@carto/meridian-ds 1.4.0 → 1.4.1-0

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.
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),u=require("react"),o=require("@mui/material"),Z=require("react-intl"),j=require("../TablePaginationActions-Bv-6vZ7z.cjs"),jn=require("echarts-for-react"),wn=require("react-window"),Te=require("../SwatchSquare-C-QxZLYN.cjs"),ee=require("@mui/icons-material"),bn=require("../Alert-C0xmyi3Z.cjs"),Me=require("../paletteUtils-DLQVT9qo.cjs");function Bt(){let e=!1;return window.PointerEvent&&"maxTouchPoints"in navigator?navigator.maxTouchPoints>0&&(e=!0):(window.matchMedia&&window.matchMedia("(any-pointer:coarse)").matches||window.TouchEvent||"ontouchstart"in window)&&(e=!0),e}function te(e){return!e||typeof e!="object"?e:`${e.prefix??""}${e.value}${e.suffix??""}`}const Sn=[],In={},lt=e=>e;function kn(e,n){if(!e||Array.isArray(e)&&e.length===0)return null;const i=Array.isArray(e)?e:[e];let r="";return r+=String(i[0].axisValueLabel),r+=i.map(({seriesName:s,value:l,data:a,marker:p})=>{const c=s?s+": ":"",g=te(n(Number(l))),h=a,d=`<div style="margin-left: 8px; display: inline">
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),u=require("react"),o=require("@mui/material"),Z=require("react-intl"),j=require("../TablePaginationActions-7wkkiCXh.cjs"),jn=require("echarts-for-react"),wn=require("react-window"),Te=require("../SwatchSquare-C-QxZLYN.cjs"),ee=require("@mui/icons-material"),bn=require("../Alert-B2JgFj6Y.cjs"),Me=require("../paletteUtils-DLQVT9qo.cjs");function Bt(){let e=!1;return window.PointerEvent&&"maxTouchPoints"in navigator?navigator.maxTouchPoints>0&&(e=!0):(window.matchMedia&&window.matchMedia("(any-pointer:coarse)").matches||window.TouchEvent||"ontouchstart"in window)&&(e=!0),e}function te(e){return!e||typeof e!="object"?e:`${e.prefix??""}${e.value}${e.suffix??""}`}const Sn=[],In={},lt=e=>e;function kn(e,n){if(!e||Array.isArray(e)&&e.length===0)return null;const i=Array.isArray(e)?e:[e];let r="";return r+=String(i[0].axisValueLabel),r+=i.map(({seriesName:s,value:l,data:a,marker:p})=>{const c=s?s+": ":"",g=te(n(Number(l))),h=a,d=`<div style="margin-left: 8px; display: inline">
2
2
  ${c}${g}${String((h==null?void 0:h.unit)||"")}
3
3
  </div>`;return`<div style="margin-top: 4px">${String(p)}${d}</div>`}).join(" "),r}function Tn({height:e,labels:n=In,yAxisData:i,selectedBars:r=Sn,series:s,colors:l,tooltip:a=!0,tooltipFormatter:p=kn,xAxisFormatter:c=lt,yAxisFormatter:g=lt,onSelectedBarsChange:h,animation:d=!0,filterable:y=!0,stacked:f=!0,...m}){const v=o.useTheme(),x=u.useMemo(()=>(s??[]).map(I=>n[I]??I),[s,n]),b=u.useMemo(()=>Array.isArray(i[0])?i:[i],[i]),S=u.useMemo(()=>typeof l=="string"?[l]:Array.isArray(l)&&l.length?l:b.length<=1||x.length===1?[v.palette.secondary.main]:b.length===2||x.length===2?[v.palette.secondary.light,v.palette.secondary.dark]:Object.values(v.palette.qualitative.bold||{}),[l,v,b,x]);return{...m,tooltip:a,tooltipFormatter:p,xAxisFormatter:c,yAxisFormatter:g,onSelectedBarsChange:h,animation:d,filterable:y,stacked:f,labels:n,height:e??parseInt(v.spacing(22)),selectedBars:Mn(r),yAxisData:b,colors:S,series:x}}function Mn(e){return(e??[]).length?e.map(n=>Array.isArray(n)&&n.length===2?n:Array.isArray(n)?[...Array(2)].map((r,s)=>n[s]??0):[n,0]):[]}var Cn=function e(n,i){if(n===i)return!0;if(n&&i&&typeof n=="object"&&typeof i=="object"){if(n.constructor!==i.constructor)return!1;var r,s,l;if(Array.isArray(n)){if(r=n.length,r!=i.length)return!1;for(s=r;s--!==0;)if(!e(n[s],i[s]))return!1;return!0}if(n.constructor===RegExp)return n.source===i.source&&n.flags===i.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===i.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===i.toString();if(l=Object.keys(n),r=l.length,r!==Object.keys(i).length)return!1;for(s=r;s--!==0;)if(!Object.prototype.hasOwnProperty.call(i,l[s]))return!1;for(s=r;s--!==0;){var a=l[s];if(!e(n[a],i[a]))return!1}return!0}return n!==n&&i!==i};const xe=j.getDefaultExportFromCjs(Cn);class ye extends jn{componentDidUpdate(n){const{shouldSetOption:i}=this.props;if(typeof i=="function"&&!i(n,this.props))return;if(!xe(n.theme,this.props.theme)||!xe(n.opts,this.props.opts)){this.dispose(),this.renderNewEcharts();return}const r=this.getEchartsInstance();xe(n.onEvents,this.props.onEvents)||(this.offEvents(r,n.onEvents),this.bindEvents(r,this.props.onEvents));const s=["option","notMerge","lazyUpdate","showLoading","loadingOption"];xe(at(this.props,s),at(n,s))||this.updateEChartsOption(),(!xe(n.style,this.props.style)||!xe(n.className,this.props.className))&&this.resize()}updateEChartsOption(){const n=this.props.option,i=this.props.loadingOption||null,{lazyUpdate:r,showLoading:s}=this.props,l=this.getEchartsInstance();return l.setOption(n,{replaceMerge:["series"],lazyUpdate:r}),s?l.showLoading(i):l.hideLoading(),l}offEvents(n,i){if(i)for(const r in i)typeof r=="string"&&n.off(r)}}function at(e,n){const i={};return n.forEach(r=>{i[r]=e[r]}),i}const _e=240,Pt=o.styled(o.Box)(({theme:e})=>({display:"flex",alignItems:"flex-end",justifyContent:"space-between",position:"relative",padding:e.spacing(0,2),"&::before":{content:'""',position:"absolute",top:0,right:0,left:0,bottom:0,backgroundSize:e.spacing(4,4),backgroundImage:`linear-gradient(to bottom, ${e.palette.grey[50]} 1px, transparent 1px)`,transform:"scaleY(-1)"}})),Lt=o.styled(o.Box)(({theme:e})=>({display:"flex",alignItems:"flex-end",justifyContent:"space-between",backgroundImage:`linear-gradient(${e.palette.grey[50]} 0.5px, transparent 0.5px, transparent calc(100% - 0.5px), ${e.palette.grey[50]} calc(100% - 0.5px)), linear-gradient(90deg, ${e.palette.grey[50]} 0.5px, transparent 0.5px, transparent calc(100% - 0.5px), ${e.palette.grey[50]} calc(100% - 0.5px))`,backgroundSize:"8.33% 20%",border:`0.5px solid ${e.palette.grey[50]}`})),je=o.styled(o.Skeleton)(({theme:e})=>({flex:1,maxWidth:e.spacing(12),"& + &":{marginLeft:e.spacing(1)}})),ne=o.styled(o.Skeleton)(({theme:e})=>({flex:1,maxWidth:e.spacing(8),"& + &":{marginLeft:"1px"}})),An=o.styled(o.Skeleton)(({theme:e})=>({backgroundColor:e.palette.common.white})),ct=o.styled(o.Skeleton)(({theme:e})=>({backgroundColor:e.palette.grey[100]}));function En({height:e}){return t.jsxs(t.Fragment,{children:[t.jsx(o.Box,{mb:2,children:t.jsx(o.Skeleton,{width:48,height:8})}),t.jsxs(Pt,{style:{height:e||_e},children:[t.jsx(je,{variant:"rectangular",height:"20%"}),t.jsx(je,{variant:"rectangular",height:"40%"}),t.jsx(je,{variant:"rectangular",height:"60%"}),t.jsx(je,{variant:"rectangular",height:"20%"}),t.jsx(je,{variant:"rectangular",height:"80%"})]})]})}function de(e){const[n,i]=u.useState(!1),[r,s]=u.useState(!1);return u.useEffect(()=>{e&&!r&&(i(!0),s(!0)),e||i(!1)},[e,r]),{showSkeleton:n}}const Bn=Bt(),Pn=o.styled(o.Grid)(({theme:e})=>({marginBottom:e.spacing(2),flexDirection:"row",justifyContent:"space-between",alignItems:"center","& .MuiTypography-caption":{color:e.palette.text.secondary}})),Ln=o.styled(o.Link)(({theme:e})=>({...e.typography.caption,cursor:"pointer"}));function Dn(e){const{yAxisData:n,xAxisData:i,series:r,selectedBars:s,onSelectedBarsChange:l,tooltip:a,tooltipFormatter:p,labels:c,colors:g,xAxisFormatter:h,yAxisFormatter:d,stacked:y,height:f,filterable:m,animation:v,isLoading:x}=Tn(e),b=r.length>1,S=o.useTheme(),I=Z.useIntl(),T=j.useImperativeIntl(I),{showSkeleton:w}=de(!!x),C=u.useMemo(()=>({show:a,trigger:"axis",padding:[parseInt(S.spacing(.5)),parseInt(S.spacing(1))],borderWidth:0,textStyle:{...S.typography.caption,fontSize:11,color:S.palette.common.white},backgroundColor:S.palette.black[90],position:function(k,O,G,R,H){const q={top:0};return H.contentSize[0]<H.viewSize[0]-k[0]?q.left=k[0]:q.right=H.viewSize[0]-k[0],q},formatter:k=>p(k,d)}),[S,a,p,d]),M=u.useMemo(()=>i.map(k=>te(h(c[k]??String(k)))),[i,c,h]),D=u.useMemo(()=>({type:"category",axisLine:{show:!1},axisTick:{show:!1},axisLabel:{...S.typography.overlineDelicate,padding:[parseInt(S.spacing(.5)),0,0,0]},data:M}),[S,M]),E=u.useMemo(()=>{let k=[];return y?k=n.reduce((O,G)=>(G.forEach((R,H)=>O[H]=(O[H]??0)+(R??Number.MIN_SAFE_INTEGER)),O),[]):k=n.flat().map(O=>O??Number.MIN_SAFE_INTEGER),Math.max(...k)},[n,y]),L=u.useMemo(()=>({type:"value",axisLabel:{margin:0,verticalAlign:"bottom",padding:[0,0,parseInt(S.spacing(1.25)),0],show:!0,showMaxLabel:!0,showMinLabel:!1,inside:!0,color:k=>k>=E?S.palette.black[60]:"transparent",...S.typography.overlineDelicate,formatter:k=>te(d(k))},axisLine:{show:!1},axisTick:{show:!1},splitLine:{show:!0,onZero:!1,lineStyle:{color:S.palette.black[4]}}}),[S,E,d]),P=u.useMemo(()=>n.map((k,O)=>({type:"bar",name:r[O]??"",animation:v,barMaxWidth:100,data:k.map((G,R)=>{const H=s.some(([F,Y=0])=>F===R&&Y===O),q=!!s.length&&!H;return{value:G,...q&&{itemStyle:{color:S.palette.black[25]},disabled:!0}}}),...y&&{stack:"total"},...!Bn&&{emphasis:{focus:"series",itemStyle:{color:o.darken(g[O]??"#000",.25)}}}})),[v,g,r,n,s,y,S]),N=u.useMemo(()=>({grid:{left:M.length>=4?dt(String(M[0]),M.length):0,top:parseInt(S.spacing(2)),right:M.length>=4?dt(String(M[M.length-1]),M.length):0,bottom:0,containLabel:!0},axisPointer:{lineStyle:{color:S.palette.black[40]}},color:g,tooltip:C,xAxis:D,yAxis:L,series:P}),[M,S,g,C,D,L,P]),V=()=>{l&&l([],[])},_=k=>{k.key==="Enter"&&V()},B=u.useCallback(k=>{if(l){const O=[...s],{dataIndex:G,componentIndex:R}=k,H=O.findIndex(([F,Y=0])=>G===F&&R===Y);H===-1?O.push([G,R]):O.splice(H,1);const q=O.map(([F,Y=0])=>({xAxis:i[F],serie:r[Y],yAxis:n[Y][F]}));l(b?O:O.map(F=>F[0]),q)}},[n,l,s,i,r,b]),$=u.useMemo(()=>m?{click:B}:{},[m,B]);return w?t.jsx(En,{height:f}):t.jsxs("div",{children:[l&&t.jsxs(Pn,{container:!0,children:[t.jsx(j.Typography,{variant:"caption",children:s.length>0?T.formatMessage({id:"c4r.widgets.bar.selectedItems"},{items:s.length}):T.formatMessage({id:"c4r.widgets.bar.all"})}),s&&s.length>0&&t.jsx(Ln,{onClick:()=>V(),onKeyDown:_,underline:"hover",tabIndex:0,children:T.formatMessage({id:"c4r.widgets.bar.clear"})})]}),!!N&&t.jsx(ye,{option:N,lazyUpdate:!0,notMerge:!0,onEvents:$,style:{height:f}})]})}function dt(e="",n=0){return n<=15&&e.length<=8?0:e.length*8.5/6}const ue="__rest__",me="Others";var pe=(e=>(e.RANKING="ranking",e.FIXED="fixed",e))(pe||{});const Dt=o.styled(o.Grid)(({theme:e})=>({maxHeight:e.spacing(40),overflow:"auto",padding:0})),Nt=o.styled(o.Grid,{shouldForwardProp:e=>e!=="selectable"&&e!=="name"&&e!=="unselected"})(({theme:e,selectable:n,name:i,unselected:r})=>({flexDirection:"row",maxWidth:"100%",padding:e.spacing(.5,.25),margin:0,"> .MuiGrid-item":{paddingTop:0,paddingLeft:0},"&:focus-visible":{outline:"none !important",boxShadow:`inset 0 0 0 2px ${e.palette.primary.main} !important`},...r&&{color:e.palette.text.disabled,".progressbar div":{backgroundColor:e.palette.text.disabled}},...i!==ue&&n&&{cursor:"pointer",flexWrap:"nowrap","&:hover .progressbar div":{backgroundColor:e.palette.secondary.dark}},...i===ue&&{cursor:"default",".progressbar div":{backgroundColor:e.palette.text.disabled}}})),ut=o.styled(o.Grid)(({theme:{spacing:e,palette:n}})=>({flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:e(1.5),paddingRight:e(1),"& .MuiTypography-caption":{color:n.text.secondary}})),Nn=o.styled(o.Grid)(({theme:e})=>({height:e.spacing(.5),width:"100%",margin:e.spacing(.5,0,.25,0),borderRadius:e.spacing(.5),backgroundColor:e.palette.action.disabledBackground,"& div":{width:0,height:"100%",borderRadius:e.spacing(.5),backgroundColor:e.palette.secondary.main,transition:`background-color ${e.transitions.easing.sharp} ${e.transitions.duration.shortest}ms,
4
4
  width ${e.transitions.easing.sharp} ${e.transitions.duration.complex}ms`}})),On=o.styled(o.Grid,{shouldForwardProp:e=>e!=="isSelectable"})(({theme:e,isSelectable:n})=>({...n&&{width:`calc(100% - ${e.spacing(4)})`}})),$n=o.styled(j.Typography)(({theme:e})=>({fontWeight:e.typography.fontWeightBold,marginRight:e.spacing(2)})),Ae=o.styled(o.Link)(({theme:e})=>({...e.typography.caption,cursor:"pointer","& + hr":{margin:e.spacing(0,1)}})),Rn=o.styled(o.Box)(({theme:e})=>({...e.typography.body2})),pt=o.styled(o.Button)(({theme:e})=>({position:"absolute",left:"-999px",top:"-1px",width:"1px",height:"1px",display:"inline-flex","&:focus-visible":{position:"static",width:"auto",height:"auto",marginTop:e.spacing(2)}})),Fn=o.styled(o.Skeleton)(({theme:e})=>({marginTop:e.spacing(1.25),marginBottom:e.spacing(1.75)})),Wn=e=>e%2===1,Ot=()=>t.jsxs(t.Fragment,{children:[t.jsx(o.Skeleton,{width:48,height:8}),t.jsx(Dt,{container:!0,mt:3,children:[...Array(6)].map((e,n)=>t.jsxs(Nt,{container:!0,spacing:1,children:[t.jsxs(o.Grid,{container:!0,item:!0,direction:"row",justifyContent:"space-between",children:[t.jsx(o.Skeleton,{width:Wn(n)?72:48,height:8}),t.jsx(o.Skeleton,{width:48,height:8})]}),t.jsx(Fn,{height:4,width:"100%"})]},n))})]});function $t(e){const n=u.useRef();return u.useEffect(()=>{n.current=e}),n.current}function Xe({start:e,end:n,duration:i,drawFrame:r,requestRef:s}){if(e===n&&!(e===0&&n===0))return;const a=n-e;let p=e;const c=a/(i/1e3*60),g=()=>{p+=c,r(Math.floor(p)),c>0&&p<n||c<0&&p>n?s.current=requestAnimationFrame(g):r(n)};s.current=requestAnimationFrame(g)}function _n({start:e,end:n,duration:i,drawFrame:r,requestRef:s}){if(e.length===n.length&&e.every((f,m)=>f.value===n[m].value))return;let a=n.map((f,m)=>e[m]&&e[m].name===f.name?{...f,value:e[m].value}:f),p=0;const c=a.map((f,m)=>n[m].value-f.value);if(c.every(f=>f===0)){r(n);return}const h=i/1e3*60,d=c.map(f=>f/h),y=()=>{p<h?(a=a.map((f,m)=>{const v=Math.floor(f.value+d[m]),x=m>0&&Math.floor(f.value+d[m-1]);return{...f,value:v===x?n[m].value:v}}),r(a),p++,s.current=requestAnimationFrame(y)):r(n)};s.current=requestAnimationFrame(y)}const Gn=[],Hn={},zn=e=>e,Ve=()=>{},Yn=e=>e.reduce((n,i)=>n+(i.value??0),0);function Vn({data:e,formatter:n=zn,labels:i=Hn,maxItems:r=5,order:s=pe.RANKING,selectedCategories:l=Gn,onSelectedCategoriesChange:a=Ve,onMaxItemsOverflow:p=Yn,animation:c=!0,filterable:g=!0,searchable:h=!0,isLoading:d}){const y=o.useTheme(),[f,m]=u.useState([]),[v,x]=u.useState(1),[b,S]=u.useState(!1),[I,T]=u.useState(""),[w,C]=u.useState([]),[M,D]=u.useState([]),[E,L]=u.useState([]),P=u.useRef(null),N=u.useRef(),V=$t(E),_=u.useRef([]),{showSkeleton:B}=de(!!d),$=Z.useIntl(),k=j.useImperativeIntl($);function O(A){return f.reduce((z,U)=>(A.includes(U.name)&&z.push(U.name),z),[])}function G(A){if(A!==ue){let z;l.includes(A)?z=l.filter(U=>U!==A):z=[...l,A],a&&a(z)}}const R=()=>a([]),H=A=>{A.key==="Enter"&&R()},q=()=>{a([]),C([])},F=A=>{A.key==="Enter"&&q()},Y=()=>{C(O(l))},J=A=>{A.key==="Enter"&&Y()},ie=()=>{const A=O(M);a([...A]),C([...A]),D([]),S(!1),T("")},re=A=>{A.key==="Enter"&&ie()},W=()=>{T(""),S(!1)},X=A=>{if(A!==ue){let z;M.includes(A)?z=M.filter(U=>U!==A):z=[...M,A],D(z)}},K=A=>{A.currentTarget.scrollIntoView()},Q=A=>{T(A.currentTarget.value)},ge=()=>{S(!0),D([...l])},ve=u.useCallback(A=>{if(b)return I?A.filter(z=>{var se;if(!z.name)return!1;const U=String(z.name);return!!(U.toLowerCase().includes(I.toLowerCase())||(se=i[U])!=null&&se.toLowerCase().includes(I.toLowerCase()))}):A;if(w.length)return w.reduce((U,se)=>{const Ce=A.find(le=>le.name===se);return U.push({name:se,value:Ce?Ce.value:null}),U},[]);{const z=A.slice(0,r);if(z.length<A.length){const U={name:ue,value:p(A.slice(r))};return[...z,U]}else return z}},[w,i,r,I,b,p]),he=u.useCallback(()=>{const A=w.length;return A?e.length-A:e.length-r},[e,r,w]),it=u.useCallback(A=>A===ue?`Others ${h?"":`(${he()})`}`:i[String(A)]??String(A),[he,i,h]),hn=u.useCallback(A=>A>=v?A!=null?"100%":0:`${(A||0)*100/v}%`,[v]);u.useEffect(()=>{l.length===0&&C([])},[l]),u.useEffect(()=>{if(e){if(s===pe.RANKING){const A=[...e].sort((U,se)=>(se.value??0)-(U.value??0)),z=ve(A);z.length>0?x(z[0].value??0):x(1),m(z)}else if(s===pe.FIXED){x(Math.max(...e.map(z=>z.value??0)));const A=ve(e);m(A)}}},[w,ve,e,i,r,s,I,b]),u.useEffect(()=>{V&&(_.current=V)},[V]),u.useEffect(()=>{if(c)return _n({start:(_.current||[]).map(A=>({...A,value:A.value??0})),end:f.map(A=>({...A,value:A.value??0})),duration:500,drawFrame:A=>L(A),requestRef:P}),()=>{P.current&&cancelAnimationFrame(P.current)};L(f)},[c,f]),u.useEffect(()=>{b&&N.current&&N.current.focus()},[b,N]);function fn({data:A,onCategoryClick:z}){const U=n(A.value??0),[se,Ce]=u.useState(!1),le=u.useRef(null),ze=()=>{var rt,st;const Ye=(((rt=le==null?void 0:le.current)==null?void 0:rt.scrollWidth)??0)>(((st=le==null?void 0:le.current)==null?void 0:st.clientWidth)??0);Ce(Ye)};u.useEffect(()=>(ze(),window.addEventListener("resize",ze),()=>{window.removeEventListener("resize",ze)}),[]);const yn=Ye=>{Ye.key==="Enter"&&z()},vn=!b&&l.length>0&&!l.includes(A.name);return t.jsxs(Nt,{container:!0,direction:"row",spacing:1,onClick:g?z:Ve,onKeyDown:g?yn:Ve,selectable:g,unselected:vn,name:A.name===ue?ue:"",tabIndex:g?0:-1,children:[g&&b&&t.jsx(o.Grid,{item:!0,mr:1,children:t.jsx(o.Checkbox,{checked:M.includes(A.name),tabIndex:-1})}),t.jsxs(On,{container:!0,item:!0,xs:!0,isSelectable:b,children:[t.jsxs(o.Grid,{container:!0,item:!0,direction:"row",justifyContent:"space-between",wrap:"nowrap",children:[t.jsx(o.Tooltip,{title:it(A.name),disableHoverListener:!se,children:t.jsx($n,{variant:"body2",noWrap:!0,ref:le,children:it(A.name)})}),typeof U=="object"&&U!==null?t.jsxs("span",{children:[U.prefix,U.value,U.suffix]}):t.jsx("span",{children:U})]}),t.jsx(Nn,{className:"progressbar",item:!0,children:t.jsx("div",{style:{width:hn(A.value??0)}})})]})]})}if((e==null?void 0:e.length)===0||B)return t.jsx(Ot,{});const xn=({index:A,style:z})=>{const U=E[A];return U?t.jsx("div",{style:z,children:t.jsx(fn,{data:U,onCategoryClick:()=>b?X(U.name):G(U.name)})}):null},mn=()=>b?320:E.length<=r?E.length*38:w.length>0?w.length*38:(r+1)*38;return t.jsxs(Rn,{children:[g&&f.length>0&&t.jsxs(ut,{container:!0,children:[t.jsx(j.Typography,{variant:"caption",children:l.length>0?k.formatMessage({id:"c4r.widgets.category.selectedItems"},{items:l.length}):k.formatMessage({id:"c4r.widgets.category.all"})}),b?t.jsx(Ae,{onClick:ie,onKeyDown:re,underline:"hover",tabIndex:0,"data-testid":"primaryApplyButton",children:k.formatMessage({id:"c4r.widgets.category.apply"})}):w.length>0?t.jsx(Ae,{onClick:q,onKeyDown:F,underline:"hover",tabIndex:0,children:k.formatMessage({id:"c4r.widgets.category.unlock"})}):l.length>0&&t.jsxs(o.Grid,{container:!0,direction:"row",justifyContent:"flex-end",item:!0,xs:!0,children:[t.jsx(Ae,{onClick:Y,onKeyDown:J,underline:"hover",tabIndex:0,children:k.formatMessage({id:"c4r.widgets.category.lock"})}),t.jsx(o.Divider,{orientation:"vertical",flexItem:!0}),t.jsx(Ae,{onClick:R,onKeyDown:H,underline:"hover",tabIndex:0,children:k.formatMessage({id:"c4r.widgets.category.clear"})})]})]}),e.length>r&&b&&t.jsxs(ut,{container:!0,children:[t.jsx(o.TextField,{size:"small",sx:{mt:-.5},placeholder:k.formatMessage({id:"c4r.widgets.category.search"}),onChange:Q,onFocus:K,InputProps:{startAdornment:t.jsx(o.InputAdornment,{position:"start",children:t.jsx(Te.Search,{})})},inputProps:{tabIndex:0,ref:N}}),t.jsx(pt,{size:"small",onClick:W,children:k.formatMessage({id:"c4r.widgets.category.cancel"})})]}),t.jsx(Dt,{container:!0,item:!0,children:E.length?t.jsx(wn.FixedSizeList,{outerElementType:u.forwardRef((A,z)=>t.jsx("div",{ref:z,"data-testid":"category-widget-list",...A})),height:mn(),width:"100%",itemCount:E.length,itemSize:y.spacingValue*4.5,children:xn}):t.jsxs(o.Box,{children:[t.jsx(j.Typography,{variant:"body2",children:k.formatMessage({id:"c4r.widgets.category.noResults"})}),t.jsx(j.Typography,{component:"p",variant:"caption",mb:2,children:k.formatMessage({id:"c4r.widgets.category.noResultsMessage"},{searchValue:I})})]})}),b&&t.jsx(pt,{size:"small",onClick:ie,children:k.formatMessage({id:"c4r.widgets.category.apply"})}),e.length>r&&h?b?t.jsx(o.Box,{mt:1.5,children:t.jsx(o.Button,{size:"small",color:"primary",onClick:W,"data-testid":"primaryCancelButton",children:k.formatMessage({id:"c4r.widgets.category.cancel"})})}):t.jsx(o.Box,{mt:1.5,children:t.jsx(o.Button,{"data-testid":"show-all-categories-button",size:"small",color:"primary",startIcon:t.jsx(Te.Search,{}),onClick:ge,children:k.formatMessage({id:"c4r.widgets.category.searchInfo"},{elements:he()})})}):null]})}const Rt=()=>t.jsx(o.Box,{pt:.5,children:t.jsx(o.Skeleton,{height:24,width:120})}),Un=o.styled("span")(()=>({marginRight:"2px"})),qn=o.styled("span")(()=>({marginLeft:"2px"})),Ee="-",Xn=e=>e;function Kn({data:e=Ee,formatter:n=Xn,animation:i=!0,isLoading:r=!1}){const[s,l]=u.useState(Ee),a=u.useRef(null),p=$t(s),c=u.useRef(p),{showSkeleton:g}=de(!!r);u.useEffect(()=>(typeof e=="number"&&i?Xe({start:c.current||0,end:e,duration:500,drawFrame:f=>l(f),requestRef:a}):typeof e=="object"&&i&&e&&c.current&&e.value!==null&&e.value!==void 0?Xe({start:Number(c.current.value),end:Number(e.value),duration:1e3,drawFrame:f=>l({value:f,prefix:e.prefix,suffix:e.suffix}),requestRef:a}):l(e??Ee),()=>{a.current&&cancelAnimationFrame(a.current)}),[i,e,l]);const h=n(s),d=typeof h=="object"&&h!==null,y=h===Ee;return g?t.jsx(Rt,{}):d?t.jsxs(j.Typography,{variant:"h5",component:"div",weight:"medium",children:[t.jsx(Un,{children:h.prefix}),h.value,t.jsx(qn,{children:h.suffix})]}):t.jsx(j.Typography,{variant:"h5",component:"div",weight:"medium",color:y?"text.disabled":"default",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",children:h})}const gt={};let we=null;function Zn({data:e,filterable:n,selectedBars:i,onSelectedBarsChange:r,echartsInstance:s}){const l=o.useTheme(),[a,p]=u.useState([]),c=u.useMemo(()=>s==null?void 0:s.getZr(),[s]);u.useEffect(()=>{function h(y){if(s){const[f]=s.convertFromPixel({seriesIndex:0},[y.offsetX,y.offsetY]);we=f??null}}function d(y){if(s&&we!==null){const[f]=s.convertFromPixel({seriesIndex:0},[y.offsetX,y.offsetY]);p(we===f?[]:[we,f].sort((m,v)=>m-v))}}if(s&&n){const y=Ue(c,"mousedown",h),f=Ue(c,"mousemove",d);return()=>{y==null||y(),f==null||f()}}},[c,s,n]),u.useEffect(()=>{function h(){if(a.length===2&&r){const d=e.reduce((y,f,m)=>((a[0]>=f[0]&&a[0]<=f[1]||a[1]>=f[0]&&a[1]<=f[1]||a[0]<=f[0]&&a[1]>=f[1])&&y.push(m),y),[]);r(e.length===d.length?[]:d)}p([]),we=null}if(s&&n)return Ue(c,"mouseup",h)},[c,s,a,e,r,n]);const g=u.useCallback(h=>{if(r){const d=new Set(i);d.has(h.dataIndex)?d.delete(h.dataIndex):d.add(h.dataIndex),r(d.size===e.length?[]:Array.from(d))}},[r,i,e.length]);return{markAreaOptions:a.length===2&&{data:[[{coord:[a[0]]},{coord:[a[1]]}]],itemStyle:{color:l.palette.primary.main,opacity:.2}},onEvents:n?{click:g}:{}}}function Ue(e,n,i){if(e!=null&&e.handler)return gt[n]=i,e.on(n,i),()=>{gt[n]&&(e!=null&&e.handler)&&e.off(n,i)}}function Jn({height:e}){return t.jsxs(t.Fragment,{children:[t.jsx(o.Box,{mb:2,children:t.jsx(o.Skeleton,{width:48,height:8})}),t.jsxs(Lt,{style:{height:e??_e},children:[t.jsx(ne,{variant:"rectangular",height:"20%"}),t.jsx(ne,{variant:"rectangular",height:"40%"}),t.jsx(ne,{variant:"rectangular",height:"60%"}),t.jsx(ne,{variant:"rectangular",height:"20%"}),t.jsx(ne,{variant:"rectangular",height:"80%"}),t.jsx(ne,{variant:"rectangular",height:"50%"}),t.jsx(ne,{variant:"rectangular",height:"20%"}),t.jsx(ne,{variant:"rectangular",height:"40%"}),t.jsx(ne,{variant:"rectangular",height:"60%"}),t.jsx(ne,{variant:"rectangular",height:"20%"}),t.jsx(ne,{variant:"rectangular",height:"80%"}),t.jsx(ne,{variant:"rectangular",height:"50%"})]})]})}const Qn=Bt(),eo=o.styled(o.Grid)(({theme:e})=>({marginBottom:e.spacing(2),flexDirection:"row",justifyContent:"space-between",alignItems:"center","& .MuiTypography-caption":{color:e.palette.text.secondary}})),to=o.styled(o.Link)(({theme:e})=>({...e.typography.caption,cursor:"pointer"})),no=[],oo=()=>{},Oe=e=>e;function io(e,n=Oe,i=Oe){if(!e)return null;if(Array.isArray(e)&&e.length===0)return;const r=Array.isArray(e)?e[0].marker:e.marker,s=Array.isArray(e)?e[0].data:e.data;if((s==null?void 0:s.value)===void 0)return;const[l,a,p]=s.value,c=te(n(l)),g=te(n(a)),h=te(i(p)),d=`${c} <span style="vertical-align: 1px;">—</span> ${g}`,y=`<div style="margin-left: 8px; display: inline">${h}</div>`;return`${d} <div style="margin-top: 4px">${String(r)}${y}</div>`}function ro({data:e,ticks:n,min:i,max:r,xAxisFormatter:s=Oe,yAxisFormatter:l=Oe,yAxisType:a="dense",selectedBars:p=no,onSelectedBarsChange:c=oo,tooltip:g=!0,tooltipFormatter:h=io,animation:d=!0,filterable:y=!0,height:f=200,isLoading:m}){const v=Z.useIntl(),x=o.useTheme(),b=j.useImperativeIntl(v),{showSkeleton:S}=de(!!m),I=!!y&&!!c,[T,w]=u.useState(),C=k=>w(k),M=u.useMemo(()=>ao(e,n,i,r),[e,n,i,r]),{onEvents:D,markAreaOptions:E}=Zn({data:M,filterable:I,selectedBars:p,onSelectedBarsChange:c,echartsInstance:T}),L=u.useMemo(()=>({show:g,trigger:"item",padding:[j.SPACING*.5,j.SPACING],borderWidth:0,textStyle:{...x.typography.caption,fontSize:11,color:x.palette.common.white},backgroundColor:x.palette.black[90],confine:!0,position:"top",formatter(k){return h(k,s,l)}}),[x,g,h,s,l]),P=u.useMemo(()=>({min:i,max:r,interval:(r-i)/M.length,axisLine:{show:!1},splitLine:{show:!0,lineStyle:{color:x.palette.black[4]}},axisTick:{show:!1},axisLabel:{showMinLabel:!0,showMaxLabel:!0,...x.typography.overlineDelicate,hideOverlap:!0,padding:[j.SPACING*.5,j.SPACING*.5,0,j.SPACING*.5],formatter:k=>{const O=te(s(k));return k===i?so(O):k===r?lo(O):O},color:x.palette.black[60]}}),[i,r,M.length,x,s]),N=u.useMemo(()=>{const k={margin:0,verticalAlign:"bottom",padding:[0,0,j.SPACING*1.25,0],inside:!0,color:R=>{const H=Math.max(...e.map(F=>F??Number.MIN_SAFE_INTEGER))||1;let q="transparent";return R>=H&&(q=x.palette.black[60]),q},...x.typography.overlineDelicate,formatter:R=>te(l(R))},O={verticalAlign:"middle",padding:[0,0,0,j.SPACING*.5],color:x.palette.black[60]},G=a==="dense"?k:O;return{type:"value",axisLine:{show:!1},splitLine:{show:!0,lineStyle:{color:x.palette.black[4]}},axisTick:{show:!1},axisLabel:{show:!0,showMaxLabel:!0,showMinLabel:!1,...G,...x.typography.overlineDelicate,formatter:R=>te(l(R))}}},[x.palette.black,x.typography.overlineDelicate,e,l,a]),V=u.useMemo(()=>{const k=i===r&&M.filter(R=>R[2]!==0).length===1,G=(k?[M[0],M[M.length-1]]:M).map((R,H)=>{const F=p.length&&!p.includes(H)?x.palette.black[25]:x.palette.secondary.main;return{value:R,itemStyle:{color:F}}});return{type:"custom",cursor:"pointer",markArea:E,renderItem:function(R,H){const q=R.dataIndex===M.length-1,F=R.dataIndex===0,Y=G[R.dataIndex].itemStyle.color,J=H.value(0),ie=H.value(1),re=H.value(2),[W,X]=H.coord([J,re]),[K,Q]=H.size([ie-J,re]);return{type:"rect",shape:{x:k?W/10:W+(F?0:1),y:X,width:k?W-W/10:K-(q?0:1),height:Q},style:{fill:Y},...!Qn&&{emphasis:{style:{fill:o.darken(Y,.25)}}}}},encode:{x:[0,1],y:2,tooltip:[0,1,2]},data:G,animation:d}},[i,r,M,E,x.palette.black,x.palette.secondary.main,p,d]),_=u.useMemo(()=>({grid:{left:j.SPACING*.1,right:j.SPACING*.1,top:j.SPACING*2,bottom:j.SPACING*.5,containLabel:!0},tooltip:L,xAxis:P,yAxis:N,series:[V]}),[L,P,N,V]),B=p.reduce((k,O)=>k+=e[O]??0,0),$=k=>{k.key==="Enter"&&c([])};return S?t.jsx(Jn,{height:f}):t.jsxs("div",{children:[I&&t.jsxs(eo,{container:!0,children:[t.jsx(j.Typography,{variant:"caption",weight:"strong",children:p.length>0?b.formatMessage({id:"c4r.widgets.histogram.selectedItems"},{items:te(l(B))}):b.formatMessage({id:"c4r.widgets.histogram.all"})}),p.length>0&&t.jsx(to,{onClick:()=>c([]),onKeyDown:$,underline:"hover",tabIndex:0,children:b.formatMessage({id:"c4r.widgets.histogram.clear"})})]}),t.jsx(ye,{option:_,onEvents:D,lazyUpdate:!0,onChartReady:C,style:{maxHeight:f}})]})}function so(e){return`${Array(String(e).length).fill(" ").join("")}${e}`}function lo(e){const n=Array(String(e).length).fill(" ").join("");return`${e}${n}`}function ao(e,n,i,r){return e.map((s,l)=>[l===0?i:n[l-1],l===e.length-1?r:n[l],s])}function co(e,n,i,r){const s=o.useTheme(),l=u.useMemo(()=>n===pe.RANKING?e.slice().sort((c,g)=>(g.value??0)-(c.value??0)):e,[e,n]),a=u.useMemo(()=>{const c=[];let g=0;for(const h of l)c.length<i?c.push({...h}):g+=h.value??0;return g>0&&c.push({name:me,value:g,emphasis:{scale:!1}}),c},[i,l]);return u.useMemo(()=>{const c=s.palette.common.white;return a.map((g,h)=>{let d=c;if(r.length){const f=r[h%r.length];f&&(d=f)}else{const m=s.palette.qualitative.bold[h];m&&(d=m)}const y=g;return y.color=d,y})},[a,r,s])}const uo=o.styled(o.Box)(({theme:e})=>({zIndex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",paddingBottom:e.spacing(1)})),po=o.styled(o.Box)(({theme:e})=>({display:"flex",alignItems:"center",gap:e.spacing(1),maxWidth:"140px",textTransform:"uppercase"})),go=o.styled(o.Box)(({theme:e})=>({display:"inline-block",borderRadius:e.spacing(.5),width:e.spacing(1),minWidth:e.spacing(1),height:e.spacing(1)}));function ho({data:e,selectedCategories:n,formatter:i}){const[r,s]=u.useState(),l=u.useMemo(()=>{if(!e||e.length===0)return null;let g;n.length>0?g=e.filter(m=>n.includes(m.name)):g=e;const h=fo(g),d=g.find(m=>m===h);if(!d)return null;let y=0;for(const m of e)y+=m.value??0;const f=xo(d.value??0,y,i);return{...d,percentage:f}},[e,n,i]);u.useEffect(()=>{l&&s(l)},[l,s]);const{name:a,percentage:p,color:c}=r??{};return r?t.jsxs(uo,{children:[t.jsx(j.Typography,{variant:"h5",children:p}),t.jsxs(po,{children:[t.jsx(go,{bgcolor:c,component:"span"}),t.jsx(j.Typography,{component:"span",variant:"body2",noWrap:!0,children:a})]})]}):null}function fo(e){const n=e.filter(i=>i.name!==me);return n.length===0?e[0]:n.reduce((i,r)=>(r.value??0)>(i.value??0)?r:i)}function xo(e,n,i){let r=0;return n!==0&&(r=e/n*100),i?i(r):`${r}%`}const ht=32,mo=o.styled(o.Box)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",marginTop:e.spacing(.5)})),yo=o.styled("div")(()=>({display:"flex",alignItems:"center",justifyContent:"center",position:"relative"})),vo=o.styled(An)(()=>({position:"absolute",zIndex:1})),jo=o.styled("div")(({theme:e})=>({display:"flex",flexDirection:"column",alignItems:"center",gap:e.spacing(1),position:"absolute",zIndex:2})),wo=o.styled(o.Box)(({theme:e})=>({display:"flex",alignItems:"center",gap:e.spacing(2),height:e.spacing(5)})),bo=o.styled("div")(({theme:e})=>({display:"flex",alignItems:"center",gap:e.spacing(1.5)}));function Ft({height:e}){const n=parseInt(String(e),10)||_e,i=n-ht,r=i-ht;return t.jsxs(o.Box,{mt:.5,children:[t.jsx(o.Skeleton,{height:8,width:64}),t.jsx(mo,{height:n,children:t.jsxs(yo,{children:[t.jsx(o.Skeleton,{variant:"circular",width:i,height:i}),t.jsx(vo,{variant:"circular",width:r,height:r}),t.jsxs(jo,{children:[t.jsx(o.Skeleton,{height:24,width:72}),t.jsx(o.Skeleton,{height:8,width:48})]})]})}),t.jsx(wo,{children:[...Array(2)].map((s,l)=>t.jsxs(bo,{children:[t.jsx(o.Skeleton,{variant:"circular",width:8,height:8}),t.jsx(o.Skeleton,{width:48,height:8})]},l))})]})}const So=o.styled(o.Box)(({theme:e})=>({position:"relative",padding:e.spacing(1.25,1,0,1),width:"100%"})),Io=o.styled(o.Box)(({theme:e})=>({position:"relative",display:"flex",flexDirection:"row",overflowX:"hidden",gap:e.spacing(2),padding:e.spacing(.5),margin:e.spacing(-.5)})),ko=o.styled(o.Box)(({theme:e})=>({display:"flex",flexDirection:"row",gap:e.spacing(1),alignItems:"center",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:"pointer"})),To=o.styled(o.Box)(({theme:e})=>({display:"inline-block",position:"absolute",left:e.spacing(-2),top:e.spacing(1),bottom:e.spacing(1),zIndex:1,width:e.spacing(2.5),background:`linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, ${e.palette.background.paper} 100%)`})),Mo=o.styled(o.Box)(({theme:e})=>({position:"absolute",padding:e.spacing(.25,1),top:e.spacing(0),right:0,background:e.palette.background.paper})),Co=o.styled(o.Box,{shouldForwardProp:e=>e!=="color"})(({theme:e,color:n})=>{const i=e.spacing(1);return{backgroundColor:n,borderRadius:"50%",width:i,height:i}});function Wt({series:e,selectedCategories:n,onCategoryClick:i}){var I,T;const r=o.useTheme(),[s,l]=u.useState(!1),[a,p]=u.useState(0),[c,g]=u.useState(void 0),h=u.useRef(null),d=u.useRef(null),y=u.useRef(null),f=Z.useIntl(),m=j.useImperativeIntl(f);function v(){p(a+1)}function x(){p(Math.max(a-1))}function b(w,C){w.key==="Enter"&&(i==null||i(C))}const S=u.useCallback(()=>{var C,M,D;const w=!!d.current&&d.current.scrollWidth>d.current.clientWidth;l(w),g(w&&d.current?(((C=h.current)==null?void 0:C.clientWidth)??0)-(((M=y.current)==null?void 0:M.clientWidth)??70):(((D=h.current)==null?void 0:D.clientWidth)??0)-12||500)},[h,d,y]);return u.useEffect(()=>{S()},[d,(I=d.current)==null?void 0:I.scrollWidth,(T=d.current)==null?void 0:T.clientWidth,S,a]),u.useEffect(()=>{if(typeof ResizeObserver>"u")return;let w;return h.current&&(w=new ResizeObserver(()=>{S()}),w.observe(h.current)),()=>{w==null||w.disconnect()}},[h,S]),t.jsxs(So,{ref:h,children:[t.jsx(Io,{ref:d,style:{maxWidth:`${c}px`},children:e.map((w,C)=>{if(C<a)return null;const M=n.length===0||n.includes(w.name);return t.jsxs(ko,{tabIndex:0,onClick:i?()=>i(w.name):void 0,onKeyDown:i?D=>b(D,w.name):void 0,style:{pointerEvents:!i||w.name==="Others"?"none":void 0},children:[t.jsx(Co,{color:M?w.color:r.palette.text.disabled}),t.jsx(j.Typography,{variant:"overline",color:M?void 0:"text.disabled",children:w.name})]},C)})}),(s||a>0)&&t.jsxs(Mo,{ref:y,children:[t.jsx(To,{}),t.jsx(o.Tooltip,{title:m.formatMessage({id:"c4r.widgets.chartLegend.next"}),children:t.jsx(o.IconButton,{size:"small",disabled:a===0,onClick:x,children:t.jsx(ee.ChevronLeft,{})})}),t.jsx(o.Tooltip,{title:m.formatMessage({id:"c4r.widgets.chartLegend.prev"}),children:t.jsx(o.IconButton,{size:"small",disabled:!s,onClick:v,children:t.jsx(ee.ChevronRight,{})})})]})]})}const Ke="232px",Ao=o.styled(o.Grid)(({theme:e})=>({flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:e.spacing(.5)})),Eo=o.styled(o.Box,{shouldForwardProp:e=>e!=="height"&&e!=="width"})(({height:e,width:n})=>({position:"relative",margin:"0 auto",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:n||"100%",height:e||"100%"})),Bo=o.styled(ye)(()=>({position:"absolute",top:0,right:0,left:0,bottom:0})),ft=[],Po={},Lo=e=>e;function Do({name:e,data:n,formatter:i=Lo,tooltipFormatter:r=No,percentFormatter:s,height:l=Ke,width:a=Ke,labels:p=Po,colors:c=ft,animation:g=!0,filterable:h=!0,selectedCategories:d=ft,onSelectedCategoriesChange:y,isLoading:f,maxItems:m=11,order:v=pe.RANKING}){const x=o.useTheme(),b=co(n,v,m,c),{showSkeleton:S}=de(!!f),I=Z.useIntl(),T=j.useImperativeIntl(I),w=u.useMemo(()=>s||(_=>`${I.formatNumber(_,{maximumFractionDigits:2,minimumFractionDigits:2})}%`),[I,s]),C=u.useMemo(()=>{let _;return r&&(_=B=>r(B,i,w)),{padding:[j.SPACING*.5,j.SPACING],backgroundColor:x.palette.black[90],borderColor:"transparent",textStyle:{color:x.palette.common.white},confine:!0,formatter:_}},[x.palette.black,x.palette.common.white,r,i,w]),M=u.useMemo(()=>[{type:"pie",name:e,animation:g,data:b.map(_=>{const B={..._},$=(d==null?void 0:d.length)&&!d.includes(B.name);return p!=null&&p[B.name]&&(B.name=p[B.name]),$?{...B,disabled:!0,itemStyle:{color:x.palette.black[25]}}:{...B,itemStyle:{color:B.color}}}),radius:["74%","90%"],selectedOffset:0,bottom:j.SPACING*1.5,label:{show:!1},emphasis:{focus:"series",scaleSize:5},itemStyle:{borderColor:x.palette.background.paper,borderWidth:1}}],[e,g,b,p,d,x]),D=u.useMemo(()=>({grid:{left:0,top:0,right:0,bottom:0},tooltip:C,legend:{show:!1},series:M}),[C,M]),E=u.useCallback(_=>{if(y){const B=[...d],{name:$}=b[_.dataIndex];if($===me)return;const k=B.indexOf($);k===-1?B.push($):B.splice(k,1),y(B)}},[b,y,d]),L=u.useCallback(_=>{if(y){const B=[...d],$=B.indexOf(_);$===-1?B.push(_):B.splice($,1),y(B)}},[y,d]),P={...h&&{click:E}},N=()=>{y==null||y([])},V=_=>{_.key==="Enter"&&N()};return S?t.jsx(Ft,{height:l}):t.jsxs(t.Fragment,{children:[h&&t.jsxs(Ao,{container:!0,children:[t.jsx(j.Typography,{variant:"caption",color:"textSecondary",children:d.length?T.formatMessage({id:"c4r.widgets.pie.selectedItems"},{items:d.length}):T.formatMessage({id:"c4r.widgets.pie.allSelected"})}),d.length>0&&t.jsx(o.Link,{variant:"caption",onClick:N,onKeyDown:V,tabIndex:0,children:T.formatMessage({id:"c4r.widgets.pie.clear"})})]}),t.jsxs(Eo,{height:l,width:a,children:[t.jsx(ho,{data:b,selectedCategories:d,formatter:w}),t.jsx(Bo,{option:D,onEvents:P,lazyUpdate:!0,style:{height:l,width:a}})]}),b.length>0&&t.jsx(Wt,{series:b,selectedCategories:d,onCategoryClick:y&&L})]})}function No(e,n,i){var c;const r=Array.isArray(e)?e[0]:e;if(!r)return null;const s=te(n(r.value)),l=i(r.percent)||`${r.percent}%`,p=`display:inline-block;border-radius:4px;width:8px;height:8px;background-color:${((c=r.data)==null?void 0:c.color)||r.textStyle.color}`;return`
@@ -2,12 +2,12 @@ import { jsxs as v, Fragment as ie, jsx as n } from "react/jsx-runtime";
2
2
  import Qn, { useMemo as F, useState as _, useEffect as U, useCallback as oe, useRef as re, forwardRef as ei, createContext as ti, useContext as ni, useLayoutEffect as an, createRef as ii } from "react";
3
3
  import { useTheme as le, styled as m, Box as S, Skeleton as z, Grid as ae, Link as ye, darken as yt, Button as $e, Divider as wt, TextField as ot, InputAdornment as vt, Checkbox as ln, Tooltip as ue, IconButton as fe, debounce as ri, Slider as xt, TableCell as bt, Table as sn, TableHead as cn, TableRow as Je, TableBody as dn, TableContainer as un, TableSortLabel as oi, TablePagination as ai, Menu as kt, MenuItem as Pe, SvgIcon as je, lighten as pn, Typography as De, ClickAwayListener as li, ToggleButton as si, capitalize as gn, ListItem as ci, Chip as di, List as ui, Paper as hn, Popover as pi, Select as gi, ListItemText as hi, Collapse as St, Drawer as fi, Icon as mi, LinearProgress as yi } from "@mui/material";
4
4
  import { useIntl as se } from "react-intl";
5
- import { t as wi, u as ce, T as H, S as B, B as Mt, a as vi, b as pt } from "../TablePaginationActions-BmvmVQd9.js";
5
+ import { d as wi, u as ce, T as H, S as B, B as Mt, a as vi, b as pt } from "../TablePaginationActions-EC4ynZRa.js";
6
6
  import xi from "echarts-for-react";
7
7
  import { FixedSizeList as bi } from "react-window";
8
8
  import { S as Qe, a as ki } from "../SwatchSquare-DAne_6Gi.js";
9
9
  import { ChevronLeft as Si, ChevronRight as Mi, KeyboardArrowDown as Ii, ErrorOutline as Ti, Cancel as Ci, VisibilityOutlined as Ai, VisibilityOffOutlined as Ei, ExpandLess as fn, ExpandMore as mn, Close as Li, LayersOutlined as Di, MoreVert as $i } from "@mui/icons-material";
10
- import { A as Pi } from "../Alert-DbN79ENW.js";
10
+ import { A as Pi } from "../Alert-Cn0nq6aq.js";
11
11
  import { c as yn, a as Oi, b as wn } from "../paletteUtils-BEwZhrLg.js";
12
12
  function vn() {
13
13
  let e = !1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carto/meridian-ds",
3
- "version": "1.4.0",
3
+ "version": "1.4.1-0",
4
4
  "description": "CARTO Meridian Design System",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -95,6 +95,7 @@
95
95
  "@emotion/styled": ">=11.13.0",
96
96
  "@mui/icons-material": ">=5.16.7",
97
97
  "@mui/material": ">=5.16.7",
98
+ "@mui/x-date-pickers": "^7.11.0",
98
99
  "cartocolor": "5.0.2",
99
100
  "echarts": ">=5.5.1",
100
101
  "echarts-for-react": ">=3.0.2",
@@ -158,5 +159,6 @@
158
159
  "bugs": {
159
160
  "url": "https://github.com/CartoDB/meridian-ds/issues"
160
161
  },
161
- "homepage": "https://github.com/CartoDB/meridian-ds#readme"
162
+ "homepage": "https://github.com/CartoDB/meridian-ds#readme",
163
+ "stableVersion": "1.4.0"
162
164
  }