"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=e=>e==null?void 0:e.map(t=>{const r=t.group.label;return t.label.includes(r)?t:{...t,label:`${r} - ${t.label}`}}),l=e=>{const{metadata:a}=e||{},t={},r=u((a==null?void 0:a.measures)||[]);return a&&r.forEach(n=>{t[n.value]=n}),t},c=e=>{const{metadata:a}=e||{},t={};return a&&a.types.forEach(r=>{t[r.dimension]={dimension:r.dimension,category:r.category,items:r.items}}),t},p=(e,a)=>e?e.labels&&e.labels[a.toUpperCase()]?e.labels[a.toUpperCase()]:e.label?e.label:e.value:null,i=(e,a,t,r)=>new Intl.Collator(a,{caseFirst:"upper",numeric:!0,sensitivity:"variant"}).compare(e?r:t,e?t:r),m=(e,a,t)=>!isNaN(a)&&!isNaN(t)?e?Number(t)-Number(a):Number(a)-Number(t):0,o=e=>{const[a,t]=e.split(" "),n=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"].indexOf(a),s=parseInt(t,10);return(n===-1||isNaN(s))&&console.error(`Invalid month/year format: ${e}`),new Date(s,n,1)},N=(e,a,t)=>{let r=Date.parse(a),n=Date.parse(t);return isNaN(r)&&(r=o(a)),isNaN(n)&&(n=o(t)),!isNaN(r)&&!isNaN(n)?e?n-r:r-n:0};exports.alphaSort=i;exports.dateSort=N;exports.getTranslatedValue=p;exports.measuresMap=l;exports.numericSort=m;exports.typesMap=c;
