@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
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as Q, inject as K, openBlock as r, createElementBlock as g, createElementVNode as i, Fragment as I, renderList as q, withModifiers as ue, normalizeClass as ee, unref as o, createCommentVNode as T, toDisplayString as P, createTextVNode as m, resolveComponent as s, createBlock as $, withCtx as l, createVNode as t, computed as X, renderSlot as _e, ref as j, useTemplateRef as be, withAsyncContext as xe, watch as Ce, onMounted as ye, onUnmounted as we, provide as O, withKeys as ke } from "vue";
2
2
  import { Filter as he, ChevronsUpDown as Pe, Check as se, RotateCcw as $e, ExternalLink as Se, Search as Me, Plus as Ve, LayoutGrid as Te, List as Ae } from "lucide-vue-next";
3
3
  import { useModuleRoute as J, useModulePermissions as Y, useFirebaseIntegration as te, useConfirmation as ze, useModuleBreadcrumbs as Ie } from "@oneclick.dev/cms-kit";
4
- import { u as Le } from "./index-CFzn2Lus.mjs";
4
+ import { a as Le } from "./index-hMp4p5qA.mjs";
5
5
  import { c as ae } from "./utils-CanmrIWO.mjs";
6
6
  import { t as D } from "./index-RLz1QPrf.mjs";
7
7
  const Ee = { class: "grid @md:grid-cols-2 @2xl:grid-cols-3 @3xl:grid-cols-4 @4xl:grid-cols-5 @5xl:grid-cols-6 gap-6" }, De = ["onClick", "onContextmenu"], Fe = ["src"], Be = { class: "font-semibold" }, Ue = { class: "text-sm text-muted-foreground flex items-center gap-2" }, Re = { class: "flex items-center gap-2" }, je = { key: 0 }, Ke = /* @__PURE__ */ Q({
@@ -1,10 +1,10 @@
1
1
  import { defineComponent as _e, ref as f, computed as te, watch as he, onMounted as ye, resolveComponent as h, openBlock as n, createElementBlock as i, createElementVNode as s, toDisplayString as u, unref as r, Fragment as w, renderList as D, normalizeClass as L, createVNode as t, withCtx as l, createCommentVNode as P, createBlock as T, createTextVNode as y, resolveDynamicComponent as W, normalizeStyle as se } from "vue";
2
2
  import { useModule as be, useModuleRoute as we, useModuleBreadcrumbs as Ce } from "@oneclick.dev/cms-kit";
3
- import "./index-CkVwMqpn.mjs";
3
+ import "./index-Bnn9LahC.mjs";
4
4
  import { componentToString as oe, ChartTooltipContent as ae } from "@oneclick.dev/cms-kit/charts";
5
5
  import { MousePointerClick as ke, Users as $e, Eye as De, Clock as Pe, Zap as Te, TrendingDown as le, TrendingUp as ne, UserPlus as Se, Activity as Ue, RefreshCw as Ve, Loader2 as Re, ArrowUpRight as Me, Globe as Fe, Minus as Ae, Smartphone as ze, Tablet as Ne, Monitor as Be } from "lucide-vue-next";
6
- import { $ as re, O as j, A as ie, z as ue } from "./index-BIF2RB7k.mjs";
7
- import { P as ce, S as H } from "./index-B8GvmAwh.mjs";
6
+ import { $ as re, O as j, A as ie, z as ue } from "./index-cC_2cw31.mjs";
7
+ import { P as ce, S as H } from "./index-DiTIA8Sh.mjs";
8
8
  const Le = { class: "flex flex-col gap-4 w-full max-w-7xl mx-auto py-8" }, je = { class: "flex justify-between gap-4 flex-col @lg:flex-row @lg:items-center" }, Ge = { class: "text-muted-foreground text-sm mt-1" }, Ie = {
9
9
  key: 0,
10
10
  class: "flex items-center gap-2"
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),y=require("@oneclick.dev/cms-kit"),s=require("lucide-vue-next"),ce={class:"container @container mx-auto py-8"},de={key:0,class:"flex justify-center py-24"},ue={class:"flex gap-2"},me={key:2},pe={class:"flex flex-col gap-4 mb-6 @md:flex-row @md:items-end @md:justify-between"},fe={class:"flex flex-wrap items-center gap-2"},ge={class:"relative"},ve={key:0,class:"flex flex-wrap items-center justify-between gap-3 mb-4 px-4 py-3 rounded-lg border bg-muted/40"},xe={class:"flex items-center gap-3"},Ce={class:"text-sm font-medium"},Ne={class:"flex items-center gap-2"},ye={key:1,class:"flex flex-col items-center justify-center py-16 text-center border border-dashed rounded-lg"},Ve={class:"font-medium"},we={key:2,class:"grid gap-4 @md:grid-cols-2 @3xl:grid-cols-3"},he=["onClick"],_e=["onClick"],ke={class:"flex items-start gap-3"},be=["onClick"],Ee={class:"text-base font-semibold leading-tight line-clamp-1"},Ae={class:"flex items-center gap-2 mt-1"},Se={key:0,class:"text-xs text-muted-foreground cursor-pointer"},Be={key:0,class:"shrink-0"},De={class:"grid grid-cols-3 gap-2 mt-5"},$e={class:"flex flex-col items-start gap-1 rounded-lg bg-muted/40 px-3 py-2"},Me={class:"flex items-center gap-1 text-muted-foreground"},Te={class:"text-sm font-semibold"},ze={class:"flex flex-col items-start gap-1 rounded-lg bg-muted/40 px-3 py-2"},Ie={class:"flex items-center gap-1 text-muted-foreground"},Pe={class:"text-sm font-semibold"},je={class:"flex flex-col items-start gap-1 rounded-lg bg-muted/40 px-3 py-2"},Fe={class:"flex items-center gap-1 text-muted-foreground"},Ue={class:"text-sm font-semibold"},Oe={key:0,class:"flex items-center justify-between gap-2 px-5 py-3 border-t bg-muted/20"},A="privateSettings",G="refundFlow",L="metadataSchema",S="_privateSettings",Re=e.defineComponent({__name:"Overview",setup(Ge){const{config:d}=y.useModule(),u=y.useFirebaseIntegration(d.project),{navigateTo:N}=y.useModuleRoute(),{confirm:q}=y.useConfirmation(),{hasPermission:p}=y.useModulePermissions();y.useModuleBreadcrumbs(()=>[]);const f=e.ref(null),w=e.ref(""),c=e.ref(!1),a=e.ref([]),B=e.ref("importAgendasInput"),H=["id",S,"metadataSchema","refundFlow","refundFlowEnabled","refundDialog"],D=(o,t)=>`${d.agendaCollection}/${o}/${A}/${t}`,h=o=>{if(!o||typeof o!="object")return null;const{id:t,...r}=o;return r},$=o=>!!o&&typeof o=="object"&&Object.keys(o).length>0,b=o=>{const t={...o||{}};return H.forEach(r=>delete t[r]),t},M=async o=>{const[t,r]=await Promise.all([u.get(D(o,G)),u.get(D(o,L))]);return{refundFlow:h(t),metadataSchema:h(r)}},T=async(o,t)=>{if(!t||typeof t!="object")return;const r=[],l=h(t.refundFlow);$(l)&&r.push(u.update(`${d.agendaCollection}/${o}/${A}`,G,l));const i=h(t.metadataSchema);$(i)&&r.push(u.update(`${d.agendaCollection}/${o}/${A}`,L,i)),await Promise.all(r)},x=e.computed(()=>{if(!f.value)return[];const o=w.value.trim().toLowerCase();return o?f.value.filter(t=>(t.serviceName||"").toLowerCase().includes(o)):f.value}),z=e.computed(()=>x.value.length>0&&x.value.every(o=>a.value.includes(o.id))),J=()=>{if(z.value){const o=x.value.map(t=>t.id);a.value=a.value.filter(t=>!o.includes(t))}else{const o=x.value.map(r=>r.id),t=new Set([...a.value,...o]);a.value=Array.from(t)}},I=o=>{a.value.includes(o)?a.value=a.value.filter(t=>t!==o):a.value.push(o)},K=o=>{if(!o)return"??";const t=o.trim().split(/\s+/);return t.length===1?t[0].slice(0,2).toUpperCase():(t[0][0]+t[t.length-1][0]).toUpperCase()},P=[{fg:"#7c3aed",bg:"rgba(124, 58, 237, 0.12)"},{fg:"#0891b2",bg:"rgba(8, 145, 178, 0.12)"},{fg:"#ea580c",bg:"rgba(234, 88, 12, 0.12)"},{fg:"#16a34a",bg:"rgba(22, 163, 74, 0.12)"},{fg:"#2563eb",bg:"rgba(37, 99, 235, 0.12)"},{fg:"#db2777",bg:"rgba(219, 39, 119, 0.12)"},{fg:"#475569",bg:"rgba(71, 85, 105, 0.12)"}],E=o=>{const t=(o.id||o.serviceName||"").toString();let r=0;for(let l=0;l<t.length;l++)r=r*31+t.charCodeAt(l)>>>0;return P[r%P.length]},Y=o=>{const t=o?.pricingOptions?.[0];return t?.duration?`${t.duration} min`:null},Q=o=>{const t=o?.pricingOptions?.[0];return t?.price===void 0||t?.price===null||t?.price===""?null:`${o.currency==="EUR"?"€":"$"}${t.price}`},X=o=>Array.isArray(o?.resources)?o.resources.filter(t=>t?.isActive!==!1).length:0,W=o=>o.type==="regular"?"Regular":o.type?o.type.charAt(0).toUpperCase()+o.type.slice(1):"Agenda",Z=o=>{c.value=!0,a.value=[o]},_=async()=>{f.value=await u.find(d.agendaCollection)},ee=async o=>{if(!p("create-agendas"))return;const[t,r]=await Promise.all([u.get(d.agendaCollection,o),M(o)]);if(!t){alert("Agenda not found");return}const l=prompt("Enter name for duplicated agenda",t.serviceName+" (Copy)");if(!l)return;const i={...b(t),serviceName:l},v=(await u.add(d.agendaCollection,i))?.id;v&&await T(v,r),await _()},te=async o=>{!p("delete-agendas")||!await q("Are you sure you want to delete this agenda? This action cannot be undone.")||(await u.remove(d.agendaCollection,o),await _())},oe=async()=>{if(!f.value)return;const o=f.value.filter(i=>a.value.includes(i.id)),t=await Promise.all(o.map(async i=>{const[g,v]=await Promise.all([u.get(d.agendaCollection,i.id),M(i.id)]);return{...b(g||i),[S]:v}})),r="data:text/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(t,null,2)),l=document.createElement("a");l.setAttribute("href",r),l.setAttribute("download","agendas_export.json"),document.body.appendChild(l),l.click(),l.remove(),c.value=!1,a.value=[]},ne=async o=>{const t=o.target;if(!t.files||t.files.length===0)return;const l=await t.files[0].text();let i;try{i=JSON.parse(l)}catch{alert("Invalid JSON file");return}if(!Array.isArray(i)){alert("Invalid agendas format");return}for(const g of i){const v=g?.[S],k=(await u.add(d.agendaCollection,b(g)))?.id;k&&await T(k,v)}t.value="",await _()},j=o=>{c.value||(p("edit-agendas")?N(`/edit/${o}`):N(`/edit/${o}/agenda`))};return _(),(o,t)=>{const r=e.resolveComponent("Spinner"),l=e.resolveComponent("EmptyMedia"),i=e.resolveComponent("EmptyTitle"),g=e.resolveComponent("EmptyDescription"),v=e.resolveComponent("EmptyHeader"),m=e.resolveComponent("Button"),k=e.resolveComponent("EmptyContent"),re=e.resolveComponent("Empty"),ae=e.resolveComponent("Input"),F=e.resolveComponent("DropdownMenuTrigger"),V=e.resolveComponent("DropdownMenuItem"),U=e.resolveComponent("DropdownMenuGroup"),O=e.resolveComponent("DropdownMenuContent"),R=e.resolveComponent("DropdownMenu"),le=e.resolveComponent("ButtonGroup"),se=e.resolveComponent("Checkbox"),ie=e.resolveComponent("Badge");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",ce,[f.value===null?(e.openBlock(),e.createElementBlock("div",de,[e.createVNode(r,{class:"mx-auto"})])):f.value.length===0?(e.openBlock(),e.createBlock(re,{key:1},{default:e.withCtx(()=>[e.createVNode(v,null,{default:e.withCtx(()=>[e.createVNode(l,{variant:"icon"},{default:e.withCtx(()=>[e.createVNode(e.unref(s.CalendarX),{class:"size-4-6"})]),_:1}),e.createVNode(i,null,{default:e.withCtx(()=>[...t[6]||(t[6]=[e.createTextVNode("No Agendas Yet",-1)])]),_:1}),e.createVNode(g,null,{default:e.withCtx(()=>[...t[7]||(t[7]=[e.createTextVNode(" You haven't created any agenda yet. Get started by creating your first agenda. ",-1)])]),_:1})]),_:1}),e.createVNode(k,null,{default:e.withCtx(()=>[e.createElementVNode("div",ue,[e.createVNode(m,{onClick:t[0]||(t[0]=n=>e.unref(N)("/create"))},{default:e.withCtx(()=>[e.createVNode(e.unref(s.PlusIcon)),t[8]||(t[8]=e.createTextVNode(" Create Agenda ",-1))]),_:1})])]),_:1})]),_:1})):(e.openBlock(),e.createElementBlock("div",me,[e.createElementVNode("div",pe,[t[11]||(t[11]=e.createElementVNode("div",null,[e.createElementVNode("h2",{class:"text-3xl font-bold tracking-tight"},"Agendas"),e.createElementVNode("p",{class:"text-sm text-muted-foreground mt-1"}," Manage your bookable services, hours and resources. ")],-1)),e.createElementVNode("div",fe,[e.createElementVNode("div",ge,[e.createVNode(e.unref(s.Search),{class:"absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground pointer-events-none"}),e.createVNode(ae,{modelValue:w.value,"onUpdate:modelValue":t[1]||(t[1]=n=>w.value=n),placeholder:"Search agendas...",class:"pl-9 w-full @md:w-64"},null,8,["modelValue"])]),!c.value&&e.unref(p)("create-agendas")?(e.openBlock(),e.createBlock(le,{key:0},{default:e.withCtx(()=>[e.createVNode(m,{onClick:t[2]||(t[2]=n=>e.unref(N)("/create"))},{default:e.withCtx(()=>[e.createVNode(e.unref(s.PlusIcon)),t[9]||(t[9]=e.createTextVNode(" New Agenda ",-1))]),_:1}),e.createVNode(R,null,{default:e.withCtx(()=>[e.createVNode(F,{"as-child":""},{default:e.withCtx(()=>[e.createVNode(m,{size:"icon","aria-label":"More Options"},{default:e.withCtx(()=>[e.createVNode(e.unref(s.MoreHorizontalIcon))]),_:1})]),_:1}),e.createVNode(O,{align:"end",class:"w-52"},{default:e.withCtx(()=>[e.createVNode(U,null,{default:e.withCtx(()=>[e.createVNode(V,{onClick:t[3]||(t[3]=n=>B.value.click())},{default:e.withCtx(()=>[e.createVNode(e.unref(s.ImportIcon)),t[10]||(t[10]=e.createTextVNode(" Import Agendas... ",-1))]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})):e.createCommentVNode("",!0)])]),c.value?(e.openBlock(),e.createElementBlock("div",ve,[e.createElementVNode("div",xe,[e.createVNode(se,{modelValue:z.value,"onUpdate:modelValue":J},null,8,["modelValue"]),e.createElementVNode("span",Ce,e.toDisplayString(a.value.length)+" of "+e.toDisplayString(x.value.length)+" selected ",1)]),e.createElementVNode("div",Ne,[e.createVNode(m,{variant:"ghost",onClick:t[4]||(t[4]=n=>{c.value=!1,a.value=[]})},{default:e.withCtx(()=>[...t[12]||(t[12]=[e.createTextVNode(" Cancel ",-1)])]),_:1}),e.createVNode(m,{onClick:oe,disabled:a.value.length===0},{default:e.withCtx(()=>[e.createVNode(e.unref(s.Upload)),e.createTextVNode(" Export "+e.toDisplayString(a.value.length||""),1)]),_:1},8,["disabled"])])])):e.createCommentVNode("",!0),x.value.length===0?(e.openBlock(),e.createElementBlock("div",ye,[e.createVNode(e.unref(s.Search),{class:"size-8 text-muted-foreground mb-3"}),e.createElementVNode("p",Ve,'No agendas match "'+e.toDisplayString(w.value)+'"',1),t[13]||(t[13]=e.createElementVNode("p",{class:"text-sm text-muted-foreground mt-1"},"Try a different search term.",-1))])):(e.openBlock(),e.createElementBlock("div",we,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,n=>(e.openBlock(),e.createElementBlock("div",{key:n.id,class:e.normalizeClass(["group relative flex flex-col overflow-hidden rounded-xl border bg-card shadow-sm transition-all duration-200",{"cursor-pointer":c.value,"ring-2 ring-primary border-primary/40":c.value&&a.value.includes(n.id)}]),onClick:C=>c.value?I(n.id):null},[e.createElementVNode("div",{class:"h-1 w-full",style:e.normalizeStyle({backgroundColor:E(n).fg})},null,4),e.createElementVNode("div",{class:"flex flex-col flex-1 p-5",onClick:C=>!c.value&&j(n.id)},[e.createElementVNode("div",ke,[e.createElementVNode("div",{class:"shrink-0 size-12 rounded-lg flex items-center justify-center font-semibold text-sm",style:e.normalizeStyle({backgroundColor:E(n).bg,color:E(n).fg})},e.toDisplayString(K(n.serviceName)),5),e.createElementVNode("button",{type:"button",class:"flex-1 min-w-0 text-left focus:outline-none",onClick:e.withModifiers(C=>c.value?I(n.id):j(n.id),["stop"])},[e.createElementVNode("h3",Ee,e.toDisplayString(n.serviceName||"Untitled Agenda"),1),e.createElementVNode("div",Ae,[e.createVNode(ie,{variant:"secondary",class:"text-[10px] font-medium px-1.5 py-0 h-4"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(W(n)),1)]),_:2},1024),c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Se," Click to "+e.toDisplayString(e.unref(p)("edit-agendas")?"edit":"view"),1))])],8,be),c.value?(e.openBlock(),e.createElementBlock("div",Be,[e.createElementVNode("div",{class:e.normalizeClass(["flex items-center justify-center size-6 rounded-full border-2 transition",a.value.includes(n.id)?"border-primary bg-primary text-primary-foreground":"border-muted-foreground/30"])},[a.value.includes(n.id)?(e.openBlock(),e.createBlock(e.unref(s.CheckCircle2),{key:0,class:"size-4"})):e.createCommentVNode("",!0)],2)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",De,[e.createElementVNode("div",$e,[e.createElementVNode("div",Me,[e.createVNode(e.unref(s.Clock),{class:"size-3.5"}),t[14]||(t[14]=e.createElementVNode("span",{class:"text-[10px] uppercase tracking-wide font-medium"},"Duration",-1))]),e.createElementVNode("span",Te,e.toDisplayString(Y(n)||"—"),1)]),e.createElementVNode("div",ze,[e.createElementVNode("div",Ie,[e.createVNode(e.unref(s.DollarSign),{class:"size-3.5"}),t[15]||(t[15]=e.createElementVNode("span",{class:"text-[10px] uppercase tracking-wide font-medium"},"Price",-1))]),e.createElementVNode("span",Pe,e.toDisplayString(Q(n)||"—"),1)]),e.createElementVNode("div",je,[e.createElementVNode("div",Fe,[e.createVNode(e.unref(s.Users),{class:"size-3.5"}),t[16]||(t[16]=e.createElementVNode("span",{class:"text-[10px] uppercase tracking-wide font-medium"},"Resources",-1))]),e.createElementVNode("span",Ue,e.toDisplayString(X(n)),1)])])],8,_e),c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Oe,[e.unref(p)("edit-agendas")?(e.openBlock(),e.createBlock(m,{key:0,variant:"ghost",size:"sm",class:"gap-1.5",onClick:e.withModifiers(C=>e.unref(N)(`/edit/${n.id}`),["stop"])},{default:e.withCtx(()=>[e.createVNode(e.unref(s.CalendarDays),{class:"size-4"}),t[17]||(t[17]=e.createTextVNode(" Edit Agenda ",-1))]),_:1},8,["onClick"])):(e.openBlock(),e.createBlock(m,{key:1,variant:"ghost",size:"sm",class:"gap-1.5",onClick:e.withModifiers(C=>e.unref(N)(`/edit/${n.id}/agenda`),["stop"])},{default:e.withCtx(()=>[e.createVNode(e.unref(s.CalendarDays),{class:"size-4"}),t[18]||(t[18]=e.createTextVNode(" View Agenda ",-1))]),_:1},8,["onClick"])),e.createVNode(R,null,{default:e.withCtx(()=>[e.createVNode(F,{"as-child":""},{default:e.withCtx(()=>[e.createVNode(m,{variant:"ghost",size:"icon","aria-label":"More Options",onClick:t[5]||(t[5]=e.withModifiers(()=>{},["stop"]))},{default:e.withCtx(()=>[e.createVNode(e.unref(s.MoreHorizontalIcon))]),_:1})]),_:1}),e.createVNode(O,{align:"end",class:"w-52"},{default:e.withCtx(()=>[e.createVNode(U,null,{default:e.withCtx(()=>[e.unref(p)("create-agendas")?(e.openBlock(),e.createBlock(V,{key:0,onClick:C=>ee(n.id)},{default:e.withCtx(()=>[e.createVNode(e.unref(s.Copy)),t[19]||(t[19]=e.createTextVNode(" Duplicate Agenda ",-1))]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.createVNode(V,null,{default:e.withCtx(()=>[e.createVNode(e.unref(s.ChevronsLeftRightEllipsis)),t[20]||(t[20]=e.createTextVNode(" API Set-up ",-1))]),_:1}),e.createVNode(V,{onClick:C=>Z(n.id)},{default:e.withCtx(()=>[e.createVNode(e.unref(s.Upload)),t[21]||(t[21]=e.createTextVNode(" Export Agenda ",-1))]),_:1},8,["onClick"]),e.unref(p)("delete-agendas")?(e.openBlock(),e.createBlock(V,{key:1,variant:"destructive",onClick:C=>te(n.id)},{default:e.withCtx(()=>[e.createVNode(e.unref(s.Trash2Icon)),t[22]||(t[22]=e.createTextVNode(" Remove Agenda ",-1))]),_:1},8,["onClick"])):e.createCommentVNode("",!0)]),_:2},1024)]),_:2},1024)]),_:2},1024)]))],10,he))),128))]))]))]),e.createElementVNode("input",{type:"file",ref_key:"importAgendasInput",ref:B,class:"hidden",accept:".json,application/json",onChange:ne},null,544)],64)}}});exports.default=Re;
@@ -0,0 +1,527 @@
1
+ import { defineComponent as Ee, ref as M, computed as Z, resolveComponent as u, openBlock as c, createElementBlock as g, Fragment as ee, createElementVNode as o, createVNode as n, createBlock as $, withCtx as s, unref as a, createTextVNode as f, createCommentVNode as k, toDisplayString as v, renderList as De, normalizeClass as te, normalizeStyle as ne, withModifiers as j } from "vue";
2
+ import { useModule as Me, useFirebaseIntegration as ze, useModuleRoute as Ie, useConfirmation as Ne, useModulePermissions as Pe, useModuleBreadcrumbs as je } from "@oneclick.dev/cms-kit";
3
+ import { CalendarX as Fe, PlusIcon as oe, Search as se, MoreHorizontalIcon as le, ImportIcon as Te, Upload as ae, CheckCircle2 as Ve, Clock as Be, DollarSign as Ue, Users as Oe, CalendarDays as ie, Copy as Re, ChevronsLeftRightEllipsis as Ge, Trash2Icon as Le } from "lucide-vue-next";
4
+ const He = { class: "container @container mx-auto py-8" }, Je = {
5
+ key: 0,
6
+ class: "flex justify-center py-24"
7
+ }, Ye = { class: "flex gap-2" }, qe = { key: 2 }, Ke = { class: "flex flex-col gap-4 mb-6 @md:flex-row @md:items-end @md:justify-between" }, Qe = { class: "flex flex-wrap items-center gap-2" }, Xe = { class: "relative" }, We = {
8
+ key: 0,
9
+ class: "flex flex-wrap items-center justify-between gap-3 mb-4 px-4 py-3 rounded-lg border bg-muted/40"
10
+ }, Ze = { class: "flex items-center gap-3" }, et = { class: "text-sm font-medium" }, tt = { class: "flex items-center gap-2" }, nt = {
11
+ key: 1,
12
+ class: "flex flex-col items-center justify-center py-16 text-center border border-dashed rounded-lg"
13
+ }, ot = { class: "font-medium" }, st = {
14
+ key: 2,
15
+ class: "grid gap-4 @md:grid-cols-2 @3xl:grid-cols-3"
16
+ }, lt = ["onClick"], at = ["onClick"], it = { class: "flex items-start gap-3" }, rt = ["onClick"], dt = { class: "text-base font-semibold leading-tight line-clamp-1" }, ct = { class: "flex items-center gap-2 mt-1" }, ut = {
17
+ key: 0,
18
+ class: "text-xs text-muted-foreground cursor-pointer"
19
+ }, pt = {
20
+ key: 0,
21
+ class: "shrink-0"
22
+ }, mt = { class: "grid grid-cols-3 gap-2 mt-5" }, ft = { class: "flex flex-col items-start gap-1 rounded-lg bg-muted/40 px-3 py-2" }, gt = { class: "flex items-center gap-1 text-muted-foreground" }, vt = { class: "text-sm font-semibold" }, yt = { class: "flex flex-col items-start gap-1 rounded-lg bg-muted/40 px-3 py-2" }, _t = { class: "flex items-center gap-1 text-muted-foreground" }, xt = { class: "text-sm font-semibold" }, bt = { class: "flex flex-col items-start gap-1 rounded-lg bg-muted/40 px-3 py-2" }, wt = { class: "flex items-center gap-1 text-muted-foreground" }, Ct = { class: "text-sm font-semibold" }, ht = {
23
+ key: 0,
24
+ class: "flex items-center justify-between gap-2 px-5 py-3 border-t bg-muted/20"
25
+ }, V = "privateSettings", re = "refundFlow", de = "metadataSchema", B = "_privateSettings", Et = /* @__PURE__ */ Ee({
26
+ __name: "Overview",
27
+ setup(kt) {
28
+ const { config: y } = Me(), _ = ze(y.project), { navigateTo: E } = Ie(), { confirm: ce } = Ne(), { hasPermission: b } = Pe();
29
+ je(() => []);
30
+ const w = M(null), z = M(""), m = M(!1), r = M([]), U = M("importAgendasInput"), ue = [
31
+ "id",
32
+ B,
33
+ "metadataSchema",
34
+ "refundFlow",
35
+ "refundFlowEnabled",
36
+ "refundDialog"
37
+ ], O = (t, e) => `${y.agendaCollection}/${t}/${V}/${e}`, I = (t) => {
38
+ if (!t || typeof t != "object") return null;
39
+ const { id: e, ...i } = t;
40
+ return i;
41
+ }, R = (t) => !!t && typeof t == "object" && Object.keys(t).length > 0, F = (t) => {
42
+ const e = { ...t || {} };
43
+ return ue.forEach((i) => delete e[i]), e;
44
+ }, G = async (t) => {
45
+ const [e, i] = await Promise.all([
46
+ _.get(O(t, re)),
47
+ _.get(O(t, de))
48
+ ]);
49
+ return {
50
+ refundFlow: I(e),
51
+ metadataSchema: I(i)
52
+ };
53
+ }, L = async (t, e) => {
54
+ if (!e || typeof e != "object") return;
55
+ const i = [], d = I(e.refundFlow);
56
+ R(d) && i.push(_.update(
57
+ `${y.agendaCollection}/${t}/${V}`,
58
+ re,
59
+ d
60
+ ));
61
+ const p = I(e.metadataSchema);
62
+ R(p) && i.push(_.update(
63
+ `${y.agendaCollection}/${t}/${V}`,
64
+ de,
65
+ p
66
+ )), await Promise.all(i);
67
+ }, A = Z(() => {
68
+ if (!w.value) return [];
69
+ const t = z.value.trim().toLowerCase();
70
+ return t ? w.value.filter(
71
+ (e) => (e.serviceName || "").toLowerCase().includes(t)
72
+ ) : w.value;
73
+ }), H = Z(
74
+ () => A.value.length > 0 && A.value.every((t) => r.value.includes(t.id))
75
+ ), pe = () => {
76
+ if (H.value) {
77
+ const t = A.value.map((e) => e.id);
78
+ r.value = r.value.filter((e) => !t.includes(e));
79
+ } else {
80
+ const t = A.value.map((i) => i.id), e = /* @__PURE__ */ new Set([...r.value, ...t]);
81
+ r.value = Array.from(e);
82
+ }
83
+ }, J = (t) => {
84
+ r.value.includes(t) ? r.value = r.value.filter((e) => e !== t) : r.value.push(t);
85
+ }, me = (t) => {
86
+ if (!t) return "??";
87
+ const e = t.trim().split(/\s+/);
88
+ return e.length === 1 ? e[0].slice(0, 2).toUpperCase() : (e[0][0] + e[e.length - 1][0]).toUpperCase();
89
+ }, Y = [
90
+ { fg: "#7c3aed", bg: "rgba(124, 58, 237, 0.12)" },
91
+ // violet
92
+ { fg: "#0891b2", bg: "rgba(8, 145, 178, 0.12)" },
93
+ // cyan
94
+ { fg: "#ea580c", bg: "rgba(234, 88, 12, 0.12)" },
95
+ // orange
96
+ { fg: "#16a34a", bg: "rgba(22, 163, 74, 0.12)" },
97
+ // green
98
+ { fg: "#2563eb", bg: "rgba(37, 99, 235, 0.12)" },
99
+ // blue
100
+ { fg: "#db2777", bg: "rgba(219, 39, 119, 0.12)" },
101
+ // pink
102
+ { fg: "#475569", bg: "rgba(71, 85, 105, 0.12)" }
103
+ // slate
104
+ ], T = (t) => {
105
+ const e = (t.id || t.serviceName || "").toString();
106
+ let i = 0;
107
+ for (let d = 0; d < e.length; d++) i = i * 31 + e.charCodeAt(d) >>> 0;
108
+ return Y[i % Y.length];
109
+ }, fe = (t) => {
110
+ const e = t?.pricingOptions?.[0];
111
+ return e?.duration ? `${e.duration} min` : null;
112
+ }, ge = (t) => {
113
+ const e = t?.pricingOptions?.[0];
114
+ return e?.price === void 0 || e?.price === null || e?.price === "" ? null : `${t.currency === "EUR" ? "€" : "$"}${e.price}`;
115
+ }, ve = (t) => Array.isArray(t?.resources) ? t.resources.filter((e) => e?.isActive !== !1).length : 0, ye = (t) => t.type === "regular" ? "Regular" : t.type ? t.type.charAt(0).toUpperCase() + t.type.slice(1) : "Agenda", _e = (t) => {
116
+ m.value = !0, r.value = [t];
117
+ }, N = async () => {
118
+ w.value = await _.find(y.agendaCollection);
119
+ }, xe = async (t) => {
120
+ if (!b("create-agendas")) return;
121
+ const [e, i] = await Promise.all([
122
+ _.get(y.agendaCollection, t),
123
+ G(t)
124
+ ]);
125
+ if (!e) {
126
+ alert("Agenda not found");
127
+ return;
128
+ }
129
+ const d = prompt("Enter name for duplicated agenda", e.serviceName + " (Copy)");
130
+ if (!d)
131
+ return;
132
+ const p = { ...F(e), serviceName: d }, h = (await _.add(y.agendaCollection, p))?.id;
133
+ h && await L(h, i), await N();
134
+ }, be = async (t) => {
135
+ !b("delete-agendas") || !await ce("Are you sure you want to delete this agenda? This action cannot be undone.") || (await _.remove(y.agendaCollection, t), await N());
136
+ }, we = async () => {
137
+ if (!w.value) return;
138
+ const t = w.value.filter((p) => r.value.includes(p.id)), e = await Promise.all(t.map(async (p) => {
139
+ const [C, h] = await Promise.all([
140
+ _.get(y.agendaCollection, p.id),
141
+ G(p.id)
142
+ ]);
143
+ return {
144
+ ...F(C || p),
145
+ [B]: h
146
+ };
147
+ })), i = "data:text/json;charset=utf-8," + encodeURIComponent(JSON.stringify(e, null, 2)), d = document.createElement("a");
148
+ d.setAttribute("href", i), d.setAttribute("download", "agendas_export.json"), document.body.appendChild(d), d.click(), d.remove(), m.value = !1, r.value = [];
149
+ }, Ce = async (t) => {
150
+ const e = t.target;
151
+ if (!e.files || e.files.length === 0)
152
+ return;
153
+ const d = await e.files[0].text();
154
+ let p;
155
+ try {
156
+ p = JSON.parse(d);
157
+ } catch {
158
+ alert("Invalid JSON file");
159
+ return;
160
+ }
161
+ if (!Array.isArray(p)) {
162
+ alert("Invalid agendas format");
163
+ return;
164
+ }
165
+ for (const C of p) {
166
+ const h = C?.[B], P = (await _.add(y.agendaCollection, F(C)))?.id;
167
+ P && await L(P, h);
168
+ }
169
+ e.value = "", await N();
170
+ }, q = (t) => {
171
+ m.value || (b("edit-agendas") ? E(`/edit/${t}`) : E(`/edit/${t}/agenda`));
172
+ };
173
+ return N(), (t, e) => {
174
+ const i = u("Spinner"), d = u("EmptyMedia"), p = u("EmptyTitle"), C = u("EmptyDescription"), h = u("EmptyHeader"), x = u("Button"), P = u("EmptyContent"), he = u("Empty"), ke = u("Input"), K = u("DropdownMenuTrigger"), D = u("DropdownMenuItem"), Q = u("DropdownMenuGroup"), X = u("DropdownMenuContent"), W = u("DropdownMenu"), Ae = u("ButtonGroup"), Se = u("Checkbox"), $e = u("Badge");
175
+ return c(), g(ee, null, [
176
+ o("div", He, [
177
+ w.value === null ? (c(), g("div", Je, [
178
+ n(i, { class: "mx-auto" })
179
+ ])) : w.value.length === 0 ? (c(), $(he, { key: 1 }, {
180
+ default: s(() => [
181
+ n(h, null, {
182
+ default: s(() => [
183
+ n(d, { variant: "icon" }, {
184
+ default: s(() => [
185
+ n(a(Fe), { class: "size-4-6" })
186
+ ]),
187
+ _: 1
188
+ }),
189
+ n(p, null, {
190
+ default: s(() => [...e[6] || (e[6] = [
191
+ f("No Agendas Yet", -1)
192
+ ])]),
193
+ _: 1
194
+ }),
195
+ n(C, null, {
196
+ default: s(() => [...e[7] || (e[7] = [
197
+ f(" You haven't created any agenda yet. Get started by creating your first agenda. ", -1)
198
+ ])]),
199
+ _: 1
200
+ })
201
+ ]),
202
+ _: 1
203
+ }),
204
+ n(P, null, {
205
+ default: s(() => [
206
+ o("div", Ye, [
207
+ n(x, {
208
+ onClick: e[0] || (e[0] = (l) => a(E)("/create"))
209
+ }, {
210
+ default: s(() => [
211
+ n(a(oe)),
212
+ e[8] || (e[8] = f(" Create Agenda ", -1))
213
+ ]),
214
+ _: 1
215
+ })
216
+ ])
217
+ ]),
218
+ _: 1
219
+ })
220
+ ]),
221
+ _: 1
222
+ })) : (c(), g("div", qe, [
223
+ o("div", Ke, [
224
+ e[11] || (e[11] = o("div", null, [
225
+ o("h2", { class: "text-3xl font-bold tracking-tight" }, "Agendas"),
226
+ o("p", { class: "text-sm text-muted-foreground mt-1" }, " Manage your bookable services, hours and resources. ")
227
+ ], -1)),
228
+ o("div", Qe, [
229
+ o("div", Xe, [
230
+ n(a(se), { class: "absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground pointer-events-none" }),
231
+ n(ke, {
232
+ modelValue: z.value,
233
+ "onUpdate:modelValue": e[1] || (e[1] = (l) => z.value = l),
234
+ placeholder: "Search agendas...",
235
+ class: "pl-9 w-full @md:w-64"
236
+ }, null, 8, ["modelValue"])
237
+ ]),
238
+ !m.value && a(b)("create-agendas") ? (c(), $(Ae, { key: 0 }, {
239
+ default: s(() => [
240
+ n(x, {
241
+ onClick: e[2] || (e[2] = (l) => a(E)("/create"))
242
+ }, {
243
+ default: s(() => [
244
+ n(a(oe)),
245
+ e[9] || (e[9] = f(" New Agenda ", -1))
246
+ ]),
247
+ _: 1
248
+ }),
249
+ n(W, null, {
250
+ default: s(() => [
251
+ n(K, { "as-child": "" }, {
252
+ default: s(() => [
253
+ n(x, {
254
+ size: "icon",
255
+ "aria-label": "More Options"
256
+ }, {
257
+ default: s(() => [
258
+ n(a(le))
259
+ ]),
260
+ _: 1
261
+ })
262
+ ]),
263
+ _: 1
264
+ }),
265
+ n(X, {
266
+ align: "end",
267
+ class: "w-52"
268
+ }, {
269
+ default: s(() => [
270
+ n(Q, null, {
271
+ default: s(() => [
272
+ n(D, {
273
+ onClick: e[3] || (e[3] = (l) => U.value.click())
274
+ }, {
275
+ default: s(() => [
276
+ n(a(Te)),
277
+ e[10] || (e[10] = f(" Import Agendas... ", -1))
278
+ ]),
279
+ _: 1
280
+ })
281
+ ]),
282
+ _: 1
283
+ })
284
+ ]),
285
+ _: 1
286
+ })
287
+ ]),
288
+ _: 1
289
+ })
290
+ ]),
291
+ _: 1
292
+ })) : k("", !0)
293
+ ])
294
+ ]),
295
+ m.value ? (c(), g("div", We, [
296
+ o("div", Ze, [
297
+ n(Se, {
298
+ modelValue: H.value,
299
+ "onUpdate:modelValue": pe
300
+ }, null, 8, ["modelValue"]),
301
+ o("span", et, v(r.value.length) + " of " + v(A.value.length) + " selected ", 1)
302
+ ]),
303
+ o("div", tt, [
304
+ n(x, {
305
+ variant: "ghost",
306
+ onClick: e[4] || (e[4] = (l) => {
307
+ m.value = !1, r.value = [];
308
+ })
309
+ }, {
310
+ default: s(() => [...e[12] || (e[12] = [
311
+ f(" Cancel ", -1)
312
+ ])]),
313
+ _: 1
314
+ }),
315
+ n(x, {
316
+ onClick: we,
317
+ disabled: r.value.length === 0
318
+ }, {
319
+ default: s(() => [
320
+ n(a(ae)),
321
+ f(" Export " + v(r.value.length || ""), 1)
322
+ ]),
323
+ _: 1
324
+ }, 8, ["disabled"])
325
+ ])
326
+ ])) : k("", !0),
327
+ A.value.length === 0 ? (c(), g("div", nt, [
328
+ n(a(se), { class: "size-8 text-muted-foreground mb-3" }),
329
+ o("p", ot, 'No agendas match "' + v(z.value) + '"', 1),
330
+ e[13] || (e[13] = o("p", { class: "text-sm text-muted-foreground mt-1" }, "Try a different search term.", -1))
331
+ ])) : (c(), g("div", st, [
332
+ (c(!0), g(ee, null, De(A.value, (l) => (c(), g("div", {
333
+ key: l.id,
334
+ class: te(["group relative flex flex-col overflow-hidden rounded-xl border bg-card shadow-sm transition-all duration-200", {
335
+ "cursor-pointer": m.value,
336
+ "ring-2 ring-primary border-primary/40": m.value && r.value.includes(l.id)
337
+ }]),
338
+ onClick: (S) => m.value ? J(l.id) : null
339
+ }, [
340
+ o("div", {
341
+ class: "h-1 w-full",
342
+ style: ne({ backgroundColor: T(l).fg })
343
+ }, null, 4),
344
+ o("div", {
345
+ class: "flex flex-col flex-1 p-5",
346
+ onClick: (S) => !m.value && q(l.id)
347
+ }, [
348
+ o("div", it, [
349
+ o("div", {
350
+ class: "shrink-0 size-12 rounded-lg flex items-center justify-center font-semibold text-sm",
351
+ style: ne({
352
+ backgroundColor: T(l).bg,
353
+ color: T(l).fg
354
+ })
355
+ }, v(me(l.serviceName)), 5),
356
+ o("button", {
357
+ type: "button",
358
+ class: "flex-1 min-w-0 text-left focus:outline-none",
359
+ onClick: j((S) => m.value ? J(l.id) : q(l.id), ["stop"])
360
+ }, [
361
+ o("h3", dt, v(l.serviceName || "Untitled Agenda"), 1),
362
+ o("div", ct, [
363
+ n($e, {
364
+ variant: "secondary",
365
+ class: "text-[10px] font-medium px-1.5 py-0 h-4"
366
+ }, {
367
+ default: s(() => [
368
+ f(v(ye(l)), 1)
369
+ ]),
370
+ _: 2
371
+ }, 1024),
372
+ m.value ? k("", !0) : (c(), g("span", ut, " Click to " + v(a(b)("edit-agendas") ? "edit" : "view"), 1))
373
+ ])
374
+ ], 8, rt),
375
+ m.value ? (c(), g("div", pt, [
376
+ o("div", {
377
+ class: te(["flex items-center justify-center size-6 rounded-full border-2 transition", r.value.includes(l.id) ? "border-primary bg-primary text-primary-foreground" : "border-muted-foreground/30"])
378
+ }, [
379
+ r.value.includes(l.id) ? (c(), $(a(Ve), {
380
+ key: 0,
381
+ class: "size-4"
382
+ })) : k("", !0)
383
+ ], 2)
384
+ ])) : k("", !0)
385
+ ]),
386
+ o("div", mt, [
387
+ o("div", ft, [
388
+ o("div", gt, [
389
+ n(a(Be), { class: "size-3.5" }),
390
+ e[14] || (e[14] = o("span", { class: "text-[10px] uppercase tracking-wide font-medium" }, "Duration", -1))
391
+ ]),
392
+ o("span", vt, v(fe(l) || "—"), 1)
393
+ ]),
394
+ o("div", yt, [
395
+ o("div", _t, [
396
+ n(a(Ue), { class: "size-3.5" }),
397
+ e[15] || (e[15] = o("span", { class: "text-[10px] uppercase tracking-wide font-medium" }, "Price", -1))
398
+ ]),
399
+ o("span", xt, v(ge(l) || "—"), 1)
400
+ ]),
401
+ o("div", bt, [
402
+ o("div", wt, [
403
+ n(a(Oe), { class: "size-3.5" }),
404
+ e[16] || (e[16] = o("span", { class: "text-[10px] uppercase tracking-wide font-medium" }, "Resources", -1))
405
+ ]),
406
+ o("span", Ct, v(ve(l)), 1)
407
+ ])
408
+ ])
409
+ ], 8, at),
410
+ m.value ? k("", !0) : (c(), g("div", ht, [
411
+ a(b)("edit-agendas") ? (c(), $(x, {
412
+ key: 0,
413
+ variant: "ghost",
414
+ size: "sm",
415
+ class: "gap-1.5",
416
+ onClick: j((S) => a(E)(`/edit/${l.id}`), ["stop"])
417
+ }, {
418
+ default: s(() => [
419
+ n(a(ie), { class: "size-4" }),
420
+ e[17] || (e[17] = f(" Edit Agenda ", -1))
421
+ ]),
422
+ _: 1
423
+ }, 8, ["onClick"])) : (c(), $(x, {
424
+ key: 1,
425
+ variant: "ghost",
426
+ size: "sm",
427
+ class: "gap-1.5",
428
+ onClick: j((S) => a(E)(`/edit/${l.id}/agenda`), ["stop"])
429
+ }, {
430
+ default: s(() => [
431
+ n(a(ie), { class: "size-4" }),
432
+ e[18] || (e[18] = f(" View Agenda ", -1))
433
+ ]),
434
+ _: 1
435
+ }, 8, ["onClick"])),
436
+ n(W, null, {
437
+ default: s(() => [
438
+ n(K, { "as-child": "" }, {
439
+ default: s(() => [
440
+ n(x, {
441
+ variant: "ghost",
442
+ size: "icon",
443
+ "aria-label": "More Options",
444
+ onClick: e[5] || (e[5] = j(() => {
445
+ }, ["stop"]))
446
+ }, {
447
+ default: s(() => [
448
+ n(a(le))
449
+ ]),
450
+ _: 1
451
+ })
452
+ ]),
453
+ _: 1
454
+ }),
455
+ n(X, {
456
+ align: "end",
457
+ class: "w-52"
458
+ }, {
459
+ default: s(() => [
460
+ n(Q, null, {
461
+ default: s(() => [
462
+ a(b)("create-agendas") ? (c(), $(D, {
463
+ key: 0,
464
+ onClick: (S) => xe(l.id)
465
+ }, {
466
+ default: s(() => [
467
+ n(a(Re)),
468
+ e[19] || (e[19] = f(" Duplicate Agenda ", -1))
469
+ ]),
470
+ _: 1
471
+ }, 8, ["onClick"])) : k("", !0),
472
+ n(D, null, {
473
+ default: s(() => [
474
+ n(a(Ge)),
475
+ e[20] || (e[20] = f(" API Set-up ", -1))
476
+ ]),
477
+ _: 1
478
+ }),
479
+ n(D, {
480
+ onClick: (S) => _e(l.id)
481
+ }, {
482
+ default: s(() => [
483
+ n(a(ae)),
484
+ e[21] || (e[21] = f(" Export Agenda ", -1))
485
+ ]),
486
+ _: 1
487
+ }, 8, ["onClick"]),
488
+ a(b)("delete-agendas") ? (c(), $(D, {
489
+ key: 1,
490
+ variant: "destructive",
491
+ onClick: (S) => be(l.id)
492
+ }, {
493
+ default: s(() => [
494
+ n(a(Le)),
495
+ e[22] || (e[22] = f(" Remove Agenda ", -1))
496
+ ]),
497
+ _: 1
498
+ }, 8, ["onClick"])) : k("", !0)
499
+ ]),
500
+ _: 2
501
+ }, 1024)
502
+ ]),
503
+ _: 2
504
+ }, 1024)
505
+ ]),
506
+ _: 2
507
+ }, 1024)
508
+ ]))
509
+ ], 10, lt))), 128))
510
+ ]))
511
+ ]))
512
+ ]),
513
+ o("input", {
514
+ type: "file",
515
+ ref_key: "importAgendasInput",
516
+ ref: U,
517
+ class: "hidden",
518
+ accept: ".json,application/json",
519
+ onChange: Ce
520
+ }, null, 544)
521
+ ], 64);
522
+ };
523
+ }
524
+ });
525
+ export {
526
+ Et as default
527
+ };
@@ -1,10 +1,10 @@
1
1
  import { defineComponent as w, resolveComponent as M, openBlock as a, createElementBlock as m, createVNode as n, withCtx as v, createElementVNode as e, unref as s, createTextVNode as x, toDisplayString as d, normalizeClass as b, computed as T, createBlock as k, normalizeStyle as z, createCommentVNode as $, Fragment as R, renderList as B, ref as _, watch as te, onMounted as se } from "vue";
2
2
  import { useModule as oe, useModuleRoute as ne, useModuleBreadcrumbs as re } from "@oneclick.dev/cms-kit";
3
3
  import { MousePointerClick as K, Eye as q, TrendingUp as le, Hash as ae, RefreshCw as ie, AlertTriangle as de, Loader2 as ue, Search as ce, FileText as me, ArrowUpRight as xe } from "lucide-vue-next";
4
- import "./index-CkVwMqpn.mjs";
4
+ import "./index-Bnn9LahC.mjs";
5
5
  import { componentToString as V, ChartTooltipContent as X } from "@oneclick.dev/cms-kit/charts";
6
- import { $ as j, O as U, A as G, z as J } from "./index-BIF2RB7k.mjs";
7
- import { P as Q, S as W } from "./index-B8GvmAwh.mjs";
6
+ import { $ as j, O as U, A as G, z as J } from "./index-cC_2cw31.mjs";
7
+ import { P as Q, S as W } from "./index-DiTIA8Sh.mjs";
8
8
  function S(t) {
9
9
  return t >= 1e6 ? `${(t / 1e6).toFixed(1)}M` : t >= 1e3 ? `${(t / 1e3).toFixed(1)}K` : Math.round(t).toString();
10
10
  }