@quoreadmin/ui 1.8.2 → 1.8.4
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/index142.js +401 -369
- package/dist/index144.js +1 -1
- package/dist/index174.js +14 -14
- package/dist/index175.js +3 -3
- package/dist/index178.js +4 -4
- package/dist/index185.js +10 -10
- package/dist/index186.js +12 -2
- package/dist/index187.js +10 -10
- package/dist/index189.js +36 -1190
- package/dist/{index192.js → index190.js} +17 -17
- package/dist/index191.js +1190 -36
- package/dist/index193.js +28 -28
- package/dist/index194.js +2 -2
- package/dist/index195.js +2 -2
- package/dist/index196.js +1 -1
- package/dist/index198.js +2 -2
- package/dist/index200.js +14 -14
- package/dist/index201.js +1 -1
- package/dist/index202.js +1 -1
- package/dist/index203.js +3 -3
- package/dist/index204.js +6 -6
- package/dist/index205.js +29 -84
- package/dist/index206.js +109 -400
- package/dist/index207.js +36 -22
- package/dist/index208.js +26 -161
- package/dist/index209.js +35 -19
- package/dist/index210.js +50 -19
- package/dist/index211.js +42 -21
- package/dist/index212.js +3 -198
- package/dist/index213.js +9 -70
- package/dist/index214.js +19 -34
- package/dist/index215.js +10 -40
- package/dist/index216.js +9 -160
- package/dist/index217.js +34 -223
- package/dist/index218.js +21 -37
- package/dist/index219.js +88 -10
- package/dist/index220.js +403 -29
- package/dist/index221.js +22 -116
- package/dist/index222.js +157 -32
- package/dist/index223.js +228 -26
- package/dist/index224.js +31 -30
- package/dist/index225.js +10 -51
- package/dist/index226.js +157 -39
- package/dist/index227.js +19 -3
- package/dist/index228.js +20 -9
- package/dist/index229.js +21 -18
- package/dist/index230.js +199 -10
- package/dist/index231.js +70 -10
- package/dist/index232.js +34 -39
- package/dist/index233.js +40 -21
- package/dist/index234.js +21 -126
- package/dist/index235.js +21 -37
- package/dist/index236.js +20 -80
- package/dist/index237.js +836 -20
- package/dist/index238.js +701 -19
- package/dist/index239.js +175 -19
- package/dist/index240.js +11 -11
- package/dist/index241.js +12 -14
- package/dist/index242.js +6 -6
- package/dist/index243.js +7 -7
- package/dist/index244.js +20 -836
- package/dist/index245.js +3 -702
- package/dist/index246.js +183 -172
- package/dist/index247.js +132 -21
- package/dist/index248.js +1223 -20
- package/dist/index249.js +126 -19
- package/dist/index250.js +20 -3
- package/dist/index251.js +21 -186
- package/dist/index252.js +21 -132
- package/dist/index253.js +17 -1202
- package/dist/index254.js +22 -13
- package/dist/index255.js +13 -15
- package/dist/index256.js +12 -14
- package/dist/index257.js +2 -29
- package/dist/index258.js +2 -20
- package/dist/index259.js +3636 -20
- package/dist/index260.js +55 -2
- package/dist/index261.js +77 -2
- package/dist/index262.js +33 -3617
- package/dist/index263.js +192 -32
- package/dist/index264.js +9 -76
- package/dist/index265.js +39 -34
- package/dist/index266.js +32 -186
- package/dist/index267.js +53 -9
- package/dist/index268.js +58 -40
- package/dist/index269.js +700 -35
- package/dist/index270.js +28 -40
- package/dist/index271.js +23 -34
- package/dist/index272.js +10 -725
- package/dist/index273.js +693 -30
- package/dist/index274.js +818 -62
- package/dist/index275.js +79 -10
- package/dist/index276.js +20 -705
- package/dist/index277.js +20 -820
- package/dist/index282.js +3 -54
- package/dist/index283.js +25 -77
- package/dist/index284.js +53 -25
- package/dist/index285.js +78 -21
- package/dist/index286.js +17 -13
- package/dist/index287.js +22 -16
- package/dist/index288.js +22 -17
- package/dist/index289.js +15 -22
- package/dist/index290.js +17 -2
- package/dist/index291.js +22 -261
- package/dist/index292.js +78 -5
- package/dist/index293.js +21 -139
- package/dist/index294.js +928 -66
- package/dist/index295.js +21 -86
- package/dist/index296.js +19 -28
- package/dist/index297.js +19 -15
- package/dist/index298.js +67 -73
- package/dist/index299.js +19 -4
- package/dist/index3.js +9 -9
- package/dist/index300.js +19 -2
- package/dist/index301.js +21 -82
- package/dist/index302.js +21 -52
- package/dist/index303.js +63 -6
- package/dist/index304.js +2 -5
- package/dist/index305.js +1504 -149
- package/dist/index306.js +378 -55
- package/dist/index307.js +2731 -75
- package/dist/index308.js +79 -1527
- package/dist/index309.js +3739 -333
- package/dist/index310.js +47 -2718
- package/dist/index311.js +15 -86
- package/dist/index312.js +60 -3768
- package/dist/index313.js +197 -55
- package/dist/index314.js +246 -15
- package/dist/index315.js +254 -76
- package/dist/index316.js +4 -200
- package/dist/index317.js +129 -235
- package/dist/index318.js +71 -77
- package/dist/index319.js +86 -21
- package/dist/index320.js +26 -932
- package/dist/index321.js +14 -20
- package/dist/index322.js +74 -19
- package/dist/index323.js +3 -19
- package/dist/index324.js +2 -69
- package/dist/index325.js +82 -18
- package/dist/index326.js +53 -19
- package/dist/index327.js +5 -21
- package/dist/index328.js +4 -21
- package/dist/index329.js +178 -62
- package/dist/index330.js +63 -3
- package/dist/index331.js +75 -27
- package/dist/index332.js +9 -36
- package/dist/index333.js +10 -19
- package/dist/index334.js +14 -57
- package/dist/index335.js +10 -29
- package/dist/index336.js +16 -6
- package/dist/index337.js +8 -51
- package/dist/index338.js +13 -7
- package/dist/index339.js +54 -11
- package/dist/index340.js +12 -7
- package/dist/index341.js +14 -28
- package/dist/index342.js +58 -2
- package/dist/index343.js +51 -69
- package/dist/index344.js +28 -164
- package/dist/index345.js +2 -20
- package/dist/index346.js +5 -20
- package/dist/index347.js +2 -64
- package/dist/index348.js +23 -37
- package/dist/index349.js +40 -8
- package/dist/index350.js +2 -13
- package/dist/index351.js +11 -55
- package/dist/index352.js +18 -10
- package/dist/index353.js +2 -14
- package/dist/index354.js +9 -58
- package/dist/index355.js +34 -49
- package/dist/index356.js +19 -30
- package/dist/index357.js +20 -2
- package/dist/index358.js +64 -5
- package/dist/index359.js +37 -2
- package/dist/index360.js +19 -23
- package/dist/index361.js +56 -40
- package/dist/index362.js +29 -2
- package/dist/index363.js +7 -11
- package/dist/index364.js +49 -17
- package/dist/index365.js +6 -9
- package/dist/index366.js +12 -10
- package/dist/index367.js +6 -16
- package/dist/index368.js +28 -2
- package/dist/index369.js +2 -9
- package/dist/index370.js +70 -10
- package/dist/index371.js +165 -12
- package/dist/index372.js +17 -31
- package/dist/index373.js +100 -10
- package/dist/index374.js +90 -3
- package/dist/index375.js +98 -4
- package/dist/index376.js +30 -12
- package/dist/index377.js +11 -7
- package/dist/index378.js +3 -11
- package/dist/index379.js +3 -4
- package/dist/index380.js +13 -33
- package/dist/index381.js +7 -31
- package/dist/index382.js +12 -28
- package/dist/index383.js +5 -61
- package/dist/index384.js +33 -98
- package/dist/index385.js +29 -99
- package/dist/index386.js +27 -16
- package/dist/index387.js +61 -91
- package/dist/index388.js +1 -1
- package/dist/index393.js +1 -1
- package/dist/index394.js +2 -2
- package/dist/index44.js +389 -338
- package/dist/index64.js +22 -32
- package/dist/src/components/activity-item/activity-item.d.ts +8 -6
- package/dist/src/components/room-details-popover/room-details-popover.d.ts +30 -8
- package/package.json +1 -1
- package/src/assets/illustrations/news-placeholder-image.svg +10 -0
- package/src/assets/illustrations/app-icon-news.svg +0 -1
package/dist/index142.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useI18n as
|
|
1
|
+
import { defineComponent as pt, ref as l, computed as _, watch as B, onMounted as ft, onUnmounted as ht } from "vue";
|
|
2
|
+
import { useI18n as yt } from "vue-i18n";
|
|
3
3
|
import { DateTime as w } from "./index166.js";
|
|
4
|
-
import "./
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import K from "./
|
|
16
|
-
const
|
|
4
|
+
import "./index189.js";
|
|
5
|
+
import gt from "./index2.js";
|
|
6
|
+
import _t from "./index3.js";
|
|
7
|
+
import wt from "./index4.js";
|
|
8
|
+
import It from "./index21.js";
|
|
9
|
+
import Tt from "./index28.js";
|
|
10
|
+
import Dt from "./index40.js";
|
|
11
|
+
import Ot from "./index20.js";
|
|
12
|
+
import kt from "./index47.js";
|
|
13
|
+
import Et from "./index48.js";
|
|
14
|
+
import At from "./index50.js";
|
|
15
|
+
import K from "./index190.js";
|
|
16
|
+
const Wt = pt({
|
|
17
17
|
name: "QRoomDetailsPopover",
|
|
18
18
|
components: {
|
|
19
|
-
QAccordion:
|
|
20
|
-
QActivityItem:
|
|
21
|
-
QAvatar:
|
|
22
|
-
QDatePicker:
|
|
23
|
-
QDivider:
|
|
24
|
-
QIcon:
|
|
25
|
-
QPopover:
|
|
26
|
-
QTag:
|
|
27
|
-
QTextarea:
|
|
28
|
-
QTooltip:
|
|
19
|
+
QAccordion: gt,
|
|
20
|
+
QActivityItem: _t,
|
|
21
|
+
QAvatar: wt,
|
|
22
|
+
QDatePicker: Ot,
|
|
23
|
+
QDivider: It,
|
|
24
|
+
QIcon: Tt,
|
|
25
|
+
QPopover: Dt,
|
|
26
|
+
QTag: kt,
|
|
27
|
+
QTextarea: Et,
|
|
28
|
+
QTooltip: At
|
|
29
29
|
},
|
|
30
30
|
props: {
|
|
31
31
|
id: {
|
|
@@ -83,6 +83,10 @@ const Ft = ct({
|
|
|
83
83
|
type: Boolean,
|
|
84
84
|
default: !0
|
|
85
85
|
},
|
|
86
|
+
showActivity: {
|
|
87
|
+
type: Boolean,
|
|
88
|
+
default: !1
|
|
89
|
+
},
|
|
86
90
|
showGuestCallback: {
|
|
87
91
|
type: Boolean,
|
|
88
92
|
default: !0
|
|
@@ -160,21 +164,21 @@ const Ft = ct({
|
|
|
160
164
|
}
|
|
161
165
|
},
|
|
162
166
|
emits: ["create:callback", "create:todo", "refresh:pms", "show:toast", "toggle"],
|
|
163
|
-
setup(
|
|
164
|
-
const { t:
|
|
167
|
+
setup(s, { emit: f }) {
|
|
168
|
+
const { t: u } = yt(), i = l(null), ue = l(!1), ce = l("left"), X = l([
|
|
165
169
|
{
|
|
166
170
|
id: 1,
|
|
167
|
-
label:
|
|
171
|
+
label: u("HC_DEPARTMENT")
|
|
168
172
|
},
|
|
169
173
|
{
|
|
170
174
|
id: 2,
|
|
171
|
-
label:
|
|
175
|
+
label: u("HC_PERSON")
|
|
172
176
|
},
|
|
173
177
|
{
|
|
174
178
|
id: 0,
|
|
175
|
-
label:
|
|
179
|
+
label: u("HC_ANYONE")
|
|
176
180
|
}
|
|
177
|
-
]),
|
|
181
|
+
]), S = l(""), p = l({
|
|
178
182
|
checkInDate: /* @__PURE__ */ new Date(),
|
|
179
183
|
checkOutDate: /* @__PURE__ */ new Date(),
|
|
180
184
|
guestEmail: "",
|
|
@@ -182,23 +186,24 @@ const Ft = ct({
|
|
|
182
186
|
guestMood: null,
|
|
183
187
|
guestName: "",
|
|
184
188
|
guestPhone: "",
|
|
185
|
-
inHouse: !!
|
|
189
|
+
inHouse: !!i.value?.tokenId || !1,
|
|
186
190
|
problem: null,
|
|
187
191
|
notes: "",
|
|
188
|
-
tokenId:
|
|
189
|
-
}), G =
|
|
192
|
+
tokenId: i.value?.tokenId
|
|
193
|
+
}), G = l(250), U = l(290), M = l([]), Te = l([]), Z = l(!0), ee = l(!0), N = l({
|
|
190
194
|
info: !0,
|
|
191
195
|
tickets: !0,
|
|
192
196
|
comments: !0
|
|
193
|
-
}), te =
|
|
197
|
+
}), te = l(!0), Me = l(s.guestDetails), O = l([]), y = l({
|
|
194
198
|
actionItems: !1,
|
|
199
|
+
activity: !1,
|
|
195
200
|
conversationToggle: !1,
|
|
196
201
|
messages: !1,
|
|
197
202
|
pms: !1,
|
|
198
203
|
roomNotices: !1,
|
|
199
204
|
sendingMessage: !1,
|
|
200
205
|
tickets: !1
|
|
201
|
-
}), C =
|
|
206
|
+
}), C = l([]), de = l([]), me = l("bottom"), R = l(null), L = l(!1), W = l(!1), j = l(""), ve = l(!1), b = l(!1), k = l(null), $ = l(null), Ne = 3e4, d = l({
|
|
202
207
|
assignType: null,
|
|
203
208
|
department: null,
|
|
204
209
|
due: /* @__PURE__ */ new Date(),
|
|
@@ -208,38 +213,38 @@ const Ft = ct({
|
|
|
208
213
|
requestedBy: null,
|
|
209
214
|
when: null,
|
|
210
215
|
where: null
|
|
211
|
-
}),
|
|
216
|
+
}), Q = l([
|
|
212
217
|
{
|
|
213
218
|
id: 0,
|
|
214
|
-
label:
|
|
219
|
+
label: u("HC_STAFF_MEMBER")
|
|
215
220
|
},
|
|
216
221
|
{
|
|
217
222
|
id: 1,
|
|
218
|
-
label:
|
|
223
|
+
label: u("HC_HOTEL_GUEST")
|
|
219
224
|
}
|
|
220
|
-
]),
|
|
225
|
+
]), pe = l(!1), E = l(null), I = l({
|
|
221
226
|
endDate: /* @__PURE__ */ new Date(),
|
|
222
227
|
issue: null,
|
|
223
228
|
notes: "",
|
|
224
229
|
startDate: /* @__PURE__ */ new Date()
|
|
225
|
-
}), ae =
|
|
230
|
+
}), ae = l([]), oe = l(!1), fe = l([]), Re = l(!0), A = l([]), H = l([]), Le = l([
|
|
226
231
|
{
|
|
227
|
-
label:
|
|
232
|
+
label: u("HC_COMPLAINT"),
|
|
228
233
|
id: "complaint"
|
|
229
234
|
},
|
|
230
235
|
{
|
|
231
|
-
label:
|
|
236
|
+
label: u("HC_REQUEST"),
|
|
232
237
|
id: "request"
|
|
233
238
|
},
|
|
234
239
|
{
|
|
235
|
-
label:
|
|
240
|
+
label: u("HC_ROOM_NOTICE"),
|
|
236
241
|
id: "room_notice"
|
|
237
242
|
},
|
|
238
243
|
{
|
|
239
|
-
label:
|
|
244
|
+
label: u("HC_WORK_ORDER"),
|
|
240
245
|
id: "work_order"
|
|
241
246
|
}
|
|
242
|
-
]),
|
|
247
|
+
]), V = l(), P = l(null), v = l({
|
|
243
248
|
assignType: null,
|
|
244
249
|
department: null,
|
|
245
250
|
due: /* @__PURE__ */ new Date(),
|
|
@@ -248,47 +253,47 @@ const Ft = ct({
|
|
|
248
253
|
notes: "",
|
|
249
254
|
person: null,
|
|
250
255
|
requestedBy: null
|
|
251
|
-
}),
|
|
252
|
-
switch (
|
|
256
|
+
}), he = l([]), q = l([]), x = l([]), He = _(() => {
|
|
257
|
+
switch (i.value.cleaning?.name) {
|
|
253
258
|
case "CLEAN":
|
|
254
259
|
case "INSPECTED":
|
|
255
260
|
return "CLEAN";
|
|
256
261
|
case "DIRTY":
|
|
257
262
|
case "PICKUP":
|
|
258
|
-
case "
|
|
259
|
-
case "
|
|
263
|
+
case "OUT_OF_ORDER":
|
|
264
|
+
case "OUT_OF_SERVICE":
|
|
260
265
|
return "DIRTY";
|
|
261
266
|
default:
|
|
262
267
|
return "";
|
|
263
268
|
}
|
|
264
|
-
}),
|
|
265
|
-
const e =
|
|
266
|
-
return
|
|
267
|
-
}),
|
|
269
|
+
}), Pe = _(() => {
|
|
270
|
+
const e = S.value.toLowerCase();
|
|
271
|
+
return s.quickReplies.filter((t) => t.toLowerCase().match(e));
|
|
272
|
+
}), qe = _(() => {
|
|
268
273
|
if (!C.value.length) return [];
|
|
269
274
|
const e = [];
|
|
270
275
|
let t = null;
|
|
271
276
|
return C.value.forEach((a) => {
|
|
272
|
-
const
|
|
277
|
+
const o = w.fromFormat(
|
|
273
278
|
a.dateUtc,
|
|
274
279
|
"yyyy-MM-dd HH:mm:ss",
|
|
275
280
|
{ zone: "utc" }
|
|
276
|
-
).setZone(
|
|
281
|
+
).setZone(s.propertyTimeZone), n = o.toFormat("yyyy-MM-dd-HH");
|
|
277
282
|
n !== t && (e.push({
|
|
278
283
|
type: "separator",
|
|
279
|
-
label:
|
|
284
|
+
label: o.toFormat("ccc, LLL d 'at' h:mma").replace("AM", "am").replace("PM", "pm"),
|
|
280
285
|
hourKey: n
|
|
281
286
|
}), t = n), e.push({
|
|
282
287
|
type: "message",
|
|
283
288
|
...a,
|
|
284
|
-
formattedTime:
|
|
289
|
+
formattedTime: o.toFormat("h:mma").replace("AM", "am").replace("PM", "pm")
|
|
285
290
|
});
|
|
286
291
|
}), e;
|
|
287
|
-
}),
|
|
292
|
+
}), De = _(() => A.value.length ? !!A.value.find(
|
|
288
293
|
(t) => t.type === "complaint"
|
|
289
|
-
) : !1),
|
|
294
|
+
) : !1), xe = _(() => A.value.length ? !!A.value.find(
|
|
290
295
|
(t) => t.type === "callback"
|
|
291
|
-
) : !1),
|
|
296
|
+
) : !1), Fe = _(() => {
|
|
292
297
|
let e = [];
|
|
293
298
|
return O.value[0] && O.value[0].options === void 0 ? O.value.forEach((t) => {
|
|
294
299
|
e.push({
|
|
@@ -296,7 +301,7 @@ const Ft = ct({
|
|
|
296
301
|
label: t.display_name
|
|
297
302
|
});
|
|
298
303
|
}) : e = O.value, e;
|
|
299
|
-
}),
|
|
304
|
+
}), Oe = _(() => i.value.occupancy?.name === "OCCUPIED"), Be = _(() => Oe.value && De.value ? "HK_ROOM_STATUS_Occupied_Complaint" : "HK_ROOM_STATUS_Occupied"), Ge = _(() => {
|
|
300
305
|
switch (E.value?.id) {
|
|
301
306
|
case "request":
|
|
302
307
|
case "work_order":
|
|
@@ -304,7 +309,7 @@ const Ft = ct({
|
|
|
304
309
|
default:
|
|
305
310
|
return null;
|
|
306
311
|
}
|
|
307
|
-
}),
|
|
312
|
+
}), Ue = _(() => {
|
|
308
313
|
if (M.value)
|
|
309
314
|
switch (E.value?.id) {
|
|
310
315
|
case "request":
|
|
@@ -315,30 +320,30 @@ const Ft = ct({
|
|
|
315
320
|
return null;
|
|
316
321
|
}
|
|
317
322
|
return null;
|
|
318
|
-
}),
|
|
323
|
+
}), We = _(() => {
|
|
319
324
|
switch (E.value?.id) {
|
|
320
325
|
case "request":
|
|
321
|
-
return
|
|
326
|
+
return Q.value[1];
|
|
322
327
|
case "work_order":
|
|
323
|
-
return
|
|
328
|
+
return Q.value[0];
|
|
324
329
|
default:
|
|
325
330
|
return null;
|
|
326
331
|
}
|
|
327
|
-
}),
|
|
332
|
+
}), je = _(() => {
|
|
328
333
|
let e = "";
|
|
329
|
-
if (
|
|
334
|
+
if (i.value && i.value.reservations[0]) {
|
|
330
335
|
const t = w.fromISO(
|
|
331
|
-
|
|
332
|
-
), a = t.toFormat("MMM"),
|
|
333
|
-
|
|
334
|
-
),
|
|
335
|
-
e += a + " " +
|
|
336
|
+
i.value.reservations[0].arrivalDate
|
|
337
|
+
), a = t.toFormat("MMM"), o = t.day, n = t.year, r = w.fromISO(
|
|
338
|
+
i.value.reservations[0].departureDate
|
|
339
|
+
), c = r.toFormat("MMM"), m = r.day, h = r.year;
|
|
340
|
+
e += a + " " + o, n !== h && (e += ", " + n), a === c ? e += "-" + m : e += " - " + c + " " + m, e += ", " + h;
|
|
336
341
|
}
|
|
337
342
|
return e;
|
|
338
|
-
}),
|
|
343
|
+
}), $e = _(() => {
|
|
339
344
|
let e = ae.value;
|
|
340
345
|
return e = [...new Set(e)], e;
|
|
341
|
-
}),
|
|
346
|
+
}), Qe = _(() => {
|
|
342
347
|
const e = E.value?.id;
|
|
343
348
|
if (!e)
|
|
344
349
|
return !1;
|
|
@@ -354,87 +359,87 @@ const Ft = ct({
|
|
|
354
359
|
default:
|
|
355
360
|
return !1;
|
|
356
361
|
}
|
|
357
|
-
}),
|
|
358
|
-
|
|
359
|
-
},
|
|
360
|
-
|
|
362
|
+
}), ke = () => {
|
|
363
|
+
oe.value = !1, L.value = !1, ue.value = !1, pe.value = !1, O.value = [], de.value = [], he.value = [], q.value = [], x.value = [], E.value = null, I.value.issue = null, I.value.startDate = /* @__PURE__ */ new Date(), I.value.endDate = /* @__PURE__ */ new Date(), I.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;
|
|
364
|
+
}, Ve = async () => {
|
|
365
|
+
f("create:callback", i.value), f("toggle", !1);
|
|
361
366
|
}, F = (e) => {
|
|
362
367
|
const t = [];
|
|
363
|
-
(Array.isArray(e) ? e : Object.values(e)).forEach((
|
|
364
|
-
const n =
|
|
365
|
-
let
|
|
366
|
-
id:
|
|
368
|
+
(Array.isArray(e) ? e : Object.values(e)).forEach((o) => {
|
|
369
|
+
const n = o.senderType || o.sender_type, r = o.senderName || "", c = o.senderId || o.sender_id, m = o.profileImg || o.profile_img, h = r ? r.split(" ") : ["", ""], g = o.user_first_name || o.guest_first_name || h[0] || "", z = o.user_last_name || o.guest_last_name || h.slice(1).join(" ") || "", le = g && z ? `${g} ${z}` : g || "Auto-Reply", ie = n === "system" || n === "user", T = n === "guest";
|
|
370
|
+
let D = {
|
|
371
|
+
id: o.id,
|
|
367
372
|
isPropertyEmployee: n === "user",
|
|
368
|
-
isSent: !!
|
|
373
|
+
isSent: !!o.sent,
|
|
369
374
|
isSystemMessage: n === "system",
|
|
370
|
-
isStaffMessage:
|
|
371
|
-
isGuestMessage:
|
|
372
|
-
comment:
|
|
373
|
-
dateUtc:
|
|
375
|
+
isStaffMessage: ie,
|
|
376
|
+
isGuestMessage: T,
|
|
377
|
+
comment: o.content,
|
|
378
|
+
dateUtc: o.sent || o.created,
|
|
374
379
|
user: {
|
|
375
380
|
firstName: g || "Auto-Reply",
|
|
376
381
|
icon: "",
|
|
377
|
-
id:
|
|
382
|
+
id: c || "system-message",
|
|
378
383
|
initials: "",
|
|
379
384
|
lastName: z || "",
|
|
380
|
-
name:
|
|
385
|
+
name: le,
|
|
381
386
|
src: m || ""
|
|
382
387
|
}
|
|
383
388
|
};
|
|
384
|
-
|
|
389
|
+
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);
|
|
385
390
|
}), C.value = t;
|
|
386
|
-
},
|
|
391
|
+
}, Je = (e) => {
|
|
387
392
|
if (!e || e.length === 0) return;
|
|
388
393
|
(Array.isArray(e) ? e : Object.values(e)).forEach((a) => {
|
|
389
|
-
if (C.value.some((
|
|
394
|
+
if (C.value.some((D) => D.id === a.id))
|
|
390
395
|
return;
|
|
391
|
-
const
|
|
392
|
-
let
|
|
396
|
+
const o = a.senderType || a.sender_type, n = a.senderName || "", r = 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] || "", g = a.user_last_name || a.guest_last_name || m.slice(1).join(" ") || "", z = h && g ? `${h} ${g}` : h || "Auto-Reply", le = o === "system" || o === "user", ie = o === "guest";
|
|
397
|
+
let T = {
|
|
393
398
|
id: a.id,
|
|
394
|
-
isPropertyEmployee:
|
|
399
|
+
isPropertyEmployee: o === "user",
|
|
395
400
|
isSent: !!a.sent,
|
|
396
|
-
isSystemMessage:
|
|
397
|
-
isStaffMessage:
|
|
398
|
-
isGuestMessage:
|
|
401
|
+
isSystemMessage: o === "system",
|
|
402
|
+
isStaffMessage: le,
|
|
403
|
+
isGuestMessage: ie,
|
|
399
404
|
comment: a.content,
|
|
400
405
|
dateUtc: a.sent || a.created,
|
|
401
406
|
user: {
|
|
402
|
-
firstName:
|
|
407
|
+
firstName: h || "Auto-Reply",
|
|
403
408
|
icon: "",
|
|
404
409
|
id: r || "system-message",
|
|
405
410
|
initials: "",
|
|
406
411
|
lastName: g || "",
|
|
407
412
|
name: z,
|
|
408
|
-
src:
|
|
413
|
+
src: c || ""
|
|
409
414
|
}
|
|
410
415
|
};
|
|
411
|
-
|
|
416
|
+
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"), C.value.push(T);
|
|
412
417
|
});
|
|
413
|
-
},
|
|
414
|
-
if (
|
|
418
|
+
}, ye = async (e = !1) => {
|
|
419
|
+
if (s.showComments && i.value.tokenId) {
|
|
415
420
|
e || (y.value.messages = !0);
|
|
416
421
|
try {
|
|
417
|
-
let t = `/api/client/connect/getMessages.php?tokenId=${
|
|
422
|
+
let t = `/api/client/connect/getMessages.php?tokenId=${i.value.tokenId}`;
|
|
418
423
|
e && k.value !== null && (t += `&lastMsgId=${k.value}`);
|
|
419
|
-
const
|
|
424
|
+
const o = await (await fetch(t, {
|
|
420
425
|
method: "GET",
|
|
421
426
|
credentials: "include"
|
|
422
427
|
})).json();
|
|
423
|
-
if (
|
|
424
|
-
throw new Error(
|
|
425
|
-
if (
|
|
426
|
-
k.value =
|
|
428
|
+
if (o.status === "error")
|
|
429
|
+
throw new Error(o.message || "Failed to get messages");
|
|
430
|
+
if (b.value = !o.closed, o.messages && o.messages.length > 0) {
|
|
431
|
+
k.value = o.messages[o.messages.length - 1].id, e ? Je(o.messages) : F(o.messages);
|
|
427
432
|
const n = setTimeout(Y, 100);
|
|
428
|
-
|
|
429
|
-
} else e || F(
|
|
433
|
+
H.value.push(n);
|
|
434
|
+
} else e || F(o.messages || []);
|
|
430
435
|
} catch (t) {
|
|
431
436
|
console.error("getChatMessages error:", t);
|
|
432
437
|
} finally {
|
|
433
438
|
e || (y.value.messages = !1);
|
|
434
439
|
}
|
|
435
440
|
}
|
|
436
|
-
},
|
|
437
|
-
const t = w.utc(), a = w.fromFormat(e, "yyyy-MM-dd HH:mm:ss", { zone: "utc" }),
|
|
441
|
+
}, Ye = (e) => {
|
|
442
|
+
const t = w.utc(), a = w.fromFormat(e, "yyyy-MM-dd HH:mm:ss", { zone: "utc" }), o = t.diff(
|
|
438
443
|
a,
|
|
439
444
|
[
|
|
440
445
|
"years",
|
|
@@ -443,54 +448,54 @@ const Ft = ct({
|
|
|
443
448
|
"hours",
|
|
444
449
|
"minutes"
|
|
445
450
|
]
|
|
446
|
-
), n = Math.floor(
|
|
451
|
+
), n = Math.floor(o.years), r = Math.floor(o.months), c = Math.floor(o.days), m = Math.floor(o.hours), h = Math.floor(o.minutes);
|
|
447
452
|
if (n)
|
|
448
|
-
return n === 1 ?
|
|
453
|
+
return n === 1 ? u("HC_ONE_YEAR_AGO") : u("HC_X_YEARS_AGO", { years: n });
|
|
449
454
|
if (r)
|
|
450
|
-
return r === 1 ?
|
|
451
|
-
if (
|
|
452
|
-
return
|
|
455
|
+
return r === 1 ? u("HC_ONE_MONTH_AGO") : u("HC_X_MONTHS_AGO", { months: r });
|
|
456
|
+
if (c)
|
|
457
|
+
return c === 1 ? u("HC_ONE_DAY_AGO") : u("HC_X_DAYS_AGO", { days: c });
|
|
453
458
|
if (m)
|
|
454
|
-
return m === 1 ?
|
|
455
|
-
if (
|
|
456
|
-
return
|
|
457
|
-
if (
|
|
458
|
-
return
|
|
459
|
-
},
|
|
460
|
-
|
|
461
|
-
},
|
|
459
|
+
return m === 1 ? u("HC_ONE_HOUR_AGO") : u("HC_X_HOURS_AGO", { hours: m });
|
|
460
|
+
if (h)
|
|
461
|
+
return h === 1 ? u("HC_ONE_MINUTE_AGO") : u("HC_X_MINUTES_AGO", { minutes: h });
|
|
462
|
+
if (h === 0)
|
|
463
|
+
return u("HC_A_MOMENT_AGO");
|
|
464
|
+
}, ze = async () => {
|
|
465
|
+
s.showGuestDetails && se(), ne(), J(), re(), f("refresh:pms", i.value);
|
|
466
|
+
}, se = async () => {
|
|
462
467
|
try {
|
|
463
468
|
y.value.pms = !0;
|
|
464
469
|
const e = new AbortController(), t = setTimeout(() => e.abort(), 45e3);
|
|
465
|
-
|
|
466
|
-
const a =
|
|
470
|
+
H.value.push(t);
|
|
471
|
+
const a = s.pmsBaseUrl;
|
|
467
472
|
if (!a)
|
|
468
473
|
throw new Error("PMS base URL is required");
|
|
469
|
-
const
|
|
474
|
+
const o = {
|
|
470
475
|
Authorization: "Bearer " + (() => {
|
|
471
476
|
const g = `; ${document.cookie}`.split("; QV2Auth=");
|
|
472
477
|
return g.length === 2 && g.pop()?.split(";").shift() || "";
|
|
473
478
|
})(),
|
|
474
479
|
"Content-Type": "application/json"
|
|
475
|
-
}, n =
|
|
476
|
-
`${a}/vendors/properties/statuses/${
|
|
480
|
+
}, n = i.value?.qv2Rooms?.qRoomId || i.value?.id || s.room.id, r = await fetch(
|
|
481
|
+
`${a}/vendors/properties/statuses/${s.propertyId}/rooms`,
|
|
477
482
|
{
|
|
478
483
|
method: "POST",
|
|
479
|
-
headers:
|
|
484
|
+
headers: o,
|
|
480
485
|
signal: e.signal,
|
|
481
486
|
body: JSON.stringify({ roomsIds: [n] })
|
|
482
487
|
}
|
|
483
488
|
);
|
|
484
|
-
clearTimeout(t), r.ok ||
|
|
485
|
-
const
|
|
486
|
-
R.value = m, m.length > 0 ?
|
|
489
|
+
clearTimeout(t), r.ok || Ae(r);
|
|
490
|
+
const c = await r.json(), m = c.data?.pmsRooms || c.data?.rooms || c.rooms || [];
|
|
491
|
+
R.value = m, m.length > 0 ? i.value = {
|
|
487
492
|
...m[0],
|
|
488
|
-
tokenId: m[0].tokenId ||
|
|
489
|
-
} :
|
|
493
|
+
tokenId: m[0].tokenId || s.room.tokenId
|
|
494
|
+
} : i.value = s.room, y.value.pms = !1;
|
|
490
495
|
} catch (e) {
|
|
491
|
-
return y.value.pms = !1,
|
|
496
|
+
return y.value.pms = !1, f("show:toast", {
|
|
492
497
|
show: !0,
|
|
493
|
-
message:
|
|
498
|
+
message: u("HC_FAILED_TO_LOAD_PMS_DATA"),
|
|
494
499
|
variant: "error",
|
|
495
500
|
icon: "exclamation-circle"
|
|
496
501
|
}), e;
|
|
@@ -499,26 +504,26 @@ const Ft = ct({
|
|
|
499
504
|
try {
|
|
500
505
|
y.value.roomNotices = !0;
|
|
501
506
|
const e = await fetch(
|
|
502
|
-
"/api/client/common/getRoomNotices.php?propertyId=" +
|
|
507
|
+
"/api/client/common/getRoomNotices.php?propertyId=" + s.propertyId + "&roomIds=[" + s.room.id + "]"
|
|
503
508
|
);
|
|
504
509
|
if (!e.ok)
|
|
505
510
|
throw new Error(`HTTP error! status: ${e.status}`);
|
|
506
511
|
const t = await e.json();
|
|
507
512
|
ae.value = t.notices;
|
|
508
513
|
} catch (e) {
|
|
509
|
-
console.error("Error getting room notices:", e), ae.value = [],
|
|
514
|
+
console.error("Error getting room notices:", e), ae.value = [], f("show:toast", {
|
|
510
515
|
show: !0,
|
|
511
|
-
message:
|
|
516
|
+
message: u("HC_FAILED_TO_LOAD_ROOM_NOTICES"),
|
|
512
517
|
variant: "error",
|
|
513
518
|
icon: "exclamation-circle"
|
|
514
519
|
});
|
|
515
520
|
} finally {
|
|
516
521
|
y.value.roomNotices = !1;
|
|
517
522
|
}
|
|
518
|
-
},
|
|
523
|
+
}, ge = async () => {
|
|
519
524
|
try {
|
|
520
525
|
const e = new FormData();
|
|
521
|
-
e.append("property_id",
|
|
526
|
+
e.append("property_id", s.propertyId), e.append("filter", "tasks_new");
|
|
522
527
|
const [t, a] = await Promise.all([
|
|
523
528
|
fetch("/api/client/common/getDepartments.php", {
|
|
524
529
|
method: "POST"
|
|
@@ -527,31 +532,31 @@ const Ft = ct({
|
|
|
527
532
|
method: "POST",
|
|
528
533
|
body: e
|
|
529
534
|
})
|
|
530
|
-
]),
|
|
531
|
-
if (
|
|
535
|
+
]), o = await t.json(), n = await a.json();
|
|
536
|
+
if (o.departments && (o.departments.forEach((r) => {
|
|
532
537
|
r.label = r.display_name;
|
|
533
|
-
}), M.value =
|
|
538
|
+
}), M.value = o.departments), n.users) {
|
|
534
539
|
const r = [];
|
|
535
|
-
let
|
|
540
|
+
let c = {
|
|
536
541
|
group: "",
|
|
537
542
|
options: []
|
|
538
543
|
};
|
|
539
544
|
n.users.forEach((m) => {
|
|
540
|
-
m.translated_department !==
|
|
541
|
-
}),
|
|
545
|
+
m.translated_department !== c.group && (c.group && r.push({ ...c }), c.group = m.translated_department, c.options = []), c.options.push(m);
|
|
546
|
+
}), c.group && r.push({ ...c }), Te.value = r;
|
|
542
547
|
}
|
|
543
548
|
} catch (e) {
|
|
544
|
-
console.error("Error getting shared data:", e),
|
|
549
|
+
console.error("Error getting shared data:", e), f("show:toast", {
|
|
545
550
|
show: !0,
|
|
546
|
-
message:
|
|
551
|
+
message: u("HC_FAILED_TO_LOAD_SHARED_DATA"),
|
|
547
552
|
variant: "error",
|
|
548
553
|
icon: "exclamation-circle"
|
|
549
554
|
});
|
|
550
555
|
}
|
|
551
|
-
},
|
|
556
|
+
}, Ee = async () => {
|
|
552
557
|
try {
|
|
553
558
|
const t = await (await fetch(
|
|
554
|
-
`/api/client/connect/getStayDetails.php?tokenId=${
|
|
559
|
+
`/api/client/connect/getStayDetails.php?tokenId=${i.value.tokenId}`,
|
|
555
560
|
{
|
|
556
561
|
method: "GET",
|
|
557
562
|
credentials: "include"
|
|
@@ -565,14 +570,14 @@ const Ft = ct({
|
|
|
565
570
|
t.checkOut
|
|
566
571
|
).toJSDate());
|
|
567
572
|
} catch (e) {
|
|
568
|
-
console.error("getStayDetails error:", e),
|
|
573
|
+
console.error("getStayDetails error:", e), f("show:toast", {
|
|
569
574
|
show: !0,
|
|
570
|
-
message:
|
|
575
|
+
message: u("HC_FAILED_TO_LOAD_STAY_DETAILS"),
|
|
571
576
|
variant: "error",
|
|
572
577
|
icon: "exclamation-circle"
|
|
573
578
|
});
|
|
574
579
|
}
|
|
575
|
-
},
|
|
580
|
+
}, Ke = (e) => {
|
|
576
581
|
switch (e) {
|
|
577
582
|
case "complaint":
|
|
578
583
|
return "red-30";
|
|
@@ -585,7 +590,7 @@ const Ft = ct({
|
|
|
585
590
|
case "task":
|
|
586
591
|
return "green-20";
|
|
587
592
|
}
|
|
588
|
-
},
|
|
593
|
+
}, Xe = (e) => {
|
|
589
594
|
switch (e) {
|
|
590
595
|
case "complaint":
|
|
591
596
|
return "face-frown";
|
|
@@ -598,27 +603,48 @@ const Ft = ct({
|
|
|
598
603
|
case "task":
|
|
599
604
|
return "check";
|
|
600
605
|
}
|
|
601
|
-
},
|
|
606
|
+
}, J = async () => {
|
|
602
607
|
try {
|
|
603
608
|
y.value.tickets = !0;
|
|
604
609
|
const e = await fetch(
|
|
605
|
-
"/api/client/common/getAllToDos.php?propertyId=" +
|
|
610
|
+
"/api/client/common/getAllToDos.php?propertyId=" + s.propertyId + "&roomIds=[" + s.room.id + "]"
|
|
606
611
|
);
|
|
607
612
|
if (!e.ok)
|
|
608
613
|
throw new Error(`HTTP error! status: ${e.status}`);
|
|
609
614
|
const t = await e.json();
|
|
610
|
-
|
|
615
|
+
A.value = t.tickets;
|
|
611
616
|
} catch (e) {
|
|
612
|
-
console.error("Error getting tickets:", e),
|
|
617
|
+
console.error("Error getting tickets:", e), A.value = [], f("show:toast", {
|
|
613
618
|
show: !0,
|
|
614
|
-
message:
|
|
619
|
+
message: u("HC_FAILED_TO_LOAD_TICKETS"),
|
|
615
620
|
variant: "error",
|
|
616
621
|
icon: "exclamation-circle"
|
|
617
622
|
});
|
|
618
623
|
} finally {
|
|
619
624
|
y.value.tickets = !1;
|
|
620
625
|
}
|
|
621
|
-
},
|
|
626
|
+
}, re = async () => {
|
|
627
|
+
if (s.showActivity)
|
|
628
|
+
try {
|
|
629
|
+
y.value.activity = !0;
|
|
630
|
+
const e = i.value?.qv2Rooms?.qRoomId || i.value?.id || s.room?.id, t = await fetch(
|
|
631
|
+
"/api/client/common/getCleaningsInspections.php?propertyId=" + s.propertyId + "&areaId=" + e
|
|
632
|
+
);
|
|
633
|
+
if (!t.ok)
|
|
634
|
+
throw new Error(`HTTP error! status: ${t.status}`);
|
|
635
|
+
const a = await t.json();
|
|
636
|
+
fe.value = a.inspections || [];
|
|
637
|
+
} catch (e) {
|
|
638
|
+
console.error("Error getting activity:", e), fe.value = [], f("show:toast", {
|
|
639
|
+
show: !0,
|
|
640
|
+
message: u("HC_FAILED_TO_LOAD_ACTIVITY"),
|
|
641
|
+
variant: "error",
|
|
642
|
+
icon: "exclamation-circle"
|
|
643
|
+
});
|
|
644
|
+
} finally {
|
|
645
|
+
y.value.activity = !1;
|
|
646
|
+
}
|
|
647
|
+
}, Ae = async (e) => {
|
|
622
648
|
const t = await e.text();
|
|
623
649
|
let a;
|
|
624
650
|
try {
|
|
@@ -627,34 +653,34 @@ const Ft = ct({
|
|
|
627
653
|
a = { code: e.status, message: t };
|
|
628
654
|
}
|
|
629
655
|
return a.code === 401 ? (window.location.href = "/logout.php?unauthorized=1", { error: a }) : a;
|
|
630
|
-
},
|
|
656
|
+
}, Ze = (e) => {
|
|
631
657
|
const t = document.querySelectorAll(".pulse");
|
|
632
658
|
if (t && t.length) {
|
|
633
|
-
const a =
|
|
659
|
+
const a = i.value?.qv2Rooms?.qRoomId || i.value?.id || s.room?.id, o = document.getElementById("room-" + a), n = o?.classList;
|
|
634
660
|
switch (e) {
|
|
635
661
|
case "room_notice":
|
|
636
|
-
(n?.contains("roombox_unsel") || n?.contains("roombox_unsel_active")) && (
|
|
662
|
+
(n?.contains("roombox_unsel") || n?.contains("roombox_unsel_active")) && (o?.classList.remove(), o?.classList.add("roomnoticeroombox_sel"));
|
|
637
663
|
break;
|
|
638
664
|
case "complaint":
|
|
639
|
-
!n?.contains("smsroombox_sel") && !n?.contains("callbackroombox_sel") && (
|
|
665
|
+
!n?.contains("smsroombox_sel") && !n?.contains("callbackroombox_sel") && (o?.classList.remove(), o?.classList.add("complaintsroombox_sel"));
|
|
640
666
|
break;
|
|
641
667
|
case "request":
|
|
642
|
-
!n?.contains("smsroombox_sel") && !n?.contains("callbackroombox_sel") && !n?.contains("complaintsroombox_sel") && (
|
|
668
|
+
!n?.contains("smsroombox_sel") && !n?.contains("callbackroombox_sel") && !n?.contains("complaintsroombox_sel") && (o?.classList.remove(), o?.classList.add("guestrequestroombox_sel"));
|
|
643
669
|
break;
|
|
644
670
|
case "work_order":
|
|
645
|
-
!n?.contains("smsroombox_sel") && !n?.contains("callbackroombox_sel") && !n?.contains("complaintsroombox_sel") && !n?.contains("guestrequestroombox_sel") && (
|
|
671
|
+
!n?.contains("smsroombox_sel") && !n?.contains("callbackroombox_sel") && !n?.contains("complaintsroombox_sel") && !n?.contains("guestrequestroombox_sel") && (o?.classList.remove(), o?.classList.add("workordersroombox_sel"));
|
|
646
672
|
break;
|
|
647
673
|
}
|
|
648
674
|
const r = setTimeout(() => {
|
|
649
|
-
t.forEach((
|
|
650
|
-
|
|
675
|
+
t.forEach((c) => {
|
|
676
|
+
c.classList.remove("pulse");
|
|
651
677
|
});
|
|
652
678
|
}, 4500);
|
|
653
|
-
|
|
679
|
+
H.value.push(r);
|
|
654
680
|
}
|
|
655
|
-
},
|
|
681
|
+
}, et = () => {
|
|
656
682
|
window.open("/guest/overview.php", "_blank");
|
|
657
|
-
},
|
|
683
|
+
}, tt = (e) => {
|
|
658
684
|
let t = "";
|
|
659
685
|
switch (e.type) {
|
|
660
686
|
case "complaint":
|
|
@@ -676,48 +702,50 @@ const Ft = ct({
|
|
|
676
702
|
return "#";
|
|
677
703
|
}
|
|
678
704
|
window.open(t, "_blank");
|
|
679
|
-
},
|
|
680
|
-
|
|
681
|
-
|
|
705
|
+
}, at = (e) => {
|
|
706
|
+
e.link && window.open(e.link, "_blank");
|
|
707
|
+
}, ot = async () => {
|
|
708
|
+
pe.value = !0;
|
|
709
|
+
const e = i.value?.qv2Rooms?.qRoomId || i.value?.id || s.room?.id, t = i.value?.qv2Rooms?.qRoomName || i.value?.name || s.room?.name, a = {
|
|
682
710
|
type: E.value?.id,
|
|
683
|
-
propertyId:
|
|
711
|
+
propertyId: s.propertyId,
|
|
684
712
|
userId: P.value,
|
|
685
713
|
areaId: e,
|
|
686
714
|
areaName: t
|
|
687
715
|
};
|
|
688
716
|
switch (E.value?.id) {
|
|
689
717
|
case "complaint":
|
|
690
|
-
a.tokenId =
|
|
718
|
+
a.tokenId = i.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 = w.fromJSDate(p.value.checkInDate).toFormat(
|
|
691
719
|
"yyyy-MM-dd"
|
|
692
720
|
), a.checkOutDate = w.fromJSDate(p.value.checkOutDate).toFormat(
|
|
693
721
|
"yyyy-MM-dd"
|
|
694
|
-
), a.notes = p.value.notes, a.inHouse = 2, a.source = "dashboard",
|
|
722
|
+
), a.notes = p.value.notes, a.inHouse = 2, a.source = "dashboard", f("create:todo", a);
|
|
695
723
|
break;
|
|
696
724
|
case "request":
|
|
697
|
-
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 = w.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),
|
|
725
|
+
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 = w.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);
|
|
698
726
|
break;
|
|
699
727
|
case "room_notice":
|
|
700
|
-
a.issueId = I.value.issue.id, a.startDate = w.fromJSDate(I.value.startDate).toFormat("yyyy-MM-dd"), a.endDate = w.fromJSDate(I.value.endDate).toFormat("yyyy-MM-dd"), a.notes = I.value.notes, a.sendPush = "1",
|
|
728
|
+
a.issueId = I.value.issue.id, a.startDate = w.fromJSDate(I.value.startDate).toFormat("yyyy-MM-dd"), a.endDate = w.fromJSDate(I.value.endDate).toFormat("yyyy-MM-dd"), a.notes = I.value.notes, a.sendPush = "1", f("create:todo", a);
|
|
701
729
|
break;
|
|
702
730
|
case "work_order":
|
|
703
|
-
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 = w.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),
|
|
731
|
+
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 = w.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);
|
|
704
732
|
break;
|
|
705
733
|
}
|
|
706
|
-
},
|
|
707
|
-
|
|
708
|
-
},
|
|
709
|
-
Se(),
|
|
710
|
-
},
|
|
734
|
+
}, st = (e) => {
|
|
735
|
+
we(), Ie(), s.hover && f("toggle", e);
|
|
736
|
+
}, nt = (e) => {
|
|
737
|
+
Se(), S.value = e;
|
|
738
|
+
}, rt = async (e) => {
|
|
711
739
|
if (console.log("selected:", e), E.value = e, O.value = [], I.value.issue = null, p.value.problem = null, v.value.item = null, v.value.issue = null, d.value.item = null, !E.value) {
|
|
712
740
|
y.value.actionItems = !1;
|
|
713
741
|
return;
|
|
714
742
|
}
|
|
715
743
|
y.value.actionItems = !0;
|
|
716
|
-
const t =
|
|
717
|
-
switch (a.append("property_id",
|
|
744
|
+
const t = i.value?.qv2Rooms?.qRoomId || i.value?.id || s.room?.id, a = new FormData();
|
|
745
|
+
switch (a.append("property_id", s.propertyId), a.append("area_id", t), e.id) {
|
|
718
746
|
case "complaint":
|
|
719
747
|
try {
|
|
720
|
-
|
|
748
|
+
i.value.tokenId && await Ee();
|
|
721
749
|
const n = await (await fetch("/api/client/common/getComplaintProblemsByPropertyId.php", {
|
|
722
750
|
method: "POST",
|
|
723
751
|
body: a
|
|
@@ -726,13 +754,13 @@ const Ft = ct({
|
|
|
726
754
|
const r = await K.post(
|
|
727
755
|
"/api/client/common/getComplaintMoods.php"
|
|
728
756
|
);
|
|
729
|
-
r.data.items.forEach((
|
|
730
|
-
|
|
731
|
-
}),
|
|
732
|
-
} catch (
|
|
733
|
-
console.error("Error loading complaint options:",
|
|
757
|
+
r.data.items.forEach((c) => {
|
|
758
|
+
c.label = c.display_name;
|
|
759
|
+
}), de.value = r.data.items;
|
|
760
|
+
} catch (o) {
|
|
761
|
+
console.error("Error loading complaint options:", o), f("show:toast", {
|
|
734
762
|
show: !0,
|
|
735
|
-
message:
|
|
763
|
+
message: u("HC_FAILED_TO_LOAD_COMPLAINT_OPTIONS"),
|
|
736
764
|
variant: "error",
|
|
737
765
|
icon: "exclamation-circle"
|
|
738
766
|
});
|
|
@@ -747,10 +775,10 @@ const Ft = ct({
|
|
|
747
775
|
body: a
|
|
748
776
|
})).json();
|
|
749
777
|
n.items && (O.value = n.items);
|
|
750
|
-
} catch (
|
|
751
|
-
console.error("Error loading room notice options:",
|
|
778
|
+
} catch (o) {
|
|
779
|
+
console.error("Error loading room notice options:", o), f("show:toast", {
|
|
752
780
|
show: !0,
|
|
753
|
-
message:
|
|
781
|
+
message: u("HC_FAILED_TO_LOAD_ROOM_NOTICE_OPTIONS"),
|
|
754
782
|
variant: "error",
|
|
755
783
|
icon: "exclamation-circle"
|
|
756
784
|
});
|
|
@@ -760,17 +788,17 @@ const Ft = ct({
|
|
|
760
788
|
break;
|
|
761
789
|
case "request":
|
|
762
790
|
try {
|
|
763
|
-
d.value.requestedBy =
|
|
791
|
+
d.value.requestedBy = Q.value[1], d.value.assignType = X.value[0];
|
|
764
792
|
const n = await (await fetch("/api/client/common/getHousekeepingItemsByPropertyId.php", {
|
|
765
793
|
method: "POST",
|
|
766
794
|
body: a
|
|
767
795
|
})).json();
|
|
768
|
-
if (n.items && (O.value = n.items), await
|
|
796
|
+
if (n.items && (O.value = n.items), await ge(), d.value.department = M.value.find(
|
|
769
797
|
(r) => parseInt(r.id) === 4
|
|
770
|
-
),
|
|
798
|
+
), s.allowWhenWhere)
|
|
771
799
|
try {
|
|
772
800
|
const r = new FormData();
|
|
773
|
-
r.append("property_id",
|
|
801
|
+
r.append("property_id", s.propertyId);
|
|
774
802
|
const m = await (await fetch(
|
|
775
803
|
"/api/client/common/getWhenWhereOptions.php",
|
|
776
804
|
{
|
|
@@ -778,27 +806,27 @@ const Ft = ct({
|
|
|
778
806
|
body: r
|
|
779
807
|
}
|
|
780
808
|
)).json();
|
|
781
|
-
m.when && Array.isArray(m.when) ? q.value = m.when.map((
|
|
782
|
-
id:
|
|
783
|
-
label:
|
|
784
|
-
value:
|
|
785
|
-
})) : q.value = [], m.where && Array.isArray(m.where) ? x.value = m.where.map((
|
|
786
|
-
id:
|
|
787
|
-
label:
|
|
788
|
-
value:
|
|
809
|
+
m.when && Array.isArray(m.when) ? q.value = m.when.map((h) => ({
|
|
810
|
+
id: h.id,
|
|
811
|
+
label: h.name,
|
|
812
|
+
value: h.id
|
|
813
|
+
})) : q.value = [], m.where && Array.isArray(m.where) ? x.value = m.where.map((h) => ({
|
|
814
|
+
id: h.id,
|
|
815
|
+
label: h.name,
|
|
816
|
+
value: h.id
|
|
789
817
|
})) : x.value = [];
|
|
790
818
|
} catch (r) {
|
|
791
|
-
console.error("Error loading When/Where options:", r), q.value = [], x.value = [],
|
|
819
|
+
console.error("Error loading When/Where options:", r), q.value = [], x.value = [], f("show:toast", {
|
|
792
820
|
show: !0,
|
|
793
|
-
message:
|
|
821
|
+
message: u("HC_FAILED_TO_LOAD_WHEN_WHERE_OPTIONS"),
|
|
794
822
|
variant: "error",
|
|
795
823
|
icon: "exclamation-circle"
|
|
796
824
|
});
|
|
797
825
|
}
|
|
798
|
-
} catch (
|
|
799
|
-
console.error("Error loading request options:",
|
|
826
|
+
} catch (o) {
|
|
827
|
+
console.error("Error loading request options:", o), f("show:toast", {
|
|
800
828
|
show: !0,
|
|
801
|
-
message:
|
|
829
|
+
message: u("HC_FAILED_TO_LOAD_REQUEST_OPTIONS"),
|
|
802
830
|
variant: "error",
|
|
803
831
|
icon: "exclamation-circle"
|
|
804
832
|
});
|
|
@@ -808,34 +836,34 @@ const Ft = ct({
|
|
|
808
836
|
break;
|
|
809
837
|
case "work_order":
|
|
810
838
|
try {
|
|
811
|
-
v.value.requestedBy =
|
|
839
|
+
v.value.requestedBy = Q.value[0], v.value.assignType = X.value[0];
|
|
812
840
|
const n = await (await fetch("/api/client/common/getItemsByRoomId.php", {
|
|
813
841
|
method: "POST",
|
|
814
842
|
body: a
|
|
815
843
|
})).json(), r = [];
|
|
816
|
-
let
|
|
844
|
+
let c = {
|
|
817
845
|
group: "",
|
|
818
846
|
options: []
|
|
819
847
|
};
|
|
820
848
|
n.items && (n.items.forEach((m) => {
|
|
821
|
-
m.section_name !==
|
|
822
|
-
}),
|
|
849
|
+
m.section_name !== c.group && (c.group && r.push({ ...c }), c.group = m.section_name, c.options = []), m.label && c.options.push(m);
|
|
850
|
+
}), c.group && r.push({ ...c })), O.value = r, await Promise.all([
|
|
823
851
|
K.post(
|
|
824
852
|
"/api/client/common/getWorkOrderIssues.php"
|
|
825
853
|
),
|
|
826
|
-
|
|
854
|
+
ge()
|
|
827
855
|
]).then((m) => {
|
|
828
|
-
const
|
|
829
|
-
|
|
856
|
+
const h = m[0];
|
|
857
|
+
h.data.issues.forEach((g) => {
|
|
830
858
|
g.label = g.display_name;
|
|
831
|
-
}),
|
|
859
|
+
}), he.value = h.data.issues;
|
|
832
860
|
}), v.value.department = M.value.find(
|
|
833
861
|
(m) => parseInt(m.id) === 2
|
|
834
862
|
);
|
|
835
|
-
} catch (
|
|
836
|
-
console.error("Error loading work order options:",
|
|
863
|
+
} catch (o) {
|
|
864
|
+
console.error("Error loading work order options:", o), f("show:toast", {
|
|
837
865
|
show: !0,
|
|
838
|
-
message:
|
|
866
|
+
message: u("HC_FAILED_TO_LOAD_WORK_ORDER_OPTIONS"),
|
|
839
867
|
variant: "error",
|
|
840
868
|
icon: "exclamation-circle"
|
|
841
869
|
});
|
|
@@ -847,9 +875,9 @@ const Ft = ct({
|
|
|
847
875
|
y.value.actionItems = !1;
|
|
848
876
|
return;
|
|
849
877
|
}
|
|
850
|
-
},
|
|
851
|
-
|
|
852
|
-
},
|
|
878
|
+
}, lt = () => {
|
|
879
|
+
oe.value = !oe.value, ue.value = !1;
|
|
880
|
+
}, be = () => {
|
|
853
881
|
const e = document.getElementById("comment-field"), t = document.getElementById("hidden-text");
|
|
854
882
|
e.style.height = t?.offsetHeight + "px";
|
|
855
883
|
}, Y = () => {
|
|
@@ -858,30 +886,30 @@ const Ft = ct({
|
|
|
858
886
|
top: e.scrollHeight,
|
|
859
887
|
behavior: "smooth"
|
|
860
888
|
});
|
|
861
|
-
},
|
|
862
|
-
if (e && e.type === "keydown" && e.preventDefault(),
|
|
889
|
+
}, it = async (e) => {
|
|
890
|
+
if (e && e.type === "keydown" && e.preventDefault(), i.value.tokenId && S.value && !L.value) {
|
|
863
891
|
y.value.sendingMessage = !0;
|
|
864
892
|
try {
|
|
865
893
|
const t = new FormData();
|
|
866
|
-
t.append("tokenId",
|
|
894
|
+
t.append("tokenId", i.value.tokenId), t.append("content", S.value), t.append("senderId", P.value || "");
|
|
867
895
|
const a = await K.post(
|
|
868
896
|
"/api/client/connect/sendMessage.php",
|
|
869
897
|
t
|
|
870
898
|
);
|
|
871
899
|
if (a.data.status === "error") {
|
|
872
|
-
|
|
900
|
+
f("show:toast", {
|
|
873
901
|
show: !0,
|
|
874
|
-
message:
|
|
902
|
+
message: u("HC_FAILED_TO_SEND_MESSAGE"),
|
|
875
903
|
variant: "error",
|
|
876
904
|
icon: "exclamation-circle"
|
|
877
905
|
});
|
|
878
906
|
return;
|
|
879
907
|
}
|
|
880
|
-
|
|
908
|
+
S.value = "", b.value = !a.data.closed, a.data.messages && (F(a.data.messages), a.data.messages.length > 0 && (k.value = a.data.messages[a.data.messages.length - 1].id)), Y();
|
|
881
909
|
} catch (t) {
|
|
882
|
-
console.error("sendChatMessage error:", t),
|
|
910
|
+
console.error("sendChatMessage error:", t), f("show:toast", {
|
|
883
911
|
show: !0,
|
|
884
|
-
message:
|
|
912
|
+
message: u("HC_FAILED_TO_SEND_MESSAGE"),
|
|
885
913
|
variant: "error",
|
|
886
914
|
icon: "exclamation-circle"
|
|
887
915
|
});
|
|
@@ -889,32 +917,32 @@ const Ft = ct({
|
|
|
889
917
|
y.value.sendingMessage = !1;
|
|
890
918
|
}
|
|
891
919
|
}
|
|
892
|
-
},
|
|
893
|
-
if (!(!
|
|
920
|
+
}, ut = async () => {
|
|
921
|
+
if (!(!i.value.tokenId || !P.value)) {
|
|
894
922
|
y.value.conversationToggle = !0;
|
|
895
923
|
try {
|
|
896
|
-
const e =
|
|
897
|
-
t.append("tokenId",
|
|
924
|
+
const e = b.value ? "/api/client/connect/closeConversation.php" : "/api/client/connect/openConversation.php", t = new FormData();
|
|
925
|
+
t.append("tokenId", i.value.tokenId), t.append("userId", P.value), b.value && k.value !== null && t.append("lastMsgId", k.value.toString());
|
|
898
926
|
const a = await K.post(e, t);
|
|
899
927
|
if (a.data.status === "error") {
|
|
900
|
-
|
|
928
|
+
f("show:toast", {
|
|
901
929
|
show: !0,
|
|
902
|
-
message:
|
|
930
|
+
message: u("HC_FAILED_TO_UPDATE_CONVERSATION"),
|
|
903
931
|
variant: "error",
|
|
904
932
|
icon: "exclamation-circle"
|
|
905
933
|
});
|
|
906
934
|
return;
|
|
907
935
|
}
|
|
908
|
-
|
|
936
|
+
b.value = !a.data.closed, a.data.messages && (F(a.data.messages), a.data.messages.length > 0 && (k.value = a.data.messages[a.data.messages.length - 1].id)), f("show:toast", {
|
|
909
937
|
show: !0,
|
|
910
|
-
message:
|
|
938
|
+
message: b.value ? u("HC_CONVERSATION_REOPENED") : u("HC_CONVERSATION_CLOSED"),
|
|
911
939
|
variant: "success",
|
|
912
940
|
icon: "check-circle"
|
|
913
941
|
});
|
|
914
942
|
} catch (e) {
|
|
915
|
-
console.error("toggleMarkOpenClose error:", e),
|
|
943
|
+
console.error("toggleMarkOpenClose error:", e), f("show:toast", {
|
|
916
944
|
show: !0,
|
|
917
|
-
message:
|
|
945
|
+
message: u("HC_FAILED_TO_UPDATE_CONVERSATION"),
|
|
918
946
|
variant: "error",
|
|
919
947
|
icon: "exclamation-circle"
|
|
920
948
|
});
|
|
@@ -922,73 +950,73 @@ const Ft = ct({
|
|
|
922
950
|
y.value.conversationToggle = !1;
|
|
923
951
|
}
|
|
924
952
|
}
|
|
925
|
-
},
|
|
926
|
-
if (
|
|
927
|
-
|
|
953
|
+
}, ct = async () => {
|
|
954
|
+
if (s.isTestEnvironment && !(!i.value?.tokenId || !j.value.trim())) {
|
|
955
|
+
ve.value = !0;
|
|
928
956
|
try {
|
|
929
957
|
const e = new FormData();
|
|
930
|
-
e.append("tokenId",
|
|
958
|
+
e.append("tokenId", i.value.tokenId), e.append("content", j.value.trim());
|
|
931
959
|
const t = await K.post(
|
|
932
960
|
"/api/client/connect/simulateInbound.php",
|
|
933
961
|
e
|
|
934
962
|
);
|
|
935
963
|
if (t.data.status === "error") {
|
|
936
|
-
|
|
964
|
+
f("show:toast", {
|
|
937
965
|
show: !0,
|
|
938
|
-
message:
|
|
966
|
+
message: u("HC_FAILED_TO_SIMULATE_MESSAGE"),
|
|
939
967
|
variant: "error",
|
|
940
968
|
icon: "exclamation-circle"
|
|
941
969
|
});
|
|
942
970
|
return;
|
|
943
971
|
}
|
|
944
|
-
t.data.messages && (F(t.data.messages),
|
|
972
|
+
t.data.messages && (F(t.data.messages), b.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, Y(), f("show:toast", {
|
|
945
973
|
show: !0,
|
|
946
|
-
message:
|
|
974
|
+
message: u("HC_SIMULATED_GUEST_REPLY"),
|
|
947
975
|
variant: "success",
|
|
948
976
|
icon: "check-circle"
|
|
949
977
|
});
|
|
950
978
|
} catch (e) {
|
|
951
|
-
console.error("simulateGuestReply error:", e),
|
|
979
|
+
console.error("simulateGuestReply error:", e), f("show:toast", {
|
|
952
980
|
show: !0,
|
|
953
|
-
message:
|
|
981
|
+
message: u("HC_FAILED_TO_SIMULATE_MESSAGE"),
|
|
954
982
|
variant: "error",
|
|
955
983
|
icon: "exclamation-circle"
|
|
956
984
|
});
|
|
957
985
|
} finally {
|
|
958
|
-
|
|
986
|
+
ve.value = !1;
|
|
959
987
|
}
|
|
960
988
|
}
|
|
961
|
-
},
|
|
989
|
+
}, dt = () => {
|
|
962
990
|
W.value = !W.value, W.value || (j.value = "");
|
|
963
|
-
},
|
|
964
|
-
|
|
965
|
-
document.visibilityState === "visible" &&
|
|
966
|
-
},
|
|
967
|
-
},
|
|
968
|
-
|
|
969
|
-
},
|
|
970
|
-
if (
|
|
971
|
-
const e =
|
|
972
|
-
|
|
991
|
+
}, mt = () => {
|
|
992
|
+
$.value || ($.value = setInterval(() => {
|
|
993
|
+
document.visibilityState === "visible" && ye(!0);
|
|
994
|
+
}, Ne));
|
|
995
|
+
}, _e = () => {
|
|
996
|
+
$.value && (clearInterval($.value), $.value = null);
|
|
997
|
+
}, we = () => {
|
|
998
|
+
if (s.align === "left" || s.align === "right") {
|
|
999
|
+
const e = V.value?.getBoundingClientRect().left, t = window.innerWidth;
|
|
1000
|
+
ce.value = t - e < U.value ? "right" : "left";
|
|
973
1001
|
} else {
|
|
974
|
-
const e =
|
|
975
|
-
|
|
1002
|
+
const e = V.value?.getBoundingClientRect().top, t = window.innerHeight;
|
|
1003
|
+
ce.value = t - e < G.value ? "bottom" : "top";
|
|
976
1004
|
}
|
|
977
|
-
},
|
|
978
|
-
if (
|
|
979
|
-
const e =
|
|
980
|
-
|
|
1005
|
+
}, Ie = () => {
|
|
1006
|
+
if (s.position === "top" || s.position === "bottom") {
|
|
1007
|
+
const e = V.value?.getBoundingClientRect().top, t = window.innerHeight;
|
|
1008
|
+
me.value = t - e < G.value ? "top" : "bottom";
|
|
981
1009
|
} else {
|
|
982
|
-
const e =
|
|
983
|
-
|
|
1010
|
+
const e = V.value?.getBoundingClientRect().left, t = window.innerWidth;
|
|
1011
|
+
me.value = t - e < U.value ? "left" : "right";
|
|
984
1012
|
}
|
|
985
1013
|
}, Se = () => {
|
|
986
|
-
|
|
987
|
-
},
|
|
988
|
-
const a =
|
|
989
|
-
if (
|
|
1014
|
+
L.value = !L.value, L.value ? (S.value = "", N.value.info = ee.value, N.value.tickets = te.value, N.value.comments = Z.value, ee.value = !1, te.value = !1, document.getElementById("comment-field")?.focus()) : (ee.value = N.value.info, te.value = N.value.tickets, Z.value = N.value.comments);
|
|
1015
|
+
}, vt = async (e, t) => {
|
|
1016
|
+
const a = i.value?.qv2Rooms?.qRoomId || i.value?.id || s.room?.id, o = new FormData();
|
|
1017
|
+
if (o.append("property_id", s.propertyId), o.append("room_ids", JSON.stringify([a])), await J(), A.value) {
|
|
990
1018
|
const n = [];
|
|
991
|
-
|
|
1019
|
+
A.value.forEach((r) => {
|
|
992
1020
|
r.id === e && r.type === t ? n.unshift({
|
|
993
1021
|
...r,
|
|
994
1022
|
isNew: !0
|
|
@@ -996,142 +1024,146 @@ const Ft = ct({
|
|
|
996
1024
|
...r,
|
|
997
1025
|
isNew: !1
|
|
998
1026
|
});
|
|
999
|
-
}), n.sort((r,
|
|
1027
|
+
}), n.sort((r, c) => r.id === e ? -1 : c.id === e ? 1 : 0), A.value = [...n];
|
|
1000
1028
|
}
|
|
1001
1029
|
};
|
|
1002
|
-
B(() =>
|
|
1003
|
-
if (
|
|
1030
|
+
B(() => s.open, () => {
|
|
1031
|
+
if (s.open && s.showComments && C.value.length) {
|
|
1004
1032
|
const e = setTimeout(Y, 500);
|
|
1005
|
-
|
|
1033
|
+
H.value.push(e);
|
|
1006
1034
|
}
|
|
1007
|
-
|
|
1035
|
+
s.open || (ke(), _e(), k.value = null, C.value = [], b.value = !1);
|
|
1008
1036
|
}), B(
|
|
1009
|
-
() => [
|
|
1010
|
-
([e, t, a,
|
|
1011
|
-
e && t && a &&
|
|
1037
|
+
() => [s.open, s.showComments, Z.value, i.value?.tokenId],
|
|
1038
|
+
([e, t, a, o]) => {
|
|
1039
|
+
e && t && a && o ? mt() : _e();
|
|
1012
1040
|
}
|
|
1013
|
-
), B(
|
|
1014
|
-
const e = setTimeout(
|
|
1015
|
-
|
|
1016
|
-
}), B(() =>
|
|
1041
|
+
), B(S, () => {
|
|
1042
|
+
const e = setTimeout(be, 100);
|
|
1043
|
+
H.value.push(e);
|
|
1044
|
+
}), B(() => s.allowWhenWhere, (e, t) => {
|
|
1017
1045
|
t === !0 && e === !1 && (d.value.when = null, d.value.where = null, q.value = [], x.value = []);
|
|
1018
1046
|
});
|
|
1019
|
-
const
|
|
1020
|
-
return B(() =>
|
|
1021
|
-
e && !t && (
|
|
1047
|
+
const Ce = () => !!(s.room.reservations || s.room.cleaning || s.room.occupancy);
|
|
1048
|
+
return B(() => s.open, async (e, t) => {
|
|
1049
|
+
e && !t && (Ce() ? (i.value = s.room, R.value = [s.room]) : s.showGuestDetails && !R.value ? await se() : i.value || (i.value = s.room), J(), ne(), re(), s.showComments && ye());
|
|
1022
1050
|
}), B(
|
|
1023
|
-
() =>
|
|
1051
|
+
() => s.room.id,
|
|
1024
1052
|
(e, t) => {
|
|
1025
|
-
e !== t && (
|
|
1053
|
+
e !== t && (i.value = s.room, R.value = null, s.open && (Ce() ? R.value = [s.room] : s.showGuestDetails && se(), J(), ne(), re()));
|
|
1026
1054
|
}
|
|
1027
|
-
),
|
|
1055
|
+
), ft(async () => {
|
|
1028
1056
|
const e = JSON.parse(
|
|
1029
1057
|
window.localStorage.getItem("authenticated")
|
|
1030
1058
|
);
|
|
1031
|
-
P.value = e?.user?.id || window.userId || "",
|
|
1032
|
-
}),
|
|
1033
|
-
|
|
1059
|
+
P.value = e?.user?.id || window.userId || "", i.value = s.room, s.size === "sm" && (G.value = 140, U.value = 160), s.size === "lg" && (G.value = 250, U.value = 440), we(), Ie();
|
|
1060
|
+
}), ht(() => {
|
|
1061
|
+
H.value.forEach((e) => {
|
|
1034
1062
|
clearTimeout(e);
|
|
1035
|
-
}),
|
|
1063
|
+
}), _e();
|
|
1036
1064
|
}), {
|
|
1037
1065
|
DateTime: w,
|
|
1038
1066
|
// Refs
|
|
1039
|
-
|
|
1040
|
-
|
|
1067
|
+
activityList: fe,
|
|
1068
|
+
actionMenuOpen: ue,
|
|
1069
|
+
alignment: ce,
|
|
1041
1070
|
assignTypes: X,
|
|
1042
|
-
comment:
|
|
1071
|
+
comment: S,
|
|
1043
1072
|
complaint: p,
|
|
1044
1073
|
componentHeight: G,
|
|
1045
1074
|
componentWidth: U,
|
|
1046
1075
|
departments: M,
|
|
1047
|
-
departmentUsers:
|
|
1076
|
+
departmentUsers: Te,
|
|
1077
|
+
expandActivity: Re,
|
|
1048
1078
|
expandComments: Z,
|
|
1049
1079
|
expandGuestInfo: ee,
|
|
1050
1080
|
expandedStates: N,
|
|
1051
1081
|
expandTickets: te,
|
|
1052
|
-
guestDetailsData:
|
|
1082
|
+
guestDetailsData: Me,
|
|
1053
1083
|
itemOptions: O,
|
|
1054
1084
|
loading: y,
|
|
1055
1085
|
messages: C,
|
|
1056
|
-
moodOptions:
|
|
1086
|
+
moodOptions: de,
|
|
1057
1087
|
pmsData: R,
|
|
1058
|
-
positioning:
|
|
1059
|
-
quickReplyOpen:
|
|
1088
|
+
positioning: me,
|
|
1089
|
+
quickReplyOpen: L,
|
|
1060
1090
|
request: d,
|
|
1061
|
-
requestedByOptions:
|
|
1062
|
-
requestLoading:
|
|
1091
|
+
requestedByOptions: Q,
|
|
1092
|
+
requestLoading: pe,
|
|
1063
1093
|
requestType: E,
|
|
1064
|
-
roomDetailsData:
|
|
1094
|
+
roomDetailsData: i,
|
|
1065
1095
|
roomNotice: I,
|
|
1066
1096
|
roomNotices: ae,
|
|
1067
|
-
showCreateRequest:
|
|
1068
|
-
ticketsList:
|
|
1069
|
-
todoOptions:
|
|
1070
|
-
trigger:
|
|
1097
|
+
showCreateRequest: oe,
|
|
1098
|
+
ticketsList: A,
|
|
1099
|
+
todoOptions: Le,
|
|
1100
|
+
trigger: V,
|
|
1071
1101
|
userId: P,
|
|
1072
1102
|
workOrder: v,
|
|
1073
|
-
workOrderIssues:
|
|
1103
|
+
workOrderIssues: he,
|
|
1074
1104
|
whenOptions: q,
|
|
1075
1105
|
whereOptions: x,
|
|
1076
1106
|
// Guest Connect state
|
|
1077
|
-
isConversationOpen:
|
|
1107
|
+
isConversationOpen: b,
|
|
1078
1108
|
lastMessageId: k,
|
|
1079
1109
|
// Simulate Guest Reply state (test environments only)
|
|
1080
1110
|
simulateOpen: W,
|
|
1081
1111
|
simulateContent: j,
|
|
1082
|
-
simulateLoading:
|
|
1112
|
+
simulateLoading: ve,
|
|
1083
1113
|
// Computed
|
|
1084
|
-
cleanliness:
|
|
1085
|
-
filteredReplies:
|
|
1086
|
-
groupedMessages:
|
|
1087
|
-
hasGuestCallback:
|
|
1088
|
-
hasComplaint:
|
|
1089
|
-
itemOptionsList:
|
|
1090
|
-
occupied:
|
|
1091
|
-
occupancyTooltipContent:
|
|
1092
|
-
selectedAssignType:
|
|
1093
|
-
selectedDepartment:
|
|
1094
|
-
selectedRequestedBy:
|
|
1095
|
-
stayDetails:
|
|
1096
|
-
tagsList:
|
|
1097
|
-
validateToDo:
|
|
1114
|
+
cleanliness: He,
|
|
1115
|
+
filteredReplies: Pe,
|
|
1116
|
+
groupedMessages: qe,
|
|
1117
|
+
hasGuestCallback: xe,
|
|
1118
|
+
hasComplaint: De,
|
|
1119
|
+
itemOptionsList: Fe,
|
|
1120
|
+
occupied: Oe,
|
|
1121
|
+
occupancyTooltipContent: Be,
|
|
1122
|
+
selectedAssignType: Ge,
|
|
1123
|
+
selectedDepartment: Ue,
|
|
1124
|
+
selectedRequestedBy: We,
|
|
1125
|
+
stayDetails: je,
|
|
1126
|
+
tagsList: $e,
|
|
1127
|
+
validateToDo: Qe,
|
|
1098
1128
|
// Methods
|
|
1099
|
-
closeRequest:
|
|
1100
|
-
createCallback:
|
|
1129
|
+
closeRequest: ke,
|
|
1130
|
+
createCallback: Ve,
|
|
1131
|
+
getActivity: re,
|
|
1101
1132
|
createMessageList: F,
|
|
1102
|
-
getChatMessages:
|
|
1103
|
-
getHowLongAgo:
|
|
1104
|
-
getPMSData:
|
|
1133
|
+
getChatMessages: ye,
|
|
1134
|
+
getHowLongAgo: Ye,
|
|
1135
|
+
getPMSData: se,
|
|
1105
1136
|
getRoomNotices: ne,
|
|
1106
|
-
getSharedData:
|
|
1107
|
-
getStayDetails:
|
|
1108
|
-
getTicketColor:
|
|
1109
|
-
getTicketIcon:
|
|
1110
|
-
getTickets:
|
|
1111
|
-
handleFailedResponse:
|
|
1112
|
-
handlePulse:
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1137
|
+
getSharedData: ge,
|
|
1138
|
+
getStayDetails: Ee,
|
|
1139
|
+
getTicketColor: Ke,
|
|
1140
|
+
getTicketIcon: Xe,
|
|
1141
|
+
getTickets: J,
|
|
1142
|
+
handleFailedResponse: Ae,
|
|
1143
|
+
handlePulse: Ze,
|
|
1144
|
+
onClickActivity: at,
|
|
1145
|
+
onClickEditConnectGuest: et,
|
|
1146
|
+
onClickTicket: tt,
|
|
1147
|
+
onCreateRequestSubmit: ot,
|
|
1148
|
+
onHoverToggle: st,
|
|
1149
|
+
onSelectQuickReply: nt,
|
|
1150
|
+
onSelectToDo: rt,
|
|
1151
|
+
openRequest: lt,
|
|
1152
|
+
refreshPMSData: ze,
|
|
1153
|
+
resizeTextarea: be,
|
|
1122
1154
|
scrollToConnectBottom: Y,
|
|
1123
|
-
sendChatMessage:
|
|
1124
|
-
setAlignment:
|
|
1125
|
-
setPositioning:
|
|
1126
|
-
toggleMarkOpenClose:
|
|
1155
|
+
sendChatMessage: it,
|
|
1156
|
+
setAlignment: we,
|
|
1157
|
+
setPositioning: Ie,
|
|
1158
|
+
toggleMarkOpenClose: ut,
|
|
1127
1159
|
toggleQuickReply: Se,
|
|
1128
|
-
updateTickets:
|
|
1160
|
+
updateTickets: vt,
|
|
1129
1161
|
// Simulate Guest Reply methods (test environments only)
|
|
1130
|
-
simulateGuestReply:
|
|
1131
|
-
toggleSimulateOpen:
|
|
1162
|
+
simulateGuestReply: ct,
|
|
1163
|
+
toggleSimulateOpen: dt
|
|
1132
1164
|
};
|
|
1133
1165
|
}
|
|
1134
1166
|
});
|
|
1135
1167
|
export {
|
|
1136
|
-
|
|
1168
|
+
Wt as default
|
|
1137
1169
|
};
|