@oneclick.dev/cms-core-modules 0.0.119 → 0.0.121
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.
- package/dist/{ContentEditor-BnOVpmsQ.js → ContentEditor-Dl41qaCh.js} +42 -41
- package/dist/{ContentEditor-Cm28u_14.mjs → ContentEditor-u3k-uTny.mjs} +4785 -4492
- package/dist/{Detail-C8wQiDcv.js → Detail-BCUUNWvp.js} +1 -1
- package/dist/{Detail-CtItxMX4.mjs → Detail-B_scnidb.mjs} +1 -1
- package/dist/Detail-Cn9Bk0u0.mjs +852 -0
- package/dist/Detail-DGg_xXZc.js +1 -0
- package/dist/Detail-Dk8E6_uF.mjs +3731 -0
- package/dist/Detail-Sc2qZdxj.js +1 -0
- package/dist/EditLayout.vue_vue_type_script_setup_true_lang-4_t0PPqM.mjs +78 -0
- package/dist/EditLayout.vue_vue_type_script_setup_true_lang-D1b9_iiN.js +1 -0
- package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-BdZbcubW.js +1 -0
- package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-bZidw6RT.mjs +1500 -0
- package/dist/Overview-CVgViW3c.mjs +852 -0
- package/dist/Overview-DEF-z7Yb.js +1 -0
- package/dist/Overview-Tf_ApkWh.js +1 -0
- package/dist/{Overview-CVQ1pkuD.mjs → Overview-usm5gPD1.mjs} +131 -131
- package/dist/{agenda-BtmnpFmi.js → agenda-B54F8cEr.js} +1 -1
- package/dist/{agenda-D0QBOJUy.mjs → agenda-BCKDYOeF.mjs} +7 -7
- package/dist/{availability-ClBGVgE9.js → availability-C4v46rha.js} +1 -1
- package/dist/{availability-D8JdA4rP.mjs → availability-DVT1Mdxq.mjs} +1 -1
- package/dist/{booking-data-aMS1p_3g.js → booking-data-A5JrLY4j.js} +1 -1
- package/dist/{booking-data-Px7XCIfU.mjs → booking-data-lZvSYna2.mjs} +1 -1
- package/dist/cms-core-modules.css +1 -1
- package/dist/{exceptions-Dgj54ULn.mjs → exceptions-DJHfvADv.mjs} +1 -1
- package/dist/{exceptions-DXqc0Nza.js → exceptions-DKc8fO1S.js} +1 -1
- package/dist/index-Bk3yLv_G.js +35 -0
- package/dist/{index-Dnn2SCSl.js → index-CZau1wR8.js} +1 -1
- package/dist/{index-DRqJOqUR.mjs → index-DE8rdSjd.mjs} +0 -22
- package/dist/index-DU3Ib10Z.mjs +1256 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.mjs +35 -33
- package/dist/orders-BMosTk6r.js +1 -0
- package/dist/{orders-C5NT99Fy.mjs → orders-CElKNc1v.mjs} +229 -234
- package/dist/{payment-D5j-68Ig.mjs → payment-DSQ_2FIT.mjs} +1 -1
- package/dist/{payment-BJHgpaeT.js → payment-DlgYuea2.js} +1 -1
- package/dist/{refunds-oVB2Opib.js → refunds-Cvw9N--u.js} +1 -1
- package/dist/{refunds-D9nTeD2d.mjs → refunds-xR936Ted.mjs} +1 -1
- package/dist/reports-BQT_GZzU.js +158 -0
- package/dist/reports-DksZCTOw.mjs +837 -0
- package/dist/{resources-CK0oWssj.mjs → resources-C-5BU9Ux.mjs} +1 -1
- package/dist/{resources-8WouFvJe.js → resources-D04yKKVN.js} +1 -1
- package/dist/src/appointments/components/edit/NewReservationDialog/QuickReservationAdder.vue.d.ts +2 -0
- package/dist/src/appointments/components/edit/NewReservationDialog/ReservationLines.vue.d.ts +1 -0
- package/dist/src/productCollections/components/detail/Subcollections.vue.d.ts +2 -0
- package/dist/src/productCollections/types.d.ts +1 -4
- package/dist/src/products/components/detail/variants/VariantList.vue.d.ts +48 -6
- package/dist/src/products/components/detail/variants/dialogs/VariantDialog.vue.d.ts +4 -0
- package/dist/{vee-validate-zod-CcOwoF6y.mjs → vee-validate-zod-SjDT8X35.mjs} +92 -90
- package/dist/{vee-validate-zod-ByykgYKJ.js → vee-validate-zod-VCmLnrtQ.js} +1 -1
- package/package.json +2 -2
- package/dist/Detail-C1Blq61w.mjs +0 -585
- package/dist/Detail-CPqug27l.js +0 -1
- package/dist/Detail-CjuhjPby.js +0 -1
- package/dist/Detail-Dnpnmy4-.mjs +0 -3477
- package/dist/EditLayout.vue_vue_type_script_setup_true_lang-gozJKXvM.js +0 -1
- package/dist/EditLayout.vue_vue_type_script_setup_true_lang-pDO9b4Pv.mjs +0 -77
- package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-CcMEKZzd.mjs +0 -1476
- package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-CkFsdcvP.js +0 -1
- package/dist/Overview-BWLxUksJ.mjs +0 -860
- package/dist/Overview-CBahJviK.js +0 -1
- package/dist/Overview-DAxCu9XC.js +0 -1
- package/dist/index-BnFWz40Q.mjs +0 -1261
- package/dist/index-DcGPR_vt.js +0 -35
- package/dist/orders-lO3dZ5un.js +0 -1
- /package/dist/src/{productCollections/components/detail/SEO.vue.d.ts → appointments/pages/edit/reports.vue.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),y=require("lucide-vue-next"),k=require("@oneclick.dev/cms-kit"),W=require("./index-CxETuRsG.js"),X=require("./utils-Yd6F5mea.js"),h=require("./index-ijdf0d9-.js"),J={class:"grid @md:grid-cols-2 @2xl:grid-cols-3 @3xl:grid-cols-4 @4xl:grid-cols-5 @5xl:grid-cols-6 gap-6"},Y=["onClick","onContextmenu"],Z=["src"],ee={class:"font-semibold"},te={class:"text-sm text-muted-foreground flex items-center gap-2"},oe={class:"flex items-center gap-2"},ne={key:0},le=e.defineComponent({__name:"GridView",props:{products:{type:Array,required:!0}},setup(S){const n=e.inject("selection"),{navigateTo:b}=k.useModuleRoute(),{hasPermission:g}=k.useModulePermissions(),a=(l,o)=>{const i=o.ctrlKey||o.metaKey;if(!o.shiftKey)if(i||n.value.length>0){const C=n.value.indexOf(l.id);C>-1?n.value.splice(C,1):n.value.push(l.id)}else n.value=[],b(l.id)},f=l=>{l.target.closest(".GRID_ITEM")||(n.value=[])},p=(l,o)=>{o.ctrlKey||o.metaKey?n.value.includes(l.id)?n.value.splice(n.value.indexOf(l.id),1):n.value.push(l.id):n.value.includes(l.id)||(n.value=[l.id])};return(l,o)=>(e.openBlock(),e.createElementBlock("div",{class:"@container mb-4 flex-1 select-none",onClick:o[0]||(o[0]=i=>n.value=[]),onContextmenu:f},[e.createElementVNode("div",J,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.products,i=>(e.openBlock(),e.createElementBlock("div",{key:i.id,onClick:e.withModifiers(v=>a(i,v),["stop"]),onContextmenu:v=>p(i,v),class:"GRID_ITEM cursor-pointer"},[e.createElementVNode("div",{class:e.normalizeClass(["aspect-square bg-muted rounded-xl overflow-hidden mb-2 transition-all duration-200",{"outline outline-4 outline-primary/50":e.unref(n).includes(i.id)}])},[i.featuredMedia?(e.openBlock(),e.createElementBlock("img",{key:0,src:i.featuredMedia,class:"w-full h-full object-cover pointer-events-none",draggable:"false"},null,8,Z)):e.createCommentVNode("",!0)],2),e.createElementVNode("div",null,[e.createElementVNode("p",ee,e.toDisplayString(i.title),1),e.createElementVNode("p",te,[e.createElementVNode("span",oe,[i.status==="published"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[o[1]||(o[1]=e.createElementVNode("span",{class:"block shrink-0 size-3 rounded-full bg-green-500"},null,-1)),o[2]||(o[2]=e.createTextVNode(" Published ",-1))],64)):i.status==="draft"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[o[3]||(o[3]=e.createElementVNode("span",{class:"block shrink-0 size-3 rounded-full bg-blue-500"},null,-1)),o[4]||(o[4]=e.createTextVNode(" Draft ",-1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[o[5]||(o[5]=e.createElementVNode("span",{class:"block shrink-0 size-3 rounded-full bg-gray-300"},null,-1)),o[6]||(o[6]=e.createTextVNode(" Archived ",-1))],64))]),i.variantsTotal>1?(e.openBlock(),e.createElementBlock("span",ne,"| "+e.toDisplayString(i.variantsTotal)+" variants",1)):e.createCommentVNode("",!0)])])],40,Y))),128))])],32))}}),re={class:"flex items-center gap-2"},se={key:0,class:"bg-green-500 text-green-950 px-2 py-1 rounded-lg text-xs"},ae={key:1,class:"bg-blue-500 text-blue-950 px-2 py-1 rounded-lg text-xs"},ie={key:2,class:"bg-gray-500 text-gray-950 px-2 py-1 rounded-lg text-xs"},ue=e.defineComponent({__name:"ListView",props:{products:{type:Array,required:!0}},setup(S){const n=e.inject("selection"),{navigateTo:b}=k.useModuleRoute(),{hasPermission:g}=k.useModulePermissions(),a=(f,p)=>{f?n.value.push(p):n.value=n.value.filter(l=>l!==p)};return(f,p)=>{const l=e.resolveComponent("TableHead"),o=e.resolveComponent("TableRow"),i=e.resolveComponent("TableHeader"),v=e.resolveComponent("Checkbox"),C=e.resolveComponent("TableCell"),d=e.resolveComponent("AvatarImage"),t=e.resolveComponent("AvatarFallback"),m=e.resolveComponent("Avatar"),x=e.resolveComponent("TableBody"),V=e.resolveComponent("Table"),N=e.resolveComponent("Card");return e.openBlock(),e.createBlock(N,{class:"w-full py-4 px-4"},{default:e.withCtx(()=>[e.createVNode(V,{class:"rounded overflow-hidden"},{default:e.withCtx(()=>[e.createVNode(i,null,{default:e.withCtx(()=>[e.createVNode(o,null,{default:e.withCtx(()=>[e.unref(n)?.length>0?(e.openBlock(),e.createBlock(l,{key:0})):e.createCommentVNode("",!0),e.createVNode(l,null,{default:e.withCtx(()=>[...p[1]||(p[1]=[e.createTextVNode("Title",-1)])]),_:1}),e.createVNode(l,null,{default:e.withCtx(()=>[...p[2]||(p[2]=[e.createTextVNode("Status",-1)])]),_:1}),e.createVNode(l,null,{default:e.withCtx(()=>[...p[3]||(p[3]=[e.createTextVNode(" Variants",-1)])]),_:1}),e.createVNode(l,null,{default:e.withCtx(()=>[...p[4]||(p[4]=[e.createTextVNode("Price",-1)])]),_:1})]),_:1})]),_:1}),e.createVNode(x,null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.products,c=>(e.openBlock(),e.createBlock(o,{key:c.id,onClick:_=>e.unref(b)(c.id),class:"cursor-pointer"},{default:e.withCtx(()=>[e.unref(n)?.length>0?(e.openBlock(),e.createBlock(C,{key:0},{default:e.withCtx(()=>[e.createVNode(v,{"model-value":e.unref(n)?.includes(c.id),"onUpdate:modelValue":_=>a(_,c.id),onClick:p[0]||(p[0]=e.withModifiers(()=>{},["prevent","stop"]))},null,8,["model-value","onUpdate:modelValue"])]),_:2},1024)):e.createCommentVNode("",!0),e.createVNode(C,{class:"font-medium"},{default:e.withCtx(()=>[e.createElementVNode("div",re,[e.createVNode(m,{class:"size-12 rounded-xl"},{default:e.withCtx(()=>[e.createVNode(d,{src:c.media?.[0],class:"object-cover"},null,8,["src"]),e.createVNode(t,{class:"rounded-xl"})]),_:2},1024),e.createElementVNode("span",null,e.toDisplayString(c.title),1)])]),_:2},1024),e.createVNode(C,null,{default:e.withCtx(()=>[c.status==="published"?(e.openBlock(),e.createElementBlock("span",se,"Published")):c.status==="draft"?(e.openBlock(),e.createElementBlock("span",ae,"Draft")):c.status==="archived"?(e.openBlock(),e.createElementBlock("span",ie,"Archived")):e.createCommentVNode("",!0)]),_:2},1024),e.createVNode(C,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.variantsTotal),1)]),_:2},1024),e.createVNode(C,{class:"text-right"},{default:e.withCtx(()=>[e.createTextVNode(" € "+e.toDisplayString(c.price||0),1)]),_:2},1024)]),_:2},1032,["onClick"]))),128))]),_:1})]),_:1})]),_:1})}}}),ce={class:"truncate"},de={key:0},pe={key:1},me={key:2},fe={key:3},ve={class:"relative w-full max-w-sm items-center"},Ce={class:"truncate"},xe={class:"flex items-center space-x-2 mb-4"},ge={class:"flex items-center space-x-2 mb-4"},Ve={class:"flex items-center space-x-2 mb-4"},Ne=e.defineComponent({__name:"FilterPopover",setup(S){const n=e.inject("filter"),b=e.inject("collections"),g=e.computed(()=>(e.unref(b)||[]).flatMap(l=>{const o=l.status||"draft",i=[{id:l.id,title:l.title,status:o,isSubcollection:!1}];return Array.isArray(l.subcollections)&&i.push(...l.subcollections.map(v=>({id:v.id,title:v.title,status:o==="published"&&v.status||o,isSubcollection:!0,parentTitle:l.title}))),i})),a=e.computed(()=>Array.isArray(n.value.collections)?n.value.collections.map(l=>g.value.find(o=>o.id===l)).filter(Boolean):[]),f=l=>l.isSubcollection?`${l.parentTitle} / ${l.title}`:l.title,p=()=>{n.value={collections:[],published:!0,draft:!0,archived:!1}};return(l,o)=>{const i=e.resolveComponent("Button"),v=e.resolveComponent("PopoverTrigger"),C=e.resolveComponent("ComboboxTrigger"),d=e.resolveComponent("ComboboxAnchor"),t=e.resolveComponent("ComboboxInput"),m=e.resolveComponent("ComboboxEmpty"),x=e.resolveComponent("ComboboxItemIndicator"),V=e.resolveComponent("ComboboxItem"),N=e.resolveComponent("ScrollArea"),c=e.resolveComponent("ComboboxGroup"),_=e.resolveComponent("ComboboxList"),w=e.resolveComponent("Combobox"),E=e.resolveComponent("Checkbox"),T=e.resolveComponent("PopoverContent"),D=e.resolveComponent("Popover");return e.openBlock(),e.createBlock(D,null,{default:e.withCtx(()=>[e.createVNode(v,{asChild:""},{default:e.withCtx(()=>[e.createVNode(i,{variant:"outline"},{default:e.withCtx(()=>[e.createVNode(e.unref(y.Filter),{class:"size-4"}),o[4]||(o[4]=e.createTextVNode(" Filter ",-1))]),_:1})]),_:1}),e.createVNode(T,{class:"w-64"},{default:e.withCtx(()=>[o[10]||(o[10]=e.createElementVNode("p",{class:"text-sm font-medium text-muted-foreground mb-4"}," Filter by Collection ",-1)),e.createVNode(w,{modelValue:e.unref(n).collections,"onUpdate:modelValue":o[0]||(o[0]=u=>e.unref(n).collections=u),by:"id",multiple:!0,class:"mb-6"},{default:e.withCtx(()=>[e.createVNode(d,{"as-child":""},{default:e.withCtx(()=>[e.createVNode(C,{"as-child":""},{default:e.withCtx(()=>[e.createVNode(i,{variant:"outline",class:"justify-between w-full"},{default:e.withCtx(()=>[e.createElementVNode("span",ce,[a.value.length===1?(e.openBlock(),e.createElementBlock("span",de,e.toDisplayString(f(a.value[0])),1)):a.value.length===2?(e.openBlock(),e.createElementBlock("span",pe,e.toDisplayString(f(a.value[0]))+", "+e.toDisplayString(f(a.value[1])),1)):a.value.length>2?(e.openBlock(),e.createElementBlock("span",me,e.toDisplayString(f(a.value[0]))+", "+e.toDisplayString(f(a.value[1]))+" + "+e.toDisplayString(a.value.length-2),1)):(e.openBlock(),e.createElementBlock("span",fe,"Select collection"))]),e.createVNode(e.unref(y.ChevronsUpDown),{class:"ml-2 size-4 shrink-0 opacity-50"})]),_:1})]),_:1})]),_:1}),e.createVNode(_,null,{default:e.withCtx(()=>[e.createElementVNode("div",ve,[e.createVNode(t,{placeholder:"Select collection..."})]),e.createVNode(m,null,{default:e.withCtx(()=>[...o[5]||(o[5]=[e.createTextVNode(" No collection found. ",-1)])]),_:1}),e.createVNode(c,null,{default:e.withCtx(()=>[e.createVNode(N,{class:"max-h-[200px] overflow-y-auto"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,u=>(e.openBlock(),e.createBlock(V,{key:u.id,value:u.id},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["flex min-w-0 items-center gap-2",{"pl-4":u.isSubcollection}])},[u.isSubcollection?(e.openBlock(),e.createBlock(e.unref(y.CornerDownRight),{key:0,class:"size-4 shrink-0 text-muted-foreground"})):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["size-2 rounded-full shrink-0",u.status==="published"?"bg-green-500":"bg-blue-500"])},null,2),e.createElementVNode("span",Ce,e.toDisplayString(u.title),1)],2),e.createVNode(x,null,{default:e.withCtx(()=>[e.createVNode(e.unref(y.Check),{class:e.normalizeClass(e.unref(X.classNames)("ml-auto size-4"))},null,8,["class"])]),_:1})]),_:2},1032,["value"]))),128))]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"]),o[11]||(o[11]=e.createElementVNode("p",{class:"text-sm font-medium text-muted-foreground mb-4"}," Filter by Status ",-1)),e.createElementVNode("div",xe,[e.createVNode(E,{id:"chk_published_products",modelValue:e.unref(n).published,"onUpdate:modelValue":o[1]||(o[1]=u=>e.unref(n).published=u)},null,8,["modelValue"]),o[6]||(o[6]=e.createElementVNode("label",{for:"chk_published_products",class:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"}," Show published products ",-1))]),e.createElementVNode("div",ge,[e.createVNode(E,{id:"chk_draft_products",modelValue:e.unref(n).draft,"onUpdate:modelValue":o[2]||(o[2]=u=>e.unref(n).draft=u)},null,8,["modelValue"]),o[7]||(o[7]=e.createElementVNode("label",{for:"chk_draft_products",class:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"}," Show draft products ",-1))]),e.createElementVNode("div",Ve,[e.createVNode(E,{id:"chk_archived_products",modelValue:e.unref(n).archived,"onUpdate:modelValue":o[3]||(o[3]=u=>e.unref(n).archived=u)},null,8,["modelValue"]),o[8]||(o[8]=e.createElementVNode("label",{for:"chk_archived_products",class:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"}," Show archived products ",-1))]),e.unref(n).collections.length>0||!e.unref(n).published||!e.unref(n).draft||e.unref(n).archived?(e.openBlock(),e.createBlock(i,{key:0,variant:"secondary",class:"ml-auto my-2",size:"sm",onClick:p},{default:e.withCtx(()=>[e.createVNode(e.unref(y.RotateCcw),{class:"size-3"}),o[9]||(o[9]=e.createElementVNode("span",{class:"ml-0.5 text-xs"},"Reset filters",-1))]),_:1})):e.createCommentVNode("",!0)]),_:1})]),_:1})}}}),be=e.defineComponent({__name:"ProductContextMenu",emits:["selectAll","duplicateProduct","deleteProduct","deleteSelection"],setup(S,{emit:n}){const b=n,g=e.inject("products"),a=e.inject("selection"),f=e.inject("config"),{hasPermission:p}=k.useModulePermissions(),{navigateTo:l}=k.useModuleRoute(),o=e.computed(()=>a.value?.length!==1?null:g.value?.find(d=>d.id===a.value[0])),i=d=>{let t=f.previewUrl;t=t.replace("{{ id","{{id"),t=t.replace("id }}","id}}"),t=t.replace("{{id}}",d.id),t=t.replace("{{ slug","{{slug"),t=t.replace("slug }}","slug}}"),t=t.replace("{{slug}}",d.slug),window.open(t,"_blank")},v=async(d,t)=>{try{if(!["draft","published","archived"].includes(t))return;await k.useFirebaseIntegration(f.project).update(f.productCollection,d.id,{status:t}),d.status=t,h.toast.success("Product status changed")}catch{h.toast.error("Failed to change product status")}},C=async d=>{try{if(!["draft","published","archived"].includes(d))return;const t=k.useFirebaseIntegration(f.project),m=[];a.value.forEach(async x=>{m.push(t.update(f.productCollection,x,{status:d}))}),h.toast.promise(Promise.all(m),{loading:`Changing status of ${a.value.length} products...`,success:()=>{const x=a.value.length;return a.value.forEach(V=>{g.value.find(N=>N.id==V).status=d}),a.value=[],`Product status changed for ${x} products`},error:x=>"Failed to change product status"})}catch{h.toast.error("Failed to change product status")}};return(d,t)=>{const m=e.resolveComponent("ContextMenuTrigger"),x=e.resolveComponent("ContextMenuShortcut"),V=e.resolveComponent("ContextMenuItem"),N=e.resolveComponent("ContextMenuContent"),c=e.resolveComponent("ContextMenuSeparator"),_=e.resolveComponent("ContextMenuSubTrigger"),w=e.resolveComponent("ContextMenuCheckboxItem"),E=e.resolveComponent("ContextMenuSubContent"),T=e.resolveComponent("ContextMenuSub"),D=e.resolveComponent("ContextMenu");return e.openBlock(),e.createBlock(D,null,{default:e.withCtx(()=>[e.createVNode(m,{class:"flex flex-1"},{default:e.withCtx(()=>[e.renderSlot(d.$slots,"default")]),_:3}),e.unref(a).length===0?(e.openBlock(),e.createBlock(N,{key:0,class:"w-64"},{default:e.withCtx(()=>[e.createVNode(V,{inset:"",onClick:t[0]||(t[0]=u=>b("selectAll"))},{default:e.withCtx(()=>[t[13]||(t[13]=e.createTextVNode(" Select all ",-1)),e.createVNode(x,null,{default:e.withCtx(()=>[...t[12]||(t[12]=[e.createTextVNode("⌘ + A",-1)])]),_:1})]),_:1})]),_:1})):e.createCommentVNode("",!0),e.unref(a).length===1&&o.value?(e.openBlock(),e.createBlock(N,{key:1,class:"w-64"},{default:e.withCtx(()=>[e.createVNode(V,{inset:"",onClick:t[1]||(t[1]=u=>e.unref(l)(o.value.id))},{default:e.withCtx(()=>[...t[14]||(t[14]=[e.createTextVNode(" Edit product ",-1)])]),_:1}),e.createVNode(c),e.unref(f).previewUrl?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(V,{inset:"",onClick:t[2]||(t[2]=u=>i(o.value))},{default:e.withCtx(()=>[t[15]||(t[15]=e.createTextVNode(" Preview product ",-1)),e.createVNode(x,null,{default:e.withCtx(()=>[e.createVNode(e.unref(y.ExternalLink),{class:"size-4"})]),_:1})]),_:1}),e.createVNode(c)],64)):e.createCommentVNode("",!0),e.createVNode(V,{inset:"",onClick:t[3]||(t[3]=u=>b("duplicateProduct",o.value))},{default:e.withCtx(()=>[...t[16]||(t[16]=[e.createTextVNode(" Duplicate product ",-1)])]),_:1}),e.createVNode(T,null,{default:e.withCtx(()=>[e.createVNode(_,{inset:""},{default:e.withCtx(()=>[...t[17]||(t[17]=[e.createTextVNode(" Change status ",-1)])]),_:1}),e.createVNode(E,{class:"w-48"},{default:e.withCtx(()=>[e.createVNode(w,{onClick:t[4]||(t[4]=u=>v(o.value,"draft")),modelValue:o.value.status==="draft"},{default:e.withCtx(()=>[...t[18]||(t[18]=[e.createElementVNode("span",{class:"size-2 rounded-full bg-blue-500"},null,-1),e.createTextVNode(" Draft ",-1)])]),_:1},8,["modelValue"]),e.createVNode(w,{onClick:t[5]||(t[5]=u=>v(o.value,"published")),modelValue:o.value.status==="published"},{default:e.withCtx(()=>[...t[19]||(t[19]=[e.createElementVNode("span",{class:"size-2 rounded-full bg-green-500"},null,-1),e.createTextVNode(" Published ",-1)])]),_:1},8,["modelValue"]),e.createVNode(w,{onClick:t[6]||(t[6]=u=>v(o.value,"archived")),modelValue:o.value.status==="archived"},{default:e.withCtx(()=>[...t[20]||(t[20]=[e.createElementVNode("span",{class:"size-2 rounded-full bg-gray-300"},null,-1),e.createTextVNode(" Archived ",-1)])]),_:1},8,["modelValue"])]),_:1})]),_:1}),e.createVNode(V,{inset:"",variant:"destructive",onClick:t[7]||(t[7]=u=>b("deleteProduct",o.value))},{default:e.withCtx(()=>[...t[21]||(t[21]=[e.createTextVNode(" Delete product ",-1)])]),_:1})]),_:1})):e.createCommentVNode("",!0),e.unref(a).length>1?(e.openBlock(),e.createBlock(N,{key:2,class:"w-64"},{default:e.withCtx(()=>[e.createVNode(T,null,{default:e.withCtx(()=>[e.createVNode(_,{inset:""},{default:e.withCtx(()=>[e.createTextVNode(" Change status ("+e.toDisplayString(e.unref(a).length)+") ",1)]),_:1}),e.createVNode(E,{class:"w-48"},{default:e.withCtx(()=>[e.createVNode(w,{onClick:t[8]||(t[8]=u=>C("draft"))},{default:e.withCtx(()=>[...t[22]||(t[22]=[e.createElementVNode("span",{class:"size-2 rounded-full bg-blue-500"},null,-1),e.createTextVNode(" Draft ",-1)])]),_:1}),e.createVNode(w,{onClick:t[9]||(t[9]=u=>C("published"))},{default:e.withCtx(()=>[...t[23]||(t[23]=[e.createElementVNode("span",{class:"size-2 rounded-full bg-green-500"},null,-1),e.createTextVNode(" Published ",-1)])]),_:1}),e.createVNode(w,{onClick:t[10]||(t[10]=u=>C("archived"))},{default:e.withCtx(()=>[...t[24]||(t[24]=[e.createElementVNode("span",{class:"size-2 rounded-full bg-gray-300"},null,-1),e.createTextVNode(" Archived ",-1)])]),_:1})]),_:1})]),_:1}),e.createVNode(V,{inset:"",variant:"destructive",onClick:t[11]||(t[11]=u=>b("deleteSelection"))},{default:e.withCtx(()=>[e.createTextVNode(" Delete products ("+e.toDisplayString(e.unref(a).length)+") ",1)]),_:1})]),_:1})):e.createCommentVNode("",!0)]),_:3})}}}),ke={class:"relative flex flex-col flex-1"},_e={ref:"container",class:"flex items-center justify-between gap-4 w-full mt-12 mb-8"},we={class:"flex items-center gap-4"},he={class:"text-lg whitespace-nowrap"},ye={class:"relative w-full max-w-sm items-center"},Be={class:"absolute start-0 inset-y-0 flex items-center justify-center px-2"},Ee={class:"flex items-center gap-4"},Pe={class:"flex flex-1"},Se=e.defineComponent({__name:"Overview",props:{config:{type:Object,required:!0}},async setup(S){let n,b;const g=S,{hasPermission:a}=k.useModulePermissions(),{navigateTo:f}=k.useModuleRoute(),{confirm:p}=k.useConfirmation();k.useModuleBreadcrumbs(()=>[]);const l=k.useFirebaseIntegration(g.config.project),o=e.ref([]),i=async()=>{const s=await l.find(g.config.productCollection);o.value=s||[]},v=e.useTemplateRef("container"),{width:C}=W.useElementSize(v),d=e.ref("grid"),t=e.ref(1),m=e.ref([]),x=e.ref(""),V=e.ref([]);V.value=([n,b]=e.withAsyncContext(()=>w()),n=await n,b(),n);const N=e.computed(()=>d.value==="grid"?C.value<768?6:C.value<896?8:C.value<1024?10:12:10),c=e.computed(()=>o.value.filter(s=>!($.value.collections.length>0&&!s.collections?.some(r=>$.value.collections.includes(r))||!$.value.published&&s.status==="published"||!$.value.draft&&s.status==="draft"||!$.value.archived&&s.status==="archived")).filter(s=>s.title.toLowerCase().includes(x.value.toLowerCase())||s.slug.toLowerCase().includes(x.value.toLowerCase())||s.id.toLowerCase().includes(x.value.toLowerCase()))),_=e.computed(()=>{if(c.value.length<=N.value)return c.value;const s=(t.value-1)*N.value,r=s+N.value;return c.value.slice(s,r)});async function w(){if(!g.config.collectionsCollection)return[];const s=g.config.collectionsCollection.split(":");return s.length!==2?[]:(await l.get(s[0]))?.[s[1]]||[]}async function E(s){return(await l.find(g.config.productCollection,{filters:[{field:"slug",operator:"==",value:s}]})).length>0}const T=()=>{m.value=_.value.map(s=>s.id)},D=async s=>{try{let r={...s},P=r.slug+"-copy",M=2;for(;await E(P);)P=r.slug+"-copy-"+M,M++;r.id=void 0,r.createdAt=new Date,r.updatedAt=new Date,r.slug=P,r.status="draft",r.title=r.title+" (copy)";const z=await l.add(g.config.productCollection,r);f(z.id),h.toast.success("Product duplicated")}catch{h.toast.error("Failed to duplicate product")}},u=async s=>{if(await p(`Are you sure you want to delete "${s.title}"?`))try{await l.remove(g.config.productCollection,s.id),o.value=o.value.filter(P=>P.id!==s.id),m.value=[],h.toast.success("Product deleted")}catch{h.toast.error("Failed to delete product")}},F=async()=>{if(await p(`Are you sure you want to delete all selected products (${m.value.length})?`))try{m.value.forEach(async r=>{await l.remove(g.config.productCollection,r)}),o.value=o.value.filter(r=>!m.value.includes(r.id)),m.value=[],h.toast.success("Products deleted")}catch{h.toast.error("Failed to delete products")}},$=e.ref({collections:[],published:!0,draft:!0,archived:!1});e.watch($,()=>{t.value=1});const I=s=>{s.target?.matches("input, textarea")||s.target?.isContentEditable||(s.key==="Escape"&&(m.value=[]),(s.metaKey||s.ctrlKey)&&s.key.toLowerCase()==="a"&&(s.preventDefault(),T()))};return e.onMounted(()=>{i(),window.addEventListener("keydown",I)}),e.onUnmounted(()=>{window.removeEventListener("keydown",I)}),e.provide("config",g.config),e.provide("filter",$),e.provide("products",o),e.provide("collections",V),e.provide("selection",m),(s,r)=>{const P=e.resolveComponent("Input"),M=e.resolveComponent("Button"),z=e.resolveComponent("SegmentedControlButton"),j=e.resolveComponent("SegmentedControl"),R=e.resolveComponent("PaginationFirst"),U=e.resolveComponent("PaginationPrev"),K=e.resolveComponent("PaginationListItem"),q=e.resolveComponent("PaginationEllipsis"),O=e.resolveComponent("PaginationNext"),G=e.resolveComponent("PaginationLast"),H=e.resolveComponent("PaginationList"),Q=e.resolveComponent("Pagination");return e.openBlock(),e.createElementBlock("div",ke,[e.createElementVNode("div",_e,[e.createElementVNode("div",we,[e.createElementVNode("p",he,e.toDisplayString(c.value?.length)+" products",1),e.createElementVNode("div",ye,[e.createVNode(P,{id:"search",type:"text",placeholder:"Search...",class:"pl-8",onKeydown:r[0]||(r[0]=e.withKeys(B=>x.value="",["escape"])),modelValue:x.value,"onUpdate:modelValue":r[1]||(r[1]=B=>x.value=B)},null,8,["modelValue"]),e.createElementVNode("span",Be,[e.createVNode(e.unref(y.Search),{class:"size-4 text-muted-foreground"})])])]),e.createElementVNode("div",Ee,[m.value.length>0?(e.openBlock(),e.createBlock(M,{key:0,variant:"destructive",onClick:F},{default:e.withCtx(()=>[e.createTextVNode(" Delete Selection ("+e.toDisplayString(m.value.length)+") ",1)]),_:1})):e.createCommentVNode("",!0),e.unref(a)("create-product")?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(M,{variant:"outline",onClick:r[2]||(r[2]=B=>e.unref(f)("new"))},{default:e.withCtx(()=>[e.createVNode(e.unref(y.Plus),{class:"size-4"}),r[5]||(r[5]=e.createTextVNode(" New Product ",-1))]),_:1}),r[6]||(r[6]=e.createElementVNode("div",{class:"w-[1px] h-8 bg-border"},null,-1))],64)):e.createCommentVNode("",!0),e.createVNode(Ne),r[7]||(r[7]=e.createElementVNode("div",{class:"w-[1px] h-8 bg-border"},null,-1)),e.createElementVNode("div",null,[e.createVNode(j,{modelValue:d.value,"onUpdate:modelValue":r[3]||(r[3]=B=>d.value=B),"aria-label":"View mode"},{default:e.withCtx(()=>[e.createVNode(z,{value:"grid"},{default:e.withCtx(()=>[e.createVNode(e.unref(y.LayoutGrid),{class:"size-4"})]),_:1}),e.createVNode(z,{value:"list"},{default:e.withCtx(()=>[e.createVNode(e.unref(y.List),{class:"size-4"})]),_:1})]),_:1},8,["modelValue"])])])],512),e.createElementVNode("div",Pe,[e.createVNode(be,{onSelectAll:T,onDuplicateProduct:D,onDeleteProduct:u,onDeleteSelection:F},{default:e.withCtx(()=>[d.value==="grid"?(e.openBlock(),e.createBlock(le,{key:0,products:_.value},null,8,["products"])):(e.openBlock(),e.createBlock(ue,{key:1,products:_.value},null,8,["products"]))]),_:1})]),c.value?.length>N.value?(e.openBlock(),e.createBlock(Q,{key:0,page:t.value,"onUpdate:page":r[4]||(r[4]=B=>t.value=B),"items-per-page":N.value,total:c.value?.length,"sibling-count":1,"show-edges":""},{default:e.withCtx(()=>[e.createVNode(H,{class:"flex items-center gap-1"},{default:e.withCtx(({items:B})=>[e.createVNode(R),e.createVNode(U),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B,(A,L)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[A.type==="page"?(e.openBlock(),e.createBlock(K,{key:L,value:A.value,"as-child":""},{default:e.withCtx(()=>[e.createVNode(M,{class:"size-10 p-0",variant:A.value===t.value?"default":"outline"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(A.value),1)]),_:2},1032,["variant"])]),_:2},1032,["value"])):(e.openBlock(),e.createBlock(q,{key:A.type,index:L},null,8,["index"]))],64))),256)),e.createVNode(O),e.createVNode(G)]),_:1})]),_:1},8,["page","items-per-page","total"])):e.createCommentVNode("",!0)])}}});exports.default=Se;
|
|
@@ -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"},ue={key:0,class:"flex justify-center py-24"},me={class:"flex gap-2"},pe={key:2},fe={class:"flex flex-col gap-4 mb-6 @md:flex-row @md:items-end @md:justify-between"},ge={class:"flex flex-wrap items-center gap-2"},ve={class:"relative"},xe={key:0,class:"flex flex-wrap items-center justify-between gap-3 mb-4 px-4 py-3 rounded-lg border bg-muted/40"},Ce={class:"flex items-center gap-3"},Ne={class:"text-sm font-medium"},ye={class:"flex items-center gap-2"},Ve={key:1,class:"flex flex-col items-center justify-center py-16 text-center border border-dashed rounded-lg"},we={class:"font-medium"},he={key:2,class:"grid gap-4 @md:grid-cols-2 @3xl:grid-cols-3"},_e=["onClick"],ke=["onClick"],be={class:"flex items-start gap-3"},Ee=["onClick"],Ae={class:"text-base font-semibold leading-tight line-clamp-1"},Se={class:"flex items-center gap-2 mt-1"},Be={key:0,class:"text-xs text-muted-foreground cursor-pointer"},De={key:0,class:"shrink-0"},$e={class:"grid grid-cols-3 gap-2 mt-5"},Me={class:"flex flex-col items-start gap-1 rounded-lg bg-muted/40 px-3 py-2"},Te={class:"flex items-center gap-1 text-muted-foreground"},ze={class:"text-sm font-semibold"},Ie={class:"flex flex-col items-start gap-1 rounded-lg bg-muted/40 px-3 py-2"},Pe={class:"flex items-center gap-1 text-muted-foreground"},je={class:"text-sm font-semibold"},Fe={class:"flex flex-col items-start gap-1 rounded-lg bg-muted/40 px-3 py-2"},Ue={class:"flex items-center gap-1 text-muted-foreground"},Oe={class:"text-sm font-semibold"},Re={key:0,class:"flex items-center justify-between gap-2 px-5 py-3 border-t bg-muted/20"},S="privateSettings",G="refundFlow",L="metadataSchema",B="_privateSettings",Ge=e.defineComponent({__name:"Overview",setup(Le){const{config:c}=y.useModule(),u=y.useFirebaseIntegration(c.project),{navigateTo:N}=y.useModuleRoute(),{confirm:q}=y.useConfirmation(),{hasPermission:f,hasAnyPermission:H}=y.useModulePermissions();y.useModuleBreadcrumbs(()=>[]);const m=e.ref(null),w=e.ref(""),d=e.ref(!1),a=e.ref([]),D=e.ref("importAgendasInput"),J=["id",B,"metadataSchema","refundFlow","refundFlowEnabled","refundDialog"],$=(o,t)=>`${c.agendaCollection}/${o}/${S}/${t}`,h=o=>{if(!o||typeof o!="object")return null;const{id:t,...r}=o;return r},M=o=>!!o&&typeof o=="object"&&Object.keys(o).length>0,b=o=>{const t={...o||{}};return J.forEach(r=>delete t[r]),t},T=async o=>{const[t,r]=await Promise.all([u.get($(o,G)),u.get($(o,L))]);return{refundFlow:h(t),metadataSchema:h(r)}},z=async(o,t)=>{if(!t||typeof t!="object")return;const r=[],l=h(t.refundFlow);M(l)&&r.push(u.update(`${c.agendaCollection}/${o}/${S}`,G,l));const i=h(t.metadataSchema);M(i)&&r.push(u.update(`${c.agendaCollection}/${o}/${S}`,L,i)),await Promise.all(r)},x=e.computed(()=>{if(!m.value)return[];const o=w.value.trim().toLowerCase();return o?m.value.filter(t=>(t.serviceName||"").toLowerCase().includes(o)):m.value}),I=e.computed(()=>x.value.length>0&&x.value.every(o=>a.value.includes(o.id))),K=()=>{if(I.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)}},P=o=>{a.value.includes(o)?a.value=a.value.filter(t=>t!==o):a.value.push(o)},Y=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()},j=[{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 j[r%j.length]},Q=o=>{const t=o?.pricingOptions?.[0];return t?.duration?`${t.duration} min`:null},X=o=>{const t=o?.pricingOptions?.[0];return t?.price===void 0||t?.price===null||t?.price===""?null:`${o.currency==="EUR"?"€":"$"}${t.price}`},W=o=>Array.isArray(o?.resources)?o.resources.filter(t=>t?.isActive!==!1).length:0,Z=o=>o.type==="regular"?"Regular":o.type?o.type.charAt(0).toUpperCase()+o.type.slice(1):"Agenda",ee=o=>{d.value=!0,a.value=[o]},_=async()=>{m.value=await u.find(c.agendaCollection),!H("create-agendas","delete-agendas")&&m.value?.length===1&&A(m.value[0].id)},te=async o=>{if(!f("create-agendas"))return;const[t,r]=await Promise.all([u.get(c.agendaCollection,o),T(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(c.agendaCollection,i))?.id;v&&await z(v,r),await _()},oe=async o=>{!f("delete-agendas")||!await q("Are you sure you want to delete this agenda? This action cannot be undone.")||(await u.remove(c.agendaCollection,o),await _())},ne=async()=>{if(!m.value)return;const o=m.value.filter(i=>a.value.includes(i.id)),t=await Promise.all(o.map(async i=>{const[g,v]=await Promise.all([u.get(c.agendaCollection,i.id),T(i.id)]);return{...b(g||i),[B]: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(),d.value=!1,a.value=[]},re=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?.[B],k=(await u.add(c.agendaCollection,b(g)))?.id;k&&await z(k,v)}t.value="",await _()},A=o=>{d.value||(f("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"),p=e.resolveComponent("Button"),k=e.resolveComponent("EmptyContent"),ae=e.resolveComponent("Empty"),le=e.resolveComponent("Input"),F=e.resolveComponent("DropdownMenuTrigger"),V=e.resolveComponent("DropdownMenuItem"),U=e.resolveComponent("DropdownMenuGroup"),O=e.resolveComponent("DropdownMenuContent"),R=e.resolveComponent("DropdownMenu"),se=e.resolveComponent("ButtonGroup"),ie=e.resolveComponent("Checkbox"),de=e.resolveComponent("Badge");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",ce,[m.value===null?(e.openBlock(),e.createElementBlock("div",ue,[e.createVNode(r,{class:"mx-auto"})])):m.value.length===0?(e.openBlock(),e.createBlock(ae,{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",me,[e.createVNode(p,{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",pe,[e.createElementVNode("div",fe,[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",ge,[e.createElementVNode("div",ve,[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(le,{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"])]),!d.value&&e.unref(f)("create-agendas")?(e.openBlock(),e.createBlock(se,{key:0},{default:e.withCtx(()=>[e.createVNode(p,{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(p,{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=>D.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)])]),d.value?(e.openBlock(),e.createElementBlock("div",xe,[e.createElementVNode("div",Ce,[e.createVNode(ie,{modelValue:I.value,"onUpdate:modelValue":K},null,8,["modelValue"]),e.createElementVNode("span",Ne,e.toDisplayString(a.value.length)+" of "+e.toDisplayString(x.value.length)+" selected ",1)]),e.createElementVNode("div",ye,[e.createVNode(p,{variant:"ghost",onClick:t[4]||(t[4]=n=>{d.value=!1,a.value=[]})},{default:e.withCtx(()=>[...t[12]||(t[12]=[e.createTextVNode(" Cancel ",-1)])]),_:1}),e.createVNode(p,{onClick:ne,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",Ve,[e.createVNode(e.unref(s.Search),{class:"size-8 text-muted-foreground mb-3"}),e.createElementVNode("p",we,'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",he,[(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":d.value,"ring-2 ring-primary border-primary/40":d.value&&a.value.includes(n.id)}]),onClick:C=>d.value?P(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=>!d.value&&A(n.id)},[e.createElementVNode("div",be,[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(Y(n.serviceName)),5),e.createElementVNode("button",{type:"button",class:"flex-1 min-w-0 text-left focus:outline-none",onClick:e.withModifiers(C=>d.value?P(n.id):A(n.id),["stop"])},[e.createElementVNode("h3",Ae,e.toDisplayString(n.serviceName||"Untitled Agenda"),1),e.createElementVNode("div",Se,[e.createVNode(de,{variant:"secondary",class:"text-[10px] font-medium px-1.5 py-0 h-4"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(Z(n)),1)]),_:2},1024),d.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Be," Click to "+e.toDisplayString(e.unref(f)("edit-agendas")?"edit":"view"),1))])],8,Ee),d.value?(e.openBlock(),e.createElementBlock("div",De,[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",$e,[e.createElementVNode("div",Me,[e.createElementVNode("div",Te,[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",ze,e.toDisplayString(Q(n)||"—"),1)]),e.createElementVNode("div",Ie,[e.createElementVNode("div",Pe,[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",je,e.toDisplayString(X(n)||"—"),1)]),e.createElementVNode("div",Fe,[e.createElementVNode("div",Ue,[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",Oe,e.toDisplayString(W(n)),1)])])],8,ke),d.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Re,[e.unref(f)("edit-agendas")?(e.openBlock(),e.createBlock(p,{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(p,{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(p,{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(f)("create-agendas")?(e.openBlock(),e.createBlock(V,{key:0,onClick:C=>te(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=>ee(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(f)("delete-agendas")?(e.openBlock(),e.createBlock(V,{key:1,variant:"destructive",onClick:C=>oe(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,_e))),128))]))]))]),e.createElementVNode("input",{type:"file",ref_key:"importAgendasInput",ref:D,class:"hidden",accept:".json,application/json",onChange:re},null,544)],64)}}});exports.default=Ge;
|