@quoreadmin/ui 1.7.4 → 1.7.6

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