@oneclick.dev/cms-core-modules 0.0.110 → 0.0.111
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Acquisition-Dt2rREU8.js → Acquisition-DgzDQH51.js} +1 -1
- package/dist/{Acquisition-DNCy8nQz.mjs → Acquisition-FV3QpaUX.mjs} +2 -2
- package/dist/{Audience-Bs7b0TNm.js → Audience-BSgNvcVb.js} +1 -1
- package/dist/{Audience-CUeMVYRy.mjs → Audience-ka0b7YPE.mjs} +2 -2
- package/dist/{ContentEditor-D9-1SJ5F.mjs → ContentEditor-pZPfo0qN.mjs} +4384 -4282
- package/dist/{ContentEditor-BprPiHMJ.js → ContentEditor-tYkh4vRV.js} +42 -42
- package/dist/{Create-89z41K73.js → Create--MOBOTA-.js} +1 -1
- package/dist/{Create-BCklc_T1.mjs → Create-BXNLRQag.mjs} +1 -1
- package/dist/DateFormatter-CSAbE3BC.js +1 -0
- package/dist/{DateFormatter-DUxlo8X8.mjs → DateFormatter-qbhRYxI_.mjs} +226 -222
- package/dist/{Detail-CNlljBfH.mjs → Detail-ChD5XurA.mjs} +1 -1
- package/dist/{Detail-C857g62L.js → Detail-RISEJJab.js} +1 -1
- package/dist/{Find-DIISO5GO.mjs → Find-zN_dKz4p.mjs} +1 -1
- package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-Baqy-rTT.js +1 -0
- package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-Dx4Bpa2m.mjs +1263 -0
- package/dist/{Overview-Di84CsR5.mjs → Overview-98nkJUWN.mjs} +162 -157
- package/dist/{Overview-C-Jb_BxY.mjs → Overview-BR_y8x3W.mjs} +1 -1
- package/dist/{Overview-DC9io1bk.js → Overview-CX-n6W7d.js} +1 -1
- package/dist/Overview-Dl8cMlsr.js +1 -0
- package/dist/{Overview-BKAti8nc.mjs → Overview-MpgkLB6m.mjs} +36 -36
- package/dist/{SeoHealth-az1YuNF2.js → SeoHealth-C5npw7mE.js} +1 -1
- package/dist/{SeoHealth-MC3lSCOY.mjs → SeoHealth-bVQj_Xgm.mjs} +29 -29
- package/dist/{TableView-DXHhJ-jm.mjs → TableView-Bf1fdJrD.mjs} +1838 -1822
- package/dist/TableView-DNcXyIMu.js +4 -0
- package/dist/{agenda-IOqtALWf.js → agenda-BaJu3-1c.js} +1 -1
- package/dist/{agenda-DcatSSYQ.mjs → agenda-BwVY_8oM.mjs} +3 -3
- package/dist/cms-core-modules.css +1 -1
- package/dist/{exceptions-CI0B4xVj.js → exceptions-B6P9UiCj.js} +1 -1
- package/dist/{exceptions-YCQkHa6a.mjs → exceptions-De9-FvdP.mjs} +67 -67
- package/dist/{index-CpzDEMeC.mjs → index-B8GvmAwh.mjs} +438 -478
- package/dist/{index-wjkEPsNx.mjs → index-BIF2RB7k.mjs} +1212 -1316
- package/dist/index-ByRsp77L.js +70 -0
- package/dist/{index-BhWvXMOp.mjs → index-CFzn2Lus.mjs} +5 -9
- package/dist/{index-BFLV54kw.mjs → index-CkVwMqpn.mjs} +1114 -1100
- package/dist/index-DL6orwdK.js +35 -0
- package/dist/index-DUlYrnXH.js +58 -0
- package/dist/index-DZV720u-.mjs +439 -0
- package/dist/index-D_nfGegA.js +184 -0
- package/dist/index-DtSvAFLL.js +54 -0
- package/dist/{index-D30apIn-.mjs → index-L54VBzwJ.mjs} +2 -3
- package/dist/{index-BzWmWCo5.mjs → index-hH3e-IYz.mjs} +267 -267
- package/dist/index.cjs.js +1 -1
- package/dist/index.mjs +15 -15
- package/dist/math-BJ-oX_IM.mjs +80 -0
- package/dist/math-emotyaF6.js +1 -0
- package/dist/{resources-CYOb5Bl6.mjs → resources-DwYxn2Vi.mjs} +1 -1
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/ScopedSelectAll.d.ts +1 -2
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/helpers/useFocus.d.ts +1 -0
- package/package.json +2 -2
- package/dist/DateFormatter-CYAD4GBN.js +0 -1
- package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-Ceoje52V.js +0 -1
- package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-Dh9jzvE0.mjs +0 -1255
- package/dist/Overview-UoZHUMUz.js +0 -1
- package/dist/TableView-DQW0A1oG.js +0 -4
- package/dist/array-CbATeQbk.js +0 -1
- package/dist/array-DT5pE8Gm.mjs +0 -108
- package/dist/index-A2kp8Isi.js +0 -75
- package/dist/index-B5aBwdxY.js +0 -54
- package/dist/index-BiT55eU0.js +0 -58
- package/dist/index-G7cIlnGN.js +0 -158
- package/dist/index-V78huaSJ.mjs +0 -442
- package/dist/index-vHmvbEwa.js +0 -35
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),G=require("@oneclick.dev/cms-kit"),le=require("./EditLayout.vue_vue_type_script_setup_true_lang-kpjbVSXg.js"),C=require("./index-DtSvAFLL.js"),Q=require("@oneclick.dev/cms-kit/charts"),F=require("lucide-vue-next"),ie=require("./index-CxETuRsG.js"),M=require("./index-D_nfGegA.js"),ce=require("./_plugin-vue_export-helper-BHFhmbuH.js"),ee=require("./ReservationDetailDialog.vue_vue_type_script_setup_true_lang-CuwREvXD.js"),de=require("./OrderDetailDialog.vue_vue_type_script_setup_true_lang-COrK1j0S.js"),ue=require("./NewReservationDialog.vue_vue_type_script_setup_true_lang-Baqy-rTT.js");function me({x:p,y:f,w:o,h:v,tl:g=!1,tr:h=!1,bl:x=!1,br:i=!1,r=0}){let l;l=`M${p+r},${f}h${o-2*r}`;let n=h?r:0,c=h?0:r;return l+=`a${n},${n} 0 0 1 ${n},${n}`,l+=`h${c}v${c}`,l+=`v${v-2*r}`,n=i?r:0,c=i?0:r,l+=`a${n},${n} 0 0 1 ${-n},${n}`,l+=`v${c}h${-c}`,l+=`h${2*r-o}`,n=x?r:0,c=x?0:r,l+=`a${n},${n} 0 0 1 ${-n},${-n}`,l+=`h${-c}v${-c}`,l+=`v${2*r-v}`,n=g?r:0,c=g?0:r,l+=`a${n},${n} 0 0 1 ${n},${-n}`,l+=`v${-c}h${c}`,l+="z",l}const pe=Object.assign(Object.assign({},M.XYComponentDefaultConfig),{color:void 0,groupMaxWidth:void 0,groupWidth:void 0,dataStep:void 0,groupPadding:.05,barPadding:0,roundedCorners:2,barMinHeight:2,cursor:null,orientation:M.Orientation.Vertical}),ae=C.css`
|
|
2
|
+
label: grouped-bar-component;
|
|
3
|
+
`,fe=C.injectGlobal`
|
|
4
|
+
:root {
|
|
5
|
+
--vis-grouped-bar-cursor: default;
|
|
6
|
+
--vis-grouped-bar-fill-color: var(--vis-color-main);
|
|
7
|
+
--vis-grouped-bar-stroke-color: none;
|
|
8
|
+
--vis-grouped-bar-stroke-width: 0px;
|
|
9
|
+
--vis-grouped-bar-hover-stroke-width: 1px;
|
|
10
|
+
--vis-grouped-bar-hover-stroke-color: none;
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
/* Dark Theme */
|
|
14
|
+
--vis-dark-grouped-bar-stroke-color: none;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
body.theme-dark ${`.${ae}`} {
|
|
18
|
+
--vis-grouped-bar-stroke-color: var(--vis-dark-grouped-bar-stroke-color);
|
|
19
|
+
}
|
|
20
|
+
`,Z=C.css`
|
|
21
|
+
label: bar;
|
|
22
|
+
fill: var(--vis-grouped-bar-fill-color);
|
|
23
|
+
stroke: var(--vis-grouped-bar-stroke-color);
|
|
24
|
+
stroke-width: var(--vis-grouped-bar-stroke-width);
|
|
25
|
+
cursor: var(--vis-grouped-bar-cursor);
|
|
26
|
+
|
|
27
|
+
&:hover {
|
|
28
|
+
stroke-width: var(--vis-grouped-bar-hover-stroke-width);
|
|
29
|
+
stroke: var(--vis-grouped-bar-hover-stroke-color);
|
|
30
|
+
}
|
|
31
|
+
`,te=C.css`
|
|
32
|
+
label: barGroup;
|
|
33
|
+
`,re=C.css`
|
|
34
|
+
label: barGroupExit;
|
|
35
|
+
`,ve=Object.freeze(Object.defineProperty({__proto__:null,bar:Z,barGroup:te,barGroupExit:re,globalStyles:fe,root:ae},Symbol.toStringTag,{value:"Module"}));class se extends M.XYComponentCore{constructor(f){super(),this._defaultConfig=pe,this.config=this._defaultConfig,this.getAccessors=()=>C.isArray(this.config.y)?this.config.y:[this.config.y],this.events={},this._barData=[],f&&this.setConfig(f)}get bleed(){if(this._barData=this._getVisibleData(),this._barData.length===0)return{top:0,bottom:0,left:0,right:0};const f=!this.isVertical()&&this.dataScale.range()[0]>this.dataScale.range()[1],o=this.dataScale.domain(),v=this._getGroupWidth()/2,g=this._barData.map((k,S)=>C.getNumber(k,this.config.x,S)),h=C.min(g),x=C.max(g),i=this.dataScale(h),r=this.dataScale(x),l=this.dataScale.invert(i+(f?v:-v)),n=this.dataScale.invert(r+(f?-v:v)),c=l<=o[0]?this.dataScale(o[0])-this.dataScale(l):0,N=n>o[1]?this.dataScale(n)-this.dataScale(o[1]):0;return{top:this.isVertical()?0:f?-N:c,bottom:this.isVertical()?0:f?-c:N,left:this.isVertical()?c:0,right:this.isVertical()?N:0}}get dataScale(){return this.isVertical()?this.xScale:this.yScale}get valueScale(){return this.isVertical()?this.yScale:this.xScale}isVertical(){return this.config.orientation===M.Orientation.Vertical}_render(f){const{config:o}=this,v=C.isNumber(f)?f:o.duration,g=this._getGroupWidth(),h=this.getAccessors(),x=[-g/2,g/2],i=M.band().domain(M.range(h.length)).range(x).paddingInner(o.barPadding).paddingOuter(o.barPadding),r=this.g.selectAll(`.${te}`).data(this._barData,(B,$)=>{var _;return`${(_=C.getString(B,o.id,$))!==null&&_!==void 0?_:$}`}),l=(B,$)=>{const _=this.dataScale(C.getNumber(B,o.x,$)),P=this.isVertical()?_:0,I=this.isVertical()?0:_;return`translate(${P},${I})`},c=r.enter().append("g").attr("class",te).attr("transform",l).style("opacity",1).merge(r);C.smartTransition(c,v).attr("transform",l).style("opacity",1);const N=r.exit().attr("class",re);C.smartTransition(N,v).style("opacity",0).remove(),C.smartTransition(N.selectAll(`.${Z}`),v).attr("transform",(B,$,_)=>this.isVertical()?`translate(0,${this.yScale(0)}) scale(1,0)`:`translate(${this.xScale(0)},0) scale(0,1)`);const k=i.bandwidth(),S=c.selectAll(`.${Z}`).data(B=>h.map(()=>B)),w=this._getValueAxisDirection(),X=S.enter().append("path").attr("class",Z).attr("d",(B,$)=>{const _=i($),P=this.valueScale(0),I=k;return this._getBarPath(_,P,I,0,!1,w)}).style("fill",(B,$)=>C.getColor(B,o.color,$)).merge(S);C.smartTransition(X,v).attr("d",(B,$)=>{const _=i($),P=k,I=C.getNumber(B,h[$]),m=I<0;let j=m?this.valueScale(0):this.valueScale(I||0),Y=Math.abs(this.valueScale(0)-this.valueScale(I))||0;if(Y<o.barMinHeight){const L=w===M.Direction.North?-1:1;j=this.valueScale(0)+L*o.barMinHeight,Y=o.barMinHeight}return this._getBarPath(_,j,P,Y,m,w)}).style("fill",(B,$)=>C.getColor(B,o.color,$)).style("cursor",(B,$)=>C.getString(B,o.cursor,$)),C.smartTransition(S.exit(),v).remove()}_getValueAxisDirection(){return this.valueScale.range()[0]>this.valueScale.range()[1]?M.Direction.North:M.Direction.South}_getVisibleData(){const{config:f,datamodel:{data:o}}=this,v=this._getGroupWidth(),g=o.length<2?0:v/2,h=this.dataScale,x=Math.abs(h.invert(g)-h.invert(0));return o?.filter((r,l)=>{const n=C.getNumber(r,f.x,l),c=h.domain(),N=+c[0],k=+c[1];return n>=N-x&&n<=k+x})}_getBarPath(f,o,v,g,h,x){const{config:i}=this,r=i.roundedCorners?C.isNumber(i.roundedCorners)?+i.roundedCorners:v/2:0,l=C.clamp(r,0,Math.min(g,v)/2),n=x===M.Direction.North,c=this.isVertical()&&h!==n,N=this.isVertical()&&h===n,k=!this.isVertical()&&h,S=!this.isVertical()&&!h;return me({x:this.isVertical()?f:o+(n?0:-g),y:this.isVertical()?o+(n?0:-g):f,w:this.isVertical()?v:g,h:this.isVertical()?g:v,tl:c||k,tr:c||S,bl:N||k,br:N||S,r:l})}_getGroupWidth(){const{config:f,datamodel:{data:o}}=this;if(C.isEmpty(o))return 0;if(f.groupWidth)return C.min([f.groupWidth,f.groupMaxWidth]);const v=this.dataScale.bandwidth,g=this.dataScale.domain?this.dataScale.domain():[];let x=1+(v?g.length:g[1]-g[0])/f.dataStep||!v&&o.filter((l,n)=>{const c=C.getNumber(l,f.x,n);return c>=g[0]&&c<=g[1]}).length||o.length;!v&&x>=2&&(x+=1);const r=(x<2?1:1-f.groupPadding)*(this.isVertical()?this._width:this._height)/x;return C.min([r,f.groupMaxWidth])}getValueScaleExtent(f){const{datamodel:o}=this,v=this.getAccessors(),g=f?this._getVisibleData():o.data,h=C.getMin(g,...v),x=C.getMax(g,...v);return[h>0?0:h,x<0?0:x]}getDataScaleExtent(){const{config:f,datamodel:o}=this;return C.getExtent(o.data,f.x)}getYDataExtent(f){return this.isVertical()?this.getValueScaleExtent(f):this.getDataScaleExtent()}getXDataExtent(){return this.isVertical()?this.getDataScaleExtent():this.getValueScaleExtent(!1)}}se.selectors=ve;const ge={"data-vis-component":""},oe=e.defineComponent({__name:"index",props:{color:{},groupWidth:{},groupMaxWidth:{},dataStep:{},groupPadding:{},barPadding:{},roundedCorners:{type:[Number,Boolean]},barMinHeight:{},cursor:{},orientation:{},x:{},y:{},id:{type:Function},xScale:{type:[Object,Function]},yScale:{type:[Object,Function]},excludeFromDomainCalculation:{type:Boolean},duration:{},events:{},attributes:{},data:{}},setup(p,{expose:f}){const o=e.inject(C.o),v=p,g=e.computed(()=>o.data.value??v.data),h=C.m(v),x=e.ref();return e.onMounted(()=>{e.nextTick(()=>{var i;x.value=new se(h.value),(i=x.value)==null||i.setData(g.value),o.update(x.value)})}),e.onUnmounted(()=>{var i;(i=x.value)==null||i.destroy(),o.destroy()}),e.watch(h,(i,r)=>{var l;C.f(i,r)||(l=x.value)==null||l.setConfig(h.value)}),e.watch(g,()=>{var i;(i=x.value)==null||i.setData(g.value)}),f({component:x}),(i,r)=>(e.openBlock(),e.createElementBlock("div",ge))}}),he={class:"flex flex-col sm:flex-row"},xe=["data-active"],ye={class:"flex items-center gap-2"},ke={class:"block text-muted-foreground text-xs mr-2 max-w-[120px] truncate"},Ce={class:"block text-lg leading-none font-bold sm:text-3xl"},be={class:"mx-auto w-full max-w-sm mt-2 mb-8"},Ve={class:"text-muted-foreground"},we={class:"text-muted-foreground"},_e={class:"grid"},De={class:"flex gap-1 overflow-hidden max-w-80"},Ne={class:"truncate"},Se=e.defineComponent({__name:"ResourceSelector",props:{resources:{type:Array,required:!0},totals:{type:Object,required:!0},viewMode:{type:String,required:!0},activeChart:{type:String,required:!1}},emits:["update:viewMode","update:activeChart"],setup(p,{emit:f}){const o=p,v=f,g=e.computed({get:()=>o.viewMode,set:l=>{v("update:viewMode",l)}}),h=e.computed({get:()=>o.activeChart,set:l=>{v("update:activeChart",l)}}),{width:x}=ie.useWindowSize(),i=e.computed(()=>x.value<640),r=e.ref(!1);return(l,n)=>{const c=e.resolveComponent("DrawerTitle"),N=e.resolveComponent("DrawerDescription"),k=e.resolveComponent("DrawerHeader"),S=e.resolveComponent("Button"),w=e.resolveComponent("DrawerFooter"),A=e.resolveComponent("DrawerContent"),X=e.resolveComponent("Drawer"),B=e.resolveComponent("DropdownMenuTrigger"),$=e.resolveComponent("DropdownMenuLabel"),_=e.resolveComponent("DropdownMenuItem"),P=e.resolveComponent("DropdownMenuContent"),I=e.resolveComponent("DropdownMenu");return e.openBlock(),e.createElementBlock("div",he,[p.resources.length>1?(e.openBlock(),e.createElementBlock("button",{key:0,"data-active":p.viewMode==="stacked",class:"hover:bg-muted/50 flex flex-1 flex-col justify-center gap-2 border-t px-4 py-3 text-left sm:border-t-0 sm:border-l sm:px-6 sm:py-6 cursor-pointer",onClick:n[0]||(n[0]=m=>r.value=!0),onContextmenu:n[1]||(n[1]=e.withModifiers(m=>r.value=!0,["prevent"]))},[e.createElementVNode("div",ye,[p.viewMode==="stacked"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(F.Layers),{class:"size-3 text-muted-foreground"}),n[6]||(n[6]=e.createElementVNode("span",{class:"block text-muted-foreground text-xs mr-2 max-w-[120px] truncate"},"All Resources",-1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"size-3 rounded-full mr-2",style:e.normalizeStyle({backgroundColor:p.resources.find(m=>m.id===p.activeChart)?.color||"#6b7280"})},null,4),e.createElementVNode("span",ke,e.toDisplayString(p.resources.find(m=>m.id===p.activeChart)?.name||"Select Resource"),1)],64)),e.createVNode(e.unref(F.ChevronDown),{class:"ml-auto size-4"})]),e.createElementVNode("span",Ce,e.toDisplayString(p.viewMode==="stacked"?Object.values(p.totals).reduce((m,j)=>m+j,0).toLocaleString():(p.totals[p.activeChart]||0).toLocaleString()),1)],40,xe)):e.createCommentVNode("",!0),e.unref(i)?(e.openBlock(),e.createBlock(X,{key:1,open:e.unref(r),"onUpdate:open":n[3]||(n[3]=m=>e.isRef(r)?r.value=m:null)},{default:e.withCtx(()=>[e.createVNode(A,null,{default:e.withCtx(()=>[e.createElementVNode("div",be,[e.createVNode(k,null,{default:e.withCtx(()=>[e.createVNode(c,null,{default:e.withCtx(()=>[...n[7]||(n[7]=[e.createTextVNode("Resources",-1)])]),_:1}),e.createVNode(N,null,{default:e.withCtx(()=>[...n[8]||(n[8]=[e.createTextVNode("Select the resources to display on the timeline.",-1)])]),_:1})]),_:1}),e.createVNode(w,null,{default:e.withCtx(()=>[e.createVNode(S,{onClick:n[2]||(n[2]=m=>{g.value="stacked",h.value="",r.value=!1}),variant:p.viewMode==="stacked"?"secondary":"outline"},{default:e.withCtx(()=>[e.createVNode(e.unref(F.Layers),{class:"size-3 text-muted-foreground"}),e.createElementVNode("span",Ve," All Resources ("+e.toDisplayString(Object.values(p.totals).reduce((m,j)=>m+j,0).toLocaleString())+") ",1)]),_:1},8,["variant"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.resources,m=>(e.openBlock(),e.createBlock(S,{key:m.id,onClick:j=>{g.value="single",h.value=m.id,r.value=!1},variant:p.viewMode==="single"&&p.activeChart===m.id?"secondary":"outline"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"size-3 rounded-full",style:e.normalizeStyle({backgroundColor:m.color||"#6b7280"})},null,4),e.createElementVNode("span",we,e.toDisplayString(m.name)+" ("+e.toDisplayString((p.totals[m.id]||0).toLocaleString())+") ",1)]),_:2},1032,["onClick","variant"]))),128))]),_:1})])]),_:1})]),_:1},8,["open"])):(e.openBlock(),e.createBlock(I,{key:2,open:e.unref(r),"onUpdate:open":n[5]||(n[5]=m=>e.isRef(r)?r.value=m:null)},{default:e.withCtx(()=>[e.createVNode(B,{"as-child":""},{default:e.withCtx(()=>[...n[9]||(n[9]=[e.createElementVNode("button",{tabindex:"-1",class:"size-0 opacity-0 self-end"},null,-1)])]),_:1}),e.createVNode(P,{align:"end"},{default:e.withCtx(()=>[e.createVNode($,null,{default:e.withCtx(()=>[...n[10]||(n[10]=[e.createTextVNode("Resources",-1)])]),_:1}),e.createElementVNode("div",_e,[e.createVNode(_,{onClick:n[4]||(n[4]=m=>{g.value="stacked",h.value="",r.value=!1}),class:e.normalizeClass(p.viewMode==="stacked"?"bg-input":"")},{default:e.withCtx(()=>[e.createVNode(e.unref(F.Layers),{class:"size-3 text-muted-foreground"}),e.createElementVNode("span",null," All Resources ("+e.toDisplayString(Object.values(p.totals).reduce((m,j)=>m+j,0).toLocaleString())+") ",1)]),_:1},8,["class"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.resources,m=>(e.openBlock(),e.createBlock(_,{key:m.id,onClick:j=>{g.value="single",h.value=m.id,r.value=!1},class:e.normalizeClass(p.viewMode==="single"&&p.activeChart===m.id?"bg-input":"")},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"size-3 rounded-full",style:e.normalizeStyle({backgroundColor:m.color||"#6b7280"})},null,4),e.createElementVNode("span",De,[e.createElementVNode("span",Ne,e.toDisplayString(m.name),1),e.createElementVNode("span",null,"("+e.toDisplayString((p.totals[m.id]||0).toLocaleString())+")",1)])]),_:2},1032,["onClick","class"]))),128))])]),_:1})]),_:1},8,["open"]))])}}}),Ee={class:"flex flex-1 flex-col justify-center gap-1 px-6 py-5 sm:py-6"},Be={class:"flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3"},$e={class:"flex items-center gap-1"},Me={class:"timeline-date-trigger"},Re={key:1,class:"flex items-center justify-center px-6 py-4 text-muted-foreground text-sm"},Te={key:0,class:"flex items-center justify-center h-[250px]"},Ie={key:1,class:"flex items-center justify-center h-[250px]"},ne="#61616180",Oe=e.defineComponent({__name:"Timeline",props:{modelValue:{},selectedResource:{},viewMode:{},agendaData:{},resources:{}},emits:["update:modelValue","update:selectedResource","update:viewMode"],setup(p,{emit:f}){const o=p,v=f,{params:g}=G.useModuleRoute(),{config:h}=G.useModule(),x=G.useFirebaseIntegration(h.project),i=e.ref([]),r=e.ref([]),l=e.ref(!0),n=e.ref(o.viewMode||"stacked"),c=e.ref(o.selectedResource||"");e.watch(n,t=>{v("update:viewMode",t)},{immediate:!0}),e.watch(c,t=>{v("update:selectedResource",n.value==="single"?t:null)}),e.watch(n,t=>{v("update:selectedResource",t==="single"?c.value:null)}),e.watch(()=>o.selectedResource,t=>{n.value==="single"&&t!==c.value&&(c.value=t||"")});const N=new Date,k=e.ref(o.modelValue||new Date),S=e.ref(null);e.watch(()=>o.modelValue,t=>{t&&t.getTime()!==k.value.getTime()&&(k.value=t)}),e.watch(k,t=>{v("update:modelValue",t)},{immediate:!0});const w=e.computed({get:()=>J(k.value),set:t=>{if(!t){k.value=new Date;return}k.value=new Date(`${t}T00:00:00`)}}),A=()=>{const t=S.value;if(t){if(typeof t.showPicker=="function"){t.showPicker();return}t.focus(),t.click()}},X=e.computed(()=>{const t=new Date(N);t.setDate(N.getDate()-1);const u=new Date(N);return u.setDate(N.getDate()+1),k.value.toDateString()===N.toDateString()?"Today":k.value.toDateString()===t.toDateString()?"Yesterday":k.value.toDateString()===u.toDateString()?"Tomorrow":k.value.toLocaleDateString("en-US",{weekday:"long",month:"long",day:"numeric",year:"numeric"})}),B=()=>{const t=new Date(k.value);t.setDate(t.getDate()-1),k.value=t},$=()=>{const t=new Date(k.value);t.setDate(t.getDate()+1),k.value=t},_=()=>{k.value=new Date},P=e.computed(()=>o.resources?.length===0?10:Math.max(...(o.resources||[]).map(t=>t.capacity||10))),I=e.computed(()=>(o.resources?.length||0)===0?60:Math.min(...(o.resources||[]).map(t=>t.interval||60))),m=e.computed(()=>{const t={total:{label:"Total Reservations",color:void 0}};return(o.resources||[]).forEach((u,V)=>{t[u.id]={label:u.name,color:u.color||`var(--chart-${V%5+1})`}}),t});e.watch(()=>o.resources,t=>{(t?.length||0)>0&&!c.value&&(c.value=t[0].id)},{immediate:!0});const j=e.computed(()=>[...o.resources||[]].sort((t,u)=>{const V=L.value[t.id]||0;return(L.value[u.id]||0)-V})),Y=e.computed(()=>{const t=[];return I.value,i.value.forEach((u,V)=>{u.time.endsWith(":00")&&t.push(V)}),t}),L=e.computed(()=>{const t={};return o.resources?.forEach(u=>{t[u.id]=r.value.filter(V=>V.resourceId===u.id).reduce((V,D)=>V+(D.reserved||0),0)}),t}),J=t=>{const u=t.getFullYear(),V=String(t.getMonth()+1).padStart(2,"0"),D=String(t.getDate()).padStart(2,"0");return`${u}-${V}-${D}`},s=t=>{const[u,V]=t.split(":").map(Number);return u*60+V},a=(t,u)=>(o.agendaData?.exceptions||[]).find(D=>u>=D.startDate&&u<=D.endDate?D.resourceIds===null?!0:D.resourceIds?.includes(t):!1)||null,E=e.computed(()=>{const t=J(k.value),u=k.value.getDay();let V=1440,D=0;if((o.resources||[]).forEach(U=>{const T=a(U.id,t);if(T){if(T.isClosed)return;T.timeslots.forEach(W=>{const y=s(W.startTime),b=s(W.endTime);V=Math.min(V,y),D=Math.max(D,b)})}else(U.openingHours?.[u]||[]).forEach(y=>{const b=s(y.start),q=s(y.end);V=Math.min(V,b),D=Math.max(D,q)})}),V>=D)return{startMinutes:540,endMinutes:1020};const d=Math.floor(V/60)*60,H=Math.ceil(D/60)*60;return{startMinutes:d,endMinutes:H}}),O=()=>{const t=[],u=I.value,{startMinutes:V,endMinutes:D}=E.value;for(let d=V;d<D;d+=u){const H=Math.floor(d/60),U=d%60,T=`${String(H).padStart(2,"0")}:${String(U).padStart(2,"0")}`,W={time:T,label:T};o.resources?.forEach(y=>{W[y.id]=0}),t.push(W)}return t},z=async()=>{l.value=!0;try{const t=g.value.id,u=J(k.value),V=`${t}_${u}`,D=await x.get(h.reservedSpotsCollection,V);r.value=[];for(const T of o.resources||[]){const W=D?.[T.id]||{};Object.entries(W).forEach(([y,b])=>{const[q,K]=y.split("-");r.value.push({resourceId:T.id,startTime:q,endTime:K,reserved:b})})}const d=O(),H=I.value,{startMinutes:U}=E.value;r.value.forEach(T=>{const W=s(T.startTime),y=s(T.endTime);for(let b=W;b<y;b+=H){const q=Math.floor((b-U)/H);if(q>=0&&q<d.length){const K=d[q][T.resourceId];typeof K=="number"&&(d[q][T.resourceId]=K+(T.reserved||0))}}}),i.value=d}catch(t){console.error("Error loading reservation data:",t),i.value=O(),r.value=[]}finally{l.value=!1}};return(async()=>await z())(),e.watch(k,()=>{z()}),e.watch(()=>o.resources,()=>{(o.resources?.length||0)>0&&z()}),(t,u)=>{const V=e.resolveComponent("CardTitle"),D=e.resolveComponent("Button"),d=e.resolveComponent("CardDescription"),H=e.resolveComponent("CardHeader"),U=e.resolveComponent("ChartContainer"),T=e.resolveComponent("CardContent"),W=e.resolveComponent("Card");return e.openBlock(),e.createBlock(W,{class:"py-4 sm:py-0"},{default:e.withCtx(()=>[e.createVNode(H,{class:"flex flex-col items-stretch border-b !p-0 sm:flex-row"},{default:e.withCtx(()=>[e.createElementVNode("div",Ee,[e.createElementVNode("div",Be,[e.createVNode(V,null,{default:e.withCtx(()=>[...u[3]||(u[3]=[e.createTextVNode("Reservations",-1)])]),_:1}),e.createElementVNode("div",$e,[e.createVNode(D,{variant:"outline",size:"icon",class:"size-8",onClick:B},{default:e.withCtx(()=>[e.createVNode(e.unref(F.ChevronLeft),{size:16})]),_:1}),e.createVNode(D,{variant:"outline",size:"sm",class:"h-8 px-3 text-xs",onClick:_},{default:e.withCtx(()=>[...u[4]||(u[4]=[e.createTextVNode(" Today ",-1)])]),_:1}),e.createVNode(D,{variant:"outline",size:"icon",class:"size-8",onClick:$},{default:e.withCtx(()=>[e.createVNode(e.unref(F.ChevronRight),{size:16})]),_:1})])]),e.createVNode(d,null,{default:e.withCtx(()=>[e.createElementVNode("div",Me,[e.createVNode(D,{type:"button",variant:"outline",onClick:A},{default:e.withCtx(()=>[e.createVNode(e.unref(F.CalendarIcon),{class:"size-4"}),e.createTextVNode(" "+e.toDisplayString(e.unref(X)),1)]),_:1}),e.withDirectives(e.createElementVNode("input",{ref_key:"dateInputRef",ref:S,"onUpdate:modelValue":u[0]||(u[0]=y=>e.isRef(w)?w.value=y:null),type:"date",class:"timeline-date-picker","aria-label":"Select reservation date"},null,512),[[e.vModelText,e.unref(w)]])])]),_:1})]),p.resources.length>0?(e.openBlock(),e.createBlock(Se,{key:0,resources:p.resources,totals:e.unref(L),viewMode:e.unref(n),"onUpdate:viewMode":u[1]||(u[1]=y=>e.isRef(n)?n.value=y:null),activeChart:e.unref(c),"onUpdate:activeChart":u[2]||(u[2]=y=>e.isRef(c)?c.value=y:null)},null,8,["resources","totals","viewMode","activeChart"])):(e.openBlock(),e.createElementBlock("div",Re," No resources configured "))]),_:1}),e.createVNode(T,{class:"px-2 sm:p-6"},{default:e.withCtx(()=>[e.unref(l)?(e.openBlock(),e.createElementBlock("div",Te,[...u[5]||(u[5]=[e.createElementVNode("div",{class:"text-muted-foreground"},"Loading...",-1)])])):p.resources.length===0?(e.openBlock(),e.createElementBlock("div",Ie,[...u[6]||(u[6]=[e.createElementVNode("div",{class:"text-muted-foreground"},"No resources to display",-1)])])):e.unref(n)==="stacked"?(e.openBlock(),e.createBlock(U,{key:2,config:e.unref(m),class:"aspect-auto h-[250px] w-full",cursor:""},{default:e.withCtx(()=>[e.createVNode(e.unref(M.$),{data:e.unref(i),margin:{left:-24},"y-domain":[0,e.unref(P)]},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(j),y=>(e.openBlock(),e.createBlock(e.unref(oe),{key:y.id,x:(b,q)=>q,y:b=>b[y.id]||0,color:b=>b[y.id]>0?e.unref(m)[y.id]?.color:ne,"bar-padding":.1,"rounded-corners":2},null,8,["x","y","color"]))),128)),e.createVNode(e.unref(M.O),{type:"x",x:(y,b)=>b,"tick-line":!1,"domain-line":!1,"grid-line":!1,"tick-values":e.unref(Y),"tick-format":y=>e.unref(i)[y]?.time||""},null,8,["x","tick-values","tick-format"]),e.createVNode(e.unref(M.O),{type:"y","num-ticks":3,"tick-line":!1,"domain-line":!1}),e.createVNode(e.unref(M.z)),e.createVNode(e.unref(M.A),{template:e.unref(Q.componentToString)(e.unref(m),e.unref(Q.ChartTooltipContent),{labelFormatter(y){const b=Math.round(y);return b>=0&&b<e.unref(i).length&&e.unref(i)[b]?.time||""}}),color:"#0000"},null,8,["template"])]),_:1},8,["data","y-domain"])]),_:1},8,["config"])):(e.openBlock(),e.createBlock(U,{key:e.unref(c),config:e.unref(m),class:"aspect-auto h-[250px] w-full",cursor:""},{default:e.withCtx(()=>[e.createVNode(e.unref(M.$),{data:e.unref(i),margin:{left:-24},"y-domain":[0,e.unref(P)]},{default:e.withCtx(()=>[e.createVNode(e.unref(oe),{x:(y,b)=>b,y:y=>y[e.unref(c)]||0,color:y=>y[e.unref(c)]>0?e.unref(m)[e.unref(c)]?.color:ne,"bar-padding":.1,"rounded-corners":!1},null,8,["x","y","color"]),e.createVNode(e.unref(M.O),{type:"x",x:(y,b)=>b,"tick-line":!1,"domain-line":!1,"grid-line":!1,"tick-values":e.unref(Y),"tick-format":y=>e.unref(i)[y]?.time||""},null,8,["x","tick-values","tick-format"]),e.createVNode(e.unref(M.O),{type:"y","num-ticks":3,"tick-line":!1,"domain-line":!1}),e.createVNode(e.unref(M.z)),e.createVNode(e.unref(M.A),{template:e.unref(Q.componentToString)(e.unref(m),e.unref(Q.ChartTooltipContent),{labelFormatter(y){const b=Math.round(y);return b>=0&&b<e.unref(i).length&&e.unref(i)[b]?.time||""}}),color:"#0000"},null,8,["template"])]),_:1},8,["data","y-domain"])]),_:1},8,["config"]))]),_:1})]),_:1})}}}),ze=ce._export_sfc(Oe,[["__scopeId","data-v-62490f67"]]),Pe={class:"flex flex-row items-center justify-between gap-2"},je={class:"relative mb-4"},Ae={class:"flex gap-1 mb-4 flex-wrap"},Fe={key:0,class:"mb-3 text-sm text-muted-foreground"},Le={key:1,class:"flex items-center justify-center py-8"},We={key:2,class:"flex flex-col items-center gap-2 text-center py-8 text-muted-foreground"},qe={key:3,class:"text-center py-8 text-muted-foreground"},Ge={key:4,class:"space-y-2"},He=["onClick"],Ue={class:"flex items-start justify-between"},Ye={class:"flex-1"},Xe={class:"font-medium"},Je={class:"text-sm text-muted-foreground"},Ke={class:"text-sm text-muted-foreground"},Qe={class:"flex items-center gap-4 flex-wrap"},Ze={class:"flex items-center gap-2 mt-1 text-xs text-muted-foreground"},et={class:"flex items-center gap-2 mt-1 text-xs text-muted-foreground"},tt={key:0,class:"flex items-center gap-1 mt-1 text-xs text-muted-foreground"},ot={class:"text-right"},nt={key:0,class:"inline-block px-2 py-1 text-xs rounded-full bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400"},at={key:1,class:"inline-block px-2 py-1 text-xs rounded-full bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400"},rt={key:2,class:"inline-block px-2 py-1 text-xs rounded-full bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400"},st={key:3,class:"inline-block px-2 py-1 text-xs rounded-full bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400"},lt={key:4,class:"inline-block px-2 py-1 text-xs rounded-full bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400"},it={key:5,class:"text-sm font-medium mt-1"},ct=e.defineComponent({__name:"BookingsList",props:{agendaData:{},activeDate:{},selectedResource:{},resources:{}},emits:["resetSelectedResource"],setup(p,{emit:f}){const o=p,v=f,{params:g}=G.useModuleRoute(),{config:h}=G.useModule(),x=G.useFirebaseIntegration(h.project),i=e.ref([]),r=e.ref(!0),l=e.ref(""),n=e.ref(null),c=e.ref(null),N=e.computed(()=>o.agendaData?.metadataSchema||[]),k=e.computed(()=>({date:S(o.activeDate),resource:null}));e.provide("event",k);const S=s=>{const a=s.getFullYear(),E=String(s.getMonth()+1).padStart(2,"0"),O=String(s.getDate()).padStart(2,"0");return`${a}-${E}-${O}`},w=e.computed(()=>{let s=i.value;return o.selectedResource&&(s=s.filter(a=>a.resourceId===o.selectedResource)),l.value.trim()&&(s=new ee.Fuse(s,{keys:["customerInfo.firstName","customerInfo.lastName","customerInfo.email","customerInfo.phone","resourceName"],threshold:.3,ignoreLocation:!0}).search(l.value).map(E=>E.item)),s}),A=e.computed(()=>w.value.filter(s=>_.value.includes(s.reservationStatus))),X=e.computed(()=>{let s=JSON.parse(JSON.stringify(i.value));return o.selectedResource&&(s=s.filter(a=>a.resourceId===o.selectedResource)),s.some(a=>a.reservationStatus==="approved"||a.reservationStatus==="needs_approval")}),B=e.computed(()=>({spots:i.value.reduce((s,a)=>s+(a.spots||0),0),bookings:i.value.length})),$=()=>{l.value=""},_=e.ref(["needs_approval","approved"]),P=s=>{_.value.includes(s)?_.value=_.value.filter(a=>a!==s):_.value.push(s)},I=(s,a,E=a.date)=>{const O=o.resources.find(R=>R.id===a.resourceId),z=s.id||s.orderId||a.orderId||"";return{customerInfo:s.customerInfo,amountDue:s.amountDue,amountPaid:s.amountPaid,status:s.status,reservationStatus:a.status,subtotal:s.subtotal,total:s.total,discount:s.discount,id:z,res_id:a.id,resourceId:a.resourceId,spots:a.spots,date:E,createdAt:s.createdAt,startTime:a.timeslot?.startTime,endTime:a.timeslot?.endTime,reservationPrice:a.totalPrice,reservationBasePrice:a.basePrice,reservationAddOnsPrice:a.addOnsPrice,pricingOptionId:a.pricingOptionId,pricingOption:a.pricingOption,resourceName:O?.name||"Unknown",resourceColor:O?.color,metadata:s.metadata||{},reservationMetadata:a.metadata||{},adjustments:s.adjustments||[],reservationAdjustments:a.adjustments||[]}},m=async()=>{await e.nextTick(),await new Promise(s=>{if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>s());return}s()})},j=async s=>{const a=await x.get(h.reservationsCollection,s);if(!a)return;const E={...a,id:a.id||s},O=(E.reservations||[]).map(z=>I(E,z));O.length&&(await m(),c.value?.openDialog({id:E.id,customerInfo:E.customerInfo,status:E.status,createdAt:E.createdAt,metadata:E.metadata||{},reservations:O,adjustments:E.adjustments||[],totalPrice:typeof E.total=="number"?E.total:O.reduce((z,R)=>z+(R.reservationPrice||0),0),totalSpots:O.reduce((z,R)=>z+(R.spots||0),0)}))},Y=async s=>{await m(),n.value?.openDialog(s)},L=async()=>{r.value=!0,i.value=[];try{const s=g.value.id,a=S(o.activeDate),E=new Set;o.resources?.forEach(R=>{const t=`${R.id}_${a}`;E.add(t)});const O=await x.find(h.reservationsCollection,{filters:[{field:"agendaId",operator:"==",value:s},{field:"status",operator:"==",value:"confirmed"},{field:"flattenedReservationDates",operator:"array-contains-any",value:Array.from(E)}]});let z=[];O.forEach(R=>{(R.reservations?.filter(u=>u.date===a)||[]).forEach(u=>{z.push(I(R,u,a))})}),i.value=z.sort((R,t)=>R.startTime?.localeCompare(t.startTime||"")||0)}catch(s){console.error("Error loading orders:",s),i.value=[]}finally{r.value=!1}};return(async()=>await L())(),e.watch(()=>o.activeDate,()=>{L()}),(s,a)=>{const E=e.resolveComponent("Badge"),O=e.resolveComponent("CardTitle"),z=e.resolveComponent("CardDescription"),R=e.resolveComponent("Button"),t=e.resolveComponent("CardHeader"),u=e.resolveComponent("Input"),V=e.resolveComponent("CardContent"),D=e.resolveComponent("Card");return e.openBlock(),e.createBlock(D,null,{default:e.withCtx(()=>[e.createVNode(t,null,{default:e.withCtx(()=>[e.createElementVNode("div",Pe,[e.createElementVNode("div",null,[e.createVNode(O,{class:"flex items-center gap-2"},{default:e.withCtx(()=>[a[9]||(a[9]=e.createTextVNode(" Bookings ",-1)),e.unref(B).bookings>0?(e.openBlock(),e.createBlock(E,{key:0,variant:"secondary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(B).bookings),1)]),_:1})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(z,{class:"flex items-center gap-2 mt-1"},{default:e.withCtx(()=>[e.createVNode(e.unref(F.Users),{size:14}),e.createElementVNode("span",null,e.toDisplayString(e.unref(B).spots)+" total spots",1)]),_:1})]),e.createVNode(R,{variant:"ghost",size:"icon",onClick:L,disabled:e.unref(r)},{default:e.withCtx(()=>[e.createVNode(e.unref(F.RefreshCw),{size:16,class:e.normalizeClass({"animate-spin":e.unref(r)})},null,8,["class"])]),_:1},8,["disabled"])])]),_:1}),e.createVNode(V,null,{default:e.withCtx(()=>[e.createElementVNode("div",je,[e.createVNode(e.unref(F.Search),{size:16,class:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),e.createVNode(u,{modelValue:e.unref(l),"onUpdate:modelValue":a[0]||(a[0]=d=>e.isRef(l)?l.value=d:null),placeholder:"Search by name, email, or phone...",class:"pl-9 pr-9"},null,8,["modelValue"]),e.unref(l)?(e.openBlock(),e.createBlock(R,{key:0,variant:"ghost",size:"icon",class:"absolute right-1 top-1/2 -translate-y-1/2 h-7 w-7",onClick:$},{default:e.withCtx(()=>[e.createVNode(e.unref(F.X),{size:14})]),_:1})):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ae,[p.agendaData.needsApproval?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:a[1]||(a[1]=d=>P("needs_approval")),class:e.normalizeClass(["px-3 py-1.5 rounded-full text-sm bg-muted",{"opacity-50 hover:opacity-75":!e.unref(_).includes("needs_approval")}])}," Needs Approval ",2)):e.createCommentVNode("",!0),e.createElementVNode("button",{onClick:a[2]||(a[2]=d=>P("approved")),class:e.normalizeClass(["px-3 py-1.5 rounded-full text-sm bg-muted",{"opacity-50 hover:opacity-75":!e.unref(_).includes("approved")}])}," Approved ",2),e.createElementVNode("button",{onClick:a[3]||(a[3]=d=>P("rejected")),class:e.normalizeClass(["px-3 py-1.5 rounded-full text-sm bg-muted",{"opacity-50 hover:opacity-75":!e.unref(_).includes("rejected")}])}," Rejected ",2),e.createElementVNode("button",{onClick:a[4]||(a[4]=d=>P("cancelled")),class:e.normalizeClass(["px-3 py-1.5 rounded-full text-sm bg-muted",{"opacity-50 hover:opacity-75":!e.unref(_).includes("cancelled")}])}," Cancelled ",2)]),e.unref(l)?(e.openBlock(),e.createElementBlock("div",Fe," Showing "+e.toDisplayString(e.unref(w).length)+" of "+e.toDisplayString(e.unref(i).length)+" bookings ",1)):e.createCommentVNode("",!0),e.unref(r)?(e.openBlock(),e.createElementBlock("div",Le,[...a[10]||(a[10]=[e.createElementVNode("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"},null,-1)])])):e.unref(A).length===0?(e.openBlock(),e.createElementBlock("div",We,[a[13]||(a[13]=e.createTextVNode(" No bookings for this day ",-1)),e.unref(X)?(e.openBlock(),e.createBlock(R,{key:0,onClick:a[5]||(a[5]=d=>_.value=["needs_approval","approved"])},{default:e.withCtx(()=>[...a[11]||(a[11]=[e.createTextVNode("Reset filters",-1)])]),_:1})):e.createCommentVNode("",!0),p.selectedResource!==null?(e.openBlock(),e.createBlock(R,{key:1,onClick:a[6]||(a[6]=d=>v("resetSelectedResource"))},{default:e.withCtx(()=>[...a[12]||(a[12]=[e.createTextVNode("Reset resource filter",-1)])]),_:1})):e.createCommentVNode("",!0)])):e.unref(w).length===0?(e.openBlock(),e.createElementBlock("div",qe," No bookings match your search ")):(e.openBlock(),e.createElementBlock("div",Ge,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(w),d=>(e.openBlock(),e.createElementBlock("div",{key:d.res_id||d.id,class:"p-3 border rounded-lg hover:bg-muted/50 transition-colors cursor-pointer",onClick:H=>e.unref(n)?.openDialog(d)},[e.createElementVNode("div",Ue,[e.createElementVNode("div",Ye,[e.createElementVNode("div",Xe,e.toDisplayString(d.customerInfo.firstName+" "+d.customerInfo.lastName||"Unknown Customer"),1),e.createElementVNode("div",Je,e.toDisplayString(d.customerInfo?.email),1),e.createElementVNode("div",Ke,e.toDisplayString(d.customerInfo?.phone),1),e.createElementVNode("div",Qe,[e.createElementVNode("div",Ze,[e.createVNode(e.unref(F.Clock),{size:12}),e.createElementVNode("span",null,e.toDisplayString(d.startTime)+" - "+e.toDisplayString(d.endTime),1)]),e.createElementVNode("div",et,[e.createVNode(e.unref(F.Users),{size:12}),e.createElementVNode("span",null,e.toDisplayString(d.spots)+" spots",1)]),d.resourceName?(e.openBlock(),e.createElementBlock("div",tt,[e.createElementVNode("div",{class:"w-3 h-3 rounded-full",style:e.normalizeStyle({backgroundColor:d.resourceColor||"#6b7280"})},null,4),e.createElementVNode("span",null,e.toDisplayString(d.resourceName),1)])):e.createCommentVNode("",!0)]),e.createVNode(ee._sfc_main,{metadata:{...d.metadata,...d.reservationMetadata},schema:e.unref(N),"display-filter":["highlight","badge"],compact:"",class:"mt-1"},null,8,["metadata","schema"])]),e.createElementVNode("div",ot,[d.reservationStatus==="needs_approval"?(e.openBlock(),e.createElementBlock("span",nt,"Needs Approval")):d.reservationStatus==="approved"?(e.openBlock(),e.createElementBlock("span",at,"Approved")):d.reservationStatus==="rejected"?(e.openBlock(),e.createElementBlock("span",rt,"Rejected")):d.reservationStatus==="cancelled"?(e.openBlock(),e.createElementBlock("span",st,"Cancelled")):(e.openBlock(),e.createElementBlock("span",lt,"Pending")),d.reservationPrice||d.reservationPrice===0?(e.openBlock(),e.createElementBlock("div",it," €"+e.toDisplayString(d.reservationPrice.toFixed(2)),1)):e.createCommentVNode("",!0)])])],8,He))),128))]))]),_:1}),e.createVNode(ee._sfc_main$1,{ref_key:"reservationDetailDialog",ref:n,agendaData:p.agendaData,"show-order-link":"",onCancelled:L,onConfirmed:L,onRejected:L,onOpenOrder:a[7]||(a[7]=d=>j(d))},null,8,["agendaData"]),e.createVNode(de._sfc_main,{ref_key:"orderDetailDialog",ref:c,agendaData:p.agendaData,onOpenReservation:a[8]||(a[8]=d=>Y(d))},null,8,["agendaData"])]),_:1})}}}),dt={class:"space-y-6"},ut={class:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4"},mt={class:"text-2xl font-semibold tracking-tight"},pt={class:"flex flex-col md:flex-row gap-2"},ft={class:"grid gap-6 md:grid-cols-2 lg:grid-cols-3"},vt={class:"md:col-span-2 lg:col-span-3"},gt=e.defineComponent({__name:"index",setup(p){const{hasPermission:f}=G.useModulePermissions(),{params:o,resolvePath:v}=G.useModuleRoute(),{config:g}=G.useModule(),h=G.useFirebaseIntegration(g.project),x=e.ref(""),i=e.ref(!0),r=e.ref(new Date),l=e.ref(null),n=e.ref("stacked"),c=e.ref(null),N=e.ref([]);return(async()=>{try{const S=await h.get(g.agendaCollection,o.value.id);x.value=S?.serviceName||"",c.value=S,N.value=S?.resources?.filter(w=>w.isActive)||[]}catch(S){console.error("Error loading data:",S)}finally{i.value=!1}})(),(S,w)=>(e.openBlock(),e.createBlock(le._sfc_main,null,{default:e.withCtx(()=>[e.createElementVNode("div",dt,[e.createElementVNode("div",ut,[e.createElementVNode("div",null,[e.createElementVNode("h1",mt,e.toDisplayString(e.unref(x)||"Dashboard"),1),w[4]||(w[4]=e.createElementVNode("p",{class:"text-muted-foreground text-sm mt-1"}," Overview and analytics for your booking service ",-1))]),e.createElementVNode("div",pt,[e.unref(f)("manage-reservations")?(e.openBlock(),e.createBlock(ue._sfc_main,{key:0,"agenda-data":e.unref(c)},null,8,["agenda-data"])):e.createCommentVNode("",!0)])]),e.createVNode(ze,{modelValue:e.unref(r),"onUpdate:modelValue":w[0]||(w[0]=A=>e.isRef(r)?r.value=A:null),"view-mode":e.unref(n),"onUpdate:viewMode":w[1]||(w[1]=A=>e.isRef(n)?n.value=A:null),"selected-resource":e.unref(l),"onUpdate:selectedResource":w[2]||(w[2]=A=>e.isRef(l)?l.value=A:null),"agenda-data":e.unref(c),resources:e.unref(N)},null,8,["modelValue","view-mode","selected-resource","agenda-data","resources"]),e.createElementVNode("div",ft,[e.createElementVNode("div",vt,[e.unref(N).length>0?(e.openBlock(),e.createBlock(ct,{key:0,"agenda-data":e.unref(c),"active-date":e.unref(r),"selected-resource":e.unref(l),resources:e.unref(N),onResetSelectedResource:w[3]||(w[3]=A=>l.value=null)},null,8,["agenda-data","active-date","selected-resource","resources"])):e.createCommentVNode("",!0)])])])]),_:1}))}});exports.default=gt;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";const b=require("vue"),v=require("./index-DtSvAFLL.js"),n=require("./math-emotyaF6.js"),ot=Object.assign(Object.assign({},v.ContainerDefaultConfig),{tooltip:void 0,annotations:void 0});class st extends v.ContainerCore{constructor(e,a,o){var u;super(e),this._defaultConfig=ot,this.config=this._defaultConfig,a&&(this.updateContainer(a,!0),this.component=a.component),o&&this.setData(o,!0),!((u=this.component)===null||u===void 0)&&u.datamodel.data&&this.render()}setData(e,a){var o;const{config:u}=this;this.component&&this.component.setData(e),a||this.render(),(o=u.tooltip)===null||o===void 0||o.hide()}updateContainer(e,a){super.updateContainer(e),this._removeAllChildren(),this.component=e.component,e.sizing&&(this.component.sizing=e.sizing),this.element.appendChild(this.component.element);const o=e.tooltip;o&&(o.hasContainer()||o.setContainer(this._container),o.setComponents([this.component]));const u=e.annotations;u&&this.element.appendChild(u.element),this.element.appendChild(this._svgDefs.node()),this.element.appendChild(this._svgDefsExternal.node()),a||this.render()}updateComponent(e,a){this.component.setConfig(e),a||this.render()}update(e,a,o){e&&this.updateContainer(e,!0),a&&this.updateComponent(a,!0),o&&this.setData(o,!0),this.render()}getFitWidthScale(){const{config:e,component:a}=this,o=a;if(!o.getWidth)return 1;const u=o.getWidth()+e.margin.left+e.margin.right;return this.width/u}_preRender(){var e;super._preRender(),this.component.setSize(this.width,this.height,this.containerWidth,this.containerHeight),(e=this.config.annotations)===null||e===void 0||e.setSize(this.width,this.height,this.containerWidth,this.containerHeight)}_render(e){var a;const{config:o,component:u}=this;super._render(e),u.g.attr("transform",`translate(${o.margin.left},${o.margin.top})`),u.render(e),(a=o.annotations)===null||a===void 0||a.render(e),o.tooltip&&o.tooltip.update()}render(e=this.config.duration){const{config:a,component:o}=this;if(a.sizing===v.Sizing.Extend||a.sizing===v.Sizing.FitWidth){const u=a.sizing===v.Sizing.FitWidth,d=o,l=d.getWidth()+a.margin.left+a.margin.right,t=d.getHeight()+a.margin.top+a.margin.bottom,r=u?this.getFitWidthScale():1,i=this.svg.attr("width"),y=this.svg.attr("height"),p=l*r,g=t*r,A=i||y;v.smartTransition(this.svg,A?e:0).attr("width",p).attr("height",g).attr("viewBox",`0 0 ${l} ${u?g:t}`).attr("preserveAspectRatio","xMinYMin")}else this.svg.attr("width",this.config.width||this.containerWidth).attr("height",this.config.height||this.containerHeight);this._resizeObserver||this._setUpResizeObserver(),cancelAnimationFrame(this._renderAnimationFrameId),this._renderAnimationFrameId=requestAnimationFrame(()=>{this._preRender(),this._render(e)})}_onResize(){var e;const{config:a}=this;super._onResize(),(e=a.tooltip)===null||e===void 0||e.hide()}destroy(){var e,a;const{component:o,config:u}=this;super.destroy(),o?.destroy(),(e=u.tooltip)===null||e===void 0||e.destroy(),(a=u.annotations)===null||a===void 0||a.destroy()}}function lt(c){return c.innerRadius}function rt(c){return c.outerRadius}function ut(c){return c.startAngle}function ct(c){return c.endAngle}function dt(c){return c&&c.padAngle}function gt(c,e,a,o,u,d,l,t){var r=a-c,i=o-e,y=l-u,p=t-d,g=p*r-y*i;if(!(g*g<n.epsilon))return g=(y*(e-d)-p*(c-u))/g,[c+g*r,e+g*i]}function V(c,e,a,o,u,d,l){var t=c-a,r=e-o,i=(l?d:-d)/n.sqrt(t*t+r*r),y=i*r,p=-i*t,g=c+y,A=e+p,x=a+y,S=o+p,s=(g+x)/2,T=(A+S)/2,_=x-g,w=S-A,R=_*_+w*w,k=u-d,L=g*S-x*A,z=(w<0?-1:1)*n.sqrt(n.max(0,k*k*R-L*L)),N=(L*w-_*z)/R,C=(-L*_-w*z)/R,E=(L*w+_*z)/R,D=(-L*_+w*z)/R,h=N-s,m=C-T,W=E-s,B=D-T;return h*h+m*m>W*W+B*B&&(N=E,C=D),{cx:N,cy:C,x01:-y,y01:-p,x11:N*(u/k-1),y11:C*(u/k-1)}}function ht(){var c=lt,e=rt,a=n.constant(0),o=null,u=ut,d=ct,l=dt,t=null;function r(){var i,y,p=+c.apply(this,arguments),g=+e.apply(this,arguments),A=u.apply(this,arguments)-n.halfPi,x=d.apply(this,arguments)-n.halfPi,S=n.abs(x-A),s=x>A;if(t||(t=i=n.path()),g<p&&(y=g,g=p,p=y),!(g>n.epsilon))t.moveTo(0,0);else if(S>n.tau-n.epsilon)t.moveTo(g*n.cos(A),g*n.sin(A)),t.arc(0,0,g,A,x,!s),p>n.epsilon&&(t.moveTo(p*n.cos(x),p*n.sin(x)),t.arc(0,0,p,x,A,s));else{var T=A,_=x,w=A,R=x,k=S,L=S,z=l.apply(this,arguments)/2,N=z>n.epsilon&&(o?+o.apply(this,arguments):n.sqrt(p*p+g*g)),C=n.min(n.abs(g-p)/2,+a.apply(this,arguments)),E=C,D=C,h,m;if(N>n.epsilon){var W=n.asin(N/p*n.sin(z)),B=n.asin(N/g*n.sin(z));(k-=W*2)>n.epsilon?(W*=s?1:-1,w+=W,R-=W):(k=0,w=R=(A+x)/2),(L-=B*2)>n.epsilon?(B*=s?1:-1,T+=B,_-=B):(L=0,T=_=(A+x)/2)}var H=g*n.cos(T),F=g*n.sin(T),X=p*n.cos(R),$=p*n.sin(R);if(C>n.epsilon){var M=g*n.cos(_),P=g*n.sin(_),j=p*n.cos(w),I=p*n.sin(w),G;if(S<n.pi&&(G=gt(H,F,j,I,M,P,X,$))){var q=H-G[0],U=F-G[1],f=M-G[0],O=P-G[1],Y=1/n.sin(n.acos((q*f+U*O)/(n.sqrt(q*q+U*U)*n.sqrt(f*f+O*O)))/2),K=n.sqrt(G[0]*G[0]+G[1]*G[1]);E=n.min(C,(p-K)/(Y-1)),D=n.min(C,(g-K)/(Y+1))}}L>n.epsilon?D>n.epsilon?(h=V(j,I,H,F,g,D,s),m=V(M,P,X,$,g,D,s),t.moveTo(h.cx+h.x01,h.cy+h.y01),D<C?t.arc(h.cx,h.cy,D,n.atan2(h.y01,h.x01),n.atan2(m.y01,m.x01),!s):(t.arc(h.cx,h.cy,D,n.atan2(h.y01,h.x01),n.atan2(h.y11,h.x11),!s),t.arc(0,0,g,n.atan2(h.cy+h.y11,h.cx+h.x11),n.atan2(m.cy+m.y11,m.cx+m.x11),!s),t.arc(m.cx,m.cy,D,n.atan2(m.y11,m.x11),n.atan2(m.y01,m.x01),!s))):(t.moveTo(H,F),t.arc(0,0,g,T,_,!s)):t.moveTo(H,F),!(p>n.epsilon)||!(k>n.epsilon)?t.lineTo(X,$):E>n.epsilon?(h=V(X,$,M,P,p,-E,s),m=V(H,F,j,I,p,-E,s),t.lineTo(h.cx+h.x01,h.cy+h.y01),E<C?t.arc(h.cx,h.cy,E,n.atan2(h.y01,h.x01),n.atan2(m.y01,m.x01),!s):(t.arc(h.cx,h.cy,E,n.atan2(h.y01,h.x01),n.atan2(h.y11,h.x11),!s),t.arc(0,0,p,n.atan2(h.cy+h.y11,h.cx+h.x11),n.atan2(m.cy+m.y11,m.cx+m.x11),s),t.arc(m.cx,m.cy,E,n.atan2(m.y11,m.x11),n.atan2(m.y01,m.x01),!s))):t.arc(0,0,p,R,w,s)}if(t.closePath(),i)return t=null,i+""||null}return r.centroid=function(){var i=(+c.apply(this,arguments)+ +e.apply(this,arguments))/2,y=(+u.apply(this,arguments)+ +d.apply(this,arguments))/2-n.pi/2;return[n.cos(y)*i,n.sin(y)*i]},r.innerRadius=function(i){return arguments.length?(c=typeof i=="function"?i:n.constant(+i),r):c},r.outerRadius=function(i){return arguments.length?(e=typeof i=="function"?i:n.constant(+i),r):e},r.cornerRadius=function(i){return arguments.length?(a=typeof i=="function"?i:n.constant(+i),r):a},r.padRadius=function(i){return arguments.length?(o=i==null?null:typeof i=="function"?i:n.constant(+i),r):o},r.startAngle=function(i){return arguments.length?(u=typeof i=="function"?i:n.constant(+i),r):u},r.endAngle=function(i){return arguments.length?(d=typeof i=="function"?i:n.constant(+i),r):d},r.padAngle=function(i){return arguments.length?(l=typeof i=="function"?i:n.constant(+i),r):l},r.context=function(i){return arguments.length?(t=i??null,r):t},r}function ft(c,e){return e<c?-1:e>c?1:e>=c?0:NaN}function pt(c){return c}function mt(){var c=pt,e=ft,a=null,o=n.constant(0),u=n.constant(n.tau),d=n.constant(0);function l(t){var r,i=t.length,y,p,g=0,A=new Array(i),x=new Array(i),S=+o.apply(this,arguments),s=Math.min(n.tau,Math.max(-n.tau,u.apply(this,arguments)-S)),T,_=Math.min(Math.abs(s)/i,d.apply(this,arguments)),w=_*(s<0?-1:1),R;for(r=0;r<i;++r)(R=x[A[r]=r]=+c(t[r],r,t))>0&&(g+=R);for(e!=null?A.sort(function(k,L){return e(x[k],x[L])}):a!=null&&A.sort(function(k,L){return a(t[k],t[L])}),r=0,p=g?(s-i*w)/g:0;r<i;++r,S=T)y=A[r],R=x[y],T=S+(R>0?R*p:0)+w,x[y]={data:t[y],index:r,value:R,startAngle:S,endAngle:T,padAngle:_};return x}return l.value=function(t){return arguments.length?(c=typeof t=="function"?t:n.constant(+t),l):c},l.sortValues=function(t){return arguments.length?(e=t,a=null,l):e},l.sort=function(t){return arguments.length?(a=t,e=null,l):a},l.startAngle=function(t){return arguments.length?(o=typeof t=="function"?t:n.constant(+t),l):o},l.endAngle=function(t){return arguments.length?(u=typeof t=="function"?t:n.constant(+t),l):u},l.padAngle=function(t){return arguments.length?(d=typeof t=="function"?t:n.constant(+t),l):d},l}const vt=Object.assign(Object.assign({},v.ComponentDefaultConfig),{id:(c,e)=>{var a;return(a=c.id)!==null&&a!==void 0?a:e},value:void 0,angleRange:[0,2*Math.PI],padAngle:0,sortFunction:void 0,cornerRadius:0,color:void 0,radius:void 0,arcWidth:20,centralLabel:void 0,centralSubLabel:void 0,centralSubLabelWrap:!0,showEmptySegments:!1,emptySegmentAngle:.5*Math.PI/180,showBackground:!0,backgroundAngleRange:void 0,centralLabelOffsetX:void 0,centralLabelOffsetY:void 0});function bt(c,e){c.style("fill",a=>v.getColor(a.data,e.color,a.index)).style("opacity",0).each((a,o,u)=>{const d=u[o],l=(a.startAngle+a.endAngle)/2,t=(a.endAngle-a.startAngle)/2;d._animState={startAngle:l-t,endAngle:l+t,innerRadius:a.innerRadius,outerRadius:a.outerRadius,padAngle:a.padAngle}})}function yt(c,e,a,o){c.style("transition",`fill ${o}ms`).style("fill",d=>v.getColor(d.data,e.color,d.index));const u=d=>e.showEmptySegments||d.value?1:0;o?v.smartTransition(c,o).style("opacity",u).attrTween("d",(l,t,r)=>{const i=r[t],y={startAngle:l.startAngle,endAngle:l.endAngle,innerRadius:l.innerRadius,outerRadius:l.outerRadius,padAngle:l.padAngle},p=v.interpolate(i._animState,y);return g=>(i._animState=p(g),a(i._animState))}):c.attr("d",a).style("opacity",u)}function At(c,e){v.smartTransition(c,e).style("opacity",0).remove()}const Q=Array.from({length:4},(c,e)=>{const a=-Math.PI/2+e*Math.PI/2;return[a,a+Math.PI]}),[St,kt,Ct,Tt]=Q,Z=v.css`
|
|
2
|
+
label: donut-component;
|
|
3
|
+
`,xt=v.injectGlobal`
|
|
4
|
+
:root {
|
|
5
|
+
--vis-donut-central-label-font-size: 16px;
|
|
6
|
+
--vis-donut-central-label-text-color: #5b5f6d;
|
|
7
|
+
// Undefined by default to allow proper fallback to var(--vis-font-family)
|
|
8
|
+
/* --vis-donut-central-label-font-family: */
|
|
9
|
+
--vis-donut-central-label-font-weight: 600;
|
|
10
|
+
|
|
11
|
+
--vis-donut-central-sub-label-font-size: 12px;
|
|
12
|
+
--vis-donut-central-sub-label-text-color: #5b5f6d;
|
|
13
|
+
// Undefined by default to allow proper fallback to var(--vis-font-family)
|
|
14
|
+
/* --vis-donut-central-sub-label-font-family: */
|
|
15
|
+
--vis-donut-central-sub-label-font-weight: 500;
|
|
16
|
+
|
|
17
|
+
--vis-donut-background-color: #E7E9F3;
|
|
18
|
+
--vis-donut-segment-stroke-width: 0;
|
|
19
|
+
// The line segment color variable is not defined by default
|
|
20
|
+
// to allow it to fallback to the donut background color
|
|
21
|
+
/* --vis-donut-segment-stroke-color: none; */
|
|
22
|
+
|
|
23
|
+
--vis-dark-donut-central-label-text-color: #C2BECE;
|
|
24
|
+
--vis-dark-donut-central-sub-label-text-color: #C2BECE;
|
|
25
|
+
--vis-dark-donut-background-color: #18160C;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
body.theme-dark ${`.${Z}`} {
|
|
29
|
+
--vis-donut-central-label-text-color: var(--vis-dark-donut-central-label-text-color);
|
|
30
|
+
--vis-donut-central-sub-label-text-color: var(--vis-dark-donut-central-sub-label-text-color);
|
|
31
|
+
--vis-donut-background-color: var(--vis-dark-donut-background-color);
|
|
32
|
+
}
|
|
33
|
+
`,tt=v.css`
|
|
34
|
+
label: background;
|
|
35
|
+
fill: var(--vis-donut-background-color);
|
|
36
|
+
`,J=v.css`
|
|
37
|
+
label: segment;
|
|
38
|
+
stroke-width: var(--vis-donut-segment-stroke-width);
|
|
39
|
+
stroke: var(--vis-donut-segment-stroke-color, var(--vis-donut-background-color));
|
|
40
|
+
`,nt=v.css`
|
|
41
|
+
label: segment-exit;
|
|
42
|
+
`,et=v.css`
|
|
43
|
+
label: central-label;
|
|
44
|
+
text-anchor: middle;
|
|
45
|
+
dominant-baseline: middle;
|
|
46
|
+
font-size: var(--vis-donut-central-label-font-size);
|
|
47
|
+
font-family: var(--vis-donut-central-label-font-family, var(--vis-font-family));
|
|
48
|
+
font-weight: var(--vis-donut-central-label-font-weight);
|
|
49
|
+
fill: var(--vis-donut-central-label-text-color);
|
|
50
|
+
`,at=v.css`
|
|
51
|
+
label: central-label;
|
|
52
|
+
text-anchor: middle;
|
|
53
|
+
dominant-baseline: middle;
|
|
54
|
+
font-size: var(--vis-donut-central-sub-label-font-size);
|
|
55
|
+
font-family: var(--vis-donut-central-sub-label-font-family, var(--vis-font-family));
|
|
56
|
+
font-weight: var(--vis-donut-central-sub-label-font-weight);
|
|
57
|
+
fill: var(--vis-donut-central-sub-label-text-color);
|
|
58
|
+
`,Rt=Object.freeze(Object.defineProperty({__proto__:null,background:tt,centralLabel:et,centralSubLabel:at,root:Z,segment:J,segmentExit:nt,variables:xt},Symbol.toStringTag,{value:"Module"}));class it extends v.ComponentCore{constructor(e){super(),this._defaultConfig=vt,this.config=this._defaultConfig,this.datamodel=new v.SeriesDataModel,this.arcGen=ht(),this.events={},e&&this.setConfig(e),this.arcBackground=this.g.append("path"),this.arcGroup=this.g.append("g"),this.centralLabel=this.g.append("text").attr("class",et),this.centralSubLabel=this.g.append("text").attr("class",at)}get bleed(){return{top:0,bottom:0,left:0,right:0}}_render(e){var a,o,u,d,l,t,r,i,y,p,g,A,x,S;const{config:s,datamodel:T,bleed:_}=this,w=T.data.map((f,O)=>({index:O,datum:f})).filter(f=>s.showEmptySegments||v.getNumber(f.datum,s.value,f.index)),R=v.isNumber(e)?e:s.duration,[k,L,z,N]=Q.map(f=>s.angleRange&&s.angleRange[0]===f[0]&&s.angleRange[1]===f[1]),C=k||z,E=L||N,D=this._width*(E?2:1),h=this._height*(C?2:1),m=s.radius||Math.min(D-_.left-_.right,h-_.top-_.bottom)/2,W=s.arcWidth===0?0:v.clamp(m-s.arcWidth,0,m-1),B=this._height/2+(k?m/2:z?-m/2:0),H=this._width/2+(N?m/2:L?-m/2:0),F=`translate(${H},${B})`;this.arcGroup.attr("transform",F),this.arcGen.startAngle(f=>f.startAngle).endAngle(f=>f.endAngle).innerRadius(f=>f.innerRadius).outerRadius(f=>f.outerRadius).padAngle(f=>f.padAngle).cornerRadius(s.cornerRadius);const $=mt().startAngle((o=(a=s.angleRange)===null||a===void 0?void 0:a[0])!==null&&o!==void 0?o:0).endAngle((d=(u=s.angleRange)===null||u===void 0?void 0:u[1])!==null&&d!==void 0?d:2*Math.PI).padAngle(s.padAngle).value(f=>v.getNumber(f.datum,s.value,f.index)||0).sort((f,O)=>{var Y;return(Y=s.sortFunction)===null||Y===void 0?void 0:Y.call(s,f.datum,O.datum)})(w).map(f=>{const O=Object.assign(Object.assign({},f),{data:f.data.datum,index:f.data.index,innerRadius:W,outerRadius:m});return s.showEmptySegments&&f.endAngle-f.startAngle-f.padAngle<=Number.EPSILON&&(O.endAngle=f.startAngle+Math.max(s.emptySegmentAngle,s.padAngle),O.padAngle=f.padAngle/2),O}),M=this.arcGroup.selectAll(`.${J}`).data($,f=>s.id(f.data,f.index)),P=M.enter().append("path").attr("class",J).call(bt,s),j=M.merge(P);j.call(yt,s,this.arcGen,R),j.sort((f,O)=>O.value-f.value),M.exit().attr("class",nt).call(At,R);const I=L?"start":N?"end":"middle";this.centralLabel.attr("dy",s.centralSubLabel?"-0.55em":null).style("text-anchor",I).text((l=s.centralLabel)!==null&&l!==void 0?l:null),this.centralSubLabel.attr("dy",s.centralLabel?"0.55em":null).style("text-anchor",I).text((t=s.centralSubLabel)!==null&&t!==void 0?t:null),s.centralSubLabelWrap&&v.wrapSVGText(this.centralSubLabel,W*1.9);const G=(s.centralLabelOffsetX||0)+H;let q=(s.centralLabelOffsetY||0)+B;C&&s.centralLabelOffsetX===void 0&&s.centralLabelOffsetY===void 0&&(q=(k?-this.centralSubLabel.node().getBoundingClientRect().height:z?this.centralLabel.node().getBoundingClientRect().height:0)+B);const U=`translate(${G},${q})`;this.centralLabel.attr("transform",U),this.centralSubLabel.attr("transform",U),this.arcBackground.attr("class",tt).attr("visibility",s.showBackground?null:"hidden").attr("transform",F),v.smartTransition(this.arcBackground,R).attr("d",this.arcGen({startAngle:(p=(i=(r=s.backgroundAngleRange)===null||r===void 0?void 0:r[0])!==null&&i!==void 0?i:(y=s.angleRange)===null||y===void 0?void 0:y[0])!==null&&p!==void 0?p:0,endAngle:(S=(A=(g=s.backgroundAngleRange)===null||g===void 0?void 0:g[1])!==null&&A!==void 0?A:(x=s.angleRange)===null||x===void 0?void 0:x[1])!==null&&S!==void 0?S:2*Math.PI,innerRadius:W,outerRadius:m}))}}it.selectors=Rt;const _t=b.defineComponent({__name:"index",props:{component:{},tooltip:{},annotations:{},duration:{},margin:{},padding:{},sizing:{},width:{},height:{},svgDefs:{},ariaLabel:{},data:{}},setup(c,{expose:e}){const a=c,{data:o}=b.toRefs(a),u=v.m(a);let d;const l=b.reactive({component:void 0,tooltip:void 0,annotations:void 0}),t=b.ref(),r=()=>{d||t.value&&l.component&&(d=new st(t.value,{...b.toRaw(l)},o.value))};return b.watchEffect(()=>{var i;r(),(i=l.component)==null||i.config,d?.updateContainer({...b.toRaw(u.value),...b.toRaw(l)})}),b.watch(o,()=>{d?d.setData(o.value,!0):r()}),b.onUnmounted(()=>d?.destroy()),b.provide(v.o,{data:o,update:i=>l.component=i,destroy:()=>l.component=void 0}),b.provide(v.s,{data:o,update:i=>l.tooltip=i,destroy:()=>{l.tooltip=void 0}}),b.provide(v.t,{data:o,update:i=>l.annotations=i,destroy:()=>{l.annotations=void 0}}),e({component:d}),(i,y)=>(b.openBlock(),b.createElementBlock("div",{"data-vis-single-container":"",ref_key:"elRef",ref:t,class:"unovis-single-container"},[b.renderSlot(i.$slots,"default")],512))}}),wt={"data-vis-component":""},Lt=b.defineComponent({__name:"index",props:{id:{type:Function},value:{},angleRange:{},padAngle:{},sortFunction:{type:Function},cornerRadius:{},color:{},radius:{},arcWidth:{},centralLabel:{},centralSubLabel:{},centralSubLabelWrap:{type:Boolean},showEmptySegments:{type:Boolean},emptySegmentAngle:{},showBackground:{type:Boolean},backgroundAngleRange:{},centralLabelOffsetX:{},centralLabelOffsetY:{},duration:{},events:{},attributes:{},data:{}},setup(c,{expose:e}){const a=b.inject(v.o),o=c,u=b.computed(()=>a.data.value??o.data),d=v.m(o),l=b.ref();return b.onMounted(()=>{b.nextTick(()=>{var t;l.value=new it(d.value),(t=l.value)==null||t.setData(u.value),a.update(l.value)})}),b.onUnmounted(()=>{var t;(t=l.value)==null||t.destroy(),a.destroy()}),b.watch(d,(t,r)=>{var i;v.f(t,r)||(i=l.value)==null||i.setConfig(d.value)}),b.watch(u,()=>{var t;(t=l.value)==null||t.setData(u.value)}),e({component:l}),(t,r)=>(b.openBlock(),b.createElementBlock("div",wt))}});exports.E=Lt;exports.b=_t;
|