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