@opengis/bi 1.2.3 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bi.js +1 -1
- package/dist/bi.umd.cjs +40 -40
- package/dist/import-file-MEpI7PGd.js +3509 -0
- package/dist/{vs-funnel-bar-T330oJNS.js → vs-funnel-bar-BdVcgrYG.js} +1 -1
- package/dist/{vs-list-DeHF_Oaf.js → vs-list-_1Ub562I.js} +1 -1
- package/dist/{vs-map-Skt608pM.js → vs-map-BQwf_Vmm.js} +2 -2
- package/dist/{vs-map-cluster-BRUiY_90.js → vs-map-cluster-Bu0fgucv.js} +2 -2
- package/dist/{vs-number-Dd_21nn-.js → vs-number-Dke5ThxE.js} +1 -1
- package/dist/{vs-table-BwC29Zyc.js → vs-table-C95epuWz.js} +1 -1
- package/dist/{vs-text-DEJjWxDu.js → vs-text-DAq6rCjJ.js} +1 -1
- package/package.json +79 -78
- package/server/plugins/vite.js +69 -69
- package/server/routes/dashboard/controllers/utils/yaml.js +11 -11
- package/server/routes/data/index.mjs +7 -1
- package/server/routes/map/controllers/cluster.js +125 -125
- package/server/routes/map/controllers/clusterVtile.js +166 -166
- package/server/routes/map/controllers/geojson.js +127 -127
- package/server/routes/map/controllers/map.js +69 -69
- package/server/routes/map/controllers/utils/downloadClusterData.js +44 -44
- package/server/routes/map/controllers/vtile.js +183 -183
- package/utils.js +12 -12
- package/dist/import-file-D8jh74Dz.js +0 -3543
package/dist/bi.umd.cjs
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
(function(T,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],o):(T=typeof globalThis<"u"?globalThis:T||self,o(T.bi={},T.Vue))})(this,function(T,o){"use strict";var oc=Object.defineProperty;var ic=(T,o,R)=>o in T?oc(T,o,{enumerable:!0,configurable:!0,writable:!0,value:R}):T[o]=R;var N=(T,o,R)=>ic(T,typeof o!="symbol"?o+"":o,R);function R(t,e){return t!=null&&t.value?isNaN(t==null?void 0:t.value)?t==null?void 0:t.value:new Intl.NumberFormat("en",e||{notation:"compact"}).format(t==null?void 0:t.value):isNaN(t)?t:new Intl.NumberFormat("en",e||{notation:"compact"}).format(t)}function se(t){if(!(t!=null&&t.includes("T")))return t;const[e,n,s]=t.split("T")[0].split("-");return`${s}.${n}.${e}`}function zn(t){return Intl.NumberFormat("en").format(t)}function lt(t,e){return function(){return t.apply(e,arguments)}}const{toString:Rn}=Object.prototype,{getPrototypeOf:Oe}=Object,{iterator:ge,toStringTag:ct}=Symbol,be=(t=>e=>{const n=Rn.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),j=t=>(t=t.toLowerCase(),e=>be(e)===t),ye=t=>e=>typeof e===t,{isArray:Y}=Array,ee=ye("undefined");function re(t){return t!==null&&!ee(t)&&t.constructor!==null&&!ee(t.constructor)&&O(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const dt=j("ArrayBuffer");function Ln(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&dt(t.buffer),e}const On=ye("string"),O=ye("function"),ht=ye("number"),oe=t=>t!==null&&typeof t=="object",An=t=>t===!0||t===!1,xe=t=>{if(be(t)!=="object")return!1;const e=Oe(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(ct in t)&&!(ge in t)},Fn=t=>{if(!oe(t)||re(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},Mn=j("Date"),Pn=j("File"),In=j("Blob"),jn=j("FileList"),Un=t=>oe(t)&&O(t.pipe),qn=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||O(t.append)&&((e=be(t))==="formdata"||e==="object"&&O(t.toString)&&t.toString()==="[object FormData]"))},Hn=j("URLSearchParams"),[Wn,Zn,Jn,Gn]=["ReadableStream","Request","Response","Headers"].map(j),Kn=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ie(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let s,r;if(typeof t!="object"&&(t=[t]),Y(t))for(s=0,r=t.length;s<r;s++)e.call(null,t[s],s,t);else{if(re(t))return;const i=n?Object.getOwnPropertyNames(t):Object.keys(t),a=i.length;let l;for(s=0;s<a;s++)l=i[s],e.call(null,t[l],l,t)}}function pt(t,e){if(re(t))return null;e=e.toLowerCase();const n=Object.keys(t);let s=n.length,r;for(;s-- >0;)if(r=n[s],e===r.toLowerCase())return r;return null}const Z=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ut=t=>!ee(t)&&t!==Z;function Ae(){const{caseless:t,skipUndefined:e}=ut(this)&&this||{},n={},s=(r,i)=>{const a=t&&pt(n,i)||i;xe(n[a])&&xe(r)?n[a]=Ae(n[a],r):xe(r)?n[a]=Ae({},r):Y(r)?n[a]=r.slice():(!e||!ee(r))&&(n[a]=r)};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&ie(arguments[r],s);return n}const Qn=(t,e,n,{allOwnKeys:s}={})=>(ie(e,(r,i)=>{n&&O(r)?t[i]=lt(r,n):t[i]=r},{allOwnKeys:s}),t),vn=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Xn=(t,e,n,s)=>{t.prototype=Object.create(e.prototype,s),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},Yn=(t,e,n,s)=>{let r,i,a;const l={};if(e=e||{},t==null)return e;do{for(r=Object.getOwnPropertyNames(t),i=r.length;i-- >0;)a=r[i],(!s||s(a,t,e))&&!l[a]&&(e[a]=t[a],l[a]=!0);t=n!==!1&&Oe(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},es=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const s=t.indexOf(e,n);return s!==-1&&s===n},ts=t=>{if(!t)return null;if(Y(t))return t;let e=t.length;if(!ht(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},ns=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Oe(Uint8Array)),ss=(t,e)=>{const s=(t&&t[ge]).call(t);let r;for(;(r=s.next())&&!r.done;){const i=r.value;e.call(t,i[0],i[1])}},rs=(t,e)=>{let n;const s=[];for(;(n=t.exec(e))!==null;)s.push(n);return s},os=j("HTMLFormElement"),is=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,s,r){return s.toUpperCase()+r}),ft=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),as=j("RegExp"),mt=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),s={};ie(n,(r,i)=>{let a;(a=e(r,i,t))!==!1&&(s[i]=a||r)}),Object.defineProperties(t,s)},ls=t=>{mt(t,(e,n)=>{if(O(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const s=t[n];if(O(s)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},cs=(t,e)=>{const n={},s=r=>{r.forEach(i=>{n[i]=!0})};return Y(t)?s(t):s(String(t).split(e)),n},ds=()=>{},hs=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function ps(t){return!!(t&&O(t.append)&&t[ct]==="FormData"&&t[ge])}const us=t=>{const e=new Array(10),n=(s,r)=>{if(oe(s)){if(e.indexOf(s)>=0)return;if(re(s))return s;if(!("toJSON"in s)){e[r]=s;const i=Y(s)?[]:{};return ie(s,(a,l)=>{const c=n(a,r+1);!ee(c)&&(i[l]=c)}),e[r]=void 0,i}}return s};return n(t,0)},fs=j("AsyncFunction"),ms=t=>t&&(oe(t)||O(t))&&O(t.then)&&O(t.catch),gt=((t,e)=>t?setImmediate:e?((n,s)=>(Z.addEventListener("message",({source:r,data:i})=>{r===Z&&i===n&&s.length&&s.shift()()},!1),r=>{s.push(r),Z.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",O(Z.postMessage)),gs=typeof queueMicrotask<"u"?queueMicrotask.bind(Z):typeof process<"u"&&process.nextTick||gt,f={isArray:Y,isArrayBuffer:dt,isBuffer:re,isFormData:qn,isArrayBufferView:Ln,isString:On,isNumber:ht,isBoolean:An,isObject:oe,isPlainObject:xe,isEmptyObject:Fn,isReadableStream:Wn,isRequest:Zn,isResponse:Jn,isHeaders:Gn,isUndefined:ee,isDate:Mn,isFile:Pn,isBlob:In,isRegExp:as,isFunction:O,isStream:Un,isURLSearchParams:Hn,isTypedArray:ns,isFileList:jn,forEach:ie,merge:Ae,extend:Qn,trim:Kn,stripBOM:vn,inherits:Xn,toFlatObject:Yn,kindOf:be,kindOfTest:j,endsWith:es,toArray:ts,forEachEntry:ss,matchAll:rs,isHTMLForm:os,hasOwnProperty:ft,hasOwnProp:ft,reduceDescriptors:mt,freezeMethods:ls,toObjectSet:cs,toCamelCase:is,noop:ds,toFiniteNumber:hs,findKey:pt,global:Z,isContextDefined:ut,isSpecCompliantForm:ps,toJSONObject:us,isAsyncFn:fs,isThenable:ms,setImmediate:gt,asap:gs,isIterable:t=>t!=null&&O(t[ge])};function w(t,e,n,s,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),s&&(this.request=s),r&&(this.response=r,this.status=r.status?r.status:null)}f.inherits(w,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:f.toJSONObject(this.config),code:this.code,status:this.status}}});const bt=w.prototype,yt={};["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=>{yt[t]={value:t}}),Object.defineProperties(w,yt),Object.defineProperty(bt,"isAxiosError",{value:!0}),w.from=(t,e,n,s,r,i)=>{const a=Object.create(bt);f.toFlatObject(t,a,function(d){return d!==Error.prototype},h=>h!=="isAxiosError");const l=t&&t.message?t.message:"Error",c=e==null&&t?t.code:e;return w.call(a,l,c,n,s,r),t&&a.cause==null&&Object.defineProperty(a,"cause",{value:t,configurable:!0}),a.name=t&&t.name||"Error",i&&Object.assign(a,i),a};const bs=null;function Fe(t){return f.isPlainObject(t)||f.isArray(t)}function xt(t){return f.endsWith(t,"[]")?t.slice(0,-2):t}function wt(t,e,n){return t?t.concat(e).map(function(r,i){return r=xt(r),!n&&i?"["+r+"]":r}).join(n?".":""):e}function ys(t){return f.isArray(t)&&!t.some(Fe)}const xs=f.toFlatObject(f,{},null,function(e){return/^is[A-Z]/.test(e)});function we(t,e,n){if(!f.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=f.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,y){return!f.isUndefined(y[g])});const s=n.metaTokens,r=n.visitor||d,i=n.dots,a=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&f.isSpecCompliantForm(e);if(!f.isFunction(r))throw new TypeError("visitor must be a function");function h(p){if(p===null)return"";if(f.isDate(p))return p.toISOString();if(f.isBoolean(p))return p.toString();if(!c&&f.isBlob(p))throw new w("Blob is not supported. Use a Buffer instead.");return f.isArrayBuffer(p)||f.isTypedArray(p)?c&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function d(p,g,y){let k=p;if(p&&!y&&typeof p=="object"){if(f.endsWith(g,"{}"))g=s?g:g.slice(0,-2),p=JSON.stringify(p);else if(f.isArray(p)&&ys(p)||(f.isFileList(p)||f.endsWith(g,"[]"))&&(k=f.toArray(p)))return g=xt(g),k.forEach(function(x,S){!(f.isUndefined(x)||x===null)&&e.append(a===!0?wt([g],S,i):a===null?g:g+"[]",h(x))}),!1}return Fe(p)?!0:(e.append(wt(y,g,i),h(p)),!1)}const u=[],m=Object.assign(xs,{defaultVisitor:d,convertValue:h,isVisitable:Fe});function b(p,g){if(!f.isUndefined(p)){if(u.indexOf(p)!==-1)throw Error("Circular reference detected in "+g.join("."));u.push(p),f.forEach(p,function(k,E){(!(f.isUndefined(k)||k===null)&&r.call(e,k,f.isString(E)?E.trim():E,g,m))===!0&&b(k,g?g.concat(E):[E])}),u.pop()}}if(!f.isObject(t))throw new TypeError("data must be an object");return b(t),e}function kt(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(s){return e[s]})}function Me(t,e){this._pairs=[],t&&we(t,this,e)}const _t=Me.prototype;_t.append=function(e,n){this._pairs.push([e,n])},_t.toString=function(e){const n=e?function(s){return e.call(this,s,kt)}:kt;return this._pairs.map(function(r){return n(r[0])+"="+n(r[1])},"").join("&")};function ws(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Et(t,e,n){if(!e)return t;const s=n&&n.encode||ws;f.isFunction(n)&&(n={serialize:n});const r=n&&n.serialize;let i;if(r?i=r(e,n):i=f.isURLSearchParams(e)?e.toString():new Me(e,n).toString(s),i){const a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class St{constructor(){this.handlers=[]}use(e,n,s){return this.handlers.push({fulfilled:e,rejected:n,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){f.forEach(this.handlers,function(s){s!==null&&e(s)})}}const $t={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ks={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Me,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Pe=typeof window<"u"&&typeof document<"u",Ie=typeof navigator=="object"&&navigator||void 0,_s=Pe&&(!Ie||["ReactNative","NativeScript","NS"].indexOf(Ie.product)<0),Es=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Ss=Pe&&window.location.href||"http://localhost",L={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Pe,hasStandardBrowserEnv:_s,hasStandardBrowserWebWorkerEnv:Es,navigator:Ie,origin:Ss},Symbol.toStringTag,{value:"Module"})),...ks};function $s(t,e){return we(t,new L.classes.URLSearchParams,{visitor:function(n,s,r,i){return L.isNode&&f.isBuffer(n)?(this.append(s,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...e})}function Cs(t){return f.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Bs(t){const e={},n=Object.keys(t);let s;const r=n.length;let i;for(s=0;s<r;s++)i=n[s],e[i]=t[i];return e}function Ct(t){function e(n,s,r,i){let a=n[i++];if(a==="__proto__")return!0;const l=Number.isFinite(+a),c=i>=n.length;return a=!a&&f.isArray(r)?r.length:a,c?(f.hasOwnProp(r,a)?r[a]=[r[a],s]:r[a]=s,!l):((!r[a]||!f.isObject(r[a]))&&(r[a]=[]),e(n,s,r[a],i)&&f.isArray(r[a])&&(r[a]=Bs(r[a])),!l)}if(f.isFormData(t)&&f.isFunction(t.entries)){const n={};return f.forEachEntry(t,(s,r)=>{e(Cs(s),r,n,0)}),n}return null}function Ds(t,e,n){if(f.isString(t))try{return(e||JSON.parse)(t),f.trim(t)}catch(s){if(s.name!=="SyntaxError")throw s}return(n||JSON.stringify)(t)}const ae={transitional:$t,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const s=n.getContentType()||"",r=s.indexOf("application/json")>-1,i=f.isObject(e);if(i&&f.isHTMLForm(e)&&(e=new FormData(e)),f.isFormData(e))return r?JSON.stringify(Ct(e)):e;if(f.isArrayBuffer(e)||f.isBuffer(e)||f.isStream(e)||f.isFile(e)||f.isBlob(e)||f.isReadableStream(e))return e;if(f.isArrayBufferView(e))return e.buffer;if(f.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let l;if(i){if(s.indexOf("application/x-www-form-urlencoded")>-1)return $s(e,this.formSerializer).toString();if((l=f.isFileList(e))||s.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return we(l?{"files[]":e}:e,c&&new c,this.formSerializer)}}return i||r?(n.setContentType("application/json",!1),Ds(e)):e}],transformResponse:[function(e){const n=this.transitional||ae.transitional,s=n&&n.forcedJSONParsing,r=this.responseType==="json";if(f.isResponse(e)||f.isReadableStream(e))return e;if(e&&f.isString(e)&&(s&&!this.responseType||r)){const a=!(n&&n.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(l){if(a)throw l.name==="SyntaxError"?w.from(l,w.ERR_BAD_RESPONSE,this,null,this.response):l}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:L.classes.FormData,Blob:L.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};f.forEach(["delete","get","head","post","put","patch"],t=>{ae.headers[t]={}});const Ns=f.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"]),Vs=t=>{const e={};let n,s,r;return t&&t.split(`
|
|
2
|
-
`).forEach(function(a){r=a.indexOf(":"),n=a.substring(0,r).trim().toLowerCase(),s=a.substring(r+1).trim(),!(!n||e[n]&&
|
|
3
|
-
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const s=new this(e);return n.forEach(r=>s.set(r)),s}static accessor(e){const s=(this[Bt]=this[Bt]={accessors:{}}).accessors,r=this.prototype;function i(a){const l=le(a);s[l]||(Ls(r,a),s[l]=!0)}return f.isArray(e)?e.forEach(i):i(e),this}};A.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),f.reduceDescriptors(A.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(s){this[n]=s}}}),f.freezeMethods(A);function Ue(t,e){const n=this||ae,s=e||n,r=A.from(s.headers);let i=s.data;return f.forEach(t,function(l){i=l.call(n,i,r.normalize(),e?e.status:void 0)}),r.normalize(),i}function Dt(t){return!!(t&&t.__CANCEL__)}function te(t,e,n){w.call(this,t??"canceled",w.ERR_CANCELED,e,n),this.name="CanceledError"}f.inherits(te,w,{__CANCEL__:!0});function Nt(t,e,n){const s=n.config.validateStatus;!n.status||!s||s(n.status)?t(n):e(new w("Request failed with status code "+n.status,[w.ERR_BAD_REQUEST,w.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Os(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function As(t,e){t=t||10;const n=new Array(t),s=new Array(t);let r=0,i=0,a;return e=e!==void 0?e:1e3,function(c){const h=Date.now(),d=s[i];a||(a=h),n[r]=c,s[r]=h;let u=i,m=0;for(;u!==r;)m+=n[u++],u=u%t;if(r=(r+1)%t,r===i&&(i=(i+1)%t),h-a<e)return;const b=d&&h-d;return b?Math.round(m*1e3/b):void 0}}function Fs(t,e){let n=0,s=1e3/e,r,i;const a=(h,d=Date.now())=>{n=d,r=null,i&&(clearTimeout(i),i=null),t(...h)};return[(...h)=>{const d=Date.now(),u=d-n;u>=s?a(h,d):(r=h,i||(i=setTimeout(()=>{i=null,a(r)},s-u)))},()=>r&&a(r)]}const _e=(t,e,n=3)=>{let s=0;const r=As(50,250);return Fs(i=>{const a=i.loaded,l=i.lengthComputable?i.total:void 0,c=a-s,h=r(c),d=a<=l;s=a;const u={loaded:a,total:l,progress:l?a/l:void 0,bytes:c,rate:h||void 0,estimated:h&&l&&d?(l-a)/h:void 0,event:i,lengthComputable:l!=null,[e?"download":"upload"]:!0};t(u)},n)},Vt=(t,e)=>{const n=t!=null;return[s=>e[0]({lengthComputable:n,total:t,loaded:s}),e[1]]},Tt=t=>(...e)=>f.asap(()=>t(...e)),Ms=L.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,L.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(L.origin),L.navigator&&/(msie|trident)/i.test(L.navigator.userAgent)):()=>!0,Ps=L.hasStandardBrowserEnv?{write(t,e,n,s,r,i){const a=[t+"="+encodeURIComponent(e)];f.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),f.isString(s)&&a.push("path="+s),f.isString(r)&&a.push("domain="+r),i===!0&&a.push("secure"),document.cookie=a.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Is(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function js(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function zt(t,e,n){let s=!Is(e);return t&&(s||n==!1)?js(t,e):e}const Rt=t=>t instanceof A?{...t}:t;function J(t,e){e=e||{};const n={};function s(h,d,u,m){return f.isPlainObject(h)&&f.isPlainObject(d)?f.merge.call({caseless:m},h,d):f.isPlainObject(d)?f.merge({},d):f.isArray(d)?d.slice():d}function r(h,d,u,m){if(f.isUndefined(d)){if(!f.isUndefined(h))return s(void 0,h,u,m)}else return s(h,d,u,m)}function i(h,d){if(!f.isUndefined(d))return s(void 0,d)}function a(h,d){if(f.isUndefined(d)){if(!f.isUndefined(h))return s(void 0,h)}else return s(void 0,d)}function l(h,d,u){if(u in e)return s(h,d);if(u in t)return s(void 0,h)}const c={url:i,method:i,data:i,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:l,headers:(h,d,u)=>r(Rt(h),Rt(d),u,!0)};return f.forEach(Object.keys({...t,...e}),function(d){const u=c[d]||r,m=u(t[d],e[d],d);f.isUndefined(m)&&u!==l||(n[d]=m)}),n}const Lt=t=>{const e=J({},t);let{data:n,withXSRFToken:s,xsrfHeaderName:r,xsrfCookieName:i,headers:a,auth:l}=e;if(e.headers=a=A.from(a),e.url=Et(zt(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),f.isFormData(n)){if(L.hasStandardBrowserEnv||L.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(f.isFunction(n.getHeaders)){const c=n.getHeaders(),h=["content-type","content-length"];Object.entries(c).forEach(([d,u])=>{h.includes(d.toLowerCase())&&a.set(d,u)})}}if(L.hasStandardBrowserEnv&&(s&&f.isFunction(s)&&(s=s(e)),s||s!==!1&&Ms(e.url))){const c=r&&i&&Ps.read(i);c&&a.set(r,c)}return e},Us=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,s){const r=Lt(t);let i=r.data;const a=A.from(r.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:h}=r,d,u,m,b,p;function g(){b&&b(),p&&p(),r.cancelToken&&r.cancelToken.unsubscribe(d),r.signal&&r.signal.removeEventListener("abort",d)}let y=new XMLHttpRequest;y.open(r.method.toUpperCase(),r.url,!0),y.timeout=r.timeout;function k(){if(!y)return;const x=A.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),D={data:!l||l==="text"||l==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:x,config:t,request:y};Nt(function(z){n(z),g()},function(z){s(z),g()},D),y=null}"onloadend"in y?y.onloadend=k:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(k)},y.onabort=function(){y&&(s(new w("Request aborted",w.ECONNABORTED,t,y)),y=null)},y.onerror=function(S){const D=S&&S.message?S.message:"Network Error",$=new w(D,w.ERR_NETWORK,t,y);$.event=S||null,s($),y=null},y.ontimeout=function(){let S=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const D=r.transitional||$t;r.timeoutErrorMessage&&(S=r.timeoutErrorMessage),s(new w(S,D.clarifyTimeoutError?w.ETIMEDOUT:w.ECONNABORTED,t,y)),y=null},i===void 0&&a.setContentType(null),"setRequestHeader"in y&&f.forEach(a.toJSON(),function(S,D){y.setRequestHeader(D,S)}),f.isUndefined(r.withCredentials)||(y.withCredentials=!!r.withCredentials),l&&l!=="json"&&(y.responseType=r.responseType),h&&([m,p]=_e(h,!0),y.addEventListener("progress",m)),c&&y.upload&&([u,b]=_e(c),y.upload.addEventListener("progress",u),y.upload.addEventListener("loadend",b)),(r.cancelToken||r.signal)&&(d=x=>{y&&(s(!x||x.type?new te(null,t,y):x),y.abort(),y=null)},r.cancelToken&&r.cancelToken.subscribe(d),r.signal&&(r.signal.aborted?d():r.signal.addEventListener("abort",d)));const E=Os(r.url);if(E&&L.protocols.indexOf(E)===-1){s(new w("Unsupported protocol "+E+":",w.ERR_BAD_REQUEST,t));return}y.send(i||null)})},qs=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let s=new AbortController,r;const i=function(h){if(!r){r=!0,l();const d=h instanceof Error?h:this.reason;s.abort(d instanceof w?d:new te(d instanceof Error?d.message:d))}};let a=e&&setTimeout(()=>{a=null,i(new w(`timeout ${e} of ms exceeded`,w.ETIMEDOUT))},e);const l=()=>{t&&(a&&clearTimeout(a),a=null,t.forEach(h=>{h.unsubscribe?h.unsubscribe(i):h.removeEventListener("abort",i)}),t=null)};t.forEach(h=>h.addEventListener("abort",i));const{signal:c}=s;return c.unsubscribe=()=>f.asap(l),c}},Hs=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let s=0,r;for(;s<n;)r=s+e,yield t.slice(s,r),s=r},Ws=async function*(t,e){for await(const n of Zs(t))yield*Hs(n,e)},Zs=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:s}=await e.read();if(n)break;yield s}}finally{await e.cancel()}},Ot=(t,e,n,s)=>{const r=Ws(t,e);let i=0,a,l=c=>{a||(a=!0,s&&s(c))};return new ReadableStream({async pull(c){try{const{done:h,value:d}=await r.next();if(h){l(),c.close();return}let u=d.byteLength;if(n){let m=i+=u;n(m)}c.enqueue(new Uint8Array(d))}catch(h){throw l(h),h}},cancel(c){return l(c),r.return()}},{highWaterMark:2})},At=64*1024,{isFunction:Ee}=f,Js=(({Request:t,Response:e})=>({Request:t,Response:e}))(f.global),{ReadableStream:Ft,TextEncoder:Mt}=f.global,Pt=(t,...e)=>{try{return!!t(...e)}catch{return!1}},Gs=t=>{t=f.merge.call({skipUndefined:!0},Js,t);const{fetch:e,Request:n,Response:s}=t,r=e?Ee(e):typeof fetch=="function",i=Ee(n),a=Ee(s);if(!r)return!1;const l=r&&Ee(Ft),c=r&&(typeof Mt=="function"?(p=>g=>p.encode(g))(new Mt):async p=>new Uint8Array(await new n(p).arrayBuffer())),h=i&&l&&Pt(()=>{let p=!1;const g=new n(L.origin,{body:new Ft,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!g}),d=a&&l&&Pt(()=>f.isReadableStream(new s("").body)),u={stream:d&&(p=>p.body)};r&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!u[p]&&(u[p]=(g,y)=>{let k=g&&g[p];if(k)return k.call(g);throw new w(`Response type '${p}' is not supported`,w.ERR_NOT_SUPPORT,y)})});const m=async p=>{if(p==null)return 0;if(f.isBlob(p))return p.size;if(f.isSpecCompliantForm(p))return(await new n(L.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(f.isArrayBufferView(p)||f.isArrayBuffer(p))return p.byteLength;if(f.isURLSearchParams(p)&&(p=p+""),f.isString(p))return(await c(p)).byteLength},b=async(p,g)=>{const y=f.toFiniteNumber(p.getContentLength());return y??m(g)};return async p=>{let{url:g,method:y,data:k,signal:E,cancelToken:x,timeout:S,onDownloadProgress:D,onUploadProgress:$,responseType:z,headers:it,withCredentials:ze="same-origin",fetchOptions:$n}=Lt(p),Cn=e||fetch;z=z?(z+"").toLowerCase():"text";let Re=qs([E,x&&x.toAbortSignal()],S),me=null;const X=Re&&Re.unsubscribe&&(()=>{Re.unsubscribe()});let Bn;try{if($&&h&&y!=="get"&&y!=="head"&&(Bn=await b(it,k))!==0){let W=new n(g,{method:"POST",body:k,duplex:"half"}),ne;if(f.isFormData(k)&&(ne=W.headers.get("content-type"))&&it.setContentType(ne),W.body){const[at,Le]=Vt(Bn,_e(Tt($)));k=Ot(W.body,At,at,Le)}}f.isString(ze)||(ze=ze?"include":"omit");const q=i&&"credentials"in n.prototype,Dn={...$n,signal:Re,method:y.toUpperCase(),headers:it.normalize().toJSON(),body:k,duplex:"half",credentials:q?ze:void 0};me=i&&new n(g,Dn);let H=await(i?Cn(me,$n):Cn(g,Dn));const Nn=d&&(z==="stream"||z==="response");if(d&&(D||Nn&&X)){const W={};["status","statusText","headers"].forEach(Vn=>{W[Vn]=H[Vn]});const ne=f.toFiniteNumber(H.headers.get("content-length")),[at,Le]=D&&Vt(ne,_e(Tt(D),!0))||[];H=new s(Ot(H.body,At,at,()=>{Le&&Le(),X&&X()}),W)}z=z||"text";let rc=await u[f.findKey(u,z)||"text"](H,p);return!Nn&&X&&X(),await new Promise((W,ne)=>{Nt(W,ne,{data:rc,headers:A.from(H.headers),status:H.status,statusText:H.statusText,config:p,request:me})})}catch(q){throw X&&X(),q&&q.name==="TypeError"&&/Load failed|fetch/i.test(q.message)?Object.assign(new w("Network Error",w.ERR_NETWORK,p,me),{cause:q.cause||q}):w.from(q,q&&q.code,p,me)}}},Ks=new Map,It=t=>{let e=t?t.env:{};const{fetch:n,Request:s,Response:r}=e,i=[s,r,n];let a=i.length,l=a,c,h,d=Ks;for(;l--;)c=i[l],h=d.get(c),h===void 0&&d.set(c,h=l?new Map:Gs(e)),d=h;return h};It();const qe={http:bs,xhr:Us,fetch:{get:It}};f.forEach(qe,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const jt=t=>`- ${t}`,Qs=t=>f.isFunction(t)||t===null||t===!1,Ut={getAdapter:(t,e)=>{t=f.isArray(t)?t:[t];const{length:n}=t;let s,r;const i={};for(let a=0;a<n;a++){s=t[a];let l;if(r=s,!Qs(s)&&(r=qe[(l=String(s)).toLowerCase()],r===void 0))throw new w(`Unknown adapter '${l}'`);if(r&&(f.isFunction(r)||(r=r.get(e))))break;i[l||"#"+a]=r}if(!r){const a=Object.entries(i).map(([c,h])=>`adapter ${c} `+(h===!1?"is not supported by the environment":"is not available in the build"));let l=n?a.length>1?`since :
|
|
4
|
-
`+
|
|
5
|
-
`):" "+
|
|
6
|
-
`+i):s.stack=i}catch{}}throw s}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=
|
|
1
|
+
(function(T,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],o):(T=typeof globalThis<"u"?globalThis:T||self,o(T.bi={},T.Vue))})(this,function(T,o){"use strict";var Hl=Object.defineProperty;var Wl=(T,o,R)=>o in T?Hl(T,o,{enumerable:!0,configurable:!0,writable:!0,value:R}):T[o]=R;var D=(T,o,R)=>Wl(T,typeof o!="symbol"?o+"":o,R);function R(t,e){return t!=null&&t.value?isNaN(t==null?void 0:t.value)?t==null?void 0:t.value:new Intl.NumberFormat("en",e||{notation:"compact"}).format(t==null?void 0:t.value):isNaN(t)?t:new Intl.NumberFormat("en",e||{notation:"compact"}).format(t)}function v(t){if(!(t!=null&&t.includes("T")))return t;const[e,n,s]=t.split("T")[0].split("-");return`${s}.${n}.${e}`}function bn(t){return Intl.NumberFormat("en").format(t)}function et(t,e){return function(){return t.apply(e,arguments)}}const{toString:yn}=Object.prototype,{getPrototypeOf:De}=Object,{iterator:de,toStringTag:tt}=Symbol,he=(t=>e=>{const n=yn.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),j=t=>(t=t.toLowerCase(),e=>he(e)===t),pe=t=>e=>typeof e===t,{isArray:K}=Array,X=pe("undefined");function Y(t){return t!==null&&!X(t)&&t.constructor!==null&&!X(t.constructor)&&L(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const nt=j("ArrayBuffer");function xn(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&nt(t.buffer),e}const wn=pe("string"),L=pe("function"),st=pe("number"),ee=t=>t!==null&&typeof t=="object",kn=t=>t===!0||t===!1,ue=t=>{if(he(t)!=="object")return!1;const e=De(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(tt in t)&&!(de in t)},_n=t=>{if(!ee(t)||Y(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},En=j("Date"),Sn=j("File"),$n=j("Blob"),Cn=j("FileList"),Bn=t=>ee(t)&&L(t.pipe),Dn=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||L(t.append)&&((e=he(t))==="formdata"||e==="object"&&L(t.toString)&&t.toString()==="[object FormData]"))},Nn=j("URLSearchParams"),[Vn,Tn,Rn,zn]=["ReadableStream","Request","Response","Headers"].map(j),Ln=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function te(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let s,r;if(typeof t!="object"&&(t=[t]),K(t))for(s=0,r=t.length;s<r;s++)e.call(null,t[s],s,t);else{if(Y(t))return;const i=n?Object.getOwnPropertyNames(t):Object.keys(t),a=i.length;let l;for(s=0;s<a;s++)l=i[s],e.call(null,t[l],l,t)}}function rt(t,e){if(Y(t))return null;e=e.toLowerCase();const n=Object.keys(t);let s=n.length,r;for(;s-- >0;)if(r=n[s],e===r.toLowerCase())return r;return null}const q=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ot=t=>!X(t)&&t!==q;function Ne(){const{caseless:t}=ot(this)&&this||{},e={},n=(s,r)=>{const i=t&&rt(e,r)||r;ue(e[i])&&ue(s)?e[i]=Ne(e[i],s):ue(s)?e[i]=Ne({},s):K(s)?e[i]=s.slice():e[i]=s};for(let s=0,r=arguments.length;s<r;s++)arguments[s]&&te(arguments[s],n);return e}const On=(t,e,n,{allOwnKeys:s}={})=>(te(e,(r,i)=>{n&&L(r)?t[i]=et(r,n):t[i]=r},{allOwnKeys:s}),t),An=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Fn=(t,e,n,s)=>{t.prototype=Object.create(e.prototype,s),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},Mn=(t,e,n,s)=>{let r,i,a;const l={};if(e=e||{},t==null)return e;do{for(r=Object.getOwnPropertyNames(t),i=r.length;i-- >0;)a=r[i],(!s||s(a,t,e))&&!l[a]&&(e[a]=t[a],l[a]=!0);t=n!==!1&&De(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},Pn=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const s=t.indexOf(e,n);return s!==-1&&s===n},In=t=>{if(!t)return null;if(K(t))return t;let e=t.length;if(!st(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},jn=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&De(Uint8Array)),Un=(t,e)=>{const s=(t&&t[de]).call(t);let r;for(;(r=s.next())&&!r.done;){const i=r.value;e.call(t,i[0],i[1])}},qn=(t,e)=>{let n;const s=[];for(;(n=t.exec(e))!==null;)s.push(n);return s},Hn=j("HTMLFormElement"),Wn=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,s,r){return s.toUpperCase()+r}),it=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),Zn=j("RegExp"),at=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),s={};te(n,(r,i)=>{let a;(a=e(r,i,t))!==!1&&(s[i]=a||r)}),Object.defineProperties(t,s)},Jn=t=>{at(t,(e,n)=>{if(L(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const s=t[n];if(L(s)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Gn=(t,e)=>{const n={},s=r=>{r.forEach(i=>{n[i]=!0})};return K(t)?s(t):s(String(t).split(e)),n},Kn=()=>{},Qn=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function vn(t){return!!(t&&L(t.append)&&t[tt]==="FormData"&&t[de])}const Xn=t=>{const e=new Array(10),n=(s,r)=>{if(ee(s)){if(e.indexOf(s)>=0)return;if(Y(s))return s;if(!("toJSON"in s)){e[r]=s;const i=K(s)?[]:{};return te(s,(a,l)=>{const c=n(a,r+1);!X(c)&&(i[l]=c)}),e[r]=void 0,i}}return s};return n(t,0)},Yn=j("AsyncFunction"),es=t=>t&&(ee(t)||L(t))&&L(t.then)&&L(t.catch),lt=((t,e)=>t?setImmediate:e?((n,s)=>(q.addEventListener("message",({source:r,data:i})=>{r===q&&i===n&&s.length&&s.shift()()},!1),r=>{s.push(r),q.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",L(q.postMessage)),ts=typeof queueMicrotask<"u"?queueMicrotask.bind(q):typeof process<"u"&&process.nextTick||lt,f={isArray:K,isArrayBuffer:nt,isBuffer:Y,isFormData:Dn,isArrayBufferView:xn,isString:wn,isNumber:st,isBoolean:kn,isObject:ee,isPlainObject:ue,isEmptyObject:_n,isReadableStream:Vn,isRequest:Tn,isResponse:Rn,isHeaders:zn,isUndefined:X,isDate:En,isFile:Sn,isBlob:$n,isRegExp:Zn,isFunction:L,isStream:Bn,isURLSearchParams:Nn,isTypedArray:jn,isFileList:Cn,forEach:te,merge:Ne,extend:On,trim:Ln,stripBOM:An,inherits:Fn,toFlatObject:Mn,kindOf:he,kindOfTest:j,endsWith:Pn,toArray:In,forEachEntry:Un,matchAll:qn,isHTMLForm:Hn,hasOwnProperty:it,hasOwnProp:it,reduceDescriptors:at,freezeMethods:Jn,toObjectSet:Gn,toCamelCase:Wn,noop:Kn,toFiniteNumber:Qn,findKey:rt,global:q,isContextDefined:ot,isSpecCompliantForm:vn,toJSONObject:Xn,isAsyncFn:Yn,isThenable:es,setImmediate:lt,asap:ts,isIterable:t=>t!=null&&L(t[de])};function k(t,e,n,s,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),s&&(this.request=s),r&&(this.response=r,this.status=r.status?r.status:null)}f.inherits(k,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:f.toJSONObject(this.config),code:this.code,status:this.status}}});const ct=k.prototype,dt={};["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=>{dt[t]={value:t}}),Object.defineProperties(k,dt),Object.defineProperty(ct,"isAxiosError",{value:!0}),k.from=(t,e,n,s,r,i)=>{const a=Object.create(ct);return f.toFlatObject(t,a,function(c){return c!==Error.prototype},l=>l!=="isAxiosError"),k.call(a,t.message,e,n,s,r),a.cause=t,a.name=t.name,i&&Object.assign(a,i),a};const ns=null;function Ve(t){return f.isPlainObject(t)||f.isArray(t)}function ht(t){return f.endsWith(t,"[]")?t.slice(0,-2):t}function pt(t,e,n){return t?t.concat(e).map(function(r,i){return r=ht(r),!n&&i?"["+r+"]":r}).join(n?".":""):e}function ss(t){return f.isArray(t)&&!t.some(Ve)}const rs=f.toFlatObject(f,{},null,function(e){return/^is[A-Z]/.test(e)});function fe(t,e,n){if(!f.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=f.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,y){return!f.isUndefined(y[b])});const s=n.metaTokens,r=n.visitor||d,i=n.dots,a=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&f.isSpecCompliantForm(e);if(!f.isFunction(r))throw new TypeError("visitor must be a function");function h(u){if(u===null)return"";if(f.isDate(u))return u.toISOString();if(f.isBoolean(u))return u.toString();if(!c&&f.isBlob(u))throw new k("Blob is not supported. Use a Buffer instead.");return f.isArrayBuffer(u)||f.isTypedArray(u)?c&&typeof Blob=="function"?new Blob([u]):Buffer.from(u):u}function d(u,b,y){let _=u;if(u&&!y&&typeof u=="object"){if(f.endsWith(b,"{}"))b=s?b:b.slice(0,-2),u=JSON.stringify(u);else if(f.isArray(u)&&ss(u)||(f.isFileList(u)||f.endsWith(b,"[]"))&&(_=f.toArray(u)))return b=ht(b),_.forEach(function(x,N){!(f.isUndefined(x)||x===null)&&e.append(a===!0?pt([b],N,i):a===null?b:b+"[]",h(x))}),!1}return Ve(u)?!0:(e.append(pt(y,b,i),h(u)),!1)}const p=[],m=Object.assign(rs,{defaultVisitor:d,convertValue:h,isVisitable:Ve});function g(u,b){if(!f.isUndefined(u)){if(p.indexOf(u)!==-1)throw Error("Circular reference detected in "+b.join("."));p.push(u),f.forEach(u,function(_,w){(!(f.isUndefined(_)||_===null)&&r.call(e,_,f.isString(w)?w.trim():w,b,m))===!0&&g(_,b?b.concat(w):[w])}),p.pop()}}if(!f.isObject(t))throw new TypeError("data must be an object");return g(t),e}function ut(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(s){return e[s]})}function Te(t,e){this._pairs=[],t&&fe(t,this,e)}const ft=Te.prototype;ft.append=function(e,n){this._pairs.push([e,n])},ft.toString=function(e){const n=e?function(s){return e.call(this,s,ut)}:ut;return this._pairs.map(function(r){return n(r[0])+"="+n(r[1])},"").join("&")};function os(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function mt(t,e,n){if(!e)return t;const s=n&&n.encode||os;f.isFunction(n)&&(n={serialize:n});const r=n&&n.serialize;let i;if(r?i=r(e,n):i=f.isURLSearchParams(e)?e.toString():new Te(e,n).toString(s),i){const a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class gt{constructor(){this.handlers=[]}use(e,n,s){return this.handlers.push({fulfilled:e,rejected:n,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){f.forEach(this.handlers,function(s){s!==null&&e(s)})}}const bt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},is={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Te,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Re=typeof window<"u"&&typeof document<"u",ze=typeof navigator=="object"&&navigator||void 0,as=Re&&(!ze||["ReactNative","NativeScript","NS"].indexOf(ze.product)<0),ls=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",cs=Re&&window.location.href||"http://localhost",z={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Re,hasStandardBrowserEnv:as,hasStandardBrowserWebWorkerEnv:ls,navigator:ze,origin:cs},Symbol.toStringTag,{value:"Module"})),...is};function ds(t,e){return fe(t,new z.classes.URLSearchParams,{visitor:function(n,s,r,i){return z.isNode&&f.isBuffer(n)?(this.append(s,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...e})}function hs(t){return f.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function ps(t){const e={},n=Object.keys(t);let s;const r=n.length;let i;for(s=0;s<r;s++)i=n[s],e[i]=t[i];return e}function yt(t){function e(n,s,r,i){let a=n[i++];if(a==="__proto__")return!0;const l=Number.isFinite(+a),c=i>=n.length;return a=!a&&f.isArray(r)?r.length:a,c?(f.hasOwnProp(r,a)?r[a]=[r[a],s]:r[a]=s,!l):((!r[a]||!f.isObject(r[a]))&&(r[a]=[]),e(n,s,r[a],i)&&f.isArray(r[a])&&(r[a]=ps(r[a])),!l)}if(f.isFormData(t)&&f.isFunction(t.entries)){const n={};return f.forEachEntry(t,(s,r)=>{e(hs(s),r,n,0)}),n}return null}function us(t,e,n){if(f.isString(t))try{return(e||JSON.parse)(t),f.trim(t)}catch(s){if(s.name!=="SyntaxError")throw s}return(n||JSON.stringify)(t)}const ne={transitional:bt,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const s=n.getContentType()||"",r=s.indexOf("application/json")>-1,i=f.isObject(e);if(i&&f.isHTMLForm(e)&&(e=new FormData(e)),f.isFormData(e))return r?JSON.stringify(yt(e)):e;if(f.isArrayBuffer(e)||f.isBuffer(e)||f.isStream(e)||f.isFile(e)||f.isBlob(e)||f.isReadableStream(e))return e;if(f.isArrayBufferView(e))return e.buffer;if(f.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let l;if(i){if(s.indexOf("application/x-www-form-urlencoded")>-1)return ds(e,this.formSerializer).toString();if((l=f.isFileList(e))||s.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return fe(l?{"files[]":e}:e,c&&new c,this.formSerializer)}}return i||r?(n.setContentType("application/json",!1),us(e)):e}],transformResponse:[function(e){const n=this.transitional||ne.transitional,s=n&&n.forcedJSONParsing,r=this.responseType==="json";if(f.isResponse(e)||f.isReadableStream(e))return e;if(e&&f.isString(e)&&(s&&!this.responseType||r)){const a=!(n&&n.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(l){if(a)throw l.name==="SyntaxError"?k.from(l,k.ERR_BAD_RESPONSE,this,null,this.response):l}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:z.classes.FormData,Blob:z.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};f.forEach(["delete","get","head","post","put","patch"],t=>{ne.headers[t]={}});const fs=f.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"]),ms=t=>{const e={};let n,s,r;return t&&t.split(`
|
|
2
|
+
`).forEach(function(a){r=a.indexOf(":"),n=a.substring(0,r).trim().toLowerCase(),s=a.substring(r+1).trim(),!(!n||e[n]&&fs[n])&&(n==="set-cookie"?e[n]?e[n].push(s):e[n]=[s]:e[n]=e[n]?e[n]+", "+s:s)}),e},xt=Symbol("internals");function se(t){return t&&String(t).trim().toLowerCase()}function me(t){return t===!1||t==null?t:f.isArray(t)?t.map(me):String(t)}function gs(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=n.exec(t);)e[s[1]]=s[2];return e}const bs=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Le(t,e,n,s,r){if(f.isFunction(s))return s.call(this,e,n);if(r&&(e=n),!!f.isString(e)){if(f.isString(s))return e.indexOf(s)!==-1;if(f.isRegExp(s))return s.test(e)}}function ys(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,s)=>n.toUpperCase()+s)}function xs(t,e){const n=f.toCamelCase(" "+e);["get","set","has"].forEach(s=>{Object.defineProperty(t,s+n,{value:function(r,i,a){return this[s].call(this,e,r,i,a)},configurable:!0})})}let O=class{constructor(e){e&&this.set(e)}set(e,n,s){const r=this;function i(l,c,h){const d=se(c);if(!d)throw new Error("header name must be a non-empty string");const p=f.findKey(r,d);(!p||r[p]===void 0||h===!0||h===void 0&&r[p]!==!1)&&(r[p||c]=me(l))}const a=(l,c)=>f.forEach(l,(h,d)=>i(h,d,c));if(f.isPlainObject(e)||e instanceof this.constructor)a(e,n);else if(f.isString(e)&&(e=e.trim())&&!bs(e))a(ms(e),n);else if(f.isObject(e)&&f.isIterable(e)){let l={},c,h;for(const d of e){if(!f.isArray(d))throw TypeError("Object iterator must return a key-value pair");l[h=d[0]]=(c=l[h])?f.isArray(c)?[...c,d[1]]:[c,d[1]]:d[1]}a(l,n)}else e!=null&&i(n,e,s);return this}get(e,n){if(e=se(e),e){const s=f.findKey(this,e);if(s){const r=this[s];if(!n)return r;if(n===!0)return gs(r);if(f.isFunction(n))return n.call(this,r,s);if(f.isRegExp(n))return n.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=se(e),e){const s=f.findKey(this,e);return!!(s&&this[s]!==void 0&&(!n||Le(this,this[s],s,n)))}return!1}delete(e,n){const s=this;let r=!1;function i(a){if(a=se(a),a){const l=f.findKey(s,a);l&&(!n||Le(s,s[l],l,n))&&(delete s[l],r=!0)}}return f.isArray(e)?e.forEach(i):i(e),r}clear(e){const n=Object.keys(this);let s=n.length,r=!1;for(;s--;){const i=n[s];(!e||Le(this,this[i],i,e,!0))&&(delete this[i],r=!0)}return r}normalize(e){const n=this,s={};return f.forEach(this,(r,i)=>{const a=f.findKey(s,i);if(a){n[a]=me(r),delete n[i];return}const l=e?ys(i):String(i).trim();l!==i&&delete n[i],n[l]=me(r),s[l]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return f.forEach(this,(s,r)=>{s!=null&&s!==!1&&(n[r]=e&&f.isArray(s)?s.join(", "):s)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
|
|
3
|
+
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const s=new this(e);return n.forEach(r=>s.set(r)),s}static accessor(e){const s=(this[xt]=this[xt]={accessors:{}}).accessors,r=this.prototype;function i(a){const l=se(a);s[l]||(xs(r,a),s[l]=!0)}return f.isArray(e)?e.forEach(i):i(e),this}};O.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),f.reduceDescriptors(O.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(s){this[n]=s}}}),f.freezeMethods(O);function Oe(t,e){const n=this||ne,s=e||n,r=O.from(s.headers);let i=s.data;return f.forEach(t,function(l){i=l.call(n,i,r.normalize(),e?e.status:void 0)}),r.normalize(),i}function wt(t){return!!(t&&t.__CANCEL__)}function Q(t,e,n){k.call(this,t??"canceled",k.ERR_CANCELED,e,n),this.name="CanceledError"}f.inherits(Q,k,{__CANCEL__:!0});function kt(t,e,n){const s=n.config.validateStatus;!n.status||!s||s(n.status)?t(n):e(new k("Request failed with status code "+n.status,[k.ERR_BAD_REQUEST,k.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function ws(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function ks(t,e){t=t||10;const n=new Array(t),s=new Array(t);let r=0,i=0,a;return e=e!==void 0?e:1e3,function(c){const h=Date.now(),d=s[i];a||(a=h),n[r]=c,s[r]=h;let p=i,m=0;for(;p!==r;)m+=n[p++],p=p%t;if(r=(r+1)%t,r===i&&(i=(i+1)%t),h-a<e)return;const g=d&&h-d;return g?Math.round(m*1e3/g):void 0}}function _s(t,e){let n=0,s=1e3/e,r,i;const a=(h,d=Date.now())=>{n=d,r=null,i&&(clearTimeout(i),i=null),t(...h)};return[(...h)=>{const d=Date.now(),p=d-n;p>=s?a(h,d):(r=h,i||(i=setTimeout(()=>{i=null,a(r)},s-p)))},()=>r&&a(r)]}const ge=(t,e,n=3)=>{let s=0;const r=ks(50,250);return _s(i=>{const a=i.loaded,l=i.lengthComputable?i.total:void 0,c=a-s,h=r(c),d=a<=l;s=a;const p={loaded:a,total:l,progress:l?a/l:void 0,bytes:c,rate:h||void 0,estimated:h&&l&&d?(l-a)/h:void 0,event:i,lengthComputable:l!=null,[e?"download":"upload"]:!0};t(p)},n)},_t=(t,e)=>{const n=t!=null;return[s=>e[0]({lengthComputable:n,total:t,loaded:s}),e[1]]},Et=t=>(...e)=>f.asap(()=>t(...e)),Es=z.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,z.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(z.origin),z.navigator&&/(msie|trident)/i.test(z.navigator.userAgent)):()=>!0,Ss=z.hasStandardBrowserEnv?{write(t,e,n,s,r,i){const a=[t+"="+encodeURIComponent(e)];f.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),f.isString(s)&&a.push("path="+s),f.isString(r)&&a.push("domain="+r),i===!0&&a.push("secure"),document.cookie=a.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function $s(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Cs(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function St(t,e,n){let s=!$s(e);return t&&(s||n==!1)?Cs(t,e):e}const $t=t=>t instanceof O?{...t}:t;function H(t,e){e=e||{};const n={};function s(h,d,p,m){return f.isPlainObject(h)&&f.isPlainObject(d)?f.merge.call({caseless:m},h,d):f.isPlainObject(d)?f.merge({},d):f.isArray(d)?d.slice():d}function r(h,d,p,m){if(f.isUndefined(d)){if(!f.isUndefined(h))return s(void 0,h,p,m)}else return s(h,d,p,m)}function i(h,d){if(!f.isUndefined(d))return s(void 0,d)}function a(h,d){if(f.isUndefined(d)){if(!f.isUndefined(h))return s(void 0,h)}else return s(void 0,d)}function l(h,d,p){if(p in e)return s(h,d);if(p in t)return s(void 0,h)}const c={url:i,method:i,data:i,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:l,headers:(h,d,p)=>r($t(h),$t(d),p,!0)};return f.forEach(Object.keys({...t,...e}),function(d){const p=c[d]||r,m=p(t[d],e[d],d);f.isUndefined(m)&&p!==l||(n[d]=m)}),n}const Ct=t=>{const e=H({},t);let{data:n,withXSRFToken:s,xsrfHeaderName:r,xsrfCookieName:i,headers:a,auth:l}=e;e.headers=a=O.from(a),e.url=mt(St(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let c;if(f.isFormData(n)){if(z.hasStandardBrowserEnv||z.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((c=a.getContentType())!==!1){const[h,...d]=c?c.split(";").map(p=>p.trim()).filter(Boolean):[];a.setContentType([h||"multipart/form-data",...d].join("; "))}}if(z.hasStandardBrowserEnv&&(s&&f.isFunction(s)&&(s=s(e)),s||s!==!1&&Es(e.url))){const h=r&&i&&Ss.read(i);h&&a.set(r,h)}return e},Bs=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,s){const r=Ct(t);let i=r.data;const a=O.from(r.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:h}=r,d,p,m,g,u;function b(){g&&g(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(d),r.signal&&r.signal.removeEventListener("abort",d)}let y=new XMLHttpRequest;y.open(r.method.toUpperCase(),r.url,!0),y.timeout=r.timeout;function _(){if(!y)return;const x=O.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),$={data:!l||l==="text"||l==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:x,config:t,request:y};kt(function(F){n(F),b()},function(F){s(F),b()},$),y=null}"onloadend"in y?y.onloadend=_:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(_)},y.onabort=function(){y&&(s(new k("Request aborted",k.ECONNABORTED,t,y)),y=null)},y.onerror=function(){s(new k("Network Error",k.ERR_NETWORK,t,y)),y=null},y.ontimeout=function(){let N=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const $=r.transitional||bt;r.timeoutErrorMessage&&(N=r.timeoutErrorMessage),s(new k(N,$.clarifyTimeoutError?k.ETIMEDOUT:k.ECONNABORTED,t,y)),y=null},i===void 0&&a.setContentType(null),"setRequestHeader"in y&&f.forEach(a.toJSON(),function(N,$){y.setRequestHeader($,N)}),f.isUndefined(r.withCredentials)||(y.withCredentials=!!r.withCredentials),l&&l!=="json"&&(y.responseType=r.responseType),h&&([m,u]=ge(h,!0),y.addEventListener("progress",m)),c&&y.upload&&([p,g]=ge(c),y.upload.addEventListener("progress",p),y.upload.addEventListener("loadend",g)),(r.cancelToken||r.signal)&&(d=x=>{y&&(s(!x||x.type?new Q(null,t,y):x),y.abort(),y=null)},r.cancelToken&&r.cancelToken.subscribe(d),r.signal&&(r.signal.aborted?d():r.signal.addEventListener("abort",d)));const w=ws(r.url);if(w&&z.protocols.indexOf(w)===-1){s(new k("Unsupported protocol "+w+":",k.ERR_BAD_REQUEST,t));return}y.send(i||null)})},Ds=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let s=new AbortController,r;const i=function(h){if(!r){r=!0,l();const d=h instanceof Error?h:this.reason;s.abort(d instanceof k?d:new Q(d instanceof Error?d.message:d))}};let a=e&&setTimeout(()=>{a=null,i(new k(`timeout ${e} of ms exceeded`,k.ETIMEDOUT))},e);const l=()=>{t&&(a&&clearTimeout(a),a=null,t.forEach(h=>{h.unsubscribe?h.unsubscribe(i):h.removeEventListener("abort",i)}),t=null)};t.forEach(h=>h.addEventListener("abort",i));const{signal:c}=s;return c.unsubscribe=()=>f.asap(l),c}},Ns=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let s=0,r;for(;s<n;)r=s+e,yield t.slice(s,r),s=r},Vs=async function*(t,e){for await(const n of Ts(t))yield*Ns(n,e)},Ts=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:s}=await e.read();if(n)break;yield s}}finally{await e.cancel()}},Bt=(t,e,n,s)=>{const r=Vs(t,e);let i=0,a,l=c=>{a||(a=!0,s&&s(c))};return new ReadableStream({async pull(c){try{const{done:h,value:d}=await r.next();if(h){l(),c.close();return}let p=d.byteLength;if(n){let m=i+=p;n(m)}c.enqueue(new Uint8Array(d))}catch(h){throw l(h),h}},cancel(c){return l(c),r.return()}},{highWaterMark:2})},be=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Dt=be&&typeof ReadableStream=="function",Rs=be&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),Nt=(t,...e)=>{try{return!!t(...e)}catch{return!1}},zs=Dt&&Nt(()=>{let t=!1;const e=new Request(z.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),Vt=64*1024,Ae=Dt&&Nt(()=>f.isReadableStream(new Response("").body)),ye={stream:Ae&&(t=>t.body)};be&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!ye[e]&&(ye[e]=f.isFunction(t[e])?n=>n[e]():(n,s)=>{throw new k(`Response type '${e}' is not supported`,k.ERR_NOT_SUPPORT,s)})})})(new Response);const Ls=async t=>{if(t==null)return 0;if(f.isBlob(t))return t.size;if(f.isSpecCompliantForm(t))return(await new Request(z.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(f.isArrayBufferView(t)||f.isArrayBuffer(t))return t.byteLength;if(f.isURLSearchParams(t)&&(t=t+""),f.isString(t))return(await Rs(t)).byteLength},Os=async(t,e)=>{const n=f.toFiniteNumber(t.getContentLength());return n??Ls(e)},Fe={http:ns,xhr:Bs,fetch:be&&(async t=>{let{url:e,method:n,data:s,signal:r,cancelToken:i,timeout:a,onDownloadProgress:l,onUploadProgress:c,responseType:h,headers:d,withCredentials:p="same-origin",fetchOptions:m}=Ct(t);h=h?(h+"").toLowerCase():"text";let g=Ds([r,i&&i.toAbortSignal()],a),u;const b=g&&g.unsubscribe&&(()=>{g.unsubscribe()});let y;try{if(c&&zs&&n!=="get"&&n!=="head"&&(y=await Os(d,s))!==0){let $=new Request(e,{method:"POST",body:s,duplex:"half"}),S;if(f.isFormData(s)&&(S=$.headers.get("content-type"))&&d.setContentType(S),$.body){const[F,Be]=_t(y,ge(Et(c)));s=Bt($.body,Vt,F,Be)}}f.isString(p)||(p=p?"include":"omit");const _="credentials"in Request.prototype;u=new Request(e,{...m,signal:g,method:n.toUpperCase(),headers:d.normalize().toJSON(),body:s,duplex:"half",credentials:_?p:void 0});let w=await fetch(u,m);const x=Ae&&(h==="stream"||h==="response");if(Ae&&(l||x&&b)){const $={};["status","statusText","headers"].forEach(mn=>{$[mn]=w[mn]});const S=f.toFiniteNumber(w.headers.get("content-length")),[F,Be]=l&&_t(S,ge(Et(l),!0))||[];w=new Response(Bt(w.body,Vt,F,()=>{Be&&Be(),b&&b()}),$)}h=h||"text";let N=await ye[f.findKey(ye,h)||"text"](w,t);return!x&&b&&b(),await new Promise(($,S)=>{kt($,S,{data:N,headers:O.from(w.headers),status:w.status,statusText:w.statusText,config:t,request:u})})}catch(_){throw b&&b(),_&&_.name==="TypeError"&&/Load failed|fetch/i.test(_.message)?Object.assign(new k("Network Error",k.ERR_NETWORK,t,u),{cause:_.cause||_}):k.from(_,_&&_.code,t,u)}})};f.forEach(Fe,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Tt=t=>`- ${t}`,As=t=>f.isFunction(t)||t===null||t===!1,Rt={getAdapter:t=>{t=f.isArray(t)?t:[t];const{length:e}=t;let n,s;const r={};for(let i=0;i<e;i++){n=t[i];let a;if(s=n,!As(n)&&(s=Fe[(a=String(n)).toLowerCase()],s===void 0))throw new k(`Unknown adapter '${a}'`);if(s)break;r[a||"#"+i]=s}if(!s){const i=Object.entries(r).map(([l,c])=>`adapter ${l} `+(c===!1?"is not supported by the environment":"is not available in the build"));let a=e?i.length>1?`since :
|
|
4
|
+
`+i.map(Tt).join(`
|
|
5
|
+
`):" "+Tt(i[0]):"as no adapter specified";throw new k("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return s},adapters:Fe};function Me(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Q(null,t)}function zt(t){return Me(t),t.headers=O.from(t.headers),t.data=Oe.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Rt.getAdapter(t.adapter||ne.adapter)(t).then(function(s){return Me(t),s.data=Oe.call(t,t.transformResponse,s),s.headers=O.from(s.headers),s},function(s){return wt(s)||(Me(t),s&&s.response&&(s.response.data=Oe.call(t,t.transformResponse,s.response),s.response.headers=O.from(s.response.headers))),Promise.reject(s)})}const Lt="1.11.0",xe={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{xe[t]=function(s){return typeof s===t||"a"+(e<1?"n ":" ")+t}});const Ot={};xe.transitional=function(e,n,s){function r(i,a){return"[Axios v"+Lt+"] Transitional option '"+i+"'"+a+(s?". "+s:"")}return(i,a,l)=>{if(e===!1)throw new k(r(a," has been removed"+(n?" in "+n:"")),k.ERR_DEPRECATED);return n&&!Ot[a]&&(Ot[a]=!0,console.warn(r(a," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(i,a,l):!0}},xe.spelling=function(e){return(n,s)=>(console.warn(`${s} is likely a misspelling of ${e}`),!0)};function Fs(t,e,n){if(typeof t!="object")throw new k("options must be an object",k.ERR_BAD_OPTION_VALUE);const s=Object.keys(t);let r=s.length;for(;r-- >0;){const i=s[r],a=e[i];if(a){const l=t[i],c=l===void 0||a(l,i,t);if(c!==!0)throw new k("option "+i+" must be "+c,k.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new k("Unknown option "+i,k.ERR_BAD_OPTION)}}const we={assertOptions:Fs,validators:xe},U=we.validators;let W=class{constructor(e){this.defaults=e||{},this.interceptors={request:new gt,response:new gt}}async request(e,n){try{return await this._request(e,n)}catch(s){if(s instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;const i=r.stack?r.stack.replace(/^.+\n/,""):"";try{s.stack?i&&!String(s.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(s.stack+=`
|
|
6
|
+
`+i):s.stack=i}catch{}}throw s}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=H(this.defaults,n);const{transitional:s,paramsSerializer:r,headers:i}=n;s!==void 0&&we.assertOptions(s,{silentJSONParsing:U.transitional(U.boolean),forcedJSONParsing:U.transitional(U.boolean),clarifyTimeoutError:U.transitional(U.boolean)},!1),r!=null&&(f.isFunction(r)?n.paramsSerializer={serialize:r}:we.assertOptions(r,{encode:U.function,serialize:U.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),we.assertOptions(n,{baseUrl:U.spelling("baseURL"),withXsrfToken:U.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&f.merge(i.common,i[n.method]);i&&f.forEach(["delete","get","head","post","put","patch","common"],u=>{delete i[u]}),n.headers=O.concat(a,i);const l=[];let c=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(n)===!1||(c=c&&b.synchronous,l.unshift(b.fulfilled,b.rejected))});const h=[];this.interceptors.response.forEach(function(b){h.push(b.fulfilled,b.rejected)});let d,p=0,m;if(!c){const u=[zt.bind(this),void 0];for(u.unshift(...l),u.push(...h),m=u.length,d=Promise.resolve(n);p<m;)d=d.then(u[p++],u[p++]);return d}m=l.length;let g=n;for(p=0;p<m;){const u=l[p++],b=l[p++];try{g=u(g)}catch(y){b.call(this,y);break}}try{d=zt.call(this,g)}catch(u){return Promise.reject(u)}for(p=0,m=h.length;p<m;)d=d.then(h[p++],h[p++]);return d}getUri(e){e=H(this.defaults,e);const n=St(e.baseURL,e.url,e.allowAbsoluteUrls);return mt(n,e.params,e.paramsSerializer)}};f.forEach(["delete","get","head","options"],function(e){W.prototype[e]=function(n,s){return this.request(H(s||{},{method:e,url:n,data:(s||{}).data}))}}),f.forEach(["post","put","patch"],function(e){function n(s){return function(i,a,l){return this.request(H(l||{},{method:e,headers:s?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))}}W.prototype[e]=n(),W.prototype[e+"Form"]=n(!0)});let Ms=class gn{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const s=this;this.promise.then(r=>{if(!s._listeners)return;let i=s._listeners.length;for(;i-- >0;)s._listeners[i](r);s._listeners=null}),this.promise.then=r=>{let i;const a=new Promise(l=>{s.subscribe(l),i=l}).then(r);return a.cancel=function(){s.unsubscribe(i)},a},e(function(i,a,l){s.reason||(s.reason=new Q(i,a,l),n(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=s=>{e.abort(s)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new gn(function(r){e=r}),cancel:e}}};function Ps(t){return function(n){return t.apply(null,n)}}function Is(t){return f.isObject(t)&&t.isAxiosError===!0}const Pe={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(Pe).forEach(([t,e])=>{Pe[e]=t});function At(t){const e=new W(t),n=et(W.prototype.request,e);return f.extend(n,W.prototype,e,{allOwnKeys:!0}),f.extend(n,e,null,{allOwnKeys:!0}),n.create=function(r){return At(H(t,r))},n}const V=At(ne);V.Axios=W,V.CanceledError=Q,V.CancelToken=Ms,V.isCancel=wt,V.VERSION=Lt,V.toFormData=fe,V.AxiosError=k,V.Cancel=V.CanceledError,V.all=function(e){return Promise.all(e)},V.spread=Ps,V.isAxiosError=Is,V.mergeConfig=H,V.AxiosHeaders=O,V.formToJSON=t=>yt(f.isHTMLForm(t)?new FormData(t):t),V.getAdapter=Rt.getAdapter,V.HttpStatusCode=Pe,V.default=V;const{Axios:Yl,AxiosError:ec,CanceledError:tc,isCancel:nc,CancelToken:sc,VERSION:rc,all:oc,Cancel:ic,isAxiosError:ac,spread:lc,toFormData:cc,AxiosHeaders:dc,HttpStatusCode:hc,formToJSON:pc,getAdapter:uc,mergeConfig:fc}=V;class js{static getTooltipOptions(e=!0){return{show:e,axisPointer:{type:"cross",label:{backgroundColor:"#6a7985"}}}}}class ke{static getLabelOptions(e={}){return{show:(e==null?void 0:e.show_label)||(e==null?void 0:e.show)||!1,fontSize:"10",position:(e==null?void 0:e.position)||"inside",formatter:(e==null?void 0:e.formatter)||"{d}%",...e}}static getLegendOpions(e={}){return{...e,position:(e==null?void 0:e.position)||"bottom"}}}const Us={show_label:!1,show_legend:!1,label:null,legend:{position:null},colors:null,color:null,title:null};function qs(){const t="0123456789ABCDEF";let e="#";for(let n=0;n<6;n+=1)e+=t[Math.floor(Math.random()*16)];return e}function Z(t=Us){var n;const e={label:{show:t==null?void 0:t.show_label,formatter:(t==null?void 0:t.formatter)||(s=>R(s)),...(t==null?void 0:t.label)||{}},legend:{...(t==null?void 0:t.legend)||{},[((n=t==null?void 0:t.legend)==null?void 0:n.position)||"bottom"]:"0",show:(t==null?void 0:t.show_legend)||!1},barWidth:"70%",grid:{borderColor:"#e5e7eb"},title:{...(t==null?void 0:t.title)||{}}};return(t!=null&&t.colors||t!=null&&t.color)&&(e.color=(t==null?void 0:t.colors)||(t==null?void 0:t.color)||null),e}function Ft(t){return{color:"#9ca3af",fontSize:10,fontFamily:"Inter, ui-sans-serif, system-ui",fontWeight:400,label:t==null?void 0:t.label,show:!0,formatter:(t==null?void 0:t.formatter)||(n=>R(n)),margin:(t==null?void 0:t.margin)||7,interval:(t==null?void 0:t.interval)||"auto",rotate:(t==null?void 0:t.rotate)||0}}const Mt=["#d3c7e6","#bedae3","#f8e9cb","#ff8c8c","#c5d8be","#ffc6c6","#ffc39a","#fff7c5","#d8ffc0","#d4f7ff"],A={props:["source","style","widget","dashboard","title","currentWidget","widgetData","prefix"],data(){return{sourceData:null,styleData:null,widgetName:"",dimensions:[],dashboardName:"",titleCharts:"",widgetInstance:null}},mounted(){window.addEventListener("resize",this.handleResize),window.addEventListener(`update-data-${this.widget}`,this.checkCustomEvent),window.addEventListener(`update-style-${this.widget}`,this.checkCustomStyleEvent)},unmounted(){window.removeEventListener(`update-data-${this.widget}`,this.checkCustomEvent),window.removeEventListener(`update-style-${this.widget}`,this.checkCustomStyleEvent)},watch:{sourceData:{async handler(){setTimeout(()=>{this==null||this.onChangedData()},0)}}},methods:{checkCustomStyleEvent(t){this.changeOptionsByName(t.chartId,t.options)},checkCustomEvent({filterUrl:t}){this.getDataFromURL(t)},handleResize(){this.widgetInstance&&this.widgetInstance.resize()},async getDataFromURL(t){var e,n,s,r;try{const i=await V.get(t);this.sourceData=((e=i.data)==null?void 0:e.source)||[],this.$emit("update:widgetData",i.data),this.dimensions=Object.keys(((n=this.sourceData)==null?void 0:n[0])||{}),this.titleCharts=this.style?this.style:((s=i.data)==null?void 0:s.title)||"",this.styleData=((r=i.data)==null?void 0:r.style)||{}}catch(i){const a={message:"Дані не знайдено",title:"Помилка!",type:"error",status:400,id:this.widgetName};(i==null?void 0:i.status)=="404"&&(a.status=404,a.message="Дані не знайдено"),(i==null?void 0:i.status)=="400"&&(a.message="Перевірте налаштування або зверніться до адміністратора"),(i==null?void 0:i.status)=="500"&&(a.message="Сталася помилка сервера"),this.$emit("update:widgetData",a)}},getValues(){return this.sourceData.map(t=>{var e;return parseFloat(t[(e=this.columns)==null?void 0:e[1]])})},formatDate(t){const e=new Date(t);if(isNaN(e))return t;const n=String(e.getDate()).padStart(2,"0"),r=["січня","лютого","березня","квітня","травня","червня","липня","серпня","вересня","жовтня","листопада","грудня"][e.getMonth()],i=e.getFullYear();return`${n} ${r} ${i}`},async getData(){var t;try{if(this.source)this.sourceData=[...this.source],this.styleData=this.style,this.titleCharts=this.title,this.dimensions=Object.keys(((t=this.sourceData)==null?void 0:t[0])||{});else{this.widgetName=this.widget,this.dashboardName=this.dashboard;const e=this.dashboardName?`${this.prefix||""}/bi-data?dashboard=${this.dashboardName}&widget=${this.widgetName}`:`${this.prefix||""}/bi-data?&widget=${this.widgetName}`;await this.getDataFromURL(e)}}catch(e){console.error(e)}},async initChart(t,e,n){var s,r,i,a,l,c,h;this.widgetInstance&&this.widgetInstance.clear();try{const d=this.$refs.chart,p=echarts==null?void 0:echarts.init(d),m={tooltip:{trigger:"axis",axisPointer:{type:"shadow"},backgroundColor:"transparent",shadowColor:"transparent",padding:[0,0,0,0],borderWidth:0,formatter:g=>{var _;const u=(_=g[0])==null?void 0:_.axisValue;let y=`
|
|
7
7
|
<div style="background-color: rgba(255, 255, 255, 0.7)" class="border border-gray-200 text-gray-800 rounded-lg shadow-md dark:bg-neutral-800 dark:border-neutral-700 min-w-28">
|
|
8
8
|
<div class="font-semibold text-sm border-b border-solid border-gray-200 text-gray-800 rounded-t-lg dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-200 px-2 py-1">
|
|
9
|
-
${
|
|
9
|
+
${u?this.formatDate(u):"N/A"}
|
|
10
10
|
</div>
|
|
11
|
-
`;return
|
|
11
|
+
`;return g.forEach(w=>{y+=`
|
|
12
12
|
<div class="flex justify-between items-center text-xs px-2 py-0.5 text-gray-500 dark:text-neutral-400">
|
|
13
13
|
<span class="flex items-center">
|
|
14
|
-
<span class="w-2.5 h-2.5 me-1.5 rounded-sm" style="background-color: ${
|
|
15
|
-
<span class="font-medium mr-[6px]">${(
|
|
14
|
+
<span class="w-2.5 h-2.5 me-1.5 rounded-sm" style="background-color: ${w.color};"></span>
|
|
15
|
+
<span class="font-medium mr-[6px]">${(w==null?void 0:w.seriesName)==="metric"?"Значення":w==null?void 0:w.seriesName}</span>
|
|
16
16
|
</span>
|
|
17
|
-
<span>${this.getMetricValue(
|
|
17
|
+
<span>${this.getMetricValue(w==null?void 0:w.data)}</span>
|
|
18
18
|
</div>
|
|
19
|
-
`}),y+="</div>",y}},xAxis:{data:e!=null&&e.length?e:null,type:e?"category":"value",name:((r=(s=this.styleData)==null?void 0:s.x_axis)==null?void 0:r.name)||"",axisLabel:{...
|
|
19
|
+
`}),y+="</div>",y}},xAxis:{data:e!=null&&e.length?e:null,type:e?"category":"value",name:((r=(s=this.styleData)==null?void 0:s.x_axis)==null?void 0:r.name)||"",axisLabel:{...Ft((i=this.styleData)==null?void 0:i.x_axis),formatter:g=>{var b,y;const u=this.formatDate(g);return((y=(b=this.styleData)==null?void 0:b.x_axis)==null?void 0:y.overflow)==="ellipsis"&&u.length>10?`${u.slice(0,10)}...`:u}}},yAxis:{data:n!=null&&n.length?n:null,type:n?"category":"value",name:((l=(a=this.styleData)==null?void 0:a.y_axis)==null?void 0:l.name)||"",axisLabel:Ft((c=this.styleData)==null?void 0:c.y_axis)},series:t!=null&&t.length?t:null,...Z(this.styleData),grid:{bottom:"0%",right:"0%",left:"0%",top:"20px",containLabel:!0,...((h=this.styleData)==null?void 0:h.grid)||{}}};await p.setOption(m),p.resize(),this.widgetInstance=p,this.$emit("update:currentWidget",p)}catch(d){console.error(d)}},async setSeriesOption(t,e){const n=t.getOption(),{series:s=[]}=n,r=s.map(i=>({...i,...e}));t.setOption({...n,series:r})},async changeOptionsByName(t,e){const n=document.getElementById(t);if(!n)return null;const s=echarts.getInstanceByDom(n);if(!s)return null;const r=s.getOption();e.seriesOptions&&this.setSeriesOption(s,e.seriesOptions),s.setOption({...r,...e.options,tooltip:{...js.getTooltipOptions(e.options.tooltip.show)}})},async changeData(t){var e;try{let n=this.dashboard?`${this.prefix||""}/bi-data?dashboard=${this.dashboard}&widget=${this.widget}`:`${this.prefix||""}/bi-data?&widget=${this.widget}`;(e=t==null?void 0:t.granularity)!=null&&e.length&&(n+=`&granularity=${t.granularity}`),t!=null&&t.metrics&&(n+=`&metrics=${t.metrics}`),this.getDataFromURL(n)}catch(n){console.error(n)}},async setFilter(t){const e=`${this.prefix||""}/bi-data?dashboard=${this.dashboardName}&widget=${this.widgetName}${t||""}`;await this.getDataFromURL(e)},async changeStyle(t,e){this.styleData[t]=e,this.onChangedData()},getMetricValue(t){var s;const e=(t==null?void 0:t.metric)||t;return parseFloat(e)?(s=R(e,{notation:"standard"}))==null?void 0:s.replaceAll(","," "):e}}},Hs={name:"VsBar",mixins:[A],data(){return{resizeObserver:null}},computed:{uniqueID(){return this.widget}},async mounted(){var e;this.getData(),this.onChangedData();const t=(e=this.$refs)==null?void 0:e.chart;t&&(this.resizeObserver=new ResizeObserver(()=>{var n;this.widgetInstance&&((n=this.widgetInstance)==null||n.resize())}),this.resizeObserver.observe(t))},unmounted(){this.resizeObserver.disconnect()},methods:{async onChangedData(){try{if(this.sourceData){await this.$nextTick();const{series:t,xs:e,ys:n}=this.prepareData();t&&(this==null||this.initChart(t,e,n))}}catch(t){console.error(t)}},prepareData(){var t,e,n,s,r,i;try{if(!((t=this.sourceData)!=null&&t.length))return{series:[],xs:[],ys:void 0};const a=Array.from(new Set(this.sourceData.filter(m=>m[this.dimensions[0]]).map(m=>m[this.dimensions[0]])));let l;this.dimensions[0].includes("date")?l=a.map(m=>v(m)):l=[...a];let c,h;((e=this.styleData)==null?void 0:e.horizontal)===!0?h=[...l]:c=[...l];const d=this.sourceData.filter(m=>parseFloat(m[this.dimensions[1]])&&m[this.dimensions[0]]).map(m=>parseFloat(m[this.dimensions[1]]));let p;return((n=this.styleData)==null?void 0:n.stack)!==!1?p=this.prepareStackData():((s=this.styleData)==null?void 0:s.negative_waterfall)===!0?p=this.prepareNegativeWaterfall():((r=this.styleData)==null?void 0:r.waterfall)===!0?p=this.prepareWaterfallData(d):((i=this.styleData)==null?void 0:i.accumulative)===!0?p=this.prepareAccumulative(d):p=this.dimensions.slice(1).map((g,u)=>({name:g,type:"bar",stack:`a${u}`,data:this.sourceData.filter(b=>parseFloat(b[g])&&g).map(b=>parseFloat(b[g]))})),{series:p,xs:c,ys:h}}catch(a){return console.error(a),{series:[],xs:[],ys:[]}}},prepareWaterfallData(t){let e=t.reduce((i,a)=>i+a,0);const n=[e,...t],s=n.map((i,a)=>{if(a===0)return 0;const l=e-i;return e-=i,l>=0?l:0});return[{type:"bar",stack:"Total",itemStyle:{borderColor:"transparent",color:"transparent"},data:s,tooltip:{show:!1}},{name:this.title?this.title:this.dimensions[0],type:"bar",stack:"Total",data:n}]},prepareStackData(){return this.dimensions.slice(1).map(n=>({name:n,type:"bar",stack:"a",data:this.sourceData.filter(s=>parseFloat(s[n])&&n).map(s=>parseFloat(s[n]))}))},prepareNegativeWaterfall(){const t=this.sourceData.map(i=>Number.isNaN(i[this.dimensions[1]])?0:Number(i[this.dimensions[1]])),e=this.sourceData.map(i=>Number.isNaN(i[this.dimensions[2]])?0:Number(i[this.dimensions[2]]));let n=0;const s=t.map((i,a)=>{const l=n;return n+=Number.isNaN(i)?0:i,a===0&&(n-=Number.isNaN(e[a])?0:e[a]),n-=Number.isNaN(e[a+1])?0:e[a+1],l>=0?l:0});return[{type:"bar",stack:"a",itemStyle:{borderColor:"transparent",color:"transparent"},data:s,tooltip:{show:!1}},{name:this.dimensions[1],type:"bar",stack:"a",data:t},{name:this.dimensions[2],type:"bar",stack:"a",data:e}]},prepareAccumulative(t){let e=0;const n=t.map(r=>(e+=r,e));return[{name:this.titleCharts,type:"bar",stack:"Total",data:n}]}}},E=(t,e)=>{const n=t.__vccOpts||t;for(const[s,r]of e)n[s]=r;return n},Ws=["id"];function Zs(t,e,n,s,r,i){return o.openBlock(),o.createElementBlock("div",{id:i.uniqueID,ref:"chart",class:"h-full w-full min-h-[200px]"},null,8,Ws)}const Ie=E(Hs,[["render",Zs]]),Js=Object.freeze(Object.defineProperty({__proto__:null,default:Ie},Symbol.toStringTag,{value:"Module"})),Gs={name:"VsPie",props:["currentWidget"],mixins:[A],data(){return{chartInstance:null,resizeObserver:null}},computed:{uniqueID(){return this.widget}},async mounted(){var n;await this.$nextTick(),await this.getData();const{series:t}=this.prepareData()||{};t&&this.initChart(t);const e=(n=this.$refs)==null?void 0:n.chart;e&&(this.resizeObserver=new ResizeObserver(()=>{this.chartInstance&&this.chartInstance.resize()}),this.resizeObserver.observe(e))},beforeUnmount(){var t;(t=this.resizeObserver)==null||t.disconnect()},methods:{onChangedData(){try{if(this.sourceData){const{series:t,xs:e,ys:n}=this.prepareData();t&&this.initChart(t,e,n)}}catch(t){console.error(t)}},buildTooltipForDonut(t,e){const{name:n,value:s,percent:r}=t;return`
|
|
20
20
|
<div style="background-color:${e[0]}; font-size:12px; font-family:Helvetica, Arial, sans-serif; color:#ffff; padding:5px; border-radius:5px;">
|
|
21
21
|
${n==null?void 0:n.replace("null","Не визначено")}: ${R(s)} (${r}%)
|
|
22
|
-
</div>`},prepareData(){var t,e,n,s,r,i;try{if(this.styleData=this.styleData||{},!((t=this.sourceData)!=null&&t.length))return console.warn("No source data available"),null;const a=Array.from(new Set((this.sourceData||[]).map(
|
|
22
|
+
</div>`},prepareData(){var t,e,n,s,r,i;try{if(this.styleData=this.styleData||{},!((t=this.sourceData)!=null&&t.length))return console.warn("No source data available"),null;const a=Array.from(new Set((this.sourceData||[]).map(u=>u[this.dimensions[0]]))),l=Array.from(new Set((this.sourceData||[]).map(u=>u[this.dimensions[1]]))),c=parseInt((this.sourceData||[]).reduce((u,b)=>u+parseFloat((b==null?void 0:b.metric)||0),0),10),h=a.map((u,b)=>{const y=(l[b]/c*100).toFixed(2);return{name:`${u} (${y}%)`,value:l[b]}}),d=((e=this.styleData)==null?void 0:e.innerRadius)||"80%",p=((n=this.styleData)==null?void 0:n.outerRadius)||"100%",m=[d,p];return this.styleData.legend=ke.getLegendOpions({borderRadius:10,height:"100%",padding:10,bottom:"0",type:"scroll",itemWidth:14,itemHeight:14,formatter:u=>{var b;return(b=u==null?void 0:u.replace("null","Не визначено"))==null?void 0:b.replace("NaN","0.00")},...((s=this.styleData)==null?void 0:s.legend)||{}}),this.styleData.label=ke.getLabelOptions((r=this.styleData)==null?void 0:r.label),this.styleData.show_legend=((i=this.styleData)==null?void 0:i.show_legend)??!0,{series:[{name:this.titleCharts?this.titleCharts:this.dimensions[0],type:"pie",radius:m,center:["50%","60%"],height:"75%",...Z(this.styleData),data:h}]}}catch(a){return console.error("Error in prepareData:",a),null}},async initChart(t){try{if(!t){console.warn("No series data available for chart initialization");return}const e=this.$refs.chart;if(!e){console.warn("Chart DOM element not found");return}this.chartInstance=echarts.init(e);const n=parseInt((this.sourceData||[]).reduce((r,i)=>r+parseFloat((i==null?void 0:i.metric)||0),0),10),s={tooltip:{trigger:"item",formatter:r=>this.buildTooltipForDonut(r,[r.color]),borderWidth:0,appendToBody:!0,borderColor:"transparent",textStyle:{color:"#000"},padding:[15,15],shadowColor:"transparent",backgroundColor:"transparent"},series:t,...Z(this.styleData||{}),title:{text:R(n),left:"center",top:"41%",textStyle:{color:"black",fontWeight:400,fontSize:"22px"}}};this.chartInstance.setOption(s),this.$emit("update:currentWidget",this.chartInstance),this.chartInstance.resize(),window.addEventListener("resize",()=>{var r;(r=this.chartInstance)==null||r.resize()})}catch(e){console.error("Error in initChart:",e)}}}},Ks=["id"];function Qs(t,e,n,s,r,i){return o.openBlock(),o.createElementBlock("div",{id:i.uniqueID,ref:"chart",class:"h-full min-h-[200px] flex items-center"},null,8,Ks)}const Pt=E(Gs,[["render",Qs]]),vs=Object.freeze(Object.defineProperty({__proto__:null,default:Pt},Symbol.toStringTag,{value:"Module"})),Xs={name:"VsPie",props:["currentWidget"],mixins:[A],data(){return{chartInstance:null,resizeObserver:null}},computed:{uniqueID(){return this.widget}},async mounted(){var n;await this.$nextTick(),await this.getData();const{series:t}=this.prepareData()||{};t&&this.initChart(t);const e=(n=this.$refs)==null?void 0:n.chart;e&&(this.resizeObserver=new ResizeObserver(()=>{this.chartInstance&&this.chartInstance.resize()}),this.resizeObserver.observe(e))},unmounted(){var t;(t=this.resizeObserver)==null||t.disconnect()},methods:{onChangedData(){try{if(this.sourceData){const{series:t,xs:e,ys:n}=this.prepareData();t&&this.initChart(t,e,n)}}catch(t){console.error(t)}},buildTooltipForDonut(t,e){const{name:n,value:s,percent:r}=t;return`
|
|
23
23
|
<div style="background-color:${e[0]}; font-size:12px; font-family:Helvetica, Arial, sans-serif; color:#ffff; padding:5px; border-radius:5px;">
|
|
24
24
|
${n==null?void 0:n.replace("null","Не визначено")}: ${R(s)} (${r}%)
|
|
25
|
-
</div>`},prepareData(){var t,e,n,s,r;try{this.styleData=this.styleData||{};const i=Array.from(new Set((this.sourceData||[]).map(b=>b[this.dimensions[0]]))),a=Array.from(new Set((this.sourceData||[]).map(b=>b[this.dimensions[1]]))),l=parseInt((this.sourceData||[]).reduce((b,p)=>b+parseFloat(p==null?void 0:p.metric),0),10),c=i.map((b,p)=>{const g=(a[p]/l*100).toFixed(2);return{name:`${b} (${g}%)`,value:a[p]}}),h=((t=this.styleData)==null?void 0:t.innerRadius)||"0%",d=((e=this.styleData)==null?void 0:e.outerRadius)||"100%",u=[h,d];return this.styleData.legend=Ce.getLegendOpions({borderRadius:10,height:"100%",padding:10,type:"scroll",itemWidth:14,itemHeight:14,formatter:b=>b==null?void 0:b.replace("null","Не визначено"),textStyle:{fontSize:"14px"},...((n=this.styleData)==null?void 0:n.legend)||{}}),this.styleData.label=Ce.getLabelOptions((s=this.styleData)==null?void 0:s.label),this.styleData.show_legend=((r=this.styleData)==null?void 0:r.show_legend)??!0,{series:[{name:this.titleCharts?this.titleCharts:this.dimensions[0],type:"pie",radius:u,center:["50%","60%"],height:"75%",...K(this.styleData),data:c}]}}catch(i){return console.error("Error in prepareData:",i),null}},async initChart(t){try{if(!t){console.warn("No series data available for chart initialization");return}const e=this.$refs.chart;if(!e){console.warn("Chart DOM element not found");return}this.chartInstance=echarts.init(e);const n={tooltip:{trigger:"item",formatter:s=>this.buildTooltipForDonut(s,[s.color]),borderWidth:0,appendToBody:!0,borderColor:"transparent",textStyle:{color:"#000"},padding:[15,15],shadowColor:"transparent",backgroundColor:"transparent"},series:t,...K(this.styleData||{})};this.chartInstance.setOption(n),this.$emit("update:currentWidget",this.chartInstance),this.chartInstance.resize(),window.addEventListener("resize",()=>{var s;(s=this.chartInstance)==null||s.resize()})}catch(e){console.error("Error in initChart:",e)}}}},ur=["id"];function fr(t,e,n,s,r,i){return o.openBlock(),o.createElementBlock("div",{id:i.uniqueID,ref:"chart",class:"h-full min-h-[200px] flex items-center"},null,8,ur)}const Qt=_(pr,[["render",fr]]),mr=Object.freeze(Object.defineProperty({__proto__:null,default:Qt},Symbol.toStringTag,{value:"Module"})),gr={name:"VsLine",mixins:[F],data(){return{chartInstance:null,uniqueID:null}},async mounted(){this.uniqueID=this.widget,await this.$nextTick(),await this.getData();const{series:t,xs:e}=this.prepareData();t&&this.initChart(t,e)},methods:{onChangedData(){try{if(this.sourceData){const{series:t,xs:e,ys:n}=this.prepareData();t&&(this==null||this.initChart(t,e,n))}}catch(t){console.error(t)}},prepareData(){var t,e;try{const n=Array.from(new Set(this.sourceData.map(a=>a[this.dimensions[0]])));let s;this.dimensions[0].includes("date")?s=n.map(a=>se(a)):s=[...n];const r=this.sourceData.map(a=>parseFloat(a[this.dimensions[1]]));let i;return(t=this.styleData)!=null&&t.stack?i=this.dimensions.slice(1).map(l=>({name:l,type:"line",stack:"a",areaStyle:this.styleData.area?{}:null,data:this.sourceData.filter(c=>parseFloat(c[l])).map(c=>parseFloat(c[l]))})):i=[{name:this.title,type:"line",areaStyle:(e=this.styleData)!=null&&e.area?{}:null,data:r,stack:"a"}],{series:i,xs:s}}catch(n){return console.error(n),null}}}},br=["id"];function yr(t,e,n,s,r,i){return o.openBlock(),o.createElementBlock("div",{id:r.uniqueID,ref:"chart",style:{height:"400px"}},null,8,br)}const vt=_(gr,[["render",yr]]),xr=Object.freeze(Object.defineProperty({__proto__:null,default:vt},Symbol.toStringTag,{value:"Module"})),wr={name:"VsStat",mixins:[F],data(){return{restDimensions:[],sumValue:0,columns:null,showTooltip:-1}},async mounted(){await this.getData(),this.prepareData()},methods:{onChangedData(){try{this.sourceData&&this.prepareData()}catch{}},prepareData(){this.columns=Object.keys(this.sourceData[0]);const t=this.getValues();this.sumValue=t.reduce((e,n)=>e+n,0),this.sourceData.forEach((e,n)=>{e.color=n<Gt.length-1?Gt[n]:sr()})},formattedValue(t){const e=parseFloat(t);return R(e)}}},kr={class:"flex flex-col w-full h-full pt-[16px] rounded-xl"},_r={class:"flex flex-col justify-between w-full h-full"},Er={class:"w-full h-full pb-6 space-y-4"},Sr={class:"flex w-full h-3 rounded-full gap-x-1 min-h-3 custom-x-scrollbar"},$r=["onMouseover"],Cr={key:0,class:"absolute top-[-1] left-1/2 transform -translate-x-1/2 -translate-y-full bg-black text-white rounded px-2 py-1"},Br={class:"h-[calc(100%-20px)] w-full custom-scrollbar"},Dr={class:"grid items-center justify-between grid-cols-2 py-2 gap-x-4"},Nr={class:"flex items-center"},Vr={class:"text-sm text-gray-800"},Tr={class:"text-end"},zr={class:"text-sm text-gray-500"};function Rr(t,e,n,s,r,i){return o.openBlock(),o.createElementBlock("div",kr,[o.createElementVNode("div",_r,[o.createElementVNode("div",Er,[o.createElementVNode("div",Sr,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.sourceData,(a,l)=>{var c,h,d,u;return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["flex flex-col min-w-[5px] justify-center min-h-2.5 h-2.5 text-xs text-white text-center whitespace-nowrap",`bg-[${a.color}]`]),style:o.normalizeStyle({width:`${parseFloat(a==null?void 0:a[(c=r.columns)==null?void 0:c[1]])/r.sumValue*100}%`}),role:"progressbar","aria-valuenow":"42","aria-valuemin":"0","aria-valuemax":"100",onMouseover:m=>r.showTooltip=l,onMouseleave:e[0]||(e[0]=m=>r.showTooltip=-1)},[r.showTooltip>-1?(o.openBlock(),o.createElementBlock("div",Cr,o.toDisplayString(t.sourceData[r.showTooltip][r.columns[0]])+" "+o.toDisplayString((parseFloat((u=(h=t.sourceData)==null?void 0:h[r.showTooltip])==null?void 0:u[(d=r.columns)==null?void 0:d[1]])/r.sumValue*100).toFixed(2))+"% ",1)):o.createCommentVNode("",!0)],46,$r)}),256))]),o.createElementVNode("ul",Br,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.sourceData,a=>{var l,c;return o.openBlock(),o.createElementBlock("li",Dr,[o.createElementVNode("div",Nr,[o.createElementVNode("span",{class:o.normalizeClass(["shrink-0 size-2.5 inline-block rounded-sm me-2.5 min-w-[10px] w-[10px] h-[10px] min-h-[10px]",`bg-[${a.color}]`])},null,2),o.createElementVNode("span",Vr,o.toDisplayString((a==null?void 0:a[(l=r.columns)==null?void 0:l[0]])||"Не визначено"),1)]),o.createElementVNode("div",Tr,[o.createElementVNode("span",zr,o.toDisplayString(i.formattedValue(a==null?void 0:a[(c=r.columns)==null?void 0:c[1]])||"-"),1)])])}),256))])])])])}const Xt=_(wr,[["render",Rr]]),Lr=Object.freeze(Object.defineProperty({__proto__:null,default:Xt},Symbol.toStringTag,{value:"Module"})),Or={name:"VsProgressBar",mixins:[F],data(){return{restDimensions:[],maxValue:0,columns:null}},async mounted(){await this.getData(),this.prepareData()},methods:{onChangedData(){try{this.sourceData&&this.prepareData()}catch{}},prepareData(){var e;this.columns=Object.keys((e=this.sourceData)==null?void 0:e[0])||null;const t=this.getValues();this.maxValue=Math.max(...t)},formattedValue(t){return R(t)}}},Ar={key:0,class:"flex flex-col h-full pt-[16px] rounded-xl"},Fr={class:"h-full pt-0 pb-6 space-y-4"},Mr={class:"h-full space-y-4 custom-scrollbar"},Pr={class:"flex items-center justify-between mr-2 gap-x-2"},Ir={class:"grid items-center w-full grid-cols-2 gap-x-2"},jr={class:"text-sm text-gray-800"},Ur={class:"flex justify-end",role:"progressbar","aria-valuenow":"100","aria-valuemin":"0","aria-valuemax":"100"},qr={class:"min-w-[60px] text-end"},Hr={class:"text-sm text-gray-500"};function Wr(t,e,n,s,r,i){return r.columns?(o.openBlock(),o.createElementBlock("div",Ar,[o.createElementVNode("div",Fr,[o.createElementVNode("ul",Mr,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.sourceData,(a,l)=>(o.openBlock(),o.createElementBlock("li",Pr,[o.createElementVNode("div",Ir,[o.createElementVNode("span",jr,o.toDisplayString(a[r.columns[0]]),1),o.createElementVNode("div",Ur,[o.createElementVNode("div",{class:"h-1.5 flex flex-col justify-center overflow-hidden bg-indigo-500 rounded-full text-xs text-white text-center whitespace-nowrap",style:o.normalizeStyle({width:`${parseFloat(a[r.columns[1]])/r.maxValue*100}%`})},null,4)])]),o.createElementVNode("div",qr,[o.createElementVNode("span",Hr,o.toDisplayString(i.formattedValue(a[r.columns[1]])),1)])]))),256))])])])):o.createCommentVNode("",!0)}const Yt=_(Or,[["render",Wr]]),Zr=Object.freeze(Object.defineProperty({__proto__:null,default:Yt},Symbol.toStringTag,{value:"Module"})),Jr={name:"VsListbar",mixins:[F],props:["source"],data(){return{restDimensions:[],maxValue:0,columns:null}},async mounted(){await this.getData(),this.prepareData()},methods:{onChangedData(){try{this.sourceData&&this.prepareData()}catch(t){console.error(t)}},prepareData(){var e,n,s;this.columns=Object.keys(((e=this.sourceData)==null?void 0:e[0])||{});const t=(n=this.sourceData)==null?void 0:n.map(r=>{var i;return r==null?void 0:r[(i=this.columns)==null?void 0:i[1]]});this.maxValue=Math.max(...t||[]),this.restDimensions=(s=this.columns)==null?void 0:s.filter((r,i)=>i!==0)},formattedValue(t){return R(t)},getWidth(t){return`${t/this.maxValue*100}%`}}},Gr={class:"h-full pt-[20px] list-bar"},Kr={class:"space-y-2 custom-scrollbar h-full h-[calc(100%-20px)]"},Qr={class:"relative w-full truncate"},vr={class:"relative z-[1] text-sm block py-1 px-2 w-full text-sm truncate text-gray-800"},Xr={class:"text-[14px] text-gray-500"};function Yr(t,e,n,s,r,i){return o.openBlock(),o.createElementBlock("div",Gr,[o.createElementVNode("ul",Kr,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.sourceData,(a,l)=>{var c,h,d;return o.openBlock(),o.createElementBlock("li",{key:l,class:"flex items-center justify-between w-full gap-x-2"},[o.createElementVNode("div",Qr,[o.createElementVNode("span",vr,o.toDisplayString((a==null?void 0:a[(c=r.columns)==null?void 0:c[0]])||"Без категорії"),1),o.createElementVNode("div",{class:o.normalizeClass(["absolute inset-y-0 h-full rounded start-0",a!=null&&a[(h=r.columns)==null?void 0:h[0]]?"bg-indigo-100":"bg-gray-100"]),style:o.normalizeStyle({width:i.getWidth(a==null?void 0:a[(d=r.columns)==null?void 0:d[1]])})},null,6)]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.restDimensions,(u,m)=>(o.openBlock(),o.createElementBlock("div",{key:m,class:"w-20 mr-2 text-end"},[o.createElementVNode("span",Xr,o.toDisplayString(i.formattedValue(a==null?void 0:a[u])),1)]))),128))])}),128))])])}const en=_(Jr,[["render",Yr]]),eo=Object.freeze(Object.defineProperty({__proto__:null,default:en},Symbol.toStringTag,{value:"Module"})),Je={week:"Тиждень",month:"Місяць",quarter:"Квартал",year:"Рік"},to=["onClick"],no={class:"flex items-center justify-between w-full"},so={key:0},ro={__name:"vs-bi-dropdown",props:{title:String,options:[Array,String],value:{type:String}},emits:["selected"],setup(t,{emit:e}){const n=t,s=e,r=o.ref(!1),i=o.ref(n.value||null),a=o.ref(null),l=o.computed(()=>typeof n.options=="string"?n.options.split(",").map((b,p)=>({id:p,text:b.trim()})):n.options),c=o.computed(()=>{const b=l.value.find(p=>(p.id||p)===i.value);return b?b.text||b:n.title}),h=b=>{i.value=b.id||b,r.value=!1,s("selected",(b==null?void 0:b.id)||b),document.removeEventListener("click",d)},d=b=>{a.value&&!a.value.contains(b.target)&&(r.value=!1,document.removeEventListener("click",d))},u=()=>{r.value=!r.value,r.value?setTimeout(()=>{document.addEventListener("click",d)},200):document.removeEventListener("click",d)},m=b=>(Je==null?void 0:Je[b])||b;return o.onUnmounted(()=>{document.removeEventListener("click",d)}),(b,p)=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createElementVNode("button",{type:"button","aria-expanded":"true",class:"hs-select-disabled:pointer-events-none hs-select-disabled:opacity-50 relative group pr-2 -ms-2 py-1.5 pl-2.5 inline-flex shrink-0 justify-center items-center gap-x-1.5 text-sm text-gray-800 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100 before:absolute before:inset-0 before:z-[1] dark:text-neutral-400 dark:hover:bg-neutral-800 dark:focus:bg-neutral-700",onClick:u},[o.createTextVNode(o.toDisplayString(m(c.value))+" ",1),p[0]||(p[0]=o.createElementVNode("svg",{class:"shrink-0 size-3.5 text-gray-600 dark:text-neutral-400",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[o.createElementVNode("path",{d:"m6 9 6 6 6-6"})],-1))]),r.value?(o.openBlock(),o.createElementBlock("div",{key:0,ref_key:"biDropdown",ref:a,"data-hs-select-dropdown":"",class:"absolute mt-2 z-50 w-48 p-1 space-y-0.5 bg-white rounded-xl shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] dark:bg-neutral-950 opened",role:"listbox",tabindex:"-1","aria-orientation":"vertical",style:{"margin-top":"10px"}},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(l.value,g=>(o.openBlock(),o.createElementBlock("div",{key:g.id||g,class:"cursor-pointer selected hs-selected:bg-gray-100 dark:hs-selected:bg-neutral-800 py-1.5 px-2 w-full text-[13px] text-gray-800 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:y=>h(g)},[o.createElementVNode("div",no,[o.createElementVNode("span",null,o.toDisplayString(m(g.text||g)),1),i.value===(g.id||g)?(o.openBlock(),o.createElementBlock("span",so,[...p[1]||(p[1]=[o.createElementVNode("svg",{class:"shrink-0 h-3.5 w-3.5 text-gray-800 dark:text-neutral-200",xmlns:"http:.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[o.createElementVNode("polyline",{points:"20 6 9 17 4 12"})],-1)])])):o.createCommentVNode("",!0)])],8,to))),128))],512)):o.createCommentVNode("",!0)],64))}},oo={"bi-bar":o.defineAsyncComponent(()=>Promise.resolve().then(()=>ar)),"bi-number":o.defineAsyncComponent(()=>Promise.resolve().then(()=>wi)),"bi-text":o.defineAsyncComponent(()=>Promise.resolve().then(()=>sa)),"bi-listbar":o.defineAsyncComponent(()=>Promise.resolve().then(()=>eo)),"bi-pie":o.defineAsyncComponent(()=>Promise.resolve().then(()=>mr)),"bi-donut":o.defineAsyncComponent(()=>Promise.resolve().then(()=>hr)),"bi-line":o.defineAsyncComponent(()=>Promise.resolve().then(()=>xr)),"bi-stat":o.defineAsyncComponent(()=>Promise.resolve().then(()=>Lr)),"bi-pivot":o.defineAsyncComponent(()=>Promise.resolve().then(()=>gi)),"bi-progress":o.defineAsyncComponent(()=>Promise.resolve().then(()=>Zr)),"bi-funnel":o.defineAsyncComponent(()=>Promise.resolve().then(()=>aa)),"bi-map":o.defineAsyncComponent(()=>Promise.resolve().then(()=>ul)),"bi-cluster":o.defineAsyncComponent(()=>Promise.resolve().then(()=>Hl)),"bi-table":o.defineAsyncComponent(()=>Promise.resolve().then(()=>sc))},io={class:"flex items-center space-x-2"},ao=o.defineComponent({__name:"vs-bi-switch",props:o.mergeModels({leftLabel:{},rightLabel:{},modelValue:{type:Boolean}},{modelValue:{default:()=>!1,type:Boolean},modelModifiers:{}}),emits:o.mergeModels(["update:is-enabled"],["update:modelValue"]),setup(t,{emit:e}){const n=e,s=o.useModel(t,"modelValue"),r=()=>{n("update:is-enabled",s)};return(i,a)=>(o.openBlock(),o.createElementBlock("div",io,[t.leftLabel?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["transition-colors",{"text-blue-500":!s.value}])},o.toDisplayString(t.leftLabel),3)):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":a[0]||(a[0]=l=>s.value=l),type:"checkbox",class:"relative w-11 h-6 p-px bg-gray-100 border-transparent text-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:ring-blue-600 disabled:opacity-50 disabled:pointer-events-none checked:bg-none checked:text-blue-600 checked:border-blue-600 focus:checked:border-blue-600 dark:bg-neutral-800 dark:border-neutral-700 dark:checked:bg-blue-500 dark:checked:border-blue-500 dark:focus:ring-offset-gray-600 before:inline-block before:size-5 before:bg-white checked:before:bg-blue-200 before:translate-x-0 checked:before:translate-x-full before:rounded-full before:shadow before:h-5 before:w-5 before:transform before:ring-0 before:transition before:ease-in-out before:duration-200 dark:before:bg-neutral-400 dark:checked:before:bg-blue-200",onChange:r},null,544),[[o.vModelCheckbox,s.value]]),t.rightLabel?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(["transition-colors",{"text-blue-500":s.value}])},o.toDisplayString(t.rightLabel),3)):o.createCommentVNode("",!0)]))}}),lo={},co={class:"flex items-center justify-center h-full"};function ho(t,e){return o.openBlock(),o.createElementBlock("div",co,[...e[0]||(e[0]=[o.createElementVNode("div",{class:"text-center text-gray-500"},[o.createElementVNode("h2",{class:"text-2xl font-bold"},"No data available")],-1)])])}const po=_(lo,[["render",ho]]),uo={},fo={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-download"};function mo(t,e,n,s,r,i){return o.openBlock(),o.createElementBlock("svg",fo,[...e[0]||(e[0]=[o.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),o.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),o.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),o.createElementVNode("path",{d:"M12 4l0 12"},null,-1)])])}const go={components:{VsBiDropdown:ro,VsBiSwitch:ao,VsNoDataChart:po,IconDownload:_(uo,[["render",mo]]),...oo},props:{dashboard:{type:String},prefix:{type:String,default:""},widget:{type:String},filterURl:{type:String},dashboardWidgets:{type:Object},selectedWidget:{type:String}},data(){return{checked:[],selected:[],currentWidget:null,widgetData:[]}},computed:{computedTitle(){var e,n;const t=(e=this.dashboardWidgets)==null?void 0:e.find(s=>s.name===this.widget);return((n=t==null?void 0:t.data)==null?void 0:n.title)||(t==null?void 0:t.title)||""},computedType(){var e;const t=(e=this.dashboardWidgets)==null?void 0:e.find(n=>n.name===this.widget);return(t==null?void 0:t.type)||"text"},controls(){var e;return Object.keys(((e=this.widgetData)==null?void 0:e.controls)||{}).map(n=>{var s,r,i;return{name:n,options:typeof((s=this.widgetData)==null?void 0:s.controls)=="boolean"?!1:(i=(r=this.widgetData)==null?void 0:r.controls)==null?void 0:i[n]}})}},mounted(){this.prefix&&(V.defaults.baseURL=this.prefix)},watch:{filterURl(t){var e,n;(n=(e=this.$refs)==null?void 0:e.chart)==null||n.setFilter(t)},selectedWidget(t,e){var n;t!==e&&t===((n=this.widgetData)==null?void 0:n.id)&&this.$emit("update:current-widget-data",this.widgetData)},widgetData(t,e){if((t==null?void 0:t.id)===(e==null?void 0:e.id))return;const s=new URLSearchParams(window.top.location.search).get("widget");s&&s===(t==null?void 0:t.id)&&this.$emit("update:current-widget-data",t)}},methods:{changeStyleHandler(t,e){var n;(n=this.$refs.chart)==null||n.changeStyle(t,e)},selectedOptionHandler(t,e){let n=!0;this.selected.forEach(s=>{s.name===e&&(s.option=t,n=!1)}),n&&this.selected.push({name:e,option:t}),this.makeUpUrl()},makeUpUrl(){var e;let t=`/bi-data?dashboard=${this.dashboard}&widget=${this.widget}`;this.selected.forEach((n,s)=>{t+=`&${n.name}=${n.option}`}),(e=this.$refs.chart)==null||e.getDataFromURL(t)},exportChart(){if(this.currentWidget){const t=this.currentWidget.getDataURL({type:"png",pixelRatio:2,backgroundColor:"#ffffff"}),e=document.createElement("a");e.href=t,e.download="chart.png",document.body.appendChild(e),e.click(),document.body.removeChild(e)}}}},bo={key:0,class:"text-[16px] flex max-w-full items-center min-h-0 flex justify-between max-h-[50px] h-fit shrink-0"},yo={class:"flex items-center justify-between w-full"},xo={class:"grid"},wo={class:"text-gray-800 max-h-[30px] inline-block text-nowrap font-semibold"},ko={class:"flex flex-col justify-end"},_o={key:0,class:"flex items-center justify-end w-full gap-2"},Eo={class:"w-full h-full"};function So(t,e,n,s,r,i){var d,u,m,b,p,g,y,k,E;const a=o.resolveComponent("VsBiDropdown"),l=o.resolveComponent("VsBiSwitch"),c=o.resolveComponent("IconDownload"),h=o.resolveComponent("VsNoDataChart");return o.openBlock(),o.createElementBlock("div",{ref:"widget",class:o.normalizeClass(["box-border relative h-full p-4 bg-white border border-gray-200 select-auto rounded-xl",[(u=(d=r.widgetData)==null?void 0:d.style)!=null&&u.height?`max-h-[${(b=(m=r.widgetData)==null?void 0:m.style)==null?void 0:b.height}px] h-[${(g=(p=r.widgetData)==null?void 0:p.style)==null?void 0:g.height}px]`:"max-h-[460px]"]])},[["text","cluster","map"].includes(i.computedType)?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",bo,[o.createElementVNode("div",yo,[o.createElementVNode("div",xo,[o.createElementVNode("span",wo,o.toDisplayString(i.computedTitle),1)]),o.createElementVNode("div",ko,[(y=i.controls)!=null&&y.length?(o.openBlock(),o.createElementBlock("span",_o,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList((k=i.controls)==null?void 0:k.filter(x=>(x==null?void 0:x.options)&&(x==null?void 0:x.name)!=="export"),x=>{var S;return o.openBlock(),o.createElementBlock("div",null,[Array.isArray(x==null?void 0:x.options)?(o.openBlock(),o.createBlock(a,{key:0,title:x==null?void 0:x.name,options:x==null?void 0:x.options,value:(S=r.widgetData)==null?void 0:S.data[x==null?void 0:x.name],onSelected:D=>i.selectedOptionHandler(D,x==null?void 0:x.name)},null,8,["title","options","value","onSelected"])):typeof x.options=="boolean"?(o.openBlock(),o.createBlock(l,{key:1,"left-label":x==null?void 0:x.name,"is-enabled":x==null?void 0:x.options,"onUpdate:isEnabled":D=>i.changeStyleHandler(x==null?void 0:x.name,D)},null,8,["left-label","is-enabled","onUpdate:isEnabled"])):o.createCommentVNode("",!0)])}),256)),(E=i.controls)!=null&&E.some(x=>(x==null?void 0:x.name)==="export")?(o.openBlock(),o.createElementBlock("button",{key:0,onClick:e[0]||(e[0]=(...x)=>i.exportChart&&i.exportChart(...x)),class:"h-[32px] w-[32px] rounded-lg hover:bg-gray-100 duration-100 flex items-center justify-center"},[o.createVNode(c,{height:"16",width:"16",class:"text-gray-800"})])):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0)])])])),o.createElementVNode("div",Eo,[r.widgetData?(o.openBlock(),o.createBlock(o.resolveDynamicComponent("bi-"+i.computedType),{key:0,currentWidget:r.currentWidget,"onUpdate:currentWidget":e[1]||(e[1]=x=>r.currentWidget=x),widgetData:r.widgetData,"onUpdate:widgetData":e[2]||(e[2]=x=>r.widgetData=x),ref:"chart",dashboard:n.dashboard,title:i.computedTitle,widget:n.widget},null,40,["currentWidget","widgetData","dashboard","title","widget"])):(o.openBlock(),o.createBlock(h,{key:1,class:"w-full h-full"}))])],2)}const tn=_(go,[["render",So]]),$o={props:{title:{type:String,default:()=>"Дані для відображення відсутні"},text:{type:String,default:()=>"Змініть параметри пошуку або спробуйте пізніше"}}},Co={class:"w-full overflow-hidden rounded vs-table-interface__table-wrp h-fit"},Bo={class:"p-5 min-h-[500px] flex flex-col justify-center items-center text-center"},Do={class:"max-w-sm mx-auto mt-6"},No={class:"font-medium text-gray-800 dark:text-neutral-200"},Vo={class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"};function To(t,e,n,s,r,i){return o.openBlock(),o.createElementBlock("div",Co,[o.createElementVNode("div",null,[o.createElementVNode("div",Bo,[e[0]||(e[0]=o.createStaticVNode('<svg class="w-48 mx-auto" viewBox="0 0 178 90" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs></svg>',1)),o.createElementVNode("div",Do,[o.createElementVNode("p",No,o.toDisplayString(n.title),1),o.createElementVNode("p",Vo,o.toDisplayString(n.text),1)])])])])}const zo=_($o,[["render",To]]),Ro={},Lo={class:"flex-shrink-0 size-3.5",xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function Oo(t,e){return o.openBlock(),o.createElementBlock("svg",Lo,[...e[0]||(e[0]=[o.createStaticVNode('<line x1="21" x2="14" y1="4" y2="4"></line><line x1="10" x2="3" y1="4" y2="4"></line><line x1="21" x2="12" y1="12" y2="12"></line><line x1="8" x2="3" y1="12" y2="12"></line><line x1="21" x2="16" y1="20" y2="20"></line><line x1="12" x2="3" y1="20" y2="20"></line><line x1="14" x2="14" y1="2" y2="6"></line><line x1="8" x2="8" y1="10" y2="14"></line><line x1="16" x2="16" y1="18" y2="22"></line>',9)])])}const Ao=_(Ro,[["render",Oo]]),Fo={},Mo={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-refresh"};function Po(t,e){return o.openBlock(),o.createElementBlock("svg",Mo,[...e[0]||(e[0]=[o.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),o.createElementVNode("path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4"},null,-1),o.createElementVNode("path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"},null,-1)])])}const Io={components:{filterIcon:Ao,refreshIcon:_(Fo,[["render",Po]])},props:["filterScheme"],emits:["filters:changed"],data(){return{rows:[],isFilterVisible:!1,rowList:[],activeFilters:"",filters:{}}},async mounted(){const e=await(await new URLSearchParams(window.top.location.search)).get("filter");this.filters.url=e||""},computed:{activeFiltersCount(){var t,e;return(t=this.filters)!=null&&t.url?((e=this.filters)==null?void 0:e.url.split("=").length)-1:0}},methods:{toggleFilterShown(){this.isFilterVisible=!this.isFilterVisible},handleFilterChange(t){var e,n;this.filters=t,this.activeFilters=(n=(e=this.$refs)==null?void 0:e.filter)==null?void 0:n.activeFilters,this.$emit("filters:changed",this.filters)},resetFilters(){this.$refs.filter&&this.$refs.filter.clearAll(),this.isFilterVisible=!1,this.$emit("filters:changed",""),this.activeFilters=null},closeFilter({target:t}){this.isFilterVisible&&t.classList.contains("filter-container")&&(this.isFilterVisible=!1)}}},jo={class:"flex items-center"},Uo={key:0,class:"font-medium text-[10px] min-w-[16px] py-0.5 px-[5px] bg-gray-800 text-white leading-3 rounded-full"};function qo(t,e,n,s,r,i){const a=o.resolveComponent("filterIcon"),l=o.resolveComponent("VsFilterList");return o.openBlock(),o.createElementBlock("div",jo,[n.filterScheme?(o.openBlock(),o.createBlock(l,{key:0,ref:"filter",scheme:n.filterScheme,closeFilterBtn:!0,onFilterClose:e[1]||(e[1]=c=>r.isFilterVisible=!1),layout:"default","apply-vue-router":"",history:"",view:"plain",token:t.table,name:"filter",footer:!0,background:!0,onFilterChange:i.handleFilterChange},{button:o.withCtx(()=>[o.createElementVNode("button",{type:"button",class:"py-2 px-2.5 ml-3 h-[38px] inline-flex items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50",onClick:e[0]||(e[0]=(...c)=>i.toggleFilterShown&&i.toggleFilterShown(...c))},[o.createVNode(a),e[2]||(e[2]=o.createTextVNode(" Фільтри ",-1)),i.activeFiltersCount>=1?(o.openBlock(),o.createElementBlock("span",Uo,o.toDisplayString(i.activeFiltersCount),1)):o.createCommentVNode("",!0)])]),_:1},8,["scheme","token","onFilterChange"])):o.createCommentVNode("",!0)])}const Ho={props:["dashboardData","filters"],components:{VsFilterHeader:_(Io,[["render",qo]])}},Wo={class:"bg-white px-5 flex gap-4 h-[90px] border border-gray-200 mt-2 rounded-xl mb-2 pt-[3px] justify-between items-center"},Zo={class:"grow"},Jo={class:"text-lg font-semibold text-stone-800 dark:text-neutral-200"},Go={type:"button",class:"inline-flex items-center text-sm gap-x-2 text-stone-800 hover:text-stone-500 focus:outline-none focus:text-stone-500 dark:text-neutral-200 dark:hover:text-neutral-400 dark:focus:text-neutral-400","data-clipboard-target":"#hs-erc","data-clipboard-action":"copy","data-clipboard-success-text":"Copied"};function Ko(t,e,n,s,r,i){var l,c;const a=o.resolveComponent("VsFilterHeader");return o.openBlock(),o.createElementBlock("div",Wo,[o.createElementVNode("div",Zo,[o.createElementVNode("h1",Jo,o.toDisplayString((l=n.dashboardData)==null?void 0:l.title),1),o.createElementVNode("button",Go,o.toDisplayString((c=n.dashboardData)==null?void 0:c.description),1)]),o.createVNode(a,{filterScheme:n.filters,"onFilters:changed":e[0]||(e[0]=h=>t.$emit("filters:changed",h))},null,8,["filterScheme"])])}const Qo={components:{VsWidget:tn,VsNewNodata:zo,VsHeader:_(Ho,[["render",Ko]])},props:["id","prefix"],data(){return{widgets:[],panels:[],error:!1,selectedPanel:"",filterURl:null,dashboardData:null}},async mounted(){V.defaults.baseURL=this.prefix||"/api",await this.fetchData()},methods:{async fetchData(){if(this.id)try{const{data:t}=await V.get(`/bi-dashboard/${this.id}`);this.dashboardData=t}catch(t){console.error(t)}},columnClass(t){const e=t!=null&&t.col?t==null?void 0:t.col:12;return{1:"md:w-1/12 sm:w-full",2:"md:w-1/6 sm:w-full",3:"md:w-1/4 sm:w-full",4:"md:w-1/3 sm:w-full",6:"md:w-1/2 sm:w-full",8:"md:w-2/3 sm:w-full",10:"md:w-5/6 sm:w-full",12:"w-full"}[e]||"w-full"},async filterHandler(t){var n;this.filterURl="";let e="&filter=";(n=t==null?void 0:t.url)!=null&&n.length&&(t.url.split("|").forEach(r=>{const i=r.split("=");e+=`${i[0]}=${i[1]}`}),this.filterURl+=e)}}},vo={class:"w-full pb-8 overflow-y-auto"},Xo={class:"grid flex-grow w-full grid-cols-12 gap-4 h-fit"};function Yo(t,e,n,s,r,i){var h,d,u;const a=o.resolveComponent("VsHeader"),l=o.resolveComponent("VsNewNodata"),c=o.resolveComponent("VsWidget");return o.openBlock(),o.createElementBlock("div",vo,[o.createElementVNode("div",null,[(h=r.dashboardData)!=null&&h.filters?(o.openBlock(),o.createBlock(a,{key:0,filters:(d=r.dashboardData)==null?void 0:d.filters,dashboardData:r.dashboardData,"onFilters:changed":e[0]||(e[0]=m=>i.filterHandler(m))},null,8,["filters","dashboardData"])):o.createCommentVNode("",!0)]),o.createElementVNode("div",Xo,[r.error||!r.dashboardData?(o.openBlock(),o.createBlock(l,{key:0,class:"col-span-12"})):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(((u=r.dashboardData)==null?void 0:u.panels)||[],(m,b)=>{var p;return o.openBlock(),o.createElementBlock("div",{key:b,class:o.normalizeClass([`col-span-${m.col||12}`,"flex flex-col gap-[10px]"])},[(p=m.widgets)!=null&&p.length?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:0},o.renderList(m.widgets,g=>(o.openBlock(),o.createBlock(c,{key:g,dashboard:n.id,widget:g,"dashboard-widgets":r.dashboardData.widgets,"filter-u-rl":r.filterURl},null,8,["dashboard","widget","dashboard-widgets","filter-u-rl"]))),128)):(o.openBlock(),o.createBlock(c,{key:1,class:"flex flex-col",dashboard:n.id,widget:m.widget,"dashboard-widgets":r.dashboardData.widgets,"filter-u-rl":r.filterURl},null,8,["dashboard","widget","dashboard-widgets","filter-u-rl"]))],2)}),128))])])}const ei=_(Qo,[["render",Yo]]),ti={name:"VsPivotTable",mixins:[F],data(){return{values:null,xs:null,products:null}},async mounted(){await this.getData(),this.prepareData()},methods:{onChangedData(){try{this.sourceData&&this.prepareData()}catch{}},prepareData(){try{const t=Array.from(new Set(this.sourceData.map(e=>e[this.dimensions[0]])));this.dimensions[0].includes("date")?this.xs=t.map(e=>se(e)):this.xs=[...t],this.products=this.dimensions.filter((e,n)=>n!=0),this.values=this.products.map((e,n)=>({name:e,data:this.sourceData.filter(s=>parseFloat(s[e])).map(s=>R(parseFloat(s[e])))}))}catch(t){console.error(t)}}}},ni={class:"flex flex-col h-full p-5 space-y-4 rounded-xl custom-scrollbar"},si={class:"overflow-x-auto [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 custom-scrollbar"},ri={class:"inline-block min-w-full align-middle"},oi={class:"min-w-full divide-y divide-gray-200"},ii={class:"space-x-2"},ai={scope:"col",class:"xl:min-w-[120px] min-w-48"},li={class:"py-2.5 text-text-start flex items-center gap-x-1 text-sm font-normal text-gray-500"},ci={class:"divide-y divide-gray-200 text-[12px]"},di={class:"py-3 size-px whitespace-nowrap"},hi={class:"flex items-center gap-x-3"},pi={class:"font-medium text-gray-800"},ui={class:"py-3 size-px whitespace-nowrap"},fi={class:"text-gray-600"};function mi(t,e,n,s,r,i){return o.openBlock(),o.createElementBlock("div",ni,[o.createElementVNode("div",si,[o.createElementVNode("div",ri,[o.createElementVNode("table",oi,[o.createElementVNode("thead",null,[o.createElementVNode("tr",ii,[e[0]||(e[0]=o.createElementVNode("th",{scope:"col",class:"min-w-[200px]"},[o.createElementVNode("div",{class:"py-2.5 text-text-start flex items-center gap-x-1 text-sm font-normal text-gray-500"})],-1)),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.xs,a=>(o.openBlock(),o.createElementBlock("th",ai,[o.createElementVNode("div",li,o.toDisplayString(a),1)]))),256))])]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.values,a=>(o.openBlock(),o.createElementBlock("tbody",ci,[o.createElementVNode("tr",null,[o.createElementVNode("td",di,[o.createElementVNode("div",hi,[o.createElementVNode("span",pi,o.toDisplayString(a.name),1)])]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.xs,(l,c)=>(o.openBlock(),o.createElementBlock("td",ui,[o.createElementVNode("span",fi,o.toDisplayString(a.data[c]),1)]))),256))])]))),256))])])])])}const nn=_(ti,[["render",mi]]),gi=Object.freeze(Object.defineProperty({__proto__:null,default:nn},Symbol.toStringTag,{value:"Module"})),bi={name:"VsNumber",mixins:[F],data(){return{number:""}},computed:{formattedNumber(){return zn(this.number)},prefix(){var t,e;return(t=this.styleData)!=null&&t.prefix?(e=this.styleData)==null?void 0:e.prefix:""}},watch:{sourceData:{async handler(){this.getNumber()},deep:!0}},async mounted(){await this.getData(),this.getNumber()},methods:{onChangedData(){try{this.sourceData&&this.getNumber()}catch(t){console.error(t)}},async getNumber(){var t,e;try{this.number=((e=this.sourceData[0])==null?void 0:e[Object.keys((t=this.sourceData)==null?void 0:t[0])])||0}catch(n){console.error(n)}}}},yi={class:"text-lg lg:text-xl xl:text-2xl text-gray-800 h-[32px] flex items-center"};function xi(t,e,n,s,r,i){return o.openBlock(),o.createElementBlock("div",yi,o.toDisplayString(i.prefix)+o.toDisplayString(i.formattedNumber),1)}const wi=Object.freeze(Object.defineProperty({__proto__:null,default:_(bi,[["render",xi]])},Symbol.toStringTag,{value:"Module"}));function Ge(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let Q=Ge();function sn(t){Q=t}const rn=/[&<>"']/,ki=new RegExp(rn.source,"g"),on=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,_i=new RegExp(on.source,"g"),Ei={"&":"&","<":"<",">":">",'"':""","'":"'"},an=t=>Ei[t];function M(t,e){if(e){if(rn.test(t))return t.replace(ki,an)}else if(on.test(t))return t.replace(_i,an);return t}const Si=/(^|[^\[])\^/g;function B(t,e){let n=typeof t=="string"?t:t.source;e=e||"";const s={replace:(r,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(Si,"$1"),n=n.replace(r,a),s},getRegex:()=>new RegExp(n,e)};return s}function ln(t){try{t=encodeURI(t).replace(/%25/g,"%")}catch{return null}return t}const ce={exec:()=>null};function cn(t,e){const n=t.replace(/\|/g,(i,a,l)=>{let c=!1,h=a;for(;--h>=0&&l[h]==="\\";)c=!c;return c?"|":" |"}),s=n.split(/ \|/);let r=0;if(s[0].trim()||s.shift(),s.length>0&&!s[s.length-1].trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;r<s.length;r++)s[r]=s[r].trim().replace(/\\\|/g,"|");return s}function de(t,e,n){const s=t.length;if(s===0)return"";let r=0;for(;r<s&&t.charAt(s-r-1)===e;)r++;return t.slice(0,s-r)}function $i(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let s=0;s<t.length;s++)if(t[s]==="\\")s++;else if(t[s]===e[0])n++;else if(t[s]===e[1]&&(n--,n<0))return s;return-1}function dn(t,e,n,s){const r=e.href,i=e.title?M(e.title):null,a=t[1].replace(/\\([\[\]])/g,"$1");if(t[0].charAt(0)!=="!"){s.state.inLink=!0;const l={type:"link",raw:n,href:r,title:i,text:a,tokens:s.inlineTokens(a)};return s.state.inLink=!1,l}return{type:"image",raw:n,href:r,title:i,text:M(a)}}function Ci(t,e){const n=t.match(/^(\s+)(?:```)/);if(n===null)return e;const s=n[1];return e.split(`
|
|
25
|
+
</div>`},prepareData(){var t,e,n,s,r;try{this.styleData=this.styleData||{};const i=Array.from(new Set((this.sourceData||[]).map(g=>g[this.dimensions[0]]))),a=Array.from(new Set((this.sourceData||[]).map(g=>g[this.dimensions[1]]))),l=parseInt((this.sourceData||[]).reduce((g,u)=>g+parseFloat(u==null?void 0:u.metric),0),10),c=i.map((g,u)=>{const b=(a[u]/l*100).toFixed(2);return{name:`${g} (${b}%)`,value:a[u]}}),h=((t=this.styleData)==null?void 0:t.innerRadius)||"0%",d=((e=this.styleData)==null?void 0:e.outerRadius)||"100%",p=[h,d];return this.styleData.legend=ke.getLegendOpions({borderRadius:10,height:"100%",padding:10,type:"scroll",itemWidth:14,itemHeight:14,formatter:g=>g==null?void 0:g.replace("null","Не визначено"),textStyle:{fontSize:"14px"},...((n=this.styleData)==null?void 0:n.legend)||{}}),this.styleData.label=ke.getLabelOptions((s=this.styleData)==null?void 0:s.label),this.styleData.show_legend=((r=this.styleData)==null?void 0:r.show_legend)??!0,{series:[{name:this.titleCharts?this.titleCharts:this.dimensions[0],type:"pie",radius:p,center:["50%","60%"],height:"75%",...Z(this.styleData),data:c}]}}catch(i){return console.error("Error in prepareData:",i),null}},async initChart(t){try{if(!t){console.warn("No series data available for chart initialization");return}const e=this.$refs.chart;if(!e){console.warn("Chart DOM element not found");return}this.chartInstance=echarts.init(e);const n={tooltip:{trigger:"item",formatter:s=>this.buildTooltipForDonut(s,[s.color]),borderWidth:0,appendToBody:!0,borderColor:"transparent",textStyle:{color:"#000"},padding:[15,15],shadowColor:"transparent",backgroundColor:"transparent"},series:t,...Z(this.styleData||{})};this.chartInstance.setOption(n),this.$emit("update:currentWidget",this.chartInstance),this.chartInstance.resize(),window.addEventListener("resize",()=>{var s;(s=this.chartInstance)==null||s.resize()})}catch(e){console.error("Error in initChart:",e)}}}},Ys=["id"];function er(t,e,n,s,r,i){return o.openBlock(),o.createElementBlock("div",{id:i.uniqueID,ref:"chart",class:"h-full min-h-[200px] flex items-center"},null,8,Ys)}const It=E(Xs,[["render",er]]),tr=Object.freeze(Object.defineProperty({__proto__:null,default:It},Symbol.toStringTag,{value:"Module"})),nr={name:"VsLine",mixins:[A],data(){return{chartInstance:null,uniqueID:null}},async mounted(){this.uniqueID=this.widget,await this.$nextTick(),await this.getData();const{series:t,xs:e}=this.prepareData();t&&this.initChart(t,e)},methods:{onChangedData(){try{if(this.sourceData){const{series:t,xs:e,ys:n}=this.prepareData();t&&(this==null||this.initChart(t,e,n))}}catch(t){console.error(t)}},prepareData(){var t,e;try{const n=Array.from(new Set(this.sourceData.map(a=>a[this.dimensions[0]])));let s;this.dimensions[0].includes("date")?s=n.map(a=>v(a)):s=[...n];const r=this.sourceData.map(a=>parseFloat(a[this.dimensions[1]]));let i;return(t=this.styleData)!=null&&t.stack?i=this.dimensions.slice(1).map(l=>({name:l,type:"line",stack:"a",areaStyle:this.styleData.area?{}:null,data:this.sourceData.filter(c=>parseFloat(c[l])).map(c=>parseFloat(c[l]))})):i=[{name:this.title,type:"line",areaStyle:(e=this.styleData)!=null&&e.area?{}:null,data:r,stack:"a"}],{series:i,xs:s}}catch(n){return console.error(n),null}}}},sr=["id"];function rr(t,e,n,s,r,i){return o.openBlock(),o.createElementBlock("div",{id:r.uniqueID,ref:"chart",style:{height:"400px"}},null,8,sr)}const jt=E(nr,[["render",rr]]),or=Object.freeze(Object.defineProperty({__proto__:null,default:jt},Symbol.toStringTag,{value:"Module"})),ir={name:"VsStat",mixins:[A],data(){return{restDimensions:[],sumValue:0,columns:null,showTooltip:-1}},async mounted(){await this.getData(),this.prepareData()},methods:{onChangedData(){try{this.sourceData&&this.prepareData()}catch{}},prepareData(){this.columns=Object.keys(this.sourceData[0]);const t=this.getValues();this.sumValue=t.reduce((e,n)=>e+n,0),this.sourceData.forEach((e,n)=>{e.color=n<Mt.length-1?Mt[n]:qs()})},formattedValue(t){const e=parseFloat(t);return R(e)}}},ar={class:"flex flex-col w-full h-full pt-[16px] rounded-xl"},lr={class:"flex flex-col justify-between w-full h-full"},cr={class:"w-full h-full pb-6 space-y-4"},dr={class:"flex w-full h-3 rounded-full gap-x-1 min-h-3 custom-x-scrollbar"},hr=["onMouseover"],pr={key:0,class:"absolute top-[-1] left-1/2 transform -translate-x-1/2 -translate-y-full bg-black text-white rounded px-2 py-1"},ur={class:"h-[calc(100%-20px)] w-full custom-scrollbar"},fr={class:"grid items-center justify-between grid-cols-2 py-2 gap-x-4"},mr={class:"flex items-center"},gr={class:"text-sm text-gray-800"},br={class:"text-end"},yr={class:"text-sm text-gray-500"};function xr(t,e,n,s,r,i){return o.openBlock(),o.createElementBlock("div",ar,[o.createElementVNode("div",lr,[o.createElementVNode("div",cr,[o.createElementVNode("div",dr,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.sourceData,(a,l)=>{var c,h,d,p;return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["flex flex-col min-w-[5px] justify-center min-h-2.5 h-2.5 text-xs text-white text-center whitespace-nowrap",`bg-[${a.color}]`]),style:o.normalizeStyle({width:`${parseFloat(a==null?void 0:a[(c=r.columns)==null?void 0:c[1]])/r.sumValue*100}%`}),role:"progressbar","aria-valuenow":"42","aria-valuemin":"0","aria-valuemax":"100",onMouseover:m=>r.showTooltip=l,onMouseleave:e[0]||(e[0]=m=>r.showTooltip=-1)},[r.showTooltip>-1?(o.openBlock(),o.createElementBlock("div",pr,o.toDisplayString(t.sourceData[r.showTooltip][r.columns[0]])+" "+o.toDisplayString((parseFloat((p=(h=t.sourceData)==null?void 0:h[r.showTooltip])==null?void 0:p[(d=r.columns)==null?void 0:d[1]])/r.sumValue*100).toFixed(2))+"% ",1)):o.createCommentVNode("",!0)],46,hr)}),256))]),o.createElementVNode("ul",ur,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.sourceData,a=>{var l,c;return o.openBlock(),o.createElementBlock("li",fr,[o.createElementVNode("div",mr,[o.createElementVNode("span",{class:o.normalizeClass(["shrink-0 size-2.5 inline-block rounded-sm me-2.5 min-w-[10px] w-[10px] h-[10px] min-h-[10px]",`bg-[${a.color}]`])},null,2),o.createElementVNode("span",gr,o.toDisplayString((a==null?void 0:a[(l=r.columns)==null?void 0:l[0]])||"Не визначено"),1)]),o.createElementVNode("div",br,[o.createElementVNode("span",yr,o.toDisplayString(i.formattedValue(a==null?void 0:a[(c=r.columns)==null?void 0:c[1]])||"-"),1)])])}),256))])])])])}const Ut=E(ir,[["render",xr]]),wr=Object.freeze(Object.defineProperty({__proto__:null,default:Ut},Symbol.toStringTag,{value:"Module"})),kr={name:"VsProgressBar",mixins:[A],data(){return{restDimensions:[],maxValue:0,columns:null}},async mounted(){await this.getData(),this.prepareData()},methods:{onChangedData(){try{this.sourceData&&this.prepareData()}catch{}},prepareData(){var e;this.columns=Object.keys((e=this.sourceData)==null?void 0:e[0])||null;const t=this.getValues();this.maxValue=Math.max(...t)},formattedValue(t){return R(t)}}},_r={key:0,class:"flex flex-col h-full pt-[16px] rounded-xl"},Er={class:"h-full pt-0 pb-6 space-y-4"},Sr={class:"h-full space-y-4 custom-scrollbar"},$r={class:"flex items-center justify-between mr-2 gap-x-2"},Cr={class:"grid items-center w-full grid-cols-2 gap-x-2"},Br={class:"text-sm text-gray-800"},Dr={class:"flex justify-end",role:"progressbar","aria-valuenow":"100","aria-valuemin":"0","aria-valuemax":"100"},Nr={class:"min-w-[60px] text-end"},Vr={class:"text-sm text-gray-500"};function Tr(t,e,n,s,r,i){return r.columns?(o.openBlock(),o.createElementBlock("div",_r,[o.createElementVNode("div",Er,[o.createElementVNode("ul",Sr,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.sourceData,(a,l)=>(o.openBlock(),o.createElementBlock("li",$r,[o.createElementVNode("div",Cr,[o.createElementVNode("span",Br,o.toDisplayString(a[r.columns[0]]),1),o.createElementVNode("div",Dr,[o.createElementVNode("div",{class:"h-1.5 flex flex-col justify-center overflow-hidden bg-indigo-500 rounded-full text-xs text-white text-center whitespace-nowrap",style:o.normalizeStyle({width:`${parseFloat(a[r.columns[1]])/r.maxValue*100}%`})},null,4)])]),o.createElementVNode("div",Nr,[o.createElementVNode("span",Vr,o.toDisplayString(i.formattedValue(a[r.columns[1]])),1)])]))),256))])])])):o.createCommentVNode("",!0)}const qt=E(kr,[["render",Tr]]),Rr=Object.freeze(Object.defineProperty({__proto__:null,default:qt},Symbol.toStringTag,{value:"Module"})),zr={name:"VsListbar",mixins:[A],props:["source"],data(){return{restDimensions:[],maxValue:0,columns:null}},async mounted(){await this.getData(),this.prepareData()},methods:{onChangedData(){try{this.sourceData&&this.prepareData()}catch(t){console.error(t)}},prepareData(){var e,n,s;this.columns=Object.keys(((e=this.sourceData)==null?void 0:e[0])||{});const t=(n=this.sourceData)==null?void 0:n.map(r=>{var i;return r==null?void 0:r[(i=this.columns)==null?void 0:i[1]]});this.maxValue=Math.max(...t||[]),this.restDimensions=(s=this.columns)==null?void 0:s.filter((r,i)=>i!==0)},formattedValue(t){return R(t)},getWidth(t){return`${t/this.maxValue*100}%`}}},Lr={class:"h-full pt-[20px] list-bar"},Or={class:"space-y-2 custom-scrollbar h-full h-[calc(100%-20px)]"},Ar={class:"relative w-full truncate"},Fr={class:"relative z-[1] text-sm block py-1 px-2 w-full text-sm truncate text-gray-800"},Mr={class:"text-[14px] text-gray-500"};function Pr(t,e,n,s,r,i){return o.openBlock(),o.createElementBlock("div",Lr,[o.createElementVNode("ul",Or,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.sourceData,(a,l)=>{var c,h,d;return o.openBlock(),o.createElementBlock("li",{key:l,class:"flex items-center justify-between w-full gap-x-2"},[o.createElementVNode("div",Ar,[o.createElementVNode("span",Fr,o.toDisplayString((a==null?void 0:a[(c=r.columns)==null?void 0:c[0]])||"Без категорії"),1),o.createElementVNode("div",{class:o.normalizeClass(["absolute inset-y-0 h-full rounded start-0",a!=null&&a[(h=r.columns)==null?void 0:h[0]]?"bg-indigo-100":"bg-gray-100"]),style:o.normalizeStyle({width:i.getWidth(a==null?void 0:a[(d=r.columns)==null?void 0:d[1]])})},null,6)]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.restDimensions,(p,m)=>(o.openBlock(),o.createElementBlock("div",{key:m,class:"w-20 mr-2 text-end"},[o.createElementVNode("span",Mr,o.toDisplayString(i.formattedValue(a==null?void 0:a[p])),1)]))),128))])}),128))])])}const Ht=E(zr,[["render",Pr]]),Ir=Object.freeze(Object.defineProperty({__proto__:null,default:Ht},Symbol.toStringTag,{value:"Module"})),je={week:"Тиждень",month:"Місяць",quarter:"Квартал",year:"Рік"},jr=["onClick"],Ur={class:"flex items-center justify-between w-full"},qr={key:0},Hr={__name:"vs-bi-dropdown",props:{title:String,options:[Array,String],value:{type:String}},emits:["selected"],setup(t,{emit:e}){const n=t,s=e,r=o.ref(!1),i=o.ref(n.value||null),a=o.ref(null),l=o.computed(()=>typeof n.options=="string"?n.options.split(",").map((g,u)=>({id:u,text:g.trim()})):n.options),c=o.computed(()=>{const g=l.value.find(u=>(u.id||u)===i.value);return g?g.text||g:n.title}),h=g=>{i.value=g.id||g,r.value=!1,s("selected",(g==null?void 0:g.id)||g),document.removeEventListener("click",d)},d=g=>{a.value&&!a.value.contains(g.target)&&(r.value=!1,document.removeEventListener("click",d))},p=()=>{r.value=!r.value,r.value?setTimeout(()=>{document.addEventListener("click",d)},200):document.removeEventListener("click",d)},m=g=>(je==null?void 0:je[g])||g;return o.onUnmounted(()=>{document.removeEventListener("click",d)}),(g,u)=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createElementVNode("button",{type:"button","aria-expanded":"true",class:"hs-select-disabled:pointer-events-none hs-select-disabled:opacity-50 relative group pr-2 -ms-2 py-1.5 pl-2.5 inline-flex shrink-0 justify-center items-center gap-x-1.5 text-sm text-gray-800 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100 before:absolute before:inset-0 before:z-[1] dark:text-neutral-400 dark:hover:bg-neutral-800 dark:focus:bg-neutral-700",onClick:p},[o.createTextVNode(o.toDisplayString(m(c.value))+" ",1),u[0]||(u[0]=o.createElementVNode("svg",{class:"shrink-0 size-3.5 text-gray-600 dark:text-neutral-400",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[o.createElementVNode("path",{d:"m6 9 6 6 6-6"})],-1))]),r.value?(o.openBlock(),o.createElementBlock("div",{key:0,ref_key:"biDropdown",ref:a,"data-hs-select-dropdown":"",class:"absolute mt-2 z-50 w-48 p-1 space-y-0.5 bg-white rounded-xl shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] dark:bg-neutral-950 opened",role:"listbox",tabindex:"-1","aria-orientation":"vertical",style:{"margin-top":"10px"}},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(l.value,b=>(o.openBlock(),o.createElementBlock("div",{key:b.id||b,class:"cursor-pointer selected hs-selected:bg-gray-100 dark:hs-selected:bg-neutral-800 py-1.5 px-2 w-full text-[13px] text-gray-800 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:y=>h(b)},[o.createElementVNode("div",Ur,[o.createElementVNode("span",null,o.toDisplayString(m(b.text||b)),1),i.value===(b.id||b)?(o.openBlock(),o.createElementBlock("span",qr,[...u[1]||(u[1]=[o.createElementVNode("svg",{class:"shrink-0 h-3.5 w-3.5 text-gray-800 dark:text-neutral-200",xmlns:"http:.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[o.createElementVNode("polyline",{points:"20 6 9 17 4 12"})],-1)])])):o.createCommentVNode("",!0)])],8,jr))),128))],512)):o.createCommentVNode("",!0)],64))}},Wr={"bi-bar":o.defineAsyncComponent(()=>Promise.resolve().then(()=>Js)),"bi-number":o.defineAsyncComponent(()=>Promise.resolve().then(()=>ii)),"bi-text":o.defineAsyncComponent(()=>Promise.resolve().then(()=>qi)),"bi-listbar":o.defineAsyncComponent(()=>Promise.resolve().then(()=>Ir)),"bi-pie":o.defineAsyncComponent(()=>Promise.resolve().then(()=>tr)),"bi-donut":o.defineAsyncComponent(()=>Promise.resolve().then(()=>vs)),"bi-line":o.defineAsyncComponent(()=>Promise.resolve().then(()=>or)),"bi-stat":o.defineAsyncComponent(()=>Promise.resolve().then(()=>wr)),"bi-pivot":o.defineAsyncComponent(()=>Promise.resolve().then(()=>ni)),"bi-progress":o.defineAsyncComponent(()=>Promise.resolve().then(()=>Rr)),"bi-funnel":o.defineAsyncComponent(()=>Promise.resolve().then(()=>Ji)),"bi-map":o.defineAsyncComponent(()=>Promise.resolve().then(()=>Ya)),"bi-cluster":o.defineAsyncComponent(()=>Promise.resolve().then(()=>Vl)),"bi-table":o.defineAsyncComponent(()=>Promise.resolve().then(()=>ql))},Zr={class:"flex items-center space-x-2"},Jr=o.defineComponent({__name:"vs-bi-switch",props:o.mergeModels({leftLabel:{},rightLabel:{},modelValue:{type:Boolean}},{modelValue:{default:()=>!1,type:Boolean},modelModifiers:{}}),emits:o.mergeModels(["update:is-enabled"],["update:modelValue"]),setup(t,{emit:e}){const n=e,s=o.useModel(t,"modelValue"),r=()=>{n("update:is-enabled",s)};return(i,a)=>(o.openBlock(),o.createElementBlock("div",Zr,[i.leftLabel?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["transition-colors",{"text-blue-500":!s.value}])},o.toDisplayString(i.leftLabel),3)):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":a[0]||(a[0]=l=>s.value=l),type:"checkbox",class:"relative w-11 h-6 p-px bg-gray-100 border-transparent text-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:ring-blue-600 disabled:opacity-50 disabled:pointer-events-none checked:bg-none checked:text-blue-600 checked:border-blue-600 focus:checked:border-blue-600 dark:bg-neutral-800 dark:border-neutral-700 dark:checked:bg-blue-500 dark:checked:border-blue-500 dark:focus:ring-offset-gray-600 before:inline-block before:size-5 before:bg-white checked:before:bg-blue-200 before:translate-x-0 checked:before:translate-x-full before:rounded-full before:shadow before:h-5 before:w-5 before:transform before:ring-0 before:transition before:ease-in-out before:duration-200 dark:before:bg-neutral-400 dark:checked:before:bg-blue-200",onChange:r},null,544),[[o.vModelCheckbox,s.value]]),i.rightLabel?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(["transition-colors",{"text-blue-500":s.value}])},o.toDisplayString(i.rightLabel),3)):o.createCommentVNode("",!0)]))}}),Gr={},Kr={class:"flex items-center justify-center h-full"};function Qr(t,e){return o.openBlock(),o.createElementBlock("div",Kr,[...e[0]||(e[0]=[o.createElementVNode("div",{class:"text-center text-gray-500"},[o.createElementVNode("h2",{class:"text-2xl font-bold"},"No data available")],-1)])])}const vr=E(Gr,[["render",Qr]]),Xr={},Yr={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-download"};function eo(t,e,n,s,r,i){return o.openBlock(),o.createElementBlock("svg",Yr,[...e[0]||(e[0]=[o.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),o.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),o.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),o.createElementVNode("path",{d:"M12 4l0 12"},null,-1)])])}const to={components:{VsBiDropdown:Hr,VsBiSwitch:Jr,VsNoDataChart:vr,IconDownload:E(Xr,[["render",eo]]),...Wr},props:{dashboard:{type:String},prefix:{type:String,default:""},widget:{type:String},filterURl:{type:String},dashboardWidgets:{type:Object},selectedWidget:{type:String}},data(){return{checked:[],selected:[],currentWidget:null,widgetData:[]}},computed:{computedTitle(){var e,n;const t=(e=this.dashboardWidgets)==null?void 0:e.find(s=>s.name===this.widget);return((n=t==null?void 0:t.data)==null?void 0:n.title)||(t==null?void 0:t.title)||""},computedType(){var e;const t=(e=this.dashboardWidgets)==null?void 0:e.find(n=>n.name===this.widget);return(t==null?void 0:t.type)||"text"},controls(){var e;return Object.keys(((e=this.widgetData)==null?void 0:e.controls)||{}).map(n=>{var s,r,i;return{name:n,options:typeof((s=this.widgetData)==null?void 0:s.controls)=="boolean"?!1:(i=(r=this.widgetData)==null?void 0:r.controls)==null?void 0:i[n]}})}},mounted(){this.prefix&&(V.defaults.baseURL=this.prefix)},watch:{filterURl(t){var e,n;(n=(e=this.$refs)==null?void 0:e.chart)==null||n.setFilter(t)},selectedWidget(t,e){var n;t!==e&&t===((n=this.widgetData)==null?void 0:n.id)&&this.$emit("update:current-widget-data",this.widgetData)},widgetData(t,e){if((t==null?void 0:t.id)===(e==null?void 0:e.id))return;const s=new URLSearchParams(window.top.location.search).get("widget");s&&s===(t==null?void 0:t.id)&&this.$emit("update:current-widget-data",t)}},methods:{changeStyleHandler(t,e){var n;(n=this.$refs.chart)==null||n.changeStyle(t,e)},selectedOptionHandler(t,e){let n=!0;this.selected.forEach(s=>{s.name===e&&(s.option=t,n=!1)}),n&&this.selected.push({name:e,option:t}),this.makeUpUrl()},makeUpUrl(){var e;let t=`/bi-data?dashboard=${this.dashboard}&widget=${this.widget}`;this.selected.forEach((n,s)=>{t+=`&${n.name}=${n.option}`}),(e=this.$refs.chart)==null||e.getDataFromURL(t)},exportChart(){if(this.currentWidget){const t=this.currentWidget.getDataURL({type:"png",pixelRatio:2,backgroundColor:"#ffffff"}),e=document.createElement("a");e.href=t,e.download="chart.png",document.body.appendChild(e),e.click(),document.body.removeChild(e)}}}},no={key:0,class:"text-[16px] flex max-w-full items-center min-h-0 flex justify-between max-h-[50px] h-fit shrink-0"},so={class:"flex items-center justify-between w-full"},ro={class:"grid"},oo={class:"text-gray-800 max-h-[30px] inline-block text-nowrap font-semibold"},io={class:"flex flex-col justify-end"},ao={key:0,class:"flex items-center justify-end w-full gap-2"},lo={class:"w-full h-full"};function co(t,e,n,s,r,i){var d,p,m,g,u,b,y,_,w;const a=o.resolveComponent("VsBiDropdown"),l=o.resolveComponent("VsBiSwitch"),c=o.resolveComponent("IconDownload"),h=o.resolveComponent("VsNoDataChart");return o.openBlock(),o.createElementBlock("div",{ref:"widget",class:o.normalizeClass(["box-border relative h-full p-4 bg-white border border-gray-200 select-auto rounded-xl",[(p=(d=r.widgetData)==null?void 0:d.style)!=null&&p.height?`max-h-[${(g=(m=r.widgetData)==null?void 0:m.style)==null?void 0:g.height}px] h-[${(b=(u=r.widgetData)==null?void 0:u.style)==null?void 0:b.height}px]`:"max-h-[460px]"]])},[["text","cluster","map"].includes(i.computedType)?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",no,[o.createElementVNode("div",so,[o.createElementVNode("div",ro,[o.createElementVNode("span",oo,o.toDisplayString(i.computedTitle),1)]),o.createElementVNode("div",io,[(y=i.controls)!=null&&y.length?(o.openBlock(),o.createElementBlock("span",ao,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList((_=i.controls)==null?void 0:_.filter(x=>(x==null?void 0:x.options)&&(x==null?void 0:x.name)!=="export"),x=>{var N;return o.openBlock(),o.createElementBlock("div",null,[Array.isArray(x==null?void 0:x.options)?(o.openBlock(),o.createBlock(a,{key:0,title:x==null?void 0:x.name,options:x==null?void 0:x.options,value:(N=r.widgetData)==null?void 0:N.data[x==null?void 0:x.name],onSelected:$=>i.selectedOptionHandler($,x==null?void 0:x.name)},null,8,["title","options","value","onSelected"])):typeof x.options=="boolean"?(o.openBlock(),o.createBlock(l,{key:1,"left-label":x==null?void 0:x.name,"is-enabled":x==null?void 0:x.options,"onUpdate:isEnabled":$=>i.changeStyleHandler(x==null?void 0:x.name,$)},null,8,["left-label","is-enabled","onUpdate:isEnabled"])):o.createCommentVNode("",!0)])}),256)),(w=i.controls)!=null&&w.some(x=>(x==null?void 0:x.name)==="export")?(o.openBlock(),o.createElementBlock("button",{key:0,onClick:e[0]||(e[0]=(...x)=>i.exportChart&&i.exportChart(...x)),class:"h-[32px] w-[32px] rounded-lg hover:bg-gray-100 duration-100 flex items-center justify-center"},[o.createVNode(c,{height:"16",width:"16",class:"text-gray-800"})])):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0)])])])),o.createElementVNode("div",lo,[r.widgetData?(o.openBlock(),o.createBlock(o.resolveDynamicComponent("bi-"+i.computedType),{key:0,currentWidget:r.currentWidget,"onUpdate:currentWidget":e[1]||(e[1]=x=>r.currentWidget=x),widgetData:r.widgetData,"onUpdate:widgetData":e[2]||(e[2]=x=>r.widgetData=x),ref:"chart",dashboard:n.dashboard,title:i.computedTitle,widget:n.widget},null,40,["currentWidget","widgetData","dashboard","title","widget"])):(o.openBlock(),o.createBlock(h,{key:1,class:"w-full h-full"}))])],2)}const Wt=E(to,[["render",co]]),ho={props:{title:{type:String,default:()=>"Дані для відображення відсутні"},text:{type:String,default:()=>"Змініть параметри пошуку або спробуйте пізніше"}}},po={class:"w-full overflow-hidden rounded vs-table-interface__table-wrp h-fit"},uo={class:"p-5 min-h-[500px] flex flex-col justify-center items-center text-center"},fo={class:"max-w-sm mx-auto mt-6"},mo={class:"font-medium text-gray-800 dark:text-neutral-200"},go={class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"};function bo(t,e,n,s,r,i){return o.openBlock(),o.createElementBlock("div",po,[o.createElementVNode("div",null,[o.createElementVNode("div",uo,[e[0]||(e[0]=o.createStaticVNode('<svg class="w-48 mx-auto" viewBox="0 0 178 90" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs></svg>',1)),o.createElementVNode("div",fo,[o.createElementVNode("p",mo,o.toDisplayString(n.title),1),o.createElementVNode("p",go,o.toDisplayString(n.text),1)])])])])}const yo=E(ho,[["render",bo]]),xo={},wo={class:"flex-shrink-0 size-3.5",xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function ko(t,e){return o.openBlock(),o.createElementBlock("svg",wo,[...e[0]||(e[0]=[o.createStaticVNode('<line x1="21" x2="14" y1="4" y2="4"></line><line x1="10" x2="3" y1="4" y2="4"></line><line x1="21" x2="12" y1="12" y2="12"></line><line x1="8" x2="3" y1="12" y2="12"></line><line x1="21" x2="16" y1="20" y2="20"></line><line x1="12" x2="3" y1="20" y2="20"></line><line x1="14" x2="14" y1="2" y2="6"></line><line x1="8" x2="8" y1="10" y2="14"></line><line x1="16" x2="16" y1="18" y2="22"></line>',9)])])}const _o=E(xo,[["render",ko]]),Eo={},So={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-refresh"};function $o(t,e){return o.openBlock(),o.createElementBlock("svg",So,[...e[0]||(e[0]=[o.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),o.createElementVNode("path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4"},null,-1),o.createElementVNode("path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"},null,-1)])])}const Co={components:{filterIcon:_o,refreshIcon:E(Eo,[["render",$o]])},props:["filterScheme"],emits:["filters:changed"],data(){return{rows:[],isFilterVisible:!1,rowList:[],activeFilters:"",filters:{}}},async mounted(){const e=await(await new URLSearchParams(window.top.location.search)).get("filter");this.filters.url=e||""},computed:{activeFiltersCount(){var t,e;return(t=this.filters)!=null&&t.url?((e=this.filters)==null?void 0:e.url.split("=").length)-1:0}},methods:{toggleFilterShown(){this.isFilterVisible=!this.isFilterVisible},handleFilterChange(t){var e,n;this.filters=t,this.activeFilters=(n=(e=this.$refs)==null?void 0:e.filter)==null?void 0:n.activeFilters,this.$emit("filters:changed",this.filters)},resetFilters(){this.$refs.filter&&this.$refs.filter.clearAll(),this.isFilterVisible=!1,this.$emit("filters:changed",""),this.activeFilters=null},closeFilter({target:t}){this.isFilterVisible&&t.classList.contains("filter-container")&&(this.isFilterVisible=!1)}}},Bo={class:"flex items-center"},Do={key:0,class:"font-medium text-[10px] min-w-[16px] py-0.5 px-[5px] bg-gray-800 text-white leading-3 rounded-full"};function No(t,e,n,s,r,i){const a=o.resolveComponent("filterIcon"),l=o.resolveComponent("VsFilterList");return o.openBlock(),o.createElementBlock("div",Bo,[n.filterScheme?(o.openBlock(),o.createBlock(l,{key:0,ref:"filter",scheme:n.filterScheme,closeFilterBtn:!0,onFilterClose:e[1]||(e[1]=c=>r.isFilterVisible=!1),layout:"default","apply-vue-router":"",history:"",view:"plain",token:t.table,name:"filter",footer:!0,background:!0,onFilterChange:i.handleFilterChange},{button:o.withCtx(()=>[o.createElementVNode("button",{type:"button",class:"py-2 px-2.5 ml-3 h-[38px] inline-flex items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50",onClick:e[0]||(e[0]=(...c)=>i.toggleFilterShown&&i.toggleFilterShown(...c))},[o.createVNode(a),e[2]||(e[2]=o.createTextVNode(" Фільтри ",-1)),i.activeFiltersCount>=1?(o.openBlock(),o.createElementBlock("span",Do,o.toDisplayString(i.activeFiltersCount),1)):o.createCommentVNode("",!0)])]),_:1},8,["scheme","token","onFilterChange"])):o.createCommentVNode("",!0)])}const Vo={props:["dashboardData","filters"],components:{VsFilterHeader:E(Co,[["render",No]])}},To={class:"bg-white px-5 flex gap-4 h-[90px] border border-gray-200 mt-2 rounded-xl mb-2 pt-[3px] justify-between items-center"},Ro={class:"grow"},zo={class:"text-lg font-semibold text-stone-800 dark:text-neutral-200"},Lo={type:"button",class:"inline-flex items-center text-sm gap-x-2 text-stone-800 hover:text-stone-500 focus:outline-none focus:text-stone-500 dark:text-neutral-200 dark:hover:text-neutral-400 dark:focus:text-neutral-400","data-clipboard-target":"#hs-erc","data-clipboard-action":"copy","data-clipboard-success-text":"Copied"};function Oo(t,e,n,s,r,i){var l,c;const a=o.resolveComponent("VsFilterHeader");return o.openBlock(),o.createElementBlock("div",To,[o.createElementVNode("div",Ro,[o.createElementVNode("h1",zo,o.toDisplayString((l=n.dashboardData)==null?void 0:l.title),1),o.createElementVNode("button",Lo,o.toDisplayString((c=n.dashboardData)==null?void 0:c.description),1)]),o.createVNode(a,{filterScheme:n.filters,"onFilters:changed":e[0]||(e[0]=h=>t.$emit("filters:changed",h))},null,8,["filterScheme"])])}const Ao={components:{VsWidget:Wt,VsNewNodata:yo,VsHeader:E(Vo,[["render",Oo]])},props:["id","prefix"],data(){return{widgets:[],panels:[],error:!1,selectedPanel:"",filterURl:null,dashboardData:null}},async mounted(){V.defaults.baseURL=this.prefix||"/api",await this.fetchData()},methods:{async fetchData(){if(this.id)try{const{data:t}=await V.get(`/bi-dashboard/${this.id}`);this.dashboardData=t}catch(t){console.error(t)}},columnClass(t){const e=t!=null&&t.col?t==null?void 0:t.col:12;return{1:"md:w-1/12 sm:w-full",2:"md:w-1/6 sm:w-full",3:"md:w-1/4 sm:w-full",4:"md:w-1/3 sm:w-full",6:"md:w-1/2 sm:w-full",8:"md:w-2/3 sm:w-full",10:"md:w-5/6 sm:w-full",12:"w-full"}[e]||"w-full"},async filterHandler(t){var n;this.filterURl="";let e="&filter=";(n=t==null?void 0:t.url)!=null&&n.length&&(t.url.split("|").forEach(r=>{const i=r.split("=");e+=`${i[0]}=${i[1]}`}),this.filterURl+=e)}}},Fo={class:"w-full pb-8 overflow-y-auto"},Mo={class:"grid flex-grow w-full grid-cols-12 gap-4 h-fit"};function Po(t,e,n,s,r,i){var h,d,p;const a=o.resolveComponent("VsHeader"),l=o.resolveComponent("VsNewNodata"),c=o.resolveComponent("VsWidget");return o.openBlock(),o.createElementBlock("div",Fo,[o.createElementVNode("div",null,[(h=r.dashboardData)!=null&&h.filters?(o.openBlock(),o.createBlock(a,{key:0,filters:(d=r.dashboardData)==null?void 0:d.filters,dashboardData:r.dashboardData,"onFilters:changed":e[0]||(e[0]=m=>i.filterHandler(m))},null,8,["filters","dashboardData"])):o.createCommentVNode("",!0)]),o.createElementVNode("div",Mo,[r.error||!r.dashboardData?(o.openBlock(),o.createBlock(l,{key:0,class:"col-span-12"})):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(((p=r.dashboardData)==null?void 0:p.panels)||[],(m,g)=>{var u;return o.openBlock(),o.createElementBlock("div",{key:g,class:o.normalizeClass([`col-span-${m.col||12}`,"flex flex-col gap-[10px]"])},[(u=m.widgets)!=null&&u.length?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:0},o.renderList(m.widgets,b=>(o.openBlock(),o.createBlock(c,{key:b,dashboard:n.id,widget:b,"dashboard-widgets":r.dashboardData.widgets,"filter-u-rl":r.filterURl},null,8,["dashboard","widget","dashboard-widgets","filter-u-rl"]))),128)):(o.openBlock(),o.createBlock(c,{key:1,class:"flex flex-col",dashboard:n.id,widget:m.widget,"dashboard-widgets":r.dashboardData.widgets,"filter-u-rl":r.filterURl},null,8,["dashboard","widget","dashboard-widgets","filter-u-rl"]))],2)}),128))])])}const Io=E(Ao,[["render",Po]]),jo={name:"VsPivotTable",mixins:[A],data(){return{values:null,xs:null,products:null}},async mounted(){await this.getData(),this.prepareData()},methods:{onChangedData(){try{this.sourceData&&this.prepareData()}catch{}},prepareData(){try{const t=Array.from(new Set(this.sourceData.map(e=>e[this.dimensions[0]])));this.dimensions[0].includes("date")?this.xs=t.map(e=>v(e)):this.xs=[...t],this.products=this.dimensions.filter((e,n)=>n!=0),this.values=this.products.map((e,n)=>({name:e,data:this.sourceData.filter(s=>parseFloat(s[e])).map(s=>R(parseFloat(s[e])))}))}catch(t){console.error(t)}}}},Uo={class:"flex flex-col h-full p-5 space-y-4 rounded-xl custom-scrollbar"},qo={class:"overflow-x-auto [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 custom-scrollbar"},Ho={class:"inline-block min-w-full align-middle"},Wo={class:"min-w-full divide-y divide-gray-200"},Zo={class:"space-x-2"},Jo={scope:"col",class:"xl:min-w-[120px] min-w-48"},Go={class:"py-2.5 text-text-start flex items-center gap-x-1 text-sm font-normal text-gray-500"},Ko={class:"divide-y divide-gray-200 text-[12px]"},Qo={class:"py-3 size-px whitespace-nowrap"},vo={class:"flex items-center gap-x-3"},Xo={class:"font-medium text-gray-800"},Yo={class:"py-3 size-px whitespace-nowrap"},ei={class:"text-gray-600"};function ti(t,e,n,s,r,i){return o.openBlock(),o.createElementBlock("div",Uo,[o.createElementVNode("div",qo,[o.createElementVNode("div",Ho,[o.createElementVNode("table",Wo,[o.createElementVNode("thead",null,[o.createElementVNode("tr",Zo,[e[0]||(e[0]=o.createElementVNode("th",{scope:"col",class:"min-w-[200px]"},[o.createElementVNode("div",{class:"py-2.5 text-text-start flex items-center gap-x-1 text-sm font-normal text-gray-500"})],-1)),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.xs,a=>(o.openBlock(),o.createElementBlock("th",Jo,[o.createElementVNode("div",Go,o.toDisplayString(a),1)]))),256))])]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.values,a=>(o.openBlock(),o.createElementBlock("tbody",Ko,[o.createElementVNode("tr",null,[o.createElementVNode("td",Qo,[o.createElementVNode("div",vo,[o.createElementVNode("span",Xo,o.toDisplayString(a.name),1)])]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.xs,(l,c)=>(o.openBlock(),o.createElementBlock("td",Yo,[o.createElementVNode("span",ei,o.toDisplayString(a.data[c]),1)]))),256))])]))),256))])])])])}const Zt=E(jo,[["render",ti]]),ni=Object.freeze(Object.defineProperty({__proto__:null,default:Zt},Symbol.toStringTag,{value:"Module"})),si={name:"VsNumber",mixins:[A],data(){return{number:""}},computed:{formattedNumber(){return bn(this.number)},prefix(){var t,e;return(t=this.styleData)!=null&&t.prefix?(e=this.styleData)==null?void 0:e.prefix:""}},watch:{sourceData:{async handler(){this.getNumber()},deep:!0}},async mounted(){await this.getData(),this.getNumber()},methods:{onChangedData(){try{this.sourceData&&this.getNumber()}catch(t){console.error(t)}},async getNumber(){var t,e;try{this.number=((e=this.sourceData[0])==null?void 0:e[Object.keys((t=this.sourceData)==null?void 0:t[0])])||0}catch(n){console.error(n)}}}},ri={class:"text-lg lg:text-xl xl:text-2xl text-gray-800 h-[32px] flex items-center"};function oi(t,e,n,s,r,i){return o.openBlock(),o.createElementBlock("div",ri,o.toDisplayString(i.prefix)+o.toDisplayString(i.formattedNumber),1)}const ii=Object.freeze(Object.defineProperty({__proto__:null,default:E(si,[["render",oi]])},Symbol.toStringTag,{value:"Module"}));function Ue(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let J=Ue();function Jt(t){J=t}const Gt=/[&<>"']/,ai=new RegExp(Gt.source,"g"),Kt=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,li=new RegExp(Kt.source,"g"),ci={"&":"&","<":"<",">":">",'"':""","'":"'"},Qt=t=>ci[t];function M(t,e){if(e){if(Gt.test(t))return t.replace(ai,Qt)}else if(Kt.test(t))return t.replace(li,Qt);return t}const di=/(^|[^\[])\^/g;function B(t,e){let n=typeof t=="string"?t:t.source;e=e||"";const s={replace:(r,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(di,"$1"),n=n.replace(r,a),s},getRegex:()=>new RegExp(n,e)};return s}function vt(t){try{t=encodeURI(t).replace(/%25/g,"%")}catch{return null}return t}const re={exec:()=>null};function Xt(t,e){const n=t.replace(/\|/g,(i,a,l)=>{let c=!1,h=a;for(;--h>=0&&l[h]==="\\";)c=!c;return c?"|":" |"}),s=n.split(/ \|/);let r=0;if(s[0].trim()||s.shift(),s.length>0&&!s[s.length-1].trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;r<s.length;r++)s[r]=s[r].trim().replace(/\\\|/g,"|");return s}function oe(t,e,n){const s=t.length;if(s===0)return"";let r=0;for(;r<s&&t.charAt(s-r-1)===e;)r++;return t.slice(0,s-r)}function hi(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let s=0;s<t.length;s++)if(t[s]==="\\")s++;else if(t[s]===e[0])n++;else if(t[s]===e[1]&&(n--,n<0))return s;return-1}function Yt(t,e,n,s){const r=e.href,i=e.title?M(e.title):null,a=t[1].replace(/\\([\[\]])/g,"$1");if(t[0].charAt(0)!=="!"){s.state.inLink=!0;const l={type:"link",raw:n,href:r,title:i,text:a,tokens:s.inlineTokens(a)};return s.state.inLink=!1,l}return{type:"image",raw:n,href:r,title:i,text:M(a)}}function pi(t,e){const n=t.match(/^(\s+)(?:```)/);if(n===null)return e;const s=n[1];return e.split(`
|
|
26
26
|
`).map(r=>{const i=r.match(/^\s+/);if(i===null)return r;const[a]=i;return a.length>=s.length?r.slice(s.length):r}).join(`
|
|
27
|
-
`)}class
|
|
28
|
-
`)}}}fences(e){const n=this.rules.block.fences.exec(e);if(n){const s=n[0],r=
|
|
29
|
-
`)}}blockquote(e){const n=this.rules.block.blockquote.exec(e);if(n){let s=
|
|
27
|
+
`)}class _e{constructor(e){D(this,"options");D(this,"rules");D(this,"lexer");this.options=e||J}space(e){const n=this.rules.block.newline.exec(e);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(e){const n=this.rules.block.code.exec(e);if(n){const s=n[0].replace(/^(?: {1,4}| {0,3}\t)/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?s:oe(s,`
|
|
28
|
+
`)}}}fences(e){const n=this.rules.block.fences.exec(e);if(n){const s=n[0],r=pi(s,n[3]||"");return{type:"code",raw:s,lang:n[2]?n[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):n[2],text:r}}}heading(e){const n=this.rules.block.heading.exec(e);if(n){let s=n[2].trim();if(/#$/.test(s)){const r=oe(s,"#");(this.options.pedantic||!r||/ $/.test(r))&&(s=r.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:s,tokens:this.lexer.inline(s)}}}hr(e){const n=this.rules.block.hr.exec(e);if(n)return{type:"hr",raw:oe(n[0],`
|
|
29
|
+
`)}}blockquote(e){const n=this.rules.block.blockquote.exec(e);if(n){let s=oe(n[0],`
|
|
30
30
|
`).split(`
|
|
31
31
|
`),r="",i="";const a=[];for(;s.length>0;){let l=!1;const c=[];let h;for(h=0;h<s.length;h++)if(/^ {0,3}>/.test(s[h]))c.push(s[h]),l=!0;else if(!l)c.push(s[h]);else break;s=s.slice(h);const d=c.join(`
|
|
32
|
-
`),
|
|
32
|
+
`),p=d.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,`
|
|
33
33
|
$1`).replace(/^ {0,3}>[ \t]?/gm,"");r=r?`${r}
|
|
34
34
|
${d}`:d,i=i?`${i}
|
|
35
|
-
${
|
|
35
|
+
${p}`:p;const m=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,a,!0),this.lexer.state.top=m,s.length===0)break;const g=a[a.length-1];if((g==null?void 0:g.type)==="code")break;if((g==null?void 0:g.type)==="blockquote"){const u=g,b=u.raw+`
|
|
36
36
|
`+s.join(`
|
|
37
|
-
`),y=this.blockquote(
|
|
37
|
+
`),y=this.blockquote(b);a[a.length-1]=y,r=r.substring(0,r.length-u.raw.length)+y.raw,i=i.substring(0,i.length-u.text.length)+y.text;break}else if((g==null?void 0:g.type)==="list"){const u=g,b=u.raw+`
|
|
38
38
|
`+s.join(`
|
|
39
|
-
`),y=this.list(
|
|
40
|
-
`);continue}}return{type:"blockquote",raw:r,tokens:a,text:i}}}list(e){let n=this.rules.block.list.exec(e);if(n){let s=n[1].trim();const r=s.length>1,i={type:"list",raw:"",ordered:r,start:r?+s.slice(0,-1):"",loose:!1,items:[]};s=r?`\\d{1,9}\\${s.slice(-1)}`:`\\${s}`,this.options.pedantic&&(s=r?s:"[*+-]");const a=new RegExp(`^( {0,3}${s})((?:[ ][^\\n]*)?(?:\\n|$))`);let l=!1;for(;e;){let c=!1,h="",d="";if(!(n=a.exec(e))||this.rules.block.hr.test(e))break;h=n[0],e=e.substring(h.length);let
|
|
41
|
-
`,1)[0].replace(/^\t+/,
|
|
42
|
-
`,1)[0],
|
|
43
|
-
`,e=e.substring(m.length+1),c=!0),!c){const
|
|
44
|
-
`,1)[0];let
|
|
45
|
-
`+
|
|
46
|
-
`+m}!
|
|
47
|
-
`,e=e.substring(
|
|
48
|
-
`):[],a={type:"table",raw:n[0],header:[],align:[],rows:[]};if(s.length===r.length){for(const l of r)/^ *-+: *$/.test(l)?a.align.push("right"):/^ *:-+: *$/.test(l)?a.align.push("center"):/^ *:-+ *$/.test(l)?a.align.push("left"):a.align.push(null);for(let l=0;l<s.length;l++)a.header.push({text:s[l],tokens:this.lexer.inline(s[l]),header:!0,align:a.align[l]});for(const l of i)a.rows.push(
|
|
49
|
-
`?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:s,tokens:this.lexer.inline(s)}}}text(e){const n=this.rules.block.text.exec(e);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(e){const n=this.rules.inline.escape.exec(e);if(n)return{type:"escape",raw:n[0],text:M(n[1])}}tag(e){const n=this.rules.inline.tag.exec(e);if(n)return!this.lexer.state.inLink&&/^<a /i.test(n[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:n[0]}}link(e){const n=this.rules.inline.link.exec(e);if(n){const s=n[2].trim();if(!this.options.pedantic&&/^</.test(s)){if(!/>$/.test(s))return;const a=
|
|
50
|
-
]`).replace("lheading",
|
|
39
|
+
`),y=this.list(b);a[a.length-1]=y,r=r.substring(0,r.length-g.raw.length)+y.raw,i=i.substring(0,i.length-u.raw.length)+y.raw,s=b.substring(a[a.length-1].raw.length).split(`
|
|
40
|
+
`);continue}}return{type:"blockquote",raw:r,tokens:a,text:i}}}list(e){let n=this.rules.block.list.exec(e);if(n){let s=n[1].trim();const r=s.length>1,i={type:"list",raw:"",ordered:r,start:r?+s.slice(0,-1):"",loose:!1,items:[]};s=r?`\\d{1,9}\\${s.slice(-1)}`:`\\${s}`,this.options.pedantic&&(s=r?s:"[*+-]");const a=new RegExp(`^( {0,3}${s})((?:[ ][^\\n]*)?(?:\\n|$))`);let l=!1;for(;e;){let c=!1,h="",d="";if(!(n=a.exec(e))||this.rules.block.hr.test(e))break;h=n[0],e=e.substring(h.length);let p=n[2].split(`
|
|
41
|
+
`,1)[0].replace(/^\t+/,_=>" ".repeat(3*_.length)),m=e.split(`
|
|
42
|
+
`,1)[0],g=!p.trim(),u=0;if(this.options.pedantic?(u=2,d=p.trimStart()):g?u=n[1].length+1:(u=n[2].search(/[^ ]/),u=u>4?1:u,d=p.slice(u),u+=n[1].length),g&&/^[ \t]*$/.test(m)&&(h+=m+`
|
|
43
|
+
`,e=e.substring(m.length+1),c=!0),!c){const _=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),w=new RegExp(`^ {0,${Math.min(3,u-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),x=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:\`\`\`|~~~)`),N=new RegExp(`^ {0,${Math.min(3,u-1)}}#`),$=new RegExp(`^ {0,${Math.min(3,u-1)}}<(?:[a-z].*>|!--)`,"i");for(;e;){const S=e.split(`
|
|
44
|
+
`,1)[0];let F;if(m=S,this.options.pedantic?(m=m.replace(/^ {1,4}(?=( {4})*[^ ])/g," "),F=m):F=m.replace(/\t/g," "),x.test(m)||N.test(m)||$.test(m)||_.test(m)||w.test(m))break;if(F.search(/[^ ]/)>=u||!m.trim())d+=`
|
|
45
|
+
`+F.slice(u);else{if(g||p.replace(/\t/g," ").search(/[^ ]/)>=4||x.test(p)||N.test(p)||w.test(p))break;d+=`
|
|
46
|
+
`+m}!g&&!m.trim()&&(g=!0),h+=S+`
|
|
47
|
+
`,e=e.substring(S.length+1),p=F.slice(u)}}i.loose||(l?i.loose=!0:/\n[ \t]*\n[ \t]*$/.test(h)&&(l=!0));let b=null,y;this.options.gfm&&(b=/^\[[ xX]\] /.exec(d),b&&(y=b[0]!=="[ ] ",d=d.replace(/^\[[ xX]\] +/,""))),i.items.push({type:"list_item",raw:h,task:!!b,checked:y,loose:!1,text:d,tokens:[]}),i.raw+=h}i.items[i.items.length-1].raw=i.items[i.items.length-1].raw.trimEnd(),i.items[i.items.length-1].text=i.items[i.items.length-1].text.trimEnd(),i.raw=i.raw.trimEnd();for(let c=0;c<i.items.length;c++)if(this.lexer.state.top=!1,i.items[c].tokens=this.lexer.blockTokens(i.items[c].text,[]),!i.loose){const h=i.items[c].tokens.filter(p=>p.type==="space"),d=h.length>0&&h.some(p=>/\n.*\n/.test(p.raw));i.loose=d}if(i.loose)for(let c=0;c<i.items.length;c++)i.items[c].loose=!0;return i}}html(e){const n=this.rules.block.html.exec(e);if(n)return{type:"html",block:!0,raw:n[0],pre:n[1]==="pre"||n[1]==="script"||n[1]==="style",text:n[0]}}def(e){const n=this.rules.block.def.exec(e);if(n){const s=n[1].toLowerCase().replace(/\s+/g," "),r=n[2]?n[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):n[3];return{type:"def",tag:s,raw:n[0],href:r,title:i}}}table(e){const n=this.rules.block.table.exec(e);if(!n||!/[:|]/.test(n[2]))return;const s=Xt(n[1]),r=n[2].replace(/^\||\| *$/g,"").split("|"),i=n[3]&&n[3].trim()?n[3].replace(/\n[ \t]*$/,"").split(`
|
|
48
|
+
`):[],a={type:"table",raw:n[0],header:[],align:[],rows:[]};if(s.length===r.length){for(const l of r)/^ *-+: *$/.test(l)?a.align.push("right"):/^ *:-+: *$/.test(l)?a.align.push("center"):/^ *:-+ *$/.test(l)?a.align.push("left"):a.align.push(null);for(let l=0;l<s.length;l++)a.header.push({text:s[l],tokens:this.lexer.inline(s[l]),header:!0,align:a.align[l]});for(const l of i)a.rows.push(Xt(l,a.header.length).map((c,h)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:a.align[h]})));return a}}lheading(e){const n=this.rules.block.lheading.exec(e);if(n)return{type:"heading",raw:n[0],depth:n[2].charAt(0)==="="?1:2,text:n[1],tokens:this.lexer.inline(n[1])}}paragraph(e){const n=this.rules.block.paragraph.exec(e);if(n){const s=n[1].charAt(n[1].length-1)===`
|
|
49
|
+
`?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:s,tokens:this.lexer.inline(s)}}}text(e){const n=this.rules.block.text.exec(e);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(e){const n=this.rules.inline.escape.exec(e);if(n)return{type:"escape",raw:n[0],text:M(n[1])}}tag(e){const n=this.rules.inline.tag.exec(e);if(n)return!this.lexer.state.inLink&&/^<a /i.test(n[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:n[0]}}link(e){const n=this.rules.inline.link.exec(e);if(n){const s=n[2].trim();if(!this.options.pedantic&&/^</.test(s)){if(!/>$/.test(s))return;const a=oe(s.slice(0,-1),"\\");if((s.length-a.length)%2===0)return}else{const a=hi(n[2],"()");if(a>-1){const c=(n[0].indexOf("!")===0?5:4)+n[1].length+a;n[2]=n[2].substring(0,a),n[0]=n[0].substring(0,c).trim(),n[3]=""}}let r=n[2],i="";if(this.options.pedantic){const a=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r);a&&(r=a[1],i=a[3])}else i=n[3]?n[3].slice(1,-1):"";return r=r.trim(),/^</.test(r)&&(this.options.pedantic&&!/>$/.test(s)?r=r.slice(1):r=r.slice(1,-1)),Yt(n,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},n[0],this.lexer)}}reflink(e,n){let s;if((s=this.rules.inline.reflink.exec(e))||(s=this.rules.inline.nolink.exec(e))){const r=(s[2]||s[1]).replace(/\s+/g," "),i=n[r.toLowerCase()];if(!i){const a=s[0].charAt(0);return{type:"text",raw:a,text:a}}return Yt(s,i,s[0],this.lexer)}}emStrong(e,n,s=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||r[3]&&s.match(/[\p{L}\p{N}]/u))return;if(!(r[1]||r[2]||"")||!s||this.rules.inline.punctuation.exec(s)){const a=[...r[0]].length-1;let l,c,h=a,d=0;const p=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,n=n.slice(-1*e.length+a);(r=p.exec(n))!=null;){if(l=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!l)continue;if(c=[...l].length,r[3]||r[4]){h+=c;continue}else if((r[5]||r[6])&&a%3&&!((a+c)%3)){d+=c;continue}if(h-=c,h>0)continue;c=Math.min(c,c+h+d);const m=[...r[0]][0].length,g=e.slice(0,a+r.index+m+c);if(Math.min(a,c)%2){const b=g.slice(1,-1);return{type:"em",raw:g,text:b,tokens:this.lexer.inlineTokens(b)}}const u=g.slice(2,-2);return{type:"strong",raw:g,text:u,tokens:this.lexer.inlineTokens(u)}}}}codespan(e){const n=this.rules.inline.code.exec(e);if(n){let s=n[2].replace(/\n/g," ");const r=/[^ ]/.test(s),i=/^ /.test(s)&&/ $/.test(s);return r&&i&&(s=s.substring(1,s.length-1)),s=M(s,!0),{type:"codespan",raw:n[0],text:s}}}br(e){const n=this.rules.inline.br.exec(e);if(n)return{type:"br",raw:n[0]}}del(e){const n=this.rules.inline.del.exec(e);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(e){const n=this.rules.inline.autolink.exec(e);if(n){let s,r;return n[2]==="@"?(s=M(n[1]),r="mailto:"+s):(s=M(n[1]),r=s),{type:"link",raw:n[0],text:s,href:r,tokens:[{type:"text",raw:s,text:s}]}}}url(e){var s;let n;if(n=this.rules.inline.url.exec(e)){let r,i;if(n[2]==="@")r=M(n[0]),i="mailto:"+r;else{let a;do a=n[0],n[0]=((s=this.rules.inline._backpedal.exec(n[0]))==null?void 0:s[0])??"";while(a!==n[0]);r=M(n[0]),n[1]==="www."?i="http://"+n[0]:i=n[0]}return{type:"link",raw:n[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){const n=this.rules.inline.text.exec(e);if(n){let s;return this.lexer.state.inRawBlock?s=n[0]:s=M(n[0]),{type:"text",raw:n[0],text:s}}}}const ui=/^(?:[ \t]*(?:\n|$))+/,fi=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,mi=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ie=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,gi=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,en=/(?:[*+-]|\d{1,9}[.)])/,tn=B(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,en).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),qe=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,bi=/^[^\n]+/,He=/(?!\s*\])(?:\\.|[^\[\]\\])+/,yi=B(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",He).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),xi=B(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,en).getRegex(),Ee="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",We=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,wi=B("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",We).replace("tag",Ee).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),nn=B(qe).replace("hr",ie).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ee).getRegex(),Ze={blockquote:B(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",nn).getRegex(),code:fi,def:yi,fences:mi,heading:gi,hr:ie,html:wi,lheading:tn,list:xi,newline:ui,paragraph:nn,table:re,text:bi},sn=B("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ie).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ee).getRegex(),ki={...Ze,table:sn,paragraph:B(qe).replace("hr",ie).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",sn).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ee).getRegex()},_i={...Ze,html:B(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",We).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:re,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:B(qe).replace("hr",ie).replace("heading",` *#{1,6} *[^
|
|
50
|
+
]`).replace("lheading",tn).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},rn=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ei=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,on=/^( {2,}|\\)\n(?!\s*$)/,Si=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ae="\\p{P}\\p{S}",$i=B(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,ae).getRegex(),Ci=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Bi=B(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,ae).getRegex(),Di=B("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,ae).getRegex(),Ni=B("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,ae).getRegex(),Vi=B(/\\([punct])/,"gu").replace(/punct/g,ae).getRegex(),Ti=B(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Ri=B(We).replace("(?:-->|$)","-->").getRegex(),zi=B("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Ri).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Se=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Li=B(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Se).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),an=B(/^!?\[(label)\]\[(ref)\]/).replace("label",Se).replace("ref",He).getRegex(),ln=B(/^!?\[(ref)\](?:\[\])?/).replace("ref",He).getRegex(),Oi=B("reflink|nolink(?!\\()","g").replace("reflink",an).replace("nolink",ln).getRegex(),Je={_backpedal:re,anyPunctuation:Vi,autolink:Ti,blockSkip:Ci,br:on,code:Ei,del:re,emStrongLDelim:Bi,emStrongRDelimAst:Di,emStrongRDelimUnd:Ni,escape:rn,link:Li,nolink:ln,punctuation:$i,reflink:an,reflinkSearch:Oi,tag:zi,text:Si,url:re},Ai={...Je,link:B(/^!?\[(label)\]\((.*?)\)/).replace("label",Se).getRegex(),reflink:B(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Se).getRegex()},Ge={...Je,escape:B(rn).replace("])","~|])").getRegex(),url:B(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Fi={...Ge,br:B(on).replace("{2,}","*").getRegex(),text:B(Ge.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},$e={normal:Ze,gfm:ki,pedantic:_i},le={normal:Je,gfm:Ge,breaks:Fi,pedantic:Ai};class P{constructor(e){D(this,"tokens");D(this,"options");D(this,"state");D(this,"tokenizer");D(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||J,this.options.tokenizer=this.options.tokenizer||new _e,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const n={block:$e.normal,inline:le.normal};this.options.pedantic?(n.block=$e.pedantic,n.inline=le.pedantic):this.options.gfm&&(n.block=$e.gfm,this.options.breaks?n.inline=le.breaks:n.inline=le.gfm),this.tokenizer.rules=n}static get rules(){return{block:$e,inline:le}}static lex(e,n){return new P(n).lex(e)}static lexInline(e,n){return new P(n).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,`
|
|
51
51
|
`),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){const s=this.inlineQueue[n];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],s=!1){this.options.pedantic&&(e=e.replace(/\t/g," ").replace(/^ +$/gm,""));let r,i,a;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(l=>(r=l.call({lexer:this},e,n))?(e=e.substring(r.raw.length),n.push(r),!0):!1))){if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length),r.raw.length===1&&n.length>0?n[n.length-1].raw+=`
|
|
52
52
|
`:n.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length),i=n[n.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
|
|
53
53
|
`+r.raw,i.text+=`
|
|
@@ -57,7 +57,7 @@ ${u}`:u;const m=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.block
|
|
|
57
57
|
`+r.raw,i.text+=`
|
|
58
58
|
`+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):n.push(r),s=a.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length),i=n[n.length-1],i&&i.type==="text"?(i.raw+=`
|
|
59
59
|
`+r.raw,i.text+=`
|
|
60
|
-
`+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):n.push(r);continue}if(e){const l="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){let s,r,i,a=e,l,c,h;if(this.tokens.links){const d=Object.keys(this.tokens.links);if(d.length>0)for(;(l=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null;)d.includes(l[0].slice(l[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,l.index)+"["+"a".repeat(l[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(l=this.tokenizer.rules.inline.blockSkip.exec(a))!=null;)a=a.slice(0,l.index)+"["+"a".repeat(l[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(l=this.tokenizer.rules.inline.anyPunctuation.exec(a))!=null;)a=a.slice(0,l.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(c||(h=""),c=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(d=>(s=d.call({lexer:this},e,n))?(e=e.substring(s.raw.length),n.push(s),!0):!1))){if(s=this.tokenizer.escape(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.tag(e)){e=e.substring(s.raw.length),r=n[n.length-1],r&&s.type==="text"&&r.type==="text"?(r.raw+=s.raw,r.text+=s.text):n.push(s);continue}if(s=this.tokenizer.link(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(s.raw.length),r=n[n.length-1],r&&s.type==="text"&&r.type==="text"?(r.raw+=s.raw,r.text+=s.text):n.push(s);continue}if(s=this.tokenizer.emStrong(e,a,h)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.codespan(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.br(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.del(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.autolink(e)){e=e.substring(s.raw.length),n.push(s);continue}if(!this.state.inLink&&(s=this.tokenizer.url(e))){e=e.substring(s.raw.length),n.push(s);continue}if(i=e,this.options.extensions&&this.options.extensions.startInline){let d=1/0;const
|
|
60
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):n.push(r);continue}if(e){const l="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){let s,r,i,a=e,l,c,h;if(this.tokens.links){const d=Object.keys(this.tokens.links);if(d.length>0)for(;(l=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null;)d.includes(l[0].slice(l[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,l.index)+"["+"a".repeat(l[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(l=this.tokenizer.rules.inline.blockSkip.exec(a))!=null;)a=a.slice(0,l.index)+"["+"a".repeat(l[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(l=this.tokenizer.rules.inline.anyPunctuation.exec(a))!=null;)a=a.slice(0,l.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(c||(h=""),c=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(d=>(s=d.call({lexer:this},e,n))?(e=e.substring(s.raw.length),n.push(s),!0):!1))){if(s=this.tokenizer.escape(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.tag(e)){e=e.substring(s.raw.length),r=n[n.length-1],r&&s.type==="text"&&r.type==="text"?(r.raw+=s.raw,r.text+=s.text):n.push(s);continue}if(s=this.tokenizer.link(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(s.raw.length),r=n[n.length-1],r&&s.type==="text"&&r.type==="text"?(r.raw+=s.raw,r.text+=s.text):n.push(s);continue}if(s=this.tokenizer.emStrong(e,a,h)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.codespan(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.br(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.del(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.autolink(e)){e=e.substring(s.raw.length),n.push(s);continue}if(!this.state.inLink&&(s=this.tokenizer.url(e))){e=e.substring(s.raw.length),n.push(s);continue}if(i=e,this.options.extensions&&this.options.extensions.startInline){let d=1/0;const p=e.slice(1);let m;this.options.extensions.startInline.forEach(g=>{m=g.call({lexer:this},p),typeof m=="number"&&m>=0&&(d=Math.min(d,m))}),d<1/0&&d>=0&&(i=e.substring(0,d+1))}if(s=this.tokenizer.inlineText(i)){e=e.substring(s.raw.length),s.raw.slice(-1)!=="_"&&(h=s.raw.slice(-1)),c=!0,r=n[n.length-1],r&&r.type==="text"?(r.raw+=s.raw,r.text+=s.text):n.push(s);continue}if(e){const d="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(d);break}else throw new Error(d)}}return n}}class Ce{constructor(e){D(this,"options");D(this,"parser");this.options=e||J}space(e){return""}code({text:e,lang:n,escaped:s}){var a;const r=(a=(n||"").match(/^\S*/))==null?void 0:a[0],i=e.replace(/\n$/,"")+`
|
|
61
61
|
`;return r?'<pre><code class="language-'+M(r)+'">'+(s?i:M(i,!0))+`</code></pre>
|
|
62
62
|
`:"<pre><code>"+(s?i:M(i,!0))+`</code></pre>
|
|
63
63
|
`}blockquote({tokens:e}){return`<blockquote>
|
|
@@ -75,12 +75,12 @@ ${this.parser.parse(e)}</blockquote>
|
|
|
75
75
|
`}tablerow({text:e}){return`<tr>
|
|
76
76
|
${e}</tr>
|
|
77
77
|
`}tablecell(e){const n=this.parser.parseInline(e.tokens),s=e.header?"th":"td";return(e.align?`<${s} align="${e.align}">`:`<${s}>`)+n+`</${s}>
|
|
78
|
-
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${e}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:n,tokens:s}){const r=this.parser.parseInline(s),i=
|
|
79
|
-
`+this.renderer.text(l);n?s+=this.renderer.paragraph({type:"paragraph",raw:c,text:c,tokens:[{type:"text",raw:c,text:c}]}):s+=c;continue}default:{const l='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return s}parseInline(e,n){n=n||this.renderer;let s="";for(let r=0;r<e.length;r++){const i=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const l=this.options.extensions.renderers[i.type].call({parser:this},i);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){s+=l||"";continue}}const a=i;switch(a.type){case"escape":{s+=n.text(a);break}case"html":{s+=n.html(a);break}case"link":{s+=n.link(a);break}case"image":{s+=n.image(a);break}case"strong":{s+=n.strong(a);break}case"em":{s+=n.em(a);break}case"codespan":{s+=n.codespan(a);break}case"br":{s+=n.br(a);break}case"del":{s+=n.del(a);break}case"text":{s+=n.text(a);break}default:{const l='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return s}}class
|
|
80
|
-
Please report this to https://github.com/markedjs/marked.`,e){const r="<p>An error occurred:</p><pre>"+M(s.message+"",!0)+"</pre>";return n?Promise.resolve(r):r}if(n)return Promise.reject(s);throw s}}}const
|
|
78
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${e}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:n,tokens:s}){const r=this.parser.parseInline(s),i=vt(e);if(i===null)return r;e=i;let a='<a href="'+e+'"';return n&&(a+=' title="'+n+'"'),a+=">"+r+"</a>",a}image({href:e,title:n,text:s}){const r=vt(e);if(r===null)return s;e=r;let i=`<img src="${e}" alt="${s}"`;return n&&(i+=` title="${n}"`),i+=">",i}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):e.text}}class Ke{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}}class I{constructor(e){D(this,"options");D(this,"renderer");D(this,"textRenderer");this.options=e||J,this.options.renderer=this.options.renderer||new Ce,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ke}static parse(e,n){return new I(n).parse(e)}static parseInline(e,n){return new I(n).parseInline(e)}parse(e,n=!0){let s="";for(let r=0;r<e.length;r++){const i=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const l=i,c=this.options.extensions.renderers[l.type].call({parser:this},l);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(l.type)){s+=c||"";continue}}const a=i;switch(a.type){case"space":{s+=this.renderer.space(a);continue}case"hr":{s+=this.renderer.hr(a);continue}case"heading":{s+=this.renderer.heading(a);continue}case"code":{s+=this.renderer.code(a);continue}case"table":{s+=this.renderer.table(a);continue}case"blockquote":{s+=this.renderer.blockquote(a);continue}case"list":{s+=this.renderer.list(a);continue}case"html":{s+=this.renderer.html(a);continue}case"paragraph":{s+=this.renderer.paragraph(a);continue}case"text":{let l=a,c=this.renderer.text(l);for(;r+1<e.length&&e[r+1].type==="text";)l=e[++r],c+=`
|
|
79
|
+
`+this.renderer.text(l);n?s+=this.renderer.paragraph({type:"paragraph",raw:c,text:c,tokens:[{type:"text",raw:c,text:c}]}):s+=c;continue}default:{const l='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return s}parseInline(e,n){n=n||this.renderer;let s="";for(let r=0;r<e.length;r++){const i=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const l=this.options.extensions.renderers[i.type].call({parser:this},i);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){s+=l||"";continue}}const a=i;switch(a.type){case"escape":{s+=n.text(a);break}case"html":{s+=n.html(a);break}case"link":{s+=n.link(a);break}case"image":{s+=n.image(a);break}case"strong":{s+=n.strong(a);break}case"em":{s+=n.em(a);break}case"codespan":{s+=n.codespan(a);break}case"br":{s+=n.br(a);break}case"del":{s+=n.del(a);break}case"text":{s+=n.text(a);break}default:{const l='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return s}}class ce{constructor(e){D(this,"options");D(this,"block");this.options=e||J}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?P.lex:P.lexInline}provideParser(){return this.block?I.parse:I.parseInline}}D(ce,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));class Mi{constructor(...e){D(this,"defaults",Ue());D(this,"options",this.setOptions);D(this,"parse",this.parseMarkdown(!0));D(this,"parseInline",this.parseMarkdown(!1));D(this,"Parser",I);D(this,"Renderer",Ce);D(this,"TextRenderer",Ke);D(this,"Lexer",P);D(this,"Tokenizer",_e);D(this,"Hooks",ce);this.use(...e)}walkTokens(e,n){var r,i;let s=[];for(const a of e)switch(s=s.concat(n.call(this,a)),a.type){case"table":{const l=a;for(const c of l.header)s=s.concat(this.walkTokens(c.tokens,n));for(const c of l.rows)for(const h of c)s=s.concat(this.walkTokens(h.tokens,n));break}case"list":{const l=a;s=s.concat(this.walkTokens(l.items,n));break}default:{const l=a;(i=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&i[l.type]?this.defaults.extensions.childTokens[l.type].forEach(c=>{const h=l[c].flat(1/0);s=s.concat(this.walkTokens(h,n))}):l.tokens&&(s=s.concat(this.walkTokens(l.tokens,n)))}}return s}use(...e){const n=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(s=>{const r={...s};if(r.async=this.defaults.async||r.async||!1,s.extensions&&(s.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){const a=n.renderers[i.name];a?n.renderers[i.name]=function(...l){let c=i.renderer.apply(this,l);return c===!1&&(c=a.apply(this,l)),c}:n.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const a=n[i.level];a?a.unshift(i.tokenizer):n[i.level]=[i.tokenizer],i.start&&(i.level==="block"?n.startBlock?n.startBlock.push(i.start):n.startBlock=[i.start]:i.level==="inline"&&(n.startInline?n.startInline.push(i.start):n.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(n.childTokens[i.name]=i.childTokens)}),r.extensions=n),s.renderer){const i=this.defaults.renderer||new Ce(this.defaults);for(const a in s.renderer){if(!(a in i))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;const l=a,c=s.renderer[l],h=i[l];i[l]=(...d)=>{let p=c.apply(i,d);return p===!1&&(p=h.apply(i,d)),p||""}}r.renderer=i}if(s.tokenizer){const i=this.defaults.tokenizer||new _e(this.defaults);for(const a in s.tokenizer){if(!(a in i))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;const l=a,c=s.tokenizer[l],h=i[l];i[l]=(...d)=>{let p=c.apply(i,d);return p===!1&&(p=h.apply(i,d)),p}}r.tokenizer=i}if(s.hooks){const i=this.defaults.hooks||new ce;for(const a in s.hooks){if(!(a in i))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;const l=a,c=s.hooks[l],h=i[l];ce.passThroughHooks.has(a)?i[l]=d=>{if(this.defaults.async)return Promise.resolve(c.call(i,d)).then(m=>h.call(i,m));const p=c.call(i,d);return h.call(i,p)}:i[l]=(...d)=>{let p=c.apply(i,d);return p===!1&&(p=h.apply(i,d)),p}}r.hooks=i}if(s.walkTokens){const i=this.defaults.walkTokens,a=s.walkTokens;r.walkTokens=function(l){let c=[];return c.push(a.call(this,l)),i&&(c=c.concat(i.call(this,l))),c}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,n){return P.lex(e,n??this.defaults)}parser(e,n){return I.parse(e,n??this.defaults)}parseMarkdown(e){return(s,r)=>{const i={...r},a={...this.defaults,...i},l=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&i.async===!1)return l(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof s>"u"||s===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof s!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(s)+", string expected"));a.hooks&&(a.hooks.options=a,a.hooks.block=e);const c=a.hooks?a.hooks.provideLexer():e?P.lex:P.lexInline,h=a.hooks?a.hooks.provideParser():e?I.parse:I.parseInline;if(a.async)return Promise.resolve(a.hooks?a.hooks.preprocess(s):s).then(d=>c(d,a)).then(d=>a.hooks?a.hooks.processAllTokens(d):d).then(d=>a.walkTokens?Promise.all(this.walkTokens(d,a.walkTokens)).then(()=>d):d).then(d=>h(d,a)).then(d=>a.hooks?a.hooks.postprocess(d):d).catch(l);try{a.hooks&&(s=a.hooks.preprocess(s));let d=c(s,a);a.hooks&&(d=a.hooks.processAllTokens(d)),a.walkTokens&&this.walkTokens(d,a.walkTokens);let p=h(d,a);return a.hooks&&(p=a.hooks.postprocess(p)),p}catch(d){return l(d)}}}onError(e,n){return s=>{if(s.message+=`
|
|
80
|
+
Please report this to https://github.com/markedjs/marked.`,e){const r="<p>An error occurred:</p><pre>"+M(s.message+"",!0)+"</pre>";return n?Promise.resolve(r):r}if(n)return Promise.reject(s);throw s}}}const G=new Mi;function C(t,e){return G.parse(t,e)}C.options=C.setOptions=function(t){return G.setOptions(t),C.defaults=G.defaults,Jt(C.defaults),C},C.getDefaults=Ue,C.defaults=J,C.use=function(...t){return G.use(...t),C.defaults=G.defaults,Jt(C.defaults),C},C.walkTokens=function(t,e){return G.walkTokens(t,e)},C.parseInline=G.parseInline,C.Parser=I,C.parser=I.parse,C.Renderer=Ce,C.TextRenderer=Ke,C.Lexer=P,C.lexer=P.lex,C.Tokenizer=_e,C.Hooks=ce,C.parse=C,C.options,C.setOptions,C.use,C.walkTokens,C.parseInline,I.parse,P.lex;const Pi={name:"VsText",mixins:[A],data(){return{markedText:null,uniqueID:null}},async mounted(){this.uniqueID=this.widget;try{await this.getData(),this.markedText=C(this.sourceData)}catch(t){console.error(t)}},methods:{onChangedData(){return null}}},Ii=["id"],ji=["innerHTML"];function Ui(t,e,n,s,r,i){return o.openBlock(),o.createElementBlock("div",{id:r.uniqueID,class:"relative select-auto h-full rounded-xl text-[12px] box-border bg-white custom-scrollbar text-widget"},[r.markedText?(o.openBlock(),o.createElementBlock("div",{key:0,innerHTML:r.markedText},null,8,ji)):o.createCommentVNode("",!0)],8,Ii)}const qi=Object.freeze(Object.defineProperty({__proto__:null,default:E(Pi,[["render",Ui]])},Symbol.toStringTag,{value:"Module"})),Hi={name:"VsFunnelBar",mixins:[A],data(){return{chartInstance:null,uniqueID:null}},async mounted(){this.uniqueID=this.widget,await this.$nextTick(),await this.getData();const{series:t}=this.prepareData();t&&this.initChart(t)},methods:{buildTooltipForDonut(t,e){const{name:n,value:s,percent:r}=t;return`
|
|
81
81
|
<div style="background-color:${e[0]};font-size: 12px; font-family: Helvetica, Arial, sans-serif;color:#ffff; padding:5px; border-radius:5px; ![box-shadow:none]">
|
|
82
|
-
${
|
|
83
|
-
</div>`},onChangedData(){try{if(this.sourceData){const{series:t,xs:e,ys:n}=this.prepareData();t&&(this==null||this.initChart(t,e,n))}}catch{}},prepareData(){try{const t=Array.from(new Set(this.sourceData.map(r=>r[this.dimensions[0]]))),e=Array.from(new Set(this.sourceData.map(r=>r[this.dimensions[1]]))),n=t.map((r,i)=>({name:r,value:e[i]}));return{series:[{name:this.titleCharts?this.titleCharts:this.dimensions[0],type:"funnel",...K(this.styleData),data:n,height:"80%",emphasis:{label:{show:!1}}}]}}catch(t){console.error(t)}},async initChart(t){try{const e=this.$refs.chart,n=echarts.init(e),s={series:t,...K(this.styleData),tooltip:{trigger:"item",formatter:r=>this.buildTooltipForDonut(r,[r.color]),borderWidth:0,appendToBody:!0,borderColor:"transparent",textStyle:{color:"#000"},padding:[10,15],shadowColor:"transparent",backgroundColor:"transparent"},itemStyle:{height:"15px"},legend:{borderRadius:10,type:"scroll",itemWidth:14,itemHeight:14,...this.styleData.legend},labelLine:{show:!1},grid:{bottom:"0"}};n.setOption(s),n.resize(),window.addEventListener("resize",()=>{n.resize()})}catch(e){console.error(e)}}}},oa=["id"];function ia(t,e,n,s,r,i){return o.openBlock(),o.createElementBlock("div",{ref:"chart",id:r.uniqueID,class:"h-[90%] custom-scrollbar min-h-[200px]"},null,8,oa)}const aa=Object.freeze(Object.defineProperty({__proto__:null,default:_(ra,[["render",ia]])},Symbol.toStringTag,{value:"Module"}));function la(t){return[{type:"fill",paint:{"fill-color":t.color||"#ccc","fill-outline-color":t.color||"blue","fill-opacity":t.opacity||1}}]}function ca(t){return[{type:"line",paint:{"line-color":t.color||"#ccc","line-opacity":t.opacity||1}}]}function da(t){return[{type:"circle",paint:{"circle-radius":t.radius||6,"circle-stroke-color":t.stroke||"#ccc","circle-stroke-width":t.width||1,"circle-color":t.color||"blue"}}]}function xn(t){if(!t)return null;const e=t.type||"point";return e==="polygon"?la(t):e==="line"?ca(t):da(t)}const nt={data(){return{layerList:[],activeLayer:""}},computed:{interactiveSources(){return this.layerList.filter(t=>t==null?void 0:t.interactive).map(t=>t.id)}},methods:{moveLayer(t,e=this.map){e.getStyle().layers.forEach(n=>{n.id.match(t)&&e.moveLayer(n.id)})},async setVisible(t,e=!0,n=this.map){if(!t)return;const s=(t==null?void 0:t.id)||t,r=this.layerList.find(a=>a.id===t)||t;if(!(r!=null&&r.id))throw new Error("MixinError: Layer has no id");const i=n.getStyle().layers.filter(a=>a.id.match(s));i.forEach(a=>{n.setLayoutProperty(a.id,"visibility",e?"visible":"none")}),!i.length&&e&&await this.addLayer(r)},async addLayer(t,e=this==null?void 0:this.map){var r,i;const n=this.layerList.find(a=>a.id===t)||t;!this.map.getStyle()||this.map.getStyle().layers.find(a=>a.id===n.id)||(this.layerList.find(a=>a.id===n.id)||this.layerList.push(n),(n.service==="vtile"||n.service==="vector"||(r=n.url)!=null&&r.includes(".vmt"))&&this.addVtileLayer(n,e),n.service==="geojson"&&this.addGeoJsonLayer(n,e),((i=n.url)!=null&&i.includes(".png")||["tms","raster"].includes(n.service))&&await this.addRasterLayer(n,e))},async addRasterLayer(t,e=this==null?void 0:this.map){var n,s;e.getSource(t.id)||(await e.addSource(t.id,{type:"raster",tiles:[t==null?void 0:t.url],tileSize:256,...t!=null&&t.scheme?{scheme:t==null?void 0:t.scheme}:{}}),await e.addLayer({id:t.id,type:"raster",source:t.id,minzoom:0,maxzoom:(t==null?void 0:t.maxzoom)||22},t.basemap?(s=(n=this.map.getStyle().layers)==null?void 0:n[0])==null?void 0:s.id:null))},async addVtileLayer(t,e=this==null?void 0:this.map){var i;const n=["props","pointZoom"].filter(a=>t[a]).map(a=>`&${a}=${t[a]}`),s={type:"vector",tiles:[`${(i=t==null?void 0:t.url)!=null&&i.startsWith("http")?"":window.location.origin}${t==null?void 0:t.url}${n}`],minzoom:t.minzoom||3,maxzoom:t.maxzoom||24};e.addSource(t.id,s),(xn(t.style)||t.layers||[]).forEach((a,l)=>{const c={...a,id:`${t.id}-${l}`,source:t.id,"source-layer":a["source-layer"]||t.source||t.id,maxzoom:+a.maxzoom||24,minzoom:+a.minzoom||0};e.addLayer(c)})},async addGeoJsonLayer(t,e=this.map){var r;const n=t.data||((r=t==null?void 0:t.url)!=null&&r.startsWith("http")?"":window.location.origin)+t.url;e.addSource(t.id,{type:"geojson",data:n}),(xn(t.style)||t.layers||[]).forEach(i=>{const a={...i,source:t.id,id:i.id||t.id,maxzoom:+i.maxzoom||24,minzoom:+i.minzoom||0,type:i.type||"circle"};e.addLayer(a)})},setLayerData(t,e){this.layerList=this.layerList.map(n=>n.id===t?{...n,...e}:n)},async removeLayer(t,e=this.map){e.getSource(t)&&(await e.getStyle().layers.forEach(async n=>{n.source===t&&await e.removeLayer(n.id)}),await e.removeSource(t))},async setFilter(t,e){var r;const n=this.layerList.find(i=>i.id===t),s=await((r=this.map)==null?void 0:r.getSource(t));if(s&&n.service==="vtile"){await s.setTiles([`${window.location.origin}${n.url}${n.url.includes("?")?"&":"?"}filter=${e}${n.props?`&props=${n.props}`:""}`]);return}s&&n.service},async changeBaseLayer(t){const e=t!=null&&t.id?t:this.layerList.find(s=>s.id===t),{id:n}=e;if(n&&n!==this.activeLayer){if(this.activeLayer&&this.map.setLayoutProperty(this.activeLayer,"visibility","none"),this.activeLayer=n,this.map.getLayer(n)){this.map.setLayoutProperty(n,"visibility","visible");return}await this.addRasterLayer(e)}},async refreshLayer(t,e=this.map){await e.getStyle().layers.forEach(n=>{n.source===t&&e.removeLayer(n.id)}),await e.removeSource(t),this.setVisible(t)}}},ha={},pa={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-list-details"};function ua(t,e){return o.openBlock(),o.createElementBlock("svg",pa,[...e[0]||(e[0]=[o.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M13 5h8"></path><path d="M13 9h5"></path><path d="M13 15h8"></path><path d="M13 19h5"></path><path d="M3 4m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z"></path><path d="M3 14m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z"></path>',7)])])}const st=_(ha,[["render",ua]]),fa={},ma={class:"shrink-0 size-3",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"};function ga(t,e){return o.openBlock(),o.createElementBlock("svg",ma,[...e[0]||(e[0]=[o.createElementVNode("path",{d:"M18 6 6 18"},null,-1),o.createElementVNode("path",{d:"m6 6 12 12"},null,-1)])])}const rt=_(fa,[["render",ga]]),ot={pink:["#fde7e2","#feafbe","#fd58a4","#d7038e","#86007b"],blue:["#f1eef6","#bdc9e1","#74a9cf","#2b8cbe","#045a8d"],green:["#edf8fb","#b2e2e2","#66c2a4","#2ca25f","#006d2c"],pink2:["#f1eef6","#d7b5d8","#df65b0","#dd1c77","#980043"],red:["#fef0d9","#fdcc8a","#fc8d59","#e34a33","#b30000"],teal:["#f6eff7","#bdc9e1","#67a9cf","#1c9099","#016c59"]},ba={components:{legendIcon:st,closeIcon:rt},props:{mapId:{type:String},colors:{type:Array},sizes:{type:Array,default:()=>[]},cluster:{type:[Boolean,String]},color:{type:String,default:"gray"},colorTitle:{type:String},sizesTitle:{type:String},resizeItem:{type:[Boolean,String],default:!1},changeOpacityItem:{type:[Boolean,String],default:!1}},data(){return{isOpenLegend:!1,palette:ot}},computed:{borderRadius(){return this.cluster?"rounded-sm":"rounded-full"},sortedSizes(){return[...this.sizes].sort((t,e)=>t-e)},maxWidht(){var n;const t=((n=this.sizes)==null?void 0:n.length)-1;return this.calcSize(t)}},methods:{sizeClass(t){return this.resizeItem?`h-[${this.calcSize(t)}] w-[${this.calcSize(t)}] ${this.borderRadius}`:`h-[18px] w-[18px] ${this.borderRadius}`},calcSize(t){return`${10+t*2}px`},getOpacity(t){return(t+1)/this.sortedSizes.length}}},ya={class:"w-full absolute max-w-[200px] bg-white border rounded-lg bottom-[10px] right-[50px]"},xa={class:"flex items-center justify-between border-b border-[#0000001A] px-2"},wa={class:"w-full flex flex-col gap-[8px] px-2 py-2 max-h-[200px] overflow-auto [&::-webkit-scrollbar]:h-1.5 [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-gray-300 [&::-webkit-scrollbar-track]:bg-transparent"},ka={key:0,class:"flex flex-col w-full"},_a={key:0,class:"text-xs font-semibold leading-[1.2] text-[#1F2937] mb-[8px]"},Ea={class:"flex flex-col gap-[6px]"},Sa={class:"text-xs text-[#1F2937] font-normal leading-[1.2]"},$a={key:1,class:"flex flex-col w-full"},Ca={key:0,class:"text-xs font-semibold leading-[1.2] text-[#1F2937] mb-[8px]"},Ba={class:"flex flex-col gap-[6px]"},Da={class:"flex flex-row items-center justify-start"},Na={class:"text-xs text-[#1F2937] font-normal leading-[1.2]"};function Va(t,e,n,s,r,i){var c,h;const a=o.resolveComponent("legendIcon"),l=o.resolveComponent("closeIcon");return o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createElementVNode("div",{class:"flex justify-center items-center rounded-md w-[32px] h-[32px] cursor-pointer bg-white p-1 border-[2px]",onClick:e[0]||(e[0]=d=>r.isOpenLegend=!r.isOpenLegend)},[o.createVNode(a)]),r.isOpenLegend?(o.openBlock(),o.createBlock(o.Teleport,{key:0,to:`#wrapper-${n.mapId}`},[o.createElementVNode("div",ya,[o.createElementVNode("div",xa,[e[2]||(e[2]=o.createElementVNode("h3",{class:"text-[16px] font-normal text-black"},"Легенда",-1)),o.createElementVNode("button",{type:"button",class:"inline-flex items-center text-sm font-medium text-gray-500 rounded-lg gap-x-2 focus:outline-none disabled:opacity-50 disabled:pointer-events-none dark:text-neutral-400 dark:hover:text-blue-500 dark:focus:text-blue-500",onClick:e[1]||(e[1]=d=>r.isOpenLegend=!1)},[o.createVNode(l,{class:"w-[20px]"})])]),o.createElementVNode("div",wa,[(c=n.colors)!=null&&c.length?(o.openBlock(),o.createElementBlock("div",ka,[n.colorTitle?(o.openBlock(),o.createElementBlock("h4",_a,o.toDisplayString(n.colorTitle),1)):o.createCommentVNode("",!0),o.createElementVNode("div",Ea,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.colors,(d,u)=>(o.openBlock(),o.createElementBlock("div",{key:u,class:"flex items-center gap-[10px]"},[d.color?(o.openBlock(),o.createElementBlock("div",{key:0,class:"w-[12px] h-[12px] rounded-full",style:o.normalizeStyle({backgroundColor:d.color})},null,4)):o.createCommentVNode("",!0),o.createElementVNode("p",Sa,o.toDisplayString(d.text||d.val),1)]))),128))])])):o.createCommentVNode("",!0),(h=n.sizes)!=null&&h.length?(o.openBlock(),o.createElementBlock("div",$a,[t.sizeTitle?(o.openBlock(),o.createElementBlock("h4",Ca,o.toDisplayString(t.sizeTitle),1)):o.createCommentVNode("",!0),o.createElementVNode("div",Ba,[i.sortedSizes.length?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:0},o.renderList(i.sortedSizes,(d,u)=>{var m,b,p,g,y;return o.openBlock(),o.createElementBlock("div",null,[o.createElementVNode("div",Da,[o.createElementVNode("div",{class:o.normalizeClass([i.maxWidht?`w-[${i.maxWidht}]`:"","mr-[10px]"])},[o.createElementVNode("div",{class:o.normalizeClass(i.sizeClass(u)),style:o.normalizeStyle({backgroundColor:((b=(m=r.palette)==null?void 0:m[n.color])==null?void 0:b[u])||n.color})},null,6)],2),o.createElementVNode("p",Na,o.toDisplayString(u===((p=i.sortedSizes)==null?void 0:p.length)-1?">"+d:u==((g=i.sortedSizes)==null?void 0:g.length)-1?">"+i.sortedSizes[((y=i.sortedSizes)==null?void 0:y.length)-1]:d+"-"+i.sortedSizes[u+1]),1)])])}),256)):o.createCommentVNode("",!0)])])):o.createCommentVNode("",!0)])])],8,["to"])):o.createCommentVNode("",!0)],64)}const Ta=_(ba,[["render",Va]]),za={props:["map","coordinates"],data(){return{isMenuVisible:!1}},computed:{getCoordinates(){var e;return!(this!=null&&this.coordinates)||((e=this.coordinates)==null?void 0:e.length)!==2?"":(this==null?void 0:this.coordinates).slice().reverse().map(n=>Number(n).toFixed(5)).join(", ")}}},Ra={class:"map__settings"},La={ref:"attribution",class:"map__settings-attribution map__settings-item mt-[3px]"};function Oa(t,e,n,s,r,i){return o.openBlock(),o.createElementBlock("div",Ra,[o.createElementVNode("div",La,[o.withDirectives(o.createElementVNode("div",{ref:"mouse",class:"map__settings-item",style:{"min-width":"115px"}},o.toDisplayString(i.getCoordinates),513),[[o.vShow,i.getCoordinates]])],512)])}const wn=_(za,[["render",Oa]]),Aa={mixins:[nt],props:{map:{type:Object,default:()=>null}},data(){return{baseLayers:[{id:"orto10",name:"Ortophoto 1:10К",url:"https://data.gki.com.ua/api-user/rtile/orto10/ua/{z}/{x}/{y}.png",service:"TMS",image:"https://data.gki.com.ua/api-user/rtile/orto10/ua/13/4954/2876.png"},{id:"graymap",name:"Сіра карта",url:"https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png",service:"TMS",image:"https://data.gki.com.ua/api-user/rtile/positron/ua/10/601/348.png"}]}},watch:{map(t){t&&t.on("load",this.handleMapLoad)}},created(){this.baseLayers.forEach(t=>{const e={...t,basemap:!0};this.layerList.push(e)})},methods:{handleMapLoad(){this.changeBaseLayer("graymap")},isLayerInFocus(t){return t.id===this.activeLayer}}},Fa={class:"vs-map-slot-layers"},Ma=["onClick"],Pa=["src"];function Ia(t,e,n,s,r,i){return o.openBlock(),o.createElementBlock("div",Fa,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.baseLayers,a=>(o.openBlock(),o.createElementBlock("div",{key:a.id,class:o.normalizeClass(["vs-map-slot-layers__layer",{focused:i.isLayerInFocus(a)}]),onClick:l=>t.changeBaseLayer(a.id)},[o.createElementVNode("img",{src:a.image,class:"vs-map-slot-layers__image"},null,8,Pa)],10,Ma))),128))])}const kn=_(Aa,[["render",Ia]]);function _n(t,e,n){if(t!==null)for(var s,r,i,a,l,c,h,d=0,u=0,m,b=t.type,p=b==="FeatureCollection",g=b==="Feature",y=p?t.features.length:1,k=0;k<y;k++){h=p?t.features[k].geometry:g?t.geometry:t,m=h?h.type==="GeometryCollection":!1,l=m?h.geometries.length:1;for(var E=0;E<l;E++){var x=0,S=0;if(a=m?h.geometries[E]:h,a!==null){c=a.coordinates;var D=a.type;switch(d=0,D){case null:break;case"Point":if(e(c,u,k,x,S)===!1)return!1;u++,x++;break;case"LineString":case"MultiPoint":for(s=0;s<c.length;s++){if(e(c[s],u,k,x,S)===!1)return!1;u++,D==="MultiPoint"&&x++}D==="LineString"&&x++;break;case"Polygon":case"MultiLineString":for(s=0;s<c.length;s++){for(r=0;r<c[s].length-d;r++){if(e(c[s][r],u,k,x,S)===!1)return!1;u++}D==="MultiLineString"&&x++,D==="Polygon"&&S++}D==="Polygon"&&x++;break;case"MultiPolygon":for(s=0;s<c.length;s++){for(S=0,r=0;r<c[s].length;r++){for(i=0;i<c[s][r].length-d;i++){if(e(c[s][r][i],u,k,x,S)===!1)return!1;u++}S++}x++}break;case"GeometryCollection":for(s=0;s<a.geometries.length;s++)if(_n(a.geometries[s],e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function ja(t,e={}){if(t.bbox!=null&&e.recompute!==!0)return t.bbox;const n=[1/0,1/0,-1/0,-1/0];return _n(t,s=>{n[0]>s[0]&&(n[0]=s[0]),n[1]>s[1]&&(n[1]=s[1]),n[2]<s[0]&&(n[2]=s[0]),n[3]<s[1]&&(n[3]=s[1])}),n}const Ua={},qa={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-home"};function Ha(t,e){return o.openBlock(),o.createElementBlock("svg",qa,[...e[0]||(e[0]=[o.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),o.createElementVNode("path",{d:"M5 12l-2 0l9 -9l9 9l-2 0"},null,-1),o.createElementVNode("path",{d:"M5 12v7a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-7"},null,-1),o.createElementVNode("path",{d:"M9 21v-6a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v6"},null,-1)])])}const Wa={props:["bbox","map"],components:{homeIcon:_(Ua,[["render",Ha]])},methods:{setBounds(){const t={type:"Feature",geometry:this==null?void 0:this.bbox},e=ja(t);this.map.fitBounds(e)}}},Za={class:"z-100 flex justify-center items-center rounded-md w-[32px] h-[32px] cursor-pointer bg-white p-1 border-[2px]"};function Ja(t,e,n,s,r,i){const a=o.resolveComponent("homeIcon");return o.openBlock(),o.createElementBlock("div",Za,[o.createVNode(a,{onClick:i.setBounds},null,8,["onClick"])])}const En=_(Wa,[["render",Ja]]),Ga={},Ka={class:"shrink-0 size-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"#9E9E9E",stroke:"#9E9E9E","stroke-width":"2","stroke-linecap":"#9E9E9E","stroke-linejoin":"#9E9E9E"};function Qa(t,e){return o.openBlock(),o.createElementBlock("svg",Ka,[...e[0]||(e[0]=[o.createElementVNode("circle",{cx:"12",cy:"12",r:"1"},null,-1),o.createElementVNode("circle",{cx:"12",cy:"5",r:"1"},null,-1),o.createElementVNode("circle",{cx:"12",cy:"19",r:"1"},null,-1)])])}const va={components:{legendIcon:st,menuIcon:_(Ga,[["render",Qa]]),closeIcon:rt},props:["source","count","total","mapId"],data(){return{isOpenLegend:!1,palette:["#69D2E7","yellow","#FE4365"]}},methods:{calcSize(t){return t/this.maxValue*100*50/100}},computed:{maxValue(){var t,e,n,s,r,i;return((t=this.sizes)==null?void 0:t[0])>((n=this.sizes)==null?void 0:n[((e=this.sizes)==null?void 0:e.length)-1])?(s=this.sizes)==null?void 0:s[0]:(i=this.sizes)==null?void 0:i[((r=this.sizes)==null?void 0:r.length)-1]}}},Xa={class:"w-full h-[calc(100%-40px)] bg-white"},Ya={class:"w-full flex flex-col gap-[8px] h-[250px] overflow-auto [&::-webkit-scrollbar]:h-1.5 [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-gray-300 [&::-webkit-scrollbar-track]:bg-transparent text-xs"},el={class:"relative min-w-full bg-white text-[12px]"},tl={class:"divide-gray-200 dark:divide-neutral-700"},nl={class:"px-2 py-1"},sl={class:"px-2 py-1"};function rl(t,e,n,s,r,i){return o.openBlock(),o.createElementBlock("div",Xa,[o.createElementVNode("div",Ya,[o.createElementVNode("table",el,[e[0]||(e[0]=o.createElementVNode("thead",{class:"sticky top-[-1px] z-[1] bg-white w-full after:absolute after:content-[''] after:block after:w-full after:h-px after:bg-stone-200"},[o.createElementVNode("tr",null,[o.createElementVNode("th",{class:"px-2 py-1 text-start"},"Назва"),o.createElementVNode("th",{class:"px-2 py-1 text-start"},"Метрика")])],-1)),o.createElementVNode("tbody",tl,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.source,a=>(o.openBlock(),o.createElementBlock("tr",{key:a.id,class:"border-b cursor-pointer hover:bg-gray-100 odd:bg-gray-50"},[o.createElementVNode("td",nl,o.toDisplayString(a.title||"—"),1),o.createElementVNode("td",sl,o.toDisplayString(a.metric),1)]))),128))])])])])}const Sn=_(va,[["render",rl]]),ol={mixins:[F,nt,{components:{VsMapSetting:wn,VsMapSlotLayers:kn,VsMapLegend:Ta,VsMapGoHome:En,VsList:Sn},data(){return{mapId:`map-${Math.floor(Math.random()*1e3)}`,layerId:`layer${Math.floor(Math.random()*1e3)}`,map:null,hoverData:null,data:null,coordinatesByMouse:[],showSetting:!1,popup:null,color:"#69D2E7"}},methods:{async createMap(){var e,n;const t={version:8,glyphs:"https://cdn.softpro.ua/data/fonts/{fontstack}/{range}.pbf",sources:{},layers:[]};this.map=await new maplibregl.Map({container:this.mapId,style:t,center:[31,48.5],zoom:((n=(e=this.data)==null?void 0:e.style)==null?void 0:n.zoom)||5,minZoom:3,maxZoom:20,attributionControl:!1}),this.map.addControl(new maplibregl.NavigationControl({visualizePitch:!0})),this.map.on("load",()=>{this.loadHandler()}),this.map.on("mousemove",s=>{this.moveMouseHadler(s)}),this.map.on("mouseout",()=>{var s;this.showLegend=!1,this.showSetting=!1,this.coordinatesByMouse=0,(s=this.popup)==null||s.remove()})},getPopoverTitle(t){var e,n,s,r,i;return(n=(e=this.data)==null?void 0:e.colors)!=null&&n.find(a=>a.val===t)?(i=(r=(s=this.data)==null?void 0:s.colors)==null?void 0:r.find(a=>a.val===t))==null?void 0:i.text:t},moveMouseHadler(t){var e;try{const n=this.map.queryRenderedFeatures(t.point),s=((e=n[0])==null?void 0:e.properties)||{};if(!n.length){this.map.getCanvas().style.cursor="",this.popupElement&&this.popupElement.remove();return}this.map.getCanvas().style.cursor="pointer",this.popupElement&&this.popupElement.remove(),this.popupElement=document.createElement("div"),this.popupElement.className="absolute text-gray-800 border border-gray-200 rounded-lg shadow-md min-w-28",this.popupElement.style.backgroundColor="rgba(255, 255, 255, 0.7)",this.popupElement.innerHTML=`<div class="font-semibold text-sm border-b border-solid border-gray-200 text-gray-800 rounded-t-lg px-2 py-1">
|
|
82
|
+
${v(n)}: ${R(s)} (${r}%)
|
|
83
|
+
</div>`},onChangedData(){try{if(this.sourceData){const{series:t,xs:e,ys:n}=this.prepareData();t&&(this==null||this.initChart(t,e,n))}}catch{}},prepareData(){try{const t=Array.from(new Set(this.sourceData.map(r=>r[this.dimensions[0]]))),e=Array.from(new Set(this.sourceData.map(r=>r[this.dimensions[1]]))),n=t.map((r,i)=>({name:r,value:e[i]}));return{series:[{name:this.titleCharts?this.titleCharts:this.dimensions[0],type:"funnel",...Z(this.styleData),data:n,height:"80%",emphasis:{label:{show:!1}}}]}}catch(t){console.error(t)}},async initChart(t){try{const e=this.$refs.chart,n=echarts.init(e),s={series:t,...Z(this.styleData),tooltip:{trigger:"item",formatter:r=>this.buildTooltipForDonut(r,[r.color]),borderWidth:0,appendToBody:!0,borderColor:"transparent",textStyle:{color:"#000"},padding:[10,15],shadowColor:"transparent",backgroundColor:"transparent"},itemStyle:{height:"15px"},legend:{borderRadius:10,type:"scroll",itemWidth:14,itemHeight:14,...this.styleData.legend},labelLine:{show:!1},grid:{bottom:"0"}};n.setOption(s),n.resize(),window.addEventListener("resize",()=>{n.resize()})}catch(e){console.error(e)}}}},Wi=["id"];function Zi(t,e,n,s,r,i){return o.openBlock(),o.createElementBlock("div",{ref:"chart",id:r.uniqueID,class:"h-[90%] custom-scrollbar min-h-[200px]"},null,8,Wi)}const Ji=Object.freeze(Object.defineProperty({__proto__:null,default:E(Hi,[["render",Zi]])},Symbol.toStringTag,{value:"Module"}));function Gi(t){return[{type:"fill",paint:{"fill-color":t.color||"#ccc","fill-outline-color":t.color||"blue","fill-opacity":t.opacity||1}}]}function Ki(t){return[{type:"line",paint:{"line-color":t.color||"#ccc","line-opacity":t.opacity||1}}]}function Qi(t){return[{type:"circle",paint:{"circle-radius":t.radius||6,"circle-stroke-color":t.stroke||"#ccc","circle-stroke-width":t.width||1,"circle-color":t.color||"blue"}}]}function cn(t){if(!t)return null;const e=t.type||"point";return e==="polygon"?Gi(t):e==="line"?Ki(t):Qi(t)}const Qe={data(){return{layerList:[],activeLayer:""}},computed:{interactiveSources(){return this.layerList.filter(t=>t==null?void 0:t.interactive).map(t=>t.id)}},methods:{moveLayer(t,e=this.map){e.getStyle().layers.forEach(n=>{n.id.match(t)&&e.moveLayer(n.id)})},async setVisible(t,e=!0,n=this.map){if(!t)return;const s=(t==null?void 0:t.id)||t,r=this.layerList.find(a=>a.id===t)||t;if(!(r!=null&&r.id))throw new Error("MixinError: Layer has no id");const i=n.getStyle().layers.filter(a=>a.id.match(s));i.forEach(a=>{n.setLayoutProperty(a.id,"visibility",e?"visible":"none")}),!i.length&&e&&await this.addLayer(r)},async addLayer(t,e=this==null?void 0:this.map){var r,i;const n=this.layerList.find(a=>a.id===t)||t;!this.map.getStyle()||this.map.getStyle().layers.find(a=>a.id===n.id)||(this.layerList.find(a=>a.id===n.id)||this.layerList.push(n),(n.service==="vtile"||n.service==="vector"||(r=n.url)!=null&&r.includes(".vmt"))&&this.addVtileLayer(n,e),n.service==="geojson"&&this.addGeoJsonLayer(n,e),((i=n.url)!=null&&i.includes(".png")||["tms","raster"].includes(n.service))&&await this.addRasterLayer(n,e))},async addRasterLayer(t,e=this==null?void 0:this.map){var n,s;e.getSource(t.id)||(await e.addSource(t.id,{type:"raster",tiles:[t==null?void 0:t.url],tileSize:256,...t!=null&&t.scheme?{scheme:t==null?void 0:t.scheme}:{}}),await e.addLayer({id:t.id,type:"raster",source:t.id,minzoom:0,maxzoom:(t==null?void 0:t.maxzoom)||22},t.basemap?(s=(n=this.map.getStyle().layers)==null?void 0:n[0])==null?void 0:s.id:null))},async addVtileLayer(t,e=this==null?void 0:this.map){var i;const n=["props","pointZoom"].filter(a=>t[a]).map(a=>`&${a}=${t[a]}`),s={type:"vector",tiles:[`${(i=t==null?void 0:t.url)!=null&&i.startsWith("http")?"":window.location.origin}${t==null?void 0:t.url}${n}`],minzoom:t.minzoom||3,maxzoom:t.maxzoom||24};e.addSource(t.id,s),(cn(t.style)||t.layers||[]).forEach((a,l)=>{const c={...a,id:`${t.id}-${l}`,source:t.id,"source-layer":a["source-layer"]||t.source||t.id,maxzoom:+a.maxzoom||24,minzoom:+a.minzoom||0};e.addLayer(c)})},async addGeoJsonLayer(t,e=this.map){var r;const n=t.data||((r=t==null?void 0:t.url)!=null&&r.startsWith("http")?"":window.location.origin)+t.url;e.addSource(t.id,{type:"geojson",data:n}),(cn(t.style)||t.layers||[]).forEach(i=>{const a={...i,source:t.id,id:i.id||t.id,maxzoom:+i.maxzoom||24,minzoom:+i.minzoom||0,type:i.type||"circle"};e.addLayer(a)})},setLayerData(t,e){this.layerList=this.layerList.map(n=>n.id===t?{...n,...e}:n)},async removeLayer(t,e=this.map){e.getSource(t)&&(await e.getStyle().layers.forEach(async n=>{n.source===t&&await e.removeLayer(n.id)}),await e.removeSource(t))},async setFilter(t,e){var r;const n=this.layerList.find(i=>i.id===t),s=await((r=this.map)==null?void 0:r.getSource(t));if(s&&n.service==="vtile"){await s.setTiles([`${window.location.origin}${n.url}${n.url.includes("?")?"&":"?"}filter=${e}${n.props?`&props=${n.props}`:""}`]);return}s&&n.service},async changeBaseLayer(t){const e=t!=null&&t.id?t:this.layerList.find(s=>s.id===t),{id:n}=e;if(n&&n!==this.activeLayer){if(this.activeLayer&&this.map.setLayoutProperty(this.activeLayer,"visibility","none"),this.activeLayer=n,this.map.getLayer(n)){this.map.setLayoutProperty(n,"visibility","visible");return}await this.addRasterLayer(e)}},async refreshLayer(t,e=this.map){await e.getStyle().layers.forEach(n=>{n.source===t&&e.removeLayer(n.id)}),await e.removeSource(t),this.setVisible(t)}}},vi={},Xi={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-list-details"};function Yi(t,e){return o.openBlock(),o.createElementBlock("svg",Xi,[...e[0]||(e[0]=[o.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M13 5h8"></path><path d="M13 9h5"></path><path d="M13 15h8"></path><path d="M13 19h5"></path><path d="M3 4m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z"></path><path d="M3 14m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z"></path>',7)])])}const ve=E(vi,[["render",Yi]]),ea={},ta={class:"shrink-0 size-3",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"};function na(t,e){return o.openBlock(),o.createElementBlock("svg",ta,[...e[0]||(e[0]=[o.createElementVNode("path",{d:"M18 6 6 18"},null,-1),o.createElementVNode("path",{d:"m6 6 12 12"},null,-1)])])}const Xe=E(ea,[["render",na]]),Ye={pink:["#fde7e2","#feafbe","#fd58a4","#d7038e","#86007b"],blue:["#f1eef6","#bdc9e1","#74a9cf","#2b8cbe","#045a8d"],green:["#edf8fb","#b2e2e2","#66c2a4","#2ca25f","#006d2c"],pink2:["#f1eef6","#d7b5d8","#df65b0","#dd1c77","#980043"],red:["#fef0d9","#fdcc8a","#fc8d59","#e34a33","#b30000"],teal:["#f6eff7","#bdc9e1","#67a9cf","#1c9099","#016c59"]},sa={components:{legendIcon:ve,closeIcon:Xe},props:{mapId:{type:String},colors:{type:Array},sizes:{type:Array,default:()=>[]},cluster:{type:[Boolean,String]},color:{type:String,default:"gray"},colorTitle:{type:String},sizesTitle:{type:String},resizeItem:{type:[Boolean,String],default:!1},changeOpacityItem:{type:[Boolean,String],default:!1}},data(){return{isOpenLegend:!1,palette:Ye}},computed:{borderRadius(){return this.cluster?"rounded-sm":"rounded-full"},sortedSizes(){return[...this.sizes].sort((t,e)=>t-e)},maxWidht(){var n;const t=((n=this.sizes)==null?void 0:n.length)-1;return this.calcSize(t)}},methods:{sizeClass(t){return this.resizeItem?`h-[${this.calcSize(t)}] w-[${this.calcSize(t)}] ${this.borderRadius}`:`h-[18px] w-[18px] ${this.borderRadius}`},calcSize(t){return`${10+t*2}px`},getOpacity(t){return(t+1)/this.sortedSizes.length}}},ra={class:"w-full absolute max-w-[200px] bg-white border rounded-lg bottom-[10px] right-[50px]"},oa={class:"flex items-center justify-between border-b border-[#0000001A] px-2"},ia={class:"w-full flex flex-col gap-[8px] px-2 py-2 max-h-[200px] overflow-auto [&::-webkit-scrollbar]:h-1.5 [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-gray-300 [&::-webkit-scrollbar-track]:bg-transparent"},aa={key:0,class:"flex flex-col w-full"},la={key:0,class:"text-xs font-semibold leading-[1.2] text-[#1F2937] mb-[8px]"},ca={class:"flex flex-col gap-[6px]"},da={class:"text-xs text-[#1F2937] font-normal leading-[1.2]"},ha={key:1,class:"flex flex-col w-full"},pa={key:0,class:"text-xs font-semibold leading-[1.2] text-[#1F2937] mb-[8px]"},ua={class:"flex flex-col gap-[6px]"},fa={class:"flex flex-row items-center justify-start"},ma={class:"text-xs text-[#1F2937] font-normal leading-[1.2]"};function ga(t,e,n,s,r,i){var c,h;const a=o.resolveComponent("legendIcon"),l=o.resolveComponent("closeIcon");return o.openBlock(),o.createElementBlock(o.Fragment,null,[o.createElementVNode("div",{class:"flex justify-center items-center rounded-md w-[32px] h-[32px] cursor-pointer bg-white p-1 border-[2px]",onClick:e[0]||(e[0]=d=>r.isOpenLegend=!r.isOpenLegend)},[o.createVNode(a)]),r.isOpenLegend?(o.openBlock(),o.createBlock(o.Teleport,{key:0,to:`#wrapper-${n.mapId}`},[o.createElementVNode("div",ra,[o.createElementVNode("div",oa,[e[2]||(e[2]=o.createElementVNode("h3",{class:"text-[16px] font-normal text-black"},"Легенда",-1)),o.createElementVNode("button",{type:"button",class:"inline-flex items-center text-sm font-medium text-gray-500 rounded-lg gap-x-2 focus:outline-none disabled:opacity-50 disabled:pointer-events-none dark:text-neutral-400 dark:hover:text-blue-500 dark:focus:text-blue-500",onClick:e[1]||(e[1]=d=>r.isOpenLegend=!1)},[o.createVNode(l,{class:"w-[20px]"})])]),o.createElementVNode("div",ia,[(c=n.colors)!=null&&c.length?(o.openBlock(),o.createElementBlock("div",aa,[n.colorTitle?(o.openBlock(),o.createElementBlock("h4",la,o.toDisplayString(n.colorTitle),1)):o.createCommentVNode("",!0),o.createElementVNode("div",ca,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.colors,(d,p)=>(o.openBlock(),o.createElementBlock("div",{key:p,class:"flex items-center gap-[10px]"},[d.color?(o.openBlock(),o.createElementBlock("div",{key:0,class:"w-[12px] h-[12px] rounded-full",style:o.normalizeStyle({backgroundColor:d.color})},null,4)):o.createCommentVNode("",!0),o.createElementVNode("p",da,o.toDisplayString(d.text||d.val),1)]))),128))])])):o.createCommentVNode("",!0),(h=n.sizes)!=null&&h.length?(o.openBlock(),o.createElementBlock("div",ha,[t.sizeTitle?(o.openBlock(),o.createElementBlock("h4",pa,o.toDisplayString(t.sizeTitle),1)):o.createCommentVNode("",!0),o.createElementVNode("div",ua,[i.sortedSizes.length?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:0},o.renderList(i.sortedSizes,(d,p)=>{var m,g,u,b,y;return o.openBlock(),o.createElementBlock("div",null,[o.createElementVNode("div",fa,[o.createElementVNode("div",{class:o.normalizeClass([i.maxWidht?`w-[${i.maxWidht}]`:"","mr-[10px]"])},[o.createElementVNode("div",{class:o.normalizeClass(i.sizeClass(p)),style:o.normalizeStyle({backgroundColor:((g=(m=r.palette)==null?void 0:m[n.color])==null?void 0:g[p])||n.color})},null,6)],2),o.createElementVNode("p",ma,o.toDisplayString(p===((u=i.sortedSizes)==null?void 0:u.length)-1?">"+d:p==((b=i.sortedSizes)==null?void 0:b.length)-1?">"+i.sortedSizes[((y=i.sortedSizes)==null?void 0:y.length)-1]:d+"-"+i.sortedSizes[p+1]),1)])])}),256)):o.createCommentVNode("",!0)])])):o.createCommentVNode("",!0)])])],8,["to"])):o.createCommentVNode("",!0)],64)}const ba=E(sa,[["render",ga]]),ya={props:["map","coordinates"],data(){return{isMenuVisible:!1}},computed:{getCoordinates(){var e;return!(this!=null&&this.coordinates)||((e=this.coordinates)==null?void 0:e.length)!==2?"":(this==null?void 0:this.coordinates).slice().reverse().map(n=>Number(n).toFixed(5)).join(", ")}}},xa={class:"map__settings"},wa={ref:"attribution",class:"map__settings-attribution map__settings-item mt-[3px]"};function ka(t,e,n,s,r,i){return o.openBlock(),o.createElementBlock("div",xa,[o.createElementVNode("div",wa,[o.withDirectives(o.createElementVNode("div",{ref:"mouse",class:"map__settings-item",style:{"min-width":"115px"}},o.toDisplayString(i.getCoordinates),513),[[o.vShow,i.getCoordinates]])],512)])}const dn=E(ya,[["render",ka]]),_a={mixins:[Qe],props:{map:{type:Object,default:()=>null}},data(){return{baseLayers:[{id:"orto10",name:"Ortophoto 1:10К",url:"https://data.gki.com.ua/api-user/rtile/orto10/ua/{z}/{x}/{y}.png",service:"TMS",image:"https://data.gki.com.ua/api-user/rtile/orto10/ua/13/4954/2876.png"},{id:"graymap",name:"Сіра карта",url:"https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png",service:"TMS",image:"https://data.gki.com.ua/api-user/rtile/positron/ua/10/601/348.png"}]}},watch:{map(t){t&&t.on("load",this.handleMapLoad)}},created(){this.baseLayers.forEach(t=>{const e={...t,basemap:!0};this.layerList.push(e)})},methods:{handleMapLoad(){this.changeBaseLayer("graymap")},isLayerInFocus(t){return t.id===this.activeLayer}}},Ea={class:"vs-map-slot-layers"},Sa=["onClick"],$a=["src"];function Ca(t,e,n,s,r,i){return o.openBlock(),o.createElementBlock("div",Ea,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.baseLayers,a=>(o.openBlock(),o.createElementBlock("div",{key:a.id,class:o.normalizeClass(["vs-map-slot-layers__layer",{focused:i.isLayerInFocus(a)}]),onClick:l=>t.changeBaseLayer(a.id)},[o.createElementVNode("img",{src:a.image,class:"vs-map-slot-layers__image"},null,8,$a)],10,Sa))),128))])}const hn=E(_a,[["render",Ca]]);function pn(t,e,n){if(t!==null)for(var s,r,i,a,l,c,h,d=0,p=0,m,g=t.type,u=g==="FeatureCollection",b=g==="Feature",y=u?t.features.length:1,_=0;_<y;_++){h=u?t.features[_].geometry:b?t.geometry:t,m=h?h.type==="GeometryCollection":!1,l=m?h.geometries.length:1;for(var w=0;w<l;w++){var x=0,N=0;if(a=m?h.geometries[w]:h,a!==null){c=a.coordinates;var $=a.type;switch(d=0,$){case null:break;case"Point":if(e(c,p,_,x,N)===!1)return!1;p++,x++;break;case"LineString":case"MultiPoint":for(s=0;s<c.length;s++){if(e(c[s],p,_,x,N)===!1)return!1;p++,$==="MultiPoint"&&x++}$==="LineString"&&x++;break;case"Polygon":case"MultiLineString":for(s=0;s<c.length;s++){for(r=0;r<c[s].length-d;r++){if(e(c[s][r],p,_,x,N)===!1)return!1;p++}$==="MultiLineString"&&x++,$==="Polygon"&&N++}$==="Polygon"&&x++;break;case"MultiPolygon":for(s=0;s<c.length;s++){for(N=0,r=0;r<c[s].length;r++){for(i=0;i<c[s][r].length-d;i++){if(e(c[s][r][i],p,_,x,N)===!1)return!1;p++}N++}x++}break;case"GeometryCollection":for(s=0;s<a.geometries.length;s++)if(pn(a.geometries[s],e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Ba(t,e={}){if(t.bbox!=null&&e.recompute!==!0)return t.bbox;const n=[1/0,1/0,-1/0,-1/0];return pn(t,s=>{n[0]>s[0]&&(n[0]=s[0]),n[1]>s[1]&&(n[1]=s[1]),n[2]<s[0]&&(n[2]=s[0]),n[3]<s[1]&&(n[3]=s[1])}),n}const Da={},Na={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-home"};function Va(t,e){return o.openBlock(),o.createElementBlock("svg",Na,[...e[0]||(e[0]=[o.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),o.createElementVNode("path",{d:"M5 12l-2 0l9 -9l9 9l-2 0"},null,-1),o.createElementVNode("path",{d:"M5 12v7a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-7"},null,-1),o.createElementVNode("path",{d:"M9 21v-6a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v6"},null,-1)])])}const Ta={props:["bbox","map"],components:{homeIcon:E(Da,[["render",Va]])},methods:{setBounds(){const t={type:"Feature",geometry:this==null?void 0:this.bbox},e=Ba(t);this.map.fitBounds(e)}}},Ra={class:"z-100 flex justify-center items-center rounded-md w-[32px] h-[32px] cursor-pointer bg-white p-1 border-[2px]"};function za(t,e,n,s,r,i){const a=o.resolveComponent("homeIcon");return o.openBlock(),o.createElementBlock("div",Ra,[o.createVNode(a,{onClick:i.setBounds},null,8,["onClick"])])}const un=E(Ta,[["render",za]]),La={},Oa={class:"shrink-0 size-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"#9E9E9E",stroke:"#9E9E9E","stroke-width":"2","stroke-linecap":"#9E9E9E","stroke-linejoin":"#9E9E9E"};function Aa(t,e){return o.openBlock(),o.createElementBlock("svg",Oa,[...e[0]||(e[0]=[o.createElementVNode("circle",{cx:"12",cy:"12",r:"1"},null,-1),o.createElementVNode("circle",{cx:"12",cy:"5",r:"1"},null,-1),o.createElementVNode("circle",{cx:"12",cy:"19",r:"1"},null,-1)])])}const Fa={components:{legendIcon:ve,menuIcon:E(La,[["render",Aa]]),closeIcon:Xe},props:["source","count","total","mapId"],data(){return{isOpenLegend:!1,palette:["#69D2E7","yellow","#FE4365"]}},methods:{calcSize(t){return t/this.maxValue*100*50/100}},computed:{maxValue(){var t,e,n,s,r,i;return((t=this.sizes)==null?void 0:t[0])>((n=this.sizes)==null?void 0:n[((e=this.sizes)==null?void 0:e.length)-1])?(s=this.sizes)==null?void 0:s[0]:(i=this.sizes)==null?void 0:i[((r=this.sizes)==null?void 0:r.length)-1]}}},Ma={class:"w-full h-[calc(100%-40px)] bg-white"},Pa={class:"w-full flex flex-col gap-[8px] h-[250px] overflow-auto [&::-webkit-scrollbar]:h-1.5 [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-gray-300 [&::-webkit-scrollbar-track]:bg-transparent text-xs"},Ia={class:"relative min-w-full bg-white text-[12px]"},ja={class:"divide-gray-200 dark:divide-neutral-700"},Ua={class:"px-2 py-1"},qa={class:"px-2 py-1"};function Ha(t,e,n,s,r,i){return o.openBlock(),o.createElementBlock("div",Ma,[o.createElementVNode("div",Pa,[o.createElementVNode("table",Ia,[e[0]||(e[0]=o.createElementVNode("thead",{class:"sticky top-[-1px] z-[1] bg-white w-full after:absolute after:content-[''] after:block after:w-full after:h-px after:bg-stone-200"},[o.createElementVNode("tr",null,[o.createElementVNode("th",{class:"px-2 py-1 text-start"},"Назва"),o.createElementVNode("th",{class:"px-2 py-1 text-start"},"Метрика")])],-1)),o.createElementVNode("tbody",ja,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.source,a=>(o.openBlock(),o.createElementBlock("tr",{key:a.id,class:"border-b cursor-pointer hover:bg-gray-100 odd:bg-gray-50"},[o.createElementVNode("td",Ua,o.toDisplayString(a.title||"—"),1),o.createElementVNode("td",qa,o.toDisplayString(a.metric),1)]))),128))])])])])}const fn=E(Fa,[["render",Ha]]),Wa={mixins:[A,Qe,{components:{VsMapSetting:dn,VsMapSlotLayers:hn,VsMapLegend:ba,VsMapGoHome:un,VsList:fn},data(){return{mapId:`map-${Math.floor(Math.random()*1e3)}`,layerId:`layer${Math.floor(Math.random()*1e3)}`,map:null,hoverData:null,data:null,coordinatesByMouse:[],showSetting:!1,popup:null,color:"#69D2E7"}},methods:{async createMap(){var e,n;const t={version:8,glyphs:"https://cdn.softpro.ua/data/fonts/{fontstack}/{range}.pbf",sources:{},layers:[]};this.map=await new maplibregl.Map({container:this.mapId,style:t,center:[31,48.5],zoom:((n=(e=this.data)==null?void 0:e.style)==null?void 0:n.zoom)||5,minZoom:3,maxZoom:20,attributionControl:!1}),this.map.addControl(new maplibregl.NavigationControl({visualizePitch:!0})),this.map.on("load",()=>{this.loadHandler()}),this.map.on("mousemove",s=>{this.moveMouseHadler(s)}),this.map.on("mouseout",()=>{var s;this.showLegend=!1,this.showSetting=!1,this.coordinatesByMouse=0,(s=this.popup)==null||s.remove()})},getPopoverTitle(t){var e,n,s,r,i;return(n=(e=this.data)==null?void 0:e.colors)!=null&&n.find(a=>a.val===t)?(i=(r=(s=this.data)==null?void 0:s.colors)==null?void 0:r.find(a=>a.val===t))==null?void 0:i.text:t},moveMouseHadler(t){var e;try{const n=this.map.queryRenderedFeatures(t.point),s=((e=n[0])==null?void 0:e.properties)||{};if(!n.length){this.map.getCanvas().style.cursor="",this.popupElement&&this.popupElement.remove();return}this.map.getCanvas().style.cursor="pointer",this.popupElement&&this.popupElement.remove(),this.popupElement=document.createElement("div"),this.popupElement.className="absolute text-gray-800 border border-gray-200 rounded-lg shadow-md min-w-28",this.popupElement.style.backgroundColor="rgba(255, 255, 255, 0.7)",this.popupElement.innerHTML=`<div class="font-semibold text-sm border-b border-solid border-gray-200 text-gray-800 rounded-t-lg px-2 py-1">
|
|
84
84
|
${this.getPopoverTitle((s==null?void 0:s.x)||(s==null?void 0:s.title)||(s==null?void 0:s.name))||""}
|
|
85
85
|
</div>
|
|
86
86
|
|
|
@@ -89,7 +89,7 @@ Please report this to https://github.com/markedjs/marked.`,e){const r="<p>An err
|
|
|
89
89
|
<span class="font-medium mr-[6px]">Значення</span>
|
|
90
90
|
</span>
|
|
91
91
|
<span>${(s==null?void 0:s.metric)||0}</span>
|
|
92
|
-
</div>`;const r=this.map.project(t.lngLat);this.popupElement.style.left=`${r.x}px`,this.popupElement.style.top=`${r.y-60}px`,this.map.getContainer().appendChild(this.popupElement)}catch(n){console.error(n)}}}}],name:"VsMap",async mounted(){await this.getMapData(),await this.createMap()},methods:{async getMapData(){const e=await(await fetch(`/api/bi-map?widget=${this.widget}&dashboard=${this.dashboard}`)).json();this.data=e,this.$emit("update:widgetData",e),setTimeout(()=>{var n;return(n=this.map)==null?void 0:n.resize()})},async loadHandler(){const t=["#69D2E7","yellow","#FE4365"],e=this.data.colors?["match",["get","x"]].concat(this.data.colors.reduce((i,a,l)=>i.concat(a.val,(a==null?void 0:a.color)||t[l]),[])).concat(["gray"]):"blue",n=[5,7,9,11,13],s=this.data.sizes?["case"]:5;this.data.sizes&&(this.data.sizes.reverse().forEach((i,a)=>{s.push([">",["get","metric"],i]),s.push(n[a])}),s.push(5));const r={type:"circle",color:e,width:2,radius:s,stroke:"#eee"};Object.assign(r,this.data.style||{}),this.addVtileLayer({id:"bi",url:`${window.top.location.origin}/api/bi-vtile/{z}/{x}/{y}.vmt?widget=${this.widget}&dashboard=${this.dashboard}&nocache=1`,style:r})}}},il={class:"w-full h-full"},al={class:"flex items-start justify-between mb-[6px] w-full"},ll={class:"text-gray-800 font-[600]"},cl=["id"],dl=["id"],hl={class:"absolute flex flex-col right-[10px] top-[105px] gap-1"};function pl(t,e,n,s,r,i){var d,u,m;const a=o.resolveComponent("VsMapSetting"),l=o.resolveComponent("VsMapSlotLayers"),c=o.resolveComponent("VsMapLegend"),h=o.resolveComponent("VsMapGoHome");return o.openBlock(),o.createElementBlock("div",il,[o.createElementVNode("div",al,[o.createElementVNode("h5",ll,o.toDisplayString(t.title),1)]),o.createElementVNode("div",{class:"relative w-full h-[calc(100%-40px)]",id:`wrapper-${t.mapId}`},[o.createElementVNode("div",{id:t.mapId,class:"w-full flex items-end relative h-full min-h-[250px]"},null,8,dl),t.showSetting?(o.openBlock(),o.createBlock(a,{key:0,map:t.map,coordinates:t.coordinatesByMouse},null,8,["map","coordinates"])):o.createCommentVNode("",!0),o.createVNode(l,{map:t.map},null,8,["map"]),o.createElementVNode("div",hl,[o.createVNode(c,{mapId:t.mapId,colors:(d=t.data)==null?void 0:d.colors,sizes:(u=t.data)==null?void 0:u.sizes,color:t.color,resizeItem:"true"},null,8,["mapId","colors","sizes","color"]),o.createVNode(h,{map:t.map,bbox:(m=t.data)==null?void 0:m.bounds},null,8,["map","bbox"])])],8,cl)])}const ul=Object.freeze(Object.defineProperty({__proto__:null,default:_(ol,[["render",pl]])},Symbol.toStringTag,{value:"Module"})),fl={components:{legendIcon:st,closeIcon:rt},props:{mapId:{type:String},colors:{type:Array},sizes:{type:Array,default:()=>[]},cluster:{type:[Boolean,String]},color:{type:String,default:"gray"},colorTitle:{type:String},sizesTitle:{type:String},resizeItem:{type:[Boolean,String],default:!1},changeOpacityItem:{type:[Boolean,String],default:!1}},data(){return{isOpenLegend:!1,palette:ot}},computed:{borderRadius(){return this.cluster?"rounded-sm":"rounded-full"},sortedSizes(){return[...this.sizes].sort((t,e)=>t-e)},maxWidht(){var n;const t=((n=this.sizes)==null?void 0:n.length)-1;return this.calcSize(t)}},methods:{sizeClass(t){return this.resizeItem?`h-[${this.calcSize(t)}] w-[${this.calcSize(t)}] ${this.borderRadius}`:`h-[10px] ${this.borderRadius}`},calcSize(t){return`${10+t*2}px`},getOpacity(t){return(t+1)/this.sortedSizes.length}}},ml={key:0,class:"absolute flex items-end w-fit bottom-[10px] max-w-[80%] left-[50%] translate-x-[-50%] bg-[rgba(255,255,255,0.7)] p-[10px] rounded"},gl={class:"w-[80px] mr-[10px]"},bl=["title"],yl={class:"text-[10px] mb-[2px] text-[#1F2937] font-normal leading-[1.2]"};function xl(t,e,n,s,r,i){var a;return(a=n.sizes)!=null&&a.length?(o.openBlock(),o.createElementBlock("div",ml,[o.createElementVNode("div",gl,[e[0]||(e[0]=o.createElementVNode("p",{class:"text-[10px] mb-[2px] text-[#1F2937] leading-[1.2]"}," Дані відсутні ",-1)),o.createElementVNode("div",{class:o.normalizeClass([i.sizeClass(t.index),"w-full border border-gray-500"])},null,2)]),i.sortedSizes.length?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:0},o.renderList(i.sortedSizes,(l,c)=>{var h,d,u,m,b,p,g,y;return o.openBlock(),o.createElementBlock("div",{class:"w-[80px]",title:c===((h=i.sortedSizes)==null?void 0:h.length)-1?">"+l:c==((d=i.sortedSizes)==null?void 0:d.length)-1?">"+i.sortedSizes[((u=i.sortedSizes)==null?void 0:u.length)-1]:l+"-"+i.sortedSizes[c+1]},[o.createElementVNode("p",yl,o.toDisplayString(c===((m=i.sortedSizes)==null?void 0:m.length)-1?">"+parseInt(l):c==((b=i.sortedSizes)==null?void 0:b.length)-1?">"+parseInt(i.sortedSizes[((p=i.sortedSizes)==null?void 0:p.length)-1]):parseInt(l)+"-"+parseInt(i.sortedSizes[c+1])),1),o.createElementVNode("div",{class:o.normalizeClass([i.sizeClass(c),"w-full border border-r-0 border-gray-500"]),style:o.normalizeStyle({backgroundColor:((y=(g=r.palette)==null?void 0:g[n.color])==null?void 0:y[c])||n.color})},null,6)],8,bl)}),256)):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0)}const wl=_(fl,[["render",xl]]),kl={},_l={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-map"};function El(t,e){return o.openBlock(),o.createElementBlock("svg",_l,[...e[0]||(e[0]=[o.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),o.createElementVNode("path",{d:"M3 7l6 -3l6 3l6 -3v13l-6 3l-6 -3l-6 3v-13"},null,-1),o.createElementVNode("path",{d:"M9 4v13"},null,-1),o.createElementVNode("path",{d:"M15 7v13"},null,-1)])])}const Sl=_(kl,[["render",El]]),$l={},Cl={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-table"};function Bl(t,e){return o.openBlock(),o.createElementBlock("svg",Cl,[...e[0]||(e[0]=[o.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),o.createElementVNode("path",{d:"M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14z"},null,-1),o.createElementVNode("path",{d:"M3 10h18"},null,-1),o.createElementVNode("path",{d:"M10 3v18"},null,-1)])])}const Dl=_($l,[["render",Bl]]),Nl={},Vl={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-align-box-left-stretch"};function Tl(t,e){return o.openBlock(),o.createElementBlock("svg",Vl,[...e[0]||(e[0]=[o.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14z"></path><path d="M9 17h-2"></path><path d="M13 12h-6"></path><path d="M11 7h-4"></path>',5)])])}const zl=_(Nl,[["render",Tl]]),Rl={mixins:[F,nt],components:{VsMapSetting:wn,VsClusterLegend:wl,VsMapGoHome:En,VsList:Sn,VsMapSlotLayers:kn,VsBar:Ze},data(){return{baseColor:"pink",kattotg:"",options:[{id:"map",text:"Карта",component:Sl},{id:"table",text:"Таблиця",component:Dl},{id:"chart",text:"Віджет",component:zl}],activeTab:"map",mapId:`map-${Math.floor(Math.random()*1e3)}`,layerId:`layer${Math.floor(Math.random()*1e3)}`,map:null,hoverData:null,data:null,coordinatesByMouse:[],showSetting:!1,popup:null,color:"#69D2E7",label:"<div><icon-map/></div>"}},async mounted(){await this.getMapData(),await this.createMap()},watch:{kattotg(){this.loadHandler()}},methods:{async getMapData(){const t=await V.get(`/bi-cluster?widget=${this.widget}&dashboard=${this.dashboard}`);this.data=t.data,this.$emit("update:widgetData",this.data),setTimeout(()=>{var e;return(e=this.map)==null?void 0:e.resize()})},async loadHandler(){var s,r,i,a;this.baseColor=((s=this.data.style)==null?void 0:s.color)||"blue";const t=["case"];(a=(i=(r=this.data)==null?void 0:r.sizes)==null?void 0:i.toReversed())==null||a.forEach((l,c)=>{var h,d;t.push([">",["get","metric"],l]),t.push((d=(h=ot[this.baseColor])==null?void 0:h.toReversed())==null?void 0:d[c]),c++}),t.push("gray");const e={type:"polygon",color:t,opacity:.4};Object.assign(e,this.data.style||{}),this.map.getSource("bi")||this.addVtileLayer({id:"bi",url:`${window.location.origin}/api/bi-cluster-vtile/{z}/{x}/{y}.vmt?widget=${this.widget}&dashboard=${this.dashboard}&nocache=1`,style:e}),this.map.getLayer("highlighted")&&this.map.removeLayer("highlighted"),this.map.getSource("highlighted")&&this.map.removeSource("highlighted");const n=["case"];this.kattotg&&n.push(["==",["to-string",["get","name"]],String(this.kattotg)],"red"),n.push("transparent"),this.map.addLayer({id:"highlighted",type:"fill",source:"bi","source-layer":"bi",paint:{"fill-color":n,"fill-opacity":.6}})},async createMap(){var e,n;const t={version:8,glyphs:"https://cdn.softpro.ua/data/fonts/{fontstack}/{range}.pbf",sources:{},layers:[]};this.map=await new maplibregl.Map({container:this.mapId,style:t,center:[31,48.5],zoom:((n=(e=this.data)==null?void 0:e.style)==null?void 0:n.zoom)||5,minZoom:3,maxZoom:20,attributionControl:!1}),this.map.addControl(new maplibregl.NavigationControl({visualizePitch:!0})),this.map.on("load",()=>{this.loadHandler()}),this.map.on("mousemove",s=>{this.moveMouseHadler(s)}),this.map.on("mouseout",()=>{var s;this.showLegend=!1,this.showSetting=!1,this.coordinatesByMouse=0,(s=this.popup)==null||s.remove()})},moveMouseHadler(t){var e;try{const n=this.map.queryRenderedFeatures(t.point),s=((e=n[0])==null?void 0:e.properties)||{};if(!n.length){this.map.getCanvas().style.cursor="",this.popupElement&&this.popupElement.remove();return}this.map.getCanvas().style.cursor="pointer",this.popupElement&&this.popupElement.remove(),this.popupElement=document.createElement("div"),this.popupElement.className="absolute text-gray-800 border border-gray-200 rounded-lg shadow-md min-w-28",this.popupElement.style.backgroundColor="rgba(255, 255, 255, 0.7)",this.popupElement.innerHTML=`<div class="px-2 py-1 text-sm font-semibold text-gray-800 border-b border-gray-200 border-solid rounded-t-lg">
|
|
92
|
+
</div>`;const r=this.map.project(t.lngLat);this.popupElement.style.left=`${r.x}px`,this.popupElement.style.top=`${r.y-60}px`,this.map.getContainer().appendChild(this.popupElement)}catch(n){console.error(n)}}}}],name:"VsMap",async mounted(){await this.getMapData(),await this.createMap()},methods:{async getMapData(){const e=await(await fetch(`/api/bi-map?widget=${this.widget}&dashboard=${this.dashboard}`)).json();this.data=e,this.$emit("update:widgetData",e),setTimeout(()=>{var n;return(n=this.map)==null?void 0:n.resize()})},async loadHandler(){const t=["#69D2E7","yellow","#FE4365"],e=this.data.colors?["match",["get","x"]].concat(this.data.colors.reduce((i,a,l)=>i.concat(a.val,(a==null?void 0:a.color)||t[l]),[])).concat(["gray"]):"blue",n=[5,7,9,11,13],s=this.data.sizes?["case"]:5;this.data.sizes&&(this.data.sizes.reverse().forEach((i,a)=>{s.push([">",["get","metric"],i]),s.push(n[a])}),s.push(5));const r={type:"circle",color:e,width:2,radius:s,stroke:"#eee"};Object.assign(r,this.data.style||{}),this.addVtileLayer({id:"bi",url:`${window.top.location.origin}/api/bi-vtile/{z}/{x}/{y}.vmt?widget=${this.widget}&dashboard=${this.dashboard}&nocache=1`,style:r})}}},Za={class:"w-full h-full"},Ja={class:"flex items-start justify-between mb-[6px] w-full"},Ga={class:"text-gray-800 font-[600]"},Ka=["id"],Qa=["id"],va={class:"absolute flex flex-col right-[10px] top-[105px] gap-1"};function Xa(t,e,n,s,r,i){var d,p,m;const a=o.resolveComponent("VsMapSetting"),l=o.resolveComponent("VsMapSlotLayers"),c=o.resolveComponent("VsMapLegend"),h=o.resolveComponent("VsMapGoHome");return o.openBlock(),o.createElementBlock("div",Za,[o.createElementVNode("div",Ja,[o.createElementVNode("h5",Ga,o.toDisplayString(t.title),1)]),o.createElementVNode("div",{class:"relative w-full h-[calc(100%-40px)]",id:`wrapper-${t.mapId}`},[o.createElementVNode("div",{id:t.mapId,class:"w-full flex items-end relative h-full min-h-[250px]"},null,8,Qa),t.showSetting?(o.openBlock(),o.createBlock(a,{key:0,map:t.map,coordinates:t.coordinatesByMouse},null,8,["map","coordinates"])):o.createCommentVNode("",!0),o.createVNode(l,{map:t.map},null,8,["map"]),o.createElementVNode("div",va,[o.createVNode(c,{mapId:t.mapId,colors:(d=t.data)==null?void 0:d.colors,sizes:(p=t.data)==null?void 0:p.sizes,color:t.color,resizeItem:"true"},null,8,["mapId","colors","sizes","color"]),o.createVNode(h,{map:t.map,bbox:(m=t.data)==null?void 0:m.bounds},null,8,["map","bbox"])])],8,Ka)])}const Ya=Object.freeze(Object.defineProperty({__proto__:null,default:E(Wa,[["render",Xa]])},Symbol.toStringTag,{value:"Module"})),el={components:{legendIcon:ve,closeIcon:Xe},props:{mapId:{type:String},colors:{type:Array},sizes:{type:Array,default:()=>[]},cluster:{type:[Boolean,String]},color:{type:String,default:"gray"},colorTitle:{type:String},sizesTitle:{type:String},resizeItem:{type:[Boolean,String],default:!1},changeOpacityItem:{type:[Boolean,String],default:!1}},data(){return{isOpenLegend:!1,palette:Ye}},computed:{borderRadius(){return this.cluster?"rounded-sm":"rounded-full"},sortedSizes(){return[...this.sizes].sort((t,e)=>t-e)},maxWidht(){var n;const t=((n=this.sizes)==null?void 0:n.length)-1;return this.calcSize(t)}},methods:{sizeClass(t){return this.resizeItem?`h-[${this.calcSize(t)}] w-[${this.calcSize(t)}] ${this.borderRadius}`:`h-[10px] ${this.borderRadius}`},calcSize(t){return`${10+t*2}px`},getOpacity(t){return(t+1)/this.sortedSizes.length}}},tl={key:0,class:"absolute flex items-end w-fit bottom-[10px] max-w-[80%] left-[50%] translate-x-[-50%] bg-[rgba(255,255,255,0.7)] p-[10px] rounded"},nl={class:"w-[80px] mr-[10px]"},sl=["title"],rl={class:"text-[10px] mb-[2px] text-[#1F2937] font-normal leading-[1.2]"};function ol(t,e,n,s,r,i){var a;return(a=n.sizes)!=null&&a.length?(o.openBlock(),o.createElementBlock("div",tl,[o.createElementVNode("div",nl,[e[0]||(e[0]=o.createElementVNode("p",{class:"text-[10px] mb-[2px] text-[#1F2937] leading-[1.2]"}," Дані відсутні ",-1)),o.createElementVNode("div",{class:o.normalizeClass([i.sizeClass(t.index),"w-full border border-gray-500"])},null,2)]),i.sortedSizes.length?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:0},o.renderList(i.sortedSizes,(l,c)=>{var h,d,p,m,g,u,b,y;return o.openBlock(),o.createElementBlock("div",{class:"w-[80px]",title:c===((h=i.sortedSizes)==null?void 0:h.length)-1?">"+l:c==((d=i.sortedSizes)==null?void 0:d.length)-1?">"+i.sortedSizes[((p=i.sortedSizes)==null?void 0:p.length)-1]:l+"-"+i.sortedSizes[c+1]},[o.createElementVNode("p",rl,o.toDisplayString(c===((m=i.sortedSizes)==null?void 0:m.length)-1?">"+parseInt(l):c==((g=i.sortedSizes)==null?void 0:g.length)-1?">"+parseInt(i.sortedSizes[((u=i.sortedSizes)==null?void 0:u.length)-1]):parseInt(l)+"-"+parseInt(i.sortedSizes[c+1])),1),o.createElementVNode("div",{class:o.normalizeClass([i.sizeClass(c),"w-full border border-r-0 border-gray-500"]),style:o.normalizeStyle({backgroundColor:((y=(b=r.palette)==null?void 0:b[n.color])==null?void 0:y[c])||n.color})},null,6)],8,sl)}),256)):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0)}const il=E(el,[["render",ol]]),al={},ll={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-map"};function cl(t,e){return o.openBlock(),o.createElementBlock("svg",ll,[...e[0]||(e[0]=[o.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),o.createElementVNode("path",{d:"M3 7l6 -3l6 3l6 -3v13l-6 3l-6 -3l-6 3v-13"},null,-1),o.createElementVNode("path",{d:"M9 4v13"},null,-1),o.createElementVNode("path",{d:"M15 7v13"},null,-1)])])}const dl=E(al,[["render",cl]]),hl={},pl={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-table"};function ul(t,e){return o.openBlock(),o.createElementBlock("svg",pl,[...e[0]||(e[0]=[o.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),o.createElementVNode("path",{d:"M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14z"},null,-1),o.createElementVNode("path",{d:"M3 10h18"},null,-1),o.createElementVNode("path",{d:"M10 3v18"},null,-1)])])}const fl=E(hl,[["render",ul]]),ml={},gl={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-align-box-left-stretch"};function bl(t,e){return o.openBlock(),o.createElementBlock("svg",gl,[...e[0]||(e[0]=[o.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14z"></path><path d="M9 17h-2"></path><path d="M13 12h-6"></path><path d="M11 7h-4"></path>',5)])])}const yl=E(ml,[["render",bl]]),xl={mixins:[A,Qe],components:{VsMapSetting:dn,VsClusterLegend:il,VsMapGoHome:un,VsList:fn,VsMapSlotLayers:hn,VsBar:Ie},data(){return{baseColor:"pink",kattotg:"",options:[{id:"map",text:"Карта",component:dl},{id:"table",text:"Таблиця",component:fl},{id:"chart",text:"Віджет",component:yl}],activeTab:"map",mapId:`map-${Math.floor(Math.random()*1e3)}`,layerId:`layer${Math.floor(Math.random()*1e3)}`,map:null,hoverData:null,data:null,coordinatesByMouse:[],showSetting:!1,popup:null,color:"#69D2E7",label:"<div><icon-map/></div>"}},async mounted(){await this.getMapData(),await this.createMap()},watch:{kattotg(){this.loadHandler()}},methods:{async getMapData(){const t=await V.get(`/bi-cluster?widget=${this.widget}&dashboard=${this.dashboard}`);this.data=t.data,this.$emit("update:widgetData",this.data),setTimeout(()=>{var e;return(e=this.map)==null?void 0:e.resize()})},async loadHandler(){var s,r,i,a;this.baseColor=((s=this.data.style)==null?void 0:s.color)||"blue";const t=["case"];(a=(i=(r=this.data)==null?void 0:r.sizes)==null?void 0:i.toReversed())==null||a.forEach((l,c)=>{var h,d;t.push([">",["get","metric"],l]),t.push((d=(h=Ye[this.baseColor])==null?void 0:h.toReversed())==null?void 0:d[c]),c++}),t.push("gray");const e={type:"polygon",color:t,opacity:.4};Object.assign(e,this.data.style||{}),this.map.getSource("bi")||this.addVtileLayer({id:"bi",url:`${window.location.origin}/api/bi-cluster-vtile/{z}/{x}/{y}.vmt?widget=${this.widget}&dashboard=${this.dashboard}&nocache=1`,style:e}),this.map.getLayer("highlighted")&&this.map.removeLayer("highlighted"),this.map.getSource("highlighted")&&this.map.removeSource("highlighted");const n=["case"];this.kattotg&&n.push(["==",["to-string",["get","name"]],String(this.kattotg)],"red"),n.push("transparent"),this.map.addLayer({id:"highlighted",type:"fill",source:"bi","source-layer":"bi",paint:{"fill-color":n,"fill-opacity":.6}})},async createMap(){var e,n;const t={version:8,glyphs:"https://cdn.softpro.ua/data/fonts/{fontstack}/{range}.pbf",sources:{},layers:[]};this.map=await new maplibregl.Map({container:this.mapId,style:t,center:[31,48.5],zoom:((n=(e=this.data)==null?void 0:e.style)==null?void 0:n.zoom)||5,minZoom:3,maxZoom:20,attributionControl:!1}),this.map.addControl(new maplibregl.NavigationControl({visualizePitch:!0})),this.map.on("load",()=>{this.loadHandler()}),this.map.on("mousemove",s=>{this.moveMouseHadler(s)}),this.map.on("mouseout",()=>{var s;this.showLegend=!1,this.showSetting=!1,this.coordinatesByMouse=0,(s=this.popup)==null||s.remove()})},moveMouseHadler(t){var e;try{const n=this.map.queryRenderedFeatures(t.point),s=((e=n[0])==null?void 0:e.properties)||{};if(!n.length){this.map.getCanvas().style.cursor="",this.popupElement&&this.popupElement.remove();return}this.map.getCanvas().style.cursor="pointer",this.popupElement&&this.popupElement.remove(),this.popupElement=document.createElement("div"),this.popupElement.className="absolute text-gray-800 border border-gray-200 rounded-lg shadow-md min-w-28",this.popupElement.style.backgroundColor="rgba(255, 255, 255, 0.7)",this.popupElement.innerHTML=`<div class="px-2 py-1 text-sm font-semibold text-gray-800 border-b border-gray-200 border-solid rounded-t-lg">
|
|
93
93
|
${(s==null?void 0:s.x)||(s==null?void 0:s.title)||(s==null?void 0:s.name)||""}
|
|
94
94
|
</div>
|
|
95
95
|
|
|
@@ -98,4 +98,4 @@ Please report this to https://github.com/markedjs/marked.`,e){const r="<p>An err
|
|
|
98
98
|
<span class="font-medium mr-[6px]">Значення</span>
|
|
99
99
|
</span>
|
|
100
100
|
<span>${(s==null?void 0:s.metric)||0}</span>
|
|
101
|
-
</div>`;const r=this.map.project(t.lngLat);this.popupElement.style.left=`${r.x}px`,this.popupElement.style.top=`${r.y-60}px`,this.map.getContainer().appendChild(this.popupElement)}catch(n){console.error(n)}}}},
|
|
101
|
+
</div>`;const r=this.map.project(t.lngLat);this.popupElement.style.left=`${r.x}px`,this.popupElement.style.top=`${r.y-60}px`,this.map.getContainer().appendChild(this.popupElement)}catch(n){console.error(n)}}}},wl={class:"h-full"},kl={class:"flex items-start justify-between mb-[6px] w-full"},_l={class:"text-gray-800 font-[600]"},El={class:"flex gap-2"},Sl=["onClick"],$l=["id"],Cl=["id"],Bl={class:"absolute flex flex-col right-[10px] top-[105px] gap-1"},Dl={class:"h-[calc(250px)]"};function Nl(t,e,n,s,r,i){var m,g,u,b,y,_,w,x,N,$;const a=o.resolveComponent("VsMapSetting"),l=o.resolveComponent("VsMapSlotLayers"),c=o.resolveComponent("VsMapGoHome"),h=o.resolveComponent("VsClusterLegend"),d=o.resolveComponent("VsList"),p=o.resolveComponent("VsBar");return o.openBlock(),o.createElementBlock("div",wl,[o.createElementVNode("div",kl,[o.createElementVNode("h3",_l,o.toDisplayString(t.title),1),o.createElementVNode("div",El,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.options,S=>(o.openBlock(),o.createElementBlock("button",{class:o.normalizeClass(["p-1 text-gray-700 border rounded",[r.activeTab===(S==null?void 0:S.id)?"ring-2 ring-blue-500":""]]),onClick:F=>r.activeTab=S==null?void 0:S.id},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(S==null?void 0:S.component),{height:"16",width:"16"}))],10,Sl))),256))])]),o.withDirectives(o.createElementVNode("div",{class:"relative w-full h-[calc(100%-40px)]",id:`wrapper-${r.mapId}`},[o.createElementVNode("div",{id:r.mapId,class:"h-full w-full flex items-end min-h-[250px]"},null,8,Cl),r.showSetting?(o.openBlock(),o.createBlock(a,{key:0,map:r.map,coordinates:r.coordinatesByMouse},null,8,["map","coordinates"])):o.createCommentVNode("",!0),o.createVNode(l,{map:r.map},null,8,["map"]),o.createElementVNode("div",Bl,[o.createVNode(c,{map:r.map,bbox:(m=r.data)==null?void 0:m.bounds},null,8,["map","bbox"])]),o.createVNode(h,{mapId:r.mapId,colors:(g=r.data)==null?void 0:g.colors,sizes:(u=r.data)==null?void 0:u.sizes,color:r.baseColor,changeOpacityItem:"true",cluster:"true"},null,8,["mapId","colors","sizes","color"])],8,$l),[[o.vShow,r.activeTab=="map"]]),o.withDirectives(o.createVNode(d,{mapId:r.mapId,source:(b=r.data)==null?void 0:b.rows,total:((y=r.data)==null?void 0:y.total)||0,count:((_=r.data)==null?void 0:_.count)||0,onKattotg:e[0]||(e[0]=S=>r.kattotg=S)},null,8,["mapId","source","total","count"]),[[o.vShow,r.activeTab=="table"]]),o.withDirectives(o.createElementVNode("div",Dl,[(x=(w=r.data)==null?void 0:w.rows)!=null&&x.length?(o.openBlock(),o.createBlock(p,{key:0,source:($=(N=r.data)==null?void 0:N.rows)==null?void 0:$.map(S=>({title:S==null?void 0:S.title,metric:S==null?void 0:S.metric}))},null,8,["source"])):o.createCommentVNode("",!0)],512),[[o.vShow,r.activeTab=="chart"]])])}const Vl=Object.freeze(Object.defineProperty({__proto__:null,default:E(xl,[["render",Nl]])},Symbol.toStringTag,{value:"Module"})),Tl={name:"VsTable",mixins:[A],data(){return{values:null,xs:null,products:null}},async mounted(){await this.getData(),this.prepareData()},methods:{onChangedData(){try{this.sourceData&&this.prepareData()}catch{}},prepareData(){try{const t=Array.from(new Set(this.sourceData.map(e=>e[this.dimensions[0]])));this.dimensions[0].includes("date")?this.xs=t.map(e=>v(e)):this.xs=[...t],this.products=this.dimensions.filter((e,n)=>n!=0),this.values=this.products.map((e,n)=>({name:e,data:this.sourceData.filter(s=>parseFloat(s[e])).map(s=>R(parseFloat(s[e])))}))}catch(t){console.error(t)}}}},Rl={class:"flex flex-col h-full pt-[16px] pb-[16px] space-y-4 rounded-xl"},zl={class:"overflow-auto h-full [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-stone-100 [&::-webkit-scrollbar-thumb]:bg-stone-300"},Ll={class:"inline-block min-w-full align-middle"},Ol={class:"relative min-w-full divide-y divide-gray-200 text-[12px]"},Al={class:"sticky top-0 bg-white w-full after:absolute after:content-[''] after:block after:w-full after:h-px after:bg-stone-200"},Fl={class:"space-x-2"},Ml={scope:"col",class:"xl:min-w-[120px] min-w-48"},Pl={class:"flex items-center px-1 py-3 font-medium text-gray-800 text-start gap-x-1"},Il={class:"divide-y divide-gray-200"},jl={class:"text-gray-600"};function Ul(t,e,n,s,r,i){return o.openBlock(),o.createElementBlock("div",Rl,[o.createElementVNode("div",zl,[o.createElementVNode("div",Ll,[o.createElementVNode("table",Ol,[o.createElementVNode("thead",Al,[o.createElementVNode("tr",Fl,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.dimensions,a=>(o.openBlock(),o.createElementBlock("th",Ml,[o.createElementVNode("div",Pl,o.toDisplayString(a),1)]))),256))])]),o.createElementVNode("tbody",Il,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.sourceData,(a,l)=>(o.openBlock(),o.createElementBlock("tr",{key:l},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.dimensions,(c,h)=>(o.openBlock(),o.createElementBlock("td",{key:h,class:"py-3 whitespace-nowrap"},[o.createElementVNode("span",jl,o.toDisplayString(a==null?void 0:a[c]),1)]))),128))]))),128))])])])])])}const ql=Object.freeze(Object.defineProperty({__proto__:null,default:E(Tl,[["render",Ul]])},Symbol.toStringTag,{value:"Module"}));T.VsBar=Ie,T.VsDashboard=Io,T.VsDonut=Pt,T.VsLine=jt,T.VsListBar=Ht,T.VsPie=It,T.VsPivotTable=Zt,T.VsProgressBar=qt,T.VsStat=Ut,T.VsWidget=Wt,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})});
|