@quoreadmin/ui 1.9.3 → 1.10.1

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