@carto/meridian-ds 1.4.1-0 → 1.4.1-alpha-menu-tests.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/{MenuItem-vbfSlKyV.js → MenuItem-Cd34y6F3.js} +41 -15
  3. package/dist/MenuItem-Dbss-WG1.cjs +1 -0
  4. package/dist/components/index.cjs +1 -1
  5. package/dist/components/index.js +663 -598
  6. package/dist/theme/index.cjs +1 -1
  7. package/dist/theme/index.js +41 -35
  8. package/dist/types/components/molecules/Autocomplete/Autocomplete.d.ts.map +1 -1
  9. package/dist/types/components/molecules/Autocomplete/CreatableAutocomplete.d.ts +1 -1
  10. package/dist/types/components/molecules/Autocomplete/CreatableAutocomplete.d.ts.map +1 -1
  11. package/dist/types/components/molecules/Autocomplete/ListBoxWithFilter.d.ts +2 -0
  12. package/dist/types/components/molecules/Autocomplete/ListBoxWithFilter.d.ts.map +1 -1
  13. package/dist/types/components/molecules/Autocomplete/MultipleAutocomplete.d.ts +1 -1
  14. package/dist/types/components/molecules/Autocomplete/MultipleAutocomplete.d.ts.map +1 -1
  15. package/dist/types/components/molecules/Autocomplete/useAutocompleteRenderOption.d.ts.map +1 -1
  16. package/dist/types/components/molecules/Autocomplete/useMultipleAutocomplete.d.ts +2 -2
  17. package/dist/types/components/molecules/Autocomplete/useMultipleAutocomplete.d.ts.map +1 -1
  18. package/dist/types/components/molecules/Autocomplete/utils.d.ts +1 -0
  19. package/dist/types/components/molecules/Autocomplete/utils.d.ts.map +1 -1
  20. package/dist/types/components/molecules/Menu/Menu.d.ts +2 -1
  21. package/dist/types/components/molecules/Menu/Menu.d.ts.map +1 -1
  22. package/dist/types/components/molecules/Menu/MenuItem.d.ts +2 -1
  23. package/dist/types/components/molecules/Menu/MenuItem.d.ts.map +1 -1
  24. package/dist/types/components/molecules/Menu/MenuItemFilter.d.ts +9 -0
  25. package/dist/types/components/molecules/Menu/MenuItemFilter.d.ts.map +1 -0
  26. package/dist/types/components/molecules/Menu/MenuList.d.ts +2 -1
  27. package/dist/types/components/molecules/Menu/MenuList.d.ts.map +1 -1
  28. package/dist/types/components/molecules/Menu/index.d.ts +2 -2
  29. package/dist/types/components/molecules/Menu/index.d.ts.map +1 -1
  30. package/dist/types/components/organisms/DatePickers/DateRangePicker.d.ts.map +1 -1
  31. package/dist/types/components/organisms/DatePickers/PickersDay.d.ts.map +1 -1
  32. package/dist/types/theme/sections/components/data-display.d.ts.map +1 -1
  33. package/dist/types/theme/sections/components/forms.d.ts.map +1 -1
  34. package/dist/widgets/index.cjs +1 -1
  35. package/dist/widgets/index.js +1 -1
  36. package/package.json +17 -19
  37. package/dist/MenuItem-CuEx97RN.cjs +0 -1
  38. package/dist/types/components/molecules/Menu/MenuFilter.d.ts +0 -8
  39. package/dist/types/components/molecules/Menu/MenuFilter.d.ts.map +0 -1
package/CHANGELOG.md CHANGED
@@ -2,8 +2,17 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ - Add unit tests for Menu components [#158](https://github.com/CartoDB/meridian-ds/pull/158)
6
+ - Pass `reason` parameter to the **CreatableAutocomplete** `onChange` callback [#160](https://github.com/CartoDB/meridian-ds/pull/160)
7
+ - Use values passed through `startProps` or `endProps` to `DateRangePicker` for being used afterward with `PickersDay` [#159](https://github.com/CartoDB/meridian-ds/pull/159/)
8
+ - Add unit tests for Autocomplete components [#136](https://github.com/CartoDB/meridian-ds/pull/136)
9
+
5
10
  ## 1.0
6
11
 
12
+ ### 1.4.1
13
+
14
+ - Fix issue with `peerDependencies` not including `@mui/x-date-pickers` [#147](https://github.com/CartoDB/meridian-ds/pull/147)
15
+
7
16
  ### 1.4.0
8
17
 
9
18
  - Autocomplete: Split `creatable` and `multiple` from regular Autocomplete [#120](https://github.com/CartoDB/meridian-ds/pull/120)
@@ -1,17 +1,18 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { styled as l, MenuItem as s } from "@mui/material";
3
- const c = l(s, {
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import { forwardRef as s } from "react";
3
+ import { styled as c, MenuItem as g } from "@mui/material";
4
+ const u = c(g, {
4
5
  shouldForwardProp: (o) => !["subtitle", "destructive", "extended", "fixed", "iconColor"].includes(
5
6
  o
6
7
  )
7
8
  })(
8
9
  ({
9
10
  theme: o,
10
- dense: i,
11
+ dense: t,
11
12
  subtitle: r,
12
- destructive: a,
13
- extended: p,
14
- fixed: t,
13
+ destructive: i,
14
+ extended: a,
15
+ fixed: p,
15
16
  iconColor: n = "primary"
16
17
  }) => ({
17
18
  ...r && {
@@ -55,7 +56,7 @@ const c = l(s, {
55
56
  fill: o.palette.primary.main
56
57
  }
57
58
  },
58
- ...a && {
59
+ ...i && {
59
60
  color: o.palette.error.main,
60
61
  ".MuiTypography-root": {
61
62
  color: o.palette.error.main
@@ -91,12 +92,12 @@ const c = l(s, {
91
92
  }
92
93
  }
93
94
  },
94
- ...p && {
95
+ ...a && {
95
96
  "&.MuiButtonBase-root.MuiMenuItem-root": {
96
97
  minHeight: o.spacing(6)
97
98
  }
98
99
  },
99
- ...t && {
100
+ ...p && {
100
101
  "&.MuiMenuItem-root": {
101
102
  position: "sticky",
102
103
  top: 0,
@@ -118,12 +119,12 @@ const c = l(s, {
118
119
  }
119
120
  }
120
121
  },
121
- ...!t && {
122
+ ...!p && {
122
123
  ".MuiList-root &:first-of-type": {
123
124
  marginTop: o.spacing(1)
124
125
  }
125
126
  },
126
- ...i && {
127
+ ...t && {
127
128
  "&.MuiButtonBase-root.MuiMenuItem-root": {
128
129
  minHeight: o.spacing(3),
129
130
  padding: o.spacing(0.25, 1.5)
@@ -131,9 +132,34 @@ const c = l(s, {
131
132
  }
132
133
  })
133
134
  );
134
- function d(o) {
135
- return /* @__PURE__ */ e(c, { ...o });
135
+ function d({
136
+ disabled: o,
137
+ subtitle: t,
138
+ destructive: r,
139
+ extended: i,
140
+ fixed: a,
141
+ iconColor: p = "primary",
142
+ ...n
143
+ }, e) {
144
+ return /* @__PURE__ */ l(
145
+ u,
146
+ {
147
+ "data-name": "menu-item",
148
+ ...n,
149
+ ref: e,
150
+ disabled: o || t,
151
+ subtitle: t,
152
+ destructive: r,
153
+ extended: i,
154
+ fixed: a,
155
+ color: p,
156
+ "data-destructive": r,
157
+ "data-extended": i,
158
+ "data-fixed": a
159
+ }
160
+ );
136
161
  }
162
+ const f = s(d);
137
163
  export {
138
- d as M
164
+ f as M
139
165
  };
@@ -0,0 +1 @@
1
+ "use strict";const s=require("react/jsx-runtime"),c=require("react"),p=require("@mui/material"),u=p.styled(p.MenuItem,{shouldForwardProp:o=>!["subtitle","destructive","extended","fixed","iconColor"].includes(o)})(({theme:o,dense:t,subtitle:r,destructive:i,extended:a,fixed:e,iconColor:n="primary"})=>({...r&&{pointerEvents:"none",columnGap:0,...o.typography.caption,fontWeight:500,color:o.palette.text.secondary,".MuiListItemText-root .MuiTypography-root":{...o.typography.caption,fontWeight:500,color:o.palette.text.secondary},"&.MuiMenuItem-root":{minHeight:o.spacing(3),paddingTop:0,paddingBottom:0,marginTop:o.spacing(1),"&:not(:first-of-type)":{marginTop:o.spacing(2),"&::before":{content:'""',position:"absolute",top:o.spacing(-1),left:0,right:0,height:1,backgroundColor:o.palette.divider}}}},...n==="primary"&&{".MuiListItemIcon-root svg path":{fill:o.palette.text.primary},"&.Mui-selected .MuiListItemIcon-root svg path":{fill:o.palette.primary.main},'.MuiAutocomplete-listbox &[aria-selected="true"] svg path':{fill:o.palette.primary.main}},...i&&{color:o.palette.error.main,".MuiTypography-root":{color:o.palette.error.main},"svg, & .MuiSvgIcon-root":{color:o.palette.error.main},".MuiListItemIcon-root svg path":{fill:o.palette.error.main},"&.Mui-selected .MuiListItemIcon-root svg path":{fill:o.palette.error.main},"&:hover":{backgroundColor:o.palette.error.relatedLight},"&.Mui-selected":{color:o.palette.error.main,".MuiTypography-root":{color:o.palette.error.main},"svg, & .MuiSvgIcon-root":{color:o.palette.error.main}},"&.Mui-disabled":{color:o.palette.text.disabled,".MuiTypography-root":{color:o.palette.text.disabled},svg:{color:o.palette.text.disabled}}},...a&&{"&.MuiButtonBase-root.MuiMenuItem-root":{minHeight:o.spacing(6)}},...e&&{"&.MuiMenuItem-root":{position:"sticky",top:0,left:0,bottom:0,right:0,zIndex:2,minHeight:o.spacing(6),marginBottom:o.spacing(1),padding:o.spacing(.5,1.5),backgroundColor:`${o.palette.background.paper} !important`,borderBottom:`1px solid ${o.palette.divider}`},".MuiAutocomplete-listbox &.MuiAutocomplete-option:first-of-type":{minHeight:o.spacing(6),marginTop:0,"&:hover":{backgroundColor:o.palette.background.paper}}},...!e&&{".MuiList-root &:first-of-type":{marginTop:o.spacing(1)}},...t&&{"&.MuiButtonBase-root.MuiMenuItem-root":{minHeight:o.spacing(3),padding:o.spacing(.25,1.5)}}}));function g({disabled:o,subtitle:t,destructive:r,extended:i,fixed:a,iconColor:e="primary",...n},l){return s.jsx(u,{"data-name":"menu-item",...n,ref:l,disabled:o||t,subtitle:t,destructive:r,extended:i,fixed:a,color:e,"data-destructive":r,"data-extended":i,"data-fixed":a})}const d=c.forwardRef(g);exports.MenuItem=d;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),b=require("react"),i=require("@mui/material"),y=require("../TablePaginationActions-7wkkiCXh.cjs"),k=require("react-intl"),T=require("@mui/icons-material"),E=require("../Alert-B2JgFj6Y.cjs");require("cartocolor");const W=require("../MenuItem-CuEx97RN.cjs"),H=require("../ArrowDown-CGnG0E-4.cjs"),ct=require("@mui/x-date-pickers/DatePicker"),dt=require("@mui/x-date-pickers"),ut=require("@mui/x-date-pickers/TimePicker"),pt=require("@mui/x-date-pickers/DateTimePicker"),gt=require("@mui/material/ClickAwayListener"),xt=i.styled(i.Box)({position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center"}),ft=i.styled(i.Box)({visibility:"hidden",pointerEvents:"none"});function ht({children:t,loading:e,disabled:o,startIcon:r,endIcon:a,loadingPosition:l,...s},d){const c=n.jsx(i.CircularProgress,{size:18,color:"inherit"}),u=e&&l===void 0,f=()=>u?n.jsxs(i.Box,{sx:{position:"relative"},children:[n.jsx(xt,{children:c}),n.jsx(ft,{children:t})]}):t,p=g=>{if(!u)return e&&l!==void 0?l===g?c:void 0:g==="start"?r:a};return n.jsx(i.Button,{disabled:e||o,startIcon:p("start"),endIcon:p("end"),...s,ref:d,children:n.jsx(y.Typography,{variant:"inherit",color:"inherit",noWrap:!0,component:"span",children:f()})})}const mt=b.forwardRef(ht),bt=i.styled(i.Box)(({theme:t})=>({display:"flex",alignItems:"center",gap:t.spacing(.5)})),yt=i.styled(y.Typography)(({theme:t})=>({".Mui-disabled &":{color:t.palette.text.disabled}})),jt=i.styled(i.Box)(({theme:t})=>({display:"flex",svg:{width:y.ICON_SIZE_SMALL,height:y.ICON_SIZE_SMALL,fontSize:y.ICON_SIZE_SMALL,path:{fill:t.palette.text.secondary,".Mui-disabled &":{fill:t.palette.text.disabled}}}}));function F({label:t,type:e,icon:o,inheritSize:r}){return n.jsxs(bt,{children:[t,e&&n.jsx(yt,{component:"span",variant:r?"inherit":"caption",color:"textSecondary",weight:"regular",children:e==="required"?"(required)":"(optional)"}),o&&n.jsx(jt,{children:o})]})}function Mt({InputProps:t,size:e="small",...o},r){const a=k.useIntl(),l=y.useImperativeIntl(a),[s,d]=b.useState(!1),c=()=>d(!s);return n.jsx(i.TextField,{...o,ref:r,type:s?"text":"password",size:e,InputProps:{...t,endAdornment:n.jsx(i.InputAdornment,{position:"end",children:n.jsx(i.IconButton,{size:e,onClick:c,children:n.jsx(i.Tooltip,{title:l.formatMessage({id:`c4r.form.${s?"hidePassword":"showPassword"}`}),children:s?n.jsx(T.VisibilityOffOutlined,{}):n.jsx(T.VisibilityOutlined,{})})})})}})}const It=b.forwardRef(Mt),O={};function Ct(t="$lodash$"){O[t]||(O[t]=0);const e=++O[t];return t==="$lodash$"?`${e}`:`${t}${e}`}const vt=i.styled(i.Select)(({theme:t})=>({"& .MuiInputAdornment-positionStart":{paddingLeft:t.spacing(2),"&.MuiInputAdornment-sizeSmall":{paddingLeft:t.spacing(1.5)}},"& .MuiInputBase-inputAdornedStart":{paddingLeft:"0px !important"},"& .MuiSelect-select .MuiMenuItem-root:hover":{backgroundColor:"transparent"},"&.MuiInputBase-root .MuiSelect-select.MuiSelect-multiple":{paddingRight:t.spacing(7)}})),Bt=i.styled(i.MenuItem)(()=>({display:"none"}));function At({children:t,placeholder:e,size:o="small",displayEmpty:r,menuProps:a,inputProps:l,labelId:s,label:d,labelSecondary:c,helperText:u,name:f,error:p,focused:g,disabled:x,fullWidth:h,required:j,"aria-label":m,...A},D){const C=o==="small",[M]=b.useState(()=>Ct("select-label-")),v=d?s??M:void 0;return n.jsxs(i.FormControl,{size:o,error:p,focused:g,disabled:x,fullWidth:h,required:j,children:[n.jsxs(i.Box,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[d&&n.jsx(i.InputLabel,{shrink:!0,id:v,children:d}),c&&n.jsx(i.Box,{display:"flex",alignItems:"center",ml:2,mb:.5,children:c})]}),n.jsxs(vt,{...A,labelId:v,name:f,ref:D,size:o,fullWidth:h,displayEmpty:r??!!e,inputProps:{...l,"aria-label":m},MenuProps:{...a,PopoverClasses:{paper:C?"MuiMenu-paper-sizeSmall":void 0},anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:0,horizontal:"left"}},children:[e&&n.jsx(Bt,{disabled:!0,value:"",children:n.jsx(y.Typography,{variant:C?"body2":"body1",color:"text.hint",component:"span",children:e})}),t]}),u&&n.jsx(i.FormHelperText,{"aria-label":`${f}-helper`,children:u})]})}const K=b.forwardRef(At),Dt=i.styled(i.ToggleButtonGroup,{shouldForwardProp:t=>t!=="variant"&&t!=="backgroundColor"})(({variant:t,backgroundColor:e,theme:o})=>({...t==="contained"&&{boxShadow:"none"},...t==="unbounded"&&{boxShadow:"none",borderRadius:o.spacing(.5),"& .MuiDivider-root":{height:o.spacing(4),"&.MuiToggleButtonGroup-groupedHorizontal":{height:o.spacing(4)},"&.MuiToggleButtonGroup-groupedVertical":{height:"auto",width:o.spacing(4),margin:`${o.spacing(.5,0,1)} !important`,borderRadius:"0 !important"}},"& .MuiToggleButton-sizeSmall":{margin:0,"&.MuiToggleButtonGroup-grouped:not(.MuiDivider-root)":{margin:0},"& + .MuiDivider-root.MuiToggleButtonGroup-groupedHorizontal":{height:o.spacing(3)},"& + .MuiDivider-root.MuiToggleButtonGroup-groupedVertical":{height:"auto",width:o.spacing(3)}},".MuiToggleButtonGroup-grouped:not(.MuiDivider-root)":{margin:0,"&:first-of-type":{marginLeft:0},"&:not(:last-of-type)":{marginRight:o.spacing(.5)}},"&.MuiToggleButtonGroup-horizontal:not(.MuiDivider-root)":{".MuiToggleButtonGroup-grouped":{margin:o.spacing(0,.5)}},"&.MuiToggleButtonGroup-vertical:not(.MuiDivider-root)":{".MuiToggleButtonGroup-grouped":{margin:o.spacing(0,0,.5),"&:not(:last-of-type)":{marginRight:0},"&:last-of-type":{marginBottom:0}}}},...e==="primary"&&{backgroundColor:o.palette.background.paper},...e==="secondary"&&{backgroundColor:o.palette.background.default},...e==="transparent"&&{backgroundColor:"transparent"}}));function St({children:t,variant:e="floating",backgroundColor:o,...r}){const l=e==="unbounded"?"transparent":"primary";return n.jsx(Dt,{...r,variant:e,backgroundColor:o??l,children:t})}const Tt=i.styled("div")(({theme:t})=>({position:"relative",display:"inline-flex","& + &, & + .optionIconButton":{marginLeft:t.spacing(.5)}})),kt=i.styled(i.IconButton,{shouldForwardProp:t=>!["active"].includes(t)})(({active:t,theme:e})=>({...t&&{color:e.palette.primary.main,backgroundColor:e.palette.primary.background,"& svg:not(.doNotFillIcon) path":{fill:e.palette.primary.main}}}));function wt({tooltip:t,tooltipPlacement:e="top",icon:o,size:r="medium",variant:a="icon",color:l="default",sx:s,className:d,loading:c,disabled:u,active:f,...p},g){return n.jsx(i.Tooltip,{placement:e,title:t??"",children:n.jsx(Tt,{className:`optionIconButton ${d??""}`,sx:s,"data-testid":"icon-button",children:n.jsx(kt,{...p,ref:g,size:r,variant:a,color:l,active:f,disabled:u||c,children:c?n.jsx(i.CircularProgress,{size:18,color:"inherit"}):o})})})}const Q=b.forwardRef(wt),Rt=i.styled(i.Menu,{shouldForwardProp:t=>!["extended","width","height"].includes(t)})(({theme:t,extended:e,width:o,height:r})=>({...e&&{".MuiMenuItem-root":{minHeight:t.spacing(6)}},...o&&{".MuiList-root":{width:o,minWidth:o}},...r&&{".MuiMenu-paper":{overflow:"hidden"},".MuiList-root":{maxHeight:r}}}));function Ft(t){return n.jsx(Rt,{...t})}const Ot=i.styled(i.MenuList,{shouldForwardProp:t=>!["extended","width","height"].includes(t)})(({theme:t,extended:e,width:o,height:r})=>({...e&&{".MuiMenuItem-root":{minHeight:t.spacing(6)}},"&.MuiList-root":{...o&&{width:o,minWidth:o},...r&&{maxHeight:r}}}));function $t(t){return n.jsx(Ot,{...t})}const Lt=i.styled(W.MenuItem)(()=>({marginTop:"0 !important"})),Pt=i.styled(i.Link)(({disabled:t,theme:e})=>({display:"flex",alignItems:"center",gap:e.spacing(1),width:"100%",textAlign:"initial",...t&&{pointerEvents:"none",color:e.palette.text.disabled}}));function _({areAllSelected:t,areAnySelected:e,selectAll:o,selectAllDisabled:r}){const a=k.useIntl(),l=y.useImperativeIntl(a);return n.jsx(Lt,{fixed:!0,children:n.jsxs(Pt,{variant:"body2",color:"textPrimary",component:"button",underline:"none",disabled:!!r,onClick:o,tabIndex:0,children:[n.jsx(i.Checkbox,{checked:t,indeterminate:e&&!t,disabled:r}),l.formatMessage({id:"c4r.form.selectAll"})]})})}function Et({selectedOptions:t,options:e,onChange:o}){const[r,a]=b.useState(t??[]),l=e.length===r.length,s=r.length>0;return b.useEffect(()=>{r!==t&&a(r)},[t]),{areAllSelected:l,areAnySelected:s,currentOptions:r,handleChange:f=>{const{target:{value:p}}=f,g=typeof p=="string"?p.split(","):p.filter(x=>x!==void 0);a(g),o(g)},selectAll:()=>{const f=e==null?void 0:e.filter(({disabled:p})=>!p).map(({value:p})=>p);f&&(f.every(g=>r.includes(g))?(a([]),o([])):(a(f),o(f)))},unselectAll:()=>{a([]),o([])}}}const Wt=i.styled(i.MenuItem)(({theme:t})=>({"&.Mui-disabled":{pointerEvents:"auto","&:hover":{backgroundColor:`${t.palette.background.default} !important`}}})),Ht=i.styled(i.InputAdornment,{shouldForwardProp:t=>t!=="size"})(({theme:t,size:e})=>({display:"none",position:"absolute",top:t.spacing(2),right:t.spacing(3.5),".MuiInputBase-root:hover &, .MuiInputBase-root.Mui-focused &":{display:"flex"},".MuiSvgIcon-root":{color:t.palette.text.hint},...e==="medium"&&{top:t.spacing(3),right:t.spacing(5)}})),_t=[],Nt=()=>{};function qt({options:t=_t,selectedOptions:e,size:o="small",placeholder:r,showCounter:a,showFilters:l=!0,onChange:s=Nt,selectAllDisabled:d,tooltipPlacement:c,variant:u,...f},p){const{areAllSelected:g,areAnySelected:x,currentOptions:h,handleChange:j,selectAll:m,unselectAll:A}=Et({options:t,selectedOptions:e,onChange:s}),D=o==="small",C=D||u==="standard"?0:2,M=k.useIntl(),v=y.useImperativeIntl(M),B=`${h.length} ${v.formatMessage({id:"c4r.form.selected"})}`,w=b.useMemo(()=>g?n.jsx(y.Typography,{component:"span",variant:D?"body2":"body1",color:"textPrimary",ml:C,children:v.formatMessage({id:"c4r.form.allSelected"})}):x?n.jsx(y.Typography,{component:"span",variant:D?"body2":"body1",color:"textPrimary",ml:C,children:a&&h.length>1?B:h.join(", ")}):n.jsx(y.Typography,{component:"span",variant:D?"body2":"body1",color:"text.hint",ml:C,children:r??v.formatMessage({id:"c4r.form.noneSelected"})}),[g,x,B,h,v,D,C,r,a]);return n.jsxs(K,{...f,ref:p,multiple:!0,displayEmpty:!0,placeholder:r,value:h,renderValue:()=>w,onChange:j,size:o,variant:u,endAdornment:l&&x&&n.jsx(Ht,{position:"end",size:o,children:n.jsx(i.IconButton,{onClick:A,size:o,children:n.jsx(T.Cancel,{})})}),menuProps:{PaperProps:{sx:{".MuiList-root":{paddingTop:0}}}},children:[l&&n.jsx(_,{areAllSelected:g,areAnySelected:x,selectAll:m,selectAllDisabled:d}),t==null?void 0:t.map(I=>{const S=n.jsxs(Wt,{value:I.value,disabled:I.disabled,tabIndex:0,children:[n.jsx(i.Checkbox,{disabled:I.disabled,checked:h.includes(I.value)}),n.jsx(i.ListItemText,{primary:I.label})]},I.value);return I.tooltip?n.jsx(i.Tooltip,{title:I.tooltip,placement:c,children:S},I.value):S})]})}const Gt=b.forwardRef(qt),Vt=i.styled(i.TextField,{shouldForwardProp:t=>t!=="cursor"})(({cursor:t,theme:e})=>({"&.MuiTextField-root .MuiInputBase-root":{cursor:t,paddingRight:e.spacing(1),"& input":{cursor:t},"&.Mui-disabled":{pointerEvents:"none","& .MuiButtonBase-root":{color:e.palette.text.disabled}},"&.MuiInputBase-sizeSmall":{paddingRight:e.spacing(.5)}},"& .MuiFormLabel-root":{cursor:t,"&.Mui-disabled":{pointerEvents:"none"}}}));function Ut({buttonText:t,hasFiles:e,size:o,error:r,disabled:a,handleReset:l,handleOpen:s,inProgress:d}){return n.jsx(i.InputAdornment,{position:"end",children:d?n.jsx(i.IconButton,{"aria-label":"loading",disabled:!0,size:o,children:n.jsx(i.CircularProgress,{size:18})}):e?n.jsx(i.IconButton,{onClick:l,size:o,"aria-label":"delete",disabled:a,children:n.jsx(T.Cancel,{})}):n.jsx(i.Button,{onClick:s,size:o,variant:"text",color:r?"default":"primary",disabled:a,children:t})})}function tt({name:t,multiple:e,handleReset:o,handleOpen:r,dragOver:a,error:l,placeholder:s,focused:d,buttonText:c="Browse",inProgress:u,InputProps:f,size:p="small",hasFiles:g,cursor:x="pointer",...h}){return n.jsx(Vt,{...h,size:p,error:l,placeholder:s,focused:d??a,cursor:x,InputProps:{...f,name:t,readOnly:!0,endAdornment:n.jsx(Ut,{buttonText:c,hasFiles:g,size:p,error:l,disabled:!!a,handleReset:o,handleOpen:r,inProgress:u})}})}function zt({onChange:t,files:e,multiple:o,placeholder:r,uploadInputRef:a}){const l=k.useIntl(),s=y.useImperativeIntl(l),[d,c]=b.useState(""),[u,f]=b.useState(!1);b.useEffect(()=>{!e||e.length===0?c(""):e.length===1?c(e[0].name):c(s.formatMessage({id:"c4r.form.filesSelected"},{count:e.length}))},[e,s]);const p=()=>{var M;(M=a.current)==null||M.click()},g=M=>{M.preventDefault(),f(!0)},x=M=>{M.preventDefault(),f(!1)},h=M=>{M.preventDefault(),f(!1);const v=M.dataTransfer.items,B=j(v);t==null||t(B)},j=M=>{const v=[];for(const B of Array.from(M))if(B.kind==="file"){const w=B.getAsFile();v.push(w)}return v},m=M=>{const v=Array.from(M.target.files);t==null||t(v)},A=M=>{M.stopPropagation(),c("")},D=b.useMemo(()=>{const M=s.formatMessage({id:"c4r.form.dragPlaceholder"},{count:o?0:1}),v=s.formatMessage({id:"c4r.form.dragActivePlaceholder"},{count:o?0:1});let B="";return u?B=v:B=r??M,B},[u,o,r,s]);return{filesText:d,getPlaceholder:D,dragOver:u,inputEvents:{onDragOver:g,onDragLeave:x,onDrop:h,onClick:p},handleFiles:m,handleReset:A}}const Zt=["application/JSON"];function Yt({name:t,buttonText:e,accept:o,files:r,inProgress:a,onChange:l,multiple:s,placeholder:d,error:c,focused:u,nativeInputProps:f,...p}){const g=o??Zt,x=b.useRef(null),{filesText:h,getPlaceholder:j,dragOver:m,inputEvents:A,handleFiles:D,handleReset:C}=zt({uploadInputRef:x,files:r,onChange:l,multiple:s,placeholder:d});return n.jsxs(n.Fragment,{children:[n.jsx(tt,{...p,placeholder:j,value:h,error:c,focused:u??m,handleReset:C,dragOver:m,inProgress:a,hasFiles:!!h,InputProps:A,buttonText:e}),n.jsx("input",{...f,ref:x,style:{display:"none"},type:"file","aria-label":t,name:t,accept:String(g),multiple:s,onChange:D})]})}function Jt({disabled:t,loading:e,...o},r){return n.jsx(i.Autocomplete,{...o,ref:r,disabled:t||e,popupIcon:e?n.jsx(i.CircularProgress,{size:18,color:"inherit"}):n.jsx(H.ArrowDown,{})})}const Xt=b.forwardRef(Jt),et=t=>t&&typeof t=="object"?t.title??String(t):String(t),nt=(t,e)=>typeof t!="object"||t===null?{value:t,multiple:e}:{...t,multiple:e};function ot(){return{renderOption:(e,o,r,a,l)=>{const{title:s,inputValue:d,divider:c,fixed:u,extended:f,dense:p,destructive:g,disabled:x,subtitle:h,iconColor:j,startAdornment:m,endAdornment:A,alternativeTitle:D,secondaryText:C,multiple:M}=o,{key:v,...B}=e,w=typeof o=="string"||typeof o=="number",I=(S,R,U,z)=>U||z||(R&&typeof R=="object"&&"value"in R?String(R.value):S(R));return n.jsx(b.Fragment,{children:c?n.jsx(i.Divider,{}):n.jsxs(n.Fragment,{children:[d&&n.jsx(i.Divider,{}),n.jsxs(W.MenuItem,{...B,...!w&&{fixed:u,extended:f,dense:p,destructive:g,disabled:x,subtitle:h,iconColor:j},children:[!h&&(m||M||l)&&n.jsxs(i.ListItemIcon,{children:[l||M&&n.jsx(i.Checkbox,{checked:r.selected}),m]}),n.jsxs(i.ListItemText,{children:[I(a??et,o,D,s),C&&n.jsx(y.Typography,{component:"p",variant:"caption",color:"text.secondary",children:C})]}),A]})]})},v)}}}function Kt({getOptionLabel:t,newItemLabel:e,newItemIcon:o,multiple:r}){const a=k.useIntl(),l=y.useImperativeIntl(a),s=i.createFilterOptions(),{renderOption:d}=ot();return{creatableFilterOptions:(p,g)=>{const x=s(p,g),{inputValue:h}=g,j=p.some(m=>h===t(m));if(h.length>1&&h!==""&&!j){let m;typeof e=="function"?m=e(h):e?m=`${e} "${h}"`:m=`${l.formatMessage({id:"c4r.form.add"})} "${h}"`,x.push({inputValue:h,title:m})}return x},creatableOptionLabel:p=>typeof p=="string"?p:p.inputValue?p.inputValue:t(p),creatableRenderOption:(p,g,x)=>{const h=g.inputValue?o??n.jsx(T.AddCircleOutlineOutlined,{}):void 0,j=nt(g,!!r);return d(p,j,x,t,h)}}}function it({options:t,value:e,onChange:o,getOptionLabel:r}){const[a,l]=b.useState(Array.isArray(e)?e:e?[e]:[]),{renderOption:s}=ot();b.useEffect(()=>{const g=Array.isArray(e)?e:e?[e]:[];l(g)},[e]);const d=a.length===t.length,c=a.length>0&&a.length<t.length;return{multipleValue:a,allSelected:d,someSelected:c,handleSelectAll:()=>{l(d?[]:[...t])},handleChange:(g,x)=>{l(x===null?[]:x),o==null||o(g,x,"selectOption")},multipleRenderOption:(g,x,h)=>{const j=nt(x,!0);return s(g,j,h,r)}}}function Qt({children:t,showFilters:e,allSelected:o,someSelected:r,handleSelectAll:a=()=>{},...l},s){return n.jsxs("ul",{ref:s,...l,children:[e&&n.jsx(_,{areAllSelected:!!o,areAnySelected:!!r,selectAll:a}),t]})}const rt=b.forwardRef(Qt);function te({newItemLabel:t,newItemIcon:e,getOptionLabel:o=et,multiple:r,disableCloseOnSelect:a,disabled:l,loading:s,showFilters:d,options:c=[],value:u,onChange:f,...p},g){const{freeSolo:x=!0,...h}=p,{multipleValue:j,allSelected:m,someSelected:A,handleSelectAll:D,handleChange:C}=it({options:c,value:u,onChange:f}),{creatableFilterOptions:M,creatableOptionLabel:v,creatableRenderOption:B}=Kt({getOptionLabel:o,newItemLabel:t,newItemIcon:e,multiple:r});return n.jsx(i.Autocomplete,{...h,ref:g,options:c,value:r?j:u,onChange:C,filterOptions:M,getOptionLabel:v,renderOption:B,freeSolo:x,forcePopupIcon:!0,multiple:r,disableCloseOnSelect:a||r,ListboxComponent:r?rt:void 0,ListboxProps:r?{showFilters:d,allSelected:m,someSelected:A,handleSelectAll:D}:void 0,disabled:l||s,popupIcon:s?n.jsx(i.CircularProgress,{size:18,color:"inherit"}):n.jsx(H.ArrowDown,{})})}const ee=b.forwardRef(te);function ne({renderOption:t,disableCloseOnSelect:e=!0,disabled:o,loading:r,showFilters:a,options:l,value:s,onChange:d,getOptionLabel:c,...u},f){const{multipleValue:p,allSelected:g,someSelected:x,handleSelectAll:h,handleChange:j,multipleRenderOption:m}=it({options:l,value:s,onChange:d,getOptionLabel:c});return n.jsx(i.Autocomplete,{...u,ref:f,options:l,value:p,onChange:j,getOptionLabel:c,renderOption:t??m,ListboxComponent:rt,ListboxProps:{showFilters:a,allSelected:g,someSelected:x,handleSelectAll:h},multiple:!0,disableCloseOnSelect:e,disabled:o||r,popupIcon:r?n.jsx(i.CircularProgress,{size:18,color:"inherit"}):n.jsx(H.ArrowDown,{})})}const oe=b.forwardRef(ne),ie=i.styled("div",{shouldForwardProp:t=>t!=="variant"})(({variant:t,theme:e})=>({width:"100%",borderRadius:e.spacing(.5),...t==="outlined"&&{backgroundColor:e.palette.background.paper,boxShadow:`inset 0 0 0 1px ${e.palette.divider}`}}));function re({variant:t="standard",items:e,...o}){return n.jsx(ie,{...o,variant:t,children:e.map((r,a)=>n.jsxs(i.Accordion,{disabled:r.disabled,defaultExpanded:r.defaultExpanded,onChange:r.onChange,children:[n.jsx(i.AccordionSummary,{"aria-controls":`${a}-content`,id:`${a}-header`,children:r.summary}),n.jsx(i.AccordionDetails,{children:r.content})]},a))})}const Z={large:5,medium:4,small:3,xsmall:2.25},ae=i.styled(i.Avatar,{shouldForwardProp:t=>t!=="size"&&t!=="disabled"})(({theme:t,size:e="medium",disabled:o=!1})=>({width:t.spacing(Z[e]),height:t.spacing(Z[e]),...t.typography.subtitle1,...e==="large"&&{...t.typography.h6},...e==="small"&&{...t.typography.caption,fontWeight:500},...e==="xsmall"&&{...t.typography.caption,fontWeight:500,svg:{width:y.ICON_SIZE_SMALL,height:y.ICON_SIZE_SMALL}},...o&&{opacity:.6}}));function le(t){return n.jsx(ae,{...t})}const at=480,se=i.styled(i.Snackbar)(({theme:t})=>({bottom:t.spacing(2),right:t.spacing(2),left:t.spacing(2),[t.breakpoints.up("sm")]:{bottom:t.spacing(4),right:"auto",left:"50%",width:"100%",maxWidth:`${at}px`}})),ce=i.styled(i.Box,{shouldForwardProp:t=>t!=="autoWidth"})(({autoWidth:t,theme:e})=>({minWidth:"100%",maxWidth:`${at}px`,margin:e.spacing(0,1),...t&&{minWidth:"auto"},[e.breakpoints.up("sm")]:{minWidth:e.spacing(40),...t&&{minWidth:"auto"}}})),de=i.styled(E.Alert,{shouldForwardProp:t=>!["hasActions","closeable"].includes(t)})(({hasActions:t,closeable:e,icon:o,theme:r})=>({position:"relative",display:"flex",flexWrap:"wrap",columnGap:r.spacing(1),rowGap:r.spacing(.25),padding:r.spacing(1),paddingLeft:r.spacing(2),color:r.palette.common.white,backgroundColor:r.palette.common.black,".MuiAlert-message":{padding:r.spacing(.75,0)},".MuiAlert-message .MuiTypography-root, .MuiAlert-icon":{color:r.palette.common.white},".MuiAlert-message .MuiTypography-root:not(.MuiAlertTitle-root)":{...r.typography.body2},".MuiAlert-message .MuiCircularProgress-circle":{color:r.palette.common.white},".MuiAlert-icon":{position:"absolute",top:r.spacing(1),left:r.spacing(1.5),display:"flex",alignItems:"center",justifyContent:"center",width:r.spacing(3),marginTop:r.spacing(.5)},"&.MuiAlert-standardError":{backgroundColor:r.palette.error.main},...o!==!1&&{paddingLeft:r.spacing(5.5)},...e&&{paddingRight:r.spacing(6)},...!e&&!t&&{paddingRight:r.spacing(1.5)},...t&&{".MuiAlert-message":{minWidth:"fit-content",padding:r.spacing(.75,0)}}})),ue=i.styled(i.Box)(({theme:t})=>({position:"absolute",top:t.spacing(1),right:t.spacing(1),"& button:hover, & button:focus-visible":{backgroundColor:t.palette.white[8]},svg:{color:t.palette.white[60]}}));function pe({severity:t="neutral",autoHideDuration:e=y.NOTIFICATION_DURATION_IN_MS,closeable:o=!0,children:r,title:a,action:l,open:s,onClose:d=()=>{},autoWidth:c,icon:u,...f}){const p=k.useIntl(),g=y.useImperativeIntl(p),h=u===!1||t==="neutral"&&!u,m=e===null?null:e||y.NOTIFICATION_DURATION_IN_MS;return n.jsx(i.Portal,{children:n.jsx(se,{...f,open:s,autoHideDuration:m,onClose:d,TransitionComponent:c?i.Fade:i.Slide,"data-auto-width":c,children:n.jsxs(ce,{sx:{position:"relative"},autoWidth:c,children:[n.jsx(de,{severity:t,action:l,icon:h?!1:u,elevation:6,hasActions:!!l,closeable:o,title:a,children:r}),o&&n.jsx(ue,{children:n.jsx(Q,{color:"default",onClick:A=>d(A,"timeout"),icon:n.jsx(T.CloseOutlined,{}),tooltip:g.formatMessage({id:"c4r.button.close"})})})]})})})}const ge=i.styled("div")(({theme:t})=>({display:"flex",alignItems:"center",height:y.APPBAR_SIZE,marginRight:t.spacing(1.5)})),xe=i.styled(i.IconButton)(({theme:t})=>({marginRight:t.spacing(1),"&.MuiButtonBase-root svg path":{fill:t.palette.brand.appBarContrastText}})),fe=i.styled(i.Divider)(({theme:t})=>({borderColor:i.alpha(t.palette.brand.appBarContrastText,.12)}));function he({onClickMenu:t}){return n.jsx(i.Box,{sx:{display:{md:"none",xs:"block"}},children:n.jsxs(ge,{children:[n.jsx(xe,{onClick:t,children:n.jsx(T.MenuOutlined,{})}),n.jsx(fe,{orientation:"vertical",flexItem:!0})]})})}const me=i.styled("div")(({theme:t})=>({display:"flex",marginRight:t.spacing(1.5),"& a":{display:"flex"},"& svg, & img":{width:t.spacing(4),height:t.spacing(4)}}));function be({logo:t}){return n.jsx(me,{children:t})}const ye=i.styled(y.Typography)({display:"flex",alignItems:"center",whiteSpace:"nowrap"});function je({text:t}){const e=i.useTheme();return n.jsx(ye,{component:"span",variant:"subtitle1",color:e.palette.brand.appBarContrastText,children:t})}const Me=i.styled(y.Typography)(({theme:t})=>({display:"flex",alignItems:"center","&::before":{content:'"/"',margin:t.spacing(0,1),opacity:.6,color:t.palette.brand.appBarContrastText}}));function Ie({text:t}){const e=i.useTheme();return n.jsx(Me,{component:"span",variant:"body2",weight:"strong",color:e.palette.brand.appBarContrastText,children:t})}const Ce=i.styled(i.AppBar)(({theme:t})=>({backgroundColor:t.palette.brand.appBarMain,"& .MuiTypography-root":{color:t.palette.brand.appBarContrastText},"& .MuiIconButton-root path":{fill:t.palette.brand.appBarContrastText}})),ve=i.styled("div")(({theme:t})=>({display:"flex",alignItems:"center",maxWidth:"calc(100% - 300px)",overflow:"hidden",[t.breakpoints.down("sm")]:{minWidth:"192px"}})),Be=i.styled("div")(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"space-between",flex:1,marginLeft:t.spacing(1)}));function Ae({children:t,brandLogo:e,brandText:o,secondaryText:r,showBurgerMenu:a=!1,onClickMenu:l,...s}){return n.jsx(Ce,{...s,children:n.jsxs(i.Toolbar,{children:[n.jsxs(ve,{children:[a&&n.jsx(he,{onClickMenu:l}),e&&n.jsx(be,{logo:e}),o&&n.jsx(je,{text:o}),r&&n.jsx(Ie,{text:r})]}),n.jsx(Be,{children:t})]})})}const De=i.styled(i.Box,{shouldForwardProp:t=>!["size","variant"].includes(t)})(({size:t,variant:e,theme:o})=>({position:"absolute",right:o.spacing(5.75),...t==="small"&&{right:o.spacing(4),top:"3px"},...e==="standard"&&{right:o.spacing(4.75),...t==="small"&&{right:o.spacing(3.5)}}}));function N({size:t,variant:e,...o}){const r=k.useIntl(),a=y.useImperativeIntl(r);return n.jsx(De,{size:t,variant:e,children:n.jsx(i.IconButton,{...o,size:t,"aria-label":a.formatMessage({id:"c4r.form.clearSelection"})})})}const Se=i.styled(i.Box,{shouldForwardProp:t=>!["size","variant","readOnly"].includes(t)})(({size:t,variant:e,readOnly:o,theme:r})=>({".MuiInputBase-root":{"& .clearButton svg":{color:r.palette.text.hint},...t==="small"&&{paddingRight:`${r.spacing(1)} !important`},...t==="medium"&&{"& .MuiInputAdornment-root":{"& .MuiIconButton-edgeEnd":{marginRight:r.spacing(-1)}}},...e==="standard"&&{paddingRight:`${r.spacing(1)} !important`,...t==="small"&&{paddingRight:`${r.spacing(.5)} !important`}},...o&&{"& .MuiInputAdornment-root":{"& svg":{color:r.palette.text.disabled}}}}}));function q({children:t,size:e,variant:o,readOnly:r,...a}){return n.jsx(Se,{...a,size:e,variant:o,readOnly:r,children:t})}function $({handleClear:t,variant:e="outlined",size:o="small",label:r,labelHelpTooltip:a,type:l,helperText:s,placeholder:d,slotProps:c,slots:u,error:f,showCalendar:p=!0,readOnly:g,...x}){const h=k.useIntl(),j=y.useImperativeIntl(h);return n.jsx(i.Box,{className:"CartoDatePicker-root","data-testid":"date-picker",children:n.jsx(q,{size:o,variant:e,readOnly:g,children:n.jsx(ct.DatePicker,{...x,label:r&&n.jsx(F,{label:r,type:l,icon:a&&n.jsx(i.Tooltip,{title:a,children:n.jsx(T.HelpOutline,{htmlColor:"text.secondary"})})}),slotProps:{textField:{variant:e,helperText:s,placeholder:d,size:o,error:f??void 0,inputProps:{"data-testid":"date-picker-input"}},field:{clearable:!!t,onClear:t},...c},slots:{clearButton:m=>n.jsx(N,{...m,size:o,variant:e}),openPickerButton:m=>n.jsx(i.IconButton,{...m,size:o,"aria-label":j.formatMessage({id:"c4r.form.chooseDate"})}),...u},disableOpenPicker:!p,readOnly:g})})})}const Te=i.styled(i.Box,{shouldForwardProp:t=>!["isSelected","isStartDate","isEndDate","isSelectedMonth","isLastDay","isFirstDay"].includes(t)})(({theme:t,isSelected:e,isStartDate:o,isEndDate:r,isSelectedMonth:a,isLastDay:l,isFirstDay:s})=>({position:"relative",margin:t.spacing(.25),"& .MuiPickersDay-root":{margin:0},...e&&a&&{"&::before":{content:'""',position:"absolute",top:0,right:"-2px",bottom:0,left:"-2px",backgroundColor:t.palette.primary.background,...(o||s)&&{left:0,borderRadius:`${t.shape.borderRadius}px 0 0 ${t.shape.borderRadius}px`},...(r||l)&&{right:0,borderRadius:`0 ${t.shape.borderRadius}px ${t.shape.borderRadius}px 0`}},"&:first-of-type::before":{left:0,borderRadius:`${t.shape.borderRadius}px 0 0 ${t.shape.borderRadius}px`},"&:last-of-type::before":{right:0,borderRadius:`0 ${t.shape.borderRadius}px ${t.shape.borderRadius}px 0`},...s&&{"&:last-of-type::before":{left:0,right:0,borderRadius:t.shape.borderRadius}},...l&&{"&:first-of-type::before":{left:0,right:0,borderRadius:t.shape.borderRadius}},"& .MuiPickersDay-today":{borderColor:`${t.palette.default.outlinedBorder} !important`,...(o||r)&&{boxShadow:`0 0 0 1px inset ${t.palette.background.paper}`}},"&::after":{content:'""',position:"absolute",top:0,right:0,bottom:0,left:0,backgroundColor:t.palette.background.paper,borderRadius:t.shape.borderRadius,transition:"background-color 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms"},"&:hover::after":{backgroundColor:t.palette.primary.relatedLight}}})),ke=i.styled(dt.PickersDay,{shouldForwardProp:t=>t!=="isDateRangeLimit"})(({theme:t,isDateRangeLimit:e})=>({"&.MuiPickersDay-root":{position:"relative",zIndex:1,"&.Mui-selected":{color:t.palette.text.primary},...e&&{"&.Mui-selected":{backgroundColor:`${t.palette.primary.main} !important`,color:t.palette.primary.contrastText,"&:hover":{backgroundColor:`${t.palette.primary.dark} !important`}}}}}));function Y({day:t,startDate:e,endDate:o,selectedMonth:r,...a}){const l=!!(e&&t.getTime()===e.getTime()),s=!!(o&&t.getTime()===o.getTime()),d=!!(e&&o&&t>=e&&t<=o),c=t.getDate()===1,u=t.getDate()===new Date(t.getFullYear(),t.getMonth()+1,0).getDate(),f=!!(r&&t.getMonth()==r.getMonth());return n.jsx(Te,{isSelected:d,isStartDate:l,isEndDate:s,isSelectedMonth:f,isLastDay:u,isFirstDay:c,children:n.jsx(ke,{...a,day:t,selected:d||l||s,isDateRangeLimit:l||s})})}const we=i.styled(i.Box,{shouldForwardProp:t=>!["variant"].includes(t)})(({variant:t,theme:e})=>({display:"flex",gap:t==="standard"?e.spacing(1):"1px","& .CartoDatePicker-root":{"&:first-of-type":{".MuiInputBase-root":{borderRadius:e.spacing(.5,0,0,.5),boxShadow:`1px 0 0 0 ${e.palette.default.outlinedBorder}`,...t==="outlined"&&{"&:not(:hover):not(.Mui-focused):not(.Mui-error) .MuiOutlinedInput-notchedOutline":{borderRightColor:"transparent"}},...t==="filled"&&{"&::before, &::after":{borderRadius:e.spacing(.5,0,0,.5)}},...t==="standard"&&{boxShadow:"none",borderRadius:0}}},"&:last-of-type":{".MuiInputBase-root":{borderRadius:e.spacing(0,.5,.5,0),...t==="outlined"&&{"&:not(:hover):not(.Mui-focused):not(.Mui-error) .MuiOutlinedInput-notchedOutline":{borderLeftColor:"transparent"}},...t==="filled"&&{"&::before, &::after":{borderRadius:e.spacing(0,.5,.5,0)}},...t==="standard"&&{borderRadius:0}}}}}));function Re({globalHelperText:t,error:e,variant:o="outlined",startProps:r,endProps:a,...l}){const s=k.useIntl(),d=y.useImperativeIntl(s),[c,u]=b.useState(!1),[f,p]=b.useState(!1),[g,x]=b.useState(null),[h,j]=b.useState(null),[m,A]=b.useState(new Date),D=e??(r==null?void 0:r.error)??(a==null?void 0:a.error),C=(I,S)=>{x(I),r!=null&&r.onChange&&r.onChange(I,S),I&&S.validationError===null&&!f&&S.trigger===null&&(p(!1),u(!0))},M=(I,S)=>{j(I),a!=null&&a.onChange&&a.onChange(I,S)},v=()=>{p(!0),u(!1),setTimeout(()=>{A(g??new Date)},120)},B=()=>{p(!1),u(!0),setTimeout(()=>{A(h??g??new Date)},120)},w=()=>{p(!1),u(!0),setTimeout(()=>{A(h??g??new Date)},120)};return n.jsxs(i.Box,{children:[n.jsxs(we,{variant:o,children:[n.jsx($,{...l,...r,value:(r==null?void 0:r.value)??g,maxDate:h??void 0,label:(r==null?void 0:r.label)??d.formatMessage({id:"c4r.form.startDate"}),slotProps:{popper:{placement:"bottom-start","aria-label":d.formatMessage({id:"c4r.form.startDateCalendar"})},...r==null?void 0:r.slotProps},slots:{openPickerIcon:T.TodayOutlined,day:I=>n.jsx(Y,{...I,startDate:g,endDate:h,selectedMonth:m}),...r==null?void 0:r.slots},error:(r==null?void 0:r.error)??e,open:f,onChange:C,onOpen:v,onClose:B,onMonthChange:I=>A(I),variant:o}),n.jsx($,{...l,...a,value:(a==null?void 0:a.value)??h,minDate:g??void 0,slotProps:{popper:{"aria-label":d.formatMessage({id:"c4r.form.endDateCalendar"})},...a==null?void 0:a.slotProps},slots:{day:I=>n.jsx(Y,{...I,startDate:g,endDate:h,selectedMonth:m}),...a==null?void 0:a.slots},label:(a==null?void 0:a.label)??d.formatMessage({id:"c4r.form.endDate"}),error:(a==null?void 0:a.error)??e,open:c,onOpen:w,onClose:()=>u(!1),onChange:M,onMonthChange:I=>A(I),variant:o})]}),t&&n.jsx(i.FormHelperText,{error:D,children:t})]})}const lt=(t,e,o,r)=>{const a=t==null?void 0:t.includes("hours"),l=t==null?void 0:t.includes("seconds"),s=t==null?void 0:t.includes("minutes"),d=(t==null?void 0:t.length)===1&&t[0]==="hours";if(r)return r;const c=[];return e&&c.push("MM/dd/yyyy "),a&&c.push(o?"hh":"HH"),d||c.push(":"),s&&c.push("mm"),l&&c.push(":ss"),o&&c.push(" a"),c.join("")};function Fe({handleClear:t,variant:e="outlined",size:o="small",label:r,labelHelpTooltip:a,type:l,helperText:s,placeholder:d,error:c,showClock:u=!0,readOnly:f,slotProps:p,slots:g,ampm:x=!0,views:h=["hours","minutes"],format:j,...m}){const A=k.useIntl(),D=y.useImperativeIntl(A),C=b.useRef(null),[M,v]=b.useState(0);return b.useEffect(()=>{if(!C.current)return;const B=new ResizeObserver(w=>{var S;const I=(S=w[0])==null?void 0:S.contentRect.width;I&&v(I)});return B.observe(C.current),()=>{B.disconnect()}},[]),n.jsx(q,{size:o,variant:e,readOnly:f,"data-testid":"time-picker",children:n.jsx(ut.TimePicker,{...m,ref:C,label:n.jsx(F,{label:r??D.formatMessage({id:"c4r.form.time"}),type:l,icon:a&&n.jsx(i.Tooltip,{title:a,children:n.jsx(T.HelpOutline,{htmlColor:"text.secondary"})})}),views:["hours"],format:lt(h,!1,x,j),slotProps:{textField:{variant:e,helperText:s,placeholder:d,size:o,error:c??void 0,inputProps:{"data-testid":"time-picker-input"}},field:{clearable:!!t,onClear:t},popper:{placement:"bottom-end"},layout:{sx:{width:M}},...p},slots:{clearButton:B=>n.jsx(N,{...B,size:o,variant:e}),openPickerButton:B=>n.jsx(i.IconButton,{...B,size:o,"aria-label":D.formatMessage({id:"c4r.form.chooseDate"})}),...g},disableOpenPicker:!u,readOnly:f,ampm:x})})}function Oe({handleClear:t,variant:e="outlined",size:o="small",label:r,labelHelpTooltip:a,type:l,helperText:s,placeholder:d,error:c,showCalendar:u=!0,readOnly:f,slotProps:p,slots:g,ampm:x=!0,views:h=["hours","minutes"],format:j,...m}){const A=k.useIntl(),D=y.useImperativeIntl(A);return n.jsx(q,{size:o,variant:e,readOnly:f,"data-testid":"date-time-picker",children:n.jsx(pt.DateTimePicker,{...m,label:n.jsx(F,{label:r??D.formatMessage({id:"c4r.form.time"}),type:l,icon:a&&n.jsx(i.Tooltip,{title:a,children:n.jsx(T.HelpOutline,{htmlColor:"text.secondary"})})}),views:["year","month","day","hours"],format:lt(h,!0,x,j),slotProps:{textField:{variant:e,helperText:s,placeholder:d,size:o,error:c??void 0,inputProps:{"data-testid":"date-time-picker-input"}},field:{clearable:!!t,onClear:t},...p},slots:{clearButton:C=>n.jsx(N,{...C,size:o,variant:e}),openPickerButton:C=>n.jsx(i.IconButton,{...C,size:o,"aria-label":D.formatMessage({id:"c4r.form.chooseDate"})}),...g},disableOpenPicker:!u,readOnly:f,ampm:x})})}const $e=[{outlinedBullet:!1,value:""}],Le=i.styled("ul")(({theme:t})=>({listStyle:"none",paddingLeft:0,margin:t.spacing(.5,0,0,0)})),Pe=i.styled("li")(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"space-between","&:not(:last-child)":{marginBottom:t.spacing(.5)}})),Ee=i.styled("span")(({theme:t})=>({width:t.spacing(1),height:t.spacing(1),marginRight:t.spacing(.5),border:`2px solid ${t.palette.qualitative.bold[1]}`,borderRadius:"50%",backgroundColor:t.palette.qualitative.bold[1]})),We=i.styled(y.Typography)(({theme:t})=>({minWidth:t.spacing(10),marginRight:t.spacing(1.5)}));function He({items:t=$e,title:e}){return n.jsxs(n.Fragment,{children:[e&&n.jsx(y.Typography,{color:"inherit",variant:"caption",weight:"medium",children:e}),n.jsx(Le,{children:t.map((o,r)=>n.jsxs(Pe,{children:[n.jsx(Ee,{style:{backgroundColor:`${o.outlinedBullet?"transparent":o.color}`,borderColor:o.color}}),o.category&&n.jsx(We,{color:"inherit",variant:"caption",children:o.category}),n.jsx(y.Typography,{color:"inherit",variant:"caption",weight:"medium",children:o.value})]},r))})]})}const J={small:"480px",medium:"640px",large:"640px",xlarge:"720px"},L={small:{width:"432px",maxWidth:"432px"},medium:{width:"592px",maxWidth:"592px"},large:{width:"768px",maxWidth:"768px",minHeight:"576px"},xlarge:{width:"calc(100vw - 80px)",height:"calc(100vh - 80px)",maxWidth:"960px"}},P=i.styled(i.Paper,{shouldForwardProp:t=>!["fullScreen","height","width","hasForm"].includes(t)})(({fullScreen:t,height:e,width:o,hasForm:r,size:a="small",theme:l})=>({"&.MuiPaper-root":{position:"relative",display:"flex",flexDirection:"column",margin:l.spacing(5),borderRadius:l.spacing(1),...L[a],maxHeight:J[a],[`@media (max-height:${J[a]})`]:{maxHeight:"calc(100vh - 80px)",...a==="large"&&{minHeight:e!=="auto"?"calc(100vh - 80px)":"auto"}},...t&&{width:"100vw",maxWidth:`calc(100vw - ${l.spacing(10)})`,height:"100vh",maxHeight:`calc(100vh - ${l.spacing(10)})`,margin:l.spacing(5),borderRadius:l.spacing(1)},...e&&{height:e,minHeight:e},...o&&{width:o},[l.breakpoints.down("sm")]:{position:"absolute",width:"100%",maxWidth:"100%",height:"100vh",maxHeight:"100vh",top:0,bottom:0,left:0,right:0,margin:0,borderRadius:0,...e&&{top:"auto",borderRadius:l.spacing(1,1,0,0),height:e,minHeight:e}},...r&&{maxHeight:`calc(100vh - ${l.spacing(10)})`,form:{flex:1,display:"flex",flexDirection:"column",justifyContent:"space-between",overflow:"hidden",...L[a],maxWidth:"100%",...t&&{width:"100%",maxWidth:"100%",height:"100%",maxHeight:"100%"},...e&&{height:e,minHeight:e},...o&&{width:o},[l.breakpoints.down("sm")]:{width:"100%",maxWidth:"100%",height:"100vh",maxHeight:"100vh",...e&&{top:"auto",borderRadius:l.spacing(1,1,0,0),height:e,minHeight:e}}}}}}));function _e({nonModal:t,children:e,size:o="small",PaperProps:r,fullScreen:a,height:l,width:s,hasForm:d,"aria-label":c,"data-testid":u,...f}){return t?n.jsx(P,{size:o,fullScreen:a,height:l,width:s,hasForm:d,"aria-label":c,"data-testid":u,...f,children:e}):n.jsx(i.Dialog,{PaperComponent:P,PaperProps:{...r,size:o,fullScreen:a,height:l,width:s,hasForm:d},fullScreen:a,role:"section","aria-label":c,"data-testid":u,"data-size":o,"data-width":s,"data-height":l,...f,children:e})}const Ne=i.styled(i.DialogTitle)(()=>({padding:0,zIndex:10})),qe=i.styled(i.Box)(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"space-between",padding:t.spacing(2),minHeight:t.spacing(8)})),X=i.styled(i.Box)(({theme:t})=>({display:"flex",alignItems:"center",gap:t.spacing(1),overflow:"hidden"})),Ge=i.styled(T.CloseOutlined)(({theme:t})=>({color:t.palette.text.secondary})),Ve=i.styled(i.Divider)(()=>({"+ .MuiDialogContent-root":{borderTop:"none !important"}}));function Ue({title:t,chipLabel:e,chipProps:o,children:r,onClose:a,secondaryActions:l,"aria-label":s,closeIcon:d,...c}){const u=k.useIntl(),f=y.useImperativeIntl(u);return n.jsxs(n.Fragment,{children:[n.jsxs(Ne,{component:"div",...c,children:[n.jsxs(qe,{children:[n.jsxs(X,{flex:1,maxWidth:.8,children:[n.jsx(y.Typography,{component:"h2",variant:"inherit",noWrap:!0,"aria-label":s,children:t}),e&&n.jsx(i.Chip,{color:"default",label:e,...o})]}),n.jsxs(X,{children:[l,a&&n.jsx(i.Tooltip,{title:f.formatMessage({id:"c4r.button.close"}),placement:"left",children:n.jsx(i.IconButton,{onClick:a,children:d||n.jsx(Ge,{"data-testid":"CloseIcon"})})})]})]}),r]}),r&&n.jsx(Ve,{})]})}const ze=i.styled(i.DialogContent,{shouldForwardProp:t=>!["scrollableContent","withGutter","withBottomGutter"].includes(t)})(({theme:t,scrollableContent:e,withGutter:o,withBottomGutter:r})=>({display:"flex",flexDirection:"column",gap:t.spacing(3),padding:0,...t.typography.body2,color:t.palette.text.secondary,".MuiAlert-root":{minHeight:"auto"},...e&&{borderBottom:`1px solid ${t.palette.divider}`,"+ .MuiDivider-root":{display:"none"}},...o&&{padding:` ${t.spacing(1,2,0)} !important`,".MuiDialog-paperFullScreen &":{padding:`${t.spacing(2,2,0)} !important`}},...r&&{paddingBottom:`${t.spacing(3)} !important`,".MuiDialog-paperFullScreen &":{paddingBottom:`${t.spacing(3)} !important`}}}));function Ze({children:t,scrollableContent:e,hasFooterAlert:o,withGutter:r=!0,withBottomGutter:a=!0,onScroll:l,...s},d){const c=i.useTheme(),[u,f]=b.useState(null);b.useImperativeHandle(d,()=>u,[u]);const p=b.useCallback(x=>{const h=Math.abs(x.scrollHeight-x.clientHeight-x.scrollTop)<1,j=x.scrollTop===0,m=`1px solid ${c.palette.divider}`;x.style.borderTop=j?"none":m,x.style.borderBottom=h&&!o?"none":m},[c.palette.divider,o]),g=b.useCallback(x=>{p(x.target),l==null||l(x)},[p,l]);return b.useEffect(()=>{u&&p(u)},[u,p]),b.useEffect(()=>{if(!u||typeof ResizeObserver>"u")return;const x=new ResizeObserver(()=>{p(u)});return x.observe(u),()=>x.disconnect()},[u,p]),n.jsx(ze,{ref:f,onScroll:g,scrollableContent:e,withGutter:r,withBottomGutter:a&&r,...s,children:t})}const st=b.forwardRef(Ze),Ye=i.styled(st,{shouldForwardProp:t=>t!=="withAlert"})(({withAlert:t,theme:e})=>({padding:`${e.spacing(0,2)} !important`,...t&&{paddingBottom:`${e.spacing(3)} !important`}})),Je=i.styled(E.Alert)(({theme:t})=>({minHeight:"auto",padding:0,backgroundColor:"transparent","& .MuiTypography-root":{color:t.palette.text.secondary,a:{color:t.palette.primary.main}},"& .MuiAlertTitle-root":{color:t.palette.text.primary}}));function G({children:t,severity:e="neutral",...o}){return n.jsx(Je,{severity:e,...o,children:t})}const Xe=i.styled(i.Box,{shouldForwardProp:t=>!["dark","hasChildren"].includes(t)})(({dark:t,hasChildren:e,theme:o})=>({flex:"0 0 auto",display:"block",minHeight:e?o.spacing(8):"auto",zIndex:10,...t&&{backgroundColor:o.palette.common.black,color:o.palette.white[60],".MuiAlert-root":{".MuiTypography-root, .MuiAlert-message :not(.MuiAlertTitle-root)":{color:o.palette.white[60],a:{color:`${o.palette.secondary.main} !important`}},".MuiAlert-icon":{color:o.palette.white[60]}}}})),Ke=i.styled(i.Box)(()=>({display:"flex",alignItems:"center",justifyContent:"space-between","& > div:empty":{padding:0}})),Qe=i.styled(i.Box,{shouldForwardProp:t=>t!=="hasAlert"})(({hasAlert:t,theme:e})=>({display:"flex",alignItems:"center",gap:e.spacing(1),padding:e.spacing(2),paddingTop:t?0:e.spacing(2)})),V=i.styled(i.DialogActions,{shouldForwardProp:t=>t!=="hasAlert"})(({hasAlert:t,theme:e})=>({gap:e.spacing(1),padding:e.spacing(2),paddingTop:t?0:e.spacing(2),margin:0,".MuiButton-root + .MuiButton-root":{marginLeft:0}})),tn=i.styled(i.Divider)(()=>({marginTop:"-1px"}));function en({children:t,secondaryActions:e,alertContent:o,alertProps:r,dark:a,topContent:l,...s}){return n.jsxs(n.Fragment,{children:[l,!!o&&n.jsx(tn,{}),n.jsxs(Xe,{...s,dark:a,"data-theme":a?"dark":"light",hasChildren:!!t,children:[!!o&&n.jsx(i.Box,{sx:{p:2,pt:1.5,pb:1},children:n.jsx(G,{...r,children:o})}),n.jsxs(Ke,{children:[n.jsx(Qe,{hasAlert:!!o,children:e}),n.jsx(V,{hasAlert:!!o,children:t})]})]})]})}const nn=i.styled(i.Box)(({theme:t})=>({position:"absolute",width:"100%",zIndex:100,top:0,bottom:0,left:0,right:0,overflow:"hidden",display:"flex",boxSizing:"border-box",alignItems:"flex-end",background:t.palette.white[60]})),on=i.styled("div")(()=>({width:"100%"})),rn=i.styled(i.Box)(({theme:t})=>({width:"100%",padding:t.spacing(1.5,2,2),backgroundColor:t.palette.background.paper,borderTop:`1px solid ${t.palette.divider}`,".MuiDialogActions-root":{padding:0,marginTop:t.spacing(1)}}));function an({children:t,onClickAway:e,actions:o,severity:r="warning",opened:a,"data-testid":l,"aria-label":s,...d}){const c=b.useRef(null),u=i.useTheme(),f=()=>{e&&e()};return n.jsx(nn,{ref:c,"data-testid":l,"aria-label":s,role:"presentation",children:n.jsx(gt,{onClickAway:f,children:n.jsx(i.Slide,{direction:"up",in:a,container:c.current,mountOnEnter:!0,unmountOnExit:!0,easing:u.transitions.easing.easeOut,timeout:350,children:n.jsx(on,{children:n.jsxs(rn,{children:[n.jsx(G,{severity:r,...d,children:t}),n.jsx(V,{children:o})]})})})})})}const ln=i.styled(i.Box)(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"center",height:t.spacing(8),marginBottom:t.spacing(2),"& > div":{flex:1}})),sn=i.styled(i.Box)(({theme:t})=>({display:"flex",flex:1,flexDirection:"column",justifyContent:"center",alignItems:"center",position:"relative","&:before, &:after":{content:'""',background:t.palette.divider,position:"absolute",top:t.spacing(1.25),height:t.spacing(.25),width:`calc(50% - ${t.spacing(2.5)})`},"&:before":{left:0},"&:after":{right:0},"&:first-of-type:before":{content:"none"},"&:last-of-type:after":{content:"none"}}));function cn({theme:t,completed:e,current:o}){return e?{background:t.palette.success.main,borderColor:t.palette.success.main,color:t.palette.common.white}:o?{background:t.palette.text.primary,borderColor:t.palette.text.primary,color:t.palette.common.white}:{borderColor:t.palette.text.secondary,color:t.palette.text.secondary}}const dn=i.styled("span",{shouldForwardProp:t=>t!=="completed"&&t!=="current"})(({theme:t,completed:e,current:o})=>({display:"flex",justifyContent:"center",alignItems:"center",height:t.spacing(3),width:t.spacing(3),marginBottom:t.spacing(1),borderRadius:"50%",border:`${t.spacing(.25)} solid currentColor`,...t.typography.caption,...cn({theme:t,completed:e,current:o})}));function un({currentStep:t,stepsLabels:e,...o}){return n.jsx(ln,{...o,children:n.jsx(i.Box,{sx:{display:"flex"},children:e.map((r,a)=>{const l=a+1,s=l===t,d=l<t,c=d?"success.main":s?"textPrimary":"textSecondary";return n.jsxs(sn,{"data-state":d?"completed":s?"current":"uncompleted",children:[n.jsx(dn,{completed:d,current:s,children:d?n.jsx(T.Check,{fontSize:"small","aria-label":"Completed step"}):l}),n.jsx(y.Typography,{variant:"caption",component:"div",color:c,children:r})]},a)})})})}exports.TablePaginationActions=y.TablePaginationActions;exports.Typography=y.Typography;exports.Alert=E.Alert;exports.MenuItem=W.MenuItem;exports.AccordionGroup=re;exports.AppBar=Ae;exports.Autocomplete=Xt;exports.Avatar=le;exports.Button=mt;exports.CreatableAutocomplete=ee;exports.DatePicker=$;exports.DateRangePicker=Re;exports.DateTimePicker=Oe;exports.Dialog=_e;exports.DialogActions=V;exports.DialogAlert=G;exports.DialogConfirmation=an;exports.DialogContent=st;exports.DialogContentPadded=Ye;exports.DialogFooter=en;exports.DialogHeader=Ue;exports.DialogPaper=P;exports.DialogStepper=un;exports.IconButton=Q;exports.LabelWithIndicator=F;exports.Menu=Ft;exports.MenuFilter=_;exports.MenuList=$t;exports.MultipleAutocomplete=oe;exports.MultipleSelectField=Gt;exports.PasswordField=It;exports.SelectField=K;exports.Snackbar=pe;exports.TimePicker=Fe;exports.ToggleButtonGroup=St;exports.TooltipData=He;exports.UploadField=Yt;exports.UploadFieldBase=tt;exports.dialogDimensionsBySize=L;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),h=require("react"),r=require("@mui/material"),y=require("../TablePaginationActions-7wkkiCXh.cjs"),w=require("react-intl"),S=require("@mui/icons-material"),W=require("../Alert-B2JgFj6Y.cjs");require("cartocolor");const H=require("../MenuItem-Dbss-WG1.cjs"),P=require("../ArrowDown-CGnG0E-4.cjs"),ut=require("@mui/x-date-pickers/DatePicker"),pt=require("@mui/x-date-pickers"),gt=require("@mui/x-date-pickers/TimePicker"),xt=require("@mui/x-date-pickers/DateTimePicker"),ft=require("@mui/material/ClickAwayListener"),mt=r.styled(r.Box)({position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center"}),ht=r.styled(r.Box)({visibility:"hidden",pointerEvents:"none"});function bt({children:t,loading:e,disabled:o,startIcon:i,endIcon:a,loadingPosition:l,...s},c){const d=n.jsx(r.CircularProgress,{size:18,color:"inherit"}),u=e&&l===void 0,m=()=>u?n.jsxs(r.Box,{sx:{position:"relative"},children:[n.jsx(mt,{children:d}),n.jsx(ht,{children:t})]}):t,p=g=>{if(!u)return e&&l!==void 0?l===g?d:void 0:g==="start"?i:a};return n.jsx(r.Button,{disabled:e||o,startIcon:p("start"),endIcon:p("end"),...s,ref:c,children:n.jsx(y.Typography,{variant:"inherit",color:"inherit",noWrap:!0,component:"span",children:m()})})}const yt=h.forwardRef(bt),jt=r.styled(r.Box)(({theme:t})=>({display:"flex",alignItems:"center",gap:t.spacing(.5)})),Mt=r.styled(y.Typography)(({theme:t})=>({".Mui-disabled &":{color:t.palette.text.disabled}})),It=r.styled(r.Box)(({theme:t})=>({display:"flex",svg:{width:y.ICON_SIZE_SMALL,height:y.ICON_SIZE_SMALL,fontSize:y.ICON_SIZE_SMALL,path:{fill:t.palette.text.secondary,".Mui-disabled &":{fill:t.palette.text.disabled}}}}));function F({label:t,type:e,icon:o,inheritSize:i}){return n.jsxs(jt,{children:[t,e&&n.jsx(Mt,{component:"span",variant:i?"inherit":"caption",color:"textSecondary",weight:"regular",children:e==="required"?"(required)":"(optional)"}),o&&n.jsx(It,{children:o})]})}function Ct({InputProps:t,size:e="small",...o},i){const a=w.useIntl(),l=y.useImperativeIntl(a),[s,c]=h.useState(!1),d=()=>c(!s);return n.jsx(r.TextField,{...o,ref:i,type:s?"text":"password",size:e,InputProps:{...t,endAdornment:n.jsx(r.InputAdornment,{position:"end",children:n.jsx(r.IconButton,{size:e,onClick:d,children:n.jsx(r.Tooltip,{title:l.formatMessage({id:`c4r.form.${s?"hidePassword":"showPassword"}`}),children:s?n.jsx(S.VisibilityOffOutlined,{}):n.jsx(S.VisibilityOutlined,{})})})})}})}const vt=h.forwardRef(Ct),O={};function Bt(t="$lodash$"){O[t]||(O[t]=0);const e=++O[t];return t==="$lodash$"?`${e}`:`${t}${e}`}const Dt=r.styled(r.Select)(({theme:t})=>({"& .MuiInputAdornment-positionStart":{paddingLeft:t.spacing(2),"&.MuiInputAdornment-sizeSmall":{paddingLeft:t.spacing(1.5)}},"& .MuiInputBase-inputAdornedStart":{paddingLeft:"0px !important"},"& .MuiSelect-select .MuiMenuItem-root:hover":{backgroundColor:"transparent"},"&.MuiInputBase-root .MuiSelect-select.MuiSelect-multiple":{paddingRight:t.spacing(7)}})),At=r.styled(r.MenuItem)(()=>({display:"none"}));function Tt({children:t,placeholder:e,size:o="small",displayEmpty:i,menuProps:a,inputProps:l,labelId:s,label:c,labelSecondary:d,helperText:u,name:m,error:p,focused:g,disabled:x,fullWidth:f,required:j,"aria-label":b,...C},A){const v=o==="small",[M]=h.useState(()=>Bt("select-label-")),B=c?s??M:void 0;return n.jsxs(r.FormControl,{size:o,error:p,focused:g,disabled:x,fullWidth:f,required:j,children:[n.jsxs(r.Box,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[c&&n.jsx(r.InputLabel,{shrink:!0,id:B,children:c}),d&&n.jsx(r.Box,{display:"flex",alignItems:"center",ml:2,mb:.5,children:d})]}),n.jsxs(Dt,{...C,labelId:B,name:m,ref:A,size:o,fullWidth:f,displayEmpty:i??!!e,inputProps:{...l,"aria-label":b},MenuProps:{...a,PopoverClasses:{paper:v?"MuiMenu-paper-sizeSmall":void 0},anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:0,horizontal:"left"}},children:[e&&n.jsx(At,{disabled:!0,value:"",children:n.jsx(y.Typography,{variant:v?"body2":"body1",color:"text.hint",component:"span",children:e})}),t]}),u&&n.jsx(r.FormHelperText,{"aria-label":`${m}-helper`,children:u})]})}const Q=h.forwardRef(Tt),St=r.styled(r.ToggleButtonGroup,{shouldForwardProp:t=>t!=="variant"&&t!=="backgroundColor"})(({variant:t,backgroundColor:e,theme:o})=>({...t==="contained"&&{boxShadow:"none"},...t==="unbounded"&&{boxShadow:"none",borderRadius:o.spacing(.5),"& .MuiDivider-root":{height:o.spacing(4),"&.MuiToggleButtonGroup-groupedHorizontal":{height:o.spacing(4)},"&.MuiToggleButtonGroup-groupedVertical":{height:"auto",width:o.spacing(4),margin:`${o.spacing(.5,0,1)} !important`,borderRadius:"0 !important"}},"& .MuiToggleButton-sizeSmall":{margin:0,"&.MuiToggleButtonGroup-grouped:not(.MuiDivider-root)":{margin:0},"& + .MuiDivider-root.MuiToggleButtonGroup-groupedHorizontal":{height:o.spacing(3)},"& + .MuiDivider-root.MuiToggleButtonGroup-groupedVertical":{height:"auto",width:o.spacing(3)}},".MuiToggleButtonGroup-grouped:not(.MuiDivider-root)":{margin:0,"&:first-of-type":{marginLeft:0},"&:not(:last-of-type)":{marginRight:o.spacing(.5)}},"&.MuiToggleButtonGroup-horizontal:not(.MuiDivider-root)":{".MuiToggleButtonGroup-grouped":{margin:o.spacing(0,.5)}},"&.MuiToggleButtonGroup-vertical:not(.MuiDivider-root)":{".MuiToggleButtonGroup-grouped":{margin:o.spacing(0,0,.5),"&:not(:last-of-type)":{marginRight:0},"&:last-of-type":{marginBottom:0}}}},...e==="primary"&&{backgroundColor:o.palette.background.paper},...e==="secondary"&&{backgroundColor:o.palette.background.default},...e==="transparent"&&{backgroundColor:"transparent"}}));function wt({children:t,variant:e="floating",backgroundColor:o,...i}){const l=e==="unbounded"?"transparent":"primary";return n.jsx(St,{...i,variant:e,backgroundColor:o??l,children:t})}const kt=r.styled("div")(({theme:t})=>({position:"relative",display:"inline-flex","& + &, & + .optionIconButton":{marginLeft:t.spacing(.5)}})),Rt=r.styled(r.IconButton,{shouldForwardProp:t=>!["active"].includes(t)})(({active:t,theme:e})=>({...t&&{color:e.palette.primary.main,backgroundColor:e.palette.primary.background,"& svg:not(.doNotFillIcon) path":{fill:e.palette.primary.main}}}));function Ft({tooltip:t,tooltipPlacement:e="top",icon:o,size:i="medium",variant:a="icon",color:l="default",sx:s,className:c,loading:d,disabled:u,active:m,...p},g){return n.jsx(r.Tooltip,{placement:e,title:t??"",children:n.jsx(kt,{className:`optionIconButton ${c??""}`,sx:s,"data-testid":"icon-button",children:n.jsx(Rt,{...p,ref:g,size:i,variant:a,color:l,active:m,disabled:u||d,children:d?n.jsx(r.CircularProgress,{size:18,color:"inherit"}):o})})})}const tt=h.forwardRef(Ft),Ot=r.styled(r.Menu,{shouldForwardProp:t=>!["extended","width","height"].includes(t)})(({theme:t,extended:e,width:o,height:i})=>({...e&&{".MuiMenuItem-root":{minHeight:t.spacing(6)}},...o&&{".MuiList-root":{width:o,minWidth:o}},...i&&{".MuiMenu-paper":{overflow:"hidden"},".MuiList-root":{maxHeight:i}}}));function $t({extended:t,width:e,height:o,MenuListProps:i,...a},l){return n.jsx(Ot,{...a,ref:l,"data-name":"menu",width:e,height:o,extended:t,MenuListProps:{...i,"data-width":e,"data-height":o,"data-extended":t}})}const Lt=h.forwardRef($t),Et=r.styled(r.MenuList,{shouldForwardProp:t=>!["extended","width","height"].includes(t)})(({theme:t,extended:e,width:o,height:i})=>({...e&&{".MuiMenuItem-root":{minHeight:t.spacing(6)}},"&.MuiList-root":{...o&&{width:o,minWidth:o},...i&&{maxHeight:i}}}));function Wt({extended:t,width:e,height:o,...i},a){return n.jsx(Et,{...i,ref:a,width:e,height:o,extended:t,"data-name":"menu-list","data-width":e,"data-height":o,"data-extended":t})}const Ht=h.forwardRef(Wt),Pt=r.styled(H.MenuItem)(()=>({marginTop:"0 !important"})),_t=r.styled(r.Link)(({disabled:t,theme:e})=>({display:"flex",alignItems:"center",gap:e.spacing(1),width:"100%",textAlign:"initial",...t&&{pointerEvents:"none",color:e.palette.text.disabled}}));function Nt({areAllSelected:t,areAnySelected:e,selectAll:o,selectAllDisabled:i,...a},l){const s=w.useIntl(),c=y.useImperativeIntl(s);return n.jsx(Pt,{...a,ref:l,fixed:!0,"data-name":"menu-filter",children:n.jsxs(_t,{variant:"body2",color:"textPrimary",component:"button",underline:"none",disabled:!!i,onClick:o,tabIndex:0,children:[n.jsx(r.Checkbox,{checked:t,indeterminate:e&&!t,disabled:i}),c.formatMessage({id:"c4r.form.selectAll"})]})})}const _=h.forwardRef(Nt);function qt({selectedOptions:t,options:e,onChange:o}){const[i,a]=h.useState(t??[]),l=e.length===i.length,s=i.length>0;return h.useEffect(()=>{i!==t&&a(i)},[t]),{areAllSelected:l,areAnySelected:s,currentOptions:i,handleChange:m=>{const{target:{value:p}}=m,g=typeof p=="string"?p.split(","):p.filter(x=>x!==void 0);a(g),o(g)},selectAll:()=>{const m=e==null?void 0:e.filter(({disabled:p})=>!p).map(({value:p})=>p);m&&(m.every(g=>i.includes(g))?(a([]),o([])):(a(m),o(m)))},unselectAll:()=>{a([]),o([])}}}const Gt=r.styled(r.MenuItem)(({theme:t})=>({"&.Mui-disabled":{pointerEvents:"auto","&:hover":{backgroundColor:`${t.palette.background.default} !important`}}})),Vt=r.styled(r.InputAdornment,{shouldForwardProp:t=>t!=="size"})(({theme:t,size:e})=>({display:"none",position:"absolute",top:t.spacing(2),right:t.spacing(3.5),".MuiInputBase-root:hover &, .MuiInputBase-root.Mui-focused &":{display:"flex"},".MuiSvgIcon-root":{color:t.palette.text.hint},...e==="medium"&&{top:t.spacing(3),right:t.spacing(5)}})),Ut=[],zt=()=>{};function Yt({options:t=Ut,selectedOptions:e,size:o="small",placeholder:i,showCounter:a,showFilters:l=!0,onChange:s=zt,selectAllDisabled:c,tooltipPlacement:d,variant:u,...m},p){const{areAllSelected:g,areAnySelected:x,currentOptions:f,handleChange:j,selectAll:b,unselectAll:C}=qt({options:t,selectedOptions:e,onChange:s}),A=o==="small",v=A||u==="standard"?0:2,M=w.useIntl(),B=y.useImperativeIntl(M),D=`${f.length} ${B.formatMessage({id:"c4r.form.selected"})}`,k=h.useMemo(()=>g?n.jsx(y.Typography,{component:"span",variant:A?"body2":"body1",color:"textPrimary",ml:v,children:B.formatMessage({id:"c4r.form.allSelected"})}):x?n.jsx(y.Typography,{component:"span",variant:A?"body2":"body1",color:"textPrimary",ml:v,children:a&&f.length>1?D:f.join(", ")}):n.jsx(y.Typography,{component:"span",variant:A?"body2":"body1",color:"text.hint",ml:v,children:i??B.formatMessage({id:"c4r.form.noneSelected"})}),[g,x,D,f,B,A,v,i,a]);return n.jsxs(Q,{...m,ref:p,multiple:!0,displayEmpty:!0,placeholder:i,value:f,renderValue:()=>k,onChange:j,size:o,variant:u,endAdornment:l&&x&&n.jsx(Vt,{position:"end",size:o,children:n.jsx(r.IconButton,{onClick:C,size:o,children:n.jsx(S.Cancel,{})})}),menuProps:{PaperProps:{sx:{".MuiList-root":{paddingTop:0}}}},children:[l&&n.jsx(_,{areAllSelected:g,areAnySelected:x,selectAll:b,selectAllDisabled:c}),t==null?void 0:t.map(I=>{const T=n.jsxs(Gt,{value:I.value,disabled:I.disabled,tabIndex:0,children:[n.jsx(r.Checkbox,{disabled:I.disabled,checked:f.includes(I.value)}),n.jsx(r.ListItemText,{primary:I.label})]},I.value);return I.tooltip?n.jsx(r.Tooltip,{title:I.tooltip,placement:d,children:T},I.value):T})]})}const Zt=h.forwardRef(Yt),Jt=r.styled(r.TextField,{shouldForwardProp:t=>t!=="cursor"})(({cursor:t,theme:e})=>({"&.MuiTextField-root .MuiInputBase-root":{cursor:t,paddingRight:e.spacing(1),"& input":{cursor:t},"&.Mui-disabled":{pointerEvents:"none","& .MuiButtonBase-root":{color:e.palette.text.disabled}},"&.MuiInputBase-sizeSmall":{paddingRight:e.spacing(.5)}},"& .MuiFormLabel-root":{cursor:t,"&.Mui-disabled":{pointerEvents:"none"}}}));function Xt({buttonText:t,hasFiles:e,size:o,error:i,disabled:a,handleReset:l,handleOpen:s,inProgress:c}){return n.jsx(r.InputAdornment,{position:"end",children:c?n.jsx(r.IconButton,{"aria-label":"loading",disabled:!0,size:o,children:n.jsx(r.CircularProgress,{size:18})}):e?n.jsx(r.IconButton,{onClick:l,size:o,"aria-label":"delete",disabled:a,children:n.jsx(S.Cancel,{})}):n.jsx(r.Button,{onClick:s,size:o,variant:"text",color:i?"default":"primary",disabled:a,children:t})})}function et({name:t,multiple:e,handleReset:o,handleOpen:i,dragOver:a,error:l,placeholder:s,focused:c,buttonText:d="Browse",inProgress:u,InputProps:m,size:p="small",hasFiles:g,cursor:x="pointer",...f}){return n.jsx(Jt,{...f,size:p,error:l,placeholder:s,focused:c??a,cursor:x,InputProps:{...m,name:t,readOnly:!0,endAdornment:n.jsx(Xt,{buttonText:d,hasFiles:g,size:p,error:l,disabled:!!a,handleReset:o,handleOpen:i,inProgress:u})}})}function Kt({onChange:t,files:e,multiple:o,placeholder:i,uploadInputRef:a}){const l=w.useIntl(),s=y.useImperativeIntl(l),[c,d]=h.useState(""),[u,m]=h.useState(!1);h.useEffect(()=>{!e||e.length===0?d(""):e.length===1?d(e[0].name):d(s.formatMessage({id:"c4r.form.filesSelected"},{count:e.length}))},[e,s]);const p=()=>{var M;(M=a.current)==null||M.click()},g=M=>{M.preventDefault(),m(!0)},x=M=>{M.preventDefault(),m(!1)},f=M=>{M.preventDefault(),m(!1);const B=M.dataTransfer.items,D=j(B);t==null||t(D)},j=M=>{const B=[];for(const D of Array.from(M))if(D.kind==="file"){const k=D.getAsFile();B.push(k)}return B},b=M=>{const B=Array.from(M.target.files);t==null||t(B)},C=M=>{M.stopPropagation(),d("")},A=h.useMemo(()=>{const M=s.formatMessage({id:"c4r.form.dragPlaceholder"},{count:o?0:1}),B=s.formatMessage({id:"c4r.form.dragActivePlaceholder"},{count:o?0:1});let D="";return u?D=B:D=i??M,D},[u,o,i,s]);return{filesText:c,getPlaceholder:A,dragOver:u,inputEvents:{onDragOver:g,onDragLeave:x,onDrop:f,onClick:p},handleFiles:b,handleReset:C}}const Qt=["application/JSON"];function te({name:t,buttonText:e,accept:o,files:i,inProgress:a,onChange:l,multiple:s,placeholder:c,error:d,focused:u,nativeInputProps:m,...p}){const g=o??Qt,x=h.useRef(null),{filesText:f,getPlaceholder:j,dragOver:b,inputEvents:C,handleFiles:A,handleReset:v}=Kt({uploadInputRef:x,files:i,onChange:l,multiple:s,placeholder:c});return n.jsxs(n.Fragment,{children:[n.jsx(et,{...p,placeholder:j,value:f,error:d,focused:u??b,handleReset:v,dragOver:b,inProgress:a,hasFiles:!!f,InputProps:C,buttonText:e}),n.jsx("input",{...m,ref:x,style:{display:"none"},type:"file","aria-label":t,name:t,accept:String(g),multiple:s,onChange:A})]})}function ee({disabled:t,loading:e,...o},i){return n.jsx(r.Autocomplete,{...o,ref:i,disabled:t||e,popupIcon:e?n.jsx(r.CircularProgress,{size:18,color:"inherit"}):n.jsx(P.ArrowDown,{}),"data-name":"autocomplete",ListboxProps:{"aria-multiselectable":!1,...o.ListboxProps}})}const ne=h.forwardRef(ee),nt=t=>t&&typeof t=="object"?t.title??String(t):String(t),ot=(t,e)=>typeof t!="object"||t===null?{value:t,multiple:e}:{...t,multiple:e},it=t=>n.jsx("span",{"data-testid":"more-options-tag",children:`+${t}`});function rt(){return{renderOption:(e,o,i,a,l)=>{const{title:s,inputValue:c,divider:d,fixed:u,extended:m,dense:p,destructive:g,disabled:x,subtitle:f,iconColor:j,startAdornment:b,endAdornment:C,alternativeTitle:A,secondaryText:v,multiple:M}=o,{key:B,...D}=e,k=typeof o=="string"||typeof o=="number",I=(T,R,U,z)=>U||z||(R&&typeof R=="object"&&"value"in R?String(R.value):T(R));return n.jsx(h.Fragment,{children:d?n.jsx(r.Divider,{}):n.jsxs(n.Fragment,{children:[c&&n.jsx(r.Divider,{}),n.jsxs(H.MenuItem,{...D,...!k&&{fixed:u,extended:m,dense:p,destructive:g,disabled:x,subtitle:f,iconColor:j},"aria-disabled":f||x,"aria-selected":i.selected,children:[!f&&(b||M||l)&&n.jsxs(r.ListItemIcon,{children:[l||M&&n.jsx(r.Checkbox,{checked:i.selected}),b]}),n.jsxs(r.ListItemText,{children:[I(a??nt,o,A,s),v&&n.jsx(y.Typography,{component:"p",variant:"caption",color:"text.secondary",children:v})]}),!f&&C]})]})},B)}}}function oe({getOptionLabel:t,newItemLabel:e,newItemIcon:o,multiple:i}){const a=w.useIntl(),l=y.useImperativeIntl(a),s=r.createFilterOptions(),{renderOption:c}=rt();return{creatableFilterOptions:(p,g)=>{const x=s(p,g),{inputValue:f}=g,j=p.some(b=>f===t(b));if(f.length>1&&f!==""&&!j){let b;typeof e=="function"?b=e(f):e?b=`${e} "${f}"`:b=`${l.formatMessage({id:"c4r.form.add"})} "${f}"`,x.push({inputValue:f,title:b})}return x},creatableOptionLabel:p=>typeof p=="string"?p:p.inputValue?p.inputValue:t(p),creatableRenderOption:(p,g,x)=>{const f=g.inputValue?o??n.jsx(S.AddCircleOutlineOutlined,{}):void 0,j=ot(g,!!i);return c(p,j,x,t,f)}}}function at({options:t,value:e,onChange:o,getOptionLabel:i}){const[a,l]=h.useState(Array.isArray(e)?e:e?[e]:[]),{renderOption:s}=rt();h.useEffect(()=>{const g=Array.isArray(e)?e:e?[e]:[];l(g)},[e]);const c=a.length===t.length,d=a.length>0&&a.length<t.length;return{multipleValue:a,allSelected:c,someSelected:d,handleSelectAll:g=>{const x=c?[]:[...t];l(x),o==null||o(g,x,"selectOption")},handleChange:(g,x,f)=>{l(x===null?[]:x),o==null||o(g,x,f)},multipleRenderOption:(g,x,f)=>{const j=ot(x,!0);return s(g,j,f,i)}}}function ie({children:t,showFilters:e,allSelected:o,someSelected:i,handleSelectAll:a=()=>{},multiple:l,...s},c){return n.jsxs("ul",{ref:c,...s,role:"listbox","aria-multiselectable":l,children:[e&&l&&n.jsx(_,{areAllSelected:!!o,areAnySelected:!!i,selectAll:a}),t]})}const lt=h.forwardRef(ie);function re({newItemLabel:t,newItemIcon:e,getOptionLabel:o=nt,multiple:i,disableCloseOnSelect:a,disabled:l,loading:s,showFilters:c,options:d=[],value:u,onChange:m,getLimitTagsText:p,...g},x){const{freeSolo:f=!0,...j}=g,{multipleValue:b,allSelected:C,someSelected:A,handleSelectAll:v,handleChange:M}=at({options:d,value:u,onChange:m}),{creatableFilterOptions:B,creatableOptionLabel:D,creatableRenderOption:k}=oe({getOptionLabel:o,newItemLabel:t,newItemIcon:e,multiple:i});return n.jsx(r.Autocomplete,{...j,ref:x,options:d,value:i?b:u,onChange:M,filterOptions:B,getOptionLabel:D,renderOption:k,freeSolo:f,forcePopupIcon:!0,multiple:i,disableCloseOnSelect:a??i,ListboxComponent:lt,ListboxProps:{showFilters:c,allSelected:C,someSelected:A,handleSelectAll:v,multiple:i},getLimitTagsText:p??it,disabled:l||s,popupIcon:s?n.jsx(r.CircularProgress,{size:18,color:"inherit"}):n.jsx(P.ArrowDown,{}),"data-name":"creatable-autocomplete"})}const ae=h.forwardRef(re);function le({renderOption:t,disableCloseOnSelect:e=!0,disabled:o,loading:i,showFilters:a,options:l,value:s,onChange:c,getOptionLabel:d,getLimitTagsText:u,...m},p){const{multipleValue:g,allSelected:x,someSelected:f,handleSelectAll:j,handleChange:b,multipleRenderOption:C}=at({options:l,value:s,onChange:c,getOptionLabel:d});return n.jsx(r.Autocomplete,{...m,ref:p,options:l,value:g,onChange:b,getOptionLabel:d,renderOption:t??C,ListboxComponent:lt,ListboxProps:{showFilters:a,allSelected:x,someSelected:f,handleSelectAll:j,multiple:!0},multiple:!0,getLimitTagsText:u??it,disableCloseOnSelect:e,disabled:o||i,popupIcon:i?n.jsx(r.CircularProgress,{size:18,color:"inherit"}):n.jsx(P.ArrowDown,{}),"data-name":"multiple-autocomplete"})}const se=h.forwardRef(le),ce=r.styled("div",{shouldForwardProp:t=>t!=="variant"})(({variant:t,theme:e})=>({width:"100%",borderRadius:e.spacing(.5),...t==="outlined"&&{backgroundColor:e.palette.background.paper,boxShadow:`inset 0 0 0 1px ${e.palette.divider}`}}));function de({variant:t="standard",items:e,...o}){return n.jsx(ce,{...o,variant:t,children:e.map((i,a)=>n.jsxs(r.Accordion,{disabled:i.disabled,defaultExpanded:i.defaultExpanded,onChange:i.onChange,children:[n.jsx(r.AccordionSummary,{"aria-controls":`${a}-content`,id:`${a}-header`,children:i.summary}),n.jsx(r.AccordionDetails,{children:i.content})]},a))})}const Y={large:5,medium:4,small:3,xsmall:2.25},ue=r.styled(r.Avatar,{shouldForwardProp:t=>t!=="size"&&t!=="disabled"})(({theme:t,size:e="medium",disabled:o=!1})=>({width:t.spacing(Y[e]),height:t.spacing(Y[e]),...t.typography.subtitle1,...e==="large"&&{...t.typography.h6},...e==="small"&&{...t.typography.caption,fontWeight:500},...e==="xsmall"&&{...t.typography.caption,fontWeight:500,svg:{width:y.ICON_SIZE_SMALL,height:y.ICON_SIZE_SMALL}},...o&&{opacity:.6}}));function pe(t){return n.jsx(ue,{...t})}const st=480,ge=r.styled(r.Snackbar)(({theme:t})=>({bottom:t.spacing(2),right:t.spacing(2),left:t.spacing(2),[t.breakpoints.up("sm")]:{bottom:t.spacing(4),right:"auto",left:"50%",width:"100%",maxWidth:`${st}px`}})),xe=r.styled(r.Box,{shouldForwardProp:t=>t!=="autoWidth"})(({autoWidth:t,theme:e})=>({minWidth:"100%",maxWidth:`${st}px`,margin:e.spacing(0,1),...t&&{minWidth:"auto"},[e.breakpoints.up("sm")]:{minWidth:e.spacing(40),...t&&{minWidth:"auto"}}})),fe=r.styled(W.Alert,{shouldForwardProp:t=>!["hasActions","closeable"].includes(t)})(({hasActions:t,closeable:e,icon:o,theme:i})=>({position:"relative",display:"flex",flexWrap:"wrap",columnGap:i.spacing(1),rowGap:i.spacing(.25),padding:i.spacing(1),paddingLeft:i.spacing(2),color:i.palette.common.white,backgroundColor:i.palette.common.black,".MuiAlert-message":{padding:i.spacing(.75,0)},".MuiAlert-message .MuiTypography-root, .MuiAlert-icon":{color:i.palette.common.white},".MuiAlert-message .MuiTypography-root:not(.MuiAlertTitle-root)":{...i.typography.body2},".MuiAlert-message .MuiCircularProgress-circle":{color:i.palette.common.white},".MuiAlert-icon":{position:"absolute",top:i.spacing(1),left:i.spacing(1.5),display:"flex",alignItems:"center",justifyContent:"center",width:i.spacing(3),marginTop:i.spacing(.5)},"&.MuiAlert-standardError":{backgroundColor:i.palette.error.main},...o!==!1&&{paddingLeft:i.spacing(5.5)},...e&&{paddingRight:i.spacing(6)},...!e&&!t&&{paddingRight:i.spacing(1.5)},...t&&{".MuiAlert-message":{minWidth:"fit-content",padding:i.spacing(.75,0)}}})),me=r.styled(r.Box)(({theme:t})=>({position:"absolute",top:t.spacing(1),right:t.spacing(1),"& button:hover, & button:focus-visible":{backgroundColor:t.palette.white[8]},svg:{color:t.palette.white[60]}}));function he({severity:t="neutral",autoHideDuration:e=y.NOTIFICATION_DURATION_IN_MS,closeable:o=!0,children:i,title:a,action:l,open:s,onClose:c=()=>{},autoWidth:d,icon:u,...m}){const p=w.useIntl(),g=y.useImperativeIntl(p),f=u===!1||t==="neutral"&&!u,b=e===null?null:e||y.NOTIFICATION_DURATION_IN_MS;return n.jsx(r.Portal,{children:n.jsx(ge,{...m,open:s,autoHideDuration:b,onClose:c,TransitionComponent:d?r.Fade:r.Slide,"data-auto-width":d,children:n.jsxs(xe,{sx:{position:"relative"},autoWidth:d,children:[n.jsx(fe,{severity:t,action:l,icon:f?!1:u,elevation:6,hasActions:!!l,closeable:o,title:a,children:i}),o&&n.jsx(me,{children:n.jsx(tt,{color:"default",onClick:C=>c(C,"timeout"),icon:n.jsx(S.CloseOutlined,{}),tooltip:g.formatMessage({id:"c4r.button.close"})})})]})})})}const be=r.styled("div")(({theme:t})=>({display:"flex",alignItems:"center",height:y.APPBAR_SIZE,marginRight:t.spacing(1.5)})),ye=r.styled(r.IconButton)(({theme:t})=>({marginRight:t.spacing(1),"&.MuiButtonBase-root svg path":{fill:t.palette.brand.appBarContrastText}})),je=r.styled(r.Divider)(({theme:t})=>({borderColor:r.alpha(t.palette.brand.appBarContrastText,.12)}));function Me({onClickMenu:t}){return n.jsx(r.Box,{sx:{display:{md:"none",xs:"block"}},children:n.jsxs(be,{children:[n.jsx(ye,{onClick:t,children:n.jsx(S.MenuOutlined,{})}),n.jsx(je,{orientation:"vertical",flexItem:!0})]})})}const Ie=r.styled("div")(({theme:t})=>({display:"flex",marginRight:t.spacing(1.5),"& a":{display:"flex"},"& svg, & img":{width:t.spacing(4),height:t.spacing(4)}}));function Ce({logo:t}){return n.jsx(Ie,{children:t})}const ve=r.styled(y.Typography)({display:"flex",alignItems:"center",whiteSpace:"nowrap"});function Be({text:t}){const e=r.useTheme();return n.jsx(ve,{component:"span",variant:"subtitle1",color:e.palette.brand.appBarContrastText,children:t})}const De=r.styled(y.Typography)(({theme:t})=>({display:"flex",alignItems:"center","&::before":{content:'"/"',margin:t.spacing(0,1),opacity:.6,color:t.palette.brand.appBarContrastText}}));function Ae({text:t}){const e=r.useTheme();return n.jsx(De,{component:"span",variant:"body2",weight:"strong",color:e.palette.brand.appBarContrastText,children:t})}const Te=r.styled(r.AppBar)(({theme:t})=>({backgroundColor:t.palette.brand.appBarMain,"& .MuiTypography-root":{color:t.palette.brand.appBarContrastText},"& .MuiIconButton-root path":{fill:t.palette.brand.appBarContrastText}})),Se=r.styled("div")(({theme:t})=>({display:"flex",alignItems:"center",maxWidth:"calc(100% - 300px)",overflow:"hidden",[t.breakpoints.down("sm")]:{minWidth:"192px"}})),we=r.styled("div")(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"space-between",flex:1,marginLeft:t.spacing(1)}));function ke({children:t,brandLogo:e,brandText:o,secondaryText:i,showBurgerMenu:a=!1,onClickMenu:l,...s}){return n.jsx(Te,{...s,children:n.jsxs(r.Toolbar,{children:[n.jsxs(Se,{children:[a&&n.jsx(Me,{onClickMenu:l}),e&&n.jsx(Ce,{logo:e}),o&&n.jsx(Be,{text:o}),i&&n.jsx(Ae,{text:i})]}),n.jsx(we,{children:t})]})})}const Re=r.styled(r.Box,{shouldForwardProp:t=>!["size","variant"].includes(t)})(({size:t,variant:e,theme:o})=>({position:"absolute",right:o.spacing(5.75),...t==="small"&&{right:o.spacing(4),top:"3px"},...e==="standard"&&{right:o.spacing(4.75),...t==="small"&&{right:o.spacing(3.5)}}}));function N({size:t,variant:e,...o}){const i=w.useIntl(),a=y.useImperativeIntl(i);return n.jsx(Re,{size:t,variant:e,children:n.jsx(r.IconButton,{...o,size:t,"aria-label":a.formatMessage({id:"c4r.form.clearSelection"})})})}const Fe=r.styled(r.Box,{shouldForwardProp:t=>!["size","variant","readOnly"].includes(t)})(({size:t,variant:e,readOnly:o,theme:i})=>({".MuiInputBase-root":{"& .clearButton svg":{color:i.palette.text.hint},...t==="small"&&{paddingRight:`${i.spacing(1)} !important`},...t==="medium"&&{"& .MuiInputAdornment-root":{"& .MuiIconButton-edgeEnd":{marginRight:i.spacing(-1)}}},...e==="standard"&&{paddingRight:`${i.spacing(1)} !important`,...t==="small"&&{paddingRight:`${i.spacing(.5)} !important`}},...o&&{"& .MuiInputAdornment-root":{"& svg":{color:i.palette.text.disabled}}}}}));function q({children:t,size:e,variant:o,readOnly:i,...a}){return n.jsx(Fe,{...a,size:e,variant:o,readOnly:i,children:t})}function $({handleClear:t,variant:e="outlined",size:o="small",label:i,labelHelpTooltip:a,type:l,helperText:s,placeholder:c,slotProps:d,slots:u,error:m,showCalendar:p=!0,readOnly:g,...x}){const f=w.useIntl(),j=y.useImperativeIntl(f);return n.jsx(r.Box,{className:"CartoDatePicker-root","data-testid":"date-picker",children:n.jsx(q,{size:o,variant:e,readOnly:g,children:n.jsx(ut.DatePicker,{...x,label:i&&n.jsx(F,{label:i,type:l,icon:a&&n.jsx(r.Tooltip,{title:a,children:n.jsx(S.HelpOutline,{htmlColor:"text.secondary"})})}),slotProps:{textField:{variant:e,helperText:s,placeholder:c,size:o,error:m??void 0,inputProps:{"data-testid":"date-picker-input"}},field:{clearable:!!t,onClear:t},...d},slots:{clearButton:b=>n.jsx(N,{...b,size:o,variant:e}),openPickerButton:b=>n.jsx(r.IconButton,{...b,size:o,"aria-label":j.formatMessage({id:"c4r.form.chooseDate"})}),...u},disableOpenPicker:!p,readOnly:g})})})}const Oe=r.styled(r.Box,{shouldForwardProp:t=>!["isSelected","isStartDate","isEndDate","isSelectedMonth","isLastDay","isFirstDay"].includes(t)})(({theme:t,isSelected:e,isStartDate:o,isEndDate:i,isSelectedMonth:a,isLastDay:l,isFirstDay:s})=>({position:"relative",margin:t.spacing(.25),"& .MuiPickersDay-root":{margin:0},...e&&a&&{"&::before":{content:'""',position:"absolute",top:0,right:"-2px",bottom:0,left:"-2px",backgroundColor:t.palette.primary.background,...(o||s)&&{left:0,borderRadius:`${t.shape.borderRadius}px 0 0 ${t.shape.borderRadius}px`},...(i||l)&&{right:0,borderRadius:`0 ${t.shape.borderRadius}px ${t.shape.borderRadius}px 0`}},"&:first-of-type::before":{left:0,borderRadius:`${t.shape.borderRadius}px 0 0 ${t.shape.borderRadius}px`},"&:last-of-type::before":{right:0,borderRadius:`0 ${t.shape.borderRadius}px ${t.shape.borderRadius}px 0`},...s&&{"&:last-of-type::before":{left:0,right:0,borderRadius:t.shape.borderRadius}},...l&&{"&:first-of-type::before":{left:0,right:0,borderRadius:t.shape.borderRadius}},"& .MuiPickersDay-today":{borderColor:`${t.palette.default.outlinedBorder} !important`,...(o||i)&&{boxShadow:`0 0 0 1px inset ${t.palette.background.paper}`}},"&::after":{content:'""',position:"absolute",top:0,right:0,bottom:0,left:0,backgroundColor:t.palette.background.paper,borderRadius:t.shape.borderRadius,transition:"background-color 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms"},"&:hover::after":{backgroundColor:t.palette.primary.relatedLight}}})),$e=r.styled(pt.PickersDay,{shouldForwardProp:t=>t!=="isDateRangeLimit"})(({theme:t,isDateRangeLimit:e})=>({"&.MuiPickersDay-root":{position:"relative",zIndex:1,"&.Mui-selected":{color:t.palette.text.primary},...e&&{"&.Mui-selected":{backgroundColor:`${t.palette.primary.main} !important`,color:t.palette.primary.contrastText,"&:hover":{backgroundColor:`${t.palette.primary.dark} !important`}}}}})),Z=(t,e)=>!t||!e?!1:t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate();function J({day:t,startDate:e,endDate:o,selectedMonth:i,...a}){const l=!!(e&&Z(e,t)),s=!!(o&&Z(o,t)),c=!!(e&&o&&t.getTime()>=e.getTime()&&t.getTime()<=o.getTime()),d=t.getDate()===1,u=t.getDate()===new Date(t.getFullYear(),t.getMonth()+1,0).getDate(),m=!!(i&&t.getMonth()===i.getMonth());return n.jsx(Oe,{isSelected:c,isStartDate:l,isEndDate:s,isSelectedMonth:m,isLastDay:u,isFirstDay:d,children:n.jsx($e,{...a,day:t,selected:c||l||s,isDateRangeLimit:l||s})})}const Le=r.styled(r.Box,{shouldForwardProp:t=>!["variant"].includes(t)})(({variant:t,theme:e})=>({display:"flex",gap:t==="standard"?e.spacing(1):"1px","& .CartoDatePicker-root":{"&:first-of-type":{".MuiInputBase-root":{borderRadius:e.spacing(.5,0,0,.5),boxShadow:`1px 0 0 0 ${e.palette.default.outlinedBorder}`,...t==="outlined"&&{"&:not(:hover):not(.Mui-focused):not(.Mui-error) .MuiOutlinedInput-notchedOutline":{borderRightColor:"transparent"}},...t==="filled"&&{"&::before, &::after":{borderRadius:e.spacing(.5,0,0,.5)}},...t==="standard"&&{boxShadow:"none",borderRadius:0}}},"&:last-of-type":{".MuiInputBase-root":{borderRadius:e.spacing(0,.5,.5,0),...t==="outlined"&&{"&:not(:hover):not(.Mui-focused):not(.Mui-error) .MuiOutlinedInput-notchedOutline":{borderLeftColor:"transparent"}},...t==="filled"&&{"&::before, &::after":{borderRadius:e.spacing(0,.5,.5,0)}},...t==="standard"&&{borderRadius:0}}}}}));function Ee({globalHelperText:t,error:e,variant:o="outlined",startProps:i,endProps:a,...l}){const s=w.useIntl(),c=y.useImperativeIntl(s),[d,u]=h.useState(!1),[m,p]=h.useState(!1),[g,x]=h.useState((i==null?void 0:i.value)||null),[f,j]=h.useState((a==null?void 0:a.value)||null),[b,C]=h.useState((a==null?void 0:a.value)??(i==null?void 0:i.value)??new Date),A=e??(i==null?void 0:i.error)??(a==null?void 0:a.error),v=(I,T)=>{x(I),i!=null&&i.onChange&&i.onChange(I,T),I&&T.validationError===null&&!m&&T.trigger===null&&(p(!1),u(!0))},M=(I,T)=>{j(I),a!=null&&a.onChange&&a.onChange(I,T)},B=()=>{p(!0),u(!1),setTimeout(()=>{C(g??new Date)},120)},D=()=>{p(!1),u(!0),setTimeout(()=>{C(f??g??new Date)},120)},k=()=>{p(!1),u(!0),setTimeout(()=>{C(f??g??new Date)},120)};return n.jsxs(r.Box,{children:[n.jsxs(Le,{variant:o,children:[n.jsx($,{...l,...i,value:(i==null?void 0:i.value)??g,maxDate:f??void 0,label:(i==null?void 0:i.label)??c.formatMessage({id:"c4r.form.startDate"}),slotProps:{popper:{placement:"bottom-start","aria-label":c.formatMessage({id:"c4r.form.startDateCalendar"})},...i==null?void 0:i.slotProps},slots:{openPickerIcon:S.TodayOutlined,day:I=>n.jsx(J,{...I,startDate:g,endDate:f,selectedMonth:b}),...i==null?void 0:i.slots},error:(i==null?void 0:i.error)??e,open:m,onChange:v,onOpen:B,onClose:D,onMonthChange:I=>C(I),variant:o}),n.jsx($,{...l,...a,value:(a==null?void 0:a.value)??f,minDate:g??void 0,slotProps:{popper:{"aria-label":c.formatMessage({id:"c4r.form.endDateCalendar"})},...a==null?void 0:a.slotProps},slots:{day:I=>n.jsx(J,{...I,startDate:g,endDate:f,selectedMonth:b}),...a==null?void 0:a.slots},label:(a==null?void 0:a.label)??c.formatMessage({id:"c4r.form.endDate"}),error:(a==null?void 0:a.error)??e,open:d,onOpen:k,onClose:()=>u(!1),onChange:M,onMonthChange:I=>C(I),variant:o})]}),t&&n.jsx(r.FormHelperText,{error:A,children:t})]})}const ct=(t,e,o,i)=>{const a=t==null?void 0:t.includes("hours"),l=t==null?void 0:t.includes("seconds"),s=t==null?void 0:t.includes("minutes"),c=(t==null?void 0:t.length)===1&&t[0]==="hours";if(i)return i;const d=[];return e&&d.push("MM/dd/yyyy "),a&&d.push(o?"hh":"HH"),c||d.push(":"),s&&d.push("mm"),l&&d.push(":ss"),o&&d.push(" a"),d.join("")};function We({handleClear:t,variant:e="outlined",size:o="small",label:i,labelHelpTooltip:a,type:l,helperText:s,placeholder:c,error:d,showClock:u=!0,readOnly:m,slotProps:p,slots:g,ampm:x=!0,views:f=["hours","minutes"],format:j,...b}){const C=w.useIntl(),A=y.useImperativeIntl(C),v=h.useRef(null),[M,B]=h.useState(0);return h.useEffect(()=>{if(!v.current)return;const D=new ResizeObserver(k=>{var T;const I=(T=k[0])==null?void 0:T.contentRect.width;I&&B(I)});return D.observe(v.current),()=>{D.disconnect()}},[]),n.jsx(q,{size:o,variant:e,readOnly:m,"data-testid":"time-picker",children:n.jsx(gt.TimePicker,{...b,ref:v,label:n.jsx(F,{label:i??A.formatMessage({id:"c4r.form.time"}),type:l,icon:a&&n.jsx(r.Tooltip,{title:a,children:n.jsx(S.HelpOutline,{htmlColor:"text.secondary"})})}),views:["hours"],format:ct(f,!1,x,j),slotProps:{textField:{variant:e,helperText:s,placeholder:c,size:o,error:d??void 0,inputProps:{"data-testid":"time-picker-input"}},field:{clearable:!!t,onClear:t},popper:{placement:"bottom-end"},layout:{sx:{width:M}},...p},slots:{clearButton:D=>n.jsx(N,{...D,size:o,variant:e}),openPickerButton:D=>n.jsx(r.IconButton,{...D,size:o,"aria-label":A.formatMessage({id:"c4r.form.chooseDate"})}),...g},disableOpenPicker:!u,readOnly:m,ampm:x})})}function He({handleClear:t,variant:e="outlined",size:o="small",label:i,labelHelpTooltip:a,type:l,helperText:s,placeholder:c,error:d,showCalendar:u=!0,readOnly:m,slotProps:p,slots:g,ampm:x=!0,views:f=["hours","minutes"],format:j,...b}){const C=w.useIntl(),A=y.useImperativeIntl(C);return n.jsx(q,{size:o,variant:e,readOnly:m,"data-testid":"date-time-picker",children:n.jsx(xt.DateTimePicker,{...b,label:n.jsx(F,{label:i??A.formatMessage({id:"c4r.form.time"}),type:l,icon:a&&n.jsx(r.Tooltip,{title:a,children:n.jsx(S.HelpOutline,{htmlColor:"text.secondary"})})}),views:["year","month","day","hours"],format:ct(f,!0,x,j),slotProps:{textField:{variant:e,helperText:s,placeholder:c,size:o,error:d??void 0,inputProps:{"data-testid":"date-time-picker-input"}},field:{clearable:!!t,onClear:t},...p},slots:{clearButton:v=>n.jsx(N,{...v,size:o,variant:e}),openPickerButton:v=>n.jsx(r.IconButton,{...v,size:o,"aria-label":A.formatMessage({id:"c4r.form.chooseDate"})}),...g},disableOpenPicker:!u,readOnly:m,ampm:x})})}const Pe=[{outlinedBullet:!1,value:""}],_e=r.styled("ul")(({theme:t})=>({listStyle:"none",paddingLeft:0,margin:t.spacing(.5,0,0,0)})),Ne=r.styled("li")(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"space-between","&:not(:last-child)":{marginBottom:t.spacing(.5)}})),qe=r.styled("span")(({theme:t})=>({width:t.spacing(1),height:t.spacing(1),marginRight:t.spacing(.5),border:`2px solid ${t.palette.qualitative.bold[1]}`,borderRadius:"50%",backgroundColor:t.palette.qualitative.bold[1]})),Ge=r.styled(y.Typography)(({theme:t})=>({minWidth:t.spacing(10),marginRight:t.spacing(1.5)}));function Ve({items:t=Pe,title:e}){return n.jsxs(n.Fragment,{children:[e&&n.jsx(y.Typography,{color:"inherit",variant:"caption",weight:"medium",children:e}),n.jsx(_e,{children:t.map((o,i)=>n.jsxs(Ne,{children:[n.jsx(qe,{style:{backgroundColor:`${o.outlinedBullet?"transparent":o.color}`,borderColor:o.color}}),o.category&&n.jsx(Ge,{color:"inherit",variant:"caption",children:o.category}),n.jsx(y.Typography,{color:"inherit",variant:"caption",weight:"medium",children:o.value})]},i))})]})}const X={small:"480px",medium:"640px",large:"640px",xlarge:"720px"},L={small:{width:"432px",maxWidth:"432px"},medium:{width:"592px",maxWidth:"592px"},large:{width:"768px",maxWidth:"768px",minHeight:"576px"},xlarge:{width:"calc(100vw - 80px)",height:"calc(100vh - 80px)",maxWidth:"960px"}},E=r.styled(r.Paper,{shouldForwardProp:t=>!["fullScreen","height","width","hasForm"].includes(t)})(({fullScreen:t,height:e,width:o,hasForm:i,size:a="small",theme:l})=>({"&.MuiPaper-root":{position:"relative",display:"flex",flexDirection:"column",margin:l.spacing(5),borderRadius:l.spacing(1),...L[a],maxHeight:X[a],[`@media (max-height:${X[a]})`]:{maxHeight:"calc(100vh - 80px)",...a==="large"&&{minHeight:e!=="auto"?"calc(100vh - 80px)":"auto"}},...t&&{width:"100vw",maxWidth:`calc(100vw - ${l.spacing(10)})`,height:"100vh",maxHeight:`calc(100vh - ${l.spacing(10)})`,margin:l.spacing(5),borderRadius:l.spacing(1)},...e&&{height:e,minHeight:e},...o&&{width:o},[l.breakpoints.down("sm")]:{position:"absolute",width:"100%",maxWidth:"100%",height:"100vh",maxHeight:"100vh",top:0,bottom:0,left:0,right:0,margin:0,borderRadius:0,...e&&{top:"auto",borderRadius:l.spacing(1,1,0,0),height:e,minHeight:e}},...i&&{maxHeight:`calc(100vh - ${l.spacing(10)})`,form:{flex:1,display:"flex",flexDirection:"column",justifyContent:"space-between",overflow:"hidden",...L[a],maxWidth:"100%",...t&&{width:"100%",maxWidth:"100%",height:"100%",maxHeight:"100%"},...e&&{height:e,minHeight:e},...o&&{width:o},[l.breakpoints.down("sm")]:{width:"100%",maxWidth:"100%",height:"100vh",maxHeight:"100vh",...e&&{top:"auto",borderRadius:l.spacing(1,1,0,0),height:e,minHeight:e}}}}}}));function Ue({nonModal:t,children:e,size:o="small",PaperProps:i,fullScreen:a,height:l,width:s,hasForm:c,"aria-label":d,"data-testid":u,...m}){return t?n.jsx(E,{size:o,fullScreen:a,height:l,width:s,hasForm:c,"aria-label":d,"data-testid":u,...m,children:e}):n.jsx(r.Dialog,{PaperComponent:E,PaperProps:{...i,size:o,fullScreen:a,height:l,width:s,hasForm:c},fullScreen:a,role:"section","aria-label":d,"data-testid":u,"data-size":o,"data-width":s,"data-height":l,...m,children:e})}const ze=r.styled(r.DialogTitle)(()=>({padding:0,zIndex:10})),Ye=r.styled(r.Box)(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"space-between",padding:t.spacing(2),minHeight:t.spacing(8)})),K=r.styled(r.Box)(({theme:t})=>({display:"flex",alignItems:"center",gap:t.spacing(1),overflow:"hidden"})),Ze=r.styled(S.CloseOutlined)(({theme:t})=>({color:t.palette.text.secondary})),Je=r.styled(r.Divider)(()=>({"+ .MuiDialogContent-root":{borderTop:"none !important"}}));function Xe({title:t,chipLabel:e,chipProps:o,children:i,onClose:a,secondaryActions:l,"aria-label":s,closeIcon:c,...d}){const u=w.useIntl(),m=y.useImperativeIntl(u);return n.jsxs(n.Fragment,{children:[n.jsxs(ze,{component:"div",...d,children:[n.jsxs(Ye,{children:[n.jsxs(K,{flex:1,maxWidth:.8,children:[n.jsx(y.Typography,{component:"h2",variant:"inherit",noWrap:!0,"aria-label":s,children:t}),e&&n.jsx(r.Chip,{color:"default",label:e,...o})]}),n.jsxs(K,{children:[l,a&&n.jsx(r.Tooltip,{title:m.formatMessage({id:"c4r.button.close"}),placement:"left",children:n.jsx(r.IconButton,{onClick:a,children:c||n.jsx(Ze,{"data-testid":"CloseIcon"})})})]})]}),i]}),i&&n.jsx(Je,{})]})}const Ke=r.styled(r.DialogContent,{shouldForwardProp:t=>!["scrollableContent","withGutter","withBottomGutter"].includes(t)})(({theme:t,scrollableContent:e,withGutter:o,withBottomGutter:i})=>({display:"flex",flexDirection:"column",gap:t.spacing(3),padding:0,...t.typography.body2,color:t.palette.text.secondary,".MuiAlert-root":{minHeight:"auto"},...e&&{borderBottom:`1px solid ${t.palette.divider}`,"+ .MuiDivider-root":{display:"none"}},...o&&{padding:` ${t.spacing(1,2,0)} !important`,".MuiDialog-paperFullScreen &":{padding:`${t.spacing(2,2,0)} !important`}},...i&&{paddingBottom:`${t.spacing(3)} !important`,".MuiDialog-paperFullScreen &":{paddingBottom:`${t.spacing(3)} !important`}}}));function Qe({children:t,scrollableContent:e,hasFooterAlert:o,withGutter:i=!0,withBottomGutter:a=!0,onScroll:l,...s},c){const d=r.useTheme(),[u,m]=h.useState(null);h.useImperativeHandle(c,()=>u,[u]);const p=h.useCallback(x=>{const f=Math.abs(x.scrollHeight-x.clientHeight-x.scrollTop)<1,j=x.scrollTop===0,b=`1px solid ${d.palette.divider}`;x.style.borderTop=j?"none":b,x.style.borderBottom=f&&!o?"none":b},[d.palette.divider,o]),g=h.useCallback(x=>{p(x.target),l==null||l(x)},[p,l]);return h.useEffect(()=>{u&&p(u)},[u,p]),h.useEffect(()=>{if(!u||typeof ResizeObserver>"u")return;const x=new ResizeObserver(()=>{p(u)});return x.observe(u),()=>x.disconnect()},[u,p]),n.jsx(Ke,{ref:m,onScroll:g,scrollableContent:e,withGutter:i,withBottomGutter:a&&i,...s,children:t})}const dt=h.forwardRef(Qe),tn=r.styled(dt,{shouldForwardProp:t=>t!=="withAlert"})(({withAlert:t,theme:e})=>({padding:`${e.spacing(0,2)} !important`,...t&&{paddingBottom:`${e.spacing(3)} !important`}})),en=r.styled(W.Alert)(({theme:t})=>({minHeight:"auto",padding:0,backgroundColor:"transparent","& .MuiTypography-root":{color:t.palette.text.secondary,a:{color:t.palette.primary.main}},"& .MuiAlertTitle-root":{color:t.palette.text.primary}}));function G({children:t,severity:e="neutral",...o}){return n.jsx(en,{severity:e,...o,children:t})}const nn=r.styled(r.Box,{shouldForwardProp:t=>!["dark","hasChildren"].includes(t)})(({dark:t,hasChildren:e,theme:o})=>({flex:"0 0 auto",display:"block",minHeight:e?o.spacing(8):"auto",zIndex:10,...t&&{backgroundColor:o.palette.common.black,color:o.palette.white[60],".MuiAlert-root":{".MuiTypography-root, .MuiAlert-message :not(.MuiAlertTitle-root)":{color:o.palette.white[60],a:{color:`${o.palette.secondary.main} !important`}},".MuiAlert-icon":{color:o.palette.white[60]}}}})),on=r.styled(r.Box)(()=>({display:"flex",alignItems:"center",justifyContent:"space-between","& > div:empty":{padding:0}})),rn=r.styled(r.Box,{shouldForwardProp:t=>t!=="hasAlert"})(({hasAlert:t,theme:e})=>({display:"flex",alignItems:"center",gap:e.spacing(1),padding:e.spacing(2),paddingTop:t?0:e.spacing(2)})),V=r.styled(r.DialogActions,{shouldForwardProp:t=>t!=="hasAlert"})(({hasAlert:t,theme:e})=>({gap:e.spacing(1),padding:e.spacing(2),paddingTop:t?0:e.spacing(2),margin:0,".MuiButton-root + .MuiButton-root":{marginLeft:0}})),an=r.styled(r.Divider)(()=>({marginTop:"-1px"}));function ln({children:t,secondaryActions:e,alertContent:o,alertProps:i,dark:a,topContent:l,...s}){return n.jsxs(n.Fragment,{children:[l,!!o&&n.jsx(an,{}),n.jsxs(nn,{...s,dark:a,"data-theme":a?"dark":"light",hasChildren:!!t,children:[!!o&&n.jsx(r.Box,{sx:{p:2,pt:1.5,pb:1},children:n.jsx(G,{...i,children:o})}),n.jsxs(on,{children:[n.jsx(rn,{hasAlert:!!o,children:e}),n.jsx(V,{hasAlert:!!o,children:t})]})]})]})}const sn=r.styled(r.Box)(({theme:t})=>({position:"absolute",width:"100%",zIndex:100,top:0,bottom:0,left:0,right:0,overflow:"hidden",display:"flex",boxSizing:"border-box",alignItems:"flex-end",background:t.palette.white[60]})),cn=r.styled("div")(()=>({width:"100%"})),dn=r.styled(r.Box)(({theme:t})=>({width:"100%",padding:t.spacing(1.5,2,2),backgroundColor:t.palette.background.paper,borderTop:`1px solid ${t.palette.divider}`,".MuiDialogActions-root":{padding:0,marginTop:t.spacing(1)}}));function un({children:t,onClickAway:e,actions:o,severity:i="warning",opened:a,"data-testid":l,"aria-label":s,...c}){const d=h.useRef(null),u=r.useTheme(),m=()=>{e&&e()};return n.jsx(sn,{ref:d,"data-testid":l,"aria-label":s,role:"presentation",children:n.jsx(ft,{onClickAway:m,children:n.jsx(r.Slide,{direction:"up",in:a,container:d.current,mountOnEnter:!0,unmountOnExit:!0,easing:u.transitions.easing.easeOut,timeout:350,children:n.jsx(cn,{children:n.jsxs(dn,{children:[n.jsx(G,{severity:i,...c,children:t}),n.jsx(V,{children:o})]})})})})})}const pn=r.styled(r.Box)(({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"center",height:t.spacing(8),marginBottom:t.spacing(2),"& > div":{flex:1}})),gn=r.styled(r.Box)(({theme:t})=>({display:"flex",flex:1,flexDirection:"column",justifyContent:"center",alignItems:"center",position:"relative","&:before, &:after":{content:'""',background:t.palette.divider,position:"absolute",top:t.spacing(1.25),height:t.spacing(.25),width:`calc(50% - ${t.spacing(2.5)})`},"&:before":{left:0},"&:after":{right:0},"&:first-of-type:before":{content:"none"},"&:last-of-type:after":{content:"none"}}));function xn({theme:t,completed:e,current:o}){return e?{background:t.palette.success.main,borderColor:t.palette.success.main,color:t.palette.common.white}:o?{background:t.palette.text.primary,borderColor:t.palette.text.primary,color:t.palette.common.white}:{borderColor:t.palette.text.secondary,color:t.palette.text.secondary}}const fn=r.styled("span",{shouldForwardProp:t=>t!=="completed"&&t!=="current"})(({theme:t,completed:e,current:o})=>({display:"flex",justifyContent:"center",alignItems:"center",height:t.spacing(3),width:t.spacing(3),marginBottom:t.spacing(1),borderRadius:"50%",border:`${t.spacing(.25)} solid currentColor`,...t.typography.caption,...xn({theme:t,completed:e,current:o})}));function mn({currentStep:t,stepsLabels:e,...o}){return n.jsx(pn,{...o,children:n.jsx(r.Box,{sx:{display:"flex"},children:e.map((i,a)=>{const l=a+1,s=l===t,c=l<t,d=c?"success.main":s?"textPrimary":"textSecondary";return n.jsxs(gn,{"data-state":c?"completed":s?"current":"uncompleted",children:[n.jsx(fn,{completed:c,current:s,children:c?n.jsx(S.Check,{fontSize:"small","aria-label":"Completed step"}):l}),n.jsx(y.Typography,{variant:"caption",component:"div",color:d,children:i})]},a)})})})}exports.TablePaginationActions=y.TablePaginationActions;exports.Typography=y.Typography;exports.Alert=W.Alert;exports.MenuItem=H.MenuItem;exports.AccordionGroup=de;exports.AppBar=ke;exports.Autocomplete=ne;exports.Avatar=pe;exports.Button=yt;exports.CreatableAutocomplete=ae;exports.DatePicker=$;exports.DateRangePicker=Ee;exports.DateTimePicker=He;exports.Dialog=Ue;exports.DialogActions=V;exports.DialogAlert=G;exports.DialogConfirmation=un;exports.DialogContent=dt;exports.DialogContentPadded=tn;exports.DialogFooter=ln;exports.DialogHeader=Xe;exports.DialogPaper=E;exports.DialogStepper=mn;exports.IconButton=tt;exports.LabelWithIndicator=F;exports.Menu=Lt;exports.MenuItemFilter=_;exports.MenuList=Ht;exports.MultipleAutocomplete=se;exports.MultipleSelectField=Zt;exports.PasswordField=vt;exports.SelectField=Q;exports.Snackbar=he;exports.TimePicker=We;exports.ToggleButtonGroup=wt;exports.TooltipData=Ve;exports.UploadField=te;exports.UploadFieldBase=et;exports.dialogDimensionsBySize=L;