@oneclick.dev/cms-core-modules 0.0.115 → 0.0.117

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 (107) hide show
  1. package/dist/{Acquisition-FV3QpaUX.mjs → Acquisition-X5-eksDw.mjs} +2 -2
  2. package/dist/{Audience-ka0b7YPE.mjs → Audience-CXryJ8tc.mjs} +2 -2
  3. package/dist/{ContentEditor-C5yNNLeV.mjs → ContentEditor-CUe6-NwF.mjs} +17650 -14456
  4. package/dist/{ContentEditor-MctMvN7D.js → ContentEditor-DWoXc0T_.js} +52 -52
  5. package/dist/{Create-BXNLRQag.mjs → Create-BPA2ywrd.mjs} +1 -1
  6. package/dist/{DateFormatter-qbhRYxI_.mjs → DateFormatter-BkKoSf_l.mjs} +5 -5
  7. package/dist/{Detail-BCOcP2ql.mjs → Detail-C1Blq61w.mjs} +1 -1
  8. package/dist/{Detail-ChD5XurA.mjs → Detail-CfsPwl4s.mjs} +17 -17
  9. package/dist/{Detail-DnX7tsqN.mjs → Detail-CtItxMX4.mjs} +1 -1
  10. package/dist/{Detail-Btzwo0Y3.mjs → Detail-Dnpnmy4-.mjs} +1 -1
  11. package/dist/EditLayout.vue_vue_type_script_setup_true_lang-gozJKXvM.js +1 -0
  12. package/dist/EditLayout.vue_vue_type_script_setup_true_lang-pDO9b4Pv.mjs +77 -0
  13. package/dist/{Find-zN_dKz4p.mjs → Find-BAvaNf90.mjs} +1 -1
  14. package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-BXTkYCm_.mjs +1476 -0
  15. package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-C2zwt5UF.js +1 -0
  16. package/dist/OrderDetailDialog.vue_vue_type_script_setup_true_lang-BYSeUW_V.js +925 -0
  17. package/dist/OrderDetailDialog.vue_vue_type_script_setup_true_lang-DwAUYR8p.mjs +5021 -0
  18. package/dist/{Overview-BR_y8x3W.mjs → Overview-BWLxUksJ.mjs} +1 -1
  19. package/dist/{Overview-MpgkLB6m.mjs → Overview-Bjvu9Lfc.mjs} +3 -3
  20. package/dist/Overview-CBahJviK.js +1 -0
  21. package/dist/Overview-CVQ1pkuD.mjs +527 -0
  22. package/dist/{SeoHealth-bVQj_Xgm.mjs → SeoHealth-I2mqiuLm.mjs} +3 -3
  23. package/dist/TableView-BQI3CWll.mjs +6234 -0
  24. package/dist/TableView-Cwal0BPW.js +4 -0
  25. package/dist/agenda-B3nj388v.mjs +1253 -0
  26. package/dist/agenda-Bev1mO7E.js +1 -0
  27. package/dist/availability-ClBGVgE9.js +1 -0
  28. package/dist/availability-D8JdA4rP.mjs +274 -0
  29. package/dist/booking-data-Px7XCIfU.mjs +1024 -0
  30. package/dist/booking-data-aMS1p_3g.js +1 -0
  31. package/dist/cms-core-modules.css +1 -1
  32. package/dist/exceptions-DXqc0Nza.js +1 -0
  33. package/dist/exceptions-Dgj54ULn.mjs +651 -0
  34. package/dist/{index-DZV720u-.mjs → index-52nwosIs.mjs} +45 -45
  35. package/dist/{index-CkVwMqpn.mjs → index-Bnn9LahC.mjs} +52 -52
  36. package/dist/{index-B8GvmAwh.mjs → index-DiTIA8Sh.mjs} +27 -27
  37. package/dist/index-Djp4EBb0.mjs +1245 -0
  38. package/dist/index-DliTZzwI.js +35 -0
  39. package/dist/{index-L54VBzwJ.mjs → index-ar4tbR3i.mjs} +8 -8
  40. package/dist/{index-BIF2RB7k.mjs → index-cC_2cw31.mjs} +4 -4
  41. package/dist/{index-CFzn2Lus.mjs → index-hMp4p5qA.mjs} +3 -3
  42. package/dist/index.cjs.js +1 -1
  43. package/dist/index.mjs +26 -25
  44. package/dist/{math-BJ-oX_IM.mjs → math-Bkw6u412.mjs} +11 -11
  45. package/dist/orders-1swJVKw2.js +1 -0
  46. package/dist/orders-D41GbzIa.mjs +624 -0
  47. package/dist/payment-BJHgpaeT.js +1 -0
  48. package/dist/payment-D5j-68Ig.mjs +1278 -0
  49. package/dist/refunds-D9nTeD2d.mjs +436 -0
  50. package/dist/refunds-oVB2Opib.js +1 -0
  51. package/dist/resources-8WouFvJe.js +1 -0
  52. package/dist/resources-CK0oWssj.mjs +975 -0
  53. package/dist/server-handlers.cjs.js +1 -1
  54. package/dist/server-handlers.mjs +626 -515
  55. package/dist/src/appointments/components/edit/EventDialog/BookingsList.vue.d.ts +146 -5
  56. package/dist/src/appointments/components/edit/EventDialog/CancelRefundReservationDialog.vue.d.ts +33 -0
  57. package/dist/src/appointments/components/edit/EventDialog/OrderDetailDialog.vue.d.ts +26 -8
  58. package/dist/src/appointments/components/edit/EventDialog/RefundDetailsDisplay.vue.d.ts +8 -0
  59. package/dist/src/appointments/components/edit/EventDialog/ReservationDetailDialog.vue.d.ts +91 -5
  60. package/dist/src/appointments/components/edit/EventDialog/TransferReservationDialog.vue.d.ts +20 -3
  61. package/dist/src/appointments/components/edit/NewReservationDialog/ReservationLines.vue.d.ts +5 -0
  62. package/dist/src/appointments/components/edit/OrderMetadataDisplay.vue.d.ts +20 -2
  63. package/dist/src/appointments/components/edit/dashboard/BookingsList.vue.d.ts +240 -0
  64. package/dist/src/appointments/composables/useAgendaMetadataSchema.d.ts +37 -0
  65. package/dist/src/appointments/pages/edit/orders.vue.d.ts +225 -0
  66. package/dist/src/appointments/pages/edit/refunds.vue.d.ts +2 -0
  67. package/dist/src/appointments/server.d.ts +2 -0
  68. package/dist/src/appointments/types.d.ts +6 -0
  69. package/dist/src/appointments/utils/printReservation.d.ts +65 -3
  70. package/dist/src/contentManager/components/content-editor/tiptap-extensions/table/Table.d.ts +36 -0
  71. package/dist/src/contentManager/components/content-editor/tiptap-extensions/table/Table.vue.d.ts +95 -0
  72. package/dist/src/contentManager/components/content-editor/tiptap-extensions/table/TableCell.d.ts +13 -0
  73. package/dist/src/contentManager/components/content-editor/tiptap-extensions/table/TableHeader.d.ts +6 -0
  74. package/dist/src/contentManager/components/content-editor/tiptap-extensions/table/TableRow.d.ts +6 -0
  75. package/dist/src/contentManager/components/content-editor/tiptap-extensions/table/index.d.ts +4 -0
  76. package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/TableMenu.vue.d.ts +13 -0
  77. package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/index.d.ts +14 -0
  78. package/dist/{vee-validate-zod-DNjTLCgh.mjs → vee-validate-zod-CcOwoF6y.mjs} +6 -6
  79. package/package.json +2 -2
  80. package/dist/EditLayout.vue_vue_type_script_setup_true_lang-DWMqQvHl.mjs +0 -76
  81. package/dist/EditLayout.vue_vue_type_script_setup_true_lang-kpjbVSXg.js +0 -1
  82. package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-Baqy-rTT.js +0 -1
  83. package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-Dx4Bpa2m.mjs +0 -1263
  84. package/dist/OrderDetailDialog.vue_vue_type_script_setup_true_lang-COrK1j0S.js +0 -1
  85. package/dist/OrderDetailDialog.vue_vue_type_script_setup_true_lang-Vb3q8EVv.mjs +0 -330
  86. package/dist/Overview-98nkJUWN.mjs +0 -481
  87. package/dist/Overview-Dl8cMlsr.js +0 -1
  88. package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-CuwREvXD.js +0 -349
  89. package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-GYNZ_yhD.mjs +0 -3077
  90. package/dist/TableView-CVfkyj1k.js +0 -4
  91. package/dist/TableView-zDx0IegJ.mjs +0 -6096
  92. package/dist/agenda-BaJu3-1c.js +0 -1
  93. package/dist/agenda-BwVY_8oM.mjs +0 -1165
  94. package/dist/availability-CMrRa5y2.mjs +0 -269
  95. package/dist/availability-Cf2YfMwM.js +0 -1
  96. package/dist/booking-data-DgJd0BcM.mjs +0 -889
  97. package/dist/booking-data-Di5GmH_8.js +0 -1
  98. package/dist/exceptions-B6P9UiCj.js +0 -1
  99. package/dist/exceptions-De9-FvdP.mjs +0 -646
  100. package/dist/index-DL6orwdK.js +0 -35
  101. package/dist/index-hH3e-IYz.mjs +0 -1187
  102. package/dist/orders-C65SlpJy.mjs +0 -618
  103. package/dist/orders-XVzWAgG1.js +0 -1
  104. package/dist/payment-C3ohkehF.mjs +0 -1080
  105. package/dist/payment-Dfr-Ro-a.js +0 -1
  106. package/dist/resources-CxeFd57z.js +0 -1
  107. package/dist/resources-DwYxn2Vi.mjs +0 -811
package/dist/index.mjs CHANGED
@@ -54,7 +54,7 @@ const I = "data:image/webp;base64,UklGRg5VAABXRUJQVlA4WAoAAAAMAAAA4wAA4wAAVlA4IJ
54
54
  default: !1
55
55
  }
56
56
  }), l = [
57
- { path: "", component: () => import("./TableView-zDx0IegJ.mjs") }
57
+ { path: "", component: () => import("./TableView-BQI3CWll.mjs") }
58
58
  ], p = [], rA = {
59
59
  component: () => import("./index-Bkq58CeQ.mjs"),
60
60
  metadata: C,
@@ -98,9 +98,9 @@ const I = "data:image/webp;base64,UklGRg5VAABXRUJQVlA4WAoAAAAMAAAA4wAA4wAAVlA4IJ
98
98
  default: "https://preview.com/shop/{{slug}}"
99
99
  }
100
100
  }), M = [
101
- { path: "", component: () => import("./Overview-BR_y8x3W.mjs") },
102
- { path: "/:productId", component: () => import("./Detail-Btzwo0Y3.mjs") },
103
- { path: "/new", component: () => import("./Detail-Btzwo0Y3.mjs") }
101
+ { path: "", component: () => import("./Overview-BWLxUksJ.mjs") },
102
+ { path: "/:productId", component: () => import("./Detail-Dnpnmy4-.mjs") },
103
+ { path: "/new", component: () => import("./Detail-Dnpnmy4-.mjs") }
104
104
  ], s = [
105
105
  { key: "create-product", name: "Create product", description: "Team member can create a new product" },
106
106
  { key: "edit-product", name: "Edit product", description: "Team member can edit a product" },
@@ -186,9 +186,9 @@ const I = "data:image/webp;base64,UklGRg5VAABXRUJQVlA4WAoAAAAMAAAA4wAA4wAAVlA4IJ
186
186
  default: "promo-codes"
187
187
  }
188
188
  }), y = [
189
- { path: "", component: () => import("./Create-BXNLRQag.mjs") },
190
- { path: "/promo-codes", component: () => import("./Find-zN_dKz4p.mjs") },
191
- { path: "/promo-codes/:promoCodeId", component: () => import("./Detail-ChD5XurA.mjs") }
189
+ { path: "", component: () => import("./Create-BPA2ywrd.mjs") },
190
+ { path: "/promo-codes", component: () => import("./Find-BAvaNf90.mjs") },
191
+ { path: "/promo-codes/:promoCodeId", component: () => import("./Detail-CfsPwl4s.mjs") }
192
192
  ], u = [
193
193
  { key: "create-promo-codes", name: "Create promo codes", description: "Team member can create promo codes" },
194
194
  { key: "view-promo-codes", name: "View promo codes", description: "Team member can view promo codes" },
@@ -227,8 +227,8 @@ const I = "data:image/webp;base64,UklGRg5VAABXRUJQVlA4WAoAAAAMAAAA4wAA4wAAVlA4IJ
227
227
  }
228
228
  }), P = [
229
229
  { path: "", component: () => import("./Overview-BCpJNiEB.mjs") },
230
- { path: "/:collectionId", component: () => import("./Detail-BCOcP2ql.mjs") },
231
- { path: "/new", component: () => import("./Detail-BCOcP2ql.mjs") }
230
+ { path: "/:collectionId", component: () => import("./Detail-C1Blq61w.mjs") },
231
+ { path: "/new", component: () => import("./Detail-C1Blq61w.mjs") }
232
232
  ], E = [
233
233
  { key: "create-collection", name: "Create product collection", description: "Team member can create a new product collection" },
234
234
  { key: "edit-collection", name: "Edit product collection", description: "Team member can edit a product collection" },
@@ -257,8 +257,8 @@ const I = "data:image/webp;base64,UklGRg5VAABXRUJQVlA4WAoAAAAMAAAA4wAA4wAAVlA4IJ
257
257
  }
258
258
  }), z = [
259
259
  { path: "", component: () => import("./Overview-CIa1E-HH.mjs") },
260
- { path: "/:optionId", component: () => import("./Detail-DnX7tsqN.mjs") },
261
- { path: "/new", component: () => import("./Detail-DnX7tsqN.mjs") }
260
+ { path: "/:optionId", component: () => import("./Detail-CtItxMX4.mjs") },
261
+ { path: "/new", component: () => import("./Detail-CtItxMX4.mjs") }
262
262
  ], k = [
263
263
  { key: "create-option", name: "Create shipping option", description: "Team member can create a new shipping option" },
264
264
  { key: "edit-option", name: "Edit shipping option", description: "Team member can edit a shipping option" },
@@ -293,11 +293,11 @@ const I = "data:image/webp;base64,UklGRg5VAABXRUJQVlA4WAoAAAAMAAAA4wAA4wAAVlA4IJ
293
293
  description: "Optional. When set, the module will fetch real keyword data from Google Search Console. Use the same site URL format as shown in Search Console."
294
294
  }
295
295
  }), x = [
296
- { path: "", component: () => import("./Overview-MpgkLB6m.mjs") },
297
- { path: "/acquisition", component: () => import("./Acquisition-FV3QpaUX.mjs") },
296
+ { path: "", component: () => import("./Overview-Bjvu9Lfc.mjs") },
297
+ { path: "/acquisition", component: () => import("./Acquisition-X5-eksDw.mjs") },
298
298
  { path: "/content", component: () => import("./Content-CYOZKvWK.mjs") },
299
- { path: "/audience", component: () => import("./Audience-ka0b7YPE.mjs") },
300
- { path: "/seo", component: () => import("./SeoHealth-bVQj_Xgm.mjs") }
299
+ { path: "/audience", component: () => import("./Audience-CXryJ8tc.mjs") },
300
+ { path: "/seo", component: () => import("./SeoHealth-I2mqiuLm.mjs") }
301
301
  ], K = [], S = [
302
302
  {
303
303
  name: "getTopPages",
@@ -557,7 +557,7 @@ const I = "data:image/webp;base64,UklGRg5VAABXRUJQVlA4WAoAAAAMAAAA4wAA4wAAVlA4IJ
557
557
  { path: "", component: () => import("./Overview-lWAyyenp.mjs") },
558
558
  { path: "/collections", component: () => import("./Overview-lWAyyenp.mjs") },
559
559
  { path: "/collections/:collectionId", component: () => import("./Entries-BdhUyJR5.mjs") },
560
- { path: "/collections/:collectionId/:entryId", component: () => import("./ContentEditor-C5yNNLeV.mjs") },
560
+ { path: "/collections/:collectionId/:entryId", component: () => import("./ContentEditor-CUe6-NwF.mjs") },
561
561
  { path: "/components", component: () => import("./Components-iU3ZaJm5.mjs") },
562
562
  { path: "/global-styling", component: () => import("./GlobalStyling-Bp2PiOWt.mjs") }
563
563
  ], q = [
@@ -632,19 +632,20 @@ const I = "data:image/webp;base64,UklGRg5VAABXRUJQVlA4WAoAAAAMAAAA4wAA4wAAVlA4IJ
632
632
  default: "reserved_spots"
633
633
  }
634
634
  }), tA = [
635
- { path: "", component: () => import("./Overview-98nkJUWN.mjs") },
635
+ { path: "", component: () => import("./Overview-CVQ1pkuD.mjs") },
636
636
  { path: "/create", component: () => import("./index-DrXxXB2F.mjs") },
637
637
  { path: "/create/regular", component: () => import("./regular-_05oq5Tx.mjs") },
638
638
  // { path: '/create/full-day', component: () => import('./pages/create/full-day.vue') },
639
639
  // { path: '/create/multi-day', component: () => import('./pages/create/multi-day.vue') },
640
- { path: "/edit/:id", component: () => import("./index-hH3e-IYz.mjs") },
641
- { path: "/edit/:id/agenda", component: () => import("./agenda-BwVY_8oM.mjs") },
642
- { path: "/edit/:id/exceptions", component: () => import("./exceptions-De9-FvdP.mjs") },
643
- { path: "/edit/:id/availability", component: () => import("./availability-CMrRa5y2.mjs") },
644
- { path: "/edit/:id/payment", component: () => import("./payment-C3ohkehF.mjs") },
645
- { path: "/edit/:id/resources", component: () => import("./resources-DwYxn2Vi.mjs") },
646
- { path: "/edit/:id/orders", component: () => import("./orders-C65SlpJy.mjs") },
647
- { path: "/edit/:id/booking-data", component: () => import("./booking-data-DgJd0BcM.mjs") }
640
+ { path: "/edit/:id", component: () => import("./index-Djp4EBb0.mjs") },
641
+ { path: "/edit/:id/agenda", component: () => import("./agenda-B3nj388v.mjs") },
642
+ { path: "/edit/:id/exceptions", component: () => import("./exceptions-Dgj54ULn.mjs") },
643
+ { path: "/edit/:id/availability", component: () => import("./availability-D8JdA4rP.mjs") },
644
+ { path: "/edit/:id/payment", component: () => import("./payment-D5j-68Ig.mjs") },
645
+ { path: "/edit/:id/refunds", component: () => import("./refunds-D9nTeD2d.mjs") },
646
+ { path: "/edit/:id/resources", component: () => import("./resources-CK0oWssj.mjs") },
647
+ { path: "/edit/:id/orders", component: () => import("./orders-D41GbzIa.mjs") },
648
+ { path: "/edit/:id/booking-data", component: () => import("./booking-data-Px7XCIfU.mjs") }
648
649
  ], iA = [
649
650
  { key: "create-agendas", name: "Create agendas", description: "Team member can create agendas" },
650
651
  { key: "edit-agendas", name: "Edit agendas", description: "Team member can edit agendas" },
@@ -62,18 +62,18 @@ function D(t) {
62
62
  return t >= 1 ? g : t <= -1 ? -g : Math.asin(t);
63
63
  }
64
64
  export {
65
- $ as a,
66
- B as b,
67
- D as c,
68
- w as d,
69
- E as e,
70
- I as f,
71
- Q as g,
65
+ b as a,
66
+ I as b,
67
+ E as c,
68
+ z as d,
69
+ Q as e,
70
+ $ as f,
71
+ w as g,
72
72
  g as h,
73
- j as i,
74
- b as j,
75
- z as k,
76
- Z as m,
73
+ Z as i,
74
+ D as j,
75
+ B as k,
76
+ j as m,
77
77
  C as p,
78
78
  k as s,
79
79
  S as t
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),k=require("@oneclick.dev/cms-kit"),d=require("lucide-vue-next"),g=require("./OrderDetailDialog.vue_vue_type_script_setup_true_lang-BYSeUW_V.js"),oe=require("./EditLayout.vue_vue_type_script_setup_true_lang-gozJKXvM.js"),ne=require("./_plugin-vue_export-helper-BHFhmbuH.js"),ae={class:"space-y-6"},re={class:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4"},se={class:"text-2xl font-semibold tracking-tight flex items-center gap-2"},le={class:"flex gap-1 border rounded-lg p-1 w-fit"},ce={class:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4"},de={class:"flex items-center gap-1"},ie={class:"flex items-center gap-1"},ue={class:"flex items-center gap-2"},me={class:"flex items-center gap-1"},fe={class:"mt-2 text-sm text-muted-foreground"},pe={class:"orders-date-trigger"},ve={class:"relative mb-4"},ge={key:0,class:"mb-3 text-sm text-muted-foreground"},xe={key:1,class:"flex items-center justify-center py-8"},ke={key:2,class:"text-center py-8 text-muted-foreground"},_e={key:3,class:"text-center py-8 text-muted-foreground"},ye={key:4,class:"space-y-2"},he=["onClick"],Ne={class:"flex items-start justify-between"},Ve={class:"flex-1"},we={class:"font-medium"},be={class:"text-sm text-muted-foreground"},De={class:"text-sm text-muted-foreground"},Ee={class:"flex items-center gap-4 flex-wrap mt-1"},Ce={class:"flex items-center gap-2 text-xs text-muted-foreground"},Se={class:"flex items-center gap-2 text-xs text-muted-foreground"},Be={key:0,class:"flex items-center gap-1 text-xs text-muted-foreground"},Ie={class:"flex items-center gap-2 mt-1 text-xs text-muted-foreground"},Pe={class:"text-right"},Te={key:0,class:"inline-block px-2 py-1 text-xs rounded-full bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400"},Ae={key:1,class:"inline-block px-2 py-1 text-xs rounded-full bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400"},ze={key:2,class:"inline-block px-2 py-1 text-xs rounded-full bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400"},Oe={key:3,class:"inline-block px-2 py-1 text-xs rounded-full bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400"},je={key:4,class:"inline-block px-2 py-1 text-xs rounded-full bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400"},Re={key:5,class:"inline-block px-2 py-1 text-xs rounded-full bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400"},Fe={key:6,class:"inline-block px-2 py-1 text-xs rounded-full bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400"},Le={key:7,class:"text-sm font-medium mt-1"},Me=["onClick"],Ue={class:"flex items-start justify-between"},qe={class:"flex-1"},$e={class:"flex items-center gap-2"},He={class:"font-medium"},Ye={class:"text-sm text-muted-foreground"},Ke={class:"text-sm text-muted-foreground"},Qe={class:"flex items-center gap-2 mt-1 text-xs text-muted-foreground"},Xe={class:"text-right"},Ge={key:0,class:"inline-block px-2 py-1 text-xs rounded-full bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400"},Je={key:1,class:"inline-block px-2 py-1 text-xs rounded-full bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400"},We={key:2,class:"inline-block px-2 py-1 text-xs rounded-full bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400"},Ze={class:"text-sm font-medium mt-1"},et=["onClick"],tt={class:"flex items-center justify-between"},ot={class:"flex items-center gap-4 flex-wrap"},nt={class:"flex items-center gap-2 text-xs text-muted-foreground"},at={class:"flex items-center gap-2 text-xs text-muted-foreground"},rt={key:0,class:"flex items-center gap-1 text-xs text-muted-foreground"},st={key:0,class:"text-right flex items-center gap-2"},lt={key:0,class:"inline-block px-2 py-1 text-xs rounded-full bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400"},ct={key:1,class:"inline-block px-2 py-1 text-xs rounded-full bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400"},dt={key:2,class:"inline-block px-2 py-1 text-xs rounded-full bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400"},it={key:3,class:"inline-block px-2 py-1 text-xs rounded-full bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400"},ut={key:4,class:"inline-block px-2 py-1 text-xs rounded-full bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400"},mt={key:5,class:"text-sm font-medium"},ft=e.defineComponent({__name:"orders",setup(vt){const T=k.useRoute();k.useRouter();const A=k.useOverlayParams(),{params:w}=k.useModuleRoute(),{config:N}=k.useModule(),b=k.useFirebaseIntegration(N.project),z=e.computed(()=>w.value?.id??w.id??""),{metadataSchema:D}=g.useAgendaMetadataSchema(z),u=e.ref([]),_=e.ref([]),y=e.ref(!0),E=e.ref(null),f=e.ref(""),h=e.ref(null),C=e.ref(null),x=e.ref("confirmed"),v=new Date,l=e.ref(new Date),O=e.ref(null),U=e.computed(()=>({date:j(l.value),resource:null}));e.provide("event",U);const S=e.computed({get:()=>j(l.value),set:o=>{if(!o){l.value=new Date;return}l.value=new Date(`${o}T00:00:00`)}}),q=()=>{const o=O.value;if(o){if(typeof o.showPicker=="function"){o.showPicker();return}o.focus(),o.click()}},$=e.computed(()=>{const o=new Date(v);o.setDate(v.getDate()-1);const t=new Date(v);return t.setDate(v.getDate()+1),l.value.toDateString()===v.toDateString()?"Today":l.value.toDateString()===o.toDateString()?"Yesterday":l.value.toDateString()===t.toDateString()?"Tomorrow":l.value.toLocaleDateString("en-US",{weekday:"long",month:"long",day:"numeric",year:"numeric"})}),H=()=>{const o=new Date(l.value);o.setDate(o.getDate()-1),l.value=o},Y=()=>{const o=new Date(l.value);o.setDate(o.getDate()+1),o<=v&&(l.value=o)},K=e.computed(()=>{const o=new Date(l.value);return o.setDate(o.getDate()+1),o<=v}),Q=()=>{l.value=new Date},j=o=>{const t=o.getFullYear(),a=String(o.getMonth()+1).padStart(2,"0"),s=String(o.getDate()).padStart(2,"0");return`${t}-${a}-${s}`},R=o=>o?new Date(o).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1}):"",F=o=>o?new Date(o).toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}):"",L=(o,t)=>{const a=_.value.find(i=>i.id===t.resourceId),s=o.id||o.orderId||t.orderId||"";return{customerInfo:o.customerInfo,amountDue:o.amountDue,amountPaid:o.amountPaid,status:o.status,reservationStatus:t.status,subtotal:o.subtotal,total:o.total,discount:o.discount,id:s,res_id:t.id,resourceId:t.resourceId,spots:t.spots,date:t.date,createdAt:o.createdAt,startTime:t.timeslot?.startTime,endTime:t.timeslot?.endTime,reservationPrice:t.totalPrice,reservationBasePrice:t.basePrice,reservationAddOnsPrice:t.addOnsPrice,pricingOptionId:t.pricingOptionId,pricingOption:t.pricingOption,resourceName:a?.name,resourceColor:a?.color,metadata:o.metadata||{},reservationMetadata:t.metadata||{},refundStatus:t.refundStatus,refundedAt:t.refundedAt,refundedAmount:t.refundedAmount,refunds:Array.isArray(t.refunds)?t.refunds:[],adjustments:o.adjustments||[],reservationAdjustments:t.adjustments||[]}},B=async()=>{await e.nextTick(),await new Promise(o=>{if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>o());return}o()})},I=e.computed(()=>f.value.trim()?new g.Fuse(u.value,{keys:["customerInfo.firstName","customerInfo.lastName","customerInfo.email","customerInfo.phone","resourceName"],threshold:.3,ignoreLocation:!0}).search(f.value).map(t=>t.item):u.value),X=e.computed(()=>{const o=new Map;for(const t of I.value){o.has(t.id)||o.set(t.id,{id:t.id,customerInfo:t.customerInfo,status:t.status,createdAt:t.createdAt,metadata:t.metadata||{},reservations:[],adjustments:t.adjustments||[],totalPrice:0,totalSpots:0});const a=o.get(t.id);a.reservations.push(t),a.totalPrice=typeof t.total=="number"?t.total:a.totalPrice+(t.reservationPrice||0),a.totalSpots+=t.spots||0}return Array.from(o.values())}),V=e.computed(()=>({spots:u.value.reduce((o,t)=>o+(t.spots||0),0),bookings:u.value.length,revenue:u.value.reduce((o,t)=>o+(t.reservationPrice||0),0)})),G=()=>{f.value=""},J=async()=>{try{const o=await b.get(N.agendaCollection,z.value);E.value=o,_.value=o?.resources?.filter(t=>t.isActive)||[]}catch(o){console.error("Error loading resources:",o),_.value=[]}},p=async()=>{y.value=!0,u.value=[];try{const o=w.value.id,t=new Date(l.value);t.setHours(0,0,0,0);const a=new Date(l.value);a.setHours(23,59,59,999);const s=await b.find(N.reservationsCollection,{filters:[{field:"agendaId",operator:"==",value:o},{field:"createdAt",operator:">=",value:t.toISOString()},{field:"createdAt",operator:"<=",value:a.toISOString()},{field:"status",operator:"==",value:x.value}]});let i=[];s.forEach(c=>{(c.reservations||[]).forEach(P=>{i.push(L(c,P))})}),u.value=i.sort((c,m)=>(m.createdAt||"").localeCompare(c.createdAt||""))}catch(o){console.error("Error loading orders:",o),u.value=[]}finally{y.value=!1}},W=async()=>{await J(),await p()},M=async(o,t)=>{const a=await b.get(N.reservationsCollection,o);if(!a)return;const s={...a,id:a.id||o},i=(s.reservations||[]).map(c=>L(s,c));if(t){const c=i.find(m=>m.res_id===t);if(!c)return;await B(),h.value?.openDialog(c);return}i.length&&(await B(),C.value?.openDialog({id:s.id,customerInfo:s.customerInfo,status:s.status,createdAt:s.createdAt,metadata:s.metadata||{},reservations:i,adjustments:s.adjustments||[],totalPrice:typeof s.total=="number"?s.total:i.reduce((c,m)=>c+(m.reservationPrice||0),0),totalSpots:i.reduce((c,m)=>c+(m.spots||0),0)}))},Z=async o=>{await B(),h.value?.openDialog(o)};return W(),e.onMounted(async()=>{const o=A.value.orderId||T.query.orderId,t=A.value.reservationId||T.query.reservationId;if(o){const a=new URL(window.location.href);a.searchParams.delete("orderId"),a.searchParams.delete("reservationId"),window.history.replaceState(window.history.state,"",a.toString()),await M(o,t)}}),e.watch(l,()=>{p()}),e.watch(x,()=>{p()}),(o,t)=>{const a=e.resolveComponent("Button"),s=e.resolveComponent("Badge"),i=e.resolveComponent("CardTitle"),c=e.resolveComponent("CardDescription"),m=e.resolveComponent("CardHeader"),P=e.resolveComponent("Input"),ee=e.resolveComponent("CardContent"),te=e.resolveComponent("Card");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(oe._sfc_main,null,{default:e.withCtx(()=>[e.createElementVNode("div",ae,[e.createElementVNode("div",re,[e.createElementVNode("div",null,[e.createElementVNode("h1",se,[e.createVNode(e.unref(d.ShoppingBag),{class:"size-6"}),t[4]||(t[4]=e.createTextVNode(" Orders ",-1))]),t[5]||(t[5]=e.createElementVNode("p",{class:"text-muted-foreground text-sm mt-1"}," View orders by when they were placed ",-1))])]),e.createElementVNode("div",le,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(["confirmed","pending","cancelled"],n=>e.createVNode(a,{key:n,variant:e.unref(x)===n?"default":"ghost",size:"sm",class:"capitalize",onClick:r=>x.value=n},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n),1)]),_:2},1032,["variant","onClick"])),64))]),e.createVNode(te,null,{default:e.withCtx(()=>[e.createVNode(m,null,{default:e.withCtx(()=>[e.createElementVNode("div",ce,[e.createElementVNode("div",null,[e.createVNode(i,{class:"flex items-center gap-2"},{default:e.withCtx(()=>[t[6]||(t[6]=e.createTextVNode(" Orders received ",-1)),e.unref(V).bookings>0?(e.openBlock(),e.createBlock(s,{key:0,variant:"secondary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(V).bookings),1)]),_:1})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(c,{class:"flex items-center gap-4 mt-1"},{default:e.withCtx(()=>[e.createElementVNode("span",de,[e.createVNode(e.unref(d.Users),{size:14}),e.createTextVNode(" "+e.toDisplayString(e.unref(V).spots)+" spots ",1)]),e.createElementVNode("span",ie," €"+e.toDisplayString(e.unref(V).revenue.toFixed(2))+e.toDisplayString(e.unref(x)==="pending"?" pending ":e.unref(x)==="cancelled"?" cancelled ":" ")+"revenue ",1)]),_:1})]),e.createElementVNode("div",ue,[e.createElementVNode("div",me,[e.createVNode(a,{variant:"outline",size:"icon",class:"size-8",onClick:H},{default:e.withCtx(()=>[e.createVNode(e.unref(d.ChevronLeft),{size:16})]),_:1}),e.createVNode(a,{variant:"outline",size:"sm",class:"h-8 px-3 text-xs",onClick:Q},{default:e.withCtx(()=>[...t[7]||(t[7]=[e.createTextVNode(" Today ",-1)])]),_:1}),e.createVNode(a,{variant:"outline",size:"icon",class:"size-8",onClick:Y,disabled:!e.unref(K)},{default:e.withCtx(()=>[e.createVNode(e.unref(d.ChevronRight),{size:16})]),_:1},8,["disabled"])]),e.createVNode(a,{variant:"outline",size:"icon",onClick:p,disabled:e.unref(y)},{default:e.withCtx(()=>[e.createVNode(e.unref(d.RefreshCw),{size:16,class:e.normalizeClass({"animate-spin":e.unref(y)})},null,8,["class"])]),_:1},8,["disabled"])])]),e.createElementVNode("div",fe,[e.createElementVNode("div",pe,[e.createVNode(a,{type:"button",variant:"outline",onClick:q},{default:e.withCtx(()=>[e.createVNode(e.unref(d.CalendarIcon),{class:"size-4"}),e.createTextVNode(" "+e.toDisplayString(e.unref($)),1)]),_:1}),e.withDirectives(e.createElementVNode("input",{ref_key:"dateInputRef",ref:O,"onUpdate:modelValue":t[0]||(t[0]=n=>e.isRef(S)?S.value=n:null),type:"date",class:"orders-date-picker","aria-label":"Select order date"},null,512),[[e.vModelText,e.unref(S)]])])])]),_:1}),e.createVNode(ee,null,{default:e.withCtx(()=>[e.createElementVNode("div",ve,[e.createVNode(e.unref(d.Search),{size:16,class:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),e.createVNode(P,{modelValue:e.unref(f),"onUpdate:modelValue":t[1]||(t[1]=n=>e.isRef(f)?f.value=n:null),placeholder:"Search by name, email, or phone...",class:"pl-9 pr-9"},null,8,["modelValue"]),e.unref(f)?(e.openBlock(),e.createBlock(a,{key:0,variant:"ghost",size:"icon",class:"absolute right-1 top-1/2 -translate-y-1/2 h-7 w-7",onClick:G},{default:e.withCtx(()=>[e.createVNode(e.unref(d.X),{size:14})]),_:1})):e.createCommentVNode("",!0)]),e.unref(f)?(e.openBlock(),e.createElementBlock("div",ge," Showing "+e.toDisplayString(e.unref(I).length)+" of "+e.toDisplayString(e.unref(u).length)+" orders ",1)):e.createCommentVNode("",!0),e.unref(y)?(e.openBlock(),e.createElementBlock("div",xe,[...t[8]||(t[8]=[e.createElementVNode("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"},null,-1)])])):e.unref(u).length===0?(e.openBlock(),e.createElementBlock("div",ke,[e.createVNode(e.unref(d.ShoppingBag),{class:"size-12 mx-auto mb-3 opacity-50"}),t[9]||(t[9]=e.createElementVNode("p",null,"No orders received on this day",-1))])):e.unref(I).length===0?(e.openBlock(),e.createElementBlock("div",_e," No orders match your search ")):(e.openBlock(),e.createElementBlock("div",ye,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(X),n=>(e.openBlock(),e.createElementBlock("div",{key:n.id,class:"border rounded-lg overflow-hidden shadow-sm"},[n.reservations.length===1?(e.openBlock(),e.createElementBlock("div",{key:0,class:"p-3 hover:bg-muted/50 transition-colors cursor-pointer",onClick:r=>e.unref(h)?.openDialog(n.reservations[0])},[e.createElementVNode("div",Ne,[e.createElementVNode("div",Ve,[e.createElementVNode("div",we,e.toDisplayString(n.customerInfo?.firstName||n.customerInfo?.lastName?[n.customerInfo?.firstName,n.customerInfo?.lastName].filter(Boolean).join(" "):"Unknown Customer"),1),e.createElementVNode("div",be,e.toDisplayString(n.customerInfo?.email),1),e.createElementVNode("div",De,e.toDisplayString(n.customerInfo?.phone),1),e.createElementVNode("div",Ee,[e.createElementVNode("div",Ce,[e.createVNode(e.unref(d.CalendarIcon),{size:12}),e.createElementVNode("span",null,e.toDisplayString(F(n.reservations[0].date))+" · "+e.toDisplayString(n.reservations[0].startTime)+" - "+e.toDisplayString(n.reservations[0].endTime),1)]),e.createElementVNode("div",Se,[e.createVNode(e.unref(d.Users),{size:12}),e.createElementVNode("span",null,e.toDisplayString(n.reservations[0].spots)+" spots",1)]),n.reservations[0].resourceName?(e.openBlock(),e.createElementBlock("div",Be,[e.createElementVNode("div",{class:"w-3 h-3 rounded-full",style:e.normalizeStyle({backgroundColor:n.reservations[0].resourceColor||"#6b7280"})},null,4),e.createElementVNode("span",null,e.toDisplayString(n.reservations[0].resourceName),1)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ie,[e.createVNode(e.unref(d.Clock),{size:12}),e.createElementVNode("span",null,"Ordered at "+e.toDisplayString(R(n.createdAt)),1)]),e.createVNode(g._sfc_main,{metadata:{...n.reservations[0].metadata,...n.reservations[0].reservationMetadata},schema:e.unref(D),"display-filter":["highlight","badge"],compact:"",class:"mt-1"},null,8,["metadata","schema"])]),e.createElementVNode("div",Pe,[n.reservations[0].status==="pending"?(e.openBlock(),e.createElementBlock("span",Te,"Pending")):n.reservations[0].status==="cancelled"?(e.openBlock(),e.createElementBlock("span",Ae,"Cancelled")):n.reservations[0].reservationStatus==="needs_approval"?(e.openBlock(),e.createElementBlock("span",ze,"Needs Approval")):n.reservations[0].reservationStatus==="approved"?(e.openBlock(),e.createElementBlock("span",Oe,"Approved")):n.reservations[0].reservationStatus==="cancelled"?(e.openBlock(),e.createElementBlock("span",je,"Cancelled")):n.reservations[0].reservationStatus==="rejected"?(e.openBlock(),e.createElementBlock("span",Re,"Rejected")):(e.openBlock(),e.createElementBlock("span",Fe,"Pending")),n.reservations[0].reservationPrice||n.reservations[0].reservationPrice===0?(e.openBlock(),e.createElementBlock("div",Le," €"+e.toDisplayString(n.reservations[0].reservationPrice.toFixed(2)),1)):e.createCommentVNode("",!0)])])],8,he)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"p-3 bg-muted/30 hover:bg-muted/50 transition-colors cursor-pointer",onClick:r=>e.unref(C)?.openDialog(n)},[e.createElementVNode("div",Ue,[e.createElementVNode("div",qe,[e.createElementVNode("div",$e,[e.createElementVNode("div",He,e.toDisplayString(n.customerInfo?.firstName||n.customerInfo?.lastName?[n.customerInfo?.firstName,n.customerInfo?.lastName].filter(Boolean).join(" "):"Unknown Customer"),1),e.createVNode(s,{variant:"secondary",class:"text-xs"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.reservations.length)+" reservations ",1)]),_:2},1024)]),e.createElementVNode("div",Ye,e.toDisplayString(n.customerInfo?.email),1),e.createElementVNode("div",Ke,e.toDisplayString(n.customerInfo?.phone),1),e.createElementVNode("div",Qe,[e.createVNode(e.unref(d.Clock),{size:12}),e.createElementVNode("span",null,"Ordered at "+e.toDisplayString(R(n.createdAt)),1)]),e.createVNode(g._sfc_main,{metadata:n.metadata,schema:e.unref(D),"display-filter":["highlight","badge"],compact:"",class:"mt-1"},null,8,["metadata","schema"])]),e.createElementVNode("div",Xe,[n.status==="pending"?(e.openBlock(),e.createElementBlock("span",Ge,"Pending")):n.status==="cancelled"?(e.openBlock(),e.createElementBlock("span",Je,"Cancelled")):(e.openBlock(),e.createElementBlock("span",We,"Confirmed")),e.createElementVNode("div",Ze," €"+e.toDisplayString(n.totalPrice.toFixed(2)),1)])])],8,Me),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.reservations,r=>(e.openBlock(),e.createElementBlock("div",{key:r.res_id,class:"p-3 border-t bg-muted/50 dark:bg-transparent dark:hover:bg-muted/50 transition-colors cursor-pointer",onClick:gt=>e.unref(h)?.openDialog(r)},[e.createElementVNode("div",tt,[e.createElementVNode("div",ot,[e.createElementVNode("div",nt,[e.createVNode(e.unref(d.CalendarIcon),{size:12}),e.createElementVNode("span",null,e.toDisplayString(F(r.date))+" · "+e.toDisplayString(r.startTime)+" - "+e.toDisplayString(r.endTime),1)]),e.createElementVNode("div",at,[e.createVNode(e.unref(d.Users),{size:12}),e.createElementVNode("span",null,e.toDisplayString(r.spots)+" spots",1)]),r.resourceName?(e.openBlock(),e.createElementBlock("div",rt,[e.createElementVNode("div",{class:"w-3 h-3 rounded-full",style:e.normalizeStyle({backgroundColor:r.resourceColor||"#6b7280"})},null,4),e.createElementVNode("span",null,e.toDisplayString(r.resourceName),1)])):e.createCommentVNode("",!0)]),r.status==="confirmed"?(e.openBlock(),e.createElementBlock("div",st,[r.reservationStatus==="needs_approval"?(e.openBlock(),e.createElementBlock("span",lt,"Needs Approval")):r.reservationStatus==="approved"?(e.openBlock(),e.createElementBlock("span",ct,"Approved")):r.reservationStatus==="cancelled"?(e.openBlock(),e.createElementBlock("span",dt,"Cancelled")):r.reservationStatus==="rejected"?(e.openBlock(),e.createElementBlock("span",it,"Rejected")):(e.openBlock(),e.createElementBlock("span",ut,"Pending")),r.reservationPrice||r.reservationPrice===0?(e.openBlock(),e.createElementBlock("div",mt," €"+e.toDisplayString(r.reservationPrice.toFixed(2)),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createVNode(g._sfc_main,{metadata:r.reservationMetadata,schema:e.unref(D),"display-filter":["highlight","badge"],compact:"",class:"mt-1"},null,8,["metadata","schema"])],8,et))),128))],64))]))),128))]))]),_:1})]),_:1})])]),_:1}),e.createVNode(g._sfc_main$1,{ref_key:"reservationDetailDialog",ref:h,"agenda-data":e.unref(E),resources:e.unref(_),"show-order-link":"",onCancelled:p,onConfirmed:p,onRejected:p,onTransferred:p,onOpenOrder:t[2]||(t[2]=n=>M(n))},null,8,["agenda-data","resources"]),e.createVNode(g._sfc_main$2,{ref_key:"orderDetailDialog",ref:C,"agenda-data":e.unref(E),resources:e.unref(_),onOpenReservation:t[3]||(t[3]=n=>Z(n))},null,8,["agenda-data","resources"])],64)}}}),pt=ne._export_sfc(ft,[["__scopeId","data-v-11463131"]]);exports.default=pt;