@feedmepos/mf-hrm-portal 2.3.3-dev → 2.3.3

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 (304) hide show
  1. package/dist/{ApprovalCodeList-D8ZVkmrF.js → ApprovalCodeList-BvS5dgU3.js} +15 -14
  2. package/dist/AuditLogList-CpX_suVp.js +2031 -0
  3. package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-BT4DaSaO.js +438 -0
  4. package/dist/EmployeeList-CVsnidNV.js +776 -0
  5. package/dist/FormItem.vue_vue_type_script_setup_true_lang-h8toO2k-.js +45 -0
  6. package/dist/FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js +49 -0
  7. package/dist/{GrantUserList-RK38DjjY.js → GrantUserList-Dyh5kllB.js} +16 -15
  8. package/dist/Main-CRU4YEdj.js +96 -0
  9. package/dist/{Main-Pv9x678t.js → Main-OmCnufx6.js} +11 -11
  10. package/dist/{Main-424HHE7m.js → Main-aoY6s0QA.js} +5 -5
  11. package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-CqG0v0Sz.js +243 -0
  12. package/dist/{PermissionSetList-BT1oUm8M.js → PermissionSetList-B7B3vnRf.js} +46 -44
  13. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BVOwDcXo.js +4167 -0
  14. package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-EwU7gHP7.js +35 -0
  15. package/dist/ResponsiveContextMenu.vue_vue_type_script_setup_true_lang-mSJFKo7r.js +132 -0
  16. package/dist/RoleList-B7jLSn2l.js +740 -0
  17. package/dist/ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-BG5gE0iX.js +544 -0
  18. package/dist/ScheduleGeneralPage-DK2hKCWE.js +811 -0
  19. package/dist/ScheduleModal.vue_vue_type_script_setup_true_lang-mMjDR4Nz.js +2556 -0
  20. package/dist/SchedulePage-Dn4joe9m.js +19446 -0
  21. package/dist/SchedulePositionPage-D7u4QBug.js +282 -0
  22. package/dist/SelectFilter-BbTj7kMh.js +263 -0
  23. package/dist/TeamMemberList-C0nZBhqp.js +1154 -0
  24. package/dist/{TimesheetList-ByUp0yfA.js → TimesheetList-B6TIgZba.js} +11 -11
  25. package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-9x0jnL2P.js → TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-CF1cWXsG.js} +4 -4
  26. package/dist/{app-BsAwRWj0.js → app-Cfzysb_Z.js} +11543 -6732
  27. package/dist/app.js +3 -3
  28. package/dist/{approval-code-BUuYtJAO.js → approval-code-CWq2ce3u.js} +4 -4
  29. package/dist/{dayjs.min-C9xnIrg1.js → dayjs.min-NoTESZyy.js} +13 -13
  30. package/dist/{employee-DAwBQ0bc.js → employee-BzUt7_wz.js} +71 -67
  31. package/dist/{grant-user-D-PdX5g-.js → grant-user-q_mkj3Vh.js} +2 -2
  32. package/dist/{iteration-Dat4Ismm.js → iteration-DmbHO_Rl.js} +1 -1
  33. package/dist/{lodash-DjYVoggD.js → lodash-DqvpfdBt.js} +1 -1
  34. package/dist/object-Dwyg2LgX.js +16 -0
  35. package/dist/restaurant-DJBQY9N5.js +2688 -0
  36. package/dist/{role-DN-jiQnS.js → role-Crd3XL59.js} +6 -7
  37. package/dist/{rule-Bgcb9R7I.js → rule-B1ck-XG6.js} +100 -105
  38. package/dist/src/api/audit-log/index.d.ts +6 -0
  39. package/dist/src/api/employee/index.d.ts +2 -2
  40. package/dist/src/api/restaurant/index.d.ts +2 -0
  41. package/dist/src/api/schedule/index.d.ts +68 -0
  42. package/dist/src/components/AppForm.vue.d.ts +2 -2
  43. package/dist/src/components/CheckboxInput.vue.d.ts +2 -2
  44. package/dist/src/components/CollapsibleWrapper.vue.d.ts +3 -11
  45. package/dist/src/components/layout/PortalShell.vue.d.ts +12 -0
  46. package/dist/src/components/layout/withScheduleShell.d.ts +10 -0
  47. package/dist/src/composables/useDiscardConfirm.d.ts +3 -1
  48. package/dist/src/composables/useMessage.d.ts +8 -2
  49. package/dist/src/helpers/string.d.ts +1 -10
  50. package/dist/src/router/shared.d.ts +3 -2
  51. package/dist/src/stores/approval-code.d.ts +1 -1
  52. package/dist/src/stores/employee.d.ts +14 -14
  53. package/dist/src/stores/grant-user.d.ts +1 -1
  54. package/dist/src/stores/permission-assignment.d.ts +2 -2
  55. package/dist/src/stores/permission-set.d.ts +2 -2
  56. package/dist/src/stores/restaurant.d.ts +9 -9
  57. package/dist/src/stores/role.d.ts +2 -2
  58. package/dist/src/stores/team.d.ts +1 -31
  59. package/dist/src/stores/timesheet.d.ts +2 -2
  60. package/dist/src/types/employee.d.ts +1 -0
  61. package/dist/src/types/schedule.d.ts +23 -0
  62. package/dist/src/types/team.d.ts +1 -17
  63. package/dist/src/views/audit-log/constants.d.ts +9 -30
  64. package/dist/src/views/audit-log/locales/index.d.ts +532 -0
  65. package/dist/src/views/audit-log/pos-row.d.ts +27 -0
  66. package/dist/src/views/audit-log/useTraceIdDeepLink.d.ts +19 -0
  67. package/dist/src/views/hr/locales/index.d.ts +4 -24
  68. package/dist/src/views/hr/role/RoleForm.vue.d.ts +2 -29
  69. package/dist/src/views/scheduling/ScheduleGeneralPage.vue.d.ts +3 -0
  70. package/dist/src/views/scheduling/SchedulePage.vue.d.ts +3 -0
  71. package/dist/src/views/scheduling/SchedulePositionPage.vue.d.ts +3 -0
  72. package/dist/src/views/scheduling/components/ScheduleAddEmployeeIdentitySection.vue.d.ts +6 -0
  73. package/dist/src/views/scheduling/components/ScheduleAddEmployeeModal.vue.d.ts +12 -0
  74. package/dist/src/views/scheduling/components/ScheduleAddEmployeeModeStep.vue.d.ts +6 -0
  75. package/dist/src/views/scheduling/components/ScheduleAddEmployeePosAccessSection.vue.d.ts +6 -0
  76. package/dist/src/views/scheduling/components/ScheduleAddEmployeePositionsSection.vue.d.ts +10 -0
  77. package/dist/src/views/scheduling/components/ScheduleAddEmployeeSchedulingSection.vue.d.ts +6 -0
  78. package/dist/src/views/scheduling/components/ScheduleAddPickPopover.vue.d.ts +6 -0
  79. package/dist/src/views/scheduling/components/ScheduleAddPositionModal.vue.d.ts +6 -0
  80. package/dist/src/views/scheduling/components/ScheduleAreaRows.vue.d.ts +41 -0
  81. package/dist/src/views/scheduling/components/ScheduleAutoScheduleDetailsModal.vue.d.ts +6 -0
  82. package/dist/src/views/scheduling/components/ScheduleAutoScheduleDoneArt.vue.d.ts +2 -0
  83. package/dist/src/views/{team/member/ExistingMemberNotice.vue.d.ts → scheduling/components/ScheduleAutoScheduleModal.vue.d.ts} +5 -6
  84. package/dist/src/views/scheduling/components/ScheduleBoardAreaRows.vue.d.ts +25 -0
  85. package/dist/src/views/scheduling/components/ScheduleBoardEditOverlays.vue.d.ts +17 -0
  86. package/dist/src/views/scheduling/components/ScheduleBoardEmployeeRows.vue.d.ts +31 -0
  87. package/dist/src/views/scheduling/components/ScheduleBoardGridHeader.vue.d.ts +29 -0
  88. package/dist/src/views/scheduling/components/ScheduleBoardInteractionOverlays.vue.d.ts +34 -0
  89. package/dist/src/views/scheduling/components/ScheduleBoardOnboardingOverlays.vue.d.ts +26 -0
  90. package/dist/src/views/scheduling/components/ScheduleBoardRails.vue.d.ts +17 -0
  91. package/dist/src/views/scheduling/components/ScheduleBoardToolbar.vue.d.ts +38 -0
  92. package/dist/src/views/scheduling/components/ScheduleBoardUtilityOverlays.vue.d.ts +22 -0
  93. package/dist/src/views/scheduling/components/ScheduleButton.vue.d.ts +23 -0
  94. package/dist/src/views/scheduling/components/ScheduleChangeEmployeeModal.vue.d.ts +8 -0
  95. package/dist/src/views/scheduling/components/ScheduleCloneOutletModal.vue.d.ts +6 -0
  96. package/dist/src/views/scheduling/components/ScheduleCoach.vue.d.ts +6 -0
  97. package/dist/src/views/scheduling/components/ScheduleCompletionDialog.vue.d.ts +15 -0
  98. package/dist/src/views/scheduling/components/ScheduleConfirmModal.vue.d.ts +33 -0
  99. package/dist/src/views/scheduling/components/ScheduleContextMenu.vue.d.ts +17 -0
  100. package/dist/src/views/scheduling/components/ScheduleCostRail.vue.d.ts +8 -0
  101. package/dist/src/views/scheduling/components/ScheduleCostRailEmptyArt.vue.d.ts +2 -0
  102. package/dist/src/views/scheduling/components/ScheduleDateRangePopover.vue.d.ts +6 -0
  103. package/dist/src/views/scheduling/components/ScheduleDayNotePopover.vue.d.ts +6 -0
  104. package/dist/src/views/scheduling/components/ScheduleDayTimeline.vue.d.ts +17 -0
  105. package/dist/src/views/scheduling/components/ScheduleDemandRow.vue.d.ts +23 -0
  106. package/dist/src/views/scheduling/components/ScheduleDemandSheet.vue.d.ts +10 -0
  107. package/dist/src/views/scheduling/components/ScheduleDotsIcon.vue.d.ts +2 -0
  108. package/dist/src/views/scheduling/components/ScheduleEmployeeDetailPanel.vue.d.ts +12 -0
  109. package/dist/src/views/scheduling/components/ScheduleEmployeeIdentity.vue.d.ts +17 -0
  110. package/dist/src/views/scheduling/components/ScheduleExportPreview.vue.d.ts +7 -0
  111. package/dist/src/views/scheduling/components/ScheduleFilterBar.vue.d.ts +18 -0
  112. package/dist/src/views/scheduling/components/ScheduleGapPopover.vue.d.ts +6 -0
  113. package/dist/src/views/scheduling/components/ScheduleGridHeader.vue.d.ts +18 -0
  114. package/dist/src/views/scheduling/components/ScheduleGridSkeleton.vue.d.ts +2 -0
  115. package/dist/src/views/scheduling/components/ScheduleLeaveEditModal.vue.d.ts +6 -0
  116. package/dist/src/views/scheduling/components/ScheduleLoadState.vue.d.ts +9 -0
  117. package/dist/src/views/scheduling/components/ScheduleModal.vue.d.ts +26 -0
  118. package/dist/src/views/scheduling/components/ScheduleOnboardingAssignPositionModal.vue.d.ts +6 -0
  119. package/dist/src/views/scheduling/components/ScheduleOnboardingClosedDayConfirm.vue.d.ts +6 -0
  120. package/dist/src/views/scheduling/components/ScheduleOnboardingDemandDays.vue.d.ts +6 -0
  121. package/dist/src/views/scheduling/components/ScheduleOnboardingDemandFooter.vue.d.ts +6 -0
  122. package/dist/src/views/scheduling/components/ScheduleOnboardingDemandHeader.vue.d.ts +6 -0
  123. package/dist/src/views/scheduling/components/ScheduleOnboardingDoneArt.vue.d.ts +2 -0
  124. package/dist/src/views/scheduling/components/ScheduleOnboardingHoursProfileNotice.vue.d.ts +10 -0
  125. package/dist/src/views/scheduling/components/ScheduleOnboardingPositions.vue.d.ts +6 -0
  126. package/dist/src/views/scheduling/components/ScheduleOnboardingReview.vue.d.ts +6 -0
  127. package/dist/src/views/scheduling/components/ScheduleOnboardingSettings.vue.d.ts +6 -0
  128. package/dist/src/views/scheduling/components/ScheduleOnboardingWelcome.vue.d.ts +11 -0
  129. package/dist/src/views/scheduling/components/ScheduleOnboardingWizard.vue.d.ts +9 -0
  130. package/dist/src/views/scheduling/components/ScheduleOnboardingWizardFooter.vue.d.ts +6 -0
  131. package/dist/src/views/scheduling/components/ScheduleOnboardingWizardHeader.vue.d.ts +11 -0
  132. package/dist/src/views/scheduling/components/SchedulePublishModal.vue.d.ts +8 -0
  133. package/dist/src/views/scheduling/components/SchedulePublishShareArt.vue.d.ts +2 -0
  134. package/dist/src/views/scheduling/components/ScheduleReviewBar.vue.d.ts +12 -0
  135. package/dist/src/views/scheduling/components/ScheduleSelect.vue.d.ts +70 -0
  136. package/dist/src/views/scheduling/components/ScheduleSelectExistingEmployeeModal.vue.d.ts +6 -0
  137. package/dist/src/views/scheduling/components/ScheduleSetupBanner.vue.d.ts +12 -0
  138. package/dist/src/views/scheduling/components/ScheduleShiftCell.vue.d.ts +35 -0
  139. package/dist/src/views/scheduling/components/ScheduleShiftHeadcountEditor.vue.d.ts +10 -0
  140. package/dist/src/views/scheduling/components/ScheduleShiftImpact.vue.d.ts +6 -0
  141. package/dist/src/views/scheduling/components/ScheduleShiftMoreOptions.vue.d.ts +8 -0
  142. package/dist/src/views/scheduling/components/ScheduleShiftPopover.vue.d.ts +16 -0
  143. package/dist/src/views/scheduling/components/ScheduleShiftRepeatDaysRow.vue.d.ts +8 -0
  144. package/dist/src/views/scheduling/components/ScheduleShiftSegmentsEditor.vue.d.ts +8 -0
  145. package/dist/src/views/scheduling/components/ScheduleShiftWhoPicker.vue.d.ts +25 -0
  146. package/dist/src/views/scheduling/components/ScheduleStaffRail.vue.d.ts +16 -0
  147. package/dist/src/views/scheduling/components/ScheduleStaffRows.vue.d.ts +50 -0
  148. package/dist/src/views/scheduling/components/ScheduleStatsRow.vue.d.ts +12 -0
  149. package/dist/src/views/scheduling/components/ScheduleSwapShiftsModal.vue.d.ts +8 -0
  150. package/dist/src/views/scheduling/components/ScheduleTimePickerPopover.vue.d.ts +6 -0
  151. package/dist/src/views/scheduling/components/ScheduleTopbar.vue.d.ts +20 -0
  152. package/dist/src/views/scheduling/composables/auto-schedule-mapping.d.ts +35 -0
  153. package/dist/src/views/scheduling/composables/onboarding-constants.d.ts +7 -0
  154. package/dist/src/views/scheduling/composables/onboarding-hours.d.ts +7 -0
  155. package/dist/src/views/scheduling/composables/onboarding-types.d.ts +51 -0
  156. package/dist/src/views/scheduling/composables/remyPrompt.d.ts +15 -0
  157. package/dist/src/views/scheduling/composables/schedule-add-employee-form.d.ts +82 -0
  158. package/dist/src/views/scheduling/composables/schedule-board-helpers.d.ts +63 -0
  159. package/dist/src/views/scheduling/composables/schedule-breaks.d.ts +9 -0
  160. package/dist/src/views/scheduling/composables/schedule-calendar.d.ts +17 -0
  161. package/dist/src/views/scheduling/composables/schedule-cost.d.ts +24 -0
  162. package/dist/src/views/scheduling/composables/schedule-currency.d.ts +22 -0
  163. package/dist/src/views/scheduling/composables/schedule-day-meta.d.ts +21 -0
  164. package/dist/src/views/scheduling/composables/schedule-demand-domain.d.ts +23 -0
  165. package/dist/src/views/scheduling/composables/schedule-employee-profile.d.ts +7 -0
  166. package/dist/src/views/scheduling/composables/schedule-error.d.ts +1 -0
  167. package/dist/src/views/scheduling/composables/schedule-export-matrix.d.ts +14 -0
  168. package/dist/src/views/scheduling/composables/schedule-leave-split.d.ts +9 -0
  169. package/dist/src/views/scheduling/composables/schedule-popover-position.d.ts +16 -0
  170. package/dist/src/views/scheduling/composables/schedule-quick-pick.d.ts +23 -0
  171. package/dist/src/views/scheduling/composables/schedule-shift-time.d.ts +29 -0
  172. package/dist/src/views/scheduling/composables/schedule-time.d.ts +8 -0
  173. package/dist/src/views/scheduling/composables/schedule-week-cache.d.ts +9 -0
  174. package/dist/src/views/scheduling/composables/useCollapsedList.d.ts +9 -0
  175. package/dist/src/views/scheduling/composables/useRemyAppStore.d.ts +16 -0
  176. package/dist/src/views/scheduling/composables/useScheduleAddEmployee.d.ts +137 -0
  177. package/dist/src/views/scheduling/composables/useScheduleAddPick.d.ts +75 -0
  178. package/dist/src/views/scheduling/composables/useScheduleAreaBoard.d.ts +50 -0
  179. package/dist/src/views/scheduling/composables/useScheduleAreaDragDrop.d.ts +11 -0
  180. package/dist/src/views/scheduling/composables/useScheduleAssignmentMutations.d.ts +13 -0
  181. package/dist/src/views/scheduling/composables/useScheduleAutoSchedule.d.ts +301 -0
  182. package/dist/src/views/scheduling/composables/useScheduleBoard.d.ts +615 -0
  183. package/dist/src/views/scheduling/composables/useScheduleCellState.d.ts +27 -0
  184. package/dist/src/views/scheduling/composables/useScheduleClashDetection.d.ts +28 -0
  185. package/dist/src/views/scheduling/composables/useScheduleCloneOutletModal.d.ts +21 -0
  186. package/dist/src/views/scheduling/composables/useScheduleCoach.d.ts +80 -0
  187. package/dist/src/views/scheduling/composables/useScheduleCopyWeek.d.ts +12 -0
  188. package/dist/src/views/scheduling/composables/useScheduleCostRail.d.ts +60 -0
  189. package/dist/src/views/scheduling/composables/useScheduleDayNote.d.ts +44 -0
  190. package/dist/src/views/scheduling/composables/useScheduleDayTimeline.d.ts +111 -0
  191. package/dist/src/views/scheduling/composables/useScheduleDemand.d.ts +59 -0
  192. package/dist/src/views/scheduling/composables/useScheduleDemandRow.d.ts +47 -0
  193. package/dist/src/views/scheduling/composables/useScheduleDemandSheet.d.ts +166 -0
  194. package/dist/src/views/scheduling/composables/useScheduleDragDrop.d.ts +55 -0
  195. package/dist/src/views/scheduling/composables/useScheduleEmployeeAccess.d.ts +24 -0
  196. package/dist/src/views/scheduling/composables/useScheduleEmployeeAvailability.d.ts +13 -0
  197. package/dist/src/views/scheduling/composables/useScheduleEmployeeCandidates.d.ts +49 -0
  198. package/dist/src/views/scheduling/composables/useScheduleEmployeeCompensation.d.ts +7 -0
  199. package/dist/src/views/scheduling/composables/useScheduleEmployeeForm.d.ts +22 -0
  200. package/dist/src/views/scheduling/composables/useScheduleEmployeeIdentity.d.ts +50 -0
  201. package/dist/src/views/scheduling/composables/useScheduleEmployeeMenu.d.ts +38 -0
  202. package/dist/src/views/scheduling/composables/useScheduleEmployeePersistence.d.ts +32 -0
  203. package/dist/src/views/scheduling/composables/useScheduleEmployeeProfile.d.ts +16 -0
  204. package/dist/src/views/scheduling/composables/useScheduleEmployeeValidation.d.ts +18 -0
  205. package/dist/src/views/scheduling/composables/useScheduleExport.d.ts +52 -0
  206. package/dist/src/views/scheduling/composables/useScheduleFilterBar.d.ts +14 -0
  207. package/dist/src/views/scheduling/composables/useScheduleGapPopover.d.ts +79 -0
  208. package/dist/src/views/scheduling/composables/useScheduleLeave.d.ts +60 -0
  209. package/dist/src/views/scheduling/composables/useScheduleLegend.d.ts +15 -0
  210. package/dist/src/views/scheduling/composables/useScheduleOnboardingAvailability.d.ts +58 -0
  211. package/dist/src/views/scheduling/composables/useScheduleOnboardingDemand.d.ts +45 -0
  212. package/dist/src/views/scheduling/composables/useScheduleOnboardingEmployees.d.ts +231 -0
  213. package/dist/src/views/scheduling/composables/useScheduleOnboardingFlow.d.ts +9 -0
  214. package/dist/src/views/scheduling/composables/useScheduleOnboardingHours.d.ts +15 -0
  215. package/dist/src/views/scheduling/composables/useScheduleOnboardingNavigation.d.ts +11 -0
  216. package/dist/src/views/scheduling/composables/useScheduleOnboardingPersistence.d.ts +13 -0
  217. package/dist/src/views/scheduling/composables/useScheduleOnboardingWizard.d.ts +1543 -0
  218. package/dist/src/views/scheduling/composables/useScheduleOutlet.d.ts +25 -0
  219. package/dist/src/views/scheduling/composables/useSchedulePageActions.d.ts +18 -0
  220. package/dist/src/views/scheduling/composables/useSchedulePageBootstrap.d.ts +9 -0
  221. package/dist/src/views/scheduling/composables/useSchedulePageCellActions.d.ts +21 -0
  222. package/dist/src/views/scheduling/composables/useSchedulePageCellDrop.d.ts +20 -0
  223. package/dist/src/views/scheduling/composables/useSchedulePageClearActions.d.ts +33 -0
  224. package/dist/src/views/scheduling/composables/useSchedulePageEmployeeActions.d.ts +22 -0
  225. package/dist/src/views/scheduling/composables/useSchedulePageOverlays.d.ts +21 -0
  226. package/dist/src/views/scheduling/composables/useSchedulePdfExport.d.ts +19 -0
  227. package/dist/src/views/scheduling/composables/useSchedulePositionModal.d.ts +55 -0
  228. package/dist/src/views/scheduling/composables/useSchedulePositions.d.ts +35 -0
  229. package/dist/src/views/scheduling/composables/useSchedulePublish.d.ts +127 -0
  230. package/dist/src/views/scheduling/composables/useSchedulePublishPersistence.d.ts +11 -0
  231. package/dist/src/views/scheduling/composables/useScheduleRangeCalendar.d.ts +27 -0
  232. package/dist/src/views/scheduling/composables/useScheduleRoster.d.ts +313 -0
  233. package/dist/src/views/scheduling/composables/useScheduleSettings.d.ts +40 -0
  234. package/dist/src/views/scheduling/composables/useScheduleSetupBanner.d.ts +17 -0
  235. package/dist/src/views/scheduling/composables/useScheduleShiftActions.d.ts +245 -0
  236. package/dist/src/views/scheduling/composables/useScheduleShiftDraft.d.ts +63 -0
  237. package/dist/src/views/scheduling/composables/useScheduleShiftPersistence.d.ts +17 -0
  238. package/dist/src/views/scheduling/composables/useScheduleShiftPopover.d.ts +255 -0
  239. package/dist/src/views/scheduling/composables/useScheduleStatsRow.d.ts +27 -0
  240. package/dist/src/views/scheduling/composables/useScheduleTimePicker.d.ts +49 -0
  241. package/dist/src/views/scheduling/composables/useScheduleTour.d.ts +95 -0
  242. package/dist/src/views/scheduling/composables/useScheduleViewportFit.d.ts +9 -0
  243. package/dist/src/views/scheduling/country-rules/index.d.ts +33 -0
  244. package/dist/src/views/scheduling/data.d.ts +123 -0
  245. package/dist/src/views/scheduling/locales/index.d.ts +6988 -0
  246. package/dist/src/views/scheduling/schedule-constants.d.ts +7 -0
  247. package/dist/src/views/scheduling/schedule-state.d.ts +767 -0
  248. package/dist/src/views/scheduling/schedule-store.d.ts +140 -0
  249. package/dist/src/views/scheduling/types.d.ts +381 -0
  250. package/dist/src/views/team/components/BasePermission.vue.d.ts +0 -11
  251. package/dist/src/views/team/components/ConditionPermission.vue.d.ts +0 -11
  252. package/dist/src/views/team/components/PortalConditionForm.vue.d.ts +2 -2
  253. package/dist/src/views/team/components/PortalPermissionEditor.vue.d.ts +0 -21
  254. package/dist/src/views/team/components/PosRolePermission.vue.d.ts +0 -11
  255. package/dist/src/views/team/condition-builders/ConditionBuilderForm.vue.d.ts +2 -2
  256. package/dist/src/views/team/locales/index.d.ts +0 -716
  257. package/dist/src/views/team/member/AddMemberForm.vue.d.ts +3 -48
  258. package/dist/src/views/team/{components/MemberStatusBadge.vue.d.ts → member/MemberInfo.vue.d.ts} +2 -2
  259. package/dist/src/views/team/member/TeamMemberList.vue.d.ts +0 -1
  260. package/dist/string-VNuQNweN.js +15 -0
  261. package/dist/style.css +1 -1
  262. package/dist/tsconfig.app.tsbuildinfo +1 -1
  263. package/dist/{useAppStore-BABlZnfR.js → useAppStore-TRX-PQD4.js} +1 -1
  264. package/dist/useDiscardConfirm-CzZSPyvh.js +28 -0
  265. package/dist/{useLoading-B47q5dVg.js → useLoading-W3YSF8OB.js} +1 -1
  266. package/dist/useMessage-_ywT_N9X.js +17 -0
  267. package/dist/{useReportPermissions-D-nbQAm5.js → useReportPermissions-DmMlLiQP.js} +5 -5
  268. package/package.json +7 -5
  269. package/dist/AuditLogList-Fby1fcGU.js +0 -1777
  270. package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-B1uS6T3r.js +0 -459
  271. package/dist/EmployeeList-DY2Y-FtT.js +0 -907
  272. package/dist/FormSection.vue_vue_type_script_setup_true_lang-BDGewUFD.js +0 -90
  273. package/dist/Main-BuJe2QNl.js +0 -101
  274. package/dist/MyPosProfile-Rc2ZTeQR.js +0 -301
  275. package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-TXPEqa46.js +0 -126
  276. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-BRrhFF3y.js +0 -4243
  277. package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-CD3d4RX6.js +0 -1840
  278. package/dist/RoleForm.vue_vue_type_script_setup_true_lang-DS4eMJ6w.js +0 -547
  279. package/dist/RoleList-CrLxn4_K.js +0 -274
  280. package/dist/SelectFilter-ATOm0hdn.js +0 -269
  281. package/dist/TeamMemberList-D32ZtSLP.js +0 -2060
  282. package/dist/member-grant-CQHFGo-k.js +0 -55
  283. package/dist/restaurant-dbllb9m8.js +0 -45
  284. package/dist/src/api/my-pos-profile/index.d.ts +0 -5
  285. package/dist/src/api/staff-invite/index.d.ts +0 -17
  286. package/dist/src/components/form/SegmentedTabs.vue.d.ts +0 -23
  287. package/dist/src/composables/useMenuAccess.d.ts +0 -56
  288. package/dist/src/composables/useStaffInviteProviders.d.ts +0 -19
  289. package/dist/src/helpers/member-grant.d.ts +0 -36
  290. package/dist/src/helpers/my-pos-profile.d.ts +0 -37
  291. package/dist/src/helpers/pos-assignment-rows.d.ts +0 -28
  292. package/dist/src/helpers/staff-invite.d.ts +0 -51
  293. package/dist/src/router/menu-access-guard.d.ts +0 -17
  294. package/dist/src/types/my-pos-profile.d.ts +0 -25
  295. package/dist/src/types/staff-invite.d.ts +0 -100
  296. package/dist/src/views/my-pos-profile/components/PasscodeChangedDialog.vue.d.ts +0 -4
  297. package/dist/src/views/my-pos-profile/locales/index.d.ts +0 -200
  298. package/dist/src/views/team/components/MemberGrantFields.vue.d.ts +0 -51
  299. package/dist/src/views/team/components/PosAssignmentRows.vue.d.ts +0 -44
  300. package/dist/src/views/team/member/MemberDetailsCard.vue.d.ts +0 -35
  301. package/dist/src/views/team/member/MemberHeaderCard.vue.d.ts +0 -19
  302. package/dist/string-DZQ1uNjn.js +0 -22
  303. package/dist/useDiscardConfirm-DPhEV6v0.js +0 -157
  304. /package/dist/src/{views/my-pos-profile/MyPosProfile.vue.d.ts → components/layout/SchedulePromoBanner.vue.d.ts} +0 -0
@@ -0,0 +1,2031 @@
1
+ import { defineComponent as Vt, ref as w, computed as A, onMounted as Uo, onBeforeUnmount as Ko, watch as oe, resolveComponent as N, createElementBlock as v, openBlock as f, createBlock as Ce, createCommentVNode as M, createElementVNode as a, Fragment as z, renderList as ce, withCtx as Y, createVNode as h, toDisplayString as l, unref as u, nextTick as Bo, onUnmounted as Yo, createTextVNode as ye, normalizeClass as zo } from "vue";
2
+ import { d as T } from "./dayjs.min-NoTESZyy.js";
3
+ import { defineStore as qo, storeToRefs as Jo } from "pinia";
4
+ import { useI18n as dt, useCoreStore as Ho } from "@feedmepos/mf-common";
5
+ import { B as Mt, _ as Wo, a as Go } from "./app-Cfzysb_Z.js";
6
+ import { components as ve } from "@feedmepos/ui-library";
7
+ import { g as st, b as at, u as Xo } from "./restaurant-DJBQY9N5.js";
8
+ import { S as Fe } from "./SelectFilter-BbTj7kMh.js";
9
+ import { _ as Qo } from "./PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js";
10
+ import { _ as Zo } from "./TableEmptyState.vue_vue_type_script_setup_true_lang-IfAZmWr0.js";
11
+ import { t as es, p as Dt } from "./rule-B1ck-XG6.js";
12
+ import { u as ts } from "./useDebounce-B8ZPVS5C.js";
13
+ import { n as os } from "./string-VNuQNweN.js";
14
+ import { useRoute as ss, useRouter as as } from "vue-router";
15
+ import { u as ns } from "./useMessage-_ywT_N9X.js";
16
+ const ls = {
17
+ order: "Order",
18
+ refund: "Refund",
19
+ drawer: "Cash drawer",
20
+ menu: "Menu",
21
+ inventory: "Inventory",
22
+ deposit: "Deposit",
23
+ delivery: "Delivery",
24
+ counterRecord: "Counter",
25
+ counter: "Counter",
26
+ setting: "Settings",
27
+ display: "Display",
28
+ printer: "Printer",
29
+ table: "Table",
30
+ employee: "Employee",
31
+ system: "System",
32
+ tax: "Tax",
33
+ paymentType: "Payment type",
34
+ faceId: "Face ID",
35
+ mallIntegration: "Mall integration",
36
+ report: "Report"
37
+ }, Me = [
38
+ { key: "all", label: "All", subjectPrefixes: [] },
39
+ { key: "inventory", label: "Inventory", subjectPrefixes: ["business::inventory", "inventory"], sources: ["portal"] },
40
+ { key: "report", label: "Report", subjectPrefixes: ["business::report", "report"], sources: ["portal"] },
41
+ { key: "hrm", label: "HRM", subjectPrefixes: ["business::hrm", "hrm"], sources: ["portal"] },
42
+ { key: "payment", label: "Payment", subjectPrefixes: ["business::payment", "payment"], sources: ["portal"] },
43
+ { key: "menu", label: "Menu", subjectPrefixes: ["business::menu", "menu"], sources: ["portal"] },
44
+ { key: "crm", label: "CRM", subjectPrefixes: ["business::crm", "crm"], sources: ["portal"] },
45
+ { key: "operation", label: "Operation", subjectPrefixes: ["business::operation", "operation"], sources: ["portal"] },
46
+ // Settings spans the mdm, kiosk and eInvoice namespaces (PermissionCategory.settings).
47
+ { key: "settings", label: "Settings", subjectPrefixes: ["business::mdm", "business::kiosk", "business::eInvoice", "mdm", "kiosk", "eInvoice"], sources: ["portal"] },
48
+ { key: "miniProgram", label: "Mini Program", subjectPrefixes: ["business::miniProgram", "miniProgram"], sources: ["portal"] },
49
+ { key: "media", label: "Media", subjectPrefixes: ["business::media", "media"], sources: ["portal"] },
50
+ { key: "pos", label: "POS", subjectPrefixes: [], sources: ["pos-v8", "hrm-validate"] }
51
+ ], nt = "/audit-logs", Oe = {
52
+ async count(t) {
53
+ var r, d, y, _, g, S, O, i, P;
54
+ const o = {
55
+ ...t != null && t.from ? { from: t.from } : {},
56
+ ...t != null && t.to ? { to: t.to } : {},
57
+ ...(r = t == null ? void 0 : t.userIds) != null && r.length ? { userIds: t.userIds } : {},
58
+ ...(d = t == null ? void 0 : t.subjects) != null && d.length ? { subjects: t.subjects } : {},
59
+ ...(y = t == null ? void 0 : t.subjectPrefixes) != null && y.length ? { subjectPrefixes: t.subjectPrefixes } : {},
60
+ ...(_ = t == null ? void 0 : t.actions) != null && _.length ? { actions: t.actions } : {},
61
+ ...(g = t == null ? void 0 : t.outcomes) != null && g.length ? { outcomes: t.outcomes } : {},
62
+ ...t != null && t.feedmeAdminActors ? { feedmeAdminActors: !0 } : {},
63
+ ...t != null && t.search ? { search: t.search } : {},
64
+ ...(S = t == null ? void 0 : t.searchUserIds) != null && S.length ? { searchUserIds: t.searchUserIds } : {},
65
+ ...(O = t == null ? void 0 : t.searchSubjects) != null && O.length ? { searchSubjects: t.searchSubjects } : {},
66
+ ...(i = t == null ? void 0 : t.sources) != null && i.length ? { sources: t.sources } : {},
67
+ ...(P = t == null ? void 0 : t.restaurantIds) != null && P.length ? { restaurantIds: t.restaurantIds } : {},
68
+ ...t != null && t.traceId ? { traceId: t.traceId } : {}
69
+ };
70
+ return (await st(
71
+ await at().get(`${nt}/count`, {
72
+ params: o,
73
+ paramsSerializer: ($) => {
74
+ const m = new URLSearchParams();
75
+ for (const [x, D] of Object.entries($))
76
+ if (Array.isArray(D))
77
+ for (const F of D) m.append(x, String(F));
78
+ else D != null && m.append(x, String(D));
79
+ return m.toString();
80
+ }
81
+ })
82
+ )).total;
83
+ },
84
+ async read(t) {
85
+ var n, r, d, y, _, g, S, O, i;
86
+ const o = {
87
+ limit: (t == null ? void 0 : t.limit) ?? 100,
88
+ offset: (t == null ? void 0 : t.offset) ?? 0,
89
+ ...t != null && t.from ? { from: t.from } : {},
90
+ ...t != null && t.to ? { to: t.to } : {},
91
+ ...(n = t == null ? void 0 : t.userIds) != null && n.length ? { userIds: t.userIds } : {},
92
+ ...t != null && t.feedmeAdminActors ? { feedmeAdminActors: !0 } : {},
93
+ ...(r = t == null ? void 0 : t.subjects) != null && r.length ? { subjects: t.subjects } : {},
94
+ ...(d = t == null ? void 0 : t.subjectPrefixes) != null && d.length ? { subjectPrefixes: t.subjectPrefixes } : {},
95
+ ...(y = t == null ? void 0 : t.actions) != null && y.length ? { actions: t.actions } : {},
96
+ ...(_ = t == null ? void 0 : t.outcomes) != null && _.length ? { outcomes: t.outcomes } : {},
97
+ ...t != null && t.search ? { search: t.search } : {},
98
+ ...(g = t == null ? void 0 : t.searchUserIds) != null && g.length ? { searchUserIds: t.searchUserIds } : {},
99
+ ...(S = t == null ? void 0 : t.searchSubjects) != null && S.length ? { searchSubjects: t.searchSubjects } : {},
100
+ ...(O = t == null ? void 0 : t.sources) != null && O.length ? { sources: t.sources } : {},
101
+ ...(i = t == null ? void 0 : t.restaurantIds) != null && i.length ? { restaurantIds: t.restaurantIds } : {},
102
+ ...t != null && t.traceId ? { traceId: t.traceId } : {}
103
+ };
104
+ return st(
105
+ await at().get(nt, {
106
+ params: o,
107
+ // Serialize arrays as repeated params: key=val1&key=val2
108
+ // (NestJS @Query expects this; axios default adds brackets which break matching)
109
+ paramsSerializer: (P) => {
110
+ const $ = new URLSearchParams();
111
+ for (const [m, x] of Object.entries(P))
112
+ if (Array.isArray(x))
113
+ for (const D of x) $.append(m, String(D));
114
+ else x != null && $.append(m, String(x));
115
+ return $.toString();
116
+ }
117
+ })
118
+ );
119
+ },
120
+ /**
121
+ * FeedMe-admin options for the User filter. `actors` is the named admin list (internal
122
+ * viewers only; empty for merchants). `showFeedmeAdminFilter` indicates whether to offer
123
+ * the "FeedMe Admin" catch-all (only when the business has relevant admin activity).
124
+ */
125
+ async getFeedmeAdminFilter(t) {
126
+ const o = {
127
+ ...t != null && t.from ? { from: t.from } : {},
128
+ ...t != null && t.to ? { to: t.to } : {}
129
+ };
130
+ return st(
131
+ await at().get(`${nt}/actors`, { params: o })
132
+ );
133
+ }
134
+ }, rs = { class: "flex h-[46px] items-center gap-8 rounded-sm px-16 hover:bg-fm-color-opacity-sm" }, is = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, us = {
135
+ "data-more-measure": "",
136
+ class: "flex h-[46px] items-center gap-8 rounded-sm px-16"
137
+ }, ds = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, cs = /* @__PURE__ */ Vt({
138
+ __name: "AuditLogModuleTabs",
139
+ props: {
140
+ modelValue: {},
141
+ items: {}
142
+ },
143
+ emits: ["update:modelValue"],
144
+ setup(t, { emit: o }) {
145
+ const n = t, r = o, { t: d } = dt(), y = w(!1), _ = w(null), g = w(null), S = w([]), O = w(0), i = w(0);
146
+ let P = null;
147
+ async function $() {
148
+ if (await Bo(), !g.value) return;
149
+ const b = g.value.querySelectorAll("[data-tab-measure]");
150
+ S.value = Array.from(b).map((B) => B.offsetWidth);
151
+ const j = g.value.querySelector("[data-more-measure]");
152
+ O.value = (j == null ? void 0 : j.offsetWidth) ?? 0;
153
+ }
154
+ const m = A(() => {
155
+ const b = n.items.length;
156
+ if (b === 0) return 0;
157
+ if (!i.value || S.value.length !== b) return b;
158
+ const j = S.value;
159
+ if (j.reduce((I, X) => I + X, 0) <= i.value) return b;
160
+ const E = O.value;
161
+ let H = 0, U = 0;
162
+ for (let I = 0; I < b && !(H + j[I] + E > i.value); I++)
163
+ H += j[I], U++;
164
+ return U;
165
+ }), x = A(() => {
166
+ const b = m.value, j = n.items.length;
167
+ if (b >= j) return [...n.items];
168
+ const B = n.items.slice(0, b), E = n.items.find((W) => W.value === n.modelValue);
169
+ if (!E || B.some((W) => W.value === E.value)) return B;
170
+ if (b === 0) return [E];
171
+ const H = n.items.findIndex((W) => W.value === E.value), U = S.value, I = O.value, X = U[H] ?? 0;
172
+ let ue = b, Te = U.slice(0, ue - 1).reduce((W, xe) => W + xe, 0);
173
+ for (; ue > 1 && Te + X + I > i.value; )
174
+ ue--, Te = U.slice(0, ue - 1).reduce((W, xe) => W + xe, 0);
175
+ return [...n.items.slice(0, Math.max(ue - 1, 0)), E];
176
+ }), D = A(() => {
177
+ const b = new Set(x.value.map((j) => j.value));
178
+ return n.items.filter((j) => !b.has(j.value));
179
+ });
180
+ function F(b) {
181
+ y.value = !1, r("update:modelValue", b);
182
+ }
183
+ return Uo(async () => {
184
+ await $(), _.value && (i.value = _.value.clientWidth, P = new ResizeObserver(() => {
185
+ _.value && (i.value = _.value.clientWidth);
186
+ }), P.observe(_.value));
187
+ }), Ko(() => {
188
+ P == null || P.disconnect(), P = null;
189
+ }), oe(
190
+ () => n.items,
191
+ () => {
192
+ $();
193
+ },
194
+ { deep: !0 }
195
+ ), (b, j) => {
196
+ const B = N("FmTab"), E = N("FmIcon"), H = N("FmMenuItem"), U = N("FmMenu");
197
+ return f(), v("div", {
198
+ ref_key: "containerRef",
199
+ ref: _,
200
+ class: "relative flex w-full flex-row items-center"
201
+ }, [
202
+ (f(!0), v(z, null, ce(x.value, (I) => (f(), Ce(B, {
203
+ key: I.value,
204
+ "model-value": t.modelValue,
205
+ label: I.label,
206
+ badge: I.badge,
207
+ disabled: I.disabled,
208
+ value: I.value,
209
+ "onUpdate:modelValue": F
210
+ }, null, 8, ["model-value", "label", "badge", "disabled", "value"]))), 128)),
211
+ D.value.length > 0 ? (f(), Ce(U, {
212
+ key: 0,
213
+ "show-menu": y.value,
214
+ class: "max-w-[360px] min-w-[90px] rounded-sm",
215
+ placement: "bottom-start",
216
+ onMenuChanged: j[0] || (j[0] = (I) => y.value = I)
217
+ }, {
218
+ "menu-button": Y(() => [
219
+ a("div", rs, [
220
+ h(E, { name: "more_vert" }),
221
+ a("span", is, l(u(d)("auditLog.modules.more")), 1)
222
+ ])
223
+ ]),
224
+ default: Y(() => [
225
+ (f(!0), v(z, null, ce(D.value, (I) => (f(), Ce(H, {
226
+ key: I.value,
227
+ "model-value": t.modelValue === I.value,
228
+ label: I.label,
229
+ disabled: I.disabled,
230
+ onClick: (X) => F(I.value)
231
+ }, null, 8, ["model-value", "label", "disabled", "onClick"]))), 128))
232
+ ]),
233
+ _: 1
234
+ }, 8, ["show-menu"])) : M("", !0),
235
+ a("div", {
236
+ ref_key: "measurerRef",
237
+ ref: g,
238
+ "aria-hidden": "true",
239
+ class: "pointer-events-none invisible absolute -left-[9999px] -top-[9999px] flex flex-row items-center"
240
+ }, [
241
+ (f(!0), v(z, null, ce(t.items, (I) => (f(), v("div", {
242
+ key: `measure-${I.value}`,
243
+ "data-tab-measure": ""
244
+ }, [
245
+ h(B, {
246
+ "model-value": t.modelValue,
247
+ label: I.label,
248
+ badge: I.badge,
249
+ disabled: I.disabled,
250
+ value: I.value
251
+ }, null, 8, ["model-value", "label", "badge", "disabled", "value"])
252
+ ]))), 128)),
253
+ a("div", us, [
254
+ h(E, { name: "more_vert" }),
255
+ a("span", ds, l(u(d)("auditLog.modules.more")), 1)
256
+ ])
257
+ ], 512)
258
+ ], 512);
259
+ };
260
+ }
261
+ }), fs = qo("hrm-team", () => {
262
+ const t = w([]), o = w(!1), n = w(!1), r = A(
263
+ () => Object.fromEntries(t.value.map((g) => [g.doc.userId, g.name]))
264
+ ), d = A(
265
+ () => Object.fromEntries(t.value.map((g) => [g.doc.userId, g.email]))
266
+ ), y = A(
267
+ () => Object.fromEntries(t.value.map((g) => [g.doc.userId, g.phoneNumber]))
268
+ );
269
+ async function _({ force: g = !1 } = {}) {
270
+ if (!(!g && t.value.length > 0))
271
+ try {
272
+ o.value = !0;
273
+ const S = await es.readTeamMembers();
274
+ t.value = S.sort((O, i) => O.doc.isOwner ? -1 : O.name.localeCompare(i.name)), n.value = !0;
275
+ } finally {
276
+ o.value = !1;
277
+ }
278
+ }
279
+ return {
280
+ members: t,
281
+ isLoading: o,
282
+ hasLoaded: n,
283
+ userIdToName: r,
284
+ userIdToEmail: d,
285
+ userIdToPhone: y,
286
+ readTeamMembers: _
287
+ };
288
+ });
289
+ function ms(t) {
290
+ const o = t.indexOf(".");
291
+ return o <= 0 || o === t.length - 1 ? null : { entity: t.slice(0, o), verb: t.slice(o + 1) };
292
+ }
293
+ function Ot(t) {
294
+ const o = t.split("-").join(" ");
295
+ return o.charAt(0).toUpperCase() + o.slice(1);
296
+ }
297
+ function vs(t, o, n) {
298
+ const r = t(o, n);
299
+ return r === o ? null : r;
300
+ }
301
+ function ut(t, o) {
302
+ const { eventKey: n, params: r, operationLabel: d } = o;
303
+ if (n) {
304
+ const y = vs(t, `auditLog.event.sentence.${n}`, r);
305
+ if (y) return y;
306
+ const _ = ms(n);
307
+ if (_) {
308
+ const g = `${Ot(_.verb)} ${Ot(_.entity)}`, S = (r == null ? void 0 : r.label) ?? (r == null ? void 0 : r.name);
309
+ return S !== void 0 && S !== "" ? `${g} — ${S}` : g;
310
+ }
311
+ }
312
+ return d ?? "";
313
+ }
314
+ function ps({ logs: t, selectedLog: o, isSheetOpen: n, businessId: r }) {
315
+ const d = ss(), y = as(), { t: _ } = dt(), g = ns();
316
+ let S = 0;
317
+ function O(x) {
318
+ const { traceId: D, ...F } = d.query;
319
+ (D ?? void 0) !== x && y.replace({ query: x ? { ...F, traceId: x } : F });
320
+ }
321
+ function i(x) {
322
+ O(x.traceId || void 0);
323
+ }
324
+ function P() {
325
+ S++, O(void 0);
326
+ }
327
+ async function $(x) {
328
+ var b;
329
+ if (((b = o.value) == null ? void 0 : b.traceId) === x) return;
330
+ const D = ++S;
331
+ let F = t.value.find((j) => j.traceId === x);
332
+ if (!F) {
333
+ try {
334
+ [F] = await Oe.read({ traceId: x, limit: 1 });
335
+ } catch {
336
+ D === S && g.error(_("auditLog.deepLink.loadFailed"));
337
+ return;
338
+ }
339
+ if (D !== S) return;
340
+ }
341
+ if (!F) {
342
+ g.error(_("auditLog.deepLink.notFound")), O(void 0);
343
+ return;
344
+ }
345
+ o.value = F, n.value = !0;
346
+ }
347
+ oe(
348
+ () => [d.query.traceId, r()],
349
+ ([x, D], F) => {
350
+ var b;
351
+ if (F != null && F[1] && D !== F[1]) {
352
+ S++, n.value = !1, o.value = null, O(void 0);
353
+ return;
354
+ }
355
+ typeof x == "string" && x ? D && $(x) : (S++, (b = o.value) != null && b.traceId && n.value && (n.value = !1, o.value = null));
356
+ },
357
+ { immediate: !0 }
358
+ );
359
+ async function m() {
360
+ try {
361
+ await navigator.clipboard.writeText(window.location.href), g.success(_("auditLog.detail.linkCopied"));
362
+ } catch {
363
+ g.error(_("auditLog.detail.linkCopyFailed"));
364
+ }
365
+ }
366
+ return { onSheetOpened: i, onSheetClosed: P, copyLink: m };
367
+ }
368
+ function _e(t) {
369
+ return typeof t == "object" && t !== null && !Array.isArray(t);
370
+ }
371
+ function je(t) {
372
+ return Array.isArray(t);
373
+ }
374
+ function Be(t) {
375
+ if (t === null) return "null";
376
+ if (typeof t == "object")
377
+ try {
378
+ return JSON.stringify(t);
379
+ } catch {
380
+ return String(t);
381
+ }
382
+ return String(t);
383
+ }
384
+ function gs(t, o) {
385
+ return t ? `${t}.${o}` : o;
386
+ }
387
+ function Ct(t) {
388
+ if (typeof t != "string") return { ok: !1, value: void 0 };
389
+ const o = t.trim();
390
+ if (!o.startsWith("{") && !o.startsWith("[")) return { ok: !1, value: void 0 };
391
+ try {
392
+ const n = JSON.parse(o);
393
+ return _e(n) || je(n) ? { ok: !0, value: n } : { ok: !1, value: void 0 };
394
+ } catch {
395
+ return { ok: !1, value: void 0 };
396
+ }
397
+ }
398
+ const hs = ["_id", "id", "subject", "key", "name"];
399
+ function ys(t, o) {
400
+ if (t.length === 0 || o.length === 0) return null;
401
+ const n = (d, y) => d.every((_) => _e(_) && _[y] !== void 0), r = (d, y) => {
402
+ const _ = d.map((g) => g[y]);
403
+ return _.length === new Set(_).size;
404
+ };
405
+ for (const d of hs)
406
+ if (n(t, d) && n(o, d) && r(t, d) && r(o, d))
407
+ return d;
408
+ return null;
409
+ }
410
+ function $t(t, o, n) {
411
+ n.push({ path: t, type: "added", before: null, after: Be(o) });
412
+ }
413
+ function Et(t, o, n) {
414
+ n.push({ path: t, type: "removed", before: Be(o), after: null });
415
+ }
416
+ function bs(t, o, n, r) {
417
+ const d = /* @__PURE__ */ new Set([...Object.keys(o), ...Object.keys(n)]);
418
+ for (const y of Array.from(d)) {
419
+ const _ = Object.prototype.hasOwnProperty.call(o, y), g = Object.prototype.hasOwnProperty.call(n, y);
420
+ Ye(gs(t, y), o[y], _, n[y], g, r);
421
+ }
422
+ }
423
+ function _s(t, o, n, r) {
424
+ const d = ys(o, n);
425
+ if (d) {
426
+ const m = new Map(
427
+ o.map((b) => [b[d], b])
428
+ ), x = new Map(
429
+ n.map((b) => [b[d], b])
430
+ ), D = Array.from(m.keys()).concat(Array.from(x.keys())), F = Array.from(new Set(D));
431
+ for (const b of F) {
432
+ const j = m.has(b), B = x.has(b), E = `${t}[${String(b)}]`;
433
+ Ye(
434
+ E,
435
+ m.get(b),
436
+ j,
437
+ x.get(b),
438
+ B,
439
+ r
440
+ );
441
+ }
442
+ return;
443
+ }
444
+ const y = o.map((m, x) => ({ sig: JSON.stringify(m), idx: x, item: m })), _ = n.map((m, x) => ({ sig: JSON.stringify(m), idx: x, item: m })), g = /* @__PURE__ */ new Map(), S = /* @__PURE__ */ new Map();
445
+ for (const m of y)
446
+ g.has(m.sig) || g.set(m.sig, []), g.get(m.sig).push(m);
447
+ for (const m of _)
448
+ S.has(m.sig) || S.set(m.sig, []), S.get(m.sig).push(m);
449
+ const O = [], i = [], P = Array.from(g.keys()).concat(Array.from(S.keys())), $ = Array.from(new Set(P));
450
+ for (const m of $) {
451
+ const x = g.get(m) || [], D = S.get(m) || [], F = Math.min(x.length, D.length);
452
+ for (let b = F; b < x.length; b++)
453
+ O.push({ idx: x[b].idx, item: x[b].item });
454
+ for (let b = F; b < D.length; b++)
455
+ i.push({ idx: D[b].idx, item: D[b].item });
456
+ }
457
+ for (const { idx: m, item: x } of O)
458
+ Et(`${t}[${m}]`, x, r);
459
+ for (const { idx: m, item: x } of i)
460
+ $t(`${t}[${m}]`, x, r);
461
+ }
462
+ function Ye(t, o, n, r, d, y) {
463
+ if (!n && !d) return;
464
+ if (n && !d) {
465
+ Et(t, o, y);
466
+ return;
467
+ }
468
+ if (!n && d) {
469
+ $t(t, r, y);
470
+ return;
471
+ }
472
+ if (JSON.stringify(o) === JSON.stringify(r)) return;
473
+ if (_e(o) && _e(r)) {
474
+ bs(t, o, r, y);
475
+ return;
476
+ }
477
+ if (je(o) && je(r)) {
478
+ _s(t, o, r, y);
479
+ return;
480
+ }
481
+ const _ = Ct(o), g = Ct(r);
482
+ if (_.ok && g.ok) {
483
+ Ye(t, _.value, !0, g.value, !0, y);
484
+ return;
485
+ }
486
+ y.push({
487
+ path: t,
488
+ type: "changed",
489
+ before: Be(o),
490
+ after: Be(r)
491
+ });
492
+ }
493
+ function xs(t, o) {
494
+ if (JSON.stringify(t) === JSON.stringify(o)) return [];
495
+ const n = t == null, r = o == null;
496
+ let d = t;
497
+ n && (_e(o) ? d = {} : je(o) && (d = []));
498
+ let y = o;
499
+ r && (_e(t) ? y = {} : je(t) && (y = []));
500
+ const _ = [];
501
+ return Ye("", d, !0, y, !0, _), _;
502
+ }
503
+ function jt(t) {
504
+ const o = t.operations;
505
+ return !o || o.length === 0 ? !1 : o.some((n) => n.status === "failed");
506
+ }
507
+ function lt(t, o) {
508
+ var d, y;
509
+ if (t.source === "hrm-validate") return o("auditLog.pos.device.posV7");
510
+ const n = (y = (d = t.metadata) == null ? void 0 : d.pos) == null ? void 0 : y.posMode, r = t.deviceId || "-";
511
+ return n ? `${r} · ${o(`auditLog.pos.mode.${n}`)}` : r;
512
+ }
513
+ function Ls(t, o) {
514
+ var r;
515
+ const n = t.actorName || t.userId || "-";
516
+ return ((r = t.metadata) == null ? void 0 : r.actorKnown) === !1 ? `${n} (${o("auditLog.pos.unverified")})` : n;
517
+ }
518
+ function Tt(t, o) {
519
+ var d;
520
+ const n = t.approverName || t.approverId;
521
+ if (!n)
522
+ return t.source === "hrm-validate" ? o("auditLog.pos.viaCode") : "-";
523
+ const r = ((d = t.metadata) == null ? void 0 : d.approverKnown) === !1 ? `${n} (${o("auditLog.pos.unverified")})` : n;
524
+ return t.source === "hrm-validate" ? `${r} · ${o("auditLog.pos.viaCode")}` : r;
525
+ }
526
+ function ks(t, o) {
527
+ const n = t.approverName || t.approverId;
528
+ return n ? ` · ${o("auditLog.pos.approverInline", { name: n })}` : "";
529
+ }
530
+ function Ss(t, o, n) {
531
+ return o || !(t != null && t.length) ? { userIds: [], feedmeAdminActors: !1 } : {
532
+ userIds: t.filter((r) => r !== n),
533
+ feedmeAdminActors: t.includes(n)
534
+ };
535
+ }
536
+ function be(t) {
537
+ return t === void 0 ? "—" : Array.isArray(t) ? t.length > 0 ? t.join(", ") : "—" : t || "—";
538
+ }
539
+ function ws(t) {
540
+ return {
541
+ label: t.label,
542
+ labelKey: t.labelKey,
543
+ type: t.type,
544
+ beforeDisplay: be(t.before),
545
+ afterDisplay: be(t.after)
546
+ };
547
+ }
548
+ function Is(t) {
549
+ return Array.isArray(t) && t.length > 0;
550
+ }
551
+ function Rt(t, o, n) {
552
+ return n.labelKey && o(n.labelKey) ? t(n.labelKey) : n.label;
553
+ }
554
+ function Nt(t, o) {
555
+ return ut(t, o) || t("auditLog.operation.unlabeled");
556
+ }
557
+ function As(t, o) {
558
+ return !o || o.length === 0 ? "" : o.map((n) => {
559
+ const r = Nt(t, n), d = t(`auditLog.outcome.${n.status}`);
560
+ let y = `${r}: ${d}`;
561
+ return n.status === "failed" && n.errorMessage && (y += ` — ${n.errorMessage}`), y;
562
+ }).join(`
563
+ `);
564
+ }
565
+ function Fs(t, o, n) {
566
+ const r = Rt(t, o, n);
567
+ return n.type === "add" ? `${r}: + ${be(n.after)}` : n.type === "remove" ? `${r}: - ${be(n.before)}` : `${r}: ${be(n.before)} → ${be(n.after)}`;
568
+ }
569
+ function Ms(t, o, n) {
570
+ if (!n || n.length === 0) return "";
571
+ const r = n.filter((_) => _.changeNodes && _.changeNodes.length > 0);
572
+ if (r.length === 0) return "";
573
+ const d = r.length > 1;
574
+ return r.map((_) => {
575
+ const g = (_.changeNodes ?? []).map((S) => Fs(t, o, S));
576
+ return d ? [`[${Nt(t, _)}]`, ...g].join(`
577
+ `) : g.join(`
578
+ `);
579
+ }).join(`
580
+ `);
581
+ }
582
+ const Ds = {
583
+ class: "flex flex-col gap-4 p-12 w-[260px]"
584
+ }, Os = {
585
+ class: "text-xs font-semibold text-fm-color-typo-secondary mb-4"
586
+ }, Cs = {
587
+ class: "flex min-h-0 flex-1 flex-col gap-16"
588
+ }, js = {
589
+ class: "space-y-16"
590
+ }, Ts = {
591
+ class: "flex flex-wrap items-center gap-8"
592
+ }, Ps = {
593
+ key: 0,
594
+ class: "w-fit"
595
+ }, Vs = {
596
+ key: 1,
597
+ class: "w-fit"
598
+ }, $s = {
599
+ class: "w-fit"
600
+ }, Es = {
601
+ class: "w-fit"
602
+ }, Rs = {
603
+ key: 2,
604
+ class: "w-fit"
605
+ }, Ns = {
606
+ class: "flex h-full flex-col overflow-auto"
607
+ }, Us = {
608
+ key: 0,
609
+ class: "space-y-12 p-4 text-sm"
610
+ }, Ks = {
611
+ class: "flex items-start justify-between gap-8 rounded-lg border border-fm-color-border-default p-12"
612
+ }, Bs = {
613
+ class: "min-w-0 flex-1"
614
+ }, Ys = {
615
+ class: "audit-log-operation-label-detail text-base font-bold leading-snug text-fm-color-typo-primary"
616
+ }, zs = {
617
+ key: 0,
618
+ class: "mt-4 break-all font-mono text-xs text-fm-color-typo-secondary"
619
+ }, qs = {
620
+ key: 1,
621
+ class: "mt-2 break-all font-mono text-xs text-fm-color-typo-secondary"
622
+ }, Js = {
623
+ class: "flex items-center gap-4"
624
+ }, Hs = {
625
+ class: "rounded-lg border border-fm-color-border-default p-12"
626
+ }, Ws = {
627
+ class: "space-y-12"
628
+ }, Gs = {
629
+ class: "text-xs text-fm-color-typo-secondary"
630
+ }, Xs = {
631
+ class: "font-semibold"
632
+ }, Qs = {
633
+ class: "text-xs text-fm-color-typo-secondary"
634
+ }, Zs = {
635
+ class: "font-semibold"
636
+ }, ea = {
637
+ class: "text-xs text-fm-color-typo-secondary"
638
+ }, ta = {
639
+ class: "break-all font-semibold"
640
+ }, oa = {
641
+ key: 0
642
+ }, sa = {
643
+ class: "text-xs text-fm-color-typo-secondary"
644
+ }, aa = {
645
+ class: "break-all font-mono text-xs font-semibold"
646
+ }, na = {
647
+ class: "text-xs text-fm-color-typo-secondary"
648
+ }, la = {
649
+ class: "break-all font-mono text-xs font-semibold"
650
+ }, ra = {
651
+ class: "text-xs text-fm-color-typo-secondary"
652
+ }, ia = {
653
+ class: "font-semibold"
654
+ }, ua = {
655
+ class: "rounded-lg border border-fm-color-border-default"
656
+ }, da = {
657
+ class: "p-12"
658
+ }, ca = {
659
+ class: "text-base font-bold text-fm-color-typo-primary"
660
+ }, fa = {
661
+ class: "space-y-12 p-12"
662
+ }, ma = {
663
+ class: "text-xs text-fm-color-typo-secondary"
664
+ }, va = {
665
+ class: "font-semibold"
666
+ }, pa = {
667
+ class: "rounded-lg border border-fm-color-border-default"
668
+ }, ga = {
669
+ class: "p-12"
670
+ }, ha = {
671
+ class: "text-base font-bold text-fm-color-typo-primary"
672
+ }, ya = {
673
+ class: "space-y-12 p-12"
674
+ }, ba = {
675
+ class: "text-xs text-fm-color-typo-secondary"
676
+ }, _a = {
677
+ class: "font-semibold"
678
+ }, xa = {
679
+ key: 0
680
+ }, La = {
681
+ class: "text-xs text-fm-color-typo-secondary"
682
+ }, ka = {
683
+ key: 0,
684
+ class: "font-semibold"
685
+ }, Sa = {
686
+ key: 1,
687
+ class: "break-all font-mono text-xs text-fm-color-typo-secondary"
688
+ }, wa = {
689
+ key: 1
690
+ }, Ia = {
691
+ class: "text-xs text-fm-color-typo-secondary"
692
+ }, Aa = {
693
+ class: "font-semibold whitespace-pre-line"
694
+ }, Fa = {
695
+ class: "text-xs text-fm-color-typo-secondary"
696
+ }, Ma = {
697
+ class: "font-semibold"
698
+ }, Da = {
699
+ class: "text-xs text-fm-color-typo-secondary"
700
+ }, Oa = {
701
+ class: "break-all font-mono text-xs font-semibold"
702
+ }, Ca = {
703
+ class: "text-xs text-fm-color-typo-secondary"
704
+ }, ja = {
705
+ class: "break-all font-mono text-xs font-semibold"
706
+ }, Ta = {
707
+ class: "text-xs text-fm-color-typo-secondary"
708
+ }, Pa = {
709
+ class: "font-semibold"
710
+ }, Va = {
711
+ key: 0,
712
+ class: "break-all font-mono text-xs"
713
+ }, $a = {
714
+ key: 0
715
+ }, Ea = {
716
+ class: "text-xs text-fm-color-typo-secondary"
717
+ }, Ra = {
718
+ class: "font-semibold"
719
+ }, Na = {
720
+ class: "text-xs text-fm-color-typo-secondary"
721
+ }, Ua = {
722
+ class: "font-semibold"
723
+ }, Ka = {
724
+ class: "text-xs text-fm-color-typo-secondary"
725
+ }, Ba = {
726
+ class: "font-semibold"
727
+ }, Ya = {
728
+ key: 0
729
+ }, za = {
730
+ key: 1
731
+ }, qa = {
732
+ class: "text-xs text-fm-color-typo-secondary"
733
+ }, Ja = {
734
+ class: "whitespace-pre-wrap break-all font-mono text-xs"
735
+ }, Ha = {
736
+ key: 3
737
+ }, Wa = {
738
+ class: "text-xs text-fm-color-typo-secondary"
739
+ }, Ga = {
740
+ class: "mt-4 space-y-4"
741
+ }, Xa = {
742
+ class: "flex h-16 w-16 shrink-0 items-center justify-center rounded-full bg-fm-color-primary-default text-xs font-bold text-white"
743
+ }, Qa = {
744
+ class: "text-xs font-semibold"
745
+ }, Za = {
746
+ key: 0,
747
+ class: "text-fm-color-typo-secondary"
748
+ }, en = {
749
+ key: 4
750
+ }, tn = {
751
+ class: "text-xs text-fm-color-typo-secondary"
752
+ }, on = {
753
+ class: "mt-4 max-h-[400px] overflow-auto rounded bg-gray-100 p-8 font-mono text-xs leading-relaxed shadow-inner whitespace-pre-wrap break-all"
754
+ }, sn = {
755
+ key: 0,
756
+ class: "space-y-12 p-4 text-sm"
757
+ }, an = {
758
+ class: "flex items-start justify-between gap-8 rounded-lg border border-fm-color-border-default p-12"
759
+ }, nn = {
760
+ class: "min-w-0 flex-1"
761
+ }, ln = {
762
+ class: "text-base font-bold leading-snug text-fm-color-typo-primary"
763
+ }, rn = {
764
+ key: 0,
765
+ class: "text-xs text-fm-color-typo-secondary"
766
+ }, un = {
767
+ class: "rounded-lg border border-fm-color-border-default p-12"
768
+ }, dn = {
769
+ class: "space-y-12"
770
+ }, cn = {
771
+ class: "text-xs text-fm-color-typo-secondary"
772
+ }, fn = {
773
+ class: "font-semibold"
774
+ }, mn = {
775
+ key: 0
776
+ }, vn = {
777
+ class: "text-xs text-fm-color-typo-secondary"
778
+ }, pn = {
779
+ class: "font-semibold"
780
+ }, gn = {
781
+ key: 1
782
+ }, hn = {
783
+ class: "text-xs text-fm-color-typo-secondary"
784
+ }, yn = {
785
+ class: "font-semibold"
786
+ }, bn = {
787
+ key: 0,
788
+ class: "rounded-lg border border-fm-color-border-default p-12"
789
+ }, _n = {
790
+ class: "text-xs text-fm-color-typo-secondary"
791
+ }, xn = {
792
+ class: "whitespace-pre-line font-semibold text-fm-color-typo-error"
793
+ }, Ln = {
794
+ class: "rounded-lg border border-fm-color-border-default"
795
+ }, kn = {
796
+ class: "p-12"
797
+ }, Sn = {
798
+ class: "text-base font-bold text-fm-color-typo-primary"
799
+ }, wn = {
800
+ class: "p-12"
801
+ }, In = {
802
+ key: 0,
803
+ class: "divide-y divide-fm-color-border-default"
804
+ }, An = {
805
+ class: "flex flex-wrap items-center gap-8"
806
+ }, Fn = {
807
+ class: "break-all text-xs"
808
+ }, Mn = {
809
+ class: "break-all font-mono text-xs"
810
+ }, Dn = {
811
+ key: 0,
812
+ class: "text-fm-color-typo-success"
813
+ }, On = {
814
+ key: 1,
815
+ class: "text-fm-color-typo-error"
816
+ }, Cn = {
817
+ class: "text-fm-color-typo-error"
818
+ }, jn = {
819
+ class: "text-fm-color-typo-success"
820
+ }, Tn = {
821
+ key: 1,
822
+ class: "divide-y divide-fm-color-border-default"
823
+ }, Pn = {
824
+ class: "flex flex-wrap items-center gap-8"
825
+ }, Vn = {
826
+ class: "break-all font-mono text-xs"
827
+ }, $n = {
828
+ class: "space-y-4"
829
+ }, En = {
830
+ key: 0,
831
+ class: "text-fm-color-typo-success"
832
+ }, Rn = {
833
+ key: 1,
834
+ class: "text-fm-color-typo-error"
835
+ }, Nn = {
836
+ class: "text-fm-color-typo-error"
837
+ }, Un = {
838
+ class: "text-fm-color-typo-success"
839
+ }, Kn = {
840
+ key: 2,
841
+ class: "text-fm-color-typo-secondary"
842
+ }, Bn = {
843
+ key: 1,
844
+ class: "rounded-lg border border-fm-color-border-default"
845
+ }, Yn = {
846
+ class: "text-base font-bold text-fm-color-typo-primary"
847
+ }, zn = {
848
+ class: "space-y-12 p-12"
849
+ }, qn = {
850
+ key: 0
851
+ }, Jn = {
852
+ class: "text-xs text-fm-color-typo-secondary"
853
+ }, Hn = {
854
+ class: "mt-4 max-h-[400px] overflow-auto rounded bg-gray-100 p-8 font-mono text-xs leading-relaxed shadow-inner whitespace-pre-wrap break-all"
855
+ }, Wn = {
856
+ key: 1
857
+ }, Gn = {
858
+ class: "text-xs text-fm-color-typo-secondary"
859
+ }, Xn = {
860
+ class: "mt-4 max-h-[400px] overflow-auto rounded bg-gray-100 p-8 font-mono text-xs leading-relaxed shadow-inner whitespace-pre-wrap break-all"
861
+ }, De = 100, rt = 1e3, it = "__feedmeAdmin__", Qn = "D MMM YYYY h:mm A", Zn = "YYYY-MM-DD HH:mm", K = "YYYY-MM-DD", Pt = "audit-log-export-fields-v3", el = /* @__PURE__ */ Vt({
862
+ __name: "AuditLogList",
863
+ setup(t) {
864
+ const {
865
+ t: o,
866
+ te: n
867
+ } = dt(), r = Ho(), d = fs(), y = Xo(), {
868
+ restaurants: _
869
+ } = Jo(y), g = w(!1), S = w(!1), O = w([]), i = w(null), P = w(!1), $ = w({}), m = w(null), x = w(!1);
870
+ async function D(e) {
871
+ const s = Uint8Array.from(atob(e), (k) => k.charCodeAt(0)), c = new DecompressionStream("gzip"), L = c.writable.getWriter();
872
+ return await L.write(s), await L.close(), new Response(c.readable).text();
873
+ }
874
+ const F = w("");
875
+ let b = 0;
876
+ oe(() => {
877
+ var e, s;
878
+ return (s = (e = i.value) == null ? void 0 : e.metadata) == null ? void 0 : s.requestBody;
879
+ }, async (e) => {
880
+ const s = ++b;
881
+ if (!e) {
882
+ F.value = "";
883
+ return;
884
+ }
885
+ if (typeof e == "object") {
886
+ F.value = JSON.stringify(e, null, 2);
887
+ return;
888
+ }
889
+ if (e.startsWith("gzip:")) {
890
+ try {
891
+ const c = await D(e.slice(5));
892
+ if (s !== b) return;
893
+ F.value = JSON.stringify(JSON.parse(c), null, 2);
894
+ } catch {
895
+ if (s !== b) return;
896
+ F.value = e;
897
+ }
898
+ return;
899
+ }
900
+ try {
901
+ F.value = JSON.stringify(JSON.parse(e), null, 2);
902
+ } catch {
903
+ F.value = e;
904
+ }
905
+ }, {
906
+ immediate: !0
907
+ });
908
+ async function j(e) {
909
+ if (!e) return;
910
+ let s = e;
911
+ if (e.startsWith("gzip:"))
912
+ try {
913
+ s = await D(e.slice(5));
914
+ } catch {
915
+ return e;
916
+ }
917
+ try {
918
+ return JSON.parse(s);
919
+ } catch {
920
+ return s;
921
+ }
922
+ }
923
+ function B(e) {
924
+ if (e === void 0) return "";
925
+ if (typeof e == "object" && e !== null)
926
+ try {
927
+ return JSON.stringify(e, null, 2);
928
+ } catch {
929
+ return String(e);
930
+ }
931
+ return String(e);
932
+ }
933
+ const E = w([]), H = w([]), U = w(""), I = w(""), X = w(!1);
934
+ let ue = 0;
935
+ oe(m, async (e) => {
936
+ const s = ++ue;
937
+ if (E.value = [], H.value = [], U.value = "", I.value = "", X.value = !1, !e) return;
938
+ const [c, L] = await Promise.all([j(e.before), j(e.after)]);
939
+ s === ue && (Is(e.changeNodes) ? H.value = e.changeNodes.map(ws) : E.value = xs(c, L), U.value = B(c), I.value = B(L));
940
+ });
941
+ function Te(e) {
942
+ return e === "added" ? "success" : e === "removed" ? "critical" : "warning";
943
+ }
944
+ function ct(e) {
945
+ return o(e === "added" ? "auditLog.operation.added" : e === "removed" ? "auditLog.operation.removed" : "auditLog.operation.updated");
946
+ }
947
+ function W(e) {
948
+ return e.replace(/\[[^\]]*\]/g, "");
949
+ }
950
+ function xe(e) {
951
+ return e === "add" ? "success" : e === "remove" ? "critical" : "warning";
952
+ }
953
+ function Ut(e) {
954
+ return o(e === "add" ? "auditLog.operation.added" : e === "remove" ? "auditLog.operation.removed" : "auditLog.operation.updated");
955
+ }
956
+ function Kt(e) {
957
+ return Rt(o, n, e);
958
+ }
959
+ const ft = A(() => {
960
+ const e = [], s = /* @__PURE__ */ new Map();
961
+ for (const c of E.value) {
962
+ const L = W(c.path), k = `${c.type}::${L}`;
963
+ let C = s.get(k);
964
+ C || (C = {
965
+ groupKey: k,
966
+ displayKey: L,
967
+ type: c.type,
968
+ rows: []
969
+ }, s.set(k, C), e.push(C)), C.rows.push(c);
970
+ }
971
+ return e;
972
+ }), Pe = w(1), Bt = w(!1), ze = w(0), mt = A(() => Math.max(1, Math.ceil(ze.value / De))), vt = T().format("YYYY-MM-DD"), se = w({
973
+ startDate: `${vt} 00:00`,
974
+ endDate: `${vt} 23:59`
975
+ }), fe = w(), Q = w(), ae = w(), ne = w(), le = w("all");
976
+ function Yt(e) {
977
+ return typeof e == "string" ? [e] : Array.isArray(e) ? e.filter((s) => typeof s == "string") : [];
978
+ }
979
+ const pt = Me.filter((e) => e.key !== "all").map((e) => e.key);
980
+ function Ve(e) {
981
+ const s = Me.find((c) => c.key !== "all" && c.subjectPrefixes.some((L) => e.startsWith(L)));
982
+ return (s == null ? void 0 : s.key) ?? "other";
983
+ }
984
+ function gt(e) {
985
+ const s = pt.indexOf(e);
986
+ return s === -1 ? pt.length : s;
987
+ }
988
+ const zt = A(() => Me.map(({
989
+ key: e
990
+ }) => ({
991
+ label: o(`auditLog.modules.${e}`),
992
+ value: e
993
+ }))), $e = A(() => Me.find((e) => e.key === le.value) ?? Me[0]), qt = A(() => le.value === "all"), q = A(() => le.value === "pos"), pe = A(() => $e.value.sources ?? []);
994
+ oe(q, (e) => {
995
+ e && y.readRestaurants();
996
+ }, {
997
+ immediate: !0
998
+ });
999
+ const Z = w([]), Jt = A(() => _.value.map((e) => ({
1000
+ label: e.profile.name,
1001
+ value: String(e._id)
1002
+ }))), Ht = A(() => Object.fromEntries(_.value.map((e) => [String(e._id), e.profile.name])));
1003
+ oe(le, () => {
1004
+ Z.value = [];
1005
+ });
1006
+ const Le = w([]), Ee = w(!1), Wt = A(() => [...Ee.value ? [{
1007
+ label: o("auditLog.user.feedmeAdmin"),
1008
+ value: it
1009
+ }] : [], ...d.members.map((e) => ({
1010
+ label: e.name,
1011
+ value: e.doc.userId
1012
+ })), ...Le.value.map((e) => ({
1013
+ label: `${e.name} (${o("auditLog.user.feedmeAdmin")})`,
1014
+ value: e.userId
1015
+ }))]), re = A(() => Ss(fe.value, q.value, it)), qe = w(""), ee = w(""), Gt = ts(qe, (e) => {
1016
+ ee.value = e.trim();
1017
+ });
1018
+ Yo(Gt);
1019
+ const {
1020
+ onSheetOpened: Xt,
1021
+ onSheetClosed: Qt,
1022
+ copyLink: Zt
1023
+ } = ps({
1024
+ logs: O,
1025
+ selectedLog: i,
1026
+ isSheetOpen: P,
1027
+ businessId: () => {
1028
+ var e;
1029
+ return (e = r.currentBusiness.value) == null ? void 0 : e._id;
1030
+ }
1031
+ }), me = A(() => {
1032
+ const e = ee.value.toLowerCase();
1033
+ if (!e) return [];
1034
+ const s = /* @__PURE__ */ new Set();
1035
+ for (const c of d.members) {
1036
+ const L = c.doc.userId;
1037
+ ((d.userIdToName[L] ?? "").toLowerCase().includes(e) || (d.userIdToEmail[L] ?? "").toLowerCase().includes(e) || (d.userIdToPhone[L] ?? "").toLowerCase().includes(e)) && s.add(L);
1038
+ }
1039
+ for (const c of Le.value)
1040
+ c.name.toLowerCase().includes(e) && s.add(c.userId);
1041
+ return [...s];
1042
+ }), Je = A(() => {
1043
+ const e = Dt.flatMap((k) => Yt(k.subject).map((C) => ({
1044
+ label: k.label,
1045
+ value: C
1046
+ }))), s = Object.entries(Mt).map(([k, C]) => ({
1047
+ label: C,
1048
+ value: k
1049
+ })), c = /* @__PURE__ */ new Set(), L = [];
1050
+ for (const k of [...e, ...s])
1051
+ if (!c.has(k.value)) {
1052
+ c.add(k.value);
1053
+ const C = Ve(k.value);
1054
+ L.push({
1055
+ ...k,
1056
+ group: o(`auditLog.modules.${C}`)
1057
+ });
1058
+ }
1059
+ return L.sort((k, C) => gt(Ve(k.value)) - gt(Ve(C.value)));
1060
+ }), ge = A(() => {
1061
+ const e = ee.value.toLowerCase();
1062
+ if (!e) return [];
1063
+ const s = /* @__PURE__ */ new Set();
1064
+ for (const c of Je.value)
1065
+ c.label.toLowerCase().includes(e) && s.add(c.value);
1066
+ return [...s];
1067
+ }), eo = A(() => qt.value ? Je.value : Je.value.filter((e) => Ve(e.value) === le.value));
1068
+ function to(e, s) {
1069
+ const c = s.toLowerCase();
1070
+ return e.label.toLowerCase().includes(c) || e.value.replace(/^business::/, "").toLowerCase().includes(c) ? !0 : e.value.toLowerCase().includes(c);
1071
+ }
1072
+ const G = A(() => ({
1073
+ manage: o("auditLog.action.manage"),
1074
+ create: o("auditLog.action.create"),
1075
+ read: o("auditLog.action.read"),
1076
+ update: o("auditLog.action.update"),
1077
+ delete: o("auditLog.action.delete")
1078
+ })), oo = A(() => [{
1079
+ label: G.value.manage,
1080
+ value: "manage"
1081
+ }, {
1082
+ label: G.value.create,
1083
+ value: "create"
1084
+ }, {
1085
+ label: G.value.read,
1086
+ value: "read"
1087
+ }, {
1088
+ label: G.value.update,
1089
+ value: "update"
1090
+ }, {
1091
+ label: G.value.delete,
1092
+ value: "delete"
1093
+ }]), Re = A(() => ({
1094
+ allowed: o("auditLog.outcome.success"),
1095
+ denied: o("auditLog.outcome.failed"),
1096
+ skipped: o("auditLog.outcome.skipped")
1097
+ })), He = A(() => {
1098
+ var e;
1099
+ return ((e = r.sessionUser.value) == null ? void 0 : e.isInternal) ?? !1;
1100
+ });
1101
+ function ht(e) {
1102
+ return !He.value && e === "skipped" ? "allowed" : e;
1103
+ }
1104
+ function We(e) {
1105
+ return !(e != null && e.length) || He.value ? e : e.includes("allowed") ? [.../* @__PURE__ */ new Set([...e, "skipped"])] : e;
1106
+ }
1107
+ const so = A(() => [{
1108
+ label: Re.value.allowed,
1109
+ value: "allowed"
1110
+ }, {
1111
+ label: Re.value.denied,
1112
+ value: "denied"
1113
+ }, ...He.value ? [{
1114
+ label: Re.value.skipped,
1115
+ value: "skipped"
1116
+ }] : []]), ao = A(() => ({
1117
+ admin: o("auditLog.detail.resolvedFromValue.admin"),
1118
+ staff: o("auditLog.detail.resolvedFromValue.staff"),
1119
+ permissionSet: o("auditLog.detail.resolvedFromValue.permissionSet"),
1120
+ systemPermissionSet: o("auditLog.detail.resolvedFromValue.systemPermissionSet"),
1121
+ custom: o("auditLog.detail.resolvedFromValue.custom"),
1122
+ "no-match": o("auditLog.detail.resolvedFromValue.noMatch"),
1123
+ unknown: o("auditLog.detail.resolvedFromValue.unknown")
1124
+ })), no = A(() => ({
1125
+ GET: G.value.read,
1126
+ POST: G.value.create,
1127
+ PUT: G.value.update,
1128
+ PATCH: G.value.update,
1129
+ DELETE: G.value.delete
1130
+ })), lo = {
1131
+ allowed: "success",
1132
+ denied: "critical",
1133
+ skipped: "warning"
1134
+ };
1135
+ function Ne(e) {
1136
+ return T(e).format(Qn);
1137
+ }
1138
+ const ro = A(() => {
1139
+ const {
1140
+ startDate: e,
1141
+ endDate: s
1142
+ } = se.value;
1143
+ return e && s ? `${Ne(e)} – ${Ne(s)}` : e ? Ne(e) : s ? Ne(s) : o("auditLog.dateRange.placeholder");
1144
+ }), io = A(() => [{
1145
+ label: o("date.predefinedRanges.today"),
1146
+ value: {
1147
+ startDate: T().format(K),
1148
+ endDate: T().format(K)
1149
+ }
1150
+ }, {
1151
+ label: o("date.predefinedRanges.yesterday"),
1152
+ value: {
1153
+ startDate: T().subtract(1, "day").format(K),
1154
+ endDate: T().subtract(1, "day").format(K)
1155
+ }
1156
+ }, {
1157
+ label: o("date.predefinedRanges.thisWeek"),
1158
+ value: {
1159
+ startDate: T().startOf("week").format(K),
1160
+ endDate: T().endOf("week").format(K)
1161
+ }
1162
+ }, {
1163
+ label: o("date.predefinedRanges.lastWeek"),
1164
+ value: {
1165
+ startDate: T().subtract(1, "week").startOf("week").format(K),
1166
+ endDate: T().subtract(1, "week").endOf("week").format(K)
1167
+ }
1168
+ }, {
1169
+ label: o("date.predefinedRanges.last7Days"),
1170
+ value: {
1171
+ startDate: T().subtract(7, "day").format(K),
1172
+ endDate: T().subtract(1, "day").format(K)
1173
+ }
1174
+ }, {
1175
+ label: o("date.predefinedRanges.thisMonth"),
1176
+ value: {
1177
+ startDate: T().startOf("month").format(K),
1178
+ endDate: T().endOf("month").format(K)
1179
+ }
1180
+ }, {
1181
+ label: o("date.predefinedRanges.lastMonth"),
1182
+ value: {
1183
+ startDate: T().subtract(1, "month").startOf("month").format(K),
1184
+ endDate: T().subtract(1, "month").endOf("month").format(K)
1185
+ }
1186
+ }]);
1187
+ function Ge(e) {
1188
+ var s;
1189
+ return ((s = Dt.find((c) => c.subject === e)) == null ? void 0 : s.label) ?? Mt[e] ?? ls[e];
1190
+ }
1191
+ function ke(e) {
1192
+ var c, L;
1193
+ if (e.actorType === "posUser")
1194
+ return Ls(e, o);
1195
+ if (e.actorType === "portalUser")
1196
+ return e.actorName ?? e.userId;
1197
+ if (e.actorType === "feedmeAdmin")
1198
+ return (c = r.sessionUser.value) != null && c.isInternal ? `${e.actorName ?? e.userId} (${o("auditLog.user.feedmeAdmin")})` : o("auditLog.user.feedmeAdmin");
1199
+ const s = d.userIdToName[e.userId];
1200
+ return s || (d.hasLoaded ? (L = r.sessionUser.value) != null && L.isInternal ? `${e.actorName ?? e.userId} (${o("auditLog.user.feedmeAdmin")})` : o("auditLog.user.feedmeAdmin") : e.userId);
1201
+ }
1202
+ function yt(e) {
1203
+ return e.actorType === "posUser" ? q.value ? "" : lt(e, o) : d.userIdToPhone[e.userId] || "-";
1204
+ }
1205
+ function uo(e) {
1206
+ return d.userIdToEmail[e.userId] || "-";
1207
+ }
1208
+ function bt(e) {
1209
+ return T(e).format("DD MMM YYYY, HH:mm");
1210
+ }
1211
+ function Xe(e) {
1212
+ return T(e).format("DD MMM YYYY, HH:mm:ss").toUpperCase();
1213
+ }
1214
+ function _t(e) {
1215
+ return G.value[e] ?? e;
1216
+ }
1217
+ function xt(e) {
1218
+ const s = ut(o, {
1219
+ eventKey: e.eventKey,
1220
+ params: e.params,
1221
+ operationLabel: e.metadata.operationLabel ?? _t(e.action)
1222
+ });
1223
+ return e.actorType === "posUser" && !q.value ? s + ks(e, o) : s;
1224
+ }
1225
+ function Lt(e) {
1226
+ return ut(o, e) || o("auditLog.operation.unlabeled");
1227
+ }
1228
+ function co(e) {
1229
+ return Ge(e.subject) ?? e.subject;
1230
+ }
1231
+ function Qe(e) {
1232
+ return Re.value[ht(e)];
1233
+ }
1234
+ function kt(e) {
1235
+ return lo[ht(e)] ?? "neutral";
1236
+ }
1237
+ function fo(e) {
1238
+ return ao.value[e] ?? e;
1239
+ }
1240
+ function mo(e) {
1241
+ return e.metadata.requestMethod ? no.value[e.metadata.requestMethod] ?? e.metadata.requestMethod : _t(e.action);
1242
+ }
1243
+ function St(e) {
1244
+ const s = String(e ?? "");
1245
+ return `"${(/^[=+\-@\t\r]/.test(s) ? `'${s}` : s).replace(/"/g, '""')}"`;
1246
+ }
1247
+ const Ze = [{
1248
+ key: "timestamp",
1249
+ labelKey: "auditLog.exportFields.timestamp",
1250
+ getValue: (e) => bt(e.timestamp),
1251
+ defaultSelected: !0
1252
+ }, {
1253
+ key: "userName",
1254
+ labelKey: "auditLog.exportFields.userName",
1255
+ getValue: (e) => ke(e),
1256
+ defaultSelected: !0
1257
+ }, {
1258
+ key: "userPhone",
1259
+ labelKey: "auditLog.exportFields.userPhone",
1260
+ getValue: (e) => yt(e),
1261
+ defaultSelected: !0
1262
+ }, {
1263
+ key: "subject",
1264
+ labelKey: "auditLog.exportFields.subject",
1265
+ getValue: (e) => Ge(e.subject) ?? e.subject,
1266
+ defaultSelected: !0
1267
+ }, {
1268
+ key: "action",
1269
+ labelKey: "auditLog.exportFields.action",
1270
+ getValue: (e) => e.action,
1271
+ defaultSelected: !0
1272
+ }, {
1273
+ key: "operation",
1274
+ labelKey: "auditLog.exportFields.operation",
1275
+ getValue: (e) => xt(e),
1276
+ defaultSelected: !0
1277
+ }, {
1278
+ key: "outcome",
1279
+ labelKey: "auditLog.exportFields.outcome",
1280
+ getValue: (e) => Qe(e.outcome),
1281
+ defaultSelected: !0
1282
+ }, {
1283
+ key: "operationEvents",
1284
+ labelKey: "auditLog.exportFields.operationEvents",
1285
+ getValue: (e) => As(o, e.operations),
1286
+ defaultSelected: !0
1287
+ }, {
1288
+ key: "changes",
1289
+ labelKey: "auditLog.exportFields.changes",
1290
+ getValue: (e) => Ms(o, n, e.operations),
1291
+ defaultSelected: !1
1292
+ }, {
1293
+ key: "businessId",
1294
+ labelKey: "auditLog.exportFields.businessId",
1295
+ getValue: (e) => e.businessId,
1296
+ defaultSelected: !1
1297
+ }, {
1298
+ key: "restaurantId",
1299
+ labelKey: "auditLog.exportFields.restaurantId",
1300
+ getValue: (e) => e.restaurantId,
1301
+ defaultSelected: !1
1302
+ }, {
1303
+ key: "country",
1304
+ labelKey: "auditLog.exportFields.country",
1305
+ getValue: (e) => e.country,
1306
+ defaultSelected: !1
1307
+ }, {
1308
+ key: "resolvedFrom",
1309
+ labelKey: "auditLog.exportFields.resolvedFrom",
1310
+ getValue: (e) => {
1311
+ var s;
1312
+ return (s = e.metadata) == null ? void 0 : s.resolvedFrom;
1313
+ },
1314
+ defaultSelected: !1
1315
+ }, {
1316
+ key: "requestMethod",
1317
+ labelKey: "auditLog.exportFields.requestMethod",
1318
+ getValue: (e) => {
1319
+ var s;
1320
+ return (s = e.metadata) == null ? void 0 : s.requestMethod;
1321
+ },
1322
+ defaultSelected: !1
1323
+ }, {
1324
+ key: "requestPath",
1325
+ labelKey: "auditLog.exportFields.requestPath",
1326
+ getValue: (e) => {
1327
+ var s;
1328
+ return (s = e.metadata) == null ? void 0 : s.requestPath;
1329
+ },
1330
+ defaultSelected: !1
1331
+ }, {
1332
+ key: "traceId",
1333
+ labelKey: "auditLog.exportFields.traceId",
1334
+ getValue: (e) => e.traceId ?? "",
1335
+ defaultSelected: !1
1336
+ }];
1337
+ function vo() {
1338
+ try {
1339
+ const e = localStorage.getItem(Pt);
1340
+ if (e) {
1341
+ const s = JSON.parse(e);
1342
+ if (Array.isArray(s) && s.length > 0) return new Set(s);
1343
+ }
1344
+ } catch {
1345
+ }
1346
+ return new Set(Ze.filter((e) => e.defaultSelected).map((e) => e.key));
1347
+ }
1348
+ const he = w(vo());
1349
+ function po(e) {
1350
+ const s = new Set(he.value);
1351
+ if (s.has(e)) {
1352
+ if (s.size <= 1) return;
1353
+ s.delete(e);
1354
+ } else
1355
+ s.add(e);
1356
+ he.value = s;
1357
+ try {
1358
+ localStorage.setItem(Pt, JSON.stringify([...s]));
1359
+ } catch {
1360
+ }
1361
+ }
1362
+ async function go() {
1363
+ var e, s, c, L, k;
1364
+ if (!S.value) {
1365
+ S.value = !0;
1366
+ try {
1367
+ const {
1368
+ startDate: C,
1369
+ endDate: R
1370
+ } = se.value, ie = $e.value.subjectPrefixes, Ue = (/* @__PURE__ */ new Date()).toISOString().slice(0, 19).replace("T", " "), we = R ? de(R) : null, Ke = we && we < Ue ? we : Ue, tt = {
1371
+ ...C ? {
1372
+ from: de(C)
1373
+ } : {},
1374
+ to: Ke,
1375
+ ...re.value.userIds.length ? {
1376
+ userIds: re.value.userIds
1377
+ } : {},
1378
+ ...re.value.feedmeAdminActors ? {
1379
+ feedmeAdminActors: !0
1380
+ } : {},
1381
+ ...(e = Q.value) != null && e.length ? {
1382
+ subjects: Q.value
1383
+ } : {},
1384
+ ...ie.length ? {
1385
+ subjectPrefixes: [...ie]
1386
+ } : {},
1387
+ ...pe.value.length ? {
1388
+ sources: [...pe.value]
1389
+ } : {},
1390
+ ...q.value && Z.value.length ? {
1391
+ restaurantIds: [...Z.value]
1392
+ } : {},
1393
+ ...(s = ne.value) != null && s.length ? {
1394
+ actions: ne.value
1395
+ } : {},
1396
+ ...(c = ae.value) != null && c.length ? {
1397
+ outcomes: We(ae.value)
1398
+ } : {},
1399
+ ...ee.value ? {
1400
+ search: ee.value
1401
+ } : {},
1402
+ ...me.value.length ? {
1403
+ searchUserIds: me.value
1404
+ } : {},
1405
+ ...ge.value.length ? {
1406
+ searchSubjects: ge.value
1407
+ } : {}
1408
+ }, Ie = [];
1409
+ let p = 0;
1410
+ for (; ; ) {
1411
+ const J = await Oe.read({
1412
+ ...tt,
1413
+ limit: rt,
1414
+ offset: p
1415
+ });
1416
+ if (Ie.push(...J), J.length < rt) break;
1417
+ p += rt;
1418
+ }
1419
+ const V = Ze.filter((J) => he.value.has(J.key)), Do = V.map((J) => o(J.labelKey)), Oo = Ie.map((J) => V.map((No) => No.getValue(J) ?? "")), ot = -(/* @__PURE__ */ new Date()).getTimezoneOffset(), Co = ot >= 0 ? "+" : "-", jo = String(Math.floor(Math.abs(ot) / 60)).padStart(2, "0"), To = String(Math.abs(ot) % 60).padStart(2, "0"), Po = `UTC${Co}${jo}:${To}`, At = ((L = r.currentBusiness.value) == null ? void 0 : L.name) || "", Vo = [C, R].filter(Boolean).join(" – "), $o = [...[[o("auditLog.title")], [`${o("auditLog.frontMatter.date")}: ${Vo}`], ...At ? [[`${o("auditLog.frontMatter.business")}: ${At}`]] : [], [`${o("auditLog.frontMatter.generatedBy")}: ${T().format("DD MMM YYYY, HH:mm")} (${Po})`], []].map((J) => J.map(St).join(",")), ...[Do, ...Oo].map((J) => J.map(St).join(","))].join(`
1420
+ `), Eo = `audit-log_${(((k = r.currentBusiness.value) == null ? void 0 : k.name) || "business").replace(/[^a-z0-9_-]+/gi, "_")}_${T().format("YYYYMMDD_HHmmss")}.csv`, Ro = new Blob([`\uFEFF${$o}`], {
1421
+ type: "text/csv;charset=utf-8;"
1422
+ }), Ft = window.URL.createObjectURL(Ro), Ae = document.createElement("a");
1423
+ Ae.href = Ft, Ae.download = Eo, document.body.appendChild(Ae), Ae.click(), Ae.remove(), window.URL.revokeObjectURL(Ft);
1424
+ } finally {
1425
+ S.value = !1;
1426
+ }
1427
+ }
1428
+ }
1429
+ function te(e) {
1430
+ return "status" in e;
1431
+ }
1432
+ function ho(e) {
1433
+ return jt(e) ? h(ve.FmTooltip, {
1434
+ variant: "plain",
1435
+ placement: "top"
1436
+ }, {
1437
+ default: () => h(ve.FmIcon, {
1438
+ name: "error",
1439
+ size: "sm",
1440
+ class: "cursor-help text-fm-color-typo-error"
1441
+ }, null),
1442
+ content: () => o("auditLog.operation.partialFailure")
1443
+ }) : null;
1444
+ }
1445
+ function yo(e) {
1446
+ var c;
1447
+ const s = e.original;
1448
+ return e.depth === 0 && !te(s) && !!((c = s.operations) != null && c.length);
1449
+ }
1450
+ function bo(e) {
1451
+ return te(e) ? void 0 : e.operations;
1452
+ }
1453
+ const Se = [{
1454
+ accessorKey: "timestamp",
1455
+ header: () => o("auditLog.columns.timestamp"),
1456
+ cell(e) {
1457
+ return bt(e.row.original.timestamp);
1458
+ }
1459
+ }, {
1460
+ accessorKey: "userId",
1461
+ header: () => o("auditLog.columns.user"),
1462
+ enableSorting: !1,
1463
+ size: 220,
1464
+ cell(e) {
1465
+ const s = e.row.original;
1466
+ return te(s) ? null : h("div", {
1467
+ class: "flex items-center gap-8"
1468
+ }, [h(ve.FmAvatar, {
1469
+ name: ke(s),
1470
+ initials: os(ke(s)),
1471
+ size: "sm",
1472
+ class: "shrink-0"
1473
+ }, null), h("div", {
1474
+ class: "min-w-0"
1475
+ }, [h("p", {
1476
+ class: "truncate font-semibold"
1477
+ }, [ke(s)]), h("p", {
1478
+ class: "truncate text-fm-color-typo-secondary"
1479
+ }, [yt(s)])])]);
1480
+ }
1481
+ }, {
1482
+ accessorKey: "subject",
1483
+ header: () => o("auditLog.columns.subject"),
1484
+ cell(e) {
1485
+ const s = e.row.original;
1486
+ return te(s) ? h("span", {
1487
+ class: "text-fm-color-typo-secondary"
1488
+ }, [o("auditLog.operation.rowHint")]) : Ge(s.subject) ?? s.subject;
1489
+ }
1490
+ }, {
1491
+ accessorKey: "action",
1492
+ header: () => o("auditLog.columns.action"),
1493
+ enableSorting: !1,
1494
+ size: 280,
1495
+ meta: {
1496
+ cellSpanClass: "audit-log-action-label"
1497
+ },
1498
+ cell(e) {
1499
+ var R;
1500
+ const s = e.row.original;
1501
+ if (te(s))
1502
+ return h("span", {
1503
+ class: "audit-op-marker flex flex-wrap items-baseline gap-4"
1504
+ }, [h("span", {
1505
+ class: "text-fm-color-typo-secondary"
1506
+ }, [ye("↳")]), h("span", {
1507
+ class: "font-semibold"
1508
+ }, [Lt(s)]), s.entityId ? h("span", {
1509
+ class: "text-fm-color-typo-secondary"
1510
+ }, [ye("· "), s.entityId]) : null, s.status === "failed" && s.errorMessage ? h("span", {
1511
+ class: "text-fm-color-typo-error"
1512
+ }, [ye("· "), s.errorMessage]) : null]);
1513
+ const c = ((R = s.operations) == null ? void 0 : R.length) ?? 0, L = (ie) => {
1514
+ ie.stopPropagation(), e.row.getToggleExpandedHandler()();
1515
+ }, k = {
1516
+ variant: "tertiary",
1517
+ icon: e.row.getIsExpanded() ? "keyboard_arrow_up" : "keyboard_arrow_down",
1518
+ "aria-label": o("auditLog.operation.toggle"),
1519
+ class: "ml-auto shrink-0",
1520
+ onClick: L
1521
+ }, C = ve.FmButton;
1522
+ return h("span", {
1523
+ class: "flex items-center gap-8"
1524
+ }, [h("span", null, [xt(s)]), c > 0 ? h("span", {
1525
+ class: "cursor-pointer",
1526
+ onClick: L
1527
+ }, [h(ve.FmChip, {
1528
+ variant: "neutral",
1529
+ compact: !0,
1530
+ label: o("auditLog.operation.badge", {
1531
+ count: c
1532
+ })
1533
+ }, null)]) : null, e.row.getCanExpand() ? h(C, k, null) : null]);
1534
+ }
1535
+ }, {
1536
+ accessorKey: "outcome",
1537
+ header: () => o("auditLog.columns.outcome"),
1538
+ enableSorting: !1,
1539
+ cell(e) {
1540
+ const s = e.row.original;
1541
+ return te(s) ? h(ve.FmChip, {
1542
+ variant: s.status === "failed" ? "critical" : "success",
1543
+ label: s.status === "failed" ? o("auditLog.outcome.failed") : o("auditLog.outcome.success"),
1544
+ compact: !0
1545
+ }, null) : h("span", {
1546
+ class: "flex items-center gap-4"
1547
+ }, [h(ve.FmChip, {
1548
+ variant: kt(s.outcome),
1549
+ label: Qe(s.outcome),
1550
+ compact: !0
1551
+ }, null), ho(s)]);
1552
+ }
1553
+ }], _o = [
1554
+ Se[0],
1555
+ // timestamp: Date
1556
+ Se.find((e) => e.accessorKey === "userId"),
1557
+ // User: getUserName -> posActorLabel for posUser rows
1558
+ {
1559
+ accessorKey: "restaurantId",
1560
+ header: () => o("auditLog.columns.restaurant"),
1561
+ enableSorting: !1,
1562
+ cell(e) {
1563
+ const s = e.row.original;
1564
+ return te(s) ? null : s.restaurantId && Ht.value[s.restaurantId] || s.restaurantId || "-";
1565
+ }
1566
+ },
1567
+ {
1568
+ accessorKey: "deviceId",
1569
+ header: () => o("auditLog.columns.device"),
1570
+ enableSorting: !1,
1571
+ cell(e) {
1572
+ const s = e.row.original;
1573
+ return te(s) ? null : lt(s, o);
1574
+ }
1575
+ },
1576
+ {
1577
+ accessorKey: "approverName",
1578
+ header: () => o("auditLog.columns.approver"),
1579
+ enableSorting: !1,
1580
+ cell(e) {
1581
+ const s = e.row.original;
1582
+ return te(s) ? null : Tt(s, o);
1583
+ }
1584
+ },
1585
+ Se.find((e) => e.accessorKey === "action"),
1586
+ // Action Description: event line
1587
+ Se.find((e) => e.accessorKey === "outcome")
1588
+ // Status
1589
+ ], xo = A(() => q.value ? _o : Se);
1590
+ function de(e) {
1591
+ const s = T(e, Zn);
1592
+ return new Date(s.year(), s.month(), s.date(), s.hour(), s.minute(), 0).toISOString().slice(0, 19).replace("T", " ");
1593
+ }
1594
+ async function wt() {
1595
+ var e, s, c;
1596
+ g.value = !0;
1597
+ try {
1598
+ const {
1599
+ startDate: L,
1600
+ endDate: k
1601
+ } = se.value, C = (Pe.value - 1) * De, R = $e.value.subjectPrefixes, ie = await Oe.read({
1602
+ limit: De,
1603
+ offset: C,
1604
+ ...L ? {
1605
+ from: de(L)
1606
+ } : {},
1607
+ ...k ? {
1608
+ to: de(k)
1609
+ } : {},
1610
+ ...re.value.userIds.length ? {
1611
+ userIds: re.value.userIds
1612
+ } : {},
1613
+ ...re.value.feedmeAdminActors ? {
1614
+ feedmeAdminActors: !0
1615
+ } : {},
1616
+ ...(e = Q.value) != null && e.length ? {
1617
+ subjects: Q.value
1618
+ } : {},
1619
+ ...R.length ? {
1620
+ subjectPrefixes: [...R]
1621
+ } : {},
1622
+ ...pe.value.length ? {
1623
+ sources: [...pe.value]
1624
+ } : {},
1625
+ ...q.value && Z.value.length ? {
1626
+ restaurantIds: [...Z.value]
1627
+ } : {},
1628
+ ...(s = ne.value) != null && s.length ? {
1629
+ actions: ne.value
1630
+ } : {},
1631
+ ...(c = ae.value) != null && c.length ? {
1632
+ outcomes: We(ae.value)
1633
+ } : {},
1634
+ ...ee.value ? {
1635
+ search: ee.value
1636
+ } : {},
1637
+ ...me.value.length ? {
1638
+ searchUserIds: me.value
1639
+ } : {},
1640
+ ...ge.value.length ? {
1641
+ searchSubjects: ge.value
1642
+ } : {}
1643
+ });
1644
+ O.value = ie, Bt.value = ie.length === De, $.value = {};
1645
+ } finally {
1646
+ g.value = !1;
1647
+ }
1648
+ }
1649
+ const It = A(() => {
1650
+ var e;
1651
+ return JSON.stringify({
1652
+ businessId: ((e = r.currentBusiness.value) == null ? void 0 : e._id) ?? "",
1653
+ dateRange: se.value,
1654
+ users: [...fe.value ?? []].sort(),
1655
+ subjects: [...Q.value ?? []].sort(),
1656
+ outcomes: [...ae.value ?? []].sort(),
1657
+ actions: [...ne.value ?? []].sort(),
1658
+ moduleKey: le.value,
1659
+ restaurantIds: [...Z.value].sort(),
1660
+ search: ee.value,
1661
+ // Member/feedme-admin-actor lists resolve asynchronously (and actors refetch on
1662
+ // every date-range change), so searchUserIds can change after the key above is
1663
+ // computed — include it explicitly or a late-arriving match never refetches.
1664
+ searchUserIds: [...me.value].sort()
1665
+ });
1666
+ });
1667
+ async function Lo() {
1668
+ var L, k, C;
1669
+ const {
1670
+ startDate: e,
1671
+ endDate: s
1672
+ } = se.value, c = $e.value.subjectPrefixes;
1673
+ ze.value = await Oe.count({
1674
+ ...e ? {
1675
+ from: de(e)
1676
+ } : {},
1677
+ ...s ? {
1678
+ to: de(s)
1679
+ } : {},
1680
+ ...re.value.userIds.length ? {
1681
+ userIds: re.value.userIds
1682
+ } : {},
1683
+ ...re.value.feedmeAdminActors ? {
1684
+ feedmeAdminActors: !0
1685
+ } : {},
1686
+ ...(L = Q.value) != null && L.length ? {
1687
+ subjects: Q.value
1688
+ } : {},
1689
+ ...c.length ? {
1690
+ subjectPrefixes: [...c]
1691
+ } : {},
1692
+ ...pe.value.length ? {
1693
+ sources: [...pe.value]
1694
+ } : {},
1695
+ ...q.value && Z.value.length ? {
1696
+ restaurantIds: [...Z.value]
1697
+ } : {},
1698
+ ...(k = ne.value) != null && k.length ? {
1699
+ actions: ne.value
1700
+ } : {},
1701
+ ...(C = ae.value) != null && C.length ? {
1702
+ outcomes: We(ae.value)
1703
+ } : {},
1704
+ ...ee.value ? {
1705
+ search: ee.value
1706
+ } : {},
1707
+ ...me.value.length ? {
1708
+ searchUserIds: me.value
1709
+ } : {},
1710
+ ...ge.value.length ? {
1711
+ searchSubjects: ge.value
1712
+ } : {}
1713
+ });
1714
+ }
1715
+ oe(It, async () => {
1716
+ var e;
1717
+ Pe.value = 1, (e = r.currentBusiness.value) != null && e._id && await Promise.all([Lo(), wt()]);
1718
+ }, {
1719
+ immediate: !0
1720
+ }), oe(le, () => {
1721
+ Q.value = void 0, q.value && (fe.value = void 0);
1722
+ });
1723
+ let et = !1;
1724
+ async function ko({
1725
+ pageIndex: e
1726
+ }) {
1727
+ var s;
1728
+ if ((s = r.currentBusiness.value) != null && s._id && !(e === 0 && Pe.value === 1) && !et) {
1729
+ et = !0, Pe.value = e + 1;
1730
+ try {
1731
+ await wt();
1732
+ } finally {
1733
+ et = !1;
1734
+ }
1735
+ }
1736
+ }
1737
+ function So(e) {
1738
+ if (te(e)) {
1739
+ Io(e);
1740
+ return;
1741
+ }
1742
+ i.value = e, P.value = !0, Xt(e);
1743
+ }
1744
+ function wo() {
1745
+ P.value = !1, i.value = null, Qt();
1746
+ }
1747
+ function Io(e) {
1748
+ m.value = e, x.value = !0;
1749
+ }
1750
+ function Ao() {
1751
+ x.value = !1, m.value = null;
1752
+ }
1753
+ oe(r.currentBusiness, (e) => {
1754
+ e && d.readTeamMembers();
1755
+ }, {
1756
+ immediate: !0
1757
+ });
1758
+ function Fo() {
1759
+ const e = fe.value;
1760
+ if (!(e != null && e.length)) return;
1761
+ const s = new Set(Le.value.map((k) => k.userId)), c = new Set(d.members.map((k) => k.doc.userId)), L = e.filter((k) => k === it ? Ee.value : d.hasLoaded ? c.has(k) || s.has(k) : !0);
1762
+ L.length !== e.length && (fe.value = L.length ? L : void 0);
1763
+ }
1764
+ async function Mo() {
1765
+ var c;
1766
+ if (!((c = r.currentBusiness.value) != null && c._id)) return;
1767
+ const {
1768
+ startDate: e,
1769
+ endDate: s
1770
+ } = se.value;
1771
+ try {
1772
+ const {
1773
+ actors: L,
1774
+ showFeedmeAdminFilter: k
1775
+ } = await Oe.getFeedmeAdminFilter({
1776
+ ...e ? {
1777
+ from: de(e)
1778
+ } : {},
1779
+ ...s ? {
1780
+ to: de(s)
1781
+ } : {}
1782
+ });
1783
+ Le.value = L, Ee.value = k;
1784
+ } catch {
1785
+ Le.value = [], Ee.value = !1;
1786
+ }
1787
+ Fo();
1788
+ }
1789
+ return oe(() => {
1790
+ var e;
1791
+ return {
1792
+ businessId: (e = r.currentBusiness.value) == null ? void 0 : e._id,
1793
+ range: se.value
1794
+ };
1795
+ }, () => Mo(), {
1796
+ immediate: !0,
1797
+ deep: !0
1798
+ }), (e, s) => {
1799
+ const c = N("FmSpacer"), L = N("FmButton"), k = N("FmMenuItem"), C = N("FmMenu"), R = N("FmChip"), ie = N("FmDateRangePicker"), Ue = N("FmSearch"), we = N("FmTable"), Ke = N("FmIcon"), tt = N("FmTooltip"), Ie = N("FmSideSheet");
1800
+ return f(), v(z, null, [h(Qo, {
1801
+ heading: u(o)("auditLog.title")
1802
+ }, {
1803
+ "append-heading": Y(() => [h(c), h(L, {
1804
+ variant: "primary",
1805
+ "prepend-icon": "upload",
1806
+ label: u(o)("auditLog.export"),
1807
+ disabled: O.value.length === 0 || S.value || u(d).isLoading || u(d).members.length === 0,
1808
+ loading: S.value,
1809
+ onClick: go
1810
+ }, null, 8, ["label", "disabled", "loading"]), h(C, {
1811
+ "close-on-click": !1,
1812
+ "z-index": 50
1813
+ }, {
1814
+ "menu-button": Y(() => [h(L, {
1815
+ variant: "tertiary",
1816
+ icon: "settings",
1817
+ "aria-label": u(o)("auditLog.exportSettings.title"),
1818
+ disabled: S.value
1819
+ }, null, 8, ["aria-label", "disabled"])]),
1820
+ default: Y(() => [a("div", Ds, [a("p", Os, l(u(o)("auditLog.exportSettings.title")), 1), (f(), v(z, null, ce(Ze, (p) => h(k, {
1821
+ key: p.key,
1822
+ label: u(o)(p.labelKey),
1823
+ "has-checkbox": "",
1824
+ "model-value": he.value.has(p.key),
1825
+ disabled: he.value.has(p.key) && he.value.size === 1,
1826
+ onClick: (V) => po(p.key)
1827
+ }, null, 8, ["label", "model-value", "disabled", "onClick"])), 64))])]),
1828
+ _: 1
1829
+ })]),
1830
+ default: Y(() => [a("div", Cs, [a("div", js, [h(cs, {
1831
+ modelValue: le.value,
1832
+ "onUpdate:modelValue": s[0] || (s[0] = (p) => le.value = p),
1833
+ items: zt.value
1834
+ }, null, 8, ["modelValue", "items"]), a("div", Ts, [h(ie, {
1835
+ modelValue: se.value,
1836
+ "onUpdate:modelValue": s[1] || (s[1] = (p) => se.value = p),
1837
+ "show-predefined-range": "",
1838
+ "show-time": "",
1839
+ "predefined-range": io.value
1840
+ }, {
1841
+ "trigger-button": Y(() => [h(R, {
1842
+ label: ro.value,
1843
+ icon: "calendar_month"
1844
+ }, null, 8, ["label"])]),
1845
+ _: 1
1846
+ }, 8, ["modelValue", "predefined-range"]), q.value ? M("", !0) : (f(), v("div", Ps, [h(Fe, {
1847
+ modelValue: fe.value,
1848
+ "onUpdate:modelValue": s[2] || (s[2] = (p) => fe.value = p),
1849
+ items: Wt.value,
1850
+ multiple: "",
1851
+ variant: "dark",
1852
+ placeholder: u(o)("auditLog.filter.user_placeholder"),
1853
+ "selected-prefix": u(o)("auditLog.filter.selected_user_prefix"),
1854
+ "chip-icon": "account_circle"
1855
+ }, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])])), q.value ? M("", !0) : (f(), v("div", Vs, [h(Fe, {
1856
+ modelValue: Q.value,
1857
+ "onUpdate:modelValue": s[3] || (s[3] = (p) => Q.value = p),
1858
+ items: eo.value,
1859
+ "filter-fn": to,
1860
+ multiple: "",
1861
+ variant: "dark",
1862
+ placeholder: u(o)("auditLog.filter.subject_placeholder"),
1863
+ "selected-prefix": u(o)("auditLog.filter.selected_subject_prefix"),
1864
+ "chip-icon": "badge"
1865
+ }, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])])), a("div", $s, [h(Fe, {
1866
+ modelValue: ne.value,
1867
+ "onUpdate:modelValue": s[4] || (s[4] = (p) => ne.value = p),
1868
+ items: oo.value,
1869
+ multiple: "",
1870
+ variant: "dark",
1871
+ placeholder: u(o)("auditLog.filter.action_placeholder"),
1872
+ "selected-prefix": u(o)("auditLog.filter.selected_action_prefix"),
1873
+ searchable: !1
1874
+ }, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])]), a("div", Es, [h(Fe, {
1875
+ modelValue: ae.value,
1876
+ "onUpdate:modelValue": s[5] || (s[5] = (p) => ae.value = p),
1877
+ items: so.value,
1878
+ multiple: "",
1879
+ variant: "dark",
1880
+ placeholder: u(o)("auditLog.filter.status_placeholder"),
1881
+ "selected-prefix": u(o)("auditLog.filter.selected_status_prefix"),
1882
+ searchable: !1,
1883
+ "chip-icon": "check_circle"
1884
+ }, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])]), q.value ? (f(), v("div", Rs, [h(Fe, {
1885
+ modelValue: Z.value,
1886
+ "onUpdate:modelValue": s[6] || (s[6] = (p) => Z.value = p),
1887
+ items: Jt.value,
1888
+ multiple: "",
1889
+ variant: "dark",
1890
+ placeholder: u(o)("auditLog.filter.restaurant_placeholder"),
1891
+ "selected-prefix": u(o)("auditLog.filter.selected_restaurant_prefix"),
1892
+ "chip-icon": "storefront"
1893
+ }, null, 8, ["modelValue", "items", "placeholder", "selected-prefix"])])) : M("", !0), h(Ue, {
1894
+ modelValue: qe.value,
1895
+ "onUpdate:modelValue": s[7] || (s[7] = (p) => qe.value = p),
1896
+ class: "ml-auto w-[280px]",
1897
+ placeholder: u(o)("auditLog.search.placeholder")
1898
+ }, null, 8, ["modelValue", "placeholder"])])]), h(Wo, null, {
1899
+ default: Y(() => [a("div", Ns, [h(Zo, {
1900
+ "is-loading": g.value,
1901
+ "is-empty": O.value.length === 0,
1902
+ title: u(o)("auditLog.noData.title"),
1903
+ subtitle: u(o)("auditLog.noData.subtitle")
1904
+ }, {
1905
+ default: Y(() => [(f(), Ce(we, {
1906
+ key: It.value,
1907
+ "column-defs": xo.value,
1908
+ "row-data": O.value,
1909
+ "page-size": De,
1910
+ "page-count": mt.value,
1911
+ "row-count": ze.value,
1912
+ "fetch-fn": ko,
1913
+ "hide-footer": mt.value <= 1,
1914
+ loading: g.value,
1915
+ "expanded-state": $.value,
1916
+ "get-row-can-expand": yo,
1917
+ "get-sub-row": bo,
1918
+ "pin-header-row": "",
1919
+ class: "audit-log-list-table cursor-pointer",
1920
+ "onUpdate:expandedState": s[8] || (s[8] = (p) => $.value = p),
1921
+ onRowClick: s[9] || (s[9] = (p) => So(p.original))
1922
+ }, null, 8, ["column-defs", "row-data", "page-count", "row-count", "hide-footer", "loading", "expanded-state"]))]),
1923
+ _: 1
1924
+ }, 8, ["is-loading", "is-empty", "title", "subtitle"])])]),
1925
+ _: 1
1926
+ })])]),
1927
+ _: 1
1928
+ }, 8, ["heading"]), h(Ie, {
1929
+ header: u(o)("auditLog.detail.header"),
1930
+ "model-value": P.value,
1931
+ "max-width": 768,
1932
+ "dismiss-away": "",
1933
+ "onUpdate:modelValue": s[10] || (s[10] = (p) => {
1934
+ p || wo();
1935
+ })
1936
+ }, {
1937
+ default: Y(() => [i.value ? (f(), v("div", Us, [a("div", Ks, [a("div", Bs, [a("p", Ys, l(co(i.value)), 1), i.value.traceId ? (f(), v("p", zs, [ye(" Trace ID: " + l(i.value.traceId) + " ", 1), h(L, {
1938
+ variant: "tertiary",
1939
+ icon: "link",
1940
+ class: "ml-4 align-middle",
1941
+ "aria-label": u(o)("auditLog.detail.copyLink"),
1942
+ onClick: u(Zt)
1943
+ }, null, 8, ["aria-label", "onClick"])])) : M("", !0), i.value.eventId ? (f(), v("p", qs, " Event ID: " + l(i.value.eventId), 1)) : M("", !0)]), a("div", Js, [h(R, {
1944
+ variant: kt(i.value.outcome),
1945
+ label: Qe(i.value.outcome),
1946
+ compact: ""
1947
+ }, null, 8, ["variant", "label"]), u(jt)(i.value) ? (f(), Ce(tt, {
1948
+ key: 0,
1949
+ variant: "plain",
1950
+ placement: "top"
1951
+ }, {
1952
+ content: Y(() => [ye(l(u(o)("auditLog.operation.partialFailure")), 1)]),
1953
+ default: Y(() => [h(Ke, {
1954
+ name: "error",
1955
+ size: "sm",
1956
+ class: "cursor-help text-fm-color-typo-error"
1957
+ })]),
1958
+ _: 1
1959
+ })) : M("", !0)])]), a("div", Hs, [a("div", Ws, [a("div", null, [a("p", Gs, l(u(o)("auditLog.detail.date")), 1), a("p", Xs, l(Xe(i.value.timestamp)), 1)]), a("div", null, [a("p", Qs, l(u(o)("auditLog.detail.user")), 1), a("p", Zs, l(ke(i.value)), 1)]), a("div", null, [a("p", ea, l(u(o)("auditLog.detail.email")), 1), a("p", ta, l(uo(i.value)), 1)]), i.value.field ? (f(), v("div", oa, [a("p", sa, l(u(o)("auditLog.detail.field")), 1), a("p", aa, l(i.value.field), 1)])) : M("", !0), a("div", null, [a("p", na, l(u(o)("auditLog.detail.business")), 1), a("p", la, l(i.value.businessId || "-"), 1)]), a("div", null, [a("p", ra, l(u(o)("auditLog.detail.restaurant")), 1), a("p", ia, l(i.value.restaurantId || "-"), 1)])])]), a("div", ua, [a("div", da, [a("p", ca, l(u(o)("auditLog.detail.eventDetails")), 1)]), s[13] || (s[13] = a("hr", {
1960
+ class: "border-fm-color-border-default"
1961
+ }, null, -1)), a("div", fa, [a("div", null, [a("p", ma, l(u(o)("auditLog.detail.actionDescription")), 1), a("p", va, l(i.value.metadata.operationLabel || "-"), 1)])])]), a("div", pa, [a("div", ga, [a("p", ha, l(u(o)("auditLog.detail.metadata")), 1)]), s[14] || (s[14] = a("hr", {
1962
+ class: "border-fm-color-border-default"
1963
+ }, null, -1)), a("div", ya, [a("div", null, [a("p", ba, l(u(o)("auditLog.detail.resolvedFrom")), 1), a("p", _a, l(fo(i.value.metadata.resolvedFrom)), 1)]), (i.value.metadata.resolvedFrom === "permissionSet" || i.value.metadata.resolvedFrom === "systemPermissionSet") && (i.value.metadata.permissionSetName || i.value.metadata.permissionSetId) ? (f(), v("div", xa, [a("p", La, l(u(o)("auditLog.detail.permissionSet")), 1), i.value.metadata.permissionSetName ? (f(), v("p", ka, l(i.value.metadata.permissionSetName), 1)) : M("", !0), i.value.metadata.permissionSetId ? (f(), v("p", Sa, l(i.value.metadata.permissionSetId), 1)) : M("", !0)])) : M("", !0), i.value.metadata.reason ? (f(), v("div", wa, [a("p", Ia, l(u(o)("auditLog.detail.reason")), 1), a("p", Aa, l(i.value.metadata.reason), 1)])) : M("", !0), a("div", null, [a("p", Fa, l(u(o)("auditLog.detail.requestMethod")), 1), a("p", Ma, l(mo(i.value)), 1)]), a("div", null, [a("p", Da, l(u(o)("auditLog.detail.requestPath")), 1), a("p", Oa, l(i.value.metadata.requestPath || "-"), 1)]), i.value.metadata.pos ? (f(), v(z, {
1964
+ key: 2
1965
+ }, [a("div", null, [a("p", Ca, l(u(o)("auditLog.pos.details.eventKey")), 1), a("p", ja, l(i.value.eventKey || "-"), 1)]), a("div", null, [a("p", Ta, l(u(o)("auditLog.columns.device")), 1), a("p", Pa, l(u(lt)(i.value, u(o))), 1), i.value.metadata.pos.machineId ? (f(), v("p", Va, l(i.value.metadata.pos.machineId), 1)) : M("", !0)]), i.value.metadata.pos.appVersion ? (f(), v("div", $a, [a("p", Ea, l(u(o)("auditLog.pos.details.appVersion")), 1), a("p", Ra, l(i.value.metadata.pos.appVersion), 1)])) : M("", !0), a("div", null, [a("p", Na, l(u(o)("auditLog.columns.approver")), 1), a("p", Ua, l(u(Tt)(i.value, u(o))), 1)]), a("div", null, [a("p", Ka, l(u(o)("auditLog.pos.details.clock")), 1), a("p", Ba, [ye(l(Xe(new Date(i.value.metadata.pos.occurredAt))) + " · " + l(i.value.metadata.pos.clockSkewMs) + " ms", 1), i.value.metadata.pos.clockClamped ? (f(), v("span", Ya, " · " + l(u(o)("auditLog.pos.details.clamped")), 1)) : M("", !0)])]), i.value.params ? (f(), v("div", za, [a("p", qa, l(u(o)("auditLog.pos.details.params")), 1), a("pre", Ja, l(i.value.params), 1)])) : M("", !0)], 64)) : M("", !0), i.value.metadata.trace && i.value.metadata.trace.length > 0 ? (f(), v("div", Ha, [a("p", Wa, l(u(o)("auditLog.detail.permissionTrace")), 1), a("ol", Ga, [(f(!0), v(z, null, ce(i.value.metadata.trace, (p, V) => (f(), v("li", {
1966
+ key: V,
1967
+ class: "flex items-center gap-6"
1968
+ }, [a("span", Xa, l(V + 1), 1), a("span", Qa, l(p), 1), V < i.value.metadata.trace.length - 1 ? (f(), v("span", Za, "→")) : M("", !0)]))), 128))])])) : M("", !0), F.value ? (f(), v("div", en, [a("p", tn, l(u(o)("auditLog.detail.requestBody")), 1), a("pre", on, l(F.value), 1)])) : M("", !0)])])])) : M("", !0)]),
1969
+ _: 1
1970
+ }, 8, ["header", "model-value"]), h(Ie, {
1971
+ header: u(o)("auditLog.operation.sheetHeader"),
1972
+ "model-value": x.value,
1973
+ "max-width": 768,
1974
+ "dismiss-away": "",
1975
+ "onUpdate:modelValue": s[12] || (s[12] = (p) => {
1976
+ p || Ao();
1977
+ })
1978
+ }, {
1979
+ default: Y(() => [m.value ? (f(), v("div", sn, [a("div", an, [a("div", nn, [a("p", ln, l(Lt(m.value)), 1), m.value.entityId ? (f(), v("p", rn, l(m.value.entityId), 1)) : M("", !0)]), h(R, {
1980
+ variant: m.value.status === "failed" ? "critical" : "success",
1981
+ label: m.value.status === "failed" ? u(o)("auditLog.outcome.failed") : u(o)("auditLog.outcome.success"),
1982
+ compact: ""
1983
+ }, null, 8, ["variant", "label"])]), a("div", un, [a("div", dn, [a("div", null, [a("p", cn, l(u(o)("auditLog.detail.date")), 1), a("p", fn, l(Xe(m.value.timestamp)), 1)]), m.value.entityId ? (f(), v("div", mn, [a("p", vn, l(u(o)("auditLog.operation.entity")), 1), a("p", pn, l(m.value.entityId), 1)])) : M("", !0), m.value.durationMs !== void 0 ? (f(), v("div", gn, [a("p", hn, l(u(o)("auditLog.operation.duration")), 1), a("p", yn, l(u(o)("auditLog.operation.durationValue", {
1984
+ ms: m.value.durationMs
1985
+ })), 1)])) : M("", !0)])]), m.value.status === "failed" ? (f(), v("div", bn, [a("p", _n, l(u(o)("auditLog.operation.error")), 1), a("p", xn, l(m.value.errorMessage || "-"), 1)])) : M("", !0), a("div", Ln, [a("div", kn, [a("p", Sn, l(u(o)("auditLog.operation.changes")), 1)]), s[17] || (s[17] = a("hr", {
1986
+ class: "border-fm-color-border-default"
1987
+ }, null, -1)), a("div", wn, [H.value.length ? (f(), v("div", In, [(f(!0), v(z, null, ce(H.value, (p, V) => (f(), v("div", {
1988
+ key: V,
1989
+ class: "space-y-4 py-8 first:pt-0 last:pb-0"
1990
+ }, [a("div", An, [h(R, {
1991
+ variant: xe(p.type),
1992
+ label: Ut(p.type),
1993
+ compact: ""
1994
+ }, null, 8, ["variant", "label"]), a("span", Fn, l(Kt(p)), 1)]), a("p", Mn, [p.type === "add" ? (f(), v("span", Dn, l(p.afterDisplay), 1)) : p.type === "remove" ? (f(), v("span", On, l(p.beforeDisplay), 1)) : (f(), v(z, {
1995
+ key: 2
1996
+ }, [a("span", Cn, l(p.beforeDisplay), 1), s[15] || (s[15] = a("span", {
1997
+ class: "text-fm-color-typo-secondary"
1998
+ }, " → ", -1)), a("span", jn, l(p.afterDisplay), 1)], 64))])]))), 128))])) : ft.value.length ? (f(), v("div", Tn, [(f(!0), v(z, null, ce(ft.value, (p) => (f(), v("div", {
1999
+ key: p.groupKey,
2000
+ class: "space-y-4 py-8 first:pt-0 last:pb-0"
2001
+ }, [a("div", Pn, [h(R, {
2002
+ variant: Te(p.type),
2003
+ label: ct(p.type),
2004
+ compact: ""
2005
+ }, null, 8, ["variant", "label"]), a("span", Vn, l(p.displayKey), 1)]), a("div", $n, [(f(!0), v(z, null, ce(p.rows, (V) => (f(), v("p", {
2006
+ key: V.path,
2007
+ class: "break-all font-mono text-xs"
2008
+ }, [V.type === "added" ? (f(), v("span", En, l(V.after ?? "—"), 1)) : V.type === "removed" ? (f(), v("span", Rn, l(V.before ?? "—"), 1)) : (f(), v(z, {
2009
+ key: 2
2010
+ }, [a("span", Nn, l(V.before ?? "—"), 1), s[16] || (s[16] = a("span", {
2011
+ class: "text-fm-color-typo-secondary"
2012
+ }, " → ", -1)), a("span", Un, l(V.after ?? "—"), 1)], 64))]))), 128))])]))), 128))])) : (f(), v("p", Kn, l(u(o)("auditLog.operation.noChanges")), 1))])]), U.value || I.value ? (f(), v("div", Bn, [a("button", {
2013
+ type: "button",
2014
+ class: "flex w-full items-center justify-between p-12 text-left",
2015
+ onClick: s[11] || (s[11] = (p) => X.value = !X.value)
2016
+ }, [a("p", Yn, l(u(o)("auditLog.operation.showData")), 1), h(Ke, {
2017
+ name: "keyboard_arrow_down",
2018
+ class: zo(["shrink-0 transition-transform", X.value ? "rotate-180" : ""])
2019
+ }, null, 8, ["class"])]), X.value ? (f(), v(z, {
2020
+ key: 0
2021
+ }, [s[18] || (s[18] = a("hr", {
2022
+ class: "border-fm-color-border-default"
2023
+ }, null, -1)), a("div", zn, [U.value ? (f(), v("div", qn, [a("p", Jn, l(u(o)("auditLog.operation.before")), 1), a("pre", Hn, l(U.value), 1)])) : M("", !0), I.value ? (f(), v("div", Wn, [a("p", Gn, l(u(o)("auditLog.operation.after")), 1), a("pre", Xn, l(I.value), 1)])) : M("", !0)])], 64)) : M("", !0)])) : M("", !0)])) : M("", !0)]),
2024
+ _: 1
2025
+ }, 8, ["header", "model-value"])], 64);
2026
+ };
2027
+ }
2028
+ }), yl = /* @__PURE__ */ Go(el, [["__scopeId", "data-v-277a4ae7"]]);
2029
+ export {
2030
+ yl as default
2031
+ };