@oneclick.dev/cms-core-modules 0.0.110 → 0.0.112

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 (72) hide show
  1. package/dist/{Acquisition-Dt2rREU8.js → Acquisition-DgzDQH51.js} +1 -1
  2. package/dist/{Acquisition-DNCy8nQz.mjs → Acquisition-FV3QpaUX.mjs} +2 -2
  3. package/dist/{Audience-Bs7b0TNm.js → Audience-BSgNvcVb.js} +1 -1
  4. package/dist/{Audience-CUeMVYRy.mjs → Audience-ka0b7YPE.mjs} +2 -2
  5. package/dist/{Components-DXbx0RLV.js → Components-6gTTI_u-.js} +1 -1
  6. package/dist/{Components-C83O-xlF.mjs → Components-iU3ZaJm5.mjs} +32 -32
  7. package/dist/{ContentEditor-D9-1SJ5F.mjs → ContentEditor-C5yNNLeV.mjs} +8446 -7893
  8. package/dist/{ContentEditor-BprPiHMJ.js → ContentEditor-MctMvN7D.js} +53 -53
  9. package/dist/{Create-89z41K73.js → Create--MOBOTA-.js} +1 -1
  10. package/dist/{Create-BCklc_T1.mjs → Create-BXNLRQag.mjs} +1 -1
  11. package/dist/DateFormatter-CSAbE3BC.js +1 -0
  12. package/dist/{DateFormatter-DUxlo8X8.mjs → DateFormatter-qbhRYxI_.mjs} +226 -222
  13. package/dist/{Detail-CNlljBfH.mjs → Detail-ChD5XurA.mjs} +1 -1
  14. package/dist/{Detail-C857g62L.js → Detail-RISEJJab.js} +1 -1
  15. package/dist/{Find-DIISO5GO.mjs → Find-zN_dKz4p.mjs} +1 -1
  16. package/dist/{GlobalStyling-C9VthHWK.mjs → GlobalStyling-Bp2PiOWt.mjs} +648 -502
  17. package/dist/GlobalStyling-fRjfDDeO.js +25 -0
  18. package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-Baqy-rTT.js +1 -0
  19. package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-Dx4Bpa2m.mjs +1263 -0
  20. package/dist/{Overview-Di84CsR5.mjs → Overview-98nkJUWN.mjs} +162 -157
  21. package/dist/{Overview-C-Jb_BxY.mjs → Overview-BR_y8x3W.mjs} +1 -1
  22. package/dist/{Overview-DC9io1bk.js → Overview-CX-n6W7d.js} +1 -1
  23. package/dist/Overview-Dl8cMlsr.js +1 -0
  24. package/dist/{Overview-BKAti8nc.mjs → Overview-MpgkLB6m.mjs} +36 -36
  25. package/dist/{SeoHealth-az1YuNF2.js → SeoHealth-C5npw7mE.js} +1 -1
  26. package/dist/{SeoHealth-MC3lSCOY.mjs → SeoHealth-bVQj_Xgm.mjs} +29 -29
  27. package/dist/{TableView-DXHhJ-jm.mjs → TableView-Bf1fdJrD.mjs} +1838 -1822
  28. package/dist/TableView-DNcXyIMu.js +4 -0
  29. package/dist/{agenda-IOqtALWf.js → agenda-BaJu3-1c.js} +1 -1
  30. package/dist/{agenda-DcatSSYQ.mjs → agenda-BwVY_8oM.mjs} +3 -3
  31. package/dist/cms-core-modules.css +1 -1
  32. package/dist/{exceptions-CI0B4xVj.js → exceptions-B6P9UiCj.js} +1 -1
  33. package/dist/{exceptions-YCQkHa6a.mjs → exceptions-De9-FvdP.mjs} +67 -67
  34. package/dist/{index-CpzDEMeC.mjs → index-B8GvmAwh.mjs} +438 -478
  35. package/dist/{index-wjkEPsNx.mjs → index-BIF2RB7k.mjs} +1212 -1316
  36. package/dist/index-ByRsp77L.js +70 -0
  37. package/dist/{index-BhWvXMOp.mjs → index-CFzn2Lus.mjs} +5 -9
  38. package/dist/{index-BFLV54kw.mjs → index-CkVwMqpn.mjs} +1114 -1100
  39. package/dist/index-DL6orwdK.js +35 -0
  40. package/dist/index-DUlYrnXH.js +58 -0
  41. package/dist/index-DZV720u-.mjs +439 -0
  42. package/dist/index-D_nfGegA.js +184 -0
  43. package/dist/index-DtSvAFLL.js +54 -0
  44. package/dist/{index-D30apIn-.mjs → index-L54VBzwJ.mjs} +2 -3
  45. package/dist/{index-BzWmWCo5.mjs → index-hH3e-IYz.mjs} +267 -267
  46. package/dist/index.cjs.js +1 -1
  47. package/dist/index.mjs +17 -17
  48. package/dist/math-BJ-oX_IM.mjs +80 -0
  49. package/dist/math-emotyaF6.js +1 -0
  50. package/dist/{resources-CYOb5Bl6.mjs → resources-DwYxn2Vi.mjs} +1 -1
  51. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Icon.d.ts +15 -0
  52. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Icon.vue.d.ts +92 -0
  53. package/dist/src/contentManager/components/content-editor/tiptap-extensions/ScopedSelectAll.d.ts +1 -2
  54. package/dist/src/contentManager/components/content-editor/tiptap-extensions/helpers/iconOptions.d.ts +22 -0
  55. package/dist/src/contentManager/components/content-editor/tiptap-extensions/helpers/useFocus.d.ts +1 -0
  56. package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/IconMenu.vue.d.ts +16 -0
  57. package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/index.d.ts +17 -0
  58. package/package.json +2 -2
  59. package/dist/DateFormatter-CYAD4GBN.js +0 -1
  60. package/dist/GlobalStyling-CnSlXkZc.js +0 -25
  61. package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-Ceoje52V.js +0 -1
  62. package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-Dh9jzvE0.mjs +0 -1255
  63. package/dist/Overview-UoZHUMUz.js +0 -1
  64. package/dist/TableView-DQW0A1oG.js +0 -4
  65. package/dist/array-CbATeQbk.js +0 -1
  66. package/dist/array-DT5pE8Gm.mjs +0 -108
  67. package/dist/index-A2kp8Isi.js +0 -75
  68. package/dist/index-B5aBwdxY.js +0 -54
  69. package/dist/index-BiT55eU0.js +0 -58
  70. package/dist/index-G7cIlnGN.js +0 -158
  71. package/dist/index-V78huaSJ.mjs +0 -442
  72. package/dist/index-vHmvbEwa.js +0 -35
@@ -0,0 +1,25 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),R=require("@oneclick.dev/cms-kit"),m=require("lucide-vue-next"),P={class:"grid py-4"},H={class:"grid grid-cols-2 gap-2 mb-6"},j={class:"relative"},q={class:"grid grid-cols-3 gap-2 mb-6"},K={class:"relative"},W={class:"relative"},Q={class:"relative"},X={class:"grid grid-cols-1 gap-2 mb-6"},Y={class:"relative"},Z={class:"flex items-center space-x-2"},ee={class:"flex items-center space-x-2"},te={class:"grid grid-cols-2 gap-2 mb-6"},oe={key:0},le={class:"relative"},se={key:1},re={class:"relative"},ne={key:0,class:"bg-muted px-4 py-2 rounded-md text-sm"},ae=e.defineComponent({__name:"SectionStyleDialog",props:{buttons:{type:Array,default:()=>[]}},emits:["add","edit","delete"],setup(z,{expose:h,emit:b}){const{confirm:g}=R.useConfirmation(),N=b,x=e.ref(!1),f=e.ref("create"),u=e.ref(null),d=e.ref(!1),t=e.reactive({name:"",rendering:"class",className:"",componentName:"",styles:{backgroundColor:"#FFFFFF",titleColor:"#000000",textColor:"#000000"}}),C=k=>{k?(f.value="edit",u.value=k.id,d.value=k.id==="DEFAULT",t.name=k.name||"",t.rendering=k.rendering||"class",t.className=k.className||"",t.componentName=k.componentName||"",t.styles.backgroundColor=k.styles.backgroundColor||"#FFFFFF",t.styles.titleColor=k.styles.titleColor||"#000000",t.styles.textColor=k.styles.textColor||"#000000"):(f.value="create",u.value=null,d.value=!1,t.name="",t.rendering="class",t.className="",t.componentName="",t.styles.backgroundColor="#FFFFFF",t.styles.titleColor="#000000",t.styles.textColor="#000000"),x.value=!0},T=()=>{N("add",t),x.value=!1},F=()=>{d.value&&(t.name="Default"),N("edit",{id:u.value,...t}),x.value=!1},S=async()=>{if(d.value)return;await g("Are you sure you want to delete this theme? This action cannot be undone.","Delete Theme","Delete")&&(N("delete",u.value),x.value=!1)},$=()=>{t.styles.backgroundColor="#FFFFFF",t.styles.titleColor="#000000",t.styles.textColor="#000000"};return h({openDialog:C}),(k,n)=>{const a=e.resolveComponent("DialogTitle"),o=e.resolveComponent("DialogDescription"),U=e.resolveComponent("DialogHeader"),E=e.resolveComponent("Label"),D=e.resolveComponent("Input"),v=e.resolveComponent("RadioGroupItem"),V=e.resolveComponent("RadioGroup"),w=e.resolveComponent("Button"),A=e.resolveComponent("DialogFooter"),B=e.resolveComponent("DialogScrollContent"),_=e.resolveComponent("Dialog");return e.openBlock(),e.createBlock(_,{open:x.value,"onUpdate:open":n[10]||(n[10]=y=>x.value=y)},{default:e.withCtx(()=>[e.createVNode(B,{class:"sm:max-w-2xl"},{default:e.withCtx(()=>[e.createVNode(U,null,{default:e.withCtx(()=>[e.createVNode(a,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f.value==="create"?"Add New Section Style":"Edit Section Style"),1)]),_:1}),e.createVNode(o,null,{default:e.withCtx(()=>[...n[11]||(n[11]=[e.createTextVNode(" These settings change how this section looks in the editor. To style your live site, add matching CSS or use a custom component. ",-1)])]),_:1})]),_:1}),e.createElementVNode("div",P,[e.createElementVNode("div",H,[e.createElementVNode("div",null,[e.createVNode(E,{class:"mb-2",for:"collection-theme-dialog-theme-name"},{default:e.withCtx(()=>[...n[12]||(n[12]=[e.createTextVNode("Display name",-1)])]),_:1}),e.createElementVNode("div",j,[e.createVNode(D,{modelValue:t.name,"onUpdate:modelValue":n[0]||(n[0]=y=>t.name=y),id:"collection-theme-dialog-theme-name",disabled:d.value},null,8,["modelValue","disabled"])])])]),n[21]||(n[21]=e.createElementVNode("h2",{class:"font-semibold mb-4"},"Style Settings",-1)),e.createElementVNode("div",q,[e.createElementVNode("div",null,[e.createVNode(E,{class:"mb-2",for:"collection-theme-dialog-background-color"},{default:e.withCtx(()=>[...n[13]||(n[13]=[e.createTextVNode("Background color",-1)])]),_:1}),e.createElementVNode("div",K,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":n[1]||(n[1]=y=>t.styles.backgroundColor=y),type:"color",label:"Primary Color",class:"absolute top-0.5 left-1 size-8"},null,512),[[e.vModelText,t.styles.backgroundColor]]),e.createVNode(D,{modelValue:t.styles.backgroundColor,"onUpdate:modelValue":n[2]||(n[2]=y=>t.styles.backgroundColor=y),class:"pl-12",id:"collection-theme-dialog-background-color"},null,8,["modelValue"])])]),e.createElementVNode("div",null,[e.createVNode(E,{class:"mb-2",for:"collection-theme-dialog-title-color"},{default:e.withCtx(()=>[...n[14]||(n[14]=[e.createTextVNode("Heading color",-1)])]),_:1}),e.createElementVNode("div",W,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":n[3]||(n[3]=y=>t.styles.titleColor=y),type:"color",label:"Primary Color",class:"absolute top-0.5 left-1 size-8"},null,512),[[e.vModelText,t.styles.titleColor]]),e.createVNode(D,{modelValue:t.styles.titleColor,"onUpdate:modelValue":n[4]||(n[4]=y=>t.styles.titleColor=y),class:"pl-12",id:"collection-theme-dialog-title-color"},null,8,["modelValue"])])]),e.createElementVNode("div",null,[e.createVNode(E,{class:"mb-2",for:"collection-theme-dialog-text-color"},{default:e.withCtx(()=>[...n[15]||(n[15]=[e.createTextVNode("Body text color",-1)])]),_:1}),e.createElementVNode("div",Q,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":n[5]||(n[5]=y=>t.styles.textColor=y),type:"color",label:"Primary Color",class:"absolute top-0.5 left-1 size-8"},null,512),[[e.vModelText,t.styles.textColor]]),e.createVNode(D,{modelValue:t.styles.textColor,"onUpdate:modelValue":n[6]||(n[6]=y=>t.styles.textColor=y),class:"pl-12",id:"collection-theme-dialog-text-color"},null,8,["modelValue"])])])]),n[22]||(n[22]=e.createElementVNode("h2",{class:"font-semibold mb-4"},"Rendering Method",-1)),e.createElementVNode("div",X,[e.createElementVNode("div",null,[e.createElementVNode("div",Y,[e.createVNode(E,{class:"mb-4 text-muted-foreground"},{default:e.withCtx(()=>[...n[16]||(n[16]=[e.createTextVNode("Choose how this section should be styled on your site:",-1)])]),_:1}),e.createVNode(V,{modelValue:t.rendering,"onUpdate:modelValue":n[7]||(n[7]=y=>t.rendering=y),"default-value":"class"},{default:e.withCtx(()=>[e.createElementVNode("div",Z,[e.createVNode(v,{id:"collection-theme-dialog-render-class",value:"class"}),e.createVNode(E,{for:"collection-theme-dialog-render-class"},{default:e.withCtx(()=>[...n[17]||(n[17]=[e.createTextVNode("Use a CSS class",-1)])]),_:1})]),e.createElementVNode("div",ee,[e.createVNode(v,{id:"collection-theme-dialog-render-component",value:"component"}),e.createVNode(E,{for:"collection-theme-dialog-render-component"},{default:e.withCtx(()=>[...n[18]||(n[18]=[e.createTextVNode("Custom component",-1)])]),_:1})])]),_:1},8,["modelValue"])])])]),e.createElementVNode("div",te,[t.rendering==="class"?(e.openBlock(),e.createElementBlock("div",oe,[e.createVNode(E,{class:"mb-2",for:"collection-theme-dialog-class-name"},{default:e.withCtx(()=>[...n[19]||(n[19]=[e.createTextVNode("Class name",-1)])]),_:1}),e.createElementVNode("div",le,[e.createVNode(D,{modelValue:t.className,"onUpdate:modelValue":n[8]||(n[8]=y=>t.className=y),id:"collection-theme-dialog-class-name"},null,8,["modelValue"])])])):(e.openBlock(),e.createElementBlock("div",se,[e.createVNode(E,{class:"mb-2",for:"collection-theme-dialog-component-name"},{default:e.withCtx(()=>[...n[20]||(n[20]=[e.createTextVNode("Component name",-1)])]),_:1}),e.createElementVNode("div",re,[e.createVNode(D,{modelValue:t.componentName,"onUpdate:modelValue":n[9]||(n[9]=y=>t.componentName=y),id:"collection-theme-dialog-component-name"},null,8,["modelValue"])])]))]),t.rendering==="class"?(e.openBlock(),e.createElementBlock("pre",ne,"."+e.toDisplayString(t.className)+` {
2
+ background-color: `+e.toDisplayString(t.styles.backgroundColor)+`;
3
+ color: `+e.toDisplayString(t.styles.textColor)+`;
4
+
5
+ h1, h2, h3, h4, h5, h6 {
6
+ color: `+e.toDisplayString(t.styles.titleColor)+`;
7
+ }
8
+ }
9
+ `,1)):e.createCommentVNode("",!0)]),e.createVNode(A,null,{default:e.withCtx(()=>[f.value==="edit"&&!d.value?(e.openBlock(),e.createBlock(w,{key:0,variant:"destructive",class:"mr-auto",onClick:S},{default:e.withCtx(()=>[...n[23]||(n[23]=[e.createTextVNode(" Delete Style ",-1)])]),_:1})):e.createCommentVNode("",!0),f.value==="edit"&&d.value?(e.openBlock(),e.createBlock(w,{key:1,variant:"outline",class:"mr-auto",onClick:$},{default:e.withCtx(()=>[...n[24]||(n[24]=[e.createTextVNode(" Reset to Default ",-1)])]),_:1})):e.createCommentVNode("",!0),f.value==="create"?(e.openBlock(),e.createBlock(w,{key:2,type:"submit",onClick:T},{default:e.withCtx(()=>[...n[25]||(n[25]=[e.createTextVNode(" Add Style ",-1)])]),_:1})):(e.openBlock(),e.createBlock(w,{key:3,type:"submit",onClick:F},{default:e.withCtx(()=>[...n[26]||(n[26]=[e.createTextVNode(" Save Changes ",-1)])]),_:1}))]),_:1})]),_:1})]),_:1},8,["open"])}}}),de={class:"grid py-4"},ie={class:"grid grid-cols-2 gap-2 mb-6"},ce={class:"relative"},ue={class:"grid grid-cols-3 gap-2 mb-6"},me={class:"relative"},pe={class:"relative"},ye={class:"relative"},ve={class:"grid grid-cols-1 gap-2 mb-6"},xe={class:"relative"},fe={class:"flex items-center space-x-2"},be={class:"flex items-center space-x-2"},ge={class:"grid grid-cols-2 gap-2 mb-6"},Ce={key:0},ke={class:"relative"},Ve={key:1},Ne={class:"relative"},Ee={key:0,class:"bg-muted px-4 py-2 rounded-md text-sm"},Be=e.defineComponent({__name:"ButtonStyleDialog",props:{defaultBackground:{type:String,default:"#FFFFFF"}},emits:["add","edit","delete"],setup(z,{expose:h,emit:b}){const{confirm:g}=R.useConfirmation(),N=b,x=e.ref(!1),f=e.ref("create"),u=e.ref(null),d=e.ref(!1),t=e.reactive({name:"",rendering:"class",className:"",componentName:"",styles:{backgroundColor:"#FFFFFF",textColor:"#000000",borderColor:"#000000",buttonRoundness:"none",buttonStyle:"default"}}),C=a=>{a?(f.value="edit",u.value=a.id,d.value=a.id==="DEFAULT",t.name=a.name||"",t.rendering=a.rendering||"class",t.className=a.className||"",t.componentName=a.componentName||"",t.styles.backgroundColor=a.styles.backgroundColor||"#FFFFFF",t.styles.textColor=a.styles.textColor||"#000000",t.styles.borderColor=a.styles.borderColor||"#000000",t.styles.buttonRoundness=a.styles.buttonRoundness||"none",t.styles.buttonStyle=a.styles.buttonStyle||"default"):(f.value="create",u.value=null,d.value=!1,t.name="",t.rendering="class",t.className="",t.componentName="",t.styles.backgroundColor="#FFFFFF",t.styles.textColor="#000000",t.styles.borderColor="#000000",t.styles.buttonRoundness="none",t.styles.buttonStyle="default"),x.value=!0},T=()=>{N("add",t),x.value=!1},F=()=>{d.value&&(t.name="Default"),N("edit",{id:u.value,...t}),x.value=!1},S=async()=>{if(d.value)return;await g("Are you sure you want to delete this theme? This action cannot be undone.","Delete Theme","Delete")&&(N("delete",u.value),x.value=!1)},$=()=>{t.styles.backgroundColor="#FFFFFF",t.styles.textColor="#000000",t.styles.borderColor="#000000",t.styles.buttonRoundness="none",t.styles.buttonStyle="default"},k=a=>{switch(a){case"none":return 0;case"small":return 8;case"medium":return 12;case"pill":return 99;default:return 0}},n=e.computed(()=>{let a="."+t.className+` {
10
+ `;return a+=` background-color: ${t.styles.backgroundColor};
11
+ `,a+=` color: ${t.styles.textColor};
12
+ `,t.styles.buttonStyle==="outline"?a+=` border: 1px solid ${t.styles.borderColor};
13
+ `:t.styles.buttonStyle==="shadow"?a+=` box-shadow: 0 3px 6px #ccc;
14
+ `:t.styles.buttonStyle==="retro"&&(a+=` box-shadow: inset 0 0 0 2px ${t.styles.borderColor}, 2px 2px 0 ${t.styles.borderColor};
15
+ `),t.styles.buttonRoundness!=="none"&&(a+=` border-radius: ${k(t.styles.buttonRoundness)}px;
16
+ `),a+=`}
17
+ `,a});return h({openDialog:C}),(a,o)=>{const U=e.resolveComponent("DialogTitle"),E=e.resolveComponent("DialogDescription"),D=e.resolveComponent("DialogHeader"),v=e.resolveComponent("Label"),V=e.resolveComponent("Input"),w=e.resolveComponent("RadioGroupItem"),A=e.resolveComponent("RadioGroup"),B=e.resolveComponent("Button"),_=e.resolveComponent("DialogFooter"),y=e.resolveComponent("DialogScrollContent"),L=e.resolveComponent("Dialog");return e.openBlock(),e.createBlock(L,{open:x.value,"onUpdate:open":o[18]||(o[18]=r=>x.value=r)},{default:e.withCtx(()=>[e.createVNode(y,{class:"sm:max-w-2xl"},{default:e.withCtx(()=>[e.createVNode(D,null,{default:e.withCtx(()=>[e.createVNode(U,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f.value==="create"?"Add New Button Style":"Edit Button Style"),1)]),_:1}),e.createVNode(E,null,{default:e.withCtx(()=>[...o[19]||(o[19]=[e.createTextVNode(" These settings change how this section looks in the editor. To style your live site, add matching CSS or use a custom component. ",-1)])]),_:1})]),_:1}),e.createElementVNode("div",de,[e.createElementVNode("div",ie,[e.createElementVNode("div",null,[e.createVNode(v,{class:"mb-2",for:"collection-theme-dialog-theme-name"},{default:e.withCtx(()=>[...o[20]||(o[20]=[e.createTextVNode("Display name",-1)])]),_:1}),e.createElementVNode("div",ce,[e.createVNode(V,{modelValue:t.name,"onUpdate:modelValue":o[0]||(o[0]=r=>t.name=r),id:"collection-theme-dialog-theme-name",disabled:d.value},null,8,["modelValue","disabled"])])])]),o[38]||(o[38]=e.createElementVNode("h2",{class:"font-semibold mb-4"},"Style Settings",-1)),e.createElementVNode("div",ue,[e.createElementVNode("div",null,[e.createVNode(v,{class:"mb-2",for:"collection-theme-dialog-background-color"},{default:e.withCtx(()=>[...o[21]||(o[21]=[e.createTextVNode("Background color",-1)])]),_:1}),e.createElementVNode("div",me,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":o[1]||(o[1]=r=>t.styles.backgroundColor=r),type:"color",label:"Primary Color",class:"absolute top-0.5 left-1 size-8"},null,512),[[e.vModelText,t.styles.backgroundColor]]),e.createVNode(V,{modelValue:t.styles.backgroundColor,"onUpdate:modelValue":o[2]||(o[2]=r=>t.styles.backgroundColor=r),class:"pl-12",id:"collection-theme-dialog-background-color"},null,8,["modelValue"])])]),e.createElementVNode("div",null,[e.createVNode(v,{class:"mb-2",for:"collection-theme-dialog-text-color"},{default:e.withCtx(()=>[...o[22]||(o[22]=[e.createTextVNode("Text color",-1)])]),_:1}),e.createElementVNode("div",pe,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":o[3]||(o[3]=r=>t.styles.textColor=r),type:"color",label:"Primary Color",class:"absolute top-0.5 left-1 size-8"},null,512),[[e.vModelText,t.styles.textColor]]),e.createVNode(V,{modelValue:t.styles.textColor,"onUpdate:modelValue":o[4]||(o[4]=r=>t.styles.textColor=r),class:"pl-12",id:"collection-theme-dialog-text-color"},null,8,["modelValue"])])]),e.createElementVNode("div",null,[e.createVNode(v,{class:"mb-2",for:"collection-theme-dialog-border-color"},{default:e.withCtx(()=>[...o[23]||(o[23]=[e.createTextVNode("Border color",-1)])]),_:1}),e.createElementVNode("div",ye,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":o[5]||(o[5]=r=>t.styles.borderColor=r),type:"color",label:"Primary Color",class:"absolute top-0.5 left-1 size-8"},null,512),[[e.vModelText,t.styles.borderColor]]),e.createVNode(V,{modelValue:t.styles.borderColor,"onUpdate:modelValue":o[6]||(o[6]=r=>t.styles.borderColor=r),class:"pl-12",id:"collection-theme-dialog-border-color"},null,8,["modelValue"])])])]),e.createElementVNode("div",{style:e.normalizeStyle(`--button-background-color: ${t.styles.backgroundColor}; --button-text-color: ${t.styles.textColor}`)},[e.createVNode(v,{class:"mb-4"},{default:e.withCtx(()=>[...o[24]||(o[24]=[e.createTextVNode("Shape",-1)])]),_:1}),e.createElementVNode("div",{class:"grid grid-cols-4 gap-4 mb-6 p-2 rounded",style:e.normalizeStyle({backgroundColor:z.defaultBackground})},[e.createElementVNode("div",{class:"flex flex-col gap-2 items-center cursor-pointer",onClick:o[7]||(o[7]=r=>t.styles.buttonRoundness="none")},[o[25]||(o[25]=e.createElementVNode("div",{class:"text-center px-8 py-2 bg-[var(--button-background-color)] text-[var(--button-text-color)]"},"Button",-1)),t.styles.buttonRoundness!=="none"?(e.openBlock(),e.createBlock(e.unref(m.Circle),{key:0,class:"size-4 text-black/30"})):(e.openBlock(),e.createBlock(e.unref(m.CircleCheckBig),{key:1,class:"size-4 text-black"}))]),e.createElementVNode("div",{class:"flex flex-col gap-2 items-center cursor-pointer",onClick:o[8]||(o[8]=r=>t.styles.buttonRoundness="small")},[o[26]||(o[26]=e.createElementVNode("div",{class:"text-center px-8 py-2 bg-[var(--button-background-color)] text-[var(--button-text-color)] rounded-[8px]"},"Button",-1)),t.styles.buttonRoundness!=="small"?(e.openBlock(),e.createBlock(e.unref(m.Circle),{key:0,class:"size-4 text-black/30"})):(e.openBlock(),e.createBlock(e.unref(m.CircleCheckBig),{key:1,class:"size-4 text-black"}))]),e.createElementVNode("div",{class:"flex flex-col gap-2 items-center cursor-pointer",onClick:o[9]||(o[9]=r=>t.styles.buttonRoundness="medium")},[o[27]||(o[27]=e.createElementVNode("div",{class:"text-center px-8 py-2 bg-[var(--button-background-color)] text-[var(--button-text-color)] rounded-[12px]"},"Button",-1)),t.styles.buttonRoundness!=="medium"?(e.openBlock(),e.createBlock(e.unref(m.Circle),{key:0,class:"size-4 text-black/30"})):(e.openBlock(),e.createBlock(e.unref(m.CircleCheckBig),{key:1,class:"size-4 text-black"}))]),e.createElementVNode("div",{class:"flex flex-col gap-2 items-center cursor-pointer",onClick:o[10]||(o[10]=r=>t.styles.buttonRoundness="pill")},[o[28]||(o[28]=e.createElementVNode("div",{class:"text-center px-8 py-2 bg-[var(--button-background-color)] text-[var(--button-text-color)] rounded-[99px]"},"Button",-1)),t.styles.buttonRoundness!=="pill"?(e.openBlock(),e.createBlock(e.unref(m.Circle),{key:0,class:"size-4 text-black/30"})):(e.openBlock(),e.createBlock(e.unref(m.CircleCheckBig),{key:1,class:"size-4 text-black"}))])],4),e.createVNode(v,{class:"mb-4"},{default:e.withCtx(()=>[...o[29]||(o[29]=[e.createTextVNode("Style",-1)])]),_:1}),e.createElementVNode("div",{class:"grid grid-cols-4 gap-4 mb-6 p-2 rounded",style:e.normalizeStyle(`--button-border-radius: ${k(t.styles.buttonRoundness)}px; --button-border-color: ${t.styles.borderColor}; background-color: ${z.defaultBackground}`)},[e.createElementVNode("div",{class:"flex flex-col gap-2 items-center cursor-pointer",onClick:o[11]||(o[11]=r=>t.styles.buttonStyle="default")},[o[30]||(o[30]=e.createElementVNode("div",{class:"text-center px-8 py-2 bg-[var(--button-background-color)] text-[var(--button-text-color)] rounded-[var(--button-border-radius)]"},"Button",-1)),t.styles.buttonStyle!=="default"?(e.openBlock(),e.createBlock(e.unref(m.Circle),{key:0,class:"size-4 text-black/30"})):(e.openBlock(),e.createBlock(e.unref(m.CircleCheckBig),{key:1,class:"size-4 text-black"}))]),e.createElementVNode("div",{class:"flex flex-col gap-2 items-center cursor-pointer",onClick:o[12]||(o[12]=r=>t.styles.buttonStyle="outline")},[o[31]||(o[31]=e.createElementVNode("div",{class:"text-center px-8 py-2 bg-[var(--button-background-color)] text-[var(--button-text-color)] rounded-[var(--button-border-radius)] border border-[var(--button-border-color)]"}," Button ",-1)),t.styles.buttonStyle!=="outline"?(e.openBlock(),e.createBlock(e.unref(m.Circle),{key:0,class:"size-4 text-black/30"})):(e.openBlock(),e.createBlock(e.unref(m.CircleCheckBig),{key:1,class:"size-4 text-black"}))]),e.createElementVNode("div",{class:"flex flex-col gap-2 items-center cursor-pointer",onClick:o[13]||(o[13]=r=>t.styles.buttonStyle="shadow")},[o[32]||(o[32]=e.createElementVNode("div",{class:"text-center px-8 py-2 bg-[var(--button-background-color)] text-[var(--button-text-color)] rounded-[var(--button-border-radius)]",style:{"box-shadow":"0 3px 6px #ccc"}}," Button ",-1)),t.styles.buttonStyle!=="shadow"?(e.openBlock(),e.createBlock(e.unref(m.Circle),{key:0,class:"size-4 text-black/30"})):(e.openBlock(),e.createBlock(e.unref(m.CircleCheckBig),{key:1,class:"size-4 text-black"}))]),e.createElementVNode("div",{class:"flex flex-col gap-2 items-center cursor-pointer",onClick:o[14]||(o[14]=r=>t.styles.buttonStyle="retro")},[e.createElementVNode("div",{class:"text-center px-8 py-2 bg-[var(--button-background-color)] text-[var(--button-text-color)] rounded-[var(--button-border-radius)]",style:e.normalizeStyle(`box-shadow: inset 0 0 0 2px ${t.styles.borderColor}, 2px 2px 0 ${t.styles.borderColor};`)}," Button ",4),t.styles.buttonStyle!=="retro"?(e.openBlock(),e.createBlock(e.unref(m.Circle),{key:0,class:"size-4 text-black/30"})):(e.openBlock(),e.createBlock(e.unref(m.CircleCheckBig),{key:1,class:"size-4 text-black"}))])],4)],4),o[39]||(o[39]=e.createElementVNode("h2",{class:"font-semibold mb-4"},"Rendering Method",-1)),e.createElementVNode("div",ve,[e.createElementVNode("div",null,[e.createElementVNode("div",xe,[e.createVNode(v,{class:"mb-4 text-muted-foreground"},{default:e.withCtx(()=>[...o[33]||(o[33]=[e.createTextVNode("Choose how this section should be styled on your site:",-1)])]),_:1}),e.createVNode(A,{modelValue:t.rendering,"onUpdate:modelValue":o[15]||(o[15]=r=>t.rendering=r),"default-value":"class"},{default:e.withCtx(()=>[e.createElementVNode("div",fe,[e.createVNode(w,{id:"collection-theme-dialog-render-class",value:"class"}),e.createVNode(v,{for:"collection-theme-dialog-render-class"},{default:e.withCtx(()=>[...o[34]||(o[34]=[e.createTextVNode("Use a CSS class",-1)])]),_:1})]),e.createElementVNode("div",be,[e.createVNode(w,{id:"collection-theme-dialog-render-component",value:"component"}),e.createVNode(v,{for:"collection-theme-dialog-render-component"},{default:e.withCtx(()=>[...o[35]||(o[35]=[e.createTextVNode("Custom component",-1)])]),_:1})])]),_:1},8,["modelValue"])])])]),e.createElementVNode("div",ge,[t.rendering==="class"?(e.openBlock(),e.createElementBlock("div",Ce,[e.createVNode(v,{class:"mb-2",for:"collection-theme-dialog-class-name"},{default:e.withCtx(()=>[...o[36]||(o[36]=[e.createTextVNode("Class name",-1)])]),_:1}),e.createElementVNode("div",ke,[e.createVNode(V,{modelValue:t.className,"onUpdate:modelValue":o[16]||(o[16]=r=>t.className=r),id:"collection-theme-dialog-class-name"},null,8,["modelValue"])])])):(e.openBlock(),e.createElementBlock("div",Ve,[e.createVNode(v,{class:"mb-2",for:"collection-theme-dialog-component-name"},{default:e.withCtx(()=>[...o[37]||(o[37]=[e.createTextVNode("Component name",-1)])]),_:1}),e.createElementVNode("div",Ne,[e.createVNode(V,{modelValue:t.componentName,"onUpdate:modelValue":o[17]||(o[17]=r=>t.componentName=r),id:"collection-theme-dialog-component-name"},null,8,["modelValue"])])]))]),t.rendering==="class"?(e.openBlock(),e.createElementBlock("pre",Ee,e.toDisplayString(n.value),1)):e.createCommentVNode("",!0)]),e.createVNode(_,null,{default:e.withCtx(()=>[f.value==="edit"&&!d.value?(e.openBlock(),e.createBlock(B,{key:0,variant:"destructive",class:"mr-auto",onClick:S},{default:e.withCtx(()=>[...o[40]||(o[40]=[e.createTextVNode(" Delete Style ",-1)])]),_:1})):e.createCommentVNode("",!0),f.value==="edit"&&d.value?(e.openBlock(),e.createBlock(B,{key:1,variant:"outline",class:"mr-auto",onClick:$},{default:e.withCtx(()=>[...o[41]||(o[41]=[e.createTextVNode(" Reset to Default ",-1)])]),_:1})):e.createCommentVNode("",!0),f.value==="create"?(e.openBlock(),e.createBlock(B,{key:2,type:"submit",onClick:T},{default:e.withCtx(()=>[...o[42]||(o[42]=[e.createTextVNode(" Add Style ",-1)])]),_:1})):(e.openBlock(),e.createBlock(B,{key:3,type:"submit",onClick:F},{default:e.withCtx(()=>[...o[43]||(o[43]=[e.createTextVNode(" Save Changes ",-1)])]),_:1}))]),_:1})]),_:1})]),_:1},8,["open"])}}}),De={class:"grid py-4"},we={class:"grid grid-cols-2 gap-2 mb-6"},Te={class:"relative"},Se={class:"grid grid-cols-4 gap-2 mb-6"},Fe={class:"relative"},$e={class:"relative"},ze={class:"relative"},he={class:"relative"},Ue={class:"grid grid-cols-1 gap-2 mb-6"},Ae={class:"relative"},_e={class:"flex items-center space-x-2"},Re={class:"flex items-center space-x-2"},Le={class:"grid grid-cols-2 gap-2 mb-6"},Ie={key:0},Me={class:"relative"},Oe={key:1},Ge={class:"relative"},Je={key:0,class:"bg-muted px-4 py-2 rounded-md text-sm"},Pe=e.defineComponent({__name:"CardStyleDialog",props:{defaultBackground:{type:String,default:"#FFFFFF"}},emits:["add","edit","delete"],setup(z,{expose:h,emit:b}){const{confirm:g}=R.useConfirmation(),N=b,x=e.ref(!1),f=e.ref("create"),u=e.ref(null),d=e.ref(!1),t=e.reactive({name:"",rendering:"class",className:"",componentName:"",styles:{backgroundColor:"#FFFFFF",titleColor:"#000000",textColor:"#000000",borderColor:"#000000",roundness:"none",style:"default"}}),C=a=>{a?(f.value="edit",u.value=a.id,d.value=a.id==="DEFAULT",t.name=a.name||"",t.rendering=a.rendering||"class",t.className=a.className||"",t.componentName=a.componentName||"",t.styles.backgroundColor=a.styles.backgroundColor||"#FFFFFF",t.styles.titleColor=a.styles.titleColor||"#000000",t.styles.textColor=a.styles.textColor||"#000000",t.styles.borderColor=a.styles.borderColor||"#000000",t.styles.roundness=a.styles.roundness||"none",t.styles.style=a.styles.style||"default"):(f.value="create",u.value=null,d.value=!1,t.name="",t.rendering="class",t.className="",t.componentName="",t.styles.backgroundColor="#FFFFFF",t.styles.titleColor="#000000",t.styles.textColor="#000000",t.styles.borderColor="#000000",t.styles.roundness="none",t.styles.style="default"),x.value=!0},T=()=>{N("add",t),x.value=!1},F=()=>{d.value&&(t.name="Default"),N("edit",{id:u.value,...t}),x.value=!1},S=async()=>{if(d.value)return;await g("Are you sure you want to delete this theme? This action cannot be undone.","Delete Theme","Delete")&&(N("delete",u.value),x.value=!1)},$=()=>{t.styles.backgroundColor="#FFFFFF",t.styles.titleColor="#000000",t.styles.textColor="#000000",t.styles.borderColor="#000000",t.styles.roundness="none",t.styles.style="default"},k=a=>{switch(a){case"none":return 0;case"small":return 8;case"medium":return 12;default:return 0}},n=e.computed(()=>{let a="."+t.className+` {
18
+ `;return a+=` background-color: ${t.styles.backgroundColor};
19
+ `,a+=` color: ${t.styles.textColor};
20
+ `,t.styles.style==="outline"?a+=` border: 1px solid ${t.styles.borderColor};
21
+ `:t.styles.style==="shadow"?a+=` box-shadow: 0 3px 6px #ccc;
22
+ `:t.styles.style==="retro"&&(a+=` box-shadow: inset 0 0 0 2px ${t.styles.borderColor}, 2px 2px 0 ${t.styles.borderColor};
23
+ `),t.styles.roundness!=="none"&&(a+=` border-radius: ${k(t.styles.roundness)}px;
24
+ `),a+=`}
25
+ `,a});return h({openDialog:C}),(a,o)=>{const U=e.resolveComponent("DialogTitle"),E=e.resolveComponent("DialogDescription"),D=e.resolveComponent("DialogHeader"),v=e.resolveComponent("Label"),V=e.resolveComponent("Input"),w=e.resolveComponent("RadioGroupItem"),A=e.resolveComponent("RadioGroup"),B=e.resolveComponent("Button"),_=e.resolveComponent("DialogFooter"),y=e.resolveComponent("DialogScrollContent"),L=e.resolveComponent("Dialog");return e.openBlock(),e.createBlock(L,{open:x.value,"onUpdate:open":o[19]||(o[19]=r=>x.value=r)},{default:e.withCtx(()=>[e.createVNode(y,{class:"sm:max-w-2xl"},{default:e.withCtx(()=>[e.createVNode(D,null,{default:e.withCtx(()=>[e.createVNode(U,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f.value==="create"?"Add New Card Style":"Edit Card Style"),1)]),_:1}),e.createVNode(E,null,{default:e.withCtx(()=>[...o[20]||(o[20]=[e.createTextVNode(" These settings change how this section looks in the editor. To style your live site, add matching CSS or use a custom component. ",-1)])]),_:1})]),_:1}),e.createElementVNode("div",De,[e.createElementVNode("div",we,[e.createElementVNode("div",null,[e.createVNode(v,{class:"mb-2",for:"collection-theme-dialog-theme-name"},{default:e.withCtx(()=>[...o[21]||(o[21]=[e.createTextVNode("Display name",-1)])]),_:1}),e.createElementVNode("div",Te,[e.createVNode(V,{modelValue:t.name,"onUpdate:modelValue":o[0]||(o[0]=r=>t.name=r),id:"collection-theme-dialog-theme-name",disabled:d.value},null,8,["modelValue","disabled"])])])]),o[40]||(o[40]=e.createElementVNode("h2",{class:"font-semibold mb-4"},"Style Settings",-1)),e.createElementVNode("div",Se,[e.createElementVNode("div",null,[e.createVNode(v,{class:"mb-2",for:"collection-theme-dialog-background-color"},{default:e.withCtx(()=>[...o[22]||(o[22]=[e.createTextVNode("Background color",-1)])]),_:1}),e.createElementVNode("div",Fe,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":o[1]||(o[1]=r=>t.styles.backgroundColor=r),type:"color",label:"Background color",class:"absolute top-0.5 left-1 size-8"},null,512),[[e.vModelText,t.styles.backgroundColor]]),e.createVNode(V,{modelValue:t.styles.backgroundColor,"onUpdate:modelValue":o[2]||(o[2]=r=>t.styles.backgroundColor=r),class:"pl-12",id:"collection-theme-dialog-background-color"},null,8,["modelValue"])])]),e.createElementVNode("div",null,[e.createVNode(v,{class:"mb-2",for:"collection-theme-dialog-title-color"},{default:e.withCtx(()=>[...o[23]||(o[23]=[e.createTextVNode("Heading color",-1)])]),_:1}),e.createElementVNode("div",$e,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":o[3]||(o[3]=r=>t.styles.titleColor=r),type:"color",label:"Heading color",class:"absolute top-0.5 left-1 size-8"},null,512),[[e.vModelText,t.styles.titleColor]]),e.createVNode(V,{modelValue:t.styles.titleColor,"onUpdate:modelValue":o[4]||(o[4]=r=>t.styles.titleColor=r),class:"pl-12",id:"collection-theme-dialog-title-color"},null,8,["modelValue"])])]),e.createElementVNode("div",null,[e.createVNode(v,{class:"mb-2",for:"collection-theme-dialog-text-color"},{default:e.withCtx(()=>[...o[24]||(o[24]=[e.createTextVNode("Text color",-1)])]),_:1}),e.createElementVNode("div",ze,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":o[5]||(o[5]=r=>t.styles.textColor=r),type:"color",label:"Text color",class:"absolute top-0.5 left-1 size-8"},null,512),[[e.vModelText,t.styles.textColor]]),e.createVNode(V,{modelValue:t.styles.textColor,"onUpdate:modelValue":o[6]||(o[6]=r=>t.styles.textColor=r),class:"pl-12",id:"collection-theme-dialog-text-color"},null,8,["modelValue"])])]),e.createElementVNode("div",null,[e.createVNode(v,{class:"mb-2",for:"collection-theme-dialog-border-color"},{default:e.withCtx(()=>[...o[25]||(o[25]=[e.createTextVNode("Border color",-1)])]),_:1}),e.createElementVNode("div",he,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":o[7]||(o[7]=r=>t.styles.borderColor=r),type:"color",label:"Border color",class:"absolute top-0.5 left-1 size-8"},null,512),[[e.vModelText,t.styles.borderColor]]),e.createVNode(V,{modelValue:t.styles.borderColor,"onUpdate:modelValue":o[8]||(o[8]=r=>t.styles.borderColor=r),class:"pl-12",id:"collection-theme-dialog-border-color"},null,8,["modelValue"])])])]),e.createElementVNode("div",{style:e.normalizeStyle(`--card-background-color: ${t.styles.backgroundColor}; --card-title-color: ${t.styles.titleColor}; --card-text-color: ${t.styles.textColor}`)},[e.createVNode(v,{class:"mb-4"},{default:e.withCtx(()=>[...o[26]||(o[26]=[e.createTextVNode("Shape",-1)])]),_:1}),e.createElementVNode("div",{class:"grid grid-cols-3 gap-4 mb-6 p-2 rounded",style:e.normalizeStyle({backgroundColor:z.defaultBackground})},[e.createElementVNode("div",{class:"flex flex-col gap-2 items-center cursor-pointer",onClick:o[9]||(o[9]=r=>t.styles.roundness="none")},[o[27]||(o[27]=e.createElementVNode("div",{class:"text-center px-8 py-4 bg-[var(--card-background-color)]"},[e.createElementVNode("strong",{class:"text-2xl text-[var(--card-title-color)]"},"Card"),e.createElementVNode("p",{class:"text-[var(--card-text-color)]"},"Lorem ipsum dolor sit amet.")],-1)),t.styles.roundness!=="none"?(e.openBlock(),e.createBlock(e.unref(m.Circle),{key:0,class:"size-4 text-black/30"})):(e.openBlock(),e.createBlock(e.unref(m.CircleCheckBig),{key:1,class:"size-4 text-black"}))]),e.createElementVNode("div",{class:"flex flex-col gap-2 items-center cursor-pointer",onClick:o[10]||(o[10]=r=>t.styles.roundness="small")},[o[28]||(o[28]=e.createElementVNode("div",{class:"text-center px-8 py-4 bg-[var(--card-background-color)] rounded-[8px]"},[e.createElementVNode("strong",{class:"text-2xl text-[var(--card-title-color)]"},"Card"),e.createElementVNode("p",{class:"text-[var(--card-text-color)]"},"Lorem ipsum dolor sit amet.")],-1)),t.styles.roundness!=="small"?(e.openBlock(),e.createBlock(e.unref(m.Circle),{key:0,class:"size-4 text-black/30"})):(e.openBlock(),e.createBlock(e.unref(m.CircleCheckBig),{key:1,class:"size-4 text-black"}))]),e.createElementVNode("div",{class:"flex flex-col gap-2 items-center cursor-pointer",onClick:o[11]||(o[11]=r=>t.styles.roundness="medium")},[o[29]||(o[29]=e.createElementVNode("div",{class:"text-center px-8 py-4 bg-[var(--card-background-color)] rounded-[12px]"},[e.createElementVNode("strong",{class:"text-2xl text-[var(--card-title-color)]"},"Card"),e.createElementVNode("p",{class:"text-[var(--card-text-color)]"},"Lorem ipsum dolor sit amet.")],-1)),t.styles.roundness!=="medium"?(e.openBlock(),e.createBlock(e.unref(m.Circle),{key:0,class:"size-4 text-black/30"})):(e.openBlock(),e.createBlock(e.unref(m.CircleCheckBig),{key:1,class:"size-4 text-black"}))])],4),e.createVNode(v,{class:"mb-4"},{default:e.withCtx(()=>[...o[30]||(o[30]=[e.createTextVNode("Style",-1)])]),_:1}),e.createElementVNode("div",{class:"grid grid-cols-4 gap-4 mb-6 p-2 rounded",style:e.normalizeStyle(`--card-border-radius: ${k(t.styles.roundness)}px; --card-border-color: ${t.styles.borderColor}; background-color: ${z.defaultBackground}`)},[e.createElementVNode("div",{class:"flex flex-col gap-2 items-center cursor-pointer",onClick:o[12]||(o[12]=r=>t.styles.style="default")},[o[31]||(o[31]=e.createElementVNode("div",{class:"text-center px-8 py-4 bg-[var(--card-background-color)] rounded-[var(--card-border-radius)]"},[e.createElementVNode("strong",{class:"text-2xl text-[var(--card-title-color)]"},"Card"),e.createElementVNode("p",{class:"text-[var(--card-text-color)]"},"Lorem ipsum dolor sit amet.")],-1)),t.styles.style!=="default"?(e.openBlock(),e.createBlock(e.unref(m.Circle),{key:0,class:"size-4 text-black/30"})):(e.openBlock(),e.createBlock(e.unref(m.CircleCheckBig),{key:1,class:"size-4 text-black"}))]),e.createElementVNode("div",{class:"flex flex-col gap-2 items-center cursor-pointer",onClick:o[13]||(o[13]=r=>t.styles.style="outline")},[o[32]||(o[32]=e.createElementVNode("div",{class:"text-center px-8 py-4 bg-[var(--card-background-color)] rounded-[var(--card-border-radius)] border border-[var(--card-border-color)]"},[e.createElementVNode("strong",{class:"text-2xl text-[var(--card-title-color)]"},"Card"),e.createElementVNode("p",{class:"text-[var(--card-text-color)]"},"Lorem ipsum dolor sit amet.")],-1)),t.styles.style!=="outline"?(e.openBlock(),e.createBlock(e.unref(m.Circle),{key:0,class:"size-4 text-black/30"})):(e.openBlock(),e.createBlock(e.unref(m.CircleCheckBig),{key:1,class:"size-4 text-black"}))]),e.createElementVNode("div",{class:"flex flex-col gap-2 items-center cursor-pointer",onClick:o[14]||(o[14]=r=>t.styles.style="shadow")},[o[33]||(o[33]=e.createElementVNode("div",{class:"text-center px-8 py-4 bg-[var(--card-background-color)] rounded-[var(--card-border-radius)]",style:{"box-shadow":"0 3px 6px #ccc"}},[e.createElementVNode("strong",{class:"text-2xl text-[var(--card-title-color)]"},"Card"),e.createElementVNode("p",{class:"text-[var(--card-text-color)]"},"Lorem ipsum dolor sit amet.")],-1)),t.styles.style!=="shadow"?(e.openBlock(),e.createBlock(e.unref(m.Circle),{key:0,class:"size-4 text-black/30"})):(e.openBlock(),e.createBlock(e.unref(m.CircleCheckBig),{key:1,class:"size-4 text-black"}))]),e.createElementVNode("div",{class:"flex flex-col gap-2 items-center cursor-pointer",onClick:o[15]||(o[15]=r=>t.styles.style="retro")},[e.createElementVNode("div",{class:"text-center px-8 py-4 bg-[var(--card-background-color)] rounded-[var(--card-border-radius)]",style:e.normalizeStyle(`box-shadow: inset 0 0 0 2px ${t.styles.borderColor}, 2px 2px 0 ${t.styles.borderColor};`)},[...o[34]||(o[34]=[e.createElementVNode("strong",{class:"text-2xl text-[var(--card-title-color)]"},"Card",-1),e.createElementVNode("p",{class:"text-[var(--card-text-color)]"},"Lorem ipsum dolor sit amet.",-1)])],4),t.styles.style!=="retro"?(e.openBlock(),e.createBlock(e.unref(m.Circle),{key:0,class:"size-4 text-black/30"})):(e.openBlock(),e.createBlock(e.unref(m.CircleCheckBig),{key:1,class:"size-4 text-black"}))])],4)],4),o[41]||(o[41]=e.createElementVNode("h2",{class:"font-semibold mb-4"},"Rendering Method",-1)),e.createElementVNode("div",Ue,[e.createElementVNode("div",null,[e.createElementVNode("div",Ae,[e.createVNode(v,{class:"mb-4 text-muted-foreground"},{default:e.withCtx(()=>[...o[35]||(o[35]=[e.createTextVNode("Choose how this section should be styled on your site:",-1)])]),_:1}),e.createVNode(A,{modelValue:t.rendering,"onUpdate:modelValue":o[16]||(o[16]=r=>t.rendering=r),"default-value":"class"},{default:e.withCtx(()=>[e.createElementVNode("div",_e,[e.createVNode(w,{id:"collection-theme-dialog-render-class",value:"class"}),e.createVNode(v,{for:"collection-theme-dialog-render-class"},{default:e.withCtx(()=>[...o[36]||(o[36]=[e.createTextVNode("Use a CSS class",-1)])]),_:1})]),e.createElementVNode("div",Re,[e.createVNode(w,{id:"collection-theme-dialog-render-component",value:"component"}),e.createVNode(v,{for:"collection-theme-dialog-render-component"},{default:e.withCtx(()=>[...o[37]||(o[37]=[e.createTextVNode("Custom component",-1)])]),_:1})])]),_:1},8,["modelValue"])])])]),e.createElementVNode("div",Le,[t.rendering==="class"?(e.openBlock(),e.createElementBlock("div",Ie,[e.createVNode(v,{class:"mb-2",for:"collection-theme-dialog-class-name"},{default:e.withCtx(()=>[...o[38]||(o[38]=[e.createTextVNode("Class name",-1)])]),_:1}),e.createElementVNode("div",Me,[e.createVNode(V,{modelValue:t.className,"onUpdate:modelValue":o[17]||(o[17]=r=>t.className=r),id:"collection-theme-dialog-class-name"},null,8,["modelValue"])])])):(e.openBlock(),e.createElementBlock("div",Oe,[e.createVNode(v,{class:"mb-2",for:"collection-theme-dialog-component-name"},{default:e.withCtx(()=>[...o[39]||(o[39]=[e.createTextVNode("Component name",-1)])]),_:1}),e.createElementVNode("div",Ge,[e.createVNode(V,{modelValue:t.componentName,"onUpdate:modelValue":o[18]||(o[18]=r=>t.componentName=r),id:"collection-theme-dialog-component-name"},null,8,["modelValue"])])]))]),t.rendering==="class"?(e.openBlock(),e.createElementBlock("pre",Je,e.toDisplayString(n.value),1)):e.createCommentVNode("",!0)]),e.createVNode(_,null,{default:e.withCtx(()=>[f.value==="edit"&&!d.value?(e.openBlock(),e.createBlock(B,{key:0,variant:"destructive",class:"mr-auto",onClick:S},{default:e.withCtx(()=>[...o[42]||(o[42]=[e.createTextVNode(" Delete Style ",-1)])]),_:1})):e.createCommentVNode("",!0),f.value==="edit"&&d.value?(e.openBlock(),e.createBlock(B,{key:1,variant:"outline",class:"mr-auto",onClick:$},{default:e.withCtx(()=>[...o[43]||(o[43]=[e.createTextVNode(" Reset to Default ",-1)])]),_:1})):e.createCommentVNode("",!0),f.value==="create"?(e.openBlock(),e.createBlock(B,{key:2,type:"submit",onClick:T},{default:e.withCtx(()=>[...o[44]||(o[44]=[e.createTextVNode(" Add Style ",-1)])]),_:1})):(e.openBlock(),e.createBlock(B,{key:3,type:"submit",onClick:F},{default:e.withCtx(()=>[...o[45]||(o[45]=[e.createTextVNode(" Save Changes ",-1)])]),_:1}))]),_:1})]),_:1})]),_:1},8,["open"])}}}),He={class:"w-full"},je={class:"flex items-center justify-between gap-4 w-full my-4"},qe={key:0,class:"flex gap-4 flex-wrap mb-8"},Ke=["onClick"],We={class:"text-muted-foreground group-hover/item:text-white transition-colors duration-300"},Qe={key:1,class:"flex gap-4 flex-wrap mb-8"},Xe={key:2,class:"flex gap-4 flex-wrap mb-8"},Ye=["onClick"],Ze={class:"text-muted-foreground group-hover/item:text-white transition-colors duration-300"},et={key:3,class:"flex gap-4 flex-wrap mb-8"},tt={key:4,class:"flex gap-4 flex-wrap mb-8"},ot=["onClick"],lt={class:"text-muted-foreground group-hover/item:text-white transition-colors duration-300"},st={key:5,class:"flex gap-4 flex-wrap mb-8"},rt={key:6,class:"mb-8"},nt={class:"flex flex-wrap items-center gap-3 mb-4"},at={class:"flex items-center gap-3 rounded-md border border-border px-3 py-2"},dt={class:"font-mono text-sm uppercase"},it={key:0,class:"flex flex-wrap gap-3"},ct=["aria-label","title","onClick"],ut={class:"min-w-24"},mt={class:"font-mono text-sm uppercase"},pt={class:"text-xs text-muted-foreground"},yt={key:1,class:"text-muted-foreground"},vt={key:7,class:"flex gap-4 flex-wrap mb-8"},xt=e.defineComponent({__name:"GlobalStyling",setup(z){const{navigateTo:h}=R.useModuleRoute(),{getModuleData:b,setModuleData:g}=R.useModuleStorage();R.useModuleBreadcrumbs(()=>[{text:"Global Styling"}]);const N=e.ref(""),x=e.ref(""),f=e.ref(""),u=e.ref(null),d=e.ref(null),t=e.ref(null),C=e.ref(null),T=e.ref("#3B82F6"),F=e.computed(()=>u.value===null?null:u.value&&u.value.find(s=>s.id==="DEFAULT")?u.value:[{id:"DEFAULT",name:"Default",className:"",styles:{backgroundColor:"#FFFFFF",textColor:"#000000"}},...u.value]),S=e.computed(()=>F.value?.find(s=>s.id==="DEFAULT")?.styles.backgroundColor??"#FFFFFF"),$=e.computed(()=>d.value===null?null:d.value&&d.value.find(s=>s.id==="DEFAULT")?d.value:[{id:"DEFAULT",name:"Default",className:"",styles:{backgroundColor:"#FFFFFF",textColor:"#000000"}},...d.value]),k=e.computed(()=>t.value===null?null:t.value&&t.value.find(s=>s.id==="DEFAULT")?t.value:[{id:"DEFAULT",name:"Default",className:"",styles:{backgroundColor:"#FFFFFF",textColor:"#000000"}},...t.value]),n=e.computed(()=>C.value),a=e.computed(()=>C.value===null?!1:!C.value.some(s=>s.color===y(T.value)));async function o(s){let l=JSON.parse(JSON.stringify(s)),c=crypto.randomUUID();l.id=c,u.value.push(l),u.value=await b("sectionThemes")||[],u.value.push(l),g("sectionThemes",u.value)}async function U(s){let l=JSON.parse(JSON.stringify(s)),c=u.value.findIndex(p=>p.id===l.id);c!==-1?u.value[c]=l:l.id==="DEFAULT"&&(Array.isArray(u.value)||(u.value=[]),u.value=[{id:"DEFAULT",name:"Default",styles:l.styles},...u.value]),u.value=await b("sectionThemes")||[],c=u.value.findIndex(p=>p.id===l.id),c!==-1?(u.value[c]=l,g("sectionThemes",u.value)):l.id==="DEFAULT"&&(Array.isArray(u.value)||(u.value=[]),u.value=[{id:"DEFAULT",name:"Default",styles:l.styles},...u.value],g("sectionThemes",u.value))}async function E(s){u.value=u.value.filter(l=>l.id!==s),u.value=await b("sectionThemes")||[],u.value=u.value.filter(l=>l.id!==s),g("sectionThemes",u.value)}async function D(s){let l=JSON.parse(JSON.stringify(s)),c=crypto.randomUUID();l.id=c,d.value.push(l),d.value=await b("buttonThemes")||[],d.value.push(l),g("buttonThemes",d.value)}async function v(s){let l=JSON.parse(JSON.stringify(s)),c=d.value.findIndex(p=>p.id===l.id);c!==-1?d.value[c]=l:l.id==="DEFAULT"&&(Array.isArray(d.value)||(d.value=[]),d.value=[{id:"DEFAULT",name:"Default",styles:l.styles},...d.value]),d.value=await b("buttonThemes")||[],c=d.value.findIndex(p=>p.id===l.id),c!==-1?(d.value[c]=l,g("buttonThemes",d.value)):l.id==="DEFAULT"&&(Array.isArray(d.value)||(d.value=[]),d.value=[{id:"DEFAULT",name:"Default",styles:l.styles},...d.value],g("buttonThemes",d.value))}async function V(s){d.value=d.value.filter(l=>l.id!==s),d.value=await b("buttonThemes")||[],d.value=d.value.filter(l=>l.id!==s),g("buttonThemes",d.value)}const w=function(s){let l={};if(l.backgroundColor=s.styles.backgroundColor,l.color=s.styles.textColor,s.styles.buttonStyle==="outline"?l.border=`1px solid ${s.styles.borderColor}`:s.styles.buttonStyle==="shadow"?l.boxShadow="0 3px 6px #ccc":s.styles.buttonStyle==="retro"&&(l.boxShadow=`inset 0 0 0 2px ${s.styles.borderColor}, 2px 2px 0 ${s.styles.borderColor}`),s.styles.buttonRoundness!=="none"){let c=0;s.styles.buttonRoundness==="small"?c=4:s.styles.buttonRoundness==="medium"?c=8:s.styles.buttonRoundness==="pill"&&(c=9999),l.borderRadius=`${c}px`}return l};async function A(s){let l=JSON.parse(JSON.stringify(s)),c=crypto.randomUUID();l.id=c,t.value.push(l),t.value=await b("cardThemes")||[],t.value.push(l),g("cardThemes",t.value)}async function B(s){let l=JSON.parse(JSON.stringify(s)),c=t.value.findIndex(p=>p.id===l.id);c!==-1?t.value[c]=l:l.id==="DEFAULT"&&(Array.isArray(t.value)||(t.value=[]),t.value=[{id:"DEFAULT",name:"Default",styles:l.styles},...t.value]),t.value=await b("cardThemes")||[],c=t.value.findIndex(p=>p.id===l.id),c!==-1?(t.value[c]=l,g("cardThemes",t.value)):l.id==="DEFAULT"&&(Array.isArray(t.value)||(t.value=[]),t.value=[{id:"DEFAULT",name:"Default",styles:l.styles},...t.value],g("cardThemes",t.value))}async function _(s){t.value=t.value.filter(l=>l.id!==s),t.value=await b("cardThemes")||[],t.value=t.value.filter(l=>l.id!==s),g("cardThemes",t.value)}function y(s){return s.startsWith("#")?s.toUpperCase():`#${s.toUpperCase()}`}function L(){return[{id:"WHITE",name:"White",color:"#FFFFFF",isDefault:!1},{id:"BLACK",name:"Black",color:"#000000",isDefault:!0}]}function r(s){if(!Array.isArray(s))return[];let l=!1;const c=s.map(p=>{const i=typeof p=="string"?{id:crypto.randomUUID(),color:y(p),isDefault:!1}:{id:p.id||crypto.randomUUID(),name:p.name,color:y(p.color),isDefault:!!p.isDefault};return i.isDefault&&(i.isDefault=!l,l=!0),i});return c.length&&!l&&(c[0].isDefault=!0),c}async function O(){const s=r(await b("iconColors")??C.value??[]),l=y(T.value);if(s.some(c=>c.color===l)){C.value=s;return}C.value=[...s,{id:crypto.randomUUID(),color:l,isDefault:s.length===0}],g("iconColors",C.value)}async function G(s){const l=r(await b("iconColors")??C.value??[]),c=l.find(i=>i.id===s),p=l.filter(i=>i.id!==s);c?.isDefault&&p.length&&(p[0].isDefault=!0),C.value=p,g("iconColors",C.value)}async function M(s){const l=r(await b("iconColors")??C.value??[]);C.value=l.map(c=>({...c,isDefault:c.id===s})),g("iconColors",C.value)}const J=function(s){let l={};if(l.backgroundColor=s.styles.backgroundColor,l.color=s.styles.textColor,s.styles.style==="outline"?l.border=`1px solid ${s.styles.borderColor}`:s.styles.style==="shadow"?l.boxShadow="0 3px 6px #ccc":s.styles.style==="retro"&&(l.boxShadow=`inset 0 0 0 2px ${s.styles.borderColor}, 2px 2px 0 ${s.styles.borderColor}`),s.styles.roundness!=="none"){let c=0;s.styles.roundness==="small"?c=4:s.styles.roundness==="medium"&&(c=8),l.borderRadius=`${c}px`}return l};return e.onMounted(()=>{b("sectionThemes").then(s=>{u.value=s||[]}),b("buttonThemes").then(s=>{d.value=s||[]}),b("cardThemes").then(s=>{t.value=s||[]}),b("iconColors").then(s=>{if(s==null){C.value=L(),g("iconColors",C.value);return}C.value=r(s)})}),(s,l)=>{const c=e.resolveComponent("Button"),p=e.resolveComponent("Skeleton");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",He,[e.createElementVNode("div",je,[e.createVNode(c,{onClick:l[0]||(l[0]=i=>e.unref(h)("/")),variant:"link",class:"!pl-0"},{default:e.withCtx(()=>[e.createVNode(e.unref(m.ChevronLeft),{class:"size-4"}),l[5]||(l[5]=e.createTextVNode(" Collections ",-1))]),_:1})]),l[12]||(l[12]=e.createElementVNode("h1",{class:"text-3xl mb-8"},"Global Styling",-1)),l[13]||(l[13]=e.createElementVNode("h3",{class:"text-2xl mb-2"},"Section Variants",-1)),l[14]||(l[14]=e.createElementVNode("p",{class:"mb-6 max-w-3xl text-muted-foreground"}," Set up the default design variants for your sections. These styles will be available across all collections by default, but you can choose to disable them within individual collections if needed. ",-1)),F.value!==null?(e.openBlock(),e.createElementBlock("div",qe,[e.createElementVNode("div",{class:"group/item flex flex-col gap-2 items-center",onClick:l[1]||(l[1]=i=>N.value.openDialog())},[e.createVNode(c,{variant:"outline",class:"size-44 border-dotted",tabindex:"-1"},{default:e.withCtx(()=>[e.createVNode(e.unref(m.Plus),{class:"size-14"})]),_:1}),l[6]||(l[6]=e.createElementVNode("p",{class:"text-muted-foreground group-hover/item:text-white transition-colors duration-300"},"New Style",-1))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,i=>(e.openBlock(),e.createElementBlock("div",{class:"group/item flex flex-col gap-2 text-black items-center cursor-pointer hover:brightness-105 transition-all duration-300",key:i.id,onClick:I=>N.value.openDialog(i)},[e.createElementVNode("div",{class:"flex flex-col items-start rounded-md p-4 size-44",style:e.normalizeStyle({backgroundColor:i.styles.backgroundColor,border:"1px solid #E5E7EB"})},[e.createElementVNode("strong",{class:"text-2xl",style:e.normalizeStyle({color:i.styles.titleColor})},"Title",4),e.createElementVNode("p",{class:"mb-1",style:e.normalizeStyle({color:i.styles.textColor})},[...l[7]||(l[7]=[e.createTextVNode("Lorem ipsum dolor",-1),e.createElementVNode("br",null,null,-1),e.createTextVNode("sit amet.",-1)])],4),i.className?(e.openBlock(),e.createElementBlock("p",{key:0,class:"px-3 py-1.5 rounded-[99px]",style:e.normalizeStyle({backgroundColor:i.styles.textColor,color:i.styles.backgroundColor})},"."+e.toDisplayString(i.className),5)):e.createCommentVNode("",!0)],4),e.createElementVNode("p",We,e.toDisplayString(i.name),1)],8,Ke))),128))])):(e.openBlock(),e.createElementBlock("div",Qe,[e.createVNode(p,{class:"size-44 rounded-md"}),e.createVNode(p,{class:"size-44 rounded-md"})])),l[15]||(l[15]=e.createElementVNode("h3",{class:"text-2xl mb-2"},"Button Variants",-1)),l[16]||(l[16]=e.createElementVNode("p",{class:"mb-6 max-w-3xl text-muted-foreground"}," Define your standard button styles here. Collections can inherit these defaults or customize their own variants for more tailored experiences. ",-1)),$.value!==null?(e.openBlock(),e.createElementBlock("div",Xe,[e.createElementVNode("div",{class:"group/item flex flex-col gap-2 items-center",onClick:l[2]||(l[2]=i=>x.value.openDialog())},[e.createVNode(c,{variant:"outline",class:"size-44 border-dotted",tabindex:"-1"},{default:e.withCtx(()=>[e.createVNode(e.unref(m.Plus),{class:"size-14"})]),_:1}),l[8]||(l[8]=e.createElementVNode("p",{class:"text-muted-foreground group-hover/item:text-white transition-colors duration-300"},"New Style",-1))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value,i=>(e.openBlock(),e.createElementBlock("div",{class:"group/item flex flex-col gap-2 text-black items-center cursor-pointer hover:brightness-105 transition-all duration-300",key:i.id,onClick:I=>x.value.openDialog(i)},[e.createElementVNode("div",{class:"flex flex-col items-center justify-center rounded-md p-4 size-44",style:e.normalizeStyle({backgroundColor:S.value})},[e.createElementVNode("div",{style:e.normalizeStyle(w(i)),class:"px-4 py-2"}," Button ",4)],4),e.createElementVNode("p",Ze,e.toDisplayString(i.name),1)],8,Ye))),128))])):(e.openBlock(),e.createElementBlock("div",et,[e.createVNode(p,{class:"size-44 rounded-md"}),e.createVNode(p,{class:"size-44 rounded-md"})])),l[17]||(l[17]=e.createElementVNode("h3",{class:"text-2xl mb-2"},"Card Variants",-1)),l[18]||(l[18]=e.createElementVNode("p",{class:"mb-6 max-w-3xl text-muted-foreground"}," Define your standard card styles here. Collections can inherit these defaults or customize their own variants for more tailored experiences. ",-1)),k.value!==null?(e.openBlock(),e.createElementBlock("div",tt,[e.createElementVNode("div",{class:"group/item flex flex-col gap-2 items-center",onClick:l[3]||(l[3]=i=>f.value.openDialog())},[e.createVNode(c,{variant:"outline",class:"size-44 border-dotted",tabindex:"-1"},{default:e.withCtx(()=>[e.createVNode(e.unref(m.Plus),{class:"size-14"})]),_:1}),l[9]||(l[9]=e.createElementVNode("p",{class:"text-muted-foreground group-hover/item:text-white transition-colors duration-300"},"New Style",-1))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,i=>(e.openBlock(),e.createElementBlock("div",{class:"group/item flex flex-col gap-2 text-black items-center cursor-pointer hover:brightness-105 transition-all duration-300",key:i.id,onClick:I=>f.value.openDialog(i)},[e.createElementVNode("div",{class:"flex flex-col items-center justify-center rounded-md p-4 size-44",style:e.normalizeStyle({backgroundColor:S.value})},[e.createElementVNode("div",{style:e.normalizeStyle(J(i)),class:"p-4"},[e.createElementVNode("strong",{class:"text-2xl",style:e.normalizeStyle({color:i.styles.titleColor})},"Card",4),l[10]||(l[10]=e.createElementVNode("p",null,"Lorem ipsum dolor sit amet.",-1))],4)],4),e.createElementVNode("p",lt,e.toDisplayString(i.name),1)],8,ot))),128))])):(e.openBlock(),e.createElementBlock("div",st,[e.createVNode(p,{class:"size-44 rounded-md"}),e.createVNode(p,{class:"size-44 rounded-md"})])),l[19]||(l[19]=e.createElementVNode("h3",{class:"text-2xl mb-2"},"Icon Colors",-1)),l[20]||(l[20]=e.createElementVNode("p",{class:"mb-6 max-w-3xl text-muted-foreground"}," Manage the color options available for icons and choose which one is used by default. ",-1)),n.value!==null?(e.openBlock(),e.createElementBlock("div",rt,[e.createElementVNode("div",nt,[e.createElementVNode("label",at,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":l[4]||(l[4]=i=>T.value=i),type:"color",class:"h-9 w-12 cursor-pointer rounded border border-border bg-transparent p-1"},null,512),[[e.vModelText,T.value]]),e.createElementVNode("span",dt,e.toDisplayString(T.value),1)]),e.createVNode(c,{onClick:O,disabled:!a.value},{default:e.withCtx(()=>[e.createVNode(e.unref(m.Plus),{class:"size-4"}),l[11]||(l[11]=e.createTextVNode(" Add Color ",-1))]),_:1},8,["disabled"])]),n.value.length?(e.openBlock(),e.createElementBlock("div",it,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,i=>(e.openBlock(),e.createElementBlock("div",{class:"flex items-center gap-3 rounded-md border border-border p-3",key:i.id},[e.createElementVNode("button",{type:"button",class:"size-10 rounded-md border border-border",style:e.normalizeStyle({backgroundColor:i.color}),"aria-label":`Set ${i.color} as default icon color`,title:`Set ${i.color} as default`,onClick:I=>M(i.id)},null,12,ct),e.createElementVNode("div",ut,[e.createElementVNode("p",mt,e.toDisplayString(i.color),1),e.createElementVNode("p",pt,e.toDisplayString(i.isDefault?"Default":i.name||"Icon color"),1)]),e.createVNode(c,{type:"button",size:"icon",variant:i.isDefault?"default":"outline","aria-pressed":i.isDefault,"aria-label":`Set ${i.color} as default icon color`,title:`Set ${i.color} as default`,onClick:I=>M(i.id)},{default:e.withCtx(()=>[e.createVNode(e.unref(m.Check),{class:"size-4"})]),_:1},8,["variant","aria-pressed","aria-label","title","onClick"]),e.createVNode(c,{type:"button",size:"icon",variant:"outline","aria-label":`Delete ${i.color}`,title:`Delete ${i.color}`,onClick:I=>G(i.id)},{default:e.withCtx(()=>[e.createVNode(e.unref(m.Trash2),{class:"size-4"})]),_:1},8,["aria-label","title","onClick"])]))),128))])):(e.openBlock(),e.createElementBlock("p",yt,"No icon colors configured."))])):(e.openBlock(),e.createElementBlock("div",vt,[e.createVNode(p,{class:"size-44 rounded-md"}),e.createVNode(p,{class:"size-44 rounded-md"})]))]),e.createVNode(ae,{ref_key:"sectionStyleDialog",ref:N,onAdd:o,onEdit:U,onDelete:E},null,512),e.createVNode(Be,{ref_key:"buttonStyleDialog",ref:x,defaultBackground:S.value,onAdd:D,onEdit:v,onDelete:V},null,8,["defaultBackground"]),e.createVNode(Pe,{ref_key:"cardStyleDialog",ref:f,defaultBackground:S.value,onAdd:A,onEdit:B,onDelete:_},null,8,["defaultBackground"])],64)}}});exports.default=xt;
@@ -0,0 +1 @@
1
+ "use strict";const e=require("vue"),U=require("lucide-vue-next"),K=require("@oneclick.dev/cms-kit"),J=require("./utils-Yd6F5mea.js"),G=require("./DateFormatter-CSAbE3BC.js"),te=require("./_plugin-vue_export-helper-BHFhmbuH.js"),ne={class:"space-y-3"},ae={class:"grid gap-4 @md/modal:grid-cols-2 @2xl/modal:grid-cols-3 @4xl/modal:grid-cols-4 overflow-hidden p-1"},re={key:0,class:"flex items-center gap-3 min-h-9"},se={key:0,class:"italic text-xs opacity-50"},le={key:0,class:"italic text-xs opacity-50"},ie={key:0,class:"italic text-xs opacity-50"},ce={key:0,class:"italic text-xs opacity-50"},de={key:0,class:"text-red-400"},ue={class:"list-disc pl-4"},me=e.defineComponent({__name:"CustomerInformation",props:{agendaData:{}},setup(C,{expose:$}){const b=[{id:"firstName",fieldName:"First Name",fieldType:"text",required:!0,visible:!0},{id:"lastName",fieldName:"Last Name",fieldType:"text",required:!0,visible:!0},{id:"phone",fieldName:"Phone No",fieldType:"tel",required:!0,visible:!0},{id:"email",fieldName:"Email",fieldType:"email",required:!0,visible:!0},{id:"birthdate",fieldName:"Birthdate",fieldType:"date",required:!0,visible:!0}],E=new Set(["firstName","email"]),R=C,T=e.ref([]),v=e.reactive({}),B=e.computed(()=>{const i=R.agendaData?.customerInformationFields,p=(Array.isArray(i)&&i.length>0?i:b).filter(V=>V?.id&&(V.visible!==!1||E.has(V.id))).map(V=>({...V,required:E.has(V.id),visible:!0})),_=b.filter(V=>E.has(V.id)&&!p.some(M=>M.id===V.id)).map(V=>({...V,required:!0,visible:!0}));return[...p,..._]}),y=i=>i.fieldName||i.id,w=i=>i.replace(/[^A-Za-z0-9_-]/g,"-"),h=(i,N)=>["new-res-customer-info",i.id,N].filter(Boolean).map(_=>w(_)).join("-"),k=i=>i.fieldType==="email"||i.fieldType==="tel"||i.fieldType==="date"?i.fieldType:"text",I=i=>Array.isArray(i.options)?i.options.filter(Boolean):[],L=i=>i.fieldType==="checkbox"?!1:"",g=(i=!1)=>{const N=new Set(B.value.map(p=>p.id));Object.keys(v).forEach(p=>{N.has(p)||delete v[p]}),B.value.forEach(p=>{const _=L(p);(i||v[p.id]===void 0||typeof v[p.id]!=typeof _)&&(v[p.id]=_)})},F=()=>{const i=B.value.reduce((N,p)=>{const _=v[p.id];return N[p.id]=typeof _=="string"?_.trim():!!_,N},{});return Object.entries(i).forEach(([N,p])=>{v[N]=p}),i},O=(i,N)=>i.fieldType==="checkbox"?N===!0:typeof N=="string"?N.trim().length>0:N!=null,q=()=>{T.value=[],g(!0)},D=()=>{const i=[],N=F();return B.value.forEach(p=>{const _=N[p.id],V=y(p);p.required&&!O(p,_)&&i.push(`Please fill in ${V}.`),p.fieldType==="email"&&O(p,_)&&typeof _=="string"&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(_)===!1&&i.push(`Please fill in a correct ${V}.`)}),T.value=i,i.length===0};return e.watch(B,()=>{g()},{immediate:!0}),$({getCustomerInfo:F,reset:q,validateForm:D}),(i,N)=>{const p=e.resolveComponent("Checkbox"),_=e.resolveComponent("Label"),V=e.resolveComponent("SelectValue"),M=e.resolveComponent("SelectTrigger"),z=e.resolveComponent("SelectItem"),H=e.resolveComponent("SelectGroup"),Q=e.resolveComponent("SelectContent"),A=e.resolveComponent("Select"),s=e.resolveComponent("RadioGroupItem"),r=e.resolveComponent("RadioGroup"),c=e.resolveComponent("Input");return e.openBlock(),e.createElementBlock("div",ne,[N[0]||(N[0]=e.createElementVNode("h2",{class:"text-sm font-medium"},"Customer Information",-1)),e.createElementVNode("div",ae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.value,t=>(e.openBlock(),e.createElementBlock("div",{key:t.id,class:e.normalizeClass(["grid gap-2",t.fieldType==="checkbox"?"@md/modal:col-span-2":""])},[t.fieldType==="checkbox"?(e.openBlock(),e.createElementBlock("div",re,[e.createVNode(p,{id:h(t),modelValue:v[t.id],"onUpdate:modelValue":n=>v[t.id]=n},null,8,["id","modelValue","onUpdate:modelValue"]),e.createVNode(_,{for:h(t),class:"font-normal cursor-pointer"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(y(t))+" ",1),t.required?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",se,"optional"))]),_:2},1032,["for"])])):t.fieldType==="select"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(_,{for:h(t)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(y(t))+" ",1),t.required?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",le,"optional"))]),_:2},1032,["for"]),e.createVNode(A,{modelValue:v[t.id],"onUpdate:modelValue":n=>v[t.id]=n},{default:e.withCtx(()=>[e.createVNode(M,{id:h(t),class:"w-full"},{default:e.withCtx(()=>[e.createVNode(V,{placeholder:`Select ${y(t)}`},null,8,["placeholder"])]),_:2},1032,["id"]),e.createVNode(Q,null,{default:e.withCtx(()=>[e.createVNode(H,null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I(t),n=>(e.openBlock(),e.createBlock(z,{key:n,value:n},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n),1)]),_:2},1032,["value"]))),128))]),_:2},1024)]),_:2},1024)]),_:2},1032,["modelValue","onUpdate:modelValue"])],64)):t.fieldType==="radio"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createVNode(_,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(y(t))+" ",1),t.required?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",ie,"optional"))]),_:2},1024),e.createVNode(r,{modelValue:v[t.id],"onUpdate:modelValue":n=>v[t.id]=n,class:"grid gap-2"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I(t),n=>(e.openBlock(),e.createElementBlock("div",{key:n,class:"flex items-center gap-2"},[e.createVNode(s,{id:h(t,n),value:n},null,8,["id","value"]),e.createVNode(_,{for:h(t,n),class:"font-normal cursor-pointer"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n),1)]),_:2},1032,["for"])]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createVNode(_,{for:h(t)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(y(t))+" ",1),t.required?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",ce,"optional"))]),_:2},1032,["for"]),e.createVNode(c,{modelValue:v[t.id],"onUpdate:modelValue":n=>v[t.id]=n,id:h(t),type:k(t),autocomplete:"off"},null,8,["modelValue","onUpdate:modelValue","id","type"])],64))],2))),128))]),T.value.length>0?(e.openBlock(),e.createElementBlock("div",de,[e.createElementVNode("ul",ue,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,t=>(e.openBlock(),e.createElementBlock("li",{key:t},e.toDisplayString(t),1))),128))])])):e.createCommentVNode("",!0)])}}});function pe(C={}){const $=e.ref(null),b=e.ref(!1),E=e.ref(!1),R=e.ref(!1),T=e.ref(!1),v=C.dragSpeed??1.1,B=C.dragThreshold??10,y=C.edgeThreshold??10,w=C.ignoreDragSelector??'input, select, textarea, [contenteditable="true"], [data-horizontal-scroll-ignore-drag]';let h=null,k=0,I=0,L=!1,g=null,F=null,O=null;const q=()=>{g===null||typeof window>"u"||(window.clearTimeout(g),g=null)},D=()=>{const o=$.value;if(!o){E.value=!1,R.value=!1,T.value=!1;return}const a=Math.max(o.scrollWidth-o.clientWidth,0);E.value=a>y,R.value=E.value&&o.scrollLeft>y,T.value=E.value&&o.scrollLeft<a-y},i=()=>{e.nextTick(()=>{if(typeof window>"u"){D();return}window.requestAnimationFrame(()=>D())})},N=()=>{if(typeof C.scrollStep=="number")return C.scrollStep;const o=$.value;return o?Math.max(Math.floor(o.clientWidth*.72),180):240},p=(o,a="smooth")=>{const l=$.value;if(l){if(l.scrollBy({left:o,behavior:a}),a==="auto"){D();return}i()}},_=()=>{p(-N())},V=()=>{p(N())},M=()=>{const o=$.value;h!==null&&o?.hasPointerCapture?.(h)&&o.releasePointerCapture(h),b.value&&(L=!0,q(),typeof window<"u"&&(g=window.setTimeout(()=>{L=!1,g=null},0))),h=null,b.value=!1,o&&(o.style.userSelect="",o.style.cursor=""),D()},z=()=>{D()},H=o=>{const a=$.value;if(!a||!E.value||Math.abs(o.deltaY)<=Math.abs(o.deltaX))return;const l=o.deltaY<0,S=o.deltaY>0;l&&!R.value||S&&!T.value||(o.preventDefault(),a.scrollLeft+=o.deltaY,D())},Q=o=>o instanceof Element?!!o.closest(w):!1,A=o=>{const a=$.value;!a||!E.value||o.pointerType!=="touch"&&o.button===0&&(Q(o.target)||(h=o.pointerId,k=o.clientX,I=a.scrollLeft,L=!1))},s=o=>{const a=$.value;if(!a||h!==o.pointerId)return;const l=o.clientX-k;!b.value&&Math.abs(l)<B||(b.value||(b.value=!0,a.style.userSelect="none",a.style.cursor="grabbing",a.setPointerCapture?.(o.pointerId)),o.preventDefault(),a.scrollLeft=I-l*v,D())},r=o=>{h===o.pointerId&&M()},c=()=>{h!==null&&M()},t=o=>{L&&(o.preventDefault(),o.stopPropagation(),L=!1)},n=o=>{typeof ResizeObserver<"u"&&(F=new ResizeObserver(()=>D()),F.observe(o)),C.observeMutations!==!1&&typeof MutationObserver<"u"&&(O=new MutationObserver(()=>i()),O.observe(o,{childList:!0,subtree:!0,characterData:!0}))},f=()=>{F?.disconnect(),O?.disconnect(),F=null,O=null},d=o=>{o.addEventListener("scroll",z),o.addEventListener("wheel",H,{passive:!1}),o.addEventListener("pointerdown",A),o.addEventListener("pointermove",s),o.addEventListener("pointerup",r),o.addEventListener("pointercancel",c),o.addEventListener("lostpointercapture",c),o.addEventListener("click",t,!0),n(o),i()},u=o=>{o.removeEventListener("scroll",z),o.removeEventListener("wheel",H),o.removeEventListener("pointerdown",A),o.removeEventListener("pointermove",s),o.removeEventListener("pointerup",r),o.removeEventListener("pointercancel",c),o.removeEventListener("lostpointercapture",c),o.removeEventListener("click",t,!0),f()};return e.watch($,(o,a)=>{a&&u(a),o?d(o):D()}),e.onMounted(()=>{i()}),e.onBeforeUnmount(()=>{q(),$.value&&u($.value),L=!1,M()}),{canScrollLeft:e.computed(()=>R.value),canScrollRight:e.computed(()=>T.value),containerRef:$,isDragging:b,isScrollable:E,refresh:i,scrollNext:V,scrollPrev:_,showLeftShadow:R,showRightShadow:T}}const fe={class:"flex items-start justify-between gap-3"},ge={class:"text-sm font-medium"},ve={key:0,class:"mt-1 text-xs text-muted-foreground"},he={class:"grid gap-4 @md/quick-adder:grid-cols-2 @2xl/quick-adder:grid-cols-3 @4xl/quick-adder:grid-cols-4"},_e={class:"grid gap-2"},ke={key:0,class:"grid gap-2"},Ne={key:1,class:"grid gap-2"},xe={key:2,class:"grid gap-2"},Ve={class:"grid gap-2"},be={key:0,class:"rounded-md border border-dashed bg-muted/20 px-4 py-4 text-sm text-muted-foreground"},ye={key:1,class:"relative flex items-center gap-2 overflow-hidden"},Ce={class:"relative min-w-0 flex-1 overflow-hidden"},we={key:0,class:"pointer-events-none absolute inset-y-0 left-0 z-10 w-10 md:w-20 bg-gradient-to-r from-background via-background/95 to-transparent"},Se={key:1,class:"pointer-events-none absolute inset-y-0 right-0 z-10 w-10 md:w-20 bg-gradient-to-l from-background via-background/95 to-transparent"},Ee={key:0,class:"absolute -top-1 -right-1 flex items-center justify-center bg-primary rounded-full text-background size-4"},Te={class:"flex flex-wrap gap-2"},Be=["onClick"],De={key:0},$e={key:1},Re={key:2},Ie=e.defineComponent({__name:"QuickReservationAdder",props:{agendaData:{},surface:{default:"card"}},emits:["add"],setup(C,{emit:$}){const b=C,E=$,R=new G.$fb18d541ea1ad717$export$ad991b66133851cf("en-US",{dateStyle:"long"}),T=G.$14e0f24ef4ac5c92$export$d0bdf45af03a6ea3(G.$14e0f24ef4ac5c92$export$aa8b41735afcabd2()),v=e.computed(()=>b.surface==="popover"),B=e.ref(""),y=e.ref(void 0),w=e.ref(""),h=e.ref(""),k=e.ref([]),I=e.ref(1),L=e.computed(()=>b.agendaData?.resources?.find(u=>u.id===w.value)),g=u=>{const[o,a]=u.split(":").map(Number);return o*60+a},F=u=>{const o=Math.floor(u/60),a=u%60;return`${o.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}`},O=()=>{if(!L.value)return[];const u=L.value.interval||60;let o=null,a=null;for(const S of Object.values(L.value.openingHours||{}))for(const m of S){const P=g(m.start),j=g(m.end);(o===null||P<o)&&(o=P),(a===null||j>a)&&(a=j)}if(o===null||a===null)return[];const l=[];for(let S=o;S<a;S+=u)l.push(F(S));return l},q=e.computed(()=>y.value&&w.value&&h.value&&k.value.length>0),D=e.computed(()=>O()),{canScrollLeft:i,canScrollRight:N,containerRef:p,isDragging:_,isScrollable:V,scrollNext:M,scrollPrev:z,showLeftShadow:H,showRightShadow:Q}=pe(),A=u=>k.value.includes(u),s=u=>{if(A(u)){k.value=k.value.filter(o=>o!==u);return}k.value=[...k.value,u].sort((o,a)=>g(o)-g(a))},r=(u,o)=>{y.value=u?e.markRaw(u):void 0,B.value=u?`${u}`:"",o()},c=e.ref(""),t=e.ref(""),n=e.ref([]),f=()=>{E("add",{date:y.value,resourceId:w.value,pricingOptionId:h.value,startTimes:k.value,spots:I.value}),k.value=[],n.value=[],t.value="",c.value=""},d=()=>{B.value=T.toString(),y.value=T,w.value=b.agendaData?.resources?.[0]?.id||"",h.value=b.agendaData?.pricingOptions?.find(u=>u.isDefault)?.id||b.agendaData?.pricingOptions?.[0]?.id||"",k.value=[],I.value=1,c.value=""};return e.onMounted(()=>{d()}),(u,o)=>{const a=e.resolveComponent("Label"),l=e.resolveComponent("Button"),S=e.resolveComponent("PopoverTrigger"),m=e.resolveComponent("Calendar"),P=e.resolveComponent("PopoverContent"),j=e.resolveComponent("Popover"),Y=e.resolveComponent("DynamicSelectOption"),X=e.resolveComponent("DynamicSelect"),oe=e.resolveComponent("Input");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(J.classNames)("@container/quick-adder grid gap-4 overflow-hidden bg-background",e.unref(v)?"p-5 sm:p-6":"rounded-md border p-4"))},[e.createElementVNode("div",fe,[e.createElementVNode("div",null,[e.createElementVNode("h3",ge,e.toDisplayString(e.unref(v)?"Quick add reservations":"Add reservations"),1),e.unref(v)?(e.openBlock(),e.createElementBlock("p",ve," Choose one date and add multiple timeslots in one pass. ")):e.createCommentVNode("",!0)])]),e.createElementVNode("div",he,[e.createElementVNode("div",_e,[e.createVNode(a,null,{default:e.withCtx(()=>[...o[3]||(o[3]=[e.createTextVNode("Date",-1)])]),_:1}),e.createVNode(j,null,{default:e.withCtx(({close:x})=>[e.createVNode(S,{"as-child":""},{default:e.withCtx(()=>[e.createVNode(l,{type:"button",variant:"outline",class:e.normalizeClass(e.unref(J.classNames)("w-full justify-start text-left font-normal",!e.unref(y)&&"text-muted-foreground"))},{default:e.withCtx(()=>[e.createVNode(e.unref(U.CalendarIcon)),e.createTextVNode(" "+e.toDisplayString(e.unref(y)?e.unref(R).format(e.unref(y).toDate(e.unref(G.$14e0f24ef4ac5c92$export$aa8b41735afcabd2)())):"Pick a date"),1)]),_:1},8,["class"])]),_:1}),e.createVNode(P,{class:"w-auto p-0",align:"start"},{default:e.withCtx(()=>[e.createVNode(m,{"model-value":e.unref(y),"default-placeholder":e.unref(T),layout:"month-and-year","initial-focus":"","onUpdate:modelValue":W=>r(W,x),minValue:e.unref(G.$14e0f24ef4ac5c92$export$d0bdf45af03a6ea3)(e.unref(G.$14e0f24ef4ac5c92$export$aa8b41735afcabd2)())},null,8,["model-value","default-placeholder","onUpdate:modelValue","minValue"])]),_:2},1024)]),_:1})]),C.agendaData.resources?.length>1?(e.openBlock(),e.createElementBlock("div",ke,[e.createVNode(a,null,{default:e.withCtx(()=>[...o[4]||(o[4]=[e.createTextVNode("Resource",-1)])]),_:1}),e.createVNode(X,{modelValue:e.unref(w),"onUpdate:modelValue":o[0]||(o[0]=x=>e.isRef(w)?w.value=x:null),"wrapper-class":"w-full",class:"w-full",placeholder:"Select resource"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.agendaData.resources||[],x=>(e.openBlock(),e.createBlock(Y,{key:x.id,value:x.id},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(x.name),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"])])):e.createCommentVNode("",!0),C.agendaData.pricingOptions?.length>1?(e.openBlock(),e.createElementBlock("div",Ne,[e.createVNode(a,null,{default:e.withCtx(()=>[...o[5]||(o[5]=[e.createTextVNode("Type",-1)])]),_:1}),e.createVNode(X,{modelValue:e.unref(h),"onUpdate:modelValue":o[1]||(o[1]=x=>e.isRef(h)?h.value=x:null),"wrapper-class":"w-full",class:"w-full",placeholder:"Select type"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.agendaData.pricingOptions||[],x=>(e.openBlock(),e.createBlock(Y,{key:x.id,value:x.id},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(x.name)+" ("+e.toDisplayString(x.duration)+"min) ",1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"])])):e.createCommentVNode("",!0),C.agendaData?.maxTicketsPerReservation>1?(e.openBlock(),e.createElementBlock("div",xe,[e.createVNode(a,null,{default:e.withCtx(()=>[...o[6]||(o[6]=[e.createTextVNode("Spots/tickets",-1)])]),_:1}),e.createVNode(oe,{modelValue:e.unref(I),"onUpdate:modelValue":o[2]||(o[2]=x=>e.isRef(I)?I.value=x:null),modelModifiers:{number:!0},type:"number",min:"1",class:"no-spinner",autocomplete:"off"},null,8,["modelValue"])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ve,[e.createVNode(a,null,{default:e.withCtx(()=>[...o[7]||(o[7]=[e.createTextVNode("Available hours",-1)])]),_:1}),e.unref(D).length===0?(e.openBlock(),e.createElementBlock("div",be," No preset hours are available for this resource. You can still add a custom time below. ")):(e.openBlock(),e.createElementBlock("div",ye,[e.unref(i)?(e.openBlock(),e.createBlock(l,{key:0,type:"button",size:"icon",variant:"outline",class:"hidden absolute size-8 shrink-0 rounded-full shadow-sm md:inline-flex z-[11] left-0.5",onClick:e.unref(z)},{default:e.withCtx(()=>[e.createVNode(e.unref(U.ChevronLeft),{class:"size-4"})]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.createElementVNode("div",Ce,[e.unref(H)?(e.openBlock(),e.createElementBlock("div",we)):e.createCommentVNode("",!0),e.unref(Q)?(e.openBlock(),e.createElementBlock("div",Se)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"hourScrollContainer",ref:p,class:e.normalizeClass(e.unref(J.classNames)("hour-scroll-track flex w-full min-w-0 gap-2 overflow-x-auto overscroll-contain py-2",e.unref(V)&&!e.unref(_)&&"cursor-grab",e.unref(_)&&"cursor-grabbing select-none"))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(D),x=>(e.openBlock(),e.createBlock(l,{key:x,type:"button",variant:"outline",class:e.normalizeClass(["relative h-12 shrink-0",A(x)?"border-primary!":""]),onClick:W=>s(x)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(x)+" ",1),A(x)?(e.openBlock(),e.createElementBlock("div",Ee,[e.createVNode(e.unref(U.Check),{class:"size-3"})])):e.createCommentVNode("",!0)]),_:2},1032,["class","onClick"]))),128))],2)]),e.unref(N)?(e.openBlock(),e.createBlock(l,{key:1,type:"button",size:"icon",variant:"outline",class:"hidden absolute size-8 shrink-0 rounded-full shadow-sm md:inline-flex z-[11] right-0.5",onClick:e.unref(M)},{default:e.withCtx(()=>[e.createVNode(e.unref(U.ChevronRight),{class:"size-4"})]),_:1},8,["onClick"])):e.createCommentVNode("",!0)])),e.createElementVNode("div",Te,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(n),x=>(e.openBlock(),e.createElementBlock("div",{key:x,class:"relative"},[e.createVNode(l,{type:"button",variant:"outline",class:"h-12 px-4 py-2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(x),1)]),_:2},1024),e.createElementVNode("div",{class:"absolute -top-1 -right-1 flex items-center justify-center bg-red-500 rounded-full text-white size-4 cursor-pointer",onClick:W=>{n.value=e.unref(n).filter(Z=>Z!==x),k.value=e.unref(k).filter(Z=>Z!==x)}},[e.createVNode(e.unref(U.X),{class:"size-3"})],8,Be)]))),128))])]),e.createElementVNode("div",null,[e.createVNode(l,{disabled:!e.unref(q),onClick:f},{default:e.withCtx(()=>[e.unref(k).length===0?(e.openBlock(),e.createElementBlock("span",De,"Select at least one timeslot")):e.unref(k).length===1?(e.openBlock(),e.createElementBlock("span",$e,"Add 1 reservation")):(e.openBlock(),e.createElementBlock("span",Re,"Add "+e.toDisplayString(e.unref(k).length)+" reservations",1))]),_:1},8,["disabled"])])],2)}}}),Le=te._export_sfc(Ie,[["__scopeId","data-v-c7529556"]]),Fe={class:"space-y-3"},Oe={class:"flex flex-wrap items-center justify-between gap-3"},Pe={class:"text-xs text-muted-foreground"},Me={class:"flex flex-wrap items-center gap-2"},Ue={key:0,class:"rounded-md border border-dashed bg-muted/20 px-4 py-6 text-sm text-muted-foreground"},ze={key:1,class:"space-y-3"},Ae={class:"flex items-start gap-2 p-3 md:hidden"},qe=["aria-expanded","onClick"],je={class:"mt-0.5 flex size-10 shrink-0 items-center justify-center rounded-full bg-muted text-sm font-semibold text-muted-foreground"},He={class:"min-w-0 flex-1"},Qe={class:"flex items-start justify-between gap-3"},Ye={class:"min-w-0"},Ge={class:"block truncate text-base font-semibold"},Xe={class:"mt-1 block truncate text-xs text-muted-foreground"},We={class:"mt-1 block truncate text-xs text-muted-foreground"},Ze={class:"flex size-10 shrink-0 items-center justify-center rounded-xl border border-border/70 text-muted-foreground"},Ke={class:"mt-3 flex flex-wrap items-center gap-x-4 gap-y-1 text-sm text-muted-foreground"},Je={class:"inline-flex items-center gap-1.5"},et={class:"inline-flex items-center gap-1.5"},tt={class:"hidden items-start justify-between gap-3 p-4 pb-0 md:flex"},ot={class:"text-sm font-medium"},nt={class:"text-xs text-muted-foreground"},at={class:"grid gap-4 border-t pt-3 md:grid-cols-2 md:border-0 md:pt-4 xl:grid-cols-5"},rt={class:"grid gap-2"},st={key:0,class:"text-xs text-orange-500"},lt={class:"grid gap-2"},it={class:"grid gap-2"},ct={class:"grid gap-2"},dt={key:0,class:"grid gap-2"},ut=e.defineComponent({__name:"ReservationLines",props:{modelValue:{},agendaData:{}},emits:["add","quick-add","update:modelValue"],setup(C,{emit:$}){const b=C,E=$,R=e.computed(()=>b.modelValue??[]),T=e.computed(()=>Number(b.agendaData?.maxTicketsPerReservation)>1),v=e.ref(null),B=e.ref(!1),y=e.computed(()=>String(b.agendaData?.currency||"EUR").toUpperCase()),w=e.computed(()=>{try{return new Intl.NumberFormat("en-US",{style:"currency",currency:y.value,minimumFractionDigits:2,maximumFractionDigits:2})}catch{return new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}}),h=s=>{E("update:modelValue",s)},k=(s,r,c)=>{h(R.value.map(t=>t.id!==s?t:r==="date"?{...t,date:String(c??""),dateValue:c||void 0}:{...t,[r]:c}))},I=(s,r)=>{const c=Number(r);k(s,"paid",Number.isFinite(c)?c:0)},L=(s,r)=>{const c=Number(r);k(s,"spots",Number.isFinite(c)&&c>0?c:1)},g=s=>{h(R.value.filter(r=>r.id!==s))},F=s=>{E("quick-add",s),B.value=!1},O=s=>b.agendaData?.pricingOptions?.find(r=>r.id===s.pricingOption),q=s=>{const r=O(s);return r?r.duration?`${r.name} (${r.duration}min)`:r.name:"Reservation"},D=s=>b.agendaData?.resources?.find(r=>r.id===s.resourceId),i=s=>D(s)?.name||"Unknown resource",N=s=>{if(!s.startTime)return"";const r=Number(O(s)?.duration);if(!Number.isFinite(r)||r<=0)return"";const[c,t]=s.startTime.split(":").map(Number);if(!Number.isFinite(c)||!Number.isFinite(t))return"";const n=c*60+t+r,f=Math.floor(n/60)%24,d=n%60;return`${f.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}`},p=s=>{if(!s.startTime)return"Select time";const r=N(s);return r?`${s.startTime} - ${r}`:s.startTime},_=s=>{const r=Number(s);if(!Number.isFinite(r))return y.value==="EUR"?"€0.00":"0.00";try{return w.value.format(r)}catch{return`${r.toFixed(2)}`}},V=s=>{const r=Number(s.spots),c=Number.isFinite(r)&&r>0?r:1;return c===1?"1 spot":`${c} spots`},M=s=>{if(!/^\d{4}-\d{2}-\d{2}$/.test(s))return null;const[r,c,t]=s.split("-").map(Number),n=new Date(r,c-1,t);return Number.isNaN(n.getTime())||n.getFullYear()!==r||n.getMonth()!==c-1||n.getDate()!==t?null:(n.setHours(0,0,0,0),n)},z=s=>{const r=M(String(s.date||"").trim());if(!r)return"";const c=new Date;if(c.setHours(0,0,0,0),r<c)return"This date is in the past. Double-check it before saving.";const t=new Date(c);return t.setFullYear(t.getFullYear()+1),r>t?"This date is more than a year ahead. Double-check it before saving.":""},H=s=>!s.date||!s.startTime||!s.resourceId||!s.pricingOption,Q=s=>v.value===s,A=s=>{v.value=v.value===s?null:s};return e.watch(R,s=>{const r=new Set(s.map(c=>c.id));if(v.value&&!r.has(v.value)&&(v.value=null),!v.value){const c=s.find(H);c&&(v.value=c.id)}},{immediate:!0}),(s,r)=>{const c=e.resolveComponent("Button"),t=e.resolveComponent("PopoverTrigger"),n=e.resolveComponent("PopoverContent"),f=e.resolveComponent("Popover"),d=e.resolveComponent("Label"),u=e.resolveComponent("Input"),o=e.resolveComponent("DynamicSelectOption"),a=e.resolveComponent("DynamicSelect");return e.openBlock(),e.createElementBlock("div",Fe,[e.createElementVNode("div",Oe,[e.createElementVNode("p",Pe,e.toDisplayString(R.value.length===1?"1 reservation line":`${R.value.length} reservation lines`),1),e.createElementVNode("div",Me,[e.createVNode(f,{open:B.value,"onUpdate:open":r[0]||(r[0]=l=>B.value=l)},{default:e.withCtx(()=>[e.createVNode(t,{"as-child":""},{default:e.withCtx(()=>[e.createVNode(c,{type:"button",variant:"outline",size:"sm",class:"gap-2"},{default:e.withCtx(()=>[e.createVNode(e.unref(U.Zap),{class:"size-4 text-primary"}),r[2]||(r[2]=e.createTextVNode(" Quick add ",-1))]),_:1})]),_:1}),e.createVNode(n,{align:"end",class:"max-h-[80vh] w-[min(34rem,calc(100vw-2rem))] overflow-y-auto p-0"},{default:e.withCtx(()=>[B.value?(e.openBlock(),e.createBlock(Le,{key:0,surface:"popover",agendaData:C.agendaData,onAdd:F},null,8,["agendaData"])):e.createCommentVNode("",!0)]),_:1})]),_:1},8,["open"]),e.createVNode(c,{type:"button",variant:"outline",size:"sm",onClick:r[1]||(r[1]=l=>E("add"))},{default:e.withCtx(()=>[e.createVNode(e.unref(U.Plus),{class:"size-4"}),r[3]||(r[3]=e.createTextVNode(" Add line ",-1))]),_:1})])]),R.value.length===0?(e.openBlock(),e.createElementBlock("div",Ue," Use Quick add to create filled reservation lines, or add an empty line manually. ")):(e.openBlock(),e.createElementBlock("div",ze,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.value,(l,S)=>(e.openBlock(),e.createElementBlock("div",{key:l.id,class:"rounded-xl border bg-background"},[e.createElementVNode("div",Ae,[e.createElementVNode("button",{type:"button",class:"flex min-w-0 flex-1 items-start gap-3 rounded-lg px-1 py-1 text-left outline-none transition-colors hover:bg-muted/40 focus-visible:ring-2 focus-visible:ring-ring/50","aria-expanded":Q(l.id),onClick:m=>A(l.id)},[e.createElementVNode("span",je,e.toDisplayString(S+1),1),e.createElementVNode("span",He,[e.createElementVNode("span",Qe,[e.createElementVNode("span",Ye,[e.createElementVNode("span",Ge,e.toDisplayString(p(l)),1),e.createElementVNode("span",Xe,e.toDisplayString(l.date||"No date selected"),1),e.createElementVNode("span",We,e.toDisplayString(i(l))+" · "+e.toDisplayString(q(l)),1)]),e.createElementVNode("span",Ze,[e.createVNode(e.unref(U.Pencil),{class:"size-4"})])]),e.createElementVNode("span",Ke,[e.createElementVNode("span",Je,[e.createVNode(e.unref(U.Users),{class:"size-4"}),e.createTextVNode(" "+e.toDisplayString(V(l)),1)]),e.createElementVNode("span",et,[e.createVNode(e.unref(U.Tag),{class:"size-4"}),e.createTextVNode(" "+e.toDisplayString(_(l.paid)),1)])])])],8,qe),e.createVNode(c,{type:"button",variant:"ghost",size:"icon",class:"mt-1 shrink-0",onClick:m=>g(l.id)},{default:e.withCtx(()=>[e.createVNode(e.unref(U.Trash2),{class:"size-4"})]),_:1},8,["onClick"])]),e.createElementVNode("div",tt,[e.createElementVNode("div",null,[e.createElementVNode("p",ot,"Reservation "+e.toDisplayString(S+1),1),e.createElementVNode("p",nt,e.toDisplayString(i(l))+" · "+e.toDisplayString(q(l)),1)]),e.createVNode(c,{type:"button",variant:"ghost",size:"icon",class:"shrink-0",onClick:m=>g(l.id)},{default:e.withCtx(()=>[e.createVNode(e.unref(U.Trash2),{class:"size-4"})]),_:1},8,["onClick"])]),e.createElementVNode("div",{class:e.normalizeClass(["px-3 pb-3 md:px-4 md:pb-4 overflow-hidden",Q(l.id)?"block":"hidden md:block"])},[e.createElementVNode("div",at,[e.createElementVNode("div",rt,[e.createVNode(d,null,{default:e.withCtx(()=>[...r[4]||(r[4]=[e.createTextVNode("Date",-1)])]),_:1}),e.createVNode(u,{"model-value":l.date,type:"date","onUpdate:modelValue":m=>k(l.id,"date",String(m??""))},null,8,["model-value","onUpdate:modelValue"]),z(l)?(e.openBlock(),e.createElementBlock("p",st,e.toDisplayString(z(l)),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",lt,[e.createVNode(d,{for:`new_reservation_res_line_${S}_time`},{default:e.withCtx(()=>[...r[5]||(r[5]=[e.createTextVNode("Time",-1)])]),_:1},8,["for"]),e.createVNode(u,{id:`new_reservation_res_line_${S}_time`,"model-value":l.startTime,type:"time",class:"reservation-time-input","onUpdate:modelValue":m=>k(l.id,"startTime",String(m??""))},null,8,["id","model-value","onUpdate:modelValue"])]),e.createElementVNode("div",it,[e.createVNode(d,null,{default:e.withCtx(()=>[...r[6]||(r[6]=[e.createTextVNode("Resource",-1)])]),_:1}),e.createVNode(a,{"model-value":l.resourceId,"wrapper-class":"w-full",class:"w-full",placeholder:"Select resource","onUpdate:modelValue":m=>k(l.id,"resourceId",String(m??""))},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.agendaData?.resources||[],m=>(e.openBlock(),e.createBlock(o,{key:m.id,value:m.id},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.name),1)]),_:2},1032,["value"]))),128))]),_:1},8,["model-value","onUpdate:modelValue"])]),e.createElementVNode("div",ct,[e.createVNode(d,null,{default:e.withCtx(()=>[...r[7]||(r[7]=[e.createTextVNode("Type",-1)])]),_:1}),e.createVNode(a,{"model-value":l.pricingOption,"wrapper-class":"w-full",class:"w-full",placeholder:"Select type","onUpdate:modelValue":m=>k(l.id,"pricingOption",String(m??""))},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.agendaData?.pricingOptions||[],m=>(e.openBlock(),e.createBlock(o,{key:m.id,value:m.id},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.name),1)]),_:2},1032,["value"]))),128))]),_:1},8,["model-value","onUpdate:modelValue"])]),e.createElementVNode("div",{class:e.normalizeClass(["grid gap-4",T.value?"md:grid-cols-2 xl:grid-cols-2 xl:col-span-1":""])},[T.value?(e.openBlock(),e.createElementBlock("div",dt,[e.createVNode(d,null,{default:e.withCtx(()=>[...r[8]||(r[8]=[e.createTextVNode("Spots",-1)])]),_:1}),e.createVNode(u,{"model-value":l.spots,type:"number",min:"1",class:"no-spinner","onUpdate:modelValue":m=>L(l.id,m)},null,8,["model-value","onUpdate:modelValue"])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["grid gap-2",T.value?"":"md:col-span-2 xl:col-span-1"])},[e.createVNode(d,null,{default:e.withCtx(()=>[...r[9]||(r[9]=[e.createTextVNode("Paid",-1)])]),_:1}),e.createVNode(u,{"model-value":l.paid,type:"number",min:"0",step:"1",class:"no-spinner","onUpdate:modelValue":m=>I(l.id,m)},null,8,["model-value","onUpdate:modelValue"])],2)],2)])],2)]))),128))]))])}}}),mt=te._export_sfc(ut,[["__scopeId","data-v-9b860aae"]]),pt={class:"space-y-5 md:mt-5"},ft={class:"space-y-3"},gt={class:"mt-4 text-red-400"},vt={class:"list-disc pl-4"},ht={key:0},_t={key:1},ee="00:00",kt=e.defineComponent({__name:"NewReservationDialog",props:{agendaData:{}},setup(C){const $=C,{params:b}=K.useModuleRoute(),{config:E}=K.useModule(),{log:R,logError:T}=useLogs(),v=K.useFirebaseIntegration(E.project),B=e.computed(()=>b.value?.id??b.id??""),y=e.inject("agendaData",e.ref({})),w=e.computed(()=>$.agendaData??y.value??{}),h=e.ref(!1),k=e.ref(!1),I=e.ref([]),L=/^([01]\d|2[0-3]):[0-5]\d$/,g=e.ref([]),F=e.ref(null),O=()=>w.value?.resources?.[0]?.id??"",q=()=>w.value?.pricingOptions?.find(t=>t.isDefault===!0)?.id??w.value?.pricingOptions?.[0]?.id??"",D=t=>{let n=t?.pricingOption??q(),f=w.value?.pricingOptions?.find(u=>u.id===n)?.price??0;typeof f=="string"&&(f=Number(f));let d=t?.paid??f;return typeof d=="string"&&(d=Number(d)),{id:`reservation_${Date.now()}_${Math.random().toString(36).substring(2,9)}`,spots:Number(t?.spots)||1,paid:Number.isFinite(d)?d:0,resourceId:t?.resourceId??O(),pricingOption:n,date:t?.date??"",dateValue:t?.dateValue,startTime:t?.startTime??ee}},i=()=>{g.value=[D()]},N=t=>!t.date&&t.startTime===ee,p=()=>{const t=g.value[g.value.length-1];g.value=[...g.value,D(t?{...t}:void 0)]},_=t=>w.value?.pricingOptions?.find(n=>n.id===t.pricingOption),V=t=>w.value?.resources?.find(n=>n.id===t.resourceId),M=()=>{const t=Number(w.value?.maxTicketsPerReservation);return Number.isFinite(t)&&t>0?t:null},z=t=>`Reservation ${t+1}`,H=t=>{const n=String(t.date||"").trim(),f=String(t.startTime||"").trim(),d=String(t.resourceId||"").trim();return!n||!f||!d?"":`${d}_${n}_${f}`},Q=()=>{const t=[],n=new Map,f=M();return g.value.forEach((d,u)=>{const o=z(u),a=String(d.date||"").trim(),l=String(d.startTime||"").trim(),S=String(d.resourceId||"").trim(),m=String(d.pricingOption||"").trim(),P=Number(d.spots),j=Number(d.paid);a||t.push(`${o}: please select a date.`),l?L.test(l)||t.push(`${o}: please enter a valid time.`):t.push(`${o}: please select a time.`),S?V(d)||t.push(`${o}: the selected resource is no longer available.`):t.push(`${o}: please select a resource.`),m?_(d)||t.push(`${o}: the selected type is no longer available.`):t.push(`${o}: please select a type.`),!Number.isFinite(P)||P<=0?t.push(`${o}: spots must be at least 1.`):f!==null&&P>f&&t.push(`${o}: spots cannot be more than ${f}.`),(!Number.isFinite(j)||j<0)&&t.push(`${o}: paid amount must be 0 or higher.`);const Y=H(d);if(Y){const X=n.get(Y);X!==void 0?t.push(`${o}: duplicate of ${z(X).toLowerCase()}.`):n.set(Y,u)}}),t},A=t=>{const n=t.startTimes.map(f=>D({date:t.date?`${t.date}`:"",dateValue:t.date,pricingOption:t.pricingOptionId,resourceId:t.resourceId,spots:t.spots,startTime:f}));if(n.length!==0){if(g.value.length===1&&N(g.value[0])){g.value=n;return}g.value=[...g.value,...n]}},s=t=>{if(!t.startTime||!t.pricingOption)return"";const n=_(t);if(!n?.duration)return t.startTime;const[f,d]=t.startTime.split(":").map(Number);if(isNaN(f)||isNaN(d))return"";const u=f*60+d+n.duration,o=Math.floor(u/60)%24,a=u%60;return`${o.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}`};e.watch(h,async t=>{t&&(I.value=[],i(),await e.nextTick(),F.value?.reset())});const r=()=>{const t=[];I.value=[];const n=F.value,f=n?n.validateForm():!1;return n||t.push("Customer information form is unavailable."),g.value.length===0&&t.push("Please add at least one reservation."),t.push(...Q()),I.value=t,t.length===0&&f},c=async()=>{const t=F.value;if(!t||!r())return;let n=!1;try{k.value=!0;const f=t.getCustomerInfo(),d=g.value.map(a=>{const l=Number(a.paid)||0,S=Number(a.spots)||1,m=_(a),P=V(a),j=a.date;return{paidAmount:l,flattenedReservationDate:`${a.resourceId}_${j}`,flattenedReservation:`${a.resourceId}_${j}_${a.startTime.replace(":","")}`,reservation:{status:"approved",totalPrice:Number(l.toFixed(2)),basePrice:Number((l/S).toFixed(2)),addOnsPrice:0,addOns:[],date:j,id:`res_${Date.now()}_${Math.random().toString(36).substring(2,9)}`,pricingOption:{duration:m?.duration||"",id:m?.id||"",name:m?.name||"",price:m?.price||""},pricingOptionId:a.pricingOption,resource:{avatarLabel:P?.avatarLabel||"",color:P?.color||"",description:P?.description||"",id:P?.id||"",name:P?.name||""},resourceId:a.resourceId,spots:S,timeslot:{startTime:a.startTime,endTime:s(a)}}}}),u=Number(d.reduce((a,l)=>a+l.paidAmount,0).toFixed(2)),o={agendaId:B.value,customerInfo:f,metadata:{},amountPaid:u,amountDue:0,subtotal:u,total:u,createdAt:new Date,updatedAt:new Date,discount:0,flattenedReservationDates:Array.from(new Set(d.map(a=>a.flattenedReservationDate))),flattenedReservations:d.map(a=>a.flattenedReservation),paymentStatus:"paid",paymentType:"full",reservations:d.map(a=>a.reservation),status:"confirmed"};await v.add(E.reservationsCollection,o),n=!0,R(`${d.length} ${d.length>1?"reservations":"reservation"} created in Studio`,{agendaId:B.value,reservationIds:d.map(a=>a.reservation.id),amountPaid:u,reservations:d.map(a=>`${a.reservation.resource.name}: ${a.reservation.date} ${a.reservation.timeslot.startTime}`)})}catch(f){T("Failed to create reservation in Studio",{error:f instanceof Error?f.message:String(f),agendaId:B.value}),console.error("Error creating reservation:",f)}finally{k.value=!1,n&&(h.value=!1)}};return(t,n)=>{const f=e.resolveComponent("Button"),d=e.resolveComponent("ResponsiveModalTrigger"),u=e.resolveComponent("ResponsiveModalTitle"),o=e.resolveComponent("ResponsiveModalHeader"),a=e.resolveComponent("ResponsiveModalFooter"),l=e.resolveComponent("ResponsiveModalScrollContent"),S=e.resolveComponent("ResponsiveModal");return e.openBlock(),e.createBlock(S,{open:h.value,"onUpdate:open":n[1]||(n[1]=m=>h.value=m)},{default:e.withCtx(()=>[e.createVNode(d,{"as-child":""},{default:e.withCtx(()=>[e.createVNode(f,null,{default:e.withCtx(()=>[e.createVNode(e.unref(U.Plus),{class:"size-4"}),n[2]||(n[2]=e.createTextVNode(" Add Reservation ",-1))]),_:1})]),_:1}),e.createVNode(l,{class:"@container/modal sm:max-w-7xl"},{default:e.withCtx(()=>[e.createVNode(o,null,{default:e.withCtx(()=>[e.createVNode(u,null,{default:e.withCtx(()=>[...n[3]||(n[3]=[e.createTextVNode("Create new reservation",-1)])]),_:1})]),_:1}),e.createElementVNode("div",pt,[e.createVNode(me,{ref_key:"customerInformationRef",ref:F,agendaData:w.value},null,8,["agendaData"]),n[5]||(n[5]=e.createElementVNode("div",{class:"w-full h-[1px] bg-border my-8"},null,-1)),e.createElementVNode("div",ft,[n[4]||(n[4]=e.createElementVNode("div",{class:"flex items-center justify-between gap-3"},[e.createElementVNode("h2",{class:"text-sm font-medium"},"Reservations")],-1)),e.createVNode(mt,{modelValue:g.value,"onUpdate:modelValue":n[0]||(n[0]=m=>g.value=m),agendaData:w.value,onAdd:p,onQuickAdd:A},null,8,["modelValue","agendaData"])]),e.createElementVNode("div",gt,[e.createElementVNode("ul",vt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.value,m=>(e.openBlock(),e.createElementBlock("li",{key:m},e.toDisplayString(m),1))),128))])])]),e.createVNode(a,{class:"gap-2"},{default:e.withCtx(()=>[e.createVNode(f,{onClick:c,disabled:k.value},{default:e.withCtx(()=>[k.value?(e.openBlock(),e.createElementBlock("span",ht,"Creating...")):(e.openBlock(),e.createElementBlock("span",_t,e.toDisplayString(g.value.length>1?`Create ${g.value.length} reservations`:"Create reservation"),1))]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["open"])}}});exports._sfc_main=kt;