@opengis/filter 0.0.1

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/README.md ADDED
@@ -0,0 +1,148 @@
1
+ # 📊 TableCRM
2
+
3
+ A reusable Vue 3 component for rendering data tables with external `<table>` markup. Supports automatic data loading, pagination, sorting, and column formatting (`text`, `badge`, `date`, `number`, `custom`).
4
+
5
+ ---
6
+
7
+ ## 🚀 Features
8
+
9
+ - Uses external HTML `<table>` structure
10
+ - Automatically loads data from API
11
+ - Supports sorting and pagination
12
+ - Column formatting: `text`, `number`, `date`, `badge`, `custom`
13
+ - Syncs with URL-like query params: `page`, `limit`, `sort`, `filter`
14
+ - Handles loading, empty, and error states
15
+ - Built with TypeScript + Composition API
16
+
17
+ ---
18
+
19
+ ## 💾 Installation
20
+
21
+ ```bash
22
+ npm install @your-org/table-crm
23
+ ```
24
+
25
+ ```ts
26
+ // main.ts
27
+ import { createApp } from 'vue'
28
+ import App from './App.vue'
29
+ import TableCRM from '@your-org/table-crm'
30
+
31
+ createApp(App).component('TableCRM', TableCRM).mount('#app')
32
+ ```
33
+
34
+ ---
35
+
36
+ ## ✅ Example Usage
37
+
38
+ ```vue
39
+ <template>
40
+ <TableCRM
41
+ url="/api/products"
42
+ :columns="columns"
43
+ v-model:page="page"
44
+ v-model:limit="limit"
45
+ v-model:sort="sort"
46
+ :filters="filters"
47
+ >
48
+ <table class="w-full text-sm">
49
+ <thead>
50
+ <tr>
51
+ <th>ID</th>
52
+ <th>Name</th>
53
+ <th>Price</th>
54
+ <th>Status</th>
55
+ </tr>
56
+ </thead>
57
+ <tbody>
58
+ <tr v-for="row in rows" :key="row.id">
59
+ <td>{{ row.id }}</td>
60
+ <td>{{ row.name }}</td>
61
+ <td>{{ row.price }}</td>
62
+ <td>
63
+ <span :class="badgeClass(row.status)">
64
+ {{ row.status }}
65
+ </span>
66
+ </td>
67
+ </tr>
68
+ </tbody>
69
+ </table>
70
+ </TableCRM>
71
+ </template>
72
+
73
+ <script setup lang="ts">
74
+ import { ref } from 'vue'
75
+ import type { Column } from '@your-org/table-crm'
76
+
77
+ const page = ref(1)
78
+ const limit = ref(10)
79
+ const sort = ref({ field: 'name', direction: 'asc' })
80
+ const filters = ref({})
81
+
82
+ const columns: Column[] = [
83
+ { name: 'id', label: 'ID', type: 'text' },
84
+ { name: 'name', label: 'Name', type: 'text', sortable: true },
85
+ { name: 'price', label: 'Price', type: 'number', sortable: true },
86
+ { name: 'status', label: 'Status', type: 'badge' },
87
+ ]
88
+
89
+ function badgeClass(status: string) {
90
+ return status === 'active' ? 'text-green-600' : 'text-gray-400'
91
+ }
92
+ </script>
93
+ ```
94
+
95
+ ---
96
+
97
+ ## ⚙️ Props
98
+
99
+ | Prop | Type | Description |
100
+ |--------------|-----------------------------|------------------------------------------|
101
+ | `url` | `string` | API endpoint for fetching table data |
102
+ | `columns` | `Column[]` | List of column definitions |
103
+ | `filters` | `Record<string, any>` | Active filters to apply to the request |
104
+ | `page` | `number` (v-model) | Current page |
105
+ | `limit` | `number` (v-model) | Items per page |
106
+ | `sort` | `{ field, direction }` (v-model) | Current sort field and direction |
107
+
108
+ ---
109
+
110
+ ## 📐 Column Format
111
+
112
+ ```ts
113
+ type Column = {
114
+ name: string // field name from the API response
115
+ label: string // column header label
116
+ type?: 'text' | 'number' | 'date' | 'badge' | 'custom'
117
+ sortable?: boolean // whether this column is sortable
118
+ }
119
+ ```
120
+
121
+ ---
122
+
123
+ ## 📡 API Response Format
124
+
125
+ The component expects the API to return:
126
+
127
+ ```json
128
+ {
129
+ "data": [ /* array of row objects */ ],
130
+ "total": 100
131
+ }
132
+ ```
133
+
134
+ ---
135
+
136
+ ## 📤 Events
137
+
138
+ | Event | Triggered When |
139
+ |------------------|-------------------------------------|
140
+ | `update:page` | Page number changes |
141
+ | `update:limit` | Page size (limit) changes |
142
+ | `update:sort` | Sorting field or direction changes |
143
+
144
+ ---
145
+
146
+ ## 🧩 Use Cases
147
+
148
+ Perfect for admin panels, CRM systems, product catalogs, user/order tables, etc.
Binary file
@@ -0,0 +1,6 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),Et={class:"flex items-center w-full rounded-lg group hover:bg-gray-100"},Ct={class:"flex items-center justify-between w-full text-sm"},Vt={class:"flex items-center cursor-pointer w-full"},Bt={key:0,width:"16",height:"auto",src:"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMTYgMTYnIGZpbGw9J3doaXRlJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnPjxwYXRoIGQ9J00xMi4yMDcgNC43OTNhMSAxIDAgMDEwIDEuNDE0bC01IDVhMSAxIDAgMDEtMS40MTQgMGwtMi0yYTEgMSAwIDAxMS40MTQtMS40MTRMNi41IDkuMDg2bDQuMjkzLTQuMjkzYTEgMSAwIDAxMS40MTQgMHonLz48L3N2Zz4="},Nt=["value"],_t={class:"w-[calc(100%-18px)] flex flex-row items-center justify-between pl-[10px] truncate"},St={class:"flex flex-row items-center font-normal text-gray-800 gap-x-1"},Rt={key:0,class:"text-xs text-gray-500 dark:text-neutral-500"},ze=e.defineComponent({__name:"list-item",props:{layout:{},count:{},type:{},label:{},value:{},isSelected:{type:Boolean},color:{}},emits:["itemClick"],setup(t,{emit:n}){const o=t,r=n;function l(){r("itemClick",o.value)}return(s,a)=>(e.openBlock(),e.createElementBlock("div",Et,[e.createElementVNode("div",Ct,[e.createElementVNode("div",Vt,[e.createElementVNode("label",{for:"radio-9740",class:e.normalizeClass(["inline","popover"].includes(s.layout)?"text-sm text-gray-500 px-2 w-full py-2 cursor-pointer !flex flex-row items-center":"flex flex-row items-center w-full px-2 py-2 text-sm text-gray-500 cursor-pointer"),onClick:e.withModifiers(l,["stop","prevent"])},[e.createElementVNode("div",{class:e.normalizeClass(["w-[18px] h-[18px] border rounded-[4px] flex items-center justify-center",[s.type==="checkbox"?"rounded-[4px]":"rounded-full",s.color?`bg-[${s.color}] border-[#ffffff]`:s.isSelected?"bg-[#2563eb] border-[#ffffff]":"bg-[#ffffff] border-[#d9d9d9]"]])},[s.isSelected?(e.openBlock(),e.createElementBlock("img",Bt)):e.createCommentVNode("",!0)],2),e.createElementVNode("input",{type:"checkbox",class:"hidden",id:"radio-9740",value:s.value},null,8,Nt),e.createElementVNode("div",_t,[e.createElementVNode("span",St,e.toDisplayString(s.label),1),s.count?(e.openBlock(),e.createElementBlock("div",Rt," ("+e.toDisplayString(s.count)+") ",1)):e.createCommentVNode("",!0)])],2)])])]))}});function qe(t,n){return function(){return t.apply(n,arguments)}}const{toString:At}=Object.prototype,{getPrototypeOf:we}=Object,{iterator:re,toStringTag:He}=Symbol,oe=(t=>n=>{const o=At.call(n);return t[o]||(t[o]=o.slice(8,-1).toLowerCase())})(Object.create(null)),T=t=>(t=t.toLowerCase(),n=>oe(n)===t),le=t=>n=>typeof n===t,{isArray:q}=Array,J=le("undefined");function W(t){return t!==null&&!J(t)&&t.constructor!==null&&!J(t.constructor)&&S(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Ke=T("ArrayBuffer");function Tt(t){let n;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?n=ArrayBuffer.isView(t):n=t&&t.buffer&&Ke(t.buffer),n}const Ot=le("string"),S=le("function"),Je=le("number"),Y=t=>t!==null&&typeof t=="object",Ft=t=>t===!0||t===!1,X=t=>{if(oe(t)!=="object")return!1;const n=we(t);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(He in t)&&!(re in t)},Dt=t=>{if(!Y(t)||W(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},$t=T("Date"),Mt=T("File"),Lt=T("Blob"),Pt=T("FileList"),jt=t=>Y(t)&&S(t.pipe),Ut=t=>{let n;return t&&(typeof FormData=="function"&&t instanceof FormData||S(t.append)&&((n=oe(t))==="formdata"||n==="object"&&S(t.toString)&&t.toString()==="[object FormData]"))},It=T("URLSearchParams"),[zt,qt,Ht,Kt]=["ReadableStream","Request","Response","Headers"].map(T),Jt=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Q(t,n,{allOwnKeys:o=!1}={}){if(t===null||typeof t>"u")return;let r,l;if(typeof t!="object"&&(t=[t]),q(t))for(r=0,l=t.length;r<l;r++)n.call(null,t[r],r,t);else{if(W(t))return;const s=o?Object.getOwnPropertyNames(t):Object.keys(t),a=s.length;let i;for(r=0;r<a;r++)i=s[r],n.call(null,t[i],i,t)}}function We(t,n){if(W(t))return null;n=n.toLowerCase();const o=Object.keys(t);let r=o.length,l;for(;r-- >0;)if(l=o[r],n===l.toLowerCase())return l;return null}const j=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Ye=t=>!J(t)&&t!==j;function pe(){const{caseless:t}=Ye(this)&&this||{},n={},o=(r,l)=>{const s=t&&We(n,l)||l;X(n[s])&&X(r)?n[s]=pe(n[s],r):X(r)?n[s]=pe({},r):q(r)?n[s]=r.slice():n[s]=r};for(let r=0,l=arguments.length;r<l;r++)arguments[r]&&Q(arguments[r],o);return n}const Wt=(t,n,o,{allOwnKeys:r}={})=>(Q(n,(l,s)=>{o&&S(l)?t[s]=qe(l,o):t[s]=l},{allOwnKeys:r}),t),Yt=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Qt=(t,n,o,r)=>{t.prototype=Object.create(n.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:n.prototype}),o&&Object.assign(t.prototype,o)},Gt=(t,n,o,r)=>{let l,s,a;const i={};if(n=n||{},t==null)return n;do{for(l=Object.getOwnPropertyNames(t),s=l.length;s-- >0;)a=l[s],(!r||r(a,t,n))&&!i[a]&&(n[a]=t[a],i[a]=!0);t=o!==!1&&we(t)}while(t&&(!o||o(t,n))&&t!==Object.prototype);return n},Xt=(t,n,o)=>{t=String(t),(o===void 0||o>t.length)&&(o=t.length),o-=n.length;const r=t.indexOf(n,o);return r!==-1&&r===o},Zt=t=>{if(!t)return null;if(q(t))return t;let n=t.length;if(!Je(n))return null;const o=new Array(n);for(;n-- >0;)o[n]=t[n];return o},en=(t=>n=>t&&n instanceof t)(typeof Uint8Array<"u"&&we(Uint8Array)),tn=(t,n)=>{const r=(t&&t[re]).call(t);let l;for(;(l=r.next())&&!l.done;){const s=l.value;n.call(t,s[0],s[1])}},nn=(t,n)=>{let o;const r=[];for(;(o=t.exec(n))!==null;)r.push(o);return r},rn=T("HTMLFormElement"),on=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(o,r,l){return r.toUpperCase()+l}),Be=(({hasOwnProperty:t})=>(n,o)=>t.call(n,o))(Object.prototype),ln=T("RegExp"),Qe=(t,n)=>{const o=Object.getOwnPropertyDescriptors(t),r={};Q(o,(l,s)=>{let a;(a=n(l,s,t))!==!1&&(r[s]=a||l)}),Object.defineProperties(t,r)},sn=t=>{Qe(t,(n,o)=>{if(S(t)&&["arguments","caller","callee"].indexOf(o)!==-1)return!1;const r=t[o];if(S(r)){if(n.enumerable=!1,"writable"in n){n.writable=!1;return}n.set||(n.set=()=>{throw Error("Can not rewrite read-only method '"+o+"'")})}})},an=(t,n)=>{const o={},r=l=>{l.forEach(s=>{o[s]=!0})};return q(t)?r(t):r(String(t).split(n)),o},un=()=>{},cn=(t,n)=>t!=null&&Number.isFinite(t=+t)?t:n;function dn(t){return!!(t&&S(t.append)&&t[He]==="FormData"&&t[re])}const fn=t=>{const n=new Array(10),o=(r,l)=>{if(Y(r)){if(n.indexOf(r)>=0)return;if(W(r))return r;if(!("toJSON"in r)){n[l]=r;const s=q(r)?[]:{};return Q(r,(a,i)=>{const m=o(a,l+1);!J(m)&&(s[i]=m)}),n[l]=void 0,s}}return r};return o(t,0)},pn=T("AsyncFunction"),mn=t=>t&&(Y(t)||S(t))&&S(t.then)&&S(t.catch),Ge=((t,n)=>t?setImmediate:n?((o,r)=>(j.addEventListener("message",({source:l,data:s})=>{l===j&&s===o&&r.length&&r.shift()()},!1),l=>{r.push(l),j.postMessage(o,"*")}))(`axios@${Math.random()}`,[]):o=>setTimeout(o))(typeof setImmediate=="function",S(j.postMessage)),hn=typeof queueMicrotask<"u"?queueMicrotask.bind(j):typeof process<"u"&&process.nextTick||Ge,gn=t=>t!=null&&S(t[re]),p={isArray:q,isArrayBuffer:Ke,isBuffer:W,isFormData:Ut,isArrayBufferView:Tt,isString:Ot,isNumber:Je,isBoolean:Ft,isObject:Y,isPlainObject:X,isEmptyObject:Dt,isReadableStream:zt,isRequest:qt,isResponse:Ht,isHeaders:Kt,isUndefined:J,isDate:$t,isFile:Mt,isBlob:Lt,isRegExp:ln,isFunction:S,isStream:jt,isURLSearchParams:It,isTypedArray:en,isFileList:Pt,forEach:Q,merge:pe,extend:Wt,trim:Jt,stripBOM:Yt,inherits:Qt,toFlatObject:Gt,kindOf:oe,kindOfTest:T,endsWith:Xt,toArray:Zt,forEachEntry:tn,matchAll:nn,isHTMLForm:rn,hasOwnProperty:Be,hasOwnProp:Be,reduceDescriptors:Qe,freezeMethods:sn,toObjectSet:an,toCamelCase:on,noop:un,toFiniteNumber:cn,findKey:We,global:j,isContextDefined:Ye,isSpecCompliantForm:dn,toJSONObject:fn,isAsyncFn:pn,isThenable:mn,setImmediate:Ge,asap:hn,isIterable:gn};function C(t,n,o,r,l){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",n&&(this.code=n),o&&(this.config=o),r&&(this.request=r),l&&(this.response=l,this.status=l.status?l.status:null)}p.inherits(C,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:p.toJSONObject(this.config),code:this.code,status:this.status}}});const Xe=C.prototype,Ze={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{Ze[t]={value:t}});Object.defineProperties(C,Ze);Object.defineProperty(Xe,"isAxiosError",{value:!0});C.from=(t,n,o,r,l,s)=>{const a=Object.create(Xe);return p.toFlatObject(t,a,function(m){return m!==Error.prototype},i=>i!=="isAxiosError"),C.call(a,t.message,n,o,r,l),a.cause=t,a.name=t.name,s&&Object.assign(a,s),a};const yn=null;function me(t){return p.isPlainObject(t)||p.isArray(t)}function et(t){return p.endsWith(t,"[]")?t.slice(0,-2):t}function Ne(t,n,o){return t?t.concat(n).map(function(l,s){return l=et(l),!o&&s?"["+l+"]":l}).join(o?".":""):n}function bn(t){return p.isArray(t)&&!t.some(me)}const vn=p.toFlatObject(p,{},null,function(n){return/^is[A-Z]/.test(n)});function se(t,n,o){if(!p.isObject(t))throw new TypeError("target must be an object");n=n||new FormData,o=p.toFlatObject(o,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,k){return!p.isUndefined(k[y])});const r=o.metaTokens,l=o.visitor||c,s=o.dots,a=o.indexes,m=(o.Blob||typeof Blob<"u"&&Blob)&&p.isSpecCompliantForm(n);if(!p.isFunction(l))throw new TypeError("visitor must be a function");function f(v){if(v===null)return"";if(p.isDate(v))return v.toISOString();if(p.isBoolean(v))return v.toString();if(!m&&p.isBlob(v))throw new C("Blob is not supported. Use a Buffer instead.");return p.isArrayBuffer(v)||p.isTypedArray(v)?m&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}function c(v,y,k){let b=v;if(v&&!k&&typeof v=="object"){if(p.endsWith(y,"{}"))y=r?y:y.slice(0,-2),v=JSON.stringify(v);else if(p.isArray(v)&&bn(v)||(p.isFileList(v)||p.endsWith(y,"[]"))&&(b=p.toArray(v)))return y=et(y),b.forEach(function(h,w){!(p.isUndefined(h)||h===null)&&n.append(a===!0?Ne([y],w,s):a===null?y:y+"[]",f(h))}),!1}return me(v)?!0:(n.append(Ne(k,y,s),f(v)),!1)}const d=[],g=Object.assign(vn,{defaultVisitor:c,convertValue:f,isVisitable:me});function x(v,y){if(!p.isUndefined(v)){if(d.indexOf(v)!==-1)throw Error("Circular reference detected in "+y.join("."));d.push(v),p.forEach(v,function(b,u){(!(p.isUndefined(b)||b===null)&&l.call(n,b,p.isString(u)?u.trim():u,y,g))===!0&&x(b,y?y.concat(u):[u])}),d.pop()}}if(!p.isObject(t))throw new TypeError("data must be an object");return x(t),n}function _e(t){const n={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return n[r]})}function xe(t,n){this._pairs=[],t&&se(t,this,n)}const tt=xe.prototype;tt.append=function(n,o){this._pairs.push([n,o])};tt.toString=function(n){const o=n?function(r){return n.call(this,r,_e)}:_e;return this._pairs.map(function(l){return o(l[0])+"="+o(l[1])},"").join("&")};function wn(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function nt(t,n,o){if(!n)return t;const r=o&&o.encode||wn;p.isFunction(o)&&(o={serialize:o});const l=o&&o.serialize;let s;if(l?s=l(n,o):s=p.isURLSearchParams(n)?n.toString():new xe(n,o).toString(r),s){const a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+s}return t}class Se{constructor(){this.handlers=[]}use(n,o,r){return this.handlers.push({fulfilled:n,rejected:o,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(n){this.handlers[n]&&(this.handlers[n]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(n){p.forEach(this.handlers,function(r){r!==null&&n(r)})}}const rt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},xn=typeof URLSearchParams<"u"?URLSearchParams:xe,kn=typeof FormData<"u"?FormData:null,En=typeof Blob<"u"?Blob:null,Cn={isBrowser:!0,classes:{URLSearchParams:xn,FormData:kn,Blob:En},protocols:["http","https","file","blob","url","data"]},ke=typeof window<"u"&&typeof document<"u",he=typeof navigator=="object"&&navigator||void 0,Vn=ke&&(!he||["ReactNative","NativeScript","NS"].indexOf(he.product)<0),Bn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Nn=ke&&window.location.href||"http://localhost",_n=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ke,hasStandardBrowserEnv:Vn,hasStandardBrowserWebWorkerEnv:Bn,navigator:he,origin:Nn},Symbol.toStringTag,{value:"Module"})),_={..._n,...Cn};function Sn(t,n){return se(t,new _.classes.URLSearchParams,{visitor:function(o,r,l,s){return _.isNode&&p.isBuffer(o)?(this.append(r,o.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)},...n})}function Rn(t){return p.matchAll(/\w+|\[(\w*)]/g,t).map(n=>n[0]==="[]"?"":n[1]||n[0])}function An(t){const n={},o=Object.keys(t);let r;const l=o.length;let s;for(r=0;r<l;r++)s=o[r],n[s]=t[s];return n}function ot(t){function n(o,r,l,s){let a=o[s++];if(a==="__proto__")return!0;const i=Number.isFinite(+a),m=s>=o.length;return a=!a&&p.isArray(l)?l.length:a,m?(p.hasOwnProp(l,a)?l[a]=[l[a],r]:l[a]=r,!i):((!l[a]||!p.isObject(l[a]))&&(l[a]=[]),n(o,r,l[a],s)&&p.isArray(l[a])&&(l[a]=An(l[a])),!i)}if(p.isFormData(t)&&p.isFunction(t.entries)){const o={};return p.forEachEntry(t,(r,l)=>{n(Rn(r),l,o,0)}),o}return null}function Tn(t,n,o){if(p.isString(t))try{return(n||JSON.parse)(t),p.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(o||JSON.stringify)(t)}const G={transitional:rt,adapter:["xhr","http","fetch"],transformRequest:[function(n,o){const r=o.getContentType()||"",l=r.indexOf("application/json")>-1,s=p.isObject(n);if(s&&p.isHTMLForm(n)&&(n=new FormData(n)),p.isFormData(n))return l?JSON.stringify(ot(n)):n;if(p.isArrayBuffer(n)||p.isBuffer(n)||p.isStream(n)||p.isFile(n)||p.isBlob(n)||p.isReadableStream(n))return n;if(p.isArrayBufferView(n))return n.buffer;if(p.isURLSearchParams(n))return o.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),n.toString();let i;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Sn(n,this.formSerializer).toString();if((i=p.isFileList(n))||r.indexOf("multipart/form-data")>-1){const m=this.env&&this.env.FormData;return se(i?{"files[]":n}:n,m&&new m,this.formSerializer)}}return s||l?(o.setContentType("application/json",!1),Tn(n)):n}],transformResponse:[function(n){const o=this.transitional||G.transitional,r=o&&o.forcedJSONParsing,l=this.responseType==="json";if(p.isResponse(n)||p.isReadableStream(n))return n;if(n&&p.isString(n)&&(r&&!this.responseType||l)){const a=!(o&&o.silentJSONParsing)&&l;try{return JSON.parse(n)}catch(i){if(a)throw i.name==="SyntaxError"?C.from(i,C.ERR_BAD_RESPONSE,this,null,this.response):i}}return n}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:_.classes.FormData,Blob:_.classes.Blob},validateStatus:function(n){return n>=200&&n<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};p.forEach(["delete","get","head","post","put","patch"],t=>{G.headers[t]={}});const On=p.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Fn=t=>{const n={};let o,r,l;return t&&t.split(`
2
+ `).forEach(function(a){l=a.indexOf(":"),o=a.substring(0,l).trim().toLowerCase(),r=a.substring(l+1).trim(),!(!o||n[o]&&On[o])&&(o==="set-cookie"?n[o]?n[o].push(r):n[o]=[r]:n[o]=n[o]?n[o]+", "+r:r)}),n},Re=Symbol("internals");function K(t){return t&&String(t).trim().toLowerCase()}function Z(t){return t===!1||t==null?t:p.isArray(t)?t.map(Z):String(t)}function Dn(t){const n=Object.create(null),o=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=o.exec(t);)n[r[1]]=r[2];return n}const $n=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function ce(t,n,o,r,l){if(p.isFunction(r))return r.call(this,n,o);if(l&&(n=o),!!p.isString(n)){if(p.isString(r))return n.indexOf(r)!==-1;if(p.isRegExp(r))return r.test(n)}}function Mn(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(n,o,r)=>o.toUpperCase()+r)}function Ln(t,n){const o=p.toCamelCase(" "+n);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+o,{value:function(l,s,a){return this[r].call(this,n,l,s,a)},configurable:!0})})}let R=class{constructor(n){n&&this.set(n)}set(n,o,r){const l=this;function s(i,m,f){const c=K(m);if(!c)throw new Error("header name must be a non-empty string");const d=p.findKey(l,c);(!d||l[d]===void 0||f===!0||f===void 0&&l[d]!==!1)&&(l[d||m]=Z(i))}const a=(i,m)=>p.forEach(i,(f,c)=>s(f,c,m));if(p.isPlainObject(n)||n instanceof this.constructor)a(n,o);else if(p.isString(n)&&(n=n.trim())&&!$n(n))a(Fn(n),o);else if(p.isObject(n)&&p.isIterable(n)){let i={},m,f;for(const c of n){if(!p.isArray(c))throw TypeError("Object iterator must return a key-value pair");i[f=c[0]]=(m=i[f])?p.isArray(m)?[...m,c[1]]:[m,c[1]]:c[1]}a(i,o)}else n!=null&&s(o,n,r);return this}get(n,o){if(n=K(n),n){const r=p.findKey(this,n);if(r){const l=this[r];if(!o)return l;if(o===!0)return Dn(l);if(p.isFunction(o))return o.call(this,l,r);if(p.isRegExp(o))return o.exec(l);throw new TypeError("parser must be boolean|regexp|function")}}}has(n,o){if(n=K(n),n){const r=p.findKey(this,n);return!!(r&&this[r]!==void 0&&(!o||ce(this,this[r],r,o)))}return!1}delete(n,o){const r=this;let l=!1;function s(a){if(a=K(a),a){const i=p.findKey(r,a);i&&(!o||ce(r,r[i],i,o))&&(delete r[i],l=!0)}}return p.isArray(n)?n.forEach(s):s(n),l}clear(n){const o=Object.keys(this);let r=o.length,l=!1;for(;r--;){const s=o[r];(!n||ce(this,this[s],s,n,!0))&&(delete this[s],l=!0)}return l}normalize(n){const o=this,r={};return p.forEach(this,(l,s)=>{const a=p.findKey(r,s);if(a){o[a]=Z(l),delete o[s];return}const i=n?Mn(s):String(s).trim();i!==s&&delete o[s],o[i]=Z(l),r[i]=!0}),this}concat(...n){return this.constructor.concat(this,...n)}toJSON(n){const o=Object.create(null);return p.forEach(this,(r,l)=>{r!=null&&r!==!1&&(o[l]=n&&p.isArray(r)?r.join(", "):r)}),o}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([n,o])=>n+": "+o).join(`
3
+ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(n){return n instanceof this?n:new this(n)}static concat(n,...o){const r=new this(n);return o.forEach(l=>r.set(l)),r}static accessor(n){const r=(this[Re]=this[Re]={accessors:{}}).accessors,l=this.prototype;function s(a){const i=K(a);r[i]||(Ln(l,a),r[i]=!0)}return p.isArray(n)?n.forEach(s):s(n),this}};R.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);p.reduceDescriptors(R.prototype,({value:t},n)=>{let o=n[0].toUpperCase()+n.slice(1);return{get:()=>t,set(r){this[o]=r}}});p.freezeMethods(R);function de(t,n){const o=this||G,r=n||o,l=R.from(r.headers);let s=r.data;return p.forEach(t,function(i){s=i.call(o,s,l.normalize(),n?n.status:void 0)}),l.normalize(),s}function lt(t){return!!(t&&t.__CANCEL__)}function H(t,n,o){C.call(this,t??"canceled",C.ERR_CANCELED,n,o),this.name="CanceledError"}p.inherits(H,C,{__CANCEL__:!0});function st(t,n,o){const r=o.config.validateStatus;!o.status||!r||r(o.status)?t(o):n(new C("Request failed with status code "+o.status,[C.ERR_BAD_REQUEST,C.ERR_BAD_RESPONSE][Math.floor(o.status/100)-4],o.config,o.request,o))}function Pn(t){const n=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return n&&n[1]||""}function jn(t,n){t=t||10;const o=new Array(t),r=new Array(t);let l=0,s=0,a;return n=n!==void 0?n:1e3,function(m){const f=Date.now(),c=r[s];a||(a=f),o[l]=m,r[l]=f;let d=s,g=0;for(;d!==l;)g+=o[d++],d=d%t;if(l=(l+1)%t,l===s&&(s=(s+1)%t),f-a<n)return;const x=c&&f-c;return x?Math.round(g*1e3/x):void 0}}function Un(t,n){let o=0,r=1e3/n,l,s;const a=(f,c=Date.now())=>{o=c,l=null,s&&(clearTimeout(s),s=null),t(...f)};return[(...f)=>{const c=Date.now(),d=c-o;d>=r?a(f,c):(l=f,s||(s=setTimeout(()=>{s=null,a(l)},r-d)))},()=>l&&a(l)]}const te=(t,n,o=3)=>{let r=0;const l=jn(50,250);return Un(s=>{const a=s.loaded,i=s.lengthComputable?s.total:void 0,m=a-r,f=l(m),c=a<=i;r=a;const d={loaded:a,total:i,progress:i?a/i:void 0,bytes:m,rate:f||void 0,estimated:f&&i&&c?(i-a)/f:void 0,event:s,lengthComputable:i!=null,[n?"download":"upload"]:!0};t(d)},o)},Ae=(t,n)=>{const o=t!=null;return[r=>n[0]({lengthComputable:o,total:t,loaded:r}),n[1]]},Te=t=>(...n)=>p.asap(()=>t(...n)),In=_.hasStandardBrowserEnv?((t,n)=>o=>(o=new URL(o,_.origin),t.protocol===o.protocol&&t.host===o.host&&(n||t.port===o.port)))(new URL(_.origin),_.navigator&&/(msie|trident)/i.test(_.navigator.userAgent)):()=>!0,zn=_.hasStandardBrowserEnv?{write(t,n,o,r,l,s){const a=[t+"="+encodeURIComponent(n)];p.isNumber(o)&&a.push("expires="+new Date(o).toGMTString()),p.isString(r)&&a.push("path="+r),p.isString(l)&&a.push("domain="+l),s===!0&&a.push("secure"),document.cookie=a.join("; ")},read(t){const n=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function qn(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Hn(t,n){return n?t.replace(/\/?\/$/,"")+"/"+n.replace(/^\/+/,""):t}function at(t,n,o){let r=!qn(n);return t&&(r||o==!1)?Hn(t,n):n}const Oe=t=>t instanceof R?{...t}:t;function I(t,n){n=n||{};const o={};function r(f,c,d,g){return p.isPlainObject(f)&&p.isPlainObject(c)?p.merge.call({caseless:g},f,c):p.isPlainObject(c)?p.merge({},c):p.isArray(c)?c.slice():c}function l(f,c,d,g){if(p.isUndefined(c)){if(!p.isUndefined(f))return r(void 0,f,d,g)}else return r(f,c,d,g)}function s(f,c){if(!p.isUndefined(c))return r(void 0,c)}function a(f,c){if(p.isUndefined(c)){if(!p.isUndefined(f))return r(void 0,f)}else return r(void 0,c)}function i(f,c,d){if(d in n)return r(f,c);if(d in t)return r(void 0,f)}const m={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:i,headers:(f,c,d)=>l(Oe(f),Oe(c),d,!0)};return p.forEach(Object.keys({...t,...n}),function(c){const d=m[c]||l,g=d(t[c],n[c],c);p.isUndefined(g)&&d!==i||(o[c]=g)}),o}const it=t=>{const n=I({},t);let{data:o,withXSRFToken:r,xsrfHeaderName:l,xsrfCookieName:s,headers:a,auth:i}=n;n.headers=a=R.from(a),n.url=nt(at(n.baseURL,n.url,n.allowAbsoluteUrls),t.params,t.paramsSerializer),i&&a.set("Authorization","Basic "+btoa((i.username||"")+":"+(i.password?unescape(encodeURIComponent(i.password)):"")));let m;if(p.isFormData(o)){if(_.hasStandardBrowserEnv||_.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((m=a.getContentType())!==!1){const[f,...c]=m?m.split(";").map(d=>d.trim()).filter(Boolean):[];a.setContentType([f||"multipart/form-data",...c].join("; "))}}if(_.hasStandardBrowserEnv&&(r&&p.isFunction(r)&&(r=r(n)),r||r!==!1&&In(n.url))){const f=l&&s&&zn.read(s);f&&a.set(l,f)}return n},Kn=typeof XMLHttpRequest<"u",Jn=Kn&&function(t){return new Promise(function(o,r){const l=it(t);let s=l.data;const a=R.from(l.headers).normalize();let{responseType:i,onUploadProgress:m,onDownloadProgress:f}=l,c,d,g,x,v;function y(){x&&x(),v&&v(),l.cancelToken&&l.cancelToken.unsubscribe(c),l.signal&&l.signal.removeEventListener("abort",c)}let k=new XMLHttpRequest;k.open(l.method.toUpperCase(),l.url,!0),k.timeout=l.timeout;function b(){if(!k)return;const h=R.from("getAllResponseHeaders"in k&&k.getAllResponseHeaders()),E={data:!i||i==="text"||i==="json"?k.responseText:k.response,status:k.status,statusText:k.statusText,headers:h,config:t,request:k};st(function($){o($),y()},function($){r($),y()},E),k=null}"onloadend"in k?k.onloadend=b:k.onreadystatechange=function(){!k||k.readyState!==4||k.status===0&&!(k.responseURL&&k.responseURL.indexOf("file:")===0)||setTimeout(b)},k.onabort=function(){k&&(r(new C("Request aborted",C.ECONNABORTED,t,k)),k=null)},k.onerror=function(){r(new C("Network Error",C.ERR_NETWORK,t,k)),k=null},k.ontimeout=function(){let w=l.timeout?"timeout of "+l.timeout+"ms exceeded":"timeout exceeded";const E=l.transitional||rt;l.timeoutErrorMessage&&(w=l.timeoutErrorMessage),r(new C(w,E.clarifyTimeoutError?C.ETIMEDOUT:C.ECONNABORTED,t,k)),k=null},s===void 0&&a.setContentType(null),"setRequestHeader"in k&&p.forEach(a.toJSON(),function(w,E){k.setRequestHeader(E,w)}),p.isUndefined(l.withCredentials)||(k.withCredentials=!!l.withCredentials),i&&i!=="json"&&(k.responseType=l.responseType),f&&([g,v]=te(f,!0),k.addEventListener("progress",g)),m&&k.upload&&([d,x]=te(m),k.upload.addEventListener("progress",d),k.upload.addEventListener("loadend",x)),(l.cancelToken||l.signal)&&(c=h=>{k&&(r(!h||h.type?new H(null,t,k):h),k.abort(),k=null)},l.cancelToken&&l.cancelToken.subscribe(c),l.signal&&(l.signal.aborted?c():l.signal.addEventListener("abort",c)));const u=Pn(l.url);if(u&&_.protocols.indexOf(u)===-1){r(new C("Unsupported protocol "+u+":",C.ERR_BAD_REQUEST,t));return}k.send(s||null)})},Wn=(t,n)=>{const{length:o}=t=t?t.filter(Boolean):[];if(n||o){let r=new AbortController,l;const s=function(f){if(!l){l=!0,i();const c=f instanceof Error?f:this.reason;r.abort(c instanceof C?c:new H(c instanceof Error?c.message:c))}};let a=n&&setTimeout(()=>{a=null,s(new C(`timeout ${n} of ms exceeded`,C.ETIMEDOUT))},n);const i=()=>{t&&(a&&clearTimeout(a),a=null,t.forEach(f=>{f.unsubscribe?f.unsubscribe(s):f.removeEventListener("abort",s)}),t=null)};t.forEach(f=>f.addEventListener("abort",s));const{signal:m}=r;return m.unsubscribe=()=>p.asap(i),m}},Yn=function*(t,n){let o=t.byteLength;if(o<n){yield t;return}let r=0,l;for(;r<o;)l=r+n,yield t.slice(r,l),r=l},Qn=async function*(t,n){for await(const o of Gn(t))yield*Yn(o,n)},Gn=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const n=t.getReader();try{for(;;){const{done:o,value:r}=await n.read();if(o)break;yield r}}finally{await n.cancel()}},Fe=(t,n,o,r)=>{const l=Qn(t,n);let s=0,a,i=m=>{a||(a=!0,r&&r(m))};return new ReadableStream({async pull(m){try{const{done:f,value:c}=await l.next();if(f){i(),m.close();return}let d=c.byteLength;if(o){let g=s+=d;o(g)}m.enqueue(new Uint8Array(c))}catch(f){throw i(f),f}},cancel(m){return i(m),l.return()}},{highWaterMark:2})},ae=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",ut=ae&&typeof ReadableStream=="function",Xn=ae&&(typeof TextEncoder=="function"?(t=>n=>t.encode(n))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),ct=(t,...n)=>{try{return!!t(...n)}catch{return!1}},Zn=ut&&ct(()=>{let t=!1;const n=new Request(_.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!n}),De=64*1024,ge=ut&&ct(()=>p.isReadableStream(new Response("").body)),ne={stream:ge&&(t=>t.body)};ae&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(n=>{!ne[n]&&(ne[n]=p.isFunction(t[n])?o=>o[n]():(o,r)=>{throw new C(`Response type '${n}' is not supported`,C.ERR_NOT_SUPPORT,r)})})})(new Response);const er=async t=>{if(t==null)return 0;if(p.isBlob(t))return t.size;if(p.isSpecCompliantForm(t))return(await new Request(_.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(p.isArrayBufferView(t)||p.isArrayBuffer(t))return t.byteLength;if(p.isURLSearchParams(t)&&(t=t+""),p.isString(t))return(await Xn(t)).byteLength},tr=async(t,n)=>{const o=p.toFiniteNumber(t.getContentLength());return o??er(n)},nr=ae&&(async t=>{let{url:n,method:o,data:r,signal:l,cancelToken:s,timeout:a,onDownloadProgress:i,onUploadProgress:m,responseType:f,headers:c,withCredentials:d="same-origin",fetchOptions:g}=it(t);f=f?(f+"").toLowerCase():"text";let x=Wn([l,s&&s.toAbortSignal()],a),v;const y=x&&x.unsubscribe&&(()=>{x.unsubscribe()});let k;try{if(m&&Zn&&o!=="get"&&o!=="head"&&(k=await tr(c,r))!==0){let E=new Request(n,{method:"POST",body:r,duplex:"half"}),A;if(p.isFormData(r)&&(A=E.headers.get("content-type"))&&c.setContentType(A),E.body){const[$,z]=Ae(k,te(Te(m)));r=Fe(E.body,De,$,z)}}p.isString(d)||(d=d?"include":"omit");const b="credentials"in Request.prototype;v=new Request(n,{...g,signal:x,method:o.toUpperCase(),headers:c.normalize().toJSON(),body:r,duplex:"half",credentials:b?d:void 0});let u=await fetch(v,g);const h=ge&&(f==="stream"||f==="response");if(ge&&(i||h&&y)){const E={};["status","statusText","headers"].forEach(V=>{E[V]=u[V]});const A=p.toFiniteNumber(u.headers.get("content-length")),[$,z]=i&&Ae(A,te(Te(i),!0))||[];u=new Response(Fe(u.body,De,$,()=>{z&&z(),y&&y()}),E)}f=f||"text";let w=await ne[p.findKey(ne,f)||"text"](u,t);return!h&&y&&y(),await new Promise((E,A)=>{st(E,A,{data:w,headers:R.from(u.headers),status:u.status,statusText:u.statusText,config:t,request:v})})}catch(b){throw y&&y(),b&&b.name==="TypeError"&&/Load failed|fetch/i.test(b.message)?Object.assign(new C("Network Error",C.ERR_NETWORK,t,v),{cause:b.cause||b}):C.from(b,b&&b.code,t,v)}}),ye={http:yn,xhr:Jn,fetch:nr};p.forEach(ye,(t,n)=>{if(t){try{Object.defineProperty(t,"name",{value:n})}catch{}Object.defineProperty(t,"adapterName",{value:n})}});const $e=t=>`- ${t}`,rr=t=>p.isFunction(t)||t===null||t===!1,dt={getAdapter:t=>{t=p.isArray(t)?t:[t];const{length:n}=t;let o,r;const l={};for(let s=0;s<n;s++){o=t[s];let a;if(r=o,!rr(o)&&(r=ye[(a=String(o)).toLowerCase()],r===void 0))throw new C(`Unknown adapter '${a}'`);if(r)break;l[a||"#"+s]=r}if(!r){const s=Object.entries(l).map(([i,m])=>`adapter ${i} `+(m===!1?"is not supported by the environment":"is not available in the build"));let a=n?s.length>1?`since :
4
+ `+s.map($e).join(`
5
+ `):" "+$e(s[0]):"as no adapter specified";throw new C("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r},adapters:ye};function fe(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new H(null,t)}function Me(t){return fe(t),t.headers=R.from(t.headers),t.data=de.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),dt.getAdapter(t.adapter||G.adapter)(t).then(function(r){return fe(t),r.data=de.call(t,t.transformResponse,r),r.headers=R.from(r.headers),r},function(r){return lt(r)||(fe(t),r&&r.response&&(r.response.data=de.call(t,t.transformResponse,r.response),r.response.headers=R.from(r.response.headers))),Promise.reject(r)})}const ft="1.11.0",ie={};["object","boolean","number","function","string","symbol"].forEach((t,n)=>{ie[t]=function(r){return typeof r===t||"a"+(n<1?"n ":" ")+t}});const Le={};ie.transitional=function(n,o,r){function l(s,a){return"[Axios v"+ft+"] Transitional option '"+s+"'"+a+(r?". "+r:"")}return(s,a,i)=>{if(n===!1)throw new C(l(a," has been removed"+(o?" in "+o:"")),C.ERR_DEPRECATED);return o&&!Le[a]&&(Le[a]=!0,console.warn(l(a," has been deprecated since v"+o+" and will be removed in the near future"))),n?n(s,a,i):!0}};ie.spelling=function(n){return(o,r)=>(console.warn(`${r} is likely a misspelling of ${n}`),!0)};function or(t,n,o){if(typeof t!="object")throw new C("options must be an object",C.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let l=r.length;for(;l-- >0;){const s=r[l],a=n[s];if(a){const i=t[s],m=i===void 0||a(i,s,t);if(m!==!0)throw new C("option "+s+" must be "+m,C.ERR_BAD_OPTION_VALUE);continue}if(o!==!0)throw new C("Unknown option "+s,C.ERR_BAD_OPTION)}}const ee={assertOptions:or,validators:ie},F=ee.validators;let U=class{constructor(n){this.defaults=n||{},this.interceptors={request:new Se,response:new Se}}async request(n,o){try{return await this._request(n,o)}catch(r){if(r instanceof Error){let l={};Error.captureStackTrace?Error.captureStackTrace(l):l=new Error;const s=l.stack?l.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=`
6
+ `+s):r.stack=s}catch{}}throw r}}_request(n,o){typeof n=="string"?(o=o||{},o.url=n):o=n||{},o=I(this.defaults,o);const{transitional:r,paramsSerializer:l,headers:s}=o;r!==void 0&&ee.assertOptions(r,{silentJSONParsing:F.transitional(F.boolean),forcedJSONParsing:F.transitional(F.boolean),clarifyTimeoutError:F.transitional(F.boolean)},!1),l!=null&&(p.isFunction(l)?o.paramsSerializer={serialize:l}:ee.assertOptions(l,{encode:F.function,serialize:F.function},!0)),o.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?o.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:o.allowAbsoluteUrls=!0),ee.assertOptions(o,{baseUrl:F.spelling("baseURL"),withXsrfToken:F.spelling("withXSRFToken")},!0),o.method=(o.method||this.defaults.method||"get").toLowerCase();let a=s&&p.merge(s.common,s[o.method]);s&&p.forEach(["delete","get","head","post","put","patch","common"],v=>{delete s[v]}),o.headers=R.concat(a,s);const i=[];let m=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(o)===!1||(m=m&&y.synchronous,i.unshift(y.fulfilled,y.rejected))});const f=[];this.interceptors.response.forEach(function(y){f.push(y.fulfilled,y.rejected)});let c,d=0,g;if(!m){const v=[Me.bind(this),void 0];for(v.unshift(...i),v.push(...f),g=v.length,c=Promise.resolve(o);d<g;)c=c.then(v[d++],v[d++]);return c}g=i.length;let x=o;for(d=0;d<g;){const v=i[d++],y=i[d++];try{x=v(x)}catch(k){y.call(this,k);break}}try{c=Me.call(this,x)}catch(v){return Promise.reject(v)}for(d=0,g=f.length;d<g;)c=c.then(f[d++],f[d++]);return c}getUri(n){n=I(this.defaults,n);const o=at(n.baseURL,n.url,n.allowAbsoluteUrls);return nt(o,n.params,n.paramsSerializer)}};p.forEach(["delete","get","head","options"],function(n){U.prototype[n]=function(o,r){return this.request(I(r||{},{method:n,url:o,data:(r||{}).data}))}});p.forEach(["post","put","patch"],function(n){function o(r){return function(s,a,i){return this.request(I(i||{},{method:n,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}U.prototype[n]=o(),U.prototype[n+"Form"]=o(!0)});let lr=class pt{constructor(n){if(typeof n!="function")throw new TypeError("executor must be a function.");let o;this.promise=new Promise(function(s){o=s});const r=this;this.promise.then(l=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](l);r._listeners=null}),this.promise.then=l=>{let s;const a=new Promise(i=>{r.subscribe(i),s=i}).then(l);return a.cancel=function(){r.unsubscribe(s)},a},n(function(s,a,i){r.reason||(r.reason=new H(s,a,i),o(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(n){if(this.reason){n(this.reason);return}this._listeners?this._listeners.push(n):this._listeners=[n]}unsubscribe(n){if(!this._listeners)return;const o=this._listeners.indexOf(n);o!==-1&&this._listeners.splice(o,1)}toAbortSignal(){const n=new AbortController,o=r=>{n.abort(r)};return this.subscribe(o),n.signal.unsubscribe=()=>this.unsubscribe(o),n.signal}static source(){let n;return{token:new pt(function(l){n=l}),cancel:n}}};function sr(t){return function(o){return t.apply(null,o)}}function ar(t){return p.isObject(t)&&t.isAxiosError===!0}const be={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(be).forEach(([t,n])=>{be[n]=t});function mt(t){const n=new U(t),o=qe(U.prototype.request,n);return p.extend(o,U.prototype,n,{allOwnKeys:!0}),p.extend(o,n,null,{allOwnKeys:!0}),o.create=function(l){return mt(I(t,l))},o}const N=mt(G);N.Axios=U;N.CanceledError=H;N.CancelToken=lr;N.isCancel=lt;N.VERSION=ft;N.toFormData=se;N.AxiosError=C;N.Cancel=N.CanceledError;N.all=function(n){return Promise.all(n)};N.spread=sr;N.isAxiosError=ar;N.mergeConfig=I;N.AxiosHeaders=R;N.formToJSON=t=>ot(p.isHTMLForm(t)?new FormData(t):t);N.getAdapter=dt.getAdapter;N.HttpStatusCode=be;N.default=N;const{Axios:wl,AxiosError:xl,CanceledError:kl,isCancel:El,CancelToken:Cl,VERSION:Vl,all:Bl,Cancel:Nl,isAxiosError:_l,spread:Sl,toFormData:Rl,AxiosHeaders:Al,HttpStatusCode:Tl,formToJSON:Ol,getAdapter:Fl,mergeConfig:Dl}=N;function ht(t,n){const{api:o,options:r=[],limit:l=20,dataKey:s="data"}=t,a=t.type==="checkbox";function i(V){return a?Array.isArray(V)?V:V?[V]:[]:V??""}const m=e.ref(i(t.modelValue)),f=e.ref(""),c=e.ref(!1),d=e.ref([]),g=e.ref("id"),x=e.ref("text"),v=e.ref(!1),y=e.ref(t.layout!=="popover"&&r.length>l);function k(V){const O=V.find(Boolean)??{},M=["id","value","code","key"].find(ue=>ue in O)??"id",kt=["text","label","name","title"].find(ue=>ue in O)??"text";return{autoValueKey:M,autoLabelKey:kt}}if(r.length>0){const V=k(r);g.value=V.autoValueKey,x.value=V.autoLabelKey}const b=e.computed(()=>{if(o)return d.value;const V=d.value;if(t.layout==="popover")return V;if(!f.value)return v.value?V:V.slice(0,l);const O=f.value.toLowerCase();return V.filter(M=>M[x.value].toLowerCase().includes(O))});let u=null;async function h(V){if(o){c.value=!0;try{const O=await N.get(o,{params:{json:1,key:V,limit:l}});if(d.value=O.data[s],d.value.length>0){const M=k(d.value);g.value=M.autoValueKey,x.value=M.autoLabelKey}}catch(O){console.error("Failed to fetch remote options:",O)}finally{c.value=!1}}}e.watch(f,V=>{o&&(u&&clearTimeout(u),u=setTimeout(()=>{h(V)},200))}),e.watch(()=>t.modelValue,V=>{m.value=i(V)},{immediate:!0}),o?h(""):d.value=r;function w(V){return a&&Array.isArray(m.value)?m.value.includes(V[g.value]):m.value===V[g.value]}function E(V){if(a&&!Array.isArray(m.value)&&(m.value=[]),a&&Array.isArray(m.value)){const O=m.value.includes(V[g.value]);m.value=O?m.value.filter(M=>M!==V[g.value]):[...m.value,V[g.value]]}else m.value=V[g.value];n("update:modelValue",m.value),n("change",{name:t.name,value:m.value})}function A(){a?m.value=[]:m.value="",n("update:modelValue",m.value),n("clear",t.name)}function $(){u&&clearTimeout(u),f.value="",v.value=!1}function z(){v.value=!v.value}return e.onBeforeUnmount(()=>{u&&clearTimeout(u)}),{innerValue:m,searchTerm:f,filteredOptions:b,isSelected:w,selectItem:E,clear:A,resetSearch:$,toggleShowAll:z,isReqProc:c,showAll:v,isEnableShowAll:y,labelKey:x,valueKey:g}}const D=(t,n)=>{const o=t.__vccOpts||t;for(const[r,l]of n)o[r]=l;return o},ir={},ur={class:"w-48 mx-auto",viewBox:"0 0 178 90",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function cr(t,n){return e.openBlock(),e.createElementBlock("svg",ur,n[0]||(n[0]=[e.createStaticVNode('<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>',12)]))}const gt=D(ir,[["render",cr]]),dr={},fr={xmlns:"http://www.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",class:"icon icon-tabler icons-tabler-outline icon-tabler-chevron-down w-[14px] rotate"};function pr(t,n){return e.openBlock(),e.createElementBlock("svg",fr,n[0]||(n[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)]))}const Ee=D(dr,[["render",pr]]),mr={},hr={xmlns:"http://www.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",class:"icon icon-tabler icons-tabler-outline icon-tabler-chevron-down w-[14px] rotate-[180deg]"};function gr(t,n){return e.openBlock(),e.createElementBlock("svg",hr,n[0]||(n[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)]))}const yt=D(mr,[["render",gr]]),yr={key:0,class:"h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relative justify-center"},br={key:1,class:"w-full"},vr={class:"flex flex-col items-center justify-center p-5 text-center"},wr={key:2,class:"flex justify-between items-center text-xs text-gray-500 pt-2 border-t"},xr=["disabled"],Pe=e.defineComponent({__name:"radio",props:{name:{},type:{},label:{},width:{},options:{default:()=>[]},placeHolder:{},api:{},default:{},modelValue:{},disabled:{type:Boolean,default:!1},layout:{default:"inline"},cleanable:{type:Boolean},limit:{default:10},multi:{type:Boolean},dataKey:{},valueKey:{},labelKey:{}},emits:["update:modelValue","change","clear"],setup(t,{expose:n,emit:o}){const r=t,l=e.ref(null),s=o,{innerValue:a,searchTerm:i,filteredOptions:m,isSelected:f,selectItem:c,clear:d,resetSearch:g,toggleShowAll:x,isReqProc:v,showAll:y,isEnableShowAll:k,labelKey:b,valueKey:u}=ht({...r,modelValue:r.modelValue??r.default??""},s);return e.onMounted(()=>{g()}),n({clear:d,inputTextRef:l}),e.watch(()=>r.modelValue,h=>{h===void 0&&(a.value=void 0)}),(h,w)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(h.layout==="popover"?"p-4 flex flex-col h-full":"flex flex-col vs-filter-checkbox space-y-0.5")},[h.type==="select"?(e.openBlock(),e.createElementBlock("div",yr,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":w[0]||(w[0]=E=>e.isRef(i)?i.value=E:null),class:"w-full h-full text-[13px] px-4 border rounded-sm pl-9 focus:outline-none focus:ring-ring focus:ring-1 focus:ring-blue-500",placeholder:"Пошук",type:"text",ref_key:"inputTextRef",ref:l},null,512),[[e.vModelText,e.unref(i)]]),w[6]||(w[6]=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-search absolute text-gray-400 -translate-y-1/2 left-4 top-1/2"},[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),e.createElementVNode("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"}),e.createElementVNode("path",{d:"M21 21l-6 -6"})],-1)),(e.openBlock(),e.createElementBlock("svg",{onClick:w[1]||(w[1]=E=>i.value=""),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-x absolute text-gray-400 -translate-y-1/2 cursor-pointer hover:text-red-500 right-4 top-1/2",height:"16",width:"16"},w[5]||(w[5]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M18 6l-12 12"},null,-1),e.createElementVNode("path",{d:"M6 6l12 12"},null,-1)])))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(h.layout==="popover"?"flex-1 overflow-y-auto mb-4 max-h-64":"")},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(m),E=>(e.openBlock(),e.createBlock(ze,{layout:h.layout,key:E.id,count:E.count,label:E[e.unref(b)],color:E.color,type:"radio",value:E[e.unref(u)],"is-selected":e.unref(f)(E),onItemClick:A=>e.unref(c)(E)},null,8,["layout","count","label","color","value","is-selected","onItemClick"]))),128))],2),h.type==="select"&&e.unref(m).length===0&&!e.unref(v)?(e.openBlock(),e.createElementBlock("div",br,[e.createElementVNode("div",vr,[e.createVNode(gt),w[7]||(w[7]=e.createElementVNode("div",{class:"max-w-sm mx-auto mt-6"},[e.createElementVNode("p",{class:"font-medium text-gray-800 dark:text-neutral-200"},"За вашим запитом нічого не знайдено"),e.createElementVNode("p",{class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"})],-1))])])):e.createCommentVNode("",!0),h.layout==="popover"?(e.openBlock(),e.createElementBlock("div",wr,[e.createElementVNode("button",{class:"text-gray-600 hover:text-gray-800",disabled:e.unref(a).length===0,onClick:w[2]||(w[2]=(...E)=>e.unref(d)&&e.unref(d)(...E))}," Clear ",8,xr)])):e.createCommentVNode("",!0)],2),h.layout!=="popover"&&h.type!=="select"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[!e.unref(y)&&e.unref(k)?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:w[3]||(w[3]=(...E)=>e.unref(x)&&e.unref(x)(...E)),class:"inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"},[w[8]||(w[8]=e.createTextVNode(" Показати більше ")),e.createVNode(Ee)])):e.createCommentVNode("",!0),e.unref(y)?(e.openBlock(),e.createElementBlock("div",{key:1,onClick:w[4]||(w[4]=(...E)=>e.unref(x)&&e.unref(x)(...E)),class:"inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"},[w[9]||(w[9]=e.createTextVNode(" Показати менше ")),e.createVNode(yt)])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64))}}),kr={key:0,class:"h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relative justify-center"},Er={key:1,class:"w-full"},Cr={class:"flex flex-col items-center justify-center p-5 text-center"},Vr={key:2,class:"flex justify-between items-center text-xs text-gray-500 pt-2 border-t"},Br=["disabled"],ve=e.defineComponent({__name:"checkbox",props:{name:{},type:{},label:{},width:{},options:{default:()=>[]},placeHolder:{},api:{},default:{},modelValue:{},disabled:{type:Boolean,default:!1},layout:{default:"inline"},cleanable:{type:Boolean},limit:{default:10},multi:{type:Boolean},dataKey:{},valueKey:{},labelKey:{}},emits:["update:modelValue","change","clear"],setup(t,{expose:n,emit:o}){const r=t,l=o,{innerValue:s,filteredOptions:a,isSelected:i,selectItem:m,clear:f,resetSearch:c,toggleShowAll:d,isReqProc:g,showAll:x,isEnableShowAll:v,searchTerm:y,labelKey:k,valueKey:b}=ht({...r,type:"checkbox",modelValue:r.modelValue},l);return e.onMounted(()=>{c()}),e.watch(()=>r.modelValue,u=>{u===void 0&&(s.value=[])}),n({clear:f}),(u,h)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(u.layout==="popover"?"p-4 flex flex-col h-full":"flex flex-col vs-filter-checkbox space-y-0.5")},[u.type==="select"?(e.openBlock(),e.createElementBlock("div",kr,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":h[0]||(h[0]=w=>e.isRef(y)?y.value=w:null),class:"w-full h-full text-[13px] px-4 border rounded-sm pl-9 focus:outline-none focus:ring-ring focus:ring-1 focus:ring-blue-500",placeholder:"Пошук",type:"text",ref:"inputTextRef"},null,512),[[e.vModelText,e.unref(y)]]),h[6]||(h[6]=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-search absolute text-gray-400 -translate-y-1/2 left-4 top-1/2"},[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),e.createElementVNode("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"}),e.createElementVNode("path",{d:"M21 21l-6 -6"})],-1)),(e.openBlock(),e.createElementBlock("svg",{onClick:h[1]||(h[1]=w=>y.value=""),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-x absolute text-gray-400 -translate-y-1/2 cursor-pointer hover:text-red-500 right-4 top-1/2",height:"16",width:"16"},h[5]||(h[5]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M18 6l-12 12"},null,-1),e.createElementVNode("path",{d:"M6 6l12 12"},null,-1)])))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(u.layout==="popover"?"flex-1 overflow-y-auto mb-4 max-h-64":"")},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(a),w=>(e.openBlock(),e.createBlock(ze,{layout:u.layout,count:w.count,label:w[e.unref(k)],color:w.color,type:"checkbox",value:w[e.unref(b)],"is-selected":e.unref(i)(w),onItemClick:E=>e.unref(m)(w)},null,8,["layout","count","label","color","value","is-selected","onItemClick"]))),256))],2),u.type==="select"&&e.unref(a).length===0&&!e.unref(g)?(e.openBlock(),e.createElementBlock("div",Er,[e.createElementVNode("div",Cr,[e.createVNode(gt),h[7]||(h[7]=e.createElementVNode("div",{class:"max-w-sm mx-auto mt-6"},[e.createElementVNode("p",{class:"font-medium text-gray-800 dark:text-neutral-200"},"За вашим запитом нічого не знайдено"),e.createElementVNode("p",{class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"})],-1))])])):e.createCommentVNode("",!0),u.layout==="popover"?(e.openBlock(),e.createElementBlock("div",Vr,[e.createElementVNode("button",{class:"text-gray-600 hover:text-gray-800",disabled:e.unref(s)===0,onClick:h[2]||(h[2]=(...w)=>e.unref(f)&&e.unref(f)(...w))}," Clear ",8,Br)])):e.createCommentVNode("",!0)],2),u.layout!=="popover"&&u.type!=="select"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[!e.unref(x)&&e.unref(v)?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:h[3]||(h[3]=(...w)=>e.unref(d)&&e.unref(d)(...w)),class:"inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"},[h[8]||(h[8]=e.createTextVNode(" Показати більше ")),e.createVNode(Ee)])):e.createCommentVNode("",!0),e.unref(x)?(e.openBlock(),e.createElementBlock("div",{key:1,onClick:h[4]||(h[4]=(...w)=>e.unref(d)&&e.unref(d)(...w)),class:"inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"},[h[9]||(h[9]=e.createTextVNode(" Показати менше ")),e.createVNode(yt)])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64))}}),Nr={},_r={xmlns:"http://www.w3.org/2000/svg",width:"15px",height:"15px",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-search stroke-gray-500 transition-all"};function Sr(t,n){return e.openBlock(),e.createElementBlock("svg",_r,n[0]||(n[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"},null,-1),e.createElementVNode("path",{d:"M21 21l-6 -6"},null,-1)]))}const Rr=D(Nr,[["render",Sr]]),Ar={},Tr={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-x stroke-gray-500 hover:stroke-red-500 transition-all",width:"15px",height:"15px"};function Or(t,n){return e.openBlock(),e.createElementBlock("svg",Tr,n[0]||(n[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M18 6l-12 12"},null,-1),e.createElementVNode("path",{d:"M6 6l12 12"},null,-1)]))}const Fr=D(Ar,[["render",Or]]);class bt{static getWidthClass(n){return typeof n=="number"?`w-[${n}px]`:typeof n=="string"?n.endsWith("%")||n.endsWith("px")?`w-[${n}]`:`w-${n}`:"w-full"}}const Dr={class:"absolute bottom-2/4 translate-y-2/4 cursor-pointer left-3"},$r=["placeholder"],Mr=e.defineComponent({__name:"text-input",props:{name:{},type:{},label:{},width:{default:220},options:{},placeHolder:{},api:{},default:{},modelValue:{},disabled:{type:Boolean},layout:{default:"inline"},cleanable:{type:Boolean},limit:{},multi:{type:Boolean},dataKey:{},valueKey:{},labelKey:{}},emits:["update:modelValue","change","clear"],setup(t,{emit:n}){const o=t,r=e.ref((o.placeHolder||o.label).toString()),l=n,s=e.ref(o.modelValue??"");e.watch(()=>o.modelValue,m=>{m!==s.value&&(s.value=m??"")});function a(){l("update:modelValue",s.value),l("change",{name:o.name,value:s.value})}function i(){s.value="",l("update:modelValue",""),l("clear",o.name)}return(m,f)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["vs-form-text relative bg-white rounded-lg [&>input]:py-[7px] [&>input]:max-h-[38px] [&>input]:ps-10 [&>input]:pe-8 [&>input]:block [&>input]:w-full [&>input]:bg-gray-100 [&>input]:border-transparent [&>input]:rounded-lg [&>input]:text-sm [&>input]:focus:bg-white [&>input]:focus:border-blue-500 [&>input]:focus:ring-blue-500 [&>input]:disabled:opacity-50 [&>input]:disabled:pointer-events-none [&>input]:dark:bg-neutral-700 [&>input]:dark:border-transparent [&>input]:dark:text-neutral-400 [&>input]:dark:placeholder:text-neutral-400 dark:focus:bg-neutral-800 dark:focus:ring-neutral-600",m.layout==="inline"?e.unref(bt).getWidthClass(m.width):"w-full mb-2"])},[e.createElementVNode("div",Dr,[e.createVNode(Rr)]),s.value!==""?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:i,class:"absolute bottom-2/4 translate-y-2/4 right-3 cursor-pointer"},[e.createVNode(Fr)])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":f[0]||(f[0]=c=>s.value=c),onInput:a,placeholder:r.value,class:"!pr-7 !pl-8 bg-white h-[38px] text-sm py-2 px-3 block w-full border border-solid placeholder:text-nowrap border-stone-200 rounded-lg text-sm text-stone-800 placeholder:text-stone-400 focus:border-2 focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"},null,40,$r),[[e.vModelText,s.value]])],2))}}),Lr={key:0,class:"p-1"},Pr={class:"flex justify-between gap-4"},jr={for:"FilterFrom",class:"flex items-center w-full"},Ur=["placeholder","disabled"],Ir={for:"FilterTo",class:"flex items-center w-full"},zr=["placeholder","disabled"],qr={key:1,class:"p-1"},Hr={key:2,class:"flex justify-between items-center text-xs text-gray-500 pt-2 border-t"},Kr=["disabled"],Jr=e.defineComponent({__name:"range-input",props:{name:{},type:{},label:{},width:{},options:{},placeHolder:{},api:{},default:{},modelValue:{},disabled:{type:Boolean,default:!1},layout:{default:"inline"},cleanable:{type:Boolean},limit:{},multi:{type:Boolean},dataKey:{},valueKey:{},labelKey:{}},emits:["update:modelValue","change","clear"],setup(t,{expose:n,emit:o}){const r=t,l=e.ref(r.modelValue??r.default??["",""]),s=o,a=e.computed({get:()=>r.modelValue??l.value,set:f=>{r.modelValue!==void 0?s("update:modelValue",f):l.value=f}});function i(){a.value=l.value,s("change",{name:r.name,value:l.value})}function m(){l.value=["",""],a.value=l.value,s("clear",r.name)}return e.watch(()=>r.modelValue,f=>{f!==void 0?(l.value=f,s("update:modelValue",f)):l.value=[]}),n({clear:m,currentValue:a}),(f,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[f.layout==="popover"?(e.openBlock(),e.createElementBlock("div",Lr)):e.createCommentVNode("",!0),e.createElementVNode("div",null,[e.createElementVNode("div",Pr,[e.createElementVNode("label",jr,[e.withDirectives(e.createElementVNode("input",{id:"FilterFrom",type:"number",class:"vs-filter-range py-2 px-3 block w-full border h-[38px] border-solid border-stone-200 rounded-lg text-sm text-stone-800 placeholder:text-stone-500 focus:z-10 focus:border-blue-600 focus:border-2 focus:ring-blue-500",placeholder:f.placeHolder?.[0]??"min",step:"1",style:{outline:"none"},"onUpdate:modelValue":c[0]||(c[0]=d=>l.value[0]=d),onInput:c[1]||(c[1]=d=>i()),disabled:f.disabled},null,40,Ur),[[e.vModelText,l.value[0]]])]),e.createElementVNode("label",Ir,[e.withDirectives(e.createElementVNode("input",{id:"FilterTo",type:"number",class:"vs-filter-range py-2 px-3 block w-full border h-[38px] border-solid border-stone-200 rounded-lg text-sm text-stone-800 placeholder:text-stone-500 focus:z-10 focus:border-blue-600 focus:border-2 focus:ring-blue-500",placeholder:f.placeHolder?.[1]??"max",min:"0",max:"1000000000000000",step:"1",style:{outline:"none"},"onUpdate:modelValue":c[2]||(c[2]=d=>l.value[1]=d),onInput:c[3]||(c[3]=d=>i()),disabled:f.disabled},null,40,zr),[[e.vModelText,l.value[1]]])])])]),f.layout==="popover"&&f.cleanable?(e.openBlock(),e.createElementBlock("div",qr)):e.createCommentVNode("",!0),f.layout==="popover"&&f.cleanable?(e.openBlock(),e.createElementBlock("div",Hr,[e.createElementVNode("button",{class:"text-gray-600 hover:text-gray-800",disabled:a.value.length===0,onClick:m}," Clear ",8,Kr)])):e.createCommentVNode("",!0)],64))}}),Wr={class:"text-center"},Yr=["disabled"],Qr={class:"pr-4 truncate opacity-50"},Gr={key:0,class:"absolute top-0 end-0 inline-flex min-h-[10px] min-w-[10px] z-10 items-center py-0.5 rounded-full text-xs font-medium transform -translate-y-1/2 translate-x-1/2 bg-blue-600 text-white px-1"},Xr={class:"w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg focus:outline-none focus:bg-stone-100 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full"},Zr={class:"w-[300px] p-[4px] py-[8px] max-h-[500px] overflow-auto [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-stone-100 [&::-webkit-scrollbar-thumb]:bg-stone-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500 before:w-full"},eo={class:"h-[50px] px-[10px] py-[5px] pb-[10px] flex items-center justify-center"},to=["disabled"],vt=e.defineComponent({__name:"popover-field",props:{disabled:{type:Boolean,default:!1},label:{},currentValue:{},fieldRef:{},width:{}},emits:["clear"],setup(t,{expose:n,emit:o}){const r=t,l=o,s=e.ref(!1),a=e.ref({top:0,left:0}),i=e.ref(null),m=e.ref(null),f=e.ref(null);function c(){const y=m.value,k=f.value;if(!y||!k)return;const b=y.getBoundingClientRect();a.value={top:b.bottom+8,left:b.left}}function d(){s.value=!s.value,s.value&&e.nextTick(()=>{c(),r.fieldRef?.inputTextRef&&r.fieldRef?.inputTextRef.focus()})}function g(y){!i.value?.contains(y.target)&&!f.value?.contains(y.target)&&(s.value=!1)}function x(y){y.key==="Escape"&&(s.value=!1)}e.onMounted(()=>{document.addEventListener("click",g,!0),document.addEventListener("keydown",x),window.addEventListener("scroll",c,!0)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",g,!0),document.removeEventListener("keydown",x),window.removeEventListener("scroll",c,!0)});function v(){s.value=!1}return n({close:v}),(y,k)=>(e.openBlock(),e.createElementBlock("div",{class:"shrink-0",ref_key:"wrapperRef",ref:i},[e.createElementVNode("div",Wr,[e.createElementVNode("div",{class:e.normalizeClass(y.width?e.unref(bt).getWidthClass(y.width):"w-full")},[e.createElementVNode("button",{onClick:d,disabled:y.disabled,ref_key:"triggerRef",ref:m,class:"relative flex w-full px-4 py-2 text-sm bg-white border border-solid rounded-lg cursor-pointer hs-select-disabled:pointer-events-none hs-select-disabled:opacity-50 pe-9 text-nowrap text-start text-stone-800 border-stone-200 !bg-gray-100 !text-sm !font-[500] border-transparent hover:!bg-gray-200 [&>div]:!text-gray-800 [&>div]:!opacity-100"},[e.createElementVNode("div",Qr,e.toDisplayString(y.label),1),e.createVNode(Ee,{class:"absolute text-gray-500 right-3 translate-y-2/4 bottom-1/2 text-500-gray"}),(Array.isArray(y.currentValue)?y.currentValue.length>0:y.currentValue)?(e.openBlock(),e.createElementBlock("span",Gr)):e.createCommentVNode("",!0)],8,Yr),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.withDirectives(e.createElementVNode("div",{ref_key:"popperRef",ref:f,class:"vsTailwind vs-popover__content bottom-right w-fit fixed z-[1000]",style:e.normalizeStyle({top:`${a.value.top}px`,left:`${a.value.left}px`}),"data-inside-popover":""},[e.createElementVNode("div",Xr,[e.createElementVNode("div",Zr,[e.renderSlot(y.$slots,"default"),e.createElementVNode("div",eo,[e.createElementVNode("button",{class:"w-full h-full border rounded-lg text-[16px] hover:bg-gray-100 duration-300 disabled:cursor-not-allowed disabled:hover:bg-white disabled:text-gray-200",disabled:y.currentValue!==void 0&&y.currentValue.length===0,onClick:k[0]||(k[0]=b=>l("clear",!0))}," Очистити ",8,to)])])])],4),[[e.vShow,s.value]])]))],2)])],512))}});class B{static format(n){const o=n.getFullYear(),r=(n.getMonth()+1).toString().padStart(2,"0"),l=n.getDate().toString().padStart(2,"0");return`${o}-${r}-${l}`}static getShiftedDay(n,o=0){const r=n?new Date(n):new Date;return r.setDate(r.getDate()+o),this.format(r)}static getLastWeekRange(n,o,r=0){if(n&&o){const f=new Date(n),c=new Date(o);return f.setDate(f.getDate()+r*7),c.setDate(c.getDate()+r*7),[this.format(f),this.format(c)]}const l=new Date,s=l.getDay(),a=s===0?13:s-1+7,i=new Date(l);i.setDate(l.getDate()-a+r*7);const m=new Date(i);return m.setDate(i.getDate()+6),[this.format(i),this.format(m)]}static getMonthRange(n,o,r=0){let l;n?l=new Date(n):l=new Date,l=new Date(l.getFullYear(),l.getMonth()+r,1);const s=l,a=new Date(l.getFullYear(),l.getMonth()+1,0);return[this.format(s),this.format(a)]}static getQuarterRange(n,o,r=0){const l=n||o,s=l?new Date(l):new Date;let a=Math.floor(s.getMonth()/3);a+=r;const i=(a%4+4)%4*3,m=s.getFullYear()+Math.floor(a/4),f=new Date(m,i,1),c=new Date(m,i+3,0);return[this.format(f),this.format(c)]}static getYear(n,o=0){let r;return n&&/^\d{4}$/.test(n)?r=parseInt(n,10):n?r=new Date(n).getFullYear():r=new Date().getFullYear(),String(r+o)}static getRangeFromDaysBefore(n){const o=new Date,r=new Date(o.getTime());return r.setDate(o.getDate()-n),[this.format(r),this.format(o)]}}const no={},ro={xmlns:"http://www.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",class:"text-blue-600 w-[16px] h-[16px]"};function oo(t,n){return e.openBlock(),e.createElementBlock("svg",ro,n[0]||(n[0]=[e.createElementVNode("path",{d:"M20 6 9 17l-5-5"},null,-1)]))}const P=D(no,[["render",oo]]),lo={},so={xmlns:"http://www.w3.org/2000/svg",width:"15px",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-chevron-down text-gray-800 rotate-[90deg]"};function ao(t,n){return e.openBlock(),e.createElementBlock("svg",so,n[0]||(n[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)]))}const io=D(lo,[["render",ao]]),uo={},co={xmlns:"http://www.w3.org/2000/svg",width:"15px",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-chevron-down text-gray-800 rotate-[270deg]"};function fo(t,n){return e.openBlock(),e.createElementBlock("svg",co,n[0]||(n[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)]))}const po=D(uo,[["render",fo]]),mo={class:""},ho={class:""},go={class:""},yo={class:""},bo={class:""},vo={class:""},wo={class:""},xo={class:"inline-flex rounded-lg shrink-0 pl-1"},ko={class:"inline-flex rounded-lg shrink-0 pl-1"},Eo={key:1,class:"flex gap-1 !w-[75%] rounded-lg"},Co=["max","disabled"],Vo=["min","disabled"],Bo={key:2,class:"ml-1"},No=["disabled"],_o={key:0,class:"flex justify-between items-center text-xs text-gray-500 pt-2 border-t"},So=["disabled"],Ro=e.defineComponent({__name:"date-input",props:{name:{},type:{},label:{},width:{},options:{},placeHolder:{},api:{},default:{},modelValue:{},disabled:{type:Boolean},layout:{default:"inline"},cleanable:{type:Boolean},limit:{},multi:{type:Boolean},dataKey:{},valueKey:{},labelKey:{}},emits:["update:modelValue","change","clear"],setup(t,{emit:n}){const o=t,r=n,l=e.ref(null),s=e.ref(o.modelValue??o.default??[]),a=e.ref(""),i=e.ref(0);function m(){const b=B.getRangeFromDaysBefore(i.value);return s.value=[a.value,...b],r("change",{name:o.name,value:s}),r("update:modelValue",s.value),b}function f(b){a.value=b,l.value?.close();const u=[];switch(a.value){case"today":u.push(B.getShiftedDay());break;case"week":u.push(...B.getLastWeekRange());break;case"month":u.push(...B.getMonthRange());break;case"quarter":u.push(...B.getQuarterRange());break;case"year":u.push(B.getYear());break;case"last_7_days":i.value=7,m();break;case"range":i.value=7,u.push(...m());break}s.value=[a.value,...u],r("change",{name:o.name,value:s}),r("update:modelValue",s.value)}function c(){const b=[];switch(a.value){case"today":b.push(B.getShiftedDay(s.value[1],1));break;case"week":b.push(...B.getLastWeekRange(s.value[1],s.value[2],1));break;case"month":b.push(...B.getMonthRange(s.value[1],s.value[2],1));break;case"quarter":b.push(...B.getQuarterRange(s.value[1],s.value[2],1));break;case"year":b.push(B.getYear(s.value[1],1));break}s.value=[a.value,...b],r("change",{name:o.name,value:s}),r("update:modelValue",s.value)}function d(){const b=[];switch(a.value){case"today":b.push(B.getShiftedDay(s.value[1],-1));break;case"week":b.push(...B.getLastWeekRange(s.value[1],s.value[2],-1));break;case"month":b.push(...B.getMonthRange(s.value[1],s.value[2],-1));break;case"quarter":b.push(...B.getQuarterRange(s.value[1],s.value[2],-1));break;case"year":b.push(B.getYear(s.value[1],-1));break}s.value=[a.value,...b],r("change",{name:o.name,value:s}),r("update:modelValue",s.value)}e.onMounted(()=>{let b=[];if(Array.isArray(o.modelValue)?b=o.modelValue:Array.isArray(o.default)&&(b=o.default),b.length===0)return;const[u,...h]=b;a.value=u;let w=[];switch(u){case"today":w.push(B.getShiftedDay(h[0]));break;case"week":w=B.getLastWeekRange(h[0],h[1]);break;case"month":w=B.getMonthRange(h[0],h[1]);break;case"quarter":w=B.getQuarterRange(h[0],h[1]);break;case"year":w.push(B.getYear(h[0]));break;case"last_7_days":i.value=Number(h[0]??7);return;case"range":s.value=[u,h[0]??"",h[1]??""];return;default:return}s.value=[u,...w],r("update:modelValue",s.value)});const g=["Січень","Лютий","Березень","Квітень","Травень","Червень","Липень","Серпень","Вересень","Жовтень","Листопад","Грудень"];function x(b){const[u,h,w]=b.split("-");return`${w}.${h}.${u}`}function v(b){const{value:u}=s;switch(b){case"today":return x(u[1]);case"range":return"Період";case"week":return u[1]&&u[2]?`${x(u[1])} – ${x(u[2])}`:"";case"quarter":if(u[1]){const h=new Date(u[1]),w=h.getFullYear(),E=h.getMonth();return`${Math.floor(E/3)+1} квартал ${w}`}return"";case"month":if(u[1]){const[h,w]=u[1].split("-");return`${g[parseInt(w,10)-1]} ${h}`}return"";case"year":return u[1]||"";case"last_7_days":return"За останні дні";default:return o.label??""}}const y=e.computed(()=>a.value?v(a.value):o.label??"");function k(){a.value="",s.value=[],r("update:modelValue",[])}return e.watch(()=>o.modelValue,b=>{b!==void 0?(s.value=b,r("update:modelValue",b)):(a.value="",s.value=[])}),(b,u)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["",b.layout!="inline"?"relative flex w-full h-auto gap-2 filter-date m-2 flex-wrap":"flex"])},[e.createVNode(vt,{ref_key:"popoverRef",ref:l,label:y.value,"current-value":s.value,onClear:k},{default:e.withCtx(()=>[e.createElementVNode("div",mo,[e.createElementVNode("button",{type:"button",onClick:u[0]||(u[0]=h=>f("range")),class:"flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"},[u[10]||(u[10]=e.createTextVNode(" Період ")),a.value==="range"?(e.openBlock(),e.createBlock(P,{key:0})):e.createCommentVNode("",!0)])]),u[17]||(u[17]=e.createElementVNode("div",{class:""},[e.createElementVNode("div",{class:"pt-2 mt-2 border-t"})],-1)),e.createElementVNode("div",ho,[e.createElementVNode("button",{type:"button",onClick:u[1]||(u[1]=h=>f("today")),class:"flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"},[u[11]||(u[11]=e.createTextVNode(" Сьогодні ")),a.value==="today"?(e.openBlock(),e.createBlock(P,{key:0})):e.createCommentVNode("",!0)])]),e.createElementVNode("div",go,[e.createElementVNode("button",{type:"button",onClick:u[2]||(u[2]=h=>f("week")),class:"flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"},[u[12]||(u[12]=e.createTextVNode(" Тиждень ")),a.value==="week"?(e.openBlock(),e.createBlock(P,{key:0})):e.createCommentVNode("",!0)])]),e.createElementVNode("div",yo,[e.createElementVNode("button",{type:"button",onClick:u[3]||(u[3]=h=>f("month")),class:"flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"},[u[13]||(u[13]=e.createTextVNode(" Місяць ")),a.value==="month"?(e.openBlock(),e.createBlock(P,{key:0})):e.createCommentVNode("",!0)])]),e.createElementVNode("div",bo,[e.createElementVNode("button",{type:"button",onClick:u[4]||(u[4]=h=>f("quarter")),class:"flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"},[u[14]||(u[14]=e.createTextVNode(" Квартал ")),a.value==="quarter"?(e.openBlock(),e.createBlock(P,{key:0})):e.createCommentVNode("",!0)])]),e.createElementVNode("div",vo,[e.createElementVNode("button",{type:"button",onClick:u[5]||(u[5]=h=>f("year")),class:"flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"},[u[15]||(u[15]=e.createTextVNode(" Рік ")),a.value==="year"?(e.openBlock(),e.createBlock(P,{key:0})):e.createCommentVNode("",!0)])]),u[18]||(u[18]=e.createElementVNode("div",{class:""},[e.createElementVNode("div",{class:"pt-2 mt-2 border-t"})],-1)),e.createElementVNode("div",wo,[e.createElementVNode("button",{type:"button",onClick:u[6]||(u[6]=h=>f("last_7_days")),class:"flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"},[u[16]||(u[16]=e.createTextVNode(" Останні 7 днів ")),a.value==="last_7_days"?(e.openBlock(),e.createBlock(P,{key:0})):e.createCommentVNode("",!0)])]),u[19]||(u[19]=e.createElementVNode("div",{class:""},[e.createElementVNode("div",{class:"pt-2 mt-2 border-t"})],-1))]),_:1,__:[17,18,19]},8,["label","current-value"]),a.value!==""&&a.value!=="range"&&a.value!=="last_7_days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",xo,[e.createElementVNode("button",{type:"button",title:"Попередній період",class:"inline-flex h-[38px] items-center px-2 text-sm text-gray-800 bg-gray-100 gap-x-2 -ms-px first:rounded-s-lg first:ms-0 last:rounded-e-lg focus:z-10 hover:bg-gray-200 focus:bg-gray-200 duration-300",onClick:d},[e.createVNode(io)])]),e.createElementVNode("div",ko,[e.createElementVNode("button",{type:"button",title:"Наступний період",class:"inline-flex h-[38px] items-center px-2 text-sm text-gray-800 gap-x-2 bg-gray-100 -ms-px first:rounded-s-lg first:ms-0 last:rounded-e-lg focus:z-10 hover:bg-gray-200 focus:bg-gray-200 duration-300",onClick:c},[e.createVNode(po)])])],64)):e.createCommentVNode("",!0),a.value!==""&&a.value==="range"?(e.openBlock(),e.createElementBlock("div",Eo,[e.withDirectives(e.createElementVNode("input",{type:"date",max:s.value[2],locale:"uk-UA","onUpdate:modelValue":u[7]||(u[7]=h=>s.value[1]=h),class:"px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-lg focus:outline-blue-600",disabled:b.disabled},null,8,Co),[[e.vModelText,s.value[1]]]),e.withDirectives(e.createElementVNode("input",{type:"date",min:s.value[1],locale:"uk-UA","onUpdate:modelValue":u[8]||(u[8]=h=>s.value[2]=h),class:"px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-lg focus:outline-blue-600 appearance-auto",disabled:b.disabled},null,8,Vo),[[e.vModelText,s.value[2]]])])):e.createCommentVNode("",!0),a.value!==""&&a.value==="last_7_days"?(e.openBlock(),e.createElementBlock("div",Bo,[e.withDirectives(e.createElementVNode("input",{type:"number","onUpdate:modelValue":u[9]||(u[9]=h=>i.value=h),onInput:m,class:"h-[38px] w-[60px] border rounded-lg focus:outline-blue-600 px-[10px]",disabled:b.disabled},null,40,No),[[e.vModelText,i.value]])])):e.createCommentVNode("",!0)],2),b.layout==="popover"&&b.cleanable?(e.openBlock(),e.createElementBlock("div",_o,[e.createElementVNode("button",{class:"text-gray-600 hover:text-gray-800",disabled:s.value.length===0,onClick:k}," Clear ",8,So)])):e.createCommentVNode("",!0)],64))}}),je={radio:Pe,checkbox:ve,check:ve,text:Mr,range:Jr,date:Ro,select:Pe};function Ce(t,n=!1){let o;switch(t.toLowerCase()){case"autocomplete":o="select";break;case"check":o="checkbox";break;default:o=t.toString().toLowerCase()}return["select"].includes(o)&&n?{component:ve,type:"select"}:{component:je[o]||je.text,type:o}}const Ao={},To={xmlns:"http://www.w3.org/2000/svg",width:"15px",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-reload absolute inline mr-1 text-gray-800 transition-all cursor-pointer active:rotate-90 right-1 top-1 hover:text-blue-500"};function Oo(t,n){return e.openBlock(),e.createElementBlock("svg",To,n[0]||(n[0]=[e.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),e.createElementVNode("path",{d:"M19.933 13.041a8 8 0 1 1 -9.925 -8.788c3.899 -1 7.935 1.007 9.425 4.747"},null,-1),e.createElementVNode("path",{d:"M20 4v5h-5"},null,-1)]))}const Fo=D(Ao,[["render",Oo]]),Do={style:{display:"inline-flex",margin:"0px",width:"100%"}},$o={class:"relative w-full mb-2 p-4 bg-white rounded-lg shadow-sm"},Mo={class:"block mb-3 text-sm font-medium text-gray-800 dark:text-neutral-200"},Lo={class:"flex items-center"},Po={class:"text-sm font-medium max-w-[80%] text-gray-800 flex items-center gap-x-1"},jo={class:"filter-layout__body"},Uo=e.defineComponent({__name:"vertical-layout",props:{name:{},type:{},label:{},width:{},options:{},placeHolder:{},api:{},default:{},modelValue:{},disabled:{type:Boolean},layout:{},cleanable:{type:Boolean},limit:{},multi:{type:Boolean},dataKey:{},valueKey:{},labelKey:{}},emits:["update:modelValue","change","clear"],setup(t,{expose:n,emit:o}){const r=t,l=o,s=e.ref(),a=Ce(r.type,r.multi),i=e.computed({get:()=>r.modelValue,set:d=>l("update:modelValue",d)});function m(d){l("clear",d)}function f(d,g){l("change",{name:d,value:g}),r.modelValue!==void 0&&l("update:modelValue",g)}function c(){s.value&&s.value.clear(),l("clear",r.name)}return e.watch(()=>r.default,d=>{i.value=d}),e.watch(()=>r.modelValue,d=>{i.value=d}),n({filterRef:s}),(d,g)=>(e.openBlock(),e.createElementBlock("div",Do,[e.createElementVNode("div",$o,[e.createElementVNode("div",Mo,[e.createElementVNode("div",Lo,[e.createElementVNode("span",Po,e.toDisplayString(d.label),1)]),typeof i.value=="string"&&i.value.trim()!==""||Array.isArray(i.value)&&i.value.length>0&&i.value.some(x=>x!=null&&String(x).trim()!=="")?(e.openBlock(),e.createBlock(Fo,{key:0,onClick:c})):e.createCommentVNode("",!0)]),e.createElementVNode("div",jo,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(a)?.component),e.mergeProps(r,{type:e.unref(a)?.type,onChange:g[0]||(g[0]=x=>f(x.name,x.value)),onClear:g[1]||(g[1]=x=>m(x)),ref_key:"filterRef",ref:s}),null,16,["type"]))])])]))}}),Ue=e.defineComponent({__name:"inline-layout",props:{name:{},type:{},label:{},width:{},options:{},placeHolder:{},api:{},default:{},modelValue:{},disabled:{type:Boolean},layout:{},cleanable:{type:Boolean},limit:{},multi:{type:Boolean},dataKey:{},valueKey:{},labelKey:{}},emits:["update:modelValue","change","clear"],setup(t,{expose:n,emit:o}){const r=t,l=o,s=e.ref(),a=Ce(r.type,r.multi),i=e.computed({get:()=>r.modelValue,set:d=>l("update:modelValue",d)});function m(d){l("clear",d)}function f(d,g){l("change",{name:d,value:g}),r.modelValue!==void 0&&l("update:modelValue",g)}function c(){s.value&&s.value.clear(),l("clear",r.name)}return e.watch(()=>r.default,d=>{i.value=d}),e.watch(()=>r.modelValue,d=>{i.value=d}),n({filterRef:s}),(d,g)=>["text","date"].includes(d.type.toLocaleLowerCase())?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(a)?.component),e.mergeProps({key:0},r,{type:e.unref(a)?.type,onChange:g[0]||(g[0]=x=>f(x.name,x.value)),onClear:g[1]||(g[1]=x=>m(x)),disabled:d.disabled}),null,16,["type","disabled"])):(e.openBlock(),e.createBlock(vt,{key:1,"current-value":i.value,label:d.label,onClear:c,fieldRef:s.value,width:d.width,disabled:d.disabled},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(a)?.component),e.mergeProps({ref_key:"filterRef",ref:s},r,{type:e.unref(a)?.type,onChange:g[2]||(g[2]=x=>f(x.name,x.value)),onClear:g[3]||(g[3]=x=>m(x))}),null,16,["type"]))]),_:1},8,["current-value","label","fieldRef","width","disabled"]))}}),Io=e.defineComponent({__name:"popover-layout",props:{name:{},type:{},label:{},width:{},options:{},placeHolder:{},api:{},default:{},modelValue:{},disabled:{type:Boolean},layout:{},cleanable:{type:Boolean},limit:{},multi:{type:Boolean},dataKey:{},valueKey:{},labelKey:{}},emits:["update:modelValue","change","clear"],setup(t,{expose:n,emit:o}){const r=t,l=o,s=e.ref(),a=e.ref(Ce(r.type,r.multi)),i=e.computed({get:()=>r.modelValue,set:c=>l("update:modelValue",c)});function m(c){l("clear",c)}function f(c,d){l("change",{name:c,value:d}),r.modelValue!==void 0&&l("update:modelValue",d)}return e.watch(()=>r.default,c=>{i.value=c}),e.watch(()=>r.modelValue,c=>{i.value=c}),e.watch(()=>r,c=>{i.value=c}),n({filterRef:s}),(c,d)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.value?.component),e.mergeProps(r,{type:a.value?.type,modelValue:i.value,"onUpdate:modelValue":d[0]||(d[0]=g=>i.value=g),onChange:d[1]||(d[1]=g=>f(g.name,g.value)),onClear:d[2]||(d[2]=g=>m(g)),ref_key:"filterRef",ref:s}),null,16,["type","modelValue"]))}}),L=e.defineComponent({__name:"filter-field",props:{name:{},type:{},label:{},width:{},options:{default:()=>[]},placeHolder:{},api:{},default:{},modelValue:{},disabled:{type:Boolean,default:!1},layout:{default:"inline"},cleanable:{type:Boolean},limit:{default:10},multi:{type:Boolean,default:!0},dataKey:{},valueKey:{},labelKey:{}},emits:["update:modelValue","change","clear"],setup(t,{expose:n,emit:o}){const r=t,l=o,s=e.ref(),a=e.computed({get:()=>r.modelValue,set:c=>l("update:modelValue",c)});function i(c){l("clear",c)}function m(c,d){l("change",{name:c,value:d}),r.modelValue!==void 0&&l("update:modelValue",d)}e.watch(()=>r.default,c=>{a.value=c}),e.watch(()=>r.modelValue,c=>{a.value=c}),n({filterRef:s});function f(){switch(r.layout){case"inline":return Ue;case"vertical":return Uo;case"popover":return Io;default:return Ue}}return(c,d)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f()),e.mergeProps(r,{onChange:d[0]||(d[0]=g=>m(g.name,g.value)),onClear:d[1]||(d[1]=g=>i(g)),modelValue:a.value,"onUpdate:modelValue":d[2]||(d[2]=g=>a.value=g)}),null,16,["modelValue"]))}});function Ve(t,n){const{slots:o}=t,r=e.ref(t.value??{}),l=e.computed(()=>(e.toRaw(o?.default?.())??[]).flatMap(h=>Array.isArray(h.children)?h.children:[h]));function s(u){delete r.value[u],n("clear",{data:e.toRaw(r.value),name:u})}function a(u,h){r.value={...r.value,[u]:h},n("change",{data:e.toRaw(r.value),name:u,value:h})}const i=e.computed(()=>l.value.map(u=>{const h=u.props?.name;return e.cloneVNode(u,{...u.props,layout:t.view,showClean:!0,modelValue:r[h],"onUpdate:modelValue":w=>{a(h,w)},onClear:()=>s(h)})})),m=e.computed(()=>new Map(i.value.map(u=>{const h=u.props?.name;return h?[h,u]:null}).filter(u=>u!==null)));function f(){r.value={},n("clearAll",{data:e.toRaw(r.value),name:"ALL"})}const c=e.ref(""),d=e.computed(()=>Object.values(r.value).filter(u=>Array.isArray(u)?u.some(h=>h!==""&&h!==null&&h!==void 0):u!==""&&u!==null&&u!==void 0).length),g=e.ref();e.watch(c,async()=>{await e.nextTick(),g?.value?.filterRef?.inputTextRef&&g.value.filterRef.inputTextRef.focus()});const x=e.computed(()=>t.schema?Object.fromEntries(Object.entries(t.schema).slice(0,t.limit)):{}),v=e.computed(()=>t.schema?t.view!=="inline"?t.schema:Object.fromEntries(Object.entries(t.schema).slice(t.limit)):{}),y=e.computed(()=>{if(i.value.length===0)return[];let u=0;if(t.schema){const h=Object.entries(t.schema).length;h<t.limit?u=t.limit-h:u=0}return i.value.slice(0,u)}),k=e.computed(()=>i.value.length===0?[]:t.view!=="inline"?i.value:i.value.slice(y.value.length));function b(){if(v.value){const[u]=Object.keys(v.value);c.value=u}else k.value.length>0?c.value=k.value[0].props.name:c.value=""}return{activeFilter:r,activeFilterCount:d,onFilterChange:a,clearFilter:s,clearAllFilters:f,limitedSchema:x,popoverSchema:v,filtersSlot:i,limitedFiltersSlot:y,popoverFiltersSlot:k,vnodeMap:m,onPopoverOpen:b,selectedFilter:c,filterRef:g}}const zo=e.defineComponent({__name:"popover",emits:["open","close"],setup(t,{emit:n}){const o=e.ref(!1),r=e.ref(null),l=e.ref(null),s=e.ref(null),a=e.ref({top:"0px",left:"0px",position:"absolute"});function i(){o.value=!o.value}function m(){const d=s.value,g=r.value;if(!d||!g)return;const x=d.getBoundingClientRect();a.value={position:"absolute",top:`${x.bottom+window.scrollY+8}px`,left:`${x.left+window.scrollX}px`}}function f(d){const g=d.target;!s.value?.contains(d.target)&&!r.value?.contains(d.target)&&!g.closest("[data-inside-popover]")&&(o.value=!1)}e.onMounted(()=>{s.value=l.value?.querySelector("[data-popover-trigger]")||null,s.value?.addEventListener("click",i),document.addEventListener("click",f),window.addEventListener("resize",m),window.addEventListener("scroll",m,!0)}),e.onBeforeUnmount(()=>{s.value?.removeEventListener("click",i),document.removeEventListener("click",f),window.removeEventListener("resize",m),window.removeEventListener("scroll",m,!0)});const c=n;return e.watch(o,async d=>{d?(await e.nextTick(m),c("open")):c("close")}),(d,g)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:l},[e.renderSlot(d.$slots,"trigger"),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[o.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"popoverRef",ref:r,class:"absolute z-[50] w-[600px] rounded-md border bg-white shadow-md",style:e.normalizeStyle(a.value)},[e.renderSlot(d.$slots,"default")],4)):e.createCommentVNode("",!0)]))],512))}}),qo={},Ho={xmlns:"http://www.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",class:"lucide lucide-filter h-4 w-4"};function Ko(t,n){return e.openBlock(),e.createElementBlock("svg",Ho,n[0]||(n[0]=[e.createElementVNode("polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"},null,-1)]))}const Jo=D(qo,[["render",Ko]]),Wo={key:0,class:"inline-flex items-center rounded-full border font-semibold transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent hover:bg-secondary/80 bg-blue-500 text-white text-xs px-1.5 py-0.5"},Yo={class:"flex"},Qo={class:"w-64 border-r border-gray-200"},Go={class:"p-2"},Xo=["onClick"],Zo={class:"flex items-center gap-2"},el={class:"text-sm font-medium"},tl={key:0,class:"inline-flex items-center rounded-full border font-semibold transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent hover:bg-secondary/80 bg-blue-100 text-blue-700 text-xs p-2"},nl=["onClick"],rl={class:"flex items-center gap-2"},ol={class:"text-sm font-medium"},ll={key:0,class:"inline-flex items-center rounded-full border font-semibold transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent hover:bg-secondary/80 bg-blue-100 text-blue-700 text-xs p-2"},sl={key:0,class:"p-2 border-t"},al={class:"flex-1 min-h-[300px] overflow-y-auto"},il={key:0,class:"flex items-center justify-center h-full text-gray-500"},wt=e.defineComponent({__name:"popover-filter-layout",props:{schema:{},view:{},value:{},history:{type:Boolean},limit:{default:3}},emits:["change","clear","clearAll"],setup(t,{expose:n,emit:o}){const r=t,l=e.useSlots(),s=o,{activeFilter:a,activeFilterCount:i,onFilterChange:m,clearFilter:f,clearAllFilters:c,popoverSchema:d,popoverFiltersSlot:g,onPopoverOpen:x,selectedFilter:v,filterRef:y}=Ve({...r,slots:l},s);return n({clearFilter:f,clearAllFilters:c}),(k,b)=>(e.openBlock(),e.createBlock(zo,{onOpen:e.unref(x),onClose:b[5]||(b[5]=u=>v.value="")},{trigger:e.withCtx(()=>[e.createElementVNode("button",{"data-popover-trigger":"","aria-haspopup":"dialog","aria-expanded":"false",class:e.normalizeClass(["ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:text-accent-foreground border h-10 px-4 py-2 gap-2",e.unref(i)>0?"bg-blue-50 border-blue-200 text-blue-700 hover:bg-blue-100":"text-gray-800 hover:bg-gray-200 focus:bg-gray-200"]),type:"button"},[e.createVNode(Jo),b[6]||(b[6]=e.createTextVNode(" Filter ")),e.unref(i)>0?(e.openBlock(),e.createElementBlock("div",Wo,e.toDisplayString(e.unref(i)),1)):e.createCommentVNode("",!0)],2)]),default:e.withCtx(()=>[e.createElementVNode("div",Yo,[e.createElementVNode("div",Qo,[b[7]||(b[7]=e.createElementVNode("div",{class:"p-4 border-b"},[e.createElementVNode("p",{class:"text-sm text-gray-600"},"Select a field to start creating a filter.")],-1)),e.createElementVNode("div",Go,[k.schema?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Object.entries(e.unref(d)),([u,h])=>(e.openBlock(),e.createElementBlock("button",{key:u,onClick:()=>{v.value=u,console.log(e.unref(v))},class:e.normalizeClass(["w-full flex items-center justify-between px-3 py-2 text-left hover:bg-gray-50 transition-colors",e.unref(v)===u?"bg-blue-50 text-blue-700 border-l-2 border-blue-500":""])},[e.createElementVNode("div",Zo,[e.createElementVNode("span",el,e.toDisplayString(h.label),1)]),(Array.isArray(e.unref(a)[u])?e.unref(a)[u].length>0:e.unref(a)[u])?(e.openBlock(),e.createElementBlock("div",tl)):e.createCommentVNode("",!0)],10,Xo))),128)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(g),(u,h)=>(e.openBlock(),e.createElementBlock("button",{key:"slot-"+h,onClick:w=>v.value=u.props.name,class:e.normalizeClass(["w-full flex items-center justify-between px-3 py-2 text-left hover:bg-gray-50 transition-colors",e.unref(v)===u.props.name?"bg-blue-50 text-blue-700 border-l-2 border-blue-500":""])},[e.createElementVNode("div",rl,[e.createElementVNode("span",ol,e.toDisplayString(u.props.label),1)]),e.unref(a)[u.props.name]?.length>0?(e.openBlock(),e.createElementBlock("div",ll)):e.createCommentVNode("",!0)],10,nl))),128))]),e.unref(i)>0?(e.openBlock(),e.createElementBlock("div",sl,[e.createElementVNode("button",{class:"w-full px-3 py-2 text-left text-sm text-gray-600 hover:bg-gray-50 transition-colors",onClick:b[0]||(b[0]=(...u)=>e.unref(c)&&e.unref(c)(...u)),"data-inside-popover":""}," Clear all ")])):e.createCommentVNode("",!0)]),e.createElementVNode("div",al,[e.unref(v)===""?(e.openBlock(),e.createElementBlock("div",il,b[8]||(b[8]=[e.createElementVNode("p",{class:"text-sm"},"Select a field to start creating a filter.",-1)]))):e.createCommentVNode("",!0),e.unref(v)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(d)?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Object.entries(e.unref(d)),([u,h])=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.unref(v)===u?(e.openBlock(),e.createBlock(L,e.mergeProps({key:0,name:u,layout:"popover",ref_for:!0,ref_key:"filterRef",ref:y},{ref_for:!0},h,{onChange:b[1]||(b[1]=w=>e.unref(m)(w.name,w.value)),onClear:b[2]||(b[2]=w=>e.unref(f)(w)),modelValue:e.unref(a)[u],"onUpdate:modelValue":w=>e.unref(a)[u]=w,showClean:!0}),null,16,["name","modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0)],64))),256)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(g),(u,h)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"slot-"+h},[e.unref(v)===u.props.name?(e.openBlock(),e.createBlock(L,e.mergeProps({key:0,layout:"popover"},{ref_for:!0},u.props,{ref_for:!0,ref_key:"filterRef",ref:y,onChange:b[3]||(b[3]=w=>e.unref(m)(w.name,w.value)),onClear:b[4]||(b[4]=w=>e.unref(f)(w)),modelValue:e.unref(a)[u.props.name],"onUpdate:modelValue":w=>e.unref(a)[u.props.name]=w,showClean:!0}),null,16,["modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0)],64))),128))],64)):e.createCommentVNode("",!0)])])]),_:1},8,["onOpen"]))}}),ul={class:"w-full gap-5 flex justify-between mb-[6px] pr-3"},cl={class:"table items-center gap-2 max-h-[38px] pt-[4px]"},dl={class:"custom-filter-list"},fl={class:"vs-filter-list"},pl={class:"flex flex-wrap items-center w-full gap-[6px]"},Ie=e.defineComponent({__name:"inline-filter-layout",props:{schema:{},view:{},value:{},history:{type:Boolean},limit:{default:3}},emits:["change","clear","clearAll"],setup(t,{emit:n}){const o=t,r=n,l=e.useSlots(),{activeFilter:s,activeFilterCount:a,onFilterChange:i,clearFilter:m,clearAllFilters:f,limitedSchema:c,popoverSchema:d,filtersSlot:g,limitedFiltersSlot:x,popoverFiltersSlot:v}=Ve({...o,slots:l},r),y=e.ref();function k(){y.value&&(y.value.clearAllFilters(),f())}return(b,u)=>(e.openBlock(),e.createElementBlock("div",ul,[e.createElementVNode("div",cl,[e.createElementVNode("div",dl,[e.createElementVNode("div",fl,[e.createElementVNode("div",pl,[b.schema?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Object.entries(e.unref(c)),([h,w])=>(e.openBlock(),e.createBlock(L,e.mergeProps({key:h,name:h},{ref_for:!0},w,{onChange:u[0]||(u[0]=E=>e.unref(i)(E.name,E.value)),onClear:u[1]||(u[1]=E=>e.unref(m)(E)),layout:"inline",modelValue:e.unref(s)[h],"onUpdate:modelValue":E=>e.unref(s)[h]=E}),null,16,["name","modelValue","onUpdate:modelValue"]))),128)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(x),(h,w)=>(e.openBlock(),e.createBlock(L,e.mergeProps({key:"slot-"+w,layout:"vertical"},{ref_for:!0},h.props,{onChange:u[2]||(u[2]=E=>e.unref(i)(E.name,E.value)),onClear:u[3]||(u[3]=E=>e.unref(m)(E)),showClean:!0,modelValue:e.unref(s)[h.props.name],"onUpdate:modelValue":E=>e.unref(s)[h.props.name]=E}),null,16,["modelValue","onUpdate:modelValue"]))),128)),Object.entries(e.unref(d)).length>0||e.unref(v).length>0?(e.openBlock(),e.createBlock(wt,e.mergeProps({key:1},o,{onChange:u[4]||(u[4]=h=>e.unref(i)(h.name,h.value)),onClearAll:e.unref(f),onClear:u[5]||(u[5]=h=>e.unref(m)(h.name)),ref_key:"popoverRef",ref:y}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(g),(h,w)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(h),e.mergeProps({key:"slot-"+w,layout:"inline"},{ref_for:!0},h.props),null,16))),128))]),_:1},16,["onClearAll"])):e.createCommentVNode("",!0),e.unref(a)>0?(e.openBlock(),e.createElementBlock("button",{key:2,onClick:k,class:"relative py-2 px-3 inline-flex justify-center items-center gap-x-2 text-sm font-medium rounded-lg bg-gray-100 border border-transparent text-gray-800 hover:bg-gray-200 focus:bg-gray-200"}," Очистити ")):e.createCommentVNode("",!0)])])])])]))}}),ml={key:0,class:"p-2 overflow-y-auto overflow-hidden [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500 dark:bg-neutral-800 max-h-[calc(100%-142px)] h-full bg-gray-100"},hl={class:"flex items-center vst-filters vsTailwind flex-col w-full"},gl=e.defineComponent({__name:"vertical-filter-layout",props:{schema:{},view:{},value:{},history:{type:Boolean},limit:{default:3}},emits:["change","clear","clearAll"],setup(t,{emit:n}){const o=t,r=n,l=e.useSlots(),{activeFilter:s,activeFilterCount:a,onFilterChange:i,clearFilter:m,clearAllFilters:f,filtersSlot:c}=Ve({...o,slots:l},r);return(d,g)=>d.view==="vertical"?(e.openBlock(),e.createElementBlock("div",ml,[e.createElementVNode("div",hl,[e.unref(a)>0?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:g[0]||(g[0]=(...x)=>e.unref(f)&&e.unref(f)(...x)),"data-popover-trigger":"","aria-haspopup":"dialog","aria-expanded":"false",class:"w-full ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:text-accent-foreground border h-10 px-4 py-2 gap-2 m-2 bg-white text-gray-800 hover:bg-gray-200 focus:bg-gray-200",type:"button"}," Очистити ")):e.createCommentVNode("",!0),d.schema?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(Object.entries(d.schema),([x,v])=>(e.openBlock(),e.createBlock(L,e.mergeProps({name:x,layout:"vertical"},{ref_for:!0},v,{onChange:g[1]||(g[1]=y=>e.unref(i)(y.name,y.value)),onClear:g[2]||(g[2]=y=>e.unref(m)(y)),modelValue:e.unref(s)[x],"onUpdate:modelValue":y=>e.unref(s)[x]=y,showClean:!0}),null,16,["name","modelValue","onUpdate:modelValue"]))),256)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(c),(x,v)=>(e.openBlock(),e.createBlock(L,e.mergeProps({key:"slot-"+v,layout:"vertical"},{ref_for:!0},x.props,{onChange:g[3]||(g[3]=y=>e.unref(i)(y.name,y.value)),onClear:g[4]||(g[4]=y=>e.unref(m)(y)),modelValue:e.unref(s)[x.props.name],"onUpdate:modelValue":y=>e.unref(s)[x.props.name]=y,showClean:!0}),null,16,["modelValue","onUpdate:modelValue"]))),128))])])):e.createCommentVNode("",!0)}}),xt=e.defineComponent({__name:"filter",props:{schema:{},view:{default:"inline"},value:{},history:{type:Boolean},limit:{default:3}},emits:["change","clear","clearAll"],setup(t,{emit:n}){const o=t,r=e.ref(o.value??{}),l=n;function s(c,d){r.value={...r.value,[c]:d},l("change",{data:e.toRaw(r.value),name:c,value:d})}function a(c){delete r.value[c],l("clear",{data:e.toRaw(r.value),name:c})}function i(){r.value={},l("clear",{data:e.toRaw(r.value),name:"ALL"}),l("change",{data:e.toRaw(r.value),name:"ALL",value:null})}const m=e.computed(()=>Array.isArray(o.schema)?o.schema.reduce((c,d)=>(c[d.name]=d,c),{}):o.schema);function f(){switch(o.view){case"inline":return Ie;case"vertical":return gl;case"popover":return wt;default:return Ie}}return(c,d)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f()),e.mergeProps(o,{schema:m.value,onChange:d[0]||(d[0]=g=>s(g.name,g.value)),onClear:d[1]||(d[1]=g=>a(g.name)),onClearAll:i}),{default:e.withCtx(()=>[e.renderSlot(c.$slots,"default")]),_:3},16,["schema"]))}}),yl={install(t){t.component("Filter",xt),t.component("FilterField",L)}};exports.Filter=xt;exports.FilterField=L;exports.default=yl;