@oneclick.dev/cms-core-modules 0.0.123 → 0.0.125

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 (223) hide show
  1. package/dist/AppointmentListTable-CWzbwqR-.js +1 -0
  2. package/dist/AppointmentListTable-DoZuBstk.mjs +270 -0
  3. package/dist/ContentEditor-BlNbqkAz.js +324 -0
  4. package/dist/{ContentEditor-MDGolnIP.mjs → ContentEditor-D754iLJS.mjs} +7985 -26820
  5. package/dist/{Detail-Dk8E6_uF.mjs → Detail-BOxWQ1QQ.mjs} +15 -14
  6. package/dist/{Detail-Cn9Bk0u0.mjs → Detail-BfKW0uZE.mjs} +26 -25
  7. package/dist/Detail-DFVu2F38.mjs +11 -0
  8. package/dist/Detail-DJea_fCd.js +1 -0
  9. package/dist/Detail-DPJacXfm.js +1 -0
  10. package/dist/Detail-DSLZ7_bM.js +1 -0
  11. package/dist/Detail-DUGThL9Y.js +1 -0
  12. package/dist/{Detail-B_scnidb.mjs → Detail-D_LlEeHu.mjs} +35 -34
  13. package/dist/Editor-D4evcdhv.mjs +768 -0
  14. package/dist/Editor-gLLtuJbY.js +1 -0
  15. package/dist/FormStatusBadge.vue_vue_type_script_setup_true_lang-BjKpsqT9.js +1 -0
  16. package/dist/FormStatusBadge.vue_vue_type_script_setup_true_lang-D5v5AhLe.mjs +76 -0
  17. package/dist/Knowledge-B66vxz--.js +1 -0
  18. package/dist/Knowledge-BnMTTuJ7.mjs +742 -0
  19. package/dist/Overview-0hFXiuYo.js +1 -0
  20. package/dist/Overview-BE4uYPx0.mjs +745 -0
  21. package/dist/Overview-BTx5LF4J.js +1 -0
  22. package/dist/Overview-CCu2PHai.mjs +289 -0
  23. package/dist/Overview-CQRpFhbJ.mjs +286 -0
  24. package/dist/Overview-CTs7sX4d.js +1 -0
  25. package/dist/Overview-Cj89XXKN.js +1 -0
  26. package/dist/Overview-D2u-leeO.js +1 -0
  27. package/dist/Overview-D_2wozCG.mjs +1733 -0
  28. package/dist/Overview-D_c18mbR.mjs +248 -0
  29. package/dist/Overview-Dffo-zH4.mjs +11 -0
  30. package/dist/Overview-g4Rcj245.js +1 -0
  31. package/dist/{TableCalculationWidget-CrqcLGfU.mjs → TableCalculationWidget-B_LFoOYm.mjs} +3 -3
  32. package/dist/{TableCalculationWidget-CkQPrVUd.js → TableCalculationWidget-CahOIcbk.js} +1 -1
  33. package/dist/TableDataWidget-BwqWFH4A.js +1 -0
  34. package/dist/TableDataWidget-RsVxcDsL.mjs +112 -0
  35. package/dist/TableOverviewCard-BPWCqo56.js +1 -0
  36. package/dist/{TableOverviewCard-Ci0d4o4w.mjs → TableOverviewCard-D667DDag.mjs} +113 -127
  37. package/dist/TableResultView.vue_vue_type_script_setup_true_lang-C3XiOXgb.js +1 -0
  38. package/dist/TableResultView.vue_vue_type_script_setup_true_lang-sp0TLio0.mjs +547 -0
  39. package/dist/{TableRowActionCard-BhdnnPaq.mjs → TableRowActionCard-BPYJ-Kjy.mjs} +95 -101
  40. package/dist/TableRowActionCard-Bnqj1YIe.js +1 -0
  41. package/dist/TableView-CwhZ9YN2.js +4 -0
  42. package/dist/TableView-DX9PKS8N.mjs +9673 -0
  43. package/dist/TemplateBuilder.vue_vue_type_script_setup_true_lang-BgDdzbLe.js +1 -0
  44. package/dist/TemplateBuilder.vue_vue_type_script_setup_true_lang-D85V4nrQ.mjs +2886 -0
  45. package/dist/Test-CzmOmi53.mjs +447 -0
  46. package/dist/Test-USDtNFY1.js +1 -0
  47. package/dist/UserDetail-DpUL3mhk.mjs +1483 -0
  48. package/dist/UserDetail-KRIfxaYd.js +1 -0
  49. package/dist/cms-core-modules.css +1 -1
  50. package/dist/dateRangePresets-CaPVagHY.mjs +453 -0
  51. package/dist/dateRangePresets-gxQCiZ6c.js +1 -0
  52. package/dist/index-6hZ6MYY6.js +1 -0
  53. package/dist/index-BVmmicu3.mjs +14 -0
  54. package/dist/index-CQuN5rKx.js +1 -0
  55. package/dist/index-ChHD_1Cf.js +144 -0
  56. package/dist/index-CnDGeInm.js +1 -0
  57. package/dist/index-CqDTc5Ig.mjs +20 -0
  58. package/dist/index-CvV4nVWI.js +1 -0
  59. package/dist/index-CyvvAdt4.js +1 -0
  60. package/dist/index-DH2z0W_w.mjs +19012 -0
  61. package/dist/index-DIRD7t5_.mjs +20 -0
  62. package/dist/index-DZKzj48V.mjs +17 -0
  63. package/dist/index-OJuBYR60.mjs +57 -0
  64. package/dist/index.cjs.js +1 -1
  65. package/dist/index.mjs +480 -103
  66. package/dist/orders-C_sz8J9b.js +1 -0
  67. package/dist/{orders-BfTLIm7U.mjs → orders-Cgdggzvx.mjs} +84 -84
  68. package/dist/server-handlers.cjs.js +1 -1
  69. package/dist/server-handlers.mjs +2696 -605
  70. package/dist/src/appointments/chat-components/AppointmentListTable.vue.d.ts +3 -0
  71. package/dist/src/appointments/index.d.ts +93 -3
  72. package/dist/src/appointments/reservation-summary.d.ts +48 -0
  73. package/dist/src/appointments/server.d.ts +1 -0
  74. package/dist/src/appointments/tools.d.ts +93 -3
  75. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Container.d.ts +1 -1
  76. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Row.d.ts +7 -0
  77. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Stack.d.ts +7 -0
  78. package/dist/src/contentManager/components/content-editor/tiptap-extensions/helpers/resizeHistory.d.ts +9 -0
  79. package/dist/src/contentManager/components/content-editor/tiptap-menus/ElementEditorMenu.vue.d.ts +3 -1
  80. package/dist/src/filezone/config.d.ts +31 -0
  81. package/dist/src/filezone/index.d.ts +43 -0
  82. package/dist/src/filezone/index.vue.d.ts +2 -0
  83. package/dist/src/filezone/metadata.d.ts +2 -0
  84. package/dist/src/filezone/pages/Overview.vue.d.ts +4 -0
  85. package/dist/src/filezone/permissions.d.ts +5 -0
  86. package/dist/src/filezone/routes.d.ts +5 -0
  87. package/dist/src/filezone/server.d.ts +36 -0
  88. package/dist/src/firebaseAuthManager/components/DeleteUserDialog.vue.d.ts +25 -0
  89. package/dist/src/firebaseAuthManager/components/ReasonActionDialog.vue.d.ts +23 -0
  90. package/dist/src/firebaseAuthManager/components/UserStatusBadge.vue.d.ts +5 -0
  91. package/dist/src/firebaseAuthManager/config.d.ts +151 -0
  92. package/dist/src/firebaseAuthManager/index.d.ts +163 -0
  93. package/dist/src/firebaseAuthManager/index.vue.d.ts +14 -0
  94. package/dist/src/firebaseAuthManager/metadata.d.ts +2 -0
  95. package/dist/src/firebaseAuthManager/pages/Overview.vue.d.ts +2 -0
  96. package/dist/src/firebaseAuthManager/pages/UserDetail.vue.d.ts +2 -0
  97. package/dist/src/firebaseAuthManager/permissions.d.ts +5 -0
  98. package/dist/src/firebaseAuthManager/routes.d.ts +5 -0
  99. package/dist/src/firebaseAuthManager/server.d.ts +162 -0
  100. package/dist/src/firebaseAuthManager/types.d.ts +84 -0
  101. package/dist/src/formBuilder/components/FormPreviewDialog.vue.d.ts +12 -0
  102. package/dist/src/formBuilder/components/FormStatusBadge.vue.d.ts +9 -0
  103. package/dist/src/formBuilder/config.d.ts +31 -0
  104. package/dist/src/formBuilder/index.d.ts +44 -0
  105. package/dist/src/formBuilder/index.vue.d.ts +14 -0
  106. package/dist/src/formBuilder/lib/forms.d.ts +11 -0
  107. package/dist/src/formBuilder/metadata.d.ts +2 -0
  108. package/dist/src/formBuilder/pages/Editor.vue.d.ts +2 -0
  109. package/dist/src/formBuilder/pages/Overview.vue.d.ts +2 -0
  110. package/dist/src/formBuilder/permissions.d.ts +5 -0
  111. package/dist/src/formBuilder/routes.d.ts +5 -0
  112. package/dist/src/formBuilder/server.d.ts +87 -0
  113. package/dist/src/formBuilder/tools.d.ts +1 -0
  114. package/dist/src/formBuilder/types.d.ts +46 -0
  115. package/dist/src/helpbot/composables/useHelpbotApi.d.ts +18 -0
  116. package/dist/src/helpbot/config.d.ts +17 -0
  117. package/dist/src/helpbot/index.d.ts +29 -0
  118. package/dist/src/helpbot/index.vue.d.ts +2 -0
  119. package/dist/src/helpbot/metadata.d.ts +2 -0
  120. package/dist/src/helpbot/pages/Knowledge.vue.d.ts +4 -0
  121. package/dist/src/helpbot/pages/Overview.vue.d.ts +2 -0
  122. package/dist/src/helpbot/pages/Test.vue.d.ts +4 -0
  123. package/dist/src/helpbot/permissions.d.ts +5 -0
  124. package/dist/src/helpbot/routes.d.ts +5 -0
  125. package/dist/src/helpbot/types.d.ts +42 -0
  126. package/dist/src/index.d.ts +5 -0
  127. package/dist/src/mailTemplates/builder-types.d.ts +40 -0
  128. package/dist/src/mailTemplates/components/BlockRenderer.vue.d.ts +24 -0
  129. package/dist/src/mailTemplates/components/DesignPanel.vue.d.ts +13 -0
  130. package/dist/src/mailTemplates/components/EmailCanvas.vue.d.ts +44 -0
  131. package/dist/src/mailTemplates/components/RichTextEditor.vue.d.ts +10 -0
  132. package/dist/src/mailTemplates/components/RightSidebar.vue.d.ts +18 -0
  133. package/dist/src/mailTemplates/components/SettingsPanel.vue.d.ts +15 -0
  134. package/dist/src/mailTemplates/components/TemplateBuilder.vue.d.ts +2 -0
  135. package/dist/src/mailTemplates/components/TemplateList.vue.d.ts +19 -1
  136. package/dist/src/mailTemplates/components/rich-text.d.ts +6 -0
  137. package/dist/src/mailTemplates/config.d.ts +10 -4
  138. package/dist/src/mailTemplates/defaults.d.ts +10 -0
  139. package/dist/src/mailTemplates/editor-state.d.ts +21 -0
  140. package/dist/src/mailTemplates/index.d.ts +11 -5
  141. package/dist/src/mailTemplates/index.vue.d.ts +2 -4
  142. package/dist/src/mailTemplates/metadata.d.ts +1 -1
  143. package/dist/src/mailTemplates/pages/Detail.vue.d.ts +1 -13
  144. package/dist/src/mailTemplates/pages/Overview.vue.d.ts +1 -13
  145. package/dist/src/mailTemplates/server.d.ts +23 -0
  146. package/dist/src/server-handlers.d.ts +6 -0
  147. package/dist/src/table/badge-filter-utils.d.ts +8 -0
  148. package/dist/src/table/chat-components/TableOverviewCard.vue.d.ts +2 -7
  149. package/dist/src/table/chat-components/TableResultView.vue.d.ts +3 -7
  150. package/dist/src/table/components/TableDisplayCell.vue.d.ts +8 -0
  151. package/dist/src/table/components/columns/BadgeColumnSettings.vue.d.ts +9 -0
  152. package/dist/src/table/components/columns/ColumnColorSelect.vue.d.ts +11 -0
  153. package/dist/src/table/components/columns/ColumnDisplaySettings.vue.d.ts +9 -0
  154. package/dist/src/table/components/columns/ColumnTypeSelect.vue.d.ts +11 -0
  155. package/dist/src/table/components/columns/ColumnValueSourceInput.vue.d.ts +15 -0
  156. package/dist/src/table/components/columns/DialogTableColumnItem.vue.d.ts +8 -11
  157. package/dist/src/table/components/columns/ProgressColumnSettings.vue.d.ts +8 -0
  158. package/dist/src/table/components/stats/StatDialog.vue.d.ts +6 -10
  159. package/dist/src/table/components/stats/Stats.vue.d.ts +9 -15
  160. package/dist/src/table/composables/useTableClock.d.ts +4 -0
  161. package/dist/src/table/display-utils.d.ts +35 -0
  162. package/dist/src/table/row-value.d.ts +1 -0
  163. package/dist/src/table/stat-utils.d.ts +9 -0
  164. package/dist/src/table/tool-utils.d.ts +1 -1
  165. package/dist/src/table/types.d.ts +54 -1
  166. package/dist/src/whatsappBusiness/analytics.d.ts +4 -0
  167. package/dist/src/whatsappBusiness/components/AccountPanel.vue.d.ts +2 -0
  168. package/dist/src/whatsappBusiness/components/InsightsPanel.vue.d.ts +5 -0
  169. package/dist/src/whatsappBusiness/components/TemplateDialog.vue.d.ts +14 -0
  170. package/dist/src/whatsappBusiness/components/TemplatesPanel.vue.d.ts +5 -0
  171. package/dist/src/whatsappBusiness/components/presentation.d.ts +4 -0
  172. package/dist/src/whatsappBusiness/config.d.ts +51 -0
  173. package/dist/src/whatsappBusiness/connection.d.ts +77 -0
  174. package/dist/src/whatsappBusiness/index.d.ts +63 -0
  175. package/dist/src/whatsappBusiness/index.vue.d.ts +5 -0
  176. package/dist/src/whatsappBusiness/metadata.d.ts +2 -0
  177. package/dist/src/whatsappBusiness/pages/Overview.vue.d.ts +2 -0
  178. package/dist/src/whatsappBusiness/permissions.d.ts +5 -0
  179. package/dist/src/whatsappBusiness/provider.d.ts +21 -0
  180. package/dist/src/whatsappBusiness/routes.d.ts +5 -0
  181. package/dist/src/whatsappBusiness/server.d.ts +14 -0
  182. package/dist/src/whatsappBusiness/templates.d.ts +94 -0
  183. package/dist/src/whatsappBusiness/types.d.ts +162 -0
  184. package/dist/{tool-sandbox-DoF1PsyS.js → tool-sandbox-BSkKdH7V.js} +1 -1
  185. package/dist/{tool-sandbox-DdkMLkDK.mjs → tool-sandbox-DU9b1B7v.mjs} +1 -1
  186. package/dist/types-9N-DKxNj.mjs +250 -0
  187. package/dist/types-B5MifmeF.mjs +2696 -0
  188. package/dist/types-Cem0vPo_.js +1 -0
  189. package/dist/types-D5dgTskW.js +1 -0
  190. package/dist/useHelpbotApi-BIIungOh.js +1 -0
  191. package/dist/useHelpbotApi-HC9JSiSn.mjs +229 -0
  192. package/dist/{useTableAgentTools-D5mzGf3A.js → useTableAgentTools-BrUot49I.js} +1 -1
  193. package/dist/{useTableAgentTools-DcN3kYRL.mjs → useTableAgentTools-r5InEI4p.mjs} +8 -8
  194. package/dist/vee-validate-zod-CWZwNTWE.js +1 -0
  195. package/dist/vee-validate-zod-D0WaDgDZ.mjs +1780 -0
  196. package/package.json +2 -2
  197. package/src/appointments/tools.ts +52 -2
  198. package/src/formBuilder/tools.ts +1 -0
  199. package/dist/AppointmentListTable-DZJNmTMb.mjs +0 -177
  200. package/dist/AppointmentListTable-Dieu9US_.js +0 -1
  201. package/dist/ContentEditor-C-Wm48ai.js +0 -467
  202. package/dist/Detail-BCUUNWvp.js +0 -1
  203. package/dist/Detail-Byk781b4.mjs +0 -26
  204. package/dist/Detail-DGg_xXZc.js +0 -1
  205. package/dist/Detail-Sc2qZdxj.js +0 -1
  206. package/dist/Detail-mvSGbnFU.js +0 -1
  207. package/dist/Overview-BDlBCUI_.js +0 -1
  208. package/dist/Overview-Su8ZUbMs.mjs +0 -26
  209. package/dist/TableDataWidget-7qvC3Egd.js +0 -1
  210. package/dist/TableDataWidget-DMTSoGRO.mjs +0 -121
  211. package/dist/TableOverviewCard-AFq-puJs.js +0 -1
  212. package/dist/TableResultView.vue_vue_type_script_setup_true_lang-CBn-Oxl9.mjs +0 -534
  213. package/dist/TableResultView.vue_vue_type_script_setup_true_lang-C_Lv-SmJ.js +0 -1
  214. package/dist/TableRowActionCard-IzB6tNN-.js +0 -1
  215. package/dist/TableView-BkwoKREo.js +0 -4
  216. package/dist/TableView-C4Zyp8d7.mjs +0 -8228
  217. package/dist/TemplateList.vue_vue_type_script_setup_true_lang-B_AtWnHa.js +0 -1
  218. package/dist/TemplateList.vue_vue_type_script_setup_true_lang-Cmovy7kk.mjs +0 -40
  219. package/dist/dateRangePresets-B-l5b_wR.mjs +0 -48
  220. package/dist/dateRangePresets-CPWqst_x.js +0 -1
  221. package/dist/orders-DUa2PVoa.js +0 -1
  222. package/dist/vee-validate-zod-SjDT8X35.mjs +0 -4404
  223. package/dist/vee-validate-zod-VCmLnrtQ.js +0 -1
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),g=require("lucide-vue-next"),T={class:"w-full"},j={key:0,class:"flex items-center gap-2 py-3"},P={key:1,class:"text-xs text-destructive py-2"},A={key:2,class:"rounded-xl border bg-background overflow-hidden"},L={key:0,class:"border-b px-3 py-3 space-y-1"},F={class:"text-sm font-medium"},R={class:"text-muted-foreground font-normal"},M={class:"text-xs text-muted-foreground"},q={key:1},z={key:1,class:"p-4 text-center"},U={class:"text-sm text-muted-foreground"},K={key:2,class:"overflow-x-auto"},O={class:"w-full text-xs"},Z={key:0,class:"sr-only"},J={class:"border-b bg-muted/40"},G={key:0,scope:"col",class:"text-left px-3 py-2 font-medium text-muted-foreground"},H=["onClick"],Q={key:0,class:"whitespace-nowrap px-3 py-2 text-muted-foreground"},W={class:"px-3 py-2"},X=["href","aria-label","onClick"],Y={class:"font-medium truncate max-w-[160px]"},ee={class:"text-muted-foreground truncate max-w-[160px]"},te={class:"font-medium truncate max-w-[160px]"},re={class:"text-muted-foreground truncate max-w-[160px]"},oe={class:"px-3 py-2 whitespace-nowrap"},ne={class:"px-3 py-2 whitespace-nowrap"},se={class:"px-3 py-2 text-center"},ae={class:"px-3 py-2"},le={class:"px-3 py-2 text-right font-medium whitespace-nowrap"},ie={key:3,class:"px-3 py-2 border-t bg-muted/20 flex flex-wrap gap-2 items-center justify-between"},de={class:"text-xs text-muted-foreground"},ce=e.defineComponent({__name:"AppointmentListTable",props:{toolName:{},instanceId:{},instanceName:{},projectSlug:{},moduleType:{},resolvedArgs:{},status:{},executionMode:{},result:{}},emits:["submit"],setup(x,{emit:b}){const{$useRoute:_,$useRouter:E,$useModuleApi:V}=useNuxtApp(),s=x,D=b,y=_(),k=E(),v=e.computed(()=>s.projectSlug||y.params.slug),w=V(s.instanceId),u=e.computed(()=>s.executionMode==="api"||s.toolName==="getReservationSummary"),d=e.ref(!0),i=e.ref(null),l=e.ref([]),n=e.ref(null);e.watch(()=>[s.result,s.status,u.value],()=>{if(u.value&&(l.value=[],n.value=null,i.value=null,d.value=s.status==="pending"||s.status==="running",!d.value)){if(s.status==="error"){i.value="Could not load reservations. Please try asking again.";return}try{const o=typeof s.result=="string"?JSON.parse(s.result):s.result;if(!o||typeof o!="object"||!Array.isArray(o.appointments))throw new Error("Missing saved reservations");n.value=o,l.value=o.appointments}catch{i.value="Reservation details are unavailable for this result. Please ask for the reservations again."}}},{immediate:!0});async function B(){const o=s.resolvedArgs?.quantity||20,t=s.resolvedArgs?.status||"confirmed";d.value=!0,i.value=null;try{const a=await w.get(`/appointments?quantity=${o}&status=${t}`);l.value=a.appointments||[],h({count:l.value.length,appointments:l.value.map(r=>({orderId:r.orderId,agendaId:r.agendaId,reservationId:r.reservationId,customerName:`${r.customerInfo?.firstName||""} ${r.customerInfo?.lastName||""}`.trim(),email:r.customerInfo?.email,date:r.date,startTime:r.startTime,endTime:r.endTime,spots:r.spots,status:r.reservationStatus||r.status,price:r.reservationPrice}))})}catch(a){i.value=a?.data?.statusMessage||a?.message||"Failed to load appointments",h(`Error loading appointments: ${i.value}`)}finally{d.value=!1}}e.onMounted(()=>{u.value||B()});function h(o){!u.value&&s.status!=="completed"&&D("submit",o)}function m(o){const t=[v.value,s.instanceId,o.agendaId,o.orderId,o.reservationId];if(t.some(p=>typeof p!="string"||!p))return;const[a,r,f]=t.map(p=>encodeURIComponent(p)),c=new URLSearchParams({orderId:o.orderId,reservationId:o.reservationId});return`/projects/${a}/modules/${r}/edit/${f}/orders?${c}`}function N(o,t){const a=m(o);if(!(!a||t.defaultPrevented||t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey)){if(t.preventDefault(),k.resolve(a).fullPath===y.fullPath){window.location.assign(a);return}k.push(a)}}const S=(o,t)=>{if(t!=="confirmed")switch(t){case"pending":return"text-amber-600 dark:text-amber-400 bg-amber-50 dark:bg-amber-900/20";case"cancelled":return"text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20";default:return"text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20"}switch(o||t){case"approved":return"text-emerald-600 dark:text-emerald-400 bg-emerald-50 dark:bg-emerald-900/20";case"needs_approval":return"text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20";case"rejected":case"cancelled":return"text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20";default:return"text-amber-600 dark:text-amber-400 bg-amber-50 dark:bg-amber-900/20"}},C=(o,t)=>{if(t!=="confirmed")switch(t){case"pending":return"Pending";case"cancelled":return"Cancelled";default:return t||"Unknown"}switch(o||t){case"approved":return"Approved";case"needs_approval":return"Needs Approval";case"rejected":return"Rejected";case"cancelled":return"Cancelled";case"confirmed":return"Confirmed";default:return o||t||"Pending"}},I=o=>{if(o==null)return"—";const t=Number(o);return Number.isFinite(t)?`€${t.toFixed(2)}`:"—"},$=o=>{if(!o)return"—";try{return new Date(`${o}T00:00:00Z`).toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric",timeZone:"UTC"})}catch{return o}};return(o,t)=>{const a=e.resolveComponent("NuxtLink");return e.openBlock(),e.createElementBlock("div",T,[e.unref(d)?(e.openBlock(),e.createElementBlock("div",j,[e.createVNode(e.unref(g.Loader2),{class:"size-4 animate-spin text-muted-foreground"}),t[0]||(t[0]=e.createElementVNode("span",{class:"text-xs text-muted-foreground"},"Loading appointments…",-1))])):e.unref(i)?(e.openBlock(),e.createElementBlock("div",P,e.toDisplayString(e.unref(i)),1)):(e.openBlock(),e.createElementBlock("div",A,[e.unref(n)?(e.openBlock(),e.createElementBlock("div",L,[e.createElementVNode("p",F,[e.createTextVNode(e.toDisplayString(e.unref(n).reservationCount)+" reservation"+e.toDisplayString(e.unref(n).reservationCount===1?"":"s")+" ",1),e.createElementVNode("span",R," · "+e.toDisplayString(e.unref(n).orderCount)+" order"+e.toDisplayString(e.unref(n).orderCount===1?"":"s")+" · "+e.toDisplayString(e.unref(n).spotCount)+" spot"+e.toDisplayString(e.unref(n).spotCount===1?"":"s"),1)]),e.createElementVNode("p",M,[e.createTextVNode(e.toDisplayString(e.unref(n).startDate),1),e.unref(n).endDate!==e.unref(n).startDate?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(" – "+e.toDisplayString(e.unref(n).endDate),1)],64)):e.createCommentVNode("",!0),e.unref(n).timeZone?(e.openBlock(),e.createElementBlock("span",q," · "+e.toDisplayString(e.unref(n).timeZone),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.unref(l).length===0?(e.openBlock(),e.createElementBlock("div",z,[e.createVNode(e.unref(g.CalendarDays),{class:"size-8 text-muted-foreground mx-auto mb-2"}),e.createElementVNode("p",U,e.toDisplayString(e.unref(n)?e.unref(n).reservationCount===0?"No reservations match these dates and filters.":"No more reservations on this page.":"No recent appointments found."),1)])):(e.openBlock(),e.createElementBlock("div",K,[e.createElementVNode("table",O,[e.unref(n)?(e.openBlock(),e.createElementBlock("caption",Z,"Reservations from "+e.toDisplayString(e.unref(n).startDate)+" through "+e.toDisplayString(e.unref(n).endDate),1)):e.createCommentVNode("",!0),e.createElementVNode("thead",null,[e.createElementVNode("tr",J,[e.unref(n)?(e.openBlock(),e.createElementBlock("th",G,"#")):e.createCommentVNode("",!0),t[1]||(t[1]=e.createElementVNode("th",{class:"text-left px-3 py-2 font-medium text-muted-foreground"},"Customer",-1)),t[2]||(t[2]=e.createElementVNode("th",{class:"text-left px-3 py-2 font-medium text-muted-foreground"},"Date",-1)),t[3]||(t[3]=e.createElementVNode("th",{class:"text-left px-3 py-2 font-medium text-muted-foreground"},"Time",-1)),t[4]||(t[4]=e.createElementVNode("th",{class:"whitespace-nowrap text-center px-3 py-2 font-medium text-muted-foreground"},"Spots",-1)),t[5]||(t[5]=e.createElementVNode("th",{class:"text-left px-3 py-2 font-medium text-muted-foreground"},"Status",-1)),t[6]||(t[6]=e.createElementVNode("th",{class:"text-right px-3 py-2 font-medium text-muted-foreground"},"Price",-1))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(l),(r,f)=>(e.openBlock(),e.createElementBlock("tr",{key:`${r.orderId}:${r.reservationId||f}`,class:e.normalizeClass(["border-b last:border-b-0 hover:bg-muted/30 focus-within:bg-muted/30 transition-colors",{"cursor-pointer":m(r)}]),onClick:c=>N(r,c)},[e.unref(n)?(e.openBlock(),e.createElementBlock("td",Q,e.toDisplayString((e.unref(n).pagination?.offset||0)+f+1),1)):e.createCommentVNode("",!0),e.createElementVNode("td",W,[m(r)?(e.openBlock(),e.createElementBlock("a",{key:0,href:m(r),class:"block rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary hover:underline","aria-label":`Open reservation for ${[r.customerInfo?.firstName,r.customerInfo?.lastName].filter(Boolean).join(" ")||"this reservation"}`,onClick:e.withModifiers(c=>N(r,c),["stop"])},[e.createElementVNode("div",Y,e.toDisplayString(r.customerInfo?.firstName)+" "+e.toDisplayString(r.customerInfo?.lastName),1),e.createElementVNode("div",ee,e.toDisplayString(r.customerInfo?.email),1)],8,X)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",te,e.toDisplayString(r.customerInfo?.firstName)+" "+e.toDisplayString(r.customerInfo?.lastName),1),e.createElementVNode("div",re,e.toDisplayString(r.customerInfo?.email),1)],64))]),e.createElementVNode("td",oe,e.toDisplayString($(r.date)),1),e.createElementVNode("td",ne,e.toDisplayString(r.startTime)+" – "+e.toDisplayString(r.endTime),1),e.createElementVNode("td",se,e.toDisplayString(r.spots??1),1),e.createElementVNode("td",ae,[e.createElementVNode("span",{class:e.normalizeClass(["inline-block text-[10px] font-medium px-1.5 py-0.5 rounded-full uppercase whitespace-nowrap",S(r.reservationStatus,r.status)])},e.toDisplayString(C(r.reservationStatus,r.status)),3)]),e.createElementVNode("td",le,e.toDisplayString(I(r.reservationPrice)),1)],10,H))),128))])])])),e.unref(l).length>0?(e.openBlock(),e.createElementBlock("div",ie,[e.createElementVNode("span",de,[e.unref(n)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(" Showing "+e.toDisplayString((e.unref(n).pagination?.offset||0)+1)+"–"+e.toDisplayString((e.unref(n).pagination?.offset||0)+e.unref(l).length)+" of "+e.toDisplayString(e.unref(n).reservationCount)+" reservations ",1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(e.unref(l).length)+" appointment"+e.toDisplayString(e.unref(l).length===1?"":"s"),1)],64))]),e.createVNode(a,{to:`/projects/${e.unref(v)}/modules/${x.instanceId}`,class:"inline-flex items-center gap-1.5 text-xs text-primary hover:underline"},{default:e.withCtx(()=>[e.createVNode(e.unref(g.ExternalLink),{class:"size-3"}),t[7]||(t[7]=e.createTextVNode(" View all ",-1))]),_:1},8,["to"])])):e.createCommentVNode("",!0)]))])}}});exports.default=ce;
@@ -0,0 +1,270 @@
1
+ import { defineComponent as K, computed as A, ref as k, watch as Z, onMounted as B, resolveComponent as O, openBlock as i, createElementBlock as d, unref as s, createVNode as w, createElementVNode as a, toDisplayString as o, createTextVNode as p, Fragment as v, createCommentVNode as f, renderList as J, normalizeClass as P, withModifiers as G, withCtx as H } from "vue";
2
+ import { Loader2 as Q, CalendarDays as W, ExternalLink as X } from "lucide-vue-next";
3
+ const Y = { class: "w-full" }, ee = {
4
+ key: 0,
5
+ class: "flex items-center gap-2 py-3"
6
+ }, te = {
7
+ key: 1,
8
+ class: "text-xs text-destructive py-2"
9
+ }, se = {
10
+ key: 2,
11
+ class: "rounded-xl border bg-background overflow-hidden"
12
+ }, re = {
13
+ key: 0,
14
+ class: "border-b px-3 py-3 space-y-1"
15
+ }, oe = { class: "text-sm font-medium" }, ne = { class: "text-muted-foreground font-normal" }, ae = { class: "text-xs text-muted-foreground" }, ie = { key: 1 }, de = {
16
+ key: 1,
17
+ class: "p-4 text-center"
18
+ }, ue = { class: "text-sm text-muted-foreground" }, le = {
19
+ key: 2,
20
+ class: "overflow-x-auto"
21
+ }, ce = { class: "w-full text-xs" }, me = {
22
+ key: 0,
23
+ class: "sr-only"
24
+ }, fe = { class: "border-b bg-muted/40" }, pe = {
25
+ key: 0,
26
+ scope: "col",
27
+ class: "text-left px-3 py-2 font-medium text-muted-foreground"
28
+ }, xe = ["onClick"], ge = {
29
+ key: 0,
30
+ class: "whitespace-nowrap px-3 py-2 text-muted-foreground"
31
+ }, ve = { class: "px-3 py-2" }, he = ["href", "aria-label", "onClick"], ye = { class: "font-medium truncate max-w-[160px]" }, be = { class: "text-muted-foreground truncate max-w-[160px]" }, _e = { class: "font-medium truncate max-w-[160px]" }, ke = { class: "text-muted-foreground truncate max-w-[160px]" }, we = { class: "px-3 py-2 whitespace-nowrap" }, Ie = { class: "px-3 py-2 whitespace-nowrap" }, Ce = { class: "px-3 py-2 text-center" }, Ne = { class: "px-3 py-2" }, $e = { class: "px-3 py-2 text-right font-medium whitespace-nowrap" }, De = {
32
+ key: 3,
33
+ class: "px-3 py-2 border-t bg-muted/20 flex flex-wrap gap-2 items-center justify-between"
34
+ }, je = { class: "text-xs text-muted-foreground" }, Te = /* @__PURE__ */ K({
35
+ __name: "AppointmentListTable",
36
+ props: {
37
+ toolName: {},
38
+ instanceId: {},
39
+ instanceName: {},
40
+ projectSlug: {},
41
+ moduleType: {},
42
+ resolvedArgs: {},
43
+ status: {},
44
+ executionMode: {},
45
+ result: {}
46
+ },
47
+ emits: ["submit"],
48
+ setup(I, { emit: T }) {
49
+ const { $useRoute: L, $useRouter: R, $useModuleApi: M } = useNuxtApp(), u = I, S = T, C = L(), N = R(), $ = A(() => u.projectSlug || C.params.slug), E = M(u.instanceId), h = A(() => u.executionMode === "api" || u.toolName === "getReservationSummary"), x = k(!0), m = k(null), c = k([]), n = k(null);
50
+ Z(() => [u.result, u.status, h.value], () => {
51
+ if (h.value && (c.value = [], n.value = null, m.value = null, x.value = u.status === "pending" || u.status === "running", !x.value)) {
52
+ if (u.status === "error") {
53
+ m.value = "Could not load reservations. Please try asking again.";
54
+ return;
55
+ }
56
+ try {
57
+ const r = typeof u.result == "string" ? JSON.parse(u.result) : u.result;
58
+ if (!r || typeof r != "object" || !Array.isArray(r.appointments))
59
+ throw new Error("Missing saved reservations");
60
+ n.value = r, c.value = r.appointments;
61
+ } catch {
62
+ m.value = "Reservation details are unavailable for this result. Please ask for the reservations again.";
63
+ }
64
+ }
65
+ }, { immediate: !0 });
66
+ async function F() {
67
+ const r = u.resolvedArgs?.quantity || 20, e = u.resolvedArgs?.status || "confirmed";
68
+ x.value = !0, m.value = null;
69
+ try {
70
+ const l = await E.get(`/appointments?quantity=${r}&status=${e}`);
71
+ c.value = l.appointments || [], D({
72
+ count: c.value.length,
73
+ appointments: c.value.map((t) => ({
74
+ orderId: t.orderId,
75
+ agendaId: t.agendaId,
76
+ reservationId: t.reservationId,
77
+ customerName: `${t.customerInfo?.firstName || ""} ${t.customerInfo?.lastName || ""}`.trim(),
78
+ email: t.customerInfo?.email,
79
+ date: t.date,
80
+ startTime: t.startTime,
81
+ endTime: t.endTime,
82
+ spots: t.spots,
83
+ status: t.reservationStatus || t.status,
84
+ price: t.reservationPrice
85
+ }))
86
+ });
87
+ } catch (l) {
88
+ m.value = l?.data?.statusMessage || l?.message || "Failed to load appointments", D(`Error loading appointments: ${m.value}`);
89
+ } finally {
90
+ x.value = !1;
91
+ }
92
+ }
93
+ B(() => {
94
+ h.value || F();
95
+ });
96
+ function D(r) {
97
+ !h.value && u.status !== "completed" && S("submit", r);
98
+ }
99
+ function y(r) {
100
+ const e = [$.value, u.instanceId, r.agendaId, r.orderId, r.reservationId];
101
+ if (e.some((_) => typeof _ != "string" || !_)) return;
102
+ const [l, t, b] = e.map((_) => encodeURIComponent(_)), g = new URLSearchParams({ orderId: r.orderId, reservationId: r.reservationId });
103
+ return `/projects/${l}/modules/${t}/edit/${b}/orders?${g}`;
104
+ }
105
+ function j(r, e) {
106
+ const l = y(r);
107
+ if (!(!l || e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey)) {
108
+ if (e.preventDefault(), N.resolve(l).fullPath === C.fullPath) {
109
+ window.location.assign(l);
110
+ return;
111
+ }
112
+ N.push(l);
113
+ }
114
+ }
115
+ const U = (r, e) => {
116
+ if (e !== "confirmed")
117
+ switch (e) {
118
+ case "pending":
119
+ return "text-amber-600 dark:text-amber-400 bg-amber-50 dark:bg-amber-900/20";
120
+ case "cancelled":
121
+ return "text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20";
122
+ default:
123
+ return "text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20";
124
+ }
125
+ switch (r || e) {
126
+ case "approved":
127
+ return "text-emerald-600 dark:text-emerald-400 bg-emerald-50 dark:bg-emerald-900/20";
128
+ case "needs_approval":
129
+ return "text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20";
130
+ case "rejected":
131
+ case "cancelled":
132
+ return "text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20";
133
+ default:
134
+ return "text-amber-600 dark:text-amber-400 bg-amber-50 dark:bg-amber-900/20";
135
+ }
136
+ }, V = (r, e) => {
137
+ if (e !== "confirmed")
138
+ switch (e) {
139
+ case "pending":
140
+ return "Pending";
141
+ case "cancelled":
142
+ return "Cancelled";
143
+ default:
144
+ return e || "Unknown";
145
+ }
146
+ switch (r || e) {
147
+ case "approved":
148
+ return "Approved";
149
+ case "needs_approval":
150
+ return "Needs Approval";
151
+ case "rejected":
152
+ return "Rejected";
153
+ case "cancelled":
154
+ return "Cancelled";
155
+ case "confirmed":
156
+ return "Confirmed";
157
+ default:
158
+ return r || e || "Pending";
159
+ }
160
+ }, q = (r) => {
161
+ if (r == null) return "—";
162
+ const e = Number(r);
163
+ return Number.isFinite(e) ? `€${e.toFixed(2)}` : "—";
164
+ }, z = (r) => {
165
+ if (!r) return "—";
166
+ try {
167
+ return (/* @__PURE__ */ new Date(`${r}T00:00:00Z`)).toLocaleDateString("en-US", { weekday: "short", month: "short", day: "numeric", timeZone: "UTC" });
168
+ } catch {
169
+ return r;
170
+ }
171
+ };
172
+ return (r, e) => {
173
+ const l = O("NuxtLink");
174
+ return i(), d("div", Y, [
175
+ s(x) ? (i(), d("div", ee, [
176
+ w(s(Q), { class: "size-4 animate-spin text-muted-foreground" }),
177
+ e[0] || (e[0] = a("span", { class: "text-xs text-muted-foreground" }, "Loading appointments…", -1))
178
+ ])) : s(m) ? (i(), d("div", te, o(s(m)), 1)) : (i(), d("div", se, [
179
+ s(n) ? (i(), d("div", re, [
180
+ a("p", oe, [
181
+ p(o(s(n).reservationCount) + " reservation" + o(s(n).reservationCount === 1 ? "" : "s") + " ", 1),
182
+ a("span", ne, " · " + o(s(n).orderCount) + " order" + o(s(n).orderCount === 1 ? "" : "s") + " · " + o(s(n).spotCount) + " spot" + o(s(n).spotCount === 1 ? "" : "s"), 1)
183
+ ]),
184
+ a("p", ae, [
185
+ p(o(s(n).startDate), 1),
186
+ s(n).endDate !== s(n).startDate ? (i(), d(v, { key: 0 }, [
187
+ p(" – " + o(s(n).endDate), 1)
188
+ ], 64)) : f("", !0),
189
+ s(n).timeZone ? (i(), d("span", ie, " · " + o(s(n).timeZone), 1)) : f("", !0)
190
+ ])
191
+ ])) : f("", !0),
192
+ s(c).length === 0 ? (i(), d("div", de, [
193
+ w(s(W), { class: "size-8 text-muted-foreground mx-auto mb-2" }),
194
+ a("p", ue, o(s(n) ? s(n).reservationCount === 0 ? "No reservations match these dates and filters." : "No more reservations on this page." : "No recent appointments found."), 1)
195
+ ])) : (i(), d("div", le, [
196
+ a("table", ce, [
197
+ s(n) ? (i(), d("caption", me, "Reservations from " + o(s(n).startDate) + " through " + o(s(n).endDate), 1)) : f("", !0),
198
+ a("thead", null, [
199
+ a("tr", fe, [
200
+ s(n) ? (i(), d("th", pe, "#")) : f("", !0),
201
+ e[1] || (e[1] = a("th", { class: "text-left px-3 py-2 font-medium text-muted-foreground" }, "Customer", -1)),
202
+ e[2] || (e[2] = a("th", { class: "text-left px-3 py-2 font-medium text-muted-foreground" }, "Date", -1)),
203
+ e[3] || (e[3] = a("th", { class: "text-left px-3 py-2 font-medium text-muted-foreground" }, "Time", -1)),
204
+ e[4] || (e[4] = a("th", { class: "whitespace-nowrap text-center px-3 py-2 font-medium text-muted-foreground" }, "Spots", -1)),
205
+ e[5] || (e[5] = a("th", { class: "text-left px-3 py-2 font-medium text-muted-foreground" }, "Status", -1)),
206
+ e[6] || (e[6] = a("th", { class: "text-right px-3 py-2 font-medium text-muted-foreground" }, "Price", -1))
207
+ ])
208
+ ]),
209
+ a("tbody", null, [
210
+ (i(!0), d(v, null, J(s(c), (t, b) => (i(), d("tr", {
211
+ key: `${t.orderId}:${t.reservationId || b}`,
212
+ class: P(["border-b last:border-b-0 hover:bg-muted/30 focus-within:bg-muted/30 transition-colors", { "cursor-pointer": y(t) }]),
213
+ onClick: (g) => j(t, g)
214
+ }, [
215
+ s(n) ? (i(), d("td", ge, o((s(n).pagination?.offset || 0) + b + 1), 1)) : f("", !0),
216
+ a("td", ve, [
217
+ y(t) ? (i(), d("a", {
218
+ key: 0,
219
+ href: y(t),
220
+ class: "block rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary hover:underline",
221
+ "aria-label": `Open reservation for ${[t.customerInfo?.firstName, t.customerInfo?.lastName].filter(Boolean).join(" ") || "this reservation"}`,
222
+ onClick: G((g) => j(t, g), ["stop"])
223
+ }, [
224
+ a("div", ye, o(t.customerInfo?.firstName) + " " + o(t.customerInfo?.lastName), 1),
225
+ a("div", be, o(t.customerInfo?.email), 1)
226
+ ], 8, he)) : (i(), d(v, { key: 1 }, [
227
+ a("div", _e, o(t.customerInfo?.firstName) + " " + o(t.customerInfo?.lastName), 1),
228
+ a("div", ke, o(t.customerInfo?.email), 1)
229
+ ], 64))
230
+ ]),
231
+ a("td", we, o(z(t.date)), 1),
232
+ a("td", Ie, o(t.startTime) + " – " + o(t.endTime), 1),
233
+ a("td", Ce, o(t.spots ?? 1), 1),
234
+ a("td", Ne, [
235
+ a("span", {
236
+ class: P(["inline-block text-[10px] font-medium px-1.5 py-0.5 rounded-full uppercase whitespace-nowrap", U(t.reservationStatus, t.status)])
237
+ }, o(V(t.reservationStatus, t.status)), 3)
238
+ ]),
239
+ a("td", $e, o(q(t.reservationPrice)), 1)
240
+ ], 10, xe))), 128))
241
+ ])
242
+ ])
243
+ ])),
244
+ s(c).length > 0 ? (i(), d("div", De, [
245
+ a("span", je, [
246
+ s(n) ? (i(), d(v, { key: 0 }, [
247
+ p(" Showing " + o((s(n).pagination?.offset || 0) + 1) + "–" + o((s(n).pagination?.offset || 0) + s(c).length) + " of " + o(s(n).reservationCount) + " reservations ", 1)
248
+ ], 64)) : (i(), d(v, { key: 1 }, [
249
+ p(o(s(c).length) + " appointment" + o(s(c).length === 1 ? "" : "s"), 1)
250
+ ], 64))
251
+ ]),
252
+ w(l, {
253
+ to: `/projects/${s($)}/modules/${I.instanceId}`,
254
+ class: "inline-flex items-center gap-1.5 text-xs text-primary hover:underline"
255
+ }, {
256
+ default: H(() => [
257
+ w(s(X), { class: "size-3" }),
258
+ e[7] || (e[7] = p(" View all ", -1))
259
+ ]),
260
+ _: 1
261
+ }, 8, ["to"])
262
+ ])) : f("", !0)
263
+ ]))
264
+ ]);
265
+ };
266
+ }
267
+ });
268
+ export {
269
+ Te as default
270
+ };