@quoreadmin/ui 1.10.32 → 1.10.33
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/dist/index.css +1 -1
- package/dist/index147.js +253 -250
- package/dist/index157.js +204 -191
- package/dist/index182.js +14 -14
- package/dist/index183.js +3 -3
- package/dist/index186.js +4 -4
- package/dist/index193.js +10 -10
- package/dist/index195.js +10 -10
- package/dist/index198.js +17 -17
- package/dist/index201.js +28 -28
- package/dist/index202.js +2 -2
- package/dist/index203.js +2 -2
- package/dist/index204.js +1 -1
- package/dist/index212.js +4 -4
- package/dist/index213.js +84 -29
- package/dist/index214.js +400 -109
- package/dist/index215.js +22 -36
- package/dist/index216.js +33 -26
- package/dist/index217.js +111 -31
- package/dist/index218.js +35 -50
- package/dist/index219.js +26 -43
- package/dist/index220.js +35 -3
- package/dist/index221.js +51 -9
- package/dist/index222.js +42 -18
- package/dist/index223.js +4 -10
- package/dist/index224.js +9 -10
- package/dist/index225.js +18 -38
- package/dist/index226.js +10 -21
- package/dist/index227.js +10 -88
- package/dist/index228.js +35 -403
- package/dist/index229.js +21 -22
- package/dist/index230.js +156 -122
- package/dist/index231.js +225 -35
- package/dist/index232.js +37 -80
- package/dist/index233.js +10 -20
- package/dist/index234.js +160 -19
- package/dist/index235.js +10 -10
- package/dist/index236.js +11 -11
- package/dist/index237.js +15 -13
- package/dist/index238.js +167 -129
- package/dist/index239.js +69 -19
- package/dist/index240.js +33 -21
- package/dist/index241.js +25 -184
- package/dist/index242.js +21 -69
- package/dist/index243.js +22 -34
- package/dist/index244.js +19 -39
- package/dist/index245.js +833 -158
- package/dist/index246.js +683 -209
- package/dist/index247.js +176 -37
- package/dist/index248.js +20 -10
- package/dist/index249.js +20 -253
- package/dist/index250.js +21 -7
- package/dist/index251.js +20 -138
- package/dist/index252.js +20 -83
- package/dist/index253.js +3 -22
- package/dist/index254.js +186 -21
- package/dist/index255.js +132 -19
- package/dist/index256.js +1131 -744
- package/dist/index257.js +104 -679
- package/dist/index258.js +20 -176
- package/dist/index259.js +11 -11
- package/dist/index260.js +15 -13
- package/dist/index261.js +37 -19
- package/dist/index262.js +29 -3
- package/dist/index263.js +19 -186
- package/dist/index264.js +18 -131
- package/dist/index265.js +2 -1223
- package/dist/index266.js +2 -20
- package/dist/index267.js +80 -22
- package/dist/index268.js +13 -15
- package/dist/index269.js +12 -21
- package/dist/index270.js +253 -20
- package/dist/index271.js +8 -20
- package/dist/index272.js +138 -2
- package/dist/index273.js +83 -2
- package/dist/index274.js +6 -6
- package/dist/index275.js +1 -1
- package/dist/index276.js +1 -1
- package/dist/index289.js +2 -2
- package/dist/index290.js +54 -2
- package/dist/index291.js +2 -2
- package/dist/index292.js +25 -53
- package/dist/index293.js +15 -19
- package/dist/index294.js +9 -9
- package/dist/index295.js +16 -22
- package/dist/index296.js +15 -14
- package/dist/index297.js +21 -15
- package/dist/index298.js +3 -23
- package/dist/index299.js +27 -3
- package/dist/index300.js +2 -27
- package/dist/index301.js +74 -230
- package/dist/index302.js +21 -5
- package/dist/index303.js +925 -124
- package/dist/index304.js +21 -67
- package/dist/index305.js +18 -85
- package/dist/index306.js +19 -28
- package/dist/index307.js +67 -7
- package/dist/index308.js +19 -75
- package/dist/index309.js +19 -4
- package/dist/index310.js +22 -2
- package/dist/index311.js +21 -82
- package/dist/index312.js +62 -53
- package/dist/index313.js +1533 -5
- package/dist/index314.js +385 -4
- package/dist/index315.js +2700 -148
- package/dist/index316.js +83 -60
- package/dist/index317.js +3798 -75
- package/dist/index318.js +55 -1529
- package/dist/index319.js +14 -385
- package/dist/index320.js +67 -2714
- package/dist/index321.js +189 -73
- package/dist/index322.js +222 -3774
- package/dist/index323.js +32 -55
- package/dist/index324.js +234 -14
- package/dist/index325.js +5 -83
- package/dist/index326.js +122 -190
- package/dist/index327.js +61 -239
- package/dist/index328.js +83 -75
- package/dist/index329.js +28 -21
- package/dist/index330.js +9 -935
- package/dist/index331.js +74 -21
- package/dist/index332.js +3 -19
- package/dist/index333.js +2 -20
- package/dist/index334.js +80 -66
- package/dist/index335.js +53 -18
- package/dist/index336.js +6 -19
- package/dist/index337.js +4 -21
- package/dist/index338.js +178 -21
- package/dist/index339.js +62 -62
- package/dist/index340.js +74 -36
- package/dist/index341.js +8 -9
- package/dist/index342.js +13 -10
- package/dist/index343.js +54 -13
- package/dist/index344.js +12 -10
- package/dist/index345.js +12 -15
- package/dist/index346.js +57 -8
- package/dist/index347.js +51 -12
- package/dist/index348.js +25 -49
- package/dist/index349.js +2 -12
- package/dist/index350.js +5 -14
- package/dist/index351.js +2 -58
- package/dist/index352.js +23 -52
- package/dist/index353.js +38 -28
- package/dist/index354.js +2 -2
- package/dist/index355.js +10 -4
- package/dist/index356.js +20 -2
- package/dist/index357.js +9 -22
- package/dist/index358.js +9 -40
- package/dist/index359.js +17 -2
- package/dist/index360.js +2 -11
- package/dist/index361.js +9 -20
- package/dist/index362.js +10 -2
- package/dist/index363.js +13 -8
- package/dist/index364.js +19 -20
- package/dist/index365.js +19 -55
- package/dist/index366.js +63 -28
- package/dist/index367.js +37 -7
- package/dist/index368.js +18 -49
- package/dist/index369.js +56 -6
- package/dist/index370.js +27 -10
- package/dist/index371.js +7 -7
- package/dist/index372.js +51 -27
- package/dist/index373.js +6 -2
- package/dist/index374.js +11 -69
- package/dist/index375.js +6 -166
- package/dist/index376.js +28 -20
- package/dist/index377.js +2 -20
- package/dist/index378.js +67 -61
- package/dist/index379.js +166 -36
- package/dist/index380.js +17 -31
- package/dist/index381.js +100 -10
- package/dist/index382.js +90 -3
- package/dist/index383.js +98 -4
- package/dist/index386.js +30 -11
- package/dist/index387.js +10 -4
- package/dist/index388.js +4 -33
- package/dist/index389.js +4 -31
- package/dist/index390.js +12 -28
- package/dist/index391.js +5 -61
- package/dist/index392.js +33 -101
- package/dist/index393.js +31 -91
- package/dist/index394.js +27 -97
- package/dist/index395.js +60 -16
- package/dist/index396.js +1 -1
- package/dist/index401.js +1 -1
- package/dist/index402.js +2 -2
- package/dist/index45.js +9 -7
- package/dist/index50.js +2 -2
- package/dist/index98.js +101 -29
- package/dist/src/components/date-picker/date-picker.d.ts +33 -0
- package/dist/src/components/date-picker/date-picker.stories.d.ts +108 -0
- package/dist/src/components/room-details-popover/room-details-popover.d.ts +37 -12
- package/package.json +1 -1
package/dist/index147.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useI18n as
|
|
3
|
-
import { DateTime as
|
|
1
|
+
import { defineComponent as Tt, ref as i, computed as w, watch as B, onMounted as Dt, onUnmounted as Ot } from "vue";
|
|
2
|
+
import { useI18n as kt } from "vue-i18n";
|
|
3
|
+
import { DateTime as g } from "./index174.js";
|
|
4
4
|
import "./index197.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
const
|
|
5
|
+
import Et from "./index2.js";
|
|
6
|
+
import At from "./index3.js";
|
|
7
|
+
import St from "./index4.js";
|
|
8
|
+
import bt from "./index21.js";
|
|
9
|
+
import Nt from "./index28.js";
|
|
10
|
+
import Ct from "./index41.js";
|
|
11
|
+
import Mt from "./index20.js";
|
|
12
|
+
import Rt from "./index48.js";
|
|
13
|
+
import Ht from "./index50.js";
|
|
14
|
+
import Lt from "./index49.js";
|
|
15
|
+
import Pt from "./index52.js";
|
|
16
|
+
import Z from "./index198.js";
|
|
17
|
+
const qt = 996, ea = Tt({
|
|
18
18
|
name: "QRoomDetailsPopover",
|
|
19
19
|
components: {
|
|
20
|
-
QAccordion:
|
|
21
|
-
QActivityItem:
|
|
22
|
-
QAvatar:
|
|
23
|
-
QDatePicker:
|
|
24
|
-
QDivider:
|
|
25
|
-
QIcon:
|
|
26
|
-
QPopover:
|
|
27
|
-
QTag:
|
|
28
|
-
QTextarea:
|
|
29
|
-
QTimePicker:
|
|
30
|
-
QTooltip:
|
|
20
|
+
QAccordion: Et,
|
|
21
|
+
QActivityItem: At,
|
|
22
|
+
QAvatar: St,
|
|
23
|
+
QDatePicker: Mt,
|
|
24
|
+
QDivider: bt,
|
|
25
|
+
QIcon: Nt,
|
|
26
|
+
QPopover: Ct,
|
|
27
|
+
QTag: Rt,
|
|
28
|
+
QTextarea: Lt,
|
|
29
|
+
QTimePicker: Ht,
|
|
30
|
+
QTooltip: Pt
|
|
31
31
|
},
|
|
32
32
|
props: {
|
|
33
33
|
id: {
|
|
@@ -172,10 +172,13 @@ const Pt = 996, Zt = It({
|
|
|
172
172
|
},
|
|
173
173
|
emits: ["create:callback", "create:todo", "refresh:pms", "show:toast", "toggle"],
|
|
174
174
|
setup(s, { emit: f }) {
|
|
175
|
-
const { t: u } =
|
|
176
|
-
const e =
|
|
177
|
-
return `${
|
|
178
|
-
},
|
|
175
|
+
const { t: u } = kt(), De = () => {
|
|
176
|
+
const e = g.now().setZone(s.propertyTimeZone), t = e.isValid ? e : g.now(), a = t.hour, o = t.minute, n = a >= 12 ? "PM" : "AM";
|
|
177
|
+
return `${a % 12 || 12}:${String(o).padStart(2, "0")} ${n}`;
|
|
178
|
+
}, X = () => {
|
|
179
|
+
const e = g.now().setZone(s.propertyTimeZone), t = e.isValid ? e : g.now();
|
|
180
|
+
return new Date(t.year, t.month - 1, t.day, 12, 0, 0, 0);
|
|
181
|
+
}, Oe = "11:59 PM", r = i(s.room), ue = i(!1), ce = i("left"), ee = i([
|
|
179
182
|
{
|
|
180
183
|
id: 1,
|
|
181
184
|
label: u("HC_DEPARTMENT")
|
|
@@ -200,11 +203,11 @@ const Pt = 996, Zt = It({
|
|
|
200
203
|
problem: null,
|
|
201
204
|
notes: "",
|
|
202
205
|
tokenId: r.value?.tokenId
|
|
203
|
-
}), G = i(250), U = i(290), C = i([]),
|
|
206
|
+
}), G = i(250), U = i(290), C = i([]), ke = i([]), te = i(!0), ae = i(!0), M = i({
|
|
204
207
|
info: !0,
|
|
205
208
|
tickets: !0,
|
|
206
209
|
comments: !0
|
|
207
|
-
}),
|
|
210
|
+
}), oe = i(!0), Le = i(s.guestDetails), O = i([]), y = i({
|
|
208
211
|
actionItems: !1,
|
|
209
212
|
activity: !1,
|
|
210
213
|
conversationToggle: !1,
|
|
@@ -213,7 +216,7 @@ const Pt = 996, Zt = It({
|
|
|
213
216
|
roomNotices: !1,
|
|
214
217
|
sendingMessage: !1,
|
|
215
218
|
tickets: !1
|
|
216
|
-
}), N = i([]),
|
|
219
|
+
}), N = i([]), de = i([]), me = i("bottom"), R = i(null), H = i(!1), W = i(!1), j = i(""), ve = i(!1), S = i(!1), k = i(null), $ = i(null), Pe = 3e4, d = i({
|
|
217
220
|
assignType: null,
|
|
218
221
|
department: null,
|
|
219
222
|
due: /* @__PURE__ */ new Date(),
|
|
@@ -232,14 +235,14 @@ const Pt = 996, Zt = It({
|
|
|
232
235
|
id: 1,
|
|
233
236
|
label: u("HC_HOTEL_GUEST")
|
|
234
237
|
}
|
|
235
|
-
]),
|
|
236
|
-
endDate:
|
|
238
|
+
]), pe = i(!1), E = i(null), _ = i({
|
|
239
|
+
endDate: X(),
|
|
237
240
|
issue: null,
|
|
238
241
|
notes: "",
|
|
239
|
-
startDate:
|
|
240
|
-
startTime:
|
|
241
|
-
endTime:
|
|
242
|
-
}),
|
|
242
|
+
startDate: X(),
|
|
243
|
+
startTime: De(),
|
|
244
|
+
endTime: Oe
|
|
245
|
+
}), V = i([]), se = i(!1), fe = i([]), qe = i(!0), A = i([]), L = i([]), Fe = i([
|
|
243
246
|
{
|
|
244
247
|
label: u("HC_COMPLAINT"),
|
|
245
248
|
id: "complaint"
|
|
@@ -256,7 +259,7 @@ const Pt = 996, Zt = It({
|
|
|
256
259
|
label: u("HC_WORK_ORDER"),
|
|
257
260
|
id: "work_order"
|
|
258
261
|
}
|
|
259
|
-
]),
|
|
262
|
+
]), Y = i(), P = i(null), v = i({
|
|
260
263
|
assignType: null,
|
|
261
264
|
department: null,
|
|
262
265
|
due: /* @__PURE__ */ new Date(),
|
|
@@ -265,7 +268,7 @@ const Pt = 996, Zt = It({
|
|
|
265
268
|
notes: "",
|
|
266
269
|
person: null,
|
|
267
270
|
requestedBy: null
|
|
268
|
-
}),
|
|
271
|
+
}), he = i([]), q = i([]), F = i([]), xe = w(() => {
|
|
269
272
|
switch (r.value.cleaning?.name) {
|
|
270
273
|
case "CLEAN":
|
|
271
274
|
case "INSPECTED":
|
|
@@ -278,18 +281,18 @@ const Pt = 996, Zt = It({
|
|
|
278
281
|
default:
|
|
279
282
|
return "";
|
|
280
283
|
}
|
|
281
|
-
}),
|
|
284
|
+
}), Be = w(() => {
|
|
282
285
|
const e = r.value?.hkTaskTypeId || s.room?.hkTaskTypeId;
|
|
283
|
-
return Number(e) ===
|
|
284
|
-
}),
|
|
286
|
+
return Number(e) === qt;
|
|
287
|
+
}), Ge = w(() => s.cleanInitiativeInfo?.cleanInitiativeName ?? r.value?.cleanInitiativeInfo?.cleanInitiativeName ?? "Greener Stay"), Ue = w(() => s.cleanInitiativeInfo?.imgUrl ?? r.value?.cleanInitiativeInfo?.imgUrl ?? ""), We = w(() => {
|
|
285
288
|
const e = b.value.toLowerCase();
|
|
286
289
|
return s.quickReplies.filter((t) => t.toLowerCase().match(e));
|
|
287
|
-
}),
|
|
290
|
+
}), je = w(() => {
|
|
288
291
|
if (!N.value.length) return [];
|
|
289
292
|
const e = [];
|
|
290
293
|
let t = null;
|
|
291
294
|
return N.value.forEach((a) => {
|
|
292
|
-
const o =
|
|
295
|
+
const o = g.fromFormat(
|
|
293
296
|
a.dateUtc,
|
|
294
297
|
"yyyy-MM-dd HH:mm:ss",
|
|
295
298
|
{ zone: "utc" }
|
|
@@ -304,11 +307,11 @@ const Pt = 996, Zt = It({
|
|
|
304
307
|
formattedTime: o.toFormat("h:mma").replace("AM", "am").replace("PM", "pm")
|
|
305
308
|
});
|
|
306
309
|
}), e;
|
|
307
|
-
}),
|
|
310
|
+
}), Ee = w(() => A.value.length ? !!A.value.find(
|
|
308
311
|
(t) => t.type === "complaint"
|
|
309
|
-
) : !1),
|
|
312
|
+
) : !1), $e = w(() => A.value.length ? !!A.value.find(
|
|
310
313
|
(t) => t.type === "callback"
|
|
311
|
-
) : !1),
|
|
314
|
+
) : !1), Qe = w(() => {
|
|
312
315
|
let e = [];
|
|
313
316
|
return O.value[0] && O.value[0].options === void 0 ? O.value.forEach((t) => {
|
|
314
317
|
e.push({
|
|
@@ -316,15 +319,15 @@ const Pt = 996, Zt = It({
|
|
|
316
319
|
label: t.display_name
|
|
317
320
|
});
|
|
318
321
|
}) : e = O.value, e;
|
|
319
|
-
}),
|
|
322
|
+
}), Ae = w(() => r.value.occupancy?.name === "OCCUPIED"), Ve = w(() => Ae.value && Ee.value ? "HK_ROOM_STATUS_Occupied_Complaint" : "HK_ROOM_STATUS_Occupied"), Ye = w(() => {
|
|
320
323
|
switch (E.value?.id) {
|
|
321
324
|
case "request":
|
|
322
325
|
case "work_order":
|
|
323
|
-
return
|
|
326
|
+
return ee.value[0];
|
|
324
327
|
default:
|
|
325
328
|
return null;
|
|
326
329
|
}
|
|
327
|
-
}),
|
|
330
|
+
}), Je = w(() => {
|
|
328
331
|
if (C.value)
|
|
329
332
|
switch (E.value?.id) {
|
|
330
333
|
case "request":
|
|
@@ -335,7 +338,7 @@ const Pt = 996, Zt = It({
|
|
|
335
338
|
return null;
|
|
336
339
|
}
|
|
337
340
|
return null;
|
|
338
|
-
}),
|
|
341
|
+
}), ze = w(() => {
|
|
339
342
|
switch (E.value?.id) {
|
|
340
343
|
case "request":
|
|
341
344
|
return Q.value[1];
|
|
@@ -344,27 +347,27 @@ const Pt = 996, Zt = It({
|
|
|
344
347
|
default:
|
|
345
348
|
return null;
|
|
346
349
|
}
|
|
347
|
-
}), Ke =
|
|
350
|
+
}), Ke = w(() => {
|
|
348
351
|
let e = "";
|
|
349
352
|
if (r.value && r.value.reservations[0]) {
|
|
350
|
-
const t =
|
|
353
|
+
const t = g.fromISO(
|
|
351
354
|
r.value.reservations[0].arrivalDate
|
|
352
|
-
), a = t.toFormat("MMM"), o = t.day, n = t.year, l =
|
|
355
|
+
), a = t.toFormat("MMM"), o = t.day, n = t.year, l = g.fromISO(
|
|
353
356
|
r.value.reservations[0].departureDate
|
|
354
357
|
), c = l.toFormat("MMM"), m = l.day, h = l.year;
|
|
355
358
|
e += a + " " + o, n !== h && (e += ", " + n), a === c ? e += "-" + m : e += " - " + c + " " + m, e += ", " + h;
|
|
356
359
|
}
|
|
357
360
|
return e;
|
|
358
|
-
}),
|
|
359
|
-
let e =
|
|
361
|
+
}), Ze = w(() => {
|
|
362
|
+
let e = V.value;
|
|
360
363
|
return e = [...new Set(e)], e;
|
|
361
|
-
}), Xe =
|
|
364
|
+
}), Xe = w(() => {
|
|
362
365
|
const e = E.value?.id;
|
|
363
366
|
if (!e)
|
|
364
367
|
return !1;
|
|
365
368
|
switch (e) {
|
|
366
369
|
case "room_notice":
|
|
367
|
-
return
|
|
370
|
+
return _.value.issue && _.value.startDate && _.value.endDate;
|
|
368
371
|
case "complaint":
|
|
369
372
|
return p.value.problem && p.value.guestName && p.value.guestMood;
|
|
370
373
|
case "work_order":
|
|
@@ -374,48 +377,48 @@ const Pt = 996, Zt = It({
|
|
|
374
377
|
default:
|
|
375
378
|
return !1;
|
|
376
379
|
}
|
|
377
|
-
}),
|
|
378
|
-
|
|
379
|
-
},
|
|
380
|
+
}), Se = () => {
|
|
381
|
+
se.value = !1, H.value = !1, ue.value = !1, pe.value = !1, O.value = [], de.value = [], he.value = [], q.value = [], F.value = [], E.value = null, _.value.issue = null, _.value.startDate = X(), _.value.endDate = X(), _.value.startTime = De(), _.value.endTime = Oe, _.value.notes = "", p.value.guestName = "", p.value.guestEmail = "", p.value.guestPhone = "", p.value.guestMood = null, p.value.guestLoyalty = "", p.value.problem = null, p.value.checkInDate = /* @__PURE__ */ new Date(), p.value.checkOutDate = /* @__PURE__ */ new Date(), p.value.notes = "", v.value.assignType = null, v.value.department = null, v.value.person = null, v.value.due = /* @__PURE__ */ new Date(), v.value.item = null, v.value.issue = null, v.value.notes = "", d.value.assignType = null, d.value.department = null, d.value.person = null, d.value.due = /* @__PURE__ */ new Date(), d.value.item = null, d.value.notes = "", d.value.when = null, d.value.where = null;
|
|
382
|
+
}, et = async () => {
|
|
380
383
|
f("create:callback", r.value), f("toggle", !1);
|
|
381
|
-
},
|
|
384
|
+
}, x = (e) => {
|
|
382
385
|
const t = [];
|
|
383
386
|
(Array.isArray(e) ? e : Object.values(e)).forEach((o) => {
|
|
384
|
-
const n = o.senderType || o.sender_type, l = o.senderName || "", c = o.senderId || o.sender_id, m = o.profileImg || o.profile_img, h = l ? l.split(" ") : ["", ""],
|
|
387
|
+
const n = o.senderType || o.sender_type, l = o.senderName || "", c = o.senderId || o.sender_id, m = o.profileImg || o.profile_img, h = l ? l.split(" ") : ["", ""], I = o.user_first_name || o.guest_first_name || h[0] || "", K = o.user_last_name || o.guest_last_name || h.slice(1).join(" ") || "", le = I && K ? `${I} ${K}` : I || "Auto-Reply", ie = n === "system" || n === "user", T = n === "guest";
|
|
385
388
|
let D = {
|
|
386
389
|
id: o.id,
|
|
387
390
|
isPropertyEmployee: n === "user",
|
|
388
391
|
isSent: !!o.sent,
|
|
389
392
|
isSystemMessage: n === "system",
|
|
390
|
-
isStaffMessage:
|
|
393
|
+
isStaffMessage: ie,
|
|
391
394
|
isGuestMessage: T,
|
|
392
395
|
comment: o.content,
|
|
393
396
|
dateUtc: o.sent || o.created,
|
|
394
397
|
user: {
|
|
395
|
-
firstName:
|
|
398
|
+
firstName: I || "Auto-Reply",
|
|
396
399
|
icon: "",
|
|
397
400
|
id: c || "system-message",
|
|
398
401
|
initials: "",
|
|
399
|
-
lastName:
|
|
400
|
-
name:
|
|
402
|
+
lastName: K || "",
|
|
403
|
+
name: le,
|
|
401
404
|
src: m || ""
|
|
402
405
|
}
|
|
403
406
|
};
|
|
404
|
-
D.user.firstName && D.user.lastName ? D.user.initials = D.user.firstName[0] + D.user.lastName[0] : D.user.firstName && (D.user.initials = D.user.firstName[0]),
|
|
407
|
+
D.user.firstName && D.user.lastName ? D.user.initials = D.user.firstName[0] + D.user.lastName[0] : D.user.firstName && (D.user.initials = D.user.firstName[0]), ie && (D.user.icon = "property-fill"), t.push(D);
|
|
405
408
|
}), N.value = t;
|
|
406
|
-
},
|
|
409
|
+
}, tt = (e) => {
|
|
407
410
|
if (!e || e.length === 0) return;
|
|
408
411
|
(Array.isArray(e) ? e : Object.values(e)).forEach((a) => {
|
|
409
412
|
if (N.value.some((D) => D.id === a.id))
|
|
410
413
|
return;
|
|
411
|
-
const o = a.senderType || a.sender_type, n = a.senderName || "", l = a.senderId || a.sender_id, c = a.profileImg || a.profile_img, m = n ? n.split(" ") : ["", ""], h = a.user_first_name || a.guest_first_name || m[0] || "",
|
|
414
|
+
const o = a.senderType || a.sender_type, n = a.senderName || "", l = a.senderId || a.sender_id, c = a.profileImg || a.profile_img, m = n ? n.split(" ") : ["", ""], h = a.user_first_name || a.guest_first_name || m[0] || "", I = a.user_last_name || a.guest_last_name || m.slice(1).join(" ") || "", K = h && I ? `${h} ${I}` : h || "Auto-Reply", le = o === "system" || o === "user", ie = o === "guest";
|
|
412
415
|
let T = {
|
|
413
416
|
id: a.id,
|
|
414
417
|
isPropertyEmployee: o === "user",
|
|
415
418
|
isSent: !!a.sent,
|
|
416
419
|
isSystemMessage: o === "system",
|
|
417
|
-
isStaffMessage:
|
|
418
|
-
isGuestMessage:
|
|
420
|
+
isStaffMessage: le,
|
|
421
|
+
isGuestMessage: ie,
|
|
419
422
|
comment: a.content,
|
|
420
423
|
dateUtc: a.sent || a.created,
|
|
421
424
|
user: {
|
|
@@ -423,14 +426,14 @@ const Pt = 996, Zt = It({
|
|
|
423
426
|
icon: "",
|
|
424
427
|
id: l || "system-message",
|
|
425
428
|
initials: "",
|
|
426
|
-
lastName:
|
|
427
|
-
name:
|
|
429
|
+
lastName: I || "",
|
|
430
|
+
name: K,
|
|
428
431
|
src: c || ""
|
|
429
432
|
}
|
|
430
433
|
};
|
|
431
|
-
T.user.firstName && T.user.lastName ? T.user.initials = T.user.firstName[0] + T.user.lastName[0] : T.user.firstName && (T.user.initials = T.user.firstName[0]),
|
|
434
|
+
T.user.firstName && T.user.lastName ? T.user.initials = T.user.firstName[0] + T.user.lastName[0] : T.user.firstName && (T.user.initials = T.user.firstName[0]), le && (T.user.icon = "property-fill"), N.value.push(T);
|
|
432
435
|
});
|
|
433
|
-
},
|
|
436
|
+
}, ye = async (e = !1) => {
|
|
434
437
|
if (s.showComments && r.value.tokenId) {
|
|
435
438
|
e || (y.value.messages = !0);
|
|
436
439
|
try {
|
|
@@ -443,18 +446,18 @@ const Pt = 996, Zt = It({
|
|
|
443
446
|
if (o.status === "error")
|
|
444
447
|
throw new Error(o.message || "Failed to get messages");
|
|
445
448
|
if (S.value = !o.closed, o.messages && o.messages.length > 0) {
|
|
446
|
-
k.value = o.messages[o.messages.length - 1].id, e ?
|
|
447
|
-
const n = setTimeout(
|
|
449
|
+
k.value = o.messages[o.messages.length - 1].id, e ? tt(o.messages) : x(o.messages);
|
|
450
|
+
const n = setTimeout(z, 100);
|
|
448
451
|
L.value.push(n);
|
|
449
|
-
} else e ||
|
|
452
|
+
} else e || x(o.messages || []);
|
|
450
453
|
} catch (t) {
|
|
451
454
|
console.error("getChatMessages error:", t);
|
|
452
455
|
} finally {
|
|
453
456
|
e || (y.value.messages = !1);
|
|
454
457
|
}
|
|
455
458
|
}
|
|
456
|
-
},
|
|
457
|
-
const t =
|
|
459
|
+
}, at = (e) => {
|
|
460
|
+
const t = g.utc(), a = g.fromFormat(e, "yyyy-MM-dd HH:mm:ss", { zone: "utc" }), o = t.diff(
|
|
458
461
|
a,
|
|
459
462
|
[
|
|
460
463
|
"years",
|
|
@@ -476,9 +479,9 @@ const Pt = 996, Zt = It({
|
|
|
476
479
|
return h === 1 ? u("HC_ONE_MINUTE_AGO") : u("HC_X_MINUTES_AGO", { minutes: h });
|
|
477
480
|
if (h === 0)
|
|
478
481
|
return u("HC_A_MOMENT_AGO");
|
|
479
|
-
},
|
|
480
|
-
s.showGuestDetails &&
|
|
481
|
-
},
|
|
482
|
+
}, ot = async () => {
|
|
483
|
+
s.showGuestDetails && ne(), ge(), J(), re(), f("refresh:pms", r.value);
|
|
484
|
+
}, ne = async () => {
|
|
482
485
|
try {
|
|
483
486
|
y.value.pms = !0;
|
|
484
487
|
const e = new AbortController(), t = setTimeout(() => e.abort(), 45e3);
|
|
@@ -488,8 +491,8 @@ const Pt = 996, Zt = It({
|
|
|
488
491
|
throw new Error("PMS base URL is required");
|
|
489
492
|
const o = {
|
|
490
493
|
Authorization: "Bearer " + (() => {
|
|
491
|
-
const
|
|
492
|
-
return
|
|
494
|
+
const I = `; ${document.cookie}`.split("; QV2Auth=");
|
|
495
|
+
return I.length === 2 && I.pop()?.split(";").shift() || "";
|
|
493
496
|
})(),
|
|
494
497
|
"Content-Type": "application/json"
|
|
495
498
|
}, n = r.value?.qv2Rooms?.qRoomId || r.value?.id || s.room.id, l = await fetch(
|
|
@@ -501,7 +504,7 @@ const Pt = 996, Zt = It({
|
|
|
501
504
|
body: JSON.stringify({ roomsIds: [n] })
|
|
502
505
|
}
|
|
503
506
|
);
|
|
504
|
-
clearTimeout(t), l.ok ||
|
|
507
|
+
clearTimeout(t), l.ok || Ne(l);
|
|
505
508
|
const c = await l.json(), m = c.data?.pmsRooms || c.data?.rooms || c.rooms || [];
|
|
506
509
|
R.value = m, m.length > 0 ? r.value = {
|
|
507
510
|
...m[0],
|
|
@@ -515,7 +518,7 @@ const Pt = 996, Zt = It({
|
|
|
515
518
|
icon: "exclamation-circle"
|
|
516
519
|
}), e;
|
|
517
520
|
}
|
|
518
|
-
},
|
|
521
|
+
}, ge = async () => {
|
|
519
522
|
try {
|
|
520
523
|
y.value.roomNotices = !0;
|
|
521
524
|
const e = await fetch(
|
|
@@ -524,9 +527,9 @@ const Pt = 996, Zt = It({
|
|
|
524
527
|
if (!e.ok)
|
|
525
528
|
throw new Error(`HTTP error! status: ${e.status}`);
|
|
526
529
|
const t = await e.json();
|
|
527
|
-
|
|
530
|
+
V.value = t.notices;
|
|
528
531
|
} catch (e) {
|
|
529
|
-
console.error("Error getting room notices:", e),
|
|
532
|
+
console.error("Error getting room notices:", e), V.value = [], f("show:toast", {
|
|
530
533
|
show: !0,
|
|
531
534
|
message: u("HC_FAILED_TO_LOAD_ROOM_NOTICES"),
|
|
532
535
|
variant: "error",
|
|
@@ -535,7 +538,7 @@ const Pt = 996, Zt = It({
|
|
|
535
538
|
} finally {
|
|
536
539
|
y.value.roomNotices = !1;
|
|
537
540
|
}
|
|
538
|
-
},
|
|
541
|
+
}, _e = async () => {
|
|
539
542
|
try {
|
|
540
543
|
const e = new FormData();
|
|
541
544
|
e.append("property_id", s.propertyId), e.append("filter", "tasks_new");
|
|
@@ -558,7 +561,7 @@ const Pt = 996, Zt = It({
|
|
|
558
561
|
};
|
|
559
562
|
n.users.forEach((m) => {
|
|
560
563
|
m.translated_department !== c.group && (c.group && l.push({ ...c }), c.group = m.translated_department, c.options = []), c.options.push(m);
|
|
561
|
-
}), c.group && l.push({ ...c }),
|
|
564
|
+
}), c.group && l.push({ ...c }), ke.value = l;
|
|
562
565
|
}
|
|
563
566
|
} catch (e) {
|
|
564
567
|
console.error("Error getting shared data:", e), f("show:toast", {
|
|
@@ -568,7 +571,7 @@ const Pt = 996, Zt = It({
|
|
|
568
571
|
icon: "exclamation-circle"
|
|
569
572
|
});
|
|
570
573
|
}
|
|
571
|
-
},
|
|
574
|
+
}, be = async () => {
|
|
572
575
|
try {
|
|
573
576
|
const t = await (await fetch(
|
|
574
577
|
`/api/client/connect/getStayDetails.php?tokenId=${r.value.tokenId}`,
|
|
@@ -579,9 +582,9 @@ const Pt = 996, Zt = It({
|
|
|
579
582
|
)).json();
|
|
580
583
|
if (t.status === "error")
|
|
581
584
|
throw new Error(t.message || "Failed to get stay details");
|
|
582
|
-
t.userName && (p.value.guestName = t.userName), t.cellPhone && (p.value.guestPhone = t.cellPhone), t.email && (p.value.guestEmail = t.email), t.checkIn && (p.value.checkInDate =
|
|
585
|
+
t.userName && (p.value.guestName = t.userName), t.cellPhone && (p.value.guestPhone = t.cellPhone), t.email && (p.value.guestEmail = t.email), t.checkIn && (p.value.checkInDate = g.fromISO(
|
|
583
586
|
t.checkIn
|
|
584
|
-
).toJSDate()), t.checkOut && (p.value.checkOutDate =
|
|
587
|
+
).toJSDate()), t.checkOut && (p.value.checkOutDate = g.fromISO(
|
|
585
588
|
t.checkOut
|
|
586
589
|
).toJSDate());
|
|
587
590
|
} catch (e) {
|
|
@@ -592,7 +595,7 @@ const Pt = 996, Zt = It({
|
|
|
592
595
|
icon: "exclamation-circle"
|
|
593
596
|
});
|
|
594
597
|
}
|
|
595
|
-
},
|
|
598
|
+
}, st = (e) => {
|
|
596
599
|
switch (e) {
|
|
597
600
|
case "complaint":
|
|
598
601
|
return "red-30";
|
|
@@ -605,7 +608,7 @@ const Pt = 996, Zt = It({
|
|
|
605
608
|
case "task":
|
|
606
609
|
return "green-20";
|
|
607
610
|
}
|
|
608
|
-
},
|
|
611
|
+
}, nt = (e) => {
|
|
609
612
|
switch (e) {
|
|
610
613
|
case "complaint":
|
|
611
614
|
return "face-frown";
|
|
@@ -638,7 +641,7 @@ const Pt = 996, Zt = It({
|
|
|
638
641
|
} finally {
|
|
639
642
|
y.value.tickets = !1;
|
|
640
643
|
}
|
|
641
|
-
},
|
|
644
|
+
}, re = async () => {
|
|
642
645
|
if (s.showActivity)
|
|
643
646
|
try {
|
|
644
647
|
y.value.activity = !0;
|
|
@@ -648,9 +651,9 @@ const Pt = 996, Zt = It({
|
|
|
648
651
|
if (!t.ok)
|
|
649
652
|
throw new Error(`HTTP error! status: ${t.status}`);
|
|
650
653
|
const a = await t.json();
|
|
651
|
-
|
|
654
|
+
fe.value = a.inspections || [];
|
|
652
655
|
} catch (e) {
|
|
653
|
-
console.error("Error getting activity:", e),
|
|
656
|
+
console.error("Error getting activity:", e), fe.value = [], f("show:toast", {
|
|
654
657
|
show: !0,
|
|
655
658
|
message: u("HC_FAILED_TO_LOAD_ACTIVITY"),
|
|
656
659
|
variant: "error",
|
|
@@ -659,7 +662,7 @@ const Pt = 996, Zt = It({
|
|
|
659
662
|
} finally {
|
|
660
663
|
y.value.activity = !1;
|
|
661
664
|
}
|
|
662
|
-
},
|
|
665
|
+
}, Ne = async (e) => {
|
|
663
666
|
const t = await e.text();
|
|
664
667
|
let a;
|
|
665
668
|
try {
|
|
@@ -668,7 +671,7 @@ const Pt = 996, Zt = It({
|
|
|
668
671
|
a = { code: e.status, message: t };
|
|
669
672
|
}
|
|
670
673
|
return a.code === 401 ? (window.location.href = "/logout.php?unauthorized=1", { error: a }) : a;
|
|
671
|
-
},
|
|
674
|
+
}, rt = (e) => {
|
|
672
675
|
const t = document.querySelectorAll(".pulse");
|
|
673
676
|
if (t && t.length) {
|
|
674
677
|
const a = r.value?.qv2Rooms?.qRoomId || r.value?.id || s.room?.id, o = document.getElementById("room-" + a), n = o?.classList;
|
|
@@ -693,9 +696,9 @@ const Pt = 996, Zt = It({
|
|
|
693
696
|
}, 4500);
|
|
694
697
|
L.value.push(l);
|
|
695
698
|
}
|
|
696
|
-
},
|
|
699
|
+
}, lt = () => {
|
|
697
700
|
window.open("/guest/overview.php", "_blank");
|
|
698
|
-
},
|
|
701
|
+
}, it = (e) => {
|
|
699
702
|
let t = "";
|
|
700
703
|
switch (e.type) {
|
|
701
704
|
case "complaint":
|
|
@@ -717,10 +720,10 @@ const Pt = 996, Zt = It({
|
|
|
717
720
|
return "#";
|
|
718
721
|
}
|
|
719
722
|
window.open(t, "_blank");
|
|
720
|
-
},
|
|
723
|
+
}, ut = (e) => {
|
|
721
724
|
e.link && window.open(e.link, "_blank");
|
|
722
|
-
},
|
|
723
|
-
|
|
725
|
+
}, ct = async () => {
|
|
726
|
+
pe.value = !0;
|
|
724
727
|
const e = r.value?.qv2Rooms?.qRoomId || r.value?.id || s.room?.id, t = r.value?.qv2Rooms?.qRoomName || r.value?.name || s.room?.name, a = {
|
|
725
728
|
type: E.value?.id,
|
|
726
729
|
propertyId: s.propertyId,
|
|
@@ -730,28 +733,28 @@ const Pt = 996, Zt = It({
|
|
|
730
733
|
};
|
|
731
734
|
switch (E.value?.id) {
|
|
732
735
|
case "complaint":
|
|
733
|
-
a.tokenId = r.value.tokenId, a.problemId = p.value.problem.id, a.guestName = p.value.guestName, a.guestPhone = p.value.guestPhone, a.guestEmail = p.value.guestEmail, a.guestLoyalty = p.value.guestLoyalty, a.guestMood = p.value.guestMood.id, a.checkInDate =
|
|
736
|
+
a.tokenId = r.value.tokenId, a.problemId = p.value.problem.id, a.guestName = p.value.guestName, a.guestPhone = p.value.guestPhone, a.guestEmail = p.value.guestEmail, a.guestLoyalty = p.value.guestLoyalty, a.guestMood = p.value.guestMood.id, a.checkInDate = g.fromJSDate(p.value.checkInDate).toFormat(
|
|
734
737
|
"yyyy-MM-dd"
|
|
735
|
-
), a.checkOutDate =
|
|
738
|
+
), a.checkOutDate = g.fromJSDate(p.value.checkOutDate).toFormat(
|
|
736
739
|
"yyyy-MM-dd"
|
|
737
740
|
), a.notes = p.value.notes, a.inHouse = 2, a.source = "dashboard", f("create:todo", a);
|
|
738
741
|
break;
|
|
739
742
|
case "request":
|
|
740
|
-
a.itemId = d.value.item.id, a.assignType = d.value.assignType.id, a.occupied = d.value.requestedBy.id, a.notes = d.value.notes, a.dueDate =
|
|
743
|
+
a.itemId = d.value.item.id, a.assignType = d.value.assignType.id, a.occupied = d.value.requestedBy.id, a.notes = d.value.notes, a.dueDate = g.fromJSDate(d.value.due).toFormat("yyyy-MM-dd"), d.value.assignType.id === 1 && (a.department = d.value.department.id), d.value.assignType.id === 2 && (a.person = d.value.person.id), s.allowWhenWhere && (a.requestWhen = d.value.when ? d.value.when.id : "", a.requestWhere = d.value.where ? d.value.where.id : ""), f("create:todo", a);
|
|
741
744
|
break;
|
|
742
745
|
case "room_notice":
|
|
743
|
-
a.issueId =
|
|
746
|
+
a.issueId = _.value.issue.id, a.startDate = g.fromJSDate(_.value.startDate).toFormat("yyyy-MM-dd"), a.endDate = g.fromJSDate(_.value.endDate).toFormat("yyyy-MM-dd"), a.startTime = _.value.startTime || "", a.endTime = _.value.endTime || "", a.notes = _.value.notes, f("create:todo", a);
|
|
744
747
|
break;
|
|
745
748
|
case "work_order":
|
|
746
|
-
a.itemId = v.value.item.id, a.issueId = v.value.issue.id, a.assignType = v.value.assignType.id, a.occupied = v.value.requestedBy.id, a.notes = v.value.notes, a.dueDate =
|
|
749
|
+
a.itemId = v.value.item.id, a.issueId = v.value.issue.id, a.assignType = v.value.assignType.id, a.occupied = v.value.requestedBy.id, a.notes = v.value.notes, a.dueDate = g.fromJSDate(v.value.due).toFormat("yyyy-MM-dd"), v.value.assignType.id === 1 && (a.department = v.value.department.id), v.value.assignType.id === 2 && (a.person = v.value.person.id), f("create:todo", a);
|
|
747
750
|
break;
|
|
748
751
|
}
|
|
749
|
-
}, ct = (e) => {
|
|
750
|
-
we(), Ie(), s.hover && f("toggle", e);
|
|
751
752
|
}, dt = (e) => {
|
|
752
|
-
|
|
753
|
-
}, mt =
|
|
754
|
-
|
|
753
|
+
Ie(), Te(), s.hover && f("toggle", e);
|
|
754
|
+
}, mt = (e) => {
|
|
755
|
+
Me(), b.value = e;
|
|
756
|
+
}, vt = async (e) => {
|
|
757
|
+
if (E.value = e, O.value = [], _.value.issue = null, p.value.problem = null, v.value.item = null, v.value.issue = null, d.value.item = null, !E.value) {
|
|
755
758
|
y.value.actionItems = !1;
|
|
756
759
|
return;
|
|
757
760
|
}
|
|
@@ -760,18 +763,18 @@ const Pt = 996, Zt = It({
|
|
|
760
763
|
switch (a.append("property_id", s.propertyId), a.append("area_id", t), e.id) {
|
|
761
764
|
case "complaint":
|
|
762
765
|
try {
|
|
763
|
-
r.value.tokenId && await
|
|
766
|
+
r.value.tokenId && await be();
|
|
764
767
|
const n = await (await fetch("/api/client/common/getComplaintProblemsByPropertyId.php", {
|
|
765
768
|
method: "POST",
|
|
766
769
|
body: a
|
|
767
770
|
})).json();
|
|
768
771
|
n.items && (O.value = n.items);
|
|
769
|
-
const l = await
|
|
772
|
+
const l = await Z.post(
|
|
770
773
|
"/api/client/common/getComplaintMoods.php"
|
|
771
774
|
);
|
|
772
775
|
l.data.items.forEach((c) => {
|
|
773
776
|
c.label = c.display_name;
|
|
774
|
-
}),
|
|
777
|
+
}), de.value = l.data.items;
|
|
775
778
|
} catch (o) {
|
|
776
779
|
console.error("Error loading complaint options:", o), f("show:toast", {
|
|
777
780
|
show: !0,
|
|
@@ -803,12 +806,12 @@ const Pt = 996, Zt = It({
|
|
|
803
806
|
break;
|
|
804
807
|
case "request":
|
|
805
808
|
try {
|
|
806
|
-
d.value.requestedBy = Q.value[1], d.value.assignType =
|
|
809
|
+
d.value.requestedBy = Q.value[1], d.value.assignType = ee.value[0];
|
|
807
810
|
const n = await (await fetch("/api/client/common/getHousekeepingItemsByPropertyId.php", {
|
|
808
811
|
method: "POST",
|
|
809
812
|
body: a
|
|
810
813
|
})).json();
|
|
811
|
-
if (n.items && (O.value = n.items), await
|
|
814
|
+
if (n.items && (O.value = n.items), await _e(), d.value.department = C.value.find(
|
|
812
815
|
(l) => parseInt(l.id) === 4
|
|
813
816
|
), s.allowWhenWhere)
|
|
814
817
|
try {
|
|
@@ -825,13 +828,13 @@ const Pt = 996, Zt = It({
|
|
|
825
828
|
id: h.id,
|
|
826
829
|
label: h.name,
|
|
827
830
|
value: h.id
|
|
828
|
-
})) : q.value = [], m.where && Array.isArray(m.where) ?
|
|
831
|
+
})) : q.value = [], m.where && Array.isArray(m.where) ? F.value = m.where.map((h) => ({
|
|
829
832
|
id: h.id,
|
|
830
833
|
label: h.name,
|
|
831
834
|
value: h.id
|
|
832
|
-
})) :
|
|
835
|
+
})) : F.value = [];
|
|
833
836
|
} catch (l) {
|
|
834
|
-
console.error("Error loading When/Where options:", l), q.value = [],
|
|
837
|
+
console.error("Error loading When/Where options:", l), q.value = [], F.value = [], f("show:toast", {
|
|
835
838
|
show: !0,
|
|
836
839
|
message: u("HC_FAILED_TO_LOAD_WHEN_WHERE_OPTIONS"),
|
|
837
840
|
variant: "error",
|
|
@@ -851,7 +854,7 @@ const Pt = 996, Zt = It({
|
|
|
851
854
|
break;
|
|
852
855
|
case "work_order":
|
|
853
856
|
try {
|
|
854
|
-
v.value.requestedBy = Q.value[0], v.value.assignType =
|
|
857
|
+
v.value.requestedBy = Q.value[0], v.value.assignType = ee.value[0];
|
|
855
858
|
const n = await (await fetch("/api/client/common/getItemsByRoomId.php", {
|
|
856
859
|
method: "POST",
|
|
857
860
|
body: a
|
|
@@ -863,15 +866,15 @@ const Pt = 996, Zt = It({
|
|
|
863
866
|
n.items && (n.items.forEach((m) => {
|
|
864
867
|
m.section_name !== c.group && (c.group && l.push({ ...c }), c.group = m.section_name, c.options = []), m.label && c.options.push(m);
|
|
865
868
|
}), c.group && l.push({ ...c })), O.value = l, await Promise.all([
|
|
866
|
-
|
|
869
|
+
Z.post(
|
|
867
870
|
"/api/client/common/getWorkOrderIssues.php"
|
|
868
871
|
),
|
|
869
|
-
|
|
872
|
+
_e()
|
|
870
873
|
]).then((m) => {
|
|
871
874
|
const h = m[0];
|
|
872
|
-
h.data.issues.forEach((
|
|
873
|
-
|
|
874
|
-
}),
|
|
875
|
+
h.data.issues.forEach((I) => {
|
|
876
|
+
I.label = I.display_name;
|
|
877
|
+
}), he.value = h.data.issues;
|
|
875
878
|
}), v.value.department = C.value.find(
|
|
876
879
|
(m) => parseInt(m.id) === 2
|
|
877
880
|
);
|
|
@@ -890,24 +893,24 @@ const Pt = 996, Zt = It({
|
|
|
890
893
|
y.value.actionItems = !1;
|
|
891
894
|
return;
|
|
892
895
|
}
|
|
893
|
-
},
|
|
894
|
-
|
|
895
|
-
},
|
|
896
|
+
}, pt = () => {
|
|
897
|
+
se.value = !se.value, ue.value = !1;
|
|
898
|
+
}, Ce = () => {
|
|
896
899
|
const e = document.getElementById("comment-field"), t = document.getElementById("hidden-text");
|
|
897
900
|
e.style.height = t?.offsetHeight + "px";
|
|
898
|
-
},
|
|
901
|
+
}, z = () => {
|
|
899
902
|
const e = document.getElementById("comments-container");
|
|
900
903
|
e?.scroll({
|
|
901
904
|
top: e.scrollHeight,
|
|
902
905
|
behavior: "smooth"
|
|
903
906
|
});
|
|
904
|
-
},
|
|
907
|
+
}, ft = async (e) => {
|
|
905
908
|
if (e && e.type === "keydown" && e.preventDefault(), r.value.tokenId && b.value && !H.value) {
|
|
906
909
|
y.value.sendingMessage = !0;
|
|
907
910
|
try {
|
|
908
911
|
const t = new FormData();
|
|
909
912
|
t.append("tokenId", r.value.tokenId), t.append("content", b.value), t.append("senderId", P.value || "");
|
|
910
|
-
const a = await
|
|
913
|
+
const a = await Z.post(
|
|
911
914
|
"/api/client/connect/sendMessage.php",
|
|
912
915
|
t
|
|
913
916
|
);
|
|
@@ -920,7 +923,7 @@ const Pt = 996, Zt = It({
|
|
|
920
923
|
});
|
|
921
924
|
return;
|
|
922
925
|
}
|
|
923
|
-
b.value = "", S.value = !a.data.closed, a.data.messages && (
|
|
926
|
+
b.value = "", S.value = !a.data.closed, a.data.messages && (x(a.data.messages), a.data.messages.length > 0 && (k.value = a.data.messages[a.data.messages.length - 1].id)), z();
|
|
924
927
|
} catch (t) {
|
|
925
928
|
console.error("sendChatMessage error:", t), f("show:toast", {
|
|
926
929
|
show: !0,
|
|
@@ -932,13 +935,13 @@ const Pt = 996, Zt = It({
|
|
|
932
935
|
y.value.sendingMessage = !1;
|
|
933
936
|
}
|
|
934
937
|
}
|
|
935
|
-
},
|
|
938
|
+
}, ht = async () => {
|
|
936
939
|
if (!(!r.value.tokenId || !P.value)) {
|
|
937
940
|
y.value.conversationToggle = !0;
|
|
938
941
|
try {
|
|
939
942
|
const e = S.value ? "/api/client/connect/closeConversation.php" : "/api/client/connect/openConversation.php", t = new FormData();
|
|
940
943
|
t.append("tokenId", r.value.tokenId), t.append("userId", P.value), S.value && k.value !== null && t.append("lastMsgId", k.value.toString());
|
|
941
|
-
const a = await
|
|
944
|
+
const a = await Z.post(e, t);
|
|
942
945
|
if (a.data.status === "error") {
|
|
943
946
|
f("show:toast", {
|
|
944
947
|
show: !0,
|
|
@@ -948,7 +951,7 @@ const Pt = 996, Zt = It({
|
|
|
948
951
|
});
|
|
949
952
|
return;
|
|
950
953
|
}
|
|
951
|
-
S.value = !a.data.closed, a.data.messages && (
|
|
954
|
+
S.value = !a.data.closed, a.data.messages && (x(a.data.messages), a.data.messages.length > 0 && (k.value = a.data.messages[a.data.messages.length - 1].id)), f("show:toast", {
|
|
952
955
|
show: !0,
|
|
953
956
|
message: S.value ? u("HC_CONVERSATION_REOPENED") : u("HC_CONVERSATION_CLOSED"),
|
|
954
957
|
variant: "success",
|
|
@@ -965,13 +968,13 @@ const Pt = 996, Zt = It({
|
|
|
965
968
|
y.value.conversationToggle = !1;
|
|
966
969
|
}
|
|
967
970
|
}
|
|
968
|
-
},
|
|
971
|
+
}, yt = async () => {
|
|
969
972
|
if (s.isTestEnvironment && !(!r.value?.tokenId || !j.value.trim())) {
|
|
970
|
-
|
|
973
|
+
ve.value = !0;
|
|
971
974
|
try {
|
|
972
975
|
const e = new FormData();
|
|
973
976
|
e.append("tokenId", r.value.tokenId), e.append("content", j.value.trim());
|
|
974
|
-
const t = await
|
|
977
|
+
const t = await Z.post(
|
|
975
978
|
"/api/client/connect/simulateInbound.php",
|
|
976
979
|
e
|
|
977
980
|
);
|
|
@@ -984,7 +987,7 @@ const Pt = 996, Zt = It({
|
|
|
984
987
|
});
|
|
985
988
|
return;
|
|
986
989
|
}
|
|
987
|
-
t.data.messages && (
|
|
990
|
+
t.data.messages && (x(t.data.messages), S.value = !t.data.closed, t.data.messages.length > 0 && (k.value = t.data.messages[t.data.messages.length - 1].id)), j.value = "", W.value = !1, z(), f("show:toast", {
|
|
988
991
|
show: !0,
|
|
989
992
|
message: u("HC_SIMULATED_GUEST_REPLY"),
|
|
990
993
|
variant: "success",
|
|
@@ -998,36 +1001,36 @@ const Pt = 996, Zt = It({
|
|
|
998
1001
|
icon: "exclamation-circle"
|
|
999
1002
|
});
|
|
1000
1003
|
} finally {
|
|
1001
|
-
|
|
1004
|
+
ve.value = !1;
|
|
1002
1005
|
}
|
|
1003
1006
|
}
|
|
1004
|
-
}, yt = () => {
|
|
1005
|
-
W.value = !W.value, W.value || (j.value = "");
|
|
1006
1007
|
}, gt = () => {
|
|
1008
|
+
W.value = !W.value, W.value || (j.value = "");
|
|
1009
|
+
}, _t = () => {
|
|
1007
1010
|
$.value || ($.value = setInterval(() => {
|
|
1008
|
-
document.visibilityState === "visible" &&
|
|
1009
|
-
},
|
|
1010
|
-
}, _e = () => {
|
|
1011
|
-
$.value && (clearInterval($.value), $.value = null);
|
|
1011
|
+
document.visibilityState === "visible" && ye(!0);
|
|
1012
|
+
}, Pe));
|
|
1012
1013
|
}, we = () => {
|
|
1014
|
+
$.value && (clearInterval($.value), $.value = null);
|
|
1015
|
+
}, Ie = () => {
|
|
1013
1016
|
if (s.align === "left" || s.align === "right") {
|
|
1014
|
-
const e =
|
|
1015
|
-
|
|
1017
|
+
const e = Y.value?.getBoundingClientRect().left, t = window.innerWidth;
|
|
1018
|
+
ce.value = t - e < U.value ? "right" : "left";
|
|
1016
1019
|
} else {
|
|
1017
|
-
const e =
|
|
1018
|
-
|
|
1020
|
+
const e = Y.value?.getBoundingClientRect().top, t = window.innerHeight;
|
|
1021
|
+
ce.value = t - e < G.value ? "bottom" : "top";
|
|
1019
1022
|
}
|
|
1020
|
-
},
|
|
1023
|
+
}, Te = () => {
|
|
1021
1024
|
if (s.position === "top" || s.position === "bottom") {
|
|
1022
|
-
const e =
|
|
1023
|
-
|
|
1025
|
+
const e = Y.value?.getBoundingClientRect().top, t = window.innerHeight;
|
|
1026
|
+
me.value = t - e < G.value ? "top" : "bottom";
|
|
1024
1027
|
} else {
|
|
1025
|
-
const e =
|
|
1026
|
-
|
|
1028
|
+
const e = Y.value?.getBoundingClientRect().left, t = window.innerWidth;
|
|
1029
|
+
me.value = t - e < U.value ? "left" : "right";
|
|
1027
1030
|
}
|
|
1028
|
-
},
|
|
1029
|
-
H.value = !H.value, H.value ? (b.value = "", M.value.info =
|
|
1030
|
-
},
|
|
1031
|
+
}, Me = () => {
|
|
1032
|
+
H.value = !H.value, H.value ? (b.value = "", M.value.info = ae.value, M.value.tickets = oe.value, M.value.comments = te.value, ae.value = !1, oe.value = !1, document.getElementById("comment-field")?.focus()) : (ae.value = M.value.info, oe.value = M.value.tickets, te.value = M.value.comments);
|
|
1033
|
+
}, wt = async (e, t) => {
|
|
1031
1034
|
const a = r.value?.qv2Rooms?.qRoomId || r.value?.id || s.room?.id, o = new FormData();
|
|
1032
1035
|
if (o.append("property_id", s.propertyId), o.append("room_ids", JSON.stringify([a])), await J(), A.value) {
|
|
1033
1036
|
const n = [];
|
|
@@ -1044,146 +1047,146 @@ const Pt = 996, Zt = It({
|
|
|
1044
1047
|
};
|
|
1045
1048
|
B(() => s.open, () => {
|
|
1046
1049
|
if (s.open && s.showComments && N.value.length) {
|
|
1047
|
-
const e = setTimeout(
|
|
1050
|
+
const e = setTimeout(z, 500);
|
|
1048
1051
|
L.value.push(e);
|
|
1049
1052
|
}
|
|
1050
|
-
s.open || (
|
|
1053
|
+
s.open || (Se(), we(), k.value = null, N.value = [], S.value = !1);
|
|
1051
1054
|
}), B(
|
|
1052
|
-
() => [s.open, s.showComments,
|
|
1055
|
+
() => [s.open, s.showComments, te.value, r.value?.tokenId],
|
|
1053
1056
|
([e, t, a, o]) => {
|
|
1054
|
-
e && t && a && o ?
|
|
1057
|
+
e && t && a && o ? _t() : we();
|
|
1055
1058
|
}
|
|
1056
1059
|
), B(b, () => {
|
|
1057
|
-
const e = setTimeout(
|
|
1060
|
+
const e = setTimeout(Ce, 100);
|
|
1058
1061
|
L.value.push(e);
|
|
1059
1062
|
}), B(() => s.allowWhenWhere, (e, t) => {
|
|
1060
|
-
t === !0 && e === !1 && (d.value.when = null, d.value.where = null, q.value = [],
|
|
1063
|
+
t === !0 && e === !1 && (d.value.when = null, d.value.where = null, q.value = [], F.value = []);
|
|
1061
1064
|
});
|
|
1062
|
-
const
|
|
1063
|
-
|
|
1065
|
+
const Re = () => !!(s.room.reservations || s.room.cleaning || s.room.occupancy || s.room.hkTaskTypeId != null), It = () => Array.isArray(s.room.roomNoticeIssues) && s.room.roomNoticeIssues.length > 0, He = () => {
|
|
1066
|
+
It() ? V.value = s.room.roomNoticeIssues : ge();
|
|
1064
1067
|
};
|
|
1065
1068
|
return B(() => s.open, async (e, t) => {
|
|
1066
|
-
e && !t && (
|
|
1069
|
+
e && !t && (Re() ? (r.value = s.room, R.value = [s.room]) : s.showGuestDetails && !R.value ? await ne() : r.value || (r.value = s.room), J(), He(), re(), s.showComments && ye());
|
|
1067
1070
|
}), B(
|
|
1068
1071
|
() => s.room.id,
|
|
1069
1072
|
(e, t) => {
|
|
1070
|
-
e !== t && (r.value = s.room, R.value = null, s.open && (
|
|
1073
|
+
e !== t && (r.value = s.room, R.value = null, s.open && (Re() ? R.value = [s.room] : s.showGuestDetails && ne(), J(), He(), re()));
|
|
1071
1074
|
}
|
|
1072
|
-
),
|
|
1075
|
+
), Dt(async () => {
|
|
1073
1076
|
const e = JSON.parse(
|
|
1074
1077
|
window.localStorage.getItem("authenticated")
|
|
1075
1078
|
);
|
|
1076
|
-
P.value = e?.user?.id || window.userId || "", r.value = s.room, s.size === "sm" && (G.value = 140, U.value = 160), s.size === "lg" && (G.value = 250, U.value = 440),
|
|
1077
|
-
}),
|
|
1079
|
+
P.value = e?.user?.id || window.userId || "", r.value = s.room, s.size === "sm" && (G.value = 140, U.value = 160), s.size === "lg" && (G.value = 250, U.value = 440), Ie(), Te();
|
|
1080
|
+
}), Ot(() => {
|
|
1078
1081
|
L.value.forEach((e) => {
|
|
1079
1082
|
clearTimeout(e);
|
|
1080
|
-
}),
|
|
1083
|
+
}), we();
|
|
1081
1084
|
}), {
|
|
1082
|
-
DateTime:
|
|
1085
|
+
DateTime: g,
|
|
1083
1086
|
// Refs
|
|
1084
|
-
activityList:
|
|
1085
|
-
actionMenuOpen:
|
|
1086
|
-
alignment:
|
|
1087
|
-
assignTypes:
|
|
1087
|
+
activityList: fe,
|
|
1088
|
+
actionMenuOpen: ue,
|
|
1089
|
+
alignment: ce,
|
|
1090
|
+
assignTypes: ee,
|
|
1088
1091
|
comment: b,
|
|
1089
1092
|
complaint: p,
|
|
1090
1093
|
componentHeight: G,
|
|
1091
1094
|
componentWidth: U,
|
|
1092
1095
|
departments: C,
|
|
1093
|
-
departmentUsers:
|
|
1094
|
-
expandActivity:
|
|
1095
|
-
expandComments:
|
|
1096
|
-
expandGuestInfo:
|
|
1096
|
+
departmentUsers: ke,
|
|
1097
|
+
expandActivity: qe,
|
|
1098
|
+
expandComments: te,
|
|
1099
|
+
expandGuestInfo: ae,
|
|
1097
1100
|
expandedStates: M,
|
|
1098
|
-
expandTickets:
|
|
1099
|
-
guestDetailsData:
|
|
1101
|
+
expandTickets: oe,
|
|
1102
|
+
guestDetailsData: Le,
|
|
1100
1103
|
itemOptions: O,
|
|
1101
1104
|
loading: y,
|
|
1102
1105
|
messages: N,
|
|
1103
|
-
moodOptions:
|
|
1106
|
+
moodOptions: de,
|
|
1104
1107
|
pmsData: R,
|
|
1105
|
-
positioning:
|
|
1108
|
+
positioning: me,
|
|
1106
1109
|
quickReplyOpen: H,
|
|
1107
1110
|
request: d,
|
|
1108
1111
|
requestedByOptions: Q,
|
|
1109
|
-
requestLoading:
|
|
1112
|
+
requestLoading: pe,
|
|
1110
1113
|
requestType: E,
|
|
1111
1114
|
roomDetailsData: r,
|
|
1112
|
-
roomNotice:
|
|
1113
|
-
roomNotices:
|
|
1114
|
-
showCreateRequest:
|
|
1115
|
+
roomNotice: _,
|
|
1116
|
+
roomNotices: V,
|
|
1117
|
+
showCreateRequest: se,
|
|
1115
1118
|
ticketsList: A,
|
|
1116
|
-
todoOptions:
|
|
1117
|
-
trigger:
|
|
1119
|
+
todoOptions: Fe,
|
|
1120
|
+
trigger: Y,
|
|
1118
1121
|
userId: P,
|
|
1119
1122
|
workOrder: v,
|
|
1120
|
-
workOrderIssues:
|
|
1123
|
+
workOrderIssues: he,
|
|
1121
1124
|
whenOptions: q,
|
|
1122
|
-
whereOptions:
|
|
1125
|
+
whereOptions: F,
|
|
1123
1126
|
// Guest Connect state
|
|
1124
1127
|
isConversationOpen: S,
|
|
1125
1128
|
lastMessageId: k,
|
|
1126
1129
|
// Simulate Guest Reply state (test environments only)
|
|
1127
1130
|
simulateOpen: W,
|
|
1128
1131
|
simulateContent: j,
|
|
1129
|
-
simulateLoading:
|
|
1132
|
+
simulateLoading: ve,
|
|
1130
1133
|
// Computed
|
|
1131
1134
|
cleanliness: xe,
|
|
1132
|
-
greenerStayIconUrl:
|
|
1133
|
-
greenerStayTooltipContent:
|
|
1134
|
-
isGreenerStay:
|
|
1135
|
-
filteredReplies:
|
|
1136
|
-
groupedMessages:
|
|
1137
|
-
hasGuestCallback:
|
|
1138
|
-
hasComplaint:
|
|
1139
|
-
itemOptionsList:
|
|
1140
|
-
occupied:
|
|
1141
|
-
occupancyTooltipContent:
|
|
1135
|
+
greenerStayIconUrl: Ue,
|
|
1136
|
+
greenerStayTooltipContent: Ge,
|
|
1137
|
+
isGreenerStay: Be,
|
|
1138
|
+
filteredReplies: We,
|
|
1139
|
+
groupedMessages: je,
|
|
1140
|
+
hasGuestCallback: $e,
|
|
1141
|
+
hasComplaint: Ee,
|
|
1142
|
+
itemOptionsList: Qe,
|
|
1143
|
+
occupied: Ae,
|
|
1144
|
+
occupancyTooltipContent: Ve,
|
|
1142
1145
|
selectedAssignType: Ye,
|
|
1143
|
-
selectedDepartment:
|
|
1144
|
-
selectedRequestedBy:
|
|
1146
|
+
selectedDepartment: Je,
|
|
1147
|
+
selectedRequestedBy: ze,
|
|
1145
1148
|
stayDetails: Ke,
|
|
1146
|
-
tagsList:
|
|
1149
|
+
tagsList: Ze,
|
|
1147
1150
|
validateToDo: Xe,
|
|
1148
1151
|
// Methods
|
|
1149
|
-
closeRequest:
|
|
1150
|
-
createCallback:
|
|
1151
|
-
getActivity:
|
|
1152
|
-
createMessageList:
|
|
1153
|
-
getChatMessages:
|
|
1154
|
-
getHowLongAgo:
|
|
1155
|
-
getPMSData:
|
|
1156
|
-
getRoomNotices:
|
|
1157
|
-
getSharedData:
|
|
1158
|
-
getStayDetails:
|
|
1159
|
-
getTicketColor:
|
|
1160
|
-
getTicketIcon:
|
|
1152
|
+
closeRequest: Se,
|
|
1153
|
+
createCallback: et,
|
|
1154
|
+
getActivity: re,
|
|
1155
|
+
createMessageList: x,
|
|
1156
|
+
getChatMessages: ye,
|
|
1157
|
+
getHowLongAgo: at,
|
|
1158
|
+
getPMSData: ne,
|
|
1159
|
+
getRoomNotices: ge,
|
|
1160
|
+
getSharedData: _e,
|
|
1161
|
+
getStayDetails: be,
|
|
1162
|
+
getTicketColor: st,
|
|
1163
|
+
getTicketIcon: nt,
|
|
1161
1164
|
getTickets: J,
|
|
1162
|
-
handleFailedResponse:
|
|
1163
|
-
handlePulse:
|
|
1164
|
-
onClickActivity:
|
|
1165
|
-
onClickEditConnectGuest:
|
|
1166
|
-
onClickTicket:
|
|
1167
|
-
onCreateRequestSubmit:
|
|
1168
|
-
onHoverToggle:
|
|
1169
|
-
onSelectQuickReply:
|
|
1170
|
-
onSelectToDo:
|
|
1171
|
-
openRequest:
|
|
1172
|
-
refreshPMSData:
|
|
1173
|
-
resizeTextarea:
|
|
1174
|
-
scrollToConnectBottom:
|
|
1175
|
-
sendChatMessage:
|
|
1176
|
-
setAlignment:
|
|
1177
|
-
setPositioning:
|
|
1178
|
-
toggleMarkOpenClose:
|
|
1179
|
-
toggleQuickReply:
|
|
1180
|
-
updateTickets:
|
|
1165
|
+
handleFailedResponse: Ne,
|
|
1166
|
+
handlePulse: rt,
|
|
1167
|
+
onClickActivity: ut,
|
|
1168
|
+
onClickEditConnectGuest: lt,
|
|
1169
|
+
onClickTicket: it,
|
|
1170
|
+
onCreateRequestSubmit: ct,
|
|
1171
|
+
onHoverToggle: dt,
|
|
1172
|
+
onSelectQuickReply: mt,
|
|
1173
|
+
onSelectToDo: vt,
|
|
1174
|
+
openRequest: pt,
|
|
1175
|
+
refreshPMSData: ot,
|
|
1176
|
+
resizeTextarea: Ce,
|
|
1177
|
+
scrollToConnectBottom: z,
|
|
1178
|
+
sendChatMessage: ft,
|
|
1179
|
+
setAlignment: Ie,
|
|
1180
|
+
setPositioning: Te,
|
|
1181
|
+
toggleMarkOpenClose: ht,
|
|
1182
|
+
toggleQuickReply: Me,
|
|
1183
|
+
updateTickets: wt,
|
|
1181
1184
|
// Simulate Guest Reply methods (test environments only)
|
|
1182
|
-
simulateGuestReply:
|
|
1183
|
-
toggleSimulateOpen:
|
|
1185
|
+
simulateGuestReply: yt,
|
|
1186
|
+
toggleSimulateOpen: gt
|
|
1184
1187
|
};
|
|
1185
1188
|
}
|
|
1186
1189
|
});
|
|
1187
1190
|
export {
|
|
1188
|
-
|
|
1191
|
+
ea as default
|
|
1189
1192
|
};
|