moorr-react-mui 0.3.25 → 0.3.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.css +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
package/index.css
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
.simple-form-tile-component{display:block;width:100%;height:100%;border-radius:0.5rem;background-color:transparent;}.simple-form-tile-component > .graphing-tile-controls-container.simple-form-tile > .graphing-tile-control-container + .graphing-tile-control-container{margin-top:2rem;}.simple-form-tile-component > .graphing-tile-controls-container.simple-form-tile > .graphing-tile-control-container:last-child{margin-bottom:1.5rem;}
|
|
9
9
|
.single-tile-component{display:block;width:100%;height:100%;border-radius:0.5rem;}.single-tile-component>.graphing-tile-controls-container.single-tile{display:block;width:100%;height:100%;}.single-tile-component>.graphing-tile-controls-container.single-tile>.graphing-tile-control-container{display:flex;width:100%;height:100%;flex-wrap:wrap;align-content:center;justify-content:center;}
|
|
10
10
|
.vertical-tile-component{display:block;width:100%;height:100%;border-radius:0.5rem;}.vertical-tile-component>.graphing-tile-controls-container.vertical-tile{display:flex;width:100%;height:100%;flex-direction:column;overflow-x:hidden;overflow-y:auto;justify-content:space-between;}
|
|
11
|
-
.moorr-modal-container > .moorr-modal-content-container{padding:0;display:flex;flex-direction:column;
|
|
11
|
+
.moorr-modal-container > .moorr-modal-content-container{padding:0;display:flex;flex-direction:column;}.moorr-modal-container > .moorr-modal-content-container:focus-visible{border:none;outline:none;}.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-header{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid #e3e3e3;border-radius:5px 5px 0 0;}.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-header > .moorr-modal-header-color-bar{width:0.25rem;height:100%;background-color:#aeaeae;}.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-header > h6{padding:1rem;flex-grow:1;}.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-body{display:block;flex-grow:1;overflow-y:auto;padding:1rem;}.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-body:last-child{border-radius:0 0 5px 5px;}.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-body::-webkit-scrollbar{width:6px;height:6px;}.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-body::-webkit-scrollbar-thumb{background-color:#a98bb3;border-radius:6px;transition:background-color 300ms cubic-bezier(0.4,0,0.2,1) 0ms;}.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-body::-webkit-scrollbar-thumb:hover{background-color:rgb(118,70,134);}.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-body::-webkit-scrollbar-track{background:rgba(118,70,134,0.15);border-radius:6px;}.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-body .MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-body .MoorrReactMuiModal-MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-body .MoorrPersonalInfo-MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-body .MoorrFieldValidationModal-MuiOutlinedInput-notchedOutline{border-color:rgba(0,0,0,0.23);}.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-body input[text] + .MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-body input[text] + .MoorrReactMuiModal-MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-body input[text] + .MoorrPersonalInfo-MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-body input[text] + .MoorrFieldValidationModal-MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-body .Mui-focused > .MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-body .Mui-focused > .MoorrReactMuiModal-MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-body .Mui-focused > .MoorrPersonalInfo-MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-content-container > .moorr-modal-body .Mui-focused > .MoorrFieldValidationModal-MuiOutlinedInput-notchedOutline{border-color:var(--primary-color);}.moorr-modal-container.moorr-slide-modal{align-items:flex-start;justify-content:flex-end;}.moorr-modal-container.moorr-slide-modal > .moorr-modal-content-container{height:100%;}.moorr-modal-container .MuiButton-root.MuiButton-text{font-family:"Poppins";font-size:0.9em;}
|
|
12
12
|
.moorr-modal-container{width:100%;height:100%;}.moorr-modal-container + .moorr-modal-container.moorr-fade-modal{opacity:1;transition:opacity 300ms cubic-bezier(0.4,0,0.2,1) 0ms;}.moorr-modal-container.moorr-modal-container-closing + .moorr-modal-container.moorr-fade-modal{opacity:0;}.moorr-modal-container.moorr-modal-container-closing + .moorr-modal-container.moorr-slide-modal > div:first-child{opacity:0!important;}.moorr-modal-container.moorr-modal-container-closing + .moorr-modal-container.moorr-slide-modal > .moorr-modal-content-container{transform:translate(100%,0px)!important;}.moorr-modal-container > .moorr-modal-body{padding:1rem;flex-grow:1;overflow:auto;}.moorr-modal-container > .moorr-modal-body:last-child{border-radius:0 0 5px 5px;}.moorr-modal-container > .moorr-modal-body::-webkit-scrollbar{width:6px;height:6px;}.moorr-modal-container > .moorr-modal-body::-webkit-scrollbar-thumb{background-color:#a98bb3;border-radius:6px;transition:background-color 300ms cubic-bezier(0.4,0,0.2,1) 0ms;}.moorr-modal-container > .moorr-modal-body::-webkit-scrollbar-thumb:hover{background:rgb(118,70,134);}.moorr-modal-container > .moorr-modal-body::-webkit-scrollbar-track{background:rgba(118,70,134,0.15);border-radius:6px;}.moorr-modal-container > .moorr-modal-body .MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-body .MoorrReactMuiModal-MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-body .MoorrPersonalInfo-MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-body .MoorrFieldValidationModal-MuiOutlinedInput-notchedOutline{border-color:rgba(0,0,0,0.23);}.moorr-modal-container > .moorr-modal-body input[text] + .MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-body input[text] + .MoorrReactMuiModal-MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-body input[text] + .MoorrPersonalInfo-MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-body input[text] + .MoorrFieldValidationModal-MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-body .Mui-focused > .MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-body .Mui-focused > .MoorrReactMuiModal-MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-body .Mui-focused > .MoorrPersonalInfo-MuiOutlinedInput-notchedOutline,.moorr-modal-container > .moorr-modal-body .Mui-focused > .MoorrFieldValidationModal-MuiOutlinedInput-notchedOutline{border-color:var(--primary-color);}.moorr-modal-container > .moorr-modal-header{padding:1rem;border-radius:5px 5px 0 0;}.moorr-modal-container > .moorr-modal-header > .tabs{margin-bottom:-1rem;}.moorr-modal-container > .moorr-modal-footer{display:flex;justify-content:space-between;flex-direction:row;padding:1rem;}.moorr-modal-container > .moorr-modal-footer > .left-buttons{display:flex;justify-content:flex-start;flex-direction:row;}.moorr-modal-container > .moorr-modal-footer > .status-message{flex-grow:1;}.moorr-modal-container > .moorr-modal-footer > .right-buttons{display:flex;justify-content:flex-end;flex-direction:row;}.moorr-modal-container > .moorr-modal-footer > .left-buttons button + button,.moorr-modal-container > .moorr-modal-footer > .right-buttons button + button{margin-left:0.5rem;}.moorr-modal-container > .moorr-modal-footer > div > .MuiButtonBase-root.MuiButton-contained{display:flex;justify-content:center;align-items:center;padding:12px 15px;gap:10px;border-radius:100px;width:110px;height:33px;font-family:"Poppins";font-style:normal;font-weight:400;font-size:14px;line-height:14px;text-align:center;border:none;text-transform:capitalize;}.moorr-modal-container > .moorr-modal-footer > div > .MuiButtonBase-root.MuiButton-contained.MuiButton-containedSecondary{background:#d4c5d9;color:#541868;}.moorr-modal-container > .moorr-modal-footer > div > .MuiButtonBase-root.MuiButton-contained.MuiButton-containedPrimary{background:#541868;color:#ffffff;}
|
|
13
13
|
.moorr-modal-container.alert-modal{padding:18px;}.moorr-modal-container.alert-modal > .moorr-modal-header{padding:0;}.moorr-modal-container.alert-modal > .moorr-modal-body{padding:0;}.moorr-modal-container.alert-modal > .moorr-modal-footer{padding:0;}.moorr-modal-container.alert-modal > .moorr-modal-footer > .status-message{display:flex;justify-content:center;}
|
|
14
14
|
.moorr-modal-container.confirm-modal{padding:18px;}.moorr-modal-container.confirm-modal > .moorr-modal-header{padding:0;}.moorr-modal-container.confirm-modal > .moorr-modal-body{padding:0;}.moorr-modal-container.confirm-modal > .moorr-modal-footer{padding:0;}
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e,{forwardRef as t,useMemo as n,useCallback as o,createContext as r,useContext as i,useState as l,useRef as a,useEffect as s,useImperativeHandle as d}from"react";import c from"@mui/material/Button";import{useMediaQuery as u,Typography as m,SpeedDial as p,Box as h,SpeedDialIcon as g,SpeedDialAction as v,Slide as f,Icon as b,IconButton as y,Button as x}from"@mui/material";import{integers as E,utils as w,dates as M,decimals as C,strings as k}from"moorr-common";import T from"@mui/material/IconButton";import F from"@material-ui/core/MenuItem";import{makeStyles as N,createStyles as S,withStyles as O,StylesProvider as D}from"@material-ui/core/styles";import P from"@material-ui/core/TextField";import{StylesProvider as I,Modal as R,Backdrop as V,Fade as A}from"@material-ui/core";import{createGenerateClassName as L,StylesProvider as U}from"@material-ui/styles";import{v4 as j}from"uuid";import B,{Responsive as $}from"react-grid-layout";import z from"@mui/material/Accordion";import H from"@mui/material/AccordionSummary";import G from"@mui/material/AccordionDetails";import W from"@mui/icons-material/ExpandMore";import q from"react-dom";import{toast as K}from"react-toastify";import _ from"@mui/icons-material/Cancel";import Y from"@mui/icons-material/Close";import X from"@mui/icons-material/CheckCircle";import Z from"@mui/material/Box";import J from"@mui/material/Fade";import Q from"@mui/material/Slide";const ee=({type:t,label:n})=>(t||(t="button"),e.createElement("button",{type:t,className:"moorr-button"},e.createElement("span",null,n)));function te(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}function ne(e,t,n,o){return new(n||(n=Promise))((function(r,i){function l(e){try{s(o.next(e))}catch(e){i(e)}}function a(e){try{s(o.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(l,a)}s((o=o.apply(e,t||[])).next())}))}const oe=t(((t,o)=>{var{style:r={},handleClick:i,label:l,disabled:a}=t,s=te(t,["style","handleClick","label","disabled"]);const d=u("(max-width: 600px)"),m=n((()=>d?"8rem":"172px"),[d]);return e.createElement(c,Object.assign({},s,{ref:o,disabled:a,disableElevation:!0,disableRipple:!0,disableFocusRipple:!0,disableTouchRipple:!0,style:Object.assign(Object.assign(Object.assign({},!a&&{backgroundColor:"#541868"}),{color:"#FFFFFF",fontWeight:400,fontSize:"14px",width:m,height:"39px",borderRadius:"48px",textTransform:"capitalize"}),r),onClick:i,variant:"contained"}),l)})),re=t(((t,r)=>{var{sx:i,item:l,label:a,qty:s,disabled:d,highlight:u,onSelectItem:p}=t,h=te(t,["sx","item","label","qty","disabled","highlight","onSelectItem"]);const g=n((()=>({width:"27px",height:"27px",color:"#FFFFFF",flexShrink:0})),[]),v=n((()=>{const e=Object.assign(Object.assign({},i),{flexGrow:1,fontFamily:"Poppins",fontSize:"14px",fontWeight:400,lineHeight:"9px",minHeight:"42px",border:"1px solid #EDEDEE",borderRadius:"10rem",textTransform:"none",gap:"0.5rem","&:hover > button":{opacity:1}});return s>0?Object.assign(Object.assign({},e),{backgroundColor:"#66e84b",borderColor:"#541868",color:"#541868","&:hover":{backgroundColor:"#66e84b",borderColor:"#541868",color:"#541868"}}):Object.assign(Object.assign({},e),{backgroundColor:"#FBFBFD",borderColor:!0===u?"#541868":"#EDEDEE",color:"#000000","&:hover":{backgroundColor:"#66e84b",borderColor:"#66e84b",color:"#ffffff"}})}),[s,i]),f=o((e=>ne(void 0,void 0,void 0,(function*(){e.stopPropagation(),e.preventDefault(),w.isFunction(p)&&s<=0&&(yield Promise.all([p(l,1)]))}))),[s,p]),b=o((()=>!E.isValid(s)||s<=0?null:e.createElement(T,{disabled:d,sx:Object.assign(Object.assign({},g),{backgroundColor:"#E37D7D",opacity:0,"&:hover":{backgroundColor:"#E37D7D"},"&:active":{backgroundColor:"#E37D7D"}}),onClick:()=>p&&p(l,Math.max(0,s-1))},"-")),[d,g,s,p]),y=o((()=>!E.isValid(s)||s<=0?null:e.createElement(T,{disabled:d,sx:Object.assign(Object.assign({},g),{backgroundColor:"#541868",opacity:0,"&:hover":{backgroundColor:"#541868"},"&:active":{backgroundColor:"#541868"}}),onClick:()=>p&&p(l,s+1)},"+")),[d,g,s,p]),x=o((()=>{let t,n;return!E.isValid(s)||s<=0?(t=1,n=0):(t=`${s}`,n=1),e.createElement(m,{variant:"body1",component:"span",sx:{color:"#541868",fontWeight:700,fontSize:"14px",lineHeight:"20px",flexShrink:0,opacity:n}},t)}),[s]);return e.createElement(c,Object.assign({},h,{ref:r,disableElevation:!0,disableRipple:!0,disableFocusRipple:!0,disableTouchRipple:!0,disabled:d,sx:v,onClick:f}),b(),e.createElement(m,{variant:"body1",component:"span",sx:{flexGrow:1}},null!=a?a:l),y(),x())})),ie=t(((t,o)=>{var{style:r={},handleClick:i,label:l,disabled:a}=t,s=te(t,["style","handleClick","label","disabled"]);const d=u("(max-width: 600px)"),m=n((()=>d?"8rem":"172px"),[d]);return e.createElement(c,Object.assign({},s,{ref:o,disabled:a,disableElevation:!0,disableRipple:!0,disableFocusRipple:!0,disableTouchRipple:!0,style:Object.assign(Object.assign(Object.assign({},!a&&{backgroundColor:"#D4C5D9"}),{color:"#541868",fontWeight:400,fontSize:"14px",width:m,height:"39px",borderRadius:"48px",textTransform:"capitalize"}),r),onClick:i,variant:"contained"}),l)})),le=t(((t,r)=>{var{sx:i,item:l,label:a,itemSelected:s,onSelectItem:d}=t,u=te(t,["sx","item","label","itemSelected","onSelectItem"]);const p=n((()=>{const e=Object.assign(Object.assign({},i),{flexGrow:1,fontFamily:"Poppins",fontSize:"13px",fontWeight:400,lineHeight:"18px",border:"1px solid #EDEDEE",borderRadius:"10rem",textTransform:"none"});return s?Object.assign(Object.assign({},e),{backgroundColor:"#66e84b",borderColor:"#541868",color:"#541868","&:hover":{backgroundColor:"#66e84b",borderColor:"#541868",color:"#541868"}}):Object.assign(Object.assign({},e),{backgroundColor:"#fbfbfd",borderColor:"#EDEDEE",color:"#000000","&:hover":{backgroundColor:"#66e84b",borderColor:"#66e84b",color:"#ffffff"}})}),[s,i]),h=o((e=>ne(void 0,void 0,void 0,(function*(){e.stopPropagation(),e.preventDefault(),w.isFunction(d)&&(yield Promise.all([d(l)]))}))),[d]);return e.createElement(c,Object.assign({},u,{ref:r,disableElevation:!0,disableRipple:!0,disableFocusRipple:!0,disableTouchRipple:!0,sx:p,onClick:h}),e.createElement(m,{variant:"body1",component:"span",sx:{flexGrow:1}},null!=a?a:l))})),ae=e=>({root:{"&:hover:not($disabled):not($focused):not($error) $notchedOutline":{},"&$checked":{color:"var(--primary-color)"},"& .vldt-MuiSelect-select.vldt-MuiSelect-select":{color:"var(--grey-color-2)"}},disabled:{},focused:{},error:{},notchedOutline:{},checked:{},notchedOutlineMBRequired:{flex:3,borderColor:"blue",borderWidth:2},fieldSetMBRequired:{"& fieldset":{flex:3,borderColor:"blue",borderWidth:2}},fieldSetErrorField:{"& fieldset":{borderColor:"var(--error-color)"}},blue:{color:"blue"}});N(ae);const se=N((()=>S({root:{overflow:"hidden",display:"flex",alignItems:"center","&.start":{flexDirection:"row"},"&.top":{flexDirection:"column"},"& .Mui-disabled":{backgroundColor:"var(--grey-color-3)",cursor:"not-allowed",borderRadius:"4px"}},label:{flex:2},field:{flex:3},required:{color:"red"},menuItem:{color:"var(--grey-color-2)","&:hover":{backgroundColor:"var(--primary-color-scale-25)",color:"var(--grey-color-2)"}},menuItemSelected:{color:"var(--grey-color-2)"},mandatory:{border:"red 2px solid",borderRadius:"4px"}})));var de=O(ae)((({handleChange:t,value:n,disabled:o=!1,name:r,className:i,classes:l,size:a,menuItemLabel:s,options:d,labelPlacement:c="start",label:u,required:m=!1,isMBRequiredField:p,fullWidth:h,selectIconComponent:g})=>{const{root:v,focused:f,error:b,notchedOutline:y,notchedOutlineMBRequired:x}=l,E=se();let w;return g&&(w={IconComponent:g}),e.createElement(P,{fullWidth:!1!==h,id:"outlined-basic",variant:"outlined",value:n,onChange:t,disabled:o,name:r,className:[i].join(" "),InputProps:{classes:{root:v,focused:f,error:b,notchedOutline:!p||n&&0!==(null==n?void 0:n.length)?!m||n&&0!==(null==n?void 0:n.length)?y:E.mandatory:x}},color:"primary",size:a||"small",select:!0,SelectProps:w,defaultValue:""},e.createElement(F,{value:"",disabled:!0},e.createElement("em",null,s)),d&&d.map(((t,n)=>"-separator-"===t?e.createElement(F,{key:`separator-${n}`,value:"",disabled:!0},e.createElement("em",null,"-----------")):e.createElement(F,{key:`menu-item-${n}-${t.value||t}`,value:t.value||t},t.label||t))))}));const ce={};function ue(e,t){e&&t&&(ce[e]=t)}const me=({className:t,icon:n,width:o,height:r,fill:i,stroke:l,accent:a,dropShadow:s})=>{if(w.isNullOrUndefined(n))return null;const d=ce[n]||null;return d?e.createElement(d,{className:t,fill:i,width:o,height:r,stroke:l,accent:a,dropShadow:s}):null},pe={};var he=({stylePrefix:t,children:n})=>{let o;if(t)o=pe[t]?pe[t]:pe[t]=L({seed:t});else{const e=`MoorrStylesProvider-${j()}-`;o=L({seed:e})}return e.createElement(U,{generateClassName:o,injectFirst:!0},e.createElement(I,{generateClassName:o,injectFirst:!0},e.createElement(D,{generateClassName:o},n)))};const ge=r({});function ve(){return i(ge)}const fe={};function be(e,t){e&&t&&(fe[e]=t)}const ye=({graphingTile:t,graphingTileIndex:n})=>{var o;if(!(null===(o=null==t?void 0:t.tile)||void 0===o?void 0:o.tileType))return null;const r=fe[t.tile.tileType]||null;return r?e.createElement(r,{graphingTile:t,graphingTileIndex:n}):null},xe=[20,20],Ee={lg:600,sm:0},we={lg:8,sm:2},Me=({tilePrefix:t,responsive:n,columns:o,containerPadding:r,referenceMargin:i,referenceWidth:d,graphingTiles:c})=>{const u=ve(),[m,p]=l(null),[h,g]=l(null),[v,f]=l(null),[b,y]=l(null),x=a(null),E=()=>{const e=(null==x?void 0:x.current)?(null==x?void 0:x.current).getBoundingClientRect().width:null;y(e);const t=T(e);p(t)};let M;const C=e=>{E(),clearTimeout(M),M=setTimeout((()=>{E()}),300)};s((()=>{E()}),[x]),s((()=>(window.addEventListener("resize",C),()=>{window.removeEventListener("resize",C)})),[]),s((()=>{if(n){if(!Array.isArray(c)||0===c.length)return void f({lg:[]});const e=c.map(((e,n)=>({x:e.x,y:e.y,w:isNaN(e.w)?1:e.w,h:isNaN(e.h)?1:e.h,i:`${t?t+"_":""}tile_${n}`})));f({lg:e})}else{if(!Array.isArray(c)||0===c.length)return void g([]);g(c.map(((e,n)=>({x:e.x,y:e.y,w:isNaN(e.w)?1:e.w,h:isNaN(e.h)?1:e.h,i:`${t?t+"_":""}tile_${n}`,static:!0}))))}}),[c]);const k=()=>null==c?void 0:c.map(((n,o)=>{if(!n.tile||!n.visible)return null;if(w.isFunction(u.isTileVisible)&&n.tile.id&&!u.isTileVisible(n.tile.id))return null;let r="graphing-tile-container";n.tile.id&&(r+=` ${n.tile.id}`),!1!==n.border&&(r+=" bordered"),n.autoHeight&&(r+=" auto-height");const i=`${t?t+"_":""}tile_${o}`;return e.createElement("div",{className:r,key:i},e.createElement(ye,{graphingTile:n,graphingTileIndex:o}))})),T=e=>{if(!i||isNaN(i)||i<=0||!d||isNaN(d)||d<=0||null==e)return xe;const t=e/d*i;return[t,t]};return e.createElement("div",{ref:x,className:"graphing-tiles-container"},(()=>{if(!b||!m)return null;if(!1!==n){if(!v)return null;const t=[r||0,0];return e.createElement($,{width:b,breakpoints:Ee,cols:o||we,rowHeight:1,layouts:v,containerPadding:t,margin:m,isDraggable:!1},k())}return h?e.createElement(B,{width:b,cols:9,rowHeight:50,margin:m,isDraggable:!1,layout:h},k()):null})())},Ce={};function ke(e,t){Ce[e]=t}function Te(e){const t=Ce[null==e?void 0:e.tileType];return t?new t(e):null}function Fe(e){const t=[];return e.forEach((e=>{const n=Te(e);n&&t.push(n)})),t}class Ne{constructor(e){this.x=e.x,this.y=e.y,this.w=e.w,this.h=e.h,this.border=!0===e.border,this.background=e.background||null,this.autoHeight=!0===e.autoHeight,this.tile=Te(e.tile),this.visible=!1!==e.visible}getBackground(){return this.background||"#FFFFFF"}}class Se{constructor(e){this.title=e.title||"",this.infoIconUrl=e.infoUrl,this.infoIconHref=e.infoHref,this.responsive=!1!==e.responsive,this.columns=e.columns||{lg:8,sm:2},this.containerPadding=e.containerPadding||0,this.referenceMargin=e.referenceMargin||null,this.referenceWidth=e.referenceWidth||null,this.tiles=[],Array.isArray(e.tiles)&&e.tiles.forEach((e=>{this.tiles.push(new Ne(e))}))}}const Oe={};function De(e,t){Oe[e]=t}function Pe(e){const t=Oe[null==e?void 0:e.controlType];return t?new t(e):null}function Ie(e){const t=[];return e.forEach((e=>{const n=Pe(e);n&&t.push(n)})),t}class Re{constructor(e){this.controlType=e.controlType,this.dataKey=e.dataKey}}class Ve extends Re{constructor(e){super(e),this.inputLabel=e.inputLabel||"",this.readOnly=!0===e.readOnly,this.readOnlyBorderless=!0===e.readOnlyBorderless,this.hasAsAtDate=!1===e.hasAsAtDate||!0===e.hasAsAtDate?e.hasAsAtDate:null,this.staticAsAtDate=!0===e.staticAsAtDate,this.validationSchemaPath=(w.isArray(e.validationSchemaPath)?e.validationSchemaPath:[]).filter((e=>w.isString(e))),this.validationErrorMessages=e.validationErrorMessages||{}}}class Ae{constructor(e){this.border=e.border,this.background=e.background||null,this.control=Pe(e.control)}getBackground(e){return this.background||(null==e?void 0:e.background)||"#FFFFFF"}}class Le{constructor(e){this.label=e.label||"",this.value=e.value||"",this.icon=e.icon||"",this.accent=e.accent||""}}class Ue{constructor(e){this.id=e.id||"",this.title=e.title||"",this.controls=[],Array.isArray(e.controls)&&e.controls.forEach((e=>{this.controls.push(new Ae(e))})),this.add=!0===e.add,this.edit=!0===e.edit,this.addActions=[],Array.isArray(e.addActions)&&e.addActions.forEach((e=>{this.addActions.push(new Le(e))}))}}class je{constructor(e){this.id=e.id,this.tileType=e.tileType}}class Be extends je{constructor(e){super(e),this.control=new Ae(e.control)}}class $e extends je{constructor(e){super(e),this.controls=[],Array.isArray(e.controls)&&e.controls.forEach((e=>{this.controls.push(new Ae(e))}))}}class ze extends je{constructor(e){super(e),w.isArray(e.formGroups)&&e.formGroups.length>0?this.formGroups=e.formGroups.map((e=>new Ue(e))):this.formGroups=[]}}ke("form-groups-tile",ze);class He extends $e{constructor(e){super(e),this.controlsPerPage=e.controlsPerPage,(isNaN(this.controlsPerPage)||this.controlsPerPage<=1)&&(this.controlsPerPage=1)}}ke("horizontal-tile",He);class Ge extends $e{constructor(e){super(e),this.states={};for(const t in e.states){const n=e.states[t];n&&(this.states[t]=new Se(n))}}}ke("selectable-states-tile",Ge);class We extends je{constructor(e){super(e),this.controls=[],Array.isArray(e.controls)&&e.controls.forEach((e=>{this.controls.push(new Ae(e))}))}}ke("simple-form-tile",We);class qe extends Be{constructor(e){super(e)}}ke("single-tile",qe);class Ke extends $e{constructor(e){super(e)}}ke("vertical-tile",Ke);const _e=(e,t,n)=>{s((()=>{const n=document.querySelector("#react-root");return null==n||n.addEventListener(e,t),()=>{null==n||n.removeEventListener(e,t)}}),null!=n?n:[t])},Ye=(e,t)=>{const n=document.querySelector("#react-root");null==n||n.dispatchEvent(new CustomEvent(e,{detail:null!=t?t:{}}))},Xe=({})=>{const{settings:t,handleUIReady:n}=ve(),[r,i]=l(null),[a,d]=l([]),[c,u]=l(!1);s((()=>{setTimeout((()=>{window.dispatchEvent(new Event("resize")),setTimeout((()=>{u(!0),w.isFunction(n)&&n()}),300)}),300)}),[]);const m=o((e=>{var t,n,o,r,i,l,s,c,u,m,p;if(!(null==a?void 0:a.length)||!(null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.id))return;const h=a.find((t=>{var n,o;return(null===(n=t.tile)||void 0===n?void 0:n.id)===(null===(o=null==e?void 0:e.detail)||void 0===o?void 0:o.id)}));if(!h)return;w.isNullOrUndefined(null===(n=null==e?void 0:e.detail)||void 0===n?void 0:n.x)||(h.x=null===(o=null==e?void 0:e.detail)||void 0===o?void 0:o.x),w.isNullOrUndefined(null===(r=null==e?void 0:e.detail)||void 0===r?void 0:r.y)||(h.y=null===(i=null==e?void 0:e.detail)||void 0===i?void 0:i.y),w.isNullOrUndefined(null===(l=null==e?void 0:e.detail)||void 0===l?void 0:l.w)||(h.w=null===(s=null==e?void 0:e.detail)||void 0===s?void 0:s.w),w.isNullOrUndefined(null===(c=null==e?void 0:e.detail)||void 0===c?void 0:c.h)||(h.h=null===(u=null==e?void 0:e.detail)||void 0===u?void 0:u.h),w.isNullOrUndefined(null===(m=null==e?void 0:e.detail)||void 0===m?void 0:m.visible)||(h.visible=null===(p=null==e?void 0:e.detail)||void 0===p?void 0:p.visible);const g=a.map((e=>new Ne(e)));d(g)}),[a]);_e("graphingGrid.updateTile",m),s((()=>{var e;t?(i(new Se(t)),d(null===(e=t.tiles)||void 0===e?void 0:e.map((e=>new Ne(e))))):i(null)}),[t]);const p=()=>(null==t?void 0:t.infoIconUrl)&&t.infoIconHref?e.createElement("a",{className:"information-anchor",href:t.infoIconHref,target:"_blank"},e.createElement("img",{alt:null==t?void 0:t.title,src:null==t?void 0:t.infoIconUrl})):null;if(!r)return null;let h="graphing-grid-container";return c&&(h+=" in"),e.createElement(e.Fragment,null,e.createElement("div",{className:h},w.isNullOrUndefined(null==t?void 0:t.title)?null:e.createElement(e.Fragment,null,e.createElement("h2",{className:"graphing-grid-title"},null==t?void 0:t.title,p()),e.createElement("hr",{className:"graphing-grid-hr"})),e.createElement(Me,{graphingTiles:a,responsive:r.responsive,columns:r.columns,containerPadding:r.containerPadding,referenceMargin:r.referenceMargin,referenceWidth:r.referenceWidth})))},Ze={};function Je(e,t){e&&t&&(Ze[e]=t)}const Qe=({graphingTile:t,graphingTileIndex:n,graphingTileControl:o,ControlProps:r})=>{var i;if(!(null===(i=null==o?void 0:o.control)||void 0===i?void 0:i.controlType))return null;const l=Ze[o.control.controlType]||null;return l?e.createElement(l,Object.assign({graphingTile:t,graphingTileIndex:n,graphingTileControl:o},r)):null},et=({graphingTile:t,graphingTileIndex:n,graphingTileControls:o,ControlProps:r})=>{var i,l;let a="graphing-tile-controls-container";return(null===(i=null==t?void 0:t.tile)||void 0===i?void 0:i.tileType)&&(a+=" "+(null===(l=null==t?void 0:t.tile)||void 0===l?void 0:l.tileType)),e.createElement("div",{className:a},null==o?void 0:o.map(((o,i)=>{var l,a;if(!o.control)return null;let s="graphing-tile-control-container";(null===(l=o.control)||void 0===l?void 0:l.controlType)&&(s+=" "+(null===(a=o.control)||void 0===a?void 0:a.controlType)),!1!==o.border&&(s+=" bordered");const d=`control_${n}_${i}`;return e.createElement("div",{className:s,key:d},e.createElement(Qe,{graphingTile:t,graphingTileIndex:n,graphingTileControl:o,ControlProps:r}))})))},tt=({className:t,context:n})=>e.createElement(ge.Provider,{value:n},e.createElement("div",{className:t},e.createElement(Xe,null))),nt=({open:t,actions:n,disabled:o,onClick:r})=>e.createElement(p,{ariaLabel:"Add a New Card",direction:"down",open:t,className:t?"add-card-open":void 0,onClick:r,icon:e.createElement(h,{sx:{display:"flex"}},e.createElement(g,{open:t,icon:e.createElement(me,{icon:"add-icon",stroke:t?"#E24242":"#FFFFFF"})})),FabProps:{className:t?"add-card-open":void 0,variant:"extended",disabled:o,disableRipple:!0,disableFocusRipple:!0,disableTouchRipple:!0,sx:{background:"transparent",color:"inherit",width:"auto",height:"30px",whiteSpace:"nowrap",boxShadow:"none",textTransform:"inherit","&:hover":{background:"transparent",boxShadow:"none"},"&:active":{background:"transparent",boxShadow:"none"},"&:disabled":{background:"transparent !important"},"& > div":{display:"flex",flexDirection:"row",gap:"1rem",textTransform:"inherit",justifyContent:"center"},"& > div > .MuiTypography-root.MuiTypography-button":{textTransform:"inherit",fontFamily:"Poppins",fontStyle:"normal",fontWeight:400,fontSize:"14px"},"& > div > .MuiSpeedDialIcon-root":{display:"flex",width:"30px",height:"30px",alignItems:"center",justifyContent:"center",backgroundColor:"#541868",transition:"background-color 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",borderRadius:"15px",color:"#FFFFFF"},"& > div > .MuiSpeedDialIcon-root:hover":{backgroundColor:"#541868"},"& > div > .MuiSpeedDialIcon-root > svg":{transform:"rotate(0deg)",transition:"transform 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,opacity 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms"},"&.add-card-open > div > .MuiSpeedDialIcon-root":{backgroundColor:"#FFFFFF",color:"#E24242"},"&.add-card-open > div > .MuiSpeedDialIcon-root:hover":{backgroundColor:"#FFFFFF",color:"#E24242"},"&.add-card-open > div > .MuiSpeedDialIcon-root > svg":{transform:"rotate(45deg)"},"&:disabled > div > .MuiSpeedDialIcon-root":{backgroundColor:"#DCDCDC",color:"#FFFFFF"},"&:disabled > div > .MuiSpeedDialIcon-root:hover":{backgroundColor:"#DCDCDC",color:"#FFFFFF"}}},sx:{position:"absolute",width:"30px",zIndex:1,"&.add-card-open":{zIndex:1050},"& > .MuiSpeedDial-actions":{alignSelf:"flex-end",marginRight:"-15px"},"& > .MuiSpeedDial-actions .MuiSpeedDialAction-staticTooltipLabel":{whiteSpace:"nowrap"}}},n),ot=({graphingTile:t,graphingTileIndex:r})=>{const i=null==t?void 0:t.tile;if(!i)return null;const d=ve();return e.createElement("div",{className:"form-groups-tile-component"},!w.isArray(i.formGroups)||i.formGroups.length<0?null:i.formGroups.map(((i,c)=>{const u=a(null),[m,p]=l("normal"),[g,f]=l("form-group-container");s((()=>{M()}),[g,m]);const[b,y]=l(0),[x,E]=l(!0);s((()=>{if(x){const e=u.current;w.isNullOrUndefined(e)?y(0):setTimeout((()=>{y(e.scrollHeight)}),10)}else y(0)}),[x]);const M=e=>{if(x){const e=u.current;w.isNullOrUndefined(e)?y(0):setTimeout((()=>{y(Math.max(e.clientHeight,e.scrollHeight))}),10)}else y(0)},C=o((e=>{""===e.value?(p("add"),E(!0)):(null==d?void 0:d.handleFormGroupAdd)&&w.isFunction(d.handleFormGroupAdd)&&d.handleFormGroupAdd(i,e)}),[i,null==d?void 0:d.handleFormGroupAdd]),k=n((()=>i.addActions&&i.addActions.length?i.addActions.map(((t,n)=>e.createElement(v,{key:n.toString(),icon:e.createElement(me,{icon:t.icon,fill:t.accent,stroke:"#FFFFFF"}),tooltipTitle:e.createElement("span",null,t.label),tooltipOpen:!0,FabProps:{disableFocusRipple:!0,disableRipple:!0,disableTouchRipple:!0},sx:{"& > .MuiSpeedDialAction-staticTooltipLabel":{background:"#ffffff",color:"#000000",textTransform:"inherit",fontFamily:"Poppins",fontStyle:"normal",fontWeight:400,fontSize:"12px",padding:"0.25rem 0.5rem",cursor:"pointer"},"& > .MuiSpeedDialAction-staticTooltipLabel#AddaNewCard-action-0-label":{marginRight:0},"& > .MuiFab-root":{backgroundColor:"transparent !important",color:"#ffffff",boxShadow:"none",width:"36px !important",height:"36px !important",margin:"0.375rem 1rem 0.375rem 0.25rem","&:hover":{backgroundColor:"transparent !important"},"&:active":{backgroundColor:"transparent !important",boxShadow:"none"},justifyContent:"flex-end !important"}},onClick:()=>C(t)}))):null),[i.addActions,C]),[T,F]=l(!1),N=o((e=>{e.stopPropagation(),F((e=>!e))}),[]),S=o((()=>!0!==i.add||w.isFunction(d.formGroupHasAddMode)&&!d.formGroupHasAddMode(i.id)?null:k?e.createElement(nt,{disabled:"add"==m,open:T,actions:k,onClick:N}):e.createElement("button",{type:"button",className:"form-group-tile-add-button",onClick:D,disabled:"add"==m},e.createElement(me,{icon:"add-icon",stroke:"#ffffff"}))),[m,d.formGroupHasAddMode,T,k,N]),O=o((()=>!0!==i.edit||w.isFunction(d.formGroupHasEditMode)&&!d.formGroupHasEditMode(i.id)?null:e.createElement("button",{type:"button",className:"form-group-tile-edit-button",onClick:P,disabled:"add"==m},e.createElement(me,{icon:"edit-icon",fill:"#ffffff"}))),[m,d.formGroupHasEditMode]),D=e=>{e.stopPropagation(),p("add"),E(!0)},P=e=>{e.stopPropagation(),(null==d?void 0:d.handleEdit)&&(null==d||d.handleEdit(i))},I=e=>ne(void 0,void 0,void 0,(function*(){w.isFunction(null==d?void 0:d.handleFormGroupCancel)&&(yield Promise.all([null==d?void 0:d.handleFormGroupCancel({formGroup:i})])),p("normal")})),[R,V]=l(!1),A=e=>ne(void 0,void 0,void 0,(function*(){if(w.isFunction(null==d?void 0:d.handleFormGroupSave))try{V(!0);const[e]=yield Promise.all([null==d?void 0:d.handleFormGroupSave({formGroup:i})]);if(!1===e)return}finally{V(!1)}p("normal")}));let L="form-group-container";return w.isFunction(d.isFormGroupVisible)&&(d.isFormGroupVisible(i.id)||(L+=" hidden")),L!==g&&f(L),e.createElement(z,{key:`${i.id}-{${c}}`,className:L,expanded:x,onChange:e=>{"add"!==m&&E((e=>!e))},TransitionProps:{unmountOnExit:!0}},e.createElement(H,{className:"form-group-title",expandIcon:"add"!==m?e.createElement(W,null):null},e.createElement("span",{className:"form-group-title-text"},i.title),S(),O()),e.createElement("hr",null),e.createElement(G,{className:"form-group-components"},(()=>{if("add"===m){let t;return w.isFunction(d.renderFormGroup)&&(t=d.renderFormGroup(i,"add")),e.createElement(e.Fragment,null,t,e.createElement("hr",null),e.createElement("div",{className:"form-group-add-mode-buttons"},e.createElement("button",{className:"cancel-button",disabled:R,onClick:I},"Cancel"),e.createElement("button",{className:"save-button",disabled:R,onClick:A},"Create")))}{const n=i.controls;let o,l;if(w.isFunction(d.renderFormGroup)){if(o=d.renderFormGroup(i,"normal"),!w.isNullOrUndefined(o))return o;l=d.renderFormGroup(i,"footer")}return e.createElement(e.Fragment,null,e.createElement(et,{graphingTile:t,graphingTileIndex:r,graphingTileControls:n,ControlProps:{onUIChange:M}}),l)}})()),k&&e.createElement(h,{sx:{position:"absolute",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:T?2:-1,borderRadius:"10px",transition:"opacity 225ms cubic-bezier(0.4, 0, 0.2, 1)",opacity:T?1:0},onClick:()=>F(!1)}))})))};be("form-groups-tile",ot);const rt=({graphingTile:t,graphingTileIndex:n})=>{const o=null==t?void 0:t.tile;if(!o)return null;const[r,i]=l(null),[a,d]=l(0),[c,u]=l(0),[m,p]=l(null),[h,g]=l(null),[v,f]=l(null),[b,y]=l([]);s((()=>{let e=[];const t=Math.ceil(o.controls.length/o.controlsPerPage);if(t>0)for(let n=0;n<t;n++){const t={pageIndex:n,controls:[]};for(let e=0;e<o.controlsPerPage;e++){const r=n*o.controlsPerPage+e;if(r>=o.controls.length)break;t.controls.push(o.controls[r])}e.push(t)}d(t),u(0),p(null),g(null),f(null),y(e)}),o.controls);const x=e=>{let t=e-1;t<0&&(t=a-1),g(t)},E=e=>{e.stopPropagation(),x(c),f(null),p(null)},w=e=>{e.stopPropagation()},M=e=>{e.stopPropagation()},C=e=>{if(e.stopPropagation(),null!==r)return;const t=c;let n=c-1;n<0&&(n=a-1),p(t),u(n),g(null),f(t);const o=setTimeout((()=>{x(n),f(null),p(null),setTimeout((function(){i(null)}),300)}),300);i(o)},k=e=>{let t=e+1;t>=a&&(t=0),f(t)},T=e=>{e.stopPropagation(),g(null),k(c),p(null)},F=e=>{e.stopPropagation()},N=e=>{e.stopPropagation()},S=e=>{if(e.stopPropagation(),null!==r)return;const t=c;let n=c+1;n>=a&&(n=0),p(t),u(n),g(t),f(null);const o=setTimeout((()=>{g(null),k(n),p(null),setTimeout((function(){i(null)}),300)}),300);i(o)},O={background:t.getBackground()};return e.createElement("div",{className:"horizontal-tile-component",style:O},e.createElement("div",{className:"horizontal-tile-pages-container"},b.map(((o,r)=>{let i="horizontal-tile-page-container";return r===c?i+=" active":r===h?i+=" navigating-from-left":r===v&&(i+=" navigating-from-right"),r===m&&(i+=" previous"),e.createElement("div",{key:`horizontal-tile-page-${r}`,className:i},e.createElement(et,{graphingTile:t,graphingTileIndex:n,graphingTileControls:o.controls}))})),e.createElement("div",{className:"horizontal-tile-page-container background",style:O}),a<=1?null:e.createElement(e.Fragment,null,e.createElement("button",{type:"button",className:"navigate-button navigate-left-button",onMouseEnter:E,onMouseLeave:w,onMouseDown:M,onClick:C},e.createElement("svg",{width:"8",height:"13",viewBox:"0 0 8 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M7.40991 10.643L2.82991 6.05298L7.40991 1.46298L5.99991 0.0529785L-8.80003e-05 6.05298L5.99991 12.053L7.40991 10.643Z",fill:"#828282"}))),e.createElement("button",{type:"button",className:"navigate-button navigate-right-button",onMouseEnter:T,onMouseLeave:F,onMouseDown:N,onClick:S},e.createElement("svg",{width:"8",height:"13",viewBox:"0 0 8 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M0.589843 1.46298L5.16984 6.05298L0.589844 10.643L1.99984 12.053L7.99984 6.05298L1.99984 0.0529785L0.589843 1.46298Z",fill:"#828282"}))))),a<=1?null:e.createElement("div",{className:"horizontal-tile-paginators-container"},Array.from(Array(a).keys()).map((t=>{let n="paginator-anchor";return t===c&&(n+=" active"),e.createElement("a",{key:`horizontal-tile-page-index-${t}`,className:n,onMouseEnter:e=>{e.stopPropagation(),t!==c&&(t<c?(g(t),f(null)):(g(null),f(t)),p(null))},onMouseLeave:e=>{e.stopPropagation()},onMouseDown:e=>{e.stopPropagation()},onClick:e=>{if(e.stopPropagation(),t===c)return;const n=c,o=t;p(n),u(o),n<o?g(n):f(n)}})}))))};be("horizontal-tile",rt);const it=({graphingTile:t})=>{const n=null==t?void 0:t.tile;if(!n)return null;const[o,r]=l(""),[i,a]=l(null),[d,c]=l([]),u=ve();s((()=>{const e=Object.keys(n.states);if(c(e.map((e=>{var t;return{label:null===(t=n.states[e])||void 0===t?void 0:t.title,value:e}}))),e&&e.length>0){const t=e[0];m(t)}else r(""),a(null)}),[n.states]);const m=e=>{r(e),a(n.states[e])};return e.createElement("div",{className:"selectable-states-tile-component"},e.createElement("div",{className:"selectable-states-tile-header"},e.createElement("div",{className:"selected-state-tile-title"},e.createElement("h6",null,null==i?void 0:i.title)),e.createElement("div",{className:"selectable-states-dropdown-container"},e.createElement(de,{options:d,label:"Select",value:o,handleChange:e=>{var t;m(null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value),(null==u?void 0:u.handleSelectableStatesTileChange)&&(null==u||u.handleSelectableStatesTileChange(e))}}))),e.createElement("div",{className:"selected-state-tile-container"},i?e.createElement(Me,{tilePrefix:o,graphingTiles:i.tiles,responsive:i.responsive,columns:i.columns,containerPadding:i.containerPadding,referenceMargin:i.referenceMargin,referenceWidth:i.referenceWidth}):null))};be("selectable-states-tile",it);const lt=({graphingTile:t,graphingTileIndex:n})=>{const o=null==t?void 0:t.tile;if(!o)return null;const r=ve(),i=e=>{w.isFunction(r.handleUIChange)&&r.handleUIChange(e)};return e.createElement("div",{className:"simple-form-tile-component"},(()=>{if(!w.isArray(o.controls)||o.controls.length<0)return null;const r=o.controls;return e.createElement(et,{graphingTile:t,graphingTileIndex:n,graphingTileControls:r,ControlProps:{onUIChange:i}})})())};be("simple-form-tile",lt);const at=({graphingTile:t,graphingTileIndex:n})=>{const o=null==t?void 0:t.tile;if(!o)return null;const r=[o.control],i={background:t.getBackground()};return e.createElement("div",{className:"single-tile-component",style:i},e.createElement(et,{graphingTile:t,graphingTileIndex:n,graphingTileControls:r}))};be("single-tile",at);const st=({graphingTile:t,graphingTileIndex:n})=>{const o=null==t?void 0:t.tile;if(!o)return null;const r=o.controls;return e.createElement("div",{className:"vertical-tile-component"},e.createElement(et,{graphingTile:t,graphingTileIndex:n,graphingTileControls:r}))};function dt(e,t){const n=ve(),o=null==e?void 0:e.control,[r,i]=l(null);return s((()=>{if(!(o&&(n.data&&n.data[o.dataKey]||t)))return;const e=null!=t?t:n.data[o.dataKey];i(e)}),[o,t,n.data]),{context:n,settings:o,data:r}}be("vertical-tile",st);const ct={};function ut(e,t){ct[e]=t}function mt(e){const t=ct[e];return t?new t:null}function pt(e){const t=[];return e.forEach((e=>{const n=mt(e);n&&t.push(n)})),t}const ht=(e,t,n)=>!(!w.isNullOrUndefined(n)&&""!==(null==n?void 0:n.trim())&&"normal"!==n&&"hover"!==n&&(w.isNullOrUndefined(t)||""===(null==t?void 0:t.trim())))&&(!w.isNullOrUndefined(t)&&""!==(null==t?void 0:t.trim())||!w.isNullOrUndefined(e)&&"warning"!==(null==e?void 0:e.error_0)),gt=(e,t)=>{let n=!1,o=!1;return Object.entries(e).forEach((([e,t])=>{const r=null==t?void 0:t.error;n=n||ht(r),o=o||!0===(null==r?void 0:r.mandatory)})),w.isFunction(t)&&t(n,o),{hasErrors:n,hasMandatoryErrors:o}},vt=(e,t)=>ne(void 0,void 0,void 0,(function*(){var n;const o=(t||{})[e.key];if(!w.isArray(o))return;const r={count:0};return!0===(null===(n=null==e?void 0:e.originalEvent)||void 0===n?void 0:n.noValidate)||o.forEach(((t,n)=>{var o;const i=mt(null!==(o=null==e?void 0:e.validatorType)&&void 0!==o?o:t.type);if(w.isNullOrUndefined(i))return;e.validatorData&&(i.validatorData=e.validatorData);const l=i.validate(t,e.value);r.mandatory=!0===t.mandatory||"AsAtDate"===e.validatorType,r.errors=l,w.isArray(l)&&l.length>0&&l.forEach(((n,o)=>{r[`error_${o}`]=i.getErrorMessage(t,e.control,n),r.count+=1}))})),r})),ft=(e,t,n,o,r)=>ne(void 0,void 0,void 0,(function*(){var i;if(w.isNullOrUndefined(e)||w.isNullOrUndefined(t))return{hasErrors:!1,hasMandatoryErrors:!1};let l;w.isNullOrUndefined(n)?o((e=>(l=Object.assign({},e),e))):l=Object.assign({},n);const a=[];return null===(i=null==e?void 0:e.tiles)||void 0===i||i.forEach((e=>{var n,o,r,i,s;switch(null===(n=null==e?void 0:e.tile)||void 0===n?void 0:n.tileType){case"form-groups-tile":null===(r=null===(o=null==e?void 0:e.tile)||void 0===o?void 0:o.formGroups)||void 0===r||r.forEach((e=>{var n,o;(null===(n=null==e?void 0:e.controls)||void 0===n?void 0:n.length)&&(null===(o=null==e?void 0:e.controls)||void 0===o||o.forEach((e=>{var n,o;if(!(null===(n=null==e?void 0:e.control)||void 0===n?void 0:n.dataKey)||(null==e?void 0:e.control.readOnly))return;const r=l[null===(o=null==e?void 0:e.control)||void 0===o?void 0:o.dataKey];if(r.readOnly||r.hidden)return;a.push(ne(void 0,void 0,void 0,(function*(){var n,o;const i=yield vt({originalEvent:null,control:null==e?void 0:e.control,key:null===(n=null==e?void 0:e.control)||void 0===n?void 0:n.dataKey,value:null==r?void 0:r.value},t);!w.isNullOrUndefined(i)&&i.count>0&&(l[null===(o=null==e?void 0:e.control)||void 0===o?void 0:o.dataKey].error=i)})))})))}));break;case"simple-form-tile":null===(s=null===(i=null==e?void 0:e.tile)||void 0===i?void 0:i.controls)||void 0===s||s.forEach((e=>ne(void 0,void 0,void 0,(function*(){var n,o;if(!(null===(n=null==e?void 0:e.control)||void 0===n?void 0:n.dataKey)||(null==e?void 0:e.control.readOnly))return;const r=l[null===(o=null==e?void 0:e.control)||void 0===o?void 0:o.dataKey];if(r.readOnly||r.hidden)return;a.push(ne(void 0,void 0,void 0,(function*(){var n,o;const i=yield vt({originalEvent:null,control:null==e?void 0:e.control,key:null===(n=null==e?void 0:e.control)||void 0===n?void 0:n.dataKey,value:null==r?void 0:r.value},t);!w.isNullOrUndefined(i)&&i.count>0&&(l[null===(o=null==e?void 0:e.control)||void 0===o?void 0:o.dataKey].error=i)})))}))));break;default:return}})),yield Promise.all(a),o(l),gt(l,r)})),bt=()=>{const[e,t]=l(0),[n,r]=l({});return{updatingCount:e,updatingFlags:n,setUpdating:o((e=>{t((e=>e+1)),r((t=>Object.assign(Object.assign({},t),{[e]:!0})))}),[e,n]),unsetUpdating:o((e=>{t((e=>e-1)),r((t=>Object.assign(Object.assign({},t),{[e]:!1})))}),[e,n])}},yt=(e,t,n,r,i,a)=>{const d=ve(),[c,u]=l(t),[m,p]=l(null),[h,g]=l(null),[v,f]=l(null),[b,y]=l(null),[x,E]=l(!1),w=o((()=>new Promise((t=>{if(x)return void t(x);const n={};Ye(`graphingForm.validateForm.${e}`,{callback:(e,o)=>{n.hasErrors=!0===(null==n?void 0:n.hasErrors)||e,n.hasMandatoryErrors=1==(null==n?void 0:n.hasMandatoryErrors)||o;const r=!n.hasErrors&&!n.hasMandatoryErrors;r||!0===i||E(!0),t(r)}})}))),[x,e]);s((()=>{if(!n)return;ne(void 0,void 0,void 0,(function*(){yield r(null,t,f,y,null!=a?a:()=>{},n),u(t);const e=t.tiles[0];p(e);const o={};e.tile.controls.forEach((e=>{o[e.control.dataKey]=e})),g(o)}))}),[t,n]);const[M,C]=l(!1),[k,T]=l(!1),F=o(((e,t)=>{const n=!0===t;C(!0===e),T(n)}),[]),[N,S]=l(null),O=o((e=>ne(void 0,void 0,void 0,(function*(){var n,o;if(!t||!v||!N)return{hasErrors:!1,hasMandatoryErrors:!1};const{hasErrors:r,hasMandatoryErrors:i}=yield ft(t,v,null,S,F);return(null===(n=null==e?void 0:e.detail)||void 0===n?void 0:n.callback)&&(null===(o=null==e?void 0:e.detail)||void 0===o||o.callback(r,i)),{hasErrors:r,hasMandatoryErrors:i}}))),[t,v,N,F]);_e(`graphingForm.validateForm.${e}`,O);const{updatingCount:D,updatingFlags:P,setUpdating:I,unsetUpdating:R}=bt();return{context:d,settings:c,graphingTile:m,graphingControls:h,inputSchemas:v,dropdownValues:b,data:N,setData:S,updatingCount:D,updatingFlags:P,setUpdating:I,unsetUpdating:R,hasErrors:M,hasMandatoryErrors:k,handleSetHasErrors:F,canSubmit:w}};class xt{constructor(){}getErrorMessage(e,t,n){if(w.isNullOrUndefined(n))return n;if(!w.isNullOrUndefined(null==t?void 0:t.validationErrorMessages)&&!w.isNullOrUndefined(t.validationErrorMessages[n])&&w.isString(t.validationErrorMessages[n])&&""!==t.validationErrorMessages[n].trim())return t.validationErrorMessages[n];switch(n){case"mandatory":return"This field is mandatory. Please ensure it is not empty or invalid";case"required":return"This field is required. Please ensure it is not empty or invalid";case"mbRequired":return"warning";case"enum":return w.isArray(null==e?void 0:e.enum)&&e.enum.length>0?`Value must be in this list: ${e.enum.filter((e=>!w.isNullOrUndefined(e)&&""!==e)).join(", ")}`:"Value must be in enum list";case"as-at-future":return"Your current value's as at date must not be in the future"}return n}validate(e,t){const n=this.validateInputValue(e,t);return!0!==(null==e?void 0:e.mbRequired)||this.validateMbRequired(e,t)||n.push("mbRequired"),n}validateInputValue(e,t){const n=[];return!0!==(null==e?void 0:e.mandatory)||this.validateMandatory(e,t)||n.push("mandatory"),!0!==(null==e?void 0:e.required)||this.validateRequired(e,t)||n.push("required"),w.isArray(null==e?void 0:e.enum)&&(null==e?void 0:e.enum.length)>0&&!this.validateEnum(null==e?void 0:e.enum,t)&&n.push("enum"),n}validateMandatory(e,t){return!w.isNullOrUndefined(t)}validateRequired(e,t){return this.validateMandatory(e,t)}validateMbRequired(e,t){return this.validateMandatory(e,t)}validateEnum(e,t){return!(w.isArray(e)&&0!==e.length&&!w.isNullOrUndefined(t))||e.includes(t)}}class Et extends xt{validateInputValue(e,t){return super.validateInputValue(e,t)}validateMandatory(e,t){return!!super.validateMandatory(e,t)&&!!t.formatted}}ut("Address",Et);class wt extends xt{validateInputValue(e,t){const n=super.validateInputValue(e,t);if(n.length>0)return n;if(M.isValid(t)){const e=new Date(t),o=M.todayUtc();e.getTime()>o.getTime()&&n.push("as-at-future")}return n}validateMandatory(e,t){return!!super.validateMandatory(e,t)&&M.isValid(t)}}ut("AsAtDate",wt);class Mt extends xt{validateInputValue(e,t){const n=super.validateInputValue(e,t);return t=C.parse(t),C.isValid(e.min)&&!this.validateMin(e.min,t)&&n.push("min"),C.isValid(e.max)&&!this.validateMax(e.max,t)&&n.push("max"),n}getErrorMessage(e,t,n){switch(n){case"min":return`Data not saved. The value must be greater than or equal to ${C.getCurrencyText(e.min,!1,e.decimalPlaces||2,"")}`;case"max":return`Data not saved. The value must be less than or equal to ${C.getCurrencyText(e.max,!1,e.decimalPlaces||2,"")}`;default:return super.getErrorMessage(e,t,n)}}validateMin(e,t){return!C.isValid(e)||!C.isValid(t)||t>=e}validateMax(e,t){return!C.isValid(e)||!C.isValid(t)||t<=e}}ut("Number",Mt);class Ct extends Mt{validateInputValue(e,t){return super.validateInputValue(e,t)}getErrorMessage(e,t,n){switch(n){case"min":return`Data not saved. The value must be greater than or equal to ${C.getCurrencyText(e.min,!1,e.decimalPlaces||2)}`;case"max":return`Data not saved. The value must be less than or equal to ${C.getCurrencyText(e.max,!1,e.decimalPlaces||2)}`;default:return super.getErrorMessage(e,t,n)}}}ut("Currency",Ct);class kt extends xt{getErrorMessage(e,t,n){var o,r,i,l;switch(n=super.getErrorMessage(e,t,n)){case"min":if(M.isValid(null===(o=this.validatorData)||void 0===o?void 0:o.min)){const e=M.parse(null===(r=this.validatorData)||void 0===r?void 0:r.min);return`Value cannot be before ${M.format(e,"DD/MM/yyyy")}`}break;case"max":if(M.isValid(null===(i=this.validatorData)||void 0===i?void 0:i.max)){const e=M.parse(null===(l=this.validatorData)||void 0===l?void 0:l.max);return`Value cannot be after ${M.format(e,"DD/MM/yyyy")}`}}return n}validateInputValue(e,t){var n,o,r,i;const l=super.validateInputValue(e,t);if(0===l.length&&M.isValid(t)){const e=M.parse(t);if(M.isValid(null===(n=this.validatorData)||void 0===n?void 0:n.min)){const t=M.parse(null===(o=this.validatorData)||void 0===o?void 0:o.min);(null==t?void 0:t.getTime())>(null==e?void 0:e.getTime())&&l.push("min")}if(M.isValid(null===(r=this.validatorData)||void 0===r?void 0:r.max)){const t=M.parse(null===(i=this.validatorData)||void 0===i?void 0:i.max);(null==t?void 0:t.getTime())<(null==e?void 0:e.getTime())&&l.push("max")}}return l}validateMandatory(e,t){return!!super.validateMandatory(e,t)&&M.isValid(t)}}ut("Date",kt);class Tt extends xt{validateInputValue(e,t){const n=super.validateInputValue(e,t);return!w.isNullOrUndefined(e.minLength)&&E.isValid(e.minLength)&&e.minLength>0&&!this.validateMinLength(e.minLength,t)&&n.push("minLength"),!w.isNullOrUndefined(e.maxLength)&&E.isValid(e.maxLength)&&e.maxLength>0&&!this.validateMaxLength(e.maxLength,t)&&n.push("maxLength"),!w.isNullOrUndefined(e.match)&&w.isString(e.match)&&e.match.length>0&&!this.validateMatch(e.match,t)&&n.push("match"),n}getErrorMessage(e,t,n){const o=super.getErrorMessage(e,t,n);switch(o){case"minLength":return`Data not saved. Minimum ${e.minLength} characters are required`;case"maxLength":return`Data not saved. Maximum ${e.maxLength} characters are allowed`;case"match":return"Data not saved. This field contains invalid characters";default:return o}}validateMinLength(e,t){return!(!(!E.isValid(e)||e<=0||w.isNullOrUndefined(t))&&w.isString(t))||t.length>=e}validateMaxLength(e,t){return!(!(!E.isValid(e)||e<=0||w.isNullOrUndefined(t))&&w.isString(t))||t.length<=e}validateMatch(e,t){if(w.isNullOrUndefined(e)||!w.isString(e)||""===e.trim())return!0;if(w.isNullOrUndefined(t)||!w.isString(t)||""===t.trim())return!0;const n=e.match(/(\/?)(.+)\1([a-z]*)/i),o=n[2],r=n[3];return new RegExp(o,r).test(t)}validateMandatory(e,t){return!!super.validateMandatory(e,t)&&(w.isString(t)&&t.length>0&&""!==t.trim())}}ut("String",Tt);class Ft extends Tt{validateInputValue(e,t){return super.validateInputValue(e,t)}}ut("Notes",Ft);class Nt extends xt{validateInputValue(e,t){return super.validateInputValue(e,t)}}ut("ObjectId",Nt);class St extends xt{validateInputValue(e,t){return super.validateInputValue(e,t)}}ut("[ObjectId]",St);class Ot extends xt{validateInputValue(e,t){return super.validateInputValue(e,t)}validateMandatory(e,t){var n,o,r;if(!super.validateMandatory(e,t))return!1;switch(null==t?void 0:t.ownershipType){case"Sole":return 1===(null===(n=null==t?void 0:t.owners)||void 0===n?void 0:n.length);case"Joint":return 2===(null===(o=null==t?void 0:t.owners)||void 0===o?void 0:o.length);case"Other":return(null===(r=null==t?void 0:t.owners)||void 0===r?void 0:r.length)>=1}return!1}}ut("Ownership",Ot);class Dt extends Mt{validateInputValue(e,t){return super.validateInputValue(e,t)}getErrorMessage(e,t,n){switch(n){case"min":return`Data not saved. The value must be greater than or equal to ${C.getCurrencyText(e.min,!1,e.decimalPlaces||2,"")}%`;case"max":return`Data not saved. The value must be less than or equal to ${C.getCurrencyText(e.max,!1,e.decimalPlaces||2,"")}%`;default:return super.getErrorMessage(e,t,n)}}}ut("Percentage",Dt);class Pt extends xt{validateInputValue(e,t){return super.validateInputValue(e,t)}}ut("SelectBoolean",Pt);class It extends xt{validateInputValue(e,t){return super.validateInputValue(e,t)}validateMandatory(e,t){return!!super.validateMandatory(e,t)&&(w.isString(t)&&t.length>0&&""!==t.trim()&&null!==E.parse(t))}}ut("SelectNumber",It);class Rt extends xt{validateInputValue(e,t){return super.validateInputValue(e,t)}validateMandatory(e,t){return!w.isNullOrUndefined(t)&&""!==t.trim()&&this.validateEnum(e.enum,t)}}ut("Select",Rt);const Vt=(e,t,n)=>{De(e,t),Je(e,n)},At=()=>{const e=Ut.pop();e&&(e.classList.add("moorr-modal-container-closing"),setTimeout((()=>{e&&(q.unmountComponentAtNode(e),e.remove())}),300))};let Lt=class{constructor(e){this._props=e}open(){const t=this._props;return new Promise(((n,o)=>{let r,i;"function"==typeof t.onClose&&(r=t.onClose),t.onClose=e=>{r&&r(e),n({dismissed:!1,result:e}),t.showModal=!1,At()},"function"==typeof t.onDismiss&&(i=t.onClose),t.onDismiss=()=>{i&&i(),n({dismissed:!0}),t.showModal=!1,At()},t.showModal=!0;let l=e.createElement(he,{stylePrefix:"MoorrReactMuiModal"},e.createElement(this.getComponent(),t));Ut.push(this._container=document.createElement("div")),this._container.className="moorr-modal-container",document.body.appendChild(this._container),q.render(l,this._container)}))}};const Ut=[],jt={},Bt=N((e=>({modal:{display:"flex",alignItems:"center",justifyContent:"center"},paper:{width:825,backgroundColor:e.palette.background.paper,borderRadius:"5px",boxShadow:e.shadows[5],padding:e.spacing(2,4,3)}}))),$t=t=>{var n,o,r,i,a,d,c,u;const m=Bt(),p={};t.fixedWidth&&(p.width=t.fixedWidth),t.fixedHeight&&(p.height=t.fixedHeight),t.fixedHeight&&(p.height=t.fixedHeight),(null===(n=t.margins)||void 0===n?void 0:n.left)&&(p.marginLeft=null===(o=t.margins)||void 0===o?void 0:o.left),(null===(r=t.margins)||void 0===r?void 0:r.right)&&(p.marginRight=null===(i=t.margins)||void 0===i?void 0:i.right),(null===(a=t.margins)||void 0===a?void 0:a.top)&&(p.marginTop=null===(d=t.margins)||void 0===d?void 0:d.top),(null===(c=t.margins)||void 0===c?void 0:c.bottom)&&(p.marginBottom=null===(u=t.margins)||void 0===u?void 0:u.bottom);let h=m.paper+" moorr-modal-content-container";t.contentClassName&&(h+=" "+t.contentClassName);const[g,v]=l(!1),[b,y]=l(!1);s((()=>{y(!g&&!1!==t.showModal)}),[g,b,t.showModal]);const x=e=>{v(!0),(null==t?void 0:t.onDismiss)&&t.onDismiss(e)};let E=m.modal;switch(E+=" moorr-modal-container",t.effect){case"fade":E+=" moorr-fade-modal";break;case"slide":E+=" moorr-slide-modal"}return g&&(E+=" moorr-modal-closing"),e.createElement(R,{disableEnforceFocus:!0,className:E,open:b,onClose:x,closeAfterTransition:!0,BackdropComponent:V,BackdropProps:{timeout:300,onClick:e=>{e.preventDefault(),e.stopPropagation(),w.isFunction(t.onBackdropClick)?t.onBackdropClick(e):x("backdrop")}}},(()=>{switch(t.effect){case"fade":default:return e.createElement(A,{in:b},e.createElement("div",{className:h,style:p},t.children));case"slide":return e.createElement(f,{in:b,direction:"left",timeout:300},e.createElement("div",{className:h},t.children))}})())},zt=(t,n)=>{switch(t){default:case"info":case"warning":case"error":(t=>{K(t,{icon:e.createElement(_,{sx:{color:"#EB5757"}}),style:{color:"#EB5757",backgroundColor:"#FCECEC",border:"2px solid #EB5757",fontFamily:'"Poppins", sans-serif',borderRadius:"0.7em",marginLeft:"-100px"},closeButton:()=>e.createElement(Y,{sx:{color:"#EB5757"}})})})(n);break;case"success":(t=>{K(t,{icon:e.createElement(X,{sx:{color:"#1B5E20"}}),style:{color:"#1B5E20",backgroundColor:"#E8F5E9",border:"2px solid #1B5E20",fontFamily:'"Poppins", sans-serif',borderRadius:"0.7em",marginLeft:"-100px"},closeButton:()=>e.createElement(Y,{sx:{color:"#1B5E20"}})})})(n)}},Ht=t=>e.createElement($t,{effect:"fade",contentClassName:`${t.className}-content-container`,fixedWidth:t.widthValue,fixedHeight:t.heightValue,margins:t.marginValues,showModal:t.showModal,onClose:t.onClose,onDismiss:t.onDismiss,onBackdropClick:t.onBackdropClick},e.createElement("div",{className:`${t.className} moorr-modal-container`},e.createElement("div",{className:"moorr-modal-header"},t.renderHeader),e.createElement("div",{className:"moorr-modal-body"},t.renderBody),!1===t.hasFooter?null:e.createElement("div",{className:"moorr-modal-footer"},e.createElement("div",{className:"left-buttons"},t.renderLeftButtons),e.createElement("div",{className:"status-message"},t.renderStatusMessage),e.createElement("div",{className:"right-buttons"},t.renderRightButtons)))),Gt=t=>{const{className:n,onDismiss:r,showModal:i,onClose:l,icon:a,title:s,body:d,closeLabel:c}=t,u=o((()=>{l(!1)}),[l]);o((()=>{l(!0)}),[l]);const p=o((()=>w.isString(d)?e.createElement(m,{paragraph:!0},d):w.isArray(d)&&d.length>0?d.map(((t,n)=>{const o=`paragraph-${n}`;if(w.isString(t)||!w.isNullOrUndefined(t))return e.createElement(m,{paragraph:!0,key:o},t)})):w.isNullOrUndefined(d)?e.createElement(m,{paragraph:!0},"Please alert to continue."):d),[d]),g=o((()=>e.createElement(h,{sx:{marginBottom:"0.5rem","& > .MuiTypography-root.MuiTypography-paragraph":{fontFamily:"Poppins,sans-serif",fontSize:"14px !important",fontWeight:400,lineHeight:"20px"},"& > .MuiTypography-root.MuiTypography-paragraph .MuiTypography-root.MuiTypography-body1":{fontFamily:"inherit !important",fontSize:"inherit !important",fontWeight:"inherit",lineHeight:"inherit"},"& > .MuiTypography-root.MuiTypography-paragraph strong.MuiTypography-root.MuiTypography-body1":{fontWeight:"600 !important"}}},p())),[p]),v=o((()=>w.isString(s)||!w.isNullOrUndefined(s)?s:"Alert"),[s]),f=o((()=>e.createElement(h,{sx:{position:"relative",marginBottom:"0.5rem","& > .MuiSvgIcon-root":{color:"#541868",fontSize:"2rem"}}},null!=a?a:e.createElement(b,null),e.createElement(m,{variant:"h6",sx:{color:"#541868",fontFamily:"Poppins,sans-serif",fontSize:"16px !important",fontWeight:400,lineHeight:22}},v()),e.createElement(y,{onClick:u,sx:{position:"absolute",top:"-0.5rem",right:"-0.5rem"},"data-testid":"dismiss"},e.createElement(Y,{sx:{fontSize:"1rem"}})))),[a,v,u]),x=o((()=>{const t=c||"Dismiss";return e.createElement(oe,{handleClick:u,label:t,"data-testid":`${k.toKebabCase(t)}`})}),[c,u]);return e.createElement(Ht,{className:"alert-modal"+(n?" "+n:""),widthValue:"400px",showModal:!0===i,onDismiss:r,onBackdropClick:u,renderHeader:f(),renderBody:g(),renderStatusMessage:x()})};class Wt extends Lt{constructor(e){super(e)}getComponent(){return Gt}}jt.alert=Wt;const qt=t=>{const{className:n,onDismiss:r,showModal:i,onClose:l,icon:a,title:s,body:d,cancelLabel:c,confirmLabel:u}=t,p=o((()=>{l(!1)}),[l]),g=o((()=>{l(!0)}),[l]),v=o((()=>w.isString(d)?e.createElement(m,{paragraph:!0},d):w.isArray(d)&&d.length>0?d.map(((t,n)=>{const o=`paragraph-${n}`;if(w.isString(t)||!w.isNullOrUndefined(t))return e.createElement(m,{paragraph:!0,key:o},t)})):w.isNullOrUndefined(d)?e.createElement(m,{paragraph:!0},"Please confirm to continue."):d),[d]),f=o((()=>e.createElement(h,{sx:{marginBottom:"0.5rem","& > .MuiTypography-root.MuiTypography-paragraph":{fontFamily:"Poppins,sans-serif",fontSize:"14px !important",fontWeight:400,lineHeight:"20px"},"& > .MuiTypography-root.MuiTypography-paragraph .MuiTypography-root.MuiTypography-body1":{fontFamily:"inherit !important",fontSize:"inherit !important",fontWeight:"inherit",lineHeight:"inherit"},"& > .MuiTypography-root.MuiTypography-paragraph strong.MuiTypography-root.MuiTypography-body1":{fontWeight:"600 !important"}}},v())),[v]),x=o((()=>w.isString(s)||!w.isNullOrUndefined(s)?s:"Confirm"),[s]),E=o((()=>e.createElement(h,{sx:{position:"relative",marginBottom:"0.5rem","& > .MuiSvgIcon-root":{color:"#541868",fontSize:"2rem"}}},null!=a?a:e.createElement(b,null),e.createElement(m,{variant:"h6",sx:{color:"#541868",fontFamily:"Poppins,sans-serif",fontSize:"16px !important",fontWeight:400,lineHeight:22}},x()),e.createElement(y,{onClick:p,sx:{position:"absolute",top:"-0.5rem",right:"-0.5rem"}},e.createElement(Y,{sx:{fontSize:"1rem"},"data-testid":"dismiss"})))),[a,x,p]),M=o((()=>{const t=c||"Cancel";return e.createElement(ie,{handleClick:p,label:t,"data-testid":`${k.toKebabCase(t)}`})}),[c,p]),C=o((()=>{const t=u||"Dismiss";return e.createElement(oe,{handleClick:g,label:t,"data-testid":`${k.toKebabCase(t)}`})}),[u,g]);return e.createElement(Ht,{className:"confirm-modal"+(n?" "+n:""),widthValue:"400px",showModal:!0===i,onDismiss:r,onBackdropClick:p,renderHeader:E(),renderBody:f(),renderLeftButtons:M(),renderRightButtons:C()})};class Kt extends Lt{constructor(e){super(e)}getComponent(){return qt}}jt.confirm=Kt;const _t=t=>{const{className:n,header:o,body:r,leftButtonLabel:i,rightButtonLabel:l,hiddenClose:a,width:s}=t,d=e=>{e.stopPropagation(),t.onDismiss()};return e.createElement(Ht,{className:"opti-info-modal"+(n?" "+n:""),widthValue:null!=s?s:"554px",showModal:!0===t.showModal,onDismiss:t.onDismiss,renderBody:e.createElement(h,{sx:{display:"flex",flexDirection:"row",position:"relative"}},e.createElement(h,{sx:{position:"absolute",right:"12px",top:"12px",cursor:"pointer"}},e.createElement("svg",{onClick:t.onDismiss,width:"20",height:"20",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M16.8564 6.35381L12.2707 10.9395L16.8976 15.5664L15.5609 16.903L10.9341 12.2762L6.36889 16.8414L5.13506 15.6075L9.70023 11.0424L5.07337 6.4155L6.41002 5.07885L11.0369 9.70571L15.6226 5.11998L16.8564 6.35381Z",fill:"#541868"}))),e.createElement(h,{sx:{width:"60px",background:"#541868",borderTopLeftRadius:"5px",borderBottomLeftRadius:"5px",flexShrink:0}}),e.createElement(h,{sx:{position:"absolute",top:"11.81px",left:"12px",borderRadius:"50% 50% 0% 50%",padding:"5px",background:"white"}},e.createElement("img",{style:{height:"50px",background:"#66E84B",borderRadius:"50% 50% 0% 50%",padding:"5px"},src:"/assets/img/opti/Opti-Blinked.gif"})),e.createElement(h,{sx:{padding:"1rem 1rem 1rem 1.5rem"}},e.createElement(h,{sx:{color:"#541868",fontSize:"16px",lineHeight:"22.4px",fontWeight:400}},o),e.createElement(h,{sx:{marginTop:"1rem"}},r),e.createElement(h,{className:"opti-info-modal-buttons",sx:{textAlign:"right",marginTop:"1rem"}},i&&e.createElement(x,{className:"opti-info-modal-button-left",style:{marginRight:"5px"},variant:"contained",color:"primary",onClick:()=>{},"data-testid":`${k.toKebabCase(i)}`},i),!a&&e.createElement(oe,{label:"Close",handleClick:d,"data-testid":"close"}))))})};class Yt extends Lt{constructor(e){super(e)}getComponent(){return _t}}jt.optiInfo=Yt;const Xt=e=>{var t,n,o,r,i;const l=null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.modal;if(!l||!jt[l])return Promise.reject("invalid-modal");const a=new jt[l]((null===(n=null==e?void 0:e.detail)||void 0===n?void 0:n.props)||{}).open();(null===(o=null==e?void 0:e.detail)||void 0===o?void 0:o.then)&&a.then((t=>{var n;try{null===(n=null==e?void 0:e.detail)||void 0===n||n.then(t)}catch(e){console.error(e)}})),(null===(r=null==e?void 0:e.detail)||void 0===r?void 0:r.catch)&&a.catch(null===(i=null==e?void 0:e.detail)||void 0===i?void 0:i.catch),a.finally((()=>{var t,n;if(null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.finally)try{null===(n=null==e?void 0:e.detail)||void 0===n||n.finally()}catch(e){console.error(e)}})),(null==e?void 0:e.detail)&&((null==e?void 0:e.detail).promise=a)};document&&(document.removeEventListener("openModal",Xt),document.addEventListener("openModal",Xt));const Zt=(e,t)=>{const[n,r]=l(null),i=a(null),d=o((e=>{if(!e)return;const n=Object.assign({},e.contentRect.toJSON());E.isValid(t)&&t>0?(clearTimeout(i.current),i.current=setTimeout((()=>{r(n)}),t)):r(n)}),[t]);return s((()=>{const t=e.current;let n;return t&&(n=new ResizeObserver((([e])=>d(e))),n.observe(t)),()=>{n&&t&&(n.unobserve(t),n.disconnect())}}),[e.current]),n},Jt=r({}),Qt=()=>i(Jt),en=()=>({context:Qt()}),tn=(e,t,n)=>{var r,i;const{context:a}=en();s((()=>{var e,t;w.mutexRelease(null!==(t=null===(e=null==a?void 0:a.sectionContext)||void 0===e?void 0:e.updateSessionId)&&void 0!==t?t:"default")}),[null===(r=null==a?void 0:a.sectionContext)||void 0===r?void 0:r.updateSessionId]);const[d,c]=l(0),u=o((()=>{c((e=>e+1))}),[]),[m,p]=l(!1),[h,g]=l(!1),v=o(((e,t)=>{const n=!0===t;p(!0===e),g(n)}),[]),f=o((n=>ne(void 0,void 0,void 0,(function*(){if(w.isFunction(t)){const[e]=yield Promise.all([t(n)]);if(!e)return}return a.onMoveBack&&a.onMoveBack({section:e,data:n})}))),[h,t,a.onMoveBack]),[b,y]=l(!1),[x,E]=l(!1),[M,C]=l(null);s((()=>{x&&a.onMoveNext&&a.onMoveNext({section:e,data:M})}),[x,M]);const k=o((e=>ne(void 0,void 0,void 0,(function*(){var t,o;try{y(!0),yield w.delay(350),yield w.mutex(null!==(o=null===(t=null==a?void 0:a.sectionContext)||void 0===t?void 0:t.updateSessionId)&&void 0!==o?o:"default",(()=>ne(void 0,void 0,void 0,(function*(){if(yield w.delay(350),w.isFunction(n)){const[t]=yield Promise.all([n(e)]);if(!t)return}else if(m||h)return;E(!0),C(e)}))))}finally{y(!1)}}))),[null===(i=null==a?void 0:a.sectionContext)||void 0===i?void 0:i.updateSessionId,m,h,n]),{updatingCount:T,updatingFlags:F,setUpdating:N,unsetUpdating:S}=bt();return{context:a.sectionContext,sectionStep:d,nextSectionStep:u,hasErrors:m,hasMandatoryErrors:h,handleSetHasErrors:v,moveBack:f,moveNext:k,awaitingMoveNext:b,updatingCount:T,updatingFlags:F,setUpdating:N,unsetUpdating:S}},nn=(e,t,n)=>{const[r,i]=l(t),[a,d]=l(null),[c,u]=l(null),[m,p]=l(null),[h,g]=l(!1),v=o((()=>new Promise((t=>{if(h)return void t(h);const n={};Ye(`wizardSection.validateForm.${e}`,{callback:(e,o)=>{n.hasErrors=!0===(null==n?void 0:n.hasErrors)||e,n.hasMandatoryErrors=1==(null==n?void 0:n.hasMandatoryErrors)||o;const r=!n.hasErrors&&!n.hasMandatoryErrors;r||g(!0),t(r)}})}))),[h,e]),{context:f,sectionStep:b,nextSectionStep:y,updatingCount:x,updatingFlags:E,setUpdating:w,unsetUpdating:M,hasErrors:C,hasMandatoryErrors:k,handleSetHasErrors:T,moveBack:F,moveNext:N,awaitingMoveNext:S}=tn(e,void 0,v);s((()=>{if(!(null==f?void 0:f.validationSchemas))return;ne(void 0,void 0,void 0,(function*(){yield n(null,t,p,(()=>{}),(()=>{}),f.validationSchemas),i(t);const e=t.tiles[0];d(e);const o={};e.tile.controls.forEach((e=>{o[e.control.dataKey]=e})),u(o)}))}),[t,null==f?void 0:f.validationSchemas]);const[O,D]=l(null),P=o((e=>ne(void 0,void 0,void 0,(function*(){var n,o;if(!t||!m||!O)return{hasErrors:!1,hasMandatoryErrors:!1};const{hasErrors:r,hasMandatoryErrors:i}=yield ft(t,m,null,D,T);return(null===(n=null==e?void 0:e.detail)||void 0===n?void 0:n.callback)&&(null===(o=null==e?void 0:e.detail)||void 0===o||o.callback(r,i)),{hasErrors:r,hasMandatoryErrors:i}}))),[t,m,O,T]);return _e(`wizardSection.validateForm.${e}`,P),{context:f,sectionStep:b,nextSectionStep:y,settings:r,graphingTile:a,graphingControls:c,inputSchemas:m,data:O,setData:D,updatingCount:x,updatingFlags:E,setUpdating:w,unsetUpdating:M,hasErrors:C,hasMandatoryErrors:k,handleSetHasErrors:T,moveBack:F,moveNext:N,awaitingMoveNext:S}},on=e=>{const[t,n]=l(e),[o,r]=l(null),[i,a]=l(null);return s((()=>{n(e);const t=e.tiles[0];r(t);const o={};t.tile.controls.forEach((e=>{o[e.control.dataKey]=e})),a(o)}),[e]),{settings:t,graphingTile:o,graphingControls:i}},rn=t(((t,n)=>{var{stepIndex:o,sectionStep:r,onNextSectionStep:i,onStepIncrease:l,enterTimeout:a,onEntered:s,children:d}=t,c=te(t,["stepIndex","sectionStep","onNextSectionStep","onStepIncrease","enterTimeout","onEntered","children"]);return e.createElement(J,{in:r>=o,timeout:{enter:null!=a?a:600},mountOnEnter:!0,onEntered:()=>{i&&i(),s&&s()}},e.createElement(Z,Object.assign({},c,{ref:n}),d))})),ln=t(((t,r)=>{var i,l,{section:a,children:d,animate:c,animateIn:m,animateOut:p,animateEasing:h,animateDuration:g,maxWidth:v,sx:f}=t,b=te(t,["section","children","animate","animateIn","animateOut","animateEasing","animateDuration","maxWidth","sx"]);const y=u("(max-width: 700px)"),x=Qt();s((()=>{x.setSectionMaxWidth(null!=v?v:0)}),[v]);const M=n((()=>{var e;let t={position:"absolute",height:"100%",top:0,overflowY:"auto",overflowX:"hidden","&::-webkit-scrollbar":{width:"6px",height:"6px"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#a98bb3",borderRadius:"6px"},"&::-webkit-scrollbar-thumb:hover":{backgroundColor:"rgb(118, 70, 134)"},"&::-webkit-scrollbar-track":{background:"rgba(118, 70, 134, 0.15)",borderRadius:"6px"}};if(!y&&E.isValid(v)&&v>0&&!w.isNullOrUndefined(null===(e=x.containerRect)||void 0===e?void 0:e.width)&&x.containerRect.width>v){const e=Math.floor((x.containerRect.width-v)/2);t=Object.assign(Object.assign({},t),{left:e,width:`calc(100% - ${e}px)`})}else t=Object.assign(Object.assign({},t),{left:0,width:"100%",padding:y?"0 0.75rem":"0"});return t}),[y,v,null===(i=x.containerRect)||void 0===i?void 0:i.width]),C=n((()=>{var e;let t=Object.assign(Object.assign({},f),{width:"100%"});return E.isValid(v)&&v>0&&!w.isNullOrUndefined(null===(e=x.containerRect)||void 0===e?void 0:e.width)&&x.containerRect.width>v&&(t=Object.assign(Object.assign({},t),{maxWidth:v})),t}),[f,v,null===(l=x.containerRect)||void 0===l?void 0:l.width]),k=o((()=>e.createElement(Z,Object.assign({},b,{ref:r,className:`wizard-section wizard-section-${a}`,sx:M}),e.createElement(Z,{sx:C},d))),[a,M,C,d,b]),T=n((()=>{var e;return null!==(e=null!=c?c:x.animate)&&void 0!==e?e:"fade"}),[x.animate,c]),F=n((()=>({enter:!1!==m?null!=g?g:300:0,exit:!1!==p?null!=g?g:300:0})),[m,p,g]),N=n((()=>null!=h?h:"ease-in-out"),[]),S=o((()=>e.createElement(J,{easing:N,timeout:F,in:x.section===a,mountOnEnter:!0,unmountOnExit:!0,onEnter:e=>{e.style.opacity="0"},onEntering:e=>{e.style.opacity="1"},onEntered:e=>{e.style.opacity="",e.style.transition="",x.setSectionMaxWidth(null!=v?v:0)}},k())),[N,F,x.section,a,k]),O=n((()=>{switch(T){case"scroll-up":return"back"!==x.moveDirection?x.section===a?"up":"down":x.section===a?"down":"up";case"scroll-down":return"back"!==x.moveDirection?x.section===a?"down":"up":x.section===a?"up":"down";case"scroll-left":return"back"!==x.moveDirection?x.section===a?"left":"right":x.section===a?"right":"left";case"scroll-right":return"back"!==x.moveDirection?x.section===a?"right":"left":x.section===a?"left":"right"}}),[x.section,x.moveDirection,a,T]),D=o((()=>e.createElement(Q,{container:x.containerRef.current,direction:O,easing:N,timeout:F,in:x.section===a,mountOnEnter:!0,unmountOnExit:!0,onEnter:e=>{var t,n,o,r;switch(O){case"up":e.style.transform=e.style.webkitTransform=`translateY(${null===(t=x.containerRect)||void 0===t?void 0:t.height}px)`;break;case"down":e.style.transform=e.style.webkitTransform=`translateY(-${null===(n=x.containerRect)||void 0===n?void 0:n.height}px)`;break;case"left":e.style.transform=e.style.webkitTransform=`translateX(${null===(o=x.containerRect)||void 0===o?void 0:o.width}px)`;break;case"right":e.style.transform=e.style.webkitTransform=`translateX(-${null===(r=x.containerRect)||void 0===r?void 0:r.height}px)`}},onEntering:e=>{switch(O){case"up":case"down":e.style.transform=e.style.webkitTransform="translateY(0)";break;case"left":case"right":e.style.transform=e.style.webkitTransform="translateX(0)"}},onEntered:e=>{e.style.transform="",e.style.webkitTransform="",e.style.transition="",x.setSectionMaxWidth(null!=v?v:0)}},k())),[N,F,x.section,a,O,x.containerRect,k]),P=o((()=>{switch(T){case"fade":return S();case"scroll-up":case"scroll-down":case"scroll-left":case"scroll-right":return D()}return x.section!==a?null:k()}),[x.section,a,T,S,D,k]);return e.createElement(e.Fragment,null,P())})),an=t((({children:t,initialSection:r,animate:i,avatar:c,isAvatarVisible:u,sx:m,onMoveBack:p,onMoveNext:h,onSectionChange:g,sectionContext:v},f)=>{const b=a(null),y=Zt(b),[x,M]=l(r);s((()=>{r&&g&&g(r)}),[r]);const[C,k]=l(null),[T,F]=l(),N=a(null),S=Zt(N),O=o(((e,t)=>{e!==x&&(M(e),k(null!=t?t:null),g&&g(e))}),[x,g]),D=n((()=>({containerRef:b,containerRect:y,section:x,moveDirection:C,onMoveBack:p,onMoveNext:h,changeSection:O,setSectionMaxWidth:F,animate:i,sectionContext:v})),[y,x,C,p,h,O,i,v]);d(f,(()=>({section:x,context:D})),[x,D]);const P=n((()=>{if(w.isNullOrUndefined(y))return null;if(w.isNullOrUndefined(c)||w.isNullOrUndefined(S))return null;let e={display:"inline-block",position:"absolute"};return e=w.isFunction(u)&&!u(x)?Object.assign(Object.assign({},e),{opacity:0}):Object.assign(Object.assign({},e),{opacity:1}),E.isValid(T)&&T>0&&(e=Object.assign(Object.assign({},e),{left:Math.floor((y.width-T)/2)-S.width})),e}),[y,c,u,S,T]),I=o((()=>w.isNullOrUndefined(T)||0===T||w.isNullOrUndefined(P)?null:c),[T,c,P]);return e.createElement(Z,{ref:b,sx:Object.assign({position:"relative"},m)},e.createElement(Jt.Provider,{value:D},e.createElement(Z,{ref:N,sx:P},I()),t))}));export{Et as AddressValidator,Wt as AlertModal,wt as AsAtDateValidator,ee as Button,Kt as ConfirmModal,Ct as CurrencyValidator,kt as DateValidator,de as Dropdown,Ht as FadeModal,Le as FormGroupAddActionModel,Ue as FormGroupModel,ot as FormGroupsTile,ze as FormGroupsTileModel,Ve as FormInputModel,ge as GraphingContext,Qe as GraphingControl,Re as GraphingControlModel,Ae as GraphingControlSettingsModel,Xe as GraphingGrid,tt as GraphingPage,Se as GraphingSettingsModel,ye as GraphingTile,et as GraphingTileControls,je as GraphingTileModel,Ne as GraphingTileSettingsModel,Me as GraphingTiles,rt as HorizontalTile,He as HorizontalTileModel,Lt as Modal,$t as MoorrModal,$e as MultipleControlsTileModel,Ft as NotesValidator,Mt as NumberValidator,Nt as ObjectIdValidator,St as ObjectIdsValidator,Yt as OptiInfoModal,Ot as OwnershipValidator,Dt as PercentageValidator,oe as PrimaryButton,re as QtyButton,ie as SecondaryButton,Pt as SelectBooleanValidator,le as SelectButton,It as SelectNumberValidator,Rt as SelectValidator,it as SelectableStatesTile,Ge as SelectableStatesTileModel,lt as SimpleFormTile,We as SimpleFormTileModel,Be as SingleControlTileModel,at as SingleTile,qe as SingleTileModel,Tt as StringValidator,he as StylesProvider,me as SvgIcon,xt as Validator,st as VerticalTile,Ke as VerticalTileModel,an as Wizard,ln as WizardSection,rn as WizardSectionStep,gt as checkDataForErrors,Pe as createGraphingControl,Ie as createGraphingControls,Te as createGraphingTile,Fe as createGraphingTiles,mt as createValidator,pt as createValidators,Ye as dispatchRootEvent,ht as hasInputError,jt as modals,Ut as modalsStack,De as registerGraphingControl,Je as registerGraphingControlComponent,Vt as registerGraphingFrameworkComponent,ke as registerGraphingTile,be as registerGraphingTileComponent,ue as registerSvgIconComponent,ut as registerValidator,zt as toastMessage,ve as useGraphingContext,yt as useGraphingForm,dt as useGraphingFramework,Zt as useResizeObserver,_e as useRootEventListener,bt as useUpdateTracker,en as useWizard,Qt as useWizardContext,on as useWizardForm,nn as useWizardFormSection,tn as useWizardSection,ft as validateData,vt as validateInput};
|
|
1
|
+
import e,{forwardRef as t,useMemo as n,useCallback as o,createContext as r,useContext as i,useState as l,useRef as a,useEffect as s,useImperativeHandle as d}from"react";import c from"@mui/material/Button";import{useMediaQuery as u,Typography as m,SpeedDial as p,Box as h,SpeedDialIcon as g,SpeedDialAction as v,Slide as f,Icon as b,IconButton as y,Button as x}from"@mui/material";import{integers as E,utils as w,dates as M,decimals as C,strings as k}from"moorr-common";import T from"@mui/material/IconButton";import F from"@material-ui/core/MenuItem";import{makeStyles as N,createStyles as S,withStyles as O,StylesProvider as D}from"@material-ui/core/styles";import P from"@material-ui/core/TextField";import{StylesProvider as I,Modal as R,Backdrop as V,Fade as A}from"@material-ui/core";import{createGenerateClassName as L,StylesProvider as U}from"@material-ui/styles";import{v4 as j}from"uuid";import B,{Responsive as $}from"react-grid-layout";import z from"@mui/material/Accordion";import H from"@mui/material/AccordionSummary";import G from"@mui/material/AccordionDetails";import W from"@mui/icons-material/ExpandMore";import q from"react-dom";import{toast as K}from"react-toastify";import _ from"@mui/icons-material/Cancel";import Y from"@mui/icons-material/Close";import X from"@mui/icons-material/CheckCircle";import Z from"@mui/material/Box";import J from"@mui/material/Fade";import Q from"@mui/material/Slide";const ee=({type:t,label:n})=>(t||(t="button"),e.createElement("button",{type:t,className:"moorr-button"},e.createElement("span",null,n)));function te(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}function ne(e,t,n,o){return new(n||(n=Promise))((function(r,i){function l(e){try{s(o.next(e))}catch(e){i(e)}}function a(e){try{s(o.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(l,a)}s((o=o.apply(e,t||[])).next())}))}const oe=t(((t,o)=>{var{style:r={},handleClick:i,label:l,disabled:a}=t,s=te(t,["style","handleClick","label","disabled"]);const d=u("(max-width: 600px)"),m=n((()=>d?"8rem":"172px"),[d]);return e.createElement(c,Object.assign({},s,{ref:o,disabled:a,disableElevation:!0,disableRipple:!0,disableFocusRipple:!0,disableTouchRipple:!0,style:Object.assign(Object.assign(Object.assign({},!a&&{backgroundColor:"#541868"}),{color:"#FFFFFF",fontWeight:400,fontSize:"14px",width:m,height:"39px",borderRadius:"48px",textTransform:"capitalize"}),r),onClick:i,variant:"contained"}),l)})),re=t(((t,r)=>{var{sx:i,item:l,label:a,qty:s,disabled:d,highlight:u,onSelectItem:p}=t,h=te(t,["sx","item","label","qty","disabled","highlight","onSelectItem"]);const g=n((()=>({width:"27px",height:"27px",color:"#FFFFFF",flexShrink:0})),[]),v=n((()=>{const e=Object.assign(Object.assign({},i),{flexGrow:1,fontFamily:"Poppins",fontSize:"14px",fontWeight:400,lineHeight:"9px",minHeight:"42px",border:"1px solid #EDEDEE",borderRadius:"10rem",textTransform:"none",gap:"0.5rem","&:hover > button":{opacity:1}});return s>0?Object.assign(Object.assign({},e),{backgroundColor:"#66e84b",borderColor:"#541868",color:"#541868","&:hover":{backgroundColor:"#66e84b",borderColor:"#541868",color:"#541868"}}):Object.assign(Object.assign({},e),{backgroundColor:"#FBFBFD",borderColor:!0===u?"#541868":"#EDEDEE",color:"#000000","&:hover":{backgroundColor:"#66e84b",borderColor:"#66e84b",color:"#ffffff"}})}),[s,i]),f=o((e=>ne(void 0,void 0,void 0,(function*(){e.stopPropagation(),e.preventDefault(),w.isFunction(p)&&s<=0&&(yield Promise.all([p(l,1)]))}))),[s,p]),b=o((()=>!E.isValid(s)||s<=0?null:e.createElement(T,{disabled:d,sx:Object.assign(Object.assign({},g),{backgroundColor:"#E37D7D",opacity:0,"&:hover":{backgroundColor:"#E37D7D"},"&:active":{backgroundColor:"#E37D7D"}}),onClick:()=>p&&p(l,Math.max(0,s-1))},"-")),[d,g,s,p]),y=o((()=>!E.isValid(s)||s<=0?null:e.createElement(T,{disabled:d,sx:Object.assign(Object.assign({},g),{backgroundColor:"#541868",opacity:0,"&:hover":{backgroundColor:"#541868"},"&:active":{backgroundColor:"#541868"}}),onClick:()=>p&&p(l,s+1)},"+")),[d,g,s,p]),x=o((()=>{let t,n;return!E.isValid(s)||s<=0?(t=1,n=0):(t=`${s}`,n=1),e.createElement(m,{variant:"body1",component:"span",sx:{color:"#541868",fontWeight:700,fontSize:"14px",lineHeight:"20px",flexShrink:0,opacity:n}},t)}),[s]);return e.createElement(c,Object.assign({},h,{ref:r,disableElevation:!0,disableRipple:!0,disableFocusRipple:!0,disableTouchRipple:!0,disabled:d,sx:v,onClick:f}),b(),e.createElement(m,{variant:"body1",component:"span",sx:{flexGrow:1}},null!=a?a:l),y(),x())})),ie=t(((t,o)=>{var{style:r={},handleClick:i,label:l,disabled:a}=t,s=te(t,["style","handleClick","label","disabled"]);const d=u("(max-width: 600px)"),m=n((()=>d?"8rem":"172px"),[d]);return e.createElement(c,Object.assign({},s,{ref:o,disabled:a,disableElevation:!0,disableRipple:!0,disableFocusRipple:!0,disableTouchRipple:!0,style:Object.assign(Object.assign(Object.assign({},!a&&{backgroundColor:"#D4C5D9"}),{color:"#541868",fontWeight:400,fontSize:"14px",width:m,height:"39px",borderRadius:"48px",textTransform:"capitalize"}),r),onClick:i,variant:"contained"}),l)})),le=t(((t,r)=>{var{sx:i,item:l,label:a,itemSelected:s,onSelectItem:d}=t,u=te(t,["sx","item","label","itemSelected","onSelectItem"]);const p=n((()=>{const e=Object.assign(Object.assign({},i),{flexGrow:1,fontFamily:"Poppins",fontSize:"13px",fontWeight:400,lineHeight:"18px",border:"1px solid #EDEDEE",borderRadius:"10rem",textTransform:"none"});return s?Object.assign(Object.assign({},e),{backgroundColor:"#66e84b",borderColor:"#541868",color:"#541868","&:hover":{backgroundColor:"#66e84b",borderColor:"#541868",color:"#541868"}}):Object.assign(Object.assign({},e),{backgroundColor:"#fbfbfd",borderColor:"#EDEDEE",color:"#000000","&:hover":{backgroundColor:"#66e84b",borderColor:"#66e84b",color:"#ffffff"}})}),[s,i]),h=o((e=>ne(void 0,void 0,void 0,(function*(){e.stopPropagation(),e.preventDefault(),w.isFunction(d)&&(yield Promise.all([d(l)]))}))),[d]);return e.createElement(c,Object.assign({},u,{ref:r,disableElevation:!0,disableRipple:!0,disableFocusRipple:!0,disableTouchRipple:!0,sx:p,onClick:h}),e.createElement(m,{variant:"body1",component:"span",sx:{flexGrow:1}},null!=a?a:l))})),ae=e=>({root:{"&:hover:not($disabled):not($focused):not($error) $notchedOutline":{},"&$checked":{color:"var(--primary-color)"},"& .vldt-MuiSelect-select.vldt-MuiSelect-select":{color:"var(--grey-color-2)"}},disabled:{},focused:{},error:{},notchedOutline:{},checked:{},notchedOutlineMBRequired:{flex:3,borderColor:"blue",borderWidth:2},fieldSetMBRequired:{"& fieldset":{flex:3,borderColor:"blue",borderWidth:2}},fieldSetErrorField:{"& fieldset":{borderColor:"var(--error-color)"}},blue:{color:"blue"}});N(ae);const se=N((()=>S({root:{overflow:"hidden",display:"flex",alignItems:"center","&.start":{flexDirection:"row"},"&.top":{flexDirection:"column"},"& .Mui-disabled":{backgroundColor:"var(--grey-color-3)",cursor:"not-allowed",borderRadius:"4px"}},label:{flex:2},field:{flex:3},required:{color:"red"},menuItem:{color:"var(--grey-color-2)","&:hover":{backgroundColor:"var(--primary-color-scale-25)",color:"var(--grey-color-2)"}},menuItemSelected:{color:"var(--grey-color-2)"},mandatory:{border:"red 2px solid",borderRadius:"4px"}})));var de=O(ae)((({handleChange:t,value:n,disabled:o=!1,name:r,className:i,classes:l,size:a,menuItemLabel:s,options:d,labelPlacement:c="start",label:u,required:m=!1,isMBRequiredField:p,fullWidth:h,selectIconComponent:g})=>{const{root:v,focused:f,error:b,notchedOutline:y,notchedOutlineMBRequired:x}=l,E=se();let w;return g&&(w={IconComponent:g}),e.createElement(P,{fullWidth:!1!==h,id:"outlined-basic",variant:"outlined",value:n,onChange:t,disabled:o,name:r,className:[i].join(" "),InputProps:{classes:{root:v,focused:f,error:b,notchedOutline:!p||n&&0!==(null==n?void 0:n.length)?!m||n&&0!==(null==n?void 0:n.length)?y:E.mandatory:x}},color:"primary",size:a||"small",select:!0,SelectProps:w,defaultValue:""},e.createElement(F,{value:"",disabled:!0},e.createElement("em",null,s)),d&&d.map(((t,n)=>"-separator-"===t?e.createElement(F,{key:`separator-${n}`,value:"",disabled:!0},e.createElement("em",null,"-----------")):e.createElement(F,{key:`menu-item-${n}-${t.value||t}`,value:t.value||t},t.label||t))))}));const ce={};function ue(e,t){e&&t&&(ce[e]=t)}const me=({className:t,icon:n,width:o,height:r,fill:i,stroke:l,accent:a,dropShadow:s})=>{if(w.isNullOrUndefined(n))return null;const d=ce[n]||null;return d?e.createElement(d,{className:t,fill:i,width:o,height:r,stroke:l,accent:a,dropShadow:s}):null},pe={};var he=({stylePrefix:t,children:n})=>{let o;if(t)o=pe[t]?pe[t]:pe[t]=L({seed:t});else{const e=`MoorrStylesProvider-${j()}-`;o=L({seed:e})}return e.createElement(U,{generateClassName:o,injectFirst:!0},e.createElement(I,{generateClassName:o,injectFirst:!0},e.createElement(D,{generateClassName:o},n)))};const ge=r({});function ve(){return i(ge)}const fe={};function be(e,t){e&&t&&(fe[e]=t)}const ye=({graphingTile:t,graphingTileIndex:n})=>{var o;if(!(null===(o=null==t?void 0:t.tile)||void 0===o?void 0:o.tileType))return null;const r=fe[t.tile.tileType]||null;return r?e.createElement(r,{graphingTile:t,graphingTileIndex:n}):null},xe=[20,20],Ee={lg:600,sm:0},we={lg:8,sm:2},Me=({tilePrefix:t,responsive:n,columns:o,containerPadding:r,referenceMargin:i,referenceWidth:d,graphingTiles:c})=>{const u=ve(),[m,p]=l(null),[h,g]=l(null),[v,f]=l(null),[b,y]=l(null),x=a(null),E=()=>{const e=(null==x?void 0:x.current)?(null==x?void 0:x.current).getBoundingClientRect().width:null;y(e);const t=T(e);p(t)};let M;const C=e=>{E(),clearTimeout(M),M=setTimeout((()=>{E()}),300)};s((()=>{E()}),[x]),s((()=>(window.addEventListener("resize",C),()=>{window.removeEventListener("resize",C)})),[]),s((()=>{if(n){if(!Array.isArray(c)||0===c.length)return void f({lg:[]});const e=c.map(((e,n)=>({x:e.x,y:e.y,w:isNaN(e.w)?1:e.w,h:isNaN(e.h)?1:e.h,i:`${t?t+"_":""}tile_${n}`})));f({lg:e})}else{if(!Array.isArray(c)||0===c.length)return void g([]);g(c.map(((e,n)=>({x:e.x,y:e.y,w:isNaN(e.w)?1:e.w,h:isNaN(e.h)?1:e.h,i:`${t?t+"_":""}tile_${n}`,static:!0}))))}}),[c]);const k=()=>null==c?void 0:c.map(((n,o)=>{if(!n.tile||!n.visible)return null;if(w.isFunction(u.isTileVisible)&&n.tile.id&&!u.isTileVisible(n.tile.id))return null;let r="graphing-tile-container";n.tile.id&&(r+=` ${n.tile.id}`),!1!==n.border&&(r+=" bordered"),n.autoHeight&&(r+=" auto-height");const i=`${t?t+"_":""}tile_${o}`;return e.createElement("div",{className:r,key:i},e.createElement(ye,{graphingTile:n,graphingTileIndex:o}))})),T=e=>{if(!i||isNaN(i)||i<=0||!d||isNaN(d)||d<=0||null==e)return xe;const t=e/d*i;return[t,t]};return e.createElement("div",{ref:x,className:"graphing-tiles-container"},(()=>{if(!b||!m)return null;if(!1!==n){if(!v)return null;const t=[r||0,0];return e.createElement($,{width:b,breakpoints:Ee,cols:o||we,rowHeight:1,layouts:v,containerPadding:t,margin:m,isDraggable:!1},k())}return h?e.createElement(B,{width:b,cols:9,rowHeight:50,margin:m,isDraggable:!1,layout:h},k()):null})())},Ce={};function ke(e,t){Ce[e]=t}function Te(e){const t=Ce[null==e?void 0:e.tileType];return t?new t(e):null}function Fe(e){const t=[];return e.forEach((e=>{const n=Te(e);n&&t.push(n)})),t}class Ne{constructor(e){this.x=e.x,this.y=e.y,this.w=e.w,this.h=e.h,this.border=!0===e.border,this.background=e.background||null,this.autoHeight=!0===e.autoHeight,this.tile=Te(e.tile),this.visible=!1!==e.visible}getBackground(){return this.background||"#FFFFFF"}}class Se{constructor(e){this.title=e.title||"",this.infoIconUrl=e.infoUrl,this.infoIconHref=e.infoHref,this.responsive=!1!==e.responsive,this.columns=e.columns||{lg:8,sm:2},this.containerPadding=e.containerPadding||0,this.referenceMargin=e.referenceMargin||null,this.referenceWidth=e.referenceWidth||null,this.tiles=[],Array.isArray(e.tiles)&&e.tiles.forEach((e=>{this.tiles.push(new Ne(e))}))}}const Oe={};function De(e,t){Oe[e]=t}function Pe(e){const t=Oe[null==e?void 0:e.controlType];return t?new t(e):null}function Ie(e){const t=[];return e.forEach((e=>{const n=Pe(e);n&&t.push(n)})),t}class Re{constructor(e){this.controlType=e.controlType,this.dataKey=e.dataKey}}class Ve extends Re{constructor(e){super(e),this.inputLabel=e.inputLabel||"",this.readOnly=!0===e.readOnly,this.readOnlyBorderless=!0===e.readOnlyBorderless,this.hasAsAtDate=!1===e.hasAsAtDate||!0===e.hasAsAtDate?e.hasAsAtDate:null,this.staticAsAtDate=!0===e.staticAsAtDate,this.validationSchemaPath=(w.isArray(e.validationSchemaPath)?e.validationSchemaPath:[]).filter((e=>w.isString(e))),this.validationErrorMessages=e.validationErrorMessages||{}}}class Ae{constructor(e){this.border=e.border,this.background=e.background||null,this.control=Pe(e.control)}getBackground(e){return this.background||(null==e?void 0:e.background)||"#FFFFFF"}}class Le{constructor(e){this.label=e.label||"",this.value=e.value||"",this.icon=e.icon||"",this.accent=e.accent||""}}class Ue{constructor(e){this.id=e.id||"",this.title=e.title||"",this.controls=[],Array.isArray(e.controls)&&e.controls.forEach((e=>{this.controls.push(new Ae(e))})),this.add=!0===e.add,this.edit=!0===e.edit,this.addActions=[],Array.isArray(e.addActions)&&e.addActions.forEach((e=>{this.addActions.push(new Le(e))}))}}class je{constructor(e){this.id=e.id,this.tileType=e.tileType}}class Be extends je{constructor(e){super(e),this.control=new Ae(e.control)}}class $e extends je{constructor(e){super(e),this.controls=[],Array.isArray(e.controls)&&e.controls.forEach((e=>{this.controls.push(new Ae(e))}))}}class ze extends je{constructor(e){super(e),w.isArray(e.formGroups)&&e.formGroups.length>0?this.formGroups=e.formGroups.map((e=>new Ue(e))):this.formGroups=[]}}ke("form-groups-tile",ze);class He extends $e{constructor(e){super(e),this.controlsPerPage=e.controlsPerPage,(isNaN(this.controlsPerPage)||this.controlsPerPage<=1)&&(this.controlsPerPage=1)}}ke("horizontal-tile",He);class Ge extends $e{constructor(e){super(e),this.states={};for(const t in e.states){const n=e.states[t];n&&(this.states[t]=new Se(n))}}}ke("selectable-states-tile",Ge);class We extends je{constructor(e){super(e),this.controls=[],Array.isArray(e.controls)&&e.controls.forEach((e=>{this.controls.push(new Ae(e))}))}}ke("simple-form-tile",We);class qe extends Be{constructor(e){super(e)}}ke("single-tile",qe);class Ke extends $e{constructor(e){super(e)}}ke("vertical-tile",Ke);const _e=(e,t,n)=>{s((()=>{const n=document.querySelector("#react-root");return null==n||n.addEventListener(e,t),()=>{null==n||n.removeEventListener(e,t)}}),null!=n?n:[t])},Ye=(e,t)=>{const n=document.querySelector("#react-root");null==n||n.dispatchEvent(new CustomEvent(e,{detail:null!=t?t:{}}))},Xe=({})=>{const{settings:t,handleUIReady:n}=ve(),[r,i]=l(null),[a,d]=l([]),[c,u]=l(!1);s((()=>{setTimeout((()=>{window.dispatchEvent(new Event("resize")),setTimeout((()=>{u(!0),w.isFunction(n)&&n()}),300)}),300)}),[]);const m=o((e=>{var t,n,o,r,i,l,s,c,u,m,p;if(!(null==a?void 0:a.length)||!(null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.id))return;const h=a.find((t=>{var n,o;return(null===(n=t.tile)||void 0===n?void 0:n.id)===(null===(o=null==e?void 0:e.detail)||void 0===o?void 0:o.id)}));if(!h)return;w.isNullOrUndefined(null===(n=null==e?void 0:e.detail)||void 0===n?void 0:n.x)||(h.x=null===(o=null==e?void 0:e.detail)||void 0===o?void 0:o.x),w.isNullOrUndefined(null===(r=null==e?void 0:e.detail)||void 0===r?void 0:r.y)||(h.y=null===(i=null==e?void 0:e.detail)||void 0===i?void 0:i.y),w.isNullOrUndefined(null===(l=null==e?void 0:e.detail)||void 0===l?void 0:l.w)||(h.w=null===(s=null==e?void 0:e.detail)||void 0===s?void 0:s.w),w.isNullOrUndefined(null===(c=null==e?void 0:e.detail)||void 0===c?void 0:c.h)||(h.h=null===(u=null==e?void 0:e.detail)||void 0===u?void 0:u.h),w.isNullOrUndefined(null===(m=null==e?void 0:e.detail)||void 0===m?void 0:m.visible)||(h.visible=null===(p=null==e?void 0:e.detail)||void 0===p?void 0:p.visible);const g=a.map((e=>new Ne(e)));d(g)}),[a]);_e("graphingGrid.updateTile",m),s((()=>{var e;t?(i(new Se(t)),d(null===(e=t.tiles)||void 0===e?void 0:e.map((e=>new Ne(e))))):i(null)}),[t]);const p=()=>(null==t?void 0:t.infoIconUrl)&&t.infoIconHref?e.createElement("a",{className:"information-anchor",href:t.infoIconHref,target:"_blank"},e.createElement("img",{alt:null==t?void 0:t.title,src:null==t?void 0:t.infoIconUrl})):null;if(!r)return null;let h="graphing-grid-container";return c&&(h+=" in"),e.createElement(e.Fragment,null,e.createElement("div",{className:h},w.isNullOrUndefined(null==t?void 0:t.title)?null:e.createElement(e.Fragment,null,e.createElement("h2",{className:"graphing-grid-title"},null==t?void 0:t.title,p()),e.createElement("hr",{className:"graphing-grid-hr"})),e.createElement(Me,{graphingTiles:a,responsive:r.responsive,columns:r.columns,containerPadding:r.containerPadding,referenceMargin:r.referenceMargin,referenceWidth:r.referenceWidth})))},Ze={};function Je(e,t){e&&t&&(Ze[e]=t)}const Qe=({graphingTile:t,graphingTileIndex:n,graphingTileControl:o,ControlProps:r})=>{var i;if(!(null===(i=null==o?void 0:o.control)||void 0===i?void 0:i.controlType))return null;const l=Ze[o.control.controlType]||null;return l?e.createElement(l,Object.assign({graphingTile:t,graphingTileIndex:n,graphingTileControl:o},r)):null},et=({graphingTile:t,graphingTileIndex:n,graphingTileControls:o,ControlProps:r})=>{var i,l;let a="graphing-tile-controls-container";return(null===(i=null==t?void 0:t.tile)||void 0===i?void 0:i.tileType)&&(a+=" "+(null===(l=null==t?void 0:t.tile)||void 0===l?void 0:l.tileType)),e.createElement("div",{className:a},null==o?void 0:o.map(((o,i)=>{var l,a;if(!o.control)return null;let s="graphing-tile-control-container";(null===(l=o.control)||void 0===l?void 0:l.controlType)&&(s+=" "+(null===(a=o.control)||void 0===a?void 0:a.controlType)),!1!==o.border&&(s+=" bordered");const d=`control_${n}_${i}`;return e.createElement("div",{className:s,key:d},e.createElement(Qe,{graphingTile:t,graphingTileIndex:n,graphingTileControl:o,ControlProps:r}))})))},tt=({className:t,context:n})=>e.createElement(ge.Provider,{value:n},e.createElement("div",{className:t},e.createElement(Xe,null))),nt=({open:t,actions:n,disabled:o,onClick:r})=>e.createElement(p,{ariaLabel:"Add a New Card",direction:"down",open:t,className:t?"add-card-open":void 0,onClick:r,icon:e.createElement(h,{sx:{display:"flex"}},e.createElement(g,{open:t,icon:e.createElement(me,{icon:"add-icon",stroke:t?"#E24242":"#FFFFFF"})})),FabProps:{className:t?"add-card-open":void 0,variant:"extended",disabled:o,disableRipple:!0,disableFocusRipple:!0,disableTouchRipple:!0,sx:{background:"transparent",color:"inherit",width:"auto",height:"30px",whiteSpace:"nowrap",boxShadow:"none",textTransform:"inherit","&:hover":{background:"transparent",boxShadow:"none"},"&:active":{background:"transparent",boxShadow:"none"},"&:disabled":{background:"transparent !important"},"& > div":{display:"flex",flexDirection:"row",gap:"1rem",textTransform:"inherit",justifyContent:"center"},"& > div > .MuiTypography-root.MuiTypography-button":{textTransform:"inherit",fontFamily:"Poppins",fontStyle:"normal",fontWeight:400,fontSize:"14px"},"& > div > .MuiSpeedDialIcon-root":{display:"flex",width:"30px",height:"30px",alignItems:"center",justifyContent:"center",backgroundColor:"#541868",transition:"background-color 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",borderRadius:"15px",color:"#FFFFFF"},"& > div > .MuiSpeedDialIcon-root:hover":{backgroundColor:"#541868"},"& > div > .MuiSpeedDialIcon-root > svg":{transform:"rotate(0deg)",transition:"transform 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,opacity 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms"},"&.add-card-open > div > .MuiSpeedDialIcon-root":{backgroundColor:"#FFFFFF",color:"#E24242"},"&.add-card-open > div > .MuiSpeedDialIcon-root:hover":{backgroundColor:"#FFFFFF",color:"#E24242"},"&.add-card-open > div > .MuiSpeedDialIcon-root > svg":{transform:"rotate(45deg)"},"&:disabled > div > .MuiSpeedDialIcon-root":{backgroundColor:"#DCDCDC",color:"#FFFFFF"},"&:disabled > div > .MuiSpeedDialIcon-root:hover":{backgroundColor:"#DCDCDC",color:"#FFFFFF"}}},sx:{position:"absolute",width:"30px",zIndex:1,"&.add-card-open":{zIndex:1050},"& > .MuiSpeedDial-actions":{alignSelf:"flex-end",marginRight:"-15px"},"& > .MuiSpeedDial-actions .MuiSpeedDialAction-staticTooltipLabel":{whiteSpace:"nowrap"}}},n),ot=({graphingTile:t,graphingTileIndex:r})=>{const i=null==t?void 0:t.tile;if(!i)return null;const d=ve();return e.createElement("div",{className:"form-groups-tile-component"},!w.isArray(i.formGroups)||i.formGroups.length<0?null:i.formGroups.map(((i,c)=>{const u=a(null),[m,p]=l("normal"),[g,f]=l("form-group-container");s((()=>{M()}),[g,m]);const[b,y]=l(0),[x,E]=l(!0);s((()=>{if(x){const e=u.current;w.isNullOrUndefined(e)?y(0):setTimeout((()=>{y(e.scrollHeight)}),10)}else y(0)}),[x]);const M=e=>{if(x){const e=u.current;w.isNullOrUndefined(e)?y(0):setTimeout((()=>{y(Math.max(e.clientHeight,e.scrollHeight))}),10)}else y(0)},C=o((e=>{""===e.value?(p("add"),E(!0)):(null==d?void 0:d.handleFormGroupAdd)&&w.isFunction(d.handleFormGroupAdd)&&d.handleFormGroupAdd(i,e)}),[i,null==d?void 0:d.handleFormGroupAdd]),k=n((()=>i.addActions&&i.addActions.length?i.addActions.map(((t,n)=>e.createElement(v,{key:n.toString(),icon:e.createElement(me,{icon:t.icon,fill:t.accent,stroke:"#FFFFFF"}),tooltipTitle:e.createElement("span",null,t.label),tooltipOpen:!0,FabProps:{disableFocusRipple:!0,disableRipple:!0,disableTouchRipple:!0},sx:{"& > .MuiSpeedDialAction-staticTooltipLabel":{background:"#ffffff",color:"#000000",textTransform:"inherit",fontFamily:"Poppins",fontStyle:"normal",fontWeight:400,fontSize:"12px",padding:"0.25rem 0.5rem",cursor:"pointer"},"& > .MuiSpeedDialAction-staticTooltipLabel#AddaNewCard-action-0-label":{marginRight:0},"& > .MuiFab-root":{backgroundColor:"transparent !important",color:"#ffffff",boxShadow:"none",width:"36px !important",height:"36px !important",margin:"0.375rem 1rem 0.375rem 0.25rem","&:hover":{backgroundColor:"transparent !important"},"&:active":{backgroundColor:"transparent !important",boxShadow:"none"},justifyContent:"flex-end !important"}},onClick:()=>C(t)}))):null),[i.addActions,C]),[T,F]=l(!1),N=o((e=>{e.stopPropagation(),F((e=>!e))}),[]),S=o((()=>!0!==i.add||w.isFunction(d.formGroupHasAddMode)&&!d.formGroupHasAddMode(i.id)?null:k?e.createElement(nt,{disabled:"add"==m,open:T,actions:k,onClick:N}):e.createElement("button",{type:"button",className:"form-group-tile-add-button",onClick:D,disabled:"add"==m},e.createElement(me,{icon:"add-icon",stroke:"#ffffff"}))),[m,d.formGroupHasAddMode,T,k,N]),O=o((()=>!0!==i.edit||w.isFunction(d.formGroupHasEditMode)&&!d.formGroupHasEditMode(i.id)?null:e.createElement("button",{type:"button",className:"form-group-tile-edit-button",onClick:P,disabled:"add"==m},e.createElement(me,{icon:"edit-icon",fill:"#ffffff"}))),[m,d.formGroupHasEditMode]),D=e=>{e.stopPropagation(),p("add"),E(!0)},P=e=>{e.stopPropagation(),(null==d?void 0:d.handleEdit)&&(null==d||d.handleEdit(i))},I=e=>ne(void 0,void 0,void 0,(function*(){w.isFunction(null==d?void 0:d.handleFormGroupCancel)&&(yield Promise.all([null==d?void 0:d.handleFormGroupCancel({formGroup:i})])),p("normal")})),[R,V]=l(!1),A=e=>ne(void 0,void 0,void 0,(function*(){if(w.isFunction(null==d?void 0:d.handleFormGroupSave))try{V(!0);const[e]=yield Promise.all([null==d?void 0:d.handleFormGroupSave({formGroup:i})]);if(!1===e)return}finally{V(!1)}p("normal")}));let L="form-group-container";return w.isFunction(d.isFormGroupVisible)&&(d.isFormGroupVisible(i.id)||(L+=" hidden")),L!==g&&f(L),e.createElement(z,{key:`${i.id}-{${c}}`,className:L,expanded:x,onChange:e=>{"add"!==m&&E((e=>!e))},TransitionProps:{unmountOnExit:!0}},e.createElement(H,{className:"form-group-title",expandIcon:"add"!==m?e.createElement(W,null):null},e.createElement("span",{className:"form-group-title-text"},i.title),S(),O()),e.createElement("hr",null),e.createElement(G,{className:"form-group-components"},(()=>{if("add"===m){let t;return w.isFunction(d.renderFormGroup)&&(t=d.renderFormGroup(i,"add")),e.createElement(e.Fragment,null,t,e.createElement("hr",null),e.createElement("div",{className:"form-group-add-mode-buttons"},e.createElement("button",{className:"cancel-button",disabled:R,onClick:I},"Cancel"),e.createElement("button",{className:"save-button",disabled:R,onClick:A},"Create")))}{const n=i.controls;let o,l;if(w.isFunction(d.renderFormGroup)){if(o=d.renderFormGroup(i,"normal"),!w.isNullOrUndefined(o))return o;l=d.renderFormGroup(i,"footer")}return e.createElement(e.Fragment,null,e.createElement(et,{graphingTile:t,graphingTileIndex:r,graphingTileControls:n,ControlProps:{onUIChange:M}}),l)}})()),k&&e.createElement(h,{sx:{position:"absolute",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:T?2:-1,borderRadius:"10px",transition:"opacity 225ms cubic-bezier(0.4, 0, 0.2, 1)",opacity:T?1:0},onClick:()=>F(!1)}))})))};be("form-groups-tile",ot);const rt=({graphingTile:t,graphingTileIndex:n})=>{const o=null==t?void 0:t.tile;if(!o)return null;const[r,i]=l(null),[a,d]=l(0),[c,u]=l(0),[m,p]=l(null),[h,g]=l(null),[v,f]=l(null),[b,y]=l([]);s((()=>{let e=[];const t=Math.ceil(o.controls.length/o.controlsPerPage);if(t>0)for(let n=0;n<t;n++){const t={pageIndex:n,controls:[]};for(let e=0;e<o.controlsPerPage;e++){const r=n*o.controlsPerPage+e;if(r>=o.controls.length)break;t.controls.push(o.controls[r])}e.push(t)}d(t),u(0),p(null),g(null),f(null),y(e)}),o.controls);const x=e=>{let t=e-1;t<0&&(t=a-1),g(t)},E=e=>{e.stopPropagation(),x(c),f(null),p(null)},w=e=>{e.stopPropagation()},M=e=>{e.stopPropagation()},C=e=>{if(e.stopPropagation(),null!==r)return;const t=c;let n=c-1;n<0&&(n=a-1),p(t),u(n),g(null),f(t);const o=setTimeout((()=>{x(n),f(null),p(null),setTimeout((function(){i(null)}),300)}),300);i(o)},k=e=>{let t=e+1;t>=a&&(t=0),f(t)},T=e=>{e.stopPropagation(),g(null),k(c),p(null)},F=e=>{e.stopPropagation()},N=e=>{e.stopPropagation()},S=e=>{if(e.stopPropagation(),null!==r)return;const t=c;let n=c+1;n>=a&&(n=0),p(t),u(n),g(t),f(null);const o=setTimeout((()=>{g(null),k(n),p(null),setTimeout((function(){i(null)}),300)}),300);i(o)},O={background:t.getBackground()};return e.createElement("div",{className:"horizontal-tile-component",style:O},e.createElement("div",{className:"horizontal-tile-pages-container"},b.map(((o,r)=>{let i="horizontal-tile-page-container";return r===c?i+=" active":r===h?i+=" navigating-from-left":r===v&&(i+=" navigating-from-right"),r===m&&(i+=" previous"),e.createElement("div",{key:`horizontal-tile-page-${r}`,className:i},e.createElement(et,{graphingTile:t,graphingTileIndex:n,graphingTileControls:o.controls}))})),e.createElement("div",{className:"horizontal-tile-page-container background",style:O}),a<=1?null:e.createElement(e.Fragment,null,e.createElement("button",{type:"button",className:"navigate-button navigate-left-button",onMouseEnter:E,onMouseLeave:w,onMouseDown:M,onClick:C},e.createElement("svg",{width:"8",height:"13",viewBox:"0 0 8 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M7.40991 10.643L2.82991 6.05298L7.40991 1.46298L5.99991 0.0529785L-8.80003e-05 6.05298L5.99991 12.053L7.40991 10.643Z",fill:"#828282"}))),e.createElement("button",{type:"button",className:"navigate-button navigate-right-button",onMouseEnter:T,onMouseLeave:F,onMouseDown:N,onClick:S},e.createElement("svg",{width:"8",height:"13",viewBox:"0 0 8 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M0.589843 1.46298L5.16984 6.05298L0.589844 10.643L1.99984 12.053L7.99984 6.05298L1.99984 0.0529785L0.589843 1.46298Z",fill:"#828282"}))))),a<=1?null:e.createElement("div",{className:"horizontal-tile-paginators-container"},Array.from(Array(a).keys()).map((t=>{let n="paginator-anchor";return t===c&&(n+=" active"),e.createElement("a",{key:`horizontal-tile-page-index-${t}`,className:n,onMouseEnter:e=>{e.stopPropagation(),t!==c&&(t<c?(g(t),f(null)):(g(null),f(t)),p(null))},onMouseLeave:e=>{e.stopPropagation()},onMouseDown:e=>{e.stopPropagation()},onClick:e=>{if(e.stopPropagation(),t===c)return;const n=c,o=t;p(n),u(o),n<o?g(n):f(n)}})}))))};be("horizontal-tile",rt);const it=({graphingTile:t})=>{const n=null==t?void 0:t.tile;if(!n)return null;const[o,r]=l(""),[i,a]=l(null),[d,c]=l([]),u=ve();s((()=>{const e=Object.keys(n.states);if(c(e.map((e=>{var t;return{label:null===(t=n.states[e])||void 0===t?void 0:t.title,value:e}}))),e&&e.length>0){const t=e[0];m(t)}else r(""),a(null)}),[n.states]);const m=e=>{r(e),a(n.states[e])};return e.createElement("div",{className:"selectable-states-tile-component"},e.createElement("div",{className:"selectable-states-tile-header"},e.createElement("div",{className:"selected-state-tile-title"},e.createElement("h6",null,null==i?void 0:i.title)),e.createElement("div",{className:"selectable-states-dropdown-container"},e.createElement(de,{options:d,label:"Select",value:o,handleChange:e=>{var t;m(null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value),(null==u?void 0:u.handleSelectableStatesTileChange)&&(null==u||u.handleSelectableStatesTileChange(e))}}))),e.createElement("div",{className:"selected-state-tile-container"},i?e.createElement(Me,{tilePrefix:o,graphingTiles:i.tiles,responsive:i.responsive,columns:i.columns,containerPadding:i.containerPadding,referenceMargin:i.referenceMargin,referenceWidth:i.referenceWidth}):null))};be("selectable-states-tile",it);const lt=({graphingTile:t,graphingTileIndex:n})=>{const o=null==t?void 0:t.tile;if(!o)return null;const r=ve(),i=e=>{w.isFunction(r.handleUIChange)&&r.handleUIChange(e)};return e.createElement("div",{className:"simple-form-tile-component"},(()=>{if(!w.isArray(o.controls)||o.controls.length<0)return null;const r=o.controls;return e.createElement(et,{graphingTile:t,graphingTileIndex:n,graphingTileControls:r,ControlProps:{onUIChange:i}})})())};be("simple-form-tile",lt);const at=({graphingTile:t,graphingTileIndex:n})=>{const o=null==t?void 0:t.tile;if(!o)return null;const r=[o.control],i={background:t.getBackground()};return e.createElement("div",{className:"single-tile-component",style:i},e.createElement(et,{graphingTile:t,graphingTileIndex:n,graphingTileControls:r}))};be("single-tile",at);const st=({graphingTile:t,graphingTileIndex:n})=>{const o=null==t?void 0:t.tile;if(!o)return null;const r=o.controls;return e.createElement("div",{className:"vertical-tile-component"},e.createElement(et,{graphingTile:t,graphingTileIndex:n,graphingTileControls:r}))};function dt(e,t){const n=ve(),o=null==e?void 0:e.control,[r,i]=l(null);return s((()=>{if(!(o&&(n.data&&n.data[o.dataKey]||t)))return;const e=null!=t?t:n.data[o.dataKey];i(e)}),[o,t,n.data]),{context:n,settings:o,data:r}}be("vertical-tile",st);const ct={};function ut(e,t){ct[e]=t}function mt(e){const t=ct[e];return t?new t:null}function pt(e){const t=[];return e.forEach((e=>{const n=mt(e);n&&t.push(n)})),t}const ht=(e,t,n)=>!(!w.isNullOrUndefined(n)&&""!==(null==n?void 0:n.trim())&&"normal"!==n&&"hover"!==n&&(w.isNullOrUndefined(t)||""===(null==t?void 0:t.trim())))&&(!w.isNullOrUndefined(t)&&""!==(null==t?void 0:t.trim())||!w.isNullOrUndefined(e)&&"warning"!==(null==e?void 0:e.error_0)),gt=(e,t)=>{let n=!1,o=!1;return Object.entries(e).forEach((([e,t])=>{const r=null==t?void 0:t.error;n=n||ht(r),o=o||!0===(null==r?void 0:r.mandatory)})),w.isFunction(t)&&t(n,o),{hasErrors:n,hasMandatoryErrors:o}},vt=(e,t)=>ne(void 0,void 0,void 0,(function*(){var n;const o=(t||{})[e.key];if(!w.isArray(o))return;const r={count:0};return!0===(null===(n=null==e?void 0:e.originalEvent)||void 0===n?void 0:n.noValidate)||o.forEach(((t,n)=>{var o;const i=mt(null!==(o=null==e?void 0:e.validatorType)&&void 0!==o?o:t.type);if(w.isNullOrUndefined(i))return;e.validatorData&&(i.validatorData=e.validatorData);const l=i.validate(t,e.value);r.mandatory=!0===t.mandatory||"AsAtDate"===e.validatorType,r.errors=l,w.isArray(l)&&l.length>0&&l.forEach(((n,o)=>{r[`error_${o}`]=i.getErrorMessage(t,e.control,n),r.count+=1}))})),r})),ft=(e,t,n,o,r)=>ne(void 0,void 0,void 0,(function*(){var i;if(w.isNullOrUndefined(e)||w.isNullOrUndefined(t))return{hasErrors:!1,hasMandatoryErrors:!1};let l;w.isNullOrUndefined(n)?o((e=>(l=Object.assign({},e),e))):l=Object.assign({},n);const a=[];return null===(i=null==e?void 0:e.tiles)||void 0===i||i.forEach((e=>{var n,o,r,i,s;switch(null===(n=null==e?void 0:e.tile)||void 0===n?void 0:n.tileType){case"form-groups-tile":null===(r=null===(o=null==e?void 0:e.tile)||void 0===o?void 0:o.formGroups)||void 0===r||r.forEach((e=>{var n,o;(null===(n=null==e?void 0:e.controls)||void 0===n?void 0:n.length)&&(null===(o=null==e?void 0:e.controls)||void 0===o||o.forEach((e=>{var n,o;if(!(null===(n=null==e?void 0:e.control)||void 0===n?void 0:n.dataKey)||(null==e?void 0:e.control.readOnly))return;const r=l[null===(o=null==e?void 0:e.control)||void 0===o?void 0:o.dataKey];if(r.readOnly||r.hidden)return;a.push(ne(void 0,void 0,void 0,(function*(){var n,o;const i=yield vt({originalEvent:null,control:null==e?void 0:e.control,key:null===(n=null==e?void 0:e.control)||void 0===n?void 0:n.dataKey,value:null==r?void 0:r.value},t);!w.isNullOrUndefined(i)&&i.count>0&&(l[null===(o=null==e?void 0:e.control)||void 0===o?void 0:o.dataKey].error=i)})))})))}));break;case"simple-form-tile":null===(s=null===(i=null==e?void 0:e.tile)||void 0===i?void 0:i.controls)||void 0===s||s.forEach((e=>ne(void 0,void 0,void 0,(function*(){var n,o;if(!(null===(n=null==e?void 0:e.control)||void 0===n?void 0:n.dataKey)||(null==e?void 0:e.control.readOnly))return;const r=l[null===(o=null==e?void 0:e.control)||void 0===o?void 0:o.dataKey];if(r.readOnly||r.hidden)return;a.push(ne(void 0,void 0,void 0,(function*(){var n,o;const i=yield vt({originalEvent:null,control:null==e?void 0:e.control,key:null===(n=null==e?void 0:e.control)||void 0===n?void 0:n.dataKey,value:null==r?void 0:r.value},t);!w.isNullOrUndefined(i)&&i.count>0&&(l[null===(o=null==e?void 0:e.control)||void 0===o?void 0:o.dataKey].error=i)})))}))));break;default:return}})),yield Promise.all(a),o(l),gt(l,r)})),bt=()=>{const[e,t]=l(0),[n,r]=l({});return{updatingCount:e,updatingFlags:n,setUpdating:o((e=>{t((e=>e+1)),r((t=>Object.assign(Object.assign({},t),{[e]:!0})))}),[e,n]),unsetUpdating:o((e=>{t((e=>e-1)),r((t=>Object.assign(Object.assign({},t),{[e]:!1})))}),[e,n])}},yt=(e,t,n,r,i,a)=>{const d=ve(),[c,u]=l(t),[m,p]=l(null),[h,g]=l(null),[v,f]=l(null),[b,y]=l(null),[x,E]=l(!1),w=o((()=>new Promise((t=>{if(x)return void t(x);const n={};Ye(`graphingForm.validateForm.${e}`,{callback:(e,o)=>{n.hasErrors=!0===(null==n?void 0:n.hasErrors)||e,n.hasMandatoryErrors=1==(null==n?void 0:n.hasMandatoryErrors)||o;const r=!n.hasErrors&&!n.hasMandatoryErrors;r||!0===i||E(!0),t(r)}})}))),[x,e]);s((()=>{if(!n)return;ne(void 0,void 0,void 0,(function*(){yield r(null,t,f,y,null!=a?a:()=>{},n),u(t);const e=t.tiles[0];p(e);const o={};e.tile.controls.forEach((e=>{o[e.control.dataKey]=e})),g(o)}))}),[t,n]);const[M,C]=l(!1),[k,T]=l(!1),F=o(((e,t)=>{const n=!0===t;C(!0===e),T(n)}),[]),[N,S]=l(null),O=o((e=>ne(void 0,void 0,void 0,(function*(){var n,o;if(!t||!v||!N)return{hasErrors:!1,hasMandatoryErrors:!1};const{hasErrors:r,hasMandatoryErrors:i}=yield ft(t,v,null,S,F);return(null===(n=null==e?void 0:e.detail)||void 0===n?void 0:n.callback)&&(null===(o=null==e?void 0:e.detail)||void 0===o||o.callback(r,i)),{hasErrors:r,hasMandatoryErrors:i}}))),[t,v,N,F]);_e(`graphingForm.validateForm.${e}`,O);const{updatingCount:D,updatingFlags:P,setUpdating:I,unsetUpdating:R}=bt();return{context:d,settings:c,graphingTile:m,graphingControls:h,inputSchemas:v,dropdownValues:b,data:N,setData:S,updatingCount:D,updatingFlags:P,setUpdating:I,unsetUpdating:R,hasErrors:M,hasMandatoryErrors:k,handleSetHasErrors:F,canSubmit:w}};class xt{constructor(){}getErrorMessage(e,t,n){if(w.isNullOrUndefined(n))return n;if(!w.isNullOrUndefined(null==t?void 0:t.validationErrorMessages)&&!w.isNullOrUndefined(t.validationErrorMessages[n])&&w.isString(t.validationErrorMessages[n])&&""!==t.validationErrorMessages[n].trim())return t.validationErrorMessages[n];switch(n){case"mandatory":return"This field is mandatory. Please ensure it is not empty or invalid";case"required":return"This field is required. Please ensure it is not empty or invalid";case"mbRequired":return"warning";case"enum":return w.isArray(null==e?void 0:e.enum)&&e.enum.length>0?`Value must be in this list: ${e.enum.filter((e=>!w.isNullOrUndefined(e)&&""!==e)).join(", ")}`:"Value must be in enum list";case"as-at-future":return"Your current value's as at date must not be in the future"}return n}validate(e,t){const n=this.validateInputValue(e,t);return!0!==(null==e?void 0:e.mbRequired)||this.validateMbRequired(e,t)||n.push("mbRequired"),n}validateInputValue(e,t){const n=[];return!0!==(null==e?void 0:e.mandatory)||this.validateMandatory(e,t)||n.push("mandatory"),!0!==(null==e?void 0:e.required)||this.validateRequired(e,t)||n.push("required"),w.isArray(null==e?void 0:e.enum)&&(null==e?void 0:e.enum.length)>0&&!this.validateEnum(null==e?void 0:e.enum,t)&&n.push("enum"),n}validateMandatory(e,t){return!w.isNullOrUndefined(t)}validateRequired(e,t){return this.validateMandatory(e,t)}validateMbRequired(e,t){return this.validateMandatory(e,t)}validateEnum(e,t){return!(w.isArray(e)&&0!==e.length&&!w.isNullOrUndefined(t))||e.includes(t)}}class Et extends xt{validateInputValue(e,t){return super.validateInputValue(e,t)}validateMandatory(e,t){return!!super.validateMandatory(e,t)&&!!t.formatted}}ut("Address",Et);class wt extends xt{validateInputValue(e,t){const n=super.validateInputValue(e,t);if(n.length>0)return n;if(M.isValid(t)){const e=new Date(t),o=M.todayUtc();e.getTime()>o.getTime()&&n.push("as-at-future")}return n}validateMandatory(e,t){return!!super.validateMandatory(e,t)&&M.isValid(t)}}ut("AsAtDate",wt);class Mt extends xt{validateInputValue(e,t){const n=super.validateInputValue(e,t);return t=C.parse(t),C.isValid(e.min)&&!this.validateMin(e.min,t)&&n.push("min"),C.isValid(e.max)&&!this.validateMax(e.max,t)&&n.push("max"),n}getErrorMessage(e,t,n){switch(n){case"min":return`Data not saved. The value must be greater than or equal to ${C.getCurrencyText(e.min,!1,e.decimalPlaces||2,"")}`;case"max":return`Data not saved. The value must be less than or equal to ${C.getCurrencyText(e.max,!1,e.decimalPlaces||2,"")}`;default:return super.getErrorMessage(e,t,n)}}validateMin(e,t){return!C.isValid(e)||!C.isValid(t)||t>=e}validateMax(e,t){return!C.isValid(e)||!C.isValid(t)||t<=e}}ut("Number",Mt);class Ct extends Mt{validateInputValue(e,t){return super.validateInputValue(e,t)}getErrorMessage(e,t,n){switch(n){case"min":return`Data not saved. The value must be greater than or equal to ${C.getCurrencyText(e.min,!1,e.decimalPlaces||2)}`;case"max":return`Data not saved. The value must be less than or equal to ${C.getCurrencyText(e.max,!1,e.decimalPlaces||2)}`;default:return super.getErrorMessage(e,t,n)}}}ut("Currency",Ct);class kt extends xt{getErrorMessage(e,t,n){var o,r,i,l;switch(n=super.getErrorMessage(e,t,n)){case"min":if(M.isValid(null===(o=this.validatorData)||void 0===o?void 0:o.min)){const e=M.parse(null===(r=this.validatorData)||void 0===r?void 0:r.min);return`Value cannot be before ${M.format(e,"DD/MM/yyyy")}`}break;case"max":if(M.isValid(null===(i=this.validatorData)||void 0===i?void 0:i.max)){const e=M.parse(null===(l=this.validatorData)||void 0===l?void 0:l.max);return`Value cannot be after ${M.format(e,"DD/MM/yyyy")}`}}return n}validateInputValue(e,t){var n,o,r,i;const l=super.validateInputValue(e,t);if(0===l.length&&M.isValid(t)){const e=M.parse(t);if(M.isValid(null===(n=this.validatorData)||void 0===n?void 0:n.min)){const t=M.parse(null===(o=this.validatorData)||void 0===o?void 0:o.min);(null==t?void 0:t.getTime())>(null==e?void 0:e.getTime())&&l.push("min")}if(M.isValid(null===(r=this.validatorData)||void 0===r?void 0:r.max)){const t=M.parse(null===(i=this.validatorData)||void 0===i?void 0:i.max);(null==t?void 0:t.getTime())<(null==e?void 0:e.getTime())&&l.push("max")}}return l}validateMandatory(e,t){return!!super.validateMandatory(e,t)&&M.isValid(t)}}ut("Date",kt);class Tt extends xt{validateInputValue(e,t){const n=super.validateInputValue(e,t);return!w.isNullOrUndefined(e.minLength)&&E.isValid(e.minLength)&&e.minLength>0&&!this.validateMinLength(e.minLength,t)&&n.push("minLength"),!w.isNullOrUndefined(e.maxLength)&&E.isValid(e.maxLength)&&e.maxLength>0&&!this.validateMaxLength(e.maxLength,t)&&n.push("maxLength"),!w.isNullOrUndefined(e.match)&&w.isString(e.match)&&e.match.length>0&&!this.validateMatch(e.match,t)&&n.push("match"),n}getErrorMessage(e,t,n){const o=super.getErrorMessage(e,t,n);switch(o){case"minLength":return`Data not saved. Minimum ${e.minLength} characters are required`;case"maxLength":return`Data not saved. Maximum ${e.maxLength} characters are allowed`;case"match":return"Data not saved. This field contains invalid characters";default:return o}}validateMinLength(e,t){return!(!(!E.isValid(e)||e<=0||w.isNullOrUndefined(t))&&w.isString(t))||t.length>=e}validateMaxLength(e,t){return!(!(!E.isValid(e)||e<=0||w.isNullOrUndefined(t))&&w.isString(t))||t.length<=e}validateMatch(e,t){if(w.isNullOrUndefined(e)||!w.isString(e)||""===e.trim())return!0;if(w.isNullOrUndefined(t)||!w.isString(t)||""===t.trim())return!0;const n=e.match(/(\/?)(.+)\1([a-z]*)/i),o=n[2],r=n[3];return new RegExp(o,r).test(t)}validateMandatory(e,t){return!!super.validateMandatory(e,t)&&(w.isString(t)&&t.length>0&&""!==t.trim())}}ut("String",Tt);class Ft extends Tt{validateInputValue(e,t){return super.validateInputValue(e,t)}}ut("Notes",Ft);class Nt extends xt{validateInputValue(e,t){return super.validateInputValue(e,t)}}ut("ObjectId",Nt);class St extends xt{validateInputValue(e,t){return super.validateInputValue(e,t)}}ut("[ObjectId]",St);class Ot extends xt{validateInputValue(e,t){return super.validateInputValue(e,t)}validateMandatory(e,t){var n,o,r;if(!super.validateMandatory(e,t))return!1;switch(null==t?void 0:t.ownershipType){case"Sole":return 1===(null===(n=null==t?void 0:t.owners)||void 0===n?void 0:n.length);case"Joint":return 2===(null===(o=null==t?void 0:t.owners)||void 0===o?void 0:o.length);case"Other":return(null===(r=null==t?void 0:t.owners)||void 0===r?void 0:r.length)>=1}return!1}}ut("Ownership",Ot);class Dt extends Mt{validateInputValue(e,t){return super.validateInputValue(e,t)}getErrorMessage(e,t,n){switch(n){case"min":return`Data not saved. The value must be greater than or equal to ${C.getCurrencyText(e.min,!1,e.decimalPlaces||2,"")}%`;case"max":return`Data not saved. The value must be less than or equal to ${C.getCurrencyText(e.max,!1,e.decimalPlaces||2,"")}%`;default:return super.getErrorMessage(e,t,n)}}}ut("Percentage",Dt);class Pt extends xt{validateInputValue(e,t){return super.validateInputValue(e,t)}}ut("SelectBoolean",Pt);class It extends xt{validateInputValue(e,t){return super.validateInputValue(e,t)}validateMandatory(e,t){return!!super.validateMandatory(e,t)&&(w.isString(t)&&t.length>0&&""!==t.trim()&&null!==E.parse(t))}}ut("SelectNumber",It);class Rt extends xt{validateInputValue(e,t){return super.validateInputValue(e,t)}validateMandatory(e,t){return!w.isNullOrUndefined(t)&&""!==t.trim()&&this.validateEnum(e.enum,t)}}ut("Select",Rt);const Vt=(e,t,n)=>{De(e,t),Je(e,n)},At=()=>{const e=Ut.pop();e&&(e.classList.add("moorr-modal-container-closing"),setTimeout((()=>{e&&(q.unmountComponentAtNode(e),e.remove())}),300))};let Lt=class{constructor(e){this._props=e}open(){const t=this._props;return new Promise(((n,o)=>{let r,i;"function"==typeof t.onClose&&(r=t.onClose),t.onClose=e=>{r&&r(e),n({dismissed:!1,result:e}),t.showModal=!1,At()},"function"==typeof t.onDismiss&&(i=t.onClose),t.onDismiss=()=>{i&&i(),n({dismissed:!0}),t.showModal=!1,At()},t.showModal=!0;let l=e.createElement(he,{stylePrefix:"MoorrReactMuiModal"},e.createElement(this.getComponent(),t));Ut.push(this._container=document.createElement("div")),this._container.className="moorr-modal-container",document.body.appendChild(this._container),q.render(l,this._container)}))}};const Ut=[],jt={},Bt=N((e=>({modal:{display:"flex",alignItems:"center",justifyContent:"center"},paper:{width:825,backgroundColor:e.palette.background.paper,borderRadius:"5px",boxShadow:e.shadows[5],padding:e.spacing(2,4,3)}}))),$t=e=>"number"==typeof e?e+"px":e,zt=t=>{var n,o,r,i,a,d,c,u;const m=Bt(),p={};t.fixedWidth&&(p.width=t.fixedWidth),t.fixedHeight&&(p.height=t.fixedHeight),t.fixedHeight&&(p.height=t.fixedHeight),(null===(n=t.margins)||void 0===n?void 0:n.left)&&(p.marginLeft=$t(null===(o=t.margins)||void 0===o?void 0:o.left)),(null===(r=t.margins)||void 0===r?void 0:r.right)&&(p.marginRight=$t(null===(i=t.margins)||void 0===i?void 0:i.right)),(null===(a=t.margins)||void 0===a?void 0:a.top)&&(p.marginTop=$t(null===(d=t.margins)||void 0===d?void 0:d.top)),(null===(c=t.margins)||void 0===c?void 0:c.bottom)&&(p.marginBottom=$t(null===(u=t.margins)||void 0===u?void 0:u.bottom)),p.transition="opacity 225ms cubic-bezier(0.4, 0, 0.2, 1), width 0.333s, height 0.333s, margin 0.333s";let h=m.paper+" moorr-modal-content-container";t.contentClassName&&(h+=" "+t.contentClassName);const[g,v]=l(!1),[b,y]=l(!1);s((()=>{y(!g&&!1!==t.showModal)}),[g,b,t.showModal]);const x=e=>{v(!0),(null==t?void 0:t.onDismiss)&&t.onDismiss(e)};let E=m.modal;switch(E+=" moorr-modal-container",t.effect){case"fade":E+=" moorr-fade-modal";break;case"slide":E+=" moorr-slide-modal"}return g&&(E+=" moorr-modal-closing"),e.createElement(R,{disableEnforceFocus:!0,className:E,open:b,onClose:x,closeAfterTransition:!0,BackdropComponent:V,BackdropProps:{timeout:300,onClick:e=>{e.preventDefault(),e.stopPropagation(),w.isFunction(t.onBackdropClick)?t.onBackdropClick(e):x("backdrop")}}},(()=>{switch(t.effect){case"fade":default:return e.createElement(A,{in:b},e.createElement("div",{className:h,style:p},t.children));case"slide":return e.createElement(f,{in:b,direction:"left",timeout:300},e.createElement("div",{className:h},t.children))}})())},Ht=(t,n)=>{switch(t){default:case"info":case"warning":case"error":(t=>{K(t,{icon:e.createElement(_,{sx:{color:"#EB5757"}}),style:{color:"#EB5757",backgroundColor:"#FCECEC",border:"2px solid #EB5757",fontFamily:'"Poppins", sans-serif',borderRadius:"0.7em",marginLeft:"-100px"},closeButton:()=>e.createElement(Y,{sx:{color:"#EB5757"}})})})(n);break;case"success":(t=>{K(t,{icon:e.createElement(X,{sx:{color:"#1B5E20"}}),style:{color:"#1B5E20",backgroundColor:"#E8F5E9",border:"2px solid #1B5E20",fontFamily:'"Poppins", sans-serif',borderRadius:"0.7em",marginLeft:"-100px"},closeButton:()=>e.createElement(Y,{sx:{color:"#1B5E20"}})})})(n)}},Gt=t=>e.createElement(zt,{effect:"fade",contentClassName:`${t.className}-content-container`,fixedWidth:t.widthValue,fixedHeight:t.heightValue,margins:t.marginValues,showModal:t.showModal,onClose:t.onClose,onDismiss:t.onDismiss,onBackdropClick:t.onBackdropClick},e.createElement("div",{className:`${t.className} moorr-modal-container`},e.createElement("div",{className:"moorr-modal-header"},t.renderHeader),e.createElement("div",{className:"moorr-modal-body"},t.renderBody),!1===t.hasFooter?null:e.createElement("div",{className:"moorr-modal-footer"},e.createElement("div",{className:"left-buttons"},t.renderLeftButtons),e.createElement("div",{className:"status-message"},t.renderStatusMessage),e.createElement("div",{className:"right-buttons"},t.renderRightButtons)))),Wt=t=>{const{className:n,onDismiss:r,showModal:i,onClose:l,icon:a,title:s,body:d,closeLabel:c}=t,u=o((()=>{l(!1)}),[l]);o((()=>{l(!0)}),[l]);const p=o((()=>w.isString(d)?e.createElement(m,{paragraph:!0},d):w.isArray(d)&&d.length>0?d.map(((t,n)=>{const o=`paragraph-${n}`;if(w.isString(t)||!w.isNullOrUndefined(t))return e.createElement(m,{paragraph:!0,key:o},t)})):w.isNullOrUndefined(d)?e.createElement(m,{paragraph:!0},"Please alert to continue."):d),[d]),g=o((()=>e.createElement(h,{sx:{marginBottom:"0.5rem","& > .MuiTypography-root.MuiTypography-paragraph":{fontFamily:"Poppins,sans-serif",fontSize:"14px !important",fontWeight:400,lineHeight:"20px"},"& > .MuiTypography-root.MuiTypography-paragraph .MuiTypography-root.MuiTypography-body1":{fontFamily:"inherit !important",fontSize:"inherit !important",fontWeight:"inherit",lineHeight:"inherit"},"& > .MuiTypography-root.MuiTypography-paragraph strong.MuiTypography-root.MuiTypography-body1":{fontWeight:"600 !important"}}},p())),[p]),v=o((()=>w.isString(s)||!w.isNullOrUndefined(s)?s:"Alert"),[s]),f=o((()=>e.createElement(h,{sx:{position:"relative",marginBottom:"0.5rem","& > .MuiSvgIcon-root":{color:"#541868",fontSize:"2rem"}}},null!=a?a:e.createElement(b,null),e.createElement(m,{variant:"h6",sx:{color:"#541868",fontFamily:"Poppins,sans-serif",fontSize:"16px !important",fontWeight:400,lineHeight:22}},v()),e.createElement(y,{onClick:u,sx:{position:"absolute",top:"-0.5rem",right:"-0.5rem"},"data-testid":"dismiss"},e.createElement(Y,{sx:{fontSize:"1rem"}})))),[a,v,u]),x=o((()=>{const t=c||"Dismiss";return e.createElement(oe,{handleClick:u,label:t,"data-testid":`${k.toKebabCase(t)}`})}),[c,u]);return e.createElement(Gt,{className:"alert-modal"+(n?" "+n:""),widthValue:"400px",showModal:!0===i,onDismiss:r,onBackdropClick:u,renderHeader:f(),renderBody:g(),renderStatusMessage:x()})};class qt extends Lt{constructor(e){super(e)}getComponent(){return Wt}}jt.alert=qt;const Kt=t=>{const{className:n,onDismiss:r,showModal:i,onClose:l,icon:a,title:s,body:d,cancelLabel:c,confirmLabel:u}=t,p=o((()=>{l(!1)}),[l]),g=o((()=>{l(!0)}),[l]),v=o((()=>w.isString(d)?e.createElement(m,{paragraph:!0},d):w.isArray(d)&&d.length>0?d.map(((t,n)=>{const o=`paragraph-${n}`;if(w.isString(t)||!w.isNullOrUndefined(t))return e.createElement(m,{paragraph:!0,key:o},t)})):w.isNullOrUndefined(d)?e.createElement(m,{paragraph:!0},"Please confirm to continue."):d),[d]),f=o((()=>e.createElement(h,{sx:{marginBottom:"0.5rem","& > .MuiTypography-root.MuiTypography-paragraph":{fontFamily:"Poppins,sans-serif",fontSize:"14px !important",fontWeight:400,lineHeight:"20px"},"& > .MuiTypography-root.MuiTypography-paragraph .MuiTypography-root.MuiTypography-body1":{fontFamily:"inherit !important",fontSize:"inherit !important",fontWeight:"inherit",lineHeight:"inherit"},"& > .MuiTypography-root.MuiTypography-paragraph strong.MuiTypography-root.MuiTypography-body1":{fontWeight:"600 !important"}}},v())),[v]),x=o((()=>w.isString(s)||!w.isNullOrUndefined(s)?s:"Confirm"),[s]),E=o((()=>e.createElement(h,{sx:{position:"relative",marginBottom:"0.5rem","& > .MuiSvgIcon-root":{color:"#541868",fontSize:"2rem"}}},null!=a?a:e.createElement(b,null),e.createElement(m,{variant:"h6",sx:{color:"#541868",fontFamily:"Poppins,sans-serif",fontSize:"16px !important",fontWeight:400,lineHeight:22}},x()),e.createElement(y,{onClick:p,sx:{position:"absolute",top:"-0.5rem",right:"-0.5rem"}},e.createElement(Y,{sx:{fontSize:"1rem"},"data-testid":"dismiss"})))),[a,x,p]),M=o((()=>{const t=c||"Cancel";return e.createElement(ie,{handleClick:p,label:t,"data-testid":`${k.toKebabCase(t)}`})}),[c,p]),C=o((()=>{const t=u||"Dismiss";return e.createElement(oe,{handleClick:g,label:t,"data-testid":`${k.toKebabCase(t)}`})}),[u,g]);return e.createElement(Gt,{className:"confirm-modal"+(n?" "+n:""),widthValue:"400px",showModal:!0===i,onDismiss:r,onBackdropClick:p,renderHeader:E(),renderBody:f(),renderLeftButtons:M(),renderRightButtons:C()})};class _t extends Lt{constructor(e){super(e)}getComponent(){return Kt}}jt.confirm=_t;const Yt=t=>{const{className:n,header:o,body:r,leftButtonLabel:i,rightButtonLabel:l,hiddenClose:a,width:s}=t,d=e=>{e.stopPropagation(),t.onDismiss()};return e.createElement(Gt,{className:"opti-info-modal"+(n?" "+n:""),widthValue:null!=s?s:"554px",showModal:!0===t.showModal,onDismiss:t.onDismiss,renderBody:e.createElement(h,{sx:{display:"flex",flexDirection:"row",position:"relative"}},e.createElement(h,{sx:{position:"absolute",right:"12px",top:"12px",cursor:"pointer"}},e.createElement("svg",{onClick:t.onDismiss,width:"20",height:"20",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M16.8564 6.35381L12.2707 10.9395L16.8976 15.5664L15.5609 16.903L10.9341 12.2762L6.36889 16.8414L5.13506 15.6075L9.70023 11.0424L5.07337 6.4155L6.41002 5.07885L11.0369 9.70571L15.6226 5.11998L16.8564 6.35381Z",fill:"#541868"}))),e.createElement(h,{sx:{width:"60px",background:"#541868",borderTopLeftRadius:"5px",borderBottomLeftRadius:"5px",flexShrink:0}}),e.createElement(h,{sx:{position:"absolute",top:"11.81px",left:"12px",borderRadius:"50% 50% 0% 50%",padding:"5px",background:"white"}},e.createElement("img",{style:{height:"50px",background:"#66E84B",borderRadius:"50% 50% 0% 50%",padding:"5px"},src:"/assets/img/opti/Opti-Blinked.gif"})),e.createElement(h,{sx:{padding:"1rem 1rem 1rem 1.5rem"}},e.createElement(h,{sx:{color:"#541868",fontSize:"16px",lineHeight:"22.4px",fontWeight:400}},o),e.createElement(h,{sx:{marginTop:"1rem"}},r),e.createElement(h,{className:"opti-info-modal-buttons",sx:{textAlign:"right",marginTop:"1rem"}},i&&e.createElement(x,{className:"opti-info-modal-button-left",style:{marginRight:"5px"},variant:"contained",color:"primary",onClick:()=>{},"data-testid":`${k.toKebabCase(i)}`},i),!a&&e.createElement(oe,{label:"Close",handleClick:d,"data-testid":"close"}))))})};class Xt extends Lt{constructor(e){super(e)}getComponent(){return Yt}}jt.optiInfo=Xt;const Zt=e=>{var t,n,o,r,i;const l=null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.modal;if(!l||!jt[l])return Promise.reject("invalid-modal");const a=new jt[l]((null===(n=null==e?void 0:e.detail)||void 0===n?void 0:n.props)||{}).open();(null===(o=null==e?void 0:e.detail)||void 0===o?void 0:o.then)&&a.then((t=>{var n;try{null===(n=null==e?void 0:e.detail)||void 0===n||n.then(t)}catch(e){console.error(e)}})),(null===(r=null==e?void 0:e.detail)||void 0===r?void 0:r.catch)&&a.catch(null===(i=null==e?void 0:e.detail)||void 0===i?void 0:i.catch),a.finally((()=>{var t,n;if(null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.finally)try{null===(n=null==e?void 0:e.detail)||void 0===n||n.finally()}catch(e){console.error(e)}})),(null==e?void 0:e.detail)&&((null==e?void 0:e.detail).promise=a)};document&&(document.removeEventListener("openModal",Zt),document.addEventListener("openModal",Zt));const Jt=(e,t)=>{const[n,r]=l(null),i=a(null),d=o((e=>{if(!e)return;const n=Object.assign({},e.contentRect.toJSON());E.isValid(t)&&t>0?(clearTimeout(i.current),i.current=setTimeout((()=>{r(n)}),t)):r(n)}),[t]);return s((()=>{const t=e.current;let n;return t&&(n=new ResizeObserver((([e])=>d(e))),n.observe(t)),()=>{n&&t&&(n.unobserve(t),n.disconnect())}}),[e.current]),n},Qt=r({}),en=()=>i(Qt),tn=()=>({context:en()}),nn=(e,t,n)=>{var r,i;const{context:a}=tn();s((()=>{var e,t;w.mutexRelease(null!==(t=null===(e=null==a?void 0:a.sectionContext)||void 0===e?void 0:e.updateSessionId)&&void 0!==t?t:"default")}),[null===(r=null==a?void 0:a.sectionContext)||void 0===r?void 0:r.updateSessionId]);const[d,c]=l(0),u=o((()=>{c((e=>e+1))}),[]),[m,p]=l(!1),[h,g]=l(!1),v=o(((e,t)=>{const n=!0===t;p(!0===e),g(n)}),[]),f=o((n=>ne(void 0,void 0,void 0,(function*(){if(w.isFunction(t)){const[e]=yield Promise.all([t(n)]);if(!e)return}return a.onMoveBack&&a.onMoveBack({section:e,data:n})}))),[h,t,a.onMoveBack]),[b,y]=l(!1),[x,E]=l(!1),[M,C]=l(null);s((()=>{x&&a.onMoveNext&&a.onMoveNext({section:e,data:M})}),[x,M]);const k=o((e=>ne(void 0,void 0,void 0,(function*(){var t,o;try{y(!0),yield w.delay(350),yield w.mutex(null!==(o=null===(t=null==a?void 0:a.sectionContext)||void 0===t?void 0:t.updateSessionId)&&void 0!==o?o:"default",(()=>ne(void 0,void 0,void 0,(function*(){if(yield w.delay(350),w.isFunction(n)){const[t]=yield Promise.all([n(e)]);if(!t)return}else if(m||h)return;E(!0),C(e)}))))}finally{y(!1)}}))),[null===(i=null==a?void 0:a.sectionContext)||void 0===i?void 0:i.updateSessionId,m,h,n]),{updatingCount:T,updatingFlags:F,setUpdating:N,unsetUpdating:S}=bt();return{context:a.sectionContext,sectionStep:d,nextSectionStep:u,hasErrors:m,hasMandatoryErrors:h,handleSetHasErrors:v,moveBack:f,moveNext:k,awaitingMoveNext:b,updatingCount:T,updatingFlags:F,setUpdating:N,unsetUpdating:S}},on=(e,t,n)=>{const[r,i]=l(t),[a,d]=l(null),[c,u]=l(null),[m,p]=l(null),[h,g]=l(!1),v=o((()=>new Promise((t=>{if(h)return void t(h);const n={};Ye(`wizardSection.validateForm.${e}`,{callback:(e,o)=>{n.hasErrors=!0===(null==n?void 0:n.hasErrors)||e,n.hasMandatoryErrors=1==(null==n?void 0:n.hasMandatoryErrors)||o;const r=!n.hasErrors&&!n.hasMandatoryErrors;r||g(!0),t(r)}})}))),[h,e]),{context:f,sectionStep:b,nextSectionStep:y,updatingCount:x,updatingFlags:E,setUpdating:w,unsetUpdating:M,hasErrors:C,hasMandatoryErrors:k,handleSetHasErrors:T,moveBack:F,moveNext:N,awaitingMoveNext:S}=nn(e,void 0,v);s((()=>{if(!(null==f?void 0:f.validationSchemas))return;ne(void 0,void 0,void 0,(function*(){yield n(null,t,p,(()=>{}),(()=>{}),f.validationSchemas),i(t);const e=t.tiles[0];d(e);const o={};e.tile.controls.forEach((e=>{o[e.control.dataKey]=e})),u(o)}))}),[t,null==f?void 0:f.validationSchemas]);const[O,D]=l(null),P=o((e=>ne(void 0,void 0,void 0,(function*(){var n,o;if(!t||!m||!O)return{hasErrors:!1,hasMandatoryErrors:!1};const{hasErrors:r,hasMandatoryErrors:i}=yield ft(t,m,null,D,T);return(null===(n=null==e?void 0:e.detail)||void 0===n?void 0:n.callback)&&(null===(o=null==e?void 0:e.detail)||void 0===o||o.callback(r,i)),{hasErrors:r,hasMandatoryErrors:i}}))),[t,m,O,T]);return _e(`wizardSection.validateForm.${e}`,P),{context:f,sectionStep:b,nextSectionStep:y,settings:r,graphingTile:a,graphingControls:c,inputSchemas:m,data:O,setData:D,updatingCount:x,updatingFlags:E,setUpdating:w,unsetUpdating:M,hasErrors:C,hasMandatoryErrors:k,handleSetHasErrors:T,moveBack:F,moveNext:N,awaitingMoveNext:S}},rn=e=>{const[t,n]=l(e),[o,r]=l(null),[i,a]=l(null);return s((()=>{n(e);const t=e.tiles[0];r(t);const o={};t.tile.controls.forEach((e=>{o[e.control.dataKey]=e})),a(o)}),[e]),{settings:t,graphingTile:o,graphingControls:i}},ln=t(((t,n)=>{var{stepIndex:o,sectionStep:r,onNextSectionStep:i,onStepIncrease:l,enterTimeout:a,onEntered:s,children:d}=t,c=te(t,["stepIndex","sectionStep","onNextSectionStep","onStepIncrease","enterTimeout","onEntered","children"]);return e.createElement(J,{in:r>=o,timeout:{enter:null!=a?a:600},mountOnEnter:!0,onEntered:()=>{i&&i(),s&&s()}},e.createElement(Z,Object.assign({},c,{ref:n}),d))})),an=t(((t,r)=>{var i,l,{section:a,children:d,animate:c,animateIn:m,animateOut:p,animateEasing:h,animateDuration:g,maxWidth:v,sx:f}=t,b=te(t,["section","children","animate","animateIn","animateOut","animateEasing","animateDuration","maxWidth","sx"]);const y=u("(max-width: 700px)"),x=en();s((()=>{x.setSectionMaxWidth(null!=v?v:0)}),[v]);const M=n((()=>{var e;let t={position:"absolute",height:"100%",top:0,overflowY:"auto",overflowX:"hidden","&::-webkit-scrollbar":{width:"6px",height:"6px"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#a98bb3",borderRadius:"6px"},"&::-webkit-scrollbar-thumb:hover":{backgroundColor:"rgb(118, 70, 134)"},"&::-webkit-scrollbar-track":{background:"rgba(118, 70, 134, 0.15)",borderRadius:"6px"}};if(!y&&E.isValid(v)&&v>0&&!w.isNullOrUndefined(null===(e=x.containerRect)||void 0===e?void 0:e.width)&&x.containerRect.width>v){const e=Math.floor((x.containerRect.width-v)/2);t=Object.assign(Object.assign({},t),{left:e,width:`calc(100% - ${e}px)`})}else t=Object.assign(Object.assign({},t),{left:0,width:"100%",padding:y?"0 0.75rem":"0"});return t}),[y,v,null===(i=x.containerRect)||void 0===i?void 0:i.width]),C=n((()=>{var e;let t=Object.assign(Object.assign({},f),{width:"100%"});return E.isValid(v)&&v>0&&!w.isNullOrUndefined(null===(e=x.containerRect)||void 0===e?void 0:e.width)&&x.containerRect.width>v&&(t=Object.assign(Object.assign({},t),{maxWidth:v})),t}),[f,v,null===(l=x.containerRect)||void 0===l?void 0:l.width]),k=o((()=>e.createElement(Z,Object.assign({},b,{ref:r,className:`wizard-section wizard-section-${a}`,sx:M}),e.createElement(Z,{sx:C},d))),[a,M,C,d,b]),T=n((()=>{var e;return null!==(e=null!=c?c:x.animate)&&void 0!==e?e:"fade"}),[x.animate,c]),F=n((()=>({enter:!1!==m?null!=g?g:300:0,exit:!1!==p?null!=g?g:300:0})),[m,p,g]),N=n((()=>null!=h?h:"ease-in-out"),[]),S=o((()=>e.createElement(J,{easing:N,timeout:F,in:x.section===a,mountOnEnter:!0,unmountOnExit:!0,onEnter:e=>{e.style.opacity="0"},onEntering:e=>{e.style.opacity="1"},onEntered:e=>{e.style.opacity="",e.style.transition="",x.setSectionMaxWidth(null!=v?v:0)}},k())),[N,F,x.section,a,k]),O=n((()=>{switch(T){case"scroll-up":return"back"!==x.moveDirection?x.section===a?"up":"down":x.section===a?"down":"up";case"scroll-down":return"back"!==x.moveDirection?x.section===a?"down":"up":x.section===a?"up":"down";case"scroll-left":return"back"!==x.moveDirection?x.section===a?"left":"right":x.section===a?"right":"left";case"scroll-right":return"back"!==x.moveDirection?x.section===a?"right":"left":x.section===a?"left":"right"}}),[x.section,x.moveDirection,a,T]),D=o((()=>e.createElement(Q,{container:x.containerRef.current,direction:O,easing:N,timeout:F,in:x.section===a,mountOnEnter:!0,unmountOnExit:!0,onEnter:e=>{var t,n,o,r;switch(O){case"up":e.style.transform=e.style.webkitTransform=`translateY(${null===(t=x.containerRect)||void 0===t?void 0:t.height}px)`;break;case"down":e.style.transform=e.style.webkitTransform=`translateY(-${null===(n=x.containerRect)||void 0===n?void 0:n.height}px)`;break;case"left":e.style.transform=e.style.webkitTransform=`translateX(${null===(o=x.containerRect)||void 0===o?void 0:o.width}px)`;break;case"right":e.style.transform=e.style.webkitTransform=`translateX(-${null===(r=x.containerRect)||void 0===r?void 0:r.height}px)`}},onEntering:e=>{switch(O){case"up":case"down":e.style.transform=e.style.webkitTransform="translateY(0)";break;case"left":case"right":e.style.transform=e.style.webkitTransform="translateX(0)"}},onEntered:e=>{e.style.transform="",e.style.webkitTransform="",e.style.transition="",x.setSectionMaxWidth(null!=v?v:0)}},k())),[N,F,x.section,a,O,x.containerRect,k]),P=o((()=>{switch(T){case"fade":return S();case"scroll-up":case"scroll-down":case"scroll-left":case"scroll-right":return D()}return x.section!==a?null:k()}),[x.section,a,T,S,D,k]);return e.createElement(e.Fragment,null,P())})),sn=t((({children:t,initialSection:r,animate:i,avatar:c,isAvatarVisible:u,sx:m,onMoveBack:p,onMoveNext:h,onSectionChange:g,sectionContext:v},f)=>{const b=a(null),y=Jt(b),[x,M]=l(r);s((()=>{r&&g&&g(r)}),[r]);const[C,k]=l(null),[T,F]=l(),N=a(null),S=Jt(N),O=o(((e,t)=>{e!==x&&(M(e),k(null!=t?t:null),g&&g(e))}),[x,g]),D=n((()=>({containerRef:b,containerRect:y,section:x,moveDirection:C,onMoveBack:p,onMoveNext:h,changeSection:O,setSectionMaxWidth:F,animate:i,sectionContext:v})),[y,x,C,p,h,O,i,v]);d(f,(()=>({section:x,context:D})),[x,D]);const P=n((()=>{if(w.isNullOrUndefined(y))return null;if(w.isNullOrUndefined(c)||w.isNullOrUndefined(S))return null;let e={display:"inline-block",position:"absolute"};return e=w.isFunction(u)&&!u(x)?Object.assign(Object.assign({},e),{opacity:0}):Object.assign(Object.assign({},e),{opacity:1}),E.isValid(T)&&T>0&&(e=Object.assign(Object.assign({},e),{left:Math.floor((y.width-T)/2)-S.width})),e}),[y,c,u,S,T]),I=o((()=>w.isNullOrUndefined(T)||0===T||w.isNullOrUndefined(P)?null:c),[T,c,P]);return e.createElement(Z,{ref:b,sx:Object.assign({position:"relative"},m)},e.createElement(Qt.Provider,{value:D},e.createElement(Z,{ref:N,sx:P},I()),t))}));export{Et as AddressValidator,qt as AlertModal,wt as AsAtDateValidator,ee as Button,_t as ConfirmModal,Ct as CurrencyValidator,kt as DateValidator,de as Dropdown,Gt as FadeModal,Le as FormGroupAddActionModel,Ue as FormGroupModel,ot as FormGroupsTile,ze as FormGroupsTileModel,Ve as FormInputModel,ge as GraphingContext,Qe as GraphingControl,Re as GraphingControlModel,Ae as GraphingControlSettingsModel,Xe as GraphingGrid,tt as GraphingPage,Se as GraphingSettingsModel,ye as GraphingTile,et as GraphingTileControls,je as GraphingTileModel,Ne as GraphingTileSettingsModel,Me as GraphingTiles,rt as HorizontalTile,He as HorizontalTileModel,Lt as Modal,zt as MoorrModal,$e as MultipleControlsTileModel,Ft as NotesValidator,Mt as NumberValidator,Nt as ObjectIdValidator,St as ObjectIdsValidator,Xt as OptiInfoModal,Ot as OwnershipValidator,Dt as PercentageValidator,oe as PrimaryButton,re as QtyButton,ie as SecondaryButton,Pt as SelectBooleanValidator,le as SelectButton,It as SelectNumberValidator,Rt as SelectValidator,it as SelectableStatesTile,Ge as SelectableStatesTileModel,lt as SimpleFormTile,We as SimpleFormTileModel,Be as SingleControlTileModel,at as SingleTile,qe as SingleTileModel,Tt as StringValidator,he as StylesProvider,me as SvgIcon,xt as Validator,st as VerticalTile,Ke as VerticalTileModel,sn as Wizard,an as WizardSection,ln as WizardSectionStep,gt as checkDataForErrors,Pe as createGraphingControl,Ie as createGraphingControls,Te as createGraphingTile,Fe as createGraphingTiles,mt as createValidator,pt as createValidators,Ye as dispatchRootEvent,ht as hasInputError,jt as modals,Ut as modalsStack,De as registerGraphingControl,Je as registerGraphingControlComponent,Vt as registerGraphingFrameworkComponent,ke as registerGraphingTile,be as registerGraphingTileComponent,ue as registerSvgIconComponent,ut as registerValidator,Ht as toastMessage,ve as useGraphingContext,yt as useGraphingForm,dt as useGraphingFramework,Jt as useResizeObserver,_e as useRootEventListener,bt as useUpdateTracker,tn as useWizard,en as useWizardContext,rn as useWizardForm,on as useWizardFormSection,nn as useWizardSection,ft as validateData,vt as validateInput};
|