@australiangreens/ag-internal-components 0.1.25 → 0.1.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- "use strict";var Ue=Object.defineProperty,We=Object.defineProperties;var Ve=Object.getOwnPropertyDescriptors;var U=Object.getOwnPropertySymbols;var ie=Object.prototype.hasOwnProperty,se=Object.prototype.propertyIsEnumerable;var X=(e,t,n)=>t in e?Ue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,u=(e,t)=>{for(var n in t||(t={}))ie.call(t,n)&&X(e,n,t[n]);if(U)for(var n of U(t))se.call(t,n)&&X(e,n,t[n]);return e},E=(e,t)=>We(e,Ve(t));var ae=(e,t)=>{var n={};for(var r in e)ie.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&U)for(var r of U(e))t.indexOf(r)<0&&se.call(e,r)&&(n[r]=e[r]);return n};var le=(e,t,n)=>X(e,typeof t!="symbol"?t+"":t,n);var F=(e,t,n)=>new Promise((r,s)=>{var a=c=>{try{l(n.next(c))}catch(p){s(p)}},d=c=>{try{l(n.throw(c))}catch(p){s(p)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(a,d);l((n=n.apply(e,t)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),f=require("react"),i=require("@mui/material"),ze=require("@mui/material/CssBaseline"),T=require("@mui/material/styles"),Q=require("souvlaki"),Ge=require("react-router-dom"),Xe=require("@mui/material/List"),Y=require("@mui/icons-material"),b=require("jotai"),Ye=require("jotai/utils"),Ke=require("react-avatar"),J=require("@auth0/auth0-react"),ye=require("@tanstack/react-query"),Qe=require("autosuggest-highlight/match"),Je=require("autosuggest-highlight/parse"),Ze=require("buffer"),et=require("@mui/material/Skeleton"),R=e=>e&&e.__esModule?e:{default:e},tt=R(ze),Se=R(Xe),ce=R(Ke),ot=R(Qe),nt=R(Je),rt=R(et);function it({text:e}){const[t,n]=f.useState(0);return o.jsxs(o.Fragment,{children:[o.jsx(i.Typography,{variant:"h6",color:"inherit",component:"div",sx:{fontSize:"22px"},children:"Hello world"}),o.jsx(i.Typography,{variant:"caption",display:"block",children:o.jsx("span",{children:"Just ensuring MUI is working as planned as a peer dependency. v0.0.11"})}),o.jsx(i.Button,{variant:"outlined",onClick:()=>n(r=>r+1),"aria-label":"Increment",children:"Hello I am a button"}),o.jsxs("p",{children:["This is some text: ",o.jsx("span",{children:e})]}),o.jsxs(i.Paper,{children:["This number will incremember when button pressed: ",t]})]})}const Z=330,ee=73,N="Navbar",$={root:`${N}-root`,menuButton:`${N}-menuButton`,hide:`${N}-hide`,content:`${N}-content`,userInfoHolder:`${N}-userInfoHolder`,settings:`${N}-settings`,pieChartIcon:`${N}-pieChartIcon`},st=T.styled(i.Box,{name:"NavBar"})(({theme:e})=>({[`&.${$.root}`]:{display:"flex"},[`& .${$.menuButton}`]:{marginRight:36},[`& .${$.hide}`]:{display:"none"},[`& .${$.content}`]:{flexGrow:1,padding:e.spacing(3)},[`& .${$.userInfoHolder}`]:{height:"148px",marginTop:"64px",marginBottom:"16px"}})),we=()=>({position:"absolute",height:"100%",overflowX:"hidden",overflowY:"hidden",color:"white",backgroundColor:"black"}),at=()=>u({width:Z},we()),lt=()=>u({width:ee},we()),ct=T.styled(i.Drawer,{shouldForwardProp:e=>e!=="open"})(({theme:e,open:t})=>u(u({width:t?Z:ee,flexShrink:0,whiteSpace:"nowrap",boxSizing:"border-box",zIndex:e.zIndex.drawer+100},t&&{"& .MuiDrawer-paper":at()}),!t&&{"& .MuiDrawer-paper":lt()}));class z extends Error{}le(z,"errorName","ContextError");const je=f.createContext(null),dt={},ut={},De=({overrideState:e=dt,overrideActions:t=ut,children:n})=>{const[{open:r},s]=f.useState({open:!0}),a=f.useCallback(c=>{s({open:c})},[]),d=f.useCallback(()=>{s(c=>E(u({},c),{open:!c.open}))},[]),l=u(u({open:r,setOpen:a,toggleOpen:d},e),t);return o.jsx(je.Provider,{value:l,children:n})},be=()=>{const e=f.useContext(je);if(e===null)throw new z("Error: Tried to useNavBar outside of a <NavBarProvider>");return e},ke=(e={})=>u({open:!0},e),pt=Q.createHelper((e=ke(),t={})=>({children:n})=>o.jsx(De,{overrideState:e,overrideActions:t,children:n})),ht=Q.createHelper(()=>({children:e})=>o.jsx(Ge.BrowserRouter,{children:e})),de=7,gt=T.styled(Se.default)(({theme:e})=>({backgroundColor:"black",color:"white","& .MuiListItem-root":{padding:"unset"},"& .MuiListItemButton-root":{" .MuiListItemIcon-root":{color:"white",padding:`${de}px`},"&.Mui-focusVisible":{backgroundColor:e.palette.grey[700]},"&.Mui-selected":{borderLeftStyle:"solid",borderLeftWidth:"7px",borderLeftColor:e.palette.primary.main,paddingLeft:`calc(${e.spacing(2)} - ${de}px)`},"&:hover":{backgroundColor:e.palette.primary.dark},"&.Mui-selected.Mui-focusVisible":{backgroundColor:e.palette.grey[700]},"&.Mui-selected:hover":{backgroundColor:e.palette.primary.dark}}})),ue=7,mt=T.styled(Se.default)(({theme:e})=>({backgroundColor:"#e8e8e8",color:"inherit","& .MuiListItem-root":{padding:"unset"},"& .MuiListItemButton-root":{" .MuiListItemIcon-root":{color:"inherit",padding:`${ue}px`},"&.Mui-focusVisible":{backgroundColor:e.palette.grey[700]},"&.Mui-selected":{borderLeftStyle:"solid",borderLeftWidth:"7px",borderLeftColor:e.palette.primary.main,paddingLeft:`calc(${e.spacing(2)} - ${ue}px)`},"&:hover":{backgroundColor:e.palette.primary.dark},"&.Mui-selected.Mui-focusVisible":{backgroundColor:e.palette.grey[700]},"&.Mui-selected:hover":{backgroundColor:e.palette.primary.dark}}}));function xt({"data-testid":e,children:t}){const{open:n}=be();return o.jsxs(st,{className:$.root,"data-testid":e,children:[o.jsx(tt.default,{}),o.jsx(ct,{variant:"permanent",anchor:"left",transitionDuration:null,open:n,children:t})]})}const Ee=()=>{const e=i.useTheme();return i.useMediaQuery(e.breakpoints.down("sm"))},ft=64,At=72,vt=256,q=b.atom(!0),Be=b.atom(vt),Ie=b.atom(At),K=b.atom(""),_e=b.atom(void 0),Fe=b.atom(ft),Te=b.atom(void 0);function Ct({links:e}){return o.jsx("div",{children:"LinksMenu not implemented yet"})}const W="Navbar",H={root:`${W}-root`,menuButton:`${W}-menuButton`,hide:`${W}-hide`,content:`${W}-content`},yt=T.styled(i.Box,{name:"NavBar"})(({theme:e})=>({[`&.${H.root}`]:{display:"flex"},[`& .${H.menuButton}`]:{marginRight:36},[`& .${H.hide}`]:{display:"none"},[`& .${H.content}`]:{flexGrow:1,padding:e.spacing(3)}})),P=(e,t,n)=>e.transitions.create(t,{easing:e.transitions.easing.sharp,duration:n==="leaving"?e.transitions.duration.leavingScreen:e.transitions.duration.enteringScreen}),St=e=>{const t=i.useTheme();return o.jsx(i.Collapse,u({easing:t.transitions.easing.sharp,timeout:{enter:t.transitions.duration.enteringScreen,exit:t.transitions.duration.leavingScreen}},e))},Ne=e=>{var t,n;return{overflowX:"hidden",color:"inherit",backgroundColor:(n=(t=e==null?void 0:e.navBar)==null?void 0:t.backgroundColor)!=null?n:"white"}},pe=(e,t)=>u({width:t,transition:P(e,"width","entering")},Ne(e)),he=(e,t)=>u({width:t,transition:P(e,"width","leaving")},Ne(e)),wt=T.styled(i.Drawer,{shouldForwardProp:e=>!["widthOpen","widthClosed","isSmallScreen"].includes(e)})(({theme:e,open:t,widthOpen:n,widthClosed:r,isSmallScreen:s})=>u(u({flexShrink:0,whiteSpace:"nowrap",boxSizing:"border-box",display:"flex",flexDirection:"column"},t&&E(u({},pe(e,n)),{backgroundColor:"","& .MuiDrawer-paper":pe(e,n)})),!t&&E(u({},he(e,s?n:r)),{backgroundColor:"","& .MuiDrawer-paper":he(e,s?n:r)}))),V={log:console.warn.bind(console),error:console.error.bind(console),warn:console.warn.bind(console),info:console.info.bind(console),debug:console.debug.bind(console)};function jt(e,t){console[e]=(...n)=>{for(const r of t)if(typeof r=="function"){if(r(...n))return}else if(r instanceof RegExp&&n.length>0){for(const s of n)if(typeof s=="string"&&r.test(s))return}V[e](n)}}function Dt(e){if(e)console[e]=V[e];else for(const t of Object.keys(V))console[t]=V[t]}function $e(e){return e.replace(/(^|-)([a-z])/g,(t,n,r)=>n==="-"?" "+r.toUpperCase():r.toUpperCase())}function bt(e,t,n,r){var d;if(!e)return"None";const a=Object.entries(e).filter(([l,c])=>l.startsWith("https://greens.org.au/roles/")&&c.includes(t)).map(([l])=>{var c;return $e((c=l.split("/").at(-1))!=null?c:"")});return(d=r.find(l=>n[l].some(c=>a.includes(c))))!=null?d:"None"}const kt=e=>{const{getIdTokenClaims:t,user:n}=J.useAuth0();return ye.useQuery({queryKey:["availableDomains",n==null?void 0:n.sub],queryFn:()=>F(exports,null,function*(){const r=yield t();return r?Object.entries(r).reduce((s,[a,d])=>{var p;const l=$e((p=a.split("/").at(-1))!=null?p:""),c=a.startsWith("https://greens.org.au/roles/")&&e.includes(l)?d:[];return[...new Set([...s,...c])]},[]):[]})})};function Le(e){let t=0;for(let n=0,r=e.length;n<r;n++){const s=e.charCodeAt(n);t=(t<<5)-t+s,t|=0}return t}const ge=["#A62A21","#7e3794","#0B51C1","#3A6024","#A81563","#B3003C"],me=e=>e.split(/\s/).map(t=>t.substring(0,1).toUpperCase()).filter(t=>!!t).slice(0,2).join("").toUpperCase();function Et({user:e,domainCode:t,open:n,useNewAvatar:r=!1}){const s=i.useTheme();return o.jsxs(i.Box,{sx:{paddingTop:3,display:"flex",alignItems:"center",flexDirection:"column",gap:"0.5rem"},children:[!r&&o.jsx(i.Box,{sx:{width:n?"5rem":"2rem",transition:n?P(s,["width","height"],"entering"):P(s,["width","height"],"leaving"),aspectRatio:1},children:e!=null&&e.name?o.jsx(o.Fragment,{children:o.jsx(i.Avatar,{src:e==null?void 0:e.picture,sx:{width:"100%",height:"100%",bgcolor:ge[Math.abs(Le(e==null?void 0:e.name))%ge.length]},children:me(e==null?void 0:e.name)})}):o.jsx(i.Avatar,{sx:{width:"100%",height:"100%"}})}),r&&o.jsx(i.Box,{sx:{width:n?"5rem":"2rem",transition:n?P(s,["width","height"],"entering"):P(s,["width","height"],"leaving"),aspectRatio:1},children:e!=null&&e.name?o.jsx(o.Fragment,{children:o.jsxs(ce.default,{src:e==null?void 0:e.picture,name:e==null?void 0:e.name,round:!0,size:n?"80":"32",children:[" ",me(e==null?void 0:e.name)," ","ab"]})}):o.jsx(ce.default,{})}),o.jsx(St,{sx:{width:"100%"},in:n,children:o.jsx(i.Fade,{in:n,children:o.jsxs(i.Box,{width:"100%",display:"flex",flexDirection:"column",alignItems:"center",children:[e!=null&&e.name?o.jsx(i.Typography,{children:e==null?void 0:e.name}):o.jsx(i.Skeleton,{animation:!1,width:"50%"}),t?o.jsx(i.Typography,{children:t.toUpperCase()}):o.jsx(i.Skeleton,{animation:!1,width:"25%"})]})})})]})}function Bt({open:e,widthClosed:t,widthOpen:n,"data-testid":r,top:s,middle:a,bottom:d,user:l,domainCode:c,useNewAvatar:p=!1}){const m=Ee(),w=b.useSetAtom(q);return o.jsx(yt,{className:H.root,"data-testid":r,children:o.jsxs(wt,{open:e,widthOpen:n,widthClosed:t,anchor:"left",variant:m?"temporary":"permanent",PaperProps:{component:"nav"},onClose:()=>{w(!1)},isSmallScreen:m,children:[!m&&o.jsx(i.Toolbar,{}),s&&o.jsxs(i.Box,{flexGrow:"0",children:[s,o.jsx(i.Divider,{variant:"middle",sx:{marginY:"0.5rem"}})]}),o.jsx(i.Box,{flexGrow:"1",children:Array.isArray(a)?o.jsx(Ct,{links:a}):a}),o.jsxs(i.Box,{flexGrow:"0",children:[o.jsx(i.Divider,{variant:"middle",sx:{marginY:"0.5rem"}}),o.jsx(Et,{user:l,domainCode:c,open:e,useNewAvatar:p}),d&&o.jsx(o.Fragment,{children:d})]})]})})}function It({children:e,topBarHeight:t,maxWidth:n=!1,noPadding:r}){return o.jsx(i.Box,{sx:{overflow:"auto",height:`calc(100vh - ${t}px)`,flexGrow:1},children:r?o.jsx(i.Box,{component:"main",id:"main-content",height:"inherit",children:e}):o.jsx(i.Container,{component:"main",id:"main-content",maxWidth:n,sx:{paddingTop:3,paddingBottom:3,flexGrow:1},children:e})})}const _t="TopBar",Ft={titleText:`${_t}-titleText`};function Tt({titleText:e="",height:t,"data-testid":n,middle:r}){const s=b.useSetAtom(q),a=()=>s(c=>!c),d=i.useTheme(),l=Ee();return o.jsx("header",{"data-testid":n,children:o.jsxs(i.Paper,{square:!0,elevation:0,sx:{width:"100%",position:"sticky",color:"primary.contrastText",backgroundColor:"primary.main",display:"flex",alignItems:"center",gap:2,flexShrink:0,height:t,zIndex:l?0:d.zIndex.drawer+101},children:[o.jsx(i.IconButton,{size:"medium",color:"inherit",sx:{padding:1.5,marginLeft:"12px"},onClick:a,children:o.jsx(Y.ViewHeadline,{fontSize:"medium"})}),o.jsx(i.Typography,{className:Ft.titleText,variant:"h6",component:"h1",children:e}),r]})})}function Nt({children:e,initialTitleText:t,initialNavBarOpen:n,pageContainerProps:r,pageContentDataTestId:s,topBarDataTestId:a,navBarDataTestId:d,navBarMiddle:l,navBarBottom:c,user:p,domainCode:m,useNewAvatar:w=!1}){Ye.useHydrateAtoms([[q,n!=null?n:!0],[K,t!=null?t:""]]);const y=b.useAtomValue(q),[x]=b.useAtom(Be),[j]=b.useAtom(Ie),k=b.useAtomValue(K),[h]=b.useAtom(Fe),[D]=b.useAtom(_e),[B]=b.useAtom(Te);return o.jsxs(i.Box,{children:[o.jsx(i.CssBaseline,{}),o.jsx(Tt,{titleText:k,"data-testid":a,height:h,middle:D}),o.jsxs(i.Box,{sx:{display:"flex"},children:[o.jsx(Bt,{open:y,top:B,middle:l,bottom:c,user:p,domainCode:m,widthOpen:x,widthClosed:j,offsetTop:h,"data-testid":d,useNewAvatar:w}),o.jsx(It,E(u({"data-testid":s,topBarHeight:h},r),{children:e}))]})]})}const te=({isOpen:e,dialogTitle:t,children:n,maxWidth:r,primaryButton:s,secondaryButton:a,additionalButtons:d,onClose:l,sx:c,"data-testid":p,disableCloseOnBackdropOrEscape:m=!1,isLoading:w=!1})=>{var j,k;const[y,x]=f.useState(!1);return o.jsxs(i.Dialog,{open:e,onClose:(h,D)=>F(exports,null,function*(){m&&(D==="backdropClick"||D==="escapeKeyDown")||y||(a!=null&&a.onClick?yield a.onClick():l())}),fullWidth:!0,maxWidth:r!=null?r:"xs","data-testid":p,sx:c,children:[w&&o.jsx(i.LinearProgress,{sx:{height:"4px",marginBottom:"-4px"}}),o.jsx(i.DialogTitle,{children:t}),o.jsx(i.DialogContent,{sx:{"& > :last-child":{marginBottom:0}},children:n}),o.jsxs(i.DialogActions,{children:[o.jsx(i.Button,{onClick:(j=a==null?void 0:a.onClick)!=null?j:l,"data-testid":a==null?void 0:a.testId,disabled:(a==null?void 0:a.disabled)||y,color:a==null?void 0:a.buttonColor,children:(k=a==null?void 0:a.text)!=null?k:"Cancel"}),d&&d.map((h,D)=>{var B;return o.jsx(i.Button,{onClick:h==null?void 0:h.onClick,"data-testid":h==null?void 0:h.testId,disabled:(h==null?void 0:h.disabled)||y,color:h==null?void 0:h.buttonColor,children:(B=h.text)!=null?B:`Button ${D}`},D)}),s&&o.jsx(i.Button,{onClick:()=>F(exports,null,function*(){var h;x(!0),yield(h=s.onClick)==null?void 0:h.call(s),x(!1)}),"data-testid":s.testId,disabled:s.disabled||y,color:s==null?void 0:s.buttonColor,children:s.text})]})]})},oe=({minLength:e,preLoadedOptions:t,lookup:n,label:r,inputValue:s})=>ye.useQuery({queryFn:()=>e&&s.length<e?t!=null?t:[]:t?t.filter(a=>a.label.toLowerCase().includes(s.toLowerCase())):n(s),queryKey:["autocomplete",r,s]});function $t({lookup:e=()=>F(this,null,function*(){}),enableHighlighting:t=!0,onChange:n,minLength:r=0,label:s,value:a,"data-testid":d,sx:l,boxSx:c,textFieldColor:p,textFieldVariant:m="filled",loadingText:w="Loading...",noOptionsText:y="No options",popupIcon:x=o.jsx(Y.ArrowDropDown,{}),error:j=!1,helperText:k="",preLoadedOptions:h=void 0,disablePortal:D=!1,disableIconFlip:B=!1}){const[_,O]=f.useState(""),L=(g,v)=>{const C=a.filter(S=>S.id!==v);n(C,"delete",g)},{data:A,isLoading:I}=oe({inputValue:_,label:s,lookup:e,minLength:r,preLoadedOptions:h}),M=_.length>=r;return o.jsxs("div",{"data-testid":d,children:[o.jsx(i.Autocomplete,{sx:u(u({},l),B?{".MuiAutocomplete-popupIndicatorOpen":{transform:"rotate(0deg)"}}:{}),"data-testid":d?`${d}:Autocomplete`:void 0,disablePortal:D,multiple:!0,getOptionLabel:g=>typeof g=="string"?g:g.label,loading:M?I:!1,options:[...a,...A!=null?A:[]],filterSelectedOptions:!0,includeInputInList:!0,value:a,onChange:(g,v,C)=>{n(v,C,g)},onInputChange:(g,v)=>O(v),noOptionsText:M?y:"Start typing to search",loadingText:w,popupIcon:x,renderInput:g=>o.jsx(i.TextField,E(u({},g),{label:s,fullWidth:!0,variant:m,error:j,helperText:k,InputProps:E(u({},g.InputProps),{endAdornment:o.jsxs(o.Fragment,{children:[I?o.jsx(i.CircularProgress,{color:"inherit",size:20}):null,g.InputProps.endAdornment]})}),"data-testid":d?`${d}:Autocomplete:TextField`:void 0,onKeyDown:v=>{(v.key==="Backspace"||v.key==="Delete")&&v.stopPropagation()},color:p})),renderTags:()=>null,isOptionEqualToValue:(g,v)=>g.id===v.id,renderOption:(g,v,C)=>{if(t){const S=ot.default(v.label,C.inputValue,{insideWords:!0,findAllOccurrences:!0}),G=nt.default(v.label,S);return f.createElement("li",E(u({},g),{key:v.id,"data-testid":d?`${d}:Autocomplete:option(${v.id.toString()})`:void 0}),o.jsx("div",{children:G.map((re,qe)=>o.jsx("span",{style:{fontWeight:re.highlight?700:400},children:re.text},qe))}))}else return f.createElement("li",E(u({},g),{key:v.id,"data-testid":d?`${d}:option(${v.id.toString()})`:void 0}),v.label)}}),a.length>0&&o.jsx(i.Box,{sx:c,children:a.map(g=>o.jsx(i.Chip,{sx:{marginTop:1,marginRight:1,height:"auto"},label:o.jsx(i.Tooltip,{title:g.tooltipContent||"",placement:"bottom-start",PopperProps:{modifiers:[{name:"offset",options:{offset:[115,-15]}}]},children:o.jsx(i.Typography,{style:{whiteSpace:"normal"},children:g.chipLabel?g.chipLabel:g.label})}),"data-testid":d?`${d}:Chip(${g.id.toString()})`:void 0,onDelete:v=>L(v,g.id),deleteIcon:o.jsx(Y.Cancel,{"data-testid":d?`${d}:Chip(${g.id.toString()}):deleteIcon`:void 0})},g.id))})]})}const Lt=/MUI: The value provided to.*is invalid/i,Mt=({lookup:e=()=>F(exports,null,function*(){}),onChange:t,label:n,value:r,sx:s,textFieldColor:a,textFieldVariant:d="filled",error:l=!1,"data-testid":c,noOptionsText:p="No options",minLength:m=3,disablePortal:w=!1,preLoadedOptions:y,helperText:x="",disabled:j,popupIcon:k,disableIconFlip:h})=>{const[D,B]=f.useState(""),{data:_,isLoading:O}=oe({inputValue:D,label:n,lookup:e,minLength:m!=null?m:0,preLoadedOptions:y}),L=D.length>=m;return o.jsx("div",{"data-testid":c,children:o.jsx(i.Stack,{direction:"row",spacing:1,children:o.jsx(i.Autocomplete,{sx:u(u({},s),h?{".MuiAutocomplete-popupIndicatorOpen":{transform:"rotate(0deg)"}}:{}),"data-testid":c?`${c}:Autocomplete`:void 0,loading:L?O:!1,options:_!=null?_:[],onChange:(A,I,M)=>{t(A,I,M)},disablePortal:w,filterOptions:A=>A,value:r,noOptionsText:L?p:"Start typing to search",getOptionLabel:A=>A.label,popupIcon:k,renderInput:A=>o.jsx(i.TextField,E(u({"data-testid":c?`${c}:Autocomplete:TextField`:void 0},A),{variant:d,label:n,color:a,error:l,helperText:x})),isOptionEqualToValue:(A,I)=>A.id===I.id,onInputChange:(A,I)=>{B(I)},renderOption:(A,I)=>f.createElement("li",E(u({},A),{key:I.id,"data-testid":c?`${c}:Autocomplete:option(${I.id.toString()})`:void 0}),I.label),disabled:j})})})},Me=e=>{if(!e)return-1;try{const n=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),r=decodeURIComponent(Ze.Buffer.from(n,"base64").toString("utf8").split("").map(function(a){return"%"+("00"+a.charCodeAt(0).toString(16)).slice(-2)}).join("")),s=JSON.parse(r);return s!=null&&s.exp?s.exp:-1}catch(t){return-1}},Pt=({open:e=!1,closeHandler:t,setAuth0ExpiryTime:n})=>{const{logout:r,getAccessTokenSilently:s}=J.useAuth0(),[a,d]=f.useState(0),l=()=>F(exports,null,function*(){r({logoutParams:{returnTo:`${window.location.origin}`}})}),c=()=>F(exports,null,function*(){d(a+1),t()});f.useEffect(()=>{F(exports,null,function*(){if(a>0){const y=yield s({cacheMode:"off"}),x=Me(y)*1e3;n(x)}})},[a,s,n]);const p={text:"Continue",onClick:c,disabled:!1,testId:"PreferencesDialog",buttonColor:"secondary"},m={text:"Log out",onClick:l,disabled:!1,testId:"PreferencesDialog",buttonColor:"secondary"};return o.jsx(te,{isOpen:e,primaryButton:p,secondaryButton:m,onClose:t,dialogTitle:"Session expiry",disableCloseOnBackdropOrEscape:!0,children:o.jsx("p",{style:{marginBottom:0},children:"Your session is about to time out due to inactivity. Do you want to continue?"})})};function Rt(e){return"error"in e}function Ot(e){var r;const t=e.error,n=(r=e==null?void 0:e.error_description)!=null?r:"";return t==="access_denied"&&n.startsWith("You do not have the required authorization")}function Ht(e){var r;const t=e.error,n=(r=e==null?void 0:e.error_description)!=null?r:"";return t==="access_denied"&&n.startsWith("User did not authorize the request")}function qt(e){var r;const t=e.error,n=(r=e==null?void 0:e.error_description)!=null?r:"";return t==="access_denied"&&n.match(/Script.*time.*exceeded/)}function Ut({children:e,appName:t="the app",throwErrors:n="none",disableConsoleLogging:r=!1,onError:s=()=>{}}){var w,y;const{isAuthenticated:a,isLoading:d,error:l,loginWithRedirect:c,logout:p}=J.useAuth0();f.useEffect(()=>{l&&s(l)},[l,s]);const m=f.useMemo(()=>({appState:{returnTo:`${window.location.pathname}${window.location.search}`}}),[]);if(f.useEffect(()=>{d||a||l||c(m)},[d,a,l,c,s,m]),l){if(r||console.error(`Error detected in AuthGuard [isAuthenticated=${a},isLoading=${d}]`,l),n==="all")throw l;if(Rt(l)){let x="Auth error",j="An unknown Auth0 error occurred.";if(Ot(l))x="Unauthorised",j=`You are not authorised to access ${t}.`;else if(Ht(l))x="App not authorised",j=`You have not authorised ${t} to access your user profile. This is necessary to use ${t}.`;else if(qt(l))x="Auth0 script execution time exceeded",j="The Auth0 login flow exceeded the time limit (20s). Try again in a minute by clicking the RELOAD button below.";else if(l.message==="Invalid state"){const k=localStorage.getItem("auth0_redirect_count");k?k&&parseInt(k)<2&&(localStorage.setItem("auth0_redirect_count",String(parseInt(k)+1)),c(m)):(localStorage.setItem("auth0_redirect_count","1"),c(m))}else if(n==="unknown")throw l;return o.jsxs(i.Dialog,{open:!0,children:[o.jsx(i.DialogTitle,{children:x}),o.jsxs(i.DialogContent,{children:[o.jsx(i.Typography,{children:j}),o.jsx("br",{}),o.jsx(i.Typography,{variant:"subtitle2",children:"Details from Auth0"}),o.jsxs(i.Typography,{variant:"body2",children:["error: ",(w=l==null?void 0:l.error)!=null?w:"N/A"]}),o.jsxs(i.Typography,{variant:"body2",children:["description: ",(y=l==null?void 0:l.error_description)!=null?y:"N/A"]})]}),o.jsxs(i.DialogActions,{children:[x==="Auth0 script execution time exceeded"&&o.jsx(i.Button,{href:window.location.origin+window.location.pathname,children:"Reload"}),o.jsx(i.Button,{onClick:()=>p({logoutParams:{returnTo:window.location.origin}}),children:"Logout"})]})]})}else if(n==="unknown")throw l}return a?(localStorage.removeItem("auth0_redirect_count"),o.jsx(o.Fragment,{children:e})):o.jsx(rt.default,{variant:"rectangular",animation:"pulse",height:"100vh",width:"100vw"})}const Wt={autoHideDuration:6e3,anchorOrigin:{vertical:"top",horizontal:"center"},disableWindowBlurListener:!1},Vt={shouldClose:(e,t)=>t!=="clickaway"},xe={message:"",severity:"info",variant:"standard",progressIndicator:void 0},fe=100,Ae=2e3,zt=2e3,Gt=(()=>{let e=0;return()=>(e+=1,e)})(),Xt={borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px"},Yt={},Kt={},ne=f.createContext(null);function Pe(a){var d=a,{overrideState:e=Yt,overrideActions:t=Kt,shouldClose:n=Vt.shouldClose,children:r}=d,s=ae(d,["overrideState","overrideActions","shouldClose","children"]);var v;const[{open:l},c]=f.useState({open:!1}),p=f.useRef([]),m=f.useRef(Date.now()),w=f.useRef(0),y=f.useCallback(C=>{c({open:C})},[]),x=f.useCallback((C={})=>{w.current+=1,p.current.length>=fe&&Date.now()-m.current>=Ae&&(m.current=Date.now(),console.error(`SaladBarProvider: MAX_QUEUE_LENGTH (${fe}) hit ${w.current} times in last ${Ae}ms)`),w.current=0);const S=u(E(u({},xe),{key:Gt()}),C);return p.current.push(S),p.current.length===1&&c({open:!0}),S.key},[]),j=(C="",S={})=>x(u({message:C,severity:"success"},S)),k=(C="",S={})=>x(u({message:C,severity:"info"},S)),h=(C="",S={})=>x(u({message:C,severity:"warning"},S)),D=(C="",S={})=>x(u({message:C,severity:"error"},S)),B=C=>{const S=p.current.findIndex(G=>G.key===C);if(S!==-1)return S===0?(c({open:!1}),p.current[0]):p.current.splice(S,1)},_=(C,S)=>{n(C,S)&&c({open:!1})},O=()=>{},L=()=>{p.current.shift(),p.current.length>0&&c({open:!0})},A=(v=p.current[0])!=null?v:u({},xe),I={};"autoHideDuration"in A&&(I.autoHideDuration=A.autoHideDuration);const M=u(u({},Wt),s),g=u(u({open:l,setOpen:y,enqueueNotification:x,enqueueSuccessNotification:j,enqueueInfoNotification:k,enqueueWarningNotification:h,enqueueErrorNotification:D,removeNotification:B},e),t);return o.jsxs(ne.Provider,{value:g,children:[r,o.jsx(i.Snackbar,E(u(u({},M),I),{open:l,onClose:_,TransitionProps:{onExited:L,onExit:O},sx:{zIndex:zt},children:o.jsxs("div",{children:[o.jsx(i.Alert,{onClose:C=>_(C,"closeAlert"),severity:A.severity,variant:"filled",icon:A.progressIndicator==="circular"?o.jsx(i.CircularProgress,{size:"1em"}):void 0,style:A.progressIndicator==="linear"?Xt:void 0,children:A.message}),A.progressIndicator==="linear"&&o.jsx(i.LinearProgress,{color:"primary"})]})}))]})}function Re(){const e=f.useContext(ne);if(e===null)throw new z("Error: Tried to useSaladBar outside of a <SaladBarProvider>");return e}const Qt=Q.createHelper((e={autoHideDuration:1},t={},n={})=>({children:r})=>o.jsx(Pe,E(u({},e),{overrideState:t,overrideActions:n,children:r}))),Oe="domainCode";var Ce;const ve=b.atom(JSON.parse((Ce=localStorage.getItem(Oe))!=null?Ce:'{"domainCode": ""}').domainCode),He=b.atom(e=>e(ve),(e,t,n)=>{t(ve,n),localStorage.setItem(Oe,JSON.stringify({domainCode:n}))}),Jt={act:"ACT",nsw:"NSW",nt:"NT",qld:"QLD",sa:"SA",tas:"TAS",vic:"VIC",wa:"WA",ag:"AG",fedmps:"Fedmps","":""},Zt=e=>{var t;return e===null?"N/A":(t=Jt[e])!=null?t:""},eo=({isLoading:e,isOpen:t,onClose:n,onDomainChange:r,domainOptions:s,applicationName:a,handleLogout:d})=>{const[l,c]=b.useAtom(He),[p,m]=f.useState(l),{enqueueSuccessNotification:w}=Re(),y=s.length===0,x=!!l&&!s.includes(l)&&!s.includes(p),j=!l||y||x,k=()=>F(exports,null,function*(){p?(c(p),r==null||r(p),w(`Set organisation to ${p}`),n()):(c(""),r==null||r(""))}),h=()=>F(exports,null,function*(){l&&!y&&!x?(m(l),n()):j&&d()});let D;return y?D="Unable to retrieve your active organisations. Try logging in again.":x&&(D="You no longer have any roles in your chosen organisation. Please choose another."),o.jsxs(te,{isOpen:t,dialogTitle:"Select an organisation",primaryButton:{text:"Confirm",onClick:k,disabled:!p||y||x,buttonColor:"primary"},secondaryButton:{text:j?"Logout":"Cancel",onClick:h},onClose:j?()=>{}:n,children:[o.jsxs(i.Typography,{marginBottom:2,children:["Select the default organisation that you want to use with the ",a,"."]}),o.jsx(i.Autocomplete,{loading:e,multiple:!1,disableClearable:!1,value:p!==""?p:null,onChange:(B,_)=>m(_!=null?_:""),getOptionLabel:Zt,options:[...s],renderInput:B=>o.jsx(i.TextField,E(u({},B),{variant:"filled",label:"Select organisation",InputProps:E(u({},B.InputProps),{endAdornment:o.jsxs(o.Fragment,{children:[e?o.jsx(i.CircularProgress,{color:"inherit",size:20,sx:{marginTop:"-20px"}}):null,B.InputProps.endAdornment]})})}))}),D&&o.jsx(i.FormHelperText,{error:!0,children:D})]})},to=T.createTheme({palette:{primary:{dark:"#00A651",light:"#A3D39C",main:"#007236",contrastText:"#FFF"},warning:{main:"#F5871F",light:"#FCC589",dark:"#A2590A",contrastText:"#FFF"},secondary:{main:"#662D91",light:"#BD8CBF",dark:"#440E62",contrastText:"#FFF"},error:{main:"#D43C95",light:"#8F2064",dark:"#F9CDE0",contrastText:"#FFF"},info:{main:"#00A88D",light:"#ADDCCF",dark:"#005243",contrastText:"#FFF"},success:{main:"#00A651",light:"#A3D39C",dark:"#007236",contrastText:"#FFF"}},typography:{explainer:{fontSize:"14px",marginBlockStart:"1em"}},navBar:{backgroundColor:"#E8E8E8"}}),oo=T.createTheme({palette:{primary:{main:"#007236",dark:"#005221",light:"#00A04E",contrastText:"#FFFFFF"},secondary:{main:"#662D91",dark:"#440E62",light:"#93268F",contrastText:"#FFFFFF"},error:{main:"#D32F2F",dark:"#C62828",light:"#EF5350"},info:{main:"#0288D1",dark:"#01579B",light:"#03A9F4"},success:{main:"#0288D1",dark:"#01579B",light:"#03A9F4"}},components:{MuiTextField:{defaultProps:{color:"secondary"}},MuiToggleButtonGroup:{defaultProps:{color:"secondary"}},MuiCheckbox:{defaultProps:{color:"secondary"}},MuiSelect:{defaultProps:{color:"secondary"}},MuiSwitch:{defaultProps:{color:"secondary"}},MuiFormControl:{defaultProps:{color:"secondary"}},MuiMenuItem:{styleOverrides:{root:({theme:e})=>({"&.Mui-selected":{backgroundColor:T.alpha(e.palette.secondary.main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:T.alpha(e.palette.secondary.main,e.palette.action.selectedOpacity)},"&.Mui-focusVisible":{backgroundColor:T.alpha(e.palette.secondary.main,e.palette.action.focusOpacity)}}})}}},typography:{h4:{fontSize:"1.88rem",fontWeight:500},h5:{fontWeight:500},explainer:{fontSize:"14px",marginBlockStart:"1em"}},navBar:{backgroundColor:"#E8E8E8"}});exports.AgDialog=te;exports.AppLayout=Nt;exports.AuthGuard=Ut;exports.Context=ne;exports.ContextError=z;exports.DomainCodeDialog=eo;exports.ExampleComponent=it;exports.FetchAutocomplete=$t;exports.MUI_AUTOCOMPLETE_VALUE_WARNING_REGEX=Lt;exports.NAVBAR_WIDTH_CLOSED=ee;exports.NAVBAR_WIDTH_OPENED=Z;exports.NavBar=xt;exports.NavBarDarkStyledList=gt;exports.NavBarLightStyledList=mt;exports.NavBarProvider=De;exports.SaladBarProvider=Pe;exports.SessionExpiryDialog=Pt;exports.SingleAutocomplete=Mt;exports.buildNavBarState=ke;exports.determineUserLevelFromClaims=bt;exports.domainCodeAtom=He;exports.fed21Theme=to;exports.getAuth0Expiry=Me;exports.internalAgSystemsTheme=oo;exports.navBarClasses=$;exports.navBarOpenAtom=q;exports.navBarTopAtom=Te;exports.navBarWidthClosedAtom=Ie;exports.navBarWidthOpenAtom=Be;exports.simpleHashCode=Le;exports.suppressConsole=jt;exports.titleTextAtom=K;exports.topBarHeightAtom=Fe;exports.topBarMiddleAtom=_e;exports.unsuppressConsole=Dt;exports.useAutocompleteOptions=oe;exports.useNavBar=be;exports.useSaladBar=Re;exports.useValidDomains=kt;exports.withBrowserRouter=ht;exports.withNavBarProvider=pt;exports.withSaladBarProvider=Qt;
1
+ "use strict";var Ue=Object.defineProperty,We=Object.defineProperties;var Ve=Object.getOwnPropertyDescriptors;var U=Object.getOwnPropertySymbols;var ie=Object.prototype.hasOwnProperty,se=Object.prototype.propertyIsEnumerable;var X=(e,t,n)=>t in e?Ue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,u=(e,t)=>{for(var n in t||(t={}))ie.call(t,n)&&X(e,n,t[n]);if(U)for(var n of U(t))se.call(t,n)&&X(e,n,t[n]);return e},B=(e,t)=>We(e,Ve(t));var ae=(e,t)=>{var n={};for(var r in e)ie.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&U)for(var r of U(e))t.indexOf(r)<0&&se.call(e,r)&&(n[r]=e[r]);return n};var le=(e,t,n)=>X(e,typeof t!="symbol"?t+"":t,n);var F=(e,t,n)=>new Promise((r,s)=>{var a=c=>{try{l(n.next(c))}catch(p){s(p)}},d=c=>{try{l(n.throw(c))}catch(p){s(p)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(a,d);l((n=n.apply(e,t)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),f=require("react"),i=require("@mui/material"),ze=require("@mui/material/CssBaseline"),T=require("@mui/material/styles"),Q=require("souvlaki"),Ge=require("react-router-dom"),Xe=require("@mui/material/List"),Y=require("@mui/icons-material"),D=require("jotai"),Ye=require("jotai/utils"),Ke=require("react-avatar"),J=require("@auth0/auth0-react"),ye=require("@tanstack/react-query"),Qe=require("autosuggest-highlight/match"),Je=require("autosuggest-highlight/parse"),Ze=require("buffer"),et=require("@mui/material/Skeleton"),R=e=>e&&e.__esModule?e:{default:e},tt=R(ze),Se=R(Xe),ce=R(Ke),ot=R(Qe),nt=R(Je),rt=R(et);function it({text:e}){const[t,n]=f.useState(0);return o.jsxs(o.Fragment,{children:[o.jsx(i.Typography,{variant:"h6",color:"inherit",component:"div",sx:{fontSize:"22px"},children:"Hello world"}),o.jsx(i.Typography,{variant:"caption",display:"block",children:o.jsx("span",{children:"Just ensuring MUI is working as planned as a peer dependency. v0.0.11"})}),o.jsx(i.Button,{variant:"outlined",onClick:()=>n(r=>r+1),"aria-label":"Increment",children:"Hello I am a button"}),o.jsxs("p",{children:["This is some text: ",o.jsx("span",{children:e})]}),o.jsxs(i.Paper,{children:["This number will incremember when button pressed: ",t]})]})}const Z=330,ee=73,N="Navbar",$={root:`${N}-root`,menuButton:`${N}-menuButton`,hide:`${N}-hide`,content:`${N}-content`,userInfoHolder:`${N}-userInfoHolder`,settings:`${N}-settings`,pieChartIcon:`${N}-pieChartIcon`},st=T.styled(i.Box,{name:"NavBar"})(({theme:e})=>({[`&.${$.root}`]:{display:"flex"},[`& .${$.menuButton}`]:{marginRight:36},[`& .${$.hide}`]:{display:"none"},[`& .${$.content}`]:{flexGrow:1,padding:e.spacing(3)},[`& .${$.userInfoHolder}`]:{height:"148px",marginTop:"64px",marginBottom:"16px"}})),we=()=>({position:"absolute",height:"100%",overflowX:"hidden",overflowY:"hidden",color:"white",backgroundColor:"black"}),at=()=>u({width:Z},we()),lt=()=>u({width:ee},we()),ct=T.styled(i.Drawer,{shouldForwardProp:e=>e!=="open"})(({theme:e,open:t})=>u(u({width:t?Z:ee,flexShrink:0,whiteSpace:"nowrap",boxSizing:"border-box",zIndex:e.zIndex.drawer+100},t&&{"& .MuiDrawer-paper":at()}),!t&&{"& .MuiDrawer-paper":lt()}));class z extends Error{}le(z,"errorName","ContextError");const je=f.createContext(null),dt={},ut={},be=({overrideState:e=dt,overrideActions:t=ut,children:n})=>{const[{open:r},s]=f.useState({open:!0}),a=f.useCallback(c=>{s({open:c})},[]),d=f.useCallback(()=>{s(c=>B(u({},c),{open:!c.open}))},[]),l=u(u({open:r,setOpen:a,toggleOpen:d},e),t);return o.jsx(je.Provider,{value:l,children:n})},De=()=>{const e=f.useContext(je);if(e===null)throw new z("Error: Tried to useNavBar outside of a <NavBarProvider>");return e},ke=(e={})=>u({open:!0},e),pt=Q.createHelper((e=ke(),t={})=>({children:n})=>o.jsx(be,{overrideState:e,overrideActions:t,children:n})),ht=Q.createHelper(()=>({children:e})=>o.jsx(Ge.BrowserRouter,{children:e})),de=7,gt=T.styled(Se.default)(({theme:e})=>({backgroundColor:"black",color:"white","& .MuiListItem-root":{padding:"unset"},"& .MuiListItemButton-root":{" .MuiListItemIcon-root":{color:"white",padding:`${de}px`},"&.Mui-focusVisible":{backgroundColor:e.palette.grey[700]},"&.Mui-selected":{borderLeftStyle:"solid",borderLeftWidth:"7px",borderLeftColor:e.palette.primary.main,paddingLeft:`calc(${e.spacing(2)} - ${de}px)`},"&:hover":{backgroundColor:e.palette.primary.dark},"&.Mui-selected.Mui-focusVisible":{backgroundColor:e.palette.grey[700]},"&.Mui-selected:hover":{backgroundColor:e.palette.primary.dark}}})),ue=7,mt=T.styled(Se.default)(({theme:e})=>({backgroundColor:"#e8e8e8",color:"inherit","& .MuiListItem-root":{padding:"unset"},"& .MuiListItemButton-root":{" .MuiListItemIcon-root":{color:"inherit",padding:`${ue}px`},"&.Mui-focusVisible":{backgroundColor:e.palette.grey[700]},"&.Mui-selected":{borderLeftStyle:"solid",borderLeftWidth:"7px",borderLeftColor:e.palette.primary.main,paddingLeft:`calc(${e.spacing(2)} - ${ue}px)`},"&:hover":{backgroundColor:e.palette.primary.dark},"&.Mui-selected.Mui-focusVisible":{backgroundColor:e.palette.grey[700]},"&.Mui-selected:hover":{backgroundColor:e.palette.primary.dark}}}));function xt({"data-testid":e,children:t}){const{open:n}=De();return o.jsxs(st,{className:$.root,"data-testid":e,children:[o.jsx(tt.default,{}),o.jsx(ct,{variant:"permanent",anchor:"left",transitionDuration:null,open:n,children:t})]})}const Be=()=>{const e=i.useTheme();return i.useMediaQuery(e.breakpoints.down("sm"))},ft=64,At=72,vt=256,q=D.atom(!0),Ee=D.atom(vt),Ie=D.atom(At),K=D.atom(""),_e=D.atom(void 0),Fe=D.atom(ft),Te=D.atom(void 0);function Ct({links:e}){return o.jsx("div",{children:"LinksMenu not implemented yet"})}const W="Navbar",H={root:`${W}-root`,menuButton:`${W}-menuButton`,hide:`${W}-hide`,content:`${W}-content`},yt=T.styled(i.Box,{name:"NavBar"})(({theme:e})=>({[`&.${H.root}`]:{display:"flex"},[`& .${H.menuButton}`]:{marginRight:36},[`& .${H.hide}`]:{display:"none"},[`& .${H.content}`]:{flexGrow:1,padding:e.spacing(3)}})),P=(e,t,n)=>e.transitions.create(t,{easing:e.transitions.easing.sharp,duration:n==="leaving"?e.transitions.duration.leavingScreen:e.transitions.duration.enteringScreen}),St=e=>{const t=i.useTheme();return o.jsx(i.Collapse,u({easing:t.transitions.easing.sharp,timeout:{enter:t.transitions.duration.enteringScreen,exit:t.transitions.duration.leavingScreen}},e))},Ne=e=>{var t,n;return{overflowX:"hidden",color:"inherit",backgroundColor:(n=(t=e==null?void 0:e.navBar)==null?void 0:t.backgroundColor)!=null?n:"white"}},pe=(e,t)=>u({width:t,transition:P(e,"width","entering")},Ne(e)),he=(e,t)=>u({width:t,transition:P(e,"width","leaving")},Ne(e)),wt=T.styled(i.Drawer,{shouldForwardProp:e=>!["widthOpen","widthClosed","isSmallScreen"].includes(e)})(({theme:e,open:t,widthOpen:n,widthClosed:r,isSmallScreen:s})=>u(u({flexShrink:0,whiteSpace:"nowrap",boxSizing:"border-box",display:"flex",flexDirection:"column"},t&&B(u({},pe(e,n)),{backgroundColor:"","& .MuiDrawer-paper":pe(e,n)})),!t&&B(u({},he(e,s?n:r)),{backgroundColor:"","& .MuiDrawer-paper":he(e,s?n:r)})));function $e(e){return e.replace(/(^|-)([a-z])/g,(t,n,r)=>n==="-"?" "+r.toUpperCase():r.toUpperCase())}function jt(e,t,n,r){var d;if(!e)return"None";const a=Object.entries(e).filter(([l,c])=>l.startsWith("https://greens.org.au/roles/")&&c.includes(t)).map(([l])=>{var c;return $e((c=l.split("/").at(-1))!=null?c:"")});return(d=r.find(l=>n[l].some(c=>a.includes(c))))!=null?d:"None"}const bt=e=>{const{getIdTokenClaims:t,user:n}=J.useAuth0();return ye.useQuery({queryKey:["availableDomains",n==null?void 0:n.sub],queryFn:()=>F(exports,null,function*(){const r=yield t();return r?Object.entries(r).reduce((s,[a,d])=>{var p;const l=$e((p=a.split("/").at(-1))!=null?p:""),c=a.startsWith("https://greens.org.au/roles/")&&e.includes(l)?d:[];return[...new Set([...s,...c])]},[]):[]})})},Dt=e=>Object.values(e).reduce((t,n)=>[...new Set([...t,...n])],[]),V={log:console.warn.bind(console),error:console.error.bind(console),warn:console.warn.bind(console),info:console.info.bind(console),debug:console.debug.bind(console)};function kt(e,t){console[e]=(...n)=>{for(const r of t)if(typeof r=="function"){if(r(...n))return}else if(r instanceof RegExp&&n.length>0){for(const s of n)if(typeof s=="string"&&r.test(s))return}V[e](n)}}function Bt(e){if(e)console[e]=V[e];else for(const t of Object.keys(V))console[t]=V[t]}function Le(e){let t=0;for(let n=0,r=e.length;n<r;n++){const s=e.charCodeAt(n);t=(t<<5)-t+s,t|=0}return t}const ge=["#A62A21","#7e3794","#0B51C1","#3A6024","#A81563","#B3003C"],me=e=>e.split(/\s/).map(t=>t.substring(0,1).toUpperCase()).filter(t=>!!t).slice(0,2).join("").toUpperCase();function Et({user:e,domainCode:t,open:n,useNewAvatar:r=!1}){const s=i.useTheme();return o.jsxs(i.Box,{sx:{paddingTop:3,display:"flex",alignItems:"center",flexDirection:"column",gap:"0.5rem"},children:[!r&&o.jsx(i.Box,{sx:{width:n?"5rem":"2rem",transition:n?P(s,["width","height"],"entering"):P(s,["width","height"],"leaving"),aspectRatio:1},children:e!=null&&e.name?o.jsx(o.Fragment,{children:o.jsx(i.Avatar,{src:e==null?void 0:e.picture,sx:{width:"100%",height:"100%",bgcolor:ge[Math.abs(Le(e==null?void 0:e.name))%ge.length]},children:me(e==null?void 0:e.name)})}):o.jsx(i.Avatar,{sx:{width:"100%",height:"100%"}})}),r&&o.jsx(i.Box,{sx:{width:n?"5rem":"2rem",transition:n?P(s,["width","height"],"entering"):P(s,["width","height"],"leaving"),aspectRatio:1},children:e!=null&&e.name?o.jsx(o.Fragment,{children:o.jsxs(ce.default,{src:e==null?void 0:e.picture,name:e==null?void 0:e.name,round:!0,size:n?"80":"32",children:[" ",me(e==null?void 0:e.name)," ","ab"]})}):o.jsx(ce.default,{})}),o.jsx(St,{sx:{width:"100%"},in:n,children:o.jsx(i.Fade,{in:n,children:o.jsxs(i.Box,{width:"100%",display:"flex",flexDirection:"column",alignItems:"center",children:[e!=null&&e.name?o.jsx(i.Typography,{children:e==null?void 0:e.name}):o.jsx(i.Skeleton,{animation:!1,width:"50%"}),t?o.jsx(i.Typography,{children:t.toUpperCase()}):o.jsx(i.Skeleton,{animation:!1,width:"25%"})]})})})]})}function It({open:e,widthClosed:t,widthOpen:n,"data-testid":r,top:s,middle:a,bottom:d,user:l,domainCode:c,useNewAvatar:p=!1}){const m=Be(),w=D.useSetAtom(q);return o.jsx(yt,{className:H.root,"data-testid":r,children:o.jsxs(wt,{open:e,widthOpen:n,widthClosed:t,anchor:"left",variant:m?"temporary":"permanent",PaperProps:{component:"nav"},onClose:()=>{w(!1)},isSmallScreen:m,children:[!m&&o.jsx(i.Toolbar,{}),s&&o.jsxs(i.Box,{flexGrow:"0",children:[s,o.jsx(i.Divider,{variant:"middle",sx:{marginY:"0.5rem"}})]}),o.jsx(i.Box,{flexGrow:"1",children:Array.isArray(a)?o.jsx(Ct,{links:a}):a}),o.jsxs(i.Box,{flexGrow:"0",children:[o.jsx(i.Divider,{variant:"middle",sx:{marginY:"0.5rem"}}),o.jsx(Et,{user:l,domainCode:c,open:e,useNewAvatar:p}),d&&o.jsx(o.Fragment,{children:d})]})]})})}function _t({children:e,topBarHeight:t,maxWidth:n=!1,noPadding:r}){return o.jsx(i.Box,{sx:{overflow:"auto",height:`calc(100vh - ${t}px)`,flexGrow:1},children:r?o.jsx(i.Box,{component:"main",id:"main-content",height:"inherit",children:e}):o.jsx(i.Container,{component:"main",id:"main-content",maxWidth:n,sx:{paddingTop:3,paddingBottom:3,flexGrow:1},children:e})})}const Ft="TopBar",Tt={titleText:`${Ft}-titleText`};function Nt({titleText:e="",height:t,"data-testid":n,middle:r}){const s=D.useSetAtom(q),a=()=>s(c=>!c),d=i.useTheme(),l=Be();return o.jsx("header",{"data-testid":n,children:o.jsxs(i.Paper,{square:!0,elevation:0,sx:{width:"100%",position:"sticky",color:"primary.contrastText",backgroundColor:"primary.main",display:"flex",alignItems:"center",gap:2,flexShrink:0,height:t,zIndex:l?0:d.zIndex.drawer+101},children:[o.jsx(i.IconButton,{size:"medium",color:"inherit",sx:{padding:1.5,marginLeft:"12px"},onClick:a,children:o.jsx(Y.ViewHeadline,{fontSize:"medium"})}),o.jsx(i.Typography,{className:Tt.titleText,variant:"h6",component:"h1",children:e}),r]})})}function $t({children:e,initialTitleText:t,initialNavBarOpen:n,pageContainerProps:r,pageContentDataTestId:s,topBarDataTestId:a,navBarDataTestId:d,navBarMiddle:l,navBarBottom:c,user:p,domainCode:m,useNewAvatar:w=!1}){Ye.useHydrateAtoms([[q,n!=null?n:!0],[K,t!=null?t:""]]);const y=D.useAtomValue(q),[x]=D.useAtom(Ee),[j]=D.useAtom(Ie),k=D.useAtomValue(K),[h]=D.useAtom(Fe),[b]=D.useAtom(_e),[E]=D.useAtom(Te);return o.jsxs(i.Box,{children:[o.jsx(i.CssBaseline,{}),o.jsx(Nt,{titleText:k,"data-testid":a,height:h,middle:b}),o.jsxs(i.Box,{sx:{display:"flex"},children:[o.jsx(It,{open:y,top:E,middle:l,bottom:c,user:p,domainCode:m,widthOpen:x,widthClosed:j,offsetTop:h,"data-testid":d,useNewAvatar:w}),o.jsx(_t,B(u({"data-testid":s,topBarHeight:h},r),{children:e}))]})]})}const te=({isOpen:e,dialogTitle:t,children:n,maxWidth:r,primaryButton:s,secondaryButton:a,additionalButtons:d,onClose:l,sx:c,"data-testid":p,disableCloseOnBackdropOrEscape:m=!1,isLoading:w=!1})=>{var j,k;const[y,x]=f.useState(!1);return o.jsxs(i.Dialog,{open:e,onClose:(h,b)=>F(exports,null,function*(){m&&(b==="backdropClick"||b==="escapeKeyDown")||y||(a!=null&&a.onClick?yield a.onClick():l())}),fullWidth:!0,maxWidth:r!=null?r:"xs","data-testid":p,sx:c,children:[w&&o.jsx(i.LinearProgress,{sx:{height:"4px",marginBottom:"-4px"}}),o.jsx(i.DialogTitle,{children:t}),o.jsx(i.DialogContent,{sx:{"& > :last-child":{marginBottom:0}},children:n}),o.jsxs(i.DialogActions,{children:[o.jsx(i.Button,{onClick:(j=a==null?void 0:a.onClick)!=null?j:l,"data-testid":a==null?void 0:a.testId,disabled:(a==null?void 0:a.disabled)||y,color:a==null?void 0:a.buttonColor,children:(k=a==null?void 0:a.text)!=null?k:"Cancel"}),d&&d.map((h,b)=>{var E;return o.jsx(i.Button,{onClick:h==null?void 0:h.onClick,"data-testid":h==null?void 0:h.testId,disabled:(h==null?void 0:h.disabled)||y,color:h==null?void 0:h.buttonColor,children:(E=h.text)!=null?E:`Button ${b}`},b)}),s&&o.jsx(i.Button,{onClick:()=>F(exports,null,function*(){var h;x(!0),yield(h=s.onClick)==null?void 0:h.call(s),x(!1)}),"data-testid":s.testId,disabled:s.disabled||y,color:s==null?void 0:s.buttonColor,children:s.text})]})]})},oe=({minLength:e,preLoadedOptions:t,lookup:n,label:r,inputValue:s})=>ye.useQuery({queryFn:()=>e&&s.length<e?t!=null?t:[]:t?t.filter(a=>a.label.toLowerCase().includes(s.toLowerCase())):n(s),queryKey:["autocomplete",r,s]});function Lt({lookup:e=()=>F(this,null,function*(){}),enableHighlighting:t=!0,onChange:n,minLength:r=0,label:s,value:a,"data-testid":d,sx:l,boxSx:c,textFieldColor:p,textFieldVariant:m="filled",loadingText:w="Loading...",noOptionsText:y="No options",popupIcon:x=o.jsx(Y.ArrowDropDown,{}),error:j=!1,helperText:k="",preLoadedOptions:h=void 0,disablePortal:b=!1,disableIconFlip:E=!1}){const[_,O]=f.useState(""),L=(g,v)=>{const C=a.filter(S=>S.id!==v);n(C,"delete",g)},{data:A,isLoading:I}=oe({inputValue:_,label:s,lookup:e,minLength:r,preLoadedOptions:h}),M=_.length>=r;return o.jsxs("div",{"data-testid":d,children:[o.jsx(i.Autocomplete,{sx:u(u({},l),E?{".MuiAutocomplete-popupIndicatorOpen":{transform:"rotate(0deg)"}}:{}),"data-testid":d?`${d}:Autocomplete`:void 0,disablePortal:b,multiple:!0,getOptionLabel:g=>typeof g=="string"?g:g.label,loading:M?I:!1,options:[...a,...A!=null?A:[]],filterSelectedOptions:!0,includeInputInList:!0,value:a,onChange:(g,v,C)=>{n(v,C,g)},onInputChange:(g,v)=>O(v),noOptionsText:M?y:"Start typing to search",loadingText:w,popupIcon:x,renderInput:g=>o.jsx(i.TextField,B(u({},g),{label:s,fullWidth:!0,variant:m,error:j,helperText:k,InputProps:B(u({},g.InputProps),{endAdornment:o.jsxs(o.Fragment,{children:[I?o.jsx(i.CircularProgress,{color:"inherit",size:20}):null,g.InputProps.endAdornment]})}),"data-testid":d?`${d}:Autocomplete:TextField`:void 0,onKeyDown:v=>{(v.key==="Backspace"||v.key==="Delete")&&v.stopPropagation()},color:p})),renderTags:()=>null,isOptionEqualToValue:(g,v)=>g.id===v.id,renderOption:(g,v,C)=>{if(t){const S=ot.default(v.label,C.inputValue,{insideWords:!0,findAllOccurrences:!0}),G=nt.default(v.label,S);return f.createElement("li",B(u({},g),{key:v.id,"data-testid":d?`${d}:Autocomplete:option(${v.id.toString()})`:void 0}),o.jsx("div",{children:G.map((re,qe)=>o.jsx("span",{style:{fontWeight:re.highlight?700:400},children:re.text},qe))}))}else return f.createElement("li",B(u({},g),{key:v.id,"data-testid":d?`${d}:option(${v.id.toString()})`:void 0}),v.label)}}),a.length>0&&o.jsx(i.Box,{sx:c,children:a.map(g=>o.jsx(i.Chip,{sx:{marginTop:1,marginRight:1,height:"auto"},label:o.jsx(i.Tooltip,{title:g.tooltipContent||"",placement:"bottom-start",PopperProps:{modifiers:[{name:"offset",options:{offset:[115,-15]}}]},children:o.jsx(i.Typography,{style:{whiteSpace:"normal"},children:g.chipLabel?g.chipLabel:g.label})}),"data-testid":d?`${d}:Chip(${g.id.toString()})`:void 0,onDelete:v=>L(v,g.id),deleteIcon:o.jsx(Y.Cancel,{"data-testid":d?`${d}:Chip(${g.id.toString()}):deleteIcon`:void 0})},g.id))})]})}const Mt=/MUI: The value provided to.*is invalid/i,Pt=({lookup:e=()=>F(exports,null,function*(){}),onChange:t,label:n,value:r,sx:s,textFieldColor:a,textFieldVariant:d="filled",error:l=!1,"data-testid":c,noOptionsText:p="No options",minLength:m=3,disablePortal:w=!1,preLoadedOptions:y,helperText:x="",disabled:j,popupIcon:k,disableIconFlip:h})=>{const[b,E]=f.useState(""),{data:_,isLoading:O}=oe({inputValue:b,label:n,lookup:e,minLength:m!=null?m:0,preLoadedOptions:y}),L=b.length>=m;return o.jsx("div",{"data-testid":c,children:o.jsx(i.Stack,{direction:"row",spacing:1,children:o.jsx(i.Autocomplete,{sx:u(u({},s),h?{".MuiAutocomplete-popupIndicatorOpen":{transform:"rotate(0deg)"}}:{}),"data-testid":c?`${c}:Autocomplete`:void 0,loading:L?O:!1,options:_!=null?_:[],onChange:(A,I,M)=>{t(A,I,M)},disablePortal:w,filterOptions:A=>A,value:r,noOptionsText:L?p:"Start typing to search",getOptionLabel:A=>A.label,popupIcon:k,renderInput:A=>o.jsx(i.TextField,B(u({"data-testid":c?`${c}:Autocomplete:TextField`:void 0},A),{variant:d,label:n,color:a,error:l,helperText:x})),isOptionEqualToValue:(A,I)=>A.id===I.id,onInputChange:(A,I)=>{E(I)},renderOption:(A,I)=>f.createElement("li",B(u({},A),{key:I.id,"data-testid":c?`${c}:Autocomplete:option(${I.id.toString()})`:void 0}),I.label),disabled:j})})})},Me=e=>{if(!e)return-1;try{const n=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),r=decodeURIComponent(Ze.Buffer.from(n,"base64").toString("utf8").split("").map(function(a){return"%"+("00"+a.charCodeAt(0).toString(16)).slice(-2)}).join("")),s=JSON.parse(r);return s!=null&&s.exp?s.exp:-1}catch(t){return-1}},Rt=({open:e=!1,closeHandler:t,setAuth0ExpiryTime:n})=>{const{logout:r,getAccessTokenSilently:s}=J.useAuth0(),[a,d]=f.useState(0),l=()=>F(exports,null,function*(){r({logoutParams:{returnTo:`${window.location.origin}`}})}),c=()=>F(exports,null,function*(){d(a+1),t()});f.useEffect(()=>{F(exports,null,function*(){if(a>0){const y=yield s({cacheMode:"off"}),x=Me(y)*1e3;n(x)}})},[a,s,n]);const p={text:"Continue",onClick:c,disabled:!1,testId:"PreferencesDialog",buttonColor:"secondary"},m={text:"Log out",onClick:l,disabled:!1,testId:"PreferencesDialog",buttonColor:"secondary"};return o.jsx(te,{isOpen:e,primaryButton:p,secondaryButton:m,onClose:t,dialogTitle:"Session expiry",disableCloseOnBackdropOrEscape:!0,children:o.jsx("p",{style:{marginBottom:0},children:"Your session is about to time out due to inactivity. Do you want to continue?"})})};function Ot(e){return"error"in e}function Ht(e){var r;const t=e.error,n=(r=e==null?void 0:e.error_description)!=null?r:"";return t==="access_denied"&&n.startsWith("You do not have the required authorization")}function qt(e){var r;const t=e.error,n=(r=e==null?void 0:e.error_description)!=null?r:"";return t==="access_denied"&&n.startsWith("User did not authorize the request")}function Ut(e){var r;const t=e.error,n=(r=e==null?void 0:e.error_description)!=null?r:"";return t==="access_denied"&&n.match(/Script.*time.*exceeded/)}function Wt({children:e,appName:t="the app",throwErrors:n="none",disableConsoleLogging:r=!1,onError:s=()=>{}}){var w,y;const{isAuthenticated:a,isLoading:d,error:l,loginWithRedirect:c,logout:p}=J.useAuth0();f.useEffect(()=>{l&&s(l)},[l,s]);const m=f.useMemo(()=>({appState:{returnTo:`${window.location.pathname}${window.location.search}`}}),[]);if(f.useEffect(()=>{d||a||l||c(m)},[d,a,l,c,s,m]),l){if(r||console.error(`Error detected in AuthGuard [isAuthenticated=${a},isLoading=${d}]`,l),n==="all")throw l;if(Ot(l)){let x="Auth error",j="An unknown Auth0 error occurred.";if(Ht(l))x="Unauthorised",j=`You are not authorised to access ${t}.`;else if(qt(l))x="App not authorised",j=`You have not authorised ${t} to access your user profile. This is necessary to use ${t}.`;else if(Ut(l))x="Auth0 script execution time exceeded",j="The Auth0 login flow exceeded the time limit (20s). Try again in a minute by clicking the RELOAD button below.";else if(l.message==="Invalid state"){const k=localStorage.getItem("auth0_redirect_count");k?k&&parseInt(k)<2&&(localStorage.setItem("auth0_redirect_count",String(parseInt(k)+1)),c(m)):(localStorage.setItem("auth0_redirect_count","1"),c(m))}else if(n==="unknown")throw l;return o.jsxs(i.Dialog,{open:!0,children:[o.jsx(i.DialogTitle,{children:x}),o.jsxs(i.DialogContent,{children:[o.jsx(i.Typography,{children:j}),o.jsx("br",{}),o.jsx(i.Typography,{variant:"subtitle2",children:"Details from Auth0"}),o.jsxs(i.Typography,{variant:"body2",children:["error: ",(w=l==null?void 0:l.error)!=null?w:"N/A"]}),o.jsxs(i.Typography,{variant:"body2",children:["description: ",(y=l==null?void 0:l.error_description)!=null?y:"N/A"]})]}),o.jsxs(i.DialogActions,{children:[x==="Auth0 script execution time exceeded"&&o.jsx(i.Button,{href:window.location.origin+window.location.pathname,children:"Reload"}),o.jsx(i.Button,{onClick:()=>p({logoutParams:{returnTo:window.location.origin}}),children:"Logout"})]})]})}else if(n==="unknown")throw l}return a?(localStorage.removeItem("auth0_redirect_count"),o.jsx(o.Fragment,{children:e})):o.jsx(rt.default,{variant:"rectangular",animation:"pulse",height:"100vh",width:"100vw"})}const Vt={autoHideDuration:6e3,anchorOrigin:{vertical:"top",horizontal:"center"},disableWindowBlurListener:!1},zt={shouldClose:(e,t)=>t!=="clickaway"},xe={message:"",severity:"info",variant:"standard",progressIndicator:void 0},fe=100,Ae=2e3,Gt=2e3,Xt=(()=>{let e=0;return()=>(e+=1,e)})(),Yt={borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px"},Kt={},Qt={},ne=f.createContext(null);function Pe(a){var d=a,{overrideState:e=Kt,overrideActions:t=Qt,shouldClose:n=zt.shouldClose,children:r}=d,s=ae(d,["overrideState","overrideActions","shouldClose","children"]);var v;const[{open:l},c]=f.useState({open:!1}),p=f.useRef([]),m=f.useRef(Date.now()),w=f.useRef(0),y=f.useCallback(C=>{c({open:C})},[]),x=f.useCallback((C={})=>{w.current+=1,p.current.length>=fe&&Date.now()-m.current>=Ae&&(m.current=Date.now(),console.error(`SaladBarProvider: MAX_QUEUE_LENGTH (${fe}) hit ${w.current} times in last ${Ae}ms)`),w.current=0);const S=u(B(u({},xe),{key:Xt()}),C);return p.current.push(S),p.current.length===1&&c({open:!0}),S.key},[]),j=(C="",S={})=>x(u({message:C,severity:"success"},S)),k=(C="",S={})=>x(u({message:C,severity:"info"},S)),h=(C="",S={})=>x(u({message:C,severity:"warning"},S)),b=(C="",S={})=>x(u({message:C,severity:"error"},S)),E=C=>{const S=p.current.findIndex(G=>G.key===C);if(S!==-1)return S===0?(c({open:!1}),p.current[0]):p.current.splice(S,1)},_=(C,S)=>{n(C,S)&&c({open:!1})},O=()=>{},L=()=>{p.current.shift(),p.current.length>0&&c({open:!0})},A=(v=p.current[0])!=null?v:u({},xe),I={};"autoHideDuration"in A&&(I.autoHideDuration=A.autoHideDuration);const M=u(u({},Vt),s),g=u(u({open:l,setOpen:y,enqueueNotification:x,enqueueSuccessNotification:j,enqueueInfoNotification:k,enqueueWarningNotification:h,enqueueErrorNotification:b,removeNotification:E},e),t);return o.jsxs(ne.Provider,{value:g,children:[r,o.jsx(i.Snackbar,B(u(u({},M),I),{open:l,onClose:_,TransitionProps:{onExited:L,onExit:O},sx:{zIndex:Gt},children:o.jsxs("div",{children:[o.jsx(i.Alert,{onClose:C=>_(C,"closeAlert"),severity:A.severity,variant:"filled",icon:A.progressIndicator==="circular"?o.jsx(i.CircularProgress,{size:"1em"}):void 0,style:A.progressIndicator==="linear"?Yt:void 0,children:A.message}),A.progressIndicator==="linear"&&o.jsx(i.LinearProgress,{color:"primary"})]})}))]})}function Re(){const e=f.useContext(ne);if(e===null)throw new z("Error: Tried to useSaladBar outside of a <SaladBarProvider>");return e}const Jt=Q.createHelper((e={autoHideDuration:1},t={},n={})=>({children:r})=>o.jsx(Pe,B(u({},e),{overrideState:t,overrideActions:n,children:r}))),Oe="domainCode";var Ce;const ve=D.atom(JSON.parse((Ce=localStorage.getItem(Oe))!=null?Ce:'{"domainCode": ""}').domainCode),He=D.atom(e=>e(ve),(e,t,n)=>{t(ve,n),localStorage.setItem(Oe,JSON.stringify({domainCode:n}))}),Zt={act:"ACT",nsw:"NSW",nt:"NT",qld:"QLD",sa:"SA",tas:"TAS",vic:"VIC",wa:"WA",ag:"AG",fedmps:"Fedmps","":""},eo=e=>{var t;return e===null?"N/A":(t=Zt[e])!=null?t:""},to=({isLoading:e,isOpen:t,onClose:n,onDomainChange:r,domainOptions:s,applicationName:a,handleLogout:d})=>{const[l,c]=D.useAtom(He),[p,m]=f.useState(l),{enqueueSuccessNotification:w}=Re(),y=s.length===0,x=!!l&&!s.includes(l)&&!s.includes(p),j=!l||y||x,k=()=>F(exports,null,function*(){p?(c(p),r==null||r(p),w(`Set organisation to ${p}`),n()):(c(""),r==null||r(""))}),h=()=>F(exports,null,function*(){l&&!y&&!x?(m(l),n()):j&&d()});let b;return y?b="Unable to retrieve your active organisations. Try logging in again.":x&&(b="You no longer have any roles in your chosen organisation. Please choose another."),o.jsxs(te,{isOpen:t,dialogTitle:"Select an organisation",primaryButton:{text:"Confirm",onClick:k,disabled:!p||y||x,buttonColor:"primary"},secondaryButton:{text:j?"Logout":"Cancel",onClick:h},onClose:j?()=>{}:n,children:[o.jsxs(i.Typography,{marginBottom:2,children:["Select the default organisation that you want to use with the ",a,"."]}),o.jsx(i.Autocomplete,{loading:e,multiple:!1,disableClearable:!1,value:p!==""?p:null,onChange:(E,_)=>m(_!=null?_:""),getOptionLabel:eo,options:[...s],renderInput:E=>o.jsx(i.TextField,B(u({},E),{variant:"filled",label:"Select organisation",InputProps:B(u({},E.InputProps),{endAdornment:o.jsxs(o.Fragment,{children:[e?o.jsx(i.CircularProgress,{color:"inherit",size:20,sx:{marginTop:"-20px"}}):null,E.InputProps.endAdornment]})})}))}),b&&o.jsx(i.FormHelperText,{error:!0,children:b})]})},oo=T.createTheme({palette:{primary:{dark:"#00A651",light:"#A3D39C",main:"#007236",contrastText:"#FFF"},warning:{main:"#F5871F",light:"#FCC589",dark:"#A2590A",contrastText:"#FFF"},secondary:{main:"#662D91",light:"#BD8CBF",dark:"#440E62",contrastText:"#FFF"},error:{main:"#D43C95",light:"#8F2064",dark:"#F9CDE0",contrastText:"#FFF"},info:{main:"#00A88D",light:"#ADDCCF",dark:"#005243",contrastText:"#FFF"},success:{main:"#00A651",light:"#A3D39C",dark:"#007236",contrastText:"#FFF"}},typography:{explainer:{fontSize:"14px",marginBlockStart:"1em"}},navBar:{backgroundColor:"#E8E8E8"}}),no=T.createTheme({palette:{primary:{main:"#007236",dark:"#005221",light:"#00A04E",contrastText:"#FFFFFF"},secondary:{main:"#662D91",dark:"#440E62",light:"#93268F",contrastText:"#FFFFFF"},error:{main:"#D32F2F",dark:"#C62828",light:"#EF5350"},info:{main:"#0288D1",dark:"#01579B",light:"#03A9F4"},success:{main:"#0288D1",dark:"#01579B",light:"#03A9F4"}},components:{MuiTextField:{defaultProps:{color:"secondary"}},MuiToggleButtonGroup:{defaultProps:{color:"secondary"}},MuiCheckbox:{defaultProps:{color:"secondary"}},MuiSelect:{defaultProps:{color:"secondary"}},MuiSwitch:{defaultProps:{color:"secondary"}},MuiFormControl:{defaultProps:{color:"secondary"}},MuiMenuItem:{styleOverrides:{root:({theme:e})=>({"&.Mui-selected":{backgroundColor:T.alpha(e.palette.secondary.main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:T.alpha(e.palette.secondary.main,e.palette.action.selectedOpacity)},"&.Mui-focusVisible":{backgroundColor:T.alpha(e.palette.secondary.main,e.palette.action.focusOpacity)}}})}}},typography:{h4:{fontSize:"1.88rem",fontWeight:500},h5:{fontWeight:500},explainer:{fontSize:"14px",marginBlockStart:"1em"}},navBar:{backgroundColor:"#E8E8E8"}});exports.AgDialog=te;exports.AppLayout=$t;exports.AuthGuard=Wt;exports.Context=ne;exports.ContextError=z;exports.DomainCodeDialog=to;exports.ExampleComponent=it;exports.FetchAutocomplete=Lt;exports.MUI_AUTOCOMPLETE_VALUE_WARNING_REGEX=Mt;exports.NAVBAR_WIDTH_CLOSED=ee;exports.NAVBAR_WIDTH_OPENED=Z;exports.NavBar=xt;exports.NavBarDarkStyledList=gt;exports.NavBarLightStyledList=mt;exports.NavBarProvider=be;exports.SaladBarProvider=Pe;exports.SessionExpiryDialog=Rt;exports.SingleAutocomplete=Pt;exports.buildNavBarState=ke;exports.determineUserLevelFromClaims=jt;exports.domainCodeAtom=He;exports.fed21Theme=oo;exports.getAuth0Expiry=Me;exports.getValidBusinessRoles=Dt;exports.internalAgSystemsTheme=no;exports.navBarClasses=$;exports.navBarOpenAtom=q;exports.navBarTopAtom=Te;exports.navBarWidthClosedAtom=Ie;exports.navBarWidthOpenAtom=Ee;exports.simpleHashCode=Le;exports.suppressConsole=kt;exports.titleTextAtom=K;exports.topBarHeightAtom=Fe;exports.topBarMiddleAtom=_e;exports.unsuppressConsole=Bt;exports.useAutocompleteOptions=oe;exports.useNavBar=De;exports.useSaladBar=Re;exports.useValidDomains=bt;exports.withBrowserRouter=ht;exports.withNavBarProvider=pt;exports.withSaladBarProvider=Jt;
2
2
  //# sourceMappingURL=index.cjs.map