@carto/meridian-ds 0.1.1-alpha.3 → 0.1.1-alpha.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/components/index.cjs +1 -1
- package/dist/components/index.js +326 -323
- package/dist/types/components/atoms/Button.d.ts +4 -1
- package/dist/types/components/atoms/Button.d.ts.map +1 -1
- package/dist/types/components/atoms/SelectField.d.ts +1 -1
- package/dist/types/components/atoms/SelectField.d.ts.map +1 -1
- package/dist/types/components/molecules/Autocomplete.d.ts +3 -3
- package/dist/types/components/molecules/Autocomplete.d.ts.map +1 -1
- package/dist/types/components/molecules/MultipleSelectField/MultipleSelectField.d.ts +4 -4
- package/dist/types/components/molecules/MultipleSelectField/MultipleSelectField.d.ts.map +1 -1
- package/dist/types/components/molecules/MultipleSelectField/useMultipleSelectField.d.ts +1 -1
- package/dist/types/theme/types.d.ts +6 -0
- package/dist/types/theme/types.d.ts.map +1 -1
- package/dist/types/widgets/WrapperWidgetUI.d.ts +9 -3
- package/dist/types/widgets/WrapperWidgetUI.d.ts.map +1 -1
- package/dist/widgets/index.cjs +1 -1
- package/dist/widgets/index.js +36 -36
- package/package.json +1 -1
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import { ButtonProps } from '@mui/material';
|
|
1
|
+
import { ButtonProps as MUIButtonProps } from '@mui/material';
|
|
2
|
+
export type ButtonProps = MUIButtonProps<React.ElementType, {
|
|
3
|
+
target?: string;
|
|
4
|
+
}>;
|
|
2
5
|
declare const Button: import('react').ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
3
6
|
export default Button;
|
|
4
7
|
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAuB,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,cAAc,EAAuB,MAAM,eAAe,CAAA;AAIlF,MAAM,MAAM,WAAW,GAAG,cAAc,CACtC,KAAK,CAAC,WAAW,EACjB;IACE,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CACF,CAAA;AAiBD,QAAA,MAAM,MAAM,wHAAsB,CAAA;AAClC,eAAe,MAAM,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MenuProps, SelectProps } from '@mui/material';
|
|
2
2
|
import { ForwardedRef } from 'react';
|
|
3
|
-
export type SelectFieldProps<T = unknown> = SelectProps<T> & {
|
|
3
|
+
export type SelectFieldProps<T = unknown> = Omit<SelectProps<T>, 'placeholder'> & {
|
|
4
4
|
placeholder?: React.ReactNode;
|
|
5
5
|
size?: 'small' | 'medium';
|
|
6
6
|
menuProps?: Partial<MenuProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectField.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/SelectField.tsx"],"names":[],"mappings":"AACA,OAAO,EAML,SAAS,EAET,WAAW,EAEZ,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAE,YAAY,EAAwB,MAAM,OAAO,CAAA;AAE1D,MAAM,MAAM,gBAAgB,CAAC,CAAC,GAAG,OAAO,IAAI,WAAW,CAAC,CAAC,CAAC,GAAG;
|
|
1
|
+
{"version":3,"file":"SelectField.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/SelectField.tsx"],"names":[],"mappings":"AACA,OAAO,EAML,SAAS,EAET,WAAW,EAEZ,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAE,YAAY,EAAwB,MAAM,OAAO,CAAA;AAE1D,MAAM,MAAM,gBAAgB,CAAC,CAAC,GAAG,OAAO,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,GAAG;IAChF,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC7B,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAA;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAA;IAC9B,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAChC,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAyBD,iBAAS,YAAY,CAAC,CAAC,GAAG,OAAO,EAC/B,EACE,QAAQ,EACR,WAAW,EACX,IAAc,EACd,YAAY,EACZ,SAAS,EACT,UAAU,EACV,OAAO,EACP,KAAK,EACL,cAAc,EACd,UAAU,EACV,IAAI,EACJ,KAAK,EACL,OAAO,EACP,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,YAAY,EAAE,SAAS,EACvB,GAAG,UAAU,EACd,EAAE,gBAAgB,CAAC,CAAC,CAAC,EACtB,GAAG,EAAE,YAAY,CAAC,gBAAgB,CAAC,2CA+EpC;AAID,QAAA,MAAM,WAAW,EAA+B,CAAC,CAAW,GAAP,OAAO,EAC1D,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,YAAY,CAAC,gBAAgB,CAAC,CAAA;CAAE,KAClE,UAAU,CAAC,OAAO,YAAY,CAAC,CAAA;AAEpC,eAAe,WAAW,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ChipTypeMap, AutocompleteProps as MUIAutocompleteProps } from '@mui/material';
|
|
2
2
|
import { ForwardedRef } from 'react';
|
|
3
|
-
export type AutocompleteProps<Value
|
|
3
|
+
export type AutocompleteProps<Value, Multiple extends boolean | undefined = undefined, DisableClearable extends boolean | undefined = undefined, FreeSolo extends boolean | undefined = undefined, ChipComponent extends React.ElementType = ChipTypeMap['defaultComponent']> = Omit<MUIAutocompleteProps<Value, Multiple, DisableClearable, FreeSolo, ChipComponent>, 'ref'> & {
|
|
4
4
|
creatable?: FreeSolo;
|
|
5
5
|
/** either a string (a translation key) or a function that receives the input value and returns a ReactNode */
|
|
6
6
|
newItemLabel?: string | ((value: string) => React.ReactNode);
|
|
@@ -10,8 +10,8 @@ export type CreatableValue = {
|
|
|
10
10
|
inputValue: string;
|
|
11
11
|
title: string;
|
|
12
12
|
};
|
|
13
|
-
declare function _Autocomplete<Value
|
|
14
|
-
declare const Autocomplete: <Value
|
|
13
|
+
declare function _Autocomplete<Value, Multiple extends boolean | undefined = undefined, DisableClearable extends boolean | undefined = undefined, FreeSolo extends boolean | undefined = undefined, ChipComponent extends React.ElementType = ChipTypeMap['defaultComponent']>({ creatable, newItemLabel, newItemIcon, freeSolo, renderOption, forcePopupIcon, filterOptions, getOptionLabel, ...props }: AutocompleteProps<Value, Multiple, DisableClearable, FreeSolo, ChipComponent>, ref: ForwardedRef<HTMLElement>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare const Autocomplete: <Value, Multiple extends boolean | undefined = undefined, DisableClearable extends boolean | undefined = undefined, FreeSolo extends boolean | undefined = undefined, ChipComponent extends React.ElementType = ChipTypeMap["defaultComponent"]>(props: AutocompleteProps<Value, Multiple, DisableClearable, FreeSolo, ChipComponent> & {
|
|
15
15
|
ref?: ForwardedRef<HTMLElement>;
|
|
16
16
|
}) => ReturnType<typeof _Autocomplete>;
|
|
17
17
|
export default Autocomplete;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Autocomplete.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/Autocomplete.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,WAAW,EAIX,iBAAiB,IAAI,oBAAoB,EAI1C,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,YAAY,EAAwB,MAAM,OAAO,CAAA;AAO1D,MAAM,MAAM,iBAAiB,CAC3B,KAAK,
|
|
1
|
+
{"version":3,"file":"Autocom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,EACtC,GAAG,KAAK,EACT,EAAE,iBAAiB,CAClB,KAAK,EACL,QAAQ,EACR,gBAAgB,EAChB,QAAQ,EACR,aAAa,CACd,EACD,GAAG,EAAE,YAAY,CAAC,WAAW,CAAC,2CAgH/B;AAID,QAAA,MAAM,YAAY,EAAgC,CAChD,KAAK,EACL,QAAgD,SAA/B,OAAO,GAAG,SAAS,GAAG,SAAS,EAChD,gBAAwD,SAA/B,OAAO,GAAG,SAAS,GAAG,SAAS,EACxD,QAAgD,SAA/B,OAAO,GAAG,SAAS,GAAG,SAAS,EAChD,aAAyE,SAAnD,KAAK,CAAC,WAAW,GAAG,WAAW,CAAC,kBAAkB,CAAC,EAEzE,KAAK,EAAE,iBAAiB,CACtB,KAAK,EACL,QAAQ,EACR,gBAAgB,EAChB,QAAQ,EACR,aAAa,CACd,GAAG;IAAE,GAAG,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,CAAA;CAAE,KACpC,UAAU,CAAC,OAAO,aAAa,CAAC,CAAA;AAErC,eAAe,YAAY,CAAA"}
|
|
@@ -2,19 +2,19 @@ import { SelectFieldProps } from '../../atoms/SelectField';
|
|
|
2
2
|
import { TooltipProps } from '@mui/material';
|
|
3
3
|
export type MultipleSelectFieldOption = {
|
|
4
4
|
label: React.ReactNode;
|
|
5
|
-
value: string
|
|
5
|
+
value: string;
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
tooltip?: string | false;
|
|
8
8
|
};
|
|
9
9
|
type OptionValue = MultipleSelectFieldOption['value'];
|
|
10
10
|
export type MultipleSelectFieldProps = Omit<SelectFieldProps<OptionValue[]>, 'options' | 'value' | 'onChange'> & {
|
|
11
11
|
options: MultipleSelectFieldOption[];
|
|
12
|
-
selectedOptions:
|
|
12
|
+
selectedOptions: string[] | undefined;
|
|
13
13
|
selectAllDisabled?: boolean;
|
|
14
|
-
onChange?: (value:
|
|
14
|
+
onChange?: (value: string[]) => void;
|
|
15
15
|
showCounter?: boolean;
|
|
16
16
|
showFilters?: boolean;
|
|
17
|
-
value
|
|
17
|
+
value?: string[] | string;
|
|
18
18
|
tooltipPlacement?: TooltipProps['placement'];
|
|
19
19
|
};
|
|
20
20
|
declare const MultipleSelectField: import('react').ForwardRefExoticComponent<Omit<MultipleSelectFieldProps, "ref"> & import('react').RefAttributes<HTMLInputElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultipleSelectField.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/MultipleSelectField/MultipleSelectField.tsx"],"names":[],"mappings":"AAAA,OAAoB,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAC9E,OAAO,EAQL,YAAY,EACb,MAAM,eAAe,CAAA;AAStB,MAAM,MAAM,yBAAyB,GAAG;IACtC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"MultipleSelectField.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/MultipleSelectField/MultipleSelectField.tsx"],"names":[],"mappings":"AAAA,OAAoB,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAC9E,OAAO,EAQL,YAAY,EACb,MAAM,eAAe,CAAA;AAStB,MAAM,MAAM,yBAAyB,GAAG;IACtC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,MAAM,GAAG,KAAK,CAAA;CACzB,CAAA;AACD,KAAK,WAAW,GAAG,yBAAyB,CAAC,OAAO,CAAC,CAAA;AAErD,MAAM,MAAM,wBAAwB,GAAG,IAAI,CACzC,gBAAgB,CAAC,WAAW,EAAE,CAAC,EAC/B,SAAS,GAAG,OAAO,GAAG,UAAU,CACjC,GAAG;IACF,OAAO,EAAE,yBAAyB,EAAE,CAAA;IACpC,eAAe,EAAE,MAAM,EAAE,GAAG,SAAS,CAAA;IACrC,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;IACpC,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CAAA;IACzB,gBAAgB,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,CAAA;CAC7C,CAAA;AAgMD,QAAA,MAAM,mBAAmB,oIAAmC,CAAA;AAC5D,eAAe,mBAAmB,CAAA"}
|
|
@@ -3,7 +3,7 @@ import { MultipleSelectFieldOption, MultipleSelectFieldProps } from './MultipleS
|
|
|
3
3
|
export default function useMultipleSelectField({ selectedOptions, options, onChange, }: Pick<Required<MultipleSelectFieldProps>, 'selectedOptions' | 'options' | 'onChange'>): {
|
|
4
4
|
areAllSelected: boolean;
|
|
5
5
|
areAnySelected: boolean;
|
|
6
|
-
currentOptions:
|
|
6
|
+
currentOptions: string[];
|
|
7
7
|
handleChange: (event: SelectChangeEvent<MultipleSelectFieldOption["value"][]>) => void;
|
|
8
8
|
selectAll: () => void;
|
|
9
9
|
unselectAll: () => void;
|
|
@@ -25,6 +25,12 @@ interface QualitativeColors {
|
|
|
25
25
|
bold: Record<number, string>;
|
|
26
26
|
}
|
|
27
27
|
declare module '@mui/material/styles' {
|
|
28
|
+
interface Theme {
|
|
29
|
+
spacingValue: number;
|
|
30
|
+
}
|
|
31
|
+
interface ThemeOptions {
|
|
32
|
+
spacingValue?: number;
|
|
33
|
+
}
|
|
28
34
|
interface PaletteColor {
|
|
29
35
|
relatedLight: string;
|
|
30
36
|
relatedDark: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/theme/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAE5C,KAAK,MAAM,CAAC,CAAC,EA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.ReactNode;
|
|
30
|
-
children?:
|
|
30
|
+
children?: JSX.Element | JSX.Element[];
|
|
31
31
|
footer?: React.ReactNode;
|
|
32
32
|
margin?: CSSProperties['margin'];
|
|
33
33
|
contentProps?: BoxProps;
|
|
34
|
-
}
|
|
35
|
-
|
|
34
|
+
} & ({
|
|
35
|
+
disabled: true;
|
|
36
|
+
children: React.ReactNode;
|
|
37
|
+
} | {
|
|
38
|
+
disabled?: false;
|
|
39
|
+
children?: React.ReactNode;
|
|
40
|
+
});
|
|
41
|
+
export default function WrapperWidgetUI({ title, actions, options, optionsIcon, children, contentProps, disabled, expandable, expanded: _expanded, onExpandedChange, footer, headerItems, isLoading, margin, }: WrapperWidgetUIProps): import("react/jsx-runtime").JSX.Element | null;
|
|
36
42
|
//# sourceMappingURL=WrapperWidgetUI.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WrapperWidgetUI.d.ts","sourceRoot":"","sources":["../../../src/widgets/WrapperWidgetUI.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,OAAO,CAAA;AAC/D,OAAO,EAEL,QAAQ,EAaT,MAAM,eAAe,CAAA;AA0GtB,MAAM,MAAM,qBAAqB,GAAG;IAClC,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,KAAK,CAAC,SAAS,CAAA;IACrB,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,OAAO,CAAC,EAAE;QACR,IAAI,EAAE,MAAM,CAAA;QACZ,SAAS,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAA;KAChD,CAAA;CACF,CAAA;AACD,MAAM,MAAM,qBAAqB,GAAG;IAClC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB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${s}">${String(l.marker)} ${c} (${g} %)</p>
|
|
32
32
|
`.trim()}const Ri=e=>e,Fi=()=>{},Le=[],Wi="260px";function _i({names:e=Le,data:n=Le,labels:r=Le,colors:i=Le,height:s=Wi,animation:l=!0,formatter:a=Ri,tooltipFormatter:p=Oi,selectedCategories:c=[],onCategorySelected:g=Fi,isLoading:h=!1}){const d=o.useTheme(),v=u.useRef(),f=u.useMemo(()=>n.map((S,b)=>$i(S,i[b],r[b],d,c)),[n,i,r,d,c]),y=u.useMemo(()=>{const S=f.length>1;let b;p&&(b=B=>p(B,a,S));const I={trigger:"item",show:!0,backgroundColor:d.palette.black[90],textStyle:{color:d.palette.common.white},confine:!0,borderWidth:0,formatter:b},w={data:S?f.map((B,P)=>e[P]):(f[0]??[]).map(B=>B.name),selectedMode:!1,type:"scroll",left:j.SPACING,bottom:j.SPACING*-.5,itemGap:j.SPACING*3,icon:"circle",itemWidth:j.SPACING,itemHeight:j.SPACING,textStyle:{...d.typography.overline,color:d.palette.text.primary,fontWeight:400,lineHeight:1,verticalAlign:"bottom",padding:[0,0,0,j.SPACING*.5]},inactiveColor:d.palette.text.disabled,pageIcons:{horizontal:["path://M15.41 7.41 14 6 8 12 14 18 15.41 16.59 10.83 12z","path://M9 16.59 13.3265857 12 9 7.41 10.3319838 6 16 12 10.3319838 18z"]},pageIconSize:j.SPACING*1.5,pageIconColor:d.palette.text.secondary,pageIconInactiveColor:d.palette.text.disabled,pageTextStyle:{fontFamily:d.typography.overline.fontFamily,fontSize:j.SPACING*1.5,lineHeight:j.SPACING*1.75,fontWeight:400,color:d.palette.text.primary}},C={formatter:({name:B,percent:P})=>`{per|${a(P)}%}
|
|
33
|
-
{b|${B}}`,position:"center",rich:{b:{fontFamily:d.typography.overline.fontFamily,fontSize:j.SPACING*1.75,lineHeight:j.SPACING*1.75,fontWeight:400,color:d.palette.text.primary},per:{...d.typography.overline,fontSize:j.SPACING*3,lineHeight:j.SPACING*4.5,fontWeight:600,color:d.palette.text.primary}}},A=f.map((B,P)=>{var L;return{type:"pie",name:e[P],itemStyle:{color:(L=B[0])==null?void 0:L.color},animation:l,data:B.map(N=>({...N,itemStyle:{color:N.color}})),radius:P===0?["75%","90%"]:["56%","72%"],selectedOffset:0,hoverOffset:5,bottom:j.SPACING*2.5,avoidLabelOverlap:!0,label:{show:!1,...C},emphasis:{label:{show:!0,formatter:C.formatter,rich:C.rich}}}});return{grid:{left:0,top:0,right:0,bottom:0},tooltip:I,legend:w,series:A}},[d,e,l,f,a,p]),m={mouseover:(S,b)=>{f.length===1&&(S.seriesIndex!==0||S.dataIndex!==0)&&b.dispatchAction({type:"downplay",seriesIndex:0,dataIndex:0})},mouseout:(S,b)=>{f.length===1&&b.dispatchAction({type:"highlight",seriesIndex:0,dataIndex:0})},click:S=>{const I=f[S.seriesIndex][S.dataIndex].key,k=c.includes(I),w=new Set(c);k?w.delete(I):w.add(I);const C=f[0].length;let A=Array.from(w);A.length===C&&(A=[]),g(A)}};u.useEffect(()=>{v.current&&v.current.dispatchAction({type:f.length===1?"highlight":"downplay",seriesIndex:0,dataIndex:0})},[f]);function x(S){v.current=S}return f.length?h?t.jsx(Wt,{height:s}):t.jsx(ye,{onChartReady:x,notMerge:!0,option:y,onEvents:m,style:{maxHeight:s,width:"100%"}}):null}const Gi=()=>{};function on({icon:e,hoverTooltip:n,clickTooltip:r,enabled:i,onEnabledChange:s=Gi,tooltipPlacement:l="bottom"}){const[a,p]=u.useState(!1),[c,g]=u.useState(i);u.useEffect(()=>{g(i)},[i]),u.useEffect(()=>{if(i){const d=v=>{v.key==="Escape"&&s&&s(!1)};return window.addEventListener("keydown",d),()=>{window.removeEventListener("keydown",d)}}},[i,s]);const h=c?r:n;return t.jsx(o.ClickAwayListener,{onClickAway:()=>g(!1),children:t.jsx(o.Tooltip,{title:h,placement:l,open:a,onOpen:()=>p(!0),onClose:()=>{c||p(!1)},children:t.jsx(o.ToggleButton,{value:"selectedMode",selected:i,onClick:()=>s&&s(!i),children:e})})})}const Hi=o.styled(o.IconButton,{shouldForwardProp:e=>e!=="isOpen"})(({isOpen:e,theme:n})=>({color:n.palette.text.secondary,width:n.spacing(3),transform:`rotate(${e?"180":"0"}deg)`,backgroundColor:e?n.palette.action.hover:void 0})),zi=o.styled(o.MenuItem,{shouldForwardProp:e=>e!=="disabled"})(({disabled:e,theme:n})=>({...e&&{pointerEvents:"none",color:n.palette.text.disabled}})),Yi=o.styled(o.MenuItem)(()=>({"&.Mui-disabled":{opacity:1}})),Vi=()=>{};function rn({selectionModes:e,editModes:n,selectedMode:r,onSelectMode:i=Vi,enabled:s,tooltipPlacement:l="bottom",tooltipText:a="",menuHeaderText:p="",editDisabled:c}){const g=o.useTheme(),[h,d]=u.useState(null),v=!!h,f=I=>d(I.currentTarget),y=()=>d(null),m=I=>{i&&i(I),y()},x=!!e.length&&!!n.length,S=I=>n.some(k=>k.id===I.id);function b(I){return t.jsx(zi,{selected:s&&r===I.id,onClick:()=>m(I.id),disabled:c&&S(I),children:t.jsxs(o.Box,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[I.icon,t.jsx(o.Box,{ml:2,children:t.jsx(j.Typography,{variant:"body2",color:"inherit",children:o.capitalize(I.label)})})]})},I.id)}return t.jsxs(t.Fragment,{children:[t.jsx(o.Tooltip,{title:a,placement:l,children:t.jsx(Hi,{id:"feature-selection-menu-button","aria-controls":"feature-selection-menu","aria-haspopup":"true","aria-expanded":v?"true":void 0,onClick:f,isOpen:v,children:t.jsx(vn,{})})}),t.jsxs(o.Menu,{id:"feature-selection-menu",style:{zIndex:g.zIndex.tooltip+1},anchorEl:h,open:v,onClose:y,MenuListProps:{"aria-labelledby":"feature-selection-menu-button"},children:[p&&t.jsx(Yi,{disabled:!0,children:t.jsx(j.Typography,{variant:"caption",color:"textSecondary",children:p})}),!!e.length&&e.map(b),x&&t.jsx(o.Divider,{sx:{margin:({spacing:I})=>I(1,0)}}),!!n.length&&n.map(b)]})]})}const Ui=o.styled(o.List)(({theme:e})=>({display:"flex",alignItems:"center",marginLeft:e.spacing(1.5),padding:e.spacing(.5),overflowX:"auto",maxWidth:"100%",scrollbarWidth:"none",msOverflowStyle:"none","&::-webkit-scrollbar":{display:"none"}})),qi=()=>{};function sn({features:e,onSelectGeometry:n=qi,onDeleteGeometry:r,chipTooltip:i,disabledChipTooltip:s,size:l="medium",tooltipPlacement:a="bottom",chipLabel:p}){const c=X.useIntl(),g=j.useImperativeIntl(c);function h(y){return y==="MultiPoint"?g.formatMessage({id:"c4r.widgets.featureSelection.point"}):y==="MultiLineString"?g.formatMessage({id:"c4r.widgets.featureSelection.lineString"}):y==="MultiPolygon"||y==="Polygon"||y==="GeometryCollection"?g.formatMessage({id:"c4r.widgets.featureSelection.polygon"}):y}function d(y,m){var S;const x=h(y.geometry.type);return p||((S=y.properties)==null?void 0:S.name)||`${x} ${m+1}`}const[v,f]=u.useState(!1);return t.jsx(o.Box,{sx:{overflowX:"auto"},children:t.jsx(Ui,{sx:{gap:l==="small"?.5:1},children:e.map((y,m)=>{var k,w;const x=(k=y.properties)==null?void 0:k.disabled,S=(w=y.properties)==null?void 0:w.invalid;let b=i;x&&(b=s||i),S&&(b=g.formatMessage({id:"c4r.widgets.featureSelection.invalid"})),v&&(b=g.formatMessage({id:"c4r.widgets.featureSelection.remove"}));let I="secondary";return x&&(I="default"),S&&(I="error"),t.jsx(o.ListItem,{disablePadding:!0,children:t.jsx(o.Tooltip,{disableHoverListener:x?!s:!i,title:b,placement:a,children:t.jsx(o.Chip,{size:l,label:d(y,m),color:I,onClick:()=>n(y),onDelete:r?()=>r(y):void 0,icon:S?t.jsx(fe.ErrorOutline,{color:"error"}):void 0,deleteIcon:t.jsx(fe.Cancel,{onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1)})})})},m)})})})}const Ki=o.styled(o.Paper)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",maxHeight:e.spacing(5),padding:e.spacing(.5)})),Zi=[];function Xi({selectionModes:e,editModes:n=Zi,selectedMode:r,onSelectMode:i,enabled:s=!1,onEnabledChange:l,geometry:a,onSelectGeometry:p,onDeleteGeometry:c,tooltipPlacement:g="bottom",size:h="medium",chipLabel:d}){const v=X.useIntl(),f=j.useImperativeIntl(v),y=u.useMemo(()=>e.map(k=>({...k,label:f.formatMessage({id:`c4r.widgets.featureSelection.${kt(k.id)}`})})),[e,f]),m=u.useMemo(()=>n.map(k=>({...k,label:f.formatMessage({id:`c4r.widgets.featureSelection.${kt(k.id)}`})})),[n,f]),x=u.useMemo(()=>{const w=[...y.map(C=>({...C,isEdit:!1})),...m.map(C=>({...C,isEdit:!0}))].find(C=>C.id===r);if(!w)throw new Error(`Selected mode "${r}" not supported`);return w},[m,y,r]),S=o.capitalize((x==null?void 0:x.label)||""),b=x!=null&&x.isEdit?S:f.formatMessage({id:"c4r.widgets.featureSelection.selectTool"},{label:S}),I=x!=null&&x.isEdit?f.formatMessage({id:"c4r.widgets.featureSelection.clickToEdit"}):f.formatMessage({id:"c4r.widgets.featureSelection.clickToCreate"});return t.jsxs(Ki,{children:[t.jsx(on,{icon:x==null?void 0:x.icon,hoverTooltip:b,clickTooltip:I,enabled:s,onEnabledChange:l,tooltipPlacement:g}),t.jsx(rn,{selectionModes:y,editModes:m,selectedMode:r,onSelectMode:i,enabled:s,tooltipPlacement:g,tooltipText:f.formatMessage({id:"c4r.widgets.featureSelection.selectMode"}),menuHeaderText:f.formatMessage({id:"c4r.widgets.featureSelection.chooseSelectionMode"}),editDisabled:!a}),!!a&&t.jsx(sn,{features:[a],onSelectGeometry:p,onDeleteGeometry:c,disabledChipTooltip:f.formatMessage({id:"c4r.widgets.featureSelection.applyMask"}),chipTooltip:f.formatMessage({id:"c4r.widgets.featureSelection.clearMask"}),tooltipPlacement:g,size:h,chipLabel:d})]})}function kt(e){return e.charAt(0).toLowerCase()+e.slice(1)}const ln=240,Ji=o.styled(o.Paper,{shouldForwardProp:e=>e!=="collapsed"})(({theme:e,collapsed:n})=>({width:n?"min-content":ln,background:e.palette.background.paper,maxHeight:"calc(100% - 120px)",display:"flex",flexDirection:"column"})),Qi=o.styled("header",{shouldForwardProp:e=>e!=="collapsed"})(({theme:e,collapsed:n})=>({display:"flex",alignItems:"center",justifyContent:"space-between",padding:e.spacing(1),paddingLeft:e.spacing(2),borderBottom:n?void 0:`1px solid ${e.palette.divider}`})),es=o.styled("header")(({theme:e})=>({padding:e.spacing(1.5),paddingRight:e.spacing(2),gap:e.spacing(.5),display:"flex",justifyContent:"space-between",position:"sticky",zIndex:2,top:0,background:e.palette.background.paper})),ts=o.styled("div")(({theme:e})=>({display:"flex",gap:e.spacing(2),alignItems:"center",padding:e.spacing(1),minWidth:`calc(${ln}px - ${e.spacing(4)})`})),ns=o.styled(o.TextField)(({theme:e})=>({display:"flex",width:e.spacing(7.5),flexShrink:0,"input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:0}})),os=o.styled("ul",{shouldForwardProp:e=>e!=="opacity"})(({theme:e,opacity:n})=>({opacity:n,margin:0,padding:0,display:"flex",flexDirection:"column",gap:e.spacing(1)})),an=o.styled("ul")(({theme:e})=>({margin:0,padding:0,paddingBottom:e.spacing(1),display:"flex",flexDirection:"column"})),rs=o.styled("li")(()=>({display:"flex",alignItems:"center"})),is=o.styled("div")(({theme:e})=>({marginRight:e.spacing(1.5),width:j.ICON_SIZE_MEDIUM,height:j.ICON_SIZE_MEDIUM,"& img":{margin:"auto",display:"block"}})),Tt=o.styled(o.Box,{shouldForwardProp:e=>e!=="width"})(({width:e,theme:n})=>({width:e,overflow:"auto",maxHeight:`calc(100% - ${n.spacing(1.5)})`})),ss=o.styled("section")(({theme:e})=>({"&:not(:first-of-type)":{borderTop:`1px solid ${e.palette.divider}`}})),ls=o.styled("div")(()=>({flexGrow:1,flexShrink:1,minWidth:0}));function as({menuRef:e,open:n,toggleOpen:r,opacity:i,onChange:s}){const l=X.useIntl(),a=j.useImperativeIntl(l);function p(c){const g=parseInt(c.target.value||"0"),h=Math.min(Math.max(g,0),100);s(h/100)}return t.jsxs(t.Fragment,{children:[t.jsx(o.Tooltip,{title:a.formatMessage({id:"c4r.widgets.legend.opacity"}),children:t.jsx(o.IconButton,{size:"small",color:n?"primary":"default",onClick:()=>r(!n),children:t.jsx(Ne.OpacityIcon,{})})}),t.jsx(o.Popover,{open:n,onClose:()=>r(!1),anchorEl:e.current,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{root:{sx:{transform:"translate(-12px, 36px)"}}},children:t.jsxs(ts,{children:[t.jsx(o.Slider,{value:i*100,onChange:(c,g)=>s(g/100),min:0,max:100,step:1}),t.jsx(ns,{size:"small",type:"number",value:Math.round(i*100),onChange:p,inputProps:{step:1,min:0,max:100,style:{appearance:"textfield"},"data-testid":"opacity-slider"},InputProps:{endAdornment:t.jsxs(o.InputAdornment,{position:"end",sx:{margin:0},children:[" ","%"]})}})]})})]})}function ot({title:e,visible:n,typographyProps:r}){const i=u.useRef(null),[s,l]=u.useState(!1);u.useLayoutEffect(()=>{if(n&&i.current){const{offsetWidth:p,scrollWidth:c}=i.current;l(p<c)}},[e,n]);const a=t.jsx(j.Typography,{ref:i,color:n?"textPrimary":"textSecondary",variant:"button",weight:"medium",component:"p",noWrap:!0,my:.25,...r,children:e});return s?t.jsx(o.Tooltip,{title:e,children:a}):a}var ae=(e=>(e.CATEGORY="category",e.ICON="icon",e.CONTINUOUS_RAMP="continuous_ramp",e.BINS="bins",e.PROPORTION="proportion",e))(ae||{});const qe=20;function cn({legend:e}){const{labels:n=[],colors:r=[],isStrokeColor:i=!1,customMarkers:s,maskedMarkers:l=!0}=e,a=Te.getPalette(r,n.length),p=n.length>qe,c=X.useIntl(),g=j.useImperativeIntl(c);return t.jsxs(t.Fragment,{children:[t.jsx(an,{"data-testid":"categories-legend",children:n.slice(0,qe).map((h,d)=>t.jsx(ps,{label:String(h),color:a[d%a.length],icon:s&&Array.isArray(s)?s[d]:s,maskedIcon:l,isStrokeColor:i},`${h}${d}`))}),p&&t.jsx(j.Typography,{variant:"caption",color:"textSecondary",component:"div",py:2,children:g.formatMessage({id:"c4r.widgets.legend.maxCategories"},{n:qe})})]})}const cs=({isMax:e,color:n,isStrokeColor:r,theme:i})=>({border:"2px solid transparent","&::after":{position:"absolute",display:e?"block":"none",content:'""',width:i.spacing(2),height:i.spacing(2),border:`2px solid ${i.palette.grey[900]}`,transform:"translate(-30%, -30%)",borderRadius:"50%",boxSizing:"content-box"},...r?{borderColor:n}:{backgroundColor:n}}),ds=({icon:e,color:n,maskedIcon:r})=>({maskRepeat:"no-repeat",maskSize:"cover",backgroundRepeat:"no-repeat",backgroundSize:"cover",...r?{backgroundColor:n,maskImage:`url(${e})`,WebkitMaskImage:`url(${e})`}:{backgroundColor:"rgba(0,0,0,0)",backgroundImage:`url(${e})`}}),us=o.styled(o.Box,{shouldForwardProp:e=>e!=="icon"&&e!=="maskedIcon"&&e!=="color"&&e!=="isStrokeColor"})(({icon:e,maskedIcon:n,color:r,isStrokeColor:i,theme:s})=>({whiteSpace:"nowrap",display:"block",width:s.spacing(1.5),height:s.spacing(1.5),flexShrink:"0",borderRadius:"50%",position:"relative",border:"2px solid transparent",...e?ds({icon:e,color:r,maskedIcon:n}):cs({color:r,isStrokeColor:i,theme:s})}));function ps({label:e,isStrokeColor:n,color:r="#000",icon:i,maskedIcon:s}){return t.jsxs(o.Box,{component:"li",sx:{display:"flex",alignItems:"center"},children:[t.jsx(us,{className:"marker",mr:1.5,component:"span",icon:i,maskedIcon:s,isStrokeColor:n,color:r}),t.jsx(ot,{title:e,visible:!0,typographyProps:{variant:"overline",my:.75}})]})}const De=6,We={0:12,1:9,2:6,3:3},gs=o.styled(o.Box,{shouldForwardProp:e=>e!=="index"})(({index:e=0,theme:n})=>{const r=n.spacing(We[e]),i=n.spacing(We[e]);return{border:`solid 1px ${n.palette.divider}`,backgroundColor:n.palette.background.default,borderRadius:"50%",position:"absolute",right:0,bottom:0,width:r,height:i}}),hs=o.styled(o.Box)(({theme:{spacing:e}})=>({display:"flex",justifyContent:"flex-end",flexShrink:0,position:"relative",width:e(We[0]),height:e(We[0])})),fs=o.styled(o.Box)(({theme:{spacing:e}})=>({display:"flex",gap:e(1),alignItems:"stretch",justifyContent:"stretch",padding:e(2,0)})),xs=o.styled(o.Box)(()=>({display:"flex",flexDirection:"column",justifyContent:"space-around",gap:1,flexGrow:1,flexShrink:1}));function dn({legend:e}){const n=X.useIntl(),r=j.useImperativeIntl(n),i=e.showMinMax??!0,{min:s,max:l,error:a}=ms(e),[p,c]=a?[0,0]:ys(s,l);return t.jsxs(fs,{"data-testid":"proportion-legend",children:[t.jsx(hs,{children:[...Array(4)].map((g,h)=>t.jsx(gs,{index:h,component:"span"},h))}),t.jsx(xs,{children:a?t.jsx(o.Box,{maxWidth:240,children:t.jsx(j.Typography,{variant:"overline",children:"You need to specify valid numbers for the labels property"})}):t.jsxs(t.Fragment,{children:[t.jsxs(j.Typography,{variant:"overline",color:"textSecondary",children:[i&&r.formatMessage({id:"c4r.widgets.legend.max"})+": ",n.formatNumber(l,{maximumSignificantDigits:De})]}),t.jsx(j.Typography,{variant:"overline",color:"textSecondary",children:n.formatNumber(c,{maximumSignificantDigits:De})}),t.jsx(j.Typography,{variant:"overline",color:"textSecondary",children:n.formatNumber(p,{maximumSignificantDigits:De})}),t.jsxs(j.Typography,{variant:"overline",color:"textSecondary",children:[i&&r.formatMessage({id:"c4r.widgets.legend.min"})+": ",n.formatNumber(s,{maximumSignificantDigits:De})]})]})})]})}function un({labels:e}){let n=e==null?void 0:e[e.length-1],r=e==null?void 0:e[0];return Number.isFinite(r)||(r=parseInt(String(r),10)),Number.isFinite(n)||(n=parseInt(String(n),10)),[r,n]}function ms(e){let n=!1;const[r,i]=un(e);return(Number.isNaN(r)||Number.isNaN(i))&&(n=!0),{min:r,max:i,error:n}}function ys(e,n){const r=(n-e)/3;return[e+r,n-r]}function pn({legend:e}){const{labels:n=[],icons:r=[]}=e;return t.jsx(an,{"data-testid":"icon-legend",children:n.map((i,s)=>t.jsxs(rs,{children:[t.jsx(is,{children:t.jsx("img",{src:r[s],alt:i,width:"auto",height:j.ICON_SIZE_MEDIUM})}),t.jsx(ot,{visible:!0,title:i,typographyProps:{variant:"overline",my:.75}})]},i))})}function vs(e){return typeof e[0]=="object"&&"label"in e[0]}function Qe({isContinuous:e=!1,legend:n}){const{labels:r=[],colors:i=[],showMinMax:s=!0}=n,l=Te.getPalette(i,!r.length||e?2:r.length+1),a=vs(r),p=a?r.map(({value:y})=>y):r,c=a?r.map(({label:y})=>y):r,[g,h]=un({labels:p}),d=Number.isNaN(g)||Number.isNaN(h);let v=c[c.length-1],f=c[0];return!e&&s&&(f="< "+f,v="≥ "+v),t.jsx(o.Box,{py:2,"data-testid":"ramp-legend",children:d?t.jsx(o.Box,{maxWidth:240,children:t.jsx(j.Typography,{variant:"overline",children:"You need to specify valid numbers for the labels property"})}):t.jsxs(t.Fragment,{children:[t.jsx(o.Box,{display:"flex",pb:1,children:e?t.jsx(js,{"data-testid":"step-continuous",palette:l}):t.jsx(bs,{palette:l,labels:c,max:v,min:f})}),t.jsxs(o.Box,{display:"flex",justifyContent:"space-between",children:[t.jsx(j.Typography,{variant:"overlineDelicate",color:"textSecondary",children:f}),t.jsx(j.Typography,{variant:"overlineDelicate",color:"textSecondary",children:v})]})]})})}const js=o.styled(o.Box,{shouldForwardProp:e=>e!=="palette"})(({palette:e,theme:n})=>({display:"block",flexGrow:1,height:n.spacing(1),borderRadius:n.spacing(.5),background:`linear-gradient(to right, ${e.join()})`})),ws=o.styled(o.Box,{shouldForwardProp:e=>e!=="color"})(({color:e,theme:n})=>({display:"block",flexGrow:1,height:n.spacing(1),backgroundColor:e,"&:first-of-type":{borderRadius:n.spacing(.5,0,0,.5)},"&:last-of-type":{borderRadius:n.spacing(0,.5,.5,0)}}));function bs({labels:e=[],palette:n=[],max:r,min:i}){const s=e.length?[i,...e]:[i,r];return t.jsx(t.Fragment,{children:s.map((l,a)=>{const p=a===0?i:a===s.length-1?r:`${l} - ${s[a+1]}`;return t.jsx(o.Tooltip,{title:p,children:t.jsx(ws,{"data-testid":"step-discontinuous",color:n[a]})},a)})})}const Ss={[ae.CATEGORY]:cn,[ae.PROPORTION]:dn,[ae.ICON]:pn,[ae.BINS]:e=>t.jsx(Qe,{...e,isContinuous:!1}),[ae.CONTINUOUS_RAMP]:e=>t.jsx(Qe,{...e,isContinuous:!0})};function Is({legend:e}){const n=X.useIntl(),r=j.useImperativeIntl(n);return e.select||!e.type?null:t.jsxs(j.Typography,{variant:"body2",color:"textSecondary",component:"p",children:[e.type," ",r.formatMessage({id:"c4r.widgets.legend.notSupported"}),"."]})}function ks(e){return e.type===ae.PROPORTION?"c4r.widgets.legend.subtitles.proportion":e.type===ae.ICON||e.customMarkers?"c4r.widgets.legend.subtitles.icon":e.isStrokeColor?"c4r.widgets.legend.subtitles.strokeColor":"c4r.widgets.legend.subtitles.color"}function Ts({layer:e,legend:n,customLegendTypes:r,onChangeSelection:i}){var h;const s=X.useIntl(),l=j.useImperativeIntl(s),a=n.type,c=Ss[a]??r[a]??Is,g=((h=n.select)==null?void 0:h.options)??[];return t.jsxs(o.Box,{component:"li","data-testid":"legend-layer-variable",px:2,children:[n.attr?t.jsxs(o.Box,{pb:1,children:[t.jsx(j.Typography,{gutterBottom:!0,variant:"overlineDelicate",color:"textSecondary",component:"p",children:l.formatMessage({id:ks(n)})}),t.jsx(j.Typography,{variant:"caption",component:"p",children:n.attr})]}):null,n.select?t.jsxs(o.Box,{pb:1,children:[t.jsx(j.Typography,{variant:"caption",weight:"medium",component:"p",children:n.select.label}),t.jsx(o.Select,{"data-testid":"legend-layer-variable-select",name:"legend-select",value:n.select.value,renderValue:d=>{var v;return((v=g.find(f=>f.value===d))==null?void 0:v.label)??d},onChange:d=>i(d.target.value),MenuProps:{transformOrigin:{vertical:"bottom",horizontal:"left"},anchorOrigin:{vertical:"top",horizontal:"left"},PaperProps:{style:{maxHeight:240}}},children:g.map(d=>t.jsx(o.MenuItem,{value:d.value,children:t.jsx(o.ListItemText,{primary:d.label})},d.value))})]}):null,t.jsx(c,{layer:e,legend:n})]})}const Ms={};function gn(e){return e?Array.isArray(e)?e.every(n=>gn(n)):!e.select&&!e.type:!0}function Mt({customLegendTypes:e=Ms,layer:n,onChangeCollapsed:r,onChangeOpacity:i,onChangeVisibility:s,onChangeSelection:l,maxZoom:a=21,minZoom:p=0,currentZoom:c=0}){const g=X.useIntl(),h=j.useImperativeIntl(g),d=u.useRef(null),[v,f]=u.useState(!1),y=n.id,m=n.title,x=n.visible??!0,S=n.switchable??!0,b=n.collapsed??!1,I=(n.collapsible??!0)&&!gn(n.legend),k=n.opacity??1,w=n.showOpacityControl??!0,C=x&&!b,A=C?t.jsx(kn,{}):t.jsx(In,{}),D=(n==null?void 0:n.minZoom)!==void 0||(n==null?void 0:n.maxZoom)!==void 0,B=n.minZoom??p,P=n.maxZoom??a,L=D&&(B>p||P<a),N=c<B||c>P,V=Cs({intl:h,minZoom:p,maxZoom:a,layerMinZoom:B,layerMaxZoom:P}),_=n.helperText??(L?V:""),T=u.useMemo(()=>n.legend?Array.isArray(n.legend)?n.legend:[n.legend]:[],[n.legend]);return n.legend?t.jsxs(ss,{"data-testid":"legend-layer","aria-label":m,children:[t.jsxs(es,{ref:d,children:[I&&t.jsx(o.IconButton,{size:"small","aria-label":h.formatMessage({id:b?"c4r.widgets.legend.expand":"c4r.widgets.legend.collapse"}),disabled:!x,onClick:()=>r({id:y,collapsed:!b}),children:A}),t.jsxs(ls,{children:[t.jsx(ot,{visible:x,title:m??""}),L&&t.jsx(o.Tooltip,{title:h.formatMessage({id:"c4r.widgets.legend.zoomLevelTooltip"}),children:t.jsxs(j.Typography,{color:x?"textPrimary":"textSecondary",variant:"caption",component:"p",children:[h.formatMessage({id:"c4r.widgets.legend.zoomLevel"})," ",n.minZoom," - ",n.maxZoom]})})]}),w&&x&&!b&&t.jsx(as,{menuRef:d,open:v,toggleOpen:f,opacity:k,onChange:O=>i({id:y,opacity:O})}),S&&t.jsx(o.Tooltip,{title:h.formatMessage({id:x?"c4r.widgets.legend.hideLayer":"c4r.widgets.legend.showLayer"}),children:t.jsx(o.IconButton,{size:"small",onClick:()=>s({id:y,collapsed:x?b:!1,visible:!x}),children:x?t.jsx(bn,{}):t.jsx(Sn,{})})})]}),t.jsxs(o.Collapse,{unmountOnExit:!0,timeout:100,in:C,children:[t.jsx(os,{"data-testid":"legend-layer-variable-list",opacity:N?.5:1,children:T.map((O,M)=>t.jsx(Ts,{legend:O,layer:n,customLegendTypes:e,onChangeSelection:$=>l({id:y,index:M,selection:$})},`${O.type}-${M}`))}),_&&t.jsx(j.Typography,{variant:"caption",color:"textSecondary",component:"div",p:2,children:t.jsx("div",{dangerouslySetInnerHTML:{__html:_}})})]})]}):null}function Cs({intl:e,minZoom:n,maxZoom:r,layerMinZoom:i,layerMaxZoom:s}){const l=e.formatMessage({id:"c4r.widgets.legend.and"}),a=e.formatMessage({id:"c4r.widgets.legend.lowerThan"}),p=e.formatMessage({id:"c4r.widgets.legend.greaterThan"}),c=e.formatMessage({id:"c4r.widgets.legend.zoomNote"}),g=s<r?`${a} ${s}`:"",h=i>n?`${p} ${i}`:"",d=[g,h].filter(Boolean).join(` ${l} `);return d?`${c} ${d}`:""}const As={},ke=()=>{},Es=[];function Bs({customLegendTypes:e=As,layers:n=Es,collapsed:r=!1,onChangeCollapsed:i=ke,onChangeVisibility:s=ke,onChangeOpacity:l=ke,onChangeLegendRowCollapsed:a=ke,onChangeSelection:p=ke,title:c="Layers",maxZoom:g=20,minZoom:h=0,currentZoom:d,isMobile:v,sx:f}){const y=X.useIntl(),m=j.useImperativeIntl(y),x=t.jsxs(Qi,{collapsed:r,children:[t.jsx(j.Typography,{variant:"caption",flexGrow:1,children:c}),t.jsx(o.Tooltip,{title:m.formatMessage({id:"c4r.widgets.legend.close"}),children:t.jsx(o.IconButton,{size:"small",onClick:()=>i(!0),children:t.jsx(jn,{})})})]}),S=t.jsx(o.Tooltip,{title:m.formatMessage({id:"c4r.widgets.legend.open"}),children:t.jsx(o.IconButton,{"aria-label":c,onClick:()=>i(!1),children:t.jsx(wn,{})})});return t.jsx(Ji,{sx:f,elevation:3,collapsed:r||!!v,children:v?t.jsxs(t.Fragment,{children:[S,t.jsxs(o.Drawer,{anchor:"bottom",open:!r,onClose:()=>i(!0),children:[x,t.jsx(Tt,{children:n.map(b=>t.jsx(Mt,{layer:b,onChangeCollapsed:a,onChangeOpacity:l,onChangeVisibility:s,onChangeSelection:p,maxZoom:g,minZoom:h,currentZoom:d,customLegendTypes:e},b.id))})]})]}):t.jsxs(t.Fragment,{children:[r?S:x,t.jsx(Tt,{width:r?0:void 0,children:t.jsx(o.Collapse,{unmountOnExit:!0,in:!r,timeout:500,children:n.map(b=>t.jsx(Mt,{layer:b,onChangeCollapsed:a,onChangeOpacity:l,onChangeVisibility:s,onChangeSelection:p,maxZoom:g,minZoom:h,currentZoom:d,customLegendTypes:e},b.id))})})]})})}function Ct({color:e=void 0,children:n}){return n?t.jsx(o.Box,{mt:.5,children:t.jsx(j.Typography,{component:"div",variant:"caption",color:e??"inherit",style:{fontWeight:"normal"},children:n})}):t.jsx(o.Box,{mt:-1})}function Ps({title:e="No data available",body:n="There are no results for the combination of filters applied to your data. Try tweaking your filters, or zoom and pan the map to adjust the Map View.",severity:r=void 0,...i}){return r?t.jsx(Tn.Alert,{title:e,severity:r,...i,children:t.jsx(Ct,{children:n})}):t.jsxs(o.Box,{...i,children:[e&&t.jsx(j.Typography,{variant:"body2",children:e}),t.jsx(Ct,{color:"textSecondary",children:n})]})}const Ls=o.styled(o.Box,{shouldForwardProp:e=>e!=="margin"})(({theme:e,margin:n})=>({margin:0,position:"relative",maxWidth:"100%",padding:n??e.spacing(2,2.5)})),Ds=o.styled(o.LinearProgress)(({theme:e})=>({position:"absolute",top:0,left:0,width:"100%",height:e.spacing(.25)})),Ns=o.styled(o.Grid,{shouldForwardProp:e=>e!=="expanded"})(({theme:e,expanded:n=!0})=>({display:"flex",flexDirection:"row",alignItems:"flex-start",justifyContent:"space-between",width:"100%",...n?{minHeight:e.spacing(3)}:{height:e.spacing(3)},padding:0})),$s=o.styled(o.Button,{shouldForwardProp:e=>e!=="expandable"})(({theme:e,expandable:n=!0})=>({flex:1,padding:0,alignItems:"flex-start",justifyContent:"flex-start",height:"auto",minHeight:"auto",marginBottom:e.spacing(1),cursor:n?"pointer":"default","& .MuiButton-startIcon":{marginTop:"3px",marginRight:e.spacing(1)},"&:hover":{background:"none"}})),hn=({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",width:e.spacing(3),height:e.spacing(3),color:e.palette.text.secondary}),Os=o.styled(fe.ExpandLess)(({theme:e})=>hn({theme:e})),Rs=o.styled(fe.ExpandMore)(({theme:e})=>hn({theme:e})),Fs=o.styled(o.Typography,{shouldForwardProp:e=>e!=="expanded"})(({expanded:e=!0})=>({wordBreak:"break-word",overflow:"hidden",...e&&{display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"},...!e&&{whiteSpace:"nowrap",textOverflow:"ellipsis"}})),Ws=o.styled(o.Grid)(({theme:e})=>({display:"flex",alignItems:"center",gap:e.spacing(1),marginRight:e.spacing(-.5),marginLeft:e.spacing(1)})),At=o.styled(o.IconButton)(({theme:e})=>({color:e.palette.text.secondary})),_s=o.styled(o.Menu)(({theme:e})=>({".MuiPaper-root":{marginTop:e.spacing(5),maxHeight:e.spacing(21),minWidth:e.spacing(16)}})),Et=[],Gs=t.jsx(fe.MoreVert,{});function Hs({title:e,actions:n=Et,options:r=Et,optionsIcon:i=Gs,children:s,contentProps:l,disabled:a=!1,expandable:p=!0,expanded:c=!0,onExpandedChange:g,footer:h,headerItems:d,isLoading:v=!1,margin:f}){const y=u.createRef(),[m,x]=u.useState(!0),S=c!==void 0&&g!==void 0,b=p!==!1?S?c:m:!0,I=S?g:x,[k,w]=u.useState(null),C=!!k,A=()=>{p&&I(!b)},D=N=>w(N.currentTarget),B=()=>w(null);function P(N){N&&N(),B()}const L=N=>t.jsx(At,{"aria-label":N.label,onClick:N.action,size:"small",children:N.icon},N.id);return a?s:t.jsxs(Ls,{margin:f,component:"section","aria-label":e,children:[v?t.jsx(Ds,{}):null,t.jsxs(Ns,{container:!0,expanded:c,children:[t.jsx($s,{expandable:p,startIcon:p&&t.jsx(o.Icon,{children:b?t.jsx(Os,{}):t.jsx(Rs,{})}),onClick:A,tabIndex:p?0:-1,children:t.jsx(o.Tooltip,{title:e,children:t.jsx(Fs,{expanded:c,align:"left",variant:"subtitle1",children:e})})}),t.jsxs(Ws,{item:!0,children:[d,n.length>0&&n.map(N=>N.tooltip?t.jsx(o.Tooltip,{title:N.tooltip.text,placement:N.tooltip.placement??"top",children:L(N)},N.id):L(N)),r.length>0&&t.jsxs(t.Fragment,{children:[t.jsx(At,{"aria-label":"options","aria-controls":"options-menu","aria-haspopup":"true",onClick:D,size:"small",children:i}),t.jsx(_s,{id:"options-menu",elevation:8,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},anchorEl:k,keepMounted:!0,open:C,onClose:B,children:r.map(N=>t.jsx(o.MenuItem,{selected:N.selected,onClick:()=>P(N.action),children:N.name},N.id))})]})]})]}),t.jsx(o.Collapse,{ref:y,in:b,timeout:"auto",unmountOnExit:!0,children:t.jsxs(o.Box,{...l,children:[t.jsx(o.Box,{pt:1,children:s}),h??t.jsx(o.Box,{children:h})]})})]})}exports.BarWidgetUI=Rn;exports.CategoryWidgetUI=Kn;exports.ComparativeCategoryWidgetUI=ki;exports.ComparativeFormulaWidgetUI=Di;exports.ComparativePieWidgetUI=_i;exports.FeatureSelectionUIDropdown=rn;exports.FeatureSelectionUIGeometryChips=sn;exports.FeatureSelectionUIToggleButton=on;exports.FeatureSelectionWidgetUI=Xi;exports.FormulaWidgetUI=Qn;exports.GroupDateTypes=le;exports.HistogramWidgetUI=ao;exports.LEGEND_TYPES=ae;exports.LegendCategories=cn;exports.LegendIcon=pn;exports.LegendProportion=dn;exports.LegendRamp=Qe;exports.LegendWidgetUI=Bs;exports.NoDataAlert=Ps;exports.PieWidgetUI=Oo;exports.RangeWidgetUI=Uo;exports.ScatterPlotWidgetUI=nr;exports.TIME_SERIES_CHART_TYPES=Ge;exports.TableWidgetUI=gr;exports.TimeSeriesProvider=Vt;exports.TimeSeriesWidgetUI=oi;exports.WrapperWidgetUI=Hs;exports.useTimeSeriesContext=He;exports.useTimeSeriesInteractivity=Ut;
|
|
33
|
+
{b|${B}}`,position:"center",rich:{b:{fontFamily:d.typography.overline.fontFamily,fontSize:j.SPACING*1.75,lineHeight:j.SPACING*1.75,fontWeight:400,color:d.palette.text.primary},per:{...d.typography.overline,fontSize:j.SPACING*3,lineHeight:j.SPACING*4.5,fontWeight:600,color:d.palette.text.primary}}},A=f.map((B,P)=>{var L;return{type:"pie",name:e[P],itemStyle:{color:(L=B[0])==null?void 0:L.color},animation:l,data:B.map(N=>({...N,itemStyle:{color:N.color}})),radius:P===0?["75%","90%"]:["56%","72%"],selectedOffset:0,hoverOffset:5,bottom:j.SPACING*2.5,avoidLabelOverlap:!0,label:{show:!1,...C},emphasis:{label:{show:!0,formatter:C.formatter,rich:C.rich}}}});return{grid:{left:0,top:0,right:0,bottom:0},tooltip:I,legend:w,series:A}},[d,e,l,f,a,p]),m={mouseover:(S,b)=>{f.length===1&&(S.seriesIndex!==0||S.dataIndex!==0)&&b.dispatchAction({type:"downplay",seriesIndex:0,dataIndex:0})},mouseout:(S,b)=>{f.length===1&&b.dispatchAction({type:"highlight",seriesIndex:0,dataIndex:0})},click:S=>{const I=f[S.seriesIndex][S.dataIndex].key,k=c.includes(I),w=new Set(c);k?w.delete(I):w.add(I);const C=f[0].length;let A=Array.from(w);A.length===C&&(A=[]),g(A)}};u.useEffect(()=>{v.current&&v.current.dispatchAction({type:f.length===1?"highlight":"downplay",seriesIndex:0,dataIndex:0})},[f]);function x(S){v.current=S}return f.length?h?t.jsx(Wt,{height:s}):t.jsx(ye,{onChartReady:x,notMerge:!0,option:y,onEvents:m,style:{maxHeight:s,width:"100%"}}):null}const Gi=()=>{};function on({icon:e,hoverTooltip:n,clickTooltip:r,enabled:i,onEnabledChange:s=Gi,tooltipPlacement:l="bottom"}){const[a,p]=u.useState(!1),[c,g]=u.useState(i);u.useEffect(()=>{g(i)},[i]),u.useEffect(()=>{if(i){const d=v=>{v.key==="Escape"&&s&&s(!1)};return window.addEventListener("keydown",d),()=>{window.removeEventListener("keydown",d)}}},[i,s]);const h=c?r:n;return t.jsx(o.ClickAwayListener,{onClickAway:()=>g(!1),children:t.jsx(o.Tooltip,{title:h,placement:l,open:a,onOpen:()=>p(!0),onClose:()=>{c||p(!1)},children:t.jsx(o.ToggleButton,{value:"selectedMode",selected:i,onClick:()=>s&&s(!i),children:e})})})}const Hi=o.styled(o.IconButton,{shouldForwardProp:e=>e!=="isOpen"})(({isOpen:e,theme:n})=>({color:n.palette.text.secondary,width:n.spacing(3),transform:`rotate(${e?"180":"0"}deg)`,backgroundColor:e?n.palette.action.hover:void 0})),zi=o.styled(o.MenuItem,{shouldForwardProp:e=>e!=="disabled"})(({disabled:e,theme:n})=>({...e&&{pointerEvents:"none",color:n.palette.text.disabled}})),Yi=o.styled(o.MenuItem)(()=>({"&.Mui-disabled":{opacity:1}})),Vi=()=>{};function rn({selectionModes:e,editModes:n,selectedMode:r,onSelectMode:i=Vi,enabled:s,tooltipPlacement:l="bottom",tooltipText:a="",menuHeaderText:p="",editDisabled:c}){const g=o.useTheme(),[h,d]=u.useState(null),v=!!h,f=I=>d(I.currentTarget),y=()=>d(null),m=I=>{i&&i(I),y()},x=!!e.length&&!!n.length,S=I=>n.some(k=>k.id===I.id);function b(I){return t.jsx(zi,{selected:s&&r===I.id,onClick:()=>m(I.id),disabled:c&&S(I),children:t.jsxs(o.Box,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[I.icon,t.jsx(o.Box,{ml:2,children:t.jsx(j.Typography,{variant:"body2",color:"inherit",children:o.capitalize(I.label)})})]})},I.id)}return t.jsxs(t.Fragment,{children:[t.jsx(o.Tooltip,{title:a,placement:l,children:t.jsx(Hi,{id:"feature-selection-menu-button","aria-controls":"feature-selection-menu","aria-haspopup":"true","aria-expanded":v?"true":void 0,onClick:f,isOpen:v,children:t.jsx(vn,{})})}),t.jsxs(o.Menu,{id:"feature-selection-menu",style:{zIndex:g.zIndex.tooltip+1},anchorEl:h,open:v,onClose:y,MenuListProps:{"aria-labelledby":"feature-selection-menu-button"},children:[p&&t.jsx(Yi,{disabled:!0,children:t.jsx(j.Typography,{variant:"caption",color:"textSecondary",children:p})}),!!e.length&&e.map(b),x&&t.jsx(o.Divider,{sx:{margin:({spacing:I})=>I(1,0)}}),!!n.length&&n.map(b)]})]})}const Ui=o.styled(o.List)(({theme:e})=>({display:"flex",alignItems:"center",marginLeft:e.spacing(1.5),padding:e.spacing(.5),overflowX:"auto",maxWidth:"100%",scrollbarWidth:"none",msOverflowStyle:"none","&::-webkit-scrollbar":{display:"none"}})),qi=()=>{};function sn({features:e,onSelectGeometry:n=qi,onDeleteGeometry:r,chipTooltip:i,disabledChipTooltip:s,size:l="medium",tooltipPlacement:a="bottom",chipLabel:p}){const c=X.useIntl(),g=j.useImperativeIntl(c);function h(y){return y==="MultiPoint"?g.formatMessage({id:"c4r.widgets.featureSelection.point"}):y==="MultiLineString"?g.formatMessage({id:"c4r.widgets.featureSelection.lineString"}):y==="MultiPolygon"||y==="Polygon"||y==="GeometryCollection"?g.formatMessage({id:"c4r.widgets.featureSelection.polygon"}):y}function d(y,m){var S;const x=h(y.geometry.type);return p||((S=y.properties)==null?void 0:S.name)||`${x} ${m+1}`}const[v,f]=u.useState(!1);return t.jsx(o.Box,{sx:{overflowX:"auto"},children:t.jsx(Ui,{sx:{gap:l==="small"?.5:1},children:e.map((y,m)=>{var k,w;const x=(k=y.properties)==null?void 0:k.disabled,S=(w=y.properties)==null?void 0:w.invalid;let b=i;x&&(b=s||i),S&&(b=g.formatMessage({id:"c4r.widgets.featureSelection.invalid"})),v&&(b=g.formatMessage({id:"c4r.widgets.featureSelection.remove"}));let I="secondary";return x&&(I="default"),S&&(I="error"),t.jsx(o.ListItem,{disablePadding:!0,children:t.jsx(o.Tooltip,{disableHoverListener:x?!s:!i,title:b,placement:a,children:t.jsx(o.Chip,{size:l,label:d(y,m),color:I,onClick:()=>n(y),onDelete:r?()=>r(y):void 0,icon:S?t.jsx(fe.ErrorOutline,{color:"error"}):void 0,deleteIcon:t.jsx(fe.Cancel,{onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1)})})})},m)})})})}const Ki=o.styled(o.Paper)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",maxHeight:e.spacing(5),padding:e.spacing(.5)})),Zi=[];function Xi({selectionModes:e,editModes:n=Zi,selectedMode:r,onSelectMode:i,enabled:s=!1,onEnabledChange:l,geometry:a,onSelectGeometry:p,onDeleteGeometry:c,tooltipPlacement:g="bottom",size:h="medium",chipLabel:d}){const v=X.useIntl(),f=j.useImperativeIntl(v),y=u.useMemo(()=>e.map(k=>({...k,label:f.formatMessage({id:`c4r.widgets.featureSelection.${kt(k.id)}`})})),[e,f]),m=u.useMemo(()=>n.map(k=>({...k,label:f.formatMessage({id:`c4r.widgets.featureSelection.${kt(k.id)}`})})),[n,f]),x=u.useMemo(()=>{const w=[...y.map(C=>({...C,isEdit:!1})),...m.map(C=>({...C,isEdit:!0}))].find(C=>C.id===r);if(!w)throw new Error(`Selected mode "${r}" not supported`);return w},[m,y,r]),S=o.capitalize((x==null?void 0:x.label)||""),b=x!=null&&x.isEdit?S:f.formatMessage({id:"c4r.widgets.featureSelection.selectTool"},{label:S}),I=x!=null&&x.isEdit?f.formatMessage({id:"c4r.widgets.featureSelection.clickToEdit"}):f.formatMessage({id:"c4r.widgets.featureSelection.clickToCreate"});return t.jsxs(Ki,{children:[t.jsx(on,{icon:x==null?void 0:x.icon,hoverTooltip:b,clickTooltip:I,enabled:s,onEnabledChange:l,tooltipPlacement:g}),t.jsx(rn,{selectionModes:y,editModes:m,selectedMode:r,onSelectMode:i,enabled:s,tooltipPlacement:g,tooltipText:f.formatMessage({id:"c4r.widgets.featureSelection.selectMode"}),menuHeaderText:f.formatMessage({id:"c4r.widgets.featureSelection.chooseSelectionMode"}),editDisabled:!a}),!!a&&t.jsx(sn,{features:[a],onSelectGeometry:p,onDeleteGeometry:c,disabledChipTooltip:f.formatMessage({id:"c4r.widgets.featureSelection.applyMask"}),chipTooltip:f.formatMessage({id:"c4r.widgets.featureSelection.clearMask"}),tooltipPlacement:g,size:h,chipLabel:d})]})}function kt(e){return e.charAt(0).toLowerCase()+e.slice(1)}const ln=240,Ji=o.styled(o.Paper,{shouldForwardProp:e=>e!=="collapsed"})(({theme:e,collapsed:n})=>({width:n?"min-content":ln,background:e.palette.background.paper,maxHeight:"calc(100% - 120px)",display:"flex",flexDirection:"column"})),Qi=o.styled("header",{shouldForwardProp:e=>e!=="collapsed"})(({theme:e,collapsed:n})=>({display:"flex",alignItems:"center",justifyContent:"space-between",padding:e.spacing(1),paddingLeft:e.spacing(2),borderBottom:n?void 0:`1px solid ${e.palette.divider}`})),es=o.styled("header")(({theme:e})=>({padding:e.spacing(1.5),paddingRight:e.spacing(2),gap:e.spacing(.5),display:"flex",justifyContent:"space-between",position:"sticky",zIndex:2,top:0,background:e.palette.background.paper})),ts=o.styled("div")(({theme:e})=>({display:"flex",gap:e.spacing(2),alignItems:"center",padding:e.spacing(1),minWidth:`calc(${ln}px - ${e.spacing(4)})`})),ns=o.styled(o.TextField)(({theme:e})=>({display:"flex",width:e.spacing(7.5),flexShrink:0,"input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:0}})),os=o.styled("ul",{shouldForwardProp:e=>e!=="opacity"})(({theme:e,opacity:n})=>({opacity:n,margin:0,padding:0,display:"flex",flexDirection:"column",gap:e.spacing(1)})),an=o.styled("ul")(({theme:e})=>({margin:0,padding:0,paddingBottom:e.spacing(1),display:"flex",flexDirection:"column"})),rs=o.styled("li")(()=>({display:"flex",alignItems:"center"})),is=o.styled("div")(({theme:e})=>({marginRight:e.spacing(1.5),width:j.ICON_SIZE_MEDIUM,height:j.ICON_SIZE_MEDIUM,"& img":{margin:"auto",display:"block"}})),Tt=o.styled(o.Box,{shouldForwardProp:e=>e!=="width"})(({width:e,theme:n})=>({width:e,overflow:"auto",maxHeight:`calc(100% - ${n.spacing(1.5)})`})),ss=o.styled("section")(({theme:e})=>({"&:not(:first-of-type)":{borderTop:`1px solid ${e.palette.divider}`}})),ls=o.styled("div")(()=>({flexGrow:1,flexShrink:1,minWidth:0}));function as({menuRef:e,open:n,toggleOpen:r,opacity:i,onChange:s}){const l=X.useIntl(),a=j.useImperativeIntl(l);function p(c){const g=parseInt(c.target.value||"0"),h=Math.min(Math.max(g,0),100);s(h/100)}return t.jsxs(t.Fragment,{children:[t.jsx(o.Tooltip,{title:a.formatMessage({id:"c4r.widgets.legend.opacity"}),children:t.jsx(o.IconButton,{size:"small",color:n?"primary":"default",onClick:()=>r(!n),children:t.jsx(Ne.OpacityIcon,{})})}),t.jsx(o.Popover,{open:n,onClose:()=>r(!1),anchorEl:e.current,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{root:{sx:{transform:"translate(-12px, 36px)"}}},children:t.jsxs(ts,{children:[t.jsx(o.Slider,{value:i*100,onChange:(c,g)=>s(g/100),min:0,max:100,step:1}),t.jsx(ns,{size:"small",type:"number",value:Math.round(i*100),onChange:p,inputProps:{step:1,min:0,max:100,style:{appearance:"textfield"},"data-testid":"opacity-slider"},InputProps:{endAdornment:t.jsxs(o.InputAdornment,{position:"end",sx:{margin:0},children:[" ","%"]})}})]})})]})}function ot({title:e,visible:n,typographyProps:r}){const i=u.useRef(null),[s,l]=u.useState(!1);u.useLayoutEffect(()=>{if(n&&i.current){const{offsetWidth:p,scrollWidth:c}=i.current;l(p<c)}},[e,n]);const a=t.jsx(j.Typography,{ref:i,color:n?"textPrimary":"textSecondary",variant:"button",weight:"medium",component:"p",noWrap:!0,my:.25,...r,children:e});return s?t.jsx(o.Tooltip,{title:e,children:a}):a}var ae=(e=>(e.CATEGORY="category",e.ICON="icon",e.CONTINUOUS_RAMP="continuous_ramp",e.BINS="bins",e.PROPORTION="proportion",e))(ae||{});const qe=20;function cn({legend:e}){const{labels:n=[],colors:r=[],isStrokeColor:i=!1,customMarkers:s,maskedMarkers:l=!0}=e,a=Te.getPalette(r,n.length),p=n.length>qe,c=X.useIntl(),g=j.useImperativeIntl(c);return t.jsxs(t.Fragment,{children:[t.jsx(an,{"data-testid":"categories-legend",children:n.slice(0,qe).map((h,d)=>t.jsx(ps,{label:String(h),color:a[d%a.length],icon:s&&Array.isArray(s)?s[d]:s,maskedIcon:l,isStrokeColor:i},`${h}${d}`))}),p&&t.jsx(j.Typography,{variant:"caption",color:"textSecondary",component:"div",py:2,children:g.formatMessage({id:"c4r.widgets.legend.maxCategories"},{n:qe})})]})}const cs=({isMax:e,color:n,isStrokeColor:r,theme:i})=>({border:"2px solid transparent","&::after":{position:"absolute",display:e?"block":"none",content:'""',width:i.spacing(2),height:i.spacing(2),border:`2px solid ${i.palette.grey[900]}`,transform:"translate(-30%, -30%)",borderRadius:"50%",boxSizing:"content-box"},...r?{borderColor:n}:{backgroundColor:n}}),ds=({icon:e,color:n,maskedIcon:r})=>({maskRepeat:"no-repeat",maskSize:"cover",backgroundRepeat:"no-repeat",backgroundSize:"cover",...r?{backgroundColor:n,maskImage:`url(${e})`,WebkitMaskImage:`url(${e})`}:{backgroundColor:"rgba(0,0,0,0)",backgroundImage:`url(${e})`}}),us=o.styled(o.Box,{shouldForwardProp:e=>e!=="icon"&&e!=="maskedIcon"&&e!=="color"&&e!=="isStrokeColor"})(({icon:e,maskedIcon:n,color:r,isStrokeColor:i,theme:s})=>({whiteSpace:"nowrap",display:"block",width:s.spacing(1.5),height:s.spacing(1.5),flexShrink:"0",borderRadius:"50%",position:"relative",border:"2px solid transparent",...e?ds({icon:e,color:r,maskedIcon:n}):cs({color:r,isStrokeColor:i,theme:s})}));function ps({label:e,isStrokeColor:n,color:r="#000",icon:i,maskedIcon:s}){return t.jsxs(o.Box,{component:"li",sx:{display:"flex",alignItems:"center"},children:[t.jsx(us,{className:"marker",mr:1.5,component:"span",icon:i,maskedIcon:s,isStrokeColor:n,color:r}),t.jsx(ot,{title:e,visible:!0,typographyProps:{variant:"overline",my:.75}})]})}const De=6,We={0:12,1:9,2:6,3:3},gs=o.styled(o.Box,{shouldForwardProp:e=>e!=="index"})(({index:e=0,theme:n})=>{const r=n.spacing(We[e]),i=n.spacing(We[e]);return{border:`solid 1px ${n.palette.divider}`,backgroundColor:n.palette.background.default,borderRadius:"50%",position:"absolute",right:0,bottom:0,width:r,height:i}}),hs=o.styled(o.Box)(({theme:{spacing:e}})=>({display:"flex",justifyContent:"flex-end",flexShrink:0,position:"relative",width:e(We[0]),height:e(We[0])})),fs=o.styled(o.Box)(({theme:{spacing:e}})=>({display:"flex",gap:e(1),alignItems:"stretch",justifyContent:"stretch",padding:e(2,0)})),xs=o.styled(o.Box)(()=>({display:"flex",flexDirection:"column",justifyContent:"space-around",gap:1,flexGrow:1,flexShrink:1}));function dn({legend:e}){const n=X.useIntl(),r=j.useImperativeIntl(n),i=e.showMinMax??!0,{min:s,max:l,error:a}=ms(e),[p,c]=a?[0,0]:ys(s,l);return t.jsxs(fs,{"data-testid":"proportion-legend",children:[t.jsx(hs,{children:[...Array(4)].map((g,h)=>t.jsx(gs,{index:h,component:"span"},h))}),t.jsx(xs,{children:a?t.jsx(o.Box,{maxWidth:240,children:t.jsx(j.Typography,{variant:"overline",children:"You need to specify valid numbers for the labels property"})}):t.jsxs(t.Fragment,{children:[t.jsxs(j.Typography,{variant:"overline",color:"textSecondary",children:[i&&r.formatMessage({id:"c4r.widgets.legend.max"})+": ",n.formatNumber(l,{maximumSignificantDigits:De})]}),t.jsx(j.Typography,{variant:"overline",color:"textSecondary",children:n.formatNumber(c,{maximumSignificantDigits:De})}),t.jsx(j.Typography,{variant:"overline",color:"textSecondary",children:n.formatNumber(p,{maximumSignificantDigits:De})}),t.jsxs(j.Typography,{variant:"overline",color:"textSecondary",children:[i&&r.formatMessage({id:"c4r.widgets.legend.min"})+": ",n.formatNumber(s,{maximumSignificantDigits:De})]})]})})]})}function un({labels:e}){let n=e==null?void 0:e[e.length-1],r=e==null?void 0:e[0];return Number.isFinite(r)||(r=parseInt(String(r),10)),Number.isFinite(n)||(n=parseInt(String(n),10)),[r,n]}function ms(e){let n=!1;const[r,i]=un(e);return(Number.isNaN(r)||Number.isNaN(i))&&(n=!0),{min:r,max:i,error:n}}function ys(e,n){const r=(n-e)/3;return[e+r,n-r]}function pn({legend:e}){const{labels:n=[],icons:r=[]}=e;return t.jsx(an,{"data-testid":"icon-legend",children:n.map((i,s)=>t.jsxs(rs,{children:[t.jsx(is,{children:t.jsx("img",{src:r[s],alt:i,width:"auto",height:j.ICON_SIZE_MEDIUM})}),t.jsx(ot,{visible:!0,title:i,typographyProps:{variant:"overline",my:.75}})]},i))})}function vs(e){return typeof e[0]=="object"&&"label"in e[0]}function Qe({isContinuous:e=!1,legend:n}){const{labels:r=[],colors:i=[],showMinMax:s=!0}=n,l=Te.getPalette(i,!r.length||e?2:r.length+1),a=vs(r),p=a?r.map(({value:y})=>y):r,c=a?r.map(({label:y})=>y):r,[g,h]=un({labels:p}),d=Number.isNaN(g)||Number.isNaN(h);let v=c[c.length-1],f=c[0];return!e&&s&&(f="< "+f,v="≥ "+v),t.jsx(o.Box,{py:2,"data-testid":"ramp-legend",children:d?t.jsx(o.Box,{maxWidth:240,children:t.jsx(j.Typography,{variant:"overline",children:"You need to specify valid numbers for the labels property"})}):t.jsxs(t.Fragment,{children:[t.jsx(o.Box,{display:"flex",pb:1,children:e?t.jsx(js,{"data-testid":"step-continuous",palette:l}):t.jsx(bs,{palette:l,labels:c,max:v,min:f})}),t.jsxs(o.Box,{display:"flex",justifyContent:"space-between",children:[t.jsx(j.Typography,{variant:"overlineDelicate",color:"textSecondary",children:f}),t.jsx(j.Typography,{variant:"overlineDelicate",color:"textSecondary",children:v})]})]})})}const js=o.styled(o.Box,{shouldForwardProp:e=>e!=="palette"})(({palette:e,theme:n})=>({display:"block",flexGrow:1,height:n.spacing(1),borderRadius:n.spacing(.5),background:`linear-gradient(to right, ${e.join()})`})),ws=o.styled(o.Box,{shouldForwardProp:e=>e!=="color"})(({color:e,theme:n})=>({display:"block",flexGrow:1,height:n.spacing(1),backgroundColor:e,"&:first-of-type":{borderRadius:n.spacing(.5,0,0,.5)},"&:last-of-type":{borderRadius:n.spacing(0,.5,.5,0)}}));function bs({labels:e=[],palette:n=[],max:r,min:i}){const s=e.length?[i,...e]:[i,r];return t.jsx(t.Fragment,{children:s.map((l,a)=>{const p=a===0?i:a===s.length-1?r:`${l} - ${s[a+1]}`;return t.jsx(o.Tooltip,{title:p,children:t.jsx(ws,{"data-testid":"step-discontinuous",color:n[a]})},a)})})}const Ss={[ae.CATEGORY]:cn,[ae.PROPORTION]:dn,[ae.ICON]:pn,[ae.BINS]:e=>t.jsx(Qe,{...e,isContinuous:!1}),[ae.CONTINUOUS_RAMP]:e=>t.jsx(Qe,{...e,isContinuous:!0})};function Is({legend:e}){const n=X.useIntl(),r=j.useImperativeIntl(n);return e.select||!e.type?null:t.jsxs(j.Typography,{variant:"body2",color:"textSecondary",component:"p",children:[e.type," ",r.formatMessage({id:"c4r.widgets.legend.notSupported"}),"."]})}function ks(e){return e.type===ae.PROPORTION?"c4r.widgets.legend.subtitles.proportion":e.type===ae.ICON||e.customMarkers?"c4r.widgets.legend.subtitles.icon":e.isStrokeColor?"c4r.widgets.legend.subtitles.strokeColor":"c4r.widgets.legend.subtitles.color"}function Ts({layer:e,legend:n,customLegendTypes:r,onChangeSelection:i}){var h;const s=X.useIntl(),l=j.useImperativeIntl(s),a=n.type,c=Ss[a]??r[a]??Is,g=((h=n.select)==null?void 0:h.options)??[];return t.jsxs(o.Box,{component:"li","data-testid":"legend-layer-variable",px:2,children:[n.attr?t.jsxs(o.Box,{pb:1,children:[t.jsx(j.Typography,{gutterBottom:!0,variant:"overlineDelicate",color:"textSecondary",component:"p",children:l.formatMessage({id:ks(n)})}),t.jsx(j.Typography,{variant:"caption",component:"p",children:n.attr})]}):null,n.select?t.jsxs(o.Box,{pb:1,children:[t.jsx(j.Typography,{variant:"caption",weight:"medium",component:"p",children:n.select.label}),t.jsx(o.Select,{"data-testid":"legend-layer-variable-select",name:"legend-select",value:n.select.value,renderValue:d=>{var v;return((v=g.find(f=>f.value===d))==null?void 0:v.label)??d},onChange:d=>i(d.target.value),MenuProps:{transformOrigin:{vertical:"bottom",horizontal:"left"},anchorOrigin:{vertical:"top",horizontal:"left"},PaperProps:{style:{maxHeight:240}}},children:g.map(d=>t.jsx(o.MenuItem,{value:d.value,children:t.jsx(o.ListItemText,{primary:d.label})},d.value))})]}):null,t.jsx(c,{layer:e,legend:n})]})}const Ms={};function gn(e){return e?Array.isArray(e)?e.every(n=>gn(n)):!e.select&&!e.type:!0}function Mt({customLegendTypes:e=Ms,layer:n,onChangeCollapsed:r,onChangeOpacity:i,onChangeVisibility:s,onChangeSelection:l,maxZoom:a=21,minZoom:p=0,currentZoom:c=0}){const g=X.useIntl(),h=j.useImperativeIntl(g),d=u.useRef(null),[v,f]=u.useState(!1),y=n.id,m=n.title,x=n.visible??!0,S=n.switchable??!0,b=n.collapsed??!1,I=(n.collapsible??!0)&&!gn(n.legend),k=n.opacity??1,w=n.showOpacityControl??!0,C=x&&!b,A=C?t.jsx(kn,{}):t.jsx(In,{}),D=(n==null?void 0:n.minZoom)!==void 0||(n==null?void 0:n.maxZoom)!==void 0,B=n.minZoom??p,P=n.maxZoom??a,L=D&&(B>p||P<a),N=c<B||c>P,V=Cs({intl:h,minZoom:p,maxZoom:a,layerMinZoom:B,layerMaxZoom:P}),_=n.helperText??(L?V:""),T=u.useMemo(()=>n.legend?Array.isArray(n.legend)?n.legend:[n.legend]:[],[n.legend]);return n.legend?t.jsxs(ss,{"data-testid":"legend-layer","aria-label":m,children:[t.jsxs(es,{ref:d,children:[I&&t.jsx(o.IconButton,{size:"small","aria-label":h.formatMessage({id:b?"c4r.widgets.legend.expand":"c4r.widgets.legend.collapse"}),disabled:!x,onClick:()=>r({id:y,collapsed:!b}),children:A}),t.jsxs(ls,{children:[t.jsx(ot,{visible:x,title:m??""}),L&&t.jsx(o.Tooltip,{title:h.formatMessage({id:"c4r.widgets.legend.zoomLevelTooltip"}),children:t.jsxs(j.Typography,{color:x?"textPrimary":"textSecondary",variant:"caption",component:"p",children:[h.formatMessage({id:"c4r.widgets.legend.zoomLevel"})," ",n.minZoom," - ",n.maxZoom]})})]}),w&&x&&!b&&t.jsx(as,{menuRef:d,open:v,toggleOpen:f,opacity:k,onChange:O=>i({id:y,opacity:O})}),S&&t.jsx(o.Tooltip,{title:h.formatMessage({id:x?"c4r.widgets.legend.hideLayer":"c4r.widgets.legend.showLayer"}),children:t.jsx(o.IconButton,{size:"small",onClick:()=>s({id:y,collapsed:x?b:!1,visible:!x}),children:x?t.jsx(bn,{}):t.jsx(Sn,{})})})]}),t.jsxs(o.Collapse,{unmountOnExit:!0,timeout:100,in:C,children:[t.jsx(os,{"data-testid":"legend-layer-variable-list",opacity:N?.5:1,children:T.map((O,M)=>t.jsx(Ts,{legend:O,layer:n,customLegendTypes:e,onChangeSelection:$=>l({id:y,index:M,selection:$})},`${O.type}-${M}`))}),_&&t.jsx(j.Typography,{variant:"caption",color:"textSecondary",component:"div",p:2,children:t.jsx("div",{dangerouslySetInnerHTML:{__html:_}})})]})]}):null}function Cs({intl:e,minZoom:n,maxZoom:r,layerMinZoom:i,layerMaxZoom:s}){const l=e.formatMessage({id:"c4r.widgets.legend.and"}),a=e.formatMessage({id:"c4r.widgets.legend.lowerThan"}),p=e.formatMessage({id:"c4r.widgets.legend.greaterThan"}),c=e.formatMessage({id:"c4r.widgets.legend.zoomNote"}),g=s<r?`${a} ${s}`:"",h=i>n?`${p} ${i}`:"",d=[g,h].filter(Boolean).join(` ${l} `);return d?`${c} ${d}`:""}const As={},ke=()=>{},Es=[];function Bs({customLegendTypes:e=As,layers:n=Es,collapsed:r=!1,onChangeCollapsed:i=ke,onChangeVisibility:s=ke,onChangeOpacity:l=ke,onChangeLegendRowCollapsed:a=ke,onChangeSelection:p=ke,title:c="Layers",maxZoom:g=20,minZoom:h=0,currentZoom:d,isMobile:v,sx:f}){const y=X.useIntl(),m=j.useImperativeIntl(y),x=t.jsxs(Qi,{collapsed:r,children:[t.jsx(j.Typography,{variant:"caption",flexGrow:1,children:c}),t.jsx(o.Tooltip,{title:m.formatMessage({id:"c4r.widgets.legend.close"}),children:t.jsx(o.IconButton,{size:"small",onClick:()=>i(!0),children:t.jsx(jn,{})})})]}),S=t.jsx(o.Tooltip,{title:m.formatMessage({id:"c4r.widgets.legend.open"}),children:t.jsx(o.IconButton,{"aria-label":c,onClick:()=>i(!1),children:t.jsx(wn,{})})});return t.jsx(Ji,{sx:f,elevation:3,collapsed:r||!!v,children:v?t.jsxs(t.Fragment,{children:[S,t.jsxs(o.Drawer,{anchor:"bottom",open:!r,onClose:()=>i(!0),children:[x,t.jsx(Tt,{children:n.map(b=>t.jsx(Mt,{layer:b,onChangeCollapsed:a,onChangeOpacity:l,onChangeVisibility:s,onChangeSelection:p,maxZoom:g,minZoom:h,currentZoom:d,customLegendTypes:e},b.id))})]})]}):t.jsxs(t.Fragment,{children:[r?S:x,t.jsx(Tt,{width:r?0:void 0,children:t.jsx(o.Collapse,{unmountOnExit:!0,in:!r,timeout:500,children:n.map(b=>t.jsx(Mt,{layer:b,onChangeCollapsed:a,onChangeOpacity:l,onChangeVisibility:s,onChangeSelection:p,maxZoom:g,minZoom:h,currentZoom:d,customLegendTypes:e},b.id))})})]})})}function Ct({color:e=void 0,children:n}){return n?t.jsx(o.Box,{mt:.5,children:t.jsx(j.Typography,{component:"div",variant:"caption",color:e??"inherit",style:{fontWeight:"normal"},children:n})}):t.jsx(o.Box,{mt:-1})}function Ps({title:e="No data available",body:n="There are no results for the combination of filters applied to your data. Try tweaking your filters, or zoom and pan the map to adjust the Map View.",severity:r=void 0,...i}){return r?t.jsx(Tn.Alert,{title:e,severity:r,...i,children:t.jsx(Ct,{children:n})}):t.jsxs(o.Box,{...i,children:[e&&t.jsx(j.Typography,{variant:"body2",children:e}),t.jsx(Ct,{color:"textSecondary",children:n})]})}const Ls=o.styled(o.Box,{shouldForwardProp:e=>e!=="margin"})(({theme:e,margin:n})=>({margin:0,position:"relative",maxWidth:"100%",padding:n??e.spacing(2,2.5)})),Ds=o.styled(o.LinearProgress)(({theme:e})=>({position:"absolute",top:0,left:0,width:"100%",height:e.spacing(.25)})),Ns=o.styled(o.Grid,{shouldForwardProp:e=>e!=="expanded"})(({theme:e,expanded:n=!0})=>({display:"flex",flexDirection:"row",alignItems:"flex-start",justifyContent:"space-between",width:"100%",...n?{minHeight:e.spacing(3)}:{height:e.spacing(3)},padding:0})),$s=o.styled(o.Button,{shouldForwardProp:e=>e!=="expandable"})(({theme:e,expandable:n=!0})=>({flex:1,padding:0,alignItems:"flex-start",justifyContent:"flex-start",height:"auto",minHeight:"auto",marginBottom:e.spacing(1),cursor:n?"pointer":"default","& .MuiButton-startIcon":{marginTop:"3px",marginRight:e.spacing(1)},"&:hover":{background:"none"}})),hn=({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",width:e.spacing(3),height:e.spacing(3),color:e.palette.text.secondary}),Os=o.styled(fe.ExpandLess)(({theme:e})=>hn({theme:e})),Rs=o.styled(fe.ExpandMore)(({theme:e})=>hn({theme:e})),Fs=o.styled(o.Typography,{shouldForwardProp:e=>e!=="expanded"})(({expanded:e=!0})=>({wordBreak:"break-word",overflow:"hidden",...e&&{display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"},...!e&&{whiteSpace:"nowrap",textOverflow:"ellipsis"}})),Ws=o.styled(o.Grid)(({theme:e})=>({display:"flex",alignItems:"center",gap:e.spacing(1),marginRight:e.spacing(-.5),marginLeft:e.spacing(1)})),At=o.styled(o.IconButton)(({theme:e})=>({color:e.palette.text.secondary})),_s=o.styled(o.Menu)(({theme:e})=>({".MuiPaper-root":{marginTop:e.spacing(5),maxHeight:e.spacing(21),minWidth:e.spacing(16)}})),Et=[],Gs=t.jsx(fe.MoreVert,{});function Hs({title:e,actions:n=Et,options:r=Et,optionsIcon:i=Gs,children:s,contentProps:l,disabled:a=!1,expandable:p=!0,expanded:c=!0,onExpandedChange:g,footer:h,headerItems:d,isLoading:v=!1,margin:f}){const y=u.createRef(),[m,x]=u.useState(!0),S=c!==void 0&&g!==void 0,b=p!==!1?S?c:m:!0,I=S?g:x,[k,w]=u.useState(null),C=!!k,A=()=>{p&&I(!b)},D=N=>w(N.currentTarget),B=()=>w(null);function P(N){N&&N(),B()}const L=N=>t.jsx(At,{"aria-label":N.label,onClick:N.action,size:"small",children:N.icon},N.id);return a?s?t.jsx(t.Fragment,{children:s}):null:t.jsxs(Ls,{margin:f,component:"section","aria-label":e,children:[v?t.jsx(Ds,{}):null,t.jsxs(Ns,{container:!0,expanded:c,children:[t.jsx($s,{expandable:p,startIcon:p&&t.jsx(o.Icon,{children:b?t.jsx(Os,{}):t.jsx(Rs,{})}),onClick:A,tabIndex:p?0:-1,children:t.jsx(o.Tooltip,{title:e,children:t.jsx(Fs,{expanded:c,align:"left",variant:"subtitle1",children:e})})}),t.jsxs(Ws,{item:!0,children:[d,n.length>0&&n.map(N=>N.tooltip?t.jsx(o.Tooltip,{title:N.tooltip.text,placement:N.tooltip.placement??"top",children:L(N)},N.id):L(N)),r.length>0&&t.jsxs(t.Fragment,{children:[t.jsx(At,{"aria-label":"options","aria-controls":"options-menu","aria-haspopup":"true",onClick:D,size:"small",children:i}),t.jsx(_s,{id:"options-menu",elevation:8,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},anchorEl:k,keepMounted:!0,open:C,onClose:B,children:r.map(N=>t.jsx(o.MenuItem,{selected:N.selected,onClick:()=>P(N.action),children:N.name},N.id))})]})]})]}),t.jsx(o.Collapse,{ref:y,in:b,timeout:"auto",unmountOnExit:!0,children:t.jsxs(o.Box,{...l,children:[t.jsx(o.Box,{pt:1,children:s}),h??t.jsx(o.Box,{children:h})]})})]})}exports.BarWidgetUI=Rn;exports.CategoryWidgetUI=Kn;exports.ComparativeCategoryWidgetUI=ki;exports.ComparativeFormulaWidgetUI=Di;exports.ComparativePieWidgetUI=_i;exports.FeatureSelectionUIDropdown=rn;exports.FeatureSelectionUIGeometryChips=sn;exports.FeatureSelectionUIToggleButton=on;exports.FeatureSelectionWidgetUI=Xi;exports.FormulaWidgetUI=Qn;exports.GroupDateTypes=le;exports.HistogramWidgetUI=ao;exports.LEGEND_TYPES=ae;exports.LegendCategories=cn;exports.LegendIcon=pn;exports.LegendProportion=dn;exports.LegendRamp=Qe;exports.LegendWidgetUI=Bs;exports.NoDataAlert=Ps;exports.PieWidgetUI=Oo;exports.RangeWidgetUI=Uo;exports.ScatterPlotWidgetUI=nr;exports.TIME_SERIES_CHART_TYPES=Ge;exports.TableWidgetUI=gr;exports.TimeSeriesProvider=Vt;exports.TimeSeriesWidgetUI=oi;exports.WrapperWidgetUI=Hs;exports.useTimeSeriesContext=He;exports.useTimeSeriesInteractivity=Ut;
|