@opengis/bi 1.2.21 → 1.2.22
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/bi.js +1 -1
- package/dist/bi.umd.cjs +1 -1
- package/dist/{import-file-D3ajRJ26.js → import-file-Cy2Zpvpw.js} +7 -7
- package/dist/{vs-funnel-bar-D7J503Ku.js → vs-funnel-bar-BYIBOhaT.js} +1 -1
- package/dist/{vs-list-CNv8F3wE.js → vs-list-D2YSJTpd.js} +1 -1
- package/dist/{vs-map-CRAC3EEz.js → vs-map-DEmnVnil.js} +2 -2
- package/dist/{vs-map-cluster-CUQatQFX.js → vs-map-cluster-Dv4ypLk9.js} +2 -2
- package/dist/{vs-number-CPLhX6h9.js → vs-number-DXMmIAu0.js} +1 -1
- package/dist/{vs-table-DOGK5wps.js → vs-table-C5I59PQW.js} +1 -1
- package/dist/{vs-text-BhtRju6H.js → vs-text-qF7xeWu5.js} +1 -1
- package/package.json +1 -1
package/dist/bi.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { j as o, R as V, U as t, V as e, r as i, v as P, l as d, p as g, k as l, q as n, o as p, n as B, s as E } from "./import-file-
|
|
1
|
+
import { j as o, R as V, U as t, V as e, r as i, v as P, l as d, p as g, k as l, q as n, o as p, n as B, s as E } from "./import-file-Cy2Zpvpw.js";
|
|
2
2
|
import "vue";
|
|
3
3
|
export {
|
|
4
4
|
o as EditorRootPage,
|
package/dist/bi.umd.cjs
CHANGED
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
*
|
|
104
104
|
* This source code is licensed under the ISC license.
|
|
105
105
|
* See the LICENSE file in the root directory of this source tree.
|
|
106
|
-
*/const He=M("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Be={week:"Тиждень",month:"Місяць",quarter:"Квартал",year:"Рік"},ks=["onClick"],ws={class:"flex items-center justify-between w-full"},_s={key:0},$s=e.defineComponent({__name:"vs-bi-dropdown",props:{title:{},options:{},value:{default:null}},emits:["selected"],setup(s,{emit:t}){const r=s,n=t,o=e.ref(!1),l=e.ref(r.value??null),a=e.ref(null),i=e.computed(()=>{const f=r.options;return typeof f=="string"?f.split(",").map((m,x)=>({id:x,text:m.trim()})):Array.isArray(f)?f:[]}),c=e.computed(()=>{const f=i.value.find(m=>(m.id??m)===l.value);return f?f.text??String(f):r.title??""}),p=f=>{const m=(f==null?void 0:f.id)??f;l.value=m,o.value=!1,n("selected",m),document.removeEventListener("click",d)},d=f=>{a.value&&!a.value.contains(f.target)&&(o.value=!1,document.removeEventListener("click",d))},h=()=>{o.value=!o.value,o.value?setTimeout(()=>{document.addEventListener("click",d)},200):document.removeEventListener("click",d)},g=f=>(Be==null?void 0:Be[f])??f;return e.onUnmounted(()=>{document.removeEventListener("click",d)}),(f,m)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("button",{type:"button","aria-expanded":"true",class:"hs-select-disabled:pointer-events-none hs-select-disabled:opacity-50 relative group pr-2 -ms-2 py-1.5 pl-2.5 inline-flex shrink-0 justify-center items-center gap-x-1.5 text-sm text-gray-800 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100 before:absolute before:inset-0 before:z-[1] dark:text-neutral-400 dark:hover:bg-neutral-800 dark:focus:bg-neutral-700",onClick:h},[e.createTextVNode(e.toDisplayString(g(c.value))+" ",1),m[0]||(m[0]=e.createElementVNode("svg",{class:"shrink-0 size-3.5 text-gray-600 dark:text-neutral-400",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"m6 9 6 6 6-6"})],-1))]),o.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"biDropdown",ref:a,"data-hs-select-dropdown":"",class:"absolute mt-2 z-50 w-48 p-1 space-y-0.5 bg-white rounded-xl shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] dark:bg-neutral-950 opened",role:"listbox",tabindex:"-1","aria-orientation":"vertical",style:{"margin-top":"10px"}},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,x=>(e.openBlock(),e.createElementBlock("div",{key:x.id||x,class:"cursor-pointer selected hs-selected:bg-gray-100 dark:hs-selected:bg-neutral-800 py-1.5 px-2 w-full text-[13px] text-gray-800 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:k=>p(x)},[e.createElementVNode("div",ws,[e.createElementVNode("span",null,e.toDisplayString(g(x.text||x)),1),l.value===(x.id||x)?(e.openBlock(),e.createElementBlock("span",_s,m[1]||(m[1]=[e.createElementVNode("svg",{class:"shrink-0 h-3.5 w-3.5 text-gray-800 dark:text-neutral-200",xmlns:"http:.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("polyline",{points:"20 6 9 17 4 12"})],-1)]))):e.createCommentVNode("",!0)])],8,ks))),128))],512)):e.createCommentVNode("",!0)],64))}}),Vs={class:"flex items-center space-x-2"},Es=e.defineComponent({__name:"vs-bi-switch",props:e.mergeModels({leftLabel:{},rightLabel:{},modelValue:{type:Boolean}},{modelValue:{default:()=>!1,type:Boolean},modelModifiers:{}}),emits:e.mergeModels(["update:is-enabled"],["update:modelValue"]),setup(s,{emit:t}){const r=t,n=e.useModel(s,"modelValue"),o=()=>{r("update:is-enabled",n)};return(l,a)=>(e.openBlock(),e.createElementBlock("div",Vs,[l.leftLabel?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["transition-colors",{"text-blue-500":!n.value}])},e.toDisplayString(l.leftLabel),3)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":a[0]||(a[0]=i=>n.value=i),type:"checkbox",class:"relative w-11 h-6 p-px bg-gray-100 border-transparent text-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:ring-blue-600 disabled:opacity-50 disabled:pointer-events-none checked:bg-none checked:text-blue-600 checked:border-blue-600 focus:checked:border-blue-600 dark:bg-neutral-800 dark:border-neutral-700 dark:checked:bg-blue-500 dark:checked:border-blue-500 dark:focus:ring-offset-gray-600 before:inline-block before:size-5 before:bg-white checked:before:bg-blue-200 before:translate-x-0 checked:before:translate-x-full before:rounded-full before:shadow before:h-5 before:w-5 before:transform before:ring-0 before:transition before:ease-in-out before:duration-200 dark:before:bg-neutral-400 dark:checked:before:bg-blue-200",onChange:o},null,544),[[e.vModelCheckbox,n.value]]),l.rightLabel?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["transition-colors",{"text-blue-500":n.value}])},e.toDisplayString(l.rightLabel),3)):e.createCommentVNode("",!0)]))}}),D=(s,t)=>{const r=s.__vccOpts||s;for(const[n,o]of t)r[n]=o;return r},Bs={},Cs={class:"flex items-center justify-center h-full"};function Ds(s,t){return e.openBlock(),e.createElementBlock("div",Cs,t[0]||(t[0]=[e.createElementVNode("div",{class:"text-center text-gray-500"},[e.createElementVNode("h2",{class:"text-2xl font-bold"},"No data available")],-1)]))}const Ns=D(Bs,[["render",Ds]]),Ge={"bi-bar":e.defineAsyncComponent(()=>Promise.resolve().then(()=>Co)),"bi-number":e.defineAsyncComponent(()=>Promise.resolve().then(()=>Oa)),"bi-text":e.defineAsyncComponent(()=>Promise.resolve().then(()=>va)),"bi-listbar":e.defineAsyncComponent(()=>Promise.resolve().then(()=>ka)),"bi-pie":e.defineAsyncComponent(()=>Promise.resolve().then(()=>Mo)),"bi-donut":e.defineAsyncComponent(()=>Promise.resolve().then(()=>zo)),"bi-line":e.defineAsyncComponent(()=>Promise.resolve().then(()=>Ao)),"bi-stat":e.defineAsyncComponent(()=>Promise.resolve().then(()=>ea)),"bi-pivot":e.defineAsyncComponent(()=>Promise.resolve().then(()=>Pa)),"bi-progress":e.defineAsyncComponent(()=>Promise.resolve().then(()=>ha)),"bi-funnel":e.defineAsyncComponent(()=>Promise.resolve().then(()=>Qa)),"bi-map":e.defineAsyncComponent(()=>Promise.resolve().then(()=>Gl)),"bi-cluster":e.defineAsyncComponent(()=>Promise.resolve().then(()=>mi)),"bi-table":e.defineAsyncComponent(()=>Promise.resolve().then(()=>Bi))};let Ze="/api";function ge(s){Ze=s||"/api"}function Ss(s,t){const r=Ze.replace(/\/$/,""),o=s.startsWith("http")||s.startsWith("//")||r&&s.startsWith(r)?s:`${r}${s.startsWith("/")?s:`/${s}`}`;if(!t||!Object.keys(t).length)return o;const l=new URLSearchParams;Object.entries(t).forEach(([i,c])=>{c!==void 0&&c!==""&&l.set(i,String(c))});const a=l.toString();return a?`${o}${o.includes("?")?"&":"?"}${a}`:o}async function be(s,t={}){const{params:r,...n}=t,o=Ss(s,r),l=await fetch(o,{...n,headers:{"Content-Type":"application/json",...n.headers}});if(!l.ok){const i=new Error(l.statusText);throw i.status=l.status,i}const a=await l.text();if(a)try{return JSON.parse(a)}catch{return a}}const T={get(s,t){return be(s,{...t,method:"GET"})},post(s,t){return be(s,{method:"POST",body:t!=null?JSON.stringify(t):void 0})},put(s,t){return be(s,{method:"PUT",body:t!=null?JSON.stringify(t):void 0})},delete(s){return be(s,{method:"DELETE"})}},zs={key:0,class:"text-[16px] flex max-w-full items-center min-h-0 justify-between max-h-[50px] h-fit shrink-0"},Ls={class:"flex items-center justify-between w-full gap-2"},Ts={class:"flex items-center gap-2 min-w-0"},Is={class:"text-gray-800 max-h-[30px] inline-block line-clamp-1 font-semibold"},Ms={class:"flex flex-col justify-end"},Ps={key:0,class:"flex items-center justify-end w-full gap-2"},Rs={class:"w-full h-full"},re=e.defineComponent({__name:"vs-widget",props:{dashboard:{},prefix:{default:""},widget:{},filterURl:{},dashboardWidgets:{},selectedWidget:{}},emits:["update:current-widget-data"],setup(s,{emit:t}){const r=s,n=t,o=e.ref(null),l=e.ref(null),a=e.ref(null),i=e.ref({}),c=e.ref([]),p=e.computed(()=>{var y,b;const u=(y=r.dashboardWidgets)==null?void 0:y.find(_=>_.name===r.widget);return((b=u==null?void 0:u.data)==null?void 0:b.title)??(u==null?void 0:u.title)??""}),d=e.computed(()=>{var y;const u=(y=r.dashboardWidgets)==null?void 0:y.find(b=>b.name===r.widget);return(u==null?void 0:u.type)??"text"}),h=e.computed(()=>{var y;const u=(y=i.value)==null?void 0:y.controls;return!u||typeof u=="boolean"?[]:Object.keys(u).map(b=>({name:b,options:u[b]}))}),g=e.computed(()=>{const u=d.value?`bi-${d.value}`:"";return u&&u in Ge?Ge[u]:null});function f(u,y){var b,_;(_=(b=l.value)==null?void 0:b.changeStyle)==null||_.call(b,u,y)}function m(u,y){const b=c.value.find(_=>_.name===y);b?b.option=u:c.value.push({name:y,option:u}),x()}function x(){var y,b;let u=`/bi-data?dashboard=${r.dashboard}&widget=${r.widget}`;c.value.forEach(_=>{u+=`&${_.name}=${_.option}`}),(b=(y=l.value)==null?void 0:y.getDataFromURL)==null||b.call(y,u)}function k(){const u=a.value;if(u!=null&&u.getDataURL){const y=u.getDataURL({type:"png",pixelRatio:2,backgroundColor:"#ffffff"}),b=document.createElement("a");b.href=y,b.download="chart.png",document.body.appendChild(b),b.click(),document.body.removeChild(b)}}return e.onMounted(()=>{r.prefix&&ge(r.prefix)}),e.watch(()=>r.filterURl,u=>{var y,b;u&&((b=(y=l.value)==null?void 0:y.setFilter)==null||b.call(y,u))}),e.watch(()=>r.selectedWidget,(u,y)=>{var b;u!==y&&u===((b=i.value)==null?void 0:b.id)&&n("update:current-widget-data",i.value)}),e.watch(i,(u,y)=>{if((u==null?void 0:u.id)===(y==null?void 0:y.id))return;const b=typeof window<"u"?new URLSearchParams(window.top.location.search).get("widget"):null;b&&b===(u==null?void 0:u.id)&&n("update:current-widget-data",u)},{deep:!0}),(u,y)=>{var b,_,$,w,L,P,F,q,U;return e.openBlock(),e.createElementBlock("div",{ref_key:"widgetRef",ref:o,class:e.normalizeClass(["box-border relative h-full p-4 bg-white border border-gray-200 rounded-xl shadow-sm select-auto",[(_=(b=i.value)==null?void 0:b.style)!=null&&_.height?`max-h-[${(w=($=i.value)==null?void 0:$.style)==null?void 0:w.height}px] h-[${(P=(L=i.value)==null?void 0:L.style)==null?void 0:P.height}px]`:"max-h-[460px]"]])},[["text","cluster","map"].includes(d.value)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",zs,[e.createElementVNode("div",Ls,[e.createElementVNode("div",Ts,[e.createElementVNode("span",Is,e.toDisplayString(p.value),1)]),e.createElementVNode("div",Ms,[(F=h.value)!=null&&F.length?(e.openBlock(),e.createElementBlock("span",Ps,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((q=h.value)==null?void 0:q.filter(V=>(V==null?void 0:V.options)&&(V==null?void 0:V.name)!=="export"),V=>{var v,Z;return e.openBlock(),e.createElementBlock("div",{key:V==null?void 0:V.name},[Array.isArray(V==null?void 0:V.options)?(e.openBlock(),e.createBlock($s,{key:0,title:V==null?void 0:V.name,options:V==null?void 0:V.options,value:((Z=(v=i.value)==null?void 0:v.data)==null?void 0:Z[V==null?void 0:V.name])??null,onSelected:G=>m(G,V==null?void 0:V.name)},null,8,["title","options","value","onSelected"])):typeof V.options=="boolean"?(e.openBlock(),e.createBlock(Es,{key:1,"left-label":V==null?void 0:V.name,"model-value":!!(V!=null&&V.options),"onUpdate:isEnabled":G=>f(V==null?void 0:V.name,G)},null,8,["left-label","model-value","onUpdate:isEnabled"])):e.createCommentVNode("",!0)])}),128)),(U=h.value)!=null&&U.some(V=>(V==null?void 0:V.name)==="export")?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"h-[32px] w-[32px] rounded-lg hover:bg-gray-100 duration-100 flex items-center justify-center",onClick:k},[e.createVNode(e.unref(as),{size:16,class:"text-gray-800"})])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])])])),e.createElementVNode("div",Rs,[g.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(g.value),{key:0,ref_key:"chartRef",ref:l,"current-widget":a.value,"onUpdate:currentWidget":y[0]||(y[0]=V=>a.value=V),"widget-data":i.value,"onUpdate:widgetData":y[1]||(y[1]=V=>i.value=V),dashboard:u.dashboard,title:p.value,widget:u.widget},null,40,["current-widget","widget-data","dashboard","title","widget"])):(e.openBlock(),e.createBlock(Ns,{key:1,class:"w-full h-full"}))])],2)}}}),Fs={class:"w-full overflow-hidden rounded vs-table-interface__table-wrp h-fit"},As={class:"p-5 min-h-[500px] flex flex-col justify-center items-center text-center"},Os={class:"max-w-sm mx-auto mt-6"},js={class:"font-medium text-gray-800 dark:text-neutral-200"},Ws={class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"},ye=e.defineComponent({__name:"vs-new-nodata",props:{title:{default:"Дані для відображення відсутні"},text:{default:"Змініть параметри пошуку або спробуйте пізніше"}},setup(s){return(t,r)=>(e.openBlock(),e.createElementBlock("div",Fs,[e.createElementVNode("div",null,[e.createElementVNode("div",As,[r[0]||(r[0]=e.createStaticVNode('<svg class="w-48 mx-auto" viewBox="0 0 178 90" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs></svg>',1)),e.createElementVNode("div",Os,[e.createElementVNode("p",js,e.toDisplayString(t.title),1),e.createElementVNode("p",Ws,e.toDisplayString(t.text),1)])])])]))}}),qs={components:{filterIcon:{__name:"filter",setup(s){return(t,r)=>(e.openBlock(),e.createBlock(e.unref(is),e.mergeProps(t.$attrs,{size:24}),null,16))}}},props:["filterScheme"],emits:["filters:changed"]},Us={class:"flex items-center"},vs={key:0,type:"button",class:"py-2 px-2.5 ml-3 h-[38px] inline-flex items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 opacity-60 cursor-not-allowed",disabled:"",title:"Фільтри вимкнено (v3-filter видалено)"};function Hs(s,t,r,n,o,l){const a=e.resolveComponent("filterIcon");return e.openBlock(),e.createElementBlock("div",Us,[r.filterScheme?(e.openBlock(),e.createElementBlock("button",vs,[e.createVNode(a),t[0]||(t[0]=e.createTextVNode(" Фільтри "))])):e.createCommentVNode("",!0)])}const Gs={components:{VsFilterHeader:D(qs,[["render",Hs]])},props:{dashboardData:{type:Object,default:null},filters:{type:Array,default:null}}},Zs={class:"bg-white px-5 flex gap-4 h-[90px] border border-gray-200 rounded-xl mb-2 pt-[3px] justify-between items-center"},Qs={class:"grow"},Xs={class:"text-lg font-semibold text-stone-800 dark:text-neutral-200"},Js={key:0,class:"inline-flex items-center text-sm gap-x-2 text-stone-800 hover:text-stone-500 focus:outline-none focus:text-stone-500 dark:text-neutral-200 dark:hover:text-neutral-400 dark:focus:text-neutral-400"},Ks={key:0,class:"flex items-center gap-3"};function Ys(s,t,r,n,o,l){var i,c,p;const a=e.resolveComponent("VsFilterHeader");return e.openBlock(),e.createElementBlock("div",Zs,[e.createElementVNode("div",Qs,[e.createElementVNode("h1",Xs,e.toDisplayString((i=r.dashboardData)==null?void 0:i.title),1),(c=r.dashboardData)!=null&&c.description?(e.openBlock(),e.createElementBlock("button",Js,e.toDisplayString((p=r.dashboardData)==null?void 0:p.description),1)):e.createCommentVNode("",!0)]),r.filters?(e.openBlock(),e.createElementBlock("div",Ks,[e.createVNode(a,{filterScheme:r.filters,"onFilters:changed":t[0]||(t[0]=d=>s.$emit("filters:changed",d))},null,8,["filterScheme"])])):e.createCommentVNode("",!0)])}const er=D(Gs,[["render",Ys]]);var Qe={},Xe;(function(s){s.pop="pop",s.push="push"})(Xe||(Xe={}));var Je;(function(s){s.back="back",s.forward="forward",s.unknown=""})(Je||(Je={}));var Ke;(function(s){s[s.aborted=4]="aborted",s[s.cancelled=8]="cancelled",s[s.duplicated=16]="duplicated"})(Ke||(Ke={}));const tr=Symbol(Qe.NODE_ENV!=="production"?"router":""),sr=Symbol(Qe.NODE_ENV!=="production"?"route location":"");function Ce(){return e.inject(tr)}function rr(s){return e.inject(sr)}const nr={key:0,class:"text-gray-400 shrink-0"},or=["onClick"],ar=["onClick"],lr={key:4,class:"text-gray-900 font-medium truncate"},Ye={__name:"vs-breadcrumbs",props:{items:{type:Array,default:()=>[]},compact:{type:Boolean,default:!1}},setup(s){const t=s,r=Ce(),n=e.computed(()=>Array.isArray(t.items)?t.items:[]);function o(l){r!=null&&r.push?r.push(l):typeof l=="string"&&(window!=null&&window.location)&&(window.location.href=l)}return(l,a)=>{const i=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("nav",{class:e.normalizeClass(["flex items-center gap-2 text-sm text-gray-600",s.compact?"py-1":"py-6"]),"aria-label":"Breadcrumb"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(c,p)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:p},[p>0?(e.openBlock(),e.createElementBlock("span",nr,[e.createVNode(e.unref(os),{class:"w-4 h-4"})])):e.createCommentVNode("",!0),typeof c.onClick=="function"?(e.openBlock(),e.createElementBlock("span",{key:1,class:"hover:text-gray-900 transition-colors cursor-pointer",onClick:d=>c.onClick()},e.toDisplayString(c.label),9,or)):e.unref(r)&&c.to?(e.openBlock(),e.createBlock(i,{key:2,to:c.to,class:"hover:text-gray-900 transition-colors"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.label),1)]),_:2},1032,["to"])):c.to?(e.openBlock(),e.createElementBlock("span",{key:3,class:"hover:text-gray-900 transition-colors cursor-pointer",onClick:d=>o(c.to)},e.toDisplayString(c.label),9,ar)):(e.openBlock(),e.createElementBlock("span",lr,e.toDisplayString(c.label),1))],64))),128))],2)}}},ir={components:{VsWidget:re,VsNewNodata:ye,VsHeader:er,VsBreadcrumbs:Ye},props:["id","prefix"],data(){return{widgets:[],panels:[],error:!1,selectedPanel:"",filterURl:null,dashboardData:null}},async mounted(){ge(this.prefix||"/api"),await this.fetchData()},methods:{async fetchData(){if(this.id)try{const s=await T.get(`/bi-dashboard/${this.id}`);this.dashboardData=s}catch(s){console.error(s)}},columnClass(s){const t=s!=null&&s.col?s==null?void 0:s.col:12;return{1:"md:w-1/12 sm:w-full",2:"md:w-1/6 sm:w-full",3:"md:w-1/4 sm:w-full",4:"md:w-1/3 sm:w-full",6:"md:w-1/2 sm:w-full",8:"md:w-2/3 sm:w-full",10:"md:w-5/6 sm:w-full",12:"w-full"}[t]||"w-full"},async filterHandler(s){var r;this.filterURl="";let t="&filter=";(r=s==null?void 0:s.url)!=null&&r.length&&(s.url.split("|").forEach(o=>{const l=o.split("=");t+=`${l[0]}=${l[1]}`}),this.filterURl+=t)}}},cr={class:"w-full pb-8 overflow-y-auto mx-auto"},dr={class:"grid flex-grow w-full grid-cols-12 gap-4 h-fit"};function pr(s,t,r,n,o,l){var c;const a=e.resolveComponent("VsNewNodata"),i=e.resolveComponent("VsWidget");return e.openBlock(),e.createElementBlock("div",cr,[e.createElementVNode("div",dr,[o.error||!o.dashboardData?(e.openBlock(),e.createBlock(a,{key:0,class:"col-span-12"})):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(((c=o.dashboardData)==null?void 0:c.panels)||[],(p,d)=>{var h;return e.openBlock(),e.createElementBlock("div",{key:d,class:e.normalizeClass([`col-span-${p.col||12}`,"flex flex-col gap-[10px]"])},[(h=p.widgets)!=null&&h.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(p.widgets,g=>(e.openBlock(),e.createBlock(i,{key:g,dashboard:r.id,widget:g,"dashboard-widgets":o.dashboardData.widgets,"filter-u-rl":o.filterURl},null,8,["dashboard","widget","dashboard-widgets","filter-u-rl"]))),128)):(e.openBlock(),e.createBlock(i,{key:1,class:"flex flex-col",dashboard:r.id,widget:p.widget,"dashboard-widgets":o.dashboardData.widgets,"filter-u-rl":o.filterURl},null,8,["dashboard","widget","dashboard-widgets","filter-u-rl"]))],2)}),128))])])}const hr=D(ir,[["render",pr]]),mr={key:0,class:"vs-modal-wrapper fixed inset-0 flex items-center justify-center p-4"},ur={class:"flex items-center justify-between shrink-0 py-2.5 px-4 border-b border-gray-200 dark:border-[#454545]"},fr={class:"font-medium text-gray-800 dark:text-white"},gr={class:"vs-modal-content flex-1 min-h-0 overflow-auto p-4"},br={key:0,class:"shrink-0 border-t border-gray-200 dark:border-neutral-700"},ne=D({__name:"vs-modal",props:{visible:{type:Boolean,default:!1},title:{type:String,default:""},size:{type:String,default:"medium"},closeClickBack:{type:Boolean,default:!1},teleport:{type:String,default:"#modal"}},emits:["close","update:visible"],setup(s,{emit:t}){const r=s,n=t,o=e.computed(()=>r.size==="small"?"md:max-w-[40%] w-full max-w-md":r.size==="lg"?"md:max-w-[70%] w-full max-w-4xl":"md:max-w-[50%] w-full max-w-lg");function l(){n("update:visible",!1),n("close")}function a(i){i.key==="Escape"&&l()}return e.onMounted(()=>{window.addEventListener("keydown",a)}),e.onUnmounted(()=>{window.removeEventListener("keydown",a)}),(i,c)=>(e.openBlock(),e.createBlock(e.Teleport,{to:s.teleport},[s.visible?(e.openBlock(),e.createElementBlock("div",mr,[e.createElementVNode("div",{class:"absolute inset-0 bg-black/50","aria-hidden":"true",onMousedown:c[0]||(c[0]=p=>s.closeClickBack&&p.target===p.currentTarget&&l())},null,32),e.createVNode(e.Transition,{name:"vs-modal",appear:""},{default:e.withCtx(()=>[s.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["vs-modal-panel relative flex flex-col bg-white dark:bg-[#1A1A1A] rounded-xl shadow-xl max-h-[85vh] min-w-0 border border-gray-200 dark:border-[#454545]",o.value]),role:"dialog","aria-modal":"true",onMousedown:c[1]||(c[1]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",ur,[e.createElementVNode("h3",fr,e.toDisplayString(s.title),1),e.createElementVNode("button",{type:"button",class:"size-8 inline-flex justify-center items-center rounded-full bg-gray-100 text-gray-800 hover:bg-gray-200 dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-300","aria-label":"Закрити",onClick:l},c[2]||(c[2]=[e.createElementVNode("svg",{class:"w-4 h-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),e.createElementVNode("div",gr,[e.renderSlot(i.$slots,"default",{},void 0,!0)]),i.$slots.footer?(e.openBlock(),e.createElementBlock("div",br,[e.renderSlot(i.$slots,"footer",{},void 0,!0)])):e.createCommentVNode("",!0)],34)):e.createCommentVNode("",!0)]),_:3})])):e.createCommentVNode("",!0)],8,["to"]))}},[["__scopeId","data-v-5722a50f"]]),yr={__name:"icon-plus",setup(s){return(t,r)=>(e.openBlock(),e.createBlock(e.unref(ve),e.mergeProps(t.$attrs,{size:24}),null,16))}},xr={class:"mb-4 overflow-auto scrollbar max-h-96"},kr={__name:"vs-editor-create-widget",props:{columns:{type:Array,default:()=>[]},selectedDashboard:String,inline:{type:Boolean,default:!1}},emits:"update-data",setup(s,{expose:t,emit:r}){var m;const n=e.defineAsyncComponent(()=>import("@opengis/form")),o=(m=e.getCurrentInstance().proxy)==null?void 0:m.$notify,l=r,a=s,i=e.ref(!1),c=e.ref({}),p=e.ref();function d(){i.value=!0}function h(){i.value=!1}t({open:d,close:h});const g=async()=>{try{await p.value.doValidation(),await T.post(`/bi-dashboard/${a.selectedDashboard}`,c.value),await o({type:"success",title:"Успішно!",message:"Віджет успішно створено"}),await l("update-data"),c.value={},i.value=!1}catch{o({type:"error",title:"Помилка!",message:"При спробі створити віджет сталася помилка"})}},f=e.computed(()=>{var x,k,u,y;return{title:{type:"text",label:"Widget title",placeholder:"Widget title",validators:["required"]},x:{type:"select",label:"X Axis",view:"buttons",style:{size:"xs"},validators:["required"],options:(k=(x=a.columns)==null?void 0:x.filter(b=>(b==null?void 0:b.type)=="text"||(b==null?void 0:b.type)==="date"||(b==null?void 0:b.type)==="timestamp without time zone"||(b==null?void 0:b.type)==="boolean"||(b==null?void 0:b.type)==="integer"))==null?void 0:k.map(({name:b,type:_})=>({id:b,text:b,type:_}))},metric:{type:"select",label:"Y Axis",view:"buttons",validators:["required"],style:{size:"xs"},options:[{id:"count",label:"count"},...(y=(u=a.columns)==null?void 0:u.filter(b=>(b==null?void 0:b.type)==="numeric"||(b==null?void 0:b.type)==="double precision"))==null?void 0:y.map(({name:b,type:_})=>({id:b,text:b,type:_}))]},col:{type:"select",label:"Columns count",validators:["required"],options:[{id:1,label:1},{id:2,text:2},{id:3,text:3},{id:4,text:4},{id:6,text:6},{id:9,text:9},{id:12,text:12}]},type:{type:"select",view:"buttons",label:"Type",validators:["required"],options:[{label:"Bar",id:"bar"},{label:"Funnel",id:"funnel"},{label:"Line",id:"line"},{label:"List bar",id:"listbar"},{label:"Number",id:"number"},{label:"Pie",id:"pie"},{label:"Donut",id:"donut"},{label:"Pivot",id:"pivot"},{label:"Table",id:"table"},{label:"Progress",id:"progress"},{label:"Stat",id:"stat"},{label:"Text",id:"text"},{label:"Map",id:"map"}]},table:{type:"Text",ua:"Table",placeholder:"Table"},query:{type:"Text",ua:"Query",placeholder:"Query"},cls:{type:"Text",ua:"Cls",placeholder:"Cls"}}});return(x,k)=>{const u=e.resolveComponent("VsPopover");return e.openBlock(),e.createElementBlock("div",null,[s.inline?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(u,{key:0,placement:"right",trigger:"hover"},{reference:e.withCtx(()=>[e.createElementVNode("div",null,[e.createElementVNode("button",{class:"z-50 flex items-center justify-center h-[50px] !w-[50px] text-2xl text-white transition-colors bg-blue-500 rounded-full cursor-pointer hover:bg-blue-700",onClick:d},[e.createVNode(yr,{height:"20",width:"20"})])])]),default:e.withCtx(()=>[k[1]||(k[1]=e.createTextVNode(" Створити віджет "))]),_:1})),e.createVNode(ne,{teleport:"#modal",visible:i.value,title:"Створити віджет",onClose:h},{footer:e.withCtx(()=>[e.createElementVNode("div",{class:"flex justify-end p-[20px] gap-[10px] border-t w-full"},[e.createElementVNode("button",{style:{border:"1px solid #000"},onClick:h,class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border-gray-200 rounded-lg !border-gray-200 hover:bg-gray-100 duration-300"}," Скасувати "),e.createElementVNode("button",{onClick:g,class:"py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"}," Створити ")])]),default:e.withCtx(()=>[e.createElementVNode("div",xr,[e.createVNode(e.unref(n),{ref_key:"form",ref:p,schema:f.value,values:c.value,"onUpdate:values":k[0]||(k[0]=y=>c.value=y)},null,8,["schema","values"])])]),_:1},8,["visible"])])}}},et={__name:"delete",setup(s){return(t,r)=>(e.openBlock(),e.createBlock(e.unref(xs),e.mergeProps(t.$attrs,{size:24}),null,16))}},De={__name:"close",setup(s){return(t,r)=>(e.openBlock(),e.createBlock(e.unref(He),e.mergeProps(t.$attrs,{size:24}),null,16))}},tt={__name:"edit",setup(s){return(t,r)=>(e.openBlock(),e.createBlock(e.unref(fs),e.mergeProps(t.$attrs,{size:24}),null,16))}},wr={class:"space-y-4"},_r={__name:"vs-editor-form-style",props:{widgetName:{type:String},data:{type:Object,default:()=>{}}},setup(s,{expose:t}){var m,x,k,u,y,b;const r=e.defineAsyncComponent(()=>import("@opengis/form")),{$notify:n}=e.getCurrentInstance().proxy,o=s,l=e.ref(null),a={show:{label:"Label",type:"switcher",title:"Show label"},rotate:{type:"number",label:"Rotate angel",conditions:["show","==",!0]},align:{type:"select",view:"buttons",label:"Align",conditions:["show","==",!0],options:[{id:"center",text:"Center"},{id:"left",text:"Left"},{id:"right",text:"Right"}]},position:{type:"select",label:"Position",conditions:["show","==",!0],options:[{id:"top",text:"Top"},{id:"right",text:"Right"},{id:"left",text:"Left"},{id:"bottom",text:"Bottom"}]}},i={show:{label:"Legend",type:"switcher",title:"Show legend"}},c={show:{label:"Tooltip ",type:"switcher",title:"Show tooltip"}},p=e.ref({...((x=(m=o.data)==null?void 0:m.style)==null?void 0:x.label)||{}}),d=e.ref({...((u=(k=o.data)==null?void 0:k.style)==null?void 0:u.legend)||{}}),h=e.ref({...((b=(y=o.data)==null?void 0:y.style)==null?void 0:b.tooltip)||{}}),g=()=>{const _=new CustomEvent(`update-style-${o.widgetName}`);_.chartId=o.widgetName,_.options={options:{legend:d.value,tooltip:h.value,label:p.value},seriesOptions:p.value},window.dispatchEvent(_)};e.watch(p,g,{deep:!0}),e.watch(d,g,{deep:!0}),e.watch(h,g,{deep:!0});const f=async()=>{try{await T.put(`/bi-dashboard/${l.value}/${o.widgetName}`,{style:{legend:d.value,tooltip:h.value,label:p.value}});const _=new CustomEvent(`update-style-${o.widgetName}`);_.chartId=o.widgetName,_.options={options:{legend:d.value,tooltip:h.value,label:p.value},seriesOptions:p.value},window.dispatchEvent(_),n({type:"success",title:"Успішно!",message:"Дані успішно оновлено"})}catch{n({type:"error",title:"Помилка!",message:"При спробі оновити данні сталася помилка"})}};return e.onMounted(()=>{const _=new URLSearchParams(window.top.location.search);l.value=_.get("dashboard")}),t({requestUpdateWidget:f}),(_,$)=>(e.openBlock(),e.createElementBlock("div",wr,[e.createVNode(e.unref(r),{schema:a,values:p.value,"onUpdate:values":$[0]||($[0]=w=>p.value=w),class:"p-0"},null,8,["values"]),e.createVNode(e.unref(r),{schema:i,values:d.value,"onUpdate:values":$[1]||($[1]=w=>d.value=w),class:"p-0"},null,8,["values"]),e.createVNode(e.unref(r),{schema:c,values:h.value,"onUpdate:values":$[2]||($[2]=w=>h.value=w),class:"p-0"},null,8,["values"])]))}};function Ne(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let J=Ne();function st(s){J=s}const rt=/[&<>"']/,$r=new RegExp(rt.source,"g"),nt=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Vr=new RegExp(nt.source,"g"),Er={"&":"&","<":"<",">":">",'"':""","'":"'"},ot=s=>Er[s];function A(s,t){if(t){if(rt.test(s))return s.replace($r,ot)}else if(nt.test(s))return s.replace(Vr,ot);return s}const Br=/(^|[^\[])\^/g;function N(s,t){let r=typeof s=="string"?s:s.source;t=t||"";const n={replace:(o,l)=>{let a=typeof l=="string"?l:l.source;return a=a.replace(Br,"$1"),r=r.replace(o,a),n},getRegex:()=>new RegExp(r,t)};return n}function at(s){try{s=encodeURI(s).replace(/%25/g,"%")}catch{return null}return s}const oe={exec:()=>null};function lt(s,t){const r=s.replace(/\|/g,(l,a,i)=>{let c=!1,p=a;for(;--p>=0&&i[p]==="\\";)c=!c;return c?"|":" |"}),n=r.split(/ \|/);let o=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;o<n.length;o++)n[o]=n[o].trim().replace(/\\\|/g,"|");return n}function ae(s,t,r){const n=s.length;if(n===0)return"";let o=0;for(;o<n&&s.charAt(n-o-1)===t;)o++;return s.slice(0,n-o)}function Cr(s,t){if(s.indexOf(t[1])===-1)return-1;let r=0;for(let n=0;n<s.length;n++)if(s[n]==="\\")n++;else if(s[n]===t[0])r++;else if(s[n]===t[1]&&(r--,r<0))return n;return-1}function it(s,t,r,n){const o=t.href,l=t.title?A(t.title):null,a=s[1].replace(/\\([\[\]])/g,"$1");if(s[0].charAt(0)!=="!"){n.state.inLink=!0;const i={type:"link",raw:r,href:o,title:l,text:a,tokens:n.inlineTokens(a)};return n.state.inLink=!1,i}return{type:"image",raw:r,href:o,title:l,text:A(a)}}function Dr(s,t){const r=s.match(/^(\s+)(?:```)/);if(r===null)return t;const n=r[1];return t.split(`
|
|
106
|
+
*/const He=M("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Be={week:"Тиждень",month:"Місяць",quarter:"Квартал",year:"Рік"},ks=["onClick"],ws={class:"flex items-center justify-between w-full"},_s={key:0},$s=e.defineComponent({__name:"vs-bi-dropdown",props:{title:{},options:{},value:{default:null}},emits:["selected"],setup(s,{emit:t}){const r=s,n=t,o=e.ref(!1),l=e.ref(r.value??null),a=e.ref(null),i=e.computed(()=>{const f=r.options;return typeof f=="string"?f.split(",").map((m,x)=>({id:x,text:m.trim()})):Array.isArray(f)?f:[]}),c=e.computed(()=>{const f=i.value.find(m=>(m.id??m)===l.value);return f?f.text??String(f):r.title??""}),p=f=>{const m=(f==null?void 0:f.id)??f;l.value=m,o.value=!1,n("selected",m),document.removeEventListener("click",d)},d=f=>{a.value&&!a.value.contains(f.target)&&(o.value=!1,document.removeEventListener("click",d))},h=()=>{o.value=!o.value,o.value?setTimeout(()=>{document.addEventListener("click",d)},200):document.removeEventListener("click",d)},g=f=>(Be==null?void 0:Be[f])??f;return e.onUnmounted(()=>{document.removeEventListener("click",d)}),(f,m)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("button",{type:"button","aria-expanded":"true",class:"hs-select-disabled:pointer-events-none hs-select-disabled:opacity-50 relative group pr-2 -ms-2 py-1.5 pl-2.5 inline-flex shrink-0 justify-center items-center gap-x-1.5 text-sm text-gray-800 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100 before:absolute before:inset-0 before:z-[1] dark:text-neutral-400 dark:hover:bg-neutral-800 dark:focus:bg-neutral-700",onClick:h},[e.createTextVNode(e.toDisplayString(g(c.value))+" ",1),m[0]||(m[0]=e.createElementVNode("svg",{class:"shrink-0 size-3.5 text-gray-600 dark:text-neutral-400",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"m6 9 6 6 6-6"})],-1))]),o.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"biDropdown",ref:a,"data-hs-select-dropdown":"",class:"absolute mt-2 z-50 w-48 p-1 space-y-0.5 bg-white rounded-xl shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] dark:bg-neutral-950 opened",role:"listbox",tabindex:"-1","aria-orientation":"vertical",style:{"margin-top":"10px"}},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,x=>(e.openBlock(),e.createElementBlock("div",{key:x.id||x,class:"cursor-pointer selected hs-selected:bg-gray-100 dark:hs-selected:bg-neutral-800 py-1.5 px-2 w-full text-[13px] text-gray-800 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:k=>p(x)},[e.createElementVNode("div",ws,[e.createElementVNode("span",null,e.toDisplayString(g(x.text||x)),1),l.value===(x.id||x)?(e.openBlock(),e.createElementBlock("span",_s,m[1]||(m[1]=[e.createElementVNode("svg",{class:"shrink-0 h-3.5 w-3.5 text-gray-800 dark:text-neutral-200",xmlns:"http:.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("polyline",{points:"20 6 9 17 4 12"})],-1)]))):e.createCommentVNode("",!0)])],8,ks))),128))],512)):e.createCommentVNode("",!0)],64))}}),Vs={class:"flex items-center space-x-2"},Es=e.defineComponent({__name:"vs-bi-switch",props:e.mergeModels({leftLabel:{},rightLabel:{},modelValue:{type:Boolean}},{modelValue:{default:()=>!1,type:Boolean},modelModifiers:{}}),emits:e.mergeModels(["update:is-enabled"],["update:modelValue"]),setup(s,{emit:t}){const r=t,n=e.useModel(s,"modelValue"),o=()=>{r("update:is-enabled",n)};return(l,a)=>(e.openBlock(),e.createElementBlock("div",Vs,[l.leftLabel?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["transition-colors",{"text-blue-500":!n.value}])},e.toDisplayString(l.leftLabel),3)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":a[0]||(a[0]=i=>n.value=i),type:"checkbox",class:"relative w-11 h-6 p-px bg-gray-100 border-transparent text-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:ring-blue-600 disabled:opacity-50 disabled:pointer-events-none checked:bg-none checked:text-blue-600 checked:border-blue-600 focus:checked:border-blue-600 dark:bg-neutral-800 dark:border-neutral-700 dark:checked:bg-blue-500 dark:checked:border-blue-500 dark:focus:ring-offset-gray-600 before:inline-block before:size-5 before:bg-white checked:before:bg-blue-200 before:translate-x-0 checked:before:translate-x-full before:rounded-full before:shadow before:h-5 before:w-5 before:transform before:ring-0 before:transition before:ease-in-out before:duration-200 dark:before:bg-neutral-400 dark:checked:before:bg-blue-200",onChange:o},null,544),[[e.vModelCheckbox,n.value]]),l.rightLabel?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["transition-colors",{"text-blue-500":n.value}])},e.toDisplayString(l.rightLabel),3)):e.createCommentVNode("",!0)]))}}),D=(s,t)=>{const r=s.__vccOpts||s;for(const[n,o]of t)r[n]=o;return r},Bs={},Cs={class:"flex items-center justify-center h-full"};function Ds(s,t){return e.openBlock(),e.createElementBlock("div",Cs,t[0]||(t[0]=[e.createElementVNode("div",{class:"text-center text-gray-500"},[e.createElementVNode("h2",{class:"text-2xl font-bold"},"No data available")],-1)]))}const Ns=D(Bs,[["render",Ds]]),Ge={"bi-bar":e.defineAsyncComponent(()=>Promise.resolve().then(()=>Co)),"bi-number":e.defineAsyncComponent(()=>Promise.resolve().then(()=>Oa)),"bi-text":e.defineAsyncComponent(()=>Promise.resolve().then(()=>va)),"bi-listbar":e.defineAsyncComponent(()=>Promise.resolve().then(()=>ka)),"bi-pie":e.defineAsyncComponent(()=>Promise.resolve().then(()=>Mo)),"bi-donut":e.defineAsyncComponent(()=>Promise.resolve().then(()=>zo)),"bi-line":e.defineAsyncComponent(()=>Promise.resolve().then(()=>Ao)),"bi-stat":e.defineAsyncComponent(()=>Promise.resolve().then(()=>ea)),"bi-pivot":e.defineAsyncComponent(()=>Promise.resolve().then(()=>Pa)),"bi-progress":e.defineAsyncComponent(()=>Promise.resolve().then(()=>ha)),"bi-funnel":e.defineAsyncComponent(()=>Promise.resolve().then(()=>Qa)),"bi-map":e.defineAsyncComponent(()=>Promise.resolve().then(()=>Gl)),"bi-cluster":e.defineAsyncComponent(()=>Promise.resolve().then(()=>mi)),"bi-table":e.defineAsyncComponent(()=>Promise.resolve().then(()=>Bi))};let Ze="/api";function ge(s){Ze=s||"/api"}function Ss(s,t){const r=Ze.replace(/\/$/,""),o=s.startsWith("http")||s.startsWith("//")||r&&s.startsWith(r)?s:`${r}${s.startsWith("/")?s:`/${s}`}`;if(!t||!Object.keys(t).length)return o;const l=new URLSearchParams;Object.entries(t).forEach(([i,c])=>{c!==void 0&&c!==""&&l.set(i,String(c))});const a=l.toString();return a?`${o}${o.includes("?")?"&":"?"}${a}`:o}async function be(s,t={}){const{params:r,...n}=t,o=Ss(s,r),l=await fetch(o,{...n,headers:{"Content-Type":"application/json",...n.headers}});if(!l.ok){const i=new Error(l.statusText);throw i.status=l.status,i}const a=await l.text();if(a)try{return JSON.parse(a)}catch{return a}}const T={get(s,t){return be(s,{...t,method:"GET"})},post(s,t){return be(s,{method:"POST",body:t!=null?JSON.stringify(t):void 0})},put(s,t){return be(s,{method:"PUT",body:t!=null?JSON.stringify(t):void 0})},delete(s){return be(s,{method:"DELETE"})}},zs={key:0,class:"text-[16px] flex max-w-full items-center min-h-0 justify-between max-h-[50px] h-fit shrink-0"},Ls={class:"flex items-center justify-between w-full gap-2"},Ts={class:"flex items-center gap-2 min-w-0"},Is={class:"text-gray-800 inline-block line-clamp-1 font-semibold"},Ms={class:"flex flex-col justify-end"},Ps={key:0,class:"flex items-center justify-end w-full gap-2"},Rs={class:"w-full h-full"},re=e.defineComponent({__name:"vs-widget",props:{dashboard:{},prefix:{default:""},widget:{},filterURl:{},dashboardWidgets:{},selectedWidget:{}},emits:["update:current-widget-data"],setup(s,{emit:t}){const r=s,n=t,o=e.ref(null),l=e.ref(null),a=e.ref(null),i=e.ref({}),c=e.ref([]),p=e.computed(()=>{var y,b;const u=(y=r.dashboardWidgets)==null?void 0:y.find(_=>_.name===r.widget);return((b=u==null?void 0:u.data)==null?void 0:b.title)??(u==null?void 0:u.title)??""}),d=e.computed(()=>{var y;const u=(y=r.dashboardWidgets)==null?void 0:y.find(b=>b.name===r.widget);return(u==null?void 0:u.type)??"text"}),h=e.computed(()=>{var y;const u=(y=i.value)==null?void 0:y.controls;return!u||typeof u=="boolean"?[]:Object.keys(u).map(b=>({name:b,options:u[b]}))}),g=e.computed(()=>{const u=d.value?`bi-${d.value}`:"";return u&&u in Ge?Ge[u]:null});function f(u,y){var b,_;(_=(b=l.value)==null?void 0:b.changeStyle)==null||_.call(b,u,y)}function m(u,y){const b=c.value.find(_=>_.name===y);b?b.option=u:c.value.push({name:y,option:u}),x()}function x(){var y,b;let u=`/bi-data?dashboard=${r.dashboard}&widget=${r.widget}`;c.value.forEach(_=>{u+=`&${_.name}=${_.option}`}),(b=(y=l.value)==null?void 0:y.getDataFromURL)==null||b.call(y,u)}function k(){const u=a.value;if(u!=null&&u.getDataURL){const y=u.getDataURL({type:"png",pixelRatio:2,backgroundColor:"#ffffff"}),b=document.createElement("a");b.href=y,b.download="chart.png",document.body.appendChild(b),b.click(),document.body.removeChild(b)}}return e.onMounted(()=>{r.prefix&&ge(r.prefix)}),e.watch(()=>r.filterURl,u=>{var y,b;u&&((b=(y=l.value)==null?void 0:y.setFilter)==null||b.call(y,u))}),e.watch(()=>r.selectedWidget,(u,y)=>{var b;u!==y&&u===((b=i.value)==null?void 0:b.id)&&n("update:current-widget-data",i.value)}),e.watch(i,(u,y)=>{if((u==null?void 0:u.id)===(y==null?void 0:y.id))return;const b=typeof window<"u"?new URLSearchParams(window.top.location.search).get("widget"):null;b&&b===(u==null?void 0:u.id)&&n("update:current-widget-data",u)},{deep:!0}),(u,y)=>{var b,_,$,w,L,P,F,q,U;return e.openBlock(),e.createElementBlock("div",{ref_key:"widgetRef",ref:o,class:e.normalizeClass(["box-border relative h-full p-4 bg-white border border-gray-200 rounded-xl shadow-sm select-auto",[(_=(b=i.value)==null?void 0:b.style)!=null&&_.height?`max-h-[${(w=($=i.value)==null?void 0:$.style)==null?void 0:w.height}px] h-[${(P=(L=i.value)==null?void 0:L.style)==null?void 0:P.height}px]`:"max-h-[460px]"]])},[["text","cluster","map"].includes(d.value)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",zs,[e.createElementVNode("div",Ls,[e.createElementVNode("div",Ts,[e.createElementVNode("span",Is,e.toDisplayString(p.value),1)]),e.createElementVNode("div",Ms,[(F=h.value)!=null&&F.length?(e.openBlock(),e.createElementBlock("span",Ps,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((q=h.value)==null?void 0:q.filter(V=>(V==null?void 0:V.options)&&(V==null?void 0:V.name)!=="export"),V=>{var v,Z;return e.openBlock(),e.createElementBlock("div",{key:V==null?void 0:V.name},[Array.isArray(V==null?void 0:V.options)?(e.openBlock(),e.createBlock($s,{key:0,title:V==null?void 0:V.name,options:V==null?void 0:V.options,value:((Z=(v=i.value)==null?void 0:v.data)==null?void 0:Z[V==null?void 0:V.name])??null,onSelected:G=>m(G,V==null?void 0:V.name)},null,8,["title","options","value","onSelected"])):typeof V.options=="boolean"?(e.openBlock(),e.createBlock(Es,{key:1,"left-label":V==null?void 0:V.name,"model-value":!!(V!=null&&V.options),"onUpdate:isEnabled":G=>f(V==null?void 0:V.name,G)},null,8,["left-label","model-value","onUpdate:isEnabled"])):e.createCommentVNode("",!0)])}),128)),(U=h.value)!=null&&U.some(V=>(V==null?void 0:V.name)==="export")?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"h-[32px] w-[32px] rounded-lg hover:bg-gray-100 duration-100 flex items-center justify-center",onClick:k},[e.createVNode(e.unref(as),{size:16,class:"text-gray-800"})])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])])])),e.createElementVNode("div",Rs,[g.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(g.value),{key:0,ref_key:"chartRef",ref:l,"current-widget":a.value,"onUpdate:currentWidget":y[0]||(y[0]=V=>a.value=V),"widget-data":i.value,"onUpdate:widgetData":y[1]||(y[1]=V=>i.value=V),dashboard:u.dashboard,title:p.value,widget:u.widget},null,40,["current-widget","widget-data","dashboard","title","widget"])):(e.openBlock(),e.createBlock(Ns,{key:1,class:"w-full h-full"}))])],2)}}}),Fs={class:"w-full overflow-hidden rounded vs-table-interface__table-wrp h-fit"},As={class:"p-5 min-h-[500px] flex flex-col justify-center items-center text-center"},Os={class:"max-w-sm mx-auto mt-6"},js={class:"font-medium text-gray-800 dark:text-neutral-200"},Ws={class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"},ye=e.defineComponent({__name:"vs-new-nodata",props:{title:{default:"Дані для відображення відсутні"},text:{default:"Змініть параметри пошуку або спробуйте пізніше"}},setup(s){return(t,r)=>(e.openBlock(),e.createElementBlock("div",Fs,[e.createElementVNode("div",null,[e.createElementVNode("div",As,[r[0]||(r[0]=e.createStaticVNode('<svg class="w-48 mx-auto" viewBox="0 0 178 90" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs></svg>',1)),e.createElementVNode("div",Os,[e.createElementVNode("p",js,e.toDisplayString(t.title),1),e.createElementVNode("p",Ws,e.toDisplayString(t.text),1)])])])]))}}),qs={components:{filterIcon:{__name:"filter",setup(s){return(t,r)=>(e.openBlock(),e.createBlock(e.unref(is),e.mergeProps(t.$attrs,{size:24}),null,16))}}},props:["filterScheme"],emits:["filters:changed"]},Us={class:"flex items-center"},vs={key:0,type:"button",class:"py-2 px-2.5 ml-3 h-[38px] inline-flex items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 opacity-60 cursor-not-allowed",disabled:"",title:"Фільтри вимкнено (v3-filter видалено)"};function Hs(s,t,r,n,o,l){const a=e.resolveComponent("filterIcon");return e.openBlock(),e.createElementBlock("div",Us,[r.filterScheme?(e.openBlock(),e.createElementBlock("button",vs,[e.createVNode(a),t[0]||(t[0]=e.createTextVNode(" Фільтри "))])):e.createCommentVNode("",!0)])}const Gs={components:{VsFilterHeader:D(qs,[["render",Hs]])},props:{dashboardData:{type:Object,default:null},filters:{type:Array,default:null}}},Zs={class:"bg-white px-5 flex gap-4 h-[90px] border border-gray-200 rounded-xl mb-2 pt-[3px] justify-between items-center"},Qs={class:"grow"},Xs={class:"text-lg font-semibold text-stone-800 dark:text-neutral-200"},Js={key:0,class:"inline-flex items-center text-sm gap-x-2 text-stone-800 hover:text-stone-500 focus:outline-none focus:text-stone-500 dark:text-neutral-200 dark:hover:text-neutral-400 dark:focus:text-neutral-400"},Ks={key:0,class:"flex items-center gap-3"};function Ys(s,t,r,n,o,l){var i,c,p;const a=e.resolveComponent("VsFilterHeader");return e.openBlock(),e.createElementBlock("div",Zs,[e.createElementVNode("div",Qs,[e.createElementVNode("h1",Xs,e.toDisplayString((i=r.dashboardData)==null?void 0:i.title),1),(c=r.dashboardData)!=null&&c.description?(e.openBlock(),e.createElementBlock("button",Js,e.toDisplayString((p=r.dashboardData)==null?void 0:p.description),1)):e.createCommentVNode("",!0)]),r.filters?(e.openBlock(),e.createElementBlock("div",Ks,[e.createVNode(a,{filterScheme:r.filters,"onFilters:changed":t[0]||(t[0]=d=>s.$emit("filters:changed",d))},null,8,["filterScheme"])])):e.createCommentVNode("",!0)])}const er=D(Gs,[["render",Ys]]);var Qe={},Xe;(function(s){s.pop="pop",s.push="push"})(Xe||(Xe={}));var Je;(function(s){s.back="back",s.forward="forward",s.unknown=""})(Je||(Je={}));var Ke;(function(s){s[s.aborted=4]="aborted",s[s.cancelled=8]="cancelled",s[s.duplicated=16]="duplicated"})(Ke||(Ke={}));const tr=Symbol(Qe.NODE_ENV!=="production"?"router":""),sr=Symbol(Qe.NODE_ENV!=="production"?"route location":"");function Ce(){return e.inject(tr)}function rr(s){return e.inject(sr)}const nr={key:0,class:"text-gray-400 shrink-0"},or=["onClick"],ar=["onClick"],lr={key:4,class:"text-gray-900 font-medium truncate"},Ye={__name:"vs-breadcrumbs",props:{items:{type:Array,default:()=>[]},compact:{type:Boolean,default:!1}},setup(s){const t=s,r=Ce(),n=e.computed(()=>Array.isArray(t.items)?t.items:[]);function o(l){r!=null&&r.push?r.push(l):typeof l=="string"&&(window!=null&&window.location)&&(window.location.href=l)}return(l,a)=>{const i=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("nav",{class:e.normalizeClass(["flex items-center gap-2 text-sm text-gray-600",s.compact?"py-1":"py-6"]),"aria-label":"Breadcrumb"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(c,p)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:p},[p>0?(e.openBlock(),e.createElementBlock("span",nr,[e.createVNode(e.unref(os),{class:"w-4 h-4"})])):e.createCommentVNode("",!0),typeof c.onClick=="function"?(e.openBlock(),e.createElementBlock("span",{key:1,class:"hover:text-gray-900 transition-colors cursor-pointer",onClick:d=>c.onClick()},e.toDisplayString(c.label),9,or)):e.unref(r)&&c.to?(e.openBlock(),e.createBlock(i,{key:2,to:c.to,class:"hover:text-gray-900 transition-colors"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.label),1)]),_:2},1032,["to"])):c.to?(e.openBlock(),e.createElementBlock("span",{key:3,class:"hover:text-gray-900 transition-colors cursor-pointer",onClick:d=>o(c.to)},e.toDisplayString(c.label),9,ar)):(e.openBlock(),e.createElementBlock("span",lr,e.toDisplayString(c.label),1))],64))),128))],2)}}},ir={components:{VsWidget:re,VsNewNodata:ye,VsHeader:er,VsBreadcrumbs:Ye},props:["id","prefix"],data(){return{widgets:[],panels:[],error:!1,selectedPanel:"",filterURl:null,dashboardData:null}},async mounted(){ge(this.prefix||"/api"),await this.fetchData()},methods:{async fetchData(){if(this.id)try{const s=await T.get(`/bi-dashboard/${this.id}`);this.dashboardData=s}catch(s){console.error(s)}},columnClass(s){const t=s!=null&&s.col?s==null?void 0:s.col:12;return{1:"md:w-1/12 sm:w-full",2:"md:w-1/6 sm:w-full",3:"md:w-1/4 sm:w-full",4:"md:w-1/3 sm:w-full",6:"md:w-1/2 sm:w-full",8:"md:w-2/3 sm:w-full",10:"md:w-5/6 sm:w-full",12:"w-full"}[t]||"w-full"},async filterHandler(s){var r;this.filterURl="";let t="&filter=";(r=s==null?void 0:s.url)!=null&&r.length&&(s.url.split("|").forEach(o=>{const l=o.split("=");t+=`${l[0]}=${l[1]}`}),this.filterURl+=t)}}},cr={class:"w-full pb-8 overflow-y-auto mx-auto"},dr={class:"grid flex-grow w-full grid-cols-12 gap-4 h-fit"};function pr(s,t,r,n,o,l){var c;const a=e.resolveComponent("VsNewNodata"),i=e.resolveComponent("VsWidget");return e.openBlock(),e.createElementBlock("div",cr,[e.createElementVNode("div",dr,[o.error||!o.dashboardData?(e.openBlock(),e.createBlock(a,{key:0,class:"col-span-12"})):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(((c=o.dashboardData)==null?void 0:c.panels)||[],(p,d)=>{var h;return e.openBlock(),e.createElementBlock("div",{key:d,class:e.normalizeClass([`col-span-${p.col||12}`,"flex flex-col gap-[10px]"])},[(h=p.widgets)!=null&&h.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(p.widgets,g=>(e.openBlock(),e.createBlock(i,{key:g,dashboard:r.id,widget:g,"dashboard-widgets":o.dashboardData.widgets,"filter-u-rl":o.filterURl},null,8,["dashboard","widget","dashboard-widgets","filter-u-rl"]))),128)):(e.openBlock(),e.createBlock(i,{key:1,class:"flex flex-col",dashboard:r.id,widget:p.widget,"dashboard-widgets":o.dashboardData.widgets,"filter-u-rl":o.filterURl},null,8,["dashboard","widget","dashboard-widgets","filter-u-rl"]))],2)}),128))])])}const hr=D(ir,[["render",pr]]),mr={key:0,class:"vs-modal-wrapper fixed inset-0 flex items-center justify-center p-4"},ur={class:"flex items-center justify-between shrink-0 py-2.5 px-4 border-b border-gray-200 dark:border-[#454545]"},fr={class:"font-medium text-gray-800 dark:text-white"},gr={class:"vs-modal-content flex-1 min-h-0 overflow-auto p-4"},br={key:0,class:"shrink-0 border-t border-gray-200 dark:border-neutral-700"},ne=D({__name:"vs-modal",props:{visible:{type:Boolean,default:!1},title:{type:String,default:""},size:{type:String,default:"medium"},closeClickBack:{type:Boolean,default:!1},teleport:{type:String,default:"#modal"}},emits:["close","update:visible"],setup(s,{emit:t}){const r=s,n=t,o=e.computed(()=>r.size==="small"?"md:max-w-[40%] w-full max-w-md":r.size==="lg"?"md:max-w-[70%] w-full max-w-4xl":"md:max-w-[50%] w-full max-w-lg");function l(){n("update:visible",!1),n("close")}function a(i){i.key==="Escape"&&l()}return e.onMounted(()=>{window.addEventListener("keydown",a)}),e.onUnmounted(()=>{window.removeEventListener("keydown",a)}),(i,c)=>(e.openBlock(),e.createBlock(e.Teleport,{to:s.teleport},[s.visible?(e.openBlock(),e.createElementBlock("div",mr,[e.createElementVNode("div",{class:"absolute inset-0 bg-black/50","aria-hidden":"true",onMousedown:c[0]||(c[0]=p=>s.closeClickBack&&p.target===p.currentTarget&&l())},null,32),e.createVNode(e.Transition,{name:"vs-modal",appear:""},{default:e.withCtx(()=>[s.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["vs-modal-panel relative flex flex-col bg-white dark:bg-[#1A1A1A] rounded-xl shadow-xl max-h-[85vh] min-w-0 border border-gray-200 dark:border-[#454545]",o.value]),role:"dialog","aria-modal":"true",onMousedown:c[1]||(c[1]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",ur,[e.createElementVNode("h3",fr,e.toDisplayString(s.title),1),e.createElementVNode("button",{type:"button",class:"size-8 inline-flex justify-center items-center rounded-full bg-gray-100 text-gray-800 hover:bg-gray-200 dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-300","aria-label":"Закрити",onClick:l},c[2]||(c[2]=[e.createElementVNode("svg",{class:"w-4 h-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),e.createElementVNode("div",gr,[e.renderSlot(i.$slots,"default",{},void 0,!0)]),i.$slots.footer?(e.openBlock(),e.createElementBlock("div",br,[e.renderSlot(i.$slots,"footer",{},void 0,!0)])):e.createCommentVNode("",!0)],34)):e.createCommentVNode("",!0)]),_:3})])):e.createCommentVNode("",!0)],8,["to"]))}},[["__scopeId","data-v-5722a50f"]]),yr={__name:"icon-plus",setup(s){return(t,r)=>(e.openBlock(),e.createBlock(e.unref(ve),e.mergeProps(t.$attrs,{size:24}),null,16))}},xr={class:"mb-4 overflow-auto scrollbar max-h-96"},kr={__name:"vs-editor-create-widget",props:{columns:{type:Array,default:()=>[]},selectedDashboard:String,inline:{type:Boolean,default:!1}},emits:"update-data",setup(s,{expose:t,emit:r}){var m;const n=e.defineAsyncComponent(()=>import("@opengis/form")),o=(m=e.getCurrentInstance().proxy)==null?void 0:m.$notify,l=r,a=s,i=e.ref(!1),c=e.ref({}),p=e.ref();function d(){i.value=!0}function h(){i.value=!1}t({open:d,close:h});const g=async()=>{try{await p.value.doValidation(),await T.post(`/bi-dashboard/${a.selectedDashboard}`,c.value),await o({type:"success",title:"Успішно!",message:"Віджет успішно створено"}),await l("update-data"),c.value={},i.value=!1}catch{o({type:"error",title:"Помилка!",message:"При спробі створити віджет сталася помилка"})}},f=e.computed(()=>{var x,k,u,y;return{title:{type:"text",label:"Widget title",placeholder:"Widget title",validators:["required"]},x:{type:"select",label:"X Axis",view:"buttons",style:{size:"xs"},validators:["required"],options:(k=(x=a.columns)==null?void 0:x.filter(b=>(b==null?void 0:b.type)=="text"||(b==null?void 0:b.type)==="date"||(b==null?void 0:b.type)==="timestamp without time zone"||(b==null?void 0:b.type)==="boolean"||(b==null?void 0:b.type)==="integer"))==null?void 0:k.map(({name:b,type:_})=>({id:b,text:b,type:_}))},metric:{type:"select",label:"Y Axis",view:"buttons",validators:["required"],style:{size:"xs"},options:[{id:"count",label:"count"},...(y=(u=a.columns)==null?void 0:u.filter(b=>(b==null?void 0:b.type)==="numeric"||(b==null?void 0:b.type)==="double precision"))==null?void 0:y.map(({name:b,type:_})=>({id:b,text:b,type:_}))]},col:{type:"select",label:"Columns count",validators:["required"],options:[{id:1,label:1},{id:2,text:2},{id:3,text:3},{id:4,text:4},{id:6,text:6},{id:9,text:9},{id:12,text:12}]},type:{type:"select",view:"buttons",label:"Type",validators:["required"],options:[{label:"Bar",id:"bar"},{label:"Funnel",id:"funnel"},{label:"Line",id:"line"},{label:"List bar",id:"listbar"},{label:"Number",id:"number"},{label:"Pie",id:"pie"},{label:"Donut",id:"donut"},{label:"Pivot",id:"pivot"},{label:"Table",id:"table"},{label:"Progress",id:"progress"},{label:"Stat",id:"stat"},{label:"Text",id:"text"},{label:"Map",id:"map"}]},table:{type:"Text",ua:"Table",placeholder:"Table"},query:{type:"Text",ua:"Query",placeholder:"Query"},cls:{type:"Text",ua:"Cls",placeholder:"Cls"}}});return(x,k)=>{const u=e.resolveComponent("VsPopover");return e.openBlock(),e.createElementBlock("div",null,[s.inline?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(u,{key:0,placement:"right",trigger:"hover"},{reference:e.withCtx(()=>[e.createElementVNode("div",null,[e.createElementVNode("button",{class:"z-50 flex items-center justify-center h-[50px] !w-[50px] text-2xl text-white transition-colors bg-blue-500 rounded-full cursor-pointer hover:bg-blue-700",onClick:d},[e.createVNode(yr,{height:"20",width:"20"})])])]),default:e.withCtx(()=>[k[1]||(k[1]=e.createTextVNode(" Створити віджет "))]),_:1})),e.createVNode(ne,{teleport:"#modal",visible:i.value,title:"Створити віджет",onClose:h},{footer:e.withCtx(()=>[e.createElementVNode("div",{class:"flex justify-end p-[20px] gap-[10px] border-t w-full"},[e.createElementVNode("button",{style:{border:"1px solid #000"},onClick:h,class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border-gray-200 rounded-lg !border-gray-200 hover:bg-gray-100 duration-300"}," Скасувати "),e.createElementVNode("button",{onClick:g,class:"py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"}," Створити ")])]),default:e.withCtx(()=>[e.createElementVNode("div",xr,[e.createVNode(e.unref(n),{ref_key:"form",ref:p,schema:f.value,values:c.value,"onUpdate:values":k[0]||(k[0]=y=>c.value=y)},null,8,["schema","values"])])]),_:1},8,["visible"])])}}},et={__name:"delete",setup(s){return(t,r)=>(e.openBlock(),e.createBlock(e.unref(xs),e.mergeProps(t.$attrs,{size:24}),null,16))}},De={__name:"close",setup(s){return(t,r)=>(e.openBlock(),e.createBlock(e.unref(He),e.mergeProps(t.$attrs,{size:24}),null,16))}},tt={__name:"edit",setup(s){return(t,r)=>(e.openBlock(),e.createBlock(e.unref(fs),e.mergeProps(t.$attrs,{size:24}),null,16))}},wr={class:"space-y-4"},_r={__name:"vs-editor-form-style",props:{widgetName:{type:String},data:{type:Object,default:()=>{}}},setup(s,{expose:t}){var m,x,k,u,y,b;const r=e.defineAsyncComponent(()=>import("@opengis/form")),{$notify:n}=e.getCurrentInstance().proxy,o=s,l=e.ref(null),a={show:{label:"Label",type:"switcher",title:"Show label"},rotate:{type:"number",label:"Rotate angel",conditions:["show","==",!0]},align:{type:"select",view:"buttons",label:"Align",conditions:["show","==",!0],options:[{id:"center",text:"Center"},{id:"left",text:"Left"},{id:"right",text:"Right"}]},position:{type:"select",label:"Position",conditions:["show","==",!0],options:[{id:"top",text:"Top"},{id:"right",text:"Right"},{id:"left",text:"Left"},{id:"bottom",text:"Bottom"}]}},i={show:{label:"Legend",type:"switcher",title:"Show legend"}},c={show:{label:"Tooltip ",type:"switcher",title:"Show tooltip"}},p=e.ref({...((x=(m=o.data)==null?void 0:m.style)==null?void 0:x.label)||{}}),d=e.ref({...((u=(k=o.data)==null?void 0:k.style)==null?void 0:u.legend)||{}}),h=e.ref({...((b=(y=o.data)==null?void 0:y.style)==null?void 0:b.tooltip)||{}}),g=()=>{const _=new CustomEvent(`update-style-${o.widgetName}`);_.chartId=o.widgetName,_.options={options:{legend:d.value,tooltip:h.value,label:p.value},seriesOptions:p.value},window.dispatchEvent(_)};e.watch(p,g,{deep:!0}),e.watch(d,g,{deep:!0}),e.watch(h,g,{deep:!0});const f=async()=>{try{await T.put(`/bi-dashboard/${l.value}/${o.widgetName}`,{style:{legend:d.value,tooltip:h.value,label:p.value}});const _=new CustomEvent(`update-style-${o.widgetName}`);_.chartId=o.widgetName,_.options={options:{legend:d.value,tooltip:h.value,label:p.value},seriesOptions:p.value},window.dispatchEvent(_),n({type:"success",title:"Успішно!",message:"Дані успішно оновлено"})}catch{n({type:"error",title:"Помилка!",message:"При спробі оновити данні сталася помилка"})}};return e.onMounted(()=>{const _=new URLSearchParams(window.top.location.search);l.value=_.get("dashboard")}),t({requestUpdateWidget:f}),(_,$)=>(e.openBlock(),e.createElementBlock("div",wr,[e.createVNode(e.unref(r),{schema:a,values:p.value,"onUpdate:values":$[0]||($[0]=w=>p.value=w),class:"p-0"},null,8,["values"]),e.createVNode(e.unref(r),{schema:i,values:d.value,"onUpdate:values":$[1]||($[1]=w=>d.value=w),class:"p-0"},null,8,["values"]),e.createVNode(e.unref(r),{schema:c,values:h.value,"onUpdate:values":$[2]||($[2]=w=>h.value=w),class:"p-0"},null,8,["values"])]))}};function Ne(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let J=Ne();function st(s){J=s}const rt=/[&<>"']/,$r=new RegExp(rt.source,"g"),nt=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Vr=new RegExp(nt.source,"g"),Er={"&":"&","<":"<",">":">",'"':""","'":"'"},ot=s=>Er[s];function A(s,t){if(t){if(rt.test(s))return s.replace($r,ot)}else if(nt.test(s))return s.replace(Vr,ot);return s}const Br=/(^|[^\[])\^/g;function N(s,t){let r=typeof s=="string"?s:s.source;t=t||"";const n={replace:(o,l)=>{let a=typeof l=="string"?l:l.source;return a=a.replace(Br,"$1"),r=r.replace(o,a),n},getRegex:()=>new RegExp(r,t)};return n}function at(s){try{s=encodeURI(s).replace(/%25/g,"%")}catch{return null}return s}const oe={exec:()=>null};function lt(s,t){const r=s.replace(/\|/g,(l,a,i)=>{let c=!1,p=a;for(;--p>=0&&i[p]==="\\";)c=!c;return c?"|":" |"}),n=r.split(/ \|/);let o=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;o<n.length;o++)n[o]=n[o].trim().replace(/\\\|/g,"|");return n}function ae(s,t,r){const n=s.length;if(n===0)return"";let o=0;for(;o<n&&s.charAt(n-o-1)===t;)o++;return s.slice(0,n-o)}function Cr(s,t){if(s.indexOf(t[1])===-1)return-1;let r=0;for(let n=0;n<s.length;n++)if(s[n]==="\\")n++;else if(s[n]===t[0])r++;else if(s[n]===t[1]&&(r--,r<0))return n;return-1}function it(s,t,r,n){const o=t.href,l=t.title?A(t.title):null,a=s[1].replace(/\\([\[\]])/g,"$1");if(s[0].charAt(0)!=="!"){n.state.inLink=!0;const i={type:"link",raw:r,href:o,title:l,text:a,tokens:n.inlineTokens(a)};return n.state.inLink=!1,i}return{type:"image",raw:r,href:o,title:l,text:A(a)}}function Dr(s,t){const r=s.match(/^(\s+)(?:```)/);if(r===null)return t;const n=r[1];return t.split(`
|
|
107
107
|
`).map(o=>{const l=o.match(/^\s+/);if(l===null)return o;const[a]=l;return a.length>=n.length?o.slice(n.length):o}).join(`
|
|
108
108
|
`)}class xe{constructor(t){S(this,"options");S(this,"rules");S(this,"lexer");this.options=t||J}space(t){const r=this.rules.block.newline.exec(t);if(r&&r[0].length>0)return{type:"space",raw:r[0]}}code(t){const r=this.rules.block.code.exec(t);if(r){const n=r[0].replace(/^(?: {1,4}| {0,3}\t)/gm,"");return{type:"code",raw:r[0],codeBlockStyle:"indented",text:this.options.pedantic?n:ae(n,`
|
|
109
109
|
`)}}}fences(t){const r=this.rules.block.fences.exec(t);if(r){const n=r[0],o=Dr(n,r[3]||"");return{type:"code",raw:n,lang:r[2]?r[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):r[2],text:o}}}heading(t){const r=this.rules.block.heading.exec(t);if(r){let n=r[2].trim();if(/#$/.test(n)){const o=ae(n,"#");(this.options.pedantic||!o||/ $/.test(o))&&(n=o.trim())}return{type:"heading",raw:r[0],depth:r[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){const r=this.rules.block.hr.exec(t);if(r)return{type:"hr",raw:ae(r[0],`
|
|
@@ -389,8 +389,8 @@ function Es(s, e) {
|
|
|
389
389
|
}
|
|
390
390
|
const Os = /* @__PURE__ */ H(Ns, [["render", Es]]), Ct = {
|
|
391
391
|
"bi-bar": A(() => Promise.resolve().then(() => qa)),
|
|
392
|
-
"bi-number": A(() => import("./vs-number-
|
|
393
|
-
"bi-text": A(() => import("./vs-text-
|
|
392
|
+
"bi-number": A(() => import("./vs-number-DXMmIAu0.js")),
|
|
393
|
+
"bi-text": A(() => import("./vs-text-qF7xeWu5.js")),
|
|
394
394
|
"bi-listbar": A(() => Promise.resolve().then(() => Mi)),
|
|
395
395
|
"bi-pie": A(() => Promise.resolve().then(() => ti)),
|
|
396
396
|
"bi-donut": A(() => Promise.resolve().then(() => Xa)),
|
|
@@ -398,10 +398,10 @@ const Os = /* @__PURE__ */ H(Ns, [["render", Es]]), Ct = {
|
|
|
398
398
|
"bi-stat": A(() => Promise.resolve().then(() => ki)),
|
|
399
399
|
"bi-pivot": A(() => Promise.resolve().then(() => oo)),
|
|
400
400
|
"bi-progress": A(() => Promise.resolve().then(() => Pi)),
|
|
401
|
-
"bi-funnel": A(() => import("./vs-funnel-bar-
|
|
402
|
-
"bi-map": A(() => import("./vs-map-
|
|
403
|
-
"bi-cluster": A(() => import("./vs-map-cluster-
|
|
404
|
-
"bi-table": A(() => import("./vs-table-
|
|
401
|
+
"bi-funnel": A(() => import("./vs-funnel-bar-BYIBOhaT.js")),
|
|
402
|
+
"bi-map": A(() => import("./vs-map-DEmnVnil.js")),
|
|
403
|
+
"bi-cluster": A(() => import("./vs-map-cluster-Dv4ypLk9.js")),
|
|
404
|
+
"bi-table": A(() => import("./vs-table-C5I59PQW.js"))
|
|
405
405
|
};
|
|
406
406
|
let qt = "/api";
|
|
407
407
|
function Me(s) {
|
|
@@ -453,7 +453,7 @@ const G = {
|
|
|
453
453
|
}, Bs = {
|
|
454
454
|
key: 0,
|
|
455
455
|
class: "text-[16px] flex max-w-full items-center min-h-0 justify-between max-h-[50px] h-fit shrink-0"
|
|
456
|
-
}, Fs = { class: "flex items-center justify-between w-full gap-2" }, qs = { class: "flex items-center gap-2 min-w-0" }, Ms = { class: "text-gray-800
|
|
456
|
+
}, Fs = { class: "flex items-center justify-between w-full gap-2" }, qs = { class: "flex items-center gap-2 min-w-0" }, Ms = { class: "text-gray-800 inline-block line-clamp-1 font-semibold" }, Us = { class: "flex flex-col justify-end" }, Gs = {
|
|
457
457
|
key: 0,
|
|
458
458
|
class: "flex items-center justify-end w-full gap-2"
|
|
459
459
|
}, Hs = { class: "w-full h-full" }, Ne = /* @__PURE__ */ ge({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as c, c as l, a as o, b as h, d } from "./import-file-
|
|
1
|
+
import { _ as c, c as l, a as o, b as h, d } from "./import-file-Cy2Zpvpw.js";
|
|
2
2
|
import { createElementBlock as u, openBlock as p } from "vue";
|
|
3
3
|
const i = typeof window < "u" ? window.echarts : null, m = {
|
|
4
4
|
name: "VsFunnelBar",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createBlock as b, openBlock as l, unref as L, mergeProps as v, createElementBlock as d, createElementVNode as c, withDirectives as F, toDisplayString as S, vShow as R, Fragment as P, renderList as V, normalizeClass as D, resolveComponent as A, createVNode as H } from "vue";
|
|
2
|
-
import { e as x, X as J, _ as w } from "./import-file-
|
|
2
|
+
import { e as x, X as J, _ as w } from "./import-file-Cy2Zpvpw.js";
|
|
3
3
|
/**
|
|
4
4
|
* @license lucide-vue-next v0.546.0 - ISC
|
|
5
5
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as E, a as L, p as $, V as T, b as B, c as H, d as O, l as F, e as N } from "./vs-list-
|
|
2
|
-
import { _ as V, c as P } from "./import-file-
|
|
1
|
+
import { _ as E, a as L, p as $, V as T, b as B, c as H, d as O, l as F, e as N } from "./vs-list-D2YSJTpd.js";
|
|
2
|
+
import { _ as V, c as P } from "./import-file-Cy2Zpvpw.js";
|
|
3
3
|
import { resolveComponent as u, createElementBlock as c, openBlock as i, Fragment as w, createElementVNode as r, createBlock as C, createCommentVNode as m, createVNode as x, Teleport as R, toDisplayString as g, renderList as S, normalizeStyle as k, normalizeClass as I } from "vue";
|
|
4
4
|
const A = {
|
|
5
5
|
components: { legendIcon: L, closeIcon: E },
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as A, a as F, p as T, c as G, V as P, b as Z, d as q, e as D, l as K } from "./vs-list-
|
|
2
|
-
import { e as W, _ as H, V as J, c as Q, g as U, h as X, i as Y } from "./import-file-
|
|
1
|
+
import { _ as A, a as F, p as T, c as G, V as P, b as Z, d as q, e as D, l as K } from "./vs-list-D2YSJTpd.js";
|
|
2
|
+
import { e as W, _ as H, V as J, c as Q, g as U, h as X, i as Y } from "./import-file-Cy2Zpvpw.js";
|
|
3
3
|
import { createElementBlock as g, createCommentVNode as S, openBlock as p, createElementVNode as l, normalizeClass as V, Fragment as R, renderList as N, toDisplayString as O, normalizeStyle as j, createBlock as z, unref as $, mergeProps as ee, resolveComponent as m, withDirectives as M, resolveDynamicComponent as te, createVNode as w, vShow as C } from "vue";
|
|
4
4
|
/**
|
|
5
5
|
* @license lucide-vue-next v0.546.0 - ISC
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as m, c as f, b as _, d as b } from "./import-file-
|
|
1
|
+
import { _ as m, c as f, b as _, d as b } from "./import-file-Cy2Zpvpw.js";
|
|
2
2
|
import { createElementBlock as a, openBlock as r, createElementVNode as s, Fragment as n, renderList as c, toDisplayString as d } from "vue";
|
|
3
3
|
const x = {
|
|
4
4
|
name: "VsTable",
|