@new-vintage-labs/guest-prep 0.1.2 → 0.1.3
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 +2 -2
- package/dist/guest-prep.js +29 -22
- package/dist/guest-prep.mjs +741 -708
- package/package.json +1 -1
package/dist/guest-prep.mjs
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
class
|
|
1
|
+
class ae extends Error {
|
|
2
2
|
constructor(t) {
|
|
3
3
|
super(t.kind === "tool" ? t.message : t.kind), this.failure = t;
|
|
4
4
|
}
|
|
5
5
|
}
|
|
6
|
-
const
|
|
7
|
-
function
|
|
6
|
+
const $n = ["New Vintage", "New Vintage Staging"];
|
|
7
|
+
function Xt() {
|
|
8
8
|
const e = globalThis.claude;
|
|
9
9
|
return e && typeof e.use == "function" ? e : null;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function en() {
|
|
12
12
|
const e = globalThis.openai;
|
|
13
13
|
return e && typeof e == "object" ? e : null;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
return
|
|
15
|
+
function Ce() {
|
|
16
|
+
return Xt() ? "claude" : en() ? "chatgpt" : "browser";
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function Tn(e, t) {
|
|
19
19
|
let n = t.length === 1 ? t[0] : null;
|
|
20
20
|
return async (r, s) => {
|
|
21
21
|
var l;
|
|
@@ -28,24 +28,24 @@ function $n(e, t) {
|
|
|
28
28
|
} catch (d) {
|
|
29
29
|
a.push(d);
|
|
30
30
|
}
|
|
31
|
-
throw (l = a.find((c) =>
|
|
31
|
+
throw (l = a.find((c) => ve(c).kind !== "reconnect")) != null ? l : a[0];
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
async function
|
|
35
|
-
const t =
|
|
34
|
+
async function Nn(e) {
|
|
35
|
+
const t = Xt();
|
|
36
36
|
if (t != null && t.use)
|
|
37
37
|
try {
|
|
38
38
|
const n = await Promise.race([
|
|
39
39
|
t.use("mcp"),
|
|
40
40
|
new Promise((r) => setTimeout(() => r(null), 1e4))
|
|
41
41
|
]);
|
|
42
|
-
return !n || typeof n.callTool != "function" ? null :
|
|
42
|
+
return !n || typeof n.callTool != "function" ? null : Tn(n, e ? [e] : $n);
|
|
43
43
|
} catch {
|
|
44
44
|
return null;
|
|
45
45
|
}
|
|
46
46
|
return null;
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function An(e) {
|
|
49
49
|
const t = e.content;
|
|
50
50
|
if (!Array.isArray(t)) return;
|
|
51
51
|
const n = t.find((r) => r && typeof r == "object" && r.type === "text");
|
|
@@ -56,29 +56,29 @@ function Nn(e) {
|
|
|
56
56
|
return n.text;
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function _t(e) {
|
|
60
60
|
var r, s, a;
|
|
61
|
-
if (!e || typeof e != "object") throw new
|
|
62
|
-
const t = e, n = (a = (s = (r = t.payload) != null ? r : t.structuredContent) != null ? s :
|
|
61
|
+
if (!e || typeof e != "object") throw new ae({ kind: "tool", message: "The connector returned nothing." });
|
|
62
|
+
const t = e, n = (a = (s = (r = t.payload) != null ? r : t.structuredContent) != null ? s : An(t)) != null ? a : t;
|
|
63
63
|
if (t.isError === !0 || n && typeof n == "object" && n.ok === !1) {
|
|
64
64
|
const l = n.error, c = typeof (l == null ? void 0 : l.message) == "string" ? l.message : typeof n == "string" ? n : "The New Vintage tool returned an error.";
|
|
65
|
-
throw new
|
|
65
|
+
throw new ae({ kind: "tool", message: c });
|
|
66
66
|
}
|
|
67
|
-
if (!n || typeof n != "object") throw new
|
|
67
|
+
if (!n || typeof n != "object") throw new ae({ kind: "tool", message: String(n) });
|
|
68
68
|
return n;
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function ve(e) {
|
|
71
71
|
var r, s, a;
|
|
72
|
-
if (e instanceof
|
|
72
|
+
if (e instanceof ae) return e.failure;
|
|
73
73
|
const t = String((r = e == null ? void 0 : e.code) != null ? r : ""), n = String((a = (s = e == null ? void 0 : e.message) != null ? s : e) != null ? a : "");
|
|
74
74
|
return /not_granted|consent|permission|denied/i.test(t) ? { kind: "approval" } : /server_not_connected|unauthori[sz]ed|auth|reconnect/i.test(t + " " + n) ? { kind: "reconnect" } : (e == null ? void 0 : e.retryable) === !0 || /timeout|unavailable|rate_limited|network|5\d\d/i.test(t + " " + n) ? { kind: "temporary" } : /cannot access|not in this session|tenant/i.test(n) ? { kind: "unavailable" } : { kind: "tool", message: n || "The New Vintage tool returned an error." };
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function Mn(e = Ce()) {
|
|
77
77
|
return e === "claude" ? "Reconnect New Vintage in claude.ai Settings → Connectors." : "Reconnect New Vintage in your chat's connector settings.";
|
|
78
78
|
}
|
|
79
|
-
async function
|
|
79
|
+
async function _n(e, t = {}) {
|
|
80
80
|
var s, a, l;
|
|
81
|
-
const n =
|
|
81
|
+
const n = en(), r = (s = t.followUp) != null ? s : n && typeof n.sendFollowUpMessage == "function" ? (c) => n.sendFollowUpMessage({ prompt: c, ...t.title ? { title: t.title } : {} }) : null;
|
|
82
82
|
if (r)
|
|
83
83
|
try {
|
|
84
84
|
return await r(e), { kind: "sent" };
|
|
@@ -93,7 +93,7 @@ async function Mn(e, t = {}) {
|
|
|
93
93
|
return { kind: "manual", text: e };
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
const
|
|
96
|
+
const tn = [
|
|
97
97
|
"America/Los_Angeles",
|
|
98
98
|
"America/Denver",
|
|
99
99
|
"America/Phoenix",
|
|
@@ -101,43 +101,43 @@ const en = [
|
|
|
101
101
|
"America/New_York",
|
|
102
102
|
"America/Anchorage",
|
|
103
103
|
"Pacific/Honolulu"
|
|
104
|
-
],
|
|
105
|
-
function
|
|
104
|
+
], Cn = /^\d{4}-\d{2}-\d{2}$/, En = /^[A-Za-z0-9-]{1,100}$/, Ct = /timestamptz '(\d{4}-\d{2}-\d{2}) 00:00:00 [^']*'/g, Et = /(\bfocus as \(\s*(?:--[^\n]*\n\s*)?select \* from \(\s*values )\([^()]*\)(\s*\) focus_rows \()/;
|
|
105
|
+
function se(e) {
|
|
106
106
|
throw new Error("fillGuestPrepQuery: " + e);
|
|
107
107
|
}
|
|
108
|
-
function
|
|
109
|
-
(typeof e != "string" || !
|
|
108
|
+
function zn(e) {
|
|
109
|
+
(typeof e != "string" || !Cn.test(e)) && se("day must be YYYY-MM-DD");
|
|
110
110
|
const [t, n, r] = e.split("-").map(Number), s = new Date(Date.UTC(t, n - 1, r));
|
|
111
|
-
return s.toISOString().slice(0, 10) !== e &&
|
|
111
|
+
return s.toISOString().slice(0, 10) !== e && se("bad date " + e), new Date(s.getTime() + 864e5).toISOString().slice(0, 10);
|
|
112
112
|
}
|
|
113
|
-
function
|
|
114
|
-
return e == null ? "(null::text, null::text)" : (e.source !== "commerce7" && e.source !== "tock" &&
|
|
113
|
+
function Pn(e) {
|
|
114
|
+
return e == null ? "(null::text, null::text)" : (e.source !== "commerce7" && e.source !== "tock" && se("unexpected source " + String(e.source)), (typeof e.id != "string" || !En.test(e.id)) && se("arrival id may only hold letters, digits and hyphens"), "('" + e.source + "'::text, '" + e.id + "'::text)");
|
|
115
115
|
}
|
|
116
|
-
function
|
|
116
|
+
function Ln(e, t) {
|
|
117
117
|
const n = t || {};
|
|
118
|
-
|
|
119
|
-
const r =
|
|
118
|
+
tn.indexOf(n.timeZone) < 0 && se("unsupported time zone");
|
|
119
|
+
const r = zn(n.day);
|
|
120
120
|
let s = String(e);
|
|
121
|
-
const a = Array.from(new Set(Array.from(s.matchAll(
|
|
122
|
-
a.length > 2 &&
|
|
123
|
-
const l =
|
|
124
|
-
return
|
|
121
|
+
const a = Array.from(new Set(Array.from(s.matchAll(Ct), (c) => c[1]))).sort();
|
|
122
|
+
a.length > 2 && se("expected at most two day literals"), s = s.replace(Ct, (c, d) => "timestamptz '" + (a.length === 2 && d === a[1] ? r : n.day) + " 00:00:00 " + n.timeZone + "'"), s = s.replace(/at time zone '[^']*'/gi, (c) => c.slice(0, c.indexOf("'")) + "'" + n.timeZone + "'");
|
|
123
|
+
const l = Pn(n.arrival);
|
|
124
|
+
return Et.test(s) ? s = s.replace(Et, (c, d, m) => d + l + m) : n.arrival && se("this query has no focus row"), s;
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function F(e) {
|
|
127
127
|
if (e == null || e === "") return null;
|
|
128
128
|
const t = typeof e == "number" ? e : Number(e);
|
|
129
129
|
return Number.isFinite(t) ? t : null;
|
|
130
130
|
}
|
|
131
|
-
const
|
|
132
|
-
function
|
|
131
|
+
const In = new Intl.NumberFormat("en-US", { style: "currency", currency: "USD", minimumFractionDigits: 2, maximumFractionDigits: 2 }), On = new Intl.NumberFormat("en-US", { style: "currency", currency: "USD", maximumFractionDigits: 0 });
|
|
132
|
+
function W(e) {
|
|
133
133
|
var n;
|
|
134
|
-
const t = (n =
|
|
135
|
-
return Number.isInteger(Math.round(t * 100) / 100) ?
|
|
134
|
+
const t = (n = F(e)) != null ? n : 0;
|
|
135
|
+
return Number.isInteger(Math.round(t * 100) / 100) ? On.format(t) : In.format(t);
|
|
136
136
|
}
|
|
137
137
|
function A(e, t, n = `${t}s`) {
|
|
138
138
|
return `${e} ${e === 1 ? t : n}`;
|
|
139
139
|
}
|
|
140
|
-
function
|
|
140
|
+
function Rn(e) {
|
|
141
141
|
if (e) return e;
|
|
142
142
|
try {
|
|
143
143
|
return Intl.DateTimeFormat().resolvedOptions().timeZone || "America/Los_Angeles";
|
|
@@ -145,128 +145,128 @@ function On(e) {
|
|
|
145
145
|
return "America/Los_Angeles";
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
|
-
function
|
|
148
|
+
function zt(e, t) {
|
|
149
149
|
const n = new Intl.DateTimeFormat("en-CA", { timeZone: t, year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", hourCycle: "h23" }).formatToParts(e), r = (s) => {
|
|
150
150
|
var a, l;
|
|
151
151
|
return (l = (a = n.find((c) => c.type === s)) == null ? void 0 : a.value) != null ? l : "00";
|
|
152
152
|
};
|
|
153
153
|
return { day: `${r("year")}-${r("month")}-${r("day")}`, minutes: Number(r("hour")) % 24 * 60 + Number(r("minute")) };
|
|
154
154
|
}
|
|
155
|
-
const
|
|
156
|
-
function
|
|
157
|
-
return typeof e != "string" || !
|
|
155
|
+
const Dn = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
156
|
+
function Pt(e) {
|
|
157
|
+
return typeof e != "string" || !Dn.test(e) ? !1 : xe(e).toISOString().slice(0, 10) === e;
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function xe(e) {
|
|
160
160
|
const [t, n, r] = e.split("-").map(Number);
|
|
161
161
|
return new Date(Date.UTC(t, n - 1, r));
|
|
162
162
|
}
|
|
163
|
-
function
|
|
164
|
-
return new Date(
|
|
163
|
+
function K(e, t) {
|
|
164
|
+
return new Date(xe(e).getTime() + t * 864e5).toISOString().slice(0, 10);
|
|
165
165
|
}
|
|
166
|
-
function
|
|
166
|
+
function _e(e, t) {
|
|
167
167
|
const [n, r] = e.split("-").map(Number), s = n * 12 + r - 1 + t;
|
|
168
168
|
return `${Math.floor(s / 12)}-${String(s % 12 + 1).padStart(2, "0")}`;
|
|
169
169
|
}
|
|
170
|
-
function
|
|
171
|
-
return Math.round((
|
|
170
|
+
function Ne(e, t) {
|
|
171
|
+
return Math.round((xe(t).getTime() - xe(e).getTime()) / 864e5);
|
|
172
172
|
}
|
|
173
|
-
function
|
|
174
|
-
return
|
|
173
|
+
function we(e) {
|
|
174
|
+
return xe(e).getUTCDay();
|
|
175
175
|
}
|
|
176
|
-
const
|
|
177
|
-
function
|
|
178
|
-
return `${
|
|
176
|
+
const je = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], Ee = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], nn = (e, t) => e.slice(0, 4) !== t.slice(0, 4) ? `, ${e.slice(0, 4)}` : "";
|
|
177
|
+
function rn(e, t) {
|
|
178
|
+
return `${Ee[Number(e.slice(5, 7)) - 1].slice(0, 3)} ${Number(e.slice(8, 10))}${nn(e, t)}`;
|
|
179
179
|
}
|
|
180
|
-
function
|
|
181
|
-
return `${
|
|
180
|
+
function oe(e, t) {
|
|
181
|
+
return `${je[we(e)].slice(0, 3)}, ${rn(e, t)}`;
|
|
182
182
|
}
|
|
183
|
-
function
|
|
184
|
-
return `${
|
|
183
|
+
function Ge(e, t) {
|
|
184
|
+
return `${je[we(e)]}, ${Ee[Number(e.slice(5, 7)) - 1]} ${Number(e.slice(8, 10))}${nn(e, t)}`;
|
|
185
185
|
}
|
|
186
|
-
function
|
|
187
|
-
return `${
|
|
186
|
+
function Lt(e) {
|
|
187
|
+
return `${Ee[Number(e.slice(5, 7)) - 1]} ${e.slice(0, 4)}`;
|
|
188
188
|
}
|
|
189
189
|
function qn(e) {
|
|
190
190
|
const t = /^(\d{1,2}):(\d{2})/.exec(String(e != null ? e : ""));
|
|
191
191
|
return t ? Number(t[1]) * 60 + Number(t[2]) : null;
|
|
192
192
|
}
|
|
193
|
-
function
|
|
193
|
+
function Q(e) {
|
|
194
194
|
const t = Math.floor(e / 60) % 24;
|
|
195
195
|
return `${t % 12 === 0 ? 12 : t % 12}:${String(e % 60).padStart(2, "0")} ${t < 12 ? "AM" : "PM"}`;
|
|
196
196
|
}
|
|
197
|
-
function
|
|
198
|
-
return `${
|
|
197
|
+
function Se(e, t, n) {
|
|
198
|
+
return `${oe(e, n)}, ${Q(t)}`;
|
|
199
199
|
}
|
|
200
|
-
function
|
|
200
|
+
function Fe(e) {
|
|
201
201
|
if (e <= 0) return "now";
|
|
202
202
|
const t = Math.floor(e / 60), n = e % 60;
|
|
203
203
|
return t ? n ? `in ${t} hr ${n} min` : `in ${t} hr` : `in ${n} min`;
|
|
204
204
|
}
|
|
205
|
-
function
|
|
206
|
-
const n =
|
|
205
|
+
function Vn(e, t) {
|
|
206
|
+
const n = Ne(e, t);
|
|
207
207
|
if (n <= 0) return "today";
|
|
208
208
|
if (n === 1) return "yesterday";
|
|
209
209
|
if (n < 14) return `${n} days ago`;
|
|
210
210
|
let r = (Number(t.slice(0, 4)) - Number(e.slice(0, 4))) * 12 + Number(t.slice(5, 7)) - Number(e.slice(5, 7));
|
|
211
211
|
return Number(t.slice(8, 10)) < Number(e.slice(8, 10)) && (r -= 1), r < 2 ? `${Math.max(2, Math.floor(n / 7))} weeks ago` : r < 12 ? `${r} months ago` : `${A(Math.floor(r / 12), "year")} ago`;
|
|
212
212
|
}
|
|
213
|
-
function
|
|
213
|
+
function Un(e, t) {
|
|
214
214
|
var a;
|
|
215
|
-
const n = ((a =
|
|
215
|
+
const n = ((a = F(e)) != null ? a : 0) - 1, r = Ee[n], s = F(t);
|
|
216
216
|
return r && s ? `${r} ${s}` : r != null ? r : s ? String(s) : "";
|
|
217
217
|
}
|
|
218
|
-
function
|
|
218
|
+
function It(e) {
|
|
219
219
|
const t = e.trim().toLowerCase();
|
|
220
220
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
221
221
|
}
|
|
222
|
-
const
|
|
223
|
-
function
|
|
222
|
+
const jn = "guest-prep", Ve = "guest-prep-day-arrivals";
|
|
223
|
+
function Oe(e, t) {
|
|
224
224
|
return {
|
|
225
225
|
call: async (n, r) => {
|
|
226
226
|
const s = n === "get_analysis_guide" || !t ? r : { tenantId: t, ...r };
|
|
227
227
|
try {
|
|
228
|
-
return
|
|
228
|
+
return _t(await e(n, s));
|
|
229
229
|
} catch (a) {
|
|
230
|
-
if (
|
|
231
|
-
return await new Promise((l) => setTimeout(l, 2e3)),
|
|
230
|
+
if (ve(a).kind !== "temporary") throw a;
|
|
231
|
+
return await new Promise((l) => setTimeout(l, 2e3)), _t(await e(n, s));
|
|
232
232
|
}
|
|
233
233
|
}
|
|
234
234
|
};
|
|
235
235
|
}
|
|
236
|
-
async function
|
|
236
|
+
async function Ot(e, t) {
|
|
237
237
|
var a, l, c;
|
|
238
238
|
const n = await e.call("get_analysis_guide", {
|
|
239
239
|
context: "Opening the Guest Prep briefing with the latest day query.",
|
|
240
|
-
slug:
|
|
240
|
+
slug: jn,
|
|
241
241
|
includeReferenceQueries: !0,
|
|
242
242
|
...t ? { pageSetup: t } : {}
|
|
243
243
|
}), r = (a = n.item) != null ? a : n, s = {};
|
|
244
244
|
for (const d of (l = r.referenceQueries) != null ? l : [])
|
|
245
245
|
typeof d.slug == "string" && typeof d.sqlText == "string" && (s[d.slug] = d.sqlText);
|
|
246
|
-
if (!s[
|
|
247
|
-
return { version: (c =
|
|
246
|
+
if (!s[Ve]) throw new ae({ kind: "tool", message: `The guide is missing the ${Ve} query.` });
|
|
247
|
+
return { version: (c = F(r.version)) != null ? c : 0, queries: s };
|
|
248
248
|
}
|
|
249
|
-
async function
|
|
249
|
+
async function an(e, t, n) {
|
|
250
250
|
const r = await e.call("safe_tenant_sql", { context: n, sqlText: t });
|
|
251
251
|
return { rows: Array.isArray(r.rows) ? r.rows : [], complete: r.resultMode === "complete" };
|
|
252
252
|
}
|
|
253
|
-
function
|
|
253
|
+
function Gn(e, t, n, r) {
|
|
254
254
|
try {
|
|
255
|
-
return
|
|
255
|
+
return Ln(e.queries[Ve], { timeZone: t, day: n, arrival: r });
|
|
256
256
|
} catch {
|
|
257
|
-
throw new
|
|
257
|
+
throw new ae({ kind: "needs_update" });
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
|
-
async function
|
|
260
|
+
async function Rt(e, t, n) {
|
|
261
261
|
var a;
|
|
262
|
-
const r =
|
|
262
|
+
const r = Gn(t, n.timeZone, n.day, (a = n.arrival) != null ? a : null), s = n.arrival ? "Refreshing one guest's briefing for the Guest Prep page." : "Loading one day's arrivals for the Guest Prep briefing.";
|
|
263
263
|
for (let l = 0; l < 2; l += 1) {
|
|
264
|
-
const c = await
|
|
264
|
+
const c = await an(e, r, s);
|
|
265
265
|
if (c.complete) return c.rows;
|
|
266
266
|
}
|
|
267
|
-
throw new
|
|
267
|
+
throw new ae({ kind: "tool", message: "New Vintage returned only a preview of this day, so it wasn't loaded. Try again." });
|
|
268
268
|
}
|
|
269
|
-
async function
|
|
269
|
+
async function Fn(e) {
|
|
270
270
|
var t, n;
|
|
271
271
|
try {
|
|
272
272
|
const r = await e.call("discover_tenant_data_sources", { context: "Finding which wineries the Guest Prep page can load." }), s = (t = r.accessibleTenants) != null ? t : r.tenants;
|
|
@@ -283,18 +283,18 @@ async function Gn(e) {
|
|
|
283
283
|
throw r;
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
|
-
const
|
|
287
|
-
function
|
|
286
|
+
const Bn = "Name not on file";
|
|
287
|
+
function ke(e) {
|
|
288
288
|
var t;
|
|
289
|
-
return (t = e.name) != null ? t :
|
|
289
|
+
return (t = e.name) != null ? t : Bn;
|
|
290
290
|
}
|
|
291
|
-
const Zn = /[A-Z0-9._%+-]+@[A-Z0-9-]+(?:\.[A-Z0-9-]+)*\.[A-Z]{2,}/gi,
|
|
292
|
-
function
|
|
293
|
-
const t = String(e != null ? e : "").replace(Zn, "[email]").replace(
|
|
291
|
+
const Zn = /[A-Z0-9._%+-]+@[A-Z0-9-]+(?:\.[A-Z0-9-]+)*\.[A-Z]{2,}/gi, Hn = /(?:\+?\d{1,3}[\s.-]?)?(?:\(\d{3}\)\s?|\b\d{3}[\s.-]?)\d{3}[\s.-]?\d{4}\b|\b\d{3}[\s.-]\d{4}\b/g;
|
|
292
|
+
function Dt(e) {
|
|
293
|
+
const t = String(e != null ? e : "").replace(Zn, "[email]").replace(Hn, "[phone]").replace(/\s{2,}/g, " ").replace(/\s+([,.;:!?])/g, "$1").replace(/([,;:])(?=[.!?]|$)/g, "").replace(/^[\s,;:.-]+|[\s,;:-]+$/g, "");
|
|
294
294
|
return t || null;
|
|
295
295
|
}
|
|
296
|
-
const
|
|
297
|
-
function
|
|
296
|
+
const Re = (e) => String(e != null ? e : "").trim().replace(/\s+/g, " ").toLowerCase();
|
|
297
|
+
function Yn(e) {
|
|
298
298
|
const t = (n) => (n != null ? n : []).flatMap((r) => {
|
|
299
299
|
try {
|
|
300
300
|
return [new RegExp(r, "i")];
|
|
@@ -304,7 +304,7 @@ function Hn(e) {
|
|
|
304
304
|
});
|
|
305
305
|
return { hide: t(e.hide), interests: t(e.interests), vip: t(e.vip), club: t(e.club) };
|
|
306
306
|
}
|
|
307
|
-
function
|
|
307
|
+
function Wn(e, t) {
|
|
308
308
|
var r;
|
|
309
309
|
const n = { vip: !1, interests: [], clubTags: [], accountTags: [] };
|
|
310
310
|
for (const s of e) {
|
|
@@ -319,12 +319,12 @@ function Yn(e, t) {
|
|
|
319
319
|
}
|
|
320
320
|
return n;
|
|
321
321
|
}
|
|
322
|
-
function
|
|
322
|
+
function V(e) {
|
|
323
323
|
if (e == null) return null;
|
|
324
324
|
const t = String(e).trim();
|
|
325
325
|
return t || null;
|
|
326
326
|
}
|
|
327
|
-
function
|
|
327
|
+
function Ae(e) {
|
|
328
328
|
if (Array.isArray(e)) return e;
|
|
329
329
|
if (typeof e == "string" && e.trim().startsWith("["))
|
|
330
330
|
try {
|
|
@@ -335,74 +335,74 @@ function $e(e) {
|
|
|
335
335
|
}
|
|
336
336
|
return [];
|
|
337
337
|
}
|
|
338
|
-
function
|
|
339
|
-
return typeof e == "string" && !e.trim().startsWith("[") ? e.split(",").map((t) => t.trim()).filter(Boolean) :
|
|
338
|
+
function ue(e) {
|
|
339
|
+
return typeof e == "string" && !e.trim().startsWith("[") ? e.split(",").map((t) => t.trim()).filter(Boolean) : Ae(e).map((t) => V(t)).filter((t) => !!t);
|
|
340
340
|
}
|
|
341
|
-
const
|
|
342
|
-
function
|
|
341
|
+
const Kn = (e) => /^rose$/i.test(e) ? "Rosé" : e, qt = (e) => ue(e).map((t) => t.toLowerCase());
|
|
342
|
+
function Vt(e, t) {
|
|
343
343
|
if (!/^\d{2}-\d{2}$/.test(e)) return null;
|
|
344
|
-
const n = Number(t.slice(0, 4)), s = [n - 1, n, n + 1].map((a) => `${a}-${e}`).filter((a) =>
|
|
345
|
-
return s && Math.abs(
|
|
346
|
-
}
|
|
347
|
-
function
|
|
348
|
-
const r = [], s =
|
|
349
|
-
a && r.push(a === t ? "Birthday on this day" : `Birthday ${
|
|
350
|
-
const l =
|
|
351
|
-
return c && d > 0 && r.push(`${A(d, "year")} in the club ${c === t ? "on this day" :
|
|
352
|
-
}
|
|
353
|
-
function
|
|
354
|
-
var
|
|
355
|
-
const n = e.source === "tock" ? "tock" : "commerce7", r = String((
|
|
356
|
-
var
|
|
357
|
-
return { title: (
|
|
358
|
-
}).filter((
|
|
359
|
-
for (const
|
|
360
|
-
const
|
|
361
|
-
if (!(!
|
|
344
|
+
const n = Number(t.slice(0, 4)), s = [n - 1, n, n + 1].map((a) => `${a}-${e}`).filter((a) => K(a, 0) === a).sort((a, l) => Math.abs(Ne(t, a)) - Math.abs(Ne(t, l)))[0];
|
|
345
|
+
return s && Math.abs(Ne(t, s)) <= 30 ? s : null;
|
|
346
|
+
}
|
|
347
|
+
function Jn(e, t, n) {
|
|
348
|
+
const r = [], s = V(e.bday_md), a = s ? Vt(s, t) : null;
|
|
349
|
+
a && r.push(a === t ? "Birthday on this day" : `Birthday ${oe(a, n)}`);
|
|
350
|
+
const l = V(e.club_signup), c = l && /^\d{4}-\d{2}-\d{2}$/.test(l) ? Vt(l.slice(5), t) : null, d = c && l ? Number(c.slice(0, 4)) - Number(l.slice(0, 4)) : 0;
|
|
351
|
+
return c && d > 0 && r.push(`${A(d, "year")} in the club ${c === t ? "on this day" : oe(c, n)}`), r;
|
|
352
|
+
}
|
|
353
|
+
function Qn(e, t) {
|
|
354
|
+
var B, O, H;
|
|
355
|
+
const n = e.source === "tock" ? "tock" : "commerce7", r = String((B = e.arr_id) != null ? B : ""), s = (O = F(e.party)) != null ? O : 0, a = e.visit === "First visit" ? "first" : e.visit === "Return" ? "return" : "unknown", l = Wn(ue(e.tags), t.rules), c = V(e.club_titles), d = c !== null, m = V(e.signup_tier), S = V(e.churn_tier), w = !d && qt(m).some((f) => f === "high" || f === "very high"), y = d && qt(S).some((f) => f === "medium" || f === "high"), k = V(e.last_taste), U = k ? { title: k, day: V(e.last_taste_date) } : null, D = Ae(e.last_taste_items).map((f) => f).map((f) => {
|
|
356
|
+
var C, N;
|
|
357
|
+
return { title: (C = V(f == null ? void 0 : f.title)) != null ? C : "", qty: (N = F(f == null ? void 0 : f.qty)) != null ? N : 0 };
|
|
358
|
+
}).filter((f) => f.title), z = Ae(e.notes).map((f) => f).map((f) => ({ content: Dt(f == null ? void 0 : f.content), when: Un(f == null ? void 0 : f.month, f == null ? void 0 : f.year), original: Re(f == null ? void 0 : f.content) })).filter((f) => !!f.content).slice(0, 3), j = z.map(({ content: f, when: C }) => ({ content: f, when: C })), M = new Set(z.map((f) => f.original)), h = [];
|
|
359
|
+
for (const f of Ae(e.last_taste_notes)) {
|
|
360
|
+
const C = Dt(f);
|
|
361
|
+
if (!(!C || M.has(Re(f))) && (M.add(Re(f)), h.push(C), h.length === 3))
|
|
362
362
|
break;
|
|
363
363
|
}
|
|
364
|
-
const
|
|
364
|
+
const _ = F(e.price_floor), P = F(e.price_ceiling), L = F(e.avg_unit_price), E = F(e.ltv_cents), I = F(e.order_count);
|
|
365
365
|
return {
|
|
366
366
|
key: `${n}:${r}`,
|
|
367
367
|
source: n,
|
|
368
368
|
id: r,
|
|
369
369
|
row: e,
|
|
370
|
-
minutes: (
|
|
370
|
+
minutes: (H = qn(e.t)) != null ? H : 0,
|
|
371
371
|
party: s,
|
|
372
|
-
experience:
|
|
373
|
-
name:
|
|
372
|
+
experience: V(e.experience),
|
|
373
|
+
name: V(e.name),
|
|
374
374
|
visit: a,
|
|
375
375
|
vip: l.vip,
|
|
376
376
|
clubMember: d,
|
|
377
377
|
clubTitles: c,
|
|
378
|
-
prospect:
|
|
378
|
+
prospect: w,
|
|
379
379
|
signupTier: m,
|
|
380
|
-
atRisk:
|
|
381
|
-
churnTier:
|
|
382
|
-
clubPickup:
|
|
380
|
+
atRisk: y,
|
|
381
|
+
churnTier: S,
|
|
382
|
+
clubPickup: V(e.next_ship) === t.day,
|
|
383
383
|
large: s >= t.largeParty,
|
|
384
384
|
partlyRefunded: e.refund_state === "partial",
|
|
385
|
-
occasions:
|
|
385
|
+
occasions: Jn(e, t.day, t.today),
|
|
386
386
|
interests: l.interests,
|
|
387
387
|
clubTags: l.clubTags,
|
|
388
388
|
accountTags: l.accountTags,
|
|
389
|
-
varietals:
|
|
390
|
-
wineTypes:
|
|
391
|
-
vintages:
|
|
392
|
-
appellations:
|
|
393
|
-
lastTaste:
|
|
394
|
-
bought:
|
|
395
|
-
orderNotes:
|
|
396
|
-
personalNotes:
|
|
397
|
-
price:
|
|
398
|
-
lifetime:
|
|
399
|
-
since:
|
|
389
|
+
varietals: ue(e.top_varietals).slice(0, 3),
|
|
390
|
+
wineTypes: ue(e.top_wine_types).map(Kn).slice(0, 2),
|
|
391
|
+
vintages: ue(e.top_vintages).slice(0, 3),
|
|
392
|
+
appellations: ue(e.top_appellations).slice(0, 2),
|
|
393
|
+
lastTaste: U,
|
|
394
|
+
bought: U ? { items: D, total: F(e.last_taste_spend) } : null,
|
|
395
|
+
orderNotes: h,
|
|
396
|
+
personalNotes: j,
|
|
397
|
+
price: _ !== null || P !== null || L !== null ? { floor: _, ceiling: P, avg: L } : null,
|
|
398
|
+
lifetime: E !== null && (E > 0 || (I != null ? I : 0) > 0) ? { spend: E / 100, orders: I } : null,
|
|
399
|
+
since: V(e.since_year)
|
|
400
400
|
};
|
|
401
401
|
}
|
|
402
|
-
function Qn(e, t) {
|
|
403
|
-
return e.map((n) => Jn(n, t)).map((n, r) => ({ arrival: n, index: r })).sort((n, r) => n.arrival.minutes - r.arrival.minutes || n.index - r.index).map(({ arrival: n }) => n);
|
|
404
|
-
}
|
|
405
402
|
function Xn(e, t) {
|
|
403
|
+
return e.map((n) => Qn(n, t)).map((n, r) => ({ arrival: n, index: r })).sort((n, r) => n.arrival.minutes - r.arrival.minutes || n.index - r.index).map(({ arrival: n }) => n);
|
|
404
|
+
}
|
|
405
|
+
function er(e, t) {
|
|
406
406
|
const n = [...e].sort((a, l) => a.minutes - l.minutes), r = [];
|
|
407
407
|
for (const a of n) {
|
|
408
408
|
const l = r[r.length - 1];
|
|
@@ -419,79 +419,79 @@ function Xn(e, t) {
|
|
|
419
419
|
return Array.from(l.values());
|
|
420
420
|
}).map((a) => ({ key: String(a[0].minutes), first: a[0].minutes, last: a[a.length - 1].minutes, arrivals: a }));
|
|
421
421
|
}
|
|
422
|
-
function
|
|
422
|
+
function tr(e) {
|
|
423
423
|
const t = [], n = e.filter((a) => a.vip).length, r = e.filter((a) => a.large).length, s = e.filter((a) => a.clubPickup).length;
|
|
424
424
|
return n && t.push(A(n, "VIP")), r && t.push(A(r, "large party", "large parties")), s && t.push(A(s, "club pickup")), t.length ? t.join(", ") : null;
|
|
425
425
|
}
|
|
426
|
-
const
|
|
426
|
+
const sn = [
|
|
427
427
|
{ id: "vip", label: "VIP", test: (e) => e.vip },
|
|
428
428
|
{ id: "first", label: "First visit", test: (e) => e.visit === "first" },
|
|
429
429
|
{ id: "club", label: "Club member", test: (e) => e.clubMember },
|
|
430
430
|
{ id: "large", label: "Large party", test: (e) => e.large }
|
|
431
431
|
];
|
|
432
|
-
function
|
|
432
|
+
function Ut(e) {
|
|
433
433
|
return e.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase().trim();
|
|
434
434
|
}
|
|
435
|
-
function
|
|
435
|
+
function jt(e, t, n) {
|
|
436
436
|
var s;
|
|
437
|
-
const r =
|
|
438
|
-
return r && !
|
|
437
|
+
const r = Ut(t);
|
|
438
|
+
return r && !Ut((s = e.name) != null ? s : "").includes(r) ? !1 : sn.every((a) => !n.includes(a.id) || a.test(e));
|
|
439
439
|
}
|
|
440
|
-
function
|
|
440
|
+
function Ue(e, t) {
|
|
441
441
|
return e < t ? "past" : e > t ? "future" : "today";
|
|
442
442
|
}
|
|
443
|
-
function
|
|
443
|
+
function on(e, t, n) {
|
|
444
444
|
return t !== "today" ? { upcoming: e, earlier: [] } : { upcoming: e.filter((r) => r.minutes >= n), earlier: e.filter((r) => r.minutes < n) };
|
|
445
445
|
}
|
|
446
|
-
function
|
|
446
|
+
function nr(e, t, n) {
|
|
447
447
|
if (t !== "today") return null;
|
|
448
448
|
const r = e.minutes - n;
|
|
449
|
-
return r >= 0 && r <= 120 ?
|
|
449
|
+
return r >= 0 && r <= 120 ? Fe(r) : null;
|
|
450
450
|
}
|
|
451
|
-
function
|
|
452
|
-
const t = e.slice(0, 2).map(
|
|
451
|
+
function rr(e) {
|
|
452
|
+
const t = e.slice(0, 2).map(ke).join(", ");
|
|
453
453
|
return e.length > 2 ? `${t} and ${e.length - 2} more` : t;
|
|
454
454
|
}
|
|
455
|
-
function
|
|
456
|
-
return n.length ? n.length === 1 ? { label: e, value:
|
|
455
|
+
function De(e, t, n, r, s) {
|
|
456
|
+
return n.length ? n.length === 1 ? { label: e, value: ke(n[0]), detail: Se(r, n[0].minutes, s) } : { label: t, value: A(n.length, "guest"), detail: rr(n) } : null;
|
|
457
457
|
}
|
|
458
|
-
function
|
|
458
|
+
function Gt(e, t, n) {
|
|
459
459
|
const r = [];
|
|
460
|
-
r.push(
|
|
460
|
+
r.push(De("Club pickup", "Club pickups", e.filter((a) => a.clubPickup), t, n));
|
|
461
461
|
const s = e.filter((a) => a.large);
|
|
462
|
-
if (s.length === 1) r.push({ label: "Large party", value: `Party of ${s[0].party}`, detail:
|
|
462
|
+
if (s.length === 1) r.push({ label: "Large party", value: `Party of ${s[0].party}`, detail: Se(t, s[0].minutes, n) });
|
|
463
463
|
else if (s.length > 1) {
|
|
464
|
-
const a = s.reduce((c, d) => c + d.party, 0), l = s.slice(0, 2).map((c) => `${
|
|
464
|
+
const a = s.reduce((c, d) => c + d.party, 0), l = s.slice(0, 2).map((c) => `${Q(c.minutes)} for ${c.party}`).join(", ");
|
|
465
465
|
r.push({
|
|
466
466
|
label: "Large parties",
|
|
467
467
|
value: `${A(s.length, "party", "parties")}, ${A(a, "guest")}`,
|
|
468
|
-
detail: `${
|
|
468
|
+
detail: `${oe(t, n)}, ${l}${s.length > 2 ? ` and ${s.length - 2} more` : ""}`
|
|
469
469
|
});
|
|
470
470
|
}
|
|
471
|
-
return r.push(
|
|
471
|
+
return r.push(De("VIP", "VIPs", e.filter((a) => a.vip), t, n)), r.push(De("Club prospect", "Club prospects", e.filter((a) => a.prospect), t, n)), r.filter((a) => a !== null);
|
|
472
472
|
}
|
|
473
|
-
function
|
|
473
|
+
function ar(e, t, n) {
|
|
474
474
|
var c;
|
|
475
475
|
const r = /* @__PURE__ */ new Map();
|
|
476
476
|
for (const d of e) {
|
|
477
|
-
const m = Math.floor(d.minutes / 30) * 30,
|
|
478
|
-
r.set(m, { parties:
|
|
477
|
+
const m = Math.floor(d.minutes / 30) * 30, S = (c = r.get(m)) != null ? c : { parties: 0, guests: 0 };
|
|
478
|
+
r.set(m, { parties: S.parties + 1, guests: S.guests + d.party });
|
|
479
479
|
}
|
|
480
480
|
const s = Array.from(r.entries()).sort((d, m) => m[1].guests - d[1].guests || m[1].parties - d[1].parties || d[0] - m[0])[0];
|
|
481
481
|
if (!s) return null;
|
|
482
482
|
const [a, l] = s;
|
|
483
483
|
return {
|
|
484
484
|
label: "Busiest half hour",
|
|
485
|
-
value: `${
|
|
486
|
-
detail: `${
|
|
485
|
+
value: `${Q(a)} to ${Q(a + 30)}`,
|
|
486
|
+
detail: `${oe(t, n)}, ${A(l.parties, "party", "parties")}, ${A(l.guests, "guest")}`
|
|
487
487
|
};
|
|
488
488
|
}
|
|
489
|
-
function
|
|
490
|
-
const s = { reservations: e.length, guests: e.reduce((m,
|
|
489
|
+
function sr(e, t, n, r) {
|
|
490
|
+
const s = { reservations: e.length, guests: e.reduce((m, S) => m + S.party, 0) };
|
|
491
491
|
if (!e.length) return { ...s, message: "No reservations on this day", facts: [] };
|
|
492
|
-
const a =
|
|
492
|
+
const a = Ue(t, n);
|
|
493
493
|
if (a === "past") return { ...s, message: "This day has passed", facts: [] };
|
|
494
|
-
const { upcoming: l, earlier: c } =
|
|
494
|
+
const { upcoming: l, earlier: c } = on(e, a, r);
|
|
495
495
|
if (!l.length) return { ...s, message: "No more arrivals today", facts: [] };
|
|
496
496
|
if (c.length) {
|
|
497
497
|
const m = l[0];
|
|
@@ -500,23 +500,23 @@ function ar(e, t, n, r) {
|
|
|
500
500
|
message: null,
|
|
501
501
|
facts: [
|
|
502
502
|
{ label: "Still to arrive", value: `${l.length} of ${e.length}` },
|
|
503
|
-
{ label: "Next arrival", value:
|
|
504
|
-
...
|
|
503
|
+
{ label: "Next arrival", value: Se(t, m.minutes, n), detail: Fe(m.minutes - r) },
|
|
504
|
+
...Gt(l, t, n)
|
|
505
505
|
]
|
|
506
506
|
};
|
|
507
507
|
}
|
|
508
|
-
const d =
|
|
508
|
+
const d = Gt(l, t, n);
|
|
509
509
|
if (!d.length) {
|
|
510
|
-
const m =
|
|
510
|
+
const m = ar(l, t, n);
|
|
511
511
|
m && d.push(m);
|
|
512
512
|
}
|
|
513
513
|
return { ...s, message: null, facts: d };
|
|
514
514
|
}
|
|
515
|
-
function
|
|
515
|
+
function or(e) {
|
|
516
516
|
return new Set(e.map((n) => n.source)).size === 1 ? e[0].source : null;
|
|
517
517
|
}
|
|
518
|
-
const
|
|
519
|
-
function
|
|
518
|
+
const Be = { commerce7: "Commerce7", tock: "Tock" }, ir = "Load Guest Prep day";
|
|
519
|
+
function lr(e) {
|
|
520
520
|
var n;
|
|
521
521
|
const t = ((n = e.wineryName) == null ? void 0 : n.trim()) || "this winery";
|
|
522
522
|
return [
|
|
@@ -529,30 +529,30 @@ function or(e) {
|
|
|
529
529
|
"Do not use exports or invent guests."
|
|
530
530
|
].join(" ");
|
|
531
531
|
}
|
|
532
|
-
const
|
|
533
|
-
function
|
|
532
|
+
const cr = "0.1.3", ye = (e, t) => String(e != null ? e : "").replace(/\s+/g, " ").trim().slice(0, t);
|
|
533
|
+
function ur(e = {}, t = []) {
|
|
534
534
|
var n, r, s, a, l, c;
|
|
535
535
|
return {
|
|
536
|
-
packageVersion:
|
|
537
|
-
hiddenSections: ((n = e.hide) != null ? n : []).slice(0, 20).map((d) =>
|
|
536
|
+
packageVersion: cr,
|
|
537
|
+
hiddenSections: ((n = e.hide) != null ? n : []).slice(0, 20).map((d) => ye(d, 40)),
|
|
538
538
|
// Guest Prep has one view and no reordering.
|
|
539
539
|
reorderedViews: [],
|
|
540
|
-
renamedSections: Object.keys((r = e.labels) != null ? r : {}).slice(0, 20).map((d) =>
|
|
540
|
+
renamedSections: Object.keys((r = e.labels) != null ? r : {}).slice(0, 20).map((d) => ye(d, 40)),
|
|
541
541
|
themeChanged: Object.keys((s = e.theme) != null ? s : {}).length + Object.keys((a = e.themeDark) != null ? a : {}).length > 0,
|
|
542
542
|
fontsChanged: !!((l = e.fonts) != null && l.display || (c = e.fonts) != null && c.body),
|
|
543
543
|
titleChanged: !!e.title,
|
|
544
544
|
customCards: t.slice(0, 10).map((d) => {
|
|
545
545
|
var m;
|
|
546
|
-
return { title:
|
|
546
|
+
return { title: ye(d.title, 80), purpose: ye(d.purpose, 160), view: ye((m = d.after) != null ? m : "page", 20) };
|
|
547
547
|
})
|
|
548
548
|
};
|
|
549
549
|
}
|
|
550
|
-
const
|
|
551
|
-
function
|
|
550
|
+
const Ft = "guest-prep.tenant", Bt = (e) => `guest-prep:${e}`;
|
|
551
|
+
function dr() {
|
|
552
552
|
const e = globalThis.storage;
|
|
553
553
|
return e && typeof e.get == "function" && typeof e.set == "function" ? e : null;
|
|
554
554
|
}
|
|
555
|
-
function
|
|
555
|
+
function pr() {
|
|
556
556
|
try {
|
|
557
557
|
const e = globalThis.localStorage, t = "__nv_probe__";
|
|
558
558
|
return e.setItem(t, "1"), e.removeItem(t), e;
|
|
@@ -560,29 +560,29 @@ function dr() {
|
|
|
560
560
|
return null;
|
|
561
561
|
}
|
|
562
562
|
}
|
|
563
|
-
function
|
|
563
|
+
function gr(e) {
|
|
564
564
|
return typeof e == "string" ? e : e && typeof e == "object" && typeof e.value == "string" ? e.value : null;
|
|
565
565
|
}
|
|
566
|
-
function
|
|
566
|
+
function fr(e) {
|
|
567
567
|
if (e) return { adapter: e, mode: "artifact" };
|
|
568
|
-
const t =
|
|
568
|
+
const t = dr();
|
|
569
569
|
if (t)
|
|
570
570
|
return {
|
|
571
571
|
mode: "artifact",
|
|
572
572
|
adapter: {
|
|
573
|
-
get: async (r, s) =>
|
|
573
|
+
get: async (r, s) => gr(await t.get(r, s)),
|
|
574
574
|
set: async (r, s, a) => {
|
|
575
575
|
await t.set(r, s, a);
|
|
576
576
|
}
|
|
577
577
|
}
|
|
578
578
|
};
|
|
579
|
-
const n =
|
|
579
|
+
const n = pr();
|
|
580
580
|
return n ? {
|
|
581
581
|
mode: "browser",
|
|
582
582
|
adapter: { get: async (r) => n.getItem(r), set: async (r, s) => n.setItem(r, s) }
|
|
583
583
|
} : { adapter: null, mode: "none" };
|
|
584
584
|
}
|
|
585
|
-
async function
|
|
585
|
+
async function Zt(e, t) {
|
|
586
586
|
if (!e) return null;
|
|
587
587
|
try {
|
|
588
588
|
return await e.get(t, !1);
|
|
@@ -590,14 +590,14 @@ async function Ft(e, t) {
|
|
|
590
590
|
return null;
|
|
591
591
|
}
|
|
592
592
|
}
|
|
593
|
-
async function
|
|
593
|
+
async function Ht(e, t, n) {
|
|
594
594
|
if (e)
|
|
595
595
|
try {
|
|
596
596
|
await e.set(t, n, !1);
|
|
597
597
|
} catch {
|
|
598
598
|
}
|
|
599
599
|
}
|
|
600
|
-
function
|
|
600
|
+
function mr(e) {
|
|
601
601
|
if (!e) return null;
|
|
602
602
|
try {
|
|
603
603
|
const t = JSON.parse(e);
|
|
@@ -606,7 +606,7 @@ function fr(e) {
|
|
|
606
606
|
return null;
|
|
607
607
|
}
|
|
608
608
|
}
|
|
609
|
-
const
|
|
609
|
+
const hr = {
|
|
610
610
|
"surface-base": "#f7f5f1",
|
|
611
611
|
"surface-subtle": "#f2efea",
|
|
612
612
|
"surface-raised": "#ffffff",
|
|
@@ -624,7 +624,7 @@ const mr = {
|
|
|
624
624
|
"status-warning-bg": "#fff7e7",
|
|
625
625
|
"font-display": "'Newsreader', Georgia, serif",
|
|
626
626
|
"font-body": "'Be Vietnam Pro', system-ui, sans-serif"
|
|
627
|
-
},
|
|
627
|
+
}, yr = {
|
|
628
628
|
"surface-base": "#171614",
|
|
629
629
|
"surface-subtle": "#24211f",
|
|
630
630
|
"surface-raised": "#34302d",
|
|
@@ -640,18 +640,18 @@ const mr = {
|
|
|
640
640
|
"focus-ring-color": "#8cd0a0",
|
|
641
641
|
"status-warning": "#f0c36a",
|
|
642
642
|
"status-warning-bg": "rgba(240,195,106,.16)"
|
|
643
|
-
},
|
|
644
|
-
function
|
|
645
|
-
return Object.entries(e).filter(([t, n]) =>
|
|
643
|
+
}, br = /^[a-z][a-z0-9-]{0,40}$/, vr = /^[^;{}<>\\]{1,120}$/;
|
|
644
|
+
function Yt(e) {
|
|
645
|
+
return Object.entries(e).filter(([t, n]) => br.test(t) && typeof n == "string" && vr.test(n)).map(([t, n]) => `--${t}:${n};`).join("");
|
|
646
646
|
}
|
|
647
|
-
function
|
|
647
|
+
function xr(e) {
|
|
648
648
|
return `https://fonts.googleapis.com/css2?${e.map((n) => `family=${encodeURIComponent(n).replace(/%20/g, "+")}:wght@300;400;500;600`).join("&")}&display=swap`;
|
|
649
649
|
}
|
|
650
|
-
function
|
|
651
|
-
const n =
|
|
650
|
+
function wr(e = {}, t = {}) {
|
|
651
|
+
const n = Yt({ ...hr, ...e }), r = Yt({ ...yr, ...t });
|
|
652
652
|
return `:root,.nvgp{${n}}@media (prefers-color-scheme: dark){:root,.nvgp{${r}}}`;
|
|
653
653
|
}
|
|
654
|
-
const
|
|
654
|
+
const re = "120ms cubic-bezier(0.2,0,0.2,1)", kr = `
|
|
655
655
|
html,body{margin:0;background:var(--surface-base,#f7f5f1)}
|
|
656
656
|
.nvgp{background:var(--surface-base);color:var(--text-primary);font:16px/1.5 var(--font-body);-webkit-font-smoothing:antialiased;min-height:100vh;overflow-x:clip}
|
|
657
657
|
.nvgp *{box-sizing:border-box}
|
|
@@ -672,7 +672,7 @@ html,body{margin:0;background:var(--surface-base,#f7f5f1)}
|
|
|
672
672
|
.nvgp .storage-note{font-size:13px;color:var(--text-tertiary);margin:0 0 8px}
|
|
673
673
|
.nvgp .daybar{position:sticky;top:0;z-index:20;background:var(--surface-base);display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px;padding:12px 0;padding-top:max(12px,env(safe-area-inset-top))}
|
|
674
674
|
.nvgp .day-wrap{position:relative;max-width:100%}
|
|
675
|
-
.nvgp .day-button{display:inline-flex;align-items:center;gap:8px;min-height:40px;max-width:100%;padding:0 14px;border:1px solid var(--border-default);border-radius:10px;background:var(--surface-raised);font-size:15px;font-weight:600;cursor:pointer;transition:border-color ${
|
|
675
|
+
.nvgp .day-button{display:inline-flex;align-items:center;gap:8px;min-height:40px;max-width:100%;padding:0 14px;border:1px solid var(--border-default);border-radius:10px;background:var(--surface-raised);font-size:15px;font-weight:600;cursor:pointer;transition:border-color ${re}}
|
|
676
676
|
.nvgp .day-button:hover{border-color:var(--border-strong)}
|
|
677
677
|
.nvgp .day-button svg{flex:none;color:var(--text-secondary)}
|
|
678
678
|
.nvgp .day-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
@@ -715,24 +715,29 @@ html,body{margin:0;background:var(--surface-base,#f7f5f1)}
|
|
|
715
715
|
.nvgp .search:focus-within{outline:2px solid var(--focus-ring-color);outline-offset:2px}
|
|
716
716
|
.nvgp .search-input{flex:1;min-width:0;border:0;background:none;color:var(--text-primary);font:inherit;font-size:15px;outline:none}
|
|
717
717
|
.nvgp .filters{display:flex;flex-wrap:wrap;gap:8px}
|
|
718
|
-
.nvgp .filter-chip{display:inline-flex;align-items:center;min-height:32px;padding:0 12px;border:1px solid var(--border-default);border-radius:999px;background:var(--surface-raised);color:var(--text-primary);font:inherit;font-size:13px;font-weight:500;cursor:pointer;transition:background ${
|
|
718
|
+
.nvgp .filter-chip{display:inline-flex;align-items:center;min-height:32px;padding:0 12px;border:1px solid var(--border-default);border-radius:999px;background:var(--surface-raised);color:var(--text-primary);font:inherit;font-size:13px;font-weight:500;cursor:pointer;transition:background ${re},border-color ${re}}
|
|
719
719
|
.nvgp .filter-chip:hover{border-color:var(--text-tertiary)}
|
|
720
720
|
.nvgp .filter-chip[aria-pressed="true"]{background:var(--action-primary-bg);border-color:var(--action-primary-bg);color:var(--action-primary-fg)}
|
|
721
|
-
.nvgp .
|
|
722
|
-
.nvgp .
|
|
723
|
-
.nvgp .
|
|
724
|
-
.nvgp .
|
|
725
|
-
.nvgp .
|
|
726
|
-
.nvgp .
|
|
727
|
-
.nvgp .seat-
|
|
728
|
-
.nvgp .seat-
|
|
729
|
-
.nvgp .seat-
|
|
721
|
+
.nvgp .list-results{padding:12px 16px 16px}
|
|
722
|
+
.nvgp .list-tools{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:4px 16px;min-height:32px;padding:0 4px 8px;font-size:14px;color:var(--text-secondary)}
|
|
723
|
+
.nvgp .list-tools-actions{display:flex;gap:16px;margin-left:auto}
|
|
724
|
+
.nvgp .link-button{min-height:32px;padding:0;border:0;background:none;color:var(--action-primary-bg);font:inherit;font-size:14px;font-weight:500;cursor:pointer}
|
|
725
|
+
.nvgp .seatings{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:12px}
|
|
726
|
+
.nvgp .seating{border:1px solid var(--border-default);border-radius:12px;background:var(--surface-raised);overflow:clip}
|
|
727
|
+
.nvgp .seat-head{position:sticky;top:var(--seat-top,0px);z-index:5;display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px;width:100%;min-height:52px;padding:10px 16px;border:0;background:var(--surface-subtle);color:var(--text-primary);font:inherit;text-align:left;cursor:pointer;transition:background ${re}}
|
|
728
|
+
.nvgp .seat-head:hover{background:var(--border-subtle)}
|
|
729
|
+
.nvgp .seating[data-open="true"] .seat-head{border-bottom:1px solid var(--border-default)}
|
|
730
|
+
.nvgp .seating[data-open="false"] .seat-head{position:static}
|
|
731
|
+
.nvgp .seat-chevron{display:inline-flex;flex:none;color:var(--text-secondary);transition:transform ${re}}
|
|
732
|
+
.nvgp .seating[data-open="false"] .seat-chevron{transform:rotate(-90deg)}
|
|
733
|
+
.nvgp .seat-time{font:400 20px/1.25 var(--font-display);font-variant-numeric:tabular-nums}
|
|
734
|
+
.nvgp .seat-counts{margin-left:auto;font-size:13px;color:var(--text-secondary);text-align:right;font-variant-numeric:tabular-nums}
|
|
735
|
+
.nvgp .seat-marker{flex:none;padding:0 10px;border-radius:999px;font-size:12px;font-weight:600;line-height:22px}
|
|
730
736
|
.nvgp .seat-now{background:var(--action-primary-bg);color:var(--action-primary-fg)}
|
|
731
|
-
.nvgp .seat-next{border:1px solid var(--action-primary-bg);color:var(--action-primary-bg)}
|
|
732
|
-
.nvgp .
|
|
733
|
-
.nvgp .
|
|
734
|
-
.nvgp .
|
|
735
|
-
.nvgp .row{display:grid;grid-template-columns:88px minmax(0,1fr) auto;gap:12px;width:100%;padding:12px 24px;border:0;border-bottom:1px solid var(--border-subtle);border-left:3px solid transparent;background:none;text-align:left;cursor:pointer;transition:background ${me}}
|
|
737
|
+
.nvgp .seat-next{border:1px solid var(--action-primary-bg);color:var(--action-primary-bg);line-height:20px}
|
|
738
|
+
.nvgp .seating .rows li:last-child .row{border-bottom:0}
|
|
739
|
+
.nvgp .seatings .earlier-head{padding:8px 4px 0;background:none;border:0}
|
|
740
|
+
.nvgp .row{display:grid;grid-template-columns:88px minmax(0,1fr) auto;gap:12px;width:100%;padding:12px 24px;border:0;border-bottom:1px solid var(--border-subtle);border-left:3px solid transparent;background:none;text-align:left;cursor:pointer;transition:background ${re}}
|
|
736
741
|
.nvgp .row:hover{background:var(--surface-subtle)}
|
|
737
742
|
.nvgp .row[aria-current="true"]{border-left-color:var(--action-primary-bg);background:var(--surface-subtle)}
|
|
738
743
|
.nvgp .row-time{font-weight:600;font-variant-numeric:tabular-nums}
|
|
@@ -753,7 +758,7 @@ html,body{margin:0;background:var(--surface-base,#f7f5f1)}
|
|
|
753
758
|
.nvgp .empty-title{font:300 22px/1.3 var(--font-display);color:var(--text-primary);margin:0 0 8px}
|
|
754
759
|
.nvgp .note{font-size:14px;color:var(--text-secondary);margin:8px 0 0}
|
|
755
760
|
.nvgp .problem{color:var(--status-warning)}
|
|
756
|
-
.nvgp .button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:40px;padding:0 16px;border:0;border-radius:8px;background:var(--action-primary-bg);color:var(--action-primary-fg);font-weight:500;cursor:pointer;transition:background ${
|
|
761
|
+
.nvgp .button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:40px;padding:0 16px;border:0;border-radius:8px;background:var(--action-primary-bg);color:var(--action-primary-fg);font-weight:500;cursor:pointer;transition:background ${re}}
|
|
757
762
|
.nvgp .button:hover{background:var(--action-primary-hover)}
|
|
758
763
|
.nvgp .button:disabled{opacity:.55;cursor:default}
|
|
759
764
|
.nvgp .button-quiet{background:transparent;color:var(--text-primary);border:1px solid var(--border-strong)}
|
|
@@ -825,16 +830,18 @@ html,body{margin:0;background:var(--surface-base,#f7f5f1)}
|
|
|
825
830
|
.nvgp .row{grid-template-columns:72px minmax(0,1fr) auto;padding:12px 16px;min-height:44px}
|
|
826
831
|
.nvgp .earlier-head{padding:8px 16px}
|
|
827
832
|
.nvgp .finder{padding:12px 16px}
|
|
828
|
-
.nvgp .search,.nvgp .filter-chip,.nvgp .link-button
|
|
829
|
-
.nvgp .
|
|
830
|
-
.nvgp .seat-head{padding:8px
|
|
833
|
+
.nvgp .search,.nvgp .filter-chip,.nvgp .link-button{min-height:44px}
|
|
834
|
+
.nvgp .list-results{padding:8px 8px 12px}
|
|
835
|
+
.nvgp .seat-head{padding:8px 12px}
|
|
836
|
+
.nvgp .seating .row{grid-template-columns:76px minmax(0,1fr) auto;gap:8px;padding:12px}
|
|
837
|
+
.nvgp .seat-counts{flex-basis:100%;margin-left:28px;text-align:left}
|
|
831
838
|
.nvgp .panel-body{padding:0 16px 24px}
|
|
832
839
|
.nvgp .fact-row{grid-template-columns:repeat(2,minmax(0,1fr))}
|
|
833
840
|
.nvgp .fact-grid{grid-template-columns:minmax(0,1fr)}
|
|
834
841
|
.nvgp .custom-card{padding:12px 16px}
|
|
835
842
|
}
|
|
836
843
|
@media (prefers-reduced-motion: reduce){.nvgp *{transition-duration:0ms!important;animation:none!important}}
|
|
837
|
-
`,
|
|
844
|
+
`, Sr = ["summary", "guestList"], ln = ["reservation", "talkAbout", "newVintageProfile", "relationship", "headsUp", "personalNotes"], na = [...Sr, ...ln], be = {
|
|
838
845
|
timeZone: "America/Los_Angeles",
|
|
839
846
|
largeParty: 10,
|
|
840
847
|
seatingGapMinutes: 45,
|
|
@@ -845,23 +852,23 @@ html,body{margin:0;background:var(--surface-base,#f7f5f1)}
|
|
|
845
852
|
hide: ["^\\*+\\s*test\\s*\\*+$", "^test\\b"]
|
|
846
853
|
}
|
|
847
854
|
};
|
|
848
|
-
function
|
|
855
|
+
function o(e, t = null, ...n) {
|
|
849
856
|
const r = document.createElement(e);
|
|
850
857
|
for (const [s, a] of Object.entries(t != null ? t : {}))
|
|
851
858
|
a == null || a === !1 || (typeof a == "function" ? r.addEventListener(s.replace(/^on/, "").toLowerCase(), a) : a === !0 ? r.setAttribute(s, "") : r.setAttribute(s, String(a)));
|
|
852
|
-
return
|
|
859
|
+
return cn(r, n), r;
|
|
853
860
|
}
|
|
854
|
-
function
|
|
861
|
+
function cn(e, t) {
|
|
855
862
|
for (const n of t)
|
|
856
|
-
n == null || n === !1 || (Array.isArray(n) ?
|
|
863
|
+
n == null || n === !1 || (Array.isArray(n) ? cn(e, n) : e.append(n instanceof Node ? n : String(n)));
|
|
857
864
|
}
|
|
858
|
-
const
|
|
859
|
-
function
|
|
860
|
-
const r = document.createElementNS(
|
|
865
|
+
const $r = "http://www.w3.org/2000/svg";
|
|
866
|
+
function Wt(e, t = {}, ...n) {
|
|
867
|
+
const r = document.createElementNS($r, e);
|
|
861
868
|
for (const [s, a] of Object.entries(t)) r.setAttribute(s, String(a));
|
|
862
869
|
return r.append(...n), r;
|
|
863
870
|
}
|
|
864
|
-
const
|
|
871
|
+
const Tr = {
|
|
865
872
|
"chevron-left": ["M15 18l-6-6 6-6"],
|
|
866
873
|
"chevron-right": ["M9 18l6-6-6-6"],
|
|
867
874
|
"chevron-down": ["M6 9l6 6 6-6"],
|
|
@@ -875,76 +882,76 @@ const $r = {
|
|
|
875
882
|
x: ["M18 6L6 18", "M6 6l12 12"],
|
|
876
883
|
"refresh-cw": ["M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", "M21 3v5h-5", "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", "M8 16H3v5"]
|
|
877
884
|
};
|
|
878
|
-
function
|
|
885
|
+
function J(e, t = 16) {
|
|
879
886
|
var n;
|
|
880
|
-
return
|
|
887
|
+
return Wt(
|
|
881
888
|
"svg",
|
|
882
889
|
{ width: t, height: t, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": 2, "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true" },
|
|
883
|
-
...((n =
|
|
890
|
+
...((n = Tr[e]) != null ? n : []).map((r) => Wt("path", { d: r }))
|
|
884
891
|
);
|
|
885
892
|
}
|
|
886
|
-
function
|
|
887
|
-
return
|
|
893
|
+
function R(e, t = "note") {
|
|
894
|
+
return o("p", { class: t }, e);
|
|
888
895
|
}
|
|
889
|
-
function
|
|
890
|
-
return
|
|
896
|
+
function $(e, t, n, r = "") {
|
|
897
|
+
return o(
|
|
891
898
|
"div",
|
|
892
899
|
{ class: `fact${r ? ` ${r}` : ""}` },
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
n ?
|
|
900
|
+
o("div", { class: "fact-label" }, e),
|
|
901
|
+
o("div", { class: "fact-value" }, t),
|
|
902
|
+
n ? o("div", { class: "fact-detail" }, n) : null
|
|
896
903
|
);
|
|
897
904
|
}
|
|
898
|
-
function
|
|
899
|
-
return
|
|
900
|
-
}
|
|
901
|
-
function cn(e) {
|
|
902
|
-
return i("span", { class: `badge${e === "VIP" ? " badge-vip" : ""}` }, e);
|
|
905
|
+
function Me(e, t = "neutral") {
|
|
906
|
+
return o("div", { class: "chips" }, e.map((n) => o("span", { class: `chip chip-${t}` }, n)));
|
|
903
907
|
}
|
|
904
908
|
function un(e) {
|
|
905
|
-
return
|
|
909
|
+
return o("span", { class: `badge${e === "VIP" ? " badge-vip" : ""}` }, e);
|
|
910
|
+
}
|
|
911
|
+
function dn(e) {
|
|
912
|
+
return Number(K(`${_e(e, 1)}-01`, -1).slice(8, 10));
|
|
906
913
|
}
|
|
907
|
-
function
|
|
908
|
-
const n =
|
|
909
|
-
return `${n}-${String(Math.min(Number(e.slice(8, 10)),
|
|
914
|
+
function Kt(e, t) {
|
|
915
|
+
const n = _e(e.slice(0, 7), t);
|
|
916
|
+
return `${n}-${String(Math.min(Number(e.slice(8, 10)), dn(n))).padStart(2, "0")}`;
|
|
910
917
|
}
|
|
911
|
-
function
|
|
912
|
-
const t = `${e}-01`, n = Array.from({ length:
|
|
913
|
-
for (let r = 0; r <
|
|
918
|
+
function Nr(e) {
|
|
919
|
+
const t = `${e}-01`, n = Array.from({ length: we(t) }, () => null);
|
|
920
|
+
for (let r = 0; r < dn(e); r += 1) n.push(K(t, r));
|
|
914
921
|
return n;
|
|
915
922
|
}
|
|
916
|
-
function
|
|
923
|
+
function Ar(e, t) {
|
|
917
924
|
switch (t) {
|
|
918
925
|
case "ArrowLeft":
|
|
919
|
-
return
|
|
926
|
+
return K(e, -1);
|
|
920
927
|
case "ArrowRight":
|
|
921
|
-
return
|
|
928
|
+
return K(e, 1);
|
|
922
929
|
case "ArrowUp":
|
|
923
|
-
return
|
|
930
|
+
return K(e, -7);
|
|
924
931
|
case "ArrowDown":
|
|
925
|
-
return
|
|
932
|
+
return K(e, 7);
|
|
926
933
|
case "PageUp":
|
|
927
|
-
return
|
|
934
|
+
return Kt(e, -1);
|
|
928
935
|
case "PageDown":
|
|
929
|
-
return
|
|
936
|
+
return Kt(e, 1);
|
|
930
937
|
case "Home":
|
|
931
|
-
return
|
|
938
|
+
return K(e, -we(e));
|
|
932
939
|
case "End":
|
|
933
|
-
return
|
|
940
|
+
return K(e, 6 - we(e));
|
|
934
941
|
default:
|
|
935
942
|
return null;
|
|
936
943
|
}
|
|
937
944
|
}
|
|
938
|
-
function
|
|
939
|
-
const { state: t } = e, n =
|
|
940
|
-
if (!a) return
|
|
945
|
+
function Mr(e) {
|
|
946
|
+
const { state: t } = e, n = Nr(t.month).map((a, l) => {
|
|
947
|
+
if (!a) return o("span", { "aria-hidden": "true", "data-blank": l });
|
|
941
948
|
const c = a === t.focus;
|
|
942
|
-
return
|
|
949
|
+
return o(
|
|
943
950
|
"button",
|
|
944
951
|
{
|
|
945
952
|
type: "button",
|
|
946
953
|
class: `cal-day${a === e.today ? " is-today" : ""}`,
|
|
947
|
-
"aria-label":
|
|
954
|
+
"aria-label": Ge(a, e.today) + (a === e.today ? ", today" : ""),
|
|
948
955
|
"aria-selected": a === e.selected ? "true" : "false",
|
|
949
956
|
"aria-current": a === e.today ? "date" : null,
|
|
950
957
|
tabindex: c ? 0 : -1,
|
|
@@ -954,25 +961,25 @@ function Ar(e) {
|
|
|
954
961
|
},
|
|
955
962
|
String(Number(a.slice(8, 10)))
|
|
956
963
|
);
|
|
957
|
-
}), r =
|
|
964
|
+
}), r = o(
|
|
958
965
|
"div",
|
|
959
|
-
{ class: "cal-grid", role: "group", "aria-label":
|
|
960
|
-
|
|
966
|
+
{ class: "cal-grid", role: "group", "aria-label": Lt(t.month) },
|
|
967
|
+
je.map((a) => o("span", { class: "cal-dow", "aria-hidden": "true" }, a.slice(0, 2))),
|
|
961
968
|
n
|
|
962
969
|
);
|
|
963
970
|
r.addEventListener("keydown", (a) => {
|
|
964
|
-
const l = a.key, c =
|
|
971
|
+
const l = a.key, c = Ar(t.focus, l);
|
|
965
972
|
c && (a.preventDefault(), e.onFocus(c));
|
|
966
973
|
});
|
|
967
|
-
const s =
|
|
974
|
+
const s = o(
|
|
968
975
|
"div",
|
|
969
976
|
{ class: "calendar", role: "dialog", "aria-label": "Choose a day" },
|
|
970
|
-
|
|
977
|
+
o(
|
|
971
978
|
"div",
|
|
972
979
|
{ class: "cal-head" },
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
980
|
+
o("button", { type: "button", class: "icon-button", "aria-label": "Previous month", onclick: () => e.onMonth(_e(t.month, -1)) }, J("chevron-left")),
|
|
981
|
+
o("span", { class: "cal-title", "aria-live": "polite" }, Lt(t.month)),
|
|
982
|
+
o("button", { type: "button", class: "icon-button", "aria-label": "Next month", onclick: () => e.onMonth(_e(t.month, 1)) }, J("chevron-right"))
|
|
976
983
|
),
|
|
977
984
|
r
|
|
978
985
|
);
|
|
@@ -980,7 +987,7 @@ function Ar(e) {
|
|
|
980
987
|
a.key === "Escape" && (a.preventDefault(), a.stopPropagation(), e.onClose());
|
|
981
988
|
}), s;
|
|
982
989
|
}
|
|
983
|
-
const
|
|
990
|
+
const _r = "https://newvintage.ai/?utm_source=guest-prep&utm_medium=referral&utm_campaign=guest-prep&utm_content=season-bar-logo", Cr = {
|
|
984
991
|
summary: "Summary",
|
|
985
992
|
guestList: "Everyone coming in",
|
|
986
993
|
reservation: "Reservation",
|
|
@@ -989,60 +996,60 @@ const Mr = "https://newvintage.ai/?utm_source=guest-prep&utm_medium=referral&utm
|
|
|
989
996
|
relationship: "Relationship",
|
|
990
997
|
headsUp: "Heads-up",
|
|
991
998
|
personalNotes: "Personal notes"
|
|
992
|
-
},
|
|
999
|
+
}, Er = {
|
|
993
1000
|
reservation: "calendar",
|
|
994
1001
|
talkAbout: "message-circle",
|
|
995
1002
|
newVintageProfile: "wine",
|
|
996
1003
|
relationship: "heart",
|
|
997
1004
|
headsUp: "triangle-alert",
|
|
998
1005
|
personalNotes: "sticky-note"
|
|
999
|
-
},
|
|
1006
|
+
}, Jt = {
|
|
1000
1007
|
newVintageProfile: "From New Vintage's analysis of their wine purchases."
|
|
1001
1008
|
};
|
|
1002
1009
|
function Ze(e, t) {
|
|
1003
1010
|
var r, s;
|
|
1004
1011
|
const n = (s = (r = e.options.customize) == null ? void 0 : r.labels) == null ? void 0 : s[t];
|
|
1005
|
-
return typeof n == "string" && n.trim() ? n.trim() :
|
|
1012
|
+
return typeof n == "string" && n.trim() ? n.trim() : Cr[t];
|
|
1006
1013
|
}
|
|
1007
|
-
function
|
|
1014
|
+
function He(e, t) {
|
|
1008
1015
|
var n, r;
|
|
1009
1016
|
return ((r = (n = e.options.customize) == null ? void 0 : n.hide) != null ? r : []).includes(t);
|
|
1010
1017
|
}
|
|
1011
|
-
const
|
|
1012
|
-
function
|
|
1018
|
+
const zr = () => Ce() === "claude";
|
|
1019
|
+
function Pr(e) {
|
|
1013
1020
|
const t = e.dayState;
|
|
1014
1021
|
let n = "idle", r, s = null;
|
|
1015
|
-
return t.status === "choose" ? r = "Choose a winery to load reservations" : t.status === "loading" ? r = "Loading reservations" : t.status === "unloaded" ? r = "This day isn't loaded yet" : t.status === "failed" ? (n = "problem", r = "This day couldn't load") : t.arrivals.length ? (n = "loaded", r = "Commerce7 reservations and Tock orders", s = "Commerce7 and Tock") : r = "No arrivals on this day",
|
|
1022
|
+
return t.status === "choose" ? r = "Choose a winery to load reservations" : t.status === "loading" ? r = "Loading reservations" : t.status === "unloaded" ? r = "This day isn't loaded yet" : t.status === "failed" ? (n = "problem", r = "This day couldn't load") : t.arrivals.length ? (n = "loaded", r = "Commerce7 reservations and Tock orders", s = "Commerce7 and Tock") : r = "No arrivals on this day", o(
|
|
1016
1023
|
"div",
|
|
1017
1024
|
{ class: `status status-${n}`, role: "status", "aria-live": "polite" },
|
|
1018
|
-
|
|
1019
|
-
s ? [
|
|
1025
|
+
o("span", { class: "dot", "aria-hidden": "true" }),
|
|
1026
|
+
s ? [o("span", { class: "status-long" }, r), o("span", { class: "status-short", "aria-hidden": "true" }, s)] : o("span", null, r)
|
|
1020
1027
|
);
|
|
1021
1028
|
}
|
|
1022
|
-
function
|
|
1029
|
+
function Lr(e, t) {
|
|
1023
1030
|
if (!e.wineries || e.wineries.length < 2) return null;
|
|
1024
|
-
const n =
|
|
1031
|
+
const n = o(
|
|
1025
1032
|
"select",
|
|
1026
1033
|
{ id: "winery-picker", "data-fid": "winery-picker", onchange: (r) => t.chooseWinery(r.target.value) },
|
|
1027
|
-
|
|
1028
|
-
e.wineries.map((r) =>
|
|
1034
|
+
o("option", { value: "", disabled: !0, selected: !e.tenantId }, "Choose a winery"),
|
|
1035
|
+
e.wineries.map((r) => o("option", { value: r.tenantId, selected: r.tenantId === e.tenantId }, r.name))
|
|
1029
1036
|
);
|
|
1030
|
-
return
|
|
1037
|
+
return o("label", { class: "picker", for: "winery-picker" }, "Winery", n);
|
|
1031
1038
|
}
|
|
1032
|
-
function
|
|
1033
|
-
return
|
|
1039
|
+
function Ir(e, t) {
|
|
1040
|
+
return o(
|
|
1034
1041
|
"header",
|
|
1035
1042
|
{ class: "header" },
|
|
1036
|
-
|
|
1043
|
+
o(
|
|
1037
1044
|
"a",
|
|
1038
|
-
{ class: "logo", href:
|
|
1039
|
-
|
|
1045
|
+
{ class: "logo", href: _r, target: "_blank", rel: "noopener", "aria-label": "New Vintage" },
|
|
1046
|
+
o("span", { class: "logo-mark", "aria-hidden": "true" }, "New Vintage")
|
|
1040
1047
|
),
|
|
1041
|
-
|
|
1048
|
+
o("div", { class: "heading" }, o("h1", null, e.title), Pr(e), Lr(e, t))
|
|
1042
1049
|
);
|
|
1043
1050
|
}
|
|
1044
|
-
function
|
|
1045
|
-
const n = e.day === e.today ? "Today" : e.day ===
|
|
1051
|
+
function Or(e, t) {
|
|
1052
|
+
const n = e.day === e.today ? "Today" : e.day === K(e.today, 1) ? "Tomorrow" : null, r = o(
|
|
1046
1053
|
"button",
|
|
1047
1054
|
{
|
|
1048
1055
|
type: "button",
|
|
@@ -1052,44 +1059,44 @@ function Ir(e, t) {
|
|
|
1052
1059
|
"aria-expanded": e.calendar.open ? "true" : "false",
|
|
1053
1060
|
onclick: () => t.toggleCalendar()
|
|
1054
1061
|
},
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
n ?
|
|
1058
|
-
|
|
1059
|
-
), s = e.calendar.open ?
|
|
1060
|
-
return
|
|
1062
|
+
J("calendar", 18),
|
|
1063
|
+
o("span", { class: "day-label" }, Ge(e.day, e.today)),
|
|
1064
|
+
n ? o("span", { class: "day-relative" }, n) : null,
|
|
1065
|
+
J("chevron-down", 16)
|
|
1066
|
+
), s = e.calendar.open ? Mr({ state: e.calendar, selected: e.day, today: e.today, onPick: t.pickDay, onFocus: t.focusDay, onMonth: t.showMonth, onClose: t.closeCalendar }) : null;
|
|
1067
|
+
return o(
|
|
1061
1068
|
"div",
|
|
1062
1069
|
{ class: "daybar" },
|
|
1063
|
-
|
|
1064
|
-
e.dayNote ?
|
|
1070
|
+
o("div", { class: "day-wrap" }, r, s),
|
|
1071
|
+
e.dayNote ? o("span", { class: `day-note${e.dayNote.problem ? " problem" : ""}`, "aria-live": "polite" }, e.dayNote.text) : null
|
|
1065
1072
|
);
|
|
1066
1073
|
}
|
|
1067
|
-
function
|
|
1068
|
-
if (e.dayState.status !== "ready" ||
|
|
1069
|
-
const t =
|
|
1070
|
-
return
|
|
1074
|
+
function Rr(e) {
|
|
1075
|
+
if (e.dayState.status !== "ready" || He(e, "summary")) return null;
|
|
1076
|
+
const t = sr(e.dayState.arrivals, e.day, e.today, e.nowMinutes), n = (r, s, a) => o("div", { class: "number" }, o("div", { class: "number-value" }, String(r)), o("div", { class: "number-label" }, r === 1 ? s : a));
|
|
1077
|
+
return o(
|
|
1071
1078
|
"section",
|
|
1072
1079
|
{ class: "card summary", "data-section": "summary", "aria-label": Ze(e, "summary") },
|
|
1073
|
-
|
|
1074
|
-
|
|
1080
|
+
o("div", { class: "numbers" }, n(t.reservations, "Reservation", "Reservations"), n(t.guests, "Guest", "Guests")),
|
|
1081
|
+
o(
|
|
1075
1082
|
"div",
|
|
1076
1083
|
{ class: "facts" },
|
|
1077
|
-
t.message ?
|
|
1084
|
+
t.message ? o("div", { class: "summary-message" }, t.message) : t.facts.map((r) => $(r.label, r.value, r.detail, r.label === "Next arrival" ? "fact-countdown" : ""))
|
|
1078
1085
|
),
|
|
1079
|
-
|
|
1086
|
+
$("Now", Q(e.nowMinutes), oe(e.today, e.today), "now")
|
|
1080
1087
|
);
|
|
1081
1088
|
}
|
|
1082
|
-
function
|
|
1089
|
+
function Dr(e) {
|
|
1083
1090
|
const t = [];
|
|
1084
|
-
return e.vip && t.push("VIP"), e.clubMember && t.push("Club member"), e.prospect && t.push("Club prospect"), e.atRisk && t.push("Membership at risk"), e.visit === "first" && t.push("First visit"), e.partlyRefunded && t.push("Partly refunded"), t.map(
|
|
1091
|
+
return e.vip && t.push("VIP"), e.clubMember && t.push("Club member"), e.prospect && t.push("Club prospect"), e.atRisk && t.push("Membership at risk"), e.visit === "first" && t.push("First visit"), e.partlyRefunded && t.push("Partly refunded"), t.map(un);
|
|
1085
1092
|
}
|
|
1086
1093
|
function qr(e, t, n, r, s) {
|
|
1087
1094
|
var c;
|
|
1088
|
-
const a = s ? null :
|
|
1089
|
-
return
|
|
1095
|
+
const a = s ? null : nr(n, e.kind, e.nowMinutes), l = [n.experience, r ? Be[n.source] : null].filter(Boolean).join(", ");
|
|
1096
|
+
return o(
|
|
1090
1097
|
"li",
|
|
1091
1098
|
null,
|
|
1092
|
-
|
|
1099
|
+
o(
|
|
1093
1100
|
"button",
|
|
1094
1101
|
{
|
|
1095
1102
|
type: "button",
|
|
@@ -1099,96 +1106,96 @@ function qr(e, t, n, r, s) {
|
|
|
1099
1106
|
"aria-current": ((c = e.selected) == null ? void 0 : c.key) === n.key ? "true" : "false",
|
|
1100
1107
|
onclick: () => t.select(n.key)
|
|
1101
1108
|
},
|
|
1102
|
-
|
|
1109
|
+
o(
|
|
1103
1110
|
"span",
|
|
1104
1111
|
{ class: "row-when" },
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
a ?
|
|
1112
|
+
o("span", { class: "row-time" }, Q(n.minutes)),
|
|
1113
|
+
o("span", { class: "row-date", style: "display:block" }, oe(e.day, e.today)),
|
|
1114
|
+
a ? o("span", { class: "row-soon soon", style: "display:block" }, a) : null
|
|
1108
1115
|
),
|
|
1109
|
-
|
|
1116
|
+
o(
|
|
1110
1117
|
"span",
|
|
1111
1118
|
{ style: "min-width:0" },
|
|
1112
|
-
|
|
1113
|
-
l ?
|
|
1119
|
+
o("span", { class: "row-name" }, o("span", null, ke(n)), Dr(n)),
|
|
1120
|
+
l ? o("span", { class: "row-experience", style: "display:block" }, l) : null
|
|
1114
1121
|
),
|
|
1115
|
-
|
|
1122
|
+
o("span", { class: "row-party" }, A(n.party, "guest"))
|
|
1116
1123
|
)
|
|
1117
1124
|
);
|
|
1118
1125
|
}
|
|
1119
|
-
function
|
|
1120
|
-
return
|
|
1126
|
+
function Vr() {
|
|
1127
|
+
return o(
|
|
1121
1128
|
"div",
|
|
1122
1129
|
{ "aria-hidden": "true" },
|
|
1123
|
-
[0, 1, 2, 3].map(() =>
|
|
1130
|
+
[0, 1, 2, 3].map(() => o("div", { class: "skeleton-row" }, o("span", { class: "skel", style: "flex:0 0 72px" }), o("span", { class: "skel", style: "flex:2" }), o("span", { class: "skel", style: "flex:0 0 56px" })))
|
|
1124
1131
|
);
|
|
1125
1132
|
}
|
|
1126
|
-
function
|
|
1127
|
-
const t = e.request, n =
|
|
1128
|
-
return (t == null ? void 0 : t.kind) === "sent" ?
|
|
1133
|
+
function Ur(e) {
|
|
1134
|
+
const t = e.request, n = Ge(e.day, e.today);
|
|
1135
|
+
return (t == null ? void 0 : t.kind) === "sent" ? R(`Request sent. You may need to finish sending it in the chat. The briefing updates after the assistant loads ${n}.`) : (t == null ? void 0 : t.kind) === "copied" ? R(`Request copied. Paste it into this chat to load ${n}.`) : (t == null ? void 0 : t.kind) === "manual" ? o(
|
|
1129
1136
|
"div",
|
|
1130
1137
|
null,
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
) : (t == null ? void 0 : t.kind) === "failed" ?
|
|
1138
|
+
R(`Copy this request into the chat to load ${n}.`),
|
|
1139
|
+
o("textarea", { class: "request-text", readonly: !0, rows: 6, "aria-label": "Request to copy", onfocus: (r) => r.target.select() }, t.text)
|
|
1140
|
+
) : (t == null ? void 0 : t.kind) === "failed" ? R(`The request wasn't sent. ${t.message}`, "note problem") : null;
|
|
1134
1141
|
}
|
|
1135
|
-
function
|
|
1142
|
+
function jr(e, t) {
|
|
1136
1143
|
var s;
|
|
1137
|
-
const n = ((s = e.request) == null ? void 0 : s.kind) === "pending", r =
|
|
1138
|
-
return
|
|
1144
|
+
const n = ((s = e.request) == null ? void 0 : s.kind) === "pending", r = zr() ? "This page holds the days loaded in this chat. Load this day asks the chat for it, or open the page where the New Vintage connector can run to load any day." : "This page holds the days loaded in this chat. Load this day asks the chat for it.";
|
|
1145
|
+
return o(
|
|
1139
1146
|
"div",
|
|
1140
1147
|
{ class: "empty" },
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1148
|
+
o("p", { class: "empty-title" }, "This day isn't loaded yet"),
|
|
1149
|
+
R(r),
|
|
1150
|
+
o(
|
|
1144
1151
|
"div",
|
|
1145
1152
|
{ class: "actions" },
|
|
1146
|
-
|
|
1153
|
+
o(
|
|
1147
1154
|
"button",
|
|
1148
1155
|
{ type: "button", class: "button", "data-fid": "load-day", disabled: n, "aria-busy": n ? "true" : "false", onclick: () => t.requestDay() },
|
|
1149
1156
|
n ? "Sending…" : "Load this day"
|
|
1150
1157
|
)
|
|
1151
1158
|
),
|
|
1152
|
-
|
|
1159
|
+
Ur(e)
|
|
1153
1160
|
);
|
|
1154
1161
|
}
|
|
1155
|
-
function
|
|
1156
|
-
if (
|
|
1162
|
+
function Gr(e, t) {
|
|
1163
|
+
if (He(e, "guestList")) return null;
|
|
1157
1164
|
const n = e.dayState, r = Ze(e, "guestList");
|
|
1158
1165
|
let s = null, a;
|
|
1159
|
-
if (n.status === "loading") a =
|
|
1160
|
-
else if (n.status === "choose") a =
|
|
1161
|
-
else if (n.status === "unloaded") a =
|
|
1166
|
+
if (n.status === "loading") a = Vr();
|
|
1167
|
+
else if (n.status === "choose") a = o("div", { class: "empty" }, o("p", { class: "empty-title" }, "Choose a winery"), n.message ? R(n.message) : null);
|
|
1168
|
+
else if (n.status === "unloaded") a = jr(e, t);
|
|
1162
1169
|
else if (n.status === "failed")
|
|
1163
|
-
a =
|
|
1170
|
+
a = o(
|
|
1164
1171
|
"div",
|
|
1165
1172
|
{ class: "empty" },
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1173
|
+
o("p", { class: "empty-title" }, "This day couldn't load"),
|
|
1174
|
+
R(n.message, "note problem"),
|
|
1175
|
+
o("div", { class: "actions" }, o("button", { type: "button", class: "button", "data-fid": "retry", onclick: () => t.retry() }, "Try again"))
|
|
1169
1176
|
);
|
|
1170
|
-
else if (!n.arrivals.length) a =
|
|
1177
|
+
else if (!n.arrivals.length) a = o("div", { class: "empty" }, o("p", { class: "empty-title" }, "No one is coming in on this day."));
|
|
1171
1178
|
else {
|
|
1172
|
-
const l =
|
|
1173
|
-
l && (s = `All from ${
|
|
1179
|
+
const l = or(n.arrivals);
|
|
1180
|
+
l && (s = `All from ${Be[l]}`), a = o("div", null, Fr(e, t), pn(e, t, n.arrivals, !l));
|
|
1174
1181
|
}
|
|
1175
|
-
return
|
|
1182
|
+
return o(
|
|
1176
1183
|
"section",
|
|
1177
1184
|
{ class: "card list-card", "data-section": "guestList", "aria-busy": n.status === "loading" ? "true" : "false" },
|
|
1178
|
-
|
|
1185
|
+
o("div", { class: "card-head" }, o("h2", null, r), s ? o("span", { class: "card-aside" }, s) : null),
|
|
1179
1186
|
a
|
|
1180
1187
|
);
|
|
1181
1188
|
}
|
|
1182
|
-
function
|
|
1183
|
-
return
|
|
1189
|
+
function Fr(e, t) {
|
|
1190
|
+
return o(
|
|
1184
1191
|
"div",
|
|
1185
1192
|
{ class: "finder" },
|
|
1186
|
-
|
|
1193
|
+
o(
|
|
1187
1194
|
"label",
|
|
1188
1195
|
{ class: "search" },
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1196
|
+
J("search", 16),
|
|
1197
|
+
o("span", { class: "sr-only" }, "Search guests by name"),
|
|
1198
|
+
o("input", {
|
|
1192
1199
|
type: "search",
|
|
1193
1200
|
class: "search-input",
|
|
1194
1201
|
placeholder: "Search guests",
|
|
@@ -1199,11 +1206,11 @@ function Gr(e, t) {
|
|
|
1199
1206
|
oninput: (n) => t.search(n.target.value)
|
|
1200
1207
|
})
|
|
1201
1208
|
),
|
|
1202
|
-
|
|
1209
|
+
o(
|
|
1203
1210
|
"div",
|
|
1204
1211
|
{ class: "filters", role: "group", "aria-label": "Show only" },
|
|
1205
|
-
|
|
1206
|
-
(n) =>
|
|
1212
|
+
sn.map(
|
|
1213
|
+
(n) => o(
|
|
1207
1214
|
"button",
|
|
1208
1215
|
{
|
|
1209
1216
|
type: "button",
|
|
@@ -1219,86 +1226,99 @@ function Gr(e, t) {
|
|
|
1219
1226
|
)
|
|
1220
1227
|
);
|
|
1221
1228
|
}
|
|
1222
|
-
function
|
|
1223
|
-
return e.first === e.last ?
|
|
1229
|
+
function Br(e) {
|
|
1230
|
+
return e.first === e.last ? Q(e.first) : `${Q(e.first)} to ${Q(e.last)}`;
|
|
1224
1231
|
}
|
|
1225
|
-
function
|
|
1232
|
+
function Zr(e, t, n) {
|
|
1226
1233
|
const r = t.reduce((a, l) => a + l.party, 0);
|
|
1227
|
-
return [n ? `${t.length} of ${A(e.arrivals.length, "party", "parties")}` : A(t.length, "party", "parties"), A(r, "guest"),
|
|
1228
|
-
}
|
|
1229
|
-
function
|
|
1230
|
-
const s = !!e.query.trim() || e.filters.length > 0, a =
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
type: "button",
|
|
1237
|
-
class: "seat-head seat-toggle",
|
|
1238
|
-
"aria-expanded": L ? "true" : "false",
|
|
1239
|
-
"data-fid": `seating-${y.key}`,
|
|
1240
|
-
onclick: () => t.toggleSeating(y.key)
|
|
1241
|
-
},
|
|
1242
|
-
i("span", { class: "seat-chevron" }, K(L ? "chevron-down" : "chevron-right", 16)),
|
|
1243
|
-
i("span", { class: "seat-label" }, q, F)
|
|
1244
|
-
) : i("div", { class: "seat-head" }, i("span", { class: "seat-label" }, i("h3", { class: "seat-time" }, Kt(y)), F), T ? i("span", { class: `seat-marker seat-${T.toLowerCase()}` }, T) : null);
|
|
1245
|
-
return i(
|
|
1234
|
+
return [n ? `${t.length} of ${A(e.arrivals.length, "party", "parties")}` : A(t.length, "party", "parties"), A(r, "guest"), tr(t)].filter(Boolean).join(", ");
|
|
1235
|
+
}
|
|
1236
|
+
function pn(e, t, n, r) {
|
|
1237
|
+
const s = !!e.query.trim() || e.filters.length > 0, a = er(n, e.seatingGap), l = e.kind === "today", c = (h) => l && h.last < e.nowMinutes, d = l ? a.find((h) => !c(h)) : void 0, m = (h) => h.arrivals.filter((_) => jt(_, e.query, e.filters)), S = a.filter((h) => m(h).length > 0), w = (h) => `${e.day}-${h.key}`, y = (h) => {
|
|
1238
|
+
var _;
|
|
1239
|
+
return (_ = e.seatingChoices[w(h)]) != null ? _ : s || !c(h);
|
|
1240
|
+
}, k = n.filter((h) => jt(h, e.query, e.filters)).length, U = (h) => {
|
|
1241
|
+
const _ = m(h), P = c(h), L = y(h), E = h === d ? h.first <= e.nowMinutes ? "Now" : "Next" : null, I = `nvgp-seating-${w(h)}`;
|
|
1242
|
+
return o(
|
|
1246
1243
|
"li",
|
|
1247
|
-
{ class: `seating${
|
|
1248
|
-
|
|
1249
|
-
|
|
1244
|
+
{ class: `seating${P ? " seating-earlier" : ""}`, "data-seating": h.key, "data-state": P ? "earlier" : E ? E.toLowerCase() : "later", "data-open": L ? "true" : "false" },
|
|
1245
|
+
o(
|
|
1246
|
+
"button",
|
|
1247
|
+
{
|
|
1248
|
+
type: "button",
|
|
1249
|
+
class: "seat-head",
|
|
1250
|
+
"aria-expanded": L ? "true" : "false",
|
|
1251
|
+
"aria-controls": I,
|
|
1252
|
+
"data-fid": `seating-${h.key}`,
|
|
1253
|
+
onclick: () => t.toggleSeating(w(h), !L)
|
|
1254
|
+
},
|
|
1255
|
+
o("span", { class: "seat-chevron" }, J("chevron-down", 18)),
|
|
1256
|
+
o("span", { class: "seat-time" }, Br(h)),
|
|
1257
|
+
E ? o("span", { class: `seat-marker seat-${E.toLowerCase()}` }, E) : null,
|
|
1258
|
+
o("span", { class: "seat-counts" }, Zr(h, _, s))
|
|
1259
|
+
),
|
|
1260
|
+
o(
|
|
1250
1261
|
"ul",
|
|
1251
|
-
{ class: "rows" },
|
|
1252
|
-
_.map((
|
|
1253
|
-
)
|
|
1262
|
+
{ class: "rows", id: I, hidden: !L },
|
|
1263
|
+
L ? _.map((B) => qr(e, t, B, r, l && B.minutes < e.nowMinutes)) : null
|
|
1264
|
+
)
|
|
1254
1265
|
);
|
|
1255
|
-
},
|
|
1256
|
-
return
|
|
1266
|
+
}, D = S.filter((h) => !c(h)).map(U), z = S.filter(c), j = z.reduce((h, _) => h + m(_).length, 0), M = S.length > 0 && S.every(y);
|
|
1267
|
+
return o(
|
|
1257
1268
|
"div",
|
|
1258
|
-
{ class: "list-results"
|
|
1259
|
-
|
|
1269
|
+
{ class: "list-results" },
|
|
1270
|
+
o(
|
|
1260
1271
|
"div",
|
|
1261
|
-
{ class: "
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1272
|
+
{ class: "list-tools" },
|
|
1273
|
+
o("span", { class: "filter-status", "aria-live": "polite" }, s ? k ? `${k} of ${A(n.length, "party", "parties")}` : "No guests match." : null),
|
|
1274
|
+
o(
|
|
1275
|
+
"span",
|
|
1276
|
+
{ class: "list-tools-actions" },
|
|
1277
|
+
s ? o("button", { type: "button", class: "link-button", "data-fid": "clear-filters", onclick: () => t.clearFilters() }, "Clear filters") : null,
|
|
1278
|
+
S.length ? o(
|
|
1279
|
+
"button",
|
|
1280
|
+
{ type: "button", class: "link-button", "data-fid": "toggle-all", onclick: () => t.setSeatings(S.map(w), !M) },
|
|
1281
|
+
M ? "Collapse all" : "Expand all"
|
|
1282
|
+
) : null
|
|
1283
|
+
)
|
|
1284
|
+
),
|
|
1285
|
+
S.length ? o(
|
|
1266
1286
|
"ol",
|
|
1267
1287
|
{ class: "seatings" },
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1288
|
+
D,
|
|
1289
|
+
z.length ? o("li", { class: "earlier-head" }, "Earlier today", o("span", { class: "count", "aria-label": A(j, "reservation") }, String(j))) : null,
|
|
1290
|
+
z.map(U)
|
|
1271
1291
|
) : null
|
|
1272
1292
|
);
|
|
1273
1293
|
}
|
|
1274
|
-
function
|
|
1275
|
-
return e.map((t) =>
|
|
1294
|
+
function Hr(e) {
|
|
1295
|
+
return e.map((t) => o("p", { class: "soft" }, t.text, t.when ? o("span", { class: "soft-when" }, t.when) : null));
|
|
1276
1296
|
}
|
|
1277
|
-
function
|
|
1297
|
+
function Yr(e) {
|
|
1278
1298
|
const t = e.bought;
|
|
1279
|
-
return t ? t.items.length ?
|
|
1299
|
+
return t ? t.items.length ? o(
|
|
1280
1300
|
"ul",
|
|
1281
1301
|
{ class: "bought" },
|
|
1282
|
-
t.items.map((n) =>
|
|
1283
|
-
t.total !== null ?
|
|
1284
|
-
) :
|
|
1302
|
+
t.items.map((n) => o("li", null, o("span", null, n.title), o("span", { class: "qty" }, `× ${n.qty}`))),
|
|
1303
|
+
t.total !== null ? o("li", { class: "total" }, o("span", null, "Total"), o("span", null, W(t.total))) : null
|
|
1304
|
+
) : o("p", { class: "visit-muted" }, "Nothing beyond the tasting") : null;
|
|
1285
1305
|
}
|
|
1286
|
-
function
|
|
1306
|
+
function Wr(e, t) {
|
|
1287
1307
|
const n = t.lastTaste, r = [];
|
|
1288
1308
|
if (n) {
|
|
1289
|
-
const l = n.day ? `${
|
|
1290
|
-
r.push(
|
|
1309
|
+
const l = n.day ? `${rn(n.day, e.today)}, ${Vn(n.day, e.today)}` : null;
|
|
1310
|
+
r.push(o("div", { class: "visit-part visit-taste" }, o("p", { class: "visit-title" }, n.title), l ? o("p", { class: "visit-muted" }, l) : null));
|
|
1291
1311
|
}
|
|
1292
|
-
const s =
|
|
1293
|
-
if (s && r.push(
|
|
1294
|
-
const a = r.flatMap((l, c) => c ? [
|
|
1295
|
-
return
|
|
1312
|
+
const s = Yr(t);
|
|
1313
|
+
if (s && r.push(o("div", { class: "visit-part visit-bought" }, s)), t.orderNotes.length && r.push(o("div", { class: "visit-part visit-notes" }, t.orderNotes.map((l) => o("p", { class: "visit-note" }, l)))), !r.length) return null;
|
|
1314
|
+
const a = r.flatMap((l, c) => c ? [o("hr", { class: "visit-divider" }), l] : [l]);
|
|
1315
|
+
return o("div", { class: "fact fact-visit" }, o("div", { class: "fact-label" }, "Last visit"), o("div", { class: "visit" }, a));
|
|
1296
1316
|
}
|
|
1297
|
-
function
|
|
1317
|
+
function Kr(e) {
|
|
1298
1318
|
const { floor: t, ceiling: n } = e;
|
|
1299
|
-
return t !== null && n !== null ? t === n ?
|
|
1319
|
+
return t !== null && n !== null ? t === n ? W(t) : `${W(t)} to ${W(n)}` : t !== null ? `From ${W(t)}` : n !== null ? `Up to ${W(n)}` : e.avg !== null ? W(e.avg) : null;
|
|
1300
1320
|
}
|
|
1301
|
-
function
|
|
1321
|
+
function Jr(e, t, n) {
|
|
1302
1322
|
var a, l;
|
|
1303
1323
|
const r = [], s = (c) => {
|
|
1304
1324
|
c && r.push(c);
|
|
@@ -1307,111 +1327,111 @@ function Wr(e, t, n) {
|
|
|
1307
1327
|
case "reservation": {
|
|
1308
1328
|
const c = e.kind === "today" && t.minutes >= e.nowMinutes;
|
|
1309
1329
|
r.push(
|
|
1310
|
-
|
|
1330
|
+
o(
|
|
1311
1331
|
"div",
|
|
1312
1332
|
{ class: "fact-row" },
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1333
|
+
$("Arrives", Se(e.day, t.minutes, e.today), c ? Fe(t.minutes - e.nowMinutes) : null, c ? "fact-countdown" : ""),
|
|
1334
|
+
$("Party", A(t.party, "guest")),
|
|
1335
|
+
$("Booked via", Be[t.source])
|
|
1316
1336
|
)
|
|
1317
|
-
), s(t.experience ?
|
|
1337
|
+
), s(t.experience ? $("Experience", t.experience) : null);
|
|
1318
1338
|
break;
|
|
1319
1339
|
}
|
|
1320
1340
|
case "talkAbout": {
|
|
1321
|
-
s(t.occasions.length ?
|
|
1341
|
+
s(t.occasions.length ? $("Occasion", t.occasions.map((c, d) => o("div", { "data-line": d }, c))) : null), s(t.interests.length ? $("Interested in", Me(t.interests)) : null), s(Wr(e, t));
|
|
1322
1342
|
break;
|
|
1323
1343
|
}
|
|
1324
1344
|
case "newVintageProfile": {
|
|
1325
|
-
const c = t.price ?
|
|
1326
|
-
c ?
|
|
1327
|
-
t.wineTypes.length ?
|
|
1328
|
-
t.varietals.length ?
|
|
1329
|
-
t.vintages.length ?
|
|
1330
|
-
t.appellations.length ?
|
|
1345
|
+
const c = t.price ? Kr(t.price) : null, d = [
|
|
1346
|
+
c ? $("Usual bottle price", c, ((a = t.price) == null ? void 0 : a.avg) !== null && ((l = t.price) == null ? void 0 : l.avg) !== void 0 ? `Average ${W(t.price.avg)}` : null) : null,
|
|
1347
|
+
t.wineTypes.length ? $("Wine types", t.wineTypes.join(", ")) : null,
|
|
1348
|
+
t.varietals.length ? $("Favorite varietals", t.varietals.join(", ")) : null,
|
|
1349
|
+
t.vintages.length ? $("Vintages", t.vintages.join(", ")) : null,
|
|
1350
|
+
t.appellations.length ? $("Appellations", t.appellations.join(", ")) : null
|
|
1331
1351
|
].filter((m) => m !== null);
|
|
1332
|
-
d.length && r.push(
|
|
1352
|
+
d.length && r.push(o("div", { class: "fact-grid" }, d));
|
|
1333
1353
|
break;
|
|
1334
1354
|
}
|
|
1335
1355
|
case "relationship":
|
|
1336
|
-
s(t.since ?
|
|
1356
|
+
s(t.since ? $("Customer since", t.since) : null), s(t.lifetime ? $("Lifetime spend", W(t.lifetime.spend), t.lifetime.orders !== null ? A(t.lifetime.orders, "order") : null) : null), s(t.clubTitles ? $("Club", t.clubTitles) : null), s(t.clubPickup ? $("Club pickup", "Shipment ready to hand over") : null), s(t.prospect && t.signupTier ? $("Likely to join the club", It(t.signupTier)) : null), s(t.atRisk && t.churnTier ? $("Membership at risk", It(t.churnTier)) : null), s(t.clubTags.length ? $("Club tags", Me(t.clubTags)) : null);
|
|
1337
1357
|
break;
|
|
1338
1358
|
case "headsUp":
|
|
1339
|
-
s(t.accountTags.length ?
|
|
1359
|
+
s(t.accountTags.length ? $("Account tags", Me(t.accountTags, "warning")) : null);
|
|
1340
1360
|
break;
|
|
1341
1361
|
case "personalNotes":
|
|
1342
|
-
r.push(...
|
|
1362
|
+
r.push(...Hr(t.personalNotes.map((c) => ({ text: c.content, when: c.when }))));
|
|
1343
1363
|
break;
|
|
1344
1364
|
}
|
|
1345
1365
|
return r;
|
|
1346
1366
|
}
|
|
1347
|
-
function
|
|
1367
|
+
function Qr(e) {
|
|
1348
1368
|
const t = [];
|
|
1349
|
-
return e.vip && t.push("VIP"), t.push(e.visit === "first" ? "First visit" : e.visit === "return" ? "Returning guest" : "Visit history unknown"), e.clubMember && t.push("Club member"), e.prospect && t.push("Club prospect"), e.atRisk && t.push("Membership at risk"), e.partlyRefunded && t.push("Partly refunded"),
|
|
1369
|
+
return e.vip && t.push("VIP"), t.push(e.visit === "first" ? "First visit" : e.visit === "return" ? "Returning guest" : "Visit history unknown"), e.clubMember && t.push("Club member"), e.prospect && t.push("Club prospect"), e.atRisk && t.push("Membership at risk"), e.partlyRefunded && t.push("Partly refunded"), o("div", { class: "chips" }, t.map(un));
|
|
1350
1370
|
}
|
|
1351
|
-
const
|
|
1352
|
-
function
|
|
1353
|
-
var d, m,
|
|
1371
|
+
const Xr = ["reservation", "talkAbout", "newVintageProfile", "relationship", "headsUp", "personalNotes"];
|
|
1372
|
+
function ea(e, t, n) {
|
|
1373
|
+
var d, m, S;
|
|
1354
1374
|
const r = e.selected;
|
|
1355
1375
|
if (!r || e.dayState.status !== "ready") return null;
|
|
1356
1376
|
const s = [];
|
|
1357
|
-
for (const
|
|
1358
|
-
if (!
|
|
1359
|
-
const
|
|
1360
|
-
|
|
1361
|
-
|
|
1377
|
+
for (const w of Xr) {
|
|
1378
|
+
if (!He(e, w)) {
|
|
1379
|
+
const y = Jr(e, r, w);
|
|
1380
|
+
y.length && s.push(
|
|
1381
|
+
o(
|
|
1362
1382
|
"section",
|
|
1363
|
-
{ class: "psec", "data-section":
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1383
|
+
{ class: "psec", "data-section": w },
|
|
1384
|
+
o("h3", { class: "psec-title" }, o("span", { class: `tile${w === "headsUp" ? " tile-warning" : ""}` }, J((d = Er[w]) != null ? d : "", 16)), Ze(e, w)),
|
|
1385
|
+
Jt[w] ? o("p", { class: "psec-source" }, Jt[w]) : null,
|
|
1386
|
+
o("div", { class: "psec-facts" }, y)
|
|
1367
1387
|
)
|
|
1368
1388
|
);
|
|
1369
1389
|
}
|
|
1370
|
-
s.push(...n(
|
|
1390
|
+
s.push(...n(w));
|
|
1371
1391
|
}
|
|
1372
|
-
const a = ((m = e.research) == null ? void 0 : m.key) === r.key ? e.research : null, l = (a == null ? void 0 : a.status) === "pending", c = e.live ?
|
|
1392
|
+
const a = ((m = e.research) == null ? void 0 : m.key) === r.key ? e.research : null, l = (a == null ? void 0 : a.status) === "pending", c = e.live ? o(
|
|
1373
1393
|
"div",
|
|
1374
1394
|
{ class: "research" },
|
|
1375
|
-
|
|
1395
|
+
o(
|
|
1376
1396
|
"button",
|
|
1377
1397
|
{ type: "button", class: "button button-quiet", "data-fid": "research", disabled: l, "aria-busy": l ? "true" : "false", onclick: () => t.research() },
|
|
1378
|
-
|
|
1398
|
+
J("refresh-cw", 16),
|
|
1379
1399
|
l ? "Researching…" : "Research this guest again"
|
|
1380
1400
|
),
|
|
1381
|
-
(a == null ? void 0 : a.status) === "failed" ?
|
|
1382
|
-
) :
|
|
1401
|
+
(a == null ? void 0 : a.status) === "failed" ? R((S = a.message) != null ? S : "This guest couldn't refresh.", "note problem") : null
|
|
1402
|
+
) : o(
|
|
1383
1403
|
"div",
|
|
1384
1404
|
{ class: "research" },
|
|
1385
|
-
|
|
1386
|
-
|
|
1405
|
+
o("button", { type: "button", class: "button button-quiet", disabled: !0, "aria-describedby": "research-reason" }, J("refresh-cw", 16), "Research this guest again"),
|
|
1406
|
+
o("p", { class: "note", id: "research-reason" }, "Ask in this chat to refresh this guest.")
|
|
1387
1407
|
);
|
|
1388
|
-
return
|
|
1408
|
+
return o(
|
|
1389
1409
|
"aside",
|
|
1390
|
-
{ class: "card panel", "aria-label": `Guest: ${
|
|
1391
|
-
|
|
1410
|
+
{ class: "card panel", "aria-label": `Guest: ${ke(r)}`, "data-key": r.key },
|
|
1411
|
+
o(
|
|
1392
1412
|
"div",
|
|
1393
1413
|
{ class: "panel-head" },
|
|
1394
|
-
|
|
1395
|
-
|
|
1414
|
+
o("div", { class: "handle", "aria-hidden": "true" }),
|
|
1415
|
+
o(
|
|
1396
1416
|
"div",
|
|
1397
1417
|
{ class: "panel-head-row" },
|
|
1398
|
-
|
|
1399
|
-
|
|
1418
|
+
o("h2", { class: "panel-name" }, ke(r)),
|
|
1419
|
+
o("button", { type: "button", class: "icon-button close", "aria-label": "Close", "data-fid": "close-sheet", onclick: () => t.closeSheet() }, J("x", 20))
|
|
1400
1420
|
),
|
|
1401
|
-
|
|
1421
|
+
Qr(r)
|
|
1402
1422
|
),
|
|
1403
|
-
|
|
1423
|
+
o("div", { class: "panel-body" }, s, c)
|
|
1404
1424
|
);
|
|
1405
1425
|
}
|
|
1406
|
-
const
|
|
1426
|
+
const Qt = 900 * 1e3;
|
|
1407
1427
|
function qe(e) {
|
|
1408
1428
|
switch (e.kind) {
|
|
1409
1429
|
case "unavailable":
|
|
1410
|
-
return
|
|
1430
|
+
return Ce() === "claude" ? "Loading a day needs the New Vintage connector with access to this winery. Add the connector in this chat, then try again." : "This page shows the days loaded in the chat. Ask in the chat to load another.";
|
|
1411
1431
|
case "approval":
|
|
1412
1432
|
return "Loading a day needs your permission to use the New Vintage connector. Allow it for this page, then try again.";
|
|
1413
1433
|
case "reconnect":
|
|
1414
|
-
return
|
|
1434
|
+
return Mn();
|
|
1415
1435
|
case "temporary":
|
|
1416
1436
|
return "New Vintage didn't answer. Try again in a moment.";
|
|
1417
1437
|
case "needs_update":
|
|
@@ -1422,332 +1442,345 @@ function qe(e) {
|
|
|
1422
1442
|
return e.message;
|
|
1423
1443
|
}
|
|
1424
1444
|
}
|
|
1425
|
-
function
|
|
1426
|
-
var
|
|
1427
|
-
const n = (
|
|
1428
|
-
...
|
|
1445
|
+
function ta(e, t) {
|
|
1446
|
+
var ot, it, lt, ct, ut, dt, pt, gt, ft, mt, ht, yt, bt, vt, xt, wt, kt, St, $t, Tt;
|
|
1447
|
+
const n = (ot = t.now) != null ? ot : (() => /* @__PURE__ */ new Date()), r = {
|
|
1448
|
+
...be,
|
|
1429
1449
|
...(it = t.settings) != null ? it : {},
|
|
1430
|
-
tagRules: { ...
|
|
1431
|
-
}, s =
|
|
1432
|
-
let
|
|
1433
|
-
const
|
|
1434
|
-
let
|
|
1435
|
-
const
|
|
1436
|
-
let
|
|
1437
|
-
const
|
|
1450
|
+
tagRules: { ...be.tagRules, ...(ct = (lt = t.settings) == null ? void 0 : lt.tagRules) != null ? ct : {} }
|
|
1451
|
+
}, s = Rn(t.settings ? t.settings.timeZone : be.timeZone), a = Yn(r.tagRules), l = Number(r.largeParty) > 0 ? Number(r.largeParty) : be.largeParty, c = Number(r.seatingGapMinutes) > 0 ? Number(r.seatingGapMinutes) : (ut = be.seatingGapMinutes) != null ? ut : 45, d = ur(t.customize, t.cards), m = fr(t.storage), S = () => zt(n(), s);
|
|
1452
|
+
let w = S().day, y = w, k = (dt = t.tenantId) != null ? dt : null, U = (pt = t.wineryName) != null ? pt : null, D = null, z = null, j = !0, M = null, h = null, _ = !1, P = 0;
|
|
1453
|
+
const L = /* @__PURE__ */ new Map(), E = /* @__PURE__ */ new Set(), I = /* @__PURE__ */ new Map();
|
|
1454
|
+
let B = null, O = null, H = !1;
|
|
1455
|
+
const f = /* @__PURE__ */ new Map();
|
|
1456
|
+
let C = null, N = { open: !1, month: y.slice(0, 7), focus: y }, q = null, $e = "", te = [];
|
|
1457
|
+
const de = {};
|
|
1458
|
+
let ne = {};
|
|
1459
|
+
const pe = () => !!$e.trim() || te.length > 0;
|
|
1460
|
+
let ze = null, Te = null, ge = !1;
|
|
1461
|
+
const Ye = /* @__PURE__ */ new Map();
|
|
1438
1462
|
e.innerHTML = "";
|
|
1439
|
-
const
|
|
1440
|
-
(
|
|
1441
|
-
const
|
|
1442
|
-
document.head.append(
|
|
1443
|
-
const
|
|
1444
|
-
e.append(
|
|
1445
|
-
const
|
|
1446
|
-
window.addEventListener("resize",
|
|
1447
|
-
const
|
|
1448
|
-
|
|
1449
|
-
},
|
|
1463
|
+
const gn = [(mt = (ft = (gt = t.customize) == null ? void 0 : gt.fonts) == null ? void 0 : ft.display) != null ? mt : "Newsreader", (bt = (yt = (ht = t.customize) == null ? void 0 : ht.fonts) == null ? void 0 : yt.body) != null ? bt : "Be Vietnam Pro"], We = o("link", { rel: "stylesheet", href: xr(gn.filter((i) => /^[A-Za-z0-9 ]{1,40}$/.test(i))) }), Pe = {};
|
|
1464
|
+
(xt = (vt = t.customize) == null ? void 0 : vt.fonts) != null && xt.display && (Pe["font-display"] = `'${t.customize.fonts.display}', Georgia, serif`), (kt = (wt = t.customize) == null ? void 0 : wt.fonts) != null && kt.body && (Pe["font-body"] = `'${t.customize.fonts.body}', system-ui, sans-serif`);
|
|
1465
|
+
const Ke = o("style", null, wr({ ...Pe, ...($t = (St = t.customize) == null ? void 0 : St.theme) != null ? $t : {} }, (Tt = t.customize) == null ? void 0 : Tt.themeDark) + kr);
|
|
1466
|
+
document.head.append(We, Ke);
|
|
1467
|
+
const G = o("div", { class: "nvgp" });
|
|
1468
|
+
e.append(G);
|
|
1469
|
+
const Je = () => et();
|
|
1470
|
+
window.addEventListener("resize", Je);
|
|
1471
|
+
const Qe = (i) => {
|
|
1472
|
+
i.key === "Escape" && (N.open ? ee.closeCalendar() : H && ee.closeSheet());
|
|
1473
|
+
}, Xe = (i) => {
|
|
1450
1474
|
var p;
|
|
1451
1475
|
if (!N.open) return;
|
|
1452
|
-
const u =
|
|
1453
|
-
(p = u == null ? void 0 : u.closest) != null && p.call(u, ".day-wrap") || (N = { ...N, open: !1 },
|
|
1476
|
+
const u = i.target;
|
|
1477
|
+
(p = u == null ? void 0 : u.closest) != null && p.call(u, ".day-wrap") || (N = { ...N, open: !1 }, v());
|
|
1454
1478
|
};
|
|
1455
|
-
document.addEventListener("keydown",
|
|
1456
|
-
function
|
|
1457
|
-
var
|
|
1458
|
-
const
|
|
1459
|
-
|
|
1460
|
-
const u =
|
|
1461
|
-
|
|
1479
|
+
document.addEventListener("keydown", Qe), document.addEventListener("mousedown", Xe);
|
|
1480
|
+
function et() {
|
|
1481
|
+
var g;
|
|
1482
|
+
const i = G.querySelector(".daybar");
|
|
1483
|
+
i && G.style.setProperty("--daybar-h", `${i.offsetHeight}px`);
|
|
1484
|
+
const u = G.querySelector(".summary");
|
|
1485
|
+
G.style.setProperty("--summary-h", `${u ? u.offsetHeight + 16 : 0}px`);
|
|
1462
1486
|
const p = u && window.getComputedStyle(u).position === "sticky" ? u.offsetHeight : 0;
|
|
1463
|
-
|
|
1487
|
+
G.style.setProperty("--seat-top", `${((g = i == null ? void 0 : i.offsetHeight) != null ? g : 0) + p}px`);
|
|
1464
1488
|
}
|
|
1465
|
-
const X = () => !!(
|
|
1466
|
-
function
|
|
1467
|
-
var p,
|
|
1468
|
-
const u = (p = t.days) == null ? void 0 : p[
|
|
1469
|
-
return u && Array.isArray(u.arrivals) ? { rows: u.arrivals, loadedAt: String((
|
|
1489
|
+
const X = () => !!(z && M && k);
|
|
1490
|
+
function fn(i) {
|
|
1491
|
+
var p, g;
|
|
1492
|
+
const u = (p = t.days) == null ? void 0 : p[i];
|
|
1493
|
+
return u && Array.isArray(u.arrivals) ? { rows: u.arrivals, loadedAt: String((g = u.loadedAt) != null ? g : ""), live: !1 } : null;
|
|
1470
1494
|
}
|
|
1471
|
-
function
|
|
1495
|
+
function Le(i) {
|
|
1472
1496
|
var u;
|
|
1473
|
-
return (u =
|
|
1497
|
+
return (u = L.get(i)) != null ? u : fn(i);
|
|
1474
1498
|
}
|
|
1475
|
-
function
|
|
1476
|
-
if (!
|
|
1477
|
-
const
|
|
1478
|
-
if (
|
|
1479
|
-
return { status: "ready", arrivals:
|
|
1480
|
-
if (
|
|
1481
|
-
const u =
|
|
1499
|
+
function tt() {
|
|
1500
|
+
if (!k) return j ? { status: "loading" } : { status: "choose", message: B };
|
|
1501
|
+
const i = Le(y);
|
|
1502
|
+
if (i)
|
|
1503
|
+
return { status: "ready", arrivals: Xn(i.rows, { day: y, today: w, largeParty: l, rules: a }), rows: i.rows, loadedAt: i.loadedAt, live: i.live };
|
|
1504
|
+
if (j || E.has(y)) return { status: "loading" };
|
|
1505
|
+
const u = I.get(y);
|
|
1482
1506
|
return u ? { status: "failed", message: u } : X() ? { status: "loading" } : { status: "unloaded" };
|
|
1483
1507
|
}
|
|
1484
|
-
function
|
|
1485
|
-
var
|
|
1486
|
-
const { upcoming: p } =
|
|
1487
|
-
return (
|
|
1508
|
+
function mn(i, u) {
|
|
1509
|
+
var g, x;
|
|
1510
|
+
const { upcoming: p } = on(i, Ue(y, w), u);
|
|
1511
|
+
return (x = (g = p[0]) != null ? g : i[0]) != null ? x : null;
|
|
1488
1512
|
}
|
|
1489
|
-
function
|
|
1490
|
-
const u =
|
|
1491
|
-
if (
|
|
1492
|
-
if (!
|
|
1493
|
-
if (
|
|
1494
|
-
if (
|
|
1495
|
-
const p = new Date(
|
|
1513
|
+
function hn(i) {
|
|
1514
|
+
const u = I.get(y);
|
|
1515
|
+
if (i && u) return { text: u, problem: !0 };
|
|
1516
|
+
if (!i) return null;
|
|
1517
|
+
if (E.has(y)) return { text: "Checking for changes", problem: !1 };
|
|
1518
|
+
if (i.live) return { text: "Up to date", problem: !1 };
|
|
1519
|
+
const p = new Date(i.loadedAt);
|
|
1496
1520
|
if (Number.isNaN(p.getTime())) return { text: "Loaded in the chat", problem: !1 };
|
|
1497
|
-
const
|
|
1498
|
-
return { text: `Loaded in the chat ${
|
|
1521
|
+
const g = zt(p, s);
|
|
1522
|
+
return { text: `Loaded in the chat ${Se(g.day, g.minutes, w)}`, problem: !1 };
|
|
1499
1523
|
}
|
|
1500
|
-
function
|
|
1501
|
-
var
|
|
1502
|
-
const
|
|
1524
|
+
function fe() {
|
|
1525
|
+
var x, b, T, le;
|
|
1526
|
+
const i = S(), u = tt(), p = u.status === "ready" ? u.arrivals : [], g = (x = p.find((Z) => Z.key === O)) != null ? x : mn(p, i.minutes);
|
|
1503
1527
|
return {
|
|
1504
1528
|
options: t,
|
|
1505
|
-
title: ((
|
|
1529
|
+
title: ((T = (b = t.customize) == null ? void 0 : b.title) == null ? void 0 : T.trim()) || (U ? `${U} Guest Prep` : "Guest Prep"),
|
|
1506
1530
|
timeZone: s,
|
|
1507
|
-
today:
|
|
1508
|
-
nowMinutes:
|
|
1509
|
-
day:
|
|
1510
|
-
kind:
|
|
1531
|
+
today: w,
|
|
1532
|
+
nowMinutes: i.minutes,
|
|
1533
|
+
day: y,
|
|
1534
|
+
kind: Ue(y, w),
|
|
1511
1535
|
live: X(),
|
|
1512
1536
|
dayState: u,
|
|
1513
|
-
selected:
|
|
1514
|
-
sheetOpen:
|
|
1515
|
-
request: (
|
|
1516
|
-
research:
|
|
1537
|
+
selected: g,
|
|
1538
|
+
sheetOpen: H,
|
|
1539
|
+
request: (le = f.get(y)) != null ? le : null,
|
|
1540
|
+
research: C,
|
|
1517
1541
|
calendar: N,
|
|
1518
|
-
dayNote:
|
|
1519
|
-
wineries:
|
|
1520
|
-
tenantId:
|
|
1542
|
+
dayNote: hn(k ? Le(y) : null),
|
|
1543
|
+
wineries: D,
|
|
1544
|
+
tenantId: k,
|
|
1521
1545
|
storageNote: m.mode === "none" ? "Changes won't be saved in this browser." : null,
|
|
1522
1546
|
seatingGap: c,
|
|
1523
|
-
query:
|
|
1524
|
-
filters:
|
|
1525
|
-
|
|
1547
|
+
query: $e,
|
|
1548
|
+
filters: te,
|
|
1549
|
+
seatingChoices: pe() ? ne : de
|
|
1526
1550
|
};
|
|
1527
1551
|
}
|
|
1528
|
-
const
|
|
1552
|
+
const yn = () => typeof window.matchMedia == "function" && window.matchMedia("(max-width: 900px)").matches, ee = {
|
|
1529
1553
|
toggleCalendar: () => {
|
|
1530
|
-
N = N.open ? { ...N, open: !1 } : { open: !0, month:
|
|
1554
|
+
N = N.open ? { ...N, open: !1 } : { open: !0, month: y.slice(0, 7), focus: y }, q = N.open ? "cal-focus" : "day-button", v();
|
|
1531
1555
|
},
|
|
1532
1556
|
closeCalendar: () => {
|
|
1533
|
-
N = { ...N, open: !1 },
|
|
1557
|
+
N = { ...N, open: !1 }, q = "day-button", v();
|
|
1534
1558
|
},
|
|
1535
|
-
pickDay: (
|
|
1536
|
-
N = { open: !1, month:
|
|
1537
|
-
const u =
|
|
1538
|
-
X() && (!u || Date.parse(u.loadedAt) < n().getTime() -
|
|
1559
|
+
pickDay: (i) => {
|
|
1560
|
+
N = { open: !1, month: i.slice(0, 7), focus: i }, q = "day-button", i !== y && (y = i, O = null, H = !1, C = null, nt()), v();
|
|
1561
|
+
const u = L.get(y);
|
|
1562
|
+
X() && (!u || Date.parse(u.loadedAt) < n().getTime() - Qt) && ie();
|
|
1539
1563
|
},
|
|
1540
|
-
focusDay: (
|
|
1541
|
-
N = { ...N, focus:
|
|
1564
|
+
focusDay: (i) => {
|
|
1565
|
+
N = { ...N, focus: i, month: i.slice(0, 7) }, q = "cal-focus", v();
|
|
1542
1566
|
},
|
|
1543
|
-
showMonth: (
|
|
1544
|
-
var
|
|
1545
|
-
const p = (
|
|
1546
|
-
N = { open: !0, month:
|
|
1567
|
+
showMonth: (i) => {
|
|
1568
|
+
var g;
|
|
1569
|
+
const p = (g = [Number(N.focus.slice(8, 10)), 30, 29, 28].map((x) => `${i}-${String(x).padStart(2, "0")}`).find(Pt)) != null ? g : `${i}-01`;
|
|
1570
|
+
N = { open: !0, month: i, focus: p }, v();
|
|
1547
1571
|
},
|
|
1548
|
-
select: (
|
|
1549
|
-
|
|
1572
|
+
select: (i) => {
|
|
1573
|
+
O = i, H = !0, yn() && (q = "close-sheet"), nt(), v();
|
|
1550
1574
|
},
|
|
1551
1575
|
closeSheet: () => {
|
|
1552
|
-
|
|
1576
|
+
H = !1, q = O ? `row-${O}` : null, v();
|
|
1553
1577
|
},
|
|
1554
|
-
retry: () => void (
|
|
1555
|
-
requestDay: () => void
|
|
1556
|
-
research: () => void
|
|
1557
|
-
chooseWinery: (
|
|
1578
|
+
retry: () => void (k ? ie() : at()),
|
|
1579
|
+
requestDay: () => void kn(),
|
|
1580
|
+
research: () => void wn(),
|
|
1581
|
+
chooseWinery: (i) => void Sn(i),
|
|
1558
1582
|
// Typing updates only the list, so the search box keeps focus and its caret.
|
|
1559
|
-
search: (
|
|
1560
|
-
|
|
1583
|
+
search: (i) => {
|
|
1584
|
+
$e = i, pe() || (ne = {}), bn();
|
|
1561
1585
|
},
|
|
1562
|
-
toggleFilter: (
|
|
1563
|
-
|
|
1586
|
+
toggleFilter: (i) => {
|
|
1587
|
+
te = te.includes(i) ? te.filter((u) => u !== i) : [...te, i], pe() || (ne = {}), v();
|
|
1564
1588
|
},
|
|
1565
1589
|
clearFilters: () => {
|
|
1566
|
-
|
|
1590
|
+
$e = "", te = [], ne = {}, q = "search", v();
|
|
1567
1591
|
},
|
|
1568
|
-
toggleSeating: (
|
|
1569
|
-
|
|
1592
|
+
toggleSeating: (i, u) => {
|
|
1593
|
+
(pe() ? ne : de)[i] = u, v();
|
|
1594
|
+
},
|
|
1595
|
+
setSeatings: (i, u) => {
|
|
1596
|
+
const p = pe() ? ne : de;
|
|
1597
|
+
for (const g of i) p[g] = u;
|
|
1598
|
+
q = "toggle-all", v();
|
|
1570
1599
|
}
|
|
1571
1600
|
};
|
|
1572
|
-
function
|
|
1573
|
-
const
|
|
1574
|
-
if (!u ||
|
|
1575
|
-
const p = new Set(
|
|
1576
|
-
u.replaceWith(
|
|
1577
|
-
}
|
|
1578
|
-
async function tt() {
|
|
1579
|
-
x && await Zt(m.adapter, Gt(x), JSON.stringify({ day: h, guest: z, savedOn: k }));
|
|
1601
|
+
function bn() {
|
|
1602
|
+
const i = fe(), u = G.querySelector(".list-results");
|
|
1603
|
+
if (!u || i.dayState.status !== "ready") return v();
|
|
1604
|
+
const p = new Set(i.dayState.arrivals.map((g) => g.source)).size === 1;
|
|
1605
|
+
u.replaceWith(pn(i, ee, i.dayState.arrivals, !p));
|
|
1580
1606
|
}
|
|
1581
1607
|
async function nt() {
|
|
1582
|
-
|
|
1583
|
-
const o = fr(await Ft(m.adapter, Gt(x)));
|
|
1584
|
-
!o || o.savedOn !== k || !zt(o.day) || (h = o.day, z = o.guest, N = { open: !1, month: h.slice(0, 7), focus: h });
|
|
1608
|
+
k && await Ht(m.adapter, Bt(k), JSON.stringify({ day: y, guest: O, savedOn: w }));
|
|
1585
1609
|
}
|
|
1586
|
-
function
|
|
1587
|
-
|
|
1588
|
-
const
|
|
1610
|
+
async function rt() {
|
|
1611
|
+
if (!k) return;
|
|
1612
|
+
const i = mr(await Zt(m.adapter, Bt(k)));
|
|
1613
|
+
!i || i.savedOn !== w || !Pt(i.day) || (y = i.day, O = i.guest, N = { open: !1, month: y.slice(0, 7), focus: y });
|
|
1614
|
+
}
|
|
1615
|
+
function vn(i) {
|
|
1616
|
+
var p, g;
|
|
1617
|
+
const u = fe();
|
|
1589
1618
|
return {
|
|
1590
|
-
day:
|
|
1619
|
+
day: y,
|
|
1591
1620
|
timeZone: s,
|
|
1592
1621
|
live: X(),
|
|
1593
1622
|
arrivals: u.dayState.status === "ready" ? u.dayState.rows : null,
|
|
1594
|
-
selected: (
|
|
1595
|
-
ui: { h:
|
|
1596
|
-
runSql: async (
|
|
1597
|
-
if (!
|
|
1598
|
-
const b = await
|
|
1623
|
+
selected: (g = (p = u.selected) == null ? void 0 : p.row) != null ? g : null,
|
|
1624
|
+
ui: { h: o, money: W, note: (x) => R(x), fact: (x, b, T) => $(x, b, T), chips: Me },
|
|
1625
|
+
runSql: async (x) => {
|
|
1626
|
+
if (!M || !X()) throw new Error(`${i.title} needs the New Vintage connector.`);
|
|
1627
|
+
const b = await an(M, x, "Loading a custom card on the Guest Prep page.");
|
|
1599
1628
|
if (!b.complete) throw new Error("New Vintage returned only a preview for this card.");
|
|
1600
1629
|
return b.rows;
|
|
1601
1630
|
}
|
|
1602
1631
|
};
|
|
1603
1632
|
}
|
|
1604
|
-
function
|
|
1605
|
-
const u =
|
|
1606
|
-
if (
|
|
1607
|
-
const
|
|
1608
|
-
return
|
|
1633
|
+
function xn(i) {
|
|
1634
|
+
const u = tt(), p = [y, O != null ? O : "", u.status, u.status === "ready" ? u.loadedAt + u.rows.length : ""].join("|"), g = Ye.get(i.id);
|
|
1635
|
+
if (g && g.signature === p) return g.element;
|
|
1636
|
+
const x = o("div", null, R("Loading…")), b = o("section", { class: "card custom-card", "data-card": i.id }, o("h2", null, i.title), o("p", { class: "card-purpose" }, i.purpose), x);
|
|
1637
|
+
return Ye.set(i.id, { signature: p, element: b }), Promise.resolve().then(() => i.render(vn(i))).then((T) => x.replaceChildren(T == null ? R("Nothing to show yet.") : typeof T == "string" ? R(T) : T)).catch((T) => x.replaceChildren(R(`This card couldn't load: ${T instanceof Error ? T.message : String(T)}`, "note problem"))), b;
|
|
1609
1638
|
}
|
|
1610
|
-
function
|
|
1639
|
+
function Ie(i) {
|
|
1611
1640
|
var p;
|
|
1612
|
-
return ((p = t.cards) != null ? p : []).filter((
|
|
1641
|
+
return ((p = t.cards) != null ? p : []).filter((g) => i === null ? !g.after || !(g.after === "summary" || ln.includes(g.after)) : g.after === i).map(xn);
|
|
1613
1642
|
}
|
|
1614
|
-
function
|
|
1615
|
-
var
|
|
1616
|
-
if (
|
|
1617
|
-
const
|
|
1618
|
-
|
|
1619
|
-
const
|
|
1643
|
+
function v() {
|
|
1644
|
+
var me, Y, he, Nt, At, Mt;
|
|
1645
|
+
if (ge) return;
|
|
1646
|
+
const i = document.activeElement, u = (Y = q != null ? q : (me = i == null ? void 0 : i.getAttribute) == null ? void 0 : me.call(i, "data-fid")) != null ? Y : null, p = !q && i instanceof HTMLInputElement ? [i.selectionStart, i.selectionEnd] : null;
|
|
1647
|
+
q = null;
|
|
1648
|
+
const g = G.querySelector(".panel"), x = g ? { key: g.getAttribute("data-key"), top: (Nt = (he = g.querySelector(".panel-body")) == null ? void 0 : he.scrollTop) != null ? Nt : 0 } : null, b = fe(), T = ea(b, ee, (ce) => Ie(ce)), le = o(
|
|
1620
1649
|
"div",
|
|
1621
|
-
{ class: `page${
|
|
1622
|
-
Lr(b, ee),
|
|
1623
|
-
b.storageNote ? P(b.storageNote, "storage-note") : null,
|
|
1650
|
+
{ class: `page${H && T ? " sheet-open" : ""}` },
|
|
1624
1651
|
Ir(b, ee),
|
|
1625
|
-
|
|
1626
|
-
b
|
|
1627
|
-
|
|
1628
|
-
|
|
1652
|
+
b.storageNote ? R(b.storageNote, "storage-note") : null,
|
|
1653
|
+
Or(b, ee),
|
|
1654
|
+
Rr(b),
|
|
1655
|
+
b.dayState.status === "ready" ? Ie("summary") : null,
|
|
1656
|
+
o("div", { class: "layout" }, o("div", { style: "min-width:0" }, Gr(b, ee), Ie(null)), T),
|
|
1657
|
+
H && T ? o("div", { class: "backdrop", "aria-hidden": "true", onclick: () => ee.closeSheet() }) : null
|
|
1629
1658
|
);
|
|
1630
|
-
if (
|
|
1631
|
-
const
|
|
1632
|
-
|
|
1659
|
+
if (G.replaceChildren(le), x && x.key === ((At = b.selected) == null ? void 0 : At.key)) {
|
|
1660
|
+
const ce = G.querySelector(".panel-body");
|
|
1661
|
+
ce && (ce.scrollTop = x.top);
|
|
1633
1662
|
}
|
|
1634
|
-
const
|
|
1635
|
-
|
|
1663
|
+
const Z = u ? Array.from(G.querySelectorAll("[data-fid]")).find((ce) => ce.getAttribute("data-fid") === u) : null;
|
|
1664
|
+
Z == null || Z.focus(), p && Z instanceof HTMLInputElement && p[0] !== null && Z.setSelectionRange(p[0], (Mt = p[1]) != null ? Mt : p[0]), et();
|
|
1636
1665
|
}
|
|
1637
|
-
async function ie(
|
|
1638
|
-
if (!
|
|
1639
|
-
const u =
|
|
1640
|
-
if (!
|
|
1641
|
-
|
|
1666
|
+
async function ie(i = y) {
|
|
1667
|
+
if (!M || !k || ge) return;
|
|
1668
|
+
const u = P;
|
|
1669
|
+
if (!tn.includes(s)) {
|
|
1670
|
+
I.set(i, `Guest Prep can't load days in the ${s} time zone yet. Ask in this chat to set the winery's time zone.`), v();
|
|
1642
1671
|
return;
|
|
1643
1672
|
}
|
|
1644
|
-
|
|
1673
|
+
E.add(i), I.delete(i), v();
|
|
1645
1674
|
try {
|
|
1646
|
-
|
|
1647
|
-
const p = await
|
|
1648
|
-
if (u !==
|
|
1649
|
-
|
|
1675
|
+
h || (h = await Ot(M, _ ? null : d), _ = !0);
|
|
1676
|
+
const p = await Rt(M, h, { timeZone: s, day: i });
|
|
1677
|
+
if (u !== P) return;
|
|
1678
|
+
L.set(i, { rows: p, loadedAt: n().toISOString(), live: !0 });
|
|
1650
1679
|
} catch (p) {
|
|
1651
|
-
if (u !==
|
|
1652
|
-
|
|
1680
|
+
if (u !== P) return;
|
|
1681
|
+
I.set(i, qe(ve(p)));
|
|
1653
1682
|
} finally {
|
|
1654
|
-
u ===
|
|
1683
|
+
u === P && E.delete(i), v();
|
|
1655
1684
|
}
|
|
1656
1685
|
}
|
|
1657
|
-
async function
|
|
1658
|
-
const
|
|
1659
|
-
if (!
|
|
1660
|
-
const u =
|
|
1661
|
-
|
|
1686
|
+
async function wn() {
|
|
1687
|
+
const i = fe().selected;
|
|
1688
|
+
if (!i || !M || !k || (C == null ? void 0 : C.status) === "pending") return;
|
|
1689
|
+
const u = y, p = P;
|
|
1690
|
+
C = { key: i.key, status: "pending" }, v();
|
|
1662
1691
|
try {
|
|
1663
|
-
|
|
1664
|
-
const
|
|
1665
|
-
if (p !==
|
|
1666
|
-
const b =
|
|
1692
|
+
h || (h = await Ot(M, _ ? null : d), _ = !0);
|
|
1693
|
+
const g = i.id.replace(/[^A-Za-z0-9-]/g, ""), x = await Rt(M, h, { timeZone: s, day: u, arrival: { source: i.source, id: g } });
|
|
1694
|
+
if (p !== P) return;
|
|
1695
|
+
const b = Le(u);
|
|
1667
1696
|
if (b) {
|
|
1668
|
-
const
|
|
1669
|
-
var
|
|
1670
|
-
return `${
|
|
1671
|
-
},
|
|
1672
|
-
let
|
|
1673
|
-
for (const
|
|
1674
|
-
|
|
1675
|
-
|
|
1697
|
+
const T = (Y) => {
|
|
1698
|
+
var he;
|
|
1699
|
+
return `${Y.source === "tock" ? "tock" : "commerce7"}:${String((he = Y.arr_id) != null ? he : "")}`;
|
|
1700
|
+
}, le = x.filter((Y) => T(Y) === i.key), Z = [];
|
|
1701
|
+
let me = !1;
|
|
1702
|
+
for (const Y of b.rows)
|
|
1703
|
+
T(Y) !== i.key ? Z.push(Y) : me || (Z.push(...le), me = !0);
|
|
1704
|
+
L.set(u, { rows: Z, loadedAt: b.loadedAt, live: b.live });
|
|
1676
1705
|
}
|
|
1677
|
-
|
|
1678
|
-
} catch (
|
|
1679
|
-
if (p !==
|
|
1680
|
-
|
|
1706
|
+
C = null;
|
|
1707
|
+
} catch (g) {
|
|
1708
|
+
if (p !== P) return;
|
|
1709
|
+
C = { key: i.key, status: "failed", message: qe(ve(g)) };
|
|
1681
1710
|
}
|
|
1682
|
-
|
|
1711
|
+
v();
|
|
1683
1712
|
}
|
|
1684
|
-
async function
|
|
1713
|
+
async function kn() {
|
|
1685
1714
|
var p;
|
|
1686
|
-
if (!
|
|
1687
|
-
const
|
|
1688
|
-
|
|
1689
|
-
const u = await
|
|
1690
|
-
|
|
1715
|
+
if (!k || ((p = f.get(y)) == null ? void 0 : p.kind) === "pending") return;
|
|
1716
|
+
const i = y;
|
|
1717
|
+
f.set(i, { kind: "pending" }), v();
|
|
1718
|
+
const u = await _n(lr({ day: i, wineryName: U, tenantId: k, timeZone: s }), { title: ir, followUp: t.followUp });
|
|
1719
|
+
f.set(i, u), v();
|
|
1691
1720
|
}
|
|
1692
|
-
async function
|
|
1721
|
+
async function Sn(i) {
|
|
1693
1722
|
var u, p;
|
|
1694
|
-
!
|
|
1723
|
+
if (!(!z || !i || i === k)) {
|
|
1724
|
+
P += 1, k = i, U = (p = (u = D == null ? void 0 : D.find((g) => g.tenantId === i)) == null ? void 0 : u.name) != null ? p : U, M = Oe(z, i), L.clear(), I.clear(), E.clear(), O = null, C = null;
|
|
1725
|
+
for (const g of Object.keys(de)) delete de[g];
|
|
1726
|
+
ne = {}, await Ht(m.adapter, Ft, i), v(), await ie();
|
|
1727
|
+
}
|
|
1695
1728
|
}
|
|
1696
|
-
async function
|
|
1697
|
-
var u, p,
|
|
1698
|
-
|
|
1699
|
-
const
|
|
1700
|
-
if (
|
|
1701
|
-
if (!
|
|
1702
|
-
|
|
1729
|
+
async function at() {
|
|
1730
|
+
var u, p, g;
|
|
1731
|
+
j = !0, B = null, v();
|
|
1732
|
+
const i = t.tenantId ? null : await Zt(m.adapter, Ft);
|
|
1733
|
+
if (z = (u = t.callTool) != null ? u : await Nn(t.connectorName), !ge) {
|
|
1734
|
+
if (!z) {
|
|
1735
|
+
j = !1, k || (B = Ce() === "claude" ? "Picking a winery needs the New Vintage connector. Add it in this chat, then reload the page." : "Ask in the chat which winery this page is for."), await rt(), v();
|
|
1703
1736
|
return;
|
|
1704
1737
|
}
|
|
1705
|
-
if (!
|
|
1738
|
+
if (!k) {
|
|
1706
1739
|
try {
|
|
1707
|
-
|
|
1740
|
+
D = await Fn(Oe(z, null));
|
|
1708
1741
|
} catch (b) {
|
|
1709
|
-
|
|
1742
|
+
j = !1, B = qe(ve(b)), v();
|
|
1710
1743
|
return;
|
|
1711
1744
|
}
|
|
1712
|
-
const
|
|
1713
|
-
if (!
|
|
1714
|
-
|
|
1745
|
+
const x = (p = D.find((b) => b.tenantId === i)) != null ? p : D.length === 1 ? D[0] : null;
|
|
1746
|
+
if (!x) {
|
|
1747
|
+
j = !1, B = D.length ? null : "The New Vintage connector can't reach any winery for this account.", v();
|
|
1715
1748
|
return;
|
|
1716
1749
|
}
|
|
1717
|
-
|
|
1750
|
+
k = x.tenantId, U = (g = t.wineryName) != null ? g : x.name;
|
|
1718
1751
|
}
|
|
1719
|
-
|
|
1752
|
+
M = Oe(z, k), await rt(), j = !1, await ie(), !ge && !Te && (Te = setInterval(() => void (X() && !E.has(y) ? ie() : void 0), Qt));
|
|
1720
1753
|
}
|
|
1721
1754
|
}
|
|
1722
|
-
function
|
|
1723
|
-
const
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
},
|
|
1755
|
+
function st() {
|
|
1756
|
+
const i = 6e4 - n().getTime() % 6e4 + 50;
|
|
1757
|
+
ze = setTimeout(() => {
|
|
1758
|
+
w = S().day, v(), st();
|
|
1759
|
+
}, i);
|
|
1727
1760
|
}
|
|
1728
|
-
return
|
|
1761
|
+
return v(), st(), at(), {
|
|
1729
1762
|
refresh: () => X() ? ie() : Promise.resolve(),
|
|
1730
1763
|
destroy: () => {
|
|
1731
|
-
|
|
1764
|
+
ge = !0, ze && clearTimeout(ze), Te && clearInterval(Te), window.removeEventListener("resize", Je), document.removeEventListener("keydown", Qe), document.removeEventListener("mousedown", Xe), Ke.remove(), We.remove(), G.remove();
|
|
1732
1765
|
},
|
|
1733
1766
|
state: () => {
|
|
1734
1767
|
var u, p;
|
|
1735
|
-
const
|
|
1736
|
-
return { day:
|
|
1768
|
+
const i = fe();
|
|
1769
|
+
return { day: y, tenantId: k, live: X(), selected: (p = (u = i.selected) == null ? void 0 : u.key) != null ? p : null, status: i.dayState.status };
|
|
1737
1770
|
}
|
|
1738
1771
|
};
|
|
1739
1772
|
}
|
|
1740
|
-
function
|
|
1773
|
+
function ra(e, t) {
|
|
1741
1774
|
const n = typeof e == "string" ? document.querySelector(e) : e;
|
|
1742
1775
|
if (!n) throw new Error(`NVGuestPrep: no element matches ${String(e)}`);
|
|
1743
|
-
return
|
|
1776
|
+
return ta(n, t);
|
|
1744
1777
|
}
|
|
1745
1778
|
export {
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1779
|
+
be as DEFAULT_SETTINGS,
|
|
1780
|
+
na as SECTION_IDS,
|
|
1781
|
+
tn as SUPPORTED_TIME_ZONES,
|
|
1782
|
+
cr as VERSION,
|
|
1783
|
+
Ln as fillGuestPrepQuery,
|
|
1784
|
+
ra as mount,
|
|
1785
|
+
ur as pageSetup
|
|
1753
1786
|
};
|