moorr-react-mui 0.3.35 → 0.3.36
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;}.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;}
|
|
11
|
+
.moorr-modal-container > .moorr-modal-content-container{padding:0;display:flex;flex-direction:column;z-index:1;}.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.moorr-fade-modal > .moorr-modal-content-container{transition:opacity 225ms cubic-bezier(0.4,0,0.2,1),width 225ms cubic-bezier(0.4,0,0.2,1),height 225ms cubic-bezier(0.4,0,0.2,1),margin 225ms cubic-bezier(0.4,0,0.2,1)!important;}.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 i,useContext as r,useState as a,useRef as l,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,Modal as f,Backdrop as b,Fade as y,Slide as x,Icon as E,IconButton as w,Button as M}from"@mui/material";import{integers as C,utils as k,dates as T,decimals as F,strings as N}from"moorr-common";import O from"@mui/material/IconButton";import S from"@mui/material/MenuItem";import D from"@mui/material/TextField";import I from"@mui/material/Divider";import P from"@emotion/cache";import{CacheProvider as V}from"@emotion/react";import{StyledEngineProvider as A}from"@mui/material/styles";import L,{Responsive as R}from"react-grid-layout";import U from"@mui/material/Accordion";import j from"@mui/material/AccordionSummary";import B from"@mui/material/AccordionDetails";import z from"@mui/icons-material/ExpandMore";import $ from"react-dom";import{toast as H}from"react-toastify";import G from"@mui/icons-material/Cancel";import W from"@mui/icons-material/Close";import q from"@mui/icons-material/CheckCircle";import K from"@mui/material/Box";import _ from"@mui/material/Fade";import Y from"@mui/material/Slide";const X=({type:t,label:n})=>(t||(t="button"),e.createElement("button",{type:t,className:"moorr-button"},e.createElement("span",null,n)));function Z(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 i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(n[o[i]]=e[o[i]])}return n}function J(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{s(o.next(e))}catch(e){r(e)}}function l(e){try{s(o.throw(e))}catch(e){r(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}s((o=o.apply(e,t||[])).next())}))}const Q=t(((t,o)=>{var{style:i={},handleClick:r,label:a,disabled:l}=t,s=Z(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:l,disableElevation:!0,disableRipple:!0,disableFocusRipple:!0,disableTouchRipple:!0,style:Object.assign(Object.assign(Object.assign({},!l&&{backgroundColor:"#541868"}),{color:"#FFFFFF",fontWeight:400,fontSize:"14px",width:m,height:"39px",borderRadius:"48px",textTransform:"capitalize"}),i),onClick:r,variant:"contained"}),a)})),ee=t(((t,i)=>{var{sx:r,item:a,label:l,qty:s,disabled:d,highlight:u,onSelectItem:p}=t,h=Z(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({},r),{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,r]),f=o((e=>J(void 0,void 0,void 0,(function*(){e.stopPropagation(),e.preventDefault(),k.isFunction(p)&&s<=0&&(yield Promise.all([p(a,1)]))}))),[s,p]),b=o((()=>!C.isValid(s)||s<=0?null:e.createElement(O,{disabled:d,sx:Object.assign(Object.assign({},g),{backgroundColor:"#E37D7D",opacity:0,"&:hover":{backgroundColor:"#E37D7D"},"&:active":{backgroundColor:"#E37D7D"}}),onClick:()=>p&&p(a,Math.max(0,s-1))},"-")),[d,g,s,p]),y=o((()=>!C.isValid(s)||s<=0?null:e.createElement(O,{disabled:d,sx:Object.assign(Object.assign({},g),{backgroundColor:"#541868",opacity:0,"&:hover":{backgroundColor:"#541868"},"&:active":{backgroundColor:"#541868"}}),onClick:()=>p&&p(a,s+1)},"+")),[d,g,s,p]),x=o((()=>{let t,n;return!C.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:i,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!=l?l:a),y(),x())})),te=t(((t,o)=>{var{style:i={},handleClick:r,label:a,disabled:l}=t,s=Z(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:l,disableElevation:!0,disableRipple:!0,disableFocusRipple:!0,disableTouchRipple:!0,style:Object.assign(Object.assign(Object.assign({},!l&&{backgroundColor:"#D4C5D9"}),{color:"#541868",fontWeight:400,fontSize:"14px",width:m,height:"39px",borderRadius:"48px",textTransform:"capitalize"}),i),onClick:r,variant:"contained"}),a)})),ne=t(((t,i)=>{var{sx:r,item:a,label:l,itemSelected:s,onSelectItem:d}=t,u=Z(t,["sx","item","label","itemSelected","onSelectItem"]);const p=n((()=>{const e=Object.assign(Object.assign({},r),{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,r]),h=o((e=>J(void 0,void 0,void 0,(function*(){e.stopPropagation(),e.preventDefault(),k.isFunction(d)&&(yield Promise.all([d(a)]))}))),[d]);return e.createElement(c,Object.assign({},u,{ref:i,disableElevation:!0,disableRipple:!0,disableFocusRipple:!0,disableTouchRipple:!0,sx:p,onClick:h}),e.createElement(m,{variant:"body1",component:"span",sx:{flexGrow:1}},null!=l?l:a))})),oe=({handleChange:t,onItemClick:n,value:o,disabled:i=!1,name:r,className:a,classes:l,size:s,menuItemLabel:d,options:c,label:u,required:m=!1,isMBRequiredField:p,fullWidth:h,selectIconComponent:g})=>{let v;g&&(v={IconComponent:g});const f=!o||0===(null==o?void 0:o.length),b=p&&f?{borderColor:"blue !important",borderWidth:"2px !important"}:m&&f?{border:"red 2px solid !important",borderRadius:"4px"}:{},y=l?{classes:{root:l.root,focused:l.focused,error:l.error,notchedOutline:p&&f?l.notchedOutlineMBRequired:l.notchedOutline}}:void 0;return e.createElement(D,{fullWidth:!1!==h,id:"outlined-basic",variant:"outlined",value:o,onChange:t,disabled:i,name:r,className:[a].join(" "),color:"primary",size:s||"small",select:!0,SelectProps:v,defaultValue:"",InputProps:y,sx:{overflow:"hidden",display:"flex",alignItems:"center","&.start":{flexDirection:"row"},"&.top":{flexDirection:"column"},"& .Mui-disabled":{backgroundColor:"var(--grey-color-3)",cursor:"not-allowed",borderRadius:"4px"},"& .MuiSelect-select":{color:"var(--grey-color-2)"},"& .MuiOutlinedInput-notchedOutline":b}},e.createElement(S,{value:"",disabled:!0},e.createElement("em",null,d)),c&&c.map(((t,o)=>"-separator-"===t?e.createElement(I,{key:`divider-${o}`}):e.createElement(S,{key:`menu-item-${o}-${t.value||t}`,value:t.value||t,onClick:()=>n&&n(t)},t.label||t))))},ie={};function re(e,t){e&&t&&(ie[e]=t)}const ae=({className:t,icon:n,width:o,height:i,fill:r,stroke:a,accent:l,dropShadow:s})=>{if(k.isNullOrUndefined(n))return null;const d=ie[n]||null;return d?e.createElement(d,{className:t,fill:r,width:o,height:i,stroke:a,accent:l,dropShadow:s}):null},le={},se=()=>{var e;if("undefined"!=typeof document)return null!==(e=document.querySelector('meta[name="emotion-insertion-point"]'))&&void 0!==e?e:void 0};var de=({stylePrefix:t,children:n})=>{const o=t?t.toLowerCase().replace(/[^a-z0-9]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""):`moorr-sp-${Math.random().toString(36).slice(2,8)}`;return le[o]||(le[o]=P({key:o,insertionPoint:se()})),e.createElement(A,{injectFirst:!0},e.createElement(V,{value:le[o]},n))};const ce=i({});function ue(){return r(ce)}const me={};function pe(e,t){e&&t&&(me[e]=t)}const he=({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 i=me[t.tile.tileType]||null;return i?e.createElement(i,{graphingTile:t,graphingTileIndex:n}):null},ge=[20,20],ve={lg:600,sm:0},fe={lg:8,sm:2},be=({tilePrefix:t,responsive:n,columns:o,containerPadding:i,referenceMargin:r,referenceWidth:d,graphingTiles:c})=>{const u=ue(),[m,p]=a(null),[h,g]=a(null),[v,f]=a(null),[b,y]=a(null),x=l(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 w;const M=e=>{E(),clearTimeout(w),w=setTimeout((()=>{E()}),300)};s((()=>{E()}),[x]),s((()=>(window.addEventListener("resize",M),()=>{window.removeEventListener("resize",M)})),[]),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 C=()=>null==c?void 0:c.map(((n,o)=>{if(!n.tile||!n.visible)return null;if(k.isFunction(u.isTileVisible)&&n.tile.id&&!u.isTileVisible(n.tile.id))return null;let i="graphing-tile-container";n.tile.id&&(i+=` ${n.tile.id}`),!1!==n.border&&(i+=" bordered"),n.autoHeight&&(i+=" auto-height");const r=`${t?t+"_":""}tile_${o}`;return e.createElement("div",{className:i,key:r},e.createElement(he,{graphingTile:n,graphingTileIndex:o}))})),T=e=>{if(!r||isNaN(r)||r<=0||!d||isNaN(d)||d<=0||null==e)return ge;const t=e/d*r;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=[i||0,0];return e.createElement(R,{width:b,breakpoints:ve,cols:o||fe,rowHeight:1,layouts:v,containerPadding:t,margin:m,isDraggable:!1},C())}return h?e.createElement(L,{width:b,cols:9,rowHeight:50,margin:m,isDraggable:!1,layout:h},C()):null})())},ye={};function xe(e,t){ye[e]=t}function Ee(e){const t=ye[null==e?void 0:e.tileType];return t?new t(e):null}function we(e){const t=[];return e.forEach((e=>{const n=Ee(e);n&&t.push(n)})),t}class Me{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=Ee(e.tile),this.visible=!1!==e.visible}getBackground(){return this.background||"#FFFFFF"}}class Ce{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 Me(e))}))}}const ke={};function Te(e,t){ke[e]=t}function Fe(e){const t=ke[null==e?void 0:e.controlType];return t?new t(e):null}function Ne(e){const t=[];return e.forEach((e=>{const n=Fe(e);n&&t.push(n)})),t}class Oe{constructor(e){this.controlType=e.controlType,this.dataKey=e.dataKey}}class Se extends Oe{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=(k.isArray(e.validationSchemaPath)?e.validationSchemaPath:[]).filter((e=>k.isString(e))),this.validationErrorMessages=e.validationErrorMessages||{}}}class De{constructor(e){this.border=e.border,this.background=e.background||null,this.control=Fe(e.control)}getBackground(e){return this.background||(null==e?void 0:e.background)||"#FFFFFF"}}class Ie{constructor(e){this.label=e.label||"",this.value=e.value||"",this.icon=e.icon||"",this.accent=e.accent||""}}class Pe{constructor(e){this.id=e.id||"",this.title=e.title||"",this.controls=[],Array.isArray(e.controls)&&e.controls.forEach((e=>{this.controls.push(new De(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 Ie(e))}))}}class Ve{constructor(e){this.id=e.id,this.tileType=e.tileType}}class Ae extends Ve{constructor(e){super(e),this.control=new De(e.control)}}class Le extends Ve{constructor(e){super(e),this.controls=[],Array.isArray(e.controls)&&e.controls.forEach((e=>{this.controls.push(new De(e))}))}}class Re extends Ve{constructor(e){super(e),k.isArray(e.formGroups)&&e.formGroups.length>0?this.formGroups=e.formGroups.map((e=>new Pe(e))):this.formGroups=[]}}xe("form-groups-tile",Re);class Ue extends Le{constructor(e){super(e),this.controlsPerPage=e.controlsPerPage,(isNaN(this.controlsPerPage)||this.controlsPerPage<=1)&&(this.controlsPerPage=1)}}xe("horizontal-tile",Ue);class je extends Le{constructor(e){super(e),this.states={};for(const t in e.states){const n=e.states[t];n&&(this.states[t]=new Ce(n))}}}xe("selectable-states-tile",je);class Be extends Ve{constructor(e){super(e),this.controls=[],Array.isArray(e.controls)&&e.controls.forEach((e=>{this.controls.push(new De(e))}))}}xe("simple-form-tile",Be);class ze extends Ae{constructor(e){super(e)}}xe("single-tile",ze);class $e extends Le{constructor(e){super(e)}}xe("vertical-tile",$e);const He=(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])},Ge=(e,t)=>{const n=document.querySelector("#react-root");null==n||n.dispatchEvent(new CustomEvent(e,{detail:null!=t?t:{}}))},We=({})=>{const{settings:t,handleUIReady:n}=ue(),[i,r]=a(null),[l,d]=a([]),[c,u]=a(!1);s((()=>{setTimeout((()=>{window.dispatchEvent(new Event("resize")),setTimeout((()=>{u(!0),k.isFunction(n)&&n()}),300)}),300)}),[]);const m=o((e=>{var t,n,o,i,r,a,s,c,u,m,p;if(!(null==l?void 0:l.length)||!(null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.id))return;const h=l.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;k.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),k.isNullOrUndefined(null===(i=null==e?void 0:e.detail)||void 0===i?void 0:i.y)||(h.y=null===(r=null==e?void 0:e.detail)||void 0===r?void 0:r.y),k.isNullOrUndefined(null===(a=null==e?void 0:e.detail)||void 0===a?void 0:a.w)||(h.w=null===(s=null==e?void 0:e.detail)||void 0===s?void 0:s.w),k.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),k.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=l.map((e=>new Me(e)));d(g)}),[l]);He("graphingGrid.updateTile",m),s((()=>{var e;t?(r(new Ce(t)),d(null===(e=t.tiles)||void 0===e?void 0:e.map((e=>new Me(e))))):r(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(!i)return null;let h="graphing-grid-container";return c&&(h+=" in"),e.createElement(e.Fragment,null,e.createElement("div",{className:h},k.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(be,{graphingTiles:l,responsive:i.responsive,columns:i.columns,containerPadding:i.containerPadding,referenceMargin:i.referenceMargin,referenceWidth:i.referenceWidth})))},qe={};function Ke(e,t){e&&t&&(qe[e]=t)}const _e=({graphingTile:t,graphingTileIndex:n,graphingTileControl:o,ControlProps:i})=>{var r;if(!(null===(r=null==o?void 0:o.control)||void 0===r?void 0:r.controlType))return null;const a=qe[o.control.controlType]||null;return a?e.createElement(a,Object.assign({graphingTile:t,graphingTileIndex:n,graphingTileControl:o},i)):null},Ye=({graphingTile:t,graphingTileIndex:n,graphingTileControls:o,ControlProps:i})=>{var r,a;let l="graphing-tile-controls-container";return(null===(r=null==t?void 0:t.tile)||void 0===r?void 0:r.tileType)&&(l+=" "+(null===(a=null==t?void 0:t.tile)||void 0===a?void 0:a.tileType)),e.createElement("div",{className:l},null==o?void 0:o.map(((o,r)=>{var a,l;if(!o.control)return null;let s="graphing-tile-control-container";(null===(a=o.control)||void 0===a?void 0:a.controlType)&&(s+=" "+(null===(l=o.control)||void 0===l?void 0:l.controlType)),!1!==o.border&&(s+=" bordered");const d=`control_${n}_${r}`;return e.createElement("div",{className:s,key:d},e.createElement(_e,{graphingTile:t,graphingTileIndex:n,graphingTileControl:o,ControlProps:i}))})))},Xe=({className:t,context:n})=>e.createElement(ce.Provider,{value:n},e.createElement("div",{className:t},e.createElement(We,null))),Ze=({open:t,actions:n,disabled:o,onClick:i})=>e.createElement(p,{ariaLabel:"Add a New Card",direction:"down",open:t,className:t?"add-card-open":void 0,onClick:i,icon:e.createElement(h,{sx:{display:"flex"}},e.createElement(g,{open:t,icon:e.createElement(ae,{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),Je=({graphingTile:t,graphingTileIndex:i})=>{const r=null==t?void 0:t.tile;if(!r)return null;const d=ue();return e.createElement("div",{className:"form-groups-tile-component"},!k.isArray(r.formGroups)||r.formGroups.length<0?null:r.formGroups.map(((r,c)=>{const u=l(null),[m,p]=a("normal"),[g,f]=a("form-group-container");s((()=>{w()}),[g,m]);const[b,y]=a(0),[x,E]=a(!0);s((()=>{if(x){const e=u.current;k.isNullOrUndefined(e)?y(0):setTimeout((()=>{y(e.scrollHeight)}),10)}else y(0)}),[x]);const w=e=>{if(x){const e=u.current;k.isNullOrUndefined(e)?y(0):setTimeout((()=>{y(Math.max(e.clientHeight,e.scrollHeight))}),10)}else y(0)},M=o((e=>{""===e.value?(p("add"),E(!0)):(null==d?void 0:d.handleFormGroupAdd)&&k.isFunction(d.handleFormGroupAdd)&&d.handleFormGroupAdd(r,e)}),[r,null==d?void 0:d.handleFormGroupAdd]),C=n((()=>r.addActions&&r.addActions.length?r.addActions.map(((t,n)=>e.createElement(v,{key:n.toString(),icon:e.createElement(ae,{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:()=>M(t)}))):null),[r.addActions,M]),[T,F]=a(!1),N=o((e=>{e.stopPropagation(),F((e=>!e))}),[]),O=o((()=>!0!==r.add||k.isFunction(d.formGroupHasAddMode)&&!d.formGroupHasAddMode(r.id)?null:C?e.createElement(Ze,{disabled:"add"==m,open:T,actions:C,onClick:N}):e.createElement("button",{type:"button",className:"form-group-tile-add-button",onClick:D,disabled:"add"==m},e.createElement(ae,{icon:"add-icon",stroke:"#ffffff"}))),[m,d.formGroupHasAddMode,T,C,N]),S=o((()=>!0!==r.edit||k.isFunction(d.formGroupHasEditMode)&&!d.formGroupHasEditMode(r.id)?null:e.createElement("button",{type:"button",className:"form-group-tile-edit-button",onClick:I,disabled:"add"==m},e.createElement(ae,{icon:"edit-icon",fill:"#ffffff"}))),[m,d.formGroupHasEditMode]),D=e=>{e.stopPropagation(),p("add"),E(!0)},I=e=>{e.stopPropagation(),(null==d?void 0:d.handleEdit)&&(null==d||d.handleEdit(r))},P=e=>J(void 0,void 0,void 0,(function*(){k.isFunction(null==d?void 0:d.handleFormGroupCancel)&&(yield Promise.all([null==d?void 0:d.handleFormGroupCancel({formGroup:r})])),p("normal")})),[V,A]=a(!1),L=e=>J(void 0,void 0,void 0,(function*(){if(k.isFunction(null==d?void 0:d.handleFormGroupSave))try{A(!0);const[e]=yield Promise.all([null==d?void 0:d.handleFormGroupSave({formGroup:r})]);if(!1===e)return}finally{A(!1)}p("normal")}));let R="form-group-container";return k.isFunction(d.isFormGroupVisible)&&(d.isFormGroupVisible(r.id)||(R+=" hidden")),R!==g&&f(R),e.createElement(U,{key:`${r.id}-{${c}}`,className:R,expanded:x,onChange:e=>{"add"!==m&&E((e=>!e))},TransitionProps:{unmountOnExit:!0}},e.createElement(j,{className:"form-group-title",expandIcon:"add"!==m?e.createElement(z,null):null},e.createElement("span",{className:"form-group-title-text"},r.title),O(),S()),e.createElement("hr",null),e.createElement(B,{className:"form-group-components"},(()=>{if("add"===m){let t;return k.isFunction(d.renderFormGroup)&&(t=d.renderFormGroup(r,"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:V,onClick:P},"Cancel"),e.createElement("button",{className:"save-button",disabled:V,onClick:L},"Create")))}{const n=r.controls;let o,a;if(k.isFunction(d.renderFormGroup)){if(o=d.renderFormGroup(r,"normal"),!k.isNullOrUndefined(o))return o;a=d.renderFormGroup(r,"footer")}return e.createElement(e.Fragment,null,e.createElement(Ye,{graphingTile:t,graphingTileIndex:i,graphingTileControls:n,ControlProps:{onUIChange:w}}),a)}})()),C&&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)}))})))};pe("form-groups-tile",Je);const Qe=({graphingTile:t,graphingTileIndex:n})=>{const o=null==t?void 0:t.tile;if(!o)return null;const[i,r]=a(null),[l,d]=a(0),[c,u]=a(0),[m,p]=a(null),[h,g]=a(null),[v,f]=a(null),[b,y]=a([]);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 i=n*o.controlsPerPage+e;if(i>=o.controls.length)break;t.controls.push(o.controls[i])}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=l-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!==i)return;const t=c;let n=c-1;n<0&&(n=l-1),p(t),u(n),g(null),f(t);const o=setTimeout((()=>{x(n),f(null),p(null),setTimeout((function(){r(null)}),300)}),300);r(o)},k=e=>{let t=e+1;t>=l&&(t=0),f(t)},T=e=>{e.stopPropagation(),g(null),k(c),p(null)},F=e=>{e.stopPropagation()},N=e=>{e.stopPropagation()},O=e=>{if(e.stopPropagation(),null!==i)return;const t=c;let n=c+1;n>=l&&(n=0),p(t),u(n),g(t),f(null);const o=setTimeout((()=>{g(null),k(n),p(null),setTimeout((function(){r(null)}),300)}),300);r(o)},S={background:t.getBackground()};return e.createElement("div",{className:"horizontal-tile-component",style:S},e.createElement("div",{className:"horizontal-tile-pages-container"},b.map(((o,i)=>{let r="horizontal-tile-page-container";return i===c?r+=" active":i===h?r+=" navigating-from-left":i===v&&(r+=" navigating-from-right"),i===m&&(r+=" previous"),e.createElement("div",{key:`horizontal-tile-page-${i}`,className:r},e.createElement(Ye,{graphingTile:t,graphingTileIndex:n,graphingTileControls:o.controls}))})),e.createElement("div",{className:"horizontal-tile-page-container background",style:S}),l<=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:O},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"}))))),l<=1?null:e.createElement("div",{className:"horizontal-tile-paginators-container"},Array.from(Array(l).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)}})}))))};pe("horizontal-tile",Qe);const et=({graphingTile:t})=>{const n=null==t?void 0:t.tile;if(!n)return null;const[o,i]=a(""),[r,l]=a(null),[d,c]=a([]),u=ue();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 i(""),l(null)}),[n.states]);const m=e=>{i(e),l(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==r?void 0:r.title)),e.createElement("div",{className:"selectable-states-dropdown-container"},e.createElement(oe,{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"},r?e.createElement(be,{tilePrefix:o,graphingTiles:r.tiles,responsive:r.responsive,columns:r.columns,containerPadding:r.containerPadding,referenceMargin:r.referenceMargin,referenceWidth:r.referenceWidth}):null))};pe("selectable-states-tile",et);const tt=({graphingTile:t,graphingTileIndex:n})=>{const o=null==t?void 0:t.tile;if(!o)return null;const i=ue(),r=e=>{k.isFunction(i.handleUIChange)&&i.handleUIChange(e)};return e.createElement("div",{className:"simple-form-tile-component"},(()=>{if(!k.isArray(o.controls)||o.controls.length<0)return null;const i=o.controls;return e.createElement(Ye,{graphingTile:t,graphingTileIndex:n,graphingTileControls:i,ControlProps:{onUIChange:r}})})())};pe("simple-form-tile",tt);const nt=({graphingTile:t,graphingTileIndex:n})=>{const o=null==t?void 0:t.tile;if(!o)return null;const i=[o.control],r={background:t.getBackground()};return e.createElement("div",{className:"single-tile-component",style:r},e.createElement(Ye,{graphingTile:t,graphingTileIndex:n,graphingTileControls:i}))};pe("single-tile",nt);const ot=({graphingTile:t,graphingTileIndex:n})=>{const o=null==t?void 0:t.tile;if(!o)return null;const i=o.controls;return e.createElement("div",{className:"vertical-tile-component"},e.createElement(Ye,{graphingTile:t,graphingTileIndex:n,graphingTileControls:i}))};function it(e,t){const n=ue(),o=null==e?void 0:e.control,[i,r]=a(null);return s((()=>{if(!(o&&(n.data&&n.data[o.dataKey]||t)))return;const e=null!=t?t:n.data[o.dataKey];r(e)}),[o,t,n.data]),{context:n,settings:o,data:i}}pe("vertical-tile",ot);const rt={};function at(e,t){rt[e]=t}function lt(e){const t=rt[e];return t?new t:null}function st(e){const t=[];return e.forEach((e=>{const n=lt(e);n&&t.push(n)})),t}const dt=(e,t,n)=>!(!k.isNullOrUndefined(n)&&""!==(null==n?void 0:n.trim())&&"normal"!==n&&"hover"!==n&&(k.isNullOrUndefined(t)||""===(null==t?void 0:t.trim())))&&(!k.isNullOrUndefined(t)&&""!==(null==t?void 0:t.trim())||!k.isNullOrUndefined(e)&&"warning"!==(null==e?void 0:e.error_0)),ct=(e,t)=>{let n=!1,o=!1;return Object.entries(e).forEach((([e,t])=>{const i=null==t?void 0:t.error;n=n||dt(i),o=o||!0===(null==i?void 0:i.mandatory)})),k.isFunction(t)&&t(n,o),{hasErrors:n,hasMandatoryErrors:o}},ut=(e,t)=>J(void 0,void 0,void 0,(function*(){var n;const o=(t||{})[e.key];if(!k.isArray(o))return;const i={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 r=lt(null!==(o=null==e?void 0:e.validatorType)&&void 0!==o?o:t.type);if(k.isNullOrUndefined(r))return;e.validatorData&&(r.validatorData=e.validatorData);const a=r.validate(t,e.value);i.mandatory=!0===t.mandatory||"AsAtDate"===e.validatorType,i.errors=a,k.isArray(a)&&a.length>0&&a.forEach(((n,o)=>{i[`error_${o}`]=r.getErrorMessage(t,e.control,n),i.count+=1}))})),i})),mt=(e,t,n,o,i)=>J(void 0,void 0,void 0,(function*(){var r;if(k.isNullOrUndefined(e)||k.isNullOrUndefined(t))return{hasErrors:!1,hasMandatoryErrors:!1};let a;if(k.isNullOrUndefined(n)?o((e=>(a=Object.assign({},e),e))):a=Object.assign({},n),!a)return{hasErrors:!1,hasMandatoryErrors:!1};const l=[];return null===(r=null==e?void 0:e.tiles)||void 0===r||r.forEach((e=>{var n,o,i,r,s;switch(null===(n=null==e?void 0:e.tile)||void 0===n?void 0:n.tileType){case"form-groups-tile":null===(i=null===(o=null==e?void 0:e.tile)||void 0===o?void 0:o.formGroups)||void 0===i||i.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(!a)return;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 i=a[null===(o=null==e?void 0:e.control)||void 0===o?void 0:o.dataKey];if(!i||i.readOnly||i.hidden)return;l.push(J(void 0,void 0,void 0,(function*(){var n,o;const r=yield ut({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==i?void 0:i.value},t);!k.isNullOrUndefined(r)&&r.count>0&&(a[null===(o=null==e?void 0:e.control)||void 0===o?void 0:o.dataKey].error=r)})))})))}));break;case"simple-form-tile":null===(s=null===(r=null==e?void 0:e.tile)||void 0===r?void 0:r.controls)||void 0===s||s.forEach((e=>J(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 i=a[null===(o=null==e?void 0:e.control)||void 0===o?void 0:o.dataKey];if(!i||i.readOnly||i.hidden)return;l.push(J(void 0,void 0,void 0,(function*(){var n,o;const r=yield ut({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==i?void 0:i.value},t);!k.isNullOrUndefined(r)&&r.count>0&&(a[null===(o=null==e?void 0:e.control)||void 0===o?void 0:o.dataKey].error=r)})))}))));break;default:return}})),yield Promise.all(l),o(a),ct(a,i)})),pt=()=>{const[e,t]=a(0),[n,i]=a({});return{updatingCount:e,updatingFlags:n,setUpdating:o((e=>{t((e=>e+1)),i((t=>Object.assign(Object.assign({},t),{[e]:!0})))}),[e,n]),unsetUpdating:o((e=>{t((e=>e-1)),i((t=>Object.assign(Object.assign({},t),{[e]:!1})))}),[e,n])}},ht=(e,t,n,i,r,l)=>{const d=ue(),[c,u]=a(t),[m,p]=a(null),[h,g]=a(null),[v,f]=a(null),[b,y]=a(null),[x,E]=a(!1),w=o((()=>new Promise((t=>{if(x)return void t(x);const n={};Ge(`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 i=!n.hasErrors&&!n.hasMandatoryErrors;i||!0===r||E(!0),t(i)}})}))),[x,e]);s((()=>{if(!n)return;J(void 0,void 0,void 0,(function*(){yield i(null,t,f,y,null!=l?l:()=>{},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]=a(!1),[k,T]=a(!1),F=o(((e,t)=>{const n=!0===t;C(!0===e),T(n)}),[]),[N,O]=a(null),S=o((e=>J(void 0,void 0,void 0,(function*(){var n,o;if(!t||!v||!N)return{hasErrors:!1,hasMandatoryErrors:!1};const{hasErrors:i,hasMandatoryErrors:r}=yield mt(t,v,null,O,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(i,r)),{hasErrors:i,hasMandatoryErrors:r}}))),[t,v,N,F]);He(`graphingForm.validateForm.${e}`,S);const{updatingCount:D,updatingFlags:I,setUpdating:P,unsetUpdating:V}=pt();return{context:d,settings:c,graphingTile:m,graphingControls:h,inputSchemas:v,dropdownValues:b,data:N,setData:O,updatingCount:D,updatingFlags:I,setUpdating:P,unsetUpdating:V,hasErrors:M,hasMandatoryErrors:k,handleSetHasErrors:F,canSubmit:w}};class gt{constructor(){}getErrorMessage(e,t,n){if(k.isNullOrUndefined(n))return n;if(!k.isNullOrUndefined(null==t?void 0:t.validationErrorMessages)&&!k.isNullOrUndefined(t.validationErrorMessages[n])&&k.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 k.isArray(null==e?void 0:e.enum)&&e.enum.length>0?`Value must be in this list: ${e.enum.filter((e=>!k.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"),k.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!k.isNullOrUndefined(t)}validateRequired(e,t){return this.validateMandatory(e,t)}validateMbRequired(e,t){return this.validateMandatory(e,t)}validateEnum(e,t){return!(k.isArray(e)&&0!==e.length&&!k.isNullOrUndefined(t))||e.includes(t)}}class vt extends gt{validateInputValue(e,t){return super.validateInputValue(e,t)}validateMandatory(e,t){return!!super.validateMandatory(e,t)&&!!t.formatted}}at("Address",vt);class ft extends gt{validateInputValue(e,t){const n=super.validateInputValue(e,t);if(n.length>0)return n;if(T.isValid(t)){const e=new Date(t),o=T.todayUtc();e.getTime()>o.getTime()&&n.push("as-at-future")}return n}validateMandatory(e,t){return!!super.validateMandatory(e,t)&&T.isValid(t)}}at("AsAtDate",ft);class bt extends gt{validateInputValue(e,t){const n=super.validateInputValue(e,t);return t=F.parse(t),F.isValid(e.min)&&!this.validateMin(e.min,t)&&n.push("min"),F.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 ${F.getCurrencyText(e.min,!1,e.decimalPlaces||2,"")}`;case"max":return`Data not saved. The value must be less than or equal to ${F.getCurrencyText(e.max,!1,e.decimalPlaces||2,"")}`;default:return super.getErrorMessage(e,t,n)}}validateMin(e,t){return!F.isValid(e)||!F.isValid(t)||t>=e}validateMax(e,t){return!F.isValid(e)||!F.isValid(t)||t<=e}}at("Number",bt);class yt extends bt{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 ${F.getCurrencyText(e.min,!1,e.decimalPlaces||2)}`;case"max":return`Data not saved. The value must be less than or equal to ${F.getCurrencyText(e.max,!1,e.decimalPlaces||2)}`;default:return super.getErrorMessage(e,t,n)}}}at("Currency",yt);class xt extends gt{getErrorMessage(e,t,n){var o,i,r,a;switch(n=super.getErrorMessage(e,t,n)){case"min":if(T.isValid(null===(o=this.validatorData)||void 0===o?void 0:o.min)){const e=T.parse(null===(i=this.validatorData)||void 0===i?void 0:i.min);return`Value cannot be before ${T.format(e,"DD/MM/yyyy")}`}break;case"max":if(T.isValid(null===(r=this.validatorData)||void 0===r?void 0:r.max)){const e=T.parse(null===(a=this.validatorData)||void 0===a?void 0:a.max);return`Value cannot be after ${T.format(e,"DD/MM/yyyy")}`}}return n}validateInputValue(e,t){var n,o,i,r;const a=super.validateInputValue(e,t);if(0===a.length&&T.isValid(t)){const e=T.parse(t);if(T.isValid(null===(n=this.validatorData)||void 0===n?void 0:n.min)){const t=T.parse(null===(o=this.validatorData)||void 0===o?void 0:o.min);(null==t?void 0:t.getTime())>(null==e?void 0:e.getTime())&&a.push("min")}if(T.isValid(null===(i=this.validatorData)||void 0===i?void 0:i.max)){const t=T.parse(null===(r=this.validatorData)||void 0===r?void 0:r.max);(null==t?void 0:t.getTime())<(null==e?void 0:e.getTime())&&a.push("max")}}return a}validateMandatory(e,t){return!!super.validateMandatory(e,t)&&T.isValid(t)}}at("Date",xt);class Et extends gt{validateInputValue(e,t){const n=super.validateInputValue(e,t);return!k.isNullOrUndefined(e.minLength)&&C.isValid(e.minLength)&&e.minLength>0&&!this.validateMinLength(e.minLength,t)&&n.push("minLength"),!k.isNullOrUndefined(e.maxLength)&&C.isValid(e.maxLength)&&e.maxLength>0&&!this.validateMaxLength(e.maxLength,t)&&n.push("maxLength"),!k.isNullOrUndefined(e.match)&&k.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!(!(!C.isValid(e)||e<=0||k.isNullOrUndefined(t))&&k.isString(t))||t.length>=e}validateMaxLength(e,t){return!(!(!C.isValid(e)||e<=0||k.isNullOrUndefined(t))&&k.isString(t))||t.length<=e}validateMatch(e,t){if(k.isNullOrUndefined(e)||!k.isString(e)||""===e.trim())return!0;if(k.isNullOrUndefined(t)||!k.isString(t)||""===t.trim())return!0;const n=e.match(/(\/?)(.+)\1([a-z]*)/i),o=n[2],i=n[3];return new RegExp(o,i).test(t)}validateMandatory(e,t){return!!super.validateMandatory(e,t)&&(k.isString(t)&&t.length>0&&""!==t.trim())}}at("String",Et);class wt extends Et{validateInputValue(e,t){return super.validateInputValue(e,t)}}at("Notes",wt);class Mt extends gt{validateInputValue(e,t){return super.validateInputValue(e,t)}}at("ObjectId",Mt);class Ct extends gt{validateInputValue(e,t){return super.validateInputValue(e,t)}}at("[ObjectId]",Ct);class kt extends gt{validateInputValue(e,t){return super.validateInputValue(e,t)}validateMandatory(e,t){var n,o,i;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===(i=null==t?void 0:t.owners)||void 0===i?void 0:i.length)>=1}return!1}}at("Ownership",kt);class Tt extends bt{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 ${F.getCurrencyText(e.min,!1,e.decimalPlaces||2,"")}%`;case"max":return`Data not saved. The value must be less than or equal to ${F.getCurrencyText(e.max,!1,e.decimalPlaces||2,"")}%`;default:return super.getErrorMessage(e,t,n)}}}at("Percentage",Tt);class Ft extends gt{validateInputValue(e,t){return super.validateInputValue(e,t)}}at("SelectBoolean",Ft);class Nt extends gt{validateInputValue(e,t){return super.validateInputValue(e,t)}validateMandatory(e,t){return!!super.validateMandatory(e,t)&&(k.isString(t)&&t.length>0&&""!==t.trim()&&null!==C.parse(t))}}at("SelectNumber",Nt);class Ot extends gt{validateInputValue(e,t){return super.validateInputValue(e,t)}validateMandatory(e,t){return!k.isNullOrUndefined(t)&&""!==t.trim()&&this.validateEnum(e.enum,t)}}at("Select",Ot);const St=(e,t,n)=>{Te(e,t),Ke(e,n)},Dt=()=>{const e=Pt.pop();e&&(e.classList.add("moorr-modal-container-closing"),setTimeout((()=>{e&&($.unmountComponentAtNode(e),e.remove())}),300))};let It=class{constructor(e){this._props=e}open(){const t=this._props;return new Promise(((n,o)=>{let i,r;"function"==typeof t.onClose&&(i=t.onClose),t.onClose=e=>{i&&i(e),n({dismissed:!1,result:e}),t.showModal=!1,Dt()},"function"==typeof t.onDismiss&&(r=t.onClose),t.onDismiss=()=>{r&&r(),n({dismissed:!0}),t.showModal=!1,Dt()},t.showModal=!0;let a=e.createElement(de,{stylePrefix:"MoorrReactMuiModal"},e.createElement(this.getComponent(),t));Pt.push(this._container=document.createElement("div")),this._container.className="moorr-modal-container",document.body.appendChild(this._container),$.render(a,this._container)}))}};const Pt=[],Vt={},At=e=>"number"==typeof e?e+"px":e,Lt=t=>{var n,o,i,r,l,d,c,u;const m={};t.fixedWidth&&(m.width=t.fixedWidth),t.fixedHeight&&(m.height=t.fixedHeight),(null===(n=t.margins)||void 0===n?void 0:n.left)&&(m.marginLeft=At(null===(o=t.margins)||void 0===o?void 0:o.left)),(null===(i=t.margins)||void 0===i?void 0:i.right)&&(m.marginRight=At(null===(r=t.margins)||void 0===r?void 0:r.right)),(null===(l=t.margins)||void 0===l?void 0:l.top)&&(m.marginTop=At(null===(d=t.margins)||void 0===d?void 0:d.top)),(null===(c=t.margins)||void 0===c?void 0:c.bottom)&&(m.marginBottom=At(null===(u=t.margins)||void 0===u?void 0:u.bottom));let p="moorr-modal-content-container";t.contentClassName&&(p+=" "+t.contentClassName);const[g,v]=a(!1),[E,w]=a(!1);s((()=>{w(!g&&!1!==t.showModal)}),[g,E,t.showModal]);const M=(e,n)=>{v(!0),(null==t?void 0:t.onDismiss)&&t.onDismiss(n)};let C="moorr-modal-container";switch(t.effect){case"fade":C+=" moorr-fade-modal";break;case"slide":C+=" moorr-slide-modal"}return g&&(C+=" moorr-modal-closing"),e.createElement(f,{disableEnforceFocus:!0,className:C,open:E,onClose:M,closeAfterTransition:!0,sx:{display:"flex",alignItems:"center",justifyContent:"center",zIndex:1},slots:{backdrop:b},slotProps:{backdrop:{timeout:300,onClick:e=>{e.preventDefault(),e.stopPropagation(),k.isFunction(t.onBackdropClick)?t.onBackdropClick(e):M(0,"backdrop")}}}},(()=>{switch(t.effect){case"fade":default:return e.createElement(y,{in:E},e.createElement(h,{className:p,sx:e=>({width:825,backgroundColor:e.palette.background.paper,borderRadius:"5px",boxShadow:e.shadows[5],padding:e.spacing(2,4,3),transition:e.transitions.create(["width","height","margin"],{duration:300,easing:e.transitions.easing.easeOut}),transitionProperty:"width, height, margin"}),style:m},t.children));case"slide":return e.createElement(x,{in:E,direction:"left",timeout:300},e.createElement("div",{className:p},t.children))}})())},Rt=(t,n)=>{switch(t){default:case"info":case"warning":case"error":(t=>{H(t,{icon:e.createElement(G,{sx:{color:"#EB5757"}}),style:{color:"#EB5757",backgroundColor:"#FCECEC",border:"2px solid #EB5757",fontFamily:'"Poppins", sans-serif',borderRadius:"0.7em",marginLeft:"-100px"},closeButton:()=>e.createElement(W,{sx:{color:"#EB5757"}})})})(n);break;case"success":(t=>{H(t,{icon:e.createElement(q,{sx:{color:"#1B5E20"}}),style:{color:"#1B5E20",backgroundColor:"#E8F5E9",border:"2px solid #1B5E20",fontFamily:'"Poppins", sans-serif',borderRadius:"0.7em",marginLeft:"-100px"},closeButton:()=>e.createElement(W,{sx:{color:"#1B5E20"}})})})(n)}},Ut=t=>e.createElement(Lt,{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)))),jt=t=>{const{className:n,onDismiss:i,showModal:r,onClose:a,icon:l,title:s,body:d,closeLabel:c}=t,u=o((()=>{a(!1)}),[a]);o((()=>{a(!0)}),[a]);const p=o((()=>k.isString(d)?e.createElement(m,{paragraph:!0},d):k.isArray(d)&&d.length>0?d.map(((t,n)=>{const o=`paragraph-${n}`;if(k.isString(t)||!k.isNullOrUndefined(t))return e.createElement(m,{paragraph:!0,key:o},t)})):k.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((()=>k.isString(s)||!k.isNullOrUndefined(s)?s:"Alert"),[s]),f=o((()=>e.createElement(h,{sx:{position:"relative",marginBottom:"0.5rem","& > .MuiSvgIcon-root":{color:"#541868",fontSize:"2rem"}}},null!=l?l:e.createElement(E,null),e.createElement(m,{variant:"h6",sx:{color:"#541868",fontFamily:"Poppins,sans-serif",fontSize:"16px !important",fontWeight:400,lineHeight:22}},v()),e.createElement(w,{onClick:u,sx:{position:"absolute",top:"-0.5rem",right:"-0.5rem"},"data-testid":"dismiss"},e.createElement(W,{sx:{fontSize:"1rem"}})))),[l,v,u]),b=o((()=>{const t=c||"Dismiss";return e.createElement(Q,{handleClick:u,label:t,"data-testid":`${N.toKebabCase(t)}`})}),[c,u]);return e.createElement(Ut,{className:"alert-modal"+(n?" "+n:""),widthValue:"400px",showModal:!0===r,onDismiss:i,onBackdropClick:u,renderHeader:f(),renderBody:g(),renderStatusMessage:b()})};class Bt extends It{constructor(e){super(e)}getComponent(){return jt}}Vt.alert=Bt;const zt=t=>{const{className:n,onDismiss:i,showModal:r,onClose:a,icon:l,title:s,body:d,cancelLabel:c,confirmLabel:u}=t,p=o((()=>{a(!1)}),[a]),g=o((()=>{a(!0)}),[a]),v=o((()=>k.isString(d)?e.createElement(m,{paragraph:!0},d):k.isArray(d)&&d.length>0?d.map(((t,n)=>{const o=`paragraph-${n}`;if(k.isString(t)||!k.isNullOrUndefined(t))return e.createElement(m,{paragraph:!0,key:o},t)})):k.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]),b=o((()=>k.isString(s)||!k.isNullOrUndefined(s)?s:"Confirm"),[s]),y=o((()=>e.createElement(h,{sx:{position:"relative",marginBottom:"0.5rem","& > .MuiSvgIcon-root":{color:"#541868",fontSize:"2rem"}}},null!=l?l:e.createElement(E,null),e.createElement(m,{variant:"h6",sx:{color:"#541868",fontFamily:"Poppins,sans-serif",fontSize:"16px !important",fontWeight:400,lineHeight:22}},b()),e.createElement(w,{onClick:p,sx:{position:"absolute",top:"-0.5rem",right:"-0.5rem"}},e.createElement(W,{sx:{fontSize:"1rem"},"data-testid":"dismiss"})))),[l,b,p]),x=o((()=>{const t=c||"Cancel";return e.createElement(te,{handleClick:p,label:t,"data-testid":`${N.toKebabCase(t)}`})}),[c,p]),M=o((()=>{const t=u||"Dismiss";return e.createElement(Q,{handleClick:g,label:t,"data-testid":`${N.toKebabCase(t)}`})}),[u,g]);return e.createElement(Ut,{className:"confirm-modal"+(n?" "+n:""),widthValue:"400px",showModal:!0===r,onDismiss:i,onBackdropClick:p,renderHeader:y(),renderBody:f(),renderLeftButtons:x(),renderRightButtons:M()})};class $t extends It{constructor(e){super(e)}getComponent(){return zt}}Vt.confirm=$t;const Ht=t=>{const{className:n,header:o,body:i,leftButtonLabel:r,rightButtonLabel:a,hiddenClose:l,width:s}=t,d=e=>{e.stopPropagation(),t.onDismiss()};return e.createElement(Ut,{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"}},i),e.createElement(h,{className:"opti-info-modal-buttons",sx:{textAlign:"right",marginTop:"1rem"}},r&&e.createElement(M,{className:"opti-info-modal-button-left",style:{marginRight:"5px"},variant:"contained",color:"primary",onClick:()=>{},"data-testid":`${N.toKebabCase(r)}`},r),!l&&e.createElement(Q,{label:"Close",handleClick:d,"data-testid":"close"}))))})};class Gt extends It{constructor(e){super(e)}getComponent(){return Ht}}Vt.optiInfo=Gt;const Wt=e=>{var t,n,o,i,r;const a=null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.modal;if(!a||!Vt[a])return Promise.reject("invalid-modal");const l=new Vt[a]((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)&&l.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===(i=null==e?void 0:e.detail)||void 0===i?void 0:i.catch)&&l.catch(null===(r=null==e?void 0:e.detail)||void 0===r?void 0:r.catch),l.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=l)};document&&(document.removeEventListener("openModal",Wt),document.addEventListener("openModal",Wt));const qt=(e,t)=>{const[n,i]=a(null),r=l(null),d=o((e=>{if(!e)return;const n=Object.assign({},e.contentRect.toJSON());C.isValid(t)&&t>0?(clearTimeout(r.current),r.current=setTimeout((()=>{i(n)}),t)):i(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},Kt=i({}),_t=()=>r(Kt),Yt=()=>({context:_t()}),Xt=(e,t,n)=>{var i,r;const{context:l}=Yt();s((()=>{var e,t;k.mutexRelease(null!==(t=null===(e=null==l?void 0:l.sectionContext)||void 0===e?void 0:e.updateSessionId)&&void 0!==t?t:"default")}),[null===(i=null==l?void 0:l.sectionContext)||void 0===i?void 0:i.updateSessionId]);const[d,c]=a(0),u=o((()=>{c((e=>e+1))}),[]),[m,p]=a(!1),[h,g]=a(!1),v=o(((e,t)=>{const n=!0===t;p(!0===e),g(n)}),[]),f=o((n=>J(void 0,void 0,void 0,(function*(){if(k.isFunction(t)){const[e]=yield Promise.all([t(n)]);if(!e)return}return l.onMoveBack&&l.onMoveBack({section:e,data:n})}))),[h,t,l.onMoveBack]),[b,y]=a(!1),[x,E]=a(!1),[w,M]=a(null);s((()=>{x&&l.onMoveNext&&l.onMoveNext({section:e,data:w})}),[x,w]);const C=o((e=>J(void 0,void 0,void 0,(function*(){var t,o;try{y(!0),yield k.delay(350),yield k.mutex(null!==(o=null===(t=null==l?void 0:l.sectionContext)||void 0===t?void 0:t.updateSessionId)&&void 0!==o?o:"default",(()=>J(void 0,void 0,void 0,(function*(){if(yield k.delay(350),k.isFunction(n)){const[t]=yield Promise.all([n(e)]);if(!t)return}else if(m||h)return;E(!0),M(e)}))))}finally{y(!1)}}))),[null===(r=null==l?void 0:l.sectionContext)||void 0===r?void 0:r.updateSessionId,m,h,n]),{updatingCount:T,updatingFlags:F,setUpdating:N,unsetUpdating:O}=pt();return{context:l.sectionContext,sectionStep:d,nextSectionStep:u,hasErrors:m,hasMandatoryErrors:h,handleSetHasErrors:v,moveBack:f,moveNext:C,awaitingMoveNext:b,updatingCount:T,updatingFlags:F,setUpdating:N,unsetUpdating:O}},Zt=(e,t,n)=>{const[i,r]=a(t),[l,d]=a(null),[c,u]=a(null),[m,p]=a(null),[h,g]=a(!1),v=o((()=>new Promise((t=>{if(h)return void t(h);const n={};Ge(`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 i=!n.hasErrors&&!n.hasMandatoryErrors;i||g(!0),t(i)}})}))),[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:O}=Xt(e,void 0,v);s((()=>{if(!(null==f?void 0:f.validationSchemas))return;J(void 0,void 0,void 0,(function*(){yield n(null,t,p,(()=>{}),(()=>{}),f.validationSchemas),r(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[S,D]=a(null),I=o((e=>J(void 0,void 0,void 0,(function*(){var n,o;if(!t||!m||!S)return{hasErrors:!1,hasMandatoryErrors:!1};const{hasErrors:i,hasMandatoryErrors:r}=yield mt(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(i,r)),{hasErrors:i,hasMandatoryErrors:r}}))),[t,m,S,T]);return He(`wizardSection.validateForm.${e}`,I),{context:f,sectionStep:b,nextSectionStep:y,settings:i,graphingTile:l,graphingControls:c,inputSchemas:m,data:S,setData:D,updatingCount:x,updatingFlags:E,setUpdating:w,unsetUpdating:M,hasErrors:C,hasMandatoryErrors:k,handleSetHasErrors:T,moveBack:F,moveNext:N,awaitingMoveNext:O}},Jt=e=>{const[t,n]=a(e),[o,i]=a(null),[r,l]=a(null);return s((()=>{n(e);const t=e.tiles[0];i(t);const o={};t.tile.controls.forEach((e=>{o[e.control.dataKey]=e})),l(o)}),[e]),{settings:t,graphingTile:o,graphingControls:r}},Qt=t(((t,n)=>{var{stepIndex:o,sectionStep:i,onNextSectionStep:r,onStepIncrease:a,enterTimeout:l,onEntered:s,children:d}=t,c=Z(t,["stepIndex","sectionStep","onNextSectionStep","onStepIncrease","enterTimeout","onEntered","children"]);return e.createElement(_,{in:i>=o,timeout:{enter:null!=l?l:600},mountOnEnter:!0,onEntered:()=>{r&&r(),s&&s()}},e.createElement(K,Object.assign({},c,{ref:n}),d))})),en=t(((t,i)=>{var r,a,{section:l,children:d,animate:c,animateIn:m,animateOut:p,animateEasing:h,animateDuration:g,maxWidth:v,sx:f}=t,b=Z(t,["section","children","animate","animateIn","animateOut","animateEasing","animateDuration","maxWidth","sx"]);const y=u("(max-width: 700px)"),x=_t();s((()=>{x.setSectionMaxWidth(null!=v?v:0)}),[v]);const E=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&&C.isValid(v)&&v>0&&!k.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===(r=x.containerRect)||void 0===r?void 0:r.width]),w=n((()=>{var e;let t=Object.assign(Object.assign({},f),{width:"100%"});return C.isValid(v)&&v>0&&!k.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===(a=x.containerRect)||void 0===a?void 0:a.width]),M=o((()=>e.createElement(K,Object.assign({},b,{ref:i,className:`wizard-section wizard-section-${l}`,sx:E}),e.createElement(K,{sx:w},d))),[l,E,w,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"),[]),O=o((()=>e.createElement(_,{easing:N,timeout:F,in:x.section===l,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)}},M())),[N,F,x.section,l,M]),S=n((()=>{switch(T){case"scroll-up":return"back"!==x.moveDirection?x.section===l?"up":"down":x.section===l?"down":"up";case"scroll-down":return"back"!==x.moveDirection?x.section===l?"down":"up":x.section===l?"up":"down";case"scroll-left":return"back"!==x.moveDirection?x.section===l?"left":"right":x.section===l?"right":"left";case"scroll-right":return"back"!==x.moveDirection?x.section===l?"right":"left":x.section===l?"left":"right"}}),[x.section,x.moveDirection,l,T]),D=o((()=>e.createElement(Y,{container:x.containerRef.current,direction:S,easing:N,timeout:F,in:x.section===l,mountOnEnter:!0,unmountOnExit:!0,onEnter:e=>{var t,n,o,i;switch(S){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===(i=x.containerRect)||void 0===i?void 0:i.height}px)`}},onEntering:e=>{switch(S){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)}},M())),[N,F,x.section,l,S,x.containerRect,M]),I=o((()=>{switch(T){case"fade":return O();case"scroll-up":case"scroll-down":case"scroll-left":case"scroll-right":return D()}return x.section!==l?null:M()}),[x.section,l,T,O,D,M]);return e.createElement(e.Fragment,null,I())})),tn=t((({children:t,initialSection:i,animate:r,avatar:c,isAvatarVisible:u,sx:m,onMoveBack:p,onMoveNext:h,onSectionChange:g,sectionContext:v},f)=>{const b=l(null),y=qt(b),[x,E]=a(i);s((()=>{i&&g&&g(i)}),[i]);const[w,M]=a(null),[T,F]=a(),N=l(null),O=qt(N),S=o(((e,t)=>{e!==x&&(E(e),M(null!=t?t:null),g&&g(e))}),[x,g]),D=n((()=>({containerRef:b,containerRect:y,section:x,moveDirection:w,onMoveBack:p,onMoveNext:h,changeSection:S,setSectionMaxWidth:F,animate:r,sectionContext:v})),[y,x,w,p,h,S,r,v]);d(f,(()=>({section:x,context:D})),[x,D]);const I=n((()=>{if(k.isNullOrUndefined(y))return null;if(k.isNullOrUndefined(c)||k.isNullOrUndefined(O))return null;let e={display:"inline-block",position:"absolute"};return e=k.isFunction(u)&&!u(x)?Object.assign(Object.assign({},e),{opacity:0}):Object.assign(Object.assign({},e),{opacity:1}),C.isValid(T)&&T>0&&(e=Object.assign(Object.assign({},e),{left:Math.floor((y.width-T)/2)-O.width})),e}),[y,c,u,O,T]),P=o((()=>k.isNullOrUndefined(T)||0===T||k.isNullOrUndefined(I)?null:c),[T,c,I]);return e.createElement(K,{ref:b,sx:Object.assign({position:"relative"},m)},e.createElement(Kt.Provider,{value:D},e.createElement(K,{ref:N,sx:I},P()),t))}));export{vt as AddressValidator,Bt as AlertModal,ft as AsAtDateValidator,X as Button,$t as ConfirmModal,yt as CurrencyValidator,xt as DateValidator,oe as Dropdown,Ut as FadeModal,Ie as FormGroupAddActionModel,Pe as FormGroupModel,Je as FormGroupsTile,Re as FormGroupsTileModel,Se as FormInputModel,ce as GraphingContext,_e as GraphingControl,Oe as GraphingControlModel,De as GraphingControlSettingsModel,We as GraphingGrid,Xe as GraphingPage,Ce as GraphingSettingsModel,he as GraphingTile,Ye as GraphingTileControls,Ve as GraphingTileModel,Me as GraphingTileSettingsModel,be as GraphingTiles,Qe as HorizontalTile,Ue as HorizontalTileModel,It as Modal,Lt as MoorrModal,Le as MultipleControlsTileModel,wt as NotesValidator,bt as NumberValidator,Mt as ObjectIdValidator,Ct as ObjectIdsValidator,Gt as OptiInfoModal,kt as OwnershipValidator,Tt as PercentageValidator,Q as PrimaryButton,ee as QtyButton,te as SecondaryButton,Ft as SelectBooleanValidator,ne as SelectButton,Nt as SelectNumberValidator,Ot as SelectValidator,et as SelectableStatesTile,je as SelectableStatesTileModel,tt as SimpleFormTile,Be as SimpleFormTileModel,Ae as SingleControlTileModel,nt as SingleTile,ze as SingleTileModel,Et as StringValidator,de as StylesProvider,ae as SvgIcon,gt as Validator,ot as VerticalTile,$e as VerticalTileModel,tn as Wizard,en as WizardSection,Qt as WizardSectionStep,ct as checkDataForErrors,Fe as createGraphingControl,Ne as createGraphingControls,Ee as createGraphingTile,we as createGraphingTiles,lt as createValidator,st as createValidators,Ge as dispatchRootEvent,dt as hasInputError,Vt as modals,Pt as modalsStack,Te as registerGraphingControl,Ke as registerGraphingControlComponent,St as registerGraphingFrameworkComponent,xe as registerGraphingTile,pe as registerGraphingTileComponent,re as registerSvgIconComponent,at as registerValidator,Rt as toastMessage,ue as useGraphingContext,ht as useGraphingForm,it as useGraphingFramework,qt as useResizeObserver,He as useRootEventListener,pt as useUpdateTracker,Yt as useWizard,_t as useWizardContext,Jt as useWizardForm,Zt as useWizardFormSection,Xt as useWizardSection,mt as validateData,ut as validateInput};
|
|
1
|
+
import e,{forwardRef as t,useMemo as n,useCallback as o,createContext as i,useContext as r,useState as a,useRef as l,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,Modal as f,Backdrop as b,Fade as y,Slide as x,Icon as E,IconButton as w,Button as M}from"@mui/material";import{integers as C,utils as k,dates as T,decimals as F,strings as N}from"moorr-common";import O from"@mui/material/IconButton";import S from"@mui/material/MenuItem";import D from"@mui/material/TextField";import I from"@mui/material/Divider";import P from"@emotion/cache";import{CacheProvider as V}from"@emotion/react";import{StyledEngineProvider as A}from"@mui/material/styles";import L,{Responsive as R}from"react-grid-layout";import U from"@mui/material/Accordion";import j from"@mui/material/AccordionSummary";import B from"@mui/material/AccordionDetails";import $ from"@mui/icons-material/ExpandMore";import z from"react-dom";import{toast as H}from"react-toastify";import G from"@mui/icons-material/Cancel";import W from"@mui/icons-material/Close";import q from"@mui/icons-material/CheckCircle";import K from"@mui/material/Box";import _ from"@mui/material/Fade";import Y from"@mui/material/Slide";const X=({type:t,label:n})=>(t||(t="button"),e.createElement("button",{type:t,className:"moorr-button"},e.createElement("span",null,n)));function Z(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 i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(n[o[i]]=e[o[i]])}return n}function J(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{s(o.next(e))}catch(e){r(e)}}function l(e){try{s(o.throw(e))}catch(e){r(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}s((o=o.apply(e,t||[])).next())}))}const Q=t(((t,o)=>{var{style:i={},handleClick:r,label:a,disabled:l}=t,s=Z(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:l,disableElevation:!0,disableRipple:!0,disableFocusRipple:!0,disableTouchRipple:!0,style:Object.assign(Object.assign(Object.assign({},!l&&{backgroundColor:"#541868"}),{color:"#FFFFFF",fontWeight:400,fontSize:"14px",width:m,height:"39px",borderRadius:"48px",textTransform:"capitalize"}),i),onClick:r,variant:"contained"}),a)})),ee=t(((t,i)=>{var{sx:r,item:a,label:l,qty:s,disabled:d,highlight:u,onSelectItem:p}=t,h=Z(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({},r),{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,r]),f=o((e=>J(void 0,void 0,void 0,(function*(){e.stopPropagation(),e.preventDefault(),k.isFunction(p)&&s<=0&&(yield Promise.all([p(a,1)]))}))),[s,p]),b=o((()=>!C.isValid(s)||s<=0?null:e.createElement(O,{disabled:d,sx:Object.assign(Object.assign({},g),{backgroundColor:"#E37D7D",opacity:0,"&:hover":{backgroundColor:"#E37D7D"},"&:active":{backgroundColor:"#E37D7D"}}),onClick:()=>p&&p(a,Math.max(0,s-1))},"-")),[d,g,s,p]),y=o((()=>!C.isValid(s)||s<=0?null:e.createElement(O,{disabled:d,sx:Object.assign(Object.assign({},g),{backgroundColor:"#541868",opacity:0,"&:hover":{backgroundColor:"#541868"},"&:active":{backgroundColor:"#541868"}}),onClick:()=>p&&p(a,s+1)},"+")),[d,g,s,p]),x=o((()=>{let t,n;return!C.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:i,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!=l?l:a),y(),x())})),te=t(((t,o)=>{var{style:i={},handleClick:r,label:a,disabled:l}=t,s=Z(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:l,disableElevation:!0,disableRipple:!0,disableFocusRipple:!0,disableTouchRipple:!0,style:Object.assign(Object.assign(Object.assign({},!l&&{backgroundColor:"#D4C5D9"}),{color:"#541868",fontWeight:400,fontSize:"14px",width:m,height:"39px",borderRadius:"48px",textTransform:"capitalize"}),i),onClick:r,variant:"contained"}),a)})),ne=t(((t,i)=>{var{sx:r,item:a,label:l,itemSelected:s,onSelectItem:d}=t,u=Z(t,["sx","item","label","itemSelected","onSelectItem"]);const p=n((()=>{const e=Object.assign(Object.assign({},r),{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,r]),h=o((e=>J(void 0,void 0,void 0,(function*(){e.stopPropagation(),e.preventDefault(),k.isFunction(d)&&(yield Promise.all([d(a)]))}))),[d]);return e.createElement(c,Object.assign({},u,{ref:i,disableElevation:!0,disableRipple:!0,disableFocusRipple:!0,disableTouchRipple:!0,sx:p,onClick:h}),e.createElement(m,{variant:"body1",component:"span",sx:{flexGrow:1}},null!=l?l:a))})),oe=({handleChange:t,onItemClick:n,value:o,disabled:i=!1,name:r,className:a,classes:l,size:s,menuItemLabel:d,options:c,label:u,required:m=!1,isMBRequiredField:p,fullWidth:h,selectIconComponent:g})=>{let v;g&&(v={IconComponent:g});const f=!o||0===(null==o?void 0:o.length),b=p&&f?{borderColor:"blue !important",borderWidth:"2px !important"}:m&&f?{border:"red 2px solid !important",borderRadius:"4px"}:{},y=l?{classes:{root:l.root,focused:l.focused,error:l.error,notchedOutline:p&&f?l.notchedOutlineMBRequired:l.notchedOutline}}:void 0;return e.createElement(D,{fullWidth:!1!==h,id:"outlined-basic",variant:"outlined",value:o,onChange:t,disabled:i,name:r,className:[a].join(" "),color:"primary",size:s||"small",select:!0,SelectProps:v,defaultValue:"",InputProps:y,sx:{overflow:"hidden",display:"flex",alignItems:"center","&.start":{flexDirection:"row"},"&.top":{flexDirection:"column"},"& .Mui-disabled":{backgroundColor:"var(--grey-color-3)",cursor:"not-allowed",borderRadius:"4px"},"& .MuiSelect-select":{color:"var(--grey-color-2)"},"& .MuiOutlinedInput-notchedOutline":b}},e.createElement(S,{value:"",disabled:!0},e.createElement("em",null,d)),c&&c.map(((t,o)=>"-separator-"===t?e.createElement(I,{key:`divider-${o}`}):e.createElement(S,{key:`menu-item-${o}-${t.value||t}`,value:t.value||t,onClick:()=>n&&n(t)},t.label||t))))},ie={};function re(e,t){e&&t&&(ie[e]=t)}const ae=({className:t,icon:n,width:o,height:i,fill:r,stroke:a,accent:l,dropShadow:s})=>{if(k.isNullOrUndefined(n))return null;const d=ie[n]||null;return d?e.createElement(d,{className:t,fill:r,width:o,height:i,stroke:a,accent:l,dropShadow:s}):null},le={},se=()=>{var e;if("undefined"!=typeof document)return null!==(e=document.querySelector('meta[name="emotion-insertion-point"]'))&&void 0!==e?e:void 0};var de=({stylePrefix:t,children:n})=>{const o=t?t.toLowerCase().replace(/[^a-z0-9]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""):`moorr-sp-${Math.random().toString(36).slice(2,8)}`;return le[o]||(le[o]=P({key:o,insertionPoint:se()})),e.createElement(A,{injectFirst:!0},e.createElement(V,{value:le[o]},n))};const ce=i({});function ue(){return r(ce)}const me={};function pe(e,t){e&&t&&(me[e]=t)}const he=({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 i=me[t.tile.tileType]||null;return i?e.createElement(i,{graphingTile:t,graphingTileIndex:n}):null},ge=[20,20],ve={lg:600,sm:0},fe={lg:8,sm:2},be=({tilePrefix:t,responsive:n,columns:o,containerPadding:i,referenceMargin:r,referenceWidth:d,graphingTiles:c})=>{const u=ue(),[m,p]=a(null),[h,g]=a(null),[v,f]=a(null),[b,y]=a(null),x=l(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 w;const M=e=>{E(),clearTimeout(w),w=setTimeout((()=>{E()}),300)};s((()=>{E()}),[x]),s((()=>(window.addEventListener("resize",M),()=>{window.removeEventListener("resize",M)})),[]),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 C=()=>null==c?void 0:c.map(((n,o)=>{if(!n.tile||!n.visible)return null;if(k.isFunction(u.isTileVisible)&&n.tile.id&&!u.isTileVisible(n.tile.id))return null;let i="graphing-tile-container";n.tile.id&&(i+=` ${n.tile.id}`),!1!==n.border&&(i+=" bordered"),n.autoHeight&&(i+=" auto-height");const r=`${t?t+"_":""}tile_${o}`;return e.createElement("div",{className:i,key:r},e.createElement(he,{graphingTile:n,graphingTileIndex:o}))})),T=e=>{if(!r||isNaN(r)||r<=0||!d||isNaN(d)||d<=0||null==e)return ge;const t=e/d*r;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=[i||0,0];return e.createElement(R,{width:b,breakpoints:ve,cols:o||fe,rowHeight:1,layouts:v,containerPadding:t,margin:m,isDraggable:!1},C())}return h?e.createElement(L,{width:b,cols:9,rowHeight:50,margin:m,isDraggable:!1,layout:h},C()):null})())},ye={};function xe(e,t){ye[e]=t}function Ee(e){const t=ye[null==e?void 0:e.tileType];return t?new t(e):null}function we(e){const t=[];return e.forEach((e=>{const n=Ee(e);n&&t.push(n)})),t}class Me{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=Ee(e.tile),this.visible=!1!==e.visible}getBackground(){return this.background||"#FFFFFF"}}class Ce{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 Me(e))}))}}const ke={};function Te(e,t){ke[e]=t}function Fe(e){const t=ke[null==e?void 0:e.controlType];return t?new t(e):null}function Ne(e){const t=[];return e.forEach((e=>{const n=Fe(e);n&&t.push(n)})),t}class Oe{constructor(e){this.controlType=e.controlType,this.dataKey=e.dataKey}}class Se extends Oe{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=(k.isArray(e.validationSchemaPath)?e.validationSchemaPath:[]).filter((e=>k.isString(e))),this.validationErrorMessages=e.validationErrorMessages||{}}}class De{constructor(e){this.border=e.border,this.background=e.background||null,this.control=Fe(e.control)}getBackground(e){return this.background||(null==e?void 0:e.background)||"#FFFFFF"}}class Ie{constructor(e){this.label=e.label||"",this.value=e.value||"",this.icon=e.icon||"",this.accent=e.accent||""}}class Pe{constructor(e){this.id=e.id||"",this.title=e.title||"",this.controls=[],Array.isArray(e.controls)&&e.controls.forEach((e=>{this.controls.push(new De(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 Ie(e))}))}}class Ve{constructor(e){this.id=e.id,this.tileType=e.tileType}}class Ae extends Ve{constructor(e){super(e),this.control=new De(e.control)}}class Le extends Ve{constructor(e){super(e),this.controls=[],Array.isArray(e.controls)&&e.controls.forEach((e=>{this.controls.push(new De(e))}))}}class Re extends Ve{constructor(e){super(e),k.isArray(e.formGroups)&&e.formGroups.length>0?this.formGroups=e.formGroups.map((e=>new Pe(e))):this.formGroups=[]}}xe("form-groups-tile",Re);class Ue extends Le{constructor(e){super(e),this.controlsPerPage=e.controlsPerPage,(isNaN(this.controlsPerPage)||this.controlsPerPage<=1)&&(this.controlsPerPage=1)}}xe("horizontal-tile",Ue);class je extends Le{constructor(e){super(e),this.states={};for(const t in e.states){const n=e.states[t];n&&(this.states[t]=new Ce(n))}}}xe("selectable-states-tile",je);class Be extends Ve{constructor(e){super(e),this.controls=[],Array.isArray(e.controls)&&e.controls.forEach((e=>{this.controls.push(new De(e))}))}}xe("simple-form-tile",Be);class $e extends Ae{constructor(e){super(e)}}xe("single-tile",$e);class ze extends Le{constructor(e){super(e)}}xe("vertical-tile",ze);const He=(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])},Ge=(e,t)=>{const n=document.querySelector("#react-root");null==n||n.dispatchEvent(new CustomEvent(e,{detail:null!=t?t:{}}))},We=({})=>{const{settings:t,handleUIReady:n}=ue(),[i,r]=a(null),[l,d]=a([]),[c,u]=a(!1);s((()=>{setTimeout((()=>{window.dispatchEvent(new Event("resize")),setTimeout((()=>{u(!0),k.isFunction(n)&&n()}),300)}),300)}),[]);const m=o((e=>{var t,n,o,i,r,a,s,c,u,m,p;if(!(null==l?void 0:l.length)||!(null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.id))return;const h=l.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;k.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),k.isNullOrUndefined(null===(i=null==e?void 0:e.detail)||void 0===i?void 0:i.y)||(h.y=null===(r=null==e?void 0:e.detail)||void 0===r?void 0:r.y),k.isNullOrUndefined(null===(a=null==e?void 0:e.detail)||void 0===a?void 0:a.w)||(h.w=null===(s=null==e?void 0:e.detail)||void 0===s?void 0:s.w),k.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),k.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=l.map((e=>new Me(e)));d(g)}),[l]);He("graphingGrid.updateTile",m),s((()=>{var e;t?(r(new Ce(t)),d(null===(e=t.tiles)||void 0===e?void 0:e.map((e=>new Me(e))))):r(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(!i)return null;let h="graphing-grid-container";return c&&(h+=" in"),e.createElement(e.Fragment,null,e.createElement("div",{className:h},k.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(be,{graphingTiles:l,responsive:i.responsive,columns:i.columns,containerPadding:i.containerPadding,referenceMargin:i.referenceMargin,referenceWidth:i.referenceWidth})))},qe={};function Ke(e,t){e&&t&&(qe[e]=t)}const _e=({graphingTile:t,graphingTileIndex:n,graphingTileControl:o,ControlProps:i})=>{var r;if(!(null===(r=null==o?void 0:o.control)||void 0===r?void 0:r.controlType))return null;const a=qe[o.control.controlType]||null;return a?e.createElement(a,Object.assign({graphingTile:t,graphingTileIndex:n,graphingTileControl:o},i)):null},Ye=({graphingTile:t,graphingTileIndex:n,graphingTileControls:o,ControlProps:i})=>{var r,a;let l="graphing-tile-controls-container";return(null===(r=null==t?void 0:t.tile)||void 0===r?void 0:r.tileType)&&(l+=" "+(null===(a=null==t?void 0:t.tile)||void 0===a?void 0:a.tileType)),e.createElement("div",{className:l},null==o?void 0:o.map(((o,r)=>{var a,l;if(!o.control)return null;let s="graphing-tile-control-container";(null===(a=o.control)||void 0===a?void 0:a.controlType)&&(s+=" "+(null===(l=o.control)||void 0===l?void 0:l.controlType)),!1!==o.border&&(s+=" bordered");const d=`control_${n}_${r}`;return e.createElement("div",{className:s,key:d},e.createElement(_e,{graphingTile:t,graphingTileIndex:n,graphingTileControl:o,ControlProps:i}))})))},Xe=({className:t,context:n})=>e.createElement(ce.Provider,{value:n},e.createElement("div",{className:t},e.createElement(We,null))),Ze=({open:t,actions:n,disabled:o,onClick:i})=>e.createElement(p,{ariaLabel:"Add a New Card",direction:"down",open:t,className:t?"add-card-open":void 0,onClick:i,icon:e.createElement(h,{sx:{display:"flex"}},e.createElement(g,{open:t,icon:e.createElement(ae,{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),Je=({graphingTile:t,graphingTileIndex:i})=>{const r=null==t?void 0:t.tile;if(!r)return null;const d=ue();return e.createElement("div",{className:"form-groups-tile-component"},!k.isArray(r.formGroups)||r.formGroups.length<0?null:r.formGroups.map(((r,c)=>{const u=l(null),[m,p]=a("normal"),[g,f]=a("form-group-container");s((()=>{w()}),[g,m]);const[b,y]=a(0),[x,E]=a(!0);s((()=>{if(x){const e=u.current;k.isNullOrUndefined(e)?y(0):setTimeout((()=>{y(e.scrollHeight)}),10)}else y(0)}),[x]);const w=e=>{if(x){const e=u.current;k.isNullOrUndefined(e)?y(0):setTimeout((()=>{y(Math.max(e.clientHeight,e.scrollHeight))}),10)}else y(0)},M=o((e=>{""===e.value?(p("add"),E(!0)):(null==d?void 0:d.handleFormGroupAdd)&&k.isFunction(d.handleFormGroupAdd)&&d.handleFormGroupAdd(r,e)}),[r,null==d?void 0:d.handleFormGroupAdd]),C=n((()=>r.addActions&&r.addActions.length?r.addActions.map(((t,n)=>e.createElement(v,{key:n.toString(),icon:e.createElement(ae,{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:()=>M(t)}))):null),[r.addActions,M]),[T,F]=a(!1),N=o((e=>{e.stopPropagation(),F((e=>!e))}),[]),O=o((()=>!0!==r.add||k.isFunction(d.formGroupHasAddMode)&&!d.formGroupHasAddMode(r.id)?null:C?e.createElement(Ze,{disabled:"add"==m,open:T,actions:C,onClick:N}):e.createElement("button",{type:"button",className:"form-group-tile-add-button",onClick:D,disabled:"add"==m},e.createElement(ae,{icon:"add-icon",stroke:"#ffffff"}))),[m,d.formGroupHasAddMode,T,C,N]),S=o((()=>!0!==r.edit||k.isFunction(d.formGroupHasEditMode)&&!d.formGroupHasEditMode(r.id)?null:e.createElement("button",{type:"button",className:"form-group-tile-edit-button",onClick:I,disabled:"add"==m},e.createElement(ae,{icon:"edit-icon",fill:"#ffffff"}))),[m,d.formGroupHasEditMode]),D=e=>{e.stopPropagation(),p("add"),E(!0)},I=e=>{e.stopPropagation(),(null==d?void 0:d.handleEdit)&&(null==d||d.handleEdit(r))},P=e=>J(void 0,void 0,void 0,(function*(){k.isFunction(null==d?void 0:d.handleFormGroupCancel)&&(yield Promise.all([null==d?void 0:d.handleFormGroupCancel({formGroup:r})])),p("normal")})),[V,A]=a(!1),L=e=>J(void 0,void 0,void 0,(function*(){if(k.isFunction(null==d?void 0:d.handleFormGroupSave))try{A(!0);const[e]=yield Promise.all([null==d?void 0:d.handleFormGroupSave({formGroup:r})]);if(!1===e)return}finally{A(!1)}p("normal")}));let R="form-group-container";return k.isFunction(d.isFormGroupVisible)&&(d.isFormGroupVisible(r.id)||(R+=" hidden")),R!==g&&f(R),e.createElement(U,{key:`${r.id}-{${c}}`,className:R,expanded:x,onChange:e=>{"add"!==m&&E((e=>!e))},TransitionProps:{unmountOnExit:!0}},e.createElement(j,{className:"form-group-title",expandIcon:"add"!==m?e.createElement($,null):null},e.createElement("span",{className:"form-group-title-text"},r.title),O(),S()),e.createElement("hr",null),e.createElement(B,{className:"form-group-components"},(()=>{if("add"===m){let t;return k.isFunction(d.renderFormGroup)&&(t=d.renderFormGroup(r,"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:V,onClick:P},"Cancel"),e.createElement("button",{className:"save-button",disabled:V,onClick:L},"Create")))}{const n=r.controls;let o,a;if(k.isFunction(d.renderFormGroup)){if(o=d.renderFormGroup(r,"normal"),!k.isNullOrUndefined(o))return o;a=d.renderFormGroup(r,"footer")}return e.createElement(e.Fragment,null,e.createElement(Ye,{graphingTile:t,graphingTileIndex:i,graphingTileControls:n,ControlProps:{onUIChange:w}}),a)}})()),C&&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)}))})))};pe("form-groups-tile",Je);const Qe=({graphingTile:t,graphingTileIndex:n})=>{const o=null==t?void 0:t.tile;if(!o)return null;const[i,r]=a(null),[l,d]=a(0),[c,u]=a(0),[m,p]=a(null),[h,g]=a(null),[v,f]=a(null),[b,y]=a([]);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 i=n*o.controlsPerPage+e;if(i>=o.controls.length)break;t.controls.push(o.controls[i])}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=l-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!==i)return;const t=c;let n=c-1;n<0&&(n=l-1),p(t),u(n),g(null),f(t);const o=setTimeout((()=>{x(n),f(null),p(null),setTimeout((function(){r(null)}),300)}),300);r(o)},k=e=>{let t=e+1;t>=l&&(t=0),f(t)},T=e=>{e.stopPropagation(),g(null),k(c),p(null)},F=e=>{e.stopPropagation()},N=e=>{e.stopPropagation()},O=e=>{if(e.stopPropagation(),null!==i)return;const t=c;let n=c+1;n>=l&&(n=0),p(t),u(n),g(t),f(null);const o=setTimeout((()=>{g(null),k(n),p(null),setTimeout((function(){r(null)}),300)}),300);r(o)},S={background:t.getBackground()};return e.createElement("div",{className:"horizontal-tile-component",style:S},e.createElement("div",{className:"horizontal-tile-pages-container"},b.map(((o,i)=>{let r="horizontal-tile-page-container";return i===c?r+=" active":i===h?r+=" navigating-from-left":i===v&&(r+=" navigating-from-right"),i===m&&(r+=" previous"),e.createElement("div",{key:`horizontal-tile-page-${i}`,className:r},e.createElement(Ye,{graphingTile:t,graphingTileIndex:n,graphingTileControls:o.controls}))})),e.createElement("div",{className:"horizontal-tile-page-container background",style:S}),l<=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:O},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"}))))),l<=1?null:e.createElement("div",{className:"horizontal-tile-paginators-container"},Array.from(Array(l).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)}})}))))};pe("horizontal-tile",Qe);const et=({graphingTile:t})=>{const n=null==t?void 0:t.tile;if(!n)return null;const[o,i]=a(""),[r,l]=a(null),[d,c]=a([]),u=ue();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 i(""),l(null)}),[n.states]);const m=e=>{i(e),l(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==r?void 0:r.title)),e.createElement("div",{className:"selectable-states-dropdown-container"},e.createElement(oe,{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"},r?e.createElement(be,{tilePrefix:o,graphingTiles:r.tiles,responsive:r.responsive,columns:r.columns,containerPadding:r.containerPadding,referenceMargin:r.referenceMargin,referenceWidth:r.referenceWidth}):null))};pe("selectable-states-tile",et);const tt=({graphingTile:t,graphingTileIndex:n})=>{const o=null==t?void 0:t.tile;if(!o)return null;const i=ue(),r=e=>{k.isFunction(i.handleUIChange)&&i.handleUIChange(e)};return e.createElement("div",{className:"simple-form-tile-component"},(()=>{if(!k.isArray(o.controls)||o.controls.length<0)return null;const i=o.controls;return e.createElement(Ye,{graphingTile:t,graphingTileIndex:n,graphingTileControls:i,ControlProps:{onUIChange:r}})})())};pe("simple-form-tile",tt);const nt=({graphingTile:t,graphingTileIndex:n})=>{const o=null==t?void 0:t.tile;if(!o)return null;const i=[o.control],r={background:t.getBackground()};return e.createElement("div",{className:"single-tile-component",style:r},e.createElement(Ye,{graphingTile:t,graphingTileIndex:n,graphingTileControls:i}))};pe("single-tile",nt);const ot=({graphingTile:t,graphingTileIndex:n})=>{const o=null==t?void 0:t.tile;if(!o)return null;const i=o.controls;return e.createElement("div",{className:"vertical-tile-component"},e.createElement(Ye,{graphingTile:t,graphingTileIndex:n,graphingTileControls:i}))};function it(e,t){const n=ue(),o=null==e?void 0:e.control,[i,r]=a(null);return s((()=>{if(!(o&&(n.data&&n.data[o.dataKey]||t)))return;const e=null!=t?t:n.data[o.dataKey];r(e)}),[o,t,n.data]),{context:n,settings:o,data:i}}pe("vertical-tile",ot);const rt={};function at(e,t){rt[e]=t}function lt(e){const t=rt[e];return t?new t:null}function st(e){const t=[];return e.forEach((e=>{const n=lt(e);n&&t.push(n)})),t}const dt=(e,t,n)=>!(!k.isNullOrUndefined(n)&&""!==(null==n?void 0:n.trim())&&"normal"!==n&&"hover"!==n&&(k.isNullOrUndefined(t)||""===(null==t?void 0:t.trim())))&&(!k.isNullOrUndefined(t)&&""!==(null==t?void 0:t.trim())||!k.isNullOrUndefined(e)&&"warning"!==(null==e?void 0:e.error_0)),ct=(e,t)=>{let n=!1,o=!1;return Object.entries(e).forEach((([e,t])=>{const i=null==t?void 0:t.error;n=n||dt(i),o=o||!0===(null==i?void 0:i.mandatory)})),k.isFunction(t)&&t(n,o),{hasErrors:n,hasMandatoryErrors:o}},ut=(e,t)=>J(void 0,void 0,void 0,(function*(){var n;const o=(t||{})[e.key];if(!k.isArray(o))return;const i={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 r=lt(null!==(o=null==e?void 0:e.validatorType)&&void 0!==o?o:t.type);if(k.isNullOrUndefined(r))return;e.validatorData&&(r.validatorData=e.validatorData);const a=r.validate(t,e.value);i.mandatory=!0===t.mandatory||"AsAtDate"===e.validatorType,i.errors=a,k.isArray(a)&&a.length>0&&a.forEach(((n,o)=>{i[`error_${o}`]=r.getErrorMessage(t,e.control,n),i.count+=1}))})),i})),mt=(e,t,n,o,i)=>J(void 0,void 0,void 0,(function*(){var r;if(k.isNullOrUndefined(e)||k.isNullOrUndefined(t))return{hasErrors:!1,hasMandatoryErrors:!1};let a;if(k.isNullOrUndefined(n)?o((e=>(a=Object.assign({},e),e))):a=Object.assign({},n),!a)return{hasErrors:!1,hasMandatoryErrors:!1};const l=[];return null===(r=null==e?void 0:e.tiles)||void 0===r||r.forEach((e=>{var n,o,i,r,s;switch(null===(n=null==e?void 0:e.tile)||void 0===n?void 0:n.tileType){case"form-groups-tile":null===(i=null===(o=null==e?void 0:e.tile)||void 0===o?void 0:o.formGroups)||void 0===i||i.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(!a)return;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 i=a[null===(o=null==e?void 0:e.control)||void 0===o?void 0:o.dataKey];if(!i||i.readOnly||i.hidden)return;l.push(J(void 0,void 0,void 0,(function*(){var n,o;const r=yield ut({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==i?void 0:i.value},t);!k.isNullOrUndefined(r)&&r.count>0&&(a[null===(o=null==e?void 0:e.control)||void 0===o?void 0:o.dataKey].error=r)})))})))}));break;case"simple-form-tile":null===(s=null===(r=null==e?void 0:e.tile)||void 0===r?void 0:r.controls)||void 0===s||s.forEach((e=>J(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 i=a[null===(o=null==e?void 0:e.control)||void 0===o?void 0:o.dataKey];if(!i||i.readOnly||i.hidden)return;l.push(J(void 0,void 0,void 0,(function*(){var n,o;const r=yield ut({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==i?void 0:i.value},t);!k.isNullOrUndefined(r)&&r.count>0&&(a[null===(o=null==e?void 0:e.control)||void 0===o?void 0:o.dataKey].error=r)})))}))));break;default:return}})),yield Promise.all(l),o(a),ct(a,i)})),pt=()=>{const[e,t]=a(0),[n,i]=a({});return{updatingCount:e,updatingFlags:n,setUpdating:o((e=>{t((e=>e+1)),i((t=>Object.assign(Object.assign({},t),{[e]:!0})))}),[e,n]),unsetUpdating:o((e=>{t((e=>e-1)),i((t=>Object.assign(Object.assign({},t),{[e]:!1})))}),[e,n])}},ht=(e,t,n,i,r,l)=>{const d=ue(),[c,u]=a(t),[m,p]=a(null),[h,g]=a(null),[v,f]=a(null),[b,y]=a(null),[x,E]=a(!1),w=o((()=>new Promise((t=>{if(x)return void t(x);const n={};Ge(`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 i=!n.hasErrors&&!n.hasMandatoryErrors;i||!0===r||E(!0),t(i)}})}))),[x,e]);s((()=>{if(!n)return;J(void 0,void 0,void 0,(function*(){yield i(null,t,f,y,null!=l?l:()=>{},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]=a(!1),[k,T]=a(!1),F=o(((e,t)=>{const n=!0===t;C(!0===e),T(n)}),[]),[N,O]=a(null),S=o((e=>J(void 0,void 0,void 0,(function*(){var n,o;if(!t||!v||!N)return{hasErrors:!1,hasMandatoryErrors:!1};const{hasErrors:i,hasMandatoryErrors:r}=yield mt(t,v,null,O,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(i,r)),{hasErrors:i,hasMandatoryErrors:r}}))),[t,v,N,F]);He(`graphingForm.validateForm.${e}`,S);const{updatingCount:D,updatingFlags:I,setUpdating:P,unsetUpdating:V}=pt();return{context:d,settings:c,graphingTile:m,graphingControls:h,inputSchemas:v,dropdownValues:b,data:N,setData:O,updatingCount:D,updatingFlags:I,setUpdating:P,unsetUpdating:V,hasErrors:M,hasMandatoryErrors:k,handleSetHasErrors:F,canSubmit:w}};class gt{constructor(){}getErrorMessage(e,t,n){if(k.isNullOrUndefined(n))return n;if(!k.isNullOrUndefined(null==t?void 0:t.validationErrorMessages)&&!k.isNullOrUndefined(t.validationErrorMessages[n])&&k.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 k.isArray(null==e?void 0:e.enum)&&e.enum.length>0?`Value must be in this list: ${e.enum.filter((e=>!k.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"),k.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!k.isNullOrUndefined(t)}validateRequired(e,t){return this.validateMandatory(e,t)}validateMbRequired(e,t){return this.validateMandatory(e,t)}validateEnum(e,t){return!(k.isArray(e)&&0!==e.length&&!k.isNullOrUndefined(t))||e.includes(t)}}class vt extends gt{validateInputValue(e,t){return super.validateInputValue(e,t)}validateMandatory(e,t){return!!super.validateMandatory(e,t)&&!!t.formatted}}at("Address",vt);class ft extends gt{validateInputValue(e,t){const n=super.validateInputValue(e,t);if(n.length>0)return n;if(T.isValid(t)){const e=new Date(t),o=T.todayUtc();e.getTime()>o.getTime()&&n.push("as-at-future")}return n}validateMandatory(e,t){return!!super.validateMandatory(e,t)&&T.isValid(t)}}at("AsAtDate",ft);class bt extends gt{validateInputValue(e,t){const n=super.validateInputValue(e,t);return t=F.parse(t),F.isValid(e.min)&&!this.validateMin(e.min,t)&&n.push("min"),F.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 ${F.getCurrencyText(e.min,!1,e.decimalPlaces||2,"")}`;case"max":return`Data not saved. The value must be less than or equal to ${F.getCurrencyText(e.max,!1,e.decimalPlaces||2,"")}`;default:return super.getErrorMessage(e,t,n)}}validateMin(e,t){return!F.isValid(e)||!F.isValid(t)||t>=e}validateMax(e,t){return!F.isValid(e)||!F.isValid(t)||t<=e}}at("Number",bt);class yt extends bt{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 ${F.getCurrencyText(e.min,!1,e.decimalPlaces||2)}`;case"max":return`Data not saved. The value must be less than or equal to ${F.getCurrencyText(e.max,!1,e.decimalPlaces||2)}`;default:return super.getErrorMessage(e,t,n)}}}at("Currency",yt);class xt extends gt{getErrorMessage(e,t,n){var o,i,r,a;switch(n=super.getErrorMessage(e,t,n)){case"min":if(T.isValid(null===(o=this.validatorData)||void 0===o?void 0:o.min)){const e=T.parse(null===(i=this.validatorData)||void 0===i?void 0:i.min);return`Value cannot be before ${T.format(e,"DD/MM/yyyy")}`}break;case"max":if(T.isValid(null===(r=this.validatorData)||void 0===r?void 0:r.max)){const e=T.parse(null===(a=this.validatorData)||void 0===a?void 0:a.max);return`Value cannot be after ${T.format(e,"DD/MM/yyyy")}`}}return n}validateInputValue(e,t){var n,o,i,r;const a=super.validateInputValue(e,t);if(0===a.length&&T.isValid(t)){const e=T.parse(t);if(T.isValid(null===(n=this.validatorData)||void 0===n?void 0:n.min)){const t=T.parse(null===(o=this.validatorData)||void 0===o?void 0:o.min);(null==t?void 0:t.getTime())>(null==e?void 0:e.getTime())&&a.push("min")}if(T.isValid(null===(i=this.validatorData)||void 0===i?void 0:i.max)){const t=T.parse(null===(r=this.validatorData)||void 0===r?void 0:r.max);(null==t?void 0:t.getTime())<(null==e?void 0:e.getTime())&&a.push("max")}}return a}validateMandatory(e,t){return!!super.validateMandatory(e,t)&&T.isValid(t)}}at("Date",xt);class Et extends gt{validateInputValue(e,t){const n=super.validateInputValue(e,t);return!k.isNullOrUndefined(e.minLength)&&C.isValid(e.minLength)&&e.minLength>0&&!this.validateMinLength(e.minLength,t)&&n.push("minLength"),!k.isNullOrUndefined(e.maxLength)&&C.isValid(e.maxLength)&&e.maxLength>0&&!this.validateMaxLength(e.maxLength,t)&&n.push("maxLength"),!k.isNullOrUndefined(e.match)&&k.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!(!(!C.isValid(e)||e<=0||k.isNullOrUndefined(t))&&k.isString(t))||t.length>=e}validateMaxLength(e,t){return!(!(!C.isValid(e)||e<=0||k.isNullOrUndefined(t))&&k.isString(t))||t.length<=e}validateMatch(e,t){if(k.isNullOrUndefined(e)||!k.isString(e)||""===e.trim())return!0;if(k.isNullOrUndefined(t)||!k.isString(t)||""===t.trim())return!0;const n=e.match(/(\/?)(.+)\1([a-z]*)/i),o=n[2],i=n[3];return new RegExp(o,i).test(t)}validateMandatory(e,t){return!!super.validateMandatory(e,t)&&(k.isString(t)&&t.length>0&&""!==t.trim())}}at("String",Et);class wt extends Et{validateInputValue(e,t){return super.validateInputValue(e,t)}}at("Notes",wt);class Mt extends gt{validateInputValue(e,t){return super.validateInputValue(e,t)}}at("ObjectId",Mt);class Ct extends gt{validateInputValue(e,t){return super.validateInputValue(e,t)}}at("[ObjectId]",Ct);class kt extends gt{validateInputValue(e,t){return super.validateInputValue(e,t)}validateMandatory(e,t){var n,o,i;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===(i=null==t?void 0:t.owners)||void 0===i?void 0:i.length)>=1}return!1}}at("Ownership",kt);class Tt extends bt{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 ${F.getCurrencyText(e.min,!1,e.decimalPlaces||2,"")}%`;case"max":return`Data not saved. The value must be less than or equal to ${F.getCurrencyText(e.max,!1,e.decimalPlaces||2,"")}%`;default:return super.getErrorMessage(e,t,n)}}}at("Percentage",Tt);class Ft extends gt{validateInputValue(e,t){return super.validateInputValue(e,t)}}at("SelectBoolean",Ft);class Nt extends gt{validateInputValue(e,t){return super.validateInputValue(e,t)}validateMandatory(e,t){return!!super.validateMandatory(e,t)&&(k.isString(t)&&t.length>0&&""!==t.trim()&&null!==C.parse(t))}}at("SelectNumber",Nt);class Ot extends gt{validateInputValue(e,t){return super.validateInputValue(e,t)}validateMandatory(e,t){return!k.isNullOrUndefined(t)&&""!==t.trim()&&this.validateEnum(e.enum,t)}}at("Select",Ot);const St=(e,t,n)=>{Te(e,t),Ke(e,n)},Dt=()=>{const e=Pt.pop();e&&(e.classList.add("moorr-modal-container-closing"),setTimeout((()=>{e&&(z.unmountComponentAtNode(e),e.remove())}),300))};let It=class{constructor(e){this._props=e}open(){const t=this._props;return new Promise(((n,o)=>{let i,r;"function"==typeof t.onClose&&(i=t.onClose),t.onClose=e=>{i&&i(e),n({dismissed:!1,result:e}),t.showModal=!1,Dt()},"function"==typeof t.onDismiss&&(r=t.onClose),t.onDismiss=()=>{r&&r(),n({dismissed:!0}),t.showModal=!1,Dt()},t.showModal=!0;let a=e.createElement(de,{stylePrefix:"MoorrReactMuiModal"},e.createElement(this.getComponent(),t));Pt.push(this._container=document.createElement("div")),this._container.className="moorr-modal-container",document.body.appendChild(this._container),z.render(a,this._container)}))}};const Pt=[],Vt={},At=e=>"number"==typeof e?e+"px":e,Lt=t=>{var n,o,i,r,l,d,c,u;const m={};t.fixedWidth&&(m.width=t.fixedWidth),t.fixedHeight&&(m.height=t.fixedHeight),(null===(n=t.margins)||void 0===n?void 0:n.left)&&(m.marginLeft=At(null===(o=t.margins)||void 0===o?void 0:o.left)),(null===(i=t.margins)||void 0===i?void 0:i.right)&&(m.marginRight=At(null===(r=t.margins)||void 0===r?void 0:r.right)),(null===(l=t.margins)||void 0===l?void 0:l.top)&&(m.marginTop=At(null===(d=t.margins)||void 0===d?void 0:d.top)),(null===(c=t.margins)||void 0===c?void 0:c.bottom)&&(m.marginBottom=At(null===(u=t.margins)||void 0===u?void 0:u.bottom));let p="moorr-modal-content-container";t.contentClassName&&(p+=" "+t.contentClassName);const[g,v]=a(!1),[E,w]=a(!1);s((()=>{w(!g&&!1!==t.showModal)}),[g,E,t.showModal]);const M=(e,n)=>{v(!0),(null==t?void 0:t.onDismiss)&&t.onDismiss(n)};let C="moorr-modal-container";switch(t.effect){case"fade":C+=" moorr-fade-modal";break;case"slide":C+=" moorr-slide-modal"}return g&&(C+=" moorr-modal-closing"),e.createElement(f,{disableEnforceFocus:!0,className:C,open:E,onClose:M,closeAfterTransition:!0,sx:{display:"flex",alignItems:"center",justifyContent:"center"},slots:{backdrop:b},slotProps:{backdrop:{timeout:300,onClick:e=>{e.preventDefault(),e.stopPropagation(),k.isFunction(t.onBackdropClick)?t.onBackdropClick(e):M(0,"backdrop")}}}},(()=>{switch(t.effect){case"fade":default:return e.createElement(y,{in:E},e.createElement(h,{className:p,sx:e=>({position:"relative",width:825,backgroundColor:e.palette.background.paper,borderRadius:"5px",boxShadow:e.shadows[5],padding:e.spacing(2,4,3),transition:e.transitions.create(["width","height","margin"],{duration:300,easing:e.transitions.easing.easeOut}),transitionProperty:"width, height, margin"}),style:m},t.children));case"slide":return e.createElement(x,{in:E,direction:"left",timeout:300},e.createElement("div",{className:p,style:{position:"relative"}},t.children))}})())},Rt=(t,n)=>{switch(t){default:case"info":case"warning":case"error":(t=>{H(t,{icon:e.createElement(G,{sx:{color:"#EB5757"}}),style:{color:"#EB5757",backgroundColor:"#FCECEC",border:"2px solid #EB5757",fontFamily:'"Poppins", sans-serif',borderRadius:"0.7em",marginLeft:"-100px"},closeButton:()=>e.createElement(W,{sx:{color:"#EB5757"}})})})(n);break;case"success":(t=>{H(t,{icon:e.createElement(q,{sx:{color:"#1B5E20"}}),style:{color:"#1B5E20",backgroundColor:"#E8F5E9",border:"2px solid #1B5E20",fontFamily:'"Poppins", sans-serif',borderRadius:"0.7em",marginLeft:"-100px"},closeButton:()=>e.createElement(W,{sx:{color:"#1B5E20"}})})})(n)}},Ut=t=>e.createElement(Lt,{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)))),jt=t=>{const{className:n,onDismiss:i,showModal:r,onClose:a,icon:l,title:s,body:d,closeLabel:c}=t,u=o((()=>{a(!1)}),[a]);o((()=>{a(!0)}),[a]);const p=o((()=>k.isString(d)?e.createElement(m,{paragraph:!0},d):k.isArray(d)&&d.length>0?d.map(((t,n)=>{const o=`paragraph-${n}`;if(k.isString(t)||!k.isNullOrUndefined(t))return e.createElement(m,{paragraph:!0,key:o},t)})):k.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((()=>k.isString(s)||!k.isNullOrUndefined(s)?s:"Alert"),[s]),f=o((()=>e.createElement(h,{sx:{position:"relative",marginBottom:"0.5rem","& > .MuiSvgIcon-root":{color:"#541868",fontSize:"2rem"}}},null!=l?l:e.createElement(E,null),e.createElement(m,{variant:"h6",sx:{color:"#541868",fontFamily:"Poppins,sans-serif",fontSize:"16px !important",fontWeight:400,lineHeight:22}},v()),e.createElement(w,{onClick:u,sx:{position:"absolute",top:"-0.5rem",right:"-0.5rem"},"data-testid":"dismiss"},e.createElement(W,{sx:{fontSize:"1rem"}})))),[l,v,u]),b=o((()=>{const t=c||"Dismiss";return e.createElement(Q,{handleClick:u,label:t,"data-testid":`${N.toKebabCase(t)}`})}),[c,u]);return e.createElement(Ut,{className:"alert-modal"+(n?" "+n:""),widthValue:"400px",showModal:!0===r,onDismiss:i,onBackdropClick:u,renderHeader:f(),renderBody:g(),renderStatusMessage:b()})};class Bt extends It{constructor(e){super(e)}getComponent(){return jt}}Vt.alert=Bt;const $t=t=>{const{className:n,onDismiss:i,showModal:r,onClose:a,icon:l,title:s,body:d,cancelLabel:c,confirmLabel:u}=t,p=o((()=>{a(!1)}),[a]),g=o((()=>{a(!0)}),[a]),v=o((()=>k.isString(d)?e.createElement(m,{paragraph:!0},d):k.isArray(d)&&d.length>0?d.map(((t,n)=>{const o=`paragraph-${n}`;if(k.isString(t)||!k.isNullOrUndefined(t))return e.createElement(m,{paragraph:!0,key:o},t)})):k.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]),b=o((()=>k.isString(s)||!k.isNullOrUndefined(s)?s:"Confirm"),[s]),y=o((()=>e.createElement(h,{sx:{position:"relative",marginBottom:"0.5rem","& > .MuiSvgIcon-root":{color:"#541868",fontSize:"2rem"}}},null!=l?l:e.createElement(E,null),e.createElement(m,{variant:"h6",sx:{color:"#541868",fontFamily:"Poppins,sans-serif",fontSize:"16px !important",fontWeight:400,lineHeight:22}},b()),e.createElement(w,{onClick:p,sx:{position:"absolute",top:"-0.5rem",right:"-0.5rem"}},e.createElement(W,{sx:{fontSize:"1rem"},"data-testid":"dismiss"})))),[l,b,p]),x=o((()=>{const t=c||"Cancel";return e.createElement(te,{handleClick:p,label:t,"data-testid":`${N.toKebabCase(t)}`})}),[c,p]),M=o((()=>{const t=u||"Dismiss";return e.createElement(Q,{handleClick:g,label:t,"data-testid":`${N.toKebabCase(t)}`})}),[u,g]);return e.createElement(Ut,{className:"confirm-modal"+(n?" "+n:""),widthValue:"400px",showModal:!0===r,onDismiss:i,onBackdropClick:p,renderHeader:y(),renderBody:f(),renderLeftButtons:x(),renderRightButtons:M()})};class zt extends It{constructor(e){super(e)}getComponent(){return $t}}Vt.confirm=zt;const Ht=t=>{const{className:n,header:o,body:i,leftButtonLabel:r,rightButtonLabel:a,hiddenClose:l,width:s}=t,d=e=>{e.stopPropagation(),t.onDismiss()};return e.createElement(Ut,{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"}},i),e.createElement(h,{className:"opti-info-modal-buttons",sx:{textAlign:"right",marginTop:"1rem"}},r&&e.createElement(M,{className:"opti-info-modal-button-left",style:{marginRight:"5px"},variant:"contained",color:"primary",onClick:()=>{},"data-testid":`${N.toKebabCase(r)}`},r),!l&&e.createElement(Q,{label:"Close",handleClick:d,"data-testid":"close"}))))})};class Gt extends It{constructor(e){super(e)}getComponent(){return Ht}}Vt.optiInfo=Gt;const Wt=e=>{var t,n,o,i,r;const a=null===(t=null==e?void 0:e.detail)||void 0===t?void 0:t.modal;if(!a||!Vt[a])return Promise.reject("invalid-modal");const l=new Vt[a]((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)&&l.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===(i=null==e?void 0:e.detail)||void 0===i?void 0:i.catch)&&l.catch(null===(r=null==e?void 0:e.detail)||void 0===r?void 0:r.catch),l.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=l)};document&&(document.removeEventListener("openModal",Wt),document.addEventListener("openModal",Wt));const qt=(e,t)=>{const[n,i]=a(null),r=l(null),d=o((e=>{if(!e)return;const n=Object.assign({},e.contentRect.toJSON());C.isValid(t)&&t>0?(clearTimeout(r.current),r.current=setTimeout((()=>{i(n)}),t)):i(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},Kt=i({}),_t=()=>r(Kt),Yt=()=>({context:_t()}),Xt=(e,t,n)=>{var i,r;const{context:l}=Yt();s((()=>{var e,t;k.mutexRelease(null!==(t=null===(e=null==l?void 0:l.sectionContext)||void 0===e?void 0:e.updateSessionId)&&void 0!==t?t:"default")}),[null===(i=null==l?void 0:l.sectionContext)||void 0===i?void 0:i.updateSessionId]);const[d,c]=a(0),u=o((()=>{c((e=>e+1))}),[]),[m,p]=a(!1),[h,g]=a(!1),v=o(((e,t)=>{const n=!0===t;p(!0===e),g(n)}),[]),f=o((n=>J(void 0,void 0,void 0,(function*(){if(k.isFunction(t)){const[e]=yield Promise.all([t(n)]);if(!e)return}return l.onMoveBack&&l.onMoveBack({section:e,data:n})}))),[h,t,l.onMoveBack]),[b,y]=a(!1),[x,E]=a(!1),[w,M]=a(null);s((()=>{x&&l.onMoveNext&&l.onMoveNext({section:e,data:w})}),[x,w]);const C=o((e=>J(void 0,void 0,void 0,(function*(){var t,o;try{y(!0),yield k.delay(350),yield k.mutex(null!==(o=null===(t=null==l?void 0:l.sectionContext)||void 0===t?void 0:t.updateSessionId)&&void 0!==o?o:"default",(()=>J(void 0,void 0,void 0,(function*(){if(yield k.delay(350),k.isFunction(n)){const[t]=yield Promise.all([n(e)]);if(!t)return}else if(m||h)return;E(!0),M(e)}))))}finally{y(!1)}}))),[null===(r=null==l?void 0:l.sectionContext)||void 0===r?void 0:r.updateSessionId,m,h,n]),{updatingCount:T,updatingFlags:F,setUpdating:N,unsetUpdating:O}=pt();return{context:l.sectionContext,sectionStep:d,nextSectionStep:u,hasErrors:m,hasMandatoryErrors:h,handleSetHasErrors:v,moveBack:f,moveNext:C,awaitingMoveNext:b,updatingCount:T,updatingFlags:F,setUpdating:N,unsetUpdating:O}},Zt=(e,t,n)=>{const[i,r]=a(t),[l,d]=a(null),[c,u]=a(null),[m,p]=a(null),[h,g]=a(!1),v=o((()=>new Promise((t=>{if(h)return void t(h);const n={};Ge(`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 i=!n.hasErrors&&!n.hasMandatoryErrors;i||g(!0),t(i)}})}))),[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:O}=Xt(e,void 0,v);s((()=>{if(!(null==f?void 0:f.validationSchemas))return;J(void 0,void 0,void 0,(function*(){yield n(null,t,p,(()=>{}),(()=>{}),f.validationSchemas),r(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[S,D]=a(null),I=o((e=>J(void 0,void 0,void 0,(function*(){var n,o;if(!t||!m||!S)return{hasErrors:!1,hasMandatoryErrors:!1};const{hasErrors:i,hasMandatoryErrors:r}=yield mt(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(i,r)),{hasErrors:i,hasMandatoryErrors:r}}))),[t,m,S,T]);return He(`wizardSection.validateForm.${e}`,I),{context:f,sectionStep:b,nextSectionStep:y,settings:i,graphingTile:l,graphingControls:c,inputSchemas:m,data:S,setData:D,updatingCount:x,updatingFlags:E,setUpdating:w,unsetUpdating:M,hasErrors:C,hasMandatoryErrors:k,handleSetHasErrors:T,moveBack:F,moveNext:N,awaitingMoveNext:O}},Jt=e=>{const[t,n]=a(e),[o,i]=a(null),[r,l]=a(null);return s((()=>{n(e);const t=e.tiles[0];i(t);const o={};t.tile.controls.forEach((e=>{o[e.control.dataKey]=e})),l(o)}),[e]),{settings:t,graphingTile:o,graphingControls:r}},Qt=t(((t,n)=>{var{stepIndex:o,sectionStep:i,onNextSectionStep:r,onStepIncrease:a,enterTimeout:l,onEntered:s,children:d}=t,c=Z(t,["stepIndex","sectionStep","onNextSectionStep","onStepIncrease","enterTimeout","onEntered","children"]);return e.createElement(_,{in:i>=o,timeout:{enter:null!=l?l:600},mountOnEnter:!0,onEntered:()=>{r&&r(),s&&s()}},e.createElement(K,Object.assign({},c,{ref:n}),d))})),en=t(((t,i)=>{var r,a,{section:l,children:d,animate:c,animateIn:m,animateOut:p,animateEasing:h,animateDuration:g,maxWidth:v,sx:f}=t,b=Z(t,["section","children","animate","animateIn","animateOut","animateEasing","animateDuration","maxWidth","sx"]);const y=u("(max-width: 700px)"),x=_t();s((()=>{x.setSectionMaxWidth(null!=v?v:0)}),[v]);const E=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&&C.isValid(v)&&v>0&&!k.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===(r=x.containerRect)||void 0===r?void 0:r.width]),w=n((()=>{var e;let t=Object.assign(Object.assign({},f),{width:"100%"});return C.isValid(v)&&v>0&&!k.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===(a=x.containerRect)||void 0===a?void 0:a.width]),M=o((()=>e.createElement(K,Object.assign({},b,{ref:i,className:`wizard-section wizard-section-${l}`,sx:E}),e.createElement(K,{sx:w},d))),[l,E,w,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"),[]),O=o((()=>e.createElement(_,{easing:N,timeout:F,in:x.section===l,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)}},M())),[N,F,x.section,l,M]),S=n((()=>{switch(T){case"scroll-up":return"back"!==x.moveDirection?x.section===l?"up":"down":x.section===l?"down":"up";case"scroll-down":return"back"!==x.moveDirection?x.section===l?"down":"up":x.section===l?"up":"down";case"scroll-left":return"back"!==x.moveDirection?x.section===l?"left":"right":x.section===l?"right":"left";case"scroll-right":return"back"!==x.moveDirection?x.section===l?"right":"left":x.section===l?"left":"right"}}),[x.section,x.moveDirection,l,T]),D=o((()=>e.createElement(Y,{container:x.containerRef.current,direction:S,easing:N,timeout:F,in:x.section===l,mountOnEnter:!0,unmountOnExit:!0,onEnter:e=>{var t,n,o,i;switch(S){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===(i=x.containerRect)||void 0===i?void 0:i.height}px)`}},onEntering:e=>{switch(S){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)}},M())),[N,F,x.section,l,S,x.containerRect,M]),I=o((()=>{switch(T){case"fade":return O();case"scroll-up":case"scroll-down":case"scroll-left":case"scroll-right":return D()}return x.section!==l?null:M()}),[x.section,l,T,O,D,M]);return e.createElement(e.Fragment,null,I())})),tn=t((({children:t,initialSection:i,animate:r,avatar:c,isAvatarVisible:u,sx:m,onMoveBack:p,onMoveNext:h,onSectionChange:g,sectionContext:v},f)=>{const b=l(null),y=qt(b),[x,E]=a(i);s((()=>{i&&g&&g(i)}),[i]);const[w,M]=a(null),[T,F]=a(),N=l(null),O=qt(N),S=o(((e,t)=>{e!==x&&(E(e),M(null!=t?t:null),g&&g(e))}),[x,g]),D=n((()=>({containerRef:b,containerRect:y,section:x,moveDirection:w,onMoveBack:p,onMoveNext:h,changeSection:S,setSectionMaxWidth:F,animate:r,sectionContext:v})),[y,x,w,p,h,S,r,v]);d(f,(()=>({section:x,context:D})),[x,D]);const I=n((()=>{if(k.isNullOrUndefined(y))return null;if(k.isNullOrUndefined(c)||k.isNullOrUndefined(O))return null;let e={display:"inline-block",position:"absolute"};return e=k.isFunction(u)&&!u(x)?Object.assign(Object.assign({},e),{opacity:0}):Object.assign(Object.assign({},e),{opacity:1}),C.isValid(T)&&T>0&&(e=Object.assign(Object.assign({},e),{left:Math.floor((y.width-T)/2)-O.width})),e}),[y,c,u,O,T]),P=o((()=>k.isNullOrUndefined(T)||0===T||k.isNullOrUndefined(I)?null:c),[T,c,I]);return e.createElement(K,{ref:b,sx:Object.assign({position:"relative"},m)},e.createElement(Kt.Provider,{value:D},e.createElement(K,{ref:N,sx:I},P()),t))}));export{vt as AddressValidator,Bt as AlertModal,ft as AsAtDateValidator,X as Button,zt as ConfirmModal,yt as CurrencyValidator,xt as DateValidator,oe as Dropdown,Ut as FadeModal,Ie as FormGroupAddActionModel,Pe as FormGroupModel,Je as FormGroupsTile,Re as FormGroupsTileModel,Se as FormInputModel,ce as GraphingContext,_e as GraphingControl,Oe as GraphingControlModel,De as GraphingControlSettingsModel,We as GraphingGrid,Xe as GraphingPage,Ce as GraphingSettingsModel,he as GraphingTile,Ye as GraphingTileControls,Ve as GraphingTileModel,Me as GraphingTileSettingsModel,be as GraphingTiles,Qe as HorizontalTile,Ue as HorizontalTileModel,It as Modal,Lt as MoorrModal,Le as MultipleControlsTileModel,wt as NotesValidator,bt as NumberValidator,Mt as ObjectIdValidator,Ct as ObjectIdsValidator,Gt as OptiInfoModal,kt as OwnershipValidator,Tt as PercentageValidator,Q as PrimaryButton,ee as QtyButton,te as SecondaryButton,Ft as SelectBooleanValidator,ne as SelectButton,Nt as SelectNumberValidator,Ot as SelectValidator,et as SelectableStatesTile,je as SelectableStatesTileModel,tt as SimpleFormTile,Be as SimpleFormTileModel,Ae as SingleControlTileModel,nt as SingleTile,$e as SingleTileModel,Et as StringValidator,de as StylesProvider,ae as SvgIcon,gt as Validator,ot as VerticalTile,ze as VerticalTileModel,tn as Wizard,en as WizardSection,Qt as WizardSectionStep,ct as checkDataForErrors,Fe as createGraphingControl,Ne as createGraphingControls,Ee as createGraphingTile,we as createGraphingTiles,lt as createValidator,st as createValidators,Ge as dispatchRootEvent,dt as hasInputError,Vt as modals,Pt as modalsStack,Te as registerGraphingControl,Ke as registerGraphingControlComponent,St as registerGraphingFrameworkComponent,xe as registerGraphingTile,pe as registerGraphingTileComponent,re as registerSvgIconComponent,at as registerValidator,Rt as toastMessage,ue as useGraphingContext,ht as useGraphingForm,it as useGraphingFramework,qt as useResizeObserver,He as useRootEventListener,pt as useUpdateTracker,Yt as useWizard,_t as useWizardContext,Jt as useWizardForm,Zt as useWizardFormSection,Xt as useWizardSection,mt as validateData,ut as validateInput};
|