@acuteinfo/common-base 1.2.38-beta.8 → 1.2.38-beta.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import r,{createContext as n,useContext as a,useMemo as s,useRef as o,useCallback as l,useEffect as h,forwardRef as c,useState as d,createElement as u,memo as A,useImperativeHandle as p,Fragment as f,lazy as m,cloneElement as g,Suspense as w,Children as b}from"react";import v from"@mui/icons-material/Visibility";import y from"@mui/icons-material/VisibilityOff";import B from"@mui/material/InputAdornment";import C from"@mui/material/IconButton";import{clone as x,toPath as F,merge as S,cloneDeep as N}from"lodash-es";import*as E from"yup";import k from"date-fns/format";import T,{toNumber as L,isEmpty as I,cloneDeep as D,isEqual as U,isArray as P}from"lodash";import{useAtomValue as R,useAtom as O,useSetAtom as Q}from"jotai/react";import{atomWithReset as H,RESET as M,useAtomCallback as _}from"jotai/utils";import{useAtom as j,useAtomValue as z,useSetAtom as V}from"jotai";import K from"@mui/material/MenuItem";import q from"@mui/material/Grid";import G from"@mui/material/CircularProgress";import{useTranslation as W}from"react-i18next";import J from"clsx";import{Typography as X,Button as Y,Dialog as $,DialogTitle as Z,DialogContent as ee,DialogContentText as te,DialogActions as ie,useTheme as re,Tooltip as ne,FormControlLabel as ae,InputAdornment as se,Box as oe,FormHelperText as le,CircularProgress as he,TableFooter as ce,IconButton as de,Popper as ue,styled as Ae,Card as pe,CardHeader as fe,CardContent as me,Grid as ge,Divider as we,Stack as be,Hidden as ve,Autocomplete as ye,Drawer as Be,AppBar as Ce,Toolbar as xe,Popover as Fe,Select as Se,MenuItem as Ne,TablePagination as Ee,Switch as ke,TextField as Te,TableBody as Le,TableHead as Ie,TableContainer as De,Paper as Ue,TableRow as Pe,Table as Re,TableCell as Oe,LinearProgress as Qe}from"@mui/material";import{isBefore as He,isAfter as Me,isEqual as _e,parse as je,format as ze,isValid as Ve,differenceInCalendarDays as Ke}from"date-fns";import qe,{t as Ge}from"i18next";import We from"pako";import Je from"@mui/material/FormLabel";import Xe from"@mui/material/FormGroup";import Ye from"@mui/material/FormControlLabel";import $e from"@mui/material/FormControl";import Ze from"@mui/material/FormHelperText";import{Engine as et}from"json-rules-engine";import*as tt from"xlsx";import{utils as it,writeFile as rt}from"xlsx";import nt from"@mui/material/Alert";import at from"@mui/material/Card";import st from"@mui/material/CardContent";import ot from"@mui/material/CardActions";import lt from"@mui/material/CardHeader";import ht from"@mui/material/Collapse";import ct from"@mui/material/Button";import dt from"@mui/material/Dialog";import ut from"@mui/material/DialogTitle";import At from"@mui/material/DialogActions";import pt from"@mui/material/DialogContent";import ft from"@mui/lab/Alert";import mt from"@mui/material/LinearProgress";import{NativeTypes as gt}from"react-dnd-html5-backend";import{useDrag as wt,useDrop as bt}from"react-dnd";import vt from"@mui/material/Typography";import yt from"@mui/icons-material/GetAppRounded";import Bt from"@mui/icons-material/Close";import Ct from"papaparse";import xt from"@mui/icons-material/ZoomIn";import Ft from"@mui/icons-material/ZoomOut";import St from"@mui/icons-material/CenterFocusStrong";import Nt from"@mui/icons-material/AddCircleOutline";import Et from"@mui/icons-material/RemoveCircleOutline";import kt from"@mui/icons-material/Help";import Tt from"@mui/icons-material/CheckCircle";import Lt from"@mui/icons-material/Cancel";import It from"@mui/material/Switch";import Dt from"@mui/material/Slider";import Ut from"@mui/material/InputLabel";import Pt from"@mui/material/Rating";import Rt from"@mui/material/ToggleButton";import Ot from"@mui/icons-material/Person";import Qt from"@mui/icons-material/Business";import{NumericFormat as Ht}from"react-number-format";import Mt from"lodash-es/cloneDeep";import _t from"@mui/material/TextField";import{QueryClient as jt,useQuery as zt,useMutation as Vt,useQueries as Kt}from"react-query";import{useAsyncDebounce as qt,useTable as Gt,useGlobalFilter as Wt,useColumnOrder as Jt,useGroupBy as Xt,useSortBy as Yt,useExpanded as $t,usePagination as Zt,useRowSelect as ei,useResizeColumns as ti,useBlockLayout as ii,useFilters as ri}from"react-table";import ni from"@mui/material/Paper";import ai from"@mui/material/Toolbar";import si from"@mui/material/TableContainer";import oi from"@mui/material/Table";import li from"@mui/material/TableHead";import hi from"@mui/material/TableRow";import ci from"@mui/material/TableCell";import di from"@mui/material/TableBody";import ui from"@mui/material/Checkbox";import"regenerator-runtime/runtime";import Ai,{createFilterOptions as pi,autocompleteClasses as fi}from"@mui/material/Autocomplete";import mi from"@mui/material/Input";import gi from"@mui/material/Chip";import wi from"autosuggest-highlight/match";import bi from"autosuggest-highlight/parse";import{styled as vi,alpha as yi,lighten as Bi}from"@mui/material/styles";import{makeStyles as Ci,withStyles as xi,createStyles as Fi}from"@mui/styles";import Si from"@mui/material/useMediaQuery";import{VariableSizeList as Ni,FixedSizeList as Ei}from"react-window";import ki from"@mui/icons-material/Refresh";import Ti from"@mui/material/Select";import{IMaskInput as Li}from"react-imask";import Ii,{tooltipClasses as Di}from"@mui/material/Tooltip";import Ui from"date-fns/subDays";import Pi from"@mui/material/ButtonGroup";import Ri from"@mui/icons-material/MoreHoriz";import Oi from"@mui/icons-material/DeleteOutline";import{LocalizationProvider as Qi}from"@mui/x-date-pickers/LocalizationProvider";import{AdapterDateFns as Hi}from"@mui/x-date-pickers/AdapterDateFns";import Mi from"@mui/material/Avatar";import _i,{stepConnectorClasses as ji}from"@mui/material/StepConnector";import zi from"@mui/material/TableSortLabel";import Vi from"@mui/material/TablePagination";import Ki from"@mui/icons-material/GetApp";import qi,{PrintContextConsumer as Gi}from"react-to-print";import Wi from"@mui/icons-material/Print";import{useLocation as Ji}from"react-router-dom";import*as Xi from"@mui/icons-material";import{KeyboardDoubleArrowLeft as Yi,ChevronLeft as $i,ChevronRight as Zi,KeyboardDoubleArrowRight as er,CheckCircle as tr,Help as ir,Cancel as rr,ExpandLess as nr,ExpandMore as ar}from"@mui/icons-material";import sr from"@mui/material/RadioGroup";import or from"@mui/material/Radio";import lr from"@mui/material/ToggleButtonGroup";import{LocalizationProvider as hr,DatePicker as cr}from"@mui/x-date-pickers";import dr from"@mui/material/Container";import ur from"@mui/material/Divider";import Ar from"@mui/material/AppBar";import pr from"@mui/icons-material/HighlightOffOutlined";import{useSnackbar as fr,SnackbarProvider as mr}from"notistack";import gr from"@mui/material/Tabs";import wr from"@mui/material/Tab";import br from"@mui/icons-material/ArrowRightSharp";import vr from"@mui/icons-material/ArrowDropDownSharp";import yr from"@mui/icons-material/TableView";import Br from"@mui/icons-material/FilterList";import Cr from"@mui/icons-material/FilterAlt";import{matchSorter as xr}from"match-sorter";import{ModuleRegistry as Fr,AllCommunityModule as Sr,ClientSideRowModelModule as Nr,RowApiModule as Er,PinnedRowModule as kr}from"ag-grid-community";import{AgGridReact as Tr}from"ag-grid-react";import Lr from"react-dom";import Ir from"@mui/material/TextareaAutosize";import Dr from"@mui/material/List";import Ur from"@mui/material/ListItem";import Pr from"@mui/material/ListItemText";import Rr from"@mui/material/ListItemIcon";import Or from"@mui/icons-material/Search";import{atom as Qr}from"jotai/vanilla";import{atomFamily as Hr}from"jotai-family";import{DatePicker as Mr}from"@mui/x-date-pickers/DatePicker";import{TimePicker as _r}from"@mui/x-date-pickers/TimePicker";import{DateTimePicker as jr}from"@mui/x-date-pickers/DateTimePicker";import zr from"@mui/material/Menu";import Vr from"@mui/icons-material/PlayArrow";import Kr from"@mui/icons-material/Pause";import qr from"@mui/icons-material/FilterListTwoTone";import Gr from"@mui/material/Drawer";import Wr from"@mui/material/MenuList";import Jr from"@mui/icons-material/ViewColumnOutlined";import Xr from"@mui/material/Popover";import Yr from"@mui/icons-material/FirstPage";import $r from"@mui/icons-material/KeyboardArrowLeft";import Zr from"@mui/icons-material/KeyboardArrowRight";import en from"@mui/icons-material/ArrowForward";import tn from"@mui/icons-material/LastPage";import rn from"@mui/material/Backdrop";import nn from"@mui/material/Slide";import an from"@mui/material/Stepper";import sn from"@mui/material/Step";import on from"@mui/material/StepLabel";import ln from"date-fns/sub";import{DataGrid as hn}from"@mui/x-data-grid";import{WORKER_STATUS as cn,useWorker as dn}from"@koale/useworker";import un from"axios";import An from"@mui/icons-material/Info";import pn from"@mui/icons-material/Warning";var fn="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},mn=[],gn=[],wn="undefined"!=typeof Uint8Array?Uint8Array:Array,bn=!1;function vn(){bn=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0;t<64;++t)mn[t]=e[t],gn[e.charCodeAt(t)]=t;gn["-".charCodeAt(0)]=62,gn["_".charCodeAt(0)]=63}function yn(e){return mn[e>>18&63]+mn[e>>12&63]+mn[e>>6&63]+mn[63&e]}function Bn(e,t,i){for(var r,n=[],a=t;a<i;a+=3)r=(e[a]<<16)+(e[a+1]<<8)+e[a+2],n.push(yn(r));return n.join("")}function Cn(e){var t;bn||vn();for(var i=e.length,r=i%3,n="",a=[],s=16383,o=0,l=i-r;o<l;o+=s)a.push(Bn(e,o,o+s>l?l:o+s));return 1===r?(t=e[i-1],n+=mn[t>>2],n+=mn[t<<4&63],n+="=="):2===r&&(t=(e[i-2]<<8)+e[i-1],n+=mn[t>>10],n+=mn[t>>4&63],n+=mn[t<<2&63],n+="="),a.push(n),a.join("")}function xn(e,t,i,r,n){var a,s,o=8*n-r-1,l=(1<<o)-1,h=l>>1,c=-7,d=i?n-1:0,u=i?-1:1,A=e[t+d];for(d+=u,a=A&(1<<-c)-1,A>>=-c,c+=o;c>0;a=256*a+e[t+d],d+=u,c-=8);for(s=a&(1<<-c)-1,a>>=-c,c+=r;c>0;s=256*s+e[t+d],d+=u,c-=8);if(0===a)a=1-h;else{if(a===l)return s?NaN:1/0*(A?-1:1);s+=Math.pow(2,r),a-=h}return(A?-1:1)*s*Math.pow(2,a-r)}function Fn(e,t,i,r,n,a){var s,o,l,h=8*a-n-1,c=(1<<h)-1,d=c>>1,u=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,A=r?0:a-1,p=r?1:-1,f=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),(t+=s+d>=1?u/l:u*Math.pow(2,1-d))*l>=2&&(s++,l/=2),s+d>=c?(o=0,s=c):s+d>=1?(o=(t*l-1)*Math.pow(2,n),s+=d):(o=t*Math.pow(2,d-1)*Math.pow(2,n),s=0));n>=8;e[i+A]=255&o,A+=p,o/=256,n-=8);for(s=s<<n|o,h+=n;h>0;e[i+A]=255&s,A+=p,s/=256,h-=8);e[i+A-p]|=128*f}var Sn={}.toString,Nn=Array.isArray||function(e){return"[object Array]"==Sn.call(e)};function En(){return Tn.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function kn(e,t){if(En()<t)throw new RangeError("Invalid typed array length");return Tn.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=Tn.prototype:(null===e&&(e=new Tn(t)),e.length=t),e}function Tn(e,t,i){if(!(Tn.TYPED_ARRAY_SUPPORT||this instanceof Tn))return new Tn(e,t,i);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return Dn(this,e)}return Ln(this,e,t,i)}function Ln(e,t,i,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,i,r){if(t.byteLength,i<0||t.byteLength<i)throw new RangeError("'offset' is out of bounds");if(t.byteLength<i+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===i&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,i):new Uint8Array(t,i,r);Tn.TYPED_ARRAY_SUPPORT?(e=t).__proto__=Tn.prototype:e=Un(e,t);return e}(e,t,i,r):"string"==typeof t?function(e,t,i){"string"==typeof i&&""!==i||(i="utf8");if(!Tn.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var r=0|On(t,i);e=kn(e,r);var n=e.write(t,i);n!==r&&(e=e.slice(0,n));return e}(e,t,i):function(e,t){if(Rn(t)){var i=0|Pn(t.length);return 0===(e=kn(e,i)).length||t.copy(e,0,0,i),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?kn(e,0):Un(e,t);if("Buffer"===t.type&&Nn(t.data))return Un(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function In(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function Dn(e,t){if(In(t),e=kn(e,t<0?0:0|Pn(t)),!Tn.TYPED_ARRAY_SUPPORT)for(var i=0;i<t;++i)e[i]=0;return e}function Un(e,t){var i=t.length<0?0:0|Pn(t.length);e=kn(e,i);for(var r=0;r<i;r+=1)e[r]=255&t[r];return e}function Pn(e){if(e>=En())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+En().toString(16)+" bytes");return 0|e}function Rn(e){return!(null==e||!e._isBuffer)}function On(e,t){if(Rn(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var i=e.length;if(0===i)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return ca(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return da(e).length;default:if(r)return ca(e).length;t=(""+t).toLowerCase(),r=!0}}function Qn(e,t,i){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return Zn(this,t,i);case"utf8":case"utf-8":return Jn(this,t,i);case"ascii":return Yn(this,t,i);case"latin1":case"binary":return $n(this,t,i);case"base64":return Wn(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ea(this,t,i);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function Hn(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function Mn(e,t,i,r,n){if(0===e.length)return-1;if("string"==typeof i?(r=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=n?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(n)return-1;i=e.length-1}else if(i<0){if(!n)return-1;i=0}if("string"==typeof t&&(t=Tn.from(t,r)),Rn(t))return 0===t.length?-1:_n(e,t,i,r,n);if("number"==typeof t)return t&=255,Tn.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):_n(e,[t],i,r,n);throw new TypeError("val must be string, number or Buffer")}function _n(e,t,i,r,n){var a,s=1,o=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,o/=2,l/=2,i/=2}function h(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(n){var c=-1;for(a=i;a<o;a++)if(h(e,a)===h(t,-1===c?0:a-c)){if(-1===c&&(c=a),a-c+1===l)return c*s}else-1!==c&&(a-=a-c),c=-1}else for(i+l>o&&(i=o-l),a=i;a>=0;a--){for(var d=!0,u=0;u<l;u++)if(h(e,a+u)!==h(t,u)){d=!1;break}if(d)return a}return-1}function jn(e,t,i,r){i=Number(i)||0;var n=e.length-i;r?(r=Number(r))>n&&(r=n):r=n;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");r>a/2&&(r=a/2);for(var s=0;s<r;++s){var o=parseInt(t.substr(2*s,2),16);if(isNaN(o))return s;e[i+s]=o}return s}function zn(e,t,i,r){return ua(ca(t,e.length-i),e,i,r)}function Vn(e,t,i,r){return ua(function(e){for(var t=[],i=0;i<e.length;++i)t.push(255&e.charCodeAt(i));return t}(t),e,i,r)}function Kn(e,t,i,r){return Vn(e,t,i,r)}function qn(e,t,i,r){return ua(da(t),e,i,r)}function Gn(e,t,i,r){return ua(function(e,t){for(var i,r,n,a=[],s=0;s<e.length&&!((t-=2)<0);++s)r=(i=e.charCodeAt(s))>>8,n=i%256,a.push(n),a.push(r);return a}(t,e.length-i),e,i,r)}function Wn(e,t,i){return 0===t&&i===e.length?Cn(e):Cn(e.slice(t,i))}function Jn(e,t,i){i=Math.min(e.length,i);for(var r=[],n=t;n<i;){var a,s,o,l,h=e[n],c=null,d=h>239?4:h>223?3:h>191?2:1;if(n+d<=i)switch(d){case 1:h<128&&(c=h);break;case 2:128==(192&(a=e[n+1]))&&(l=(31&h)<<6|63&a)>127&&(c=l);break;case 3:a=e[n+1],s=e[n+2],128==(192&a)&&128==(192&s)&&(l=(15&h)<<12|(63&a)<<6|63&s)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:a=e[n+1],s=e[n+2],o=e[n+3],128==(192&a)&&128==(192&s)&&128==(192&o)&&(l=(15&h)<<18|(63&a)<<12|(63&s)<<6|63&o)>65535&&l<1114112&&(c=l)}null===c?(c=65533,d=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),n+=d}return function(e){var t=e.length;if(t<=Xn)return String.fromCharCode.apply(String,e);var i="",r=0;for(;r<t;)i+=String.fromCharCode.apply(String,e.slice(r,r+=Xn));return i}(r)}Tn.TYPED_ARRAY_SUPPORT=void 0===fn.TYPED_ARRAY_SUPPORT||fn.TYPED_ARRAY_SUPPORT,En(),Tn.poolSize=8192,Tn._augment=function(e){return e.__proto__=Tn.prototype,e},Tn.from=function(e,t,i){return Ln(null,e,t,i)},Tn.TYPED_ARRAY_SUPPORT&&(Tn.prototype.__proto__=Uint8Array.prototype,Tn.__proto__=Uint8Array),Tn.alloc=function(e,t,i){return function(e,t,i,r){return In(t),t<=0?kn(e,t):void 0!==i?"string"==typeof r?kn(e,t).fill(i,r):kn(e,t).fill(i):kn(e,t)}(null,e,t,i)},Tn.allocUnsafe=function(e){return Dn(null,e)},Tn.allocUnsafeSlow=function(e){return Dn(null,e)},Tn.isBuffer=function(e){return null!=e&&(!!e._isBuffer||Aa(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&Aa(e.slice(0,0))}(e))},Tn.compare=function(e,t){if(!Rn(e)||!Rn(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var i=e.length,r=t.length,n=0,a=Math.min(i,r);n<a;++n)if(e[n]!==t[n]){i=e[n],r=t[n];break}return i<r?-1:r<i?1:0},Tn.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Tn.concat=function(e,t){if(!Nn(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return Tn.alloc(0);var i;if(void 0===t)for(t=0,i=0;i<e.length;++i)t+=e[i].length;var r=Tn.allocUnsafe(t),n=0;for(i=0;i<e.length;++i){var a=e[i];if(!Rn(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,n),n+=a.length}return r},Tn.byteLength=On,Tn.prototype._isBuffer=!0,Tn.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)Hn(this,t,t+1);return this},Tn.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)Hn(this,t,t+3),Hn(this,t+1,t+2);return this},Tn.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)Hn(this,t,t+7),Hn(this,t+1,t+6),Hn(this,t+2,t+5),Hn(this,t+3,t+4);return this},Tn.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?Jn(this,0,e):Qn.apply(this,arguments)},Tn.prototype.equals=function(e){if(!Rn(e))throw new TypeError("Argument must be a Buffer");return this===e||0===Tn.compare(this,e)},Tn.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),"<Buffer "+e+">"},Tn.prototype.compare=function(e,t,i,r,n){if(!Rn(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===i&&(i=e?e.length:0),void 0===r&&(r=0),void 0===n&&(n=this.length),t<0||i>e.length||r<0||n>this.length)throw new RangeError("out of range index");if(r>=n&&t>=i)return 0;if(r>=n)return-1;if(t>=i)return 1;if(this===e)return 0;for(var a=(n>>>=0)-(r>>>=0),s=(i>>>=0)-(t>>>=0),o=Math.min(a,s),l=this.slice(r,n),h=e.slice(t,i),c=0;c<o;++c)if(l[c]!==h[c]){a=l[c],s=h[c];break}return a<s?-1:s<a?1:0},Tn.prototype.includes=function(e,t,i){return-1!==this.indexOf(e,t,i)},Tn.prototype.indexOf=function(e,t,i){return Mn(this,e,t,i,!0)},Tn.prototype.lastIndexOf=function(e,t,i){return Mn(this,e,t,i,!1)},Tn.prototype.write=function(e,t,i,r){if(void 0===t)r="utf8",i=this.length,t=0;else if(void 0===i&&"string"==typeof t)r=t,i=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(i)?(i|=0,void 0===r&&(r="utf8")):(r=i,i=void 0)}var n=this.length-t;if((void 0===i||i>n)&&(i=n),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var a=!1;;)switch(r){case"hex":return jn(this,e,t,i);case"utf8":case"utf-8":return zn(this,e,t,i);case"ascii":return Vn(this,e,t,i);case"latin1":case"binary":return Kn(this,e,t,i);case"base64":return qn(this,e,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Gn(this,e,t,i);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},Tn.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Xn=4096;function Yn(e,t,i){var r="";i=Math.min(e.length,i);for(var n=t;n<i;++n)r+=String.fromCharCode(127&e[n]);return r}function $n(e,t,i){var r="";i=Math.min(e.length,i);for(var n=t;n<i;++n)r+=String.fromCharCode(e[n]);return r}function Zn(e,t,i){var r=e.length;(!t||t<0)&&(t=0),(!i||i<0||i>r)&&(i=r);for(var n="",a=t;a<i;++a)n+=ha(e[a]);return n}function ea(e,t,i){for(var r=e.slice(t,i),n="",a=0;a<r.length;a+=2)n+=String.fromCharCode(r[a]+256*r[a+1]);return n}function ta(e,t,i){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>i)throw new RangeError("Trying to access beyond buffer length")}function ia(e,t,i,r,n,a){if(!Rn(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<a)throw new RangeError('"value" argument is out of bounds');if(i+r>e.length)throw new RangeError("Index out of range")}function ra(e,t,i,r){t<0&&(t=65535+t+1);for(var n=0,a=Math.min(e.length-i,2);n<a;++n)e[i+n]=(t&255<<8*(r?n:1-n))>>>8*(r?n:1-n)}function na(e,t,i,r){t<0&&(t=4294967295+t+1);for(var n=0,a=Math.min(e.length-i,4);n<a;++n)e[i+n]=t>>>8*(r?n:3-n)&255}function aa(e,t,i,r,n,a){if(i+r>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function sa(e,t,i,r,n){return n||aa(e,0,i,4),Fn(e,t,i,r,23,4),i+4}function oa(e,t,i,r,n){return n||aa(e,0,i,8),Fn(e,t,i,r,52,8),i+8}Tn.prototype.slice=function(e,t){var i,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),Tn.TYPED_ARRAY_SUPPORT)(i=this.subarray(e,t)).__proto__=Tn.prototype;else{var n=t-e;i=new Tn(n,void 0);for(var a=0;a<n;++a)i[a]=this[a+e]}return i},Tn.prototype.readUIntLE=function(e,t,i){e|=0,t|=0,i||ta(e,t,this.length);for(var r=this[e],n=1,a=0;++a<t&&(n*=256);)r+=this[e+a]*n;return r},Tn.prototype.readUIntBE=function(e,t,i){e|=0,t|=0,i||ta(e,t,this.length);for(var r=this[e+--t],n=1;t>0&&(n*=256);)r+=this[e+--t]*n;return r},Tn.prototype.readUInt8=function(e,t){return t||ta(e,1,this.length),this[e]},Tn.prototype.readUInt16LE=function(e,t){return t||ta(e,2,this.length),this[e]|this[e+1]<<8},Tn.prototype.readUInt16BE=function(e,t){return t||ta(e,2,this.length),this[e]<<8|this[e+1]},Tn.prototype.readUInt32LE=function(e,t){return t||ta(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Tn.prototype.readUInt32BE=function(e,t){return t||ta(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Tn.prototype.readIntLE=function(e,t,i){e|=0,t|=0,i||ta(e,t,this.length);for(var r=this[e],n=1,a=0;++a<t&&(n*=256);)r+=this[e+a]*n;return r>=(n*=128)&&(r-=Math.pow(2,8*t)),r},Tn.prototype.readIntBE=function(e,t,i){e|=0,t|=0,i||ta(e,t,this.length);for(var r=t,n=1,a=this[e+--r];r>0&&(n*=256);)a+=this[e+--r]*n;return a>=(n*=128)&&(a-=Math.pow(2,8*t)),a},Tn.prototype.readInt8=function(e,t){return t||ta(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Tn.prototype.readInt16LE=function(e,t){t||ta(e,2,this.length);var i=this[e]|this[e+1]<<8;return 32768&i?4294901760|i:i},Tn.prototype.readInt16BE=function(e,t){t||ta(e,2,this.length);var i=this[e+1]|this[e]<<8;return 32768&i?4294901760|i:i},Tn.prototype.readInt32LE=function(e,t){return t||ta(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Tn.prototype.readInt32BE=function(e,t){return t||ta(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Tn.prototype.readFloatLE=function(e,t){return t||ta(e,4,this.length),xn(this,e,!0,23,4)},Tn.prototype.readFloatBE=function(e,t){return t||ta(e,4,this.length),xn(this,e,!1,23,4)},Tn.prototype.readDoubleLE=function(e,t){return t||ta(e,8,this.length),xn(this,e,!0,52,8)},Tn.prototype.readDoubleBE=function(e,t){return t||ta(e,8,this.length),xn(this,e,!1,52,8)},Tn.prototype.writeUIntLE=function(e,t,i,r){(e=+e,t|=0,i|=0,r)||ia(this,e,t,i,Math.pow(2,8*i)-1,0);var n=1,a=0;for(this[t]=255&e;++a<i&&(n*=256);)this[t+a]=e/n&255;return t+i},Tn.prototype.writeUIntBE=function(e,t,i,r){(e=+e,t|=0,i|=0,r)||ia(this,e,t,i,Math.pow(2,8*i)-1,0);var n=i-1,a=1;for(this[t+n]=255&e;--n>=0&&(a*=256);)this[t+n]=e/a&255;return t+i},Tn.prototype.writeUInt8=function(e,t,i){return e=+e,t|=0,i||ia(this,e,t,1,255,0),Tn.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},Tn.prototype.writeUInt16LE=function(e,t,i){return e=+e,t|=0,i||ia(this,e,t,2,65535,0),Tn.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):ra(this,e,t,!0),t+2},Tn.prototype.writeUInt16BE=function(e,t,i){return e=+e,t|=0,i||ia(this,e,t,2,65535,0),Tn.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):ra(this,e,t,!1),t+2},Tn.prototype.writeUInt32LE=function(e,t,i){return e=+e,t|=0,i||ia(this,e,t,4,4294967295,0),Tn.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):na(this,e,t,!0),t+4},Tn.prototype.writeUInt32BE=function(e,t,i){return e=+e,t|=0,i||ia(this,e,t,4,4294967295,0),Tn.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):na(this,e,t,!1),t+4},Tn.prototype.writeIntLE=function(e,t,i,r){if(e=+e,t|=0,!r){var n=Math.pow(2,8*i-1);ia(this,e,t,i,n-1,-n)}var a=0,s=1,o=0;for(this[t]=255&e;++a<i&&(s*=256);)e<0&&0===o&&0!==this[t+a-1]&&(o=1),this[t+a]=(e/s|0)-o&255;return t+i},Tn.prototype.writeIntBE=function(e,t,i,r){if(e=+e,t|=0,!r){var n=Math.pow(2,8*i-1);ia(this,e,t,i,n-1,-n)}var a=i-1,s=1,o=0;for(this[t+a]=255&e;--a>=0&&(s*=256);)e<0&&0===o&&0!==this[t+a+1]&&(o=1),this[t+a]=(e/s|0)-o&255;return t+i},Tn.prototype.writeInt8=function(e,t,i){return e=+e,t|=0,i||ia(this,e,t,1,127,-128),Tn.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},Tn.prototype.writeInt16LE=function(e,t,i){return e=+e,t|=0,i||ia(this,e,t,2,32767,-32768),Tn.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):ra(this,e,t,!0),t+2},Tn.prototype.writeInt16BE=function(e,t,i){return e=+e,t|=0,i||ia(this,e,t,2,32767,-32768),Tn.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):ra(this,e,t,!1),t+2},Tn.prototype.writeInt32LE=function(e,t,i){return e=+e,t|=0,i||ia(this,e,t,4,2147483647,-2147483648),Tn.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):na(this,e,t,!0),t+4},Tn.prototype.writeInt32BE=function(e,t,i){return e=+e,t|=0,i||ia(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),Tn.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):na(this,e,t,!1),t+4},Tn.prototype.writeFloatLE=function(e,t,i){return sa(this,e,t,!0,i)},Tn.prototype.writeFloatBE=function(e,t,i){return sa(this,e,t,!1,i)},Tn.prototype.writeDoubleLE=function(e,t,i){return oa(this,e,t,!0,i)},Tn.prototype.writeDoubleBE=function(e,t,i){return oa(this,e,t,!1,i)},Tn.prototype.copy=function(e,t,i,r){if(i||(i=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<i&&(r=i),r===i)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-i&&(r=e.length-t+i);var n,a=r-i;if(this===e&&i<t&&t<r)for(n=a-1;n>=0;--n)e[n+t]=this[n+i];else if(a<1e3||!Tn.TYPED_ARRAY_SUPPORT)for(n=0;n<a;++n)e[n+t]=this[n+i];else Uint8Array.prototype.set.call(e,this.subarray(i,i+a),t);return a},Tn.prototype.fill=function(e,t,i,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,i=this.length):"string"==typeof i&&(r=i,i=this.length),1===e.length){var n=e.charCodeAt(0);n<256&&(e=n)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!Tn.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;var a;if(t>>>=0,i=void 0===i?this.length:i>>>0,e||(e=0),"number"==typeof e)for(a=t;a<i;++a)this[a]=e;else{var s=Rn(e)?e:ca(new Tn(e,r).toString()),o=s.length;for(a=0;a<i-t;++a)this[a+t]=s[a%o]}return this};var la=/[^+\/0-9A-Za-z-_]/g;function ha(e){return e<16?"0"+e.toString(16):e.toString(16)}function ca(e,t){var i;t=t||1/0;for(var r=e.length,n=null,a=[],s=0;s<r;++s){if((i=e.charCodeAt(s))>55295&&i<57344){if(!n){if(i>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&a.push(239,191,189);continue}n=i;continue}if(i<56320){(t-=3)>-1&&a.push(239,191,189),n=i;continue}i=65536+(n-55296<<10|i-56320)}else n&&(t-=3)>-1&&a.push(239,191,189);if(n=null,i<128){if((t-=1)<0)break;a.push(i)}else if(i<2048){if((t-=2)<0)break;a.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;a.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return a}function da(e){return function(e){var t,i,r,n,a,s;bn||vn();var o=e.length;if(o%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a="="===e[o-2]?2:"="===e[o-1]?1:0,s=new wn(3*o/4-a),r=a>0?o-4:o;var l=0;for(t=0,i=0;t<r;t+=4,i+=3)n=gn[e.charCodeAt(t)]<<18|gn[e.charCodeAt(t+1)]<<12|gn[e.charCodeAt(t+2)]<<6|gn[e.charCodeAt(t+3)],s[l++]=n>>16&255,s[l++]=n>>8&255,s[l++]=255&n;return 2===a?(n=gn[e.charCodeAt(t)]<<2|gn[e.charCodeAt(t+1)]>>4,s[l++]=255&n):1===a&&(n=gn[e.charCodeAt(t)]<<10|gn[e.charCodeAt(t+1)]<<4|gn[e.charCodeAt(t+2)]>>2,s[l++]=n>>8&255,s[l++]=255&n),s}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(la,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function ua(e,t,i,r){for(var n=0;n<r&&!(n+i>=t.length||n>=e.length);++n)t[n+i]=e[n];return n}function Aa(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}const pa=()=>{const e=new Map;return{registerFn:(t,i)=>"function"==typeof i&&(e.set(t,i),!0),unregisterFn:t=>{e.has(t)&&e.delete(t)},getFn:(t,i)=>e.has(t)?e.get(t):i}},fa=pa(),ma=pa(),ga=(e,t)=>Number.parseFloat(e)>Number.parseFloat(t),wa=(e,t)=>Number.parseFloat(e)>=Number.parseFloat(t),ba=(e,t)=>Number.parseFloat(e)<Number.parseFloat(t),va=(e,t)=>Number.parseFloat(e)<=Number.parseFloat(t),ya=(e,t,i)=>(e instanceof Date&&t instanceof Date&&i?.ignoreTime&&(e=new Date(e).setHours(0,0,0,0),t=new Date(t).setHours(0,0,0,0)),Me(e,t)),Ba=(e,t)=>!!_e(e,t)||Me(e,t),Ca=(e,t,i)=>(e instanceof Date&&t instanceof Date&&i?.ignoreTime&&(e=new Date(e).setHours(0,0,0,0),t=new Date(t).setHours(0,0,0,0)),He(e,t)),xa=(e,t)=>!!_e(e,t)||He(e,t),Fa=e=>async(t,i)=>{const{success:r,failure:n,conditions:a}=e;let s=new et;s.addOperator("greaterThanInclusiveDate",Ba),s.addOperator("greaterThanDate",ya),s.addOperator("lessThanDate",Ca),s.addOperator("lessThanInclusiveDate",xa),s.addOperator("greaterThanString",ga),s.addOperator("greaterThanInclusiveString",wa),s.addOperator("lessThanInclusiveString",va),s.addOperator("lessThanString",ba);const o={conditions:a,event:{type:"success"}};s.addRule(o);const l=await s.run({currentField:t,dependentFields:i});return s.stop(),l.events.length>0?r:n},Sa=e=>"[object String]"===Object.prototype.toString.call(e),Na=e=>null!==e&&"object"==typeof e,Ea=e=>String(Math.floor(Number(e)))===e;function ka(e,t,i,r=0){const n=F(t);for(;e&&r<n.length;)e=e[n[r++]];return void 0===e?i:e}function Ta(e,t,i){let r=x(e),n=r,a=0,s=F(t);for(;a<s.length-1;a++){const t=s[a];let i=ka(e,s.slice(0,a+1));if(i&&(Na(i)||Array.isArray(i)))n=n[t]=x(i);else{const e=s[a+1];n=n[t]=Ea(e)&&Number(e)>=0?[]:{}}}return(0===a?e:n)[s[a]]===i?e:(void 0===i?delete n[s[a]]:n[s[a]]=i,0===a&&void 0===i&&delete r[s[a]],r)}const La={abortEarly:!1,strict:!1},Ia=e=>async t=>{const{value:i}=t;try{return await e.validate("string"==typeof i?(i||"").trim():i,La),null}catch(e){return e instanceof E.ValidationError?e.errors[0]:e.message}},Da=(e,t)=>{if("object"==typeof e)try{let i=E.reach(e,t);return async e=>await Ia(i)(e)}catch(e){return}},Ua={formAtom:"formAtom",formFieldAtom:"formFieldAtom",formArrayFieldRowsAtom:"formArrayFieldRowsAtom",formArrayFieldRegistryAtom:"formArrayFieldRegistryAtom",formFieldRegistryAtom:"formFieldRegistryAtom",formFieldRegisterSelector:"formFieldRegisterSelector",formFieldUnregisterSelector:"formFieldUnregisterSelector",formArrayFieldRegisterSelector:"formArrayFieldRegisterSelector",formArrayFieldUnregisterSelector:"formArrayFieldUnregisterSelector",subscribeToFormFieldsSelector:"subscribeToFormFieldsSelector",isFormArrayFieldRegistered:"isFormArrayFieldRegistered",formFieldsExcludedAtom:"formFieldsExcludedAtom",formFieldExcludeAddSelector:"formFieldExcludeAddSelector",formFieldExcludeRemoveSelector:"formFieldExcludeRemoveSelector",formFieldsErrorWatcherAtom:"formFieldsErrorWatcherAtom",formFieldsErrorWatcherAddSelector:"formFieldsErrorWatcherAddSelector",formFieldsErrorWatcherRemoveSelector:"formFieldsErrorWatcherAddSelector"},Pa=Hr(e=>{const t=H({submitAttempt:0,isSubmitting:!1,submitSuccessful:!1,serverSentError:"",serverSentErrorDetail:"",validationRunning:!1});return t.debugLabel=`${Ua.formAtom}__${e}`,t}),Ra=Hr(e=>{const t=H({fieldKey:e??"",name:e??"",value:"",displayValue:"",touched:!1,error:null,validationRunning:!1,validate:null,excluded:!1,readOnly:!1,incomingMessage:null,skipValueUpdateFromCrossFieldWhenReadOnly:!1,optionData:{},ignoreInSubmit:!1});return t.debugLabel=`${Ua.formFieldAtom}__${e}`,t}),Oa=Hr(e=>{const t=H([]);return t.debugLabel=`${Ua.formFieldsErrorWatcherAtom}__${e}`,t}),Qa=Hr(e=>{const t=Qr(null,(t,i,r)=>{if(r===M)return;const n=t(Oa(e));n.includes(r)||i(Oa(e),[...n,r])});return t.debugLabel=`${Ua.formFieldsErrorWatcherAddSelector}__${e}`,t}),Ha=Hr(e=>{const t=Qr(null,(t,i,r)=>{if(r===M)return;const n=t(Oa(e)),a=n.indexOf(r);if(a>-1){const t=[...n.slice(0,a),...n.slice(a+1)];i(Oa(e),t)}});return t.debugLabel=`${Ua.formFieldsErrorWatcherRemoveSelector}__${e}`,t}),Ma=Hr(e=>{const t=H([]);return t.debugLabel=`${Ua.formFieldsExcludedAtom}__${e}`,t}),_a=Hr(e=>{const t=Qr(null,(t,i,r)=>{if(r===M)return;const n=t(Ma(e));n.includes(r)||i(Ma(e),[...n,r])});return t.debugLabel=`${Ua.formFieldExcludeAddSelector}__${e}`,t}),ja=Hr(e=>{const t=Qr(null,(t,i,r)=>{if(r===M)return;const n=t(Ma(e)),a=n.indexOf(r);if(a>-1){const t=[...n.slice(0,a),...n.slice(a+1)];i(Ma(e),t)}});return t.debugLabel=`${Ua.formFieldExcludeRemoveSelector}__${e}`,t}),za=Hr(e=>{const t=H([]);return t.debugLabel=`${Ua.formFieldRegistryAtom}__${e}`,t}),Va=Hr(e=>{const t=Qr(null,(t,i,r)=>{if(r===M)return;const n=t(za(e));n.includes(r.fieldName)||(i(za(e),[...n,r.fieldName]),null!==r.defaultValue&&i(Ra(r.fieldName),e=>({...e,...r.defaultValue})))});return t.debugLabel=`${Ua.formFieldRegisterSelector}__${e}`,t}),Ka=Hr(e=>{const t=Qr(null,(t,i,r)=>{if(r===M)return;const n=t(za(e)),a=n.indexOf(r);if(a>-1){i(Ra(r),M);const t=[...n.slice(0,a),...n.slice(a+1)];i(za(e),t)}});return t.debugLabel=`${Ua.formFieldUnregisterSelector}__${e}`,t}),qa=Hr(e=>{const t=H({fieldName:e,templateFieldRows:[],lastInsertIndex:-1,resetFlag:!1,excluded:!1});return t.debugLabel=`${Ua.formArrayFieldRowsAtom}__${e}`,t}),Ga=Hr(e=>{const t=H([]);return t.debugLabel=`${Ua.formArrayFieldRegistryAtom}__${e}`,t}),Wa=Hr(e=>{const t=Qr(null,(t,i,r)=>{if(r===M)return;const n=t(Ga(e));n.includes(r)||i(Ga(e),[...n,r])});return t.debugLabel=`${Ua.formArrayFieldRegisterSelector}__${e}`,t}),Ja=Hr(e=>{const t=Qr(null,(t,i,r)=>{if(r===M)return;const n=t(Ga(e)),a=n.indexOf(r);if(a>-1){i(Ga(r),M);const t=[...n.slice(0,a),...n.slice(a+1)];i(Ga(e),t)}});return t.debugLabel=`${Ua.formArrayFieldUnregisterSelector}__${e}`,t}),Xa=Hr(e=>{const t=Qr(t=>{if("object"!=typeof e)return{};let i=e.fields??[];"string"==typeof i&&(i=[i]);let r=t(za(`${e.formName}`)),n=t(Ga(`${e.formName}`)),a=i.filter(i=>i.split(".").length>1&&!t(za(`${e.formName}`)).filter(e=>e.split("/")[1].includes(i)).length);i=i.concat(a.map(e=>e.split(".")[1]));let s=n.filter(e=>Array.isArray(i)&&i.filter(t=>e.includes(t)).length),o=r.filter(e=>s.filter(t=>e.includes(t)).length),l=o.map(t=>t.replace(`${e.formName}/`,""));const h=[];for(const i of l)h.push(t(Ra(`${e.formName}/${i}`)));let c={};for(const t of h)c=Ta(c,t.name.replace(`${e.formName}/`,""),t);let d={};for(let r of i)if("string"==typeof r&&Boolean(r)){let i=t(Ra(`${e.formName}/${r}`));d[r]=i}return d={...d,...c},d});return t.debugLabel=`${Ua.subscribeToFormFieldsSelector}__${JSON.stringify(e)}`,t},(e,t)=>T.isEqual(e,t)),Ya=n({formName:"FORM_NAME",validationRun:"onBlur",resetFieldOnUnmount:!0,initialValues:{},previousValues:{},formState:{},defaultArrayFieldValues:{},lastValidationValue:new Map,flagRef:new Map,setCurrentStepIndexFnRef:null});Ya.displayName="FormContext";const $a=n({authState:{}}),Za=({authState:t,children:i})=>{const r=s(()=>t,[t]);return e($a.Provider,{value:{authState:r},children:i})},es=()=>{const e=a($a);if(void 0===e)throw new Error("useAuthContext must be used within a AuthContextProvider");return e},ts={dynamicAccountNumberField:"separated",dynamicAmountSymbol:"INR",dynamicAmountGroupStyle:"lakh",currencyFormat:"en-IN",decimalCount:2,commonDateFormat:"dd/MM/yyyy",commonDateTimeFormat:"dd/MM/yyyy hh:mm:ss aa",commonTimeFormat:"hh:mm:ss aa",denoTableType:"single",customExtendedTypes:{},defaultGridConfig:{variant:"standard",enablePaginationInput:!0,isContainedActionButton:!1,enableDoubleSpaceAction:!1},defaultExportConfig:{enablePdfPrint:!1,saveUpdateTemplateApiFn:void 0,getPersonalizedReportData:void 0},enableOptionsGridForAutocomplete:!0,enablePostValidationRun:!1,disableColumnFilters:!1,enableEnterToFocus:!1,refetchOptionsWhenOnline:!0},is=n(ts),rs=({config:t,children:i})=>{const r=s(()=>({...ts,...t}),[t]);return e(is.Provider,{value:r,children:i})},ns=()=>{const e=a(is);if(void 0===e)throw new Error("usePropertiesConfigContext must be used within a CustomPropertiesConfigurationProvider");return e},as=({fieldKey:e,name:t,dependentFields:i,validate:r,validationRun:n,shouldExclude:s,isReadOnly:c,postValidationSetCrossFieldValues:d,runPostValidationHookAlways:u,runValidationOnDependentFieldsChange:A,skipValueUpdateFromCrossFieldWhenReadOnly:p,runExternalFunction:f,onFormDataChange:m,txtTransform:g,AlwaysRunPostValidationSetCrossFieldValues:w,componentType:b="",runPostValidationForInitValue:v,dependentFieldDebounceDelay:y=300,isCurrencyField:B=!1})=>{const C=a(Ya),{authState:x}=es(),[F,S]=j(Pa(C.formName)),N=o(Boolean(e)?`${C.formName}/${e}`:`${C.formName}/${t}`),E=o("DO_NOT_CHANGE_THIS_VALUE_I_WILL_FIRE_YOU");"DO_NOT_CHANGE_THIS_VALUE_I_WILL_FIRE_YOU"===E.current&&(E.current=hs(e,i));const k=z(Xa({formName:C.formName,fields:E.current})),T=o(!1),L=(e,t,i,r,n)=>{if("function"!=typeof e)return e??n;const a=e(t,ds(i),r);return a instanceof Promise?"PENDING_PROMISE":a};_(l((e,t)=>{if(T.current)return;const i=e(Ra(N.current)),r=ds(k),n=L(s,i,r,C.formState,!1),a=L(c,i,r,C.formState,!1);t(Ra(N.current),e=>({...e,excluded:"PENDING_PROMISE"===n?e.excluded:!!n,readOnly:"PENDING_PROMISE"===a?e.readOnly:!!a,skipValueUpdateFromCrossFieldWhenReadOnly:!!p,componentType:b})),"PENDING_PROMISE"===n&&Promise.resolve(s(i,r,C.formState)).then(e=>t(Ra(N.current),t=>({...t,excluded:!!e}))),"PENDING_PROMISE"===a&&Promise.resolve(c(i,r,C.formState)).then(e=>t(Ra(N.current),t=>({...t,readOnly:!!e}))),T.current=!0},[s,c,k,C.formState,b,p]))();const[I,D]=j(Ra(N.current)),{t:U}=W();h(()=>{0===t.indexOf(`${C.formName}/`)?D(e=>({...e,name:t,componentType:b})):D(e=>({...e,name:`${C.formName}/${t}`,componentType:b}))},[t,D,C.formName,b]);const P=o(I);P.current=I;const R=V(Va(C.formName)),O=V(Ka(C.formName)),{enablePostValidationRun:Q,decimalCount:H}=ns();h(()=>{const e=N.current,t="object"==typeof C.defaultArrayFieldValues?ka(C.defaultArrayFieldValues,e.replace(`${C.formName}/`,"").replace(/\[\d\]/g,""),null):null;let i=null;const r="object"==typeof C.initialValues?ka(C.initialValues,e.replace(`${C.formName}/`,""),null):null;null!=r?i={value:B&&r?String(r).includes(".")?r:Number(r).toFixed(H):r,ignoreInSubmit:"typography"===b.toLowerCase()||"divider"===b.toLowerCase()||"spacer"===b.toLowerCase()}:Boolean(t)&&(i={value:t,ignoreInSubmit:"typography"===b.toLowerCase()||"divider"===b.toLowerCase()||"spacer"===b.toLowerCase()});const n="object"==typeof C.previousValues?ka(C.previousValues,e.replace(`${C.formName}/`,""),null):null;null!=n&&(i={...i,prevValue:n});const a={defaultValue:null===i?{ignoreInSubmit:"typography"===b.toLowerCase()||"divider"===b.toLowerCase()||"spacer"===b.toLowerCase()}:i,fieldName:e};if(R(a),!0===Boolean(C.resetFieldOnUnmount))return()=>{O(e)}},[D,R,O,C]);const M=o("function"==typeof r),K=C.flagRef;h(()=>{const t=I.name.replace(`${C.formName}/`,""),i=function(e,t,i,r,n,a,s,o,l,h,c,d,u,A,p,f,m=2){const g=`${p}/${s}`;if("function"!=typeof e&&"function"!=typeof t&&"function"!=typeof i&&"function"!=typeof a&&!l?.minDate&&"datePicker"===o)return;const w=Boolean(r);if(w){const r=async(r,p,w)=>{let b,v=null,y=null,B=null;if((u||A||!ls(s,r.value,h,c,o,r.defaultKeyValue,f,m)||d?.current.get(g))&&("function"==typeof i&&(b=await i(r,w,l,p),null!=b&&"object"==typeof b||(b={})),d.current.set(g,!0)),Boolean(r?.value&&l?.minDate&&"datepicker"===o?.toLowerCase())){if(Ca(r?.value,new Date(l?.minDate)))return{error:"DateOutOfPeriod",crossFieldMessages:b,apiResult:y}}return"function"==typeof e&&(v=await e(r,w)),Boolean(v)||"function"==typeof t&&(B=await t(r,p,w),"object"==typeof B?(v=B.error,y=B.apiResult):v=B,Boolean(v))||"function"==typeof a&&Boolean(n)&&(B=await a(s,r,p,w),"object"==typeof B?(v=B.error,y=B.apiResult):v=B),{error:v,crossFieldMessages:b,apiResult:y}};return r}{const r=async(r,p,w)=>{let b,v=null,y=null,B=null;if(Boolean(r?.value&&l?.minDate&&"datepicker"===o?.toLowerCase())){if(Ca(r?.value,new Date(l?.minDate)))return{error:"DateOutOfPeriod",crossFieldMessages:{},apiResult:y}}return"function"==typeof e&&(v=await e(r,w)),Boolean(v)?{error:v,crossFieldMessages:{},apiResult:y}:("function"==typeof t&&(B=await t(r,p,w),"object"==typeof B?(v=B.error,y=B.apiResult):v=B),Boolean(v)||"function"==typeof a&&Boolean(n)&&(B=await a(s,r,p,w),"object"==typeof B?(v=B.error,y=B.apiResult):v=B,Boolean(v))?{error:v,crossFieldMessages:{},apiResult:y}:((u||A||!ls(s,r.value,h,c,o,r.defaultKeyValue,f,m)||d?.current?.get(g))&&("function"==typeof i&&(b=await i(r,w,l,p),null!=b&&"object"==typeof b||(b={})),d.current.set(g,!0)),{error:v,crossFieldMessages:b,apiResult:y}))};return r}}(Da(C.validationSchema,t),r,d,u,f,m,e,b,x??{},C.initialValues,C.defaultArrayFieldValues,K,v,Q,C.formName,B,H);"function"==typeof i?(M.current=!0,D(e=>({...e,validate:i,dependentFields:E.current,skipValueUpdateFromCrossFieldWhenReadOnly:Boolean(p)}))):D(e=>({...e,dependentFields:E.current,skipValueUpdateFromCrossFieldWhenReadOnly:Boolean(p)}))},[D,C.formName,C.validationSchema,I.name]);const q=_(l((e,t,{fieldName:i,flag:r})=>{"add"===r?t(_a(C.formName),i):"remove"===r&&t(ja(C.formName),i)},[C.formName])),G=_(l((e,t,{fieldName:i,flag:r})=>{"add"===r?t(Qa(C.formName),i):"remove"===r&&t(Ha(C.formName),i)},[C.formName])),J=o(k);J.current=k,h(()=>{!0===A&&ie(I,k,!0)},[k]);const X=o(null),Y=o(null);h(()=>{if("function"==typeof s){const e=Promise.resolve(s(I,ds(k),C.formState));X.current=e,e.then(t=>{e===X.current&&(D(e=>e.excluded===t?e:{...e,excluded:t}),q({fieldName:I.name,flag:t?"add":"remove"}))})}if("function"==typeof c){const e=Promise.resolve(c(I,ds(k),C.formState));Y.current=e,e.then(t=>{e===Y.current&&D(e=>e.readOnly===t?e:{...e,readOnly:t})})}I.error?G({fieldName:I.name,flag:"add"}):G({fieldName:I.name,flag:"remove"})},[s,c,I.error,k,C.formState,q,G]);const $=_(l((t,i,r)=>{const n=cs(e),a=t(za(C.formName))??[];for(const[e,s]of Object.entries(r)){let r=n;const o=a.includes(`${C.formName}/${n}${e}`),l=a.includes(`${C.formName}/${e}`);!o&&l&&(r="");const h=`${C.formName}/${r}${e}`;if(a.includes(h)){const e=t(Ra(h));if(e.readOnly&&e.skipValueUpdateFromCrossFieldWhenReadOnly)continue;i(Ra(h),e=>({...e,incomingMessage:{...e.incomingMessage,...s}}))}}},[C.formName,e])),Z=o(Boolean(n)?n:Boolean(C.validationRun)?C.validationRun:"all"),ee=o(null),te=C.lastValidationValue,ie=l((t,i,r,n)=>{if("function"!=typeof P.current.validate)return;if(te.current.get(`${C.formName}/${e}`)===t.value&&!1==!!r)return;D(e=>({...e,validationRunning:!0})),S(e=>({...e,validationRunning:!0}));const a=Promise.resolve(P.current.validate(t,ds(i),C.formState));te.current.set(`${C.formName}/${e}`,t.value),ee.current=a,a.then(e=>{if(ee.current===a){const{error:t,crossFieldMessages:i,apiResult:r}=e;let a;a="string"==typeof t||null==t?t:"unkown error check console",Boolean(n)?D(e=>({...e,validationRunning:!1,touched:!0,error:a,validationAPIResult:r})):D(e=>({...e,validationRunning:!1,error:a,validationAPIResult:r})),S(e=>({...e,validationRunning:!1})),"object"==typeof i&&$(i)}}).catch(e=>{if(ee.current===a){let t;t=e instanceof Error?e.message:e?.error_msg??"unkown error type check console",Boolean(n)?D(i=>({...i,validationRunning:!1,touched:!0,error:t,validationAPIResult:e})):D(i=>({...i,validationRunning:!1,error:t,validationAPIResult:e})),S(e=>({...e,validationRunning:!1}))}})},[D,$]),re=l(()=>{D(e=>e.touched?e:{...e,touched:!0})},[D]),ne=l(e=>{D(t=>({...t,incomingMessage:null===e?null:{...t.incomingMessage,...e}}))},[D]),ae=l(e=>{D(t=>({...t,filteredOptions:e}))},[D]),se=l(e=>{D(t=>({...t,displayValue:e??t?.value}))},[D]),oe=l((e,t,i,r)=>{D(!1==!!i?i=>i.value===e?i:{...i,value:e,displayValue:t??e,...r||{}}:i=>({...i,value:e,displayValue:t??e,...r||{}}))},[D]),le=l(e=>{D(t=>{let i;i="function"==typeof e?e(t.value):e;return{...t,value:i,displayValue:i,touched:!0}})},[D]),he=l(e=>{D(t=>{let i;i="function"==typeof e?e(t.error):e;return{...t,error:i}})},[D]),ce=l(e=>{D(t=>({...t,ignoreInSubmit:e}))},[D]),de=l((e,t,i)=>{ie(e?{...P.current,...e}:P.current,J.current,t,i)},[]),ue=l((t,i,r,n={},a=!1)=>{if(null!==P.current){let s=t=t??"",o=i;if(!(t instanceof Date||"string"==typeof t||"number"==typeof t||"boolean"==typeof t||Array.isArray(t))){const{type:e,value:r,checked:n,options:a,multiple:l}=t.target;let h;s=/number|range/.test(e)?(h=parseFloat(r),isNaN(h)?"":h):/checkbox/.test(e)?ss(P.current.value,n,r):l?function(e){return Array.from(e).filter(e=>e.selected).map(e=>e.value)}(a):r,o=/checkbox/.test(e)?ss(P.current.displayValue??"00",n,i):i}"string"==typeof s&&Boolean(g)&&(s="uppercase"===g?s.toUpperCase():"lowercase"===g?s.toLowerCase():s),oe(s,o),Boolean(r)&&te.current.set(`${C.formName}/${e}`,s),a||!M.current||"onChange"!==Z.current&&"all"!==Z.current||de({value:s,...n})}},[oe,de,C.validationRun]),Ae=l(async(e={},t={})=>{const i="function"==typeof w?w(J.current):w;null!==P.current&&(re(),!M.current||"onBlur"!==Z.current&&"all"!==Z.current||de({touched:!0,...t},i?.alwaysRun??!1,i?.touchAndValidate??!1))},[re,de,C.validationRun]),pe=l(e=>{D(t=>({...t,optionData:e}))},[]);return{...I,formState:C.formState,whenToRunValidation:Z.current,isSubmitting:F.isSubmitting,handleChange:ue,handleBlur:Ae,setTouched:re,setValue:oe,setValueAsCB:le,setErrorAsCB:he,setIncomingMessage:ne,setFilteredOptions:ae,runValidation:de,dependentValues:k,handleOptionValueExtraData:pe,validationAPIResult:U(I?.validationAPIResult??""),setDisplayValue:se,setIgnoreInSubmit:ce,error:U(I?.error??""),initialValues:C.initialValues}};function ss(e,t,i){if("boolean"==typeof e)return Boolean(t);let r=[],n=!1,a=-1;if(Array.isArray(e))r=e,a=e.indexOf(i),n=a>=0;else if(!i||"true"==i||"false"==i)return Boolean(t);return t&&i&&!n?r.concat(i):n?r.slice(0,a).concat(r.slice(a+1)):r}function os(e,t,i){return i?.includes("date")||i?.includes("time")?_e(Fs(e),Fs(t)):e===t}function ls(e,t,i,r,n,a,s,o){if("autocomplete"===n&&"string"==typeof a&&(""===i?.[e]||void 0===i?.[e]))return os(a,t,n);if(e.includes(".")){const a=T.get(i,e);if(void 0===a){let i=e.replace(/\[\d+\]/g,"");return os(T.get(r,i),t,n)}return os(s&&a?String(a).includes(".")?a:Number(a).toFixed(o):a,t,n)}return os(i?.[e],t,n)}const hs=(e,t)=>{if(void 0===t)return t;if("string"==typeof t&&(t=[t]),Array.isArray(t)&&e.split(".").length>1){const i=e.split("."),r=i.slice(0,i.length-1).join(".");t=t.map(e=>`${r}.${e}`)}return t},cs=e=>{if(e.split(".").length>1){const t=e.split(".");return`${t.slice(0,t.length-1).join(".")}.`}return""},ds=e=>Object.keys(e).reduce((t,i)=>{let r=e[i];return t[i.replace(/(\[\d+\])/g,"")]=r,t},{}),us=e=>e?"object"==typeof e&&!Array.isArray(e)&&"value"in e&&"fieldKey"in e?[e]:Array.isArray(e)?e.flatMap(us):"object"==typeof e?Object.values(e).flatMap(us):[]:[],As=(e,t)=>{if(Array.isArray(e)){if(!Boolean(t))return e.length+1;let i=0;return e.forEach((e,r)=>{Boolean(e[t])?parseFloat(e[t])>i&&(i=parseFloat(e[t])):i<r+1&&(i=r+1)}),i+1}return 1},ps=(e,t="",i=512)=>{const r=null!=e&&""!=e?atob(e):"",n=[];for(let e=0;e<r.length;e+=i){const t=r.slice(e,e+i),a=new Array(t.length);for(let e=0;e<t.length;e++)a[e]=t.charCodeAt(e);const s=new Uint8Array(a);n.push(s)}return new Blob(n,{type:t})},fs=async e=>await ms(e).then(e=>e.toString().split(",")),ms=e=>new Promise((t,i)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=()=>t(r.result),r.onerror=e=>i(e)}),gs=(e,t=!0)=>{let i=[];if(Array.isArray(e))for(let r=0;r<e.length;r++){let{children:n,...a}=e[r];if(Array.isArray(n)&&n.length>0){let e=gs(n);i.push(...e)}else t&&!Boolean(a.system_code)||!Boolean(a.href)||i.push({...a})}return i},ws=["MM-dd-yy","dd-MM-yy","dd/MM/yy","MM/dd/yy","yyyy-MM-dd HH:mm:ss","yyyy-MM-dd HH:mm:ss.S","yyyy-MM-dd","dd/MM/yyyy","dd/MM/yyyy HH:mm:ss","MM/dd/yyyy HH:mm:ss","dd-MM-yyyy HH:mm:ss","MM/dd/yyyy","MM-dd-yyyy HH:mm:ss","dd/MMM/yyyy","dd-MM-yyyy","dd-MMM-yyyy","yyyy-MM-dd'T'HH:mm:ssX","EEE MMM dd yyyy HH:mm:ss xxxx","EEE MMM dd yyyy HH:mm:ss xx"];function bs(e){if("object"==typeof e&&e instanceof Date)return!isNaN(e.getTime());for(const t of ws){const i=je(e,t,new Date);if(!isNaN(i?.getTime()))return!0}return!1}const vs=(e,t)=>{let i=Object.keys(e),r=[],n={};return i.forEach(i=>{e[i]===t[i]||("object"==typeof e[i]||"object"==typeof t[i]||"string"==typeof e[i])&&bs(e[i])&&bs(t[i])&&ze(Fs(e[i]),"dd/MM/yyyy HH:mm:ss")===ze(Fs(t[i]),"dd/MM/yyyy HH:mm:ss")||(r.push(i),n[i]=t[i])}),{_UPDATEDCOLUMNS:r,_OLDROWVALUE:n}},ys=e=>{try{if(e){let t=new Date(e);return!(!isNaN(t)&&t<new Date("1900/01/01"))&&!isNaN(t)}return!1}catch(e){return!1}},Bs=(e,t,i)=>{const r=t.map(t=>e[t]??"").join("_");return""===r.replace(/^_+|_+$/g,"").trim()?`__row_${i}`:r},Cs=(e,t,i)=>i.every(i=>e[i]===t[i]),xs=(e,t,i)=>i.filter(i=>{if(e[i]!==t[i]&&("object"!=typeof t[i]&&"object"!=typeof e[i]&&"string"!=typeof t[i]||!ys(t[i])||!ys(e[i])||ze(new Date(t[i]),"dd/MM/yyyy HH:mm:ss")!==ze(new Date(e[i]),"dd/MM/yyyy HH:mm:ss")))return i}),Fs=(e,t=!1,i=[])=>{if("object"==typeof e)return e;const r=i.length?i:ws;for(const t of r){const i=je(e,t,new Date);if(!isNaN(i.getTime()))return i}return t?e:new Date(e)},Ss=(e,t,i=!0,r=!1)=>{const n=gs(t,!0),a=n?.find(t=>{const i=e?.indexOf(t.href);if(-1===i)return!1;const r=e[i+t.length];return void 0===r||"/"===r||""===r});if(!a)return"";const{label:s,system_code:o,user_code:l}=a,h="en"===qe.language?`${s}`:qe.t(o,{defaultValue:s});if(!i)return h;const c=r?l?.trim():o?.trim();return c?`${h} (${c})`:h},Ns=e=>getComputedStyle(document.documentElement).getPropertyValue(e).trim(),Es=(e,t)=>{if("Enter"!==e.key)return;const i=e.target;if("option"===i.getAttribute("role")||i.classList.contains("MuiMenuItem-root")||i.classList.contains("MuiAutocomplete-option")){const r="true"===i.closest('[role="listbox"]')?.getAttribute("aria-multiselectable");return e.preventDefault(),e.stopPropagation(),i.click(),void(r||requestAnimationFrame(()=>{requestAnimationFrame(()=>{ks(e.shiftKey,t,i,!0)})}))}e.preventDefault(),e.stopPropagation(),ks(e.shiftKey,t,i)},ks=(e,t,i,r)=>{let n;clearTimeout(n);const a=[];if(t)a.push(...Array.from(document.querySelectorAll(`[data-scope-id="${t}"]`)));else{const e=i.closest("[data-scope-id], form, div[tabindex]");a.push(e||i)}if(0===a.length)return;const s=[];if(a.forEach(e=>{if(!e)return;const t=Array.from(e.querySelectorAll('\n button:not([tabindex="-1"]),\n [href]:not([href^="javascript:"]),\n input:not([type="hidden"]),\n select,\n textarea,\n [tabindex]:not([tabindex="-1"]),\n .MuiTab-root,\n .MuiSelect-select,\n [role="combobox"]\n ')).filter(e=>{const t=getComputedStyle(e);return!(e.hasAttribute("disabled")||"true"===e.getAttribute("aria-disabled")||e.hasAttribute("readonly")||"none"===t.display||"hidden"===t.visibility||e.classList.contains("MuiTableSortLabel-root")||e.getAttribute("data-testid")?.includes("sentinel"))});s.push(...t)}),0===s.length)return;let o=i;if("option"===i.getAttribute("role")){const e=i.closest('[role="listbox"]')?.id;if(e){const t=document.querySelector(`[aria-controls="${e}"]`);t&&(o=t)}}else"combobox"===i.getAttribute("role")&&(o=i);s.includes(o)||(o=document.activeElement);let l=s.indexOf(o);-1===l&&(l=e?s.length-1:-1);let h=e?l>0?l-1:s.length-1:l<s.length-1?l+1:0;r&&!e&&(h=h<s.length-1?h+1:0);const c=s[h];c?n=setTimeout(()=>{c.focus(),"numeric"===c.getAttribute("inputmode")&&c?.select()},0):console.warn("No next element to focus (normal)")};var Ts=Object.freeze({__proto__:null,ChangeJsonValue:(e,t)=>Array.isArray(e)?e.map(e=>{let i=e;return Object.keys(e).forEach(r=>{if(Boolean(t[r])){let n=e[r];if("object"==typeof t[r])i["_NEW_"+r]=Boolean(t[r][n])?t[r][n]:n;else if("function"==typeof t[r]){let e=t[r](n,r);i["_NEW_"+r]=Boolean(e)?e:n}else i["_NEW_"+r]=n}}),i}):e,GetAllChieldMenuData:gs,GetMaxCdForDetails:As,GetMaxDisplaySequenceCd:(e,t)=>{if(Array.isArray(e)){if(!Boolean(t))return e.length+1;let i=0;return e.forEach((e,r)=>{if(void 0!==e[t]){let{_hidden:r}=e;(void 0===r||"boolean"==typeof r&&!Boolean(r))&&parseFloat(e[t])>i&&(i=parseFloat(e[t]))}else i<r+1&&(i=r+1)}),i+1}return 1},ValidatePassword:e=>Boolean(e)?/(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*\W)(?!.*\s)/.test(e)?e.length<8||e.length>16?"EnterPasswordValid":"":"EnterPasswordPolicy":"PasswordisRequired",base64toBlob:ps,blobToFile:(e,t)=>{var i=e;return i.lastModifiedDate=new Date,i.name=t,e},convertBlobToBase64:fs,generateUUID:()=>{var e=(new Date).getTime(),t="undefined"!=typeof performance&&performance.now&&1e3*performance.now()||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(i){var r=16*Math.random();return e>0?(r=(e+r)%16|0,e=Math.floor(e/16)):(r=(t+r)%16|0,t=Math.floor(t/16)),("x"===i?r:3&r|8).toString(16)})},getAuthorizeTokenText:(e,t)=>"bearer"===t?"Bearer "+e:"basic"===t?"Basic "+e:"Bearer "+e,getCssVariable:Ns,getCurrentDateinLong:()=>(new Date).getTime(),getDependetFieldDataArrayField:e=>{let t={};for(const i in e)if(e.hasOwnProperty(i)){const r=i.split(".");t[r[r.length-1]]=e[i]}return t},getDynamicLabel:Ss,getMetadataLabelFromColumnName:(e,t)=>{if(!Boolean(e)||!Boolean(t)||!Array.isArray(t))return{};let i={};for(const r of e?.fields??[])t.includes(r.name)&&(i[r.name]=r.label);return i},getPadAccountNumber:(e,t)=>e?.trim()?.padStart(t?.PADDING_NUMBER??6,"0").padEnd(20," "),getParsedDate:Fs,handleEnterToFocus:Es,isValidDate:ys,isValidDateStrict:bs,moveToNextField:ks,transformBlobData:e=>Array.isArray(e)?e.map(e=>{let t={};return t.id=L(e.ID),t.blob=ps(e.BLOB,"pdf"===e.FILEEXT?"application/pdf":""),t.fileExt=e.FILEEXT,t.name=e.NAME?.includes(".")??1?e.NAME:e.NAME+"."+t.fileExt,t._mimeType="pdf"===t.fileExt?"pdf":"jpg"===t.fileExt||"png"===t.fileExt||"jpeg"===t.fileExt?"image":"other",t.sizeStr=t.blob?.size??1e3,t}):e,transformDetailDataForDML:(e,t,i)=>{const r={isNewRow:[],isUpdatedRow:[],isDeleteRow:[]};if(!i?.length)return console.warn("transformDetailDataForDML third argument expected at least one valid key to compare!"),r;const n=new Map(e.map((e,t)=>[Bs(e,i,t),e])),a=new Map(t.map((e,t)=>[Bs(e,i,t),e]));for(const[e,t]of a){const a=n.get(e);if(a){if(Cs(a,t,i)){const e=xs(a,t,Object.keys(t));if(e.length>0){const i={};for(const t of e)t in a&&(i[t]=a[t]);const n={...t,_OLDROWVALUE:i,_UPDATEDCOLUMNS:e};r.isUpdatedRow.push(n)}}}else r.isNewRow.push(t)}for(const[e,t]of n)a.has(e)||r.isDeleteRow.push(t);return r},transformDetailsData:vs,uncompressApiResponse:e=>{const t=atob(e),i=new Uint8Array(t.split("").map(e=>e.charCodeAt(0))),r=We.inflate(i,{to:"string"});return JSON.parse(r)}});const Ls=({onSubmit:e,readOnly:t=!1})=>{const i=a(Ya),r=R(Pa(i.formName)),n=_(l((e,t)=>{const r=e(za(i.formName)),n=e(Ga(i.formName));for(const e of r)t(Ra(e),M);for(const e of n)t(qa(e),M);t(Ga(i.formName),M),t(za(i.formName),M),t(Ma(i.formName),M),t(Oa(i.formName),M),t(Pa(i.formName),M)},[i.formName]));h(()=>()=>n(),[n]);const s=_(l((e,t,r)=>{const n=e(za(i.formName));if(n){for(const e of n){const n=e.replace(`${i.formName}/`,"");let a="object"==typeof r?ka(r,n,""):"";t(Ra(e),e=>({...e,touched:!1,value:a,error:"",validationRunning:!1,incomingMessage:null})),t(Pa(i?.formName),e=>({...e,validationRunning:!1}))}const a=e(Ga(i.formName));if(a)for(const e of a)t(qa(e),e=>({...e,resetFlag:!0}))}},[i.formName])),o=_(l((e,t)=>{t(Pa(i.formName),e=>({...e,isSubmitting:!0,submitAttempt:e.submitAttempt+1}))},[i.formName]));h(()=>{Boolean(t)&&o()},[o,t]);const c=_(l((e,t,r=!1,n="",a="")=>{"string"!=typeof n&&(n=""),t(Pa(i.formName),e=>({...e,isSubmitting:!1,submitSuccessful:r,serverSentError:n,serverSentErrorDetail:a}))},[i.formName])),d=_(l((e,t,r={})=>{for(const e of Object.entries(r)){const[r,n]=e;t(Ra(`${i.formName}/${r}`),e=>({...e,error:n}))}},[i.formName])),u=_(l((e,t,r)=>{r?.preventDefault?.();const n=e(za(i.formName));if(n)for(const e of n)t(Ra(e),e=>({...e,touched:!1,value:"",error:"",validationRunning:!1})),t(Pa(i?.formName),e=>({...e,validationRunning:!1}));const a=e(Ga(i.formName));if(a)for(const e of a)t(qa(e),e=>({...e,resetFlag:!1,templateFieldRows:[],lastInsertIndex:-1}))},[i.formName])),A=l(e=>{e.preventDefault(),"object"==typeof i.initialValues&&Object.keys(i.initialValues).length>0?s(i.initialValues):u(null)},[s,u,i.initialValues]),p=_(l((e,t,r)=>{for(const e of r)t(Ra(`${i.formName}/${e}`),e=>({...e,touched:!1,value:"",error:"",validationRunning:!1})),t(Pa(i?.formName),e=>({...e,validationRunning:!1}));const n=e(Ga(i.formName));if(n)for(const e of n)t(qa(e),e=>({...e,resetFlag:!1,templateFieldRows:[],lastInsertIndex:-1}))},[i.formName])),f=_(l((e,t,r)=>e(Xa({formName:i.formName,fields:r}))??{},[i.formName])),m=l(e=>{if("object"==typeof i.initialValues&&Object.keys(i.initialValues).length>0){let t={};for(const r of e){const e=ka(i.initialValues,r,null);Boolean(e)&&(t=Ta(t,r,e))}Object.keys(t).length>0?s(t):p(e)}},[i.initialValues,p,s]),g=async(e,t,r,n=!1)=>{const a=t(Ra(e));if(a){if(a?.ignoreInSubmit)return null;if(!0===a?.excluded)return Boolean(a?.error)?null:{...a};const t={...a};let s=null;if(!t.touched||t.validationRunning){const a="function"==typeof t.validate?t.validate:e=>({error:e.error});try{const e=f(t.dependentFields);s=await Promise.resolve(a(t,e,{...i.formState,isSubmitting:n}))}catch(e){s={error:e.message,apiResult:null}}const o={...t,validationRunning:!1,touched:!0,error:s.error,validationAPIResult:s.apiResult};return r(Ra(e),o),r(Pa(i?.formName),e=>({...e,validationRunning:!1})),o}return t}return null},w=_(l((e,t,r)=>(async r=>{let n=!1;for(const a of r){let r=await g(`${i.formName}/${a}`,e,t);null!==r&&(!1===n&&(n=Boolean(r.error)))}return n})(r),[i.formName])),b=(e,t,r)=>{const n=(e=>{const t=`tabform-main-tab-${e}`,i=document.getElementById(t);if(!i)return[];const r=i.querySelectorAll('[id^="tabform-sub-tab-"]');return Array.from(r).map(e=>({id:e.id,value:Number(e.getAttribute("value")),label:e.innerText||e.textContent,hasError:"red"===e.style.color}))})(i.formName)?.find(e=>e?.hasError)||{};if(!I(n)){const e=n?.id?.split("-")||[];if(e?.length>=4){const t=e?.[3],i=e?.[4];i!==t&&document.getElementById(n.id)?.click()}}const a=document.getElementById(e);if(a){let e;a.style.scrollMarginBottom="50px",a.scrollIntoView({behavior:"smooth",block:"end"}),clearTimeout(e),e=setTimeout(()=>{a.focus(),"autocomplete"!==t&&"select"!==t||r||(a.click(),a.dispatchEvent(new KeyboardEvent("keydown",{key:"ArrowDown",code:"ArrowDown",keyCode:40,which:40,bubbles:!0})))},800)}},v=l(e=>Number(e.match(/\[(\d+)\]/)?.[1]),[]),y=_(l(async(t,r,n,a="action",s=!0,l=null)=>{let h=null,u={};return n.preventDefault(),o(),await(async()=>{const n=t(za(i.formName));if(n){const o=[];let A=!1;for(const e of n){let i=await g(e,t,r,!0);null!==i&&(!1===A&&(A=Boolean(i.error)),i.error&&(u[e]=i.error),o.push(i))}if(A)for(const e of o.filter(e=>e?.error)){if("function"==typeof i.setCurrentStepIndexFnRef){const t=v(e.name);null==t||isNaN(t)||i.setCurrentStepIndexFnRef(t)}setTimeout(()=>{document.getElementById(e?.fieldKey)&&b(e?.fieldKey,e?.componentType||"",e?.readOnly)},0);break}if(A&&s)c(!1);else if("function"==typeof e){let t={},r={};for(const e of o){let n=e.value;n instanceof Date&&(n=ys(n)?k(n,"iii LLL dd yyyy HH:mm:ss xxxx"):n),t=Ta(t,e.name.replace(`${i.formName}/`,""),n),r=Ta(r,e.name.replace(`${i.formName}/`,""),e.displayValue)}h={data:t,displayData:r,actionFlag:a,hasError:A,optionalData:l,errorFields:u},e(t,r,c,d,a,A,l,u)}}})(),h},[i.formName])),B=_(l(async(e,t)=>{const r=e(za(i.formName));let n={};if(r){const a=[];for(const i of r){let r=await g(i,e,t);null!==r&&a.push(r)}for(const e of a){let t=e.value;t instanceof Date&&(t=k(t,"iii LLL dd yyyy HH:mm:ss xxxx")),n=Ta(n,e.name.replace(`${i.formName}/`,""),t)}}return n},[i.formName])),C=_(l((e,t,r={})=>{for(const e of Object.entries(r)){const[r,n]=e;t(Ra(`${i.formName}/${r}`),e=>({...e,value:n}))}},[i.formName]));return{handleSubmit:y,handleSubmitPartial:w,handleReset:A,handleResetPartial:m,handleClear:u,handleClearPartial:p,getFieldData:B,setFieldData:C,...r}},Is=({arrayFieldName:e,template:t,shouldExclude:i,dependentFields:r,getFixedRowsCount:n})=>{const s=a(Ya);let c=o(Object.keys(t));const d=z(Pa(s.formName)),[u,A]=j(qa(`${s.formName}/${e}`)),p=o(u);p.current=u;const f=V(Wa(s.formName)),m=V(Ja(s.formName)),g=V(Ka(s.formName)),w=_(l((e,t,{fieldName:i})=>{t(Ha(s.formName),i)},[s.formName])),b=_(l((e,t,i)=>e(Ga(s.formName)).includes(i),[s.formName,Wa])),v=z(Xa({formName:"function"==typeof i||"function"==typeof n?s.formName:`${s.formName}-NOTEXIST`,fields:r})),y=_(l((e,t,i)=>{const r=[];for(let e=0;e<i.length;e++){let n=Object.keys(i[e]?.cells);for(let a=0;a<n.length;a++){const o=i[e].cells[n[a]].key;t(Ra(`${s.formName}/${o}`),M),r.push(`${s.formName}/${o}`)}}const n=e(za(s.formName)).filter(e=>!r.includes(e));t(za(s.formName),n)},[s.formName])),B=o(null);h(()=>{if("function"==typeof i){const e=Promise.resolve(i({},v,s.formState));B.current=e,e.then(t=>{e===B.current&&(!0===t&&!1===u.excluded?(A(e=>({...e,excluded:!0})),y(u.templateFieldRows)):!1===t&&!0===u.excluded&&A(e=>({...e,excluded:!1})))})}}),h(()=>{if("function"==typeof n&&!1===u.excluded){let e=n(u,v,s.formState);if(e<0&&(e=0),u.templateFieldRows.length!==e){let t=e-u.templateFieldRows.length;if(t>0){let e=u.templateFieldRows.length,i=u.templateFieldRows,r=u.lastInsertIndex;for(;t>0;){let n=x(e,i,r,c.current);i=n?.newRows,r=n?.lastIndex??-1,e++,t--}Array.isArray(i)&&A(e=>({...e,lastInsertIndex:r,templateFieldRows:i}))}else{let e=u.templateFieldRows.length+t,i=u.templateFieldRows.slice(0,e),r=u.templateFieldRows.slice(e);y(r),A(e=>({...e,templateFieldRows:i,lastInsertIndex:e.lastInsertIndex}))}}}});const C=_(l((e,t,i)=>{const r=[];for(let e=0;e<i.length;e++){let t=Object.keys(i[e]?.cells);for(let n=0;n<t.length;n++){const a=i[e].cells[t[n]].key;r.push(`${s.formName}/${a}`)}}let n={};for(let t=0;t<r.length;t++){const i=e(Ra(r[t]));if(i){if(!0===i.excluded)continue;n=Ta(n,i.name.replace(`${s.formName}/`,""),i.value)}}return n},[s.formName])),x=l((t,i,r,n)=>{if(t>=0&&t<=i.length){const a=++r;let o={cells:{},fieldIndexKey:`${s.formName}/${e}/${a}`};for(const i of n){const r=`${e}[${a}].${i}`,n=`${e}[${t}].${i}`;o.cells[i]={key:r,name:n}}const l=i.slice(0,t),h=i.slice(t);let c=t+1;for(let t of h){for(const i of n)t.cells[i].name=`${e}[${c}].${i}`;c++}return{newRows:[...l,o,...h],lastIndex:a}}},[e,s.formName]),F=l(t=>{if(t>=0&&t<p.current.templateFieldRows.length){let i=t;const r=p.current.templateFieldRows[t],n=p.current.templateFieldRows.slice(0,i),a=p.current.templateFieldRows.slice(i+1);for(let t of a){for(const r of c.current??[])t.cells[r].name=`${e}[${i}].${r}`;i++}A(e=>({...e,templateFieldRows:[...n,...a],lastInsertIndex:e.lastInsertIndex}));for(const e of Object.values(r.cells))e.key.indexOf(`${s.formName}/`)>-1?(g(e.key),w({fieldName:e.key})):(g(`${s.formName}/${e.key}`),w({fieldName:`${s.formName}/${e.key}`}));for(const e of c.current){const t=r.cells[e].key,i=`${s.formName}/${t}`;s.lastValidationValue.current.delete(i),s.flagRef.current.delete(i)}}},[A,g,e,s.formName,w]),S=l(t=>{const i=ka(t,e);if(void 0!==i&&Array.isArray(i)){let e=-1,t=[];for(let r=0;r<i.length;r++){const i=x(t.length,t,e,c.current);void 0!==i&&(e=i.lastIndex,Array.isArray(i.newRows)&&(t=i.newRows))}A(i=>({...i,resetFlag:!1,templateFieldRows:t,lastInsertIndex:e}))}else A(e=>({...e,resetFlag:!1,templateFieldRows:[],lastInsertIndex:-1}))},[e,A,x]);h(()=>{if(b(`${s.formName}/${e}`)||(f(`${s.formName}/${e}`),"object"==typeof s.initialValues&&S(s.initialValues)),!0===Boolean(s.resetFieldOnUnmount))return()=>{m(`${s.formName}/${e}`)}},[f,m,s.formName,e,s.resetFieldOnUnmount,s.initialValues,S,b]),h(()=>{!0===u.resetFlag&&"object"==typeof s.initialValues&&Object.keys(s.initialValues).length>0&&S(s.initialValues)},[u.resetFlag,S,s.initialValues]);const N=l(e=>p.current.templateFieldRows.map((t,i)=>e({row:t,fields:c.current?.slice?.()??[],rowIndex:i,removeFn:F,totalRows:p.current.templateFieldRows.length})),[F]),E=l(()=>{A(e=>({...e,resetFlag:!1,templateFieldRows:[],lastInsertIndex:-1}))},[A]),k=l(e=>{const t=x(e,p.current.templateFieldRows,p.current.lastInsertIndex,c.current);void 0!==t&&Array.isArray(t.newRows)&&A(e=>({...e,lastInsertIndex:t.lastIndex,templateFieldRows:t.newRows}))},[A,x]),T=l(()=>{const e=x(p.current.templateFieldRows.length,p.current.templateFieldRows,p.current.lastInsertIndex,c.current);void 0!==e&&A(t=>({...t,lastInsertIndex:e.lastIndex,templateFieldRows:e.newRows}))},[A,x]),L=l(()=>{const e=x(0,p.current.templateFieldRows,p.current.lastInsertIndex,c.current);void 0!==e&&Array.isArray(e.newRows)&&A(t=>({...t,lastInsertIndex:e.lastIndex,templateFieldRows:e.newRows}))},[A,x]),I=l(()=>{F(p.current.templateFieldRows.length-1)},[F]),D=l((e,t)=>{if(e>=0&&e<p.current.templateFieldRows.length&&t>=0&&t<p.current.templateFieldRows.length&&e!==t){const i=p.current.templateFieldRows.slice(0),r=i[e],n=i[t];for(const e of c.current??[]){const t=r.cells[e].name;r.cells[e].name=n.cells[e].name,n.cells[e].name=t}const a=i[t];i[t]=i[e],i[e]=a,A(e=>({...e,templateFieldRows:i,lastInsertIndex:e.lastInsertIndex}))}},[A]),U=l((t,i)=>{if(t>=0&&t<p.current.templateFieldRows.length&&i>=0&&i<p.current.templateFieldRows.length&&t!==i){const[r,n]=t<i?[t,i]:[i,t],a=p.current.templateFieldRows.slice(0,r),s=p.current.templateFieldRows.slice(n+1),o=p.current.templateFieldRows.slice(r,n+1);if(t<i){let r=o.slice(0,1)[0],n=o.slice(1),l=t;for(let t of n){for(const i of c.current??[])t.cells[i].name=`${e}[${l}].${i}`;l++}for(const t of c.current??[])r.cells[t].name=`${e}[${i}].${t}`;A(e=>({...e,templateFieldRows:[...a,...n,r,...s],lastInsertIndex:e.lastInsertIndex}))}else{let t=o.slice(0,o.length-1),r=o.slice(o.length-1)[0],n=i+1;for(let i of t){for(const t of c.current??[])i.cells[t].name=`${e}[${n}].${t}`;n++}for(const t of c.current??[])r.cells[t].name=`${e}[${i}].${t}`;A(e=>({...e,templateFieldRows:[...a,r,...t,...s],lastInsertIndex:e.lastInsertIndex}))}}},[A,e]),P=l(()=>C(p.current.templateFieldRows),[C]);return{fieldRows:u,templateFieldNames:c.current,clearFieldArray:E,getAllRowsValues:P,unshift:L,push:T,insert:k,pop:I,remove:F,swap:D,move:U,renderRows:N,excluded:u.excluded,isSubmitting:d.isSubmitting,formState:s.formState,formName:s.formName}},Ds=e=>()=>e,Us=(e,t,i,r="",n="")=>{let a=((e,t)=>{for(const i of e)if(i[0]instanceof RegExp&&i[0].test(t))return{found:!0,defaultFn:i[1]};return{found:!1,defaultFn:void 0}})(t,r);if(a.found)if("getFixedRowsCount"!==n||isNaN(Number(e))){if("true"===e)i.push([r,"BOOLEAN_FUNCTION_TO_ATTACH_FOR_BOOLEAN_VALUES",n,Ds(!0)]);else if("false"===e)i.push([r,"BOOLEAN_FUNCTION_TO_ATTACH_FOR_BOOLEAN_VALUES",n,Ds(!1)]);else if("boolean"==typeof e)i.push([r,"BOOLEAN_FUNCTION_TO_ATTACH_FOR_BOOLEAN_VALUES",n,Ds(e)]);else if("object"==typeof e)i.push([r,"RULES_ENGINE_FUNCTION_TO_ATTACH_AS_DEFAULT_FN",n,Fa(e)]);else if("string"==typeof e)if("function"==typeof a.defaultFn){let t=a.defaultFn(r);"function"==typeof t?i.push([r,e,n,t]):i.push([r,e,n,void 0])}else i.push([r,e,n,void 0])}else i.push([r,"NUMBERIC_FUNCTION_TO_ATTACH_FOR_FIXED_ROW_COUNT",n,(s=e,()=>Number(s))]);var s},Ps=(e,t,i,r,n="",a="")=>{if("object"==typeof e&&null!==e)if(r.indexOf(a)>-1)Us(e,t,i,n,a);else for(const[a,s]of Object.entries(e)){const e=Boolean(n)?`${n}.${a}`:`${a}`;Ps(s,t,i,r,e,a)}else Array.isArray(e)?e.forEach((e,a)=>{const s=Boolean(n)?`${n}.${a}`:`${a}`;Ps(e,t,i,r,s,a)}):Us(e,t,i,n,a)},Rs=(e,t,i,r=[])=>{const n=[];Ps(e,i,n,r);let a={...e};for(const e of n){if("setColor"===e[2]){const i=t.getFn(e[1],e[3]);a=i===e[3]?e[1].indexOf("FUNCTION_TO_ATTACH")>=0?Ta(a,e[0],""):Ta(a,e[0],e[1]):Ta(a,e[0],i)}else{const i=t.getFn(e[1],e[3]);a=Ta(a,e[0],i)}if(["options","leftOptions","rightOptions"].indexOf(`${e[2]}`)>=0){const t=e[0].split(".");a=Ta(a,[...t.slice(0,t.length-1),`_${e[2]}Key`].join("."),e[1])}else{const i=t.getFn(e[1],e[3]);a=Ta(a,e[0],i)}}return a},Os=(e,t)=>{let i=Ms(e.fields,t);return{form:Hs(e.form,t),fields:i}},Qs=(e,t)=>{let i=e.columns.map(e=>Hs(e,t));return{...e,columns:i}},Hs=(e,t)=>{const{__VIEW__:i,__EDIT__:r,__NEW__:n,...a}=e;let s=a;return"new"===t?s=S({},a,n):"edit"===t?s=S({},a,r):"view"===t&&(s=S({},a,i)),s},Ms=(e,t)=>Array.isArray(e)?e.map(e=>{const{__VIEW__:i,__EDIT__:r,__NEW__:n,...a}=e;try{if("arrayField"===a.render.componentType||"arrayFieldStepper"===a.render.componentType){let e=Ms(a._fields,t);a._fields=e}else if("dataTable"===a.render.componentType){let e=Ms(a._column,t);a._column=e}}catch(t){console.log(e)}let s=a;return"new"===t?s=S({},a,n):"edit"===t?s=S({},a,r):"view"===t&&(s=S({},a,i)),s}):e,_s=e=>{if("object"==typeof e){const t=Object.keys(e);let i=!0;return 0!==t.length&&(t.forEach(t=>{if(Boolean(e[t]))return i=!1,!1}),i)}return!1},js=(e,t)=>{if("object"==typeof e&&"object"==typeof t){let i=N(e);return Object.keys(t).forEach(e=>{t[e]||(i[e]="")}),i}return e},zs=e=>Array.isArray(e)?e.map((e,t)=>({id:t+1,...e})):e,Vs=(e,t)=>e.reduce((e,i)=>((e[i[t]]=e[i[t]]||[]).push(i),e),{}),Ks=(e,t="",i="error")=>({error_msg:e,severity:i,error_detail:t}),qs=(e,t)=>Array.isArray(e)?e.map(e=>Boolean(e?._hidden)?e:Boolean(t[e?.TRN_TYPE])?(e?.DISPLAY_MSG!==t[e?.TRN_TYPE]?.DISPLAY_MSG&&(e._isTouchedCol={...e._isTouchedCol,DISPLAY_MSG:!0},e._oldData={...e?._oldData,DISPLAY_MSG:Js(e?.DISPLAY_MSG)},e.DISPLAY_MSG=Js(t[e?.TRN_TYPE]?.DISPLAY_MSG)),e?.DISPLAY_MSG_BN!==t[e?.TRN_TYPE]?.DISPLAY_MSG_BN&&(e._isTouchedCol={...e._isTouchedCol,DISPLAY_MSG_BN:!0},e._oldData={...e?._oldData,DISPLAY_MSG_BN:Js(e?.DISPLAY_MSG_BN)},e.DISPLAY_MSG_BN=Js(t[e?.TRN_TYPE]?.DISPLAY_MSG_BN)),e):e):e,Gs=e=>{let t=[],i=[],r=[];return Array.isArray(e)&&e.forEach(e=>{let{_isNewRow:n,_hidden:a,_isTouchedCol:s,_oldData:o,...l}=e;if(Boolean(n))Boolean(a)||t.push(l);else if(Boolean(a))i.push(l);else if(Boolean(s)){let t=!1,i=N(l),n={},a=Object.keys(s),h=[];a.forEach(i=>{e?._isTouchedCol?.[i]&&(t=!0,n[i]=o?.[i]??"",h.push(i))}),t&&r.push({...i,_UPDATEDCOLUMNS:h,_OLDROWVALUE:n})}}),{isNewRow:t,isDeleteRow:i,isUpdatedRow:r}},Ws=(e,...t)=>{if("object"==typeof e){let i={};return t.forEach(t=>{i[t]=e[t]}),i}return e},Js=e=>e.split("").map(function(e,t,i){var r=e.charCodeAt(0).toString(16).toUpperCase();return r.length>2?"\\u"+(3===r.length?"0"+r:r):e}).join(""),Xs=(e,t)=>{let i=[],r=[],n=[];return Array.isArray(e)||(e=[e]),Array.isArray(t)||(t=[t]),e.forEach(e=>{const{SR_CD:r,...a}=e,s=t.find(e=>e.SR_CD===r);if(s){if(s){const e=s;for(const t in e)e.hasOwnProperty(t)&&"boolean"==typeof e[t]&&(e[t]=e[t]?"Y":"N")}let t=vs(e,s);t?._UPDATEDCOLUMNS?.length>0&&(e={...e,...t},n.push(e))}else i.push(a)}),t.forEach(t=>{const{SR_CD:i,...n}=t;e.find(e=>e.SR_CD===i)||r.push(t)}),{isNewRow:i,isDeleteRow:r,isUpdatedRow:n}},Ys=({title:e="sheet1",data:t})=>{const i=it.json_to_sheet(t),r=it.book_new();r.Props={Title:e,Author:"Acute",CreatedDate:new Date},r.SheetNames.push(e),r.Sheets[e]=i,rt(r,`${e}.xlsx`)},$s=({title:e="sheet1",data:t})=>{const i=it.json_to_sheet(t),r=it.book_new();r.Props={Title:e,Author:"Acute",CreatedDate:new Date},r.SheetNames.push(e),r.Sheets[e]=i,rt(r,`${e}.csv`,{bookType:"csv"})},Zs=vi(ct)(({})=>({background:"var(--primary-bg)",color:"#fff",fontWeight:700,minWidth:"64px",marginLeft:"5px",letterSpacing:"0.02857em",textTransform:"capitalize",transition:".25s ease","&:hover":{background:"var(--primary-bg)",opacity:"0.75",boxShadow:"rgba(0, 0, 0, 0.2) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px"},"&:disabled":{color:"#eee !important",opacity:"0.65 !important"}})),eo=c(({starticon:i,endicon:r,rotateIcon:n,sx:s,textColor:l,elevate:c,enableShortcut:u=!0,children:A,onClick:p,disabled:f,shortcut:m,eventKey:g,...w},b)=>{const v=i?Xi[i]:null,y=r?Xi[r]:null,[B,C]=d(!1),x=o(null),F=a(Ya),S=R(Pa(F.formName));h(()=>{S.validationRunning&&C(!1)},[S.validationRunning]),h(()=>{if(!m||f)return;const e=m.toLowerCase(),t=t=>{switch(e){case"alt":return t.altKey;case"ctrl":case"control":return t.ctrlKey;case"shift":return t.shiftKey;case"meta":return t.metaKey;default:return!1}},i=e=>{if(!(()=>{if(!x.current)return!1;const e=document.querySelectorAll('[role="dialog"]');return!e.length||e[e.length-1].contains(x.current)})())return;const i=t(e),r=e.key?.toLowerCase()===g?.toLowerCase();if(i&&r)return x.current?.focus(),e.preventDefault(),void setTimeout(()=>{x.current?.click()},0);i&&C(!0)},r=e=>{t(e)&&"Escape"!==e.key||" "===e.key||"Enter"===e.key||(e.preventDefault(),C(!1))},n=()=>{C(!1)};return window.addEventListener("keydown",i),window.addEventListener("keyup",r),window.addEventListener("blur",n),()=>{window.removeEventListener("keydown",i),window.removeEventListener("keyup",r),window.removeEventListener("blur",n)}},[m,f,g]);return t(Zs,{sx:{color:l,position:"relative","&:hover":{"& .MuiSvgIcon-root":{transform:n,transition:"transform 2s ease-in-out"}},boxShadow:c?"2px 2px 4px rgba(0,0,0,.2)":"none",...s},className:"gradient-btn",ref:e=>{x.current=e,b&&("function"==typeof b?b(e):b.current=e)},startIcon:v?e(v,{}):null,endIcon:y?e(y,{}):null,onClick:p,disabled:f,title:m&&g?`${m}+${g?.toUpperCase()}`:void 0,...w,children:[B&&m&&e(X,{style:{position:"absolute",top:"-4px",right:"-5px",background:"#ff0",color:"var(--theme-color1)",fontSize:"12px",width:"17px",height:"17px",borderRadius:"100%",zIndex:99,boxShadow:"0 1px 4px rgba(0,0,0,.2)",textAlign:"center",lineHeight:"18px",fontWeight:"bolder"},children:g?.toUpperCase()}),A]})});eo.displayName="GradientButton";const to=({errorMsg:r,errorDetail:n,...a})=>{const[s,o]=d(!1),{t:l}=W();return t(i,{children:[e(nt,{...a,action:Boolean(n)?e(Y,{color:"secondary",onClick:()=>o(e=>!e),children:l(s?"ShowLess":"ShowMore")}):null,style:{background:"white"},children:e("span",{style:{fontWeight:"bold",color:"red"},children:r})}),t($,{open:s,fullWidth:!1,onKeyUp:e=>{"Escape"===e.key&&o(!1)},children:[e(Z,{children:l("ErrorDetails")}),e(ee,{children:e(te,{children:n})}),e(ie,{children:e(eo,{onClick:()=>o(!1),children:l("Ok")})})]})]})};function io(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===i&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}io(".waviy-loading-text{position:relative}.waviy-loading-text span{animation:flip 2s infinite;animation-delay:calc(.2s*var(--i));display:inline-block;font-size:.9rem;font-weight:400;position:relative;text-transform:uppercase}@keyframes flip{0%,80%{transform:rotateY(1turn)}}.waviy-loading-text-1{--i:1}");const ro=({i:e})=>({"--i":e}),no=({text:t="Loading"})=>{const i=Boolean(t)?t:"Loading";return e("div",{className:"waviy-loading-text",children:[...i].map((t,i)=>e("span",{style:ro({i:i+1}),children:t},"span"+i))})},ao=({open:i,closeDialog:r,gridData:n,fileName:a})=>{const[s,o]=d(!1),[l,h]=d(""),{t:c}=W(),u=()=>{r()},A=e=>{o(!0),h("");try{"excel"===e.toLowerCase()?Ys({data:n,title:a}):"csv"===e.toLowerCase()&&$s({data:n,title:a})}catch(e){h(String(e))}setTimeout(()=>{o(!1),u()},1e3)};return t($,{open:i,maxWidth:"sm",children:[e(Z,{children:c("Whichformatdoyouwanttodownload")}),e(ee,{children:s?e(no,{text:"Exporting..."},"loaderforExporting"):Boolean(l)?e(to,{severity:"error",errorMsg:l}):null}),t(ie,{children:[e(Y,{onClick:()=>{A("Excel")},color:"secondary",disabled:s,children:c("Excel")}),e(Y,{onClick:()=>{A("CSV")},color:"secondary",disabled:s,children:c("CSV")}),e(Y,{onClick:u,color:"secondary",disabled:s,children:c("Cancel")})]})]})},so=({title:e="sheet1",data:t})=>{let i=tt.read(t.blob,{type:"base64",raw:!0}),r=[];return i?.SheetNames?.length>0?(i?.SheetNames.forEach(e=>{let t=tt.utils.sheet_to_json(i.Sheets[e],{defval:"",raw:!1});t.forEach(e=>{for(let t in e){const i=Fs(e[t],!0);e[t]=i instanceof Date&&Ve(i)?i.toLocaleDateString("en-UK"):i}}),r=[...r,...t]}),r):[]},oo=e=>Array.isArray(e)?e.map(e=>{const{alignment:t,...i}=e;switch(t){case"right":return{...i,cellHeaderAlignment:"0 10px 0 0 !important",TableCellProps:{align:"right"}};case"center":return{...i,TableCellProps:{align:"center",sx:{justifyContent:"center"}}};case"left":return{...i,TableCellProps:{align:"left"}};default:return i}}):[],lo=Ci({root:{"&:focus-within":{border:"1px solid rgba(25, 118, 210, 0.5)"},borderLeft:"0.5px solid #BABABA",borderRight:"0.5px solid #BABABA"}}),ho=({children:r,showBorder:n,positionRelative:a,...s})=>{const{value:o,cell:l,column:{color:h="initial",TableCellProps:c,isVisibleField:d=e=>!0,pinColumn:u,sequence:A},row:p,pinnedOffsets:f,visibleColumns:m}=s,g=f?.leftMap?.[l.column.id],w=f?.rightMap?.[l.column.id],b=m?.filter(e=>"left"===e.pinColumn),v=m?.filter(e=>"right"===e.pinColumn),y=b?.[b.length-1]?.id,B=v?.[0]?.id,x=l.column.id===y,F=l.column.id===B,S=lo();let N="function"==typeof h?h(o,p):h,E=r,k=d(p?.original);return l?.isGrouped?E=t(i,{children:[e(C,{...p.getToggleRowExpandedProps([{style:{padding:0}}]),children:p.isExpanded?e(vr,{}):e(br,{})}),r,t("i",{children:["(",p.subRows.length,")"]})]}):l?.isPlaceholder&&(E=null),e(ci,{component:"div",variant:"head",className:n?S.root:"",...l.getCellProps([{...c??{}},{style:{background:"inherit",display:"flex",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"0px 10px",lineHeight:"28px",color:N,position:u?"sticky":a?"relative":"static",..."left"===u&&{position:"sticky",left:g??0,...x&&{borderRight:"1px solid #ccc"}},..."right"===u&&{position:"sticky",right:w??0,...F&&{borderLeft:"1px solid #ccc"}}}}]),children:k?E:null})},co=t=>{const{value:i,column:{showTooltip:r=!1,transform:n=e=>e,isAutoSequence:a=!1,tooltipPlacement:o="bottom-start",customTooltipValue:l},row:h,data:c}=t;let d,{original:{_isNewRow:u}}=h;d=a?Boolean(h?.original?._displaySequence)?h?.original?._displaySequence:Boolean(u)?c.reduce((e,{_hidden:t})=>Boolean(t)?e:e+1,0):Number(h?.index??0)+1:n(i);const A=s(()=>{let e;return"string"==typeof l?e=h?.original?.[l]:"function"==typeof l&&(e=l(h?.original)),e},[h,l]);let p=r?e(Ii,{title:A??d,placement:o,children:e("span",{children:d})}):d;return e(ho,{...t,children:p})},uo=e=>Array.isArray(e)?e.map(e=>{const{componentType:t,...i}=e;return{...i,Cell:ma.getFn(t,co)}}):[],Ao=xi({root:{"&:has(.Mui-readOnly),&:has(.Mui-disabled),&:has(input[readonly]),&:has(textarea[readonly]:nth-child(1))":{"& input, & textarea":{color:"rgba(0, 0, 0, 0.75)",WebkitTextFillColor:"rgba(0, 0, 0, 0.75)"},"& label":{pointerEvents:"none",color:"rgba(0, 0, 0, 0.5)"}},"&.hasOldValue":{"& .MuiInputBase-root":{border:"1px solid var(--old-value-text-primary) !important"},"& input, & textarea, & .MuiSelect-select, & .MuiAutocomplete-inputRoot, & .MuiInputBase-root":{backgroundColor:"var(--old-value-bg-primary) !important",color:"var(--old-value-text-primary) !important",WebkitTextFillColor:"var(--old-value-text-primary) !important",borderRadius:"4.5px",fontWeight:500},"& label":{color:"var(--old-value-text-primary) !important"}},"& .MuiFormHelperText-root":{marginTop:"1px","& .MuiFormHelperText-root:last-child":{margin:"1px 8px 0 0 !important"}},"& .MuiSelect-select.Mui-disabled":{WebkitTextFillColor:"rgba(0, 0, 0, 0.75)"},"& .MuiInputLabel-formControl":{padding:"2px 0px 7px 0px",fontWeight:600,textTransform:"capitalize",fontSize:"0.875rem",whiteSpace:"normal",lineHeight:"0.875","@media (max-width: 1200px)":{fontSize:"0.75rem"},"@media (max-width: 1440px)":{fontSize:"0.875rem"}},"& .MuiInputLabel-shrink":{transform:"translate(0, 1.5px) scale(1)"},"& label.Mui-focused":{color:"var(--theme-color1)"},"& .MuiInputBase-root":{border:"1px solid #BABABA",marginTop:"26px",borderRadius:5,backgroundColor:"#fff","& .MuiInputAdornment-root .MuiButtonBase-root":{marginRight:0},"& input":{padding:"5px 6px",height:"22px","&::placeholder":{},"@media (max-width: 1200px)":{height:"18px"}},"& .MuiInputBase-inputMultiline":{padding:"5px 6px"},"& .MuiInputBase-input":{padding:"5px 6px"}},"& .MuiInputBase-root.Mui-disabled":{"& input[type='password'] + .MuiInputAdornment-root":{display:"none"}},"& .Mui-error:after":{transform:"scaleX(1) !important",borderBottom:"3px solid var(--theme-color1)"},"& .MuiInput-underline:before":{borderBottom:"0"},"& .MuiInput-underline:after":{borderBottom:"3px solid var(--theme-color1)",transition:"transform 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms"},"&:hover .MuiInput-underline:before":{borderBottom:"0"},"& .MuiInputAdornment-positionStart":{borderRight:"1px solid #BABABA",height:"30px",maxHeight:"36px",padding:"0 1rem"},"& .withBorder.MuiInputAdornment-positionEnd":{borderLeft:"1px solid #BABABA",height:"30px",maxHeight:"36px",padding:"0 1rem"},"& .MuiSelect-selectMenu":{minHeight:"22px",lineHeight:"22px","@media (max-width: 1200px)":{minHeight:"18px",lineHeight:"18px"}}}})(_t),po=xi({root:{"& .MuiInputLabel-formControl":{fontWeight:600,textTransform:"capitalize",fontSize:"1rem","@media (max-width: 1200px)":{fontSize:"0.75rem"},"@media (max-width: 1440px)":{fontSize:"0.875rem"}},"& .MuiInputLabel-shrink":{transform:"translate(0, 1.5px) scale(1)"},"& label.Mui-focused":{},"& .MuiInputBase-root":{border:"1px solid #BABABA",borderRadius:5,backgroundColor:"#fff","& input":{padding:"6px 7px",height:"22px","&::placeholder":{fontSize:"0.875rem"},"@media (max-width: 1200px)":{height:"18px"}},"& inputMultiline":{padding:"6px 7px"},"& .MuiInputBase-input":{padding:"6px 7px"}},"& .MuiInput-underline:before":{borderBottom:"0"},"& .MuiInput-underline:after":{borderBottom:"3px solid #3f51b5",transition:"transform 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms"},"&:hover .MuiInput-underline:before":{borderBottom:"0"},"& .MuiInputAdornment-positionStart":{borderRight:"1px solid #BABABA",height:"36px",maxHeight:"36px",padding:"0 1rem"},"& .MuiSelect-selectMenu":{minHeight:"22px",lineHeight:"22px","@media (max-width: 1200px)":{minHeight:"18px",lineHeight:"18px"}}}})(_t),fo=xi({root:{"& .MuiInputLabel-formControl":{fontWeight:600,textTransform:"capitalize",fontSize:"1rem","@media (max-width: 1200px)":{fontSize:"0.75rem"},"@media (max-width: 1440px)":{fontSize:"0.875rem"}},"& .MuiInputLabel-shrink":{transform:"translate(0, 1.5px) scale(1)"},"& .MuiInputBase-root":{marginTop:0,border:"0px",borderLeft:"1px solid #BABABA",borderRadius:5,borderBottomLeftRadius:0,borderTopLeftRadius:0,backgroundColor:"#fff","& input":{padding:"6px 7px",height:"22px","&::placeholder":{fontSize:"0.875rem"},"@media (max-width: 1200px)":{height:"18px"}},"& inputMultiline":{padding:"6px 7px"},"& .MuiInputBase-input":{padding:"6px 7px"}},"& .MuiInput-underline:before":{borderBottom:"0"},"& .MuiInput-underline:after":{borderBottom:"3px solid var(--theme-color1)",transition:"transform 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms"},"&:hover .MuiInput-underline:before":{borderBottom:"0"},"& .MuiInputAdornment-positionStart":{borderRight:"1px solid #BABABA",height:"36px",maxHeight:"36px",padding:"0 1rem"},"& .MuiSelect-selectMenu":{minHeight:"22px",lineHeight:"22px","@media (max-width: 1200px)":{minHeight:"18px",lineHeight:"18px"}}}})(_t),mo=xi({root:{"& .MuiInputLabel-formControl":{fontWeight:600,textTransform:"capitalize",fontSize:"1rem","@media (max-width: 1200px)":{fontSize:"0.75rem"},"@media (max-width: 1440px)":{fontSize:"0.875rem"}},"& .MuiInputLabel-shrink":{transform:"translate(0, 1.5px) scale(1)"},"& label.Mui-focused":{},"& .MuiInputBase-root":{border:"1px solid #BABABA",marginTop:"26px",borderRadius:5,backgroundColor:"#fff","@media (max-width: 1200px)":{fontSize:"0.875rem"},flexWrap:"wrap","& input":{padding:"6px 7px ",width:0,minWidth:30,flexGrow:1,height:"22px","&::placeholder":{},"@media (max-width: 1200px)":{height:"18px"}},"& inputMultiline":{padding:"6px 7px"},"& .MuiInputBase-input":{padding:"6px 7px"}},"& .MuiInput-underline:before":{borderBottom:"0"},"& .MuiInput-underline:after":{borderBottom:"3px solid #3f51b5",transition:"transform 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms"},"&:hover .MuiInput-underline:before":{borderBottom:"0"},"& .MuiInputAdornment-positionStart":{borderRight:"1px solid #BABABA",height:"36px",maxHeight:"36px",padding:"0 1rem"},"& .MuiSelect-selectMenu":{minHeight:"22px",lineHeight:"22px","@media (max-width: 1200px)":{minHeight:"18px",lineHeight:"18px"}}}})(_t),go=xi({root:{color:"#0063A3",alignSelf:"center",padding:"0 9px","&$checked":{color:"var(--theme-color1)"},"&.Mui-disabled":{color:"#aaa"}},checked:{}})(ui),wo=new jt({defaultOptions:{queries:{cacheTime:36e5,refetchOnWindowFocus:!1,refetchOnMount:!1,refetchOnReconnect:!1,retry:!1}}}),bo=n({addEntry:()=>{},removeEntry:e=>{},getEntries:()=>{}}),vo=({children:t})=>{const i=o([]),r=l(e=>{i.current.findIndex(t=>t===JSON.stringify(e))<0&&i.current.push(JSON.stringify(e))},[]),n=l(e=>{let t=i.current.findIndex(t=>t===JSON.stringify(e));if(t>=0){const e=i.current.slice(0,t),r=i.current.slice(t+1);i.current=[...e,...r]}},[]),a=l(()=>i.current.map(e=>JSON.parse(e)),[]);return e(bo.Provider,{value:{addEntry:r,removeEntry:n,getEntries:a},children:t})},yo=e=>Array.isArray(e)&&e.length>0?e.sort().join("-"):"NO_CACHING_KEY_AVAILABLE",Bo=(e,t,i,r,n,s,o,l,c,d,u,A,p,f,m=void 0)=>{let g=!1,w=[];const{authState:b}=es(),{addEntry:v}=a(bo),{t:y}=W(),B=yo(Object.values("object"==typeof e&&null!==e?e:{none:!0}).filter(e=>"function"!=typeof e)),C=(()=>{if("function"==typeof c)w=c(n,e,ds(n),b);else if(d){const e=((e={})=>Object.keys(e).sort().reduce((t,i)=>(t[i]=e[i].value,t),{}))(n);w=[c,B,e]}else w=[c,B];return w})();h(()=>{d||v(C)},[v,d,C]);const x=zt(C,()=>t(n,e,ds(n),b),{retry:!1,enabled:"function"==typeof t,cacheTime:d?0:36e5,staleTime:6e5});return g=x.isLoading,h(()=>{if(void 0===t)i([{label:"No Data",value:null,disabled:!0,isDefaultOption:!0}]),g=!1;else if(Array.isArray(t))Boolean(A)||(t=[{label:Boolean(p)?y(p):y("SelectOption"),value:" ",disabled:!Boolean(f),isDefaultOption:!0},...t]),t=T.uniqBy(t,"value"),i(t),g=!1;else if("object"==typeof t){const{options:e,...r}=t;Array.isArray(e)?(i(t),Object.keys(r).length>0&&u(r)):i([{label:"Invalid Data",value:null,disabled:!0,isDefaultOption:!0}]),g=!1}else if(x.isLoading)i([{label:"loading...",value:null,disabled:!0,isDefaultOption:!0}]),g=!0;else if(x.isError)i([{label:"Couldn't fetch",value:null,disabled:!0,isDefaultOption:!0}]),console.log(`error occured while fetching data for ${C}`,x.error),g=!1;else if(Array.isArray(x.data)){let e=x.data;Boolean(A)||(e=[{label:Boolean(p)?y(p):y("SelectOption"),value:" ",disabled:!Boolean(f),isDefaultOption:!0},...e]),i(e),g=!1}else if("object"==typeof x.data){const{options:e,...t}=x.data;Array.isArray(e)?(i(e),Object.keys(t).length>0&&u(t)):i([{label:"Invalid Data",value:null,disabled:!0,isDefaultOption:!0}]),g=!1}else i([{label:"Couldn't fetch",value:null,disabled:!0,isDefaultOption:!0}]),console.log(`expected optionsFunction:${C} in select component to return array of OptionsType but got: ${x.data}`),g=!1},[y,g,x.dataUpdatedAt]),h(()=>{if(null!==s&&"object"==typeof s&&Object.keys(s).length){const{value:e,ignoreUpdate:t,GridProps:i}=s;"object"==typeof i&&"function"==typeof m&&m(i),(Boolean(e)||""===e)&&(r(e,void 0,!1,{isIncomingValue:!0},t),t||"onBlur"!==l||o({value:e,isIncomingValue:!0},!0)),u(null)}},[s,i,r,o,l]),{loadingOptions:g,queryError:x.isError,refetchOptions:x.refetch}},Co=(e,t,i,r,n,a,s,o)=>{let l=!1;const{authState:c}=es(),{t:d}=W();let u=[];u=Boolean(r)?[i,n]:[i];const A=zt(u,()=>e(n,c),{retry:!1,enabled:"function"==typeof e,cacheTime:r?0:36e5});return l=A.isLoading,h(()=>{if(void 0===e)t([{label:"No Data",value:null,disabled:!0}]),l=!1;else if(Array.isArray(e))Boolean(a)||(e=[{label:Boolean(s)?d(s):d("SelectOption"),value:"00",disabled:!Boolean(o),isDefaultOption:!0},...e]),e=T.uniqBy(e,"value"),t(e),l=!1;else if(A.isLoading)t([{label:"loading...",value:null,disabled:!0}]),l=!0;else if(A.isError)t([{label:"Couldn't fetch",value:null,disabled:!0}]),console.log(`error occured while fetching data for ${i}`,A.error),l=!1;else{if(Array.isArray(A.data)){let e=A.data;Boolean(a)||(e=[{label:Boolean(s)?d(s):d("SelectOption"),value:"00",disabled:!Boolean(o),isDefaultOption:!0},...e]),t(e)}else t([{label:"Couldn't fetch",value:null,disabled:!0}]),console.log(`expected optionsFunction:${i} in select component to return array of OptionsType but got: ${A.data}`);l=!1}},[l]),{loadingOptions:l}},xo=(e,t,i,r,n,s,o)=>{let l=!1;const{addEntry:c}=a(bo);let d=[];const{t:u}=W();d=Boolean(r)?[i,n]:[i],h(()=>{c(i)},[c]);const A=zt(d,()=>e(n),{retry:!1,enabled:"function"==typeof e,cacheTime:36e5});return l=A.isLoading,h(()=>{if(void 0===e)t([{label:"No Data",value:null,disabled:!0}]),l=!1;else if(Array.isArray(e))Boolean(s)||(e=[{label:Boolean(o)?u(o):u("SelectOption"),value:"00",disabled:!0},...e]),e=T.uniqBy(e,"value"),t(e),l=!1;else if(A.isLoading)t([{label:"loading...",value:null,disabled:!0}]),l=!0;else if(A.isError)t([{label:"Couldn't fetch",value:null,disabled:!0}]),console.log(`error occured while fetching data for ${i}`,A.error),l=!1;else{if(Array.isArray(A.data)){let e=A.data;Boolean(s)||(e=[{label:Boolean(o)?u(o):u("SelectOption"),value:"00",disabled:!0},...e]),t(e)}else t([{label:"Couldn't fetch",value:null,disabled:!0}]),console.log(`expected optionsFunction:${i} in select component to return array of OptionsType but got: ${A.data}`);l=!1}},[l]),{loadingOptions:l}},Fo=(e,t=!1)=>i=>{let r=[];return Array.isArray(i)||(i=[i]),Array.isArray(e)&&(r=e.reduce((e,t)=>(i.indexOf(t.value)>=0&&e.push(t.label),e),[])),t?r.join(","):r},So=e=>t=>{let i=[];return Array.isArray(t)||(t=[t]),Array.isArray(e)&&(i=e.reduce((e,i)=>(t.indexOf(i.value)>=0&&e.push(i),e),[])),i},No=["","one ","two ","three ","four ","five ","six ","seven ","eight ","nine ","ten ","eleven ","twelve ","thirteen ","fourteen ","fifteen ","sixteen ","seventeen ","eighteen ","nineteen "],Eo=["","","twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety"],ko=/^(\d{1})(\d{2})(\d{2})(\d{2})(\d{1})(\d{2})$/,To=e=>No[Number(e)],Lo=e=>Eo[e[0]]+" "+No[e[1]];function Io(e){const t=Number(e);if(isNaN(t))return"";if(0===t)return"zero";const i=t.toString();if(i.length>10)throw new Error("overflow");const[,r,n,a,s,o,l]=("0000000000"+i).substr(-10).match(ko);let h="";return h+=0!=r?To(r)+"hundred ":"",h+=0!=n&&""!=h?"and ":"",h+=0!=n?(To(n)||Lo(n))+"crore ":0!=r?"crore ":"",h+=0!=a?(To(a)||Lo(a))+"lakh ":"",h+=0!=s?(To(s)||Lo(s))+"thousand ":"",h+=0!=o?To(o)+"hundred ":"",h+=0!=l&&""!=h?"and ":"",h+=0!=l?To(l)||Lo(l):"",h.trim()}const Do=({options:t,MenuItemProps:i,SelectProps:r,multiple:n,showCheckbox:a,InputProps:s,inputProps:o,CircularProgressProps:h,handleBlur:c,handleChange:A,error:p,touched:f,value:m,loading:g,readOnly:w,_optionsKey:b,disableCaching:v,optionsProps:y,selectVariant:C="default",skipDefaultOption:x,defaultOptionLabel:F,defaultSpaceAdd:S=!1,InputLabelProps:N={},enableDefaultOption:E=!1,...k})=>{let T;T="andornment"===C?fo:"regular"===C?Ao:po;const[L,I]=d([]),D=Boolean(f)&&Boolean(p),{loadingOptions:U}=Co(t,I,b,v,y,x,F,E),P=l(e=>Fo(L)(e),[L]),R=l(e=>{let t=P("object"==typeof e?e?.target?.value??"":e);t=n?t:t[0],A(e,t)},[A,P,n]),O=l(e=>{let t=P("object"==typeof e?e?.target?.value??"":e);t=n?t:t[0],c(e,t)},[c,P,n]),Q=L.map((t,r)=>u(K,{...i,key:t.value??r,value:t.value,disabled:t.disabled},a?e(go,{checked:Boolean(n)?Array.isArray(m)&&m.indexOf(t.value)>=0:m===t.value}):null,t.label));return e(T,{...k,select:!0,value:n&&!Array.isArray(m)?[m]:m,error:D,helperText:D?p:S?" ":null,onChange:R,onBlur:O,SelectProps:{...r,native:!1,multiple:n,renderValue:n?Fo(L,!0):void 0},InputLabelProps:{shrink:!0,...N},InputProps:{endAdornment:g||U?e(B,{position:"end",children:e(G,{color:"secondary",size:22,sx:{marginRight:"1px"},variant:"indeterminate",...h})}):null,...s},inputProps:{readOnly:w,tabIndex:w?-1:void 0,...o},children:Q})},Uo=[{label:"startswith",value:"startsWith"},{label:"endswith",value:"endsWith"},{label:"equal",value:"equal"},{label:"contains",value:"contains"}],Po=({filterValue:i,id:r,columnName:n,gridProps:a,dispatch:s,maxLength:o,showMaxLength:l})=>{const[h,c]=d(i?.value??""),[u,A]=d(i?.condition??"equal"),{t:p}=W(),f=()=>{Boolean(h)?s({type:"setValue",payload:{condition:u,value:h,id:r,columnName:n}}):s({type:"removeValue",payload:{id:r}})};return e(q,{item:!0,xs:12,sm:6,md:6,...a,children:e(Ao,{label:n,InputLabelProps:{shrink:!0},onChange:e=>{(o!=o||e.target.value.length<=(o??20))&&c(e.target.value)},helperText:e("div",{style:{display:"flex"},children:o>0&&Boolean(l)?t(Ze,{error:!1,style:{flex:1,textAlign:"right",margin:"5px 15px 0 0"},children:[h.length,"/",o]}):null}),onBlur:f,fullWidth:!0,value:h,InputProps:{endAdornment:e(Do,{size:"small",style:{width:"50%"},touched:!0,error:"",multiple:!1,handleChange:e=>{A(e.target.value)},handleBlur:f,options:Uo.map(e=>({label:p(e.label),value:e.value})),disableCaching:!1,value:u,selectVariant:"andornment"})}})})},Ro=({options:t,MenuItemProps:i,SelectProps:r,multiple:n,showCheckbox:a,InputProps:s,inputProps:o,CircularProgressProps:h,handleBlur:c,handleChange:d,error:A,touched:p,value:f,loading:m,readOnly:g,optionsProps:w,selectVariant:b="default",loadingOptions:v,...y})=>{let C;C="andornment"===b?fo:"regular"===b?Ao:po;const x=Boolean(p)&&Boolean(A),F=l(e=>Fo(t)(e),[t]),S=l(e=>{let t=F("object"==typeof e?e?.target?.value??"":e);t=n?t:t[0],d(e,t)},[d,F,n]),N=t.map((t,r)=>u(K,{...i,key:t.value??r,value:t.value,disabled:t.disabled},a?e(go,{checked:Boolean(n)?Array.isArray(f)&&f.indexOf(t.value)>=0:f===t.value}):null,Ge(t.label)));return e(C,{...y,select:!0,value:n&&!Array.isArray(f)?[f]:f,error:x,helperText:x?A:null,onChange:S,onBlur:c,SelectProps:{...r,native:!1,multiple:n,renderValue:n?Fo(t,!0):void 0},InputLabelProps:{shrink:!0},InputProps:{endAdornment:m||v?e(B,{position:"end",children:e(G,{color:"secondary",size:22,variant:"indeterminate",...h})}):null,...s},inputProps:{readOnly:g,tabIndex:g?-1:void 0,...o},children:N})},Oo=({filterValue:t,id:i,columnName:r,filterProps:n,gridProps:a,dispatch:s})=>{const[l,h]=d(t?.value??[]),c=o(null),[u,A]=d([]),{loadingOptions:p}=xo(n?.options??[],A,n?._optionsKey??"",!1,{},!1,void 0);return e(q,{item:!0,xs:12,sm:6,md:6,...a,children:e(Ro,{label:r,showCheckbox:!0,value:l,size:"small",fullWidth:!0,touched:!0,error:"",multiple:!0,handleChange:(e,t)=>{h(e.target.value),c.current=t},handleBlur:e=>{Array.isArray(l)&&l.length>0?s({type:"setValue",payload:{condition:"in",value:l,label:c.current,id:i,columnName:r}}):s({type:"removeValue",payload:{id:i}})},options:u,loadingOptions:p,selectVariant:"regular"})})},Qo={root:{"& label.Mui-focused":{color:"var(--theme-color1)"},"& .MuiInputLabel-formControl":{fontWeight:600,textTransform:"capitalize",fontSize:"1rem","@media (max-width: 1200px)":{fontSize:"0.75rem"},"@media (max-width: 1440px)":{fontSize:"0.875rem"}},"& .MuiInputLabel-shrink":{transform:"translate(0, 1.5px) scale(1)"},"& .MuiInputBase-root":{border:"1px solid #BABABA",marginTop:"26px",borderRadius:5,backgroundColor:"#fff","@media (max-width: 1200px)":{fontSize:"0.875rem"},"& input":{padding:"6px 7px ",height:"22px","&::placeholder":{},"@media (max-width: 1200px)":{height:"18px"}},"& inputMultiline":{padding:"6px 7px"},"& .MuiInputBase-input":{padding:"6px 7px"}},"& .MuiInput-underline:before":{borderBottom:"0"},"& .MuiInput-underline:after":{borderBottom:"3px solid var(--theme-color1)",transition:"transform 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms"},"&:hover .MuiInput-underline:before":{borderBottom:"0"},"& .MuiInputAdornment-positionStart":{borderRight:"1px solid #BABABA",height:"36px",maxHeight:"36px",padding:"0 1rem"},"& .MuiSelect":{"& selectMenu":{minHeight:"22px",lineHeight:"22px","@media (max-width: 1200px)":{minHeight:"18px",lineHeight:"18px"}}}}},Ho=xi(Qo)(Mr),Mo=xi(Qo)(_r),_o=xi(Qo)(jr),jo=[{label:"All",value:"all"},{label:"Today",value:"today"},{label:"Last Week",value:"lastWeek"},{label:"Last Month",value:"lastMonth"},{label:"Custom",value:"custom"}],zo=({filterValue:r,id:n,columnName:a,gridProps:s,dispatch:o,filterProps:l})=>{const[h,c]=d(Array.isArray(r?.value)?new Date(r?.value[0])??null:new Date(r?.value)??null),[u,A]=d(Array.isArray(r?.value)?new Date(r?.value[1])??null:null),[p,f]=d(r?.option??"all");return e(q,{item:!0,xs:12,...s,sm:"custom"===p?12:6,md:"custom"===p?12:6,children:t("div",{style:{width:"100%",display:"flex"},tabIndex:1,onBlur:e=>{let t=k(new Date,"iii LLL dd yyyy HH:mm:ss xxxx"),i=k(new Date,"iii LLL dd yyyy HH:mm:ss xxxx");h instanceof Date&&!isNaN(h)&&(t=k(h,"iii LLL dd yyyy HH:mm:ss xxxx")),u instanceof Date&&!isNaN(u)&&(i=k(u,"iii LLL dd yyyy HH:mm:ss xxxx")),"today"===p?o({type:"setValue",payload:{condition:"equal",value:t,id:n,option:p,columnName:a,type:l?.type}}):("lastWeek"===p||"lastMonth"===p||"custom"===p)&&h instanceof Date&&u instanceof Date&&!isNaN(h)&&!isNaN(u)&&h<=u?o({type:"setValue",payload:{condition:"between",value:[t,i],id:n,option:p,columnName:a,type:l?.type}}):o({type:"removeValue",payload:{id:n}})},children:[e(Do,{label:a,value:p,size:"small",touched:!0,error:"",handleChange:(e,t)=>{let i=new Date;"today"===e.target.value?c(i):"lastWeek"===e.target.value?(A(i),c(Ui(i,7))):"lastMonth"===e.target.value?(A(i),c(Ui(i,30))):"all"!==e.target.value&&"custom"!==e.target.value||(c(null),A(null)),f(e.target.value)},handleBlur:()=>!0,options:jo,_optionsKey:"dateRangePicker",optionsProps:{},disableCaching:!1,selectVariant:"regular",..."custom"===p?{style:{width:"40%"}}:{fullWidth:!0}}),"custom"===p?t(i,{children:[e("span",{style:{width:"1%",textAlign:"center",marginTop:"32px"}}),e(Ho,{format:"dd/MM/yyyy",label:"From Date",onChange:c,value:h,sx:{width:"30%"},slots:{textField:Ao},slotProps:{textField:{InputLabelProps:{shrink:!0},"aria-label":"Select Date",placeholder:"Start Date"},actionBar:{actions:["today","cancel"]}}}),e("span",{style:{width:"1%",textAlign:"center",marginTop:"32px"}}),e(Ho,{format:"dd/MM/yyyy",label:"To Date",minDate:h,onChange:A,value:u,sx:{width:"30%"},slots:{textField:Ao},slotProps:{textField:{InputLabelProps:{shrink:!0},"aria-label":"Select Date",placeholder:"End Date"},actionBar:{actions:["today","cancel"]}}})]}):null]})})},Vo=xi({root:{fontWeight:600,textTransform:"capitalize",fontSize:"1rem","@media (max-width: 1200px)":{fontSize:"0.75rem"},"@media (max-width: 1440px)":{fontSize:"0.875rem"}},shrink:{transform:"translate(0, 1.5px) scale(1)"}})(Ut),Ko=xi({root:{border:"1px solid #BABABA",marginTop:"26px",borderRadius:5,backgroundColor:"#fff","@media (max-width: 1200px)":{fontSize:"0.875rem"}},multiline:{padding:"6px 7px"},input:{padding:"6px 7px ",height:"22px","&::placeholder":{},"@media (max-width: 1200px)":{height:"18px"}},underline:{"&:before":{borderBottom:"0 !important"},"&:after":{borderBottom:"3px solid var(--theme-color1)",transition:"transform 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms"}},adornedStart:{borderRight:"1px solid #BABABA",height:"36px",maxHeight:"36px",padding:"0 1rem"}})(mi),qo=({filterValue:i,id:r,columnName:n,gridProps:a,dispatch:s})=>{const[o,l]=d(Array.isArray(i?.value)?i?.value[0]??0:0),[c,u]=d(Array.isArray(i?.value)?i?.value[1]??0:0),[A,p]=d("");h(()=>{Number(o)>Number(c)?p("Min value is greater than max"):p("")},[o,c]);return e(q,{item:!0,xs:12,sm:6,md:6,...a,children:t($e,{fullWidth:!0,error:Boolean(A),tabIndex:1,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(!isNaN(Number(o))&&!isNaN(Number(c))&&o<=c?s({type:"setValue",payload:{condition:"between",value:[o,c],id:r,columnName:n}}):s({type:"removeValue",payload:{id:r}}))},sx:{"& label.Mui-focused":{color:"var(--theme-color1)"}},children:[e(Vo,{shrink:!0,children:n}),t("div",{style:{display:"flex",width:"100%",justifyContent:"space-between"},children:[e(Ko,{style:{width:"45%"},placeholder:"min",value:o,onChange:e=>{isNaN(Number(e.target.value))||l(e.target.value)}}),e(Ko,{style:{width:"45%"},placeholder:"max",value:c,onChange:e=>{isNaN(Number(e.target.value))||u(e.target.value)}})]}),Boolean(A)?e(Ze,{children:A}):null]})})},Go=({filterValue:i,id:r,columnName:n,gridProps:a,dispatch:s,filterProps:o})=>{const{t:l}=W(),[c,u]=d(Array.isArray(i?.value)?i?.value[0]:null),[A,p]=d(Array.isArray(i?.value)?i?.value[1]:null),[f,m]=d("");h(()=>{Number(c)>Number(A)&&A?.length>0?m("Min value is greater than max"):m("")},[c,A]);return e(q,{item:!0,xs:12,sm:6,md:6,...a,children:t($e,{fullWidth:!0,error:Boolean(f),tabIndex:1,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(!isNaN(Number(c))&&!isNaN(Number(A))&&c?.length&&A?.length&&Number(c)<=Number(A)?s({type:"setValue",payload:{condition:"between",value:[c,A],id:r,columnName:n,type:o.type}}):s({type:"removeValue",payload:{id:r}}))},sx:{"& label.Mui-focused":{color:"var(--theme-color1)"}},children:[e(Vo,{shrink:!0,sx:{fontSize:"0.875rem !important"},children:l(n)}),t("div",{style:{display:"flex",width:"100%",justifyContent:"space-between"},children:[e(Ht,{thousandSeparator:!0,thousandsGroupStyle:"lakh",allowNegative:!1,allowLeadingZeros:!1,decimalScale:2,fixedDecimalScale:!0,value:c,customInput:Ao,placeholder:"Min",onValueChange:e=>{isNaN(Number(e.value))||u(String(e.value))},style:{width:"48%"}}),e(Ht,{thousandSeparator:!0,thousandsGroupStyle:"lakh",allowNegative:!1,allowLeadingZeros:!1,decimalScale:2,fixedDecimalScale:!0,value:A,customInput:Ao,placeholder:"Max",onValueChange:e=>{isNaN(Number(e.value))||p(String(e.value))},style:{width:"48%"}})]}),Boolean(f)?e(Ze,{children:f}):null]})})},Wo=xi({tooltip:{backgroundColor:"var(--theme-color1)",color:"#fff",boxShadow:"0 3px 6px rgba(0,0,0,0.46)",fontSize:11,borderBottom:"1px solid var(--theme-color1)"},arrow:{fontSize:16,width:17,"&::before":{border:"1px solid #fff",backgroundColor:"var(--theme-color1)",boxSizing:"border-box"}}})(Ii),Jo=vi(({className:t,...i})=>e(Ii,{...i,arrow:!0,classes:{popper:t}}))(()=>({[`& .${Di.tooltip}`]:{backgroundColor:"#ffffff",color:"#1a1a1a",maxWidth:280,fontSize:"0.95rem",fontFamily:'"Segoe UI", Roboto, sans-serif',border:"1px solid #e0e0e0",borderRadius:"10px",boxShadow:"0 6px 16px rgba(0, 0, 0, 0.15)",padding:"12px 16px",marginTop:"0.75rem",transition:"opacity 0.3s ease, transform 0.3s ease",transform:"scale(1)"},[`& .${Di.arrow}`]:{color:"#ffffff","&::before":{boxShadow:"-1px -1px 2px rgba(0,0,0,0.05)"}}})),Xo=({label:i="",value:r=""})=>t("div",{children:[t("strong",{className:"old_value_tooltip_label",style:{fontWeight:600,display:"flex",alignItems:"center"},children:["🕓  ",i]}),e("h4",{className:"old_value_tooltip_value",style:{marginTop:4,fontStyle:"italic",color:"var(--theme-color1)"},children:Array.isArray(r)&&"string"==typeof r[0]?r.join(","):r})]}),Yo={ALL:"Lek",AFN:"؋",ARS:"$",AWG:"ƒ",AUD:"$",AZN:"₼",BSD:"$",BBD:"$",BYN:"Br",BZD:"BZ$",BMD:"$",BOB:"$b",BAM:"KM",BWP:"P",BGN:"лв",BRL:"R$",BND:"$",KHR:"៛",BDT:"৳",CAD:"$",KYD:"$",CLP:"$",CNY:"¥",COP:"$",CRC:"₡",HRK:"kn",CUP:"₱",CZK:"Kč",DKK:"kr",DOP:"RD$",XCD:"$",EGP:"£",SVC:"$",EUR:"€",FKP:"£",GIP:"£",GTQ:"Q",GGP:"£",GYD:"$",HNL:"L",HKD:"$",HUF:"Ft",INR:"₹",IDR:"Rp",IRR:"﷼",IMP:"£",ILS:"₪",JMD:"J$",JPY:"¥",JEP:"£",KZT:"лв",KPW:"₩",KRW:"₩",KGS:"лв",LAK:"₭",LBP:"£",LRD:"$",MKD:"ден",MYR:"RM",MUR:"₨",MXN:"$",MNT:"₮",MZN:"MT",NAD:"$",ANG:"ƒ",NZD:"$",NIO:"C$",NGN:"₦",NOK:"kr",OMR:"﷼",PKR:"₨",PAB:"B/.",PYG:"Gs",PEN:"S/.",PHP:"₱",PLN:"zł",ZAR:"R",AED:"د.إ",CHF:"Fr.",GBP:"£",RUB:"₽",SEK:"kr",TRY:"₺",USD:"$",VND:"₫",ZWL:"Z$",BTN:"Nu.",BYR:"Br",CVE:"€",DJF:"Fdj",DZD:"دج",ERN:"Nfk",FJD:"$",GEL:"₾",GHS:"¢",ISK:"kr",KWD:"د.ك",LKR:"₨",LYD:"ل.د",MDL:"L",MVR:"ރ",MWK:"MK",NPR:"₨",RSD:"din.",SAR:"ر.س",SCR:"₨",SYP:"£",TND:"د.ت",TTD:"TT$",TWD:"NT$",UGX:"Ush",YER:"﷼",ZMW:"K",XOF:"CFA",XAF:"FCFA",TZS:"TSh",SZL:"L",STN:"Db",SSP:"£",SOS:"Sh.So.",SLL:"Le",ETB:"ብር",MMK:"Ks.",BLANK:""};function $o(e,t=!0){return Yo[e]??(t?e:void 0)}var Zo=A(({name:i,validate:r,validationRun:n,postValidationSetCrossFieldValues:a,runValidationOnDependentFieldsChange:c,runPostValidationHookAlways:A,shouldExclude:p,isReadOnly:f,dependentFields:m,fieldKey:g,GridProps:w,CircularProgressProps:b,enableGrid:v,enableNumWords:y,InputProps:C,inputProps:x,StartAdornment:F,EndAdornment:S,isFieldFocused:N,maxLength:E=-1,setValueOnDependentFieldsChange:k,setValueOnDependentFieldsValueChange:T,skipValueUpdateFromCrossFieldWhenReadOnly:L,setColor:I,showMaxLength:D=!0,startsIcon:U,endsIcon:P,iconStyle:R,textFieldStyle:O,txtTransform:Q,AlwaysRunPostValidationSetCrossFieldValues:H,ignoreInSubmit:M=!1,label:_,setFieldLabel:j,preventSpecialChars:z,placeholder:V,handleKeyDown:K,runExternalFunction:W,onFormDataChange:X,runPostValidationForInitValue:Y,className:$,componentType:Z,isCurrencyField:ee,dependentFieldDebounceDelay:te=300,allowEmojiIcons:ie=!1,...re})=>{const[ne,ae]=d(w),[se,oe]=d(void 0),{authState:le}=es(),he=ns(),{value:ce,prevValue:de,error:ue,touched:Ae,handleChange:pe,handleBlur:fe,isSubmitting:me,validationRunning:ge,fieldKey:we,name:be,excluded:ve,readOnly:ye,incomingMessage:Be,whenToRunValidation:Ce,runValidation:xe,validationAPIResult:Fe,dependentValues:Se,setErrorAsCB:Ne,setIgnoreInSubmit:Ee,formState:ke,initialValues:Te,setIncomingMessage:Le}=as({name:i,fieldKey:g,dependentFields:m,validate:r,validationRun:n,runPostValidationHookAlways:A,postValidationSetCrossFieldValues:a,isReadOnly:f,shouldExclude:p,runValidationOnDependentFieldsChange:c,skipValueUpdateFromCrossFieldWhenReadOnly:L,txtTransform:Q,AlwaysRunPostValidationSetCrossFieldValues:H,runExternalFunction:W,onFormDataChange:X,runPostValidationForInitValue:Y,componentType:Z,dependentFieldDebounceDelay:te,isCurrencyField:ee}),[Ie,De]=d("string"==typeof I?I:""),Ue=o(),Pe=o();h(()=>{if("function"==typeof I){const e=I(ce,ds(Se),ke);De("string"!=typeof e?"":e)}},[ce,Se,I]),h(()=>{(async()=>{if(F)if("function"==typeof F){const e=await F(ds(Se),ke,Te,he);oe(ee?$o(e||he.dynamicAmountSymbol):e)}else oe(e=>e??F)})()},[F,Se,ke,Te]);const Re=l(e=>{const t=e.target,i=t.selectionStart;if(/(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff]|[°¯╯ツಠ益ಥಥರೃσ♥ ̄︶ ̄-ノ人ψωー゚~﹃~\︿])/g.test(e.target.value)&&!ie)return;const r="function"==typeof z?z():z;r&&e.target.value&&r.split("").some(t=>e.target.value.includes(t))||(pe(e,e.target?.formattedValue??void 0),requestAnimationFrame(()=>{t.selectionStart=t.selectionEnd=i}))},[pe]),Oe=l(e=>{pe(e)},[pe]);h(()=>{N&&Qe()},[N,ce]);const Qe=()=>{setTimeout(()=>{Ue?.current?.focus?.(),Boolean(Ue?.current)||Pe?.current?.children?.[1]?.lastChild?.select?.()},50)},He=s(()=>{const e=ds(Se),t=us(e);return JSON.stringify(t.sort((e,t)=>e.fieldKey.localeCompare(t.fieldKey)).map(e=>e.value))},[Se]);h(()=>{if(!He)return;(async()=>{if("function"==typeof T)try{const e=await T(ds(Se),ke,{value:ce,isSubmitting:me});null!=e&&pe(e)}catch(e){console.error("An error occurred:",e)}})()},[He,T,pe]),h(()=>{(async()=>{if("function"==typeof k)try{let e=await k(ds(Se),ke,{value:ce,isSubmitting:me});null!=e&&pe(e)}catch(e){console.error("An error occurred:",e)}})()},[Se,pe,k]),h(()=>{if(null!==Be&&"object"==typeof Be&&Object.keys(Be).length){const{value:e,error:t,ignoreUpdate:i,isFieldFocused:r,isErrorBlank:n,GridProps:a,startAdornment:s}=Be;if("object"==typeof a){const e={...w,xs:a?.xs??w?.xs??"auto",md:a?.md??w?.md??"auto",xl:a?.xl??a?.md??w?.xl??"auto",sm:a?.sm??w?.sm??"auto",lg:a?.lg??a?.md??w?.lg??"auto"};ae(e)}if(s&&"string"==typeof s&&oe($o(s)),r&&Qe(),Boolean(e)||""===e){const t=ee&&e?String(e).includes(".")?e:Number(e).toFixed(he.decimalCount):e;pe(t,void 0,!0,{isIncomingValue:!0}),i||"onBlur"!==Ce||xe({value:t,isIncomingValue:!0},!0)}n?Ne(""):Boolean(t)&&Ne(t),Le(null)}},[Be,pe,xe,Ce,Ne]),h(()=>{if(Boolean(M))if("function"==typeof M){let e=M(ds(Se),ke,{isSubmitting:me,value:ce});Ee(e)}else Ee(M)},[M,Ee,Se,ce]);const Me=s(()=>{if("function"==typeof j)return j(ds(Se),ce)},[j,Se,ce]);if(ve)return null;let _e=ue,je=null,ze=Ae;try{if(y&&Boolean(ce)){let e=String(ce).split("."),t=Number(e[0]);t<0?(t=Math.abs(Number(t)),je=`Negative ${Io(t)} Rupees`):je=`${Io(t)} Rupees`,2===e.length&&Boolean(e[1])&&(je=`${je} and ${Io(e[1])} paise`)}}catch(e){_e="",ze=!0}C?.inputProps&&(C.inputProps={...C.inputProps,readOnly:ye,tabIndex:ye?-1:void 0});const Ve=ze&&Boolean(_e),Ke=u(Ao,{...re,key:we,id:we,className:J($,{hasOldValue:void 0!==de&&void 0!==ce&&de!==ce}),label:Me?.label?Ge(Me.label):_,placeholder:ye?"":Me?.placeholder?Ge(Me.placeholder)??"":V,autoComplete:"off",name:be,value:"string"==typeof ce?ce.trimStart():ce,error:!me&&Ve,helperText:t("div",{style:{display:"flex"},children:[e(Ze,{children:!me&&Ve?Ge(_e):Boolean(Fe)?Fe:je}),E>0&&Boolean(D)?t(Ze,{error:!1,disabled:me,style:{flex:1,textAlign:"right"},children:[ce.length,"/",E]}):null]}),FormHelperTextProps:{component:"div"},sx:{"& .MuiInputBase-root":{background:Boolean(ye||me)?"#f3f3f3 !important":""},...O},InputProps:{style:{...!me&&Boolean(Ie)?{color:Ie}:{}},endAdornment:ge?e(B,{position:"end",children:e(G,{color:"secondary",variant:"indeterminate",size:20,style:{marginRight:"8px"},...b})}):Boolean(S)?e(B,{position:"end",className:"withBorder",children:S}):null,startAdornment:"password-loader"===se&&ge?e(B,{position:"end",sx:{position:"absolute",right:"38px"},children:e(G,{color:"secondary",variant:"indeterminate",size:20,...b})}):Boolean(se)&&"password-loader"!==se?e(B,{position:"start",children:se}):null,...C},InputLabelProps:{shrink:!0},inputRef:Ue,onChange:e=>{ye||me||(-1===E||e.target.value.length<=E)&&Re(e)},inputProps:{readOnly:ye,tabIndex:ye?-1:void 0,...x},onBlur:fe,onKeyDown:e=>{const t=e.key.includes("F")&&e.key.length>1,i=e.ctrlKey||e.shiftKey;(t||i)&&"function"==typeof K&&K(e,ds(Se),le,ke,e=>Oe(e))},disabled:me||ye,ref:Pe}),qe=void 0!==de&&void 0!==ce&&de!==ce?e(Jo,{title:e(Xo,{label:`${Ge("OldValueOf")} ${Me?.label?Ge(Me.label):_}`,value:de||"(blank)"}),arrow:!0,followCursor:!0,children:Ke}):Ke;return Boolean(v)?e(q,{...ne,children:qe}):qe}),el=Object.freeze({__proto__:null,TextField:Zo,default:Zo});function tl(e,t){return t>=.1*e+1&&t<e}const il=c((t,i)=>{const{inputRef:r,onChange:n,FormatProps:a,...s}=t,{formattedValue:l,maxLength:c,maxPercent:u,...A}=a,p=o(null),[f,m]=d(!1);return h(()=>{p.current=r?.current},[r]),e(Ht,{...s,getInputRef:e=>{r&&(r.current=e),e&&(p.current=e)},onValueChange:e=>{const{formattedValue:i,value:r,floatValue:a}=e,s=p.current,o=()=>{if(s){const e=s.value.indexOf(".");s.selectionStart=s.selectionEnd=e>=0?e+1:s.value.length}};c&&(f||r.length!==c||(m(!0),setTimeout(o,0)),r.length<c&&m(!1)),u&&(!f&&tl(u,Number(a))&&(m(!0),setTimeout(o,0)),tl(u,Number(a))||m(!1)),n({target:{name:t.name,value:r,formattedValue:i}},i)},valueIsNumericString:!1,isAllowed:a?.isAllowed??(e=>{if(!c&&!u)return!0;if(c){return e.value.length<=c}return u?!(e.floatValue>u):void 0}),...A})}),rl=({FormatProps:t,formattedValue:i,isFieldFocused:r,maxLength:n,showMaxLength:a,maxPercent:s,...l})=>{const c=o(null);return h(()=>{r&&setTimeout(()=>{c?.current?.select?.()},1)},[r]),e(Zo,{...l,maxLength:n,showMaxLength:a,inputRef:c,InputProps:{inputComponent:il,inputProps:{FormatProps:{...t,formattedValue:i,maxLength:n,maxPercent:s},inputRef:c}}})},nl=({filterValue:i,id:r,columnName:n,gridProps:a,dispatch:s,filterProps:o})=>{const{t:l}=W(),{dynamicAmountSymbol:c}=ns(),[u,A]=d(Array.isArray(i?.value)?i?.value[0]:null),[p,f]=d(Array.isArray(i?.value)?i?.value[1]:null),[m,g]=d("");h(()=>{Number(u)>Number(p)&&p?.length>0?g("From Amount should be less To Amount"):g("")},[u,p]);return e(q,{item:!0,xs:12,sm:6,md:6,...a,children:t($e,{fullWidth:!0,error:Boolean(m),tabIndex:1,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(!isNaN(Number(u))&&!isNaN(Number(p))&&u?.length&&p?.length&&Number(u)<=Number(p)?s({type:"setValue",payload:{condition:"between",value:[u,p],id:r,columnName:n,type:o.type}}):s({type:"removeValue",payload:{id:r}}))},sx:{"& label.Mui-focused":{color:"var(--theme-color1)"}},children:[e(Vo,{shrink:!0,sx:{fontSize:"0.875rem !important"},children:l(n)}),t("div",{style:{display:"flex",width:"100%",justifyContent:"space-between"},children:[e(rl,{FormatProps:{thousandSeparator:!0,prefix:"",thousandsGroupStyle:"lakh",allowNegative:!1,allowLeadingZeros:!1,decimalScale:2,fixedDecimalScale:!0,placeholder:"From Amount",isAllowed:e=>!(e?.value?.length>15),value:u,onValueChange:e=>{isNaN(Number(e.value))||A(String(e.value))}},enableGrid:!1,fieldKey:"FromAmount",name:"from-amount",StartAdornment:$o(c),className:"textInputFromRight",maxLength:15,showMaxLength:!1,style:{width:"48%"}}),e(rl,{FormatProps:{thousandSeparator:!0,prefix:"",thousandsGroupStyle:"lakh",allowNegative:!1,allowLeadingZeros:!1,decimalScale:2,fixedDecimalScale:!0,placeholder:"To Amount",isAllowed:e=>!(e?.value?.length>15),value:p,onValueChange:e=>{isNaN(Number(e.value))||f(String(e.value))}},enableGrid:!1,fieldKey:"ToAmount",name:"to-amount",StartAdornment:$o(c),className:"textInputFromRight",maxLength:15,showMaxLength:!1,style:{width:"48%"}})]}),Boolean(m)?e(Ze,{children:m}):null]})})},al=t=>{const{filterProps:i}=t;return"date"===i?.type?e(zo,{...t}):"value"===i?.type?e(qo,{...t}):"number"===i?.type?e(Go,{...t}):"amount"===i?.type?e(nl,{...t}):e(q,{item:!0,md:6,sm:6,xs:12,children:"Range Component Type not set"})},sl=e=>({"data-tag-index":e,tabIndex:-1,key:e}),ol=({filterValue:t,id:i,columnName:r,gridProps:n,dispatch:a})=>{const[s,h]=d(""),[c,u]=d(t?.value??[]),[A,p]=d(-1),f=o(null),m=o(null),g=(e,t)=>{let i=A;-1===A?""===s&&"previous"===t&&(i=c.length-1):(i+="next"===t?1:-1,i<0&&(i=0),i===c.length&&(i=-1)),p(i),w(i)},w=l(e=>{-1===e?m.current.focus():f.current.querySelector(`[data-tag-index="${e}"]`).focus()},[]);let b=null;Array.isArray(c)&&c.length>0&&(b=c.map((t,i)=>e(gi,{label:t,size:"small",onDelete:()=>u([...c.slice(i,i+1),...c.slice(i+1)]),style:{margin:"4px 2px"},...sl(i)})));return e(q,{item:!0,xs:12,sm:6,md:6,...n,children:e(mo,{inputRef:m,label:r,InputLabelProps:{shrink:!0},onChange:e=>h(e.target.value),onBlur:()=>{Array.isArray(c)&&c.length>0?a({type:"setValue",payload:{condition:"in",value:c,id:i,columnName:r}}):a({type:"removeValue",payload:{id:i}})},fullWidth:!0,value:s,InputProps:{startAdornment:b,ref:f},onKeyDown:e=>{if(-1!==A&&-1===["ArrowLeft","ArrowRight"].indexOf(e.key)&&(p(-1),w(-1)),299!==e.which)switch(e.key){case"Enter":Boolean(s)&&(u(e=>[...e,s]),h(""));break;case"Backspace":if(""===s&&c.length>0){const e=-1===A?c.length-1:A,t=c.slice();t.splice(e,1),u(t)}break;case"ArrowLeft":g(0,"previous");break;case"ArrowRight":g(0,"next")}}})})},ll=e=>()=>(console.log(`no method found for options at ${e}`),[{label:"Oops error occured",value:""}]),hl=e=>Array.isArray(e)?e.map(e=>{const{filterComponentType:t,filterProps:i,...r}=e;switch(t){case"valueFilter":return{...r,Filter:Po,filterProps:i};case"multiValueFilter":return{...r,Filter:ol,filterProps:i};case"optionsFilter":{const{options:e,...t}=i;if("string"==typeof e){const i=fa.getFn(e??"NOT_EXIST_OPTIONS_FN",ll);return{...r,Filter:Oo,filterProps:{options:i,_optionsKey:e,...t}}}return{...r,Filter:Oo,filterProps:i}}case"rangeFilter":return{...r,Filter:al,filterProps:i};default:return{...r}}}):[],cl=e=>Array.isArray(e)?e.reduce((e,t)=>(!1===t.isVisible&&e.push(t.accessor),e),[]):[],dl=e=>{if(Array.isArray(e)){return e.sort((e,t)=>Number(e.sequence)<Number(t.sequence)?-1:Number(t.sequence)>Number(e.sequence)?1:0).map(({sequence:e,...t})=>t)}return[]},ul=e=>{if(Array.isArray(e)&&e.length>0){const t=e.filter(e=>!0===e.multiple),i=e.filter(e=>!1===e.multiple),r=e.filter(e=>!0===e.rowDoubleClick),n=e.filter(e=>!0===e.alwaysAvailable);return{multipleActions:t,singleActions:i,doubleClickAction:r[0]??!1,alwaysAvailableAction:n}}return{multipleActions:[],singleActions:[],alwaysAvailableAction:[],doubleClickAction:!1}},Al=(e,t,i,r,n)=>{if(!Array.isArray(e)&&Boolean(e)&&(e=[e]),n&&(e=e.filter(e=>"function"!=typeof e?.shouldExclude||!0!==e.shouldExclude(t,i))),e.length<=0||t.length<=0)return!0===r?e[0]:e;let a=e.filter(e=>"function"!=typeof e?.shouldExclude||!0!==e.shouldExclude(t.map(e=>({id:e.id,data:e.original})),i));return!0===r?a[0]:a},pl=(e,t)=>e.filter(e=>!(!e?.isNodataThenShow||0!==t)||!e?.isNodataThenShow&&t>0),fl=(e,t)=>{let i;return i=e.length>0?t.filter(t=>ml(t,e)):t,i},ml=(e,t)=>{let i=!0;return t.forEach(t=>{void 0===e[t.id]||((e,t)=>{let i=!0;if(void 0!==e)switch(t.condition){case"equal":i=(e??"").toLowerCase()===(t.value??"").toLowerCase();break;case"startsWith":i=(e??"").toLowerCase().startsWith((t.value??"").toLowerCase());break;case"endsWith":i=(e??"").toLowerCase().endsWith((t.value??"").toLowerCase());break;case"contains":i=(e??"").toLowerCase().indexOf((t.value??"").toLowerCase())>=0;break;case"in":i=t.value?.filter(t=>t===(e??""))?.length>0;break;case"between":const r=t.value;if("date"===t.type){const t=new Date(r[0]),n=new Date(r[1]),a=new Date(e);i=a>t&&a<n}else if("amount"===t.type||"number"===t.type){const t=parseFloat(r[0]),n=parseFloat(r[1]),a=parseFloat(e);i=a>t&&a<n}else i=e>r[0]&&e<r[1];break;default:i=!0}return i})(e[t.id],t.value)||(i=!1)}),i},gl=[[/^columns.*.options$/,e=>()=>(console.log(`no method found for options at ${e}`),[{label:"Oops error occured",value:""}])],[/^columns.*.validate$/,e=>()=>(console.log(`no method found for validation at ${e}`),"")]],wl=["validate"],bl={abortEarly:!1,strict:!1},vl=e=>{if(void 0===e)return;const{type:t,rules:i}=e;if(!E[t])return;if(!Array.isArray(i))return;let r=E[t]();return i.forEach(e=>{const{params:t,name:i}=e;r[i]&&(r=r[i](...t))}),yl(r)},yl=e=>async t=>{try{return await e.validate(t,bl),null}catch(e){return e instanceof E.ValidationError?Ge(e.errors[0]):e.message}},Bl=(e,t,i,r)=>async(n,a,s,o)=>{let l;if("function"==typeof e&&(l=await e(n),Boolean(l)))return l;if("function"==typeof t){const e=r?.current?await(r.current?.getFieldData()):{};if(l=await t(n,a,s,o,i,e),Boolean(l))return l}return""},Cl=({column:r,visibleColumns:n,setColumnOrder:a,allowColumnReordering:s})=>{const[{isDragging:l},h]=wt({type:"Column",collect:e=>({isDragging:!!e.isDragging()}),end:(e,t)=>{if(t.didDrop()){const{id:e}=t.getDropResult(),s=n.map(e=>e.id),o=s.indexOf(e),l=s.indexOf(r.id);var i=s[o];s[o]=s[l],s[l]=i,a(s)}},canDrag:()=>s&&!r.pinColumn}),[{isOver:c},d]=bt({accept:"Column",drop:()=>({id:r.id}),collect:e=>({isOver:s&&!r.pinColumn&&!!e.isOver()}),canDrop:()=>s&&!r.pinColumn}),u=o(null);return h(d(u)),t(i,{children:[e(zi,{active:r.isSorted,direction:r.isSortedDesc?"desc":"asc",hideSortIcon:!0,ref:u,...r.getSortByToggleProps([{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"flex",color:"var(--theme-color1)",fontSize:"1 rem",fontWeight:"600",opacity:l||c?.5:1,cursor:l?"move":"default"}}]),children:e("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r.columnName})}),r.canGroupBy?e("span",{...r.getGroupByToggleProps(),children:r.isGrouped?"🔴":"➕"}):null,r.getResizerProps&&!r.disableResizing&&e("div",{...r.getResizerProps([{style:{minHeight:"26px",opacity:1,color:"rgba(224, 224, 224, 1)",right:"-10px",display:"flex",zIndex:5,position:"absolute",flexDirection:"column",justifyContent:"center"}}]),children:e("svg",{focusable:"false",viewBox:"0 0 24 24","aria-hidden":"true","data-testid":"SeparatorIcon",style:{color:"inherit",userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:"currentColor",flexShrink:0,transition:"fill 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",fontSize:"20px"},children:e("path",{d:"M11 19V5h2v14z"})})})]})},xl=({allowToggleVisiblity:t,...i})=>{const[r,n]=d(0),a=Date.now()<r,s=o(null),[,l]=d();return h(()=>()=>clearTimeout(s.current),[]),e(Zo,{...i,type:a?"text":"password",StartAdornment:"password-loader",InputProps:{endAdornment:Boolean(t)?e(B,{position:"end",children:e(C,{"aria-label":"toggle password visibility",onClick:()=>{a?a&&n(0):(n(Date.now()+5e3),s.current=setTimeout(()=>l(Date.now()),5e3))},children:e(a?v:y,{})})}):null}})};var Fl=Object.freeze({__proto__:null,PasswordField:xl,default:xl}),Sl=Object.freeze({__proto__:null,NumberFormat:rl,NumberFormatCustom:il,default:rl});function Nl(t){const{inputRef:i,onChange:r,MaskProps:n,...a}=t,{formattedValue:s,...o}=n;return e(Li,{...a,inputRef:i,onAccept:(e,i)=>{r({target:{name:t.name,value:s?i.value:i.unmaskedValue}})},...o})}const El=({MaskProps:t,formattedValue:i,...r})=>e(Zo,{...r,InputProps:{inputComponent:Nl,inputProps:{MaskProps:{...t,formattedValue:i}}}});var kl=Object.freeze({__proto__:null,InputMask:El,InputMaskCustom:Nl,default:El});const Tl=Ci(e=>({searchRoot:{fontFamily:e.typography.fontFamily,position:"relative",boxShadow:"0px 2px 4px -1px rgba(0,0,0,0.2), 0px 4px 5px 0px rgba(0,0,0,0.14), 0px 1px 10px 0px rgba(0,0,0,0.12)",marginRight:"10px",marginLeft:e.spacing(1),marginBottom:e.spacing(.25),marginTop:e.spacing(.25),borderRadius:40,backgroundColor:e.palette.common.white,"& $inputInput":{transition:e.transitions.create("width"),width:146,"&:focus":{width:170}},"&:has(.route-search-bar)":{boxShadow:"none"}},searchRoot2:{fontFamily:e.typography.fontFamily,position:"relative",boxShadow:"0px 2px 4px -1px rgba(0,0,0,0.2), 0px 4px 5px 0px rgba(0,0,0,0.14), 0px 1px 10px 0px rgba(0,0,0,0.12)",marginRight:e.spacing(2),marginLeft:e.spacing(1),borderRadius:40,backgroundColor:yi(e.palette.common.white,.15),"&:hover":{backgroundColor:yi(e.palette.common.white,.25)}},searchError:{marginRight:e.spacing(2),marginLeft:e.spacing(6)},search:{width:e.spacing(6),height:"100%",position:"absolute",pointerEvents:"none",display:"flex",alignItems:"center",justifyContent:"center"},inputRoot:{color:"inherit",marginTop:0,borderRadius:"40px"},inputInput:{padding:e.spacing(1,1,1,6)}})),Ll=c((i,r)=>{const n=re(),a=Si(n.breakpoints.up("sm")),s=Tl(),l=o(null);return p(r,()=>({handleBlur:()=>l.current?.blur(),handleFocus:()=>l.current?.focus()})),h(()=>{Boolean(i.autoFocus)&&setTimeout(()=>{l.current?.focus?.()},1e3)},[]),t("div",{className:s.searchRoot,style:{display:a?"flex":"none"},children:[e(mi,{...i,disableUnderline:!0,inputRef:l,autoComplete:"off",classes:{root:s.inputRoot,input:s.inputInput}}),e("div",{className:s.search,children:e(Or,{sx:{color:"var(--theme-color1)"}})})]})}),Il=({helperText:i,error:r,disabled:n,...a})=>{const s=re(),l=Si(s.breakpoints.up("sm")),h=Tl(),c=o(null);return t(f,{children:[t("div",{className:h.searchRoot2,style:{display:l?"flex":"none"},children:[e(mi,{...a,disabled:n,error:r,disableUnderline:!0,inputRef:c,classes:{root:h.inputRoot,input:h.inputInput}}),e("div",{className:h.search,children:e(Or,{})})]}),Boolean(r)?e(Ze,{disabled:n,error:r,className:h.searchError,children:i}):null]})},Dl=({preGlobalFilteredRows:t,globalFilter:i,setGlobalFilter:r,searchPlaceholder:n})=>{const a=t.length,[,s]=d(i),{t:o}=W(),l=qt(e=>r(e||void 0),200);return e(Ll,{type:"text",onChange:e=>{s(e.target.value),l(e.target.value)},className:"gridwrapper_global_search",placeholder:`${o("profile.Searchin")} ${a} ${o(n)}`,color:"primary"})},Ul=xi(e=>({root:{"&.Mui-checked":{color:"var(--theme-color1)"},"&.MuiCheckbox-indeterminate":{color:e.palette.text.secondary}},checked:{}}))(ui),Pl=({row:t,cell:r,setContextMenuSelectedRowId:n,hasLeftPinnedColumn:a})=>e(i,{children:e(ci,{component:"div",variant:"head",...r.getCellProps([{style:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"0px 10px",lineHeight:"28px",...a&&{position:"sticky",left:0,zIndex:1,background:"inherit"}}}]),children:Boolean(t?.original?.__isRowSelection??!0)?e(Ul,{size:"small",...t.getToggleRowSelectedProps([{style:{padding:0}}]),onClick:e=>{t.isSelected&&n("")}}):null})}),Rl=({getToggleAllRowsSelectedProps:t,setContextMenuSelectedRowId:i,hasLeftPinnedColumn:r})=>e(ci,{component:"div",variant:"head",style:{padding:0,...r&&{position:"sticky",left:0,zIndex:1,background:"inherit"}},children:e(Ul,{size:"small",...t([{style:{padding:0}}]),onClick:()=>{i("")}})}),Ol=Ci(e=>({root:{paddingLeft:e.spacing(2),paddingRight:e.spacing(2)},highlight:"light"===e?.palette?.mode?{color:e.palette.secondary.main,backgroundColor:Bi(e.palette.secondary.light,.85)}:{color:e.palette.secondary.dark,background:e.palette.secondary.dark},title:{flex:"1"}})),Ql=({dense:i,selectedFlatRows:r,multipleActions:n,singleActions:a,setGridAction:s,submitButtonRef:o,loading:l})=>{const h=Ol(),{t:c}=W(),d=r.length,u=r.map(e=>({data:e.original,id:e.id}));return d<=0?null:("function"!=typeof s&&(s=()=>{}),t(ai,{className:J(h.root,h.highlight),variant:i?"dense":"regular",children:[t(vt,{className:h.title,color:"inherit",variant:d>0?"subtitle1":"h6",component:"div",children:[c("Selected")," ",d]}),1===d?e(Hl,{actions:a,setAction:s,selectedRows:u,buttonTextColor:"var(--theme-color1)",buttonBackground:"inherit",submitButtonRef:o,loading:l},"singleFilters"):null,d>0?e(Hl,{actions:n??[],setAction:s,selectedRows:u,buttonTextColor:"var(--theme-color1)",buttonBackground:"inherit",submitButtonRef:o,loading:l},"multipleFilters"):null]}))},Hl=({actions:t,setAction:i,selectedRows:r,buttonTextColor:n="var(--white)",buttonBackground:a="",style:s={},filteredRows:o,submitButtonRef:l,loading:h})=>{const{t:c}=W(),{defaultGridConfig:d}=ns(),u=d?.isContainedActionButton;return Array.isArray(t)&&t.length>0?t.map(t=>{const d=t.startsIcon?Xi[t.startsIcon]:null,A=t.endsIcon?Xi[t.endsIcon]:null;return e(Ii,{title:c(t.tooltip??t.actionLabel),children:e(eo,{startIcon:d?e(d,{}):null,endIcon:A?e(A,{}):null,disabled:h,sx:{marginLeft:"5px",color:t.actionTextColor??n,boxShadow:u&&!a?"2px 2px 4px rgba(0,0,0,.2)":"none",background:t.actionBackground??(Boolean(a)?a:u?"var(--primary-bg)":"inherit"),"&:hover":{background:t.actionBackground??(Boolean(a)?a:u?"var(--primary-bg)":"inherit"),opacity:.85,"& .MuiSvgIcon-root":{transform:t.rotateIcon,transition:"transform 2s ease-in-out"}}},onClick:()=>{i({name:t.actionName,rows:r,filteredRows:o})},style:{...s},ref:t?.onEnterSubmit?l:null,enableShortcut:t.enableShortcut??!0,eventKey:t.eventKey,shortcut:t.shortcut,children:c(t.actionLabel)})},t.actionName)}):null},Ml=({singleActions:t,multipleActions:r,setGridAction:n,contextMenuRow:a,selectedFlatRows:s,mouseX:o,mouseY:l,handleClose:h,authState:c})=>{const{t:d}=W(),u=s.map(e=>({data:e.original,id:e.id}));let A=null;"function"!=typeof n&&(n=()=>{});let p=[...t,...r??[]];return Array.isArray(p)&&p.length>0&&s.length<=1&&null!==a?(p=Al(p,[a],c,!1),A=p.map(t=>e(K,{onClick:()=>{n({name:t.actionName,rows:[{data:a?.original,id:a?.id}]}),h()},children:d(t.actionLabel)},t.actionName))):Array.isArray(r)&&r.length>0&&s.length>1&&null!==s&&(A=r?.map(t=>e(K,{onClick:()=>{n({name:t.actionName,rows:u}),h()},children:d(t.actionLabel)},t.actionName))),e(i,{children:null!==A&&Array.isArray(A)&&A.length>0?e(zr,{onContextMenu:e=>{e.preventDefault(),h()},open:null!==l,onClose:h,anchorReference:"anchorPosition",anchorPosition:null!==l&&null!==o?{top:l,left:o}:void 0,children:A}):null})},_l=n({resume:()=>{},pause:()=>{},attachFunction:(e,t)=>{}}),jl=({children:t})=>{let i=o(null),r=o(null),n=o(!1),a=o(!1);const s=l(()=>{Boolean(n.current)&&!Boolean(a.current)&&(i.current=setInterval(()=>{"function"==typeof r?.current&&r.current()},1e3),a.current=!0)},[]),h=l(()=>{Boolean(n.current&&Boolean(a.current))&&(clearInterval(i.current),a.current=!1)},[]);return e(_l.Provider,{value:{resume:s,pause:h,attachFunction:(e,t)=>{r.current=e,n.current=t}},children:t})},zl=()=>{const{resume:e,pause:t}=a(_l);return{resume:e,pause:t}},Vl=(e,t)=>{const[i,r]=d(0),[n,s]=d(!1),c=o(0),u=o(e);u.current=e;const{resume:A,pause:p,attachFunction:f}=a(_l),m=l(()=>{c.current=Math.min(c.current+1,t);let e=Math.floor(c.current/t*100);c.current===t&&(c.current=0),r(Math.min(e,100))},[r,t]);return h(()=>(parseInt(t)>0&&(f(m,!0),s(!0),A()),()=>{p()}),[t,m]),h(()=>{100===i&&"function"==typeof u.current&&u.current()},[i]),{intervalElapsed:Math.min(t-c.current,t),enabled:n,progress:i,resume:A,pause:p}},Kl=({value:i,variant:r,interval:n,pause:a,resume:s})=>{const[o,l]=d(!0),[h,c]=d(!1);return t("div",{style:{position:"relative",display:"inline-flex"},children:[e(G,{variant:r,value:i,size:"2rem"}),e("div",{style:{position:"absolute",top:0,left:0,bottom:0,right:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#80808042",borderRadius:"50%"},onMouseOver:()=>c(!0),onMouseOut:()=>c(!1),children:h?e(C,{onClick:()=>{o?(a(),l(!1)):(s(),l(!0))},style:{opacity:.6},children:e(o?Kr:Vr,{})}):o?e(vt,{variant:"caption",component:"div",color:"textSecondary",children:n??i}):e(C,{onClick:()=>{o?(a(),l(!1)):(s(),l(!0))},style:{opacity:.6},children:e(o?Kr:Vr,{})})})]})},ql=(e=[],t={})=>{switch(t.type){case"setValue":{const{id:i,...r}=t.payload;let n=e.findIndex(e=>e.id===i);return n>=0?(e[n].value=r,[...e]):[...e,{id:i,value:r}]}case"removeValue":{const{id:i}=t.payload;return e.filter(e=>e.id!=i)}case"resetAll":return[];default:return e}},Gl=({filters:i,setAllFilters:r,filterMeta:n,setSortBy:a,gotoPage:s,classes:c,isDefaultFilter:A=!1})=>{const[p,f]=d(!1),{filterState:m,dispatch:g}=(e=>{const t=o([]);return{dispatch:l(i=>{let r=e(t.current,i);t.current=r},[]),filterState:t}})(ql),{t:w}=W(),b=()=>{f(!1)};h(()=>{m.current=i},[i]);let v=[];return Array.isArray(n)&&(v=n.filter(e=>"function"==typeof e.Filter),v=v.map(e=>{const{Filter:t,accessor:r,...n}=e;return u(t,{key:r,filterValue:i.filter(e=>e.id===r)?.[0]?.value,id:r,dispatch:g,isDefaultFilter:A,...n})})),t(Qi,{dateAdapter:Hi,children:[e(C,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true",onClick:()=>{f(!0)},color:"primary",className:c.refreshiconhover,children:e(qr,{})}),t(Gr,{anchor:"right",id:"columnVisibility",open:p,onClose:b,sx:{zIndex:1300},PaperProps:{style:{width:"520px"}},children:[e(Ar,{position:"relative",color:"secondary",children:t(ai,{variant:"dense",children:[e(vt,{variant:"h6",children:w("Filter")}),e("div",{style:{flexGrow:1}}),e(ct,{onClick:()=>{r(m.current),a([]),s(0),f(!1)},color:"primary",children:w("Apply")}),e(ct,{onClick:()=>{m.current=[],r(m.current),a([]),s(0),f(!1)},color:"primary",children:w("Clear")}),e(ct,{onClick:b,color:"primary",children:w("Close")})]})}),e(st,{children:e(q,{container:!0,spacing:2,children:v})})]})]})},Wl=xi(e=>({root:{"& .MuiCheckbox-root":{padding:"2px 6px"},"& label":{marginBottom:0}}}))(K);xi({root:{"& .MuiInputBase-root":{border:"1px solid #BABABA",marginTop:"0 !important",borderRadius:5,backgroundColor:"#fff",padding:"0 0","& input":{padding:"4px 38px 4px 6px",marginTop:"0 !important",fontSize:"12px"}},"& .MuiInput-underline:before":{borderBottom:"0"},"& .MuiInput-underline:after":{borderBottom:"2px solid #26A456",transition:"transform 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms"},"&:hover .MuiInput-underline:before":{borderBottom:"0"},"& .MuiInputLabel-shrink":{transform:"translate(0, 1.5px) scale(1)"},"& .MuiSelect-selectMenu":{minHeight:"9px",lineHeight:"9px",fontSize:12}}})(_t),xi({root:{color:"#26A456",height:8},thumb:{height:24,width:24,backgroundColor:"#fff",border:"2px solid currentColor",marginTop:-8,marginLeft:-12,"&:focus, &:hover, &$active":{boxShadow:"inherit"}},active:{},valueLabel:{left:"calc(-50% + 4px)"},track:{height:8,borderRadius:4},rail:{height:8,borderRadius:4}})(Dt);const Jl=({visibleColumns:i,defaultHiddenColumns:r,classes:n,IconButtonStyle:a={variant:null}})=>{const[s,o]=d(null),l=Boolean(s),{t:h}=W(),c=i.reduce((t,i)=>{const{checked:n,style:a,onChange:s}=i.getToggleHiddenProps(),o=i?.isColumnHidingDisabled??!1;return-1!==r.indexOf(i.id)&&!0!==i.isTableHidden||t.push(e(Wl,{dense:!0,onChange:s,children:e(Ye,{control:e(ui,{checked:n,onChange:s,name:i.id,color:"secondary",disabled:o}),label:h(i.columnName),style:a})},i.id)),t},[]);return t("div",{children:[e(C,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true",onClick:e=>{o(e.currentTarget)},color:a.variant?a.variant:"primary",className:n.refreshiconhover,children:e(Jr,{})}),e(Xr,{id:"columnVisibility",open:l,anchorEl:s,onClose:()=>{o(null)},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:e(ni,{style:{maxHeight:216,overflow:"scroll"},children:e(Wr,{dense:!0,children:c})})})]})},Xl=Ci(e=>({root:{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),background:"var(--primary-bg)",borderTopLeftRadius:"4px",borderTopRightRadius:"4px"},title:{color:"var(--white)",letterSpacing:"1px",fontSize:"1.25rem"},refreshiconhover:{}})),Yl=c(({dense:i,label:r,preGlobalFilteredRows:n,globalFilter:a,setGlobalFilter:o,alwaysAvailableAction:l,setGridAction:h,filteredRows:c,selectedFlatRows:d,disableGlobalFilter:u,refetchData:A,autoRefreshInterval:f,gotoPage:m,setSortBy:g,allowFilter:w,filters:b,setAllFilters:v,filterMeta:y,visibleColumns:B,defaultHiddenColumns:x,allowColumnHiding:F,loading:S=!1,headerToolbarStyle:N,searchPlaceholder:E,enableExport:k,setOpenExport:T,subGridLabel:L,enablePivot:I,setOpenPivot:D,RenderSubHeader:U,subHeaderComponentProps:P},R)=>{const{defaultGridConfig:O}=ns(),{progress:Q,enabled:H,intervalElapsed:M,pause:_,resume:j}=Vl(A,f),z=Xl(),V=s(()=>d.map(e=>({data:e.original,id:e.id})),[d]);return p(R,()=>({pause:_,resume:j})),t(ai,{className:J(z.root,"static__grid__header"),variant:i?"dense":"regular",sx:{...N},children:[t(vt,{className:z.title,color:"inherit",variant:"h6",component:"div",children:[r," ",L]}),t("div",{style:{display:"flex",alignItems:"center",marginLeft:"auto"},children:[U&&P.__showInHeader?e(U,{...P}):null,w?e(Gl,{setAllFilters:v,filters:b,filterMeta:y,gotoPage:m,setSortBy:g,classes:z}):null,"function"==typeof A?e(ne,{title:Ge("Refetch"),children:e(C,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true",onClick:A,color:"primary",children:e(ki,{})})}):null,H?e(Kl,{variant:"determinate",value:Q,interval:M,pause:_,resume:j}):null,F?e(Jl,{visibleColumns:B,defaultHiddenColumns:x,classes:z}):null,u?null:e(Dl,{preGlobalFilteredRows:n,globalFilter:a,setGlobalFilter:o,searchPlaceholder:E}),I?t(eo,{disabled:S,style:{marginRight:".5rem"},onClick:()=>D(!0),children:[Ge("Pivot"),e(yr,{})]}):null,k?e(ae,{style:{cursor:S?"auto":"pointer"},control:e(ne,{title:Ge("Showexportoptions"),children:t(eo,{onClick:()=>{T(!0)},disabled:S,style:{color:"white",background:O?.isContainedActionButton?"var(--primary-bg)":"inherit",boxShadow:O?.isContainedActionButton?"2px 2px 4px 0px rgba(0,0,0,.2)":"none"},eventKey:"x",shortcut:"alt",children:[Ge("Export")," ",e(Ki,{})]})}),sx:{color:"var(--white)",margin:"0 !important"},label:""}):null,e(Hl,{selectedRows:V,setAction:h,actions:l??[],filteredRows:c,loading:S},"alwaysRender")]})]})}),$l=xi(()=>({root:{position:"sticky",zIndex:10,top:0,borderRadius:"8px",display:"block",height:"28px"}}))(li),Zl=xi(e=>({root:{background:"#fff","&:focus":{outline:"none !important",background:"#ddd"},"&$selected:focus":{outline:"none !important",background:"#ddd"},"&$hover:hover":{outline:"none !important"},"&$selected, &$selected:hover":{outline:"none !important"},"&:hover":{outline:"none !important",background:"#eee"}},selected:{background:e.palette.action.selected}}))(hi),eh=e=>"Y"===e||!0===e,th=({variant:i,column:r,rows:n=[],children:a,pinnedOffsets:o,visibleColumns:l})=>{const h=o?.leftMap?.[r.id],c=o?.rightMap?.[r.id],d=l?.filter(e=>"left"===e.pinColumn),u=l?.filter(e=>"right"===e.pinColumn),A=d?.[d.length-1]?.id,p=u?.[0]?.id,f=r.id===A,m=r.id===p,g="left"===r.pinColumn?{position:"sticky",left:h??0,zIndex:"6",...f&&{borderRight:"1px solid var(--theme-color3)"}}:"right"===r.pinColumn?{position:"sticky",right:c??0,zIndex:"6",...m&&{borderLeft:"1px solid var(--theme-color3)"}}:!0===r.sticky?{position:"sticky",zIndex:"6"}:{},{allChecked:w,someChecked:b}=s(()=>{if(0===n.length)return{allChecked:!1,someChecked:!1};const e=n.every(e=>eh(e.values[r.id])),t=n.every(e=>!eh(e.values[r.id]));return{allChecked:e,someChecked:!e&&!t}},[n,r.id]);return t(ci,{component:"div",variant:"head",sx:{padding:r?.cellHeaderAlignment||null},...r.disableSortBy?{style:{position:"relative",display:"flex",padding:"0px 10px",lineHeight:"28px",borderBottom:"standard"===i?"auto":"none",background:"inherit",backgroundColor:"inherit",zIndex:"5",...g}}:r.getHeaderProps([{style:{position:"relative",display:"flex",padding:"0px 10px",lineHeight:"28px",background:"inherit",zIndex:"5",backgroundColor:"inherit",borderBottom:"standard"===i?"auto":"none",...g}}]),children:[r?.enableColumnSelection&&e(go,{checked:w,indeterminate:b,style:{color:"var(--theme-color1)"},onChange:e=>{a?.props?.updateGridData(0,a?.props?.column?.id,e.target.checked?"Y":"N",!0,"","A")}}),a]})},ih=Ci(e=>({root:{flexShrink:0,marginLeft:e.spacing(2.5)}})),rh=i=>{const r=ih(),n=re(),{count:a,page:s,rowsPerPage:o,onPageChange:l}=i;return t("div",{className:r.root,children:[e(C,{onClick:e=>{l(e,0)},disabled:0===s,"aria-label":"first page",children:"rtl"===n.direction?e(tn,{}):e(Yr,{})}),e(C,{onClick:e=>{l(e,s-1)},disabled:0===s,"aria-label":"previous page",children:"rtl"===n.direction?e(Zr,{}):e($r,{})}),e(C,{onClick:e=>{l(e,s+1)},disabled:s>=Math.ceil(a/o)-1,"aria-label":"next Page",children:"rtl"===n.direction?e($r,{}):e(Zr,{})}),e(C,{onClick:e=>{l(e,Math.max(0,Math.ceil(a/o)-1))},disabled:s>=Math.ceil(a/o)-1,children:"rtl"===n.direction?e(Yr,{}):e(tn,{})})]})},nh=i=>{const r=ih(),n=re(),{count:a,page:s,rowsPerPage:o,onPageChange:l}=i,[h,c]=d(""),u=Math.ceil(a/o),A=0===u?0:s+1;return t("div",{className:r.root,style:{display:"flex",alignItems:"center",marginLeft:"1rem"},children:[t(X,{variant:"body2",children:["Page ",`${A} of ${u}`]}),e(C,{onClick:e=>{l(e,0)},disabled:0===s,"aria-label":"first page",children:"rtl"===n.direction?e(tn,{}):e(Yr,{})}),e(C,{onClick:e=>{l(e,s-1)},disabled:0===s,"aria-label":"previous page",children:"rtl"===n.direction?e(Zr,{}):e($r,{})}),e(Ao,{type:"number",sx:{"& .MuiInputBase-root":{marginTop:"4px !important",height:"28px",pointerEvents:"visible !important"}},value:h,onChange:e=>{c(e.target.value)},InputProps:{inputProps:{min:1,max:Math.ceil(a/o)},endAdornment:e(se,{position:"end",children:e(C,{onClick:()=>{const e=parseInt(h,10)-1;!isNaN(e)&&e>=0&&e<Math.ceil(a/o)&&(l(null,e),c(""))},disabled:isNaN(parseInt(h,10))||""===h,children:e(en,{fontSize:"small"})})})}}),e(C,{onClick:e=>{l(e,s+1)},disabled:s>=Math.ceil(a/o)-1,"aria-label":"next Page",children:"rtl"===n.direction?e($r,{}):e(Zr,{})}),e(C,{onClick:e=>{l(e,Math.max(0,Math.ceil(a/o)-1))},disabled:s>=Math.ceil(a/o)-1,children:"rtl"===n.direction?e(Yr,{}):e(tn,{})})]})},ah=Ci(()=>({root:{position:"relative",overflow:"hidden",display:"block",height:4,zIndex:0,"@media print":{colorAdjust:"exact"}}})),sh=()=>{const t=ah();return e("div",{className:t.root})},oh=xi(()=>({root:{position:"absolute",zIndex:9,backgroundColor:"rgb(0 0 0 / 0%)"}}))(rn),lh=Ci(e=>({root:{display:"flex",justifyContent:"left",flexWrap:"wrap",listStyle:"none",paddingLeft:e.spacing(2),paddingRight:e.spacing(2),margin:0},chip:{margin:e.spacing(.5)}})),hh=({dense:i,filters:r,setAllFilters:n,gotoPage:a,setSortBy:s})=>{const o=lh(),{t:l}=W();return Array.isArray(r)&&r.length<=0?null:t(ai,{component:"ul",className:o.root,variant:i?"dense":"regular",children:[e("li",{children:t(vt,{variant:"h6",color:"secondary",children:[l("AppliedFilters"),":"," "]})}),r.map(t=>e("li",{children:e(gi,{label:ch(t?.value?.condition,l(t?.value?.columnName),t?.value?.value,t?.value?.label,t?.value?.type),...Boolean(t?.value?.isDisableDelete)?null:{onDelete:()=>(e=>{let t=r.filter(t=>t.id!==e);n(t),a(0),s([])})(t?.id)},className:o.chip,variant:"outlined",color:"secondary"})},t?.id))]})},ch=(e,t,i,r,n)=>{switch(e){case"equal":return`${t} = ${"date"===n||"dateTime"===n?dh(i):i}`;case"between":return`${t} between ${"date"===n||"dateTime"===n?dh(i[0]):i[0]} and ${"date"===n||"dateTime"===n?dh(i[1]):i[1]}`;case"in":return`${t} in ${uh(i,r)}`;case"contains":return`${t} like ${i}`;case"endsWith":return`${t} ends with ${i}`;case"startsWith":return`${t} starts with ${i}`;default:return`${t}`}},dh=e=>{let t=e;return ys(e)?(t=new Date(e),!isNaN(t)&&isNaN(e)?ze(t,"dd/MM/yyyy"):e):e},uh=(e,t)=>Array.isArray(t)&&Array.isArray(e)&&e.length===t.length?JSON.stringify(t).replaceAll(/"/g," "):JSON.stringify(e).replaceAll(/"/g," "),Ah=Ci(()=>({outlinedClass:{margin:"10px 0px",borderRadius:"10px",border:"1px solid #ddd"}})),ph=c(function(t,i){return e(nn,{direction:"up",ref:i,...t})}),fh=m(()=>Promise.resolve().then(function(){return uA}).then(e=>({default:e.CheckboxGroup}))),mh=m(()=>Promise.resolve().then(function(){return uA}).then(e=>({default:e.Checkbox}))),gh=m(()=>Promise.resolve().then(function(){return KA}).then(e=>({default:e.SwitchGroup}))),wh=m(()=>Promise.resolve().then(function(){return KA}).then(e=>({default:e.Switch}))),bh=m(()=>Promise.resolve().then(function(){return JA}).then(e=>({default:e.DatePicker}))),vh=m(()=>Promise.resolve().then(function(){return JA}).then(e=>({default:e.DateTimePicker}))),yh=m(()=>Promise.resolve().then(function(){return JA}).then(e=>({default:e.TimePicker}))),Bh=m(()=>Promise.resolve().then(function(){return hp})),Ch=m(()=>Promise.resolve().then(function(){return el})),xh=m(()=>Promise.resolve().then(function(){return Uc})),Fh=m(()=>Promise.resolve().then(function(){return zA})),Sh=m(()=>Promise.resolve().then(function(){return GA})),Nh=m(()=>Promise.resolve().then(function(){return YA})),Eh=m(()=>Promise.resolve().then(function(){return ip})),kh=m(()=>Promise.resolve().then(function(){return ep})),Th=m(()=>Promise.resolve().then(function(){return Sl})),Lh=m(()=>Promise.resolve().then(function(){return Fl})),Ih=m(()=>Promise.resolve().then(function(){return kl})),Dh=m(()=>Promise.resolve().then(function(){return ap})),Uh=m(()=>Promise.resolve().then(function(){return MA}).then(e=>({default:e.ArrayField2}))),Ph=m(()=>Promise.resolve().then(function(){return MA}).then(e=>({default:e.ArrayFieldStepper}))),Rh=m(()=>Promise.resolve().then(function(){return My})),Oh=m(()=>Promise.resolve().then(function(){return jy})),Qh=m(()=>Promise.resolve().then(function(){return zy})),Hh=m(()=>Promise.resolve().then(function(){return Yy})),Mh=m(()=>Promise.resolve().then(function(){return Zy})),_h=m(()=>Promise.resolve().then(function(){return qp})),jh=m(()=>Promise.resolve().then(function(){return eB})),zh=({componentType:e})=>t("div",{children:["No Component of type: $",e]}),Vh=m(()=>Promise.resolve().then(function(){return iB})),Kh=(t,i,r,n={},a="")=>{const{render:s,schemaValidation:o,defaultValue:l,onFormButtonClickHandel:h,...c}=t;let d=null;switch(s.componentType){case"arrayField":d=Uh;break;case"arrayFieldStepper":d=Ph;break;case"textarea":d=Rh;break;case"textField":d=Ch;break;case"select":d=xh;break;case"checkbox":d=mh;break;case"checkboxGroup":d=fh;break;case"radio":d=Fh;break;case"switch":d=wh;break;case"switchGroup":d=gh;break;case"slider":d=Sh;break;case"rating":d=Nh;break;case"datePicker":d=bh;break;case"timePicker":d=yh;break;case"datetimePicker":d=vh;break;case"passwordField":d=Lh;break;case"numberFormat":d=Th;break;case"toggleButtonGroup":d=kh;break;case"inputMask":d=Ih;break;case"autocomplete":d=Dh;break;case"spacer":d=Eh;break;case"typography":d=Qh;break;case"hidden":d=Oh;break;case"transferList":d=Hh;break;case"searchField":d=Mh;break;case"visaversa":d=Bh;break;case"dataTable":d=_h;break;case"formbutton":d=jh;break;case"divider":d=Vh;break;default:d=zh}if(d===zh)return e(d,{componentType:s.componentType});if(d===Eh||d===Qh)return e(d,{...c,enableGrid:!0,GridProps:{item:!0,...c?.GridProps},fieldKey:c.name,componentType:s.componentType},`${r}/${c.name}`);if(d===jh){const e={...n[s.componentType],...c},t={...i?.gridConfig?.item,...c?.GridProps};return u(d,{...e,fieldKey:c.name,key:`${r}/${c.name}`,enableGrid:!0,GridProps:{item:!0,...t,xs:t?.xs??"auto",md:t?.md??"auto",xl:t?.xl??t?.md??"auto",sm:t?.sm??"auto",lg:t?.lg??t?.md??"auto"},onFormButtonClickHandel:h,componentType:s.componentType})}{const e={...n[s.componentType],...c},t={...i?.gridConfig?.item,...c?.GridProps};return"arrayField"!==s.componentType&&"arrayFieldStepper"!==s.componentType||(e.componentProps=n),u(d,{...e,fieldKey:c.name,key:`${r}/${c.name}`,enableGrid:!0,GridProps:{item:!0,...t,xs:t?.xs??"auto",md:t?.md??"auto",xl:t?.xl??t?.md??"auto",sm:t?.sm??"auto",lg:t?.lg??t?.md??"auto"},onFormButtonClickHandel:h,componentType:s.componentType,focusScopeId:a})}},qh=m(()=>Promise.resolve().then(function(){return nB})),Gh=m(()=>Promise.resolve().then(function(){return ip})),Wh=m(()=>Promise.resolve().then(function(){return MA}).then(e=>({default:e.ArrayFieldValues}))),Jh=m(()=>Promise.resolve().then(function(){return jy})),Xh=m(()=>Promise.resolve().then(function(){return zy})),Yh=($h=Kh,(e,t=e=>{},i=()=>{},r="")=>{const{fields:n,form:a}=e;let s={};for(const e of n){let n=-1;"object"==typeof a.render.groups&&(n=a.render.groups.hasOwnProperty(`${e.render?.group}`)?e.render?.group??-1:-1),"formbutton"!==e?.render?.componentType&&"arrayField"!==e?.render?.componentType&&"arrayFieldStepper"!==e?.render?.componentType||(e.onFormButtonClickHandel=t),e.onFormDataChange=i;const o=$h(e,a?.render,a?.name,a?.componentProps,r);let l;l=s[n],void 0===l&&(l={fields:[],sequence:[],fieldNames:[]},s[n]=l),l.fields.push(o),l.sequence.push(e?.render?.sequence??0),l.fieldNames.push(e.name)}if("sequence"===a.render.ordering){const e=Object.keys(s);for(const t of e){const e=s[t];for(let t=0;t<e.sequence.length;t++)for(let i=t+1;i<e.sequence.length;i++)if(e.sequence[t]>e.sequence[i]){const r=e.sequence[i];e.sequence[i]=e.sequence[t],e.sequence[t]=r;const n=e.fields[i];e.fields[i]=e.fields[t],e.fields[t]=n;const a=e.fieldNames[i];e.fieldNames[i]=e.fieldNames[t],e.fieldNames[t]=a}}}return s});var $h;const Zh=(e,t={},i={})=>{if(!Array.isArray(e))return{};let r={};for(const n of e){const{defaultValue:e,name:a,_fields:s}=n,o="function"==typeof e?e(t,i??{}):e;if(Array.isArray(s)){r=Ta(r,a,Zh(s,t,i))}null!=o&&(r=Ta(r,a,o))}return r},ec=e=>{if(!Array.isArray(e))return E.object().shape({});const t=e.reduce(tc,{});return E.object().shape(t)},tc=(e,t)=>{const{name:i,schemaValidation:r,render:n}=t;if("arrayField"===n.componentType||"arrayFieldStepper"===n.componentType){let r=ec(t._fields),n=E.array().of(r);return e[i]=n,e}if(void 0===r)return e;const{type:a,rules:s}=r;if(!E[a])return e;if(!Array.isArray(s))return e;let o=E[a]();return s.forEach(e=>{const{params:t,name:i}=e;o[i]&&(o=o[i](...t))}),e[i]=o,e},ic=e=>()=>(console.log(`no method found for options at ${e}`),[{label:"Oops error occured",value:""}]),rc=e=>t=>i=>(console.log(`no method found for ${e} Transform at ${t}`),i),nc=[[/^fields.*.options$/,ic],[/^fields.*.setColor$/,e=>()=>(console.log(`no method for setColorMethodNotFound found at ${e}`),"")],[/^fields.*.leftOptions$/,ic],[/^fields.*.rightOptions$/,ic],[/^fields.*.validate$/,e=>()=>(console.log(`no method found for validation at ${e}`),"")],[/^fields.*.postValidationSetCrossFieldValues$/,e=>()=>{console.log(`no method for postValidationSetCrossFieldValues found at ${e}`)}],[/^fields.*.isReadOnly$/,e=>()=>(console.log(`no method for isReadOnly found at ${e}`),!1)],[/^fields.*.shouldExclude$/,e=>()=>(console.log(`no method for shouldExclude found at ${e}`),!1)],[/^fields.*.MaskProps.prepare$/,e=>t=>(console.log(`no method for inputMaskPrepare found at ${e}`),t)],[/^fields.*.removeRowFn$/,e=>t=>{throw console.log(`no method for removeRowFn found at ${e}`),new Error("method not implemeneted")}],[/^fields.*.setValueOnDependentFieldsChange$/,e=>t=>(console.log(`no method for removeRowFn found at ${e}`),"")],[/^fields.*.getFixedRowsCount$/,e=>t=>(console.log(`no method for getFixedRowsCount found at ${e}`),0)],[/^fields.*.searchComponent$/,e=>()=>(console.log(`no method for searchComponentNotFound found at ${e}`),"Component not found")],[/^fields.*.leftTransform$/,rc("left")],[/^fields.*.rightTransform$/,rc("right")],[/^fields.*.dataTransformer$/,void 0],[/^fields.*.rowValidator$/,void 0]],ac=["validate","isReadOnly","shouldExclude","setColor","_fields","_columns"],sc=e=>Rs(e,fa,nc,ac),oc=(e,t,i=e=>e,r=null,n={},a={})=>{const{dynamicAccountNumberField:s,dynamicAmountSymbol:o,dynamicAmountGroupStyle:l,decimalCount:h,customExtendedTypes:c}=n,d={...c,...t},u=e?.fields?.map(t=>{if("arrayField"===t.render?.componentType||"arrayFieldStepper"===t.render?.componentType){let s=D({form:e.form,fields:t._fields}),o=oc(s,d,i,r,n,a);t._fields=o.fields}const s=d[t.render.componentType];if(t.options&&Array.isArray(t.options)&&(t.options=t.options.map(e=>e?.label?{...e,label:i(e?.label)}:e)),t.label=i(t.label,{nsSeparator:"|"}),t.placeholder=i(t.placeholder,{nsSeparator:"|"}),t?.addHandleKeyDownFromExtendedType&&(t.handleKeyDown=c?.accountCode?.handleKeyDown??void 0),"object"==typeof s){const{render:e,FormatProps:i,StartAdornment:r,isCurrencyField:n,...a}=s,c=Object.assign({},a,t);if(c.FormatProps={...i,...t?.FormatProps??{}},Boolean(n)||Boolean(t?.isCurrencyField)){c.isCurrencyField=!0;let e=t?.isCurrencyCode,n=t?.StartAdornment||o||r||"INR";c.StartAdornment=e?n:$o(n);let a=t?.FormatProps?.thousandsGroupStyle||l||i?.thousandsGroupStyle;c.FormatProps?c.FormatProps.thousandsGroupStyle=a??"thousand":c.FormatProps={thousandsGroupStyle:a??"lakh"};let s=t?.FormatProps?.decimalScale||h||i?.decimalScale||2;c.FormatProps.decimalScale=s}return c&&c.render&&c.render.componentType&&(c.render.componentType=s.render?.componentType),c}return t});let A=[];const p=s,f=(e,t)=>{const n=t||d[e];if("object"==typeof n){let t;n.label=i(n.label,{nsSeparator:"|"}),n.placeholder=i(n.placeholder,{nsSeparator:"|"}),"function"==typeof n?.defaultValue?t=n.defaultValue(a,r??{}):"string"==typeof n?.defaultValue&&(t=n.defaultValue.trim()),"branchCode"===e&&(n.defaultValue=null==t?r?.user?.branchCode:t),A.push(n)}};return u?.forEach(e=>{if("_accountNumber"===e.render.componentType){let t;p&&(t=p),e?.acctFieldPara&&(t=e?.acctFieldPara),p||e?.acctFieldPara||(t="separated");const i=t=>{if(Boolean(e?.[`${t}Metadata`])){const i={...d[t],...e[`${t}Metadata`]};f(t,i)}else f(t,d?.[t])};"single"===t?i("fullAccountNumber"):["branchCode","accountType","accountCode"].forEach("separated"===t?i:f)}else A=[...A,e];if("datePicker"===e.render.componentType){const t=r?.workingDate?new Date(r.workingDate):null;t&&(e?.isWorkingDate&&(e.defaultValue=t),e?.isMaxWorkingDate&&(e.maxDate=t),e?.isMinWorkingDate&&(e.minDate=t))}if("datetimePicker"===e.render.componentType||"datePicker"===e.render.componentType){const t=new Date;e?.disablePast&&(e.minDate=t),e?.disableFuture&&(e.maxDate=t)}}),{form:e.form,fields:[...A]}},lc=e=>{let{fields:t,form:i}=e;return Array.isArray(t)&&(t=t.map(e=>{const{sequence:t,render:i,...r}=e;return{...r,render:{sequence:t,...i}}})),{fields:t,form:i}},hc=Ci(e=>({title:{color:"#26A456",letterSpacing:"2px",fontSize:"1.75rem",fontWeight:700,alignSelf:"flex-start",marginBottom:"10px"},subTitle:{color:"#26A456",letterSpacing:"2px",fontSize:"1.25rem",fontWeight:700,alignSelf:"flex-start",marginBottom:e.spacing(2)},label:{color:"#736f6f",fontWeight:600,textTransform:"capitalize",fontSize:"1rem",marginBottom:"0.5 rem"},form:{width:"100%"},tabsSubmitBtn:{boxShadow:"none ",background:"#e0e0e0",marginRight:e.spacing(2),color:"#0b6fb8 ",fontSize:"1.2rem","&:hover":{color:"#e0e0e0 ",background:"linear-gradient(-90deg, rgba(94,231,131,1) 0%, rgba(74,205,159,1) 35%, rgba(33,150,218,1) 100%)",boxShadow:"none "}},submit:{margin:e.spacing(3,0,2),fontSize:"1.2rem",borderRadius:"24px"},backBtn:{boxShadow:"none ",background:"#e0e0e0",marginRight:e.spacing(2),color:"#0b6fb8 ",margin:e.spacing(3,0,2),fontSize:"1.2rem",borderRadius:"24px","&:hover":{color:"#e0e0e0 ",background:"linear-gradient(-90deg, rgba(94,231,131,1) 0%, rgba(74,205,159,1) 35%, rgba(33,150,218,1) 100%)",boxShadow:"none "}},buttonProgress:{position:"absolute",top:"50%",left:"50%",marginTop:-12,marginLeft:-12},buttonWrapper:{position:"relative"},stepper:{width:"100%",display:"flex",justifyContent:"flex-end"},stepperLabel:{display:"flex",justifyContent:"flex-start"},formControlLabelSpacer:{flexGrow:1}})),cc=(e,t,i)=>t.filter(t=>{const r=`${e}/${t}`;return!(i.indexOf(r)>=0)}).length>0,dc=(e,t,i)=>t.filter(t=>{const r=`${e}/${t}`;let n=i.indexOf(r)>=0;return!1===n&&(n=!!Boolean(i.find(e=>e.indexOf(r)>-1))),n}).length>0,uc=(e,t)=>{let i=e;for(let r=e+1;r<t.length;r++)if(!0===t[r].status){i=r;break}return i===e},Ac=({fields:i,formRenderConfig:r,formName:n,handleSubmit:a,handleSubmitPartial:s,formDisplayLabel:l,hidden:h,defaultActiveStep:c=0,wrapperChild:u,classes:A,children:p,isSubmitting:f,serverSentError:m,serverSentErrorDetail:g})=>{const w=hc(),[b,v]=d(c),{current:y}=o(Object.keys(i).sort());return t(dr,{component:"main",style:{display:h?"none":"block",paddingTop:"16px"},children:[t(ai,{variant:"dense",children:[e(vt,{component:"h3",className:w.title,children:l}),e("div",{className:A.formControlLabelSpacer}),"function"==typeof u?u({isSubmitting:f,handleSubmit:a}):u]}),!f&&Boolean(m)?e(to,{severity:"error",errorMsg:m,errorDetail:g}):null,t("div",{className:w.form,children:[e(pc,{activeStep:b,formRenderConfig:r,classes:w,fieldGroups:y,formName:n,fields:i}),e(fc,{stepsRenderer:p,fieldGroups:y,fields:i,formRenderConfig:r,activeStep:b}),e(mc,{activeStep:b,setActiveStep:v,formRenderConfig:r,classes:w,fieldGroups:y,formName:n,fields:i,handleSubmit:a,handleSubmitPartial:s})]})]})},pc=({activeStep:r,formRenderConfig:n,classes:a,fieldGroups:s,formName:o,fields:l})=>{const h="DefaultGroup",c=z(Ma(o)),d=z(Oa(o)),u=s.map(e=>{let t=h;return"object"==typeof n.groups&&(t=n.groups[e]),{index:e,name:t,status:cc(o,l[e].fieldNames,c),hasError:dc(o,l[e].fieldNames,d)}}).filter(e=>e.status);return t(i,{children:[e(an,{activeStep:r,alternativeLabel:!0,children:u.map(t=>e(sn,{children:e(on,{error:t.hasError,children:t.name})},t.name))}),e("div",{className:a.stepperLabel,children:e(vt,{component:"h4",className:a.subTitle,children:"object"==typeof n.groups?n.groups[s[r]]:h})})]})},fc=({activeStep:t,fields:i,fieldGroups:r,formRenderConfig:n,stepsRenderer:a})=>{const s=r.map((r,a)=>{const s=i[r];s.fields[0]=g(s.fields[0],{isFieldFocused:a===t});const o=a!==Number(t)?{display:"none"}:{};return e(q,{container:!0,spacing:n?.gridConfig?.container?.spacing??2,direction:n?.gridConfig?.container?.direction??"row",style:o,children:s.fields},r)});return"function"==typeof a?a({steps:s}):e(w,{fallback:e("div",{children:"Loading..."}),children:s})},mc=({activeStep:i,formName:r,fieldGroups:n,formRenderConfig:a,fields:s,handleSubmitPartial:o,handleSubmit:l,setActiveStep:h,classes:c})=>{const d=z(Ma(r)),u=z(Oa(r)),A=n.map(e=>{let t="DefaultGroup";return"object"==typeof a.groups&&(t=a.groups[e]),{index:e,name:t,status:cc(r,s[e].fieldNames,d),hasError:dc(r,s[e].fieldNames,u)}});return t("div",{className:c.stepper,children:[0===i?null:e(ct,{type:"button",onClick:()=>{if(i>0){let e=((e,t)=>{for(let i=e-1;i>=0;i--)if(!0===t[i].status)return i;return e})(i,A);h(e)}},className:c.submit,children:a?.labels?.prev??"Back"}),uc(i,A)?e(ct,{type:"button",className:c.submit,onClick:l,children:a?.labels?.complete??"Submit"}):e(ct,{type:"button",className:c.submit,onClick:async()=>{if(!uc(i,A)){const e=A[i],t=s[e.index].fieldNames;if(!await o(t)){const e=((e,t)=>{for(let i=e+1;i<t.length;i++)if(!0===t[i].status)return i;return e})(i,A);h(e)}}},children:a?.labels?.next??"Next"})]})},gc=({fields:t,formRenderConfig:i,children:r})=>{const n=o(Object.keys(t).sort()).current.map(e=>t[e].fields).reduce((e,t)=>[...e,...t],[]);return"function"==typeof r?r({fieldsToRender:n,spacing:i?.gridConfig?.container?.spacing??2,direction:i?.gridConfig?.container?.direction??"row"}):e(q,{container:!0,spacing:i?.gridConfig?.container?.spacing??2,direction:i?.gridConfig?.container?.direction??"row",children:e(w,{fallback:e("div",{children:"Loading..."}),children:n})})},wc=({fields:i,formRenderConfig:r,formName:n,formStyle:a,hidden:s,formDisplayLabel:o,displayMode:l,hideDisplayModeInTitle:h,wrapperChild:c,serverSentError:d,serverSentErrorDetail:u,isSubmitting:A,classes:p,handleSubmit:f,controlsAtBottom:m,hideHeader:g,containerstyle:b={},subHeaderLabel:v,subHeaderLabelStyle:y,formHeaderStyle:B,validationRunning:C})=>t(dr,{component:"main",style:{display:s?"none":"block",...b},children:[g?null:e(vc,{formDisplayLabel:o,displayMode:l,hideDisplayModeInTitle:h,wrapperChild:c,serverSentError:d,serverSentErrorDetail:u,isSubmitting:A,classes:p,handleSubmit:f,controlsAtBottom:m,subHeaderLabel:v,subHeaderLabelStyle:y,formHeaderStyle:B,validationRunning:C}),t(oe,{sx:{paddingTop:"10px",...a},children:[e(gc,{fields:i,formRenderConfig:r,formName:n,children:({spacing:t,direction:i,fieldsToRender:r})=>e("div",{className:"form-fields-container",children:e(q,{container:!0,spacing:t,direction:i,children:e(w,{fallback:e("div",{children:"Loading..."}),children:r})})})},`${n}-simple`),m&&e(bc,{wrapperChild:c,isSubmitting:A,handleSubmit:f,classes:p,validationRunning:C})]})]}),bc=({wrapperChild:i,isSubmitting:r,handleSubmit:n,classes:a,validationRunning:s})=>t(ai,{variant:"dense",disableGutters:!0,className:"form-bottom-controls",children:[e("div",{className:a.formControlLabelSpacer}),"function"==typeof i?i({isSubmitting:r,handleSubmit:n,validationRunning:s}):i]}),vc=({formDisplayLabel:i,displayMode:r,hideDisplayModeInTitle:n,wrapperChild:a,serverSentError:s,serverSentErrorDetail:o,isSubmitting:l,classes:h,handleSubmit:c,controlsAtBottom:d,subHeaderLabel:u,subHeaderLabelStyle:A,formHeaderStyle:p,validationRunning:f})=>t(Ar,{className:"form__header",position:"relative",sx:{background:"var(--primary-bg)",borderRadius:"4px",...p},children:[t(ai,{variant:"dense",children:[e(vt,{component:"div",variant:"h6",color:"primary",children:i}),Boolean(u)?e(vt,{component:"span",variant:"h6",color:"primary",px:1,sx:{...A},children:u}):null,Boolean(r)&&!Boolean(n)?e(gi,{style:{color:"white",marginLeft:"8px"},variant:"outlined",color:"primary",size:"small",label:Ge(`${r?.toLowerCase()}mode`)}):"",e("div",{className:h.formControlLabelSpacer}),d?null:"function"==typeof a?a({isSubmitting:l,handleSubmit:c,validationRunning:f}):a]}),!l&&Boolean(s)?e(to,{severity:"error",errorMsg:s,errorDetail:o}):null]}),yc=Ci(e=>({root:{"& .MuiTabs-indicator":{background:"var(--theme-color1)"},"& .MuiButtonBase-root.Mui-selected":{color:"#000"}}})),Bc=({fields:i,formRenderConfig:r,formName:n,children:a,formStyle:s,hidden:l,formDisplayLabel:h,displayMode:c,hideDisplayModeInTitle:u,wrapperChild:A,serverSentError:p,serverSentErrorDetail:f,isSubmitting:m,classes:g,handleSubmit:w,defaultActiveStep:b=0,hideHeader:v=!1,formHeaderStyle:y})=>{const[B,C]=d(b),{current:x}=o(Object.keys(i).sort());return t(dr,{component:"main",style:{display:l?"none":"block"},children:[v?null:e(Cc,{formDisplayLabel:h,displayMode:c,hideDisplayModeInTitle:u,wrapperChild:A,serverSentError:p,serverSentErrorDetail:f,isSubmitting:m,classes:g,handleSubmit:w,formHeaderStyle:y}),e(xc,{formName:n,fields:i,fieldGroups:x,formRenderConfig:r,activeStep:B,setActiveStep:C}),e("div",{style:{...s},children:e(Fc,{fields:i,fieldGroups:x,formRenderConfig:r,activeStep:B,tabsRenderer:a})})]})},Cc=({formDisplayLabel:i,displayMode:r,hideDisplayModeInTitle:n,wrapperChild:a,serverSentError:s,serverSentErrorDetail:o,isSubmitting:l,classes:h,handleSubmit:c,formHeaderStyle:d})=>t(Ar,{className:"form__header",position:"relative",color:"secondary",sx:d,children:[t(ai,{variant:"dense",children:[t(vt,{component:"div",variant:"h6",children:[i,Boolean(r)&&!Boolean(n)?e(gi,{style:{color:"white",marginLeft:"8px"},variant:"outlined",color:"primary",size:"small",label:`${r} mode`}):""]}),e("div",{className:h.formControlLabelSpacer}),"function"==typeof a?a({isSubmitting:l,handleSubmit:c}):a]}),!l&&Boolean(s)?e(to,{severity:"error",errorMsg:s,errorDetail:o}):null]}),xc=({fields:t,formName:i,fieldGroups:r,formRenderConfig:n,activeStep:a,setActiveStep:s})=>{const o=yc(),l=z(Ma(i)),{t:h}=W(),c=z(Oa(i)),d=r.map(e=>{let r="DefaultGroup";return"object"==typeof n.groups&&(r=h(n.groups[e])),{index:e,name:r,status:cc(i,t[e].fieldNames,l),hasError:dc(i,t[e].fieldNames,c)}}).filter(e=>e.status);return e(gr,{id:`tabform-main-tab-${i}`,value:Number(a),variant:"scrollable",scrollButtons:"auto",className:o.root,children:d.map(t=>e(wr,{id:`tabform-sub-tab-${a}-${t?.index}-${t?.name}`,value:Number(t.index),label:t.name,onClick:()=>s(Number(t.index)),style:t.hasError?{color:"red"}:{}},t.name))})},Fc=({fields:t,activeStep:i,fieldGroups:r,formRenderConfig:n,tabsRenderer:a})=>{const s=r.map((r,a)=>{const s=t[r];s.fields[0]=g(s.fields[0],{isFieldFocused:a===i});const o=a!==Number(i)?{display:"none"}:{};return e(q,{container:!0,spacing:n?.gridConfig?.container?.spacing??2,direction:n?.gridConfig?.container?.direction??"row",style:o,children:s.fields},r)});return e(f,{children:"function"==typeof a?a({steps:s}):e(w,{fallback:e("div",{children:"Loading..."}),children:s})})},Sc={currency:{render:{componentType:"numberFormat"},FormatProps:{thousandSeparator:!0,prefix:"",thousandsGroupStyle:"lakh",allowNegative:!0,allowLeadingZeros:!1,decimalScale:2,isAllowed:e=>!(e?.value?.length>10)&&0!==e.floatValue},isCurrencyField:!0,StartAdornment:"INR",enableNumWords:!0,maxLength:10},currencyWithoutWords:{render:{componentType:"numberFormat"},FormatProps:{thousandSeparator:!0,prefix:"",thousandsGroupStyle:"lakh",allowNegative:!1,allowLeadingZeros:!1,decimalScale:2,isAllowed:e=>!(e?.value?.length>10)&&0!==e.floatValue},isCurrencyField:!0,StartAdornment:"INR",enableNumWords:!1,maxLength:10},dob:{render:{componentType:"datePicker"},schemaValidation:{type:"date",rules:[{name:"typeError",params:["Must be a valid date"]},{name:"max",params:[ln(new Date,{years:18}),"minimum age must be 18 years"]},{name:"min",params:[ln(new Date,{years:100}),"maximum age must be 100 years"]}]}},phoneNumber:{render:{componentType:"numberFormat"},schemaValidation:{type:"string",rules:[{name:"required",params:["MobileNoisrequired"]},{name:"min",params:[11,"MobileNoshouldbe11digit"]},{name:"max",params:[11,"MobileNoshouldbe11digit"]}]},FormatProps:{format:"###########",allowNegative:!1,allowLeadingZeros:!0,valueIsNumericString:!0},StartAdornment:"+88"},panCard:{render:{componentType:"inputMask"},fullWidth:!0,MaskProps:{mask:"aaaaa0000a",prepare:function(e){return e.toUpperCase()},lazy:!0},schemaValidation:{type:"string",rules:[{name:"required",params:["This Field is required"]},{name:"pancard",params:["Please enter valid Pan Card Number"]}]}},panCardOptional:{render:{componentType:"inputMask"},MaskProps:{mask:"aaaaa0000a",prepare:function(e){return e.toUpperCase()},lazy:!0}},aadharCard:{render:{componentType:"inputMask"},fullWidth:!0,MaskProps:{mask:"0000` 0000` 0000",lazy:!0},schemaValidation:{type:"string",rules:[{name:"required",params:["This Field is required"]},{name:"aadhar",params:["Please enter valid Aadhar Number"]}]}},rateOfInt:{render:{componentType:"numberFormat"},className:"textInputFromRight",FormatProps:{suffix:"%",decimalScale:2,placeholder:"0",fixedDecimalScale:!0,allowNegative:!1,allowEmptyFormatting:!0},maxPercent:100},MonthlyEmiPayCurrency:{render:{componentType:"numberFormat"},FormatProps:{thousandSeparator:!0,prefix:"",thousandsGroupStyle:"lakh",allowNegative:!1,allowLeadingZeros:!1,decimalScale:0,maxLength:13,isAllowed:e=>null!==e.floatValue},isCurrencyField:!0,StartAdornment:"INR",enableNumWords:!0},pincode:{render:{componentType:"numberFormat"},schemaValidation:{type:"string",rules:[{name:"required",params:["Residence Pincode is required"]},{name:"min",params:[6,"Residence Pincode should be 6 digit."]},{name:"max",params:[6,"Residence Pincode should be 6 digit."]}]},FormatProps:{format:"######",isAllowed:e=>0!==e.floatValue}},futureDateNotAllowed:{render:{componentType:"datePicker"},schemaValidation:{type:"date",rules:[{name:"typeError",params:["Must be a valid date"]},{name:"max",params:[new Date,"Future Date not allowed."]}]}},minAge:{render:{componentType:"numberFormat"},schemaValidation:{type:"number",rules:[{name:"required",params:["Min Age is required"]},{name:"min",params:[25,"Min age should be 25 years"]}]},FormatProps:{format:"##"}},maxAge:{render:{componentType:"numberFormat"},schemaValidation:{type:"number",rules:[{name:"required",params:["Max Age is required"]},{name:"max",params:[65,"Max age should be 65 years"]}]},FormatProps:{format:"##"}},rateOfIntWithoutValidation:{render:{componentType:"numberFormat"},FormatProps:{suffix:"%",decimalScale:2,fixedDecimalScale:!0,allowNegative:!0,allowEmptyFormatting:!0,isAllowed:e=>!(e.floatValue>=999.99)}},rateOfIntUptoThreeDigits:{render:{componentType:"numberFormat"},FormatProps:{suffix:"%",decimalScale:2,fixedDecimalScale:!0,allowNegative:!0,allowEmptyFormatting:!0,isAllowed:e=>!(e.floatValue<999.99)}},squareFeetFormat:{render:{componentType:"numberFormat"},FormatProps:{thousandSeparator:!0,thousandsGroupStyle:"lakh",allowNegative:!1,allowLeadingZeros:!1,isAllowed:e=>!(e?.value?.length>20)&&0!==e.floatValue},maxLength:20,showMaxLength:!1},currencyWithLeadingZeros:{render:{componentType:"numberFormat"},FormatProps:{thousandSeparator:!0,prefix:"",thousandsGroupStyle:"lakh",allowNegative:!0,allowLeadingZeros:!1,decimalScale:2,isAllowed:e=>!(e?.value?.length>10)},isCurrencyField:!0,StartAdornment:"INR",enableNumWords:!0,maxLength:10},pincodeNoValidation:{render:{componentType:"numberFormat"},FormatProps:{format:"######",isAllowed:e=>0!==e.floatValue}},amountField:{render:{componentType:"numberFormat"},className:"textInputFromRight",FormatProps:{thousandSeparator:!0,prefix:"",thousandsGroupStyle:"lakh",allowNegative:!1,allowLeadingZeros:!1,decimalScale:2,fixedDecimalScale:!0,placeholder:"0.00"},enableNumWords:!1,isCurrencyField:!0,StartAdornment:"INR",maxLength:15,showMaxLength:!1},accountNumber:{render:{componentType:"textField"},fullWidth:!0,inputProps:{onChange:function(e){const t=e.target.value.replace(/[^0-9]/g,"");e.target.value=t}},maxLength:20,showMaxLength:!0},loginID:{render:{componentType:"textField"},fullWidth:!0,inputProps:{onChange:function(e){const t=e.target.value.replace(/[^a-zA-Z0-9]/g,"");e.target.value=t}},maxLength:16,showMaxLength:!0},Percentage:{render:{componentType:"numberFormat"},className:"textInputFromRight",FormatProps:{allowNegative:!1,allowLeadingZeros:!0,decimalScale:2,isAllowed:e=>!(e?.value?.length>5)&&!(parseFloat(e?.value)>100)},maxLength:5,showMaxLength:!0,EndAdornment:"%"}},Nc=c(({metaData:t,initialValues:i,previousValues:r,onSubmitHandler:n=()=>console.log("onSubmitHandler is not passed"),hidden:a=!1,displayMode:s,hideTitleBar:l=!1,hideDisplayModeInTitle:c=!1,formStyle:d={background:"white",height:"calc(100vh - 230px)",overflowY:"auto",overflowX:"hidden"},controlsAtBottom:u=!1,children:A,formState:p,defaultActiveStep:f,hideHeader:m=!1,containerstyle:g={padding:"10px"},onFormButtonClickHandel:w=e=>{},onFormDataChange:b=()=>{},subHeaderLabel:v,subHeaderLabelStyle:y,setDataOnFieldChange:B=(e,t)=>{},formHeaderStyle:C={},enableEnterToFocus:x,focusScopeId:F="enter-to-focus-form",setValidationRunning:S},E)=>{const{t:k}=W(),T=ns(),{authState:L}=es();let I=N(t);I=oc(I,Sc,k,L,T,p),I=sc(I),I=lc(I);const D=Yh(I,w,b,F),U=((e,t,i={},r={},n=2)=>{if(!Array.isArray(e))return{};let a={};for(const s of e){const{defaultValue:e,name:o,isCurrencyField:l}=s,h="function"==typeof e?e(i,r??{}):e,c=ka(t,o,void 0);null!=c?a=Ta(a,o,l&&c?String(c).includes(".")?c:Number(c).toFixed(n):c):null!=h&&(a=Ta(a,o,"datetimePicker"===s.render.componentType?new Date(h):h))}return a})(I.fields,i,p,L,T.decimalCount),P=((e,t)=>{if(!Array.isArray(e))return{};let i={};for(const r of e){const{name:e}=r,n=ka(t,e,void 0);null!=n&&(i=Ta(i,e,n))}return i})(I.fields,r),R=((e,t={},i={})=>{if(!Array.isArray(e))return{};const r={};for(const n of e){const{name:e,_fields:a}=n;if(Array.isArray(a)){let n=Zh(a,t,i);r[e]=n}}return r})(I.fields,p,L),O=ec(I.fields),Q=I.form.name??"NO_NAME",H=o(null),M=x??T.enableEnterToFocus,_=F&&M?{"data-scope-id":F}:{};h(()=>{M&&H.current&&H.current.focus()},[M]);const j=o(new Map),z=o(new Map),V=o(null);return e(Qi,{dateAdapter:Hi,children:e(Ya.Provider,{value:{formName:Q,resetFieldOnUnmount:Boolean(I.form.resetFieldOnUnmount),validationRun:I.form.validationRun,initialValues:U,previousValues:P,defaultArrayFieldValues:R,validationSchema:O,lastValidationValue:j,flagRef:z,setCurrentStepIndexFnRef:V.current,formState:{formCode:I.form.name,refID:I.form.refID,setDataOnFieldChange:B,...I.form?.formState,...p}},children:e("div",{ref:H,tabIndex:M?0:-1,style:{width:"100%"},onKeyDown:e=>{M&&Es(e,F)},..._,children:e(Ec,{ref:E,formName:Q,formDisplayLabel:I?.form?.label?k(I?.form?.label):Ss(window.location.pathname,L?.menulistdata,I?.form?.setScreenCode??!0,I?.form?.showUserCode??!1),formRenderType:I.form.render.renderType??"simple",formRenderConfig:I.form.render,submitFn:n,hidden:a,displayMode:s,groupWiseFields:D,hideTitleBar:l,hideDisplayModeInTitle:c,wrapperChild:A,formStyle:d,controlsAtBottom:u,defaultActiveStep:f,hideHeader:m,containerstyle:g,subHeaderLabel:v,subHeaderLabelStyle:y,formHeaderStyle:C,setValidationRunning:S})})})})}),Ec=c(({formName:i,formDisplayLabel:r,formRenderType:n,formRenderConfig:a,submitFn:s,hidden:o,displayMode:l,groupWiseFields:c,hideTitleBar:d,hideDisplayModeInTitle:u,wrapperChild:A,formStyle:f,controlsAtBottom:m,defaultActiveStep:g,hideHeader:b,containerstyle:v={},subHeaderLabel:y,subHeaderLabelStyle:B,formHeaderStyle:C,setValidationRunning:x},F)=>{const{handleSubmit:S,handleSubmitPartial:N,serverSentError:E,serverSentErrorDetail:k,isSubmitting:T,getFieldData:L,setFieldData:I,handleReset:D,handleClear:U,validationRunning:P}=Ls({onSubmit:s,readOnly:"view"===l}),R=hc();return p(F,()=>({handleSubmit:S,formDisplayLabel:r,getFieldData:L,setFieldData:I,handleFormReset:D,handleFormClear:U})),h(()=>{"function"==typeof x&&x(P)},[P,x]),"stepper"===n?e(Ac,{fields:c,formRenderConfig:a,formName:i,handleSubmit:S,handleSubmitPartial:N,formDisplayLabel:r,hidden:o,defaultActiveStep:g,classes:R,wrapperChild:A,isSubmitting:T,serverSentError:E,serverSentErrorDetail:k},`${i}-grouped-stepper`):"tabs"===n?e(Bc,{fields:c,formRenderConfig:a,formName:i,formStyle:f,formDisplayLabel:r,hidden:o,displayMode:l,hideDisplayModeInTitle:u,wrapperChild:A,serverSentError:E,serverSentErrorDetail:k,isSubmitting:T,classes:R,handleSubmit:S,defaultActiveStep:g,hideHeader:b,formHeaderStyle:C,children:({steps:i})=>t("div",{children:[e("br",{}),e(w,{fallback:e("div",{children:"Loading..."}),children:i})]})},`${i}-grouped-tabs`):"simple"===n?e(wc,{formStyle:f,fields:c,formRenderConfig:a,formName:i,formDisplayLabel:r,hidden:o,displayMode:l,hideDisplayModeInTitle:u,wrapperChild:A,serverSentError:E,serverSentErrorDetail:k,isSubmitting:T,classes:R,handleSubmit:S,controlsAtBottom:m,hideHeader:b,containerstyle:v,subHeaderLabel:y,subHeaderLabelStyle:B,formHeaderStyle:C,validationRunning:P}):t("div",{children:["RenderType ",n," not available"]})}),kc=({children:r,...n})=>{const{value:a,cell:s,column:{color:o="initial",TableCellProps:l,isGroupSum:h},row:c,index:d}=n;let u="function"==typeof o?o(a):o,A={};c?.isGrouped&&c?.isExpanded&&(A={...A,fontWeight:800});let p=r;return s?.isGrouped?p=t(i,{children:[e(C,{...c.getToggleRowExpandedProps([{style:{padding:0}}]),children:c.isExpanded?e(vr,{}):e(br,{})}),r,t("i",{children:["(",c.subRows.length,")"]})]}):s?.isAggregated&&h?p=r:s?.isPlaceholder&&(p=null),e(ci,{component:"td",variant:"head",...s?.getCellProps?.([{...l??{}},{style:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",paddingRight:"20px",paddingTop:0,paddingBottom:0,paddingLeft:0===d?"10px":"0px",lineHeight:"34px",color:u,textAlign:s?.column?.alignment??"unset",...A}}]),children:p})},Tc=t=>{const{commonDateTimeFormat:i}=ns(),{value:r,column:{format:n},isAdvanceFilter:a=!1}=t;let s="00/00/0000 00:00:00",o=new Date(r);return isNaN(o)||(s=ze(new Date(r),(Boolean(n)?n:i)||"dd/MM/yyyy HH:mm:ss")),a?s:e(kc,{...t,children:s})},Lc=t=>{const{commonDateFormat:i}=ns(),{value:r,column:{format:n},isAdvanceFilter:a=!1}=t;if(null==r||""===r)return a?null:e(kc,{...t});const s=new Date(r);if(isNaN(s.getTime()))return a?null:e(kc,{...t});const o=ze(s,(Boolean(n)?n:i)||"dd/MM/yyyy");return a?o:e(kc,{...t,children:o})},Ic=t=>{const{value:i}=t;return e(kc,{...t,children:i})},Dc=({name:i,validate:r,validationRun:n,shouldExclude:a,isReadOnly:c,postValidationSetCrossFieldValues:A,runPostValidationHookAlways:p,dependentFields:f,fieldKey:m,options:g,MenuItemProps:w,SelectProps:b,GridProps:v,enableGrid:y,multiple:C,showCheckbox:x,isFieldFocused:F,InputProps:S,inputProps:N,CircularProgressProps:E,runValidationOnDependentFieldsChange:k,setValueOnDependentFieldsChange:L,setValueOnDependentFieldsValueChange:I,skipValueUpdateFromCrossFieldWhenReadOnly:D,_optionsKey:U,disableCaching:P,skipDefaultOption:R,defaultOptionLabel:O,enableDefaultOption:Q,runExternalFunction:H,onFormDataChange:M,ignoreInSubmit:_=!1,AlwaysRunPostValidationSetCrossFieldValues:j,label:z,setFieldLabel:V,placeholder:X,defaultValueKey:Y,componentType:$,runPostValidationForInitValue:Z,className:ee,filterOptionsCb:te,focusScopeId:ie,...re})=>{const[ne,ae]=d(v),{value:se,prevValue:oe,error:he,touched:ce,handleChange:de,handleBlur:ue,runValidation:Ae,validationRunning:pe,isSubmitting:fe,fieldKey:me,name:ge,dependentValues:we,excluded:be,incomingMessage:ve,whenToRunValidation:ye,readOnly:Be,formState:Ce,setIncomingMessage:xe,handleOptionValueExtraData:Fe,setDisplayValue:Se,setIgnoreInSubmit:Ne,setFilteredOptions:Ee,...ke}=as({name:i,fieldKey:m,dependentFields:f,validate:r,validationRun:n,runPostValidationHookAlways:p,postValidationSetCrossFieldValues:A,isReadOnly:c,shouldExclude:a,runValidationOnDependentFieldsChange:k,skipValueUpdateFromCrossFieldWhenReadOnly:D,runExternalFunction:H,onFormDataChange:M,AlwaysRunPostValidationSetCrossFieldValues:j,componentType:$,runPostValidationForInitValue:Z}),Te=o(),[Le,Ie]=d([]),[De,Ue]=d([]),Pe=l(e=>{Ie(e),Ue(e),Ee(e)},[Ue,Ie,Ee]);h(()=>{if("function"!=typeof te)return;const e=te(De,ds(we),Ce)??De;Ie(e),Ee(e)},[we,Ce,De,te,Ee]),h(()=>{if(Boolean(_))if("function"==typeof _){let e=_(ds(we),Ce,{isSubmitting:fe,value:se});Ne(e)}else Ne(_)},[_,Ne,we,se]),h(()=>{F&&setTimeout(()=>{Te?.current?.focus?.()},1)},[F]);const Re=l(e=>Fo(Le)(e),[Le]),Oe=l(e=>So(Le)(e),[Le]),Qe=l((e,t=void 0,i=!1,r={},n=!1)=>{let a="object"==typeof e?e?.target?.value??"":e;if(Array.isArray(a)&&(a=a.filter(e=>""!==e)),Array.isArray(a)&&C){let e=a.indexOf("00");if(e>=0?a.splice(e,1):0!==a.length||R||(a=["00"]),"all"===a[a.length-1]){let e=[],t=[];if(Le.filter(e=>" "!==e.value).length===a.filter(e=>"all"!==e).length)de(["00"],[Boolean(O)?O:"Select Option"],i,r,n);else{for(let i=0;i<Le.length;i++)"00"!==Le[i].value&&" "!==Le[i].value&&(e.push(Le[i].value),t.push(Le[i].label));de(e,t,i,r,n)}return}}let s=Re(a),o=Oe(a);const l=Boolean(o?.[0]?.isDefaultOption);s=C?s:s[0],Fe(o),l&&(e.target.value=e.target?.value?.trim?.()),de(C?a:e,s)},[de,Re,C,R]),He=l(()=>{let e=Oe(se);Fe(e),ue()},[ue,Oe,Fe,se]),Me=s(()=>{const e=ds(we),t=us(e);return JSON.stringify(t.sort((e,t)=>e.fieldKey.localeCompare(t.fieldKey)).map(e=>e.value))},[we]);h(()=>{if(Me&&"function"==typeof I){let e=I(ds(we),Ce,{value:se,isSubmitting:fe});null!=e&&Qe(e)}},[Me,I,de]),h(()=>{if("function"==typeof L){let e=L(ds(we),Ce,{value:se,isSubmitting:fe});null!=e&&Qe(e)}},[we,Qe,L]),h(()=>{if(se&&Array.isArray(Le)&&Le.length>0){let e=Re(se);e=C?e:e[0],Se(e)}},[Se,Le]);const _e=Le.filter(e=>"00"!==e.value),je=Array.isArray(se)?se.filter(e=>"00"!==e):[],ze=!!C&&_e.length===(se?.length??-1/0),Ve=C&&je.length>0&&je.length<_e.length,{loadingOptions:Ke}=Bo(Ce,g,Pe,Qe,we,ve,Ae,ye,U,P,xe,R,O,Q,e=>{const t={...v,xs:e?.xs??v?.xs??"auto",md:e?.md??v?.md??"auto",xl:e?.xl??e?.md??v?.xl??"auto",sm:e?.sm??v?.sm??"auto",lg:e?.lg??e?.md??v?.lg??"auto"};ae(t)}),{t:qe}=W();h(()=>{let e=Oe(se);Fe(e)},[Ke,Oe,Fe]);const Ge=s(()=>{if("function"==typeof V)return V(ds(we),se)},[V,we,se]);if(h(()=>{if(!Y||se||Ke)return;const e=Le.find(e=>e[Y]===e.value);e&&(Qe({target:e}),setTimeout(()=>{He()},0))},[Ke,Le]),be)return null;const We=ce&&""!==(he??""),Je=Le.map((t,i)=>u(K,{...w,key:t.value??i,value:t.value,disabled:t.disabled,sx:{"&.Mui-selected:not(.Mui-disabled)":{background:"#eee !important",fontWeight:"500","&:hover":{background:"#eee"}}}},x&&!t.disabled?e(go,{checked:Boolean(C)?Array.isArray(se)&&se.indexOf(t.value)>=0:se===t.value}):null,t.label)),Xe=t(K,{value:"all",children:[e(go,{checked:ze,indeterminate:Ve,color:"secondary"}),qe("SelectAll")]},"selectAll"),Ye=u(Ao,{...re,label:Ge?.label?qe(Ge.label):z,select:!0,key:me,id:me,className:J(ee,{hasOldValue:void 0!==oe&&void 0!==se&&!T.isEqual(oe,se)}),name:ge,value:C&&!Array.isArray(se)?[se]:Boolean(se)?se:"string"==typeof se?" ":se,error:!fe&&We,helperText:e(le,{children:!fe&&We?he:null}),onChange:Qe,onBlur:He,disabled:fe||Be,SelectProps:{...b,native:!1,multiple:C,MenuProps:{MenuListProps:{onKeyDown:e=>{if("Enter"!==e.key)return;const t=e.currentTarget;Array.from(t.querySelectorAll('[role="option"], .MuiMenuItem-root')).some(e=>"true"!==e.getAttribute("aria-disabled"))||(e.preventDefault(),e.stopPropagation(),t.dispatchEvent(new KeyboardEvent("keydown",{key:"Escape",bubbles:!0})),requestAnimationFrame(()=>{ks(e.shiftKey,ie,document.activeElement,!0)}))}}},renderValue:C?Fo(Le,!0):void 0,SelectDisplayProps:{onKeyDownCapture:e=>{"Enter"===e.key&&(e.preventDefault(),e.stopPropagation(),ks(e.shiftKey,ie,e.currentTarget,!0))}}},InputLabelProps:{shrink:!0},inputRef:Te,InputProps:{style:{background:Boolean(Be||fe)?"#f3f3f3":""},endAdornment:pe||Ke?e(B,{position:"end",children:e(G,{color:"secondary",variant:"indeterminate",size:24,...E})}):null,...S},onMouseDown:e=>{(fe||Be)&&(e.preventDefault(),e.stopPropagation())},inputProps:{readOnly:Be,tabIndex:fe||Be?-1:void 0,...N}},C&&x?[Xe,...Je]:Je),$e=void 0===oe||void 0===se||T.isEqual(oe,se)?Ye:e(Jo,{title:e(Xo,{label:`${qe("OldValueOf")} ${Ge?.label?qe(Ge.label):z}`,value:oe?Re(oe)??oe:"(blank)"}),arrow:!0,followCursor:!0,children:Ye});return Boolean(y)?e(q,{...ne,children:$e}):$e};var Uc=Object.freeze({__proto__:null,Select:Dc,SelectRenderOnly:Do,default:Dc});const Pc=n(null),Rc=({children:t})=>{const[i,r]=d(1);return e(Pc.Provider,{value:{divider:i,setDivider:r},children:t})},Oc=()=>{const e=a(Pc);if(!e)return null;const{divider:t}=e;return t},Qc=[{label:"Default",value:1},{label:"Lakhs",value:1e5},{label:"Crore",value:1e7}],Hc=()=>{const{setDivider:t,divider:i}=a(Pc);return e(Do,{label:"Amount In",size:"small",touched:!0,error:"",value:i,handleChange:e=>t(e.target.value),handleBlur:()=>!0,options:Qc,_optionsKey:"amountIn",selectVariant:"default",style:{width:"120px",margin:"0px 16px",color:"white"},InputLabelProps:{style:{color:"white"}}})};const Mc=({rows:e,column:{id:t,isTotalWithoutCurrency:i=!1,isTotalWithCurrency:r=!1,currencyRefColumn:n,isCurrencyCode:a,currencySymbolPosition:o="start"},loading:l,data:h,...c})=>{const{dynamicAmountSymbol:d,currencyFormat:u,decimalCount:A}=ns(),p=s(()=>h.reduce((e,i)=>l?0:Number("null"===i?.[t]?0:i?.[t])+e,0),[h,t,l]);let f=$o(d??"INR");a?Boolean(n)&&(f=$o(n)):Boolean(n)&&(f="");const m=Oc();let g=" ";return null===p||""===p||isNaN(Number(p))||(g=r?`${function(e,t,i,r,n="start"){const a=new Intl.NumberFormat(i,{minimumFractionDigits:r}).format(e);return"end"===n?`${a} ${t}`:`${t} ${a}`}(p.toFixed(2)/m,f,u,A,o)}`:i?p.toFixed(2):""),g},_c=({rows:t,column:{id:i,isDisplayValueTotal:r=!1,currencyRefColumn:n,isCurrencyCode:a,DisplayValueLabel:o}})=>{const l=s(()=>{const e=new Map;return t.forEach(t=>{const r=String(t.values?.[i]);if(void 0!==r){const t=e.get(r)||0;e.set(r,t+1)}}),e},[t,i]);if(r){const t=Array.from(l).map(([t,i])=>e("div",{children:`${t}: ${i}`},t));if("string"==typeof o)return t;if("object"==typeof o&&null!==o){return Array.from(l).map(([t,i])=>e("div",{children:`${o[t]} : ${i}`},t))}return t}},jc=t=>{const{t:i}=W(),{value:r,row:{index:n,original:a},column:{id:o,buttonLabel:l,columnName:h,isVisible:c,isVisibleInNew:d=!1,shouldExclude:u,setButtonName:A},onButtonActionHandel:p}=t,f=s(()=>Boolean(a?._isNewRow)?d:c,[c,a?._isNewRow]),m=s(()=>"function"==typeof u&&u(r,a),[r,a]),g=s(()=>"function"==typeof A?A(r,a):null,[r,a]),w=Boolean(g)?g:h;return e(ho,m?{...t}:{...t,children:f?e(ct,{onClick:e=>{"function"==typeof p&&p(n,o)},fullWidth:!0,variant:"contained",color:"secondary",style:{height:"28px"},children:Boolean(l)?i(l):i(w)}):null})},zc=i=>{const{column:r,initialState:n}=i,a=(n?.groupBy??[]).includes(r?.id);return t(f,{children:[e(zi,{active:r.isSorted,direction:r.isSortedDesc?"desc":"asc",hideSortIcon:!0,...r.getSortByToggleProps([{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"flex",color:"var(--theme-color1)",fontSize:"1 rem",fontWeight:"600",paddingRight:"right"===(r?.TableCellProps?.align??r.alignment??"left")&&r.canFilter?"10px":"4px"}}]),children:e("span",{title:r.columnName,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r.Cell!==jc||r?.showColumnName?r.columnName:null})}),r.canGroupBy?e(oe,{sx:{marginLeft:"right"!==r.alignment?"auto":0,marginRight:"right"===r.alignment?"auto":0},children:e("span",{...a?{}:r.getGroupByToggleProps(),children:r.isGrouped?"🔴":"➕"})}):null,e("div",{...r.getResizerProps([{style:{opacity:1,color:"rgba(224, 224, 224, 1)",right:"0px",display:"flex",zIndex:100,position:"absolute",flexDirection:"column",justifyContent:"center"}}]),children:e("svg",{focusable:"false",viewBox:"0 0 24 24","aria-hidden":"true","data-testid":"SeparatorIcon",style:{color:"inherit",userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:"currentColor",flexShrink:0,transition:"fill 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",fontSize:"20px"},children:e("path",{d:"M11 19V5h2v14z"})})})]})};const Vc=t=>{const{dynamicAmountSymbol:i,currencyFormat:r,decimalCount:n}=ns(),{value:a,cell:s,row:o,column:{isVisibleCurrSymbol:l=!0,isCurrencyCode:h,currencyRefColumn:c,currencySymbolPosition:d,isGroupSum:u},isAdvanceFilter:A=!1}=t,p=s?.isAggregated;let f=a;p&&u&&(f=o?.values?.[s.column.id]);let m=$o(i??"INR");if(h)Boolean(c)&&(m=$o(c));else if(Boolean(c)){m=$o(o?.original?.[c]??c)}const g=Oc();if(null==f||""===f)return A?"":e(kc,{...t,children:""});if(isNaN(Number(f)))return A?"":e(kc,{...t,children:""});const w=function(e,t,i="en-IN",r=0,n="start"){const a=new Intl.NumberFormat(i,{minimumFractionDigits:r}).format(e);return"end"===n?t?`${a} ${t}`:a:t?`${t} ${a}`:a}(Number(f)/g,l?m:"",r??"en-IN",n??2,d??"start");return A?w:e(kc,{...t,children:w})};let Kc=new Intl.NumberFormat("en-IN",{minimumFractionDigits:2,style:"currency",currency:"INR"});const qc=t=>{const{commonTimeFormat:i}=ns(),{value:r,column:{format:n}}=t;let a="-",s=new Date(r);return isNaN(s)||(a=ze(new Date(r),n??i??"HH:mm:ss")),e(kc,{...t,children:a})};var Gc=Object.freeze({__proto__:null,ButtonRowCell:jc,DateCell:Lc,DateTimeCell:Tc,DefaultCell:Ic,DefaultCellWithDefaultValue:t=>i=>e(kc,{...i,children:t}),FooterCell:Mc,FooterCell1:_c,FooterCellWithNumber:e=>{const{rows:t,column:{id:i}}=e,r=s(()=>t.reduce((e,t)=>Number(t.values?.[i]??0)+e,0),[t,i]);return`${isNaN(r)?"":Kc.format(r)}`},HeaderColumnCell:zc,NumberCell:Vc,NumberCell2:t=>{const{value:i}=t;let r="-";return null===i||""===i||isNaN(Number(i))||(r=`${i}`),e(kc,{...t,children:r})},TimeCell:qc});const Wc=({title:e,columns:t,rows:i,columnsSelected:r,data:n,auth:a,retrievalParams:s,filters:o,globalFilter:l,columnLabel:h,banklogo:c,pageNumber:d,totalPageCount:u,primaryTheme:A})=>{const p=["a6"].includes(n.PAGE_SIZE.toLowerCase()),f={DEFAULT:"#000",THEME:A,SMALL_TEXT:p?5:7,DEFAULT_TEXT:p?8:16,HEADING_TEXT:p?10:12};let m=5;const g=new jspdf.jsPDF({orientation:n.ORIENTATION,unit:"mm",format:n.PAGE_SIZE,compress:!0}),w=g.internal.pageSize.width,{fromDt:b,toDt:v}=getRetrievalParaDate(s);function y(e=f.DEFAULT){g.setFontSize(f.DEFAULT_TEXT),g.setTextColor(e),g.setFont(void 0,"normal")}const B=`${e} ${getTitleFilters(s,o,l,h)}`;t=t.filter(e=>r.includes(e.id));const C=getDynamicRow(i,t,"PDF");const x=t.map(e=>e.cname),F=C.map(e=>Object.values(e));B.length>w?m+=25:m+=20;const S="Y"===n.SHOW_HEADER||!0===n.SHOW_HEADER,N="Y"===n.ALL_PAGE_HEADER||!0===n.ALL_PAGE_HEADER,E=p?30:45,k=dateFns.format(Date.now(),"DD/MM/YYYY HH:mm:ss");g.autoTable({head:[x],headStyles:{fillColor:f.THEME},body:F,styles:{fontSize:p?3.5:6,cellPadding:p?{top:.5,bottom:.5,left:1,right:1}:{top:1,bottom:1,left:2,right:2}},margin:{top:S&&N?E:15},startY:S&&N?E:p?S?m+5:15:S?m+20:15,tableWidth:"a6"===n?.PAGE_SIZE?"wrap":"auto",didDrawPage:function(e){const t=e.table.pageNumber;S&&(N||1===t)&&function(e,t={value:i}){let i=t.value;e.addImage(c,"JPG",10,i,"a6"===n.PAGE_SIZE||"a5"===n.PAGE_SIZE?18:32,"a6"===n.PAGE_SIZE||"a5"===n.PAGE_SIZE?9:18),e.setFontSize("a6"===n.PAGE_SIZE?f.SMALL_TEXT:f.HEADING_TEXT),e.setTextColor(f.THEME);const r=a?.companyName??"",s=w/2,o=i+10;if("landscape"===n?.ORIENTATION?.toLowerCase()&&p||"portrait"===n?.ORIENTATION?.toLowerCase()&&["a4","a5","a6"].includes(n.PAGE_SIZE.toLowerCase())){const t=e.splitTextToSize(r,p?40:100);e.text(t,s,o,{align:"center"})}else e.text(r,s,o,{align:"center"});p?e.setFontSize(4):e.setFontSize(8);const l=a?.user?.branchCode&&a?.user?.branch?`Branch: ${a?.user?.branchCode}- ${a?.user?.branch}`:"",h=a?.workingDate?`Working date: ${dateFns.format(new Date(a?.workingDate),"DD/MM/YYYY")}`:"",d=w/2-e.getTextWidth(l)/2,u=w/2-e.getTextWidth(h)/2;if(e.text(l,d,p?i+15:i+22),e.text(h,u,p?i+17:i+26),"a6"===n.PAGE_SIZE?i+=5:i+=20,y(),e.setFontSize("a6"===n.PAGE_SIZE?4:8),e.setTextColor(f.DEFAULT),B.length>w-80){const t=e.splitTextToSize(B,w-30);e.text(t,15,p?i+15:i+11)}else{const t=w/2-e.getTextWidth(B)/2;e.text(B,t,p?i+15:i+11)}}(g,{value:5}),g.setFontSize(f.SMALL_TEXT),g.setTextColor(150),g.text(`Printed On: ${k}`,p?w-32:w-42,10)}}),(e=>{const t=e.internal.getNumberOfPages();e.setFontSize(f.SMALL_TEXT),e.setTextColor(150),e.setFont(void 0,"normal");for(let i=1;i<=t;i++){e.setPage(i);const r=e.internal.pageSize.width,n=e.internal.pageSize.height;e.text(`Generated by- ${a?.user?.id||"Unknown"}`,10,n-10);const s=`Page ${i} of ${t}`,o=e.getTextWidth(s);e.text(s,r-10-o,n-10)}})(g);const T=g.output("datauristring");return b||v?{downloadTitle:`${e} ${b}-${v}-${n.ORIENTATION}.pdf`,blob:T}:{downloadTitle:`${e}-${n.ORIENTATION}.pdf`,blob:T}},Jc=({title:e,columns:t,rows:i,columnsSelected:r,data:n,auth:a,retrievalParams:s,filters:o,globalFilter:l,columnLabel:h,pageNumber:c,totalPageCount:d,primaryTheme:u})=>{const A={bg:u.substring(1),white:"ffffff"};t=t.filter(e=>r.includes(e.id));const{fromDt:p,toDt:f}=getRetrievalParaDate(s);return XlsxPopulate.fromBlankAsync().then(r=>{const u=r.sheet(0);let m=1;if("Y"===n.SHOW_HEADER||!0===n.SHOW_HEADER){u.row(1).height(30),u.freezePanes(0,5),u.range(m,1,m,t.length).merged(!0);u.cell("A1").value(a?.companyName).style({bold:!0,fontSize:18,horizontalAlignment:"center",verticalAlignment:"center",fill:A.bg,fontColor:A.white}),m+=1;const e=a?.user?.branchCode&&a?.user?.branch?`Branch: ${a?.user?.branchCode}- ${a?.user?.branch}`:"",i=a?.workingDate?`Working date: ${dateFns.format(new Date(a?.workingDate),"DD/MM/YYYY")}`:"";u.range(m,1,m,t.length).merged(!0).style({border:!0});u.cell(`A${m}`).value(`${e} | ${i}`).style({bold:!0,fontSize:12,horizontalAlignment:"center",fontColor:A.bg}),m+=1}else u.freezePanes(0,3);let g=getTitleFilters(s,o,l,h);u.range(m,1,m,t.length).merged(!0).style({border:!0});u.cell(`A${m}`).value(`${e}`).style({bold:!0,fontSize:12,horizontalAlignment:"center",fontColor:A.bg}),u.range(m+1,1,m+1,t.length).merged(!0).style({border:!0,wrapText:!0});u.cell(`A${m+1}`).value(`${g}`).style({bold:!0,fontSize:12,horizontalAlignment:"center",fontColor:A.bg}),m+=2;t.map(e=>e.cname).forEach((e,t)=>{u.cell(m,t+1).value(e).style({bold:!0,border:!0})});const w=getDynamicRow(i,t,"EXCEL");w.forEach((e,i)=>{Object.entries(e).forEach(([e,r],n)=>{const a=t.find(t=>t[e]&&"currency"===t.cellType)?"right":"left";u.cell(i+m+1,n+1).value(r).style({border:!0,horizontalAlignment:a})})}),m+=w.length+3;if(u.cell(m,1).value("Generated by").style({bold:!0,border:!0}),u.cell(m,2).value(a?.user?.id).style({border:!0}),"number"==typeof c&&(m+=1,u.cell(m,1).value("Page").style({bold:!0,border:!0}),u.cell(m,2).value(`${c+1} of ${d}`).style({border:!0})),m+=1,u.cell(m,1).value("Printed on").style({bold:!0,border:!0}),u.cell(m,2).value(dateFns.format(new Date,"DD/MM/YYYY HH:mm:ss")).style({border:!0}),"EXCEL"===n.EXPORT_TYPE){const e=Object.keys(w[0]),t=e.map((t,i)=>{let r=8;for(let t=0;t<w.length;t++){const n=(w[t][e[i]]||"").toString().trim();n.length>r&&(r=n.length)}return r}),i=4;e.forEach((e,r)=>{u.column(r+1).width(t[r]+i)})}return r.outputAsync().then(t=>p||f?{downloadTitle:`${e} ${p}-${f}.xlsx`,blob:t}:{downloadTitle:`${e}.xlsx`,blob:t})})},Xc=({title:e,columns:t,rows:i,columnsSelected:r,data:n,auth:a,retrievalParams:s,filters:o,globalFilter:l,columnLabel:h})=>{let c="";t=t.filter(e=>r.includes(e.id));const{fromDt:d,toDt:u}=getRetrievalParaDate(s);let A=getTitleFilters(s,o,l,h);const p=t.map(e=>e.cname),f=getDynamicRow(i,t,"CSV");c+=Papa.unparse([[`${e} ${A}`]])+"\r\n"+Papa.unparse([p])+"\r\n"+Papa.unparse(f,{header:!1});const m=new Blob([c],{type:"text/csv"});return d||u?{downloadTitle:`${e} ${d}-${u}.csv`,blob:m}:{downloadTitle:`${e}.csv`,blob:m}},Yc=({title:e,columns:t,rows:i,columnsSelected:r,data:n,auth:a,retrievalParams:s,filters:o,globalFilter:l,columnLabel:h})=>{t=t.filter(e=>r.includes(e.id));const{fromDt:c,toDt:d}=getRetrievalParaDate(s),u=t.map(e=>e.cname),A=getDynamicRow(i,t,"TEXT");let p="";u.forEach(e=>{p+=`${e}\t`}),p+="\n",A.forEach(e=>{Object.values(e).forEach(e=>{p+=`${e}\t`}),p+="\n"});const f=new Blob([p],{type:"text/plain"});return c||d?{downloadTitle:`${e} ${c}-${d}.txt`,blob:f}:{downloadTitle:`${e}.txt`,blob:f}},$c=({title:e,columns:t,rows:i,columnsSelected:r,data:n,auth:a,retrievalParams:s,filters:o,globalFilter:l,columnLabel:h,primaryTheme:c})=>{t=t.filter(e=>r.includes(e.id));const{fromDt:d,toDt:u}=getRetrievalParaDate(s);let A=getTitleFilters(s,o,l,h);const p=t.map(e=>e.cname),f=getDynamicRow(i,t,"HTML"),m=a?.user?.branchCode&&a?.user?.branch?`Branch: ${a?.user?.branchCode}- ${a?.user?.branch}`:"",g=a?.workingDate?`Working date: ${dateFns.format(new Date(a?.workingDate),"DD/MM/YYYY")}`:"";let w=`\n <header>\n ${"Y"===n.SHOW_HEADER||!0===n.SHOW_HEADER?`<h1>${a?.companyName}</h1>`:""}\n ${"Y"===n.SHOW_HEADER||!0===n.SHOW_HEADER?`<p class="branch-title">${m} | ${g}</p>`:""}\n <p class="report-title">${e} ${A}</p>\n </header>\n <table><thead><tr>`;p.forEach(e=>{w+=`<th>${e}</th>`}),w+="</tr></thead><tbody>",f.forEach(e=>{const i=Object.entries(e);w+="<tr>",i.forEach(([e,i])=>{void 0===i&&(i="");const r=t.find(t=>t[e]&&"currency"===t.cellType)?"right":"left";w+=`<td style="text-align: ${r}">${i}</td>`}),w+="</tr>"}),w+="</tbody></table></div>",w=`\n <style>\n body {\n font-family: sans-serif;\n overflow-x: auto\n }\n header {\n text-align: center\n }\n h1, .branch-title {\n color: ${c};\n }\n .report-title {\n max-width: 100%;\n word-wrap: break-word;\n }\n table {\n border-collapse: collapse;\n width: 100%;\n }\n th, td {\n white-space: nowrap;\n padding: 8px;\n text-align: left;\n border: 1px solid #ddd;\n }\n th {\n background-color: ${c};\n color: #fff;\n }\n tr:nth-child(even) {\n background-color: #f1f1f1\n }\n </style>\n `+w;const b=new Blob([w],{type:"text/html"});return d||u?{downloadTitle:`${e} ${d}-${u}.html`,blob:b}:{downloadTitle:`${e}.html`,blob:b}},Zc=({title:e,columns:t,rows:i,columnsSelected:r,data:n,auth:a,retrievalParams:s,filters:o,globalFilter:l,columnLabel:h})=>{t=t.filter(e=>r.includes(e.id));const{fromDt:c,toDt:d}=getRetrievalParaDate(s),u=getDynamicRow(i,t,"XML"),A=jstoxml.toXML({XmlData_root:u.map(e=>({XmlData_row:e}))},{header:!0}),p=new Blob([A],{type:"application/xml"});return c||d?{downloadTitle:`${e} ${c}-${d}.xml`,blob:p}:{downloadTitle:`${e}.xml`,blob:p}},ed=n({status:{excelStatus:"",pdfStatus:"",csvStatus:"",xmlStatus:"",htmlStatus:"",textStatus:""},workerQueue:[],setWorkerQueue:()=>{},pdfExporter:()=>{},excelExporter:()=>{},csvExporter:()=>{},textExporter:()=>{},htmlExporter:()=>{},xmlExporter:()=>{},markComplete:()=>{},downloadProgress:{},setDownloadProgress:()=>{}}),td=({children:t})=>{const[i,r]=d([]),[n,a]=d({pdf:!1,excel:!1,csv:!1,text:!1,xml:!1,html:!1}),s=o(),c=l((e,t="",i=null,a=!1)=>{r(r=>r.map(r=>r.id===e?{...r,type:t,url:i,enablePdfPrint:a,isCompleted:!n[t]}:r))},[]),[u,{status:A,kill:p}]=dn(Wc,{remoteDependencies:[`${new URL(window.location.href).origin}/exportUtility.js`,`${new URL(window.location.href).origin}/cdn/date-fns.js`,`${new URL(window.location.href).origin}/cdn/jspdf.js`,`${new URL(window.location.href).origin}/cdn/jspdf-autotable.js`]}),[f,{status:m}]=dn(Jc,{remoteDependencies:[`${new URL(window.location.href).origin}/cdn/date-fns.js`,`${new URL(window.location.href).origin}/cdn/xlsx.js`,`${new URL(window.location.href).origin}/exportUtility.js`]}),[g,{status:w}]=dn(Xc,{remoteDependencies:[`${new URL(window.location.href).origin}/cdn/date-fns.js`,`${new URL(window.location.href).origin}/cdn/papaparse.js`,`${new URL(window.location.href).origin}/exportUtility.js`]}),[b,{status:v}]=dn(Yc,{remoteDependencies:[`${new URL(window.location.href).origin}/cdn/date-fns.js`,`${new URL(window.location.href).origin}/exportUtility.js`]}),[y,{status:B}]=dn($c,{remoteDependencies:[`${new URL(window.location.href).origin}/cdn/date-fns.js`,`${new URL(window.location.href).origin}/exportUtility.js`]}),[C,{status:x}]=dn(Zc,{remoteDependencies:[`${new URL(window.location.href).origin}/cdn/date-fns.js`,`${new URL(window.location.href).origin}/cdn/jstoxml.js`,`${new URL(window.location.href).origin}/exportUtility.js`]});return s.current={pdfStatus:A,excelStatus:m,csvStatus:w,textStatus:v,htmlStatus:B,xmlStatus:x},h(()=>{const e=e=>{if(s.current?.excelStatus===cn.RUNNING||s.current?.pdfStatus===cn.RUNNING||s.current?.csvStatus===cn.RUNNING||s.current?.textStatus===cn.RUNNING||s.current?.htmlStatus===cn.RUNNING||s.current?.xmlStatus===cn.RUNNING){e.preventDefault();const t="Export is still running";return e.returnValue=t,t}};return window.addEventListener("beforeunload",e),()=>{window.removeEventListener("beforeunload",e)}},[]),e(ed.Provider,{value:{workerQueue:i,setWorkerQueue:r,setDownloadProgress:a,downloadProgress:n,pdfExporter:u,excelExporter:f,csvExporter:g,textExporter:b,htmlExporter:y,xmlExporter:C,markComplete:c,kill:p,status:{pdfStatus:A,excelStatus:m,csvStatus:w,textStatus:v,htmlStatus:B,xmlStatus:x}},children:t})},id=()=>a(ed),rd={PENDING:cn.PENDING,SUCCESS:cn.SUCCESS,RUNNING:cn.RUNNING,ERROR:cn.ERROR,TIMEOUT_EXPIRED:cn.TIMEOUT_EXPIRED},nd={form:{name:"exportReportForm",label:"ExportReportform",resetFieldOnUnmount:!1,validationRun:"onBlur",submitAction:"home",render:{ordering:"auto",renderType:"simple",gridConfig:{item:{xs:12,sm:4,md:4},container:{direction:"row",spacing:1}}},componentProps:{textField:{fullWidth:!0},select:{fullWidth:!0},datePicker:{fullWidth:!0},numberFormat:{fullWidth:!0},inputMask:{fullWidth:!0},datetimePicker:{fullWidth:!0}}},fields:[{render:{componentType:"autocomplete"},name:"TEMPLATE_ID",label:"SelectTemplate",placeholder:"SelectTemplate",runPostValidationForInitValue:!0,options:[],isFieldFocused:!0,validationRun:"all",postValidationSetCrossFieldValues:async(e,t)=>{const i=t?.templates??null;if(!i)return{};try{const r=i?.find(t=>t?.TEMPLATE_ID===e.value);return t?.handleSelectionModel(r),{EXPORT_TYPE:{value:r?.EXPORT_TYPE},SHOW_HEADER:{value:r?.SHOW_HEADER},PAGE_SIZE:{value:r?.PAGE_SIZE},ORIENTATION:{value:r?.ORIENTATION}}}catch(e){return console.log("err",e),{}}},shouldExclude:(e,t,i)=>!i?.templates,GridProps:{xs:6,md:3,sm:3}},{render:{componentType:"autocomplete"},name:"EXPORT_TYPE",label:"Selectfiletype",required:!0,defaultValue:"EXCEL",defaultOptionLabel:"Selectfiletype",options:[{label:"EXCEL (.xlsx)",value:"EXCEL"},{label:"CSV (.csv)",value:"CSV"},{label:"PDF (.pdf)",value:"PDF"},{label:"PLAIN TEXT (.txt)",value:"TEXT"},{label:"XML (.xml)",value:"XML"},{label:"HTML (.html)",value:"HTML"}],validationRun:"onChange",postValidationSetCrossFieldValues:(e,t)=>(t?.setSelectedFileType&&t?.setSelectedFileType(e.value),{}),schemaValidation:{type:"string",rules:[{name:"required",params:["ThisFieldisrequired"]}]},GridProps:{xs:6,md:3,sm:3}},{render:{componentType:"autocomplete"},name:"PAGE_SIZE",label:"Selectpagesize",defaultValue:"a4",defaultOptionLabel:"Select page size",dependentFields:["EXPORT_TYPE"],ignoreInSubmit:e=>"PDF"!==e?.EXPORT_TYPE?.value,shouldExclude:(e,t,i)=>"PDF"!==t?.EXPORT_TYPE?.value,options:[{label:"A3",value:"a3"},{label:"A4",value:"a4"},{label:"A5",value:"a5"},{label:"A6",value:"a6"},{label:"Letter",value:"letter"},{label:"Legal",value:"legal"}],required:!0,schemaValidation:{type:"string",rules:[{name:"required",params:["ThisFieldisrequired"]}]},GridProps:{xs:6,md:3,sm:3}},{render:{componentType:"autocomplete"},name:"ORIENTATION",label:"Selectorientation",defaultValue:"portrait",defaultOptionLabel:"Select orientation",dependentFields:["EXPORT_TYPE"],ignoreInSubmit:e=>"PDF"!==e?.EXPORT_TYPE?.value,shouldExclude:(e,t,i)=>"PDF"!==t?.EXPORT_TYPE?.value,options:[{label:"Portrait",value:"portrait"},{label:"Landscape",value:"landscape"}],required:!0,schemaValidation:{type:"string",rules:[{name:"required",params:["ThisFieldisrequired"]}]},GridProps:{xs:6,md:3,sm:3}},{render:{componentType:"checkbox"},name:"SHOW_HEADER",label:"ShowHeader",defaultValue:!0,GridProps:{xs:6,md:3,sm:3},fullWidth:!0,dependentFields:["EXPORT_TYPE"],ignoreInSubmit:e=>"XML"===e?.EXPORT_TYPE?.value||"TEXT"===e?.EXPORT_TYPE?.value||"CSV"===e?.EXPORT_TYPE?.value,shouldExclude:(e,t,i)=>"XML"===t?.EXPORT_TYPE?.value||"TEXT"===t?.EXPORT_TYPE?.value||"CSV"===t?.EXPORT_TYPE?.value},{render:{componentType:"checkbox"},name:"ALL_PAGE_HEADER",label:"ShowHeaderOnAllPage",defaultValue:!1,GridProps:{xs:6,md:3,sm:3},fullWidth:!0,dependentFields:["EXPORT_TYPE","SHOW_HEADER"],ignoreInSubmit:e=>"PDF"!==e?.EXPORT_TYPE?.value||!e?.SHOW_HEADER?.value,shouldExclude:(e,t,i)=>!t?.SHOW_HEADER?.value||"PDF"!==t?.EXPORT_TYPE?.value}]},ad=Ci(e=>({wrapper:{minHeight:"100vh",boxShadow:"0 3px 6px rgba(0,0,0,0.03)",[e.breakpoints.down("sm")]:{minHeight:"100vh"},background:"var(--theme-color2)"},loginEmp:{background:"#fff",padding:e.spacing(2,4),display:"flex",maxWidth:"400px",margin:"auto",boxShadow:"0 0 20px rgba(0,0,0,0.06)",borderRadius:"8px",[e.breakpoints.down("sm")]:{width:"100%"}},formWrap:{marginTop:e.spacing(2)},otpformWrap:{marginTop:e.spacing(2),marginBottom:e.spacing(2),display:"inline-flex"},loginBtn:{minWidth:"100% !important",margin:e.spacing(2,0),fontSize:"1rem",padding:"10px .75rem",background:"var(--theme-color1)",border:0,color:"#fff !important",fontWeight:600,letterSpacing:"0.02857em",boxShadow:"none",textTransform:"capitalize",alignSelf:"flex-end","&:hover":{background:"#fedad8",boxShadow:"none"}},OTPTimer:{marginTop:"10px",color:e.palette.primary.main,fontWeight:600},resendLink:{marginTop:"10px",cursor:"pointer",color:e.palette.secondary.main,fontWeight:600,fontSize:"0.875 rem"},logo:{marginBottom:e.spacing(1)},loginLeft:{display:"flex",justifyContent:"center",padding:"2rem",[e.breakpoints.down("sm")]:{display:"none"}},loginRight:{background:"#fff",padding:e.spacing(2,4),display:"flex",maxWidth:"400px",margin:"auto",boxShadow:"0 0 20px rgba(0,0,0,0.06)",borderRadius:"8px",[e.breakpoints.down("sm")]:{width:"100%"},"& img":{alignSelf:"center"}},loginImg:{},verifybutton:{alignSelf:"center",marginBottom:"10px",marginTop:"10px"},divflex:{display:"flex"},otpinputpadding:{"& input":{marginRight:"8px !important"}},otpinputform:{"& input":{marginRight:"10px !important",width:"42px !important",height:"42px !important",borderRadius:"8px",border:"1px solid #000"}},otpinputformauth:{"& input":{marginRight:"8px !important",width:"40px !important",height:"40px !important",borderRadius:"8px",border:"1px solid #000"}},ibtnvisible:{padding:"7px !important"},btnvisibleoff:{display:"none"},resendOTPalign:{textAlign:"center",marginTop:"15px",display:"block !important"},resendbtnLink:{textDecoration:"underline",color:"blue",cursor:"pointer","&:hover":{textDecoration:"underline",color:"blue"}},dialogTitleClass:{background:"var(--theme-color1)",padding:"8px 15px !important",color:"#fff","& h2":{color:"white",fontWeight:"500 !important"}},button:{display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",margin:"6px",background:"var(--theme-color1)","&:hover":{background:"var(--theme-color1) !important"}},lang_svg:{marginRight:"10px",width:"22px",height:"22px"}})),sd=({MessageTitle:r,Message:n,onClickButton:a,buttonNames:s=["Yes","No"],rows:l,open:c=!1,loading:d=!1,icon:u="INFO",defFocusBtnName:A="",loadingBtnName:p="",messageBoxConfig:f,enableEnterToFocus:m,focusScopeId:g="enter-to-focus-message-box"})=>{const{t:w}=W(),b=ad(),{enableEnterToFocus:v}=ns(),y=o(null),B={INFO:f?.iconsConfig?.INFO?.color??"dodgerblue",SUCCESS:f?.iconsConfig?.SUCCESS?.color??"green",WARNING:f?.iconsConfig?.WARNING?.color??"orange",ERROR:f?.iconsConfig?.ERROR?.color??"#f44336",CONFIRM:f?.iconsConfig?.CONFIRM?.color??"#474e5b"},C=f?.iconsConfig?.INFO?.icon??An,x=f?.iconsConfig?.SUCCESS?.icon??Tt,F=f?.iconsConfig?.WARNING?.icon??pn,S=f?.iconsConfig?.ERROR?.icon??Lt,N=f?.iconsConfig?.CONFIRM?.icon??kt;h(()=>{let e;return e=setTimeout(()=>{c&&y.current&&y.current.focus()},10),()=>clearTimeout(e)},[c,y.current]);const E=m??v;return e(i,{children:t($,{className:"message__box__base",onKeyDown:e=>{E&&Es(e,g)},maxWidth:"md",PaperProps:{style:{minWidth:"200px",maxWidth:"50%"}},open:c,...g&&E?{"data-scope-id":g}:{},children:[e(Z,{className:b.dialogTitleClass,style:{background:B[u]},children:w(r,{nsSeparator:"|"})}),t(ee,{sx:{paddingLeft:"10px",display:"flex",gap:"0.5rem"},children:[e(oe,{style:{position:"fixed"},children:"INFO"===u?e(C,{fontSize:"large",style:{color:B[u],width:"1.3em",height:"1.3em"}}):"WARNING"===u?e(F,{fontSize:"large",style:{color:B[u],width:"1.3em",height:"1.3em"}}):"SUCCESS"===u?e(x,{fontSize:"large",style:{color:B[u],width:"1.3em",height:"1.3em"}}):"ERROR"===u?e(S,{fontSize:"large",style:{color:B[u],width:"1.3em",height:"1.3em"}}):"CONFIRM"===u?e(N,{fontSize:"large",style:{color:B[u],width:"1.3em",height:"1.3em"}}):null}),e(te,{children:e(X,{style:{color:"black",whiteSpace:"pre-wrap",marginLeft:"3rem",paddingTop:"0.6rem"},children:n.startsWith("\n")?w(n?.slice(1),{nsSeparator:"|"}):w(n,{nsSeparator:"|"})})})]}),e(ie,{children:s.map((t,i)=>{const r=Boolean(A)&&A===t,n=!Boolean(A)&&0===i;return e(eo,{ref:r||n?y:null,sx:{background:B[u],"&:hover":{background:B[u]}},disabled:d,endIcon:p===t&&d?e(he,{size:20}):null,onClick:()=>"function"==typeof a?a(t):void 0,children:w(t)})})})]})})},od=[];for(let e=0;e<256;++e)od.push((e+256).toString(16).slice(1));let ld;const hd=new Uint8Array(16);var cd={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function dd(e,t,i){if(cd.randomUUID&&!e)return cd.randomUUID();const r=(e=e||{}).random??e.rng?.()??function(){if(!ld){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");ld=crypto.getRandomValues.bind(crypto)}return ld(hd)}();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=15&r[6]|64,r[8]=63&r[8]|128,function(e,t=0){return(od[e[t+0]]+od[e[t+1]]+od[e[t+2]]+od[e[t+3]]+"-"+od[e[t+4]]+od[e[t+5]]+"-"+od[e[t+6]]+od[e[t+7]]+"-"+od[e[t+8]]+od[e[t+9]]+"-"+od[e[t+10]]+od[e[t+11]]+od[e[t+12]]+od[e[t+13]]+od[e[t+14]]+od[e[t+15]]).toLowerCase()}(r)}const ud={isOpen:!1,messageTitle:"",message:"",icon:"INFO",buttonNames:["Ok"],defFocusBtnName:"",loadingBtnName:[""],focusScopeId:"enter-to-focus-message-box",enableEnterToFocus:void 0},Ad=n({MessageBox:()=>{},CloseMessageBox:()=>{}}),pd=({messageBoxConfig:r,children:n})=>{const[a,s]=d(ud),[o,l]=d(!1),[h,c]=d(),u=()=>{l(!1),s(ud)};return e(Ad.Provider,{value:{MessageBox:({messageTitle:e,message:t,icon:i="INFO",buttonNames:n=["Ok"],defFocusBtnName:a="",loadingBtnName:o=[""],enableEnterToFocus:h,focusScopeId:d="enter-to-focus-message-box"})=>(l(!1),new Promise(A=>{s({isOpen:!0,messageTitle:e,message:t,icon:i,buttonNames:n,callBack:e=>{A(e);const t=o?.find(t=>t===e);t?(l(!0),c(t)):u()},defFocusBtnName:a,loadingBtnName:o,enableEnterToFocus:h??r?.enableEnterToFocus??!1,focusScopeId:d})})),CloseMessageBox:u,messageBoxConfig:r,isMessageBoxOpen:a.isOpen},children:t(i,{children:[n,a.isOpen?e(sd,{open:a.isOpen,Message:a.message,MessageTitle:a.messageTitle,rows:[],onClickButton:a.callBack,buttonNames:a.buttonNames,icon:a.icon,defFocusBtnName:a.defFocusBtnName,loading:o,loadingBtnName:h,messageBoxConfig:r,enableEnterToFocus:a.enableEnterToFocus,focusScopeId:a.focusScopeId},dd()):null]})})},fd=()=>a(Ad),md={loading:!1,isError:!1,userMessage:""},gd=({TitleText:r,onActionNo:n,onActionYes:a,isRequired:s=!0,isEntertoSubmit:l=!1,AcceptbuttonLabelText:h="Yes",CanceltbuttonLabelText:c="No",isLoading:u=!1,open:A=!1,label:p="Remarks",placeholder:f="EnterRemarks",defaultValue:m="",rows:g,customRequiredMessage:w="",maxLength:b=200,showMaxLength:v=!1,enableEnterToFocus:y,focusScopeId:B="enter-to-focus-remarks",preventSpecialChars:C=null})=>{const{enableEnterToFocus:x}=ns(),[F,S]=d(m),[N,E]=d(md),k=ad(),T=o(null),{t:L}=W(),I=o(null),D=y??x;return e(i,{children:t($,{fullWidth:!0,open:A,className:"remarks__wrapper__base",onKeyDown:e=>{D&&Es(e,B)},...B&&D?{"data-scope-id":B}:{},children:[e(Z,{className:k.dialogTitleClass,children:L(r)}),e(ee,{sx:{mt:2},children:e(Ao,{autoFocus:!0,label:L(p),placeholder:String(L(`${f}`)),fullWidth:!0,type:"text",name:"remarks",value:F||"",onChange:e=>{e.target.value.trimStart().length<=b&&(e=>{const t="function"==typeof C?C():C;t&&e.target.value&&t.split("").some(t=>e.target.value.includes(t))||(S(e.target.value.trimStart()),e.target.value.trimStart()&&E(e=>({...e,isError:!1,userMessage:""})))})(e)},error:N.isError,helperText:t("div",{style:{display:"flex"},children:[e(le,{children:N.isError?N.userMessage:""}),b>0&&Boolean(v)?t(le,{error:!1,style:{flex:1,textAlign:"right",margin:"5px 15px 0 0"},children:[F.length,"/",b]}):null]}),InputLabelProps:{shrink:!0},disabled:u,autoComplete:"off",ref:T,required:s,onKeyPress:e=>{"Enter"===e.key&&l&&I?.current?.click?.()}})}),t(ie,{className:k.verifybutton,children:[e(eo,{endIcon:u?e(G,{size:20}):null,disabled:u,onClick:()=>{!Boolean(F)&&s?E(e=>({...e,isError:!0,userMessage:L(w||"ThisFieldisrequired")})):a(F,g)},ref:I,children:L(h)}),e(eo,{disabled:u,onClick:()=>{n()},children:L(c)})]})]})})};io('.modal-backdrop{background-color:#000;bottom:0;left:0;opacity:.2;position:fixed;right:0;top:0;z-index:9999}.modal-backdrop.fade{opacity:0}.modal-backdrop,.modal-backdrop.fade.in{filter:alpha(opacity=80);opacity:.2}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(1turn)}}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.sk-fading-circle{height:65px;left:48%;position:relative;width:65px}.sk-fading-circle .sk-circle{height:100%;left:0;position:absolute;top:0;width:100%}.sk-fading-circle .sk-circle:before{-webkit-animation:sk-circleFadeDelay 1.2s ease-in-out infinite both;animation:sk-circleFadeDelay 1.2s ease-in-out infinite both;background-color:red;border-radius:100%;content:"";display:block;height:15%;margin:0 auto;width:15%}.sk-fading-circle .sk-circle2{-webkit-transform:rotate(30deg);-ms-transform:rotate(30deg);transform:rotate(30deg)}.sk-fading-circle .sk-circle3{-webkit-transform:rotate(60deg);-ms-transform:rotate(60deg);transform:rotate(60deg)}.sk-fading-circle .sk-circle4{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.sk-fading-circle .sk-circle5{-webkit-transform:rotate(120deg);-ms-transform:rotate(120deg);transform:rotate(120deg)}.sk-fading-circle .sk-circle6{-webkit-transform:rotate(150deg);-ms-transform:rotate(150deg);transform:rotate(150deg)}.sk-fading-circle .sk-circle7{-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.sk-fading-circle .sk-circle8{-webkit-transform:rotate(210deg);-ms-transform:rotate(210deg);transform:rotate(210deg)}.sk-fading-circle .sk-circle9{-webkit-transform:rotate(240deg);-ms-transform:rotate(240deg);transform:rotate(240deg)}.sk-fading-circle .sk-circle10{-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.sk-fading-circle .sk-circle11{-webkit-transform:rotate(300deg);-ms-transform:rotate(300deg);transform:rotate(300deg)}.sk-fading-circle .sk-circle12{-webkit-transform:rotate(330deg);-ms-transform:rotate(330deg);transform:rotate(330deg)}.sk-fading-circle .sk-circle2:before{-webkit-animation-delay:-1.1s;animation-delay:-1.1s}.sk-fading-circle .sk-circle3:before{-webkit-animation-delay:-1s;animation-delay:-1s}.sk-fading-circle .sk-circle4:before{-webkit-animation-delay:-.9s;animation-delay:-.9s}.sk-fading-circle .sk-circle5:before{-webkit-animation-delay:-.8s;animation-delay:-.8s}.sk-fading-circle .sk-circle6:before{-webkit-animation-delay:-.7s;animation-delay:-.7s}.sk-fading-circle .sk-circle7:before{-webkit-animation-delay:-.6s;animation-delay:-.6s}.sk-fading-circle .sk-circle8:before{-webkit-animation-delay:-.5s;animation-delay:-.5s}.sk-fading-circle .sk-circle9:before{-webkit-animation-delay:-.4s;animation-delay:-.4s}.sk-fading-circle .sk-circle10:before{-webkit-animation-delay:-.3s;animation-delay:-.3s}.sk-fading-circle .sk-circle11:before{-webkit-animation-delay:-.2s;animation-delay:-.2s}.sk-fading-circle .sk-circle12:before{-webkit-animation-delay:-.1s;animation-delay:-.1s}@-webkit-keyframes sk-circleFadeDelay{0%,39%,to{opacity:0}40%{opacity:1}}@keyframes sk-circleFadeDelay{0%,39%,to{opacity:0}40%{opacity:1}}');const wd=i=>e(ni,{style:{width:"100%"},children:t("div",{className:"loading",style:{textAlign:"center",margin:"2px"},children:[e("div",{className:"bounceball"}),e("div",{className:"text-forloader",children:e(no,{text:"Loading..."},"loaderWithbounce")})]})});io('.wrap-forloader{left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}.text-forloader{color:var(--theme-color1);display:inline-block;font-family:Franklin Gothic Medium,Arial Narrow,Arial,sans-serif;margin-left:5px}.bounceball{display:inline-block;height:37px;position:relative;width:15px}.bounceball:before{animation:bounce .5s ease infinite alternate;background-color:var(--theme-color1);border-radius:50%;content:"";display:block;height:15px;position:absolute;top:0;transform-origin:50%;width:15px}@keyframes bounce{0%{border-radius:60px 60px 20px 20px;height:5px;top:30px;transform:scaleX(2)}35%{border-radius:50%;height:15px;transform:scaleX(1)}to{top:0}}');const bd=()=>{const{t:i}=W();return e("div",{className:"wrap-forloader",children:t("div",{className:"loading",children:[e("div",{className:"bounceball"}),t("div",{className:"text-forloader",children:[i("Loading"),"..."]})]})})},vd=Ci(e=>({dataGrid:{fontWeight:500,fontFamily:'"Roboto", "Helvetica", "Arial", "sans-serif" !important',fontSize:"0.9rem",letterSpacing:"0.01071em","& .MuiDataGrid-columnHeaderTitle":{color:"var(--theme-color1)",fontWeight:700},"& .Mui-checked":{color:"var(--theme-color1)"},"& .MuiCheckbox-indeterminate":{color:e.palette.text.secondary}}})),yd=e=>e.trim().split(","),Bd=({globalFilter:r="",filters:n=[],queryFilters:a=[],onClose:c,rows:u,columns:A,title:p,pageNumber:f,totalPageCount:m,enablePdfPrint:g,reportTemplateCode:w,enableEnterToFocus:b})=>{const{dynamicAmountSymbol:v,defaultExportConfig:y}=ns(),{MessageBox:B}=fd(),{authState:C}=es(),{pdfExporter:x,excelExporter:F,csvExporter:S,textExporter:N,htmlExporter:E,xmlExporter:k,setWorkerQueue:T,setDownloadProgress:L,status:I,markComplete:P}=id(),R=o(null);R.current=I;const{t:O}=W(),Q=o([]),H=vd(),M=o(null),{enqueueSnackbar:_}=fr(),[j,z]=d(""),V=o(null),K=o(void 0),[q,G]=d(!1),{data:J,isLoading:Y,isFetching:Z,isError:ee,error:te}=zt(["getPersonalizationData",w],()=>y?.getPersonalizedReportData?.(w,C?.user?.id)??Promise.resolve(null),{enabled:Boolean(w),cacheTime:0}),re=s(()=>{if(!J)return nd;const e=D(nd),t=J.map(e=>({label:e.TEMPLATE_LABEL,value:e.TEMPLATE_ID}));return e.fields[0].options=t,e},[J,nd]),ne=s(()=>J?J.find(e=>"Y"===e?.DEFAULT_FLAG):null,[J]),ae=s(()=>A.filter(e=>"ButtonRowCell"!==e?.Cell?.name&&e?.Cell!==jc&&"buttonRowCell"!==e?.componentType&&!0!==e.isHiddenColumn),[]),se=s(()=>ae.reduce((e,t)=>({...e,[t?.accessor]:t?.columnName}),{}),[]),oe=s(()=>ae.map((e,t)=>({id:e.accessor,__srno__:t+1,cname:e.columnName,[e.accessor]:e.accessor,cellType:e?.Cell===Tc||"dateTime"===e?.componentType?"DateTimeCell":e?.Cell===Lc||"date"===e?.componentType?"DateCell":e?.Cell===qc?"TimeCell":e?.Cell===Vc||"currency"===e.componentType?"currency":"",format:e?.format?e?.format:e?.dateFormat?e?.dateFormat:"currency"===e.componentType||e?.Cell===Vc?$o(e?.currencyRefColumn??v,!1)??"":"",...e?.isAutoSequence?{isAutoSequence:!0}:{}})),[]),[le,he]=d([]);Q.current=le,h(()=>{he(()=>ne?yd(ne.SELECTION_MODEL):oe.map(e=>e.id)),z(e=>ne?.EXPORT_TYPE??e)},[ne]);const ce=l(e=>{he(t=>e?.SELECTION_MODEL?yd(e?.SELECTION_MODEL):t),V.current=e},[he,V.current]),de=s(()=>{const e=oe[0]?.isAutoSequence?Object.keys(oe[0]).find(e=>!["id","__srno__","cname","cellType","format","isAutoSequence"].includes(e))??"":"";return u.map((t,i)=>Boolean(e)?{...t?.values,[e]:i+1}:t?.values)},[]),ue=l((e="report")=>{const t=(new Date).getTime(),i={id:t,title:e,isCompleted:!1};return T(e=>[i,...e]),t},[]),Ae=async(e,t)=>await un({url:e,method:"GET",responseType:"blob",onDownloadProgress:e=>{let i=Math.round(100*e.loaded/e.total);L(e=>({...e,[t]:100!==i}))}}),pe=n?.map(e=>{const t=D(e);return t?.value?.columnName&&(t.value.columnName=O(t.value.columnName)),t}),fe=l(async e=>{G(!0),await new Promise(t=>{K.current={handleClose:()=>{G(!1),t("")},handleAccept:i=>{const r={...e,TEMPLATE_ID:"",GRID_ID:w,NEW_TEMPLATE_NAME:i,SELECTION_MODEL:Q.current?.join(","),USER_ID:C?.user?.id,isNewRow:!0};try{"function"==typeof y?.saveUpdateTemplateApiFn?y?.saveUpdateTemplateApiFn(r):console.error("No function provided to save/update template!")}catch(e){console.log("Error while saving template: ",e)}G(!1),t("")}}})},[w,y,Q.current]);return t(i,{children:[Y||Z?e($,{open:!0,TransitionComponent:ph,PaperProps:{style:{width:"65%"}},className:"report__export__dialog__base",maxWidth:"lg",children:e(wd,{})}):t($,{open:!0,TransitionComponent:ph,PaperProps:{style:{width:"65%"}},className:"report__export__dialog__base",maxWidth:"lg",onKeyDown:e=>{b&&Es(e,"report__export__dialog__base")},"data-scope-id":"report__export__dialog__base",children:[ee?e(to,{severity:"error",errorMsg:te?.error_msg??O("Somethingwenttowrong"),errorDetail:te?.error_detail,color:"error"}):null,e(Nc,{metaData:re,initialValues:ne,onSubmitHandler:async(e,t,i,n,s)=>{if(i(!0),0===de.length)return void _(O("Nodatafoundtoexports"),{variant:"error"});if(0===Q.current.length)return void _(O("Pleaseselectatleastonecolumn"),{variant:"error"});"SHOW_HEADER"in e&&(e.SHOW_HEADER="Y"===e.SHOW_HEADER||!0===e.SHOW_HEADER?"Y":"N"),V.current&&"SHOW_HEADER"in V.current&&(V.current.SHOW_HEADER="Y"===V.current.SHOW_HEADER||!0===V.current.SHOW_HEADER?"Y":"N"),"ALL_PAGE_HEADER"in e&&(e.ALL_PAGE_HEADER="Y"===e.ALL_PAGE_HEADER||!0===e.ALL_PAGE_HEADER?"Y":"N"),V.current&&"ALL_PAGE_HEADER"in V.current&&(V.current.ALL_PAGE_HEADER="Y"===V.current.ALL_PAGE_HEADER||!0===V.current.ALL_PAGE_HEADER?"Y":"N");const o={columns:oe,rows:de,title:p,columnsSelected:Q.current,data:e,auth:C,retrievalParams:a?.map(e=>({...e,value:{...e.value,columnName:O(e?.value?.columnName??""),label:O(e?.value?.label??"")}})),filters:pe,globalFilter:r,columnLabel:se,pageNumber:f,totalPageCount:m,primaryTheme:Ns("--report-export-theme")||"#800000"};if(J&&!Boolean(e?.TEMPLATE_ID)){"Yes"===await B({message:"DoYouWantToSaveNewTemplate",messageTitle:"Save",buttonNames:["Yes","No"],defFocusBtnName:"Yes",icon:"CONFIRM"})&&await fe(e)}else if(J){const t=vs(e,V.current);if(t._UPDATEDCOLUMNS.length||!((e,t,i)=>{const r=e?.find(e=>e?.TEMPLATE_ID===i),n=r?.SELECTION_MODEL?yd(r?.SELECTION_MODEL):[],a=n?.toSorted(),s=t?.toSorted();return U(a,s)})(J,Q.current,e.TEMPLATE_ID)){const i=await B({message:"DoYouWantToUpdateThisTemplate",messageTitle:"Update",buttonNames:["ReportPersonalizationUpdate","ReportPersonalizationSaveAsNew","ExportWithoutSave"],defFocusBtnName:"ReportPersonalizationUpdate",icon:"CONFIRM"});if("ReportPersonalizationUpdate"===i)try{const i={...e,...t,GRID_ID:w,USER_ID:C?.user?.id,SELECTION_MODEL:Q.current?.join(","),isNewRow:!1},r=Q.current?.join(","),n=V.current?.SELECTION_MODEL;r!==n&&(i.OLD_SELECTION_MODEL=n),"function"==typeof y?.saveUpdateTemplateApiFn?y?.saveUpdateTemplateApiFn(i):console.error("No function provided to save/update template!")}catch(e){console.log("err",e)}else"ReportPersonalizationSaveAsNew"===i&&await fe(e)}}switch(e.EXPORT_TYPE){case"EXCEL":if(R.current.excelStatus===cn.RUNNING)return void console.log("excel in operation");let e=ue(`${p} - Excel`);F(o).then(async t=>{const i=URL.createObjectURL(t.blob),r=await Ae(i,"excel"),n=URL.createObjectURL(new Blob([r.data],{type:"application/octet-stream"})),a=document.createElement("a");a.href=n,a.download=t.downloadTitle,a.click(),URL.revokeObjectURL(n),P(e,"excel")});break;case"CSV":if(R.current.csvStatus===cn.RUNNING)return void console.log("csv in operation");let t=ue(`${p} - Csv`);S(o).then(async e=>{const i=URL.createObjectURL(e.blob),r=await Ae(i,"csv"),n=URL.createObjectURL(new Blob([r.data])),a=document.createElement("a");a.href=n,a.download=e.downloadTitle,a.click(),URL.revokeObjectURL(n),P(t,"csv")});break;case"PDF":if(R.current.pdfStatus===cn.RUNNING)return void console.log("pdf in operation");let i=ue(`${p} - Pdf`);x({...o,banklogo:`${new URL(window.location.href).origin}/bank-logo.jpg`}).then(async e=>{const t=await Ae(e.blob,"pdf"),r=URL.createObjectURL(new Blob([t.data],{type:"application/pdf"}));if("EXPORT"===s){const t=document.createElement("a");t.href=r,t.download=e.downloadTitle,document.body.appendChild(t),t.click(),document.body.removeChild(t)}P(i,"pdf",r,Boolean(g))});break;case"TEXT":if(R.current.textStatus===cn.RUNNING)return void console.log("text in operation");let r=ue(`${p} - Text`);N(o).then(async e=>{const t=URL.createObjectURL(e.blob),i=await Ae(t,"text"),n=URL.createObjectURL(new Blob([i.data])),a=document.createElement("a");a.href=n,a.download=e.downloadTitle,a.click(),URL.revokeObjectURL(n),P(r,"text")});break;case"XML":if(R.current.xmlStatus===cn.RUNNING)return void console.log("xml in operation");let n=ue(`${p} - Xml`);k(o).then(async e=>{const t=URL.createObjectURL(e.blob),i=await Ae(t,"xml"),r=URL.createObjectURL(new Blob([i.data])),a=document.createElement("a");a.href=r,a.download=e.downloadTitle,a.click(),URL.revokeObjectURL(r),P(n,"xml")});break;case"HTML":if(R.current.htmlStatus===cn.RUNNING)return void console.log("html in operation");let a=ue(`${p} - Html`);E(o).then(async e=>{const t=URL.createObjectURL(e.blob),i=await Ae(t,"html"),r=URL.createObjectURL(new Blob([i.data])),n=document.createElement("a");n.href=r,n.download=e.downloadTitle,n.click(),URL.revokeObjectURL(r),P(a,"html")})}_(O("ReportExportStatus"),{variant:"exportReportSnackbar",preventDuplicate:!0,persist:!0,anchorOrigin:{horizontal:"right",vertical:"bottom"}}),c()},formState:{setSelectedFileType:g?z:void 0,handleSelectionModel:ce,templates:J},displayMode:null,formStyle:{background:"white"},ref:M,enableEnterToFocus:!1},"ExportReportForm"),e(X,{style:{paddingLeft:".75rem"},variant:"caption",display:"block",gutterBottom:!0,children:0===de.length?`${O("Nodatafoundtoexport")}`:`${de.length} ${O("rowswillbeexported")}`}),e("div",{style:{height:"50vh",width:"100%"},children:e(hn,{className:H.dataGrid,rows:oe,rowHeight:36,columnHeaderHeight:40,columns:[{field:"__srno__",headerName:String(O("SrNo")),width:100},{field:"cname",headerName:String(O("ColumnstoExport")),width:300}],paginationModel:{page:0,pageSize:50},checkboxSelection:!0,disableRowSelectionOnClick:!0,disableColumnMenu:!0,rowSelectionModel:le,onRowSelectionModelChange:he,hideFooter:!0,style:{fontWeight:500}})}),t(ie,{style:{display:"flex",justifyContent:"center"},children:[g&&"PDF"===j?e(eo,{onClick:e=>{M.current?.handleSubmit(e,"PRINT")},shortcut:"alt",eventKey:"p",children:O("Print")}):null,e(eo,{onClick:e=>{M.current?.handleSubmit(e,"EXPORT")},shortcut:"alt",eventKey:"x",children:O("Export")}),e(eo,{onClick:()=>c(),shortcut:"alt",eventKey:"c",children:O("Close")})]})]}),q?e(gd,{TitleText:"DoYouWantToSaveNewTemplate",onActionNo:K.current.handleClose,onActionYes:K.current.handleAccept,rows:{},open:q,label:"TemplateName",placeholder:"EnterTemplateName",AcceptbuttonLabelText:"SaveNewTemplate",CanceltbuttonLabelText:"ExportWithoutSave"}):null]})};var Cd="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},xd=fn.performance||{};xd.now||xd.mozNow||xd.msNow||xd.oNow||xd.webkitNow;var Fd,Sd={},Nd={exports:{}},Ed={exports:{}},kd={};var Td,Ld,Id,Dd,Ud,Pd,Rd,Od,Qd,Hd,Md,_d,jd,zd,Vd,Kd={};function qd(){return Ld||(Ld=1,"production"===Sd.NODE_ENV?Ed.exports=function(){if(Fd)return kd;Fd=1;var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,i=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,n=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,o=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,h=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,u=e?Symbol.for("react.suspense_list"):60120,A=e?Symbol.for("react.memo"):60115,p=e?Symbol.for("react.lazy"):60116,f=e?Symbol.for("react.block"):60121,m=e?Symbol.for("react.fundamental"):60117,g=e?Symbol.for("react.responder"):60118,w=e?Symbol.for("react.scope"):60119;function b(e){if("object"==typeof e&&null!==e){var u=e.$$typeof;switch(u){case t:switch(e=e.type){case l:case h:case r:case a:case n:case d:return e;default:switch(e=e&&e.$$typeof){case o:case c:case p:case A:case s:return e;default:return u}}case i:return u}}}function v(e){return b(e)===h}return kd.AsyncMode=l,kd.ConcurrentMode=h,kd.ContextConsumer=o,kd.ContextProvider=s,kd.Element=t,kd.ForwardRef=c,kd.Fragment=r,kd.Lazy=p,kd.Memo=A,kd.Portal=i,kd.Profiler=a,kd.StrictMode=n,kd.Suspense=d,kd.isAsyncMode=function(e){return v(e)||b(e)===l},kd.isConcurrentMode=v,kd.isContextConsumer=function(e){return b(e)===o},kd.isContextProvider=function(e){return b(e)===s},kd.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},kd.isForwardRef=function(e){return b(e)===c},kd.isFragment=function(e){return b(e)===r},kd.isLazy=function(e){return b(e)===p},kd.isMemo=function(e){return b(e)===A},kd.isPortal=function(e){return b(e)===i},kd.isProfiler=function(e){return b(e)===a},kd.isStrictMode=function(e){return b(e)===n},kd.isSuspense=function(e){return b(e)===d},kd.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===h||e===a||e===n||e===d||e===u||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===A||e.$$typeof===s||e.$$typeof===o||e.$$typeof===c||e.$$typeof===m||e.$$typeof===g||e.$$typeof===w||e.$$typeof===f)},kd.typeOf=b,kd}():Ed.exports=(Td||(Td=1,"production"!==Sd.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,i=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,n=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,o=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,h=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,u=e?Symbol.for("react.suspense_list"):60120,A=e?Symbol.for("react.memo"):60115,p=e?Symbol.for("react.lazy"):60116,f=e?Symbol.for("react.block"):60121,m=e?Symbol.for("react.fundamental"):60117,g=e?Symbol.for("react.responder"):60118,w=e?Symbol.for("react.scope"):60119;function b(e){if("object"==typeof e&&null!==e){var u=e.$$typeof;switch(u){case t:var f=e.type;switch(f){case l:case h:case r:case a:case n:case d:return f;default:var m=f&&f.$$typeof;switch(m){case o:case c:case p:case A:case s:return m;default:return u}}case i:return u}}}var v=l,y=h,B=o,C=s,x=t,F=c,S=r,N=p,E=A,k=i,T=a,L=n,I=d,D=!1;function U(e){return b(e)===h}Kd.AsyncMode=v,Kd.ConcurrentMode=y,Kd.ContextConsumer=B,Kd.ContextProvider=C,Kd.Element=x,Kd.ForwardRef=F,Kd.Fragment=S,Kd.Lazy=N,Kd.Memo=E,Kd.Portal=k,Kd.Profiler=T,Kd.StrictMode=L,Kd.Suspense=I,Kd.isAsyncMode=function(e){return D||(D=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),U(e)||b(e)===l},Kd.isConcurrentMode=U,Kd.isContextConsumer=function(e){return b(e)===o},Kd.isContextProvider=function(e){return b(e)===s},Kd.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Kd.isForwardRef=function(e){return b(e)===c},Kd.isFragment=function(e){return b(e)===r},Kd.isLazy=function(e){return b(e)===p},Kd.isMemo=function(e){return b(e)===A},Kd.isPortal=function(e){return b(e)===i},Kd.isProfiler=function(e){return b(e)===a},Kd.isStrictMode=function(e){return b(e)===n},Kd.isSuspense=function(e){return b(e)===d},Kd.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===h||e===a||e===n||e===d||e===u||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===A||e.$$typeof===s||e.$$typeof===o||e.$$typeof===c||e.$$typeof===m||e.$$typeof===g||e.$$typeof===w||e.$$typeof===f)},Kd.typeOf=b}()),Kd)),Ed.exports}
1
+ import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import r,{createContext as n,useContext as a,useMemo as s,useRef as o,useCallback as l,useEffect as h,forwardRef as c,useState as d,createElement as u,memo as A,useImperativeHandle as p,Fragment as f,lazy as m,cloneElement as g,Suspense as w,Children as b}from"react";import v from"@mui/icons-material/Visibility";import y from"@mui/icons-material/VisibilityOff";import B from"@mui/material/InputAdornment";import C from"@mui/material/IconButton";import{clone as x,toPath as F,merge as S,cloneDeep as N}from"lodash-es";import*as E from"yup";import k from"date-fns/format";import T,{toNumber as L,isEmpty as I,cloneDeep as D,isEqual as U,isArray as P}from"lodash";import{useAtomValue as R,useAtom as O,useSetAtom as Q}from"jotai/react";import{atomWithReset as H,RESET as M,useAtomCallback as _}from"jotai/utils";import{useAtom as j,useAtomValue as z,useSetAtom as V}from"jotai";import K from"@mui/material/MenuItem";import q from"@mui/material/Grid";import G from"@mui/material/CircularProgress";import{useTranslation as W}from"react-i18next";import J from"clsx";import{Typography as X,Button as Y,Dialog as $,DialogTitle as Z,DialogContent as ee,DialogContentText as te,DialogActions as ie,useTheme as re,Tooltip as ne,FormControlLabel as ae,InputAdornment as se,Box as oe,FormHelperText as le,CircularProgress as he,TableFooter as ce,IconButton as de,Popper as ue,styled as Ae,Card as pe,CardHeader as fe,CardContent as me,Grid as ge,Divider as we,Stack as be,Hidden as ve,Autocomplete as ye,Drawer as Be,AppBar as Ce,Toolbar as xe,Popover as Fe,Select as Se,MenuItem as Ne,TablePagination as Ee,Switch as ke,TextField as Te,TableBody as Le,TableHead as Ie,TableContainer as De,Paper as Ue,TableRow as Pe,Table as Re,TableCell as Oe,LinearProgress as Qe}from"@mui/material";import{isBefore as He,isAfter as Me,isEqual as _e,parse as je,format as ze,isValid as Ve,differenceInCalendarDays as Ke}from"date-fns";import qe,{t as Ge}from"i18next";import We from"pako";import Je from"@mui/material/FormLabel";import Xe from"@mui/material/FormGroup";import Ye from"@mui/material/FormControlLabel";import $e from"@mui/material/FormControl";import Ze from"@mui/material/FormHelperText";import{Engine as et}from"json-rules-engine";import*as tt from"xlsx";import{utils as it,writeFile as rt}from"xlsx";import nt from"@mui/material/Alert";import at from"@mui/material/Card";import st from"@mui/material/CardContent";import ot from"@mui/material/CardActions";import lt from"@mui/material/CardHeader";import ht from"@mui/material/Collapse";import ct from"@mui/material/Button";import dt from"@mui/material/Dialog";import ut from"@mui/material/DialogTitle";import At from"@mui/material/DialogActions";import pt from"@mui/material/DialogContent";import ft from"@mui/lab/Alert";import mt from"@mui/material/LinearProgress";import{NativeTypes as gt}from"react-dnd-html5-backend";import{useDrag as wt,useDrop as bt}from"react-dnd";import vt from"@mui/material/Typography";import yt from"@mui/icons-material/GetAppRounded";import Bt from"@mui/icons-material/Close";import Ct from"papaparse";import xt from"@mui/icons-material/ZoomIn";import Ft from"@mui/icons-material/ZoomOut";import St from"@mui/icons-material/CenterFocusStrong";import Nt from"@mui/icons-material/AddCircleOutline";import Et from"@mui/icons-material/RemoveCircleOutline";import kt from"@mui/icons-material/Help";import Tt from"@mui/icons-material/CheckCircle";import Lt from"@mui/icons-material/Cancel";import It from"@mui/material/Switch";import Dt from"@mui/material/Slider";import Ut from"@mui/material/InputLabel";import Pt from"@mui/material/Rating";import Rt from"@mui/material/ToggleButton";import Ot from"@mui/icons-material/Person";import Qt from"@mui/icons-material/Business";import{NumericFormat as Ht}from"react-number-format";import Mt from"lodash-es/cloneDeep";import _t from"@mui/material/TextField";import{QueryClient as jt,useQuery as zt,useMutation as Vt,useQueries as Kt}from"react-query";import{useAsyncDebounce as qt,useTable as Gt,useGlobalFilter as Wt,useColumnOrder as Jt,useGroupBy as Xt,useSortBy as Yt,useExpanded as $t,usePagination as Zt,useRowSelect as ei,useResizeColumns as ti,useBlockLayout as ii,useFilters as ri}from"react-table";import ni from"@mui/material/Paper";import ai from"@mui/material/Toolbar";import si from"@mui/material/TableContainer";import oi from"@mui/material/Table";import li from"@mui/material/TableHead";import hi from"@mui/material/TableRow";import ci from"@mui/material/TableCell";import di from"@mui/material/TableBody";import ui from"@mui/material/Checkbox";import"regenerator-runtime/runtime";import Ai,{createFilterOptions as pi,autocompleteClasses as fi}from"@mui/material/Autocomplete";import mi from"@mui/material/Input";import gi from"@mui/material/Chip";import wi from"autosuggest-highlight/match";import bi from"autosuggest-highlight/parse";import{styled as vi,alpha as yi,lighten as Bi}from"@mui/material/styles";import{makeStyles as Ci,withStyles as xi,createStyles as Fi}from"@mui/styles";import Si from"@mui/material/useMediaQuery";import{VariableSizeList as Ni,FixedSizeList as Ei}from"react-window";import ki from"@mui/icons-material/Refresh";import Ti from"@mui/material/Select";import{IMaskInput as Li}from"react-imask";import Ii,{tooltipClasses as Di}from"@mui/material/Tooltip";import Ui from"date-fns/subDays";import Pi from"@mui/material/ButtonGroup";import Ri from"@mui/icons-material/MoreHoriz";import Oi from"@mui/icons-material/DeleteOutline";import{LocalizationProvider as Qi}from"@mui/x-date-pickers/LocalizationProvider";import{AdapterDateFns as Hi}from"@mui/x-date-pickers/AdapterDateFns";import Mi from"@mui/material/Avatar";import _i,{stepConnectorClasses as ji}from"@mui/material/StepConnector";import zi from"@mui/material/TableSortLabel";import Vi from"@mui/material/TablePagination";import Ki from"@mui/icons-material/GetApp";import qi,{PrintContextConsumer as Gi}from"react-to-print";import Wi from"@mui/icons-material/Print";import{useLocation as Ji}from"react-router-dom";import*as Xi from"@mui/icons-material";import{KeyboardDoubleArrowLeft as Yi,ChevronLeft as $i,ChevronRight as Zi,KeyboardDoubleArrowRight as er,CheckCircle as tr,Help as ir,Cancel as rr,ExpandLess as nr,ExpandMore as ar}from"@mui/icons-material";import sr from"@mui/material/RadioGroup";import or from"@mui/material/Radio";import lr from"@mui/material/ToggleButtonGroup";import{LocalizationProvider as hr,DatePicker as cr}from"@mui/x-date-pickers";import dr from"@mui/material/Container";import ur from"@mui/material/Divider";import Ar from"@mui/material/AppBar";import pr from"@mui/icons-material/HighlightOffOutlined";import{useSnackbar as fr,SnackbarProvider as mr}from"notistack";import gr from"@mui/material/Tabs";import wr from"@mui/material/Tab";import br from"@mui/icons-material/ArrowRightSharp";import vr from"@mui/icons-material/ArrowDropDownSharp";import yr from"@mui/icons-material/TableView";import Br from"@mui/icons-material/FilterList";import Cr from"@mui/icons-material/FilterAlt";import{matchSorter as xr}from"match-sorter";import{ModuleRegistry as Fr,AllCommunityModule as Sr,ClientSideRowModelModule as Nr,RowApiModule as Er,PinnedRowModule as kr}from"ag-grid-community";import{AgGridReact as Tr}from"ag-grid-react";import Lr from"react-dom";import Ir from"@mui/material/TextareaAutosize";import Dr from"@mui/material/List";import Ur from"@mui/material/ListItem";import Pr from"@mui/material/ListItemText";import Rr from"@mui/material/ListItemIcon";import Or from"@mui/icons-material/Search";import{atom as Qr}from"jotai/vanilla";import{atomFamily as Hr}from"jotai-family";import{DatePicker as Mr}from"@mui/x-date-pickers/DatePicker";import{TimePicker as _r}from"@mui/x-date-pickers/TimePicker";import{DateTimePicker as jr}from"@mui/x-date-pickers/DateTimePicker";import zr from"@mui/material/Menu";import Vr from"@mui/icons-material/PlayArrow";import Kr from"@mui/icons-material/Pause";import qr from"@mui/icons-material/FilterListTwoTone";import Gr from"@mui/material/Drawer";import Wr from"@mui/material/MenuList";import Jr from"@mui/icons-material/ViewColumnOutlined";import Xr from"@mui/material/Popover";import Yr from"@mui/icons-material/FirstPage";import $r from"@mui/icons-material/KeyboardArrowLeft";import Zr from"@mui/icons-material/KeyboardArrowRight";import en from"@mui/icons-material/ArrowForward";import tn from"@mui/icons-material/LastPage";import rn from"@mui/material/Backdrop";import nn from"@mui/material/Slide";import an from"@mui/material/Stepper";import sn from"@mui/material/Step";import on from"@mui/material/StepLabel";import ln from"date-fns/sub";import{DataGrid as hn}from"@mui/x-data-grid";import{WORKER_STATUS as cn,useWorker as dn}from"@koale/useworker";import un from"axios";import An from"@mui/icons-material/Info";import pn from"@mui/icons-material/Warning";var fn="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},mn=[],gn=[],wn="undefined"!=typeof Uint8Array?Uint8Array:Array,bn=!1;function vn(){bn=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0;t<64;++t)mn[t]=e[t],gn[e.charCodeAt(t)]=t;gn["-".charCodeAt(0)]=62,gn["_".charCodeAt(0)]=63}function yn(e){return mn[e>>18&63]+mn[e>>12&63]+mn[e>>6&63]+mn[63&e]}function Bn(e,t,i){for(var r,n=[],a=t;a<i;a+=3)r=(e[a]<<16)+(e[a+1]<<8)+e[a+2],n.push(yn(r));return n.join("")}function Cn(e){var t;bn||vn();for(var i=e.length,r=i%3,n="",a=[],s=16383,o=0,l=i-r;o<l;o+=s)a.push(Bn(e,o,o+s>l?l:o+s));return 1===r?(t=e[i-1],n+=mn[t>>2],n+=mn[t<<4&63],n+="=="):2===r&&(t=(e[i-2]<<8)+e[i-1],n+=mn[t>>10],n+=mn[t>>4&63],n+=mn[t<<2&63],n+="="),a.push(n),a.join("")}function xn(e,t,i,r,n){var a,s,o=8*n-r-1,l=(1<<o)-1,h=l>>1,c=-7,d=i?n-1:0,u=i?-1:1,A=e[t+d];for(d+=u,a=A&(1<<-c)-1,A>>=-c,c+=o;c>0;a=256*a+e[t+d],d+=u,c-=8);for(s=a&(1<<-c)-1,a>>=-c,c+=r;c>0;s=256*s+e[t+d],d+=u,c-=8);if(0===a)a=1-h;else{if(a===l)return s?NaN:1/0*(A?-1:1);s+=Math.pow(2,r),a-=h}return(A?-1:1)*s*Math.pow(2,a-r)}function Fn(e,t,i,r,n,a){var s,o,l,h=8*a-n-1,c=(1<<h)-1,d=c>>1,u=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,A=r?0:a-1,p=r?1:-1,f=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),(t+=s+d>=1?u/l:u*Math.pow(2,1-d))*l>=2&&(s++,l/=2),s+d>=c?(o=0,s=c):s+d>=1?(o=(t*l-1)*Math.pow(2,n),s+=d):(o=t*Math.pow(2,d-1)*Math.pow(2,n),s=0));n>=8;e[i+A]=255&o,A+=p,o/=256,n-=8);for(s=s<<n|o,h+=n;h>0;e[i+A]=255&s,A+=p,s/=256,h-=8);e[i+A-p]|=128*f}var Sn={}.toString,Nn=Array.isArray||function(e){return"[object Array]"==Sn.call(e)};function En(){return Tn.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function kn(e,t){if(En()<t)throw new RangeError("Invalid typed array length");return Tn.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=Tn.prototype:(null===e&&(e=new Tn(t)),e.length=t),e}function Tn(e,t,i){if(!(Tn.TYPED_ARRAY_SUPPORT||this instanceof Tn))return new Tn(e,t,i);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return Dn(this,e)}return Ln(this,e,t,i)}function Ln(e,t,i,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,i,r){if(t.byteLength,i<0||t.byteLength<i)throw new RangeError("'offset' is out of bounds");if(t.byteLength<i+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===i&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,i):new Uint8Array(t,i,r);Tn.TYPED_ARRAY_SUPPORT?(e=t).__proto__=Tn.prototype:e=Un(e,t);return e}(e,t,i,r):"string"==typeof t?function(e,t,i){"string"==typeof i&&""!==i||(i="utf8");if(!Tn.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var r=0|On(t,i);e=kn(e,r);var n=e.write(t,i);n!==r&&(e=e.slice(0,n));return e}(e,t,i):function(e,t){if(Rn(t)){var i=0|Pn(t.length);return 0===(e=kn(e,i)).length||t.copy(e,0,0,i),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?kn(e,0):Un(e,t);if("Buffer"===t.type&&Nn(t.data))return Un(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function In(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function Dn(e,t){if(In(t),e=kn(e,t<0?0:0|Pn(t)),!Tn.TYPED_ARRAY_SUPPORT)for(var i=0;i<t;++i)e[i]=0;return e}function Un(e,t){var i=t.length<0?0:0|Pn(t.length);e=kn(e,i);for(var r=0;r<i;r+=1)e[r]=255&t[r];return e}function Pn(e){if(e>=En())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+En().toString(16)+" bytes");return 0|e}function Rn(e){return!(null==e||!e._isBuffer)}function On(e,t){if(Rn(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var i=e.length;if(0===i)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return ca(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return da(e).length;default:if(r)return ca(e).length;t=(""+t).toLowerCase(),r=!0}}function Qn(e,t,i){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return Zn(this,t,i);case"utf8":case"utf-8":return Jn(this,t,i);case"ascii":return Yn(this,t,i);case"latin1":case"binary":return $n(this,t,i);case"base64":return Wn(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ea(this,t,i);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function Hn(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function Mn(e,t,i,r,n){if(0===e.length)return-1;if("string"==typeof i?(r=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=n?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(n)return-1;i=e.length-1}else if(i<0){if(!n)return-1;i=0}if("string"==typeof t&&(t=Tn.from(t,r)),Rn(t))return 0===t.length?-1:_n(e,t,i,r,n);if("number"==typeof t)return t&=255,Tn.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):_n(e,[t],i,r,n);throw new TypeError("val must be string, number or Buffer")}function _n(e,t,i,r,n){var a,s=1,o=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,o/=2,l/=2,i/=2}function h(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(n){var c=-1;for(a=i;a<o;a++)if(h(e,a)===h(t,-1===c?0:a-c)){if(-1===c&&(c=a),a-c+1===l)return c*s}else-1!==c&&(a-=a-c),c=-1}else for(i+l>o&&(i=o-l),a=i;a>=0;a--){for(var d=!0,u=0;u<l;u++)if(h(e,a+u)!==h(t,u)){d=!1;break}if(d)return a}return-1}function jn(e,t,i,r){i=Number(i)||0;var n=e.length-i;r?(r=Number(r))>n&&(r=n):r=n;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");r>a/2&&(r=a/2);for(var s=0;s<r;++s){var o=parseInt(t.substr(2*s,2),16);if(isNaN(o))return s;e[i+s]=o}return s}function zn(e,t,i,r){return ua(ca(t,e.length-i),e,i,r)}function Vn(e,t,i,r){return ua(function(e){for(var t=[],i=0;i<e.length;++i)t.push(255&e.charCodeAt(i));return t}(t),e,i,r)}function Kn(e,t,i,r){return Vn(e,t,i,r)}function qn(e,t,i,r){return ua(da(t),e,i,r)}function Gn(e,t,i,r){return ua(function(e,t){for(var i,r,n,a=[],s=0;s<e.length&&!((t-=2)<0);++s)r=(i=e.charCodeAt(s))>>8,n=i%256,a.push(n),a.push(r);return a}(t,e.length-i),e,i,r)}function Wn(e,t,i){return 0===t&&i===e.length?Cn(e):Cn(e.slice(t,i))}function Jn(e,t,i){i=Math.min(e.length,i);for(var r=[],n=t;n<i;){var a,s,o,l,h=e[n],c=null,d=h>239?4:h>223?3:h>191?2:1;if(n+d<=i)switch(d){case 1:h<128&&(c=h);break;case 2:128==(192&(a=e[n+1]))&&(l=(31&h)<<6|63&a)>127&&(c=l);break;case 3:a=e[n+1],s=e[n+2],128==(192&a)&&128==(192&s)&&(l=(15&h)<<12|(63&a)<<6|63&s)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:a=e[n+1],s=e[n+2],o=e[n+3],128==(192&a)&&128==(192&s)&&128==(192&o)&&(l=(15&h)<<18|(63&a)<<12|(63&s)<<6|63&o)>65535&&l<1114112&&(c=l)}null===c?(c=65533,d=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),n+=d}return function(e){var t=e.length;if(t<=Xn)return String.fromCharCode.apply(String,e);var i="",r=0;for(;r<t;)i+=String.fromCharCode.apply(String,e.slice(r,r+=Xn));return i}(r)}Tn.TYPED_ARRAY_SUPPORT=void 0===fn.TYPED_ARRAY_SUPPORT||fn.TYPED_ARRAY_SUPPORT,En(),Tn.poolSize=8192,Tn._augment=function(e){return e.__proto__=Tn.prototype,e},Tn.from=function(e,t,i){return Ln(null,e,t,i)},Tn.TYPED_ARRAY_SUPPORT&&(Tn.prototype.__proto__=Uint8Array.prototype,Tn.__proto__=Uint8Array),Tn.alloc=function(e,t,i){return function(e,t,i,r){return In(t),t<=0?kn(e,t):void 0!==i?"string"==typeof r?kn(e,t).fill(i,r):kn(e,t).fill(i):kn(e,t)}(null,e,t,i)},Tn.allocUnsafe=function(e){return Dn(null,e)},Tn.allocUnsafeSlow=function(e){return Dn(null,e)},Tn.isBuffer=function(e){return null!=e&&(!!e._isBuffer||Aa(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&Aa(e.slice(0,0))}(e))},Tn.compare=function(e,t){if(!Rn(e)||!Rn(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var i=e.length,r=t.length,n=0,a=Math.min(i,r);n<a;++n)if(e[n]!==t[n]){i=e[n],r=t[n];break}return i<r?-1:r<i?1:0},Tn.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Tn.concat=function(e,t){if(!Nn(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return Tn.alloc(0);var i;if(void 0===t)for(t=0,i=0;i<e.length;++i)t+=e[i].length;var r=Tn.allocUnsafe(t),n=0;for(i=0;i<e.length;++i){var a=e[i];if(!Rn(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,n),n+=a.length}return r},Tn.byteLength=On,Tn.prototype._isBuffer=!0,Tn.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)Hn(this,t,t+1);return this},Tn.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)Hn(this,t,t+3),Hn(this,t+1,t+2);return this},Tn.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)Hn(this,t,t+7),Hn(this,t+1,t+6),Hn(this,t+2,t+5),Hn(this,t+3,t+4);return this},Tn.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?Jn(this,0,e):Qn.apply(this,arguments)},Tn.prototype.equals=function(e){if(!Rn(e))throw new TypeError("Argument must be a Buffer");return this===e||0===Tn.compare(this,e)},Tn.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),"<Buffer "+e+">"},Tn.prototype.compare=function(e,t,i,r,n){if(!Rn(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===i&&(i=e?e.length:0),void 0===r&&(r=0),void 0===n&&(n=this.length),t<0||i>e.length||r<0||n>this.length)throw new RangeError("out of range index");if(r>=n&&t>=i)return 0;if(r>=n)return-1;if(t>=i)return 1;if(this===e)return 0;for(var a=(n>>>=0)-(r>>>=0),s=(i>>>=0)-(t>>>=0),o=Math.min(a,s),l=this.slice(r,n),h=e.slice(t,i),c=0;c<o;++c)if(l[c]!==h[c]){a=l[c],s=h[c];break}return a<s?-1:s<a?1:0},Tn.prototype.includes=function(e,t,i){return-1!==this.indexOf(e,t,i)},Tn.prototype.indexOf=function(e,t,i){return Mn(this,e,t,i,!0)},Tn.prototype.lastIndexOf=function(e,t,i){return Mn(this,e,t,i,!1)},Tn.prototype.write=function(e,t,i,r){if(void 0===t)r="utf8",i=this.length,t=0;else if(void 0===i&&"string"==typeof t)r=t,i=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(i)?(i|=0,void 0===r&&(r="utf8")):(r=i,i=void 0)}var n=this.length-t;if((void 0===i||i>n)&&(i=n),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var a=!1;;)switch(r){case"hex":return jn(this,e,t,i);case"utf8":case"utf-8":return zn(this,e,t,i);case"ascii":return Vn(this,e,t,i);case"latin1":case"binary":return Kn(this,e,t,i);case"base64":return qn(this,e,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Gn(this,e,t,i);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},Tn.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Xn=4096;function Yn(e,t,i){var r="";i=Math.min(e.length,i);for(var n=t;n<i;++n)r+=String.fromCharCode(127&e[n]);return r}function $n(e,t,i){var r="";i=Math.min(e.length,i);for(var n=t;n<i;++n)r+=String.fromCharCode(e[n]);return r}function Zn(e,t,i){var r=e.length;(!t||t<0)&&(t=0),(!i||i<0||i>r)&&(i=r);for(var n="",a=t;a<i;++a)n+=ha(e[a]);return n}function ea(e,t,i){for(var r=e.slice(t,i),n="",a=0;a<r.length;a+=2)n+=String.fromCharCode(r[a]+256*r[a+1]);return n}function ta(e,t,i){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>i)throw new RangeError("Trying to access beyond buffer length")}function ia(e,t,i,r,n,a){if(!Rn(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<a)throw new RangeError('"value" argument is out of bounds');if(i+r>e.length)throw new RangeError("Index out of range")}function ra(e,t,i,r){t<0&&(t=65535+t+1);for(var n=0,a=Math.min(e.length-i,2);n<a;++n)e[i+n]=(t&255<<8*(r?n:1-n))>>>8*(r?n:1-n)}function na(e,t,i,r){t<0&&(t=4294967295+t+1);for(var n=0,a=Math.min(e.length-i,4);n<a;++n)e[i+n]=t>>>8*(r?n:3-n)&255}function aa(e,t,i,r,n,a){if(i+r>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function sa(e,t,i,r,n){return n||aa(e,0,i,4),Fn(e,t,i,r,23,4),i+4}function oa(e,t,i,r,n){return n||aa(e,0,i,8),Fn(e,t,i,r,52,8),i+8}Tn.prototype.slice=function(e,t){var i,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),Tn.TYPED_ARRAY_SUPPORT)(i=this.subarray(e,t)).__proto__=Tn.prototype;else{var n=t-e;i=new Tn(n,void 0);for(var a=0;a<n;++a)i[a]=this[a+e]}return i},Tn.prototype.readUIntLE=function(e,t,i){e|=0,t|=0,i||ta(e,t,this.length);for(var r=this[e],n=1,a=0;++a<t&&(n*=256);)r+=this[e+a]*n;return r},Tn.prototype.readUIntBE=function(e,t,i){e|=0,t|=0,i||ta(e,t,this.length);for(var r=this[e+--t],n=1;t>0&&(n*=256);)r+=this[e+--t]*n;return r},Tn.prototype.readUInt8=function(e,t){return t||ta(e,1,this.length),this[e]},Tn.prototype.readUInt16LE=function(e,t){return t||ta(e,2,this.length),this[e]|this[e+1]<<8},Tn.prototype.readUInt16BE=function(e,t){return t||ta(e,2,this.length),this[e]<<8|this[e+1]},Tn.prototype.readUInt32LE=function(e,t){return t||ta(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Tn.prototype.readUInt32BE=function(e,t){return t||ta(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Tn.prototype.readIntLE=function(e,t,i){e|=0,t|=0,i||ta(e,t,this.length);for(var r=this[e],n=1,a=0;++a<t&&(n*=256);)r+=this[e+a]*n;return r>=(n*=128)&&(r-=Math.pow(2,8*t)),r},Tn.prototype.readIntBE=function(e,t,i){e|=0,t|=0,i||ta(e,t,this.length);for(var r=t,n=1,a=this[e+--r];r>0&&(n*=256);)a+=this[e+--r]*n;return a>=(n*=128)&&(a-=Math.pow(2,8*t)),a},Tn.prototype.readInt8=function(e,t){return t||ta(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Tn.prototype.readInt16LE=function(e,t){t||ta(e,2,this.length);var i=this[e]|this[e+1]<<8;return 32768&i?4294901760|i:i},Tn.prototype.readInt16BE=function(e,t){t||ta(e,2,this.length);var i=this[e+1]|this[e]<<8;return 32768&i?4294901760|i:i},Tn.prototype.readInt32LE=function(e,t){return t||ta(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Tn.prototype.readInt32BE=function(e,t){return t||ta(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Tn.prototype.readFloatLE=function(e,t){return t||ta(e,4,this.length),xn(this,e,!0,23,4)},Tn.prototype.readFloatBE=function(e,t){return t||ta(e,4,this.length),xn(this,e,!1,23,4)},Tn.prototype.readDoubleLE=function(e,t){return t||ta(e,8,this.length),xn(this,e,!0,52,8)},Tn.prototype.readDoubleBE=function(e,t){return t||ta(e,8,this.length),xn(this,e,!1,52,8)},Tn.prototype.writeUIntLE=function(e,t,i,r){(e=+e,t|=0,i|=0,r)||ia(this,e,t,i,Math.pow(2,8*i)-1,0);var n=1,a=0;for(this[t]=255&e;++a<i&&(n*=256);)this[t+a]=e/n&255;return t+i},Tn.prototype.writeUIntBE=function(e,t,i,r){(e=+e,t|=0,i|=0,r)||ia(this,e,t,i,Math.pow(2,8*i)-1,0);var n=i-1,a=1;for(this[t+n]=255&e;--n>=0&&(a*=256);)this[t+n]=e/a&255;return t+i},Tn.prototype.writeUInt8=function(e,t,i){return e=+e,t|=0,i||ia(this,e,t,1,255,0),Tn.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},Tn.prototype.writeUInt16LE=function(e,t,i){return e=+e,t|=0,i||ia(this,e,t,2,65535,0),Tn.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):ra(this,e,t,!0),t+2},Tn.prototype.writeUInt16BE=function(e,t,i){return e=+e,t|=0,i||ia(this,e,t,2,65535,0),Tn.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):ra(this,e,t,!1),t+2},Tn.prototype.writeUInt32LE=function(e,t,i){return e=+e,t|=0,i||ia(this,e,t,4,4294967295,0),Tn.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):na(this,e,t,!0),t+4},Tn.prototype.writeUInt32BE=function(e,t,i){return e=+e,t|=0,i||ia(this,e,t,4,4294967295,0),Tn.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):na(this,e,t,!1),t+4},Tn.prototype.writeIntLE=function(e,t,i,r){if(e=+e,t|=0,!r){var n=Math.pow(2,8*i-1);ia(this,e,t,i,n-1,-n)}var a=0,s=1,o=0;for(this[t]=255&e;++a<i&&(s*=256);)e<0&&0===o&&0!==this[t+a-1]&&(o=1),this[t+a]=(e/s|0)-o&255;return t+i},Tn.prototype.writeIntBE=function(e,t,i,r){if(e=+e,t|=0,!r){var n=Math.pow(2,8*i-1);ia(this,e,t,i,n-1,-n)}var a=i-1,s=1,o=0;for(this[t+a]=255&e;--a>=0&&(s*=256);)e<0&&0===o&&0!==this[t+a+1]&&(o=1),this[t+a]=(e/s|0)-o&255;return t+i},Tn.prototype.writeInt8=function(e,t,i){return e=+e,t|=0,i||ia(this,e,t,1,127,-128),Tn.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},Tn.prototype.writeInt16LE=function(e,t,i){return e=+e,t|=0,i||ia(this,e,t,2,32767,-32768),Tn.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):ra(this,e,t,!0),t+2},Tn.prototype.writeInt16BE=function(e,t,i){return e=+e,t|=0,i||ia(this,e,t,2,32767,-32768),Tn.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):ra(this,e,t,!1),t+2},Tn.prototype.writeInt32LE=function(e,t,i){return e=+e,t|=0,i||ia(this,e,t,4,2147483647,-2147483648),Tn.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):na(this,e,t,!0),t+4},Tn.prototype.writeInt32BE=function(e,t,i){return e=+e,t|=0,i||ia(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),Tn.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):na(this,e,t,!1),t+4},Tn.prototype.writeFloatLE=function(e,t,i){return sa(this,e,t,!0,i)},Tn.prototype.writeFloatBE=function(e,t,i){return sa(this,e,t,!1,i)},Tn.prototype.writeDoubleLE=function(e,t,i){return oa(this,e,t,!0,i)},Tn.prototype.writeDoubleBE=function(e,t,i){return oa(this,e,t,!1,i)},Tn.prototype.copy=function(e,t,i,r){if(i||(i=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<i&&(r=i),r===i)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-i&&(r=e.length-t+i);var n,a=r-i;if(this===e&&i<t&&t<r)for(n=a-1;n>=0;--n)e[n+t]=this[n+i];else if(a<1e3||!Tn.TYPED_ARRAY_SUPPORT)for(n=0;n<a;++n)e[n+t]=this[n+i];else Uint8Array.prototype.set.call(e,this.subarray(i,i+a),t);return a},Tn.prototype.fill=function(e,t,i,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,i=this.length):"string"==typeof i&&(r=i,i=this.length),1===e.length){var n=e.charCodeAt(0);n<256&&(e=n)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!Tn.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;var a;if(t>>>=0,i=void 0===i?this.length:i>>>0,e||(e=0),"number"==typeof e)for(a=t;a<i;++a)this[a]=e;else{var s=Rn(e)?e:ca(new Tn(e,r).toString()),o=s.length;for(a=0;a<i-t;++a)this[a+t]=s[a%o]}return this};var la=/[^+\/0-9A-Za-z-_]/g;function ha(e){return e<16?"0"+e.toString(16):e.toString(16)}function ca(e,t){var i;t=t||1/0;for(var r=e.length,n=null,a=[],s=0;s<r;++s){if((i=e.charCodeAt(s))>55295&&i<57344){if(!n){if(i>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&a.push(239,191,189);continue}n=i;continue}if(i<56320){(t-=3)>-1&&a.push(239,191,189),n=i;continue}i=65536+(n-55296<<10|i-56320)}else n&&(t-=3)>-1&&a.push(239,191,189);if(n=null,i<128){if((t-=1)<0)break;a.push(i)}else if(i<2048){if((t-=2)<0)break;a.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;a.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return a}function da(e){return function(e){var t,i,r,n,a,s;bn||vn();var o=e.length;if(o%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a="="===e[o-2]?2:"="===e[o-1]?1:0,s=new wn(3*o/4-a),r=a>0?o-4:o;var l=0;for(t=0,i=0;t<r;t+=4,i+=3)n=gn[e.charCodeAt(t)]<<18|gn[e.charCodeAt(t+1)]<<12|gn[e.charCodeAt(t+2)]<<6|gn[e.charCodeAt(t+3)],s[l++]=n>>16&255,s[l++]=n>>8&255,s[l++]=255&n;return 2===a?(n=gn[e.charCodeAt(t)]<<2|gn[e.charCodeAt(t+1)]>>4,s[l++]=255&n):1===a&&(n=gn[e.charCodeAt(t)]<<10|gn[e.charCodeAt(t+1)]<<4|gn[e.charCodeAt(t+2)]>>2,s[l++]=n>>8&255,s[l++]=255&n),s}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(la,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function ua(e,t,i,r){for(var n=0;n<r&&!(n+i>=t.length||n>=e.length);++n)t[n+i]=e[n];return n}function Aa(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}const pa=()=>{const e=new Map;return{registerFn:(t,i)=>"function"==typeof i&&(e.set(t,i),!0),unregisterFn:t=>{e.has(t)&&e.delete(t)},getFn:(t,i)=>e.has(t)?e.get(t):i}},fa=pa(),ma=pa(),ga=(e,t)=>Number.parseFloat(e)>Number.parseFloat(t),wa=(e,t)=>Number.parseFloat(e)>=Number.parseFloat(t),ba=(e,t)=>Number.parseFloat(e)<Number.parseFloat(t),va=(e,t)=>Number.parseFloat(e)<=Number.parseFloat(t),ya=(e,t,i)=>(e instanceof Date&&t instanceof Date&&i?.ignoreTime&&(e=new Date(e).setHours(0,0,0,0),t=new Date(t).setHours(0,0,0,0)),Me(e,t)),Ba=(e,t)=>!!_e(e,t)||Me(e,t),Ca=(e,t,i)=>(e instanceof Date&&t instanceof Date&&i?.ignoreTime&&(e=new Date(e).setHours(0,0,0,0),t=new Date(t).setHours(0,0,0,0)),He(e,t)),xa=(e,t)=>!!_e(e,t)||He(e,t),Fa=e=>async(t,i)=>{const{success:r,failure:n,conditions:a}=e;let s=new et;s.addOperator("greaterThanInclusiveDate",Ba),s.addOperator("greaterThanDate",ya),s.addOperator("lessThanDate",Ca),s.addOperator("lessThanInclusiveDate",xa),s.addOperator("greaterThanString",ga),s.addOperator("greaterThanInclusiveString",wa),s.addOperator("lessThanInclusiveString",va),s.addOperator("lessThanString",ba);const o={conditions:a,event:{type:"success"}};s.addRule(o);const l=await s.run({currentField:t,dependentFields:i});return s.stop(),l.events.length>0?r:n},Sa=e=>"[object String]"===Object.prototype.toString.call(e),Na=e=>null!==e&&"object"==typeof e,Ea=e=>String(Math.floor(Number(e)))===e;function ka(e,t,i,r=0){const n=F(t);for(;e&&r<n.length;)e=e[n[r++]];return void 0===e?i:e}function Ta(e,t,i){let r=x(e),n=r,a=0,s=F(t);for(;a<s.length-1;a++){const t=s[a];let i=ka(e,s.slice(0,a+1));if(i&&(Na(i)||Array.isArray(i)))n=n[t]=x(i);else{const e=s[a+1];n=n[t]=Ea(e)&&Number(e)>=0?[]:{}}}return(0===a?e:n)[s[a]]===i?e:(void 0===i?delete n[s[a]]:n[s[a]]=i,0===a&&void 0===i&&delete r[s[a]],r)}const La={abortEarly:!1,strict:!1},Ia=e=>async t=>{const{value:i}=t;try{return await e.validate("string"==typeof i?(i||"").trim():i,La),null}catch(e){return e instanceof E.ValidationError?e.errors[0]:e.message}},Da=(e,t)=>{if("object"==typeof e)try{let i=E.reach(e,t);return async e=>await Ia(i)(e)}catch(e){return}},Ua={formAtom:"formAtom",formFieldAtom:"formFieldAtom",formArrayFieldRowsAtom:"formArrayFieldRowsAtom",formArrayFieldRegistryAtom:"formArrayFieldRegistryAtom",formFieldRegistryAtom:"formFieldRegistryAtom",formFieldRegisterSelector:"formFieldRegisterSelector",formFieldUnregisterSelector:"formFieldUnregisterSelector",formArrayFieldRegisterSelector:"formArrayFieldRegisterSelector",formArrayFieldUnregisterSelector:"formArrayFieldUnregisterSelector",subscribeToFormFieldsSelector:"subscribeToFormFieldsSelector",isFormArrayFieldRegistered:"isFormArrayFieldRegistered",formFieldsExcludedAtom:"formFieldsExcludedAtom",formFieldExcludeAddSelector:"formFieldExcludeAddSelector",formFieldExcludeRemoveSelector:"formFieldExcludeRemoveSelector",formFieldsErrorWatcherAtom:"formFieldsErrorWatcherAtom",formFieldsErrorWatcherAddSelector:"formFieldsErrorWatcherAddSelector",formFieldsErrorWatcherRemoveSelector:"formFieldsErrorWatcherAddSelector"},Pa=Hr(e=>{const t=H({submitAttempt:0,isSubmitting:!1,submitSuccessful:!1,serverSentError:"",serverSentErrorDetail:"",validationRunning:!1});return t.debugLabel=`${Ua.formAtom}__${e}`,t}),Ra=Hr(e=>{const t=H({fieldKey:e??"",name:e??"",value:"",displayValue:"",touched:!1,error:null,validationRunning:!1,validate:null,excluded:!1,readOnly:!1,incomingMessage:null,skipValueUpdateFromCrossFieldWhenReadOnly:!1,optionData:{},ignoreInSubmit:!1});return t.debugLabel=`${Ua.formFieldAtom}__${e}`,t}),Oa=Hr(e=>{const t=H([]);return t.debugLabel=`${Ua.formFieldsErrorWatcherAtom}__${e}`,t}),Qa=Hr(e=>{const t=Qr(null,(t,i,r)=>{if(r===M)return;const n=t(Oa(e));n.includes(r)||i(Oa(e),[...n,r])});return t.debugLabel=`${Ua.formFieldsErrorWatcherAddSelector}__${e}`,t}),Ha=Hr(e=>{const t=Qr(null,(t,i,r)=>{if(r===M)return;const n=t(Oa(e)),a=n.indexOf(r);if(a>-1){const t=[...n.slice(0,a),...n.slice(a+1)];i(Oa(e),t)}});return t.debugLabel=`${Ua.formFieldsErrorWatcherRemoveSelector}__${e}`,t}),Ma=Hr(e=>{const t=H([]);return t.debugLabel=`${Ua.formFieldsExcludedAtom}__${e}`,t}),_a=Hr(e=>{const t=Qr(null,(t,i,r)=>{if(r===M)return;const n=t(Ma(e));n.includes(r)||i(Ma(e),[...n,r])});return t.debugLabel=`${Ua.formFieldExcludeAddSelector}__${e}`,t}),ja=Hr(e=>{const t=Qr(null,(t,i,r)=>{if(r===M)return;const n=t(Ma(e)),a=n.indexOf(r);if(a>-1){const t=[...n.slice(0,a),...n.slice(a+1)];i(Ma(e),t)}});return t.debugLabel=`${Ua.formFieldExcludeRemoveSelector}__${e}`,t}),za=Hr(e=>{const t=H([]);return t.debugLabel=`${Ua.formFieldRegistryAtom}__${e}`,t}),Va=Hr(e=>{const t=Qr(null,(t,i,r)=>{if(r===M)return;const n=t(za(e));n.includes(r.fieldName)||(i(za(e),[...n,r.fieldName]),null!==r.defaultValue&&i(Ra(r.fieldName),e=>({...e,...r.defaultValue})))});return t.debugLabel=`${Ua.formFieldRegisterSelector}__${e}`,t}),Ka=Hr(e=>{const t=Qr(null,(t,i,r)=>{if(r===M)return;const n=t(za(e)),a=n.indexOf(r);if(a>-1){i(Ra(r),M);const t=[...n.slice(0,a),...n.slice(a+1)];i(za(e),t)}});return t.debugLabel=`${Ua.formFieldUnregisterSelector}__${e}`,t}),qa=Hr(e=>{const t=H({fieldName:e,templateFieldRows:[],lastInsertIndex:-1,resetFlag:!1,excluded:!1});return t.debugLabel=`${Ua.formArrayFieldRowsAtom}__${e}`,t}),Ga=Hr(e=>{const t=H([]);return t.debugLabel=`${Ua.formArrayFieldRegistryAtom}__${e}`,t}),Wa=Hr(e=>{const t=Qr(null,(t,i,r)=>{if(r===M)return;const n=t(Ga(e));n.includes(r)||i(Ga(e),[...n,r])});return t.debugLabel=`${Ua.formArrayFieldRegisterSelector}__${e}`,t}),Ja=Hr(e=>{const t=Qr(null,(t,i,r)=>{if(r===M)return;const n=t(Ga(e)),a=n.indexOf(r);if(a>-1){i(Ga(r),M);const t=[...n.slice(0,a),...n.slice(a+1)];i(Ga(e),t)}});return t.debugLabel=`${Ua.formArrayFieldUnregisterSelector}__${e}`,t}),Xa=Hr(e=>{const t=Qr(t=>{if("object"!=typeof e)return{};let i=e.fields??[];"string"==typeof i&&(i=[i]);let r=t(za(`${e.formName}`)),n=t(Ga(`${e.formName}`)),a=i.filter(i=>i.split(".").length>1&&!t(za(`${e.formName}`)).filter(e=>e.split("/")[1].includes(i)).length);i=i.concat(a.map(e=>e.split(".")[1]));let s=n.filter(e=>Array.isArray(i)&&i.filter(t=>e.includes(t)).length),o=r.filter(e=>s.filter(t=>e.includes(t)).length),l=o.map(t=>t.replace(`${e.formName}/`,""));const h=[];for(const i of l)h.push(t(Ra(`${e.formName}/${i}`)));let c={};for(const t of h)c=Ta(c,t.name.replace(`${e.formName}/`,""),t);let d={};for(let r of i)if("string"==typeof r&&Boolean(r)){let i=t(Ra(`${e.formName}/${r}`));d[r]=i}return d={...d,...c},d});return t.debugLabel=`${Ua.subscribeToFormFieldsSelector}__${JSON.stringify(e)}`,t},(e,t)=>T.isEqual(e,t)),Ya=n({formName:"FORM_NAME",validationRun:"onBlur",resetFieldOnUnmount:!0,initialValues:{},previousValues:{},formState:{},defaultArrayFieldValues:{},lastValidationValue:new Map,flagRef:new Map,setCurrentStepIndexFnRef:null});Ya.displayName="FormContext";const $a=n({authState:{}}),Za=({authState:t,children:i})=>{const r=s(()=>t,[t]);return e($a.Provider,{value:{authState:r},children:i})},es=()=>{const e=a($a);if(void 0===e)throw new Error("useAuthContext must be used within a AuthContextProvider");return e},ts={dynamicAccountNumberField:"separated",dynamicAmountSymbol:"INR",dynamicAmountGroupStyle:"lakh",currencyFormat:"en-IN",decimalCount:2,commonDateFormat:"dd/MM/yyyy",commonDateTimeFormat:"dd/MM/yyyy hh:mm:ss aa",commonTimeFormat:"hh:mm:ss aa",denoTableType:"single",customExtendedTypes:{},defaultGridConfig:{variant:"standard",enablePaginationInput:!0,isContainedActionButton:!1,enableDoubleSpaceAction:!1},defaultExportConfig:{enablePdfPrint:!1,saveUpdateTemplateApiFn:void 0,getPersonalizedReportData:void 0},enableOptionsGridForAutocomplete:!0,enablePostValidationRun:!1,disableColumnFilters:!1,enableEnterToFocus:!1,refetchOptionsWhenOnline:!0},is=n(ts),rs=({config:t,children:i})=>{const r=s(()=>({...ts,...t}),[t]);return e(is.Provider,{value:r,children:i})},ns=()=>{const e=a(is);if(void 0===e)throw new Error("usePropertiesConfigContext must be used within a CustomPropertiesConfigurationProvider");return e},as=({fieldKey:e,name:t,dependentFields:i,validate:r,validationRun:n,shouldExclude:s,isReadOnly:c,postValidationSetCrossFieldValues:d,runPostValidationHookAlways:u,runValidationOnDependentFieldsChange:A,skipValueUpdateFromCrossFieldWhenReadOnly:p,runExternalFunction:f,onFormDataChange:m,txtTransform:g,AlwaysRunPostValidationSetCrossFieldValues:w,componentType:b="",runPostValidationForInitValue:v,dependentFieldDebounceDelay:y=300,isCurrencyField:B=!1})=>{const C=a(Ya),{authState:x}=es(),[F,S]=j(Pa(C.formName)),N=o(Boolean(e)?`${C.formName}/${e}`:`${C.formName}/${t}`),E=o("DO_NOT_CHANGE_THIS_VALUE_I_WILL_FIRE_YOU");"DO_NOT_CHANGE_THIS_VALUE_I_WILL_FIRE_YOU"===E.current&&(E.current=hs(e,i));const k=z(Xa({formName:C.formName,fields:E.current})),T=o(!1),L=(e,t,i,r,n)=>{if("function"!=typeof e)return e??n;const a=e(t,ds(i),r);return a instanceof Promise?"PENDING_PROMISE":a};_(l((e,t)=>{if(T.current)return;const i=e(Ra(N.current)),r=ds(k),n=L(s,i,r,C.formState,!1),a=L(c,i,r,C.formState,!1);t(Ra(N.current),e=>({...e,excluded:"PENDING_PROMISE"===n?e.excluded:!!n,readOnly:"PENDING_PROMISE"===a?e.readOnly:!!a,skipValueUpdateFromCrossFieldWhenReadOnly:!!p,componentType:b})),"PENDING_PROMISE"===n&&Promise.resolve(s(i,r,C.formState)).then(e=>t(Ra(N.current),t=>({...t,excluded:!!e}))),"PENDING_PROMISE"===a&&Promise.resolve(c(i,r,C.formState)).then(e=>t(Ra(N.current),t=>({...t,readOnly:!!e}))),T.current=!0},[s,c,k,C.formState,b,p]))();const[I,D]=j(Ra(N.current)),{t:U}=W();h(()=>{0===t.indexOf(`${C.formName}/`)?D(e=>({...e,name:t,componentType:b})):D(e=>({...e,name:`${C.formName}/${t}`,componentType:b}))},[t,D,C.formName,b]);const P=o(I);P.current=I;const R=V(Va(C.formName)),O=V(Ka(C.formName)),{enablePostValidationRun:Q,decimalCount:H}=ns();h(()=>{const e=N.current,t="object"==typeof C.defaultArrayFieldValues?ka(C.defaultArrayFieldValues,e.replace(`${C.formName}/`,"").replace(/\[\d\]/g,""),null):null;let i=null;const r="object"==typeof C.initialValues?ka(C.initialValues,e.replace(`${C.formName}/`,""),null):null;null!=r?i={value:B&&r?String(r).includes(".")?r:Number(r).toFixed(H):r,ignoreInSubmit:"typography"===b.toLowerCase()||"divider"===b.toLowerCase()||"spacer"===b.toLowerCase()}:Boolean(t)&&(i={value:t,ignoreInSubmit:"typography"===b.toLowerCase()||"divider"===b.toLowerCase()||"spacer"===b.toLowerCase()});const n="object"==typeof C.previousValues?ka(C.previousValues,e.replace(`${C.formName}/`,""),null):null;null!=n&&(i={...i,prevValue:n});const a={defaultValue:null===i?{ignoreInSubmit:"typography"===b.toLowerCase()||"divider"===b.toLowerCase()||"spacer"===b.toLowerCase()}:i,fieldName:e};if(R(a),!0===Boolean(C.resetFieldOnUnmount))return()=>{O(e)}},[D,R,O,C]);const M=o("function"==typeof r),K=C.flagRef;h(()=>{const t=I.name.replace(`${C.formName}/`,""),i=function(e,t,i,r,n,a,s,o,l,h,c,d,u,A,p,f,m=2){const g=`${p}/${s}`;if("function"!=typeof e&&"function"!=typeof t&&"function"!=typeof i&&"function"!=typeof a&&!l?.minDate&&"datePicker"===o)return;const w=Boolean(r);if(w){const r=async(r,p,w)=>{let b,v=null,y=null,B=null;if((u||A||!ls(s,r.value,h,c,o,r.defaultKeyValue,f,m)||d?.current.get(g))&&("function"==typeof i&&(b=await i(r,w,l,p),null!=b&&"object"==typeof b||(b={})),d.current.set(g,!0)),Boolean(r?.value&&l?.minDate&&"datepicker"===o?.toLowerCase())){if(Ca(r?.value,new Date(l?.minDate)))return{error:"DateOutOfPeriod",crossFieldMessages:b,apiResult:y}}return"function"==typeof e&&(v=await e(r,w)),Boolean(v)||"function"==typeof t&&(B=await t(r,p,w),"object"==typeof B?(v=B.error,y=B.apiResult):v=B,Boolean(v))||"function"==typeof a&&Boolean(n)&&(B=await a(s,r,p,w),"object"==typeof B?(v=B.error,y=B.apiResult):v=B),{error:v,crossFieldMessages:b,apiResult:y}};return r}{const r=async(r,p,w)=>{let b,v=null,y=null,B=null;if(Boolean(r?.value&&l?.minDate&&"datepicker"===o?.toLowerCase())){if(Ca(r?.value,new Date(l?.minDate)))return{error:"DateOutOfPeriod",crossFieldMessages:{},apiResult:y}}return"function"==typeof e&&(v=await e(r,w)),Boolean(v)?{error:v,crossFieldMessages:{},apiResult:y}:("function"==typeof t&&(B=await t(r,p,w),"object"==typeof B?(v=B.error,y=B.apiResult):v=B),Boolean(v)||"function"==typeof a&&Boolean(n)&&(B=await a(s,r,p,w),"object"==typeof B?(v=B.error,y=B.apiResult):v=B,Boolean(v))?{error:v,crossFieldMessages:{},apiResult:y}:((u||A||!ls(s,r.value,h,c,o,r.defaultKeyValue,f,m)||d?.current?.get(g))&&("function"==typeof i&&(b=await i(r,w,l,p),null!=b&&"object"==typeof b||(b={})),d.current.set(g,!0)),{error:v,crossFieldMessages:b,apiResult:y}))};return r}}(Da(C.validationSchema,t),r,d,u,f,m,e,b,x??{},C.initialValues,C.defaultArrayFieldValues,K,v,Q,C.formName,B,H);"function"==typeof i?(M.current=!0,D(e=>({...e,validate:i,dependentFields:E.current,skipValueUpdateFromCrossFieldWhenReadOnly:Boolean(p)}))):D(e=>({...e,dependentFields:E.current,skipValueUpdateFromCrossFieldWhenReadOnly:Boolean(p)}))},[D,C.formName,C.validationSchema,I.name]);const q=_(l((e,t,{fieldName:i,flag:r})=>{"add"===r?t(_a(C.formName),i):"remove"===r&&t(ja(C.formName),i)},[C.formName])),G=_(l((e,t,{fieldName:i,flag:r})=>{"add"===r?t(Qa(C.formName),i):"remove"===r&&t(Ha(C.formName),i)},[C.formName])),J=o(k);J.current=k,h(()=>{!0===A&&ie(I,k,!0)},[k]);const X=o(null),Y=o(null);h(()=>{if("function"==typeof s){const e=Promise.resolve(s(I,ds(k),C.formState));X.current=e,e.then(t=>{e===X.current&&(D(e=>e.excluded===t?e:{...e,excluded:t}),q({fieldName:I.name,flag:t?"add":"remove"}))})}if("function"==typeof c){const e=Promise.resolve(c(I,ds(k),C.formState));Y.current=e,e.then(t=>{e===Y.current&&D(e=>e.readOnly===t?e:{...e,readOnly:t})})}I.error?G({fieldName:I.name,flag:"add"}):G({fieldName:I.name,flag:"remove"})},[s,c,I.error,k,C.formState,q,G]);const $=_(l((t,i,r)=>{const n=cs(e),a=t(za(C.formName))??[];for(const[e,s]of Object.entries(r)){let r=n;const o=a.includes(`${C.formName}/${n}${e}`),l=a.includes(`${C.formName}/${e}`);!o&&l&&(r="");const h=`${C.formName}/${r}${e}`;if(a.includes(h)){const e=t(Ra(h));if(e.readOnly&&e.skipValueUpdateFromCrossFieldWhenReadOnly)continue;i(Ra(h),e=>({...e,incomingMessage:{...e.incomingMessage,...s}}))}}},[C.formName,e])),Z=o(Boolean(n)?n:Boolean(C.validationRun)?C.validationRun:"all"),ee=o(null),te=C.lastValidationValue,ie=l((t,i,r,n)=>{if("function"!=typeof P.current.validate)return;if(te.current.get(`${C.formName}/${e}`)===t.value&&!1==!!r)return;D(e=>({...e,validationRunning:!0})),S(e=>({...e,validationRunning:!0}));const a=Promise.resolve(P.current.validate(t,ds(i),C.formState));te.current.set(`${C.formName}/${e}`,t.value),ee.current=a,a.then(e=>{if(ee.current===a){const{error:t,crossFieldMessages:i,apiResult:r}=e;let a;a="string"==typeof t||null==t?t:"unkown error check console",Boolean(n)?D(e=>({...e,validationRunning:!1,touched:!0,error:a,validationAPIResult:r})):D(e=>({...e,validationRunning:!1,error:a,validationAPIResult:r})),S(e=>({...e,validationRunning:!1})),"object"==typeof i&&$(i)}}).catch(e=>{if(ee.current===a){let t;t=e instanceof Error?e.message:e?.error_msg??"unkown error type check console",Boolean(n)?D(i=>({...i,validationRunning:!1,touched:!0,error:t,validationAPIResult:e})):D(i=>({...i,validationRunning:!1,error:t,validationAPIResult:e})),S(e=>({...e,validationRunning:!1}))}})},[D,$]),re=l(()=>{D(e=>e.touched?e:{...e,touched:!0})},[D]),ne=l(e=>{D(t=>({...t,incomingMessage:null===e?null:{...t.incomingMessage,...e}}))},[D]),ae=l(e=>{D(t=>({...t,filteredOptions:e}))},[D]),se=l(e=>{D(t=>({...t,displayValue:e??t?.value}))},[D]),oe=l((e,t,i,r)=>{D(!1==!!i?i=>i.value===e?i:{...i,value:e,displayValue:t??e,...r||{}}:i=>({...i,value:e,displayValue:t??e,...r||{}}))},[D]),le=l(e=>{D(t=>{let i;i="function"==typeof e?e(t.value):e;return{...t,value:i,displayValue:i,touched:!0}})},[D]),he=l(e=>{D(t=>{let i;i="function"==typeof e?e(t.error):e;return{...t,error:i}})},[D]),ce=l(e=>{D(t=>({...t,ignoreInSubmit:e}))},[D]),de=l((e,t,i)=>{ie(e?{...P.current,...e}:P.current,J.current,t,i)},[]),ue=l((t,i,r,n={},a=!1)=>{if(null!==P.current){let s=t=t??"",o=i;if(!(t instanceof Date||"string"==typeof t||"number"==typeof t||"boolean"==typeof t||Array.isArray(t))){const{type:e,value:r,checked:n,options:a,multiple:l}=t.target;let h;s=/number|range/.test(e)?(h=parseFloat(r),isNaN(h)?"":h):/checkbox/.test(e)?ss(P.current.value,n,r):l?function(e){return Array.from(e).filter(e=>e.selected).map(e=>e.value)}(a):r,o=/checkbox/.test(e)?ss(P.current.displayValue??"00",n,i):i}"string"==typeof s&&Boolean(g)&&(s="uppercase"===g?s.toUpperCase():"lowercase"===g?s.toLowerCase():s),oe(s,o),Boolean(r)&&te.current.set(`${C.formName}/${e}`,s),a||!M.current||"onChange"!==Z.current&&"all"!==Z.current||de({value:s,...n})}},[oe,de,C.validationRun]),Ae=l(async(e={},t={})=>{const i="function"==typeof w?w(J.current):w;null!==P.current&&(re(),!M.current||"onBlur"!==Z.current&&"all"!==Z.current||de({touched:!0,...t},i?.alwaysRun??!1,i?.touchAndValidate??!1))},[re,de,C.validationRun]),pe=l(e=>{D(t=>({...t,optionData:e}))},[]);return{...I,formState:C.formState,whenToRunValidation:Z.current,isSubmitting:F.isSubmitting,handleChange:ue,handleBlur:Ae,setTouched:re,setValue:oe,setValueAsCB:le,setErrorAsCB:he,setIncomingMessage:ne,setFilteredOptions:ae,runValidation:de,dependentValues:k,handleOptionValueExtraData:pe,validationAPIResult:U(I?.validationAPIResult??""),setDisplayValue:se,setIgnoreInSubmit:ce,error:U(I?.error??""),initialValues:C.initialValues}};function ss(e,t,i){if("boolean"==typeof e)return Boolean(t);let r=[],n=!1,a=-1;if(Array.isArray(e))r=e,a=e.indexOf(i),n=a>=0;else if(!i||"true"==i||"false"==i)return Boolean(t);return t&&i&&!n?r.concat(i):n?r.slice(0,a).concat(r.slice(a+1)):r}function os(e,t,i){return i?.includes("date")||i?.includes("time")?_e(Fs(e),Fs(t)):e===t}function ls(e,t,i,r,n,a,s,o){if("autocomplete"===n&&"string"==typeof a&&(""===i?.[e]||void 0===i?.[e]))return os(a,t,n);if(e.includes(".")){const a=T.get(i,e);if(void 0===a){let i=e.replace(/\[\d+\]/g,"");return os(T.get(r,i),t,n)}return os(s&&a?String(a).includes(".")?a:Number(a).toFixed(o):a,t,n)}return os(i?.[e],t,n)}const hs=(e,t)=>{if(void 0===t)return t;if("string"==typeof t&&(t=[t]),Array.isArray(t)&&e.split(".").length>1){const i=e.split("."),r=i.slice(0,i.length-1).join(".");t=t.map(e=>`${r}.${e}`)}return t},cs=e=>{if(e.split(".").length>1){const t=e.split(".");return`${t.slice(0,t.length-1).join(".")}.`}return""},ds=e=>Object.keys(e).reduce((t,i)=>{let r=e[i];return t[i.replace(/(\[\d+\])/g,"")]=r,t},{}),us=e=>e?"object"==typeof e&&!Array.isArray(e)&&"value"in e&&"fieldKey"in e?[e]:Array.isArray(e)?e.flatMap(us):"object"==typeof e?Object.values(e).flatMap(us):[]:[],As=(e,t)=>{if(Array.isArray(e)){if(!Boolean(t))return e.length+1;let i=0;return e.forEach((e,r)=>{Boolean(e[t])?parseFloat(e[t])>i&&(i=parseFloat(e[t])):i<r+1&&(i=r+1)}),i+1}return 1},ps=(e,t="",i=512)=>{const r=null!=e&&""!=e?atob(e):"",n=[];for(let e=0;e<r.length;e+=i){const t=r.slice(e,e+i),a=new Array(t.length);for(let e=0;e<t.length;e++)a[e]=t.charCodeAt(e);const s=new Uint8Array(a);n.push(s)}return new Blob(n,{type:t})},fs=async e=>await ms(e).then(e=>e.toString().split(",")),ms=e=>new Promise((t,i)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=()=>t(r.result),r.onerror=e=>i(e)}),gs=(e,t=!0)=>{let i=[];if(Array.isArray(e))for(let r=0;r<e.length;r++){let{children:n,...a}=e[r];if(Array.isArray(n)&&n.length>0){let e=gs(n);i.push(...e)}else t&&!Boolean(a.system_code)||!Boolean(a.href)||i.push({...a})}return i},ws=["MM-dd-yy","dd-MM-yy","dd/MM/yy","MM/dd/yy","yyyy-MM-dd HH:mm:ss","yyyy-MM-dd HH:mm:ss.S","yyyy-MM-dd","dd/MM/yyyy","dd/MM/yyyy HH:mm:ss","MM/dd/yyyy HH:mm:ss","dd-MM-yyyy HH:mm:ss","MM/dd/yyyy","MM-dd-yyyy HH:mm:ss","dd/MMM/yyyy","dd-MM-yyyy","dd-MMM-yyyy","yyyy-MM-dd'T'HH:mm:ssX","EEE MMM dd yyyy HH:mm:ss xxxx","EEE MMM dd yyyy HH:mm:ss xx"];function bs(e){if("object"==typeof e&&e instanceof Date)return!isNaN(e.getTime());for(const t of ws){const i=je(e,t,new Date);if(!isNaN(i?.getTime()))return!0}return!1}const vs=(e,t)=>{let i=Object.keys(e),r=[],n={};return i.forEach(i=>{e[i]===t[i]||("object"==typeof e[i]||"object"==typeof t[i]||"string"==typeof e[i])&&bs(e[i])&&bs(t[i])&&ze(Fs(e[i]),"dd/MM/yyyy HH:mm:ss")===ze(Fs(t[i]),"dd/MM/yyyy HH:mm:ss")||(r.push(i),n[i]=t[i])}),{_UPDATEDCOLUMNS:r,_OLDROWVALUE:n}},ys=e=>{try{if(e){let t=new Date(e);return!(!isNaN(t)&&t<new Date("1900/01/01"))&&!isNaN(t)}return!1}catch(e){return!1}},Bs=(e,t,i)=>{const r=t.map(t=>e[t]??"").join("_");return""===r.replace(/^_+|_+$/g,"").trim()?`__row_${i}`:r},Cs=(e,t,i)=>i.every(i=>e[i]===t[i]),xs=(e,t,i)=>i.filter(i=>{if(e[i]!==t[i]&&("object"!=typeof t[i]&&"object"!=typeof e[i]&&"string"!=typeof t[i]||!ys(t[i])||!ys(e[i])||ze(new Date(t[i]),"dd/MM/yyyy HH:mm:ss")!==ze(new Date(e[i]),"dd/MM/yyyy HH:mm:ss")))return i}),Fs=(e,t=!1,i=[])=>{if("object"==typeof e)return e;const r=i.length?i:ws;for(const t of r){const i=je(e,t,new Date);if(!isNaN(i.getTime()))return i}return t?e:new Date(e)},Ss=(e,t,i=!0,r=!1)=>{const n=gs(t,!0),a=n?.find(t=>{const i=e?.indexOf(t.href);if(-1===i)return!1;const r=e[i+t.length];return void 0===r||"/"===r||""===r});if(!a)return"";const{label:s,system_code:o,user_code:l}=a,h="en"===qe.language?`${s}`:qe.t(o,{defaultValue:s});if(!i)return h;const c=r?l?.trim():o?.trim();return c?`${h} (${c})`:h},Ns=e=>getComputedStyle(document.documentElement).getPropertyValue(e).trim(),Es=(e,t)=>{if("Enter"!==e.key)return;const i=e.target;if("option"===i.getAttribute("role")||i.classList.contains("MuiMenuItem-root")||i.classList.contains("MuiAutocomplete-option")){const r="true"===i.closest('[role="listbox"]')?.getAttribute("aria-multiselectable");return e.preventDefault(),e.stopPropagation(),i.click(),void(r||requestAnimationFrame(()=>{requestAnimationFrame(()=>{ks(e.shiftKey,t,i,!0)})}))}e.preventDefault(),e.stopPropagation(),ks(e.shiftKey,t,i)},ks=(e,t,i,r)=>{let n;clearTimeout(n);const a=[];if(t)a.push(...Array.from(document.querySelectorAll(`[data-scope-id="${t}"]`)));else{const e=i.closest("[data-scope-id], form, div[tabindex]");a.push(e||i)}if(0===a.length)return;const s=[];if(a.forEach(e=>{if(!e)return;const t=Array.from(e.querySelectorAll('\n button:not([tabindex="-1"]),\n [href]:not([href^="javascript:"]),\n input:not([type="hidden"]),\n select,\n textarea,\n [tabindex]:not([tabindex="-1"]),\n .MuiTab-root,\n .MuiSelect-select,\n [role="combobox"]\n ')).filter(e=>{const t=getComputedStyle(e);return!(e.hasAttribute("disabled")||"true"===e.getAttribute("aria-disabled")||e.hasAttribute("readonly")||"none"===t.display||"hidden"===t.visibility||e.classList.contains("MuiTableSortLabel-root")||e.getAttribute("data-testid")?.includes("sentinel"))});s.push(...t)}),0===s.length)return;let o=i;if("option"===i.getAttribute("role")){const e=i.closest('[role="listbox"]')?.id;if(e){const t=document.querySelector(`[aria-controls="${e}"]`);t&&(o=t)}}else"combobox"===i.getAttribute("role")&&(o=i);s.includes(o)||(o=document.activeElement);let l=s.indexOf(o);-1===l&&(l=e?s.length-1:-1);let h=e?l>0?l-1:s.length-1:l<s.length-1?l+1:0;r&&!e&&(h=h<s.length-1?h+1:0);const c=s[h];c?n=setTimeout(()=>{c.focus(),"numeric"===c.getAttribute("inputmode")&&c?.select()},0):console.warn("No next element to focus (normal)")};var Ts=Object.freeze({__proto__:null,ChangeJsonValue:(e,t)=>Array.isArray(e)?e.map(e=>{let i=e;return Object.keys(e).forEach(r=>{if(Boolean(t[r])){let n=e[r];if("object"==typeof t[r])i["_NEW_"+r]=Boolean(t[r][n])?t[r][n]:n;else if("function"==typeof t[r]){let e=t[r](n,r);i["_NEW_"+r]=Boolean(e)?e:n}else i["_NEW_"+r]=n}}),i}):e,GetAllChieldMenuData:gs,GetMaxCdForDetails:As,GetMaxDisplaySequenceCd:(e,t)=>{if(Array.isArray(e)){if(!Boolean(t))return e.length+1;let i=0;return e.forEach((e,r)=>{if(void 0!==e[t]){let{_hidden:r}=e;(void 0===r||"boolean"==typeof r&&!Boolean(r))&&parseFloat(e[t])>i&&(i=parseFloat(e[t]))}else i<r+1&&(i=r+1)}),i+1}return 1},ValidatePassword:e=>Boolean(e)?/(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*\W)(?!.*\s)/.test(e)?e.length<8||e.length>16?"EnterPasswordValid":"":"EnterPasswordPolicy":"PasswordisRequired",base64toBlob:ps,blobToFile:(e,t)=>{var i=e;return i.lastModifiedDate=new Date,i.name=t,e},convertBlobToBase64:fs,generateUUID:()=>{var e=(new Date).getTime(),t="undefined"!=typeof performance&&performance.now&&1e3*performance.now()||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(i){var r=16*Math.random();return e>0?(r=(e+r)%16|0,e=Math.floor(e/16)):(r=(t+r)%16|0,t=Math.floor(t/16)),("x"===i?r:3&r|8).toString(16)})},getAuthorizeTokenText:(e,t)=>"bearer"===t?"Bearer "+e:"basic"===t?"Basic "+e:"Bearer "+e,getCssVariable:Ns,getCurrentDateinLong:()=>(new Date).getTime(),getDependetFieldDataArrayField:e=>{let t={};for(const i in e)if(e.hasOwnProperty(i)){const r=i.split(".");t[r[r.length-1]]=e[i]}return t},getDynamicLabel:Ss,getMetadataLabelFromColumnName:(e,t)=>{if(!Boolean(e)||!Boolean(t)||!Array.isArray(t))return{};let i={};for(const r of e?.fields??[])t.includes(r.name)&&(i[r.name]=r.label);return i},getPadAccountNumber:(e,t)=>e?.trim()?.padStart(t?.PADDING_NUMBER??6,"0").padEnd(20," "),getParsedDate:Fs,handleEnterToFocus:Es,isValidDate:ys,isValidDateStrict:bs,moveToNextField:ks,transformBlobData:e=>Array.isArray(e)?e.map(e=>{let t={};return t.id=L(e.ID),t.blob=ps(e.BLOB,"pdf"===e.FILEEXT?"application/pdf":""),t.fileExt=e.FILEEXT,t.name=e.NAME?.includes(".")??1?e.NAME:e.NAME+"."+t.fileExt,t._mimeType="pdf"===t.fileExt?"pdf":"jpg"===t.fileExt||"png"===t.fileExt||"jpeg"===t.fileExt?"image":"other",t.sizeStr=t.blob?.size??1e3,t}):e,transformDetailDataForDML:(e,t,i)=>{const r={isNewRow:[],isUpdatedRow:[],isDeleteRow:[]};if(!i?.length)return console.warn("transformDetailDataForDML third argument expected at least one valid key to compare!"),r;const n=new Map(e.map((e,t)=>[Bs(e,i,t),e])),a=new Map(t.map((e,t)=>[Bs(e,i,t),e]));for(const[e,t]of a){const a=n.get(e);if(a){if(Cs(a,t,i)){const e=xs(a,t,Object.keys(t));if(e.length>0){const i={};for(const t of e)t in a&&(i[t]=a[t]);const n={...t,_OLDROWVALUE:i,_UPDATEDCOLUMNS:e};r.isUpdatedRow.push(n)}}}else r.isNewRow.push(t)}for(const[e,t]of n)a.has(e)||r.isDeleteRow.push(t);return r},transformDetailsData:vs,uncompressApiResponse:e=>{const t=atob(e),i=new Uint8Array(t.split("").map(e=>e.charCodeAt(0))),r=We.inflate(i,{to:"string"});return JSON.parse(r)}});const Ls=({onSubmit:e,readOnly:t=!1})=>{const i=a(Ya),r=R(Pa(i.formName)),n=_(l((e,t)=>{const r=e(za(i.formName)),n=e(Ga(i.formName));for(const e of r)t(Ra(e),M);for(const e of n)t(qa(e),M);t(Ga(i.formName),M),t(za(i.formName),M),t(Ma(i.formName),M),t(Oa(i.formName),M),t(Pa(i.formName),M)},[i.formName]));h(()=>()=>n(),[n]);const s=_(l((e,t,r)=>{const n=e(za(i.formName));if(n){for(const e of n){const n=e.replace(`${i.formName}/`,"");let a="object"==typeof r?ka(r,n,""):"";t(Ra(e),e=>({...e,touched:!1,value:a,error:"",validationRunning:!1,incomingMessage:null})),t(Pa(i?.formName),e=>({...e,validationRunning:!1}))}const a=e(Ga(i.formName));if(a)for(const e of a)t(qa(e),e=>({...e,resetFlag:!0}))}},[i.formName])),o=_(l((e,t)=>{t(Pa(i.formName),e=>({...e,isSubmitting:!0,submitAttempt:e.submitAttempt+1}))},[i.formName]));h(()=>{Boolean(t)&&o()},[o,t]);const c=_(l((e,t,r=!1,n="",a="")=>{"string"!=typeof n&&(n=""),t(Pa(i.formName),e=>({...e,isSubmitting:!1,submitSuccessful:r,serverSentError:n,serverSentErrorDetail:a}))},[i.formName])),d=_(l((e,t,r={})=>{for(const e of Object.entries(r)){const[r,n]=e;t(Ra(`${i.formName}/${r}`),e=>({...e,error:n}))}},[i.formName])),u=_(l((e,t,r)=>{r?.preventDefault?.();const n=e(za(i.formName));if(n)for(const e of n)t(Ra(e),e=>({...e,touched:!1,value:"",error:"",validationRunning:!1})),t(Pa(i?.formName),e=>({...e,validationRunning:!1}));const a=e(Ga(i.formName));if(a)for(const e of a)t(qa(e),e=>({...e,resetFlag:!1,templateFieldRows:[],lastInsertIndex:-1}))},[i.formName])),A=l(e=>{e.preventDefault(),"object"==typeof i.initialValues&&Object.keys(i.initialValues).length>0?s(i.initialValues):u(null)},[s,u,i.initialValues]),p=_(l((e,t,r)=>{for(const e of r)t(Ra(`${i.formName}/${e}`),e=>({...e,touched:!1,value:"",error:"",validationRunning:!1})),t(Pa(i?.formName),e=>({...e,validationRunning:!1}));const n=e(Ga(i.formName));if(n)for(const e of n)t(qa(e),e=>({...e,resetFlag:!1,templateFieldRows:[],lastInsertIndex:-1}))},[i.formName])),f=_(l((e,t,r)=>e(Xa({formName:i.formName,fields:r}))??{},[i.formName])),m=l(e=>{if("object"==typeof i.initialValues&&Object.keys(i.initialValues).length>0){let t={};for(const r of e){const e=ka(i.initialValues,r,null);Boolean(e)&&(t=Ta(t,r,e))}Object.keys(t).length>0?s(t):p(e)}},[i.initialValues,p,s]),g=async(e,t,r,n=!1)=>{const a=t(Ra(e));if(a){if(a?.ignoreInSubmit)return null;if(!0===a?.excluded)return Boolean(a?.error)?null:{...a};const t={...a};let s=null;if(!t.touched||t.validationRunning){const a="function"==typeof t.validate?t.validate:e=>({error:e.error});try{const e=f(t.dependentFields);s=await Promise.resolve(a(t,e,{...i.formState,isSubmitting:n}))}catch(e){s={error:e.message,apiResult:null}}const o={...t,validationRunning:!1,touched:!0,error:s.error,validationAPIResult:s.apiResult};return r(Ra(e),o),r(Pa(i?.formName),e=>({...e,validationRunning:!1})),o}return t}return null},w=_(l((e,t,r)=>(async r=>{let n=!1;for(const a of r){let r=await g(`${i.formName}/${a}`,e,t);null!==r&&(!1===n&&(n=Boolean(r.error)))}return n})(r),[i.formName])),b=(e,t,r)=>{const n=(e=>{const t=`tabform-main-tab-${e}`,i=document.getElementById(t);if(!i)return[];const r=i.querySelectorAll('[id^="tabform-sub-tab-"]');return Array.from(r).map(e=>({id:e.id,value:Number(e.getAttribute("value")),label:e.innerText||e.textContent,hasError:"red"===e.style.color}))})(i.formName)?.find(e=>e?.hasError)||{};if(!I(n)){const e=n?.id?.split("-")||[];if(e?.length>=4){const t=e?.[3],i=e?.[4];i!==t&&document.getElementById(n.id)?.click()}}const a=document.getElementById(e);if(a){let e;a.style.scrollMarginBottom="50px",a.scrollIntoView({behavior:"smooth",block:"end"}),clearTimeout(e),e=setTimeout(()=>{a.focus(),"autocomplete"!==t&&"select"!==t||r||(a.click(),a.dispatchEvent(new KeyboardEvent("keydown",{key:"ArrowDown",code:"ArrowDown",keyCode:40,which:40,bubbles:!0})))},800)}},v=l(e=>Number(e.match(/\[(\d+)\]/)?.[1]),[]),y=_(l(async(t,r,n,a="action",s=!0,l=null)=>{let h=null,u={};return n.preventDefault(),o(),await(async()=>{const n=t(za(i.formName));if(n){const o=[];let A=!1;for(const e of n){let i=await g(e,t,r,!0);null!==i&&(!1===A&&(A=Boolean(i.error)),i.error&&(u[e]=i.error),o.push(i))}if(A)for(const e of o.filter(e=>e?.error)){if("function"==typeof i.setCurrentStepIndexFnRef){const t=v(e.name);null==t||isNaN(t)||i.setCurrentStepIndexFnRef(t)}setTimeout(()=>{document.getElementById(e?.fieldKey)&&b(e?.fieldKey,e?.componentType||"",e?.readOnly)},0);break}if(A&&s)c(!1);else if("function"==typeof e){let t={},r={};for(const e of o){let n=e.value;n instanceof Date&&(n=ys(n)?k(n,"iii LLL dd yyyy HH:mm:ss xxxx"):n),t=Ta(t,e.name.replace(`${i.formName}/`,""),n),r=Ta(r,e.name.replace(`${i.formName}/`,""),e.displayValue)}h={data:t,displayData:r,actionFlag:a,hasError:A,optionalData:l,errorFields:u},e(t,r,c,d,a,A,l,u)}}})(),h},[i.formName])),B=_(l(async(e,t)=>{const r=e(za(i.formName));let n={};if(r){const a=[];for(const i of r){let r=await g(i,e,t);null!==r&&a.push(r)}for(const e of a){let t=e.value;t instanceof Date&&(t=k(t,"iii LLL dd yyyy HH:mm:ss xxxx")),n=Ta(n,e.name.replace(`${i.formName}/`,""),t)}}return n},[i.formName])),C=_(l((e,t,r={})=>{for(const e of Object.entries(r)){const[r,n]=e;t(Ra(`${i.formName}/${r}`),e=>({...e,value:n}))}},[i.formName]));return{handleSubmit:y,handleSubmitPartial:w,handleReset:A,handleResetPartial:m,handleClear:u,handleClearPartial:p,getFieldData:B,setFieldData:C,...r}},Is=({arrayFieldName:e,template:t,shouldExclude:i,dependentFields:r,getFixedRowsCount:n})=>{const s=a(Ya);let c=o(Object.keys(t));const d=z(Pa(s.formName)),[u,A]=j(qa(`${s.formName}/${e}`)),p=o(u);p.current=u;const f=V(Wa(s.formName)),m=V(Ja(s.formName)),g=V(Ka(s.formName)),w=_(l((e,t,{fieldName:i})=>{t(Ha(s.formName),i)},[s.formName])),b=_(l((e,t,i)=>e(Ga(s.formName)).includes(i),[s.formName,Wa])),v=z(Xa({formName:"function"==typeof i||"function"==typeof n?s.formName:`${s.formName}-NOTEXIST`,fields:r})),y=_(l((e,t,i)=>{const r=[];for(let e=0;e<i.length;e++){let n=Object.keys(i[e]?.cells);for(let a=0;a<n.length;a++){const o=i[e].cells[n[a]].key;t(Ra(`${s.formName}/${o}`),M),r.push(`${s.formName}/${o}`)}}const n=e(za(s.formName)).filter(e=>!r.includes(e));t(za(s.formName),n)},[s.formName])),B=o(null);h(()=>{if("function"==typeof i){const e=Promise.resolve(i({},v,s.formState));B.current=e,e.then(t=>{e===B.current&&(!0===t&&!1===u.excluded?(A(e=>({...e,excluded:!0})),y(u.templateFieldRows)):!1===t&&!0===u.excluded&&A(e=>({...e,excluded:!1})))})}}),h(()=>{if("function"==typeof n&&!1===u.excluded){let e=n(u,v,s.formState);if(e<0&&(e=0),u.templateFieldRows.length!==e){let t=e-u.templateFieldRows.length;if(t>0){let e=u.templateFieldRows.length,i=u.templateFieldRows,r=u.lastInsertIndex;for(;t>0;){let n=x(e,i,r,c.current);i=n?.newRows,r=n?.lastIndex??-1,e++,t--}Array.isArray(i)&&A(e=>({...e,lastInsertIndex:r,templateFieldRows:i}))}else{let e=u.templateFieldRows.length+t,i=u.templateFieldRows.slice(0,e),r=u.templateFieldRows.slice(e);y(r),A(e=>({...e,templateFieldRows:i,lastInsertIndex:e.lastInsertIndex}))}}}});const C=_(l((e,t,i)=>{const r=[];for(let e=0;e<i.length;e++){let t=Object.keys(i[e]?.cells);for(let n=0;n<t.length;n++){const a=i[e].cells[t[n]].key;r.push(`${s.formName}/${a}`)}}let n={};for(let t=0;t<r.length;t++){const i=e(Ra(r[t]));if(i){if(!0===i.excluded)continue;n=Ta(n,i.name.replace(`${s.formName}/`,""),i.value)}}return n},[s.formName])),x=l((t,i,r,n)=>{if(t>=0&&t<=i.length){const a=++r;let o={cells:{},fieldIndexKey:`${s.formName}/${e}/${a}`};for(const i of n){const r=`${e}[${a}].${i}`,n=`${e}[${t}].${i}`;o.cells[i]={key:r,name:n}}const l=i.slice(0,t),h=i.slice(t);let c=t+1;for(let t of h){for(const i of n)t.cells[i].name=`${e}[${c}].${i}`;c++}return{newRows:[...l,o,...h],lastIndex:a}}},[e,s.formName]),F=l(t=>{if(t>=0&&t<p.current.templateFieldRows.length){let i=t;const r=p.current.templateFieldRows[t],n=p.current.templateFieldRows.slice(0,i),a=p.current.templateFieldRows.slice(i+1);for(let t of a){for(const r of c.current??[])t.cells[r].name=`${e}[${i}].${r}`;i++}A(e=>({...e,templateFieldRows:[...n,...a],lastInsertIndex:e.lastInsertIndex}));for(const e of Object.values(r.cells))e.key.indexOf(`${s.formName}/`)>-1?(g(e.key),w({fieldName:e.key})):(g(`${s.formName}/${e.key}`),w({fieldName:`${s.formName}/${e.key}`}));for(const e of c.current){const t=r.cells[e].key,i=`${s.formName}/${t}`;s.lastValidationValue.current.delete(i),s.flagRef.current.delete(i)}}},[A,g,e,s.formName,w]),S=l(t=>{const i=ka(t,e);if(void 0!==i&&Array.isArray(i)){let e=-1,t=[];for(let r=0;r<i.length;r++){const i=x(t.length,t,e,c.current);void 0!==i&&(e=i.lastIndex,Array.isArray(i.newRows)&&(t=i.newRows))}A(i=>({...i,resetFlag:!1,templateFieldRows:t,lastInsertIndex:e}))}else A(e=>({...e,resetFlag:!1,templateFieldRows:[],lastInsertIndex:-1}))},[e,A,x]);h(()=>{if(b(`${s.formName}/${e}`)||(f(`${s.formName}/${e}`),"object"==typeof s.initialValues&&S(s.initialValues)),!0===Boolean(s.resetFieldOnUnmount))return()=>{m(`${s.formName}/${e}`)}},[f,m,s.formName,e,s.resetFieldOnUnmount,s.initialValues,S,b]),h(()=>{!0===u.resetFlag&&"object"==typeof s.initialValues&&Object.keys(s.initialValues).length>0&&S(s.initialValues)},[u.resetFlag,S,s.initialValues]);const N=l(e=>p.current.templateFieldRows.map((t,i)=>e({row:t,fields:c.current?.slice?.()??[],rowIndex:i,removeFn:F,totalRows:p.current.templateFieldRows.length})),[F]),E=l(()=>{A(e=>({...e,resetFlag:!1,templateFieldRows:[],lastInsertIndex:-1}))},[A]),k=l(e=>{const t=x(e,p.current.templateFieldRows,p.current.lastInsertIndex,c.current);void 0!==t&&Array.isArray(t.newRows)&&A(e=>({...e,lastInsertIndex:t.lastIndex,templateFieldRows:t.newRows}))},[A,x]),T=l(()=>{const e=x(p.current.templateFieldRows.length,p.current.templateFieldRows,p.current.lastInsertIndex,c.current);void 0!==e&&A(t=>({...t,lastInsertIndex:e.lastIndex,templateFieldRows:e.newRows}))},[A,x]),L=l(()=>{const e=x(0,p.current.templateFieldRows,p.current.lastInsertIndex,c.current);void 0!==e&&Array.isArray(e.newRows)&&A(t=>({...t,lastInsertIndex:e.lastIndex,templateFieldRows:e.newRows}))},[A,x]),I=l(()=>{F(p.current.templateFieldRows.length-1)},[F]),D=l((e,t)=>{if(e>=0&&e<p.current.templateFieldRows.length&&t>=0&&t<p.current.templateFieldRows.length&&e!==t){const i=p.current.templateFieldRows.slice(0),r=i[e],n=i[t];for(const e of c.current??[]){const t=r.cells[e].name;r.cells[e].name=n.cells[e].name,n.cells[e].name=t}const a=i[t];i[t]=i[e],i[e]=a,A(e=>({...e,templateFieldRows:i,lastInsertIndex:e.lastInsertIndex}))}},[A]),U=l((t,i)=>{if(t>=0&&t<p.current.templateFieldRows.length&&i>=0&&i<p.current.templateFieldRows.length&&t!==i){const[r,n]=t<i?[t,i]:[i,t],a=p.current.templateFieldRows.slice(0,r),s=p.current.templateFieldRows.slice(n+1),o=p.current.templateFieldRows.slice(r,n+1);if(t<i){let r=o.slice(0,1)[0],n=o.slice(1),l=t;for(let t of n){for(const i of c.current??[])t.cells[i].name=`${e}[${l}].${i}`;l++}for(const t of c.current??[])r.cells[t].name=`${e}[${i}].${t}`;A(e=>({...e,templateFieldRows:[...a,...n,r,...s],lastInsertIndex:e.lastInsertIndex}))}else{let t=o.slice(0,o.length-1),r=o.slice(o.length-1)[0],n=i+1;for(let i of t){for(const t of c.current??[])i.cells[t].name=`${e}[${n}].${t}`;n++}for(const t of c.current??[])r.cells[t].name=`${e}[${i}].${t}`;A(e=>({...e,templateFieldRows:[...a,r,...t,...s],lastInsertIndex:e.lastInsertIndex}))}}},[A,e]),P=l(()=>C(p.current.templateFieldRows),[C]);return{fieldRows:u,templateFieldNames:c.current,clearFieldArray:E,getAllRowsValues:P,unshift:L,push:T,insert:k,pop:I,remove:F,swap:D,move:U,renderRows:N,excluded:u.excluded,isSubmitting:d.isSubmitting,formState:s.formState,formName:s.formName}},Ds=e=>()=>e,Us=(e,t,i,r="",n="")=>{let a=((e,t)=>{for(const i of e)if(i[0]instanceof RegExp&&i[0].test(t))return{found:!0,defaultFn:i[1]};return{found:!1,defaultFn:void 0}})(t,r);if(a.found)if("getFixedRowsCount"!==n||isNaN(Number(e))){if("true"===e)i.push([r,"BOOLEAN_FUNCTION_TO_ATTACH_FOR_BOOLEAN_VALUES",n,Ds(!0)]);else if("false"===e)i.push([r,"BOOLEAN_FUNCTION_TO_ATTACH_FOR_BOOLEAN_VALUES",n,Ds(!1)]);else if("boolean"==typeof e)i.push([r,"BOOLEAN_FUNCTION_TO_ATTACH_FOR_BOOLEAN_VALUES",n,Ds(e)]);else if("object"==typeof e)i.push([r,"RULES_ENGINE_FUNCTION_TO_ATTACH_AS_DEFAULT_FN",n,Fa(e)]);else if("string"==typeof e)if("function"==typeof a.defaultFn){let t=a.defaultFn(r);"function"==typeof t?i.push([r,e,n,t]):i.push([r,e,n,void 0])}else i.push([r,e,n,void 0])}else i.push([r,"NUMBERIC_FUNCTION_TO_ATTACH_FOR_FIXED_ROW_COUNT",n,(s=e,()=>Number(s))]);var s},Ps=(e,t,i,r,n="",a="")=>{if("object"==typeof e&&null!==e)if(r.indexOf(a)>-1)Us(e,t,i,n,a);else for(const[a,s]of Object.entries(e)){const e=Boolean(n)?`${n}.${a}`:`${a}`;Ps(s,t,i,r,e,a)}else Array.isArray(e)?e.forEach((e,a)=>{const s=Boolean(n)?`${n}.${a}`:`${a}`;Ps(e,t,i,r,s,a)}):Us(e,t,i,n,a)},Rs=(e,t,i,r=[])=>{const n=[];Ps(e,i,n,r);let a={...e};for(const e of n){if("setColor"===e[2]){const i=t.getFn(e[1],e[3]);a=i===e[3]?e[1].indexOf("FUNCTION_TO_ATTACH")>=0?Ta(a,e[0],""):Ta(a,e[0],e[1]):Ta(a,e[0],i)}else{const i=t.getFn(e[1],e[3]);a=Ta(a,e[0],i)}if(["options","leftOptions","rightOptions"].indexOf(`${e[2]}`)>=0){const t=e[0].split(".");a=Ta(a,[...t.slice(0,t.length-1),`_${e[2]}Key`].join("."),e[1])}else{const i=t.getFn(e[1],e[3]);a=Ta(a,e[0],i)}}return a},Os=(e,t)=>{let i=Ms(e.fields,t);return{form:Hs(e.form,t),fields:i}},Qs=(e,t)=>{let i=e.columns.map(e=>Hs(e,t));return{...e,columns:i}},Hs=(e,t)=>{const{__VIEW__:i,__EDIT__:r,__NEW__:n,...a}=e;let s=a;return"new"===t?s=S({},a,n):"edit"===t?s=S({},a,r):"view"===t&&(s=S({},a,i)),s},Ms=(e,t)=>Array.isArray(e)?e.map(e=>{const{__VIEW__:i,__EDIT__:r,__NEW__:n,...a}=e;try{if("arrayField"===a.render.componentType||"arrayFieldStepper"===a.render.componentType){let e=Ms(a._fields,t);a._fields=e}else if("dataTable"===a.render.componentType){let e=Ms(a._column,t);a._column=e}}catch(t){console.log(e)}let s=a;return"new"===t?s=S({},a,n):"edit"===t?s=S({},a,r):"view"===t&&(s=S({},a,i)),s}):e,_s=e=>{if("object"==typeof e){const t=Object.keys(e);let i=!0;return 0!==t.length&&(t.forEach(t=>{if(Boolean(e[t]))return i=!1,!1}),i)}return!1},js=(e,t)=>{if("object"==typeof e&&"object"==typeof t){let i=N(e);return Object.keys(t).forEach(e=>{t[e]||(i[e]="")}),i}return e},zs=e=>Array.isArray(e)?e.map((e,t)=>({id:t+1,...e})):e,Vs=(e,t)=>e.reduce((e,i)=>((e[i[t]]=e[i[t]]||[]).push(i),e),{}),Ks=(e,t="",i="error")=>({error_msg:e,severity:i,error_detail:t}),qs=(e,t)=>Array.isArray(e)?e.map(e=>Boolean(e?._hidden)?e:Boolean(t[e?.TRN_TYPE])?(e?.DISPLAY_MSG!==t[e?.TRN_TYPE]?.DISPLAY_MSG&&(e._isTouchedCol={...e._isTouchedCol,DISPLAY_MSG:!0},e._oldData={...e?._oldData,DISPLAY_MSG:Js(e?.DISPLAY_MSG)},e.DISPLAY_MSG=Js(t[e?.TRN_TYPE]?.DISPLAY_MSG)),e?.DISPLAY_MSG_BN!==t[e?.TRN_TYPE]?.DISPLAY_MSG_BN&&(e._isTouchedCol={...e._isTouchedCol,DISPLAY_MSG_BN:!0},e._oldData={...e?._oldData,DISPLAY_MSG_BN:Js(e?.DISPLAY_MSG_BN)},e.DISPLAY_MSG_BN=Js(t[e?.TRN_TYPE]?.DISPLAY_MSG_BN)),e):e):e,Gs=e=>{let t=[],i=[],r=[];return Array.isArray(e)&&e.forEach(e=>{let{_isNewRow:n,_hidden:a,_isTouchedCol:s,_oldData:o,...l}=e;if(Boolean(n))Boolean(a)||t.push(l);else if(Boolean(a))i.push(l);else if(Boolean(s)){let t=!1,i=N(l),n={},a=Object.keys(s),h=[];a.forEach(i=>{e?._isTouchedCol?.[i]&&(t=!0,n[i]=o?.[i]??"",h.push(i))}),t&&r.push({...i,_UPDATEDCOLUMNS:h,_OLDROWVALUE:n})}}),{isNewRow:t,isDeleteRow:i,isUpdatedRow:r}},Ws=(e,...t)=>{if("object"==typeof e){let i={};return t.forEach(t=>{i[t]=e[t]}),i}return e},Js=e=>e.split("").map(function(e,t,i){var r=e.charCodeAt(0).toString(16).toUpperCase();return r.length>2?"\\u"+(3===r.length?"0"+r:r):e}).join(""),Xs=(e,t)=>{let i=[],r=[],n=[];return Array.isArray(e)||(e=[e]),Array.isArray(t)||(t=[t]),e.forEach(e=>{const{SR_CD:r,...a}=e,s=t.find(e=>e.SR_CD===r);if(s){if(s){const e=s;for(const t in e)e.hasOwnProperty(t)&&"boolean"==typeof e[t]&&(e[t]=e[t]?"Y":"N")}let t=vs(e,s);t?._UPDATEDCOLUMNS?.length>0&&(e={...e,...t},n.push(e))}else i.push(a)}),t.forEach(t=>{const{SR_CD:i,...n}=t;e.find(e=>e.SR_CD===i)||r.push(t)}),{isNewRow:i,isDeleteRow:r,isUpdatedRow:n}},Ys=({title:e="sheet1",data:t})=>{const i=it.json_to_sheet(t),r=it.book_new();r.Props={Title:e,Author:"Acute",CreatedDate:new Date},r.SheetNames.push(e),r.Sheets[e]=i,rt(r,`${e}.xlsx`)},$s=({title:e="sheet1",data:t})=>{const i=it.json_to_sheet(t),r=it.book_new();r.Props={Title:e,Author:"Acute",CreatedDate:new Date},r.SheetNames.push(e),r.Sheets[e]=i,rt(r,`${e}.csv`,{bookType:"csv"})},Zs=vi(ct)(({})=>({background:"var(--primary-bg)",color:"#fff",fontWeight:700,minWidth:"64px",marginLeft:"5px",letterSpacing:"0.02857em",textTransform:"capitalize",transition:".25s ease","&:hover":{background:"var(--primary-bg)",opacity:"0.75",boxShadow:"rgba(0, 0, 0, 0.2) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px"},"&:disabled":{color:"#eee !important",opacity:"0.65 !important"}})),eo=c(({starticon:i,endicon:r,rotateIcon:n,sx:s,textColor:l,elevate:c,enableShortcut:u=!0,children:A,onClick:p,disabled:f,shortcut:m,eventKey:g,...w},b)=>{const v=i?Xi[i]:null,y=r?Xi[r]:null,[B,C]=d(!1),x=o(null),F=a(Ya),S=R(Pa(F.formName));h(()=>{S.validationRunning&&C(!1)},[S.validationRunning]),h(()=>{if(!m||f)return;const e=m.toLowerCase(),t=t=>{switch(e){case"alt":return t.altKey;case"ctrl":case"control":return t.ctrlKey;case"shift":return t.shiftKey;case"meta":return t.metaKey;default:return!1}},i=e=>{if(!(()=>{if(!x.current)return!1;const e=document.querySelectorAll('[role="dialog"]');return!e.length||e[e.length-1].contains(x.current)})())return;const i=t(e),r=e.key?.toLowerCase()===g?.toLowerCase();if(i&&r)return x.current?.focus(),e.preventDefault(),void setTimeout(()=>{x.current?.click()},0);i&&C(!0)},r=e=>{t(e)&&"Escape"!==e.key||" "===e.key||"Enter"===e.key||(e.preventDefault(),C(!1))},n=()=>{C(!1)};return window.addEventListener("keydown",i),window.addEventListener("keyup",r),window.addEventListener("blur",n),()=>{window.removeEventListener("keydown",i),window.removeEventListener("keyup",r),window.removeEventListener("blur",n)}},[m,f,g]);return t(Zs,{sx:{color:l,position:"relative","&:hover":{"& .MuiSvgIcon-root":{transform:n,transition:"transform 2s ease-in-out"}},boxShadow:c?"2px 2px 4px rgba(0,0,0,.2)":"none",...s},className:"gradient-btn",ref:e=>{x.current=e,b&&("function"==typeof b?b(e):b.current=e)},startIcon:v?e(v,{}):null,endIcon:y?e(y,{}):null,onClick:p,disabled:f,title:m&&g?`${m}+${g?.toUpperCase()}`:void 0,...w,children:[B&&m&&e(X,{style:{position:"absolute",top:"-4px",right:"-5px",background:"#ff0",color:"var(--theme-color1)",fontSize:"12px",width:"17px",height:"17px",borderRadius:"100%",zIndex:99,boxShadow:"0 1px 4px rgba(0,0,0,.2)",textAlign:"center",lineHeight:"18px",fontWeight:"bolder"},children:g?.toUpperCase()}),A]})});eo.displayName="GradientButton";const to=({errorMsg:r,errorDetail:n,...a})=>{const[s,o]=d(!1),{t:l}=W();return t(i,{children:[e(nt,{...a,action:Boolean(n)?e(Y,{color:"secondary",onClick:()=>o(e=>!e),children:l(s?"ShowLess":"ShowMore")}):null,style:{background:"white"},children:e("span",{style:{fontWeight:"bold",color:"red"},children:r})}),t($,{open:s,fullWidth:!1,onKeyUp:e=>{"Escape"===e.key&&o(!1)},children:[e(Z,{children:l("ErrorDetails")}),e(ee,{children:e(te,{children:n})}),e(ie,{children:e(eo,{onClick:()=>o(!1),children:l("Ok")})})]})]})};function io(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===i&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}io(".waviy-loading-text{position:relative}.waviy-loading-text span{animation:flip 2s infinite;animation-delay:calc(.2s*var(--i));display:inline-block;font-size:.9rem;font-weight:400;position:relative;text-transform:uppercase}@keyframes flip{0%,80%{transform:rotateY(1turn)}}.waviy-loading-text-1{--i:1}");const ro=({i:e})=>({"--i":e}),no=({text:t="Loading"})=>{const i=Boolean(t)?t:"Loading";return e("div",{className:"waviy-loading-text",children:[...i].map((t,i)=>e("span",{style:ro({i:i+1}),children:t},"span"+i))})},ao=({open:i,closeDialog:r,gridData:n,fileName:a})=>{const[s,o]=d(!1),[l,h]=d(""),{t:c}=W(),u=()=>{r()},A=e=>{o(!0),h("");try{"excel"===e.toLowerCase()?Ys({data:n,title:a}):"csv"===e.toLowerCase()&&$s({data:n,title:a})}catch(e){h(String(e))}setTimeout(()=>{o(!1),u()},1e3)};return t($,{open:i,maxWidth:"sm",children:[e(Z,{children:c("Whichformatdoyouwanttodownload")}),e(ee,{children:s?e(no,{text:"Exporting..."},"loaderforExporting"):Boolean(l)?e(to,{severity:"error",errorMsg:l}):null}),t(ie,{children:[e(Y,{onClick:()=>{A("Excel")},color:"secondary",disabled:s,children:c("Excel")}),e(Y,{onClick:()=>{A("CSV")},color:"secondary",disabled:s,children:c("CSV")}),e(Y,{onClick:u,color:"secondary",disabled:s,children:c("Cancel")})]})]})},so=({title:e="sheet1",data:t})=>{let i=tt.read(t.blob,{type:"base64",raw:!0}),r=[];return i?.SheetNames?.length>0?(i?.SheetNames.forEach(e=>{let t=tt.utils.sheet_to_json(i.Sheets[e],{defval:"",raw:!1});t.forEach(e=>{for(let t in e){const i=Fs(e[t],!0);e[t]=i instanceof Date&&Ve(i)?i.toLocaleDateString("en-UK"):i}}),r=[...r,...t]}),r):[]},oo=e=>Array.isArray(e)?e.map(e=>{const{alignment:t,...i}=e;switch(t){case"right":return{...i,cellHeaderAlignment:"0 10px 0 0 !important",TableCellProps:{align:"right"}};case"center":return{...i,TableCellProps:{align:"center",sx:{justifyContent:"center"}}};case"left":return{...i,TableCellProps:{align:"left"}};default:return i}}):[],lo=Ci({root:{"&:focus-within":{border:"1px solid rgba(25, 118, 210, 0.5)"},borderLeft:"0.5px solid #BABABA",borderRight:"0.5px solid #BABABA"}}),ho=({children:r,showBorder:n,positionRelative:a,...s})=>{const{value:o,cell:l,column:{color:h="initial",TableCellProps:c,isVisibleField:d=e=>!0,pinColumn:u,sequence:A},row:p,pinnedOffsets:f,visibleColumns:m}=s,g=f?.leftMap?.[l.column.id],w=f?.rightMap?.[l.column.id],b=m?.filter(e=>"left"===e.pinColumn),v=m?.filter(e=>"right"===e.pinColumn),y=b?.[b.length-1]?.id,B=v?.[0]?.id,x=l.column.id===y,F=l.column.id===B,S=lo();let N="function"==typeof h?h(o,p):h,E=r,k=d(p?.original);return l?.isGrouped?E=t(i,{children:[e(C,{...p.getToggleRowExpandedProps([{style:{padding:0}}]),children:p.isExpanded?e(vr,{}):e(br,{})}),r,t("i",{children:["(",p.subRows.length,")"]})]}):l?.isPlaceholder&&(E=null),e(ci,{component:"div",variant:"head",className:n?S.root:"",...l.getCellProps([{...c??{}},{style:{background:"inherit",display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"0px 10px",lineHeight:"28px",color:N,position:u?"sticky":a?"relative":"static",..."left"===u&&{position:"sticky",left:g??0,...x&&{borderRight:"1px solid #ccc"}},..."right"===u&&{position:"sticky",right:w??0,...F&&{borderLeft:"1px solid #ccc"}}}}]),children:k?E:null})},co=t=>{const{value:i,column:{showTooltip:r=!1,transform:n=e=>e,isAutoSequence:a=!1,tooltipPlacement:o="bottom-start",customTooltipValue:l},row:h,data:c}=t;let d,{original:{_isNewRow:u}}=h;d=a?Boolean(h?.original?._displaySequence)?h?.original?._displaySequence:Boolean(u)?c.reduce((e,{_hidden:t})=>Boolean(t)?e:e+1,0):Number(h?.index??0)+1:n(i);const A=s(()=>{let e;return"string"==typeof l?e=h?.original?.[l]:"function"==typeof l&&(e=l(h?.original)),e},[h,l]);let p=r?e(Ii,{title:A??d,placement:o,children:e("span",{children:d})}):d;return e(ho,{...t,children:p})},uo=e=>Array.isArray(e)?e.map(e=>{const{componentType:t,...i}=e;return{...i,Cell:ma.getFn(t,co)}}):[],Ao=xi({root:{"&:has(.Mui-readOnly),&:has(.Mui-disabled),&:has(input[readonly]),&:has(textarea[readonly]:nth-child(1))":{"& input, & textarea":{color:"rgba(0, 0, 0, 0.75)",WebkitTextFillColor:"rgba(0, 0, 0, 0.75)"},"& label":{pointerEvents:"none",color:"rgba(0, 0, 0, 0.5)"}},"&.hasOldValue":{"& .MuiInputBase-root":{border:"1px solid var(--old-value-text-primary) !important"},"& input, & textarea, & .MuiSelect-select, & .MuiAutocomplete-inputRoot, & .MuiInputBase-root":{backgroundColor:"var(--old-value-bg-primary) !important",color:"var(--old-value-text-primary) !important",WebkitTextFillColor:"var(--old-value-text-primary) !important",borderRadius:"4.5px",fontWeight:500},"& label":{color:"var(--old-value-text-primary) !important"}},"& .MuiFormHelperText-root":{marginTop:"1px","& .MuiFormHelperText-root:last-child":{margin:"1px 8px 0 0 !important"}},"& .MuiSelect-select.Mui-disabled":{WebkitTextFillColor:"rgba(0, 0, 0, 0.75)"},"& .MuiInputLabel-formControl":{padding:"2px 0px 7px 0px",fontWeight:600,textTransform:"capitalize",fontSize:"0.875rem",whiteSpace:"normal",lineHeight:"0.875","@media (max-width: 1200px)":{fontSize:"0.75rem"},"@media (max-width: 1440px)":{fontSize:"0.875rem"}},"& .MuiInputLabel-shrink":{transform:"translate(0, 1.5px) scale(1)"},"& label.Mui-focused":{color:"var(--theme-color1)"},"& .MuiInputBase-root":{border:"1px solid #BABABA",marginTop:"26px",borderRadius:5,backgroundColor:"#fff","& .MuiInputAdornment-root .MuiButtonBase-root":{marginRight:0},"& input":{padding:"5px 6px",height:"22px","&::placeholder":{},"@media (max-width: 1200px)":{height:"18px"}},"& .MuiInputBase-inputMultiline":{padding:"5px 6px"},"& .MuiInputBase-input":{padding:"5px 6px"}},"& .MuiInputBase-root.Mui-disabled":{"& input[type='password'] + .MuiInputAdornment-root":{display:"none"}},"& .Mui-error:after":{transform:"scaleX(1) !important",borderBottom:"3px solid var(--theme-color1)"},"& .MuiInput-underline:before":{borderBottom:"0"},"& .MuiInput-underline:after":{borderBottom:"3px solid var(--theme-color1)",transition:"transform 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms"},"&:hover .MuiInput-underline:before":{borderBottom:"0"},"& .MuiInputAdornment-positionStart":{borderRight:"1px solid #BABABA",height:"30px",maxHeight:"36px",padding:"0 1rem"},"& .withBorder.MuiInputAdornment-positionEnd":{borderLeft:"1px solid #BABABA",height:"30px",maxHeight:"36px",padding:"0 1rem"},"& .MuiSelect-selectMenu":{minHeight:"22px",lineHeight:"22px","@media (max-width: 1200px)":{minHeight:"18px",lineHeight:"18px"}}}})(_t),po=xi({root:{"& .MuiInputLabel-formControl":{fontWeight:600,textTransform:"capitalize",fontSize:"1rem","@media (max-width: 1200px)":{fontSize:"0.75rem"},"@media (max-width: 1440px)":{fontSize:"0.875rem"}},"& .MuiInputLabel-shrink":{transform:"translate(0, 1.5px) scale(1)"},"& label.Mui-focused":{},"& .MuiInputBase-root":{border:"1px solid #BABABA",borderRadius:5,backgroundColor:"#fff","& input":{padding:"6px 7px",height:"22px","&::placeholder":{fontSize:"0.875rem"},"@media (max-width: 1200px)":{height:"18px"}},"& inputMultiline":{padding:"6px 7px"},"& .MuiInputBase-input":{padding:"6px 7px"}},"& .MuiInput-underline:before":{borderBottom:"0"},"& .MuiInput-underline:after":{borderBottom:"3px solid #3f51b5",transition:"transform 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms"},"&:hover .MuiInput-underline:before":{borderBottom:"0"},"& .MuiInputAdornment-positionStart":{borderRight:"1px solid #BABABA",height:"36px",maxHeight:"36px",padding:"0 1rem"},"& .MuiSelect-selectMenu":{minHeight:"22px",lineHeight:"22px","@media (max-width: 1200px)":{minHeight:"18px",lineHeight:"18px"}}}})(_t),fo=xi({root:{"& .MuiInputLabel-formControl":{fontWeight:600,textTransform:"capitalize",fontSize:"1rem","@media (max-width: 1200px)":{fontSize:"0.75rem"},"@media (max-width: 1440px)":{fontSize:"0.875rem"}},"& .MuiInputLabel-shrink":{transform:"translate(0, 1.5px) scale(1)"},"& .MuiInputBase-root":{marginTop:0,border:"0px",borderLeft:"1px solid #BABABA",borderRadius:5,borderBottomLeftRadius:0,borderTopLeftRadius:0,backgroundColor:"#fff","& input":{padding:"6px 7px",height:"22px","&::placeholder":{fontSize:"0.875rem"},"@media (max-width: 1200px)":{height:"18px"}},"& inputMultiline":{padding:"6px 7px"},"& .MuiInputBase-input":{padding:"6px 7px"}},"& .MuiInput-underline:before":{borderBottom:"0"},"& .MuiInput-underline:after":{borderBottom:"3px solid var(--theme-color1)",transition:"transform 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms"},"&:hover .MuiInput-underline:before":{borderBottom:"0"},"& .MuiInputAdornment-positionStart":{borderRight:"1px solid #BABABA",height:"36px",maxHeight:"36px",padding:"0 1rem"},"& .MuiSelect-selectMenu":{minHeight:"22px",lineHeight:"22px","@media (max-width: 1200px)":{minHeight:"18px",lineHeight:"18px"}}}})(_t),mo=xi({root:{"& .MuiInputLabel-formControl":{fontWeight:600,textTransform:"capitalize",fontSize:"1rem","@media (max-width: 1200px)":{fontSize:"0.75rem"},"@media (max-width: 1440px)":{fontSize:"0.875rem"}},"& .MuiInputLabel-shrink":{transform:"translate(0, 1.5px) scale(1)"},"& label.Mui-focused":{},"& .MuiInputBase-root":{border:"1px solid #BABABA",marginTop:"26px",borderRadius:5,backgroundColor:"#fff","@media (max-width: 1200px)":{fontSize:"0.875rem"},flexWrap:"wrap","& input":{padding:"6px 7px ",width:0,minWidth:30,flexGrow:1,height:"22px","&::placeholder":{},"@media (max-width: 1200px)":{height:"18px"}},"& inputMultiline":{padding:"6px 7px"},"& .MuiInputBase-input":{padding:"6px 7px"}},"& .MuiInput-underline:before":{borderBottom:"0"},"& .MuiInput-underline:after":{borderBottom:"3px solid #3f51b5",transition:"transform 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms"},"&:hover .MuiInput-underline:before":{borderBottom:"0"},"& .MuiInputAdornment-positionStart":{borderRight:"1px solid #BABABA",height:"36px",maxHeight:"36px",padding:"0 1rem"},"& .MuiSelect-selectMenu":{minHeight:"22px",lineHeight:"22px","@media (max-width: 1200px)":{minHeight:"18px",lineHeight:"18px"}}}})(_t),go=xi({root:{color:"#0063A3",alignSelf:"center",padding:"0 9px","&$checked":{color:"var(--theme-color1)"},"&.Mui-disabled":{color:"#aaa"}},checked:{}})(ui),wo=new jt({defaultOptions:{queries:{cacheTime:36e5,refetchOnWindowFocus:!1,refetchOnMount:!1,refetchOnReconnect:!1,retry:!1}}}),bo=n({addEntry:()=>{},removeEntry:e=>{},getEntries:()=>{}}),vo=({children:t})=>{const i=o([]),r=l(e=>{i.current.findIndex(t=>t===JSON.stringify(e))<0&&i.current.push(JSON.stringify(e))},[]),n=l(e=>{let t=i.current.findIndex(t=>t===JSON.stringify(e));if(t>=0){const e=i.current.slice(0,t),r=i.current.slice(t+1);i.current=[...e,...r]}},[]),a=l(()=>i.current.map(e=>JSON.parse(e)),[]);return e(bo.Provider,{value:{addEntry:r,removeEntry:n,getEntries:a},children:t})},yo=e=>Array.isArray(e)&&e.length>0?e.sort().join("-"):"NO_CACHING_KEY_AVAILABLE",Bo=(e,t,i,r,n,s,o,l,c,d,u,A,p,f,m=void 0)=>{let g=!1,w=[];const{authState:b}=es(),{addEntry:v}=a(bo),{t:y}=W(),B=yo(Object.values("object"==typeof e&&null!==e?e:{none:!0}).filter(e=>"function"!=typeof e)),C=(()=>{if("function"==typeof c)w=c(n,e,ds(n),b);else if(d){const e=((e={})=>Object.keys(e).sort().reduce((t,i)=>(t[i]=e[i].value,t),{}))(n);w=[c,B,e]}else w=[c,B];return w})();h(()=>{d||v(C)},[v,d,C]);const x=zt(C,()=>t(n,e,ds(n),b),{retry:!1,enabled:"function"==typeof t,cacheTime:d?0:36e5,staleTime:6e5});return g=x.isLoading,h(()=>{if(void 0===t)i([{label:"No Data",value:null,disabled:!0,isDefaultOption:!0}]),g=!1;else if(Array.isArray(t))Boolean(A)||(t=[{label:Boolean(p)?y(p):y("SelectOption"),value:" ",disabled:!Boolean(f),isDefaultOption:!0},...t]),t=T.uniqBy(t,"value"),i(t),g=!1;else if("object"==typeof t){const{options:e,...r}=t;Array.isArray(e)?(i(t),Object.keys(r).length>0&&u(r)):i([{label:"Invalid Data",value:null,disabled:!0,isDefaultOption:!0}]),g=!1}else if(x.isLoading)i([{label:"loading...",value:null,disabled:!0,isDefaultOption:!0}]),g=!0;else if(x.isError)i([{label:"Couldn't fetch",value:null,disabled:!0,isDefaultOption:!0}]),console.log(`error occured while fetching data for ${C}`,x.error),g=!1;else if(Array.isArray(x.data)){let e=x.data;Boolean(A)||(e=[{label:Boolean(p)?y(p):y("SelectOption"),value:" ",disabled:!Boolean(f),isDefaultOption:!0},...e]),i(e),g=!1}else if("object"==typeof x.data){const{options:e,...t}=x.data;Array.isArray(e)?(i(e),Object.keys(t).length>0&&u(t)):i([{label:"Invalid Data",value:null,disabled:!0,isDefaultOption:!0}]),g=!1}else i([{label:"Couldn't fetch",value:null,disabled:!0,isDefaultOption:!0}]),console.log(`expected optionsFunction:${C} in select component to return array of OptionsType but got: ${x.data}`),g=!1},[y,g,x.dataUpdatedAt]),h(()=>{if(null!==s&&"object"==typeof s&&Object.keys(s).length){const{value:e,ignoreUpdate:t,GridProps:i}=s;"object"==typeof i&&"function"==typeof m&&m(i),(Boolean(e)||""===e)&&(r(e,void 0,!1,{isIncomingValue:!0},t),t||"onBlur"!==l||o({value:e,isIncomingValue:!0},!0)),u(null)}},[s,i,r,o,l]),{loadingOptions:g,queryError:x.isError,refetchOptions:x.refetch}},Co=(e,t,i,r,n,a,s,o)=>{let l=!1;const{authState:c}=es(),{t:d}=W();let u=[];u=Boolean(r)?[i,n]:[i];const A=zt(u,()=>e(n,c),{retry:!1,enabled:"function"==typeof e,cacheTime:r?0:36e5});return l=A.isLoading,h(()=>{if(void 0===e)t([{label:"No Data",value:null,disabled:!0}]),l=!1;else if(Array.isArray(e))Boolean(a)||(e=[{label:Boolean(s)?d(s):d("SelectOption"),value:"00",disabled:!Boolean(o),isDefaultOption:!0},...e]),e=T.uniqBy(e,"value"),t(e),l=!1;else if(A.isLoading)t([{label:"loading...",value:null,disabled:!0}]),l=!0;else if(A.isError)t([{label:"Couldn't fetch",value:null,disabled:!0}]),console.log(`error occured while fetching data for ${i}`,A.error),l=!1;else{if(Array.isArray(A.data)){let e=A.data;Boolean(a)||(e=[{label:Boolean(s)?d(s):d("SelectOption"),value:"00",disabled:!Boolean(o),isDefaultOption:!0},...e]),t(e)}else t([{label:"Couldn't fetch",value:null,disabled:!0}]),console.log(`expected optionsFunction:${i} in select component to return array of OptionsType but got: ${A.data}`);l=!1}},[l]),{loadingOptions:l}},xo=(e,t,i,r,n,s,o)=>{let l=!1;const{addEntry:c}=a(bo);let d=[];const{t:u}=W();d=Boolean(r)?[i,n]:[i],h(()=>{c(i)},[c]);const A=zt(d,()=>e(n),{retry:!1,enabled:"function"==typeof e,cacheTime:36e5});return l=A.isLoading,h(()=>{if(void 0===e)t([{label:"No Data",value:null,disabled:!0}]),l=!1;else if(Array.isArray(e))Boolean(s)||(e=[{label:Boolean(o)?u(o):u("SelectOption"),value:"00",disabled:!0},...e]),e=T.uniqBy(e,"value"),t(e),l=!1;else if(A.isLoading)t([{label:"loading...",value:null,disabled:!0}]),l=!0;else if(A.isError)t([{label:"Couldn't fetch",value:null,disabled:!0}]),console.log(`error occured while fetching data for ${i}`,A.error),l=!1;else{if(Array.isArray(A.data)){let e=A.data;Boolean(s)||(e=[{label:Boolean(o)?u(o):u("SelectOption"),value:"00",disabled:!0},...e]),t(e)}else t([{label:"Couldn't fetch",value:null,disabled:!0}]),console.log(`expected optionsFunction:${i} in select component to return array of OptionsType but got: ${A.data}`);l=!1}},[l]),{loadingOptions:l}},Fo=(e,t=!1)=>i=>{let r=[];return Array.isArray(i)||(i=[i]),Array.isArray(e)&&(r=e.reduce((e,t)=>(i.indexOf(t.value)>=0&&e.push(t.label),e),[])),t?r.join(","):r},So=e=>t=>{let i=[];return Array.isArray(t)||(t=[t]),Array.isArray(e)&&(i=e.reduce((e,i)=>(t.indexOf(i.value)>=0&&e.push(i),e),[])),i},No=["","one ","two ","three ","four ","five ","six ","seven ","eight ","nine ","ten ","eleven ","twelve ","thirteen ","fourteen ","fifteen ","sixteen ","seventeen ","eighteen ","nineteen "],Eo=["","","twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety"],ko=/^(\d{1})(\d{2})(\d{2})(\d{2})(\d{1})(\d{2})$/,To=e=>No[Number(e)],Lo=e=>Eo[e[0]]+" "+No[e[1]];function Io(e){const t=Number(e);if(isNaN(t))return"";if(0===t)return"zero";const i=t.toString();if(i.length>10)throw new Error("overflow");const[,r,n,a,s,o,l]=("0000000000"+i).substr(-10).match(ko);let h="";return h+=0!=r?To(r)+"hundred ":"",h+=0!=n&&""!=h?"and ":"",h+=0!=n?(To(n)||Lo(n))+"crore ":0!=r?"crore ":"",h+=0!=a?(To(a)||Lo(a))+"lakh ":"",h+=0!=s?(To(s)||Lo(s))+"thousand ":"",h+=0!=o?To(o)+"hundred ":"",h+=0!=l&&""!=h?"and ":"",h+=0!=l?To(l)||Lo(l):"",h.trim()}const Do=({options:t,MenuItemProps:i,SelectProps:r,multiple:n,showCheckbox:a,InputProps:s,inputProps:o,CircularProgressProps:h,handleBlur:c,handleChange:A,error:p,touched:f,value:m,loading:g,readOnly:w,_optionsKey:b,disableCaching:v,optionsProps:y,selectVariant:C="default",skipDefaultOption:x,defaultOptionLabel:F,defaultSpaceAdd:S=!1,InputLabelProps:N={},enableDefaultOption:E=!1,...k})=>{let T;T="andornment"===C?fo:"regular"===C?Ao:po;const[L,I]=d([]),D=Boolean(f)&&Boolean(p),{loadingOptions:U}=Co(t,I,b,v,y,x,F,E),P=l(e=>Fo(L)(e),[L]),R=l(e=>{let t=P("object"==typeof e?e?.target?.value??"":e);t=n?t:t[0],A(e,t)},[A,P,n]),O=l(e=>{let t=P("object"==typeof e?e?.target?.value??"":e);t=n?t:t[0],c(e,t)},[c,P,n]),Q=L.map((t,r)=>u(K,{...i,key:t.value??r,value:t.value,disabled:t.disabled},a?e(go,{checked:Boolean(n)?Array.isArray(m)&&m.indexOf(t.value)>=0:m===t.value}):null,t.label));return e(T,{...k,select:!0,value:n&&!Array.isArray(m)?[m]:m,error:D,helperText:D?p:S?" ":null,onChange:R,onBlur:O,SelectProps:{...r,native:!1,multiple:n,renderValue:n?Fo(L,!0):void 0},InputLabelProps:{shrink:!0,...N},InputProps:{endAdornment:g||U?e(B,{position:"end",children:e(G,{color:"secondary",size:22,sx:{marginRight:"1px"},variant:"indeterminate",...h})}):null,...s},inputProps:{readOnly:w,tabIndex:w?-1:void 0,...o},children:Q})},Uo=[{label:"startswith",value:"startsWith"},{label:"endswith",value:"endsWith"},{label:"equal",value:"equal"},{label:"contains",value:"contains"}],Po=({filterValue:i,id:r,columnName:n,gridProps:a,dispatch:s,maxLength:o,showMaxLength:l})=>{const[h,c]=d(i?.value??""),[u,A]=d(i?.condition??"equal"),{t:p}=W(),f=()=>{Boolean(h)?s({type:"setValue",payload:{condition:u,value:h,id:r,columnName:n}}):s({type:"removeValue",payload:{id:r}})};return e(q,{item:!0,xs:12,sm:6,md:6,...a,children:e(Ao,{label:n,InputLabelProps:{shrink:!0},onChange:e=>{(o!=o||e.target.value.length<=(o??20))&&c(e.target.value)},helperText:e("div",{style:{display:"flex"},children:o>0&&Boolean(l)?t(Ze,{error:!1,style:{flex:1,textAlign:"right",margin:"5px 15px 0 0"},children:[h.length,"/",o]}):null}),onBlur:f,fullWidth:!0,value:h,InputProps:{endAdornment:e(Do,{size:"small",style:{width:"50%"},touched:!0,error:"",multiple:!1,handleChange:e=>{A(e.target.value)},handleBlur:f,options:Uo.map(e=>({label:p(e.label),value:e.value})),disableCaching:!1,value:u,selectVariant:"andornment"})}})})},Ro=({options:t,MenuItemProps:i,SelectProps:r,multiple:n,showCheckbox:a,InputProps:s,inputProps:o,CircularProgressProps:h,handleBlur:c,handleChange:d,error:A,touched:p,value:f,loading:m,readOnly:g,optionsProps:w,selectVariant:b="default",loadingOptions:v,...y})=>{let C;C="andornment"===b?fo:"regular"===b?Ao:po;const x=Boolean(p)&&Boolean(A),F=l(e=>Fo(t)(e),[t]),S=l(e=>{let t=F("object"==typeof e?e?.target?.value??"":e);t=n?t:t[0],d(e,t)},[d,F,n]),N=t.map((t,r)=>u(K,{...i,key:t.value??r,value:t.value,disabled:t.disabled},a?e(go,{checked:Boolean(n)?Array.isArray(f)&&f.indexOf(t.value)>=0:f===t.value}):null,Ge(t.label)));return e(C,{...y,select:!0,value:n&&!Array.isArray(f)?[f]:f,error:x,helperText:x?A:null,onChange:S,onBlur:c,SelectProps:{...r,native:!1,multiple:n,renderValue:n?Fo(t,!0):void 0},InputLabelProps:{shrink:!0},InputProps:{endAdornment:m||v?e(B,{position:"end",children:e(G,{color:"secondary",size:22,variant:"indeterminate",...h})}):null,...s},inputProps:{readOnly:g,tabIndex:g?-1:void 0,...o},children:N})},Oo=({filterValue:t,id:i,columnName:r,filterProps:n,gridProps:a,dispatch:s})=>{const[l,h]=d(t?.value??[]),c=o(null),[u,A]=d([]),{loadingOptions:p}=xo(n?.options??[],A,n?._optionsKey??"",!1,{},!1,void 0);return e(q,{item:!0,xs:12,sm:6,md:6,...a,children:e(Ro,{label:r,showCheckbox:!0,value:l,size:"small",fullWidth:!0,touched:!0,error:"",multiple:!0,handleChange:(e,t)=>{h(e.target.value),c.current=t},handleBlur:e=>{Array.isArray(l)&&l.length>0?s({type:"setValue",payload:{condition:"in",value:l,label:c.current,id:i,columnName:r}}):s({type:"removeValue",payload:{id:i}})},options:u,loadingOptions:p,selectVariant:"regular"})})},Qo={root:{"& label.Mui-focused":{color:"var(--theme-color1)"},"& .MuiInputLabel-formControl":{fontWeight:600,textTransform:"capitalize",fontSize:"1rem","@media (max-width: 1200px)":{fontSize:"0.75rem"},"@media (max-width: 1440px)":{fontSize:"0.875rem"}},"& .MuiInputLabel-shrink":{transform:"translate(0, 1.5px) scale(1)"},"& .MuiInputBase-root":{border:"1px solid #BABABA",marginTop:"26px",borderRadius:5,backgroundColor:"#fff","@media (max-width: 1200px)":{fontSize:"0.875rem"},"& input":{padding:"6px 7px ",height:"22px","&::placeholder":{},"@media (max-width: 1200px)":{height:"18px"}},"& inputMultiline":{padding:"6px 7px"},"& .MuiInputBase-input":{padding:"6px 7px"}},"& .MuiInput-underline:before":{borderBottom:"0"},"& .MuiInput-underline:after":{borderBottom:"3px solid var(--theme-color1)",transition:"transform 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms"},"&:hover .MuiInput-underline:before":{borderBottom:"0"},"& .MuiInputAdornment-positionStart":{borderRight:"1px solid #BABABA",height:"36px",maxHeight:"36px",padding:"0 1rem"},"& .MuiSelect":{"& selectMenu":{minHeight:"22px",lineHeight:"22px","@media (max-width: 1200px)":{minHeight:"18px",lineHeight:"18px"}}}}},Ho=xi(Qo)(Mr),Mo=xi(Qo)(_r),_o=xi(Qo)(jr),jo=[{label:"All",value:"all"},{label:"Today",value:"today"},{label:"Last Week",value:"lastWeek"},{label:"Last Month",value:"lastMonth"},{label:"Custom",value:"custom"}],zo=({filterValue:r,id:n,columnName:a,gridProps:s,dispatch:o,filterProps:l})=>{const[h,c]=d(Array.isArray(r?.value)?new Date(r?.value[0])??null:new Date(r?.value)??null),[u,A]=d(Array.isArray(r?.value)?new Date(r?.value[1])??null:null),[p,f]=d(r?.option??"all");return e(q,{item:!0,xs:12,...s,sm:"custom"===p?12:6,md:"custom"===p?12:6,children:t("div",{style:{width:"100%",display:"flex"},tabIndex:1,onBlur:e=>{let t=k(new Date,"iii LLL dd yyyy HH:mm:ss xxxx"),i=k(new Date,"iii LLL dd yyyy HH:mm:ss xxxx");h instanceof Date&&!isNaN(h)&&(t=k(h,"iii LLL dd yyyy HH:mm:ss xxxx")),u instanceof Date&&!isNaN(u)&&(i=k(u,"iii LLL dd yyyy HH:mm:ss xxxx")),"today"===p?o({type:"setValue",payload:{condition:"equal",value:t,id:n,option:p,columnName:a,type:l?.type}}):("lastWeek"===p||"lastMonth"===p||"custom"===p)&&h instanceof Date&&u instanceof Date&&!isNaN(h)&&!isNaN(u)&&h<=u?o({type:"setValue",payload:{condition:"between",value:[t,i],id:n,option:p,columnName:a,type:l?.type}}):o({type:"removeValue",payload:{id:n}})},children:[e(Do,{label:a,value:p,size:"small",touched:!0,error:"",handleChange:(e,t)=>{let i=new Date;"today"===e.target.value?c(i):"lastWeek"===e.target.value?(A(i),c(Ui(i,7))):"lastMonth"===e.target.value?(A(i),c(Ui(i,30))):"all"!==e.target.value&&"custom"!==e.target.value||(c(null),A(null)),f(e.target.value)},handleBlur:()=>!0,options:jo,_optionsKey:"dateRangePicker",optionsProps:{},disableCaching:!1,selectVariant:"regular",..."custom"===p?{style:{width:"40%"}}:{fullWidth:!0}}),"custom"===p?t(i,{children:[e("span",{style:{width:"1%",textAlign:"center",marginTop:"32px"}}),e(Ho,{format:"dd/MM/yyyy",label:"From Date",onChange:c,value:h,sx:{width:"30%"},slots:{textField:Ao},slotProps:{textField:{InputLabelProps:{shrink:!0},"aria-label":"Select Date",placeholder:"Start Date"},actionBar:{actions:["today","cancel"]}}}),e("span",{style:{width:"1%",textAlign:"center",marginTop:"32px"}}),e(Ho,{format:"dd/MM/yyyy",label:"To Date",minDate:h,onChange:A,value:u,sx:{width:"30%"},slots:{textField:Ao},slotProps:{textField:{InputLabelProps:{shrink:!0},"aria-label":"Select Date",placeholder:"End Date"},actionBar:{actions:["today","cancel"]}}})]}):null]})})},Vo=xi({root:{fontWeight:600,textTransform:"capitalize",fontSize:"1rem","@media (max-width: 1200px)":{fontSize:"0.75rem"},"@media (max-width: 1440px)":{fontSize:"0.875rem"}},shrink:{transform:"translate(0, 1.5px) scale(1)"}})(Ut),Ko=xi({root:{border:"1px solid #BABABA",marginTop:"26px",borderRadius:5,backgroundColor:"#fff","@media (max-width: 1200px)":{fontSize:"0.875rem"}},multiline:{padding:"6px 7px"},input:{padding:"6px 7px ",height:"22px","&::placeholder":{},"@media (max-width: 1200px)":{height:"18px"}},underline:{"&:before":{borderBottom:"0 !important"},"&:after":{borderBottom:"3px solid var(--theme-color1)",transition:"transform 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms"}},adornedStart:{borderRight:"1px solid #BABABA",height:"36px",maxHeight:"36px",padding:"0 1rem"}})(mi),qo=({filterValue:i,id:r,columnName:n,gridProps:a,dispatch:s})=>{const[o,l]=d(Array.isArray(i?.value)?i?.value[0]??0:0),[c,u]=d(Array.isArray(i?.value)?i?.value[1]??0:0),[A,p]=d("");h(()=>{Number(o)>Number(c)?p("Min value is greater than max"):p("")},[o,c]);return e(q,{item:!0,xs:12,sm:6,md:6,...a,children:t($e,{fullWidth:!0,error:Boolean(A),tabIndex:1,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(!isNaN(Number(o))&&!isNaN(Number(c))&&o<=c?s({type:"setValue",payload:{condition:"between",value:[o,c],id:r,columnName:n}}):s({type:"removeValue",payload:{id:r}}))},sx:{"& label.Mui-focused":{color:"var(--theme-color1)"}},children:[e(Vo,{shrink:!0,children:n}),t("div",{style:{display:"flex",width:"100%",justifyContent:"space-between"},children:[e(Ko,{style:{width:"45%"},placeholder:"min",value:o,onChange:e=>{isNaN(Number(e.target.value))||l(e.target.value)}}),e(Ko,{style:{width:"45%"},placeholder:"max",value:c,onChange:e=>{isNaN(Number(e.target.value))||u(e.target.value)}})]}),Boolean(A)?e(Ze,{children:A}):null]})})},Go=({filterValue:i,id:r,columnName:n,gridProps:a,dispatch:s,filterProps:o})=>{const{t:l}=W(),[c,u]=d(Array.isArray(i?.value)?i?.value[0]:null),[A,p]=d(Array.isArray(i?.value)?i?.value[1]:null),[f,m]=d("");h(()=>{Number(c)>Number(A)&&A?.length>0?m("Min value is greater than max"):m("")},[c,A]);return e(q,{item:!0,xs:12,sm:6,md:6,...a,children:t($e,{fullWidth:!0,error:Boolean(f),tabIndex:1,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(!isNaN(Number(c))&&!isNaN(Number(A))&&c?.length&&A?.length&&Number(c)<=Number(A)?s({type:"setValue",payload:{condition:"between",value:[c,A],id:r,columnName:n,type:o.type}}):s({type:"removeValue",payload:{id:r}}))},sx:{"& label.Mui-focused":{color:"var(--theme-color1)"}},children:[e(Vo,{shrink:!0,sx:{fontSize:"0.875rem !important"},children:l(n)}),t("div",{style:{display:"flex",width:"100%",justifyContent:"space-between"},children:[e(Ht,{thousandSeparator:!0,thousandsGroupStyle:"lakh",allowNegative:!1,allowLeadingZeros:!1,decimalScale:2,fixedDecimalScale:!0,value:c,customInput:Ao,placeholder:"Min",onValueChange:e=>{isNaN(Number(e.value))||u(String(e.value))},style:{width:"48%"}}),e(Ht,{thousandSeparator:!0,thousandsGroupStyle:"lakh",allowNegative:!1,allowLeadingZeros:!1,decimalScale:2,fixedDecimalScale:!0,value:A,customInput:Ao,placeholder:"Max",onValueChange:e=>{isNaN(Number(e.value))||p(String(e.value))},style:{width:"48%"}})]}),Boolean(f)?e(Ze,{children:f}):null]})})},Wo=xi({tooltip:{backgroundColor:"var(--theme-color1)",color:"#fff",boxShadow:"0 3px 6px rgba(0,0,0,0.46)",fontSize:11,borderBottom:"1px solid var(--theme-color1)"},arrow:{fontSize:16,width:17,"&::before":{border:"1px solid #fff",backgroundColor:"var(--theme-color1)",boxSizing:"border-box"}}})(Ii),Jo=vi(({className:t,...i})=>e(Ii,{...i,arrow:!0,classes:{popper:t}}))(()=>({[`& .${Di.tooltip}`]:{backgroundColor:"#ffffff",color:"#1a1a1a",maxWidth:280,fontSize:"0.95rem",fontFamily:'"Segoe UI", Roboto, sans-serif',border:"1px solid #e0e0e0",borderRadius:"10px",boxShadow:"0 6px 16px rgba(0, 0, 0, 0.15)",padding:"12px 16px",marginTop:"0.75rem",transition:"opacity 0.3s ease, transform 0.3s ease",transform:"scale(1)"},[`& .${Di.arrow}`]:{color:"#ffffff","&::before":{boxShadow:"-1px -1px 2px rgba(0,0,0,0.05)"}}})),Xo=({label:i="",value:r=""})=>t("div",{children:[t("strong",{className:"old_value_tooltip_label",style:{fontWeight:600,display:"flex",alignItems:"center"},children:["🕓  ",i]}),e("h4",{className:"old_value_tooltip_value",style:{marginTop:4,fontStyle:"italic",color:"var(--theme-color1)"},children:Array.isArray(r)&&"string"==typeof r[0]?r.join(","):r})]}),Yo={ALL:"Lek",AFN:"؋",ARS:"$",AWG:"ƒ",AUD:"$",AZN:"₼",BSD:"$",BBD:"$",BYN:"Br",BZD:"BZ$",BMD:"$",BOB:"$b",BAM:"KM",BWP:"P",BGN:"лв",BRL:"R$",BND:"$",KHR:"៛",BDT:"৳",CAD:"$",KYD:"$",CLP:"$",CNY:"¥",COP:"$",CRC:"₡",HRK:"kn",CUP:"₱",CZK:"Kč",DKK:"kr",DOP:"RD$",XCD:"$",EGP:"£",SVC:"$",EUR:"€",FKP:"£",GIP:"£",GTQ:"Q",GGP:"£",GYD:"$",HNL:"L",HKD:"$",HUF:"Ft",INR:"₹",IDR:"Rp",IRR:"﷼",IMP:"£",ILS:"₪",JMD:"J$",JPY:"¥",JEP:"£",KZT:"лв",KPW:"₩",KRW:"₩",KGS:"лв",LAK:"₭",LBP:"£",LRD:"$",MKD:"ден",MYR:"RM",MUR:"₨",MXN:"$",MNT:"₮",MZN:"MT",NAD:"$",ANG:"ƒ",NZD:"$",NIO:"C$",NGN:"₦",NOK:"kr",OMR:"﷼",PKR:"₨",PAB:"B/.",PYG:"Gs",PEN:"S/.",PHP:"₱",PLN:"zł",ZAR:"R",AED:"د.إ",CHF:"Fr.",GBP:"£",RUB:"₽",SEK:"kr",TRY:"₺",USD:"$",VND:"₫",ZWL:"Z$",BTN:"Nu.",BYR:"Br",CVE:"€",DJF:"Fdj",DZD:"دج",ERN:"Nfk",FJD:"$",GEL:"₾",GHS:"¢",ISK:"kr",KWD:"د.ك",LKR:"₨",LYD:"ل.د",MDL:"L",MVR:"ރ",MWK:"MK",NPR:"₨",RSD:"din.",SAR:"ر.س",SCR:"₨",SYP:"£",TND:"د.ت",TTD:"TT$",TWD:"NT$",UGX:"Ush",YER:"﷼",ZMW:"K",XOF:"CFA",XAF:"FCFA",TZS:"TSh",SZL:"L",STN:"Db",SSP:"£",SOS:"Sh.So.",SLL:"Le",ETB:"ብር",MMK:"Ks.",BLANK:""};function $o(e,t=!0){return Yo[e]??(t?e:void 0)}var Zo=A(({name:i,validate:r,validationRun:n,postValidationSetCrossFieldValues:a,runValidationOnDependentFieldsChange:c,runPostValidationHookAlways:A,shouldExclude:p,isReadOnly:f,dependentFields:m,fieldKey:g,GridProps:w,CircularProgressProps:b,enableGrid:v,enableNumWords:y,InputProps:C,inputProps:x,StartAdornment:F,EndAdornment:S,isFieldFocused:N,maxLength:E=-1,setValueOnDependentFieldsChange:k,setValueOnDependentFieldsValueChange:T,skipValueUpdateFromCrossFieldWhenReadOnly:L,setColor:I,showMaxLength:D=!0,startsIcon:U,endsIcon:P,iconStyle:R,textFieldStyle:O,txtTransform:Q,AlwaysRunPostValidationSetCrossFieldValues:H,ignoreInSubmit:M=!1,label:_,setFieldLabel:j,preventSpecialChars:z,placeholder:V,handleKeyDown:K,runExternalFunction:W,onFormDataChange:X,runPostValidationForInitValue:Y,className:$,componentType:Z,isCurrencyField:ee,dependentFieldDebounceDelay:te=300,allowEmojiIcons:ie=!1,...re})=>{const[ne,ae]=d(w),[se,oe]=d(void 0),{authState:le}=es(),he=ns(),{value:ce,prevValue:de,error:ue,touched:Ae,handleChange:pe,handleBlur:fe,isSubmitting:me,validationRunning:ge,fieldKey:we,name:be,excluded:ve,readOnly:ye,incomingMessage:Be,whenToRunValidation:Ce,runValidation:xe,validationAPIResult:Fe,dependentValues:Se,setErrorAsCB:Ne,setIgnoreInSubmit:Ee,formState:ke,initialValues:Te,setIncomingMessage:Le}=as({name:i,fieldKey:g,dependentFields:m,validate:r,validationRun:n,runPostValidationHookAlways:A,postValidationSetCrossFieldValues:a,isReadOnly:f,shouldExclude:p,runValidationOnDependentFieldsChange:c,skipValueUpdateFromCrossFieldWhenReadOnly:L,txtTransform:Q,AlwaysRunPostValidationSetCrossFieldValues:H,runExternalFunction:W,onFormDataChange:X,runPostValidationForInitValue:Y,componentType:Z,dependentFieldDebounceDelay:te,isCurrencyField:ee}),[Ie,De]=d("string"==typeof I?I:""),Ue=o(),Pe=o();h(()=>{if("function"==typeof I){const e=I(ce,ds(Se),ke);De("string"!=typeof e?"":e)}},[ce,Se,I]),h(()=>{(async()=>{if(F)if("function"==typeof F){const e=await F(ds(Se),ke,Te,he);oe(ee?$o(e||he.dynamicAmountSymbol):e)}else oe(e=>e??F)})()},[F,Se,ke,Te]);const Re=l(e=>{const t=e.target,i=t.selectionStart;if(/(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff]|[°¯╯ツಠ益ಥಥರೃσ♥ ̄︶ ̄-ノ人ψωー゚~﹃~\︿])/g.test(e.target.value)&&!ie)return;const r="function"==typeof z?z():z;r&&e.target.value&&r.split("").some(t=>e.target.value.includes(t))||(pe(e,e.target?.formattedValue??void 0),requestAnimationFrame(()=>{t.selectionStart=t.selectionEnd=i}))},[pe]),Oe=l(e=>{pe(e)},[pe]);h(()=>{N&&Qe()},[N,ce]);const Qe=()=>{setTimeout(()=>{Ue?.current?.focus?.(),Boolean(Ue?.current)||Pe?.current?.children?.[1]?.lastChild?.select?.()},50)},He=s(()=>{const e=ds(Se),t=us(e);return JSON.stringify(t.sort((e,t)=>e.fieldKey.localeCompare(t.fieldKey)).map(e=>e.value))},[Se]);h(()=>{if(!He)return;(async()=>{if("function"==typeof T)try{const e=await T(ds(Se),ke,{value:ce,isSubmitting:me});null!=e&&pe(e)}catch(e){console.error("An error occurred:",e)}})()},[He,T,pe]),h(()=>{(async()=>{if("function"==typeof k)try{let e=await k(ds(Se),ke,{value:ce,isSubmitting:me});null!=e&&pe(e)}catch(e){console.error("An error occurred:",e)}})()},[Se,pe,k]),h(()=>{if(null!==Be&&"object"==typeof Be&&Object.keys(Be).length){const{value:e,error:t,ignoreUpdate:i,isFieldFocused:r,isErrorBlank:n,GridProps:a,startAdornment:s}=Be;if("object"==typeof a){const e={...w,xs:a?.xs??w?.xs??"auto",md:a?.md??w?.md??"auto",xl:a?.xl??a?.md??w?.xl??"auto",sm:a?.sm??w?.sm??"auto",lg:a?.lg??a?.md??w?.lg??"auto"};ae(e)}if(s&&"string"==typeof s&&oe($o(s)),r&&Qe(),Boolean(e)||""===e){const t=ee&&e?String(e).includes(".")?e:Number(e).toFixed(he.decimalCount):e;pe(t,void 0,!0,{isIncomingValue:!0}),i||"onBlur"!==Ce||xe({value:t,isIncomingValue:!0},!0)}n?Ne(""):Boolean(t)&&Ne(t),Le(null)}},[Be,pe,xe,Ce,Ne]),h(()=>{if(Boolean(M))if("function"==typeof M){let e=M(ds(Se),ke,{isSubmitting:me,value:ce});Ee(e)}else Ee(M)},[M,Ee,Se,ce]);const Me=s(()=>{if("function"==typeof j)return j(ds(Se),ce)},[j,Se,ce]);if(ve)return null;let _e=ue,je=null,ze=Ae;try{if(y&&Boolean(ce)){let e=String(ce).split("."),t=Number(e[0]);t<0?(t=Math.abs(Number(t)),je=`Negative ${Io(t)} Rupees`):je=`${Io(t)} Rupees`,2===e.length&&Boolean(e[1])&&(je=`${je} and ${Io(e[1])} paise`)}}catch(e){_e="",ze=!0}C?.inputProps&&(C.inputProps={...C.inputProps,readOnly:ye,tabIndex:ye?-1:void 0});const Ve=ze&&Boolean(_e),Ke=u(Ao,{...re,key:we,id:we,className:J($,{hasOldValue:void 0!==de&&void 0!==ce&&de!==ce}),label:Me?.label?Ge(Me.label):_,placeholder:ye?"":Me?.placeholder?Ge(Me.placeholder)??"":V,autoComplete:"off",name:be,value:"string"==typeof ce?ce.trimStart():ce,error:!me&&Ve,helperText:t("div",{style:{display:"flex"},children:[e(Ze,{children:!me&&Ve?Ge(_e):Boolean(Fe)?Fe:je}),E>0&&Boolean(D)?t(Ze,{error:!1,disabled:me,style:{flex:1,textAlign:"right"},children:[ce.length,"/",E]}):null]}),FormHelperTextProps:{component:"div"},sx:{"& .MuiInputBase-root":{background:Boolean(ye||me)?"#f3f3f3 !important":""},...O},InputProps:{style:{...!me&&Boolean(Ie)?{color:Ie}:{}},endAdornment:ge?e(B,{position:"end",children:e(G,{color:"secondary",variant:"indeterminate",size:20,style:{marginRight:"8px"},...b})}):Boolean(S)?e(B,{position:"end",className:"withBorder",children:S}):null,startAdornment:"password-loader"===se&&ge?e(B,{position:"end",sx:{position:"absolute",right:"38px"},children:e(G,{color:"secondary",variant:"indeterminate",size:20,...b})}):Boolean(se)&&"password-loader"!==se?e(B,{position:"start",children:se}):null,...C},InputLabelProps:{shrink:!0},inputRef:Ue,onChange:e=>{ye||me||(-1===E||e.target.value.length<=E)&&Re(e)},inputProps:{readOnly:ye,tabIndex:ye?-1:void 0,...x},onBlur:fe,onKeyDown:e=>{const t=e.key.includes("F")&&e.key.length>1,i=e.ctrlKey||e.shiftKey;(t||i)&&"function"==typeof K&&K(e,ds(Se),le,ke,e=>Oe(e))},disabled:me||ye,ref:Pe}),qe=void 0!==de&&void 0!==ce&&de!==ce?e(Jo,{title:e(Xo,{label:`${Ge("OldValueOf")} ${Me?.label?Ge(Me.label):_}`,value:de||"(blank)"}),arrow:!0,followCursor:!0,children:Ke}):Ke;return Boolean(v)?e(q,{...ne,children:qe}):qe}),el=Object.freeze({__proto__:null,TextField:Zo,default:Zo});function tl(e,t){return t>=.1*e+1&&t<e}const il=c((t,i)=>{const{inputRef:r,onChange:n,FormatProps:a,...s}=t,{formattedValue:l,maxLength:c,maxPercent:u,...A}=a,p=o(null),[f,m]=d(!1);return h(()=>{p.current=r?.current},[r]),e(Ht,{...s,getInputRef:e=>{r&&(r.current=e),e&&(p.current=e)},onValueChange:e=>{const{formattedValue:i,value:r,floatValue:a}=e,s=p.current,o=()=>{if(s){const e=s.value.indexOf(".");s.selectionStart=s.selectionEnd=e>=0?e+1:s.value.length}};c&&(f||r.length!==c||(m(!0),setTimeout(o,0)),r.length<c&&m(!1)),u&&(!f&&tl(u,Number(a))&&(m(!0),setTimeout(o,0)),tl(u,Number(a))||m(!1)),n({target:{name:t.name,value:r,formattedValue:i}},i)},valueIsNumericString:!1,isAllowed:a?.isAllowed??(e=>{if(!c&&!u)return!0;if(c){return e.value.length<=c}return u?!(e.floatValue>u):void 0}),...A})}),rl=({FormatProps:t,formattedValue:i,isFieldFocused:r,maxLength:n,showMaxLength:a,maxPercent:s,...l})=>{const c=o(null);return h(()=>{r&&setTimeout(()=>{c?.current?.select?.()},1)},[r]),e(Zo,{...l,maxLength:n,showMaxLength:a,inputRef:c,InputProps:{inputComponent:il,inputProps:{FormatProps:{...t,formattedValue:i,maxLength:n,maxPercent:s},inputRef:c}}})},nl=({filterValue:i,id:r,columnName:n,gridProps:a,dispatch:s,filterProps:o})=>{const{t:l}=W(),{dynamicAmountSymbol:c}=ns(),[u,A]=d(Array.isArray(i?.value)?i?.value[0]:null),[p,f]=d(Array.isArray(i?.value)?i?.value[1]:null),[m,g]=d("");h(()=>{Number(u)>Number(p)&&p?.length>0?g("From Amount should be less To Amount"):g("")},[u,p]);return e(q,{item:!0,xs:12,sm:6,md:6,...a,children:t($e,{fullWidth:!0,error:Boolean(m),tabIndex:1,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(!isNaN(Number(u))&&!isNaN(Number(p))&&u?.length&&p?.length&&Number(u)<=Number(p)?s({type:"setValue",payload:{condition:"between",value:[u,p],id:r,columnName:n,type:o.type}}):s({type:"removeValue",payload:{id:r}}))},sx:{"& label.Mui-focused":{color:"var(--theme-color1)"}},children:[e(Vo,{shrink:!0,sx:{fontSize:"0.875rem !important"},children:l(n)}),t("div",{style:{display:"flex",width:"100%",justifyContent:"space-between"},children:[e(rl,{FormatProps:{thousandSeparator:!0,prefix:"",thousandsGroupStyle:"lakh",allowNegative:!1,allowLeadingZeros:!1,decimalScale:2,fixedDecimalScale:!0,placeholder:"From Amount",isAllowed:e=>!(e?.value?.length>15),value:u,onValueChange:e=>{isNaN(Number(e.value))||A(String(e.value))}},enableGrid:!1,fieldKey:"FromAmount",name:"from-amount",StartAdornment:$o(c),className:"textInputFromRight",maxLength:15,showMaxLength:!1,style:{width:"48%"}}),e(rl,{FormatProps:{thousandSeparator:!0,prefix:"",thousandsGroupStyle:"lakh",allowNegative:!1,allowLeadingZeros:!1,decimalScale:2,fixedDecimalScale:!0,placeholder:"To Amount",isAllowed:e=>!(e?.value?.length>15),value:p,onValueChange:e=>{isNaN(Number(e.value))||f(String(e.value))}},enableGrid:!1,fieldKey:"ToAmount",name:"to-amount",StartAdornment:$o(c),className:"textInputFromRight",maxLength:15,showMaxLength:!1,style:{width:"48%"}})]}),Boolean(m)?e(Ze,{children:m}):null]})})},al=t=>{const{filterProps:i}=t;return"date"===i?.type?e(zo,{...t}):"value"===i?.type?e(qo,{...t}):"number"===i?.type?e(Go,{...t}):"amount"===i?.type?e(nl,{...t}):e(q,{item:!0,md:6,sm:6,xs:12,children:"Range Component Type not set"})},sl=e=>({"data-tag-index":e,tabIndex:-1,key:e}),ol=({filterValue:t,id:i,columnName:r,gridProps:n,dispatch:a})=>{const[s,h]=d(""),[c,u]=d(t?.value??[]),[A,p]=d(-1),f=o(null),m=o(null),g=(e,t)=>{let i=A;-1===A?""===s&&"previous"===t&&(i=c.length-1):(i+="next"===t?1:-1,i<0&&(i=0),i===c.length&&(i=-1)),p(i),w(i)},w=l(e=>{-1===e?m.current.focus():f.current.querySelector(`[data-tag-index="${e}"]`).focus()},[]);let b=null;Array.isArray(c)&&c.length>0&&(b=c.map((t,i)=>e(gi,{label:t,size:"small",onDelete:()=>u([...c.slice(i,i+1),...c.slice(i+1)]),style:{margin:"4px 2px"},...sl(i)})));return e(q,{item:!0,xs:12,sm:6,md:6,...n,children:e(mo,{inputRef:m,label:r,InputLabelProps:{shrink:!0},onChange:e=>h(e.target.value),onBlur:()=>{Array.isArray(c)&&c.length>0?a({type:"setValue",payload:{condition:"in",value:c,id:i,columnName:r}}):a({type:"removeValue",payload:{id:i}})},fullWidth:!0,value:s,InputProps:{startAdornment:b,ref:f},onKeyDown:e=>{if(-1!==A&&-1===["ArrowLeft","ArrowRight"].indexOf(e.key)&&(p(-1),w(-1)),299!==e.which)switch(e.key){case"Enter":Boolean(s)&&(u(e=>[...e,s]),h(""));break;case"Backspace":if(""===s&&c.length>0){const e=-1===A?c.length-1:A,t=c.slice();t.splice(e,1),u(t)}break;case"ArrowLeft":g(0,"previous");break;case"ArrowRight":g(0,"next")}}})})},ll=e=>()=>(console.log(`no method found for options at ${e}`),[{label:"Oops error occured",value:""}]),hl=e=>Array.isArray(e)?e.map(e=>{const{filterComponentType:t,filterProps:i,...r}=e;switch(t){case"valueFilter":return{...r,Filter:Po,filterProps:i};case"multiValueFilter":return{...r,Filter:ol,filterProps:i};case"optionsFilter":{const{options:e,...t}=i;if("string"==typeof e){const i=fa.getFn(e??"NOT_EXIST_OPTIONS_FN",ll);return{...r,Filter:Oo,filterProps:{options:i,_optionsKey:e,...t}}}return{...r,Filter:Oo,filterProps:i}}case"rangeFilter":return{...r,Filter:al,filterProps:i};default:return{...r}}}):[],cl=e=>Array.isArray(e)?e.reduce((e,t)=>(!1===t.isVisible&&e.push(t.accessor),e),[]):[],dl=e=>{if(Array.isArray(e)){return e.sort((e,t)=>Number(e.sequence)<Number(t.sequence)?-1:Number(t.sequence)>Number(e.sequence)?1:0).map(({sequence:e,...t})=>t)}return[]},ul=e=>{if(Array.isArray(e)&&e.length>0){const t=e.filter(e=>!0===e.multiple),i=e.filter(e=>!1===e.multiple),r=e.filter(e=>!0===e.rowDoubleClick),n=e.filter(e=>!0===e.alwaysAvailable);return{multipleActions:t,singleActions:i,doubleClickAction:r[0]??!1,alwaysAvailableAction:n}}return{multipleActions:[],singleActions:[],alwaysAvailableAction:[],doubleClickAction:!1}},Al=(e,t,i,r,n)=>{if(!Array.isArray(e)&&Boolean(e)&&(e=[e]),n&&(e=e.filter(e=>"function"!=typeof e?.shouldExclude||!0!==e.shouldExclude(t,i))),e.length<=0||t.length<=0)return!0===r?e[0]:e;let a=e.filter(e=>"function"!=typeof e?.shouldExclude||!0!==e.shouldExclude(t.map(e=>({id:e.id,data:e.original})),i));return!0===r?a[0]:a},pl=(e,t)=>e.filter(e=>!(!e?.isNodataThenShow||0!==t)||!e?.isNodataThenShow&&t>0),fl=(e,t)=>{let i;return i=e.length>0?t.filter(t=>ml(t,e)):t,i},ml=(e,t)=>{let i=!0;return t.forEach(t=>{void 0===e[t.id]||((e,t)=>{let i=!0;if(void 0!==e)switch(t.condition){case"equal":i=(e??"").toLowerCase()===(t.value??"").toLowerCase();break;case"startsWith":i=(e??"").toLowerCase().startsWith((t.value??"").toLowerCase());break;case"endsWith":i=(e??"").toLowerCase().endsWith((t.value??"").toLowerCase());break;case"contains":i=(e??"").toLowerCase().indexOf((t.value??"").toLowerCase())>=0;break;case"in":i=t.value?.filter(t=>t===(e??""))?.length>0;break;case"between":const r=t.value;if("date"===t.type){const t=new Date(r[0]),n=new Date(r[1]),a=new Date(e);i=a>t&&a<n}else if("amount"===t.type||"number"===t.type){const t=parseFloat(r[0]),n=parseFloat(r[1]),a=parseFloat(e);i=a>t&&a<n}else i=e>r[0]&&e<r[1];break;default:i=!0}return i})(e[t.id],t.value)||(i=!1)}),i},gl=[[/^columns.*.options$/,e=>()=>(console.log(`no method found for options at ${e}`),[{label:"Oops error occured",value:""}])],[/^columns.*.validate$/,e=>()=>(console.log(`no method found for validation at ${e}`),"")]],wl=["validate"],bl={abortEarly:!1,strict:!1},vl=e=>{if(void 0===e)return;const{type:t,rules:i}=e;if(!E[t])return;if(!Array.isArray(i))return;let r=E[t]();return i.forEach(e=>{const{params:t,name:i}=e;r[i]&&(r=r[i](...t))}),yl(r)},yl=e=>async t=>{try{return await e.validate(t,bl),null}catch(e){return e instanceof E.ValidationError?Ge(e.errors[0]):e.message}},Bl=(e,t,i,r)=>async(n,a,s,o)=>{let l;if("function"==typeof e&&(l=await e(n),Boolean(l)))return l;if("function"==typeof t){const e=r?.current?await(r.current?.getFieldData()):{};if(l=await t(n,a,s,o,i,e),Boolean(l))return l}return""},Cl=({column:r,visibleColumns:n,setColumnOrder:a,allowColumnReordering:s})=>{const[{isDragging:l},h]=wt({type:"Column",collect:e=>({isDragging:!!e.isDragging()}),end:(e,t)=>{if(t.didDrop()){const{id:e}=t.getDropResult(),s=n.map(e=>e.id),o=s.indexOf(e),l=s.indexOf(r.id);var i=s[o];s[o]=s[l],s[l]=i,a(s)}},canDrag:()=>s&&!r.pinColumn}),[{isOver:c},d]=bt({accept:"Column",drop:()=>({id:r.id}),collect:e=>({isOver:s&&!r.pinColumn&&!!e.isOver()}),canDrop:()=>s&&!r.pinColumn}),u=o(null);return h(d(u)),t(i,{children:[e(zi,{active:r.isSorted,direction:r.isSortedDesc?"desc":"asc",hideSortIcon:!0,ref:u,...r.getSortByToggleProps([{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"flex",color:"var(--theme-color1)",fontSize:"1 rem",fontWeight:"600",opacity:l||c?.5:1,cursor:l?"move":"default"}}]),children:e("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r.columnName})}),r.canGroupBy?e("span",{...r.getGroupByToggleProps(),children:r.isGrouped?"🔴":"➕"}):null,r.getResizerProps&&!r.disableResizing&&e("div",{...r.getResizerProps([{style:{minHeight:"26px",opacity:1,color:"rgba(224, 224, 224, 1)",right:"-10px",display:"flex",zIndex:5,position:"absolute",flexDirection:"column",justifyContent:"center"}}]),children:e("svg",{focusable:"false",viewBox:"0 0 24 24","aria-hidden":"true","data-testid":"SeparatorIcon",style:{color:"inherit",userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:"currentColor",flexShrink:0,transition:"fill 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",fontSize:"20px"},children:e("path",{d:"M11 19V5h2v14z"})})})]})},xl=({allowToggleVisiblity:t,...i})=>{const[r,n]=d(0),a=Date.now()<r,s=o(null),[,l]=d();return h(()=>()=>clearTimeout(s.current),[]),e(Zo,{...i,type:a?"text":"password",StartAdornment:"password-loader",InputProps:{endAdornment:Boolean(t)?e(B,{position:"end",children:e(C,{"aria-label":"toggle password visibility",onClick:()=>{a?a&&n(0):(n(Date.now()+5e3),s.current=setTimeout(()=>l(Date.now()),5e3))},children:e(a?v:y,{})})}):null}})};var Fl=Object.freeze({__proto__:null,PasswordField:xl,default:xl}),Sl=Object.freeze({__proto__:null,NumberFormat:rl,NumberFormatCustom:il,default:rl});function Nl(t){const{inputRef:i,onChange:r,MaskProps:n,...a}=t,{formattedValue:s,...o}=n;return e(Li,{...a,inputRef:i,onAccept:(e,i)=>{r({target:{name:t.name,value:s?i.value:i.unmaskedValue}})},...o})}const El=({MaskProps:t,formattedValue:i,...r})=>e(Zo,{...r,InputProps:{inputComponent:Nl,inputProps:{MaskProps:{...t,formattedValue:i}}}});var kl=Object.freeze({__proto__:null,InputMask:El,InputMaskCustom:Nl,default:El});const Tl=Ci(e=>({searchRoot:{fontFamily:e.typography.fontFamily,position:"relative",boxShadow:"0px 2px 4px -1px rgba(0,0,0,0.2), 0px 4px 5px 0px rgba(0,0,0,0.14), 0px 1px 10px 0px rgba(0,0,0,0.12)",marginRight:"10px",marginLeft:e.spacing(1),marginBottom:e.spacing(.25),marginTop:e.spacing(.25),borderRadius:40,backgroundColor:e.palette.common.white,"& $inputInput":{transition:e.transitions.create("width"),width:146,"&:focus":{width:170}},"&:has(.route-search-bar)":{boxShadow:"none"}},searchRoot2:{fontFamily:e.typography.fontFamily,position:"relative",boxShadow:"0px 2px 4px -1px rgba(0,0,0,0.2), 0px 4px 5px 0px rgba(0,0,0,0.14), 0px 1px 10px 0px rgba(0,0,0,0.12)",marginRight:e.spacing(2),marginLeft:e.spacing(1),borderRadius:40,backgroundColor:yi(e.palette.common.white,.15),"&:hover":{backgroundColor:yi(e.palette.common.white,.25)}},searchError:{marginRight:e.spacing(2),marginLeft:e.spacing(6)},search:{width:e.spacing(6),height:"100%",position:"absolute",pointerEvents:"none",display:"flex",alignItems:"center",justifyContent:"center"},inputRoot:{color:"inherit",marginTop:0,borderRadius:"40px"},inputInput:{padding:e.spacing(1,1,1,6)}})),Ll=c((i,r)=>{const n=re(),a=Si(n.breakpoints.up("sm")),s=Tl(),l=o(null);return p(r,()=>({handleBlur:()=>l.current?.blur(),handleFocus:()=>l.current?.focus()})),h(()=>{Boolean(i.autoFocus)&&setTimeout(()=>{l.current?.focus?.()},1e3)},[]),t("div",{className:s.searchRoot,style:{display:a?"flex":"none"},children:[e(mi,{...i,disableUnderline:!0,inputRef:l,autoComplete:"off",classes:{root:s.inputRoot,input:s.inputInput}}),e("div",{className:s.search,children:e(Or,{sx:{color:"var(--theme-color1)"}})})]})}),Il=({helperText:i,error:r,disabled:n,...a})=>{const s=re(),l=Si(s.breakpoints.up("sm")),h=Tl(),c=o(null);return t(f,{children:[t("div",{className:h.searchRoot2,style:{display:l?"flex":"none"},children:[e(mi,{...a,disabled:n,error:r,disableUnderline:!0,inputRef:c,classes:{root:h.inputRoot,input:h.inputInput}}),e("div",{className:h.search,children:e(Or,{})})]}),Boolean(r)?e(Ze,{disabled:n,error:r,className:h.searchError,children:i}):null]})},Dl=({preGlobalFilteredRows:t,globalFilter:i,setGlobalFilter:r,searchPlaceholder:n})=>{const a=t.length,[,s]=d(i),{t:o}=W(),l=qt(e=>r(e||void 0),200);return e(Ll,{type:"text",onChange:e=>{s(e.target.value),l(e.target.value)},className:"gridwrapper_global_search",placeholder:`${o("profile.Searchin")} ${a} ${o(n)}`,color:"primary"})},Ul=xi(e=>({root:{"&.Mui-checked":{color:"var(--theme-color1)"},"&.MuiCheckbox-indeterminate":{color:e.palette.text.secondary}},checked:{}}))(ui),Pl=({row:t,cell:r,setContextMenuSelectedRowId:n,hasLeftPinnedColumn:a})=>e(i,{children:e(ci,{component:"div",variant:"head",...r.getCellProps([{style:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"0px 10px",lineHeight:"28px",...a&&{position:"sticky",left:0,zIndex:1,background:"inherit"}}}]),children:Boolean(t?.original?.__isRowSelection??!0)?e(Ul,{size:"small",...t.getToggleRowSelectedProps([{style:{padding:0}}]),onClick:e=>{t.isSelected&&n("")}}):null})}),Rl=({getToggleAllRowsSelectedProps:t,setContextMenuSelectedRowId:i,hasLeftPinnedColumn:r})=>e(ci,{component:"div",variant:"head",style:{padding:0,...r&&{position:"sticky",left:0,zIndex:1,background:"inherit"}},children:e(Ul,{size:"small",...t([{style:{padding:0}}]),onClick:()=>{i("")}})}),Ol=Ci(e=>({root:{paddingLeft:e.spacing(2),paddingRight:e.spacing(2)},highlight:"light"===e?.palette?.mode?{color:e.palette.secondary.main,backgroundColor:Bi(e.palette.secondary.light,.85)}:{color:e.palette.secondary.dark,background:e.palette.secondary.dark},title:{flex:"1"}})),Ql=({dense:i,selectedFlatRows:r,multipleActions:n,singleActions:a,setGridAction:s,submitButtonRef:o,loading:l})=>{const h=Ol(),{t:c}=W(),d=r.length,u=r.map(e=>({data:e.original,id:e.id}));return d<=0?null:("function"!=typeof s&&(s=()=>{}),t(ai,{className:J(h.root,h.highlight),variant:i?"dense":"regular",children:[t(vt,{className:h.title,color:"inherit",variant:d>0?"subtitle1":"h6",component:"div",children:[c("Selected")," ",d]}),1===d?e(Hl,{actions:a,setAction:s,selectedRows:u,buttonTextColor:"var(--theme-color1)",buttonBackground:"inherit",submitButtonRef:o,loading:l},"singleFilters"):null,d>0?e(Hl,{actions:n??[],setAction:s,selectedRows:u,buttonTextColor:"var(--theme-color1)",buttonBackground:"inherit",submitButtonRef:o,loading:l},"multipleFilters"):null]}))},Hl=({actions:t,setAction:i,selectedRows:r,buttonTextColor:n="var(--white)",buttonBackground:a="",style:s={},filteredRows:o,submitButtonRef:l,loading:h})=>{const{t:c}=W(),{defaultGridConfig:d}=ns(),u=d?.isContainedActionButton;return Array.isArray(t)&&t.length>0?t.map(t=>{const d=t.startsIcon?Xi[t.startsIcon]:null,A=t.endsIcon?Xi[t.endsIcon]:null;return e(Ii,{title:c(t.tooltip??t.actionLabel),children:e(eo,{startIcon:d?e(d,{}):null,endIcon:A?e(A,{}):null,disabled:h,sx:{marginLeft:"5px",color:t.actionTextColor??n,boxShadow:u&&!a?"2px 2px 4px rgba(0,0,0,.2)":"none",background:t.actionBackground??(Boolean(a)?a:u?"var(--primary-bg)":"inherit"),"&:hover":{background:t.actionBackground??(Boolean(a)?a:u?"var(--primary-bg)":"inherit"),opacity:.85,"& .MuiSvgIcon-root":{transform:t.rotateIcon,transition:"transform 2s ease-in-out"}}},onClick:()=>{i({name:t.actionName,rows:r,filteredRows:o})},style:{...s},ref:t?.onEnterSubmit?l:null,enableShortcut:t.enableShortcut??!0,eventKey:t.eventKey,shortcut:t.shortcut,children:c(t.actionLabel)})},t.actionName)}):null},Ml=({singleActions:t,multipleActions:r,setGridAction:n,contextMenuRow:a,selectedFlatRows:s,mouseX:o,mouseY:l,handleClose:h,authState:c})=>{const{t:d}=W(),u=s.map(e=>({data:e.original,id:e.id}));let A=null;"function"!=typeof n&&(n=()=>{});let p=[...t,...r??[]];return Array.isArray(p)&&p.length>0&&s.length<=1&&null!==a?(p=Al(p,[a],c,!1),A=p.map(t=>e(K,{onClick:()=>{n({name:t.actionName,rows:[{data:a?.original,id:a?.id}]}),h()},children:d(t.actionLabel)},t.actionName))):Array.isArray(r)&&r.length>0&&s.length>1&&null!==s&&(A=r?.map(t=>e(K,{onClick:()=>{n({name:t.actionName,rows:u}),h()},children:d(t.actionLabel)},t.actionName))),e(i,{children:null!==A&&Array.isArray(A)&&A.length>0?e(zr,{onContextMenu:e=>{e.preventDefault(),h()},open:null!==l,onClose:h,anchorReference:"anchorPosition",anchorPosition:null!==l&&null!==o?{top:l,left:o}:void 0,children:A}):null})},_l=n({resume:()=>{},pause:()=>{},attachFunction:(e,t)=>{}}),jl=({children:t})=>{let i=o(null),r=o(null),n=o(!1),a=o(!1);const s=l(()=>{Boolean(n.current)&&!Boolean(a.current)&&(i.current=setInterval(()=>{"function"==typeof r?.current&&r.current()},1e3),a.current=!0)},[]),h=l(()=>{Boolean(n.current&&Boolean(a.current))&&(clearInterval(i.current),a.current=!1)},[]);return e(_l.Provider,{value:{resume:s,pause:h,attachFunction:(e,t)=>{r.current=e,n.current=t}},children:t})},zl=()=>{const{resume:e,pause:t}=a(_l);return{resume:e,pause:t}},Vl=(e,t)=>{const[i,r]=d(0),[n,s]=d(!1),c=o(0),u=o(e);u.current=e;const{resume:A,pause:p,attachFunction:f}=a(_l),m=l(()=>{c.current=Math.min(c.current+1,t);let e=Math.floor(c.current/t*100);c.current===t&&(c.current=0),r(Math.min(e,100))},[r,t]);return h(()=>(parseInt(t)>0&&(f(m,!0),s(!0),A()),()=>{p()}),[t,m]),h(()=>{100===i&&"function"==typeof u.current&&u.current()},[i]),{intervalElapsed:Math.min(t-c.current,t),enabled:n,progress:i,resume:A,pause:p}},Kl=({value:i,variant:r,interval:n,pause:a,resume:s})=>{const[o,l]=d(!0),[h,c]=d(!1);return t("div",{style:{position:"relative",display:"inline-flex"},children:[e(G,{variant:r,value:i,size:"2rem"}),e("div",{style:{position:"absolute",top:0,left:0,bottom:0,right:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#80808042",borderRadius:"50%"},onMouseOver:()=>c(!0),onMouseOut:()=>c(!1),children:h?e(C,{onClick:()=>{o?(a(),l(!1)):(s(),l(!0))},style:{opacity:.6},children:e(o?Kr:Vr,{})}):o?e(vt,{variant:"caption",component:"div",color:"textSecondary",children:n??i}):e(C,{onClick:()=>{o?(a(),l(!1)):(s(),l(!0))},style:{opacity:.6},children:e(o?Kr:Vr,{})})})]})},ql=(e=[],t={})=>{switch(t.type){case"setValue":{const{id:i,...r}=t.payload;let n=e.findIndex(e=>e.id===i);return n>=0?(e[n].value=r,[...e]):[...e,{id:i,value:r}]}case"removeValue":{const{id:i}=t.payload;return e.filter(e=>e.id!=i)}case"resetAll":return[];default:return e}},Gl=({filters:i,setAllFilters:r,filterMeta:n,setSortBy:a,gotoPage:s,classes:c,isDefaultFilter:A=!1})=>{const[p,f]=d(!1),{filterState:m,dispatch:g}=(e=>{const t=o([]);return{dispatch:l(i=>{let r=e(t.current,i);t.current=r},[]),filterState:t}})(ql),{t:w}=W(),b=()=>{f(!1)};h(()=>{m.current=i},[i]);let v=[];return Array.isArray(n)&&(v=n.filter(e=>"function"==typeof e.Filter),v=v.map(e=>{const{Filter:t,accessor:r,...n}=e;return u(t,{key:r,filterValue:i.filter(e=>e.id===r)?.[0]?.value,id:r,dispatch:g,isDefaultFilter:A,...n})})),t(Qi,{dateAdapter:Hi,children:[e(C,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true",onClick:()=>{f(!0)},color:"primary",className:c.refreshiconhover,children:e(qr,{})}),t(Gr,{anchor:"right",id:"columnVisibility",open:p,onClose:b,sx:{zIndex:1300},PaperProps:{style:{width:"520px"}},children:[e(Ar,{position:"relative",color:"secondary",children:t(ai,{variant:"dense",children:[e(vt,{variant:"h6",children:w("Filter")}),e("div",{style:{flexGrow:1}}),e(ct,{onClick:()=>{r(m.current),a([]),s(0),f(!1)},color:"primary",children:w("Apply")}),e(ct,{onClick:()=>{m.current=[],r(m.current),a([]),s(0),f(!1)},color:"primary",children:w("Clear")}),e(ct,{onClick:b,color:"primary",children:w("Close")})]})}),e(st,{children:e(q,{container:!0,spacing:2,children:v})})]})]})},Wl=xi(e=>({root:{"& .MuiCheckbox-root":{padding:"2px 6px"},"& label":{marginBottom:0}}}))(K);xi({root:{"& .MuiInputBase-root":{border:"1px solid #BABABA",marginTop:"0 !important",borderRadius:5,backgroundColor:"#fff",padding:"0 0","& input":{padding:"4px 38px 4px 6px",marginTop:"0 !important",fontSize:"12px"}},"& .MuiInput-underline:before":{borderBottom:"0"},"& .MuiInput-underline:after":{borderBottom:"2px solid #26A456",transition:"transform 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms"},"&:hover .MuiInput-underline:before":{borderBottom:"0"},"& .MuiInputLabel-shrink":{transform:"translate(0, 1.5px) scale(1)"},"& .MuiSelect-selectMenu":{minHeight:"9px",lineHeight:"9px",fontSize:12}}})(_t),xi({root:{color:"#26A456",height:8},thumb:{height:24,width:24,backgroundColor:"#fff",border:"2px solid currentColor",marginTop:-8,marginLeft:-12,"&:focus, &:hover, &$active":{boxShadow:"inherit"}},active:{},valueLabel:{left:"calc(-50% + 4px)"},track:{height:8,borderRadius:4},rail:{height:8,borderRadius:4}})(Dt);const Jl=({visibleColumns:i,defaultHiddenColumns:r,classes:n,IconButtonStyle:a={variant:null}})=>{const[s,o]=d(null),l=Boolean(s),{t:h}=W(),c=i.reduce((t,i)=>{const{checked:n,style:a,onChange:s}=i.getToggleHiddenProps(),o=i?.isColumnHidingDisabled??!1;return-1!==r.indexOf(i.id)&&!0!==i.isTableHidden||t.push(e(Wl,{dense:!0,onChange:s,children:e(Ye,{control:e(ui,{checked:n,onChange:s,name:i.id,color:"secondary",disabled:o}),label:h(i.columnName),style:a})},i.id)),t},[]);return t("div",{children:[e(C,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true",onClick:e=>{o(e.currentTarget)},color:a.variant?a.variant:"primary",className:n.refreshiconhover,children:e(Jr,{})}),e(Xr,{id:"columnVisibility",open:l,anchorEl:s,onClose:()=>{o(null)},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:e(ni,{style:{maxHeight:216,overflow:"scroll"},children:e(Wr,{dense:!0,children:c})})})]})},Xl=Ci(e=>({root:{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),background:"var(--primary-bg)",borderTopLeftRadius:"4px",borderTopRightRadius:"4px"},title:{color:"var(--white)",letterSpacing:"1px",fontSize:"1.25rem"},refreshiconhover:{}})),Yl=c(({dense:i,label:r,preGlobalFilteredRows:n,globalFilter:a,setGlobalFilter:o,alwaysAvailableAction:l,setGridAction:h,filteredRows:c,selectedFlatRows:d,disableGlobalFilter:u,refetchData:A,autoRefreshInterval:f,gotoPage:m,setSortBy:g,allowFilter:w,filters:b,setAllFilters:v,filterMeta:y,visibleColumns:B,defaultHiddenColumns:x,allowColumnHiding:F,loading:S=!1,headerToolbarStyle:N,searchPlaceholder:E,enableExport:k,setOpenExport:T,subGridLabel:L,enablePivot:I,setOpenPivot:D,RenderSubHeader:U,subHeaderComponentProps:P},R)=>{const{defaultGridConfig:O}=ns(),{progress:Q,enabled:H,intervalElapsed:M,pause:_,resume:j}=Vl(A,f),z=Xl(),V=s(()=>d.map(e=>({data:e.original,id:e.id})),[d]);return p(R,()=>({pause:_,resume:j})),t(ai,{className:J(z.root,"static__grid__header"),variant:i?"dense":"regular",sx:{...N},children:[t(vt,{className:z.title,color:"inherit",variant:"h6",component:"div",children:[r," ",L]}),t("div",{style:{display:"flex",alignItems:"center",marginLeft:"auto"},children:[U&&P.__showInHeader?e(U,{...P}):null,w?e(Gl,{setAllFilters:v,filters:b,filterMeta:y,gotoPage:m,setSortBy:g,classes:z}):null,"function"==typeof A?e(ne,{title:Ge("Refetch"),children:e(C,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true",onClick:A,color:"primary",children:e(ki,{})})}):null,H?e(Kl,{variant:"determinate",value:Q,interval:M,pause:_,resume:j}):null,F?e(Jl,{visibleColumns:B,defaultHiddenColumns:x,classes:z}):null,u?null:e(Dl,{preGlobalFilteredRows:n,globalFilter:a,setGlobalFilter:o,searchPlaceholder:E}),I?t(eo,{disabled:S,style:{marginRight:".5rem"},onClick:()=>D(!0),children:[Ge("Pivot"),e(yr,{})]}):null,k?e(ae,{style:{cursor:S?"auto":"pointer"},control:e(ne,{title:Ge("Showexportoptions"),children:t(eo,{onClick:()=>{T(!0)},disabled:S,style:{color:"white",background:O?.isContainedActionButton?"var(--primary-bg)":"inherit",boxShadow:O?.isContainedActionButton?"2px 2px 4px 0px rgba(0,0,0,.2)":"none"},eventKey:"x",shortcut:"alt",children:[Ge("Export")," ",e(Ki,{})]})}),sx:{color:"var(--white)",margin:"0 !important"},label:""}):null,e(Hl,{selectedRows:V,setAction:h,actions:l??[],filteredRows:c,loading:S},"alwaysRender")]})]})}),$l=xi(()=>({root:{position:"sticky",zIndex:10,top:0,borderRadius:"8px",display:"block",height:"28px"}}))(li),Zl=xi(e=>({root:{background:"#fff","&:focus":{outline:"none !important",background:"#ddd"},"&$selected:focus":{outline:"none !important",background:"#ddd"},"&$hover:hover":{outline:"none !important"},"&$selected, &$selected:hover":{outline:"none !important"},"&:hover":{outline:"none !important",background:"#eee"}},selected:{background:e.palette.action.selected}}))(hi),eh=e=>"Y"===e||!0===e,th=({variant:i,column:r,rows:n=[],children:a,pinnedOffsets:o,visibleColumns:l})=>{const h=o?.leftMap?.[r.id],c=o?.rightMap?.[r.id],d=l?.filter(e=>"left"===e.pinColumn),u=l?.filter(e=>"right"===e.pinColumn),A=d?.[d.length-1]?.id,p=u?.[0]?.id,f=r.id===A,m=r.id===p,g="left"===r.pinColumn?{position:"sticky",left:h??0,zIndex:"6",...f&&{borderRight:"1px solid var(--theme-color3)"}}:"right"===r.pinColumn?{position:"sticky",right:c??0,zIndex:"6",...m&&{borderLeft:"1px solid var(--theme-color3)"}}:!0===r.sticky?{position:"sticky",zIndex:"6"}:{},{allChecked:w,someChecked:b}=s(()=>{if(0===n.length)return{allChecked:!1,someChecked:!1};const e=n.every(e=>eh(e.values[r.id])),t=n.every(e=>!eh(e.values[r.id]));return{allChecked:e,someChecked:!e&&!t}},[n,r.id]);return t(ci,{component:"div",variant:"head",sx:{padding:r?.cellHeaderAlignment||null},...r.disableSortBy?{style:{position:"relative",display:"flex",padding:"0px 10px",lineHeight:"28px",borderBottom:"standard"===i?"auto":"none",background:"inherit",backgroundColor:"inherit",zIndex:"5",...g}}:r.getHeaderProps([{style:{position:"relative",display:"flex",padding:"0px 10px",lineHeight:"28px",background:"inherit",zIndex:"5",backgroundColor:"inherit",borderBottom:"standard"===i?"auto":"none",...g}}]),children:[r?.enableColumnSelection&&e(go,{checked:w,indeterminate:b,style:{color:"var(--theme-color1)"},onChange:e=>{a?.props?.updateGridData(0,a?.props?.column?.id,e.target.checked?"Y":"N",!0,"","A")}}),a]})},ih=Ci(e=>({root:{flexShrink:0,marginLeft:e.spacing(2.5)}})),rh=i=>{const r=ih(),n=re(),{count:a,page:s,rowsPerPage:o,onPageChange:l}=i;return t("div",{className:r.root,children:[e(C,{onClick:e=>{l(e,0)},disabled:0===s,"aria-label":"first page",children:"rtl"===n.direction?e(tn,{}):e(Yr,{})}),e(C,{onClick:e=>{l(e,s-1)},disabled:0===s,"aria-label":"previous page",children:"rtl"===n.direction?e(Zr,{}):e($r,{})}),e(C,{onClick:e=>{l(e,s+1)},disabled:s>=Math.ceil(a/o)-1,"aria-label":"next Page",children:"rtl"===n.direction?e($r,{}):e(Zr,{})}),e(C,{onClick:e=>{l(e,Math.max(0,Math.ceil(a/o)-1))},disabled:s>=Math.ceil(a/o)-1,children:"rtl"===n.direction?e(Yr,{}):e(tn,{})})]})},nh=i=>{const r=ih(),n=re(),{count:a,page:s,rowsPerPage:o,onPageChange:l}=i,[h,c]=d(""),u=Math.ceil(a/o),A=0===u?0:s+1;return t("div",{className:r.root,style:{display:"flex",alignItems:"center",marginLeft:"1rem"},children:[t(X,{variant:"body2",children:["Page ",`${A} of ${u}`]}),e(C,{onClick:e=>{l(e,0)},disabled:0===s,"aria-label":"first page",children:"rtl"===n.direction?e(tn,{}):e(Yr,{})}),e(C,{onClick:e=>{l(e,s-1)},disabled:0===s,"aria-label":"previous page",children:"rtl"===n.direction?e(Zr,{}):e($r,{})}),e(Ao,{type:"number",sx:{"& .MuiInputBase-root":{marginTop:"4px !important",height:"28px",pointerEvents:"visible !important"}},value:h,onChange:e=>{c(e.target.value)},InputProps:{inputProps:{min:1,max:Math.ceil(a/o)},endAdornment:e(se,{position:"end",children:e(C,{onClick:()=>{const e=parseInt(h,10)-1;!isNaN(e)&&e>=0&&e<Math.ceil(a/o)&&(l(null,e),c(""))},disabled:isNaN(parseInt(h,10))||""===h,children:e(en,{fontSize:"small"})})})}}),e(C,{onClick:e=>{l(e,s+1)},disabled:s>=Math.ceil(a/o)-1,"aria-label":"next Page",children:"rtl"===n.direction?e($r,{}):e(Zr,{})}),e(C,{onClick:e=>{l(e,Math.max(0,Math.ceil(a/o)-1))},disabled:s>=Math.ceil(a/o)-1,children:"rtl"===n.direction?e(Yr,{}):e(tn,{})})]})},ah=Ci(()=>({root:{position:"relative",overflow:"hidden",display:"block",height:4,zIndex:0,"@media print":{colorAdjust:"exact"}}})),sh=()=>{const t=ah();return e("div",{className:t.root})},oh=xi(()=>({root:{position:"absolute",zIndex:9,backgroundColor:"rgb(0 0 0 / 0%)"}}))(rn),lh=Ci(e=>({root:{display:"flex",justifyContent:"left",flexWrap:"wrap",listStyle:"none",paddingLeft:e.spacing(2),paddingRight:e.spacing(2),margin:0},chip:{margin:e.spacing(.5)}})),hh=({dense:i,filters:r,setAllFilters:n,gotoPage:a,setSortBy:s})=>{const o=lh(),{t:l}=W();return Array.isArray(r)&&r.length<=0?null:t(ai,{component:"ul",className:o.root,variant:i?"dense":"regular",children:[e("li",{children:t(vt,{variant:"h6",color:"secondary",children:[l("AppliedFilters"),":"," "]})}),r.map(t=>e("li",{children:e(gi,{label:ch(t?.value?.condition,l(t?.value?.columnName),t?.value?.value,t?.value?.label,t?.value?.type),...Boolean(t?.value?.isDisableDelete)?null:{onDelete:()=>(e=>{let t=r.filter(t=>t.id!==e);n(t),a(0),s([])})(t?.id)},className:o.chip,variant:"outlined",color:"secondary"})},t?.id))]})},ch=(e,t,i,r,n)=>{switch(e){case"equal":return`${t} = ${"date"===n||"dateTime"===n?dh(i):i}`;case"between":return`${t} between ${"date"===n||"dateTime"===n?dh(i[0]):i[0]} and ${"date"===n||"dateTime"===n?dh(i[1]):i[1]}`;case"in":return`${t} in ${uh(i,r)}`;case"contains":return`${t} like ${i}`;case"endsWith":return`${t} ends with ${i}`;case"startsWith":return`${t} starts with ${i}`;default:return`${t}`}},dh=e=>{let t=e;return ys(e)?(t=new Date(e),!isNaN(t)&&isNaN(e)?ze(t,"dd/MM/yyyy"):e):e},uh=(e,t)=>Array.isArray(t)&&Array.isArray(e)&&e.length===t.length?JSON.stringify(t).replaceAll(/"/g," "):JSON.stringify(e).replaceAll(/"/g," "),Ah=Ci(()=>({outlinedClass:{margin:"10px 0px",borderRadius:"10px",border:"1px solid #ddd"}})),ph=c(function(t,i){return e(nn,{direction:"up",ref:i,...t})}),fh=m(()=>Promise.resolve().then(function(){return uA}).then(e=>({default:e.CheckboxGroup}))),mh=m(()=>Promise.resolve().then(function(){return uA}).then(e=>({default:e.Checkbox}))),gh=m(()=>Promise.resolve().then(function(){return KA}).then(e=>({default:e.SwitchGroup}))),wh=m(()=>Promise.resolve().then(function(){return KA}).then(e=>({default:e.Switch}))),bh=m(()=>Promise.resolve().then(function(){return JA}).then(e=>({default:e.DatePicker}))),vh=m(()=>Promise.resolve().then(function(){return JA}).then(e=>({default:e.DateTimePicker}))),yh=m(()=>Promise.resolve().then(function(){return JA}).then(e=>({default:e.TimePicker}))),Bh=m(()=>Promise.resolve().then(function(){return hp})),Ch=m(()=>Promise.resolve().then(function(){return el})),xh=m(()=>Promise.resolve().then(function(){return Uc})),Fh=m(()=>Promise.resolve().then(function(){return zA})),Sh=m(()=>Promise.resolve().then(function(){return GA})),Nh=m(()=>Promise.resolve().then(function(){return YA})),Eh=m(()=>Promise.resolve().then(function(){return ip})),kh=m(()=>Promise.resolve().then(function(){return ep})),Th=m(()=>Promise.resolve().then(function(){return Sl})),Lh=m(()=>Promise.resolve().then(function(){return Fl})),Ih=m(()=>Promise.resolve().then(function(){return kl})),Dh=m(()=>Promise.resolve().then(function(){return ap})),Uh=m(()=>Promise.resolve().then(function(){return MA}).then(e=>({default:e.ArrayField2}))),Ph=m(()=>Promise.resolve().then(function(){return MA}).then(e=>({default:e.ArrayFieldStepper}))),Rh=m(()=>Promise.resolve().then(function(){return My})),Oh=m(()=>Promise.resolve().then(function(){return jy})),Qh=m(()=>Promise.resolve().then(function(){return zy})),Hh=m(()=>Promise.resolve().then(function(){return Yy})),Mh=m(()=>Promise.resolve().then(function(){return Zy})),_h=m(()=>Promise.resolve().then(function(){return qp})),jh=m(()=>Promise.resolve().then(function(){return eB})),zh=({componentType:e})=>t("div",{children:["No Component of type: $",e]}),Vh=m(()=>Promise.resolve().then(function(){return iB})),Kh=(t,i,r,n={},a="")=>{const{render:s,schemaValidation:o,defaultValue:l,onFormButtonClickHandel:h,...c}=t;let d=null;switch(s.componentType){case"arrayField":d=Uh;break;case"arrayFieldStepper":d=Ph;break;case"textarea":d=Rh;break;case"textField":d=Ch;break;case"select":d=xh;break;case"checkbox":d=mh;break;case"checkboxGroup":d=fh;break;case"radio":d=Fh;break;case"switch":d=wh;break;case"switchGroup":d=gh;break;case"slider":d=Sh;break;case"rating":d=Nh;break;case"datePicker":d=bh;break;case"timePicker":d=yh;break;case"datetimePicker":d=vh;break;case"passwordField":d=Lh;break;case"numberFormat":d=Th;break;case"toggleButtonGroup":d=kh;break;case"inputMask":d=Ih;break;case"autocomplete":d=Dh;break;case"spacer":d=Eh;break;case"typography":d=Qh;break;case"hidden":d=Oh;break;case"transferList":d=Hh;break;case"searchField":d=Mh;break;case"visaversa":d=Bh;break;case"dataTable":d=_h;break;case"formbutton":d=jh;break;case"divider":d=Vh;break;default:d=zh}if(d===zh)return e(d,{componentType:s.componentType});if(d===Eh||d===Qh)return e(d,{...c,enableGrid:!0,GridProps:{item:!0,...c?.GridProps},fieldKey:c.name,componentType:s.componentType},`${r}/${c.name}`);if(d===jh){const e={...n[s.componentType],...c},t={...i?.gridConfig?.item,...c?.GridProps};return u(d,{...e,fieldKey:c.name,key:`${r}/${c.name}`,enableGrid:!0,GridProps:{item:!0,...t,xs:t?.xs??"auto",md:t?.md??"auto",xl:t?.xl??t?.md??"auto",sm:t?.sm??"auto",lg:t?.lg??t?.md??"auto"},onFormButtonClickHandel:h,componentType:s.componentType})}{const e={...n[s.componentType],...c},t={...i?.gridConfig?.item,...c?.GridProps};return"arrayField"!==s.componentType&&"arrayFieldStepper"!==s.componentType||(e.componentProps=n),u(d,{...e,fieldKey:c.name,key:`${r}/${c.name}`,enableGrid:!0,GridProps:{item:!0,...t,xs:t?.xs??"auto",md:t?.md??"auto",xl:t?.xl??t?.md??"auto",sm:t?.sm??"auto",lg:t?.lg??t?.md??"auto"},onFormButtonClickHandel:h,componentType:s.componentType,focusScopeId:a})}},qh=m(()=>Promise.resolve().then(function(){return nB})),Gh=m(()=>Promise.resolve().then(function(){return ip})),Wh=m(()=>Promise.resolve().then(function(){return MA}).then(e=>({default:e.ArrayFieldValues}))),Jh=m(()=>Promise.resolve().then(function(){return jy})),Xh=m(()=>Promise.resolve().then(function(){return zy})),Yh=($h=Kh,(e,t=e=>{},i=()=>{},r="")=>{const{fields:n,form:a}=e;let s={};for(const e of n){let n=-1;"object"==typeof a.render.groups&&(n=a.render.groups.hasOwnProperty(`${e.render?.group}`)?e.render?.group??-1:-1),"formbutton"!==e?.render?.componentType&&"arrayField"!==e?.render?.componentType&&"arrayFieldStepper"!==e?.render?.componentType||(e.onFormButtonClickHandel=t),e.onFormDataChange=i;const o=$h(e,a?.render,a?.name,a?.componentProps,r);let l;l=s[n],void 0===l&&(l={fields:[],sequence:[],fieldNames:[]},s[n]=l),l.fields.push(o),l.sequence.push(e?.render?.sequence??0),l.fieldNames.push(e.name)}if("sequence"===a.render.ordering){const e=Object.keys(s);for(const t of e){const e=s[t];for(let t=0;t<e.sequence.length;t++)for(let i=t+1;i<e.sequence.length;i++)if(e.sequence[t]>e.sequence[i]){const r=e.sequence[i];e.sequence[i]=e.sequence[t],e.sequence[t]=r;const n=e.fields[i];e.fields[i]=e.fields[t],e.fields[t]=n;const a=e.fieldNames[i];e.fieldNames[i]=e.fieldNames[t],e.fieldNames[t]=a}}}return s});var $h;const Zh=(e,t={},i={})=>{if(!Array.isArray(e))return{};let r={};for(const n of e){const{defaultValue:e,name:a,_fields:s}=n,o="function"==typeof e?e(t,i??{}):e;if(Array.isArray(s)){r=Ta(r,a,Zh(s,t,i))}null!=o&&(r=Ta(r,a,o))}return r},ec=e=>{if(!Array.isArray(e))return E.object().shape({});const t=e.reduce(tc,{});return E.object().shape(t)},tc=(e,t)=>{const{name:i,schemaValidation:r,render:n}=t;if("arrayField"===n.componentType||"arrayFieldStepper"===n.componentType){let r=ec(t._fields),n=E.array().of(r);return e[i]=n,e}if(void 0===r)return e;const{type:a,rules:s}=r;if(!E[a])return e;if(!Array.isArray(s))return e;let o=E[a]();return s.forEach(e=>{const{params:t,name:i}=e;o[i]&&(o=o[i](...t))}),e[i]=o,e},ic=e=>()=>(console.log(`no method found for options at ${e}`),[{label:"Oops error occured",value:""}]),rc=e=>t=>i=>(console.log(`no method found for ${e} Transform at ${t}`),i),nc=[[/^fields.*.options$/,ic],[/^fields.*.setColor$/,e=>()=>(console.log(`no method for setColorMethodNotFound found at ${e}`),"")],[/^fields.*.leftOptions$/,ic],[/^fields.*.rightOptions$/,ic],[/^fields.*.validate$/,e=>()=>(console.log(`no method found for validation at ${e}`),"")],[/^fields.*.postValidationSetCrossFieldValues$/,e=>()=>{console.log(`no method for postValidationSetCrossFieldValues found at ${e}`)}],[/^fields.*.isReadOnly$/,e=>()=>(console.log(`no method for isReadOnly found at ${e}`),!1)],[/^fields.*.shouldExclude$/,e=>()=>(console.log(`no method for shouldExclude found at ${e}`),!1)],[/^fields.*.MaskProps.prepare$/,e=>t=>(console.log(`no method for inputMaskPrepare found at ${e}`),t)],[/^fields.*.removeRowFn$/,e=>t=>{throw console.log(`no method for removeRowFn found at ${e}`),new Error("method not implemeneted")}],[/^fields.*.setValueOnDependentFieldsChange$/,e=>t=>(console.log(`no method for removeRowFn found at ${e}`),"")],[/^fields.*.getFixedRowsCount$/,e=>t=>(console.log(`no method for getFixedRowsCount found at ${e}`),0)],[/^fields.*.searchComponent$/,e=>()=>(console.log(`no method for searchComponentNotFound found at ${e}`),"Component not found")],[/^fields.*.leftTransform$/,rc("left")],[/^fields.*.rightTransform$/,rc("right")],[/^fields.*.dataTransformer$/,void 0],[/^fields.*.rowValidator$/,void 0]],ac=["validate","isReadOnly","shouldExclude","setColor","_fields","_columns"],sc=e=>Rs(e,fa,nc,ac),oc=(e,t,i=e=>e,r=null,n={},a={})=>{const{dynamicAccountNumberField:s,dynamicAmountSymbol:o,dynamicAmountGroupStyle:l,decimalCount:h,customExtendedTypes:c}=n,d={...c,...t},u=e?.fields?.map(t=>{if("arrayField"===t.render?.componentType||"arrayFieldStepper"===t.render?.componentType){let s=D({form:e.form,fields:t._fields}),o=oc(s,d,i,r,n,a);t._fields=o.fields}const s=d[t.render.componentType];if(t.options&&Array.isArray(t.options)&&(t.options=t.options.map(e=>e?.label?{...e,label:i(e?.label)}:e)),t.label=i(t.label,{nsSeparator:"|"}),t.placeholder=i(t.placeholder,{nsSeparator:"|"}),t?.addHandleKeyDownFromExtendedType&&(t.handleKeyDown=c?.accountCode?.handleKeyDown??void 0),"object"==typeof s){const{render:e,FormatProps:i,StartAdornment:r,isCurrencyField:n,...a}=s,c=Object.assign({},a,t);if(c.FormatProps={...i,...t?.FormatProps??{}},Boolean(n)||Boolean(t?.isCurrencyField)){c.isCurrencyField=!0;let e=t?.isCurrencyCode,n=t?.StartAdornment||o||r||"INR";c.StartAdornment=e?n:$o(n);let a=t?.FormatProps?.thousandsGroupStyle||l||i?.thousandsGroupStyle;c.FormatProps?c.FormatProps.thousandsGroupStyle=a??"thousand":c.FormatProps={thousandsGroupStyle:a??"lakh"};let s=t?.FormatProps?.decimalScale||h||i?.decimalScale||2;c.FormatProps.decimalScale=s}return c&&c.render&&c.render.componentType&&(c.render.componentType=s.render?.componentType),c}return t});let A=[];const p=s,f=(e,t)=>{const n=t||d[e];if("object"==typeof n){let t;n.label=i(n.label,{nsSeparator:"|"}),n.placeholder=i(n.placeholder,{nsSeparator:"|"}),"function"==typeof n?.defaultValue?t=n.defaultValue(a,r??{}):"string"==typeof n?.defaultValue&&(t=n.defaultValue.trim()),"branchCode"===e&&(n.defaultValue=null==t?r?.user?.branchCode:t),A.push(n)}};return u?.forEach(e=>{if("_accountNumber"===e.render.componentType){let t;p&&(t=p),e?.acctFieldPara&&(t=e?.acctFieldPara),p||e?.acctFieldPara||(t="separated");const i=t=>{if(Boolean(e?.[`${t}Metadata`])){const i={...d[t],...e[`${t}Metadata`]};f(t,i)}else f(t,d?.[t])};"single"===t?i("fullAccountNumber"):["branchCode","accountType","accountCode"].forEach("separated"===t?i:f)}else A=[...A,e];if("datePicker"===e.render.componentType){const t=r?.workingDate?new Date(r.workingDate):null;t&&(e?.isWorkingDate&&(e.defaultValue=t),e?.isMaxWorkingDate&&(e.maxDate=t),e?.isMinWorkingDate&&(e.minDate=t))}if("datetimePicker"===e.render.componentType||"datePicker"===e.render.componentType){const t=new Date;e?.disablePast&&(e.minDate=t),e?.disableFuture&&(e.maxDate=t)}}),{form:e.form,fields:[...A]}},lc=e=>{let{fields:t,form:i}=e;return Array.isArray(t)&&(t=t.map(e=>{const{sequence:t,render:i,...r}=e;return{...r,render:{sequence:t,...i}}})),{fields:t,form:i}},hc=Ci(e=>({title:{color:"#26A456",letterSpacing:"2px",fontSize:"1.75rem",fontWeight:700,alignSelf:"flex-start",marginBottom:"10px"},subTitle:{color:"#26A456",letterSpacing:"2px",fontSize:"1.25rem",fontWeight:700,alignSelf:"flex-start",marginBottom:e.spacing(2)},label:{color:"#736f6f",fontWeight:600,textTransform:"capitalize",fontSize:"1rem",marginBottom:"0.5 rem"},form:{width:"100%"},tabsSubmitBtn:{boxShadow:"none ",background:"#e0e0e0",marginRight:e.spacing(2),color:"#0b6fb8 ",fontSize:"1.2rem","&:hover":{color:"#e0e0e0 ",background:"linear-gradient(-90deg, rgba(94,231,131,1) 0%, rgba(74,205,159,1) 35%, rgba(33,150,218,1) 100%)",boxShadow:"none "}},submit:{margin:e.spacing(3,0,2),fontSize:"1.2rem",borderRadius:"24px"},backBtn:{boxShadow:"none ",background:"#e0e0e0",marginRight:e.spacing(2),color:"#0b6fb8 ",margin:e.spacing(3,0,2),fontSize:"1.2rem",borderRadius:"24px","&:hover":{color:"#e0e0e0 ",background:"linear-gradient(-90deg, rgba(94,231,131,1) 0%, rgba(74,205,159,1) 35%, rgba(33,150,218,1) 100%)",boxShadow:"none "}},buttonProgress:{position:"absolute",top:"50%",left:"50%",marginTop:-12,marginLeft:-12},buttonWrapper:{position:"relative"},stepper:{width:"100%",display:"flex",justifyContent:"flex-end"},stepperLabel:{display:"flex",justifyContent:"flex-start"},formControlLabelSpacer:{flexGrow:1}})),cc=(e,t,i)=>t.filter(t=>{const r=`${e}/${t}`;return!(i.indexOf(r)>=0)}).length>0,dc=(e,t,i)=>t.filter(t=>{const r=`${e}/${t}`;let n=i.indexOf(r)>=0;return!1===n&&(n=!!Boolean(i.find(e=>e.indexOf(r)>-1))),n}).length>0,uc=(e,t)=>{let i=e;for(let r=e+1;r<t.length;r++)if(!0===t[r].status){i=r;break}return i===e},Ac=({fields:i,formRenderConfig:r,formName:n,handleSubmit:a,handleSubmitPartial:s,formDisplayLabel:l,hidden:h,defaultActiveStep:c=0,wrapperChild:u,classes:A,children:p,isSubmitting:f,serverSentError:m,serverSentErrorDetail:g})=>{const w=hc(),[b,v]=d(c),{current:y}=o(Object.keys(i).sort());return t(dr,{component:"main",style:{display:h?"none":"block",paddingTop:"16px"},children:[t(ai,{variant:"dense",children:[e(vt,{component:"h3",className:w.title,children:l}),e("div",{className:A.formControlLabelSpacer}),"function"==typeof u?u({isSubmitting:f,handleSubmit:a}):u]}),!f&&Boolean(m)?e(to,{severity:"error",errorMsg:m,errorDetail:g}):null,t("div",{className:w.form,children:[e(pc,{activeStep:b,formRenderConfig:r,classes:w,fieldGroups:y,formName:n,fields:i}),e(fc,{stepsRenderer:p,fieldGroups:y,fields:i,formRenderConfig:r,activeStep:b}),e(mc,{activeStep:b,setActiveStep:v,formRenderConfig:r,classes:w,fieldGroups:y,formName:n,fields:i,handleSubmit:a,handleSubmitPartial:s})]})]})},pc=({activeStep:r,formRenderConfig:n,classes:a,fieldGroups:s,formName:o,fields:l})=>{const h="DefaultGroup",c=z(Ma(o)),d=z(Oa(o)),u=s.map(e=>{let t=h;return"object"==typeof n.groups&&(t=n.groups[e]),{index:e,name:t,status:cc(o,l[e].fieldNames,c),hasError:dc(o,l[e].fieldNames,d)}}).filter(e=>e.status);return t(i,{children:[e(an,{activeStep:r,alternativeLabel:!0,children:u.map(t=>e(sn,{children:e(on,{error:t.hasError,children:t.name})},t.name))}),e("div",{className:a.stepperLabel,children:e(vt,{component:"h4",className:a.subTitle,children:"object"==typeof n.groups?n.groups[s[r]]:h})})]})},fc=({activeStep:t,fields:i,fieldGroups:r,formRenderConfig:n,stepsRenderer:a})=>{const s=r.map((r,a)=>{const s=i[r];s.fields[0]=g(s.fields[0],{isFieldFocused:a===t});const o=a!==Number(t)?{display:"none"}:{};return e(q,{container:!0,spacing:n?.gridConfig?.container?.spacing??2,direction:n?.gridConfig?.container?.direction??"row",style:o,children:s.fields},r)});return"function"==typeof a?a({steps:s}):e(w,{fallback:e("div",{children:"Loading..."}),children:s})},mc=({activeStep:i,formName:r,fieldGroups:n,formRenderConfig:a,fields:s,handleSubmitPartial:o,handleSubmit:l,setActiveStep:h,classes:c})=>{const d=z(Ma(r)),u=z(Oa(r)),A=n.map(e=>{let t="DefaultGroup";return"object"==typeof a.groups&&(t=a.groups[e]),{index:e,name:t,status:cc(r,s[e].fieldNames,d),hasError:dc(r,s[e].fieldNames,u)}});return t("div",{className:c.stepper,children:[0===i?null:e(ct,{type:"button",onClick:()=>{if(i>0){let e=((e,t)=>{for(let i=e-1;i>=0;i--)if(!0===t[i].status)return i;return e})(i,A);h(e)}},className:c.submit,children:a?.labels?.prev??"Back"}),uc(i,A)?e(ct,{type:"button",className:c.submit,onClick:l,children:a?.labels?.complete??"Submit"}):e(ct,{type:"button",className:c.submit,onClick:async()=>{if(!uc(i,A)){const e=A[i],t=s[e.index].fieldNames;if(!await o(t)){const e=((e,t)=>{for(let i=e+1;i<t.length;i++)if(!0===t[i].status)return i;return e})(i,A);h(e)}}},children:a?.labels?.next??"Next"})]})},gc=({fields:t,formRenderConfig:i,children:r})=>{const n=o(Object.keys(t).sort()).current.map(e=>t[e].fields).reduce((e,t)=>[...e,...t],[]);return"function"==typeof r?r({fieldsToRender:n,spacing:i?.gridConfig?.container?.spacing??2,direction:i?.gridConfig?.container?.direction??"row"}):e(q,{container:!0,spacing:i?.gridConfig?.container?.spacing??2,direction:i?.gridConfig?.container?.direction??"row",children:e(w,{fallback:e("div",{children:"Loading..."}),children:n})})},wc=({fields:i,formRenderConfig:r,formName:n,formStyle:a,hidden:s,formDisplayLabel:o,displayMode:l,hideDisplayModeInTitle:h,wrapperChild:c,serverSentError:d,serverSentErrorDetail:u,isSubmitting:A,classes:p,handleSubmit:f,controlsAtBottom:m,hideHeader:g,containerstyle:b={},subHeaderLabel:v,subHeaderLabelStyle:y,formHeaderStyle:B,validationRunning:C})=>t(dr,{component:"main",style:{display:s?"none":"block",...b},children:[g?null:e(vc,{formDisplayLabel:o,displayMode:l,hideDisplayModeInTitle:h,wrapperChild:c,serverSentError:d,serverSentErrorDetail:u,isSubmitting:A,classes:p,handleSubmit:f,controlsAtBottom:m,subHeaderLabel:v,subHeaderLabelStyle:y,formHeaderStyle:B,validationRunning:C}),t(oe,{sx:{paddingTop:"10px",...a},children:[e(gc,{fields:i,formRenderConfig:r,formName:n,children:({spacing:t,direction:i,fieldsToRender:r})=>e("div",{className:"form-fields-container",children:e(q,{container:!0,spacing:t,direction:i,children:e(w,{fallback:e("div",{children:"Loading..."}),children:r})})})},`${n}-simple`),m&&e(bc,{wrapperChild:c,isSubmitting:A,handleSubmit:f,classes:p,validationRunning:C})]})]}),bc=({wrapperChild:i,isSubmitting:r,handleSubmit:n,classes:a,validationRunning:s})=>t(ai,{variant:"dense",disableGutters:!0,className:"form-bottom-controls",children:[e("div",{className:a.formControlLabelSpacer}),"function"==typeof i?i({isSubmitting:r,handleSubmit:n,validationRunning:s}):i]}),vc=({formDisplayLabel:i,displayMode:r,hideDisplayModeInTitle:n,wrapperChild:a,serverSentError:s,serverSentErrorDetail:o,isSubmitting:l,classes:h,handleSubmit:c,controlsAtBottom:d,subHeaderLabel:u,subHeaderLabelStyle:A,formHeaderStyle:p,validationRunning:f})=>t(Ar,{className:"form__header",position:"relative",sx:{background:"var(--primary-bg)",borderRadius:"4px",...p},children:[t(ai,{variant:"dense",children:[e(vt,{component:"div",variant:"h6",color:"primary",children:i}),Boolean(u)?e(vt,{component:"span",variant:"h6",color:"primary",px:1,sx:{...A},children:u}):null,Boolean(r)&&!Boolean(n)?e(gi,{style:{color:"white",marginLeft:"8px"},variant:"outlined",color:"primary",size:"small",label:Ge(`${r?.toLowerCase()}mode`)}):"",e("div",{className:h.formControlLabelSpacer}),d?null:"function"==typeof a?a({isSubmitting:l,handleSubmit:c,validationRunning:f}):a]}),!l&&Boolean(s)?e(to,{severity:"error",errorMsg:s,errorDetail:o}):null]}),yc=Ci(e=>({root:{"& .MuiTabs-indicator":{background:"var(--theme-color1)"},"& .MuiButtonBase-root.Mui-selected":{color:"#000"}}})),Bc=({fields:i,formRenderConfig:r,formName:n,children:a,formStyle:s,hidden:l,formDisplayLabel:h,displayMode:c,hideDisplayModeInTitle:u,wrapperChild:A,serverSentError:p,serverSentErrorDetail:f,isSubmitting:m,classes:g,handleSubmit:w,defaultActiveStep:b=0,hideHeader:v=!1,formHeaderStyle:y})=>{const[B,C]=d(b),{current:x}=o(Object.keys(i).sort());return t(dr,{component:"main",style:{display:l?"none":"block"},children:[v?null:e(Cc,{formDisplayLabel:h,displayMode:c,hideDisplayModeInTitle:u,wrapperChild:A,serverSentError:p,serverSentErrorDetail:f,isSubmitting:m,classes:g,handleSubmit:w,formHeaderStyle:y}),e(xc,{formName:n,fields:i,fieldGroups:x,formRenderConfig:r,activeStep:B,setActiveStep:C}),e("div",{style:{...s},children:e(Fc,{fields:i,fieldGroups:x,formRenderConfig:r,activeStep:B,tabsRenderer:a})})]})},Cc=({formDisplayLabel:i,displayMode:r,hideDisplayModeInTitle:n,wrapperChild:a,serverSentError:s,serverSentErrorDetail:o,isSubmitting:l,classes:h,handleSubmit:c,formHeaderStyle:d})=>t(Ar,{className:"form__header",position:"relative",color:"secondary",sx:d,children:[t(ai,{variant:"dense",children:[t(vt,{component:"div",variant:"h6",children:[i,Boolean(r)&&!Boolean(n)?e(gi,{style:{color:"white",marginLeft:"8px"},variant:"outlined",color:"primary",size:"small",label:`${r} mode`}):""]}),e("div",{className:h.formControlLabelSpacer}),"function"==typeof a?a({isSubmitting:l,handleSubmit:c}):a]}),!l&&Boolean(s)?e(to,{severity:"error",errorMsg:s,errorDetail:o}):null]}),xc=({fields:t,formName:i,fieldGroups:r,formRenderConfig:n,activeStep:a,setActiveStep:s})=>{const o=yc(),l=z(Ma(i)),{t:h}=W(),c=z(Oa(i)),d=r.map(e=>{let r="DefaultGroup";return"object"==typeof n.groups&&(r=h(n.groups[e])),{index:e,name:r,status:cc(i,t[e].fieldNames,l),hasError:dc(i,t[e].fieldNames,c)}}).filter(e=>e.status);return e(gr,{id:`tabform-main-tab-${i}`,value:Number(a),variant:"scrollable",scrollButtons:"auto",className:o.root,children:d.map(t=>e(wr,{id:`tabform-sub-tab-${a}-${t?.index}-${t?.name}`,value:Number(t.index),label:t.name,onClick:()=>s(Number(t.index)),style:t.hasError?{color:"red"}:{}},t.name))})},Fc=({fields:t,activeStep:i,fieldGroups:r,formRenderConfig:n,tabsRenderer:a})=>{const s=r.map((r,a)=>{const s=t[r];s.fields[0]=g(s.fields[0],{isFieldFocused:a===i});const o=a!==Number(i)?{display:"none"}:{};return e(q,{container:!0,spacing:n?.gridConfig?.container?.spacing??2,direction:n?.gridConfig?.container?.direction??"row",style:o,children:s.fields},r)});return e(f,{children:"function"==typeof a?a({steps:s}):e(w,{fallback:e("div",{children:"Loading..."}),children:s})})},Sc={currency:{render:{componentType:"numberFormat"},FormatProps:{thousandSeparator:!0,prefix:"",thousandsGroupStyle:"lakh",allowNegative:!0,allowLeadingZeros:!1,decimalScale:2,isAllowed:e=>!(e?.value?.length>10)&&0!==e.floatValue},isCurrencyField:!0,StartAdornment:"INR",enableNumWords:!0,maxLength:10},currencyWithoutWords:{render:{componentType:"numberFormat"},FormatProps:{thousandSeparator:!0,prefix:"",thousandsGroupStyle:"lakh",allowNegative:!1,allowLeadingZeros:!1,decimalScale:2,isAllowed:e=>!(e?.value?.length>10)&&0!==e.floatValue},isCurrencyField:!0,StartAdornment:"INR",enableNumWords:!1,maxLength:10},dob:{render:{componentType:"datePicker"},schemaValidation:{type:"date",rules:[{name:"typeError",params:["Must be a valid date"]},{name:"max",params:[ln(new Date,{years:18}),"minimum age must be 18 years"]},{name:"min",params:[ln(new Date,{years:100}),"maximum age must be 100 years"]}]}},phoneNumber:{render:{componentType:"numberFormat"},schemaValidation:{type:"string",rules:[{name:"required",params:["MobileNoisrequired"]},{name:"min",params:[11,"MobileNoshouldbe11digit"]},{name:"max",params:[11,"MobileNoshouldbe11digit"]}]},FormatProps:{format:"###########",allowNegative:!1,allowLeadingZeros:!0,valueIsNumericString:!0},StartAdornment:"+88"},panCard:{render:{componentType:"inputMask"},fullWidth:!0,MaskProps:{mask:"aaaaa0000a",prepare:function(e){return e.toUpperCase()},lazy:!0},schemaValidation:{type:"string",rules:[{name:"required",params:["This Field is required"]},{name:"pancard",params:["Please enter valid Pan Card Number"]}]}},panCardOptional:{render:{componentType:"inputMask"},MaskProps:{mask:"aaaaa0000a",prepare:function(e){return e.toUpperCase()},lazy:!0}},aadharCard:{render:{componentType:"inputMask"},fullWidth:!0,MaskProps:{mask:"0000` 0000` 0000",lazy:!0},schemaValidation:{type:"string",rules:[{name:"required",params:["This Field is required"]},{name:"aadhar",params:["Please enter valid Aadhar Number"]}]}},rateOfInt:{render:{componentType:"numberFormat"},className:"textInputFromRight",FormatProps:{suffix:"%",decimalScale:2,placeholder:"0",fixedDecimalScale:!0,allowNegative:!1,allowEmptyFormatting:!0},maxPercent:100},MonthlyEmiPayCurrency:{render:{componentType:"numberFormat"},FormatProps:{thousandSeparator:!0,prefix:"",thousandsGroupStyle:"lakh",allowNegative:!1,allowLeadingZeros:!1,decimalScale:0,maxLength:13,isAllowed:e=>null!==e.floatValue},isCurrencyField:!0,StartAdornment:"INR",enableNumWords:!0},pincode:{render:{componentType:"numberFormat"},schemaValidation:{type:"string",rules:[{name:"required",params:["Residence Pincode is required"]},{name:"min",params:[6,"Residence Pincode should be 6 digit."]},{name:"max",params:[6,"Residence Pincode should be 6 digit."]}]},FormatProps:{format:"######",isAllowed:e=>0!==e.floatValue}},futureDateNotAllowed:{render:{componentType:"datePicker"},schemaValidation:{type:"date",rules:[{name:"typeError",params:["Must be a valid date"]},{name:"max",params:[new Date,"Future Date not allowed."]}]}},minAge:{render:{componentType:"numberFormat"},schemaValidation:{type:"number",rules:[{name:"required",params:["Min Age is required"]},{name:"min",params:[25,"Min age should be 25 years"]}]},FormatProps:{format:"##"}},maxAge:{render:{componentType:"numberFormat"},schemaValidation:{type:"number",rules:[{name:"required",params:["Max Age is required"]},{name:"max",params:[65,"Max age should be 65 years"]}]},FormatProps:{format:"##"}},rateOfIntWithoutValidation:{render:{componentType:"numberFormat"},FormatProps:{suffix:"%",decimalScale:2,fixedDecimalScale:!0,allowNegative:!0,allowEmptyFormatting:!0,isAllowed:e=>!(e.floatValue>=999.99)}},rateOfIntUptoThreeDigits:{render:{componentType:"numberFormat"},FormatProps:{suffix:"%",decimalScale:2,fixedDecimalScale:!0,allowNegative:!0,allowEmptyFormatting:!0,isAllowed:e=>!(e.floatValue<999.99)}},squareFeetFormat:{render:{componentType:"numberFormat"},FormatProps:{thousandSeparator:!0,thousandsGroupStyle:"lakh",allowNegative:!1,allowLeadingZeros:!1,isAllowed:e=>!(e?.value?.length>20)&&0!==e.floatValue},maxLength:20,showMaxLength:!1},currencyWithLeadingZeros:{render:{componentType:"numberFormat"},FormatProps:{thousandSeparator:!0,prefix:"",thousandsGroupStyle:"lakh",allowNegative:!0,allowLeadingZeros:!1,decimalScale:2,isAllowed:e=>!(e?.value?.length>10)},isCurrencyField:!0,StartAdornment:"INR",enableNumWords:!0,maxLength:10},pincodeNoValidation:{render:{componentType:"numberFormat"},FormatProps:{format:"######",isAllowed:e=>0!==e.floatValue}},amountField:{render:{componentType:"numberFormat"},className:"textInputFromRight",FormatProps:{thousandSeparator:!0,prefix:"",thousandsGroupStyle:"lakh",allowNegative:!1,allowLeadingZeros:!1,decimalScale:2,fixedDecimalScale:!0,placeholder:"0.00"},enableNumWords:!1,isCurrencyField:!0,StartAdornment:"INR",maxLength:15,showMaxLength:!1},accountNumber:{render:{componentType:"textField"},fullWidth:!0,inputProps:{onChange:function(e){const t=e.target.value.replace(/[^0-9]/g,"");e.target.value=t}},maxLength:20,showMaxLength:!0},loginID:{render:{componentType:"textField"},fullWidth:!0,inputProps:{onChange:function(e){const t=e.target.value.replace(/[^a-zA-Z0-9]/g,"");e.target.value=t}},maxLength:16,showMaxLength:!0},Percentage:{render:{componentType:"numberFormat"},className:"textInputFromRight",FormatProps:{allowNegative:!1,allowLeadingZeros:!0,decimalScale:2,isAllowed:e=>!(e?.value?.length>5)&&!(parseFloat(e?.value)>100)},maxLength:5,showMaxLength:!0,EndAdornment:"%"}},Nc=c(({metaData:t,initialValues:i,previousValues:r,onSubmitHandler:n=()=>console.log("onSubmitHandler is not passed"),hidden:a=!1,displayMode:s,hideTitleBar:l=!1,hideDisplayModeInTitle:c=!1,formStyle:d={background:"white",height:"calc(100vh - 230px)",overflowY:"auto",overflowX:"hidden"},controlsAtBottom:u=!1,children:A,formState:p,defaultActiveStep:f,hideHeader:m=!1,containerstyle:g={padding:"10px"},onFormButtonClickHandel:w=e=>{},onFormDataChange:b=()=>{},subHeaderLabel:v,subHeaderLabelStyle:y,setDataOnFieldChange:B=(e,t)=>{},formHeaderStyle:C={},enableEnterToFocus:x,focusScopeId:F="enter-to-focus-form",setValidationRunning:S},E)=>{const{t:k}=W(),T=ns(),{authState:L}=es();let I=N(t);I=oc(I,Sc,k,L,T,p),I=sc(I),I=lc(I);const D=Yh(I,w,b,F),U=((e,t,i={},r={},n=2)=>{if(!Array.isArray(e))return{};let a={};for(const s of e){const{defaultValue:e,name:o,isCurrencyField:l}=s,h="function"==typeof e?e(i,r??{}):e,c=ka(t,o,void 0);null!=c?a=Ta(a,o,l&&c?String(c).includes(".")?c:Number(c).toFixed(n):c):null!=h&&(a=Ta(a,o,"datetimePicker"===s.render.componentType?new Date(h):h))}return a})(I.fields,i,p,L,T.decimalCount),P=((e,t)=>{if(!Array.isArray(e))return{};let i={};for(const r of e){const{name:e}=r,n=ka(t,e,void 0);null!=n&&(i=Ta(i,e,n))}return i})(I.fields,r),R=((e,t={},i={})=>{if(!Array.isArray(e))return{};const r={};for(const n of e){const{name:e,_fields:a}=n;if(Array.isArray(a)){let n=Zh(a,t,i);r[e]=n}}return r})(I.fields,p,L),O=ec(I.fields),Q=I.form.name??"NO_NAME",H=o(null),M=x??T.enableEnterToFocus,_=F&&M?{"data-scope-id":F}:{};h(()=>{M&&H.current&&H.current.focus()},[M]);const j=o(new Map),z=o(new Map),V=o(null);return e(Qi,{dateAdapter:Hi,children:e(Ya.Provider,{value:{formName:Q,resetFieldOnUnmount:Boolean(I.form.resetFieldOnUnmount),validationRun:I.form.validationRun,initialValues:U,previousValues:P,defaultArrayFieldValues:R,validationSchema:O,lastValidationValue:j,flagRef:z,setCurrentStepIndexFnRef:V.current,formState:{formCode:I.form.name,refID:I.form.refID,setDataOnFieldChange:B,...I.form?.formState,...p}},children:e("div",{ref:H,tabIndex:M?0:-1,style:{width:"100%"},onKeyDown:e=>{M&&Es(e,F)},..._,children:e(Ec,{ref:E,formName:Q,formDisplayLabel:I?.form?.label?k(I?.form?.label):Ss(window.location.pathname,L?.menulistdata,I?.form?.setScreenCode??!0,I?.form?.showUserCode??!1),formRenderType:I.form.render.renderType??"simple",formRenderConfig:I.form.render,submitFn:n,hidden:a,displayMode:s,groupWiseFields:D,hideTitleBar:l,hideDisplayModeInTitle:c,wrapperChild:A,formStyle:d,controlsAtBottom:u,defaultActiveStep:f,hideHeader:m,containerstyle:g,subHeaderLabel:v,subHeaderLabelStyle:y,formHeaderStyle:C,setValidationRunning:S})})})})}),Ec=c(({formName:i,formDisplayLabel:r,formRenderType:n,formRenderConfig:a,submitFn:s,hidden:o,displayMode:l,groupWiseFields:c,hideTitleBar:d,hideDisplayModeInTitle:u,wrapperChild:A,formStyle:f,controlsAtBottom:m,defaultActiveStep:g,hideHeader:b,containerstyle:v={},subHeaderLabel:y,subHeaderLabelStyle:B,formHeaderStyle:C,setValidationRunning:x},F)=>{const{handleSubmit:S,handleSubmitPartial:N,serverSentError:E,serverSentErrorDetail:k,isSubmitting:T,getFieldData:L,setFieldData:I,handleReset:D,handleClear:U,validationRunning:P}=Ls({onSubmit:s,readOnly:"view"===l}),R=hc();return p(F,()=>({handleSubmit:S,formDisplayLabel:r,getFieldData:L,setFieldData:I,handleFormReset:D,handleFormClear:U})),h(()=>{"function"==typeof x&&x(P)},[P,x]),"stepper"===n?e(Ac,{fields:c,formRenderConfig:a,formName:i,handleSubmit:S,handleSubmitPartial:N,formDisplayLabel:r,hidden:o,defaultActiveStep:g,classes:R,wrapperChild:A,isSubmitting:T,serverSentError:E,serverSentErrorDetail:k},`${i}-grouped-stepper`):"tabs"===n?e(Bc,{fields:c,formRenderConfig:a,formName:i,formStyle:f,formDisplayLabel:r,hidden:o,displayMode:l,hideDisplayModeInTitle:u,wrapperChild:A,serverSentError:E,serverSentErrorDetail:k,isSubmitting:T,classes:R,handleSubmit:S,defaultActiveStep:g,hideHeader:b,formHeaderStyle:C,children:({steps:i})=>t("div",{children:[e("br",{}),e(w,{fallback:e("div",{children:"Loading..."}),children:i})]})},`${i}-grouped-tabs`):"simple"===n?e(wc,{formStyle:f,fields:c,formRenderConfig:a,formName:i,formDisplayLabel:r,hidden:o,displayMode:l,hideDisplayModeInTitle:u,wrapperChild:A,serverSentError:E,serverSentErrorDetail:k,isSubmitting:T,classes:R,handleSubmit:S,controlsAtBottom:m,hideHeader:b,containerstyle:v,subHeaderLabel:y,subHeaderLabelStyle:B,formHeaderStyle:C,validationRunning:P}):t("div",{children:["RenderType ",n," not available"]})}),kc=({children:r,...n})=>{const{value:a,cell:s,column:{color:o="initial",TableCellProps:l,isGroupSum:h},row:c,index:d}=n;let u="function"==typeof o?o(a):o,A={};c?.isGrouped&&c?.isExpanded&&(A={...A,fontWeight:800});let p=r;return s?.isGrouped?p=t(i,{children:[e(C,{...c.getToggleRowExpandedProps([{style:{padding:0}}]),children:c.isExpanded?e(vr,{}):e(br,{})}),r,t("i",{children:["(",c.subRows.length,")"]})]}):s?.isAggregated&&h?p=r:s?.isPlaceholder&&(p=null),e(ci,{component:"td",variant:"head",...s?.getCellProps?.([{...l??{}},{style:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",paddingRight:"20px",paddingTop:0,paddingBottom:0,paddingLeft:0===d?"10px":"0px",lineHeight:"34px",color:u,textAlign:s?.column?.alignment??"unset",...A}}]),children:p})},Tc=t=>{const{commonDateTimeFormat:i}=ns(),{value:r,column:{format:n},isAdvanceFilter:a=!1}=t;let s="00/00/0000 00:00:00",o=new Date(r);return isNaN(o)||(s=ze(new Date(r),(Boolean(n)?n:i)||"dd/MM/yyyy HH:mm:ss")),a?s:e(kc,{...t,children:s})},Lc=t=>{const{commonDateFormat:i}=ns(),{value:r,column:{format:n},isAdvanceFilter:a=!1}=t;if(null==r||""===r)return a?null:e(kc,{...t});const s=new Date(r);if(isNaN(s.getTime()))return a?null:e(kc,{...t});const o=ze(s,(Boolean(n)?n:i)||"dd/MM/yyyy");return a?o:e(kc,{...t,children:o})},Ic=t=>{const{value:i}=t;return e(kc,{...t,children:i})},Dc=({name:i,validate:r,validationRun:n,shouldExclude:a,isReadOnly:c,postValidationSetCrossFieldValues:A,runPostValidationHookAlways:p,dependentFields:f,fieldKey:m,options:g,MenuItemProps:w,SelectProps:b,GridProps:v,enableGrid:y,multiple:C,showCheckbox:x,isFieldFocused:F,InputProps:S,inputProps:N,CircularProgressProps:E,runValidationOnDependentFieldsChange:k,setValueOnDependentFieldsChange:L,setValueOnDependentFieldsValueChange:I,skipValueUpdateFromCrossFieldWhenReadOnly:D,_optionsKey:U,disableCaching:P,skipDefaultOption:R,defaultOptionLabel:O,enableDefaultOption:Q,runExternalFunction:H,onFormDataChange:M,ignoreInSubmit:_=!1,AlwaysRunPostValidationSetCrossFieldValues:j,label:z,setFieldLabel:V,placeholder:X,defaultValueKey:Y,componentType:$,runPostValidationForInitValue:Z,className:ee,filterOptionsCb:te,focusScopeId:ie,...re})=>{const[ne,ae]=d(v),{value:se,prevValue:oe,error:he,touched:ce,handleChange:de,handleBlur:ue,runValidation:Ae,validationRunning:pe,isSubmitting:fe,fieldKey:me,name:ge,dependentValues:we,excluded:be,incomingMessage:ve,whenToRunValidation:ye,readOnly:Be,formState:Ce,setIncomingMessage:xe,handleOptionValueExtraData:Fe,setDisplayValue:Se,setIgnoreInSubmit:Ne,setFilteredOptions:Ee,...ke}=as({name:i,fieldKey:m,dependentFields:f,validate:r,validationRun:n,runPostValidationHookAlways:p,postValidationSetCrossFieldValues:A,isReadOnly:c,shouldExclude:a,runValidationOnDependentFieldsChange:k,skipValueUpdateFromCrossFieldWhenReadOnly:D,runExternalFunction:H,onFormDataChange:M,AlwaysRunPostValidationSetCrossFieldValues:j,componentType:$,runPostValidationForInitValue:Z}),Te=o(),[Le,Ie]=d([]),[De,Ue]=d([]),Pe=l(e=>{Ie(e),Ue(e),Ee(e)},[Ue,Ie,Ee]);h(()=>{if("function"!=typeof te)return;const e=te(De,ds(we),Ce)??De;Ie(e),Ee(e)},[we,Ce,De,te,Ee]),h(()=>{if(Boolean(_))if("function"==typeof _){let e=_(ds(we),Ce,{isSubmitting:fe,value:se});Ne(e)}else Ne(_)},[_,Ne,we,se]),h(()=>{F&&setTimeout(()=>{Te?.current?.focus?.()},1)},[F]);const Re=l(e=>Fo(Le)(e),[Le]),Oe=l(e=>So(Le)(e),[Le]),Qe=l((e,t=void 0,i=!1,r={},n=!1)=>{let a="object"==typeof e?e?.target?.value??"":e;if(Array.isArray(a)&&(a=a.filter(e=>""!==e)),Array.isArray(a)&&C){let e=a.indexOf("00");if(e>=0?a.splice(e,1):0!==a.length||R||(a=["00"]),"all"===a[a.length-1]){let e=[],t=[];if(Le.filter(e=>" "!==e.value).length===a.filter(e=>"all"!==e).length)de(["00"],[Boolean(O)?O:"Select Option"],i,r,n);else{for(let i=0;i<Le.length;i++)"00"!==Le[i].value&&" "!==Le[i].value&&(e.push(Le[i].value),t.push(Le[i].label));de(e,t,i,r,n)}return}}let s=Re(a),o=Oe(a);const l=Boolean(o?.[0]?.isDefaultOption);s=C?s:s[0],Fe(o),l&&(e.target.value=e.target?.value?.trim?.()),de(C?a:e,s)},[de,Re,C,R]),He=l(()=>{let e=Oe(se);Fe(e),ue()},[ue,Oe,Fe,se]),Me=s(()=>{const e=ds(we),t=us(e);return JSON.stringify(t.sort((e,t)=>e.fieldKey.localeCompare(t.fieldKey)).map(e=>e.value))},[we]);h(()=>{if(Me&&"function"==typeof I){let e=I(ds(we),Ce,{value:se,isSubmitting:fe});null!=e&&Qe(e)}},[Me,I,de]),h(()=>{if("function"==typeof L){let e=L(ds(we),Ce,{value:se,isSubmitting:fe});null!=e&&Qe(e)}},[we,Qe,L]),h(()=>{if(se&&Array.isArray(Le)&&Le.length>0){let e=Re(se);e=C?e:e[0],Se(e)}},[Se,Le]);const _e=Le.filter(e=>"00"!==e.value),je=Array.isArray(se)?se.filter(e=>"00"!==e):[],ze=!!C&&_e.length===(se?.length??-1/0),Ve=C&&je.length>0&&je.length<_e.length,{loadingOptions:Ke}=Bo(Ce,g,Pe,Qe,we,ve,Ae,ye,U,P,xe,R,O,Q,e=>{const t={...v,xs:e?.xs??v?.xs??"auto",md:e?.md??v?.md??"auto",xl:e?.xl??e?.md??v?.xl??"auto",sm:e?.sm??v?.sm??"auto",lg:e?.lg??e?.md??v?.lg??"auto"};ae(t)}),{t:qe}=W();h(()=>{let e=Oe(se);Fe(e)},[Ke,Oe,Fe]);const Ge=s(()=>{if("function"==typeof V)return V(ds(we),se)},[V,we,se]);if(h(()=>{if(!Y||se||Ke)return;const e=Le.find(e=>e[Y]===e.value);e&&(Qe({target:e}),setTimeout(()=>{He()},0))},[Ke,Le]),be)return null;const We=ce&&""!==(he??""),Je=Le.map((t,i)=>u(K,{...w,key:t.value??i,value:t.value,disabled:t.disabled,sx:{"&.Mui-selected:not(.Mui-disabled)":{background:"#eee !important",fontWeight:"500","&:hover":{background:"#eee"}}}},x&&!t.disabled?e(go,{checked:Boolean(C)?Array.isArray(se)&&se.indexOf(t.value)>=0:se===t.value}):null,t.label)),Xe=t(K,{value:"all",children:[e(go,{checked:ze,indeterminate:Ve,color:"secondary"}),qe("SelectAll")]},"selectAll"),Ye=u(Ao,{...re,label:Ge?.label?qe(Ge.label):z,select:!0,key:me,id:me,className:J(ee,{hasOldValue:void 0!==oe&&void 0!==se&&!T.isEqual(oe,se)}),name:ge,value:C&&!Array.isArray(se)?[se]:Boolean(se)?se:"string"==typeof se?" ":se,error:!fe&&We,helperText:e(le,{children:!fe&&We?he:null}),onChange:Qe,onBlur:He,disabled:fe||Be,SelectProps:{...b,native:!1,multiple:C,MenuProps:{MenuListProps:{onKeyDown:e=>{if("Enter"!==e.key)return;const t=e.currentTarget;Array.from(t.querySelectorAll('[role="option"], .MuiMenuItem-root')).some(e=>"true"!==e.getAttribute("aria-disabled"))||(e.preventDefault(),e.stopPropagation(),t.dispatchEvent(new KeyboardEvent("keydown",{key:"Escape",bubbles:!0})),requestAnimationFrame(()=>{ks(e.shiftKey,ie,document.activeElement,!0)}))}}},renderValue:C?Fo(Le,!0):void 0,SelectDisplayProps:{onKeyDownCapture:e=>{"Enter"===e.key&&(e.preventDefault(),e.stopPropagation(),ks(e.shiftKey,ie,e.currentTarget,!0))}}},InputLabelProps:{shrink:!0},inputRef:Te,InputProps:{style:{background:Boolean(Be||fe)?"#f3f3f3":""},endAdornment:pe||Ke?e(B,{position:"end",children:e(G,{color:"secondary",variant:"indeterminate",size:24,...E})}):null,...S},onMouseDown:e=>{(fe||Be)&&(e.preventDefault(),e.stopPropagation())},inputProps:{readOnly:Be,tabIndex:fe||Be?-1:void 0,...N}},C&&x?[Xe,...Je]:Je),$e=void 0===oe||void 0===se||T.isEqual(oe,se)?Ye:e(Jo,{title:e(Xo,{label:`${qe("OldValueOf")} ${Ge?.label?qe(Ge.label):z}`,value:oe?Re(oe)??oe:"(blank)"}),arrow:!0,followCursor:!0,children:Ye});return Boolean(y)?e(q,{...ne,children:$e}):$e};var Uc=Object.freeze({__proto__:null,Select:Dc,SelectRenderOnly:Do,default:Dc});const Pc=n(null),Rc=({children:t})=>{const[i,r]=d(1);return e(Pc.Provider,{value:{divider:i,setDivider:r},children:t})},Oc=()=>{const e=a(Pc);if(!e)return null;const{divider:t}=e;return t},Qc=[{label:"Default",value:1},{label:"Lakhs",value:1e5},{label:"Crore",value:1e7}],Hc=()=>{const{setDivider:t,divider:i}=a(Pc);return e(Do,{label:"Amount In",size:"small",touched:!0,error:"",value:i,handleChange:e=>t(e.target.value),handleBlur:()=>!0,options:Qc,_optionsKey:"amountIn",selectVariant:"default",style:{width:"120px",margin:"0px 16px",color:"white"},InputLabelProps:{style:{color:"white"}}})};const Mc=({rows:e,column:{id:t,isTotalWithoutCurrency:i=!1,isTotalWithCurrency:r=!1,currencyRefColumn:n,isCurrencyCode:a,currencySymbolPosition:o="start"},loading:l,data:h,...c})=>{const{dynamicAmountSymbol:d,currencyFormat:u,decimalCount:A}=ns(),p=s(()=>h.reduce((e,i)=>l?0:Number("null"===i?.[t]?0:i?.[t])+e,0),[h,t,l]);let f=$o(d??"INR");a?Boolean(n)&&(f=$o(n)):Boolean(n)&&(f="");const m=Oc();let g=" ";return null===p||""===p||isNaN(Number(p))||(g=r?`${function(e,t,i,r,n="start"){const a=new Intl.NumberFormat(i,{minimumFractionDigits:r}).format(e);return"end"===n?`${a} ${t}`:`${t} ${a}`}(p.toFixed(2)/m,f,u,A,o)}`:i?p.toFixed(2):""),g},_c=({rows:t,column:{id:i,isDisplayValueTotal:r=!1,currencyRefColumn:n,isCurrencyCode:a,DisplayValueLabel:o}})=>{const l=s(()=>{const e=new Map;return t.forEach(t=>{const r=String(t.values?.[i]);if(void 0!==r){const t=e.get(r)||0;e.set(r,t+1)}}),e},[t,i]);if(r){const t=Array.from(l).map(([t,i])=>e("div",{children:`${t}: ${i}`},t));if("string"==typeof o)return t;if("object"==typeof o&&null!==o){return Array.from(l).map(([t,i])=>e("div",{children:`${o[t]} : ${i}`},t))}return t}},jc=t=>{const{t:i}=W(),{value:r,row:{index:n,original:a},column:{id:o,buttonLabel:l,columnName:h,isVisible:c,isVisibleInNew:d=!1,shouldExclude:u,setButtonName:A},onButtonActionHandel:p}=t,f=s(()=>Boolean(a?._isNewRow)?d:c,[c,a?._isNewRow]),m=s(()=>"function"==typeof u&&u(r,a),[r,a]),g=s(()=>"function"==typeof A?A(r,a):null,[r,a]),w=Boolean(g)?g:h;return e(ho,m?{...t}:{...t,children:f?e(ct,{onClick:e=>{"function"==typeof p&&p(n,o)},fullWidth:!0,variant:"contained",color:"secondary",style:{height:"28px"},children:Boolean(l)?i(l):i(w)}):null})},zc=i=>{const{column:r,initialState:n}=i,a=(n?.groupBy??[]).includes(r?.id);return t(f,{children:[e(zi,{active:r.isSorted,direction:r.isSortedDesc?"desc":"asc",hideSortIcon:!0,...r.getSortByToggleProps([{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"flex",color:"var(--theme-color1)",fontSize:"1 rem",fontWeight:"600",paddingRight:"right"===(r?.TableCellProps?.align??r.alignment??"left")&&r.canFilter?"10px":"4px"}}]),children:e("span",{title:r.columnName,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r.Cell!==jc||r?.showColumnName?r.columnName:null})}),r.canGroupBy?e(oe,{sx:{marginLeft:"right"!==r.alignment?"auto":0,marginRight:"right"===r.alignment?"auto":0},children:e("span",{...a?{}:r.getGroupByToggleProps(),children:r.isGrouped?"🔴":"➕"})}):null,e("div",{...r.getResizerProps([{style:{opacity:1,color:"rgba(224, 224, 224, 1)",right:"0px",display:"flex",zIndex:100,position:"absolute",flexDirection:"column",justifyContent:"center"}}]),children:e("svg",{focusable:"false",viewBox:"0 0 24 24","aria-hidden":"true","data-testid":"SeparatorIcon",style:{color:"inherit",userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:"currentColor",flexShrink:0,transition:"fill 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",fontSize:"20px"},children:e("path",{d:"M11 19V5h2v14z"})})})]})};const Vc=t=>{const{dynamicAmountSymbol:i,currencyFormat:r,decimalCount:n}=ns(),{value:a,cell:s,row:o,column:{isVisibleCurrSymbol:l=!0,isCurrencyCode:h,currencyRefColumn:c,currencySymbolPosition:d,isGroupSum:u},isAdvanceFilter:A=!1}=t,p=s?.isAggregated;let f=a;p&&u&&(f=o?.values?.[s.column.id]);let m=$o(i??"INR");if(h)Boolean(c)&&(m=$o(c));else if(Boolean(c)){m=$o(o?.original?.[c]??c)}const g=Oc();if(null==f||""===f)return A?"":e(kc,{...t,children:""});if(isNaN(Number(f)))return A?"":e(kc,{...t,children:""});const w=function(e,t,i="en-IN",r=0,n="start"){const a=new Intl.NumberFormat(i,{minimumFractionDigits:r}).format(e);return"end"===n?t?`${a} ${t}`:a:t?`${t} ${a}`:a}(Number(f)/g,l?m:"",r??"en-IN",n??2,d??"start");return A?w:e(kc,{...t,children:w})};let Kc=new Intl.NumberFormat("en-IN",{minimumFractionDigits:2,style:"currency",currency:"INR"});const qc=t=>{const{commonTimeFormat:i}=ns(),{value:r,column:{format:n}}=t;let a="-",s=new Date(r);return isNaN(s)||(a=ze(new Date(r),n??i??"HH:mm:ss")),e(kc,{...t,children:a})};var Gc=Object.freeze({__proto__:null,ButtonRowCell:jc,DateCell:Lc,DateTimeCell:Tc,DefaultCell:Ic,DefaultCellWithDefaultValue:t=>i=>e(kc,{...i,children:t}),FooterCell:Mc,FooterCell1:_c,FooterCellWithNumber:e=>{const{rows:t,column:{id:i}}=e,r=s(()=>t.reduce((e,t)=>Number(t.values?.[i]??0)+e,0),[t,i]);return`${isNaN(r)?"":Kc.format(r)}`},HeaderColumnCell:zc,NumberCell:Vc,NumberCell2:t=>{const{value:i}=t;let r="-";return null===i||""===i||isNaN(Number(i))||(r=`${i}`),e(kc,{...t,children:r})},TimeCell:qc});const Wc=({title:e,columns:t,rows:i,columnsSelected:r,data:n,auth:a,retrievalParams:s,filters:o,globalFilter:l,columnLabel:h,banklogo:c,pageNumber:d,totalPageCount:u,primaryTheme:A})=>{const p=["a6"].includes(n.PAGE_SIZE.toLowerCase()),f={DEFAULT:"#000",THEME:A,SMALL_TEXT:p?5:7,DEFAULT_TEXT:p?8:16,HEADING_TEXT:p?10:12};let m=5;const g=new jspdf.jsPDF({orientation:n.ORIENTATION,unit:"mm",format:n.PAGE_SIZE,compress:!0}),w=g.internal.pageSize.width,{fromDt:b,toDt:v}=getRetrievalParaDate(s);function y(e=f.DEFAULT){g.setFontSize(f.DEFAULT_TEXT),g.setTextColor(e),g.setFont(void 0,"normal")}const B=`${e} ${getTitleFilters(s,o,l,h)}`;t=t.filter(e=>r.includes(e.id));const C=getDynamicRow(i,t,"PDF");const x=t.map(e=>e.cname),F=C.map(e=>Object.values(e));B.length>w?m+=25:m+=20;const S="Y"===n.SHOW_HEADER||!0===n.SHOW_HEADER,N="Y"===n.ALL_PAGE_HEADER||!0===n.ALL_PAGE_HEADER,E=p?30:45,k=dateFns.format(Date.now(),"DD/MM/YYYY HH:mm:ss");g.autoTable({head:[x],headStyles:{fillColor:f.THEME},body:F,styles:{fontSize:p?3.5:6,cellPadding:p?{top:.5,bottom:.5,left:1,right:1}:{top:1,bottom:1,left:2,right:2}},margin:{top:S&&N?E:15},startY:S&&N?E:p?S?m+5:15:S?m+20:15,tableWidth:"a6"===n?.PAGE_SIZE?"wrap":"auto",didDrawPage:function(e){const t=e.table.pageNumber;S&&(N||1===t)&&function(e,t={value:i}){let i=t.value;e.addImage(c,"JPG",10,i,"a6"===n.PAGE_SIZE||"a5"===n.PAGE_SIZE?18:32,"a6"===n.PAGE_SIZE||"a5"===n.PAGE_SIZE?9:18),e.setFontSize("a6"===n.PAGE_SIZE?f.SMALL_TEXT:f.HEADING_TEXT),e.setTextColor(f.THEME);const r=a?.companyName??"",s=w/2,o=i+10;if("landscape"===n?.ORIENTATION?.toLowerCase()&&p||"portrait"===n?.ORIENTATION?.toLowerCase()&&["a4","a5","a6"].includes(n.PAGE_SIZE.toLowerCase())){const t=e.splitTextToSize(r,p?40:100);e.text(t,s,o,{align:"center"})}else e.text(r,s,o,{align:"center"});p?e.setFontSize(4):e.setFontSize(8);const l=a?.user?.branchCode&&a?.user?.branch?`Branch: ${a?.user?.branchCode}- ${a?.user?.branch}`:"",h=a?.workingDate?`Working date: ${dateFns.format(new Date(a?.workingDate),"DD/MM/YYYY")}`:"",d=w/2-e.getTextWidth(l)/2,u=w/2-e.getTextWidth(h)/2;if(e.text(l,d,p?i+15:i+22),e.text(h,u,p?i+17:i+26),"a6"===n.PAGE_SIZE?i+=5:i+=20,y(),e.setFontSize("a6"===n.PAGE_SIZE?4:8),e.setTextColor(f.DEFAULT),B.length>w-80){const t=e.splitTextToSize(B,w-30);e.text(t,15,p?i+15:i+11)}else{const t=w/2-e.getTextWidth(B)/2;e.text(B,t,p?i+15:i+11)}}(g,{value:5}),g.setFontSize(f.SMALL_TEXT),g.setTextColor(150),g.text(`Printed On: ${k}`,p?w-32:w-42,10)}}),(e=>{const t=e.internal.getNumberOfPages();e.setFontSize(f.SMALL_TEXT),e.setTextColor(150),e.setFont(void 0,"normal");for(let i=1;i<=t;i++){e.setPage(i);const r=e.internal.pageSize.width,n=e.internal.pageSize.height;e.text(`Generated by- ${a?.user?.id||"Unknown"}`,10,n-10);const s=`Page ${i} of ${t}`,o=e.getTextWidth(s);e.text(s,r-10-o,n-10)}})(g);const T=g.output("datauristring");return b||v?{downloadTitle:`${e} ${b}-${v}-${n.ORIENTATION}.pdf`,blob:T}:{downloadTitle:`${e}-${n.ORIENTATION}.pdf`,blob:T}},Jc=({title:e,columns:t,rows:i,columnsSelected:r,data:n,auth:a,retrievalParams:s,filters:o,globalFilter:l,columnLabel:h,pageNumber:c,totalPageCount:d,primaryTheme:u})=>{const A={bg:u.substring(1),white:"ffffff"};t=t.filter(e=>r.includes(e.id));const{fromDt:p,toDt:f}=getRetrievalParaDate(s);return XlsxPopulate.fromBlankAsync().then(r=>{const u=r.sheet(0);let m=1;if("Y"===n.SHOW_HEADER||!0===n.SHOW_HEADER){u.row(1).height(30),u.freezePanes(0,5),u.range(m,1,m,t.length).merged(!0);u.cell("A1").value(a?.companyName).style({bold:!0,fontSize:18,horizontalAlignment:"center",verticalAlignment:"center",fill:A.bg,fontColor:A.white}),m+=1;const e=a?.user?.branchCode&&a?.user?.branch?`Branch: ${a?.user?.branchCode}- ${a?.user?.branch}`:"",i=a?.workingDate?`Working date: ${dateFns.format(new Date(a?.workingDate),"DD/MM/YYYY")}`:"";u.range(m,1,m,t.length).merged(!0).style({border:!0});u.cell(`A${m}`).value(`${e} | ${i}`).style({bold:!0,fontSize:12,horizontalAlignment:"center",fontColor:A.bg}),m+=1}else u.freezePanes(0,3);let g=getTitleFilters(s,o,l,h);u.range(m,1,m,t.length).merged(!0).style({border:!0});u.cell(`A${m}`).value(`${e}`).style({bold:!0,fontSize:12,horizontalAlignment:"center",fontColor:A.bg}),u.range(m+1,1,m+1,t.length).merged(!0).style({border:!0,wrapText:!0});u.cell(`A${m+1}`).value(`${g}`).style({bold:!0,fontSize:12,horizontalAlignment:"center",fontColor:A.bg}),m+=2;t.map(e=>e.cname).forEach((e,t)=>{u.cell(m,t+1).value(e).style({bold:!0,border:!0})});const w=getDynamicRow(i,t,"EXCEL");w.forEach((e,i)=>{Object.entries(e).forEach(([e,r],n)=>{const a=t.find(t=>t[e]&&"currency"===t.cellType)?"right":"left";u.cell(i+m+1,n+1).value(r).style({border:!0,horizontalAlignment:a})})}),m+=w.length+3;if(u.cell(m,1).value("Generated by").style({bold:!0,border:!0}),u.cell(m,2).value(a?.user?.id).style({border:!0}),"number"==typeof c&&(m+=1,u.cell(m,1).value("Page").style({bold:!0,border:!0}),u.cell(m,2).value(`${c+1} of ${d}`).style({border:!0})),m+=1,u.cell(m,1).value("Printed on").style({bold:!0,border:!0}),u.cell(m,2).value(dateFns.format(new Date,"DD/MM/YYYY HH:mm:ss")).style({border:!0}),"EXCEL"===n.EXPORT_TYPE){const e=Object.keys(w[0]),t=e.map((t,i)=>{let r=8;for(let t=0;t<w.length;t++){const n=(w[t][e[i]]||"").toString().trim();n.length>r&&(r=n.length)}return r}),i=4;e.forEach((e,r)=>{u.column(r+1).width(t[r]+i)})}return r.outputAsync().then(t=>p||f?{downloadTitle:`${e} ${p}-${f}.xlsx`,blob:t}:{downloadTitle:`${e}.xlsx`,blob:t})})},Xc=({title:e,columns:t,rows:i,columnsSelected:r,data:n,auth:a,retrievalParams:s,filters:o,globalFilter:l,columnLabel:h})=>{let c="";t=t.filter(e=>r.includes(e.id));const{fromDt:d,toDt:u}=getRetrievalParaDate(s);let A=getTitleFilters(s,o,l,h);const p=t.map(e=>e.cname),f=getDynamicRow(i,t,"CSV");c+=Papa.unparse([[`${e} ${A}`]])+"\r\n"+Papa.unparse([p])+"\r\n"+Papa.unparse(f,{header:!1});const m=new Blob([c],{type:"text/csv"});return d||u?{downloadTitle:`${e} ${d}-${u}.csv`,blob:m}:{downloadTitle:`${e}.csv`,blob:m}},Yc=({title:e,columns:t,rows:i,columnsSelected:r,data:n,auth:a,retrievalParams:s,filters:o,globalFilter:l,columnLabel:h})=>{t=t.filter(e=>r.includes(e.id));const{fromDt:c,toDt:d}=getRetrievalParaDate(s),u=t.map(e=>e.cname),A=getDynamicRow(i,t,"TEXT");let p="";u.forEach(e=>{p+=`${e}\t`}),p+="\n",A.forEach(e=>{Object.values(e).forEach(e=>{p+=`${e}\t`}),p+="\n"});const f=new Blob([p],{type:"text/plain"});return c||d?{downloadTitle:`${e} ${c}-${d}.txt`,blob:f}:{downloadTitle:`${e}.txt`,blob:f}},$c=({title:e,columns:t,rows:i,columnsSelected:r,data:n,auth:a,retrievalParams:s,filters:o,globalFilter:l,columnLabel:h,primaryTheme:c})=>{t=t.filter(e=>r.includes(e.id));const{fromDt:d,toDt:u}=getRetrievalParaDate(s);let A=getTitleFilters(s,o,l,h);const p=t.map(e=>e.cname),f=getDynamicRow(i,t,"HTML"),m=a?.user?.branchCode&&a?.user?.branch?`Branch: ${a?.user?.branchCode}- ${a?.user?.branch}`:"",g=a?.workingDate?`Working date: ${dateFns.format(new Date(a?.workingDate),"DD/MM/YYYY")}`:"";let w=`\n <header>\n ${"Y"===n.SHOW_HEADER||!0===n.SHOW_HEADER?`<h1>${a?.companyName}</h1>`:""}\n ${"Y"===n.SHOW_HEADER||!0===n.SHOW_HEADER?`<p class="branch-title">${m} | ${g}</p>`:""}\n <p class="report-title">${e} ${A}</p>\n </header>\n <table><thead><tr>`;p.forEach(e=>{w+=`<th>${e}</th>`}),w+="</tr></thead><tbody>",f.forEach(e=>{const i=Object.entries(e);w+="<tr>",i.forEach(([e,i])=>{void 0===i&&(i="");const r=t.find(t=>t[e]&&"currency"===t.cellType)?"right":"left";w+=`<td style="text-align: ${r}">${i}</td>`}),w+="</tr>"}),w+="</tbody></table></div>",w=`\n <style>\n body {\n font-family: sans-serif;\n overflow-x: auto\n }\n header {\n text-align: center\n }\n h1, .branch-title {\n color: ${c};\n }\n .report-title {\n max-width: 100%;\n word-wrap: break-word;\n }\n table {\n border-collapse: collapse;\n width: 100%;\n }\n th, td {\n white-space: nowrap;\n padding: 8px;\n text-align: left;\n border: 1px solid #ddd;\n }\n th {\n background-color: ${c};\n color: #fff;\n }\n tr:nth-child(even) {\n background-color: #f1f1f1\n }\n </style>\n `+w;const b=new Blob([w],{type:"text/html"});return d||u?{downloadTitle:`${e} ${d}-${u}.html`,blob:b}:{downloadTitle:`${e}.html`,blob:b}},Zc=({title:e,columns:t,rows:i,columnsSelected:r,data:n,auth:a,retrievalParams:s,filters:o,globalFilter:l,columnLabel:h})=>{t=t.filter(e=>r.includes(e.id));const{fromDt:c,toDt:d}=getRetrievalParaDate(s),u=getDynamicRow(i,t,"XML"),A=jstoxml.toXML({XmlData_root:u.map(e=>({XmlData_row:e}))},{header:!0}),p=new Blob([A],{type:"application/xml"});return c||d?{downloadTitle:`${e} ${c}-${d}.xml`,blob:p}:{downloadTitle:`${e}.xml`,blob:p}},ed=n({status:{excelStatus:"",pdfStatus:"",csvStatus:"",xmlStatus:"",htmlStatus:"",textStatus:""},workerQueue:[],setWorkerQueue:()=>{},pdfExporter:()=>{},excelExporter:()=>{},csvExporter:()=>{},textExporter:()=>{},htmlExporter:()=>{},xmlExporter:()=>{},markComplete:()=>{},downloadProgress:{},setDownloadProgress:()=>{}}),td=({children:t})=>{const[i,r]=d([]),[n,a]=d({pdf:!1,excel:!1,csv:!1,text:!1,xml:!1,html:!1}),s=o(),c=l((e,t="",i=null,a=!1)=>{r(r=>r.map(r=>r.id===e?{...r,type:t,url:i,enablePdfPrint:a,isCompleted:!n[t]}:r))},[]),[u,{status:A,kill:p}]=dn(Wc,{remoteDependencies:[`${new URL(window.location.href).origin}/exportUtility.js`,`${new URL(window.location.href).origin}/cdn/date-fns.js`,`${new URL(window.location.href).origin}/cdn/jspdf.js`,`${new URL(window.location.href).origin}/cdn/jspdf-autotable.js`]}),[f,{status:m}]=dn(Jc,{remoteDependencies:[`${new URL(window.location.href).origin}/cdn/date-fns.js`,`${new URL(window.location.href).origin}/cdn/xlsx.js`,`${new URL(window.location.href).origin}/exportUtility.js`]}),[g,{status:w}]=dn(Xc,{remoteDependencies:[`${new URL(window.location.href).origin}/cdn/date-fns.js`,`${new URL(window.location.href).origin}/cdn/papaparse.js`,`${new URL(window.location.href).origin}/exportUtility.js`]}),[b,{status:v}]=dn(Yc,{remoteDependencies:[`${new URL(window.location.href).origin}/cdn/date-fns.js`,`${new URL(window.location.href).origin}/exportUtility.js`]}),[y,{status:B}]=dn($c,{remoteDependencies:[`${new URL(window.location.href).origin}/cdn/date-fns.js`,`${new URL(window.location.href).origin}/exportUtility.js`]}),[C,{status:x}]=dn(Zc,{remoteDependencies:[`${new URL(window.location.href).origin}/cdn/date-fns.js`,`${new URL(window.location.href).origin}/cdn/jstoxml.js`,`${new URL(window.location.href).origin}/exportUtility.js`]});return s.current={pdfStatus:A,excelStatus:m,csvStatus:w,textStatus:v,htmlStatus:B,xmlStatus:x},h(()=>{const e=e=>{if(s.current?.excelStatus===cn.RUNNING||s.current?.pdfStatus===cn.RUNNING||s.current?.csvStatus===cn.RUNNING||s.current?.textStatus===cn.RUNNING||s.current?.htmlStatus===cn.RUNNING||s.current?.xmlStatus===cn.RUNNING){e.preventDefault();const t="Export is still running";return e.returnValue=t,t}};return window.addEventListener("beforeunload",e),()=>{window.removeEventListener("beforeunload",e)}},[]),e(ed.Provider,{value:{workerQueue:i,setWorkerQueue:r,setDownloadProgress:a,downloadProgress:n,pdfExporter:u,excelExporter:f,csvExporter:g,textExporter:b,htmlExporter:y,xmlExporter:C,markComplete:c,kill:p,status:{pdfStatus:A,excelStatus:m,csvStatus:w,textStatus:v,htmlStatus:B,xmlStatus:x}},children:t})},id=()=>a(ed),rd={PENDING:cn.PENDING,SUCCESS:cn.SUCCESS,RUNNING:cn.RUNNING,ERROR:cn.ERROR,TIMEOUT_EXPIRED:cn.TIMEOUT_EXPIRED},nd={form:{name:"exportReportForm",label:"ExportReportform",resetFieldOnUnmount:!1,validationRun:"onBlur",submitAction:"home",render:{ordering:"auto",renderType:"simple",gridConfig:{item:{xs:12,sm:4,md:4},container:{direction:"row",spacing:1}}},componentProps:{textField:{fullWidth:!0},select:{fullWidth:!0},datePicker:{fullWidth:!0},numberFormat:{fullWidth:!0},inputMask:{fullWidth:!0},datetimePicker:{fullWidth:!0}}},fields:[{render:{componentType:"autocomplete"},name:"TEMPLATE_ID",label:"SelectTemplate",placeholder:"SelectTemplate",runPostValidationForInitValue:!0,options:[],isFieldFocused:!0,validationRun:"all",postValidationSetCrossFieldValues:async(e,t)=>{const i=t?.templates??null;if(!i)return{};try{const r=i?.find(t=>t?.TEMPLATE_ID===e.value);return t?.handleSelectionModel(r),{EXPORT_TYPE:{value:r?.EXPORT_TYPE},SHOW_HEADER:{value:r?.SHOW_HEADER},PAGE_SIZE:{value:r?.PAGE_SIZE},ORIENTATION:{value:r?.ORIENTATION}}}catch(e){return console.log("err",e),{}}},shouldExclude:(e,t,i)=>!i?.templates,GridProps:{xs:6,md:3,sm:3}},{render:{componentType:"autocomplete"},name:"EXPORT_TYPE",label:"Selectfiletype",required:!0,defaultValue:"EXCEL",defaultOptionLabel:"Selectfiletype",options:[{label:"EXCEL (.xlsx)",value:"EXCEL"},{label:"CSV (.csv)",value:"CSV"},{label:"PDF (.pdf)",value:"PDF"},{label:"PLAIN TEXT (.txt)",value:"TEXT"},{label:"XML (.xml)",value:"XML"},{label:"HTML (.html)",value:"HTML"}],validationRun:"onChange",postValidationSetCrossFieldValues:(e,t)=>(t?.setSelectedFileType&&t?.setSelectedFileType(e.value),{}),schemaValidation:{type:"string",rules:[{name:"required",params:["ThisFieldisrequired"]}]},GridProps:{xs:6,md:3,sm:3}},{render:{componentType:"autocomplete"},name:"PAGE_SIZE",label:"Selectpagesize",defaultValue:"a4",defaultOptionLabel:"Select page size",dependentFields:["EXPORT_TYPE"],ignoreInSubmit:e=>"PDF"!==e?.EXPORT_TYPE?.value,shouldExclude:(e,t,i)=>"PDF"!==t?.EXPORT_TYPE?.value,options:[{label:"A3",value:"a3"},{label:"A4",value:"a4"},{label:"A5",value:"a5"},{label:"A6",value:"a6"},{label:"Letter",value:"letter"},{label:"Legal",value:"legal"}],required:!0,schemaValidation:{type:"string",rules:[{name:"required",params:["ThisFieldisrequired"]}]},GridProps:{xs:6,md:3,sm:3}},{render:{componentType:"autocomplete"},name:"ORIENTATION",label:"Selectorientation",defaultValue:"portrait",defaultOptionLabel:"Select orientation",dependentFields:["EXPORT_TYPE"],ignoreInSubmit:e=>"PDF"!==e?.EXPORT_TYPE?.value,shouldExclude:(e,t,i)=>"PDF"!==t?.EXPORT_TYPE?.value,options:[{label:"Portrait",value:"portrait"},{label:"Landscape",value:"landscape"}],required:!0,schemaValidation:{type:"string",rules:[{name:"required",params:["ThisFieldisrequired"]}]},GridProps:{xs:6,md:3,sm:3}},{render:{componentType:"checkbox"},name:"SHOW_HEADER",label:"ShowHeader",defaultValue:!0,GridProps:{xs:6,md:3,sm:3},fullWidth:!0,dependentFields:["EXPORT_TYPE"],ignoreInSubmit:e=>"XML"===e?.EXPORT_TYPE?.value||"TEXT"===e?.EXPORT_TYPE?.value||"CSV"===e?.EXPORT_TYPE?.value,shouldExclude:(e,t,i)=>"XML"===t?.EXPORT_TYPE?.value||"TEXT"===t?.EXPORT_TYPE?.value||"CSV"===t?.EXPORT_TYPE?.value},{render:{componentType:"checkbox"},name:"ALL_PAGE_HEADER",label:"ShowHeaderOnAllPage",defaultValue:!1,GridProps:{xs:6,md:3,sm:3},fullWidth:!0,dependentFields:["EXPORT_TYPE","SHOW_HEADER"],ignoreInSubmit:e=>"PDF"!==e?.EXPORT_TYPE?.value||!e?.SHOW_HEADER?.value,shouldExclude:(e,t,i)=>!t?.SHOW_HEADER?.value||"PDF"!==t?.EXPORT_TYPE?.value}]},ad=Ci(e=>({wrapper:{minHeight:"100vh",boxShadow:"0 3px 6px rgba(0,0,0,0.03)",[e.breakpoints.down("sm")]:{minHeight:"100vh"},background:"var(--theme-color2)"},loginEmp:{background:"#fff",padding:e.spacing(2,4),display:"flex",maxWidth:"400px",margin:"auto",boxShadow:"0 0 20px rgba(0,0,0,0.06)",borderRadius:"8px",[e.breakpoints.down("sm")]:{width:"100%"}},formWrap:{marginTop:e.spacing(2)},otpformWrap:{marginTop:e.spacing(2),marginBottom:e.spacing(2),display:"inline-flex"},loginBtn:{minWidth:"100% !important",margin:e.spacing(2,0),fontSize:"1rem",padding:"10px .75rem",background:"var(--theme-color1)",border:0,color:"#fff !important",fontWeight:600,letterSpacing:"0.02857em",boxShadow:"none",textTransform:"capitalize",alignSelf:"flex-end","&:hover":{background:"#fedad8",boxShadow:"none"}},OTPTimer:{marginTop:"10px",color:e.palette.primary.main,fontWeight:600},resendLink:{marginTop:"10px",cursor:"pointer",color:e.palette.secondary.main,fontWeight:600,fontSize:"0.875 rem"},logo:{marginBottom:e.spacing(1)},loginLeft:{display:"flex",justifyContent:"center",padding:"2rem",[e.breakpoints.down("sm")]:{display:"none"}},loginRight:{background:"#fff",padding:e.spacing(2,4),display:"flex",maxWidth:"400px",margin:"auto",boxShadow:"0 0 20px rgba(0,0,0,0.06)",borderRadius:"8px",[e.breakpoints.down("sm")]:{width:"100%"},"& img":{alignSelf:"center"}},loginImg:{},verifybutton:{alignSelf:"center",marginBottom:"10px",marginTop:"10px"},divflex:{display:"flex"},otpinputpadding:{"& input":{marginRight:"8px !important"}},otpinputform:{"& input":{marginRight:"10px !important",width:"42px !important",height:"42px !important",borderRadius:"8px",border:"1px solid #000"}},otpinputformauth:{"& input":{marginRight:"8px !important",width:"40px !important",height:"40px !important",borderRadius:"8px",border:"1px solid #000"}},ibtnvisible:{padding:"7px !important"},btnvisibleoff:{display:"none"},resendOTPalign:{textAlign:"center",marginTop:"15px",display:"block !important"},resendbtnLink:{textDecoration:"underline",color:"blue",cursor:"pointer","&:hover":{textDecoration:"underline",color:"blue"}},dialogTitleClass:{background:"var(--theme-color1)",padding:"8px 15px !important",color:"#fff","& h2":{color:"white",fontWeight:"500 !important"}},button:{display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",margin:"6px",background:"var(--theme-color1)","&:hover":{background:"var(--theme-color1) !important"}},lang_svg:{marginRight:"10px",width:"22px",height:"22px"}})),sd=({MessageTitle:r,Message:n,onClickButton:a,buttonNames:s=["Yes","No"],rows:l,open:c=!1,loading:d=!1,icon:u="INFO",defFocusBtnName:A="",loadingBtnName:p="",messageBoxConfig:f,enableEnterToFocus:m,focusScopeId:g="enter-to-focus-message-box"})=>{const{t:w}=W(),b=ad(),{enableEnterToFocus:v}=ns(),y=o(null),B={INFO:f?.iconsConfig?.INFO?.color??"dodgerblue",SUCCESS:f?.iconsConfig?.SUCCESS?.color??"green",WARNING:f?.iconsConfig?.WARNING?.color??"orange",ERROR:f?.iconsConfig?.ERROR?.color??"#f44336",CONFIRM:f?.iconsConfig?.CONFIRM?.color??"#474e5b"},C=f?.iconsConfig?.INFO?.icon??An,x=f?.iconsConfig?.SUCCESS?.icon??Tt,F=f?.iconsConfig?.WARNING?.icon??pn,S=f?.iconsConfig?.ERROR?.icon??Lt,N=f?.iconsConfig?.CONFIRM?.icon??kt;h(()=>{let e;return e=setTimeout(()=>{c&&y.current&&y.current.focus()},10),()=>clearTimeout(e)},[c,y.current]);const E=m??v;return e(i,{children:t($,{className:"message__box__base",onKeyDown:e=>{E&&Es(e,g)},maxWidth:"md",PaperProps:{style:{minWidth:"200px",maxWidth:"50%"}},open:c,...g&&E?{"data-scope-id":g}:{},children:[e(Z,{className:b.dialogTitleClass,style:{background:B[u]},children:w(r,{nsSeparator:"|"})}),t(ee,{sx:{paddingLeft:"10px",display:"flex",gap:"0.5rem"},children:[e(oe,{style:{position:"fixed"},children:"INFO"===u?e(C,{fontSize:"large",style:{color:B[u],width:"1.3em",height:"1.3em"}}):"WARNING"===u?e(F,{fontSize:"large",style:{color:B[u],width:"1.3em",height:"1.3em"}}):"SUCCESS"===u?e(x,{fontSize:"large",style:{color:B[u],width:"1.3em",height:"1.3em"}}):"ERROR"===u?e(S,{fontSize:"large",style:{color:B[u],width:"1.3em",height:"1.3em"}}):"CONFIRM"===u?e(N,{fontSize:"large",style:{color:B[u],width:"1.3em",height:"1.3em"}}):null}),e(te,{children:e(X,{style:{color:"black",whiteSpace:"pre-wrap",marginLeft:"3rem",paddingTop:"0.6rem"},children:n.startsWith("\n")?w(n?.slice(1),{nsSeparator:"|"}):w(n,{nsSeparator:"|"})})})]}),e(ie,{children:s.map((t,i)=>{const r=Boolean(A)&&A===t,n=!Boolean(A)&&0===i;return e(eo,{ref:r||n?y:null,sx:{background:B[u],"&:hover":{background:B[u]}},disabled:d,endIcon:p===t&&d?e(he,{size:20}):null,onClick:()=>"function"==typeof a?a(t):void 0,children:w(t)})})})]})})},od=[];for(let e=0;e<256;++e)od.push((e+256).toString(16).slice(1));let ld;const hd=new Uint8Array(16);var cd={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function dd(e,t,i){if(cd.randomUUID&&!e)return cd.randomUUID();const r=(e=e||{}).random??e.rng?.()??function(){if(!ld){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");ld=crypto.getRandomValues.bind(crypto)}return ld(hd)}();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=15&r[6]|64,r[8]=63&r[8]|128,function(e,t=0){return(od[e[t+0]]+od[e[t+1]]+od[e[t+2]]+od[e[t+3]]+"-"+od[e[t+4]]+od[e[t+5]]+"-"+od[e[t+6]]+od[e[t+7]]+"-"+od[e[t+8]]+od[e[t+9]]+"-"+od[e[t+10]]+od[e[t+11]]+od[e[t+12]]+od[e[t+13]]+od[e[t+14]]+od[e[t+15]]).toLowerCase()}(r)}const ud={isOpen:!1,messageTitle:"",message:"",icon:"INFO",buttonNames:["Ok"],defFocusBtnName:"",loadingBtnName:[""],focusScopeId:"enter-to-focus-message-box",enableEnterToFocus:void 0},Ad=n({MessageBox:()=>{},CloseMessageBox:()=>{}}),pd=({messageBoxConfig:r,children:n})=>{const[a,s]=d(ud),[o,l]=d(!1),[h,c]=d(),u=()=>{l(!1),s(ud)};return e(Ad.Provider,{value:{MessageBox:({messageTitle:e,message:t,icon:i="INFO",buttonNames:n=["Ok"],defFocusBtnName:a="",loadingBtnName:o=[""],enableEnterToFocus:h,focusScopeId:d="enter-to-focus-message-box"})=>(l(!1),new Promise(A=>{s({isOpen:!0,messageTitle:e,message:t,icon:i,buttonNames:n,callBack:e=>{A(e);const t=o?.find(t=>t===e);t?(l(!0),c(t)):u()},defFocusBtnName:a,loadingBtnName:o,enableEnterToFocus:h??r?.enableEnterToFocus??!1,focusScopeId:d})})),CloseMessageBox:u,messageBoxConfig:r,isMessageBoxOpen:a.isOpen},children:t(i,{children:[n,a.isOpen?e(sd,{open:a.isOpen,Message:a.message,MessageTitle:a.messageTitle,rows:[],onClickButton:a.callBack,buttonNames:a.buttonNames,icon:a.icon,defFocusBtnName:a.defFocusBtnName,loading:o,loadingBtnName:h,messageBoxConfig:r,enableEnterToFocus:a.enableEnterToFocus,focusScopeId:a.focusScopeId},dd()):null]})})},fd=()=>a(Ad),md={loading:!1,isError:!1,userMessage:""},gd=({TitleText:r,onActionNo:n,onActionYes:a,isRequired:s=!0,isEntertoSubmit:l=!1,AcceptbuttonLabelText:h="Yes",CanceltbuttonLabelText:c="No",isLoading:u=!1,open:A=!1,label:p="Remarks",placeholder:f="EnterRemarks",defaultValue:m="",rows:g,customRequiredMessage:w="",maxLength:b=200,showMaxLength:v=!1,enableEnterToFocus:y,focusScopeId:B="enter-to-focus-remarks",preventSpecialChars:C=null})=>{const{enableEnterToFocus:x}=ns(),[F,S]=d(m),[N,E]=d(md),k=ad(),T=o(null),{t:L}=W(),I=o(null),D=y??x;return e(i,{children:t($,{fullWidth:!0,open:A,className:"remarks__wrapper__base",onKeyDown:e=>{D&&Es(e,B)},...B&&D?{"data-scope-id":B}:{},children:[e(Z,{className:k.dialogTitleClass,children:L(r)}),e(ee,{sx:{mt:2},children:e(Ao,{autoFocus:!0,label:L(p),placeholder:String(L(`${f}`)),fullWidth:!0,type:"text",name:"remarks",value:F||"",onChange:e=>{e.target.value.trimStart().length<=b&&(e=>{const t="function"==typeof C?C():C;t&&e.target.value&&t.split("").some(t=>e.target.value.includes(t))||(S(e.target.value.trimStart()),e.target.value.trimStart()&&E(e=>({...e,isError:!1,userMessage:""})))})(e)},error:N.isError,helperText:t("div",{style:{display:"flex"},children:[e(le,{children:N.isError?N.userMessage:""}),b>0&&Boolean(v)?t(le,{error:!1,style:{flex:1,textAlign:"right",margin:"5px 15px 0 0"},children:[F.length,"/",b]}):null]}),InputLabelProps:{shrink:!0},disabled:u,autoComplete:"off",ref:T,required:s,onKeyPress:e=>{"Enter"===e.key&&l&&I?.current?.click?.()}})}),t(ie,{className:k.verifybutton,children:[e(eo,{endIcon:u?e(G,{size:20}):null,disabled:u,onClick:()=>{!Boolean(F)&&s?E(e=>({...e,isError:!0,userMessage:L(w||"ThisFieldisrequired")})):a(F,g)},ref:I,children:L(h)}),e(eo,{disabled:u,onClick:()=>{n()},children:L(c)})]})]})})};io('.modal-backdrop{background-color:#000;bottom:0;left:0;opacity:.2;position:fixed;right:0;top:0;z-index:9999}.modal-backdrop.fade{opacity:0}.modal-backdrop,.modal-backdrop.fade.in{filter:alpha(opacity=80);opacity:.2}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(1turn)}}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.sk-fading-circle{height:65px;left:48%;position:relative;width:65px}.sk-fading-circle .sk-circle{height:100%;left:0;position:absolute;top:0;width:100%}.sk-fading-circle .sk-circle:before{-webkit-animation:sk-circleFadeDelay 1.2s ease-in-out infinite both;animation:sk-circleFadeDelay 1.2s ease-in-out infinite both;background-color:red;border-radius:100%;content:"";display:block;height:15%;margin:0 auto;width:15%}.sk-fading-circle .sk-circle2{-webkit-transform:rotate(30deg);-ms-transform:rotate(30deg);transform:rotate(30deg)}.sk-fading-circle .sk-circle3{-webkit-transform:rotate(60deg);-ms-transform:rotate(60deg);transform:rotate(60deg)}.sk-fading-circle .sk-circle4{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.sk-fading-circle .sk-circle5{-webkit-transform:rotate(120deg);-ms-transform:rotate(120deg);transform:rotate(120deg)}.sk-fading-circle .sk-circle6{-webkit-transform:rotate(150deg);-ms-transform:rotate(150deg);transform:rotate(150deg)}.sk-fading-circle .sk-circle7{-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.sk-fading-circle .sk-circle8{-webkit-transform:rotate(210deg);-ms-transform:rotate(210deg);transform:rotate(210deg)}.sk-fading-circle .sk-circle9{-webkit-transform:rotate(240deg);-ms-transform:rotate(240deg);transform:rotate(240deg)}.sk-fading-circle .sk-circle10{-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.sk-fading-circle .sk-circle11{-webkit-transform:rotate(300deg);-ms-transform:rotate(300deg);transform:rotate(300deg)}.sk-fading-circle .sk-circle12{-webkit-transform:rotate(330deg);-ms-transform:rotate(330deg);transform:rotate(330deg)}.sk-fading-circle .sk-circle2:before{-webkit-animation-delay:-1.1s;animation-delay:-1.1s}.sk-fading-circle .sk-circle3:before{-webkit-animation-delay:-1s;animation-delay:-1s}.sk-fading-circle .sk-circle4:before{-webkit-animation-delay:-.9s;animation-delay:-.9s}.sk-fading-circle .sk-circle5:before{-webkit-animation-delay:-.8s;animation-delay:-.8s}.sk-fading-circle .sk-circle6:before{-webkit-animation-delay:-.7s;animation-delay:-.7s}.sk-fading-circle .sk-circle7:before{-webkit-animation-delay:-.6s;animation-delay:-.6s}.sk-fading-circle .sk-circle8:before{-webkit-animation-delay:-.5s;animation-delay:-.5s}.sk-fading-circle .sk-circle9:before{-webkit-animation-delay:-.4s;animation-delay:-.4s}.sk-fading-circle .sk-circle10:before{-webkit-animation-delay:-.3s;animation-delay:-.3s}.sk-fading-circle .sk-circle11:before{-webkit-animation-delay:-.2s;animation-delay:-.2s}.sk-fading-circle .sk-circle12:before{-webkit-animation-delay:-.1s;animation-delay:-.1s}@-webkit-keyframes sk-circleFadeDelay{0%,39%,to{opacity:0}40%{opacity:1}}@keyframes sk-circleFadeDelay{0%,39%,to{opacity:0}40%{opacity:1}}');const wd=i=>e(ni,{style:{width:"100%"},children:t("div",{className:"loading",style:{textAlign:"center",margin:"2px"},children:[e("div",{className:"bounceball"}),e("div",{className:"text-forloader",children:e(no,{text:"Loading..."},"loaderWithbounce")})]})});io('.wrap-forloader{left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}.text-forloader{color:var(--theme-color1);display:inline-block;font-family:Franklin Gothic Medium,Arial Narrow,Arial,sans-serif;margin-left:5px}.bounceball{display:inline-block;height:37px;position:relative;width:15px}.bounceball:before{animation:bounce .5s ease infinite alternate;background-color:var(--theme-color1);border-radius:50%;content:"";display:block;height:15px;position:absolute;top:0;transform-origin:50%;width:15px}@keyframes bounce{0%{border-radius:60px 60px 20px 20px;height:5px;top:30px;transform:scaleX(2)}35%{border-radius:50%;height:15px;transform:scaleX(1)}to{top:0}}');const bd=()=>{const{t:i}=W();return e("div",{className:"wrap-forloader",children:t("div",{className:"loading",children:[e("div",{className:"bounceball"}),t("div",{className:"text-forloader",children:[i("Loading"),"..."]})]})})},vd=Ci(e=>({dataGrid:{fontWeight:500,fontFamily:'"Roboto", "Helvetica", "Arial", "sans-serif" !important',fontSize:"0.9rem",letterSpacing:"0.01071em","& .MuiDataGrid-columnHeaderTitle":{color:"var(--theme-color1)",fontWeight:700},"& .Mui-checked":{color:"var(--theme-color1)"},"& .MuiCheckbox-indeterminate":{color:e.palette.text.secondary}}})),yd=e=>e.trim().split(","),Bd=({globalFilter:r="",filters:n=[],queryFilters:a=[],onClose:c,rows:u,columns:A,title:p,pageNumber:f,totalPageCount:m,enablePdfPrint:g,reportTemplateCode:w,enableEnterToFocus:b})=>{const{dynamicAmountSymbol:v,defaultExportConfig:y}=ns(),{MessageBox:B}=fd(),{authState:C}=es(),{pdfExporter:x,excelExporter:F,csvExporter:S,textExporter:N,htmlExporter:E,xmlExporter:k,setWorkerQueue:T,setDownloadProgress:L,status:I,markComplete:P}=id(),R=o(null);R.current=I;const{t:O}=W(),Q=o([]),H=vd(),M=o(null),{enqueueSnackbar:_}=fr(),[j,z]=d(""),V=o(null),K=o(void 0),[q,G]=d(!1),{data:J,isLoading:Y,isFetching:Z,isError:ee,error:te}=zt(["getPersonalizationData",w],()=>y?.getPersonalizedReportData?.(w,C?.user?.id)??Promise.resolve(null),{enabled:Boolean(w),cacheTime:0}),re=s(()=>{if(!J)return nd;const e=D(nd),t=J.map(e=>({label:e.TEMPLATE_LABEL,value:e.TEMPLATE_ID}));return e.fields[0].options=t,e},[J,nd]),ne=s(()=>J?J.find(e=>"Y"===e?.DEFAULT_FLAG):null,[J]),ae=s(()=>A.filter(e=>"ButtonRowCell"!==e?.Cell?.name&&e?.Cell!==jc&&"buttonRowCell"!==e?.componentType&&!0!==e.isHiddenColumn),[]),se=s(()=>ae.reduce((e,t)=>({...e,[t?.accessor]:t?.columnName}),{}),[]),oe=s(()=>ae.map((e,t)=>({id:e.accessor,__srno__:t+1,cname:e.columnName,[e.accessor]:e.accessor,cellType:e?.Cell===Tc||"dateTime"===e?.componentType?"DateTimeCell":e?.Cell===Lc||"date"===e?.componentType?"DateCell":e?.Cell===qc?"TimeCell":e?.Cell===Vc||"currency"===e.componentType?"currency":"",format:e?.format?e?.format:e?.dateFormat?e?.dateFormat:"currency"===e.componentType||e?.Cell===Vc?$o(e?.currencyRefColumn??v,!1)??"":"",...e?.isAutoSequence?{isAutoSequence:!0}:{}})),[]),[le,he]=d([]);Q.current=le,h(()=>{he(()=>ne?yd(ne.SELECTION_MODEL):oe.map(e=>e.id)),z(e=>ne?.EXPORT_TYPE??e)},[ne]);const ce=l(e=>{he(t=>e?.SELECTION_MODEL?yd(e?.SELECTION_MODEL):t),V.current=e},[he,V.current]),de=s(()=>{const e=oe[0]?.isAutoSequence?Object.keys(oe[0]).find(e=>!["id","__srno__","cname","cellType","format","isAutoSequence"].includes(e))??"":"";return u.map((t,i)=>Boolean(e)?{...t?.values,[e]:i+1}:t?.values)},[]),ue=l((e="report")=>{const t=(new Date).getTime(),i={id:t,title:e,isCompleted:!1};return T(e=>[i,...e]),t},[]),Ae=async(e,t)=>await un({url:e,method:"GET",responseType:"blob",onDownloadProgress:e=>{let i=Math.round(100*e.loaded/e.total);L(e=>({...e,[t]:100!==i}))}}),pe=n?.map(e=>{const t=D(e);return t?.value?.columnName&&(t.value.columnName=O(t.value.columnName)),t}),fe=l(async e=>{G(!0),await new Promise(t=>{K.current={handleClose:()=>{G(!1),t("")},handleAccept:i=>{const r={...e,TEMPLATE_ID:"",GRID_ID:w,NEW_TEMPLATE_NAME:i,SELECTION_MODEL:Q.current?.join(","),USER_ID:C?.user?.id,isNewRow:!0};try{"function"==typeof y?.saveUpdateTemplateApiFn?y?.saveUpdateTemplateApiFn(r):console.error("No function provided to save/update template!")}catch(e){console.log("Error while saving template: ",e)}G(!1),t("")}}})},[w,y,Q.current]);return t(i,{children:[Y||Z?e($,{open:!0,TransitionComponent:ph,PaperProps:{style:{width:"65%"}},className:"report__export__dialog__base",maxWidth:"lg",children:e(wd,{})}):t($,{open:!0,TransitionComponent:ph,PaperProps:{style:{width:"65%"}},className:"report__export__dialog__base",maxWidth:"lg",onKeyDown:e=>{b&&Es(e,"report__export__dialog__base")},"data-scope-id":"report__export__dialog__base",children:[ee?e(to,{severity:"error",errorMsg:te?.error_msg??O("Somethingwenttowrong"),errorDetail:te?.error_detail,color:"error"}):null,e(Nc,{metaData:re,initialValues:ne,onSubmitHandler:async(e,t,i,n,s)=>{if(i(!0),0===de.length)return void _(O("Nodatafoundtoexports"),{variant:"error"});if(0===Q.current.length)return void _(O("Pleaseselectatleastonecolumn"),{variant:"error"});"SHOW_HEADER"in e&&(e.SHOW_HEADER="Y"===e.SHOW_HEADER||!0===e.SHOW_HEADER?"Y":"N"),V.current&&"SHOW_HEADER"in V.current&&(V.current.SHOW_HEADER="Y"===V.current.SHOW_HEADER||!0===V.current.SHOW_HEADER?"Y":"N"),"ALL_PAGE_HEADER"in e&&(e.ALL_PAGE_HEADER="Y"===e.ALL_PAGE_HEADER||!0===e.ALL_PAGE_HEADER?"Y":"N"),V.current&&"ALL_PAGE_HEADER"in V.current&&(V.current.ALL_PAGE_HEADER="Y"===V.current.ALL_PAGE_HEADER||!0===V.current.ALL_PAGE_HEADER?"Y":"N");const o={columns:oe,rows:de,title:p,columnsSelected:Q.current,data:e,auth:C,retrievalParams:a?.map(e=>({...e,value:{...e.value,columnName:O(e?.value?.columnName??""),label:O(e?.value?.label??"")}})),filters:pe,globalFilter:r,columnLabel:se,pageNumber:f,totalPageCount:m,primaryTheme:Ns("--report-export-theme")||"#800000"};if(J&&!Boolean(e?.TEMPLATE_ID)){"Yes"===await B({message:"DoYouWantToSaveNewTemplate",messageTitle:"Save",buttonNames:["Yes","No"],defFocusBtnName:"Yes",icon:"CONFIRM"})&&await fe(e)}else if(J){const t=vs(e,V.current);if(t._UPDATEDCOLUMNS.length||!((e,t,i)=>{const r=e?.find(e=>e?.TEMPLATE_ID===i),n=r?.SELECTION_MODEL?yd(r?.SELECTION_MODEL):[],a=n?.toSorted(),s=t?.toSorted();return U(a,s)})(J,Q.current,e.TEMPLATE_ID)){const i=await B({message:"DoYouWantToUpdateThisTemplate",messageTitle:"Update",buttonNames:["ReportPersonalizationUpdate","ReportPersonalizationSaveAsNew","ExportWithoutSave"],defFocusBtnName:"ReportPersonalizationUpdate",icon:"CONFIRM"});if("ReportPersonalizationUpdate"===i)try{const i={...e,...t,GRID_ID:w,USER_ID:C?.user?.id,SELECTION_MODEL:Q.current?.join(","),isNewRow:!1},r=Q.current?.join(","),n=V.current?.SELECTION_MODEL;r!==n&&(i.OLD_SELECTION_MODEL=n),"function"==typeof y?.saveUpdateTemplateApiFn?y?.saveUpdateTemplateApiFn(i):console.error("No function provided to save/update template!")}catch(e){console.log("err",e)}else"ReportPersonalizationSaveAsNew"===i&&await fe(e)}}switch(e.EXPORT_TYPE){case"EXCEL":if(R.current.excelStatus===cn.RUNNING)return void console.log("excel in operation");let e=ue(`${p} - Excel`);F(o).then(async t=>{const i=URL.createObjectURL(t.blob),r=await Ae(i,"excel"),n=URL.createObjectURL(new Blob([r.data],{type:"application/octet-stream"})),a=document.createElement("a");a.href=n,a.download=t.downloadTitle,a.click(),URL.revokeObjectURL(n),P(e,"excel")});break;case"CSV":if(R.current.csvStatus===cn.RUNNING)return void console.log("csv in operation");let t=ue(`${p} - Csv`);S(o).then(async e=>{const i=URL.createObjectURL(e.blob),r=await Ae(i,"csv"),n=URL.createObjectURL(new Blob([r.data])),a=document.createElement("a");a.href=n,a.download=e.downloadTitle,a.click(),URL.revokeObjectURL(n),P(t,"csv")});break;case"PDF":if(R.current.pdfStatus===cn.RUNNING)return void console.log("pdf in operation");let i=ue(`${p} - Pdf`);x({...o,banklogo:`${new URL(window.location.href).origin}/bank-logo.jpg`}).then(async e=>{const t=await Ae(e.blob,"pdf"),r=URL.createObjectURL(new Blob([t.data],{type:"application/pdf"}));if("EXPORT"===s){const t=document.createElement("a");t.href=r,t.download=e.downloadTitle,document.body.appendChild(t),t.click(),document.body.removeChild(t)}P(i,"pdf",r,Boolean(g))});break;case"TEXT":if(R.current.textStatus===cn.RUNNING)return void console.log("text in operation");let r=ue(`${p} - Text`);N(o).then(async e=>{const t=URL.createObjectURL(e.blob),i=await Ae(t,"text"),n=URL.createObjectURL(new Blob([i.data])),a=document.createElement("a");a.href=n,a.download=e.downloadTitle,a.click(),URL.revokeObjectURL(n),P(r,"text")});break;case"XML":if(R.current.xmlStatus===cn.RUNNING)return void console.log("xml in operation");let n=ue(`${p} - Xml`);k(o).then(async e=>{const t=URL.createObjectURL(e.blob),i=await Ae(t,"xml"),r=URL.createObjectURL(new Blob([i.data])),a=document.createElement("a");a.href=r,a.download=e.downloadTitle,a.click(),URL.revokeObjectURL(r),P(n,"xml")});break;case"HTML":if(R.current.htmlStatus===cn.RUNNING)return void console.log("html in operation");let a=ue(`${p} - Html`);E(o).then(async e=>{const t=URL.createObjectURL(e.blob),i=await Ae(t,"html"),r=URL.createObjectURL(new Blob([i.data])),n=document.createElement("a");n.href=r,n.download=e.downloadTitle,n.click(),URL.revokeObjectURL(r),P(a,"html")})}_(O("ReportExportStatus"),{variant:"exportReportSnackbar",preventDuplicate:!0,persist:!0,anchorOrigin:{horizontal:"right",vertical:"bottom"}}),c()},formState:{setSelectedFileType:g?z:void 0,handleSelectionModel:ce,templates:J},displayMode:null,formStyle:{background:"white"},ref:M,enableEnterToFocus:!1},"ExportReportForm"),e(X,{style:{paddingLeft:".75rem"},variant:"caption",display:"block",gutterBottom:!0,children:0===de.length?`${O("Nodatafoundtoexport")}`:`${de.length} ${O("rowswillbeexported")}`}),e("div",{style:{height:"50vh",width:"100%"},children:e(hn,{className:H.dataGrid,rows:oe,rowHeight:36,columnHeaderHeight:40,columns:[{field:"__srno__",headerName:String(O("SrNo")),width:100},{field:"cname",headerName:String(O("ColumnstoExport")),width:300}],paginationModel:{page:0,pageSize:50},checkboxSelection:!0,disableRowSelectionOnClick:!0,disableColumnMenu:!0,rowSelectionModel:le,onRowSelectionModelChange:he,hideFooter:!0,style:{fontWeight:500}})}),t(ie,{style:{display:"flex",justifyContent:"center"},children:[g&&"PDF"===j?e(eo,{onClick:e=>{M.current?.handleSubmit(e,"PRINT")},shortcut:"alt",eventKey:"p",children:O("Print")}):null,e(eo,{onClick:e=>{M.current?.handleSubmit(e,"EXPORT")},shortcut:"alt",eventKey:"x",children:O("Export")}),e(eo,{onClick:()=>c(),shortcut:"alt",eventKey:"c",children:O("Close")})]})]}),q?e(gd,{TitleText:"DoYouWantToSaveNewTemplate",onActionNo:K.current.handleClose,onActionYes:K.current.handleAccept,rows:{},open:q,label:"TemplateName",placeholder:"EnterTemplateName",AcceptbuttonLabelText:"SaveNewTemplate",CanceltbuttonLabelText:"ExportWithoutSave"}):null]})};var Cd="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},xd=fn.performance||{};xd.now||xd.mozNow||xd.msNow||xd.oNow||xd.webkitNow;var Fd,Sd={},Nd={exports:{}},Ed={exports:{}},kd={};var Td,Ld,Id,Dd,Ud,Pd,Rd,Od,Qd,Hd,Md,_d,jd,zd,Vd,Kd={};function qd(){return Ld||(Ld=1,"production"===Sd.NODE_ENV?Ed.exports=function(){if(Fd)return kd;Fd=1;var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,i=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,n=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,o=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,h=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,u=e?Symbol.for("react.suspense_list"):60120,A=e?Symbol.for("react.memo"):60115,p=e?Symbol.for("react.lazy"):60116,f=e?Symbol.for("react.block"):60121,m=e?Symbol.for("react.fundamental"):60117,g=e?Symbol.for("react.responder"):60118,w=e?Symbol.for("react.scope"):60119;function b(e){if("object"==typeof e&&null!==e){var u=e.$$typeof;switch(u){case t:switch(e=e.type){case l:case h:case r:case a:case n:case d:return e;default:switch(e=e&&e.$$typeof){case o:case c:case p:case A:case s:return e;default:return u}}case i:return u}}}function v(e){return b(e)===h}return kd.AsyncMode=l,kd.ConcurrentMode=h,kd.ContextConsumer=o,kd.ContextProvider=s,kd.Element=t,kd.ForwardRef=c,kd.Fragment=r,kd.Lazy=p,kd.Memo=A,kd.Portal=i,kd.Profiler=a,kd.StrictMode=n,kd.Suspense=d,kd.isAsyncMode=function(e){return v(e)||b(e)===l},kd.isConcurrentMode=v,kd.isContextConsumer=function(e){return b(e)===o},kd.isContextProvider=function(e){return b(e)===s},kd.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},kd.isForwardRef=function(e){return b(e)===c},kd.isFragment=function(e){return b(e)===r},kd.isLazy=function(e){return b(e)===p},kd.isMemo=function(e){return b(e)===A},kd.isPortal=function(e){return b(e)===i},kd.isProfiler=function(e){return b(e)===a},kd.isStrictMode=function(e){return b(e)===n},kd.isSuspense=function(e){return b(e)===d},kd.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===h||e===a||e===n||e===d||e===u||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===A||e.$$typeof===s||e.$$typeof===o||e.$$typeof===c||e.$$typeof===m||e.$$typeof===g||e.$$typeof===w||e.$$typeof===f)},kd.typeOf=b,kd}():Ed.exports=(Td||(Td=1,"production"!==Sd.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,i=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,n=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,o=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,h=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,u=e?Symbol.for("react.suspense_list"):60120,A=e?Symbol.for("react.memo"):60115,p=e?Symbol.for("react.lazy"):60116,f=e?Symbol.for("react.block"):60121,m=e?Symbol.for("react.fundamental"):60117,g=e?Symbol.for("react.responder"):60118,w=e?Symbol.for("react.scope"):60119;function b(e){if("object"==typeof e&&null!==e){var u=e.$$typeof;switch(u){case t:var f=e.type;switch(f){case l:case h:case r:case a:case n:case d:return f;default:var m=f&&f.$$typeof;switch(m){case o:case c:case p:case A:case s:return m;default:return u}}case i:return u}}}var v=l,y=h,B=o,C=s,x=t,F=c,S=r,N=p,E=A,k=i,T=a,L=n,I=d,D=!1;function U(e){return b(e)===h}Kd.AsyncMode=v,Kd.ConcurrentMode=y,Kd.ContextConsumer=B,Kd.ContextProvider=C,Kd.Element=x,Kd.ForwardRef=F,Kd.Fragment=S,Kd.Lazy=N,Kd.Memo=E,Kd.Portal=k,Kd.Profiler=T,Kd.StrictMode=L,Kd.Suspense=I,Kd.isAsyncMode=function(e){return D||(D=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),U(e)||b(e)===l},Kd.isConcurrentMode=U,Kd.isContextConsumer=function(e){return b(e)===o},Kd.isContextProvider=function(e){return b(e)===s},Kd.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Kd.isForwardRef=function(e){return b(e)===c},Kd.isFragment=function(e){return b(e)===r},Kd.isLazy=function(e){return b(e)===p},Kd.isMemo=function(e){return b(e)===A},Kd.isPortal=function(e){return b(e)===i},Kd.isProfiler=function(e){return b(e)===a},Kd.isStrictMode=function(e){return b(e)===n},Kd.isSuspense=function(e){return b(e)===d},Kd.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===h||e===a||e===n||e===d||e===u||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===A||e.$$typeof===s||e.$$typeof===o||e.$$typeof===c||e.$$typeof===m||e.$$typeof===g||e.$$typeof===w||e.$$typeof===f)},Kd.typeOf=b}()),Kd)),Ed.exports}
2
2
  /*
3
3
  object-assign
4
4
  (c) Sindre Sorhus
@@ -130,5 +130,5 @@ re=de,"undefined"!=typeof self&&self||void 0!==Cd&&Cd||"undefined"!=typeof windo
130
130
  */},function(e){var t,r,n,a,s,o,l,h,c,d,u,A,p,f,m,g,w,b,v,y;t=function(){return function(t){return e.prototype=t,new e};function e(){}}(),d=function(e){var t,i,r,n,a,s,o;for(i=0,r=e.length,t=void 0,s=n=!1;!n&&i!==r;)(t=e[i]=e[i].trimLeft())&&(n=!0),i++;for(i=r-1;r&&!s&&-1!==i;)(t=e[i]=e[i].trimRight())&&(s=!0),i--;for(a=/\s+$/g,o=!0,i=0;i!==r;)"\u2028"!=e[i]&&(t=e[i].replace(/\s+/g," "),o&&(t=t.trimLeft()),t&&(o=a.test(t)),e[i]=t),i++;return e},A=function(e){var t,i,r;for(t=void 0,i=(r=e.split(",")).shift();!t&&i;)t=n[i.trim().toLowerCase()],i=r.shift();return t},p=function(e){var t;return-1<(e="auto"===e?"0px":e).indexOf("em")&&!isNaN(Number(e.replace("em","")))&&(e=18.719*Number(e.replace("em",""))+"px"),-1<e.indexOf("pt")&&!isNaN(Number(e.replace("pt","")))&&(e=1.333*Number(e.replace("pt",""))+"px"),(t=f[e])?t:void 0!==(t={"xx-small":9,"x-small":11,small:13,medium:16,large:19,"x-large":23,"xx-large":28,auto:0}[e])||(t=parseFloat(e))?f[e]=t/16:(t=e.match(/([\d\.]+)(px)/),Array.isArray(t)&&3===t.length?f[e]=parseFloat(t[1])/16:f[e]=1)},c=function(e){var t,i,r,n,c;return c=e,n=document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(c,null):c.currentStyle?c.currentStyle:c.style,i=void 0,(t={})["font-family"]=A((r=function(e){return e=e.replace(/-\D/g,function(e){return e.charAt(1).toUpperCase()}),n[e]})("font-family"))||"times",t["font-style"]=a[r("font-style")]||"normal",t["text-align"]=s[r("text-align")]||"left","bold"===(i=o[r("font-weight")]||"normal")&&("normal"===t["font-style"]?t["font-style"]=i:t["font-style"]=i+t["font-style"]),t["font-size"]=p(r("font-size"))||1,t["line-height"]=p(r("line-height"))||1,t.display="inline"===r("display")?"inline":"block",i="block"===t.display,t["margin-top"]=i&&p(r("margin-top"))||0,t["margin-bottom"]=i&&p(r("margin-bottom"))||0,t["padding-top"]=i&&p(r("padding-top"))||0,t["padding-bottom"]=i&&p(r("padding-bottom"))||0,t["margin-left"]=i&&p(r("margin-left"))||0,t["margin-right"]=i&&p(r("margin-right"))||0,t["padding-left"]=i&&p(r("padding-left"))||0,t["padding-right"]=i&&p(r("padding-right"))||0,t["page-break-before"]=r("page-break-before")||"auto",t.float=l[r("cssFloat")]||"none",t.clear=h[r("clear")]||"none",t.color=r("color"),t},m=function(e,t,i){var r,n,a,s,o;if(a=!1,s=n=void 0,r=i["#"+e.id])if("function"==typeof r)a=r(e,t);else for(n=0,s=r.length;!a&&n!==s;)a=r[n](e,t),n++;if(r=i[e.nodeName],!a&&r)if("function"==typeof r)a=r(e,t);else for(n=0,s=r.length;!a&&n!==s;)a=r[n](e,t),n++;for(o="string"==typeof e.className?e.className.split(" "):[],n=0;n<o.length;n++)if(r=i["."+o[n]],!a&&r)if("function"==typeof r)a=r(e,t);else for(n=0,s=r.length;!a&&n!==s;)a=r[n](e,t),n++;return a},y=function(e,t){var i,r,n,a,s,o,l,h,c;for(i=[],r=[],n=0,c=e.rows[0].cells.length,l=e.clientWidth;n<c;)h=e.rows[0].cells[n],r[n]={name:h.textContent.toLowerCase().replace(/\s+/g,""),prompt:h.textContent.replace(/\r?\n/g,""),width:h.clientWidth/l*t.pdf.internal.pageSize.getWidth()},n++;for(n=1;n<e.rows.length;){for(o=e.rows[n],s={},a=0;a<o.cells.length;)s[r[a].name]=o.cells[a].textContent.replace(/\r?\n/g,""),a++;i.push(s),n++}return{rows:i,headers:r}};var B={SCRIPT:1,STYLE:1,NOSCRIPT:1,OBJECT:1,EMBED:1,SELECT:1},C=1;r=function(e,n,a){var s,o,l,h,d,u,A,p;for(o=e.childNodes,s=void 0,(d="block"===(l=c(e)).display)&&(n.setBlockBoundary(),n.setBlockStyle(l)),h=0,u=o.length;h<u;){if("object"===i(s=o[h])){if(n.executeWatchFunctions(s),1===s.nodeType&&"HEADER"===s.nodeName){var f=s,w=n.pdf.margins_doc.top;n.pdf.internal.events.subscribe("addPage",function(e){n.y=w,r(f,n,a),n.pdf.margins_doc.top=n.y+10,n.y+=10},!1)}if(8===s.nodeType&&"#comment"===s.nodeName)~s.textContent.indexOf("ADD_PAGE")&&(n.pdf.addPage(),n.y=n.pdf.margins_doc.top);else if(1!==s.nodeType||B[s.nodeName])if(3===s.nodeType){var b=s.nodeValue;if(s.nodeValue&&"LI"===s.parentNode.nodeName)if("OL"===s.parentNode.parentNode.nodeName)b=C+++". "+b;else{var v=l["font-size"],x=(3-.75*v)*n.pdf.internal.scaleFactor,F=.75*v*n.pdf.internal.scaleFactor,S=1.74*v/n.pdf.internal.scaleFactor;p=function(e,t){this.pdf.circle(e+x,t+F,S,"FD")}}16&s.ownerDocument.body.compareDocumentPosition(s)&&n.addText(b,l)}else"string"==typeof s&&n.addText(s,l);else{var N;if("IMG"===s.nodeName){var E=s.getAttribute("src");N=g[n.pdf.sHashCode(E)||E]}if(N){n.pdf.internal.pageSize.getHeight()-n.pdf.margins_doc.bottom<n.y+s.height&&n.y>n.pdf.margins_doc.top&&(n.pdf.addPage(),n.y=n.pdf.margins_doc.top,n.executeWatchFunctions(s));var k=c(s),T=n.x,L=12/n.pdf.internal.scaleFactor,I=(k["margin-left"]+k["padding-left"])*L,D=(k["margin-right"]+k["padding-right"])*L,U=(k["margin-top"]+k["padding-top"])*L,P=(k["margin-bottom"]+k["padding-bottom"])*L;void 0!==k.float&&"right"===k.float?T+=n.settings.width-s.width-D:T+=I,n.pdf.addImage(N,T,n.y+U,s.width,s.height),N=void 0,"right"===k.float||"left"===k.float?(n.watchFunctions.push(function(e,t,i,r){return n.y>=t?(n.x+=e,n.settings.width+=i,!0):!!(r&&1===r.nodeType&&!B[r.nodeName]&&n.x+r.width>n.pdf.margins_doc.left+n.pdf.margins_doc.width)&&(n.x+=e,n.y=t,n.settings.width+=i,!0)}.bind(this,"left"===k.float?-s.width-I-D:0,n.y+s.height+U+P,s.width)),n.watchFunctions.push(function(e,t,i){return!(n.y<e&&t===n.pdf.internal.getNumberOfPages())||1===i.nodeType&&"both"===c(i).clear&&(n.y=e,!0)}.bind(this,n.y+s.height,n.pdf.internal.getNumberOfPages())),n.settings.width-=s.width+I+D,"left"===k.float&&(n.x+=s.width+I+D)):n.y+=s.height+U+P}else if("TABLE"===s.nodeName)A=y(s,n),n.y+=10,n.pdf.table(n.x,n.y,A.rows,A.headers,{autoSize:!1,printHeaders:a.printHeaders,margins:n.pdf.margins_doc,css:c(s)}),n.y=n.pdf.lastCellPos.y+n.pdf.lastCellPos.h+20;else if("OL"===s.nodeName||"UL"===s.nodeName)C=1,m(s,n,a)||r(s,n,a),n.y+=10;else if("LI"===s.nodeName){var R=n.x;n.x+=20/n.pdf.internal.scaleFactor,n.y+=3,m(s,n,a)||r(s,n,a),n.x=R}else"BR"===s.nodeName?(n.y+=l["font-size"]*n.pdf.internal.scaleFactor,n.addText("\u2028",t(l))):m(s,n,a)||r(s,n,a)}}h++}if(a.outY=n.y,d)return n.setBlockBoundary(p)},g={},w=function(e,t,i,r){var n,a=e.getElementsByTagName("img"),s=a.length,o=0;function l(){t.pdf.internal.events.publish("imagesLoaded"),r(n)}function h(e,i,r){if(e){var a=new Image;n=++o,a.crossOrigin="",a.onerror=a.onload=function(){if(a.complete&&(0===a.src.indexOf("data:image/")&&(a.width=i||a.width||0,a.height=r||a.height||0),a.width+a.height)){var n=t.pdf.sHashCode(e)||e;g[n]=g[n]||a}--o||l()},a.src=e}}for(;s--;)h(a[s].getAttribute("src"),a[s].width,a[s].height);return o||l()},b=function(e,t,i){var n=e.getElementsByTagName("footer");if(0<n.length){n=n[0];var a=t.pdf.internal.write,s=t.y;t.pdf.internal.write=function(){},r(n,t,i);var o=Math.ceil(t.y-s)+5;t.y=s,t.pdf.internal.write=a,t.pdf.margins_doc.bottom+=o;for(var l=function(e){var a=void 0!==e?e.pageNumber:1,s=t.y;t.y=t.pdf.internal.pageSize.getHeight()-t.pdf.margins_doc.bottom,t.pdf.margins_doc.bottom-=o;for(var l=n.getElementsByTagName("span"),h=0;h<l.length;++h)-1<(" "+l[h].className+" ").replace(/[\n\t]/g," ").indexOf(" pageCounter ")&&(l[h].innerHTML=a),-1<(" "+l[h].className+" ").replace(/[\n\t]/g," ").indexOf(" totalPages ")&&(l[h].innerHTML="###jsPDFVarTotalPages###");r(n,t,i),t.pdf.margins_doc.bottom+=o,t.y=s},h=n.getElementsByTagName("span"),c=0;c<h.length;++c)-1<(" "+h[c].className+" ").replace(/[\n\t]/g," ").indexOf(" totalPages ")&&t.pdf.internal.events.subscribe("htmlRenderingFinished",t.pdf.putTotalPages.bind(t.pdf,"###jsPDFVarTotalPages###"),!0);t.pdf.internal.events.subscribe("addPage",l,!1),l(),B.FOOTER=1}},v=function(e,t,i,n,a,s){if(!t)return!1;var o,l,h,c;"string"==typeof t||t.parentNode||(t=""+t.innerHTML),"string"==typeof t&&(o=t.replace(/<\/?script[^>]*?>/gi,""),c="jsPDFhtmlText"+Date.now().toString()+(1e3*Math.random()).toFixed(0),(h=document.createElement("div")).style.cssText="position: absolute !important;clip: rect(1px 1px 1px 1px); /* IE6, IE7 */clip: rect(1px, 1px, 1px, 1px);padding:0 !important;border:0 !important;height: 1px !important;width: 1px !important; top:auto;left:-100px;overflow: hidden;",h.innerHTML='<iframe style="height:1px;width:1px" name="'+c+'" />',document.body.appendChild(h),(l=window.frames[c]).document.open(),l.document.writeln(o),l.document.close(),t=l.document.body);var d,A=new u(e,i,n,a);return w.call(this,t,A,a.elementHandlers,function(e){b(t,A,a.elementHandlers),r(t,A,a.elementHandlers),A.pdf.internal.events.publish("htmlRenderingFinished"),d=A.dispose(),"function"==typeof s?s(d):e&&console.error("jsPDF Warning: rendering issues? provide a callback to fromHTML!")}),d||{x:A.x,y:A.y}},(u=function(e,t,i,r){return this.pdf=e,this.x=t,this.y=i,this.settings=r,this.watchFunctions=[],this.init(),this}).prototype.init=function(){return this.paragraph={text:[],style:[]},this.pdf.internal.write("q")},u.prototype.dispose=function(){return this.pdf.internal.write("Q"),{x:this.x,y:this.y,ready:!0}},u.prototype.executeWatchFunctions=function(e){var t=!1,i=[];if(0<this.watchFunctions.length){for(var r=0;r<this.watchFunctions.length;++r)!0===this.watchFunctions[r](e)?t=!0:i.push(this.watchFunctions[r]);this.watchFunctions=i}return t},u.prototype.splitFragmentsIntoLines=function(e,i){var r,n,a,s,o,l,h,c,d,u,A,p,f,m;for(u=this.pdf.internal.scaleFactor,s={},l=h=c=m=o=a=d=n=void 0,p=[A=[]],r=0,f=this.settings.width;e.length;)if(o=e.shift(),m=i.shift(),o)if((a=s[(n=m["font-family"])+(d=m["font-style"])])||(a=this.pdf.internal.getFont(n,d).metadata.Unicode,s[n+d]=a),c={widths:a.widths,kerning:a.kerning,fontSize:12*m["font-size"],textIndent:r},h=this.pdf.getStringUnitWidth(o,c)*c.fontSize/u,"\u2028"==o)A=[],p.push(A);else if(f<r+h){for(l=this.pdf.splitTextToSize(o,f,c),A.push([l.shift(),m]);l.length;)A=[[l.shift(),m]],p.push(A);r=this.pdf.getStringUnitWidth(A[0][0],c)*c.fontSize/u}else A.push([o,m]),r+=h;if(void 0!==m["text-align"]&&("center"===m["text-align"]||"right"===m["text-align"]||"justify"===m["text-align"]))for(var g=0;g<p.length;++g){var w=this.pdf.getStringUnitWidth(p[g][0][0],c)*c.fontSize/u;0<g&&(p[g][0][1]=t(p[g][0][1]));var b=f-w;if("right"===m["text-align"])p[g][0][1]["margin-left"]=b;else if("center"===m["text-align"])p[g][0][1]["margin-left"]=b/2;else if("justify"===m["text-align"]){var v=p[g][0][0].split(" ").length-1;p[g][0][1]["word-spacing"]=b/v,g===p.length-1&&(p[g][0][1]["word-spacing"]=0)}}return p},u.prototype.RenderTextFragment=function(e,t){var i,r;r=0,this.pdf.internal.pageSize.getHeight()-this.pdf.margins_doc.bottom<this.y+this.pdf.internal.getFontSize()&&(this.pdf.internal.write("ET","Q"),this.pdf.addPage(),this.y=this.pdf.margins_doc.top,this.pdf.internal.write("q","BT",this.getPdfColor(t.color),this.pdf.internal.getCoordinateString(this.x),this.pdf.internal.getVerticalCoordinateString(this.y),"Td"),r=Math.max(r,t["line-height"],t["font-size"]),this.pdf.internal.write(0,(-12*r).toFixed(2),"Td")),i=this.pdf.internal.getFont(t["font-family"],t["font-style"]);var n=this.getPdfColor(t.color);n!==this.lastTextColor&&(this.pdf.internal.write(n),this.lastTextColor=n),void 0!==t["word-spacing"]&&0<t["word-spacing"]&&this.pdf.internal.write(t["word-spacing"].toFixed(2),"Tw"),this.pdf.internal.write("/"+i.id,(12*t["font-size"]).toFixed(2),"Tf","("+this.pdf.internal.pdfEscape(e)+") Tj"),void 0!==t["word-spacing"]&&this.pdf.internal.write(0,"Tw")},u.prototype.getPdfColor=function(e){var t,i,r,n=/rgb\s*\(\s*(\d+),\s*(\d+),\s*(\d+\s*)\)/.exec(e);if(null!=n)t=parseInt(n[1]),i=parseInt(n[2]),r=parseInt(n[3]);else{if("string"==typeof e&&"#"!=e.charAt(0)){var a=new RGBColor(e);e=a.ok?a.toHex():"#000000"}t=e.substring(1,3),t=parseInt(t,16),i=e.substring(3,5),i=parseInt(i,16),r=e.substring(5,7),r=parseInt(r,16)}if("string"==typeof t&&/^#[0-9A-Fa-f]{6}$/.test(t)){var s=parseInt(t.substr(1),16);t=s>>16&255,i=s>>8&255,r=255&s}var o=this.f3;return 0===t&&0===i&&0===r||void 0===i?o(t/255)+" g":[o(t/255),o(i/255),o(r/255),"rg"].join(" ")},u.prototype.f3=function(e){return e.toFixed(3)},u.prototype.renderParagraph=function(e){var t,i,r,n,a,s,o,l,h,c,u,A,p;if(r=d(this.paragraph.text),A=this.paragraph.style,t=this.paragraph.blockstyle,this.paragraph.priorblockstyle,this.paragraph={text:[],style:[],blockstyle:{},priorblockstyle:t},r.join("").trim()){o=this.splitFragmentsIntoLines(r,A),l=s=void 0,i=12/this.pdf.internal.scaleFactor,this.priorMarginBottom=this.priorMarginBottom||0,u=(Math.max((t["margin-top"]||0)-this.priorMarginBottom,0)+(t["padding-top"]||0))*i,c=((t["margin-bottom"]||0)+(t["padding-bottom"]||0))*i,this.priorMarginBottom=t["margin-bottom"]||0,"always"===t["page-break-before"]&&(this.pdf.addPage(),this.y=0,u=((t["margin-top"]||0)+(t["padding-top"]||0))*i),h=this.pdf.internal.write,a=n=void 0,this.y+=u,h("q","BT 0 g",this.pdf.internal.getCoordinateString(this.x),this.pdf.internal.getVerticalCoordinateString(this.y),"Td");for(var f=0;o.length;){for(n=l=0,a=(s=o.shift()).length;n!==a;)s[n][0].trim()&&(l=Math.max(l,s[n][1]["line-height"],s[n][1]["font-size"]),p=7*s[n][1]["font-size"]),n++;var m=0,g=0;for(void 0!==s[0][1]["margin-left"]&&0<s[0][1]["margin-left"]&&(m=(g=this.pdf.internal.getCoordinateString(s[0][1]["margin-left"]))-f,f=g),h(m+Math.max(t["margin-left"]||0,0)*i,(-12*l).toFixed(2),"Td"),n=0,a=s.length;n!==a;)s[n][0]&&this.RenderTextFragment(s[n][0],s[n][1]),n++;if(this.y+=l*i,this.executeWatchFunctions(s[0][1])&&0<o.length){var w=[],b=[];o.forEach(function(e){for(var t=0,i=e.length;t!==i;)e[t][0]&&(w.push(e[t][0]+" "),b.push(e[t][1])),++t}),o=this.splitFragmentsIntoLines(d(w),b),h("ET","Q"),h("q","BT 0 g",this.pdf.internal.getCoordinateString(this.x),this.pdf.internal.getVerticalCoordinateString(this.y),"Td")}}return e&&"function"==typeof e&&e.call(this,this.x-9,this.y-p/2),h("ET","Q"),this.y+=c}},u.prototype.setBlockBoundary=function(e){return this.renderParagraph(e)},u.prototype.setBlockStyle=function(e){return this.paragraph.blockstyle=e},u.prototype.addText=function(e,t){return this.paragraph.text.push(e),this.paragraph.style.push(t)},n={helvetica:"helvetica","sans-serif":"helvetica","times new roman":"times",serif:"times",times:"times",monospace:"courier",courier:"courier"},o={100:"normal",200:"normal",300:"normal",400:"normal",500:"bold",600:"bold",700:"bold",800:"bold",900:"bold",normal:"normal",bold:"bold",bolder:"bold",lighter:"normal"},a={normal:"normal",italic:"italic",oblique:"italic"},s={left:"left",right:"right",center:"center",justify:"justify"},l={none:"none",right:"right",left:"left"},h={none:"none",both:"both"},f={normal:1},e.fromHTML=function(e,t,i,r,n,a){return this.margins_doc=a||{top:0,bottom:0},r||(r={}),r.elementHandlers||(r.elementHandlers={}),v(this,e,isNaN(t)?4:t,isNaN(i)?4:i,r,n)}}(de.API),de.API,("undefined"!=typeof window&&window||void 0!==Cd&&Cd).html2pdf=function(e,t,i){var r=t.canvas;if(r){var n,a;if((r.pdf=t).annotations={_nameMap:[],createAnnotation:function(e,i){var r,n=t.context2d._wrapX(i.left),a=t.context2d._wrapY(i.top),s=(t.context2d._page(i.top),e.indexOf("#"));r=0<=s?{name:e.substring(s+1)}:{url:e},t.link(n,a,i.right-i.left,i.bottom-i.top,r)},setName:function(e,i){var r=t.context2d._wrapX(i.left),n=t.context2d._wrapY(i.top),a=t.context2d._page(i.top);this._nameMap[e]={page:a,x:r,y:n}}},r.annotations=t.annotations,t.context2d._pageBreakAt=function(e){this.pageBreaks.push(e)},t.context2d._gotoPage=function(e){for(;t.internal.getNumberOfPages()<e;)t.addPage();t.setPage(e)},"string"==typeof e){e=e.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"");var s,o,l=document.createElement("iframe");document.body.appendChild(l),null!=(s=l.contentDocument)&&null!=s||(s=l.contentWindow.document),s.open(),s.write(e),s.close(),n=s.body,o=s.body||{},e=s.documentElement||{},a=Math.max(o.scrollHeight,o.offsetHeight,e.clientHeight,e.scrollHeight,e.offsetHeight)}else o=(n=e).body||{},a=Math.max(o.scrollHeight,o.offsetHeight,e.clientHeight,e.scrollHeight,e.offsetHeight);var h={async:!0,allowTaint:!0,backgroundColor:"#ffffff",canvas:r,imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1,windowHeight:a=t.internal.pageSize.getHeight(),scrollY:a};t.context2d.pageWrapYEnabled=!0,t.context2d.pageWrapY=t.internal.pageSize.getHeight(),html2canvas(n,h).then(function(e){i&&(l&&l.parentElement.removeChild(l),i(t))})}else alert("jsPDF canvas plugin not installed")},window.tmp=html2pdf,function(e){var t=e.BlobBuilder||e.WebKitBlobBuilder||e.MSBlobBuilder||e.MozBlobBuilder;e.URL=e.URL||e.webkitURL||function(e,t){return(t=document.createElement("a")).href=e,t};var i=e.Blob,r=URL.createObjectURL,n=URL.revokeObjectURL,a=e.Symbol&&e.Symbol.toStringTag,s=!1,o=!1,l=!!e.ArrayBuffer,h=t&&t.prototype.append&&t.prototype.getBlob;try{s=2===new Blob(["ä"]).size,o=2===new Blob([new Uint8Array([1,2])]).size}catch(s){}function c(e){return e.map(function(e){if(e.buffer instanceof ArrayBuffer){var t=e.buffer;if(e.byteLength!==t.byteLength){var i=new Uint8Array(e.byteLength);i.set(new Uint8Array(t,e.byteOffset,e.byteLength)),t=i.buffer}return t}return e})}function d(e,i){i=i||{};var r=new t;return c(e).forEach(function(e){r.append(e)}),i.type?r.getBlob(i.type):r.getBlob()}function u(e,t){return new i(c(e),t||{})}if(e.Blob&&(d.prototype=Blob.prototype,u.prototype=Blob.prototype),a)try{File.prototype[a]="File",Blob.prototype[a]="Blob",FileReader.prototype[a]="FileReader"}catch(s){}function A(){var t=!!e.ActiveXObject||"-ms-scroll-limit"in document.documentElement.style&&"-ms-ime-align"in document.documentElement.style,i=e.XMLHttpRequest&&e.XMLHttpRequest.prototype.send;t&&i&&(XMLHttpRequest.prototype.send=function(e){e instanceof Blob&&this.setRequestHeader("Content-Type",e.type),i.call(this,e)});try{new File([],"")}catch(t){try{var r=new Function('class File extends Blob {constructor(chunks, name, opts) {opts = opts || {};super(chunks, opts || {});this.name = name;this.lastModifiedDate = opts.lastModified ? new Date(opts.lastModified) : new Date;this.lastModified = +this.lastModifiedDate;}};return new File([], ""), File')();e.File=r}catch(t){r=function(e,t,i){var r=new Blob(e,i),n=i&&void 0!==i.lastModified?new Date(i.lastModified):new Date;return r.name=t,r.lastModifiedDate=n,r.lastModified=+n,r.toString=function(){return"[object File]"},a&&(r[a]="File"),r},e.File=r}}}s?(A(),e.Blob=o?e.Blob:u):h?(A(),e.Blob=d):function(){function t(e){for(var t=[],i=0;i<e.length;i++){var r=e.charCodeAt(i);r<128?t.push(r):r<2048?t.push(192|r>>6,128|63&r):r<55296||57344<=r?t.push(224|r>>12,128|r>>6&63,128|63&r):(i++,r=65536+((1023&r)<<10|1023&e.charCodeAt(i)),t.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|63&r))}return t}function i(e){var t,i,r,n,a,s;for(t="",r=e.length,i=0;i<r;)switch((n=e[i++])>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:t+=String.fromCharCode(n);break;case 12:case 13:a=e[i++],t+=String.fromCharCode((31&n)<<6|63&a);break;case 14:a=e[i++],s=e[i++],t+=String.fromCharCode((15&n)<<12|(63&a)<<6|63&s)}return t}function a(e){for(var t=new Array(e.byteLength),i=new Uint8Array(e),r=t.length;r--;)t[r]=i[r];return t}function s(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=[],r=0;r<e.length;r+=3){var n=e[r],a=r+1<e.length,s=a?e[r+1]:0,o=r+2<e.length,l=o?e[r+2]:0,h=n>>2,c=(3&n)<<4|s>>4,d=(15&s)<<2|l>>6,u=63&l;o||(u=64,a||(d=64)),i.push(t[h],t[c],t[d],t[u])}return i.join("")}var o=Object.create||function(e){function t(){}return t.prototype=e,new t};if(l)var h=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(e){return e&&-1<h.indexOf(Object.prototype.toString.call(e))};function d(e,i){for(var r=0,n=(e=e||[]).length;r<n;r++){var s=e[r];s instanceof d?e[r]=s._buffer:"string"==typeof s?e[r]=t(s):l&&(ArrayBuffer.prototype.isPrototypeOf(s)||c(s))?e[r]=a(s):l&&(o=s)&&DataView.prototype.isPrototypeOf(o)?e[r]=a(s.buffer):e[r]=t(String(s))}var o;this._buffer=[].concat.apply([],e),this.size=this._buffer.length,this.type=i&&i.type||""}function u(e,t,i){var r=d.call(this,e,i=i||{})||this;return r.name=t,r.lastModifiedDate=i.lastModified?new Date(i.lastModified):new Date,r.lastModified=+r.lastModifiedDate,r}if(d.prototype.slice=function(e,t,i){return new d([this._buffer.slice(e||0,t||this._buffer.length)],{type:i})},d.prototype.toString=function(){return"[object Blob]"},(u.prototype=o(d.prototype)).constructor=u,Object.setPrototypeOf)Object.setPrototypeOf(u,d);else try{u.__proto__=d}catch(o){}function A(){if(!(this instanceof A))throw new TypeError("Failed to construct 'FileReader': Please use the 'new' operator, this DOM object constructor cannot be called as a function.");var e=document.createDocumentFragment();this.addEventListener=e.addEventListener,this.dispatchEvent=function(t){var i=this["on"+t.type];"function"==typeof i&&i(t),e.dispatchEvent(t)},this.removeEventListener=e.removeEventListener}function p(e,t,i){if(!(t instanceof d))throw new TypeError("Failed to execute '"+i+"' on 'FileReader': parameter 1 is not of type 'Blob'.");e.result="",setTimeout(function(){this.readyState=A.LOADING,e.dispatchEvent(new Event("load")),e.dispatchEvent(new Event("loadend"))})}u.prototype.toString=function(){return"[object File]"},A.EMPTY=0,A.LOADING=1,A.DONE=2,A.prototype.error=null,A.prototype.onabort=null,A.prototype.onerror=null,A.prototype.onload=null,A.prototype.onloadend=null,A.prototype.onloadstart=null,A.prototype.onprogress=null,A.prototype.readAsDataURL=function(e){p(this,e,"readAsDataURL"),this.result="data:"+e.type+";base64,"+s(e._buffer)},A.prototype.readAsText=function(e){p(this,e,"readAsText"),this.result=i(e._buffer)},A.prototype.readAsArrayBuffer=function(e){p(this,e,"readAsText"),this.result=e._buffer.slice()},A.prototype.abort=function(){},URL.createObjectURL=function(e){return e instanceof d?"data:"+e.type+";base64,"+s(e._buffer):r.call(URL,e)},URL.revokeObjectURL=function(e){n&&n.call(URL,e)};var f=e.XMLHttpRequest&&e.XMLHttpRequest.prototype.send;f&&(XMLHttpRequest.prototype.send=function(e){e instanceof d?(this.setRequestHeader("Content-Type",e.type),f.call(this,i(e._buffer))):f.call(this,e)}),e.FileReader=A,e.File=u,e.Blob=d}()}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||void 0!==Cd&&Cd||Function('return typeof this === "object" && this.content')()||Function("return this")());var ue,Ae,pe,fe,me,ge,we,be,ve,ye,Be,Ce,xe,Fe,Se,Ne=Ne||function(e){if(!(void 0===e||"undefined"!=typeof navigator&&/MSIE [1-9]\./.test(navigator.userAgent))){var t=e.document,i=function(){return e.URL||e.webkitURL||e},r=t.createElementNS("http://www.w3.org/1999/xhtml","a"),n="download"in r,a=/constructor/i.test(e.HTMLElement)||e.safari,s=/CriOS\/[\d]+/.test(navigator.userAgent),o=e.setImmediate||e.setTimeout,l=function(e){o(function(){throw e},0)},h=function(e){setTimeout(function(){"string"==typeof e?i().revokeObjectURL(e):e.remove()},4e4)},c=function(e){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([String.fromCharCode(65279),e],{type:e.type}):e},d=function(t,d,u){u||(t=c(t));var A,p=this,f="application/octet-stream"===t.type,m=function(){!function(e,t,i){for(var r=(t=[].concat(t)).length;r--;){var n=e["on"+t[r]];if("function"==typeof n)try{n.call(e,i||e)}catch(e){l(e)}}}(p,"writestart progress write writeend".split(" "))};if(p.readyState=p.INIT,n)return A=i().createObjectURL(t),void o(function(){var e,t;r.href=A,r.download=d,e=r,t=new MouseEvent("click"),e.dispatchEvent(t),m(),h(A),p.readyState=p.DONE},0);!function(){if((s||f&&a)&&e.FileReader){var r=new FileReader;return r.onloadend=function(){var t=s?r.result:r.result.replace(/^data:[^;]*;/,"data:attachment/file;");e.open(t,"_blank")||(e.location.href=t),t=void 0,p.readyState=p.DONE,m()},r.readAsDataURL(t),p.readyState=p.INIT}A||(A=i().createObjectURL(t)),f?e.location.href=A:e.open(A,"_blank")||(e.location.href=A),p.readyState=p.DONE,m(),h(A)}()},u=d.prototype;return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(e,t,i){return t=t||e.name||"download",i||(e=c(e)),navigator.msSaveOrOpenBlob(e,t)}:(u.abort=function(){},u.readyState=u.INIT=0,u.WRITING=1,u.DONE=2,u.error=u.onwritestart=u.onprogress=u.onwrite=u.onabort=u.onerror=u.onwriteend=null,function(e,t,i){return new d(e,t||e.name||"download",i)})}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||void 0);function Ee(e){var t=0;if(71!==e[t++]||73!==e[t++]||70!==e[t++]||56!==e[t++]||56!=(e[t++]+1&253)||97!==e[t++])throw"Invalid GIF 87a/89a header.";var i=e[t++]|e[t++]<<8,r=e[t++]|e[t++]<<8,n=e[t++],a=n>>7,s=1<<1+(7&n);e[t++],e[t++];var o=null;a&&(o=t,t+=3*s);var l=!0,h=[],c=0,d=null,u=0,A=null;for(this.width=i,this.height=r;l&&t<e.length;)switch(e[t++]){case 33:switch(e[t++]){case 255:if(11!==e[t]||78==e[t+1]&&69==e[t+2]&&84==e[t+3]&&83==e[t+4]&&67==e[t+5]&&65==e[t+6]&&80==e[t+7]&&69==e[t+8]&&50==e[t+9]&&46==e[t+10]&&48==e[t+11]&&3==e[t+12]&&1==e[t+13]&&0==e[t+16])t+=14,A=e[t++]|e[t++]<<8,t++;else for(t+=12;0!==(x=e[t++]);)t+=x;break;case 249:if(4!==e[t++]||0!==e[t+4])throw"Invalid graphics extension block.";var p=e[t++];c=e[t++]|e[t++]<<8,d=e[t++],!(1&p)&&(d=null),u=p>>2&7,t++;break;case 254:for(;0!==(x=e[t++]);)t+=x;break;default:throw"Unknown graphic control label: 0x"+e[t-1].toString(16)}break;case 44:var f=e[t++]|e[t++]<<8,m=e[t++]|e[t++]<<8,g=e[t++]|e[t++]<<8,w=e[t++]|e[t++]<<8,b=e[t++],v=b>>6&1,y=o,B=!1;b>>7&&(B=!0,y=t,t+=3*(1<<1+(7&b)));var C=t;for(t++;;){var x;if(0===(x=e[t++]))break;t+=x}h.push({x:f,y:m,width:g,height:w,has_local_palette:B,palette_offset:y,data_offset:C,data_length:t-C,transparent_index:d,interlaced:!!v,delay:c,disposal:u});break;case 59:l=!1;break;default:throw"Unknown gif block: 0x"+e[t-1].toString(16)}this.numFrames=function(){return h.length},this.loopCount=function(){return A},this.frameInfo=function(e){if(e<0||e>=h.length)throw"Frame index out of range.";return h[e]},this.decodeAndBlitFrameBGRA=function(t,r){var n=this.frameInfo(t),a=n.width*n.height,s=new Uint8Array(a);ke(e,n.data_offset,s,a);var o=n.palette_offset,l=n.transparent_index;null===l&&(l=256);var h=n.width,c=i-h,d=h,u=4*(n.y*i+n.x),A=4*((n.y+n.height)*i+n.x),p=u,f=4*c;!0===n.interlaced&&(f+=4*(h+c)*7);for(var m=8,g=0,w=s.length;g<w;++g){var b=s[g];if(0===d&&(d=h,A<=(p+=f)&&(f=c+4*(h+c)*(m-1),p=u+(h+c)*(m<<1),m>>=1)),b===l)p+=4;else{var v=e[o+3*b],y=e[o+3*b+1],B=e[o+3*b+2];r[p++]=B,r[p++]=y,r[p++]=v,r[p++]=255}--d}},this.decodeAndBlitFrameRGBA=function(t,r){var n=this.frameInfo(t),a=n.width*n.height,s=new Uint8Array(a);ke(e,n.data_offset,s,a);var o=n.palette_offset,l=n.transparent_index;null===l&&(l=256);var h=n.width,c=i-h,d=h,u=4*(n.y*i+n.x),A=4*((n.y+n.height)*i+n.x),p=u,f=4*c;!0===n.interlaced&&(f+=4*(h+c)*7);for(var m=8,g=0,w=s.length;g<w;++g){var b=s[g];if(0===d&&(d=h,A<=(p+=f)&&(f=c+4*(h+c)*(m-1),p=u+(h+c)*(m<<1),m>>=1)),b===l)p+=4;else{var v=e[o+3*b],y=e[o+3*b+1],B=e[o+3*b+2];r[p++]=v,r[p++]=y,r[p++]=B,r[p++]=255}--d}}}function ke(e,t,i,r){for(var n=e[t++],a=1<<n,s=a+1,o=s+1,l=n+1,h=(1<<l)-1,c=0,d=0,u=0,A=e[t++],p=new Int32Array(4096),f=null;;){for(;c<16&&0!==A;)d|=e[t++]<<c,c+=8,1===A?A=e[t++]:--A;if(c<l)break;var m=d&h;if(d>>=l,c-=l,m!==a){if(m===s)break;for(var g=m<o?m:f,w=0,b=g;a<b;)b=p[b]>>8,++w;var v=b;if(r<u+w+(g!==m?1:0))return void console.log("Warning, gif stream longer than expected.");i[u++]=v;var y=u+=w;for(g!==m&&(i[u++]=v),b=g;w--;)b=p[b],i[--y]=255&b,b>>=8;null!==f&&o<4096&&(p[o++]=f<<8|v,h+1<=o&&l<12&&(++l,h=h<<1|1)),f=m}else o=s+1,h=(1<<(l=n+1))-1,f=null}return u!==r&&console.log("Warning, gif stream shorter than expected."),i}try{t.GifWriter=function(e,t,i,r){var n=0,a=void 0===(r=void 0===r?{}:r).loop?null:r.loop,s=void 0===r.palette?null:r.palette;if(t<=0||i<=0||65535<t||65535<i)throw"Width/Height invalid.";function o(e){var t=e.length;if(t<2||256<t||t&t-1)throw"Invalid code/color length, must be power of 2 and 2 .. 256.";return t}e[n++]=71,e[n++]=73,e[n++]=70,e[n++]=56,e[n++]=57,e[n++]=97;var l=0,h=0;if(null!==s){for(var c=o(s);c>>=1;)++l;if(c=1<<l,--l,void 0!==r.background){if(c<=(h=r.background))throw"Background index out of range.";if(0===h)throw"Background index explicitly passed as 0."}}if(e[n++]=255&t,e[n++]=t>>8&255,e[n++]=255&i,e[n++]=i>>8&255,e[n++]=(null!==s?128:0)|l,e[n++]=h,e[n++]=0,null!==s)for(var d=0,u=s.length;d<u;++d){var A=s[d];e[n++]=A>>16&255,e[n++]=A>>8&255,e[n++]=255&A}if(null!==a){if(a<0||65535<a)throw"Loop count invalid.";e[n++]=33,e[n++]=255,e[n++]=11,e[n++]=78,e[n++]=69,e[n++]=84,e[n++]=83,e[n++]=67,e[n++]=65,e[n++]=80,e[n++]=69,e[n++]=50,e[n++]=46,e[n++]=48,e[n++]=3,e[n++]=1,e[n++]=255&a,e[n++]=a>>8&255,e[n++]=0}var p=!1;this.addFrame=function(t,i,r,a,l,h){if(!0===p&&(--n,p=!1),h=void 0===h?{}:h,t<0||i<0||65535<t||65535<i)throw"x/y invalid.";if(r<=0||a<=0||65535<r||65535<a)throw"Width/Height invalid.";if(l.length<r*a)throw"Not enough pixels for the frame size.";var c=!0,d=h.palette;if(null==d&&(c=!1,d=s),null==d)throw"Must supply either a local or global palette.";for(var u=o(d),A=0;u>>=1;)++A;u=1<<A;var f=void 0===h.delay?0:h.delay,m=void 0===h.disposal?0:h.disposal;if(m<0||3<m)throw"Disposal out of range.";var g=!1,w=0;if(void 0!==h.transparent&&null!==h.transparent&&(g=!0,(w=h.transparent)<0||u<=w))throw"Transparent color index.";if((0!==m||g||0!==f)&&(e[n++]=33,e[n++]=249,e[n++]=4,e[n++]=m<<2|(!0===g?1:0),e[n++]=255&f,e[n++]=f>>8&255,e[n++]=w,e[n++]=0),e[n++]=44,e[n++]=255&t,e[n++]=t>>8&255,e[n++]=255&i,e[n++]=i>>8&255,e[n++]=255&r,e[n++]=r>>8&255,e[n++]=255&a,e[n++]=a>>8&255,e[n++]=!0===c?128|A-1:0,!0===c)for(var b=0,v=d.length;b<v;++b){var y=d[b];e[n++]=y>>16&255,e[n++]=y>>8&255,e[n++]=255&y}n=function(e,t,i,r){e[t++]=i;var n=t++,a=1<<i,s=a-1,o=a+1,l=o+1,h=i+1,c=0,d=0;function u(i){for(;i<=c;)e[t++]=255&d,d>>=8,c-=8,t===n+256&&(e[n]=255,n=t++)}function A(e){d|=e<<c,c+=h,u(8)}var p=r[0]&s,f={};A(a);for(var m=1,g=r.length;m<g;++m){var w=r[m]&s,b=p<<8|w,v=f[b];if(void 0===v){for(d|=p<<c,c+=h;8<=c;)e[t++]=255&d,d>>=8,c-=8,t===n+256&&(e[n]=255,n=t++);4096===l?(A(a),l=o+1,h=i+1,f={}):(1<<h<=l&&++h,f[b]=l++),p=w}else p=v}return A(p),A(o),u(1),n+1===t?e[n]=0:(e[n]=t-n-1,e[t++]=0),t}(e,n,A<2?2:A,l)},this.end=function(){return!1===p&&(e[n++]=59,p=!0),n}},t.GifReader=Ee}catch(r){}function Te(e){var t,i,r,n,a,s=Math.floor,o=new Array(64),l=new Array(64),h=new Array(64),c=new Array(64),d=new Array(65535),u=new Array(65535),A=new Array(64),p=new Array(64),f=[],m=0,g=7,w=new Array(64),b=new Array(64),v=new Array(64),y=new Array(256),B=new Array(2048),C=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],x=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],F=[0,1,2,3,4,5,6,7,8,9,10,11],S=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],N=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],E=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],k=[0,1,2,3,4,5,6,7,8,9,10,11],T=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],L=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function I(e,t){for(var i=0,r=0,n=new Array,a=1;a<=16;a++){for(var s=1;s<=e[a];s++)n[t[r]]=[],n[t[r]][0]=i,n[t[r]][1]=a,r++,i++;i*=2}return n}function D(e){for(var t=e[0],i=e[1]-1;0<=i;)t&1<<i&&(m|=1<<g),i--,--g<0&&(255==m?(U(255),U(0)):U(m),g=7,m=0)}function U(e){f.push(e)}function P(e){U(e>>8&255),U(255&e)}function R(e,t,i,r,n){for(var a,s=n[0],o=n[240],l=function(e,t){var i,r,n,a,s,o,l,h,c,d,u=0;for(c=0;c<8;++c){i=e[u],r=e[u+1],n=e[u+2],a=e[u+3],s=e[u+4],o=e[u+5],l=e[u+6];var p=i+(h=e[u+7]),f=i-h,m=r+l,g=r-l,w=n+o,b=n-o,v=a+s,y=a-s,B=p+v,C=p-v,x=m+w,F=m-w;e[u]=B+x,e[u+4]=B-x;var S=.707106781*(F+C);e[u+2]=C+S,e[u+6]=C-S;var N=.382683433*((B=y+b)-(F=g+f)),E=.5411961*B+N,k=1.306562965*F+N,T=.707106781*(x=b+g),L=f+T,I=f-T;e[u+5]=I+E,e[u+3]=I-E,e[u+1]=L+k,e[u+7]=L-k,u+=8}for(c=u=0;c<8;++c){i=e[u],r=e[u+8],n=e[u+16],a=e[u+24],s=e[u+32],o=e[u+40],l=e[u+48];var D=i+(h=e[u+56]),U=i-h,P=r+l,R=r-l,O=n+o,Q=n-o,H=a+s,M=a-s,_=D+H,j=D-H,z=P+O,V=P-O;e[u]=_+z,e[u+32]=_-z;var K=.707106781*(V+j);e[u+16]=j+K,e[u+48]=j-K;var q=.382683433*((_=M+Q)-(V=R+U)),G=.5411961*_+q,W=1.306562965*V+q,J=.707106781*(z=Q+R),X=U+J,Y=U-J;e[u+40]=Y+G,e[u+24]=Y-G,e[u+8]=X+W,e[u+56]=X-W,u++}for(c=0;c<64;++c)d=e[c]*t[c],A[c]=0<d?d+.5|0:d-.5|0;return A}(e,t),h=0;h<64;++h)p[C[h]]=l[h];var c=p[0]-i;i=p[0],0==c?D(r[0]):(D(r[u[a=32767+c]]),D(d[a]));for(var f=63;0<f&&0==p[f];f--);if(0==f)return D(s),i;for(var m,g=1;g<=f;){for(var w=g;0==p[g]&&g<=f;++g);var b=g-w;if(16<=b){m=b>>4;for(var v=1;v<=m;++v)D(o);b&=15}a=32767+p[g],D(n[(b<<4)+u[a]]),D(d[a]),g++}return 63!=f&&D(s),i}function O(e){e<=0&&(e=1),100<e&&(e=100),a!=e&&(function(e){for(var t=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],i=0;i<64;i++){var r=s((t[i]*e+50)/100);r<1?r=1:255<r&&(r=255),o[C[i]]=r}for(var n=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],a=0;a<64;a++){var d=s((n[a]*e+50)/100);d<1?d=1:255<d&&(d=255),l[C[a]]=d}for(var u=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],A=0,p=0;p<8;p++)for(var f=0;f<8;f++)h[A]=1/(o[C[A]]*u[p]*u[f]*8),c[A]=1/(l[C[A]]*u[p]*u[f]*8),A++}(e<50?Math.floor(5e3/e):Math.floor(200-2*e)),a=e)}this.encode=function(e,a){var s,d;(new Date).getTime(),a&&O(a),f=new Array,m=0,g=7,P(65496),P(65504),P(16),U(74),U(70),U(73),U(70),U(0),U(1),U(1),U(0),P(1),P(1),U(0),U(0),function(){P(65499),P(132),U(0);for(var e=0;e<64;e++)U(o[e]);U(1);for(var t=0;t<64;t++)U(l[t])}(),s=e.width,d=e.height,P(65472),P(17),U(8),P(d),P(s),U(3),U(1),U(17),U(0),U(2),U(17),U(1),U(3),U(17),U(1),function(){P(65476),P(418),U(0);for(var e=0;e<16;e++)U(x[e+1]);for(var t=0;t<=11;t++)U(F[t]);U(16);for(var i=0;i<16;i++)U(S[i+1]);for(var r=0;r<=161;r++)U(N[r]);U(1);for(var n=0;n<16;n++)U(E[n+1]);for(var a=0;a<=11;a++)U(k[a]);U(17);for(var s=0;s<16;s++)U(T[s+1]);for(var o=0;o<=161;o++)U(L[o])}(),P(65498),P(12),U(3),U(1),U(0),U(2),U(17),U(3),U(17),U(0),U(63),U(0);var u=0,A=0,p=0;m=0,g=7,this.encode.displayName="_encode_";for(var y,C,I,Q,H,M,_,j,z,V=e.data,K=e.width,q=e.height,G=4*K,W=0;W<q;){for(y=0;y<G;){for(M=H=G*W+y,_=-1,z=j=0;z<64;z++)M=H+(j=z>>3)*G+(_=4*(7&z)),q<=W+j&&(M-=G*(W+1+j-q)),G<=y+_&&(M-=y+_-G+4),C=V[M++],I=V[M++],Q=V[M++],w[z]=(B[C]+B[I+256|0]+B[Q+512|0]>>16)-128,b[z]=(B[C+768|0]+B[I+1024|0]+B[Q+1280|0]>>16)-128,v[z]=(B[C+1280|0]+B[I+1536|0]+B[Q+1792|0]>>16)-128;u=R(w,h,u,t,r),A=R(b,c,A,i,n),p=R(v,c,p,i,n),y+=32}W+=8}if(0<=g){var J=[];J[1]=g+1,J[0]=(1<<g+1)-1,D(J)}return P(65497),new Uint8Array(f)},(new Date).getTime(),e||(e=50),function(){for(var e=String.fromCharCode,t=0;t<256;t++)y[t]=e(t)}(),t=I(x,F),i=I(E,k),r=I(S,N),n=I(T,L),function(){for(var e=1,t=2,i=1;i<=15;i++){for(var r=e;r<t;r++)u[32767+r]=i,d[32767+r]=[],d[32767+r][1]=i,d[32767+r][0]=r;for(var n=-(t-1);n<=-e;n++)u[32767+n]=i,d[32767+n]=[],d[32767+n][1]=i,d[32767+n][0]=t-1+n;e<<=1,t<<=1}}(),function(){for(var e=0;e<256;e++)B[e]=19595*e,B[e+256|0]=38470*e,B[e+512|0]=7471*e+32768,B[e+768|0]=-11059*e,B[e+1024|0]=-21709*e,B[e+1280|0]=32768*e+8421375,B[e+1536|0]=-27439*e,B[e+1792|0]=-5329*e}(),O(e),(new Date).getTime()}function Le(e,t){if(this.pos=0,this.buffer=e,this.datav=new DataView(e.buffer),this.is_with_alpha=!!t,this.bottom_up=!0,this.flag=String.fromCharCode(this.buffer[0])+String.fromCharCode(this.buffer[1]),this.pos+=2,-1===["BM","BA","CI","CP","IC","PT"].indexOf(this.flag))throw new Error("Invalid BMP File");this.parseHeader(),this.parseBGR()}window.tmp=Ee,de.API.adler32cs=(ge="function"==typeof ArrayBuffer&&"function"==typeof Uint8Array,we=null,be=function(){if(!ge)return function(){return!1};try{var e={};"function"==typeof e.Buffer&&(we=e.Buffer)}catch(e){}return function(e){return e instanceof ArrayBuffer||null!==we&&e instanceof we}}(),ve=null!==we?function(e){return new we(e,"utf8").toString("binary")}:function(e){return unescape(encodeURIComponent(e))},ye=function(e,t){for(var i=65535&e,r=e>>>16,n=0,a=t.length;n<a;n++)r=(r+(i=(i+(255&t.charCodeAt(n)))%65521))%65521;return(r<<16|i)>>>0},Be=function(e,t){for(var i=65535&e,r=e>>>16,n=0,a=t.length;n<a;n++)r=(r+(i=(i+t[n])%65521))%65521;return(r<<16|i)>>>0},xe=(Ce={}).Adler32=(((me=(fe=function(e){if(!(this instanceof fe))throw new TypeError("Constructor cannot called be as a function.");if(!isFinite(e=null==e?1:+e))throw new Error("First arguments needs to be a finite number.");this.checksum=e>>>0}).prototype={}).constructor=fe).from=((ue=function(e){if(!(this instanceof fe))throw new TypeError("Constructor cannot called be as a function.");if(null==e)throw new Error("First argument needs to be a string.");this.checksum=ye(1,e.toString())}).prototype=me,ue),fe.fromUtf8=((Ae=function(e){if(!(this instanceof fe))throw new TypeError("Constructor cannot called be as a function.");if(null==e)throw new Error("First argument needs to be a string.");var t=ve(e.toString());this.checksum=ye(1,t)}).prototype=me,Ae),ge&&(fe.fromBuffer=((pe=function(e){if(!(this instanceof fe))throw new TypeError("Constructor cannot called be as a function.");if(!be(e))throw new Error("First argument needs to be ArrayBuffer.");var t=new Uint8Array(e);return this.checksum=Be(1,t)}).prototype=me,pe)),me.update=function(e){if(null==e)throw new Error("First argument needs to be a string.");return e=e.toString(),this.checksum=ye(this.checksum,e)},me.updateUtf8=function(e){if(null==e)throw new Error("First argument needs to be a string.");var t=ve(e.toString());return this.checksum=ye(this.checksum,t)},ge&&(me.updateBuffer=function(e){if(!be(e))throw new Error("First argument needs to be ArrayBuffer.");var t=new Uint8Array(e);return this.checksum=Be(this.checksum,t)}),me.clone=function(){return new xe(this.checksum)},fe),Ce.from=function(e){if(null==e)throw new Error("First argument needs to be a string.");return ye(1,e.toString())},Ce.fromUtf8=function(e){if(null==e)throw new Error("First argument needs to be a string.");var t=ve(e.toString());return ye(1,t)},ge&&(Ce.fromBuffer=function(e){if(!be(e))throw new Error("First argument need to be ArrayBuffer.");var t=new Uint8Array(e);return Be(1,t)}),Ce),function(e){e.__bidiEngine__=e.prototype.__bidiEngine__=function(e){var i,r,n,a,s,o,l,h=t,c=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],d=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],u={L:0,R:1,EN:2,AN:3,N:4,B:5,S:6},A={0:0,5:1,6:2,7:3,32:4,251:5,254:6,255:7},p=["(",")","(","<",">","<","[","]","[","{","}","{","«","»","«","‹","›","‹","⁅","⁆","⁅","⁽","⁾","⁽","₍","₎","₍","≤","≥","≤","〈","〉","〈","﹙","﹚","﹙","﹛","﹜","﹛","﹝","﹞","﹝","﹤","﹥","﹤"],f=new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/),m=!1,g=0;this.__bidiEngine__={};var w=function(e){var t=e.charCodeAt(),i=t>>8,r=A[i];return void 0!==r?h[256*r+(255&t)]:252===i||253===i?"AL":f.test(i)?"L":8===i?"R":"N"},b=function(e){for(var t,i=0;i<e.length;i++){if("L"===(t=w(e.charAt(i))))return!1;if("R"===t)return!0}return!1},v=function(e,t,s,o){var l,h,c,d,u=t[o];switch(u){case"L":case"R":case"LRE":case"RLE":case"LRO":case"RLO":case"PDF":m=!1;break;case"N":case"AN":break;case"EN":m&&(u="AN");break;case"AL":m=!0,u="R";break;case"WS":case"BN":u="N";break;case"CS":o<1||o+1>=t.length||"EN"!==(l=s[o-1])&&"AN"!==l||"EN"!==(h=t[o+1])&&"AN"!==h?u="N":m&&(h="AN"),u=h===l?h:"N";break;case"ES":u="EN"===(l=0<o?s[o-1]:"B")&&o+1<t.length&&"EN"===t[o+1]?"EN":"N";break;case"ET":if(0<o&&"EN"===s[o-1]){u="EN";break}if(m){u="N";break}for(c=o+1,d=t.length;c<d&&"ET"===t[c];)c++;u=c<d&&"EN"===t[c]?"EN":"N";break;case"NSM":if(n&&!a){for(d=t.length,c=o+1;c<d&&"NSM"===t[c];)c++;if(c<d){var A=e[o],p=1425<=A&&A<=2303||64286===A;if(l=t[c],p&&("R"===l||"AL"===l)){u="R";break}}}u=o<1||"B"===(l=t[o-1])?"N":s[o-1];break;case"B":i=!(m=!1),u=g;break;case"S":r=!0,u="N"}return u},y=function(e,t,i){var r=e.split("");return i&&B(r,i,{hiLevel:g}),r.reverse(),t&&t.reverse(),r.join("")},B=function(e,t,n){var a,s,o,l,h,A=-1,p=e.length,f=0,b=[],y=g?d:c,B=[];for(r=i=m=!1,s=0;s<p;s++)B[s]=w(e[s]);for(o=0;o<p;o++){if(h=f,b[o]=v(e,B,b,o),a=240&(f=y[h][u[b[o]]]),f&=15,t[o]=l=y[f][5],0<a)if(16===a){for(s=A;s<o;s++)t[s]=1;A=-1}else A=-1;if(y[f][6])-1===A&&(A=o);else if(-1<A){for(s=A;s<o;s++)t[s]=l;A=-1}"B"===B[o]&&(t[o]=0),n.hiLevel|=l}r&&function(e,t,i){for(var r=0;r<i;r++)if("S"===e[r]){t[r]=g;for(var n=r-1;0<=n&&"WS"===e[n];n--)t[n]=g}}(B,t,p)},C=function(e,t,r,n,a){if(!(a.hiLevel<e)){if(1===e&&1===g&&!i)return t.reverse(),void(r&&r.reverse());for(var s,o,l,h,c=t.length,d=0;d<c;){if(n[d]>=e){for(l=d+1;l<c&&n[l]>=e;)l++;for(h=d,o=l-1;h<o;h++,o--)s=t[h],t[h]=t[o],t[o]=s,r&&(s=r[h],r[h]=r[o],r[o]=s);d=l}d++}}},x=function(e,t,i){var r=e.split(""),n={hiLevel:g};return i||(i=[]),B(r,i,n),function(e,t,i){if(0!==i.hiLevel&&l)for(var r,n=0;n<e.length;n++)1===t[n]&&0<=(r=p.indexOf(e[n]))&&(e[n]=p[r+1])}(r,i,n),C(2,r,t,i,n),C(1,r,t,i,n),r.join("")};return this.__bidiEngine__.doBidiReorder=function(e,t,i){if(function(e,t){if(t)for(var i=0;i<e.length;i++)t[i]=i;void 0===a&&(a=b(e)),void 0===o&&(o=b(e))}(e,t),n||!s||o)if(n&&s&&a^o)g=a?1:0,e=y(e,t,i);else if(!n&&s&&o)g=a?1:0,e=x(e,t,i),e=y(e,t);else if(!n||a||s||o){if(n&&!s&&a^o)e=y(e,t),e=a?(g=0,x(e,t,i)):(g=1,e=x(e,t,i),y(e,t));else if(n&&a&&!s&&o)g=1,e=x(e,t,i),e=y(e,t);else if(!n&&!s&&a^o){var r=l;a?(g=1,e=x(e,t,i),g=0,l=!1,e=x(e,t,i),l=r):(g=0,e=x(e,t,i),e=y(e,t),l=!(g=1),e=x(e,t,i),l=r,e=y(e,t))}}else g=0,e=x(e,t,i);else g=a?1:0,e=x(e,t,i);return e},this.__bidiEngine__.setOptions=function(e){e&&(n=e.isInputVisual,s=e.isOutputVisual,a=e.isInputRtl,o=e.isOutputRtl,l=e.isSymmetricSwapping)},this.__bidiEngine__.setOptions(e),this.__bidiEngine__};var t=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","N","ET","ET","ET","ET","N","N","N","N","L","N","N","BN","N","N","ET","ET","EN","EN","N","L","N","N","N","EN","L","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","N","N","N","N","N","ET","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","NSM","R","NSM","NSM","R","NSM","NSM","R","NSM","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","N","N","N","N","N","R","R","R","R","R","N","N","N","N","N","N","N","N","N","N","N","AN","AN","AN","AN","AN","AN","N","N","AL","ET","ET","AL","CS","AL","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","N","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","NSM","NSM","N","NSM","NSM","NSM","NSM","AL","AL","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","R","N","N","N","N","R","N","N","N","N","N","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","BN","BN","BN","L","R","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","B","LRE","RLE","PDF","LRO","RLO","CS","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","BN","BN","BN","BN","BN","N","LRI","RLI","FSI","PDI","BN","BN","BN","BN","BN","BN","EN","L","N","N","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","L","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","N","N","N","N","N","R","NSM","R","R","R","R","R","R","R","R","R","R","ES","R","R","R","R","R","R","R","R","R","R","R","R","R","N","R","R","R","R","R","N","R","N","R","R","N","R","R","N","R","R","R","R","R","R","R","R","R","R","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","CS","N","N","CS","N","N","N","N","N","N","N","N","N","ET","N","N","ES","ES","N","N","N","N","N","ET","ET","N","N","N","N","N","AL","AL","AL","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","BN","N","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","N","N","N","ET","ET","N","N","N","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N"],i=new e.__bidiEngine__({isInputVisual:!0});e.API.events.push(["postProcessText",function(e){var t=e.text,r=(e.x,e.y,e.options||{}),n=(e.mutex,r.lang,[]);if("[object Array]"===Object.prototype.toString.call(t)){var a=0;for(n=[],a=0;a<t.length;a+=1)"[object Array]"===Object.prototype.toString.call(t[a])?n.push([i.doBidiReorder(t[a][0]),t[a][1],t[a][2]]):n.push([i.doBidiReorder(t[a])]);e.text=n}else e.text=i.doBidiReorder(t)}])}(de),window.tmp=Te,Le.prototype.parseHeader=function(){if(this.fileSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.reserved=this.datav.getUint32(this.pos,!0),this.pos+=4,this.offset=this.datav.getUint32(this.pos,!0),this.pos+=4,this.headerSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.width=this.datav.getUint32(this.pos,!0),this.pos+=4,this.height=this.datav.getInt32(this.pos,!0),this.pos+=4,this.planes=this.datav.getUint16(this.pos,!0),this.pos+=2,this.bitPP=this.datav.getUint16(this.pos,!0),this.pos+=2,this.compress=this.datav.getUint32(this.pos,!0),this.pos+=4,this.rawSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.hr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.vr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.colors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.importantColors=this.datav.getUint32(this.pos,!0),this.pos+=4,16===this.bitPP&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var e=0===this.colors?1<<this.bitPP:this.colors;this.palette=new Array(e);for(var t=0;t<e;t++){var i=this.datav.getUint8(this.pos++,!0),r=this.datav.getUint8(this.pos++,!0),n=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0);this.palette[t]={red:n,green:r,blue:i,quad:a}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)},Le.prototype.parseBGR=function(){this.pos=this.offset;try{var e="bit"+this.bitPP,t=this.width*this.height*4;this.data=new Uint8Array(t),this[e]()}catch(e){console.log("bit decode error:"+e)}},Le.prototype.bit1=function(){var e=Math.ceil(this.width/8),t=e%4,i=0<=this.height?this.height-1:-this.height;for(i=this.height-1;0<=i;i--){for(var r=this.bottom_up?i:this.height-1-i,n=0;n<e;n++)for(var a=this.datav.getUint8(this.pos++,!0),s=r*this.width*4+8*n*4,o=0;o<8&&8*n+o<this.width;o++){var l=this.palette[a>>7-o&1];this.data[s+4*o]=l.blue,this.data[s+4*o+1]=l.green,this.data[s+4*o+2]=l.red,this.data[s+4*o+3]=255}0!=t&&(this.pos+=4-t)}},Le.prototype.bit4=function(){for(var e=Math.ceil(this.width/2),t=e%4,i=this.height-1;0<=i;i--){for(var r=this.bottom_up?i:this.height-1-i,n=0;n<e;n++){var a=this.datav.getUint8(this.pos++,!0),s=r*this.width*4+2*n*4,o=a>>4,l=15&a,h=this.palette[o];if(this.data[s]=h.blue,this.data[s+1]=h.green,this.data[s+2]=h.red,this.data[s+3]=255,2*n+1>=this.width)break;h=this.palette[l],this.data[s+4]=h.blue,this.data[s+4+1]=h.green,this.data[s+4+2]=h.red,this.data[s+4+3]=255}0!=t&&(this.pos+=4-t)}},Le.prototype.bit8=function(){for(var e=this.width%4,t=this.height-1;0<=t;t--){for(var i=this.bottom_up?t:this.height-1-t,r=0;r<this.width;r++){var n=this.datav.getUint8(this.pos++,!0),a=i*this.width*4+4*r;if(n<this.palette.length){var s=this.palette[n];this.data[a]=s.red,this.data[a+1]=s.green,this.data[a+2]=s.blue,this.data[a+3]=255}else this.data[a]=255,this.data[a+1]=255,this.data[a+2]=255,this.data[a+3]=255}0!=e&&(this.pos+=4-e)}},Le.prototype.bit15=function(){for(var e=this.width%3,t=parseInt("11111",2),i=this.height-1;0<=i;i--){for(var r=this.bottom_up?i:this.height-1-i,n=0;n<this.width;n++){var a=this.datav.getUint16(this.pos,!0);this.pos+=2;var s=(a&t)/t*255|0,o=(a>>5&t)/t*255|0,l=(a>>10&t)/t*255|0,h=a>>15?255:0,c=r*this.width*4+4*n;this.data[c]=l,this.data[c+1]=o,this.data[c+2]=s,this.data[c+3]=h}this.pos+=e}},Le.prototype.bit16=function(){for(var e=this.width%3,t=parseInt("11111",2),i=parseInt("111111",2),r=this.height-1;0<=r;r--){for(var n=this.bottom_up?r:this.height-1-r,a=0;a<this.width;a++){var s=this.datav.getUint16(this.pos,!0);this.pos+=2;var o=(s&t)/t*255|0,l=(s>>5&i)/i*255|0,h=(s>>11)/t*255|0,c=n*this.width*4+4*a;this.data[c]=h,this.data[c+1]=l,this.data[c+2]=o,this.data[c+3]=255}this.pos+=e}},Le.prototype.bit24=function(){for(var e=this.height-1;0<=e;e--){for(var t=this.bottom_up?e:this.height-1-e,i=0;i<this.width;i++){var r=this.datav.getUint8(this.pos++,!0),n=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),s=t*this.width*4+4*i;this.data[s]=a,this.data[s+1]=n,this.data[s+2]=r,this.data[s+3]=255}this.pos+=this.width%4}},Le.prototype.bit32=function(){for(var e=this.height-1;0<=e;e--)for(var t=this.bottom_up?e:this.height-1-e,i=0;i<this.width;i++){var r=this.datav.getUint8(this.pos++,!0),n=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),s=this.datav.getUint8(this.pos++,!0),o=t*this.width*4+4*i;this.data[o]=a,this.data[o+1]=n,this.data[o+2]=r,this.data[o+3]=s}},Le.prototype.getData=function(){return this.data},window.tmp=Le,function(e){var t=15,i=573,r=[0,1,2,3,4,4,5,5,6,6,6,6,7,7,7,7,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,0,0,16,17,18,18,19,19,20,20,20,20,21,21,21,21,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29];function n(){var e=this;function r(e,t){for(var i=0;i|=1&e,e>>>=1,i<<=1,0<--t;);return i>>>1}e.build_tree=function(n){var a,s,o,l=e.dyn_tree,h=e.stat_desc.static_tree,c=e.stat_desc.elems,d=-1;for(n.heap_len=0,n.heap_max=i,a=0;a<c;a++)0!==l[2*a]?(n.heap[++n.heap_len]=d=a,n.depth[a]=0):l[2*a+1]=0;for(;n.heap_len<2;)l[2*(o=n.heap[++n.heap_len]=d<2?++d:0)]=1,n.depth[o]=0,n.opt_len--,h&&(n.static_len-=h[2*o+1]);for(e.max_code=d,a=Math.floor(n.heap_len/2);1<=a;a--)n.pqdownheap(l,a);for(o=c;a=n.heap[1],n.heap[1]=n.heap[n.heap_len--],n.pqdownheap(l,1),s=n.heap[1],n.heap[--n.heap_max]=a,n.heap[--n.heap_max]=s,l[2*o]=l[2*a]+l[2*s],n.depth[o]=Math.max(n.depth[a],n.depth[s])+1,l[2*a+1]=l[2*s+1]=o,n.heap[1]=o++,n.pqdownheap(l,1),2<=n.heap_len;);n.heap[--n.heap_max]=n.heap[1],function(r){var n,a,s,o,l,h,c=e.dyn_tree,d=e.stat_desc.static_tree,u=e.stat_desc.extra_bits,A=e.stat_desc.extra_base,p=e.stat_desc.max_length,f=0;for(o=0;o<=t;o++)r.bl_count[o]=0;for(c[2*r.heap[r.heap_max]+1]=0,n=r.heap_max+1;n<i;n++)p<(o=c[2*c[2*(a=r.heap[n])+1]+1]+1)&&(o=p,f++),c[2*a+1]=o,a>e.max_code||(r.bl_count[o]++,l=0,A<=a&&(l=u[a-A]),h=c[2*a],r.opt_len+=h*(o+l),d&&(r.static_len+=h*(d[2*a+1]+l)));if(0!==f){do{for(o=p-1;0===r.bl_count[o];)o--;r.bl_count[o]--,r.bl_count[o+1]+=2,r.bl_count[p]--,f-=2}while(0<f);for(o=p;0!==o;o--)for(a=r.bl_count[o];0!==a;)(s=r.heap[--n])>e.max_code||(c[2*s+1]!=o&&(r.opt_len+=(o-c[2*s+1])*c[2*s],c[2*s+1]=o),a--)}}(n),function(e,i,n){var a,s,o,l=[],h=0;for(a=1;a<=t;a++)l[a]=h=h+n[a-1]<<1;for(s=0;s<=i;s++)0!==(o=e[2*s+1])&&(e[2*s]=r(l[o]++,o))}(l,e.max_code,n.bl_count)}}function a(e,t,i,r,n){this.static_tree=e,this.extra_bits=t,this.extra_base=i,this.elems=r,this.max_length=n}function s(e,t,i,r,n){this.good_length=e,this.max_lazy=t,this.nice_length=i,this.max_chain=r,this.func=n}n._length_code=[0,1,2,3,4,5,6,7,8,8,9,9,10,10,11,11,12,12,12,12,13,13,13,13,14,14,14,14,15,15,15,15,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,28],n.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0],n.base_dist=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576],n.d_code=function(e){return e<256?r[e]:r[256+(e>>>7)]},n.extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],n.extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],n.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],n.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],a.static_ltree=[12,8,140,8,76,8,204,8,44,8,172,8,108,8,236,8,28,8,156,8,92,8,220,8,60,8,188,8,124,8,252,8,2,8,130,8,66,8,194,8,34,8,162,8,98,8,226,8,18,8,146,8,82,8,210,8,50,8,178,8,114,8,242,8,10,8,138,8,74,8,202,8,42,8,170,8,106,8,234,8,26,8,154,8,90,8,218,8,58,8,186,8,122,8,250,8,6,8,134,8,70,8,198,8,38,8,166,8,102,8,230,8,22,8,150,8,86,8,214,8,54,8,182,8,118,8,246,8,14,8,142,8,78,8,206,8,46,8,174,8,110,8,238,8,30,8,158,8,94,8,222,8,62,8,190,8,126,8,254,8,1,8,129,8,65,8,193,8,33,8,161,8,97,8,225,8,17,8,145,8,81,8,209,8,49,8,177,8,113,8,241,8,9,8,137,8,73,8,201,8,41,8,169,8,105,8,233,8,25,8,153,8,89,8,217,8,57,8,185,8,121,8,249,8,5,8,133,8,69,8,197,8,37,8,165,8,101,8,229,8,21,8,149,8,85,8,213,8,53,8,181,8,117,8,245,8,13,8,141,8,77,8,205,8,45,8,173,8,109,8,237,8,29,8,157,8,93,8,221,8,61,8,189,8,125,8,253,8,19,9,275,9,147,9,403,9,83,9,339,9,211,9,467,9,51,9,307,9,179,9,435,9,115,9,371,9,243,9,499,9,11,9,267,9,139,9,395,9,75,9,331,9,203,9,459,9,43,9,299,9,171,9,427,9,107,9,363,9,235,9,491,9,27,9,283,9,155,9,411,9,91,9,347,9,219,9,475,9,59,9,315,9,187,9,443,9,123,9,379,9,251,9,507,9,7,9,263,9,135,9,391,9,71,9,327,9,199,9,455,9,39,9,295,9,167,9,423,9,103,9,359,9,231,9,487,9,23,9,279,9,151,9,407,9,87,9,343,9,215,9,471,9,55,9,311,9,183,9,439,9,119,9,375,9,247,9,503,9,15,9,271,9,143,9,399,9,79,9,335,9,207,9,463,9,47,9,303,9,175,9,431,9,111,9,367,9,239,9,495,9,31,9,287,9,159,9,415,9,95,9,351,9,223,9,479,9,63,9,319,9,191,9,447,9,127,9,383,9,255,9,511,9,0,7,64,7,32,7,96,7,16,7,80,7,48,7,112,7,8,7,72,7,40,7,104,7,24,7,88,7,56,7,120,7,4,7,68,7,36,7,100,7,20,7,84,7,52,7,116,7,3,8,131,8,67,8,195,8,35,8,163,8,99,8,227,8],a.static_dtree=[0,5,16,5,8,5,24,5,4,5,20,5,12,5,28,5,2,5,18,5,10,5,26,5,6,5,22,5,14,5,30,5,1,5,17,5,9,5,25,5,5,5,21,5,13,5,29,5,3,5,19,5,11,5,27,5,7,5,23,5],a.static_l_desc=new a(a.static_ltree,n.extra_lbits,257,286,t),a.static_d_desc=new a(a.static_dtree,n.extra_dbits,0,30,t),a.static_bl_desc=new a(null,n.extra_blbits,0,19,7);var o=[new s(0,0,0,0,0),new s(4,4,8,4,1),new s(4,5,16,8,1),new s(4,6,32,32,1),new s(4,4,16,16,2),new s(8,16,32,32,2),new s(8,16,128,128,2),new s(8,32,128,256,2),new s(32,128,258,1024,2),new s(32,258,258,4096,2)],l=["need dictionary","stream end","","","stream error","data error","","buffer error","",""];function h(e,t,i,r){var n=e[2*t],a=e[2*i];return n<a||n==a&&r[t]<=r[i]}function c(){var e,t,i,r,s,c,d,u,A,p,f,m,g,w,b,v,y,B,C,x,F,S,N,E,k,T,L,I,D,U,P,R,O,Q,H,M,_,j,z,V,K,q=this,G=new n,W=new n,J=new n;function X(){var e;for(e=0;e<286;e++)P[2*e]=0;for(e=0;e<30;e++)R[2*e]=0;for(e=0;e<19;e++)O[2*e]=0;P[512]=1,q.opt_len=q.static_len=0,M=j=0}function Y(e,t){var i,r,n=-1,a=e[1],s=0,o=7,l=4;for(0===a&&(o=138,l=3),e[2*(t+1)+1]=65535,i=0;i<=t;i++)r=a,a=e[2*(i+1)+1],++s<o&&r==a||(s<l?O[2*r]+=s:0!==r?(r!=n&&O[2*r]++,O[32]++):s<=10?O[34]++:O[36]++,n=r,l=(s=0)===a?(o=138,3):r==a?(o=6,3):(o=7,4))}function $(e){q.pending_buf[q.pending++]=e}function Z(e){$(255&e),$(e>>>8&255)}function ee(e,t){var i,r=t;16-r<K?(Z(V|=(i=e)<<K&65535),V=i>>>16-K,K+=r-16):(V|=e<<K&65535,K+=r)}function te(e,t){var i=2*e;ee(65535&t[i],65535&t[i+1])}function ie(e,t){var i,r,n=-1,a=e[1],s=0,o=7,l=4;for(0===a&&(o=138,l=3),i=0;i<=t;i++)if(r=a,a=e[2*(i+1)+1],!(++s<o&&r==a)){if(s<l)for(;te(r,O),0!=--s;);else 0!==r?(r!=n&&(te(r,O),s--),te(16,O),ee(s-3,2)):s<=10?(te(17,O),ee(s-3,3)):(te(18,O),ee(s-11,7));n=r,l=(s=0)===a?(o=138,3):r==a?(o=6,3):(o=7,4)}}function re(){16==K?(Z(V),K=V=0):8<=K&&($(255&V),V>>>=8,K-=8)}function ne(e,t){var i,r,a;if(q.pending_buf[_+2*M]=e>>>8&255,q.pending_buf[_+2*M+1]=255&e,q.pending_buf[Q+M]=255&t,M++,0===e?P[2*t]++:(j++,e--,P[2*(n._length_code[t]+256+1)]++,R[2*n.d_code(e)]++),!(8191&M)&&2<L){for(i=8*M,r=F-y,a=0;a<30;a++)i+=R[2*a]*(5+n.extra_dbits[a]);if(i>>>=3,j<Math.floor(M/2)&&i<Math.floor(r/2))return!0}return M==H-1}function ae(e,t){var i,r,a,s,o=0;if(0!==M)for(;i=q.pending_buf[_+2*o]<<8&65280|255&q.pending_buf[_+2*o+1],r=255&q.pending_buf[Q+o],o++,0===i?te(r,e):(te((a=n._length_code[r])+256+1,e),0!==(s=n.extra_lbits[a])&&ee(r-=n.base_length[a],s),te(a=n.d_code(--i),t),0!==(s=n.extra_dbits[a])&&ee(i-=n.base_dist[a],s)),o<M;);te(256,e),z=e[513]}function se(){8<K?Z(V):0<K&&$(255&V),K=V=0}function oe(e,t,i){var r,n,a;ee(0+(i?1:0),3),r=e,n=t,a=!0,se(),z=8,a&&(Z(n),Z(~n)),q.pending_buf.set(u.subarray(r,r+n),q.pending),q.pending+=n}function le(e,t,i){var r,s,o=0;0<L?(G.build_tree(q),W.build_tree(q),o=function(){var e;for(Y(P,G.max_code),Y(R,W.max_code),J.build_tree(q),e=18;3<=e&&0===O[2*n.bl_order[e]+1];e--);return q.opt_len+=3*(e+1)+5+5+4,e}(),r=q.opt_len+3+7>>>3,(s=q.static_len+3+7>>>3)<=r&&(r=s)):r=s=t+5,t+4<=r&&-1!=e?oe(e,t,i):s==r?(ee(2+(i?1:0),3),ae(a.static_ltree,a.static_dtree)):(ee(4+(i?1:0),3),function(e,t,i){var r;for(ee(e-257,5),ee(t-1,5),ee(i-4,4),r=0;r<i;r++)ee(O[2*n.bl_order[r]+1],3);ie(P,e-1),ie(R,t-1)}(G.max_code+1,W.max_code+1,o+1),ae(P,R)),X(),i&&se()}function he(t){le(0<=y?y:-1,F-y,t),y=F,e.flush_pending()}function ce(){var t,i,r,n;do{if(0===(n=A-N-F)&&0===F&&0===N)n=s;else if(-1==n)n--;else if(s+s-262<=F){for(u.set(u.subarray(s,s+s),0),S-=s,F-=s,y-=s,r=t=g;i=65535&f[--r],f[r]=s<=i?i-s:0,0!=--t;);for(r=t=s;i=65535&p[--r],p[r]=s<=i?i-s:0,0!=--t;);n+=s}if(0===e.avail_in)return;t=e.read_buf(u,F+N,n),3<=(N+=t)&&(m=((m=255&u[F])<<v^255&u[F+1])&b)}while(N<262&&0!==e.avail_in)}function de(e){var t,i,r=k,n=F,a=E,o=s-262<F?F-(s-262):0,l=U,h=d,c=F+258,A=u[n+a-1],f=u[n+a];D<=E&&(r>>=2),N<l&&(l=N);do{if(u[(t=e)+a]==f&&u[t+a-1]==A&&u[t]==u[n]&&u[++t]==u[n+1]){n+=2,t++;do{}while(u[++n]==u[++t]&&u[++n]==u[++t]&&u[++n]==u[++t]&&u[++n]==u[++t]&&u[++n]==u[++t]&&u[++n]==u[++t]&&u[++n]==u[++t]&&u[++n]==u[++t]&&n<c);if(i=258-(c-n),n=c-258,a<i){if(S=e,l<=(a=i))break;A=u[n+a-1],f=u[n+a]}}}while((e=65535&p[e&h])>o&&0!=--r);return a<=N?a:N}function ue(e){return e.total_in=e.total_out=0,e.msg=null,q.pending=0,q.pending_out=0,t=113,r=0,G.dyn_tree=P,G.stat_desc=a.static_l_desc,W.dyn_tree=R,W.stat_desc=a.static_d_desc,J.dyn_tree=O,J.stat_desc=a.static_bl_desc,K=V=0,z=8,X(),function(){var e;for(A=2*s,e=f[g-1]=0;e<g-1;e++)f[e]=0;T=o[L].max_lazy,D=o[L].good_length,U=o[L].nice_length,k=o[L].max_chain,B=E=2,m=x=N=y=F=0}(),0}q.depth=[],q.bl_count=[],q.heap=[],P=[],R=[],O=[],q.pqdownheap=function(e,t){for(var i=q.heap,r=i[t],n=t<<1;n<=q.heap_len&&(n<q.heap_len&&h(e,i[n+1],i[n],q.depth)&&n++,!h(e,r,i[n],q.depth));)i[t]=i[n],t=n,n<<=1;i[t]=r},q.deflateInit=function(e,t,r,n,a,o){return n||(n=8),a||(a=8),o||(o=0),e.msg=null,-1==t&&(t=6),a<1||9<a||8!=n||r<9||15<r||t<0||9<t||o<0||2<o?-2:(e.dstate=q,d=(s=1<<(c=r))-1,b=(g=1<<(w=a+7))-1,v=Math.floor((w+3-1)/3),u=new Uint8Array(2*s),p=[],f=[],H=1<<a+6,q.pending_buf=new Uint8Array(4*H),i=4*H,_=Math.floor(H/2),Q=3*H,L=t,I=o,ue(e))},q.deflateEnd=function(){return 42!=t&&113!=t&&666!=t?-2:(q.pending_buf=null,u=p=f=null,q.dstate=null,113==t?-3:0)},q.deflateParams=function(e,t,i){var r=0;return-1==t&&(t=6),t<0||9<t||i<0||2<i?-2:(o[L].func!=o[t].func&&0!==e.total_in&&(r=e.deflate(1)),L!=t&&(T=o[L=t].max_lazy,D=o[L].good_length,U=o[L].nice_length,k=o[L].max_chain),I=i,r)},q.deflateSetDictionary=function(e,i,r){var n,a=r,o=0;if(!i||42!=t)return-2;if(a<3)return 0;for(s-262<a&&(o=r-(a=s-262)),u.set(i.subarray(o,o+a),0),y=F=a,m=((m=255&u[0])<<v^255&u[1])&b,n=0;n<=a-3;n++)m=(m<<v^255&u[n+2])&b,p[n&d]=f[m],f[m]=n;return 0},q.deflate=function(n,h){var A,w,k,D,U,P;if(4<h||h<0)return-2;if(!n.next_out||!n.next_in&&0!==n.avail_in||666==t&&4!=h)return n.msg=l[4],-2;if(0===n.avail_out)return n.msg=l[7],-5;if(e=n,D=r,r=h,42==t&&(w=8+(c-8<<4)<<8,3<(k=(L-1&255)>>1)&&(k=3),w|=k<<6,0!==F&&(w|=32),t=113,$((P=w+=31-w%31)>>8&255),$(255&P)),0!==q.pending){if(e.flush_pending(),0===e.avail_out)return r=-1,0}else if(0===e.avail_in&&h<=D&&4!=h)return e.msg=l[7],-5;if(666==t&&0!==e.avail_in)return n.msg=l[7],-5;if(0!==e.avail_in||0!==N||0!=h&&666!=t){switch(U=-1,o[L].func){case 0:U=function(t){var r,n=65535;for(i-5<n&&(n=i-5);;){if(N<=1){if(ce(),0===N&&0==t)return 0;if(0===N)break}if(F+=N,r=y+n,((N=0)===F||r<=F)&&(N=F-r,F=r,he(!1),0===e.avail_out))return 0;if(s-262<=F-y&&(he(!1),0===e.avail_out))return 0}return he(4==t),0===e.avail_out?4==t?2:0:4==t?3:1}(h);break;case 1:U=function(t){for(var i,r=0;;){if(N<262){if(ce(),N<262&&0==t)return 0;if(0===N)break}if(3<=N&&(m=(m<<v^255&u[F+2])&b,r=65535&f[m],p[F&d]=f[m],f[m]=F),0!==r&&(F-r&65535)<=s-262&&2!=I&&(B=de(r)),3<=B)if(i=ne(F-S,B-3),N-=B,B<=T&&3<=N){for(B--;m=(m<<v^255&u[2+ ++F])&b,r=65535&f[m],p[F&d]=f[m],f[m]=F,0!=--B;);F++}else F+=B,B=0,m=((m=255&u[F])<<v^255&u[F+1])&b;else i=ne(0,255&u[F]),N--,F++;if(i&&(he(!1),0===e.avail_out))return 0}return he(4==t),0===e.avail_out?4==t?2:0:4==t?3:1}(h);break;case 2:U=function(t){for(var i,r,n=0;;){if(N<262){if(ce(),N<262&&0==t)return 0;if(0===N)break}if(3<=N&&(m=(m<<v^255&u[F+2])&b,n=65535&f[m],p[F&d]=f[m],f[m]=F),E=B,C=S,B=2,0!==n&&E<T&&(F-n&65535)<=s-262&&(2!=I&&(B=de(n)),B<=5&&(1==I||3==B&&4096<F-S)&&(B=2)),3<=E&&B<=E){for(r=F+N-3,i=ne(F-1-C,E-3),N-=E-1,E-=2;++F<=r&&(m=(m<<v^255&u[F+2])&b,n=65535&f[m],p[F&d]=f[m],f[m]=F),0!=--E;);if(x=0,B=2,F++,i&&(he(!1),0===e.avail_out))return 0}else if(0!==x){if((i=ne(0,255&u[F-1]))&&he(!1),F++,N--,0===e.avail_out)return 0}else x=1,F++,N--}return 0!==x&&(i=ne(0,255&u[F-1]),x=0),he(4==t),0===e.avail_out?4==t?2:0:4==t?3:1}(h)}if(2!=U&&3!=U||(t=666),0==U||2==U)return 0===e.avail_out&&(r=-1),0;if(1==U){if(1==h)ee(2,3),te(256,a.static_ltree),re(),1+z+10-K<9&&(ee(2,3),te(256,a.static_ltree),re()),z=7;else if(oe(0,0,!1),3==h)for(A=0;A<g;A++)f[A]=0;if(e.flush_pending(),0===e.avail_out)return r=-1,0}}return 4!=h?0:1}}function d(){this.next_in_index=0,this.next_out_index=0,this.avail_in=0,this.total_in=0,this.avail_out=0,this.total_out=0}d.prototype={deflateInit:function(e,i){return this.dstate=new c,i||(i=t),this.dstate.deflateInit(this,e,i)},deflate:function(e){return this.dstate?this.dstate.deflate(this,e):-2},deflateEnd:function(){if(!this.dstate)return-2;var e=this.dstate.deflateEnd();return this.dstate=null,e},deflateParams:function(e,t){return this.dstate?this.dstate.deflateParams(this,e,t):-2},deflateSetDictionary:function(e,t){return this.dstate?this.dstate.deflateSetDictionary(this,e,t):-2},read_buf:function(e,t,i){var r=this.avail_in;return i<r&&(r=i),0===r?0:(this.avail_in-=r,e.set(this.next_in.subarray(this.next_in_index,this.next_in_index+r),t),this.next_in_index+=r,this.total_in+=r,r)},flush_pending:function(){var e=this,t=e.dstate.pending;t>e.avail_out&&(t=e.avail_out),0!==t&&(e.next_out.set(e.dstate.pending_buf.subarray(e.dstate.pending_out,e.dstate.pending_out+t),e.next_out_index),e.next_out_index+=t,e.dstate.pending_out+=t,e.total_out+=t,e.avail_out-=t,e.dstate.pending-=t,0===e.dstate.pending&&(e.dstate.pending_out=0))}};var u=e.zip||e;u.Deflater=u._jzlib_Deflater=function(e){var t=new d,i=new Uint8Array(512),r=e?e.level:-1;void 0===r&&(r=-1),t.deflateInit(r),t.next_out=i,this.append=function(e,r){var n,a=[],s=0,o=0,l=0;if(e.length){t.next_in_index=0,t.next_in=e,t.avail_in=e.length;do{if(t.next_out_index=0,t.avail_out=512,0!=t.deflate(0))throw new Error("deflating: "+t.msg);t.next_out_index&&(512==t.next_out_index?a.push(new Uint8Array(i)):a.push(new Uint8Array(i.subarray(0,t.next_out_index)))),l+=t.next_out_index,r&&0<t.next_in_index&&t.next_in_index!=s&&(r(t.next_in_index),s=t.next_in_index)}while(0<t.avail_in||0===t.avail_out);return n=new Uint8Array(l),a.forEach(function(e){n.set(e,o),o+=e.length}),n}},this.flush=function(){var e,r,n=[],a=0,s=0;do{if(t.next_out_index=0,t.avail_out=512,1!=(e=t.deflate(4))&&0!=e)throw new Error("deflating: "+t.msg);0<512-t.avail_out&&n.push(new Uint8Array(i.subarray(0,t.next_out_index))),s+=t.next_out_index}while(0<t.avail_in||0===t.avail_out);return t.deflateEnd(),r=new Uint8Array(s),n.forEach(function(e){r.set(e,a),a+=e.length}),r}}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||void 0!==Cd&&Cd||Function('return typeof this === "object" && this.content')()||Function("return this")()),("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||void 0!==Cd&&Cd||Function('return typeof this === "object" && this.content')()||Function("return this")()).RGBColor=function(e){var t;e=e||"",this.ok=!1,"#"==e.charAt(0)&&(e=e.substr(1,6)),e=(e=e.replace(/ /g,"")).toLowerCase();var i={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"};for(var r in i)e==r&&(e=i[r]);for(var n=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(e){return[parseInt(e[1]),parseInt(e[2]),parseInt(e[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}}],a=0;a<n.length;a++){var s=n[a].re,o=n[a].process,l=s.exec(e);l&&(t=o(l),this.r=t[0],this.g=t[1],this.b=t[2],this.ok=!0)}this.r=this.r<0||isNaN(this.r)?0:255<this.r?255:this.r,this.g=this.g<0||isNaN(this.g)?0:255<this.g?255:this.g,this.b=this.b<0||isNaN(this.b)?0:255<this.b?255:this.b,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toHex=function(){var e=this.r.toString(16),t=this.g.toString(16),i=this.b.toString(16);return 1==e.length&&(e="0"+e),1==t.length&&(t="0"+t),1==i.length&&(i="0"+i),"#"+e+t+i}},function(e){var t="+".charCodeAt(0),i="/".charCodeAt(0),r="0".charCodeAt(0),n="a".charCodeAt(0),a="A".charCodeAt(0),s="-".charCodeAt(0),o="_".charCodeAt(0),l=function(e){var l=e.charCodeAt(0);return l===t||l===s?62:l===i||l===o?63:l<r?-1:l<r+10?l-r+26+26:l<a+26?l-a:l<n+26?l-n+26:void 0};e.API.TTFFont=function(){function e(e,t,i){var r;if(this.rawData=e,r=this.contents=new c(e),this.contents.pos=4,"ttcf"===r.readString(4)){if(!t)throw new Error("Must specify a font name for TTC files.");throw new Error("Font "+t+" not found in TTC file.")}r.pos=0,this.parse(),this.subset=new k(this),this.registerTTF()}return e.open=function(t,i,r,n){if("string"!=typeof r)throw new Error("Invalid argument supplied in TTFFont.open");return new e(function(e){var t,i,r,n,a,s;if(0<e.length%4)throw new Error("Invalid string. Length must be a multiple of 4");var o=e.length;a="="===e.charAt(o-2)?2:"="===e.charAt(o-1)?1:0,s=new Uint8Array(3*e.length/4-a),r=0<a?e.length-4:e.length;var h=0;function c(e){s[h++]=e}for(i=t=0;t<r;t+=4,i+=3)c((16711680&(n=l(e.charAt(t))<<18|l(e.charAt(t+1))<<12|l(e.charAt(t+2))<<6|l(e.charAt(t+3))))>>16),c((65280&n)>>8),c(255&n);return 2===a?c(255&(n=l(e.charAt(t))<<2|l(e.charAt(t+1))>>4)):1===a&&(c((n=l(e.charAt(t))<<10|l(e.charAt(t+1))<<4|l(e.charAt(t+2))>>2)>>8&255),c(255&n)),s}(r),i)},e.prototype.parse=function(){return this.directory=new d(this.contents),this.head=new p(this),this.name=new y(this),this.cmap=new m(this),this.toUnicode=new Map,this.hhea=new g(this),this.maxp=new B(this),this.hmtx=new C(this),this.post=new b(this),this.os2=new w(this),this.loca=new E(this),this.glyf=new F(this),this.ascender=this.os2.exists&&this.os2.ascender||this.hhea.ascender,this.decender=this.os2.exists&&this.os2.decender||this.hhea.decender,this.lineGap=this.os2.exists&&this.os2.lineGap||this.hhea.lineGap,this.bbox=[this.head.xMin,this.head.yMin,this.head.xMax,this.head.yMax]},e.prototype.registerTTF=function(){var e,t,i,r,n;if(this.scaleFactor=1e3/this.head.unitsPerEm,this.bbox=function(){var t,i,r,n;for(n=[],t=0,i=(r=this.bbox).length;t<i;t++)e=r[t],n.push(Math.round(e*this.scaleFactor));return n}.call(this),this.stemV=0,this.post.exists?(i=255&(r=this.post.italic_angle),!0&(t=r>>16)&&(t=-(1+(65535^t))),this.italicAngle=+(t+"."+i)):this.italicAngle=0,this.ascender=Math.round(this.ascender*this.scaleFactor),this.decender=Math.round(this.decender*this.scaleFactor),this.lineGap=Math.round(this.lineGap*this.scaleFactor),this.capHeight=this.os2.exists&&this.os2.capHeight||this.ascender,this.xHeight=this.os2.exists&&this.os2.xHeight||0,this.familyClass=(this.os2.exists&&this.os2.familyClass||0)>>8,this.isSerif=1===(n=this.familyClass)||2===n||3===n||4===n||5===n||7===n,this.isScript=10===this.familyClass,this.flags=0,this.post.isFixedPitch&&(this.flags|=1),this.isSerif&&(this.flags|=2),this.isScript&&(this.flags|=8),0!==this.italicAngle&&(this.flags|=64),this.flags|=32,!this.cmap.unicode)throw new Error("No unicode cmap for font")},e.prototype.characterToGlyph=function(e){var t;return(null!=(t=this.cmap.unicode)?t.codeMap[e]:void 0)||0},e.prototype.widthOfGlyph=function(e){var t;return t=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(e).advance*t},e.prototype.widthOfString=function(e,t,i){var r,n,a,s,o;for(n=s=a=0,o=(e=""+e).length;0<=o?s<o:o<s;n=0<=o?++s:--s)r=e.charCodeAt(n),a+=this.widthOfGlyph(this.characterToGlyph(r))+i*(1e3/t)||0;return a*(t/1e3)},e.prototype.lineHeight=function(e,t){var i;return null==t&&(t=!1),i=t?this.lineGap:0,(this.ascender+i-this.decender)/1e3*e},e}();var h,c=function(){function e(e){this.data=null!=e?e:[],this.pos=0,this.length=this.data.length}return e.prototype.readByte=function(){return this.data[this.pos++]},e.prototype.writeByte=function(e){return this.data[this.pos++]=e},e.prototype.readUInt32=function(){return 16777216*this.readByte()+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()},e.prototype.writeUInt32=function(e){return this.writeByte(e>>>24&255),this.writeByte(e>>16&255),this.writeByte(e>>8&255),this.writeByte(255&e)},e.prototype.readInt32=function(){var e;return 2147483648<=(e=this.readUInt32())?e-4294967296:e},e.prototype.writeInt32=function(e){return e<0&&(e+=4294967296),this.writeUInt32(e)},e.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()},e.prototype.writeUInt16=function(e){return this.writeByte(e>>8&255),this.writeByte(255&e)},e.prototype.readInt16=function(){var e;return 32768<=(e=this.readUInt16())?e-65536:e},e.prototype.writeInt16=function(e){return e<0&&(e+=65536),this.writeUInt16(e)},e.prototype.readString=function(e){var t,i,r;for(i=[],t=r=0;0<=e?r<e:e<r;t=0<=e?++r:--r)i[t]=String.fromCharCode(this.readByte());return i.join("")},e.prototype.writeString=function(e){var t,i,r,n;for(n=[],t=i=0,r=e.length;0<=r?i<r:r<i;t=0<=r?++i:--i)n.push(this.writeByte(e.charCodeAt(t)));return n},e.prototype.readShort=function(){return this.readInt16()},e.prototype.writeShort=function(e){return this.writeInt16(e)},e.prototype.readLongLong=function(){var e,t,i,r,n,a,s,o;return e=this.readByte(),t=this.readByte(),i=this.readByte(),r=this.readByte(),n=this.readByte(),a=this.readByte(),s=this.readByte(),o=this.readByte(),128&e?-1*(72057594037927940*(255^e)+281474976710656*(255^t)+1099511627776*(255^i)+4294967296*(255^r)+16777216*(255^n)+65536*(255^a)+256*(255^s)+(255^o)+1):72057594037927940*e+281474976710656*t+1099511627776*i+4294967296*r+16777216*n+65536*a+256*s+o},e.prototype.writeLongLong=function(e){var t,i;return t=Math.floor(e/4294967296),i=4294967295&e,this.writeByte(t>>24&255),this.writeByte(t>>16&255),this.writeByte(t>>8&255),this.writeByte(255&t),this.writeByte(i>>24&255),this.writeByte(i>>16&255),this.writeByte(i>>8&255),this.writeByte(255&i)},e.prototype.readInt=function(){return this.readInt32()},e.prototype.writeInt=function(e){return this.writeInt32(e)},e.prototype.read=function(e){var t,i;for(t=[],i=0;0<=e?i<e:e<i;0<=e?++i:--i)t.push(this.readByte());return t},e.prototype.write=function(e){var t,i,r,n;for(n=[],i=0,r=e.length;i<r;i++)t=e[i],n.push(this.writeByte(t));return n},e}(),d=function(){var e;function t(e){var t,i,r;for(this.scalarType=e.readInt(),this.tableCount=e.readShort(),this.searchRange=e.readShort(),this.entrySelector=e.readShort(),this.rangeShift=e.readShort(),this.tables={},i=0,r=this.tableCount;0<=r?i<r:r<i;0<=r?++i:--i)t={tag:e.readString(4),checksum:e.readInt(),offset:e.readInt(),length:e.readInt()},this.tables[t.tag]=t}return t.prototype.encode=function(t){var i,r,n,a,s,o,l,h,d,u,A,p,f;for(f in A=Object.keys(t).length,o=Math.log(2),d=16*Math.floor(Math.log(A)/o),a=Math.floor(d/o),h=16*A-d,(r=new c).writeInt(this.scalarType),r.writeShort(A),r.writeShort(d),r.writeShort(a),r.writeShort(h),n=16*A,l=r.pos+n,s=null,p=[],t)for(u=t[f],r.writeString(f),r.writeInt(e(u)),r.writeInt(l),r.writeInt(u.length),p=p.concat(u),"head"===f&&(s=l),l+=u.length;l%4;)p.push(0),l++;return r.write(p),i=2981146554-e(r.data),r.pos=s+8,r.writeUInt32(i),r.data},e=function(e){var t,i,r,n;for(e=x.call(e);e.length%4;)e.push(0);for(i=new c(e),r=t=0,n=e.length;r<n;r+=4)t+=i.readUInt32();return 4294967295&t},t}(),u={}.hasOwnProperty,A=function(e,t){for(var i in t)u.call(t,i)&&(e[i]=t[i]);function r(){this.constructor=e}return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e};h=function(){function e(e){var t;this.file=e,t=this.file.directory.tables[this.tag],this.exists=!!t,t&&(this.offset=t.offset,this.length=t.length,this.parse(this.file.contents))}return e.prototype.parse=function(){},e.prototype.encode=function(){},e.prototype.raw=function(){return this.exists?(this.file.contents.pos=this.offset,this.file.contents.read(this.length)):null},e}();var p=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return A(e,h),e.prototype.tag="head",e.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.revision=e.readInt(),this.checkSumAdjustment=e.readInt(),this.magicNumber=e.readInt(),this.flags=e.readShort(),this.unitsPerEm=e.readShort(),this.created=e.readLongLong(),this.modified=e.readLongLong(),this.xMin=e.readShort(),this.yMin=e.readShort(),this.xMax=e.readShort(),this.yMax=e.readShort(),this.macStyle=e.readShort(),this.lowestRecPPEM=e.readShort(),this.fontDirectionHint=e.readShort(),this.indexToLocFormat=e.readShort(),this.glyphDataFormat=e.readShort()},e.prototype.encode=function(e){var t;return(t=new c).writeInt(this.version),t.writeInt(this.revision),t.writeInt(this.checkSumAdjustment),t.writeInt(this.magicNumber),t.writeShort(this.flags),t.writeShort(this.unitsPerEm),t.writeLongLong(this.created),t.writeLongLong(this.modified),t.writeShort(this.xMin),t.writeShort(this.yMin),t.writeShort(this.xMax),t.writeShort(this.yMax),t.writeShort(this.macStyle),t.writeShort(this.lowestRecPPEM),t.writeShort(this.fontDirectionHint),t.writeShort(e),t.writeShort(this.glyphDataFormat),t.data},e}(),f=function(){function e(e,t){var i,r,n,a,s,o,l,h,c,d,u,A,p,f,m,g,w,b;switch(this.platformID=e.readUInt16(),this.encodingID=e.readShort(),this.offset=t+e.readInt(),c=e.pos,e.pos=this.offset,this.format=e.readUInt16(),this.length=e.readUInt16(),this.language=e.readUInt16(),this.isUnicode=3===this.platformID&&1===this.encodingID&&4===this.format||0===this.platformID&&4===this.format,this.codeMap={},this.format){case 0:for(o=m=0;m<256;o=++m)this.codeMap[o]=e.readByte();break;case 4:for(u=e.readUInt16(),d=u/2,e.pos+=6,n=function(){var t,i;for(i=[],o=t=0;0<=d?t<d:d<t;o=0<=d?++t:--t)i.push(e.readUInt16());return i}(),e.pos+=2,p=function(){var t,i;for(i=[],o=t=0;0<=d?t<d:d<t;o=0<=d?++t:--t)i.push(e.readUInt16());return i}(),l=function(){var t,i;for(i=[],o=t=0;0<=d?t<d:d<t;o=0<=d?++t:--t)i.push(e.readUInt16());return i}(),h=function(){var t,i;for(i=[],o=t=0;0<=d?t<d:d<t;o=0<=d?++t:--t)i.push(e.readUInt16());return i}(),r=(this.length-e.pos+this.offset)/2,s=function(){var t,i;for(i=[],o=t=0;0<=r?t<r:r<t;o=0<=r?++t:--t)i.push(e.readUInt16());return i}(),o=g=0,b=n.length;g<b;o=++g)for(f=n[o],i=w=A=p[o];A<=f?w<=f:f<=w;i=A<=f?++w:--w)0===h[o]?a=i+l[o]:0!==(a=s[h[o]/2+(i-A)-(d-o)]||0)&&(a+=l[o]),this.codeMap[i]=65535&a}e.pos=c}return e.encode=function(e,t){var i,r,n,a,s,o,l,h,d,u,A,p,f,m,g,w,b,v,y,B,C,x,F,S,N,E,k,T,L,I,D,U,P,R,O,Q,H,M,_,j,z,V,K,q,G,W;switch(T=new c,a=Object.keys(e).sort(function(e,t){return e-t}),t){case"macroman":for(f=0,m=function(){var e,t;for(t=[],p=e=0;e<256;p=++e)t.push(0);return t}(),w={0:0},n={},L=0,P=a.length;L<P;L++)null==w[K=e[r=a[L]]]&&(w[K]=++f),n[r]={old:e[r],new:w[e[r]]},m[r]=w[e[r]];return T.writeUInt16(1),T.writeUInt16(0),T.writeUInt32(12),T.writeUInt16(0),T.writeUInt16(262),T.writeUInt16(0),T.write(m),{charMap:n,subtable:T.data,maxGlyphID:f+1};case"unicode":for(E=[],d=[],w={},i={},g=l=null,I=b=0,R=a.length;I<R;I++)null==w[y=e[r=a[I]]]&&(w[y]=++b),i[r]={old:y,new:w[y]},s=w[y]-r,null!=g&&s===l||(g&&d.push(g),E.push(r),l=s),g=r;for(g&&d.push(g),d.push(65535),E.push(65535),S=2*(F=E.length),x=2*Math.pow(Math.log(F)/Math.LN2,2),u=Math.log(x/2)/Math.LN2,C=2*F-x,o=[],B=[],A=[],p=D=0,O=E.length;D<O;p=++D){if(N=E[p],h=d[p],65535===N){o.push(0),B.push(0);break}if(32768<=N-(k=i[N].new))for(o.push(0),B.push(2*(A.length+F-p)),r=U=N;N<=h?U<=h:h<=U;r=N<=h?++U:--U)A.push(i[r].new);else o.push(k-N),B.push(0)}for(T.writeUInt16(3),T.writeUInt16(1),T.writeUInt32(12),T.writeUInt16(4),T.writeUInt16(16+8*F+2*A.length),T.writeUInt16(0),T.writeUInt16(S),T.writeUInt16(x),T.writeUInt16(u),T.writeUInt16(C),z=0,Q=d.length;z<Q;z++)r=d[z],T.writeUInt16(r);for(T.writeUInt16(0),V=0,H=E.length;V<H;V++)r=E[V],T.writeUInt16(r);for(q=0,M=o.length;q<M;q++)s=o[q],T.writeUInt16(s);for(G=0,_=B.length;G<_;G++)v=B[G],T.writeUInt16(v);for(W=0,j=A.length;W<j;W++)f=A[W],T.writeUInt16(f);return{charMap:i,subtable:T.data,maxGlyphID:b+1}}},e}(),m=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return A(e,h),e.prototype.tag="cmap",e.prototype.parse=function(e){var t,i,r;for(e.pos=this.offset,this.version=e.readUInt16(),i=e.readUInt16(),this.tables=[],this.unicode=null,r=0;0<=i?r<i:i<r;0<=i?++r:--r)t=new f(e,this.offset),this.tables.push(t),t.isUnicode&&null==this.unicode&&(this.unicode=t);return!0},e.encode=function(e,t){var i,r;return null==t&&(t="macroman"),i=f.encode(e,t),(r=new c).writeUInt16(0),r.writeUInt16(1),i.table=r.data.concat(i.subtable),i},e}(),g=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return A(e,h),e.prototype.tag="hhea",e.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.ascender=e.readShort(),this.decender=e.readShort(),this.lineGap=e.readShort(),this.advanceWidthMax=e.readShort(),this.minLeftSideBearing=e.readShort(),this.minRightSideBearing=e.readShort(),this.xMaxExtent=e.readShort(),this.caretSlopeRise=e.readShort(),this.caretSlopeRun=e.readShort(),this.caretOffset=e.readShort(),e.pos+=8,this.metricDataFormat=e.readShort(),this.numberOfMetrics=e.readUInt16()},e}(),w=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return A(e,h),e.prototype.tag="OS/2",e.prototype.parse=function(e){if(e.pos=this.offset,this.version=e.readUInt16(),this.averageCharWidth=e.readShort(),this.weightClass=e.readUInt16(),this.widthClass=e.readUInt16(),this.type=e.readShort(),this.ySubscriptXSize=e.readShort(),this.ySubscriptYSize=e.readShort(),this.ySubscriptXOffset=e.readShort(),this.ySubscriptYOffset=e.readShort(),this.ySuperscriptXSize=e.readShort(),this.ySuperscriptYSize=e.readShort(),this.ySuperscriptXOffset=e.readShort(),this.ySuperscriptYOffset=e.readShort(),this.yStrikeoutSize=e.readShort(),this.yStrikeoutPosition=e.readShort(),this.familyClass=e.readShort(),this.panose=function(){var t,i;for(i=[],t=0;t<10;++t)i.push(e.readByte());return i}(),this.charRange=function(){var t,i;for(i=[],t=0;t<4;++t)i.push(e.readInt());return i}(),this.vendorID=e.readString(4),this.selection=e.readShort(),this.firstCharIndex=e.readShort(),this.lastCharIndex=e.readShort(),0<this.version&&(this.ascent=e.readShort(),this.descent=e.readShort(),this.lineGap=e.readShort(),this.winAscent=e.readShort(),this.winDescent=e.readShort(),this.codePageRange=function(){var t,i;for(i=[],t=0;t<2;++t)i.push(e.readInt());return i}(),1<this.version))return this.xHeight=e.readShort(),this.capHeight=e.readShort(),this.defaultChar=e.readShort(),this.breakChar=e.readShort(),this.maxContext=e.readShort()},e}(),b=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return A(e,h),e.prototype.tag="post",e.prototype.parse=function(e){var t,i,r,n;switch(e.pos=this.offset,this.format=e.readInt(),this.italicAngle=e.readInt(),this.underlinePosition=e.readShort(),this.underlineThickness=e.readShort(),this.isFixedPitch=e.readInt(),this.minMemType42=e.readInt(),this.maxMemType42=e.readInt(),this.minMemType1=e.readInt(),this.maxMemType1=e.readInt(),this.format){case 65536:case 196608:break;case 131072:for(i=e.readUInt16(),this.glyphNameIndex=[],r=0;0<=i?r<i:i<r;0<=i?++r:--r)this.glyphNameIndex.push(e.readUInt16());for(this.names=[],n=[];e.pos<this.offset+this.length;)t=e.readByte(),n.push(this.names.push(e.readString(t)));return n;case 151552:return i=e.readUInt16(),this.offsets=e.read(i);case 262144:return this.map=function(){var t,i,r;for(r=[],t=0,i=this.file.maxp.numGlyphs;0<=i?t<i:i<t;0<=i?++t:--t)r.push(e.readUInt32());return r}.call(this)}},e}(),v=function(e,t){this.raw=e,this.length=e.length,this.platformID=t.platformID,this.encodingID=t.encodingID,this.languageID=t.languageID},y=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return A(e,h),e.prototype.tag="name",e.prototype.parse=function(e){var t,i,r,n,a,s,o,l,h,c,d,u;for(e.pos=this.offset,e.readShort(),t=e.readShort(),s=e.readShort(),i=[],n=h=0;0<=t?h<t:t<h;n=0<=t?++h:--h)i.push({platformID:e.readShort(),encodingID:e.readShort(),languageID:e.readShort(),nameID:e.readShort(),length:e.readShort(),offset:this.offset+s+e.readShort()});for(o={},n=c=0,d=i.length;c<d;n=++c)r=i[n],e.pos=r.offset,l=e.readString(r.length),a=new v(l,r),null==o[u=r.nameID]&&(o[u]=[]),o[r.nameID].push(a);this.strings=o,this.copyright=o[0],this.fontFamily=o[1],this.fontSubfamily=o[2],this.uniqueSubfamily=o[3],this.fontName=o[4],this.version=o[5];try{this.postscriptName=o[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}catch(e){this.postscriptName=o[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}return this.trademark=o[7],this.manufacturer=o[8],this.designer=o[9],this.description=o[10],this.vendorUrl=o[11],this.designerUrl=o[12],this.license=o[13],this.licenseUrl=o[14],this.preferredFamily=o[15],this.preferredSubfamily=o[17],this.compatibleFull=o[18],this.sampleText=o[19]},e}(),B=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return A(e,h),e.prototype.tag="maxp",e.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.numGlyphs=e.readUInt16(),this.maxPoints=e.readUInt16(),this.maxContours=e.readUInt16(),this.maxCompositePoints=e.readUInt16(),this.maxComponentContours=e.readUInt16(),this.maxZones=e.readUInt16(),this.maxTwilightPoints=e.readUInt16(),this.maxStorage=e.readUInt16(),this.maxFunctionDefs=e.readUInt16(),this.maxInstructionDefs=e.readUInt16(),this.maxStackElements=e.readUInt16(),this.maxSizeOfInstructions=e.readUInt16(),this.maxComponentElements=e.readUInt16(),this.maxComponentDepth=e.readUInt16()},e}(),C=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return A(e,h),e.prototype.tag="hmtx",e.prototype.parse=function(e){var t,i,r,n,a,s,o;for(e.pos=this.offset,this.metrics=[],n=0,s=this.file.hhea.numberOfMetrics;0<=s?n<s:s<n;0<=s?++n:--n)this.metrics.push({advance:e.readUInt16(),lsb:e.readInt16()});for(i=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=function(){var t,r;for(r=[],t=0;0<=i?t<i:i<t;0<=i?++t:--t)r.push(e.readInt16());return r}(),this.widths=function(){var e,t,i,n;for(n=[],e=0,t=(i=this.metrics).length;e<t;e++)r=i[e],n.push(r.advance);return n}.call(this),t=this.widths[this.widths.length-1],o=[],a=0;0<=i?a<i:i<a;0<=i?++a:--a)o.push(this.widths.push(t));return o},e.prototype.forGlyph=function(e){return e in this.metrics?this.metrics[e]:{advance:this.metrics[this.metrics.length-1].advance,lsb:this.leftSideBearings[e-this.metrics.length]}},e}(),x=[].slice,F=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return A(e,h),e.prototype.tag="glyf",e.prototype.parse=function(e){return this.cache={}},e.prototype.glyphFor=function(e){var t,i,r,n,a,s,o,l,h,d;return e in this.cache?this.cache[e]:(n=this.file.loca,t=this.file.contents,i=n.indexOf(e),0===(r=n.lengthOf(e))?this.cache[e]=null:(t.pos=this.offset+i,a=(s=new c(t.read(r))).readShort(),l=s.readShort(),d=s.readShort(),o=s.readShort(),h=s.readShort(),this.cache[e]=-1===a?new N(s,l,d,o,h):new S(s,a,l,d,o,h),this.cache[e]))},e.prototype.encode=function(e,t,i){var r,n,a,s,o;for(a=[],n=[],s=0,o=t.length;s<o;s++)r=e[t[s]],n.push(a.length),r&&(a=a.concat(r.encode(i)));return n.push(a.length),{table:a,offsets:n}},e}(),S=function(){function e(e,t,i,r,n,a){this.raw=e,this.numberOfContours=t,this.xMin=i,this.yMin=r,this.xMax=n,this.yMax=a,this.compound=!1}return e.prototype.encode=function(){return this.raw.data},e}(),N=function(){function e(e,t,i,r,n){var a,s;for(this.raw=e,this.xMin=t,this.yMin=i,this.xMax=r,this.yMax=n,this.compound=!0,this.glyphIDs=[],this.glyphOffsets=[],a=this.raw;s=a.readShort(),this.glyphOffsets.push(a.pos),this.glyphIDs.push(a.readShort()),32&s;)a.pos+=1&s?4:2,128&s?a.pos+=8:64&s?a.pos+=4:8&s&&(a.pos+=2)}return e.prototype.encode=function(e){var t,i,r,n,a;for(i=new c(x.call(this.raw.data)),t=r=0,n=(a=this.glyphIDs).length;r<n;t=++r)a[t],i.pos=this.glyphOffsets[t];return i.data},e}(),E=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return A(e,h),e.prototype.tag="loca",e.prototype.parse=function(e){var t;return e.pos=this.offset,t=this.file.head.indexToLocFormat,this.offsets=0===t?function(){var t,i,r;for(r=[],t=0,i=this.length;t<i;t+=2)r.push(2*e.readUInt16());return r}.call(this):function(){var t,i,r;for(r=[],t=0,i=this.length;t<i;t+=4)r.push(e.readUInt32());return r}.call(this)},e.prototype.indexOf=function(e){return this.offsets[e]},e.prototype.lengthOf=function(e){return this.offsets[e+1]-this.offsets[e]},e.prototype.encode=function(e,t){for(var i=new Uint32Array(this.offsets.length),r=0,n=0,a=0;a<i.length;++a)if(i[a]=r,n<t.length&&t[n]==a){++n,i[a]=r;var s=this.offsets[a],o=this.offsets[a+1]-s;0<o&&(r+=o)}for(var l=new Array(4*i.length),h=0;h<i.length;++h)l[4*h+3]=255&i[h],l[4*h+2]=(65280&i[h])>>8,l[4*h+1]=(16711680&i[h])>>16,l[4*h]=(4278190080&i[h])>>24;return l},e}(),k=function(){function e(e){this.font=e,this.subset={},this.unicodes={},this.next=33}return e.prototype.generateCmap=function(){var e,t,i,r,n;for(t in r=this.font.cmap.tables[0].codeMap,e={},n=this.subset)i=n[t],e[t]=r[i];return e},e.prototype.glyphsFor=function(e){var t,i,r,n,a,s,o;for(r={},a=0,s=e.length;a<s;a++)r[n=e[a]]=this.font.glyf.glyphFor(n);for(n in t=[],r)(null!=(i=r[n])?i.compound:void 0)&&t.push.apply(t,i.glyphIDs);if(0<t.length)for(n in o=this.glyphsFor(t))i=o[n],r[n]=i;return r},e.prototype.encode=function(e,t){var i,r,n,a,s,o,l,h,c,d,u,A,p,f,g;for(r in i=m.encode(this.generateCmap(),"unicode"),a=this.glyphsFor(e),u={0:0},g=i.charMap)u[(o=g[r]).old]=o.new;for(A in d=i.maxGlyphID,a)A in u||(u[A]=d++);return h=function(e){var t,i;for(t in i={},e)i[e[t]]=t;return i}(u),c=Object.keys(h).sort(function(e,t){return e-t}),p=function(){var e,t,i;for(i=[],e=0,t=c.length;e<t;e++)s=c[e],i.push(h[s]);return i}(),n=this.font.glyf.encode(a,p,u),l=this.font.loca.encode(n.offsets,p),f={cmap:this.font.cmap.raw(),glyf:n.table,loca:l,hmtx:this.font.hmtx.raw(),hhea:this.font.hhea.raw(),maxp:this.font.maxp.raw(),post:this.font.post.raw(),name:this.font.name.raw(),head:this.font.head.encode(t)},this.font.os2.exists&&(f["OS/2"]=this.font.os2.raw()),this.font.directory.encode(f)},e}();e.API.PDFObject=function(){var e;function t(){}return e=function(e,t){return(Array(t+1).join("0")+e).slice(-t)},t.convert=function(i){var r,n,a,s;if(Array.isArray(i))return"["+function(){var e,n,a;for(a=[],e=0,n=i.length;e<n;e++)r=i[e],a.push(t.convert(r));return a}().join(" ")+"]";if("string"==typeof i)return"/"+i;if(null!=i?i.isString:void 0)return"("+i+")";if(i instanceof Date)return"(D:"+e(i.getUTCFullYear(),4)+e(i.getUTCMonth(),2)+e(i.getUTCDate(),2)+e(i.getUTCHours(),2)+e(i.getUTCMinutes(),2)+e(i.getUTCSeconds(),2)+"Z)";if("[object Object]"!=={}.toString.call(i))return""+i;for(n in a=["<<"],i)s=i[n],a.push("/"+n+" "+t.convert(s));return a.push(">>"),a.join("\n")},t}()}(de),Fe="undefined"!=typeof self&&self||"undefined"!=typeof window&&window||void 0!==Cd&&Cd||Function('return typeof this === "object" && this.content')()||Function("return this")(),Se=function(){var e,t,i;function r(e){var t,i,r,n,a,s,o,l,h,c,d,u,A,p;for(this.data=e,this.pos=8,this.palette=[],this.imgData=[],this.transparency={},this.animation=null,this.text={},s=null;;){switch(t=this.readUInt32(),h=function(){var e,t;for(t=[],e=0;e<4;++e)t.push(String.fromCharCode(this.data[this.pos++]));return t}.call(this).join("")){case"IHDR":this.width=this.readUInt32(),this.height=this.readUInt32(),this.bits=this.data[this.pos++],this.colorType=this.data[this.pos++],this.compressionMethod=this.data[this.pos++],this.filterMethod=this.data[this.pos++],this.interlaceMethod=this.data[this.pos++];break;case"acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||1/0,frames:[]};break;case"PLTE":this.palette=this.read(t);break;case"fcTL":s&&this.animation.frames.push(s),this.pos+=4,s={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()},a=this.readUInt16(),n=this.readUInt16()||100,s.delay=1e3*a/n,s.disposeOp=this.data[this.pos++],s.blendOp=this.data[this.pos++],s.data=[];break;case"IDAT":case"fdAT":for("fdAT"===h&&(this.pos+=4,t-=4),e=(null!=s?s.data:void 0)||this.imgData,u=0;0<=t?u<t:t<u;0<=t?++u:--u)e.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:if(r=this.palette.length/3,this.transparency.indexed=this.read(t),this.transparency.indexed.length>r)throw new Error("More transparent colors than palette size");if(0<(c=r-this.transparency.indexed.length))for(A=0;0<=c?A<c:c<A;0<=c?++A:--A)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(t)[0];break;case 2:this.transparency.rgb=this.read(t)}break;case"tEXt":o=(d=this.read(t)).indexOf(0),l=String.fromCharCode.apply(String,d.slice(0,o)),this.text[l]=String.fromCharCode.apply(String,d.slice(o+1));break;case"IEND":return s&&this.animation.frames.push(s),this.colors=function(){switch(this.colorType){case 0:case 3:case 4:return 1;case 2:case 6:return 3}}.call(this),this.hasAlphaChannel=4===(p=this.colorType)||6===p,i=this.colors+(this.hasAlphaChannel?1:0),this.pixelBitlength=this.bits*i,this.colorSpace=function(){switch(this.colors){case 1:return"DeviceGray";case 3:return"DeviceRGB"}}.call(this),void(this.imgData=new Uint8Array(this.imgData));default:this.pos+=t}if(this.pos+=4,this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}r.load=function(e,t,i){var n;return"function"==typeof t&&(i=t),(n=new XMLHttpRequest).open("GET",e,!0),n.responseType="arraybuffer",n.onload=function(){var e;return e=new r(new Uint8Array(n.response||n.mozResponseArrayBuffer)),"function"==typeof(null!=t?t.getContext:void 0)&&e.render(t),"function"==typeof i?i(e):void 0},n.send(null)},r.prototype.read=function(e){var t,i;for(i=[],t=0;0<=e?t<e:e<t;0<=e?++t:--t)i.push(this.data[this.pos++]);return i},r.prototype.readUInt32=function(){return this.data[this.pos++]<<24|this.data[this.pos++]<<16|this.data[this.pos++]<<8|this.data[this.pos++]},r.prototype.readUInt16=function(){return this.data[this.pos++]<<8|this.data[this.pos++]},r.prototype.decodePixels=function(e){var t=this.pixelBitlength/8,i=new Uint8Array(this.width*this.height*t),r=0,n=this;if(null==e&&(e=this.imgData),0===e.length)return new Uint8Array(0);function a(a,s,o,l){var h,c,d,u,A,p,f,m,g,w,b,v,y,B,C,x,F,S,N,E,k,T=Math.ceil((n.width-a)/o),L=Math.ceil((n.height-s)/l),I=n.width==T&&n.height==L;for(B=t*T,v=I?i:new Uint8Array(B*L),p=e.length,c=y=0;y<L&&r<p;){switch(e[r++]){case 0:for(u=F=0;F<B;u=F+=1)v[c++]=e[r++];break;case 1:for(u=S=0;S<B;u=S+=1)h=e[r++],A=u<t?0:v[c-t],v[c++]=(h+A)%256;break;case 2:for(u=N=0;N<B;u=N+=1)h=e[r++],d=(u-u%t)/t,C=y&&v[(y-1)*B+d*t+u%t],v[c++]=(C+h)%256;break;case 3:for(u=E=0;E<B;u=E+=1)h=e[r++],d=(u-u%t)/t,A=u<t?0:v[c-t],C=y&&v[(y-1)*B+d*t+u%t],v[c++]=(h+Math.floor((A+C)/2))%256;break;case 4:for(u=k=0;k<B;u=k+=1)h=e[r++],d=(u-u%t)/t,A=u<t?0:v[c-t],0===y?C=x=0:(C=v[(y-1)*B+d*t+u%t],x=d&&v[(y-1)*B+(d-1)*t+u%t]),f=A+C-x,m=Math.abs(f-A),w=Math.abs(f-C),b=Math.abs(f-x),g=m<=w&&m<=b?A:w<=b?C:x,v[c++]=(h+g)%256;break;default:throw new Error("Invalid filter algorithm: "+e[r-1])}if(!I){var D=((s+y*l)*n.width+a)*t,U=y*B;for(u=0;u<T;u+=1){for(var P=0;P<t;P+=1)i[D++]=v[U++];D+=(o-1)*t}}y++}}return e=(e=new De(e)).getBytes(),1==n.interlaceMethod?(a(0,0,8,8),a(4,0,8,8),a(0,4,4,8),a(2,0,4,4),a(0,2,2,4),a(1,0,2,2),a(0,1,1,2)):a(0,0,1,1),i},r.prototype.decodePalette=function(){var e,t,i,r,n,a,s,o,l;for(i=this.palette,a=this.transparency.indexed||[],n=new Uint8Array((a.length||0)+i.length),r=0,i.length,t=s=e=0,o=i.length;s<o;t=s+=3)n[r++]=i[t],n[r++]=i[t+1],n[r++]=i[t+2],n[r++]=null!=(l=a[e++])?l:255;return n},r.prototype.copyToImageData=function(e,t){var i,r,n,a,s,o,l,h,c,d,u;if(r=this.colors,c=null,i=this.hasAlphaChannel,this.palette.length&&(c=null!=(u=this._decodedPalette)?u:this._decodedPalette=this.decodePalette(),r=4,i=!0),h=(n=e.data||e).length,s=c||t,a=o=0,1===r)for(;a<h;)l=c?4*t[a/4]:o,d=s[l++],n[a++]=d,n[a++]=d,n[a++]=d,n[a++]=i?s[l++]:255,o=l;else for(;a<h;)l=c?4*t[a/4]:o,n[a++]=s[l++],n[a++]=s[l++],n[a++]=s[l++],n[a++]=i?s[l++]:255,o=l},r.prototype.decode=function(){var e;return e=new Uint8Array(this.width*this.height*4),this.copyToImageData(e,this.decodePixels()),e};try{t=Fe.document.createElement("canvas"),i=t.getContext("2d")}catch(e){return-1}return e=function(e){var r;return i.width=e.width,i.height=e.height,i.clearRect(0,0,e.width,e.height),i.putImageData(e,0,0),(r=new Image).src=t.toDataURL(),r},r.prototype.decodeFrames=function(t){var i,r,n,a,s,o,l,h;if(this.animation){for(h=[],r=s=0,o=(l=this.animation.frames).length;s<o;r=++s)i=l[r],n=t.createImageData(i.width,i.height),a=this.decodePixels(new Uint8Array(i.data)),this.copyToImageData(n,a),i.imageData=n,h.push(i.image=e(n));return h}},r.prototype.renderFrame=function(e,t){var i,r,n;return i=(r=this.animation.frames)[t],n=r[t-1],0===t&&e.clearRect(0,0,this.width,this.height),1===(null!=n?n.disposeOp:void 0)?e.clearRect(n.xOffset,n.yOffset,n.width,n.height):2===(null!=n?n.disposeOp:void 0)&&e.putImageData(n.imageData,n.xOffset,n.yOffset),0===i.blendOp&&e.clearRect(i.xOffset,i.yOffset,i.width,i.height),e.drawImage(i.image,i.xOffset,i.yOffset)},r.prototype.animate=function(e){var t,i,r,n,a,s,o=this;return i=0,s=this.animation,n=s.numFrames,r=s.frames,a=s.numPlays,(t=function(){var s,l;if(s=i++%n,l=r[s],o.renderFrame(e,s),1<n&&i/n<a)return o.animation._timeout=setTimeout(t,l.delay)})()},r.prototype.stopAnimation=function(){var e;return clearTimeout(null!=(e=this.animation)?e._timeout:void 0)},r.prototype.render=function(e){var t,i;return e._png&&e._png.stopAnimation(),e._png=this,e.width=this.width,e.height=this.height,t=e.getContext("2d"),this.animation?(this.decodeFrames(t),this.animate(t)):(i=t.createImageData(this.width,this.height),this.copyToImageData(i,this.decodePixels()),t.putImageData(i,0,0))},r}(),Fe.PNG=Se;var Ie=function(){function e(){this.pos=0,this.bufferLength=0,this.eof=!1,this.buffer=null}return e.prototype={ensureBuffer:function(e){var t=this.buffer,i=t?t.byteLength:0;if(e<i)return t;for(var r=512;r<e;)r<<=1;for(var n=new Uint8Array(r),a=0;a<i;++a)n[a]=t[a];return this.buffer=n},getByte:function(){for(var e=this.pos;this.bufferLength<=e;){if(this.eof)return null;this.readBlock()}return this.buffer[this.pos++]},getBytes:function(e){var t=this.pos;if(e){this.ensureBuffer(t+e);for(var i=t+e;!this.eof&&this.bufferLength<i;)this.readBlock();var r=this.bufferLength;r<i&&(i=r)}else{for(;!this.eof;)this.readBlock();i=this.bufferLength}return this.pos=i,this.buffer.subarray(t,i)},lookChar:function(){for(var e=this.pos;this.bufferLength<=e;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos])},getChar:function(){for(var e=this.pos;this.bufferLength<=e;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos++])},makeSubStream:function(e,t,i){for(var r=e+t;this.bufferLength<=r&&!this.eof;)this.readBlock();return new Stream(this.buffer,e,t,i)},skip:function(e){e||(e=1),this.pos+=e},reset:function(){this.pos=0}},e}(),De=function(){if("undefined"!=typeof Uint32Array){var e=new Uint32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),t=new Uint32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),i=new Uint32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),r=[new Uint32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],n=[new Uint32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5];return(s.prototype=Object.create(Ie.prototype)).getBits=function(e){for(var t,i=this.codeSize,r=this.codeBuf,n=this.bytes,s=this.bytesPos;i<e;)void 0===(t=n[s++])&&a("Bad encoding in flate stream"),r|=t<<i,i+=8;return t=r&(1<<e)-1,this.codeBuf=r>>e,this.codeSize=i-=e,this.bytesPos=s,t},s.prototype.getCode=function(e){for(var t=e[0],i=e[1],r=this.codeSize,n=this.codeBuf,s=this.bytes,o=this.bytesPos;r<i;){var l;void 0===(l=s[o++])&&a("Bad encoding in flate stream"),n|=l<<r,r+=8}var h=t[n&(1<<i)-1],c=h>>16,d=65535&h;return(0==r||r<c||0==c)&&a("Bad encoding in flate stream"),this.codeBuf=n>>c,this.codeSize=r-c,this.bytesPos=o,d},s.prototype.generateHuffmanTable=function(e){for(var t=e.length,i=0,r=0;r<t;++r)e[r]>i&&(i=e[r]);for(var n=1<<i,a=new Uint32Array(n),s=1,o=0,l=2;s<=i;++s,o<<=1,l<<=1)for(var h=0;h<t;++h)if(e[h]==s){var c=0,d=o;for(r=0;r<s;++r)c=c<<1|1&d,d>>=1;for(r=c;r<n;r+=l)a[r]=s<<16|h;++o}return[a,i]},s.prototype.readBlock=function(){function s(e,t,i,r,n){for(var a=e.getBits(i)+r;0<a--;)t[p++]=n}var o=this.getBits(3);if(1&o&&(this.eof=!0),0!=(o>>=1)){var l,h;if(1==o)l=r,h=n;else if(2==o){for(var c=this.getBits(5)+257,d=this.getBits(5)+1,u=this.getBits(4)+4,A=Array(e.length),p=0;p<u;)A[e[p++]]=this.getBits(3);for(var f=this.generateHuffmanTable(A),m=0,g=(p=0,c+d),w=new Array(g);p<g;){var b=this.getCode(f);16==b?s(this,w,2,3,m):17==b?s(this,w,3,3,m=0):18==b?s(this,w,7,11,m=0):w[p++]=m=b}l=this.generateHuffmanTable(w.slice(0,c)),h=this.generateHuffmanTable(w.slice(c,g))}else a("Unknown block type in flate stream");for(var v=(I=this.buffer)?I.length:0,y=this.bufferLength;;){var B=this.getCode(l);if(B<256)v<=y+1&&(v=(I=this.ensureBuffer(y+1)).length),I[y++]=B;else{if(256==B)return void(this.bufferLength=y);var C=(B=t[B-=257])>>16;0<C&&(C=this.getBits(C)),m=(65535&B)+C,B=this.getCode(h),0<(C=(B=i[B])>>16)&&(C=this.getBits(C));var x=(65535&B)+C;v<=y+m&&(v=(I=this.ensureBuffer(y+m)).length);for(var F=0;F<m;++F,++y)I[y]=I[y-x]}}}else{var S,N=this.bytes,E=this.bytesPos;void 0===(S=N[E++])&&a("Bad block header in flate stream");var k=S;void 0===(S=N[E++])&&a("Bad block header in flate stream"),k|=S<<8,void 0===(S=N[E++])&&a("Bad block header in flate stream");var T=S;void 0===(S=N[E++])&&a("Bad block header in flate stream"),(T|=S<<8)!=(65535&~k)&&a("Bad uncompressed block length in flate stream"),this.codeBuf=0,this.codeSize=0;var L=this.bufferLength,I=this.ensureBuffer(L+k),D=L+k;this.bufferLength=D;for(var U=L;U<D;++U){if(void 0===(S=N[E++])){this.eof=!0;break}I[U]=S}this.bytesPos=E}},s}function a(e){throw new Error(e)}function s(e){var t=0,i=e[t++],r=e[t++];-1!=i&&-1!=r||a("Invalid header in flate stream"),8!=(15&i)&&a("Unknown compression method in flate stream"),((i<<8)+r)%31!=0&&a("Bad FCHECK in flate stream"),32&r&&a("FDICT bit set in flate stream"),this.bytes=e,this.bytesPos=2,this.codeSize=0,this.codeBuf=0,Ie.call(this)}}();window.tmp=De}();try{e.exports=jsPDF}catch(e){}
131
131
  /** @license html2canvas 1.0.0-rc.1 | Copyright (c) 2019 Niklas von Hertzen [https://html2canvas.hertzen.com] | MIT License [https://github.com/niklasvh/html2canvas/blob/master/LICENSE] */r=function(){return function(e){var t={};function i(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=e,i.c=t,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=5)}([function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0});var r=i(1);Object.defineProperty(t,"toCodePoints",{enumerable:!0,get:function(){return r.toCodePoints}}),Object.defineProperty(t,"fromCodePoint",{enumerable:!0,get:function(){return r.fromCodePoint}});var n=i(2);Object.defineProperty(t,"LineBreaker",{enumerable:!0,get:function(){return n.LineBreaker}})},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.toCodePoints=function(e){for(var t=[],i=0,r=e.length;i<r;){var n=e.charCodeAt(i++);if(n>=55296&&n<=56319&&i<r){var a=e.charCodeAt(i++);56320==(64512&a)?t.push(((1023&n)<<10)+(1023&a)+65536):(t.push(n),i--)}else t.push(n)}return t},t.fromCodePoint=function(){if(String.fromCodePoint)return String.fromCodePoint.apply(String,arguments);var e=arguments.length;if(!e)return"";for(var t=[],i=-1,r="";++i<e;){var n=arguments.length<=i?void 0:arguments[i];n<=65535?t.push(n):(n-=65536,t.push(55296+(n>>10),n%1024+56320)),(i+1===e||t.length>16384)&&(r+=String.fromCharCode.apply(String,t),t.length=0)}return r};for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n="undefined"==typeof Uint8Array?[]:new Uint8Array(256),a=0;a<64;a++)n[r.charCodeAt(a)]=a;t.decode=function(e){var t=.75*e.length,i=e.length,r=void 0,a=0,s=void 0,o=void 0,l=void 0,h=void 0;"="===e[e.length-1]&&(t--,"="===e[e.length-2]&&t--);var c="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(t):new Array(t),d=Array.isArray(c)?c:new Uint8Array(c);for(r=0;r<i;r+=4)s=n[e.charCodeAt(r)],o=n[e.charCodeAt(r+1)],l=n[e.charCodeAt(r+2)],h=n[e.charCodeAt(r+3)],d[a++]=s<<2|o>>4,d[a++]=(15&o)<<4|l>>2,d[a++]=(3&l)<<6|63&h;return c},t.polyUint16Array=function(e){for(var t=e.length,i=[],r=0;r<t;r+=2)i.push(e[r+1]<<8|e[r]);return i},t.polyUint32Array=function(e){for(var t=e.length,i=[],r=0;r<t;r+=4)i.push(e[r+3]<<24|e[r+2]<<16|e[r+1]<<8|e[r]);return i}},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.LineBreaker=t.inlineBreakOpportunities=t.lineBreakAtIndex=t.codePointsToCharacterClasses=t.UnicodeTrie=t.BREAK_ALLOWED=t.BREAK_NOT_ALLOWED=t.BREAK_MANDATORY=t.classes=t.LETTER_NUMBER_MODIFIER=void 0;var r=function(){function e(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,i,r){return i&&e(t.prototype,i),r&&e(t,r),t}}(),n=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var i=[],r=!0,n=!1,a=void 0;try{for(var s,o=e[Symbol.iterator]();!(r=(s=o.next()).done)&&(i.push(s.value),!t||i.length!==t);r=!0);}catch(e){n=!0,a=e}finally{try{!r&&o.return&&o.return()}finally{if(n)throw a}}return i}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},a=i(3),s=function(e){return e&&e.__esModule?e:{default:e}}(i(4)),o=i(1),l=t.LETTER_NUMBER_MODIFIER=50,h=10,c=13,d=15,u=17,A=18,p=19,f=20,m=21,g=22,w=24,b=25,v=26,y=27,B=28,C=30,x=32,F=33,S=34,N=35,E=37,k=38,T=39,L=40,I=42,D=(t.classes={BK:1,CR:2,LF:3,CM:4,NL:5,SG:6,WJ:7,ZW:8,GL:9,SP:h,ZWJ:11,B2:12,BA:c,BB:14,HY:d,CB:16,CL:u,CP:A,EX:p,IN:f,NS:m,OP:g,QU:23,IS:w,NU:b,PO:v,PR:y,SY:B,AI:29,AL:C,CJ:31,EB:x,EM:F,H2:S,H3:N,HL:36,ID:E,JL:k,JV:T,JT:L,RI:41,SA:I,XX:43},t.BREAK_MANDATORY="!"),U=t.BREAK_NOT_ALLOWED="×",P=t.BREAK_ALLOWED="÷",R=t.UnicodeTrie=(0,a.createTrieFromBase64)(s.default),O=[C,36],Q=[1,2,3,5],H=[h,8],M=[y,v],_=Q.concat(H),j=[k,T,L,S,N],z=[d,c],V=t.codePointsToCharacterClasses=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"strict",i=[],r=[],n=[];return e.forEach(function(e,a){var s=R.get(e);if(s>l?(n.push(!0),s-=l):n.push(!1),-1!==["normal","auto","loose"].indexOf(t)&&-1!==[8208,8211,12316,12448].indexOf(e))return r.push(a),i.push(16);if(4===s||11===s){if(0===a)return r.push(a),i.push(C);var o=i[a-1];return-1===_.indexOf(o)?(r.push(r[a-1]),i.push(o)):(r.push(a),i.push(C))}return r.push(a),31===s?i.push("strict"===t?m:E):s===I||29===s?i.push(C):43===s?e>=131072&&e<=196605||e>=196608&&e<=262141?i.push(E):i.push(C):void i.push(s)}),[r,i,n]},K=function(e,t,i,r){var n=r[i];if(Array.isArray(e)?-1!==e.indexOf(n):e===n)for(var a=i;a<=r.length;){var s=r[++a];if(s===t)return!0;if(s!==h)break}if(n===h)for(var o=i;o>0;){var l=r[--o];if(Array.isArray(e)?-1!==e.indexOf(l):e===l)for(var c=i;c<=r.length;){var d=r[++c];if(d===t)return!0;if(d!==h)break}if(l!==h)break}return!1},q=function(e,t){for(var i=e;i>=0;){var r=t[i];if(r!==h)return r;i--}return 0},G=function(e,t,i,r,n){if(0===i[r])return U;var a=r-1;if(Array.isArray(n)&&!0===n[a])return U;var s=a-1,o=a+1,l=t[a],C=s>=0?t[s]:0,I=t[o];if(2===l&&3===I)return U;if(-1!==Q.indexOf(l))return D;if(-1!==Q.indexOf(I))return U;if(-1!==H.indexOf(I))return U;if(8===q(a,t))return P;if(11===R.get(e[a])&&(I===E||I===x||I===F))return U;if(7===l||7===I)return U;if(9===l)return U;if(-1===[h,c,d].indexOf(l)&&9===I)return U;if(-1!==[u,A,p,w,B].indexOf(I))return U;if(q(a,t)===g)return U;if(K(23,g,a,t))return U;if(K([u,A],m,a,t))return U;if(K(12,12,a,t))return U;if(l===h)return P;if(23===l||23===I)return U;if(16===I||16===l)return P;if(-1!==[c,d,m].indexOf(I)||14===l)return U;if(36===C&&-1!==z.indexOf(l))return U;if(l===B&&36===I)return U;if(I===f&&-1!==O.concat(f,p,b,E,x,F).indexOf(l))return U;if(-1!==O.indexOf(I)&&l===b||-1!==O.indexOf(l)&&I===b)return U;if(l===y&&-1!==[E,x,F].indexOf(I)||-1!==[E,x,F].indexOf(l)&&I===v)return U;if(-1!==O.indexOf(l)&&-1!==M.indexOf(I)||-1!==M.indexOf(l)&&-1!==O.indexOf(I))return U;if(-1!==[y,v].indexOf(l)&&(I===b||-1!==[g,d].indexOf(I)&&t[o+1]===b)||-1!==[g,d].indexOf(l)&&I===b||l===b&&-1!==[b,B,w].indexOf(I))return U;if(-1!==[b,B,w,u,A].indexOf(I))for(var _=a;_>=0;){var V=t[_];if(V===b)return U;if(-1===[B,w].indexOf(V))break;_--}if(-1!==[y,v].indexOf(I))for(var G=-1!==[u,A].indexOf(l)?s:a;G>=0;){var W=t[G];if(W===b)return U;if(-1===[B,w].indexOf(W))break;G--}if(k===l&&-1!==[k,T,S,N].indexOf(I)||-1!==[T,S].indexOf(l)&&-1!==[T,L].indexOf(I)||-1!==[L,N].indexOf(l)&&I===L)return U;if(-1!==j.indexOf(l)&&-1!==[f,v].indexOf(I)||-1!==j.indexOf(I)&&l===y)return U;if(-1!==O.indexOf(l)&&-1!==O.indexOf(I))return U;if(l===w&&-1!==O.indexOf(I))return U;if(-1!==O.concat(b).indexOf(l)&&I===g||-1!==O.concat(b).indexOf(I)&&l===A)return U;if(41===l&&41===I){for(var J=i[a],X=1;J>0&&41===t[--J];)X++;if(X%2!=0)return U}return l===x&&I===F?U:P},W=(t.lineBreakAtIndex=function(e,t){if(0===t)return U;if(t>=e.length)return D;var i=V(e),r=n(i,2),a=r[0],s=r[1];return G(e,s,a,t)},function(e,t){t||(t={lineBreak:"normal",wordBreak:"normal"});var i=V(e,t.lineBreak),r=n(i,3),a=r[0],s=r[1],o=r[2];return"break-all"!==t.wordBreak&&"break-word"!==t.wordBreak||(s=s.map(function(e){return-1!==[b,C,I].indexOf(e)?E:e})),[a,s,"keep-all"===t.wordBreak?o.map(function(t,i){return t&&e[i]>=19968&&e[i]<=40959}):null]}),J=(t.inlineBreakOpportunities=function(e,t){var i=(0,o.toCodePoints)(e),r=U,a=W(i,t),s=n(a,3),l=s[0],h=s[1],c=s[2];return i.forEach(function(e,t){r+=(0,o.fromCodePoint)(e)+(t>=i.length-1?D:G(i,h,l,t+1,c))}),r},function(){function e(t,i,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._codePoints=t,this.required=i===D,this.start=r,this.end=n}return r(e,[{key:"slice",value:function(){return o.fromCodePoint.apply(void 0,function(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}(this._codePoints.slice(this.start,this.end)))}}]),e}());t.LineBreaker=function(e,t){var i=(0,o.toCodePoints)(e),r=W(i,t),a=n(r,3),s=a[0],l=a[1],h=a[2],c=i.length,d=0,u=0;return{next:function(){if(u>=c)return{done:!0};for(var e=U;u<c&&(e=G(i,l,s,++u,h))===U;);if(e!==U||u===c){var t=new J(i,e,d,u);return d=u,{value:t,done:!1}}return{done:!0}}}}},function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.Trie=t.createTrieFromBase64=t.UTRIE2_INDEX_2_MASK=t.UTRIE2_INDEX_2_BLOCK_LENGTH=t.UTRIE2_OMITTED_BMP_INDEX_1_LENGTH=t.UTRIE2_INDEX_1_OFFSET=t.UTRIE2_UTF8_2B_INDEX_2_LENGTH=t.UTRIE2_UTF8_2B_INDEX_2_OFFSET=t.UTRIE2_INDEX_2_BMP_LENGTH=t.UTRIE2_LSCP_INDEX_2_LENGTH=t.UTRIE2_DATA_MASK=t.UTRIE2_DATA_BLOCK_LENGTH=t.UTRIE2_LSCP_INDEX_2_OFFSET=t.UTRIE2_SHIFT_1_2=t.UTRIE2_INDEX_SHIFT=t.UTRIE2_SHIFT_1=t.UTRIE2_SHIFT_2=void 0;var r=function(){function e(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,i,r){return i&&e(t.prototype,i),r&&e(t,r),t}}(),n=i(1),a=t.UTRIE2_SHIFT_2=5,s=t.UTRIE2_SHIFT_1=11,o=t.UTRIE2_INDEX_SHIFT=2,l=t.UTRIE2_SHIFT_1_2=s-a,h=t.UTRIE2_LSCP_INDEX_2_OFFSET=65536>>a,c=t.UTRIE2_DATA_BLOCK_LENGTH=1<<a,d=t.UTRIE2_DATA_MASK=c-1,u=t.UTRIE2_LSCP_INDEX_2_LENGTH=1024>>a,A=t.UTRIE2_INDEX_2_BMP_LENGTH=h+u,p=t.UTRIE2_UTF8_2B_INDEX_2_OFFSET=A,f=t.UTRIE2_UTF8_2B_INDEX_2_LENGTH=32,m=t.UTRIE2_INDEX_1_OFFSET=p+f,g=t.UTRIE2_OMITTED_BMP_INDEX_1_LENGTH=65536>>s,w=t.UTRIE2_INDEX_2_BLOCK_LENGTH=1<<l,b=t.UTRIE2_INDEX_2_MASK=w-1,v=(t.createTrieFromBase64=function(e){var t=(0,n.decode)(e),i=Array.isArray(t)?(0,n.polyUint32Array)(t):new Uint32Array(t),r=Array.isArray(t)?(0,n.polyUint16Array)(t):new Uint16Array(t),a=r.slice(12,i[4]/2),s=2===i[5]?r.slice((24+i[4])/2):i.slice(Math.ceil((24+i[4])/4));return new v(i[0],i[1],i[2],i[3],a,s)},t.Trie=function(){function e(t,i,r,n,a,s){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.initialValue=t,this.errorValue=i,this.highStart=r,this.highValueIndex=n,this.index=a,this.data=s}return r(e,[{key:"get",value:function(e){var t=void 0;if(e>=0){if(e<55296||e>56319&&e<=65535)return t=((t=this.index[e>>a])<<o)+(e&d),this.data[t];if(e<=65535)return t=((t=this.index[h+(e-55296>>a)])<<o)+(e&d),this.data[t];if(e<this.highStart)return t=m-g+(e>>s),t=this.index[t],t+=e>>a&b,t=((t=this.index[t])<<o)+(e&d),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue}}]),e}())},function(e,t,i){e.exports="KwAAAAAAAAAACA4AIDoAAPAfAAACAAAAAAAIABAAGABAAEgAUABYAF4AZgBeAGYAYABoAHAAeABeAGYAfACEAIAAiACQAJgAoACoAK0AtQC9AMUAXgBmAF4AZgBeAGYAzQDVAF4AZgDRANkA3gDmAOwA9AD8AAQBDAEUARoBIgGAAIgAJwEvATcBPwFFAU0BTAFUAVwBZAFsAXMBewGDATAAiwGTAZsBogGkAawBtAG8AcIBygHSAdoB4AHoAfAB+AH+AQYCDgIWAv4BHgImAi4CNgI+AkUCTQJTAlsCYwJrAnECeQKBAk0CiQKRApkCoQKoArACuALAAsQCzAIwANQC3ALkAjAA7AL0AvwCAQMJAxADGAMwACADJgMuAzYDPgOAAEYDSgNSA1IDUgNaA1oDYANiA2IDgACAAGoDgAByA3YDfgOAAIQDgACKA5IDmgOAAIAAogOqA4AAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAK8DtwOAAIAAvwPHA88D1wPfAyAD5wPsA/QD/AOAAIAABAQMBBIEgAAWBB4EJgQuBDMEIAM7BEEEXgBJBCADUQRZBGEEaQQwADAAcQQ+AXkEgQSJBJEEgACYBIAAoASoBK8EtwQwAL8ExQSAAIAAgACAAIAAgACgAM0EXgBeAF4AXgBeAF4AXgBeANUEXgDZBOEEXgDpBPEE+QQBBQkFEQUZBSEFKQUxBTUFPQVFBUwFVAVcBV4AYwVeAGsFcwV7BYMFiwWSBV4AmgWgBacFXgBeAF4AXgBeAKsFXgCyBbEFugW7BcIFwgXIBcIFwgXQBdQF3AXkBesF8wX7BQMGCwYTBhsGIwYrBjMGOwZeAD8GRwZNBl4AVAZbBl4AXgBeAF4AXgBeAF4AXgBeAF4AXgBeAGMGXgBqBnEGXgBeAF4AXgBeAF4AXgBeAF4AXgB5BoAG4wSGBo4GkwaAAIADHgR5AF4AXgBeAJsGgABGA4AAowarBrMGswagALsGwwbLBjAA0wbaBtoG3QbaBtoG2gbaBtoG2gblBusG8wb7BgMHCwcTBxsHCwcjBysHMAc1BzUHOgdCB9oGSgdSB1oHYAfaBloHaAfaBlIH2gbaBtoG2gbaBtoG2gbaBjUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHbQdeAF4ANQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQd1B30HNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B4MH2gaKB68EgACAAIAAgACAAIAAgACAAI8HlwdeAJ8HpweAAIAArwe3B14AXgC/B8UHygcwANAH2AfgB4AA6AfwBz4B+AcACFwBCAgPCBcIogEYAR8IJwiAAC8INwg/CCADRwhPCFcIXwhnCEoDGgSAAIAAgABvCHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIhAiLCI4IMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAANQc1BzUHNQc1BzUHNQc1BzUHNQc1B54INQc1B6II2gaqCLIIugiAAIAAvgjGCIAAgACAAIAAgACAAIAAgACAAIAAywiHAYAA0wiAANkI3QjlCO0I9Aj8CIAAgACAAAIJCgkSCRoJIgknCTYHLwk3CZYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiAAIAAAAFAAXgBeAGAAcABeAHwAQACQAKAArQC9AJ4AXgBeAE0A3gBRAN4A7AD8AMwBGgEAAKcBNwEFAUwBXAF4QkhCmEKnArcCgAHHAsABz4LAAcABwAHAAd+C6ABoAG+C/4LAAcABwAHAAc+DF4MAAcAB54M3gweDV4Nng3eDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEeDqABVg6WDqABoQ6gAaABoAHXDvcONw/3DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DncPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB7cPPwlGCU4JMACAAIAAgABWCV4JYQmAAGkJcAl4CXwJgAkwADAAMAAwAIgJgACLCZMJgACZCZ8JowmrCYAAswkwAF4AXgB8AIAAuwkABMMJyQmAAM4JgADVCTAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAqwYWBNkIMAAwADAAMADdCeAJ6AnuCR4E9gkwAP4JBQoNCjAAMACAABUK0wiAAB0KJAosCjQKgAAwADwKQwqAAEsKvQmdCVMKWwowADAAgACAALcEMACAAGMKgABrCjAAMAAwADAAMAAwADAAMAAwADAAMAAeBDAAMAAwADAAMAAwADAAMAAwADAAMAAwAIkEPQFzCnoKiQSCCooKkAqJBJgKoAqkCokEGAGsCrQKvArBCjAAMADJCtEKFQHZCuEK/gHpCvEKMAAwADAAMACAAIwE+QowAIAAPwEBCzAAMAAwADAAMACAAAkLEQswAIAAPwEZCyELgAAOCCkLMAAxCzkLMAAwADAAMAAwADAAXgBeAEELMAAwADAAMAAwADAAMAAwAEkLTQtVC4AAXAtkC4AAiQkwADAAMAAwADAAMAAwADAAbAtxC3kLgAuFC4sLMAAwAJMLlwufCzAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAApwswADAAMACAAIAAgACvC4AAgACAAIAAgACAALcLMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAvwuAAMcLgACAAIAAgACAAIAAyguAAIAAgACAAIAA0QswADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAANkLgACAAIAA4AswADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACJCR4E6AswADAAhwHwC4AA+AsADAgMEAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMACAAIAAGAwdDCUMMAAwAC0MNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQw1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHPQwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADUHNQc1BzUHNQc1BzUHNQc2BzAAMAA5DDUHNQc1BzUHNQc1BzUHNQc1BzUHNQdFDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAATQxSDFoMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAF4AXgBeAF4AXgBeAF4AYgxeAGoMXgBxDHkMfwxeAIUMXgBeAI0MMAAwADAAMAAwAF4AXgCVDJ0MMAAwADAAMABeAF4ApQxeAKsMswy7DF4Awgy9DMoMXgBeAF4AXgBeAF4AXgBeAF4AXgDRDNkMeQBqCeAM3Ax8AOYM7Az0DPgMXgBeAF4AXgBeAF4AXgBeAF4AXgBeAF4AXgBeAF4AXgCgAAANoAAHDQ4NFg0wADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAeDSYNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIAAgACAAIAAgACAAC4NMABeAF4ANg0wADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAD4NRg1ODVYNXg1mDTAAbQ0wADAAMAAwADAAMAAwADAA2gbaBtoG2gbaBtoG2gbaBnUNeg3CBYANwgWFDdoGjA3aBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gaUDZwNpA2oDdoG2gawDbcNvw3HDdoG2gbPDdYN3A3fDeYN2gbsDfMN2gbaBvoN/g3aBgYODg7aBl4AXgBeABYOXgBeACUG2gYeDl4AJA5eACwO2w3aBtoGMQ45DtoG2gbaBtoGQQ7aBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gZJDjUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B1EO2gY1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQdZDjUHNQc1BzUHNQc1B2EONQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHaA41BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B3AO2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gY1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B2EO2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gZJDtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBkkOeA6gAKAAoAAwADAAMAAwAKAAoACgAKAAoACgAKAAgA4wADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAD//wQABAAEAAQABAAEAAQABAAEAA0AAwABAAEAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAKABMAFwAeABsAGgAeABcAFgASAB4AGwAYAA8AGAAcAEsASwBLAEsASwBLAEsASwBLAEsAGAAYAB4AHgAeABMAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAFgAbABIAHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYADQARAB4ABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkAFgAaABsAGwAbAB4AHQAdAB4ATwAXAB4ADQAeAB4AGgAbAE8ATwAOAFAAHQAdAB0ATwBPABcATwBPAE8AFgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwArAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAAQABAANAA0ASwBLAEsASwBLAEsASwBLAEsASwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUAArACsABABQAAQABAAEAAQABAAEAAQAKwArAAQABAArACsABAAEAAQAUAArACsAKwArACsAKwArACsABAArACsAKwArAFAAUAArAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAGgAaAFAAUABQAFAAUABMAB4AGwBQAB4AKwArACsABAAEAAQAKwBQAFAAUABQAFAAUAArACsAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUAArAFAAUAArACsABAArAAQABAAEAAQABAArACsAKwArAAQABAArACsABAAEAAQAKwArACsABAArACsAKwArACsAKwArAFAAUABQAFAAKwBQACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwAEAAQAUABQAFAABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUAArACsABABQAAQABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQAKwArAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwAeABsAKwArACsAKwArACsAKwBQAAQABAAEAAQABAAEACsABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwArAAQABAArACsABAAEAAQAKwArACsAKwArACsAKwArAAQABAArACsAKwArAFAAUAArAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwAeAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwAEAFAAKwBQAFAAUABQAFAAUAArACsAKwBQAFAAUAArAFAAUABQAFAAKwArACsAUABQACsAUAArAFAAUAArACsAKwBQAFAAKwArACsAUABQAFAAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQAKwArACsABAAEAAQAKwAEAAQABAAEACsAKwBQACsAKwArACsAKwArAAQAKwArACsAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAB4AHgAeAB4AHgAeABsAHgArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABAArACsAKwArACsAKwArAAQABAArAFAAUABQACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAB4AUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABAArACsAKwArACsAKwArAAQABAArACsAKwArACsAKwArAFAAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwArAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAKwBcAFwAKwBcACsAKwBcACsAKwArACsAKwArAFwAXABcAFwAKwBcAFwAXABcAFwAXABcACsAXABcAFwAKwBcACsAXAArACsAXABcACsAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgArACoAKgBcACsAKwBcAFwAXABcAFwAKwBcACsAKgAqACoAKgAqACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAFwAXABcAFwAUAAOAA4ADgAOAB4ADgAOAAkADgAOAA0ACQATABMAEwATABMACQAeABMAHgAeAB4ABAAEAB4AHgAeAB4AHgAeAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUAANAAQAHgAEAB4ABAAWABEAFgARAAQABABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAAQABAAEAAQABAANAAQABABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsADQANAB4AHgAeAB4AHgAeAAQAHgAeAB4AHgAeAB4AKwAeAB4ADgAOAA0ADgAeAB4AHgAeAB4ACQAJACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgAeAB4AHgBcAFwAXABcAFwAXAAqACoAKgAqAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAKgAqACoAKgAqACoAKgBcAFwAXAAqACoAKgAqAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAXAAqAEsASwBLAEsASwBLAEsASwBLAEsAKgAqACoAKgAqACoAUABQAFAAUABQAFAAKwBQACsAKwArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQACsAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwAEAAQABAAeAA0AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAEQArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAADQANAA0AUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAA0ADQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoADQANABUAXAANAB4ADQAbAFwAKgArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAB4AHgATABMADQANAA4AHgATABMAHgAEAAQABAAJACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAUABQAFAAUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwAeACsAKwArABMAEwBLAEsASwBLAEsASwBLAEsASwBLAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwBcAFwAXABcAFwAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcACsAKwArACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwAeAB4AXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgArACsABABLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKgAqACoAKgAqACoAKgBcACoAKgAqACoAKgAqACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAUABQAFAAUABQAFAAUAArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4ADQANAA0ADQAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAHgAeAB4AHgBQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwANAA0ADQANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwBQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsABAAEAAQAHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAABABQAFAAUABQAAQABAAEAFAAUAAEAAQABAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAKwBQACsAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAKwArAB4AHgAeAB4AHgAeACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAUABQAFAAKwAeAB4AHgAeAB4AHgAeAA4AHgArAA0ADQANAA0ADQANAA0ACQANAA0ADQAIAAQACwAEAAQADQAJAA0ADQAMAB0AHQAeABcAFwAWABcAFwAXABYAFwAdAB0AHgAeABQAFAAUAA0AAQABAAQABAAEAAQABAAJABoAGgAaABoAGgAaABoAGgAeABcAFwAdABUAFQAeAB4AHgAeAB4AHgAYABYAEQAVABUAFQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgANAB4ADQANAA0ADQAeAA0ADQANAAcAHgAeAB4AHgArAAQABAAEAAQABAAEAAQABAAEAAQAUABQACsAKwBPAFAAUABQAFAAUAAeAB4AHgAWABEATwBQAE8ATwBPAE8AUABQAFAAUABQAB4AHgAeABYAEQArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAGwAbABsAGwAbABsAGwAaABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAaABsAGwAbABsAGgAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgBQABoAHgAdAB4AUAAeABoAHgAeAB4AHgAeAB4AHgAeAB4ATwAeAFAAGwAeAB4AUABQAFAAUABQAB4AHgAeAB0AHQAeAFAAHgBQAB4AUAAeAFAATwBQAFAAHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AUABQAFAAUABPAE8AUABQAFAAUABQAE8AUABQAE8AUABPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAE8ATwBPAE8ATwBPAE8ATwBPAE8AUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAATwAeAB4AKwArACsAKwAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB0AHQAeAB4AHgAdAB0AHgAeAB0AHgAeAB4AHQAeAB0AGwAbAB4AHQAeAB4AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB0AHgAdAB4AHQAdAB0AHQAdAB0AHgAdAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAdAB0AHQAdAB4AHgAdAB0AHgAeAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABQAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAlACUAHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBQAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAeAB4AHgAeAB0AHQAeAB4AHgAeAB0AHQAdAB4AHgAdAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB0AHQAeAB4AHQAeAB4AHgAeAB0AHQAeAB4AHgAeACUAJQAdAB0AJQAeACUAJQAlACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAHgAeAB4AHgAdAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHQAdAB0AHgAdACUAHQAdAB4AHQAdAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHQAdAB0AHQAlAB4AJQAlACUAHQAlACUAHQAdAB0AJQAlAB0AHQAlAB0AHQAlACUAJQAeAB0AHgAeAB4AHgAdAB0AJQAdAB0AHQAdAB0AHQAlACUAJQAlACUAHQAlACUAIAAlAB0AHQAlACUAJQAlACUAJQAlACUAHgAeAB4AJQAlACAAIAAgACAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeABcAFwAXABcAFwAXAB4AEwATACUAHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwArACUAJQBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAKwArACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAE8ATwBPAE8ATwBPAE8ATwAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeACsAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUAArACsAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQBQAFAAUABQACsAKwArACsAUABQAFAAUABQAFAAUABQAA0AUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQACsAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgBQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAABAAEAAQAKwAEAAQAKwArACsAKwArAAQABAAEAAQAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsABAAEAAQAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsADQANAA0ADQANAA0ADQANAB4AKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AUABQAFAAUABQAFAAUABQAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAUABQAFAAUABQAA0ADQANAA0ADQANABQAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwANAA0ADQANAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAeAAQABAAEAB4AKwArAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLACsADQArAB4AKwArAAQABAAEAAQAUABQAB4AUAArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwAEAAQABAAEAAQABAAEAAQABAAOAA0ADQATABMAHgAeAB4ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0AUABQAFAAUAAEAAQAKwArAAQADQANAB4AUAArACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXABcAA0ADQANACoASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUAArACsAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANACsADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEcARwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQACsAKwAeAAQABAANAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAEAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUAArACsAUAArACsAUABQACsAKwBQAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AKwArAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAeAB4ADQANAA0ADQAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAArAAQABAArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAEAAQABAAEAAQABAAEACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAFgAWAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAKwBQACsAKwArACsAKwArAFAAKwArACsAKwBQACsAUAArAFAAKwBQAFAAUAArAFAAUAArAFAAKwArAFAAKwBQACsAUAArAFAAKwBQACsAUABQACsAUAArACsAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAUABQAFAAUAArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUAArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAlACUAJQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeACUAJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeACUAJQAlACUAJQAeACUAJQAlACUAJQAgACAAIAAlACUAIAAlACUAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIQAhACEAIQAhACUAJQAgACAAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACAAIAAlACUAJQAlACAAJQAgACAAIAAgACAAIAAgACAAIAAlACUAJQAgACUAJQAlACUAIAAgACAAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeACUAHgAlAB4AJQAlACUAJQAlACAAJQAlACUAJQAeACUAHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAlACUAJQAlACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAIAAgACAAJQAlACUAIAAgACAAIAAgAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFwAXABcAFQAVABUAHgAeAB4AHgAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACAAJQAlACUAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAlACAAIAAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsA"},function(e,t,i){i.r(t);var r=0,n=1,a=2,s=/^#([a-f0-9]{3})$/i,o=function(e){var t=e.match(s);return!!t&&[parseInt(t[1][0]+t[1][0],16),parseInt(t[1][1]+t[1][1],16),parseInt(t[1][2]+t[1][2],16),null]},l=/^#([a-f0-9]{6})$/i,h=function(e){var t=e.match(l);return!!t&&[parseInt(t[1].substring(0,2),16),parseInt(t[1].substring(2,4),16),parseInt(t[1].substring(4,6),16),null]},c=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/,d=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d?\.?\d+)\s*\)$/,u=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var i=function(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){var t=[],i=!0,r=!1,n=void 0;try{for(var a,s=e[Symbol.iterator]();!(i=(a=s.next()).done)&&(t.push(a.value),4!==t.length);i=!0);}catch(e){r=!0,n=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw n}}return t}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}(Array.isArray(t)?function(e){return[Math.min(e[0],255),Math.min(e[1],255),Math.min(e[2],255),e.length>3?e[3]:null]}(t):o(t)||function(e){var t=e.match(c);return!!t&&[Number(t[1]),Number(t[2]),Number(t[3]),null]}(t)||function(e){var t=e.match(d);return!!(t&&t.length>4)&&[Number(t[1]),Number(t[2]),Number(t[3]),Number(t[4])]}(t)||function(e){return A[e.toLowerCase()]||!1}(t)||h(t)||[0,0,0,null]),r=i[0],n=i[1],a=i[2],s=i[3];this.r=r,this.g=n,this.b=a,this.a=s}return function(e,t){t&&function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t)}(e,[{key:"isTransparent",value:function(){return 0===this.a}},{key:"toString",value:function(){return null!==this.a&&1!==this.a?"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.a,")"):"rgb(".concat(this.r,",").concat(this.g,",").concat(this.b,")")}}]),e}(),A={transparent:[0,0,0,0],aliceblue:[240,248,255,null],antiquewhite:[250,235,215,null],aqua:[0,255,255,null],aquamarine:[127,255,212,null],azure:[240,255,255,null],beige:[245,245,220,null],bisque:[255,228,196,null],black:[0,0,0,null],blanchedalmond:[255,235,205,null],blue:[0,0,255,null],blueviolet:[138,43,226,null],brown:[165,42,42,null],burlywood:[222,184,135,null],cadetblue:[95,158,160,null],chartreuse:[127,255,0,null],chocolate:[210,105,30,null],coral:[255,127,80,null],cornflowerblue:[100,149,237,null],cornsilk:[255,248,220,null],crimson:[220,20,60,null],cyan:[0,255,255,null],darkblue:[0,0,139,null],darkcyan:[0,139,139,null],darkgoldenrod:[184,134,11,null],darkgray:[169,169,169,null],darkgreen:[0,100,0,null],darkgrey:[169,169,169,null],darkkhaki:[189,183,107,null],darkmagenta:[139,0,139,null],darkolivegreen:[85,107,47,null],darkorange:[255,140,0,null],darkorchid:[153,50,204,null],darkred:[139,0,0,null],darksalmon:[233,150,122,null],darkseagreen:[143,188,143,null],darkslateblue:[72,61,139,null],darkslategray:[47,79,79,null],darkslategrey:[47,79,79,null],darkturquoise:[0,206,209,null],darkviolet:[148,0,211,null],deeppink:[255,20,147,null],deepskyblue:[0,191,255,null],dimgray:[105,105,105,null],dimgrey:[105,105,105,null],dodgerblue:[30,144,255,null],firebrick:[178,34,34,null],floralwhite:[255,250,240,null],forestgreen:[34,139,34,null],fuchsia:[255,0,255,null],gainsboro:[220,220,220,null],ghostwhite:[248,248,255,null],gold:[255,215,0,null],goldenrod:[218,165,32,null],gray:[128,128,128,null],green:[0,128,0,null],greenyellow:[173,255,47,null],grey:[128,128,128,null],honeydew:[240,255,240,null],hotpink:[255,105,180,null],indianred:[205,92,92,null],indigo:[75,0,130,null],ivory:[255,255,240,null],khaki:[240,230,140,null],lavender:[230,230,250,null],lavenderblush:[255,240,245,null],lawngreen:[124,252,0,null],lemonchiffon:[255,250,205,null],lightblue:[173,216,230,null],lightcoral:[240,128,128,null],lightcyan:[224,255,255,null],lightgoldenrodyellow:[250,250,210,null],lightgray:[211,211,211,null],lightgreen:[144,238,144,null],lightgrey:[211,211,211,null],lightpink:[255,182,193,null],lightsalmon:[255,160,122,null],lightseagreen:[32,178,170,null],lightskyblue:[135,206,250,null],lightslategray:[119,136,153,null],lightslategrey:[119,136,153,null],lightsteelblue:[176,196,222,null],lightyellow:[255,255,224,null],lime:[0,255,0,null],limegreen:[50,205,50,null],linen:[250,240,230,null],magenta:[255,0,255,null],maroon:[128,0,0,null],mediumaquamarine:[102,205,170,null],mediumblue:[0,0,205,null],mediumorchid:[186,85,211,null],mediumpurple:[147,112,219,null],mediumseagreen:[60,179,113,null],mediumslateblue:[123,104,238,null],mediumspringgreen:[0,250,154,null],mediumturquoise:[72,209,204,null],mediumvioletred:[199,21,133,null],midnightblue:[25,25,112,null],mintcream:[245,255,250,null],mistyrose:[255,228,225,null],moccasin:[255,228,181,null],navajowhite:[255,222,173,null],navy:[0,0,128,null],oldlace:[253,245,230,null],olive:[128,128,0,null],olivedrab:[107,142,35,null],orange:[255,165,0,null],orangered:[255,69,0,null],orchid:[218,112,214,null],palegoldenrod:[238,232,170,null],palegreen:[152,251,152,null],paleturquoise:[175,238,238,null],palevioletred:[219,112,147,null],papayawhip:[255,239,213,null],peachpuff:[255,218,185,null],peru:[205,133,63,null],pink:[255,192,203,null],plum:[221,160,221,null],powderblue:[176,224,230,null],purple:[128,0,128,null],rebeccapurple:[102,51,153,null],red:[255,0,0,null],rosybrown:[188,143,143,null],royalblue:[65,105,225,null],saddlebrown:[139,69,19,null],salmon:[250,128,114,null],sandybrown:[244,164,96,null],seagreen:[46,139,87,null],seashell:[255,245,238,null],sienna:[160,82,45,null],silver:[192,192,192,null],skyblue:[135,206,235,null],slateblue:[106,90,205,null],slategray:[112,128,144,null],slategrey:[112,128,144,null],snow:[255,250,250,null],springgreen:[0,255,127,null],steelblue:[70,130,180,null],tan:[210,180,140,null],teal:[0,128,128,null],thistle:[216,191,216,null],tomato:[255,99,71,null],turquoise:[64,224,208,null],violet:[238,130,238,null],wheat:[245,222,179,null],white:[255,255,255,null],whitesmoke:[245,245,245,null],yellow:[255,255,0,null],yellowgreen:[154,205,50,null]},p=new u([0,0,0,0]),f=function(e){switch(e){case"underline":return 1;case"overline":return 2;case"line-through":return 3}return 4},m=function(e){var t=function(e){return"none"===e?null:e.split(" ").map(f)}(e.textDecorationLine?e.textDecorationLine:e.textDecoration);return null===t?null:{textDecorationLine:t,textDecorationColor:e.textDecorationColor?new u(e.textDecorationColor):null,textDecorationStyle:function(e){switch(e){case"double":return 1;case"dotted":return 2;case"dashed":return 3;case"wavy":return 4}return 0}(e.textDecorationStyle)}},g=function(e,t){var i=Math.max.apply(null,e.colorStops.map(function(e){return e.stop})),r=1/Math.max(1,i);e.colorStops.forEach(function(e){t.addColorStop(Math.floor(Math.max(0,r*e.stop)),e.color.toString())})},w=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.canvas=t||document.createElement("canvas")}return function(e,t){t&&function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t)}(e,[{key:"render",value:function(e){this.ctx=this.canvas.getContext("2d"),this.options=e,this.canvas.width=Math.floor(e.width*e.scale),this.canvas.height=Math.floor(e.height*e.scale),this.canvas.style.width="".concat(e.width,"px"),this.canvas.style.height="".concat(e.height,"px"),this.ctx.scale(this.options.scale,this.options.scale),this.ctx.translate(-e.x,-e.y),this.ctx.textBaseline="bottom",e.logger.log("Canvas renderer initialized (".concat(e.width,"x").concat(e.height," at ").concat(e.x,",").concat(e.y,") with scale ").concat(this.options.scale))}},{key:"clip",value:function(e,t){var i=this;e.length&&(this.ctx.save(),e.forEach(function(e){i.path(e),i.ctx.clip()})),t(),e.length&&this.ctx.restore()}},{key:"drawImage",value:function(e,t,i){this.ctx.drawImage(e,t.left,t.top,t.width,t.height,i.left,i.top,i.width,i.height)}},{key:"drawShape",value:function(e,t){this.path(e),this.ctx.fillStyle=t.toString(),this.ctx.fill()}},{key:"fill",value:function(e){this.ctx.fillStyle=e.toString(),this.ctx.fill()}},{key:"getTarget",value:function(){return this.canvas.getContext("2d").setTransform(1,0,0,1,0,0),Promise.resolve(this.canvas)}},{key:"path",value:function(e){var t=this;this.ctx.beginPath(),Array.isArray(e)?e.forEach(function(e,i){var a=e.type===r?e:e.start;0===i?t.ctx.moveTo(a.x,a.y):t.ctx.lineTo(a.x,a.y),e.type===n&&t.ctx.bezierCurveTo(e.startControl.x,e.startControl.y,e.endControl.x,e.endControl.y,e.end.x,e.end.y)}):this.ctx.arc(e.x+e.radius,e.y+e.radius,e.radius,0,2*Math.PI,!0),this.ctx.closePath()}},{key:"rectangle",value:function(e,t,i,r,n){this.ctx.fillStyle=n.toString(),this.ctx.fillRect(e,t,i,r)}},{key:"renderLinearGradient",value:function(e,t){var i=this.ctx.createLinearGradient(e.left+t.direction.x1,e.top+t.direction.y1,e.left+t.direction.x0,e.top+t.direction.y0);g(t,i),this.ctx.fillStyle=i,this.ctx.fillRect(e.left,e.top,e.width,e.height)}},{key:"renderRadialGradient",value:function(e,t){var i=this,r=e.left+t.center.x,n=e.top+t.center.y,a=this.ctx.createRadialGradient(r,n,0,r,n,t.radius.x);if(a)if(g(t,a),this.ctx.fillStyle=a,t.radius.x!==t.radius.y){var s=e.left+.5*e.width,o=e.top+.5*e.height,l=t.radius.y/t.radius.x,h=1/l;this.transform(s,o,[1,0,0,l,0,0],function(){return i.ctx.fillRect(e.left,h*(e.top-o)+o,e.width,e.height*h)})}else this.ctx.fillRect(e.left,e.top,e.width,e.height)}},{key:"renderRepeat",value:function(e,t,i,r,n){this.path(e),this.ctx.fillStyle=this.ctx.createPattern(this.resizeImage(t,i),"repeat"),this.ctx.translate(r,n),this.ctx.fill(),this.ctx.translate(-r,-n)}},{key:"renderTextNode",value:function(e,t,i,r,n){var a=this;this.ctx.font=[i.fontStyle,i.fontVariant,i.fontWeight,i.fontSize,i.fontFamily].join(" "),e.forEach(function(e){if(a.ctx.fillStyle=t.toString(),n&&e.text.trim().length?(n.slice(0).reverse().forEach(function(t){a.ctx.shadowColor=t.color.toString(),a.ctx.shadowOffsetX=t.offsetX*a.options.scale,a.ctx.shadowOffsetY=t.offsetY*a.options.scale,a.ctx.shadowBlur=t.blur,a.ctx.fillText(e.text,e.bounds.left,e.bounds.top+e.bounds.height)}),a.ctx.shadowColor="",a.ctx.shadowOffsetX=0,a.ctx.shadowOffsetY=0,a.ctx.shadowBlur=0):a.ctx.fillText(e.text,e.bounds.left,e.bounds.top+e.bounds.height),null!==r){var s=r.textDecorationColor||t;r.textDecorationLine.forEach(function(t){switch(t){case 1:var r=a.options.fontMetrics.getMetrics(i).baseline;a.rectangle(e.bounds.left,Math.round(e.bounds.top+r),e.bounds.width,1,s);break;case 2:a.rectangle(e.bounds.left,Math.round(e.bounds.top),e.bounds.width,1,s);break;case 3:var n=a.options.fontMetrics.getMetrics(i).middle;a.rectangle(e.bounds.left,Math.ceil(e.bounds.top+n),e.bounds.width,1,s)}})}})}},{key:"resizeImage",value:function(e,t){if(e.width===t.width&&e.height===t.height)return e;var i=this.canvas.ownerDocument.createElement("canvas");return i.width=t.width,i.height=t.height,i.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t.width,t.height),i}},{key:"setOpacity",value:function(e){this.ctx.globalAlpha=e}},{key:"transform",value:function(e,t,i,r){this.ctx.save(),this.ctx.translate(e,t),this.ctx.transform(i[0],i[1],i[2],i[3],i[4],i[5]),this.ctx.translate(-e,-t),r(),this.ctx.restore()}}]),e}(),b=function(){function e(t,i,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.enabled="undefined"!=typeof window&&t,this.start=r||Date.now(),this.id=i}return function(e,t){t&&function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t)}(e,[{key:"child",value:function(t){return new e(this.enabled,t,this.start)}},{key:"log",value:function(){}},{key:"error",value:function(){if(this.enabled&&window.console&&window.console.error){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];Function.prototype.bind.call(window.console.error,window.console).apply(window.console,[Date.now()-this.start+"ms",this.id?"html2canvas (".concat(this.id,"):"):"html2canvas:"].concat([].slice.call(t,0)))}}}]),e}(),v=function(e,t){return 0!=(e&t)},y=function(e,t){return Math.sqrt(e*e+t*t)},B=function(e,t){for(var i=e.length-1;i>=0;i--){var r=e.item(i);"content"!==r&&t.style.setProperty(r,e.getPropertyValue(r))}return t};function C(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var x=0,F=1,S=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.type="%"===t.substr(t.length-1)?F:x;var i=parseFloat(t);this.value=isNaN(i)?0:i}return function(e,t,i){t&&C(e.prototype,t),i&&C(e,i)}(e,[{key:"isPercentage",value:function(){return this.type===F}},{key:"getAbsoluteValue",value:function(e){return this.isPercentage()?e*(this.value/100):this.value}}],[{key:"create",value:function(t){return new e(t)}}]),e}(),N=function(e,t,i){switch(i){case"px":case"%":return new S(t+i);case"em":case"rem":var r=new S(t);return r.value*="em"===i?parseFloat(e.style.font.fontSize):function e(t){var i=t.parent;return i?e(i):parseFloat(t.style.font.fontSize)}(e),r;default:return new S("0")}},E=function e(t,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.width=t,this.height=i},k=function e(t,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.type=r,this.x=t,this.y=i},T=function(e,t,i){return new k(e.x+(t.x-e.x)*i,e.y+(t.y-e.y)*i)},L=function(){function e(t,i,r,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.type=n,this.start=t,this.startControl=i,this.endControl=r,this.end=a}return function(e,t){t&&function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t)}(e,[{key:"subdivide",value:function(t,i){var r=T(this.start,this.startControl,t),n=T(this.startControl,this.endControl,t),a=T(this.endControl,this.end,t),s=T(r,n,t),o=T(n,a,t),l=T(s,o,t);return i?new e(this.start,r,s,l):new e(l,o,a,this.end)}},{key:"reverse",value:function(){return new e(this.end,this.endControl,this.startControl,this.start)}}]),e}(),I=function(){function e(t,i,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.left=t,this.top=i,this.width=r,this.height=n}return function(e,t,i){i&&function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e,i)}(e,0,[{key:"fromClientRect",value:function(t,i,r){return new e(t.left+i,t.top+r,t.width,t.height)}}]),e}(),D=function(e,t,i){return I.fromClientRect(e.getBoundingClientRect(),t,i)},U=function(e){var t=e.body,i=e.documentElement;if(!t||!i)throw new Error("");var r=Math.max(Math.max(t.scrollWidth,i.scrollWidth),Math.max(t.offsetWidth,i.offsetWidth),Math.max(t.clientWidth,i.clientWidth)),n=Math.max(Math.max(t.scrollHeight,i.scrollHeight),Math.max(t.offsetHeight,i.offsetHeight),Math.max(t.clientHeight,i.clientHeight));return new I(0,0,r,n)},P=function(e,t,i,r){var n=[];return e instanceof L?n.push(e.subdivide(.5,!1)):n.push(e),i instanceof L?n.push(i.subdivide(.5,!0)):n.push(i),r instanceof L?n.push(r.subdivide(.5,!0).reverse()):n.push(r),t instanceof L?n.push(t.subdivide(.5,!1).reverse()):n.push(t),n},R=function(e){return[e.topLeftInner,e.topRightInner,e.bottomRightInner,e.bottomLeftInner]},O=function(e,t,i){var r=i[Q.TOP_LEFT][0].getAbsoluteValue(e.width),n=i[Q.TOP_LEFT][1].getAbsoluteValue(e.height),a=i[Q.TOP_RIGHT][0].getAbsoluteValue(e.width),s=i[Q.TOP_RIGHT][1].getAbsoluteValue(e.height),o=i[Q.BOTTOM_RIGHT][0].getAbsoluteValue(e.width),l=i[Q.BOTTOM_RIGHT][1].getAbsoluteValue(e.height),h=i[Q.BOTTOM_LEFT][0].getAbsoluteValue(e.width),c=i[Q.BOTTOM_LEFT][1].getAbsoluteValue(e.height),d=[];d.push((r+a)/e.width),d.push((h+o)/e.width),d.push((n+c)/e.height),d.push((s+l)/e.height);var u=Math.max.apply(Math,d);u>1&&(r/=u,n/=u,a/=u,s/=u,o/=u,l/=u,h/=u,c/=u);var A=e.width-a,p=e.height-l,f=e.width-o,m=e.height-c;return{topLeftOuter:r>0||n>0?H(e.left,e.top,r,n,Q.TOP_LEFT):new k(e.left,e.top),topLeftInner:r>0||n>0?H(e.left+t[3].borderWidth,e.top+t[0].borderWidth,Math.max(0,r-t[3].borderWidth),Math.max(0,n-t[0].borderWidth),Q.TOP_LEFT):new k(e.left+t[3].borderWidth,e.top+t[0].borderWidth),topRightOuter:a>0||s>0?H(e.left+A,e.top,a,s,Q.TOP_RIGHT):new k(e.left+e.width,e.top),topRightInner:a>0||s>0?H(e.left+Math.min(A,e.width+t[3].borderWidth),e.top+t[0].borderWidth,A>e.width+t[3].borderWidth?0:a-t[3].borderWidth,s-t[0].borderWidth,Q.TOP_RIGHT):new k(e.left+e.width-t[1].borderWidth,e.top+t[0].borderWidth),bottomRightOuter:o>0||l>0?H(e.left+f,e.top+p,o,l,Q.BOTTOM_RIGHT):new k(e.left+e.width,e.top+e.height),bottomRightInner:o>0||l>0?H(e.left+Math.min(f,e.width-t[3].borderWidth),e.top+Math.min(p,e.height+t[0].borderWidth),Math.max(0,o-t[1].borderWidth),l-t[2].borderWidth,Q.BOTTOM_RIGHT):new k(e.left+e.width-t[1].borderWidth,e.top+e.height-t[2].borderWidth),bottomLeftOuter:h>0||c>0?H(e.left,e.top+m,h,c,Q.BOTTOM_LEFT):new k(e.left,e.top+e.height),bottomLeftInner:h>0||c>0?H(e.left+t[3].borderWidth,e.top+m,Math.max(0,h-t[3].borderWidth),c-t[2].borderWidth,Q.BOTTOM_LEFT):new k(e.left+t[3].borderWidth,e.top+e.height-t[2].borderWidth)}},Q={TOP_LEFT:0,TOP_RIGHT:1,BOTTOM_RIGHT:2,BOTTOM_LEFT:3},H=function(e,t,i,r,n){var a=(Math.sqrt(2)-1)/3*4,s=i*a,o=r*a,l=e+i,h=t+r;switch(n){case Q.TOP_LEFT:return new L(new k(e,h),new k(e,h-o),new k(l-s,t),new k(l,t));case Q.TOP_RIGHT:return new L(new k(e,t),new k(e+s,t),new k(l,h-o),new k(l,h));case Q.BOTTOM_RIGHT:return new L(new k(l,t),new k(l,t+o),new k(e+s,h),new k(e,h));case Q.BOTTOM_LEFT:default:return new L(new k(l,h),new k(l-s,h),new k(e,t+o),new k(e,t))}},M=["top","right","bottom","left"],_=function(e){return M.map(function(t){return new S(e.getPropertyValue("padding-".concat(t)))})},j={BORDER_BOX:0,PADDING_BOX:1,CONTENT_BOX:2},z=j,V=function e(t){switch(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t){case"contain":this.size=1;break;case"cover":this.size=2;break;case"auto":this.size=0;break;default:this.value=new S(t)}},K=new V("auto"),q=function(e,t,i,r){var n=function(e,t){return new I(e.left+t[3].borderWidth,e.top+t[0].borderWidth,e.width-(t[1].borderWidth+t[3].borderWidth),e.height-(t[0].borderWidth+t[2].borderWidth))}(t,r);switch(e){case z.BORDER_BOX:return t;case z.CONTENT_BOX:var a=i[3].getAbsoluteValue(t.width),s=i[1].getAbsoluteValue(t.width),o=i[0].getAbsoluteValue(t.width),l=i[2].getAbsoluteValue(t.width);return new I(n.left+a,n.top+o,n.width-a-s,n.height-o-l);default:return n}},G=function(e,t,i){return new k(e[0].getAbsoluteValue(i.width-t.width),e[1].getAbsoluteValue(i.height-t.height))},W=function(e,t){return{backgroundColor:new u(e.backgroundColor),backgroundImage:Y(e,t),backgroundClip:J(e.backgroundClip),backgroundOrigin:X(e.backgroundOrigin)}},J=function(e){switch(e){case"padding-box":return j.PADDING_BOX;case"content-box":return j.CONTENT_BOX}return j.BORDER_BOX},X=function(e){switch(e){case"padding-box":return z.PADDING_BOX;case"content-box":return z.CONTENT_BOX}return z.BORDER_BOX},Y=function(e,t){var i=ee(e.backgroundImage).map(function(e){if("url"===e.method){var i=t.loadImage(e.args[0]);e.args=i?[i]:[]}return e}),r=e.backgroundPosition.split(","),n=e.backgroundRepeat.split(","),a=e.backgroundSize.split(",");return i.map(function(e,t){var i=(a[t]||"auto").trim().split(" ").map($),s=(r[t]||"auto").trim().split(" ").map(Z);return{source:e,repeat:function(){switch(("string"==typeof n[t]?n[t]:n[0]).trim()){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;case"repeat":return 0}return 0}(),size:i.length<2?[i[0],K]:[i[0],i[1]],position:s.length<2?[s[0],s[0]]:[s[0],s[1]]}})},$=function(e){return"auto"===e?K:new V(e)},Z=function(e){switch(e){case"bottom":case"right":return new S("100%");case"left":case"top":return new S("0%");case"auto":return new S("0")}return new S(e)},ee=function(e){var t=/^\s$/,i=[],r=[],n="",a=null,s="",o=0,l=0,h=function(){var e="";if(n){'"'===s.substr(0,1)&&(s=s.substr(1,s.length-2)),s&&r.push(s.trim());var t=n.indexOf("-",1)+1;"-"===n.substr(0,1)&&t>0&&(e=n.substr(0,t).toLowerCase(),n=n.substr(t)),"none"!==(n=n.toLowerCase())&&i.push({prefix:e,method:n,args:r})}r=[],n=s=""};return e.split("").forEach(function(e){if(0!==o||!t.test(e)){switch(e){case'"':a?a===e&&(a=null):a=e;break;case"(":if(a)break;if(0===o)return void(o=1);l++;break;case")":if(a)break;if(1===o){if(0===l)return o=0,void h();l--}break;case",":if(a)break;if(0===o)return void h();if(1===o&&0===l&&!n.match(/^url$/i))return r.push(s.trim()),void(s="")}0===o?n+=e:s+=e}}),h(),i},te=Object.keys({TOP:0,RIGHT:1,BOTTOM:2,LEFT:3}).map(function(e){return e.toLowerCase()}),ie=function(e){return te.map(function(t){var i=new u(e.getPropertyValue("border-".concat(t,"-color"))),r=function(e){return"none"===e?0:1}(e.getPropertyValue("border-".concat(t,"-style"))),n=parseFloat(e.getPropertyValue("border-".concat(t,"-width")));return{borderColor:i,borderStyle:r,borderWidth:isNaN(n)?0:n}})},re=["top-left","top-right","bottom-right","bottom-left"],ne=function(e){return re.map(function(t){var i=function(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){var t=[],i=!0,r=!1,n=void 0;try{for(var a,s=e[Symbol.iterator]();!(i=(a=s.next()).done)&&(t.push(a.value),2!==t.length);i=!0);}catch(e){r=!0,n=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw n}}return t}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}(e.getPropertyValue("border-".concat(t,"-radius")).split(" ").map(S.create)),r=i[0],n=i[1];return void 0===n?[r,r]:[r,n]})},ae=1,se=2,oe=4,le=8,he=16,ce=32,de=64,ue=128,Ae=256,pe=512,fe=1024,me=2048,ge=4096,we=8192,be=16384,ve=32768,ye=65536,Be=1<<17,Ce=1<<18,xe=1<<19,Fe=1<<20,Se=1<<21,Ne=1<<22,Ee=1<<23,ke=1<<24,Te=1<<25,Le=1<<26,Ie=1<<27,De=1<<28,Ue=1<<29,Pe=function(e,t){return e|function(){switch(t){case"block":return se;case"inline":return oe;case"run-in":return le;case"flow":return he;case"flow-root":return ce;case"table":return de;case"flex":return ue;case"grid":return Ae;case"ruby":return pe;case"subgrid":return fe;case"list-item":return me;case"table-row-group":return ge;case"table-header-group":return we;case"table-footer-group":return be;case"table-row":return ve;case"table-cell":return ye;case"table-column-group":return Be;case"table-column":return Ce;case"table-caption":return xe;case"ruby-base":return Fe;case"ruby-text":return Se;case"ruby-base-container":return Ne;case"ruby-text-container":return Ee;case"contents":return ke;case"inline-block":return Te;case"inline-list-item":return Le;case"inline-table":return Ie;case"inline-flex":return De;case"inline-grid":return Ue}return ae}()},Re=function(e){switch(e){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0},Oe=function(e){return{fontFamily:e.fontFamily,fontSize:e.fontSize,fontStyle:e.fontStyle,fontVariant:e.fontVariant,fontWeight:function(e){switch(e){case"normal":return 400;case"bold":return 700}var t=parseInt(e,10);return isNaN(t)?400:t}(e.fontWeight)}},Qe=function(e){if("normal"===e)return 0;var t=parseFloat(e);return isNaN(t)?0:t},He=function(e){return"strict"===e?"strict":"normal"},Me=function(e){switch(e){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":case"hebrew":return 22;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;default:return-1}},_e=function(e){var t=ee(e.getPropertyValue("list-style-image"));return{listStyleType:Me(e.getPropertyValue("list-style-type")),listStyleImage:t.length?t[0]:null,listStylePosition:je(e.getPropertyValue("list-style-position"))}},je=function(e){return"inside"===e?0:1},ze=["top","right","bottom","left"],Ve=function(e){return ze.map(function(t){return new S(e.getPropertyValue("margin-".concat(t)))})},Ke=0,qe=1,Ge=2,We=3,Je=function(e){switch(e){case"hidden":return qe;case"scroll":return Ge;case"auto":return We;default:return Ke}},Xe=function(e){return"break-word"===e?1:0},Ye=0,$e=1,Ze=2,et=3,tt=4,it=/^([+-]|\d|\.)$/i,rt=function(e){if("none"===e||"string"!=typeof e)return null;for(var t="",i=!1,r=[],n=[],a=0,s=null,o=function(){t.length&&(i?r.push(parseFloat(t)):s=new u(t)),i=!1,t=""},l=function(){r.length&&null!==s&&n.push({color:s,offsetX:r[0]||0,offsetY:r[1]||0,blur:r[2]||0}),r.splice(0,r.length),s=null},h=0;h<e.length;h++){var c=e[h];switch(c){case"(":t+=c,a++;break;case")":t+=c,a--;break;case",":0===a?(o(),l()):t+=c;break;case" ":0===a?o():t+=c;break;default:0===t.length&&it.test(c)&&(i=!0),t+=c}}return o(),l(),0===n.length?null:n},nt=function(e){switch(e){case"uppercase":return 2;case"lowercase":return 1;case"capitalize":return 3}return 0},at=function(e){return parseFloat(e.trim())},st=/(matrix|matrix3d)\((.+)\)/,ot=function(e){var t=ht(e.transform||e.webkitTransform||e.mozTransform||e.msTransform||e.oTransform);return null===t?null:{transform:t,transformOrigin:lt(e.transformOrigin||e.webkitTransformOrigin||e.mozTransformOrigin||e.msTransformOrigin||e.oTransformOrigin)}},lt=function(e){if("string"!=typeof e){var t=new S("0");return[t,t]}var i=e.split(" ").map(S.create);return[i[0],i[1]]},ht=function(e){if("none"===e||"string"!=typeof e)return null;var t=e.match(st);if(t){if("matrix"===t[1]){var i=t[2].split(",").map(at);return[i[0],i[1],i[2],i[3],i[4],i[5]]}var r=t[2].split(",").map(at);return[r[0],r[1],r[4],r[5],r[12],r[13]]}return null},ct=function(e){switch(e){case"hidden":return 1;case"collapse":return 2;default:return 0}},dt=function(e){switch(e){case"break-all":return"break-all";case"keep-all":return"keep-all";default:return"normal"}},ut=function(e){var t="auto"===e;return{auto:t,order:t?0:parseInt(e,10)}},At=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.element=t}return function(e,t){t&&function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t)}(e,[{key:"render",value:function(e){var t=this;this.options=e,this.canvas=document.createElement("canvas"),this.ctx=this.canvas.getContext("2d"),this.canvas.width=Math.floor(e.width)*e.scale,this.canvas.height=Math.floor(e.height)*e.scale,this.canvas.style.width="".concat(e.width,"px"),this.canvas.style.height="".concat(e.height,"px"),this.ctx.scale(e.scale,e.scale),e.logger.log("ForeignObject renderer initialized (".concat(e.width,"x").concat(e.height," at ").concat(e.x,",").concat(e.y,") with scale ").concat(e.scale));var i=pt(Math.max(e.windowWidth,e.width)*e.scale,Math.max(e.windowHeight,e.height)*e.scale,e.scrollX*e.scale,e.scrollY*e.scale,this.element);return ft(i).then(function(i){return e.backgroundColor&&(t.ctx.fillStyle=e.backgroundColor.toString(),t.ctx.fillRect(0,0,e.width*e.scale,e.height*e.scale)),t.ctx.drawImage(i,-e.x*e.scale,-e.y*e.scale),t.canvas})}}]),e}(),pt=function(e,t,i,r,n){var a="http://www.w3.org/2000/svg",s=document.createElementNS(a,"svg"),o=document.createElementNS(a,"foreignObject");return s.setAttributeNS(null,"width",e),s.setAttributeNS(null,"height",t),o.setAttributeNS(null,"width","100%"),o.setAttributeNS(null,"height","100%"),o.setAttributeNS(null,"x",i),o.setAttributeNS(null,"y",r),o.setAttributeNS(null,"externalResourcesRequired","true"),s.appendChild(o),o.appendChild(n),s},ft=function(e){return new Promise(function(t,i){var r=new Image;r.onload=function(){return t(r)},r.onerror=i,r.src="data:image/svg+xml;charset=utf-8,".concat(encodeURIComponent((new XMLSerializer).serializeToString(e)))})},mt=function(e){return 0===e[0]&&255===e[1]&&0===e[2]&&255===e[3]},gt={get SUPPORT_RANGE_BOUNDS(){var e=function(e){if(e.createRange){var t=e.createRange();if(t.getBoundingClientRect){var i=e.createElement("boundtest");i.style.height="".concat(123,"px"),i.style.display="block",e.body.appendChild(i),t.selectNode(i);var r=t.getBoundingClientRect(),n=Math.round(r.height);if(e.body.removeChild(i),123===n)return!0}}return!1}(document);return Object.defineProperty(gt,"SUPPORT_RANGE_BOUNDS",{value:e}),e},get SUPPORT_SVG_DRAWING(){var e=function(e){var t=new Image,i=e.createElement("canvas"),r=i.getContext("2d");t.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{r.drawImage(t,0,0),i.toDataURL()}catch(e){return!1}return!0}(document);return Object.defineProperty(gt,"SUPPORT_SVG_DRAWING",{value:e}),e},get SUPPORT_FOREIGNOBJECT_DRAWING(){var e="function"==typeof Array.from&&"function"==typeof window.fetch?function(e){var t=e.createElement("canvas");t.width=100,t.height=100;var i=t.getContext("2d");i.fillStyle="rgb(0, 255, 0)",i.fillRect(0,0,100,100);var r=new Image,n=t.toDataURL();r.src=n;var a=pt(100,100,0,0,r);return i.fillStyle="red",i.fillRect(0,0,100,100),ft(a).then(function(t){i.drawImage(t,0,0);var r=i.getImageData(0,0,100,100).data;i.fillStyle="red",i.fillRect(0,0,100,100);var a=e.createElement("div");return a.style.backgroundImage="url(".concat(n,")"),a.style.height="".concat(100,"px"),mt(r)?ft(pt(100,100,0,0,a)):Promise.reject(!1)}).then(function(e){return i.drawImage(e,0,0),mt(i.getImageData(0,0,100,100).data)}).catch(function(e){return!1})}(document):Promise.resolve(!1);return Object.defineProperty(gt,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:e}),e},get SUPPORT_CORS_IMAGES(){var e=void 0!==(new Image).crossOrigin;return Object.defineProperty(gt,"SUPPORT_CORS_IMAGES",{value:e}),e},get SUPPORT_RESPONSE_TYPE(){var e="string"==typeof(new XMLHttpRequest).responseType;return Object.defineProperty(gt,"SUPPORT_RESPONSE_TYPE",{value:e}),e},get SUPPORT_CORS_XHR(){var e="withCredentials"in new XMLHttpRequest;return Object.defineProperty(gt,"SUPPORT_CORS_XHR",{value:e}),e}},wt=gt,bt=i(0),vt=function e(t,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.text=t,this.bounds=i},yt=function(e,t,i){var r=e.ownerDocument.createElement("html2canvaswrapper");r.appendChild(e.cloneNode(!0));var n=e.parentNode;if(n){n.replaceChild(r,e);var a=D(r,t,i);return r.firstChild&&n.replaceChild(r.firstChild,r),a}return new I(0,0,0,0)},Bt=function(e,t,i,r,n){var a=e.ownerDocument.createRange();return a.setStart(e,t),a.setEnd(e,t+i),I.fromClientRect(a.getBoundingClientRect(),r,n)},Ct=function(){function e(t,i,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.text=t,this.parent=i,this.bounds=r}return function(e,t,i){i&&function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e,i)}(e,0,[{key:"fromTextNode",value:function(t,i){var r=Ft(t.data,i.style.textTransform);return new e(r,i,function(e,t,i){for(var r=0!==t.style.letterSpacing?Object(bt.toCodePoints)(e).map(function(e){return Object(bt.fromCodePoint)(e)}):function(e,t){for(var i,r=Object(bt.LineBreaker)(e,{lineBreak:t.style.lineBreak,wordBreak:1===t.style.overflowWrap?"break-word":t.style.wordBreak}),n=[];!(i=r.next()).done;)n.push(i.value.slice());return n}(e,t),n=r.length,a=i.parentNode?i.parentNode.ownerDocument.defaultView:null,s=a?a.pageXOffset:0,o=a?a.pageYOffset:0,l=[],h=0,c=0;c<n;c++){var d=r[c];if(null!==t.style.textDecoration||d.trim().length>0)if(wt.SUPPORT_RANGE_BOUNDS)l.push(new vt(d,Bt(i,h,d.length,s,o)));else{var u=i.splitText(d.length);l.push(new vt(d,yt(i,s,o))),i=u}else wt.SUPPORT_RANGE_BOUNDS||(i=i.splitText(d.length));h+=d.length}return l}(r,i,t))}}]),e}(),xt=/(^|\s|:|-|\(|\))([a-z])/g,Ft=function(e,t){switch(t){case 1:return e.toLowerCase();case 3:return e.replace(xt,St);case 2:return e.toUpperCase();default:return e}};function St(e,t,i){return e.length>0?t+i.toUpperCase():e}var Nt=function e(t,i,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.type=a,this.x=t,this.y=i,this.radius=r},Et=new u([42,42,42]),kt=new u([165,165,165]),Tt=new u([222,222,222]),Lt={borderWidth:1,borderColor:kt,borderStyle:1},It=[Lt,Lt,Lt,Lt],Dt={backgroundColor:Tt,backgroundImage:[],backgroundClip:j.PADDING_BOX,backgroundOrigin:z.PADDING_BOX},Ut=new S("50%"),Pt=[Ut,Ut],Rt=[Pt,Pt,Pt,Pt],Ot=new S("3px"),Qt=[Ot,Ot],Ht=[Qt,Qt,Qt,Qt],Mt=function(e){return"radio"===e.type?Rt:Ht},_t=function(e,t){if("radio"===e.type||"checkbox"===e.type){if(e.checked){var i=Math.min(t.bounds.width,t.bounds.height);t.childNodes.push("checkbox"===e.type?[new k(t.bounds.left+.39363*i,t.bounds.top+.79*i),new k(t.bounds.left+.16*i,t.bounds.top+.5549*i),new k(t.bounds.left+.27347*i,t.bounds.top+.44071*i),new k(t.bounds.left+.39694*i,t.bounds.top+.5649*i),new k(t.bounds.left+.72983*i,t.bounds.top+.23*i),new k(t.bounds.left+.84*i,t.bounds.top+.34085*i),new k(t.bounds.left+.39363*i,t.bounds.top+.79*i)]:new Nt(t.bounds.left+i/4,t.bounds.top+i/4,i/4))}}else Vt(Kt(e),e,t,!1)},jt=function(e,t){Vt(e.value,e,t,!0)},zt=function(e,t){var i=e.options[e.selectedIndex||0];Vt(i&&i.text||"",e,t,!1)},Vt=function(e,t,i,r){var n=t.ownerDocument.body;if(e.length>0&&n){var a=t.ownerDocument.createElement("html2canvaswrapper");B(t.ownerDocument.defaultView.getComputedStyle(t,null),a),a.style.position="absolute",a.style.left="".concat(i.bounds.left,"px"),a.style.top="".concat(i.bounds.top,"px"),r||(a.style.whiteSpace="nowrap");var s=t.ownerDocument.createTextNode(e);a.appendChild(s),n.appendChild(a),i.childNodes.push(Ct.fromTextNode(s,i)),n.removeChild(a)}},Kt=function(e){var t="password"===e.type?new Array(e.value.length+1).join("•"):e.value;return 0===t.length?e.placeholder||"":t},qt=["OL","UL","MENU"],Gt=function(e,t,i){var r=t.style.listStyle;if(r){var n,a=e.ownerDocument.defaultView.getComputedStyle(e,null),s=e.ownerDocument.createElement("html2canvaswrapper");switch(B(a,s),s.style.position="absolute",s.style.bottom="auto",s.style.display="block",s.style.letterSpacing="normal",r.listStylePosition){case 1:s.style.left="auto",s.style.right="".concat(e.ownerDocument.defaultView.innerWidth-t.bounds.left-t.style.margin[1].getAbsoluteValue(t.bounds.width)+7,"px"),s.style.textAlign="right";break;case 0:s.style.left="".concat(t.bounds.left-t.style.margin[3].getAbsoluteValue(t.bounds.width),"px"),s.style.right="auto",s.style.textAlign="left"}var o=t.style.margin[0].getAbsoluteValue(t.bounds.width),l=r.listStyleImage;if(l)if("url"===l.method){var h=e.ownerDocument.createElement("img");h.src=l.args[0],s.style.top="".concat(t.bounds.top-o,"px"),s.style.width="auto",s.style.height="auto",s.appendChild(h)}else{var c=.5*parseFloat(t.style.font.fontSize);s.style.top="".concat(t.bounds.top-o+t.bounds.height-1.5*c,"px"),s.style.width="".concat(c,"px"),s.style.height="".concat(c,"px"),s.style.backgroundImage=a.listStyleImage}else"number"==typeof t.listIndex&&(n=e.ownerDocument.createTextNode(ri(t.listIndex,r.listStyleType,!0)),s.appendChild(n),s.style.top="".concat(t.bounds.top-o,"px"));var d=e.ownerDocument.body;d.appendChild(s),n?(t.childNodes.push(Ct.fromTextNode(n,t)),d.removeChild(s)):t.childNodes.push(new ai(s,t,i,0))}},Wt={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},Jt={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},Xt={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},Yt={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},$t=function(e,t,i,r,n,a){return e<t||e>i?ri(e,n,a.length>0):r.integers.reduce(function(t,i,n){for(;e>=i;)e-=i,t+=r.values[n];return t},"")+a},Zt=function(e,t,i,r){var n="";do{i||e--,n=r(e)+n,e/=t}while(e*t>=t);return n},ei=function(e,t,i,r,n){var a=i-t+1;return(e<0?"-":"")+(Zt(Math.abs(e),a,r,function(e){return Object(bt.fromCodePoint)(Math.floor(e%a)+t)})+n)},ti=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:". ",r=t.length;return Zt(Math.abs(e),r,!1,function(e){return t[Math.floor(e%r)]})+i},ii=function(e,t,i,r,n,a){if(e<-9999||e>9999)return ri(e,4,n.length>0);var s=Math.abs(e),o=n;if(0===s)return t[0]+o;for(var l=0;s>0&&l<=4;l++){var h=s%10;0===h&&v(a,1)&&""!==o?o=t[h]+o:h>1||1===h&&0===l||1===h&&1===l&&v(a,2)||1===h&&1===l&&v(a,4)&&e>100||1===h&&l>1&&v(a,8)?o=t[h]+(l>0?i[l-1]:"")+o:1===h&&l>0&&(o=i[l-1]+o),s=Math.floor(s/10)}return(e<0?r:"")+o},ri=function(e,t,i){var r=i?". ":"",n=i?"、":"",a=i?", ":"";switch(t){case 0:return"•";case 1:return"◦";case 2:return"◾";case 5:var s=ei(e,48,57,!0,r);return s.length<4?"0".concat(s):s;case 4:return ti(e,"〇一二三四五六七八九",n);case 6:return $t(e,1,3999,Wt,3,r).toLowerCase();case 7:return $t(e,1,3999,Wt,3,r);case 8:return ei(e,945,969,!1,r);case 9:return ei(e,97,122,!1,r);case 10:return ei(e,65,90,!1,r);case 11:return ei(e,1632,1641,!0,r);case 12:case 49:return $t(e,1,9999,Jt,3,r);case 35:return $t(e,1,9999,Jt,3,r).toLowerCase();case 13:return ei(e,2534,2543,!0,r);case 14:case 30:return ei(e,6112,6121,!0,r);case 15:return ti(e,"子丑寅卯辰巳午未申酉戌亥",n);case 16:return ti(e,"甲乙丙丁戊己庚辛壬癸",n);case 17:case 48:return ii(e,"零一二三四五六七八九","十百千萬","負",n,14);case 47:return ii(e,"零壹貳參肆伍陸柒捌玖","拾佰仟萬","負",n,15);case 42:return ii(e,"零一二三四五六七八九","十百千萬","负",n,14);case 41:return ii(e,"零壹贰叁肆伍陆柒捌玖","拾佰仟萬","负",n,15);case 26:return ii(e,"〇一二三四五六七八九","十百千万","マイナス",n,0);case 25:return ii(e,"零壱弐参四伍六七八九","拾百千万","マイナス",n,7);case 31:return ii(e,"영일이삼사오육칠팔구","십백천만","마이너스",a,7);case 33:return ii(e,"零一二三四五六七八九","十百千萬","마이너스",a,0);case 32:return ii(e,"零壹貳參四五六七八九","拾百千","마이너스",a,7);case 18:return ei(e,2406,2415,!0,r);case 20:return $t(e,1,19999,Yt,3,r);case 21:return ei(e,2790,2799,!0,r);case 22:return ei(e,2662,2671,!0,r);case 22:return $t(e,1,10999,Xt,3,r);case 23:return ti(e,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return ti(e,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return ei(e,3302,3311,!0,r);case 28:return ti(e,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",n);case 29:return ti(e,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",n);case 34:return ei(e,3792,3801,!0,r);case 37:return ei(e,6160,6169,!0,r);case 38:return ei(e,4160,4169,!0,r);case 39:return ei(e,2918,2927,!0,r);case 40:return ei(e,1776,1785,!0,r);case 43:return ei(e,3046,3055,!0,r);case 44:return ei(e,3174,3183,!0,r);case 45:return ei(e,3664,3673,!0,r);case 46:return ei(e,3872,3881,!0,r);default:return ei(e,48,57,!0,r)}},ni=["INPUT","TEXTAREA","SELECT"],ai=function(){function e(t,i,r,n){var a=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.parent=i,this.tagName=t.tagName,this.index=n,this.childNodes=[],this.listItems=[],"number"==typeof t.start&&(this.listStart=t.start);var s=t.ownerDocument.defaultView,o=s.pageXOffset,l=s.pageYOffset,h=s.getComputedStyle(t,null),c=function(e){return e.split(" ").reduce(Pe,0)}(h.display),d="radio"===t.type||"checkbox"===t.type,A=function(e){switch(e){case"relative":return $e;case"absolute":return Ze;case"fixed":return et;case"sticky":return tt}return Ye}(h.position);if(this.style={background:d?Dt:W(h,r),border:d?It:ie(h),borderRadius:(t instanceof s.HTMLInputElement||t instanceof HTMLInputElement)&&d?Mt(t):ne(h),color:d?Et:new u(h.color),display:c,float:Re(h.float),font:Oe(h),letterSpacing:Qe(h.letterSpacing),listStyle:c===me?_e(h):null,lineBreak:He(h.lineBreak),margin:Ve(h),opacity:parseFloat(h.opacity),overflow:-1===ni.indexOf(t.tagName)?Je(h.overflow):qe,overflowWrap:Xe(h.overflowWrap?h.overflowWrap:h.wordWrap),padding:_(h),position:A,textDecoration:m(h),textShadow:rt(h.textShadow),textTransform:nt(h.textTransform),transform:ot(h),visibility:ct(h.visibility),wordBreak:dt(h.wordBreak),zIndex:ut(A!==Ye?h.zIndex:"auto")},this.isTransformed()&&(t.style.transform="matrix(1,0,0,1,0,0)"),c===me){var p=function(e){var t=e.parent;if(!t)return null;do{if(-1!==qt.indexOf(t.tagName))return t;t=t.parent}while(t);return e.parent}(this);if(p){var f=p.listItems.length;p.listItems.push(this),this.listIndex=t.hasAttribute("value")&&"number"==typeof t.value?t.value:0===f?"number"==typeof p.listStart?p.listStart:1:p.listItems[f-1].listIndex+1}}"IMG"===t.tagName&&t.addEventListener("load",function(){a.bounds=D(t,o,l),a.curvedBounds=O(a.bounds,a.style.border,a.style.borderRadius)}),this.image=si(t,r),this.bounds=d?function(e){return e.width>e.height?(e.left+=(e.width-e.height)/2,e.width=e.height):e.width<e.height&&(e.top+=(e.height-e.width)/2,e.height=e.width),e}(D(t,o,l)):D(t,o,l),this.curvedBounds=O(this.bounds,this.style.border,this.style.borderRadius)}return function(e,t){t&&function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t)}(e,[{key:"getClipPaths",value:function(){var e=this.parent?this.parent.getClipPaths():[];return this.style.overflow!==Ke?e.concat([R(this.curvedBounds)]):e}},{key:"isInFlow",value:function(){return this.isRootElement()&&!this.isFloating()&&!this.isAbsolutelyPositioned()}},{key:"isVisible",value:function(){return!v(this.style.display,ae)&&this.style.opacity>0&&0===this.style.visibility}},{key:"isAbsolutelyPositioned",value:function(){return this.style.position!==Ye&&this.style.position!==$e}},{key:"isPositioned",value:function(){return this.style.position!==Ye}},{key:"isFloating",value:function(){return 0!==this.style.float}},{key:"isRootElement",value:function(){return null===this.parent}},{key:"isTransformed",value:function(){return null!==this.style.transform}},{key:"isPositionedWithZIndex",value:function(){return this.isPositioned()&&!this.style.zIndex.auto}},{key:"isInlineLevel",value:function(){return v(this.style.display,oe)||v(this.style.display,Te)||v(this.style.display,De)||v(this.style.display,Ue)||v(this.style.display,Le)||v(this.style.display,Ie)}},{key:"isInlineBlockOrInlineTable",value:function(){return v(this.style.display,Te)||v(this.style.display,Ie)}}]),e}(),si=function(e,t){if(e instanceof e.ownerDocument.defaultView.SVGSVGElement||e instanceof SVGSVGElement){var i=new XMLSerializer;return t.loadImage("data:image/svg+xml,".concat(encodeURIComponent(i.serializeToString(e))))}switch(e.tagName){case"IMG":var r=e;return t.loadImage(r.currentSrc||r.src);case"CANVAS":var n=e;return t.loadCanvas(n);case"IFRAME":var a=e.getAttribute("data-html2canvas-internal-iframe-key");if(a)return a}return null},oi=function(){function e(t,i,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.container=t,this.parent=i,this.contexts=[],this.children=[],this.treatAsRealStackingContext=r}return function(e,t){t&&function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t)}(e,[{key:"getOpacity",value:function(){return this.parent?this.container.style.opacity*this.parent.getOpacity():this.container.style.opacity}},{key:"getRealParentStackingContext",value:function(){return!this.parent||this.treatAsRealStackingContext?this:this.parent.getRealParentStackingContext()}}]),e}(),li=["SCRIPT","HEAD","TITLE","OBJECT","BR","OPTION"],hi=function(e,t){return e.isRootElement()||e.isPositionedWithZIndex()||e.style.opacity<1||e.isTransformed()||di(e,t)},ci=function(e){return e.isPositioned()||e.isFloating()},di=function(e,t){return"BODY"===t.nodeName&&e.parent instanceof ai&&e.parent.style.background.backgroundColor.isTransparent()},ui=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._data={},this._document=t}return function(e,t){t&&function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t)}(e,[{key:"_parseMetrics",value:function(e){var t=this._document.createElement("div"),i=this._document.createElement("img"),r=this._document.createElement("span"),n=this._document.body;if(!n)throw new Error("");t.style.visibility="hidden",t.style.fontFamily=e.fontFamily,t.style.fontSize=e.fontSize,t.style.margin="0",t.style.padding="0",n.appendChild(t),i.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",i.width=1,i.height=1,i.style.margin="0",i.style.padding="0",i.style.verticalAlign="baseline",r.style.fontFamily=e.fontFamily,r.style.fontSize=e.fontSize,r.style.margin="0",r.style.padding="0",r.appendChild(this._document.createTextNode("Hidden Text")),t.appendChild(r),t.appendChild(i);var a=i.offsetTop-r.offsetTop+2;t.removeChild(r),t.appendChild(this._document.createTextNode("Hidden Text")),t.style.lineHeight="normal",i.style.verticalAlign="super";var s=i.offsetTop-t.offsetTop+2;return n.removeChild(t),{baseline:a,middle:s}}},{key:"getMetrics",value:function(e){var t="".concat(e.fontFamily," ").concat(e.fontSize);return void 0===this._data[t]&&(this._data[t]=this._parseMetrics(e)),this._data[t]}}]),e}(),Ai=/([+-]?\d*\.?\d+)(deg|grad|rad|turn)/i;function pi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var fi=/^(to )?(left|top|right|bottom)( (left|top|right|bottom))?$/i,mi=/^([+-]?\d*\.?\d+)% ([+-]?\d*\.?\d+)%$/i,gi=/(px)|%|( 0)$/i,wi=/^(from|to|color-stop)\((?:([\d.]+)(%)?,\s*)?(.+?)\)$/i,bi=/^\s*(circle|ellipse)?\s*((?:([\d.]+)(px|r?em|%)\s*(?:([\d.]+)(px|r?em|%))?)|closest-side|closest-corner|farthest-side|farthest-corner)?\s*(?:at\s*(?:(left|center|right)|([\d.]+)(px|r?em|%))\s+(?:(top|center|bottom)|([\d.]+)(px|r?em|%)))?(?:\s|$)/i,vi={left:new S("0%"),top:new S("0%"),center:new S("50%"),right:new S("100%"),bottom:new S("100%")},yi=function(e,t,i){for(var r=[],n=t;n<e.length;n++){var a=e[n],s=gi.test(a),o=a.lastIndexOf(" "),l=new u(s?a.substring(0,o):a),h=s?new S(a.substring(o+1)):n===t?new S("0%"):n===e.length-1?new S("100%"):null;r.push({color:l,stop:h})}for(var c=r.map(function(e){var t=e.color,r=e.stop;return{color:t,stop:0===i?0:r?r.getAbsoluteValue(i)/i:null}}),d=c[0].stop,A=0;A<c.length;A++)if(null!==d){var p=c[A].stop;if(null===p){for(var f=A;null===c[f].stop;)f++;for(var m=f-A+1,g=(c[f].stop-d)/m;A<f;A++)d=c[A].stop=d+g}else d=p}return c},Bi=function(e,t,i){var r=function(e){var t=e.match(Ai);if(t){var i=parseFloat(t[1]);switch(t[2].toLowerCase()){case"deg":return Math.PI*i/180;case"grad":return Math.PI/200*i;case"rad":return i;case"turn":return 2*Math.PI*i}}return null}(e[0]),n=fi.test(e[0]),a=n||null!==r||mi.test(e[0]),s=a?null!==r?xi(i?r-.5*Math.PI:r,t):n?Si(e[0],t):Ni(e[0],t):xi(Math.PI,t),o=a?1:0,l=Math.min(y(Math.abs(s.x0)+Math.abs(s.x1),Math.abs(s.y0)+Math.abs(s.y1)),2*t.width,2*t.height);return new function e(t,i){pi(this,e),this.type=0,this.colorStops=t,this.direction=i}(yi(e,o,l),s)},Ci=function(e,t,i){var r=t[0].match(bi),n=r&&("circle"===r[1]||void 0!==r[3]&&void 0===r[5])?0:1,a={},s={};r&&(void 0!==r[3]&&(a.x=N(e,r[3],r[4]).getAbsoluteValue(i.width)),void 0!==r[5]&&(a.y=N(e,r[5],r[6]).getAbsoluteValue(i.height)),r[7]?s.x=vi[r[7].toLowerCase()]:void 0!==r[8]&&(s.x=N(e,r[8],r[9])),r[10]?s.y=vi[r[10].toLowerCase()]:void 0!==r[11]&&(s.y=N(e,r[11],r[12])));var o={x:void 0===s.x?i.width/2:s.x.getAbsoluteValue(i.width),y:void 0===s.y?i.height/2:s.y.getAbsoluteValue(i.height)},l=ki(r&&r[2]||"farthest-corner",n,o,a,i);return new function e(t,i,r,n){pi(this,e),this.type=1,this.colorStops=t,this.shape=i,this.center=r,this.radius=n}(yi(t,r?1:0,Math.min(l.x,l.y)),n,o,l)},xi=function(e,t){var i=t.width,r=t.height,n=.5*i,a=.5*r,s=(Math.abs(i*Math.sin(e))+Math.abs(r*Math.cos(e)))/2,o=n+Math.sin(e)*s,l=a-Math.cos(e)*s;return{x0:o,x1:i-o,y0:l,y1:r-l}},Fi=function(e){return Math.acos(e.width/2/(y(e.width,e.height)/2))},Si=function(e,t){switch(e){case"bottom":case"to top":return xi(0,t);case"left":case"to right":return xi(Math.PI/2,t);case"right":case"to left":return xi(3*Math.PI/2,t);case"top right":case"right top":case"to bottom left":case"to left bottom":return xi(Math.PI+Fi(t),t);case"top left":case"left top":case"to bottom right":case"to right bottom":return xi(Math.PI-Fi(t),t);case"bottom left":case"left bottom":case"to top right":case"to right top":return xi(Fi(t),t);case"bottom right":case"right bottom":case"to top left":case"to left top":return xi(2*Math.PI-Fi(t),t);default:return xi(Math.PI,t)}},Ni=function(e,t){var i=function(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){var t=[],i=!0,r=!1,n=void 0;try{for(var a,s=e[Symbol.iterator]();!(i=(a=s.next()).done)&&(t.push(a.value),2!==t.length);i=!0);}catch(e){r=!0,n=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw n}}return t}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}(e.split(" ").map(parseFloat)),r=i[0],n=i[1],a=r/100*t.width/(n/100*t.height);return xi(Math.atan(isNaN(a)?1:a)+Math.PI/2,t)},Ei=function(e,t,i,r){return[{x:0,y:0},{x:0,y:e.height},{x:e.width,y:0},{x:e.width,y:e.height}].reduce(function(e,n){var a=y(t-n.x,i-n.y);return(r?a<e.optimumDistance:a>e.optimumDistance)?{optimumCorner:n,optimumDistance:a}:e},{optimumDistance:r?1/0:-1/0,optimumCorner:null}).optimumCorner},ki=function(e,t,i,r,n){var a=i.x,s=i.y,o=0,l=0;switch(e){case"closest-side":0===t?o=l=Math.min(Math.abs(a),Math.abs(a-n.width),Math.abs(s),Math.abs(s-n.height)):1===t&&(o=Math.min(Math.abs(a),Math.abs(a-n.width)),l=Math.min(Math.abs(s),Math.abs(s-n.height)));break;case"closest-corner":if(0===t)o=l=Math.min(y(a,s),y(a,s-n.height),y(a-n.width,s),y(a-n.width,s-n.height));else if(1===t){var h=Math.min(Math.abs(s),Math.abs(s-n.height))/Math.min(Math.abs(a),Math.abs(a-n.width)),c=Ei(n,a,s,!0);l=h*(o=y(c.x-a,(c.y-s)/h))}break;case"farthest-side":0===t?o=l=Math.max(Math.abs(a),Math.abs(a-n.width),Math.abs(s),Math.abs(s-n.height)):1===t&&(o=Math.max(Math.abs(a),Math.abs(a-n.width)),l=Math.max(Math.abs(s),Math.abs(s-n.height)));break;case"farthest-corner":if(0===t)o=l=Math.max(y(a,s),y(a,s-n.height),y(a-n.width,s),y(a-n.width,s-n.height));else if(1===t){var d=Math.max(Math.abs(s),Math.abs(s-n.height))/Math.max(Math.abs(a),Math.abs(a-n.width)),u=Ei(n,a,s,!1);l=d*(o=y(u.x-a,(u.y-s)/d))}break;default:o=r.x||0,l=void 0!==r.y?r.y:o}return{x:o,y:l}},Ti=function(e){var t="",i="",r="",n="",a=0,s=/^(left|center|right|\d+(?:px|r?em|%)?)(?:\s+(top|center|bottom|\d+(?:px|r?em|%)?))?$/i,o=/^\d+(px|r?em|%)?(?:\s+\d+(px|r?em|%)?)?$/i,l=e[a].match(s);l&&a++;var h=e[a].match(/^(circle|ellipse)?\s*(closest-side|closest-corner|farthest-side|farthest-corner|contain|cover)?$/i);h&&(t=h[1]||"","contain"===(r=h[2]||"")?r="closest-side":"cover"===r&&(r="farthest-corner"),a++);var c=e[a].match(o);c&&a++;var d=e[a].match(s);d&&a++;var u=e[a].match(o);u&&a++;var A=d||l;A&&A[1]&&(n=A[1]+(/^\d+$/.test(A[1])?"px":""),A[2]&&(n+=" "+A[2]+(/^\d+$/.test(A[2])?"px":"")));var p=u||c;return p&&(i=p[0],p[1]||(i+="px")),!n||t||i||r||(i=n,n=""),n&&(n="at ".concat(n)),[[t,r,i,n].filter(function(e){return!!e}).join(" ")].concat(e.slice(a))},Li=function(e){return e.map(function(e){return e.match(wi)}).map(function(t,i){if(!t)return e[i];switch(t[1]){case"from":return"".concat(t[4]," 0%");case"to":return"".concat(t[4]," 100%");case"color-stop":return"%"===t[3]?"".concat(t[4]," ").concat(t[2]):"".concat(t[4]," ").concat(100*parseFloat(t[2]),"%")}})};function Ii(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=[],r=!0,n=!1,a=void 0;try{for(var s,o=e[Symbol.iterator]();!(r=(s=o.next()).done)&&(i.push(s.value),!t||i.length!==t);r=!0);}catch(e){n=!0,a=e}finally{try{r||null==o.return||o.return()}finally{if(n)throw a}}return i}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var Di=function(){function e(t,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.target=t,this.options=i,t.render(i)}return function(e,t){t&&function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t)}(e,[{key:"renderNode",value:function(e){e.isVisible()&&(this.renderNodeBackgroundAndBorders(e),this.renderNodeContent(e))}},{key:"renderNodeContent",value:function(e){var t=this,i=function(){if(e.childNodes.length&&e.childNodes.forEach(function(i){if(i instanceof Ct){var r=i.parent.style;t.target.renderTextNode(i.bounds,r.color,r.font,r.textDecoration,r.textShadow)}else t.target.drawShape(i,e.style.color)}),e.image){var i=t.options.imageStore.get(e.image);if(i){var r=function(e,t,i){var r=t[0].value,n=t[1].value,a=t[2].value,s=t[3].value;return new I(e.left+s+i[3].borderWidth,e.top+r+i[0].borderWidth,e.width-(i[1].borderWidth+i[3].borderWidth+s+n),e.height-(i[0].borderWidth+i[2].borderWidth+r+a))}(e.bounds,e.style.padding,e.style.border),n="number"==typeof i.width&&i.width>0?i.width:r.width,a="number"==typeof i.height&&i.height>0?i.height:r.height;n>0&&a>0&&t.target.clip([R(e.curvedBounds)],function(){t.target.drawImage(i,new I(0,0,n,a),r)})}}},r=e.getClipPaths();r.length?this.target.clip(r,i):i()}},{key:"renderNodeBackgroundAndBorders",value:function(e){var t=this,i=!e.style.background.backgroundColor.isTransparent()||e.style.background.backgroundImage.length,r=e.style.border.some(function(e){return 0!==e.borderStyle&&!e.borderColor.isTransparent()}),n=function(){var r=function(e,t){return t===j.BORDER_BOX?function(e){return[e.topLeftOuter,e.topRightOuter,e.bottomRightOuter,e.bottomLeftOuter]}(e):R(e)}(e.curvedBounds,e.style.background.backgroundClip);i&&t.target.clip([r],function(){e.style.background.backgroundColor.isTransparent()||t.target.fill(e.style.background.backgroundColor),t.renderBackgroundImage(e)}),e.style.border.forEach(function(i,r){0===i.borderStyle||i.borderColor.isTransparent()||t.renderBorder(i,r,e.curvedBounds)})};if(i||r){var a=e.parent?e.parent.getClipPaths():[];a.length?this.target.clip(a,n):n()}}},{key:"renderBackgroundImage",value:function(e){var t=this;e.style.background.backgroundImage.slice(0).reverse().forEach(function(i){"url"===i.source.method&&i.source.args.length?t.renderBackgroundRepeat(e,i):/gradient/i.test(i.source.method)&&t.renderBackgroundGradient(e,i)})}},{key:"renderBackgroundRepeat",value:function(e,t){var i=this.options.imageStore.get(t.source.args[0]);if(i){var r=q(e.style.background.backgroundOrigin,e.bounds,e.style.padding,e.style.border),n=function(e,t,i){var r=0,n=0,a=e.size;if(1===a[0].size||2===a[0].size){var s=i.width/i.height,o=t.width/t.height;return s<o!=(2===a[0].size)?new E(i.width,i.width/o):new E(i.height*o,i.height)}return a[0].value&&(r=a[0].value.getAbsoluteValue(i.width)),0===a[0].size&&0===a[1].size?n=t.height:0===a[1].size?n=r/t.width*t.height:a[1].value&&(n=a[1].value.getAbsoluteValue(i.height)),0===a[0].size&&(r=n/t.height*t.width),new E(r,n)}(t,i,r),a=G(t.position,n,r),s=function(e,t,i,r,n){switch(e.repeat){case 2:return[new k(Math.round(n.left),Math.round(r.top+t.y)),new k(Math.round(n.left+n.width),Math.round(r.top+t.y)),new k(Math.round(n.left+n.width),Math.round(i.height+r.top+t.y)),new k(Math.round(n.left),Math.round(i.height+r.top+t.y))];case 3:return[new k(Math.round(r.left+t.x),Math.round(n.top)),new k(Math.round(r.left+t.x+i.width),Math.round(n.top)),new k(Math.round(r.left+t.x+i.width),Math.round(n.height+n.top)),new k(Math.round(r.left+t.x),Math.round(n.height+n.top))];case 1:return[new k(Math.round(r.left+t.x),Math.round(r.top+t.y)),new k(Math.round(r.left+t.x+i.width),Math.round(r.top+t.y)),new k(Math.round(r.left+t.x+i.width),Math.round(r.top+t.y+i.height)),new k(Math.round(r.left+t.x),Math.round(r.top+t.y+i.height))];default:return[new k(Math.round(n.left),Math.round(n.top)),new k(Math.round(n.left+n.width),Math.round(n.top)),new k(Math.round(n.left+n.width),Math.round(n.height+n.top)),new k(Math.round(n.left),Math.round(n.height+n.top))]}}(t,a,n,r,e.bounds),o=Math.round(r.left+a.x),l=Math.round(r.top+a.y);this.target.renderRepeat(s,i,n,o,l)}}},{key:"renderBackgroundGradient",value:function(e,t){var i=q(e.style.background.backgroundOrigin,e.bounds,e.style.padding,e.style.border),r=function(e,t){var i=e.size,r=i[0].value?i[0].value.getAbsoluteValue(t.width):t.width,n=i[1].value?i[1].value.getAbsoluteValue(t.height):i[0].value?r:t.height;return new E(r,n)}(t,i),n=G(t.position,r,i),a=new I(Math.round(i.left+n.x),Math.round(i.top+n.y),r.width,r.height),s=function(e,t,i){var r=t.args,n=t.method,a=t.prefix;return"linear-gradient"===n?Bi(r,i,!!a):"gradient"===n&&"linear"===r[0]?Bi(["to bottom"].concat(Li(r.slice(3))),i,!!a):"radial-gradient"===n?Ci(e,"-webkit-"===a?Ti(r):r,i):"gradient"===n&&"radial"===r[0]?Ci(e,Li(Ti(r.slice(1))),i):void 0}(e,t.source,a);if(s)switch(s.type){case 0:this.target.renderLinearGradient(a,s);break;case 1:this.target.renderRadialGradient(a,s)}}},{key:"renderBorder",value:function(e,t,i){this.target.drawShape(function(e,t){switch(t){case 0:return P(e.topLeftOuter,e.topLeftInner,e.topRightOuter,e.topRightInner);case 1:return P(e.topRightOuter,e.topRightInner,e.bottomRightOuter,e.bottomRightInner);case 2:return P(e.bottomRightOuter,e.bottomRightInner,e.bottomLeftOuter,e.bottomLeftInner);default:return P(e.bottomLeftOuter,e.bottomLeftInner,e.topLeftOuter,e.topLeftInner)}}(i,t),e.borderColor)}},{key:"renderStack",value:function(e){var t=this;if(e.container.isVisible()){var i=e.getOpacity();i!==this._opacity&&(this.target.setOpacity(e.getOpacity()),this._opacity=i);var r=e.container.style.transform;null!==r?this.target.transform(e.container.bounds.left+r.transformOrigin[0].value,e.container.bounds.top+r.transformOrigin[1].value,r.transform,function(){return t.renderStackContent(e)}):this.renderStackContent(e)}}},{key:"renderStackContent",value:function(e){var t=Ii(Pi(e),5),i=t[0],r=t[1],n=t[2],a=t[3],s=t[4],o=Ii(Ui(e),2),l=o[0],h=o[1];this.renderNodeBackgroundAndBorders(e.container),i.sort(Ri).forEach(this.renderStack,this),this.renderNodeContent(e.container),h.forEach(this.renderNode,this),a.forEach(this.renderStack,this),s.forEach(this.renderStack,this),l.forEach(this.renderNode,this),r.forEach(this.renderStack,this),n.sort(Ri).forEach(this.renderStack,this)}},{key:"render",value:function(e){return this.options.backgroundColor&&this.target.rectangle(this.options.x,this.options.y,this.options.width,this.options.height,this.options.backgroundColor),this.renderStack(e),this.target.getTarget()}}]),e}(),Ui=function(e){for(var t=[],i=[],r=e.children.length,n=0;n<r;n++){var a=e.children[n];a.isInlineLevel()?t.push(a):i.push(a)}return[t,i]},Pi=function(e){for(var t=[],i=[],r=[],n=[],a=[],s=e.contexts.length,o=0;o<s;o++){var l=e.contexts[o];l.container.isPositioned()||l.container.style.opacity<1||l.container.isTransformed()?l.container.style.zIndex.order<0?t.push(l):l.container.style.zIndex.order>0?r.push(l):i.push(l):l.container.isFloating()?n.push(l):a.push(l)}return[t,i,r,n,a]},Ri=function(e,t){return e.container.style.zIndex.order>t.container.style.zIndex.order?1:e.container.style.zIndex.order<t.container.style.zIndex.order?-1:e.container.index>t.container.index?1:-1},Oi=function(e,t){if(!t.proxy)return Promise.reject(null);var i=t.proxy;return new Promise(function(r,n){var a=wt.SUPPORT_CORS_XHR&&wt.SUPPORT_RESPONSE_TYPE?"blob":"text",s=wt.SUPPORT_CORS_XHR?new XMLHttpRequest:new XDomainRequest;if(s.onload=function(){if(s instanceof XMLHttpRequest)if(200===s.status)if("text"===a)r(s.response);else{var e=new FileReader;e.addEventListener("load",function(){return r(e.result)},!1),e.addEventListener("error",function(e){return n(e)},!1),e.readAsDataURL(s.response)}else n("");else r(s.responseText)},s.onerror=n,s.open("GET","".concat(i,"?url=").concat(encodeURIComponent(e),"&responseType=").concat(a)),"text"!==a&&s instanceof XMLHttpRequest&&(s.responseType=a),t.imageTimeout){var o=t.imageTimeout;s.timeout=o,s.ontimeout=function(){return n("")}}s.send()})};function Qi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Hi(e,t,i){return t&&function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}var Mi=function(){function e(t,i,r){Qi(this,e),this.options=t,this._window=r,this.origin=this.getOrigin(r.location.href),this.cache={},this.logger=i,this._index=0}return Hi(e,[{key:"loadImage",value:function(e){var t=this;if(this.hasResourceInCache(e))return e;if(Gi(e))return this.cache[e]=Ji(e,this.options.imageTimeout||0),e;if(!Wi(e)||wt.SUPPORT_SVG_DRAWING){if(!0===this.options.allowTaint||Ki(e)||this.isSameOrigin(e))return this.addImage(e,e,!1);if(!this.isSameOrigin(e)){if("string"==typeof this.options.proxy)return this.cache[e]=Oi(e,this.options).then(function(e){return Ji(e,t.options.imageTimeout||0)}),e;if(!0===this.options.useCORS&&wt.SUPPORT_CORS_IMAGES)return this.addImage(e,e,!0)}}}},{key:"inlineImage",value:function(e){var t=this;return Ki(e)?Ji(e,this.options.imageTimeout||0):this.hasResourceInCache(e)?this.cache[e]:this.isSameOrigin(e)||"string"!=typeof this.options.proxy?this.xhrImage(e):this.cache[e]=Oi(e,this.options).then(function(e){return Ji(e,t.options.imageTimeout||0)})}},{key:"xhrImage",value:function(e){var t=this;return this.cache[e]=new Promise(function(i,r){var n=new XMLHttpRequest;if(n.onreadystatechange=function(){if(4===n.readyState)if(200!==n.status)r("Failed to fetch image ".concat(e.substring(0,256)," with status code ").concat(n.status));else{var t=new FileReader;t.addEventListener("load",function(){var e=t.result;i(e)},!1),t.addEventListener("error",function(e){return r(e)},!1),t.readAsDataURL(n.response)}},n.responseType="blob",t.options.imageTimeout){var a=t.options.imageTimeout;n.timeout=a,n.ontimeout=function(){return r("")}}n.open("GET",e,!0),n.send()}).then(function(e){return Ji(e,t.options.imageTimeout||0)}),this.cache[e]}},{key:"loadCanvas",value:function(e){var t=String(this._index++);return this.cache[t]=Promise.resolve(e),t}},{key:"hasResourceInCache",value:function(e){return void 0!==this.cache[e]}},{key:"addImage",value:function(e,t,i){var r=this;return this.cache[e]=new Promise(function(e,n){var a=new Image;if(a.onload=function(){return e(a)},(qi(t)||i)&&(a.crossOrigin="anonymous"),a.onerror=n,a.src=t,!0===a.complete&&setTimeout(function(){e(a)},500),r.options.imageTimeout){var s=r.options.imageTimeout;setTimeout(function(){return n("")},s)}}),e}},{key:"isSameOrigin",value:function(e){return this.getOrigin(e)===this.origin}},{key:"getOrigin",value:function(e){var t=this._link||(this._link=this._window.document.createElement("a"));return t.href=e,t.href=t.href,t.protocol+t.hostname+t.port}},{key:"ready",value:function(){var e=this,t=Object.keys(this.cache),i=t.map(function(t){return e.cache[t].catch(function(e){return null})});return Promise.all(i).then(function(e){return new _i(t,e)})}}]),e}(),_i=function(){function e(t,i){Qi(this,e),this._keys=t,this._resources=i}return Hi(e,[{key:"get",value:function(e){var t=this._keys.indexOf(e);return-1===t?null:this._resources[t]}}]),e}(),ji=/^data:image\/svg\+xml/i,zi=/^data:image\/.*;base64,/i,Vi=/^data:image\/.*/i,Ki=function(e){return Vi.test(e)},qi=function(e){return zi.test(e)},Gi=function(e){return"blob"===e.substr(0,4)},Wi=function(e){return"svg"===e.substr(-3).toLowerCase()||ji.test(e)},Ji=function(e,t){return new Promise(function(i,r){var n=new Image;n.onload=function(){return i(n)},n.onerror=r,n.src=e,!0===n.complete&&setTimeout(function(){i(n)},500),t&&setTimeout(function(){return r("")},t)})};function Xi(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=[],r=!0,n=!1,a=void 0;try{for(var s,o=e[Symbol.iterator]();!(r=(s=o.next()).done)&&(i.push(s.value),!t||i.length!==t);r=!0);}catch(e){n=!0,a=e}finally{try{r||null==o.return||o.return()}finally{if(n)throw a}}return i}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var Yi=function(e,t,i){if(!t||!t.content||"none"===t.content||"-moz-alt-content"===t.content||"none"===t.display)return null;var r=$i(t.content),n=r.length,a=[],s="",o=t.counterIncrement;if(o&&"none"!==o){var l=Xi(o.split(/\s+/),2),h=l[0],c=l[1],d=i.counters[h];d&&(d[d.length-1]+=void 0===c?1:parseInt(c,10))}for(var u=0;u<n;u++){var A=r[u];switch(A.type){case 0:s+=A.value||"";break;case 1:e instanceof HTMLElement&&A.value&&(s+=e.getAttribute(A.value)||"");break;case 3:var p=i.counters[A.name||""];p&&(s+=tr([p[p.length-1]],"",A.format));break;case 4:var f=i.counters[A.name||""];f&&(s+=tr(f,A.glue,A.format));break;case 5:s+=er(t,!0,i.quoteDepth),i.quoteDepth++;break;case 6:i.quoteDepth--,s+=er(t,!1,i.quoteDepth);break;case 2:s&&(a.push({type:0,value:s}),s=""),a.push({type:1,value:A.value||""})}}return s&&a.push({type:0,value:s}),a},$i=function(e,t){for(var i=[],r=e.length,n=!1,a=!1,s=!1,o="",l="",h=[],c=0;c<r;c++){var d=e.charAt(c);switch(d){case"'":case'"':a?o+=d:(n=!n,s||n||(i.push({type:0,value:o}),o=""));break;case"\\":a?(o+=d,a=!1):a=!0;break;case"(":n?o+=d:(s=!0,l=o,o="",h=[]);break;case")":if(n)o+=d;else if(s){switch(o&&h.push(o),l){case"attr":h.length>0&&i.push({type:1,value:h[0]});break;case"counter":if(h.length>0){var u={type:3,name:h[0]};h.length>1&&(u.format=h[1]),i.push(u)}break;case"counters":if(h.length>0){var A={type:4,name:h[0]};h.length>1&&(A.glue=h[1]),h.length>2&&(A.format=h[2]),i.push(A)}break;case"url":h.length>0&&i.push({type:2,value:h[0]})}s=!1,o=""}break;case",":n?o+=d:s&&(h.push(o),o="");break;case" ":case"\t":n?o+=d:o&&(Zi(i,o),o="");break;default:o+=d}"\\"!==d&&(a=!1)}return o&&Zi(i,o),i},Zi=function(e,t){switch(t){case"open-quote":e.push({type:5});break;case"close-quote":e.push({type:6})}},er=function(e,t,i){var r=e.quotes?e.quotes.split(/\s+/):["'\"'","'\"'"],n=2*i;return n>=r.length&&(n=r.length-2),t||++n,r[n].replace(/^["']|["']$/g,"")},tr=function(e,t,i){for(var r=e.length,n="",a=0;a<r;a++)a>0&&(n+=t||""),n+=ri(e[a],Me(i||"decimal"),!1);return n},ir=function(){function e(t,i,r,n,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.referenceElement=t,this.scrolledElements=[],this.copyStyles=n,this.inlineImages=n,this.logger=r,this.options=i,this.renderer=a,this.resourceLoader=new Mi(i,r,window),this.pseudoContentData={counters:{},quoteDepth:0},this.documentElement=this.cloneNode(t.ownerDocument.documentElement)}return function(e,t){t&&function(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t)}(e,[{key:"inlineAllImages",value:function(e){var t=this;if(this.inlineImages&&e){var i=e.style;Promise.all(ee(i.backgroundImage).map(function(e){return"url"===e.method?t.resourceLoader.inlineImage(e.args[0]).then(function(e){return e&&"string"==typeof e.src?'url("'.concat(e.src,'")'):"none"}).catch(function(e){}):Promise.resolve("".concat(e.prefix).concat(e.method,"(").concat(e.args.join(","),")"))})).then(function(e){e.length>1&&(i.backgroundColor=""),i.backgroundImage=e.join(",")}),e instanceof HTMLImageElement&&this.resourceLoader.inlineImage(e.src).then(function(t){if(t&&e instanceof HTMLImageElement&&e.parentNode){var i=e.parentNode,r=B(e.style,t.cloneNode(!1));i.replaceChild(r,e)}}).catch(function(e){})}}},{key:"inlineFonts",value:function(e){var t=this;return Promise.all(Array.from(e.styleSheets).map(function(t){return t.href?fetch(t.href).then(function(e){return e.text()}).then(function(e){return nr(e,t.href)}).catch(function(e){return[]}):rr(t,e)})).then(function(e){return e.reduce(function(e,t){return e.concat(t)},[])}).then(function(e){return Promise.all(e.map(function(e){return fetch(e.formats[0].src).then(function(e){return e.blob()}).then(function(e){return new Promise(function(t,i){var r=new FileReader;r.onerror=i,r.onload=function(){var e=r.result;t(e)},r.readAsDataURL(e)})}).then(function(t){return e.fontFace.setProperty("src",'url("'.concat(t,'")')),"@font-face {".concat(e.fontFace.cssText," ")})}))}).then(function(i){var r=e.createElement("style");r.textContent=i.join("\n"),t.documentElement.appendChild(r)})}},{key:"createElementClone",value:function(e){var t=this;if(this.copyStyles&&e instanceof HTMLCanvasElement){var i=e.ownerDocument.createElement("img");try{return i.src=e.toDataURL(),i}catch(e){}}if(e instanceof HTMLIFrameElement){var r=e.cloneNode(!1),n=pr();r.setAttribute("data-html2canvas-internal-iframe-key",n);var a=D(e,0,0),s=a.width,o=a.height;return this.resourceLoader.cache[n]=mr(e,this.options).then(function(e){return t.renderer(e,{allowTaint:t.options.allowTaint,backgroundColor:"#ffffff",canvas:null,imageTimeout:t.options.imageTimeout,logging:t.options.logging,proxy:t.options.proxy,removeContainer:t.options.removeContainer,scale:t.options.scale,foreignObjectRendering:t.options.foreignObjectRendering,useCORS:t.options.useCORS,target:new w,width:s,height:o,x:0,y:0,windowWidth:e.ownerDocument.defaultView.innerWidth,windowHeight:e.ownerDocument.defaultView.innerHeight,scrollX:e.ownerDocument.defaultView.pageXOffset,scrollY:e.ownerDocument.defaultView.pageYOffset},t.logger.child(n))}).then(function(t){return new Promise(function(i,n){var a=document.createElement("img");a.onload=function(){return i(t)},a.onerror=function(e){"data:,"==a.src?i(t):n(e)},a.src=t.toDataURL(),r.parentNode&&r.parentNode.replaceChild(B(e.ownerDocument.defaultView.getComputedStyle(e),a),r)})}),r}try{if(e instanceof HTMLStyleElement&&e.sheet&&e.sheet.cssRules){var l=[].slice.call(e.sheet.cssRules,0).reduce(function(e,t){return t&&t.cssText?e+t.cssText:e},""),h=e.cloneNode(!1);return h.textContent=l,h}}catch(e){if(this.logger.log("Unable to access cssRules property"),"SecurityError"!==e.name)throw this.logger.log(e),e}return e.cloneNode(!1)}},{key:"cloneNode",value:function(e){var t=e.nodeType===Node.TEXT_NODE?document.createTextNode(e.nodeValue):this.createElementClone(e),i=e.ownerDocument.defaultView,r=e instanceof i.HTMLElement?i.getComputedStyle(e):null,n=e instanceof i.HTMLElement?i.getComputedStyle(e,":before"):null,a=e instanceof i.HTMLElement?i.getComputedStyle(e,":after"):null;this.referenceElement===e&&t instanceof i.HTMLElement&&(this.clonedReferenceElement=t),t instanceof i.HTMLBodyElement&&dr(t);for(var s=function(e,t){if(!e||!e.counterReset||"none"===e.counterReset)return[];for(var i=[],r=e.counterReset.split(/\s*,\s*/),n=r.length,a=0;a<n;a++){var s=Xi(r[a].split(/\s+/),2),o=s[0],l=s[1];i.push(o);var h=t.counters[o];h||(h=t.counters[o]=[]),h.push(parseInt(l||0,10))}return i}(r,this.pseudoContentData),o=Yi(e,n,this.pseudoContentData),l=e.firstChild;l;l=l.nextSibling)l.nodeType===Node.ELEMENT_NODE&&("SCRIPT"===l.nodeName||l.hasAttribute("data-html2canvas-ignore")||"function"==typeof this.options.ignoreElements&&this.options.ignoreElements(l))||this.copyStyles&&"STYLE"===l.nodeName||t.appendChild(this.cloneNode(l));var h=Yi(e,a,this.pseudoContentData);if(function(e,t){for(var i=e.length,r=0;r<i;r++)t.counters[e[r]].pop()}(s,this.pseudoContentData),e instanceof i.HTMLElement&&t instanceof i.HTMLElement)switch(n&&this.inlineAllImages(sr(e,t,n,o,or)),a&&this.inlineAllImages(sr(e,t,a,h,lr)),!r||!this.copyStyles||e instanceof HTMLIFrameElement||B(r,t),this.inlineAllImages(t),0===e.scrollTop&&0===e.scrollLeft||this.scrolledElements.push([t,e.scrollLeft,e.scrollTop]),e.nodeName){case"CANVAS":this.copyStyles||ar(e,t);break;case"TEXTAREA":case"SELECT":t.value=e.value}return t}}]),e}(),rr=function(e,t){return(e.cssRules?Array.from(e.cssRules):[]).filter(function(e){return e.type===CSSRule.FONT_FACE_RULE}).map(function(e){for(var i=ee(e.style.getPropertyValue("src")),r=[],n=0;n<i.length;n++)if("url"===i[n].method&&i[n+1]&&"format"===i[n+1].method){var a=t.createElement("a");a.href=i[n].args[0],t.body&&t.body.appendChild(a);var s={src:a.href,format:i[n+1].args[0]};r.push(s)}return{formats:r.filter(function(e){return/^woff/i.test(e.format)}),fontFace:e.style}}).filter(function(e){return e.formats.length})},nr=function(e,t){var i=document.implementation.createHTMLDocument(""),r=document.createElement("base");r.href=t;var n=document.createElement("style");return n.textContent=e,i.head&&i.head.appendChild(r),i.body&&i.body.appendChild(n),n.sheet?rr(n.sheet,i):[]},ar=function(e,t){try{if(t){t.width=e.width,t.height=e.height;var i=e.getContext("2d"),r=t.getContext("2d");i?r.putImageData(i.getImageData(0,0,e.width,e.height),0,0):r.drawImage(e,0,0)}}catch(e){}},sr=function(e,t,i,r,n){if(i&&i.content&&"none"!==i.content&&"-moz-alt-content"!==i.content&&"none"!==i.display){var a=t.ownerDocument.createElement("html2canvaspseudoelement");if(B(i,a),r)for(var s=r.length,o=0;o<s;o++){var l=r[o];switch(l.type){case 1:var h=t.ownerDocument.createElement("img");h.src=ee("url(".concat(l.value,")"))[0].args[0],h.style.opacity="1",a.appendChild(h);break;case 0:a.appendChild(t.ownerDocument.createTextNode(l.value))}}return a.className="".concat(hr," ").concat(cr),t.className+=" ".concat(n===or?hr:cr),n===or?t.insertBefore(a,t.firstChild):t.appendChild(a),a}},or=":before",lr=":after",hr="___html2canvas___pseudoelement_before",cr="___html2canvas___pseudoelement_after",dr=function(e){ur(e,".".concat(hr).concat(or).concat('{\n content: "" !important;\n display: none !important;\n}',"\n .").concat(cr).concat(lr).concat('{\n content: "" !important;\n display: none !important;\n}'))},ur=function(e,t){var i=e.ownerDocument.createElement("style");i.innerHTML=t,e.appendChild(i)},Ar=function(e){var t=function(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){var t=[],i=!0,r=!1,n=void 0;try{for(var a,s=e[Symbol.iterator]();!(i=(a=s.next()).done)&&(t.push(a.value),3!==t.length);i=!0);}catch(e){r=!0,n=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw n}}return t}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}(e),i=t[0],r=t[1],n=t[2];i.scrollLeft=r,i.scrollTop=n},pr=function(){return Math.ceil(Date.now()+1e7*Math.random()).toString(16)},fr=/^data:text\/(.+);(base64)?,(.*)$/i,mr=function(e,t){try{return Promise.resolve(e.contentWindow.document.documentElement)}catch(i){return t.proxy?Oi(e.src,t).then(function(e){var t=e.match(fr);return t?"base64"===t[2]?window.atob(decodeURIComponent(t[3])):decodeURIComponent(t[3]):Promise.reject()}).then(function(t){return gr(e.ownerDocument,D(e,0,0)).then(function(e){var i=e.contentWindow.document;i.open(),i.write(t);var r=wr(e).then(function(){return i.documentElement});return i.close(),r})}):Promise.reject()}},gr=function(e,t){var i=e.createElement("iframe");return i.className="html2canvas-container",i.style.visibility="hidden",i.style.position="fixed",i.style.left="-10000px",i.style.top="0px",i.style.border="0",i.width=t.width.toString(),i.height=t.height.toString(),i.scrolling="no",i.setAttribute("data-html2canvas-ignore","true"),e.body?(e.body.appendChild(i),Promise.resolve(i)):Promise.reject("")},wr=function(e){var t=e.contentWindow,i=t.document;return new Promise(function(r,n){t.onload=e.onload=i.onreadystatechange=function(){var t=setInterval(function(){i.body.childNodes.length>0&&"complete"===i.readyState&&(clearInterval(t),r(e))},50)}})},br=function e(t,i,r){var n=t.ownerDocument,a=new I(i.scrollX,i.scrollY,i.windowWidth,i.windowHeight),s=n.documentElement?new u(getComputedStyle(n.documentElement).backgroundColor):p,o=n.body?new u(getComputedStyle(n.body).backgroundColor):p,l=t===n.documentElement?s.isTransparent()?o.isTransparent()?i.backgroundColor?new u(i.backgroundColor):null:o:s:i.backgroundColor?new u(i.backgroundColor):null;return(i.foreignObjectRendering?wt.SUPPORT_FOREIGNOBJECT_DRAWING:Promise.resolve(!1)).then(function(s){return s?function(e){return e.inlineFonts(n).then(function(){return e.resourceLoader.ready()}).then(function(){var a=new At(e.documentElement),s=n.defaultView,o=s.pageXOffset,h=s.pageYOffset,c="HTML"===t.tagName||"BODY"===t.tagName?U(n):D(t,o,h),d=c.width,u=c.height,A=c.left,p=c.top;return a.render({backgroundColor:l,logger:r,scale:i.scale,x:"number"==typeof i.x?i.x:A,y:"number"==typeof i.y?i.y:p,width:"number"==typeof i.width?i.width:Math.ceil(d),height:"number"==typeof i.height?i.height:Math.ceil(u),windowWidth:i.windowWidth,windowHeight:i.windowHeight,scrollX:i.scrollX,scrollY:i.scrollY})})}(new ir(t,i,r,!0,e)):function(e,t,i,r,n,a){var s=new ir(i,r,n,!1,a),o=e.defaultView.pageXOffset,l=e.defaultView.pageYOffset;return gr(e,t).then(function(n){var a=n.contentWindow,h=a.document,c=wr(n).then(function(){s.scrolledElements.forEach(Ar),a.scrollTo(t.left,t.top),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||a.scrollY===t.top&&a.scrollX===t.left||(h.documentElement.style.top=-t.top+"px",h.documentElement.style.left=-t.left+"px",h.documentElement.style.position="absolute");var i=Promise.resolve([n,s.clonedReferenceElement,s.resourceLoader]),o=r.onclone;return s.clonedReferenceElement instanceof a.HTMLElement||s.clonedReferenceElement instanceof e.defaultView.HTMLElement||s.clonedReferenceElement instanceof HTMLElement?"function"==typeof o?Promise.resolve().then(function(){return o(h)}).then(function(){return i}):i:Promise.reject("")});return h.open(),h.write("".concat(function(e){var t="";return e&&(t+="<!DOCTYPE ",e.name&&(t+=e.name),e.internalSubset&&(t+=e.internalSubset),e.publicId&&(t+='"'.concat(e.publicId,'"')),e.systemId&&(t+='"'.concat(e.systemId,'"')),t+=">"),t}(document.doctype),"<html></html>")),function(e,t,i){!e.defaultView||t===e.defaultView.pageXOffset&&i===e.defaultView.pageYOffset||e.defaultView.scrollTo(t,i)}(i.ownerDocument,o,l),h.replaceChild(h.adoptNode(s.documentElement),h.documentElement),h.close(),c})}(n,a,t,i,r,e).then(function(e){var t=function(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){var t=[],i=!0,r=!1,n=void 0;try{for(var a,s=e[Symbol.iterator]();!(i=(a=s.next()).done)&&(t.push(a.value),3!==t.length);i=!0);}catch(e){r=!0,n=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw n}}return t}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}(e),a=t[0],s=t[1],o=t[2],h=function(e,t){var i=0,r=new ai(e,null,t,i++),n=new oi(r,null,!0);return function e(t,i,r,n,a){for(var s,o=t.firstChild;o;o=s){s=o.nextSibling;var l=o.ownerDocument.defaultView;if(o instanceof l.Text||o instanceof Text||l.parent&&o instanceof l.parent.Text)o.data.trim().length>0&&i.childNodes.push(Ct.fromTextNode(o,i));else if(o instanceof l.HTMLElement||o instanceof HTMLElement||l.parent&&o instanceof l.parent.HTMLElement){if(-1===li.indexOf(o.nodeName)){var h=new ai(o,i,n,a++);if(h.isVisible()){"INPUT"===o.tagName?_t(o,h):"TEXTAREA"===o.tagName?jt(o,h):"SELECT"===o.tagName?zt(o,h):h.style.listStyle&&-1!==h.style.listStyle.listStyleType&&Gt(o,h,n);var c="TEXTAREA"!==o.tagName,d=hi(h,o);if(d||ci(h)){var u=d||h.isPositioned()?r.getRealParentStackingContext():r,A=new oi(h,u,d);u.contexts.push(A),c&&e(o,h,A,n,a)}else r.children.push(h),c&&e(o,h,r,n,a)}}}else if(o instanceof l.SVGSVGElement||o instanceof SVGSVGElement||l.parent&&o instanceof l.parent.SVGSVGElement){var p=new ai(o,i,n,a++),f=hi(p,o);if(f||ci(p)){var m=f||p.isPositioned()?r.getRealParentStackingContext():r,g=new oi(p,m,f);m.contexts.push(g)}else r.children.push(p)}}}(e,r,n,t,1),n}(s,o),c=s.ownerDocument;return l===h.container.style.background.backgroundColor&&(h.container.style.background.backgroundColor=p),o.ready().then(function(e){var t=new ui(c),o=c.defaultView,d=o.pageXOffset,u=o.pageYOffset,A="HTML"===s.tagName||"BODY"===s.tagName?U(n):D(s,d,u),p=A.width,f=A.height,m=A.left,g=A.top,w={backgroundColor:l,fontMetrics:t,imageStore:e,logger:r,scale:i.scale,x:"number"==typeof i.x?i.x:m,y:"number"==typeof i.y?i.y:g,width:"number"==typeof i.width?i.width:Math.ceil(p),height:"number"==typeof i.height?i.height:Math.ceil(f)};if(Array.isArray(i.target))return Promise.all(i.target.map(function(e){return new Di(e,w).render(h)}));var b=new Di(i.target,w).render(h);return!0===i.removeContainer&&a.parentNode&&a.parentNode.removeChild(a),b})})})};function vr(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var yr=function(e,t){var i=t||{},r=new b("boolean"!=typeof i.logging||i.logging);r.log("html2canvas ".concat("1.0.0-rc.1"));var n=e.ownerDocument;if(!n)return Promise.reject("Provided element is not within a Document");var a=n.defaultView,s={allowTaint:!1,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,scale:a.devicePixelRatio||1,target:new w(i.canvas),useCORS:!1,windowWidth:a.innerWidth,windowHeight:a.innerHeight,scrollX:a.pageXOffset,scrollY:a.pageYOffset};return br(e,function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{},r=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}))),r.forEach(function(t){vr(e,t,i[t])})}return e}({},s,i),r)};yr.CanvasRenderer=w,t.default=yr}]).default},window.html2canvas=r(),e.exports=r();
132
132
  /** @license JSZip v3.1.5 | Copyright (c) 2009-2016 Stuart Knightley <stuart@stuartk.com> [https://stuk.github.io/jszip/] | MIT License [https://raw.github.com/Stuk/jszip/master/LICENSE.markdown] */
133
- var a,s="undefined",o=null,l=!1,h=function(e,t){this.files={},this.root="",e&&this.load(e,t)};h.signature={LOCAL_FILE_HEADER:"PK",CENTRAL_FILE_HEADER:"PK",CENTRAL_DIRECTORY_END:"PK",ZIP64_CENTRAL_DIRECTORY_LOCATOR:"PK",ZIP64_CENTRAL_DIRECTORY_END:"PK",DATA_DESCRIPTOR:"PK\b"},h.defaults={base64:l,binary:l,dir:l,date:o,compression:o},h.support={arraybuffer:typeof ArrayBuffer!==s&&typeof Uint8Array!==s,nodebuffer:!0,uint8array:typeof Uint8Array!==s,blob:function(){if(typeof ArrayBuffer===s)return l;var e=new ArrayBuffer(0);try{return 0===new Blob([e],{type:"application/zip"}).size}catch(e){}try{var t=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder);return t.append(e),0===t.getBlob("application/zip").size}catch(e){}return l}()},h.prototype=function(){var e,t;h.support.uint8array&&"function"==typeof TextEncoder&&"function"==typeof TextDecoder&&(e=new TextEncoder("utf-8"),t=new TextDecoder("utf-8"));var i=function(e){if(e._data instanceof h.CompressedObject&&(e._data=e._data.getContent(),e.options.binary=!0,e.options.base64=!1,"uint8array"===h.utils.getTypeOf(e._data))){var t=e._data;e._data=new Uint8Array(t.length),0!==t.length&&e._data.set(t,0)}return e._data},r=function(t){var r=i(t);if("string"===h.utils.getTypeOf(r)){if(!t.options.binary){if(e)return e.encode(r);if(h.support.nodebuffer)return new Tn(r,"utf-8")}return t.asBinary()}return r},n=function(e){var t=i(this);return null==t?"":(this.options.base64&&(t=h.base64.decode(t)),t=e&&this.options.binary?h.prototype.utf8decode(t):h.utils.transformTo("string",t),e||this.options.binary||(t=h.prototype.utf8encode(t)),t)},a=function(e,t,i){this.name=e,this._data=t,this.options=i};a.prototype={asText:function(){return n.call(this,!0)},asBinary:function(){return n.call(this,!1)},asNodeBuffer:function(){var e=r(this);return h.utils.transformTo("nodebuffer",e)},asUint8Array:function(){var e=r(this);return h.utils.transformTo("uint8array",e)},asArrayBuffer:function(){return this.asUint8Array().buffer}};var s=function(e,t){var i,r="";for(i=0;i<t;i++)r+=String.fromCharCode(255&e),e>>>=8;return r},o=function(){var e,t,i={};for(e=0;e<arguments.length;e++)for(t in arguments[e])arguments[e].hasOwnProperty(t)&&void 0===i[t]&&(i[t]=arguments[e][t]);return i},l=function(e,t,i){var r=c(e),n=h.utils.getTypeOf(t);if(r&&d.call(this,r),i=function(e){return!0===(e=e||{}).base64&&null==e.binary&&(e.binary=!0),(e=o(e,h.defaults)).date=e.date||new Date,null!==e.compression&&(e.compression=e.compression.toUpperCase()),e}(i),i.dir||null==t)i.base64=!1,i.binary=!1,t=null;else if("string"===n)i.binary&&!i.base64&&!0!==i.optimizedBinaryString&&(t=h.utils.string2binary(t));else{if(i.base64=!1,i.binary=!0,!(n||t instanceof h.CompressedObject))throw new Error("The data of '"+e+"' is in an unsupported format !");"arraybuffer"===n&&(t=h.utils.transformTo("uint8array",t))}return this.files[e]=new a(e,t,i)},c=function(e){"/"==e.slice(-1)&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf("/");return t>0?e.substring(0,t):""},d=function(e){return"/"!=e.slice(-1)&&(e+="/"),this.files[e]||l.call(this,e,null,{dir:!0}),this.files[e]},u=function(e,t){var i,n=new h.CompressedObject;return e._data instanceof h.CompressedObject?(n.uncompressedSize=e._data.uncompressedSize,n.crc32=e._data.crc32,0===n.uncompressedSize||e.options.dir?(t=h.compressions.STORE,n.compressedContent="",n.crc32=0):e._data.compressionMethod===t.magic?n.compressedContent=e._data.getCompressedContent():(i=e._data.getContent(),n.compressedContent=t.compress(h.utils.transformTo(t.compressInputType,i)))):((i=r(e))&&0!==i.length&&!e.options.dir||(t=h.compressions.STORE,i=""),n.uncompressedSize=i.length,n.crc32=this.crc32(i),n.compressedContent=t.compress(h.utils.transformTo(t.compressInputType,i))),n.compressedSize=n.compressedContent.length,n.compressionMethod=t.magic,n},A=function(e,t,i,r){i.compressedContent;var n,a,o=this.utf8encode(t.name),l=o!==t.name,c=t.options;n=c.date.getHours(),n<<=6,n|=c.date.getMinutes(),n<<=5,n|=c.date.getSeconds()/2,a=c.date.getFullYear()-1980,a<<=4,a|=c.date.getMonth()+1,a<<=5,a|=c.date.getDate();var d="";return d+="\n\0",d+=l?"\0\b":"\0\0",d+=i.compressionMethod,d+=s(n,2),d+=s(a,2),d+=s(i.crc32,4),d+=s(i.compressedSize,4),d+=s(i.uncompressedSize,4),d+=s(o.length,2),d+="\0\0",{fileRecord:h.signature.LOCAL_FILE_HEADER+d+o,dirRecord:h.signature.CENTRAL_FILE_HEADER+"\0"+d+"\0\0\0\0\0\0"+(!0===t.options.dir?"\0\0\0":"\0\0\0\0")+s(r,4)+o,compressedObject:i}},p=function(){this.data=[]};p.prototype={append:function(e){e=h.utils.transformTo("string",e),this.data.push(e)},finalize:function(){return this.data.join("")}};var f=function(e){this.data=new Uint8Array(e),this.index=0};return f.prototype={append:function(e){0!==e.length&&(e=h.utils.transformTo("uint8array",e),this.data.set(e,this.index),this.index+=e.length)},finalize:function(){return this.data}},{load:function(e,t){throw new Error("Load method is not defined. Is the file jszip-load.js included ?")},filter:function(e){var t,i,r,n,s=[];for(t in this.files)this.files.hasOwnProperty(t)&&(r=this.files[t],n=new a(r.name,r._data,o(r.options)),i=t.slice(this.root.length,t.length),t.slice(0,this.root.length)===this.root&&e(i,n)&&s.push(n));return s},file:function(e,t,i){if(1===arguments.length){if(h.utils.isRegExp(e)){var r=e;return this.filter(function(e,t){return!t.options.dir&&r.test(e)})}return this.filter(function(t,i){return!i.options.dir&&t===e})[0]||null}return e=this.root+e,l.call(this,e,t,i),this},folder:function(e){if(!e)return this;if(h.utils.isRegExp(e))return this.filter(function(t,i){return i.options.dir&&e.test(t)});var t=this.root+e,i=d.call(this,t),r=this.clone();return r.root=i.name,r},remove:function(e){e=this.root+e;var t=this.files[e];if(t||("/"!=e.slice(-1)&&(e+="/"),t=this.files[e]),t)if(t.options.dir)for(var i=this.filter(function(t,i){return i.name.slice(0,e.length)===e}),r=0;r<i.length;r++)delete this.files[i[r].name];else delete this.files[e];return this},generate:function(e){e=o(e||{},{base64:!0,compression:"STORE",type:"base64"}),h.utils.checkSupport(e.type);var t,i,r=[],n=0,a=0;for(var l in this.files)if(this.files.hasOwnProperty(l)){var c=this.files[l],d=c.options.compression||e.compression.toUpperCase(),m=h.compressions[d];if(!m)throw new Error(d+" is not a valid compression method !");var g=u.call(this,c,m),w=A.call(this,l,c,g,n);n+=w.fileRecord.length+g.compressedSize,a+=w.dirRecord.length,r.push(w)}var b;switch(b=h.signature.CENTRAL_DIRECTORY_END+"\0\0\0\0"+s(r.length,2)+s(r.length,2)+s(a,4)+s(n,4)+"\0\0",e.type.toLowerCase()){case"uint8array":case"arraybuffer":case"blob":case"nodebuffer":t=new f(n+a+b.length);break;default:t=new p(n+a+b.length)}for(i=0;i<r.length;i++)t.append(r[i].fileRecord),t.append(r[i].compressedObject.compressedContent);for(i=0;i<r.length;i++)t.append(r[i].dirRecord);t.append(b);var v=t.finalize();switch(e.type.toLowerCase()){case"uint8array":case"arraybuffer":case"nodebuffer":return h.utils.transformTo(e.type.toLowerCase(),v);case"blob":return h.utils.arrayBuffer2Blob(h.utils.transformTo("arraybuffer",v));case"base64":return e.base64?h.base64.encode(v):v;default:return v}},crc32:function(e,t){if(void 0===e||!e.length)return 0;var i="string"!==h.utils.getTypeOf(e),r=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];void 0===t&&(t=0);t^=-1;for(var n=0,a=e.length;n<a;n++)t=t>>>8^r[255&(t^(i?e[n]:e.charCodeAt(n)))];return-1^t},clone:function(){var e=new h;for(var t in this)"function"!=typeof this[t]&&(e[t]=this[t]);return e},utf8encode:function(t){if(e){var i=e.encode(t);return h.utils.transformTo("string",i)}if(h.support.nodebuffer)return h.utils.transformTo("string",new Tn(t,"utf-8"));for(var r=[],n=0,a=0;a<t.length;a++){var s=t.charCodeAt(a);s<128?r[n++]=String.fromCharCode(s):s>127&&s<2048?(r[n++]=String.fromCharCode(s>>6|192),r[n++]=String.fromCharCode(63&s|128)):(r[n++]=String.fromCharCode(s>>12|224),r[n++]=String.fromCharCode(s>>6&63|128),r[n++]=String.fromCharCode(63&s|128))}return r.join("")},utf8decode:function(e){var i=[],r=0,n="string"!==h.utils.getTypeOf(e),a=0,s=0,o=0,l=0;if(t)return t.decode(h.utils.transformTo("uint8array",e));if(h.support.nodebuffer)return h.utils.transformTo("nodebuffer",e).toString("utf-8");for(;a<e.length;)(s=n?e[a]:e.charCodeAt(a))<128?(i[r++]=String.fromCharCode(s),a++):s>191&&s<224?(o=n?e[a+1]:e.charCodeAt(a+1),i[r++]=String.fromCharCode((31&s)<<6|63&o),a+=2):(o=n?e[a+1]:e.charCodeAt(a+1),l=n?e[a+2]:e.charCodeAt(a+2),i[r++]=String.fromCharCode((15&s)<<12|(63&o)<<6|63&l),a+=3);return i.join("")}}}(),h.compressions={STORE:{magic:"\0\0",compress:function(e){return e},uncompress:function(e){return e},compressInputType:o,uncompressInputType:o}},function(){function e(e){return e}function t(e,t){for(var i=0;i<e.length;++i)t[i]=255&e.charCodeAt(i);return t}function i(e){var t=65536,i=[],r=e.length,n=h.utils.getTypeOf(e),a=0,s=!0;try{switch(n){case"uint8array":String.fromCharCode.apply(null,new Uint8Array(0));break;case"nodebuffer":String.fromCharCode.apply(null,new Tn(0))}}catch(e){s=!1}if(!s){for(var o="",l=0;l<e.length;l++)o+=String.fromCharCode(e[l]);return o}for(;a<r&&t>1;)try{"array"===n||"nodebuffer"===n?i.push(String.fromCharCode.apply(null,e.slice(a,Math.min(a+t,r)))):i.push(String.fromCharCode.apply(null,e.subarray(a,Math.min(a+t,r)))),a+=t}catch(e){t=Math.floor(t/2)}return i.join("")}function r(e,t){for(var i=0;i<e.length;i++)t[i]=e[i];return t}h.utils={string2binary:function(e){for(var t="",i=0;i<e.length;i++)t+=String.fromCharCode(255&e.charCodeAt(i));return t},string2Uint8Array:function(e){return h.utils.transformTo("uint8array",e)},uint8Array2String:function(e){return h.utils.transformTo("string",e)},arrayBuffer2Blob:function(e){h.utils.checkSupport("blob");try{return new Blob([e],{type:"application/zip"})}catch(e){}try{var t=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder);return t.append(e),t.getBlob("application/zip")}catch(e){}throw new Error("Bug : can't construct the Blob.")},string2Blob:function(e){var t=h.utils.transformTo("arraybuffer",e);return h.utils.arrayBuffer2Blob(t)}};var n={};n.string={string:e,array:function(e){return t(e,new Array(e.length))},arraybuffer:function(e){return n.string.uint8array(e).buffer},uint8array:function(e){return t(e,new Uint8Array(e.length))},nodebuffer:function(e){return t(e,new Tn(e.length))}},n.array={string:i,array:e,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return new Tn(e)}},n.arraybuffer={string:function(e){return i(new Uint8Array(e))},array:function(e){return r(new Uint8Array(e),new Array(e.byteLength))},arraybuffer:e,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return new Tn(new Uint8Array(e))}},n.uint8array={string:i,array:function(e){return r(e,new Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:e,nodebuffer:function(e){return new Tn(e)}},n.nodebuffer={string:i,array:function(e){return r(e,new Array(e.length))},arraybuffer:function(e){return n.nodebuffer.uint8array(e).buffer},uint8array:function(e){return r(e,new Uint8Array(e.length))},nodebuffer:e},h.utils.transformTo=function(e,t){if(t||(t=""),!e)return t;h.utils.checkSupport(e);var i=h.utils.getTypeOf(t);return n[i][e](t)},h.utils.getTypeOf=function(e){return"string"==typeof e?"string":"[object Array]"===Object.prototype.toString.call(e)?"array":h.support.nodebuffer&&Tn.isBuffer(e)?"nodebuffer":h.support.uint8array&&e instanceof Uint8Array?"uint8array":h.support.arraybuffer&&e instanceof ArrayBuffer?"arraybuffer":void 0},h.utils.isRegExp=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},h.utils.checkSupport=function(e){var t=!0;switch(e.toLowerCase()){case"uint8array":t=h.support.uint8array;break;case"arraybuffer":t=h.support.arraybuffer;break;case"nodebuffer":t=h.support.nodebuffer;break;case"blob":t=h.support.blob}if(!t)throw new Error(e+" is not supported by this browser")}}(),h.CompressedObject=function(){this.compressedSize=0,this.uncompressedSize=0,this.crc32=0,this.compressionMethod=o,this.compressedContent=o},h.CompressedObject.prototype={getContent:function(){return o},getCompressedContent:function(){return o}},h.base64=(a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",{encode:function(e,t){for(var i,r,n,s,o,l,h,c="",d=0;d<e.length;)s=(i=e.charCodeAt(d++))>>2,o=(3&i)<<4|(r=e.charCodeAt(d++))>>4,l=(15&r)<<2|(n=e.charCodeAt(d++))>>6,h=63&n,isNaN(r)?l=h=64:isNaN(n)&&(h=64),c=c+a.charAt(s)+a.charAt(o)+a.charAt(l)+a.charAt(h);return c},decode:function(e,t){var i,r,n,s,o,l,h="",c=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");c<e.length;)i=a.indexOf(e.charAt(c++))<<2|(s=a.indexOf(e.charAt(c++)))>>4,r=(15&s)<<4|(o=a.indexOf(e.charAt(c++)))>>2,n=(3&o)<<6|(l=a.indexOf(e.charAt(c++))),h+=String.fromCharCode(i),64!=o&&(h+=String.fromCharCode(r)),64!=l&&(h+=String.fromCharCode(n));return h}}),void 0!==window.jQuery&&(window.jQuery.fn.webdatarocks=function(e){return(e=e||{}).container=this.get(0),e=window.WebDataRocks?window.WebDataRocks(e):window.PivotApi(e),this.data("webdatarocks",e),e}),void 0!==window.angular&&window.angular.module("webdatarocks",[]).directive("wbrPivot",function(){return{restrict:"A",scope:{report:"=wbrReport",customizeCell:"&wbrCustomizeCell",cellclick:"&wbrCellClick",celldoubleclick:"&wbrCellDoubleClick",dataerror:"&wbrDataError",datafilecancelled:"&wbrDataFileCancelled",dataloaded:"&wbrDataLoaded",datachanged:"&wbrDataChanged",fieldslistclose:"&wbrFieldsListClose",fieldslistopen:"&wbrFieldsListOpen",filteropen:"&wbrFilteropen",fullscreen:"&wbrFullscreen",loadingdata:"&wbrLoadingData",loadinglocalization:"&wbrLoadingLocalization",loadingolapstructure:"&wbrLoadingOlapStructure",loadingreportfile:"&wbrLoadingReportFile",localizationerror:"&wbrLocalizationError",localizationloaded:"&wbrLocalizationLoaded",openingreportfile:"&wbrOpeningReportFile",querycomplete:"&wbrQueryComplete",queryerror:"&wbrQueryError",ready:"&wbrReady",reportchange:"&wbrReportChange",reportcomplete:"&wbrReportComplete",reportfilecancelled:"&wbrReportFileCancelled",reportfileerror:"&wbrReportFileError",reportfileloaded:"&wbrReportFileLoaded",runningquery:"&wbrRunningQuery",update:"&wbrUpdate",beforetoolbarcreated:"&wbrBeforeToolbarCreated"},link:function(e,t,i,r){(r={}).container=t[0],function(e,t){void 0!==e.wbrGlobal&&(t.global=e.wbrGlobal),void 0!==e.wbrWidth&&(t.width=e.wbrWidth),void 0!==e.wbrHeight&&(t.height=e.wbrHeight),void 0!==e.wbrToolbar&&(t.toolbar=!0===e.wbrToolbar||"true"==e.wbrToolbar||"on"==e.wbrToolbar)}(i,r),e.customizeCell&&(r.customizeCell=function(t,i){return e.customizeCell({html:t,data:i})}),e.cellclick&&(r.cellclick=function(t){e.cellclick({cell:t})}),e.celldoubleclick&&(r.celldoubleclick=function(t){e.celldoubleclick({cell:t})}),r.dataerror=e.dataerror,r.datafilecancelled=e.datafilecancelled,r.dataloaded=e.dataloaded,r.datachanged&&(r.datachanged=function(t){e.datachanged({event:t})}),r.fieldslistclose=e.fieldslistclose,r.fieldslistopen=e.fieldslistopen,r.filteropen&&(r.filteropen=function(t){e.filteropen({params:t})}),r.fullscreen&&(r.fullscreen=function(t){e.fullscreen({fullScreenMode:t})}),r.loadingdata=e.loadingdata,r.loadinglocalization=e.loadinglocalization,r.loadingolapstructure=e.loadingolapstructure,r.loadingreportfile=e.loadingreportfile,r.localizationerror=e.localizationerror,r.localizationloaded=e.localizationloaded,r.olapstructureerror=e.olapstructureerror,r.olapstructureloaded=e.olapstructureloaded,r.openingreportfile=e.openingreportfile,r.querycomplete=e.querycomplete,r.queryerror=e.queryerror,e.ready&&(r.ready=function(){e.ready({pivot:n})}),r.reportchange=e.reportchange,r.reportcomplete=e.reportcomplete,r.reportfilecancelled=e.reportfilecancelled,r.reportfileerror=e.reportfileerror,r.reportfileloaded=e.reportfileloaded,r.runningquery=e.runningquery,r.loadingdata=e.loadingdata,r.loadingdata=e.loadingdata,r.loadingdata=e.loadingdata,r.update=e.update,e.beforetoolbarcreated&&(r.beforetoolbarcreated=function(t){e.beforetoolbarcreated({toolbar:t})}),e.report&&(r.report=e.report),e.global&&(r.global=e.global);var n=new WebDataRocks(r)}}}),void 0!==window.React&&(window.WebDataRocksReact={Pivot:React.createClass({propTypes:{global:React.PropTypes.object,width:React.PropTypes.oneOfType([React.PropTypes.string,React.PropTypes.number]),height:React.PropTypes.oneOfType([React.PropTypes.string,React.PropTypes.number]),report:React.PropTypes.oneOfType([React.PropTypes.string,React.PropTypes.object]),toolbar:React.PropTypes.bool,customizeCell:React.PropTypes.func,cellclick:React.PropTypes.func,celldoubleclick:React.PropTypes.func,dataerror:React.PropTypes.func,datafilecancelled:React.PropTypes.func,dataloaded:React.PropTypes.func,datachanged:React.PropTypes.func,fieldslistclose:React.PropTypes.func,fieldslistopen:React.PropTypes.func,filteropen:React.PropTypes.func,fullscreen:React.PropTypes.func,loadingdata:React.PropTypes.func,loadinglocalization:React.PropTypes.func,loadingolapstructure:React.PropTypes.func,loadingreportfile:React.PropTypes.func,localizationerror:React.PropTypes.func,localizationloaded:React.PropTypes.func,olapstructureerror:React.PropTypes.func,olapstructureloaded:React.PropTypes.func,openingreportfile:React.PropTypes.func,querycomplete:React.PropTypes.func,queryerror:React.PropTypes.func,ready:React.PropTypes.func,reportchange:React.PropTypes.func,reportcomplete:React.PropTypes.func,reportfilecancelled:React.PropTypes.func,reportfileerror:React.PropTypes.func,reportfileloaded:React.PropTypes.func,runningquery:React.PropTypes.func,update:React.PropTypes.func,beforetoolbarcreated:React.PropTypes.func},render:function(){return React.DOM.div()},componentDidMount:function(){var e={};e.container=ReactDOM.findDOMNode(this),this.parseProps(e),this.webdatarocks=new window.WebDataRocks(e)},shouldComponentUpdate:function(){return!1},componentWillUnmount:function(){},parseProps:function(e){for(var t in this.props)e[t]=this.props[t]}})}),e.exports&&(e.exports=WebDataRocks)}(Zd,Zd.exports)),Zd.exports}var tu=function(e){var t={};function i(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=e,i.c=t,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=0)}([function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.Pivot=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e},n=function(){function e(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,i,r){return i&&e(t.prototype,i),r&&e(t,r),t}}(),a=l(i(1)),s=l(i(2)),o=l(i(3));function l(e){return e&&e.__esModule?e:{default:e}}var h=t.Pivot=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return i.DOMNodeRef=s.default.createRef(),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"componentDidMount",value:function(){var e=this.DOMNodeRef.current;this.webdatarocks=new o.default(r({},this.props,{container:e}))}},{key:"shouldComponentUpdate",value:function(){return!1}},{key:"componentWillUnmount",value:function(){this.webdatarocks.dispose()}},{key:"render",value:function(){return s.default.createElement("div",{ref:this.DOMNodeRef},"Pivot")}}]),t}(s.default.Component);h.propTypes={beforetoolbarcreated:a.default.func,cellclick:a.default.func,celldoubleclick:a.default.func,customizeCell:a.default.func,datachanged:a.default.func,dataerror:a.default.func,datafilecancelled:a.default.func,dataloaded:a.default.func,fieldslistclose:a.default.func,fieldslistopen:a.default.func,filteropen:a.default.func,fullscreen:a.default.func,global:a.default.object,height:a.default.oneOfType([a.default.string,a.default.number]),loadingdata:a.default.func,loadinglocalization:a.default.func,loadingreportfile:a.default.func,localizationerror:a.default.func,localizationloaded:a.default.func,openingreportfile:a.default.func,querycomplete:a.default.func,queryerror:a.default.func,ready:a.default.func,report:a.default.oneOfType([a.default.string,a.default.object]),reportchange:a.default.func,reportcomplete:a.default.func,reportfilecancelled:a.default.func,reportfileerror:a.default.func,reportfileloaded:a.default.func,runningquery:a.default.func,toolbar:a.default.bool,update:a.default.func,width:a.default.oneOfType([a.default.string,a.default.number])},t.default=h},function(e,t){e.exports=Yd()},function(e,t){e.exports=r},function(e,t){e.exports=eu()}]);const iu=({rows:t,columns:i,title:r="",onClose:n=()=>{}})=>{const a=o(null),{dynamicAmountSymbol:l,decimalCount:h}=ns();const c=s(()=>i.filter(e=>!0!==e?.isAutoSequence&&"SRNO"!==e.accessor),[i]),d=s(()=>{const e={};return c.forEach(t=>{"currency"===t.componentType||t.Cell===Vc?e[t.columnName]={type:"number"}:"date"===t.componentType||t.Cell===Lc||t.Cell===Tc?e[t.columnName]={type:"datetime"}:e[t.columnName]={type:"string"}}),e},[c]),u=s(()=>t&&t.length?t.map(e=>{const{SRNO:t,...i}=e.values;return i}):[],[t]),A=s(()=>{if(!u||!u.length)return[];const e=u.map(e=>{const t={};return c.forEach(i=>{t[i.columnName]=e[i.accessor]}),t});return[d,...e]},[u,c,d]);return e("div",{children:e(tu.Pivot,{ref:a,toolbar:!0,beforetoolbarcreated:function(e){let t=e.getTabs();e.getTabs=function(){t=t.filter(e=>"wdr-tab-connect"!==e.id&&"wdr-tab-open"!==e.id&&"wdr-tab-save"!==e.id&&"wdr-tab-fullscreen"!==e.id),t.push({id:"wdr-tab-fullscreen",title:"Fullscreen",rightGroup:!0,mobile:!1,handler:()=>{var e;document.fullscreenElement?document.exitFullscreen&&document.exitFullscreen():(e=document.documentElement).requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen&&e.msRequestFullscreen()},icon:e.icons.fullscreen},{id:"wdr-tab-close-modal tab",title:"Close",handler:n,rightGroup:!0,icon:'<svg fill="#000000" height="30px" width="30px" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" \n viewBox="0 0 512 512" xml:space="preserve">\n <g>\n <g>\n <polygon points="512,59.076 452.922,0 256,196.922 59.076,0 0,59.076 196.922,256 0,452.922 59.076,512 256,315.076 452.922,512 \n 512,452.922 315.076,256"/>\n </g>\n </g>\n </svg>'});const i=t.map(e=>{if("wdr-tab-export"===e.id){e.menu=e.menu.filter(e=>"wdr-tab-export-print"!==e.id&&"wdr-tab-export-pdf"!==e.id);let t=e.menu.findIndex(e=>"wdr-tab-export-excel"===e.id),i=e.menu.findIndex(e=>"wdr-tab-export-html"===e.id);-1!==t&&(e.menu[t].handler=()=>{a.current?.webdatarocks?.exportTo("excel",{filename:r||"pivot"})}),-1!==i&&(e.menu[i].handler=()=>{a.current?.webdatarocks?.exportTo("html",{filename:r||"pivot"})})}return e});return i}},height:670,customizeCell:function(e,t){e.text="(blank)"===e.text?" ":e.text},report:{formats:[{name:"",decimalPlaces:h,currencySymbol:$o(l),thousandsSeparator:","}],dataSource:{data:A},options:{grid:{type:"flat",showTooltips:!1},drillThrough:!1}}})})};let ru=[];const nu=({label:r,dense:n,columns:a,data:l,loading:c,getRowId:u,defaultColumn:A,allowColumnReordering:p,disableSorting:f,defaultHiddenColumns:m,defaultSortOrder:g,defaultGroupBy:w,multipleActions:b,singleActions:v,doubleClickAction:y,alwaysAvailableAction:B,setGridAction:C,updateGridData:x,hideFooter:F,hideHeader:S,disableGlobalFilter:N,disableGroupBy:E,disableLoader:k,containerHeight:T,occupiedHeight:L,gridProps:I,pageSizes:D,defaultPageSize:U,enablePagination:P,allowRowSelection:R,hideNoDataFound:O,refetchData:Q,hiddenFlag:H,autoRefreshInterval:M,allowFilter:_,filterMeta:j,allowColumnHiding:z,defaultFilter:V,isCusrsorFocused:K,onButtonActionHandel:G,controlsAtBottom:J,actionContextAtBottom:Y,headerToolbarStyle:Z,disableMultipleRowSelect:ee,columnHeaderStyle:te,variant:ie,enablePaginationInput:re,defaultSelectedRowId:ne,footerNote:ae,footerNoteStyles:se,paginationText:oe,searchPlaceholder:le,enableExport:he,subGridLabel:de,hideActionBar:ue,finalMetaData:Ae,externalExportState:pe,onExportModalClose:fe,enablePdfPrint:me,reportTemplateCode:ge,enablePivot:we,handleClickAction:be,RenderSubHeader:ve,subHeaderComponentProps:ye,gridPaperProps:Be,enableEnterToFocus:Ce})=>{const[xe,Fe]=d(V);ru=s(()=>fl(xe,l),[xe,l]);const[Se,Ne]=d(ne),{defaultGridConfig:Ee}=ns(),ke=s(()=>[...a].map(e=>e.pinColumn?{...e,disableResizing:!0}:e).sort((e,t)=>(e.sequence??0)-(t.sequence??0)),[a]),{getTableProps:Te,getTableBodyProps:Le,headerGroups:Ie,prepareRow:De,selectedFlatRows:Ue,rows:Pe,page:Re,gotoPage:Oe,footerGroups:Qe,setPageSize:He,state:Me,setGlobalFilter:_e,preGlobalFilteredRows:je,state:Ve,setSortBy:Ke,columns:qe,toggleAllRowsSelected:Ge,visibleColumns:We}=Gt({initialState:{pageIndex:0,pageSize:U,hiddenColumns:m,sortBy:g,groupBy:w},columns:ke,defaultColumn:A,data:ru,getRowId:u,allowColumnReordering:p,autoResetSortBy:!1,disableSortBy:Boolean(f),disableGlobalFilter:Boolean(N),disableGroupBy:Boolean(E),updateGridData:x,gridProps:I,singleActions:v,setGridAction:C,hiddenFlag:H,loading:c,onButtonActionHandel:G,autoResetGlobalFilter:!1,autoResetPage:!a?.some(e=>Boolean(e?.enableColumnSelection)),globalFilter:(e,t,i)=>((e,t,i,r)=>{const n=i.toLowerCase();return e.filter(e=>t.some(t=>{const i=r.find(e=>e.accessor===t),a=e.values[t];return!ys(a)||"dateTime"!==i?.componentType&&"date"!==i?.componentType?String(a).toLowerCase().includes(n):ze(new Date(a),i.dateFormat??"dd/MM/yyyy hh:mm a").toLowerCase().includes(n)}))})(e,t,i,Ae)},Wt,Jt,Xt,Yt,$t,Zt,ei,ti,ii,((t,i)=>r=>{Boolean(t)&&r.visibleColumns.push(t=>{const r=t.some(e=>"left"===e.pinColumn);return[{id:"selectionCheckbox",Header:t=>e(Rl,{...t,hasLeftPinnedColumn:r,setContextMenuSelectedRowId:i}),Cell:t=>e(Pl,{...t,hasLeftPinnedColumn:r,setContextMenuSelectedRowId:i}),minWidth:40,width:40,maxWidth:40,pinColumn:r?"left":void 0},...t]})})(R&&!ee,Ne)),{pageIndex:Je,pageSize:Xe,sortBy:Ye}=Ve,{authState:$e}=es(),Ze=Ah(),[et,tt]=d(!1),[it,rt]=d(!1),nt=o(null),at=o(null),st=o(null),ot=o(null),lt=P?Re:Pe,{t:ht}=W(),ct=s(()=>Pe.reduce((e,t)=>(t?.original?._hidden||++e,e),0),[Pe]);v=pl(v,ct),b=pl(b,ct),v=Al(v,Ue,$e),b=Al(b,Ue,$e),B=Al(B,Pe,$e,!1,!0);const[dt,ut]=d(null),[At,pt]=d(null),ft=o(0),gt=o(null),wt=(e,t)=>{Oe(t)},bt=e=>{He(Number(e.target.value))};h(()=>{const e=e=>{"Enter"===e.key&&st.current&&st?.current?.click?.()};return window.document.addEventListener("keypress",e),()=>{window.document.removeEventListener("keypress",e)}},[]),h(()=>{const e=setTimeout(()=>{ot.current?.focus?.()},200);return()=>{e&&clearTimeout(e)}},[c]),h(()=>{Ue.length>0&&ee&&JSON.stringify(Ue[0]?.original)!==JSON.stringify(at.current)&&(at.current=Ue[0]?.original,C({name:"_rowChanged",rows:[{data:Ue[0]?.original}]}))},[ee,Ue,C]);const vt=s(()=>{const e=e=>{const t=Ue.length>0&&!Y&&!ue&&R?`calc(${T?.[e]} - 48px)`:T?.[e];return t&&L?.[e]?J||Y&&Ue.length>0?xe.length?`calc(${t} - ${L?.[e]} - 98px)`:`calc(${t} - ${L?.[e]} - 50px)`:xe.length?`calc(${t} - ${L?.[e]} - 48px)`:`calc(${t} - ${L?.[e]})`:xe.length>0?`calc(${t} - 48px)`:t};return{min:e("min"),max:e("max")}},[Ue,Y,ue,T,L,xe,R,J]);h(()=>{if(!ee)return;const e=Ue[0]?.id,t=1===Ue.length&&e===Se,i=!Se&&0===Ue.length;if(!t&&!i&&(Ue.length>0&&Ge(!1),Se)){const e=Pe.find(e=>e.id===Se);e&&!e.isSelected&&e.toggleRowSelected(!0)}},[Pe,Se,ee,Ue]);const yt=s(()=>{if(!We||0===We.length)return{leftMap:{},rightMap:{}};const e=Ve?.columnResizing?.columnWidths??{},t=t=>{const i=e[t.id]??t.totalWidth??t.width??A?.width;return Number.parseFloat(i)||150},i={},r={};let n=0;We.forEach(e=>{"left"===e.pinColumn&&(i[e.id]=n,n+=t(e))});let a=0;return[...We].reverse().forEach(e=>{"right"===e.pinColumn&&(r[e.id]=a,a+=t(e))}),{leftMap:i,rightMap:r}},[We,Ve?.columnResizing?.columnWidths,A?.width]);return t(i,{children:[t(ni,{style:{width:"100%"},...Be,children:[Boolean(S)?null:e(Yl,{label:r,dense:n,preGlobalFilteredRows:je,globalFilter:Me.globalFilter,setGlobalFilter:_e,alwaysAvailableAction:J?[]:B,setGridAction:C,filteredRows:Pe,selectedFlatRows:Ue,disableGlobalFilter:Boolean(N),refetchData:Q,autoRefreshInterval:M,gotoPage:Oe,setSortBy:Ke,allowFilter:_,filters:xe,setAllFilters:Fe,filterMeta:j,visibleColumns:qe,defaultHiddenColumns:m,allowColumnHiding:z,loading:c,headerToolbarStyle:Z,searchPlaceholder:le,enableExport:he&&lt?.length,setOpenExport:tt,subGridLabel:de,enablePivot:we&&lt?.length,setOpenPivot:rt,RenderSubHeader:ve,subHeaderComponentProps:ye}),ve&&!ye.__showInHeader?e(ve,{...ye}):null,Boolean(Y)||ue||!R?null:e(Ql,{dense:n,selectedFlatRows:Ue,multipleActions:b,singleActions:v,setGridAction:C,submitButtonRef:st,loading:c}),e(Ml,{contextMenuRow:At,selectedFlatRows:Ue,singleActions:v,multipleActions:b,setGridAction:C,mouseX:dt?.mouseX??null,mouseY:dt?.mouseY??null,handleClose:()=>{pt(null),ut(null)},authState:$e}),e(hh,{dense:n,setAllFilters:Fe,filters:xe,gotoPage:Oe,setSortBy:Ke}),k?null:c?e(mt,{color:"secondary"}):e(sh,{}),t(si,{style:{position:"relative",display:"inline-block",overflow:"auto",padding:"outlined"===ie?"0 .5rem":"",maxHeight:vt.max,minHeight:vt.min,borderBottom:F?"":"1px solid rgba(133, 130, 130, 0.8)"},children:[t(oi,{component:"div",...Te(),size:n?"small":"medium",children:[e($l,{component:"div",sx:{background:te?.background?te?.background:te?.backgroundColor?te?.backgroundColor:"standard"!==ie?"var(--theme-color4)":"white"},children:Ie.map(t=>e(hi,{sx:{background:"inherit"},component:"div",...t.getHeaderGroupProps(),children:t.headers.map(t=>e(th,{variant:ie,column:t,rows:lt,pinnedOffsets:yt,visibleColumns:We,children:t.render("Header")},t.getHeaderProps().key))}))}),t(di,{component:"div",ref:nt,...Le([{style:{display:"block"}}]),onContextMenu:e=>{ct<=0&&(v.length>0||b.length>0)&&(e.preventDefault(),pt({}),Ne(""),ut(null===dt?{mouseX:e.clientX-2,mouseY:e.clientY-4}:null))},style:{height:`calc(${vt.min} - 62px)`},children:[lt.length<=0&&!1===O?e(q,{container:!0,justifyContent:"center",children:e("div",{style:{position:"absolute",left:"50%",height:`calc(${vt.min} - 50px)`,display:"flex",alignItems:"center",fontStyle:"italic",color:"rgba(133, 130, 130, 0.8)"},children:ht("Nodatafound")})}):null,lt.map((t,i)=>{if(Boolean(t?.original?.[H]))return null;De(t);const r=(e=>t=>{t.preventDefault(),pt(e),Ne(e?.id),ut(null===dt?{mouseX:t.clientX-2,mouseY:t.clientY-4}:null)})(t),n=(e=>t=>{t.preventDefault(),void 0!==Al(y,[e],$e,!0)&&C({name:y.actionName,rows:[{data:e?.original,id:e?.id}]})})(t),a=((e,t,i)=>r=>{if("INPUT"!==r?.target?.tagName&&"TEXTAREA"!==r?.target?.tagName&&"BUTTON"!==r?.target?.tagName){if("Enter"!==r.key&&"Tab"!==r.key&&r.preventDefault(),"Space"===r.code&&Boolean(y)&&Ee?.enableDoubleSpaceAction)if(ft.current+=1,2===ft.current){if(void 0===Al(y,[i],$e,!0))return;C({name:y.actionName,rows:[{data:i?.original,id:i?.id}]}),ft.current=0}else gt.current&&clearTimeout(gt.current),gt.current=setTimeout(()=>{ft.current=0},300);"ArrowUp"===r.key&&t>0?e[t-1]?.id&&(Ge(!1),e[t-1].toggleRowSelected(!0),Ne(e[t-1]?.id),r?.target?.previousElementSibling?.focus?.()):"ArrowDown"===r.key&&t<e.length-1&&e[t+1]?.id&&(Ge(!1),e[t+1].toggleRowSelected(!0),Ne(e[t+1].id),r?.target?.nextElementSibling?.focus?.())}})(lt,i,t);let s=[];Boolean(t?.original?._rowColor)&&(s=[{style:{background:t?.original?._rowColor}}]),Boolean(t?.original?._style)&&(s=[{style:{...s[0]?.style,...t?.original?._style}}]),K&&(s.length>0?s[0].style.cursor="pointer":s=[{style:{cursor:"pointer"}}]);const o=Boolean(t.isSelected)||Se===t.id;return e(Zl,{...t.getRowProps(s),id:t.id,tabIndex:0,component:"div",ref:t.isSelected||Se===t.id?ot:null,selected:o,onKeyDown:a,onContextMenu:e=>{Ge(!1),t.toggleRowSelected(!0),r(e)},onDoubleClick:Boolean(y)?n:void 0,onClick:e=>{Boolean(ee)&&(Ge(!1),t.toggleRowSelected(!0),Ne(t.id)),"function"==typeof be&&be(e,{data:t?.original,id:t?.id})},className:"outlined"===ie?Ze.outlinedClass:null,sx:{"& > .MuiTableCell-root":{border:"outlined"===ie?"none !important":"auto"},background:t?.original?._rowColor?`${t?.original?._rowColor} !important`:o?"#ccc !important":""},children:t.cells.map(e=>{const{key:t}=e.getCellProps();return e.isAggregated?e.render("Aggregated",{key:t,pinnedOffsets:yt,visibleColumns:We}):e.render("Cell",{key:t,pinnedOffsets:yt,visibleColumns:We})})})})]}),e(({footerGroup:t})=>Array.isArray(t?.headers)&&t.headers.some(e=>e.isTotalWithCurrency||e.isTotalWithoutCurrency||e.isSelectedTotal)?e(ce,{component:"div",style:{color:"var(--theme-color2)",background:"var(--theme-color4)",position:"sticky",bottom:0},children:e(hi,{...t.getFooterGroupProps(),component:"div",children:t.headers.map(t=>e(ci,{...t.getFooterProps({style:{textAlign:t?.TableCellProps?.align||"unset",display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"0px 10px",lineHeight:"22px",fontWeight:700,fontSize:"small",color:"var(--theme-color3)"}}),component:"div",children:t.render("Footer")},t.id))})}):null,{footerGroup:Qe[0]})]}),e(oh,{open:Boolean(c)})]}),ae&&e(X,{component:"div",fontWeight:500,pl:"24px",sx:se,children:ht(ae)}),F?null:P&&Pe.length>U?e(Vi,{sx:{display:"flex","& .MuiToolbar-root":{display:"flex",alignItems:"baseline",minHeight:"44px"}},variant:"body",component:"div",rowsPerPageOptions:[...new Set([U,...D])]?.sort((e,t)=>e-t),colSpan:3,count:Pe.length,rowsPerPage:Number(Xe),page:Number(Je),onPageChange:wt,onRowsPerPageChange:bt,ActionsComponent:re?nh:rh}):t(ci,{style:{display:"flex",padding:"8px"},children:[ht("TotalNoofRecords")," ",ht(oe),": ",ct]}),Boolean(J)||Boolean(Y)?t("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",padding:Ue.length>0||J?".5rem":0,paddingTop:0},children:[Boolean(J)&&e(Hl,{actions:B,setAction:C,selectedRows:Ue.map(e=>({data:e.original,id:e.id})),filteredRows:Pe,buttonTextColor:"#fff",buttonBackground:"var(--theme-color1)",loading:c},"alwaysRender"),Boolean(Y)&&1===Ue.length?e(Hl,{actions:v,setAction:C,selectedRows:Ue.map(e=>({data:e.original,id:e.id})),buttonTextColor:"#fff",buttonBackground:"var(--theme-color1)",style:{border:"1px solid var(--theme-color3)",width:"8rem"},submitButtonRef:st,loading:c},"singleFilters"):null,Boolean(Y)&&Ue.length>0?e(Hl,{actions:b,setAction:C,selectedRows:Ue.map(e=>({data:e.original,id:e.id})),buttonTextColor:"#fff",buttonBackground:"var(--theme-color1)",submitButtonRef:st,loading:c},"multipleFilters"):null]}):null]}),it?e($,{open:!0,fullScreen:!0,children:e(iu,{rows:Pe,title:r,columns:Ae,onClose:()=>rt(!1)})}):null,et||pe?e($,{open:et||pe,children:e(Bd,{globalFilter:Me.globalFilter??"",filters:xe,title:r,rows:Pe,columns:Ae,onClose:()=>{tt(!1),"function"==typeof fe&&fe()},enablePdfPrint:me,reportTemplateCode:l?.find(e=>e?.REPORT_PERSONALIZATION_ID)?.REPORT_PERSONALIZATION_ID??ge,enableEnterToFocus:Ce})}):null]})};function au(e,t,i="en-IN",r=0,n="start",a=" "){const s=new Intl.NumberFormat(i,{minimumFractionDigits:r}).format(e);return"end"===n?`${s} ${t} ${a}`:`${t} ${s} ${a}`}const su=t=>{const i=ns(),{dynamicAmountSymbol:r,currencyFormat:n,decimalCount:a}=i,{value:s,row:o,column:{isCurrencyCode:l,currencyRefColumn:h,currencySymbolPosition:c}}=t;let d="";l?d=$o(h??r):o&&(d=$o(o?.original?.[h]||r));let u="";return null===s||""===s||isNaN(Number(s))||(u=`${au(s,d,n,a,c)}`),e(ho,{...t,children:u})},ou=(e,t,i,r=0)=>`${i} ${new Intl.NumberFormat(t,{minimumFractionDigits:r}).format(e)}`,lu=A(({rows:e,column:{id:r,isTotalWithoutCurrency:n=!1,isTotalWithCurrency:a=!1,totalDecimalCount:o,isSelectedTotal:l=!1,setFooterValue:h,footerLabel:c="",footerIsMultivalue:d=!1,currencyRefColumn:u,isCurrencyCode:A,Cell:p}})=>{const f=ns();let m=c,g=e.filter(e=>!e.original.ignoreValue);const w=s(()=>g.reduce((e,t)=>Number(t.values?.[r]??0)+e,0),[g,r]),b=e.filter(e=>e.isSelected),v=s(()=>b.reduce((e,t)=>Number(t.values?.[r]??0)+e,0),[b,r]);let y=n?"":$o(f.dynamicAmountSymbol);a&&(A?y=$o(u??f.dynamicAmountSymbol):e?.[0]?.original?.[u]&&(y=$o(e?.[0]?.original?.[u]??"")));const B=s(()=>{if(!h)return isNaN(w)?"":p===su?ou(w,f.currencyFormat,y,o??f.decimalCount):w;if("function"==typeof h){const e=h(w,g,f);return d?(Array.isArray(e)&&e?.forEach((e,t)=>{m=m.replace(`{${t}}`,e)}),m):isNaN(e)?0:e}},[b,v,w,g]),C=isNaN(v)?"":p===su?ou(v,f.currencyFormat,y,o??f.decimalCount):v;return t(i,{children:[(a||n)&&""!==B&&t("span",{style:{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:m.includes("\n")?"pre-line":"nowrap",textAlign:"center"},children:[`${Boolean(m)?m:""}`," ",!d&&B]}),l&&""!==C&&t("span",{style:{paddingLeft:"10px"},children:["Selected Total: ",C]})]})}),hu=c((t,i)=>e(jl,{children:e(cu,{...t,ref:i})})),cu=c(({finalMetaData:t,data:i,setData:r,actions:n,setAction:a,loading:c,gridProps:d,refetchData:u,defaultSortOrder:A=[],defaultGroupBy:f=[],defaultFilter:m=[],hideHeader:g=!1,hideFooter:w=!1,autoRefreshInterval:b=0,onClickActionEvent:v=()=>{},controlsAtBottom:y=!1,actionContextAtBottom:B=!1,headerToolbarStyle:C={},disableMultipleRowSelect:x=!1,columnHeaderStyle:F={},variant:S,defaultSelectedRowId:N="",enableExport:E=!1,fieldDataRef:k=null,externalExportState:T=!1,onExportModalClose:L,reportTemplateCode:I,enablePivot:D,handleClickAction:U,RenderSubHeader:P,subHeaderComponentProps:R={},focusScopeId:O="enter-to-focus-static-grid",enableEnterToFocus:Q},H)=>{const{authState:M}=es(),{defaultGridConfig:_,defaultExportConfig:j,enableEnterToFocus:z}=ns(),{pause:V,resume:K}=zl(),q=o(null),{t:G}=W();null===q.current&&(q.current=du({metaData:t,actions:n,setAction:a,authState:M,fieldDataRef:k}));let J=o(i);J.current=i;let X=q.current;const Y=s(()=>Array.isArray(X.columns)?X.columns.map(e=>({...e,columnName:G(e.columnName)})):X.columns??[],[G]),$=s(()=>Array.isArray(X.filters)?X.filters.map(e=>({...e,columnName:G(e.columnName)})):X.filters??[],[G]),Z=s(()=>m,[m]),ee=s(()=>Y.reduce((e,t)=>(e[t.accessor]=t.validation,e),{}),[Y]),te=s(()=>Y.reduce((e,t)=>(e[t.accessor]="",e),{}),[Y]),ie=s(()=>({width:150,maxWidth:200,minWidth:50,Header:Cl,Footer:lu,...X?.gridConfig?.defaultColumnConfig}),[X?.gridConfig?.defaultColumnConfig]),re=l(e=>e[X?.gridConfig?.rowIdColumn],[X?.gridConfig?.rowIdColumn]),ne=s(()=>A,[]),ae=s(()=>f,[]),se=l((e,t,i,n,a,s="S")=>{let o=0;r(r=>r?.map((l,h)=>{if(!("A"===s||h===e))return Boolean(l?._hidden)||(o+=1),{...l,_displaySequence:o};let c=!0,d="";if(c=(!Boolean(r?.[h]?._oldData?.[t])||!Boolean(i)||r?.[h]?._oldData?.[t]!==i)&&(!!Boolean(r?.[h]?._isTouchedCol?.[t])||(!(!Boolean(r[h]?.[t])||Boolean(i))||(!(!Boolean(r[h]?.[t])||!Boolean(i)||r[h]?.[t]==i)||!(Boolean(r[h]?.[t])||!Boolean(i))))),c){let e=r?.[h]?._oldData?.[t];d=null==e?r?.[h]?.[t]??"":e}else d=r?.[h]?._oldData?.[t]??"";let u={...r[h],[t]:i,_touched:{...r?.[h]?._touched,[t]:n},_error:{...r?.[h]?._error,[t]:a},_isTouchedCol:{...r?.[h]?._isTouchedCol,[t]:c},_oldData:{...r?.[h]?._oldData}};return c&&(u={...u,_oldData:{...u._oldData,[t]:d}}),"_hidden"!==t&&(o+=1),{...u,_displaySequence:o}}))},[r]),oe=l(()=>Array.isArray(J.current)?J.current.map(e=>{const{_touched:t,_error:i,_rowColor:r,_style:n,...a}=e;return a}):[],[]),le=l(async(e,t)=>{let i=!1,r=Object.keys(ee);if(!Array.isArray(e))return{isValid:i,data:[]};let n=e.map(async(n,a)=>{let s=X?.gridConfig?.hiddenFlag;if(Boolean(n?.[s]))return n;const o=n._touched??{},l=n._error??{};for(let h=0;h<r.length;h++){const c=o[r[h]],d=l[r[h]],u=n[r[h]],A=ee[r[h]];if(Boolean(c)&&!1===t){if(!Boolean(d))continue;i=!0}else if("function"==typeof A){let t=await A(u,n,e.slice(0,a).filter(e=>!0!==Boolean(e[s])),e.slice(a+1).filter(e=>!0!==Boolean(e[s])));Boolean(t)&&(i=!0),o[r[h]]=!0,l[r[h]]=t}}return{...n,_touched:o,_error:l}}),a=await Promise.all(n);return{hasError:i,data:a}},[]),he=l(async e=>le(J.current,e),[]),ce=l((e,t)=>{v(e,t,i[e])},[i]);p(H,()=>({validate:(e=!1)=>he(e),validator:()=>le,cleanData:()=>oe(),columns:te,pause:V,resume:K,refetch:u,updateGridData:se}));const de=o(null),ue=Q??z,Ae=O&&ue?{"data-scope-id":O}:{};return h(()=>{ue&&de.current&&de.current.focus()},[ue]),Array.isArray(i)?e("div",{ref:de,tabIndex:ue?0:-1,onKeyDown:e=>{ue&&Es(e,O)},style:{width:"100%",position:"relative"},...Ae,children:e(nu,{label:X.gridConfig?.gridLabel?G(X.gridConfig.gridLabel):Ss(window.location.pathname,M?.menulistdata??[],X?.gridConfig?.setScreenCode??!0,X?.gridConfig?.showUserCode??!1),dense:!0,getRowId:re,columns:Y,defaultColumn:ie,data:i,loading:c,allowColumnReordering:X.gridConfig?.allowColumnReordering,disableSorting:X?.gridConfig?.disableSorting,defaultHiddenColumns:X.hiddenColumns,defaultSortOrder:ne,defaultGroupBy:ae,multipleActions:X?.multipleActions,singleActions:X?.singleActions,handleClickAction:U,doubleClickAction:X?.doubleClickAction,alwaysAvailableAction:X?.alwaysAvailableAction,setGridAction:X?.setAction,updateGridData:se,hideFooter:X?.gridConfig?.hideFooter??w,hideHeader:X?.gridConfig?.hideHeader??g,containerHeight:X?.gridConfig?.containerHeight,occupiedHeight:X?.gridConfig?.occupiedHeight,allowRowSelection:X?.gridConfig?.allowRowSelection??!0,disableGlobalFilter:X?.gridConfig?.disableGlobalFilter,disableGroupBy:X?.gridConfig?.disableGroupBy,disableLoader:X?.gridConfig?.disableLoader,pageSizes:X?.gridConfig?.pageSizes??[5,10],defaultPageSize:X?.gridConfig?.defaultPageSize??10,enablePagination:X?.gridConfig?.enablePagination??!1,hideNoDataFound:X?.gridConfig?.hideNoDataFound??!1,hiddenFlag:X?.gridConfig?.hiddenFlag,gridProps:d,refetchData:u,autoRefreshInterval:b,allowFilter:X.gridConfig?.allowFilter??!1,filterMeta:$,allowColumnHiding:X.gridConfig?.allowColumnHiding??!1,defaultFilter:Z,isCusrsorFocused:X.gridConfig?.isCusrsorFocused??!1,onButtonActionHandel:ce,controlsAtBottom:y,actionContextAtBottom:B,headerToolbarStyle:C,disableMultipleRowSelect:x,columnHeaderStyle:F,variant:S??_?.variant??"standard",enablePaginationInput:X.gridConfig?.enablePaginationInput??_?.enablePaginationInput??!0,defaultSelectedRowId:N,searchPlaceholder:X.gridConfig?.searchPlaceholder??"records",paginationText:X.gridConfig?.paginationText??"records",enableExport:E,footerNote:X.gridConfig?.footerNote??"",footerNoteStyles:X.gridConfig?.footerNoteStyles??{},subGridLabel:G(X.gridConfig?.subGridLabel??""),hideActionBar:X.gridConfig.hideActionBar??!1,finalMetaData:t.columns.map(e=>({...e,columnName:G(e.columnName)})),externalExportState:T,onExportModalClose:L,enablePdfPrint:X?.gridConfig?.enablePdfPrint??j?.enablePdfPrint??!1,reportTemplateCode:I,enablePivot:D,RenderSubHeader:P,subHeaderComponentProps:R,gridPaperProps:X?.gridConfig?.gridPaperProps??{},enableEnterToFocus:ue})}):e("div",{children:"Invalid data received"})});hu.displayName="GridWrapper";const du=({metaData:e,actions:t,setAction:i,authState:r,fieldDataRef:n})=>{let a=N(e),s=(e=>Rs(e,fa,gl,wl))(a),o=s.columns;const l=cl(o);o=(e=>Array.isArray(e)?e.map(e=>{const{schemaValidation:t,...i}=e;return{...i,schemaValidation:vl(t)}}):[])(o),o=uo(o),o=oo(o),o=((e,t,i)=>Array.isArray(e)?e.map(e=>{const{schemaValidation:r,validation:n,...a}=e;return{...a,validation:Bl(r,n,t,i)}}):[])(o,r,n),o=dl(o);let h=a.filters;try{h=hl(h)}catch(e){console.log(e)}const c=ul(t??null);return{hiddenColumns:l,columns:o,gridConfig:a.gridConfig,setAction:i,filters:h,...c}},uu=e=>[{columnName:"FileName",componentType:e?"editableTextField":"default",accessor:"name",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Size",componentType:"default",accessor:"sizeStr",sequence:2,alignment:"left",width:100,maxWidth:100,minWidth:100},{columnName:"Type",componentType:"default",accessor:"fileExt",sequence:3,alignment:"left",width:100,maxWidth:100,minWidth:100}],Au={columns:[{columnName:"File ID",componentType:"default",accessor:"id",sequence:0,alignment:"left",isVisible:!1},...uu(!1)],gridConfig:{dense:!0,gridLabel:"Files",rowIdColumn:"id",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!0,disableGlobalFilter:!0,disableGroupBy:!0,disableLoader:!0,hideHeader:!0,containerHeight:{min:"40vh",max:"50vh"}}},pu={columns:[{columnName:"File ID",componentType:"default",accessor:"id",sequence:0,alignment:"left",isVisible:!1},{columnName:"File Name",componentType:"default",accessor:"name",sequence:1,alignment:"left",width:400,maxWidth:400,minWidth:400},{columnName:"Size",componentType:"default",accessor:"sizeStr",sequence:2,alignment:"left",width:100,maxWidth:100,minWidth:100},{columnName:"Type",componentType:"default",accessor:"fileExt",sequence:3,alignment:"left",width:100,maxWidth:100,minWidth:100},{columnName:"Reason",componentType:"default",accessor:"failedReason",sequence:4,alignment:"left",width:300,maxWidth:300,minWidth:300}],gridConfig:{dense:!0,gridLabel:"Failed To Add These Files For Upload",rowIdColumn:"id",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,allowRowSelection:!1,disableGlobalFilter:!0,disableSorting:!0,disableGroupBy:!0,hideHeader:!0}},fu=Ci(e=>({uploadWrapper:{backgroundImage:"url(\"data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' stroke='%232538584A' stroke-width='4' stroke-dasharray='8' stroke-dashoffset='4' stroke-linecap='square'/%3e%3c/svg%3e\")",display:"flex",alignItems:"center",justifyContent:"center",padding:e.spacing(4)}})),mu=({disabled:e})=>({pointerEvents:e?"none":"all",opacity:e?.5:1}),gu=r=>{const n=fu(),{onDrop:a,disabled:s,existingFiles:l,accept:h,multiple:c}=r,d=o(null),{t:u}=W(),[{canDrop:A,isOver:p},f]=bt({accept:[gt.FILE],drop(e,t){if("function"==typeof a){const e=Array.from(t.getItem().files);a(e,l)}},collect:e=>({isOver:e.isOver(),canDrop:e.canDrop()})}),m=A&&p;return e("div",{ref:f,style:mu({disabled:Boolean(s)}),className:n.uploadWrapper,children:m?e(vt,{children:u("DropFileshere")}):t(i,{children:[e(vt,{children:u("DragandDropor")}),e(ct,{color:"secondary",onClick:()=>d?.current?.click(),children:u("Browse")}),e("input",{type:"file",multiple:c,accept:Array.isArray(h)?h?.map(e=>`.${e}`).join(","):`.${h}`,style:{display:"none"},ref:d,onChange:e=>{const t=e.target.files,i=Array.from(t);a(i,l)},onClick:e=>{e.target.value=""}})]})})};function wu(e){var t=0;if(0===e.length)return t;for(var i=0;i<e.length;i++){t=(t<<5)-t+e.charCodeAt(i),t&=t}return t}function bu(e){return wu([e.name,e.type,e.size,e.lastModified].join("-"))}const vu=e=>{if(Number.isInteger(Number(e))){let t=`${e} bytes`;const i=["KB","MB","GB","TB","PB","EB","ZB","YB"];for(let r=0,n=e/1024;n>1;n/=1024,r++)t=`${n.toFixed(2)} ${i[r]}`;return t}return"cannot compute size"},yu=async e=>{var t;return await(t=e,new Promise((e,i)=>{try{const r=new FileReader;r.onloadend=i=>{const r=new Uint8Array(i?.target?.result).subarray(0,4);let n,a="";for(let e=0;e<r.length;e++){let t=r[e].toString(16);t.length<2&&(t="0"+t),a+=t}switch(a=a.toUpperCase(),a){case"FFD8FFE0":case"FFD8FFE1":case"FFD8FFE2":case"FFD8FFE3":n={ext:"jpg",mime:"image/jpeg"};break;case"89504E47":n={ext:"png",mime:"image/png"};break;case"47494638":n={ext:"gif",mime:"image/gif"};break;case"25504446":n={ext:"pdf",mime:"application/pdf"};break;case"504B0304":n={ext:t.name.split(".").pop()??"xlsx",mime:t.type??"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};break;case"494433":n={ext:"mp3",mime:"audio/mpeg"};break;case"66747970":n={ext:"mp4",mime:"video/mp4"};break;case"52494646":n={ext:"wav",mime:"audio/wav"};break;case"74657874":n={ext:"txt",mime:"text/plain"};break;default:return void e(void 0)}e(n)},r.onerror=i,r.readAsArrayBuffer(t.slice(0,4))}catch(e){i(void 0)}}))};const Bu=(e,t)=>"all"===t||Array.isArray(t)&&t.indexOf(e)>-1,Cu=(e,t)=>Array.isArray(t)&&t.indexOf(e.id)>-1;function xu(e,t){const i="object"==typeof e&&URL.createObjectURL(e),r=document.createElement("a");r.href=String(i),r.download=t??e.name??`download-${(new Date).getUTCMilliseconds()}`;const n=()=>{setTimeout(()=>{URL.revokeObjectURL(String(i)),r.removeEventListener("click",n)},150)};r.target="_blank",r.addEventListener("click",n,!1),r.click()}const Fu=(e,t,i)=>{const r=N(e);if(Boolean(i))for(let e=0;e<r.columns.length;e++)"name"===r.columns[e].accessor&&(r.columns[e].componentType="editableTextField");return Array.isArray(t)&&(r.columns=[...e.columns,...t]),r},Su=e=>{if(Array.isArray(e)){return e.reduce((e,t)=>(e[t.accessor]="",e),{})}return{}},Nu=(e,t,i)=>async(r,n)=>{let a=[],s=r.map(t=>e(t)),o=await Promise.all(s),l=[];Array.isArray(n)&&(l=n.map(e=>e.id));let h=o.filter(e=>e.size>t?(a.push({...e,failedReason:"File Size exceed maximum size"}),!1):Bu(e.fileExt,i)?!Cu(e,l)||(a.push({...e,failedReason:"File already added for uploading"}),!1):(a.push({...e,failedReason:"File type is not allowed"}),!1));return{failedFiles:a,filteredNewFilesObj:h}},Eu=e=>async t=>{const i=await yu(t);return{...e,id:bu(t),blob:t,name:t.name.split(".").slice(0,-1).join("."),sizeStr:vu(t.size),size:t.size,mimeType:t.type,_mimeType:i?.mime??t.type,ext:i?.ext??t.name.split(".").pop(),fileExt:t.name.split(".").pop()}},ku=e=>Array.isArray(e)?e.map(e=>{const{id:t,blob:i,name:r,sizeStr:n,size:a,mimeType:s,_mimeType:o,ext:l,fileExt:h,...c}=e;return{name:`${r}.${l}`,blob:i,ext:l,id:t,...c}}):[],Tu=async e=>{let t=[];if(!Array.isArray(e)||0===e.length)return t;for(let i=0;i<e.length;i++){const{blob:r,...n}=e[i];let a=await fs(r);t.push({...n,blob:a[1],blobtype:a[0]})}return t},Lu=e=>{const t=new FormData;if(!Array.isArray(e)||0===e.length)return t;const i={};for(let r=0;r<e.length;r++){const{blob:n,id:a,...s}=e[r];t.append("blob",n,`${a}`),i[`${a}`]=s}return t.append("metaData",JSON.stringify(i)),t},Iu=e=>{const t=e[0]?.map((e,t)=>({accessor:e,columnName:e,sequence:t+1,componentType:"default",width:180,minWidth:120,maxWidth:600,showTooltip:!0}));let i=[];return t&&(i=[{columnName:"UNIQUE",accessor:"UNIQUE",componentType:"default",isVisible:!1},...t]),i},Du=e=>{const t=e.slice(1).map(t=>t.reduce((t,i,r)=>({...t,[e[0][r]]:i}),{}));let i=[];return t&&(i=t.map((e,t)=>({UNIQUE:t+1,...e}))),i},Uu=e=>({gridConfig:{gridLabel:"",rowIdColumn:"UNIQUE",defaultColumnConfig:{width:400,maxWidth:450,minWidth:300},hideHeader:!0,disableGroupBy:!0,enablePagination:!0,pageSizes:[15,30,50],defaultPageSize:15,containerHeight:{min:"67vh",max:"70vh"},allowFilter:!1,allowColumnHiding:!1,allowRowSelection:!1},columns:Iu(e)??[]}),Pu=({blob:i,fileName:r,onClose:n})=>{const[a,s]=d([]),[o,l]=d(!1);return h(()=>{(()=>{const e=new FileReader;l(!0),e.onload=e=>{const t=e.target.result,i=tt.read(t,{type:"binary",raw:!1}),r=i.SheetNames[0],n=i.Sheets[r],a=tt.utils.sheet_to_json(n,{header:1,raw:!1}).map(e=>e.map(e=>{const t=Fs(e,!0);return t instanceof Date&&Ve(t)?t.toLocaleDateString("en-UK"):e}));l(!1),s(a)},i?e.readAsBinaryString(i):s([])})()},[]),t(f,{children:[t(At,{style:{display:"flex",padding:"8px 24px"},children:[e(vt,{variant:"h6",color:"textSecondary",children:"File:"}),e(vt,{variant:"h6",children:r}),e("div",{style:{flexGrow:1}}),"function"==typeof n?e(C,{color:"secondary",onClick:n,children:e(Bt,{})}):null]}),t(pt,{children:[o?e(no,{}):null,a.length>0?e(cu,{finalMetaData:Uu(a??[]),data:Du(a)??[],setData:()=>null},"previewExcelFileData"):e("p",{style:{textAlign:"center",color:"#888"},children:e("em",{children:o?"File is Loading...":"Empty file found!!!"})})]})]})},Ru=({blob:i,fileName:r,onClose:n})=>{const[a,s]=d([]),[o,l]=d(!1);return h(()=>{(async()=>{l(!0),Ct.parse(i,{header:!1,skipEmptyLines:!0,complete:e=>{l(!1);const t=e.data.map(e=>e.map(e=>{const t=Fs(e,!0);return t instanceof Date&&Ve(t)?t.toLocaleDateString("en-UK"):e}));s(t)},error:e=>{l(!1),s([])}})})()},[]),t(f,{children:[t(At,{style:{display:"flex",padding:"8px 24px"},children:[e(vt,{variant:"h6",color:"textSecondary",children:"File:"}),e(vt,{variant:"h6",children:r}),e("div",{style:{flexGrow:1}}),"function"==typeof n?e(C,{color:"secondary",onClick:n,children:e(Bt,{})}):null]}),t(pt,{children:[o?e(no,{}):null,a.length>0?e(cu,{finalMetaData:Uu(a??[]),data:Du(a)??[],setData:()=>null},"previewCsvFileData"):e("p",{style:{textAlign:"center",color:"#888"},children:e("em",{children:o?"File is Loading...":"Empty file found!!!"})})]})]})},Ou=({blob:r,fileName:n,onClose:a,optionalActionButton:s,hideDownloadBtn:o=!1,hideFilename:l=!1,contentStyle:c,actionStyle:u})=>{const{t:A}=W(),[p,m]=d("object"==typeof r&&Boolean(r)?URL.createObjectURL(r):null);return h(()=>{let e=p??"";return()=>{URL.revokeObjectURL(e)}},[]),h(()=>{m("object"==typeof r&&Boolean(r)?URL.createObjectURL(r):null)},[r]),t(f,{children:[t(At,{style:{display:"flex",padding:"8px 24px",...u},children:[l?null:t(i,{children:[t(vt,{variant:"h6",color:"textSecondary",children:[A("File"),":"]}),e(vt,{variant:"h6",children:n})]}),e("div",{style:{flexGrow:1}}),Boolean(s)?e(eo,{color:"primary",onClick:()=>{"function"==typeof s?.callback&&s.callback()},children:s?.label??"NO_LABEL"}):null,o&&e(C,{color:"secondary",onClick:()=>xu(r,n),children:e(yt,{})}),"function"==typeof a?e(C,{color:"secondary",onClick:a,children:e(Bt,{})}):null]}),e(pt,{style:{...c},children:e("iframe",{title:"Document Preview",src:`${p}`,style:{height:"100%",width:"100%"},"aria-label":"PDF Preview"})})]})},Qu=({blob:r,fileName:n,onClose:a,hideFilename:s,canZoom:o=!0})=>{const[l,c]=d("object"==typeof r&&Boolean(r)?URL.createObjectURL(r):""),[u,A]=d(1);return h(()=>{let e=l??"";return()=>URL.revokeObjectURL(e)},[]),h(()=>{c("object"==typeof r&&Boolean(r)?URL.createObjectURL(r):"")},[r]),t(f,{children:[t(At,{style:{display:"flex",padding:"8px 24px"},children:[s?null:t(i,{children:[e(vt,{variant:"h6",color:"textSecondary",children:"File:"}),e(vt,{variant:"h6",children:n})]}),e("div",{style:{flexGrow:1}}),o?t(i,{children:[e(C,{color:"secondary",onClick:()=>A(e=>Math.max(e-.25,.25)),children:e(Ft,{})}),e(C,{color:"secondary",onClick:()=>A(1),children:e(St,{})}),e(C,{color:"secondary",onClick:()=>A(e=>Math.min(e+.25,4)),children:e(xt,{})})]}):null,e(C,{color:"secondary",onClick:()=>xu(r,n),children:e(yt,{})}),"function"==typeof a?e(C,{color:"secondary",onClick:a,children:e(Bt,{})}):null]}),e(pt,{children:e("img",{src:l,alt:"Preview",style:{transform:`scale(${u})`,transition:"transform 0.2s ease",transformOrigin:"top left",maxWidth:"100%",width:"60%",maxHeight:"80vh"}})})]})},Hu=({onClose:i,fileName:r,message:n})=>t(f,{children:[t(At,{style:{display:"flex",padding:"8px 24px"},children:[e(vt,{variant:"h6",color:"textSecondary",children:"File:"}),e(vt,{variant:"h6",children:r}),e("div",{style:{flexGrow:1}}),"function"==typeof i?e(C,{color:"secondary",onClick:i,children:e(Bt,{})}):null]}),e(pt,{children:n})]}),Mu=[{actionName:"Delete",actionLabel:"Delete",multiple:!0,rowDoubleClick:!1},{actionName:"View",actionLabel:"ViewFile",multiple:!1,rowDoubleClick:!1}],_u=({additionalColumns:i,editableFileName:r,onClose:n,onUpload:a,dataChangedRef:c,allowedExtensions:u=["pdf"],maxAllowedSize:A=3145728,gridProps:p,defaultFileData:m=[],onUpdateFileData:g=e=>{},allowMultipleFilesSelection:w=!1})=>{const b=s(()=>Fu(Au,i,r),[]),v=s(()=>Su(i),[]),y=l(e=>Eu(v)(e),[v]),[B,C]=d(m),[x,F]=d(""),[S,N]=d([]),[E,k]=d(!1),[T,L]=d(null),[I,D]=d(!1),[U,P]=d(1/0),R=o(null),{t:O}=W(),Q=l(async(e,t)=>{let{filteredNewFilesObj:i,failedFiles:r}=await Nu(y,A,u)(e,t);C(e=>w?[...e,...i]:i),r.length>0&&(N(r),k(!0))},[C,N,k,y,A,u]);h(()=>{if("Delete"===T?.name){const e=T?.rows?.map?.(e=>e.id),t=B.filter(t=>e.indexOf(t.id)<0);C(t),L(null)}},[T]),h(()=>{g(B)},[B]);const H=l(async e=>{try{let{hasError:t,data:i}=await(R?.current?.validate?.(!0));if(!0===t)return void C(i);let r=R?.current?.cleanData?.(),a=ku(r),s=Lu(a);D(!0),F(""),P(1/0);let o=await Tu(r);await Promise.resolve(e(s,e=>{P(e)},({status:e,data:t})=>{"success"===e?(c.current=!0,n()):F(t?.error_msg??"Unknown error occurred"),P(1/0)},o,r))}catch(e){console.error("Upload failed:",e),F(e?.message||"File upload failed due to a network or server error."),P(1/0)}finally{D(!1)}},[D,F,C]);return t(f,{children:[I?e(mt,{variant:U===1/0?"indeterminate":"determinate",value:U,color:"secondary"}):null,t(at,{children:[e(lt,{title:O("FileUpload"),action:t(ot,{children:[e("div",{style:{flexGrow:2}}),"function"==typeof a?e(ct,{disabled:I||B.length<=0,size:"small",color:"secondary",onClick:()=>H(a),endIcon:I?e(G,{size:20,color:"secondary"}):null,children:O("Upload")}):null,e(ct,{disabled:I||B.length<=0,onClick:()=>C([]),size:"small",color:"secondary",children:O("ClearAll")}),"function"==typeof n?e(ct,{disabled:I,onClick:()=>{let e=R?.current?.cleanData?.();g(e),n()},size:"small",color:"secondary",children:O("Close")}):null]})}),Boolean(x)?e(ft,{severity:"error",children:x}):null,t(st,{children:[e(gu,{existingFiles:B,onDrop:Q,disabled:I,multiple:w,accept:u}),e(ht,{in:B.length>0,children:e(hu,{finalMetaData:b,data:B,setData:C,actions:Mu,setAction:L,loading:I,ref:R,gridProps:p})})]})]}),t(dt,{open:E,maxWidth:"lg",children:[e(ut,{children:O("FailedToAddFollowingFilesForUpload")}),e(pt,{children:e(hu,{finalMetaData:pu,data:S,setData:e=>null})}),e(At,{children:e(ct,{color:"secondary",onClick:()=>{k(!1),N([])},children:O("Ok")})})]}),e(dt,{open:Boolean(T),maxWidth:"lg",onClose:()=>L(null),PaperProps:{style:{width:"100%",height:"100%"}},children:T?.rows[0]?.data?._mimeType?.includes("pdf")?e(Ou,{blob:T?.rows[0]?.data?.blob,fileName:T?.rows[0]?.data?.name,onClose:()=>L(null)}):T?.rows[0]?.data?._mimeType?.includes("image")?e(Qu,{blob:T?.rows[0]?.data?.blob,fileName:T?.rows[0]?.data?.name,onClose:()=>L(null)}):"xlsx"===T?.rows[0]?.data?.ext||"xls"===T?.rows[0]?.data?.ext?e(Pu,{blob:T?.rows[0]?.data?.blob,fileName:T?.rows[0]?.data?.name,onClose:()=>L(null)}):"csv"===T?.rows[0]?.data?.ext?e(Ru,{blob:T?.rows[0]?.data?.blob,fileName:T?.rows[0]?.data?.name,onClose:()=>L(null)}):e(Hu,{fileName:T?.rows[0]?.data?.name,onClose:()=>L(null),message:"No preview available for this file"})})]})},ju=[{actionName:"View",actionLabel:"ViewFile",multiple:!1,rowDoubleClick:!1}],zu=({additionalColumns:i,editableFileName:r,fileData:n,onClose:a,gridProps:l})=>{const h=s(()=>Fu(Au,i,r),[]),[c,u]=d(n??[]),[A,p]=d(null),m=o(null),{t:g}=W();return t(f,{children:[e(at,{children:t(st,{children:[e(lt,{title:g("FileViewer"),action:t(ot,{children:[e("div",{style:{flexGrow:2}}),"function"==typeof a?e(ct,{disabled:!1,onClick:()=>a(),size:"small",color:"secondary",children:g("Close")}):null]})}),e(hu,{finalMetaData:h,data:c,setData:u,actions:ju,setAction:p,loading:!1,ref:m,gridProps:l})]})}),e(dt,{open:Boolean(A),maxWidth:"lg",onClose:()=>p(null),PaperProps:{style:{width:"100%",height:"100%"}},children:A?.rows[0]?.data?._mimeType?.includes("pdf")?e(Ou,{blob:A?.rows[0]?.data?.blob,fileName:A?.rows[0]?.data?.name,onClose:()=>p(null)}):A?.rows[0]?.data?._mimeType?.includes("image")?e(Qu,{blob:A?.rows[0]?.data?.blob,fileName:A?.rows[0]?.data?.name,onClose:()=>p(null)}):e(Hu,{fileName:A?.rows[0]?.data?.name})})]})},Vu=({open:t,closeDialog:r,setImportedData:n})=>{const[a,s]=d(!0),[o,l]=d([]),h=()=>{r()};return e(i,{children:a?e($,{fullWidth:!0,maxWidth:"md",open:t,children:e(_u,{onClose:()=>{h()},additionalColumns:[],editableFileName:!1,defaultFileData:[],onUpload:(e,t,i,r,a)=>{r.length>0?(t(10),setTimeout(async()=>{try{(async(e,t)=>{t(20);let i=80/(e.length>0?e.length:1),r=[];e.forEach((e,n)=>{let a=so({data:e}),{blob:s,...o}=e,l=((e,t,i,r)=>(i(r-10),t))(0,a,t,10+i*(n+1));r=[...r??[],...l]}),t(95),t(100),l(r),n(r),setTimeout(()=>{s(!1),h()},1e3),t(97),r=r.filter(e=>Boolean(e?._isNewRow)),t(99),r=r.map((e,t)=>({...e,TRAN_CD:t+1}))})(r,t)}catch(e){i({status:"failed",data:{error_msg:"Error in file read "+String(e)}})}},1e3)):i({status:"failed",data:{error_msg:"Error in file read"}})},gridProps:{},maxAllowedSize:12328960,allowedExtensions:["xlsx","csv"],onUpdateFileData:e=>{}},"GridFileUploadData")}):null})},Ku=e=>{const{data:t,index:i,style:r}=e;return g(t[i],{style:{...r,whiteSpace:"pre",width:"max-content",minWidth:"100%",top:r.top+8}})},qu=n({}),Gu=c((t,i)=>{const r=a(qu);return e("div",{ref:i,...t,...r})}),Wu=c((t,i)=>{const{children:r,...n}=t,a=b.toArray(r),s=re(),l=Si(s.breakpoints.up("sm"),{noSsr:!0}),c=a.length,d=l?29.5:48,u=()=>d,A=(e=>{const t=o(null);return h(()=>{null!==t.current&&t.current.resetAfterIndex(0,!0)},[e]),t})(c);return e("div",{ref:i,children:e(qu.Provider,{value:n,children:e(Ni,{itemData:a,height:(c>8?10*d:a.map(u).reduce((e,t)=>e+t,0))+16,width:"100%",ref:A,outerElementType:Gu,innerElementType:"ul",itemSize:u,overscan:5,itemCount:c,children:Ku})})})});var Ju=Object.freeze({__proto__:null,ListBoxComponent:Wu});const Xu=[{actionName:"close",actionLabel:"Close",multiple:void 0,alwaysAvailable:!0},{actionName:"close-dbl",actionLabel:"Close",multiple:void 0,alwaysAvailable:!1,rowDoubleClick:!0}],Yu=(e=[],t={})=>({gridConfig:{dense:!0,gridLabel:"SelectAValue",rowIdColumn:"UNIQUE_ID",defaultColumnConfig:{width:440,maxWidth:450,minWidth:300},allowColumnReordering:!0,disableSorting:!1,hideHeader:!1,disableGroupBy:!0,enablePagination:!0,pageSizes:[10,20,30],defaultPageSize:10,containerHeight:{min:"53vh",max:"53vh"},allowFilter:!0,allowColumnHiding:!1,allowRowSelection:!1,isCusrsorFocused:!0},columns:[{accessor:"UNIQUE_ID",columnName:"SrNo",sequence:0,componentType:"default",width:70,minWidth:60,maxWidth:100},...e.length>0?Object.keys(e[0]).map((e,i)=>({accessor:e,columnName:e,sequence:i+1,componentType:"default",width:150,minWidth:100,showTooltip:!0,...t[e]})):[]],filters:e.length>0?Object.keys(e[0]).filter(e=>!1!==t[e]?.isVisible).map(e=>({accessor:e,columnName:t[e]?.columnName??e,filterComponentType:"valueFilter",gridProps:{xs:12,md:12,sm:12}})):[]}),$u=({handleClose:t,options:i,optionsGridColDef:r})=>{const n=s(()=>i.map(e=>{const{label:t,value:i,REPORT_PERSONALIZATION_ID:r,...n}=e;return{label:t,value:i,...n}}),[i]),a=l(e=>{if("close"===e?.name)t();else if("close-dbl"===e?.name){const i=e?.rows[0]?.data?.value??void 0;t(i)}},[]),o=s(()=>n.map((e,t)=>({...e,UNIQUE_ID:t+1})),[n]);return h(()=>{const e=setTimeout(()=>{const e=document.querySelectorAll(".gridwrapper_global_search input");e.length>0&&e[e.length-1].focus()},100);return()=>clearTimeout(e)},[]),e($,{open:!0,className:"optionsGrid",PaperProps:{style:{width:"100%",padding:"8px"}},maxWidth:"md",onKeyUp:e=>{"Escape"===e.key&&t()},children:e(hu,{finalMetaData:Yu(n,r),data:o??[],setData:()=>null,actions:Xu,setAction:a,enableExport:!0},"optionsGrid")})},Zu=vi(ue)({[`& .${fi.listbox}`]:{boxSizing:"border-box","& ul":{padding:0,margin:0}}}),eA=Ci(e=>({root:{"& .MuiInputBase-root.MuiAutocomplete-inputRoot":{paddingRight:"0 !important"},"& .MuiInputBase-root > .MuiAutocomplete-endAdornment":{display:"none"}}})),tA=e=>t=>Boolean(e)?t:t?.label??"",iA=({name:r,validate:n,validationRun:a,shouldExclude:c,isReadOnly:A,postValidationSetCrossFieldValues:p,skipValueUpdateFromCrossFieldWhenReadOnly:m,runPostValidationHookAlways:g,dependentFields:b,fieldKey:v,options:y,GridProps:B,enableGrid:C,multiple:x,disableClearable:F,freeSolo:S,TextFieldProps:N,CircularProgressProps:E,ChipProps:k,showCheckbox:L,CreateFilterOptionsConfig:I,runValidationOnDependentFieldsChange:D,label:U,placeholder:P,limitTags:R,required:O,enableVirtualized:Q,isFieldFocused:H,_optionsKey:M,disableCaching:_,disableAdornment:j,ignoreInSubmit:z=!1,textFieldStyle:V,setFieldLabel:K,defaultValueKey:W,listBoxMinWidth:X,listBoxMaxWidth:Y,setValueOnDependentFieldsChange:$,setValueOnDependentFieldsValueChange:Z,runExternalFunction:ee,onFormDataChange:te,componentType:ie,optionsGridColDef:re,runPostValidationForInitValue:ae,className:se,skipInitialDefaultValueKeyValidation:oe=!1,filterOptionsCb:he,dependentFieldDebounceDelay:ce=300,setColor:ue,customLabelKey:Ae,...pe})=>{const{enableOptionsGridForAutocomplete:fe,refetchOptionsWhenOnline:me}=ns(),[ge,we]=d(B),[be,ve]=d(!1),[ye,Be]=d(!1),{formState:Ce,error:xe,touched:Fe,handleChange:Se,handleBlur:Ne,runValidation:Ee,isSubmitting:ke,validationRunning:Te,fieldKey:Le,name:Ie,dependentValues:De,readOnly:Ue,excluded:Pe,incomingMessage:Re,whenToRunValidation:Oe,value:Qe,prevValue:He,setIncomingMessage:Me,setIgnoreInSubmit:_e,handleOptionValueExtraData:je,setErrorAsCB:ze,setValue:Ve,setFilteredOptions:Ke}=as({name:r,fieldKey:v,dependentFields:b,validate:n,validationRun:a,runPostValidationHookAlways:g,postValidationSetCrossFieldValues:p,isReadOnly:A,shouldExclude:c,runValidationOnDependentFieldsChange:D,skipValueUpdateFromCrossFieldWhenReadOnly:m,runExternalFunction:ee,onFormDataChange:te,componentType:ie,runPostValidationForInitValue:ae,dependentFieldDebounceDelay:ce}),qe=o(),We=eA(),Je=o(-1),Xe=o(new Map),Ye=l(e=>Boolean(S)?e:Ae&&e?.[Ae]?e[Ae]:e?.label??"",[S,Ae]),$e=l((e=>t=>Boolean(e)?t:t?.value??"")(S),[]),[Ze,et]=d("string"==typeof ue?ue:""),tt=l((e,t)=>{if(Array.isArray(e)||(e=[e]),t)return e;return e.map(e=>Xe.current.has(`${e}`)?Xe.current.get(`${e}`):{label:e,value:e})},[]);h(()=>{if("function"==typeof ue){const e=ue(Qe,ds(De),Ce);et("string"!=typeof e?"":e)}},[Qe,De,ue]),h(()=>{if(Boolean(z))if("function"==typeof z){let e=z(ds(De),Ce,{isSubmitting:ke,value:Qe});_e(e)}else _e(z)},[z,_e,De,Qe]);const it=()=>{setTimeout(()=>{qe?.current?.focus?.()},50)};h(()=>{H&&it()},[H]),h(()=>{const e=e=>{if(!ye)return;const t=document.querySelector(`.${fi.listbox}`),i=e.target;t&&(t===i||t.contains(i))||Be(!1)};return window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("scroll",e,!0)}},[ye]);const[rt,nt]=d([]),[at,st]=d([]),ot=l(e=>So(rt)(e),[rt]),lt=l(e=>{if(Xe.current.clear(),"function"==typeof e)nt(t=>{let i=e(t);return S&&Array.isArray(i)?i.map(e=>tA(!1)(e)):(Array.isArray(i)&&i.map(e=>{Xe.current.set(`${$e(e)}`,e)}),i)});else{if(S&&Array.isArray(e)){let t=e.map(e=>tA(!1)(e));return void nt(t)}Array.isArray(e)&&e.map(e=>{Xe.current.set(`${$e(e)}`,e)}),st(e),Ke(e),nt(e)}},[st,nt,Ye,$e]),ht=l(()=>{let e=ot(Qe);je(e),Ne()},[Ne,ot,je,Qe]),ct=(e,t)=>{if(Ue||ke)return;t||(Je.current=-1),Array.isArray(t)||(t=[t]),t=S?t.map(e=>Ye(e)??""):t.map(e=>$e(e)??"");let i=ot(t);je(i),!Boolean(x)&&Array.isArray(t)?Se(t[0],void 0,!1,{optionData:i}):Se(t,void 0,!1,{optionData:i})},dt=l(e=>{"backspace"!==e.key.toLowerCase()&&"escape"!==e.key.toLowerCase()||(Je.current=-1),"tab"===e.key.toLowerCase()&&-1!==Je.current&&rt[Je.current]&&ye&&ct(0,rt[Je.current]),"f9"===e.key.toLowerCase()&&fe&&rt.length&&ve(!0)},[Ye,rt,ct,Je.current]),{loadingOptions:ut,queryError:At,refetchOptions:pt}=Bo(Ce,y,lt,Se,De,Re,Ee,Oe,M,_,Me,!0,"",!1);h(()=>{let e=ot(Qe);je(e)},[ut,ot,je]),h(()=>{if("function"!=typeof he)return;const e=he(at,ds(De),Ce)??at;nt(e),Ke(e)},[De,Ce,at,he,Ke]),h(()=>{if(null!==Re&&"object"==typeof Re){const{error:e,isErrorBlank:t,isFieldFocused:i,GridProps:r}=Re;if("object"==typeof r){const e={...B,xs:r?.xs??B?.xs??"auto",md:r?.md??B?.md??"auto",xl:r?.xl??r?.md??B?.xl??"auto",sm:r?.sm??B?.sm??"auto",lg:r?.lg??r?.md??B?.lg??"auto"};we(e)}i&&it(),t?ze(""):Boolean(e)&&ze(e)}},[Re,ze]);const ft=s(()=>{if("function"==typeof K)return K(ds(De),Qe)},[K,De,Qe]);h(()=>{if(!W||Qe||ut)return;const e=rt.find(e=>e[W]===e.value);if(e){let t=e;Array.isArray(t)||(t=[t]),t=S?t.map(e=>Ye(e)??""):t.map(e=>$e(e)??"");let i=ot(t);je(i),!Boolean(x)&&Array.isArray(t)?Ve(t[0],void 0,void 0,{defaultKeyValue:oe?t[0]:void 0}):Ve(t,void 0,void 0,{defaultKeyValue:oe?t:void 0}),oe||setTimeout(()=>{ht()},30)}},[ut,rt]);const mt=s(()=>{const e=ds(De),t=us(e);return JSON.stringify(t.sort((e,t)=>e.fieldKey.localeCompare(t.fieldKey)).map(e=>e.value))},[De]);h(()=>{if(!mt)return;(async()=>{if("function"==typeof Z)try{let e=await Z(ds(De),Ce,{value:Qe,isSubmitting:ke});if(null!=e){const t=Boolean(e)?rt?.find(t=>e===t.value):null;ct(0,t)}}catch(e){console.error("An error occurred:",e)}})()},[mt,Z,Se]),h(()=>{(async()=>{if("function"==typeof $)try{let e=await $(ds(De),Ce,{value:Qe,isSubmitting:ke});if(null!=e){const t=Boolean(e)?rt?.find(t=>e===t.value):null;ct(0,t)}}catch(e){console.error("An error occurred:",e)}})()},[De,Se,$]);const gt=()=>{"function"==typeof pt&&pt()};h(()=>{const e=()=>{At&&me&&gt()};return window.addEventListener("online",e),()=>window.removeEventListener("online",e)},[At,me]);const wt=l(e=>Fo(rt)(e),[rt]),bt=s(()=>tt(Qe,S),[Qe,S,rt]);if(Pe)return null;const vt=Fe&&""!==(xe??""),yt=t(w,{fallback:"loading...",children:[u(Ai,{...pe,className:j?We.root:"",key:Le,id:Le,defaultValue:[],limitTags:R??2,multiple:x,autoHighlight:!0,open:ye,onOpen:()=>Be(!0),onClose:()=>Be(!1),disableClearable:F,options:rt,freeSolo:S,getOptionLabel:Ye,value:ut?x?[]:null:x?bt:bt.length>0?bt[0]:null,isOptionEqualToValue:(e,t)=>S?e===t:e.value===t.value,PopperComponent:Zu,ListboxComponent:Boolean(Q)?Wu:void 0,PaperComponent:({children:t})=>e("div",{style:{width:"fit-content",background:"white",boxShadow:"rgba(50, 50, 93, 0.25) 0px 2px 5px -1px, rgba(0, 0, 0, 0.3) 0px 1px 3px -1px",overflow:"hidden",maxWidth:Y||"320px",minWidth:X?`max(${X}px, 100%)`:"max(120px, 100%)"},children:t}),onKeyDown:dt,onChange:ct,onBlur:()=>{Je.current=-1,ht()},onHighlightChange:(e,t)=>{Je.current="mousemove"!==e?.type?rt.indexOf(t):-1},disabled:ke||Ue,filterOptions:Boolean(I)&&"object"==typeof I?pi(I):(e,t)=>{const i=t.inputValue.toLowerCase();return e.filter(e=>e.label.toLowerCase().includes(i)).sort((e,t)=>{const r=e.label.toLowerCase().startsWith(i),n=t.label.toLowerCase().startsWith(i);return r&&!n?-1:!r&&n?1:0})},renderTags:(e,t)=>e.map((e,i)=>u(gi,"string"==typeof e?{variant:"outlined",...k,label:e,...t({index:i}),key:e}:{variant:"outlined",...k,label:Ye(e),...t({index:i}),key:`${e.label}-${i}`})),renderInput:r=>{const n=e(Ao,{...N,...r,name:Ie,className:J(se,{hasOldValue:void 0!==He&&void 0!==Qe&&!T.isEqual(He,Qe)}),inputRef:qe,label:ft?.label?Ge(ft.label):U,placeholder:Ue?"":ft?.placeholder?Ge(ft.placeholder)??"":P,autoComplete:"off",type:"text",error:!ke&&vt,required:O,helperText:e(le,{children:!ke&&vt?xe:null}),sx:{"& .MuiInputBase-root":{background:Boolean(Ue||ke)?"#f3f3f3 !important":""},...V},InputProps:{...r.InputProps,endAdornment:t(f,{children:[Te||ut?e(G,{sx:{position:"absolute",right:j?"0.5rem":"1.5rem"},size:25,color:"secondary",variant:"indeterminate",...E}):null,At?e(i,{children:e(de,{onClick:()=>gt(),size:"small",sx:{left:"10px"},title:Ge("refetch")??"",children:e(ki,{fontSize:"small",color:"error"})})}):null,r.InputProps.endAdornment]})},InputLabelProps:{shrink:!0},inputProps:{...r.inputProps,autoComplete:"off",style:{...!ke&&Boolean(Ze)?{color:Ze}:{}}}});return e(i,{children:void 0===He||void 0===Qe||T.isEqual(He,Qe)?n:e(Jo,{title:e(Xo,{label:`${Ge("OldValueOf")} ${ft?.label?Ge(ft.label):U}`,value:He?wt(He)??He:"(blank)"}),arrow:!0,followCursor:!0,children:n})})},renderOption:(i,r,n)=>{i.key=i.id;let{selected:a,inputValue:s}=n,o=r?.label??"";const l=wi(o,s),h=bi(o,l).map((t,i)=>e("span",{style:{fontWeight:t.highlight?700:400,...r?.style??{}},children:t.text},i));return Q?t("li",{style:{whiteSpace:"pre",width:"max-content",minWidth:"100%"},...i,children:[L?e(go,{checked:a}):null,h]}):e(ne,{title:r.label,disableInteractive:!0,children:t("li",{style:{whiteSpace:"pre",width:"max-content",minWidth:"100%"},...i,children:[L?e(go,{checked:a}):null,h]})})}}),be?e($u,{handleClose:e=>{if(e){const t=e?rt?.find(t=>e===t.value):null;ct(0,t)}ve(!1)},options:rt,optionsGridColDef:re}):null]});return Boolean(C)?e(q,{...ge,children:yt}):yt},rA=m(()=>Promise.resolve().then(function(){return Ju}).then(e=>({default:e.ListBoxComponent}))),nA=e=>t=>Boolean(e)?t:t?.label??"",aA=({options:i,optionsProps:r,multiple:n,disableClearable:a,freeSolo:s,CircularProgressProps:h,ChipProps:c,showCheckbox:A,CreateFilterOptionsConfig:p,placeholder:m="Select Option",limitTags:g,required:b,enableVirtualized:v,_optionsKey:y,disableCaching:B,error:C,handleChange:x,handleBlur:F,touched:S,value:N,fullWidth:E,disableAdornment:k,isAutoFocus:T,...L})=>{const I=o(-1),D=o(new Map),U=eA(),P=l(nA(s),[]),R=l((e=>t=>Boolean(e)?t:t?.value??"")(s),[]),O=l((e,t)=>{if(Array.isArray(e)||(e=[e]),t)return e;return e.map(e=>D.current.has(`${e}`)?D.current.get(`${e}`):{label:e,value:e})},[]),[Q,H]=d([]),M=(e,t)=>{t||(I.current=-1),Array.isArray(t)||(t=[t]),t=s?t.map(e=>P(e)??""):t.map(e=>R(e)??""),!Boolean(n)&&Array.isArray(t)?x(t[0]):x(t)},_=l(e=>{"backspace"!==e.key.toLowerCase()&&"escape"!==e.key.toLowerCase()||(I.current=-1),"tab"===e.key.toLowerCase()&&-1!==I.current&&Q[I.current]&&M(0,Q[I.current])},[P,Q,M,I.current]),j=l(e=>{if(D.current.clear(),"function"==typeof e)H(t=>{let i=e(t);return s&&Array.isArray(i)?i.map(e=>nA(!1)(e)):(Array.isArray(i)&&i.map(e=>{D.current.set(`${R(e)}`,e)}),i)});else{if(s&&Array.isArray(e)){let t=e.map(e=>nA(!1)(e));return void H(t)}Array.isArray(e)&&e.map(e=>{D.current.set(`${R(e)}`,e)}),H(e)}},[H,P,R]),{loadingOptions:z}=Co(i,j,y,B,r,!0,"",!1),V=S&&""!==(C??"");return e(w,{fallback:"loading...",children:e(Ai,{...L,className:k?U.root:"",defaultValue:[],limitTags:g??2,multiple:n,disableClearable:a,options:Q,autoHighlight:!0,freeSolo:s,getOptionLabel:P,value:z?[]:n?O(N,s):O(N,s)[0],isOptionEqualToValue:(e,t)=>s?e===t:e.value===t.value,PaperComponent:({children:t})=>e("div",{style:{width:"fit-content",background:"white",boxShadow:"rgba(50, 50, 93, 0.25) 0px 2px 5px -1px, rgba(0, 0, 0, 0.3) 0px 1px 3px -1px",overflow:"hidden",maxWidth:"320px",minWidth:"max(120px, 100%)"},children:t}),ListboxComponent:Boolean(v)?rA:void 0,onKeyDown:_,onChange:M,onBlur:()=>{I.current=-1,F()},onHighlightChange:(e,t)=>{I.current="mousemove"!==e?.type?Q.indexOf(t):-1},filterOptions:Boolean(p)&&"object"==typeof p?pi(p):(e,t)=>{const i=t.inputValue.toLowerCase();return e.filter(e=>e.label.toLowerCase().includes(i)).sort((e,t)=>{const r=e.label.toLowerCase().startsWith(i),n=t.label.toLowerCase().startsWith(i);return r&&!n?-1:!r&&n?1:0})},renderTags:(e,t)=>e.map((e,i)=>u(gi,"string"==typeof e?{variant:"outlined",...c,label:e,...t({index:i}),key:e}:{variant:"outlined",...c,label:e.label,...t({index:i}),key:`${e.label}-${i}`})),renderInput:i=>e(mi,{...i,...i.InputProps,placeholder:m,autoComplete:"disabled",type:"text",error:V,required:b,fullWidth:E,autoFocus:T,disableUnderline:!0,endAdornment:t(f,{children:[z?e(G,{size:25,color:"secondary",variant:"indeterminate",...h}):null,i.InputProps.endAdornment]})}),renderOption:(i,r,n)=>{i.key=i.id;let{selected:a,inputValue:s}=n,o=P(r);const l=wi(o,s),h=bi(o,l).map((t,i)=>e("span",{style:{fontWeight:t.highlight?700:400},children:t.text},i));return e(ne,{title:o,children:t("li",{style:{whiteSpace:"pre",width:"max-content",minWidth:"100%"},...i,children:[A?e(go,{checked:a}):null,h]})})}})})},sA=({options:t,MenuItemProps:i,SelectProps:r,multiple:n,showCheckbox:a,CircularProgressProps:s,handleBlur:o,handleChange:h,error:c,touched:A,value:p,loading:f,readOnly:m,_optionsKey:g,disableCaching:w,optionsProps:b,skipDefaultOption:v=!1,defaultOptionLabel:y,enableDefaultOption:C=!1,...x})=>{const[F,S]=d([]),N=Boolean(A)&&Boolean(c),{loadingOptions:E}=Co(t,S,g,w,b,v,y,C),k=l(e=>Fo(F)(e),[F]),T=l(e=>{const t="object"==typeof e?e?.target?.value??"":e;let i=k(t);i=n?i:i[0],"00"===t&&(e.target.value=""),h(e,i)},[h,k,n]),L=F.map((t,r)=>u(K,{...i,key:t.value??r,value:t.value,disabled:t.disabled,style:{fontWeight:"00"===t.value?500:"inherit"}},a?e(go,{checked:Boolean(n)?Array.isArray(p)&&p.indexOf(t.value)>=0:p===t.value}):null,t.label));return e(Ti,{...x,value:n&&!Array.isArray(p)?[p]:Boolean(p)?p:"string"==typeof p?"00":p,error:N,onChange:T,onBlur:o,native:!1,multiple:n,renderValue:n?Fo(F,!0):void 0,style:{fontWeight:"00"===(n&&!Array.isArray(p)?[p]:Boolean(p)?p:"string"==typeof p?"00":p)?"500":""},input:e(mi,{sx:{"& > .MuiSvgIcon-root.MuiSelect-icon":{right:"-0.5px"}},endAdornment:f||E?e(B,{position:"end",children:e(G,{color:"primary",variant:"indeterminate",...s})}):null,disableUnderline:!0}),readOnly:m,IconComponent:r?.IconComponent,children:L})};function oA(t){const{inputRef:i,onChange:r,MaskProps:n,...a}=t;return e(Li,{...a,inputRef:i,onAccept:(e,t)=>{r({target:{value:t.unmaskedValue}})},...n})}function lA(t){const{inputRef:i,onChange:r,FormatProps:n,...a}=t;return e(Ht,{...a,getInputRef:i,onValueChange:e=>{r({target:{name:t.name,value:e.value,formattedValue:e.formattedValue}},e.formattedValue)},valueIsNumericString:!1,...n})}const hA=xi(e=>({tooltip:{backgroundColor:"#f5f5f9",color:"rgba(0, 0, 0, 0.87)",maxWidth:220,fontSize:e.typography.pxToRem(12),border:"1px solid #dadde9"}}))(Ii),cA=({name:t,validate:i,validationRun:r,shouldExclude:n,isReadOnly:a,postValidationSetCrossFieldValues:o,runPostValidationHookAlways:c,dependentFields:A,fieldKey:p,label:f,FormControlProps:m,FormHelperTextProps:g,FormControlLabelProps:w,GridProps:b,enableGrid:v,runValidationOnDependentFieldsChange:y,skipValueUpdateFromCrossFieldWhenReadOnly:B,ignoreInSubmit:C=!1,setFieldLabel:x,runPostValidationForInitValue:F,dependentFieldDebounceDelay:S=300,runExternalFunction:N,onFormDataChange:E,...k})=>{const[T,L]=d(b),{value:I,error:D,touched:U,handleChange:P,handleBlur:R,isSubmitting:O,fieldKey:Q,name:H,excluded:M,readOnly:_,whenToRunValidation:j,incomingMessage:z,setIncomingMessage:V,runValidation:K,setIgnoreInSubmit:G,dependentValues:W,formState:J}=as({name:t,fieldKey:p,dependentFields:A,validate:i,validationRun:r,runPostValidationHookAlways:c,postValidationSetCrossFieldValues:o,isReadOnly:a,shouldExclude:n,runValidationOnDependentFieldsChange:y,skipValueUpdateFromCrossFieldWhenReadOnly:B,runPostValidationForInitValue:F,dependentFieldDebounceDelay:S,runExternalFunction:N,onFormDataChange:E});h(()=>{if(Boolean(C))if("function"==typeof C){let e=C(ds(W),J,{isSubmitting:O,value:I});G(e)}else G(C)},[C,G,W,I]),h(()=>{if(null!==z&&"object"==typeof z&&Object.keys(z).length){const{value:e,ignoreUpdate:t,GridProps:i}=z;if("object"==typeof i){const e={...b,xs:i?.xs??b?.xs??"auto",md:i?.md??b?.md??"auto",xl:i?.xl??i?.md??b?.xl??"auto",sm:i?.sm??b?.sm??"auto",lg:i?.lg??i?.md??b?.lg??"auto"};L(e)}"boolean"==typeof e&&(P(e,void 0,!0),t||"onChange"!==j||K({value:e},!0)),V(null)}},[z,P,K,j]);const X=l(e=>{const{value:t,checked:i}=e.target;e.target.value="boolean"==typeof i&&i,P(e)},[P]),Y=s(()=>{if("function"==typeof x)return x(ds(W),I)},[x,W,I]);if(M)return null;const $=U&&""!==(D??""),Z=u($e,{...m,key:Q,component:"fieldset",disabled:O||_,error:!O&&$,onBlur:R},e(Ye,{...w,name:H,control:e(go,{...k,readOnly:_,tabIndex:_?-1:void 0}),onChange:X,label:Y?.label?Ge(Y.label):f,checked:Boolean("string"==typeof I?"Y"===I||"true"===I:I)}),!O&&$?e(Ze,{...g,children:D}):null);return Boolean(v)?u(q,{style:{alignSelf:"center"},...T,key:Q},Z):Z},dA=(e,t)=>Array.isArray(e)&&e.indexOf(t)>-1;var uA=Object.freeze({__proto__:null,Checkbox:cA,CheckboxGroup:({name:t,validate:i,validationRun:r,shouldExclude:n,isReadOnly:a,postValidationSetCrossFieldValues:s,runPostValidationHookAlways:o,dependentFields:h,fieldKey:c,label:A,options:p,FormControlProps:f,FormLabelProps:m,FormGroupProps:g,FormHelperTextProps:w,FormControlLabelProps:b,GridProps:v,enableGrid:y,runValidationOnDependentFieldsChange:C,skipValueUpdateFromCrossFieldWhenReadOnly:x,CircularProgressProps:F,_optionsKey:S,disableCaching:N,...E})=>{const{formState:k,value:T,error:L,touched:I,handleChange:D,handleBlur:U,isSubmitting:P,fieldKey:R,name:O,excluded:Q,readOnly:H,dependentValues:M,incomingMessage:_,runValidation:j,whenToRunValidation:z,setIncomingMessage:V}=as({name:t,fieldKey:c,dependentFields:h,validate:i,validationRun:r,runPostValidationHookAlways:o,postValidationSetCrossFieldValues:s,isReadOnly:a,shouldExclude:n,runValidationOnDependentFieldsChange:C,skipValueUpdateFromCrossFieldWhenReadOnly:x}),[K,W]=d([]),J=l(e=>Fo(K)(e),[K]),X=l(e=>{let t=J("object"==typeof e?e?.target?.value??"":e);D(e,t[0])},[D,J]),{loadingOptions:Y}=Bo(k,p,W,X,M,_,j,z,S,N,V,!0,"",!1);if(Q)return null;const $=I&&""!==(L??""),Z=K.map(t=>u(Ye,{...b,control:e(go,{...E,readOnly:H,tabIndex:H?-1:void 0}),key:t.value,name:O,onChange:X,label:t.label,value:t.value,checked:dA(T,t.value)})),ee=u($e,{...f,key:R,component:"fieldset",disabled:P,error:!P&&$,onBlur:U},e(Je,{...m,component:"label",children:A}),e(Xe,{...g,children:Y?e(B,{position:"end",children:e(G,{color:"primary",variant:"indeterminate",...F})}):Z}),!P&&$?e(Ze,{...w,children:L}):null);return Boolean(y)?u(q,{...v,key:R},ee):ee}});const AA=Ci(e=>({wrapperclass:{textAlign:"center","& div":{"& fieldset":{verticalAlign:"middle","& label":{marginLeft:0,marginRight:0}}}}})),pA=Ci(()=>({wrapperclass:{textAlign:"center","& div":{"& fieldset":{verticalAlign:"middle","& label":{marginLeft:0,marginRight:0}}}}}));ma.registerFn("currency",su),ma.registerFn("date",t=>{const{commonDateFormat:i}=ns(),{value:r,column:{dateFormat:n,showTooltip:a,tooltipPlacement:s="bottom-start"}}=t;if(!Boolean(r))return e(ho,{...t});const o=new Date(r);let l;try{const t=ze(o,(Boolean(n)?n:i)||"dd/MM/yyyy hh:mm aaa");l=a?e(ne,{title:t,placement:s,children:e("span",{children:t})}):t}catch(e){l="-"}return e(ho,{...t,children:l})}),ma.registerFn("default",co),ma.registerFn("icondefault",t=>{const{value:i,column:{showTooltip:r=!1,tooltipPlacement:n="bottom-start",transform:a=e=>e,isAutoSequence:o=!1,isImageURL:l=!1,shouldExclude:c},row:u}=t,[A,p]=d(null);let f;f=o?Number(u?.index??0)+1:a(i);const m=s(()=>"function"==typeof c&&c(f,u?.original),[f,u.original]);if(h(()=>{if(Boolean(f)){let e="";if(l)e=f;else{let t=ps(f);e="object"==typeof t&&Boolean(t)?URL.createObjectURL(t):""}p(e)}},[f]),m)return e(ho,{showBorder:!0,...t});let g=r?e(Ii,{title:f,placement:n,children:e("div",{children:e(Mi,{alt:"User",src:Boolean(A)?A:"",style:{width:"30px",height:"30px",borderRadius:0}})})}):e("div",{children:e(Mi,{alt:"User",src:Boolean(A)?A:"",style:{width:"30px",height:"30px",borderRadius:0}})});return e(ho,{...t,children:g})}),ma.registerFn("editableAutocomplete",i=>{const{value:r,rows:n,row:{index:a,original:o},column:{id:l,options:c,validation:u,_optionsKey:A,disableCachingOptions:p,disableAdornment:f,placeholder:m,isReadOnly:g,isAutoFocus:w,__EDIT__:b},updateGridData:v,gridProps:y,loading:B,hiddenFlag:C,loading:x}=i,F=n.slice(0,a).map(e=>e?.original).filter(e=>!0!==Boolean(e[C])),S=n.slice(a+1).map(e=>e?.original).filter(e=>!0!==Boolean(e[C])),N=Boolean(o?._touched?.[l]),E=o?._error?.[l]??"",[k,T]=d(!1),[L,I]=d(r),{t:D}=W(),U=e=>{I(e)},P=()=>{T(!0),u(L,o,F,S).then(e=>{T(!1),v(a,l,L,!0,e)})};h(()=>{I(r)},[r]);const R=s(()=>!0===o?._isReadOnly||!0!==o?._isNewRow&&(!!g||!1===o?._isNewRow&&!0===b?.isReadOnly),[g,o,b]);return t(ho,{showBorder:!0,...i,children:[e(aA,{value:L,onChange:U,onBlur:P,fullWidth:!0,error:E,touched:N,handleChange:U,handleBlur:P,options:c,loading:x,disabled:x||B,_optionsKey:A,optionsProps:y,disableCaching:p,showCheckbox:!1,renderInput:()=>null,placeholder:String(D(m)),disableAdornment:f,readOnly:R,isAutoFocus:w}),Boolean(N)&&Boolean(E)?e(le,{style:{whiteSpace:"break-spaces"},error:!0,children:D(E)}):null]})}),ma.registerFn("editableSelect",i=>{const{value:r,rows:n,row:{index:a,original:o},column:{id:l,options:c,validation:u,_optionsKey:A,disableCachingOptions:p,skipDefaultOption:f,defaultOptionLabel:m,requestProps:g,isReadOnly:w,__EDIT__:b,dependentOptionField:v,enableDefaultOption:y},updateGridData:B,gridProps:C,hiddenFlag:x,loading:F}=i,S=Boolean(o?._touched?.[l]),N=o?._error?.[l]??"",[E,k]=d(!1),[T,L]=d(r),I=s(()=>!0===o?._isReadOnly||!0!==o?._isNewRow&&(!!w||!1===o?._isNewRow&&!0===b?.isReadOnly),[w,o,b]);let D=Boolean(v)?o[v]:g;const U=n.slice(0,a).map(e=>e?.original).filter(e=>!0!==Boolean(e[x])),P=n.slice(a+1).map(e=>e?.original).filter(e=>!0!==Boolean(e[x])),R=e=>{L(e.target.value)},O=()=>{k(!0),u(T,o,U,P).then(e=>{k(!1),B(a,l,T,!0,e)})};return h(()=>{L(r)},[r,N]),t(ho,{showBorder:!0,...i,children:[e(sA,{value:T,onChange:R,onBlur:O,fullWidth:!0,touched:S,error:N,handleChange:R,handleBlur:O,options:c,loading:E,disabled:E||F||I,_optionsKey:A,optionsProps:D,disableCaching:p,skipDefaultOption:f,defaultOptionLabel:m,enableDefaultOption:y,CircularProgressProps:{color:"secondary",size:20},SelectProps:E||F||I?{IconComponent:()=>null}:void 0}),Boolean(S)&&Boolean(N)?e(Ze,{style:{whiteSpace:"break-spaces"},error:!0,children:N}):null]})}),ma.registerFn("editableTextField",i=>{const{value:r,rows:n,row:{index:a,original:l},column:{id:c,validation:u,isPassword:A,TableCellProps:p,isDisabledOnBlurEvent:f,maxLength:m,placeholder:g,autoComplete:w,isAutoFocus:b,multiline:x,minRows:F,maxRows:S,isReadOnly:N,__EDIT__:E,preventSpecialChars:k},updateGridData:T,hiddenFlag:L,loading:I}=i,D=n.slice(0,a).map(e=>e?.original).filter(e=>!0!==Boolean(e[L])),U=n.slice(a+1).map(e=>e?.original).filter(e=>!0!==Boolean(e[L])),P=Boolean(l?._touched?.[c]),R=l?._error?.[c]??"",O=o(Boolean(A)),[Q,H]=d(Boolean(A)?"password":"text"),[M,_]=d(!1),[j,z]=d(r),V=o(null),{t:K}=W(),q=s(()=>!0===l?._isReadOnly||!0!==l?._isNewRow&&(!!N||!1===l?._isNewRow&&!0===E?.isReadOnly),[N,l,E]),G=()=>{_(!0),u(j,l,D,U).then(e=>{_(!1),T(a,c,j,!0,e)})};return h(()=>{Boolean(f)&&G()},[j]),h(()=>{!Boolean(j)&&Boolean(b)&&n.length===a+1&&V?.current?.firstChild?.focus?.()},[a,b]),h(()=>{z(r)},[r]),t(ho,{showBorder:!0,...i,children:[e(mi,{name:c,value:"string"==typeof j?j.trimStart():j,onChange:e=>{const t="function"==typeof k?k():k;t&&e.target.value&&t.split("").some(t=>e.target.value.includes(t))||e.target.value.length<=(m??200)&&z(e.target.value)},onFocus:e=>{e.target.select()},type:Q,onBlur:()=>{Boolean(f)||G()},multiline:x,minRows:F??"",maxRows:S??"",margin:"none",fullWidth:!0,error:Boolean(P)&&Boolean(R),placeholder:String(K(g)),autoComplete:w,endAdornment:O.current?e(B,{position:"end",children:e(C,{"aria-label":"toggle password visibility",onClick:()=>H(e=>"password"===e?"text":"password"),onMouseDown:e=>{e.preventDefault()},children:e("password"===Q?v:y,{})})}):null,style:{marginTop:"0px",direction:"right"===p?.align?"rtl":"ltr"},disableUnderline:!0,disabled:I||M,readOnly:q,ref:V}),Boolean(P)&&Boolean(R)?e(Ze,{style:{whiteSpace:"break-spaces"},error:!0,children:R}):null]})}),ma.registerFn("editableMaskInputField",i=>{const{value:r,rows:n,row:{index:a,original:s},column:{id:o,validation:l,MaskProps:h},updateGridData:c,hiddenFlag:u}=i,A=Boolean(s?._touched?.[o]),p=s?._error?.[o]??"",[f,m]=d(!1),[g,w]=d(r),b=n.slice(0,a).map(e=>e?.original).filter(e=>!0!==Boolean(e[u])),v=n.slice(a+1).map(e=>e?.original).filter(e=>!0!==Boolean(e[u]));return t(ho,{showBorder:!0,...i,children:[e(mi,{name:o,value:g,onChange:e=>{w(e.target.value)},onFocus:e=>{e.target.select()},onBlur:()=>{m(!0),l(g,s,b,v).then(e=>{m(!1),c(a,o,g,!0,e)})},fullWidth:!0,margin:"none",disableUnderline:!0,error:Boolean(A)&&Boolean(p),inputComponent:oA,inputProps:{MaskProps:h},disabled:f}),Boolean(A)&&Boolean(p)?e(Ze,{style:{whiteSpace:"break-spaces"},error:!0,children:p}):null]})}),ma.registerFn("editableNumberFormat",i=>{const{value:r,rows:n,row:{index:a,original:l},column:{id:c,validation:u,FormatProps:A,placeholder:p="",enableNumWords:f,className:m,isReadOnly:g,__EDIT__:w,isDisabledOnBlurEvent:b,autoComplete:v,isAutoFocus:y},updateGridData:B,hiddenFlag:C,loading:x}=i,F=n.slice(0,a).map(e=>e?.original).filter(e=>!0!==Boolean(e[C])),S=n.slice(a+1).map(e=>e?.original).filter(e=>!0!==Boolean(e[C])),N=Boolean(l?._touched?.[c]),E=l?._error?.[c]??"",[k,T]=d(!1),[L,I]=d(r),D=o(null),{t:U}=W(),P=s(()=>!0===l?._isReadOnly||!0!==l?._isNewRow&&(!!g||!1===l?._isNewRow&&!0===w?.isReadOnly),[g,l,w]);let R=null;try{if(f&&Boolean(L)){let e=String(L).split("."),t=Number(e[0]);t<0?(t=Math.abs(Number(t)),R=`Negative ${Io(t)} Rupees`):R=`${Io(t)} Rupees`,2===e.length&&Boolean(e[1])&&(R=`${R} and ${Io(e[1])} paise`)}}catch(e){}const O=()=>{T(!0),u(L,l,F,S).then(e=>{T(!1),B(a,c,L,!0,e)})};return h(()=>{Boolean(b)&&O()},[L]),h(()=>{!Boolean(L)&&Boolean(y)&&n.length===a+1&&D?.current?.firstChild?.focus?.()},[n,a,y]),t(ho,{showBorder:!0,...i,children:[e(mi,{name:c,value:L,onChange:e=>{I(e.target.value)},onFocus:e=>{e.target.select()},onBlur:()=>{Boolean(b)||O()},placeholder:String(U(p)),fullWidth:!0,margin:"none",disableUnderline:!0,error:Boolean(N)&&Boolean(E),inputComponent:lA,inputProps:{FormatProps:A},disabled:k||x,className:m,readOnly:x||P,autoComplete:v,ref:D}),Boolean(N)&&Boolean(E)?e(Ze,{style:{whiteSpace:"break-spaces"},error:!0,children:E}):Boolean(f)?e(Ze,{style:{whiteSpace:"break-spaces"},children:R}):null]})}),ma.registerFn("editableNumberFormatLessValidation",i=>{const{value:r,rows:n,row:{index:a,original:s},column:{id:l,validation:c,FormatProps:u,placeholder:A="",enableNumWords:p,className:f,isDisabledOnBlurEvent:m},updateGridData:g,hiddenFlag:w,loading:b}=i,v=[],y=[],B=Boolean(s?._touched?.[l]),C=s?._error?.[l]??"",x=o(!0),[F,S]=d(!1),[N,E]=d(r),{t:k}=W();const T=()=>{S(!0),c(N,s,v,y).then(e=>{S(!1),g(a,l,N,!0,e)})};return h(()=>{Boolean(m)&&!x.current&&T(),x.current=!1},[N]),t(ho,{showBorder:!0,...i,children:[e(mi,{name:l,value:N,onChange:e=>{E(e.target.value)},onFocus:e=>{e.target.select()},onBlur:()=>{Boolean(m)||T()},placeholder:String(k(A)),fullWidth:!0,margin:"none",disableUnderline:!0,error:Boolean(B)&&Boolean(C),inputComponent:lA,inputProps:{FormatProps:u},disabled:F,className:f,readOnly:b}),Boolean(B)&&Boolean(C)?e(Ze,{style:{whiteSpace:"break-spaces"},error:!0,children:C}):Boolean(p)?e(Ze,{style:{whiteSpace:"break-spaces"},children:null}):null]})}),ma.registerFn("action",t=>{let{column:{actions:i},row:r,setGridAction:n,singleActions:a}=t;return Array.isArray(i)||(i=[i]),a=a.filter(e=>i.indexOf(e?.actionName)>=0),a.length>0&&(a=Al(a,[r],{},!1)),e(ho,{...t,children:e(Pi,{size:"small","aria-label":"actions",children:a.map(t=>e(ct,{onClick:()=>{return e=t.actionName,void n({name:e,rows:[{data:r?.original,id:r?.id}]});var e},children:t.actionLabel}))})})}),ma.registerFn("dateDiffere",t=>{const i=t?.cell?.row?.original??"",r=(new Date).getTime(),n=new Date(i?.due_date).getTime(),a=new Date(i?.completion_date).getTime();let s,o="-";if(""!==n||""===a?s=Ke(r,n):""===n&&""===a||(s=Ke(n,a)),"Completed"===i?.status)o="-";else if(s>"0")o=`${s} days over due`;else if(s<"0")o=-1*s+" days left";else if("0"==s){let e=new Date(r-n);var l=Math.floor(e/1e3/60/60);e-=1e3*l*60*60;var h=Math.floor(e/1e3/60);e-=1e3*h*60,l<10&&(l=`0${l}`),h<10&&(h=`0${h}`),o=l+":"+h+" mins left"}return e(ho,{...t,children:o})}),ma.registerFn("chip",t=>{const{value:i,column:{transform:r=e=>e}}=t;let n=r(i);return e(ho,{...t,children:e(gi,{label:n,variant:"outlined"})})}),ma.registerFn("multipleValuesCellRenderer",i=>{const{row:{original:r},column:{_accessor:n}}=i;let a=r[n],s=Array.isArray(a),o=a.map((t,i)=>e("li",{children:t},i));return t(ho,{positionRelative:!0,...i,children:[s?a[0]:"-",s&&a.length>1?e(hA,{title:e("ul",{style:{padding:0,listStyle:"none",margin:"0px 0px"},children:o}),children:e(Ri,{style:{position:"absolute",right:"5px",top:"5px",color:"#8d868685"}})}):null]})}),ma.registerFn("deleteRowCell",t=>{const{value:i,row:{index:r,original:n},column:{id:a,shouldExclude:o,buttonLabel:l,showDeleteIconOnly:h=!1},updateGridData:c,data:d}=t,{t:u}=W(),A=s(()=>"function"==typeof o&&o(i,n,d,r),[i,n,d,r]),p=e=>{c(r,a,!0,!0,"")};return e(ho,A?{showBorder:!0,...t}:{showBorder:!0,...t,children:h?e(de,{onClick:p,sx:{width:"35px",height:"35px","&:hover":{background:"#fccfcf"},color:"#ff2626"},children:e(Oi,{})}):e(ct,{onClick:p,fullWidth:!0,variant:"contained",color:"secondary",style:{height:"28px"},children:Boolean(l)?u(l):u("Delete")})})}),ma.registerFn("buttonRowCell",jc),ma.registerFn("percentageDiff",t=>{const i=t?.cell?.row?.original??"";let r=0;const n=Number(i?.fromPercentage),a=Number(i?.toPercentage);return isNaN(n)||isNaN(a)||(r=a-n+"%"),e(ho,{...t,children:r})}),ma.registerFn("editableCheckbox",i=>{const{value:r,rows:n,row:{index:a,original:o},column:{id:l,validation:c,isReadOnly:u,setValueFUNC:A,shouldExclude:p,__EDIT__:f},updateGridData:m,hiddenFlag:g,loading:w}=i,b=Boolean(o?._touched?.[l]),v=o?._error?.[l]??"",[y,B]=d(!1),C=AA(),[x,F]=d(r),S=n.slice(0,a).map(e=>e?.original).filter(e=>!0!==Boolean(e[g])),N=n.slice(a+1).map(e=>e?.original).filter(e=>!0!==Boolean(e[g])),E=s(()=>"function"==typeof p&&p(r,o,S,N),[r,S,N,o]),k=s(()=>u?"function"!=typeof u||u(r,o,S,N):!0===o?._isReadOnly||!0!==o?._isNewRow&&(!1===o?._isNewRow&&!0===f?.isReadOnly),[u,o,f]);return h(()=>{F(r)},[r,v]),e(ho,E?{showBorder:!0,...i}:{...i,children:t("div",{className:C.wrapperclass,children:[e(cA,{checked:Boolean("string"==typeof x?"Y"===x||"true"===x||"N"!==x&&"false"!==x&&x:x),onChange:e=>{let t=e.target.checked;"function"==typeof A&&(t=A(t)),F(t)},onBlur:()=>{B(!0),c(x,o,S,N).then(e=>{B(!1);m(a,l,"Y"===x||!0===x?"Y":"N",!0,e)})},disabled:y||w||k,enableGrid:!0,name:l,label:"",fieldKey:l}),Boolean(b)&&Boolean(v)?e(Ze,{style:{whiteSpace:"break-spaces"},error:!0,children:v}):null]})})}),ma.registerFn("editableDatetimePicker",i=>{const{commonDateTimeFormat:r}=ns(),{value:n,rows:a,row:{index:o,original:l},column:{id:c,validation:u,dateFormat:A,mindate:p,isReadOnly:f,__EDIT__:m},updateGridData:g,hiddenFlag:w,loading:b}=i,v=Boolean(l?._touched?.[c]),y=l?._error?.[c]??"",[B,C]=d(!1),[x,F]=d(n),{authState:S}=es(),N=s(()=>!!f||!1===l?._isNewRow&&!0===m?.isReadOnly,[f,l?._isNewRow,m]),E=a.slice(0,o).map(e=>e?.original).filter(e=>!0!==Boolean(e[w])),k=a.slice(o+1).map(e=>e?.original).filter(e=>!0!==Boolean(e[w]));return h(()=>{F(n)},[n]),t(ho,{showBorder:!0,...i,children:[e(Qi,{dateAdapter:Hi,children:e(_o,{format:(Boolean(A)?A:r)||"dd/MM/yyyy HH:mm:ss",onChange:e=>{F(e),u(e,l,E,k).then(t=>{const i=e?new Date(e):e;let r=ys(i)?ze(i,"yyyy-MM-dd HH:mm:ss.S"):i;if(Boolean(i&&S?.minDate)){Ca(i,new Date(S?.minDate))&&(t=Ge("DateOutOfPeriod"))}g(o,c,r,!0,t)})},value:""===x||null===x?null:Fs(x),disabled:b,readOnly:N,minDate:p||new Date("1900-01-01"),views:["year","month","day","hours","minutes","seconds"],slotProps:{textField:{onBlur:()=>{C(!0),u(x,l,E,k).then(e=>{C(!1);const t=x?new Date(x):x;let i=ys(t)?ze(t,"yyyy-MM-dd HH:mm:ss.S"):t;if(Boolean(t&&S?.minDate)){Ca(t,new Date(S?.minDate))&&(e=Ge("DateOutOfPeriod"))}g(o,c,i,!0,e)})},name:c,"aria-label":"Select Date",autoComplete:"off",InputLabelProps:{shrink:!0},InputProps:{disableUnderline:!0,startAdornment:B?e(se,{position:"end",sx:{position:"absolute",right:"18px"},children:e(he,{color:"secondary",variant:"indeterminate",size:16})}):null}},actionBar:{actions:["today","accept","cancel"]}},sx:{width:"100%"}})}),Boolean(v)&&Boolean(y)?e(Ze,{style:{whiteSpace:"break-spaces"},error:!0,children:y}):null]})}),ma.registerFn("editableDatePicker",i=>{const{commonDateFormat:r}=ns(),[n,a]=d(null),{authState:o}=es(),{value:l,rows:c,row:{index:u,original:A},column:{id:p,validation:f,dateFormat:m,mindate:g,maxdate:w,disablePast:b,disableFuture:v,disableToday:y,isReadOnly:B,__EDIT__:C},updateGridData:x,hiddenFlag:F,loading:S}=i,N=Boolean(A?._touched?.[p]),E=A?._error?.[p]??"",[k,T]=d(!1),[L,I]=d(l),D=s(()=>!0===A?._isReadOnly||!0!==A?._isNewRow&&(!!B||!1===A?._isNewRow&&!0===C?.isReadOnly),[B,A,C]),U=c.slice(0,u).map(e=>e?.original).filter(e=>!0!==Boolean(e[F])),P=c.slice(u+1).map(e=>e?.original).filter(e=>!0!==Boolean(e[F])),R=e=>{I(e),f(e,A,U,P).then(t=>{const i=e?new Date(e):e;let r=ys(i)?ze(i,"yyyy-MM-dd HH:mm:ss.S"):i;if(Boolean(i&&o?.minDate)){Ca(i,new Date(o?.minDate))&&(t=Ge("DateOutOfPeriod"))}x(u,p,r,!0,t)})};return h(()=>{I(l)},[l]),t(ho,{showBorder:!0,...i,children:[e(Qi,{dateAdapter:Hi,children:e(Ho,{format:(Boolean(m)?m:r)||"dd/MM/yyyy",onChange:R,value:""===L||null===L?null:Fs(L),disabled:S,readOnly:D,minDate:g||new Date("1900-01-01"),maxDate:w||null,disablePast:b,disableFuture:v,onSelectedSectionsChange:e=>{a(e)},selectedSections:n,slotProps:{textField:{onBlur:()=>{T(!0),f(L,A,U,P).then(e=>{T(!1);const t=L?new Date(L):L;let i=ys(t)?ze(t,"yyyy-MM-dd HH:mm:ss.S"):t;if(Boolean(t&&o?.minDate)){Ca(t,new Date(o?.minDate))&&(e=Ge("DateOutOfPeriod"))}x(u,p,i,!0,e)})},onKeyDown:e=>{const t=m??r;if(!o?.workingDate||"ArrowUp"!==e.key&&"ArrowDown"!==e.key){if("Home"===e.key)a(0);else if("End"===e.key){const e=t.includes("/")?"/":t.includes("-")?"-":null,i=e?t.split(e).length:1;a(i-1)}}else{const i=e.target.value;if(!Ve(L)&&i?.toLowerCase()===t?.toLowerCase()){const t=o?.workingDate;let i="";"ArrowUp"===e.key?i=(new Date).setDate(new Date(t).getDate()+1):"ArrowDown"===e.key&&(i=(new Date).setDate(new Date(t).getDate()-1)),setTimeout(()=>R(new Date(i)),0)}}},"aria-label":"Select Date",name:p,autoComplete:"off",InputLabelProps:{shrink:!0},InputProps:{disableUnderline:!0,startAdornment:k?e(se,{position:"end",sx:{position:"absolute",right:"18px"},children:e(he,{color:"secondary",variant:"indeterminate",size:16})}):null}},actionBar:{actions:y?["accept","cancel"]:["today","accept","cancel"]}}})}),Boolean(N)&&Boolean(E)?e(Ze,{style:{whiteSpace:"break-spaces"},error:!0,children:E}):null]})}),ma.registerFn("disableSelect",i=>{const{value:r,rows:n,row:{index:a,original:s},column:{id:o,options:l,validation:c,_optionsKey:u,disableCachingOptions:A,defaultOptionLabel:p,requestProps:f},updateGridData:m,gridProps:g,hiddenFlag:w,loading:b}=i,v=Boolean(s?._touched?.[o]),y=s?._error?.[o]??"",[B,C]=d(!1),[x,F]=d(r);const S=n.slice(0,a).map(e=>e?.original).filter(e=>!0!==Boolean(e[w])),N=n.slice(a+1).map(e=>e?.original).filter(e=>!0!==Boolean(e[w])),E=e=>{F(e.target.value)},k=()=>{C(!0),c(x,s,S,N).then(e=>{C(!1),m(a,o,x,!0,e)})};return h(()=>{F(r)},[r,y]),t(ho,{showBorder:!0,...i,children:[e(sA,{value:x,onChange:E,onBlur:k,fullWidth:!0,touched:v,error:y,handleChange:E,handleBlur:k,options:l,loading:B,disabled:!0,_optionsKey:u,optionsProps:f,disableCaching:A,defaultOptionLabel:p,CircularProgressProps:{color:"secondary",size:20},readOnly:!0,SelectProps:{IconComponent:()=>null}}),Boolean(v)&&Boolean(y)?e(Ze,{style:{whiteSpace:"break-spaces"},error:!0,children:y}):null]})}),ma.registerFn("customIconCell",i=>{const{value:r,row:{index:n,original:a},column:{id:s,isReadOnly:o,activeIcon:{icon:l,tooltip:c},inActiveIcon:{icon:u,tooltip:A}},loading:p,onButtonActionHandel:f}=i,m=Boolean(a?._touched?.[s]),g=a?._error?.[s]??"",w=pA(),[b,v]=d(r),y=()=>{"function"==typeof f&&f(n,s)};return h(()=>{v(r)},[r,g]),e(ho,{...i,children:t("div",{className:w.wrapperclass,children:[Boolean(b)?e(ne,{title:c,children:e(de,{name:s,onClick:y,disabled:p||o,size:"small",children:l??""})}):e(ne,{title:A,children:e(de,{onClick:y,disabled:p||o,size:"small",children:u??""})}),Boolean(m)&&Boolean(g)?e(le,{style:{whiteSpace:"break-spaces"},error:!0,children:g}):null]})})});io(":root{--theme-color1:maroon;--theme-color2:#fedad8;--theme-color3:#fe0000;--theme-color4:#fcbab7;--theme-color5:#efe0e0;--white:#fff;--white-dim:#ffffff8a;--primary-bg:linear-gradient(45deg,maroon,#ff5a5a);--report-export-theme:maroon;--old-value-text-primary:#7b4f00;--old-value-bg-primary:#fff8dc}");const fA=Ae("div")(({theme:e,ownerState:t})=>({backgroundColor:"dark"===e.palette.mode?e.palette.grey[700]:"#ccc",zIndex:1,color:"#fff",width:30,height:30,display:"flex",borderRadius:"50%",justifyContent:"center",alignItems:"center",...t.active&&{background:"var(--theme-color1)",boxShadow:"0 4px 10px 0 rgba(0,0,0,.25)"},...t.completed&&{background:"var(--theme-color1)"}})),mA=Ae(_i)(({theme:e})=>({[`&.${ji.alternativeLabel}`]:{top:15,left:"calc(-50% + 10px)"},[`&.${ji.active}`]:{[`& .${ji.line}`]:{background:"var(--theme-color1)"}},[`&.${ji.completed}`]:{[`& .${ji.line}`]:{background:"var(--theme-color1)"}},[`& .${ji.line}`]:{height:3,border:0,backgroundColor:"dark"===e.palette.mode?e.palette.grey[800]:"#eaeaf0",borderRadius:1}})),gA=n(null),wA=({gridCode:t,getGridData:i,children:r})=>"function"!=typeof i?e("div",{children:"Invalid Grid FNS passed"}):e(gA.Provider,{value:{getGridData:i,gridCode:t},children:r}),bA=({column:i,visibleColumns:r,setColumnOrder:n,allowColumnReordering:a})=>{const[{isDragging:s},l]=wt({type:"Column",collect:e=>({isDragging:!!e.isDragging()}),end:(e,t)=>{if(t.didDrop()){const{id:e}=t.getDropResult(),s=r.map(e=>e.id),o=s.indexOf(e),l=s.indexOf(i.id);var a=s[o];s[o]=s[l],s[l]=a,n(s)}},canDrag:()=>a&&!i.pinColumn}),[{isOver:h},c]=bt({accept:"Column",drop:()=>({id:i.id}),collect:e=>({isOver:a&&!i.pinColumn&&!!e.isOver()}),canDrop:()=>a&&!i.pinColumn}),d=o(null);return l(c(d)),t(f,{children:[e(zi,{active:i.isSorted,direction:i.isSortedDesc?"desc":"asc",hideSortIcon:!0,ref:d,...i.getSortByToggleProps([{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"flex",color:"var(--theme-color1)",fontSize:"1 rem",fontWeight:"600",opacity:s||h?.5:1,cursor:s?"move":"default"}}]),children:e("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",paddingRight:"10px"},children:i.columnName})}),i.getResizerProps&&!i.disableResizing&&e("div",{...i.getResizerProps([{style:{minHeight:"26px",opacity:1,color:"rgba(224, 224, 224, 1)",right:"0px",display:"flex",zIndex:5,position:"absolute",flexDirection:"column",justifyContent:"center"}}]),children:e("svg",{focusable:"false",viewBox:"0 0 24 24","aria-hidden":"true","data-testid":"SeparatorIcon",style:{color:"inherit",userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:"currentColor",flexShrink:0,transition:"fill 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",fontSize:"20px"},children:e("path",{d:"M11 19V5h2v14z"})})})]})},vA=xi(e=>({root:{"&.Mui-checked":{color:"var(--theme-color1)"},"&.MuiCheckbox-indeterminate":{color:e.palette.text.secondary}},checked:{}}))(ui),yA=({row:t,cell:r,setContextMenuSelectedRowId:n,hasLeftPinnedColumn:a})=>e(i,{children:e(ci,{component:"div",variant:"head",...r.getCellProps([{style:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"0px 10px",lineHeight:"28px",...a&&{position:"sticky",left:0,zIndex:1,background:"inherit"}}}]),children:Boolean(t?.original?.__isRowSelection??!0)?e(vA,{size:"small",...t.getToggleRowSelectedProps([{style:{padding:0}}]),onClick:e=>{t.isSelected&&n("")}}):null})}),BA=({getToggleAllRowsSelectedProps:t,setContextMenuSelectedRowId:i,hasLeftPinnedColumn:r})=>e(ci,{component:"div",variant:"head",style:{padding:0,...r&&{position:"sticky",left:0,zIndex:1,background:"inherit"}},children:e(vA,{size:"small",...t([{style:{padding:0}}]),onClick:()=>{i("")}})}),CA=Ci(e=>({root:{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),background:"var(--primary-bg)",borderTopLeftRadius:"4px",borderTopRightRadius:"4px"},title:{color:"var(--white)",letterSpacing:"1px",fontSize:"1.25rem"},refreshiconhover:{}})),xA=c(({dense:i,label:r,visibleColumns:n,defaultHiddenColumns:a,allowColumnHiding:s,setGridAction:o,selectedFlatRows:l,alwaysAvailableAction:h,allowFilter:c,setAllFilters:d,gotoPage:u,setSortBy:A,filterMeta:p,filters:f,autoRefreshInterval:m,loading:g,enableExport:w,setOpenExport:b,headerToolbarStyle:v},y)=>{const B=CA(),{defaultGridConfig:x}=ns(),{progress:F,enabled:S,intervalElapsed:N,pause:E,resume:k}=Vl(y?.current?.fetchData,m);return t(ai,{className:J(B.root,"server__grid__header"),variant:i?"dense":"regular",sx:v,children:[e(vt,{className:B.title,color:"inherit",variant:"h6",component:"div",children:r}),t("div",{style:{display:"flex",alignItems:"center",marginLeft:"auto"},children:[c?e(Gl,{setAllFilters:d,filters:f,filterMeta:p,gotoPage:u,setSortBy:A,classes:B}):null,e(ne,{title:Ge("Refetch"),children:e(C,{"aria-label":"refresh","aria-controls":"button","aria-haspopup":"false",onClick:()=>y?.current?.fetchData?.(),color:"primary",className:B.refreshiconhover,children:e(ki,{})})}),S?e(Kl,{variant:"determinate",value:F,interval:N,pause:E,resume:k}):null,s?e(Jl,{visibleColumns:n,defaultHiddenColumns:a,classes:B}):null,!g&&w?e(ae,{control:e(ne,{title:Ge("Showexportoptions"),children:t(eo,{onClick:()=>{b(!0)},style:{color:"white",background:x?.isContainedActionButton?"var(--primary-bg)":"inherit",boxShadow:x?.isContainedActionButton?"2px 2px 4px 0px rgba(0,0,0,.2)":"none"},eventKey:"x",shortcut:"alt",children:[Ge("Export")," ",e(Ki,{})]})}),sx:{color:"var(--white)",margin:"0 !important"},label:""}):null,e(Hl,{actions:h??[],setAction:o,selectedRows:l},"alwaysRender")]})]})}),FA=c(({label:r,dense:n,columns:a,defaultColumn:l,setData:c,data:u,onFetchData:A,loading:f,getRowId:m,totalRecords:g,pageCount:w,pageSizes:b,defaultPageSize:v,defaultSortOrder:y,defaultFilter:B,defaultHiddenColumns:C,allowColumnReordering:x,allowColumnHiding:F,allowKeyboardNavigation:S,setGridAction:N,multipleActions:E,singleActions:k,doubleClickAction:T,alwaysAvailableAction:L,allowFilter:I,allowRowSelection:D,filterMeta:U,autoRefreshInterval:P,enablePaginationInput:R=!0,finalMetaData:O,enableExport:Q,enablePdfPrint:H,reportTemplateCode:M,variant:_,containerHeight:j,occupiedHeight:z,autoFetch:V,handleReset:K,headerToolbarStyle:q,enableEnterToFocus:G,disableSorting:J,onButtonActionHandel:Y,handleClickAction:Z,defaultSelectedRowId:ee,disableMultipleRowSelect:te,footerNote:ie,footerNoteStyles:re},ne)=>{const[ae,se]=d(V),[oe,le]=d(null);h(()=>{const e="function"==typeof ee?ee(u):ee;le(t=>t??e)},[ee,u]);const he=s(()=>[...a].map(e=>e.pinColumn?{...e,disableResizing:!0}:e).sort((e,t)=>(e.sequence??0)-(t.sequence??0)),[a]),{getTableProps:ce,getTableBodyProps:de,headerGroups:ue,prepareRow:Ae,rows:pe,page:fe,selectedFlatRows:me,gotoPage:ge,setPageSize:we,state:be,setSortBy:ve,columns:ye,toggleAllRowsSelected:Be,visibleColumns:Ce}=Gt({columns:he,defaultColumn:l,data:u,getRowId:m,initialState:{pageIndex:0,pageSize:v,hiddenColumns:C,sortBy:y},manualPagination:!0,pageCount:w,autoResetPage:!1,disableSortBy:Boolean(J),manualSortBy:!0,autoResetSortBy:!1,manualFilters:!0,autoResetFilters:!1,allowColumnReordering:x,singleActions:k,setGridAction:N,onButtonActionHandel:Y},Jt,ri,Yt,Zt,ei,ti,ii,((t,i)=>r=>{Boolean(t)&&r.visibleColumns.push(t=>{const r=t.some(e=>"left"===e.pinColumn);return[{id:"selectionCheckbox",Header:t=>e(BA,{...t,hasLeftPinnedColumn:r,setContextMenuSelectedRowId:i}),Cell:t=>e(yA,{...t,hasLeftPinnedColumn:r,setContextMenuSelectedRowId:i}),minWidth:40,width:40,maxWidth:40,pinColumn:r?"left":void 0},...t]})})(D&&!te,le)),{authState:xe}=es(),[Fe,Se]=d(B),[Ne,Ee]=d(!1),{t:ke}=W();k=Al(k,me,xe),E=Al(E,me,xe),L=Al(L,fe,xe,!1,!0);const{pageIndex:Te,pageSize:Le,sortBy:Ie}=be,De=qt(A,500),Ue=o(null),Pe=o(null),Re=o(null),[Oe,Qe]=d(null),[He,Me]=d(null),{defaultGridConfig:_e}=ns(),je=o(0),ze=o(null),{resume:Ve,pause:Ke}=zl();h(()=>{ae&&(le(null),De({pageIndex:Te,pageSize:Le,sortBy:Ie,filters:Fe}))},[De,Te,Le,Ie,Fe,ae]),p(ne,()=>({fetchData:()=>{ae||se(!0),le(null),De({pageIndex:Te,pageSize:Le,sortBy:Ie,filters:Fe})},setData:c,handleReset:()=>{Se([]),ve([]),se(!1),ge(0),K()},resume:Ve,pause:Ke,data:u}));const qe=s(()=>{const e=e=>{const t=me.length>0&&D?`calc(${j?.[e]} - 48px)`:j?.[e];return t&&z?.[e]?Fe.length?`calc(${t} - ${z?.[e]} - 48px)`:`calc(${t} - ${z?.[e]})`:Fe.length>0?`calc(${t} - 48px)`:t};return{min:e("min"),max:e("max")}},[me,j,z,Fe]);h(()=>{me.length>0&&te&&JSON.stringify(me[0]?.original)!==JSON.stringify(Re.current)&&(Re.current=me[0]?.original,N({name:"_rowChanged",rows:[{data:me[0]?.original}]}))},[me[0]?.original,te]),h(()=>{if(!te)return;const e=me[0]?.id,t=1===me.length&&e===oe,i=!oe&&0===me.length;if(!t&&!i&&(me.length>0&&Be(!1),oe)){const e=pe.find(e=>e.id===oe);e&&!e.isSelected&&e.toggleRowSelected(!0)}},[pe,oe,te,me]);const Ge=s(()=>{if(!Ce||0===Ce.length)return{leftMap:{},rightMap:{}};const e=be?.columnResizing?.columnWidths??{},t=t=>{const i=e[t.id]??t.totalWidth??t.width??l?.width;return Number.parseFloat(i)||150},i={},r={};let n=0;Ce.forEach(e=>{"left"===e.pinColumn&&(i[e.id]=n,n+=t(e))});let a=0;return[...Ce].reverse().forEach(e=>{"right"===e.pinColumn&&(r[e.id]=a,a+=t(e))}),{leftMap:i,rightMap:r}},[Ce,be?.columnResizing?.columnWidths,l?.width]);return t(i,{children:[t(ni,{style:{width:"100%",background:"var(--white)"},children:[e(xA,{ref:ne,label:r,dense:n,loading:f,visibleColumns:ye,defaultHiddenColumns:C,allowColumnHiding:F,alwaysAvailableAction:L,setGridAction:N,selectedFlatRows:me,allowFilter:I,setAllFilters:Se,gotoPage:ge,setSortBy:ve,filters:Fe,filterMeta:U,autoRefreshInterval:P,enableExport:Q&&fe?.length,setOpenExport:Ee,headerToolbarStyle:q}),e(Ql,{dense:n,selectedFlatRows:me,multipleActions:E,singleActions:k,setGridAction:N}),e(Ml,{selectedFlatRows:me,contextMenuRow:He,multipleActions:E,singleActions:k,setGridAction:N,mouseX:Oe?.mouseX??null,mouseY:Oe?.mouseY??null,handleClose:()=>{Me(null),Qe(null)},authState:xe}),e(hh,{dense:n,setAllFilters:Se,filters:Fe,gotoPage:ge,setSortBy:ve}),f?e(mt,{color:"secondary",style:{marginTop:"1px"}}):e(sh,{}),t(si,{style:{position:"relative",display:"inline-block",overflow:"auto",padding:"outlined"===_?"0 .5rem":"",maxHeight:qe.max,minHeight:qe.min,borderBottom:"1px solid rgba(133, 130, 130, 0.8)"},children:[t(oi,{component:"div",...ce(),size:n?"small":"medium",children:[e($l,{component:"div",sx:{background:"standard"===_?"white":"var(--theme-color4)"},children:ue.map(t=>e(hi,{component:"div",sx:{background:"inherit"},...t.getHeaderGroupProps(),children:t.headers.map(t=>e(th,{variant:_,column:t,pinnedOffsets:Ge,visibleColumns:Ce,children:t.render("Header")},t.getHeaderProps().key))}))}),t(di,{component:"div",ref:Ue,...de([{style:{display:"block"}}]),style:{height:`calc(${qe.min} - 62px)`},children:[fe.length<=0&&!1===f?e("div",{style:{position:"absolute",left:"50%",height:`calc(${qe.min} - 50px)`,display:"flex",alignItems:"center",fontStyle:"italic",color:"rgba(133, 130, 130, 0.8)"},children:ke("Nodatafound")}):null,fe.map((t,i)=>{Ae(t);const r=(e=>t=>{t.preventDefault(),Me(e),le(e?.id),Qe(null===Oe?{mouseX:t.clientX-2,mouseY:t.clientY-4}:null)})(t),n=(e=>t=>{t.preventDefault(),void 0!==Al(T,[e],xe,!0)&&N({name:T.actionName,rows:[{data:e?.original,id:e?.id}]})})(t),a=((e,t,i)=>r=>{if("INPUT"!==r?.target?.tagName&&"TEXTAREA"!==r?.target?.tagName&&"BUTTON"!==r?.target?.tagName){if("Enter"!==r.key&&"Tab"!==r.key&&r.preventDefault(),"Space"===r.code&&Boolean(T)&&_e?.enableDoubleSpaceAction)if(je.current+=1,2===je.current){if(void 0===Al(T,[i],xe,!0))return;N({name:T.actionName,rows:[{data:i?.original,id:i?.id}]}),je.current=0}else ze.current&&clearTimeout(ze.current),ze.current=setTimeout(()=>{je.current=0},300);"ArrowUp"===r.key&&t>0?e[t-1]?.id&&(Be(!1),e[t-1].toggleRowSelected(!0),le(e[t-1]?.id),r?.target?.previousElementSibling?.focus?.()):"ArrowDown"===r.key&&t<e.length-1&&e[t+1]?.id&&(Be(!1),e[t+1].toggleRowSelected(!0),le(e[t+1].id),r?.target?.nextElementSibling?.focus?.())}})(fe,i,t);let s=[];t?.original?._rowColor&&(s=[{style:{background:t?.original?._rowColor}}]),t?.original?._style&&(s=[{style:{...s[0]?.style,...t?.original?._style}}]);const o=Boolean(t.isSelected)||oe===t.id;return e(Zl,{...t.getRowProps(s),id:t.id,tabIndex:0,component:"div",ref:t.isSelected||oe===t.id?Pe:null,selected:o,onKeyDown:a,onContextMenu:e=>{Be(!1),t.toggleRowSelected(!0),r(e)},onDoubleClick:T?n:void 0,onClick:e=>{Boolean(te)&&(Be(!1),t.toggleRowSelected(!0),le(t.id)),"function"==typeof Z&&Z(e,{data:t?.original,id:t?.id})},sx:{background:t?.original?._rowColor?`${t?.original?._rowColor} !important`:o?"#ccc !important":""},children:t.cells.map(e=>{const{key:t}=e.getCellProps();return e.render("Cell",{key:t,pinnedOffsets:Ge,visibleColumns:Ce})})})})]})]}),e(oh,{open:f})]}),ie&&e(X,{component:"div",fontWeight:500,pl:"24px",sx:re,children:ke(ie)}),e(Vi,{sx:{display:"flex","& .MuiToolbar-root":{display:"flex",alignItems:"baseline",minHeight:"44px"}},variant:"body",component:"div",rowsPerPageOptions:[...new Set([v,...b])]?.sort((e,t)=>e-t),colSpan:3,count:g,rowsPerPage:Number(Le),page:Number(Te),onPageChange:(e,t)=>{ge(t)},onRowsPerPageChange:e=>{we(Number(e.target.value))},ActionsComponent:R?nh:rh})]}),Ne?e($,{open:Ne,children:e(Bd,{filters:Fe,title:r,rows:pe,columns:O,onClose:()=>{Ee(!1)},enablePdfPrint:H,reportTemplateCode:u?.find(e=>e?.REPORT_PERSONALIZATION_ID)?.REPORT_PERSONALIZATION_ID??M,enableEnterToFocus:G})}):null]})}),SA=c(({metaData:r,defaultFilter:n,defaultSortOrder:c,dataTransformer:u,autoRefreshInterval:A,enableExport:p,reportTemplateCode:f,variant:m,autoFetch:g,headerToolbarStyle:w,enableEnterToFocus:b,focusScopeId:v,onClickActionEvent:y=()=>{},handleClickAction:B,onDataChange:C,disableMultipleRowSelect:x,defaultSelectedRowId:F},S)=>{const{authState:N}=es(),{defaultGridConfig:E,defaultExportConfig:k}=ns(),T=a(gA),{t:L}=W(),I=s(()=>Array.isArray(r.columns)?r.columns.map(e=>({...e,columnName:L(e.columnName)})):r.columns??[],[L]),D=s(()=>Array.isArray(r.filters)?r.filters.map(e=>({...e,columnName:L(e.columnName)})):r.filters??[],[L]),U=s(()=>({width:150,maxWidth:400,minWidth:50,Header:bA}),[]),P=s(()=>n,[]),R=s(()=>c,[]),O=l(e=>e[r?.gridConfig?.rowIdColumn],[r?.gridConfig?.rowIdColumn]),[Q,H]=d(!1),[M,_]=d([]),[j,z]=d(0),[V,K]=d(0),[q,G]=d(null),J=o(0),X=o(null),Y=l(()=>{_([]),z(0),K(0),J.current=0},[]),$=l(({pageSize:e,pageIndex:t,sortBy:i,filters:r})=>{H(!0),G(null);const n=++J.current,a=Number(e)*Number(t)+1,s=Number(a)+Number(e)-1;let o=((e=[])=>(Array.isArray(e)||(e=[e]),e.map((e,t)=>({ACCESSOR:e.id,CONDITION:e.value.condition,VALUE:e.value.value,TYPE:e.value?.type??""}))))(r);X.current&&X.current?.abort?.(),X.current=new AbortController,T?.getGridData(a,s,((e=[])=>e.map((e,t)=>({ACCESSOR:e.id??"",VALUE:e?.desc?"desc":"asc"})))(i),o,X.current).then(t=>{n===J.current&&(_(u(t?.[0]?.REPORT_DATA??[])),K(Math.ceil(Number(t?.[0]?.COUNT??1)/Number(e))),z(Number(t?.[0]?.COUNT??1)),H(!1))}).catch(e=>{e?.error_msg?.includes("AbortError")||G(e),H(!1)})},[z,H,_,T]),Z=o(null),ee=v&&b?{"data-scope-id":v}:{},te=l((e,t)=>{y(e,t,M[e])},[M]);return h(()=>{"function"==typeof C&&C(M)},[M]),h(()=>{b&&Z.current&&Z.current.focus()},[b]),t(i,{children:[q&&e(to,{severity:"error",errorMsg:q?.error_msg??"Unknown Error occured",errorDetail:q?.error_detail}),e("div",{ref:Z,tabIndex:b?0:-1,onKeyDown:e=>{b&&Es(e,v)},style:{width:"100%",position:"relative"},...ee,children:e(FA,{ref:S,label:r.gridConfig?.gridLabel?L(r.gridConfig.gridLabel):L(Ss(window.location.pathname,N?.menulistdata??[],r?.gridConfig?.setScreenCode??!0,r?.gridConfig?.showUserCode??!1)),dense:!0,multipleActions:r?.multipleActions,singleActions:r?.singleActions,doubleClickAction:r?.doubleClickAction,alwaysAvailableAction:r?.alwaysAvailableAction,setGridAction:r?.setAction,filterMeta:D,getRowId:O,columns:I,defaultColumn:U,defaultHiddenColumns:r.hiddenColumns,defaultFilter:P,defaultSortOrder:R,loading:Q,data:M,setData:_,onFetchData:$,pageCount:V,totalRecords:j,pageSizes:r.gridConfig?.pageSizes??[5,10],defaultPageSize:r.gridConfig?.defaultPageSize??10,allowColumnReordering:r.gridConfig?.allowColumnReordering??!1,allowColumnHiding:r.gridConfig?.allowColumnHiding??!1,allowKeyboardNavigation:r.gridConfig?.allowKeyboardNavigation??!1,allowFilter:r.gridConfig?.allowFilter??!0,filterAlwaysVisible:r.gridConfig?.filterAlwaysVisible??!1,containerHeight:r?.gridConfig?.containerHeight,occupiedHeight:r?.gridConfig?.occupiedHeight,allowRowSelection:r?.gridConfig?.allowRowSelection??!0,autoRefreshInterval:A,enablePaginationInput:r.gridConfig?.enablePaginationInput??E?.enablePaginationInput??!0,finalMetaData:r.columns.map(e=>({...e,columnName:L(e.columnName)})),enableExport:p,enablePdfPrint:r?.gridConfig?.enablePdfPrint??k?.enablePdfPrint??!1,reportTemplateCode:f,variant:m??E?.variant??"standard",autoFetch:r?.gridConfig?.autoFetch??g??!0,handleReset:Y,headerToolbarStyle:w,enableEnterToFocus:b,disableSorting:r?.gridConfig?.disableSorting,onButtonActionHandel:te,handleClickAction:B,disableMultipleRowSelect:x,defaultSelectedRowId:F,footerNote:r.gridConfig?.footerNote??"",footerNoteStyles:r.gridConfig?.footerNoteStyles??{}})})]})}),NA=c(({gridCode:t,getGridData:i,metaData:r,actions:n,setAction:a,defaultFilter:s=[],defaultSortOrder:o=[],dataTransformer:l=e=>e,autoRefreshInterval:h,enableExport:c,reportTemplateCode:d,variant:u,autoFetch:A,headerToolbarStyle:p,enableEnterToFocus:f,focusScopeId:m,onClickActionEvent:g,onDataChange:w,defaultSelectedRowId:b,disableMultipleRowSelect:v,handleClickAction:y},B)=>{let C=EA({metaData:r,actions:n,setAction:a});return e(wA,{gridCode:t,getGridData:i,children:e(jl,{children:e(SA,{ref:B,metaData:C,defaultFilter:s,defaultSortOrder:o,dataTransformer:l,autoRefreshInterval:h,enableExport:c,reportTemplateCode:d,variant:u,autoFetch:A,headerToolbarStyle:p,enableEnterToFocus:f,focusScopeId:m,disableMultipleRowSelect:v,defaultSelectedRowId:b,onClickActionEvent:g,handleClickAction:y,onDataChange:w})})})}),EA=({metaData:e,actions:t,setAction:i})=>{let r=N(e),n=r.columns,a=r.filters;a=hl(a);const s=cl(n);n=uo(n),n=oo(n),n=dl(n);const o=ul(t??null);return{columns:n,gridConfig:r.gridConfig,hiddenColumns:s,filters:a,setAction:i,...o}},kA=({content:t,buttonText:r="",...n})=>e(qi,{...n,content:t,children:e(Gi,{children:({handlePrint:t})=>e(i,{children:Boolean(r)?e(eo,{onClick:t,children:r}):e(Wo,{title:Ge("Print"),arrow:!0,children:e(C,{onClick:t,size:"small",children:e(Wi,{style:{color:"var(--white)"}})})})})})}),TA=({isOpen:i=!1,validMessage:r,onActionYes:n,onActionNo:a,rows:s,isLoading:o=!1,isError:l=!1,error_msg:h="",error_detail:c="",loadingText:d="Loading..."})=>{const{t:u}=W();return t(dt,{open:i,maxWidth:"sm",children:[e(ut,{children:r}),e(pt,{children:o?e(no,{text:d},"loaderforDeleteing"):l?e(to,{severity:"error",errorMsg:h??"Unknown Error occured",errorDetail:c??""}):null}),t(At,{children:[e(ct,{onClick:()=>a(),color:"secondary",disabled:o,children:u("No")}),e(ct,{onClick:()=>n(s),color:"secondary",disabled:o,children:u("Yes")})]})]})},LA=({validMessage:t,onActionYes:i,onActionNo:r,isLoading:n=!1,isError:a=!1,error_msg:s="",error_detail:o="",loadingText:l="Loading..."})=>{const{state:h}=Ji();return e(TA,{isOpen:!0,validMessage:t,isLoading:n,onActionYes:i,onActionNo:r,isError:a,rows:h,error_msg:s,error_detail:o,loadingText:l})},IA=({MessageTitle:r,Message:n,onActionYes:a,onActionNo:s,rows:o,open:l=!1,loading:h=!1,enableEnterToFocus:c,focusScopeId:d="enter-to-focus-popup-msg"})=>{const u=ad(),{t:A}=W(),{enableEnterToFocus:p}=ns(),f=c??p;return e(i,{children:t($,{fullWidth:!1,open:l,className:"PopupMessageAPIWrapper__base",onKeyDown:e=>{f&&Es(e,d)},...d&&f?{"data-scope-id":d}:{},children:[e(Z,{className:u.dialogTitleClass,children:A(r)}),e(ee,{children:e(te,{style:{color:"black",marginTop:"8px",marginBottom:"6px"},children:A(n)})}),t(ie,{className:u.verifybutton,children:[e(eo,{endIcon:h?e(he,{size:20}):null,onClick:()=>a(o),disabled:h,children:A("Yes")}),e(eo,{onClick:()=>s(),disabled:h,children:A("No")})]})]})})},DA=Ci(e=>({arrayRowContainer:{position:"relative",boxShadow:e.shadows[3],marginBottom:e.spacing(1),paddingRight:"8px",paddingBottom:"8px"},newArrayRowContainer:{position:"relative",boxShadow:"",marginBottom:"0","& .MuiInputBase-root":{marginTop:"0px"},"& .css-1qlanbt-MuiInputBase-root-MuiFilledInput-root":{"&:after":{borderBottom:"none"},"&:hover":{"&:before":{borderBottom:"none"}}},"& .MuiGrid-item":{}},newSecondArrayRowContainer:{position:"relative",boxShadow:"",marginBottom:"0","& .css-1qlanbt-MuiInputBase-root-MuiFilledInput-root":{"&:after":{borderBottom:"none"},"&:hover":{"&:before":{borderBottom:"none"}}}},arrayRowRemoveBtn:{position:"absolute",top:-8,right:-8,color:"#f50057"},arrayRowRemoveBtnStepper:{position:"absolute",top:-1,right:42,color:"#f50057"},arrayRowCard:{width:"100%",position:"relative",overflow:"unset"},arrayRowCardContent:{paddingLeft:"25px"},arrayRowCount:{display:"flex",width:"100%",margin:"0px 0 6px -8px"},arrayRowCountCustomStyle:{display:"flex",width:"100%",margin:"2px 0 0px -8px"},arrayRowCountFixedRows:{display:"flex",width:"100%",margin:"2px 0 6px -8px"},arrayScreenRowCount:{display:"flex",width:"100%",margin:"2px 0 12px 0px"},newArrayRowCardContent:{paddingLeft:"32px","& .MuiInputBase-root":{marginTop:"0px"}},arrayFieldSelected:{padding:"8px 0px 0px 8px",background:"#eee",width:"100%"},arrayFieldUnselected:{width:"100%"}})),UA=({row:r,getAllRowsValues:n,fieldKey:a,oneRow:s,classes:o,removeFn:h,rowIndex:c,removeRowFn:u,totalRows:A,isSubmitting:p,formState:m,formName:g,arrayFieldIDName:w,arrayFieldName:b,fixedRows:v,isDisplayCount:y=!0,isCustomStyle:B=!1,disagreeButtonName:C,agreeButtonName:x,errorTitle:F,displayCountName:S,isRemoveButton:N,selectedRowIndex:E,setSelectedRowIndex:k,hideRemoveIconOnSingleRecord:T,enableEnterToFocus:L})=>{const{messageBoxConfig:I}=fd(),{t:D}=W(),U=ad(),[P,R]=d(!1),[O,Q]=d(!1),[H,M]=d(""),[_,j]=d(!1),[z,V]=d({allow:!0,reason:""}),K=l((e=!1)=>{_||e?h(c):(R(!1),setTimeout(()=>{Q(!1),M(""),j(!1)},1))},[R,Q,M,j,_,h,c]),q=l(async()=>{let e=!0,t="Cannot remove a Row",i=!0;if("function"==typeof u){try{i=await u(m,b,n(),c)}catch(e){console.error("Remove row function error<<",e)}"boolean"==typeof i?e=i:"object"==typeof i&&(e=i?.allow??!1,t=i?.reason??"Cannot remove a Row")}e?R(!0):V({allow:e,reason:t})},[R,c]);let G;G=Boolean(B)?0!==c?o.newArrayRowContainer:o.newSecondArrayRowContainer:Boolean(v)?o.newSecondArrayRowContainer:o.arrayRowContainer;const J=n()?.[b]?.[c]?._rowColor,Y=()=>{k(c);const e=n(),t=Object.keys(r.cells).reduce((t,i)=>{const n=(t=>{const i=t.replace(/\]/g,"").split(/\[|\./);let r=e;return i.forEach(e=>{r=r&&e in r?r[e]:void 0}),r})(r.cells[i].name);return t[i]=n,t},{});"function"==typeof m?.onArrayFieldRowClickHandle&&m?.onArrayFieldRowClickHandle(t),"function"==typeof m?.onArrayFieldRowDoubleClickHandle&&m?.onArrayFieldRowDoubleClickHandle(t)},re={INFO:I?.iconsConfig?.INFO?.color??"dodgerblue",SUCCESS:I?.iconsConfig?.SUCCESS?.color??"green",WARNING:I?.iconsConfig?.WARNING?.color??"orange",ERROR:I?.iconsConfig?.ERROR?.color??"#f44336",CONFIRM:I?.iconsConfig?.CONFIRM?.color??"#474e5b"},ne=I?.iconsConfig?.SUCCESS?.icon??Tt,ae=I?.iconsConfig?.CONFIRM?.icon??kt;return t(f,{children:[Boolean(y)?e(i,{children:e(X,S?{gutterBottom:!0,className:(B?o.arrayRowCountCustomStyle:v?o.arrayRowCountFixedRows:o.arrayRowCount)+` ${b}-arrayField-firstrow`,children:`${S} ${c+1} of ${A}`}:{gutterBottom:!0,className:(B?o.arrayRowCountCustomStyle:v?o.arrayRowCountFixedRows:o.arrayRowCount)+` ${b}-arrayField-firstrow`,children:`${c+1} of ${A}`})}):null,e("div",{onClick:m?.onArrayFieldRowClickHandle&&Y,onDoubleClick:m?.onArrayFieldRowDoubleClickHandle&&Y,className:E===c?o?.arrayFieldSelected:o?.arrayFieldUnselected,children:t(ge,{container:!0,item:!0,xs:12,md:12,sm:12,spacing:1,className:G+` ${b}-array-field-row`,sx:{background:`${Boolean(J)&&"string"==typeof J?J:"none"}`},children:[s,"function"==typeof h&&!Boolean(v)||Boolean(N)?e(i,{children:A>1||!T?e(de,{onClick:q,className:o.arrayRowRemoveBtn,disabled:p,children:e(Et,{})}):null}):null]})}),v&&c+1<A?e(we,{sx:{backgroundColor:"rgba(0, 0, 0, 0.6)",width:"100%"}}):null,t($,{open:P,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",className:"arrayfield__delete__dialog__base",onKeyDown:e=>{L&&Es(e)},children:[e(Z,{className:U.dialogTitleClass,style:{background:_?re.SUCCESS:re.CONFIRM},children:D(_?"Success":"Confirmation")}),t(ee,{sx:{padding:".75rem 10px 1.5rem 10px !important",display:"flex",alignItems:"center",gap:"0.5rem"},children:[e(oe,{children:_?e(ne,{fontSize:"large",style:{color:re.SUCCESS}}):e(ae,{fontSize:"large",style:{color:re.CONFIRM}})}),e(te,{children:e(X,{color:"black",children:_?D("Recordsuccessfullydeleted"):O?D("Pleasewaitdeletingrecord"):Boolean(H)?H:D(F||"AreyouSureyouwanttodeletethisrecord")})})]}),t(ie,{children:[e(eo,{onClick:()=>K(!0),sx:{background:re.CONFIRM,"&:hover":{background:re.CONFIRM}},children:D(x||"Yes")}),e(eo,{onClick:()=>K(!1),sx:{background:re.CONFIRM,"&:hover":{background:re.CONFIRM}},children:D(C||"No")})]})]}),z.allow?null:e(PA,{open:!z.allow,className:"arrayfield__remove__error__dialog__base",icon:"ERROR",reason:z.reason,handleClick:()=>{V({allow:!0,reason:""})},enableEnterToFocus:L},"remove-error-dialog")]},r.fieldIndexKey)},PA=({open:i,icon:r="ERROR",className:n,reason:a,handleClick:s,enableEnterToFocus:l})=>{const c=ad(),d=o(null),{messageBoxConfig:u}=fd(),A={INFO:u?.iconsConfig?.INFO?.color??"dodgerblue",SUCCESS:u?.iconsConfig?.SUCCESS?.color??"green",WARNING:u?.iconsConfig?.WARNING?.color??"orange",ERROR:u?.iconsConfig?.ERROR?.color??"#f44336",CONFIRM:u?.iconsConfig?.CONFIRM?.color??"#474e5b"},p=u?.iconsConfig?.[r]?.icon??Lt;return h(()=>{setTimeout(()=>{d.current&&d.current.focus()},100)},[]),t($,{open:i,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",className:n,onKeyDown:e=>{l&&Es(e)},children:[e(Z,{className:c.dialogTitleClass,style:{background:A[r]},children:Ge("Stop")}),t(ee,{sx:{padding:".75rem 10px 1.5rem 10px !important",display:"flex",alignItems:"center",gap:"0.5rem"},children:[e(oe,{children:e(p,{fontSize:"large",style:{color:A[r]}})}),e(te,{children:e(X,{color:"black",children:a})})]}),e(ie,{children:e(eo,{onClick:s,ref:d,sx:{background:A[r],"&:hover":{background:A[r]}},children:Ge("Ok")})})]})},RA=({arrayFieldName:e,template:t,shouldExclude:i,dependentFields:r,getFixedRowsCount:n})=>{const c=a(Ya),d=s(()=>Object.keys(t),[t]),u=o(d);u.current=d;const A=R(Pa(c.formName)),[p,f]=O(qa(`${c.formName}/${e}`)),m=o(p);m.current=p;const g=Q(Wa(c.formName)),w=Q(Ja(c.formName)),b=Q(Ka(c.formName)),v=_(l((e,t,{fieldName:i})=>{t(Ha(c.formName),i)},[c.formName])),y=_(l((e,t,i)=>e(Ga(c.formName)).includes(i),[c.formName])),B=R(Xa({formName:"function"==typeof i||"function"==typeof n?c.formName:`${c.formName}-NOTEXIST`,fields:r})),C=_(l((e,t,i)=>{const r=[];for(let e=0;e<i.length;e++){let n=Object.keys(i[e]?.cells);for(let a=0;a<n.length;a++){const s=i[e].cells[n[a]].key;t(Ra(`${c.formName}/${s}`),M),r.push(`${c.formName}/${s}`)}}const n=e(za(c.formName)).filter(e=>!r.includes(e));t(za(c.formName),n)},[c.formName])),x=o(null);h(()=>{if("function"==typeof i){const e=Promise.resolve(i({},B,c.formState));x.current=e,e.then(t=>{e===x.current&&(!0===t&&!1===p.excluded?(f(e=>({...e,excluded:!0})),C(p.templateFieldRows)):!1===t&&!0===p.excluded&&f(e=>({...e,excluded:!1})))})}},[i,B,c.formState]),h(()=>{if("function"==typeof n&&!1===p.excluded){let e=n(p,B,c.formState);e<0&&(e=0);const t=p.templateFieldRows.filter(e=>!e.isDeleted).length;if(t!==e){let i=e-t;if(i>0){let e=p.templateFieldRows.length,t=p.templateFieldRows,r=p.lastInsertIndex;for(;i>0;){let n=N(e,t,r,u.current);t=n?.newRows,r=n?.lastIndex??-1,e++,i--}Array.isArray(t)&&f(e=>({...e,lastInsertIndex:r,templateFieldRows:t}))}else{let e=Math.abs(i),t=p.templateFieldRows.map((e,t)=>e.isDeleted?-1:t).filter(e=>-1!==e),r=[];for(let i=0;i<e;i++){const e=t.pop();void 0!==e&&-1!==e&&(r.push(p.templateFieldRows[e]),p.templateFieldRows[e]={isDeleted:!0})}C(r);const n=p.templateFieldRows.filter(e=>!e.isDeleted);f(e=>({...e,templateFieldRows:n,lastInsertIndex:e.lastInsertIndex}))}}}},[B,n,p,C,c.formState]);const F=_(l((e,t,i,r)=>{let n=0,a=!1;const s=i.map(i=>{if(i.isDeleted)return i;const s={...i,cells:{...i.cells}};let o=!1;for(const l of r){const r=i.cells[l],h=`${c.formName}/${r.key}`,d=r.key.replace(/\[\d+\]/,`[${n}]`);if(r.name!==d){s.cells[l]={...r,name:d},a=!0,o=!0;const i=e(Ra(h));i&&t(Ra(h),{...i,name:`${c.formName}/${d}`})}}return n++,o?s:i});a&&f(e=>({...e,templateFieldRows:s}))},[f,c.formName]));h(()=>{F(p.templateFieldRows,u.current)},[p.templateFieldRows,F]);const S=_(l((t,i,r)=>{const n=[],a=r.filter(e=>!e.isDeleted),s=new Map;for(const e of a)for(const t of Object.keys(e.cells)){const i=e.cells[t],r=`${c.formName}/${i.key}`;n.push(r),s.set(r,i.name)}let o={};for(const e of n){const i=t(Ra(e));if(i){if(!0===i.excluded)continue;let t=i.value;if(""===t){const e=i.name.replace(`${c.formName}/`,""),r=ka(c.initialValues,e,"");""!==r&&(t=r)}o=Ta(o,(s.get(e)||i.name).replace(`${c.formName}/`,""),t)}}const l=ka(o,e);return o=Ta(o,e,(e=>{if(!e||"object"!=typeof e||!Array.isArray(e))return[];const t=Object.keys(e).sort((e,t)=>parseInt(e,10)-parseInt(t,10)).map(t=>e[t]).filter(e=>null!=e&&("object"!=typeof e||0!==Object.keys(e).length));return t})(l)),o},[c.formName,e,c.initialValues])),N=l((t,i,r,n)=>{if(t>=0&&t<=i.length){const a=r+1,s=i.filter(e=>!e.isDeleted).length;let o={cells:{},fieldIndexKey:`${c.formName}/${e}/${a}`,isDeleted:!1};for(const t of n){const i=`${e}[${a}].${t}`,r=`${e}[${s}].${t}`;o.cells[t]={key:i,name:r}}return{newRows:[...i.slice(0,t),o,...i.slice(t)],lastIndex:a}}},[e,c.formName]),E=l(e=>{const t=m.current.templateFieldRows;if(e<0||e>=t.length)return;const i=t[e];for(const e of Object.values(i.cells)){const t=`${c.formName}/${e.key}`;b(t),v({fieldName:t})}f(t=>{const i=[...t.templateFieldRows];return i[e]={...i[e],isDeleted:!0},{...t,templateFieldRows:i}});for(const e of u.current){const t=i.cells[e].key,r=`${c.formName}/${t}`;c.lastValidationValue.current.delete(r),c.flagRef.current.delete(r)}},[b,v,f,c.formName]);l(t=>{const i=ka(t,e);if(void 0!==i&&Array.isArray(i)){let e=-1,t=[];for(let r=0;r<i.length;r++){const i=N(t.length,t,e,u.current);void 0!==i&&(e=i.lastIndex,Array.isArray(i.newRows)&&(t=i.newRows))}f(i=>({...i,resetFlag:!1,templateFieldRows:t,lastInsertIndex:e}))}else f(e=>({...e,resetFlag:!1,templateFieldRows:[],lastInsertIndex:-1}))},[e,f,N]);const k=_(l((e,t,i)=>{i.forEach(({key:i,name:r,value:n,componentType:a})=>{const s=`${c.formName}/${i}`,o={...e(Ra(s)),fieldKey:s,name:r,value:n??"",displayValue:n??""};t(Ra(s),o),t(za(c.formName),e=>-1===e.indexOf(s)?[...e,s]:e)})},[c.formName])),T=l(i=>{const r=ka(i,e),n=Object.keys(c?.defaultArrayFieldValues?.[e]).length>0?r?.map(t=>({...c?.defaultArrayFieldValues?.[e],...t})):r;if(void 0!==n&&Array.isArray(n)){let e=-1,i=[],r=[];for(let a=0;a<n.length;a++){const s=N(i.length,i,e,u.current);if(void 0!==s){e=s.lastIndex,i=s.newRows;const o=s.newRows[s.newRows.length-1];for(const e of u.current){const i=t[e],s=o.cells[e].key;o.cells[e].name;const l=ka(n[a],e,null);r.push({key:s,name:`${c.formName}/${s}`,value:l,componentType:i?.componentType||""})}}}k(r),f(t=>({...t,resetFlag:!1,templateFieldRows:i,lastInsertIndex:e}))}else f(e=>({...e,resetFlag:!1,templateFieldRows:[],lastInsertIndex:-1}))},[e,f,N,k,c.formName,t,c?.defaultArrayFieldValues]);h(()=>{const t=`${c.formName}/${e}`;if(y(t)||(g(t),"object"==typeof c.initialValues&&T(c.initialValues)),!0===Boolean(c.resetFieldOnUnmount))return()=>{f({fieldName:t,templateFieldRows:[],lastInsertIndex:-1,resetFlag:!1,excluded:!1}),w(t)}},[g,w,c.formName,e,c.resetFieldOnUnmount,c.initialValues,T,y,f]),h(()=>{!0===p.resetFlag&&"object"==typeof c.initialValues&&Object.keys(c.initialValues).length>0&&T(c.initialValues)},[p.resetFlag,T,c.initialValues]);const L=l(e=>{const t=m.current.templateFieldRows.filter(e=>!e.isDeleted);return t.map((i,r)=>{const n=m.current.templateFieldRows.indexOf(i);return e({row:i,fields:u.current?.slice?.()??[],rowIndex:n,removeFn:E,totalRows:t.length})})},[E,m.current.templateFieldRows]),I=l(()=>{f(e=>({...e,resetFlag:!1,templateFieldRows:[],lastInsertIndex:-1}))},[f]),D=l(e=>{const t=N(e,m.current.templateFieldRows,m.current.lastInsertIndex,u.current);void 0!==t&&Array.isArray(t.newRows)&&f(e=>({...e,lastInsertIndex:t.lastIndex,templateFieldRows:t.newRows}))},[f,N]),U=l(()=>{const e=N(m.current.templateFieldRows.length,m.current.templateFieldRows,m.current.lastInsertIndex,u.current);void 0!==e&&f(t=>({...t,lastInsertIndex:e.lastIndex,templateFieldRows:e.newRows}))},[f,N]),P=l(()=>{const e=N(0,m.current.templateFieldRows,m.current.lastInsertIndex,u.current);void 0!==e&&Array.isArray(e.newRows)&&f(t=>({...t,lastInsertIndex:e.lastIndex,templateFieldRows:e.newRows}))},[f,N]),H=l(()=>{const e=m.current.templateFieldRows.map((e,t)=>e.isDeleted?-1:t).filter(e=>-1!==e),t=e.pop();void 0!==t&&E(t)},[E]),j=l(()=>S(m.current.templateFieldRows),[S]);return{fieldRows:p,templateFieldNames:u.current,clearFieldArray:I,getAllRowsValues:j,unshift:P,push:U,insert:D,pop:H,remove:E,renderRows:L,excluded:p.excluded,isSubmitting:A.isSubmitting,formState:c.formState,formName:c.formName}},OA=A(({name:r,label:n,_fields:c,GridProps:A,enableGrid:p,componentProps:m={},removeRowFn:g,addRowFn:w,arrayFieldIDName:b,dependentFields:v,shouldExclude:y,fixedRows:B,isDisplayCount:C=!0,getFixedRowsCount:x,onFormButtonClickHandel:F,onFormDataChange:S,isRemoveButton:E,changeRowOrder:k,noRecordMessage:T,displayCountName:L,disagreeButtonName:I,agreeButtonName:D,errorTitle:U,hideRemoveIconOnSingleRecord:P=!0,enableEnterToFocus:R,focusScopeId:O})=>{const{t:Q}=W(),H=ns(),{messageBoxConfig:M}=fd(),_=a(Ya),{authState:j}=es(),z=DA(),[V,K]=d(!1),[q,G]=d(""),[J,Y]=d(null);let $=N(c),Z=s(()=>({form:{},fields:$}),[$]);const ee=o(null);null===ee.current&&(ee.current=((e,t,i,r)=>(e=oc(e,Sc,t,i,r),e=sc(e),lc(e)))(Z,Q,j,H));const te=o(ee?.current?.fields?.reduce((e,t)=>(e[t.name]="",e),{})),{renderRows:ie,getAllRowsValues:re,push:ae,isSubmitting:se,excluded:le,formState:he,fieldRows:ce}=RA({arrayFieldName:r,template:te.current,dependentFields:v,shouldExclude:y,getFixedRowsCount:x}),ue=s(()=>ce.templateFieldRows.filter(e=>!e.isDeleted),[ce.templateFieldRows]).length,Ae=ue>0?ue-1:0,[we,ve]=d(0);_.setCurrentStepIndexFnRef=ve,h(()=>{we>Ae&&ve(Ae)},[Ae,we]);const[ye,Be]=d("1");h(()=>{Be(String(we+1))},[we]);const Ce=()=>{let e=parseInt(ye,10);isNaN(e)||e<1||e>ue?Be(String(we+1)):ve(e-1)},xe=l(()=>{const e=re();if("function"==typeof w){let t=w(e,r),i=!1,n="Cannot add a new Row";"boolean"==typeof t&&(i=t),"object"==typeof t&&(i=t?.allow??!1,n=t?.reason??"Cannot add a new Row"),i?(ae(),ve(ue)):(K(!0),G(n))}else ae(),ve(ue)},[ae,w,re,r,ue]),Fe=s(()=>ee.current?.fields?.reduce((e,t)=>(e[t.name]=t,e),{}),[ee]),Se=l((e,t)=>{const i=ue-1,r=i>0?i-1:0;t(e),we>=i&&i>0?ve(r):0===i&&ve(0)},[we,ve,ue]),Ne=ue>0?ce.templateFieldRows.filter(e=>!e.isDeleted).map(e=>ce.templateFieldRows.indexOf(e))[we]:-1;if(le)return null;const Ee=ie(({row:t,removeFn:i,rowIndex:n,fields:a})=>!(n===Ne)||t.isDeleted?null:e(f,{children:e(QA,{row:t,classes:z,removeFn:i,rowIndex:n,totalRows:ue,fields:a,currentMetaToObj:Fe,componentProps:m,t:Q,isDisplayCount:C,arrayFieldName:r,isRemoveButton:E,disagreeButtonName:I,agreeButtonName:D,errorTitle:U,removeRowFn:g,hideRemoveIconOnSingleRecord:P,onFormDataChange:S,onFormButtonClickHandel:F,formState:he,getAllRowsValues:re,isSubmitting:se,fixedRows:B,onRowRemove:()=>Se(n,i),selectedRowIndex:J,setSelectedRowIndex:Y,enableEnterToFocus:R??M.enableEnterToFocus,focusScopeId:O},t.fieldIndexKey)},`${r}-${t.fieldIndexKey}`));let ke=t(f,{children:[t(pe,{className:z.arrayRowCard,children:[e(fe,{title:n,sx:{padding:"5px 16px 0 8px","&>.MuiCardHeader-action":{width:"100%"}},action:t(be,{className:"test",direction:"row",alignItems:"center",justifyContent:"space-between",spacing:2,sx:{width:"100%"},children:[ue>0?t(i,{children:[t(be,{direction:"row",alignItems:"center",children:[C?e(X,{children:Q("string"==typeof L?L:"Record")}):null,e(Ao,{type:"number",value:ye,onChange:e=>{const t=e.target.value;/^[0-9]*$/.test(t)&&Be(t)},onBlur:Ce,autoComplete:"off",onKeyDown:e=>{"Enter"===e.key&&Ce(),[".",",","e","E","+","-"].includes(e.key)&&e.preventDefault()},inputProps:{inputMode:"numeric",pattern:"[0-9]*"},sx:{"& .MuiInputBase-root":{margin:"0 5px !important",height:"28px",width:"40px",pointerEvents:"visible !important","& input":{textAlign:"center"}}}}),t(X,{children:[Q("of")," ",ue]})]}),t(oe,{mt:2,display:"flex",justifyContent:"space-between",gap:.5,children:[e(ne,{title:Q("GoToFirst"),children:e(de,{size:"small",disabled:0===we,onClick:()=>ve(0),color:"secondary",children:e(Yi,{})})}),e(ne,{title:Q("Previous"),children:e(de,{size:"small",disabled:0===we,onClick:()=>ve(e=>Math.max(0,e-1)),color:"secondary",children:e($i,{})})}),e(ne,{title:Q("Next"),children:e(de,{size:"small",disabled:we===Ae,onClick:()=>ve(e=>Math.min(Ae,e+1)),color:"secondary",children:e(Zi,{})})}),e(ne,{title:Q("GoToLast"),children:e(de,{size:"small",disabled:we===Ae,onClick:()=>ve(Ae),color:"secondary",children:e(er,{})})})]})]}):null,e(be,{direction:"row",spacing:2,alignItems:"center",justifyContent:"end",sx:{width:"100%",flex:1},children:Boolean(B)?null:e(de,{style:{background:"#fff",boxShadow:"0 1px 3px rgba(0,0,0,.2)"},onClick:xe,disabled:se,size:"small",children:e(Nt,{})})})]})}),e(me,{children:t(ge,{container:!0,spacing:1,children:[Ee,ue<=0?e(X,{children:Q(T||"NoRecordsFoundclicktheaddbuttontoaddone")}):null]})})]}),V?e(HA,{open:V,className:"arrayfield__add__error__dialog__base",icon:"ERROR",reason:q,handleClick:()=>{K(!1),G("")},enableEnterToFocus:R??M.enableEnterToFocus},"add-error-dialog"):null]});return Boolean(p)?u(ge,{container:!0,...A,key:r},ke):e(f,{children:ke},r)}),QA=A(({row:r,classes:n,formState:a,getAllRowsValues:o,removeFn:h,rowIndex:c,totalRows:u,fields:A,currentMetaToObj:p,componentProps:m,t:w,arrayFieldName:b,isRemoveButton:v,removeRowFn:y,disagreeButtonName:B,agreeButtonName:C,errorTitle:x,hideRemoveIconOnSingleRecord:F,onFormButtonClickHandel:S,onFormDataChange:N,isSubmitting:E,fixedRows:k,onRowRemove:T,selectedRowIndex:L,setSelectedRowIndex:I,enableEnterToFocus:D,focusScopeId:U})=>{const{messageBoxConfig:P}=fd(),R=ad(),[O,Q]=d(!1),[H,M]=d(!1),[_,j]=d(""),[z,V]=d(!1),[K,q]=d({allow:!0,reason:""}),G=l((e=!1)=>{z||e?T():(Q(!1),setTimeout(()=>{M(!1),j(""),V(!1)},1))},[Q,M,j,V,z,T]),W=l(async()=>{let e=!0,t="Cannot remove a Row",i=!0;if("function"==typeof y){try{i=await y(a,b,o(),c)}catch(e){console.error("Remove row function error<<",e)}"boolean"==typeof i?e=i:"object"==typeof i&&(e=i?.allow??!1,t=i?.reason??"Cannot remove a Row")}e?Q(!0):q({allow:e,reason:t})},[y,a,b,o,c]);o();const J=()=>{I(c);const e=o(),t=Object.keys(r.cells).reduce((t,i)=>{const n=(t=>{const i=t.replace(/\]/g,"").split(/\[|\./);let r=e;return i.forEach(e=>{r=r&&e in r?r[e]:void 0}),r})(r.cells[i].name);return t[i]=n,t},{});"function"==typeof a?.onArrayFieldRowClickHandle&&a?.onArrayFieldRowClickHandle(t),"function"==typeof a?.onArrayFieldRowDoubleClickHandle&&a?.onArrayFieldRowDoubleClickHandle(t)},Y=s(()=>A.map(t=>{const i=p[t];if(!Boolean(i))return null;i.onFormButtonClickHandel=S,i.onFormDataChange=N;const n=Kh(i,{},b,m,U);return e(f,{children:g(n,{fieldKey:r.cells[t].key,name:r.cells[t].name,label:w(n?.props?.label),placeholder:w(n?.props?.placeholder)})},r.cells[t].key)}),[A,p,S,N,b,m,r.cells,w]),re={INFO:P?.iconsConfig?.INFO?.color??"dodgerblue",SUCCESS:P?.iconsConfig?.SUCCESS?.color??"green",WARNING:P?.iconsConfig?.WARNING?.color??"orange",ERROR:P?.iconsConfig?.ERROR?.color??"#f44336",CONFIRM:P?.iconsConfig?.CONFIRM?.color??"#474e5b"},ne=P?.iconsConfig?.SUCCESS?.icon??tr,ae=P?.iconsConfig?.CONFIRM?.icon??ir;return t(f,{children:[t(ge,{container:!0,item:!0,xs:12,spacing:1,onClick:a?.onArrayFieldRowClickHandle&&J,onDoubleClick:a?.onArrayFieldRowDoubleClickHandle&&J,children:[Y,"function"==typeof h&&!Boolean(k)||Boolean(v)?e(i,{children:u>1||!F?e(de,{onClick:W,className:n.arrayRowRemoveBtnStepper,disabled:E,children:e(Et,{})}):null}):null]}),t($,{open:O,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",className:"arrayfield__delete__dialog__base",onKeyDown:e=>{D&&Es(e)},children:[e(Z,{className:R.dialogTitleClass,style:{background:z?re.SUCCESS:re.CONFIRM},children:w(z?"Success":"Confirmation")}),t(ee,{sx:{padding:".75rem 10px 1.5rem 10px !important",display:"flex",alignItems:"center",gap:"0.5rem"},children:[e(oe,{children:z?e(ne,{fontSize:"large",style:{color:re.SUCCESS}}):e(ae,{fontSize:"large",style:{color:re.CONFIRM}})}),e(te,{children:e(X,{color:"black",children:z?w("Recordsuccessfullydeleted"):H?w("Pleasewaitdeletingrecord"):Boolean(_)?_:w(x||"AreyouSureyouwanttodeletethisrecord")})})]}),t(ie,{children:[e(eo,{autoFocus:!0,onClick:()=>G(!0),sx:{background:re.CONFIRM,"&:hover":{background:re.CONFIRM}},children:w(C||"Yes")}),e(eo,{onClick:()=>G(!1),sx:{background:re.CONFIRM,"&:hover":{background:re.CONFIRM}},children:w(B||"No")})]})]}),K.allow?null:e(HA,{open:!K.allow,className:"arrayfield__remove__error__dialog__base",icon:"ERROR",reason:K.reason,handleClick:()=>{q({allow:!0,reason:""})},enableEnterToFocus:D},"remove-error-dialog")]})}),HA=({open:i,icon:r="ERROR",className:n,reason:a,handleClick:s,enableEnterToFocus:l})=>{const c=ad(),d=o(null),{messageBoxConfig:u}=fd(),A={INFO:u?.iconsConfig?.INFO?.color??"dodgerblue",SUCCESS:u?.iconsConfig?.SUCCESS?.color??"green",WARNING:u?.iconsConfig?.WARNING?.color??"orange",ERROR:u?.iconsConfig?.ERROR?.color??"#f44336",CONFIRM:u?.iconsConfig?.CONFIRM?.color??"#474e5b"},p=u?.iconsConfig?.[r]?.icon??rr;return h(()=>{setTimeout(()=>{d.current&&d.current.focus()},100)},[]),t($,{open:i,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",className:n,onKeyDown:e=>{l&&Es(e)},children:[e(Z,{className:c.dialogTitleClass,style:{background:A[r]},children:Ge("Stop")}),t(ee,{sx:{padding:".75rem 10px 1.5rem 10px !important",display:"flex",alignItems:"center",gap:"0.5rem"},children:[e(oe,{children:e(p,{fontSize:"large",style:{color:A[r]}})}),e(te,{children:e(X,{color:"black",children:a})})]}),e(ie,{children:e(eo,{onClick:s,ref:d,sx:{background:A[r],"&:hover":{background:A[r]}},children:Ge("Ok")})})]})};var MA=Object.freeze({__proto__:null,ArrayField2:({name:i,label:r,_fields:n,GridProps:a,enableGrid:s,componentProps:h={},removeRowFn:c,addRowFn:A,arrayFieldIDName:p,dependentFields:m,shouldExclude:w,fixedRows:b,isDisplayCount:v,isCustomStyle:y,getFixedRowsCount:B,onFormButtonClickHandel:C,onFormDataChange:x,disagreeButtonName:F,agreeButtonName:S,errorTitle:E,displayCountName:k,isRemoveButton:T,changeRowOrder:L,noRecordMessage:I,hideRemoveIconOnSingleRecord:D=!0,enableEnterToFocus:U,focusScopeId:P,formState:R})=>{const{t:O}=W(),Q=ns(),{messageBoxConfig:H}=fd(),{authState:M}=es();let _=N(n);const j=DA(),[z,V]=d(!1),[K,q]=d(""),[G,J]=d(null);let Y={form:{},fields:_};const $=o(null);null===$.current&&($.current=((e,t,i,r,n)=>(e=oc(e,Sc,t,i,r,n),e=sc(e),lc(e)))(Y,O,M,Q,R));const Z=o($?.current?.fields?.reduce((e,t)=>(e[t.name]="",e),{})),ee=o($?.current?.fields?.reduce((e,t)=>(e[t.name]=t,e),{})),{renderRows:te,getAllRowsValues:ie,unshift:re,isSubmitting:ne,formState:ae,formName:se,excluded:oe,push:le}=Is({arrayFieldName:i,template:Z.current,dependentFields:m,shouldExclude:w,getFixedRowsCount:B}),he=l(()=>{setTimeout(()=>{const e=document.querySelectorAll(`.${i}-arrayField-firstrow`)?.[0],t=document.querySelectorAll(`.${i}-array-field-row`),r=t[t.length-1];!L&&e?e.scrollIntoView({behavior:"smooth",block:"center"}):L&&r&&r.scrollIntoView({behavior:"smooth",block:"center"})},50)},[i,L]),ce=l(()=>{if("function"==typeof A){let e=A(ie(),i),t=!1,r="Cannot add a new Row";"boolean"==typeof e&&(t=e),"object"==typeof e&&(t=e?.allow??!1,r=e?.reason??"Cannot add a new Row"),t?(Boolean(L)?le():re(),he()):(V(!0),q(r))}else Boolean(L)?le():re(),he()},[re,ie]);if(oe)return null;let ue=te(({row:t,removeFn:r,rowIndex:n,fields:a,totalRows:s})=>{const o=a.map(r=>{const a=ee.current[r];if(!Boolean(a))return null;let s;a.onFormButtonClickHandel=C,a.onFormDataChange=x,s=0===n?{...a}:{...a,label:null};const o=Kh(y?s:a,{},i,h,P);let l=g(o,{fieldKey:t.cells[r].key,name:t.cells[r].name,label:O(o?.props?.label),placeholder:O(o?.props?.placeholder)});return e(f,{children:l},t.cells[r].key)});return e(UA,{fieldKey:t.cells[p??""]?.key??"",getAllRowsValues:ie,oneRow:o,classes:j,removeFn:r,rowIndex:n,removeRowFn:c,row:t,totalRows:s,isSubmitting:ne,formState:ae,formName:se,arrayFieldIDName:p,arrayFieldName:i,fixedRows:b,isDisplayCount:v,isCustomStyle:y,disagreeButtonName:F,agreeButtonName:S,errorTitle:E,displayCountName:k,isRemoveButton:T,selectedRowIndex:G,setSelectedRowIndex:J,hideRemoveIconOnSingleRecord:D,enableEnterToFocus:U??H.enableEnterToFocus},t.fieldIndexKey)});let Ae=t(f,{children:[t(pe,{className:j.arrayRowCard,children:[e(fe,{style:{paddingTop:0,paddingBottom:0,position:"sticky",top:0,zIndex:1},sx:{"& .MuiCardHeader-title":r?{background:"var(--theme-color5)",ml:1.5,mt:1,p:1,color:"var(--theme-color2)"}:null,"& .MuiCardHeader-action":{}},title:r,action:Boolean(b)?null:e(de,{style:{background:"#fff",boxShadow:"0 1px 3px rgba(0,0,0,.2)"},onClick:ce,disabled:ne,size:"small",children:e(Nt,{})})}),e(me,{className:j.arrayRowCardContent,style:{paddingTop:"0px",paddingBottom:"16px"},children:t(ge,{container:!0,item:!0,spacing:1,xs:12,md:12,sm:12,style:{marginTop:"2px"},children:[ue,ue.length<=0?e(X,{children:O(I||"NoRecordsFoundclicktheaddbuttontoaddone")}):null]})})]}),z?e(PA,{open:z,className:"arrayfield__add__error__dialog__base",icon:"ERROR",reason:K,handleClick:()=>{V(!1),q("")},enableEnterToFocus:U??H.enableEnterToFocus},"add-error-dialog"):null]});return Boolean(s)?u(ge,{container:!0,...a,key:i},Ae):e(f,{children:Ae},i)},ArrayFieldStepper:OA,ArrayFieldValues:({name:i,label:r,_fields:n,GridProps:a,enableGrid:s,defaultValue:o,componentProps:l={}})=>{let h=N(n);const c=DA();if(!Array.isArray(o))return e("div",{children:"Invalid data for arrayField"});const d=o.map((t,r)=>{const n=(a=h,s=t,Array.isArray(a)?a.map(e=>{const{name:t,...i}=e;return{...i,name:t,defaultValue:s[t]??"N/A"}}):[]);var a,s;const o=n.map((t,r)=>{const n=((t,i,r,n={})=>{const{render:a,schemaValidation:s,...o}=t;let l=null;switch(a.componentType){case"arrayField":l=Wh;break;case"spacer":l=Gh;break;case"typography":l=Xh;break;case"hidden":l=Jh;break;default:l=qh}if(l===Gh||l===Xh)return e(l,{...o},`${r}/${o.name}`);{const e={...n[a.componentType],...o},t={...i?.gridConfig?.item,...o?.GridProps};return u(l,{...e,fieldKey:o.name,key:`${r}/${o.name}`,enableGrid:!0,GridProps:{item:!0,xs:t?.xs??"auto",md:t?.sm??"auto",xl:t?.xs??"auto"}})}})(t,{},i,l);return e(f,{children:n},`${t.name}-${r}`)});return e(f,{children:e(q,{container:!0,item:!0,xs:12,md:12,sm:12,spacing:2,className:c.arrayRowContainer,children:o})},r)});let A=e(f,{children:t(at,{className:c.arrayRowCard,children:[e(lt,{title:r}),e(st,{className:c.arrayRowCardContent,children:e(q,{container:!0,spacing:1,xs:12,md:12,sm:12,children:d})})]})});return Boolean(s)?u(q,{container:!0,...a,key:i},A):e(f,{children:A},i)}});const _A=xi({root:{"& .MuiFormLabel-root":{fontWeight:600,textTransform:"capitalize",fontSize:"1rem","@media (max-width: 1200px)":{fontSize:"0.75rem"},"@media (max-width: 1440px)":{fontSize:"0.875rem"}},"& label.Mui-focused":{color:"var(--theme-color1)"},"& .MuiRadio-root.Mui-checked":{color:"var(--theme-color1) !important"}}})($e),jA=({name:t,validate:i,validationRun:r,shouldExclude:n,isReadOnly:a,postValidationSetCrossFieldValues:s,runPostValidationHookAlways:o,dependentFields:h,fieldKey:c,label:A,options:p,FormControlProps:f,FormLabelProps:m,RadioGroupProps:g,FormHelperTextProps:w,FormControlLabelProps:b,GridProps:v,enableGrid:y,runValidationOnDependentFieldsChange:C,skipValueUpdateFromCrossFieldWhenReadOnly:x,CircularProgressProps:F,_optionsKey:S,disableCaching:N,runExternalFunction:E,onFormDataChange:k,...T})=>{const{formState:L,value:I,error:D,touched:U,handleChange:P,handleBlur:R,isSubmitting:O,fieldKey:Q,name:H,excluded:M,readOnly:_,dependentValues:j,incomingMessage:z,runValidation:V,whenToRunValidation:K,setIncomingMessage:W}=as({name:t,fieldKey:c,dependentFields:h,validate:i,validationRun:r,runPostValidationHookAlways:o,postValidationSetCrossFieldValues:s,isReadOnly:a,shouldExclude:n,runValidationOnDependentFieldsChange:C,skipValueUpdateFromCrossFieldWhenReadOnly:x,runExternalFunction:E,onFormDataChange:k}),[J,X]=d([]),Y=l(e=>Fo(J)(e),[J]),$=l(e=>{let t=Y("object"==typeof e?e?.target?.value??"":e);P(e,t[0])},[P,Y]),{loadingOptions:Z}=Bo(L,p,X,$,j,z,V,K,S,N,W,!0,"",!1);if(M)return null;const ee=U&&""!==(D??""),te=J.map(t=>u(Ye,{...b,control:e(or,{...T,disabled:_,readOnly:_,tabIndex:_?-1:void 0}),key:t.value,label:t.label,value:t.value})),ie=u(_A,{...f,key:Q,component:"fieldset",disabled:O,error:!O&&ee,onBlur:R},e(Je,{...m,component:"label",children:A}),e(sr,{...g,onChange:$,name:H,value:I,children:Z?e(B,{position:"end",children:e(G,{color:"primary",variant:"indeterminate",...F})}):te}),!O&&ee?e(Ze,{...w,children:D}):null);return Boolean(y)?u(q,{...v,key:Q},ie):ie};var zA=Object.freeze({__proto__:null,Radio:jA,default:jA});const VA=(e,t)=>Array.isArray(e)&&e.indexOf(t)>-1;var KA=Object.freeze({__proto__:null,Switch:({name:t,validate:i,validationRun:r,shouldExclude:n,isReadOnly:a,postValidationSetCrossFieldValues:s,runPostValidationHookAlways:o,dependentFields:l,fieldKey:h,label:c,FormControlProps:d,FormHelperTextProps:A,FormControlLabelProps:p,GridProps:f,enableGrid:m,runValidationOnDependentFieldsChange:g,skipValueUpdateFromCrossFieldWhenReadOnly:w,...b})=>{const{value:v,error:y,touched:B,handleChange:C,handleBlur:x,isSubmitting:F,fieldKey:S,name:N,excluded:E,readOnly:k}=as({name:t,fieldKey:h,dependentFields:l,validate:i,validationRun:r,runPostValidationHookAlways:o,postValidationSetCrossFieldValues:s,runValidationOnDependentFieldsChange:g,skipValueUpdateFromCrossFieldWhenReadOnly:w,isReadOnly:a,shouldExclude:n});if(E)return null;const T=B&&""!==(y??""),L=u($e,{...d,key:S,component:"fieldset",disabled:F,error:!F&&T,onBlur:x,tabIndex:k?-1:void 0},e(Ye,{...p,name:N,control:e(It,{...b,readOnly:k,tabIndex:k?-1:void 0}),onChange:C,label:c,checked:Boolean(v)}),!F&&T?e(Ze,{...A,children:y}):null);return Boolean(m)?e(q,{...f,children:L}):L},SwitchGroup:({name:t,validate:i,validationRun:r,shouldExclude:n,isReadOnly:a,postValidationSetCrossFieldValues:s,runValidationOnDependentFieldsChange:o,runPostValidationHookAlways:h,dependentFields:c,fieldKey:A,label:p,options:f,FormControlProps:m,FormLabelProps:g,FormGroupProps:w,FormHelperTextProps:b,FormControlLabelProps:v,GridProps:y,enableGrid:C,CircularProgressProps:x,_optionsKey:F,disableCaching:S,skipValueUpdateFromCrossFieldWhenReadOnly:N,...E})=>{const{formState:k,value:T,error:L,touched:I,handleChange:D,handleBlur:U,isSubmitting:P,fieldKey:R,name:O,excluded:Q,readOnly:H,dependentValues:M,incomingMessage:_,runValidation:j,whenToRunValidation:z,setIncomingMessage:V}=as({name:t,fieldKey:A,dependentFields:c,validate:i,validationRun:r,runPostValidationHookAlways:h,postValidationSetCrossFieldValues:s,isReadOnly:a,shouldExclude:n,runValidationOnDependentFieldsChange:o,skipValueUpdateFromCrossFieldWhenReadOnly:N}),[K,W]=d([]),J=l(e=>Fo(K)(e),[K]),X=l(e=>{let t=J("object"==typeof e?e?.target?.value??"":e);D(e,t[0])},[D,J]),{loadingOptions:Y}=Bo(k,f,W,X,M,_,j,z,F,S,V,!0,"",!1);if(Q)return null;const $=I&&""!==(L??""),Z=K.map(t=>u(Ye,{...v,control:e(It,{...E,readOnly:H,tabIndex:H?-1:void 0}),key:t.value,name:O,onChange:X,label:t.label,value:t.value,checked:VA(T,t.value)})),ee=u($e,{...m,key:R,component:"fieldset",disabled:P,error:!P&&$,onBlur:U},e(Je,{...g,component:"label",children:p}),e(Xe,{...w,children:Y?e(B,{position:"end",children:e(G,{color:"primary",variant:"indeterminate",...x})}):Z}),!P&&$?e(Ze,{...b,children:L}):null);return Boolean(C)?e(q,{...y,children:ee}):ee}});const qA=({name:i,fieldKey:r,shouldExclude:n,isReadOnly:a,postValidationSetCrossFieldValues:s,runPostValidationHookAlways:o,dependentFields:c,validate:A,validationRun:p,label:m,InputLabelProps:g,GridProps:w,enableGrid:b,runValidationOnDependentFieldsChange:v,skipValueUpdateFromCrossFieldWhenReadOnly:y,...B})=>{const{handleChange:C,handleBlur:x,isSubmitting:F,fieldKey:S,name:N,value:E,excluded:k}=as({name:i,fieldKey:r,dependentFields:c,validate:A,validationRun:p,runPostValidationHookAlways:o,postValidationSetCrossFieldValues:s,isReadOnly:a,shouldExclude:n,runValidationOnDependentFieldsChange:v,skipValueUpdateFromCrossFieldWhenReadOnly:y}),[T,L]=d(Number(E));h(()=>{L(Number(E))},[E]);const[I,D]=d(!1),U=l((e,t)=>{L(t)},[L]),P=l((e,t)=>{C(t)},[C]),R=l(()=>{x(),D(!1)},[x,D]),O=l(()=>{D(!0)},[D]);if(k)return null;const Q=t(f,{children:[e(Ut,{...g,focused:I,disabled:F,children:m}),u(Dt,{...B,key:S,id:S,name:N,value:T,disabled:F,onFocus:O,onChange:U,onChangeCommitted:P,onBlur:R})]},S);return Boolean(b)?e(q,{...w,children:Q}):Q};var GA=Object.freeze({__proto__:null,Slider:qA,default:qA});function WA(e,t,i,r=!1){const n={};return i&&ya(e,i,{ignoreTime:r})&&(n._maxDt=i),t&&Ca(e,t,{ignoreTime:r})&&(n._minDt=t),n}io(".MuiPickersDay-current.MuiPickersDay-day{color:var(--theme-color1)}.MuiPickersDay-daySelected.MuiPickersDay-day,.MuiPickersDay-daySelected.MuiPickersDay-day:hover{background-color:var(--theme-color1);color:var(--white)}.MuiPickersYear-root.MuiPickersYear-yearSelected{color:var(--theme-color1)}.MuiPickersLayout-contentWrapper .MuiButtonBase-root.Mui-selected{background-color:var(--theme-color1)!important;color:#fff}.MuiPickersLayout-contentWrapper .MuiButtonBase-root:hover{background-color:#8000000a}.MuiPickersSlideTransition-root{min-height:220px}");io(".MuiPickersClock-pin,.MuiPickersClockPointer-pointer,.MuiPickersToolbar-toolbar{background-color:var(--theme-color1)!important}.MuiPickersClockPointer-thumb{background-color:var(--white)!important;border:14px solid var(--theme-color1)!important}.MuiPickersClockPointer-noPoint{background-color:var(--theme-color1)!important;border:14px solid var(--theme-color1)!important}.MuiPickersClockNumber-clockNumberSelected,.MuiPickersToolbarText-toolbarBtnSelected{color:var(--white)!important}.MuiPickersToolbarText-toolbarTxt:not(.MuiPickersToolbarText-toolbarBtnSelected){color:var(--white-dim)!important}.MuiPickersLayout-root>.MuiDialogActions-root>button.MuiButton-textPrimary{color:var(--theme-color1)}");var JA=Object.freeze({__proto__:null,DatePicker:({name:t,validate:r,validationRun:n,shouldExclude:a,isReadOnly:c,postValidationSetCrossFieldValues:A,setValueOnDependentFieldsChange:p,setValueOnDependentFieldsValueChange:f,runPostValidationHookAlways:m,dependentFields:g,fieldKey:w,type:b,GridProps:v,enableGrid:y,isFieldFocused:B,InputProps:C,inputProps:x,runValidationOnDependentFieldsChange:F,skipValueUpdateFromCrossFieldWhenReadOnly:S,required:N,disablePast:E,disableFuture:k,ignoreInSubmit:T=!1,label:L,setFieldLabel:I,placeholder:D,format:P,CircularProgressProps:R,componentType:O,runPostValidationForInitValue:Q,className:H,dependentFieldDebounceDelay:M=300,setColor:_,runExternalFunction:j,onFormDataChange:z,...V})=>{const[K,G]=d(null),{commonDateFormat:X}=ns(),{authState:Y}=es(),{value:$,prevValue:Z,error:ee,touched:te,handleChange:ie,handleBlur:re,isSubmitting:ne,fieldKey:ae,name:oe,excluded:ce,readOnly:de,setIgnoreInSubmit:ue,incomingMessage:Ae,setIncomingMessage:pe,whenToRunValidation:fe,runValidation:me,dependentValues:ge,validationRunning:we,setErrorAsCB:be,formState:ve}=as({name:t,fieldKey:w,dependentFields:g,validate:r,componentType:O,validationRun:n,runPostValidationHookAlways:m,postValidationSetCrossFieldValues:A,isReadOnly:c,shouldExclude:a,runValidationOnDependentFieldsChange:F,skipValueUpdateFromCrossFieldWhenReadOnly:S,runPostValidationForInitValue:Q,dependentFieldDebounceDelay:M,runExternalFunction:j,onFormDataChange:z}),[ye,Be]=d("string"==typeof _?_:"");h(()=>{if("function"==typeof _){const e=_($,ds(ge),ve);Be("string"!=typeof e?"":e)}},[$,ge,_]),h(()=>{if(Boolean(T))if("function"==typeof T){let e=T(ds(ge),ve,{isSubmitting:ne,value:$});ue(e)}else ue(T)},[T,ue,ge,$]),h(()=>{if("string"==typeof $){let e=Fs($);if(!isNaN(e)){const t=WA(e,V?.minDate,V?.maxDate,!0);ie(e,void 0,!1,t)}}},[$,ie]);const{t:Ce}=W(),xe=o();h(()=>{B&&setTimeout(()=>{xe?.current?.focus?.()},1)},[B]),h(()=>{if(null!==Ae&&"object"==typeof Ae&&Object.keys(Ae).length){const{isFieldFocused:e,value:t,ignoreUpdate:i}=Ae;if(e&&setTimeout(()=>{xe?.current?.focus?.()},50),Boolean(t)||""===t){const e=WA(t,V?.minDate,V?.maxDate,!0);ie(t,void 0,!0,{...e,isIncomingValue:!0}),i||"onBlur"!==fe||me({value:t,isIncomingValue:!0},!0)}pe(null)}},[Ae,ie,me,fe]);const Fe=s(()=>{const e=ds(ge),t=us(e);return JSON.stringify(t.sort((e,t)=>e.fieldKey.localeCompare(t.fieldKey)).map(e=>e.value))},[ge]);h(()=>{if(Fe&&"function"==typeof f){let e=f(ds(ge),ve,{value:$,isSubmitting:ne});if(null!=e){const t=WA(e,V?.minDate,V?.maxDate,!0);ie(e,void 0,!1,t)}}},[Fe,f,ie]),h(()=>{if("function"==typeof p){let e=p(ds(ge),ve,{value:$,isSubmitting:ne});if(null!=e){const t=WA(e,V?.minDate,V?.maxDate,!0);ie(e,void 0,!1,t)}}},[ge,ie,p]);const Se=s(()=>{if("function"==typeof I)return I(ds(ge),$)},[I,ge,$]),Ne=te&&""!==(ee??""),Ee=l(t=>e(i,{children:void 0===Z||void 0===$||U(Fs(Z).toUTCString(),Fs($).toUTCString())?e(Ao,{...t}):e(Jo,{title:e(Xo,{label:`${Ce("OldValueOf")} ${Se?.label?Ce(Se.label):L}`,value:(()=>{if(!Z)return"(blank)";try{const e=Fs(Z);return ze(e,(P??X)||"dd/MM/yyyy")}catch{return console.error("Invalid time provided while comparing old value!!!"),""}})()}),arrow:!0,followCursor:!0,children:e(Ao,{...t})})}),[Z]);if(ce)return null;const ke=u(Ho,{...V,key:ae,label:Se?.label?Ce(Se.label):L,format:(P??X)||"dd/MM/yyyy",value:""===$||null===$?null:Fs($),tabIndex:de?-1:void 0,onChange:e=>{const t=WA(e,V?.minDate,V?.maxDate,!0);ie(e,void 0,!1,t)},onSelectedSectionsChange:e=>{G(e)},selectedSections:K,onClose:()=>{setTimeout(()=>re(),0)},disabled:ne||de,readOnly:de,disablePast:E,disableFuture:k,className:J(H,{hasOldValue:void 0!==Z&&void 0!==$&&!U(Fs(Z).toUTCString(),Fs($).toUTCString())}),slots:{textField:Ee},slotProps:{textField:{onBlur:e=>{const t=WA($,V?.minDate,V?.maxDate,!0);re(e,t)},onKeyDown:e=>{const t=P??X;if("ArrowUp"===e.key||"ArrowDown"===e.key){const i=e.target.value;if(!Ve($)&&i?.toLowerCase()===t?.toLowerCase()){const e=Y?.workingDate||new Date;setTimeout(()=>{const t=WA(new Date(e),V?.minDate,V?.maxDate,!0);ie(new Date(e),void 0,!1,t)},0)}}else if("Home"===e.key)G(0);else if("End"===e.key){const e=t.includes("/")?"/":t.includes("-")?"-":null,i=e?t.split(e).length:1;G(i-1)}},id:ae,name:oe,placeholder:de?"":Se?.placeholder?Ce(Se.placeholder):D,autoComplete:"off",required:N,error:!ne&&Ne,helperText:e(le,{children:!ne&&Ne?ee:null}),inputProps:{tabIndex:de?-1:void 0,...x},InputProps:{style:{background:Boolean(de||ne)?"#f3f3f3":"",...!ne&&Boolean(ye)?{color:ye}:{}},readOnly:de,startAdornment:we?e(se,{position:"end",sx:{position:"absolute",right:"38px"},children:e(he,{color:"secondary",variant:"indeterminate",size:20,...R})}):null,...C},InputLabelProps:{shrink:!0},inputRef:xe},actionBar:{actions:["today","accept","cancel"]}},sx:{width:"100%"},cancelLabel:e(ct,{color:"secondary",style:{border:"1px solid rgba(128, 0, 0, 0.23)"},disableElevation:!0,children:Ce("Cancel")}),okLabel:e(ct,{color:"secondary",variant:"contained",disableElevation:!0,children:Ce("Ok")})});return Boolean(y)?u(q,{...v,key:ae},ke):ke},DateTimePicker:({name:t,validate:r,validationRun:n,shouldExclude:a,isReadOnly:c,postValidationSetCrossFieldValues:A,setValueOnDependentFieldsChange:p,setValueOnDependentFieldsValueChange:f,runPostValidationHookAlways:m,dependentFields:g,fieldKey:w,type:b,GridProps:v,CircularProgressProps:y,enableGrid:B,isFieldFocused:C,InputProps:x,inputProps:F,runValidationOnDependentFieldsChange:S,skipValueUpdateFromCrossFieldWhenReadOnly:N,disablePast:E,disableFuture:k,ignoreInSubmit:T=!1,label:L,setFieldLabel:I,format:D,required:P,placeholder:R,runPostValidationForInitValue:O,componentType:Q,className:H,dependentFieldDebounceDelay:M=300,setColor:_,runExternalFunction:j,onFormDataChange:z,...V})=>{const{commonDateTimeFormat:K}=ns(),{value:G,prevValue:W,error:X,touched:Y,handleChange:$,handleBlur:Z,isSubmitting:ee,fieldKey:te,name:ie,excluded:re,readOnly:ne,setIgnoreInSubmit:ae,incomingMessage:oe,setIncomingMessage:ce,whenToRunValidation:de,dependentValues:ue,runValidation:Ae,validationRunning:pe,formState:fe}=as({name:t,fieldKey:w,dependentFields:g,validate:r,validationRun:n,runPostValidationHookAlways:m,postValidationSetCrossFieldValues:A,isReadOnly:c,shouldExclude:a,runValidationOnDependentFieldsChange:S,skipValueUpdateFromCrossFieldWhenReadOnly:N,runPostValidationForInitValue:O,componentType:Q,dependentFieldDebounceDelay:M,runExternalFunction:j,onFormDataChange:z}),[me,ge]=d("string"==typeof _?_:"");h(()=>{if("function"==typeof _){const e=_(G,ds(ue),fe);ge("string"!=typeof e?"":e)}},[G,ue,_]),h(()=>{if(Boolean(T))if("function"==typeof T){let e=T(ds(ue),fe,{isSubmitting:ee,value:G});ae(e)}else ae(T)},[T,ae,ue,G]),h(()=>{if("string"==typeof G){let e=Fs(G);if(!isNaN(e)){const t=WA(e,V?.minDate,V?.maxDate);$(e,void 0,!1,t)}}},[G,$]);const we=o();h(()=>{C&&setTimeout(()=>{we?.current?.focus?.()},1)},[C]),h(()=>{if(null!==oe&&"object"==typeof oe&&Object.keys(oe).length){const{value:e,ignoreUpdate:t}=oe;if(Boolean(e)||""===e){const i=WA(e,V?.minDate,V?.maxDate);$(e,void 0,!0,{...i,isIncomingValue:!0}),t||"onBlur"!==de||Ae({value:e,isIncomingValue:!0},!0)}ce(null)}},[oe,$,Ae,de]);const be=s(()=>{const e=ds(ue),t=us(e);return JSON.stringify(t.sort((e,t)=>e.fieldKey.localeCompare(t.fieldKey)).map(e=>e.value))},[ue]);h(()=>{if(be&&"function"==typeof f){let e=f(ds(ue),fe,{value:G,isSubmitting:ee});if(null!=e){const t=WA(e,V?.minDate,V?.maxDate);$(e,void 0,!1,t)}}},[be,f,$]),h(()=>{if("function"==typeof p){let e=p(ds(ue),fe,{value:G,isSubmitting:ee});if(null!=e){const t=WA(e,V?.minDate,V?.maxDate);$(e,void 0,!1,t)}}},[ue,$,p]);const ve=s(()=>{if("function"==typeof I)return I(ds(ue),G)},[I,ue,G]),ye=l(t=>e(i,{children:void 0===W||void 0===G||U(Fs(W).toUTCString(),Fs(G).toUTCString())?e(Ao,{...t}):e(Jo,{title:e(Xo,{label:`${Ge("OldValueOf")} ${ve?.label?Ge(ve.label):L}`,value:(()=>{if(!W)return"(blank)";try{const e=Fs(W);return ze(e,(D??K)||"dd/MM/yyyy HH:mm:ss aa")}catch{return console.error("Invalid time provided while comparing old value!!!"),""}})()}),arrow:!0,followCursor:!0,children:e(Ao,{...t})})}),[W]),Be=Y&&""!==(X??"");if(re)return null;const Ce=u(_o,{...V,key:te,label:ve?.label?Ge(ve.label):L,format:(D??K)||"dd/MM/yyyy HH:mm:ss aa",value:""===G||null===G?null:Fs(G),views:["year","month","day","hours","minutes","seconds"],disablePast:E,disableFuture:k,onChange:e=>{const t=WA(e,V?.minDate,V?.maxDate);$(e,void 0,!1,t)},onClose:()=>{setTimeout(()=>Z(),0)},disabled:ee||ne,readOnly:ne,className:J(H,{hasOldValue:void 0!==W&&void 0!==G&&!U(Fs(W).toUTCString(),Fs(G).toUTCString())}),slots:{textField:ye},slotProps:{textField:{name:ie,id:te,onBlur:e=>{const t=WA(G,V?.minDate,V?.maxDate);Z(e,t)},placeholder:ne?"":ve?.placeholder?Ge(ve.placeholder):R,required:P,error:!ee&&Be,helperText:e(le,{children:!ee&&Be?X:null}),inputProps:{tabIndex:ne?-1:void 0,...F},InputProps:{style:{background:Boolean(ne||ee)?"#f3f3f3":"",...!ee&&Boolean(me)?{color:me}:{}},readOnly:ne,startAdornment:pe?e(se,{position:"end",sx:{position:"absolute",right:"38px"},children:e(he,{color:"secondary",variant:"indeterminate",size:20,...y})}):null,...x},InputLabelProps:{shrink:!0}},actionBar:{actions:["today","accept","cancel"]}},sx:{width:"100%"}});return Boolean(B)?u(q,{...v,key:te},Ce):Ce},TimePicker:({name:t,validate:r,validationRun:n,shouldExclude:a,isReadOnly:c,postValidationSetCrossFieldValues:A,runPostValidationHookAlways:p,dependentFields:f,fieldKey:m,type:g,GridProps:w,CircularProgressProps:b,enableGrid:v,isFieldFocused:y,InputProps:B,inputProps:C,runValidationOnDependentFieldsChange:x,skipValueUpdateFromCrossFieldWhenReadOnly:F,required:S,format:N,runPostValidationForInitValue:E,componentType:k,className:T,label:L,placeholder:I,setFieldLabel:D,setColor:P,...R})=>{const{commonTimeFormat:O}=ns(),{value:Q,prevValue:H,error:M,touched:_,handleChange:j,handleBlur:z,isSubmitting:V,fieldKey:K,name:G,excluded:W,readOnly:X,validationRunning:Y,dependentValues:$,formState:Z}=as({name:t,fieldKey:m,dependentFields:f,validate:r,validationRun:"onChange",runPostValidationHookAlways:p,postValidationSetCrossFieldValues:A,isReadOnly:c,shouldExclude:a,runValidationOnDependentFieldsChange:x,skipValueUpdateFromCrossFieldWhenReadOnly:F,runPostValidationForInitValue:E,componentType:k}),[ee,te]=d("string"==typeof P?P:"");h(()=>{if("function"==typeof P){const e=P(Q,ds($),Z);te("string"!=typeof e?"":e)}},[Q,$,P]),h(()=>{if("string"==typeof Q){let e=new Date(Q);isNaN(e)||j(e)}},[Q,j]);const ie=o();h(()=>{y&&setTimeout(()=>{ie?.current?.focus?.()},1)},[y]);const re=_&&""!==(M??""),ne=s(()=>{if("function"==typeof D)return D(ds($),Q)},[D,$,Q]),ae=l(t=>e(i,{children:void 0===H||void 0===Q||U(Fs(H).toUTCString(),Fs(Q).toUTCString())?e(Ao,{...t}):e(Jo,{title:e(Xo,{label:`${Ge("OldValueOf")} ${ne?.label?Ge(ne.label):L}`,value:(()=>{if(!H)return"(blank)";try{const e=Fs(H);return ze(e,(N??O)||"HH:mm:ss aa")}catch{return console.error("Invalid time provided while comparing old value!!!"),""}})()}),arrow:!0,followCursor:!0,children:e(Ao,{...t})})}),[H]);if(W)return null;const oe=u(Mo,{...R,key:K,id:K,name:G,label:ne?.label?Ge(ne.label):L,format:(N??O)||"HH:mm:ss aa",value:""===Q?null:new Date(Q),onChange:j,onClose:()=>{setTimeout(()=>z(),0)},disabled:V||X,readOnly:X,className:J(T,{hasOldValue:void 0!==H&&void 0!==Q&&!U(Fs(H).toUTCString(),Fs(Q).toUTCString())}),slots:{textField:ae},slotProps:{textField:{onBlur:z,placeholder:X?"":ne?.placeholder?Ge(ne.placeholder):I,error:!V&&re,helperText:e(le,{children:!V&&re?M:null}),inputProps:{tabIndex:X?-1:void 0,...C},InputLabelProps:{shrink:!0},InputProps:{style:{background:Boolean(X||V)?"#f3f3f3":"",...!V&&Boolean(ee)?{color:ee}:{}},readOnly:X,tabIndex:X?-1:void 0,startAdornment:Y?e(se,{position:"end",sx:{position:"absolute",right:"38px"},children:e(he,{color:"secondary",variant:"indeterminate",size:20,...b})}):null,...B},required:S}}});return Boolean(v)?u(q,{...w,key:K},oe):oe}});const XA=({name:i,validate:r,validationRun:n,shouldExclude:a,postValidationSetCrossFieldValues:s,isReadOnly:o,runPostValidationHookAlways:h,dependentFields:c,fieldKey:A,label:p,InputLabelProps:m,GridProps:g,enableGrid:w,runValidationOnDependentFieldsChange:b,skipValueUpdateFromCrossFieldWhenReadOnly:v,...y})=>{const{value:B,handleChange:C,handleBlur:x,isSubmitting:F,fieldKey:S,name:N,excluded:E,readOnly:k}=as({name:i,fieldKey:A,dependentFields:c,validate:r,validationRun:n,runPostValidationHookAlways:h,postValidationSetCrossFieldValues:s,isReadOnly:o,shouldExclude:a,runValidationOnDependentFieldsChange:b,skipValueUpdateFromCrossFieldWhenReadOnly:v}),[T,L]=d(!1),I=l(()=>{x(),L(!1)},[x,L]),D=l(()=>{L(!0)},[L]),U=l((e,t)=>{C(t)},[C]);if(E)return null;const P=t(f,{children:[e(Ut,{...m,focused:T,disabled:F,children:p}),u(Pt,{...y,key:S,id:S,name:N,value:""===B?0:B,onFocus:D,onChange:U,onBlur:I,disabled:F,readOnly:k,tabIndex:k?-1:void 0})]},S);return Boolean(w)?u(q,{...g,key:S},P):P};var YA=Object.freeze({__proto__:null,Rating:XA,default:XA});const $A=xi(e=>({grouped:{marginRight:e.spacing(2),marginTop:e.spacing(1),borderColor:"#8C8C8C",transition:"border 0.3s ease-in",borderRadius:"8px",textTransform:"capitalize",color:"#727272",padding:"4px 10px",fontWeight:700,"&:not(:first-child)":{borderRadius:"8px",borderLeft:"1px solid #8C8C8C"},"&:first-child":{borderRadius:"8px"},"&.Mui-selected":{border:"1px solid #57D3C3",background:"linear-gradient(0deg, rgba(94,231,131,1) 0%, rgba(74,205,159,1) 10%, rgba(33,150,218,1) 100%)",color:"white"},"& label":{color:"#736f6f",fontWeight:"600",textTransform:"capitalize",fontSize:"1rem",marginBottom:"0.5 rem"},"& .MuiSvgIcon-root":{maxHeight:"20px"}}}))(lr),ZA=({name:i,validate:r,validationRun:n,shouldExclude:a,isReadOnly:s,postValidationSetCrossFieldValues:o,runValidationOnDependentFieldsChange:l,runPostValidationHookAlways:h,dependentFields:c,fieldKey:d,options:A,ToggleButtonProps:p,GridProps:f,enableGrid:m,label:g,isFieldFocused:w,skipValueUpdateFromCrossFieldWhenReadOnly:b,...v})=>{const{value:y,handleChange:B,handleBlur:C,isSubmitting:x,fieldKey:F,excluded:S}=as({name:i,fieldKey:d,dependentFields:c,validate:r,validationRun:n,runPostValidationHookAlways:h,postValidationSetCrossFieldValues:o,runValidationOnDependentFieldsChange:l,isReadOnly:s,shouldExclude:a,skipValueUpdateFromCrossFieldWhenReadOnly:b});if(S)return null;const N=A.map(t=>u(Rt,{...p,key:t.value,value:t.value,disabled:x},"business"===t.iconName?e(Qt,{}):"person"===t.iconName?e(Ot,{}):null,e("span",{children:t.label}))),E=t($e,{disabled:x,children:[e(Je,{children:g}),e($A,{...v,value:y,onChange:(e,t)=>{B(t)},onBlur:C,children:N})]});return Boolean(m)?u(q,{...f,key:F},E):E};var ep=Object.freeze({__proto__:null,ToggleButtonGroup:ZA,default:ZA});const tp=({name:t,HiddenProps:i,GridProps:r,shouldExclude:n,fieldKey:a,dependentFields:s,componentType:o})=>{const{name:l,excluded:h}=as({name:t,fieldKey:a,dependentFields:s,shouldExclude:n,componentType:o});return h?null:e(f,{children:e(ve,{...i,children:e(ge,{item:!0,...r})})},l)};var ip=Object.freeze({__proto__:null,Spacer:tp,default:tp});const rp=m(()=>Promise.resolve().then(function(){return Ju}).then(e=>({default:e.ListBoxComponent}))),np=e=>e?.label??"";var ap=Object.freeze({__proto__:null,AutoComplete:iA,AutocompleteRenderOnly:({label:i,showCheckbox:r,CircularProgressProps:n,TextFieldProps:a,ChipProps:s,CreateFilterOptionsConfig:l,placeholder:c,required:A,enableVirtualized:p,handleBlur:m,handleChange:g,freeSolo:b,multiple:v,options:y,error:B,touched:C,disableClearable:x,value:F,_optionsKey:S,disableCaching:N,optionsProps:E,...k})=>{const T=Boolean(C)&&Boolean(B),[L,I]=d([]),[D,U]=d((new Date).getTime()),P=o(!1),R=o(null),{loadingOptions:O}=Co(y,I,S,N,E,!0,"",!1);return h(()=>{let e=F;if(!P.current&&Boolean(e)&&L.length>0&&"00"!==L[0].value&&null!==L[0].value){Array.isArray(e)||(e=[F]);let t=[];for(let i=0;i<L.length&&e.length>0;i++){let r=e.findIndex(e=>e==L[i].value);if(r>-1){t.push(L[i]);const n=e.slice(0,r),a=e.slice(r+1);e=[...n,...a]}}P.current=!0,R.current=v?t:t[0],U((new Date).getTime())}},[O,L,F,v]),e(w,{fallback:"loading...",children:u(Ai,{...k,key:`${D}`,multiple:v,disableClearable:x,freeSolo:b,options:L,getOptionLabel:np,ListboxComponent:Boolean(p)?rp:void 0,onChange:(e,t)=>{Array.isArray(t)||(t=[t]),t=t.map(e=>{return"object"==typeof e?Boolean(b)?np(e):(t=e,t?.value??""):e;var t}),!Boolean(v)&&Array.isArray(t)?g(t[0]):g(t)},onBlur:m,filterOptions:Boolean(l)&&"object"==typeof l?pi(l):void 0,renderTags:(e,t)=>e.map((e,i)=>u(gi,"string"==typeof e?{variant:"outlined",...s,label:e,...t({index:i}),key:e}:{variant:"outlined",...s,label:e.label,...t({index:i}),key:`${e.label}-${i}`})),renderInput:r=>e(Ao,{...a,...r,label:i,placeholder:c,autoComplete:"disabled",type:"text",error:T,required:A,helperText:T?B:null,InputProps:{...r.InputProps,endAdornment:t(f,{children:[O?e(G,{color:"primary",variant:"indeterminate",...n}):null,r.InputProps.endAdornment]})},InputLabelProps:{shrink:!0},inputProps:{...r.inputProps,autoComplete:"new-user-street-address"}}),renderOption:(i,n,a)=>{i.key=i.id;let{selected:s,inputValue:o}=a,l=np(n);const h=wi(l,o),c=bi(l,h).map((t,i)=>e("span",{style:{fontWeight:t.highlight?700:400},children:t.text},i));return t("li",{style:{whiteSpace:"pre"},...i,children:[r?e(go,{checked:s}):null,c]})}})})},default:iA});function sp(t){const{inputRef:i,onChange:r,FormatProps:n,...a}=t;return e(Ht,{...a,getInputRef:i,onValueChange:e=>{r({target:{value:e.value,formattedValue:e.formattedValue}},e.formattedValue)},...n})}function op(t){const{inputRef:i,onChange:r,FormatProps:n,...a}=t;return e(Ht,{...a,getInputRef:i,onValueChange:e=>{r({target:{value:e.value,formattedValue:e.formattedValue}},e.formattedValue)},...n})}const lp=({name:i,fieldKey:r,validate:n,leftName:a,rightName:s,leftLabel:l,rightLabel:c,leftTransform:d=e=>e,rightTransform:u=e=>e,GridProps:A,enableGrid:p,dependentFields:f,validationRun:m,runValidationOnDependentFieldsChange:g})=>{const{touched:w,value:b,error:v,setValue:y,handleBlur:B,isSubmitting:C,dependentValues:x}=as({name:i,fieldKey:r,validate:n,validationRun:m,dependentFields:f,runValidationOnDependentFieldsChange:g}),F=b[a],S=b[s],N=o(F);N.current=F;const E=o(S);E.current=S,h(()=>{let e=ds(x),t=d(N.current,a,e),i=u(E.current,s,e);null===t&&null===i||y({[a]:t,[s]:i},{[a]:t,[s]:i},!0)},[x]);const k=w&&""!==(v??"");let T=t("div",{style:{display:"flex"},tabIndex:0,onBlur:B,children:[e(Ao,{id:"left",name:a,value:F,label:l,onChange:e=>{let t=e.target.value,i=u(t,s,ds(x));y({[a]:t,[s]:i},{[a]:t,[s]:i},!0)},disabled:C,error:!C&&k,helperText:!C&&k?v:"",InputLabelProps:{shrink:!0},InputProps:{inputComponent:sp,inputProps:{FormatProps:{thousandSeparator:!0,prefix:"৳",thousandsGroupStyle:"lakh",allowNegative:!0,allowLeadingZeros:!1,decimalScale:2,isAllowed:e=>!(e?.value?.length>10)&&0!==e.floatValue}}}},"left"),e(Ao,{id:"right",name:s,label:c,value:S,onChange:e=>{let t=e.target.value,i=d(t,a,ds(x));y({[a]:i,[s]:t},{[a]:i,[s]:t},!0)},InputLabelProps:{shrink:!0},InputProps:{inputComponent:op,inputProps:{FormatProps:{suffix:"%",decimalScale:2,fixedDecimalScale:!0,allowNegative:!0,allowEmptyFormatting:!0,isAllowed:e=>!(e.floatValue>=999.99)}}}},"right")]});return Boolean(p)?e(q,{...A,children:T}):T};var hp=Object.freeze({__proto__:null,Visaversa:lp,default:lp});const cp=new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR"}),dp=({rows:t,column:{id:i,footerRenderStyle:r}})=>{const n=s(()=>t.reduce((e,t)=>Number(t.values?.[i]??0)+e,0),[t,i]);let a=isNaN(n)?"":n;return"currency"===r&&(a=cp.format(n)),e("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a})},up=({value:t})=>e(vt,{component:"span",variant:"subtitle2",style:{whiteSpace:"nowrap"},children:t}),Ap=n({}),pp=c(({currentRowError:t,currentRowObj:i,children:r,initialData:n,rowValidator:a,setFormError:o,prevRows:c,nextRows:u},A)=>{const f=s(()=>{let e={};for(const t in n)e[t]=!1;return e},[]),[m,g]=d({}),[w,b]=d(!1),[v,y]=d(n),[B,C]=d(f),x=l(()=>{let e={};for(const t in f)e[t]=!0;C(e)},[f]);p(A,()=>({touchAll:x}));const F=l(e=>{y(t=>{let r={...t,...e};return i.current=r,r})},[]),S=l(e=>{C(t=>({...t,...e}))},[]);return h(()=>{(async(e,i,r)=>{try{await a(e,i,r),g({}),b(!1),t.current={}}catch(e){g(e),b(!0),t.current=e}})(v,c,u)},[v]),h(()=>{o(w?"has error":"")},[w]),h(()=>()=>{o("")},[]),e(Ap.Provider,{value:{error:m,currentRow:v,setCellValue:F,touched:B,setCellTouched:S},children:r})}),fp=t=>{const{column:{id:i,type:r,clearFields:n,maxLength:a=NaN},row:{id:s},currentEditRow:o}=t;return o===s?e(mp,{columnName:i,type:r??"text",clearFields:n,maxLength:a},i):e(up,{...t})},mp=({columnName:t,type:i,clearFields:r,maxLength:n})=>{const{error:s,setCellValue:o,currentRow:l,touched:h,setCellTouched:c}=a(Ap);return e(_t,{type:i,value:l?.[t],size:"small",variant:"outlined",onChange:e=>{(n!=n||e.target.value.length<=n)&&o({[t]:e.target.value,...r})},helperText:h?.[t]&&s?.[t],error:Boolean(h?.[t])&&Boolean(s?.[t]),onBlur:()=>c({[t]:!0}),fullWidth:!0})};let gp=new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR"});const wp=({value:t,displayStyle:i})=>{let r="-";if(!isNaN(t))switch(i){case"currency":r=gp.format(t);break;case"percentage":r=`${t}%`;break;case"squareFeet":r=(new Intl.NumberFormat).format(t);break;default:r=t}return e(vt,{component:"span",variant:"subtitle2",style:{whiteSpace:"nowrap"},children:r})},bp=t=>{const{column:{id:i,FormatProps:r,formattedValue:n,displayStyle:a,clearFields:s,enableNumWords:o},row:{id:l},currentEditRow:h}=t;return h===l?e(vp,{columnName:i,FormatProps:r,formattedValue:n,clearFields:s,enableNumWords:o},i):e(wp,{...t,displayStyle:a})},vp=({columnName:t,FormatProps:i,formattedValue:r,clearFields:n,enableNumWords:s})=>{const{error:o,setCellValue:l,currentRow:h,touched:c,setCellTouched:d}=a(Ap);let u=null;try{if(s&&Boolean(h?.[t])){let e=String(h?.[t]).split("."),i=Number(e[0]);i<0?(i=Math.abs(Number(i)),u=`Negative ${Io(i)} Rupees`):u=`${Io(i)} Rupees`,2===e.length&&Boolean(e[1])&&(u=`${u} and ${Io(e[1])} paise`)}}catch(e){}return e(po,{value:h?.[t],onChange:e=>l({[t]:e.target.value,...n}),helperText:Boolean(o?.[t])?o?.[t]:u,error:Boolean(c?.[t])&&Boolean(o?.[t]),onBlur:()=>d({[t]:!0}),InputLabelProps:{shrink:!0},size:"small",fullWidth:!0,margin:"none",InputProps:{inputComponent:il,inputProps:{FormatProps:{...i,formattedValue:r}}}})},yp=t=>{const{column:{id:i,options:r,_optionsKey:n,multiple:a,showCheckbox:s,clearFields:o},row:{id:l},currentEditRow:h}=t,[c,u]=d([]),{loadingOptions:A}=xo(r,u,n,!1,{},!1,void 0);return h===l?e(Bp,{columnName:i,options:c,loadingOptions:A,multiple:a,showCheckbox:s,clearFields:o},i):e(Cp,{...t,options:c})},Bp=({columnName:t,options:i,loadingOptions:r,multiple:n,showCheckbox:s,clearFields:o})=>{const{error:l,setCellValue:h,currentRow:c,setCellTouched:d,touched:u}=a(Ap);let A=c?.[t];return e(Ro,{value:A,error:l?.[t],touched:u?.[t],size:"small",variant:"outlined",handleChange:e=>{h({[t]:e.target.value,...o})},handleBlur:()=>d({[t]:!0}),options:i,loadingOptions:r,multiple:n,showCheckbox:s,fullWidth:!0})},Cp=({value:t,options:i})=>e(vt,{component:"span",variant:"subtitle2",style:{whiteSpace:"nowrap"},children:Fo(i,!0)(t)});let xp=new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR"});function Fp(t){const{inputRef:i,onChange:r,FormatProps:n,setChange:a,side:s,...o}=t;return e(Ht,{...o,getInputRef:i,onChange:e=>{a(s)},onValueChange:e=>{r({target:{value:e.value,formattedValue:e.formattedValue}},e.formattedValue)},...n})}const Sp=({value:t})=>e(vt,{component:"span",variant:"subtitle2",style:{whiteSpace:"nowrap"},children:xp.format(t)}),Np=t=>{const{column:{id:i,ViceVersaProps:r,clearFields:n},row:{id:a},currentEditRow:s}=t;return s===a?e(kp,{columnName:i,clearFields:n,...r}):e(Sp,{...t,displayStyle:r.leftAdornment})},Ep=(e,t)=>e,kp=({columnName:i,rightTransform:r=Ep,leftTransform:n=Ep,dependentField:s,leftFormatProps:o,rightFormatProps:l})=>{const{error:c,setCellValue:u,currentRow:A,touched:p,setCellTouched:f}=a(Ap),[m,g]=d(""),[w,b]=d("");h(()=>{let e=r(A?.[i],A?.[s]);g(e),f({[i]:!0})},[]);let v=A?.[i];h(()=>{""===v&&g("")},[v]);return t("div",{style:{display:"flex"},children:[e(_t,{value:A?.[i],onChange:e=>{let t=e?.target?.value??e;u({[i]:t})},onBlur:()=>{if("left"!==w)return;let e=r(A?.[i],A?.[s]);g(e)},helperText:p?.[i]&&c?.[i],error:Boolean(p?.[i])&&Boolean(c?.[i]),size:"small",variant:"outlined",InputProps:{inputComponent:Fp,inputProps:{FormatProps:o,setChange:b,side:"left"}},fullWidth:!0},"left"),e("div",{style:{padding:"0px 4px"}}),e(_t,{value:m,onChange:e=>{g(e?.target?.value??e)},onBlur:()=>{if("right"!==w)return;let e=n(m,A?.[s]);u({[i]:e})},size:"small",variant:"outlined",InputProps:{inputComponent:Fp,inputProps:{FormatProps:l,setChange:b,side:"right"}},fullWidth:!0},"right")]})},Tp=({value:t})=>e(vt,{component:"span",variant:"subtitle2",style:{whiteSpace:"nowrap"},children:t}),Lp=t=>{const{column:{id:i,MaskProps:r,formattedValue:n=!0,clearFields:a},row:{id:s},currentEditRow:o}=t;return o===s?e(Ip,{columnName:i,MaskProps:r,formattedValue:n,clearFields:a},i):e(Tp,{...t})},Ip=({columnName:t,MaskProps:i,formattedValue:r,clearFields:n})=>{const{error:s,setCellValue:o,currentRow:l,touched:h,setCellTouched:c}=a(Ap);return e(po,{value:l?.[t],onChange:e=>o({[t]:e.target.value,...n}),helperText:h?.[t]?s?.[t]:"",error:Boolean(h?.[t])&&Boolean(s?.[t]),onBlur:()=>c({[t]:!0}),InputLabelProps:{shrink:!0},size:"small",fullWidth:!0,margin:"none",InputProps:{inputComponent:Nl,inputProps:{MaskProps:{...i,formattedValue:r}}}})},Dp={accessor:"action",alignment:"left",width:150,Cell:({requestRowEdit:i,currentEditRow:r,saveCurrentRow:n,cancelCurrentRowEdit:a,row:{id:s}})=>e("div",{style:{display:"flex",alignItems:"start"},children:r===s?t(f,{children:[e(ct,{onClick:()=>n(s),size:"small",variant:"outlined",disableRipple:!0,children:"Done"}),e(ct,{onClick:()=>a(s),size:"small",variant:"outlined",disableRipple:!0,children:"Cancel"})]}):e(ct,{onClick:()=>i(s),size:"small",variant:"outlined",disableRipple:!0,children:"Edit"})}),columnName:"Action"},Up=e=>(e=(e=>{if(Array.isArray(e)){let t=e;return t=t.map(e=>{if("string"==typeof e.options){let t=e.options,i=fa.getFn(t,async()=>[{label:"Cannot fetch options",value:""}]);return{...e,_optionsKey:t,options:i}}return e}),t}return e})(e),e=(e=>{if(Array.isArray(e)){let t=e;return t=t.map(e=>{if("string"!=typeof e.Cell)return e;switch(e.Cell){case"textField":return{...e,Cell:fp};case"numberField":return{...e,Cell:bp};case"selectField":return{...e,Cell:yp};case"visaversa":return{...e,Cell:Np};case"monthYear":return{...e,Cell:Lp};default:return{...e,Cell:up}}}),t}return e})(e=(e=>{if(Array.isArray(e)){let t=e;return t=t.map(e=>{if(Boolean(e.footer)){const{footer:t,...i}=e;return{...i,Footer:dp}}return e}),t}return e})(e=(e=>{if(Array.isArray(e))return[...e,Dp];return e})(e)))),Pp=({column:{columnName:r,getResizerProps:n}})=>t(i,{children:[e("span",{style:{whiteSpace:"nowrap"},children:r}),e("div",{...n([{style:{display:"inline-block",position:"absolute",right:"-5px",top:"0",padding:"0 5px",zIndex:1}}]),children:e("div",{style:{height:"35px",width:"6px",backgroundColor:"#888"}})})]}),Rp=({row:t})=>e(ui,{size:"small",...t.getToggleRowSelectedProps([{style:{padding:0}}])}),Op=({getToggleAllRowsSelectedProps:t})=>e(ui,{size:"small",...t([{style:{padding:0}}])}),Qp=async()=>{},Hp={},Mp=async()=>{throw{error_msg:"Fn not defined"}},_p=({columns:i,defaultColumn:r,data:n,setData:a,rowIDColumn:s,label:h,setFormError:c,disabled:u,maxHeight:A="200px",newRowObj:p=Hp,dataIdColumn:m="id",rowValidator:g=Qp,deleteRowFn:w=Mp,disableFooter:b=!1})=>{const v=o(null),y=o(-1),B=o({}),C=o({}),[x,F]=d(-1),[S,N]=d(!1),[E,k]=d(!1),T=o(null),L=l(e=>e[s],[]),{t:I}=W(),D=l(()=>{k(!1)},[k]),U=l(()=>{S||(a(e=>[...e,{...p,[s]:++y.current}]),N(!0),F(y.current),B.current={},setTimeout(()=>{let e=T.current;e?.scrollTo({behavior:"smooth",top:e.scrollHeight-e.offsetHeight,left:0})},1))},[a,N,F,S,n]),P=l(e=>{if(Object.keys(C.current).length>0)return v?.current?.touchAll?.(),!1;let t=n.map(t=>L(t)===e?{...t,...B.current}:t);return a(t),F(-1),N(!1),B.current={},!0},[a,N,F,n,L]),R=l(e=>{S&&a(t=>t.filter(t=>!(L(t)===e))),F(-1),N(!1),B.current={},C.current={}},[a,F,N,S]),O=l(e=>{S||Object.keys(C.current).length>0||(-1===x||R(x),F(e),B.current={})},[P,F,x,S]),Q=Gt({columns:i,data:n,defaultColumn:r,requestRowEdit:O,currentEditRow:x,getRowId:L,saveCurrentRow:P,cancelCurrentRowEdit:R},ei,ti,ii,(H=!0,t=>{Boolean(H)&&t.visibleColumns.push(t=>[{id:"selectionCheckbox",Header:Op,Cell:Rp,minWidth:25,width:25,maxWidth:25,sticky:!0,Footer:()=>e("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",paddingRight:"10px"},children:"Total"})},...t])}));var H;const{getTableProps:M,getTableBodyProps:_,headerGroups:j,footerGroups:z,rows:V,prepareRow:K,selectedFlatRows:q}=Q;return t(f,{children:[t(ni,{style:{width:"90%",overflow:"hidden"},tabIndex:0,children:[t(ai,{variant:"dense",style:{display:"flex",minHeight:"40px",paddingLeft:"16px",paddingRight:"16px"},children:[e(vt,{variant:"h6",children:h}),e("div",{style:{flexGrow:1}}),q.length>0?e(ct,{variant:"outlined",size:"small",onClick:()=>{k(!0)},children:I("Delete")}):null]}),e(si,{style:u?{opacity:.5}:{},children:t(oi,{...M(),size:"small",component:"div",children:[e(li,{component:"div",children:j.map(t=>e(hi,{...t.getHeaderGroupProps(),component:"div",children:t.headers.map(t=>e(ci,{...t.getHeaderProps([{style:{overflow:"hidden",textOverflow:"ellipsis",textAlign:t?.alignment??"unset",pointerEvents:u?"none":"unset"}}]),component:"div",children:t.render("Header")}))}))}),e(di,{..._({}),component:"div",children:e("div",{style:{overflowY:"scroll",maxHeight:A,overflowX:"hidden"},ref:T,children:V.map((t,i)=>{K(t);const r=t.getRowProps([{style:{pointerEvents:u?"none":"unset"}}]),n=e(hi,{...r,component:"div",children:t.cells.map(t=>e(ci,{...t.getCellProps([{style:{textOverflow:"ellipsis",overflow:"hidden",textAlign:t?.column?.alignment??"unset"}}]),component:"div",children:t.render("Cell")}))});if(x===t.id){let a=V.slice(0,i).map(e=>e?.original),s=V.slice(i+1).map(e=>e?.original);return e(pp,{currentRowError:C,currentRowObj:B,initialData:t.original,rowValidator:g,prevRows:a,nextRows:s,setFormError:c,ref:v,children:n},`${r.key}_row_with_context`)}return n})})}),b?null:e(li,{component:"div",children:z.map(t=>e(hi,{...t.getFooterGroupProps(),component:"div",children:t.headers.map(t=>e(ci,{...t.getFooterProps([{style:{textAlign:t?.alignment??"unset"}}]),component:"div",children:t.render("Footer")}))}))})]})}),e(ct,{onClick:U,disabled:u,children:I("AddRow")})]}),e(jp,{selectedRows:q,dataIdColumn:m,open:E,closeDialog:D,deleteFn:w,setData:a})]})},jp=({selectedRows:i,dataIdColumn:r,deleteFn:n,open:a,closeDialog:s,setData:o})=>{const{t:l}=W(),h=()=>{c.reset(),s()},c=Vt((d=n,async({data:e})=>d(e)),{onSuccess:()=>{h()}});var d;return t(dt,{open:a,children:[c.isError?e(to,{severity:"error",errorMsg:c.error?.error_msg??"Unknown error occured",errorDetail:c.error?.error_detail??""}):null,e(ut,{children:l("Wouldyouliketodeletetheselectedrecord")}),t(At,{children:[e(ct,{onClick:()=>{let e=i.map(e=>e?.original?.[r]??Number.MAX_SAFE_INTEGER).filter(e=>e!==Number.MAX_SAFE_INTEGER);c.mutate({data:e}),o(t=>t.filter(t=>!(e.indexOf(t[r])>=0)))},disabled:c.isLoading,children:l("Yes")}),e(ct,{onClick:h,disabled:c.isLoading,children:l("No")})]})]})},zp=e=>e,Vp="__id",Kp=({_columns:t,arrayFieldIDName:i,dataTransformer:r=zp,rowValidator:n,removeRowFn:a,name:c,fieldKey:u,GridProps:A,enableGrid:p,label:f,maxHeight:m,shouldExclude:g,dependentFields:w,disableFooter:b})=>{const v=s(()=>{let e=Mt(t);return Up(e)},[]),y=s(()=>({Header:Pp,Cell:up}),[]),B=s(()=>{let e=(e=>{if(Array.isArray(e))return e.reduce((e,t)=>(e[t.accessor]=t?.defaultValue??"",e),{});return{}})(t);return e={[i]:"",...e},e},[]),C=o(-1e3),[x,F]=d(!1),{value:S,setValueAsCB:N,setErrorAsCB:E,isSubmitting:k,fieldKey:T,excluded:L}=as({name:c,fieldKey:u,shouldExclude:g,dependentFields:w}),I=l(e=>{N("function"==typeof e?t=>r(e(t)):r(e))},[N,r]);if(h(()=>{if(!x&&Array.isArray(S)&&S.length>0){let e=S.map(e=>void 0===e[Vp]?{...e,[Vp]:C.current++}:e);I(e),F(!0)}}),L)return null;const D=e(_p,{columns:v,defaultColumn:y,dataIdColumn:i,newRowObj:B,rowValidator:n,setData:I,data:Array.isArray(S)?S:[],rowIDColumn:Vp,deleteRowFn:a,label:f,maxHeight:m,setFormError:E,disabled:k,disableFooter:b},T);return Boolean(p)?e(q,{...A,children:D}):D};var qp=Object.freeze({__proto__:null,DataTable:Kp,default:Kp});const Gp=({name:t,fieldKey:i,TypographyProps:r,GridProps:n,label:a,dependentFields:o,shouldExclude:l,setValueOnDependentFieldsChange:c,setValueOnDependentFieldsValueChange:d,componentType:u,dependentFieldDebounceDelay:A=300})=>{const{value:p,handleChange:m,name:g,excluded:w,dependentValues:b,incomingMessage:v,setIncomingMessage:y,formState:B}=as({name:t,fieldKey:i,dependentFields:o,shouldExclude:l,componentType:u,dependentFieldDebounceDelay:A}),C=s(()=>{const e=ds(b),t=us(e);return JSON.stringify(t.sort((e,t)=>e.fieldKey.localeCompare(t.fieldKey)).map(e=>e.value))},[b]);return h(()=>{if(C&&"function"==typeof d){let e=d(ds(b),B);null!=e&&m(e)}},[C,d,m]),h(()=>{if("function"==typeof c){let e=c(ds(b),B);null!=e&&m(e)}},[b,m,c]),h(()=>{if(null!==v&&"object"==typeof v&&Object.keys(v).length){const{value:e}=v;(Boolean(e)||""===e)&&m(e),y(null)}},[v,m]),w?null:e(f,{children:e(ge,{...n,children:e(X,{variant:"h6",style:void 0,...r,children:p||a})})},g)},Wp=Ci(e=>({root:{paddingLeft:e.spacing(1.5),paddingRight:e.spacing(1.5),background:"var(--theme-color1)"},title:{flex:"1 1 100%",color:"var(--white)",letterSpacing:"1px",fontSize:"1.5rem"},refreshiconhover:{}}));let Jp=[];const Xp=c(({dense:i,title:r,allowColumnHiding:n,fields:a,initialDataValue:l,initialVisibleColumnData:c,submitButtonHide:u,submitButtonName:A,submitSecondButtonHide:m=!0,submitSecondButtonName:g="submit",submitSecondLoading:w=!1,submitSecondAction:b=(e,t)=>{},submitSecondValidtion:v=!0,hideHeader:y,isDisplayOnly:B,onAction:C,loading:x,onFieldAction:F=(e,t)=>{},propStyles:S,focusScopeId:N,enableEnterToFocus:E},k)=>{const T=Wp(),L=o(null),[I,D]=d({}),[U,P]=d(l),[R,O]=d(a),{t:Q}=W(),[H,M]=d(c),_=s(()=>{let e={};return a.forEach(t=>{Boolean(t.dependFields)&&Array.isArray(t.dependFields)&&t.dependFields.forEach(i=>{Boolean(e[i])?e[i].push(t.name):e[i]=[t.name]})}),e},[a]),j=s(()=>{let e={};return a.forEach(t=>{Boolean(t.dependFields)&&Array.isArray(t.dependFields)&&"function"==typeof t.dependFieldsonchange&&(e[t.name]=t.dependFieldsonchange)}),e},[a]),z=(e,t="",i=!1)=>{const r=e.target.name,n=i?e.target.value.toUpperCase():e.target.value;P(e=>({...e,[r]:n})),Boolean(n)&&I[r]?.isError&&D(e=>({...e,[r]:{isError:!1,ErrorMessage:" "}})),Boolean(_[r])&&_[r].forEach(e=>{if("function"==typeof j[e]){let i=j[e](U,n,r,t);Boolean(i)&&O(t=>t.map(t=>{let r=t;return t.name===e&&"object"==typeof i&&(r={...r,...i},i.hasOwnProperty("isVisible")&&M(e=>({...e,[t.name]:Boolean(i?.isVisible)})),i.hasOwnProperty("__DATA")&&P(e=>({...e,[t.name]:i.__DATA}))),r}))}})};h(()=>{P(l),Object.keys(l).forEach(e=>{let t={target:{name:e,value:l[e]}};z(t)})},[JSON.stringify(l)]);Jp=s(()=>R.map(e=>{let t=()=>{M(t=>({...t,[e.name]:!H[e.name]}))};return{id:e.name,isTableHidden:e?.isTableHidden??!1,columnName:e?.label??"",isColumnHidingDisabled:e?.isColumnHidingDisabled??!1,getToggleHiddenProps:()=>({checked:H[e.name]??!0,onChange:t,style:{cursor:"pointer"}})}}),[R,H]);const V=async(e,t,i,r)=>{let n=!0,a={};for(const s of e)if(i[s.name]??1)if(s?.isRequired&&!Boolean(t[s.name]))a={...a,[s.name]:{isError:!0,ErrorMessage:Q("ThisFieldisrequired")}},n=!1;else{let e="";"function"==typeof s?.validate&&(e=await s.validate(t[s.name],t,r)),n=!Boolean(e)&&n,a={...a,[s.name]:{isError:Boolean(e),ErrorMessage:Boolean(e)?e:" "}}}else a={...a,[s.name]:{isError:!1,ErrorMessage:" "}};return D(a),n};p(k,()=>({columnVal:U,onAction:C}));const{dynamicAmountSymbol:K}=ns(),J=N&&E?{"data-scope-id":N}:{};return e(f,{children:t(ni,{style:{width:"100%"},sx:S.paperStyle,onKeyDown:e=>{E&&Es(e,N)},...J,children:[y?null:t(ai,{className:T.root,variant:i?"dense":"regular",sx:S.toolbarStyles,children:[e(vt,{className:T.title,color:"inherit",variant:"h6",component:"div",sx:S.titleStyle,children:r}),n?e(Jl,{visibleColumns:Jp,defaultHiddenColumns:[],classes:T,IconButtonStyle:S.IconButtonStyle}):null]}),e("div",{style:{flexGrow:"1",margin:"15px"},children:t(q,{container:!0,spacing:2,justifyContent:"flex-start",alignItems:"center",direction:"row",children:[e(q,{item:!0,xs:u?12:10,container:!0,spacing:1,justifyContent:"flex-start",alignItems:"center",children:R.map(i=>H[i.name]??1?e(q,{item:!0,xs:i?.gridconfig?.xs??6,sm:i?.gridconfig?.sm??3,children:"select"===(i?.type??"text").toLowerCase()?e(Do,{name:i.name,options:i?.optiondata??[],_optionsKey:i?._optionsKey??"",handleChange:(e,t)=>{z(e,t),!Boolean(i?.externalFunctionCall)||"onChange"!==i?.externalFunctionCall&&"all"!==i?.externalFunctionCall||F(e.target.name,e.target.value,t)},label:Q(i?.label??""),fullWidth:!0,value:U[i.name],selectVariant:"regular",enableDefaultOption:Boolean(i?.enableDefaultOption),defaultOptionLabel:i?.defaultOptionLabel??"Select Value",disabled:!!i?.isDisabled||(!!B||(x||w)),skipDefaultOption:i?.skipDefaultOption??!0,error:Boolean(I[i.name]?.isError)?I[i.name]?.ErrorMessage??"Error":"",touched:i?.touched??!0,defaultSpaceAdd:i?.defaultSpaceAdd??!0,required:i?.isRequired??!1,handleBlur:(e,t)=>{R.forEach(e=>{"function"==typeof e?.onBlurHandler&&e.onBlurHandler(U[e.name],U)}),!Boolean(i?.externalFunctionCall)||"onBlur"!==i?.externalFunctionCall&&"all"!==i?.externalFunctionCall||F(e.target.name,e.target.value,t)}}):"spacer"===(i?.type??"text").toLowerCase()?e(tp,{...i},`${i.name}`):"typography"===(i?.type??"text").toLowerCase()?e(Gp,{fieldKey:i.name,name:i.name,label:Q(i?.label??""),TypographyProps:{color:"secondary"}}):"datetimepicker"===(i?.type??"text").toLowerCase()||"datepicker"===(i?.type??"text").toLowerCase()?e(hr,{dateAdapter:Hi,children:e(_o,{format:i?.dateFormat?i?.dateFormat:"datepicker"===(i?.type??"text").toLowerCase()?"dd/MM/yyyy":"dd/MM/yyyy HH:mm:ss",value:""===U[i.name]||null===U[i.name]?null:new Date(U[i.name]),label:Q(i?.label??""),views:"datetimepicker"===(i?.type??"text").toLowerCase()?["year","month","day","hours","minutes","seconds"]:["year","month","day"],onChange:e=>{let t={target:{name:i.name,value:e}};z(t),!Boolean(i?.externalFunctionCall)||"onChange"!==i?.externalFunctionCall&&"all"!==i?.externalFunctionCall||F(t.target.name,t.target.value)},disabled:!!i?.isDisabled||(!!B||(x||w)),slots:{textField:Ao},slotProps:{textField:{name:i.name,error:Boolean(I[i.name]?.isError),InputLabelProps:{shrink:!0},onKeyDown:e=>{"Enter"===e.key&&i?.entertoSubmit&&L?.current?.click?.()}},actionBar:{actions:["today","accept","cancel"]}},sx:{width:"100%",mb:3}})}):"amountfield"===(i?.type??"text").toLowerCase()||"numberfield"===(i?.type??"text").toLowerCase()?e(Ao,{sx:{mb:3},label:Q(i?.label??""),value:U[i.name],onChange:e=>{z(e),!Boolean(i?.externalFunctionCall)||"onChange"!==i?.externalFunctionCall&&"all"!==i?.externalFunctionCall||F(e.target.name,e.target.value)},onBlur:e=>{!Boolean(i?.externalFunctionCall)||"onBlur"!==i?.externalFunctionCall&&"all"!==i?.externalFunctionCall||F(e.target.name,e.target.value)},InputProps:{inputComponent:Yp,inputProps:{FormatProps:{...i?.FormatProps,type:i?.type??"",name:i?.name??""}},startAdornment:"amountfield"===i?.type?e(se,{position:"start",style:{padding:"0 0.6rem 0 0"},children:i?.StartAdornment?$o(i?.StartAdornment):$o(K)??"₹"}):null},InputLabelProps:{shrink:!0},onKeyDown:e=>{"Enter"===e.key&&i?.entertoSubmit&&L?.current?.click?.()},disabled:!!i?.isDisabled||(!!B||(x||w))}):"pancard"===(i?.type??"text").toLowerCase()?e(Ao,{label:Q(i?.label??""),value:U[i.name],placeholder:i.placeholder??"",fullWidth:!0,onChange:e=>{z(e),!Boolean(i?.externalFunctionCall)||"onChange"!==i?.externalFunctionCall&&"all"!==i?.externalFunctionCall||F(e.target.name,e.target.value)},onBlur:e=>{!Boolean(i?.externalFunctionCall)||"onBlur"!==i?.externalFunctionCall&&"all"!==i?.externalFunctionCall||F(e.target.name,e.target.value)},InputProps:{inputComponent:Nl,inputProps:{MaskProps:{mask:"aaaaa0000a",prepare:function(e){return e.toUpperCase()},lazy:!0,...i?.MaskProps},name:i.name??""}},InputLabelProps:{shrink:!0},error:Boolean(I[i.name]?.isError),helperText:t("div",{style:{display:"flex"},children:[e(Ze,{children:Boolean(I[i.name]?.isError)?I[i.name]?.ErrorMessage??"Error":" "}),(i?.maxLength??0)>0&&Boolean(i?.showMaxLength??!1)?t(Ze,{error:!1,style:{flex:1,textAlign:"right",margin:"5px 15px 0 0"},children:[U[i.name].length,"/",i?.maxLength]}):null]}),onKeyDown:e=>{"Enter"===e.key&&i?.entertoSubmit&&L?.current?.click?.()},disabled:!!i?.isDisabled||(!!B||(x||w))}):"autocomplete"===(i?.type??"text").toLowerCase()?e($p,{name:i?.name??"",placeholder:Q(i?.placeholder??""),label:Q(i?.label??""),options:i?.optiondata,_optionsKey:i?._optionsKey,handleChange:(e,t)=>{z(e,t),!Boolean(i?.externalFunctionCall)||"onChange"!==i?.externalFunctionCall&&"all"!==i?.externalFunctionCall||F(e.target.name,e.target.value,t)},columnValue:U,dependentField:_,disabled:!!i?.isDisabled||(!!B||(x||w))}):e(Ao,{autoFocus:i?.defaultfocus??!1,label:Q(i?.label??""),fullWidth:!0,placeholder:String(Q(i?.placeholder??"")),type:"text",name:i.name,value:U[i.name],InputProps:{style:{background:Boolean(i?.isDisabled)?"#f3f3f3":""}},onChange:e=>{if(-1===(i?.maxLength??-1)||e.target.value.length<=i?.maxLength){const t=/^[0-9\b]+$/,r=/^[a-zA-Z0-9\b]+$/;(""===e.target.value||("number"===(i?.type??"text")?t.test(e.target.value):"alphanumeric"!==(i?.type??"text")||r.test(e.target.value)))&&(z(e,"",Boolean(i?.toUpperCase)),!Boolean(i?.externalFunctionCall)||"onChange"!==i?.externalFunctionCall&&"all"!==i?.externalFunctionCall||F(e.target.name,e.target.value))}},onBlur:e=>{!Boolean(i?.externalFunctionCall)||"onBlur"!==i?.externalFunctionCall&&"all"!==i?.externalFunctionCall||F(e.target.name,e.target.value)},InputLabelProps:{shrink:!0},required:i?.isRequired??!1,autoComplete:i?.autoComplete??"off",disabled:!!i?.isDisabled||(!!B||(x||w)),error:Boolean(I[i.name]?.isError),helperText:t("div",{style:{display:"flex"},children:[e(Ze,{children:Boolean(I[i.name]?.isError)?I[i.name]?.ErrorMessage??"Error":" "}),(i?.maxLength??0)>0&&Boolean(i?.showMaxLength??!1)?t(Ze,{error:!1,style:{flex:1,textAlign:"right",margin:"5px 15px 0 0"},children:[U[i.name].length,"/",i?.maxLength]}):null]}),onKeyDown:e=>{"Enter"===e.key&&i?.entertoSubmit&&L?.current?.click?.()}})},`gird${i.name}`):null)}),t(q,{item:!0,xs:2,container:!0,justifyContent:"center",alignItems:"center",spacing:2,style:{maxWidth:"16%"},children:[e(q,{item:!0,children:e(eo,{sx:{display:u?"none":"auto"},disabled:x||w,endIcon:x?e(G,{size:20}):null,onClick:async()=>{await V(R,U,H,"FIRST")&&C(U,H)},ref:L,children:Q(A)})},`gird${A}`),m?null:e(q,{item:!0,children:e(eo,{disabled:x||w,endIcon:w?e(G,{size:20}):null,onClick:async()=>{v&&!await V(R,U,H,"SECOND")||b(U,H)},children:Q(g)})},`gird${g}`)]})]})})]})})}),Yp=t=>{const{inputRef:i,onChange:r,FormatProps:n,...a}=t,{type:s,name:o,...l}=n,{decimalCount:h,dynamicAmountGroupStyle:c}=ns();return e(Ht,{...a,getInputRef:i,onValueChange:e=>{r({target:{value:e.value,name:o}})},valueIsNumericString:!1,..."amountfield"===s?{thousandSeparator:!0,isNumericString:!0,decimalScale:n?.decimalScale?n?.decimalScale:h??2,fixedDecimalScale:!0,thousandsGroupStyle:n?.thousandsGroupStyle?n?.thousandsGroupStyle:c??"lakh"}:{},...l})},$p=({name:i,label:r,placeholder:n,options:a,_optionsKey:s,handleChange:o,freeSolo:h=!1,disabled:c,columnValue:d,dependentField:u})=>{const A=l((e=>t=>Boolean(e)?t:t?.label??"")(h),[]),{t:p}=W(),{authState:m}=es(),{data:g,status:w,isLoading:b,isFetching:v,error:y}=zt([s],()=>a(d?.[i]??void 0,d,u,m));return e(ye,{sx:{mb:3},options:g??[],onChange:(e,t)=>{o({target:{value:t?.value,name:i}},t?.label)},disabled:c,getOptionLabel:A,renderInput:a=>e(Ao,{...a,label:p(r??""),placeholder:String(p(n??"")),name:i,autoComplete:"disable",InputProps:{...a.InputProps,endAdornment:t(f,{children:[b||v?e(G,{size:25,color:"secondary",variant:"indeterminate"}):null,a.InputProps.endAdornment]})},InputLabelProps:{shrink:!0}}),renderOption:(t,i,r)=>{t.key=t.id;let{selected:n,inputValue:a}=r,s=A(i);const o=wi(s,a),l=bi(s,o).map((t,i)=>e("span",{style:{fontWeight:t.highlight?700:400},children:t.text},i));return e("li",{style:{whiteSpace:"pre"},...t,children:l})}})},Zp=c(({finalMetaData:t,onAction:i,loading:r,data:n,submitSecondButtonHide:a=!0,submitSecondButtonName:s="submit",submitSecondLoading:o=!1,submitSecondAction:l=(e,t)=>{},submitSecondValidtion:h=!0,onFieldAction:c=(e,t,i)=>{},propStyles:d={titleStyle:{},toolbarStyles:{},IconButtonStyle:{},paperStyle:{}},enableEnterToFocus:u,focusScopeId:A="enter-to-focus-formComponentView"},p)=>{const{enableEnterToFocus:f}=ns(),m=t.gridConfig?.isDisplayOnly??!1,{t:g}=W();let w=ef({metaData:t,isDisplayOnly:m,data:n});return e(Xp,{dense:w.gridConfig?.dense??!0,title:g(w.gridConfig?.title??"No Title"),fields:w.fields,allowColumnHiding:w.gridConfig?.allowColumnHiding??!1,initialDataValue:w.initialData,initialVisibleColumnData:w.initialVisibleColumnData,submitButtonHide:w.gridConfig?.submitButtonHide??!1,submitButtonName:w.gridConfig?.submitButtonName??"SUBMIT",hideHeader:w.gridConfig?.HideHeader??!1,isDisplayOnly:m,onAction:i,loading:r,submitSecondButtonHide:a,submitSecondButtonName:s,submitSecondLoading:o,submitSecondAction:l,submitSecondValidtion:h,onFieldAction:c,propStyles:d,enableEnterToFocus:u??f,focusScopeId:A,ref:p})}),ef=({metaData:e,isDisplayOnly:t,data:i})=>{let r=N(e),n=r.fields.reduce((e,r)=>e={...e,[r.name]:t||Boolean(i[r?.accessor])?i[r?.accessor]??"":r?.defaultValue??""},{}),a=r.fields.reduce((e,t)=>e={...e,[t.name]:t?.isVisible??!0},{});return{gridConfig:r.gridConfig,fields:r.fields,initialData:n,initialVisibleColumnData:a}},tf=E.object().shape({name:E.string().required(),label:E.string().required(),render:E.object().shape({ordering:E.string().required(),renderType:E.string().required(),groups:E.object().required()}),submitAction:E.string().required()}),rf=E.array().of(E.object().shape({name:E.string().required(),label:E.string().required(),render:E.object().shape({componentType:E.string().required(),group:E.number().required()}),sequence:E.number(),GridProps:E.object().shape({xs:E.number().required(),md:E.number().required(),sm:E.number().required()})}));E.object().shape({form:tf,fields:rf});const nf=c(({metaData:i,children:r=()=>{},actions:n=[],initialData:a={},isError:l=!1,errorObj:c={},handelActionEvent:u=()=>{},formStyle:A={background:"white",height:"calc(100vh - 650px)",overflowY:"auto",overflowX:"hidden"},isNewRow:m=null,isLoading:g=!1,onSubmitData:w=()=>{},displayMode:b=null,containerstyle:v={padding:"10px"},formName:y="",formNameMaster:B="",onFormButtonClickHandel:C=e=>{},onClickActionEvent:x=()=>{},hideHeader:F=!1,onFormDataChange:S=()=>{},isDetailHide:N=!1,formState:E={},setDataOnFieldChange:k,isDetailRowRequire:T=!0,subHeaderLabel:L,subHeaderLabelStyle:I,hideDisplayModeInTitle:D=!1,headerToolbarStyle:U={},refetchData:P,formHeaderStyle:R={},enableEnterToFocus:O,focusScopeId:Q="enter-to-focus-master-details-form",handleClickAction:H,disableMultipleRowSelect:M=!1,defaultSelectedRowId:_="",setValidationRunning:j},z)=>{const{enableEnterToFocus:V}=ns(),K=s(()=>{const{DETAILS_DATA:e=[],...t}=a;return e},[a]),[q,G]=d(K),{t:J}=W(),X=o(null),Y=o(null),$=o(!1),[Z,ee]=d(""),te=s(()=>Os(i.masterForm,b),[i,b,B]),ie=s(()=>Qs(i.detailsGrid,b),[i,b,y]),re=s(()=>i?.detailsGrid?.gridConfig?.rowIdColumn||"id",[i]),ne=s(()=>{const{DETAILS_DATA:e,...t}=a;return t},[a]),ae=s(()=>ie.columns.reduce((e,t)=>("deleteRowCell"===t?.componentType||(e[t?.accessor]=t?.defaultValue??""),e),{}),[ie]),se=s(()=>{let e=ie.columns;return"view"===b&&(e=ie.columns.filter(e=>"_hidden"!==e.accessor)),{...ie,columns:e}},[b,ie]);h(()=>{$.current=N,N&&Boolean(Z)&&ee("")},[N,ee]);const oe=()=>{Y?.current?.handleFormReset({preventDefault:()=>{}}),G([])},le=()=>{Y?.current?.handleFormClear({preventDefault:()=>{}}),G([])};return p(z,()=>({addNewRow:(e=!1,t=ae)=>(async(e=!1,t=ae)=>{if(!g){if(Boolean(Z)&&ee(""),e){let{hasError:e,data:t}=await(X.current?.validate(!0));if(!0===e)return void(t&&G(t))}G(e=>{if(Array.isArray(e)){let i=As(e,re);const r={...t,_isNewRow:!0,[re]:i};return[...e,r]}return[{...t,_isNewRow:!0,[re]:1}]})}})(e,t),GetGirdData:()=>X?.current?.cleanData?.(),onSubmitHandler:(e,t="action",i=!0)=>{Y.current?.handleSubmit(e,t,i)},setGridData:G,getFieldData:Y?.current?.getFieldData,handleFormReset:oe,clearMasterDetailForm:le,handleFormClear:Y?.current?.handleFormClear})),e(f,{children:t("div",{style:{paddingBottom:"10px"},children:[l?e("div",{style:{padding:"10px 10px 0 10px"},children:e(Ar,{position:"relative",color:"primary",children:e(to,{severity:"error",errorMsg:c?.error_msg??"Unknow Error",errorDetail:c?.error_detail??"",color:"error"})})}):Boolean(Z)?e("div",{style:{padding:"10px 10px 0 10px"},children:e(Ar,{position:"relative",color:"primary",children:e(to,{errorMsg:Z,errorDetail:"",severity:"error"})})}):null,e(Nc,{metaData:te,initialValues:ne,formStyle:A,onSubmitHandler:async(e,t,i,r,n,a,s,o)=>{if($.current){Boolean(Z)&&ee("");let l=vs(e,ne),h={_isNewRow:Boolean(m),...e,DETAILS_DATA:{isNewRow:[],isUpdatedRow:[],isDeleteRow:[]},...l};w({data:h,resultValueObj:e,resultDisplayValueObj:t,endSubmit:i,setFieldErrors:r,actionFlag:n,hasError:a,optionalData:s,errorFields:o})}else{let{hasError:a,data:l}=await(X.current?.validate(!0));if(Boolean(Z)&&ee(""),!0===a)i(!0),l&&G(l);else{let l=X?.current?.cleanData?.();if(Array.isArray(l)||(l=[l]),0===l.length&&T)i(!0),ee(String(J("Atleastonerowmustbeindetail")));else{let h=l.filter(e=>Boolean(e?._hidden));if("edit"===b&&h.length===l.length&&T)return i(!0),void ee(String(J("Atleastonerowmustbeindetail")));let c=l.filter(e=>!(Boolean(e?._hidden)&&Boolean(e?._isNewRow)));if(0===c.length&&T)i(!0),ee(String(J("Atleastonerowmustbeindetail")));else{c=Gs(c);let l=vs(e,ne),h={_isNewRow:Boolean(m),...e,DETAILS_DATA:c,...l};w({data:h,resultValueObj:e,resultDisplayValueObj:t,endSubmit:i,setFieldErrors:r,actionFlag:n,hasError:a,optionalData:s,errorFields:o})}}}}},displayMode:b,hideDisplayModeInTitle:D,containerstyle:v,onFormButtonClickHandel:C,onFormDataChange:S,hideHeader:F,formState:E,ref:Y,setDataOnFieldChange:k,subHeaderLabel:L,subHeaderLabelStyle:I,formHeaderStyle:R,focusScopeId:Q,enableEnterToFocus:O??V,setValidationRunning:j,children:r},(Boolean(B),B)),e("div",{style:{paddingRight:"10px",paddingLeft:"10px",display:N?"none":"inherit"},children:e(hu,{finalMetaData:se,data:q,setData:G,loading:g,actions:n,setAction:u,refetchData:P,ref:X,onClickActionEvent:x,fieldDataRef:Y,headerToolbarStyle:U,focusScopeId:Q,enableEnterToFocus:O??V,handleClickAction:H,disableMultipleRowSelect:M,defaultSelectedRowId:_},(Boolean(y),y))})]})})}),af=n({}),sf=({children:t,insertFormData:i,checkFormDataExist:r,deleteFormData:n,updateFormData:a,getFormData:s,getGridFormData:o,getFormMetaData:l,getGridFormMetaData:h,context:c})=>e(af.Provider,{value:{context:c,insertFormData:i,checkFormDataExist:r,deleteFormData:n,updateFormData:a,getFormData:s,getGridFormData:o,getFormMetaData:l,getGridFormMetaData:h},children:t}),of=({isDataChangedRef:r,successAction:n,cancelAction:s,formStyle:l})=>{const{insertFormData:c,getFormMetaData:d,context:u}=a(af),{enqueueSnackbar:A}=fr(),{addEntry:p}=a(bo),f=o(null);null===f.current&&(f.current=yo(Object.values(c.args)));const m=Vt((e=>async({data:t})=>e(t))(c.fn(c.args)),{onError:(e,{endSubmit:t})=>{let i="Unknown Error occured";"object"==typeof e&&(i=e?.error_msg??i),t(!1,i,e?.error_detail??"")},onSuccess:(e,{endSubmit:t})=>{t(!0,""),r.current=!0,A("Data is successfully saved with",{variant:"success"}),"function"==typeof n&&n()}});h(()=>{p(["getFormMetaData",f.current,"new"])},[p]);const g=zt(["getFormMetaData",f.current,"new"],()=>d.fn(d.args)("new")),w=g.dataUpdatedAt,b=g.isLoading||g.isFetching;let v=g.isError,y=`${g.error?.error_msg??"unknown error occured"}`,B={};g.isSuccess&&(B=N(g.data),B.form.formState={...u,formCode:B?.form?.name},B.form.name=`${B.form.name}-New`,"stepper"===B?.form?.render?.renderType&&(B.form.render.renderType="tabs")),!1===b&&!1===v&&(!1===v||(y="Error loading form"));return b?t(i,{children:[e(wd,{}),"function"==typeof s?e("div",{style:{position:"absolute",right:0,top:0},children:e(C,{onClick:s,children:e(pr,{})})}):null]}):!0===v?t(i,{children:[e("span",{children:y}),"function"==typeof s?e("div",{style:{position:"absolute",right:0,top:0},children:e(C,{onClick:s,children:e(pr,{})})}):null]}):e(Nc,{metaData:B,initialValues:{},onSubmitHandler:(e,t,i,r)=>{m.mutate({data:e,displayData:t,endSubmit:i,setFieldError:r})},displayMode:"new",formStyle:l,children:({isSubmitting:r,handleSubmit:n})=>t(i,{children:[e(ct,{onClick:n,disabled:r,endIcon:r?e(G,{size:20}):null,children:"Save"}),"function"==typeof s?e(ct,{onClick:s,disabled:r,children:"Cancel"}):null]})},`${f.current}-${w}-new`)},lf=({isDataChangedRef:r,closeDialog:n,defaultView:s="view",serialNo:c="1",setEditFormStateFromInitValues:u,readOnly:A=!1,disableCache:p=!1,formStyle:f})=>{const{updateFormData:m,getFormData:g,getFormMetaData:w,context:b}=a(af),{addEntry:v}=a(bo),[y,B]=d(s),{enqueueSnackbar:x}=fr(),F=l(()=>B("view"),[B]),S=l(()=>B("edit"),[B]),E=o(null);null===E.current&&(E.current=yo(Object.values(g.args)));const k=Vt((e=>async({data:t,serialNo:i})=>e(t,i))(m.fn(m.args)),{onError:(e,{endSubmit:t})=>{let i="Unknown Error occured";"object"==typeof e&&(i=e?.error_msg??i),t(!1,i,e?.error_detail??"")},onSuccess:(e,{serialNo:t})=>{wo.refetchQueries(["getFormData",E.current,t]),x("Data changes successfully saved",{variant:"success"}),r.current=!0,F(),"function"==typeof n&&n()}}),T=(e,t,i,r)=>{k.mutate({data:e,displayData:t,endSubmit:i,setFieldError:r,serialNo:c})};h(()=>{v(["getFormData",E.current,c]),v(["getFormMetaData",E.current,"view"]),v(["getFormMetaData",E.current,"edit"])},[v,c]);const L=Kt([p?{queryKey:["getFormData",E.current,c],queryFn:()=>g.fn(g.args)(c),cacheTime:0}:{queryKey:["getFormData",E.current,c],queryFn:()=>g.fn(g.args)(c)},{queryKey:["getFormMetaData",E.current,"view"],queryFn:()=>w.fn(w.args)("view")},{queryKey:["getFormMetaData",E.current,"edit"],queryFn:()=>w.fn(w.args)("edit")}]),I=`${L[0].dataUpdatedAt}`,D=L[0].isLoading||L[1].isLoading||L[2].isLoading||L[0].isFetching||L[1].isFetching||L[2].isFetching;let U=L[0].isError||L[1].isError||L[2].isError,P=`${L[0].error?.error_msg} ${L[1].error?.error_msg} ${L[2].error?.error_msg}`;P=Boolean(P.trim())?P:"Unknown error occured";let R=L[0].data,O={},Q={};if(L[1].isSuccess&&L[2].isSuccess&&L[0].isSuccess){const e="function"==typeof u?u(L[0].data):void 0;Q=N(L[1].data),O=N(L[2].data),O.form.formState={...b,serialNo:c,formCode:O.form.name,...e},O.form.name=`${O.form.name}-edit`,"stepper"===O?.form?.render?.renderType&&(O.form.render.renderType="tabs"),Q.form.formState={...b,serialNo:c,formCode:Q.form.name,...e},Q.form.name=`${Q.form.name}-view`,"stepper"===Q?.form?.render?.renderType&&(Q.form.render.renderType="tabs")}return D?t(i,{children:[e(wd,{}),"function"==typeof n?e("div",{style:{position:"absolute",right:0,top:0},children:e(C,{onClick:n,children:e(pr,{})})}):null]}):!0===U?t(i,{children:[e("span",{children:P}),"function"==typeof n?e("div",{style:{position:"absolute",right:0,top:0},children:e(C,{onClick:n,children:e(pr,{})})}):null]}):"view"===y?t(Nc,{metaData:Q,initialValues:R,onSubmitHandler:T,displayMode:y,formStyle:f,children:[A?null:e(ct,{onClick:S,children:"Edit"}),"function"==typeof n?e(ct,{onClick:n,children:"Cancel"}):null]},`${E.current}-${I}-${y}`):"edit"===y?e(Nc,{metaData:O,initialValues:R,onSubmitHandler:T,displayMode:y,formStyle:f,children:({isSubmitting:r,handleSubmit:n})=>t(i,{children:[e(ct,{onClick:n,disabled:r,endIcon:r?e(G,{size:20}):null,children:"Save"}),e(ct,{onClick:F,disabled:r,children:"Cancel"})]})},`${E.current}-${I}-${y}`):null},hf=({isDataChangedRef:i,closeDialog:r,serialNo:n})=>{const{deleteFormData:s}=a(af),l=o(null),{t:h}=W();null===l.current&&(l.current=yo(Object.values(s.args)));const c=Vt((e=>async({serialNo:t})=>e(t))(s.fn(s.args)),{onError:e=>{},onSuccess:e=>{i.current=!0,r()}});return t(f,{children:[e(ut,{id:"alert-dialog-title",children:h("AreyousureyouwanttodeletetheselectedRecords")}),c.isLoading?e(pt,{children:"Deleting..."}):c?.isError?e(pt,{children:e(to,{severity:"error",errorMsg:c.error?.error_msg??"Unknown Error occured",errorDetail:c.error?.error_detail??""})}):c.isSuccess?e(pt,{children:h("AllRecordssuccessfullydeleted")}):null,c.isSuccess?e(At,{children:e(ct,{onClick:r,color:"primary",children:h("Close")})}):t(At,{children:[e(ct,{onClick:r,color:"primary",disabled:c.isLoading,children:h("Disagree")}),e(ct,{onClick:()=>c.mutate({serialNo:n}),color:"primary",disabled:c.isLoading,children:h("Agree")})]})]},l.current)},cf=c(({actions:t,setAction:i},r)=>{const{addEntry:n}=a(bo),{getGridFormData:s,getGridFormMetaData:l,context:c}=a(af),d=o(null);null===d.current&&(d.current=yo(Object.values(s.args)));const u=Kt([{queryKey:["getGridFormMetaData",d.current],queryFn:()=>l.fn(l.args)()},{queryKey:["getStaticGridData",d.current],queryFn:()=>s.fn(s.args)()}]);h(()=>{n(["getGridFormMetaData",d.current]),n(["getStaticGridData",d.current])},[n]),p(r,()=>({refetch:()=>u[1].refetch()}));const A=u[0].isLoading||u[0].isFetching;let f=u[0].isError||u[1].isError,m=`${u[0].error?.error_msg} ${u[1].error?.error_msg}`.trimStart().trimEnd();m=Boolean(m)?m:"unknown error occured";return A?e(wd,{}):!0===f?e("span",{children:m}):e(hu,{finalMetaData:u[0].data,data:u[1].data??[],setData:()=>null,actions:t,setAction:i,loading:u[1].isLoading||u[1].isFetching,gridProps:c},`staticGridData-${d.current}`)});cf.displayName="MyGridWrapper";const df=[{label:"KYC",sequence:0,docType:[{label:"Add Documents",type:"kyc",primary:!0,categoryCD:"KYC_DOC_TYPE_CO"}]},{label:"Bank",sequence:1,docType:[{label:"Add Documents",type:"bank",primary:!0,categoryCD:"BANK_DOC_TYPE"}]},{label:"Financial",sequence:2,docType:[{label:"ITR",type:"itr",primary:!0,categoryCD:"ITR_DOC_TYPE"},{label:"Others",type:"itrOther",primary:!1,categoryCD:"ITR_DOC_TYPE_O"}]},{label:"GST",sequence:3,docType:[{label:"Analysis",type:"gst",primary:!0,categoryCD:"GST_DOC_TYPE"},{label:"Others",type:"gstOther",primary:!0,categoryCD:"GST_DOC_TYPE_O"}]},{label:"Others",sequence:4,docType:[{label:"Add Documents",type:"other",primary:!0,categoryCD:"OTHER_DOC_TYPE"}]}],uf=[{label:"KYC",sequence:0,docType:[{label:"Add Documents",type:"kyc",primary:!0,categoryCD:"KYC_DOC_TYPE"}]},{label:"Bank",sequence:1,docType:[{label:"Add Documents",type:"bank",primary:!0,categoryCD:"BANK_DOC_TYPE"}]},{label:"Financial",sequence:2,docType:[{label:"ITR",type:"itr",primary:!0,categoryCD:"ITR_DOC_TYPE"},{label:"Others",type:"itrOther",primary:!1,categoryCD:"ITR_DOC_TYPE_O"}]},{label:"Others",sequence:3,docType:[{label:"Add Documents",type:"other",primary:!0,categoryCD:"OTHER_DOC_TYPE"}]}],Af={gridConfig:{dense:!0,gridLabel:"Update Statement",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!0,disableGlobalFilter:!0,disableGroupBy:!0,containerHeight:{min:"30vh",max:"30vh"},hideFooter:!0,hideHeader:!0,disableLoader:!0,enablePagination:!1},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Bank",componentType:"editableSelect",accessor:"bankID",sequence:4,alignment:"left",options:"getBankListForLeadDocuments",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]},disableCachingOptions:!0},{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getBankDocType",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0}]},pf={gridConfig:{dense:!0,gridLabel:"Bank Statement",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!1,disableGlobalFilter:!1,disableGroupBy:!1,containerHeight:{min:"40vh",max:"50vh"},enablePagination:!0},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Uploaded Date",componentType:"date",accessor:"uploadDate",sequence:2,alignment:"left",width:100,maxWidth:200,minWidth:100},{columnName:"Verification",componentType:"default",accessor:"status",sequence:3,alignment:"left",width:150,maxWidth:200,minWidth:100},{columnName:"Bank Name",componentType:"default",accessor:"bank",sequence:4,alignment:"left"},{columnName:"Document Type",componentType:"default",accessor:"docType",sequence:5,alignment:"left",width:150,maxWidth:200,minWidth:100},{columnName:"Remarks",componentType:"default",accessor:"remarks",sequence:6,alignment:"left",width:100,maxWidth:200,minWidth:100}]},ff=[{columnName:"Bank",componentType:"editableSelect",accessor:"bankLineID",sequence:4,alignment:"left",options:"getBankListForLeadDocuments",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]},disableCachingOptions:!0},{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getBankDocType",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0},{columnName:"Remarks",componentType:"editableTextField",accessor:"remarks",sequence:6,alignment:"left",isVisible:!1}],mf={gridConfig:{dense:!0,gridLabel:"GST Document Update",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!0,disableGlobalFilter:!0,disableGroupBy:!0,containerHeight:{min:"30vh",max:"30vh"},hideFooter:!0,hideHeader:!0,disableLoader:!0,enablePagination:!1},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getGSTDocType",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0}]},gf={gridConfig:{dense:!0,gridLabel:"GST",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!1,disableGlobalFilter:!1,disableGroupBy:!1,containerHeight:{min:"40vh",max:"50vh"},enablePagination:!0},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Uploaded Date",componentType:"date",accessor:"uploadDate",sequence:2,alignment:"left",width:100,maxWidth:200,minWidth:100},{columnName:"Verification",componentType:"default",accessor:"status",sequence:3,alignment:"left",width:150,maxWidth:200,minWidth:100},{columnName:"Document Type",componentType:"default",accessor:"docType",sequence:5,alignment:"left",width:150,maxWidth:200,minWidth:100},{columnName:"Remarks",componentType:"default",accessor:"remarks",sequence:6,alignment:"left",width:100,maxWidth:200,minWidth:100}]},wf=[{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getGSTDocType",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0},{columnName:"Remarks",componentType:"editableTextField",accessor:"remarks",sequence:6,alignment:"left",isVisible:!1}],bf=[{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getGSTDocTypeOther",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0},{columnName:"Remarks",componentType:"editableTextField",accessor:"remarks",sequence:6,alignment:"left",isVisible:!1}],vf={gridConfig:{dense:!0,gridLabel:"GST Document Update",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!0,disableGlobalFilter:!0,disableGroupBy:!0,containerHeight:{min:"30vh",max:"30vh"},hideFooter:!0,hideHeader:!0,disableLoader:!0,enablePagination:!1},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getGSTDocTypeOther",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0}]},yf={gridConfig:{dense:!0,gridLabel:"ITR Document Update",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!0,disableGlobalFilter:!0,disableGroupBy:!0,containerHeight:{min:"30vh",max:"30vh"},hideFooter:!0,hideHeader:!0,disableLoader:!0,enablePagination:!1},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Financial Year",componentType:"editableNumberFormat",accessor:"finYear",sequence:5,alignment:"left",FormatProps:{format:"####",placeholder:"YYYY",mask:["Y","Y","Y","Y"]},schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getITRDocType",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0}]},Bf={gridConfig:{dense:!0,gridLabel:"ITR",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!1,disableGlobalFilter:!1,disableGroupBy:!1,containerHeight:{min:"40vh",max:"50vh"},enablePagination:!0},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Uploaded Date",componentType:"date",accessor:"uploadDate",sequence:2,alignment:"left",width:100,maxWidth:200,minWidth:100},{columnName:"Verification",componentType:"default",accessor:"status",sequence:3,alignment:"left",width:150,maxWidth:200,minWidth:100},{columnName:"Financial Year",componentType:"default",accessor:"finYear",sequence:4,alignment:"left",width:150,maxWidth:200,minWidth:100},{columnName:"Document Type",componentType:"default",accessor:"docType",sequence:5,alignment:"left",width:150,maxWidth:200,minWidth:100},{columnName:"Remarks",componentType:"default",accessor:"remarks",sequence:6,alignment:"left",width:100,maxWidth:200,minWidth:100}]},Cf=[{columnName:"Financial Year",componentType:"editableNumberFormat",accessor:"finYear",sequence:4,alignment:"left",FormatProps:{format:"####",placeholder:"YYYY",mask:["Y","Y","Y","Y"]},schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getITRDocType",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0},{columnName:"Remarks",componentType:"editableTextField",accessor:"remarks",sequence:6,alignment:"left",isVisible:!1}],xf={gridConfig:{dense:!0,gridLabel:"ITR Document Update",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!0,disableGlobalFilter:!0,disableGroupBy:!0,containerHeight:{min:"30vh",max:"30vh"},hideFooter:!0,hideHeader:!0,disableLoader:!0,enablePagination:!1},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getITRDocTypeOther",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0}]},Ff=[{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getITRDocTypeOther",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0},{columnName:"Remarks",componentType:"editableTextField",accessor:"remarks",sequence:6,alignment:"left",isVisible:!1}],Sf={gridConfig:{dense:!0,gridLabel:"KYC Document Update",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!0,disableGlobalFilter:!0,disableGroupBy:!0,containerHeight:{min:"30vh",max:"30vh"},hideFooter:!0,hideHeader:!0,disableLoader:!0,enablePagination:!1},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getKYCDocType",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0}]},Nf={gridConfig:{dense:!0,gridLabel:"KYC",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!1,disableGlobalFilter:!1,disableGroupBy:!1,containerHeight:{min:"40vh",max:"50vh"},enablePagination:!0},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Uploaded Date",componentType:"date",accessor:"uploadDate",sequence:2,alignment:"left",width:100,maxWidth:200,minWidth:100},{columnName:"Verification",componentType:"default",accessor:"status",sequence:3,alignment:"left",width:150,maxWidth:200,minWidth:100},{columnName:"Document Type",componentType:"default",accessor:"docType",sequence:5,alignment:"left",width:150,maxWidth:200,minWidth:100},{columnName:"Remarks",componentType:"default",accessor:"remarks",sequence:6,alignment:"left",width:100,maxWidth:200,minWidth:100}]},Ef=[{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getKYCDocType",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0},{columnName:"Remarks",componentType:"editableTextField",accessor:"remarks",sequence:6,alignment:"left",isVisible:!1}],kf={gridConfig:{dense:!0,gridLabel:"KYC Document Update",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!0,disableGlobalFilter:!0,disableGroupBy:!0,containerHeight:{min:"30vh",max:"30vh"},hideFooter:!0,hideHeader:!0,disableLoader:!0,enablePagination:!1},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getKYCDocTypeLegal",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0}]},Tf=[{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getKYCDocTypeLegal",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0},{columnName:"Remarks",componentType:"editableTextField",accessor:"remarks",sequence:6,alignment:"left",isVisible:!1}],Lf={gridConfig:{dense:!0,gridLabel:"Others Document Update",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!0,disableGlobalFilter:!0,disableGroupBy:!0,containerHeight:{min:"30vh",max:"30vh"},hideFooter:!0,hideHeader:!0,disableLoader:!0,enablePagination:!1},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getOtherDocType",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0}]},If={gridConfig:{dense:!0,gridLabel:"Others",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!1,disableGlobalFilter:!1,disableGroupBy:!1,containerHeight:{min:"40vh",max:"50vh"},enablePagination:!0},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Uploaded Date",componentType:"date",accessor:"uploadDate",sequence:2,alignment:"left",width:100,maxWidth:200,minWidth:100},{columnName:"Verification",componentType:"default",accessor:"status",sequence:3,alignment:"left",width:150,maxWidth:200,minWidth:100},{columnName:"Document Type",componentType:"default",accessor:"docType",sequence:5,alignment:"left",width:150,maxWidth:200,minWidth:100},{columnName:"Remarks",componentType:"default",accessor:"remarks",sequence:6,alignment:"left",width:100,maxWidth:200,minWidth:100}]},Df=[{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getOtherDocType",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0},{columnName:"Remarks",componentType:"editableTextField",accessor:"remarks",sequence:6,alignment:"left",isVisible:!1}],Uf=({moduleType:e,productType:t,docCategory:i,categoryCD:r,refID:n,serialNo:a})=>async(e,t=()=>{},i=()=>{})=>{},Pf=({moduleType:e,productType:t,refID:i,serialNo:r})=>async e=>{},Rf=({moduleType:e,productType:t,refID:i,serialNo:r})=>async(e,t)=>{},Of=({moduleType:e,productType:t,refID:i,serialNo:r})=>async(e,t)=>{},Qf=({moduleType:e,productType:t,refID:i,serialNo:r})=>async(e,t,i,r)=>{},Hf=({moduleType:e,productType:t})=>(e,t)=>(Array.isArray(t)||(t=[t]),t.join(","),new URL("").href),Mf=({moduleType:e,productType:t})=>async(e,t)=>{Array.isArray(t)||(t=[t]);const i=new URL("").href;try{let e=await fetch(i,{method:"POST",body:JSON.stringify({request_data:{docUUID:t}}),headers:new Headers({"Content-Type":"application/json"})});if("200"===String(e.status)){return await e.blob()}return new Error("Error getting file")}catch(e){return e}},_f=({moduleType:e,productType:t,metaDataType:i})=>async e=>{if("grid"===i)switch(e){case"bank":return pf;case"itr":return Bf;case"gst":return gf;case"other":return If;case"kyc":return Nf;default:throw{error_msg:"Invalid docCategory"}}else if("upload"===i)switch(e){case"bank":return ff;case"itr":return Cf;case"itrOther":return Ff;case"gst":return wf;case"gstOther":return bf;case"other":return Df;case"kyc":return"management"===t?Ef:Tf;default:throw{error_msg:"Invalid docCategory"}}else{if("edit"!==i)throw{error_msg:"Invalid MetaData Type requested"};switch(e){case"bank":return Af;case"itr":return yf;case"itrOther":return xf;case"gst":return mf;case"gstOther":return vf;case"other":return Lf;case"kyc":return"management"===t?Sf:kf;default:throw{error_msg:"Invalid docCategory"}}}},jf=n({}),zf=({children:t,uploadDocuments:i,deleteDocuments:r,updateDocument:n,verifyDocuments:a,getDocumentsGridData:s,getDocumentListingGridMetaData:o,getDocumentUploadAddtionalFieldsMetaData:l,getDocumentEditGridMetaData:h,generateDocumentDownloadURL:c,previewDocument:d,context:u})=>e(jf.Provider,{value:{uploadDocuments:i,deleteDocuments:r,updateDocument:n,verifyDocuments:a,getDocumentsGridData:s,getDocumentListingGridMetaData:o,getDocumentUploadAddtionalFieldsMetaData:l,getDocumentEditGridMetaData:h,generateDocumentDownloadURL:c,previewDocument:d,context:u},children:t}),Vf=(e,t,i,r,n)=>({context:{moduleType:e,productType:t,docCategory:i,refID:r,serialNo:n},uploadDocuments:{fn:Uf,args:{moduleType:e,productType:t,refID:r,serialNo:n}},getDocumentsGridData:{fn:Pf,args:{moduleType:e,productType:t,refID:r,serialNo:n}},deleteDocuments:{fn:Rf,args:{moduleType:e,productType:t,refID:r,serialNo:n}},updateDocument:{fn:Of,args:{moduleType:e,productType:t,refID:r,serialNo:n}},verifyDocuments:{fn:Qf,args:{moduleType:e,productType:t,refID:r,serialNo:n}},getDocumentListingGridMetaData:{fn:_f,args:{moduleType:e,productType:t,metaDataType:"grid"}},getDocumentUploadAddtionalFieldsMetaData:{fn:_f,args:{moduleType:e,productType:t,metaDataType:"upload"}},getDocumentEditGridMetaData:{fn:_f,args:{moduleType:e,productType:t,metaDataType:"edit"}},generateDocumentDownloadURL:{fn:Hf,args:{moduleType:e,productType:t}},previewDocument:{fn:Mf,args:{moduleType:e,productType:t}}}),Kf=c(({actions:i,setAction:r,transformData:n=e=>e,defaultSortOrder:s,defaultGroupBy:l},c)=>{const{addEntry:d}=a(bo),{getDocumentsGridData:u,getDocumentListingGridMetaData:A,context:m}=a(jf),g=m.docCategory.filter(e=>!0===e.primary)[0].type,w=o(null);null===w.current&&(w.current=yo(Object.values(u.args))),h(()=>{d(["getDocumentListingGridMetaData",m.refID,g]),d(["getDocumentsGridData",w.current,g])},[d,m,g]),p(c,()=>({refetch:()=>b[0].refetch()}));const b=Kt([{queryKey:["getDocumentsGridData",w.current,g],queryFn:()=>u.fn(u.args)(g)},{queryKey:["getDocumentListingGridMetaData",m.refID,g],queryFn:()=>A.fn(A.args)(g)}]);return b[1].isLoading||b[1].isFetching?e(wd,{}):b[1].isError?e("span",{children:b[1]?.error?.error_msg??"Unknown Error occured"}):t(f,{children:[b[0].isError?e(ft,{severity:"error",children:b[0]?.error?.error_msg??"Unknown Error occured"}):null,e(hu,{data:n(b[0].data??[]),finalMetaData:b[1].data,setData:()=>null,actions:i,setAction:r,loading:b[0].isFetching||b[0].isLoading,refetchData:()=>b[0].refetch(),defaultSortOrder:s,defaultGroupBy:l},"listingDocuments")]})});Kf.displayName="MyGridWrapper";const qf=({dataChangedRef:i,closeDialog:r,docUUID:n})=>{const{deleteDocuments:s,context:o}=a(jf),l=o.docCategory.filter(e=>!0===e.primary)[0].type,{enqueueSnackbar:h}=fr(),c=Vt((e=>async({docType:t,docUUID:i})=>e(t,i))(s.fn(s.args)),{onError:e=>{},onSuccess:e=>{i.current=!0,h("Documents successful deleted",{variant:"success"}),r()}});return t(f,{children:[c.isError?e(ft,{severity:"error",children:c?.error?.error_msg??"Unknown Error occured"}):null,c.isLoading?e(mt,{variant:"indeterminate"}):null,e(ut,{id:"alert-dialog-title",children:"Are you sure you want to delete the selected Records"}),t(At,{children:[e(ct,{onClick:r,color:"primary",disabled:c.isLoading,children:"No"}),e(ct,{color:"primary",onClick:()=>c.mutate({docType:l,docUUID:n}),disabled:c.isLoading,children:"Yes"})]})]})},Gf=({dataChangedRef:i,closeDialog:r,docUUID:n})=>{const{verifyDocuments:s,context:o}=a(jf),l=o.docCategory.filter(e=>!0===e.primary)[0].type,[h,c]=d(""),[u,A]=d(""),{enqueueSnackbar:p}=fr(),m=Vt((e=>async({docType:t,docUUID:i,remarks:r})=>e(t,i,r,"Verify"))(s.fn(s.args)),{onError:e=>{},onSuccess:e=>{i.current=!0,p("Documents Successfully verified",{variant:"success"}),r()}}),g=Vt((e=>async({docType:t,docUUID:i,remarks:r})=>e(t,i,r,"Rejected"))(s.fn(s.args)),{onError:e=>{},onSuccess:e=>{i.current=!0,p("Documents Successfully Rejected",{variant:"success"}),r()}}),w=g.isError||m.isError,b=g.isLoading||m.isLoading;let v=`${g?.error?.error_msg??""} ${m?.error?.error_msg??""}`;return v=Boolean(v.trimEnd().trimStart())?v:"unknown error occured",t(f,{children:[b?e(mt,{variant:"indeterminate"}):null,w?e(ft,{severity:"error",children:v}):null,e(ut,{id:"alert-dialog-title",children:"Document Verification"}),e(pt,{children:e(_t,{onChange:e=>c(e.target.value),multiline:!0,rows:4,maxRows:4,error:Boolean(u),helperText:u,fullWidth:!0,label:"Remarks",InputLabelProps:{shrink:!0}})}),t(At,{children:[e(ct,{onClick:r,color:"primary",children:"Cancel"}),e(ct,{color:"primary",onClick:()=>{Boolean(h)?m.mutate({docType:l,docUUID:n,remarks:h}):A("This is a required field")},disabled:b,children:"Verify"}),e(ct,{color:"primary",onClick:()=>{Boolean(h)?g.mutate({docType:l,docUUID:n,remarks:h}):A("This is a required filed")},disabled:b,children:"Reject"})]})]})},Wf=({row:{data:r,id:n},closeDialog:s,dataChangedRef:l})=>{const[c,u]=d(Array.isArray(r)?r:[r]),{updateDocument:A,getDocumentEditGridMetaData:p,context:f}=a(jf),m=f.docCategory.filter(e=>e.categoryCD===r.docCategory)[0].type,g=f.docCategory.filter(e=>!0===e.primary)[0].type,{addEntry:w}=a(bo),{enqueueSnackbar:b}=fr(),v=o(null);h(()=>{w(["getDocumentEditGridMetaData",f.moduleType,f.productType??"legal",m])},[w,f,m]);const y=zt(["getDocumentEditGridMetaData",f.moduleType,f.productType??"legal",m],()=>p.fn(p.args)(m)),B=Vt((e=>async({docType:t,data:i})=>e(t,i))(A.fn(A.args)),{onError:e=>{},onSuccess:e=>{l.current=!0,b("Document changes successful",{variant:"success"}),s()}});let C=`${y.error?.error_msg??"unknown message"}`;const x=y.isLoading?e(wd,{}):!0===y.isError?e("span",{children:C}):t(i,{children:[B.isError?e(ft,{severity:"error",children:B?.error?.error_msg??"Unknown Error occured"}):null,B.isLoading?e(mt,{variant:"indeterminate"}):null,e(ut,{id:"alert-dialog-title",children:"Update Documents"}),e(pt,{children:e(hu,{data:c??[],finalMetaData:y.data,setData:u,gridProps:f,ref:v,loading:B.isLoading},"listingDocumentsForUpdate")}),t(At,{children:[e(ct,{onClick:s,color:"primary",disabled:B.isLoading,children:"Cancel"}),e(ct,{color:"primary",onClick:async()=>{let{hasError:e,data:t}=await(v?.current?.validate?.());if(!0===e)u(t);else{let e=v?.current?.cleanData?.();await B.mutate({docType:g,data:e})}},disabled:B.isLoading,children:"Update"})]})]});return x},Jf=({onClose:t,editableFileName:i,dataChangedRef:r,currentAction:n})=>{const{uploadDocuments:s,getDocumentUploadAddtionalFieldsMetaData:o,context:l}=a(jf),c=l.docCategory.filter(e=>e.type===n)[0],d=c.type,u=c.categoryCD,A=l.docCategory.filter(e=>!0===e.primary)[0].type,{addEntry:p}=a(bo),{enqueueSnackbar:f}=fr();h(()=>{p(["getDocumentUploadAddtionalFieldsMetaData",l.moduleType,l.productType,d])},[l,p,d]);const m=zt(["getDocumentUploadAddtionalFieldsMetaData",l.moduleType,l.productType,d],()=>o.fn(o.args)(d));let g=`${m.error?.error_msg??"unknown error occured"}`;return m.isLoading?e(wd,{}):!0===m.isError?e("span",{children:g}):e(_u,{onClose:()=>{!0===r.current&&f("Documents Successfully uploaded",{variant:"success"}),t()},additionalColumns:m.data,editableFileName:i,dataChangedRef:r,onUpload:s.fn({...s.args,docCategory:A,categoryCD:u}),gridProps:{...l,docCategory:d},maxAllowedSize:12328960,allowedExtensions:"partner"===l.productType||["kyc","other"].indexOf(d)>=0?["pdf","jpg","jpeg","png"]:["pdf"]})},Xf=(e,t)=>{const i=document.createElement("a");i.href=String(e),i.download=t;const r=()=>{setTimeout(()=>{URL.revokeObjectURL(String(e)),i.removeEventListener("click",r)},150)};i.target="_blank",i.addEventListener("click",r,!1),i.click()},Yf=({docData:i,closeDialog:r,maxDownloadLimit:n=3})=>{const{generateDocumentDownloadURL:s,context:o}=a(jf),l=o.docCategory.filter(e=>!0===e.primary)[0].type,[c,u]=d("");return h(()=>{if(i.length>Number(n))u(`Cannot download more than ${n} files at a time`);else{if(1===i.length){const e=s.fn(s.args)(l,i.map(e=>e.id));Xf(e,i[0].name)}else if(i.length>1){const e=s.fn(s.args)(l,i.map(e=>e.id));Xf(e,`download-${(new Date).getUTCMilliseconds()}`)}r()}},[n,i,l,r,s]),Boolean(c)?t(f,{children:[e(ut,{children:c}),e(At,{children:e(ct,{onClick:()=>{u(""),r()},children:"Ok"})})]}):null},$f=({fileType:t,fileName:i,docUUID:r,closeDialog:n})=>t.indexOf("pdf")>=0||t.indexOf("image")>=0?e(Zf,{fileName:i,onClose:n,docUUID:r,fileType:t}):e(em,{onClose:n,fileName:i}),Zf=({fileName:i,onClose:r,docUUID:n,fileType:a})=>{const{loading:s,blob:l,error:c,success:d}=tm({docUUID:n,fileType:a}),u=o("");return d&&(u.current=URL.createObjectURL(l)),h(()=>{let e=u.current??"";return()=>{URL.revokeObjectURL(e)}},[]),t(f,{children:[t(At,{style:{display:"flex",padding:"8px 24px"},children:[e(vt,{variant:"h6",color:"textSecondary",children:"File:"}),e(vt,{variant:"h6",children:i}),e("div",{style:{flexGrow:1}}),d?e(C,{color:"primary",onClick:()=>xu(l,i),children:e(yt,{})}):null,"function"==typeof r?e(C,{color:"primary",onClick:r,children:e(Bt,{})}):null]}),e(pt,{children:s?e(wd,{}):Boolean(c)?e("span",{children:c}):e("iframe",{src:`${u.current}`,title:"Document View",style:{height:"100%",width:"100%"},"aria-label":"File Preview"})})]})},em=({onClose:i,fileName:r,message:n})=>t(f,{children:[t(At,{style:{display:"flex",padding:"8px 24px"},children:[e(vt,{variant:"h6",color:"textSecondary",children:"File:"}),e(vt,{variant:"h6",children:r}),e("div",{style:{flexGrow:1}}),"function"==typeof i?e(C,{color:"primary",onClick:i,children:e(Bt,{})}):null]}),e(pt,{children:n})]}),tm=({docUUID:e,fileType:t})=>{const[i,r]=d(!0),[n,s]=d(!1),[o,l]=d(""),{previewDocument:c,context:u}=a(jf),A=u.docCategory.filter(e=>!0===e.primary)[0].type,[p,f]=d(null);return h(()=>{c.fn(c.args)(A,e).then(e=>{if(e instanceof Error)l(e.message),r(!1),s(!1);else if("application/json"===e.type)e.text(e=>{l(e),r(!1),s(!1)});else{const i=new Blob([e],{type:t});f(i),s(!0),l(""),r(!1)}}).catch(e=>{l(e.message),r(!0),s(!1)})},[l,r,s,f,e,t,c,A]),{success:n,loading:i,error:o,blob:p}},im=({closeDialog:e})=>(h(()=>{e()},[e]),null),rm=[{actionName:"Verify",actionLabel:"Verify",multiple:!0,shouldExclude:e=>{let t=!1;for(let i=0;i<e.length;i++)if("Pending"!==e[i].data?.status){t=!0;break}return t}},{actionName:"View",actionLabel:"View",multiple:!1,rowDoubleClick:!0},{actionName:"Download",actionLabel:"Download",multiple:!0},{actionName:"Delete",actionLabel:"Delete",multiple:!0},{actionName:"Update",actionLabel:"Update",multiple:!1}],nm=({disableActions:i})=>{const{context:r}=a(jf),n=o(null);if(null===n.current){let e,t=r.docCategory.map(e=>({actionName:`Add_${e.type}`,actionLabel:e.label,multiple:void 0,alwaysAvailable:!0}));n.current=[...t,...rm],e="string"==typeof i?[i]:Array.isArray(i)?i:[],Array.isArray(e)&&(n.current=n.current.filter(t=>!(e.indexOf("Add")>=0&&t.actionName?.indexOf("Add")>=0)&&!(e?.indexOf(t.actionName)>=0)))}const[s,c]=d(null),u=o(null),A=o(!1),p=l(()=>{c(null),!0===A.current&&(u.current?.refetch?.(),A.current=!1)},[c]);h(()=>()=>{wo.removeQueries(["getBankListForLeadDocuments"],{exact:!1})},[]);let m=s?.name??"";return t(f,{children:[e(Kf,{ref:u,actions:n.current,setAction:c},"documentListing"),e(dt,{open:Boolean(s),maxWidth:"xl",PaperProps:{style:m.indexOf("Add")>=0||"View"===m?{width:"100%",height:"100%"}:"Verify"===m?{width:"40%"}:{}},children:m.indexOf("Add")>=0?e(Jf,{onClose:p,editableFileName:!1,dataChangedRef:A,currentAction:m.slice(m.indexOf("Add_")+4)}):"Update"===m?e(Wf,{row:s?.rows[0],closeDialog:p,dataChangedRef:A}):"Delete"===m?e(qf,{docUUID:s?.rows.map(e=>e.id),closeDialog:p,dataChangedRef:A}):"Verify"===m?e(Gf,{docUUID:s?.rows.map(e=>e.id),closeDialog:p,dataChangedRef:A}):"Download"===m?e(Yf,{closeDialog:p,docData:s?.rows.map(e=>({id:e.id,name:e.data?.fileName}))}):"View"===m?e($f,{closeDialog:p,docUUID:s?.rows[0]?.id,fileName:s?.rows[0]?.data?.fileName,fileType:s?.rows[0]?.data?.fileType}):e(im,{closeDialog:p})})]})},am=Ci(e=>({tabPanel:{borderTop:"0",padding:`${e.spacing(2)},0`,backgroundColor:"#fff"}})),sm=({value:e,index:t,children:i})=>Number(e)===Number(t)?i:null,om=({moduleType:i,productType:r,refID:n,serialNo:s,onClose:o,skipBankDetails:l=!1,readOnly:c})=>{const{addEntry:u}=a(bo),[A,p]=d(0),m=am();h(()=>{u(["getDocumentCRUDTabsMetadata",i,r??"legal",n])},[u,i,n]);const g=zt(["getDocumentCRUDTabsMetadata",i,r??"legal",n],()=>(async({moduleType:e,productType:t,refID:i})=>Boolean(t)?uf:df)({moduleType:i,productType:r,refID:n}));let w=g.data;g.isSuccess&&(Array.isArray(w)?(l&&(w=w.filter(e=>"Bank"!==e.label)),w=w.sort((e,t)=>e.sequence>t.sequence?1:e.sequence<t.sequence?-1:0),l&&(w=w.map((e,t)=>({...e,sequence:t})))):w=[]);return g.isLoading?e(wd,{}):g.isError?g.error?.error_msg??"unknown error occured":t(f,{children:[t("div",{style:{display:"flex"},children:[e(gr,{value:A,onChange:(e,t)=>{p(t)},variant:"scrollable",children:w.map(t=>e(wr,{label:t.label,id:`${t.sequence}`},t.sequence))}),"function"==typeof o?t(f,{children:[e("div",{style:{flexGrow:1}}),e(ct,{variant:"text",onClick:o,children:"Close"})]}):null]}),e("div",{className:m.tabPanel,children:w.map(t=>e(sm,{value:A,index:`${t.sequence}`,children:e(zf,{...Vf(i,r,t.docType,n,s),children:e(nm,{disableActions:c?["Add","Verify","Delete","Update"]:[]})},t.docType.filter(e=>!0===e?.primary)[0].type)},t.sequence))})]})},lm=({isDataChangedRef:r,successAction:n,readOnly:s,closeDialog:c,formStyle:d})=>{const{addEntry:u}=a(bo),{checkFormDataExist:A}=a(af),{insertFormData:p}=a(af),f=o(null);null===f.current&&(f.current=yo(Object.values(p.args)));let m=zt(["checkFormDataExist",f.current],()=>A.fn(A.args)());h(()=>{u(["checkFormDataExist",f.current])},[u]);const g=m.isFetching||m.isLoading,w=m.isError,b="YES"===m.data?.exists||(m.data,!1),v=l(()=>{"function"==typeof n&&(n(),m.refetch())},[]);return h(()=>{b&&"function"==typeof n&&v()},[b,v]),g?t(i,{children:[e(wd,{}),"function"==typeof c?e("div",{style:{position:"absolute",right:0,top:0},children:e(C,{onClick:c,children:e(pr,{})})}):null]}):w?t(i,{children:[t("div",{children:[m?.error?.error_msg??"Unknown error occured"," "]}),"function"==typeof c?e("div",{style:{position:"absolute",right:0,top:0},children:e(C,{onClick:c,children:e(pr,{})})}):null]}):b?null:e(hm,{successAction:v,isDataChangedRef:r,readOnly:s,closeDialog:c,formStyle:d})},hm=({successAction:t,isDataChangedRef:i,readOnly:r,closeDialog:n,formStyle:a})=>{const s=l(()=>{"function"==typeof n&&n()},[]);return r?e(ft,{severity:"info",children:"No Details Found"}):e(of,{isDataChangedRef:i,cancelAction:s,successAction:t,formStyle:a})},cm=({isDataChangedRef:t,closeDialog:i,dataAlwaysExists:r,readOnly:n,disableCache:a,formStyle:s})=>{const[o,l]=d(Boolean(r));return o?e(lf,{isDataChangedRef:t,closeDialog:i,readOnly:n,disableCache:a,formStyle:s}):e(lm,{isDataChangedRef:t,successAction:()=>l(!0),readOnly:n,closeDialog:i,formStyle:s})},dm=Ci({topScrollPaper:{alignItems:"flex-start"},topPaperScrollBody:{verticalAlign:"top"}}),um=[{actionName:"View",actionLabel:"View Details",multiple:!1,rowDoubleClick:!0},{actionName:"Delete",actionLabel:"Delete",multiple:!0,rowDoubleClick:!1},{actionName:"Add",actionLabel:"Add Detail",multiple:void 0,alwaysAvailable:!0}],Am=({isDataChangedRef:i,showDocuments:r,disableActions:n,setEditFormStateFromInitValues:s,secondaryProduct:l,secondaryProductDataExist:h,secondaryProductDisableCache:c,maxWidth:u="xl",dialogAlignTop:A=!1,formStyle:p,readOnly:m,detailsContextGenerator:g})=>{let w=o(null);if(null===w.current){let e;w.current=[...um],Boolean(r)&&w.current.push({actionName:"Document",actionLabel:"Document Details",multiple:!1,rowDoubleClick:!1}),Boolean(l)&&w.current.push({actionName:"Detail",actionLabel:"Master",multiple:void 0,alwaysAvailable:!0}),e="string"==typeof n?[n]:Array.isArray(n)?n:[],Array.isArray(e)&&(w.current=w.current.filter(t=>!(e?.indexOf(t.actionName)>=0)))}const[b,v]=d(null),y=o(null),B=o(!1),{context:C}=a(af),x=()=>{v(null),!0===B.current&&(i.current=!0,y.current?.refetch?.(),B.current=!1)},F=dm(),S={scrollPaper:F.topScrollPaper,paperScrollBody:F.topPaperScrollBody};return t(f,{children:[e(cf,{ref:y,actions:w.current,setAction:v},"grid"),e(dt,{open:Boolean(b),maxWidth:u,PaperProps:"Delete"===b?.name?{}:{style:{width:"100%",height:A?void 0:"100%"}},classes:A?S:{},children:"Add"===(b?.name??"")?e(of,{successAction:x,cancelAction:x,isDataChangedRef:B,formStyle:p}):"View"===(b?.name??"")?e(lf,{isDataChangedRef:B,closeDialog:x,serialNo:b?.rows[0]?.id,setEditFormStateFromInitValues:s,formStyle:p,readOnly:m}):"Delete"===(b?.name??"")?e(hf,{serialNo:b?.rows.map(e=>e.id),closeDialog:x,isDataChangedRef:B}):"Document"===(b?.name??"")?e(om,{refID:C?.refID,productType:C?.productType,moduleType:C?.moduleType,serialNo:b?.rows[0]?.id,onClose:x}):"Detail"===(b?.name??"")?e(sf,{...g(C?.moduleType,l,C?.refID),children:e(cm,{isDataChangedRef:B,dataAlwaysExists:h,closeDialog:x,readOnly:m,disableCache:c})}):e(im,{closeDialog:x})})]})},pm=n({}),fm=({children:t,getGridMetaData:i,getGridData:r})=>e(pm.Provider,{value:{getGridMetaData:i,getGridData:r},children:t}),mm=(e,t,i)=>({getGridData:{fn:t,args:{reqPara:i}},getGridMetaData:{fn:e,args:{reqPara:i}}}),gm=c(({dataGridKey:t,getAPIReqPara:i,actions:r,setAction:n,defaultSortOrder:s,defaultFilter:o,dataTransformer:c,autoRefreshInterval:d,enableExport:u,reportTemplateCode:A,variant:p,autoFetch:f,headerToolbarStyle:m,enableEnterToFocus:g,focusScopeId:w,onClickActionEvent:b,onDataChange:v,disableMultipleRowSelect:y=!1,defaultSelectedRowId:B="",handleClickAction:C},x)=>{const{getGridData:F,getGridMetaData:S}=a(pm),N=l(F.fn(F.args),[i]);return h(()=>()=>{wo.removeQueries(["gridMetaData",i])},[i]),e(NA,{ref:x,metaData:S.fn,gridCode:i,getGridData:N,actions:r,setAction:n,defaultSortOrder:s,defaultFilter:o,dataTransformer:c,autoRefreshInterval:d,enableExport:u,reportTemplateCode:A,variant:p,autoFetch:f,headerToolbarStyle:m,enableEnterToFocus:g,focusScopeId:w,onClickActionEvent:b,handleClickAction:C,onDataChange:v,disableMultipleRowSelect:y,defaultSelectedRowId:B},t)}),wm=c(({dataGridKey:t,metaData:i,getAPIFn:r=()=>{},getAPIReqPara:n,actions:a,setAction:s,defaultFilter:o,defaultSortOrder:l,dataTransformer:h,autoRefreshInterval:c,enableExport:d=!1,reportTemplateCode:u,variant:A,autoFetch:p,headerToolbarStyle:f={},enableEnterToFocus:m,focusScopeId:g="enter-to-focus-server-grid",onClickActionEvent:w,onDataChange:b=e=>{},disableMultipleRowSelect:v=!1,defaultSelectedRowId:y="",handleClickAction:B},C)=>e(fm,{...mm(i,r,n),children:e(gm,{dataGridKey:t,getAPIReqPara:n,actions:a,setAction:s,defaultFilter:o,defaultSortOrder:l,dataTransformer:h,ref:C,autoRefreshInterval:c,enableExport:d,reportTemplateCode:u,variant:A,autoFetch:p,headerToolbarStyle:f,enableEnterToFocus:m,focusScopeId:g,onClickActionEvent:w,handleClickAction:B,onDataChange:b,disableMultipleRowSelect:v,defaultSelectedRowId:y})})),bm=Ci(e=>({tabPanel:{border:"1px solid #e8e8e8",borderTop:"0",backgroundColor:"#fff",boxShadow:"0px 2px 1px -1px rgba(0,0,0,0.2), 0px 1px 1px 0px rgba(0,0,0,0.14), 0px 1px 3px 0px rgba(0,0,0,0.12)"}})),vm=xi(e=>({root:{textTransform:"none",minWidth:72,marginRight:e.spacing(4),opacity:1,color:e.palette.secondary.main,fontWeight:600,fontFamily:["Montserrat","Helvetica","Arial","Lucida","sans-serif"].join(","),"&:hover":{color:"#0063a3",opacity:1},"&$selected":{color:"#fff",fontWeight:"600",background:"var(--theme-color1)","&:active":{color:"#fff"}},"&:active":{color:"var(--theme-color1)"},"&:focus:not(:selected)":{color:"var(--theme-color1)"}},selected:{}}))(wr),ym=xi(e=>({root:{border:"2px solid #e8e8e8",background:"#fff",boxShadow:"0px 2px 1px -1px rgba(0,0,0,0.2), 0px 1px 1px 0px rgba(0,0,0,0.14), 0px 1px 3px 0px rgba(0,0,0,0.12)"},indicator:{background:"var(--theme-color1)",top:0}}))(gr),Bm=n(null),Cm=()=>{const e=a(Bm);if(!e)throw new Error("useSnackbarProviderWrapper must be used within a SnackbarProviderWrapper");return e.snackbarProps},xm=({children:t,...i})=>{const r=s(()=>({snackbarProps:i}),[i]);return e(Bm.Provider,{value:r,children:e(mr,{...i,children:t})})},Fm=Ci({topScrollPaper:{alignItems:"center"},topPaperScrollBody:{verticalAlign:"top"},title:{flex:"1 1 100%",color:"var(--white)",letterSpacing:"1px",fontSize:"1.5rem"}}),Sm=({metadata:i,ClosedEventCall:r,data:n,HeaderMetaData:a,HeaderData:l,ClickEventManage:h,children:c,isLoading:u=!1,isError:A=!1,ErrorMessage:p="",actions:f=[],setData:m=e=>{},setCurrentAction:g=e=>{},mode:w="view",isEditableForm:b=!1,refID:v={},onSubmit:y=()=>{},submitSecondAction:B=()=>{},submitSecondButtonName:C="",submitSecondButtonHide:x=!0,submitSecondLoading:F=!1,onFieldAction:S=(e,t,i)=>{},formComponentPropStyles:N={},dialogProps:E={},enableEnterToFocus:k,focusScopeId:T="enter-to-focus-detailsGrid"})=>{const{enableEnterToFocus:L}=ns(),I=Fm(),D=o(null),{t:U}=W(),[P,R]=d(""),O=()=>{r()},Q=s(()=>{let e=i.columns;return"view"===w&&(e=i.columns.filter(e=>"_hidden"!==e.accessor)),{...i,columns:e}},[w,i]);return e(dt,{open:!0,TransitionComponent:ph,PaperProps:{style:{width:"100%",minHeight:"20vh"}},maxWidth:"lg",classes:{scrollPaper:I.topScrollPaper,paperScrollBody:I.topPaperScrollBody},...E,children:t("div",{style:{padding:"10px"},children:[A?e(to,{severity:"error",errorMsg:p,errorDetail:"",color:"error"}):Boolean(P)?e(to,{errorMsg:P,errorDetail:"",severity:"error"}):null,Boolean(c)?"function"==typeof c?c({handelCloseEvent:O,handleSubmit:async()=>{let{hasError:e,data:t}=await(D.current?.validate());if(!0===e)m(t);else{let e=D?.current?.cleanData?.(),t=e.filter(e=>!(Boolean(e?._hidden)&&!Boolean(e?.lineNo))),i={...v,config:t};y({data:i,mode:w,setServerError:R})}},classes:I}):c:e(Ar,{position:"relative",color:"secondary",style:{marginBottom:"10px"},children:t(ai,{variant:"dense",children:[e(vt,{className:I.title,color:"inherit",variant:"h6",component:"div",children:U(a?.gridConfig?.title??"")}),e(ct,{onClick:O,color:"primary",children:U("Close")})]})}),e(Zp,{finalMetaData:a,onAction:h,loading:u,data:l??{},submitSecondAction:B,submitSecondButtonName:C,submitSecondButtonHide:x,submitSecondLoading:F,onFieldAction:S,propStyles:N,enableEnterToFocus:k??L,focusScopeId:T},"DetailsHeadersView"),e(hu,{finalMetaData:Q,data:n,setData:m,loading:b?"view"===w:u,actions:f,setAction:async e=>{await g(e)},refetchData:null,enableEnterToFocus:k??L,focusScopeId:T,ref:D},"customerDetailsGrid")]})})},Nm=t=>{const{row:i}=t;let r=`${Number(i.index)+1}`;return e(kc,{...t,children:r})},Em=t=>e("div",{children:"#"}),km=e=>t=>{e&&t.visibleColumns.push(e=>[{id:"sequence",Header:Em,Cell:Nm,width:5,maxWidth:5,minWidth:5},...e])},Tm=({globalFilter:t,setGlobalFilter:i,rowCount:r})=>{const[,n]=d(t),{t:a}=W(),s=qt(e=>i(e||void 0),200);return e(Ll,{type:"text",onChange:e=>{n(e.target.value),s(e.target.value)},placeholder:`${a("profile.Searchin")} ${r} ${a("records")}`})},Lm=Ci(e=>({root:{display:"flex",justifyContent:"left",flexWrap:"wrap",listStyle:"none",paddingLeft:e.spacing(2),paddingRight:e.spacing(2),margin:0,overflowX:"auto"},chip:{margin:e.spacing(.5)}})),Im=({dense:r,filters:n,setAllFilters:a})=>{const s=Lm(),{t:o}=W();return Array.isArray(n)&&n.length<=0?null:t(ai,{component:"ul",className:s.root,variant:r?"dense":"regular",children:[e("li",{children:t(vt,{variant:"h6",children:[o("RetrievalParameters")," : "]})}),n.map(t=>e(i,{children:Boolean(t?.value?.value)?e("li",{children:e(gi,{label:Dm(t?.value?.condition,o(t?.value?.columnName),t?.value?.value,o(t?.value?.label),t?.value?.displayValue),className:s.chip,variant:"outlined"})},t?.id):null}))]})},Dm=(e,t,i,r,n)=>{let a=Boolean(r)?r:t;switch(e){case"equal":return`${a} = ${Um(n??i)}`;case"between":return`${a} between ${Um(i[0])} and ${Um(i[1])}`;case"in":return`${a} in ${Pm(i,r)}`;case"contains":return`${a} like ${i}`;case"endsWith":return`${a} ends with ${i}`;case"startsWith":return`${a} starts with ${i}`;default:return`${a} : ${i}`}},Um=e=>{let t;return ys(e)&&(t=ze(new Date(e),"dd/MM/yyyy")),isNaN(t)?e:t},Pm=(e,t)=>Array.isArray(t)&&Array.isArray(e)&&e.length===t.length?JSON.stringify(t).replaceAll(/"/g," "):JSON.stringify(e).replaceAll(/"/g," "),Rm=({setQueryFilters:r,filterMeta:n,filterData:a,retrievalType:s,isOpenRetrievalDefault:l,setShowFilters:c=e=>{},setAllFilters:A=e=>{},retrievalComponent:p})=>{const[f,m]=d(l),g=o(a),{t:w}=W();h(()=>{document.addEventListener("keydown",e=>{!e.ctrlKey||"R"!==e.key&&"r"!==e.key||(e.preventDefault(),m(!0))})},[]);return e(Qi,{dateAdapter:Hi,children:t(i,{children:[Boolean(s)&&"function"==typeof p?e(i,{children:"CUSTOM"===s&&n?.fields?.length>0||"CUSTOM"!==s?e(ct,{onClick:()=>{m(!0),c(!1),A([])},color:"primary",children:w("RetrieveData")}):null}):e(i,{}),f&&s&&p&&"function"==typeof p?u(p,{classes:{},open:f,handleClose:()=>{m(!1)},loginState:{},defaultData:g.current,retrievalParaValues:(e,t)=>{r(e),m(!1),t&&(g.current=t)},retrievalType:s,metaData:n}):null]})})},Om=(e=[],t={})=>{switch(t.type){case"setValue":{const{id:i,...r}=t.payload;let n=e.findIndex(e=>e.id===i);return n>=0?(e[n].value=r,[...e]):[...e,{id:i,value:r}]}case"removeValue":{const{id:i}=t.payload;return e.filter(e=>e.id!=i)}case"resetAll":return[];default:return e}},Qm=({setQueryFilters:i,filterMeta:r,filterData:n,retrievalWindowOpen:a=!1})=>{const{t:s}=W(),[h,c]=d(a),{filterState:A,dispatch:p}=(e=>{const t=o([]);return{dispatch:l(i=>{let r=e(t.current,i);t.current=r},[]),filterState:t}})(Om),f=()=>{c(!1)};let m=[];return Array.isArray(r)&&(m=r.filter(e=>"function"==typeof e.Filter),m=m.map(e=>{const{Filter:t,accessor:i,...r}=e;return u(t,{key:i,filterValue:n.filter(e=>e.id===i)?.[0]?.value,id:i,dispatch:p,...r})})),t(Qi,{dateAdapter:Hi,children:[e(Y,{onClick:()=>{c(!0)},color:"primary",children:"Retrieve Data"}),t(Be,{anchor:"right",id:"columnVisibility",open:h,onClose:f,PaperProps:{style:{width:"520px"}},children:[e(Ce,{position:"relative",color:"secondary",children:t(xe,{variant:"dense",children:[e(X,{variant:"h6",children:s("Filter")}),e("div",{style:{flexGrow:1}}),e(Y,{onClick:()=>{i(A.current),c(!1)},color:"primary",children:s("Apply")}),e(Y,{onClick:()=>{i([]),c(!1)},color:"primary",children:s("Clear")}),e(Y,{onClick:f,color:"primary",children:s("Close")})]})}),e(me,{children:e(ge,{container:!0,spacing:2,children:m})})]})]})},Hm=({dateRange:i,setDateRange:r,columnFormat:n="dd/MM/yyyy HH:mm:ss",setIsError:a,isDate:s})=>{let o=s?Ho:_o;const[l,h]=d({from:"",to:""}),c=(e,t)=>{let i=!1;const r={from:"",to:""};return e instanceof Date&&!isNaN(e?.getTime())||(r.from=Ge("Mustbeavaliddate"),i=!0),t instanceof Date&&!isNaN(t?.getTime())||(r.to=Ge("Mustbeavaliddate"),i=!0),e instanceof Date&&t instanceof Date&&e>t&&(r.from=Ge("FromDateshouldbelessthanorequaltoToDate"),r.to=Ge("ToDateshouldbegreaterthanorequaltoFromDate"),i=!0),h(r),a(i),!i};return t(be,{spacing:1,children:[e(o,{format:n,value:i.from??new Date,label:Ge("From")??"From",views:s?["year","month","day"]:["year","month","day","hours","minutes","seconds"],onChange:e=>{const t=e instanceof Date&&!isNaN(e?.getTime())?e:null,n={...i,from:t};c(t,i.to)&&r(n)},slots:{textField:Ao},slotProps:{textField:{error:!!l.from,helperText:l.from},actionBar:{actions:["today","accept","cancel"]}},sx:{width:"100%",mb:1}}),e(o,{format:n,label:Ge("To")??"To",value:i.to??new Date,views:s?["year","month","day"]:["year","month","day","hours","minutes","seconds"],onChange:e=>{const t=e instanceof Date&&!isNaN(e?.getTime())?e:null,n={...i,to:t};c(i.from,t)&&r(n)},slots:{textField:Ao},slotProps:{textField:{error:!!l.to,helperText:l.to},actionBar:{actions:["today","accept","cancel"]}},sx:{width:"100%"}})]})},Mm=({dateValue:t,setDateValue:i,columnFormat:r="dd/MM/yyyy HH:mm:ss",setIsError:n,isDate:a})=>{const[s,o]=d("");return e(a?Ho:_o,{format:r??"dd/MM/yyyy HH:mm:ss",value:t??new Date,views:a?["year","month","day"]:["year","month","day","hours","minutes","seconds"],onChange:e=>{if(!Ve(e))return o(Ge("Mustbeavaliddate")??""),void n(!0);o(""),n(!1),i(e instanceof Date?e:new Date)},slots:{textField:Ao},slotProps:{textField:{error:Boolean(s),helperText:s,sx:{"& .MuiInputBase-root":{margin:"0 !important"}}},actionBar:{actions:["today","accept","cancel"]}},sx:{width:"100%",mb:1}})},_m=(e,t)=>ze(new Date(e),t??"dd/MM/yyyy HH:mm:ss"),jm=e=>e instanceof Date&&!isNaN(e.getTime())?new Date(e.getFullYear(),e.getMonth(),e.getDate()):null,zm=(e,t,i)=>{const{type:r,value:n}=i;return null==n||""===n||Array.isArray(n)&&0===n.length?e:e.filter(i=>{const a=""===i.values[t]?.trim()&&"multi-select"===r?"(Blanks)":i.values[t];if("multi-select"===r)return n.includes(a);if("Before"===r||"After"===r||"Equal (Date)"===r||"Equal (Date & Time)"===r||"Between (Date)"===r||"Between (Date & Time)"===r||"Today"===r||"Yesterday"===r||"This Week"===r||"Last Week"===r||"This Month"===r||"Last Month"===r){const e=new Date(a),t=Array.isArray(n)?[new Date(n[0]),new Date(n[1])]:new Date(n);if(isNaN(e.getTime())||(Array.isArray(t)?t.some(e=>isNaN(e.getTime())):isNaN(t.getTime())))return!1;switch(r){case"Before":return e<t;case"After":return e>t;case"Equal (Date)":return!Array.isArray(t)&&jm(e)?.toLocaleString()===jm(t)?.toLocaleString();case"Equal (Date & Time)":return!Array.isArray(t)&&e.toLocaleString()===t.toLocaleString();case"Between (Date)":const[i,r]=Array.isArray(t)?t:[];return!(!i||!r)&&(jm(e)>=jm(i)&&jm(e)<=jm(r));case"Between (Date & Time)":const[n,a]=Array.isArray(t)?t:[];return!(!n||!a)&&(e>=n&&e<=a);case"Today":{const t=new Date;return jm(e)?.getTime()===jm(t)?.getTime()}case"Yesterday":{const t=new Date;return t.setDate(t.getDate()-1),jm(e)?.getTime()===jm(t)?.getTime()}case"This Week":{const t=new Date,i=jm(new Date(t.setDate(t.getDate()-t.getDay()))),r=new Date(i);r.setDate(i.getDate()+6);const n=jm(e);return!!n&&n>=i&&n<=jm(r)}case"Last Week":{const t=new Date,i=jm(new Date(t.setDate(t.getDate()-t.getDay()-7))),r=new Date(i);r.setDate(i.getDate()+6);const n=jm(e);return!!n&&n>=i&&n<=jm(r)}case"This Month":{const t=new Date,i=jm(new Date(t.getFullYear(),t.getMonth(),1)),r=jm(new Date(t.getFullYear(),t.getMonth()+1,0)),n=jm(e);return!!n&&n>=i&&n<=r}case"Last Month":{const t=new Date,i=jm(new Date(t.getFullYear(),t.getMonth()-1,1)),r=jm(new Date(t.getFullYear(),t.getMonth(),0)),n=jm(e);return!!n&&n>=i&&n<=r}default:return!0}}const s=a?.toString().toLowerCase(),o=n?.toString().toLowerCase();switch(r){case"Contains":return s.includes(o);case"Starts With":return s.startsWith(o);case"Ends With":return s.endsWith(o);case"Equal":return s===o;case"Not Equal":return s!==o;case"Empty":return""===s;case"Not Empty":return""!==s;case"Greater Than":return parseFloat(a)>parseFloat(n);case"Less Than":return parseFloat(a)<parseFloat(n);case"Greater Than or Equal To":return parseFloat(a)>=parseFloat(n);case"Less Than or Equal To":return parseFloat(a)<=parseFloat(n);case"Does not contain":return!s.includes(o);case"Between":const i=o.split(",")?.map(e=>parseFloat(e)),r=parseFloat(a);return r>=i[0]&&r<=i[1];case"Above Average":const l=e.reduce((e,i)=>e+parseFloat(i.values[t]),0)/e.length;return parseFloat(a)>l;case"Below Average":const h=e.reduce((e,i)=>e+parseFloat(i.values[t]),0)/e.length;return parseFloat(a)<h;default:return!0}})},Vm=({amtRange:i,setAmtRange:r,setIsError:n})=>{const{dynamicAmountSymbol:a,decimalCount:s,dynamicAmountGroupStyle:o}=ns(),[l,h]=d({from:"",to:""}),c=(e,t)=>{let i=!1;const r={from:"",to:""},a=parseFloat(e),s=parseFloat(t);isNaN(a)||isNaN(s)||a>s&&(r.from="'From' value must be less than 'To' value",r.to="'To' value must be greater than 'From' value",i=!0),h(r),n(i)};return t(be,{spacing:1.5,children:[t("div",{children:[e(rl,{FormatProps:{thousandSeparator:!0,prefix:"",thousandsGroupStyle:o,allowNegative:!0,allowLeadingZeros:!1,decimalScale:s,fixedDecimalScale:!0,placeholder:"From amount",isAllowed:e=>e?.value?.length<=15,value:i.from,onValueChange:e=>{if(!isNaN(Number(e.value))){const t=e.value;r(e=>{const i={...e,from:t};return c(t,e.to),i})}}},enableGrid:!1,fieldKey:"FromAmount",name:"from-amount",StartAdornment:$o(a),className:"textInputFromRight",maxLength:15,showMaxLength:!1,textFieldStyle:{width:"100%","& .MuiInputBase-root":{margin:"0 !important"}}}),l.from?e(le,{error:!0,sx:{mt:0},children:l.from}):null]}),t("div",{children:[e(rl,{FormatProps:{thousandSeparator:!0,prefix:"",thousandsGroupStyle:o,allowNegative:!0,allowLeadingZeros:!1,decimalScale:s,fixedDecimalScale:!0,placeholder:"To amount",isAllowed:e=>e?.value?.length<=15,value:i.to,onValueChange:e=>{if(!isNaN(Number(e.value))){const t=e.value;r(e=>{const i={...e,to:t};return c(e.from,t),i})}}},enableGrid:!1,fieldKey:"ToAmount",name:"to-amount",StartAdornment:$o(a),className:"textInputFromRight",maxLength:15,showMaxLength:!1,textFieldStyle:{width:"100%",".MuiInputBase-root":{margin:"0 !important"}}}),l.to?e(le,{error:!0,sx:{mt:0},children:l.to}):null]})]})},Km=({inputValue:t,setInputValue:i})=>{const{dynamicAmountSymbol:r,decimalCount:n,dynamicAmountGroupStyle:a}=ns();return e(rl,{FormatProps:{thousandSeparator:!0,prefix:"",thousandsGroupStyle:a,allowNegative:!0,allowLeadingZeros:!1,decimalScale:n,fixedDecimalScale:!0,placeholder:"Enter a value",isAllowed:e=>!(e?.value?.length>15),value:t,onValueChange:e=>{isNaN(Number(e.value))||i(String(e.value))}},enableGrid:!1,fieldKey:"Amount",name:"amount",StartAdornment:$o(r),className:"textInputFromRight",maxLength:15,showMaxLength:!1,textFieldStyle:{width:"100%",".MuiInputBase-root":{margin:"0 !important"}}})},qm={text:["Contains","Starts With","Ends With","Equal","Not Equal","Does not contain"],number:["Equal","Greater Than","Greater Than or Equal To","Less Than","Less Than or Equal To","Not Equal","Between","Above Average","Below Average"],date:["Equal (Date)","Equal (Date & Time)","Before","After","Between (Date)","Between (Date & Time)","Yesterday","Today","This Week","Last Week","This Month","Last Month"],dropdown:["Equal","Not Equal"]},Gm=({column:r,filters:n,enableEnterToFocus:a})=>{const{id:c,columnName:u,columnFormat:A,filterType:p,Cell:f,options:m,filterValue:g,setFilter:w,preFilteredRows:b,alignment:v}=r,[y,B]=d(null),[C,x]=d(0),[F,S]=d(()=>(qm[p||"text"]||[])[0]),[N,E]=d(!1),[k,T]=d(""),[L,I]=d(new Date),[D,U]=d({from:new Date,to:new Date}),[P,R]=d({from:"",to:""}),[O,Q]=d(""),[H,M]=d([]),_=o({dateValue:L,dateRange:D,amtRange:P,inputValue:k,selectedOption:F,selectedValues:H,search:O}),j=Boolean(y),z=f===Tc||f===Lc?"date":f===Vc?"number":p||"text",V=qm[z]||[],K=()=>{N&&(R({from:"",to:""}),E(!1)),B(null),M(_.current.selectedValues),I(_.current.dateValue),U(_.current.dateRange),R(_.current.amtRange),T(_.current.inputValue),S(_.current.selectedOption),Q(_.current.search)},q=s(()=>{const e=new Set;b?.forEach(t=>{e.add(""===t.values[c]?.trim()?"(Blanks)":t.values[c])});const t=Array.from(e).filter(e=>e?.toString().toLowerCase().includes(O.toLowerCase()));return t.includes("(Blanks)")?[...t.filter(e=>"(Blanks)"!==e),"(Blanks)"]:t},[b,c,O]),G=s(()=>{const e={};return b?.forEach(t=>{const i=""===t.values[c]?.trim()?"(Blanks)":t.values[c],r=String(i??"");e[r]=(e[r]||0)+1}),e},[b,c]);h(()=>{const e=(qm[z]||[])[0];S(e)},[z]),h(()=>{n.length||(_.current={dateValue:new Date,dateRange:{from:new Date,to:new Date},amtRange:{from:"",to:""},inputValue:"",selectedOption:(qm[z]||[])[0],selectedValues:[],search:""},M([]),T(""),I(new Date),U({from:new Date,to:new Date}),R({from:"",to:""}),Q(""),S((qm[z]||[])[0]))},[n,z]);const W=l(()=>{if(!g)return"";if("multi-select"===g.type&&"date"===z&&Array.isArray(g.value)){const e=g.value.map(e=>_m(e,A));return`${Ge("Filtered")}: ${e.join(", ")}`}return"multi-select"===g.type&&Array.isArray(g.value)?`${Ge("Filtered")}: ${g.value.join(", ")}`:"date"===z&&Array.isArray(g.value)?`${g.type}: ${_m(g.value[0],g.type.includes("Time")?A:A?.split(" ")[0]??"dd/MM/yyyy")} - ${_m(g.value[1],g.type.includes("Time")?A:A?.split(" ")[0]??"dd/MM/yyyy")}`:"date"===z&&g.value instanceof Date?`${g.type}: ${_m(g.value,g.type.includes("Time")?A:A?.split(" ")[0]??"dd/MM/yyyy")}`:"number"===z&&F.includes("Average")?g.type:`${g.type}: ${g.value}`},[g,z,F,A]);return f===jc?null:t(i,{children:[e(de,{size:"small",onClick:e=>{g||"date"!==z||(I(new Date),U({from:new Date,to:new Date}),R({from:"",to:""})),B(e.currentTarget)},sx:{...r.canGroupBy?{}:{ml:"right"!==v?"auto":0,mr:"right"===v?"auto":0}},children:e(ne,g?{disableInteractive:!0,title:g?e(oe,{sx:{p:.5},children:e(X,{variant:"caption",sx:{fontWeight:600,color:"var(--theme-color1)",fontSize:"0.75rem"},children:W()})}):"",arrow:!0,disableHoverListener:!g,componentsProps:{tooltip:{sx:{backgroundColor:"var(--theme-color2)",color:"var(--theme-color1)",fontSize:"0.75rem",borderRadius:1.5,boxShadow:4,maxWidth:240,whiteSpace:"normal"}},arrow:{sx:{color:"var(--theme-color2)"}}},children:e(Cr,{fontSize:"small",style:{color:"var(--theme-color1)"}})}:{title:Ge("AdvanceFilter"),disableInteractive:!0,children:e(Br,{fontSize:"small"})})}),e(Fe,{open:j,anchorEl:y,onClose:K,onKeyDown:e=>{a&&Es(e)},children:t(oe,{p:2,width:300,children:[e(X,{variant:"subtitle2",mb:1,children:u}),t(ym,{value:C,onChange:(e,t)=>x(t),variant:"fullWidth",TabIndicatorProps:{style:{display:"none"}},sx:{border:"none !important",boxShadow:"none !important",backgroundColor:"transparent !important",minHeight:0,"& .MuiTabs-flexContainer":{gap:1},"& .MuiTab-root":{minHeight:30,padding:"4px 12px",borderRadius:"20px",fontSize:"0.75rem",fontWeight:600}},children:[e(vm,{label:Ge("FilterByValue"),style:{padding:0,margin:0,borderRadius:"10px"}}),e(vm,{label:Ge("FilterByCondition"),style:{padding:0,margin:0,borderRadius:"10px"}})]}),0===C&&t(be,{spacing:1,mt:2,children:[e(Ao,{size:"small",placeholder:Ge("Search")??"Search...",value:O,onChange:e=>Q(e.target.value),fullWidth:!0,InputProps:{sx:{marginTop:"0px !important"}}}),e(oe,{sx:{maxHeight:200,overflowY:"auto",border:"1px solid #ccc",p:1,borderRadius:1},children:e(Wm,{uniqueValues:q,selectedValues:H,setSelectedValues:M,valueCounts:G,Cell:f,column:r,type:z})})]}),1===C&&t(be,{spacing:2,mt:2,children:[e(Se,{value:F,onChange:e=>S(e.target.value),size:"small",fullWidth:!0,children:V.map(t=>e(Ne,{value:t,children:t},t))}),"date"===z?e(hr,{dateAdapter:Hi,children:"Between (Date)"===F||"Between (Date & Time)"===F?e(Hm,{dateRange:D,setDateRange:U,columnFormat:"Between (Date)"===F?A?.split(" ")[0]??"dd/MM/yyyy":A,setIsError:E,isDate:"Between (Date)"===F}):["Equal (Date)","Equal (Date & Time)","Before","After"].includes(F)?e(Mm,{dateValue:L,setDateValue:I,columnFormat:"Equal (Date)"===F?A?.split(" ")[0]??"dd/MM/yyyy":A,setIsError:E,isDate:"Equal (Date)"===F}):null}):"dropdown"===z&&m?.length?e(Se,{value:k,onChange:e=>T(e.target.value),size:"small",fullWidth:!0,children:m.map(t=>e(Ne,{value:t,children:t},t))}):e(i,{children:"number"===z?e(i,{children:"Between"===F?e(Vm,{amtRange:P,setAmtRange:R,setIsError:E}):e(i,{children:F.includes("Average")?null:e(Km,{inputValue:k,setInputValue:T})})}):e(Ao,{size:"small",placeholder:"Enter value",value:k,type:"number"===z?"number":"text",onChange:e=>T(e.target.value),fullWidth:!0,InputProps:{sx:{marginTop:"0px !important"}}})})]}),t(be,{direction:"row",spacing:1,justifyContent:"flex-end",mt:2,children:[e(eo,{variant:"contained",size:"small",onClick:()=>{_.current={dateValue:new Date,dateRange:{from:new Date,to:new Date},amtRange:{from:"",to:""},inputValue:"",selectedOption:(qm[z]||[])[0],selectedValues:[],search:""},M([]),T(""),I(new Date),U({from:new Date,to:new Date}),R({from:"",to:""}),w(void 0),K()},children:Ge("Clear")}),e(eo,{variant:"contained",size:"small",onClick:()=>{if(_.current={dateValue:L,dateRange:D,amtRange:P,inputValue:k,selectedOption:F,selectedValues:H,search:O},0===C)Array.isArray(H)&&H?.length>0&&w({type:"multi-select",value:H});else if(!N){let e;if("date"===z?"Between (Date)"===F||"Between (Date & Time)"===F?e=[D.from,D.to]:e=["Yesterday","Today","This Week","Last Week","This Month","Last Month"].includes(F)?(e=>{const t=new Date,i=new Date(t);i.setDate(t.getDate()-t.getDay());const r=new Date(i);r.setDate(i.getDate()+6);const n=new Date(i);n.setDate(n.getDate()-7);const a=new Date(n);a.setDate(n.getDate()+6);const s=new Date(t.getFullYear(),t.getMonth(),1),o=new Date(t.getFullYear(),t.getMonth()+1,0),l=new Date(t.getFullYear(),t.getMonth()-1,1),h=new Date(t.getFullYear(),t.getMonth(),0);switch(e){case"Yesterday":const e=new Date;return e.setDate(t.getDate()-1),e;case"Today":return t;case"This Week":return[i,r];case"Last Week":return[n,a];case"This Month":return[s,o];case"Last Month":return[l,h];default:return null}})(F):L:e="Between"===F?[P.from,P.to]:F.includes("Average")?F:k,Array.isArray(e)){const[t,i]=e;t&&i&&w({type:F,condition:F?.toLowerCase(),value:e})}else e&&w({type:F,condition:F?.toLowerCase(),value:e,showType:F.includes("Average")})}K()},children:Ge("Apply")})]})]})})]})},Wm=({uniqueValues:i,selectedValues:r,setSelectedValues:n,valueCounts:a,Cell:s,column:o,type:l,height:h=144})=>{const c=i.length>0&&i.every(e=>r.includes(e));return t(be,{direction:"column",spacing:1,children:[e(ae,{control:e(go,{checked:c,indeterminate:r.length>0&&!c,color:"secondary",onChange:()=>{n(c?[]:[...i])}}),label:e(X,{sx:{fontWeight:"bold"},children:Ge("SelectAll")}),sx:{mx:0,pb:1,borderBottom:"1px solid #eee"}}),e(Ei,{height:i.length?h:0,itemCount:i.length,itemSize:30,width:"100%",children:({index:h,style:c})=>{const d=i[h];return e("div",{style:c,children:e(ae,{control:e(go,{checked:r.includes(d),onChange:()=>(e=>{r.includes(e)?n(r.filter(t=>t!==e)):n([...r,e])})(d),sx:{p:.5}}),sx:{width:"100%",alignItems:"center",mx:0,my:.5},label:t(oe,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",pr:1},children:[e(X,{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"0.875rem"},children:"function"==typeof s&&"text"!==l?s({value:d,column:o,isAdvanceFilter:!0}):d?.toString()}),t(X,{sx:{fontSize:"0.75rem",color:"#888",marginLeft:1,flexShrink:0},children:["(",a[String(d??"")]||0,")"]})]})})},d?.toString())}})]})},Jm=({footerGroup:t,loading:i})=>e(hi,{...t.getFooterGroupProps(),component:"div",children:t.headers.map(t=>e(ci,{...t.getFooterProps([{style:{textAlign:t?.alignment??"unset",display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"0px 20px 0px 10px",lineHeight:"34px",backgroundColor:"var(--theme-color2)"}}]),component:"div",children:t.render("Footer",{loading:i})}))}),Xm=({footerGroup:t})=>e("div",{style:{backgroundColor:"var(--theme-color2)"},children:e(hi,{...t.getFooterGroupProps(),children:e("div",{children:t.headers.map(t=>e("span",{style:{textAlign:t?.alignment??"unset",display:"flex",gap:"3rem",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",lineHeight:"34px",marginLeft:"10px",fontWeight:"500"},children:t.render("Footer1")},t.id))})})}),Ym=({columns:r,defaultColumn:n,data:a,maxHeight:c=300,containerHeight:u,occupiedHeight:A,initialState:p={},filterTypes:m,title:g,options:w,loading:b=!1,hideFooter:v=!1,showSerialNoColumn:y=!1,onClose:B=null,setQueryFilters:x,filterMeta:F,queryFilters:S,hideAmountIn:N,retrievalType:E,onButtonActionHandel:k,isOpenRetrievalDefault:T,hideHeader:L=!1,hideShowFiltersSwitch:I,hideStatusBar:D,refetchData:U,pageSizes:P=[20,30,40],totalRecords:R=0,defaultPageSize:O=20,defaultSortOrder:Q=[],defaultHiddenColumns:H=[],enablePagination:M=!1,retrievalComponent:_,openDrawerFilter:j,onDoubleClickAction:z,enablePdfPrint:V,reportTemplateCode:K,enablePivot:q,actions:G,getReportData:J,disableFilters:X,headerToolbarStyle:Y,enableEnterToFocus:Z,expandAllGroupedRows:ee})=>{const te=s(()=>r.some(e=>e.isDisplayValueTotal),[r]),ie=s(()=>r.some(e=>e.isTotalWithCurrency||e.isTotalWithoutCurrency),[r]),[re,ne]=d(!1),[ae,se]=d(!1),{t:oe}=W(),{disableColumnFilters:le}=ns(),he=s(()=>r.map(e=>({...e,disableFilters:e?.disableFilters??X??le??!1,filter:zm})),[r,X,le]),ce=Gt({columns:he,data:a,defaultColumn:n,filterTypes:m,onButtonActionHandel:k,autoResetGlobalFilter:!1,autoResetFilters:!1,autoResetGroupBy:!1,autoResetExpanded:!1,autoResetSortBy:!1,globalFilter:(e,t,i)=>((e,t,i,r)=>{const n=i.toLowerCase();return e.filter(e=>t.some(t=>{const i=r.find(e=>e.accessor===t),a=e.values[t];return!ys(a)||i?.Cell!==Tc&&i?.Cell!==Lc&&i?.Cell!==qc?String(a).toLowerCase().includes(n):ze(new Date(a),i.format??"dd/MM/yyyy hh:mm:ss a").toLowerCase().includes(n)}))})(e,t,i,r),initialState:{pageIndex:0,pageSize:O,hiddenColumns:H,sortBy:Q,...p},...w},Wt,ri,Xt,Yt,$t,ti,ii,km(y),k),{getTableProps:de,getTableBodyProps:ue,headerGroups:Ae,footerGroups:pe,rows:fe,prepareRow:me,totalColumnsWidth:ge,toggleAllRowsExpanded:we,isAllRowsExpanded:be,setAllFilters:ve,setGlobalFilter:ye,preGlobalFilteredRows:Be,gotoPage:Ce,setPageSize:xe,state:{filters:Fe,globalFilter:Se,pageIndex:Ne,pageSize:ke},filteredRows:Te}=ce;h(()=>{ee&&setTimeout(()=>{we(!0)},0)},[we,ee,b]),h(()=>{"function"==typeof J&&J(Fe,S,Se,a,fe?.map(e=>e.values))},[Fe,S,Se,a,fe]),h(()=>{ve([])},[S]);const Le=l(t=>{let{index:i,style:r}=t;const n=fe[i];return me(n),n?.isGrouped&&n?.isExpanded&&(r={...r,backgroundColor:"rgba(0, 0, 0, 0.04)"}),e(hi,{...n.getRowProps({style:r}),component:"div",onDoubleClick:()=>{"function"==typeof z&&z({row:[{data:n?.original,id:n?.id}]})},children:n.cells.map((e,t)=>e.isAggregated?e.render("Aggregated"):e.render("Cell",{index:t}))})},[me,fe]),Ie=s(()=>Te?.length,[Te]),De=s(()=>{if(!u||!A)return{min:"73.5vh",max:"73.5vh"};const e=e=>{const t=Array.isArray(S)&&S.length>0?`calc(${u?.[e]} - 48px)`:u?.[e];return t&&A?.[e]?`calc(${t} - ${A?.[e]})`:t};return{min:e("min"),max:e("max")}},[S,u,A]),Ue=o(null),[Pe,Re]=d({min:700,max:700});return h(()=>{if(!Ue.current)return;const e=()=>{const e=Ue.current,t=getComputedStyle(e),i=parseFloat(t.minHeight),r=parseFloat(t.maxHeight);Re({min:i,max:r})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[fe,u,A]),t(f,{children:[t(ni,{style:{width:"100%",overflow:"hidden",marginBottom:"8px",display:L?"none":"inherit"},className:"not-printed",children:[t(ai,{className:"static__report__header",variant:"dense",sx:{width:"100%",background:"var(--primary-bg)",...Y},children:[e(vt,{variant:"h5",color:"primary",children:g.trim()}),e("div",{style:{flexGrow:1}}),j?e(Qm,{setQueryFilters:x,filterMeta:F,filterData:S,retrievalWindowOpen:T}):e(Rm,{setQueryFilters:x,filterMeta:F,filterData:S,retrievalType:E,isOpenRetrievalDefault:T,retrievalComponent:_}),Fe.length>0&&e(ct,{onClick:()=>{ve([])},style:{marginRight:"8px",color:"white"},children:oe("ClearFilter")}),"function"==typeof U?e(Wo,{title:oe("Refetch"),children:e(C,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true",onClick:()=>U(),color:"primary",children:e(ki,{})})}):null,e(Tm,{setGlobalFilter:ye,globalFilter:Se,rowCount:Ie}),Boolean(N)?null:e(Hc,{}),fe?.length>0?e(i,{children:Ae.some(e=>e.headers.some(e=>!0===e.isGrouped))?e(Ye,{control:e(It,{onChange:()=>we(!be),checked:be,name:"filters",size:"small",color:"primary"}),style:{color:"var(--white)"},label:oe("ExpandRows")}):e(Ye,{control:e(Wo,{title:oe("Showexportoptions"),arrow:!0,children:t(eo,{onClick:()=>{se(!0)},style:{marginTop:"0px",color:"white"},eventKey:"x",shortcut:"alt",children:[oe("Export")," ",e(Ki,{})]})}),style:{color:"var(--white)"},label:""})}):null,!b&&q?e(Ye,{control:e(Wo,{title:oe("Open Pivot Table"),arrow:!0,children:t(ct,{onClick:()=>ne(!0),style:{marginTop:"0px",color:"white"},children:[oe("Pivot")," ",e(yr,{})]})}),style:{color:"var(--white)"},label:""}):null,G?.map((t,i)=>e(eo,{sx:{minWidth:"60px",...t.buttonStyle},disabled:b,onClick:e=>"function"==typeof t.callback&&t.callback(e,a,fe?.map(e=>e.values)),enableShortcut:t?.enableShortcut??!0,shortcut:t?.shortcut,eventKey:t?.eventKey,children:t.buttonName},i)),"function"==typeof B?e(Wo,{title:oe("Close"),arrow:!0,children:e(C,{onClick:B,size:"small",children:e(Bt,{style:{color:"var(--white)"}})})}):null]}),D?null:e(Im,{dense:!0,setAllFilters:x,filters:S})]}),b&&e(mt,{color:"secondary"}),t(ni,{style:{width:"100%",overflow:"hidden"},tabIndex:0,children:[e(si,{ref:Ue,sx:{position:"relative",maxHeight:De.max,minHeight:De.min},children:t(oi,{...de(),size:"small",component:"div",children:[e(li,{component:"div",children:Ae.map(i=>e(hi,{...i.getHeaderGroupProps(),component:"div",children:i.headers.map((i,r)=>t(ci,{...i.getHeaderProps([{style:{display:"flex",padding:0===r?"0 10px":"0px 10px 0 0",alignItems:"center"}}]),component:"div",align:i.alignment,children:[i.render("Header"),i.canFilter&&e(Gm,{column:i,filters:Fe,enableEnterToFocus:Z})]}))}))}),e(di,{...ue({}),component:"div",children:e(Ei,{height:(()=>{const e=Pe?.min??c;return ie?fe.length<=0?e-72:te?e-110:e-72:te&&fe.length?e-72:e-38})(),itemCount:fe.length,itemSize:35,width:ge+10,overscanCount:10,children:Le})}),fe.length<=0&&!1===b?e("div",{style:{justifyContent:"center",fontStyle:"italic",color:"rgba(133, 130, 130, 0.8)",position:"absolute",left:"50%",top:"50%"},children:oe("Nodatafound")}):null,t(li,{component:"div",style:{boxShadow:"0px 5px 5px -3px rgba(0,0,0,0.2),0px 8px 10px 1px rgba(0,0,0,0.14),0px 3px 14px 2px rgba(0,0,0,0.12)"},children:[e(Jm,{footerGroup:pe[0],loading:b}),e(Xm,{footerGroup:pe[0]})]})]})}),v?null:M?e(Ee,{sx:{display:"flex","& .MuiToolbar-root":{display:"flex",alignItems:"baseline"}},variant:"body",component:"div",rowsPerPageOptions:P,colSpan:3,count:R,rowsPerPage:Number(ke),page:Number(Ne),onPageChange:(e,t)=>{Ce(t)},onRowsPerPageChange:e=>{xe(Number(e.target.value))},ActionsComponent:rh}):t(ci,{style:{display:"flex",color:"var(--theme-color1)",fontWeight:"bold",padding:"10px"},children:[oe("TotalNoofRecords"),": ",Ie]})]}),ae?e(Bd,{globalFilter:Se,filters:Fe,queryFilters:S,title:g.trim(),rows:fe,columns:r,onClose:()=>{se(!1)},enablePdfPrint:V,reportTemplateCode:K,enableEnterToFocus:Z}):null,re?e($,{open:!0,fullScreen:!0,children:e(iu,{rows:fe,title:g.trim(),columns:r,onClose:()=>ne(!1)})}):null]})},$m=(e,t,i)=>xr(e,i,{keys:[e=>e.values[t]]});$m.autoRemove=e=>!e;const Zm=(e,t,i)=>e.filter(e=>{const r=e.values[t];return void 0===r||String(r).toLowerCase().startsWith(String(i).toLowerCase())}),eg=(e,t,i)=>e.filter(e=>e.values[t]>=i);eg.autoRemove=e=>"number"!=typeof e;const tg=(e,t,i)=>e.filter(e=>t.some(t=>{const r=e.values[t];return r&&r.length&&i.some(e=>r.includes(e))}));tg.autoRemove=e=>!e||!e.length;const ig=[{label:"starts with",value:"startsWith"},{label:"ends with",value:"endsWith"},{label:"equal",value:"equal"},{label:"contains",value:"contains"}],rg=({filterValue:t,id:i,columnName:r,gridProps:n,dispatch:a})=>{const{t:s}=W(),[o,l]=d(t?.value??""),[h,c]=d(t?.condition??"equal"),u=()=>{Boolean(o)?a({type:"setValue",payload:{condition:h,value:o,id:i,columnName:r}}):a({type:"removeValue",payload:{id:i}})};return e(q,{item:!0,xs:12,sm:6,md:6,...n,children:e(Ao,{label:s(r),InputLabelProps:{shrink:!0},onChange:e=>l(e.target.value.trimStart()),onBlur:u,fullWidth:!0,value:o,InputProps:{endAdornment:e(Do,{size:"small",style:{width:"50%"},touched:!0,error:"",multiple:!1,handleChange:e=>{c(e.target.value)},handleBlur:u,options:ig,disableCaching:!1,value:h,selectVariant:"andornment"})}})})},ng=({filterValue:t,id:i,columnName:r,filterProps:n,gridProps:a,dispatch:s})=>{const{t:l}=W(),[h,c]=d(t?.value??[]),u=o(null),[A,p]=d([]),{loadingOptions:f}=xo(n?.options??[],p,n?._optionsKey??"",!1,{},!1,void 0);return e(q,{item:!0,xs:12,sm:6,md:6,...a,children:e(Ro,{label:l(r),showCheckbox:!0,value:h,size:"small",fullWidth:!0,touched:!0,error:"",multiple:!0,handleChange:(e,t)=>{c(e.target.value),u.current=t},handleBlur:e=>{Array.isArray(h)&&h.length>0?s({type:"setValue",payload:{condition:"in",value:h,label:u.current,id:i,columnName:r}}):s({type:"removeValue",payload:{id:i}})},options:A,loadingOptions:f,selectVariant:"regular"})})},ag=[{label:"All",value:"all"},{label:"Today",value:"today"},{label:"Last Week",value:"lastWeek"},{label:"Last Month",value:"lastMonth"},{label:"Custom",value:"custom"}],sg=[{label:"Today",value:"today"},{label:"Last Week",value:"lastWeek"},{label:"Last Month",value:"lastMonth"},{label:"Custom",value:"custom"}],og=({filterValue:r,id:n,columnName:a,gridProps:s,dispatch:l,filterProps:c,isDefaultFilter:u})=>{const{t:A}=W(),[p,f]=d({isError:!1,error:""}),[m,g]=d({isError:!1,error:""}),w=o(null),b=o(null),[v,y]=d(Array.isArray(r?.value)?new Date(r?.value[0])??null:new Date(r?.value)??null),[B,C]=d(Array.isArray(r?.value)?new Date(r?.value[1])??null:null),[x,F]=d(r?.option??(u?"today":"all")),S="custom"===x?{style:{width:"40%"}}:{fullWidth:!0};return h(()=>{v||y(new Date),B||C(new Date)},[v,B]),e(q,{item:!0,xs:12,...s,sm:"custom"===x?12:6,md:"custom"===x?12:6,children:t("div",{style:{width:"100%",display:"flex"},tabIndex:1,onBlur:e=>{let t=k(new Date,"iii LLL dd yyyy HH:mm:ss xxxx"),i=k(new Date,"iii LLL dd yyyy HH:mm:ss xxxx");v instanceof Date&&!isNaN(v)&&(t=k(v,"iii LLL dd yyyy HH:mm:ss xxxx")),B instanceof Date&&!isNaN(B)&&(i=k(B,"iii LLL dd yyyy HH:mm:ss xxxx")),"today"===x?Boolean(u)?l({type:"removeValue",payload:{id:n}}):l({type:"setValue",payload:{condition:"equal",value:t,id:n,option:x,columnName:a,type:c?.type}}):("lastWeek"===x||"lastMonth"===x||"custom"===x)&&v instanceof Date&&B instanceof Date&&!isNaN(v)&&!isNaN(B)&&v<=B?l({type:"setValue",payload:{condition:"between",value:[t,i],id:n,option:x,columnName:a,type:c?.type}}):l({type:"removeValue",payload:{id:n}})},children:[e(Do,{label:A(a),value:x,size:"small",touched:!0,error:"",handleChange:(e,t)=>{let i=new Date;"today"===e.target.value?Boolean(u)?(y(null),C(null)):y(i):"lastWeek"===e.target.value?(C(i),y(Ui(i,7))):"lastMonth"===e.target.value?(C(i),y(Ui(i,30))):"all"!==e.target.value&&"custom"!==e.target.value||(y(null),C(null)),F(e.target.value)},handleBlur:()=>!0,options:Boolean(u)?sg:ag,_optionsKey:"dateRangePicker",optionsProps:{},disableCaching:!1,selectVariant:"regular",...S}),"custom"===x?t(i,{children:[e("span",{style:{width:"1%",textAlign:"center",marginTop:"32px"}}),e(Ho,{format:"dd/MM/yyyy",label:A("FromDate"),maxDate:new Date,onChange:e=>{if(ys(e)){if(y(e),w.current=e,e>new Date)return void f({isError:!0,error:A("Futuredatesarenotallowed")});Ba(B,e)?(null!==w.current&&f({isError:!1,error:""}),null!==b.current&&g({isError:!1,error:""})):f({isError:!0,error:A("FromDateshouldbelessthanorequaltoToDate")})}else{if(!e)return f({isError:!0,error:A("ThisFieldisrequired")}),void(w.current=null);if(!Ve(e))return f({isError:!0,error:A("Mustbeavaliddate")}),void(w.current=null)}},value:v??new Date,sx:{width:"30%"},slots:{textField:Ao},slotProps:{textField:{placeholder:"Start Date","aria-label":"Select Date",InputLabelProps:{shrink:!0},error:p.isError,helperText:p.error},actionBar:{actions:["today","cancel"]}}}),e("span",{style:{width:"1%",textAlign:"center",marginTop:"32px"}}),e(Ho,{format:"dd/MM/yyyy",label:A("ToDate"),onChange:e=>{if(ys(e))C(e),b.current=e,Ba(e,v)?(null!==b.current&&g({isError:!1,error:""}),null!==w.current&&f({isError:!1,error:""})):g({isError:!0,error:A("ToDateshouldbegreaterthanorequaltoFromDate")});else{if(!e)return g({isError:!0,error:A("ThisFieldisrequired")}),void(b.current=null);if(!Ve(e))return g({isError:!0,error:A("Mustbeavaliddate")}),void(b.current=null)}},value:B??new Date,sx:{width:"30%"},slots:{textField:Ao},slotProps:{textField:{placeholder:"End Date","aria-label":"Select Date",InputLabelProps:{shrink:!0},error:m.isError,helperText:m.error},actionBar:{actions:["today","cancel"]}}})]}):null]})})},lg=({filterValue:i,id:r,columnName:n,gridProps:a,dispatch:s,filterProps:o})=>{const{t:l}=W(),[c,u]=d(Array.isArray(i?.value)?i?.value[0]:null),[A,p]=d(Array.isArray(i?.value)?i?.value[1]:null),[f,m]=d("");h(()=>{Number(c)>Number(A)&&A?.length>0?m("Min value is greater than max"):m("")},[c,A]);return e(q,{item:!0,xs:12,sm:6,md:6,...a,children:t($e,{fullWidth:!0,error:Boolean(f),tabIndex:1,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(!isNaN(Number(c))&&!isNaN(Number(A))&&c?.length&&A?.length&&Number(c)<=Number(A)?s({type:"setValue",payload:{condition:"between",value:[c,A],id:r,columnName:n,type:o.type}}):s({type:"removeValue",payload:{id:r}}))},sx:{"& label.Mui-focused":{color:"var(--theme-color1)"}},children:[e(Vo,{shrink:!0,sx:{fontSize:"0.875rem !important"},children:l(n)}),t("div",{style:{display:"flex",width:"100%",justifyContent:"space-between"},children:[e(Ko,{style:{width:"45%"},placeholder:"min",value:c,onChange:e=>{isNaN(Number(e.target.value))||u(e.target.value.trim())}}),e(Ko,{style:{width:"45%"},placeholder:"max",value:A,onChange:e=>{isNaN(Number(e.target.value))||p(e.target.value.trim())}})]}),Boolean(f)?e(Ze,{children:f}):null]})})},hg=t=>{const{filterProps:i}=t;return"date"===i?.type||"dateTime"===i?.type?e(og,{...t}):"value"===i?.type?e(lg,{...t}):"number"===i?.type?e(Go,{...t}):"amount"===i?.type?e(nl,{...t}):e(q,{item:!0,md:6,sm:6,xs:12,children:"Range Component Type not set"})},cg=e=>({"data-tag-index":e,tabIndex:-1,key:e}),dg=({filterValue:t,id:i,columnName:r,gridProps:n,dispatch:a})=>{const[s,h]=d(""),[c,u]=d(t?.value??[]),[A,p]=d(-1),f=o(null),m=o(null),g=(e,t)=>{let i=A;-1===A?""===s&&"previous"===t&&(i=c.length-1):(i+="next"===t?1:-1,i<0&&(i=0),i===c.length&&(i=-1)),p(i),w(i)},w=l(e=>{-1===e?m.current.focus():f.current.querySelector(`[data-tag-index="${e}"]`).focus()},[]);let b=null;Array.isArray(c)&&c.length>0&&(b=c.map((t,i)=>e(gi,{label:t,size:"small",onDelete:()=>u([...c.slice(i,i+1),...c.slice(i+1)]),style:{margin:"4px 2px"},...cg(i)})));return e(q,{item:!0,xs:12,sm:6,md:6,...n,children:e(mo,{inputRef:m,label:r,InputLabelProps:{shrink:!0},onChange:e=>h(e.target.value),onBlur:()=>{Array.isArray(c)&&c.length>0?a({type:"setValue",payload:{condition:"in",value:c,id:i,columnName:r}}):a({type:"removeValue",payload:{id:i}})},fullWidth:!0,value:s,InputProps:{startAdornment:b,ref:f},onKeyDown:e=>{if(-1!==A&&-1===["ArrowLeft","ArrowRight"].indexOf(e.key)&&(p(-1),w(-1)),299!==e.which)switch(e.key){case"Enter":Boolean(s)&&(u(e=>[...e,s]),h(""));break;case"Backspace":if(""===s&&c.length>0){const e=-1===A?c.length-1:A,t=c.slice();t.splice(e,1),u(t)}break;case"ArrowLeft":g(0,"previous");break;case"ArrowRight":g(0,"next")}}})})},ug=({filterValue:t,id:i,columnName:r,gridProps:n,dispatch:a})=>{const[s,o]=d(t?.value??"");return e(q,{item:!0,xs:12,sm:6,md:6,...n,children:e(Ho,{label:r,value:""===s?null:new Date(s),onChange:e=>{o(e),isNaN(e)?a({type:"removeValue",payload:{id:i}}):a({type:"setValue",payload:{condition:"equal",value:e,id:i,columnName:r}})},sx:{width:"100%"},slots:{textField:Ao},slotProps:{textField:{variant:"standard",InputLabelProps:{shrink:!0}},actionBar:{actions:["today","cancel"]}}})})},Ag=e=>()=>(console.log(`no method found for options at ${e}`),[{label:"Oops error occured",value:""}]),pg=e=>Array.isArray(e)?e.map(e=>{const{filterComponentType:t,filterProps:i,...r}=e;switch(t){case"valueDateFilter":return{...r,Filter:ug,filterProps:i};case"valueFilter":return{...r,Filter:rg,filterProps:i};case"multiValueFilter":return{...r,Filter:dg,filterProps:i};case"optionsFilter":{const{options:e,...t}=i;if("string"==typeof e){const i=fa.getFn(e??"NOT_EXIST_OPTIONS_FN",Ag);return{...r,Filter:ng,filterProps:{options:i,_optionsKey:e,...t}}}return{...r,Filter:ng,filterProps:i}}case"rangeFilter":return{...r,Filter:hg,filterProps:i};default:return{...r}}}):[],fg=e=>Array.isArray(e)?e.reduce((e,t)=>(!0===t.isHiddenColumn&&e.push(t.accessor),e),[]):[],mg=({metaData:i,maxHeight:r,initialState:n,title:a,options:c,hideFooter:u,showSerialNoColumn:A=!1,onClose:p=null,reportName:m,dataFetcher:g=()=>[],autoFetch:w=!0,hideAmountIn:b=!1,reportID:v,retrievalType:y,onClickActionEvent:B=()=>{},otherAPIRequestPara:C={},hideHeader:x=!1,hideShowFiltersSwitch:F=!1,defaultFilter:S=[],hideStatusBar:N=!1,retrievalComponent:E,openDrawerFilter:k=!1,onDoubleClickAction:T,enableCaching:L=!1,dataTransformer:I=e=>e,reportTemplateCode:D="",enablePivot:P,actions:R=[],getReportData:O,disableFilters:Q,headerToolbarStyle:H={},enableEnterToFocus:M,focusScopeId:_="enter-to-focus-static-report",expandAllGroupedRows:j})=>{const{t:z}=W(),{defaultExportConfig:V,enableEnterToFocus:K,...q}=ns(),G=s(()=>({...i,columns:[{accessor:"SRNO",width:100,disableFilters:!0,type:"default",...i?.sequenceColumnConfig,columnName:i?.sequenceColumnConfig?.columnName??"SrNo"},...i.columns.map(t=>t.isGroupSum?{...t,Aggregated:Vc,aggregate:e=>e.reduce((e,t)=>e+Number(t||0),0)}:"function"==typeof t.customAggregation?(console.log("custom",t.customAggregation,t.accessor),{...t,Aggregated:i=>{const r=t.customAggregation(i,{...q,currencySymbol:$o(q.dynamicAmountSymbol)});return e(Ic,{...i,value:r})}}):t)]}),[i]),J=fg(G.columns),X=s(()=>({...G,hiddenColumns:J}),[J]),Y=s(()=>{if(Array.isArray(X.columns))return X.columns.map(e=>({...e,columnName:z(e.columnName)}))},[z,X]),$=s(()=>k?pg(X?.filters):X.filters,[]),[Z,ee]=d(w),[te,ie]=d([...S]),re=l(e=>{U(te,e)||(ie(e),ee(!0))},[ee,ie,te]),ne=s(()=>({Header:zc,Cell:Ic,Footer:Mc,Footer1:_c,Aggregated:Ic}),[]),ae=s(()=>({fuzzyText:$m,customText:Zm,filterGreaterThan:eg,customInclude:tg}),[]),{data:se,isFetching:oe,isLoading:le,isError:he,error:ce,refetch:de}=zt([g,v,te,C],()=>g(v,te,C),{cacheTime:L?36e5:0,enabled:Z}),ue=s(()=>se?.map((e,t)=>({SRNO:String(t+1),...e})),[se]),Ae=l((e,t)=>{oe||le||he||!Z||B(e,t,se[e],te)},[se]),pe=o(null),fe=M??K,me=_&&fe?{"data-scope-id":_}:{};return h(()=>{fe&&pe.current&&pe.current.focus()},[fe]),t(f,{children:[he?e(to,{severity:"error",errorMsg:ce?.error_msg??"Unknown Error occured",errorDetail:ce?.error_detail}):null,e(Rc,{children:e("div",{ref:pe,tabIndex:fe?0:-1,style:{width:"100%",position:"relative"},onKeyDown:e=>{fe&&Es(e,_)},...me,children:e(Ym,{columns:Y,defaultColumn:ne,defaultHiddenColumns:X.hiddenColumns,data:I(ue)??[],maxHeight:r??450,containerHeight:X?.containerHeight,occupiedHeight:X?.occupiedHeight,initialState:n,filterTypes:ae,title:a+" ",options:c,loading:oe||le,hideFooter:"Y"===u||!0===u,showSerialNoColumn:"Y"===A||!0===A,onClose:p,setQueryFilters:re,filterMeta:$,queryFilters:te,hideStatusBar:"Y"===N||!0===N,hideAmountIn:"Y"===b||!0===b,retrievalType:y,onButtonActionHandel:Ae,isOpenRetrievalDefault:!w,hideHeader:"Y"===x||!0===x,hideShowFiltersSwitch:"Y"===F||!0===F,refetchData:()=>de(),retrievalComponent:E,openDrawerFilter:k,onDoubleClickAction:T,enablePdfPrint:X?.enablePdfPrint??V?.enablePdfPrint??!1,reportTemplateCode:ue?.find(e=>e?.REPORT_PERSONALIZATION_ID)?.REPORT_PERSONALIZATION_ID??D,enablePivot:P&&ue?.length>0,actions:R,getReportData:O,disableFilters:Q,headerToolbarStyle:H,enableEnterToFocus:fe,expandAllGroupedRows:j})})})]})},gg=({column:{filterValue:t,preFilteredRows:i,setFilter:r}})=>{const n=i.length,{t:a}=W();return e(_t,{value:t||"",onChange:e=>{e.target.value.length<=100&&r(e.target.value||void 0)},fullWidth:!0,size:"small",variant:"outlined",placeholder:`${a("Searched")} ${n} ${a("records")}`})};var wg=Object.freeze({__proto__:null,DefaultColumnFilter:gg,NumberRangeColumnFilter:({column:{filterValue:i=[],preFilteredRows:r,setFilter:n,id:a}})=>{const[o,l]=s(()=>{let e=r.length?r[0].values[a]:0,t=r.length?r[0].values[a]:0;return r.forEach(i=>{e=Math.min(i.values[a],e),t=Math.max(i.values[a],t)}),[e,t]},[a,r]);return t("div",{style:{display:"flex",alignItems:"baseline"},children:[e(_t,{value:i[0]||"",type:"number",onChange:e=>{const t=e.target.value;n((e=[])=>[t?parseInt(t,10):void 0,e[1]])},placeholder:`Min (${o})`,fullWidth:!0,size:"small",variant:"outlined"}),e("span",{children:"to"}),e(_t,{value:i[1]||"",type:"number",onChange:e=>{const t=e.target.value;n((e=[])=>[e[0],t?parseInt(t,10):void 0])},placeholder:`Max (${l})`,fullWidth:!0,size:"small",variant:"outlined"})]})},SelectColumnFilter:({column:{filterValue:i,setFilter:r,preFilteredRows:n,id:a,multiple:o}})=>{const{t:l}=W(),h=s(()=>{const e=new Set;return n.forEach(t=>{e.add(t.values[a])}),[...e.values()]},[a,n]);return o&&!Array.isArray(i)&&(i=[i]),t(_t,{value:i??"",onChange:e=>{r(e.target.value||void 0)},fullWidth:!0,variant:"outlined",size:"small",select:!0,SelectProps:{multiple:o},children:[e(K,{value:"",children:l("All")},"default"),h.map((t,i)=>e(K,{value:t,children:t},i))]})},SliderColumnFilter:({column:{filterValue:t,setFilter:i,preFilteredRows:r,id:n}})=>{const[a,o]=s(()=>{let e=r.length?r[0].values[n]:0,t=r.length?r[0].values[n]:0;return r.forEach(i=>{e=Math.min(i.values[n],e),t=Math.max(i.values[n],t)}),[e,t]},[n,r]);return e(Dt,{min:a,max:o,value:t||a,onChange:(e,t)=>{i(parseInt(t))}})}});const bg=Ci(e=>({root:{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),background:"var(--theme-color1)"},title:{flex:"1 1 100%",color:"var(--white)",letterSpacing:"1px",fontSize:"2rem"}})),vg=({footerGroup:t,loading:i})=>e(hi,{...t.getFooterGroupProps(),component:"div",children:t.headers.map(t=>e(ci,{...t.getFooterProps([{style:{textAlign:t?.alignment??"unset",display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"0px 20px 0px 10px",lineHeight:"34px",backgroundColor:"var(--theme-color2)"}}]),component:"div",children:t.render("Footer",{loading:i})}))}),yg=({columns:r,defaultColumn:n,data:a,filterTypes:c,title:u,options:A,loading:p=!1,isError:m=!1,hideFooter:g=!1,showSerialNoColumn:w=!1,onClose:b=null,setQueryFilters:v,filterMeta:y,queryFilters:B,hideAmountIn:x,retrievalType:F,onButtonActionHandel:S,isOpenRetrievalDefault:N,hideHeader:E=!1,pageSizes:k=[20,30,40],pageCount:T,totalRecords:L,onFetchData:I,defaultPageSize:D=20,defaultSortOrder:U=[],defaultHiddenColumns:P=[],enablePagination:R=!0,enablePdfPrint:O,onDoubleClickAction:Q,defaultFilter:H,disableFilters:M,containerHeight:_,occupiedHeight:j,headerToolbarStyle:z,enableEnterToFocus:V,retrievalComponent:K,retrievalComponentMeta:q,retrievalFilters:G,setRetrievalFilters:J})=>{const X=bg(),[$,Z]=d(!1),[ee,te]=d(!1),{t:ie}=W(),{disableColumnFilters:re}=ns(),ne=s(()=>r.some(e=>e.isTotalWithCurrency||e.isTotalWithoutCurrency),[r]),se=s(()=>r.map(e=>({...e,disableFilters:e?.disableFilters??M??re??!1,filter:zm})),[r,M,re]),oe=Gt({columns:se,data:a,defaultColumn:n,filterTypes:c,onButtonActionHandel:S,autoResetGlobalFilter:!1,autoResetFilters:!1,autoResetGroupBy:!1,autoResetSortBy:!1,initialState:{pageIndex:0,pageSize:D,hiddenColumns:P,sortBy:U},...A,manualPagination:!0,pageCount:T,autoResetPage:!1},ri,Xt,Yt,$t,ti,ii,km(w),S,Zt),{getTableProps:le,getTableBodyProps:he,headerGroups:ce,footerGroups:de,rows:ue,page:Ae,prepareRow:pe,pageOptions:fe,totalColumnsWidth:me,toggleAllRowsExpanded:ge,isAllRowsExpanded:we,setAllFilters:be,gotoPage:ve,setPageSize:ye,setSortBy:Be,state:{filters:Ce,pageIndex:xe,pageSize:Fe,sortBy:Se},filteredRows:Ne}=oe,Te=l(({index:t,style:i})=>{if(0===Ae.length)return;const r=Ae[t];return pe(r),e(hi,{...r.getRowProps({style:i}),id:r.id,tabIndex:0,onDoubleClick:()=>{"function"==typeof Q&&Q({row:[{data:r?.original,id:r?.id}]})},children:r.cells.map((e,t)=>{const{key:i}=e.getCellProps();return e.render("Cell",{key:i,index:t})})})},[pe,Ae]),Le=qt(I,500),Ie=s(()=>Ne?.length,[Ne]),De=(e,t)=>{ve(t)},Ue=e=>{ye(Number(e.target.value))};h(()=>{be([])},[B]),h(()=>{Le({pageIndex:xe,pageSize:Fe,sortBy:Se,filters:B,retrievalFilters:G})},[Le,xe,Fe,Se,B,G]),h(()=>{if(0===B?.length&&H?.length>0)v(H);else if(H?.length>0){const e=H.filter(e=>!B.some(t=>e.id===t.id)).concat(B);JSON.stringify(e)!==JSON.stringify(B)&&v(e)}},[B,H,v]),h(()=>{H?.length>0&&te(H.some(e=>"date"===e?.value?.type||"dateTime"===e?.value?.type))},[H]);const Pe=s(()=>{const e=e=>{const t=Array.isArray(B)&&B.length>0?`calc(${_?.[e]??"73.5vh"} - 48px)`:_?.[e]??"73.5vh";return t&&j?.[e]?`calc(${t} - ${j?.[e]})`:t};return{min:e("min"),max:e("max")}},[B,_,j]),Re=o(null),[Oe,Qe]=d({});return h(()=>{if(!Re.current)return;const e=()=>{const e=Re.current,t=getComputedStyle(e),i=parseFloat(t.minHeight),r=parseFloat(t.maxHeight);Qe({min:i,max:r})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[ue]),t(f,{children:[t(ni,{style:{width:"100%",overflow:"hidden",marginBottom:"8px",display:E?"none":"inherit"},className:"not-printed",children:[t(ai,{className:"server__report__header",variant:"dense",sx:{width:"100%",background:"var(--primary-bg)",...z},children:[e(vt,{variant:"h5",color:"primary",children:u.trim()}),e("div",{style:{flexGrow:1}}),q&&e(Rm,{setQueryFilters:J,filterMeta:q,filterData:G,retrievalType:F,isOpenRetrievalDefault:N,retrievalComponent:K}),Ce.length>0&&e(Y,{onClick:()=>{be([])},style:{marginRight:"8px",color:"white"},children:ie("ClearFilter")}),y?.length?e(Gl,{setAllFilters:v,filters:B,filterMeta:y,gotoPage:ve,setSortBy:Be,classes:X,isDefaultFilter:ee}):null,e(Wo,{title:ie("Refetch"),children:e(C,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true",onClick:()=>Le({pageIndex:xe,pageSize:Fe,sortBy:Se,filters:B,retrievalFilters:G}),color:"primary",children:e(ki,{})})}),x?null:e(Hc,{}),ce.some(e=>e.headers.some(e=>!0===e.isGrouped))?e(ae,{control:e(ke,{onChange:()=>ge(!we),checked:we,name:"filters",size:"small",color:"primary"}),style:{color:"var(--white)",marginLeft:0},label:ie("ExpandRows")}):e(i,{children:!p&&!m&&Ae.length>0?e(ae,{control:e(Wo,{title:ie("Showexportoptions"),arrow:!0,children:t(eo,{onClick:()=>{Z(!0)},style:{marginTop:"0px",marginLeft:"10px",color:"white"},disabled:p,eventKey:"x",shortcut:"alt",children:[ie("Export")," ",e(Ki,{})]})}),style:{color:"var(--white)"},label:""}):null}),"function"==typeof b?e(Wo,{title:ie("Close"),arrow:!0,children:e(C,{onClick:b,size:"small",children:e(Bt,{style:{color:"var(--white)"}})})}):null]}),B.length||G?.length?e(hh,{dense:!0,setAllFilters:e=>{const t=new Set(B.map(e=>e.id)),i=new Set(G.map(e=>e.id)),r=new Set(e.map(e=>e.id)),n=[];for(const e of G)r.has(e.id)&&i.has(e.id)&&n.push(e);const a=[];for(const r of e)t.has(r.id)?a.push(r):i.has(r.id)||a.push(r);J(n),v(a)},filters:[...G,...B],gotoPage:ve,setSortBy:Be}):null]}),p&&e(mt,{color:"secondary"}),t(ni,{style:{width:"100%",overflow:"hidden"},tabIndex:0,children:[e(si,{ref:Re,sx:{position:"relative",maxHeight:Pe.max,minHeight:Pe.min},children:t(oi,{...le(),size:"small",component:"table",children:[e(li,{component:"thead",children:ce.map(i=>e(hi,{...i.getHeaderGroupProps(),component:"tr",children:i.headers.map((i,r)=>t(ci,{...i.getHeaderProps([{style:{display:"flex",padding:0===r?"0 10px":"0px 10px 0 0",alignItems:"center"}}]),component:"th",align:i.alignment,children:[i.render("Header"),i.canFilter?e(Gm,{column:i,filters:Ce,enableEnterToFocus:V}):null]}))}))}),p||m?null:e(di,{...he({}),component:"tbody",children:e(Ei,{height:(Oe?.min??300)-(ne?72:38),itemCount:Ae.length,itemSize:35,width:me+10,overscanCount:10,children:Te})}),m?e("div",{style:{position:"absolute",left:"50%",top:"50%",fontStyle:"italic",color:"rgba(133, 130, 130, 0.8)"},children:ie("Somethingwenttowrong")}):null,ue.length<=0&&!1===p?e("div",{style:{position:"absolute",left:"50%",top:"50%",fontStyle:"italic",color:"rgba(133, 130, 130, 0.8)"},children:ie("Nodatafound")}):null,p?null:e(li,{component:"div",children:e(vg,{footerGroup:de[0],loading:p})})]})}),g?null:R?e(Ee,{sx:{display:"flex",overflowY:"hidden","& .MuiToolbar-root":{display:"flex",alignItems:"baseline",transform:"translateY(5.5px)"}},variant:"body",component:"div",rowsPerPageOptions:k,colSpan:3,count:m||p?0:Number(L),rowsPerPage:Number(Fe),page:m||p?0:Number(xe),onPageChange:De,onRowsPerPageChange:Ue,ActionsComponent:nh}):t(ci,{style:{display:"flex",color:"var(--theme-color1)",fontWeight:"bold",padding:"10px"},children:[ie("TotalNoofRecords"),": ",Ie]}),$?e(Bd,{filters:Ce,queryFilters:B,title:u.trim(),rows:ue,columns:r,pageNumber:xe,totalPageCount:fe.length,onClose:()=>{Z(!1)},enablePdfPrint:O,enableEnterToFocus:V}):null]})]})},Bg=({metaData:i,maxHeight:r,containerHeight:n,occupiedHeight:a,initialState:c,title:u,options:A,hideFooter:p,showSerialNoColumn:m=!1,onClose:g=null,reportName:w,dataTransformer:b=e=>e,autoFetch:v=!0,hideAmountIn:y=!1,retrievalType:B,onClickActionEvent:C=()=>{},hideHeader:x=!1,hideShowFiltersSwitch:F=!1,defaultFilter:S=[],hideStatusBar:N=!1,data:E,loading:k,isError:T,error:L,pageCount:I,totalRecords:D,pageSizes:U,defaultPageSize:P,onFetchData:R,onDoubleClickAction:O,disableFilters:Q,headerToolbarStyle:H,enableEnterToFocus:M,focusScopeId:_,retrievalComponent:j})=>{const{t:z}=W(),{defaultExportConfig:V,enableEnterToFocus:K}=ns(),q=s(()=>{if(Array.isArray(i.columns))return i.columns.map(e=>({...e,columnName:z(e.columnName)}))},[z]),G=s(()=>pg(i.filters),[i.filters]),[J,X]=d(v),[Y,$]=d([]),[Z,ee]=d([]),te=l(e=>{$(e),X(!0)},[X,$]),ie=s(()=>({Header:zc,Cell:Ic,Footer:Mc,Filter:gg,Aggregated:Ic}),[]),re=s(()=>({fuzzyText:$m,customText:Zm,filterGreaterThan:eg,customInclude:tg}),[]),ne=l((e,t)=>{k||T||!J||C(e,t,E[e])},[E]),ae=o(null),se=M??K,oe=_&&se?{"data-scope-id":_}:{};return h(()=>{se&&ae.current&&ae.current.focus()},[se]),t(f,{children:[T&&e(to,{severity:"error",errorMsg:L?.error_msg??"Unknown Error occured",errorDetail:L?.error_detail}),e(Rc,{children:e("div",{ref:ae,tabIndex:se?0:-1,style:{width:"100%",position:"relative"},onKeyDown:e=>{se&&Es(e,_)},...oe,children:e(yg,{columns:q,defaultColumn:ie,defaultHiddenColumns:i.hiddenColumns,data:b(E)??[],maxHeight:r??450,containerHeight:n,occupiedHeight:a,filterTypes:re,title:u+" ",options:A,loading:k,isError:T,hideFooter:("string"!=typeof p||"N"!==p)&&Boolean(p),showSerialNoColumn:m,onClose:g,setQueryFilters:te,defaultFilter:S,filterMeta:G,retrievalComponentMeta:i.retrievalFilters,queryFilters:Y,hideStatusBar:N,hideAmountIn:y,retrievalType:B,onButtonActionHandel:ne,isOpenRetrievalDefault:!v,hideHeader:x,hideShowFiltersSwitch:F,onFetchData:R,totalRecords:D,pageSizes:U,pageCount:I,defaultPageSize:P,enablePdfPrint:i?.enablePdfPrint??V?.enablePdfPrint??!1,onDoubleClickAction:O,disableFilters:Q,headerToolbarStyle:H,enableEnterToFocus:se,retrievalComponent:j,retrievalFilters:Z,setRetrievalFilters:ee})})})]})},Cg=({reportID:t,reportName:i,metaData:r,getAPIFn:n,otherAPIRequestPara:a,maxHeight:h,onClickActionEvent:c,defaultFilter:u,onDoubleClickAction:A,disableFilters:p,options:f,headerToolbarStyle:m={},enableEnterToFocus:g,focusScopeId:w="enter-to-focus-server-report",retrievalComponent:b,title:v})=>{const{t:y}=W(),[B,C]=d([]),[x,F]=d(null),[S,N]=d(0),[E,k]=d(0),T=o(null),L=o(null),{...I}=ns(),D=Vt(n,{onError:e=>{F(e)},onSuccess:e=>{C(e?.[0].REPORT_DATA),k(Math.ceil(Number(e?.[0].COUNT??1)/Number(T.current?.pageSize??20))),N(Number(e?.[0].COUNT??1))}}),U=l(({pageSize:e,pageIndex:i,filters:r,sortBy:n,retrievalFilters:s})=>{if(!P?.autoFetch&&Array.isArray(s)&&0===s.length)return;const o=Number(e)*Number(i)+1,l=Number(o)+Number(e)-1;let h=((e=[])=>(Array.isArray(e)||(e=[e]),e.map((e,t)=>({ACCESSOR:e.id,CONDITION:e.value.condition,VALUE:e.value.value,TYPE:e.value?.type??""}))))(r),c=((e=[])=>e.map((e,t)=>({ACCESSOR:e.id??"",VALUE:e?.desc?"desc":"asc"})))(n),d={};Array.isArray(s)&&s.length>0&&(d=s?.reduce((e,t)=>({...e,[t.id]:t.value.value}),{})),L.current&&L.current?.abort?.(),L.current=new AbortController;const u={reportID:t,APIRequestPara:{FROM_ROW:o,TO_ROW:l,FILTER_CONDITIONS:h,ORDERBY_COLUMNS:c,IS_PAGE:!0,...d,...a},abortAPICall:L.current};T.current={pageSize:e},D.mutate(u)},[N,C]),P=s(()=>({...r,columns:[{accessor:"ROW_SR_CD_",width:100,disableFilters:!0,type:"default",...r?.sequenceColumnConfig,columnName:r?.sequenceColumnConfig?.columnName??"SrNo"},...r.columns.map(t=>t.isGroupSum?{...t,Aggregated:Vc,aggregate:e=>e.reduce((e,t)=>e+Number(t||0),0)}:"function"==typeof t.customAggregation?(console.log("custom",t.customAggregation,t.accessor),{...t,Aggregated:i=>{const r=t.customAggregation(i,{...I,currencySymbol:$o(I.dynamicAmountSymbol)});return e(Ic,{...i,value:r})}}):t)]}),[r]),R=fg(P.columns),O=s(()=>({...P,hiddenColumns:R}),[R]);return e(Bg,{metaData:O,maxHeight:h,reportName:i,containerHeight:P?.containerHeight,occupiedHeight:P?.occupiedHeight,title:v??y(P.title),hideFooter:P.hideFooter,hideAmountIn:P.hideAmountIn,retrievalType:P.retrievalType,onClickActionEvent:c,options:f,autoFetch:P?.autoFetch??!0,data:B,loading:D.isLoading,isError:D.isError,error:x,pageCount:E,totalRecords:S,pageSizes:P?.pageSize??[25,50,100,250,500,2500,5e3,1e4,5e4,1e5],defaultPageSize:P.defaultPageSize??25,onFetchData:U,defaultFilter:u,onDoubleClickAction:A,disableFilters:p,headerToolbarStyle:m,enableEnterToFocus:g,focusScopeId:w,retrievalComponent:b})};io(".ag-theme-alpine{--ag-header-background-color:var(--theme-color4)!important;--ag-header-foreground-color:var(--theme-color1)!important;--ag-row-hover-color:none;--ag-font-weight:600;--ag-font-family:Roboto,sans-serif;--ag-height:30px!important}.ag-header-cell-label{color:var(--theme-color1)!important;cursor:default;font-family:Roboto,Helvetica,Arial,sans-serif;font-size:.875rem;font-weight:600;opacity:1;overflow:hidden;text-transform:capitalize}.ag-header-cell{border-radius:8px}.ag-cell{border-right:1px solid #fff}.ag-cell.currency{text-align:right}.ag-row.ag-row-pinned{background:var(--theme-color4)!important;border:none!important;line-height:22px;pointer-events:none;text-align:center}.ag-floating-bottom{border-top:none!important;height:23px!important;min-height:23px!important}.ag-row.ag-row-pinned .ag-cell{border:none!important;color:var(--theme-color3);font-size:small;font-weight:700;height:23px!important;line-height:inherit;min-height:23px!important;overflow:hidden;padding:0 10px;text-overflow:ellipsis;white-space:nowrap}.error-border{border:1px solid #d32f2f!important;border-radius:2px}.cell-placeholder{color:var(--theme-color6)!important;cursor:default;font-family:Roboto,Helvetica,Arial,sans-serif;font-size:.875rem;height:15px;opacity:1;overflow:hidden;text-transform:capitalize}.main-container{padding:10px}.cell-value{color:#000;font-family:Roboto,Helvetica,Arial,sans-serif;font-size:.875rem;height:15px}.ag-cell .MuiAutocomplete-root .MuiOutlinedInput-root{padding:0!important}.ag-cell .MuiOutlinedInput-root .MuiAutocomplete-input{padding:4.5px 4px 4.5px 5px}.ag-cell .MuiOutlinedInput-notchedOutline{border:none!important}");const xg=({rowIndex:e,agGridReact:t,data:i,node:r,...n})=>r.rowPinned?"":r.rowIndex+1,Fg=e=>{let t;return t="string"==typeof e?Number(e.replace(/,/g,"")):e,Number.isNaN(t)?0:parseFloat(t.toFixed(Number(process.env.SYSTEM_DECIMAL_LENGTH)||3))},Sg=e=>{let t=e.values.reduce((e,t)=>e+Fg(t),0);return Fg(t)},Ng=e=>{if(!e)return null;const t="string"==typeof e?je(e,"dd/MM/yyyy",new Date):new Date(e);return Ve(t)?t:null},Eg=(e,t)=>{if(e){const i=e.current.getAllDisplayedColumns().filter(e=>{const{editable:i}=e.colDef;return"function"==typeof i?i(t):!0===i});if(!i.length)return;return i[i.length-1]}},kg=(e,t)=>{if(e){const i=e.current.getAllDisplayedColumns().filter(e=>{const{editable:i}=e.colDef;return"function"==typeof i?i(t):!0===i});if(!i.length)return;return i[0]}},Tg=e=>{if(!e.current)return[];const t=[];return e.current.forEachNode(e=>t.push(e.data)),t},Lg=async e=>{const t=Tg(e);t.length>0&&(await e.current.applyTransaction({remove:t}),await e.current.applyTransaction({add:[{}]}))},Ig=(e,t)=>{I(e)?(t.api.getRowNode(t.node.id)?.setRowHeight(30),t.api.onRowHeightChanged()):(t.api.getRowNode(t.node.id)?.setRowHeight(45),t.api.onRowHeightChanged())},Dg=e=>isNaN(e)?0:`₹ ${e.toFixed(2)}`,Ug=(e,t,i)=>("string"==typeof e&&(e=je(e,"dd/MM/yyyy",new Date)),"string"==typeof t&&(t=je(t,"dd/MMM/yyyy",new Date)),i?.ignoreTime&&(e=new Date(e).setHours(0,0,0,0),t=new Date(t).setHours(0,0,0,0)),He(e,t)),Pg=(e,t,i="")=>{const r=[...(e.data.errors||[]).filter(e=>e.field!==t),{field:t,message:i}];e.setData({...e.data,errors:r})},Rg=async e=>{const{context:t,node:i,api:r}=e,n=[];if(r.forEachNode(e=>n.push(e.data)),1===n.length)await t.MessageBox({messageTitle:"Delete Row",message:"You can not delete last row.",icon:"ERROR",buttonNames:["Ok"]});else{"Yes"===await t.MessageBox({messageTitle:"confirmation",message:"Are you sure want to delete row ?",buttonNames:["Yes","No"],defFocusBtnName:"Yes",icon:"CONFIRM"})&&(r.applyTransaction({remove:[i.data]}),t.updatePinnedBottomRow())}},Og=c((r,n)=>{const{value:a,colDef:{cellEditorParams:s,field:l,name:c},node:u,onValueChange:A,api:f,context:m}=r,{postValidationSetCrossAccessorValues:g=()=>{}}=s||{},w=o(null),b=o(-1),[v,y]=d(!1),[B,C]=d([]),[x,F]=d(!0);h(()=>{let e=r.context.state?.[l]||[];e?.length?(C(e),F(!1)):(async()=>{if("function"==typeof s?.options){F(!0);try{const e=await s.options();r.context.updateState(l,e),C(e||[])}catch(e){C([])}finally{F(!1)}}})()},[]);const S=()=>!a||"object"==typeof a&&I(a)?null:B.find(e=>e.value===a?.value||e.value===a)||null,[N,E]=d(S());h(()=>{E(S())},[B]);const k=(e,t)=>{if(t){E(t);const e={...u.data,[l]:t?.value,[c]:t?.label};u.setData(e),A(t?.value)}};p(n,()=>({getValue:()=>N?N.value:null}));const T=async e=>{y(!1),"function"==typeof g&&await g(N,u,f,l,A,m),-1!==b.current&&B[b.current]&&(await k(0,B[b.current]),"function"==typeof g&&await g(B[b.current],u,f,l,A,m))},L=()=>{if(I(a)){const e={...u.data,[l]:void 0};u.setData(e),A(void 0),E(void 0)}y(!0)};if(h(()=>{w.current&&w.current.focus()},[]),u?.rowPinned)return null;const D=u.data?.errors?.find(e=>e.field===l);return t(i,{children:[e(ye,{id:"item-cell-editor",value:N,onChange:k,options:B,loading:x,getOptionLabel:e=>e.label,isOptionEqualToValue:(e,t)=>e.value===t?.value,open:v,onOpen:()=>y(!0),onClose:()=>y(!1),onHighlightChange:(e,t)=>{b.current="mousemove"!==e?.type?B.indexOf(t):-1},sx:{padding:"0px"},renderInput:r=>e(Te,{...r,variant:"outlined",inputRef:w,onFocus:L,onClick:L,onBlur:T,placeholder:"Select an option",InputProps:{...r.InputProps,endAdornment:t(i,{children:[x?e(he,{color:"inherit",size:20}):null,r.InputProps.endAdornment]})}}),fullWidth:!0}),P(u.data?.errors)&&D?e(ne,{title:Ge(D.message),arrow:!0,children:e(le,{style:{marginTop:"0px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},error:!0,children:Ge(D.message)})}):null]})}),Qg=c((t,i)=>{const{value:r,node:n,colDef:a={},api:s,context:o={}}=t,{cellRendererParams:l={},shouldExclude:h}=a,{disabled:c=!1,handleButtonClick:d=()=>{},buttonName:u="Remove"}=l;p(i,()=>({getValue:()=>r}));const A="function"==typeof c?c(t):c;if(n?.rowPinned)return null;const f="function"==typeof h&&h(t),m="function"==typeof u?u(t):u;return f?null:e(Y,{fullWidth:!0,variant:"contained",color:"secondary",style:{height:"23px",backgroundColor:A?"var(--theme-color7) !important":"var(--theme-color1) !important"},onClick:async()=>{await d(t)},disabled:A,children:m})}),Hg=c((r,n)=>{const{value:a,colDef:{field:s,cellEditorParams:l},node:c,api:u,onValueChange:A,context:f}=r,{postValidationSetCrossAccessorValues:m}=l||{},{commonDateFormat:g="dd/MM/yyyy"}=ns(),[w,b]=d(()=>{const e=Ng(a);return Ve(e)?e:null}),v=o(null);p(n,()=>({getValue:()=>w?ze(w,g):""})),h(()=>{v.current&&setTimeout(()=>{v.current?.focus()},0)},[]),h(()=>{if(!a){const e=new Date;b(e);const t=ze(e,g),i={...c.data,[s]:t};c.setData(i),A?.(t)}},[a]);if(c?.rowPinned)return null;const y=c.data?.errors?.find(e=>e.field===s);return t(i,{children:[e(hr,{dateAdapter:Hi,children:e(cr,{defaultValue:new Date,format:"dd/MM/yyyy",value:w,onChange:e=>{if(!e||!Ve(e)){const e=new Date;b(e);const t=ze(e,g),i={...c.data,[s]:t};return c.setData(i),void A?.(t)}b(e);const t=ze(e,g),i={...c.data,[s]:t};c.setData(i),A?.(t)},slotProps:{textField:{onBlur:async()=>{"function"==typeof m&&await m(w,c,u,s,A,f)},variant:"outlined",fullWidth:!0,size:"small",inputRef:v}},sx:{"& input":{border:"none",padding:"4px 4px",textAlign:"center"},"& fieldset":{border:"none"}}})}),P(c.data?.errors)&&y?e(ne,{title:Ge(y.message),arrow:!0,children:e(le,{style:{marginTop:"0px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},error:!0,children:Ge(y.message)})}):null]})}),Mg=({fieldError:t})=>{const{i18n:i}=W();return e(Ii,{title:i.t(t.message),arrow:!0,children:e("span",{style:{display:"block",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%",color:"#d32f2f",fontSize:"0.75rem",marginTop:"7px",cursor:"pointer"},children:i.t(t.message)})})},_g=c((r,n)=>{const{value:a="",colDef:{cellEditorParams:{postValidationSetCrossAccessorValues:s=()=>{},uppercase:l=!1,defaultValue:c="",isNumber:u=!1,inputProps:A={},allowNegative:f=!0,allowLeadingZeros:m=!0,isAllowed:g=()=>!0,allowAlphaNumeric:w=!1}={},field:b,alignment:v="left"},node:y,api:B,onValueChange:C,context:x}=r,[F,S]=d(a),N=o(null),[E,k]=d(!1);p(n,()=>({getValue:()=>F})),h(()=>{N.current&&setTimeout(()=>{N.current?.select()},0)},[]);const T=y.data?.errors?.find(e=>e.field===b);return t(i,{children:[e(Te,{defaultValue:c,variant:"outlined",fullWidth:!0,size:"small",value:F,inputRef:N,onFocus:()=>{N.current?.select(),y.setDataValue("disableChequeDate",void 0)},InputProps:{...A,endAdornment:E?e(he,{size:20,color:"secondary"}):null},sx:{"& input":{textAlign:v,border:"none",padding:"4px 4px"},"& fieldset":{border:"none"}},onChange:e=>{let t=e.target.value;if(u){if(t=t.replace(/[^0-9.\- ]/g,""),(t.match(/\./g)||[]).length>1)return;if(!f&&t.startsWith("-"))return;m||(t=t.replace(/^0+/,""))}else w||(t=t.replace(/[^a-zA-Z ]/g,""));if(l&&(t=t.toUpperCase()),g&&!g({value:t}))return;S(t);const i={...y.data,[b]:t};y.setData(i),C?.(t)},onBlur:async e=>{e.preventDefault(),"function"==typeof s&&await s(F,y,B,b,C,x)}}),P(y.data?.errors)&&T?e(ne,{title:Ge(T.message),arrow:!0,children:e(le,{style:{marginTop:"0px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},error:!0,children:Ge(T.message)})}):null]})}),jg={autocomplete:Og,CustomButtonCellEditor:Qg,amountField:r=>{const{value:n=0,colDef:{cellEditorParams:{postValidationSetCrossAccessorValues:a,maxLength:s},field:l},node:c,api:u,onValueChange:A,context:p}=r,[f,m]=d(n),[g,w]=d(!1),{dynamicAmountSymbol:b}=ns(),v=o(null);h(()=>{v.current&&setTimeout(()=>{v.current?.select()},0)},[]);if(c?.rowPinned)return null;const y=c.data?.errors?.find(e=>e.field===l);return t(i,{children:[e(Ht,{value:f,thousandSeparator:!0,decimalScale:2,fixedDecimalScale:!0,allowNegative:!1,customInput:Te,variant:"outlined",fullWidth:!0,size:"small",inputRef:v,onFocus:()=>{v.current&&v.current.select()},onValueChange:e=>{m(e.floatValue);const t={...c.data,[l]:e.floatValue};c.setData(t),A(e.floatValue)},onBlur:async()=>{"function"==typeof a&&await a(f,c,u,l,A,p)},sx:{"& input":{textAlign:"right",border:"none",padding:"4px 4px"},"& fieldset":{border:"none"}},InputProps:{style:{textAlign:"right"},startAdornment:e(se,{position:"start",children:$o(b)}),endAdornment:e(se,{position:"end",children:g&&e(he,{color:"secondary",size:20})})},valueIsNumericString:!1,isAllowed:e=>{const{value:t}=e;return void 0===t||(!s||t.length<=s)}}),P(c.data?.errors)&&y?e(ne,{title:Ge(y.message),arrow:!0,children:e(le,{style:{marginTop:"0px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},error:!0,children:Ge(y.message)})}):null]})},NumberFormat:_g,DatePickerCell:Hg,DisplayCurrencyCell:i=>{const{dynamicAmountSymbol:r,decimalCount:n,currencyFormat:a}=ns(),s=au(isNaN(i.value)?0:parseFloat(i.value||"0"),$o(r),a,n),o="function"==typeof i.colDef.editable?i.colDef.editable(i):i.colDef.editable;if(h(()=>{i.eGridCell&&(i.eGridCell.style.backgroundColor=o?"transparent":"var(--theme-color7)")},[o,i.eGridCell]),i.node?.rowPinned)return i.value??null;const l=i.node?.data?.errors||[],c=l.find(e=>e.field===i.colDef.field);l&&Ig(l,i);return"function"==typeof i?.colDef?.shouldExclude&&i?.colDef?.shouldExclude(i)?null:e("div",{style:{display:"flex",flexDirection:"column"},children:e("span",{children:i.value||!I(c?.message)?t("div",{style:{display:"flex",flexDirection:"column"},children:[e("span",{className:"cell-value",children:i.value?s:""}),!I(c?.message)&&e(Mg,{fieldError:c})]}):e("span",{className:"cell-placeholder",children:"₹0.00"})})})},DisplayDateCell:i=>{const r=i.node?.data?.errors||[],n=r.find(e=>e.field===i.colDef.field);r&&Ig(r,i);const a="function"==typeof i.colDef.editable?i.colDef.editable(i):i.colDef.editable;if(h(()=>{i.eGridCell&&(i.eGridCell.style.backgroundColor=a?"transparent":"var(--theme-color7)")},[a,i.eGridCell]),i.node?.rowPinned)return i.value??null;return"function"==typeof i?.colDef?.shouldExclude&&i?.colDef?.shouldExclude(i)?null:e("div",{style:{display:"flex",flexDirection:"column"},children:e("span",{children:i.value||!I(n?.message)?t("div",{style:{display:"flex",flexDirection:"column"},children:[e("span",{className:"cell-value",children:i.value}),!I(n?.message)&&e(Mg,{fieldError:n})]}):e("span",{className:"cell-placeholder",children:i.colDef?.headerName})})})},DisplaySelectCell:i=>{const{value:r,colDef:{cellEditorParams:n,field:a,editable:s,headerName:o,name:l},node:c,context:d}=i,u=c?.data?.errors||[],A=u.find(e=>e.field===a);u&&Ig(u,i);const p="function"==typeof s?s(i):s;if(h(()=>{let e=d.state?.[a]||[];if(I(e))(async()=>{if("function"==typeof n?.options){const e=await n.options();d.updateState(a,e);const t=e.find(e=>e?.value===r);t&&c.setData({...c.data,[l]:t?.label})}})();else{const t=e.find(e=>e?.value===r);t&&c.setData({...c.data,[l]:t?.label})}},[]),h(()=>{i.eGridCell&&(i.eGridCell.style.backgroundColor=p?"transparent":"var(--theme-color7)")},[p,i.eGridCell]),c?.rowPinned)return r||!1;return"function"==typeof i?.colDef?.shouldExclude&&i?.colDef?.shouldExclude(i)?null:e("div",{style:{display:"flex",flexDirection:"column"},children:e("span",{children:c.data?.[l]||r||!I(A?.message)?t("div",{style:{display:"flex",flexDirection:"column"},children:[e("span",{className:"cell-value",children:c.data?.[l]||r}),!I(A?.message)&&e(Mg,{fieldError:A})]}):e("span",{className:"cell-placeholder",children:o})})})},DisplayCell:i=>{const r=i.node?.data?.errors||[],n=r.find(e=>e.field===i.colDef.field);r&&Ig(r,i);const a="function"==typeof i.colDef.editable?i.colDef.editable(i):i.colDef.editable;if(h(()=>{i.eGridCell&&(i.eGridCell.style.backgroundColor=a?"transparent":"var(--theme-color7)")},[a,i.eGridCell]),i.node?.rowPinned)return i.value??null;return"function"==typeof i?.colDef?.shouldExclude&&i?.colDef?.shouldExclude(i)?null:e("div",{style:{display:"flex",flexDirection:"column"},children:e("span",{children:i.value||!I(n?.message)?t("div",{style:{display:"flex",flexDirection:"column"},children:[e("span",{className:"cell-value",children:i?.value}),!I(n?.message)&&e(Mg,{fieldError:n})]}):e("span",{className:"cell-placeholder",children:i.colDef?.headerName})})})}},zg={abortEarly:!1,strict:!1},Vg=(e,t,i)=>async(t,i,r)=>{try{await e.validate(t,zg);const n=(i.data.errors||[]).filter(e=>e.field!==r);i.setData({...i.data,errors:n})}catch(e){const t=[...(i.data.errors||[]).filter(e=>e.field!==r),{field:r,message:e.message}];return i.setData({...i.data,errors:t}),e instanceof E.ValidationError?e.errors[0]:e.message}};const Kg=t=>{const{agGridProps:{columnDefs:i,rowData:n,id:c,onCellValueChanged:u=()=>{}},loading:A,defaultView:p,updatePinnedBottomRow:f=()=>{},handleCustomCellKeyDown:m,handleAddNewRow:g}=t,{i18n:w}=W(),b=o(),[v,y]=d(c),B=s(()=>function(e,t){return e.map(e=>{const{accessor:i,columnName:r,componentType:n,FormatProps:a,className:s,hide:o,displayComponentType:l,headerTooltip:h,postValidationSetCrossAccessorValues:c,isVisible:d,options:u,isReadOnly:A,...p}=e;return{headerName:`${t.t(r)}`,headerTooltip:`${t.t(h)}`,headerValueGetter:()=>t.t(r),field:i,cellEditor:n||void 0,cellEditorParams:{postValidationSetCrossAccessorValues:c,...a,options:u},className:s,hide:!1===d&&!d,cellRenderer:l||"DisplayCell",cellStyle:t=>e.alignment?{textAlign:e.alignment}:{textAlign:"left"},..."agCheckboxCellEditor"===n&&{onCellValueChanged:async e=>{"function"==typeof c&&await c(e)}},editable:t=>{const i=t.context?.gridContext?.mode??"new",r={edit:e.__EDIT__,view:e.__VIEW__,new:e.__NEW__}[i.toLowerCase()];return"function"==typeof r?.isReadOnly?!r.isReadOnly(t):"function"==typeof A?!A(t):"boolean"==typeof r?.isReadOnly?!r.isReadOnly:"boolean"!=typeof A||!A},...p}})}(i,w),[i,w]),{MessageBox:C}=fd(),{setGridData:x}=a(Gg),F=(e=>{const[t,i]=d({});return{...e,state:t,updateState:r.useCallback((e,t)=>{i(i=>({...i,[e]:t}))},[])}})({MessageBox:C,updatePinnedBottomRow:f,gridContext:t?.gridContext}),S=l(e=>{const{api:i}=e;b.current=i,i.autoSizeAllColumns(),t.getGridApi&&(t.getGridApi.current=i)},[t.getGridApi]),N=l(e=>{const{api:i}=e;if(i.autoSizeAllColumns(),f(),t.autoSelectFirst){i.deselectAll();let e=i.getRowNode(0);e?.setSelected(!0,!0)}},[t.autoSelectFirst]),k=s(()=>jg,[]);return h(()=>{y(c||`table-${String(1e17*Math.random()).substring(0,15)}`)},[c]),h(()=>{b.current&&(A?b.current.showLoadingOverlay():(b.current.hideOverlay(),n?.length||b.current.showNoRowsOverlay()))},[A,b.current,n]),h(()=>{const e=()=>{b.current&&setTimeout(()=>{b?.current.sizeColumnsToFit()},100)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[b]),h(()=>{b.current&&(b.current?.refreshHeader(),b.current.redrawRows())},[w.language]),{gridApi:b,tableId:v,allColumns:B,gridContext:F,onGridReady:S,onFirstDataRendered:N,onCellKeyDown:async e=>{const{event:t,column:{colDef:i},api:r,node:n}=e;if("new"!==p)return;if("Tab"===t.key&&t.shiftKey)return;if("Tab"!==t.key&&"Enter"!==t.key)return;const a=Eg(b,e),s=kg(b,e);if("function"==typeof m&&await m(e,a),"Enter"===t.key&&t.shiftKey)setTimeout(()=>{r.tabToPreviousCell()},50);else if(i.field===a.colDef?.field){const e=r.getDisplayedRowCount(),t=!!r.getRowNode(e-1)?.data&&Object.values(r.getRowNode(e-1).data).every(e=>null==e||""===e),i=n.rowIndex+1;t||e!==i||("function"==typeof g?g():b.current.applyTransaction({add:[{}]}),setTimeout(()=>{r.setFocusedCell(n.rowIndex+1,s?.colDef?.field),b.current.startEditingCell({rowIndex:n.rowIndex+1,colKey:s?.colDef?.field})},50))}else setTimeout(()=>{"Enter"===t.key&&r.tabToNextCell()},50)},onAddClick:()=>{"function"==typeof g?g():b.current.applyTransaction({add:[{}]});const e=[];b.current.forEachNode(t=>e.push(t.data));const t={node:{data:e[e?.length-1]}},i=b.current.getAllDisplayedColumns().filter(e=>e.colDef?.cellEditorParams?.isFieldFocused)?.[0],r=kg(b,t);setTimeout(()=>{b.current.setFocusedCell(e.length-1,i?i?.colDef?.field:r?.colDef?.field),b.current.startEditingCell({rowIndex:e.length-1,colKey:i?i?.colDef?.field:r?.colDef?.field}),"function"==typeof f&&f()},100)},components:k,onCellEditingStopped:async e=>{const{colDef:{field:t,schemaValidation:i,validate:r},node:n,api:a,value:s}=e,o=s??n?.data[t];if(x(e=>e.map((e,i)=>i===n.rowIndex?{...e,[t]:o}:e)),i){const e=(e=>{if(void 0===e)return;const{type:t,rules:i}=e;if(!E[t])return;if(!Array.isArray(i))return;let r=E[t]();return i.forEach(e=>{const{params:t,name:i}=e;r[i]&&(r=r[i](...t))}),Vg(r)})(i);e&&await e(o,n,t)}if(r){const i=r(e);if(i){const e=[...(n.data.errors||[]).filter(e=>e.field!==t),{field:t,message:i}];n.setData({...n.data,errors:e})}else{const e=(n.data.errors||[]).filter(e=>e.field!==t);n.setData({...n.data,errors:e})}}},noDataComponent:()=>e("span",{style:{fontStyle:"italic",color:"rgba(133, 130, 130, 0.8)"},children:w.t("NoDataFound")}),onCellValueChanged:u,i18n:w}},qg=({buttons:t})=>t&&0!==t.length?e(i,{children:t.map((t,i)=>e(eo,{onClick:t.onClick,disabled:t.disabled,...t,children:t.label},i))}):null;Fr.registerModules([Sr,Nr,Er,kr]);const Gg=n({gridData:[],setGridData:e=>{}}),Wg=r.memo(i=>{const[r,n]=d(i.agGridProps.rowData||[]),{tableId:a,allColumns:s,gridContext:o,onGridReady:l,onFirstDataRendered:h,onCellKeyDown:c,onAddClick:u,components:A,onCellEditingStopped:p,noDataComponent:f,i18n:m,onCellValueChanged:g}=Kg({...i});i={...i,defaultColDef:{...i.defaultColDef,flex:1,suppressMovable:!0,unSortIcon:!0,resizable:!0,suppressSizeToFit:!0,onCellValueChanged:g}};const{hideHeader:w=!1,agGridProps:b={},defaultView:v="new",gridConfig:y={},buttons:B=[],isNewButtonVisible:C=!0,newButtonLabel:x}=i;return e(Gg.Provider,{value:{gridData:r,setGridData:n},children:t("div",{className:"main-container",children:[!w&&t(xe,{style:{paddingLeft:"24px",paddingRight:"24px",background:"var(--primary-bg)",borderTopLeftRadius:"4px",borderTopRightRadius:"4px",minHeight:"48px",height:"48px",display:"flex",justifyContent:"space-between"},children:[t(X,{style:{color:"var(--white)",fontWeight:"500",fontSize:"1.5rem !important",lineHeight:"1.6 !important",letterSpacing:"0.0075em !important"},color:"inherit",variant:"h6",children:[y.gridLabel," ",i.subLabel]}),t("div",{children:[C&&t(eo,{onClick:u,children:[" ",x?m.t(x):m.t("new")]}),e(qg,{buttons:B})]})]}),e("div",{className:"ag-theme-alpine custom-grid",style:{height:i.height||"400px",width:"100%"},children:e(Tr,{onGridReady:l,...b,columnDefs:s,onFirstDataRendered:h,context:{...o,gridData:r,setGridData:n},rowData:I(r)?i.agGridProps?.rowData:r,rowHeight:30,headerHeight:35,onCellKeyDown:c,suppressClickEdit:!C,suppressCellFocus:!C,suppressHeaderFocus:!0,components:A,onCellEditingStopped:p,suppressMovableColumns:!0,noRowsOverlayComponent:f},a)})]})})}),Jg=(e,t)=>isNaN(new Date(e)?.getTime())?e:ze(new Date(e),t),Xg=(e,t,i)=>{if(!e||!Array.isArray(e))return"-";return au(e.reduce((e,i)=>{const r=Number(i[t.accessor]??0);return e+(isNaN(r)?0:r)},0),t?.isVisibleCurrSymbol?$o(t?.currencySymbol??i.dynamicAmountSymbol):"",t?.currencyFormat??i.currencyFormat,t?.decimalCount??i.decimalCount,t?.symbolPosition??"start")},Yg=(e,t)=>(e.data?e.data.reduce((e,i)=>{const r=Number(i[t.accessor]||0);return e+(isNaN(r)?0:r)},0):0)+(e.groups?e.groups.reduce((e,i)=>e+Yg(i,t),0):0);io(".layout-report-parent td{padding:6px 10px!important}.layout-report-parent thead tr{background:var(--theme-color4)}.layout-report-parent .group-name{align-items:center;display:flex;white-space:nowrap}.layout-report-parent .footer-row{background-color:var(--theme-color4)}.layout-report-parent .footer-row td{color:var(--theme-color1);font-size:.875rem;font-weight:600!important;white-space:nowrap}.layout-report-parent .footer-row.p0 td{padding:0!important}");function $g(e){return()=>e}function Zg(e){e()}function ew(e,t){return i=>e(t(i))}function tw(e,t){return()=>e(t)}function iw(e){return void 0!==e}function rw(){}function nw(e,t){return t(e),e}function aw(e,t){return t(e)}function sw(...e){return e}function ow(e,t){return e(1,t)}function lw(e,t){e(0,t)}function hw(e){e(2)}function cw(e){return e(4)}function dw(e,t){return ow(e,function(e,t){return i=>e(t,i)}(t,0))}function uw(e,t){const i=e(1,e=>{i(),t(e)});return i}function Aw(e){let t,i;return r=>n=>{t=n,i&&clearTimeout(i),i=setTimeout(()=>{r(t)},e)}}function pw(e,t){return e===t}function fw(e=pw){let t;return i=>r=>{e(t,r)||(t=r,i(r))}}function mw(e){return t=>i=>{e(i)&&t(i)}}function gw(e){return t=>ew(t,e)}function ww(e){return t=>()=>{t(e)}}function bw(e,...t){const i=function(...e){return t=>e.reduceRight(aw,t)}(...t);return(t,r)=>{switch(t){case 2:return void hw(e);case 1:return ow(e,i(r))}}}function vw(e,t){return i=>r=>{i(t=e(t,r))}}function yw(e){return t=>i=>{e>0?e--:t(i)}}function Bw(e){let t,i=null;return r=>n=>{i=n,!t&&(t=setTimeout(()=>{t=void 0,r(i)},e))}}function Cw(...e){const t=new Array(e.length);let i=0,r=null;const n=2**e.length-1;return e.forEach((e,a)=>{const s=2**a;ow(e,e=>{const o=i;i|=s,t[a]=e,o!==n&&i===n&&r&&(r(),r=null)})}),e=>a=>{const s=()=>{e([a].concat(t))};i===n?s():r=s}}function xw(e){let t=e;const i=Sw();return(e,r)=>{switch(e){case 0:t=r;break;case 1:r(t);break;case 4:return t}return i(e,r)}}function Fw(e,t){return nw(xw(t),t=>dw(e,t))}function Sw(){const e=[];return(t,i)=>{switch(t){case 0:return void e.slice().forEach(e=>{e(i)});case 2:return void e.splice(0,e.length);case 1:return e.push(i),()=>{const t=e.indexOf(i);t>-1&&e.splice(t,1)}}}}function Nw(e){return nw(Sw(),t=>dw(e,t))}function Ew(e,t=[],{singleton:i}={singleton:!0}){return{constructor:e,dependencies:t,id:kw(),singleton:i}}const kw=()=>Symbol();function Tw(...e){const t=Sw(),i=new Array(e.length);let r=0;const n=2**e.length-1;return e.forEach((e,a)=>{const s=2**a;ow(e,e=>{i[a]=e,r|=s,r===n&&lw(t,i)})}),function(e,a){switch(e){case 2:return void hw(t);case 1:return r===n&&a(i),ow(t,a)}}}function Lw(e,t=pw){return bw(e,fw(t))}function Iw(...e){return function(t,i){switch(t){case 2:return;case 1:return function(...e){return()=>{e.map(Zg)}}(...e.map(e=>ow(e,i)))}}}const Dw=0,Uw=1,Pw=2,Rw=3,Ow={[Dw]:"debug",[Rw]:"error",[Uw]:"log",[Pw]:"warn"},Qw=Ew(()=>{const e=xw(Rw);return{log:xw((t,i,r=Uw)=>{r>=((typeof globalThis>"u"?window:globalThis).VIRTUOSO_LOG_LEVEL??cw(e))&&console[Ow[r]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,i)}),logLevel:e}},[],{singleton:!0});function Hw(e,t,i){return Mw(e,t,i).callbackRef}function Mw(e,t,i){const n=r.useRef(null);let a=e=>{};const s=r.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(t=>{const r=()=>{const i=t[0].target;null!==i.offsetParent&&e(i)};i?r():requestAnimationFrame(r)}):null,[e,i]);return a=e=>{e&&t?(s?.observe(e),n.current=e):(n.current&&s?.unobserve(n.current),n.current=null)},{callbackRef:a,ref:n}}function _w(e,t,i,n,a,s,o,l,h){const c=r.useCallback(i=>{const r=function(e,t,i,r){const n=e.length;if(0===n)return null;const a=[];for(let s=0;s<n;s++){const n=e.item(s);if(void 0===n.dataset.index)continue;const o=parseInt(n.dataset.index),l=parseFloat(n.dataset.knownSize),h=t(n,i);if(0===h&&r("Zero-sized element, this should not happen",{child:n},Rw),h===l)continue;const c=a[a.length-1];0===a.length||c.size!==h||c.endIndex!==o-1?a.push({endIndex:o,size:h,startIndex:o}):a[a.length-1].endIndex++}return a}(i.children,t,"offsetHeight",a);let s=i.parentElement;for(;void 0===s.dataset.virtuosoScroller;)s=s.parentElement;const l="window"===s.lastElementChild.dataset.viewportType;let h;l&&(h=s.ownerDocument.defaultView);const c=o?o.scrollTop:l?h.scrollY||h.document.documentElement.scrollTop:s.scrollTop,d=o?o.scrollHeight:l?h.document.documentElement.scrollHeight:s.scrollHeight,u=o?o.offsetHeight:l?h.innerHeight:s.offsetHeight;n({scrollHeight:d,scrollTop:Math.max(c,0),viewportHeight:u}),null!==r&&e(r)},[e,t,a,s,o,n,l]);return Mw(c,i,h)}function jw(e,t,i){const n=r.useRef(null),a=r.useCallback(i=>{if(!i?.offsetParent)return;const r=i.getBoundingClientRect(),a=r.width;let s,l;if(t){const e=t.getBoundingClientRect(),i=r.top-e.top;l=e.height-Math.max(0,i),s=i+t.scrollTop}else{const e=o.current.ownerDocument.defaultView;l=e.innerHeight-Math.max(0,r.top),s=r.top+e.scrollY}n.current={offsetTop:s,visibleHeight:l,visibleWidth:a},e(n.current)},[e,t]),{callbackRef:s,ref:o}=Mw(a,!0,i),l=r.useCallback(()=>{a(o.current)},[a,o]);return r.useEffect(()=>{if(t){t.addEventListener("scroll",l);const e=new ResizeObserver(()=>{requestAnimationFrame(l)});return e.observe(t),()=>{t.removeEventListener("scroll",l),e.unobserve(t)}}const e=o.current?.ownerDocument.defaultView;return e?.addEventListener("scroll",l),e?.addEventListener("resize",l),()=>{e?.removeEventListener("scroll",l),e?.removeEventListener("resize",l)}},[l,t,o]),s}const zw=Ew(()=>{const e=Sw(),t=Sw(),i=xw(0),r=Sw(),n=xw(0),a=Sw(),s=Sw(),o=xw(0),l=xw(0),h=xw(0),c=xw(0),d=Sw(),u=Sw(),A=xw(!1),p=xw(!1),f=xw(!1);return dw(bw(e,gw(({scrollTop:e})=>e)),t),dw(bw(e,gw(({scrollHeight:e})=>e)),s),dw(t,n),{deviation:i,fixedFooterHeight:h,fixedHeaderHeight:l,footerHeight:c,headerHeight:o,horizontalDirection:p,scrollBy:u,scrollContainerState:e,scrollHeight:s,scrollingInProgress:A,scrollTo:d,scrollTop:t,skipAnimationFrameInResizeObserver:f,smoothScrollTargetReached:r,statefulScrollTop:n,viewportHeight:a}},[],{singleton:!0}),Vw={lvl:0};function Kw(e,t){const i=e.length;if(0===i)return[];let{index:r,value:n}=t(e[0]);const a=[];for(let s=1;s<i;s++){const{index:i,value:o}=t(e[s]);a.push({end:i-1,start:r,value:n}),r=i,n=o}return a.push({end:1/0,start:r,value:n}),a}function qw(e){return e===Vw}function Gw(e,t){if(!qw(e))return t===e.k?e.v:t<e.k?Gw(e.l,t):Gw(e.r,t)}function Ww(e,t,i="k"){if(qw(e))return[-1/0,void 0];if(Number(e[i])===t)return[e.k,e.v];if(Number(e[i])<t){const r=Ww(e.r,t,i);return r[0]===-1/0?[e.k,e.v]:r}return Ww(e.l,t,i)}function Jw(e,t,i){return qw(e)?sb(t,i,1):t===e.k?ib(e,{k:t,v:i}):t<e.k?ob(ib(e,{l:Jw(e.l,t,i)})):ob(ib(e,{r:Jw(e.r,t,i)}))}function Xw(){return Vw}function Yw(e,t,i){if(qw(e))return[];return function(e){return Kw(e,({k:e,v:t})=>({index:e,value:t}))}(eb(e,Ww(e,t)[0],i))}function $w(e,t){if(qw(e))return Vw;const{k:i,l:r,r:n}=e;if(t===i){if(qw(r))return n;if(qw(n))return r;const[t,i]=ab(r);return tb(ib(e,{k:t,l:rb(r),v:i}))}return tb(ib(e,t<i?{l:$w(r,t)}:{r:$w(n,t)}))}function Zw(e){return qw(e)?[]:[...Zw(e.l),{k:e.k,v:e.v},...Zw(e.r)]}function eb(e,t,i){if(qw(e))return[];const{k:r,l:n,r:a,v:s}=e;let o=[];return r>t&&(o=o.concat(eb(n,t,i))),r>=t&&r<=i&&o.push({k:r,v:s}),r<=i&&(o=o.concat(eb(a,t,i))),o}function tb(e){const{l:t,lvl:i,r:r}=e;if(r.lvl>=i-1&&t.lvl>=i-1)return e;if(i>r.lvl+1){if(nb(t))return lb(ib(e,{lvl:i-1}));if(!qw(t)&&!qw(t.r))return ib(t.r,{l:ib(t,{r:t.r.l}),lvl:i,r:ib(e,{l:t.r.r,lvl:i-1})});throw new Error("Unexpected empty nodes")}if(nb(e))return hb(ib(e,{lvl:i-1}));if(!qw(r)&&!qw(r.l)){const t=r.l,n=nb(t)?r.lvl-1:r.lvl;return ib(t,{l:ib(e,{lvl:i-1,r:t.l}),lvl:t.lvl+1,r:hb(ib(r,{l:t.r,lvl:n}))})}throw new Error("Unexpected empty nodes")}function ib(e,t){return sb(void 0!==t.k?t.k:e.k,void 0!==t.v?t.v:e.v,void 0!==t.lvl?t.lvl:e.lvl,void 0!==t.l?t.l:e.l,void 0!==t.r?t.r:e.r)}function rb(e){return qw(e.r)?e.l:tb(ib(e,{r:rb(e.r)}))}function nb(e){return qw(e)||e.lvl>e.r.lvl}function ab(e){return qw(e.r)?[e.k,e.v]:ab(e.r)}function sb(e,t,i,r=Vw,n=Vw){return{k:e,l:r,lvl:i,r:n,v:t}}function ob(e){return hb(lb(e))}function lb(e){const{l:t}=e;return qw(t)||t.lvl!==e.lvl?e:ib(t,{r:ib(e,{l:t.r})})}function hb(e){const{lvl:t,r:i}=e;return qw(i)||qw(i.r)||i.lvl!==t||i.r.lvl!==t?e:ib(i,{l:ib(e,{r:i.l}),lvl:t+1})}function cb(e,t){return!(!e||e.startIndex!==t.startIndex||e.endIndex!==t.endIndex)}function db(e,t){return!(!e||e[0]!==t[0]||e[1]!==t[1])}const ub=Ew(()=>({recalcInProgress:xw(!1)}),[],{singleton:!0});function Ab(e,t,i){return e[pb(e,t,i)]}function pb(e,t,i,r=0){let n=e.length-1;for(;r<=n;){const a=Math.floor((r+n)/2),s=i(e[a],t);if(0===s)return a;if(-1===s){if(n-r<2)return a-1;n=a-1}else{if(n===r)return a;r=a+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function fb(e,t){return Math.round(e.getBoundingClientRect()[t])}function mb(e){return!qw(e.groupOffsetTree)}function gb({index:e},t){return t===e?0:t<e?-1:1}function wb({offset:e},t){return t===e?0:t<e?-1:1}function bb(e,t,i){if(0===t.length)return 0;const{index:r,offset:n,size:a}=Ab(t,e,gb),s=e-r,o=a*s+(s-1)*i+n;return o>0?o+i:o}function vb(e,t){if(!mb(t))return e;let i=0;for(;t.groupIndices[i]<=e+i;)i++;return e+i}function yb(e,t,i){if(function(e){return typeof e.groupIndex<"u"}(e))return t.groupIndices[e.groupIndex]+1;let r=vb("LAST"===e.index?i:e.index,t);return r=Math.max(0,r,Math.min(i,r)),r}function Bb(e,t,i,r=0){return r>0&&(t=Math.max(t,Ab(e,r,gb).offset)),Kw(function(e,t,i,r){const n=pb(e,t,r),a=pb(e,i,r,n);return e.slice(n,a+1)}(e,t,i,wb),Sb)}function Cb(e,[t,i,r,n]){t.length>0&&r("received item sizes",t,Dw);const a=e.sizeTree;let s=a,o=0;if(i.length>0&&qw(a)&&2===t.length){const e=t[0].size,r=t[1].size;s=i.reduce((t,i)=>Jw(Jw(t,i,e),i+1,r),s)}else[s,o]=function(e,t){let i=qw(e)?0:1/0;for(const r of t){const{endIndex:t,size:n,startIndex:a}=r;if(i=Math.min(i,a),qw(e)){e=Jw(e,0,n);continue}const s=Yw(e,a-1,t+1);if(s.some(Nb(r)))continue;let o=!1,l=!1;for(const{end:i,start:r,value:a}of s)o?(t>=r||n===a)&&(e=$w(e,r)):(l=a!==n,o=!0),i>t&&t>=r&&a!==n&&(e=Jw(e,t+1,a));l&&(e=Jw(e,a,n))}return[e,i]}(s,t);if(s===a)return e;const{lastIndex:l,lastOffset:h,lastSize:c,offsetTree:d}=Fb(e.offsetTree,o,s,n);return{groupIndices:i,groupOffsetTree:i.reduce((e,t)=>Jw(e,t,bb(t,d,n)),Xw()),lastIndex:l,lastOffset:h,lastSize:c,offsetTree:d,sizeTree:s}}function xb(e,t){let i=0,r=0;for(;i<e;)i+=t[r+1]-t[r]-1,r++;return r-(i===e?0:1)}function Fb(e,t,i,r){let n=e,a=0,s=0,o=0,l=0;if(0!==t){l=pb(n,t-1,gb),o=n[l].offset;const e=Ww(i,t-1);a=e[0],s=e[1],n.length&&n[l].size===Ww(i,t)[1]&&(l-=1),n=n.slice(0,l+1)}else n=[];for(const{start:e,value:l}of Yw(i,t,1/0)){const t=e-a,i=t*s+o+t*r;n.push({index:e,offset:i,size:l}),a=e,o=i,s=l}return{lastIndex:a,lastOffset:o,lastSize:s,offsetTree:n}}function Sb(e){return{index:e.index,value:e}}function Nb(e){const{endIndex:t,size:i,startIndex:r}=e;return e=>e.start===r&&(e.end===t||e.end===1/0)&&e.value===i}const Eb={offsetHeight:"height",offsetWidth:"width"},kb=Ew(([{log:e},{recalcInProgress:t}])=>{const i=Sw(),r=Sw(),n=Fw(r,0),a=Sw(),s=Sw(),o=xw(0),l=xw([]),h=xw(void 0),c=xw(void 0),d=xw(void 0),u=xw(void 0),A=xw((e,t)=>fb(e,Eb[t])),p=xw(void 0),f=xw(0),m={groupIndices:[],groupOffsetTree:Xw(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:Xw()},g=Fw(bw(i,Cw(l,e,f),vw(Cb,m),fw()),m),w=Fw(bw(l,fw(),vw((e,t)=>({current:t,prev:e.current}),{current:[],prev:[]}),gw(({prev:e})=>e)),[]);dw(bw(l,mw(e=>e.length>0),Cw(g,f),gw(([e,t,i])=>{const r=e.reduce((e,r,n)=>Jw(e,r,bb(r,t.offsetTree,i)||n),Xw());return{...t,groupIndices:e,groupOffsetTree:r}})),g),dw(bw(r,Cw(g),mw(([e,{lastIndex:t}])=>e<t),gw(([e,{lastIndex:t,lastSize:i}])=>[{endIndex:t,size:i,startIndex:e}])),i),dw(h,c);const b=Fw(bw(h,gw(e=>void 0===e)),!0);dw(bw(c,mw(e=>void 0!==e&&qw(cw(g).sizeTree)),gw(e=>{const t=cw(d),i=cw(l).length>0;return void 0!==t&&0!==t?i?[{endIndex:0,size:t,startIndex:0},{endIndex:1,size:e,startIndex:1}]:[]:[{endIndex:0,size:e,startIndex:0}]})),i),dw(bw(u,mw(e=>void 0!==e&&e.length>0&&qw(cw(g).sizeTree)),gw(e=>{const t=[];let i=e[0],r=0;for(let n=1;n<e.length;n++){const a=e[n];a!==i&&(t.push({endIndex:n-1,size:i,startIndex:r}),i=a,r=n)}return t.push({endIndex:e.length-1,size:i,startIndex:r}),t})),i),dw(bw(l,Cw(d,c),mw(([,e,t])=>void 0!==e&&void 0!==t),gw(([e,t,i])=>{const r=[];for(let n=0;n<e.length;n++){const a=e[n],s=e[n+1];r.push({startIndex:a,endIndex:a,size:t}),void 0!==s&&r.push({startIndex:a+1,endIndex:s-1,size:i})}return r})),i);const v=Nw(bw(i,Cw(g),vw(({sizes:e},[t,i])=>({changed:i!==e,sizes:i}),{changed:!1,sizes:m}),gw(e=>e.changed)));ow(bw(o,vw((e,t)=>({diff:e.prev-t,prev:t}),{diff:0,prev:0}),gw(e=>e.diff)),e=>{const{groupIndices:i}=cw(g);if(e>0)lw(t,!0),lw(a,e+xb(e,i));else if(e<0){const t=cw(w);t.length>0&&(e-=xb(-e,t)),lw(s,e)}}),ow(bw(o,Cw(e)),([e,t])=>{e<0&&t("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:o},Rw)});const y=Nw(a);dw(bw(a,Cw(g),gw(([e,t])=>{const i=t.groupIndices.length>0,r=[],n=t.lastSize;if(i){const i=Gw(t.sizeTree,0);let a=0,s=0;for(;a<e;){const e=t.groupIndices[s],o=t.groupIndices.length===s+1?1/0:t.groupIndices[s+1]-e-1;r.push({endIndex:e,size:i,startIndex:e}),r.push({endIndex:e+1+o-1,size:n,startIndex:e+1}),s++,a+=o+1}const o=Zw(t.sizeTree);return a!==e&&o.shift(),o.reduce((t,{k:i,v:r})=>{let n=t.ranges;return 0!==t.prevSize&&(n=[...t.ranges,{endIndex:i+e-1,size:t.prevSize,startIndex:t.prevIndex}]),{prevIndex:i+e,prevSize:r,ranges:n}},{prevIndex:e,prevSize:0,ranges:r}).ranges}return Zw(t.sizeTree).reduce((t,{k:i,v:r})=>({prevIndex:i+e,prevSize:r,ranges:[...t.ranges,{endIndex:i+e-1,size:t.prevSize,startIndex:t.prevIndex}]}),{prevIndex:0,prevSize:n,ranges:[]}).ranges})),i);const B=Nw(bw(s,Cw(g,f),gw(([e,{offsetTree:t},i])=>bb(-e,t,i))));return dw(bw(s,Cw(g,f),gw(([e,t,i])=>{if(t.groupIndices.length>0){if(qw(t.sizeTree))return t;let r=Xw();const n=cw(w);let a=0,s=0,o=0;for(;a<-e;){o=n[s];const e=n[s+1]-o-1;s++,a+=e+1}if(r=Zw(t.sizeTree).reduce((t,{k:i,v:r})=>Jw(t,Math.max(0,i+e),r),r),a!==-e){r=Jw(r,0,Gw(t.sizeTree,o));r=Jw(r,1,Ww(t.sizeTree,1-e)[1])}return{...t,sizeTree:r,...Fb(t.offsetTree,0,r,i)}}const r=Zw(t.sizeTree).reduce((t,{k:i,v:r})=>Jw(t,Math.max(0,i+e),r),Xw());return{...t,sizeTree:r,...Fb(t.offsetTree,0,r,i)}})),g),{beforeUnshiftWith:y,data:p,defaultItemSize:c,firstItemIndex:o,fixedItemSize:h,fixedGroupSize:d,gap:f,groupIndices:l,heightEstimates:u,itemSize:A,listRefresh:v,shiftWith:s,shiftWithOffset:B,sizeRanges:i,sizes:g,statefulTotalCount:n,totalCount:r,trackItemSizes:b,unshiftWith:a}},sw(Qw,ub),{singleton:!0});function Tb(e){return e.reduce((e,t)=>(e.groupIndices.push(e.totalCount),e.totalCount+=t+1,e),{groupIndices:[],totalCount:0})}const Lb=Ew(([{groupIndices:e,sizes:t,totalCount:i},{headerHeight:r,scrollTop:n}])=>{const a=Sw(),s=Sw(),o=Nw(bw(a,gw(Tb)));return dw(bw(o,gw(e=>e.totalCount)),i),dw(bw(o,gw(e=>e.groupIndices)),e),dw(bw(Tw(n,t,r),mw(([e,t])=>mb(t)),gw(([e,t,i])=>Ww(t.groupOffsetTree,Math.max(e-i,0),"v")[0]),fw(),gw(e=>[e])),s),{groupCounts:a,topItemsIndexes:s}},sw(kb,zw)),Ib=Ew(([{log:e}])=>{const t=xw(!1),i=Nw(bw(t,mw(e=>e),fw()));return ow(t,t=>{t&&cw(e)("props updated",{},Dw)}),{didMount:i,propsReady:t}},sw(Qw),{singleton:!0}),Db=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function Ub(e){const t="number"==typeof e?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!Db)&&(t.behavior="auto"),void 0===t.offset&&(t.offset=0),t}const Pb=Ew(([{gap:e,listRefresh:t,sizes:i,totalCount:r},{fixedFooterHeight:n,fixedHeaderHeight:a,footerHeight:s,headerHeight:o,scrollingInProgress:l,scrollTo:h,smoothScrollTargetReached:c,viewportHeight:d},{log:u}])=>{const A=Sw(),p=Sw(),f=xw(0);let m=null,g=null,w=null;function b(){null!==m&&(m(),m=null),null!==w&&(w(),w=null),g&&(clearTimeout(g),g=null),lw(l,!1)}return dw(bw(A,Cw(i,d,r,f,o,s,u),Cw(e,a,n),gw(([[e,i,r,n,a,s,o,h],d,u,f])=>{const v=Ub(e),{align:y,behavior:B,offset:C}=v,x=n-1,F=yb(v,i,x);let S=bb(F,i.offsetTree,d)+s;"end"===y?(S+=u+Ww(i.sizeTree,F)[1]-r+f,F===x&&(S+=o)):"center"===y?S+=(u+Ww(i.sizeTree,F)[1]-r+f)/2:S-=a,void 0!==C&&0!==C&&(S+=C);const N=t=>{b(),t?(h("retrying to scroll to",{location:e},Dw),lw(A,e)):(lw(p,!0),h("list did not change, scroll successful",{},Dw))};if(b(),"smooth"===B){let e=!1;w=ow(t,t=>{e=e||t}),m=uw(c,()=>{N(e)})}else m=uw(bw(t,function(e){return t=>{const i=setTimeout(()=>{t(!1)},e);return e=>{e&&(t(!0),clearTimeout(i))}}}(150)),N);return g=setTimeout(()=>{b()},1200),lw(l,!0),h("scrolling from index to",{behavior:B,index:F,top:S},Dw),{behavior:B,top:S}})),h),{scrollTargetReached:p,scrollToIndex:A,topListHeight:f}},sw(kb,zw,Qw),{singleton:!0});function Rb(e,t){0===e?t():requestAnimationFrame(()=>{Rb(e-1,t)})}function Ob(e,t){const i=t-1;return"number"==typeof e?e:"LAST"===e.index?i:e.index}const Qb=Ew(([{defaultItemSize:e,listRefresh:t,sizes:i},{scrollTop:r},{scrollTargetReached:n,scrollToIndex:a},{didMount:s}])=>{const o=xw(!0),l=xw(0),h=xw(!0);return dw(bw(s,Cw(l),mw(([e,t])=>0!==t),ww(!1)),o),dw(bw(s,Cw(l),mw(([e,t])=>0!==t),ww(!1)),h),ow(bw(Tw(t,s),Cw(o,i,e,h),mw(([[,e],t,{sizeTree:i},r,n])=>e&&(!qw(i)||iw(r))&&!t&&!n),Cw(l)),([,e])=>{uw(n,()=>{lw(h,!0)}),Rb(4,()=>{uw(r,()=>{lw(o,!0)}),lw(a,e)})}),{initialItemFinalLocationReached:h,initialTopMostItemIndex:l,scrolledToInitialItem:o}},sw(kb,zw,Pb,Ib),{singleton:!0});function Hb(e,t){return Math.abs(e-t)<1.01}const Mb="up",_b="down",jb={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},zb=Ew(([{footerHeight:e,headerHeight:t,scrollBy:i,scrollContainerState:r,scrollTop:n,viewportHeight:a}])=>{const s=xw(!1),o=xw(!0),l=Sw(),h=Sw(),c=xw(4),d=xw(0),u=Fw(bw(Iw(bw(Lw(n),yw(1),ww(!0)),bw(Lw(n),yw(1),ww(!1),Aw(100))),fw()),!1),A=Fw(bw(Iw(bw(i,ww(!0)),bw(i,ww(!1),Aw(200))),fw()),!1);dw(bw(Tw(Lw(n),Lw(d)),gw(([e,t])=>e<=t),fw()),o),dw(bw(o,Bw(50)),h);const p=Nw(bw(Tw(r,Lw(a),Lw(t),Lw(e),Lw(c)),vw((e,[{scrollHeight:t,scrollTop:i},r,n,a,s])=>{const o={scrollHeight:t,scrollTop:i,viewportHeight:r};if(i+r-t>-s){let t,r;return i>e.state.scrollTop?(t="SCROLLED_DOWN",r=e.state.scrollTop-i):(t="SIZE_DECREASED",r=e.state.scrollTop-i||e.scrollTopDelta),{atBottom:!0,atBottomBecause:t,scrollTopDelta:r,state:o}}let l;return l=o.scrollHeight>e.state.scrollHeight?"SIZE_INCREASED":r<e.state.viewportHeight?"VIEWPORT_HEIGHT_DECREASING":i<e.state.scrollTop?"SCROLLING_UPWARDS":"NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:l,state:o}},jb),fw((e,t)=>void 0!==e&&e.atBottom===t.atBottom))),f=Fw(bw(r,vw((e,{scrollHeight:t,scrollTop:i,viewportHeight:r})=>{if(!Hb(e.scrollHeight,t)){const n=t-(i+r)<1;return e.scrollTop!==i&&n?{changed:!0,jump:e.scrollTop-i,scrollHeight:t,scrollTop:i}:{changed:!0,jump:0,scrollHeight:t,scrollTop:i}}return{changed:!1,jump:0,scrollHeight:t,scrollTop:i}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),mw(e=>e.changed),gw(e=>e.jump)),0);dw(bw(p,gw(e=>e.atBottom)),s),dw(bw(s,Bw(50)),l);const m=xw(_b);dw(bw(r,gw(({scrollTop:e})=>e),fw(),vw((e,t)=>cw(A)?{direction:e.direction,prevScrollTop:t}:{direction:t<e.prevScrollTop?Mb:_b,prevScrollTop:t},{direction:_b,prevScrollTop:0}),gw(e=>e.direction)),m),dw(bw(r,Bw(50),ww("none")),m);const g=xw(0);return dw(bw(u,mw(e=>!e),ww(0)),g),dw(bw(n,Bw(100),Cw(u),mw(([e,t])=>t),vw(([e,t],[i])=>[t,i],[0,0]),gw(([e,t])=>t-e)),g),{atBottomState:p,atBottomStateChange:l,atBottomThreshold:c,atTopStateChange:h,atTopThreshold:d,isAtBottom:s,isAtTop:o,isScrolling:u,lastJumpDueToItemResize:f,scrollDirection:m,scrollVelocity:g}},sw(zw)),Vb="top",Kb="bottom",qb="none";function Gb(e,t,i){return"number"==typeof e?i===Mb&&t===Vb||i===_b&&t===Kb?e:0:i===Mb?t===Vb?e.main:e.reverse:t===Kb?e.main:e.reverse}function Wb(e,t){return"number"==typeof e?e:e[t]??0}const Jb=Ew(([{deviation:e,fixedHeaderHeight:t,headerHeight:i,scrollTop:r,viewportHeight:n}])=>{const a=Sw(),s=xw(0),o=xw(0),l=xw(0),h=Fw(bw(Tw(Lw(r),Lw(n),Lw(i),Lw(a,db),Lw(l),Lw(s),Lw(t),Lw(e),Lw(o)),gw(([e,t,i,[r,n],a,s,o,l,h])=>{const c=e-l,d=s+o,u=Math.max(i-c,0);let A=qb;const p=Wb(h,Vb),f=Wb(h,Kb);return r-=l,n+=i+o,(r+=i+o)>e+d-p&&(A=Mb),(n-=l)<e-u+t+f&&(A=_b),A!==qb?[Math.max(c-i-Gb(a,Vb,A)-p,0),c-u-o+t+Gb(a,Kb,A)+f]:null}),mw(e=>null!==e),fw(db)),[0,0]);return{increaseViewportBy:o,listBoundary:a,overscan:l,topListHeight:s,visibleRange:h}},sw(zw),{singleton:!0});const Xb={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function Yb(e,t,i,r,n,a){const{lastIndex:s,lastOffset:o,lastSize:l}=n;let h=0,c=0;if(e.length>0){h=e[0].offset;const t=e[e.length-1];c=t.offset+t.size}const d=i-s,u=h,A=o+d*l+(d-1)*r-c;return{bottom:c,firstItemIndex:a,items:Zb(e,n,a),offsetBottom:A,offsetTop:h,top:u,topItems:Zb(t,n,a),topListHeight:t.reduce((e,t)=>t.size+e,0),totalCount:i}}function $b(e,t,i,r,n,a){let s=0;if(i.groupIndices.length>0)for(const t of i.groupIndices){if(t-s>=e)break;s++}const o=e+s,l=Ob(t,o);return Yb(Array.from({length:o}).map((e,t)=>({data:a[t+l],index:t+l,offset:0,size:0})),[],o,n,i,r)}function Zb(e,t,i){if(0===e.length)return[];if(!mb(t))return e.map(e=>({...e,index:e.index+i,originalIndex:e.index}));const r=e[0].index,n=e[e.length-1].index,a=[],s=Yw(t.groupOffsetTree,r,n);let o,l=0;for(const r of e){let e;(!o||o.end<r.index)&&(o=s.shift(),l=t.groupIndices.indexOf(o.start)),e=r.index===o.start?{index:l,type:"group"}:{groupIndex:l,index:r.index-(l+1)+i},a.push({...e,data:r.data,offset:r.offset,originalIndex:r.index,size:r.size})}return a}function ev(e,t){return void 0===e?0:"number"==typeof e?e:e[t]??0}const tv=Ew(([{data:e,firstItemIndex:t,gap:i,sizes:r,totalCount:n},a,{listBoundary:s,topListHeight:o,visibleRange:l},{initialTopMostItemIndex:h,scrolledToInitialItem:c},{topListHeight:d},u,{didMount:A},{recalcInProgress:p}])=>{const f=xw([]),m=xw(0),g=Sw(),w=xw(0);dw(a.topItemsIndexes,f);const b=Fw(bw(Tw(A,p,Lw(l,db),Lw(n),Lw(r),Lw(h),c,Lw(f),Lw(t),Lw(i),Lw(w),e),mw(([e,t,,i,,,,,,,,r])=>{const n=void 0!==r&&r.length!==i;return e&&!t&&!n}),gw(([,,[e,t],i,r,n,a,s,o,l,h,c])=>{const d=r,{offsetTree:u,sizeTree:A}=d,p=cw(m);if(0===i)return{...Xb,totalCount:i};if(0===e&&0===t)return 0===p?{...Xb,totalCount:i}:$b(p,n,r,o,l,c||[]);if(qw(A))return p>0?null:Yb(function(e,t,i){if(mb(t)){const r=vb(e,t);return[{index:Ww(t.groupOffsetTree,r)[0],offset:0,size:0},{data:i?.[0],index:r,offset:0,size:0}]}return[{data:i?.[0],index:e,offset:0,size:0}]}(Ob(n,i),d,c),[],i,l,d,o);const f=[];if(s.length>0){const e=s[0],t=s[s.length-1];let i=0;for(const r of Yw(A,e,t)){const n=r.value,a=Math.max(r.start,e),s=Math.min(r.end,t);for(let e=a;e<=s;e++)f.push({data:c?.[e],index:e,offset:i,size:n}),i+=n}}if(!a)return Yb([],f,i,l,d,o);const g=s.length>0?s[s.length-1]+1:0,w=Bb(u,e,t,g);if(0===w.length)return null;const b=i-1,v=nw([],i=>{for(const r of w){const n=r.value;let a=n.offset,s=r.start;const o=n.size;if(n.offset<e){s+=Math.floor((e-n.offset+l)/(o+l));const t=s-r.start;a+=t*o+t*l}s<g&&(a+=(g-s)*o,s=g);const h=Math.min(r.end,b);for(let e=s;e<=h&&!(a>=t);e++)i.push({data:c?.[e],index:e,offset:a,size:o}),a+=o+l}}),y=ev(h,Vb),B=ev(h,Kb);if(v.length>0&&(y>0||B>0)){const e=v[0],t=v[v.length-1];if(y>0&&e.index>g){const t=Math.min(y,e.index-g),i=[];let r=e.offset;for(let n=e.index-1;n>=e.index-t;n--){const t=Yw(A,n,n)[0]?.value??e.size;r-=t+l,i.unshift({data:c?.[n],index:n,offset:r,size:t})}v.unshift(...i)}if(B>0&&t.index<b){const e=Math.min(B,b-t.index);let i=t.offset+t.size+l;for(let r=t.index+1;r<=t.index+e;r++){const e=Yw(A,r,r)[0]?.value??t.size;v.push({data:c?.[r],index:r,offset:i,size:e}),i+=e+l}}}return Yb(v,f,i,l,d,o)}),mw(e=>null!==e),fw()),Xb);dw(bw(e,mw(iw),gw(e=>e?.length)),n),dw(bw(b,gw(e=>e.topListHeight)),d),dw(d,o),dw(bw(b,gw(e=>[e.top,e.bottom])),s),dw(bw(b,gw(e=>e.items)),g);const v=Nw(bw(b,mw(({items:e})=>e.length>0),Cw(n,e),mw(([{items:e},t])=>e[e.length-1].originalIndex===t-1),gw(([,e,t])=>[e-1,t]),fw(db),gw(([e])=>e))),y=Nw(bw(b,Bw(200),mw(({items:e,topItems:t})=>e.length>0&&e[0].originalIndex===t.length),gw(({items:e})=>e[0].index),fw())),B=Nw(bw(b,mw(({items:e})=>e.length>0),gw(({items:e})=>{let t=0,i=e.length-1;for(;"group"===e[t].type&&t<i;)t++;for(;"group"===e[i].type&&i>t;)i--;return{endIndex:e[i].index,startIndex:e[t].index}}),fw(cb)));return{endReached:v,initialItemCount:m,itemsRendered:g,listState:b,minOverscanItemCount:w,rangeChanged:B,startReached:y,topItemsIndexes:f,...u}},sw(kb,Lb,Jb,Qb,Pb,zb,Ib,ub),{singleton:!0}),iv=Ew(([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:i,headerHeight:r},{listState:n}])=>{const a=Sw(),s=Fw(bw(Tw(i,e,r,t,n),gw(([e,t,i,r,n])=>e+t+i+r+n.offsetBottom+n.bottom)),0);return dw(Lw(s),a),{totalListHeight:s,totalListHeightChanged:a}},sw(zw,tv),{singleton:!0}),rv=Ew(([{viewportHeight:e},{totalListHeight:t}])=>{const i=xw(!1);return{alignToBottom:i,paddingTopAddition:Fw(bw(Tw(i,e,t),mw(([e])=>e),gw(([,e,t])=>Math.max(0,e-t)),Bw(0),fw()),0)}},sw(zw,iv),{singleton:!0}),nv=Ew(()=>({context:xw(null)})),av=({itemBottom:e,itemTop:t,locationParams:{align:i,behavior:r,...n},viewportBottom:a,viewportTop:s})=>t<s?{...n,align:i??"start",...void 0!==r?{behavior:r}:{}}:e>a?{...n,align:i??"end",...void 0!==r?{behavior:r}:{}}:null,sv=Ew(([{gap:e,sizes:t,totalCount:i},{fixedFooterHeight:r,fixedHeaderHeight:n,headerHeight:a,scrollingInProgress:s,scrollTop:o,viewportHeight:l},{scrollToIndex:h}])=>{const c=Sw();return dw(bw(c,Cw(t,l,i,a,n,r,o),Cw(e),gw(([[e,t,i,r,n,a,o,l],h])=>{const{calculateViewLocation:c=av,done:d,...u}=e,A=yb(e,t,r-1),p=bb(A,t.offsetTree,h)+n+a,f=c({itemBottom:p+Ww(t.sizeTree,A)[1],itemTop:p,locationParams:u,viewportBottom:l+i-o,viewportTop:l+a});return null!==f?d&&uw(bw(s,mw(e=>!e),yw(cw(s)?1:2)),d):d?.(),f}),mw(e=>null!==e)),h),{scrollIntoView:c}},sw(kb,zw,Pb,tv,Qw),{singleton:!0});function ov(e){return!1!==e&&("smooth"===e?"smooth":"auto")}const lv=Ew(([{listRefresh:e,totalCount:t,fixedItemSize:i,data:r},{atBottomState:n,isAtBottom:a},{scrollToIndex:s},{scrolledToInitialItem:o},{didMount:l,propsReady:h},{log:c},{scrollingInProgress:d},{context:u},{scrollIntoView:A}])=>{const p=xw(!1),f=Sw();let m=null;function g(e){lw(s,{align:"end",behavior:e,index:"LAST"})}function w(e){const t=uw(n,t=>{e&&!t.atBottom&&"SIZE_INCREASED"===t.notAtBottomBecause&&null===m&&(cw(c)("scrolling to bottom due to increased size",{},Dw),g("auto"))});setTimeout(t,100)}ow(bw(Tw(bw(Lw(t),yw(1)),l),Cw(Lw(p),a,o,d),gw(([[e,t],i,r,n,a])=>{let s=t&&n,o="auto";return s&&(o=((e,t)=>"function"==typeof e?ov(e(t)):t&&ov(e))(i,r||a),s=s&&!1!==o),{followOutputBehavior:o,shouldFollow:s,totalCount:e}}),mw(({shouldFollow:e})=>e)),({followOutputBehavior:t,totalCount:r})=>{null!==m&&(m(),m=null),void 0!==cw(i)?requestAnimationFrame(()=>{cw(c)("following output to ",{totalCount:r},Dw),g(t)}):m=uw(e,()=>{cw(c)("following output to ",{totalCount:r},Dw),g(t),m=null})}),ow(bw(Tw(Lw(p),t,h),mw(([e,,t])=>!1!==e&&t),vw(({value:e},[,t])=>({refreshed:e===t,value:t}),{refreshed:!1,value:0}),mw(({refreshed:e})=>e),Cw(p,t)),([,e])=>{cw(o)&&w(!1!==e)}),ow(f,()=>{w(!1!==cw(p))}),ow(Tw(Lw(p),n),([e,t])=>{!1!==e&&!t.atBottom&&"VIEWPORT_HEIGHT_DECREASING"===t.notAtBottomBecause&&g("auto")});const b=xw(null),v=Sw();return dw(Iw(bw(Lw(r),gw(e=>e?.length??0)),bw(Lw(t))),v),ow(bw(Tw(bw(v,yw(1)),l),Cw(Lw(b),o,d,u),gw(([[e,t],i,r,n,a])=>t&&r&&i?.({context:a,totalCount:e,scrollingInProgress:n})),mw(e=>!!e),Bw(0)),t=>{null!==m&&(m(),m=null),void 0!==cw(i)?requestAnimationFrame(()=>{cw(c)("scrolling into view",{}),lw(A,t)}):m=uw(e,()=>{cw(c)("scrolling into view",{}),lw(A,t),m=null})}),{autoscrollToBottom:f,followOutput:p,scrollIntoViewOnChange:b}},sw(kb,zb,Pb,Qb,Ib,Qw,zw,nv,sv)),hv=Ew(([{data:e,firstItemIndex:t,gap:i,sizes:r},{initialTopMostItemIndex:n},{initialItemCount:a,listState:s},{didMount:o}])=>(dw(bw(o,Cw(a),mw(([,e])=>0!==e),Cw(n,r,t,i,e),gw(([[,e],t,i,r,n,a=[]])=>$b(e,t,i,r,n,a))),s),{}),sw(kb,Qb,tv,Ib),{singleton:!0}),cv=Ew(([{didMount:e},{scrollTo:t},{listState:i}])=>{const r=xw(0);return ow(bw(e,Cw(r),mw(([,e])=>0!==e),gw(([,e])=>({top:e}))),e=>{uw(bw(i,yw(1),mw(e=>e.items.length>1)),()=>{requestAnimationFrame(()=>{lw(t,e)})})}),{initialScrollTop:r}},sw(Ib,zw,tv),{singleton:!0}),dv=Ew(([{scrollVelocity:e}])=>{const t=xw(!1),i=Sw(),r=xw(!1);return dw(bw(e,Cw(r,t,i),mw(([e,t])=>!1!==t&&void 0!==t),gw(([e,t,i,r])=>{const{enter:n,exit:a}=t;if(i){if(a(e,r))return!1}else if(n(e,r))return!0;return i}),fw()),t),ow(bw(Tw(t,e,i),Cw(r)),([[e,t,i],r])=>{e&&!1!==r&&void 0!==r&&r.change&&r.change(t,i)}),{isSeeking:t,scrollSeekConfiguration:r,scrollSeekRangeChanged:i,scrollVelocity:e}},sw(zb),{singleton:!0}),uv=Ew(([{scrollContainerState:e,scrollTo:t}])=>{const i=Sw(),r=Sw(),n=Sw(),a=xw(!1),s=xw(void 0);return dw(bw(Tw(i,r),gw(([{scrollHeight:e,scrollTop:t,viewportHeight:i},{offsetTop:r}])=>({scrollHeight:e,scrollTop:Math.max(0,t-r),viewportHeight:i}))),e),dw(bw(t,Cw(r),gw(([e,{offsetTop:t}])=>({...e,top:e.top+t}))),n),{customScrollParent:s,useWindowScroll:a,windowScrollContainerState:i,windowScrollTo:n,windowViewportRect:r}},sw(zw)),Av=Ew(([{sizeRanges:e,sizes:t},{headerHeight:i,scrollTop:r},{initialTopMostItemIndex:n},{didMount:a},{useWindowScroll:s,windowScrollContainerState:o,windowViewportRect:l}])=>{const h=Sw(),c=xw(void 0),d=xw(null),u=xw(null);return dw(o,d),dw(l,u),ow(bw(h,Cw(t,r,s,d,u,i)),([e,t,i,r,n,a,s])=>{const o=function(e){return Zw(e).map(({k:e,v:t},i,r)=>{const n=r[i+1];return{endIndex:void 0!==n?n.k-1:1/0,size:t,startIndex:e}})}(t.sizeTree);r&&null!==n&&null!==a&&(i=n.scrollTop-a.offsetTop),e({ranges:o,scrollTop:i-=s})}),dw(bw(c,mw(iw),gw(pv)),n),dw(bw(a,Cw(c),mw(([,e])=>void 0!==e),fw(),gw(([,e])=>e.ranges)),e),{getState:h,restoreStateFrom:c}},sw(kb,zw,Qb,Ib,uv));function pv(e){return{align:"start",index:0,offset:e.scrollTop}}const fv=Ew(([{topItemsIndexes:e}])=>{const t=xw(0);return dw(bw(t,mw(e=>e>=0),gw(e=>Array.from({length:e}).map((e,t)=>t))),e),{topItemCount:t}},sw(tv));function mv(e){let t,i=!1;return()=>(i||(i=!0,t=e()),t)}const gv=mv(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),wv=Ew(([{deviation:e,scrollBy:t,scrollingInProgress:i,scrollTop:r},{isAtBottom:n,isScrolling:a,lastJumpDueToItemResize:s,scrollDirection:o},{listState:l},{beforeUnshiftWith:h,gap:c,shiftWithOffset:d,sizes:u},{log:A},{recalcInProgress:p}])=>{const f=Nw(bw(l,Cw(s),vw(([,e,t,i],[{bottom:r,items:n,offsetBottom:a,totalCount:s},o])=>{const l=r+a;let h=0;return t===s&&e.length>0&&n.length>0&&(0===n[0].originalIndex&&0===e[0].originalIndex||(h=l-i,0!==h&&(h+=o))),[h,n,s,l]},[0,[],0,0]),mw(([e])=>0!==e),Cw(r,o,i,n,A,p),mw(([,e,t,i,,,r])=>!r&&!i&&0!==e&&t===Mb),gw(([[e],,,,,t])=>(t("Upward scrolling compensation",{amount:e},Dw),e))));function m(i){i>0?(lw(t,{behavior:"auto",top:-i}),lw(e,0)):(lw(e,0),lw(t,{behavior:"auto",top:-i}))}return ow(bw(f,Cw(e,a)),([t,i,r])=>{r&&gv()?lw(e,i-t):m(-t)}),ow(bw(Tw(Fw(a,!1),e,p),mw(([e,t,i])=>!e&&!i&&0!==t),gw(([e,t])=>t),Bw(1)),m),dw(bw(d,gw(e=>({top:-e}))),t),ow(bw(h,Cw(u,c),gw(([e,{groupIndices:t,lastSize:i,sizeTree:r},n])=>{function a(e){return e*(i+n)}if(0===t.length)return a(e);let s=0;const o=Gw(r,0);let l=0,h=0;for(;l<e;){l++,s+=o;let i=t.length===h+1?1/0:t[h+1]-t[h]-1;l+i>e&&(s-=o,i=e-l+1),l+=i,s+=a(i),h++}return s})),i=>{lw(e,i),requestAnimationFrame(()=>{lw(t,{top:i}),requestAnimationFrame(()=>{lw(e,0),lw(p,!1)})})}),{deviation:e}},sw(zw,zb,tv,kb,Qw,ub)),bv=Ew(([e,t,i,r,n,a,s,o,l,h,c])=>({...e,...t,...i,...r,...n,...a,...s,...o,...l,...h,...c}),sw(Jb,hv,Ib,dv,iv,cv,rv,uv,sv,Qw,nv)),vv=Ew(([{data:e,defaultItemSize:t,firstItemIndex:i,fixedItemSize:r,fixedGroupSize:n,gap:a,groupIndices:s,heightEstimates:o,itemSize:l,sizeRanges:h,sizes:c,statefulTotalCount:d,totalCount:u,trackItemSizes:A},{initialItemFinalLocationReached:p,initialTopMostItemIndex:f,scrolledToInitialItem:m},g,w,b,v,{scrollToIndex:y},B,{topItemCount:C},{groupCounts:x},F])=>{const{listState:S,minOverscanItemCount:N,topItemsIndexes:E,rangeChanged:k,...T}=v;return dw(k,F.scrollSeekRangeChanged),dw(bw(F.windowViewportRect,gw(e=>e.visibleHeight)),g.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:i,fixedItemHeight:r,fixedGroupHeight:n,gap:a,groupCounts:x,heightEstimates:o,initialItemFinalLocationReached:p,initialTopMostItemIndex:f,scrolledToInitialItem:m,sizeRanges:h,topItemCount:C,topItemsIndexes:E,totalCount:u,...b,groupIndices:s,itemSize:l,listState:S,minOverscanItemCount:N,scrollToIndex:y,statefulTotalCount:d,trackItemSizes:A,rangeChanged:k,...T,...F,...g,sizes:c,...w}},sw(kb,Qb,zw,Av,lv,tv,Pb,wv,fv,Lb,bv));function yv(e,t){const i={},r={};let n=0;const a=e.length;for(;n<a;)r[e[n]]=1,n+=1;for(const e in t)Object.hasOwn(r,e)||(i[e]=t[e]);return i}const Bv=typeof document<"u"?r.useLayoutEffect:r.useEffect;function Cv(t,i,n){const a=Object.keys(i.required||{}),s=Object.keys(i.optional||{}),o=Object.keys(i.methods||{}),l=Object.keys(i.events||{}),h=r.createContext({});function c(e,t){void 0!==e.propsReady&&lw(e.propsReady,!1);for(const r of a){lw(e[i.required[r]],t[r])}for(const r of s)if(r in t){lw(e[i.optional[r]],t[r])}void 0!==e.propsReady&&lw(e.propsReady,!0)}function d(e){return l.reduce((t,r)=>(t[r]=function(e){let t,i;const r=()=>t?.();return function(n,a){switch(n){case 1:return a?i===a?void 0:(r(),i=a,t=ow(e,a),t):(r(),rw);case 2:return r(),void(i=null)}}}(e[i.events[r]]),t),{})}const u=r.forwardRef(function(u,A){const{children:p,...f}=u,[m]=r.useState(()=>nw(function(e){const t=new Map,i=({constructor:e,dependencies:r,id:n,singleton:a})=>{if(a&&t.has(n))return t.get(n);const s=e(r.map(e=>i(e)));return a&&t.set(n,s),s};return i(e)}(t),e=>{c(e,f)})),[g]=r.useState(tw(d,m));var w;Bv(()=>{for(const e of l)e in f&&ow(g[e],f[e]);return()=>{Object.values(g).map(hw)}},[f,g,m]),Bv(()=>{c(m,f)}),r.useImperativeHandle(A,$g((w=m,o.reduce((e,t)=>(e[t]=e=>{lw(w[i.methods[t]],e)},e),{}))));const b=n;return e(h.Provider,{value:m,children:void 0!==n?e(b,{...yv([...a,...s,...l],f),children:p}):p})});return{Component:u,useEmitter:(e,t)=>{const i=r.useContext(h)[e];Bv(()=>ow(i,t),[t,i])},useEmitterValue:r.version.startsWith("18")?e=>{const t=r.useContext(h)[e],i=r.useCallback(e=>ow(t,e),[t]);return r.useSyncExternalStore(i,()=>cw(t),()=>cw(t))}:e=>{const t=r.useContext(h)[e],[i,n]=r.useState(tw(cw,t));return Bv(()=>ow(t,e=>{e!==i&&n($g(e))}),[t,i]),i},usePublisher:e=>{const t=r.useContext(h);return r.useCallback(i=>{lw(t[e],i)},[t,e])}}}const xv=r.createContext(void 0),Fv=r.createContext(void 0),Sv="-webkit-sticky",Nv="sticky",Ev=mv(()=>{if(typeof document>"u")return Nv;const e=document.createElement("div");return e.style.position=Sv,e.style.position===Sv?Sv:Nv}),kv=typeof document<"u"?r.useLayoutEffect:r.useEffect;function Tv(e){return"self"in e}function Lv(e,t,i,n=rw,a,s){const o=r.useRef(null),l=r.useRef(null),h=r.useRef(null),c=r.useCallback(i=>{let r,n,a;const o=i.target;if(function(e){return"body"in e}(o)||Tv(o)){const e=Tv(o)?o:o.defaultView;a=!0===s?e.scrollX:e.scrollY,r=!0===s?e.document.documentElement.scrollWidth:e.document.documentElement.scrollHeight,n=!0===s?e.innerWidth:e.innerHeight}else a=!0===s?o.scrollLeft:o.scrollTop,r=!0===s?o.scrollWidth:o.scrollHeight,n=!0===s?o.offsetWidth:o.offsetHeight;const c=()=>{e({scrollHeight:r,scrollTop:Math.max(a,0),viewportHeight:n})};!0===i.suppressFlushSync?c():Lr.flushSync(c),null!==l.current&&(a===l.current||a<=0||a===r-n)&&(l.current=null,t(!0),h.current&&(clearTimeout(h.current),h.current=null))},[e,t,s]);return r.useEffect(()=>{const e=a||o.current;return n(a||o.current),c({suppressFlushSync:!0,target:e}),e.addEventListener("scroll",c,{passive:!0}),()=>{n(null),e.removeEventListener("scroll",c)}},[o,c,i,n,a]),{scrollByCallback:function(e){!0===s&&(e={...void 0!==e.behavior?{behavior:e.behavior}:{},...void 0!==e.top?{left:e.top}:{}}),o.current.scrollBy(e)},scrollerRef:o,scrollToCallback:function(i){const r=o.current;if(!r||(!0===s?"offsetWidth"in r&&0===r.offsetWidth:"offsetHeight"in r&&0===r.offsetHeight))return;const n="smooth"===i.behavior;let a,c,d;Tv(r)?(c=Math.max(fb(r.document.documentElement,!0===s?"width":"height"),!0===s?r.document.documentElement.scrollWidth:r.document.documentElement.scrollHeight),a=!0===s?r.innerWidth:r.innerHeight,d=!0===s?window.scrollX:window.scrollY):(c=r[!0===s?"scrollWidth":"scrollHeight"],a=fb(r,!0===s?"width":"height"),d=r[!0===s?"scrollLeft":"scrollTop"]);const u=c-a;if(i.top=Math.ceil(Math.max(Math.min(u,i.top),0)),Hb(a,c)||i.top===d)return e({scrollHeight:c,scrollTop:d,viewportHeight:a}),void(n&&t(!0));n?(l.current=i.top,h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{h.current=null,l.current=null,t(!0)},1e3)):l.current=null,!0===s&&(i={...void 0!==i.behavior?{behavior:i.behavior}:{},left:i.top}),r.scrollTo(i)}}}function Iv(e){return e}const Dv=Ew(()=>{const e=xw(e=>`Item ${e}`),t=xw(e=>`Group ${e}`),i=xw({}),r=xw(Iv),n=xw("div"),a=xw(rw),s=(e,t=null)=>Fw(bw(i,gw(t=>t[e]),fw()),t);return{components:i,computeItemKey:r,EmptyPlaceholder:s("EmptyPlaceholder"),FooterComponent:s("Footer"),GroupComponent:s("Group","div"),groupContent:t,HeaderComponent:s("Header"),HeaderFooterTag:n,ItemComponent:s("Item","div"),itemContent:e,ListComponent:s("List","div"),ScrollerComponent:s("Scroller","div"),scrollerRef:a,ScrollSeekPlaceholder:s("ScrollSeekPlaceholder"),TopItemListComponent:s("TopItemList")}});sw(vv,Dv),Ev();const Uv={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},Pv={outline:"none",overflowX:"auto",position:"relative"};function Rv(e,t){if("string"!=typeof e)return{context:t}}function Ov(e,t){return{item:"string"==typeof e?void 0:t}}function Qv({useEmitter:t,useEmitterValue:i,usePublisher:n}){return r.memo(function({children:r,style:a,context:s,...o}){const l=n("scrollContainerState"),h=i("ScrollerComponent"),c=n("smoothScrollTargetReached"),d=i("scrollerRef"),u=i("horizontalDirection")||!1,{scrollByCallback:A,scrollerRef:p,scrollToCallback:f}=Lv(l,c,h,d,void 0,u);return t("scrollTo",f),t("scrollBy",A),e(h,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:p,style:{...u?Pv:Uv,...a},tabIndex:0,...o,...Rv(h,s),children:r})})}function Hv({useEmitter:t,useEmitterValue:i,usePublisher:n}){return r.memo(function({children:a,style:s,context:o,...l}){const h=n("windowScrollContainerState"),c=i("ScrollerComponent"),d=n("smoothScrollTargetReached"),u=i("totalListHeight"),A=i("deviation"),p=i("customScrollParent"),f=r.useRef(null),m=i("scrollerRef"),{scrollByCallback:g,scrollerRef:w,scrollToCallback:b}=Lv(h,d,c,m,p);return kv(()=>(w.current=p||f.current?.ownerDocument.defaultView,()=>{w.current=null}),[w,p]),t("windowScrollTo",b),t("scrollBy",g),e(c,{ref:f,"data-virtuoso-scroller":!0,style:{position:"relative",...s,...0!==u?{height:u+A}:void 0},...l,...Rv(c,o),children:a})})}Ev();const Mv=Ew(()=>{const e=xw(e=>t("td",{children:["Item $",e]})),i=xw(null),r=xw(e=>t("td",{colSpan:1e3,children:["Group ",e]})),n=xw(null),a=xw(null),s=xw({}),o=xw(Iv),l=xw(rw),h=(e,t=null)=>Fw(bw(s,gw(t=>t[e]),fw()),t);return{components:s,computeItemKey:o,context:i,EmptyPlaceholder:h("EmptyPlaceholder"),FillerRow:h("FillerRow"),fixedFooterContent:a,fixedHeaderContent:n,itemContent:e,groupContent:r,ScrollerComponent:h("Scroller","div"),scrollerRef:l,ScrollSeekPlaceholder:h("ScrollSeekPlaceholder"),TableBodyComponent:h("TableBody","tbody"),TableComponent:h("Table","table"),TableFooterComponent:h("TableFoot","tfoot"),TableHeadComponent:h("TableHead","thead"),TableRowComponent:h("TableRow","tr"),GroupComponent:h("Group","tr")}}),_v=Ew(([e,t])=>({...e,...t}),sw(vv,Mv)),jv=({height:t})=>e("tr",{children:e("td",{style:{height:t}})}),zv=({height:t})=>e("tr",{children:e("td",{style:{border:0,height:t,padding:0}})}),Vv={overflowAnchor:"none"},Kv={position:Ev(),zIndex:2,overflowAnchor:"none"},qv=r.memo(function({showTopList:e=!1}){const t=Zv("listState"),i=Zv("computeItemKey"),r=Zv("firstItemIndex"),n=Zv("context"),a=Zv("isSeeking"),s=Zv("fixedHeaderHeight"),o=Zv("groupIndices").length>0,l=Zv("itemContent"),h=Zv("groupContent"),c=Zv("ScrollSeekPlaceholder")??jv,d=Zv("GroupComponent"),A=Zv("TableRowComponent"),p=(e?t.topItems:[]).reduce((e,t,i)=>(0===i?e.push(t.size):e.push(e[i-1]+t.size),e),[]);return(e?t.topItems:t.items).map(t=>{const f=t.originalIndex,m=i(f+r,t.data,n),g=e?0===f?0:p[f-1]:0;return a?u(c,{...Rv(c,n),height:t.size,index:t.index,key:m,type:t.type||"item"}):"group"===t.type?u(d,{...Rv(d,n),"data-index":f,"data-item-index":t.index,"data-known-size":t.size,key:m,style:{...Kv,top:s}},h(t.index,n)):u(A,{...Rv(A,n),...Ov(A,t.data),"data-index":f,"data-item-index":t.index,"data-known-size":t.size,"data-item-group-index":t.groupIndex,key:m,style:e?{...Kv,top:s+g}:Vv},o?l(t.index,t.groupIndex,t.data,n):l(t.index,t.data,n))})}),Gv=r.memo(function(){const i=Zv("listState"),n=Zv("topItemsIndexes").length>0,a=ey("sizeRanges"),s=Zv("useWindowScroll"),o=Zv("customScrollParent"),l=ey("windowScrollContainerState"),h=ey("scrollContainerState"),c=o||s?l:h,d=Zv("trackItemSizes"),u=Zv("itemSize"),A=Zv("log"),{callbackRef:p,ref:f}=_w(a,u,d,c,A,void 0,o,!1,Zv("skipAnimationFrameInResizeObserver")),[m,g]=r.useState(0);$v("deviation",e=>{m!==e&&(f.current.style.marginTop=`${e}px`,g(e))});const w=Zv("EmptyPlaceholder"),b=Zv("FillerRow")??zv,v=Zv("TableBodyComponent"),y=Zv("paddingTopAddition"),B=Zv("statefulTotalCount"),C=Zv("context");if(0===B&&null!=w)return e(w,{...Rv(w,C)});const x=(n?i.topItems:[]).reduce((e,t)=>e+t.size,0),F=i.offsetTop+y+m-x,S=i.offsetBottom,N=F>0?e(b,{context:C,height:F},"padding-top"):null,E=S>0?e(b,{context:C,height:S},"padding-bottom"):null;return t(v,{"data-testid":"virtuoso-item-list",ref:p,...Rv(v,C),children:[N,n&&e(qv,{showTopList:!0}),e(qv,{}),E]})}),Wv=({children:t})=>{const i=r.useContext(xv),n=ey("viewportHeight"),a=ey("fixedItemHeight"),s=Hw(r.useMemo(()=>ew(n,e=>fb(e,"height")),[n]),!0,Zv("skipAnimationFrameInResizeObserver"));return r.useEffect(()=>{i&&(n(i.viewportHeight),a(i.itemHeight))},[i,n,a]),e("div",{"data-viewport-type":"element",ref:s,style:{height:"100%",position:"absolute",top:0,width:"100%"},children:t})},Jv=({children:t})=>{const i=r.useContext(xv),n=ey("windowViewportRect"),a=ey("fixedItemHeight"),s=Zv("customScrollParent"),o=jw(n,s,Zv("skipAnimationFrameInResizeObserver"));return r.useEffect(()=>{i&&(a(i.itemHeight),n({offsetTop:0,visibleHeight:i.viewportHeight,visibleWidth:100}))},[i,n,a]),e("div",{"data-viewport-type":"window",ref:o,style:{height:"100%",position:"absolute",top:0,width:"100%"},children:t})},Xv=r.memo(function(i){const n=Zv("useWindowScroll"),a=Zv("customScrollParent"),s=ey("fixedHeaderHeight"),o=ey("fixedFooterHeight"),l=Zv("fixedHeaderContent"),h=Zv("fixedFooterContent"),c=Zv("context"),d=Hw(r.useMemo(()=>ew(s,e=>fb(e,"height")),[s]),!0,Zv("skipAnimationFrameInResizeObserver")),u=Hw(r.useMemo(()=>ew(o,e=>fb(e,"height")),[o]),!0,Zv("skipAnimationFrameInResizeObserver")),A=a||n?iy:ty,p=a||n?Jv:Wv,f=Zv("TableComponent"),m=Zv("TableHeadComponent"),g=Zv("TableFooterComponent"),w=l?e(m,{ref:d,style:{position:"sticky",top:0,zIndex:2},...Rv(m,c),children:l()},"TableHead"):null,b=h?e(g,{ref:u,style:{bottom:0,position:"sticky",zIndex:1},...Rv(g,c),children:h()},"TableFoot"):null;return e(A,{...i,...Rv(A,c),children:e(p,{children:t(f,{style:{borderSpacing:0,overflowAnchor:"none"},...Rv(f,c),children:[w,e(Gv,{},"TableBody"),b]})})})}),{Component:Yv,useEmitter:$v,useEmitterValue:Zv,usePublisher:ey}=Cv(_v,{optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",firstItemIndex:"firstItemIndex",itemContent:"itemContent",groupContent:"groupContent",fixedHeaderContent:"fixedHeaderContent",fixedFooterContent:"fixedFooterContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",topItemCount:"topItemCount",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",groupCounts:"groupCounts",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},Xv),ty=Qv({useEmitter:$v,useEmitterValue:Zv,usePublisher:ey}),iy=Hv({useEmitter:$v,useEmitterValue:Zv,usePublisher:ey}),ry=Yv,ny={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},ay={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:sy,floor:oy,max:ly,min:hy,round:cy}=Math;function dy(e,t,i){return Array.from({length:t-e+1}).map((t,r)=>({data:null===i?null:i[r+e],index:r+e}))}function uy(e,t){return void 0!==e&&e.width===t.width&&e.height===t.height}function Ay(e,t){return void 0!==e&&e.column===t.column&&e.row===t.row}const py=Ew(([{increaseViewportBy:e,listBoundary:t,overscan:i,visibleRange:r},{footerHeight:n,headerHeight:a,scrollBy:s,scrollContainerState:o,scrollTo:l,scrollTop:h,smoothScrollTargetReached:c,viewportHeight:d},u,A,{didMount:p,propsReady:f},{customScrollParent:m,useWindowScroll:g,windowScrollContainerState:w,windowScrollTo:b,windowViewportRect:v},y])=>{const B=xw(0),C=xw(0),x=xw(ny),F=xw({height:0,width:0}),S=xw({height:0,width:0}),N=Sw(),E=Sw(),k=xw(0),T=xw(null),L=xw({column:0,row:0}),I=Sw(),D=Sw(),U=xw(!1),P=xw(0),R=xw(!0),O=xw(!1),Q=xw(!1);ow(bw(p,Cw(P),mw(([e,t])=>0!==t)),()=>{lw(R,!1)}),ow(bw(Tw(p,R,S,F,P,O),mw(([e,t,i,r,,n])=>e&&!t&&0!==i.height&&0!==r.height&&!n)),([,,,,e])=>{lw(O,!0),Rb(1,()=>{lw(N,e)}),uw(bw(h),()=>{lw(t,[0,0]),lw(R,!0)})}),dw(bw(D,mw(e=>null!=e&&e.scrollTop>0),ww(0)),C),ow(bw(p,Cw(D),mw(([,e])=>null!=e)),([,e])=>{e&&(lw(F,e.viewport),lw(S,e.item),lw(L,e.gap),e.scrollTop>0&&(lw(U,!0),uw(bw(h,yw(1)),e=>{lw(U,!1)}),lw(l,{top:e.scrollTop})))}),dw(bw(F,gw(({height:e})=>e)),d),dw(bw(Tw(Lw(F,uy),Lw(S,uy),Lw(L,(e,t)=>void 0!==e&&e.column===t.column&&e.row===t.row),Lw(h)),gw(([e,t,i,r])=>({gap:i,item:t,scrollTop:r,viewport:e}))),I),dw(bw(Tw(Lw(B),r,Lw(L,Ay),Lw(S,uy),Lw(F,uy),Lw(T),Lw(C),Lw(U),Lw(R),Lw(P)),mw(([,,,,,,,e])=>!e),gw(([e,[t,i],r,n,a,s,o,,l,h])=>{const{column:c,row:d}=r,{height:u,width:A}=n,{width:p}=a;if(0===o&&(0===e||0===p))return ny;if(0===A){const t=Ob(h,e);return function(e){return{...ay,items:e}}(dy(t,t+Math.max(o-1,0),s))}const f=fy(p,A,c);let m,g;l?0===t&&0===i&&o>0?(m=0,g=o-1):(m=f*oy((t+d)/(u+d)),g=f*sy((i+d)/(u+d))-1,g=hy(e-1,ly(g,f-1)),m=hy(g,ly(0,m))):(m=0,g=-1);const w=dy(m,g,s),{bottom:b,top:v}=my(a,r,n,w),y=sy(e/f);return{bottom:b,itemHeight:u,items:w,itemWidth:A,offsetBottom:y*u+(y-1)*d-b,offsetTop:v,top:v}})),x),dw(bw(T,mw(e=>null!==e),gw(e=>e.length)),B),dw(bw(Tw(F,S,x,L),mw(([e,t,{items:i}])=>i.length>0&&0!==t.height&&0!==e.height),gw(([e,t,{items:i},r])=>{const{bottom:n,top:a}=my(e,r,t,i);return[a,n]}),fw(db)),t);const H=xw(!1);dw(bw(h,Cw(H),gw(([e,t])=>t||0!==e)),H);const M=Nw(bw(Tw(x,B),mw(([{items:e}])=>e.length>0),Cw(H),mw(([[e,t],i])=>{const r=e.items[e.items.length-1].index===t-1;return(i||e.bottom>0&&e.itemHeight>0&&0===e.offsetBottom&&e.items.length===t)&&r}),gw(([[,e]])=>e-1),fw())),_=Nw(bw(Lw(x),mw(({items:e})=>e.length>0&&0===e[0].index),ww(0),fw())),j=Nw(bw(Lw(x),Cw(U),mw(([{items:e},t])=>e.length>0&&!t),gw(([{items:e}])=>({endIndex:e[e.length-1].index,startIndex:e[0].index})),fw(cb),Bw(0)));dw(j,A.scrollSeekRangeChanged),dw(bw(N,Cw(F,S,B,L),gw(([e,t,i,r,n])=>{const a=Ub(e),{align:s,behavior:o,offset:l}=a;let h=a.index;"LAST"===h&&(h=r-1),h=ly(0,h,hy(r-1,h));let c=gy(t,n,i,h);return"end"===s?c=cy(c-t.height+i.height):"center"===s&&(c=cy(c-t.height/2+i.height/2)),void 0!==l&&0!==l&&(c+=l),{behavior:o,top:c}})),l);const z=Fw(bw(x,gw(e=>e.offsetBottom+e.bottom)),0);return dw(bw(v,gw(e=>({height:e.visibleHeight,width:e.visibleWidth}))),F),{customScrollParent:m,data:T,deviation:k,footerHeight:n,gap:L,headerHeight:a,increaseViewportBy:e,initialItemCount:C,itemDimensions:S,overscan:i,restoreStateFrom:D,scrollBy:s,scrollContainerState:o,scrollHeight:E,scrollTo:l,scrollToIndex:N,scrollTop:h,smoothScrollTargetReached:c,totalCount:B,useWindowScroll:g,viewportDimensions:F,windowScrollContainerState:w,windowScrollTo:b,windowViewportRect:v,...A,gridState:x,horizontalDirection:Q,initialTopMostItemIndex:P,totalListHeight:z,...u,endReached:M,propsReady:f,rangeChanged:j,startReached:_,stateChanged:I,stateRestoreInProgress:U,...y}},sw(Jb,zw,zb,dv,Ib,uv,Qw));function fy(e,t,i){return ly(1,oy((e+i)/(oy(t)+i)))}function my(e,t,i,r){const{height:n}=i;if(void 0===n||0===r.length)return{bottom:0,top:0};const a=gy(e,t,i,r[0].index);return{bottom:gy(e,t,i,r[r.length-1].index)+n,top:a}}function gy(e,t,i,r){const n=fy(e.width,i.width,t.column),a=oy(r/n),s=a*i.height+ly(0,a-1)*t.row;return s>0?s+t.row:s}const wy=Ew(()=>{const e=xw(e=>`Item ${e}`),t=xw({}),i=xw(null),r=xw("virtuoso-grid-item"),n=xw("virtuoso-grid-list"),a=xw(Iv),s=xw("div"),o=xw(rw),l=(e,i=null)=>Fw(bw(t,gw(t=>t[e]),fw()),i),h=xw(!1),c=xw(!1);return dw(Lw(c),h),{components:t,computeItemKey:a,context:i,FooterComponent:l("Footer"),HeaderComponent:l("Header"),headerFooterTag:s,itemClassName:r,ItemComponent:l("Item","div"),itemContent:e,listClassName:n,ListComponent:l("List","div"),readyStateChanged:h,reportReadyState:c,ScrollerComponent:l("Scroller","div"),scrollerRef:o,ScrollSeekPlaceholder:l("ScrollSeekPlaceholder","div")}}),by=Ew(([e,t])=>({...e,...t}),sw(py,wy)),vy=r.memo(function(){const t=Ny("gridState"),i=Ny("listClassName"),n=Ny("itemClassName"),a=Ny("itemContent"),s=Ny("computeItemKey"),o=Ny("isSeeking"),l=Ey("scrollHeight"),h=Ny("ItemComponent"),c=Ny("ListComponent"),d=Ny("ScrollSeekPlaceholder"),A=Ny("context"),p=Ey("itemDimensions"),f=Ey("gap"),m=Ny("log"),g=Ny("stateRestoreInProgress"),w=Ey("reportReadyState"),b=Hw(r.useMemo(()=>e=>{const t=e.parentElement.parentElement.scrollHeight;l(t);const i=e.firstChild;if(null!==i){const{height:e,width:t}=i.getBoundingClientRect();p({height:e,width:t})}f({column:Ly("column-gap",getComputedStyle(e).columnGap,m),row:Ly("row-gap",getComputedStyle(e).rowGap,m)})},[l,p,f,m]),!0,!1);return kv(()=>{t.itemHeight>0&&t.itemWidth>0&&w(!0)},[t]),g?null:e(c,{className:i,ref:b,...Rv(c,A),"data-testid":"virtuoso-item-list",style:{paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},children:t.items.map(i=>{const r=s(i.index,i.data,A);return o?e(d,{...Rv(d,A),height:t.itemHeight,index:i.index,width:t.itemWidth},r):u(h,{...Rv(h,A),className:n,"data-index":i.index,key:r},a(i.index,i.data,A))})})}),yy=r.memo(function(){const t=Ny("HeaderComponent"),i=Ey("headerHeight"),n=Ny("headerFooterTag"),a=Hw(r.useMemo(()=>e=>{i(fb(e,"height"))},[i]),!0,!1),s=Ny("context");return null!=t?e(n,{ref:a,children:e(t,{...Rv(t,s)})}):null}),By=r.memo(function(){const t=Ny("FooterComponent"),i=Ey("footerHeight"),n=Ny("headerFooterTag"),a=Hw(r.useMemo(()=>e=>{i(fb(e,"height"))},[i]),!0,!1),s=Ny("context");return null!=t?e(n,{ref:a,children:e(t,{...Rv(t,s)})}):null}),Cy=({children:t})=>{const i=r.useContext(Fv),n=Ey("itemDimensions"),a=Ey("viewportDimensions"),s=Hw(r.useMemo(()=>e=>{a(e.getBoundingClientRect())},[a]),!0,!1);return r.useEffect(()=>{i&&(a({height:i.viewportHeight,width:i.viewportWidth}),n({height:i.itemHeight,width:i.itemWidth}))},[i,a,n]),e("div",{ref:s,style:{height:"100%",position:"absolute",top:0,width:"100%"},children:t})},xy=({children:t})=>{const i=r.useContext(Fv),n=Ey("windowViewportRect"),a=Ey("itemDimensions"),s=Ny("customScrollParent"),o=jw(n,s,!1);return r.useEffect(()=>{i&&(a({height:i.itemHeight,width:i.itemWidth}),n({offsetTop:0,visibleHeight:i.viewportHeight,visibleWidth:i.viewportWidth}))},[i,n,a]),e("div",{ref:o,style:{height:"100%",position:"absolute",top:0,width:"100%"},children:t})},Fy=r.memo(function({...i}){const r=Ny("useWindowScroll"),n=Ny("customScrollParent"),a=n||r?Ty:ky,s=n||r?xy:Cy,o=Ny("context");return e(a,{...i,...Rv(a,o),children:t(s,{children:[e(yy,{}),e(vy,{}),e(By,{})]})})}),{useEmitter:Sy,useEmitterValue:Ny,usePublisher:Ey}=Cv(by,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},Fy),ky=Qv({useEmitter:Sy,useEmitterValue:Ny,usePublisher:Ey}),Ty=Hv({useEmitter:Sy,useEmitterValue:Ny,usePublisher:Ey});function Ly(e,t,i){return"normal"!==t&&!0!==t?.endsWith("px")&&i(`${e} was not resolved to pixel value correctly`,t,Pw),"normal"===t?0:parseInt(t??"0",10)}const Iy=xi(()=>({root:{borderRadius:"8px",overflow:"hidden","&>.MuiTableRow-root .MuiTableCell-head":{fontWeight:600,color:"var(--theme-color1)",background:"var(--theme-color4)",whiteSpace:"nowrap",textOverflow:"ellipsis",userSelect:"none",padding:"6px 10px",paddingRight:0,"&:first-child":{borderRadius:"8px 0 0 8px"},"&:last-child":{borderRadius:"0 8px 8px 0","&::before":{display:"none"}}}}}))(li),Dy={Scroller:r.forwardRef((t,i)=>e(De,{component:Ue,...t,ref:i})),Table:t=>e(Re,{...t,size:"small",sx:{borderCollapse:"collapse",width:"100%",tableLayout:"fixed"}}),TableHead:r.forwardRef((t,i)=>e(Ie,{...t,ref:i,sx:{background:"var(--theme-color4)"}})),TableRow:Pe,TableBody:r.forwardRef((t,i)=>e(Le,{...t,ref:i,sx:{"&>.MuiTableRow-root .MuiTableCell-body":{fontWeight:500}}})),TableFoot:r.forwardRef((t,i)=>e(ce,{...t,ref:i,sx:{background:"var(--theme-color4)"}}))},Uy=({level:t})=>e("span",{style:{paddingLeft:10*t+"px"}}),Py=r.memo(({group:r,level:n=0,columns:a,columnWidths:o,onDoubleClickAction:h})=>{const c=r?.data?.length,u=r?.groups?.length,A=ns(),[p,f]=d(!0),m=l(()=>{r.data&&f(e=>!e)},[]),g=s(()=>r?.data?a.reduce((e,t)=>(t.isDisplayTotal&&"number"===t.componentType&&(e[t.accessor]=Xg(r.data,t,A)),e),{}):{},[r?.data,a,A]),w=s(()=>r.groups?a.reduce((e,t)=>(t.isDisplayTotal&&"number"===t.componentType&&(e[t.accessor]=au(Yg(r,t),t?.isVisibleCurrSymbol?$o(t?.currencySymbol??A.dynamicAmountSymbol):"",t?.currencyFormat??A.currencyFormat,t?.decimalCount??A.decimalCount,t?.symbolPosition??"start")),e),{}):{},[r,a,A]),b=s(()=>p&&r?.data?r.data.map(t=>e(Pe,{onDoubleClick:()=>{"function"==typeof h&&h({row:[{data:t}]})},children:a.map(i=>{const r=i.accessor,n=((e,t,i)=>{const{commonDateFormat:r,commonDateTimeFormat:n,commonTimeFormat:a,currencyFormat:s,decimalCount:o,dynamicAmountSymbol:l}=i;if(!t.componentType)return e;switch(t.componentType){case"date":return Jg(e,t?.dateFormat??r??"dd/MM/yyyy");case"dateTime":return Jg(e,t?.dateFormat??n??"dd/MM/yyyy HH:mm:ss");case"time":return Jg(e,t?.dateFormat??a??"HH:mm:ss");case"number":return isNaN(Number(e))?"-":au(e,t?.isVisibleCurrSymbol?$o(t?.currencySymbol??l):"",t?.currencyFormat??s,t?.decimalCount??o,t?.symbolPosition??"start");default:return e}})(t[r],i,A);return e(Oe,{align:i.alignment??"left",sx:{whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",minWidth:o[r],maxWidth:o[r],color:"function"==typeof i.color?i.color(t[r],t):"#000"},children:i?.showTooltip?e(ne,{title:n,children:n}):n},r)})},t.id)):null,[p,r?.data,a,o,A]),v=s(()=>r?.data?e(Pe,{className:J("footer-row",{p0:!a.some(e=>"number"===e.componentType&&e.isDisplayTotal)}),children:a.map(t=>e(Oe,{align:t.alignment??"left",children:"number"===t.componentType&&t.isDisplayTotal?g[t.accessor]:""},t.accessor))}):null,[r?.data,a,g]);return t(i,{children:[e(Pe,{children:a.map((i,a)=>{const s=0===a,l=i.isDisplayTotal?g[i.accessor]:"",h=i.isDisplayTotal?w[i.accessor]:"";return e(Oe,{align:s?"left":i.alignment??"left",sx:{fontSize:"0.9rem",cursor:s?"pointer":"auto",width:o[i.accessor],minWidth:o[i.accessor],maxWidth:o[i.accessor],overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:0!==a?r.data?"var(--theme-color3)":"var(--theme-color1)":"#000"},onClick:s?m:void 0,children:s?t("div",{style:{display:"flex",alignItems:"center"},children:[t("strong",{className:"group-name",style:{display:"flex",alignItems:"center",flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:[e(Uy,{level:n}),t("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[r.groupName,t("em",{style:{fontSize:".8rem",color:"#707070",fontWeight:500,marginLeft:"5px"},children:[u?`(${u} Groups)`:"",c?`(${c} Records)`:""]})]})]}),e("span",{style:{marginLeft:"auto",height:"18px",flexShrink:0},children:r?.data?e(p?nr:ar,{fontSize:"small"}):null})]}):i.isDisplayTotal&&r.data?e("strong",{children:l}):i.isDisplayTotal&&r.groups?e("strong",{children:h}):""},i.accessor)})}),p&&t(i,{children:[b,v]}),r.groups?.map((t,i)=>e(Py,{group:t,level:n+1,columns:a,columnWidths:o,onDoubleClickAction:h},t.groupName||i))]})}),Ry=({columns:r,data:n,originalData:a,loading:o,metaData:h,hideFooter:c,onDoubleClickAction:u})=>{const A=ns(),[p,f]=d(r.reduce((e,t)=>({...e,[t.accessor]:Number(t.width)||150}),{})),m=s(()=>p,[p]),g=l((e,t)=>{f(i=>({...i,[e]:t}))},[]),w=l((e,t)=>{const i=e.clientX,r=m[t.accessor];let n;const a=e=>{n&&cancelAnimationFrame(n),n=requestAnimationFrame(()=>{const n=Math.min(Math.max(t.minWidth||50,r+(e.clientX-i)),t.maxWidth||600);n!==m[t.accessor]&&g(t.accessor,n)})},s=()=>{n&&cancelAnimationFrame(n),document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",s)};document.addEventListener("mousemove",a),document.addEventListener("mouseup",s)},[m,g]);return e(ry,{components:Dy,data:n,fixedFooterContent:()=>e(i,{children:c?null:e(ce,{sx:{position:"sticky",bottom:0},children:e(Pe,{className:"footer-row",children:r.map((e,i)=>t(Oe,{align:e.alignment??"left",sx:{borderTop:"1px solid #bbb",minWidth:m[e.accessor],maxWidth:m[e.accessor]},children:[0===i?`Grand Total ${a.length}`:"","number"===e.componentType&&e.isDisplayTotal?Xg(a,e,A):""]},e.accessor))})})}),fixedHeaderContent:()=>e(Iy,{sx:{position:"sticky",top:0,zIndex:100},children:e(Pe,{children:r.map(i=>e(Oe,{sx:{minWidth:m[i.accessor],maxWidth:m[i.accessor],fontWeight:"bold",paddingRight:0},children:t("div",{style:{display:"flex",alignItems:"center",width:"100%",minWidth:0},children:[e("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",textAlign:i?.alignment??"left"},children:i.columnName}),e("div",{onMouseDown:e=>w(e,i),style:{cursor:"col-resize",paddingLeft:"10px",flexShrink:0,display:"flex",alignItems:"center"},children:e("div",{style:{width:"2px",height:"12px",background:"#ddd"}})})]})},i.accessor))})}),itemContent:(t,i)=>e(Py,{group:i,level:0,columns:r,columnWidths:m,onDoubleClickAction:u},i.groupName??t),style:{height:h?.gridConfig?.maxHeight??"70vh"}})},Oy=({data:t,setGlobalFilterData:i,visibleKeys:r})=>{const{t:n}=W(),[a,s]=d(""),o=((e,t=500)=>{const[i,r]=d(e);return h(()=>{const i=setTimeout(()=>r(e),t);return()=>clearTimeout(i)},[e,t]),i})(a,300);h(()=>{const e=o?t.filter(e=>r.some(t=>{const i=e[t];return i&&i.toString().toLowerCase().includes(o.toLowerCase())})):t;i(e)},[o,t,r,i]);return e(Ll,{type:"text",value:a,onChange:e=>{s(e.target.value)},placeholder:`${n("profile.Searchin")} ${t.length||0} ${n("records")}`})},Qy=r.memo(({title:i,columns:r,metaData:n,groups:a,hideHeader:o,hideFooter:h,dataFetcher:c,reportID:u,otherAPIRequestPara:A={},autoFetch:p=!0,retrievalComponent:f,retrievalType:m,onClose:g,allowRefetch:w=!0,onDoubleClickAction:b,headerToolbarStyle:v={}})=>{const{t:y}=W(),[B,C]=d(p),[x,F]=d([]),S=l(e=>{F(e),C(!0)},[C,F]),{data:N,isFetching:E,isLoading:k,isError:T,error:L,refetch:I}=zt([c,u,x,A],()=>c(u,x,A),{cacheTime:0,enabled:B}),D=s(()=>k||E,[E,k]),[U,P]=d([]),[R,O]=d(N??[]),Q=s(()=>r.filter(e=>!1!==e.isVisible),[r]),H=s(()=>Array.isArray(Q)?Q.map(e=>({...e,columnName:y(e.columnName)})):[],[y,Q]),M=s(()=>H.map(e=>e.accessor),[H]),_=s(()=>fl(U,N??[]),[U,N]),j=s(()=>fl(U,R),[U,R]),z=s(()=>D?[]:((e,t)=>{if(!t.length)return[];const i=new Map;e.forEach(e=>{let r=i;t.forEach((i,n)=>{const a=`${i.groupName??""} ${e[i.accessor]}`;r.has(a)||r.set(a,n===t.length-1?{groupName:a.trim(),data:[]}:new Map),n===t.length-1?r.get(a).data.push(e):r=r.get(a)})});const r=e=>Array.from(e,([e,t])=>t instanceof Map?{groupName:e,groups:r(t)}:t);return r(i)})(j,a),[j,a,D]),V=s(()=>pg(n.filters?n.filters:[]),[n.filters]);return t(oe,{className:"layout-report-parent",sx:{display:"flex",flexDirection:"column",padding:"1rem",overflow:"auto"},children:[T?e(to,{severity:L?.severity??"error",errorMsg:L?.error_msg??"Error",errorDetail:L?.error_detail??""}):null,t(Ue,{style:{width:"100%",overflowX:"auto"},children:[t(Ue,{style:{width:"100%",overflow:"hidden",marginBottom:"8px",display:o?"none":"inherit"},children:[t(xe,{className:"layout__report__header",variant:"dense",sx:{display:"flex",alignItems:"center",justifyContent:"space-between",...v},style:{background:"var(--primary-bg)"},children:[e(X,{variant:"h5",color:"primary",children:i.trim()}),t(be,{direction:"row",alignItems:"center",className:"group-report-header-tools",children:[e(Rm,{filterData:x,filterMeta:V,isOpenRetrievalDefault:!B,retrievalComponent:f,retrievalType:m,setAllFilters:P,setQueryFilters:S,setShowFilters:()=>{}}),V.length>0&&e(Gl,{setAllFilters:P,filters:U,filterMeta:V,gotoPage:()=>{},setSortBy:()=>{},classes:{}}),w?e(Wo,{title:y("Refetch"),children:e(de,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true",onClick:()=>I(),color:"primary",children:e(ki,{})})}):null,e(Oy,{data:_,setGlobalFilterData:O,visibleKeys:M}),"function"==typeof g?e(Wo,{title:y("Close"),arrow:!0,children:e(de,{onClick:g,size:"small",sx:{width:"35px",height:"35px",padding:0},children:e(Bt,{fontSize:"medium",style:{color:"var(--white)"}})})}):null]})]}),x.length?e(Im,{dense:!0,setAllFilters:F,filters:x}):null,U.length>0&&e(hh,{dense:!0,setAllFilters:P,filters:U,gotoPage:()=>{},setSortBy:()=>{}}),D&&e(Qe,{color:"secondary"})]}),e(Ry,{columns:H,data:z,originalData:j,metaData:n,loading:D,hideFooter:h,onDoubleClickAction:b})]})]})}),Hy=({name:i,validate:r,validationRun:n,postValidationSetCrossFieldValues:a,runValidationOnDependentFieldsChange:s,runPostValidationHookAlways:c,shouldExclude:d,isReadOnly:A,dependentFields:p,fieldKey:f,GridProps:m,CircularProgressProps:g,enableGrid:w,StartAdornment:b,EndAdornment:v,isFieldFocused:y,maxLength:C=-1,label:x,skipValueUpdateFromCrossFieldWhenReadOnly:F,dependentFieldDebounceDelay:S=300,...N})=>{const{value:E,error:k,touched:T,handleChange:L,handleBlur:I,isSubmitting:D,validationRunning:U,fieldKey:P,name:R,excluded:O,readOnly:Q,incomingMessage:H,setIncomingMessage:M,whenToRunValidation:_,runValidation:j}=as({name:i,fieldKey:f,dependentFields:p,validate:r,validationRun:n,runPostValidationHookAlways:c,postValidationSetCrossFieldValues:a,isReadOnly:A,shouldExclude:d,runValidationOnDependentFieldsChange:s,skipValueUpdateFromCrossFieldWhenReadOnly:F,dependentFieldDebounceDelay:S}),z=l(e=>{L(e,e.target?.formattedValue??void 0)},[L]),V=o();if(h(()=>{y&&setTimeout(()=>{V?.current?.focus?.()},1)},[y]),h(()=>{if(null!==H&&"object"==typeof H&&Object.keys(H).length){const{value:e}=H;"DEFAULT_VALUE"!==e&&L(e),"onBlur"===_&&j({value:e},!0),M(null)}},[H,L,j,_]),O)return null;const K=T&&Boolean(k),W=t($e,{disabled:D,children:[e(Ut,{children:x}),u(Ir,{...N,key:P,id:P,name:R,value:E,InputProps:{endAdornment:U?e(B,{position:"end",children:e(G,{color:"primary",variant:"indeterminate",...g})}):Boolean(v)?v:null,startAdornment:Boolean(b)?e(B,{position:"start",children:b}):null},InputLabelProps:{shrink:!0},inputRef:V,onChange:e=>{(-1===C||e.target.value.length<=C)&&z(e)},inputProps:{readOnly:Q,tabIndex:Q?-1:void 0},onBlur:I,disabled:D}),e(Ze,{children:K?k:""})]});return Boolean(w)?e(q,{...m,children:W}):W};var My=Object.freeze({__proto__:null,TextareaAutosize:Hy,default:Hy});const _y=({name:e,fieldKey:t,setValueOnDependentFieldsChange:i,setValueOnDependentFieldsValueChange:r,dependentFields:n,ignoreInSubmit:a=!1,postValidationSetCrossFieldValues:o,validationRun:l,runValidationOnDependentFieldsChange:c,AlwaysRunPostValidationSetCrossFieldValues:d,runExternalFunction:u,onFormDataChange:A,runPostValidationForInitValue:p,dependentFieldDebounceDelay:f=300})=>{const{handleBlur:m,handleChange:g,dependentValues:w,incomingMessage:b,setIncomingMessage:v,setIgnoreInSubmit:y,runValidation:B,whenToRunValidation:C,formState:x}=as({name:e,fieldKey:t,dependentFields:n,postValidationSetCrossFieldValues:o,validationRun:l,runValidationOnDependentFieldsChange:c,AlwaysRunPostValidationSetCrossFieldValues:d,runExternalFunction:u,onFormDataChange:A,runPostValidationForInitValue:p,dependentFieldDebounceDelay:f});h(()=>{m()},[m]),h(()=>{if(Boolean(a))if("function"==typeof a){let e=a(ds(w),x);y(e)}else y(a)},[a,y,w]);const F=s(()=>{const e=ds(w),t=us(e);return JSON.stringify(t.sort((e,t)=>e.fieldKey.localeCompare(t.fieldKey)).map(e=>e.value))},[w]);return h(()=>{if(F&&"function"==typeof r){let e=r(ds(w),x);null!=e&&g(e)}},[F,r,g]),h(()=>{if("function"==typeof i){let e=i(ds(w),x);void 0===e&&null===e||g(e)}},[w,g,i]),h(()=>{if(null!==b&&"object"==typeof b&&Object.keys(b).length){const{value:e}=b;(Boolean(e)||""===e)&&(g(e,void 0,!1,{isIncomingValue:!0}),"onBlur"===C&&B({value:e,isIncomingValue:!0},!0)),v(null)}},[b,g,B,C]),null};var jy=Object.freeze({__proto__:null,HiddenField:_y,default:_y}),zy=Object.freeze({__proto__:null,Typography:Gp,default:Gp});const Vy=Ci(e=>Fi({cardHeader:{padding:e.spacing(1,2)},list:{width:200,height:230,backgroundColor:e.palette.background.paper,overflow:"auto"},button:{margin:e.spacing(.5,0)}})),Ky=(e,t)=>e.filter(e=>t.findIndex(t=>t?.value===e?.value)<0),qy=(e,t)=>e.filter(e=>t.findIndex(t=>t?.value===e)<0),Gy=(e,t)=>e.filter(e=>t.findIndex(t=>t===e)<0),Wy=(e,t)=>{let i=e.filter(e=>-1!==t.findIndex(t=>t?.value===e));return t.filter(e=>i.indexOf(e?.value)>=0)},Jy=({label:i="",leftOptions:r,rightOptions:n,leftOptionsLabel:a,rightOptionsLabel:s,valueSide:o,disabled:l=!1,error:c=!1,readOnly:u=!1,helperText:A="",handleChange:p=()=>{},handleBlur:m=()=>{}})=>{const g=Vy(),[w,b]=d([]),[v,y]=d(r??[]),[B,C]=d(n??[]),x=Wy(w,v),F=Wy(w,B);h(()=>{y(r),C(n),p("left"===o?r.map(e=>e.value):n.map(e=>e.value))},[r,n]);const S=e=>Wy(w,e).length,N=e=>()=>{u||(S(e)===e.length?b(qy(w,e)):b(((e,t)=>[...e,...Gy(t.map(e=>e?.value),e)])(w,e)))},E=(i,r,n)=>t(at,{style:n?{borderBottom:"2px solid #f44336"}:void 0,children:[e(lt,{className:g.cardHeader,avatar:e(ui,{onClick:N(r),checked:S(r)===r.length&&0!==r.length,indeterminate:S(r)!==r.length&&0!==S(r),disabled:0===r.length||l,inputProps:{"aria-label":"all items selected"}}),title:i,subheader:`${S(r)}/${r.length} selected`}),e(ur,{}),t(Dr,{className:g.list,dense:!0,component:"div",role:"list",children:[r.map(i=>{return t(Ur,{role:"listitem",button:!0,onClick:(r=i.value,()=>{if(u)return;const e=w.indexOf(r),t=[...w];-1===e?t.push(r):t.splice(e,1),b(t)}),dense:!0,style:{padding:"0px 16px"},disabled:l,children:[e(Rr,{children:e(ui,{style:{padding:"0px 8px"},checked:-1!==w.indexOf(i.value),tabIndex:-1,disableRipple:!0,disabled:l})}),e(Pr,{id:i.value,primary:i.label})]},i.value);var r}),e(Ur,{})]})]});return t(f,{children:[e(X,{variant:"h6",children:i}),t(q,{container:!0,spacing:2,justifyContent:"center",alignItems:"center",tabIndex:0,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||m(e)},children:[e(q,{item:!0,xs:5,md:5,sm:5,children:E(a,v,c)}),e(q,{item:!0,xs:2,md:2,sm:2,children:t(q,{container:!0,direction:"column",alignItems:"center",children:[e(ct,{variant:"outlined",size:"small",className:g.button,onClick:()=>{if(u)return;let e=B.concat(x),t=Ky(v,x);b(qy(w,x)),y(t),C(e),p("left"===o?t.map(e=>e.value):e.map(e=>e.value))},disabled:0===x.length||l,"aria-label":"move selected right",children:">"}),e(ct,{variant:"outlined",size:"small",className:g.button,onClick:()=>{if(u)return;let e=v.concat(F),t=Ky(B,F);b(qy(w,F)),y(e),C(t),p("left"===o?e.map(e=>e.value):t.map(e=>e.value))},disabled:0===F.length||l,"aria-label":"move selected left",children:"<"})]})}),e(q,{item:!0,xs:5,md:5,sm:5,children:E(s,B,c)})]}),e(Ze,{disabled:l,error:c,children:A})]})},Xy=({name:t,fieldKey:i,label:r,validate:n,validationRun:a,shouldExclude:s,isReadOnly:o,postValidationSetCrossFieldValues:l,runPostValidationHookAlways:h,dependentFields:c,leftOptions:u,rightOptions:A,GridProps:p,enableGrid:f,isFieldFocused:m,runValidationOnDependentFieldsChange:g,_leftOptionsKey:w,_rightOptionsKey:b,disableCaching:v,leftOptionsLabel:y,rightOptionsLabel:B,valueSide:C})=>{const{error:x,touched:F,handleChange:S,handleBlur:N,runValidation:E,isSubmitting:k,fieldKey:T,name:L,dependentValues:I,excluded:D,incomingMessage:U,whenToRunValidation:P,readOnly:R,formState:O,setIncomingMessage:Q}=as({name:t,fieldKey:i,dependentFields:c,validate:n,validationRun:a,runPostValidationHookAlways:h,postValidationSetCrossFieldValues:l,isReadOnly:o,shouldExclude:s,runValidationOnDependentFieldsChange:g}),[H,M]=d([]),[_,j]=d([]),{loadingOptions:z}=Bo(O,u,M,S,I,U,E,P,w,v,Q,!0,"",!1),{loadingOptions:V}=Bo(O,A,j,S,I,U,E,P,b,v,Q,!0,"",!1);if(D)return null;const K=F&&""!==(x??""),G=z||V?e("span",{children:"loading..."}):e(Jy,{name:L,label:r,error:!k&&K,helperText:!k&&K?x:null,handleChange:S,handleBlur:N,disabled:k,readOnly:R,leftOptions:H,rightOptions:_,leftOptionsLabel:y,rightOptionsLabel:B,valueSide:C},T);return Boolean(f)?e(q,{...p,children:G}):G};var Yy=Object.freeze({__proto__:null,TransferList:Xy,default:Xy});const $y=({name:i,validate:r,validationRun:n,postValidationSetCrossFieldValues:a,runValidationOnDependentFieldsChange:s,skipValueUpdateFromCrossFieldWhenReadOnly:c,runPostValidationHookAlways:A,shouldExclude:p,isReadOnly:m,dependentFields:g,fieldKey:w,GridProps:b,enableGrid:v,InputProps:y,inputProps:x,isFieldFocused:F,maxLength:S=-1,setColor:N,searchComponent:E=()=>e("span",{children:"No component found attached"}),...k})=>{const{value:T,error:L,touched:I,handleChange:D,handleBlur:U,isSubmitting:P,fieldKey:R,name:O,excluded:Q,readOnly:H,incomingMessage:M,whenToRunValidation:_,runValidation:j,validationAPIResult:z,setIncomingMessage:V}=as({name:i,fieldKey:w,dependentFields:g,validate:r,validationRun:n,runPostValidationHookAlways:A,postValidationSetCrossFieldValues:a,isReadOnly:m,shouldExclude:p,runValidationOnDependentFieldsChange:s,skipValueUpdateFromCrossFieldWhenReadOnly:c}),[K,G]=d(!1),[W,J]=d("string"==typeof N?N:"");h(()=>{if("function"==typeof N){let e=N(T);J("string"!=typeof e?"":e)}},[T,N]);const X=l(e=>{D(e,e.target?.formattedValue??void 0)},[D]),Y=l(e=>{"object"==typeof e?V(e):D(e,e),G(!1)},[D]),$=o();if(h(()=>{F&&setTimeout(()=>{$?.current?.focus?.()},1)},[F]),h(()=>{if(null!==M&&"object"==typeof M&&Object.keys(M).length){const{value:e}=M;(Boolean(e)||""===e)&&(D(e),"onBlur"===_&&j({value:e},!0)),V(null)}},[M,D,j,_]),Q)return null;y?.inputProps&&(y.inputProps={...y.inputProps,readOnly:H,tabIndex:H?-1:void 0});const Z=I&&Boolean(L),ee=t(f,{children:[u(Ao,{...k,key:R,id:R,name:O,value:T,error:!P&&Z,helperText:e("div",{style:{display:"flex"},children:e(Ze,{children:!P&&Z?L:Boolean(z)?z:null})}),FormHelperTextProps:{component:"div"},InputProps:{style:!P&&Boolean(W)?{color:W,fontWeight:"bold"}:{},endAdornment:e(B,{position:"end",children:e(C,{"aria-label":"toggle password visibility",onClick:()=>G(!0),children:e(Or,{})})}),...y},InputLabelProps:{shrink:!0},inputRef:$,onChange:e=>{(-1===S||e.target.value.length<=S)&&X(e)},inputProps:{readOnly:H,tabIndex:H?-1:void 0,...x},onBlur:U,disabled:P}),e(dt,{open:K,onClose:()=>G(!1),maxWidth:"md",children:u(E,{onAccept:Y,value:T},null)})]});return Boolean(v)?e(q,{...b,children:ee}):ee};var Zy=Object.freeze({__proto__:null,SearchField:$y,default:$y});var eB=Object.freeze({__proto__:null,default:({name:t,validate:i,validationRun:r,postValidationSetCrossFieldValues:n,runValidationOnDependentFieldsChange:a,runPostValidationHookAlways:l,shouldExclude:c,isReadOnly:d,dependentFields:A,fieldKey:p,isFieldFocused:m,setValueOnDependentFieldsChange:g,setValueOnDependentFieldsValueChange:w,skipValueUpdateFromCrossFieldWhenReadOnly:b,label:v,enableGrid:y,GridProps:B,onFormButtonClickHandel:C,startsIcon:x,endsIcon:F,rotateIcon:S,iconStyle:N,tabIndex:E,ignoreInSubmit:k=!1,dependentFieldDebounceDelay:T=300})=>{const{value:L,handleChange:I,isSubmitting:D,excluded:U,readOnly:P,incomingMessage:R,setIncomingMessage:O,whenToRunValidation:Q,runValidation:H,dependentValues:M,formState:_,setIgnoreInSubmit:j}=as({name:t,fieldKey:p,dependentFields:A,validate:i,validationRun:r,runPostValidationHookAlways:l,postValidationSetCrossFieldValues:n,isReadOnly:d,shouldExclude:c,runValidationOnDependentFieldsChange:a,skipValueUpdateFromCrossFieldWhenReadOnly:b,dependentFieldDebounceDelay:T}),z=o();h(()=>{m&&V()},[m,L]);const V=()=>{setTimeout(()=>{z?.current?.focus?.()},1)},K=s(()=>{const e=ds(M),t=us(e);return JSON.stringify(t.sort((e,t)=>e.fieldKey.localeCompare(t.fieldKey)).map(e=>e.value))},[M]);if(h(()=>{if(K&&"function"==typeof w){let e=w(ds(M),_);null!=e&&I(e)}},[K,w,I]),h(()=>{if("function"==typeof g){let e=g(ds(M),_);null!=e&&I(e)}},[M,I,g]),h(()=>{if(null!==R&&"object"==typeof R&&Object.keys(R).length){const{value:e,isFieldFocused:t}=R;(Boolean(e)||""===e)&&(I(e,void 0,!1,{isIncomingValue:!0}),t&&V(),"onBlur"===Q&&H({value:e,isIncomingValue:!0},!0)),O(null)}},[R,I,H,Q]),h(()=>{if(Boolean(k))if("function"==typeof k){let e=k(ds(M),_,{isSubmitting:D,value:L});j(e)}else j(k)},[k,j,M,L]),U)return null;const q=e(f,{children:e(eo,{color:"secondary",onClick:e=>{"function"==typeof C&&C(p,ds(M)),I(isNaN(L)||!Boolean(L)?"1":parseInt(L)+1)},disabled:P??!1,style:{width:"100%",paddingLeft:"10px",marginTop:"17px"},starticon:x,endicon:F,rotateIcon:S,ref:z,tabIndex:E,sx:{"& svg":{...N}},children:v})});return Boolean(y)?u(ge,{...B,key:p,container:!0,justifyContent:"center",alignItems:"center",alignSelf:"start",mt:"0.65rem"},q):q}});const tB=({name:t,label:i,shouldExclude:r,dependentFields:n,fieldKey:a,GridProps:o,setValueOnDependentFieldsChange:l,setValueOnDependentFieldsValueChange:c,skipValueUpdateFromCrossFieldWhenReadOnly:d,DividerProps:u,componentType:A})=>{const{value:p,handleChange:f,excluded:m,incomingMessage:g,setIncomingMessage:w,dependentValues:b,formState:v}=as({name:t,fieldKey:a,dependentFields:n,shouldExclude:r,componentType:A,skipValueUpdateFromCrossFieldWhenReadOnly:d}),{t:y}=W(),B=s(()=>{const e=ds(b),t=us(e);return JSON.stringify(t.sort((e,t)=>e.fieldKey.localeCompare(t.fieldKey)).map(e=>e.value))},[b]);return h(()=>{if(B&&"function"==typeof c){let e=c(ds(b),v);null!=e&&f(e)}},[B,c,f]),h(()=>{if("function"==typeof l){let e=l(ds(b),v);null!=e&&f(e)}},[b,f,l]),h(()=>{if(null!==g&&"object"==typeof g&&Object.keys(g).length){const{value:e}=g;(Boolean(e)||""===e)&&f(e),w(null)}},[g,f]),m?null:e(ge,{item:!0,...o,children:e(we,{textAlign:"left",...u,children:p&&p.length>0?p:y(i??"")})})};var iB=Object.freeze({__proto__:null,Divider:tB,default:tB});const rB=i=>{let{defaultValue:r,label:n,enableGrid:a,GridProps:s}=i;"object"==typeof r&&(r=Array.isArray(r)?r.join(","):r?.toDateString?.()??"Invalid Value"),"boolean"==typeof r&&(r=r?"Yes":"No");let o=t("div",{children:[e("b",{children:n}),e("br",{}),r]});return Boolean(a)?e(q,{...s,children:o}):o};var nB=Object.freeze({__proto__:null,default:rB,valueField:rB});export{zs as AddIDinResponseData,Wg as AgGridTableWrapper,to as Alert,Za as AuthContextProvider,jl as AutoRefreshProvider,af as CRUDContext,sf as CRUDContextProvider,_s as CheckObjectAllKeyisEmpty,go as Checkbox,mo as ChipTextField,bo as ClearCacheContext,vo as ClearCacheProvider,mA as ColorlibConnector,fA as ColorlibStepIconRoot,so as ConvertExcelToJSONData,Gs as CreateDetailsRequestData,qs as CreateLanguageRequestData,Ru as CsvViewer,rs as CustomPropertiesConfigurationProvider,NA as DataTableGridWrapper,Ks as DefaultErrorObject,Sm as DetailsGridWithHeader,om as DocumentGridCRUD,rd as EXPORT_WORKER_STATUS,Pu as ExcelViewer,$s as ExportCSVFileFromData,Ys as ExportExcelFileFromData,_u as FileUploadControl,zu as FileViewerGrid,Zp as FormComponentView,Ya as FormContext,Nc as FormWrapper,bd as FullScreenLoader,eo as GradientButton,Am as GridCRUD,ao as GridDataExport,Vu as GridDataImport,hu as GridWrapper,cu as GridWrapperStatic,Jo as HtmlTooltip,Qu as ImageViewer,Ko as Input,Vo as InputLabel,Ho as KeyboardDatePicker,_o as KeyboardDateTimePicker,Mo as KeyboardTimePicker,Qy as LayoutReport,wd as LoaderPaperComponent,no as LoadingTextAnimation,nf as MasterDetailsForm,LA as MessageBoxNavigateWrapper,TA as MessageBoxWrapper,Hu as NoPreview,Ws as ObjectMappingKeys,Ou as PDFViewer,Ad as PopupContext,pd as PopupContextProvider,IA as PopupMessageAPIWrapper,sd as PopupRequestWrapper,kA as PrintButton,Xs as ProcessDetailsData,gd as RemarksAPIWrapper,Bd as ReportExportScreen,mg as ReportGrid,Cg as ReportWrapper,Ll as SearchBar,Il as SearchBar2,Ro as SelectWithoutOptions,gm as ServerGrid,pm as ServerGridContext,fm as ServerGridContextProvider,wm as ServerGridWrapper,cm as SimpleCRUD,xm as SnackbarProviderWrapper,Js as StringtoUnicode,vm as Tab,ym as Tabs,Ao as TextField,fo as TextField3,po as TextFieldForSelect,$A as ToggleButtonGroup,Wo as Tooltip,ph as Transition,js as UpdateRequestDataVisibleColumn,gu as UploadTarget,ed as WorkerContext,td as WorkerContextProvider,Ua as atomKeys,Rs as attachMethodsToMetaData,yo as cacheWrapperKeyGen,ku as cleanFileObj,Gc as components,bu as computeFileFingerprint,vu as computeSize,Lu as convertToFormData,Tu as convertToJsonObject,Yo as currencySymbol,Sg as customCellAggFunc,Ms as deriveData,Hs as deriveFormData,yu as detectMimeType,Dg as displayNumber,xu as downloadFile,Ig as dynamicRowHeight,Su as extractColumnsFromAdditionalMetaData,us as extractDependentFields,Qs as extractGridMetaData,Os as extractMetaData,uu as fileColumns,wg as filters,kg as findFirstDisplayColumn,Eg as findLastDisplayColumn,Wa as formArrayFieldRegisterSelector,Ga as formArrayFieldRegistryAtom,qa as formArrayFieldRowsAtom,Ja as formArrayFieldUnregisterSelector,Pa as formAtom,Ra as formFieldAtom,_a as formFieldExcludeAddSelector,ja as formFieldExcludeRemoveSelector,Va as formFieldRegisterSelector,za as formFieldRegistryAtom,Ka as formFieldUnregisterSelector,Qa as formFieldsErrorWatcherAddSelector,Oa as formFieldsErrorWatcherAtom,Ha as formFieldsErrorWatcherRemoveSelector,Ma as formFieldsExcludedAtom,au as formatCurrency,xg as getAgGridSRNo,$o as getCurrencySymbol,Tg as getGridRowData,ka as getIn,ya as greaterThanDate,Ba as greaterThanInclusiveDate,wa as greaterThanInclusiveString,ga as greaterThanString,Vs as groupBy,Rg as handleDeleteButtonClick,wu as hashCode,Cu as isDuplicate,Ea as isInteger,Bu as isMimeTypeValid,Na as isObject,Sa as isString,Ug as lessThanDate,xa as lessThanInclusiveDate,va as lessThanInclusiveString,ba as lessThanString,Ng as parseDate,wo as queryClient,Lg as removeExistingRowData,Fa as ruleEngine,mm as serverGridContextGenerator,Pg as setErrorMessage,Ta as setIn,fa as singletonFunctionRegisrationFactory,ma as singletonFunctionRegisrationFactoryForTableCells,Xa as subscribeToFormFieldsSelector,ds as transformDependentFieldsState,Eu as transformFileObject,Fu as transformMetaDataByMutating,Vl as useAutoRefresh,dm as useDialogStyles,Fm as useDialogStylesDetailsGrid,as as useField,Is as useFieldArray,Ls as useForm,fd as usePopupContext,ns as usePropertiesConfigContext,Cm as useSnackbarProviderWrapper,bm as useTabStyles,id as useWorkerContext,Ts as utilFunction,Nu as validateFilesAndAddToList,Da as yupReachAndValidate,Ia as yupValidationHelper};
133
+ var a,s="undefined",o=null,l=!1,h=function(e,t){this.files={},this.root="",e&&this.load(e,t)};h.signature={LOCAL_FILE_HEADER:"PK",CENTRAL_FILE_HEADER:"PK",CENTRAL_DIRECTORY_END:"PK",ZIP64_CENTRAL_DIRECTORY_LOCATOR:"PK",ZIP64_CENTRAL_DIRECTORY_END:"PK",DATA_DESCRIPTOR:"PK\b"},h.defaults={base64:l,binary:l,dir:l,date:o,compression:o},h.support={arraybuffer:typeof ArrayBuffer!==s&&typeof Uint8Array!==s,nodebuffer:!0,uint8array:typeof Uint8Array!==s,blob:function(){if(typeof ArrayBuffer===s)return l;var e=new ArrayBuffer(0);try{return 0===new Blob([e],{type:"application/zip"}).size}catch(e){}try{var t=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder);return t.append(e),0===t.getBlob("application/zip").size}catch(e){}return l}()},h.prototype=function(){var e,t;h.support.uint8array&&"function"==typeof TextEncoder&&"function"==typeof TextDecoder&&(e=new TextEncoder("utf-8"),t=new TextDecoder("utf-8"));var i=function(e){if(e._data instanceof h.CompressedObject&&(e._data=e._data.getContent(),e.options.binary=!0,e.options.base64=!1,"uint8array"===h.utils.getTypeOf(e._data))){var t=e._data;e._data=new Uint8Array(t.length),0!==t.length&&e._data.set(t,0)}return e._data},r=function(t){var r=i(t);if("string"===h.utils.getTypeOf(r)){if(!t.options.binary){if(e)return e.encode(r);if(h.support.nodebuffer)return new Tn(r,"utf-8")}return t.asBinary()}return r},n=function(e){var t=i(this);return null==t?"":(this.options.base64&&(t=h.base64.decode(t)),t=e&&this.options.binary?h.prototype.utf8decode(t):h.utils.transformTo("string",t),e||this.options.binary||(t=h.prototype.utf8encode(t)),t)},a=function(e,t,i){this.name=e,this._data=t,this.options=i};a.prototype={asText:function(){return n.call(this,!0)},asBinary:function(){return n.call(this,!1)},asNodeBuffer:function(){var e=r(this);return h.utils.transformTo("nodebuffer",e)},asUint8Array:function(){var e=r(this);return h.utils.transformTo("uint8array",e)},asArrayBuffer:function(){return this.asUint8Array().buffer}};var s=function(e,t){var i,r="";for(i=0;i<t;i++)r+=String.fromCharCode(255&e),e>>>=8;return r},o=function(){var e,t,i={};for(e=0;e<arguments.length;e++)for(t in arguments[e])arguments[e].hasOwnProperty(t)&&void 0===i[t]&&(i[t]=arguments[e][t]);return i},l=function(e,t,i){var r=c(e),n=h.utils.getTypeOf(t);if(r&&d.call(this,r),i=function(e){return!0===(e=e||{}).base64&&null==e.binary&&(e.binary=!0),(e=o(e,h.defaults)).date=e.date||new Date,null!==e.compression&&(e.compression=e.compression.toUpperCase()),e}(i),i.dir||null==t)i.base64=!1,i.binary=!1,t=null;else if("string"===n)i.binary&&!i.base64&&!0!==i.optimizedBinaryString&&(t=h.utils.string2binary(t));else{if(i.base64=!1,i.binary=!0,!(n||t instanceof h.CompressedObject))throw new Error("The data of '"+e+"' is in an unsupported format !");"arraybuffer"===n&&(t=h.utils.transformTo("uint8array",t))}return this.files[e]=new a(e,t,i)},c=function(e){"/"==e.slice(-1)&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf("/");return t>0?e.substring(0,t):""},d=function(e){return"/"!=e.slice(-1)&&(e+="/"),this.files[e]||l.call(this,e,null,{dir:!0}),this.files[e]},u=function(e,t){var i,n=new h.CompressedObject;return e._data instanceof h.CompressedObject?(n.uncompressedSize=e._data.uncompressedSize,n.crc32=e._data.crc32,0===n.uncompressedSize||e.options.dir?(t=h.compressions.STORE,n.compressedContent="",n.crc32=0):e._data.compressionMethod===t.magic?n.compressedContent=e._data.getCompressedContent():(i=e._data.getContent(),n.compressedContent=t.compress(h.utils.transformTo(t.compressInputType,i)))):((i=r(e))&&0!==i.length&&!e.options.dir||(t=h.compressions.STORE,i=""),n.uncompressedSize=i.length,n.crc32=this.crc32(i),n.compressedContent=t.compress(h.utils.transformTo(t.compressInputType,i))),n.compressedSize=n.compressedContent.length,n.compressionMethod=t.magic,n},A=function(e,t,i,r){i.compressedContent;var n,a,o=this.utf8encode(t.name),l=o!==t.name,c=t.options;n=c.date.getHours(),n<<=6,n|=c.date.getMinutes(),n<<=5,n|=c.date.getSeconds()/2,a=c.date.getFullYear()-1980,a<<=4,a|=c.date.getMonth()+1,a<<=5,a|=c.date.getDate();var d="";return d+="\n\0",d+=l?"\0\b":"\0\0",d+=i.compressionMethod,d+=s(n,2),d+=s(a,2),d+=s(i.crc32,4),d+=s(i.compressedSize,4),d+=s(i.uncompressedSize,4),d+=s(o.length,2),d+="\0\0",{fileRecord:h.signature.LOCAL_FILE_HEADER+d+o,dirRecord:h.signature.CENTRAL_FILE_HEADER+"\0"+d+"\0\0\0\0\0\0"+(!0===t.options.dir?"\0\0\0":"\0\0\0\0")+s(r,4)+o,compressedObject:i}},p=function(){this.data=[]};p.prototype={append:function(e){e=h.utils.transformTo("string",e),this.data.push(e)},finalize:function(){return this.data.join("")}};var f=function(e){this.data=new Uint8Array(e),this.index=0};return f.prototype={append:function(e){0!==e.length&&(e=h.utils.transformTo("uint8array",e),this.data.set(e,this.index),this.index+=e.length)},finalize:function(){return this.data}},{load:function(e,t){throw new Error("Load method is not defined. Is the file jszip-load.js included ?")},filter:function(e){var t,i,r,n,s=[];for(t in this.files)this.files.hasOwnProperty(t)&&(r=this.files[t],n=new a(r.name,r._data,o(r.options)),i=t.slice(this.root.length,t.length),t.slice(0,this.root.length)===this.root&&e(i,n)&&s.push(n));return s},file:function(e,t,i){if(1===arguments.length){if(h.utils.isRegExp(e)){var r=e;return this.filter(function(e,t){return!t.options.dir&&r.test(e)})}return this.filter(function(t,i){return!i.options.dir&&t===e})[0]||null}return e=this.root+e,l.call(this,e,t,i),this},folder:function(e){if(!e)return this;if(h.utils.isRegExp(e))return this.filter(function(t,i){return i.options.dir&&e.test(t)});var t=this.root+e,i=d.call(this,t),r=this.clone();return r.root=i.name,r},remove:function(e){e=this.root+e;var t=this.files[e];if(t||("/"!=e.slice(-1)&&(e+="/"),t=this.files[e]),t)if(t.options.dir)for(var i=this.filter(function(t,i){return i.name.slice(0,e.length)===e}),r=0;r<i.length;r++)delete this.files[i[r].name];else delete this.files[e];return this},generate:function(e){e=o(e||{},{base64:!0,compression:"STORE",type:"base64"}),h.utils.checkSupport(e.type);var t,i,r=[],n=0,a=0;for(var l in this.files)if(this.files.hasOwnProperty(l)){var c=this.files[l],d=c.options.compression||e.compression.toUpperCase(),m=h.compressions[d];if(!m)throw new Error(d+" is not a valid compression method !");var g=u.call(this,c,m),w=A.call(this,l,c,g,n);n+=w.fileRecord.length+g.compressedSize,a+=w.dirRecord.length,r.push(w)}var b;switch(b=h.signature.CENTRAL_DIRECTORY_END+"\0\0\0\0"+s(r.length,2)+s(r.length,2)+s(a,4)+s(n,4)+"\0\0",e.type.toLowerCase()){case"uint8array":case"arraybuffer":case"blob":case"nodebuffer":t=new f(n+a+b.length);break;default:t=new p(n+a+b.length)}for(i=0;i<r.length;i++)t.append(r[i].fileRecord),t.append(r[i].compressedObject.compressedContent);for(i=0;i<r.length;i++)t.append(r[i].dirRecord);t.append(b);var v=t.finalize();switch(e.type.toLowerCase()){case"uint8array":case"arraybuffer":case"nodebuffer":return h.utils.transformTo(e.type.toLowerCase(),v);case"blob":return h.utils.arrayBuffer2Blob(h.utils.transformTo("arraybuffer",v));case"base64":return e.base64?h.base64.encode(v):v;default:return v}},crc32:function(e,t){if(void 0===e||!e.length)return 0;var i="string"!==h.utils.getTypeOf(e),r=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];void 0===t&&(t=0);t^=-1;for(var n=0,a=e.length;n<a;n++)t=t>>>8^r[255&(t^(i?e[n]:e.charCodeAt(n)))];return-1^t},clone:function(){var e=new h;for(var t in this)"function"!=typeof this[t]&&(e[t]=this[t]);return e},utf8encode:function(t){if(e){var i=e.encode(t);return h.utils.transformTo("string",i)}if(h.support.nodebuffer)return h.utils.transformTo("string",new Tn(t,"utf-8"));for(var r=[],n=0,a=0;a<t.length;a++){var s=t.charCodeAt(a);s<128?r[n++]=String.fromCharCode(s):s>127&&s<2048?(r[n++]=String.fromCharCode(s>>6|192),r[n++]=String.fromCharCode(63&s|128)):(r[n++]=String.fromCharCode(s>>12|224),r[n++]=String.fromCharCode(s>>6&63|128),r[n++]=String.fromCharCode(63&s|128))}return r.join("")},utf8decode:function(e){var i=[],r=0,n="string"!==h.utils.getTypeOf(e),a=0,s=0,o=0,l=0;if(t)return t.decode(h.utils.transformTo("uint8array",e));if(h.support.nodebuffer)return h.utils.transformTo("nodebuffer",e).toString("utf-8");for(;a<e.length;)(s=n?e[a]:e.charCodeAt(a))<128?(i[r++]=String.fromCharCode(s),a++):s>191&&s<224?(o=n?e[a+1]:e.charCodeAt(a+1),i[r++]=String.fromCharCode((31&s)<<6|63&o),a+=2):(o=n?e[a+1]:e.charCodeAt(a+1),l=n?e[a+2]:e.charCodeAt(a+2),i[r++]=String.fromCharCode((15&s)<<12|(63&o)<<6|63&l),a+=3);return i.join("")}}}(),h.compressions={STORE:{magic:"\0\0",compress:function(e){return e},uncompress:function(e){return e},compressInputType:o,uncompressInputType:o}},function(){function e(e){return e}function t(e,t){for(var i=0;i<e.length;++i)t[i]=255&e.charCodeAt(i);return t}function i(e){var t=65536,i=[],r=e.length,n=h.utils.getTypeOf(e),a=0,s=!0;try{switch(n){case"uint8array":String.fromCharCode.apply(null,new Uint8Array(0));break;case"nodebuffer":String.fromCharCode.apply(null,new Tn(0))}}catch(e){s=!1}if(!s){for(var o="",l=0;l<e.length;l++)o+=String.fromCharCode(e[l]);return o}for(;a<r&&t>1;)try{"array"===n||"nodebuffer"===n?i.push(String.fromCharCode.apply(null,e.slice(a,Math.min(a+t,r)))):i.push(String.fromCharCode.apply(null,e.subarray(a,Math.min(a+t,r)))),a+=t}catch(e){t=Math.floor(t/2)}return i.join("")}function r(e,t){for(var i=0;i<e.length;i++)t[i]=e[i];return t}h.utils={string2binary:function(e){for(var t="",i=0;i<e.length;i++)t+=String.fromCharCode(255&e.charCodeAt(i));return t},string2Uint8Array:function(e){return h.utils.transformTo("uint8array",e)},uint8Array2String:function(e){return h.utils.transformTo("string",e)},arrayBuffer2Blob:function(e){h.utils.checkSupport("blob");try{return new Blob([e],{type:"application/zip"})}catch(e){}try{var t=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder);return t.append(e),t.getBlob("application/zip")}catch(e){}throw new Error("Bug : can't construct the Blob.")},string2Blob:function(e){var t=h.utils.transformTo("arraybuffer",e);return h.utils.arrayBuffer2Blob(t)}};var n={};n.string={string:e,array:function(e){return t(e,new Array(e.length))},arraybuffer:function(e){return n.string.uint8array(e).buffer},uint8array:function(e){return t(e,new Uint8Array(e.length))},nodebuffer:function(e){return t(e,new Tn(e.length))}},n.array={string:i,array:e,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return new Tn(e)}},n.arraybuffer={string:function(e){return i(new Uint8Array(e))},array:function(e){return r(new Uint8Array(e),new Array(e.byteLength))},arraybuffer:e,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return new Tn(new Uint8Array(e))}},n.uint8array={string:i,array:function(e){return r(e,new Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:e,nodebuffer:function(e){return new Tn(e)}},n.nodebuffer={string:i,array:function(e){return r(e,new Array(e.length))},arraybuffer:function(e){return n.nodebuffer.uint8array(e).buffer},uint8array:function(e){return r(e,new Uint8Array(e.length))},nodebuffer:e},h.utils.transformTo=function(e,t){if(t||(t=""),!e)return t;h.utils.checkSupport(e);var i=h.utils.getTypeOf(t);return n[i][e](t)},h.utils.getTypeOf=function(e){return"string"==typeof e?"string":"[object Array]"===Object.prototype.toString.call(e)?"array":h.support.nodebuffer&&Tn.isBuffer(e)?"nodebuffer":h.support.uint8array&&e instanceof Uint8Array?"uint8array":h.support.arraybuffer&&e instanceof ArrayBuffer?"arraybuffer":void 0},h.utils.isRegExp=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},h.utils.checkSupport=function(e){var t=!0;switch(e.toLowerCase()){case"uint8array":t=h.support.uint8array;break;case"arraybuffer":t=h.support.arraybuffer;break;case"nodebuffer":t=h.support.nodebuffer;break;case"blob":t=h.support.blob}if(!t)throw new Error(e+" is not supported by this browser")}}(),h.CompressedObject=function(){this.compressedSize=0,this.uncompressedSize=0,this.crc32=0,this.compressionMethod=o,this.compressedContent=o},h.CompressedObject.prototype={getContent:function(){return o},getCompressedContent:function(){return o}},h.base64=(a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",{encode:function(e,t){for(var i,r,n,s,o,l,h,c="",d=0;d<e.length;)s=(i=e.charCodeAt(d++))>>2,o=(3&i)<<4|(r=e.charCodeAt(d++))>>4,l=(15&r)<<2|(n=e.charCodeAt(d++))>>6,h=63&n,isNaN(r)?l=h=64:isNaN(n)&&(h=64),c=c+a.charAt(s)+a.charAt(o)+a.charAt(l)+a.charAt(h);return c},decode:function(e,t){var i,r,n,s,o,l,h="",c=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");c<e.length;)i=a.indexOf(e.charAt(c++))<<2|(s=a.indexOf(e.charAt(c++)))>>4,r=(15&s)<<4|(o=a.indexOf(e.charAt(c++)))>>2,n=(3&o)<<6|(l=a.indexOf(e.charAt(c++))),h+=String.fromCharCode(i),64!=o&&(h+=String.fromCharCode(r)),64!=l&&(h+=String.fromCharCode(n));return h}}),void 0!==window.jQuery&&(window.jQuery.fn.webdatarocks=function(e){return(e=e||{}).container=this.get(0),e=window.WebDataRocks?window.WebDataRocks(e):window.PivotApi(e),this.data("webdatarocks",e),e}),void 0!==window.angular&&window.angular.module("webdatarocks",[]).directive("wbrPivot",function(){return{restrict:"A",scope:{report:"=wbrReport",customizeCell:"&wbrCustomizeCell",cellclick:"&wbrCellClick",celldoubleclick:"&wbrCellDoubleClick",dataerror:"&wbrDataError",datafilecancelled:"&wbrDataFileCancelled",dataloaded:"&wbrDataLoaded",datachanged:"&wbrDataChanged",fieldslistclose:"&wbrFieldsListClose",fieldslistopen:"&wbrFieldsListOpen",filteropen:"&wbrFilteropen",fullscreen:"&wbrFullscreen",loadingdata:"&wbrLoadingData",loadinglocalization:"&wbrLoadingLocalization",loadingolapstructure:"&wbrLoadingOlapStructure",loadingreportfile:"&wbrLoadingReportFile",localizationerror:"&wbrLocalizationError",localizationloaded:"&wbrLocalizationLoaded",openingreportfile:"&wbrOpeningReportFile",querycomplete:"&wbrQueryComplete",queryerror:"&wbrQueryError",ready:"&wbrReady",reportchange:"&wbrReportChange",reportcomplete:"&wbrReportComplete",reportfilecancelled:"&wbrReportFileCancelled",reportfileerror:"&wbrReportFileError",reportfileloaded:"&wbrReportFileLoaded",runningquery:"&wbrRunningQuery",update:"&wbrUpdate",beforetoolbarcreated:"&wbrBeforeToolbarCreated"},link:function(e,t,i,r){(r={}).container=t[0],function(e,t){void 0!==e.wbrGlobal&&(t.global=e.wbrGlobal),void 0!==e.wbrWidth&&(t.width=e.wbrWidth),void 0!==e.wbrHeight&&(t.height=e.wbrHeight),void 0!==e.wbrToolbar&&(t.toolbar=!0===e.wbrToolbar||"true"==e.wbrToolbar||"on"==e.wbrToolbar)}(i,r),e.customizeCell&&(r.customizeCell=function(t,i){return e.customizeCell({html:t,data:i})}),e.cellclick&&(r.cellclick=function(t){e.cellclick({cell:t})}),e.celldoubleclick&&(r.celldoubleclick=function(t){e.celldoubleclick({cell:t})}),r.dataerror=e.dataerror,r.datafilecancelled=e.datafilecancelled,r.dataloaded=e.dataloaded,r.datachanged&&(r.datachanged=function(t){e.datachanged({event:t})}),r.fieldslistclose=e.fieldslistclose,r.fieldslistopen=e.fieldslistopen,r.filteropen&&(r.filteropen=function(t){e.filteropen({params:t})}),r.fullscreen&&(r.fullscreen=function(t){e.fullscreen({fullScreenMode:t})}),r.loadingdata=e.loadingdata,r.loadinglocalization=e.loadinglocalization,r.loadingolapstructure=e.loadingolapstructure,r.loadingreportfile=e.loadingreportfile,r.localizationerror=e.localizationerror,r.localizationloaded=e.localizationloaded,r.olapstructureerror=e.olapstructureerror,r.olapstructureloaded=e.olapstructureloaded,r.openingreportfile=e.openingreportfile,r.querycomplete=e.querycomplete,r.queryerror=e.queryerror,e.ready&&(r.ready=function(){e.ready({pivot:n})}),r.reportchange=e.reportchange,r.reportcomplete=e.reportcomplete,r.reportfilecancelled=e.reportfilecancelled,r.reportfileerror=e.reportfileerror,r.reportfileloaded=e.reportfileloaded,r.runningquery=e.runningquery,r.loadingdata=e.loadingdata,r.loadingdata=e.loadingdata,r.loadingdata=e.loadingdata,r.update=e.update,e.beforetoolbarcreated&&(r.beforetoolbarcreated=function(t){e.beforetoolbarcreated({toolbar:t})}),e.report&&(r.report=e.report),e.global&&(r.global=e.global);var n=new WebDataRocks(r)}}}),void 0!==window.React&&(window.WebDataRocksReact={Pivot:React.createClass({propTypes:{global:React.PropTypes.object,width:React.PropTypes.oneOfType([React.PropTypes.string,React.PropTypes.number]),height:React.PropTypes.oneOfType([React.PropTypes.string,React.PropTypes.number]),report:React.PropTypes.oneOfType([React.PropTypes.string,React.PropTypes.object]),toolbar:React.PropTypes.bool,customizeCell:React.PropTypes.func,cellclick:React.PropTypes.func,celldoubleclick:React.PropTypes.func,dataerror:React.PropTypes.func,datafilecancelled:React.PropTypes.func,dataloaded:React.PropTypes.func,datachanged:React.PropTypes.func,fieldslistclose:React.PropTypes.func,fieldslistopen:React.PropTypes.func,filteropen:React.PropTypes.func,fullscreen:React.PropTypes.func,loadingdata:React.PropTypes.func,loadinglocalization:React.PropTypes.func,loadingolapstructure:React.PropTypes.func,loadingreportfile:React.PropTypes.func,localizationerror:React.PropTypes.func,localizationloaded:React.PropTypes.func,olapstructureerror:React.PropTypes.func,olapstructureloaded:React.PropTypes.func,openingreportfile:React.PropTypes.func,querycomplete:React.PropTypes.func,queryerror:React.PropTypes.func,ready:React.PropTypes.func,reportchange:React.PropTypes.func,reportcomplete:React.PropTypes.func,reportfilecancelled:React.PropTypes.func,reportfileerror:React.PropTypes.func,reportfileloaded:React.PropTypes.func,runningquery:React.PropTypes.func,update:React.PropTypes.func,beforetoolbarcreated:React.PropTypes.func},render:function(){return React.DOM.div()},componentDidMount:function(){var e={};e.container=ReactDOM.findDOMNode(this),this.parseProps(e),this.webdatarocks=new window.WebDataRocks(e)},shouldComponentUpdate:function(){return!1},componentWillUnmount:function(){},parseProps:function(e){for(var t in this.props)e[t]=this.props[t]}})}),e.exports&&(e.exports=WebDataRocks)}(Zd,Zd.exports)),Zd.exports}var tu=function(e){var t={};function i(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=e,i.c=t,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=0)}([function(e,t,i){Object.defineProperty(t,"__esModule",{value:!0}),t.Pivot=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e},n=function(){function e(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,i,r){return i&&e(t.prototype,i),r&&e(t,r),t}}(),a=l(i(1)),s=l(i(2)),o=l(i(3));function l(e){return e&&e.__esModule?e:{default:e}}var h=t.Pivot=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return i.DOMNodeRef=s.default.createRef(),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"componentDidMount",value:function(){var e=this.DOMNodeRef.current;this.webdatarocks=new o.default(r({},this.props,{container:e}))}},{key:"shouldComponentUpdate",value:function(){return!1}},{key:"componentWillUnmount",value:function(){this.webdatarocks.dispose()}},{key:"render",value:function(){return s.default.createElement("div",{ref:this.DOMNodeRef},"Pivot")}}]),t}(s.default.Component);h.propTypes={beforetoolbarcreated:a.default.func,cellclick:a.default.func,celldoubleclick:a.default.func,customizeCell:a.default.func,datachanged:a.default.func,dataerror:a.default.func,datafilecancelled:a.default.func,dataloaded:a.default.func,fieldslistclose:a.default.func,fieldslistopen:a.default.func,filteropen:a.default.func,fullscreen:a.default.func,global:a.default.object,height:a.default.oneOfType([a.default.string,a.default.number]),loadingdata:a.default.func,loadinglocalization:a.default.func,loadingreportfile:a.default.func,localizationerror:a.default.func,localizationloaded:a.default.func,openingreportfile:a.default.func,querycomplete:a.default.func,queryerror:a.default.func,ready:a.default.func,report:a.default.oneOfType([a.default.string,a.default.object]),reportchange:a.default.func,reportcomplete:a.default.func,reportfilecancelled:a.default.func,reportfileerror:a.default.func,reportfileloaded:a.default.func,runningquery:a.default.func,toolbar:a.default.bool,update:a.default.func,width:a.default.oneOfType([a.default.string,a.default.number])},t.default=h},function(e,t){e.exports=Yd()},function(e,t){e.exports=r},function(e,t){e.exports=eu()}]);const iu=({rows:t,columns:i,title:r="",onClose:n=()=>{}})=>{const a=o(null),{dynamicAmountSymbol:l,decimalCount:h}=ns();const c=s(()=>i.filter(e=>!0!==e?.isAutoSequence&&"SRNO"!==e.accessor),[i]),d=s(()=>{const e={};return c.forEach(t=>{"currency"===t.componentType||t.Cell===Vc?e[t.columnName]={type:"number"}:"date"===t.componentType||t.Cell===Lc||t.Cell===Tc?e[t.columnName]={type:"datetime"}:e[t.columnName]={type:"string"}}),e},[c]),u=s(()=>t&&t.length?t.map(e=>{const{SRNO:t,...i}=e.values;return i}):[],[t]),A=s(()=>{if(!u||!u.length)return[];const e=u.map(e=>{const t={};return c.forEach(i=>{t[i.columnName]=e[i.accessor]}),t});return[d,...e]},[u,c,d]);return e("div",{children:e(tu.Pivot,{ref:a,toolbar:!0,beforetoolbarcreated:function(e){let t=e.getTabs();e.getTabs=function(){t=t.filter(e=>"wdr-tab-connect"!==e.id&&"wdr-tab-open"!==e.id&&"wdr-tab-save"!==e.id&&"wdr-tab-fullscreen"!==e.id),t.push({id:"wdr-tab-fullscreen",title:"Fullscreen",rightGroup:!0,mobile:!1,handler:()=>{var e;document.fullscreenElement?document.exitFullscreen&&document.exitFullscreen():(e=document.documentElement).requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen&&e.msRequestFullscreen()},icon:e.icons.fullscreen},{id:"wdr-tab-close-modal tab",title:"Close",handler:n,rightGroup:!0,icon:'<svg fill="#000000" height="30px" width="30px" version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" \n viewBox="0 0 512 512" xml:space="preserve">\n <g>\n <g>\n <polygon points="512,59.076 452.922,0 256,196.922 59.076,0 0,59.076 196.922,256 0,452.922 59.076,512 256,315.076 452.922,512 \n 512,452.922 315.076,256"/>\n </g>\n </g>\n </svg>'});const i=t.map(e=>{if("wdr-tab-export"===e.id){e.menu=e.menu.filter(e=>"wdr-tab-export-print"!==e.id&&"wdr-tab-export-pdf"!==e.id);let t=e.menu.findIndex(e=>"wdr-tab-export-excel"===e.id),i=e.menu.findIndex(e=>"wdr-tab-export-html"===e.id);-1!==t&&(e.menu[t].handler=()=>{a.current?.webdatarocks?.exportTo("excel",{filename:r||"pivot"})}),-1!==i&&(e.menu[i].handler=()=>{a.current?.webdatarocks?.exportTo("html",{filename:r||"pivot"})})}return e});return i}},height:670,customizeCell:function(e,t){e.text="(blank)"===e.text?" ":e.text},report:{formats:[{name:"",decimalPlaces:h,currencySymbol:$o(l),thousandsSeparator:","}],dataSource:{data:A},options:{grid:{type:"flat",showTooltips:!1},drillThrough:!1}}})})};let ru=[];const nu=({label:r,dense:n,columns:a,data:l,loading:c,getRowId:u,defaultColumn:A,allowColumnReordering:p,disableSorting:f,defaultHiddenColumns:m,defaultSortOrder:g,defaultGroupBy:w,multipleActions:b,singleActions:v,doubleClickAction:y,alwaysAvailableAction:B,setGridAction:C,updateGridData:x,hideFooter:F,hideHeader:S,disableGlobalFilter:N,disableGroupBy:E,disableLoader:k,containerHeight:T,occupiedHeight:L,gridProps:I,pageSizes:D,defaultPageSize:U,enablePagination:P,allowRowSelection:R,hideNoDataFound:O,refetchData:Q,hiddenFlag:H,autoRefreshInterval:M,allowFilter:_,filterMeta:j,allowColumnHiding:z,defaultFilter:V,isCusrsorFocused:K,onButtonActionHandel:G,controlsAtBottom:J,actionContextAtBottom:Y,headerToolbarStyle:Z,disableMultipleRowSelect:ee,columnHeaderStyle:te,variant:ie,enablePaginationInput:re,defaultSelectedRowId:ne,footerNote:ae,footerNoteStyles:se,paginationText:oe,searchPlaceholder:le,enableExport:he,subGridLabel:de,hideActionBar:ue,finalMetaData:Ae,externalExportState:pe,onExportModalClose:fe,enablePdfPrint:me,reportTemplateCode:ge,enablePivot:we,handleClickAction:be,RenderSubHeader:ve,subHeaderComponentProps:ye,gridPaperProps:Be,enableEnterToFocus:Ce})=>{const[xe,Fe]=d(V);ru=s(()=>fl(xe,l),[xe,l]);const[Se,Ne]=d(ne),{defaultGridConfig:Ee}=ns(),ke=s(()=>[...a].map(e=>e.pinColumn?{...e,disableResizing:!0}:e).sort((e,t)=>(e.sequence??0)-(t.sequence??0)),[a]),{getTableProps:Te,getTableBodyProps:Le,headerGroups:Ie,prepareRow:De,selectedFlatRows:Ue,rows:Pe,page:Re,gotoPage:Oe,footerGroups:Qe,setPageSize:He,state:Me,setGlobalFilter:_e,preGlobalFilteredRows:je,state:Ve,setSortBy:Ke,columns:qe,toggleAllRowsSelected:Ge,visibleColumns:We}=Gt({initialState:{pageIndex:0,pageSize:U,hiddenColumns:m,sortBy:g,groupBy:w},columns:ke,defaultColumn:A,data:ru,getRowId:u,allowColumnReordering:p,autoResetSortBy:!1,disableSortBy:Boolean(f),disableGlobalFilter:Boolean(N),disableGroupBy:Boolean(E),updateGridData:x,gridProps:I,singleActions:v,setGridAction:C,hiddenFlag:H,loading:c,onButtonActionHandel:G,autoResetGlobalFilter:!1,autoResetPage:!a?.some(e=>Boolean(e?.enableColumnSelection)),globalFilter:(e,t,i)=>((e,t,i,r)=>{const n=i.toLowerCase();return e.filter(e=>t.some(t=>{const i=r.find(e=>e.accessor===t),a=e.values[t];return!ys(a)||"dateTime"!==i?.componentType&&"date"!==i?.componentType?String(a).toLowerCase().includes(n):ze(new Date(a),i.dateFormat??"dd/MM/yyyy hh:mm a").toLowerCase().includes(n)}))})(e,t,i,Ae)},Wt,Jt,Xt,Yt,$t,Zt,ei,ti,ii,((t,i)=>r=>{Boolean(t)&&r.visibleColumns.push(t=>{const r=t.some(e=>"left"===e.pinColumn);return[{id:"selectionCheckbox",Header:t=>e(Rl,{...t,hasLeftPinnedColumn:r,setContextMenuSelectedRowId:i}),Cell:t=>e(Pl,{...t,hasLeftPinnedColumn:r,setContextMenuSelectedRowId:i}),minWidth:40,width:40,maxWidth:40,pinColumn:r?"left":void 0},...t]})})(R&&!ee,Ne)),{pageIndex:Je,pageSize:Xe,sortBy:Ye}=Ve,{authState:$e}=es(),Ze=Ah(),[et,tt]=d(!1),[it,rt]=d(!1),nt=o(null),at=o(null),st=o(null),ot=o(null),lt=P?Re:Pe,{t:ht}=W(),ct=s(()=>Pe.reduce((e,t)=>(t?.original?._hidden||++e,e),0),[Pe]);v=pl(v,ct),b=pl(b,ct),v=Al(v,Ue,$e),b=Al(b,Ue,$e),B=Al(B,Pe,$e,!1,!0);const[dt,ut]=d(null),[At,pt]=d(null),ft=o(0),gt=o(null),wt=(e,t)=>{Oe(t)},bt=e=>{He(Number(e.target.value))};h(()=>{const e=e=>{"Enter"===e.key&&st.current&&st?.current?.click?.()};return window.document.addEventListener("keypress",e),()=>{window.document.removeEventListener("keypress",e)}},[]),h(()=>{const e=setTimeout(()=>{ot.current?.focus?.()},200);return()=>{e&&clearTimeout(e)}},[c]),h(()=>{Ue.length>0&&ee&&JSON.stringify(Ue[0]?.original)!==JSON.stringify(at.current)&&(at.current=Ue[0]?.original,C({name:"_rowChanged",rows:[{data:Ue[0]?.original}]}))},[ee,Ue,C]);const vt=s(()=>{const e=e=>{const t=Ue.length>0&&!Y&&!ue&&R?`calc(${T?.[e]} - 48px)`:T?.[e];return t&&L?.[e]?J||Y&&Ue.length>0?xe.length?`calc(${t} - ${L?.[e]} - 98px)`:`calc(${t} - ${L?.[e]} - 50px)`:xe.length?`calc(${t} - ${L?.[e]} - 48px)`:`calc(${t} - ${L?.[e]})`:xe.length>0?`calc(${t} - 48px)`:t};return{min:e("min"),max:e("max")}},[Ue,Y,ue,T,L,xe,R,J]);h(()=>{if(!ee)return;const e=Ue[0]?.id,t=1===Ue.length&&e===Se,i=!Se&&0===Ue.length;if(!t&&!i&&(Ue.length>0&&Ge(!1),Se)){const e=Pe.find(e=>e.id===Se);e&&!e.isSelected&&e.toggleRowSelected(!0)}},[Pe,Se,ee,Ue]);const yt=s(()=>{if(!We||0===We.length)return{leftMap:{},rightMap:{}};const e=Ve?.columnResizing?.columnWidths??{},t=t=>{const i=e[t.id]??t.totalWidth??t.width??A?.width;return Number.parseFloat(i)||150},i={},r={};let n=0;We.forEach(e=>{"left"===e.pinColumn&&(i[e.id]=n,n+=t(e))});let a=0;return[...We].reverse().forEach(e=>{"right"===e.pinColumn&&(r[e.id]=a,a+=t(e))}),{leftMap:i,rightMap:r}},[We,Ve?.columnResizing?.columnWidths,A?.width]);return t(i,{children:[t(ni,{style:{width:"100%"},...Be,children:[Boolean(S)?null:e(Yl,{label:r,dense:n,preGlobalFilteredRows:je,globalFilter:Me.globalFilter,setGlobalFilter:_e,alwaysAvailableAction:J?[]:B,setGridAction:C,filteredRows:Pe,selectedFlatRows:Ue,disableGlobalFilter:Boolean(N),refetchData:Q,autoRefreshInterval:M,gotoPage:Oe,setSortBy:Ke,allowFilter:_,filters:xe,setAllFilters:Fe,filterMeta:j,visibleColumns:qe,defaultHiddenColumns:m,allowColumnHiding:z,loading:c,headerToolbarStyle:Z,searchPlaceholder:le,enableExport:he&&lt?.length,setOpenExport:tt,subGridLabel:de,enablePivot:we&&lt?.length,setOpenPivot:rt,RenderSubHeader:ve,subHeaderComponentProps:ye}),ve&&!ye.__showInHeader?e(ve,{...ye}):null,Boolean(Y)||ue||!R?null:e(Ql,{dense:n,selectedFlatRows:Ue,multipleActions:b,singleActions:v,setGridAction:C,submitButtonRef:st,loading:c}),e(Ml,{contextMenuRow:At,selectedFlatRows:Ue,singleActions:v,multipleActions:b,setGridAction:C,mouseX:dt?.mouseX??null,mouseY:dt?.mouseY??null,handleClose:()=>{pt(null),ut(null)},authState:$e}),e(hh,{dense:n,setAllFilters:Fe,filters:xe,gotoPage:Oe,setSortBy:Ke}),k?null:c?e(mt,{color:"secondary"}):e(sh,{}),t(si,{style:{position:"relative",display:"inline-block",overflow:"auto",padding:"outlined"===ie?"0 .5rem":"",maxHeight:vt.max,minHeight:vt.min,borderBottom:F?"":"1px solid rgba(133, 130, 130, 0.8)"},children:[t(oi,{component:"div",...Te(),size:n?"small":"medium",children:[e($l,{component:"div",sx:{background:te?.background?te?.background:te?.backgroundColor?te?.backgroundColor:"standard"!==ie?"var(--theme-color4)":"white"},children:Ie.map(t=>e(hi,{sx:{background:"inherit"},component:"div",...t.getHeaderGroupProps(),children:t.headers.map(t=>e(th,{variant:ie,column:t,rows:lt,pinnedOffsets:yt,visibleColumns:We,children:t.render("Header")},t.getHeaderProps().key))}))}),t(di,{component:"div",ref:nt,...Le([{style:{display:"block"}}]),onContextMenu:e=>{ct<=0&&(v.length>0||b.length>0)&&(e.preventDefault(),pt({}),Ne(""),ut(null===dt?{mouseX:e.clientX-2,mouseY:e.clientY-4}:null))},style:{height:`calc(${vt.min} - 62px)`},children:[lt.length<=0&&!1===O?e(q,{container:!0,justifyContent:"center",children:e("div",{style:{position:"absolute",left:"50%",height:`calc(${vt.min} - 50px)`,display:"flex",alignItems:"center",fontStyle:"italic",color:"rgba(133, 130, 130, 0.8)"},children:ht("Nodatafound")})}):null,lt.map((t,i)=>{if(Boolean(t?.original?.[H]))return null;De(t);const r=(e=>t=>{t.preventDefault(),pt(e),Ne(e?.id),ut(null===dt?{mouseX:t.clientX-2,mouseY:t.clientY-4}:null)})(t),n=(e=>t=>{t.preventDefault(),void 0!==Al(y,[e],$e,!0)&&C({name:y.actionName,rows:[{data:e?.original,id:e?.id}]})})(t),a=((e,t,i)=>r=>{if("INPUT"!==r?.target?.tagName&&"TEXTAREA"!==r?.target?.tagName&&"BUTTON"!==r?.target?.tagName){if("Enter"!==r.key&&"Tab"!==r.key&&r.preventDefault(),"Space"===r.code&&Boolean(y)&&Ee?.enableDoubleSpaceAction)if(ft.current+=1,2===ft.current){if(void 0===Al(y,[i],$e,!0))return;C({name:y.actionName,rows:[{data:i?.original,id:i?.id}]}),ft.current=0}else gt.current&&clearTimeout(gt.current),gt.current=setTimeout(()=>{ft.current=0},300);"ArrowUp"===r.key&&t>0?e[t-1]?.id&&(Ge(!1),e[t-1].toggleRowSelected(!0),Ne(e[t-1]?.id),r?.target?.previousElementSibling?.focus?.()):"ArrowDown"===r.key&&t<e.length-1&&e[t+1]?.id&&(Ge(!1),e[t+1].toggleRowSelected(!0),Ne(e[t+1].id),r?.target?.nextElementSibling?.focus?.())}})(lt,i,t);let s=[];Boolean(t?.original?._rowColor)&&(s=[{style:{background:t?.original?._rowColor}}]),Boolean(t?.original?._style)&&(s=[{style:{...s[0]?.style,...t?.original?._style}}]),K&&(s.length>0?s[0].style.cursor="pointer":s=[{style:{cursor:"pointer"}}]);const o=Boolean(t.isSelected)||Se===t.id;return e(Zl,{...t.getRowProps(s),id:t.id,tabIndex:0,component:"div",ref:t.isSelected||Se===t.id?ot:null,selected:o,onKeyDown:a,onContextMenu:e=>{Ge(!1),t.toggleRowSelected(!0),r(e)},onDoubleClick:Boolean(y)?n:void 0,onClick:e=>{Boolean(ee)&&(Ge(!1),t.toggleRowSelected(!0),Ne(t.id)),"function"==typeof be&&be(e,{data:t?.original,id:t?.id})},className:"outlined"===ie?Ze.outlinedClass:null,sx:{"& > .MuiTableCell-root":{border:"outlined"===ie?"none !important":"auto"},background:t?.original?._rowColor?`${t?.original?._rowColor} !important`:o?"#ccc !important":""},children:t.cells.map(e=>{const{key:t}=e.getCellProps();return e.isAggregated?e.render("Aggregated",{key:t,pinnedOffsets:yt,visibleColumns:We}):e.render("Cell",{key:t,pinnedOffsets:yt,visibleColumns:We})})})})]}),e(({footerGroup:t})=>Array.isArray(t?.headers)&&t.headers.some(e=>e.isTotalWithCurrency||e.isTotalWithoutCurrency||e.isSelectedTotal)?e(ce,{component:"div",style:{color:"var(--theme-color2)",background:"var(--theme-color4)",position:"sticky",bottom:0},children:e(hi,{...t.getFooterGroupProps(),component:"div",children:t.headers.map(t=>e(ci,{...t.getFooterProps({style:{textAlign:t?.TableCellProps?.align||"unset",display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"0px 10px",lineHeight:"22px",fontWeight:700,fontSize:"small",color:"var(--theme-color3)"}}),component:"div",children:t.render("Footer")},t.id))})}):null,{footerGroup:Qe[0]})]}),e(oh,{open:Boolean(c)})]}),ae&&e(X,{component:"div",fontWeight:500,pl:"24px",sx:se,children:ht(ae)}),F?null:P&&Pe.length>U?e(Vi,{sx:{display:"flex","& .MuiToolbar-root":{display:"flex",alignItems:"baseline",minHeight:"44px"}},variant:"body",component:"div",rowsPerPageOptions:[...new Set([U,...D])]?.sort((e,t)=>e-t),colSpan:3,count:Pe.length,rowsPerPage:Number(Xe),page:Number(Je),onPageChange:wt,onRowsPerPageChange:bt,ActionsComponent:re?nh:rh}):t(ci,{style:{display:"flex",padding:"8px"},children:[ht("TotalNoofRecords")," ",ht(oe),": ",ct]}),Boolean(J)||Boolean(Y)?t("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",padding:Ue.length>0||J?".5rem":0,paddingTop:0},children:[Boolean(J)&&e(Hl,{actions:B,setAction:C,selectedRows:Ue.map(e=>({data:e.original,id:e.id})),filteredRows:Pe,buttonTextColor:"#fff",buttonBackground:"var(--theme-color1)",loading:c},"alwaysRender"),Boolean(Y)&&1===Ue.length?e(Hl,{actions:v,setAction:C,selectedRows:Ue.map(e=>({data:e.original,id:e.id})),buttonTextColor:"#fff",buttonBackground:"var(--theme-color1)",style:{border:"1px solid var(--theme-color3)",width:"8rem"},submitButtonRef:st,loading:c},"singleFilters"):null,Boolean(Y)&&Ue.length>0?e(Hl,{actions:b,setAction:C,selectedRows:Ue.map(e=>({data:e.original,id:e.id})),buttonTextColor:"#fff",buttonBackground:"var(--theme-color1)",submitButtonRef:st,loading:c},"multipleFilters"):null]}):null]}),it?e($,{open:!0,fullScreen:!0,children:e(iu,{rows:Pe,title:r,columns:Ae,onClose:()=>rt(!1)})}):null,et||pe?e($,{open:et||pe,children:e(Bd,{globalFilter:Me.globalFilter??"",filters:xe,title:r,rows:Pe,columns:Ae,onClose:()=>{tt(!1),"function"==typeof fe&&fe()},enablePdfPrint:me,reportTemplateCode:l?.find(e=>e?.REPORT_PERSONALIZATION_ID)?.REPORT_PERSONALIZATION_ID??ge,enableEnterToFocus:Ce})}):null]})};function au(e,t,i="en-IN",r=0,n="start",a=" "){const s=new Intl.NumberFormat(i,{minimumFractionDigits:r}).format(e);return"end"===n?`${s} ${t} ${a}`:`${t} ${s} ${a}`}const su=t=>{const i=ns(),{dynamicAmountSymbol:r,currencyFormat:n,decimalCount:a}=i,{value:s,row:o,column:{isCurrencyCode:l,currencyRefColumn:h,currencySymbolPosition:c}}=t;let d="";l?d=$o(h??r):o&&(d=$o(o?.original?.[h]||r));let u="";return null===s||""===s||isNaN(Number(s))||(u=`${au(s,d,n,a,c)}`),e(ho,{...t,children:u})},ou=(e,t,i,r=0)=>`${i} ${new Intl.NumberFormat(t,{minimumFractionDigits:r}).format(e)}`,lu=A(({rows:e,column:{id:r,isTotalWithoutCurrency:n=!1,isTotalWithCurrency:a=!1,totalDecimalCount:o,isSelectedTotal:l=!1,setFooterValue:h,footerLabel:c="",footerIsMultivalue:d=!1,currencyRefColumn:u,isCurrencyCode:A,Cell:p}})=>{const f=ns();let m=c,g=e.filter(e=>!e.original.ignoreValue);const w=s(()=>g.reduce((e,t)=>Number(t.values?.[r]??0)+e,0),[g,r]),b=e.filter(e=>e.isSelected),v=s(()=>b.reduce((e,t)=>Number(t.values?.[r]??0)+e,0),[b,r]);let y=n?"":$o(f.dynamicAmountSymbol);a&&(A?y=$o(u??f.dynamicAmountSymbol):e?.[0]?.original?.[u]&&(y=$o(e?.[0]?.original?.[u]??"")));const B=s(()=>{if(!h)return isNaN(w)?"":p===su?ou(w,f.currencyFormat,y,o??f.decimalCount):w;if("function"==typeof h){const e=h(w,g,f);return d?(Array.isArray(e)&&e?.forEach((e,t)=>{m=m.replace(`{${t}}`,e)}),m):isNaN(e)?0:e}},[b,v,w,g]),C=isNaN(v)?"":p===su?ou(v,f.currencyFormat,y,o??f.decimalCount):v;return t(i,{children:[(a||n)&&""!==B&&t("span",{style:{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:m.includes("\n")?"pre-line":"nowrap",textAlign:"center"},children:[`${Boolean(m)?m:""}`," ",!d&&B]}),l&&""!==C&&t("span",{style:{paddingLeft:"10px"},children:["Selected Total: ",C]})]})}),hu=c((t,i)=>e(jl,{children:e(cu,{...t,ref:i})})),cu=c(({finalMetaData:t,data:i,setData:r,actions:n,setAction:a,loading:c,gridProps:d,refetchData:u,defaultSortOrder:A=[],defaultGroupBy:f=[],defaultFilter:m=[],hideHeader:g=!1,hideFooter:w=!1,autoRefreshInterval:b=0,onClickActionEvent:v=()=>{},controlsAtBottom:y=!1,actionContextAtBottom:B=!1,headerToolbarStyle:C={},disableMultipleRowSelect:x=!1,columnHeaderStyle:F={},variant:S,defaultSelectedRowId:N="",enableExport:E=!1,fieldDataRef:k=null,externalExportState:T=!1,onExportModalClose:L,reportTemplateCode:I,enablePivot:D,handleClickAction:U,RenderSubHeader:P,subHeaderComponentProps:R={},focusScopeId:O="enter-to-focus-static-grid",enableEnterToFocus:Q},H)=>{const{authState:M}=es(),{defaultGridConfig:_,defaultExportConfig:j,enableEnterToFocus:z}=ns(),{pause:V,resume:K}=zl(),q=o(null),{t:G}=W();null===q.current&&(q.current=du({metaData:t,actions:n,setAction:a,authState:M,fieldDataRef:k}));let J=o(i);J.current=i;let X=q.current;const Y=s(()=>Array.isArray(X.columns)?X.columns.map(e=>({...e,columnName:G(e.columnName)})):X.columns??[],[G]),$=s(()=>Array.isArray(X.filters)?X.filters.map(e=>({...e,columnName:G(e.columnName)})):X.filters??[],[G]),Z=s(()=>m,[m]),ee=s(()=>Y.reduce((e,t)=>(e[t.accessor]=t.validation,e),{}),[Y]),te=s(()=>Y.reduce((e,t)=>(e[t.accessor]="",e),{}),[Y]),ie=s(()=>({width:150,maxWidth:200,minWidth:50,Header:Cl,Footer:lu,...X?.gridConfig?.defaultColumnConfig}),[X?.gridConfig?.defaultColumnConfig]),re=l(e=>e[X?.gridConfig?.rowIdColumn],[X?.gridConfig?.rowIdColumn]),ne=s(()=>A,[]),ae=s(()=>f,[]),se=l((e,t,i,n,a,s="S")=>{let o=0;r(r=>r?.map((l,h)=>{if(!("A"===s||h===e))return Boolean(l?._hidden)||(o+=1),{...l,_displaySequence:o};let c=!0,d="";if(c=(!Boolean(r?.[h]?._oldData?.[t])||!Boolean(i)||r?.[h]?._oldData?.[t]!==i)&&(!!Boolean(r?.[h]?._isTouchedCol?.[t])||(!(!Boolean(r[h]?.[t])||Boolean(i))||(!(!Boolean(r[h]?.[t])||!Boolean(i)||r[h]?.[t]==i)||!(Boolean(r[h]?.[t])||!Boolean(i))))),c){let e=r?.[h]?._oldData?.[t];d=null==e?r?.[h]?.[t]??"":e}else d=r?.[h]?._oldData?.[t]??"";let u={...r[h],[t]:i,_touched:{...r?.[h]?._touched,[t]:n},_error:{...r?.[h]?._error,[t]:a},_isTouchedCol:{...r?.[h]?._isTouchedCol,[t]:c},_oldData:{...r?.[h]?._oldData}};return c&&(u={...u,_oldData:{...u._oldData,[t]:d}}),"_hidden"!==t&&(o+=1),{...u,_displaySequence:o}}))},[r]),oe=l(()=>Array.isArray(J.current)?J.current.map(e=>{const{_touched:t,_error:i,_rowColor:r,_style:n,...a}=e;return a}):[],[]),le=l(async(e,t)=>{let i=!1,r=Object.keys(ee);if(!Array.isArray(e))return{isValid:i,data:[]};let n=e.map(async(n,a)=>{let s=X?.gridConfig?.hiddenFlag;if(Boolean(n?.[s]))return n;const o=n._touched??{},l=n._error??{};for(let h=0;h<r.length;h++){const c=o[r[h]],d=l[r[h]],u=n[r[h]],A=ee[r[h]];if(Boolean(c)&&!1===t){if(!Boolean(d))continue;i=!0}else if("function"==typeof A){let t=await A(u,n,e.slice(0,a).filter(e=>!0!==Boolean(e[s])),e.slice(a+1).filter(e=>!0!==Boolean(e[s])));Boolean(t)&&(i=!0),o[r[h]]=!0,l[r[h]]=t}}return{...n,_touched:o,_error:l}}),a=await Promise.all(n);return{hasError:i,data:a}},[]),he=l(async e=>le(J.current,e),[]),ce=l((e,t)=>{v(e,t,i[e])},[i]);p(H,()=>({validate:(e=!1)=>he(e),validator:()=>le,cleanData:()=>oe(),columns:te,pause:V,resume:K,refetch:u,updateGridData:se}));const de=o(null),ue=Q??z,Ae=O&&ue?{"data-scope-id":O}:{};return h(()=>{ue&&de.current&&de.current.focus()},[ue]),Array.isArray(i)?e("div",{ref:de,tabIndex:ue?0:-1,onKeyDown:e=>{ue&&Es(e,O)},style:{width:"100%",position:"relative"},...Ae,children:e(nu,{label:X.gridConfig?.gridLabel?G(X.gridConfig.gridLabel):Ss(window.location.pathname,M?.menulistdata??[],X?.gridConfig?.setScreenCode??!0,X?.gridConfig?.showUserCode??!1),dense:!0,getRowId:re,columns:Y,defaultColumn:ie,data:i,loading:c,allowColumnReordering:X.gridConfig?.allowColumnReordering,disableSorting:X?.gridConfig?.disableSorting,defaultHiddenColumns:X.hiddenColumns,defaultSortOrder:ne,defaultGroupBy:ae,multipleActions:X?.multipleActions,singleActions:X?.singleActions,handleClickAction:U,doubleClickAction:X?.doubleClickAction,alwaysAvailableAction:X?.alwaysAvailableAction,setGridAction:X?.setAction,updateGridData:se,hideFooter:X?.gridConfig?.hideFooter??w,hideHeader:X?.gridConfig?.hideHeader??g,containerHeight:X?.gridConfig?.containerHeight,occupiedHeight:X?.gridConfig?.occupiedHeight,allowRowSelection:X?.gridConfig?.allowRowSelection??!0,disableGlobalFilter:X?.gridConfig?.disableGlobalFilter,disableGroupBy:X?.gridConfig?.disableGroupBy,disableLoader:X?.gridConfig?.disableLoader,pageSizes:X?.gridConfig?.pageSizes??[5,10],defaultPageSize:X?.gridConfig?.defaultPageSize??10,enablePagination:X?.gridConfig?.enablePagination??!1,hideNoDataFound:X?.gridConfig?.hideNoDataFound??!1,hiddenFlag:X?.gridConfig?.hiddenFlag,gridProps:d,refetchData:u,autoRefreshInterval:b,allowFilter:X.gridConfig?.allowFilter??!1,filterMeta:$,allowColumnHiding:X.gridConfig?.allowColumnHiding??!1,defaultFilter:Z,isCusrsorFocused:X.gridConfig?.isCusrsorFocused??!1,onButtonActionHandel:ce,controlsAtBottom:y,actionContextAtBottom:B,headerToolbarStyle:C,disableMultipleRowSelect:x,columnHeaderStyle:F,variant:S??_?.variant??"standard",enablePaginationInput:X.gridConfig?.enablePaginationInput??_?.enablePaginationInput??!0,defaultSelectedRowId:N,searchPlaceholder:X.gridConfig?.searchPlaceholder??"records",paginationText:X.gridConfig?.paginationText??"records",enableExport:E,footerNote:X.gridConfig?.footerNote??"",footerNoteStyles:X.gridConfig?.footerNoteStyles??{},subGridLabel:G(X.gridConfig?.subGridLabel??""),hideActionBar:X.gridConfig.hideActionBar??!1,finalMetaData:t.columns.map(e=>({...e,columnName:G(e.columnName)})),externalExportState:T,onExportModalClose:L,enablePdfPrint:X?.gridConfig?.enablePdfPrint??j?.enablePdfPrint??!1,reportTemplateCode:I,enablePivot:D,RenderSubHeader:P,subHeaderComponentProps:R,gridPaperProps:X?.gridConfig?.gridPaperProps??{},enableEnterToFocus:ue})}):e("div",{children:"Invalid data received"})});hu.displayName="GridWrapper";const du=({metaData:e,actions:t,setAction:i,authState:r,fieldDataRef:n})=>{let a=N(e),s=(e=>Rs(e,fa,gl,wl))(a),o=s.columns;const l=cl(o);o=(e=>Array.isArray(e)?e.map(e=>{const{schemaValidation:t,...i}=e;return{...i,schemaValidation:vl(t)}}):[])(o),o=uo(o),o=oo(o),o=((e,t,i)=>Array.isArray(e)?e.map(e=>{const{schemaValidation:r,validation:n,...a}=e;return{...a,validation:Bl(r,n,t,i)}}):[])(o,r,n),o=dl(o);let h=a.filters;try{h=hl(h)}catch(e){console.log(e)}const c=ul(t??null);return{hiddenColumns:l,columns:o,gridConfig:a.gridConfig,setAction:i,filters:h,...c}},uu=e=>[{columnName:"FileName",componentType:e?"editableTextField":"default",accessor:"name",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Size",componentType:"default",accessor:"sizeStr",sequence:2,alignment:"left",width:100,maxWidth:100,minWidth:100},{columnName:"Type",componentType:"default",accessor:"fileExt",sequence:3,alignment:"left",width:100,maxWidth:100,minWidth:100}],Au={columns:[{columnName:"File ID",componentType:"default",accessor:"id",sequence:0,alignment:"left",isVisible:!1},...uu(!1)],gridConfig:{dense:!0,gridLabel:"Files",rowIdColumn:"id",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!0,disableGlobalFilter:!0,disableGroupBy:!0,disableLoader:!0,hideHeader:!0,containerHeight:{min:"40vh",max:"50vh"}}},pu={columns:[{columnName:"File ID",componentType:"default",accessor:"id",sequence:0,alignment:"left",isVisible:!1},{columnName:"File Name",componentType:"default",accessor:"name",sequence:1,alignment:"left",width:400,maxWidth:400,minWidth:400},{columnName:"Size",componentType:"default",accessor:"sizeStr",sequence:2,alignment:"left",width:100,maxWidth:100,minWidth:100},{columnName:"Type",componentType:"default",accessor:"fileExt",sequence:3,alignment:"left",width:100,maxWidth:100,minWidth:100},{columnName:"Reason",componentType:"default",accessor:"failedReason",sequence:4,alignment:"left",width:300,maxWidth:300,minWidth:300}],gridConfig:{dense:!0,gridLabel:"Failed To Add These Files For Upload",rowIdColumn:"id",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,allowRowSelection:!1,disableGlobalFilter:!0,disableSorting:!0,disableGroupBy:!0,hideHeader:!0}},fu=Ci(e=>({uploadWrapper:{backgroundImage:"url(\"data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' stroke='%232538584A' stroke-width='4' stroke-dasharray='8' stroke-dashoffset='4' stroke-linecap='square'/%3e%3c/svg%3e\")",display:"flex",alignItems:"center",justifyContent:"center",padding:e.spacing(4)}})),mu=({disabled:e})=>({pointerEvents:e?"none":"all",opacity:e?.5:1}),gu=r=>{const n=fu(),{onDrop:a,disabled:s,existingFiles:l,accept:h,multiple:c}=r,d=o(null),{t:u}=W(),[{canDrop:A,isOver:p},f]=bt({accept:[gt.FILE],drop(e,t){if("function"==typeof a){const e=Array.from(t.getItem().files);a(e,l)}},collect:e=>({isOver:e.isOver(),canDrop:e.canDrop()})}),m=A&&p;return e("div",{ref:f,style:mu({disabled:Boolean(s)}),className:n.uploadWrapper,children:m?e(vt,{children:u("DropFileshere")}):t(i,{children:[e(vt,{children:u("DragandDropor")}),e(ct,{color:"secondary",onClick:()=>d?.current?.click(),children:u("Browse")}),e("input",{type:"file",multiple:c,accept:Array.isArray(h)?h?.map(e=>`.${e}`).join(","):`.${h}`,style:{display:"none"},ref:d,onChange:e=>{const t=e.target.files,i=Array.from(t);a(i,l)},onClick:e=>{e.target.value=""}})]})})};function wu(e){var t=0;if(0===e.length)return t;for(var i=0;i<e.length;i++){t=(t<<5)-t+e.charCodeAt(i),t&=t}return t}function bu(e){return wu([e.name,e.type,e.size,e.lastModified].join("-"))}const vu=e=>{if(Number.isInteger(Number(e))){let t=`${e} bytes`;const i=["KB","MB","GB","TB","PB","EB","ZB","YB"];for(let r=0,n=e/1024;n>1;n/=1024,r++)t=`${n.toFixed(2)} ${i[r]}`;return t}return"cannot compute size"},yu=async e=>{var t;return await(t=e,new Promise((e,i)=>{try{const r=new FileReader;r.onloadend=i=>{const r=new Uint8Array(i?.target?.result).subarray(0,4);let n,a="";for(let e=0;e<r.length;e++){let t=r[e].toString(16);t.length<2&&(t="0"+t),a+=t}switch(a=a.toUpperCase(),a){case"FFD8FFE0":case"FFD8FFE1":case"FFD8FFE2":case"FFD8FFE3":n={ext:"jpg",mime:"image/jpeg"};break;case"89504E47":n={ext:"png",mime:"image/png"};break;case"47494638":n={ext:"gif",mime:"image/gif"};break;case"25504446":n={ext:"pdf",mime:"application/pdf"};break;case"504B0304":n={ext:t.name.split(".").pop()??"xlsx",mime:t.type??"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};break;case"494433":n={ext:"mp3",mime:"audio/mpeg"};break;case"66747970":n={ext:"mp4",mime:"video/mp4"};break;case"52494646":n={ext:"wav",mime:"audio/wav"};break;case"74657874":n={ext:"txt",mime:"text/plain"};break;default:return void e(void 0)}e(n)},r.onerror=i,r.readAsArrayBuffer(t.slice(0,4))}catch(e){i(void 0)}}))};const Bu=(e,t)=>"all"===t||Array.isArray(t)&&t.indexOf(e)>-1,Cu=(e,t)=>Array.isArray(t)&&t.indexOf(e.id)>-1;function xu(e,t){const i="object"==typeof e&&URL.createObjectURL(e),r=document.createElement("a");r.href=String(i),r.download=t??e.name??`download-${(new Date).getUTCMilliseconds()}`;const n=()=>{setTimeout(()=>{URL.revokeObjectURL(String(i)),r.removeEventListener("click",n)},150)};r.target="_blank",r.addEventListener("click",n,!1),r.click()}const Fu=(e,t,i)=>{const r=N(e);if(Boolean(i))for(let e=0;e<r.columns.length;e++)"name"===r.columns[e].accessor&&(r.columns[e].componentType="editableTextField");return Array.isArray(t)&&(r.columns=[...e.columns,...t]),r},Su=e=>{if(Array.isArray(e)){return e.reduce((e,t)=>(e[t.accessor]="",e),{})}return{}},Nu=(e,t,i)=>async(r,n)=>{let a=[],s=r.map(t=>e(t)),o=await Promise.all(s),l=[];Array.isArray(n)&&(l=n.map(e=>e.id));let h=o.filter(e=>e.size>t?(a.push({...e,failedReason:"File Size exceed maximum size"}),!1):Bu(e.fileExt,i)?!Cu(e,l)||(a.push({...e,failedReason:"File already added for uploading"}),!1):(a.push({...e,failedReason:"File type is not allowed"}),!1));return{failedFiles:a,filteredNewFilesObj:h}},Eu=e=>async t=>{const i=await yu(t);return{...e,id:bu(t),blob:t,name:t.name.split(".").slice(0,-1).join("."),sizeStr:vu(t.size),size:t.size,mimeType:t.type,_mimeType:i?.mime??t.type,ext:i?.ext??t.name.split(".").pop(),fileExt:t.name.split(".").pop()}},ku=e=>Array.isArray(e)?e.map(e=>{const{id:t,blob:i,name:r,sizeStr:n,size:a,mimeType:s,_mimeType:o,ext:l,fileExt:h,...c}=e;return{name:`${r}.${l}`,blob:i,ext:l,id:t,...c}}):[],Tu=async e=>{let t=[];if(!Array.isArray(e)||0===e.length)return t;for(let i=0;i<e.length;i++){const{blob:r,...n}=e[i];let a=await fs(r);t.push({...n,blob:a[1],blobtype:a[0]})}return t},Lu=e=>{const t=new FormData;if(!Array.isArray(e)||0===e.length)return t;const i={};for(let r=0;r<e.length;r++){const{blob:n,id:a,...s}=e[r];t.append("blob",n,`${a}`),i[`${a}`]=s}return t.append("metaData",JSON.stringify(i)),t},Iu=e=>{const t=e[0]?.map((e,t)=>({accessor:e,columnName:e,sequence:t+1,componentType:"default",width:180,minWidth:120,maxWidth:600,showTooltip:!0}));let i=[];return t&&(i=[{columnName:"UNIQUE",accessor:"UNIQUE",componentType:"default",isVisible:!1},...t]),i},Du=e=>{const t=e.slice(1).map(t=>t.reduce((t,i,r)=>({...t,[e[0][r]]:i}),{}));let i=[];return t&&(i=t.map((e,t)=>({UNIQUE:t+1,...e}))),i},Uu=e=>({gridConfig:{gridLabel:"",rowIdColumn:"UNIQUE",defaultColumnConfig:{width:400,maxWidth:450,minWidth:300},hideHeader:!0,disableGroupBy:!0,enablePagination:!0,pageSizes:[15,30,50],defaultPageSize:15,containerHeight:{min:"67vh",max:"70vh"},allowFilter:!1,allowColumnHiding:!1,allowRowSelection:!1},columns:Iu(e)??[]}),Pu=({blob:i,fileName:r,onClose:n})=>{const[a,s]=d([]),[o,l]=d(!1);return h(()=>{(()=>{const e=new FileReader;l(!0),e.onload=e=>{const t=e.target.result,i=tt.read(t,{type:"binary",raw:!1}),r=i.SheetNames[0],n=i.Sheets[r],a=tt.utils.sheet_to_json(n,{header:1,raw:!1}).map(e=>e.map(e=>{const t=Fs(e,!0);return t instanceof Date&&Ve(t)?t.toLocaleDateString("en-UK"):e}));l(!1),s(a)},i?e.readAsBinaryString(i):s([])})()},[]),t(f,{children:[t(At,{style:{display:"flex",padding:"8px 24px"},children:[e(vt,{variant:"h6",color:"textSecondary",children:"File:"}),e(vt,{variant:"h6",children:r}),e("div",{style:{flexGrow:1}}),"function"==typeof n?e(C,{color:"secondary",onClick:n,children:e(Bt,{})}):null]}),t(pt,{children:[o?e(no,{}):null,a.length>0?e(cu,{finalMetaData:Uu(a??[]),data:Du(a)??[],setData:()=>null},"previewExcelFileData"):e("p",{style:{textAlign:"center",color:"#888"},children:e("em",{children:o?"File is Loading...":"Empty file found!!!"})})]})]})},Ru=({blob:i,fileName:r,onClose:n})=>{const[a,s]=d([]),[o,l]=d(!1);return h(()=>{(async()=>{l(!0),Ct.parse(i,{header:!1,skipEmptyLines:!0,complete:e=>{l(!1);const t=e.data.map(e=>e.map(e=>{const t=Fs(e,!0);return t instanceof Date&&Ve(t)?t.toLocaleDateString("en-UK"):e}));s(t)},error:e=>{l(!1),s([])}})})()},[]),t(f,{children:[t(At,{style:{display:"flex",padding:"8px 24px"},children:[e(vt,{variant:"h6",color:"textSecondary",children:"File:"}),e(vt,{variant:"h6",children:r}),e("div",{style:{flexGrow:1}}),"function"==typeof n?e(C,{color:"secondary",onClick:n,children:e(Bt,{})}):null]}),t(pt,{children:[o?e(no,{}):null,a.length>0?e(cu,{finalMetaData:Uu(a??[]),data:Du(a)??[],setData:()=>null},"previewCsvFileData"):e("p",{style:{textAlign:"center",color:"#888"},children:e("em",{children:o?"File is Loading...":"Empty file found!!!"})})]})]})},Ou=({blob:r,fileName:n,onClose:a,optionalActionButton:s,hideDownloadBtn:o=!1,hideFilename:l=!1,contentStyle:c,actionStyle:u})=>{const{t:A}=W(),[p,m]=d("object"==typeof r&&Boolean(r)?URL.createObjectURL(r):null);return h(()=>{let e=p??"";return()=>{URL.revokeObjectURL(e)}},[]),h(()=>{m("object"==typeof r&&Boolean(r)?URL.createObjectURL(r):null)},[r]),t(f,{children:[t(At,{style:{display:"flex",padding:"8px 24px",...u},children:[l?null:t(i,{children:[t(vt,{variant:"h6",color:"textSecondary",children:[A("File"),":"]}),e(vt,{variant:"h6",children:n})]}),e("div",{style:{flexGrow:1}}),Boolean(s)?e(eo,{color:"primary",onClick:()=>{"function"==typeof s?.callback&&s.callback()},children:s?.label??"NO_LABEL"}):null,o&&e(C,{color:"secondary",onClick:()=>xu(r,n),children:e(yt,{})}),"function"==typeof a?e(C,{color:"secondary",onClick:a,children:e(Bt,{})}):null]}),e(pt,{style:{...c},children:e("iframe",{title:"Document Preview",src:`${p}`,style:{height:"100%",width:"100%"},"aria-label":"PDF Preview"})})]})},Qu=({blob:r,fileName:n,onClose:a,hideFilename:s,canZoom:o=!0})=>{const[l,c]=d("object"==typeof r&&Boolean(r)?URL.createObjectURL(r):""),[u,A]=d(1);return h(()=>{let e=l??"";return()=>URL.revokeObjectURL(e)},[]),h(()=>{c("object"==typeof r&&Boolean(r)?URL.createObjectURL(r):"")},[r]),t(f,{children:[t(At,{style:{display:"flex",padding:"8px 24px"},children:[s?null:t(i,{children:[e(vt,{variant:"h6",color:"textSecondary",children:"File:"}),e(vt,{variant:"h6",children:n})]}),e("div",{style:{flexGrow:1}}),o?t(i,{children:[e(C,{color:"secondary",onClick:()=>A(e=>Math.max(e-.25,.25)),children:e(Ft,{})}),e(C,{color:"secondary",onClick:()=>A(1),children:e(St,{})}),e(C,{color:"secondary",onClick:()=>A(e=>Math.min(e+.25,4)),children:e(xt,{})})]}):null,e(C,{color:"secondary",onClick:()=>xu(r,n),children:e(yt,{})}),"function"==typeof a?e(C,{color:"secondary",onClick:a,children:e(Bt,{})}):null]}),e(pt,{children:e("img",{src:l,alt:"Preview",style:{transform:`scale(${u})`,transition:"transform 0.2s ease",transformOrigin:"top left",maxWidth:"100%",width:"60%",maxHeight:"80vh"}})})]})},Hu=({onClose:i,fileName:r,message:n})=>t(f,{children:[t(At,{style:{display:"flex",padding:"8px 24px"},children:[e(vt,{variant:"h6",color:"textSecondary",children:"File:"}),e(vt,{variant:"h6",children:r}),e("div",{style:{flexGrow:1}}),"function"==typeof i?e(C,{color:"secondary",onClick:i,children:e(Bt,{})}):null]}),e(pt,{children:n})]}),Mu=[{actionName:"Delete",actionLabel:"Delete",multiple:!0,rowDoubleClick:!1},{actionName:"View",actionLabel:"ViewFile",multiple:!1,rowDoubleClick:!1}],_u=({additionalColumns:i,editableFileName:r,onClose:n,onUpload:a,dataChangedRef:c,allowedExtensions:u=["pdf"],maxAllowedSize:A=3145728,gridProps:p,defaultFileData:m=[],onUpdateFileData:g=e=>{},allowMultipleFilesSelection:w=!1})=>{const b=s(()=>Fu(Au,i,r),[]),v=s(()=>Su(i),[]),y=l(e=>Eu(v)(e),[v]),[B,C]=d(m),[x,F]=d(""),[S,N]=d([]),[E,k]=d(!1),[T,L]=d(null),[I,D]=d(!1),[U,P]=d(1/0),R=o(null),{t:O}=W(),Q=l(async(e,t)=>{let{filteredNewFilesObj:i,failedFiles:r}=await Nu(y,A,u)(e,t);C(e=>w?[...e,...i]:i),r.length>0&&(N(r),k(!0))},[C,N,k,y,A,u]);h(()=>{if("Delete"===T?.name){const e=T?.rows?.map?.(e=>e.id),t=B.filter(t=>e.indexOf(t.id)<0);C(t),L(null)}},[T]),h(()=>{g(B)},[B]);const H=l(async e=>{try{let{hasError:t,data:i}=await(R?.current?.validate?.(!0));if(!0===t)return void C(i);let r=R?.current?.cleanData?.(),a=ku(r),s=Lu(a);D(!0),F(""),P(1/0);let o=await Tu(r);await Promise.resolve(e(s,e=>{P(e)},({status:e,data:t})=>{"success"===e?(c.current=!0,n()):F(t?.error_msg??"Unknown error occurred"),P(1/0)},o,r))}catch(e){console.error("Upload failed:",e),F(e?.message||"File upload failed due to a network or server error."),P(1/0)}finally{D(!1)}},[D,F,C]);return t(f,{children:[I?e(mt,{variant:U===1/0?"indeterminate":"determinate",value:U,color:"secondary"}):null,t(at,{children:[e(lt,{title:O("FileUpload"),action:t(ot,{children:[e("div",{style:{flexGrow:2}}),"function"==typeof a?e(ct,{disabled:I||B.length<=0,size:"small",color:"secondary",onClick:()=>H(a),endIcon:I?e(G,{size:20,color:"secondary"}):null,children:O("Upload")}):null,e(ct,{disabled:I||B.length<=0,onClick:()=>C([]),size:"small",color:"secondary",children:O("ClearAll")}),"function"==typeof n?e(ct,{disabled:I,onClick:()=>{let e=R?.current?.cleanData?.();g(e),n()},size:"small",color:"secondary",children:O("Close")}):null]})}),Boolean(x)?e(ft,{severity:"error",children:x}):null,t(st,{children:[e(gu,{existingFiles:B,onDrop:Q,disabled:I,multiple:w,accept:u}),e(ht,{in:B.length>0,children:e(hu,{finalMetaData:b,data:B,setData:C,actions:Mu,setAction:L,loading:I,ref:R,gridProps:p})})]})]}),t(dt,{open:E,maxWidth:"lg",children:[e(ut,{children:O("FailedToAddFollowingFilesForUpload")}),e(pt,{children:e(hu,{finalMetaData:pu,data:S,setData:e=>null})}),e(At,{children:e(ct,{color:"secondary",onClick:()=>{k(!1),N([])},children:O("Ok")})})]}),e(dt,{open:Boolean(T),maxWidth:"lg",onClose:()=>L(null),PaperProps:{style:{width:"100%",height:"100%"}},children:T?.rows[0]?.data?._mimeType?.includes("pdf")?e(Ou,{blob:T?.rows[0]?.data?.blob,fileName:T?.rows[0]?.data?.name,onClose:()=>L(null)}):T?.rows[0]?.data?._mimeType?.includes("image")?e(Qu,{blob:T?.rows[0]?.data?.blob,fileName:T?.rows[0]?.data?.name,onClose:()=>L(null)}):"xlsx"===T?.rows[0]?.data?.ext||"xls"===T?.rows[0]?.data?.ext?e(Pu,{blob:T?.rows[0]?.data?.blob,fileName:T?.rows[0]?.data?.name,onClose:()=>L(null)}):"csv"===T?.rows[0]?.data?.ext?e(Ru,{blob:T?.rows[0]?.data?.blob,fileName:T?.rows[0]?.data?.name,onClose:()=>L(null)}):e(Hu,{fileName:T?.rows[0]?.data?.name,onClose:()=>L(null),message:"No preview available for this file"})})]})},ju=[{actionName:"View",actionLabel:"ViewFile",multiple:!1,rowDoubleClick:!1}],zu=({additionalColumns:i,editableFileName:r,fileData:n,onClose:a,gridProps:l})=>{const h=s(()=>Fu(Au,i,r),[]),[c,u]=d(n??[]),[A,p]=d(null),m=o(null),{t:g}=W();return t(f,{children:[e(at,{children:t(st,{children:[e(lt,{title:g("FileViewer"),action:t(ot,{children:[e("div",{style:{flexGrow:2}}),"function"==typeof a?e(ct,{disabled:!1,onClick:()=>a(),size:"small",color:"secondary",children:g("Close")}):null]})}),e(hu,{finalMetaData:h,data:c,setData:u,actions:ju,setAction:p,loading:!1,ref:m,gridProps:l})]})}),e(dt,{open:Boolean(A),maxWidth:"lg",onClose:()=>p(null),PaperProps:{style:{width:"100%",height:"100%"}},children:A?.rows[0]?.data?._mimeType?.includes("pdf")?e(Ou,{blob:A?.rows[0]?.data?.blob,fileName:A?.rows[0]?.data?.name,onClose:()=>p(null)}):A?.rows[0]?.data?._mimeType?.includes("image")?e(Qu,{blob:A?.rows[0]?.data?.blob,fileName:A?.rows[0]?.data?.name,onClose:()=>p(null)}):e(Hu,{fileName:A?.rows[0]?.data?.name})})]})},Vu=({open:t,closeDialog:r,setImportedData:n})=>{const[a,s]=d(!0),[o,l]=d([]),h=()=>{r()};return e(i,{children:a?e($,{fullWidth:!0,maxWidth:"md",open:t,children:e(_u,{onClose:()=>{h()},additionalColumns:[],editableFileName:!1,defaultFileData:[],onUpload:(e,t,i,r,a)=>{r.length>0?(t(10),setTimeout(async()=>{try{(async(e,t)=>{t(20);let i=80/(e.length>0?e.length:1),r=[];e.forEach((e,n)=>{let a=so({data:e}),{blob:s,...o}=e,l=((e,t,i,r)=>(i(r-10),t))(0,a,t,10+i*(n+1));r=[...r??[],...l]}),t(95),t(100),l(r),n(r),setTimeout(()=>{s(!1),h()},1e3),t(97),r=r.filter(e=>Boolean(e?._isNewRow)),t(99),r=r.map((e,t)=>({...e,TRAN_CD:t+1}))})(r,t)}catch(e){i({status:"failed",data:{error_msg:"Error in file read "+String(e)}})}},1e3)):i({status:"failed",data:{error_msg:"Error in file read"}})},gridProps:{},maxAllowedSize:12328960,allowedExtensions:["xlsx","csv"],onUpdateFileData:e=>{}},"GridFileUploadData")}):null})},Ku=e=>{const{data:t,index:i,style:r}=e;return g(t[i],{style:{...r,whiteSpace:"pre",width:"max-content",minWidth:"100%",top:r.top+8}})},qu=n({}),Gu=c((t,i)=>{const r=a(qu);return e("div",{ref:i,...t,...r})}),Wu=c((t,i)=>{const{children:r,...n}=t,a=b.toArray(r),s=re(),l=Si(s.breakpoints.up("sm"),{noSsr:!0}),c=a.length,d=l?29.5:48,u=()=>d,A=(e=>{const t=o(null);return h(()=>{null!==t.current&&t.current.resetAfterIndex(0,!0)},[e]),t})(c);return e("div",{ref:i,children:e(qu.Provider,{value:n,children:e(Ni,{itemData:a,height:(c>8?10*d:a.map(u).reduce((e,t)=>e+t,0))+16,width:"100%",ref:A,outerElementType:Gu,innerElementType:"ul",itemSize:u,overscan:5,itemCount:c,children:Ku})})})});var Ju=Object.freeze({__proto__:null,ListBoxComponent:Wu});const Xu=[{actionName:"close",actionLabel:"Close",multiple:void 0,alwaysAvailable:!0},{actionName:"close-dbl",actionLabel:"Close",multiple:void 0,alwaysAvailable:!1,rowDoubleClick:!0}],Yu=(e=[],t={})=>({gridConfig:{dense:!0,gridLabel:"SelectAValue",rowIdColumn:"UNIQUE_ID",defaultColumnConfig:{width:440,maxWidth:450,minWidth:300},allowColumnReordering:!0,disableSorting:!1,hideHeader:!1,disableGroupBy:!0,enablePagination:!0,pageSizes:[10,20,30],defaultPageSize:10,containerHeight:{min:"53vh",max:"53vh"},allowFilter:!0,allowColumnHiding:!1,allowRowSelection:!1,isCusrsorFocused:!0},columns:[{accessor:"UNIQUE_ID",columnName:"SrNo",sequence:0,componentType:"default",width:70,minWidth:60,maxWidth:100},...e.length>0?Object.keys(e[0]).map((e,i)=>({accessor:e,columnName:e,sequence:i+1,componentType:"default",width:150,minWidth:100,showTooltip:!0,...t[e]})):[]],filters:e.length>0?Object.keys(e[0]).filter(e=>!1!==t[e]?.isVisible).map(e=>({accessor:e,columnName:t[e]?.columnName??e,filterComponentType:"valueFilter",gridProps:{xs:12,md:12,sm:12}})):[]}),$u=({handleClose:t,options:i,optionsGridColDef:r})=>{const n=s(()=>i.map(e=>{const{label:t,value:i,REPORT_PERSONALIZATION_ID:r,...n}=e;return{label:t,value:i,...n}}),[i]),a=l(e=>{if("close"===e?.name)t();else if("close-dbl"===e?.name){const i=e?.rows[0]?.data?.value??void 0;t(i)}},[]),o=s(()=>n.map((e,t)=>({...e,UNIQUE_ID:t+1})),[n]);return h(()=>{const e=setTimeout(()=>{const e=document.querySelectorAll(".gridwrapper_global_search input");e.length>0&&e[e.length-1].focus()},100);return()=>clearTimeout(e)},[]),e($,{open:!0,className:"optionsGrid",PaperProps:{style:{width:"100%",padding:"8px"}},maxWidth:"md",onKeyUp:e=>{"Escape"===e.key&&t()},children:e(hu,{finalMetaData:Yu(n,r),data:o??[],setData:()=>null,actions:Xu,setAction:a,enableExport:!0},"optionsGrid")})},Zu=vi(ue)({[`& .${fi.listbox}`]:{boxSizing:"border-box","& ul":{padding:0,margin:0}}}),eA=Ci(e=>({root:{"& .MuiInputBase-root.MuiAutocomplete-inputRoot":{paddingRight:"0 !important"},"& .MuiInputBase-root > .MuiAutocomplete-endAdornment":{display:"none"}}})),tA=e=>t=>Boolean(e)?t:t?.label??"",iA=({name:r,validate:n,validationRun:a,shouldExclude:c,isReadOnly:A,postValidationSetCrossFieldValues:p,skipValueUpdateFromCrossFieldWhenReadOnly:m,runPostValidationHookAlways:g,dependentFields:b,fieldKey:v,options:y,GridProps:B,enableGrid:C,multiple:x,disableClearable:F,freeSolo:S,TextFieldProps:N,CircularProgressProps:E,ChipProps:k,showCheckbox:L,CreateFilterOptionsConfig:I,runValidationOnDependentFieldsChange:D,label:U,placeholder:P,limitTags:R,required:O,enableVirtualized:Q,isFieldFocused:H,_optionsKey:M,disableCaching:_,disableAdornment:j,ignoreInSubmit:z=!1,textFieldStyle:V,setFieldLabel:K,defaultValueKey:W,listBoxMinWidth:X,listBoxMaxWidth:Y,setValueOnDependentFieldsChange:$,setValueOnDependentFieldsValueChange:Z,runExternalFunction:ee,onFormDataChange:te,componentType:ie,optionsGridColDef:re,runPostValidationForInitValue:ae,className:se,skipInitialDefaultValueKeyValidation:oe=!1,filterOptionsCb:he,dependentFieldDebounceDelay:ce=300,setColor:ue,customLabelKey:Ae,...pe})=>{const{enableOptionsGridForAutocomplete:fe,refetchOptionsWhenOnline:me}=ns(),[ge,we]=d(B),[be,ve]=d(!1),[ye,Be]=d(!1),{formState:Ce,error:xe,touched:Fe,handleChange:Se,handleBlur:Ne,runValidation:Ee,isSubmitting:ke,validationRunning:Te,fieldKey:Le,name:Ie,dependentValues:De,readOnly:Ue,excluded:Pe,incomingMessage:Re,whenToRunValidation:Oe,value:Qe,prevValue:He,setIncomingMessage:Me,setIgnoreInSubmit:_e,handleOptionValueExtraData:je,setErrorAsCB:ze,setValue:Ve,setFilteredOptions:Ke}=as({name:r,fieldKey:v,dependentFields:b,validate:n,validationRun:a,runPostValidationHookAlways:g,postValidationSetCrossFieldValues:p,isReadOnly:A,shouldExclude:c,runValidationOnDependentFieldsChange:D,skipValueUpdateFromCrossFieldWhenReadOnly:m,runExternalFunction:ee,onFormDataChange:te,componentType:ie,runPostValidationForInitValue:ae,dependentFieldDebounceDelay:ce}),qe=o(),We=eA(),Je=o(-1),Xe=o(new Map),Ye=l(e=>Boolean(S)?e:Ae&&e?.[Ae]?e[Ae]:e?.label??"",[S,Ae]),$e=l((e=>t=>Boolean(e)?t:t?.value??"")(S),[]),[Ze,et]=d("string"==typeof ue?ue:""),tt=l((e,t)=>{if(Array.isArray(e)||(e=[e]),t)return e;return e.map(e=>Xe.current.has(`${e}`)?Xe.current.get(`${e}`):{label:e,value:e})},[]);h(()=>{if("function"==typeof ue){const e=ue(Qe,ds(De),Ce);et("string"!=typeof e?"":e)}},[Qe,De,ue]),h(()=>{if(Boolean(z))if("function"==typeof z){let e=z(ds(De),Ce,{isSubmitting:ke,value:Qe});_e(e)}else _e(z)},[z,_e,De,Qe]);const it=()=>{setTimeout(()=>{qe?.current?.focus?.()},50)};h(()=>{H&&it()},[H]),h(()=>{const e=e=>{if(!ye)return;const t=document.querySelector(`.${fi.listbox}`),i=e.target;t&&(t===i||t.contains(i))||Be(!1)};return window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("scroll",e,!0)}},[ye]);const[rt,nt]=d([]),[at,st]=d([]),ot=l(e=>So(rt)(e),[rt]),lt=l(e=>{if(Xe.current.clear(),"function"==typeof e)nt(t=>{let i=e(t);return S&&Array.isArray(i)?i.map(e=>tA(!1)(e)):(Array.isArray(i)&&i.map(e=>{Xe.current.set(`${$e(e)}`,e)}),i)});else{if(S&&Array.isArray(e)){let t=e.map(e=>tA(!1)(e));return void nt(t)}Array.isArray(e)&&e.map(e=>{Xe.current.set(`${$e(e)}`,e)}),st(e),Ke(e),nt(e)}},[st,nt,Ye,$e]),ht=l(()=>{let e=ot(Qe);je(e),Ne()},[Ne,ot,je,Qe]),ct=(e,t)=>{if(Ue||ke)return;t||(Je.current=-1),Array.isArray(t)||(t=[t]),t=S?t.map(e=>Ye(e)??""):t.map(e=>$e(e)??"");let i=ot(t);je(i),!Boolean(x)&&Array.isArray(t)?Se(t[0],void 0,!1,{optionData:i}):Se(t,void 0,!1,{optionData:i})},dt=l(e=>{"backspace"!==e.key.toLowerCase()&&"escape"!==e.key.toLowerCase()||(Je.current=-1),"tab"===e.key.toLowerCase()&&-1!==Je.current&&rt[Je.current]&&ye&&ct(0,rt[Je.current]),"f9"===e.key.toLowerCase()&&fe&&rt.length&&ve(!0)},[Ye,rt,ct,Je.current]),{loadingOptions:ut,queryError:At,refetchOptions:pt}=Bo(Ce,y,lt,Se,De,Re,Ee,Oe,M,_,Me,!0,"",!1);h(()=>{let e=ot(Qe);je(e)},[ut,ot,je]),h(()=>{if("function"!=typeof he)return;const e=he(at,ds(De),Ce)??at;nt(e),Ke(e)},[De,Ce,at,he,Ke]),h(()=>{if(null!==Re&&"object"==typeof Re){const{error:e,isErrorBlank:t,isFieldFocused:i,GridProps:r}=Re;if("object"==typeof r){const e={...B,xs:r?.xs??B?.xs??"auto",md:r?.md??B?.md??"auto",xl:r?.xl??r?.md??B?.xl??"auto",sm:r?.sm??B?.sm??"auto",lg:r?.lg??r?.md??B?.lg??"auto"};we(e)}i&&it(),t?ze(""):Boolean(e)&&ze(e)}},[Re,ze]);const ft=s(()=>{if("function"==typeof K)return K(ds(De),Qe)},[K,De,Qe]);h(()=>{if(!W||Qe||ut)return;const e=rt.find(e=>e[W]===e.value);if(e){let t=e;Array.isArray(t)||(t=[t]),t=S?t.map(e=>Ye(e)??""):t.map(e=>$e(e)??"");let i=ot(t);je(i),!Boolean(x)&&Array.isArray(t)?Ve(t[0],void 0,void 0,{defaultKeyValue:oe?t[0]:void 0}):Ve(t,void 0,void 0,{defaultKeyValue:oe?t:void 0}),oe||setTimeout(()=>{ht()},30)}},[ut,rt]);const mt=s(()=>{const e=ds(De),t=us(e);return JSON.stringify(t.sort((e,t)=>e.fieldKey.localeCompare(t.fieldKey)).map(e=>e.value))},[De]);h(()=>{if(!mt)return;(async()=>{if("function"==typeof Z)try{let e=await Z(ds(De),Ce,{value:Qe,isSubmitting:ke});if(null!=e){const t=Boolean(e)?rt?.find(t=>e===t.value):null;ct(0,t)}}catch(e){console.error("An error occurred:",e)}})()},[mt,Z,Se]),h(()=>{(async()=>{if("function"==typeof $)try{let e=await $(ds(De),Ce,{value:Qe,isSubmitting:ke});if(null!=e){const t=Boolean(e)?rt?.find(t=>e===t.value):null;ct(0,t)}}catch(e){console.error("An error occurred:",e)}})()},[De,Se,$]);const gt=()=>{"function"==typeof pt&&pt()};h(()=>{const e=()=>{At&&me&&gt()};return window.addEventListener("online",e),()=>window.removeEventListener("online",e)},[At,me]);const wt=l(e=>Fo(rt)(e),[rt]),bt=s(()=>tt(Qe,S),[Qe,S,rt]);if(Pe)return null;const vt=Fe&&""!==(xe??""),yt=t(w,{fallback:"loading...",children:[u(Ai,{...pe,className:j?We.root:"",key:Le,id:Le,defaultValue:[],limitTags:R??2,multiple:x,autoHighlight:!0,open:ye,onOpen:()=>Be(!0),onClose:()=>Be(!1),disableClearable:F,options:rt,freeSolo:S,getOptionLabel:Ye,value:ut?x?[]:null:x?bt:bt.length>0?bt[0]:null,isOptionEqualToValue:(e,t)=>S?e===t:e.value===t.value,PopperComponent:Zu,ListboxComponent:Boolean(Q)?Wu:void 0,PaperComponent:({children:t})=>e("div",{style:{width:"fit-content",background:"white",boxShadow:"rgba(50, 50, 93, 0.25) 0px 2px 5px -1px, rgba(0, 0, 0, 0.3) 0px 1px 3px -1px",overflow:"hidden",maxWidth:Y||"320px",minWidth:X?`max(${X}px, 100%)`:"max(120px, 100%)"},children:t}),onKeyDown:dt,onChange:ct,onBlur:()=>{Je.current=-1,ht()},onHighlightChange:(e,t)=>{Je.current="mousemove"!==e?.type?rt.indexOf(t):-1},disabled:ke||Ue,filterOptions:Boolean(I)&&"object"==typeof I?pi(I):(e,t)=>{const i=t.inputValue.toLowerCase();return e.filter(e=>e.label.toLowerCase().includes(i)).sort((e,t)=>{const r=e.label.toLowerCase().startsWith(i),n=t.label.toLowerCase().startsWith(i);return r&&!n?-1:!r&&n?1:0})},renderTags:(e,t)=>e.map((e,i)=>u(gi,"string"==typeof e?{variant:"outlined",...k,label:e,...t({index:i}),key:e}:{variant:"outlined",...k,label:Ye(e),...t({index:i}),key:`${e.label}-${i}`})),renderInput:r=>{const n=e(Ao,{...N,...r,name:Ie,className:J(se,{hasOldValue:void 0!==He&&void 0!==Qe&&!T.isEqual(He,Qe)}),inputRef:qe,label:ft?.label?Ge(ft.label):U,placeholder:Ue?"":ft?.placeholder?Ge(ft.placeholder)??"":P,autoComplete:"off",type:"text",error:!ke&&vt,required:O,helperText:e(le,{children:!ke&&vt?xe:null}),sx:{"& .MuiInputBase-root":{background:Boolean(Ue||ke)?"#f3f3f3 !important":""},...V},InputProps:{...r.InputProps,endAdornment:t(f,{children:[Te||ut?e(G,{sx:{position:"absolute",right:j?"0.5rem":"1.5rem"},size:25,color:"secondary",variant:"indeterminate",...E}):null,At?e(i,{children:e(de,{onClick:()=>gt(),size:"small",sx:{left:"10px"},title:Ge("refetch")??"",children:e(ki,{fontSize:"small",color:"error"})})}):null,r.InputProps.endAdornment]})},InputLabelProps:{shrink:!0},inputProps:{...r.inputProps,autoComplete:"off",style:{...!ke&&Boolean(Ze)?{color:Ze}:{}}}});return e(i,{children:void 0===He||void 0===Qe||T.isEqual(He,Qe)?n:e(Jo,{title:e(Xo,{label:`${Ge("OldValueOf")} ${ft?.label?Ge(ft.label):U}`,value:He?wt(He)??He:"(blank)"}),arrow:!0,followCursor:!0,children:n})})},renderOption:(i,r,n)=>{i.key=i.id;let{selected:a,inputValue:s}=n,o=r?.label??"";const l=wi(o,s),h=bi(o,l).map((t,i)=>e("span",{style:{fontWeight:t.highlight?700:400,...r?.style??{}},children:t.text},i));return Q?t("li",{style:{whiteSpace:"pre",width:"max-content",minWidth:"100%"},...i,children:[L?e(go,{checked:a}):null,h]}):e(ne,{title:r.label,disableInteractive:!0,children:t("li",{style:{whiteSpace:"pre",width:"max-content",minWidth:"100%"},...i,children:[L?e(go,{checked:a}):null,h]})})}}),be?e($u,{handleClose:e=>{if(e){const t=e?rt?.find(t=>e===t.value):null;ct(0,t)}ve(!1)},options:rt,optionsGridColDef:re}):null]});return Boolean(C)?e(q,{...ge,children:yt}):yt},rA=m(()=>Promise.resolve().then(function(){return Ju}).then(e=>({default:e.ListBoxComponent}))),nA=e=>t=>Boolean(e)?t:t?.label??"",aA=({options:i,optionsProps:r,multiple:n,disableClearable:a,freeSolo:s,CircularProgressProps:h,ChipProps:c,showCheckbox:A,CreateFilterOptionsConfig:p,placeholder:m="Select Option",limitTags:g,required:b,enableVirtualized:v,_optionsKey:y,disableCaching:B,error:C,handleChange:x,handleBlur:F,touched:S,value:N,fullWidth:E,disableAdornment:k,isAutoFocus:T,...L})=>{const I=o(-1),D=o(new Map),U=eA(),P=l(nA(s),[]),R=l((e=>t=>Boolean(e)?t:t?.value??"")(s),[]),O=l((e,t)=>{if(Array.isArray(e)||(e=[e]),t)return e;return e.map(e=>D.current.has(`${e}`)?D.current.get(`${e}`):{label:e,value:e})},[]),[Q,H]=d([]),M=(e,t)=>{t||(I.current=-1),Array.isArray(t)||(t=[t]),t=s?t.map(e=>P(e)??""):t.map(e=>R(e)??""),!Boolean(n)&&Array.isArray(t)?x(t[0]):x(t)},_=l(e=>{"backspace"!==e.key.toLowerCase()&&"escape"!==e.key.toLowerCase()||(I.current=-1),"tab"===e.key.toLowerCase()&&-1!==I.current&&Q[I.current]&&M(0,Q[I.current])},[P,Q,M,I.current]),j=l(e=>{if(D.current.clear(),"function"==typeof e)H(t=>{let i=e(t);return s&&Array.isArray(i)?i.map(e=>nA(!1)(e)):(Array.isArray(i)&&i.map(e=>{D.current.set(`${R(e)}`,e)}),i)});else{if(s&&Array.isArray(e)){let t=e.map(e=>nA(!1)(e));return void H(t)}Array.isArray(e)&&e.map(e=>{D.current.set(`${R(e)}`,e)}),H(e)}},[H,P,R]),{loadingOptions:z}=Co(i,j,y,B,r,!0,"",!1),V=S&&""!==(C??"");return e(w,{fallback:"loading...",children:e(Ai,{...L,className:k?U.root:"",defaultValue:[],limitTags:g??2,multiple:n,disableClearable:a,options:Q,autoHighlight:!0,freeSolo:s,getOptionLabel:P,value:z?[]:n?O(N,s):O(N,s)[0],isOptionEqualToValue:(e,t)=>s?e===t:e.value===t.value,PaperComponent:({children:t})=>e("div",{style:{width:"fit-content",background:"white",boxShadow:"rgba(50, 50, 93, 0.25) 0px 2px 5px -1px, rgba(0, 0, 0, 0.3) 0px 1px 3px -1px",overflow:"hidden",maxWidth:"320px",minWidth:"max(120px, 100%)"},children:t}),ListboxComponent:Boolean(v)?rA:void 0,onKeyDown:_,onChange:M,onBlur:()=>{I.current=-1,F()},onHighlightChange:(e,t)=>{I.current="mousemove"!==e?.type?Q.indexOf(t):-1},filterOptions:Boolean(p)&&"object"==typeof p?pi(p):(e,t)=>{const i=t.inputValue.toLowerCase();return e.filter(e=>e.label.toLowerCase().includes(i)).sort((e,t)=>{const r=e.label.toLowerCase().startsWith(i),n=t.label.toLowerCase().startsWith(i);return r&&!n?-1:!r&&n?1:0})},renderTags:(e,t)=>e.map((e,i)=>u(gi,"string"==typeof e?{variant:"outlined",...c,label:e,...t({index:i}),key:e}:{variant:"outlined",...c,label:e.label,...t({index:i}),key:`${e.label}-${i}`})),renderInput:i=>e(mi,{...i,...i.InputProps,placeholder:m,autoComplete:"disabled",type:"text",error:V,required:b,fullWidth:E,autoFocus:T,disableUnderline:!0,endAdornment:t(f,{children:[z?e(G,{size:25,color:"secondary",variant:"indeterminate",...h}):null,i.InputProps.endAdornment]})}),renderOption:(i,r,n)=>{i.key=i.id;let{selected:a,inputValue:s}=n,o=P(r);const l=wi(o,s),h=bi(o,l).map((t,i)=>e("span",{style:{fontWeight:t.highlight?700:400},children:t.text},i));return e(ne,{title:o,children:t("li",{style:{whiteSpace:"pre",width:"max-content",minWidth:"100%"},...i,children:[A?e(go,{checked:a}):null,h]})})}})})},sA=({options:t,MenuItemProps:i,SelectProps:r,multiple:n,showCheckbox:a,CircularProgressProps:s,handleBlur:o,handleChange:h,error:c,touched:A,value:p,loading:f,readOnly:m,_optionsKey:g,disableCaching:w,optionsProps:b,skipDefaultOption:v=!1,defaultOptionLabel:y,enableDefaultOption:C=!1,...x})=>{const[F,S]=d([]),N=Boolean(A)&&Boolean(c),{loadingOptions:E}=Co(t,S,g,w,b,v,y,C),k=l(e=>Fo(F)(e),[F]),T=l(e=>{const t="object"==typeof e?e?.target?.value??"":e;let i=k(t);i=n?i:i[0],"00"===t&&(e.target.value=""),h(e,i)},[h,k,n]),L=F.map((t,r)=>u(K,{...i,key:t.value??r,value:t.value,disabled:t.disabled,style:{fontWeight:"00"===t.value?500:"inherit"}},a?e(go,{checked:Boolean(n)?Array.isArray(p)&&p.indexOf(t.value)>=0:p===t.value}):null,t.label));return e(Ti,{...x,value:n&&!Array.isArray(p)?[p]:Boolean(p)?p:"string"==typeof p?"00":p,error:N,onChange:T,onBlur:o,native:!1,multiple:n,renderValue:n?Fo(F,!0):void 0,style:{fontWeight:"00"===(n&&!Array.isArray(p)?[p]:Boolean(p)?p:"string"==typeof p?"00":p)?"500":""},input:e(mi,{sx:{"& > .MuiSvgIcon-root.MuiSelect-icon":{right:"-0.5px"}},endAdornment:f||E?e(B,{position:"end",children:e(G,{color:"primary",variant:"indeterminate",...s})}):null,disableUnderline:!0}),readOnly:m,IconComponent:r?.IconComponent,children:L})};function oA(t){const{inputRef:i,onChange:r,MaskProps:n,...a}=t;return e(Li,{...a,inputRef:i,onAccept:(e,t)=>{r({target:{value:t.unmaskedValue}})},...n})}function lA(t){const{inputRef:i,onChange:r,FormatProps:n,...a}=t;return e(Ht,{...a,getInputRef:i,onValueChange:e=>{r({target:{name:t.name,value:e.value,formattedValue:e.formattedValue}},e.formattedValue)},valueIsNumericString:!1,...n})}const hA=xi(e=>({tooltip:{backgroundColor:"#f5f5f9",color:"rgba(0, 0, 0, 0.87)",maxWidth:220,fontSize:e.typography.pxToRem(12),border:"1px solid #dadde9"}}))(Ii),cA=({name:t,validate:i,validationRun:r,shouldExclude:n,isReadOnly:a,postValidationSetCrossFieldValues:o,runPostValidationHookAlways:c,dependentFields:A,fieldKey:p,label:f,FormControlProps:m,FormHelperTextProps:g,FormControlLabelProps:w,GridProps:b,enableGrid:v,runValidationOnDependentFieldsChange:y,skipValueUpdateFromCrossFieldWhenReadOnly:B,ignoreInSubmit:C=!1,setFieldLabel:x,runPostValidationForInitValue:F,dependentFieldDebounceDelay:S=300,runExternalFunction:N,onFormDataChange:E,...k})=>{const[T,L]=d(b),{value:I,error:D,touched:U,handleChange:P,handleBlur:R,isSubmitting:O,fieldKey:Q,name:H,excluded:M,readOnly:_,whenToRunValidation:j,incomingMessage:z,setIncomingMessage:V,runValidation:K,setIgnoreInSubmit:G,dependentValues:W,formState:J}=as({name:t,fieldKey:p,dependentFields:A,validate:i,validationRun:r,runPostValidationHookAlways:c,postValidationSetCrossFieldValues:o,isReadOnly:a,shouldExclude:n,runValidationOnDependentFieldsChange:y,skipValueUpdateFromCrossFieldWhenReadOnly:B,runPostValidationForInitValue:F,dependentFieldDebounceDelay:S,runExternalFunction:N,onFormDataChange:E});h(()=>{if(Boolean(C))if("function"==typeof C){let e=C(ds(W),J,{isSubmitting:O,value:I});G(e)}else G(C)},[C,G,W,I]),h(()=>{if(null!==z&&"object"==typeof z&&Object.keys(z).length){const{value:e,ignoreUpdate:t,GridProps:i}=z;if("object"==typeof i){const e={...b,xs:i?.xs??b?.xs??"auto",md:i?.md??b?.md??"auto",xl:i?.xl??i?.md??b?.xl??"auto",sm:i?.sm??b?.sm??"auto",lg:i?.lg??i?.md??b?.lg??"auto"};L(e)}"boolean"==typeof e&&(P(e,void 0,!0),t||"onChange"!==j||K({value:e},!0)),V(null)}},[z,P,K,j]);const X=l(e=>{const{value:t,checked:i}=e.target;e.target.value="boolean"==typeof i&&i,P(e)},[P]),Y=s(()=>{if("function"==typeof x)return x(ds(W),I)},[x,W,I]);if(M)return null;const $=U&&""!==(D??""),Z=u($e,{...m,key:Q,component:"fieldset",disabled:O||_,error:!O&&$,onBlur:R},e(Ye,{...w,name:H,control:e(go,{...k,readOnly:_,tabIndex:_?-1:void 0}),onChange:X,label:Y?.label?Ge(Y.label):f,checked:Boolean("string"==typeof I?"Y"===I||"true"===I:I)}),!O&&$?e(Ze,{...g,children:D}):null);return Boolean(v)?u(q,{style:{alignSelf:"center"},...T,key:Q},Z):Z},dA=(e,t)=>Array.isArray(e)&&e.indexOf(t)>-1;var uA=Object.freeze({__proto__:null,Checkbox:cA,CheckboxGroup:({name:t,validate:i,validationRun:r,shouldExclude:n,isReadOnly:a,postValidationSetCrossFieldValues:s,runPostValidationHookAlways:o,dependentFields:h,fieldKey:c,label:A,options:p,FormControlProps:f,FormLabelProps:m,FormGroupProps:g,FormHelperTextProps:w,FormControlLabelProps:b,GridProps:v,enableGrid:y,runValidationOnDependentFieldsChange:C,skipValueUpdateFromCrossFieldWhenReadOnly:x,CircularProgressProps:F,_optionsKey:S,disableCaching:N,...E})=>{const{formState:k,value:T,error:L,touched:I,handleChange:D,handleBlur:U,isSubmitting:P,fieldKey:R,name:O,excluded:Q,readOnly:H,dependentValues:M,incomingMessage:_,runValidation:j,whenToRunValidation:z,setIncomingMessage:V}=as({name:t,fieldKey:c,dependentFields:h,validate:i,validationRun:r,runPostValidationHookAlways:o,postValidationSetCrossFieldValues:s,isReadOnly:a,shouldExclude:n,runValidationOnDependentFieldsChange:C,skipValueUpdateFromCrossFieldWhenReadOnly:x}),[K,W]=d([]),J=l(e=>Fo(K)(e),[K]),X=l(e=>{let t=J("object"==typeof e?e?.target?.value??"":e);D(e,t[0])},[D,J]),{loadingOptions:Y}=Bo(k,p,W,X,M,_,j,z,S,N,V,!0,"",!1);if(Q)return null;const $=I&&""!==(L??""),Z=K.map(t=>u(Ye,{...b,control:e(go,{...E,readOnly:H,tabIndex:H?-1:void 0}),key:t.value,name:O,onChange:X,label:t.label,value:t.value,checked:dA(T,t.value)})),ee=u($e,{...f,key:R,component:"fieldset",disabled:P,error:!P&&$,onBlur:U},e(Je,{...m,component:"label",children:A}),e(Xe,{...g,children:Y?e(B,{position:"end",children:e(G,{color:"primary",variant:"indeterminate",...F})}):Z}),!P&&$?e(Ze,{...w,children:L}):null);return Boolean(y)?u(q,{...v,key:R},ee):ee}});const AA=Ci(e=>({wrapperclass:{textAlign:"center","& div":{"& fieldset":{verticalAlign:"middle","& label":{marginLeft:0,marginRight:0}}}}})),pA=Ci(()=>({wrapperclass:{textAlign:"center","& div":{"& fieldset":{verticalAlign:"middle","& label":{marginLeft:0,marginRight:0}}}}}));ma.registerFn("currency",su),ma.registerFn("date",t=>{const{commonDateFormat:i}=ns(),{value:r,column:{dateFormat:n,showTooltip:a,tooltipPlacement:s="bottom-start"}}=t;if(!Boolean(r))return e(ho,{...t});const o=new Date(r);let l;try{const t=ze(o,(Boolean(n)?n:i)||"dd/MM/yyyy hh:mm aaa");l=a?e(ne,{title:t,placement:s,children:e("span",{children:t})}):t}catch(e){l="-"}return e(ho,{...t,children:l})}),ma.registerFn("default",co),ma.registerFn("icondefault",t=>{const{value:i,column:{showTooltip:r=!1,tooltipPlacement:n="bottom-start",transform:a=e=>e,isAutoSequence:o=!1,isImageURL:l=!1,shouldExclude:c},row:u}=t,[A,p]=d(null);let f;f=o?Number(u?.index??0)+1:a(i);const m=s(()=>"function"==typeof c&&c(f,u?.original),[f,u.original]);if(h(()=>{if(Boolean(f)){let e="";if(l)e=f;else{let t=ps(f);e="object"==typeof t&&Boolean(t)?URL.createObjectURL(t):""}p(e)}},[f]),m)return e(ho,{showBorder:!0,...t});let g=r?e(Ii,{title:f,placement:n,children:e("div",{children:e(Mi,{alt:"User",src:Boolean(A)?A:"",style:{width:"30px",height:"30px",borderRadius:0}})})}):e("div",{children:e(Mi,{alt:"User",src:Boolean(A)?A:"",style:{width:"30px",height:"30px",borderRadius:0}})});return e(ho,{...t,children:g})}),ma.registerFn("editableAutocomplete",i=>{const{value:r,rows:n,row:{index:a,original:o},column:{id:l,options:c,validation:u,_optionsKey:A,disableCachingOptions:p,disableAdornment:f,placeholder:m,isReadOnly:g,isAutoFocus:w,__EDIT__:b},updateGridData:v,gridProps:y,loading:B,hiddenFlag:C,loading:x}=i,F=n.slice(0,a).map(e=>e?.original).filter(e=>!0!==Boolean(e[C])),S=n.slice(a+1).map(e=>e?.original).filter(e=>!0!==Boolean(e[C])),N=Boolean(o?._touched?.[l]),E=o?._error?.[l]??"",[k,T]=d(!1),[L,I]=d(r),{t:D}=W(),U=e=>{I(e)},P=()=>{T(!0),u(L,o,F,S).then(e=>{T(!1),v(a,l,L,!0,e)})};h(()=>{I(r)},[r]);const R=s(()=>!0===o?._isReadOnly||!0!==o?._isNewRow&&(!!g||!1===o?._isNewRow&&!0===b?.isReadOnly),[g,o,b]);return t(ho,{showBorder:!0,...i,children:[e(aA,{value:L,onChange:U,onBlur:P,fullWidth:!0,error:E,touched:N,handleChange:U,handleBlur:P,options:c,loading:x,disabled:x||B,_optionsKey:A,optionsProps:y,disableCaching:p,showCheckbox:!1,renderInput:()=>null,placeholder:String(D(m)),disableAdornment:f,readOnly:R,isAutoFocus:w}),Boolean(N)&&Boolean(E)?e(le,{style:{whiteSpace:"break-spaces"},error:!0,children:D(E)}):null]})}),ma.registerFn("editableSelect",i=>{const{value:r,rows:n,row:{index:a,original:o},column:{id:l,options:c,validation:u,_optionsKey:A,disableCachingOptions:p,skipDefaultOption:f,defaultOptionLabel:m,requestProps:g,isReadOnly:w,__EDIT__:b,dependentOptionField:v,enableDefaultOption:y},updateGridData:B,gridProps:C,hiddenFlag:x,loading:F}=i,S=Boolean(o?._touched?.[l]),N=o?._error?.[l]??"",[E,k]=d(!1),[T,L]=d(r),I=s(()=>!0===o?._isReadOnly||!0!==o?._isNewRow&&(!!w||!1===o?._isNewRow&&!0===b?.isReadOnly),[w,o,b]);let D=Boolean(v)?o[v]:g;const U=n.slice(0,a).map(e=>e?.original).filter(e=>!0!==Boolean(e[x])),P=n.slice(a+1).map(e=>e?.original).filter(e=>!0!==Boolean(e[x])),R=e=>{L(e.target.value)},O=()=>{k(!0),u(T,o,U,P).then(e=>{k(!1),B(a,l,T,!0,e)})};return h(()=>{L(r)},[r,N]),t(ho,{showBorder:!0,...i,children:[e(sA,{value:T,onChange:R,onBlur:O,fullWidth:!0,touched:S,error:N,handleChange:R,handleBlur:O,options:c,loading:E,disabled:E||F||I,_optionsKey:A,optionsProps:D,disableCaching:p,skipDefaultOption:f,defaultOptionLabel:m,enableDefaultOption:y,CircularProgressProps:{color:"secondary",size:20},SelectProps:E||F||I?{IconComponent:()=>null}:void 0}),Boolean(S)&&Boolean(N)?e(Ze,{style:{whiteSpace:"break-spaces"},error:!0,children:N}):null]})}),ma.registerFn("editableTextField",i=>{const{value:r,rows:n,row:{index:a,original:l},column:{id:c,validation:u,isPassword:A,TableCellProps:p,isDisabledOnBlurEvent:f,maxLength:m,placeholder:g,autoComplete:w,isAutoFocus:b,multiline:x,minRows:F,maxRows:S,isReadOnly:N,__EDIT__:E,preventSpecialChars:k},updateGridData:T,hiddenFlag:L,loading:I}=i,D=n.slice(0,a).map(e=>e?.original).filter(e=>!0!==Boolean(e[L])),U=n.slice(a+1).map(e=>e?.original).filter(e=>!0!==Boolean(e[L])),P=Boolean(l?._touched?.[c]),R=l?._error?.[c]??"",O=o(Boolean(A)),[Q,H]=d(Boolean(A)?"password":"text"),[M,_]=d(!1),[j,z]=d(r),V=o(null),{t:K}=W(),q=s(()=>!0===l?._isReadOnly||!0!==l?._isNewRow&&(!!N||!1===l?._isNewRow&&!0===E?.isReadOnly),[N,l,E]),G=()=>{_(!0),u(j,l,D,U).then(e=>{_(!1),T(a,c,j,!0,e)})};return h(()=>{Boolean(f)&&G()},[j]),h(()=>{!Boolean(j)&&Boolean(b)&&n.length===a+1&&V?.current?.firstChild?.focus?.()},[a,b]),h(()=>{z(r)},[r]),t(ho,{showBorder:!0,...i,children:[e(mi,{name:c,value:"string"==typeof j?j.trimStart():j,onChange:e=>{const t="function"==typeof k?k():k;t&&e.target.value&&t.split("").some(t=>e.target.value.includes(t))||e.target.value.length<=(m??200)&&z(e.target.value)},onFocus:e=>{e.target.select()},type:Q,onBlur:()=>{Boolean(f)||G()},multiline:x,minRows:F??"",maxRows:S??"",margin:"none",fullWidth:!0,error:Boolean(P)&&Boolean(R),placeholder:String(K(g)),autoComplete:w,endAdornment:O.current?e(B,{position:"end",children:e(C,{"aria-label":"toggle password visibility",onClick:()=>H(e=>"password"===e?"text":"password"),onMouseDown:e=>{e.preventDefault()},children:e("password"===Q?v:y,{})})}):null,style:{marginTop:"0px",direction:"right"===p?.align?"rtl":"ltr"},disableUnderline:!0,disabled:I||M,readOnly:q,ref:V}),Boolean(P)&&Boolean(R)?e(Ze,{style:{whiteSpace:"break-spaces"},error:!0,children:R}):null]})}),ma.registerFn("editableMaskInputField",i=>{const{value:r,rows:n,row:{index:a,original:s},column:{id:o,validation:l,MaskProps:h},updateGridData:c,hiddenFlag:u}=i,A=Boolean(s?._touched?.[o]),p=s?._error?.[o]??"",[f,m]=d(!1),[g,w]=d(r),b=n.slice(0,a).map(e=>e?.original).filter(e=>!0!==Boolean(e[u])),v=n.slice(a+1).map(e=>e?.original).filter(e=>!0!==Boolean(e[u]));return t(ho,{showBorder:!0,...i,children:[e(mi,{name:o,value:g,onChange:e=>{w(e.target.value)},onFocus:e=>{e.target.select()},onBlur:()=>{m(!0),l(g,s,b,v).then(e=>{m(!1),c(a,o,g,!0,e)})},fullWidth:!0,margin:"none",disableUnderline:!0,error:Boolean(A)&&Boolean(p),inputComponent:oA,inputProps:{MaskProps:h},disabled:f}),Boolean(A)&&Boolean(p)?e(Ze,{style:{whiteSpace:"break-spaces"},error:!0,children:p}):null]})}),ma.registerFn("editableNumberFormat",i=>{const{value:r,rows:n,row:{index:a,original:l},column:{id:c,validation:u,FormatProps:A,placeholder:p="",enableNumWords:f,className:m,isReadOnly:g,__EDIT__:w,isDisabledOnBlurEvent:b,autoComplete:v,isAutoFocus:y},updateGridData:B,hiddenFlag:C,loading:x}=i,F=n.slice(0,a).map(e=>e?.original).filter(e=>!0!==Boolean(e[C])),S=n.slice(a+1).map(e=>e?.original).filter(e=>!0!==Boolean(e[C])),N=Boolean(l?._touched?.[c]),E=l?._error?.[c]??"",[k,T]=d(!1),[L,I]=d(r),D=o(null),{t:U}=W(),P=s(()=>!0===l?._isReadOnly||!0!==l?._isNewRow&&(!!g||!1===l?._isNewRow&&!0===w?.isReadOnly),[g,l,w]);let R=null;try{if(f&&Boolean(L)){let e=String(L).split("."),t=Number(e[0]);t<0?(t=Math.abs(Number(t)),R=`Negative ${Io(t)} Rupees`):R=`${Io(t)} Rupees`,2===e.length&&Boolean(e[1])&&(R=`${R} and ${Io(e[1])} paise`)}}catch(e){}const O=()=>{T(!0),u(L,l,F,S).then(e=>{T(!1),B(a,c,L,!0,e)})};return h(()=>{Boolean(b)&&O()},[L]),h(()=>{!Boolean(L)&&Boolean(y)&&n.length===a+1&&D?.current?.firstChild?.focus?.()},[n,a,y]),t(ho,{showBorder:!0,...i,children:[e(mi,{name:c,value:L,onChange:e=>{I(e.target.value)},onFocus:e=>{e.target.select()},onBlur:()=>{Boolean(b)||O()},placeholder:String(U(p)),fullWidth:!0,margin:"none",disableUnderline:!0,error:Boolean(N)&&Boolean(E),inputComponent:lA,inputProps:{FormatProps:A},disabled:k||x,className:m,readOnly:x||P,autoComplete:v,ref:D}),Boolean(N)&&Boolean(E)?e(Ze,{style:{whiteSpace:"break-spaces"},error:!0,children:E}):Boolean(f)?e(Ze,{style:{whiteSpace:"break-spaces"},children:R}):null]})}),ma.registerFn("editableNumberFormatLessValidation",i=>{const{value:r,rows:n,row:{index:a,original:s},column:{id:l,validation:c,FormatProps:u,placeholder:A="",enableNumWords:p,className:f,isDisabledOnBlurEvent:m},updateGridData:g,hiddenFlag:w,loading:b}=i,v=[],y=[],B=Boolean(s?._touched?.[l]),C=s?._error?.[l]??"",x=o(!0),[F,S]=d(!1),[N,E]=d(r),{t:k}=W();const T=()=>{S(!0),c(N,s,v,y).then(e=>{S(!1),g(a,l,N,!0,e)})};return h(()=>{Boolean(m)&&!x.current&&T(),x.current=!1},[N]),t(ho,{showBorder:!0,...i,children:[e(mi,{name:l,value:N,onChange:e=>{E(e.target.value)},onFocus:e=>{e.target.select()},onBlur:()=>{Boolean(m)||T()},placeholder:String(k(A)),fullWidth:!0,margin:"none",disableUnderline:!0,error:Boolean(B)&&Boolean(C),inputComponent:lA,inputProps:{FormatProps:u},disabled:F,className:f,readOnly:b}),Boolean(B)&&Boolean(C)?e(Ze,{style:{whiteSpace:"break-spaces"},error:!0,children:C}):Boolean(p)?e(Ze,{style:{whiteSpace:"break-spaces"},children:null}):null]})}),ma.registerFn("action",t=>{let{column:{actions:i},row:r,setGridAction:n,singleActions:a}=t;return Array.isArray(i)||(i=[i]),a=a.filter(e=>i.indexOf(e?.actionName)>=0),a.length>0&&(a=Al(a,[r],{},!1)),e(ho,{...t,children:e(Pi,{size:"small","aria-label":"actions",children:a.map(t=>e(ct,{onClick:()=>{return e=t.actionName,void n({name:e,rows:[{data:r?.original,id:r?.id}]});var e},children:t.actionLabel}))})})}),ma.registerFn("dateDiffere",t=>{const i=t?.cell?.row?.original??"",r=(new Date).getTime(),n=new Date(i?.due_date).getTime(),a=new Date(i?.completion_date).getTime();let s,o="-";if(""!==n||""===a?s=Ke(r,n):""===n&&""===a||(s=Ke(n,a)),"Completed"===i?.status)o="-";else if(s>"0")o=`${s} days over due`;else if(s<"0")o=-1*s+" days left";else if("0"==s){let e=new Date(r-n);var l=Math.floor(e/1e3/60/60);e-=1e3*l*60*60;var h=Math.floor(e/1e3/60);e-=1e3*h*60,l<10&&(l=`0${l}`),h<10&&(h=`0${h}`),o=l+":"+h+" mins left"}return e(ho,{...t,children:o})}),ma.registerFn("chip",t=>{const{value:i,column:{transform:r=e=>e}}=t;let n=r(i);return e(ho,{...t,children:e(gi,{label:n,variant:"outlined"})})}),ma.registerFn("multipleValuesCellRenderer",i=>{const{row:{original:r},column:{_accessor:n}}=i;let a=r[n],s=Array.isArray(a),o=a.map((t,i)=>e("li",{children:t},i));return t(ho,{positionRelative:!0,...i,children:[s?a[0]:"-",s&&a.length>1?e(hA,{title:e("ul",{style:{padding:0,listStyle:"none",margin:"0px 0px"},children:o}),children:e(Ri,{style:{position:"absolute",right:"5px",top:"5px",color:"#8d868685"}})}):null]})}),ma.registerFn("deleteRowCell",t=>{const{value:i,row:{index:r,original:n},column:{id:a,shouldExclude:o,buttonLabel:l,showDeleteIconOnly:h=!1},updateGridData:c,data:d}=t,{t:u}=W(),A=s(()=>"function"==typeof o&&o(i,n,d,r),[i,n,d,r]),p=e=>{c(r,a,!0,!0,"")};return e(ho,A?{showBorder:!0,...t}:{showBorder:!0,...t,children:h?e(de,{onClick:p,sx:{width:"35px",height:"35px","&:hover":{background:"#fccfcf"},color:"#ff2626"},children:e(Oi,{})}):e(ct,{onClick:p,fullWidth:!0,variant:"contained",color:"secondary",style:{height:"28px"},children:Boolean(l)?u(l):u("Delete")})})}),ma.registerFn("buttonRowCell",jc),ma.registerFn("percentageDiff",t=>{const i=t?.cell?.row?.original??"";let r=0;const n=Number(i?.fromPercentage),a=Number(i?.toPercentage);return isNaN(n)||isNaN(a)||(r=a-n+"%"),e(ho,{...t,children:r})}),ma.registerFn("editableCheckbox",i=>{const{value:r,rows:n,row:{index:a,original:o},column:{id:l,validation:c,isReadOnly:u,setValueFUNC:A,shouldExclude:p,__EDIT__:f},updateGridData:m,hiddenFlag:g,loading:w}=i,b=Boolean(o?._touched?.[l]),v=o?._error?.[l]??"",[y,B]=d(!1),C=AA(),[x,F]=d(r),S=n.slice(0,a).map(e=>e?.original).filter(e=>!0!==Boolean(e[g])),N=n.slice(a+1).map(e=>e?.original).filter(e=>!0!==Boolean(e[g])),E=s(()=>"function"==typeof p&&p(r,o,S,N),[r,S,N,o]),k=s(()=>u?"function"!=typeof u||u(r,o,S,N):!0===o?._isReadOnly||!0!==o?._isNewRow&&(!1===o?._isNewRow&&!0===f?.isReadOnly),[u,o,f]);return h(()=>{F(r)},[r,v]),e(ho,E?{showBorder:!0,...i}:{...i,children:t("div",{className:C.wrapperclass,children:[e(cA,{checked:Boolean("string"==typeof x?"Y"===x||"true"===x||"N"!==x&&"false"!==x&&x:x),onChange:e=>{let t=e.target.checked;"function"==typeof A&&(t=A(t)),F(t)},onBlur:()=>{B(!0),c(x,o,S,N).then(e=>{B(!1);m(a,l,"Y"===x||!0===x?"Y":"N",!0,e)})},disabled:y||w||k,enableGrid:!0,name:l,label:"",fieldKey:l}),Boolean(b)&&Boolean(v)?e(Ze,{style:{whiteSpace:"break-spaces"},error:!0,children:v}):null]})})}),ma.registerFn("editableDatetimePicker",i=>{const{commonDateTimeFormat:r}=ns(),{value:n,rows:a,row:{index:o,original:l},column:{id:c,validation:u,dateFormat:A,mindate:p,isReadOnly:f,__EDIT__:m},updateGridData:g,hiddenFlag:w,loading:b}=i,v=Boolean(l?._touched?.[c]),y=l?._error?.[c]??"",[B,C]=d(!1),[x,F]=d(n),{authState:S}=es(),N=s(()=>!!f||!1===l?._isNewRow&&!0===m?.isReadOnly,[f,l?._isNewRow,m]),E=a.slice(0,o).map(e=>e?.original).filter(e=>!0!==Boolean(e[w])),k=a.slice(o+1).map(e=>e?.original).filter(e=>!0!==Boolean(e[w]));return h(()=>{F(n)},[n]),t(ho,{showBorder:!0,...i,children:[e(Qi,{dateAdapter:Hi,children:e(_o,{format:(Boolean(A)?A:r)||"dd/MM/yyyy HH:mm:ss",onChange:e=>{F(e),u(e,l,E,k).then(t=>{const i=e?new Date(e):e;let r=ys(i)?ze(i,"yyyy-MM-dd HH:mm:ss.S"):i;if(Boolean(i&&S?.minDate)){Ca(i,new Date(S?.minDate))&&(t=Ge("DateOutOfPeriod"))}g(o,c,r,!0,t)})},value:""===x||null===x?null:Fs(x),disabled:b,readOnly:N,minDate:p||new Date("1900-01-01"),views:["year","month","day","hours","minutes","seconds"],slotProps:{textField:{onBlur:()=>{C(!0),u(x,l,E,k).then(e=>{C(!1);const t=x?new Date(x):x;let i=ys(t)?ze(t,"yyyy-MM-dd HH:mm:ss.S"):t;if(Boolean(t&&S?.minDate)){Ca(t,new Date(S?.minDate))&&(e=Ge("DateOutOfPeriod"))}g(o,c,i,!0,e)})},name:c,"aria-label":"Select Date",autoComplete:"off",InputLabelProps:{shrink:!0},InputProps:{disableUnderline:!0,startAdornment:B?e(se,{position:"end",sx:{position:"absolute",right:"18px"},children:e(he,{color:"secondary",variant:"indeterminate",size:16})}):null}},actionBar:{actions:["today","accept","cancel"]}},sx:{width:"100%"}})}),Boolean(v)&&Boolean(y)?e(Ze,{style:{whiteSpace:"break-spaces"},error:!0,children:y}):null]})}),ma.registerFn("editableDatePicker",i=>{const{commonDateFormat:r}=ns(),[n,a]=d(null),{authState:o}=es(),{value:l,rows:c,row:{index:u,original:A},column:{id:p,validation:f,dateFormat:m,mindate:g,maxdate:w,disablePast:b,disableFuture:v,disableToday:y,isReadOnly:B,__EDIT__:C},updateGridData:x,hiddenFlag:F,loading:S}=i,N=Boolean(A?._touched?.[p]),E=A?._error?.[p]??"",[k,T]=d(!1),[L,I]=d(l),D=s(()=>!0===A?._isReadOnly||!0!==A?._isNewRow&&(!!B||!1===A?._isNewRow&&!0===C?.isReadOnly),[B,A,C]),U=c.slice(0,u).map(e=>e?.original).filter(e=>!0!==Boolean(e[F])),P=c.slice(u+1).map(e=>e?.original).filter(e=>!0!==Boolean(e[F])),R=e=>{I(e),f(e,A,U,P).then(t=>{const i=e?new Date(e):e;let r=ys(i)?ze(i,"yyyy-MM-dd HH:mm:ss.S"):i;if(Boolean(i&&o?.minDate)){Ca(i,new Date(o?.minDate))&&(t=Ge("DateOutOfPeriod"))}x(u,p,r,!0,t)})};return h(()=>{I(l)},[l]),t(ho,{showBorder:!0,...i,children:[e(Qi,{dateAdapter:Hi,children:e(Ho,{format:(Boolean(m)?m:r)||"dd/MM/yyyy",onChange:R,value:""===L||null===L?null:Fs(L),disabled:S,readOnly:D,minDate:g||new Date("1900-01-01"),maxDate:w||null,disablePast:b,disableFuture:v,onSelectedSectionsChange:e=>{a(e)},selectedSections:n,slotProps:{textField:{onBlur:()=>{T(!0),f(L,A,U,P).then(e=>{T(!1);const t=L?new Date(L):L;let i=ys(t)?ze(t,"yyyy-MM-dd HH:mm:ss.S"):t;if(Boolean(t&&o?.minDate)){Ca(t,new Date(o?.minDate))&&(e=Ge("DateOutOfPeriod"))}x(u,p,i,!0,e)})},onKeyDown:e=>{const t=m??r;if(!o?.workingDate||"ArrowUp"!==e.key&&"ArrowDown"!==e.key){if("Home"===e.key)a(0);else if("End"===e.key){const e=t.includes("/")?"/":t.includes("-")?"-":null,i=e?t.split(e).length:1;a(i-1)}}else{const i=e.target.value;if(!Ve(L)&&i?.toLowerCase()===t?.toLowerCase()){const t=o?.workingDate;let i="";"ArrowUp"===e.key?i=(new Date).setDate(new Date(t).getDate()+1):"ArrowDown"===e.key&&(i=(new Date).setDate(new Date(t).getDate()-1)),setTimeout(()=>R(new Date(i)),0)}}},"aria-label":"Select Date",name:p,autoComplete:"off",InputLabelProps:{shrink:!0},InputProps:{disableUnderline:!0,startAdornment:k?e(se,{position:"end",sx:{position:"absolute",right:"18px"},children:e(he,{color:"secondary",variant:"indeterminate",size:16})}):null}},actionBar:{actions:y?["accept","cancel"]:["today","accept","cancel"]}}})}),Boolean(N)&&Boolean(E)?e(Ze,{style:{whiteSpace:"break-spaces"},error:!0,children:E}):null]})}),ma.registerFn("disableSelect",i=>{const{value:r,rows:n,row:{index:a,original:s},column:{id:o,options:l,validation:c,_optionsKey:u,disableCachingOptions:A,defaultOptionLabel:p,requestProps:f},updateGridData:m,gridProps:g,hiddenFlag:w,loading:b}=i,v=Boolean(s?._touched?.[o]),y=s?._error?.[o]??"",[B,C]=d(!1),[x,F]=d(r);const S=n.slice(0,a).map(e=>e?.original).filter(e=>!0!==Boolean(e[w])),N=n.slice(a+1).map(e=>e?.original).filter(e=>!0!==Boolean(e[w])),E=e=>{F(e.target.value)},k=()=>{C(!0),c(x,s,S,N).then(e=>{C(!1),m(a,o,x,!0,e)})};return h(()=>{F(r)},[r,y]),t(ho,{showBorder:!0,...i,children:[e(sA,{value:x,onChange:E,onBlur:k,fullWidth:!0,touched:v,error:y,handleChange:E,handleBlur:k,options:l,loading:B,disabled:!0,_optionsKey:u,optionsProps:f,disableCaching:A,defaultOptionLabel:p,CircularProgressProps:{color:"secondary",size:20},readOnly:!0,SelectProps:{IconComponent:()=>null}}),Boolean(v)&&Boolean(y)?e(Ze,{style:{whiteSpace:"break-spaces"},error:!0,children:y}):null]})}),ma.registerFn("customIconCell",i=>{const{value:r,row:{index:n,original:a},column:{id:s,isReadOnly:o,activeIcon:{icon:l,tooltip:c},inActiveIcon:{icon:u,tooltip:A}},loading:p,onButtonActionHandel:f}=i,m=Boolean(a?._touched?.[s]),g=a?._error?.[s]??"",w=pA(),[b,v]=d(r),y=()=>{"function"==typeof f&&f(n,s)};return h(()=>{v(r)},[r,g]),e(ho,{...i,children:t("div",{className:w.wrapperclass,children:[Boolean(b)?e(ne,{title:c,children:e(de,{name:s,onClick:y,disabled:p||o,size:"small",children:l??""})}):e(ne,{title:A,children:e(de,{onClick:y,disabled:p||o,size:"small",children:u??""})}),Boolean(m)&&Boolean(g)?e(le,{style:{whiteSpace:"break-spaces"},error:!0,children:g}):null]})})});io(":root{--theme-color1:maroon;--theme-color2:#fedad8;--theme-color3:#fe0000;--theme-color4:#fcbab7;--theme-color5:#efe0e0;--white:#fff;--white-dim:#ffffff8a;--primary-bg:linear-gradient(45deg,maroon,#ff5a5a);--report-export-theme:maroon;--old-value-text-primary:#7b4f00;--old-value-bg-primary:#fff8dc}");const fA=Ae("div")(({theme:e,ownerState:t})=>({backgroundColor:"dark"===e.palette.mode?e.palette.grey[700]:"#ccc",zIndex:1,color:"#fff",width:30,height:30,display:"flex",borderRadius:"50%",justifyContent:"center",alignItems:"center",...t.active&&{background:"var(--theme-color1)",boxShadow:"0 4px 10px 0 rgba(0,0,0,.25)"},...t.completed&&{background:"var(--theme-color1)"}})),mA=Ae(_i)(({theme:e})=>({[`&.${ji.alternativeLabel}`]:{top:15,left:"calc(-50% + 10px)"},[`&.${ji.active}`]:{[`& .${ji.line}`]:{background:"var(--theme-color1)"}},[`&.${ji.completed}`]:{[`& .${ji.line}`]:{background:"var(--theme-color1)"}},[`& .${ji.line}`]:{height:3,border:0,backgroundColor:"dark"===e.palette.mode?e.palette.grey[800]:"#eaeaf0",borderRadius:1}})),gA=n(null),wA=({gridCode:t,getGridData:i,children:r})=>"function"!=typeof i?e("div",{children:"Invalid Grid FNS passed"}):e(gA.Provider,{value:{getGridData:i,gridCode:t},children:r}),bA=({column:i,visibleColumns:r,setColumnOrder:n,allowColumnReordering:a})=>{const[{isDragging:s},l]=wt({type:"Column",collect:e=>({isDragging:!!e.isDragging()}),end:(e,t)=>{if(t.didDrop()){const{id:e}=t.getDropResult(),s=r.map(e=>e.id),o=s.indexOf(e),l=s.indexOf(i.id);var a=s[o];s[o]=s[l],s[l]=a,n(s)}},canDrag:()=>a&&!i.pinColumn}),[{isOver:h},c]=bt({accept:"Column",drop:()=>({id:i.id}),collect:e=>({isOver:a&&!i.pinColumn&&!!e.isOver()}),canDrop:()=>a&&!i.pinColumn}),d=o(null);return l(c(d)),t(f,{children:[e(zi,{active:i.isSorted,direction:i.isSortedDesc?"desc":"asc",hideSortIcon:!0,ref:d,...i.getSortByToggleProps([{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"flex",color:"var(--theme-color1)",fontSize:"1 rem",fontWeight:"600",opacity:s||h?.5:1,cursor:s?"move":"default"}}]),children:e("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",paddingRight:"10px"},children:i.columnName})}),i.getResizerProps&&!i.disableResizing&&e("div",{...i.getResizerProps([{style:{minHeight:"26px",opacity:1,color:"rgba(224, 224, 224, 1)",right:"0px",display:"flex",zIndex:5,position:"absolute",flexDirection:"column",justifyContent:"center"}}]),children:e("svg",{focusable:"false",viewBox:"0 0 24 24","aria-hidden":"true","data-testid":"SeparatorIcon",style:{color:"inherit",userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:"currentColor",flexShrink:0,transition:"fill 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms",fontSize:"20px"},children:e("path",{d:"M11 19V5h2v14z"})})})]})},vA=xi(e=>({root:{"&.Mui-checked":{color:"var(--theme-color1)"},"&.MuiCheckbox-indeterminate":{color:e.palette.text.secondary}},checked:{}}))(ui),yA=({row:t,cell:r,setContextMenuSelectedRowId:n,hasLeftPinnedColumn:a})=>e(i,{children:e(ci,{component:"div",variant:"head",...r.getCellProps([{style:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"0px 10px",lineHeight:"28px",...a&&{position:"sticky",left:0,zIndex:1,background:"inherit"}}}]),children:Boolean(t?.original?.__isRowSelection??!0)?e(vA,{size:"small",...t.getToggleRowSelectedProps([{style:{padding:0}}]),onClick:e=>{t.isSelected&&n("")}}):null})}),BA=({getToggleAllRowsSelectedProps:t,setContextMenuSelectedRowId:i,hasLeftPinnedColumn:r})=>e(ci,{component:"div",variant:"head",style:{padding:0,...r&&{position:"sticky",left:0,zIndex:1,background:"inherit"}},children:e(vA,{size:"small",...t([{style:{padding:0}}]),onClick:()=>{i("")}})}),CA=Ci(e=>({root:{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),background:"var(--primary-bg)",borderTopLeftRadius:"4px",borderTopRightRadius:"4px"},title:{color:"var(--white)",letterSpacing:"1px",fontSize:"1.25rem"},refreshiconhover:{}})),xA=c(({dense:i,label:r,visibleColumns:n,defaultHiddenColumns:a,allowColumnHiding:s,setGridAction:o,selectedFlatRows:l,alwaysAvailableAction:h,allowFilter:c,setAllFilters:d,gotoPage:u,setSortBy:A,filterMeta:p,filters:f,autoRefreshInterval:m,loading:g,enableExport:w,setOpenExport:b,headerToolbarStyle:v},y)=>{const B=CA(),{defaultGridConfig:x}=ns(),{progress:F,enabled:S,intervalElapsed:N,pause:E,resume:k}=Vl(y?.current?.fetchData,m);return t(ai,{className:J(B.root,"server__grid__header"),variant:i?"dense":"regular",sx:v,children:[e(vt,{className:B.title,color:"inherit",variant:"h6",component:"div",children:r}),t("div",{style:{display:"flex",alignItems:"center",marginLeft:"auto"},children:[c?e(Gl,{setAllFilters:d,filters:f,filterMeta:p,gotoPage:u,setSortBy:A,classes:B}):null,e(ne,{title:Ge("Refetch"),children:e(C,{"aria-label":"refresh","aria-controls":"button","aria-haspopup":"false",onClick:()=>y?.current?.fetchData?.(),color:"primary",className:B.refreshiconhover,children:e(ki,{})})}),S?e(Kl,{variant:"determinate",value:F,interval:N,pause:E,resume:k}):null,s?e(Jl,{visibleColumns:n,defaultHiddenColumns:a,classes:B}):null,!g&&w?e(ae,{control:e(ne,{title:Ge("Showexportoptions"),children:t(eo,{onClick:()=>{b(!0)},style:{color:"white",background:x?.isContainedActionButton?"var(--primary-bg)":"inherit",boxShadow:x?.isContainedActionButton?"2px 2px 4px 0px rgba(0,0,0,.2)":"none"},eventKey:"x",shortcut:"alt",children:[Ge("Export")," ",e(Ki,{})]})}),sx:{color:"var(--white)",margin:"0 !important"},label:""}):null,e(Hl,{actions:h??[],setAction:o,selectedRows:l},"alwaysRender")]})]})}),FA=c(({label:r,dense:n,columns:a,defaultColumn:l,setData:c,data:u,onFetchData:A,loading:f,getRowId:m,totalRecords:g,pageCount:w,pageSizes:b,defaultPageSize:v,defaultSortOrder:y,defaultFilter:B,defaultHiddenColumns:C,allowColumnReordering:x,allowColumnHiding:F,allowKeyboardNavigation:S,setGridAction:N,multipleActions:E,singleActions:k,doubleClickAction:T,alwaysAvailableAction:L,allowFilter:I,allowRowSelection:D,filterMeta:U,autoRefreshInterval:P,enablePaginationInput:R=!0,finalMetaData:O,enableExport:Q,enablePdfPrint:H,reportTemplateCode:M,variant:_,containerHeight:j,occupiedHeight:z,autoFetch:V,handleReset:K,headerToolbarStyle:q,enableEnterToFocus:G,disableSorting:J,onButtonActionHandel:Y,handleClickAction:Z,defaultSelectedRowId:ee,disableMultipleRowSelect:te,footerNote:ie,footerNoteStyles:re},ne)=>{const[ae,se]=d(V),[oe,le]=d(null);h(()=>{const e="function"==typeof ee?ee(u):ee;le(t=>t??e)},[ee,u]);const he=s(()=>[...a].map(e=>e.pinColumn?{...e,disableResizing:!0}:e).sort((e,t)=>(e.sequence??0)-(t.sequence??0)),[a]),{getTableProps:ce,getTableBodyProps:de,headerGroups:ue,prepareRow:Ae,rows:pe,page:fe,selectedFlatRows:me,gotoPage:ge,setPageSize:we,state:be,setSortBy:ve,columns:ye,toggleAllRowsSelected:Be,visibleColumns:Ce}=Gt({columns:he,defaultColumn:l,data:u,getRowId:m,initialState:{pageIndex:0,pageSize:v,hiddenColumns:C,sortBy:y},manualPagination:!0,pageCount:w,autoResetPage:!1,disableSortBy:Boolean(J),manualSortBy:!0,autoResetSortBy:!1,manualFilters:!0,autoResetFilters:!1,allowColumnReordering:x,singleActions:k,setGridAction:N,onButtonActionHandel:Y},Jt,ri,Yt,Zt,ei,ti,ii,((t,i)=>r=>{Boolean(t)&&r.visibleColumns.push(t=>{const r=t.some(e=>"left"===e.pinColumn);return[{id:"selectionCheckbox",Header:t=>e(BA,{...t,hasLeftPinnedColumn:r,setContextMenuSelectedRowId:i}),Cell:t=>e(yA,{...t,hasLeftPinnedColumn:r,setContextMenuSelectedRowId:i}),minWidth:40,width:40,maxWidth:40,pinColumn:r?"left":void 0},...t]})})(D&&!te,le)),{authState:xe}=es(),[Fe,Se]=d(B),[Ne,Ee]=d(!1),{t:ke}=W();k=Al(k,me,xe),E=Al(E,me,xe),L=Al(L,fe,xe,!1,!0);const{pageIndex:Te,pageSize:Le,sortBy:Ie}=be,De=qt(A,500),Ue=o(null),Pe=o(null),Re=o(null),[Oe,Qe]=d(null),[He,Me]=d(null),{defaultGridConfig:_e}=ns(),je=o(0),ze=o(null),{resume:Ve,pause:Ke}=zl();h(()=>{ae&&(le(null),De({pageIndex:Te,pageSize:Le,sortBy:Ie,filters:Fe}))},[De,Te,Le,Ie,Fe,ae]),p(ne,()=>({fetchData:()=>{ae||se(!0),le(null),De({pageIndex:Te,pageSize:Le,sortBy:Ie,filters:Fe})},setData:c,handleReset:()=>{Se([]),ve([]),se(!1),ge(0),K()},resume:Ve,pause:Ke,data:u}));const qe=s(()=>{const e=e=>{const t=me.length>0&&D?`calc(${j?.[e]} - 48px)`:j?.[e];return t&&z?.[e]?Fe.length?`calc(${t} - ${z?.[e]} - 48px)`:`calc(${t} - ${z?.[e]})`:Fe.length>0?`calc(${t} - 48px)`:t};return{min:e("min"),max:e("max")}},[me,j,z,Fe]);h(()=>{me.length>0&&te&&JSON.stringify(me[0]?.original)!==JSON.stringify(Re.current)&&(Re.current=me[0]?.original,N({name:"_rowChanged",rows:[{data:me[0]?.original}]}))},[me[0]?.original,te]),h(()=>{if(!te)return;const e=me[0]?.id,t=1===me.length&&e===oe,i=!oe&&0===me.length;if(!t&&!i&&(me.length>0&&Be(!1),oe)){const e=pe.find(e=>e.id===oe);e&&!e.isSelected&&e.toggleRowSelected(!0)}},[pe,oe,te,me]);const Ge=s(()=>{if(!Ce||0===Ce.length)return{leftMap:{},rightMap:{}};const e=be?.columnResizing?.columnWidths??{},t=t=>{const i=e[t.id]??t.totalWidth??t.width??l?.width;return Number.parseFloat(i)||150},i={},r={};let n=0;Ce.forEach(e=>{"left"===e.pinColumn&&(i[e.id]=n,n+=t(e))});let a=0;return[...Ce].reverse().forEach(e=>{"right"===e.pinColumn&&(r[e.id]=a,a+=t(e))}),{leftMap:i,rightMap:r}},[Ce,be?.columnResizing?.columnWidths,l?.width]);return t(i,{children:[t(ni,{style:{width:"100%",background:"var(--white)"},children:[e(xA,{ref:ne,label:r,dense:n,loading:f,visibleColumns:ye,defaultHiddenColumns:C,allowColumnHiding:F,alwaysAvailableAction:L,setGridAction:N,selectedFlatRows:me,allowFilter:I,setAllFilters:Se,gotoPage:ge,setSortBy:ve,filters:Fe,filterMeta:U,autoRefreshInterval:P,enableExport:Q&&fe?.length,setOpenExport:Ee,headerToolbarStyle:q}),e(Ql,{dense:n,selectedFlatRows:me,multipleActions:E,singleActions:k,setGridAction:N}),e(Ml,{selectedFlatRows:me,contextMenuRow:He,multipleActions:E,singleActions:k,setGridAction:N,mouseX:Oe?.mouseX??null,mouseY:Oe?.mouseY??null,handleClose:()=>{Me(null),Qe(null)},authState:xe}),e(hh,{dense:n,setAllFilters:Se,filters:Fe,gotoPage:ge,setSortBy:ve}),f?e(mt,{color:"secondary",style:{marginTop:"1px"}}):e(sh,{}),t(si,{style:{position:"relative",display:"inline-block",overflow:"auto",padding:"outlined"===_?"0 .5rem":"",maxHeight:qe.max,minHeight:qe.min,borderBottom:"1px solid rgba(133, 130, 130, 0.8)"},children:[t(oi,{component:"div",...ce(),size:n?"small":"medium",children:[e($l,{component:"div",sx:{background:"standard"===_?"white":"var(--theme-color4)"},children:ue.map(t=>e(hi,{component:"div",sx:{background:"inherit"},...t.getHeaderGroupProps(),children:t.headers.map(t=>e(th,{variant:_,column:t,pinnedOffsets:Ge,visibleColumns:Ce,children:t.render("Header")},t.getHeaderProps().key))}))}),t(di,{component:"div",ref:Ue,...de([{style:{display:"block"}}]),style:{height:`calc(${qe.min} - 62px)`},children:[fe.length<=0&&!1===f?e("div",{style:{position:"absolute",left:"50%",height:`calc(${qe.min} - 50px)`,display:"flex",alignItems:"center",fontStyle:"italic",color:"rgba(133, 130, 130, 0.8)"},children:ke("Nodatafound")}):null,fe.map((t,i)=>{Ae(t);const r=(e=>t=>{t.preventDefault(),Me(e),le(e?.id),Qe(null===Oe?{mouseX:t.clientX-2,mouseY:t.clientY-4}:null)})(t),n=(e=>t=>{t.preventDefault(),void 0!==Al(T,[e],xe,!0)&&N({name:T.actionName,rows:[{data:e?.original,id:e?.id}]})})(t),a=((e,t,i)=>r=>{if("INPUT"!==r?.target?.tagName&&"TEXTAREA"!==r?.target?.tagName&&"BUTTON"!==r?.target?.tagName){if("Enter"!==r.key&&"Tab"!==r.key&&r.preventDefault(),"Space"===r.code&&Boolean(T)&&_e?.enableDoubleSpaceAction)if(je.current+=1,2===je.current){if(void 0===Al(T,[i],xe,!0))return;N({name:T.actionName,rows:[{data:i?.original,id:i?.id}]}),je.current=0}else ze.current&&clearTimeout(ze.current),ze.current=setTimeout(()=>{je.current=0},300);"ArrowUp"===r.key&&t>0?e[t-1]?.id&&(Be(!1),e[t-1].toggleRowSelected(!0),le(e[t-1]?.id),r?.target?.previousElementSibling?.focus?.()):"ArrowDown"===r.key&&t<e.length-1&&e[t+1]?.id&&(Be(!1),e[t+1].toggleRowSelected(!0),le(e[t+1].id),r?.target?.nextElementSibling?.focus?.())}})(fe,i,t);let s=[];t?.original?._rowColor&&(s=[{style:{background:t?.original?._rowColor}}]),t?.original?._style&&(s=[{style:{...s[0]?.style,...t?.original?._style}}]);const o=Boolean(t.isSelected)||oe===t.id;return e(Zl,{...t.getRowProps(s),id:t.id,tabIndex:0,component:"div",ref:t.isSelected||oe===t.id?Pe:null,selected:o,onKeyDown:a,onContextMenu:e=>{Be(!1),t.toggleRowSelected(!0),r(e)},onDoubleClick:T?n:void 0,onClick:e=>{Boolean(te)&&(Be(!1),t.toggleRowSelected(!0),le(t.id)),"function"==typeof Z&&Z(e,{data:t?.original,id:t?.id})},sx:{background:t?.original?._rowColor?`${t?.original?._rowColor} !important`:o?"#ccc !important":""},children:t.cells.map(e=>{const{key:t}=e.getCellProps();return e.render("Cell",{key:t,pinnedOffsets:Ge,visibleColumns:Ce})})})})]})]}),e(oh,{open:f})]}),ie&&e(X,{component:"div",fontWeight:500,pl:"24px",sx:re,children:ke(ie)}),e(Vi,{sx:{display:"flex","& .MuiToolbar-root":{display:"flex",alignItems:"baseline",minHeight:"44px"}},variant:"body",component:"div",rowsPerPageOptions:[...new Set([v,...b])]?.sort((e,t)=>e-t),colSpan:3,count:g,rowsPerPage:Number(Le),page:Number(Te),onPageChange:(e,t)=>{ge(t)},onRowsPerPageChange:e=>{we(Number(e.target.value))},ActionsComponent:R?nh:rh})]}),Ne?e($,{open:Ne,children:e(Bd,{filters:Fe,title:r,rows:pe,columns:O,onClose:()=>{Ee(!1)},enablePdfPrint:H,reportTemplateCode:u?.find(e=>e?.REPORT_PERSONALIZATION_ID)?.REPORT_PERSONALIZATION_ID??M,enableEnterToFocus:G})}):null]})}),SA=c(({metaData:r,defaultFilter:n,defaultSortOrder:c,dataTransformer:u,autoRefreshInterval:A,enableExport:p,reportTemplateCode:f,variant:m,autoFetch:g,headerToolbarStyle:w,enableEnterToFocus:b,focusScopeId:v,onClickActionEvent:y=()=>{},handleClickAction:B,onDataChange:C,disableMultipleRowSelect:x,defaultSelectedRowId:F},S)=>{const{authState:N}=es(),{defaultGridConfig:E,defaultExportConfig:k}=ns(),T=a(gA),{t:L}=W(),I=s(()=>Array.isArray(r.columns)?r.columns.map(e=>({...e,columnName:L(e.columnName)})):r.columns??[],[L]),D=s(()=>Array.isArray(r.filters)?r.filters.map(e=>({...e,columnName:L(e.columnName)})):r.filters??[],[L]),U=s(()=>({width:150,maxWidth:400,minWidth:50,Header:bA}),[]),P=s(()=>n,[]),R=s(()=>c,[]),O=l(e=>e[r?.gridConfig?.rowIdColumn],[r?.gridConfig?.rowIdColumn]),[Q,H]=d(!1),[M,_]=d([]),[j,z]=d(0),[V,K]=d(0),[q,G]=d(null),J=o(0),X=o(null),Y=l(()=>{_([]),z(0),K(0),J.current=0},[]),$=l(({pageSize:e,pageIndex:t,sortBy:i,filters:r})=>{H(!0),G(null);const n=++J.current,a=Number(e)*Number(t)+1,s=Number(a)+Number(e)-1;let o=((e=[])=>(Array.isArray(e)||(e=[e]),e.map((e,t)=>({ACCESSOR:e.id,CONDITION:e.value.condition,VALUE:e.value.value,TYPE:e.value?.type??""}))))(r);X.current&&X.current?.abort?.(),X.current=new AbortController,T?.getGridData(a,s,((e=[])=>e.map((e,t)=>({ACCESSOR:e.id??"",VALUE:e?.desc?"desc":"asc"})))(i),o,X.current).then(t=>{n===J.current&&(_(u(t?.[0]?.REPORT_DATA??[])),K(Math.ceil(Number(t?.[0]?.COUNT??1)/Number(e))),z(Number(t?.[0]?.COUNT??1)),H(!1))}).catch(e=>{e?.error_msg?.includes("AbortError")||G(e),H(!1)})},[z,H,_,T]),Z=o(null),ee=v&&b?{"data-scope-id":v}:{},te=l((e,t)=>{y(e,t,M[e])},[M]);return h(()=>{"function"==typeof C&&C(M)},[M]),h(()=>{b&&Z.current&&Z.current.focus()},[b]),t(i,{children:[q&&e(to,{severity:"error",errorMsg:q?.error_msg??"Unknown Error occured",errorDetail:q?.error_detail}),e("div",{ref:Z,tabIndex:b?0:-1,onKeyDown:e=>{b&&Es(e,v)},style:{width:"100%",position:"relative"},...ee,children:e(FA,{ref:S,label:r.gridConfig?.gridLabel?L(r.gridConfig.gridLabel):L(Ss(window.location.pathname,N?.menulistdata??[],r?.gridConfig?.setScreenCode??!0,r?.gridConfig?.showUserCode??!1)),dense:!0,multipleActions:r?.multipleActions,singleActions:r?.singleActions,doubleClickAction:r?.doubleClickAction,alwaysAvailableAction:r?.alwaysAvailableAction,setGridAction:r?.setAction,filterMeta:D,getRowId:O,columns:I,defaultColumn:U,defaultHiddenColumns:r.hiddenColumns,defaultFilter:P,defaultSortOrder:R,loading:Q,data:M,setData:_,onFetchData:$,pageCount:V,totalRecords:j,pageSizes:r.gridConfig?.pageSizes??[5,10],defaultPageSize:r.gridConfig?.defaultPageSize??10,allowColumnReordering:r.gridConfig?.allowColumnReordering??!1,allowColumnHiding:r.gridConfig?.allowColumnHiding??!1,allowKeyboardNavigation:r.gridConfig?.allowKeyboardNavigation??!1,allowFilter:r.gridConfig?.allowFilter??!0,filterAlwaysVisible:r.gridConfig?.filterAlwaysVisible??!1,containerHeight:r?.gridConfig?.containerHeight,occupiedHeight:r?.gridConfig?.occupiedHeight,allowRowSelection:r?.gridConfig?.allowRowSelection??!0,autoRefreshInterval:A,enablePaginationInput:r.gridConfig?.enablePaginationInput??E?.enablePaginationInput??!0,finalMetaData:r.columns.map(e=>({...e,columnName:L(e.columnName)})),enableExport:p,enablePdfPrint:r?.gridConfig?.enablePdfPrint??k?.enablePdfPrint??!1,reportTemplateCode:f,variant:m??E?.variant??"standard",autoFetch:r?.gridConfig?.autoFetch??g??!0,handleReset:Y,headerToolbarStyle:w,enableEnterToFocus:b,disableSorting:r?.gridConfig?.disableSorting,onButtonActionHandel:te,handleClickAction:B,disableMultipleRowSelect:x,defaultSelectedRowId:F,footerNote:r.gridConfig?.footerNote??"",footerNoteStyles:r.gridConfig?.footerNoteStyles??{}})})]})}),NA=c(({gridCode:t,getGridData:i,metaData:r,actions:n,setAction:a,defaultFilter:s=[],defaultSortOrder:o=[],dataTransformer:l=e=>e,autoRefreshInterval:h,enableExport:c,reportTemplateCode:d,variant:u,autoFetch:A,headerToolbarStyle:p,enableEnterToFocus:f,focusScopeId:m,onClickActionEvent:g,onDataChange:w,defaultSelectedRowId:b,disableMultipleRowSelect:v,handleClickAction:y},B)=>{let C=EA({metaData:r,actions:n,setAction:a});return e(wA,{gridCode:t,getGridData:i,children:e(jl,{children:e(SA,{ref:B,metaData:C,defaultFilter:s,defaultSortOrder:o,dataTransformer:l,autoRefreshInterval:h,enableExport:c,reportTemplateCode:d,variant:u,autoFetch:A,headerToolbarStyle:p,enableEnterToFocus:f,focusScopeId:m,disableMultipleRowSelect:v,defaultSelectedRowId:b,onClickActionEvent:g,handleClickAction:y,onDataChange:w})})})}),EA=({metaData:e,actions:t,setAction:i})=>{let r=N(e),n=r.columns,a=r.filters;a=hl(a);const s=cl(n);n=uo(n),n=oo(n),n=dl(n);const o=ul(t??null);return{columns:n,gridConfig:r.gridConfig,hiddenColumns:s,filters:a,setAction:i,...o}},kA=({content:t,buttonText:r="",enableShortcut:n,shortcut:a,eventKey:s,...o})=>e(qi,{...o,content:t,children:e(Gi,{children:({handlePrint:t})=>e(i,{children:Boolean(r)?e(eo,{enableShortcut:n,shortcut:a,eventKey:s,onClick:t,children:r}):e(Wo,{title:Ge("Print"),arrow:!0,children:e(C,{onClick:t,size:"small",children:e(Wi,{style:{color:"var(--white)"}})})})})})}),TA=({isOpen:i=!1,validMessage:r,onActionYes:n,onActionNo:a,rows:s,isLoading:o=!1,isError:l=!1,error_msg:h="",error_detail:c="",loadingText:d="Loading..."})=>{const{t:u}=W();return t(dt,{open:i,maxWidth:"sm",children:[e(ut,{children:r}),e(pt,{children:o?e(no,{text:d},"loaderforDeleteing"):l?e(to,{severity:"error",errorMsg:h??"Unknown Error occured",errorDetail:c??""}):null}),t(At,{children:[e(ct,{onClick:()=>a(),color:"secondary",disabled:o,children:u("No")}),e(ct,{onClick:()=>n(s),color:"secondary",disabled:o,children:u("Yes")})]})]})},LA=({validMessage:t,onActionYes:i,onActionNo:r,isLoading:n=!1,isError:a=!1,error_msg:s="",error_detail:o="",loadingText:l="Loading..."})=>{const{state:h}=Ji();return e(TA,{isOpen:!0,validMessage:t,isLoading:n,onActionYes:i,onActionNo:r,isError:a,rows:h,error_msg:s,error_detail:o,loadingText:l})},IA=({MessageTitle:r,Message:n,onActionYes:a,onActionNo:s,rows:o,open:l=!1,loading:h=!1,enableEnterToFocus:c,focusScopeId:d="enter-to-focus-popup-msg"})=>{const u=ad(),{t:A}=W(),{enableEnterToFocus:p}=ns(),f=c??p;return e(i,{children:t($,{fullWidth:!1,open:l,className:"PopupMessageAPIWrapper__base",onKeyDown:e=>{f&&Es(e,d)},...d&&f?{"data-scope-id":d}:{},children:[e(Z,{className:u.dialogTitleClass,children:A(r)}),e(ee,{children:e(te,{style:{color:"black",marginTop:"8px",marginBottom:"6px"},children:A(n)})}),t(ie,{className:u.verifybutton,children:[e(eo,{endIcon:h?e(he,{size:20}):null,onClick:()=>a(o),disabled:h,children:A("Yes")}),e(eo,{onClick:()=>s(),disabled:h,children:A("No")})]})]})})},DA=Ci(e=>({arrayRowContainer:{position:"relative",boxShadow:e.shadows[3],marginBottom:e.spacing(1),paddingRight:"8px",paddingBottom:"8px"},newArrayRowContainer:{position:"relative",boxShadow:"",marginBottom:"0","& .MuiInputBase-root":{marginTop:"0px"},"& .css-1qlanbt-MuiInputBase-root-MuiFilledInput-root":{"&:after":{borderBottom:"none"},"&:hover":{"&:before":{borderBottom:"none"}}},"& .MuiGrid-item":{}},newSecondArrayRowContainer:{position:"relative",boxShadow:"",marginBottom:"0","& .css-1qlanbt-MuiInputBase-root-MuiFilledInput-root":{"&:after":{borderBottom:"none"},"&:hover":{"&:before":{borderBottom:"none"}}}},arrayRowRemoveBtn:{position:"absolute",top:-8,right:-8,color:"#f50057"},arrayRowRemoveBtnStepper:{position:"absolute",top:-1,right:42,color:"#f50057"},arrayRowCard:{width:"100%",position:"relative",overflow:"unset"},arrayRowCardContent:{paddingLeft:"25px"},arrayRowCount:{display:"flex",width:"100%",margin:"0px 0 6px -8px"},arrayRowCountCustomStyle:{display:"flex",width:"100%",margin:"2px 0 0px -8px"},arrayRowCountFixedRows:{display:"flex",width:"100%",margin:"2px 0 6px -8px"},arrayScreenRowCount:{display:"flex",width:"100%",margin:"2px 0 12px 0px"},newArrayRowCardContent:{paddingLeft:"32px","& .MuiInputBase-root":{marginTop:"0px"}},arrayFieldSelected:{padding:"8px 0px 0px 8px",background:"#eee",width:"100%"},arrayFieldUnselected:{width:"100%"}})),UA=({row:r,getAllRowsValues:n,fieldKey:a,oneRow:s,classes:o,removeFn:h,rowIndex:c,removeRowFn:u,totalRows:A,isSubmitting:p,formState:m,formName:g,arrayFieldIDName:w,arrayFieldName:b,fixedRows:v,isDisplayCount:y=!0,isCustomStyle:B=!1,disagreeButtonName:C,agreeButtonName:x,errorTitle:F,displayCountName:S,isRemoveButton:N,selectedRowIndex:E,setSelectedRowIndex:k,hideRemoveIconOnSingleRecord:T,enableEnterToFocus:L})=>{const{messageBoxConfig:I}=fd(),{t:D}=W(),U=ad(),[P,R]=d(!1),[O,Q]=d(!1),[H,M]=d(""),[_,j]=d(!1),[z,V]=d({allow:!0,reason:""}),K=l((e=!1)=>{_||e?h(c):(R(!1),setTimeout(()=>{Q(!1),M(""),j(!1)},1))},[R,Q,M,j,_,h,c]),q=l(async()=>{let e=!0,t="Cannot remove a Row",i=!0;if("function"==typeof u){try{i=await u(m,b,n(),c)}catch(e){console.error("Remove row function error<<",e)}"boolean"==typeof i?e=i:"object"==typeof i&&(e=i?.allow??!1,t=i?.reason??"Cannot remove a Row")}e?R(!0):V({allow:e,reason:t})},[R,c]);let G;G=Boolean(B)?0!==c?o.newArrayRowContainer:o.newSecondArrayRowContainer:Boolean(v)?o.newSecondArrayRowContainer:o.arrayRowContainer;const J=n()?.[b]?.[c]?._rowColor,Y=()=>{k(c);const e=n(),t=Object.keys(r.cells).reduce((t,i)=>{const n=(t=>{const i=t.replace(/\]/g,"").split(/\[|\./);let r=e;return i.forEach(e=>{r=r&&e in r?r[e]:void 0}),r})(r.cells[i].name);return t[i]=n,t},{});"function"==typeof m?.onArrayFieldRowClickHandle&&m?.onArrayFieldRowClickHandle(t),"function"==typeof m?.onArrayFieldRowDoubleClickHandle&&m?.onArrayFieldRowDoubleClickHandle(t)},re={INFO:I?.iconsConfig?.INFO?.color??"dodgerblue",SUCCESS:I?.iconsConfig?.SUCCESS?.color??"green",WARNING:I?.iconsConfig?.WARNING?.color??"orange",ERROR:I?.iconsConfig?.ERROR?.color??"#f44336",CONFIRM:I?.iconsConfig?.CONFIRM?.color??"#474e5b"},ne=I?.iconsConfig?.SUCCESS?.icon??Tt,ae=I?.iconsConfig?.CONFIRM?.icon??kt;return t(f,{children:[Boolean(y)?e(i,{children:e(X,S?{gutterBottom:!0,className:(B?o.arrayRowCountCustomStyle:v?o.arrayRowCountFixedRows:o.arrayRowCount)+` ${b}-arrayField-firstrow`,children:`${S} ${c+1} of ${A}`}:{gutterBottom:!0,className:(B?o.arrayRowCountCustomStyle:v?o.arrayRowCountFixedRows:o.arrayRowCount)+` ${b}-arrayField-firstrow`,children:`${c+1} of ${A}`})}):null,e("div",{onClick:m?.onArrayFieldRowClickHandle&&Y,onDoubleClick:m?.onArrayFieldRowDoubleClickHandle&&Y,className:E===c?o?.arrayFieldSelected:o?.arrayFieldUnselected,children:t(ge,{container:!0,item:!0,xs:12,md:12,sm:12,spacing:1,className:G+` ${b}-array-field-row`,sx:{background:`${Boolean(J)&&"string"==typeof J?J:"none"}`},children:[s,"function"==typeof h&&!Boolean(v)||Boolean(N)?e(i,{children:A>1||!T?e(de,{onClick:q,className:o.arrayRowRemoveBtn,disabled:p,children:e(Et,{})}):null}):null]})}),v&&c+1<A?e(we,{sx:{backgroundColor:"rgba(0, 0, 0, 0.6)",width:"100%"}}):null,t($,{open:P,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",className:"arrayfield__delete__dialog__base",onKeyDown:e=>{L&&Es(e)},children:[e(Z,{className:U.dialogTitleClass,style:{background:_?re.SUCCESS:re.CONFIRM},children:D(_?"Success":"Confirmation")}),t(ee,{sx:{padding:".75rem 10px 1.5rem 10px !important",display:"flex",alignItems:"center",gap:"0.5rem"},children:[e(oe,{children:_?e(ne,{fontSize:"large",style:{color:re.SUCCESS}}):e(ae,{fontSize:"large",style:{color:re.CONFIRM}})}),e(te,{children:e(X,{color:"black",children:_?D("Recordsuccessfullydeleted"):O?D("Pleasewaitdeletingrecord"):Boolean(H)?H:D(F||"AreyouSureyouwanttodeletethisrecord")})})]}),t(ie,{children:[e(eo,{onClick:()=>K(!0),sx:{background:re.CONFIRM,"&:hover":{background:re.CONFIRM}},children:D(x||"Yes")}),e(eo,{onClick:()=>K(!1),sx:{background:re.CONFIRM,"&:hover":{background:re.CONFIRM}},children:D(C||"No")})]})]}),z.allow?null:e(PA,{open:!z.allow,className:"arrayfield__remove__error__dialog__base",icon:"ERROR",reason:z.reason,handleClick:()=>{V({allow:!0,reason:""})},enableEnterToFocus:L},"remove-error-dialog")]},r.fieldIndexKey)},PA=({open:i,icon:r="ERROR",className:n,reason:a,handleClick:s,enableEnterToFocus:l})=>{const c=ad(),d=o(null),{messageBoxConfig:u}=fd(),A={INFO:u?.iconsConfig?.INFO?.color??"dodgerblue",SUCCESS:u?.iconsConfig?.SUCCESS?.color??"green",WARNING:u?.iconsConfig?.WARNING?.color??"orange",ERROR:u?.iconsConfig?.ERROR?.color??"#f44336",CONFIRM:u?.iconsConfig?.CONFIRM?.color??"#474e5b"},p=u?.iconsConfig?.[r]?.icon??Lt;return h(()=>{setTimeout(()=>{d.current&&d.current.focus()},100)},[]),t($,{open:i,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",className:n,onKeyDown:e=>{l&&Es(e)},children:[e(Z,{className:c.dialogTitleClass,style:{background:A[r]},children:Ge("Stop")}),t(ee,{sx:{padding:".75rem 10px 1.5rem 10px !important",display:"flex",alignItems:"center",gap:"0.5rem"},children:[e(oe,{children:e(p,{fontSize:"large",style:{color:A[r]}})}),e(te,{children:e(X,{color:"black",children:a})})]}),e(ie,{children:e(eo,{onClick:s,ref:d,sx:{background:A[r],"&:hover":{background:A[r]}},children:Ge("Ok")})})]})},RA=({arrayFieldName:e,template:t,shouldExclude:i,dependentFields:r,getFixedRowsCount:n})=>{const c=a(Ya),d=s(()=>Object.keys(t),[t]),u=o(d);u.current=d;const A=R(Pa(c.formName)),[p,f]=O(qa(`${c.formName}/${e}`)),m=o(p);m.current=p;const g=Q(Wa(c.formName)),w=Q(Ja(c.formName)),b=Q(Ka(c.formName)),v=_(l((e,t,{fieldName:i})=>{t(Ha(c.formName),i)},[c.formName])),y=_(l((e,t,i)=>e(Ga(c.formName)).includes(i),[c.formName])),B=R(Xa({formName:"function"==typeof i||"function"==typeof n?c.formName:`${c.formName}-NOTEXIST`,fields:r})),C=_(l((e,t,i)=>{const r=[];for(let e=0;e<i.length;e++){let n=Object.keys(i[e]?.cells);for(let a=0;a<n.length;a++){const s=i[e].cells[n[a]].key;t(Ra(`${c.formName}/${s}`),M),r.push(`${c.formName}/${s}`)}}const n=e(za(c.formName)).filter(e=>!r.includes(e));t(za(c.formName),n)},[c.formName])),x=o(null);h(()=>{if("function"==typeof i){const e=Promise.resolve(i({},B,c.formState));x.current=e,e.then(t=>{e===x.current&&(!0===t&&!1===p.excluded?(f(e=>({...e,excluded:!0})),C(p.templateFieldRows)):!1===t&&!0===p.excluded&&f(e=>({...e,excluded:!1})))})}},[i,B,c.formState]),h(()=>{if("function"==typeof n&&!1===p.excluded){let e=n(p,B,c.formState);e<0&&(e=0);const t=p.templateFieldRows.filter(e=>!e.isDeleted).length;if(t!==e){let i=e-t;if(i>0){let e=p.templateFieldRows.length,t=p.templateFieldRows,r=p.lastInsertIndex;for(;i>0;){let n=N(e,t,r,u.current);t=n?.newRows,r=n?.lastIndex??-1,e++,i--}Array.isArray(t)&&f(e=>({...e,lastInsertIndex:r,templateFieldRows:t}))}else{let e=Math.abs(i),t=p.templateFieldRows.map((e,t)=>e.isDeleted?-1:t).filter(e=>-1!==e),r=[];for(let i=0;i<e;i++){const e=t.pop();void 0!==e&&-1!==e&&(r.push(p.templateFieldRows[e]),p.templateFieldRows[e]={isDeleted:!0})}C(r);const n=p.templateFieldRows.filter(e=>!e.isDeleted);f(e=>({...e,templateFieldRows:n,lastInsertIndex:e.lastInsertIndex}))}}}},[B,n,p,C,c.formState]);const F=_(l((e,t,i,r)=>{let n=0,a=!1;const s=i.map(i=>{if(i.isDeleted)return i;const s={...i,cells:{...i.cells}};let o=!1;for(const l of r){const r=i.cells[l],h=`${c.formName}/${r.key}`,d=r.key.replace(/\[\d+\]/,`[${n}]`);if(r.name!==d){s.cells[l]={...r,name:d},a=!0,o=!0;const i=e(Ra(h));i&&t(Ra(h),{...i,name:`${c.formName}/${d}`})}}return n++,o?s:i});a&&f(e=>({...e,templateFieldRows:s}))},[f,c.formName]));h(()=>{F(p.templateFieldRows,u.current)},[p.templateFieldRows,F]);const S=_(l((t,i,r)=>{const n=[],a=r.filter(e=>!e.isDeleted),s=new Map;for(const e of a)for(const t of Object.keys(e.cells)){const i=e.cells[t],r=`${c.formName}/${i.key}`;n.push(r),s.set(r,i.name)}let o={};for(const e of n){const i=t(Ra(e));if(i){if(!0===i.excluded)continue;let t=i.value;if(""===t){const e=i.name.replace(`${c.formName}/`,""),r=ka(c.initialValues,e,"");""!==r&&(t=r)}o=Ta(o,(s.get(e)||i.name).replace(`${c.formName}/`,""),t)}}const l=ka(o,e);return o=Ta(o,e,(e=>{if(!e||"object"!=typeof e||!Array.isArray(e))return[];const t=Object.keys(e).sort((e,t)=>parseInt(e,10)-parseInt(t,10)).map(t=>e[t]).filter(e=>null!=e&&("object"!=typeof e||0!==Object.keys(e).length));return t})(l)),o},[c.formName,e,c.initialValues])),N=l((t,i,r,n)=>{if(t>=0&&t<=i.length){const a=r+1,s=i.filter(e=>!e.isDeleted).length;let o={cells:{},fieldIndexKey:`${c.formName}/${e}/${a}`,isDeleted:!1};for(const t of n){const i=`${e}[${a}].${t}`,r=`${e}[${s}].${t}`;o.cells[t]={key:i,name:r}}return{newRows:[...i.slice(0,t),o,...i.slice(t)],lastIndex:a}}},[e,c.formName]),E=l(e=>{const t=m.current.templateFieldRows;if(e<0||e>=t.length)return;const i=t[e];for(const e of Object.values(i.cells)){const t=`${c.formName}/${e.key}`;b(t),v({fieldName:t})}f(t=>{const i=[...t.templateFieldRows];return i[e]={...i[e],isDeleted:!0},{...t,templateFieldRows:i}});for(const e of u.current){const t=i.cells[e].key,r=`${c.formName}/${t}`;c.lastValidationValue.current.delete(r),c.flagRef.current.delete(r)}},[b,v,f,c.formName]);l(t=>{const i=ka(t,e);if(void 0!==i&&Array.isArray(i)){let e=-1,t=[];for(let r=0;r<i.length;r++){const i=N(t.length,t,e,u.current);void 0!==i&&(e=i.lastIndex,Array.isArray(i.newRows)&&(t=i.newRows))}f(i=>({...i,resetFlag:!1,templateFieldRows:t,lastInsertIndex:e}))}else f(e=>({...e,resetFlag:!1,templateFieldRows:[],lastInsertIndex:-1}))},[e,f,N]);const k=_(l((e,t,i)=>{i.forEach(({key:i,name:r,value:n,componentType:a})=>{const s=`${c.formName}/${i}`,o={...e(Ra(s)),fieldKey:s,name:r,value:n??"",displayValue:n??""};t(Ra(s),o),t(za(c.formName),e=>-1===e.indexOf(s)?[...e,s]:e)})},[c.formName])),T=l(i=>{const r=ka(i,e),n=Object.keys(c?.defaultArrayFieldValues?.[e]).length>0?r?.map(t=>({...c?.defaultArrayFieldValues?.[e],...t})):r;if(void 0!==n&&Array.isArray(n)){let e=-1,i=[],r=[];for(let a=0;a<n.length;a++){const s=N(i.length,i,e,u.current);if(void 0!==s){e=s.lastIndex,i=s.newRows;const o=s.newRows[s.newRows.length-1];for(const e of u.current){const i=t[e],s=o.cells[e].key;o.cells[e].name;const l=ka(n[a],e,null);r.push({key:s,name:`${c.formName}/${s}`,value:l,componentType:i?.componentType||""})}}}k(r),f(t=>({...t,resetFlag:!1,templateFieldRows:i,lastInsertIndex:e}))}else f(e=>({...e,resetFlag:!1,templateFieldRows:[],lastInsertIndex:-1}))},[e,f,N,k,c.formName,t,c?.defaultArrayFieldValues]);h(()=>{const t=`${c.formName}/${e}`;if(y(t)||(g(t),"object"==typeof c.initialValues&&T(c.initialValues)),!0===Boolean(c.resetFieldOnUnmount))return()=>{f({fieldName:t,templateFieldRows:[],lastInsertIndex:-1,resetFlag:!1,excluded:!1}),w(t)}},[g,w,c.formName,e,c.resetFieldOnUnmount,c.initialValues,T,y,f]),h(()=>{!0===p.resetFlag&&"object"==typeof c.initialValues&&Object.keys(c.initialValues).length>0&&T(c.initialValues)},[p.resetFlag,T,c.initialValues]);const L=l(e=>{const t=m.current.templateFieldRows.filter(e=>!e.isDeleted);return t.map((i,r)=>{const n=m.current.templateFieldRows.indexOf(i);return e({row:i,fields:u.current?.slice?.()??[],rowIndex:n,removeFn:E,totalRows:t.length})})},[E,m.current.templateFieldRows]),I=l(()=>{f(e=>({...e,resetFlag:!1,templateFieldRows:[],lastInsertIndex:-1}))},[f]),D=l(e=>{const t=N(e,m.current.templateFieldRows,m.current.lastInsertIndex,u.current);void 0!==t&&Array.isArray(t.newRows)&&f(e=>({...e,lastInsertIndex:t.lastIndex,templateFieldRows:t.newRows}))},[f,N]),U=l(()=>{const e=N(m.current.templateFieldRows.length,m.current.templateFieldRows,m.current.lastInsertIndex,u.current);void 0!==e&&f(t=>({...t,lastInsertIndex:e.lastIndex,templateFieldRows:e.newRows}))},[f,N]),P=l(()=>{const e=N(0,m.current.templateFieldRows,m.current.lastInsertIndex,u.current);void 0!==e&&Array.isArray(e.newRows)&&f(t=>({...t,lastInsertIndex:e.lastIndex,templateFieldRows:e.newRows}))},[f,N]),H=l(()=>{const e=m.current.templateFieldRows.map((e,t)=>e.isDeleted?-1:t).filter(e=>-1!==e),t=e.pop();void 0!==t&&E(t)},[E]),j=l(()=>S(m.current.templateFieldRows),[S]);return{fieldRows:p,templateFieldNames:u.current,clearFieldArray:I,getAllRowsValues:j,unshift:P,push:U,insert:D,pop:H,remove:E,renderRows:L,excluded:p.excluded,isSubmitting:A.isSubmitting,formState:c.formState,formName:c.formName}},OA=A(({name:r,label:n,_fields:c,GridProps:A,enableGrid:p,componentProps:m={},removeRowFn:g,addRowFn:w,arrayFieldIDName:b,dependentFields:v,shouldExclude:y,fixedRows:B,isDisplayCount:C=!0,getFixedRowsCount:x,onFormButtonClickHandel:F,onFormDataChange:S,isRemoveButton:E,changeRowOrder:k,noRecordMessage:T,displayCountName:L,disagreeButtonName:I,agreeButtonName:D,errorTitle:U,hideRemoveIconOnSingleRecord:P=!0,enableEnterToFocus:R,focusScopeId:O})=>{const{t:Q}=W(),H=ns(),{messageBoxConfig:M}=fd(),_=a(Ya),{authState:j}=es(),z=DA(),[V,K]=d(!1),[q,G]=d(""),[J,Y]=d(null);let $=N(c),Z=s(()=>({form:{},fields:$}),[$]);const ee=o(null);null===ee.current&&(ee.current=((e,t,i,r)=>(e=oc(e,Sc,t,i,r),e=sc(e),lc(e)))(Z,Q,j,H));const te=o(ee?.current?.fields?.reduce((e,t)=>(e[t.name]="",e),{})),{renderRows:ie,getAllRowsValues:re,push:ae,isSubmitting:se,excluded:le,formState:he,fieldRows:ce}=RA({arrayFieldName:r,template:te.current,dependentFields:v,shouldExclude:y,getFixedRowsCount:x}),ue=s(()=>ce.templateFieldRows.filter(e=>!e.isDeleted),[ce.templateFieldRows]).length,Ae=ue>0?ue-1:0,[we,ve]=d(0);_.setCurrentStepIndexFnRef=ve,h(()=>{we>Ae&&ve(Ae)},[Ae,we]);const[ye,Be]=d("1");h(()=>{Be(String(we+1))},[we]);const Ce=()=>{let e=parseInt(ye,10);isNaN(e)||e<1||e>ue?Be(String(we+1)):ve(e-1)},xe=l(()=>{const e=re();if("function"==typeof w){let t=w(e,r),i=!1,n="Cannot add a new Row";"boolean"==typeof t&&(i=t),"object"==typeof t&&(i=t?.allow??!1,n=t?.reason??"Cannot add a new Row"),i?(ae(),ve(ue)):(K(!0),G(n))}else ae(),ve(ue)},[ae,w,re,r,ue]),Fe=s(()=>ee.current?.fields?.reduce((e,t)=>(e[t.name]=t,e),{}),[ee]),Se=l((e,t)=>{const i=ue-1,r=i>0?i-1:0;t(e),we>=i&&i>0?ve(r):0===i&&ve(0)},[we,ve,ue]),Ne=ue>0?ce.templateFieldRows.filter(e=>!e.isDeleted).map(e=>ce.templateFieldRows.indexOf(e))[we]:-1;if(le)return null;const Ee=ie(({row:t,removeFn:i,rowIndex:n,fields:a})=>!(n===Ne)||t.isDeleted?null:e(f,{children:e(QA,{row:t,classes:z,removeFn:i,rowIndex:n,totalRows:ue,fields:a,currentMetaToObj:Fe,componentProps:m,t:Q,isDisplayCount:C,arrayFieldName:r,isRemoveButton:E,disagreeButtonName:I,agreeButtonName:D,errorTitle:U,removeRowFn:g,hideRemoveIconOnSingleRecord:P,onFormDataChange:S,onFormButtonClickHandel:F,formState:he,getAllRowsValues:re,isSubmitting:se,fixedRows:B,onRowRemove:()=>Se(n,i),selectedRowIndex:J,setSelectedRowIndex:Y,enableEnterToFocus:R??M.enableEnterToFocus,focusScopeId:O},t.fieldIndexKey)},`${r}-${t.fieldIndexKey}`));let ke=t(f,{children:[t(pe,{className:z.arrayRowCard,children:[e(fe,{title:n,sx:{padding:"5px 16px 0 8px","&>.MuiCardHeader-action":{width:"100%"}},action:t(be,{className:"test",direction:"row",alignItems:"center",justifyContent:"space-between",spacing:2,sx:{width:"100%"},children:[ue>0?t(i,{children:[t(be,{direction:"row",alignItems:"center",children:[C?e(X,{children:Q("string"==typeof L?L:"Record")}):null,e(Ao,{type:"number",value:ye,onChange:e=>{const t=e.target.value;/^[0-9]*$/.test(t)&&Be(t)},onBlur:Ce,autoComplete:"off",onKeyDown:e=>{"Enter"===e.key&&Ce(),[".",",","e","E","+","-"].includes(e.key)&&e.preventDefault()},inputProps:{inputMode:"numeric",pattern:"[0-9]*"},sx:{"& .MuiInputBase-root":{margin:"0 5px !important",height:"28px",width:"40px",pointerEvents:"visible !important","& input":{textAlign:"center"}}}}),t(X,{children:[Q("of")," ",ue]})]}),t(oe,{mt:2,display:"flex",justifyContent:"space-between",gap:.5,children:[e(ne,{title:Q("GoToFirst"),children:e(de,{size:"small",disabled:0===we,onClick:()=>ve(0),color:"secondary",children:e(Yi,{})})}),e(ne,{title:Q("Previous"),children:e(de,{size:"small",disabled:0===we,onClick:()=>ve(e=>Math.max(0,e-1)),color:"secondary",children:e($i,{})})}),e(ne,{title:Q("Next"),children:e(de,{size:"small",disabled:we===Ae,onClick:()=>ve(e=>Math.min(Ae,e+1)),color:"secondary",children:e(Zi,{})})}),e(ne,{title:Q("GoToLast"),children:e(de,{size:"small",disabled:we===Ae,onClick:()=>ve(Ae),color:"secondary",children:e(er,{})})})]})]}):null,e(be,{direction:"row",spacing:2,alignItems:"center",justifyContent:"end",sx:{width:"100%",flex:1},children:Boolean(B)?null:e(de,{style:{background:"#fff",boxShadow:"0 1px 3px rgba(0,0,0,.2)"},onClick:xe,disabled:se,size:"small",children:e(Nt,{})})})]})}),e(me,{children:t(ge,{container:!0,spacing:1,children:[Ee,ue<=0?e(X,{children:Q(T||"NoRecordsFoundclicktheaddbuttontoaddone")}):null]})})]}),V?e(HA,{open:V,className:"arrayfield__add__error__dialog__base",icon:"ERROR",reason:q,handleClick:()=>{K(!1),G("")},enableEnterToFocus:R??M.enableEnterToFocus},"add-error-dialog"):null]});return Boolean(p)?u(ge,{container:!0,...A,key:r},ke):e(f,{children:ke},r)}),QA=A(({row:r,classes:n,formState:a,getAllRowsValues:o,removeFn:h,rowIndex:c,totalRows:u,fields:A,currentMetaToObj:p,componentProps:m,t:w,arrayFieldName:b,isRemoveButton:v,removeRowFn:y,disagreeButtonName:B,agreeButtonName:C,errorTitle:x,hideRemoveIconOnSingleRecord:F,onFormButtonClickHandel:S,onFormDataChange:N,isSubmitting:E,fixedRows:k,onRowRemove:T,selectedRowIndex:L,setSelectedRowIndex:I,enableEnterToFocus:D,focusScopeId:U})=>{const{messageBoxConfig:P}=fd(),R=ad(),[O,Q]=d(!1),[H,M]=d(!1),[_,j]=d(""),[z,V]=d(!1),[K,q]=d({allow:!0,reason:""}),G=l((e=!1)=>{z||e?T():(Q(!1),setTimeout(()=>{M(!1),j(""),V(!1)},1))},[Q,M,j,V,z,T]),W=l(async()=>{let e=!0,t="Cannot remove a Row",i=!0;if("function"==typeof y){try{i=await y(a,b,o(),c)}catch(e){console.error("Remove row function error<<",e)}"boolean"==typeof i?e=i:"object"==typeof i&&(e=i?.allow??!1,t=i?.reason??"Cannot remove a Row")}e?Q(!0):q({allow:e,reason:t})},[y,a,b,o,c]);o();const J=()=>{I(c);const e=o(),t=Object.keys(r.cells).reduce((t,i)=>{const n=(t=>{const i=t.replace(/\]/g,"").split(/\[|\./);let r=e;return i.forEach(e=>{r=r&&e in r?r[e]:void 0}),r})(r.cells[i].name);return t[i]=n,t},{});"function"==typeof a?.onArrayFieldRowClickHandle&&a?.onArrayFieldRowClickHandle(t),"function"==typeof a?.onArrayFieldRowDoubleClickHandle&&a?.onArrayFieldRowDoubleClickHandle(t)},Y=s(()=>A.map(t=>{const i=p[t];if(!Boolean(i))return null;i.onFormButtonClickHandel=S,i.onFormDataChange=N;const n=Kh(i,{},b,m,U);return e(f,{children:g(n,{fieldKey:r.cells[t].key,name:r.cells[t].name,label:w(n?.props?.label),placeholder:w(n?.props?.placeholder)})},r.cells[t].key)}),[A,p,S,N,b,m,r.cells,w]),re={INFO:P?.iconsConfig?.INFO?.color??"dodgerblue",SUCCESS:P?.iconsConfig?.SUCCESS?.color??"green",WARNING:P?.iconsConfig?.WARNING?.color??"orange",ERROR:P?.iconsConfig?.ERROR?.color??"#f44336",CONFIRM:P?.iconsConfig?.CONFIRM?.color??"#474e5b"},ne=P?.iconsConfig?.SUCCESS?.icon??tr,ae=P?.iconsConfig?.CONFIRM?.icon??ir;return t(f,{children:[t(ge,{container:!0,item:!0,xs:12,spacing:1,onClick:a?.onArrayFieldRowClickHandle&&J,onDoubleClick:a?.onArrayFieldRowDoubleClickHandle&&J,children:[Y,"function"==typeof h&&!Boolean(k)||Boolean(v)?e(i,{children:u>1||!F?e(de,{onClick:W,className:n.arrayRowRemoveBtnStepper,disabled:E,children:e(Et,{})}):null}):null]}),t($,{open:O,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",className:"arrayfield__delete__dialog__base",onKeyDown:e=>{D&&Es(e)},children:[e(Z,{className:R.dialogTitleClass,style:{background:z?re.SUCCESS:re.CONFIRM},children:w(z?"Success":"Confirmation")}),t(ee,{sx:{padding:".75rem 10px 1.5rem 10px !important",display:"flex",alignItems:"center",gap:"0.5rem"},children:[e(oe,{children:z?e(ne,{fontSize:"large",style:{color:re.SUCCESS}}):e(ae,{fontSize:"large",style:{color:re.CONFIRM}})}),e(te,{children:e(X,{color:"black",children:z?w("Recordsuccessfullydeleted"):H?w("Pleasewaitdeletingrecord"):Boolean(_)?_:w(x||"AreyouSureyouwanttodeletethisrecord")})})]}),t(ie,{children:[e(eo,{autoFocus:!0,onClick:()=>G(!0),sx:{background:re.CONFIRM,"&:hover":{background:re.CONFIRM}},children:w(C||"Yes")}),e(eo,{onClick:()=>G(!1),sx:{background:re.CONFIRM,"&:hover":{background:re.CONFIRM}},children:w(B||"No")})]})]}),K.allow?null:e(HA,{open:!K.allow,className:"arrayfield__remove__error__dialog__base",icon:"ERROR",reason:K.reason,handleClick:()=>{q({allow:!0,reason:""})},enableEnterToFocus:D},"remove-error-dialog")]})}),HA=({open:i,icon:r="ERROR",className:n,reason:a,handleClick:s,enableEnterToFocus:l})=>{const c=ad(),d=o(null),{messageBoxConfig:u}=fd(),A={INFO:u?.iconsConfig?.INFO?.color??"dodgerblue",SUCCESS:u?.iconsConfig?.SUCCESS?.color??"green",WARNING:u?.iconsConfig?.WARNING?.color??"orange",ERROR:u?.iconsConfig?.ERROR?.color??"#f44336",CONFIRM:u?.iconsConfig?.CONFIRM?.color??"#474e5b"},p=u?.iconsConfig?.[r]?.icon??rr;return h(()=>{setTimeout(()=>{d.current&&d.current.focus()},100)},[]),t($,{open:i,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",className:n,onKeyDown:e=>{l&&Es(e)},children:[e(Z,{className:c.dialogTitleClass,style:{background:A[r]},children:Ge("Stop")}),t(ee,{sx:{padding:".75rem 10px 1.5rem 10px !important",display:"flex",alignItems:"center",gap:"0.5rem"},children:[e(oe,{children:e(p,{fontSize:"large",style:{color:A[r]}})}),e(te,{children:e(X,{color:"black",children:a})})]}),e(ie,{children:e(eo,{onClick:s,ref:d,sx:{background:A[r],"&:hover":{background:A[r]}},children:Ge("Ok")})})]})};var MA=Object.freeze({__proto__:null,ArrayField2:({name:i,label:r,_fields:n,GridProps:a,enableGrid:s,componentProps:h={},removeRowFn:c,addRowFn:A,arrayFieldIDName:p,dependentFields:m,shouldExclude:w,fixedRows:b,isDisplayCount:v,isCustomStyle:y,getFixedRowsCount:B,onFormButtonClickHandel:C,onFormDataChange:x,disagreeButtonName:F,agreeButtonName:S,errorTitle:E,displayCountName:k,isRemoveButton:T,changeRowOrder:L,noRecordMessage:I,hideRemoveIconOnSingleRecord:D=!0,enableEnterToFocus:U,focusScopeId:P,formState:R})=>{const{t:O}=W(),Q=ns(),{messageBoxConfig:H}=fd(),{authState:M}=es();let _=N(n);const j=DA(),[z,V]=d(!1),[K,q]=d(""),[G,J]=d(null);let Y={form:{},fields:_};const $=o(null);null===$.current&&($.current=((e,t,i,r,n)=>(e=oc(e,Sc,t,i,r,n),e=sc(e),lc(e)))(Y,O,M,Q,R));const Z=o($?.current?.fields?.reduce((e,t)=>(e[t.name]="",e),{})),ee=o($?.current?.fields?.reduce((e,t)=>(e[t.name]=t,e),{})),{renderRows:te,getAllRowsValues:ie,unshift:re,isSubmitting:ne,formState:ae,formName:se,excluded:oe,push:le}=Is({arrayFieldName:i,template:Z.current,dependentFields:m,shouldExclude:w,getFixedRowsCount:B}),he=l(()=>{setTimeout(()=>{const e=document.querySelectorAll(`.${i}-arrayField-firstrow`)?.[0],t=document.querySelectorAll(`.${i}-array-field-row`),r=t[t.length-1];!L&&e?e.scrollIntoView({behavior:"smooth",block:"center"}):L&&r&&r.scrollIntoView({behavior:"smooth",block:"center"})},50)},[i,L]),ce=l(()=>{if("function"==typeof A){let e=A(ie(),i),t=!1,r="Cannot add a new Row";"boolean"==typeof e&&(t=e),"object"==typeof e&&(t=e?.allow??!1,r=e?.reason??"Cannot add a new Row"),t?(Boolean(L)?le():re(),he()):(V(!0),q(r))}else Boolean(L)?le():re(),he()},[re,ie]);if(oe)return null;let ue=te(({row:t,removeFn:r,rowIndex:n,fields:a,totalRows:s})=>{const o=a.map(r=>{const a=ee.current[r];if(!Boolean(a))return null;let s;a.onFormButtonClickHandel=C,a.onFormDataChange=x,s=0===n?{...a}:{...a,label:null};const o=Kh(y?s:a,{},i,h,P);let l=g(o,{fieldKey:t.cells[r].key,name:t.cells[r].name,label:O(o?.props?.label),placeholder:O(o?.props?.placeholder)});return e(f,{children:l},t.cells[r].key)});return e(UA,{fieldKey:t.cells[p??""]?.key??"",getAllRowsValues:ie,oneRow:o,classes:j,removeFn:r,rowIndex:n,removeRowFn:c,row:t,totalRows:s,isSubmitting:ne,formState:ae,formName:se,arrayFieldIDName:p,arrayFieldName:i,fixedRows:b,isDisplayCount:v,isCustomStyle:y,disagreeButtonName:F,agreeButtonName:S,errorTitle:E,displayCountName:k,isRemoveButton:T,selectedRowIndex:G,setSelectedRowIndex:J,hideRemoveIconOnSingleRecord:D,enableEnterToFocus:U??H.enableEnterToFocus},t.fieldIndexKey)});let Ae=t(f,{children:[t(pe,{className:j.arrayRowCard,children:[e(fe,{style:{paddingTop:0,paddingBottom:0,position:"sticky",top:0,zIndex:1},sx:{"& .MuiCardHeader-title":r?{background:"var(--theme-color5)",ml:1.5,mt:1,p:1,color:"var(--theme-color2)"}:null,"& .MuiCardHeader-action":{}},title:r,action:Boolean(b)?null:e(de,{style:{background:"#fff",boxShadow:"0 1px 3px rgba(0,0,0,.2)"},onClick:ce,disabled:ne,size:"small",children:e(Nt,{})})}),e(me,{className:j.arrayRowCardContent,style:{paddingTop:"0px",paddingBottom:"16px"},children:t(ge,{container:!0,item:!0,spacing:1,xs:12,md:12,sm:12,style:{marginTop:"2px"},children:[ue,ue.length<=0?e(X,{children:O(I||"NoRecordsFoundclicktheaddbuttontoaddone")}):null]})})]}),z?e(PA,{open:z,className:"arrayfield__add__error__dialog__base",icon:"ERROR",reason:K,handleClick:()=>{V(!1),q("")},enableEnterToFocus:U??H.enableEnterToFocus},"add-error-dialog"):null]});return Boolean(s)?u(ge,{container:!0,...a,key:i},Ae):e(f,{children:Ae},i)},ArrayFieldStepper:OA,ArrayFieldValues:({name:i,label:r,_fields:n,GridProps:a,enableGrid:s,defaultValue:o,componentProps:l={}})=>{let h=N(n);const c=DA();if(!Array.isArray(o))return e("div",{children:"Invalid data for arrayField"});const d=o.map((t,r)=>{const n=(a=h,s=t,Array.isArray(a)?a.map(e=>{const{name:t,...i}=e;return{...i,name:t,defaultValue:s[t]??"N/A"}}):[]);var a,s;const o=n.map((t,r)=>{const n=((t,i,r,n={})=>{const{render:a,schemaValidation:s,...o}=t;let l=null;switch(a.componentType){case"arrayField":l=Wh;break;case"spacer":l=Gh;break;case"typography":l=Xh;break;case"hidden":l=Jh;break;default:l=qh}if(l===Gh||l===Xh)return e(l,{...o},`${r}/${o.name}`);{const e={...n[a.componentType],...o},t={...i?.gridConfig?.item,...o?.GridProps};return u(l,{...e,fieldKey:o.name,key:`${r}/${o.name}`,enableGrid:!0,GridProps:{item:!0,xs:t?.xs??"auto",md:t?.sm??"auto",xl:t?.xs??"auto"}})}})(t,{},i,l);return e(f,{children:n},`${t.name}-${r}`)});return e(f,{children:e(q,{container:!0,item:!0,xs:12,md:12,sm:12,spacing:2,className:c.arrayRowContainer,children:o})},r)});let A=e(f,{children:t(at,{className:c.arrayRowCard,children:[e(lt,{title:r}),e(st,{className:c.arrayRowCardContent,children:e(q,{container:!0,spacing:1,xs:12,md:12,sm:12,children:d})})]})});return Boolean(s)?u(q,{container:!0,...a,key:i},A):e(f,{children:A},i)}});const _A=xi({root:{"& .MuiFormLabel-root":{fontWeight:600,textTransform:"capitalize",fontSize:"1rem","@media (max-width: 1200px)":{fontSize:"0.75rem"},"@media (max-width: 1440px)":{fontSize:"0.875rem"}},"& label.Mui-focused":{color:"var(--theme-color1)"},"& .MuiRadio-root.Mui-checked":{color:"var(--theme-color1) !important"}}})($e),jA=({name:t,validate:i,validationRun:r,shouldExclude:n,isReadOnly:a,postValidationSetCrossFieldValues:s,runPostValidationHookAlways:o,dependentFields:h,fieldKey:c,label:A,options:p,FormControlProps:f,FormLabelProps:m,RadioGroupProps:g,FormHelperTextProps:w,FormControlLabelProps:b,GridProps:v,enableGrid:y,runValidationOnDependentFieldsChange:C,skipValueUpdateFromCrossFieldWhenReadOnly:x,CircularProgressProps:F,_optionsKey:S,disableCaching:N,runExternalFunction:E,onFormDataChange:k,...T})=>{const{formState:L,value:I,error:D,touched:U,handleChange:P,handleBlur:R,isSubmitting:O,fieldKey:Q,name:H,excluded:M,readOnly:_,dependentValues:j,incomingMessage:z,runValidation:V,whenToRunValidation:K,setIncomingMessage:W}=as({name:t,fieldKey:c,dependentFields:h,validate:i,validationRun:r,runPostValidationHookAlways:o,postValidationSetCrossFieldValues:s,isReadOnly:a,shouldExclude:n,runValidationOnDependentFieldsChange:C,skipValueUpdateFromCrossFieldWhenReadOnly:x,runExternalFunction:E,onFormDataChange:k}),[J,X]=d([]),Y=l(e=>Fo(J)(e),[J]),$=l(e=>{let t=Y("object"==typeof e?e?.target?.value??"":e);P(e,t[0])},[P,Y]),{loadingOptions:Z}=Bo(L,p,X,$,j,z,V,K,S,N,W,!0,"",!1);if(M)return null;const ee=U&&""!==(D??""),te=J.map(t=>u(Ye,{...b,control:e(or,{...T,disabled:_,readOnly:_,tabIndex:_?-1:void 0}),key:t.value,label:t.label,value:t.value})),ie=u(_A,{...f,key:Q,component:"fieldset",disabled:O,error:!O&&ee,onBlur:R},e(Je,{...m,component:"label",children:A}),e(sr,{...g,onChange:$,name:H,value:I,children:Z?e(B,{position:"end",children:e(G,{color:"primary",variant:"indeterminate",...F})}):te}),!O&&ee?e(Ze,{...w,children:D}):null);return Boolean(y)?u(q,{...v,key:Q},ie):ie};var zA=Object.freeze({__proto__:null,Radio:jA,default:jA});const VA=(e,t)=>Array.isArray(e)&&e.indexOf(t)>-1;var KA=Object.freeze({__proto__:null,Switch:({name:t,validate:i,validationRun:r,shouldExclude:n,isReadOnly:a,postValidationSetCrossFieldValues:s,runPostValidationHookAlways:o,dependentFields:l,fieldKey:h,label:c,FormControlProps:d,FormHelperTextProps:A,FormControlLabelProps:p,GridProps:f,enableGrid:m,runValidationOnDependentFieldsChange:g,skipValueUpdateFromCrossFieldWhenReadOnly:w,...b})=>{const{value:v,error:y,touched:B,handleChange:C,handleBlur:x,isSubmitting:F,fieldKey:S,name:N,excluded:E,readOnly:k}=as({name:t,fieldKey:h,dependentFields:l,validate:i,validationRun:r,runPostValidationHookAlways:o,postValidationSetCrossFieldValues:s,runValidationOnDependentFieldsChange:g,skipValueUpdateFromCrossFieldWhenReadOnly:w,isReadOnly:a,shouldExclude:n});if(E)return null;const T=B&&""!==(y??""),L=u($e,{...d,key:S,component:"fieldset",disabled:F,error:!F&&T,onBlur:x,tabIndex:k?-1:void 0},e(Ye,{...p,name:N,control:e(It,{...b,readOnly:k,tabIndex:k?-1:void 0}),onChange:C,label:c,checked:Boolean(v)}),!F&&T?e(Ze,{...A,children:y}):null);return Boolean(m)?e(q,{...f,children:L}):L},SwitchGroup:({name:t,validate:i,validationRun:r,shouldExclude:n,isReadOnly:a,postValidationSetCrossFieldValues:s,runValidationOnDependentFieldsChange:o,runPostValidationHookAlways:h,dependentFields:c,fieldKey:A,label:p,options:f,FormControlProps:m,FormLabelProps:g,FormGroupProps:w,FormHelperTextProps:b,FormControlLabelProps:v,GridProps:y,enableGrid:C,CircularProgressProps:x,_optionsKey:F,disableCaching:S,skipValueUpdateFromCrossFieldWhenReadOnly:N,...E})=>{const{formState:k,value:T,error:L,touched:I,handleChange:D,handleBlur:U,isSubmitting:P,fieldKey:R,name:O,excluded:Q,readOnly:H,dependentValues:M,incomingMessage:_,runValidation:j,whenToRunValidation:z,setIncomingMessage:V}=as({name:t,fieldKey:A,dependentFields:c,validate:i,validationRun:r,runPostValidationHookAlways:h,postValidationSetCrossFieldValues:s,isReadOnly:a,shouldExclude:n,runValidationOnDependentFieldsChange:o,skipValueUpdateFromCrossFieldWhenReadOnly:N}),[K,W]=d([]),J=l(e=>Fo(K)(e),[K]),X=l(e=>{let t=J("object"==typeof e?e?.target?.value??"":e);D(e,t[0])},[D,J]),{loadingOptions:Y}=Bo(k,f,W,X,M,_,j,z,F,S,V,!0,"",!1);if(Q)return null;const $=I&&""!==(L??""),Z=K.map(t=>u(Ye,{...v,control:e(It,{...E,readOnly:H,tabIndex:H?-1:void 0}),key:t.value,name:O,onChange:X,label:t.label,value:t.value,checked:VA(T,t.value)})),ee=u($e,{...m,key:R,component:"fieldset",disabled:P,error:!P&&$,onBlur:U},e(Je,{...g,component:"label",children:p}),e(Xe,{...w,children:Y?e(B,{position:"end",children:e(G,{color:"primary",variant:"indeterminate",...x})}):Z}),!P&&$?e(Ze,{...b,children:L}):null);return Boolean(C)?e(q,{...y,children:ee}):ee}});const qA=({name:i,fieldKey:r,shouldExclude:n,isReadOnly:a,postValidationSetCrossFieldValues:s,runPostValidationHookAlways:o,dependentFields:c,validate:A,validationRun:p,label:m,InputLabelProps:g,GridProps:w,enableGrid:b,runValidationOnDependentFieldsChange:v,skipValueUpdateFromCrossFieldWhenReadOnly:y,...B})=>{const{handleChange:C,handleBlur:x,isSubmitting:F,fieldKey:S,name:N,value:E,excluded:k}=as({name:i,fieldKey:r,dependentFields:c,validate:A,validationRun:p,runPostValidationHookAlways:o,postValidationSetCrossFieldValues:s,isReadOnly:a,shouldExclude:n,runValidationOnDependentFieldsChange:v,skipValueUpdateFromCrossFieldWhenReadOnly:y}),[T,L]=d(Number(E));h(()=>{L(Number(E))},[E]);const[I,D]=d(!1),U=l((e,t)=>{L(t)},[L]),P=l((e,t)=>{C(t)},[C]),R=l(()=>{x(),D(!1)},[x,D]),O=l(()=>{D(!0)},[D]);if(k)return null;const Q=t(f,{children:[e(Ut,{...g,focused:I,disabled:F,children:m}),u(Dt,{...B,key:S,id:S,name:N,value:T,disabled:F,onFocus:O,onChange:U,onChangeCommitted:P,onBlur:R})]},S);return Boolean(b)?e(q,{...w,children:Q}):Q};var GA=Object.freeze({__proto__:null,Slider:qA,default:qA});function WA(e,t,i,r=!1){const n={};return i&&ya(e,i,{ignoreTime:r})&&(n._maxDt=i),t&&Ca(e,t,{ignoreTime:r})&&(n._minDt=t),n}io(".MuiPickersDay-current.MuiPickersDay-day{color:var(--theme-color1)}.MuiPickersDay-daySelected.MuiPickersDay-day,.MuiPickersDay-daySelected.MuiPickersDay-day:hover{background-color:var(--theme-color1);color:var(--white)}.MuiPickersYear-root.MuiPickersYear-yearSelected{color:var(--theme-color1)}.MuiPickersLayout-contentWrapper .MuiButtonBase-root.Mui-selected{background-color:var(--theme-color1)!important;color:#fff}.MuiPickersLayout-contentWrapper .MuiButtonBase-root:hover{background-color:#8000000a}.MuiPickersSlideTransition-root{min-height:220px}");io(".MuiPickersClock-pin,.MuiPickersClockPointer-pointer,.MuiPickersToolbar-toolbar{background-color:var(--theme-color1)!important}.MuiPickersClockPointer-thumb{background-color:var(--white)!important;border:14px solid var(--theme-color1)!important}.MuiPickersClockPointer-noPoint{background-color:var(--theme-color1)!important;border:14px solid var(--theme-color1)!important}.MuiPickersClockNumber-clockNumberSelected,.MuiPickersToolbarText-toolbarBtnSelected{color:var(--white)!important}.MuiPickersToolbarText-toolbarTxt:not(.MuiPickersToolbarText-toolbarBtnSelected){color:var(--white-dim)!important}.MuiPickersLayout-root>.MuiDialogActions-root>button.MuiButton-textPrimary{color:var(--theme-color1)}");var JA=Object.freeze({__proto__:null,DatePicker:({name:t,validate:r,validationRun:n,shouldExclude:a,isReadOnly:c,postValidationSetCrossFieldValues:A,setValueOnDependentFieldsChange:p,setValueOnDependentFieldsValueChange:f,runPostValidationHookAlways:m,dependentFields:g,fieldKey:w,type:b,GridProps:v,enableGrid:y,isFieldFocused:B,InputProps:C,inputProps:x,runValidationOnDependentFieldsChange:F,skipValueUpdateFromCrossFieldWhenReadOnly:S,required:N,disablePast:E,disableFuture:k,ignoreInSubmit:T=!1,label:L,setFieldLabel:I,placeholder:D,format:P,CircularProgressProps:R,componentType:O,runPostValidationForInitValue:Q,className:H,dependentFieldDebounceDelay:M=300,setColor:_,runExternalFunction:j,onFormDataChange:z,...V})=>{const[K,G]=d(null),{commonDateFormat:X}=ns(),{authState:Y}=es(),{value:$,prevValue:Z,error:ee,touched:te,handleChange:ie,handleBlur:re,isSubmitting:ne,fieldKey:ae,name:oe,excluded:ce,readOnly:de,setIgnoreInSubmit:ue,incomingMessage:Ae,setIncomingMessage:pe,whenToRunValidation:fe,runValidation:me,dependentValues:ge,validationRunning:we,setErrorAsCB:be,formState:ve}=as({name:t,fieldKey:w,dependentFields:g,validate:r,componentType:O,validationRun:n,runPostValidationHookAlways:m,postValidationSetCrossFieldValues:A,isReadOnly:c,shouldExclude:a,runValidationOnDependentFieldsChange:F,skipValueUpdateFromCrossFieldWhenReadOnly:S,runPostValidationForInitValue:Q,dependentFieldDebounceDelay:M,runExternalFunction:j,onFormDataChange:z}),[ye,Be]=d("string"==typeof _?_:"");h(()=>{if("function"==typeof _){const e=_($,ds(ge),ve);Be("string"!=typeof e?"":e)}},[$,ge,_]),h(()=>{if(Boolean(T))if("function"==typeof T){let e=T(ds(ge),ve,{isSubmitting:ne,value:$});ue(e)}else ue(T)},[T,ue,ge,$]),h(()=>{if("string"==typeof $){let e=Fs($);if(!isNaN(e)){const t=WA(e,V?.minDate,V?.maxDate,!0);ie(e,void 0,!1,t)}}},[$,ie]);const{t:Ce}=W(),xe=o();h(()=>{B&&setTimeout(()=>{xe?.current?.focus?.()},1)},[B]),h(()=>{if(null!==Ae&&"object"==typeof Ae&&Object.keys(Ae).length){const{isFieldFocused:e,value:t,ignoreUpdate:i}=Ae;if(e&&setTimeout(()=>{xe?.current?.focus?.()},50),Boolean(t)||""===t){const e=WA(t,V?.minDate,V?.maxDate,!0);ie(t,void 0,!0,{...e,isIncomingValue:!0}),i||"onBlur"!==fe||me({value:t,isIncomingValue:!0},!0)}pe(null)}},[Ae,ie,me,fe]);const Fe=s(()=>{const e=ds(ge),t=us(e);return JSON.stringify(t.sort((e,t)=>e.fieldKey.localeCompare(t.fieldKey)).map(e=>e.value))},[ge]);h(()=>{if(Fe&&"function"==typeof f){let e=f(ds(ge),ve,{value:$,isSubmitting:ne});if(null!=e){const t=WA(e,V?.minDate,V?.maxDate,!0);ie(e,void 0,!1,t)}}},[Fe,f,ie]),h(()=>{if("function"==typeof p){let e=p(ds(ge),ve,{value:$,isSubmitting:ne});if(null!=e){const t=WA(e,V?.minDate,V?.maxDate,!0);ie(e,void 0,!1,t)}}},[ge,ie,p]);const Se=s(()=>{if("function"==typeof I)return I(ds(ge),$)},[I,ge,$]),Ne=te&&""!==(ee??""),Ee=l(t=>e(i,{children:void 0===Z||void 0===$||U(Fs(Z).toUTCString(),Fs($).toUTCString())?e(Ao,{...t}):e(Jo,{title:e(Xo,{label:`${Ce("OldValueOf")} ${Se?.label?Ce(Se.label):L}`,value:(()=>{if(!Z)return"(blank)";try{const e=Fs(Z);return ze(e,(P??X)||"dd/MM/yyyy")}catch{return console.error("Invalid time provided while comparing old value!!!"),""}})()}),arrow:!0,followCursor:!0,children:e(Ao,{...t})})}),[Z]);if(ce)return null;const ke=u(Ho,{...V,key:ae,label:Se?.label?Ce(Se.label):L,format:(P??X)||"dd/MM/yyyy",value:""===$||null===$?null:Fs($),tabIndex:de?-1:void 0,onChange:e=>{const t=WA(e,V?.minDate,V?.maxDate,!0);ie(e,void 0,!1,t)},onSelectedSectionsChange:e=>{G(e)},selectedSections:K,onClose:()=>{setTimeout(()=>re(),0)},disabled:ne||de,readOnly:de,disablePast:E,disableFuture:k,className:J(H,{hasOldValue:void 0!==Z&&void 0!==$&&!U(Fs(Z).toUTCString(),Fs($).toUTCString())}),slots:{textField:Ee},slotProps:{textField:{onBlur:e=>{const t=WA($,V?.minDate,V?.maxDate,!0);re(e,t)},onKeyDown:e=>{const t=P??X;if("ArrowUp"===e.key||"ArrowDown"===e.key){const i=e.target.value;if(!Ve($)&&i?.toLowerCase()===t?.toLowerCase()){const e=Y?.workingDate||new Date;setTimeout(()=>{const t=WA(new Date(e),V?.minDate,V?.maxDate,!0);ie(new Date(e),void 0,!1,t)},0)}}else if("Home"===e.key)G(0);else if("End"===e.key){const e=t.includes("/")?"/":t.includes("-")?"-":null,i=e?t.split(e).length:1;G(i-1)}},id:ae,name:oe,placeholder:de?"":Se?.placeholder?Ce(Se.placeholder):D,autoComplete:"off",required:N,error:!ne&&Ne,helperText:e(le,{children:!ne&&Ne?ee:null}),inputProps:{tabIndex:de?-1:void 0,...x},InputProps:{style:{background:Boolean(de||ne)?"#f3f3f3":"",...!ne&&Boolean(ye)?{color:ye}:{}},readOnly:de,startAdornment:we?e(se,{position:"end",sx:{position:"absolute",right:"38px"},children:e(he,{color:"secondary",variant:"indeterminate",size:20,...R})}):null,...C},InputLabelProps:{shrink:!0},inputRef:xe},actionBar:{actions:["today","accept","cancel"]}},sx:{width:"100%"},cancelLabel:e(ct,{color:"secondary",style:{border:"1px solid rgba(128, 0, 0, 0.23)"},disableElevation:!0,children:Ce("Cancel")}),okLabel:e(ct,{color:"secondary",variant:"contained",disableElevation:!0,children:Ce("Ok")})});return Boolean(y)?u(q,{...v,key:ae},ke):ke},DateTimePicker:({name:t,validate:r,validationRun:n,shouldExclude:a,isReadOnly:c,postValidationSetCrossFieldValues:A,setValueOnDependentFieldsChange:p,setValueOnDependentFieldsValueChange:f,runPostValidationHookAlways:m,dependentFields:g,fieldKey:w,type:b,GridProps:v,CircularProgressProps:y,enableGrid:B,isFieldFocused:C,InputProps:x,inputProps:F,runValidationOnDependentFieldsChange:S,skipValueUpdateFromCrossFieldWhenReadOnly:N,disablePast:E,disableFuture:k,ignoreInSubmit:T=!1,label:L,setFieldLabel:I,format:D,required:P,placeholder:R,runPostValidationForInitValue:O,componentType:Q,className:H,dependentFieldDebounceDelay:M=300,setColor:_,runExternalFunction:j,onFormDataChange:z,...V})=>{const{commonDateTimeFormat:K}=ns(),{value:G,prevValue:W,error:X,touched:Y,handleChange:$,handleBlur:Z,isSubmitting:ee,fieldKey:te,name:ie,excluded:re,readOnly:ne,setIgnoreInSubmit:ae,incomingMessage:oe,setIncomingMessage:ce,whenToRunValidation:de,dependentValues:ue,runValidation:Ae,validationRunning:pe,formState:fe}=as({name:t,fieldKey:w,dependentFields:g,validate:r,validationRun:n,runPostValidationHookAlways:m,postValidationSetCrossFieldValues:A,isReadOnly:c,shouldExclude:a,runValidationOnDependentFieldsChange:S,skipValueUpdateFromCrossFieldWhenReadOnly:N,runPostValidationForInitValue:O,componentType:Q,dependentFieldDebounceDelay:M,runExternalFunction:j,onFormDataChange:z}),[me,ge]=d("string"==typeof _?_:"");h(()=>{if("function"==typeof _){const e=_(G,ds(ue),fe);ge("string"!=typeof e?"":e)}},[G,ue,_]),h(()=>{if(Boolean(T))if("function"==typeof T){let e=T(ds(ue),fe,{isSubmitting:ee,value:G});ae(e)}else ae(T)},[T,ae,ue,G]),h(()=>{if("string"==typeof G){let e=Fs(G);if(!isNaN(e)){const t=WA(e,V?.minDate,V?.maxDate);$(e,void 0,!1,t)}}},[G,$]);const we=o();h(()=>{C&&setTimeout(()=>{we?.current?.focus?.()},1)},[C]),h(()=>{if(null!==oe&&"object"==typeof oe&&Object.keys(oe).length){const{value:e,ignoreUpdate:t}=oe;if(Boolean(e)||""===e){const i=WA(e,V?.minDate,V?.maxDate);$(e,void 0,!0,{...i,isIncomingValue:!0}),t||"onBlur"!==de||Ae({value:e,isIncomingValue:!0},!0)}ce(null)}},[oe,$,Ae,de]);const be=s(()=>{const e=ds(ue),t=us(e);return JSON.stringify(t.sort((e,t)=>e.fieldKey.localeCompare(t.fieldKey)).map(e=>e.value))},[ue]);h(()=>{if(be&&"function"==typeof f){let e=f(ds(ue),fe,{value:G,isSubmitting:ee});if(null!=e){const t=WA(e,V?.minDate,V?.maxDate);$(e,void 0,!1,t)}}},[be,f,$]),h(()=>{if("function"==typeof p){let e=p(ds(ue),fe,{value:G,isSubmitting:ee});if(null!=e){const t=WA(e,V?.minDate,V?.maxDate);$(e,void 0,!1,t)}}},[ue,$,p]);const ve=s(()=>{if("function"==typeof I)return I(ds(ue),G)},[I,ue,G]),ye=l(t=>e(i,{children:void 0===W||void 0===G||U(Fs(W).toUTCString(),Fs(G).toUTCString())?e(Ao,{...t}):e(Jo,{title:e(Xo,{label:`${Ge("OldValueOf")} ${ve?.label?Ge(ve.label):L}`,value:(()=>{if(!W)return"(blank)";try{const e=Fs(W);return ze(e,(D??K)||"dd/MM/yyyy HH:mm:ss aa")}catch{return console.error("Invalid time provided while comparing old value!!!"),""}})()}),arrow:!0,followCursor:!0,children:e(Ao,{...t})})}),[W]),Be=Y&&""!==(X??"");if(re)return null;const Ce=u(_o,{...V,key:te,label:ve?.label?Ge(ve.label):L,format:(D??K)||"dd/MM/yyyy HH:mm:ss aa",value:""===G||null===G?null:Fs(G),views:["year","month","day","hours","minutes","seconds"],disablePast:E,disableFuture:k,onChange:e=>{const t=WA(e,V?.minDate,V?.maxDate);$(e,void 0,!1,t)},onClose:()=>{setTimeout(()=>Z(),0)},disabled:ee||ne,readOnly:ne,className:J(H,{hasOldValue:void 0!==W&&void 0!==G&&!U(Fs(W).toUTCString(),Fs(G).toUTCString())}),slots:{textField:ye},slotProps:{textField:{name:ie,id:te,onBlur:e=>{const t=WA(G,V?.minDate,V?.maxDate);Z(e,t)},placeholder:ne?"":ve?.placeholder?Ge(ve.placeholder):R,required:P,error:!ee&&Be,helperText:e(le,{children:!ee&&Be?X:null}),inputProps:{tabIndex:ne?-1:void 0,...F},InputProps:{style:{background:Boolean(ne||ee)?"#f3f3f3":"",...!ee&&Boolean(me)?{color:me}:{}},readOnly:ne,startAdornment:pe?e(se,{position:"end",sx:{position:"absolute",right:"38px"},children:e(he,{color:"secondary",variant:"indeterminate",size:20,...y})}):null,...x},InputLabelProps:{shrink:!0}},actionBar:{actions:["today","accept","cancel"]}},sx:{width:"100%"}});return Boolean(B)?u(q,{...v,key:te},Ce):Ce},TimePicker:({name:t,validate:r,validationRun:n,shouldExclude:a,isReadOnly:c,postValidationSetCrossFieldValues:A,runPostValidationHookAlways:p,dependentFields:f,fieldKey:m,type:g,GridProps:w,CircularProgressProps:b,enableGrid:v,isFieldFocused:y,InputProps:B,inputProps:C,runValidationOnDependentFieldsChange:x,skipValueUpdateFromCrossFieldWhenReadOnly:F,required:S,format:N,runPostValidationForInitValue:E,componentType:k,className:T,label:L,placeholder:I,setFieldLabel:D,setColor:P,...R})=>{const{commonTimeFormat:O}=ns(),{value:Q,prevValue:H,error:M,touched:_,handleChange:j,handleBlur:z,isSubmitting:V,fieldKey:K,name:G,excluded:W,readOnly:X,validationRunning:Y,dependentValues:$,formState:Z}=as({name:t,fieldKey:m,dependentFields:f,validate:r,validationRun:"onChange",runPostValidationHookAlways:p,postValidationSetCrossFieldValues:A,isReadOnly:c,shouldExclude:a,runValidationOnDependentFieldsChange:x,skipValueUpdateFromCrossFieldWhenReadOnly:F,runPostValidationForInitValue:E,componentType:k}),[ee,te]=d("string"==typeof P?P:"");h(()=>{if("function"==typeof P){const e=P(Q,ds($),Z);te("string"!=typeof e?"":e)}},[Q,$,P]),h(()=>{if("string"==typeof Q){let e=new Date(Q);isNaN(e)||j(e)}},[Q,j]);const ie=o();h(()=>{y&&setTimeout(()=>{ie?.current?.focus?.()},1)},[y]);const re=_&&""!==(M??""),ne=s(()=>{if("function"==typeof D)return D(ds($),Q)},[D,$,Q]),ae=l(t=>e(i,{children:void 0===H||void 0===Q||U(Fs(H).toUTCString(),Fs(Q).toUTCString())?e(Ao,{...t}):e(Jo,{title:e(Xo,{label:`${Ge("OldValueOf")} ${ne?.label?Ge(ne.label):L}`,value:(()=>{if(!H)return"(blank)";try{const e=Fs(H);return ze(e,(N??O)||"HH:mm:ss aa")}catch{return console.error("Invalid time provided while comparing old value!!!"),""}})()}),arrow:!0,followCursor:!0,children:e(Ao,{...t})})}),[H]);if(W)return null;const oe=u(Mo,{...R,key:K,id:K,name:G,label:ne?.label?Ge(ne.label):L,format:(N??O)||"HH:mm:ss aa",value:""===Q?null:new Date(Q),onChange:j,onClose:()=>{setTimeout(()=>z(),0)},disabled:V||X,readOnly:X,className:J(T,{hasOldValue:void 0!==H&&void 0!==Q&&!U(Fs(H).toUTCString(),Fs(Q).toUTCString())}),slots:{textField:ae},slotProps:{textField:{onBlur:z,placeholder:X?"":ne?.placeholder?Ge(ne.placeholder):I,error:!V&&re,helperText:e(le,{children:!V&&re?M:null}),inputProps:{tabIndex:X?-1:void 0,...C},InputLabelProps:{shrink:!0},InputProps:{style:{background:Boolean(X||V)?"#f3f3f3":"",...!V&&Boolean(ee)?{color:ee}:{}},readOnly:X,tabIndex:X?-1:void 0,startAdornment:Y?e(se,{position:"end",sx:{position:"absolute",right:"38px"},children:e(he,{color:"secondary",variant:"indeterminate",size:20,...b})}):null,...B},required:S}}});return Boolean(v)?u(q,{...w,key:K},oe):oe}});const XA=({name:i,validate:r,validationRun:n,shouldExclude:a,postValidationSetCrossFieldValues:s,isReadOnly:o,runPostValidationHookAlways:h,dependentFields:c,fieldKey:A,label:p,InputLabelProps:m,GridProps:g,enableGrid:w,runValidationOnDependentFieldsChange:b,skipValueUpdateFromCrossFieldWhenReadOnly:v,...y})=>{const{value:B,handleChange:C,handleBlur:x,isSubmitting:F,fieldKey:S,name:N,excluded:E,readOnly:k}=as({name:i,fieldKey:A,dependentFields:c,validate:r,validationRun:n,runPostValidationHookAlways:h,postValidationSetCrossFieldValues:s,isReadOnly:o,shouldExclude:a,runValidationOnDependentFieldsChange:b,skipValueUpdateFromCrossFieldWhenReadOnly:v}),[T,L]=d(!1),I=l(()=>{x(),L(!1)},[x,L]),D=l(()=>{L(!0)},[L]),U=l((e,t)=>{C(t)},[C]);if(E)return null;const P=t(f,{children:[e(Ut,{...m,focused:T,disabled:F,children:p}),u(Pt,{...y,key:S,id:S,name:N,value:""===B?0:B,onFocus:D,onChange:U,onBlur:I,disabled:F,readOnly:k,tabIndex:k?-1:void 0})]},S);return Boolean(w)?u(q,{...g,key:S},P):P};var YA=Object.freeze({__proto__:null,Rating:XA,default:XA});const $A=xi(e=>({grouped:{marginRight:e.spacing(2),marginTop:e.spacing(1),borderColor:"#8C8C8C",transition:"border 0.3s ease-in",borderRadius:"8px",textTransform:"capitalize",color:"#727272",padding:"4px 10px",fontWeight:700,"&:not(:first-child)":{borderRadius:"8px",borderLeft:"1px solid #8C8C8C"},"&:first-child":{borderRadius:"8px"},"&.Mui-selected":{border:"1px solid #57D3C3",background:"linear-gradient(0deg, rgba(94,231,131,1) 0%, rgba(74,205,159,1) 10%, rgba(33,150,218,1) 100%)",color:"white"},"& label":{color:"#736f6f",fontWeight:"600",textTransform:"capitalize",fontSize:"1rem",marginBottom:"0.5 rem"},"& .MuiSvgIcon-root":{maxHeight:"20px"}}}))(lr),ZA=({name:i,validate:r,validationRun:n,shouldExclude:a,isReadOnly:s,postValidationSetCrossFieldValues:o,runValidationOnDependentFieldsChange:l,runPostValidationHookAlways:h,dependentFields:c,fieldKey:d,options:A,ToggleButtonProps:p,GridProps:f,enableGrid:m,label:g,isFieldFocused:w,skipValueUpdateFromCrossFieldWhenReadOnly:b,...v})=>{const{value:y,handleChange:B,handleBlur:C,isSubmitting:x,fieldKey:F,excluded:S}=as({name:i,fieldKey:d,dependentFields:c,validate:r,validationRun:n,runPostValidationHookAlways:h,postValidationSetCrossFieldValues:o,runValidationOnDependentFieldsChange:l,isReadOnly:s,shouldExclude:a,skipValueUpdateFromCrossFieldWhenReadOnly:b});if(S)return null;const N=A.map(t=>u(Rt,{...p,key:t.value,value:t.value,disabled:x},"business"===t.iconName?e(Qt,{}):"person"===t.iconName?e(Ot,{}):null,e("span",{children:t.label}))),E=t($e,{disabled:x,children:[e(Je,{children:g}),e($A,{...v,value:y,onChange:(e,t)=>{B(t)},onBlur:C,children:N})]});return Boolean(m)?u(q,{...f,key:F},E):E};var ep=Object.freeze({__proto__:null,ToggleButtonGroup:ZA,default:ZA});const tp=({name:t,HiddenProps:i,GridProps:r,shouldExclude:n,fieldKey:a,dependentFields:s,componentType:o})=>{const{name:l,excluded:h}=as({name:t,fieldKey:a,dependentFields:s,shouldExclude:n,componentType:o});return h?null:e(f,{children:e(ve,{...i,children:e(ge,{item:!0,...r})})},l)};var ip=Object.freeze({__proto__:null,Spacer:tp,default:tp});const rp=m(()=>Promise.resolve().then(function(){return Ju}).then(e=>({default:e.ListBoxComponent}))),np=e=>e?.label??"";var ap=Object.freeze({__proto__:null,AutoComplete:iA,AutocompleteRenderOnly:({label:i,showCheckbox:r,CircularProgressProps:n,TextFieldProps:a,ChipProps:s,CreateFilterOptionsConfig:l,placeholder:c,required:A,enableVirtualized:p,handleBlur:m,handleChange:g,freeSolo:b,multiple:v,options:y,error:B,touched:C,disableClearable:x,value:F,_optionsKey:S,disableCaching:N,optionsProps:E,...k})=>{const T=Boolean(C)&&Boolean(B),[L,I]=d([]),[D,U]=d((new Date).getTime()),P=o(!1),R=o(null),{loadingOptions:O}=Co(y,I,S,N,E,!0,"",!1);return h(()=>{let e=F;if(!P.current&&Boolean(e)&&L.length>0&&"00"!==L[0].value&&null!==L[0].value){Array.isArray(e)||(e=[F]);let t=[];for(let i=0;i<L.length&&e.length>0;i++){let r=e.findIndex(e=>e==L[i].value);if(r>-1){t.push(L[i]);const n=e.slice(0,r),a=e.slice(r+1);e=[...n,...a]}}P.current=!0,R.current=v?t:t[0],U((new Date).getTime())}},[O,L,F,v]),e(w,{fallback:"loading...",children:u(Ai,{...k,key:`${D}`,multiple:v,disableClearable:x,freeSolo:b,options:L,getOptionLabel:np,ListboxComponent:Boolean(p)?rp:void 0,onChange:(e,t)=>{Array.isArray(t)||(t=[t]),t=t.map(e=>{return"object"==typeof e?Boolean(b)?np(e):(t=e,t?.value??""):e;var t}),!Boolean(v)&&Array.isArray(t)?g(t[0]):g(t)},onBlur:m,filterOptions:Boolean(l)&&"object"==typeof l?pi(l):void 0,renderTags:(e,t)=>e.map((e,i)=>u(gi,"string"==typeof e?{variant:"outlined",...s,label:e,...t({index:i}),key:e}:{variant:"outlined",...s,label:e.label,...t({index:i}),key:`${e.label}-${i}`})),renderInput:r=>e(Ao,{...a,...r,label:i,placeholder:c,autoComplete:"disabled",type:"text",error:T,required:A,helperText:T?B:null,InputProps:{...r.InputProps,endAdornment:t(f,{children:[O?e(G,{color:"primary",variant:"indeterminate",...n}):null,r.InputProps.endAdornment]})},InputLabelProps:{shrink:!0},inputProps:{...r.inputProps,autoComplete:"new-user-street-address"}}),renderOption:(i,n,a)=>{i.key=i.id;let{selected:s,inputValue:o}=a,l=np(n);const h=wi(l,o),c=bi(l,h).map((t,i)=>e("span",{style:{fontWeight:t.highlight?700:400},children:t.text},i));return t("li",{style:{whiteSpace:"pre"},...i,children:[r?e(go,{checked:s}):null,c]})}})})},default:iA});function sp(t){const{inputRef:i,onChange:r,FormatProps:n,...a}=t;return e(Ht,{...a,getInputRef:i,onValueChange:e=>{r({target:{value:e.value,formattedValue:e.formattedValue}},e.formattedValue)},...n})}function op(t){const{inputRef:i,onChange:r,FormatProps:n,...a}=t;return e(Ht,{...a,getInputRef:i,onValueChange:e=>{r({target:{value:e.value,formattedValue:e.formattedValue}},e.formattedValue)},...n})}const lp=({name:i,fieldKey:r,validate:n,leftName:a,rightName:s,leftLabel:l,rightLabel:c,leftTransform:d=e=>e,rightTransform:u=e=>e,GridProps:A,enableGrid:p,dependentFields:f,validationRun:m,runValidationOnDependentFieldsChange:g})=>{const{touched:w,value:b,error:v,setValue:y,handleBlur:B,isSubmitting:C,dependentValues:x}=as({name:i,fieldKey:r,validate:n,validationRun:m,dependentFields:f,runValidationOnDependentFieldsChange:g}),F=b[a],S=b[s],N=o(F);N.current=F;const E=o(S);E.current=S,h(()=>{let e=ds(x),t=d(N.current,a,e),i=u(E.current,s,e);null===t&&null===i||y({[a]:t,[s]:i},{[a]:t,[s]:i},!0)},[x]);const k=w&&""!==(v??"");let T=t("div",{style:{display:"flex"},tabIndex:0,onBlur:B,children:[e(Ao,{id:"left",name:a,value:F,label:l,onChange:e=>{let t=e.target.value,i=u(t,s,ds(x));y({[a]:t,[s]:i},{[a]:t,[s]:i},!0)},disabled:C,error:!C&&k,helperText:!C&&k?v:"",InputLabelProps:{shrink:!0},InputProps:{inputComponent:sp,inputProps:{FormatProps:{thousandSeparator:!0,prefix:"৳",thousandsGroupStyle:"lakh",allowNegative:!0,allowLeadingZeros:!1,decimalScale:2,isAllowed:e=>!(e?.value?.length>10)&&0!==e.floatValue}}}},"left"),e(Ao,{id:"right",name:s,label:c,value:S,onChange:e=>{let t=e.target.value,i=d(t,a,ds(x));y({[a]:i,[s]:t},{[a]:i,[s]:t},!0)},InputLabelProps:{shrink:!0},InputProps:{inputComponent:op,inputProps:{FormatProps:{suffix:"%",decimalScale:2,fixedDecimalScale:!0,allowNegative:!0,allowEmptyFormatting:!0,isAllowed:e=>!(e.floatValue>=999.99)}}}},"right")]});return Boolean(p)?e(q,{...A,children:T}):T};var hp=Object.freeze({__proto__:null,Visaversa:lp,default:lp});const cp=new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR"}),dp=({rows:t,column:{id:i,footerRenderStyle:r}})=>{const n=s(()=>t.reduce((e,t)=>Number(t.values?.[i]??0)+e,0),[t,i]);let a=isNaN(n)?"":n;return"currency"===r&&(a=cp.format(n)),e("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a})},up=({value:t})=>e(vt,{component:"span",variant:"subtitle2",style:{whiteSpace:"nowrap"},children:t}),Ap=n({}),pp=c(({currentRowError:t,currentRowObj:i,children:r,initialData:n,rowValidator:a,setFormError:o,prevRows:c,nextRows:u},A)=>{const f=s(()=>{let e={};for(const t in n)e[t]=!1;return e},[]),[m,g]=d({}),[w,b]=d(!1),[v,y]=d(n),[B,C]=d(f),x=l(()=>{let e={};for(const t in f)e[t]=!0;C(e)},[f]);p(A,()=>({touchAll:x}));const F=l(e=>{y(t=>{let r={...t,...e};return i.current=r,r})},[]),S=l(e=>{C(t=>({...t,...e}))},[]);return h(()=>{(async(e,i,r)=>{try{await a(e,i,r),g({}),b(!1),t.current={}}catch(e){g(e),b(!0),t.current=e}})(v,c,u)},[v]),h(()=>{o(w?"has error":"")},[w]),h(()=>()=>{o("")},[]),e(Ap.Provider,{value:{error:m,currentRow:v,setCellValue:F,touched:B,setCellTouched:S},children:r})}),fp=t=>{const{column:{id:i,type:r,clearFields:n,maxLength:a=NaN},row:{id:s},currentEditRow:o}=t;return o===s?e(mp,{columnName:i,type:r??"text",clearFields:n,maxLength:a},i):e(up,{...t})},mp=({columnName:t,type:i,clearFields:r,maxLength:n})=>{const{error:s,setCellValue:o,currentRow:l,touched:h,setCellTouched:c}=a(Ap);return e(_t,{type:i,value:l?.[t],size:"small",variant:"outlined",onChange:e=>{(n!=n||e.target.value.length<=n)&&o({[t]:e.target.value,...r})},helperText:h?.[t]&&s?.[t],error:Boolean(h?.[t])&&Boolean(s?.[t]),onBlur:()=>c({[t]:!0}),fullWidth:!0})};let gp=new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR"});const wp=({value:t,displayStyle:i})=>{let r="-";if(!isNaN(t))switch(i){case"currency":r=gp.format(t);break;case"percentage":r=`${t}%`;break;case"squareFeet":r=(new Intl.NumberFormat).format(t);break;default:r=t}return e(vt,{component:"span",variant:"subtitle2",style:{whiteSpace:"nowrap"},children:r})},bp=t=>{const{column:{id:i,FormatProps:r,formattedValue:n,displayStyle:a,clearFields:s,enableNumWords:o},row:{id:l},currentEditRow:h}=t;return h===l?e(vp,{columnName:i,FormatProps:r,formattedValue:n,clearFields:s,enableNumWords:o},i):e(wp,{...t,displayStyle:a})},vp=({columnName:t,FormatProps:i,formattedValue:r,clearFields:n,enableNumWords:s})=>{const{error:o,setCellValue:l,currentRow:h,touched:c,setCellTouched:d}=a(Ap);let u=null;try{if(s&&Boolean(h?.[t])){let e=String(h?.[t]).split("."),i=Number(e[0]);i<0?(i=Math.abs(Number(i)),u=`Negative ${Io(i)} Rupees`):u=`${Io(i)} Rupees`,2===e.length&&Boolean(e[1])&&(u=`${u} and ${Io(e[1])} paise`)}}catch(e){}return e(po,{value:h?.[t],onChange:e=>l({[t]:e.target.value,...n}),helperText:Boolean(o?.[t])?o?.[t]:u,error:Boolean(c?.[t])&&Boolean(o?.[t]),onBlur:()=>d({[t]:!0}),InputLabelProps:{shrink:!0},size:"small",fullWidth:!0,margin:"none",InputProps:{inputComponent:il,inputProps:{FormatProps:{...i,formattedValue:r}}}})},yp=t=>{const{column:{id:i,options:r,_optionsKey:n,multiple:a,showCheckbox:s,clearFields:o},row:{id:l},currentEditRow:h}=t,[c,u]=d([]),{loadingOptions:A}=xo(r,u,n,!1,{},!1,void 0);return h===l?e(Bp,{columnName:i,options:c,loadingOptions:A,multiple:a,showCheckbox:s,clearFields:o},i):e(Cp,{...t,options:c})},Bp=({columnName:t,options:i,loadingOptions:r,multiple:n,showCheckbox:s,clearFields:o})=>{const{error:l,setCellValue:h,currentRow:c,setCellTouched:d,touched:u}=a(Ap);let A=c?.[t];return e(Ro,{value:A,error:l?.[t],touched:u?.[t],size:"small",variant:"outlined",handleChange:e=>{h({[t]:e.target.value,...o})},handleBlur:()=>d({[t]:!0}),options:i,loadingOptions:r,multiple:n,showCheckbox:s,fullWidth:!0})},Cp=({value:t,options:i})=>e(vt,{component:"span",variant:"subtitle2",style:{whiteSpace:"nowrap"},children:Fo(i,!0)(t)});let xp=new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR"});function Fp(t){const{inputRef:i,onChange:r,FormatProps:n,setChange:a,side:s,...o}=t;return e(Ht,{...o,getInputRef:i,onChange:e=>{a(s)},onValueChange:e=>{r({target:{value:e.value,formattedValue:e.formattedValue}},e.formattedValue)},...n})}const Sp=({value:t})=>e(vt,{component:"span",variant:"subtitle2",style:{whiteSpace:"nowrap"},children:xp.format(t)}),Np=t=>{const{column:{id:i,ViceVersaProps:r,clearFields:n},row:{id:a},currentEditRow:s}=t;return s===a?e(kp,{columnName:i,clearFields:n,...r}):e(Sp,{...t,displayStyle:r.leftAdornment})},Ep=(e,t)=>e,kp=({columnName:i,rightTransform:r=Ep,leftTransform:n=Ep,dependentField:s,leftFormatProps:o,rightFormatProps:l})=>{const{error:c,setCellValue:u,currentRow:A,touched:p,setCellTouched:f}=a(Ap),[m,g]=d(""),[w,b]=d("");h(()=>{let e=r(A?.[i],A?.[s]);g(e),f({[i]:!0})},[]);let v=A?.[i];h(()=>{""===v&&g("")},[v]);return t("div",{style:{display:"flex"},children:[e(_t,{value:A?.[i],onChange:e=>{let t=e?.target?.value??e;u({[i]:t})},onBlur:()=>{if("left"!==w)return;let e=r(A?.[i],A?.[s]);g(e)},helperText:p?.[i]&&c?.[i],error:Boolean(p?.[i])&&Boolean(c?.[i]),size:"small",variant:"outlined",InputProps:{inputComponent:Fp,inputProps:{FormatProps:o,setChange:b,side:"left"}},fullWidth:!0},"left"),e("div",{style:{padding:"0px 4px"}}),e(_t,{value:m,onChange:e=>{g(e?.target?.value??e)},onBlur:()=>{if("right"!==w)return;let e=n(m,A?.[s]);u({[i]:e})},size:"small",variant:"outlined",InputProps:{inputComponent:Fp,inputProps:{FormatProps:l,setChange:b,side:"right"}},fullWidth:!0},"right")]})},Tp=({value:t})=>e(vt,{component:"span",variant:"subtitle2",style:{whiteSpace:"nowrap"},children:t}),Lp=t=>{const{column:{id:i,MaskProps:r,formattedValue:n=!0,clearFields:a},row:{id:s},currentEditRow:o}=t;return o===s?e(Ip,{columnName:i,MaskProps:r,formattedValue:n,clearFields:a},i):e(Tp,{...t})},Ip=({columnName:t,MaskProps:i,formattedValue:r,clearFields:n})=>{const{error:s,setCellValue:o,currentRow:l,touched:h,setCellTouched:c}=a(Ap);return e(po,{value:l?.[t],onChange:e=>o({[t]:e.target.value,...n}),helperText:h?.[t]?s?.[t]:"",error:Boolean(h?.[t])&&Boolean(s?.[t]),onBlur:()=>c({[t]:!0}),InputLabelProps:{shrink:!0},size:"small",fullWidth:!0,margin:"none",InputProps:{inputComponent:Nl,inputProps:{MaskProps:{...i,formattedValue:r}}}})},Dp={accessor:"action",alignment:"left",width:150,Cell:({requestRowEdit:i,currentEditRow:r,saveCurrentRow:n,cancelCurrentRowEdit:a,row:{id:s}})=>e("div",{style:{display:"flex",alignItems:"start"},children:r===s?t(f,{children:[e(ct,{onClick:()=>n(s),size:"small",variant:"outlined",disableRipple:!0,children:"Done"}),e(ct,{onClick:()=>a(s),size:"small",variant:"outlined",disableRipple:!0,children:"Cancel"})]}):e(ct,{onClick:()=>i(s),size:"small",variant:"outlined",disableRipple:!0,children:"Edit"})}),columnName:"Action"},Up=e=>(e=(e=>{if(Array.isArray(e)){let t=e;return t=t.map(e=>{if("string"==typeof e.options){let t=e.options,i=fa.getFn(t,async()=>[{label:"Cannot fetch options",value:""}]);return{...e,_optionsKey:t,options:i}}return e}),t}return e})(e),e=(e=>{if(Array.isArray(e)){let t=e;return t=t.map(e=>{if("string"!=typeof e.Cell)return e;switch(e.Cell){case"textField":return{...e,Cell:fp};case"numberField":return{...e,Cell:bp};case"selectField":return{...e,Cell:yp};case"visaversa":return{...e,Cell:Np};case"monthYear":return{...e,Cell:Lp};default:return{...e,Cell:up}}}),t}return e})(e=(e=>{if(Array.isArray(e)){let t=e;return t=t.map(e=>{if(Boolean(e.footer)){const{footer:t,...i}=e;return{...i,Footer:dp}}return e}),t}return e})(e=(e=>{if(Array.isArray(e))return[...e,Dp];return e})(e)))),Pp=({column:{columnName:r,getResizerProps:n}})=>t(i,{children:[e("span",{style:{whiteSpace:"nowrap"},children:r}),e("div",{...n([{style:{display:"inline-block",position:"absolute",right:"-5px",top:"0",padding:"0 5px",zIndex:1}}]),children:e("div",{style:{height:"35px",width:"6px",backgroundColor:"#888"}})})]}),Rp=({row:t})=>e(ui,{size:"small",...t.getToggleRowSelectedProps([{style:{padding:0}}])}),Op=({getToggleAllRowsSelectedProps:t})=>e(ui,{size:"small",...t([{style:{padding:0}}])}),Qp=async()=>{},Hp={},Mp=async()=>{throw{error_msg:"Fn not defined"}},_p=({columns:i,defaultColumn:r,data:n,setData:a,rowIDColumn:s,label:h,setFormError:c,disabled:u,maxHeight:A="200px",newRowObj:p=Hp,dataIdColumn:m="id",rowValidator:g=Qp,deleteRowFn:w=Mp,disableFooter:b=!1})=>{const v=o(null),y=o(-1),B=o({}),C=o({}),[x,F]=d(-1),[S,N]=d(!1),[E,k]=d(!1),T=o(null),L=l(e=>e[s],[]),{t:I}=W(),D=l(()=>{k(!1)},[k]),U=l(()=>{S||(a(e=>[...e,{...p,[s]:++y.current}]),N(!0),F(y.current),B.current={},setTimeout(()=>{let e=T.current;e?.scrollTo({behavior:"smooth",top:e.scrollHeight-e.offsetHeight,left:0})},1))},[a,N,F,S,n]),P=l(e=>{if(Object.keys(C.current).length>0)return v?.current?.touchAll?.(),!1;let t=n.map(t=>L(t)===e?{...t,...B.current}:t);return a(t),F(-1),N(!1),B.current={},!0},[a,N,F,n,L]),R=l(e=>{S&&a(t=>t.filter(t=>!(L(t)===e))),F(-1),N(!1),B.current={},C.current={}},[a,F,N,S]),O=l(e=>{S||Object.keys(C.current).length>0||(-1===x||R(x),F(e),B.current={})},[P,F,x,S]),Q=Gt({columns:i,data:n,defaultColumn:r,requestRowEdit:O,currentEditRow:x,getRowId:L,saveCurrentRow:P,cancelCurrentRowEdit:R},ei,ti,ii,(H=!0,t=>{Boolean(H)&&t.visibleColumns.push(t=>[{id:"selectionCheckbox",Header:Op,Cell:Rp,minWidth:25,width:25,maxWidth:25,sticky:!0,Footer:()=>e("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",paddingRight:"10px"},children:"Total"})},...t])}));var H;const{getTableProps:M,getTableBodyProps:_,headerGroups:j,footerGroups:z,rows:V,prepareRow:K,selectedFlatRows:q}=Q;return t(f,{children:[t(ni,{style:{width:"90%",overflow:"hidden"},tabIndex:0,children:[t(ai,{variant:"dense",style:{display:"flex",minHeight:"40px",paddingLeft:"16px",paddingRight:"16px"},children:[e(vt,{variant:"h6",children:h}),e("div",{style:{flexGrow:1}}),q.length>0?e(ct,{variant:"outlined",size:"small",onClick:()=>{k(!0)},children:I("Delete")}):null]}),e(si,{style:u?{opacity:.5}:{},children:t(oi,{...M(),size:"small",component:"div",children:[e(li,{component:"div",children:j.map(t=>e(hi,{...t.getHeaderGroupProps(),component:"div",children:t.headers.map(t=>e(ci,{...t.getHeaderProps([{style:{overflow:"hidden",textOverflow:"ellipsis",textAlign:t?.alignment??"unset",pointerEvents:u?"none":"unset"}}]),component:"div",children:t.render("Header")}))}))}),e(di,{..._({}),component:"div",children:e("div",{style:{overflowY:"scroll",maxHeight:A,overflowX:"hidden"},ref:T,children:V.map((t,i)=>{K(t);const r=t.getRowProps([{style:{pointerEvents:u?"none":"unset"}}]),n=e(hi,{...r,component:"div",children:t.cells.map(t=>e(ci,{...t.getCellProps([{style:{textOverflow:"ellipsis",overflow:"hidden",textAlign:t?.column?.alignment??"unset"}}]),component:"div",children:t.render("Cell")}))});if(x===t.id){let a=V.slice(0,i).map(e=>e?.original),s=V.slice(i+1).map(e=>e?.original);return e(pp,{currentRowError:C,currentRowObj:B,initialData:t.original,rowValidator:g,prevRows:a,nextRows:s,setFormError:c,ref:v,children:n},`${r.key}_row_with_context`)}return n})})}),b?null:e(li,{component:"div",children:z.map(t=>e(hi,{...t.getFooterGroupProps(),component:"div",children:t.headers.map(t=>e(ci,{...t.getFooterProps([{style:{textAlign:t?.alignment??"unset"}}]),component:"div",children:t.render("Footer")}))}))})]})}),e(ct,{onClick:U,disabled:u,children:I("AddRow")})]}),e(jp,{selectedRows:q,dataIdColumn:m,open:E,closeDialog:D,deleteFn:w,setData:a})]})},jp=({selectedRows:i,dataIdColumn:r,deleteFn:n,open:a,closeDialog:s,setData:o})=>{const{t:l}=W(),h=()=>{c.reset(),s()},c=Vt((d=n,async({data:e})=>d(e)),{onSuccess:()=>{h()}});var d;return t(dt,{open:a,children:[c.isError?e(to,{severity:"error",errorMsg:c.error?.error_msg??"Unknown error occured",errorDetail:c.error?.error_detail??""}):null,e(ut,{children:l("Wouldyouliketodeletetheselectedrecord")}),t(At,{children:[e(ct,{onClick:()=>{let e=i.map(e=>e?.original?.[r]??Number.MAX_SAFE_INTEGER).filter(e=>e!==Number.MAX_SAFE_INTEGER);c.mutate({data:e}),o(t=>t.filter(t=>!(e.indexOf(t[r])>=0)))},disabled:c.isLoading,children:l("Yes")}),e(ct,{onClick:h,disabled:c.isLoading,children:l("No")})]})]})},zp=e=>e,Vp="__id",Kp=({_columns:t,arrayFieldIDName:i,dataTransformer:r=zp,rowValidator:n,removeRowFn:a,name:c,fieldKey:u,GridProps:A,enableGrid:p,label:f,maxHeight:m,shouldExclude:g,dependentFields:w,disableFooter:b})=>{const v=s(()=>{let e=Mt(t);return Up(e)},[]),y=s(()=>({Header:Pp,Cell:up}),[]),B=s(()=>{let e=(e=>{if(Array.isArray(e))return e.reduce((e,t)=>(e[t.accessor]=t?.defaultValue??"",e),{});return{}})(t);return e={[i]:"",...e},e},[]),C=o(-1e3),[x,F]=d(!1),{value:S,setValueAsCB:N,setErrorAsCB:E,isSubmitting:k,fieldKey:T,excluded:L}=as({name:c,fieldKey:u,shouldExclude:g,dependentFields:w}),I=l(e=>{N("function"==typeof e?t=>r(e(t)):r(e))},[N,r]);if(h(()=>{if(!x&&Array.isArray(S)&&S.length>0){let e=S.map(e=>void 0===e[Vp]?{...e,[Vp]:C.current++}:e);I(e),F(!0)}}),L)return null;const D=e(_p,{columns:v,defaultColumn:y,dataIdColumn:i,newRowObj:B,rowValidator:n,setData:I,data:Array.isArray(S)?S:[],rowIDColumn:Vp,deleteRowFn:a,label:f,maxHeight:m,setFormError:E,disabled:k,disableFooter:b},T);return Boolean(p)?e(q,{...A,children:D}):D};var qp=Object.freeze({__proto__:null,DataTable:Kp,default:Kp});const Gp=({name:t,fieldKey:i,TypographyProps:r,GridProps:n,label:a,dependentFields:o,shouldExclude:l,setValueOnDependentFieldsChange:c,setValueOnDependentFieldsValueChange:d,componentType:u,dependentFieldDebounceDelay:A=300})=>{const{value:p,handleChange:m,name:g,excluded:w,dependentValues:b,incomingMessage:v,setIncomingMessage:y,formState:B}=as({name:t,fieldKey:i,dependentFields:o,shouldExclude:l,componentType:u,dependentFieldDebounceDelay:A}),C=s(()=>{const e=ds(b),t=us(e);return JSON.stringify(t.sort((e,t)=>e.fieldKey.localeCompare(t.fieldKey)).map(e=>e.value))},[b]);return h(()=>{if(C&&"function"==typeof d){let e=d(ds(b),B);null!=e&&m(e)}},[C,d,m]),h(()=>{if("function"==typeof c){let e=c(ds(b),B);null!=e&&m(e)}},[b,m,c]),h(()=>{if(null!==v&&"object"==typeof v&&Object.keys(v).length){const{value:e}=v;(Boolean(e)||""===e)&&m(e),y(null)}},[v,m]),w?null:e(f,{children:e(ge,{...n,children:e(X,{variant:"h6",style:void 0,...r,children:p||a})})},g)},Wp=Ci(e=>({root:{paddingLeft:e.spacing(1.5),paddingRight:e.spacing(1.5),background:"var(--theme-color1)"},title:{flex:"1 1 100%",color:"var(--white)",letterSpacing:"1px",fontSize:"1.5rem"},refreshiconhover:{}}));let Jp=[];const Xp=c(({dense:i,title:r,allowColumnHiding:n,fields:a,initialDataValue:l,initialVisibleColumnData:c,submitButtonHide:u,submitButtonName:A,submitSecondButtonHide:m=!0,submitSecondButtonName:g="submit",submitSecondLoading:w=!1,submitSecondAction:b=(e,t)=>{},submitSecondValidtion:v=!0,hideHeader:y,isDisplayOnly:B,onAction:C,loading:x,onFieldAction:F=(e,t)=>{},propStyles:S,focusScopeId:N,enableEnterToFocus:E},k)=>{const T=Wp(),L=o(null),[I,D]=d({}),[U,P]=d(l),[R,O]=d(a),{t:Q}=W(),[H,M]=d(c),_=s(()=>{let e={};return a.forEach(t=>{Boolean(t.dependFields)&&Array.isArray(t.dependFields)&&t.dependFields.forEach(i=>{Boolean(e[i])?e[i].push(t.name):e[i]=[t.name]})}),e},[a]),j=s(()=>{let e={};return a.forEach(t=>{Boolean(t.dependFields)&&Array.isArray(t.dependFields)&&"function"==typeof t.dependFieldsonchange&&(e[t.name]=t.dependFieldsonchange)}),e},[a]),z=(e,t="",i=!1)=>{const r=e.target.name,n=i?e.target.value.toUpperCase():e.target.value;P(e=>({...e,[r]:n})),Boolean(n)&&I[r]?.isError&&D(e=>({...e,[r]:{isError:!1,ErrorMessage:" "}})),Boolean(_[r])&&_[r].forEach(e=>{if("function"==typeof j[e]){let i=j[e](U,n,r,t);Boolean(i)&&O(t=>t.map(t=>{let r=t;return t.name===e&&"object"==typeof i&&(r={...r,...i},i.hasOwnProperty("isVisible")&&M(e=>({...e,[t.name]:Boolean(i?.isVisible)})),i.hasOwnProperty("__DATA")&&P(e=>({...e,[t.name]:i.__DATA}))),r}))}})};h(()=>{P(l),Object.keys(l).forEach(e=>{let t={target:{name:e,value:l[e]}};z(t)})},[JSON.stringify(l)]);Jp=s(()=>R.map(e=>{let t=()=>{M(t=>({...t,[e.name]:!H[e.name]}))};return{id:e.name,isTableHidden:e?.isTableHidden??!1,columnName:e?.label??"",isColumnHidingDisabled:e?.isColumnHidingDisabled??!1,getToggleHiddenProps:()=>({checked:H[e.name]??!0,onChange:t,style:{cursor:"pointer"}})}}),[R,H]);const V=async(e,t,i,r)=>{let n=!0,a={};for(const s of e)if(i[s.name]??1)if(s?.isRequired&&!Boolean(t[s.name]))a={...a,[s.name]:{isError:!0,ErrorMessage:Q("ThisFieldisrequired")}},n=!1;else{let e="";"function"==typeof s?.validate&&(e=await s.validate(t[s.name],t,r)),n=!Boolean(e)&&n,a={...a,[s.name]:{isError:Boolean(e),ErrorMessage:Boolean(e)?e:" "}}}else a={...a,[s.name]:{isError:!1,ErrorMessage:" "}};return D(a),n};p(k,()=>({columnVal:U,onAction:C}));const{dynamicAmountSymbol:K}=ns(),J=N&&E?{"data-scope-id":N}:{};return e(f,{children:t(ni,{style:{width:"100%"},sx:S.paperStyle,onKeyDown:e=>{E&&Es(e,N)},...J,children:[y?null:t(ai,{className:T.root,variant:i?"dense":"regular",sx:S.toolbarStyles,children:[e(vt,{className:T.title,color:"inherit",variant:"h6",component:"div",sx:S.titleStyle,children:r}),n?e(Jl,{visibleColumns:Jp,defaultHiddenColumns:[],classes:T,IconButtonStyle:S.IconButtonStyle}):null]}),e("div",{style:{flexGrow:"1",margin:"15px"},children:t(q,{container:!0,spacing:2,justifyContent:"flex-start",alignItems:"center",direction:"row",children:[e(q,{item:!0,xs:u?12:10,container:!0,spacing:1,justifyContent:"flex-start",alignItems:"center",children:R.map(i=>H[i.name]??1?e(q,{item:!0,xs:i?.gridconfig?.xs??6,sm:i?.gridconfig?.sm??3,children:"select"===(i?.type??"text").toLowerCase()?e(Do,{name:i.name,options:i?.optiondata??[],_optionsKey:i?._optionsKey??"",handleChange:(e,t)=>{z(e,t),!Boolean(i?.externalFunctionCall)||"onChange"!==i?.externalFunctionCall&&"all"!==i?.externalFunctionCall||F(e.target.name,e.target.value,t)},label:Q(i?.label??""),fullWidth:!0,value:U[i.name],selectVariant:"regular",enableDefaultOption:Boolean(i?.enableDefaultOption),defaultOptionLabel:i?.defaultOptionLabel??"Select Value",disabled:!!i?.isDisabled||(!!B||(x||w)),skipDefaultOption:i?.skipDefaultOption??!0,error:Boolean(I[i.name]?.isError)?I[i.name]?.ErrorMessage??"Error":"",touched:i?.touched??!0,defaultSpaceAdd:i?.defaultSpaceAdd??!0,required:i?.isRequired??!1,handleBlur:(e,t)=>{R.forEach(e=>{"function"==typeof e?.onBlurHandler&&e.onBlurHandler(U[e.name],U)}),!Boolean(i?.externalFunctionCall)||"onBlur"!==i?.externalFunctionCall&&"all"!==i?.externalFunctionCall||F(e.target.name,e.target.value,t)}}):"spacer"===(i?.type??"text").toLowerCase()?e(tp,{...i},`${i.name}`):"typography"===(i?.type??"text").toLowerCase()?e(Gp,{fieldKey:i.name,name:i.name,label:Q(i?.label??""),TypographyProps:{color:"secondary"}}):"datetimepicker"===(i?.type??"text").toLowerCase()||"datepicker"===(i?.type??"text").toLowerCase()?e(hr,{dateAdapter:Hi,children:e(_o,{format:i?.dateFormat?i?.dateFormat:"datepicker"===(i?.type??"text").toLowerCase()?"dd/MM/yyyy":"dd/MM/yyyy HH:mm:ss",value:""===U[i.name]||null===U[i.name]?null:new Date(U[i.name]),label:Q(i?.label??""),views:"datetimepicker"===(i?.type??"text").toLowerCase()?["year","month","day","hours","minutes","seconds"]:["year","month","day"],onChange:e=>{let t={target:{name:i.name,value:e}};z(t),!Boolean(i?.externalFunctionCall)||"onChange"!==i?.externalFunctionCall&&"all"!==i?.externalFunctionCall||F(t.target.name,t.target.value)},disabled:!!i?.isDisabled||(!!B||(x||w)),slots:{textField:Ao},slotProps:{textField:{name:i.name,error:Boolean(I[i.name]?.isError),InputLabelProps:{shrink:!0},onKeyDown:e=>{"Enter"===e.key&&i?.entertoSubmit&&L?.current?.click?.()}},actionBar:{actions:["today","accept","cancel"]}},sx:{width:"100%",mb:3}})}):"amountfield"===(i?.type??"text").toLowerCase()||"numberfield"===(i?.type??"text").toLowerCase()?e(Ao,{sx:{mb:3},label:Q(i?.label??""),value:U[i.name],onChange:e=>{z(e),!Boolean(i?.externalFunctionCall)||"onChange"!==i?.externalFunctionCall&&"all"!==i?.externalFunctionCall||F(e.target.name,e.target.value)},onBlur:e=>{!Boolean(i?.externalFunctionCall)||"onBlur"!==i?.externalFunctionCall&&"all"!==i?.externalFunctionCall||F(e.target.name,e.target.value)},InputProps:{inputComponent:Yp,inputProps:{FormatProps:{...i?.FormatProps,type:i?.type??"",name:i?.name??""}},startAdornment:"amountfield"===i?.type?e(se,{position:"start",style:{padding:"0 0.6rem 0 0"},children:i?.StartAdornment?$o(i?.StartAdornment):$o(K)??"₹"}):null},InputLabelProps:{shrink:!0},onKeyDown:e=>{"Enter"===e.key&&i?.entertoSubmit&&L?.current?.click?.()},disabled:!!i?.isDisabled||(!!B||(x||w))}):"pancard"===(i?.type??"text").toLowerCase()?e(Ao,{label:Q(i?.label??""),value:U[i.name],placeholder:i.placeholder??"",fullWidth:!0,onChange:e=>{z(e),!Boolean(i?.externalFunctionCall)||"onChange"!==i?.externalFunctionCall&&"all"!==i?.externalFunctionCall||F(e.target.name,e.target.value)},onBlur:e=>{!Boolean(i?.externalFunctionCall)||"onBlur"!==i?.externalFunctionCall&&"all"!==i?.externalFunctionCall||F(e.target.name,e.target.value)},InputProps:{inputComponent:Nl,inputProps:{MaskProps:{mask:"aaaaa0000a",prepare:function(e){return e.toUpperCase()},lazy:!0,...i?.MaskProps},name:i.name??""}},InputLabelProps:{shrink:!0},error:Boolean(I[i.name]?.isError),helperText:t("div",{style:{display:"flex"},children:[e(Ze,{children:Boolean(I[i.name]?.isError)?I[i.name]?.ErrorMessage??"Error":" "}),(i?.maxLength??0)>0&&Boolean(i?.showMaxLength??!1)?t(Ze,{error:!1,style:{flex:1,textAlign:"right",margin:"5px 15px 0 0"},children:[U[i.name].length,"/",i?.maxLength]}):null]}),onKeyDown:e=>{"Enter"===e.key&&i?.entertoSubmit&&L?.current?.click?.()},disabled:!!i?.isDisabled||(!!B||(x||w))}):"autocomplete"===(i?.type??"text").toLowerCase()?e($p,{name:i?.name??"",placeholder:Q(i?.placeholder??""),label:Q(i?.label??""),options:i?.optiondata,_optionsKey:i?._optionsKey,handleChange:(e,t)=>{z(e,t),!Boolean(i?.externalFunctionCall)||"onChange"!==i?.externalFunctionCall&&"all"!==i?.externalFunctionCall||F(e.target.name,e.target.value,t)},columnValue:U,dependentField:_,disabled:!!i?.isDisabled||(!!B||(x||w))}):e(Ao,{autoFocus:i?.defaultfocus??!1,label:Q(i?.label??""),fullWidth:!0,placeholder:String(Q(i?.placeholder??"")),type:"text",name:i.name,value:U[i.name],InputProps:{style:{background:Boolean(i?.isDisabled)?"#f3f3f3":""}},onChange:e=>{if(-1===(i?.maxLength??-1)||e.target.value.length<=i?.maxLength){const t=/^[0-9\b]+$/,r=/^[a-zA-Z0-9\b]+$/;(""===e.target.value||("number"===(i?.type??"text")?t.test(e.target.value):"alphanumeric"!==(i?.type??"text")||r.test(e.target.value)))&&(z(e,"",Boolean(i?.toUpperCase)),!Boolean(i?.externalFunctionCall)||"onChange"!==i?.externalFunctionCall&&"all"!==i?.externalFunctionCall||F(e.target.name,e.target.value))}},onBlur:e=>{!Boolean(i?.externalFunctionCall)||"onBlur"!==i?.externalFunctionCall&&"all"!==i?.externalFunctionCall||F(e.target.name,e.target.value)},InputLabelProps:{shrink:!0},required:i?.isRequired??!1,autoComplete:i?.autoComplete??"off",disabled:!!i?.isDisabled||(!!B||(x||w)),error:Boolean(I[i.name]?.isError),helperText:t("div",{style:{display:"flex"},children:[e(Ze,{children:Boolean(I[i.name]?.isError)?I[i.name]?.ErrorMessage??"Error":" "}),(i?.maxLength??0)>0&&Boolean(i?.showMaxLength??!1)?t(Ze,{error:!1,style:{flex:1,textAlign:"right",margin:"5px 15px 0 0"},children:[U[i.name].length,"/",i?.maxLength]}):null]}),onKeyDown:e=>{"Enter"===e.key&&i?.entertoSubmit&&L?.current?.click?.()}})},`gird${i.name}`):null)}),t(q,{item:!0,xs:2,container:!0,justifyContent:"center",alignItems:"center",spacing:2,style:{maxWidth:"16%"},children:[e(q,{item:!0,children:e(eo,{sx:{display:u?"none":"auto"},disabled:x||w,endIcon:x?e(G,{size:20}):null,onClick:async()=>{await V(R,U,H,"FIRST")&&C(U,H)},ref:L,children:Q(A)})},`gird${A}`),m?null:e(q,{item:!0,children:e(eo,{disabled:x||w,endIcon:w?e(G,{size:20}):null,onClick:async()=>{v&&!await V(R,U,H,"SECOND")||b(U,H)},children:Q(g)})},`gird${g}`)]})]})})]})})}),Yp=t=>{const{inputRef:i,onChange:r,FormatProps:n,...a}=t,{type:s,name:o,...l}=n,{decimalCount:h,dynamicAmountGroupStyle:c}=ns();return e(Ht,{...a,getInputRef:i,onValueChange:e=>{r({target:{value:e.value,name:o}})},valueIsNumericString:!1,..."amountfield"===s?{thousandSeparator:!0,isNumericString:!0,decimalScale:n?.decimalScale?n?.decimalScale:h??2,fixedDecimalScale:!0,thousandsGroupStyle:n?.thousandsGroupStyle?n?.thousandsGroupStyle:c??"lakh"}:{},...l})},$p=({name:i,label:r,placeholder:n,options:a,_optionsKey:s,handleChange:o,freeSolo:h=!1,disabled:c,columnValue:d,dependentField:u})=>{const A=l((e=>t=>Boolean(e)?t:t?.label??"")(h),[]),{t:p}=W(),{authState:m}=es(),{data:g,status:w,isLoading:b,isFetching:v,error:y}=zt([s],()=>a(d?.[i]??void 0,d,u,m));return e(ye,{sx:{mb:3},options:g??[],onChange:(e,t)=>{o({target:{value:t?.value,name:i}},t?.label)},disabled:c,getOptionLabel:A,renderInput:a=>e(Ao,{...a,label:p(r??""),placeholder:String(p(n??"")),name:i,autoComplete:"disable",InputProps:{...a.InputProps,endAdornment:t(f,{children:[b||v?e(G,{size:25,color:"secondary",variant:"indeterminate"}):null,a.InputProps.endAdornment]})},InputLabelProps:{shrink:!0}}),renderOption:(t,i,r)=>{t.key=t.id;let{selected:n,inputValue:a}=r,s=A(i);const o=wi(s,a),l=bi(s,o).map((t,i)=>e("span",{style:{fontWeight:t.highlight?700:400},children:t.text},i));return e("li",{style:{whiteSpace:"pre"},...t,children:l})}})},Zp=c(({finalMetaData:t,onAction:i,loading:r,data:n,submitSecondButtonHide:a=!0,submitSecondButtonName:s="submit",submitSecondLoading:o=!1,submitSecondAction:l=(e,t)=>{},submitSecondValidtion:h=!0,onFieldAction:c=(e,t,i)=>{},propStyles:d={titleStyle:{},toolbarStyles:{},IconButtonStyle:{},paperStyle:{}},enableEnterToFocus:u,focusScopeId:A="enter-to-focus-formComponentView"},p)=>{const{enableEnterToFocus:f}=ns(),m=t.gridConfig?.isDisplayOnly??!1,{t:g}=W();let w=ef({metaData:t,isDisplayOnly:m,data:n});return e(Xp,{dense:w.gridConfig?.dense??!0,title:g(w.gridConfig?.title??"No Title"),fields:w.fields,allowColumnHiding:w.gridConfig?.allowColumnHiding??!1,initialDataValue:w.initialData,initialVisibleColumnData:w.initialVisibleColumnData,submitButtonHide:w.gridConfig?.submitButtonHide??!1,submitButtonName:w.gridConfig?.submitButtonName??"SUBMIT",hideHeader:w.gridConfig?.HideHeader??!1,isDisplayOnly:m,onAction:i,loading:r,submitSecondButtonHide:a,submitSecondButtonName:s,submitSecondLoading:o,submitSecondAction:l,submitSecondValidtion:h,onFieldAction:c,propStyles:d,enableEnterToFocus:u??f,focusScopeId:A,ref:p})}),ef=({metaData:e,isDisplayOnly:t,data:i})=>{let r=N(e),n=r.fields.reduce((e,r)=>e={...e,[r.name]:t||Boolean(i[r?.accessor])?i[r?.accessor]??"":r?.defaultValue??""},{}),a=r.fields.reduce((e,t)=>e={...e,[t.name]:t?.isVisible??!0},{});return{gridConfig:r.gridConfig,fields:r.fields,initialData:n,initialVisibleColumnData:a}},tf=E.object().shape({name:E.string().required(),label:E.string().required(),render:E.object().shape({ordering:E.string().required(),renderType:E.string().required(),groups:E.object().required()}),submitAction:E.string().required()}),rf=E.array().of(E.object().shape({name:E.string().required(),label:E.string().required(),render:E.object().shape({componentType:E.string().required(),group:E.number().required()}),sequence:E.number(),GridProps:E.object().shape({xs:E.number().required(),md:E.number().required(),sm:E.number().required()})}));E.object().shape({form:tf,fields:rf});const nf=c(({metaData:i,children:r=()=>{},actions:n=[],initialData:a={},isError:l=!1,errorObj:c={},handelActionEvent:u=()=>{},formStyle:A={background:"white",height:"calc(100vh - 650px)",overflowY:"auto",overflowX:"hidden"},isNewRow:m=null,isLoading:g=!1,onSubmitData:w=()=>{},displayMode:b=null,containerstyle:v={padding:"10px"},formName:y="",formNameMaster:B="",onFormButtonClickHandel:C=e=>{},onClickActionEvent:x=()=>{},hideHeader:F=!1,onFormDataChange:S=()=>{},isDetailHide:N=!1,formState:E={},setDataOnFieldChange:k,isDetailRowRequire:T=!0,subHeaderLabel:L,subHeaderLabelStyle:I,hideDisplayModeInTitle:D=!1,headerToolbarStyle:U={},refetchData:P,formHeaderStyle:R={},enableEnterToFocus:O,focusScopeId:Q="enter-to-focus-master-details-form",handleClickAction:H,disableMultipleRowSelect:M=!1,defaultSelectedRowId:_="",setValidationRunning:j},z)=>{const{enableEnterToFocus:V}=ns(),K=s(()=>{const{DETAILS_DATA:e=[],...t}=a;return e},[a]),[q,G]=d(K),{t:J}=W(),X=o(null),Y=o(null),$=o(!1),[Z,ee]=d(""),te=s(()=>Os(i.masterForm,b),[i,b,B]),ie=s(()=>Qs(i.detailsGrid,b),[i,b,y]),re=s(()=>i?.detailsGrid?.gridConfig?.rowIdColumn||"id",[i]),ne=s(()=>{const{DETAILS_DATA:e,...t}=a;return t},[a]),ae=s(()=>ie.columns.reduce((e,t)=>("deleteRowCell"===t?.componentType||(e[t?.accessor]=t?.defaultValue??""),e),{}),[ie]),se=s(()=>{let e=ie.columns;return"view"===b&&(e=ie.columns.filter(e=>"_hidden"!==e.accessor)),{...ie,columns:e}},[b,ie]);h(()=>{$.current=N,N&&Boolean(Z)&&ee("")},[N,ee]);const oe=()=>{Y?.current?.handleFormReset({preventDefault:()=>{}}),G([])},le=()=>{Y?.current?.handleFormClear({preventDefault:()=>{}}),G([])};return p(z,()=>({addNewRow:(e=!1,t=ae)=>(async(e=!1,t=ae)=>{if(!g){if(Boolean(Z)&&ee(""),e){let{hasError:e,data:t}=await(X.current?.validate(!0));if(!0===e)return void(t&&G(t))}G(e=>{if(Array.isArray(e)){let i=As(e,re);const r={...t,_isNewRow:!0,[re]:i};return[...e,r]}return[{...t,_isNewRow:!0,[re]:1}]})}})(e,t),GetGirdData:()=>X?.current?.cleanData?.(),onSubmitHandler:(e,t="action",i=!0)=>{Y.current?.handleSubmit(e,t,i)},setGridData:G,getFieldData:Y?.current?.getFieldData,handleFormReset:oe,clearMasterDetailForm:le,handleFormClear:Y?.current?.handleFormClear})),e(f,{children:t("div",{style:{paddingBottom:"10px"},children:[l?e("div",{style:{padding:"10px 10px 0 10px"},children:e(Ar,{position:"relative",color:"primary",children:e(to,{severity:"error",errorMsg:c?.error_msg??"Unknow Error",errorDetail:c?.error_detail??"",color:"error"})})}):Boolean(Z)?e("div",{style:{padding:"10px 10px 0 10px"},children:e(Ar,{position:"relative",color:"primary",children:e(to,{errorMsg:Z,errorDetail:"",severity:"error"})})}):null,e(Nc,{metaData:te,initialValues:ne,formStyle:A,onSubmitHandler:async(e,t,i,r,n,a,s,o)=>{if($.current){Boolean(Z)&&ee("");let l=vs(e,ne),h={_isNewRow:Boolean(m),...e,DETAILS_DATA:{isNewRow:[],isUpdatedRow:[],isDeleteRow:[]},...l};w({data:h,resultValueObj:e,resultDisplayValueObj:t,endSubmit:i,setFieldErrors:r,actionFlag:n,hasError:a,optionalData:s,errorFields:o})}else{let{hasError:a,data:l}=await(X.current?.validate(!0));if(Boolean(Z)&&ee(""),!0===a)i(!0),l&&G(l);else{let l=X?.current?.cleanData?.();if(Array.isArray(l)||(l=[l]),0===l.length&&T)i(!0),ee(String(J("Atleastonerowmustbeindetail")));else{let h=l.filter(e=>Boolean(e?._hidden));if("edit"===b&&h.length===l.length&&T)return i(!0),void ee(String(J("Atleastonerowmustbeindetail")));let c=l.filter(e=>!(Boolean(e?._hidden)&&Boolean(e?._isNewRow)));if(0===c.length&&T)i(!0),ee(String(J("Atleastonerowmustbeindetail")));else{c=Gs(c);let l=vs(e,ne),h={_isNewRow:Boolean(m),...e,DETAILS_DATA:c,...l};w({data:h,resultValueObj:e,resultDisplayValueObj:t,endSubmit:i,setFieldErrors:r,actionFlag:n,hasError:a,optionalData:s,errorFields:o})}}}}},displayMode:b,hideDisplayModeInTitle:D,containerstyle:v,onFormButtonClickHandel:C,onFormDataChange:S,hideHeader:F,formState:E,ref:Y,setDataOnFieldChange:k,subHeaderLabel:L,subHeaderLabelStyle:I,formHeaderStyle:R,focusScopeId:Q,enableEnterToFocus:O??V,setValidationRunning:j,children:r},(Boolean(B),B)),e("div",{style:{paddingRight:"10px",paddingLeft:"10px",display:N?"none":"inherit"},children:e(hu,{finalMetaData:se,data:q,setData:G,loading:g,actions:n,setAction:u,refetchData:P,ref:X,onClickActionEvent:x,fieldDataRef:Y,headerToolbarStyle:U,focusScopeId:Q,enableEnterToFocus:O??V,handleClickAction:H,disableMultipleRowSelect:M,defaultSelectedRowId:_},(Boolean(y),y))})]})})}),af=n({}),sf=({children:t,insertFormData:i,checkFormDataExist:r,deleteFormData:n,updateFormData:a,getFormData:s,getGridFormData:o,getFormMetaData:l,getGridFormMetaData:h,context:c})=>e(af.Provider,{value:{context:c,insertFormData:i,checkFormDataExist:r,deleteFormData:n,updateFormData:a,getFormData:s,getGridFormData:o,getFormMetaData:l,getGridFormMetaData:h},children:t}),of=({isDataChangedRef:r,successAction:n,cancelAction:s,formStyle:l})=>{const{insertFormData:c,getFormMetaData:d,context:u}=a(af),{enqueueSnackbar:A}=fr(),{addEntry:p}=a(bo),f=o(null);null===f.current&&(f.current=yo(Object.values(c.args)));const m=Vt((e=>async({data:t})=>e(t))(c.fn(c.args)),{onError:(e,{endSubmit:t})=>{let i="Unknown Error occured";"object"==typeof e&&(i=e?.error_msg??i),t(!1,i,e?.error_detail??"")},onSuccess:(e,{endSubmit:t})=>{t(!0,""),r.current=!0,A("Data is successfully saved with",{variant:"success"}),"function"==typeof n&&n()}});h(()=>{p(["getFormMetaData",f.current,"new"])},[p]);const g=zt(["getFormMetaData",f.current,"new"],()=>d.fn(d.args)("new")),w=g.dataUpdatedAt,b=g.isLoading||g.isFetching;let v=g.isError,y=`${g.error?.error_msg??"unknown error occured"}`,B={};g.isSuccess&&(B=N(g.data),B.form.formState={...u,formCode:B?.form?.name},B.form.name=`${B.form.name}-New`,"stepper"===B?.form?.render?.renderType&&(B.form.render.renderType="tabs")),!1===b&&!1===v&&(!1===v||(y="Error loading form"));return b?t(i,{children:[e(wd,{}),"function"==typeof s?e("div",{style:{position:"absolute",right:0,top:0},children:e(C,{onClick:s,children:e(pr,{})})}):null]}):!0===v?t(i,{children:[e("span",{children:y}),"function"==typeof s?e("div",{style:{position:"absolute",right:0,top:0},children:e(C,{onClick:s,children:e(pr,{})})}):null]}):e(Nc,{metaData:B,initialValues:{},onSubmitHandler:(e,t,i,r)=>{m.mutate({data:e,displayData:t,endSubmit:i,setFieldError:r})},displayMode:"new",formStyle:l,children:({isSubmitting:r,handleSubmit:n})=>t(i,{children:[e(ct,{onClick:n,disabled:r,endIcon:r?e(G,{size:20}):null,children:"Save"}),"function"==typeof s?e(ct,{onClick:s,disabled:r,children:"Cancel"}):null]})},`${f.current}-${w}-new`)},lf=({isDataChangedRef:r,closeDialog:n,defaultView:s="view",serialNo:c="1",setEditFormStateFromInitValues:u,readOnly:A=!1,disableCache:p=!1,formStyle:f})=>{const{updateFormData:m,getFormData:g,getFormMetaData:w,context:b}=a(af),{addEntry:v}=a(bo),[y,B]=d(s),{enqueueSnackbar:x}=fr(),F=l(()=>B("view"),[B]),S=l(()=>B("edit"),[B]),E=o(null);null===E.current&&(E.current=yo(Object.values(g.args)));const k=Vt((e=>async({data:t,serialNo:i})=>e(t,i))(m.fn(m.args)),{onError:(e,{endSubmit:t})=>{let i="Unknown Error occured";"object"==typeof e&&(i=e?.error_msg??i),t(!1,i,e?.error_detail??"")},onSuccess:(e,{serialNo:t})=>{wo.refetchQueries(["getFormData",E.current,t]),x("Data changes successfully saved",{variant:"success"}),r.current=!0,F(),"function"==typeof n&&n()}}),T=(e,t,i,r)=>{k.mutate({data:e,displayData:t,endSubmit:i,setFieldError:r,serialNo:c})};h(()=>{v(["getFormData",E.current,c]),v(["getFormMetaData",E.current,"view"]),v(["getFormMetaData",E.current,"edit"])},[v,c]);const L=Kt([p?{queryKey:["getFormData",E.current,c],queryFn:()=>g.fn(g.args)(c),cacheTime:0}:{queryKey:["getFormData",E.current,c],queryFn:()=>g.fn(g.args)(c)},{queryKey:["getFormMetaData",E.current,"view"],queryFn:()=>w.fn(w.args)("view")},{queryKey:["getFormMetaData",E.current,"edit"],queryFn:()=>w.fn(w.args)("edit")}]),I=`${L[0].dataUpdatedAt}`,D=L[0].isLoading||L[1].isLoading||L[2].isLoading||L[0].isFetching||L[1].isFetching||L[2].isFetching;let U=L[0].isError||L[1].isError||L[2].isError,P=`${L[0].error?.error_msg} ${L[1].error?.error_msg} ${L[2].error?.error_msg}`;P=Boolean(P.trim())?P:"Unknown error occured";let R=L[0].data,O={},Q={};if(L[1].isSuccess&&L[2].isSuccess&&L[0].isSuccess){const e="function"==typeof u?u(L[0].data):void 0;Q=N(L[1].data),O=N(L[2].data),O.form.formState={...b,serialNo:c,formCode:O.form.name,...e},O.form.name=`${O.form.name}-edit`,"stepper"===O?.form?.render?.renderType&&(O.form.render.renderType="tabs"),Q.form.formState={...b,serialNo:c,formCode:Q.form.name,...e},Q.form.name=`${Q.form.name}-view`,"stepper"===Q?.form?.render?.renderType&&(Q.form.render.renderType="tabs")}return D?t(i,{children:[e(wd,{}),"function"==typeof n?e("div",{style:{position:"absolute",right:0,top:0},children:e(C,{onClick:n,children:e(pr,{})})}):null]}):!0===U?t(i,{children:[e("span",{children:P}),"function"==typeof n?e("div",{style:{position:"absolute",right:0,top:0},children:e(C,{onClick:n,children:e(pr,{})})}):null]}):"view"===y?t(Nc,{metaData:Q,initialValues:R,onSubmitHandler:T,displayMode:y,formStyle:f,children:[A?null:e(ct,{onClick:S,children:"Edit"}),"function"==typeof n?e(ct,{onClick:n,children:"Cancel"}):null]},`${E.current}-${I}-${y}`):"edit"===y?e(Nc,{metaData:O,initialValues:R,onSubmitHandler:T,displayMode:y,formStyle:f,children:({isSubmitting:r,handleSubmit:n})=>t(i,{children:[e(ct,{onClick:n,disabled:r,endIcon:r?e(G,{size:20}):null,children:"Save"}),e(ct,{onClick:F,disabled:r,children:"Cancel"})]})},`${E.current}-${I}-${y}`):null},hf=({isDataChangedRef:i,closeDialog:r,serialNo:n})=>{const{deleteFormData:s}=a(af),l=o(null),{t:h}=W();null===l.current&&(l.current=yo(Object.values(s.args)));const c=Vt((e=>async({serialNo:t})=>e(t))(s.fn(s.args)),{onError:e=>{},onSuccess:e=>{i.current=!0,r()}});return t(f,{children:[e(ut,{id:"alert-dialog-title",children:h("AreyousureyouwanttodeletetheselectedRecords")}),c.isLoading?e(pt,{children:"Deleting..."}):c?.isError?e(pt,{children:e(to,{severity:"error",errorMsg:c.error?.error_msg??"Unknown Error occured",errorDetail:c.error?.error_detail??""})}):c.isSuccess?e(pt,{children:h("AllRecordssuccessfullydeleted")}):null,c.isSuccess?e(At,{children:e(ct,{onClick:r,color:"primary",children:h("Close")})}):t(At,{children:[e(ct,{onClick:r,color:"primary",disabled:c.isLoading,children:h("Disagree")}),e(ct,{onClick:()=>c.mutate({serialNo:n}),color:"primary",disabled:c.isLoading,children:h("Agree")})]})]},l.current)},cf=c(({actions:t,setAction:i},r)=>{const{addEntry:n}=a(bo),{getGridFormData:s,getGridFormMetaData:l,context:c}=a(af),d=o(null);null===d.current&&(d.current=yo(Object.values(s.args)));const u=Kt([{queryKey:["getGridFormMetaData",d.current],queryFn:()=>l.fn(l.args)()},{queryKey:["getStaticGridData",d.current],queryFn:()=>s.fn(s.args)()}]);h(()=>{n(["getGridFormMetaData",d.current]),n(["getStaticGridData",d.current])},[n]),p(r,()=>({refetch:()=>u[1].refetch()}));const A=u[0].isLoading||u[0].isFetching;let f=u[0].isError||u[1].isError,m=`${u[0].error?.error_msg} ${u[1].error?.error_msg}`.trimStart().trimEnd();m=Boolean(m)?m:"unknown error occured";return A?e(wd,{}):!0===f?e("span",{children:m}):e(hu,{finalMetaData:u[0].data,data:u[1].data??[],setData:()=>null,actions:t,setAction:i,loading:u[1].isLoading||u[1].isFetching,gridProps:c},`staticGridData-${d.current}`)});cf.displayName="MyGridWrapper";const df=[{label:"KYC",sequence:0,docType:[{label:"Add Documents",type:"kyc",primary:!0,categoryCD:"KYC_DOC_TYPE_CO"}]},{label:"Bank",sequence:1,docType:[{label:"Add Documents",type:"bank",primary:!0,categoryCD:"BANK_DOC_TYPE"}]},{label:"Financial",sequence:2,docType:[{label:"ITR",type:"itr",primary:!0,categoryCD:"ITR_DOC_TYPE"},{label:"Others",type:"itrOther",primary:!1,categoryCD:"ITR_DOC_TYPE_O"}]},{label:"GST",sequence:3,docType:[{label:"Analysis",type:"gst",primary:!0,categoryCD:"GST_DOC_TYPE"},{label:"Others",type:"gstOther",primary:!0,categoryCD:"GST_DOC_TYPE_O"}]},{label:"Others",sequence:4,docType:[{label:"Add Documents",type:"other",primary:!0,categoryCD:"OTHER_DOC_TYPE"}]}],uf=[{label:"KYC",sequence:0,docType:[{label:"Add Documents",type:"kyc",primary:!0,categoryCD:"KYC_DOC_TYPE"}]},{label:"Bank",sequence:1,docType:[{label:"Add Documents",type:"bank",primary:!0,categoryCD:"BANK_DOC_TYPE"}]},{label:"Financial",sequence:2,docType:[{label:"ITR",type:"itr",primary:!0,categoryCD:"ITR_DOC_TYPE"},{label:"Others",type:"itrOther",primary:!1,categoryCD:"ITR_DOC_TYPE_O"}]},{label:"Others",sequence:3,docType:[{label:"Add Documents",type:"other",primary:!0,categoryCD:"OTHER_DOC_TYPE"}]}],Af={gridConfig:{dense:!0,gridLabel:"Update Statement",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!0,disableGlobalFilter:!0,disableGroupBy:!0,containerHeight:{min:"30vh",max:"30vh"},hideFooter:!0,hideHeader:!0,disableLoader:!0,enablePagination:!1},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Bank",componentType:"editableSelect",accessor:"bankID",sequence:4,alignment:"left",options:"getBankListForLeadDocuments",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]},disableCachingOptions:!0},{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getBankDocType",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0}]},pf={gridConfig:{dense:!0,gridLabel:"Bank Statement",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!1,disableGlobalFilter:!1,disableGroupBy:!1,containerHeight:{min:"40vh",max:"50vh"},enablePagination:!0},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Uploaded Date",componentType:"date",accessor:"uploadDate",sequence:2,alignment:"left",width:100,maxWidth:200,minWidth:100},{columnName:"Verification",componentType:"default",accessor:"status",sequence:3,alignment:"left",width:150,maxWidth:200,minWidth:100},{columnName:"Bank Name",componentType:"default",accessor:"bank",sequence:4,alignment:"left"},{columnName:"Document Type",componentType:"default",accessor:"docType",sequence:5,alignment:"left",width:150,maxWidth:200,minWidth:100},{columnName:"Remarks",componentType:"default",accessor:"remarks",sequence:6,alignment:"left",width:100,maxWidth:200,minWidth:100}]},ff=[{columnName:"Bank",componentType:"editableSelect",accessor:"bankLineID",sequence:4,alignment:"left",options:"getBankListForLeadDocuments",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]},disableCachingOptions:!0},{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getBankDocType",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0},{columnName:"Remarks",componentType:"editableTextField",accessor:"remarks",sequence:6,alignment:"left",isVisible:!1}],mf={gridConfig:{dense:!0,gridLabel:"GST Document Update",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!0,disableGlobalFilter:!0,disableGroupBy:!0,containerHeight:{min:"30vh",max:"30vh"},hideFooter:!0,hideHeader:!0,disableLoader:!0,enablePagination:!1},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getGSTDocType",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0}]},gf={gridConfig:{dense:!0,gridLabel:"GST",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!1,disableGlobalFilter:!1,disableGroupBy:!1,containerHeight:{min:"40vh",max:"50vh"},enablePagination:!0},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Uploaded Date",componentType:"date",accessor:"uploadDate",sequence:2,alignment:"left",width:100,maxWidth:200,minWidth:100},{columnName:"Verification",componentType:"default",accessor:"status",sequence:3,alignment:"left",width:150,maxWidth:200,minWidth:100},{columnName:"Document Type",componentType:"default",accessor:"docType",sequence:5,alignment:"left",width:150,maxWidth:200,minWidth:100},{columnName:"Remarks",componentType:"default",accessor:"remarks",sequence:6,alignment:"left",width:100,maxWidth:200,minWidth:100}]},wf=[{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getGSTDocType",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0},{columnName:"Remarks",componentType:"editableTextField",accessor:"remarks",sequence:6,alignment:"left",isVisible:!1}],bf=[{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getGSTDocTypeOther",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0},{columnName:"Remarks",componentType:"editableTextField",accessor:"remarks",sequence:6,alignment:"left",isVisible:!1}],vf={gridConfig:{dense:!0,gridLabel:"GST Document Update",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!0,disableGlobalFilter:!0,disableGroupBy:!0,containerHeight:{min:"30vh",max:"30vh"},hideFooter:!0,hideHeader:!0,disableLoader:!0,enablePagination:!1},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getGSTDocTypeOther",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0}]},yf={gridConfig:{dense:!0,gridLabel:"ITR Document Update",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!0,disableGlobalFilter:!0,disableGroupBy:!0,containerHeight:{min:"30vh",max:"30vh"},hideFooter:!0,hideHeader:!0,disableLoader:!0,enablePagination:!1},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Financial Year",componentType:"editableNumberFormat",accessor:"finYear",sequence:5,alignment:"left",FormatProps:{format:"####",placeholder:"YYYY",mask:["Y","Y","Y","Y"]},schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getITRDocType",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0}]},Bf={gridConfig:{dense:!0,gridLabel:"ITR",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!1,disableGlobalFilter:!1,disableGroupBy:!1,containerHeight:{min:"40vh",max:"50vh"},enablePagination:!0},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Uploaded Date",componentType:"date",accessor:"uploadDate",sequence:2,alignment:"left",width:100,maxWidth:200,minWidth:100},{columnName:"Verification",componentType:"default",accessor:"status",sequence:3,alignment:"left",width:150,maxWidth:200,minWidth:100},{columnName:"Financial Year",componentType:"default",accessor:"finYear",sequence:4,alignment:"left",width:150,maxWidth:200,minWidth:100},{columnName:"Document Type",componentType:"default",accessor:"docType",sequence:5,alignment:"left",width:150,maxWidth:200,minWidth:100},{columnName:"Remarks",componentType:"default",accessor:"remarks",sequence:6,alignment:"left",width:100,maxWidth:200,minWidth:100}]},Cf=[{columnName:"Financial Year",componentType:"editableNumberFormat",accessor:"finYear",sequence:4,alignment:"left",FormatProps:{format:"####",placeholder:"YYYY",mask:["Y","Y","Y","Y"]},schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getITRDocType",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0},{columnName:"Remarks",componentType:"editableTextField",accessor:"remarks",sequence:6,alignment:"left",isVisible:!1}],xf={gridConfig:{dense:!0,gridLabel:"ITR Document Update",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!0,disableGlobalFilter:!0,disableGroupBy:!0,containerHeight:{min:"30vh",max:"30vh"},hideFooter:!0,hideHeader:!0,disableLoader:!0,enablePagination:!1},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getITRDocTypeOther",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0}]},Ff=[{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getITRDocTypeOther",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0},{columnName:"Remarks",componentType:"editableTextField",accessor:"remarks",sequence:6,alignment:"left",isVisible:!1}],Sf={gridConfig:{dense:!0,gridLabel:"KYC Document Update",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!0,disableGlobalFilter:!0,disableGroupBy:!0,containerHeight:{min:"30vh",max:"30vh"},hideFooter:!0,hideHeader:!0,disableLoader:!0,enablePagination:!1},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getKYCDocType",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0}]},Nf={gridConfig:{dense:!0,gridLabel:"KYC",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!1,disableGlobalFilter:!1,disableGroupBy:!1,containerHeight:{min:"40vh",max:"50vh"},enablePagination:!0},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Uploaded Date",componentType:"date",accessor:"uploadDate",sequence:2,alignment:"left",width:100,maxWidth:200,minWidth:100},{columnName:"Verification",componentType:"default",accessor:"status",sequence:3,alignment:"left",width:150,maxWidth:200,minWidth:100},{columnName:"Document Type",componentType:"default",accessor:"docType",sequence:5,alignment:"left",width:150,maxWidth:200,minWidth:100},{columnName:"Remarks",componentType:"default",accessor:"remarks",sequence:6,alignment:"left",width:100,maxWidth:200,minWidth:100}]},Ef=[{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getKYCDocType",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0},{columnName:"Remarks",componentType:"editableTextField",accessor:"remarks",sequence:6,alignment:"left",isVisible:!1}],kf={gridConfig:{dense:!0,gridLabel:"KYC Document Update",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!0,disableGlobalFilter:!0,disableGroupBy:!0,containerHeight:{min:"30vh",max:"30vh"},hideFooter:!0,hideHeader:!0,disableLoader:!0,enablePagination:!1},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getKYCDocTypeLegal",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0}]},Tf=[{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getKYCDocTypeLegal",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0},{columnName:"Remarks",componentType:"editableTextField",accessor:"remarks",sequence:6,alignment:"left",isVisible:!1}],Lf={gridConfig:{dense:!0,gridLabel:"Others Document Update",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!0,disableGlobalFilter:!0,disableGroupBy:!0,containerHeight:{min:"30vh",max:"30vh"},hideFooter:!0,hideHeader:!0,disableLoader:!0,enablePagination:!1},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getOtherDocType",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0}]},If={gridConfig:{dense:!0,gridLabel:"Others",rowIdColumn:"docUUID",defaultColumnConfig:{width:150,maxWidth:250,minWidth:100},allowColumnReordering:!0,disableSorting:!1,disableGlobalFilter:!1,disableGroupBy:!1,containerHeight:{min:"40vh",max:"50vh"},enablePagination:!0},columns:[{columnName:"File Name",componentType:"default",accessor:"fileName",sequence:1,alignment:"left",width:300,maxWidth:300,minWidth:100,schemaValidation:{type:"string",rules:[{name:"required",params:["This is a required field"]}]}},{columnName:"Uploaded Date",componentType:"date",accessor:"uploadDate",sequence:2,alignment:"left",width:100,maxWidth:200,minWidth:100},{columnName:"Verification",componentType:"default",accessor:"status",sequence:3,alignment:"left",width:150,maxWidth:200,minWidth:100},{columnName:"Document Type",componentType:"default",accessor:"docType",sequence:5,alignment:"left",width:150,maxWidth:200,minWidth:100},{columnName:"Remarks",componentType:"default",accessor:"remarks",sequence:6,alignment:"left",width:100,maxWidth:200,minWidth:100}]},Df=[{columnName:"Document Type",componentType:"editableSelect",accessor:"docTypeID",sequence:5,alignment:"left",options:"getOtherDocType",schemaValidation:{type:"string",rules:[{name:"required",params:["required"]}]}},{columnName:"Password",componentType:"editableTextField",accessor:"password",sequence:6,alignment:"left",isPassword:!0},{columnName:"Remarks",componentType:"editableTextField",accessor:"remarks",sequence:6,alignment:"left",isVisible:!1}],Uf=({moduleType:e,productType:t,docCategory:i,categoryCD:r,refID:n,serialNo:a})=>async(e,t=()=>{},i=()=>{})=>{},Pf=({moduleType:e,productType:t,refID:i,serialNo:r})=>async e=>{},Rf=({moduleType:e,productType:t,refID:i,serialNo:r})=>async(e,t)=>{},Of=({moduleType:e,productType:t,refID:i,serialNo:r})=>async(e,t)=>{},Qf=({moduleType:e,productType:t,refID:i,serialNo:r})=>async(e,t,i,r)=>{},Hf=({moduleType:e,productType:t})=>(e,t)=>(Array.isArray(t)||(t=[t]),t.join(","),new URL("").href),Mf=({moduleType:e,productType:t})=>async(e,t)=>{Array.isArray(t)||(t=[t]);const i=new URL("").href;try{let e=await fetch(i,{method:"POST",body:JSON.stringify({request_data:{docUUID:t}}),headers:new Headers({"Content-Type":"application/json"})});if("200"===String(e.status)){return await e.blob()}return new Error("Error getting file")}catch(e){return e}},_f=({moduleType:e,productType:t,metaDataType:i})=>async e=>{if("grid"===i)switch(e){case"bank":return pf;case"itr":return Bf;case"gst":return gf;case"other":return If;case"kyc":return Nf;default:throw{error_msg:"Invalid docCategory"}}else if("upload"===i)switch(e){case"bank":return ff;case"itr":return Cf;case"itrOther":return Ff;case"gst":return wf;case"gstOther":return bf;case"other":return Df;case"kyc":return"management"===t?Ef:Tf;default:throw{error_msg:"Invalid docCategory"}}else{if("edit"!==i)throw{error_msg:"Invalid MetaData Type requested"};switch(e){case"bank":return Af;case"itr":return yf;case"itrOther":return xf;case"gst":return mf;case"gstOther":return vf;case"other":return Lf;case"kyc":return"management"===t?Sf:kf;default:throw{error_msg:"Invalid docCategory"}}}},jf=n({}),zf=({children:t,uploadDocuments:i,deleteDocuments:r,updateDocument:n,verifyDocuments:a,getDocumentsGridData:s,getDocumentListingGridMetaData:o,getDocumentUploadAddtionalFieldsMetaData:l,getDocumentEditGridMetaData:h,generateDocumentDownloadURL:c,previewDocument:d,context:u})=>e(jf.Provider,{value:{uploadDocuments:i,deleteDocuments:r,updateDocument:n,verifyDocuments:a,getDocumentsGridData:s,getDocumentListingGridMetaData:o,getDocumentUploadAddtionalFieldsMetaData:l,getDocumentEditGridMetaData:h,generateDocumentDownloadURL:c,previewDocument:d,context:u},children:t}),Vf=(e,t,i,r,n)=>({context:{moduleType:e,productType:t,docCategory:i,refID:r,serialNo:n},uploadDocuments:{fn:Uf,args:{moduleType:e,productType:t,refID:r,serialNo:n}},getDocumentsGridData:{fn:Pf,args:{moduleType:e,productType:t,refID:r,serialNo:n}},deleteDocuments:{fn:Rf,args:{moduleType:e,productType:t,refID:r,serialNo:n}},updateDocument:{fn:Of,args:{moduleType:e,productType:t,refID:r,serialNo:n}},verifyDocuments:{fn:Qf,args:{moduleType:e,productType:t,refID:r,serialNo:n}},getDocumentListingGridMetaData:{fn:_f,args:{moduleType:e,productType:t,metaDataType:"grid"}},getDocumentUploadAddtionalFieldsMetaData:{fn:_f,args:{moduleType:e,productType:t,metaDataType:"upload"}},getDocumentEditGridMetaData:{fn:_f,args:{moduleType:e,productType:t,metaDataType:"edit"}},generateDocumentDownloadURL:{fn:Hf,args:{moduleType:e,productType:t}},previewDocument:{fn:Mf,args:{moduleType:e,productType:t}}}),Kf=c(({actions:i,setAction:r,transformData:n=e=>e,defaultSortOrder:s,defaultGroupBy:l},c)=>{const{addEntry:d}=a(bo),{getDocumentsGridData:u,getDocumentListingGridMetaData:A,context:m}=a(jf),g=m.docCategory.filter(e=>!0===e.primary)[0].type,w=o(null);null===w.current&&(w.current=yo(Object.values(u.args))),h(()=>{d(["getDocumentListingGridMetaData",m.refID,g]),d(["getDocumentsGridData",w.current,g])},[d,m,g]),p(c,()=>({refetch:()=>b[0].refetch()}));const b=Kt([{queryKey:["getDocumentsGridData",w.current,g],queryFn:()=>u.fn(u.args)(g)},{queryKey:["getDocumentListingGridMetaData",m.refID,g],queryFn:()=>A.fn(A.args)(g)}]);return b[1].isLoading||b[1].isFetching?e(wd,{}):b[1].isError?e("span",{children:b[1]?.error?.error_msg??"Unknown Error occured"}):t(f,{children:[b[0].isError?e(ft,{severity:"error",children:b[0]?.error?.error_msg??"Unknown Error occured"}):null,e(hu,{data:n(b[0].data??[]),finalMetaData:b[1].data,setData:()=>null,actions:i,setAction:r,loading:b[0].isFetching||b[0].isLoading,refetchData:()=>b[0].refetch(),defaultSortOrder:s,defaultGroupBy:l},"listingDocuments")]})});Kf.displayName="MyGridWrapper";const qf=({dataChangedRef:i,closeDialog:r,docUUID:n})=>{const{deleteDocuments:s,context:o}=a(jf),l=o.docCategory.filter(e=>!0===e.primary)[0].type,{enqueueSnackbar:h}=fr(),c=Vt((e=>async({docType:t,docUUID:i})=>e(t,i))(s.fn(s.args)),{onError:e=>{},onSuccess:e=>{i.current=!0,h("Documents successful deleted",{variant:"success"}),r()}});return t(f,{children:[c.isError?e(ft,{severity:"error",children:c?.error?.error_msg??"Unknown Error occured"}):null,c.isLoading?e(mt,{variant:"indeterminate"}):null,e(ut,{id:"alert-dialog-title",children:"Are you sure you want to delete the selected Records"}),t(At,{children:[e(ct,{onClick:r,color:"primary",disabled:c.isLoading,children:"No"}),e(ct,{color:"primary",onClick:()=>c.mutate({docType:l,docUUID:n}),disabled:c.isLoading,children:"Yes"})]})]})},Gf=({dataChangedRef:i,closeDialog:r,docUUID:n})=>{const{verifyDocuments:s,context:o}=a(jf),l=o.docCategory.filter(e=>!0===e.primary)[0].type,[h,c]=d(""),[u,A]=d(""),{enqueueSnackbar:p}=fr(),m=Vt((e=>async({docType:t,docUUID:i,remarks:r})=>e(t,i,r,"Verify"))(s.fn(s.args)),{onError:e=>{},onSuccess:e=>{i.current=!0,p("Documents Successfully verified",{variant:"success"}),r()}}),g=Vt((e=>async({docType:t,docUUID:i,remarks:r})=>e(t,i,r,"Rejected"))(s.fn(s.args)),{onError:e=>{},onSuccess:e=>{i.current=!0,p("Documents Successfully Rejected",{variant:"success"}),r()}}),w=g.isError||m.isError,b=g.isLoading||m.isLoading;let v=`${g?.error?.error_msg??""} ${m?.error?.error_msg??""}`;return v=Boolean(v.trimEnd().trimStart())?v:"unknown error occured",t(f,{children:[b?e(mt,{variant:"indeterminate"}):null,w?e(ft,{severity:"error",children:v}):null,e(ut,{id:"alert-dialog-title",children:"Document Verification"}),e(pt,{children:e(_t,{onChange:e=>c(e.target.value),multiline:!0,rows:4,maxRows:4,error:Boolean(u),helperText:u,fullWidth:!0,label:"Remarks",InputLabelProps:{shrink:!0}})}),t(At,{children:[e(ct,{onClick:r,color:"primary",children:"Cancel"}),e(ct,{color:"primary",onClick:()=>{Boolean(h)?m.mutate({docType:l,docUUID:n,remarks:h}):A("This is a required field")},disabled:b,children:"Verify"}),e(ct,{color:"primary",onClick:()=>{Boolean(h)?g.mutate({docType:l,docUUID:n,remarks:h}):A("This is a required filed")},disabled:b,children:"Reject"})]})]})},Wf=({row:{data:r,id:n},closeDialog:s,dataChangedRef:l})=>{const[c,u]=d(Array.isArray(r)?r:[r]),{updateDocument:A,getDocumentEditGridMetaData:p,context:f}=a(jf),m=f.docCategory.filter(e=>e.categoryCD===r.docCategory)[0].type,g=f.docCategory.filter(e=>!0===e.primary)[0].type,{addEntry:w}=a(bo),{enqueueSnackbar:b}=fr(),v=o(null);h(()=>{w(["getDocumentEditGridMetaData",f.moduleType,f.productType??"legal",m])},[w,f,m]);const y=zt(["getDocumentEditGridMetaData",f.moduleType,f.productType??"legal",m],()=>p.fn(p.args)(m)),B=Vt((e=>async({docType:t,data:i})=>e(t,i))(A.fn(A.args)),{onError:e=>{},onSuccess:e=>{l.current=!0,b("Document changes successful",{variant:"success"}),s()}});let C=`${y.error?.error_msg??"unknown message"}`;const x=y.isLoading?e(wd,{}):!0===y.isError?e("span",{children:C}):t(i,{children:[B.isError?e(ft,{severity:"error",children:B?.error?.error_msg??"Unknown Error occured"}):null,B.isLoading?e(mt,{variant:"indeterminate"}):null,e(ut,{id:"alert-dialog-title",children:"Update Documents"}),e(pt,{children:e(hu,{data:c??[],finalMetaData:y.data,setData:u,gridProps:f,ref:v,loading:B.isLoading},"listingDocumentsForUpdate")}),t(At,{children:[e(ct,{onClick:s,color:"primary",disabled:B.isLoading,children:"Cancel"}),e(ct,{color:"primary",onClick:async()=>{let{hasError:e,data:t}=await(v?.current?.validate?.());if(!0===e)u(t);else{let e=v?.current?.cleanData?.();await B.mutate({docType:g,data:e})}},disabled:B.isLoading,children:"Update"})]})]});return x},Jf=({onClose:t,editableFileName:i,dataChangedRef:r,currentAction:n})=>{const{uploadDocuments:s,getDocumentUploadAddtionalFieldsMetaData:o,context:l}=a(jf),c=l.docCategory.filter(e=>e.type===n)[0],d=c.type,u=c.categoryCD,A=l.docCategory.filter(e=>!0===e.primary)[0].type,{addEntry:p}=a(bo),{enqueueSnackbar:f}=fr();h(()=>{p(["getDocumentUploadAddtionalFieldsMetaData",l.moduleType,l.productType,d])},[l,p,d]);const m=zt(["getDocumentUploadAddtionalFieldsMetaData",l.moduleType,l.productType,d],()=>o.fn(o.args)(d));let g=`${m.error?.error_msg??"unknown error occured"}`;return m.isLoading?e(wd,{}):!0===m.isError?e("span",{children:g}):e(_u,{onClose:()=>{!0===r.current&&f("Documents Successfully uploaded",{variant:"success"}),t()},additionalColumns:m.data,editableFileName:i,dataChangedRef:r,onUpload:s.fn({...s.args,docCategory:A,categoryCD:u}),gridProps:{...l,docCategory:d},maxAllowedSize:12328960,allowedExtensions:"partner"===l.productType||["kyc","other"].indexOf(d)>=0?["pdf","jpg","jpeg","png"]:["pdf"]})},Xf=(e,t)=>{const i=document.createElement("a");i.href=String(e),i.download=t;const r=()=>{setTimeout(()=>{URL.revokeObjectURL(String(e)),i.removeEventListener("click",r)},150)};i.target="_blank",i.addEventListener("click",r,!1),i.click()},Yf=({docData:i,closeDialog:r,maxDownloadLimit:n=3})=>{const{generateDocumentDownloadURL:s,context:o}=a(jf),l=o.docCategory.filter(e=>!0===e.primary)[0].type,[c,u]=d("");return h(()=>{if(i.length>Number(n))u(`Cannot download more than ${n} files at a time`);else{if(1===i.length){const e=s.fn(s.args)(l,i.map(e=>e.id));Xf(e,i[0].name)}else if(i.length>1){const e=s.fn(s.args)(l,i.map(e=>e.id));Xf(e,`download-${(new Date).getUTCMilliseconds()}`)}r()}},[n,i,l,r,s]),Boolean(c)?t(f,{children:[e(ut,{children:c}),e(At,{children:e(ct,{onClick:()=>{u(""),r()},children:"Ok"})})]}):null},$f=({fileType:t,fileName:i,docUUID:r,closeDialog:n})=>t.indexOf("pdf")>=0||t.indexOf("image")>=0?e(Zf,{fileName:i,onClose:n,docUUID:r,fileType:t}):e(em,{onClose:n,fileName:i}),Zf=({fileName:i,onClose:r,docUUID:n,fileType:a})=>{const{loading:s,blob:l,error:c,success:d}=tm({docUUID:n,fileType:a}),u=o("");return d&&(u.current=URL.createObjectURL(l)),h(()=>{let e=u.current??"";return()=>{URL.revokeObjectURL(e)}},[]),t(f,{children:[t(At,{style:{display:"flex",padding:"8px 24px"},children:[e(vt,{variant:"h6",color:"textSecondary",children:"File:"}),e(vt,{variant:"h6",children:i}),e("div",{style:{flexGrow:1}}),d?e(C,{color:"primary",onClick:()=>xu(l,i),children:e(yt,{})}):null,"function"==typeof r?e(C,{color:"primary",onClick:r,children:e(Bt,{})}):null]}),e(pt,{children:s?e(wd,{}):Boolean(c)?e("span",{children:c}):e("iframe",{src:`${u.current}`,title:"Document View",style:{height:"100%",width:"100%"},"aria-label":"File Preview"})})]})},em=({onClose:i,fileName:r,message:n})=>t(f,{children:[t(At,{style:{display:"flex",padding:"8px 24px"},children:[e(vt,{variant:"h6",color:"textSecondary",children:"File:"}),e(vt,{variant:"h6",children:r}),e("div",{style:{flexGrow:1}}),"function"==typeof i?e(C,{color:"primary",onClick:i,children:e(Bt,{})}):null]}),e(pt,{children:n})]}),tm=({docUUID:e,fileType:t})=>{const[i,r]=d(!0),[n,s]=d(!1),[o,l]=d(""),{previewDocument:c,context:u}=a(jf),A=u.docCategory.filter(e=>!0===e.primary)[0].type,[p,f]=d(null);return h(()=>{c.fn(c.args)(A,e).then(e=>{if(e instanceof Error)l(e.message),r(!1),s(!1);else if("application/json"===e.type)e.text(e=>{l(e),r(!1),s(!1)});else{const i=new Blob([e],{type:t});f(i),s(!0),l(""),r(!1)}}).catch(e=>{l(e.message),r(!0),s(!1)})},[l,r,s,f,e,t,c,A]),{success:n,loading:i,error:o,blob:p}},im=({closeDialog:e})=>(h(()=>{e()},[e]),null),rm=[{actionName:"Verify",actionLabel:"Verify",multiple:!0,shouldExclude:e=>{let t=!1;for(let i=0;i<e.length;i++)if("Pending"!==e[i].data?.status){t=!0;break}return t}},{actionName:"View",actionLabel:"View",multiple:!1,rowDoubleClick:!0},{actionName:"Download",actionLabel:"Download",multiple:!0},{actionName:"Delete",actionLabel:"Delete",multiple:!0},{actionName:"Update",actionLabel:"Update",multiple:!1}],nm=({disableActions:i})=>{const{context:r}=a(jf),n=o(null);if(null===n.current){let e,t=r.docCategory.map(e=>({actionName:`Add_${e.type}`,actionLabel:e.label,multiple:void 0,alwaysAvailable:!0}));n.current=[...t,...rm],e="string"==typeof i?[i]:Array.isArray(i)?i:[],Array.isArray(e)&&(n.current=n.current.filter(t=>!(e.indexOf("Add")>=0&&t.actionName?.indexOf("Add")>=0)&&!(e?.indexOf(t.actionName)>=0)))}const[s,c]=d(null),u=o(null),A=o(!1),p=l(()=>{c(null),!0===A.current&&(u.current?.refetch?.(),A.current=!1)},[c]);h(()=>()=>{wo.removeQueries(["getBankListForLeadDocuments"],{exact:!1})},[]);let m=s?.name??"";return t(f,{children:[e(Kf,{ref:u,actions:n.current,setAction:c},"documentListing"),e(dt,{open:Boolean(s),maxWidth:"xl",PaperProps:{style:m.indexOf("Add")>=0||"View"===m?{width:"100%",height:"100%"}:"Verify"===m?{width:"40%"}:{}},children:m.indexOf("Add")>=0?e(Jf,{onClose:p,editableFileName:!1,dataChangedRef:A,currentAction:m.slice(m.indexOf("Add_")+4)}):"Update"===m?e(Wf,{row:s?.rows[0],closeDialog:p,dataChangedRef:A}):"Delete"===m?e(qf,{docUUID:s?.rows.map(e=>e.id),closeDialog:p,dataChangedRef:A}):"Verify"===m?e(Gf,{docUUID:s?.rows.map(e=>e.id),closeDialog:p,dataChangedRef:A}):"Download"===m?e(Yf,{closeDialog:p,docData:s?.rows.map(e=>({id:e.id,name:e.data?.fileName}))}):"View"===m?e($f,{closeDialog:p,docUUID:s?.rows[0]?.id,fileName:s?.rows[0]?.data?.fileName,fileType:s?.rows[0]?.data?.fileType}):e(im,{closeDialog:p})})]})},am=Ci(e=>({tabPanel:{borderTop:"0",padding:`${e.spacing(2)},0`,backgroundColor:"#fff"}})),sm=({value:e,index:t,children:i})=>Number(e)===Number(t)?i:null,om=({moduleType:i,productType:r,refID:n,serialNo:s,onClose:o,skipBankDetails:l=!1,readOnly:c})=>{const{addEntry:u}=a(bo),[A,p]=d(0),m=am();h(()=>{u(["getDocumentCRUDTabsMetadata",i,r??"legal",n])},[u,i,n]);const g=zt(["getDocumentCRUDTabsMetadata",i,r??"legal",n],()=>(async({moduleType:e,productType:t,refID:i})=>Boolean(t)?uf:df)({moduleType:i,productType:r,refID:n}));let w=g.data;g.isSuccess&&(Array.isArray(w)?(l&&(w=w.filter(e=>"Bank"!==e.label)),w=w.sort((e,t)=>e.sequence>t.sequence?1:e.sequence<t.sequence?-1:0),l&&(w=w.map((e,t)=>({...e,sequence:t})))):w=[]);return g.isLoading?e(wd,{}):g.isError?g.error?.error_msg??"unknown error occured":t(f,{children:[t("div",{style:{display:"flex"},children:[e(gr,{value:A,onChange:(e,t)=>{p(t)},variant:"scrollable",children:w.map(t=>e(wr,{label:t.label,id:`${t.sequence}`},t.sequence))}),"function"==typeof o?t(f,{children:[e("div",{style:{flexGrow:1}}),e(ct,{variant:"text",onClick:o,children:"Close"})]}):null]}),e("div",{className:m.tabPanel,children:w.map(t=>e(sm,{value:A,index:`${t.sequence}`,children:e(zf,{...Vf(i,r,t.docType,n,s),children:e(nm,{disableActions:c?["Add","Verify","Delete","Update"]:[]})},t.docType.filter(e=>!0===e?.primary)[0].type)},t.sequence))})]})},lm=({isDataChangedRef:r,successAction:n,readOnly:s,closeDialog:c,formStyle:d})=>{const{addEntry:u}=a(bo),{checkFormDataExist:A}=a(af),{insertFormData:p}=a(af),f=o(null);null===f.current&&(f.current=yo(Object.values(p.args)));let m=zt(["checkFormDataExist",f.current],()=>A.fn(A.args)());h(()=>{u(["checkFormDataExist",f.current])},[u]);const g=m.isFetching||m.isLoading,w=m.isError,b="YES"===m.data?.exists||(m.data,!1),v=l(()=>{"function"==typeof n&&(n(),m.refetch())},[]);return h(()=>{b&&"function"==typeof n&&v()},[b,v]),g?t(i,{children:[e(wd,{}),"function"==typeof c?e("div",{style:{position:"absolute",right:0,top:0},children:e(C,{onClick:c,children:e(pr,{})})}):null]}):w?t(i,{children:[t("div",{children:[m?.error?.error_msg??"Unknown error occured"," "]}),"function"==typeof c?e("div",{style:{position:"absolute",right:0,top:0},children:e(C,{onClick:c,children:e(pr,{})})}):null]}):b?null:e(hm,{successAction:v,isDataChangedRef:r,readOnly:s,closeDialog:c,formStyle:d})},hm=({successAction:t,isDataChangedRef:i,readOnly:r,closeDialog:n,formStyle:a})=>{const s=l(()=>{"function"==typeof n&&n()},[]);return r?e(ft,{severity:"info",children:"No Details Found"}):e(of,{isDataChangedRef:i,cancelAction:s,successAction:t,formStyle:a})},cm=({isDataChangedRef:t,closeDialog:i,dataAlwaysExists:r,readOnly:n,disableCache:a,formStyle:s})=>{const[o,l]=d(Boolean(r));return o?e(lf,{isDataChangedRef:t,closeDialog:i,readOnly:n,disableCache:a,formStyle:s}):e(lm,{isDataChangedRef:t,successAction:()=>l(!0),readOnly:n,closeDialog:i,formStyle:s})},dm=Ci({topScrollPaper:{alignItems:"flex-start"},topPaperScrollBody:{verticalAlign:"top"}}),um=[{actionName:"View",actionLabel:"View Details",multiple:!1,rowDoubleClick:!0},{actionName:"Delete",actionLabel:"Delete",multiple:!0,rowDoubleClick:!1},{actionName:"Add",actionLabel:"Add Detail",multiple:void 0,alwaysAvailable:!0}],Am=({isDataChangedRef:i,showDocuments:r,disableActions:n,setEditFormStateFromInitValues:s,secondaryProduct:l,secondaryProductDataExist:h,secondaryProductDisableCache:c,maxWidth:u="xl",dialogAlignTop:A=!1,formStyle:p,readOnly:m,detailsContextGenerator:g})=>{let w=o(null);if(null===w.current){let e;w.current=[...um],Boolean(r)&&w.current.push({actionName:"Document",actionLabel:"Document Details",multiple:!1,rowDoubleClick:!1}),Boolean(l)&&w.current.push({actionName:"Detail",actionLabel:"Master",multiple:void 0,alwaysAvailable:!0}),e="string"==typeof n?[n]:Array.isArray(n)?n:[],Array.isArray(e)&&(w.current=w.current.filter(t=>!(e?.indexOf(t.actionName)>=0)))}const[b,v]=d(null),y=o(null),B=o(!1),{context:C}=a(af),x=()=>{v(null),!0===B.current&&(i.current=!0,y.current?.refetch?.(),B.current=!1)},F=dm(),S={scrollPaper:F.topScrollPaper,paperScrollBody:F.topPaperScrollBody};return t(f,{children:[e(cf,{ref:y,actions:w.current,setAction:v},"grid"),e(dt,{open:Boolean(b),maxWidth:u,PaperProps:"Delete"===b?.name?{}:{style:{width:"100%",height:A?void 0:"100%"}},classes:A?S:{},children:"Add"===(b?.name??"")?e(of,{successAction:x,cancelAction:x,isDataChangedRef:B,formStyle:p}):"View"===(b?.name??"")?e(lf,{isDataChangedRef:B,closeDialog:x,serialNo:b?.rows[0]?.id,setEditFormStateFromInitValues:s,formStyle:p,readOnly:m}):"Delete"===(b?.name??"")?e(hf,{serialNo:b?.rows.map(e=>e.id),closeDialog:x,isDataChangedRef:B}):"Document"===(b?.name??"")?e(om,{refID:C?.refID,productType:C?.productType,moduleType:C?.moduleType,serialNo:b?.rows[0]?.id,onClose:x}):"Detail"===(b?.name??"")?e(sf,{...g(C?.moduleType,l,C?.refID),children:e(cm,{isDataChangedRef:B,dataAlwaysExists:h,closeDialog:x,readOnly:m,disableCache:c})}):e(im,{closeDialog:x})})]})},pm=n({}),fm=({children:t,getGridMetaData:i,getGridData:r})=>e(pm.Provider,{value:{getGridMetaData:i,getGridData:r},children:t}),mm=(e,t,i)=>({getGridData:{fn:t,args:{reqPara:i}},getGridMetaData:{fn:e,args:{reqPara:i}}}),gm=c(({dataGridKey:t,getAPIReqPara:i,actions:r,setAction:n,defaultSortOrder:s,defaultFilter:o,dataTransformer:c,autoRefreshInterval:d,enableExport:u,reportTemplateCode:A,variant:p,autoFetch:f,headerToolbarStyle:m,enableEnterToFocus:g,focusScopeId:w,onClickActionEvent:b,onDataChange:v,disableMultipleRowSelect:y=!1,defaultSelectedRowId:B="",handleClickAction:C},x)=>{const{getGridData:F,getGridMetaData:S}=a(pm),N=l(F.fn(F.args),[i]);return h(()=>()=>{wo.removeQueries(["gridMetaData",i])},[i]),e(NA,{ref:x,metaData:S.fn,gridCode:i,getGridData:N,actions:r,setAction:n,defaultSortOrder:s,defaultFilter:o,dataTransformer:c,autoRefreshInterval:d,enableExport:u,reportTemplateCode:A,variant:p,autoFetch:f,headerToolbarStyle:m,enableEnterToFocus:g,focusScopeId:w,onClickActionEvent:b,handleClickAction:C,onDataChange:v,disableMultipleRowSelect:y,defaultSelectedRowId:B},t)}),wm=c(({dataGridKey:t,metaData:i,getAPIFn:r=()=>{},getAPIReqPara:n,actions:a,setAction:s,defaultFilter:o,defaultSortOrder:l,dataTransformer:h,autoRefreshInterval:c,enableExport:d=!1,reportTemplateCode:u,variant:A,autoFetch:p,headerToolbarStyle:f={},enableEnterToFocus:m,focusScopeId:g="enter-to-focus-server-grid",onClickActionEvent:w,onDataChange:b=e=>{},disableMultipleRowSelect:v=!1,defaultSelectedRowId:y="",handleClickAction:B},C)=>e(fm,{...mm(i,r,n),children:e(gm,{dataGridKey:t,getAPIReqPara:n,actions:a,setAction:s,defaultFilter:o,defaultSortOrder:l,dataTransformer:h,ref:C,autoRefreshInterval:c,enableExport:d,reportTemplateCode:u,variant:A,autoFetch:p,headerToolbarStyle:f,enableEnterToFocus:m,focusScopeId:g,onClickActionEvent:w,handleClickAction:B,onDataChange:b,disableMultipleRowSelect:v,defaultSelectedRowId:y})})),bm=Ci(e=>({tabPanel:{border:"1px solid #e8e8e8",borderTop:"0",backgroundColor:"#fff",boxShadow:"0px 2px 1px -1px rgba(0,0,0,0.2), 0px 1px 1px 0px rgba(0,0,0,0.14), 0px 1px 3px 0px rgba(0,0,0,0.12)"}})),vm=xi(e=>({root:{textTransform:"none",minWidth:72,marginRight:e.spacing(4),opacity:1,color:e.palette.secondary.main,fontWeight:600,fontFamily:["Montserrat","Helvetica","Arial","Lucida","sans-serif"].join(","),"&:hover":{color:"#0063a3",opacity:1},"&$selected":{color:"#fff",fontWeight:"600",background:"var(--theme-color1)","&:active":{color:"#fff"}},"&:active":{color:"var(--theme-color1)"},"&:focus:not(:selected)":{color:"var(--theme-color1)"}},selected:{}}))(wr),ym=xi(e=>({root:{border:"2px solid #e8e8e8",background:"#fff",boxShadow:"0px 2px 1px -1px rgba(0,0,0,0.2), 0px 1px 1px 0px rgba(0,0,0,0.14), 0px 1px 3px 0px rgba(0,0,0,0.12)"},indicator:{background:"var(--theme-color1)",top:0}}))(gr),Bm=n(null),Cm=()=>{const e=a(Bm);if(!e)throw new Error("useSnackbarProviderWrapper must be used within a SnackbarProviderWrapper");return e.snackbarProps},xm=({children:t,...i})=>{const r=s(()=>({snackbarProps:i}),[i]);return e(Bm.Provider,{value:r,children:e(mr,{...i,children:t})})},Fm=Ci({topScrollPaper:{alignItems:"center"},topPaperScrollBody:{verticalAlign:"top"},title:{flex:"1 1 100%",color:"var(--white)",letterSpacing:"1px",fontSize:"1.5rem"}}),Sm=({metadata:i,ClosedEventCall:r,data:n,HeaderMetaData:a,HeaderData:l,ClickEventManage:h,children:c,isLoading:u=!1,isError:A=!1,ErrorMessage:p="",actions:f=[],setData:m=e=>{},setCurrentAction:g=e=>{},mode:w="view",isEditableForm:b=!1,refID:v={},onSubmit:y=()=>{},submitSecondAction:B=()=>{},submitSecondButtonName:C="",submitSecondButtonHide:x=!0,submitSecondLoading:F=!1,onFieldAction:S=(e,t,i)=>{},formComponentPropStyles:N={},dialogProps:E={},enableEnterToFocus:k,focusScopeId:T="enter-to-focus-detailsGrid"})=>{const{enableEnterToFocus:L}=ns(),I=Fm(),D=o(null),{t:U}=W(),[P,R]=d(""),O=()=>{r()},Q=s(()=>{let e=i.columns;return"view"===w&&(e=i.columns.filter(e=>"_hidden"!==e.accessor)),{...i,columns:e}},[w,i]);return e(dt,{open:!0,TransitionComponent:ph,PaperProps:{style:{width:"100%",minHeight:"20vh"}},maxWidth:"lg",classes:{scrollPaper:I.topScrollPaper,paperScrollBody:I.topPaperScrollBody},...E,children:t("div",{style:{padding:"10px"},children:[A?e(to,{severity:"error",errorMsg:p,errorDetail:"",color:"error"}):Boolean(P)?e(to,{errorMsg:P,errorDetail:"",severity:"error"}):null,Boolean(c)?"function"==typeof c?c({handelCloseEvent:O,handleSubmit:async()=>{let{hasError:e,data:t}=await(D.current?.validate());if(!0===e)m(t);else{let e=D?.current?.cleanData?.(),t=e.filter(e=>!(Boolean(e?._hidden)&&!Boolean(e?.lineNo))),i={...v,config:t};y({data:i,mode:w,setServerError:R})}},classes:I}):c:e(Ar,{position:"relative",color:"secondary",style:{marginBottom:"10px"},children:t(ai,{variant:"dense",children:[e(vt,{className:I.title,color:"inherit",variant:"h6",component:"div",children:U(a?.gridConfig?.title??"")}),e(ct,{onClick:O,color:"primary",children:U("Close")})]})}),e(Zp,{finalMetaData:a,onAction:h,loading:u,data:l??{},submitSecondAction:B,submitSecondButtonName:C,submitSecondButtonHide:x,submitSecondLoading:F,onFieldAction:S,propStyles:N,enableEnterToFocus:k??L,focusScopeId:T},"DetailsHeadersView"),e(hu,{finalMetaData:Q,data:n,setData:m,loading:b?"view"===w:u,actions:f,setAction:async e=>{await g(e)},refetchData:null,enableEnterToFocus:k??L,focusScopeId:T,ref:D},"customerDetailsGrid")]})})},Nm=t=>{const{row:i}=t;let r=`${Number(i.index)+1}`;return e(kc,{...t,children:r})},Em=t=>e("div",{children:"#"}),km=e=>t=>{e&&t.visibleColumns.push(e=>[{id:"sequence",Header:Em,Cell:Nm,width:5,maxWidth:5,minWidth:5},...e])},Tm=({globalFilter:t,setGlobalFilter:i,rowCount:r})=>{const[,n]=d(t),{t:a}=W(),s=qt(e=>i(e||void 0),200);return e(Ll,{type:"text",onChange:e=>{n(e.target.value),s(e.target.value)},placeholder:`${a("profile.Searchin")} ${r} ${a("records")}`})},Lm=Ci(e=>({root:{display:"flex",justifyContent:"left",flexWrap:"wrap",listStyle:"none",paddingLeft:e.spacing(2),paddingRight:e.spacing(2),margin:0,overflowX:"auto"},chip:{margin:e.spacing(.5)}})),Im=({dense:r,filters:n,setAllFilters:a})=>{const s=Lm(),{t:o}=W();return Array.isArray(n)&&n.length<=0?null:t(ai,{component:"ul",className:s.root,variant:r?"dense":"regular",children:[e("li",{children:t(vt,{variant:"h6",children:[o("RetrievalParameters")," : "]})}),n.map(t=>e(i,{children:Boolean(t?.value?.value)?e("li",{children:e(gi,{label:Dm(t?.value?.condition,o(t?.value?.columnName),t?.value?.value,o(t?.value?.label),t?.value?.displayValue),className:s.chip,variant:"outlined"})},t?.id):null}))]})},Dm=(e,t,i,r,n)=>{let a=Boolean(r)?r:t;switch(e){case"equal":return`${a} = ${Um(n??i)}`;case"between":return`${a} between ${Um(i[0])} and ${Um(i[1])}`;case"in":return`${a} in ${Pm(i,r)}`;case"contains":return`${a} like ${i}`;case"endsWith":return`${a} ends with ${i}`;case"startsWith":return`${a} starts with ${i}`;default:return`${a} : ${i}`}},Um=e=>{let t;return ys(e)&&(t=ze(new Date(e),"dd/MM/yyyy")),isNaN(t)?e:t},Pm=(e,t)=>Array.isArray(t)&&Array.isArray(e)&&e.length===t.length?JSON.stringify(t).replaceAll(/"/g," "):JSON.stringify(e).replaceAll(/"/g," "),Rm=({setQueryFilters:r,filterMeta:n,filterData:a,retrievalType:s,isOpenRetrievalDefault:l,setShowFilters:c=e=>{},setAllFilters:A=e=>{},retrievalComponent:p})=>{const[f,m]=d(l),g=o(a),{t:w}=W();h(()=>{document.addEventListener("keydown",e=>{!e.ctrlKey||"R"!==e.key&&"r"!==e.key||(e.preventDefault(),m(!0))})},[]);return e(Qi,{dateAdapter:Hi,children:t(i,{children:[Boolean(s)&&"function"==typeof p?e(i,{children:"CUSTOM"===s&&n?.fields?.length>0||"CUSTOM"!==s?e(ct,{onClick:()=>{m(!0),c(!1),A([])},color:"primary",children:w("RetrieveData")}):null}):e(i,{}),f&&s&&p&&"function"==typeof p?u(p,{classes:{},open:f,handleClose:()=>{m(!1)},loginState:{},defaultData:g.current,retrievalParaValues:(e,t)=>{r(e),m(!1),t&&(g.current=t)},retrievalType:s,metaData:n}):null]})})},Om=(e=[],t={})=>{switch(t.type){case"setValue":{const{id:i,...r}=t.payload;let n=e.findIndex(e=>e.id===i);return n>=0?(e[n].value=r,[...e]):[...e,{id:i,value:r}]}case"removeValue":{const{id:i}=t.payload;return e.filter(e=>e.id!=i)}case"resetAll":return[];default:return e}},Qm=({setQueryFilters:i,filterMeta:r,filterData:n,retrievalWindowOpen:a=!1})=>{const{t:s}=W(),[h,c]=d(a),{filterState:A,dispatch:p}=(e=>{const t=o([]);return{dispatch:l(i=>{let r=e(t.current,i);t.current=r},[]),filterState:t}})(Om),f=()=>{c(!1)};let m=[];return Array.isArray(r)&&(m=r.filter(e=>"function"==typeof e.Filter),m=m.map(e=>{const{Filter:t,accessor:i,...r}=e;return u(t,{key:i,filterValue:n.filter(e=>e.id===i)?.[0]?.value,id:i,dispatch:p,...r})})),t(Qi,{dateAdapter:Hi,children:[e(Y,{onClick:()=>{c(!0)},color:"primary",children:"Retrieve Data"}),t(Be,{anchor:"right",id:"columnVisibility",open:h,onClose:f,PaperProps:{style:{width:"520px"}},children:[e(Ce,{position:"relative",color:"secondary",children:t(xe,{variant:"dense",children:[e(X,{variant:"h6",children:s("Filter")}),e("div",{style:{flexGrow:1}}),e(Y,{onClick:()=>{i(A.current),c(!1)},color:"primary",children:s("Apply")}),e(Y,{onClick:()=>{i([]),c(!1)},color:"primary",children:s("Clear")}),e(Y,{onClick:f,color:"primary",children:s("Close")})]})}),e(me,{children:e(ge,{container:!0,spacing:2,children:m})})]})]})},Hm=({dateRange:i,setDateRange:r,columnFormat:n="dd/MM/yyyy HH:mm:ss",setIsError:a,isDate:s})=>{let o=s?Ho:_o;const[l,h]=d({from:"",to:""}),c=(e,t)=>{let i=!1;const r={from:"",to:""};return e instanceof Date&&!isNaN(e?.getTime())||(r.from=Ge("Mustbeavaliddate"),i=!0),t instanceof Date&&!isNaN(t?.getTime())||(r.to=Ge("Mustbeavaliddate"),i=!0),e instanceof Date&&t instanceof Date&&e>t&&(r.from=Ge("FromDateshouldbelessthanorequaltoToDate"),r.to=Ge("ToDateshouldbegreaterthanorequaltoFromDate"),i=!0),h(r),a(i),!i};return t(be,{spacing:1,children:[e(o,{format:n,value:i.from??new Date,label:Ge("From")??"From",views:s?["year","month","day"]:["year","month","day","hours","minutes","seconds"],onChange:e=>{const t=e instanceof Date&&!isNaN(e?.getTime())?e:null,n={...i,from:t};c(t,i.to)&&r(n)},slots:{textField:Ao},slotProps:{textField:{error:!!l.from,helperText:l.from},actionBar:{actions:["today","accept","cancel"]}},sx:{width:"100%",mb:1}}),e(o,{format:n,label:Ge("To")??"To",value:i.to??new Date,views:s?["year","month","day"]:["year","month","day","hours","minutes","seconds"],onChange:e=>{const t=e instanceof Date&&!isNaN(e?.getTime())?e:null,n={...i,to:t};c(i.from,t)&&r(n)},slots:{textField:Ao},slotProps:{textField:{error:!!l.to,helperText:l.to},actionBar:{actions:["today","accept","cancel"]}},sx:{width:"100%"}})]})},Mm=({dateValue:t,setDateValue:i,columnFormat:r="dd/MM/yyyy HH:mm:ss",setIsError:n,isDate:a})=>{const[s,o]=d("");return e(a?Ho:_o,{format:r??"dd/MM/yyyy HH:mm:ss",value:t??new Date,views:a?["year","month","day"]:["year","month","day","hours","minutes","seconds"],onChange:e=>{if(!Ve(e))return o(Ge("Mustbeavaliddate")??""),void n(!0);o(""),n(!1),i(e instanceof Date?e:new Date)},slots:{textField:Ao},slotProps:{textField:{error:Boolean(s),helperText:s,sx:{"& .MuiInputBase-root":{margin:"0 !important"}}},actionBar:{actions:["today","accept","cancel"]}},sx:{width:"100%",mb:1}})},_m=(e,t)=>ze(new Date(e),t??"dd/MM/yyyy HH:mm:ss"),jm=e=>e instanceof Date&&!isNaN(e.getTime())?new Date(e.getFullYear(),e.getMonth(),e.getDate()):null,zm=(e,t,i)=>{const{type:r,value:n}=i;return null==n||""===n||Array.isArray(n)&&0===n.length?e:e.filter(i=>{const a=""===i.values[t]?.trim()&&"multi-select"===r?"(Blanks)":i.values[t];if("multi-select"===r)return n.includes(a);if("Before"===r||"After"===r||"Equal (Date)"===r||"Equal (Date & Time)"===r||"Between (Date)"===r||"Between (Date & Time)"===r||"Today"===r||"Yesterday"===r||"This Week"===r||"Last Week"===r||"This Month"===r||"Last Month"===r){const e=new Date(a),t=Array.isArray(n)?[new Date(n[0]),new Date(n[1])]:new Date(n);if(isNaN(e.getTime())||(Array.isArray(t)?t.some(e=>isNaN(e.getTime())):isNaN(t.getTime())))return!1;switch(r){case"Before":return e<t;case"After":return e>t;case"Equal (Date)":return!Array.isArray(t)&&jm(e)?.toLocaleString()===jm(t)?.toLocaleString();case"Equal (Date & Time)":return!Array.isArray(t)&&e.toLocaleString()===t.toLocaleString();case"Between (Date)":const[i,r]=Array.isArray(t)?t:[];return!(!i||!r)&&(jm(e)>=jm(i)&&jm(e)<=jm(r));case"Between (Date & Time)":const[n,a]=Array.isArray(t)?t:[];return!(!n||!a)&&(e>=n&&e<=a);case"Today":{const t=new Date;return jm(e)?.getTime()===jm(t)?.getTime()}case"Yesterday":{const t=new Date;return t.setDate(t.getDate()-1),jm(e)?.getTime()===jm(t)?.getTime()}case"This Week":{const t=new Date,i=jm(new Date(t.setDate(t.getDate()-t.getDay()))),r=new Date(i);r.setDate(i.getDate()+6);const n=jm(e);return!!n&&n>=i&&n<=jm(r)}case"Last Week":{const t=new Date,i=jm(new Date(t.setDate(t.getDate()-t.getDay()-7))),r=new Date(i);r.setDate(i.getDate()+6);const n=jm(e);return!!n&&n>=i&&n<=jm(r)}case"This Month":{const t=new Date,i=jm(new Date(t.getFullYear(),t.getMonth(),1)),r=jm(new Date(t.getFullYear(),t.getMonth()+1,0)),n=jm(e);return!!n&&n>=i&&n<=r}case"Last Month":{const t=new Date,i=jm(new Date(t.getFullYear(),t.getMonth()-1,1)),r=jm(new Date(t.getFullYear(),t.getMonth(),0)),n=jm(e);return!!n&&n>=i&&n<=r}default:return!0}}const s=a?.toString().toLowerCase(),o=n?.toString().toLowerCase();switch(r){case"Contains":return s.includes(o);case"Starts With":return s.startsWith(o);case"Ends With":return s.endsWith(o);case"Equal":return s===o;case"Not Equal":return s!==o;case"Empty":return""===s;case"Not Empty":return""!==s;case"Greater Than":return parseFloat(a)>parseFloat(n);case"Less Than":return parseFloat(a)<parseFloat(n);case"Greater Than or Equal To":return parseFloat(a)>=parseFloat(n);case"Less Than or Equal To":return parseFloat(a)<=parseFloat(n);case"Does not contain":return!s.includes(o);case"Between":const i=o.split(",")?.map(e=>parseFloat(e)),r=parseFloat(a);return r>=i[0]&&r<=i[1];case"Above Average":const l=e.reduce((e,i)=>e+parseFloat(i.values[t]),0)/e.length;return parseFloat(a)>l;case"Below Average":const h=e.reduce((e,i)=>e+parseFloat(i.values[t]),0)/e.length;return parseFloat(a)<h;default:return!0}})},Vm=({amtRange:i,setAmtRange:r,setIsError:n})=>{const{dynamicAmountSymbol:a,decimalCount:s,dynamicAmountGroupStyle:o}=ns(),[l,h]=d({from:"",to:""}),c=(e,t)=>{let i=!1;const r={from:"",to:""},a=parseFloat(e),s=parseFloat(t);isNaN(a)||isNaN(s)||a>s&&(r.from="'From' value must be less than 'To' value",r.to="'To' value must be greater than 'From' value",i=!0),h(r),n(i)};return t(be,{spacing:1.5,children:[t("div",{children:[e(rl,{FormatProps:{thousandSeparator:!0,prefix:"",thousandsGroupStyle:o,allowNegative:!0,allowLeadingZeros:!1,decimalScale:s,fixedDecimalScale:!0,placeholder:"From amount",isAllowed:e=>e?.value?.length<=15,value:i.from,onValueChange:e=>{if(!isNaN(Number(e.value))){const t=e.value;r(e=>{const i={...e,from:t};return c(t,e.to),i})}}},enableGrid:!1,fieldKey:"FromAmount",name:"from-amount",StartAdornment:$o(a),className:"textInputFromRight",maxLength:15,showMaxLength:!1,textFieldStyle:{width:"100%","& .MuiInputBase-root":{margin:"0 !important"}}}),l.from?e(le,{error:!0,sx:{mt:0},children:l.from}):null]}),t("div",{children:[e(rl,{FormatProps:{thousandSeparator:!0,prefix:"",thousandsGroupStyle:o,allowNegative:!0,allowLeadingZeros:!1,decimalScale:s,fixedDecimalScale:!0,placeholder:"To amount",isAllowed:e=>e?.value?.length<=15,value:i.to,onValueChange:e=>{if(!isNaN(Number(e.value))){const t=e.value;r(e=>{const i={...e,to:t};return c(e.from,t),i})}}},enableGrid:!1,fieldKey:"ToAmount",name:"to-amount",StartAdornment:$o(a),className:"textInputFromRight",maxLength:15,showMaxLength:!1,textFieldStyle:{width:"100%",".MuiInputBase-root":{margin:"0 !important"}}}),l.to?e(le,{error:!0,sx:{mt:0},children:l.to}):null]})]})},Km=({inputValue:t,setInputValue:i})=>{const{dynamicAmountSymbol:r,decimalCount:n,dynamicAmountGroupStyle:a}=ns();return e(rl,{FormatProps:{thousandSeparator:!0,prefix:"",thousandsGroupStyle:a,allowNegative:!0,allowLeadingZeros:!1,decimalScale:n,fixedDecimalScale:!0,placeholder:"Enter a value",isAllowed:e=>!(e?.value?.length>15),value:t,onValueChange:e=>{isNaN(Number(e.value))||i(String(e.value))}},enableGrid:!1,fieldKey:"Amount",name:"amount",StartAdornment:$o(r),className:"textInputFromRight",maxLength:15,showMaxLength:!1,textFieldStyle:{width:"100%",".MuiInputBase-root":{margin:"0 !important"}}})},qm={text:["Contains","Starts With","Ends With","Equal","Not Equal","Does not contain"],number:["Equal","Greater Than","Greater Than or Equal To","Less Than","Less Than or Equal To","Not Equal","Between","Above Average","Below Average"],date:["Equal (Date)","Equal (Date & Time)","Before","After","Between (Date)","Between (Date & Time)","Yesterday","Today","This Week","Last Week","This Month","Last Month"],dropdown:["Equal","Not Equal"]},Gm=({column:r,filters:n,enableEnterToFocus:a})=>{const{id:c,columnName:u,columnFormat:A,filterType:p,Cell:f,options:m,filterValue:g,setFilter:w,preFilteredRows:b,alignment:v}=r,[y,B]=d(null),[C,x]=d(0),[F,S]=d(()=>(qm[p||"text"]||[])[0]),[N,E]=d(!1),[k,T]=d(""),[L,I]=d(new Date),[D,U]=d({from:new Date,to:new Date}),[P,R]=d({from:"",to:""}),[O,Q]=d(""),[H,M]=d([]),_=o({dateValue:L,dateRange:D,amtRange:P,inputValue:k,selectedOption:F,selectedValues:H,search:O}),j=Boolean(y),z=f===Tc||f===Lc?"date":f===Vc?"number":p||"text",V=qm[z]||[],K=()=>{N&&(R({from:"",to:""}),E(!1)),B(null),M(_.current.selectedValues),I(_.current.dateValue),U(_.current.dateRange),R(_.current.amtRange),T(_.current.inputValue),S(_.current.selectedOption),Q(_.current.search)},q=s(()=>{const e=new Set;b?.forEach(t=>{e.add(""===t.values[c]?.trim()?"(Blanks)":t.values[c])});const t=Array.from(e).filter(e=>e?.toString().toLowerCase().includes(O.toLowerCase()));return t.includes("(Blanks)")?[...t.filter(e=>"(Blanks)"!==e),"(Blanks)"]:t},[b,c,O]),G=s(()=>{const e={};return b?.forEach(t=>{const i=""===t.values[c]?.trim()?"(Blanks)":t.values[c],r=String(i??"");e[r]=(e[r]||0)+1}),e},[b,c]);h(()=>{const e=(qm[z]||[])[0];S(e)},[z]),h(()=>{n.length||(_.current={dateValue:new Date,dateRange:{from:new Date,to:new Date},amtRange:{from:"",to:""},inputValue:"",selectedOption:(qm[z]||[])[0],selectedValues:[],search:""},M([]),T(""),I(new Date),U({from:new Date,to:new Date}),R({from:"",to:""}),Q(""),S((qm[z]||[])[0]))},[n,z]);const W=l(()=>{if(!g)return"";if("multi-select"===g.type&&"date"===z&&Array.isArray(g.value)){const e=g.value.map(e=>_m(e,A));return`${Ge("Filtered")}: ${e.join(", ")}`}return"multi-select"===g.type&&Array.isArray(g.value)?`${Ge("Filtered")}: ${g.value.join(", ")}`:"date"===z&&Array.isArray(g.value)?`${g.type}: ${_m(g.value[0],g.type.includes("Time")?A:A?.split(" ")[0]??"dd/MM/yyyy")} - ${_m(g.value[1],g.type.includes("Time")?A:A?.split(" ")[0]??"dd/MM/yyyy")}`:"date"===z&&g.value instanceof Date?`${g.type}: ${_m(g.value,g.type.includes("Time")?A:A?.split(" ")[0]??"dd/MM/yyyy")}`:"number"===z&&F.includes("Average")?g.type:`${g.type}: ${g.value}`},[g,z,F,A]);return f===jc?null:t(i,{children:[e(de,{size:"small",onClick:e=>{g||"date"!==z||(I(new Date),U({from:new Date,to:new Date}),R({from:"",to:""})),B(e.currentTarget)},sx:{...r.canGroupBy?{}:{ml:"right"!==v?"auto":0,mr:"right"===v?"auto":0}},children:e(ne,g?{disableInteractive:!0,title:g?e(oe,{sx:{p:.5},children:e(X,{variant:"caption",sx:{fontWeight:600,color:"var(--theme-color1)",fontSize:"0.75rem"},children:W()})}):"",arrow:!0,disableHoverListener:!g,componentsProps:{tooltip:{sx:{backgroundColor:"var(--theme-color2)",color:"var(--theme-color1)",fontSize:"0.75rem",borderRadius:1.5,boxShadow:4,maxWidth:240,whiteSpace:"normal"}},arrow:{sx:{color:"var(--theme-color2)"}}},children:e(Cr,{fontSize:"small",style:{color:"var(--theme-color1)"}})}:{title:Ge("AdvanceFilter"),disableInteractive:!0,children:e(Br,{fontSize:"small"})})}),e(Fe,{open:j,anchorEl:y,onClose:K,onKeyDown:e=>{a&&Es(e)},children:t(oe,{p:2,width:300,children:[e(X,{variant:"subtitle2",mb:1,children:u}),t(ym,{value:C,onChange:(e,t)=>x(t),variant:"fullWidth",TabIndicatorProps:{style:{display:"none"}},sx:{border:"none !important",boxShadow:"none !important",backgroundColor:"transparent !important",minHeight:0,"& .MuiTabs-flexContainer":{gap:1},"& .MuiTab-root":{minHeight:30,padding:"4px 12px",borderRadius:"20px",fontSize:"0.75rem",fontWeight:600}},children:[e(vm,{label:Ge("FilterByValue"),style:{padding:0,margin:0,borderRadius:"10px"}}),e(vm,{label:Ge("FilterByCondition"),style:{padding:0,margin:0,borderRadius:"10px"}})]}),0===C&&t(be,{spacing:1,mt:2,children:[e(Ao,{size:"small",placeholder:Ge("Search")??"Search...",value:O,onChange:e=>Q(e.target.value),fullWidth:!0,InputProps:{sx:{marginTop:"0px !important"}}}),e(oe,{sx:{maxHeight:200,overflowY:"auto",border:"1px solid #ccc",p:1,borderRadius:1},children:e(Wm,{uniqueValues:q,selectedValues:H,setSelectedValues:M,valueCounts:G,Cell:f,column:r,type:z})})]}),1===C&&t(be,{spacing:2,mt:2,children:[e(Se,{value:F,onChange:e=>S(e.target.value),size:"small",fullWidth:!0,children:V.map(t=>e(Ne,{value:t,children:t},t))}),"date"===z?e(hr,{dateAdapter:Hi,children:"Between (Date)"===F||"Between (Date & Time)"===F?e(Hm,{dateRange:D,setDateRange:U,columnFormat:"Between (Date)"===F?A?.split(" ")[0]??"dd/MM/yyyy":A,setIsError:E,isDate:"Between (Date)"===F}):["Equal (Date)","Equal (Date & Time)","Before","After"].includes(F)?e(Mm,{dateValue:L,setDateValue:I,columnFormat:"Equal (Date)"===F?A?.split(" ")[0]??"dd/MM/yyyy":A,setIsError:E,isDate:"Equal (Date)"===F}):null}):"dropdown"===z&&m?.length?e(Se,{value:k,onChange:e=>T(e.target.value),size:"small",fullWidth:!0,children:m.map(t=>e(Ne,{value:t,children:t},t))}):e(i,{children:"number"===z?e(i,{children:"Between"===F?e(Vm,{amtRange:P,setAmtRange:R,setIsError:E}):e(i,{children:F.includes("Average")?null:e(Km,{inputValue:k,setInputValue:T})})}):e(Ao,{size:"small",placeholder:"Enter value",value:k,type:"number"===z?"number":"text",onChange:e=>T(e.target.value),fullWidth:!0,InputProps:{sx:{marginTop:"0px !important"}}})})]}),t(be,{direction:"row",spacing:1,justifyContent:"flex-end",mt:2,children:[e(eo,{variant:"contained",size:"small",onClick:()=>{_.current={dateValue:new Date,dateRange:{from:new Date,to:new Date},amtRange:{from:"",to:""},inputValue:"",selectedOption:(qm[z]||[])[0],selectedValues:[],search:""},M([]),T(""),I(new Date),U({from:new Date,to:new Date}),R({from:"",to:""}),w(void 0),K()},children:Ge("Clear")}),e(eo,{variant:"contained",size:"small",onClick:()=>{if(_.current={dateValue:L,dateRange:D,amtRange:P,inputValue:k,selectedOption:F,selectedValues:H,search:O},0===C)Array.isArray(H)&&H?.length>0&&w({type:"multi-select",value:H});else if(!N){let e;if("date"===z?"Between (Date)"===F||"Between (Date & Time)"===F?e=[D.from,D.to]:e=["Yesterday","Today","This Week","Last Week","This Month","Last Month"].includes(F)?(e=>{const t=new Date,i=new Date(t);i.setDate(t.getDate()-t.getDay());const r=new Date(i);r.setDate(i.getDate()+6);const n=new Date(i);n.setDate(n.getDate()-7);const a=new Date(n);a.setDate(n.getDate()+6);const s=new Date(t.getFullYear(),t.getMonth(),1),o=new Date(t.getFullYear(),t.getMonth()+1,0),l=new Date(t.getFullYear(),t.getMonth()-1,1),h=new Date(t.getFullYear(),t.getMonth(),0);switch(e){case"Yesterday":const e=new Date;return e.setDate(t.getDate()-1),e;case"Today":return t;case"This Week":return[i,r];case"Last Week":return[n,a];case"This Month":return[s,o];case"Last Month":return[l,h];default:return null}})(F):L:e="Between"===F?[P.from,P.to]:F.includes("Average")?F:k,Array.isArray(e)){const[t,i]=e;t&&i&&w({type:F,condition:F?.toLowerCase(),value:e})}else e&&w({type:F,condition:F?.toLowerCase(),value:e,showType:F.includes("Average")})}K()},children:Ge("Apply")})]})]})})]})},Wm=({uniqueValues:i,selectedValues:r,setSelectedValues:n,valueCounts:a,Cell:s,column:o,type:l,height:h=144})=>{const c=i.length>0&&i.every(e=>r.includes(e));return t(be,{direction:"column",spacing:1,children:[e(ae,{control:e(go,{checked:c,indeterminate:r.length>0&&!c,color:"secondary",onChange:()=>{n(c?[]:[...i])}}),label:e(X,{sx:{fontWeight:"bold"},children:Ge("SelectAll")}),sx:{mx:0,pb:1,borderBottom:"1px solid #eee"}}),e(Ei,{height:i.length?h:0,itemCount:i.length,itemSize:30,width:"100%",children:({index:h,style:c})=>{const d=i[h];return e("div",{style:c,children:e(ae,{control:e(go,{checked:r.includes(d),onChange:()=>(e=>{r.includes(e)?n(r.filter(t=>t!==e)):n([...r,e])})(d),sx:{p:.5}}),sx:{width:"100%",alignItems:"center",mx:0,my:.5},label:t(oe,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",pr:1},children:[e(X,{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"0.875rem"},children:"function"==typeof s&&"text"!==l?s({value:d,column:o,isAdvanceFilter:!0}):d?.toString()}),t(X,{sx:{fontSize:"0.75rem",color:"#888",marginLeft:1,flexShrink:0},children:["(",a[String(d??"")]||0,")"]})]})})},d?.toString())}})]})},Jm=({footerGroup:t,loading:i})=>e(hi,{...t.getFooterGroupProps(),component:"div",children:t.headers.map(t=>e(ci,{...t.getFooterProps([{style:{textAlign:t?.alignment??"unset",display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"0px 20px 0px 10px",lineHeight:"34px",backgroundColor:"var(--theme-color2)"}}]),component:"div",children:t.render("Footer",{loading:i})}))}),Xm=({footerGroup:t})=>e("div",{style:{backgroundColor:"var(--theme-color2)"},children:e(hi,{...t.getFooterGroupProps(),children:e("div",{children:t.headers.map(t=>e("span",{style:{textAlign:t?.alignment??"unset",display:"flex",gap:"3rem",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",lineHeight:"34px",marginLeft:"10px",fontWeight:"500"},children:t.render("Footer1")},t.id))})})}),Ym=({columns:r,defaultColumn:n,data:a,maxHeight:c=300,containerHeight:u,occupiedHeight:A,initialState:p={},filterTypes:m,title:g,options:w,loading:b=!1,hideFooter:v=!1,showSerialNoColumn:y=!1,onClose:B=null,setQueryFilters:x,filterMeta:F,queryFilters:S,hideAmountIn:N,retrievalType:E,onButtonActionHandel:k,isOpenRetrievalDefault:T,hideHeader:L=!1,hideShowFiltersSwitch:I,hideStatusBar:D,refetchData:U,pageSizes:P=[20,30,40],totalRecords:R=0,defaultPageSize:O=20,defaultSortOrder:Q=[],defaultHiddenColumns:H=[],enablePagination:M=!1,retrievalComponent:_,openDrawerFilter:j,onDoubleClickAction:z,enablePdfPrint:V,reportTemplateCode:K,enablePivot:q,actions:G,getReportData:J,disableFilters:X,headerToolbarStyle:Y,enableEnterToFocus:Z,expandAllGroupedRows:ee})=>{const te=s(()=>r.some(e=>e.isDisplayValueTotal),[r]),ie=s(()=>r.some(e=>e.isTotalWithCurrency||e.isTotalWithoutCurrency),[r]),[re,ne]=d(!1),[ae,se]=d(!1),{t:oe}=W(),{disableColumnFilters:le}=ns(),he=s(()=>r.map(e=>({...e,disableFilters:e?.disableFilters??X??le??!1,filter:zm})),[r,X,le]),ce=Gt({columns:he,data:a,defaultColumn:n,filterTypes:m,onButtonActionHandel:k,autoResetGlobalFilter:!1,autoResetFilters:!1,autoResetGroupBy:!1,autoResetExpanded:!1,autoResetSortBy:!1,globalFilter:(e,t,i)=>((e,t,i,r)=>{const n=i.toLowerCase();return e.filter(e=>t.some(t=>{const i=r.find(e=>e.accessor===t),a=e.values[t];return!ys(a)||i?.Cell!==Tc&&i?.Cell!==Lc&&i?.Cell!==qc?String(a).toLowerCase().includes(n):ze(new Date(a),i.format??"dd/MM/yyyy hh:mm:ss a").toLowerCase().includes(n)}))})(e,t,i,r),initialState:{pageIndex:0,pageSize:O,hiddenColumns:H,sortBy:Q,...p},...w},Wt,ri,Xt,Yt,$t,ti,ii,km(y),k),{getTableProps:de,getTableBodyProps:ue,headerGroups:Ae,footerGroups:pe,rows:fe,prepareRow:me,totalColumnsWidth:ge,toggleAllRowsExpanded:we,isAllRowsExpanded:be,setAllFilters:ve,setGlobalFilter:ye,preGlobalFilteredRows:Be,gotoPage:Ce,setPageSize:xe,state:{filters:Fe,globalFilter:Se,pageIndex:Ne,pageSize:ke},filteredRows:Te}=ce;h(()=>{ee&&setTimeout(()=>{we(!0)},0)},[we,ee,b]),h(()=>{"function"==typeof J&&J(Fe,S,Se,a,fe?.map(e=>e.values))},[Fe,S,Se,a,fe]),h(()=>{ve([])},[S]);const Le=l(t=>{let{index:i,style:r}=t;const n=fe[i];return me(n),n?.isGrouped&&n?.isExpanded&&(r={...r,backgroundColor:"rgba(0, 0, 0, 0.04)"}),e(hi,{...n.getRowProps({style:r}),component:"div",onDoubleClick:()=>{"function"==typeof z&&z({row:[{data:n?.original,id:n?.id}]})},children:n.cells.map((e,t)=>e.isAggregated?e.render("Aggregated"):e.render("Cell",{index:t}))})},[me,fe]),Ie=s(()=>Te?.length,[Te]),De=s(()=>{if(!u||!A)return{min:"73.5vh",max:"73.5vh"};const e=e=>{const t=Array.isArray(S)&&S.length>0?`calc(${u?.[e]} - 48px)`:u?.[e];return t&&A?.[e]?`calc(${t} - ${A?.[e]})`:t};return{min:e("min"),max:e("max")}},[S,u,A]),Ue=o(null),[Pe,Re]=d({min:700,max:700});return h(()=>{if(!Ue.current)return;const e=()=>{const e=Ue.current,t=getComputedStyle(e),i=parseFloat(t.minHeight),r=parseFloat(t.maxHeight);Re({min:i,max:r})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[fe,u,A]),t(f,{children:[t(ni,{style:{width:"100%",overflow:"hidden",marginBottom:"8px",display:L?"none":"inherit"},className:"not-printed",children:[t(ai,{className:"static__report__header",variant:"dense",sx:{width:"100%",background:"var(--primary-bg)",...Y},children:[e(vt,{variant:"h5",color:"primary",children:g.trim()}),e("div",{style:{flexGrow:1}}),j?e(Qm,{setQueryFilters:x,filterMeta:F,filterData:S,retrievalWindowOpen:T}):e(Rm,{setQueryFilters:x,filterMeta:F,filterData:S,retrievalType:E,isOpenRetrievalDefault:T,retrievalComponent:_}),Fe.length>0&&e(ct,{onClick:()=>{ve([])},style:{marginRight:"8px",color:"white"},children:oe("ClearFilter")}),"function"==typeof U?e(Wo,{title:oe("Refetch"),children:e(C,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true",onClick:()=>U(),color:"primary",children:e(ki,{})})}):null,e(Tm,{setGlobalFilter:ye,globalFilter:Se,rowCount:Ie}),Boolean(N)?null:e(Hc,{}),fe?.length>0?e(i,{children:Ae.some(e=>e.headers.some(e=>!0===e.isGrouped))?e(Ye,{control:e(It,{onChange:()=>we(!be),checked:be,name:"filters",size:"small",color:"primary"}),style:{color:"var(--white)"},label:oe("ExpandRows")}):e(Ye,{control:e(Wo,{title:oe("Showexportoptions"),arrow:!0,children:t(eo,{onClick:()=>{se(!0)},style:{marginTop:"0px",color:"white"},eventKey:"x",shortcut:"alt",children:[oe("Export")," ",e(Ki,{})]})}),style:{color:"var(--white)"},label:""})}):null,!b&&q?e(Ye,{control:e(Wo,{title:oe("Open Pivot Table"),arrow:!0,children:t(ct,{onClick:()=>ne(!0),style:{marginTop:"0px",color:"white"},children:[oe("Pivot")," ",e(yr,{})]})}),style:{color:"var(--white)"},label:""}):null,G?.map((t,i)=>e(eo,{sx:{minWidth:"60px",...t.buttonStyle},disabled:b,onClick:e=>"function"==typeof t.callback&&t.callback(e,a,fe?.map(e=>e.values),Te?.map(e=>e.values)),enableShortcut:t?.enableShortcut??!0,shortcut:t?.shortcut,eventKey:t?.eventKey,children:t.buttonName},i)),"function"==typeof B?e(Wo,{title:oe("Close"),arrow:!0,children:e(C,{onClick:B,size:"small",children:e(Bt,{style:{color:"var(--white)"}})})}):null]}),D?null:e(Im,{dense:!0,setAllFilters:x,filters:S})]}),b&&e(mt,{color:"secondary"}),t(ni,{style:{width:"100%",overflow:"hidden"},tabIndex:0,children:[e(si,{ref:Ue,sx:{position:"relative",maxHeight:De.max,minHeight:De.min},children:t(oi,{...de(),size:"small",component:"div",children:[e(li,{component:"div",children:Ae.map(i=>e(hi,{...i.getHeaderGroupProps(),component:"div",children:i.headers.map((i,r)=>t(ci,{...i.getHeaderProps([{style:{display:"flex",padding:0===r?"0 10px":"0px 10px 0 0",alignItems:"center"}}]),component:"div",align:i.alignment,children:[i.render("Header"),i.canFilter&&e(Gm,{column:i,filters:Fe,enableEnterToFocus:Z})]}))}))}),e(di,{...ue({}),component:"div",children:e(Ei,{height:(()=>{const e=Pe?.min??c;return ie?fe.length<=0?e-72:te?e-110:e-72:te&&fe.length?e-72:e-38})(),itemCount:fe.length,itemSize:35,width:ge+10,overscanCount:10,children:Le})}),fe.length<=0&&!1===b?e("div",{style:{justifyContent:"center",fontStyle:"italic",color:"rgba(133, 130, 130, 0.8)",position:"absolute",left:"50%",top:"50%"},children:oe("Nodatafound")}):null,t(li,{component:"div",style:{boxShadow:"0px 5px 5px -3px rgba(0,0,0,0.2),0px 8px 10px 1px rgba(0,0,0,0.14),0px 3px 14px 2px rgba(0,0,0,0.12)"},children:[e(Jm,{footerGroup:pe[0],loading:b}),e(Xm,{footerGroup:pe[0]})]})]})}),v?null:M?e(Ee,{sx:{display:"flex","& .MuiToolbar-root":{display:"flex",alignItems:"baseline"}},variant:"body",component:"div",rowsPerPageOptions:P,colSpan:3,count:R,rowsPerPage:Number(ke),page:Number(Ne),onPageChange:(e,t)=>{Ce(t)},onRowsPerPageChange:e=>{xe(Number(e.target.value))},ActionsComponent:rh}):t(ci,{style:{display:"flex",color:"var(--theme-color1)",fontWeight:"bold",padding:"10px"},children:[oe("TotalNoofRecords"),": ",Ie]})]}),ae?e(Bd,{globalFilter:Se,filters:Fe,queryFilters:S,title:g.trim(),rows:fe,columns:r,onClose:()=>{se(!1)},enablePdfPrint:V,reportTemplateCode:K,enableEnterToFocus:Z}):null,re?e($,{open:!0,fullScreen:!0,children:e(iu,{rows:fe,title:g.trim(),columns:r,onClose:()=>ne(!1)})}):null]})},$m=(e,t,i)=>xr(e,i,{keys:[e=>e.values[t]]});$m.autoRemove=e=>!e;const Zm=(e,t,i)=>e.filter(e=>{const r=e.values[t];return void 0===r||String(r).toLowerCase().startsWith(String(i).toLowerCase())}),eg=(e,t,i)=>e.filter(e=>e.values[t]>=i);eg.autoRemove=e=>"number"!=typeof e;const tg=(e,t,i)=>e.filter(e=>t.some(t=>{const r=e.values[t];return r&&r.length&&i.some(e=>r.includes(e))}));tg.autoRemove=e=>!e||!e.length;const ig=[{label:"starts with",value:"startsWith"},{label:"ends with",value:"endsWith"},{label:"equal",value:"equal"},{label:"contains",value:"contains"}],rg=({filterValue:t,id:i,columnName:r,gridProps:n,dispatch:a})=>{const{t:s}=W(),[o,l]=d(t?.value??""),[h,c]=d(t?.condition??"equal"),u=()=>{Boolean(o)?a({type:"setValue",payload:{condition:h,value:o,id:i,columnName:r}}):a({type:"removeValue",payload:{id:i}})};return e(q,{item:!0,xs:12,sm:6,md:6,...n,children:e(Ao,{label:s(r),InputLabelProps:{shrink:!0},onChange:e=>l(e.target.value.trimStart()),onBlur:u,fullWidth:!0,value:o,InputProps:{endAdornment:e(Do,{size:"small",style:{width:"50%"},touched:!0,error:"",multiple:!1,handleChange:e=>{c(e.target.value)},handleBlur:u,options:ig,disableCaching:!1,value:h,selectVariant:"andornment"})}})})},ng=({filterValue:t,id:i,columnName:r,filterProps:n,gridProps:a,dispatch:s})=>{const{t:l}=W(),[h,c]=d(t?.value??[]),u=o(null),[A,p]=d([]),{loadingOptions:f}=xo(n?.options??[],p,n?._optionsKey??"",!1,{},!1,void 0);return e(q,{item:!0,xs:12,sm:6,md:6,...a,children:e(Ro,{label:l(r),showCheckbox:!0,value:h,size:"small",fullWidth:!0,touched:!0,error:"",multiple:!0,handleChange:(e,t)=>{c(e.target.value),u.current=t},handleBlur:e=>{Array.isArray(h)&&h.length>0?s({type:"setValue",payload:{condition:"in",value:h,label:u.current,id:i,columnName:r}}):s({type:"removeValue",payload:{id:i}})},options:A,loadingOptions:f,selectVariant:"regular"})})},ag=[{label:"All",value:"all"},{label:"Today",value:"today"},{label:"Last Week",value:"lastWeek"},{label:"Last Month",value:"lastMonth"},{label:"Custom",value:"custom"}],sg=[{label:"Today",value:"today"},{label:"Last Week",value:"lastWeek"},{label:"Last Month",value:"lastMonth"},{label:"Custom",value:"custom"}],og=({filterValue:r,id:n,columnName:a,gridProps:s,dispatch:l,filterProps:c,isDefaultFilter:u})=>{const{t:A}=W(),[p,f]=d({isError:!1,error:""}),[m,g]=d({isError:!1,error:""}),w=o(null),b=o(null),[v,y]=d(Array.isArray(r?.value)?new Date(r?.value[0])??null:new Date(r?.value)??null),[B,C]=d(Array.isArray(r?.value)?new Date(r?.value[1])??null:null),[x,F]=d(r?.option??(u?"today":"all")),S="custom"===x?{style:{width:"40%"}}:{fullWidth:!0};return h(()=>{v||y(new Date),B||C(new Date)},[v,B]),e(q,{item:!0,xs:12,...s,sm:"custom"===x?12:6,md:"custom"===x?12:6,children:t("div",{style:{width:"100%",display:"flex"},tabIndex:1,onBlur:e=>{let t=k(new Date,"iii LLL dd yyyy HH:mm:ss xxxx"),i=k(new Date,"iii LLL dd yyyy HH:mm:ss xxxx");v instanceof Date&&!isNaN(v)&&(t=k(v,"iii LLL dd yyyy HH:mm:ss xxxx")),B instanceof Date&&!isNaN(B)&&(i=k(B,"iii LLL dd yyyy HH:mm:ss xxxx")),"today"===x?Boolean(u)?l({type:"removeValue",payload:{id:n}}):l({type:"setValue",payload:{condition:"equal",value:t,id:n,option:x,columnName:a,type:c?.type}}):("lastWeek"===x||"lastMonth"===x||"custom"===x)&&v instanceof Date&&B instanceof Date&&!isNaN(v)&&!isNaN(B)&&v<=B?l({type:"setValue",payload:{condition:"between",value:[t,i],id:n,option:x,columnName:a,type:c?.type}}):l({type:"removeValue",payload:{id:n}})},children:[e(Do,{label:A(a),value:x,size:"small",touched:!0,error:"",handleChange:(e,t)=>{let i=new Date;"today"===e.target.value?Boolean(u)?(y(null),C(null)):y(i):"lastWeek"===e.target.value?(C(i),y(Ui(i,7))):"lastMonth"===e.target.value?(C(i),y(Ui(i,30))):"all"!==e.target.value&&"custom"!==e.target.value||(y(null),C(null)),F(e.target.value)},handleBlur:()=>!0,options:Boolean(u)?sg:ag,_optionsKey:"dateRangePicker",optionsProps:{},disableCaching:!1,selectVariant:"regular",...S}),"custom"===x?t(i,{children:[e("span",{style:{width:"1%",textAlign:"center",marginTop:"32px"}}),e(Ho,{format:"dd/MM/yyyy",label:A("FromDate"),maxDate:new Date,onChange:e=>{if(ys(e)){if(y(e),w.current=e,e>new Date)return void f({isError:!0,error:A("Futuredatesarenotallowed")});Ba(B,e)?(null!==w.current&&f({isError:!1,error:""}),null!==b.current&&g({isError:!1,error:""})):f({isError:!0,error:A("FromDateshouldbelessthanorequaltoToDate")})}else{if(!e)return f({isError:!0,error:A("ThisFieldisrequired")}),void(w.current=null);if(!Ve(e))return f({isError:!0,error:A("Mustbeavaliddate")}),void(w.current=null)}},value:v??new Date,sx:{width:"30%"},slots:{textField:Ao},slotProps:{textField:{placeholder:"Start Date","aria-label":"Select Date",InputLabelProps:{shrink:!0},error:p.isError,helperText:p.error},actionBar:{actions:["today","cancel"]}}}),e("span",{style:{width:"1%",textAlign:"center",marginTop:"32px"}}),e(Ho,{format:"dd/MM/yyyy",label:A("ToDate"),onChange:e=>{if(ys(e))C(e),b.current=e,Ba(e,v)?(null!==b.current&&g({isError:!1,error:""}),null!==w.current&&f({isError:!1,error:""})):g({isError:!0,error:A("ToDateshouldbegreaterthanorequaltoFromDate")});else{if(!e)return g({isError:!0,error:A("ThisFieldisrequired")}),void(b.current=null);if(!Ve(e))return g({isError:!0,error:A("Mustbeavaliddate")}),void(b.current=null)}},value:B??new Date,sx:{width:"30%"},slots:{textField:Ao},slotProps:{textField:{placeholder:"End Date","aria-label":"Select Date",InputLabelProps:{shrink:!0},error:m.isError,helperText:m.error},actionBar:{actions:["today","cancel"]}}})]}):null]})})},lg=({filterValue:i,id:r,columnName:n,gridProps:a,dispatch:s,filterProps:o})=>{const{t:l}=W(),[c,u]=d(Array.isArray(i?.value)?i?.value[0]:null),[A,p]=d(Array.isArray(i?.value)?i?.value[1]:null),[f,m]=d("");h(()=>{Number(c)>Number(A)&&A?.length>0?m("Min value is greater than max"):m("")},[c,A]);return e(q,{item:!0,xs:12,sm:6,md:6,...a,children:t($e,{fullWidth:!0,error:Boolean(f),tabIndex:1,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(!isNaN(Number(c))&&!isNaN(Number(A))&&c?.length&&A?.length&&Number(c)<=Number(A)?s({type:"setValue",payload:{condition:"between",value:[c,A],id:r,columnName:n,type:o.type}}):s({type:"removeValue",payload:{id:r}}))},sx:{"& label.Mui-focused":{color:"var(--theme-color1)"}},children:[e(Vo,{shrink:!0,sx:{fontSize:"0.875rem !important"},children:l(n)}),t("div",{style:{display:"flex",width:"100%",justifyContent:"space-between"},children:[e(Ko,{style:{width:"45%"},placeholder:"min",value:c,onChange:e=>{isNaN(Number(e.target.value))||u(e.target.value.trim())}}),e(Ko,{style:{width:"45%"},placeholder:"max",value:A,onChange:e=>{isNaN(Number(e.target.value))||p(e.target.value.trim())}})]}),Boolean(f)?e(Ze,{children:f}):null]})})},hg=t=>{const{filterProps:i}=t;return"date"===i?.type||"dateTime"===i?.type?e(og,{...t}):"value"===i?.type?e(lg,{...t}):"number"===i?.type?e(Go,{...t}):"amount"===i?.type?e(nl,{...t}):e(q,{item:!0,md:6,sm:6,xs:12,children:"Range Component Type not set"})},cg=e=>({"data-tag-index":e,tabIndex:-1,key:e}),dg=({filterValue:t,id:i,columnName:r,gridProps:n,dispatch:a})=>{const[s,h]=d(""),[c,u]=d(t?.value??[]),[A,p]=d(-1),f=o(null),m=o(null),g=(e,t)=>{let i=A;-1===A?""===s&&"previous"===t&&(i=c.length-1):(i+="next"===t?1:-1,i<0&&(i=0),i===c.length&&(i=-1)),p(i),w(i)},w=l(e=>{-1===e?m.current.focus():f.current.querySelector(`[data-tag-index="${e}"]`).focus()},[]);let b=null;Array.isArray(c)&&c.length>0&&(b=c.map((t,i)=>e(gi,{label:t,size:"small",onDelete:()=>u([...c.slice(i,i+1),...c.slice(i+1)]),style:{margin:"4px 2px"},...cg(i)})));return e(q,{item:!0,xs:12,sm:6,md:6,...n,children:e(mo,{inputRef:m,label:r,InputLabelProps:{shrink:!0},onChange:e=>h(e.target.value),onBlur:()=>{Array.isArray(c)&&c.length>0?a({type:"setValue",payload:{condition:"in",value:c,id:i,columnName:r}}):a({type:"removeValue",payload:{id:i}})},fullWidth:!0,value:s,InputProps:{startAdornment:b,ref:f},onKeyDown:e=>{if(-1!==A&&-1===["ArrowLeft","ArrowRight"].indexOf(e.key)&&(p(-1),w(-1)),299!==e.which)switch(e.key){case"Enter":Boolean(s)&&(u(e=>[...e,s]),h(""));break;case"Backspace":if(""===s&&c.length>0){const e=-1===A?c.length-1:A,t=c.slice();t.splice(e,1),u(t)}break;case"ArrowLeft":g(0,"previous");break;case"ArrowRight":g(0,"next")}}})})},ug=({filterValue:t,id:i,columnName:r,gridProps:n,dispatch:a})=>{const[s,o]=d(t?.value??"");return e(q,{item:!0,xs:12,sm:6,md:6,...n,children:e(Ho,{label:r,value:""===s?null:new Date(s),onChange:e=>{o(e),isNaN(e)?a({type:"removeValue",payload:{id:i}}):a({type:"setValue",payload:{condition:"equal",value:e,id:i,columnName:r}})},sx:{width:"100%"},slots:{textField:Ao},slotProps:{textField:{variant:"standard",InputLabelProps:{shrink:!0}},actionBar:{actions:["today","cancel"]}}})})},Ag=e=>()=>(console.log(`no method found for options at ${e}`),[{label:"Oops error occured",value:""}]),pg=e=>Array.isArray(e)?e.map(e=>{const{filterComponentType:t,filterProps:i,...r}=e;switch(t){case"valueDateFilter":return{...r,Filter:ug,filterProps:i};case"valueFilter":return{...r,Filter:rg,filterProps:i};case"multiValueFilter":return{...r,Filter:dg,filterProps:i};case"optionsFilter":{const{options:e,...t}=i;if("string"==typeof e){const i=fa.getFn(e??"NOT_EXIST_OPTIONS_FN",Ag);return{...r,Filter:ng,filterProps:{options:i,_optionsKey:e,...t}}}return{...r,Filter:ng,filterProps:i}}case"rangeFilter":return{...r,Filter:hg,filterProps:i};default:return{...r}}}):[],fg=e=>Array.isArray(e)?e.reduce((e,t)=>(!0===t.isHiddenColumn&&e.push(t.accessor),e),[]):[],mg=({metaData:i,maxHeight:r,initialState:n,title:a,options:c,hideFooter:u,showSerialNoColumn:A=!1,onClose:p=null,reportName:m,dataFetcher:g=()=>[],autoFetch:w=!0,hideAmountIn:b=!1,reportID:v,retrievalType:y,onClickActionEvent:B=()=>{},otherAPIRequestPara:C={},hideHeader:x=!1,hideShowFiltersSwitch:F=!1,defaultFilter:S=[],hideStatusBar:N=!1,retrievalComponent:E,openDrawerFilter:k=!1,onDoubleClickAction:T,enableCaching:L=!1,dataTransformer:I=e=>e,reportTemplateCode:D="",enablePivot:P,actions:R=[],getReportData:O,disableFilters:Q,headerToolbarStyle:H={},enableEnterToFocus:M,focusScopeId:_="enter-to-focus-static-report",expandAllGroupedRows:j})=>{const{t:z}=W(),{defaultExportConfig:V,enableEnterToFocus:K,...q}=ns(),G=s(()=>({...i,columns:[{accessor:"SRNO",width:100,disableFilters:!0,type:"default",...i?.sequenceColumnConfig,columnName:i?.sequenceColumnConfig?.columnName??"SrNo"},...i.columns.map(t=>t.isGroupSum?{...t,Aggregated:Vc,aggregate:e=>e.reduce((e,t)=>e+Number(t||0),0)}:"function"==typeof t.customAggregation?(console.log("custom",t.customAggregation,t.accessor),{...t,Aggregated:i=>{const r=t.customAggregation(i,{...q,currencySymbol:$o(q.dynamicAmountSymbol)});return e(Ic,{...i,value:r})}}):t)]}),[i]),J=fg(G.columns),X=s(()=>({...G,hiddenColumns:J}),[J]),Y=s(()=>{if(Array.isArray(X.columns))return X.columns.map(e=>({...e,columnName:z(e.columnName)}))},[z,X]),$=s(()=>k?pg(X?.filters):X.filters,[]),[Z,ee]=d(w),[te,ie]=d([...S]),re=l(e=>{U(te,e)||(ie(e),ee(!0))},[ee,ie,te]),ne=s(()=>({Header:zc,Cell:Ic,Footer:Mc,Footer1:_c,Aggregated:Ic}),[]),ae=s(()=>({fuzzyText:$m,customText:Zm,filterGreaterThan:eg,customInclude:tg}),[]),{data:se,isFetching:oe,isLoading:le,isError:he,error:ce,refetch:de}=zt([g,v,te,C],()=>g(v,te,C),{cacheTime:L?36e5:0,enabled:Z}),ue=s(()=>se?.map((e,t)=>({SRNO:String(t+1),...e})),[se]),Ae=l((e,t)=>{oe||le||he||!Z||B(e,t,se[e],te)},[se]),pe=o(null),fe=M??K,me=_&&fe?{"data-scope-id":_}:{};return h(()=>{fe&&pe.current&&pe.current.focus()},[fe]),t(f,{children:[he?e(to,{severity:"error",errorMsg:ce?.error_msg??"Unknown Error occured",errorDetail:ce?.error_detail}):null,e(Rc,{children:e("div",{ref:pe,tabIndex:fe?0:-1,style:{width:"100%",position:"relative"},onKeyDown:e=>{fe&&Es(e,_)},...me,children:e(Ym,{columns:Y,defaultColumn:ne,defaultHiddenColumns:X.hiddenColumns,data:I(ue)??[],maxHeight:r??450,containerHeight:X?.containerHeight,occupiedHeight:X?.occupiedHeight,initialState:n,filterTypes:ae,title:a+" ",options:c,loading:oe||le,hideFooter:"Y"===u||!0===u,showSerialNoColumn:"Y"===A||!0===A,onClose:p,setQueryFilters:re,filterMeta:$,queryFilters:te,hideStatusBar:"Y"===N||!0===N,hideAmountIn:"Y"===b||!0===b,retrievalType:y,onButtonActionHandel:Ae,isOpenRetrievalDefault:!w,hideHeader:"Y"===x||!0===x,hideShowFiltersSwitch:"Y"===F||!0===F,refetchData:()=>de(),retrievalComponent:E,openDrawerFilter:k,onDoubleClickAction:T,enablePdfPrint:X?.enablePdfPrint??V?.enablePdfPrint??!1,reportTemplateCode:ue?.find(e=>e?.REPORT_PERSONALIZATION_ID)?.REPORT_PERSONALIZATION_ID??D,enablePivot:P&&ue?.length>0,actions:R,getReportData:O,disableFilters:Q,headerToolbarStyle:H,enableEnterToFocus:fe,expandAllGroupedRows:j})})})]})},gg=({column:{filterValue:t,preFilteredRows:i,setFilter:r}})=>{const n=i.length,{t:a}=W();return e(_t,{value:t||"",onChange:e=>{e.target.value.length<=100&&r(e.target.value||void 0)},fullWidth:!0,size:"small",variant:"outlined",placeholder:`${a("Searched")} ${n} ${a("records")}`})};var wg=Object.freeze({__proto__:null,DefaultColumnFilter:gg,NumberRangeColumnFilter:({column:{filterValue:i=[],preFilteredRows:r,setFilter:n,id:a}})=>{const[o,l]=s(()=>{let e=r.length?r[0].values[a]:0,t=r.length?r[0].values[a]:0;return r.forEach(i=>{e=Math.min(i.values[a],e),t=Math.max(i.values[a],t)}),[e,t]},[a,r]);return t("div",{style:{display:"flex",alignItems:"baseline"},children:[e(_t,{value:i[0]||"",type:"number",onChange:e=>{const t=e.target.value;n((e=[])=>[t?parseInt(t,10):void 0,e[1]])},placeholder:`Min (${o})`,fullWidth:!0,size:"small",variant:"outlined"}),e("span",{children:"to"}),e(_t,{value:i[1]||"",type:"number",onChange:e=>{const t=e.target.value;n((e=[])=>[e[0],t?parseInt(t,10):void 0])},placeholder:`Max (${l})`,fullWidth:!0,size:"small",variant:"outlined"})]})},SelectColumnFilter:({column:{filterValue:i,setFilter:r,preFilteredRows:n,id:a,multiple:o}})=>{const{t:l}=W(),h=s(()=>{const e=new Set;return n.forEach(t=>{e.add(t.values[a])}),[...e.values()]},[a,n]);return o&&!Array.isArray(i)&&(i=[i]),t(_t,{value:i??"",onChange:e=>{r(e.target.value||void 0)},fullWidth:!0,variant:"outlined",size:"small",select:!0,SelectProps:{multiple:o},children:[e(K,{value:"",children:l("All")},"default"),h.map((t,i)=>e(K,{value:t,children:t},i))]})},SliderColumnFilter:({column:{filterValue:t,setFilter:i,preFilteredRows:r,id:n}})=>{const[a,o]=s(()=>{let e=r.length?r[0].values[n]:0,t=r.length?r[0].values[n]:0;return r.forEach(i=>{e=Math.min(i.values[n],e),t=Math.max(i.values[n],t)}),[e,t]},[n,r]);return e(Dt,{min:a,max:o,value:t||a,onChange:(e,t)=>{i(parseInt(t))}})}});const bg=Ci(e=>({root:{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),background:"var(--theme-color1)"},title:{flex:"1 1 100%",color:"var(--white)",letterSpacing:"1px",fontSize:"2rem"}})),vg=({footerGroup:t,loading:i})=>e(hi,{...t.getFooterGroupProps(),component:"div",children:t.headers.map(t=>e(ci,{...t.getFooterProps([{style:{textAlign:t?.alignment??"unset",display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"0px 20px 0px 10px",lineHeight:"34px",backgroundColor:"var(--theme-color2)"}}]),component:"div",children:t.render("Footer",{loading:i})}))}),yg=({columns:r,defaultColumn:n,data:a,filterTypes:c,title:u,options:A,loading:p=!1,isError:m=!1,hideFooter:g=!1,showSerialNoColumn:w=!1,onClose:b=null,setQueryFilters:v,filterMeta:y,queryFilters:B,hideAmountIn:x,retrievalType:F,onButtonActionHandel:S,isOpenRetrievalDefault:N,hideHeader:E=!1,pageSizes:k=[20,30,40],pageCount:T,totalRecords:L,onFetchData:I,defaultPageSize:D=20,defaultSortOrder:U=[],defaultHiddenColumns:P=[],enablePagination:R=!0,enablePdfPrint:O,onDoubleClickAction:Q,defaultFilter:H,disableFilters:M,containerHeight:_,occupiedHeight:j,headerToolbarStyle:z,enableEnterToFocus:V,retrievalComponent:K,retrievalComponentMeta:q,retrievalFilters:G,setRetrievalFilters:J})=>{const X=bg(),[$,Z]=d(!1),[ee,te]=d(!1),{t:ie}=W(),{disableColumnFilters:re}=ns(),ne=s(()=>r.some(e=>e.isTotalWithCurrency||e.isTotalWithoutCurrency),[r]),se=s(()=>r.map(e=>({...e,disableFilters:e?.disableFilters??M??re??!1,filter:zm})),[r,M,re]),oe=Gt({columns:se,data:a,defaultColumn:n,filterTypes:c,onButtonActionHandel:S,autoResetGlobalFilter:!1,autoResetFilters:!1,autoResetGroupBy:!1,autoResetSortBy:!1,initialState:{pageIndex:0,pageSize:D,hiddenColumns:P,sortBy:U},...A,manualPagination:!0,pageCount:T,autoResetPage:!1},ri,Xt,Yt,$t,ti,ii,km(w),S,Zt),{getTableProps:le,getTableBodyProps:he,headerGroups:ce,footerGroups:de,rows:ue,page:Ae,prepareRow:pe,pageOptions:fe,totalColumnsWidth:me,toggleAllRowsExpanded:ge,isAllRowsExpanded:we,setAllFilters:be,gotoPage:ve,setPageSize:ye,setSortBy:Be,state:{filters:Ce,pageIndex:xe,pageSize:Fe,sortBy:Se},filteredRows:Ne}=oe,Te=l(({index:t,style:i})=>{if(0===Ae.length)return;const r=Ae[t];return pe(r),e(hi,{...r.getRowProps({style:i}),id:r.id,tabIndex:0,onDoubleClick:()=>{"function"==typeof Q&&Q({row:[{data:r?.original,id:r?.id}]})},children:r.cells.map((e,t)=>{const{key:i}=e.getCellProps();return e.render("Cell",{key:i,index:t})})})},[pe,Ae]),Le=qt(I,500),Ie=s(()=>Ne?.length,[Ne]),De=(e,t)=>{ve(t)},Ue=e=>{ye(Number(e.target.value))};h(()=>{be([])},[B]),h(()=>{Le({pageIndex:xe,pageSize:Fe,sortBy:Se,filters:B,retrievalFilters:G})},[Le,xe,Fe,Se,B,G]),h(()=>{if(0===B?.length&&H?.length>0)v(H);else if(H?.length>0){const e=H.filter(e=>!B.some(t=>e.id===t.id)).concat(B);JSON.stringify(e)!==JSON.stringify(B)&&v(e)}},[B,H,v]),h(()=>{H?.length>0&&te(H.some(e=>"date"===e?.value?.type||"dateTime"===e?.value?.type))},[H]);const Pe=s(()=>{const e=e=>{const t=Array.isArray(B)&&B.length>0?`calc(${_?.[e]??"73.5vh"} - 48px)`:_?.[e]??"73.5vh";return t&&j?.[e]?`calc(${t} - ${j?.[e]})`:t};return{min:e("min"),max:e("max")}},[B,_,j]),Re=o(null),[Oe,Qe]=d({});return h(()=>{if(!Re.current)return;const e=()=>{const e=Re.current,t=getComputedStyle(e),i=parseFloat(t.minHeight),r=parseFloat(t.maxHeight);Qe({min:i,max:r})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[ue]),t(f,{children:[t(ni,{style:{width:"100%",overflow:"hidden",marginBottom:"8px",display:E?"none":"inherit"},className:"not-printed",children:[t(ai,{className:"server__report__header",variant:"dense",sx:{width:"100%",background:"var(--primary-bg)",...z},children:[e(vt,{variant:"h5",color:"primary",children:u.trim()}),e("div",{style:{flexGrow:1}}),q&&e(Rm,{setQueryFilters:J,filterMeta:q,filterData:G,retrievalType:F,isOpenRetrievalDefault:N,retrievalComponent:K}),Ce.length>0&&e(Y,{onClick:()=>{be([])},style:{marginRight:"8px",color:"white"},children:ie("ClearFilter")}),y?.length?e(Gl,{setAllFilters:v,filters:B,filterMeta:y,gotoPage:ve,setSortBy:Be,classes:X,isDefaultFilter:ee}):null,e(Wo,{title:ie("Refetch"),children:e(C,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true",onClick:()=>Le({pageIndex:xe,pageSize:Fe,sortBy:Se,filters:B,retrievalFilters:G}),color:"primary",children:e(ki,{})})}),x?null:e(Hc,{}),ce.some(e=>e.headers.some(e=>!0===e.isGrouped))?e(ae,{control:e(ke,{onChange:()=>ge(!we),checked:we,name:"filters",size:"small",color:"primary"}),style:{color:"var(--white)",marginLeft:0},label:ie("ExpandRows")}):e(i,{children:!p&&!m&&Ae.length>0?e(ae,{control:e(Wo,{title:ie("Showexportoptions"),arrow:!0,children:t(eo,{onClick:()=>{Z(!0)},style:{marginTop:"0px",marginLeft:"10px",color:"white"},disabled:p,eventKey:"x",shortcut:"alt",children:[ie("Export")," ",e(Ki,{})]})}),style:{color:"var(--white)"},label:""}):null}),"function"==typeof b?e(Wo,{title:ie("Close"),arrow:!0,children:e(C,{onClick:b,size:"small",children:e(Bt,{style:{color:"var(--white)"}})})}):null]}),B.length||G?.length?e(hh,{dense:!0,setAllFilters:e=>{const t=new Set(B.map(e=>e.id)),i=new Set(G.map(e=>e.id)),r=new Set(e.map(e=>e.id)),n=[];for(const e of G)r.has(e.id)&&i.has(e.id)&&n.push(e);const a=[];for(const r of e)t.has(r.id)?a.push(r):i.has(r.id)||a.push(r);J(n),v(a)},filters:[...G,...B],gotoPage:ve,setSortBy:Be}):null]}),p&&e(mt,{color:"secondary"}),t(ni,{style:{width:"100%",overflow:"hidden"},tabIndex:0,children:[e(si,{ref:Re,sx:{position:"relative",maxHeight:Pe.max,minHeight:Pe.min},children:t(oi,{...le(),size:"small",component:"table",children:[e(li,{component:"thead",children:ce.map(i=>e(hi,{...i.getHeaderGroupProps(),component:"tr",children:i.headers.map((i,r)=>t(ci,{...i.getHeaderProps([{style:{display:"flex",padding:0===r?"0 10px":"0px 10px 0 0",alignItems:"center"}}]),component:"th",align:i.alignment,children:[i.render("Header"),i.canFilter?e(Gm,{column:i,filters:Ce,enableEnterToFocus:V}):null]}))}))}),p||m?null:e(di,{...he({}),component:"tbody",children:e(Ei,{height:(Oe?.min??300)-(ne?72:38),itemCount:Ae.length,itemSize:35,width:me+10,overscanCount:10,children:Te})}),m?e("div",{style:{position:"absolute",left:"50%",top:"50%",fontStyle:"italic",color:"rgba(133, 130, 130, 0.8)"},children:ie("Somethingwenttowrong")}):null,ue.length<=0&&!1===p?e("div",{style:{position:"absolute",left:"50%",top:"50%",fontStyle:"italic",color:"rgba(133, 130, 130, 0.8)"},children:ie("Nodatafound")}):null,p?null:e(li,{component:"div",children:e(vg,{footerGroup:de[0],loading:p})})]})}),g?null:R?e(Ee,{sx:{display:"flex",overflowY:"hidden","& .MuiToolbar-root":{display:"flex",alignItems:"baseline",transform:"translateY(5.5px)"}},variant:"body",component:"div",rowsPerPageOptions:k,colSpan:3,count:m||p?0:Number(L),rowsPerPage:Number(Fe),page:m||p?0:Number(xe),onPageChange:De,onRowsPerPageChange:Ue,ActionsComponent:nh}):t(ci,{style:{display:"flex",color:"var(--theme-color1)",fontWeight:"bold",padding:"10px"},children:[ie("TotalNoofRecords"),": ",Ie]}),$?e(Bd,{filters:Ce,queryFilters:B,title:u.trim(),rows:ue,columns:r,pageNumber:xe,totalPageCount:fe.length,onClose:()=>{Z(!1)},enablePdfPrint:O,enableEnterToFocus:V}):null]})]})},Bg=({metaData:i,maxHeight:r,containerHeight:n,occupiedHeight:a,initialState:c,title:u,options:A,hideFooter:p,showSerialNoColumn:m=!1,onClose:g=null,reportName:w,dataTransformer:b=e=>e,autoFetch:v=!0,hideAmountIn:y=!1,retrievalType:B,onClickActionEvent:C=()=>{},hideHeader:x=!1,hideShowFiltersSwitch:F=!1,defaultFilter:S=[],hideStatusBar:N=!1,data:E,loading:k,isError:T,error:L,pageCount:I,totalRecords:D,pageSizes:U,defaultPageSize:P,onFetchData:R,onDoubleClickAction:O,disableFilters:Q,headerToolbarStyle:H,enableEnterToFocus:M,focusScopeId:_,retrievalComponent:j})=>{const{t:z}=W(),{defaultExportConfig:V,enableEnterToFocus:K}=ns(),q=s(()=>{if(Array.isArray(i.columns))return i.columns.map(e=>({...e,columnName:z(e.columnName)}))},[z]),G=s(()=>pg(i.filters),[i.filters]),[J,X]=d(v),[Y,$]=d([]),[Z,ee]=d([]),te=l(e=>{$(e),X(!0)},[X,$]),ie=s(()=>({Header:zc,Cell:Ic,Footer:Mc,Filter:gg,Aggregated:Ic}),[]),re=s(()=>({fuzzyText:$m,customText:Zm,filterGreaterThan:eg,customInclude:tg}),[]),ne=l((e,t)=>{k||T||!J||C(e,t,E[e])},[E]),ae=o(null),se=M??K,oe=_&&se?{"data-scope-id":_}:{};return h(()=>{se&&ae.current&&ae.current.focus()},[se]),t(f,{children:[T&&e(to,{severity:"error",errorMsg:L?.error_msg??"Unknown Error occured",errorDetail:L?.error_detail}),e(Rc,{children:e("div",{ref:ae,tabIndex:se?0:-1,style:{width:"100%",position:"relative"},onKeyDown:e=>{se&&Es(e,_)},...oe,children:e(yg,{columns:q,defaultColumn:ie,defaultHiddenColumns:i.hiddenColumns,data:b(E)??[],maxHeight:r??450,containerHeight:n,occupiedHeight:a,filterTypes:re,title:u+" ",options:A,loading:k,isError:T,hideFooter:("string"!=typeof p||"N"!==p)&&Boolean(p),showSerialNoColumn:m,onClose:g,setQueryFilters:te,defaultFilter:S,filterMeta:G,retrievalComponentMeta:i.retrievalFilters,queryFilters:Y,hideStatusBar:N,hideAmountIn:y,retrievalType:B,onButtonActionHandel:ne,isOpenRetrievalDefault:!v,hideHeader:x,hideShowFiltersSwitch:F,onFetchData:R,totalRecords:D,pageSizes:U,pageCount:I,defaultPageSize:P,enablePdfPrint:i?.enablePdfPrint??V?.enablePdfPrint??!1,onDoubleClickAction:O,disableFilters:Q,headerToolbarStyle:H,enableEnterToFocus:se,retrievalComponent:j,retrievalFilters:Z,setRetrievalFilters:ee})})})]})},Cg=({reportID:t,reportName:i,metaData:r,getAPIFn:n,otherAPIRequestPara:a,maxHeight:h,onClickActionEvent:c,defaultFilter:u,onDoubleClickAction:A,disableFilters:p,options:f,headerToolbarStyle:m={},enableEnterToFocus:g,focusScopeId:w="enter-to-focus-server-report",retrievalComponent:b,title:v})=>{const{t:y}=W(),[B,C]=d([]),[x,F]=d(null),[S,N]=d(0),[E,k]=d(0),T=o(null),L=o(null),{...I}=ns(),D=Vt(n,{onError:e=>{F(e)},onSuccess:e=>{C(e?.[0].REPORT_DATA),k(Math.ceil(Number(e?.[0].COUNT??1)/Number(T.current?.pageSize??20))),N(Number(e?.[0].COUNT??1))}}),U=l(({pageSize:e,pageIndex:i,filters:r,sortBy:n,retrievalFilters:s})=>{if(!P?.autoFetch&&Array.isArray(s)&&0===s.length)return;const o=Number(e)*Number(i)+1,l=Number(o)+Number(e)-1;let h=((e=[])=>(Array.isArray(e)||(e=[e]),e.map((e,t)=>({ACCESSOR:e.id,CONDITION:e.value.condition,VALUE:e.value.value,TYPE:e.value?.type??""}))))(r),c=((e=[])=>e.map((e,t)=>({ACCESSOR:e.id??"",VALUE:e?.desc?"desc":"asc"})))(n),d={};Array.isArray(s)&&s.length>0&&(d=s?.reduce((e,t)=>({...e,[t.id]:t.value.value}),{})),L.current&&L.current?.abort?.(),L.current=new AbortController;const u={reportID:t,APIRequestPara:{FROM_ROW:o,TO_ROW:l,FILTER_CONDITIONS:h,ORDERBY_COLUMNS:c,IS_PAGE:!0,...d,...a},abortAPICall:L.current};T.current={pageSize:e},D.mutate(u)},[N,C]),P=s(()=>({...r,columns:[{accessor:"ROW_SR_CD_",width:100,disableFilters:!0,type:"default",...r?.sequenceColumnConfig,columnName:r?.sequenceColumnConfig?.columnName??"SrNo"},...r.columns.map(t=>t.isGroupSum?{...t,Aggregated:Vc,aggregate:e=>e.reduce((e,t)=>e+Number(t||0),0)}:"function"==typeof t.customAggregation?(console.log("custom",t.customAggregation,t.accessor),{...t,Aggregated:i=>{const r=t.customAggregation(i,{...I,currencySymbol:$o(I.dynamicAmountSymbol)});return e(Ic,{...i,value:r})}}):t)]}),[r]),R=fg(P.columns),O=s(()=>({...P,hiddenColumns:R}),[R]);return e(Bg,{metaData:O,maxHeight:h,reportName:i,containerHeight:P?.containerHeight,occupiedHeight:P?.occupiedHeight,title:v??y(P.title),hideFooter:P.hideFooter,hideAmountIn:P.hideAmountIn,retrievalType:P.retrievalType,onClickActionEvent:c,options:f,autoFetch:P?.autoFetch??!0,data:B,loading:D.isLoading,isError:D.isError,error:x,pageCount:E,totalRecords:S,pageSizes:P?.pageSize??[25,50,100,250,500,2500,5e3,1e4,5e4,1e5],defaultPageSize:P.defaultPageSize??25,onFetchData:U,defaultFilter:u,onDoubleClickAction:A,disableFilters:p,headerToolbarStyle:m,enableEnterToFocus:g,focusScopeId:w,retrievalComponent:b})};io(".ag-theme-alpine{--ag-header-background-color:var(--theme-color4)!important;--ag-header-foreground-color:var(--theme-color1)!important;--ag-row-hover-color:none;--ag-font-weight:600;--ag-font-family:Roboto,sans-serif;--ag-height:30px!important}.ag-header-cell-label{color:var(--theme-color1)!important;cursor:default;font-family:Roboto,Helvetica,Arial,sans-serif;font-size:.875rem;font-weight:600;opacity:1;overflow:hidden;text-transform:capitalize}.ag-header-cell{border-radius:8px}.ag-cell{border-right:1px solid #fff}.ag-cell.currency{text-align:right}.ag-row.ag-row-pinned{background:var(--theme-color4)!important;border:none!important;line-height:22px;pointer-events:none;text-align:center}.ag-floating-bottom{border-top:none!important;height:23px!important;min-height:23px!important}.ag-row.ag-row-pinned .ag-cell{border:none!important;color:var(--theme-color3);font-size:small;font-weight:700;height:23px!important;line-height:inherit;min-height:23px!important;overflow:hidden;padding:0 10px;text-overflow:ellipsis;white-space:nowrap}.error-border{border:1px solid #d32f2f!important;border-radius:2px}.cell-placeholder{color:var(--theme-color6)!important;cursor:default;font-family:Roboto,Helvetica,Arial,sans-serif;font-size:.875rem;height:15px;opacity:1;overflow:hidden;text-transform:capitalize}.main-container{padding:10px}.cell-value{color:#000;font-family:Roboto,Helvetica,Arial,sans-serif;font-size:.875rem;height:15px}.ag-cell .MuiAutocomplete-root .MuiOutlinedInput-root{padding:0!important}.ag-cell .MuiOutlinedInput-root .MuiAutocomplete-input{padding:4.5px 4px 4.5px 5px}.ag-cell .MuiOutlinedInput-notchedOutline{border:none!important}");const xg=({rowIndex:e,agGridReact:t,data:i,node:r,...n})=>r.rowPinned?"":r.rowIndex+1,Fg=e=>{let t;return t="string"==typeof e?Number(e.replace(/,/g,"")):e,Number.isNaN(t)?0:parseFloat(t.toFixed(Number(process.env.SYSTEM_DECIMAL_LENGTH)||3))},Sg=e=>{let t=e.values.reduce((e,t)=>e+Fg(t),0);return Fg(t)},Ng=e=>{if(!e)return null;const t="string"==typeof e?je(e,"dd/MM/yyyy",new Date):new Date(e);return Ve(t)?t:null},Eg=(e,t)=>{if(e){const i=e.current.getAllDisplayedColumns().filter(e=>{const{editable:i}=e.colDef;return"function"==typeof i?i(t):!0===i});if(!i.length)return;return i[i.length-1]}},kg=(e,t)=>{if(e){const i=e.current.getAllDisplayedColumns().filter(e=>{const{editable:i}=e.colDef;return"function"==typeof i?i(t):!0===i});if(!i.length)return;return i[0]}},Tg=e=>{if(!e.current)return[];const t=[];return e.current.forEachNode(e=>t.push(e.data)),t},Lg=async e=>{const t=Tg(e);t.length>0&&(await e.current.applyTransaction({remove:t}),await e.current.applyTransaction({add:[{}]}))},Ig=(e,t)=>{I(e)?(t.api.getRowNode(t.node.id)?.setRowHeight(30),t.api.onRowHeightChanged()):(t.api.getRowNode(t.node.id)?.setRowHeight(45),t.api.onRowHeightChanged())},Dg=e=>isNaN(e)?0:`₹ ${e.toFixed(2)}`,Ug=(e,t,i)=>("string"==typeof e&&(e=je(e,"dd/MM/yyyy",new Date)),"string"==typeof t&&(t=je(t,"dd/MMM/yyyy",new Date)),i?.ignoreTime&&(e=new Date(e).setHours(0,0,0,0),t=new Date(t).setHours(0,0,0,0)),He(e,t)),Pg=(e,t,i="")=>{const r=[...(e.data.errors||[]).filter(e=>e.field!==t),{field:t,message:i}];e.setData({...e.data,errors:r})},Rg=async e=>{const{context:t,node:i,api:r}=e,n=[];if(r.forEachNode(e=>n.push(e.data)),1===n.length)await t.MessageBox({messageTitle:"Delete Row",message:"You can not delete last row.",icon:"ERROR",buttonNames:["Ok"]});else{"Yes"===await t.MessageBox({messageTitle:"confirmation",message:"Are you sure want to delete row ?",buttonNames:["Yes","No"],defFocusBtnName:"Yes",icon:"CONFIRM"})&&(r.applyTransaction({remove:[i.data]}),t.updatePinnedBottomRow())}},Og=c((r,n)=>{const{value:a,colDef:{cellEditorParams:s,field:l,name:c},node:u,onValueChange:A,api:f,context:m}=r,{postValidationSetCrossAccessorValues:g=()=>{}}=s||{},w=o(null),b=o(-1),[v,y]=d(!1),[B,C]=d([]),[x,F]=d(!0);h(()=>{let e=r.context.state?.[l]||[];e?.length?(C(e),F(!1)):(async()=>{if("function"==typeof s?.options){F(!0);try{const e=await s.options();r.context.updateState(l,e),C(e||[])}catch(e){C([])}finally{F(!1)}}})()},[]);const S=()=>!a||"object"==typeof a&&I(a)?null:B.find(e=>e.value===a?.value||e.value===a)||null,[N,E]=d(S());h(()=>{E(S())},[B]);const k=(e,t)=>{if(t){E(t);const e={...u.data,[l]:t?.value,[c]:t?.label};u.setData(e),A(t?.value)}};p(n,()=>({getValue:()=>N?N.value:null}));const T=async e=>{y(!1),"function"==typeof g&&await g(N,u,f,l,A,m),-1!==b.current&&B[b.current]&&(await k(0,B[b.current]),"function"==typeof g&&await g(B[b.current],u,f,l,A,m))},L=()=>{if(I(a)){const e={...u.data,[l]:void 0};u.setData(e),A(void 0),E(void 0)}y(!0)};if(h(()=>{w.current&&w.current.focus()},[]),u?.rowPinned)return null;const D=u.data?.errors?.find(e=>e.field===l);return t(i,{children:[e(ye,{id:"item-cell-editor",value:N,onChange:k,options:B,loading:x,getOptionLabel:e=>e.label,isOptionEqualToValue:(e,t)=>e.value===t?.value,open:v,onOpen:()=>y(!0),onClose:()=>y(!1),onHighlightChange:(e,t)=>{b.current="mousemove"!==e?.type?B.indexOf(t):-1},sx:{padding:"0px"},renderInput:r=>e(Te,{...r,variant:"outlined",inputRef:w,onFocus:L,onClick:L,onBlur:T,placeholder:"Select an option",InputProps:{...r.InputProps,endAdornment:t(i,{children:[x?e(he,{color:"inherit",size:20}):null,r.InputProps.endAdornment]})}}),fullWidth:!0}),P(u.data?.errors)&&D?e(ne,{title:Ge(D.message),arrow:!0,children:e(le,{style:{marginTop:"0px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},error:!0,children:Ge(D.message)})}):null]})}),Qg=c((t,i)=>{const{value:r,node:n,colDef:a={},api:s,context:o={}}=t,{cellRendererParams:l={},shouldExclude:h}=a,{disabled:c=!1,handleButtonClick:d=()=>{},buttonName:u="Remove"}=l;p(i,()=>({getValue:()=>r}));const A="function"==typeof c?c(t):c;if(n?.rowPinned)return null;const f="function"==typeof h&&h(t),m="function"==typeof u?u(t):u;return f?null:e(Y,{fullWidth:!0,variant:"contained",color:"secondary",style:{height:"23px",backgroundColor:A?"var(--theme-color7) !important":"var(--theme-color1) !important"},onClick:async()=>{await d(t)},disabled:A,children:m})}),Hg=c((r,n)=>{const{value:a,colDef:{field:s,cellEditorParams:l},node:c,api:u,onValueChange:A,context:f}=r,{postValidationSetCrossAccessorValues:m}=l||{},{commonDateFormat:g="dd/MM/yyyy"}=ns(),[w,b]=d(()=>{const e=Ng(a);return Ve(e)?e:null}),v=o(null);p(n,()=>({getValue:()=>w?ze(w,g):""})),h(()=>{v.current&&setTimeout(()=>{v.current?.focus()},0)},[]),h(()=>{if(!a){const e=new Date;b(e);const t=ze(e,g),i={...c.data,[s]:t};c.setData(i),A?.(t)}},[a]);if(c?.rowPinned)return null;const y=c.data?.errors?.find(e=>e.field===s);return t(i,{children:[e(hr,{dateAdapter:Hi,children:e(cr,{defaultValue:new Date,format:"dd/MM/yyyy",value:w,onChange:e=>{if(!e||!Ve(e)){const e=new Date;b(e);const t=ze(e,g),i={...c.data,[s]:t};return c.setData(i),void A?.(t)}b(e);const t=ze(e,g),i={...c.data,[s]:t};c.setData(i),A?.(t)},slotProps:{textField:{onBlur:async()=>{"function"==typeof m&&await m(w,c,u,s,A,f)},variant:"outlined",fullWidth:!0,size:"small",inputRef:v}},sx:{"& input":{border:"none",padding:"4px 4px",textAlign:"center"},"& fieldset":{border:"none"}}})}),P(c.data?.errors)&&y?e(ne,{title:Ge(y.message),arrow:!0,children:e(le,{style:{marginTop:"0px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},error:!0,children:Ge(y.message)})}):null]})}),Mg=({fieldError:t})=>{const{i18n:i}=W();return e(Ii,{title:i.t(t.message),arrow:!0,children:e("span",{style:{display:"block",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%",color:"#d32f2f",fontSize:"0.75rem",marginTop:"7px",cursor:"pointer"},children:i.t(t.message)})})},_g=c((r,n)=>{const{value:a="",colDef:{cellEditorParams:{postValidationSetCrossAccessorValues:s=()=>{},uppercase:l=!1,defaultValue:c="",isNumber:u=!1,inputProps:A={},allowNegative:f=!0,allowLeadingZeros:m=!0,isAllowed:g=()=>!0,allowAlphaNumeric:w=!1}={},field:b,alignment:v="left"},node:y,api:B,onValueChange:C,context:x}=r,[F,S]=d(a),N=o(null),[E,k]=d(!1);p(n,()=>({getValue:()=>F})),h(()=>{N.current&&setTimeout(()=>{N.current?.select()},0)},[]);const T=y.data?.errors?.find(e=>e.field===b);return t(i,{children:[e(Te,{defaultValue:c,variant:"outlined",fullWidth:!0,size:"small",value:F,inputRef:N,onFocus:()=>{N.current?.select(),y.setDataValue("disableChequeDate",void 0)},InputProps:{...A,endAdornment:E?e(he,{size:20,color:"secondary"}):null},sx:{"& input":{textAlign:v,border:"none",padding:"4px 4px"},"& fieldset":{border:"none"}},onChange:e=>{let t=e.target.value;if(u){if(t=t.replace(/[^0-9.\- ]/g,""),(t.match(/\./g)||[]).length>1)return;if(!f&&t.startsWith("-"))return;m||(t=t.replace(/^0+/,""))}else w||(t=t.replace(/[^a-zA-Z ]/g,""));if(l&&(t=t.toUpperCase()),g&&!g({value:t}))return;S(t);const i={...y.data,[b]:t};y.setData(i),C?.(t)},onBlur:async e=>{e.preventDefault(),"function"==typeof s&&await s(F,y,B,b,C,x)}}),P(y.data?.errors)&&T?e(ne,{title:Ge(T.message),arrow:!0,children:e(le,{style:{marginTop:"0px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},error:!0,children:Ge(T.message)})}):null]})}),jg={autocomplete:Og,CustomButtonCellEditor:Qg,amountField:r=>{const{value:n=0,colDef:{cellEditorParams:{postValidationSetCrossAccessorValues:a,maxLength:s},field:l},node:c,api:u,onValueChange:A,context:p}=r,[f,m]=d(n),[g,w]=d(!1),{dynamicAmountSymbol:b}=ns(),v=o(null);h(()=>{v.current&&setTimeout(()=>{v.current?.select()},0)},[]);if(c?.rowPinned)return null;const y=c.data?.errors?.find(e=>e.field===l);return t(i,{children:[e(Ht,{value:f,thousandSeparator:!0,decimalScale:2,fixedDecimalScale:!0,allowNegative:!1,customInput:Te,variant:"outlined",fullWidth:!0,size:"small",inputRef:v,onFocus:()=>{v.current&&v.current.select()},onValueChange:e=>{m(e.floatValue);const t={...c.data,[l]:e.floatValue};c.setData(t),A(e.floatValue)},onBlur:async()=>{"function"==typeof a&&await a(f,c,u,l,A,p)},sx:{"& input":{textAlign:"right",border:"none",padding:"4px 4px"},"& fieldset":{border:"none"}},InputProps:{style:{textAlign:"right"},startAdornment:e(se,{position:"start",children:$o(b)}),endAdornment:e(se,{position:"end",children:g&&e(he,{color:"secondary",size:20})})},valueIsNumericString:!1,isAllowed:e=>{const{value:t}=e;return void 0===t||(!s||t.length<=s)}}),P(c.data?.errors)&&y?e(ne,{title:Ge(y.message),arrow:!0,children:e(le,{style:{marginTop:"0px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},error:!0,children:Ge(y.message)})}):null]})},NumberFormat:_g,DatePickerCell:Hg,DisplayCurrencyCell:i=>{const{dynamicAmountSymbol:r,decimalCount:n,currencyFormat:a}=ns(),s=au(isNaN(i.value)?0:parseFloat(i.value||"0"),$o(r),a,n),o="function"==typeof i.colDef.editable?i.colDef.editable(i):i.colDef.editable;if(h(()=>{i.eGridCell&&(i.eGridCell.style.backgroundColor=o?"transparent":"var(--theme-color7)")},[o,i.eGridCell]),i.node?.rowPinned)return i.value??null;const l=i.node?.data?.errors||[],c=l.find(e=>e.field===i.colDef.field);l&&Ig(l,i);return"function"==typeof i?.colDef?.shouldExclude&&i?.colDef?.shouldExclude(i)?null:e("div",{style:{display:"flex",flexDirection:"column"},children:e("span",{children:i.value||!I(c?.message)?t("div",{style:{display:"flex",flexDirection:"column"},children:[e("span",{className:"cell-value",children:i.value?s:""}),!I(c?.message)&&e(Mg,{fieldError:c})]}):e("span",{className:"cell-placeholder",children:"₹0.00"})})})},DisplayDateCell:i=>{const r=i.node?.data?.errors||[],n=r.find(e=>e.field===i.colDef.field);r&&Ig(r,i);const a="function"==typeof i.colDef.editable?i.colDef.editable(i):i.colDef.editable;if(h(()=>{i.eGridCell&&(i.eGridCell.style.backgroundColor=a?"transparent":"var(--theme-color7)")},[a,i.eGridCell]),i.node?.rowPinned)return i.value??null;return"function"==typeof i?.colDef?.shouldExclude&&i?.colDef?.shouldExclude(i)?null:e("div",{style:{display:"flex",flexDirection:"column"},children:e("span",{children:i.value||!I(n?.message)?t("div",{style:{display:"flex",flexDirection:"column"},children:[e("span",{className:"cell-value",children:i.value}),!I(n?.message)&&e(Mg,{fieldError:n})]}):e("span",{className:"cell-placeholder",children:i.colDef?.headerName})})})},DisplaySelectCell:i=>{const{value:r,colDef:{cellEditorParams:n,field:a,editable:s,headerName:o,name:l},node:c,context:d}=i,u=c?.data?.errors||[],A=u.find(e=>e.field===a);u&&Ig(u,i);const p="function"==typeof s?s(i):s;if(h(()=>{let e=d.state?.[a]||[];if(I(e))(async()=>{if("function"==typeof n?.options){const e=await n.options();d.updateState(a,e);const t=e.find(e=>e?.value===r);t&&c.setData({...c.data,[l]:t?.label})}})();else{const t=e.find(e=>e?.value===r);t&&c.setData({...c.data,[l]:t?.label})}},[]),h(()=>{i.eGridCell&&(i.eGridCell.style.backgroundColor=p?"transparent":"var(--theme-color7)")},[p,i.eGridCell]),c?.rowPinned)return r||!1;return"function"==typeof i?.colDef?.shouldExclude&&i?.colDef?.shouldExclude(i)?null:e("div",{style:{display:"flex",flexDirection:"column"},children:e("span",{children:c.data?.[l]||r||!I(A?.message)?t("div",{style:{display:"flex",flexDirection:"column"},children:[e("span",{className:"cell-value",children:c.data?.[l]||r}),!I(A?.message)&&e(Mg,{fieldError:A})]}):e("span",{className:"cell-placeholder",children:o})})})},DisplayCell:i=>{const r=i.node?.data?.errors||[],n=r.find(e=>e.field===i.colDef.field);r&&Ig(r,i);const a="function"==typeof i.colDef.editable?i.colDef.editable(i):i.colDef.editable;if(h(()=>{i.eGridCell&&(i.eGridCell.style.backgroundColor=a?"transparent":"var(--theme-color7)")},[a,i.eGridCell]),i.node?.rowPinned)return i.value??null;return"function"==typeof i?.colDef?.shouldExclude&&i?.colDef?.shouldExclude(i)?null:e("div",{style:{display:"flex",flexDirection:"column"},children:e("span",{children:i.value||!I(n?.message)?t("div",{style:{display:"flex",flexDirection:"column"},children:[e("span",{className:"cell-value",children:i?.value}),!I(n?.message)&&e(Mg,{fieldError:n})]}):e("span",{className:"cell-placeholder",children:i.colDef?.headerName})})})}},zg={abortEarly:!1,strict:!1},Vg=(e,t,i)=>async(t,i,r)=>{try{await e.validate(t,zg);const n=(i.data.errors||[]).filter(e=>e.field!==r);i.setData({...i.data,errors:n})}catch(e){const t=[...(i.data.errors||[]).filter(e=>e.field!==r),{field:r,message:e.message}];return i.setData({...i.data,errors:t}),e instanceof E.ValidationError?e.errors[0]:e.message}};const Kg=t=>{const{agGridProps:{columnDefs:i,rowData:n,id:c,onCellValueChanged:u=()=>{}},loading:A,defaultView:p,updatePinnedBottomRow:f=()=>{},handleCustomCellKeyDown:m,handleAddNewRow:g}=t,{i18n:w}=W(),b=o(),[v,y]=d(c),B=s(()=>function(e,t){return e.map(e=>{const{accessor:i,columnName:r,componentType:n,FormatProps:a,className:s,hide:o,displayComponentType:l,headerTooltip:h,postValidationSetCrossAccessorValues:c,isVisible:d,options:u,isReadOnly:A,...p}=e;return{headerName:`${t.t(r)}`,headerTooltip:`${t.t(h)}`,headerValueGetter:()=>t.t(r),field:i,cellEditor:n||void 0,cellEditorParams:{postValidationSetCrossAccessorValues:c,...a,options:u},className:s,hide:!1===d&&!d,cellRenderer:l||"DisplayCell",cellStyle:t=>e.alignment?{textAlign:e.alignment}:{textAlign:"left"},..."agCheckboxCellEditor"===n&&{onCellValueChanged:async e=>{"function"==typeof c&&await c(e)}},editable:t=>{const i=t.context?.gridContext?.mode??"new",r={edit:e.__EDIT__,view:e.__VIEW__,new:e.__NEW__}[i.toLowerCase()];return"function"==typeof r?.isReadOnly?!r.isReadOnly(t):"function"==typeof A?!A(t):"boolean"==typeof r?.isReadOnly?!r.isReadOnly:"boolean"!=typeof A||!A},...p}})}(i,w),[i,w]),{MessageBox:C}=fd(),{setGridData:x}=a(Gg),F=(e=>{const[t,i]=d({});return{...e,state:t,updateState:r.useCallback((e,t)=>{i(i=>({...i,[e]:t}))},[])}})({MessageBox:C,updatePinnedBottomRow:f,gridContext:t?.gridContext}),S=l(e=>{const{api:i}=e;b.current=i,i.autoSizeAllColumns(),t.getGridApi&&(t.getGridApi.current=i)},[t.getGridApi]),N=l(e=>{const{api:i}=e;if(i.autoSizeAllColumns(),f(),t.autoSelectFirst){i.deselectAll();let e=i.getRowNode(0);e?.setSelected(!0,!0)}},[t.autoSelectFirst]),k=s(()=>jg,[]);return h(()=>{y(c||`table-${String(1e17*Math.random()).substring(0,15)}`)},[c]),h(()=>{b.current&&(A?b.current.showLoadingOverlay():(b.current.hideOverlay(),n?.length||b.current.showNoRowsOverlay()))},[A,b.current,n]),h(()=>{const e=()=>{b.current&&setTimeout(()=>{b?.current.sizeColumnsToFit()},100)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[b]),h(()=>{b.current&&(b.current?.refreshHeader(),b.current.redrawRows())},[w.language]),{gridApi:b,tableId:v,allColumns:B,gridContext:F,onGridReady:S,onFirstDataRendered:N,onCellKeyDown:async e=>{const{event:t,column:{colDef:i},api:r,node:n}=e;if("new"!==p)return;if("Tab"===t.key&&t.shiftKey)return;if("Tab"!==t.key&&"Enter"!==t.key)return;const a=Eg(b,e),s=kg(b,e);if("function"==typeof m&&await m(e,a),"Enter"===t.key&&t.shiftKey)setTimeout(()=>{r.tabToPreviousCell()},50);else if(i.field===a.colDef?.field){const e=r.getDisplayedRowCount(),t=!!r.getRowNode(e-1)?.data&&Object.values(r.getRowNode(e-1).data).every(e=>null==e||""===e),i=n.rowIndex+1;t||e!==i||("function"==typeof g?g():b.current.applyTransaction({add:[{}]}),setTimeout(()=>{r.setFocusedCell(n.rowIndex+1,s?.colDef?.field),b.current.startEditingCell({rowIndex:n.rowIndex+1,colKey:s?.colDef?.field})},50))}else setTimeout(()=>{"Enter"===t.key&&r.tabToNextCell()},50)},onAddClick:()=>{"function"==typeof g?g():b.current.applyTransaction({add:[{}]});const e=[];b.current.forEachNode(t=>e.push(t.data));const t={node:{data:e[e?.length-1]}},i=b.current.getAllDisplayedColumns().filter(e=>e.colDef?.cellEditorParams?.isFieldFocused)?.[0],r=kg(b,t);setTimeout(()=>{b.current.setFocusedCell(e.length-1,i?i?.colDef?.field:r?.colDef?.field),b.current.startEditingCell({rowIndex:e.length-1,colKey:i?i?.colDef?.field:r?.colDef?.field}),"function"==typeof f&&f()},100)},components:k,onCellEditingStopped:async e=>{const{colDef:{field:t,schemaValidation:i,validate:r},node:n,api:a,value:s}=e,o=s??n?.data[t];if(x(e=>e.map((e,i)=>i===n.rowIndex?{...e,[t]:o}:e)),i){const e=(e=>{if(void 0===e)return;const{type:t,rules:i}=e;if(!E[t])return;if(!Array.isArray(i))return;let r=E[t]();return i.forEach(e=>{const{params:t,name:i}=e;r[i]&&(r=r[i](...t))}),Vg(r)})(i);e&&await e(o,n,t)}if(r){const i=r(e);if(i){const e=[...(n.data.errors||[]).filter(e=>e.field!==t),{field:t,message:i}];n.setData({...n.data,errors:e})}else{const e=(n.data.errors||[]).filter(e=>e.field!==t);n.setData({...n.data,errors:e})}}},noDataComponent:()=>e("span",{style:{fontStyle:"italic",color:"rgba(133, 130, 130, 0.8)"},children:w.t("NoDataFound")}),onCellValueChanged:u,i18n:w}},qg=({buttons:t})=>t&&0!==t.length?e(i,{children:t.map((t,i)=>e(eo,{onClick:t.onClick,disabled:t.disabled,...t,children:t.label},i))}):null;Fr.registerModules([Sr,Nr,Er,kr]);const Gg=n({gridData:[],setGridData:e=>{}}),Wg=r.memo(i=>{const[r,n]=d(i.agGridProps.rowData||[]),{tableId:a,allColumns:s,gridContext:o,onGridReady:l,onFirstDataRendered:h,onCellKeyDown:c,onAddClick:u,components:A,onCellEditingStopped:p,noDataComponent:f,i18n:m,onCellValueChanged:g}=Kg({...i});i={...i,defaultColDef:{...i.defaultColDef,flex:1,suppressMovable:!0,unSortIcon:!0,resizable:!0,suppressSizeToFit:!0,onCellValueChanged:g}};const{hideHeader:w=!1,agGridProps:b={},defaultView:v="new",gridConfig:y={},buttons:B=[],isNewButtonVisible:C=!0,newButtonLabel:x}=i;return e(Gg.Provider,{value:{gridData:r,setGridData:n},children:t("div",{className:"main-container",children:[!w&&t(xe,{style:{paddingLeft:"24px",paddingRight:"24px",background:"var(--primary-bg)",borderTopLeftRadius:"4px",borderTopRightRadius:"4px",minHeight:"48px",height:"48px",display:"flex",justifyContent:"space-between"},children:[t(X,{style:{color:"var(--white)",fontWeight:"500",fontSize:"1.5rem !important",lineHeight:"1.6 !important",letterSpacing:"0.0075em !important"},color:"inherit",variant:"h6",children:[y.gridLabel," ",i.subLabel]}),t("div",{children:[C&&t(eo,{onClick:u,children:[" ",x?m.t(x):m.t("new")]}),e(qg,{buttons:B})]})]}),e("div",{className:"ag-theme-alpine custom-grid",style:{height:i.height||"400px",width:"100%"},children:e(Tr,{onGridReady:l,...b,columnDefs:s,onFirstDataRendered:h,context:{...o,gridData:r,setGridData:n},rowData:I(r)?i.agGridProps?.rowData:r,rowHeight:30,headerHeight:35,onCellKeyDown:c,suppressClickEdit:!C,suppressCellFocus:!C,suppressHeaderFocus:!0,components:A,onCellEditingStopped:p,suppressMovableColumns:!0,noRowsOverlayComponent:f},a)})]})})}),Jg=(e,t)=>isNaN(new Date(e)?.getTime())?e:ze(new Date(e),t),Xg=(e,t,i)=>{if(!e||!Array.isArray(e))return"-";return au(e.reduce((e,i)=>{const r=Number(i[t.accessor]??0);return e+(isNaN(r)?0:r)},0),t?.isVisibleCurrSymbol?$o(t?.currencySymbol??i.dynamicAmountSymbol):"",t?.currencyFormat??i.currencyFormat,t?.decimalCount??i.decimalCount,t?.symbolPosition??"start")},Yg=(e,t)=>(e.data?e.data.reduce((e,i)=>{const r=Number(i[t.accessor]||0);return e+(isNaN(r)?0:r)},0):0)+(e.groups?e.groups.reduce((e,i)=>e+Yg(i,t),0):0);io(".layout-report-parent td{padding:6px 10px!important}.layout-report-parent thead tr{background:var(--theme-color4)}.layout-report-parent .group-name{align-items:center;display:flex;white-space:nowrap}.layout-report-parent .footer-row{background-color:var(--theme-color4)}.layout-report-parent .footer-row td{color:var(--theme-color1);font-size:.875rem;font-weight:600!important;white-space:nowrap}.layout-report-parent .footer-row.p0 td{padding:0!important}");function $g(e){return()=>e}function Zg(e){e()}function ew(e,t){return i=>e(t(i))}function tw(e,t){return()=>e(t)}function iw(e){return void 0!==e}function rw(){}function nw(e,t){return t(e),e}function aw(e,t){return t(e)}function sw(...e){return e}function ow(e,t){return e(1,t)}function lw(e,t){e(0,t)}function hw(e){e(2)}function cw(e){return e(4)}function dw(e,t){return ow(e,function(e,t){return i=>e(t,i)}(t,0))}function uw(e,t){const i=e(1,e=>{i(),t(e)});return i}function Aw(e){let t,i;return r=>n=>{t=n,i&&clearTimeout(i),i=setTimeout(()=>{r(t)},e)}}function pw(e,t){return e===t}function fw(e=pw){let t;return i=>r=>{e(t,r)||(t=r,i(r))}}function mw(e){return t=>i=>{e(i)&&t(i)}}function gw(e){return t=>ew(t,e)}function ww(e){return t=>()=>{t(e)}}function bw(e,...t){const i=function(...e){return t=>e.reduceRight(aw,t)}(...t);return(t,r)=>{switch(t){case 2:return void hw(e);case 1:return ow(e,i(r))}}}function vw(e,t){return i=>r=>{i(t=e(t,r))}}function yw(e){return t=>i=>{e>0?e--:t(i)}}function Bw(e){let t,i=null;return r=>n=>{i=n,!t&&(t=setTimeout(()=>{t=void 0,r(i)},e))}}function Cw(...e){const t=new Array(e.length);let i=0,r=null;const n=2**e.length-1;return e.forEach((e,a)=>{const s=2**a;ow(e,e=>{const o=i;i|=s,t[a]=e,o!==n&&i===n&&r&&(r(),r=null)})}),e=>a=>{const s=()=>{e([a].concat(t))};i===n?s():r=s}}function xw(e){let t=e;const i=Sw();return(e,r)=>{switch(e){case 0:t=r;break;case 1:r(t);break;case 4:return t}return i(e,r)}}function Fw(e,t){return nw(xw(t),t=>dw(e,t))}function Sw(){const e=[];return(t,i)=>{switch(t){case 0:return void e.slice().forEach(e=>{e(i)});case 2:return void e.splice(0,e.length);case 1:return e.push(i),()=>{const t=e.indexOf(i);t>-1&&e.splice(t,1)}}}}function Nw(e){return nw(Sw(),t=>dw(e,t))}function Ew(e,t=[],{singleton:i}={singleton:!0}){return{constructor:e,dependencies:t,id:kw(),singleton:i}}const kw=()=>Symbol();function Tw(...e){const t=Sw(),i=new Array(e.length);let r=0;const n=2**e.length-1;return e.forEach((e,a)=>{const s=2**a;ow(e,e=>{i[a]=e,r|=s,r===n&&lw(t,i)})}),function(e,a){switch(e){case 2:return void hw(t);case 1:return r===n&&a(i),ow(t,a)}}}function Lw(e,t=pw){return bw(e,fw(t))}function Iw(...e){return function(t,i){switch(t){case 2:return;case 1:return function(...e){return()=>{e.map(Zg)}}(...e.map(e=>ow(e,i)))}}}const Dw=0,Uw=1,Pw=2,Rw=3,Ow={[Dw]:"debug",[Rw]:"error",[Uw]:"log",[Pw]:"warn"},Qw=Ew(()=>{const e=xw(Rw);return{log:xw((t,i,r=Uw)=>{r>=((typeof globalThis>"u"?window:globalThis).VIRTUOSO_LOG_LEVEL??cw(e))&&console[Ow[r]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",t,i)}),logLevel:e}},[],{singleton:!0});function Hw(e,t,i){return Mw(e,t,i).callbackRef}function Mw(e,t,i){const n=r.useRef(null);let a=e=>{};const s=r.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(t=>{const r=()=>{const i=t[0].target;null!==i.offsetParent&&e(i)};i?r():requestAnimationFrame(r)}):null,[e,i]);return a=e=>{e&&t?(s?.observe(e),n.current=e):(n.current&&s?.unobserve(n.current),n.current=null)},{callbackRef:a,ref:n}}function _w(e,t,i,n,a,s,o,l,h){const c=r.useCallback(i=>{const r=function(e,t,i,r){const n=e.length;if(0===n)return null;const a=[];for(let s=0;s<n;s++){const n=e.item(s);if(void 0===n.dataset.index)continue;const o=parseInt(n.dataset.index),l=parseFloat(n.dataset.knownSize),h=t(n,i);if(0===h&&r("Zero-sized element, this should not happen",{child:n},Rw),h===l)continue;const c=a[a.length-1];0===a.length||c.size!==h||c.endIndex!==o-1?a.push({endIndex:o,size:h,startIndex:o}):a[a.length-1].endIndex++}return a}(i.children,t,"offsetHeight",a);let s=i.parentElement;for(;void 0===s.dataset.virtuosoScroller;)s=s.parentElement;const l="window"===s.lastElementChild.dataset.viewportType;let h;l&&(h=s.ownerDocument.defaultView);const c=o?o.scrollTop:l?h.scrollY||h.document.documentElement.scrollTop:s.scrollTop,d=o?o.scrollHeight:l?h.document.documentElement.scrollHeight:s.scrollHeight,u=o?o.offsetHeight:l?h.innerHeight:s.offsetHeight;n({scrollHeight:d,scrollTop:Math.max(c,0),viewportHeight:u}),null!==r&&e(r)},[e,t,a,s,o,n,l]);return Mw(c,i,h)}function jw(e,t,i){const n=r.useRef(null),a=r.useCallback(i=>{if(!i?.offsetParent)return;const r=i.getBoundingClientRect(),a=r.width;let s,l;if(t){const e=t.getBoundingClientRect(),i=r.top-e.top;l=e.height-Math.max(0,i),s=i+t.scrollTop}else{const e=o.current.ownerDocument.defaultView;l=e.innerHeight-Math.max(0,r.top),s=r.top+e.scrollY}n.current={offsetTop:s,visibleHeight:l,visibleWidth:a},e(n.current)},[e,t]),{callbackRef:s,ref:o}=Mw(a,!0,i),l=r.useCallback(()=>{a(o.current)},[a,o]);return r.useEffect(()=>{if(t){t.addEventListener("scroll",l);const e=new ResizeObserver(()=>{requestAnimationFrame(l)});return e.observe(t),()=>{t.removeEventListener("scroll",l),e.unobserve(t)}}const e=o.current?.ownerDocument.defaultView;return e?.addEventListener("scroll",l),e?.addEventListener("resize",l),()=>{e?.removeEventListener("scroll",l),e?.removeEventListener("resize",l)}},[l,t,o]),s}const zw=Ew(()=>{const e=Sw(),t=Sw(),i=xw(0),r=Sw(),n=xw(0),a=Sw(),s=Sw(),o=xw(0),l=xw(0),h=xw(0),c=xw(0),d=Sw(),u=Sw(),A=xw(!1),p=xw(!1),f=xw(!1);return dw(bw(e,gw(({scrollTop:e})=>e)),t),dw(bw(e,gw(({scrollHeight:e})=>e)),s),dw(t,n),{deviation:i,fixedFooterHeight:h,fixedHeaderHeight:l,footerHeight:c,headerHeight:o,horizontalDirection:p,scrollBy:u,scrollContainerState:e,scrollHeight:s,scrollingInProgress:A,scrollTo:d,scrollTop:t,skipAnimationFrameInResizeObserver:f,smoothScrollTargetReached:r,statefulScrollTop:n,viewportHeight:a}},[],{singleton:!0}),Vw={lvl:0};function Kw(e,t){const i=e.length;if(0===i)return[];let{index:r,value:n}=t(e[0]);const a=[];for(let s=1;s<i;s++){const{index:i,value:o}=t(e[s]);a.push({end:i-1,start:r,value:n}),r=i,n=o}return a.push({end:1/0,start:r,value:n}),a}function qw(e){return e===Vw}function Gw(e,t){if(!qw(e))return t===e.k?e.v:t<e.k?Gw(e.l,t):Gw(e.r,t)}function Ww(e,t,i="k"){if(qw(e))return[-1/0,void 0];if(Number(e[i])===t)return[e.k,e.v];if(Number(e[i])<t){const r=Ww(e.r,t,i);return r[0]===-1/0?[e.k,e.v]:r}return Ww(e.l,t,i)}function Jw(e,t,i){return qw(e)?sb(t,i,1):t===e.k?ib(e,{k:t,v:i}):t<e.k?ob(ib(e,{l:Jw(e.l,t,i)})):ob(ib(e,{r:Jw(e.r,t,i)}))}function Xw(){return Vw}function Yw(e,t,i){if(qw(e))return[];return function(e){return Kw(e,({k:e,v:t})=>({index:e,value:t}))}(eb(e,Ww(e,t)[0],i))}function $w(e,t){if(qw(e))return Vw;const{k:i,l:r,r:n}=e;if(t===i){if(qw(r))return n;if(qw(n))return r;const[t,i]=ab(r);return tb(ib(e,{k:t,l:rb(r),v:i}))}return tb(ib(e,t<i?{l:$w(r,t)}:{r:$w(n,t)}))}function Zw(e){return qw(e)?[]:[...Zw(e.l),{k:e.k,v:e.v},...Zw(e.r)]}function eb(e,t,i){if(qw(e))return[];const{k:r,l:n,r:a,v:s}=e;let o=[];return r>t&&(o=o.concat(eb(n,t,i))),r>=t&&r<=i&&o.push({k:r,v:s}),r<=i&&(o=o.concat(eb(a,t,i))),o}function tb(e){const{l:t,lvl:i,r:r}=e;if(r.lvl>=i-1&&t.lvl>=i-1)return e;if(i>r.lvl+1){if(nb(t))return lb(ib(e,{lvl:i-1}));if(!qw(t)&&!qw(t.r))return ib(t.r,{l:ib(t,{r:t.r.l}),lvl:i,r:ib(e,{l:t.r.r,lvl:i-1})});throw new Error("Unexpected empty nodes")}if(nb(e))return hb(ib(e,{lvl:i-1}));if(!qw(r)&&!qw(r.l)){const t=r.l,n=nb(t)?r.lvl-1:r.lvl;return ib(t,{l:ib(e,{lvl:i-1,r:t.l}),lvl:t.lvl+1,r:hb(ib(r,{l:t.r,lvl:n}))})}throw new Error("Unexpected empty nodes")}function ib(e,t){return sb(void 0!==t.k?t.k:e.k,void 0!==t.v?t.v:e.v,void 0!==t.lvl?t.lvl:e.lvl,void 0!==t.l?t.l:e.l,void 0!==t.r?t.r:e.r)}function rb(e){return qw(e.r)?e.l:tb(ib(e,{r:rb(e.r)}))}function nb(e){return qw(e)||e.lvl>e.r.lvl}function ab(e){return qw(e.r)?[e.k,e.v]:ab(e.r)}function sb(e,t,i,r=Vw,n=Vw){return{k:e,l:r,lvl:i,r:n,v:t}}function ob(e){return hb(lb(e))}function lb(e){const{l:t}=e;return qw(t)||t.lvl!==e.lvl?e:ib(t,{r:ib(e,{l:t.r})})}function hb(e){const{lvl:t,r:i}=e;return qw(i)||qw(i.r)||i.lvl!==t||i.r.lvl!==t?e:ib(i,{l:ib(e,{r:i.l}),lvl:t+1})}function cb(e,t){return!(!e||e.startIndex!==t.startIndex||e.endIndex!==t.endIndex)}function db(e,t){return!(!e||e[0]!==t[0]||e[1]!==t[1])}const ub=Ew(()=>({recalcInProgress:xw(!1)}),[],{singleton:!0});function Ab(e,t,i){return e[pb(e,t,i)]}function pb(e,t,i,r=0){let n=e.length-1;for(;r<=n;){const a=Math.floor((r+n)/2),s=i(e[a],t);if(0===s)return a;if(-1===s){if(n-r<2)return a-1;n=a-1}else{if(n===r)return a;r=a+1}}throw new Error(`Failed binary finding record in array - ${e.join(",")}, searched for ${t}`)}function fb(e,t){return Math.round(e.getBoundingClientRect()[t])}function mb(e){return!qw(e.groupOffsetTree)}function gb({index:e},t){return t===e?0:t<e?-1:1}function wb({offset:e},t){return t===e?0:t<e?-1:1}function bb(e,t,i){if(0===t.length)return 0;const{index:r,offset:n,size:a}=Ab(t,e,gb),s=e-r,o=a*s+(s-1)*i+n;return o>0?o+i:o}function vb(e,t){if(!mb(t))return e;let i=0;for(;t.groupIndices[i]<=e+i;)i++;return e+i}function yb(e,t,i){if(function(e){return typeof e.groupIndex<"u"}(e))return t.groupIndices[e.groupIndex]+1;let r=vb("LAST"===e.index?i:e.index,t);return r=Math.max(0,r,Math.min(i,r)),r}function Bb(e,t,i,r=0){return r>0&&(t=Math.max(t,Ab(e,r,gb).offset)),Kw(function(e,t,i,r){const n=pb(e,t,r),a=pb(e,i,r,n);return e.slice(n,a+1)}(e,t,i,wb),Sb)}function Cb(e,[t,i,r,n]){t.length>0&&r("received item sizes",t,Dw);const a=e.sizeTree;let s=a,o=0;if(i.length>0&&qw(a)&&2===t.length){const e=t[0].size,r=t[1].size;s=i.reduce((t,i)=>Jw(Jw(t,i,e),i+1,r),s)}else[s,o]=function(e,t){let i=qw(e)?0:1/0;for(const r of t){const{endIndex:t,size:n,startIndex:a}=r;if(i=Math.min(i,a),qw(e)){e=Jw(e,0,n);continue}const s=Yw(e,a-1,t+1);if(s.some(Nb(r)))continue;let o=!1,l=!1;for(const{end:i,start:r,value:a}of s)o?(t>=r||n===a)&&(e=$w(e,r)):(l=a!==n,o=!0),i>t&&t>=r&&a!==n&&(e=Jw(e,t+1,a));l&&(e=Jw(e,a,n))}return[e,i]}(s,t);if(s===a)return e;const{lastIndex:l,lastOffset:h,lastSize:c,offsetTree:d}=Fb(e.offsetTree,o,s,n);return{groupIndices:i,groupOffsetTree:i.reduce((e,t)=>Jw(e,t,bb(t,d,n)),Xw()),lastIndex:l,lastOffset:h,lastSize:c,offsetTree:d,sizeTree:s}}function xb(e,t){let i=0,r=0;for(;i<e;)i+=t[r+1]-t[r]-1,r++;return r-(i===e?0:1)}function Fb(e,t,i,r){let n=e,a=0,s=0,o=0,l=0;if(0!==t){l=pb(n,t-1,gb),o=n[l].offset;const e=Ww(i,t-1);a=e[0],s=e[1],n.length&&n[l].size===Ww(i,t)[1]&&(l-=1),n=n.slice(0,l+1)}else n=[];for(const{start:e,value:l}of Yw(i,t,1/0)){const t=e-a,i=t*s+o+t*r;n.push({index:e,offset:i,size:l}),a=e,o=i,s=l}return{lastIndex:a,lastOffset:o,lastSize:s,offsetTree:n}}function Sb(e){return{index:e.index,value:e}}function Nb(e){const{endIndex:t,size:i,startIndex:r}=e;return e=>e.start===r&&(e.end===t||e.end===1/0)&&e.value===i}const Eb={offsetHeight:"height",offsetWidth:"width"},kb=Ew(([{log:e},{recalcInProgress:t}])=>{const i=Sw(),r=Sw(),n=Fw(r,0),a=Sw(),s=Sw(),o=xw(0),l=xw([]),h=xw(void 0),c=xw(void 0),d=xw(void 0),u=xw(void 0),A=xw((e,t)=>fb(e,Eb[t])),p=xw(void 0),f=xw(0),m={groupIndices:[],groupOffsetTree:Xw(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:Xw()},g=Fw(bw(i,Cw(l,e,f),vw(Cb,m),fw()),m),w=Fw(bw(l,fw(),vw((e,t)=>({current:t,prev:e.current}),{current:[],prev:[]}),gw(({prev:e})=>e)),[]);dw(bw(l,mw(e=>e.length>0),Cw(g,f),gw(([e,t,i])=>{const r=e.reduce((e,r,n)=>Jw(e,r,bb(r,t.offsetTree,i)||n),Xw());return{...t,groupIndices:e,groupOffsetTree:r}})),g),dw(bw(r,Cw(g),mw(([e,{lastIndex:t}])=>e<t),gw(([e,{lastIndex:t,lastSize:i}])=>[{endIndex:t,size:i,startIndex:e}])),i),dw(h,c);const b=Fw(bw(h,gw(e=>void 0===e)),!0);dw(bw(c,mw(e=>void 0!==e&&qw(cw(g).sizeTree)),gw(e=>{const t=cw(d),i=cw(l).length>0;return void 0!==t&&0!==t?i?[{endIndex:0,size:t,startIndex:0},{endIndex:1,size:e,startIndex:1}]:[]:[{endIndex:0,size:e,startIndex:0}]})),i),dw(bw(u,mw(e=>void 0!==e&&e.length>0&&qw(cw(g).sizeTree)),gw(e=>{const t=[];let i=e[0],r=0;for(let n=1;n<e.length;n++){const a=e[n];a!==i&&(t.push({endIndex:n-1,size:i,startIndex:r}),i=a,r=n)}return t.push({endIndex:e.length-1,size:i,startIndex:r}),t})),i),dw(bw(l,Cw(d,c),mw(([,e,t])=>void 0!==e&&void 0!==t),gw(([e,t,i])=>{const r=[];for(let n=0;n<e.length;n++){const a=e[n],s=e[n+1];r.push({startIndex:a,endIndex:a,size:t}),void 0!==s&&r.push({startIndex:a+1,endIndex:s-1,size:i})}return r})),i);const v=Nw(bw(i,Cw(g),vw(({sizes:e},[t,i])=>({changed:i!==e,sizes:i}),{changed:!1,sizes:m}),gw(e=>e.changed)));ow(bw(o,vw((e,t)=>({diff:e.prev-t,prev:t}),{diff:0,prev:0}),gw(e=>e.diff)),e=>{const{groupIndices:i}=cw(g);if(e>0)lw(t,!0),lw(a,e+xb(e,i));else if(e<0){const t=cw(w);t.length>0&&(e-=xb(-e,t)),lw(s,e)}}),ow(bw(o,Cw(e)),([e,t])=>{e<0&&t("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:o},Rw)});const y=Nw(a);dw(bw(a,Cw(g),gw(([e,t])=>{const i=t.groupIndices.length>0,r=[],n=t.lastSize;if(i){const i=Gw(t.sizeTree,0);let a=0,s=0;for(;a<e;){const e=t.groupIndices[s],o=t.groupIndices.length===s+1?1/0:t.groupIndices[s+1]-e-1;r.push({endIndex:e,size:i,startIndex:e}),r.push({endIndex:e+1+o-1,size:n,startIndex:e+1}),s++,a+=o+1}const o=Zw(t.sizeTree);return a!==e&&o.shift(),o.reduce((t,{k:i,v:r})=>{let n=t.ranges;return 0!==t.prevSize&&(n=[...t.ranges,{endIndex:i+e-1,size:t.prevSize,startIndex:t.prevIndex}]),{prevIndex:i+e,prevSize:r,ranges:n}},{prevIndex:e,prevSize:0,ranges:r}).ranges}return Zw(t.sizeTree).reduce((t,{k:i,v:r})=>({prevIndex:i+e,prevSize:r,ranges:[...t.ranges,{endIndex:i+e-1,size:t.prevSize,startIndex:t.prevIndex}]}),{prevIndex:0,prevSize:n,ranges:[]}).ranges})),i);const B=Nw(bw(s,Cw(g,f),gw(([e,{offsetTree:t},i])=>bb(-e,t,i))));return dw(bw(s,Cw(g,f),gw(([e,t,i])=>{if(t.groupIndices.length>0){if(qw(t.sizeTree))return t;let r=Xw();const n=cw(w);let a=0,s=0,o=0;for(;a<-e;){o=n[s];const e=n[s+1]-o-1;s++,a+=e+1}if(r=Zw(t.sizeTree).reduce((t,{k:i,v:r})=>Jw(t,Math.max(0,i+e),r),r),a!==-e){r=Jw(r,0,Gw(t.sizeTree,o));r=Jw(r,1,Ww(t.sizeTree,1-e)[1])}return{...t,sizeTree:r,...Fb(t.offsetTree,0,r,i)}}const r=Zw(t.sizeTree).reduce((t,{k:i,v:r})=>Jw(t,Math.max(0,i+e),r),Xw());return{...t,sizeTree:r,...Fb(t.offsetTree,0,r,i)}})),g),{beforeUnshiftWith:y,data:p,defaultItemSize:c,firstItemIndex:o,fixedItemSize:h,fixedGroupSize:d,gap:f,groupIndices:l,heightEstimates:u,itemSize:A,listRefresh:v,shiftWith:s,shiftWithOffset:B,sizeRanges:i,sizes:g,statefulTotalCount:n,totalCount:r,trackItemSizes:b,unshiftWith:a}},sw(Qw,ub),{singleton:!0});function Tb(e){return e.reduce((e,t)=>(e.groupIndices.push(e.totalCount),e.totalCount+=t+1,e),{groupIndices:[],totalCount:0})}const Lb=Ew(([{groupIndices:e,sizes:t,totalCount:i},{headerHeight:r,scrollTop:n}])=>{const a=Sw(),s=Sw(),o=Nw(bw(a,gw(Tb)));return dw(bw(o,gw(e=>e.totalCount)),i),dw(bw(o,gw(e=>e.groupIndices)),e),dw(bw(Tw(n,t,r),mw(([e,t])=>mb(t)),gw(([e,t,i])=>Ww(t.groupOffsetTree,Math.max(e-i,0),"v")[0]),fw(),gw(e=>[e])),s),{groupCounts:a,topItemsIndexes:s}},sw(kb,zw)),Ib=Ew(([{log:e}])=>{const t=xw(!1),i=Nw(bw(t,mw(e=>e),fw()));return ow(t,t=>{t&&cw(e)("props updated",{},Dw)}),{didMount:i,propsReady:t}},sw(Qw),{singleton:!0}),Db=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function Ub(e){const t="number"==typeof e?{index:e}:e;return t.align||(t.align="start"),(!t.behavior||!Db)&&(t.behavior="auto"),void 0===t.offset&&(t.offset=0),t}const Pb=Ew(([{gap:e,listRefresh:t,sizes:i,totalCount:r},{fixedFooterHeight:n,fixedHeaderHeight:a,footerHeight:s,headerHeight:o,scrollingInProgress:l,scrollTo:h,smoothScrollTargetReached:c,viewportHeight:d},{log:u}])=>{const A=Sw(),p=Sw(),f=xw(0);let m=null,g=null,w=null;function b(){null!==m&&(m(),m=null),null!==w&&(w(),w=null),g&&(clearTimeout(g),g=null),lw(l,!1)}return dw(bw(A,Cw(i,d,r,f,o,s,u),Cw(e,a,n),gw(([[e,i,r,n,a,s,o,h],d,u,f])=>{const v=Ub(e),{align:y,behavior:B,offset:C}=v,x=n-1,F=yb(v,i,x);let S=bb(F,i.offsetTree,d)+s;"end"===y?(S+=u+Ww(i.sizeTree,F)[1]-r+f,F===x&&(S+=o)):"center"===y?S+=(u+Ww(i.sizeTree,F)[1]-r+f)/2:S-=a,void 0!==C&&0!==C&&(S+=C);const N=t=>{b(),t?(h("retrying to scroll to",{location:e},Dw),lw(A,e)):(lw(p,!0),h("list did not change, scroll successful",{},Dw))};if(b(),"smooth"===B){let e=!1;w=ow(t,t=>{e=e||t}),m=uw(c,()=>{N(e)})}else m=uw(bw(t,function(e){return t=>{const i=setTimeout(()=>{t(!1)},e);return e=>{e&&(t(!0),clearTimeout(i))}}}(150)),N);return g=setTimeout(()=>{b()},1200),lw(l,!0),h("scrolling from index to",{behavior:B,index:F,top:S},Dw),{behavior:B,top:S}})),h),{scrollTargetReached:p,scrollToIndex:A,topListHeight:f}},sw(kb,zw,Qw),{singleton:!0});function Rb(e,t){0===e?t():requestAnimationFrame(()=>{Rb(e-1,t)})}function Ob(e,t){const i=t-1;return"number"==typeof e?e:"LAST"===e.index?i:e.index}const Qb=Ew(([{defaultItemSize:e,listRefresh:t,sizes:i},{scrollTop:r},{scrollTargetReached:n,scrollToIndex:a},{didMount:s}])=>{const o=xw(!0),l=xw(0),h=xw(!0);return dw(bw(s,Cw(l),mw(([e,t])=>0!==t),ww(!1)),o),dw(bw(s,Cw(l),mw(([e,t])=>0!==t),ww(!1)),h),ow(bw(Tw(t,s),Cw(o,i,e,h),mw(([[,e],t,{sizeTree:i},r,n])=>e&&(!qw(i)||iw(r))&&!t&&!n),Cw(l)),([,e])=>{uw(n,()=>{lw(h,!0)}),Rb(4,()=>{uw(r,()=>{lw(o,!0)}),lw(a,e)})}),{initialItemFinalLocationReached:h,initialTopMostItemIndex:l,scrolledToInitialItem:o}},sw(kb,zw,Pb,Ib),{singleton:!0});function Hb(e,t){return Math.abs(e-t)<1.01}const Mb="up",_b="down",jb={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},zb=Ew(([{footerHeight:e,headerHeight:t,scrollBy:i,scrollContainerState:r,scrollTop:n,viewportHeight:a}])=>{const s=xw(!1),o=xw(!0),l=Sw(),h=Sw(),c=xw(4),d=xw(0),u=Fw(bw(Iw(bw(Lw(n),yw(1),ww(!0)),bw(Lw(n),yw(1),ww(!1),Aw(100))),fw()),!1),A=Fw(bw(Iw(bw(i,ww(!0)),bw(i,ww(!1),Aw(200))),fw()),!1);dw(bw(Tw(Lw(n),Lw(d)),gw(([e,t])=>e<=t),fw()),o),dw(bw(o,Bw(50)),h);const p=Nw(bw(Tw(r,Lw(a),Lw(t),Lw(e),Lw(c)),vw((e,[{scrollHeight:t,scrollTop:i},r,n,a,s])=>{const o={scrollHeight:t,scrollTop:i,viewportHeight:r};if(i+r-t>-s){let t,r;return i>e.state.scrollTop?(t="SCROLLED_DOWN",r=e.state.scrollTop-i):(t="SIZE_DECREASED",r=e.state.scrollTop-i||e.scrollTopDelta),{atBottom:!0,atBottomBecause:t,scrollTopDelta:r,state:o}}let l;return l=o.scrollHeight>e.state.scrollHeight?"SIZE_INCREASED":r<e.state.viewportHeight?"VIEWPORT_HEIGHT_DECREASING":i<e.state.scrollTop?"SCROLLING_UPWARDS":"NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:l,state:o}},jb),fw((e,t)=>void 0!==e&&e.atBottom===t.atBottom))),f=Fw(bw(r,vw((e,{scrollHeight:t,scrollTop:i,viewportHeight:r})=>{if(!Hb(e.scrollHeight,t)){const n=t-(i+r)<1;return e.scrollTop!==i&&n?{changed:!0,jump:e.scrollTop-i,scrollHeight:t,scrollTop:i}:{changed:!0,jump:0,scrollHeight:t,scrollTop:i}}return{changed:!1,jump:0,scrollHeight:t,scrollTop:i}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),mw(e=>e.changed),gw(e=>e.jump)),0);dw(bw(p,gw(e=>e.atBottom)),s),dw(bw(s,Bw(50)),l);const m=xw(_b);dw(bw(r,gw(({scrollTop:e})=>e),fw(),vw((e,t)=>cw(A)?{direction:e.direction,prevScrollTop:t}:{direction:t<e.prevScrollTop?Mb:_b,prevScrollTop:t},{direction:_b,prevScrollTop:0}),gw(e=>e.direction)),m),dw(bw(r,Bw(50),ww("none")),m);const g=xw(0);return dw(bw(u,mw(e=>!e),ww(0)),g),dw(bw(n,Bw(100),Cw(u),mw(([e,t])=>t),vw(([e,t],[i])=>[t,i],[0,0]),gw(([e,t])=>t-e)),g),{atBottomState:p,atBottomStateChange:l,atBottomThreshold:c,atTopStateChange:h,atTopThreshold:d,isAtBottom:s,isAtTop:o,isScrolling:u,lastJumpDueToItemResize:f,scrollDirection:m,scrollVelocity:g}},sw(zw)),Vb="top",Kb="bottom",qb="none";function Gb(e,t,i){return"number"==typeof e?i===Mb&&t===Vb||i===_b&&t===Kb?e:0:i===Mb?t===Vb?e.main:e.reverse:t===Kb?e.main:e.reverse}function Wb(e,t){return"number"==typeof e?e:e[t]??0}const Jb=Ew(([{deviation:e,fixedHeaderHeight:t,headerHeight:i,scrollTop:r,viewportHeight:n}])=>{const a=Sw(),s=xw(0),o=xw(0),l=xw(0),h=Fw(bw(Tw(Lw(r),Lw(n),Lw(i),Lw(a,db),Lw(l),Lw(s),Lw(t),Lw(e),Lw(o)),gw(([e,t,i,[r,n],a,s,o,l,h])=>{const c=e-l,d=s+o,u=Math.max(i-c,0);let A=qb;const p=Wb(h,Vb),f=Wb(h,Kb);return r-=l,n+=i+o,(r+=i+o)>e+d-p&&(A=Mb),(n-=l)<e-u+t+f&&(A=_b),A!==qb?[Math.max(c-i-Gb(a,Vb,A)-p,0),c-u-o+t+Gb(a,Kb,A)+f]:null}),mw(e=>null!==e),fw(db)),[0,0]);return{increaseViewportBy:o,listBoundary:a,overscan:l,topListHeight:s,visibleRange:h}},sw(zw),{singleton:!0});const Xb={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function Yb(e,t,i,r,n,a){const{lastIndex:s,lastOffset:o,lastSize:l}=n;let h=0,c=0;if(e.length>0){h=e[0].offset;const t=e[e.length-1];c=t.offset+t.size}const d=i-s,u=h,A=o+d*l+(d-1)*r-c;return{bottom:c,firstItemIndex:a,items:Zb(e,n,a),offsetBottom:A,offsetTop:h,top:u,topItems:Zb(t,n,a),topListHeight:t.reduce((e,t)=>t.size+e,0),totalCount:i}}function $b(e,t,i,r,n,a){let s=0;if(i.groupIndices.length>0)for(const t of i.groupIndices){if(t-s>=e)break;s++}const o=e+s,l=Ob(t,o);return Yb(Array.from({length:o}).map((e,t)=>({data:a[t+l],index:t+l,offset:0,size:0})),[],o,n,i,r)}function Zb(e,t,i){if(0===e.length)return[];if(!mb(t))return e.map(e=>({...e,index:e.index+i,originalIndex:e.index}));const r=e[0].index,n=e[e.length-1].index,a=[],s=Yw(t.groupOffsetTree,r,n);let o,l=0;for(const r of e){let e;(!o||o.end<r.index)&&(o=s.shift(),l=t.groupIndices.indexOf(o.start)),e=r.index===o.start?{index:l,type:"group"}:{groupIndex:l,index:r.index-(l+1)+i},a.push({...e,data:r.data,offset:r.offset,originalIndex:r.index,size:r.size})}return a}function ev(e,t){return void 0===e?0:"number"==typeof e?e:e[t]??0}const tv=Ew(([{data:e,firstItemIndex:t,gap:i,sizes:r,totalCount:n},a,{listBoundary:s,topListHeight:o,visibleRange:l},{initialTopMostItemIndex:h,scrolledToInitialItem:c},{topListHeight:d},u,{didMount:A},{recalcInProgress:p}])=>{const f=xw([]),m=xw(0),g=Sw(),w=xw(0);dw(a.topItemsIndexes,f);const b=Fw(bw(Tw(A,p,Lw(l,db),Lw(n),Lw(r),Lw(h),c,Lw(f),Lw(t),Lw(i),Lw(w),e),mw(([e,t,,i,,,,,,,,r])=>{const n=void 0!==r&&r.length!==i;return e&&!t&&!n}),gw(([,,[e,t],i,r,n,a,s,o,l,h,c])=>{const d=r,{offsetTree:u,sizeTree:A}=d,p=cw(m);if(0===i)return{...Xb,totalCount:i};if(0===e&&0===t)return 0===p?{...Xb,totalCount:i}:$b(p,n,r,o,l,c||[]);if(qw(A))return p>0?null:Yb(function(e,t,i){if(mb(t)){const r=vb(e,t);return[{index:Ww(t.groupOffsetTree,r)[0],offset:0,size:0},{data:i?.[0],index:r,offset:0,size:0}]}return[{data:i?.[0],index:e,offset:0,size:0}]}(Ob(n,i),d,c),[],i,l,d,o);const f=[];if(s.length>0){const e=s[0],t=s[s.length-1];let i=0;for(const r of Yw(A,e,t)){const n=r.value,a=Math.max(r.start,e),s=Math.min(r.end,t);for(let e=a;e<=s;e++)f.push({data:c?.[e],index:e,offset:i,size:n}),i+=n}}if(!a)return Yb([],f,i,l,d,o);const g=s.length>0?s[s.length-1]+1:0,w=Bb(u,e,t,g);if(0===w.length)return null;const b=i-1,v=nw([],i=>{for(const r of w){const n=r.value;let a=n.offset,s=r.start;const o=n.size;if(n.offset<e){s+=Math.floor((e-n.offset+l)/(o+l));const t=s-r.start;a+=t*o+t*l}s<g&&(a+=(g-s)*o,s=g);const h=Math.min(r.end,b);for(let e=s;e<=h&&!(a>=t);e++)i.push({data:c?.[e],index:e,offset:a,size:o}),a+=o+l}}),y=ev(h,Vb),B=ev(h,Kb);if(v.length>0&&(y>0||B>0)){const e=v[0],t=v[v.length-1];if(y>0&&e.index>g){const t=Math.min(y,e.index-g),i=[];let r=e.offset;for(let n=e.index-1;n>=e.index-t;n--){const t=Yw(A,n,n)[0]?.value??e.size;r-=t+l,i.unshift({data:c?.[n],index:n,offset:r,size:t})}v.unshift(...i)}if(B>0&&t.index<b){const e=Math.min(B,b-t.index);let i=t.offset+t.size+l;for(let r=t.index+1;r<=t.index+e;r++){const e=Yw(A,r,r)[0]?.value??t.size;v.push({data:c?.[r],index:r,offset:i,size:e}),i+=e+l}}}return Yb(v,f,i,l,d,o)}),mw(e=>null!==e),fw()),Xb);dw(bw(e,mw(iw),gw(e=>e?.length)),n),dw(bw(b,gw(e=>e.topListHeight)),d),dw(d,o),dw(bw(b,gw(e=>[e.top,e.bottom])),s),dw(bw(b,gw(e=>e.items)),g);const v=Nw(bw(b,mw(({items:e})=>e.length>0),Cw(n,e),mw(([{items:e},t])=>e[e.length-1].originalIndex===t-1),gw(([,e,t])=>[e-1,t]),fw(db),gw(([e])=>e))),y=Nw(bw(b,Bw(200),mw(({items:e,topItems:t})=>e.length>0&&e[0].originalIndex===t.length),gw(({items:e})=>e[0].index),fw())),B=Nw(bw(b,mw(({items:e})=>e.length>0),gw(({items:e})=>{let t=0,i=e.length-1;for(;"group"===e[t].type&&t<i;)t++;for(;"group"===e[i].type&&i>t;)i--;return{endIndex:e[i].index,startIndex:e[t].index}}),fw(cb)));return{endReached:v,initialItemCount:m,itemsRendered:g,listState:b,minOverscanItemCount:w,rangeChanged:B,startReached:y,topItemsIndexes:f,...u}},sw(kb,Lb,Jb,Qb,Pb,zb,Ib,ub),{singleton:!0}),iv=Ew(([{fixedFooterHeight:e,fixedHeaderHeight:t,footerHeight:i,headerHeight:r},{listState:n}])=>{const a=Sw(),s=Fw(bw(Tw(i,e,r,t,n),gw(([e,t,i,r,n])=>e+t+i+r+n.offsetBottom+n.bottom)),0);return dw(Lw(s),a),{totalListHeight:s,totalListHeightChanged:a}},sw(zw,tv),{singleton:!0}),rv=Ew(([{viewportHeight:e},{totalListHeight:t}])=>{const i=xw(!1);return{alignToBottom:i,paddingTopAddition:Fw(bw(Tw(i,e,t),mw(([e])=>e),gw(([,e,t])=>Math.max(0,e-t)),Bw(0),fw()),0)}},sw(zw,iv),{singleton:!0}),nv=Ew(()=>({context:xw(null)})),av=({itemBottom:e,itemTop:t,locationParams:{align:i,behavior:r,...n},viewportBottom:a,viewportTop:s})=>t<s?{...n,align:i??"start",...void 0!==r?{behavior:r}:{}}:e>a?{...n,align:i??"end",...void 0!==r?{behavior:r}:{}}:null,sv=Ew(([{gap:e,sizes:t,totalCount:i},{fixedFooterHeight:r,fixedHeaderHeight:n,headerHeight:a,scrollingInProgress:s,scrollTop:o,viewportHeight:l},{scrollToIndex:h}])=>{const c=Sw();return dw(bw(c,Cw(t,l,i,a,n,r,o),Cw(e),gw(([[e,t,i,r,n,a,o,l],h])=>{const{calculateViewLocation:c=av,done:d,...u}=e,A=yb(e,t,r-1),p=bb(A,t.offsetTree,h)+n+a,f=c({itemBottom:p+Ww(t.sizeTree,A)[1],itemTop:p,locationParams:u,viewportBottom:l+i-o,viewportTop:l+a});return null!==f?d&&uw(bw(s,mw(e=>!e),yw(cw(s)?1:2)),d):d?.(),f}),mw(e=>null!==e)),h),{scrollIntoView:c}},sw(kb,zw,Pb,tv,Qw),{singleton:!0});function ov(e){return!1!==e&&("smooth"===e?"smooth":"auto")}const lv=Ew(([{listRefresh:e,totalCount:t,fixedItemSize:i,data:r},{atBottomState:n,isAtBottom:a},{scrollToIndex:s},{scrolledToInitialItem:o},{didMount:l,propsReady:h},{log:c},{scrollingInProgress:d},{context:u},{scrollIntoView:A}])=>{const p=xw(!1),f=Sw();let m=null;function g(e){lw(s,{align:"end",behavior:e,index:"LAST"})}function w(e){const t=uw(n,t=>{e&&!t.atBottom&&"SIZE_INCREASED"===t.notAtBottomBecause&&null===m&&(cw(c)("scrolling to bottom due to increased size",{},Dw),g("auto"))});setTimeout(t,100)}ow(bw(Tw(bw(Lw(t),yw(1)),l),Cw(Lw(p),a,o,d),gw(([[e,t],i,r,n,a])=>{let s=t&&n,o="auto";return s&&(o=((e,t)=>"function"==typeof e?ov(e(t)):t&&ov(e))(i,r||a),s=s&&!1!==o),{followOutputBehavior:o,shouldFollow:s,totalCount:e}}),mw(({shouldFollow:e})=>e)),({followOutputBehavior:t,totalCount:r})=>{null!==m&&(m(),m=null),void 0!==cw(i)?requestAnimationFrame(()=>{cw(c)("following output to ",{totalCount:r},Dw),g(t)}):m=uw(e,()=>{cw(c)("following output to ",{totalCount:r},Dw),g(t),m=null})}),ow(bw(Tw(Lw(p),t,h),mw(([e,,t])=>!1!==e&&t),vw(({value:e},[,t])=>({refreshed:e===t,value:t}),{refreshed:!1,value:0}),mw(({refreshed:e})=>e),Cw(p,t)),([,e])=>{cw(o)&&w(!1!==e)}),ow(f,()=>{w(!1!==cw(p))}),ow(Tw(Lw(p),n),([e,t])=>{!1!==e&&!t.atBottom&&"VIEWPORT_HEIGHT_DECREASING"===t.notAtBottomBecause&&g("auto")});const b=xw(null),v=Sw();return dw(Iw(bw(Lw(r),gw(e=>e?.length??0)),bw(Lw(t))),v),ow(bw(Tw(bw(v,yw(1)),l),Cw(Lw(b),o,d,u),gw(([[e,t],i,r,n,a])=>t&&r&&i?.({context:a,totalCount:e,scrollingInProgress:n})),mw(e=>!!e),Bw(0)),t=>{null!==m&&(m(),m=null),void 0!==cw(i)?requestAnimationFrame(()=>{cw(c)("scrolling into view",{}),lw(A,t)}):m=uw(e,()=>{cw(c)("scrolling into view",{}),lw(A,t),m=null})}),{autoscrollToBottom:f,followOutput:p,scrollIntoViewOnChange:b}},sw(kb,zb,Pb,Qb,Ib,Qw,zw,nv,sv)),hv=Ew(([{data:e,firstItemIndex:t,gap:i,sizes:r},{initialTopMostItemIndex:n},{initialItemCount:a,listState:s},{didMount:o}])=>(dw(bw(o,Cw(a),mw(([,e])=>0!==e),Cw(n,r,t,i,e),gw(([[,e],t,i,r,n,a=[]])=>$b(e,t,i,r,n,a))),s),{}),sw(kb,Qb,tv,Ib),{singleton:!0}),cv=Ew(([{didMount:e},{scrollTo:t},{listState:i}])=>{const r=xw(0);return ow(bw(e,Cw(r),mw(([,e])=>0!==e),gw(([,e])=>({top:e}))),e=>{uw(bw(i,yw(1),mw(e=>e.items.length>1)),()=>{requestAnimationFrame(()=>{lw(t,e)})})}),{initialScrollTop:r}},sw(Ib,zw,tv),{singleton:!0}),dv=Ew(([{scrollVelocity:e}])=>{const t=xw(!1),i=Sw(),r=xw(!1);return dw(bw(e,Cw(r,t,i),mw(([e,t])=>!1!==t&&void 0!==t),gw(([e,t,i,r])=>{const{enter:n,exit:a}=t;if(i){if(a(e,r))return!1}else if(n(e,r))return!0;return i}),fw()),t),ow(bw(Tw(t,e,i),Cw(r)),([[e,t,i],r])=>{e&&!1!==r&&void 0!==r&&r.change&&r.change(t,i)}),{isSeeking:t,scrollSeekConfiguration:r,scrollSeekRangeChanged:i,scrollVelocity:e}},sw(zb),{singleton:!0}),uv=Ew(([{scrollContainerState:e,scrollTo:t}])=>{const i=Sw(),r=Sw(),n=Sw(),a=xw(!1),s=xw(void 0);return dw(bw(Tw(i,r),gw(([{scrollHeight:e,scrollTop:t,viewportHeight:i},{offsetTop:r}])=>({scrollHeight:e,scrollTop:Math.max(0,t-r),viewportHeight:i}))),e),dw(bw(t,Cw(r),gw(([e,{offsetTop:t}])=>({...e,top:e.top+t}))),n),{customScrollParent:s,useWindowScroll:a,windowScrollContainerState:i,windowScrollTo:n,windowViewportRect:r}},sw(zw)),Av=Ew(([{sizeRanges:e,sizes:t},{headerHeight:i,scrollTop:r},{initialTopMostItemIndex:n},{didMount:a},{useWindowScroll:s,windowScrollContainerState:o,windowViewportRect:l}])=>{const h=Sw(),c=xw(void 0),d=xw(null),u=xw(null);return dw(o,d),dw(l,u),ow(bw(h,Cw(t,r,s,d,u,i)),([e,t,i,r,n,a,s])=>{const o=function(e){return Zw(e).map(({k:e,v:t},i,r)=>{const n=r[i+1];return{endIndex:void 0!==n?n.k-1:1/0,size:t,startIndex:e}})}(t.sizeTree);r&&null!==n&&null!==a&&(i=n.scrollTop-a.offsetTop),e({ranges:o,scrollTop:i-=s})}),dw(bw(c,mw(iw),gw(pv)),n),dw(bw(a,Cw(c),mw(([,e])=>void 0!==e),fw(),gw(([,e])=>e.ranges)),e),{getState:h,restoreStateFrom:c}},sw(kb,zw,Qb,Ib,uv));function pv(e){return{align:"start",index:0,offset:e.scrollTop}}const fv=Ew(([{topItemsIndexes:e}])=>{const t=xw(0);return dw(bw(t,mw(e=>e>=0),gw(e=>Array.from({length:e}).map((e,t)=>t))),e),{topItemCount:t}},sw(tv));function mv(e){let t,i=!1;return()=>(i||(i=!0,t=e()),t)}const gv=mv(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),wv=Ew(([{deviation:e,scrollBy:t,scrollingInProgress:i,scrollTop:r},{isAtBottom:n,isScrolling:a,lastJumpDueToItemResize:s,scrollDirection:o},{listState:l},{beforeUnshiftWith:h,gap:c,shiftWithOffset:d,sizes:u},{log:A},{recalcInProgress:p}])=>{const f=Nw(bw(l,Cw(s),vw(([,e,t,i],[{bottom:r,items:n,offsetBottom:a,totalCount:s},o])=>{const l=r+a;let h=0;return t===s&&e.length>0&&n.length>0&&(0===n[0].originalIndex&&0===e[0].originalIndex||(h=l-i,0!==h&&(h+=o))),[h,n,s,l]},[0,[],0,0]),mw(([e])=>0!==e),Cw(r,o,i,n,A,p),mw(([,e,t,i,,,r])=>!r&&!i&&0!==e&&t===Mb),gw(([[e],,,,,t])=>(t("Upward scrolling compensation",{amount:e},Dw),e))));function m(i){i>0?(lw(t,{behavior:"auto",top:-i}),lw(e,0)):(lw(e,0),lw(t,{behavior:"auto",top:-i}))}return ow(bw(f,Cw(e,a)),([t,i,r])=>{r&&gv()?lw(e,i-t):m(-t)}),ow(bw(Tw(Fw(a,!1),e,p),mw(([e,t,i])=>!e&&!i&&0!==t),gw(([e,t])=>t),Bw(1)),m),dw(bw(d,gw(e=>({top:-e}))),t),ow(bw(h,Cw(u,c),gw(([e,{groupIndices:t,lastSize:i,sizeTree:r},n])=>{function a(e){return e*(i+n)}if(0===t.length)return a(e);let s=0;const o=Gw(r,0);let l=0,h=0;for(;l<e;){l++,s+=o;let i=t.length===h+1?1/0:t[h+1]-t[h]-1;l+i>e&&(s-=o,i=e-l+1),l+=i,s+=a(i),h++}return s})),i=>{lw(e,i),requestAnimationFrame(()=>{lw(t,{top:i}),requestAnimationFrame(()=>{lw(e,0),lw(p,!1)})})}),{deviation:e}},sw(zw,zb,tv,kb,Qw,ub)),bv=Ew(([e,t,i,r,n,a,s,o,l,h,c])=>({...e,...t,...i,...r,...n,...a,...s,...o,...l,...h,...c}),sw(Jb,hv,Ib,dv,iv,cv,rv,uv,sv,Qw,nv)),vv=Ew(([{data:e,defaultItemSize:t,firstItemIndex:i,fixedItemSize:r,fixedGroupSize:n,gap:a,groupIndices:s,heightEstimates:o,itemSize:l,sizeRanges:h,sizes:c,statefulTotalCount:d,totalCount:u,trackItemSizes:A},{initialItemFinalLocationReached:p,initialTopMostItemIndex:f,scrolledToInitialItem:m},g,w,b,v,{scrollToIndex:y},B,{topItemCount:C},{groupCounts:x},F])=>{const{listState:S,minOverscanItemCount:N,topItemsIndexes:E,rangeChanged:k,...T}=v;return dw(k,F.scrollSeekRangeChanged),dw(bw(F.windowViewportRect,gw(e=>e.visibleHeight)),g.viewportHeight),{data:e,defaultItemHeight:t,firstItemIndex:i,fixedItemHeight:r,fixedGroupHeight:n,gap:a,groupCounts:x,heightEstimates:o,initialItemFinalLocationReached:p,initialTopMostItemIndex:f,scrolledToInitialItem:m,sizeRanges:h,topItemCount:C,topItemsIndexes:E,totalCount:u,...b,groupIndices:s,itemSize:l,listState:S,minOverscanItemCount:N,scrollToIndex:y,statefulTotalCount:d,trackItemSizes:A,rangeChanged:k,...T,...F,...g,sizes:c,...w}},sw(kb,Qb,zw,Av,lv,tv,Pb,wv,fv,Lb,bv));function yv(e,t){const i={},r={};let n=0;const a=e.length;for(;n<a;)r[e[n]]=1,n+=1;for(const e in t)Object.hasOwn(r,e)||(i[e]=t[e]);return i}const Bv=typeof document<"u"?r.useLayoutEffect:r.useEffect;function Cv(t,i,n){const a=Object.keys(i.required||{}),s=Object.keys(i.optional||{}),o=Object.keys(i.methods||{}),l=Object.keys(i.events||{}),h=r.createContext({});function c(e,t){void 0!==e.propsReady&&lw(e.propsReady,!1);for(const r of a){lw(e[i.required[r]],t[r])}for(const r of s)if(r in t){lw(e[i.optional[r]],t[r])}void 0!==e.propsReady&&lw(e.propsReady,!0)}function d(e){return l.reduce((t,r)=>(t[r]=function(e){let t,i;const r=()=>t?.();return function(n,a){switch(n){case 1:return a?i===a?void 0:(r(),i=a,t=ow(e,a),t):(r(),rw);case 2:return r(),void(i=null)}}}(e[i.events[r]]),t),{})}const u=r.forwardRef(function(u,A){const{children:p,...f}=u,[m]=r.useState(()=>nw(function(e){const t=new Map,i=({constructor:e,dependencies:r,id:n,singleton:a})=>{if(a&&t.has(n))return t.get(n);const s=e(r.map(e=>i(e)));return a&&t.set(n,s),s};return i(e)}(t),e=>{c(e,f)})),[g]=r.useState(tw(d,m));var w;Bv(()=>{for(const e of l)e in f&&ow(g[e],f[e]);return()=>{Object.values(g).map(hw)}},[f,g,m]),Bv(()=>{c(m,f)}),r.useImperativeHandle(A,$g((w=m,o.reduce((e,t)=>(e[t]=e=>{lw(w[i.methods[t]],e)},e),{}))));const b=n;return e(h.Provider,{value:m,children:void 0!==n?e(b,{...yv([...a,...s,...l],f),children:p}):p})});return{Component:u,useEmitter:(e,t)=>{const i=r.useContext(h)[e];Bv(()=>ow(i,t),[t,i])},useEmitterValue:r.version.startsWith("18")?e=>{const t=r.useContext(h)[e],i=r.useCallback(e=>ow(t,e),[t]);return r.useSyncExternalStore(i,()=>cw(t),()=>cw(t))}:e=>{const t=r.useContext(h)[e],[i,n]=r.useState(tw(cw,t));return Bv(()=>ow(t,e=>{e!==i&&n($g(e))}),[t,i]),i},usePublisher:e=>{const t=r.useContext(h);return r.useCallback(i=>{lw(t[e],i)},[t,e])}}}const xv=r.createContext(void 0),Fv=r.createContext(void 0),Sv="-webkit-sticky",Nv="sticky",Ev=mv(()=>{if(typeof document>"u")return Nv;const e=document.createElement("div");return e.style.position=Sv,e.style.position===Sv?Sv:Nv}),kv=typeof document<"u"?r.useLayoutEffect:r.useEffect;function Tv(e){return"self"in e}function Lv(e,t,i,n=rw,a,s){const o=r.useRef(null),l=r.useRef(null),h=r.useRef(null),c=r.useCallback(i=>{let r,n,a;const o=i.target;if(function(e){return"body"in e}(o)||Tv(o)){const e=Tv(o)?o:o.defaultView;a=!0===s?e.scrollX:e.scrollY,r=!0===s?e.document.documentElement.scrollWidth:e.document.documentElement.scrollHeight,n=!0===s?e.innerWidth:e.innerHeight}else a=!0===s?o.scrollLeft:o.scrollTop,r=!0===s?o.scrollWidth:o.scrollHeight,n=!0===s?o.offsetWidth:o.offsetHeight;const c=()=>{e({scrollHeight:r,scrollTop:Math.max(a,0),viewportHeight:n})};!0===i.suppressFlushSync?c():Lr.flushSync(c),null!==l.current&&(a===l.current||a<=0||a===r-n)&&(l.current=null,t(!0),h.current&&(clearTimeout(h.current),h.current=null))},[e,t,s]);return r.useEffect(()=>{const e=a||o.current;return n(a||o.current),c({suppressFlushSync:!0,target:e}),e.addEventListener("scroll",c,{passive:!0}),()=>{n(null),e.removeEventListener("scroll",c)}},[o,c,i,n,a]),{scrollByCallback:function(e){!0===s&&(e={...void 0!==e.behavior?{behavior:e.behavior}:{},...void 0!==e.top?{left:e.top}:{}}),o.current.scrollBy(e)},scrollerRef:o,scrollToCallback:function(i){const r=o.current;if(!r||(!0===s?"offsetWidth"in r&&0===r.offsetWidth:"offsetHeight"in r&&0===r.offsetHeight))return;const n="smooth"===i.behavior;let a,c,d;Tv(r)?(c=Math.max(fb(r.document.documentElement,!0===s?"width":"height"),!0===s?r.document.documentElement.scrollWidth:r.document.documentElement.scrollHeight),a=!0===s?r.innerWidth:r.innerHeight,d=!0===s?window.scrollX:window.scrollY):(c=r[!0===s?"scrollWidth":"scrollHeight"],a=fb(r,!0===s?"width":"height"),d=r[!0===s?"scrollLeft":"scrollTop"]);const u=c-a;if(i.top=Math.ceil(Math.max(Math.min(u,i.top),0)),Hb(a,c)||i.top===d)return e({scrollHeight:c,scrollTop:d,viewportHeight:a}),void(n&&t(!0));n?(l.current=i.top,h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{h.current=null,l.current=null,t(!0)},1e3)):l.current=null,!0===s&&(i={...void 0!==i.behavior?{behavior:i.behavior}:{},left:i.top}),r.scrollTo(i)}}}function Iv(e){return e}const Dv=Ew(()=>{const e=xw(e=>`Item ${e}`),t=xw(e=>`Group ${e}`),i=xw({}),r=xw(Iv),n=xw("div"),a=xw(rw),s=(e,t=null)=>Fw(bw(i,gw(t=>t[e]),fw()),t);return{components:i,computeItemKey:r,EmptyPlaceholder:s("EmptyPlaceholder"),FooterComponent:s("Footer"),GroupComponent:s("Group","div"),groupContent:t,HeaderComponent:s("Header"),HeaderFooterTag:n,ItemComponent:s("Item","div"),itemContent:e,ListComponent:s("List","div"),ScrollerComponent:s("Scroller","div"),scrollerRef:a,ScrollSeekPlaceholder:s("ScrollSeekPlaceholder"),TopItemListComponent:s("TopItemList")}});sw(vv,Dv),Ev();const Uv={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},Pv={outline:"none",overflowX:"auto",position:"relative"};function Rv(e,t){if("string"!=typeof e)return{context:t}}function Ov(e,t){return{item:"string"==typeof e?void 0:t}}function Qv({useEmitter:t,useEmitterValue:i,usePublisher:n}){return r.memo(function({children:r,style:a,context:s,...o}){const l=n("scrollContainerState"),h=i("ScrollerComponent"),c=n("smoothScrollTargetReached"),d=i("scrollerRef"),u=i("horizontalDirection")||!1,{scrollByCallback:A,scrollerRef:p,scrollToCallback:f}=Lv(l,c,h,d,void 0,u);return t("scrollTo",f),t("scrollBy",A),e(h,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:p,style:{...u?Pv:Uv,...a},tabIndex:0,...o,...Rv(h,s),children:r})})}function Hv({useEmitter:t,useEmitterValue:i,usePublisher:n}){return r.memo(function({children:a,style:s,context:o,...l}){const h=n("windowScrollContainerState"),c=i("ScrollerComponent"),d=n("smoothScrollTargetReached"),u=i("totalListHeight"),A=i("deviation"),p=i("customScrollParent"),f=r.useRef(null),m=i("scrollerRef"),{scrollByCallback:g,scrollerRef:w,scrollToCallback:b}=Lv(h,d,c,m,p);return kv(()=>(w.current=p||f.current?.ownerDocument.defaultView,()=>{w.current=null}),[w,p]),t("windowScrollTo",b),t("scrollBy",g),e(c,{ref:f,"data-virtuoso-scroller":!0,style:{position:"relative",...s,...0!==u?{height:u+A}:void 0},...l,...Rv(c,o),children:a})})}Ev();const Mv=Ew(()=>{const e=xw(e=>t("td",{children:["Item $",e]})),i=xw(null),r=xw(e=>t("td",{colSpan:1e3,children:["Group ",e]})),n=xw(null),a=xw(null),s=xw({}),o=xw(Iv),l=xw(rw),h=(e,t=null)=>Fw(bw(s,gw(t=>t[e]),fw()),t);return{components:s,computeItemKey:o,context:i,EmptyPlaceholder:h("EmptyPlaceholder"),FillerRow:h("FillerRow"),fixedFooterContent:a,fixedHeaderContent:n,itemContent:e,groupContent:r,ScrollerComponent:h("Scroller","div"),scrollerRef:l,ScrollSeekPlaceholder:h("ScrollSeekPlaceholder"),TableBodyComponent:h("TableBody","tbody"),TableComponent:h("Table","table"),TableFooterComponent:h("TableFoot","tfoot"),TableHeadComponent:h("TableHead","thead"),TableRowComponent:h("TableRow","tr"),GroupComponent:h("Group","tr")}}),_v=Ew(([e,t])=>({...e,...t}),sw(vv,Mv)),jv=({height:t})=>e("tr",{children:e("td",{style:{height:t}})}),zv=({height:t})=>e("tr",{children:e("td",{style:{border:0,height:t,padding:0}})}),Vv={overflowAnchor:"none"},Kv={position:Ev(),zIndex:2,overflowAnchor:"none"},qv=r.memo(function({showTopList:e=!1}){const t=Zv("listState"),i=Zv("computeItemKey"),r=Zv("firstItemIndex"),n=Zv("context"),a=Zv("isSeeking"),s=Zv("fixedHeaderHeight"),o=Zv("groupIndices").length>0,l=Zv("itemContent"),h=Zv("groupContent"),c=Zv("ScrollSeekPlaceholder")??jv,d=Zv("GroupComponent"),A=Zv("TableRowComponent"),p=(e?t.topItems:[]).reduce((e,t,i)=>(0===i?e.push(t.size):e.push(e[i-1]+t.size),e),[]);return(e?t.topItems:t.items).map(t=>{const f=t.originalIndex,m=i(f+r,t.data,n),g=e?0===f?0:p[f-1]:0;return a?u(c,{...Rv(c,n),height:t.size,index:t.index,key:m,type:t.type||"item"}):"group"===t.type?u(d,{...Rv(d,n),"data-index":f,"data-item-index":t.index,"data-known-size":t.size,key:m,style:{...Kv,top:s}},h(t.index,n)):u(A,{...Rv(A,n),...Ov(A,t.data),"data-index":f,"data-item-index":t.index,"data-known-size":t.size,"data-item-group-index":t.groupIndex,key:m,style:e?{...Kv,top:s+g}:Vv},o?l(t.index,t.groupIndex,t.data,n):l(t.index,t.data,n))})}),Gv=r.memo(function(){const i=Zv("listState"),n=Zv("topItemsIndexes").length>0,a=ey("sizeRanges"),s=Zv("useWindowScroll"),o=Zv("customScrollParent"),l=ey("windowScrollContainerState"),h=ey("scrollContainerState"),c=o||s?l:h,d=Zv("trackItemSizes"),u=Zv("itemSize"),A=Zv("log"),{callbackRef:p,ref:f}=_w(a,u,d,c,A,void 0,o,!1,Zv("skipAnimationFrameInResizeObserver")),[m,g]=r.useState(0);$v("deviation",e=>{m!==e&&(f.current.style.marginTop=`${e}px`,g(e))});const w=Zv("EmptyPlaceholder"),b=Zv("FillerRow")??zv,v=Zv("TableBodyComponent"),y=Zv("paddingTopAddition"),B=Zv("statefulTotalCount"),C=Zv("context");if(0===B&&null!=w)return e(w,{...Rv(w,C)});const x=(n?i.topItems:[]).reduce((e,t)=>e+t.size,0),F=i.offsetTop+y+m-x,S=i.offsetBottom,N=F>0?e(b,{context:C,height:F},"padding-top"):null,E=S>0?e(b,{context:C,height:S},"padding-bottom"):null;return t(v,{"data-testid":"virtuoso-item-list",ref:p,...Rv(v,C),children:[N,n&&e(qv,{showTopList:!0}),e(qv,{}),E]})}),Wv=({children:t})=>{const i=r.useContext(xv),n=ey("viewportHeight"),a=ey("fixedItemHeight"),s=Hw(r.useMemo(()=>ew(n,e=>fb(e,"height")),[n]),!0,Zv("skipAnimationFrameInResizeObserver"));return r.useEffect(()=>{i&&(n(i.viewportHeight),a(i.itemHeight))},[i,n,a]),e("div",{"data-viewport-type":"element",ref:s,style:{height:"100%",position:"absolute",top:0,width:"100%"},children:t})},Jv=({children:t})=>{const i=r.useContext(xv),n=ey("windowViewportRect"),a=ey("fixedItemHeight"),s=Zv("customScrollParent"),o=jw(n,s,Zv("skipAnimationFrameInResizeObserver"));return r.useEffect(()=>{i&&(a(i.itemHeight),n({offsetTop:0,visibleHeight:i.viewportHeight,visibleWidth:100}))},[i,n,a]),e("div",{"data-viewport-type":"window",ref:o,style:{height:"100%",position:"absolute",top:0,width:"100%"},children:t})},Xv=r.memo(function(i){const n=Zv("useWindowScroll"),a=Zv("customScrollParent"),s=ey("fixedHeaderHeight"),o=ey("fixedFooterHeight"),l=Zv("fixedHeaderContent"),h=Zv("fixedFooterContent"),c=Zv("context"),d=Hw(r.useMemo(()=>ew(s,e=>fb(e,"height")),[s]),!0,Zv("skipAnimationFrameInResizeObserver")),u=Hw(r.useMemo(()=>ew(o,e=>fb(e,"height")),[o]),!0,Zv("skipAnimationFrameInResizeObserver")),A=a||n?iy:ty,p=a||n?Jv:Wv,f=Zv("TableComponent"),m=Zv("TableHeadComponent"),g=Zv("TableFooterComponent"),w=l?e(m,{ref:d,style:{position:"sticky",top:0,zIndex:2},...Rv(m,c),children:l()},"TableHead"):null,b=h?e(g,{ref:u,style:{bottom:0,position:"sticky",zIndex:1},...Rv(g,c),children:h()},"TableFoot"):null;return e(A,{...i,...Rv(A,c),children:e(p,{children:t(f,{style:{borderSpacing:0,overflowAnchor:"none"},...Rv(f,c),children:[w,e(Gv,{},"TableBody"),b]})})})}),{Component:Yv,useEmitter:$v,useEmitterValue:Zv,usePublisher:ey}=Cv(_v,{optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",firstItemIndex:"firstItemIndex",itemContent:"itemContent",groupContent:"groupContent",fixedHeaderContent:"fixedHeaderContent",fixedFooterContent:"fixedFooterContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",minOverscanItemCount:"minOverscanItemCount",totalCount:"totalCount",topItemCount:"topItemCount",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",groupCounts:"groupCounts",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedGroupHeight:"fixedGroupHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},Xv),ty=Qv({useEmitter:$v,useEmitterValue:Zv,usePublisher:ey}),iy=Hv({useEmitter:$v,useEmitterValue:Zv,usePublisher:ey}),ry=Yv,ny={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},ay={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:sy,floor:oy,max:ly,min:hy,round:cy}=Math;function dy(e,t,i){return Array.from({length:t-e+1}).map((t,r)=>({data:null===i?null:i[r+e],index:r+e}))}function uy(e,t){return void 0!==e&&e.width===t.width&&e.height===t.height}function Ay(e,t){return void 0!==e&&e.column===t.column&&e.row===t.row}const py=Ew(([{increaseViewportBy:e,listBoundary:t,overscan:i,visibleRange:r},{footerHeight:n,headerHeight:a,scrollBy:s,scrollContainerState:o,scrollTo:l,scrollTop:h,smoothScrollTargetReached:c,viewportHeight:d},u,A,{didMount:p,propsReady:f},{customScrollParent:m,useWindowScroll:g,windowScrollContainerState:w,windowScrollTo:b,windowViewportRect:v},y])=>{const B=xw(0),C=xw(0),x=xw(ny),F=xw({height:0,width:0}),S=xw({height:0,width:0}),N=Sw(),E=Sw(),k=xw(0),T=xw(null),L=xw({column:0,row:0}),I=Sw(),D=Sw(),U=xw(!1),P=xw(0),R=xw(!0),O=xw(!1),Q=xw(!1);ow(bw(p,Cw(P),mw(([e,t])=>0!==t)),()=>{lw(R,!1)}),ow(bw(Tw(p,R,S,F,P,O),mw(([e,t,i,r,,n])=>e&&!t&&0!==i.height&&0!==r.height&&!n)),([,,,,e])=>{lw(O,!0),Rb(1,()=>{lw(N,e)}),uw(bw(h),()=>{lw(t,[0,0]),lw(R,!0)})}),dw(bw(D,mw(e=>null!=e&&e.scrollTop>0),ww(0)),C),ow(bw(p,Cw(D),mw(([,e])=>null!=e)),([,e])=>{e&&(lw(F,e.viewport),lw(S,e.item),lw(L,e.gap),e.scrollTop>0&&(lw(U,!0),uw(bw(h,yw(1)),e=>{lw(U,!1)}),lw(l,{top:e.scrollTop})))}),dw(bw(F,gw(({height:e})=>e)),d),dw(bw(Tw(Lw(F,uy),Lw(S,uy),Lw(L,(e,t)=>void 0!==e&&e.column===t.column&&e.row===t.row),Lw(h)),gw(([e,t,i,r])=>({gap:i,item:t,scrollTop:r,viewport:e}))),I),dw(bw(Tw(Lw(B),r,Lw(L,Ay),Lw(S,uy),Lw(F,uy),Lw(T),Lw(C),Lw(U),Lw(R),Lw(P)),mw(([,,,,,,,e])=>!e),gw(([e,[t,i],r,n,a,s,o,,l,h])=>{const{column:c,row:d}=r,{height:u,width:A}=n,{width:p}=a;if(0===o&&(0===e||0===p))return ny;if(0===A){const t=Ob(h,e);return function(e){return{...ay,items:e}}(dy(t,t+Math.max(o-1,0),s))}const f=fy(p,A,c);let m,g;l?0===t&&0===i&&o>0?(m=0,g=o-1):(m=f*oy((t+d)/(u+d)),g=f*sy((i+d)/(u+d))-1,g=hy(e-1,ly(g,f-1)),m=hy(g,ly(0,m))):(m=0,g=-1);const w=dy(m,g,s),{bottom:b,top:v}=my(a,r,n,w),y=sy(e/f);return{bottom:b,itemHeight:u,items:w,itemWidth:A,offsetBottom:y*u+(y-1)*d-b,offsetTop:v,top:v}})),x),dw(bw(T,mw(e=>null!==e),gw(e=>e.length)),B),dw(bw(Tw(F,S,x,L),mw(([e,t,{items:i}])=>i.length>0&&0!==t.height&&0!==e.height),gw(([e,t,{items:i},r])=>{const{bottom:n,top:a}=my(e,r,t,i);return[a,n]}),fw(db)),t);const H=xw(!1);dw(bw(h,Cw(H),gw(([e,t])=>t||0!==e)),H);const M=Nw(bw(Tw(x,B),mw(([{items:e}])=>e.length>0),Cw(H),mw(([[e,t],i])=>{const r=e.items[e.items.length-1].index===t-1;return(i||e.bottom>0&&e.itemHeight>0&&0===e.offsetBottom&&e.items.length===t)&&r}),gw(([[,e]])=>e-1),fw())),_=Nw(bw(Lw(x),mw(({items:e})=>e.length>0&&0===e[0].index),ww(0),fw())),j=Nw(bw(Lw(x),Cw(U),mw(([{items:e},t])=>e.length>0&&!t),gw(([{items:e}])=>({endIndex:e[e.length-1].index,startIndex:e[0].index})),fw(cb),Bw(0)));dw(j,A.scrollSeekRangeChanged),dw(bw(N,Cw(F,S,B,L),gw(([e,t,i,r,n])=>{const a=Ub(e),{align:s,behavior:o,offset:l}=a;let h=a.index;"LAST"===h&&(h=r-1),h=ly(0,h,hy(r-1,h));let c=gy(t,n,i,h);return"end"===s?c=cy(c-t.height+i.height):"center"===s&&(c=cy(c-t.height/2+i.height/2)),void 0!==l&&0!==l&&(c+=l),{behavior:o,top:c}})),l);const z=Fw(bw(x,gw(e=>e.offsetBottom+e.bottom)),0);return dw(bw(v,gw(e=>({height:e.visibleHeight,width:e.visibleWidth}))),F),{customScrollParent:m,data:T,deviation:k,footerHeight:n,gap:L,headerHeight:a,increaseViewportBy:e,initialItemCount:C,itemDimensions:S,overscan:i,restoreStateFrom:D,scrollBy:s,scrollContainerState:o,scrollHeight:E,scrollTo:l,scrollToIndex:N,scrollTop:h,smoothScrollTargetReached:c,totalCount:B,useWindowScroll:g,viewportDimensions:F,windowScrollContainerState:w,windowScrollTo:b,windowViewportRect:v,...A,gridState:x,horizontalDirection:Q,initialTopMostItemIndex:P,totalListHeight:z,...u,endReached:M,propsReady:f,rangeChanged:j,startReached:_,stateChanged:I,stateRestoreInProgress:U,...y}},sw(Jb,zw,zb,dv,Ib,uv,Qw));function fy(e,t,i){return ly(1,oy((e+i)/(oy(t)+i)))}function my(e,t,i,r){const{height:n}=i;if(void 0===n||0===r.length)return{bottom:0,top:0};const a=gy(e,t,i,r[0].index);return{bottom:gy(e,t,i,r[r.length-1].index)+n,top:a}}function gy(e,t,i,r){const n=fy(e.width,i.width,t.column),a=oy(r/n),s=a*i.height+ly(0,a-1)*t.row;return s>0?s+t.row:s}const wy=Ew(()=>{const e=xw(e=>`Item ${e}`),t=xw({}),i=xw(null),r=xw("virtuoso-grid-item"),n=xw("virtuoso-grid-list"),a=xw(Iv),s=xw("div"),o=xw(rw),l=(e,i=null)=>Fw(bw(t,gw(t=>t[e]),fw()),i),h=xw(!1),c=xw(!1);return dw(Lw(c),h),{components:t,computeItemKey:a,context:i,FooterComponent:l("Footer"),HeaderComponent:l("Header"),headerFooterTag:s,itemClassName:r,ItemComponent:l("Item","div"),itemContent:e,listClassName:n,ListComponent:l("List","div"),readyStateChanged:h,reportReadyState:c,ScrollerComponent:l("Scroller","div"),scrollerRef:o,ScrollSeekPlaceholder:l("ScrollSeekPlaceholder","div")}}),by=Ew(([e,t])=>({...e,...t}),sw(py,wy)),vy=r.memo(function(){const t=Ny("gridState"),i=Ny("listClassName"),n=Ny("itemClassName"),a=Ny("itemContent"),s=Ny("computeItemKey"),o=Ny("isSeeking"),l=Ey("scrollHeight"),h=Ny("ItemComponent"),c=Ny("ListComponent"),d=Ny("ScrollSeekPlaceholder"),A=Ny("context"),p=Ey("itemDimensions"),f=Ey("gap"),m=Ny("log"),g=Ny("stateRestoreInProgress"),w=Ey("reportReadyState"),b=Hw(r.useMemo(()=>e=>{const t=e.parentElement.parentElement.scrollHeight;l(t);const i=e.firstChild;if(null!==i){const{height:e,width:t}=i.getBoundingClientRect();p({height:e,width:t})}f({column:Ly("column-gap",getComputedStyle(e).columnGap,m),row:Ly("row-gap",getComputedStyle(e).rowGap,m)})},[l,p,f,m]),!0,!1);return kv(()=>{t.itemHeight>0&&t.itemWidth>0&&w(!0)},[t]),g?null:e(c,{className:i,ref:b,...Rv(c,A),"data-testid":"virtuoso-item-list",style:{paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},children:t.items.map(i=>{const r=s(i.index,i.data,A);return o?e(d,{...Rv(d,A),height:t.itemHeight,index:i.index,width:t.itemWidth},r):u(h,{...Rv(h,A),className:n,"data-index":i.index,key:r},a(i.index,i.data,A))})})}),yy=r.memo(function(){const t=Ny("HeaderComponent"),i=Ey("headerHeight"),n=Ny("headerFooterTag"),a=Hw(r.useMemo(()=>e=>{i(fb(e,"height"))},[i]),!0,!1),s=Ny("context");return null!=t?e(n,{ref:a,children:e(t,{...Rv(t,s)})}):null}),By=r.memo(function(){const t=Ny("FooterComponent"),i=Ey("footerHeight"),n=Ny("headerFooterTag"),a=Hw(r.useMemo(()=>e=>{i(fb(e,"height"))},[i]),!0,!1),s=Ny("context");return null!=t?e(n,{ref:a,children:e(t,{...Rv(t,s)})}):null}),Cy=({children:t})=>{const i=r.useContext(Fv),n=Ey("itemDimensions"),a=Ey("viewportDimensions"),s=Hw(r.useMemo(()=>e=>{a(e.getBoundingClientRect())},[a]),!0,!1);return r.useEffect(()=>{i&&(a({height:i.viewportHeight,width:i.viewportWidth}),n({height:i.itemHeight,width:i.itemWidth}))},[i,a,n]),e("div",{ref:s,style:{height:"100%",position:"absolute",top:0,width:"100%"},children:t})},xy=({children:t})=>{const i=r.useContext(Fv),n=Ey("windowViewportRect"),a=Ey("itemDimensions"),s=Ny("customScrollParent"),o=jw(n,s,!1);return r.useEffect(()=>{i&&(a({height:i.itemHeight,width:i.itemWidth}),n({offsetTop:0,visibleHeight:i.viewportHeight,visibleWidth:i.viewportWidth}))},[i,n,a]),e("div",{ref:o,style:{height:"100%",position:"absolute",top:0,width:"100%"},children:t})},Fy=r.memo(function({...i}){const r=Ny("useWindowScroll"),n=Ny("customScrollParent"),a=n||r?Ty:ky,s=n||r?xy:Cy,o=Ny("context");return e(a,{...i,...Rv(a,o),children:t(s,{children:[e(yy,{}),e(vy,{}),e(By,{})]})})}),{useEmitter:Sy,useEmitterValue:Ny,usePublisher:Ey}=Cv(by,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},Fy),ky=Qv({useEmitter:Sy,useEmitterValue:Ny,usePublisher:Ey}),Ty=Hv({useEmitter:Sy,useEmitterValue:Ny,usePublisher:Ey});function Ly(e,t,i){return"normal"!==t&&!0!==t?.endsWith("px")&&i(`${e} was not resolved to pixel value correctly`,t,Pw),"normal"===t?0:parseInt(t??"0",10)}const Iy=xi(()=>({root:{borderRadius:"8px",overflow:"hidden","&>.MuiTableRow-root .MuiTableCell-head":{fontWeight:600,color:"var(--theme-color1)",background:"var(--theme-color4)",whiteSpace:"nowrap",textOverflow:"ellipsis",userSelect:"none",padding:"6px 10px",paddingRight:0,"&:first-child":{borderRadius:"8px 0 0 8px"},"&:last-child":{borderRadius:"0 8px 8px 0","&::before":{display:"none"}}}}}))(li),Dy={Scroller:r.forwardRef((t,i)=>e(De,{component:Ue,...t,ref:i})),Table:t=>e(Re,{...t,size:"small",sx:{borderCollapse:"collapse",width:"100%",tableLayout:"fixed"}}),TableHead:r.forwardRef((t,i)=>e(Ie,{...t,ref:i,sx:{background:"var(--theme-color4)"}})),TableRow:Pe,TableBody:r.forwardRef((t,i)=>e(Le,{...t,ref:i,sx:{"&>.MuiTableRow-root .MuiTableCell-body":{fontWeight:500}}})),TableFoot:r.forwardRef((t,i)=>e(ce,{...t,ref:i,sx:{background:"var(--theme-color4)"}}))},Uy=({level:t})=>e("span",{style:{paddingLeft:10*t+"px"}}),Py=r.memo(({group:r,level:n=0,columns:a,columnWidths:o,onDoubleClickAction:h})=>{const c=r?.data?.length,u=r?.groups?.length,A=ns(),[p,f]=d(!0),m=l(()=>{r.data&&f(e=>!e)},[]),g=s(()=>r?.data?a.reduce((e,t)=>(t.isDisplayTotal&&"number"===t.componentType&&(e[t.accessor]=Xg(r.data,t,A)),e),{}):{},[r?.data,a,A]),w=s(()=>r.groups?a.reduce((e,t)=>(t.isDisplayTotal&&"number"===t.componentType&&(e[t.accessor]=au(Yg(r,t),t?.isVisibleCurrSymbol?$o(t?.currencySymbol??A.dynamicAmountSymbol):"",t?.currencyFormat??A.currencyFormat,t?.decimalCount??A.decimalCount,t?.symbolPosition??"start")),e),{}):{},[r,a,A]),b=s(()=>p&&r?.data?r.data.map(t=>e(Pe,{onDoubleClick:()=>{"function"==typeof h&&h({row:[{data:t}]})},children:a.map(i=>{const r=i.accessor,n=((e,t,i)=>{const{commonDateFormat:r,commonDateTimeFormat:n,commonTimeFormat:a,currencyFormat:s,decimalCount:o,dynamicAmountSymbol:l}=i;if(!t.componentType)return e;switch(t.componentType){case"date":return Jg(e,t?.dateFormat??r??"dd/MM/yyyy");case"dateTime":return Jg(e,t?.dateFormat??n??"dd/MM/yyyy HH:mm:ss");case"time":return Jg(e,t?.dateFormat??a??"HH:mm:ss");case"number":return isNaN(Number(e))?"-":au(e,t?.isVisibleCurrSymbol?$o(t?.currencySymbol??l):"",t?.currencyFormat??s,t?.decimalCount??o,t?.symbolPosition??"start");default:return e}})(t[r],i,A);return e(Oe,{align:i.alignment??"left",sx:{whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",minWidth:o[r],maxWidth:o[r],color:"function"==typeof i.color?i.color(t[r],t):"#000"},children:i?.showTooltip?e(ne,{title:n,children:n}):n},r)})},t.id)):null,[p,r?.data,a,o,A]),v=s(()=>r?.data?e(Pe,{className:J("footer-row",{p0:!a.some(e=>"number"===e.componentType&&e.isDisplayTotal)}),children:a.map(t=>e(Oe,{align:t.alignment??"left",children:"number"===t.componentType&&t.isDisplayTotal?g[t.accessor]:""},t.accessor))}):null,[r?.data,a,g]);return t(i,{children:[e(Pe,{children:a.map((i,a)=>{const s=0===a,l=i.isDisplayTotal?g[i.accessor]:"",h=i.isDisplayTotal?w[i.accessor]:"";return e(Oe,{align:s?"left":i.alignment??"left",sx:{fontSize:"0.9rem",cursor:s?"pointer":"auto",width:o[i.accessor],minWidth:o[i.accessor],maxWidth:o[i.accessor],overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:0!==a?r.data?"var(--theme-color3)":"var(--theme-color1)":"#000"},onClick:s?m:void 0,children:s?t("div",{style:{display:"flex",alignItems:"center"},children:[t("strong",{className:"group-name",style:{display:"flex",alignItems:"center",flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:[e(Uy,{level:n}),t("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[r.groupName,t("em",{style:{fontSize:".8rem",color:"#707070",fontWeight:500,marginLeft:"5px"},children:[u?`(${u} Groups)`:"",c?`(${c} Records)`:""]})]})]}),e("span",{style:{marginLeft:"auto",height:"18px",flexShrink:0},children:r?.data?e(p?nr:ar,{fontSize:"small"}):null})]}):i.isDisplayTotal&&r.data?e("strong",{children:l}):i.isDisplayTotal&&r.groups?e("strong",{children:h}):""},i.accessor)})}),p&&t(i,{children:[b,v]}),r.groups?.map((t,i)=>e(Py,{group:t,level:n+1,columns:a,columnWidths:o,onDoubleClickAction:h},t.groupName||i))]})}),Ry=({columns:r,data:n,originalData:a,loading:o,metaData:h,hideFooter:c,onDoubleClickAction:u})=>{const A=ns(),[p,f]=d(r.reduce((e,t)=>({...e,[t.accessor]:Number(t.width)||150}),{})),m=s(()=>p,[p]),g=l((e,t)=>{f(i=>({...i,[e]:t}))},[]),w=l((e,t)=>{const i=e.clientX,r=m[t.accessor];let n;const a=e=>{n&&cancelAnimationFrame(n),n=requestAnimationFrame(()=>{const n=Math.min(Math.max(t.minWidth||50,r+(e.clientX-i)),t.maxWidth||600);n!==m[t.accessor]&&g(t.accessor,n)})},s=()=>{n&&cancelAnimationFrame(n),document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",s)};document.addEventListener("mousemove",a),document.addEventListener("mouseup",s)},[m,g]);return e(ry,{components:Dy,data:n,fixedFooterContent:()=>e(i,{children:c?null:e(ce,{sx:{position:"sticky",bottom:0},children:e(Pe,{className:"footer-row",children:r.map((e,i)=>t(Oe,{align:e.alignment??"left",sx:{borderTop:"1px solid #bbb",minWidth:m[e.accessor],maxWidth:m[e.accessor]},children:[0===i?`Grand Total ${a.length}`:"","number"===e.componentType&&e.isDisplayTotal?Xg(a,e,A):""]},e.accessor))})})}),fixedHeaderContent:()=>e(Iy,{sx:{position:"sticky",top:0,zIndex:100},children:e(Pe,{children:r.map(i=>e(Oe,{sx:{minWidth:m[i.accessor],maxWidth:m[i.accessor],fontWeight:"bold",paddingRight:0},children:t("div",{style:{display:"flex",alignItems:"center",width:"100%",minWidth:0},children:[e("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",textAlign:i?.alignment??"left"},children:i.columnName}),e("div",{onMouseDown:e=>w(e,i),style:{cursor:"col-resize",paddingLeft:"10px",flexShrink:0,display:"flex",alignItems:"center"},children:e("div",{style:{width:"2px",height:"12px",background:"#ddd"}})})]})},i.accessor))})}),itemContent:(t,i)=>e(Py,{group:i,level:0,columns:r,columnWidths:m,onDoubleClickAction:u},i.groupName??t),style:{height:h?.gridConfig?.maxHeight??"70vh"}})},Oy=({data:t,setGlobalFilterData:i,visibleKeys:r})=>{const{t:n}=W(),[a,s]=d(""),o=((e,t=500)=>{const[i,r]=d(e);return h(()=>{const i=setTimeout(()=>r(e),t);return()=>clearTimeout(i)},[e,t]),i})(a,300);h(()=>{const e=o?t.filter(e=>r.some(t=>{const i=e[t];return i&&i.toString().toLowerCase().includes(o.toLowerCase())})):t;i(e)},[o,t,r,i]);return e(Ll,{type:"text",value:a,onChange:e=>{s(e.target.value)},placeholder:`${n("profile.Searchin")} ${t.length||0} ${n("records")}`})},Qy=r.memo(({title:i,columns:r,metaData:n,groups:a,hideHeader:o,hideFooter:h,dataFetcher:c,reportID:u,otherAPIRequestPara:A={},autoFetch:p=!0,retrievalComponent:f,retrievalType:m,onClose:g,allowRefetch:w=!0,onDoubleClickAction:b,headerToolbarStyle:v={}})=>{const{t:y}=W(),[B,C]=d(p),[x,F]=d([]),S=l(e=>{F(e),C(!0)},[C,F]),{data:N,isFetching:E,isLoading:k,isError:T,error:L,refetch:I}=zt([c,u,x,A],()=>c(u,x,A),{cacheTime:0,enabled:B}),D=s(()=>k||E,[E,k]),[U,P]=d([]),[R,O]=d(N??[]),Q=s(()=>r.filter(e=>!1!==e.isVisible),[r]),H=s(()=>Array.isArray(Q)?Q.map(e=>({...e,columnName:y(e.columnName)})):[],[y,Q]),M=s(()=>H.map(e=>e.accessor),[H]),_=s(()=>fl(U,N??[]),[U,N]),j=s(()=>fl(U,R),[U,R]),z=s(()=>D?[]:((e,t)=>{if(!t.length)return[];const i=new Map;e.forEach(e=>{let r=i;t.forEach((i,n)=>{const a=`${i.groupName??""} ${e[i.accessor]}`;r.has(a)||r.set(a,n===t.length-1?{groupName:a.trim(),data:[]}:new Map),n===t.length-1?r.get(a).data.push(e):r=r.get(a)})});const r=e=>Array.from(e,([e,t])=>t instanceof Map?{groupName:e,groups:r(t)}:t);return r(i)})(j,a),[j,a,D]),V=s(()=>pg(n.filters?n.filters:[]),[n.filters]);return t(oe,{className:"layout-report-parent",sx:{display:"flex",flexDirection:"column",padding:"1rem",overflow:"auto"},children:[T?e(to,{severity:L?.severity??"error",errorMsg:L?.error_msg??"Error",errorDetail:L?.error_detail??""}):null,t(Ue,{style:{width:"100%",overflowX:"auto"},children:[t(Ue,{style:{width:"100%",overflow:"hidden",marginBottom:"8px",display:o?"none":"inherit"},children:[t(xe,{className:"layout__report__header",variant:"dense",sx:{display:"flex",alignItems:"center",justifyContent:"space-between",...v},style:{background:"var(--primary-bg)"},children:[e(X,{variant:"h5",color:"primary",children:i.trim()}),t(be,{direction:"row",alignItems:"center",className:"group-report-header-tools",children:[e(Rm,{filterData:x,filterMeta:V,isOpenRetrievalDefault:!B,retrievalComponent:f,retrievalType:m,setAllFilters:P,setQueryFilters:S,setShowFilters:()=>{}}),V.length>0&&e(Gl,{setAllFilters:P,filters:U,filterMeta:V,gotoPage:()=>{},setSortBy:()=>{},classes:{}}),w?e(Wo,{title:y("Refetch"),children:e(de,{"aria-label":"more","aria-controls":"long-menu","aria-haspopup":"true",onClick:()=>I(),color:"primary",children:e(ki,{})})}):null,e(Oy,{data:_,setGlobalFilterData:O,visibleKeys:M}),"function"==typeof g?e(Wo,{title:y("Close"),arrow:!0,children:e(de,{onClick:g,size:"small",sx:{width:"35px",height:"35px",padding:0},children:e(Bt,{fontSize:"medium",style:{color:"var(--white)"}})})}):null]})]}),x.length?e(Im,{dense:!0,setAllFilters:F,filters:x}):null,U.length>0&&e(hh,{dense:!0,setAllFilters:P,filters:U,gotoPage:()=>{},setSortBy:()=>{}}),D&&e(Qe,{color:"secondary"})]}),e(Ry,{columns:H,data:z,originalData:j,metaData:n,loading:D,hideFooter:h,onDoubleClickAction:b})]})]})}),Hy=({name:i,validate:r,validationRun:n,postValidationSetCrossFieldValues:a,runValidationOnDependentFieldsChange:s,runPostValidationHookAlways:c,shouldExclude:d,isReadOnly:A,dependentFields:p,fieldKey:f,GridProps:m,CircularProgressProps:g,enableGrid:w,StartAdornment:b,EndAdornment:v,isFieldFocused:y,maxLength:C=-1,label:x,skipValueUpdateFromCrossFieldWhenReadOnly:F,dependentFieldDebounceDelay:S=300,...N})=>{const{value:E,error:k,touched:T,handleChange:L,handleBlur:I,isSubmitting:D,validationRunning:U,fieldKey:P,name:R,excluded:O,readOnly:Q,incomingMessage:H,setIncomingMessage:M,whenToRunValidation:_,runValidation:j}=as({name:i,fieldKey:f,dependentFields:p,validate:r,validationRun:n,runPostValidationHookAlways:c,postValidationSetCrossFieldValues:a,isReadOnly:A,shouldExclude:d,runValidationOnDependentFieldsChange:s,skipValueUpdateFromCrossFieldWhenReadOnly:F,dependentFieldDebounceDelay:S}),z=l(e=>{L(e,e.target?.formattedValue??void 0)},[L]),V=o();if(h(()=>{y&&setTimeout(()=>{V?.current?.focus?.()},1)},[y]),h(()=>{if(null!==H&&"object"==typeof H&&Object.keys(H).length){const{value:e}=H;"DEFAULT_VALUE"!==e&&L(e),"onBlur"===_&&j({value:e},!0),M(null)}},[H,L,j,_]),O)return null;const K=T&&Boolean(k),W=t($e,{disabled:D,children:[e(Ut,{children:x}),u(Ir,{...N,key:P,id:P,name:R,value:E,InputProps:{endAdornment:U?e(B,{position:"end",children:e(G,{color:"primary",variant:"indeterminate",...g})}):Boolean(v)?v:null,startAdornment:Boolean(b)?e(B,{position:"start",children:b}):null},InputLabelProps:{shrink:!0},inputRef:V,onChange:e=>{(-1===C||e.target.value.length<=C)&&z(e)},inputProps:{readOnly:Q,tabIndex:Q?-1:void 0},onBlur:I,disabled:D}),e(Ze,{children:K?k:""})]});return Boolean(w)?e(q,{...m,children:W}):W};var My=Object.freeze({__proto__:null,TextareaAutosize:Hy,default:Hy});const _y=({name:e,fieldKey:t,setValueOnDependentFieldsChange:i,setValueOnDependentFieldsValueChange:r,dependentFields:n,ignoreInSubmit:a=!1,postValidationSetCrossFieldValues:o,validationRun:l,runValidationOnDependentFieldsChange:c,AlwaysRunPostValidationSetCrossFieldValues:d,runExternalFunction:u,onFormDataChange:A,runPostValidationForInitValue:p,dependentFieldDebounceDelay:f=300})=>{const{handleBlur:m,handleChange:g,dependentValues:w,incomingMessage:b,setIncomingMessage:v,setIgnoreInSubmit:y,runValidation:B,whenToRunValidation:C,formState:x}=as({name:e,fieldKey:t,dependentFields:n,postValidationSetCrossFieldValues:o,validationRun:l,runValidationOnDependentFieldsChange:c,AlwaysRunPostValidationSetCrossFieldValues:d,runExternalFunction:u,onFormDataChange:A,runPostValidationForInitValue:p,dependentFieldDebounceDelay:f});h(()=>{m()},[m]),h(()=>{if(Boolean(a))if("function"==typeof a){let e=a(ds(w),x);y(e)}else y(a)},[a,y,w]);const F=s(()=>{const e=ds(w),t=us(e);return JSON.stringify(t.sort((e,t)=>e.fieldKey.localeCompare(t.fieldKey)).map(e=>e.value))},[w]);return h(()=>{if(F&&"function"==typeof r){let e=r(ds(w),x);null!=e&&g(e)}},[F,r,g]),h(()=>{if("function"==typeof i){let e=i(ds(w),x);void 0===e&&null===e||g(e)}},[w,g,i]),h(()=>{if(null!==b&&"object"==typeof b&&Object.keys(b).length){const{value:e}=b;(Boolean(e)||""===e)&&(g(e,void 0,!1,{isIncomingValue:!0}),"onBlur"===C&&B({value:e,isIncomingValue:!0},!0)),v(null)}},[b,g,B,C]),null};var jy=Object.freeze({__proto__:null,HiddenField:_y,default:_y}),zy=Object.freeze({__proto__:null,Typography:Gp,default:Gp});const Vy=Ci(e=>Fi({cardHeader:{padding:e.spacing(1,2)},list:{width:200,height:230,backgroundColor:e.palette.background.paper,overflow:"auto"},button:{margin:e.spacing(.5,0)}})),Ky=(e,t)=>e.filter(e=>t.findIndex(t=>t?.value===e?.value)<0),qy=(e,t)=>e.filter(e=>t.findIndex(t=>t?.value===e)<0),Gy=(e,t)=>e.filter(e=>t.findIndex(t=>t===e)<0),Wy=(e,t)=>{let i=e.filter(e=>-1!==t.findIndex(t=>t?.value===e));return t.filter(e=>i.indexOf(e?.value)>=0)},Jy=({label:i="",leftOptions:r,rightOptions:n,leftOptionsLabel:a,rightOptionsLabel:s,valueSide:o,disabled:l=!1,error:c=!1,readOnly:u=!1,helperText:A="",handleChange:p=()=>{},handleBlur:m=()=>{}})=>{const g=Vy(),[w,b]=d([]),[v,y]=d(r??[]),[B,C]=d(n??[]),x=Wy(w,v),F=Wy(w,B);h(()=>{y(r),C(n),p("left"===o?r.map(e=>e.value):n.map(e=>e.value))},[r,n]);const S=e=>Wy(w,e).length,N=e=>()=>{u||(S(e)===e.length?b(qy(w,e)):b(((e,t)=>[...e,...Gy(t.map(e=>e?.value),e)])(w,e)))},E=(i,r,n)=>t(at,{style:n?{borderBottom:"2px solid #f44336"}:void 0,children:[e(lt,{className:g.cardHeader,avatar:e(ui,{onClick:N(r),checked:S(r)===r.length&&0!==r.length,indeterminate:S(r)!==r.length&&0!==S(r),disabled:0===r.length||l,inputProps:{"aria-label":"all items selected"}}),title:i,subheader:`${S(r)}/${r.length} selected`}),e(ur,{}),t(Dr,{className:g.list,dense:!0,component:"div",role:"list",children:[r.map(i=>{return t(Ur,{role:"listitem",button:!0,onClick:(r=i.value,()=>{if(u)return;const e=w.indexOf(r),t=[...w];-1===e?t.push(r):t.splice(e,1),b(t)}),dense:!0,style:{padding:"0px 16px"},disabled:l,children:[e(Rr,{children:e(ui,{style:{padding:"0px 8px"},checked:-1!==w.indexOf(i.value),tabIndex:-1,disableRipple:!0,disabled:l})}),e(Pr,{id:i.value,primary:i.label})]},i.value);var r}),e(Ur,{})]})]});return t(f,{children:[e(X,{variant:"h6",children:i}),t(q,{container:!0,spacing:2,justifyContent:"center",alignItems:"center",tabIndex:0,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||m(e)},children:[e(q,{item:!0,xs:5,md:5,sm:5,children:E(a,v,c)}),e(q,{item:!0,xs:2,md:2,sm:2,children:t(q,{container:!0,direction:"column",alignItems:"center",children:[e(ct,{variant:"outlined",size:"small",className:g.button,onClick:()=>{if(u)return;let e=B.concat(x),t=Ky(v,x);b(qy(w,x)),y(t),C(e),p("left"===o?t.map(e=>e.value):e.map(e=>e.value))},disabled:0===x.length||l,"aria-label":"move selected right",children:">"}),e(ct,{variant:"outlined",size:"small",className:g.button,onClick:()=>{if(u)return;let e=v.concat(F),t=Ky(B,F);b(qy(w,F)),y(e),C(t),p("left"===o?e.map(e=>e.value):t.map(e=>e.value))},disabled:0===F.length||l,"aria-label":"move selected left",children:"<"})]})}),e(q,{item:!0,xs:5,md:5,sm:5,children:E(s,B,c)})]}),e(Ze,{disabled:l,error:c,children:A})]})},Xy=({name:t,fieldKey:i,label:r,validate:n,validationRun:a,shouldExclude:s,isReadOnly:o,postValidationSetCrossFieldValues:l,runPostValidationHookAlways:h,dependentFields:c,leftOptions:u,rightOptions:A,GridProps:p,enableGrid:f,isFieldFocused:m,runValidationOnDependentFieldsChange:g,_leftOptionsKey:w,_rightOptionsKey:b,disableCaching:v,leftOptionsLabel:y,rightOptionsLabel:B,valueSide:C})=>{const{error:x,touched:F,handleChange:S,handleBlur:N,runValidation:E,isSubmitting:k,fieldKey:T,name:L,dependentValues:I,excluded:D,incomingMessage:U,whenToRunValidation:P,readOnly:R,formState:O,setIncomingMessage:Q}=as({name:t,fieldKey:i,dependentFields:c,validate:n,validationRun:a,runPostValidationHookAlways:h,postValidationSetCrossFieldValues:l,isReadOnly:o,shouldExclude:s,runValidationOnDependentFieldsChange:g}),[H,M]=d([]),[_,j]=d([]),{loadingOptions:z}=Bo(O,u,M,S,I,U,E,P,w,v,Q,!0,"",!1),{loadingOptions:V}=Bo(O,A,j,S,I,U,E,P,b,v,Q,!0,"",!1);if(D)return null;const K=F&&""!==(x??""),G=z||V?e("span",{children:"loading..."}):e(Jy,{name:L,label:r,error:!k&&K,helperText:!k&&K?x:null,handleChange:S,handleBlur:N,disabled:k,readOnly:R,leftOptions:H,rightOptions:_,leftOptionsLabel:y,rightOptionsLabel:B,valueSide:C},T);return Boolean(f)?e(q,{...p,children:G}):G};var Yy=Object.freeze({__proto__:null,TransferList:Xy,default:Xy});const $y=({name:i,validate:r,validationRun:n,postValidationSetCrossFieldValues:a,runValidationOnDependentFieldsChange:s,skipValueUpdateFromCrossFieldWhenReadOnly:c,runPostValidationHookAlways:A,shouldExclude:p,isReadOnly:m,dependentFields:g,fieldKey:w,GridProps:b,enableGrid:v,InputProps:y,inputProps:x,isFieldFocused:F,maxLength:S=-1,setColor:N,searchComponent:E=()=>e("span",{children:"No component found attached"}),...k})=>{const{value:T,error:L,touched:I,handleChange:D,handleBlur:U,isSubmitting:P,fieldKey:R,name:O,excluded:Q,readOnly:H,incomingMessage:M,whenToRunValidation:_,runValidation:j,validationAPIResult:z,setIncomingMessage:V}=as({name:i,fieldKey:w,dependentFields:g,validate:r,validationRun:n,runPostValidationHookAlways:A,postValidationSetCrossFieldValues:a,isReadOnly:m,shouldExclude:p,runValidationOnDependentFieldsChange:s,skipValueUpdateFromCrossFieldWhenReadOnly:c}),[K,G]=d(!1),[W,J]=d("string"==typeof N?N:"");h(()=>{if("function"==typeof N){let e=N(T);J("string"!=typeof e?"":e)}},[T,N]);const X=l(e=>{D(e,e.target?.formattedValue??void 0)},[D]),Y=l(e=>{"object"==typeof e?V(e):D(e,e),G(!1)},[D]),$=o();if(h(()=>{F&&setTimeout(()=>{$?.current?.focus?.()},1)},[F]),h(()=>{if(null!==M&&"object"==typeof M&&Object.keys(M).length){const{value:e}=M;(Boolean(e)||""===e)&&(D(e),"onBlur"===_&&j({value:e},!0)),V(null)}},[M,D,j,_]),Q)return null;y?.inputProps&&(y.inputProps={...y.inputProps,readOnly:H,tabIndex:H?-1:void 0});const Z=I&&Boolean(L),ee=t(f,{children:[u(Ao,{...k,key:R,id:R,name:O,value:T,error:!P&&Z,helperText:e("div",{style:{display:"flex"},children:e(Ze,{children:!P&&Z?L:Boolean(z)?z:null})}),FormHelperTextProps:{component:"div"},InputProps:{style:!P&&Boolean(W)?{color:W,fontWeight:"bold"}:{},endAdornment:e(B,{position:"end",children:e(C,{"aria-label":"toggle password visibility",onClick:()=>G(!0),children:e(Or,{})})}),...y},InputLabelProps:{shrink:!0},inputRef:$,onChange:e=>{(-1===S||e.target.value.length<=S)&&X(e)},inputProps:{readOnly:H,tabIndex:H?-1:void 0,...x},onBlur:U,disabled:P}),e(dt,{open:K,onClose:()=>G(!1),maxWidth:"md",children:u(E,{onAccept:Y,value:T},null)})]});return Boolean(v)?e(q,{...b,children:ee}):ee};var Zy=Object.freeze({__proto__:null,SearchField:$y,default:$y});var eB=Object.freeze({__proto__:null,default:({name:t,validate:i,validationRun:r,postValidationSetCrossFieldValues:n,runValidationOnDependentFieldsChange:a,runPostValidationHookAlways:l,shouldExclude:c,isReadOnly:d,dependentFields:A,fieldKey:p,isFieldFocused:m,setValueOnDependentFieldsChange:g,setValueOnDependentFieldsValueChange:w,skipValueUpdateFromCrossFieldWhenReadOnly:b,label:v,enableGrid:y,GridProps:B,onFormButtonClickHandel:C,startsIcon:x,endsIcon:F,rotateIcon:S,iconStyle:N,tabIndex:E,ignoreInSubmit:k=!1,dependentFieldDebounceDelay:T=300})=>{const{value:L,handleChange:I,isSubmitting:D,excluded:U,readOnly:P,incomingMessage:R,setIncomingMessage:O,whenToRunValidation:Q,runValidation:H,dependentValues:M,formState:_,setIgnoreInSubmit:j}=as({name:t,fieldKey:p,dependentFields:A,validate:i,validationRun:r,runPostValidationHookAlways:l,postValidationSetCrossFieldValues:n,isReadOnly:d,shouldExclude:c,runValidationOnDependentFieldsChange:a,skipValueUpdateFromCrossFieldWhenReadOnly:b,dependentFieldDebounceDelay:T}),z=o();h(()=>{m&&V()},[m,L]);const V=()=>{setTimeout(()=>{z?.current?.focus?.()},1)},K=s(()=>{const e=ds(M),t=us(e);return JSON.stringify(t.sort((e,t)=>e.fieldKey.localeCompare(t.fieldKey)).map(e=>e.value))},[M]);if(h(()=>{if(K&&"function"==typeof w){let e=w(ds(M),_);null!=e&&I(e)}},[K,w,I]),h(()=>{if("function"==typeof g){let e=g(ds(M),_);null!=e&&I(e)}},[M,I,g]),h(()=>{if(null!==R&&"object"==typeof R&&Object.keys(R).length){const{value:e,isFieldFocused:t}=R;(Boolean(e)||""===e)&&(I(e,void 0,!1,{isIncomingValue:!0}),t&&V(),"onBlur"===Q&&H({value:e,isIncomingValue:!0},!0)),O(null)}},[R,I,H,Q]),h(()=>{if(Boolean(k))if("function"==typeof k){let e=k(ds(M),_,{isSubmitting:D,value:L});j(e)}else j(k)},[k,j,M,L]),U)return null;const q=e(f,{children:e(eo,{color:"secondary",onClick:e=>{"function"==typeof C&&C(p,ds(M)),I(isNaN(L)||!Boolean(L)?"1":parseInt(L)+1)},disabled:P??!1,style:{width:"100%",paddingLeft:"10px",marginTop:"17px"},starticon:x,endicon:F,rotateIcon:S,ref:z,tabIndex:E,sx:{"& svg":{...N}},children:v})});return Boolean(y)?u(ge,{...B,key:p,container:!0,justifyContent:"center",alignItems:"center",alignSelf:"start",mt:"0.65rem"},q):q}});const tB=({name:t,label:i,shouldExclude:r,dependentFields:n,fieldKey:a,GridProps:o,setValueOnDependentFieldsChange:l,setValueOnDependentFieldsValueChange:c,skipValueUpdateFromCrossFieldWhenReadOnly:d,DividerProps:u,componentType:A})=>{const{value:p,handleChange:f,excluded:m,incomingMessage:g,setIncomingMessage:w,dependentValues:b,formState:v}=as({name:t,fieldKey:a,dependentFields:n,shouldExclude:r,componentType:A,skipValueUpdateFromCrossFieldWhenReadOnly:d}),{t:y}=W(),B=s(()=>{const e=ds(b),t=us(e);return JSON.stringify(t.sort((e,t)=>e.fieldKey.localeCompare(t.fieldKey)).map(e=>e.value))},[b]);return h(()=>{if(B&&"function"==typeof c){let e=c(ds(b),v);null!=e&&f(e)}},[B,c,f]),h(()=>{if("function"==typeof l){let e=l(ds(b),v);null!=e&&f(e)}},[b,f,l]),h(()=>{if(null!==g&&"object"==typeof g&&Object.keys(g).length){const{value:e}=g;(Boolean(e)||""===e)&&f(e),w(null)}},[g,f]),m?null:e(ge,{item:!0,...o,children:e(we,{textAlign:"left",...u,children:p&&p.length>0?p:y(i??"")})})};var iB=Object.freeze({__proto__:null,Divider:tB,default:tB});const rB=i=>{let{defaultValue:r,label:n,enableGrid:a,GridProps:s}=i;"object"==typeof r&&(r=Array.isArray(r)?r.join(","):r?.toDateString?.()??"Invalid Value"),"boolean"==typeof r&&(r=r?"Yes":"No");let o=t("div",{children:[e("b",{children:n}),e("br",{}),r]});return Boolean(a)?e(q,{...s,children:o}):o};var nB=Object.freeze({__proto__:null,default:rB,valueField:rB});export{zs as AddIDinResponseData,Wg as AgGridTableWrapper,to as Alert,Za as AuthContextProvider,jl as AutoRefreshProvider,af as CRUDContext,sf as CRUDContextProvider,_s as CheckObjectAllKeyisEmpty,go as Checkbox,mo as ChipTextField,bo as ClearCacheContext,vo as ClearCacheProvider,mA as ColorlibConnector,fA as ColorlibStepIconRoot,so as ConvertExcelToJSONData,Gs as CreateDetailsRequestData,qs as CreateLanguageRequestData,Ru as CsvViewer,rs as CustomPropertiesConfigurationProvider,NA as DataTableGridWrapper,Ks as DefaultErrorObject,Sm as DetailsGridWithHeader,om as DocumentGridCRUD,rd as EXPORT_WORKER_STATUS,Pu as ExcelViewer,$s as ExportCSVFileFromData,Ys as ExportExcelFileFromData,_u as FileUploadControl,zu as FileViewerGrid,Zp as FormComponentView,Ya as FormContext,Nc as FormWrapper,bd as FullScreenLoader,eo as GradientButton,Am as GridCRUD,ao as GridDataExport,Vu as GridDataImport,hu as GridWrapper,cu as GridWrapperStatic,Jo as HtmlTooltip,Qu as ImageViewer,Ko as Input,Vo as InputLabel,Ho as KeyboardDatePicker,_o as KeyboardDateTimePicker,Mo as KeyboardTimePicker,Qy as LayoutReport,wd as LoaderPaperComponent,no as LoadingTextAnimation,nf as MasterDetailsForm,LA as MessageBoxNavigateWrapper,TA as MessageBoxWrapper,Hu as NoPreview,Ws as ObjectMappingKeys,Ou as PDFViewer,Ad as PopupContext,pd as PopupContextProvider,IA as PopupMessageAPIWrapper,sd as PopupRequestWrapper,kA as PrintButton,Xs as ProcessDetailsData,gd as RemarksAPIWrapper,Bd as ReportExportScreen,mg as ReportGrid,Cg as ReportWrapper,Ll as SearchBar,Il as SearchBar2,Ro as SelectWithoutOptions,gm as ServerGrid,pm as ServerGridContext,fm as ServerGridContextProvider,wm as ServerGridWrapper,cm as SimpleCRUD,xm as SnackbarProviderWrapper,Js as StringtoUnicode,vm as Tab,ym as Tabs,Ao as TextField,fo as TextField3,po as TextFieldForSelect,$A as ToggleButtonGroup,Wo as Tooltip,ph as Transition,js as UpdateRequestDataVisibleColumn,gu as UploadTarget,ed as WorkerContext,td as WorkerContextProvider,Ua as atomKeys,Rs as attachMethodsToMetaData,yo as cacheWrapperKeyGen,ku as cleanFileObj,Gc as components,bu as computeFileFingerprint,vu as computeSize,Lu as convertToFormData,Tu as convertToJsonObject,Yo as currencySymbol,Sg as customCellAggFunc,Ms as deriveData,Hs as deriveFormData,yu as detectMimeType,Dg as displayNumber,xu as downloadFile,Ig as dynamicRowHeight,Su as extractColumnsFromAdditionalMetaData,us as extractDependentFields,Qs as extractGridMetaData,Os as extractMetaData,uu as fileColumns,wg as filters,kg as findFirstDisplayColumn,Eg as findLastDisplayColumn,Wa as formArrayFieldRegisterSelector,Ga as formArrayFieldRegistryAtom,qa as formArrayFieldRowsAtom,Ja as formArrayFieldUnregisterSelector,Pa as formAtom,Ra as formFieldAtom,_a as formFieldExcludeAddSelector,ja as formFieldExcludeRemoveSelector,Va as formFieldRegisterSelector,za as formFieldRegistryAtom,Ka as formFieldUnregisterSelector,Qa as formFieldsErrorWatcherAddSelector,Oa as formFieldsErrorWatcherAtom,Ha as formFieldsErrorWatcherRemoveSelector,Ma as formFieldsExcludedAtom,au as formatCurrency,xg as getAgGridSRNo,$o as getCurrencySymbol,Tg as getGridRowData,ka as getIn,ya as greaterThanDate,Ba as greaterThanInclusiveDate,wa as greaterThanInclusiveString,ga as greaterThanString,Vs as groupBy,Rg as handleDeleteButtonClick,wu as hashCode,Cu as isDuplicate,Ea as isInteger,Bu as isMimeTypeValid,Na as isObject,Sa as isString,Ug as lessThanDate,xa as lessThanInclusiveDate,va as lessThanInclusiveString,ba as lessThanString,Ng as parseDate,wo as queryClient,Lg as removeExistingRowData,Fa as ruleEngine,mm as serverGridContextGenerator,Pg as setErrorMessage,Ta as setIn,fa as singletonFunctionRegisrationFactory,ma as singletonFunctionRegisrationFactoryForTableCells,Xa as subscribeToFormFieldsSelector,ds as transformDependentFieldsState,Eu as transformFileObject,Fu as transformMetaDataByMutating,Vl as useAutoRefresh,dm as useDialogStyles,Fm as useDialogStylesDetailsGrid,as as useField,Is as useFieldArray,Ls as useForm,fd as usePopupContext,ns as usePropertiesConfigContext,Cm as useSnackbarProviderWrapper,bm as useTabStyles,id as useWorkerContext,Ts as utilFunction,Nu as validateFilesAndAddToList,Da as yupReachAndValidate,Ia as yupValidationHelper};
134
134
  //# sourceMappingURL=index.js.map