react-declarative 2.7.109 → 2.7.110

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.esm.js CHANGED
@@ -1 +1 @@
1
- import{__read as e,__awaiter as t,__generator as n,__spreadArray as r,__asyncGenerator as o,__await as i,__assign as a,__rest as l,__values as c,__extends as u,__makeTemplateObject as s,__asyncValues as d}from"tslib";import*as f from"react";import m,{createContext as p,useMemo as h,useContext as v,useState as g,useRef as b,useCallback as y,useEffect as w,useLayoutEffect as E,forwardRef as x,memo as C,Fragment as k,createElement as S,cloneElement as L,lazy as N,Suspense as I}from"react";import{useTheme as M,createTheme as R,ThemeProvider as P,alpha as A}from"@mui/material/styles";import{createMakeAndWithStyles as T,keyframes as D}from"tss-react";import j from"@mui/material/Box";import O from"@mui/material/CircularProgress";import F from"@mui/material/ListItemIcon";import _ from"@mui/material/Typography";import B from"@mui/material/MenuItem";import H from"@mui/material/Divider";import W from"@mui/material/Menu";import*as z from"react-dom";import{flushSync as V}from"react-dom";import{v4 as Y}from"uuid";import U from"@mui/material/Grid";import{Grid as q,alpha as $,Typography as X,Divider as G,useMediaQuery as K,Accordion as Q,AccordionSummary as J,AccordionDetails as Z,Paper as ee,Box as te,debounce as ne,useTheme as re,lighten as oe,Tooltip as ie,darken as ae,Button as le,List as ce,ListItem as ue,ListItemIcon as se,TextField as de,Avatar as fe,Grow as me,createTheme as pe,ThemeProvider as he}from"@mui/material";import ve from"@mui/material/Checkbox";import ge from"@mui/material/FormControlLabel";import be from"@mui/material/FormGroup";import ye from"@mui/material/Button";import we from"@mui/material/Stack";import Ee from"@mui/material/Autocomplete";import xe from"@mui/material/TextField";import Ce from"@mui/material/Radio";import ke from"@mui/material/Paper";import Se from"@mui/material/Modal";import Le from"@mui/material/InputAdornment";import Ne from"@mui/material/IconButton";import Ie from"@mui/material/List";import Me from"@mui/material/ListItemButton";import Re from"@mui/icons-material/ArrowDropUp";import Pe from"@mui/icons-material/ArrowDropDown";import Ae from"@mui/icons-material/MoreVert";import Te from"@mui/material/Fab";import De from"@mui/material/LinearProgress";import je from"@mui/material/Backdrop";import Oe from"@mui/material/ListItemText";import Fe from"@mui/icons-material/Close";import _e from"@mui/icons-material/RadioButtonChecked";import Be from"@mui/icons-material/RadioButtonUnchecked";import He from"@mui/material/Chip";import We from"@mui/icons-material/CheckBox";import ze from"@mui/icons-material/CheckBoxOutlineBlank";import Ve from"@mui/material/RadioGroup";import Ye from"@mui/material/Rating";import Ue from"dayjs";export{default as dayjs}from"dayjs";import qe from"@mui/material/Popover";import $e from"@mui/material/Toolbar";import Xe from"@mui/icons-material/KeyboardArrowLeft";import Ge from"@mui/icons-material/KeyboardArrowRight";import Ke from"@mui/icons-material/CalendarTodayOutlined";import Qe from"@mui/icons-material/ArrowForward";import Je from"@mui/icons-material/AlarmOutlined";import Ze from"@mui/material/Switch";import et from"@mui/material/Slider";import tt from"@mui/material/ListItem";import nt from"@mui/icons-material/Clear";import rt from"@mui/material/ListSubheader";import ot from"@mui/icons-material/Search";import it from"@mui/icons-material/ExpandMore";import at from"@mui/material/Tab";import lt from"@mui/material/Tabs";import{createMemoryHistory as ct,createBrowserHistory as ut}from"history";import st from"@mui/material/Dialog";import dt from"@mui/material/DialogContent";import ft from"@mui/material/DialogActions";import mt from"@mui/material/DialogTitle";import pt from"@mui/material/Badge";import ht from"@mui/icons-material/Fullscreen";import vt from"@mui/material/Table";import gt from"@mui/material/TableBody";import bt from"@mui/material/TableHead";import yt from"@mui/material/TableContainer";import wt from"@mui/material/TableRow";import Et from"@mui/material/TableCell";import xt from"@mui/material/TablePagination";import Ct from"@mui/material/PaginationItem";import kt from"@mui/material/Pagination";import St from"@mui/icons-material/ArrowUpward";import Lt from"@mui/icons-material/ArrowDownward";import Nt from"@mui/material/Tooltip";import It from"@mui/material/TableSortLabel";import Mt from"@mui/icons-material/Add";import Rt from"@mui/icons-material/CleaningServicesOutlined";import Pt from"@mui/icons-material/Refresh";import At from"@mui/icons-material/Sort";import Tt from"@mui/icons-material/Settings";import Dt from"@mui/material/Collapse";import jt from"@mui/icons-material/ExpandLess";import Ot from"@mui/icons-material/NotInterested";import Ft from"@mui/icons-material/FilterList";import{pathToRegexp as _t,compile as Bt,match as Ht}from"path-to-regexp";import{red as Wt}from"@mui/material/colors";import zt from"@mui/material/AppBar";import Vt from"@mui/material/CssBaseline";import Yt from"@mui/material/Drawer";import Ut from"@mui/icons-material/Menu";import qt from"@mui/material/ButtonBase";import $t from"@mui/icons-material/OutlinedFlag";import Xt from"@mui/material/SwipeableDrawer";import Gt from"@mui/material/InputBase";import Kt from"@mui/material/Breadcrumbs";import Qt from"@mui/material/Link";import Jt from"@mui/material/ButtonGroup";import Zt from"@mui/icons-material/Palette";import en from"@mui/icons-material/Remove";import tn from"@mui/material/Snackbar";import nn from"@mui/icons-material/KeyboardArrowUp";import rn from"@mui/material/Box/Box";import on from"@mui/material/Alert";import an from"@mui/icons-material/CloudUpload";import ln from"@mui/icons-material/Delete";import cn from"@mui/material/Step";import un from"@mui/material/StepLabel";import sn from"@mui/material/Stepper";import*as dn from"xlsx";import fn from"dayjs/plugin/isToday";import mn from"dayjs/plugin/localeData";import pn from"dayjs/locale/en-gb";import hn from"dayjs/plugin/utc";import vn from"@mui/icons-material/ArrowBackIos";import gn from"@mui/icons-material/ArrowForwardIos";import bn from"dayjs/plugin/timezone";import yn from"@mui/icons-material/Send";import wn from"@mui/icons-material/Stop";import En from"@mui/icons-material/KeyboardVoice";import xn from"@mui/icons-material/AttachFile";import Cn from"@mui/icons-material/Folder";import kn from"@mui/icons-material/ContentCopy";import Sn from"@mui/icons-material/AccessTime";import{fileTypeFromBlob as Ln}from"file-type/core";import Nn from"@mui/material/Avatar";import In from"@mui/material/ListItemAvatar";import Mn from"@mui/icons-material/CloudSync";globalThis.window||(globalThis.window=globalThis);var Rn,Pn=p(null),An=function(e){var t=e.children,n=e.apiRef,r=void 0===n?null:n,o=e.reloadSubject,i=void 0===o?null:o,a=e.changeSubject,l=void 0===a?null:a,c=e.updateSubject,u=void 0===c?null:c,s=h(function(){return{apiRef:r,reloadSubject:i,changeSubject:l,updateSubject:u}},[r,i,l,u]);return f.createElement(Pn.Provider,{value:s},t)},Tn=T({useTheme:M}).makeStyles,Dn=function(e){var t=e.children,n=M(),r=h(function(){return R(n)},[n]);return f.createElement(P,{theme:r},t)};!function(e){e.Layout="custom-layout",e.Switch="switch-field",e.YesNo="yesno-field",e.Line="line-field",e.File="file-field",e.Group="group-layout",e.Paper="paper-layout",e.Outline="outline-layout",e.Expansion="expansion-layout",e.Radio="radio-field",e.Checkbox="checkbox-field",e.Text="text-field",e.Date="date-field",e.Time="time-field",e.Progress="progress-field",e.Component="component-field",e.Slider="slider-field",e.Combo="combo-field",e.Choose="choose-field",e.Tree="tree-field",e.Dict="dict-field",e.Init="init-field",e.Phony="phony-field",e.Button="button-field",e.Icon="icon-field",e.Complete="complete-field",e.Items="items-field",e.Rating="rating-field",e.Typography="typography-field",e.Fragment="fragment-layout",e.Div="div-layout",e.Box="box-layout",e.Tabs="tabs-layout",e.Hero="hero-layout",e.Center="center-layout",e.Stretch="stretch-layout",e.Condition="condition-layout"}(Rn||(Rn={})),Object.entries(Rn).forEach(function(t){var n=e(t,2),r=n[0],o=n[1];Rn[r]=Symbol.for(o)});var jn=Rn,On=new Set([jn.Group,jn.Box,jn.Paper,jn.Outline,jn.Expansion,jn.Div,jn.Tabs,jn.Hero,jn.Fragment,jn.Center,jn.Stretch,jn.Condition,jn.Layout]),Fn=function(e){return On.has(e)},_n=function(e){var t=e.type;return e.name&&!On.has(t)},Bn=function(e){return"object"==typeof e&&null!==e&&Object.getPrototypeOf(e)===Object.prototype},Hn=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(Array.isArray(e[n])?t[n]=e[n].slice(0):Bn(e[n])?t[n]=Hn(e[n]):t[n]=e[n]);return t},Wn=function(t,n,r){var o=(Array.isArray(n)?n:n.split(".").filter(function(e){return e})).flatMap(function(e){return"string"==typeof e?e.split("."):e}),i=o.slice(0,o.length-1).reduce(function(e,t){return e&&e[t]},t),a=e(o.reverse(),1)[0];try{return i[a]=r,!0}catch(e){return!1}},zn=function(e,t){return(Array.isArray(t)?t:t.split(".").filter(function(e){return e})).flatMap(function(e){return"string"==typeof e?e.split("."):e}).reduce(function(e,t){return e&&e[t]},e)},Vn=function(e,t){if(e===t)return!0;if(Bn(e)&&Bn(t)){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!Vn(e[n],t[n]))return!1;return!0}return!1};var Yn,Un=function(){function o(){var o=this;this._events={},this.getListeners=function(e){return o._events[e]||[]},this.subscribe=function(e,t){!o._events[e]&&(o._events[e]=[]),o._events[e].push(t)},this.unsubscribe=function(e,t){!o._events[e]&&(o._events[e]=[]),o._events[e]=o._events[e].filter(function(e){return t!==e})},this.unsubscribeAll=function(){o._events={}},this.once=function(i,a){var l=function(){for(var c=[],u=0;u<arguments.length;u++)c[u]=arguments[u];return t(o,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,a.apply(void 0,r([],e(c),!1))];case 1:return t.sent(),this.unsubscribe(i,l),[2]}})})};return o.subscribe(i,l),function(){o.unsubscribe(i,l)}},this.emit=function(i){for(var a=[],l=1;l<arguments.length;l++)a[l-1]=arguments[l];return t(o,void 0,void 0,function(){var t,o;return n(this,function(n){switch(n.label){case 0:t=r([],e(this._events&&this._events[i]||[]),!1),o=0,n.label=1;case 1:return o===t.length?[3,4]:[4,t[o].apply(t,r([],e(a),!1))];case 2:n.sent(),n.label=3;case 3:return o++,[3,1];case 4:return[2]}})})}}return Object.defineProperty(o.prototype,"hasListeners",{get:function(){return e=this._events,!(0===Object.getOwnPropertySymbols(e).length&&0===Object.getOwnPropertyNames(e).length);var e},enumerable:!1,configurable:!0}),o}(),qn=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce(function(t,n){return function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return t(n.apply(void 0,r([],e(o),!1)))}})},$n=function(e){return void 0===e&&(e=1e3),new Promise(function(t){return setTimeout(function(){return t()},e)})},Xn=Symbol("cancelable-canceled"),Gn=function(t){var n,o=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return new Promise(function(i,a){var l=!1;n&&n(),n=function(){l=!0,i(Xn)};var c=t.apply(void 0,r([],e(o),!1));c.then(function(e){l||i(e)}),c.catch(function(e){l||a(e)})})};return o.cancel=function(){n&&n()},o},Kn=function(o){var i=Promise.resolve(),a=void 0,l=function(){for(var c=[],u=0;u<arguments.length;u++)c[u]=arguments[u];var s=!1,d=function(){s=!0};return a=a?qn(a,d):d,i=i.then(function(){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return s?[3,2]:[4,o.apply(void 0,r([],e(c),!1))];case 1:return[2,t.sent()];case 2:return[2,Xn]}})})}).finally(function(){l.clear(),a=void 0}),i};return l.clear=function(){i=Promise.resolve(),a=void 0},l.cancel=function(){i=Promise.resolve(),a&&a(),a=void 0},l},Qn=function(e){return requestAnimationFrame(e)},Jn=function(e){return cancelAnimationFrame(e)},Zn=function(t,n){var o;void 0===n&&(n=1e3);var i=null,a=n?setTimeout:Qn,l=n?clearTimeout:Jn,c=function(){for(var c=[],u=0;u<arguments.length;u++)c[u]=arguments[u];null!==o&&l(o);var s=function(){i=null,o=null,t.apply(void 0,r([],e(c),!1))};i=s,o=a(s,n)};return c.clear=function(){null!==o&&l(o),o=null,i=null},c.flush=function(){null!==o&&l(o),i&&i(),o=null,i=null},c.pending=function(){return!!i},c},er=Symbol("observer-subscribe"),tr=Symbol("observer-connect"),nr=Symbol("observer-disconnect"),rr=Symbol("observer-connect-listen"),or=Symbol("observer-disconnect-listen"),ir=function(){function e(r){var a=this;this.dispose=r,this.broadcast=new Un,this._isShared=!1,this._subscribe=function(e,t){a.broadcast.subscribe(er,t),e[rr](function(){a.broadcast.emit(tr)}),e[or](function(){a.hasListeners||a.broadcast.emit(nr)})},this._unsubscribe=function(e){a.broadcast.unsubscribe(er,e)},this.tryDispose=function(){a.hasListeners||a._isShared||(a.dispose(),a.broadcast.emit(nr))},this.map=function(t){var n,r=new e(qn(function(){return a.tryDispose()},function(){return n()})),o=function(e){var n=t(e);r.emit(n)};return a._subscribe(r,o),n=function(){return a._unsubscribe(o)},r},this.flatMap=function(t){var n,r=new e(qn(function(){return a.tryDispose()},function(){return n()})),o=function(e){var n=t(e);Array.isArray(n)?n.forEach(function(e){r.emit(e)}):r.emit(n)};return a._subscribe(r,o),n=function(){return a._unsubscribe(o)},r},this.operator=function(e){return e(a)},this.reduce=function(t,n){var r,o=n,i=new e(qn(function(){return a.tryDispose()},function(){return r()})),l=function(e){var n=t(o,e);o=n,i.emit(n)};return a._subscribe(i,l),r=function(){return a._unsubscribe(l)},i},this.split=function(){var t,n=new e(qn(function(){return a.tryDispose()},function(){return t()})),r=function(e){Array.isArray(e)?e.flat(Number.POSITIVE_INFINITY).forEach(function(e){n.emit(e)}):n.emit(e)};return a._subscribe(n,r),t=function(){return a._unsubscribe(r)},n},this.mapAsync=function(r,o){var i,l=new e(qn(function(){return a.tryDispose()},function(){return i()})),c=Kn(r),u=function(e){return t(a,void 0,void 0,function(){var t,r;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,c(e)];case 1:return(t=n.sent())!==Xn&&l.emit(t),[3,3];case 2:if(r=n.sent(),!o)throw r;return o(r),[3,3];case 3:return[2]}})})};return a._subscribe(l,u),i=qn(function(){return a._unsubscribe(u)},function(){return c.clear()}),l},this.filter=function(t){var n,r=new e(qn(function(){return a.tryDispose()},function(){return n()})),o=function(e){t(e)&&r.emit(e)};return a._subscribe(r,o),n=function(){return a._unsubscribe(o)},r},this.tap=function(t){var n,r=new e(qn(function(){return a.tryDispose()},function(){return n()})),o=function(e){t(e),r.emit(e)};return a._subscribe(r,o),n=function(){return a._unsubscribe(o)},r},this.debounce=function(t){var n,r=new e(qn(function(){return a.tryDispose()},function(){return n()})),o=Zn(function(e){r.emit(e)},t);return a._subscribe(r,o),n=qn(function(){return o.clear()},function(){return a._unsubscribe(o)}),r},this.delay=function(r){var o,i=new e(qn(function(){return a.tryDispose()},function(){return o()})),l=!1,c=Kn(function(e){return t(a,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,$n(r)];case 1:return t.sent(),l?[3,3]:[4,i.emit(e)];case 2:t.sent(),t.label=3;case 3:return[2]}})})});return a._subscribe(i,c),o=qn(function(){return c.clear()},function(){return a._unsubscribe(c)},function(){l=!0}),i},this.emit=function(e){return t(a,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,this.broadcast.emit(er,e)];case 1:return t.sent(),[2]}})})},this.connect=function(e){return a.broadcast.subscribe(er,e),a.broadcast.emit(tr),qn(function(){return a.tryDispose()},function(){return a._unsubscribe(e)})},this.once=function(e){var t;return t=a.connect(function(n){e(n),t()})},this.share=function(){return a._isShared=!0,a},this.repeat=function(t){var n,r;void 0===t&&(t=1e3);var o=new e(qn(function(){return a.tryDispose()},function(){return n()},function(){return void 0!==r&&clearTimeout(r)})),i=function(e){void 0!==r&&clearTimeout(r),o.emit(e),a.hasListeners&&(r=setTimeout(i,t,e))};return a._subscribe(o,i),n=function(){return a._unsubscribe(i)},o},this.merge=function(t){var n,r=new e(qn(function(){return a.tryDispose()},function(){return n()})),o=function(e){r.emit(e)};a._subscribe(r,o);var i=function(){};return r[rr](function(){i=t.connect(o)||function(){}}),n=qn(function(){return a._unsubscribe(o)},function(){return i()}),r},this.unsubscribe=function(){a.broadcast.unsubscribeAll(),a.broadcast.emit(nr),a.dispose()},this.toPromise=function(){return new Promise(function(e){a.once(function(t){return e(t)})})},this.toIteratorContext=function(){var e=a,t=!1;return{iterate:function(){return o(this,arguments,function(){var r;return n(this,function(n){switch(n.label){case 0:return t?[3,4]:[4,i(e.toPromise())];case 1:return r=n.sent(),[4,i(r)];case 2:return[4,n.sent()];case 3:return n.sent(),[3,0];case 4:return[2]}})})},done:function(){t=!0}}}}return Object.defineProperty(e.prototype,"isShared",{get:function(){return this._isShared},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasListeners",{get:function(){return!!this.broadcast.getListeners(er).length},enumerable:!1,configurable:!0}),e.prototype[rr]=function(e){this.broadcast.once(tr,e)},e.prototype[or]=function(e){this.broadcast.once(nr,e)},e}(),ar=Symbol("react-declarative-subject"),lr=function(){function e(){var e=this;this._emitter=new Un,this.map=function(t){var n,r=new ir(function(){return n()});return n=e.subscribe(r.emit),r.map(t)},this.flatMap=function(t){var n,r=new ir(function(){return n()});return n=e.subscribe(r.emit),r.flatMap(t)},this.reduce=function(t,n){var r,o=new ir(function(){return r()});return r=e.subscribe(o.emit),o.reduce(t,n)},this.mapAsync=function(t,n){var r,o=new ir(function(){return r()});return r=e.subscribe(o.emit),o.mapAsync(t,n)},this.filter=function(t){var n,r=new ir(function(){return n()});return n=e.subscribe(r.emit),r.filter(t)},this.tap=function(t){var n,r=new ir(function(){return n()});return n=e.subscribe(r.emit),r.tap(t)},this.operator=function(t){var n,r=new ir(function(){return n()});return n=e.subscribe(r.emit),r.operator(t)},this.split=function(){var t,n=new ir(function(){return t()});return t=e.subscribe(n.emit),n.split()},this.debounce=function(t){var n,r=new ir(function(){return n()});return n=e.subscribe(r.emit),r.debounce(t)},this.delay=function(t){var n,r=new ir(function(){return n()});return n=e.subscribe(r.emit),r.delay(t)},this.repeat=function(t){var n,r=new ir(function(){return n()});return n=e.subscribe(r.emit),r.repeat(t)},this.merge=function(t){var n,r=new ir(function(){return n()});return n=e.subscribe(r.emit),r.merge(t)},this.subscribe=function(t){return e._emitter.subscribe(ar,t),function(){e._emitter.unsubscribe(ar,t)}},this.unsubscribeAll=function(){e._emitter.unsubscribeAll()},this.once=function(t){return e._emitter.once(ar,t)},this.toPromise=function(){return e.toObserver().toPromise()},this.toIteratorContext=function(){return e.toObserver().toIteratorContext()},this.next=this.next.bind(this),this.toObserver=this.toObserver.bind(this),this.toIteratorContext=this.toIteratorContext.bind(this)}return e.prototype.next=function(e){return t(this,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,this._emitter.emit(ar,e)];case 1:return t.sent(),[2]}})})},e.prototype.toObserver=function(){var e,t=new ir(function(){return e()});return e=this.subscribe(t.emit),t},e}(),cr=function(e){var t,n=0,r=new ir(function(){void 0!==t&&clearTimeout(t)}),o=function(){r.emit(n),n++,t=setTimeout(o,e)};return r[rr](function(){o()}),r},ur=function(e,r){var o=!1,i=new ir(function(){o=!0});return i[rr](function(){t(void 0,void 0,void 0,function(){var t,a;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,e()];case 1:return t=n.sent(),o||i.emit(t),[3,3];case 2:if(a=n.sent(),!r)throw a;return r(a),[3,3];case 3:return[2]}})})}),i},sr=function(e){var t,n=new ir(function(){void 0!==t&&clearTimeout(t)}),r=function(){t=void 0,n.emit()};return n[rr](function(){setTimeout(r,e)}),n},dr=function(e){var t=new ir(function(){});return t[rr](function(){Array.isArray(e)?e.flat(Number.POSITIVE_INFINITY).forEach(function(e){t.emit(e)}):t.emit(e)}),t},fr=function(e){var t=new ir(function(){document.removeEventListener(e,t.emit)});if("document"in globalThis){t[rr](function(){document.addEventListener(e,t.emit)})}return t},mr=function(e){return{tap:function(t){return e().tap(t)},debounce:function(t){return e().debounce(t)},delay:function(t){return e().delay(t)},repeat:function(t){return e().repeat(t)},filter:function(t){return e().filter(t)},map:function(t){return e().map(t)},flatMap:function(t){return e().flatMap(t)},operator:function(t){return e().operator(t)},reduce:function(t,n){return e().reduce(t,n)},mapAsync:function(t,n){return e().mapAsync(t,n)},merge:function(t){return e().merge(t)},split:function(){return e().split()},connect:function(t){return e().connect(t)},once:function(t){return e().once(t)},unsubscribe:function(){return e().unsubscribe()},share:function(){return e().share()},toPromise:function(){return e().toPromise()},toIteratorContext:function(){return e().toIteratorContext()}}},pr=function(){function t(){}var n;return n=t,t.merge=function(e){var t=(new lr).toObserver();return e.forEach(function(e){e&&(t=t.merge(e))}),t},t.join=function(t,n){var o=void 0===n?{}:n,i=o.race,a=void 0!==i&&i,l=o.buffer,c=void 0===l?[]:l,u=function(){},s=new ir(function(){return u()});t=t.filter(function(e){return!!e}),c=r([],e(new Array(t.length)),!1).map(function(e,t){return c[t]});var d=[],f=function(){c.every(function(e){return void 0!==e})&&(s.emit(r([],e(c),!1)),!a&&c.fill(void 0))};return s[rr](function(){t.forEach(function(e,t){if(e){var n=e.connect(function(e){c[t]=e,f()});d.push(function(){return n()})}}),u=qn.apply(void 0,r([],e(d),!1))}),s},t.unicast=function(e){return a(a({},mr(e)),{isUnicasted:!0})},t.multicast=function(e){var t;return a(a({},mr(function(){return t||(t=e())[or](function(){t=void 0}),t})),{getRef:function(){return t},isMulticasted:!0})},t.createHot=function(e){var t,n=new ir(function(){return t()});return t=e(n.emit)||function(){},n},t.createCold=function(e){var t=function(){},n=new ir(function(){return t()});return n[rr](function(){t=e(n.emit)||function(){}}),n},t.create=n.createCold,t.pipe=function(e,t){var n=function(){},r=new ir(function(){return n()});return r[rr](function(){var o=new lr,i=e.connect(o.next),a=t(o,r.emit)||function(){};n=qn(function(){return a()},function(){return i()})}),r},t.fromInterval=cr,t.fromPromise=ur,t.fromDelay=sr,t.fromArray=dr,t.fromEvent=fr,t.fromValue=function(e){var t=new ir(function(){});return t[rr](function(){"function"==typeof e?t.emit(e()):t.emit(e)}),t},t.fromSubject=function(e){var t,n=new ir(function(){return t()});return t=e.subscribe(n.emit),n},t.fromBehaviorSubject=function(e){var t,n=new ir(function(){return t()});return n[rr](function(){e.data&&n.emit(e.data)}),t=e.subscribe(n.emit),n},t}(),hr=pr.create(function(e){return document.addEventListener("mousemove",e),function(){return document.removeEventListener("mousemove",e)}}),vr=pr.create(function(e){return document.addEventListener("touchmove",e),function(){return document.removeEventListener("touchmove",e)}}),gr=pr.create(function(e){return document.addEventListener("scroll",e),function(){return document.removeEventListener("scroll",e)}}),br=pr.unicast(function(){var e=0;return pr.merge([hr,vr,gr]).filter(function(){return 20===e||(e+=1,!1)}).tap(function(){e=0}).share()}),yr=function(e){return br.connect(e)},wr=pr.unicast(function(){return pr.create(function(e){return pr.fromEvent("keydown").connect(function(t){"Tab"===t.code&&e()})}).share()}),Er=pr.unicast(function(){return pr.create(function(e){return document.addEventListener("touchstart",e,{passive:!1}),document.addEventListener("mousedown",e),function(){document.removeEventListener("touchstart",e),document.removeEventListener("mousedown",e)}}).share()}),xr=function(e){var t=p(e||null);return[function(e){var n=e.children,r=e.payload;return m.createElement(t.Provider,{value:r},n)},function(){return v(t)}]},Cr=e(xr(),2),kr=Cr[0],Sr=Cr[1],Lr=p(null),Nr={},Ir=function(e){var t=e.children,n=e.payload,r=void 0===n?Nr:n;return f.createElement(Lr.Provider,{value:r},t)},Mr=function(){return v(Lr)},Rr=((Yn={})[jn.Checkbox]=!1,Yn[jn.Radio]=null,Yn[jn.Text]="",Yn[jn.Switch]=!1,Yn[jn.Progress]=1,Yn[jn.Slider]=0,Yn[jn.Combo]=null,Yn[jn.Items]=null,Yn[jn.Rating]=3,Yn[jn.Typography]="",Yn[jn.Date]="",Yn[jn.Time]="",Yn[jn.File]=null,Yn[jn.Choose]=null,Yn[jn.Component]=null,Yn[jn.Complete]="",Yn[jn.Init]=null,Yn[jn.YesNo]=null,Yn[jn.Dict]=null,Yn[jn.Tree]=null,Yn),Pr=function(e){var t=Rr[e];return void 0===t?void console.warn("react-declarative One initialValue unknown type ".concat(String(e))):t},Ar=function(t){void 0===t&&(t=[]);var n=[],o=function(t){return void 0===t&&(t=[]),null==t?void 0:t.forEach(function(t){var i=t.fields||[],a=t.child?[t.child]:[];o(r(r([],e(i),!1),e(a),!1)),n.push(t)})};return o(t),n},Tr=function(t){for(var n,o,i=[],a=1;a<arguments.length;a++)i[a-1]=arguments[a];if(!i.length)return t;var l=i.shift();if(Bn(t)&&Bn(l))for(var c in l)Array.isArray(l[c])?t[c]=l[c].slice(0):Bn(l[c])?(t[c]||Object.assign(t,((n={})[c]={},n)),Tr(t[c],l[c])):Object.assign(t,((o={})[c]=l[c],o));return Tr.apply(void 0,r([t],e(i),!1))},Dr=function(e,t){var n=(Array.isArray(t)?t:t.split(".").filter(function(e){return e})).flatMap(function(e){return"string"==typeof e?e.split("."):e});n.slice(0,n.length-1).reduce(function(e,t){return e[t]=e[t]?e[t]:{}},e)},jr=function(t){var n=e(g(t),2),r=n[0],o=n[1],i=b(r),a=y(function(e){var t;t="function"==typeof e?e(i.current):e,i.current=t,o(t)},[]);return[i,a]},Or=Symbol("empty-value"),Fr=function(e){var t=b(Or);return t.current===Or&&(t.current=function(e){return"function"==typeof e?e():e}(e)),t.current},_r=function(e){var t=Fr(function(){return new lr});return w(function(){var n=void 0;return e&&(n=e.subscribe(t.next)),n},[e]),t},Br="one-resolve",Hr=function(e){return e},Wr=function(e,t,n){var r={};return e&&Ar(e).filter(function(e){return!n||!e.features||e.features.some(function(e){return n.includes(e)})}).filter(function(e){return e.type!==jn.Phony}).filter(function(e){return e.type!==jn.Button}).filter(function(e){return e.type!==jn.Icon}).forEach(function(e){if(_n(e)){if(Dr(r,e.name),"function"==typeof e.hidden?e.hidden(t):e.hidden)return;void 0===e.defaultValue?Wn(r,e.name,zn(r,e.name)||Pr(e.type)):"function"==typeof e.defaultValue?Wn(r,e.name,e.defaultValue(t)):Wn(r,e.name,e.defaultValue)}}),r},zr=function(r){var o=r.handler,i=r.fallback,l=r.fields,c=r.features,u=r.payload,s=r.change,d=r.loadStart,f=r.loadEnd,m=r.incomingTransform,p=void 0===m?Hr:m,h=e(jr(null),2),g=h[0],x=h[1],C=v(Pn),k=C.apiRef,S=C.changeSubject,L=C.reloadSubject,N=C.updateSubject,I=b(!0),M=b(!1),R=_r(S),P=_r(L),A=_r(N);w(function(){var e,r=function(){return t(void 0,void 0,void 0,function(){var e,t,r,a,m,h,v;return n(this,function(n){switch(n.label){case 0:return M.current?[2]:[3,1];case 1:if("function"!=typeof o)return[3,9];e=!0,d&&d(Br),n.label=2;case 2:return n.trys.push([2,6,7,8]),(t=o(u))instanceof Promise?(r=Tr,a=[{},Wr(l,u,c)],m=Hn,[4,t]):[3,4];case 3:return v=r.apply(void 0,a.concat([m.apply(void 0,[n.sent()])])),s(v,!0),I.current&&x(p(v,u)),[3,5];case 4:v=Tr({},Wr(l,u,c),Hn(t)),s(v,!0),I.current&&x(p(v,u)),n.label=5;case 5:return[3,8];case 6:if(h=n.sent(),e=!1,!i)throw h;return i(h),[3,8];case 7:return f&&f(e,Br),M.current=!0,[7];case 8:return[3,10];case 9:o&&!Vn(g.current,o)&&(v=Tr({},Wr(l,u,c),Hn(o)),I.current&&x(p(v,u))),n.label=10;case 10:return[2]}})})};r(),e={reload:r,change:function(e,t){void 0===t&&(t=!1),x(p(e,u)),s(e,t)},getData:function(){return a({},g.current||{})}},"function"==typeof k?k(e):k&&(k.current=e),P.unsubscribeAll(),P.subscribe(e.reload),R.unsubscribeAll(),R.subscribe(function(t){t&&t!==g.current&&e.change(t,!0)}),A.unsubscribeAll(),A.subscribe(function(t){t&&t!==g.current&&e.change(t,!1)})},[o]),E(function(){return function(){I.current=!1}},[]);var T=y(function(){return g.current},[]);return[g.current,x,T]},Vr=function(e){var t=b(e);return t.current=e,t},Yr=p(null),Ur=function(t){var n=t.children,r=l(t,["children"]),o=b({}),i=b(!1),c=r.fields,u=void 0===c?[]:c,s=r.features,d=r.change,m=void 0===d?function(){return null}:d,p=r.fallback,v=void 0===p?function(){return null}:p,g=r.handler,w=void 0===g?function(){return{}}:g,E=r.payload,x=r.loadStart,C=r.loadEnd,k=r.incomingTransform,S=e(zr({handler:w,fallback:v,fields:u,features:s,payload:E,change:m,loadStart:x,loadEnd:C,incomingTransform:k}),3),L=S[0],N=S[1],I=S[2],M=Vr(L),R=y(function(t,n){var r=o.current,a=M.current;N(t),Object.entries(n).forEach(function(t){var n=e(t,2),o=n[0],i=n[1];r[o]=i}),Object.values(r).some(function(e){return e})?i.current=!0:(t!==a||i.current)&&(i.current=!1,m(t,!1))},[]),P=y(function(e){return R(Hn(a(a({},M.current),e)),{})},[]),A=h(function(){return{object:L,setObject:R,changeObject:P,getObjectRef:I}},[L]);return f.createElement(Yr.Provider,{value:A},!!L&&n)},qr=function(){return v(Yr)},$r=function(){},Xr=function(e,t,n){void 0===t&&(t=[]),void 0===n&&(n=!1);var r=b(!0),o=b(n);return w(function(){return r.current?(r.current=!1,$r):o.current?$r:e()||$r},t),h(function(){return{resetWatcher:function(){r.current=!0},beginWatch:function(){r.current=!1,o.current=!1},stopWatch:function(){o.current=!0}}},[])},Gr=function(e){var t=Fr(function(){return new lr});return Xr(function(){t.next(e)},[e]),t},Kr=function(){return Y()},Qr=Kr(),Jr=function(t){void 0===t&&(t=0);var n=e(g(Qr),2),r=n[0],o=n[1],i=y(function(){return o(Kr())},[]);return w(function(){var e;return t&&(e=setTimeout(function(){e=void 0,i()},t)),function(){void 0!==e&&clearTimeout(e)}},[r,t,i]),{reloadTrigger:r,doReload:i}},Zr=function(o){var i=o.reloadSubject,a=o.loading,l=o.disabled,c=o.children,u=o.fallback,s=o.Loader,d=void 0===s?function(){return null}:s,m=o.Error,p=void 0===m?function(){return null}:m,h=o.onLoadStart,v=o.onLoadEnd,y=o.payload,x=o.deps,C=void 0===x?[]:x,k=o.throwError,S=void 0!==k&&k,L=e(g(""),2),N=L[0],I=L[1],M=e(g(l),2),R=M[0],P=M[1],A=Gr(l);w(function(){return A.subscribe(function(e){e||P(!1)})},[]);var T=Jr(),D=T.reloadTrigger,j=T.doReload,O=_r(i);w(function(){return O.subscribe(function(){j()})},[]);var F=b(null),_=e(g(!1),2),B=_[0],H=_[1],W=e(g(!1),2),z=W[0],Y=W[1],U=b(!0),q=a||B;return E(function(){return function(){U.current=!1}},[]),w(function(){if(!R){F.current&&F.current.cancel();var e=Gn(function(){return t(void 0,void 0,void 0,function(){var e,t,r;return n(this,function(n){switch(n.label){case 0:e=!0,h&&h(),n.label=1;case 1:return n.trys.push([1,5,6,7]),(t=c(y))instanceof Promise?[4,t]:[3,3];case 2:return[2,n.sent()||null];case 3:return[2,t||null];case 4:return[3,7];case 5:throw r=n.sent(),e=!1,r;case 6:return v&&v(e),[7];case 7:return[2]}})})});F.current=e;t(void 0,void 0,void 0,function(){var t,r,o;return n(this,function(n){switch(n.label){case 0:t=!1,U.current&&H(!0),U.current&&Y(!1),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,e()];case 2:return(r=n.sent())===Xn?(t=!0,[2]):(F.current=null,U.current&&queueMicrotask(function(){return V(function(){I(r)})}),[3,5]);case 3:if(o=n.sent(),U.current&&Y(!0),S)throw o;return u&&u(o),[3,5];case 4:return t||U.current&&H(!1),[7];case 5:return[2]}})})}},r(r([y,R],e(C),!1),[D],!1)),q?f.createElement(d,{payload:y}):z?f.createElement(p,{payload:y}):f.createElement(f.Fragment,null,N)},eo=function(){function e(e){var t=this;this.target=e,this._status="pending",e.then(function(){return t._status="fulfilled"}),e.catch(function(){return t._status="rejected"})}return Object.defineProperty(e.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),e}(),to=function(t){var n=void 0,o=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return"pending"!==(null==n?void 0:n.status)&&(n=new eo(t.apply(void 0,r([],e(o),!1)))),null==n?void 0:n.target};return o.clear=function(){n=void 0},o.getStatus=function(){return(null==n?void 0:n.status)||"ready"},o},no=function(t,n){void 0===n&&(n=[]);var o=b(t);return o.current=t,y(function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return o.current.apply(o,r([],e(t),!1))},n)},ro=function(r,o){var i=void 0===o?{}:o,a=i.onLoadStart,l=i.onLoadEnd,c=i.fallback,u=i.throwError,s=e(g(!1),2),d=s[0],f=s[1],m=e(g(!1),2),p=m[0],v=m[1],y=b(!0),w=no(r);E(function(){return function(){y.current=!1}},[]);var x=h(function(){return to(function(e){return t(void 0,void 0,void 0,function(){var r,o,i;return n(this,function(s){switch(s.label){case 0:r=function(){return t(void 0,void 0,void 0,function(){var t,r,o;return n(this,function(n){switch(n.label){case 0:t=!0,a&&a(),n.label=1;case 1:return n.trys.push([1,5,6,7]),(r=w(e))instanceof Promise?[4,r]:[3,3];case 2:return[2,n.sent()||null];case 3:return[2,r||null];case 4:return[3,7];case 5:throw o=n.sent(),t=!1,o;case 6:return l&&l(t),[7];case 7:return[2]}})})},y.current&&f(!0),y.current&&v(!1),o=!1,s.label=1;case 1:return s.trys.push([1,3,4,5]),[4,r()];case 2:return[2,s.sent()];case 3:if(i=s.sent(),y.current&&v(!0),u)throw i;return c&&c(i),[3,5];case 4:return o||y.current&&f(!1),[7];case 5:return[2,null]}})})})},[]);return{loading:d,error:p,execute:x}},oo=function(e){var t=Fr(e),n=b(t),r=y(function(e){var t;t="function"==typeof e?e(n.current):e,n.current=t},[]);return[n,r]},io={name:"",menu:function(){return null},menuItems:[],onValueChange:function(){return null}},ao=Tn()({container:{position:"relative",display:"flex",alignItems:"stretch",justifyContent:"stretch",maxHeight:"45vh",overflowY:"auto",overflowX:"hidden"},content:{flex:1,display:"flex",flexDirection:"column",justifyContent:"stretch"},loader:{position:"absolute",top:0,left:0,right:0,bottom:0,height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center"}}),lo=function(r){var o=r.requestSubject,i=ao().classes,c=e(g(null),2),u=c[0],s=c[1],d=e(g(0),2),m=d[0],p=d[1],v=e(oo(io),2),b=v[0],E=v[1],x=e(oo(0),2),C=x[0],k=x[1],S=qr(),L=S.object,N=S.changeObject,I=Mr(),M=y(function(){p(function(e){return e+1})},[]),R=y(function(){p(function(e){return Math.max(e-1,0)})},[]),P=ro(function(e){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,b.current.menu(b.current.name,e,A.current,I,b.current.onValueChange,N)];case 1:return t.sent(),s(null),[2]}})})},{onLoadStart:M,onLoadEnd:R}).execute,A=Vr(L),T=h(function(){return b.current.menuItems.map(function(e){var t=e.isDisabled,n=void 0===t?function(){return!1}:t,r=e.isVisible,o=void 0===r?function(){return!0}:r,i=l(e,["isDisabled","isVisible"]);return a(a({},i),{isDisabled:function(){return n(A.current,I)},isVisible:function(){return o(A.current,I)}})})},[b.current.menuItems]),D=Vr(T);return w(function(){return o.subscribe(Kn(function(e){return t(void 0,[e],void 0,function(e){var t,r=e.event,o=e.menuItems,i=e.menu,a=e.name,l=e.onValueChange;return n(this,function(e){switch(e.label){case 0:return[4,$n(350)];case 1:return e.sent(),k(function(e){return e+1}),E({name:a,menuItems:o,onValueChange:l,menu:i}),t=document.elementFromPoint(r.clientX,r.clientY),s(t||r.target),[2]}})})}))},[]),f.createElement(W,{key:C.current,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},anchorEl:u,open:!!u,onClose:function(){return s(null)},MenuListProps:{disablePadding:!0}},f.createElement("div",{className:i.container},0!==m&&f.createElement("div",{className:i.loader},f.createElement(O,{size:14})),f.createElement("div",{className:i.content},D.current.map(function(e,r){var o=e.label,i=void 0===o?"unknown-label":o,a=e.action,l=void 0===a?"unknown-action":a,c=e.divider,u=e.onClick,d=e.icon,m=e.isDisabled,p=void 0===m?function(){return!1}:m,h=e.isVisible,v=void 0===h?function(){return!0}:h;return f.createElement(Zr,{Loader:function(){return c?null:f.createElement(B,{sx:{visibility:"hidden",minWidth:225}},!!d&&f.createElement(F,null,f.createElement(d,null)),f.createElement(_,{variant:"inherit"},i))},onLoadStart:M,onLoadEnd:R,key:"".concat(C.current,"-").concat(r),payload:I},function(e){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return[4,$n(0)];case 1:return n.sent(),[4,p(e)];case 2:return t=n.sent(),[4,v(e)];case 3:return n.sent()?c?[2,f.createElement(H,{orientation:"horizontal"})]:[2,f.createElement(B,{disabled:t,onClick:function(){if(u)return u(A.current,e,b.current.onValueChange,N),void s(null);P(l)},sx:{minWidth:225}},!!d&&f.createElement(F,null,f.createElement(d,null)),f.createElement(_,{variant:"inherit"},i))]:[2,null]}})})})}))))},co=p(null),uo=function(e){var r=e.children,o=_r(),i=h(function(){return{createContextMenu:function(e){var r=e.menuItems,i=void 0===r?[]:r,a=e.onValueChange,l=void 0===a?function(){return null}:a,c=e.menu,u=e.name;return function(e){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return i?(e.preventDefault(),e.stopPropagation(),(null==i?void 0:i.length)?[4,o.next({name:u,menu:c,event:e,menuItems:i,onValueChange:l})]:[2]):[2];case 1:return[2,t.sent()]}})})}},requestSubject:o}},[]);return f.createElement(co.Provider,{value:i},r,f.createElement(lo,{requestSubject:o}))},so=function(){return v(co)};var fo=function(t){var n=!1,o=null,i=function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];return n||(n=!0,o=t.apply(void 0,r([],e(i),!1))),o};return i.clear=function(){n=!1},i},mo=function(){return!0},po=function(e,t){var n=e.compute,r=e.type,o=e.readTransform,i=e.name,a=e.object,l=e.payload,c=e.config;if(n&&c.WITH_SYNC_COMPUTE){var u=t?n(a,l):Pr(r);return!(u instanceof Promise)&&u}return!(n||!i)&&(o(zn(a,i),i,a,l)||Pr(r))},ho=function(o,i){var a=void 0===i?{}:i,l=a.allowedErrors,u=a.fallback,s=a.defaultValue,d=void 0===s?null:s;return function(){for(var i,a,s=[],f=0;f<arguments.length;f++)s[f]=arguments[f];try{var m=o.apply(void 0,r([],e(s),!1));return m instanceof Promise?function(e,r){return t(void 0,[e,r],void 0,function(e,t){var r,o=t.fallback,i=t.defaultValue;return n(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,e];case 1:return[2,t.sent()];case 2:return r=t.sent(),o&&o(r),[2,i];case 3:return[2]}})})}(m,{fallback:u,defaultValue:d}):m}catch(e){if(u&&u(e),l){try{for(var p=c(l),h=p.next();!h.done;h=p.next()){if(e instanceof h.value)return d}}catch(e){i={error:e}}finally{try{h&&!h.done&&(a=p.return)&&a.call(p)}finally{if(i)throw i.error}}throw e}return d}}},vo=function(){return!1},go=function(){return!0},bo=function(){return null},yo=function(){return null},wo=function(){return!1},Eo=function(e,t,n){var r="".concat(t,"(").concat(e||"unknown",")");return function(e){console.error("react-declarative ".concat(r," ").concat(n," exception"),e)}},xo=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=[];return t.forEach(function(t){if(t)if("string"==typeof t)o.push(t);else if(Array.isArray(t)){if(t.length){var n=xo.apply(void 0,r([],e(t),!1));n&&o.push(n)}}else"object"==typeof t&&(t.toString!==Object.prototype.toString?o.push(t.toString()):Object.entries(t).filter(function(t){var n=e(t,2);return n[0],!!n[1]}).forEach(function(t){var n=e(t,1)[0];return o.push(n)}))}),o.join(" ")},Co="12",ko=function(e){return Number(e)},So=Tn()({root:{position:"relative",display:"flex",alignItems:"stretch",justifyContent:"stretch"},container:{flex:1,display:"flex",alignItems:"stretch",justifyContent:"stretch",width:"100%","& > *":{flex:1}}}),Lo=function(e,t){var n=e.className,r=e.style,o=e.sx,i=e.columns,c=void 0===i?"":i,u=e.phoneColumns,s=void 0===u?"":u,d=e.tabletColumns,m=void 0===d?"":d,p=e.desktopColumns,v=void 0===p?"":p,g=e.fieldRightMargin,b=void 0===g?"1":g,y=e.fieldBottomMargin,w=void 0===y?"2":y,E=e.children,x=e.onClick,C=e.onFocus,k=e.onContextMenu,S=l(e,["className","style","sx","columns","phoneColumns","tabletColumns","desktopColumns","fieldRightMargin","fieldBottomMargin","children","onClick","onFocus","onContextMenu"]),L=So().classes,N=h(function(){return{xs:ko(s||c||Co),sm:ko(m||c||Co),md:ko(m||c||Co),lg:ko(v||c||Co),xl:ko(v||c||Co),mr:ko(b),mb:ko(w)}},[]),I=N.xs,M=N.sm,R=N.md,P=N.lg,A=N.xl,T=N.mr,D=N.mb;return f.createElement(U,a({},S,{ref:t,item:!0,className:xo(n,L.root),style:r,onFocus:C,onClick:x,xs:I,sm:M,md:R,lg:P,xl:A,sx:o,onContextMenu:k}),f.createElement(j,{className:L.container,mr:T,mb:D},E))};Lo.displayName="Item";var No=x(Lo),Io=function(e,t){var n=e.className,r=e.style,o=e.children,i=e.onFocus,c=e.onClick,u=e.isBaselineAlign,s=e.columnsOverride,d=e.sx,m=e.onContextMenu,p=l(e,["className","style","children","onFocus","onClick","isBaselineAlign","columnsOverride","sx","onContextMenu"]),v=h(function(){return s&&Number(s)},[]);return f.createElement(q,a({},p,{ref:t,container:!0,alignItems:u?"flex-end":"flex-start",className:n,style:r,onClick:c,onFocus:i,columns:v,onContextMenu:m,sx:d}),o)};Io.displayName="Container";var Mo=x(Io),Ro=Tn()({root:{position:"relative","& > *":{width:"100%"}}}),Po=function(e,t){var n=e.className,r=void 0===n?"":n,o=e.columns,i=void 0===o?"":o,c=e.phoneColumns,u=void 0===c?"":c,s=e.tabletColumns,d=void 0===s?"":s,m=e.desktopColumns,p=void 0===m?"":m,h=e.children,v=e.isItem,g=e.isBaselineAlign,b=e.style,y=e.columnsOverride,w=e.sx,E=e.fieldRightMargin,x=void 0===E?"1":E,C=e.fieldBottomMargin,k=void 0===C?"2":C,S=e.onClick,L=e.onFocus,N=e.onContextMenu,I=l(e,["className","columns","phoneColumns","tabletColumns","desktopColumns","children","isItem","isBaselineAlign","style","columnsOverride","sx","fieldRightMargin","fieldBottomMargin","onClick","onFocus","onContextMenu"]),M=Ro().classes;return v?f.createElement(No,a({},I,{ref:t,className:xo(M.root,r),style:b,columns:i,phoneColumns:u,tabletColumns:d,desktopColumns:p,fieldRightMargin:x,fieldBottomMargin:k,onFocus:L,onClick:S,onContextMenu:N,sx:w}),h):f.createElement(Mo,a({},I,{ref:t,className:xo(M.root,r),isBaselineAlign:g,columnsOverride:y,style:b,onFocus:L,onContextMenu:N,onClick:S,sx:w}),h)};Po.displayName="Group";var Ao=x(Po),To=function(t){if(t){if(t.includes(".")){var n=t.split(".");t=e(n.reverse(),1)[0]}var o=e(t.split("_")),i=o[0],a=o.slice(1);return r(["".concat(i.charAt(0).toUpperCase()).concat(i.slice(1))],e(a),!1).join(" ")}},Do={WITH_DIRTY_CLICK_LISTENER:!0,WITH_MOBILE_READONLY_FALLBACK:!0,WITH_WAIT_FOR_MOVE_LISTENER:!0,WITH_WAIT_FOR_TAB_LISTENER:!0,WITH_WAIT_FOR_TOUCH_LISTENER:!0,WITH_DISMOUNT_LISTENER:!0,WITH_SYNC_COMPUTE:!1,CUSTOM_FIELD_DEBOUNCE:800,FIELD_BLUR_DEBOUNCE:100},jo=function(){var e=this;this._config=Do,this.getRef=function(){return e._config},this.setValue=function(t){Object.assign(e._config,Do,t)}},Oo=Symbol("get-reference"),Fo=function(){function e(){}var t;return t=Oo,e.instance=new jo,e[t]=e.instance.getRef,e.setValue=e.instance.setValue,e}(),_o={display:"flex",alignItems:"stretch",justifyContent:"stretch"},Bo=Tn()(function(e){var t,n,r;return{root:a(a({},_o),{"& > *":a(a({},_o),{flexGrow:1}),"& > * > *":{flexGrow:1},pointerEvents:"all"}),hidden:{display:"none !important"},fieldReadonly:{"& > *":{pointerEvents:"none !important"}},phoneHidden:(t={},t[e.breakpoints.only("xs")]={display:"none !important"},t),tabletHidden:(n={},n[e.breakpoints.between("sm","lg")]={display:"none !important"},n),desktopHidden:(r={},r[e.breakpoints.up("lg")]={display:"none !important"},r)}}),Ho=function(e){return console.log({v:e})},Wo=function(){return null},zo=function(){return null},Vo=function(e){return e},Yo=function(){},Uo=function(){return null},qo=function(){return null},$o=function(e){return e},Xo=function(e){return e};function Go(o,i){var c=this;void 0===i&&(i={withApplyQueue:!1,skipDirtyClickListener:!1,skipClickListener:!1,skipFocusReadonly:!1,skipFocusBlurCall:!1,skipDebounce:!1,defaultProps:{}});var u=C(o),s=Fo[Oo](),d=function(d){var m,p,v,b,x,C,k,S=d.className,L=void 0===S?"":S,N=d.sx,I=d.columns,M=void 0===I?"":I,R=d.phoneColumns,P=void 0===R?"":R,A=d.tabletColumns,T=void 0===A?"":A,D=d.desktopColumns,j=void 0===D?"":D,O=d.phoneHidden,F=void 0!==O&&O,_=d.tabletHidden,B=void 0!==_&&_,H=d.desktopHidden,W=void 0!==H&&H,z=d.isDisabled,V=d.isVisible,Y=d.isInvalid,U=d.isIncorrect,q=d.isReadonly,$=d.readTransform,X=void 0===$?$o:$,G=d.writeTransform,K=void 0===G?Xo:G,Q=d.change,J=void 0===Q?Ho:Q,Z=d.fallback,ee=void 0===Z?Wo:Z,te=d.ready,ne=void 0===te?zo:te,re=d.compute,oe=d.shouldRecompute,ie=d.click,ae=void 0===ie?Yo:ie,le=d.map,ce=void 0===le?Vo:le,ue=d.object,se=d.name,de=void 0===se?"":se,fe=d.title,me=void 0===fe?To(de)||void 0:fe,pe=d.menu,he=void 0===pe?qo:pe,ve=d.type,ge=d.debug,be=d.focus,ye=d.blur,we=d.invalidity,Ee=d.prefix,xe=d.dirty,Ce=void 0!==xe&&xe,ke=d.disabled,Se=void 0!==ke&&ke,Le=d.readonly,Ne=void 0!==Le&&Le,Ie=d.autoFocus,Me=d.style,Re=d.menuItems,Pe=d.groupRef,Ae=void 0===Pe?Uo:Pe,Te=d.fieldRightMargin,De=void 0===Te?null===(p=i.defaultProps)||void 0===p?void 0:p.fieldRightMargin:Te,je=d.fieldBottomMargin,Oe=void 0===je?null===(v=i.defaultProps)||void 0===v?void 0:v.fieldBottomMargin:je,Fe=d.outlinePaper,_e=void 0!==Fe&&Fe,Be=d.transparentPaper,He=void 0!==Be&&Be,We=d.testId,ze=void 0===We?de:We,Ve=l(d,["className","sx","columns","phoneColumns","tabletColumns","desktopColumns","phoneHidden","tabletHidden","desktopHidden","isDisabled","isVisible","isInvalid","isIncorrect","isReadonly","readTransform","writeTransform","change","fallback","ready","compute","shouldRecompute","click","map","object","name","title","menu","type","debug","focus","blur","invalidity","prefix","dirty","disabled","readonly","autoFocus","style","menuItems","groupRef","fieldRightMargin","fieldBottomMargin","outlinePaper","transparentPaper","testId"]),Ye=qr(),Ue=Ye.object,qe=Ye.changeObject,$e=Ye.getObjectRef,Xe=Mr(),Ge=so().createContextMenu,Ke=function(e){var t=e.prefix,n=e.name,r=e.isDisabled,o=void 0===r?vo:r,i=e.isVisible,a=void 0===i?go:i,l=e.isInvalid,c=void 0===l?bo:l,u=e.isIncorrect,s=void 0===u?yo:u,d=e.isReadonly,f=void 0===d?wo:d;return h(function(){return{isDisabled:ho(o,{defaultValue:!1,fallback:Eo(n,t,"isDisabled")}),isVisible:ho(a,{defaultValue:!1,fallback:Eo(n,t,"isVisible")}),isInvalid:ho(c,{defaultValue:null,fallback:Eo(n,t,"isInvalid")}),isIncorrect:ho(s,{defaultValue:null,fallback:Eo(n,t,"isIncorrect")}),isReadonly:ho(f,{defaultValue:!1,fallback:Eo(n,t,"isReadonly")})}},[])}({prefix:Ee,name:de,isDisabled:z,isVisible:V,isInvalid:Y,isIncorrect:U,isReadonly:q}),Qe=Ke.isDisabled,Je=Ke.isVisible,Ze=Ke.isInvalid,et=Ke.isIncorrect,tt=Ke.isReadonly,nt=Ue||ue,rt=Bo().classes,ot=function(e){var t=e.compute,n=e.shouldRecompute,r=void 0===n?mo:n;return h(function(){var e=null;if(t){var n=fo(t);return function(t,o){return e&&r(e,t,o)&&n.clear(),e=t,n(t,o)}}},[])}({compute:re,shouldRecompute:oe}),it=function(t,n){var r=e(g(function(){var e=function(e){var t=e.phoneHidden,n=e.tabletHidden,r=e.desktopHidden,o=e.isReadonly,i=e.isInvalid,a=e.isDisabled,l=e.isVisible,c=e.isIncorrect,u=e.object,s=e.payload;return{phoneHidden:"function"==typeof t?t(s):t,tabletHidden:"function"==typeof n?n(s):n,desktopHidden:"function"==typeof r?r(s):r,fieldReadonly:o(u,s),invalid:i(u,s),visible:l(u,s),incorrect:c(u,s),disabled:a(u,s)}}(n);return a(a(a({groupRef:null,focusReadonly:!0,loading:!1},e),{value:po(n,e.visible)}),t)}),2),o=r[0],i=r[1];return{state:o,action:h(function(){return{setGroupRef:function(e){return i(function(t){return a(a({},t),{groupRef:e})})},setFocusReadonly:function(e){return i(function(t){return a(a({},t),{focusReadonly:e})})},setFieldReadonly:function(e){return i(function(t){return a(a({},t),{fieldReadonly:e})})},setDisabled:function(e){return i(function(t){return a(a({},t),{disabled:e})})},setInvalid:function(e){return i(function(t){return a(a({},t),{invalid:e})})},setIncorrect:function(e){return i(function(t){return a(a({},t),{incorrect:e})})},setVisible:function(e){return i(function(t){return a(a({},t),{visible:e})})},setLoading:function(e){return i(function(t){return a(a({},t),{loading:e})})},setDirty:function(e){return i(function(t){return a(a({},t),{dirty:e})})},setValue:function(e){return i(function(t){return a(a({},t),{value:e})})}}},[])}}({dirty:Ce},{compute:ot,type:ve,readTransform:X,config:s,name:de,object:nt,payload:Xe,isVisible:Je,isDisabled:Qe,isInvalid:Ze,isIncorrect:et,isReadonly:tt,phoneHidden:F,tabletHidden:B,desktopHidden:W}),at=it.state,lt=at.phoneHidden,ct=at.tabletHidden,ut=at.desktopHidden,st=at.dirty,dt=at.disabled,ft=at.fieldReadonly,mt=at.focusReadonly,pt=at.groupRef,ht=at.invalid,vt=at.incorrect,gt=at.loading,bt=at.value,yt=at.visible,wt=it.action,Et=wt.setDirty,xt=wt.setDisabled,Ct=wt.setFieldReadonly,kt=wt.setFocusReadonly,St=wt.setGroupRef,Lt=wt.setInvalid,Nt=wt.setIncorrect,It=wt.setLoading,Mt=wt.setValue,Rt=wt.setVisible,Pt=(x=s,C=Sr(),k=x.CUSTOM_FIELD_DEBOUNCE,C||k),At=e(function(t,n){var r=e(g(function(){return{value:t}}),2),o=r[0],i=r[1],a=h(function(){return Zn(function(e){return i({value:e})},n)},[]);return w(function(){return function(){return a.clear()}},[]),[o,a,a]}(bt,i.skipDebounce?0:Pt),3),Tt=At[0],Dt=At[1],jt=At[2],Ot=jt.pending,Ft=jt.flush,_t=function(e){var t=e.prefix,n=e.name,r=e.clickDisabled,o=e.lastObject,i=e.debouncedValue$,a=e.fieldReadonly$,l=e.focusReadonly$,c=e.invalid$,u=e.upperReadonly$,s=e.value$,d=e.groupRef$,f=h(function(){return{inputUpdate:!1,objectUpdate:!1,initComplete:!1,fieldName:"".concat(t,"(").concat(n||"unknown",")"),lastObject:o,isMounted:!0,clickDisabled:!1,debouncedValue$:null,fieldReadonly$:null,focusReadonly$:null,invalid$:null,upperReadonly$:null,value$:null,groupRef$:null}},[]);return f.debouncedValue$=i,f.fieldReadonly$=a,f.focusReadonly$=l,f.invalid$=c,f.upperReadonly$=u,f.value$=s,f.groupRef$=d,f.clickDisabled=r,{memory:f}}({prefix:Ee,name:de,clickDisabled:Se||dt,lastObject:null,debouncedValue$:Tt.value,fieldReadonly$:ft,focusReadonly$:mt,invalid$:ht,upperReadonly$:Ne,groupRef$:pt,value$:bt}).memory,Bt=no(function(e){Mt(e),Dt(e),_t.initComplete=!0},[]);s.WITH_DISMOUNT_LISTENER&&E(function(){return function(){_t.isMounted=!1}},[]),s.WITH_WAIT_FOR_MOVE_LISTENER&&w(function(){return yr(function(){Ot()&&Ft()})},[]),s.WITH_WAIT_FOR_TAB_LISTENER&&w(function(){return e=function(){Ot()&&Ft()},wr.connect(e);var e},[]),s.WITH_WAIT_FOR_TOUCH_LISTENER&&w(function(){return e=function(){Ot()&&Ft()},Er.connect(e);var e},[]);var Ht=y(function(){var e,t=$e(),n=_t.invalid$,r=_t.value$,o=!!n;if(_t.objectUpdate=!0,_t.inputUpdate=!1,ot){var i=Je(t,Xe),a=!!i&&ot(t,Xe);a instanceof Promise?(It(!0),a.then(function(e){return _t.isMounted&&Bt(e)}).catch(function(e){return _t.isMounted&&ee(e)}).finally(function(){return _t.isMounted&&It(!1)})):Bt(a);var l=Qe(t,Xe),c=tt(t,Xe),u=Ze(t,Xe)||null,s=et(t,Xe)||null;Ct(c),Lt(u),Nt(s),xt(l),Rt(i)}else if(de){var d=Qe(t,Xe),f=Je(t,Xe),m=Ze(t,Xe)||null,p=et(t,Xe)||null,h=(c=tt(t,Xe),X(zn(t,de),de,t,Xe)),v=h!==r;(v=v&&!o)&&(_t.inputUpdate=!0,Bt(h),Lt(m),null!==m&&we(de,m,Xe),J(t,((e={})[_t.fieldName]=!!m,e))),Ct(c),Nt(p),xt(d),Rt(f)}else{var g=Qe(t,Xe),b=Je(t,Xe),c=tt(t,Xe);Ct(c),xt(g),Rt(b)}ne()},[nt]),Wt=y(function(){var e,t,n=$e(),r=_t.debouncedValue$,o=!!_t.invalid$;if(_t.inputUpdate)_t.inputUpdate=!1;else if(_t.objectUpdate)_t.objectUpdate=!1;else{if(ot)return;var a=Hn(n),l=Wn(a,de,K(r,de,n,Xe)),c=Ze(a,Xe)||null,u=et(a,Xe)||null;if(Lt(c),Nt(u),Et(!0),!de)return;if(!l)throw new Error('One error invalid name specified "'.concat(de,'"'));null!==c?(we(de,c,Xe),J(a,((e={})[_t.fieldName]=!!c,e))):Vn(n,a)&&!o||J(i.skipDebounce?ce(a,Xe):a,((t={})[_t.fieldName]=!!c,t))}},[]),zt=y(function(){var e,t;if(_t.initComplete&&!_t.inputUpdate){var n=$e(),r=_t.invalid$,o=_t.value$,a=Hn(n);Wn(a,de,K(o,de,n,Xe));var l=Ze(a,Xe)||null,c=et(a,Xe)||null;!l&&r&&(Lt(l),J(i.skipDebounce?ce(a,Xe):a,((e={})[_t.fieldName]=!!l,e))),l&&!r&&(Lt(l),J(n,((t={})[_t.fieldName]=!!l,t))),Nt(c)}},[]);w(function(){Ot()?Ft():(_t.lastObject!==nt&&(Ht(),zt()),Wt(),_t.lastObject=nt)},[Tt,nt]),s.WITH_MOBILE_READONLY_FALLBACK&&w(function(){var e=function(){return kt(!1)};return pt&&pt.addEventListener("touchstart",e,{passive:!1}),function(){return pt&&pt.removeEventListener("touchstart",e)}},[pt]),s.WITH_DIRTY_CLICK_LISTENER&&w(function(){if(!i.skipDirtyClickListener){var e=function(){return Et(!0)};return pt&&pt.addEventListener("click",e,{passive:!0}),function(){return pt&&pt.removeEventListener("click",e)}}},[pt]);var Vt=y(function(){return t(c,void 0,void 0,function(){var e;return n(this,function(t){for(e=0;60!==e&&(_t.inputUpdate||_t.objectUpdate);e++)$n(10);return _t.inputUpdate=!1,_t.objectUpdate=!1,[2]})})},[]),Yt=h(function(){return Gn(function(){return t(c,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,Vt()];case 1:return e.sent(),[2,!0]}})})})},[]),Ut=h(function(){return Kn(function(o){for(var a=[],l=1;l<arguments.length;l++)a[l-1]=arguments[l];return t(c,r([o],e(a),!1),void 0,function(e,t){return void 0===t&&(t={}),n(this,function(n){switch(n.label){case 0:return i.withApplyQueue?[4,Yt().then(function(n){n!==Xn&&qt(e,t)})]:[3,2];case 1:return n.sent(),[2];case 2:return[2,qt(e,t)]}})})})},[]),qt=y(function(e,t){var n=(void 0===t?{}:t).skipReadonly,r=_t.fieldReadonly$,o=_t.upperReadonly$;_t.inputUpdate||_t.objectUpdate||_t.isMounted&&(r&&!n||o&&!n||ot&&!n||Bt(e))},[]),$t=y(function(e){e&&St(e),Ae(e)},[]),Xt=y(function(){var e=$e(),t=_t.fieldReadonly$,n=_t.upperReadonly$,r=_t.groupRef$;_t.isMounted&&(t||n||kt(!1),i.skipFocusBlurCall||(r&&function(e,t){return void 0===t&&(t=50),new Promise(function(n){var r=setInterval(function(){var t=document.activeElement!==e&&!e.contains(document.activeElement);(t=t||!document.body.contains(e))&&(clearInterval(r),n())},t)})}(r,s.FIELD_BLUR_DEBOUNCE).then(function(){Ot()&&Ft(),ye&&ye(de,e,Xe,function(e){return tn.onChange(e,{skipReadonly:!0})},qe),kt(!0)}),be&&be(de,e,Xe,function(e){return tn.onChange(e,{skipReadonly:!0})},qe)))},[]),Gt=h(function(){return Re?Ge({name:de,menu:he,menuItems:Re,onValueChange:function(e){return tn.onChange(e,{skipReadonly:!0})}}):void 0},[]),Kt=y(function(e){return t(c,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return _t.clickDisabled?[2]:(t=$e(),[4,ae(de,e,t,Xe,function(e){return tn.onChange(e,{skipReadonly:!0})},qe)]);case 1:return n.sent(),[2]}})})},[]),Qt=y(function(e){return t(c,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return i.skipClickListener?[2]:[4,Kt(e)];case 1:return[2,t.sent()]}})})},[]),Jt=a(a({},i.defaultProps),{columns:M,phoneColumns:P,tabletColumns:T,desktopColumns:j,fieldRightMargin:De,fieldBottomMargin:Oe,sx:a(a({},N),null===(b=i.defaultProps)||void 0===b?void 0:b.sx)}),Zt=y(function(){var e=_t.fieldReadonly$,t=_t.upperReadonly$,n=_t.focusReadonly$,r=!1;return r=r||t,i.skipFocusReadonly||(r=r||n),r=(r=r||e)||!!ot},[]),en=y(function(){var e=_t.fieldReadonly$,t=_t.upperReadonly$,n=!1;return n=(n=(n=n||t)||e)||!!ot},[]),tn=a(a({onChange:i.withApplyQueue?Ut:qt,click:Kt,fallback:ee,disabled:Se||dt,readonly:Zt(),dirty:st||Ce,autoFocus:Ie,invalid:ht,incorrect:vt,value:bt,name:de,loading:gt,object:nt,prefix:Ee,outlinePaper:_e,transparentPaper:He,withContextMenu:!!(null==Re?void 0:Re.length)||void 0},Ve),{fieldReadonly:en()});ge&&ge({managedProps:tn,originalComponent:o,payload:Xe});var nn=((m={})[rt.hidden]=!yt,m[rt.fieldReadonly]=ft,m[rt.phoneHidden]=lt,m[rt.tabletHidden]=ct,m[rt.desktopHidden]=ut,m),rn=a(a(a({},i.defaultProps),tn),me&&{title:me});return yt?f.createElement(Ao,a({ref:$t,"data-testid":ze,"data-path":_t.fieldName,isItem:!0,style:Me,className:xo(L,rt.root,nn)},Jt,{onFocus:Xt,onContextMenu:Gt,onClick:Qt}),f.createElement(u,a({},rn))):null};return d.displayName="Managed".concat(o.displayName||"UnknownField"),C(d)}var Ko={},Qo=p(Ko),Jo=function(e){var t=e.context,n=void 0===t?Ko:t,r=e.children;return f.createElement(Qo.Provider,{value:n},r)},Zo=function(){return v(Qo)||Ko},ei=p(null),ti=[],ni=function(e){var t=e.children,n=e.features,r=void 0===n?ti:n;return f.createElement(ei.Provider,{value:r},t)},ri=function(){return v(ei)},oi=["dirty","fallback","readonly","invalid","loading","object","onChange","prefix","value"],ii=Tn()({root:{display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *":{flex:1}},disabled:{pointerEvents:"none",opacity:.5},readonly:{pointerEvents:"none"}}),ai=function(e){var t=e.Element,n=l(e,["Element"]),r=Zo();return f.createElement(t,a({},n,{context:r}))},li=function(t){var n,r=t.disabled,o=t.invalid,i=t.incorrect,c=t.readonly,u=t.value,s=t.watchOneContext,d=t.element,m=void 0===d?function(){return f.createElement(k,null)}:d,p=t.outlinePaper,v=t.transparentPaper,g=t.object,b=t.onChange,y=t.click,w=l(t,["disabled","invalid","incorrect","readonly","value","watchOneContext","element","outlinePaper","transparentPaper","object","onChange","click"]),E=ii().classes,x=qr().changeObject,C=Mr(),S=ri(),L=h(function(){var t=Object.entries(w).filter(function(t){var n=e(t,1)[0];return!oi.includes(n)}).reduce(function(t,n){var r,o=e(n,2),i=o[0],l=o[1];return a(a({},t),((r={})[i]=l,r))},{});return a(a({},g),{onChange:x,onValueChange:b,onClick:y,_fieldParams:t,_fieldData:g,outlinePaper:p,transparentPaper:v,invalid:o,incorrect:i,payload:C,disabled:r,readonly:c,features:S})},[g,r,o,i,c]);return f.createElement(j,{className:xo(E.root,(n={},n[E.disabled]=r,n[E.readonly]=c,n))},s?f.createElement(ai,a({},L,{value:u,Element:m})):f.createElement(m,a({},L,{value:u,context:Ko})))};li.displayName="ComponentField";var ci=Go(li,{defaultProps:{fieldRightMargin:"0",fieldBottomMargin:"0"},withApplyQueue:!0,skipDirtyClickListener:!0,skipFocusReadonly:!0,skipFocusBlurCall:!0,skipDebounce:!1}),ui=function(e){var t=e.loading,n=e.children;return f.createElement(we,{direction:"row",alignItems:"center",spacing:1},!!t&&f.createElement(j,{display:"flex",alignItems:"center"},f.createElement(O,{size:"16px",color:"inherit"})),f.createElement(j,null,n))},si=function(r){var o=r.Progress,i=void 0===o?ui:o,c=r.onClick,u=void 0===c?function(){}:c,s=r.onLoadStart,d=r.onLoadEnd,m=r.fallback,p=r.children,h=r.disabled,v=r.throwError,y=void 0!==v&&v,w=r.variant,x=void 0===w?"outlined":w,C=l(r,["Progress","onClick","onLoadStart","onLoadEnd","fallback","children","disabled","throwError","variant"]),k=e(g(0),2),S=k[0],L=k[1],N=b(!0);E(function(){return function(){N.current=!1}},[]);var I=Vr(S);return f.createElement(ye,a({},C,{onClick:function(e){return t(void 0,void 0,void 0,function(){var t,r;return n(this,function(n){switch(n.label){case 0:if(I.current)return[2];t=!0,n.label=1;case 1:return n.trys.push([1,3,4,5]),s&&s(),N.current&&L(function(e){return e+1}),[4,u(e)];case 2:return n.sent(),[3,5];case 3:if(r=n.sent(),t=!1,y)throw r;return m&&m(r),[3,5];case 4:return d&&d(t),N.current&&L(function(e){return e-1}),[7];case 5:return[2]}})})},disabled:!!S||h,variant:x}),f.createElement(i,{loading:!!S},p))},di=function(t){var n=void 0===t?{}:t,r=n.onLoadStart,o=n.onLoadEnd,i=n.disabled,a=e(g(0),2),l=a[0],c=a[1];return{handleLoadStart:function(){r&&r(),c(function(e){return e+1})},handleLoadEnd:function(e){o&&o(e),c(function(e){return e-1})},loading:!!l||i}},fi=function(t,n){void 0===n&&(n=1e3);var o=0,i=function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];var l=Date.now()-o,c=function(){o=Date.now(),t.apply(void 0,r([],e(i),!1))};c(),l>n&&c()};return i.clear=function(){},i},mi="virtual-view-root",pi="virtual-view-child",hi="list_item_idx",vi=Tn()({root:{position:"relative",overflowY:"auto",minHeight:"50px"},hideScrollbar:{"&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"},adjust:{position:"absolute",visibility:"hidden",height:1,width:1,left:0}}),gi=function(r){var o,i=r.className,c=r.sx,u=r.withScrollbar,s=void 0!==u&&u,d=r.minRowHeight,m=void 0===d?60:d,p=r.bufferSize,v=void 0===p?5:p,x=r.children,C=r.hasMore,k=void 0===C||C,S=r.loading,L=void 0!==S&&S,N=r.onDataRequest,I=void 0===N?function(){}:N,M=r.onLoadStart,R=r.onLoadEnd,P=r.fallback,A=r.scrollXSubject,T=r.scrollYSubject,D=r.throwError,O=void 0!==D&&D,F=l(r,["className","sx","withScrollbar","minRowHeight","bufferSize","children","hasMore","loading","onDataRequest","onLoadStart","onLoadEnd","fallback","scrollXSubject","scrollYSubject","throwError"]),_=vi().classes,B=b(!0),H=b(!1),W=_r(A),z=_r(T),V=h(function(){return H.current=!0,f.Children.toArray(x)},[x]),Y=e(g(0),2),U=Y[0],q=Y[1],$=e(g(function(){return new Map}),2),X=$[0],G=$[1],K=!!U||L,Q=Vr(k),J=Vr(m),Z=Vr(K),ee=no(function(e){return t(void 0,void 0,void 0,function(){var t,r;return n(this,function(n){switch(n.label){case 0:if(K)return[2];t=!0,n.label=1;case 1:return n.trys.push([1,5,6,7]),M&&M(),B.current&&q(function(e){return e+1}),I?[4,$n(0)]:[3,4];case 2:return n.sent(),[4,I(e)];case 3:n.sent(),n.label=4;case 4:return[3,7];case 5:if(r=n.sent(),t=!1,O)throw r;return P&&P(r),[3,7];case 6:return R&&R(t),B.current&&q(function(e){return e-1}),[7];case 7:return[2]}})})}),te=Fr(function(){return new Map}),ne=e(g(null),2),re=ne[0],oe=ne[1],ie=e(g(0),2),ae=ie[0],le=ie[1],ce=e(g(0),2),ue=ce[0],se=ce[1],de=h(function(){return Math.max(Math.floor(ue/m),v)},[m,v,ue]),fe=Fr(function(){return new ResizeObserver(function(e){return e.forEach(function(e){var t=e.target;if(t){var n=e.contentRect.height;if(t.classList.contains(mi)&&(se(n),te.forEach(function(e){if(document.body.contains(e)){var t=Number(e.dataset[hi]);if(!Number.isNaN(t)){var n=e.offsetHeight;G(function(e){return e.get(t)!==n?(e.set(t,Math.max(n,J.current)),new Map(e)):e})}}})),t.classList.contains(pi)){var r=Number(t.dataset[hi]);Number.isNaN(r)||G(function(e){return e.get(r)!==n?(e.set(r,Math.max(n,J.current)),new Map(e)):e})}}})})}),me=y(function(e){var t=e,n=0;return V.forEach(function(){t>=0&&(t-=X.get(n)||m,n+=1)}),Math.max(n-de,0)},[X,de,m,V]),pe=y(function(e,t){var n=e+ue,r=0;return V.forEach(function(){n>=0&&(n-=X.get(r)||m,r+=1)}),Math.min(r-1+de,t-1)},[X,de,ue,m,V]),he=y(function(e){var t=0;return V.slice(0,e).forEach(function(e,n){t+=X.get(n)||m}),t},[X,m,V]),ve=h(function(){var e=0;return V.forEach(function(t,n){e+=X.get(n)||m}),e},[X,V,m]),ge=y(function(){if(re){if(re.clientHeight>=re.scrollHeight)return!1;var e=re.scrollHeight-re.scrollTop-re.clientHeight;return Math.abs(e)<10}return!1},[re]),be=f.useMemo(function(){var t=me(ae),n=pe(ae,V.length);Array.from(te.entries()).forEach(function(r){var o=e(r,2),i=o[0],a=o[1];(i<t||i>n)&&(fe.unobserve(a),te.delete(i))});var r=!0;return(r=(r=(r=(r=r&&Q.current)&&!Z.current)&&ge())&&V.length===n+1)&&!H.current&&queueMicrotask(function(){return ee(!1)}),H.current=!1,V.slice(t,n+1).map(function(e,n){return f.cloneElement(e,{ref:function(e){if(e){var r=t+n,o=te.get(r);o!==e&&(o&&fe.unobserve(o),e.classList.add(pi),e.dataset[hi]=String(r),fe.observe(e),te.set(r,e),G(function(t){return t.get(r)!==e.offsetHeight?(t.set(r,Math.max(e.offsetHeight,m)),new Map(t)):t}))}},style:{position:"absolute",top:he(t+n),minHeight:m,minWidth:"100%",left:0}})})},[Q,Z,V,m,ae,X,me,pe,he,ge,ee]),ye=y(function(e){e&&(e.addEventListener("scroll",fi(function(e){le(e.target.scrollTop)},50)),se(e.offsetHeight),W.unsubscribeAll(),W.subscribe(function(t){e.scrollLeft!==t&&e.scrollTo(Math.min(t,e.scrollWidth),e.scrollTop)}),z.unsubscribeAll(),z.subscribe(function(t){e.scrollLeft!==t&&e.scrollTo(Math.min(t,e.scrollWidth),e.scrollTop)}),oe(e),fe.observe(e))},[]);return w(function(){return function(){fe.disconnect(),W.unsubscribeAll(),z.unsubscribeAll()}},[]),w(function(){ee(!0)},[]),E(function(){return function(){B.current=!1}},[]),f.createElement(j,a({className:xo(i,_.root,mi,(o={},o[_.hideScrollbar]=!s,o)),sx:a({width:"100%"},c)},F,{ref:ye}),be,f.createElement("div",{className:_.adjust,style:{top:ve}}))};gi.virtualize=function(e){return x(function(t,n){var r=t,o=r.className,i=r.style,c=l(r,["className","style"]);return f.createElement("div",{className:o,style:i,ref:n},f.createElement(e,a({},c)))})};var bi,yi=function(t){var n=void 0===t?{}:t,r=n.defaultSize,o=void 0===r?{height:0,width:0}:r,i=o.height,l=o.width,c=n.target,u=void 0===c?null:c,s=n.map,d=n.closest,f=n.selector,m=n.debounce,p=void 0===m?0:m,h=n.compute,v=void 0===h?function(e){return e}:h,y=n.onResize,w=b(null),x=b(!0);E(function(){return function(){x.current=!1}},[]);var C=e(g({height:i,width:l}),2),k=C[0],S=C[1],L=Vr(k);return E(function(){var e=w.current,t=u||e;if(t&&(d&&(t=(null==t?void 0:t.closest(d))||null),f&&(t=(null==t?void 0:t.querySelector(f))||null),s&&(t=t?s(t):t),t)){var n=Zn(function(e){var t=a({},v(e));t.height=Math.floor(t.height),t.width=Math.floor(t.width);var n=L.current;n.height===t.height&&n.width===t.width||(x.current&&S(t),y&&y(t))},p),r=new ResizeObserver(function(){var e=t.getBoundingClientRect(),r=e.height,o=e.width;n({height:r,width:o})}),o=a({},v(a({},t.getBoundingClientRect())));o.height=Math.floor(o.height),o.width=Math.floor(o.width),S(o),r.observe(t);var i=function(){var e=t.getBoundingClientRect(),r=e.height,o=e.width;n({height:r,width:o})};return window.visualViewport&&window.visualViewport.addEventListener("resize",i),function(){window.visualViewport&&window.visualViewport.removeEventListener("resize",i),r.disconnect(),n.clear()}}},[w.current,u,d,f]),{elementRef:w,size:k}},wi=Tn()({listBox:{overflow:"hidden !important"}}),Ei=x(function(e,t){var n=e.className,r=e.children,o=e.role,i=l(e,["className","children","role"]),c=wi().classes,u=yi(),s=u.elementRef,d=u.size,m=Array.isArray(r)?r.length:0;return f.createElement("div",{ref:t},f.createElement("div",a({},i,{ref:s,className:xo(c.listBox,n)}),f.createElement(gi,{role:o,sx:{width:d.width,height:"min(".concat(m?Math.min(54*m,300):54,"px, 45vh)"),maxHeight:"45vh"},minRowHeight:54},r)))}),xi=Tn()(function(e){return{root:{position:"absolute",top:0,left:0,right:0,bottom:0,height:"100%",width:"100%",background:e.palette.background.paper,display:"flex",alignItems:"center",justifyContent:"center",zIndex:999},hidden:{display:"none !important"}}}),Ci=function(e){var t,n=e.open,r=xi().classes;return f.createElement(j,{className:xo(r.root,(t={},t[r.hidden]=!n,t))},f.createElement(O,null))},ki=Tn()({root:{position:"relative",minHeight:"50px",width:"100%",overflowY:"auto",overflowX:"hidden"},hideScrollbar:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},container:{position:"absolute",top:0,left:0,right:0,width:"100%",display:"flex",flexDirection:"column",alignItems:"stretch"}}),Si=function(r){var o,i=r.withScrollbar,c=void 0!==i&&i,u=r.className,s=r.style,d=r.sx,m=r.loading,p=void 0!==m&&m,v=r.throwError,x=void 0!==v&&v,C=r.hasMore,k=void 0===C||C,S=r.children,L=r.scrollXSubject,N=r.scrollYSubject,I=r.onDataRequest,M=r.onLoadStart,R=r.onLoadEnd,P=r.fallback,A=l(r,["withScrollbar","className","style","sx","loading","throwError","hasMore","children","scrollXSubject","scrollYSubject","onDataRequest","onLoadStart","onLoadEnd","fallback"]),T=ki().classes,D=_r(L),O=_r(N),F=e(g(0),2),_=F[0],B=F[1],H=b(),W=b(!0),z=b(!1),V=h(function(){return z.current=!0,S},[S]);E(function(){return function(){W.current=!1}},[]);var Y=!!_||p,U=Vr(Y),q=Vr(k),$=no(function(e){return t(void 0,void 0,void 0,function(){var t,r;return n(this,function(n){switch(n.label){case 0:if(Y)return[2];t=!0,n.label=1;case 1:return n.trys.push([1,5,6,7]),M&&M(),W.current&&B(function(e){return e+1}),I?[4,$n(0)]:[3,4];case 2:return n.sent(),[4,I(e)];case 3:n.sent(),n.label=4;case 4:return[3,7];case 5:if(r=n.sent(),t=!1,x)throw r;return P&&P(r),[3,7];case 6:return R&&R(t),W.current&&B(function(e){return e-1}),[7];case 7:return[2]}})})}),X=y(function(t){Y||(H.current&&H.current.disconnect(),H.current=new IntersectionObserver(function(t){var n=e(t,1)[0],r=!0;r=(r=r&&q.current)&&!U.current,(null==n?void 0:n.isIntersecting)&&r&&!z.current&&$(!1),z.current=!1}),t&&H.current.observe(t))},[k,Y,I]);w(function(){$(!0)},[]),w(function(){return function(){H.current&&H.current.disconnect(),D.unsubscribeAll(),O.unsubscribeAll()}},[]);var G=y(function(e){e&&(D.unsubscribeAll(),D.subscribe(function(t){e.scrollLeft!==t&&e.scrollTo(Math.min(t,e.scrollWidth),e.scrollTop)}),O.unsubscribeAll(),O.subscribe(function(t){e.scrollLeft!==t&&e.scrollTo(Math.min(t,e.scrollWidth),e.scrollTop)}))},[]);return f.createElement(j,a({},A,{className:xo(u,T.root,(o={},o[T.hideScrollbar]=!c,o)),style:s,sx:d,ref:G}),f.createElement(j,{className:T.container},V,f.createElement("div",{style:{height:1},ref:X})))};!function(e){e.Single="single-selection",e.Multiple="multiple-selection",e.None="none-selection"}(bi||(bi={}));var Li=bi,Ni=function(r){void 0===r&&(r=750);var o=e(jr(!1),2),i=o[0],a=o[1],l=h(function(){return to(function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,$n(r)];case 1:return e.sent(),a(!1),[2]}})})})},[]),c=y(function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return a(!0),[4,l()];case 1:return e.sent(),[2]}})})},[]);return{delay$:i,doDelay:c}},Ii=p(null),Mi=function(){return v(Ii)},Ri=function(t){var n=t.children,o=t.selectedRows,i=t.onSelectedRows,a=e(g(new Set(o)),2),l=a[0],c=a[1],u=Ni(),s=u.delay$,d=u.doDelay,f=function(t,n){void 0===n&&(n=!1),d(),i&&i(r([],e(t),!1),n),c(new Set(t))},p={selection:l,setSelection:f};return w(function(){if(o&&!s.current){var e=new Set(o);(function(e,t){if(e.size!==t.size)return!1;var n=!0;return e.forEach(function(e){!t.has(e)&&n&&(n=!1)}),t.forEach(function(t){!e.has(t)&&n&&(n=!1)}),n})(e,l)||f(e)}},[o]),m.createElement(Ii.Provider,{value:p},n)},Pi=Tn()(function(e){return{root:{position:"relative",display:"flex",alignItems:"stretch",justifyContent:"stretch"},container:{flex:1,display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column","& > *":{flex:1}},header:{display:"flex",flexDirection:"row",gap:e.spacing(1),alignItems:"center",width:"100%",height:"35px",maxHeight:"35px",borderBottom:"1px solid ".concat($(e.palette.getContrastText(e.palette.background.default),.23)),scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},headerLabel:{opacity:.65}}}),Ai=function(e){var t,n=e.className,r=e.style,o=e.sx,i=e.selectionMode,a=void 0===i?Li.None:i,l=e.headerLabel,c=void 0===l?"List":l,u=e.data,s=e.withHeader,d=void 0!==s&&s,f=e.children,p=Pi().classes,h=Mi(),v=h.selection,g=h.setSelection;return m.createElement(j,{className:xo(n,p.root),style:r,sx:o},m.createElement("div",{className:p.container},d?m.createElement("div",{className:p.header},(t=function(){a!==Li.None&&(a!==Li.Single?v.size?g(new Set):(u.forEach(function(e){var t=e.id;return v.add(t)}),g(v)):g(new Set))},a===Li.Single?m.createElement(Ce,{onClick:t,color:"primary"}):a===Li.Multiple?m.createElement(ve,{checked:!!v.size,onClick:t,color:"primary"}):a===Li.None?m.createElement(ve,{color:"primary",onClick:t,disabled:!0}):null),!!c&&m.createElement(X,{variant:"body1",className:p.headerLabel},c)):null,f))},Ti=function(r,o){var i=void 0===o?{}:o,a=i.onLoadStart,l=i.onLoadEnd,c=i.fallback,u=i.throwError,s=b(null),d=e(g(!1),2),f=d[0],m=d[1],p=e(g(!1),2),h=p[0],v=p[1],w=b(!0);E(function(){return function(){w.current=!1}},[]);var x=no(r),C=y(function(e){return t(void 0,void 0,void 0,function(){var r,o,i,d;return n(this,function(f){switch(f.label){case 0:s.current&&s.current.cancel(),r=Gn(function(){return t(void 0,void 0,void 0,function(){var t,r,o;return n(this,function(n){switch(n.label){case 0:t=!0,a&&a(),n.label=1;case 1:return n.trys.push([1,5,6,7]),(r=x(e))instanceof Promise?[4,r]:[3,3];case 2:return[2,n.sent()||null];case 3:return[2,r||null];case 4:return[3,7];case 5:throw o=n.sent(),t=!1,o;case 6:return l&&l(t),[7];case 7:return[2]}})})}),s.current=r,w.current&&m(!0),w.current&&v(!1),o=!1,f.label=1;case 1:return f.trys.push([1,3,4,5]),[4,r()];case 2:return(i=f.sent())===Xn?(o=!0,[2,null]):(s.current=null,[2,i]);case 3:if(d=f.sent(),w.current&&v(!0),u)throw d;return c&&c(d),[3,5];case 4:return o||w.current&&m(!1),[7];case 5:return[2,null]}})})},[]);return{loading:f,error:h,execute:C}};function Di(e,t,n){var r=this,o=b(null),i=b(0),a=b(null),l=b([]),c=b(),u=b(),s=b(e),d=b(!0);s.current=e;var f=!t&&0!==t&&"undefined"!=typeof window;if("function"!=typeof e)throw new TypeError("Expected a function");t=+t||0;var m=!!(n=n||{}).leading,p=!("trailing"in n)||!!n.trailing,v="maxWait"in n,g=v?Math.max(+n.maxWait||0,t):null,E=y(function(e){var t=l.current,n=c.current;return l.current=c.current=null,i.current=e,u.current=s.current.apply(n,t)},[]),x=y(function(e,t){f&&cancelAnimationFrame(a.current),a.current=f?requestAnimationFrame(e):setTimeout(e,t)},[f]),C=y(function(e){if(!d.current)return!1;var n=e-o.current,r=e-i.current;return!o.current||n>=t||n<0||v&&r>=g},[g,v,t]),k=y(function(e){return a.current=null,p&&l.current?E(e):(l.current=c.current=null,u.current)},[E,p]),S=y(function(){if(d.current){var e=Date.now();if(C(e))return k(e);var n=e-o.current,r=e-i.current,a=t-n,l=v?Math.min(a,g-r):a;x(S,l)}},[g,v,C,x,k,t]),L=y(function(){a.current&&(f?cancelAnimationFrame(a.current):clearTimeout(a.current)),i.current=0,l.current=o.current=c.current=a.current=null},[f]),N=y(function(){return a.current?k(Date.now()):u.current},[k]);w(function(){return d.current=!0,function(){d.current=!1}},[]);var I=y(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(!d.current)return u.current;var s=Date.now(),f=C(s);if(l.current=e,c.current=r,o.current=s,f){if(!a.current&&d.current)return i.current=o.current,x(S,t),m?E(o.current):u.current;if(v)return x(S,t),E(o.current)}return a.current||x(S,t),u.current},[E,m,v,C,x,S,t]),M=y(function(){return!!a.current},[]);return h(function(){return{callback:I,cancel:L,flush:N,pending:M}},[I,L,N,M])}function ji(e,t){return e===t}function Oi(t,n,r){var o=r&&r.equalityFn||ji,i=e(g(t),2),a=i[0],l=i[1],c=Di(y(function(e){return l(e)},[]),n,r),u=b(t);return w(function(){o(u.current,t)||(c.callback(t),u.current=t)},[t,c,o]),[a,{cancel:c.cancel,pending:c.pending,flush:c.flush}]}var Fi,_i=function(t){var n=e(Oi(t,800),1)[0],r=b(t),o=_r(),i=b(!0);return w(function(){i.current?i.current=!1:Vn(n,r.current)||(r.current=n,o.next(n))},[n]),o},Bi=Symbol("get-value-map"),Hi=function(t,n){var o=new Map,i=function(){for(var i,a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];var c=t(a),u=null===(i=o.get(c))||void 0===i?void 0:i.current;if(void 0===u){var s={current:void 0};o.set(c,s),u=s.current=n.apply(void 0,r([],e(a),!1))}return u};return i[Bi]=function(){return o},i.clear=function(e){e?o.delete(e):o.clear()},i.add=function(e,t){var n=o.get(e);void 0===n?n={current:t}:n.current=t,o.set(e,n)},i.remove=function(e){return o.delete(e)},i},Wi=new lr,zi=p(null),Vi=function(t){var n=t.children,r=t.rowKey,o=void 0===r?"id":r,i=t.recomputeSubject,a=t.rowMark,l=void 0===a?function(){return""}:a,c=t.rowColor,u=void 0===c?function(){return""}:c,s=_r(i),d=h(function(){return Hi(function(t){var n=e(t,1)[0];return n[o]||n},l)},[]),f=h(function(){return Hi(function(t){var n=e(t,1)[0];return n[o]||n},u)},[]);w(function(){return s.subscribe(function(){d.clear(),f.clear(),Wi.next()})},[]),w(function(){return function(){d.clear(),f.clear()}},[]);var p=h(function(){return{rowMark:d,rowColor:f}},[]);return m.createElement(zi.Provider,{value:p},n)},Yi=x(function(r,o){var i=r.className,l=r.style,c=r.index,u=r.data,s=r.sx,d=r.payload,m=r.rowKey,p=r.selectionMode,b=r.children,E=r.onItemClick,x=Vr(u),C=_i(u),k=y(function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,Promise.race([C.toPromise(),$n(7500)])];case 1:return e.sent(),[2]}})})},[]),S=e(g(""),2),L=S[0],N=S[1],I=e(g(""),2),M=I[0],R=I[1],P=Mi(),A=P.selection,T=P.setSelection,D=v(zi),j=D.rowMark,O=D.rowColor,F=Ti(function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:return e=N,[4,j(x.current)];case 1:return e.apply(void 0,[n.sent()]),t=R,[4,O(x.current)];case 2:return t.apply(void 0,[n.sent()]),[2]}})})}).execute;w(function(){return F(),function(){j.clear(u[m]||u)}},[]),w(function(){return Wi.subscribe(function(){k().then(F)})},[]);var _=y(function(){var e=u[m];e&&p!==Li.None&&(p===Li.Single?A.has(e)&&1===A.size?A.delete(e):(A.clear(),A.add(e)):A.has(e)?A.delete(e):A.add(e),T(new Set(A)))},[A]),B=h(function(){return A.has(u[m])},[A]);return f.createElement(Me,{ref:o,disableRipple:!0,className:i,style:l,sx:a({background:M,"&:hover":{background:M||"transparent"}},s),selected:B,onClick:function(){return E&&E({data:u,payload:d,toggleSelection:_,isSelected:B})}},f.createElement(b,{toggleSelection:_,data:u,payload:d,index:c,rowMark:L,isSelected:B}))});!function(e){e.Virtual="virtual",e.Intersection="intersection"}(Fi||(Fi={}));var Ui,qi=Fi,$i=Tn()({noData:{display:"flex",justifyContent:"center",alignItems:"center",padding:"12px"}}),Xi=function(e){var t,n=e.className,r=e.style,o=e.sx,i=e.itemSx,a=e.data,l=e.loading,c=e.hasMore,u=e.mode,s=void 0===u?qi.Virtual:u,d=e.bufferSize,m=void 0===d?25:d,p=e.minRowHeight,h=void 0===p?72:p,v=e.payload,g=void 0===v?{}:v,b=e.rowKey,y=void 0===b?"id":b,w=e.noDataLabel,E=void 0===w?"No data":w,x=e.errorMessage,C=e.children,k=e.onSkip,L=e.onButtonSkip,N=e.onItemClick,I=e.onSelectedRows,M=e.selectedRows,R=e.selectionMode,P=e.recomputeSubject,A=e.scrollXSubject,T=e.scrollYSubject,D=e.withHeader,O=e.headerLabel,F=e.rowMark,B=void 0===F?function(){return""}:F,H=e.rowColor,W=void 0===H?function(){return""}:H,z=$i().classes,V=Fr(g);return f.createElement(Ri,{onSelectedRows:I,selectedRows:M},f.createElement(Vi,{recomputeSubject:P,rowKey:y,rowMark:B,rowColor:W},f.createElement(Ai,{className:n,style:r,sx:o,data:a,selectionMode:R,withHeader:D,headerLabel:O},S(s===qi.Virtual?gi:Si,{withScrollbar:!0,component:Ie,scrollYSubject:T,scrollXSubject:A,minRowHeight:h,bufferSize:m,loading:l,hasMore:c,onDataRequest:function(e){k&&c&&k(e)},children:(t=[],l||x||0!==a.length||t.push(f.createElement(j,{className:z.noData},f.createElement(_,{variant:"body1"},E))),x&&t.push(f.createElement(j,{className:z.noData},f.createElement(_,{color:"error",variant:"body1"},x))),a.forEach(function(e,n){return t.push(f.createElement(Yi,{key:e[y]||n,sx:i,index:n,payload:V,data:e,rowKey:y,selectionMode:R,onItemClick:N},C))}),a.length>0&&!x&&L&&!k&&!l&&c&&t.push(f.createElement(j,{className:z.noData},f.createElement(ye,{variant:"outlined",onClick:L},"Show More"))),t)}))))},Gi=function(e){var t=e.isSelected,n=e.selectionMode,r=void 0===n?Li.None:n,o=e.toggleSelection,i=e.disabled;return r===Li.Single?f.createElement(Ce,{color:"primary",onClick:function(e){e.stopPropagation(),o()},checked:t,disabled:i}):r===Li.Multiple?f.createElement(ve,{color:"primary",onClick:function(e){e.stopPropagation(),o()},checked:t,disabled:i}):f.createElement(ve,{color:"primary",disabled:!0})},Ki=p(null),Qi=function(){return v(Ki)},Ji=function(e){var t=e.children,n=e.constraintManager;return f.createElement(Ki.Provider,{value:n},t)},Zi=p(null),ea=function(){return v(Zi)},ta=function(e){var t=e.children,n=e.size;return f.createElement(Zi.Provider,{value:n},t)},na="react-declatative__PaperView-root",ra=Tn()(function(e){return{outline:{border:"1px solid ".concat($(e.palette.getContrastText(e.palette.background.default),.23)),background:e.palette.background.paper,borderRadius:"4px"}}}),oa=x(function(e,t){var n=e.component,r=e.className,o=e.outlinePaper,i=e.transparentPaper,c=l(e,["component","className","outlinePaper","transparentPaper"]),u=ra().classes;return i?f.createElement(j,a({className:xo(r,na)},c,{ref:t})):o?f.createElement(j,a({className:xo(r,u.outline,na)},c,{component:n,ref:t})):f.createElement(ke,a({className:xo(r,na)},c,{component:n,ref:t}))}),ia=Tn()(function(e){return{root:{width:"100%",overflow:"hidden",display:"flex",alignItems:"stretch",justifyContent:"stretch",background:"light"===e.palette.mode?e.palette.background.paper:$("#000",.05)},container:{display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column",flex:1},content:{display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column",flex:1},header:{minHeight:"35px",width:"100%",display:"flex",alignItems:"center",background:"light"===e.palette.mode?$("#000",.05):e.palette.background.paper}}}),aa=function(t){var n=t.outlinePaper,r=t.transparentPaper,o=t.className,i=t.style,a=t.sx,l=t.header,c=t.children,u=ia().classes,s=Qi(),d=h(function(){return function(){var e=document.createElement("div");e.style.position="fixed",e.style.left="-100%",e.style.visibility="hidden",e.style.overflow="scroll",document.body.appendChild(e);var t=document.createElement("div");e.appendChild(t);var n=e.offsetWidth-t.offsetWidth;return document.body.removeChild(e),n}()},[]),m=h(function(){return function(){var e=document.createElement("div");e.style.position="fixed",e.style.left="-100%",e.style.visibility="hidden",e.style.overflow="scroll",document.body.appendChild(e);var t=document.createElement("div");e.appendChild(t);var n=e.offsetHeight-t.offsetHeight;return document.body.removeChild(e),n}()},[]),p=e(g({height:0,width:0}),2),v=p[0],b=p[1],E=Fr(function(){return new ResizeObserver(function(t){var n=e(t,1)[0].target;n&&(s.clear(),b({height:Math.max(n.offsetHeight-m,0),width:Math.max(n.offsetWidth-d,0)}))})}),x=y(function(e){e&&(b({height:Math.max(e.offsetHeight-m,0),width:Math.max(e.offsetWidth-d,0)}),E.observe(e))},[E,d,m]);return w(function(){return function(){E.disconnect()}},[E]),f.createElement(ta,{size:v},f.createElement(oa,{outlinePaper:n,transparentPaper:r,className:xo(o,u.root),style:i,sx:a},f.createElement("div",{className:u.container},!!l&&f.createElement("div",{className:u.header},l),f.createElement("div",{className:u.content,ref:x},c))))},la=p(null),ca=function(){return v(la)},ua=function(e){var t=e.children,n=e.value;return f.createElement(la.Provider,{value:n},t)},sa=125,da=75,fa=function(e){var t=e.className,n=e.style,r=e.sx,o=e.column,i=e.idx,c=e.children,u=l(e,["className","style","sx","column","idx","children"]),s=Qi(),d=ea().width,m=ca(),p=m.rowActions,v=m.selectionMode,g=void 0===v?Li.None:v,b=h(function(){return Math.max(d-(p?sa:0)-(g===Li.None?0:da),0)},[d,p]),y=h(function(){return s.memoize("column-width-".concat(b,"-").concat(i),function(){var e=o.width||165,t="function"==typeof e?e(b):e;return"number"==typeof t?"".concat(t,"px"):t})},[o.width,b,i,s]);return f.createElement(j,a({className:t,style:n,sx:a(a({},r),{position:"relative",overflow:"hidden",minWidth:y,maxWidth:y})},u),c)},ma=function(e){var t=e.className,n=e.style,r=e.sx,o=e.children;return f.createElement(j,{className:t,style:n,sx:a(a({},r),{display:"flex",justifyContent:"center !important",alignItems:"center !important"})},o)},pa=p(null),ha=function(){return v(pa)},va=function(t){var n=t.children,o=ca(),i=o.selectedRows,a=o.onSelectedRows,l=e(g(new Set(i)),2),c=l[0],u=l[1],s=Ni(),d=s.delay$,f=s.doDelay,p=function(t,n){void 0===n&&(n=!1),f(),a&&a(r([],e(t),!1),n),u(new Set(t))},h={selection:c,setSelection:p};return w(function(){if(i&&!d.current){var e=new Set(i);(function(e,t){if(e.size!==t.size)return!1;var n=!0;return e.forEach(function(e){!t.has(e)&&n&&(n=!1)}),t.forEach(function(t){!e.has(t)&&n&&(n=!1)}),n})(e,c)||p(e)}},[i]),m.createElement(pa.Provider,{value:h},n)},ga=Kr(),ba=Kr(),ya=Tn()(function(e){return{root:{position:"relative",overflowX:"auto",overflowY:"hidden",width:"100%",height:"35px",borderBottom:"1px solid ".concat($(e.palette.getContrastText(e.palette.background.default),.23)),scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},container:{position:"absolute",top:0,left:0,bottom:0,height:"100%",minWidth:"100%",display:"flex",alignItems:"stretch",justifyContent:"stretch"},headerCell:{display:"flex",userSelect:"none",flexDirection:"column",justifyContent:"center",paddingLeft:"5px",paddingRight:"5px",paddingTop:"7.5px",paddingBottom:"7.5px",width:"100%",whiteSpace:"break-spaces",overflowWrap:"anywhere",textOverflow:"ellipsis",overflow:"hidden",fontWeight:"bold"},headerCellOpacity:{opacity:.7},headerCellClick:{"&:hover":{backgroundColor:"#f9f9f9",cursor:"pointer"}},coloredHeaderCell:{background:$(e.palette.background.paper,.2)},headerCellSortable:{display:"flex",justifyContent:"space-between",width:"100%","&>*:nth-of-type(n+1)":{marginLeft:e.spacing(1)}},noWrap:{whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"}}}),wa=function(e){var t=e.className,n=e.style,r=e.sx,o=e.columns,i=e.sort,a=e.rowActions,l=e.scrollXSubject,c=e.onClickHeaderColumn,u=e.onScrollX,s=ya().classes,d=ca(),m=d.data,p=d.selectionMode,h=void 0===p?Li.None:p,v=ha(),g=v.selection,b=v.setSelection,w=Vr(m),E=Vr(g),x=y(function(e){e&&l.subscribe(function(t){e.scrollLeft!==t&&e.scrollTo(Math.min(t,e.scrollWidth),e.scrollTop)})},[l]),C=y(function(){var e=w.current,t=E.current,n=function(){h!==Li.None&&(h!==Li.Single?t.size?b(new Set):(e.forEach(function(e){var n=e.id;return t.add(n)}),b(t)):b(new Set))};return h===Li.Single?f.createElement(Ce,{onClick:n,color:"primary"}):h===Li.Multiple?f.createElement(ve,{checked:!!t.size,onClick:n,color:"primary"}):h===Li.None?f.createElement(ve,{color:"primary",onClick:n,disabled:!0}):null},[]);return f.createElement(j,{ref:x,className:xo(t,s.root),style:n,sx:r,onScroll:function(e){var t=e.target;u&&u(t.scrollLeft)}},f.createElement(j,{className:s.container},h!==Li.None&&f.createElement(ma,{className:s.headerCell,key:ba,sx:{minWidth:da,maxWidth:da}},C()),o.map(function(e,t){var n,r,o="".concat(String(e.field),"-").concat(t);return f.createElement(fa,{key:o,className:xo(s.headerCell,s.headerCellOpacity,(n={},n[s.headerCellClick]=Boolean(c),n[s.coloredHeaderCell]=i&&i.value===e.field,n)),column:e,idx:t,onClick:function(){c&&c(e.field)}},f.createElement("div",{className:xo(s.noWrap,(r={},r[s.headerCellSortable]=Boolean(i),r))},e.label,i&&i.value===e.field?"ASC"===(null==i?void 0:i.sortDirection)?f.createElement(Re,null):f.createElement(Pe,null):null))}),!!(null==a?void 0:a.length)&&f.createElement(ma,{className:xo(s.headerCell,s.headerCellOpacity),key:ga,sx:{minWidth:sa,maxWidth:sa}},"Actions")))},Ea=x(function(e,t){var n=e.className,r=e.style,o=e.sx,i=e.columns,l=e.children,c=e.withRowActions,u=Qi(),s=ea().width,d=h(function(){return Math.max(s-(c?sa:0),0)},[s,c]),m=h(function(){var e=i.map(function(e,t){return parseFloat(u.memoize("column-width-".concat(d,"-").concat(t),function(e){return function(){var t=e.width||165,n="function"==typeof t?t(d):t;return"string"==typeof n?parseFloat(n):n}}(e)))}).reduce(function(e,t){return e+t},0);return c&&(e+=sa),"".concat(e+=da,"px !important")},[i,d,c,u]);return f.createElement(j,{ref:t,className:xo(n,pi),style:r,sx:a(a({},o),{minWidth:m,maxWidth:m})},l)}),xa=Tn()({root:{zIndex:"unset !important"},container:{position:"relative",display:"flex",alignItems:"stretch",justifyContent:"stretch",overflowY:"auto",overflowX:"hidden",maxHeight:"45vh"},content:{flex:1,display:"flex",flexDirection:"column",justifyContent:"stretch"},loader:{position:"absolute",top:0,left:0,right:0,bottom:0,height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center"},beforeContent:{width:"100%",display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *":{flex:1}},afterContent:{width:"100%",display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *":{flex:1}}}),Ca=function(r){var o=r.options,i=void 0===o?[]:o,l=r.transparent,c=void 0!==l&&l,u=r.disabled,s=void 0!==u&&u,d=r.throwError,m=void 0!==d&&d,p=r.fallback,h=r.onToggle,v=r.onAction,y=void 0===v?function(){return null}:v,w=r.payload,E=r.className,x=r.style,C=r.sx,k=r.deps,S=r.onLoadStart,L=r.onLoadEnd,N=r.keepMounted,I=r.BeforeContent,M=r.AfterContent,R=r.reloadSubject,P=b(null),A=e(g(null),2),T=A[0],D=A[1],H=e(g(0),2),z=H[0],V=H[1],Y=xa().classes,U=no(y),q=function(){V(function(e){return e+1}),S&&S()},X=function(e){V(function(e){return Math.max(e-1,0)}),L&&L(e)},K=Ti(U,{onLoadStart:q,onLoadEnd:X,throwError:m,fallback:p}).execute;return f.createElement(f.Fragment,null,f.createElement(Te,{ref:P,className:xo(E,Y.root),style:x,sx:a(a({},c?{boxShadow:"none !important",background:"transparent !important",color:function(e){return"".concat($(e.palette.getContrastText(e.palette.background.default),.4)," !important")}}:void 0),C),disableFocusRipple:c,disableRipple:c,disabled:s||!!z,size:"small",color:"primary","aria-label":"more","aria-haspopup":"true",onClick:function(e){e.preventDefault(),e.stopPropagation(),D(P.current),h&&h(!0)}},f.createElement(Ae,{color:"inherit"})),f.createElement(W,{keepMounted:N,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},anchorEl:s?null:T,open:!!T&&!s,onClose:function(e){e.preventDefault(),e.stopPropagation(),D(null),V(0),h&&h(!1)},MenuListProps:{disablePadding:!0,sx:{pt:I?0:1,pb:M?0:1}}},f.createElement(j,{className:Y.container},0!==z&&f.createElement(j,{className:Y.loader},f.createElement(O,null)),f.createElement(j,{className:Y.content,sx:{visibility:0!==z?"hidden":"visible"}},I&&f.createElement(j,{className:Y.beforeContent},f.createElement(I,null)),i.map(function(e,r){var o=e.label,i=void 0===o?"unknown-label":o,a=e.action,l=void 0===a?"unknown-action":a,c=e.divider,u=e.icon,s=e.isDisabled,d=void 0===s?function(){return!1}:s,v=e.isVisible,g=void 0===v?function(){return!0}:v;return f.createElement(Zr,{Loader:function(){return c?null:f.createElement(B,{sx:{visibility:"hidden",minWidth:225}},!!u&&f.createElement(F,null,f.createElement(u,null)),f.createElement(_,{variant:"inherit"},i))},throwError:m,fallback:p,key:r,onLoadStart:q,onLoadEnd:X,reloadSubject:R,deps:k,payload:w},function(e){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return[4,$n(250)];case 1:return n.sent(),[4,d(e)];case 2:return t=n.sent(),[4,g(e)];case 3:return n.sent()?c?[2,f.createElement(G,{orientation:"horizontal"})]:[2,f.createElement(B,{disabled:t,onClick:(r=l,function(e){e.preventDefault(),e.stopPropagation(),K(r),D(null),h&&h(!1)}),sx:{minWidth:225}},!!u&&f.createElement(F,null,f.createElement(u,null)),f.createElement(_,{variant:"inherit"},i))]:[2,null]}var r})})})}),M&&f.createElement(j,{className:Y.afterContent},f.createElement(M,null))))))},ka=new lr,Sa=Kr(),La=Kr(),Na=Tn()(function(e){return{wrapper:{display:"flex",alignItems:"stretch",justifyContent:"stretch"},contentRow:{flex:1,position:"relative",display:"flex",alignItems:"stretch",justifyContent:"stretch",overflow:"hidden",minHeight:"50px",borderBottom:"1px solid ".concat($(e.palette.getContrastText(e.palette.background.default),.23)),"&:hover":{background:$(e.palette.background.paper,.2)}},contentCell:{display:"flex",flexDirection:"column",justifyContent:"center",paddingLeft:"5px",paddingRight:"5px",paddingTop:"7.5px",paddingBottom:"7.5px",width:"100%",whiteSpace:"break-spaces",overflowWrap:"anywhere",textOverflow:"ellipsis",overflow:"hidden"},alignLeft:{alignItems:"flex-start"},alignRight:{alignItems:"flex-end"},alignCenter:{alignItems:"center"},alignStretch:{alignItems:"stretch","& > *:nth-of-type(1)":{flex:1}},rowOnClick:{"&:hover":{cursor:"pointer"}},mark:{position:"absolute",top:0,left:0,bottom:0,width:4},noPadding:{padding:0}}}),Ia=x(function(r,o){var i=r.className,c=r.style,u=r.sx,s=r.rowKey,d=void 0===s?"id":s,m=r.columns,p=r.rowActions,h=r.payload,v=r.row,b=r.onTableRowClick,E=r.onRowAction,x=r.rowMark,C=r.rowColor,k=Na().classes,S=e(g(""),2),L=S[0],N=S[1],I=e(g(""),2),M=I[0],R=I[1],P=ca().selectionMode,A=void 0===P?Li.None:P,T=ha(),D=T.selection,O=T.setSelection,F=Vr(v),_=_i(v),B=y(function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,Promise.race([_.toPromise(),$n(7500)])];case 1:return e.sent(),[2]}})})},[]),H=Ti(function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:return e=N,[4,x(F.current)];case 1:return e.apply(void 0,[n.sent()]),t=R,[4,C(F.current)];case 2:return t.apply(void 0,[n.sent()]),[2]}})})}).execute;w(function(){return H(),function(){x.clear(v[d]||v),C.clear(v[d]||v)}},[]),w(function(){return ka.subscribe(function(){B().then(H)})},[]);var W=y(function(e){e.preventDefault(),e.stopPropagation();var t=v[d];t&&(A===Li.Single?D.has(t)&&1===D.size?D.delete(t):(D.clear(),D.add(t)):D.has(t)?D.delete(t):D.add(t),O(new Set(D)))},[D]),z=y(function(){return A===Li.Single?f.createElement(Ce,{color:"primary",onClick:W,checked:D.has(v.id)}):A===Li.Multiple?f.createElement(ve,{color:"primary",onClick:W,checked:D.has(v.id)}):A===Li.None?f.createElement(ve,{color:"primary",disabled:!0}):null},[D]);return f.createElement(Me,{disableGutters:!0,disableRipple:!0,selected:D.has(v[d]),ref:o,sx:{background:M},className:xo(pi,i,k.noPadding),style:c},f.createElement(j,{className:k.contentRow,sx:u},L&&f.createElement(j,{className:k.mark,style:{background:L}}),A!==Li.None&&f.createElement(ma,{className:k.contentCell,key:La,sx:{minWidth:da,maxWidth:da}},z()),m.map(function(e,t){var n,r="".concat(zn(v,d),"-").concat(t);return f.createElement(fa,{className:xo(k.contentCell,(n={},n[k.rowOnClick]=Boolean(b),n[k.alignLeft]="left"===e.align,n[k.alignRight]="right"===e.align,n[k.alignCenter]="center"===e.align,n[k.alignStretch]="stretch"===e.align,n)),onClick:function(e){b&&b(e,v)},key:r,column:e,idx:t},e.format?e.format(v,h):e.field?String(zn(v,e.field)):null)}),!!(null==p?void 0:p.length)&&f.createElement(ma,{className:k.contentCell,key:Sa,sx:{minWidth:sa,maxWidth:sa}},f.createElement(Ca,{transparent:!0,payload:h,options:p.map(function(e){var t=e.isDisabled,n=void 0===t?function(){return!1}:t,r=e.isVisible,o=void 0===r?function(){return!0}:r,i=l(e,["isDisabled","isVisible"]);return a({isVisible:function(e){return o(v,e)},isDisabled:function(e){return n(v,e)}},i)}),onAction:function(e){E&&E(e,v)}}))))}),Ma=Tn()({content:{height:"calc(100% - 35px)"},noData:{display:"flex",justifyContent:"center",alignItems:"center",padding:"12px"}}),Ra=function(t){var n=t.className,r=t.style,o=t.sx,i=t.recomputeSubject,a=t.scrollXSubject,l=t.scrollYSubject,c=t.columns,u=t.loading,s=t.data,d=t.rowKey,m=void 0===d?"id":d,p=t.hasMore,v=t.errorMessage,g=t.rowActions,b=t.payload,y=t.minRowHeight,E=void 0===y?50:y,x=t.bufferSize,C=t.onTableRowClick,k=t.onRowAction,S=t.onButtonSkip,L=t.onSkip,N=t.onScrollX,I=t.noDataLabel,M=void 0===I?"No data":I,R=t.rowMark,P=void 0===R?function(){return""}:R,A=t.rowColor,T=void 0===A?function(){return""}:A,D=Ma().classes,O=ea().width,F=_r(i),B=h(function(){return Hi(function(t){var n=e(t,1)[0];return n[m]||n},P)},[]),H=h(function(){return Hi(function(t){var n=e(t,1)[0];return n[m]||n},T)},[]);return w(function(){return F.subscribe(function(){B.clear(),H.clear(),ka.next()})},[]),w(function(){return function(){B.clear(),H.clear()}},[]),f.createElement(gi,{withScrollbar:!0,className:xo(n,D.content),style:r,sx:o,scrollXSubject:a,scrollYSubject:l,minRowHeight:E,bufferSize:x,loading:u,hasMore:p,onDataRequest:function(e){L&&p&&L(e)},onScroll:function(e){var t=e.target;N&&N(t.scrollLeft)}},!u&&!v&&0===s.length&&f.createElement(Ea,{columns:c,withRowActions:!!(null==g?void 0:g.length)},f.createElement(j,{className:D.noData,sx:{position:"sticky",left:0,width:O}},f.createElement(_,{variant:"body1"},M))),v&&f.createElement(Ea,{columns:c,withRowActions:!!(null==g?void 0:g.length)},f.createElement(j,{className:D.noData,sx:{position:"sticky",left:0,width:O}},f.createElement(_,{color:"error",variant:"body1"},v))),s.map(function(e,t){var n="".concat(zn(e,m),"-").concat(t);return f.createElement(Ia,{key:n,rowMark:B,rowColor:H,columns:c,row:e,recomputeSubject:F,onTableRowClick:C,onRowAction:k,rowActions:g,payload:b,rowKey:m})}),s.length>0&&!v&&S&&!L&&!u&&p&&f.createElement(Ea,{columns:c,withRowActions:!!(null==g?void 0:g.length)},f.createElement(j,{className:D.noData,sx:{position:"sticky",left:0,width:O}},f.createElement(ye,{variant:"outlined",onClick:S},"Show More"))))},Pa=function(){var e=ea().width;return f.createElement(De,{sx:{width:"".concat(e,"px"),marginLeft:"-1px",marginTop:"-4px",zIndex:10}})},Aa=function(e){var t=e.className,n=e.style,r=e.sx,o=e.outlinePaper,i=e.transparentPaper,c=e.header,u=e.columns,s=e.data,d=e.errorMessage,m=e.hasMore,p=e.loading,v=e.rowActions,g=e.payload,b=e.rowKey,y=e.sort,E=e.minRowHeight,x=e.bufferSize,C=void 0===x?25:x,k=e.onButtonSkip,S=e.onClickHeaderColumn,L=e.onRowAction,N=e.onSkip,I=e.rowMark,M=e.rowColor,R=e.onTableRowClick,P=e.onRowClick,A=e.noDataLabel,T=e.recomputeSubject,D=e.scrollXSubject,j=e.scrollYSubject,O=Fr(g),F=Fr(function(){return e=new Map,{memoize:function(t,n){if(!e.has(t)){var r=n();return e.set(t,r),r}return e.get(t)},clear:function(){e.clear()}};var e}),_=_r(D),B=h(function(){return e=u.length,function(t){var n=Math.floor(t/e);return Math.max(n,165)};var e},[u]),H=h(function(){return u.map(function(e){var t=e.width,n=void 0===t?B:t,r=e.minWidth,o=void 0===r?0:r,i=l(e,["width","minWidth"]);return a({minWidth:o,width:function(e){var t="function"==typeof n?n(e):n,r="string"==typeof t?parseFloat(t):t,i="function"==typeof n?10:0;return Math.max(r-i,o)}},i)})},[u,B]);w(function(){if(T)return T.subscribe(function(){F.clear()})},[T,F]);var W=h(function(){return fi(function(e){_.next(e)},5)},[_]);return w(function(){return function(){W.clear()}},[W]),f.createElement(Ji,{constraintManager:F},f.createElement(ua,{value:e},f.createElement(va,null,f.createElement(aa,{outlinePaper:o,transparentPaper:i,className:t,header:c,style:n,sx:r},f.createElement(wa,{columns:H,sort:y,rowActions:v,onClickHeaderColumn:S,onScrollX:W,scrollXSubject:_}),!!p&&f.createElement(Pa,null),f.createElement(Ra,{recomputeSubject:T,noDataLabel:A,rowMark:I,rowColor:M,columns:H,data:s,errorMessage:d,hasMore:m,loading:p,rowActions:v,payload:O,rowKey:b,minRowHeight:E,bufferSize:C,onSkip:N,onTableRowClick:function(e,t){R?R(e,t):P&&P(t)},onRowAction:L,onButtonSkip:k,onScrollX:W,scrollXSubject:_,scrollYSubject:j})))))},Ta=function(r,o){var i=void 0===o?{}:o,a=i.onLoadStart,l=i.onLoadEnd,c=i.fallback,u=i.throwError,s=e(g(!1),2),d=s[0],f=s[1],m=e(g(!1),2),p=m[0],v=m[1],y=b(!0);E(function(){return function(){y.current=!1}},[]);var w=no(r),x=h(function(){return Kn(function(e){return t(void 0,void 0,void 0,function(){var t,r,o;return n(this,function(n){switch(n.label){case 0:t=!0,a&&a(),n.label=1;case 1:return n.trys.push([1,5,6,7]),(r=w(e))instanceof Promise?[4,r]:[3,3];case 2:return[2,n.sent()||null];case 3:return[2,r||null];case 4:return[3,7];case 5:throw o=n.sent(),t=!1,o;case 6:return l&&l(t),[7];case 7:return[2]}})})})},[]),C=h(function(){return function(e){return t(void 0,void 0,void 0,function(){var t,r;return n(this,function(n){switch(n.label){case 0:y.current&&f(!0),y.current&&v(!1),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,x(e)];case 2:return(t=n.sent())===Xn?[2,null]:[2,t];case 3:if(r=n.sent(),y.current&&v(!0),u)throw r;return c&&c(r),[3,5];case 4:return y.current&&f(!1),[7];case 5:return[2,null]}})})}},[]);return Object.assign(C,{clear:function(){x.clear()},cancel:function(){x.cancel()}}),{loading:d,error:p,execute:C}},Da=function(o){var i=o.reloadSubject,c=o.initialData,u=void 0===c?[]:c,s=o.handler,d=o.limit,f=void 0===d?25:d,m=o.delay,p=void 0===m?100:m,h=l(o,["reloadSubject","initialData","handler","limit","delay"]),v=_r(i),g=e(jr(u),2),b=g[0],E=g[1],x=e(jr(function(){return{data:b.current,prevOffset:-f-b.current.length,hasMore:!0}}),2),C=x[0],k=x[1],S=no(s),L=Ta(function(e){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,S(f,C.current.prevOffset+f+b.current.length,e,C.current.data)];case 1:return[2,t.sent()]}})})}).execute,N=ro(function(o){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return[4,L(o)];case 1:return(t=n.sent())?(k({prevOffset:C.current.prevOffset+f+b.current.length,data:o?t:r(r([],e(C.current.data),!1),e(t),!1),hasMore:t.length>=f}),[4,$n(p)]):[2];case 2:return n.sent(),[2]}})})},h),I=N.execute,M=N.loading,R=N.error;w(function(){return v.subscribe(function(){E([]),L.cancel(),I.clear(),k({data:[],hasMore:!0,prevOffset:-f}),I(!0)})},[]);var P=y(function(e){return k(function(t){return a(a({},t),{data:"function"==typeof e?e(t.data):e})})},[]),A=y(function(){E([]),L.cancel(),I.clear(),k({data:[],hasMore:!0,prevOffset:-f})},[]);return{data:C.current.data,setData:P,offset:C.current.prevOffset+f+b.current.length,hasMore:C.current.hasMore,loading:M,error:R,onSkip:I,reloadSubject:v,clear:A}},ja=function(o){var i=o.reloadSubject,c=o.initialData,u=void 0===c?[]:c,s=o.handler,d=o.delay,f=void 0===d?100:d,m=o.limit,p=void 0===m?25:m,v=l(o,["reloadSubject","initialData","handler","delay","limit"]),g=_r(i),b=e(jr(u),2),E=b[0],x=b[1],C=e(jr(function(){return{data:E.current,hasMore:!0}}),2),k=C[0],S=C[1],L=no(s),N=Ta(function(r){return t(void 0,void 0,void 0,function(){var t,o,i;return n(this,function(n){switch(n.label){case 0:return t=e(k.current.data.slice(-1),1),o=t[0],i=(void 0===o?{}:o).id,[4,L(void 0===i?null:i,r,p,k.current.data)];case 1:return[2,n.sent()]}})})}).execute,I=ro(function(o){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return N.cancel(),[4,N(o)];case 1:return(t=n.sent())?(S({data:o?t:r(r([],e(k.current.data),!1),e(t),!1),hasMore:t.length>=p}),[4,$n(f)]):[2];case 2:return n.sent(),[2]}})})},v),M=I.execute,R=I.loading,P=I.error;w(function(){return g.subscribe(function(){N.cancel(),M.clear(),x([]),S({data:[],hasMore:!0}),M(!0)})},[]);var A=h(function(){var t=e(k.current.data.slice(-1),1)[0],n=(void 0===t?{}:t).id;return void 0===n?null:n},[k.current.data]),T=y(function(e){return S(function(t){return a(a({},t),{data:"function"==typeof e?e(t.data):e})})},[]);return{data:k.current.data,setData:T,hasMore:k.current.hasMore,lastCursor:A,loading:R,error:P,onSkip:M,reloadSubject:g}},Oa=function(t){var n=void 0===t?{}:t,r=n.selectedRows,o=void 0===r?[]:r,i=n.onChange,a=e(g(o),2),l=a[0],c=a[1],u=y(function(){return c([])},[]);return Xr(function(){i&&i(l)},[l]),{selectedRows:l,gridProps:{selectedRows:l,onSelectedRows:function(e){return c(e)}},deselectAll:u,setSelectedRows:c}},Fa=function(e){var r=e.onLoadStart,o=e.onLoadEnd,i=e.throwError,a=e.fallback,l=e.fetchRow,c=e.onAction,u=e.onRowAction,s=e.onSelectionChange,d=e.selectedRows,f=Oa({onChange:s,selectedRows:d}),m=f.deselectAll,p=f.gridProps,h=f.selectedRows,v=Ti(function(e){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return c?[4,Promise.all(h.map(l))]:[3,3];case 1:return t=n.sent(),[4,c(e,t,m)];case 2:n.sent(),n.label=3;case 3:return[2]}})})},{onLoadStart:r,onLoadEnd:o,throwError:i,fallback:a}).execute,g=Ti(function(e){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return u?[4,u(e.action,e.row,m)]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}})})},{onLoadStart:r,onLoadEnd:o,throwError:i,fallback:a}).execute;return{deselectAll:m,selectedRows:h,gridProps:p,commitAction:v,commitRowAction:function(e,t){return g({action:e,row:t})}}},_a=p({modalStack:[],pop:function(){throw new Error("ModalManager no context provided")},push:function(){throw new Error("ModalManager no context provided")},clear:function(){throw new Error("ModalManager no context provided")}}),Ba=function(t){var n=t.render,r=t.onMount,o=t.onUnmount,i=t.count,a=t.modalStack,l=e(g(!1),2),c=l[0],u=l[1];return w(function(){return r&&r(i,a),u(!0),function(){o&&o(i,a)}},[]),c?f.createElement(f.Fragment,null,n()):null},Ha={key:Kr(),id:"unknown",render:function(){return null}},Wa={modalStack:[],count:0},za=Tn()({backdrop:{color:A("#000",.5),zIndex:1300}}),Va=new lr,Ya=function(o){var i=o.children,c=o.fallback,u=o.throwError,s=o.onLoadEnd,d=o.onLoadStart,m=za().classes,p=M(),v=e(g(Wa),2),b=v[0],E=b.modalStack,x=b.count,C=v[1],k=Vr(E),S=y(function(e){return C(function(t){var n=t.count;return{modalStack:e,count:0===e.length?0:n+1}})},[]),L=Ta(function(e){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return e?[4,e()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}})})},{onLoadStart:d,onLoadEnd:s,fallback:c,throwError:u}).execute,N=h(function(){return{modalStack:k.current,pop:function(){return S(k.current.slice(1))},push:function(o){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,L(o.onInit)];case 1:return t.sent(),S(r([a(a({},o),{key:Kr()})],e(k.current),!1)),[2]}})})},clear:function(){Va.next()}}},[E]);w(function(){return Va.subscribe(function(){C(Wa)})},[]);var I=h(function(){var t=e(E,1)[0],n=void 0===t?Ha:t,o=n.onInit,i=void 0===o?function(){}:o,c=n.onMount,u=void 0===c?function(){}:c,s=n.onUnmount,d=void 0===s?function(){}:s,f=l(n,["onInit","onMount","onUnmount"]);return a({onInit:function(){L(i)},onMount:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];L(function(){return u.apply(void 0,r([],e(t),!1))})},onUnmount:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];L(function(){return d.apply(void 0,r([],e(t),!1))})}},f)},[E]),A=h(function(){return R(a(a({},p),{components:a(a({},p.components),{MuiBackdrop:{styleOverrides:{root:{background:"transparent"}}}})}))},[p]),T=h(function(){return E.slice(1,E.length)},[E]);return f.createElement(_a.Provider,{value:N},i,f.createElement(P,{theme:A},f.createElement(Ba,a({},I,{modalStack:T,count:x}))),!!E.length&&f.createElement(je,{open:!0,className:m.backdrop}))},Ua=function(){var e=v(_a);return{total:e.modalStack.length,push:e.push,pop:e.pop,clear:e.clear}},qa=function(e){var t=e.data.label,n=e.isSelected;return f.createElement(f.Fragment,null,f.createElement(F,null,f.createElement(ve,{edge:"start",checked:n,tabIndex:-1,disableRipple:!0})),f.createElement(Oe,{primary:t}))},$a=function(e){var t=e.data.label,n=e.isSelected;return f.createElement(f.Fragment,null,f.createElement(F,null,f.createElement(Ce,{edge:"start",checked:n,tabIndex:-1,disableRipple:!0})),f.createElement(Oe,{primary:t}))},Xa=function(e){var t=e.data.label;return f.createElement(Oe,{primary:t})},Ga=function(e,t){for(var n,r,o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];var a=String(t||"").toLowerCase().split(" "),l=function(t){var n=String(e[t]||"").toLowerCase().split(" ");return a.every(function(e){return n.some(function(t){return t.includes(e)})})},u=!1;try{for(var s=c(o),d=s.next();!d.done;d=s.next()){var f=d.value;u=u||l(f)}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return u},Ka=function(e){return t(void 0,[e],void 0,function(e){var r,o,i=e.data,a=e.payload,l=e.itemList,c=e.tr,u=void 0===c?function(e){return e}:c;return n(this,function(e){switch(e.label){case 0:return"function"!=typeof l?[3,2]:[4,l(i,a)];case 1:return o=e.sent(),[3,3];case 2:o=l,e.label=3;case 3:return r=o,[4,Promise.all(r.map(function(e){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return t={id:e},[4,u(e,i,a)];case 1:return[2,(t.label=n.sent(),t)]}})})}))];case 4:return[2,e.sent()]}})})},Qa=function(e){return t(void 0,[e],void 0,function(e){var t,r=e.tip,o=e.searchText,i=e.data,a=e.payload;return n(this,function(e){switch(e.label){case 0:return"function"!=typeof r?[3,2]:[4,r(o,i,a)];case 1:return t=e.sent(),[3,3];case 2:t=r,e.label=3;case 3:return[2,t.map(function(e){return{id:e,label:e}})]}})})},Ja=Tn()(function(e,t){var n=t.height;return{root:{marginTop:"10px",marginLeft:"10px",marginRight:"10px",gap:e.spacing(1),height:"calc(min(50vh, 60dvh) - 20px)",width:"calc(100vw - 20px)",minHeight:"".concat(Math.floor(n/2)-20,"px"),maxWidth:"450px",display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column"},container:{position:"relative",overflow:"hidden",display:"flex",alignItems:"stretch",justifyContent:"stretch",flex:1},content:{flex:1},submit:{width:"calc(100% - 16px)",margin:"8px"},modal:{display:"flex",justifyContent:"center"}}}),Za=function(r){var o=r._autofocusDelay,i=void 0===o?650:o,l=r.type,c=r.data,u=r.payload,s=r.itemList,d=r.tip,m=r.tr,p=r.keepRaw,v=r.value,g=r.title,w=void 0===g?"Search":g,x=r.placeholder,C=r.onValueChange,k=Ja(window.screen).classes,S=yi(),L=S.elementRef,N=S.size,I=b(null),M=function(r){var o=r.data,i=r.type,l=r.payload,c=r.value,u=r.itemList,s=r.tip,d=r.tr,m=r.keepRaw,p=void 0!==m&&m,v=r.onValueChange,g=_r(),b=Ua().clear,w=e(jr(function(){return"string"==typeof c?c:""}),2),E=w[0],x=w[1],C=e(jr(function(){return Array.isArray(c)?c:[]}),2),k=C[0],S=C[1],L=no(function(){return t(void 0,void 0,void 0,function(){var e;return n(this,function(t){switch(t.label){case 0:return e=new Set,s?[4,Qa({tip:s,data:o,payload:l,searchText:E.current})]:[3,2];case 1:return[2,t.sent().filter(function(t){var n=t.id;return!e.has(n)})];case 2:return u?[4,Ka({data:o,payload:l,itemList:u,tr:d})]:[3,4];case 3:return[2,t.sent().filter(function(t){var n=t.id;return!e.has(n)})];case 4:return[2,[]]}})})}),N=y(function(){return i===jn.Items||i===jn.Combo?k.current.length?k.current:null:E.current},[]),I=Da({handler:function(){return t(void 0,void 0,void 0,function(){var e;return n(this,function(t){switch(t.label){case 0:return[4,L()];case 1:return e=t.sent(),s?[2,p?e:e.filter(function(e){return Ga(e,E.current,"label")})]:[2,e.filter(function(e){return Ga(e,E.current,"label")})]}})})},limit:1e4,reloadSubject:g}),M=I.data,R=I.hasMore,P=I.loading,A=I.onSkip,T=h(function(){return Zn(function(){g.next()},1e3)},[]),D=h(function(){return i===jn.Items?Li.Multiple:i===jn.Combo?Li.Single:Li.None},[]),j=h(function(){return i===jn.Complete?"":"No data"},[]),O=y(function(){v(N(),{skipReadonly:!0}),b()},[]);return{items:M,hasMore:R,loading:P,onSkip:A,selectionMode:D,reloadSubject:g,onItemClick:y(function(e){var t=e.data,n=e.toggleSelection;if(i===jn.Complete)return x(t.id),void O();n()},[]),onSelectedRows:y(function(e,t){t||S(e)},[]),renderItem:y(function(e){return i===jn.Items?f.createElement(qa,a({},e)):i===jn.Combo?f.createElement($a,a({},e)):f.createElement(Xa,a({},e))},[]),noDataLabel:j,searchText:E.current,selectedRows:k.current,setSearchText:y(function(e){x(e),T()},[]),beginSubmit:O,cancelSubmit:y(function(){b()},[])}}({type:l,data:c,payload:u,value:v,itemList:s,tip:d,keepRaw:p,tr:m,onValueChange:C}),R=M.items,P=M.hasMore,A=M.loading,T=M.onSkip,D=M.onItemClick,O=M.onSelectedRows,F=M.searchText,_=M.selectedRows,B=M.setSearchText,H=M.renderItem,W=M.selectionMode,z=M.beginSubmit,V=M.cancelSubmit,Y=M.noDataLabel;return E(function(){var e;null===(e=I.current)||void 0===e||e.focus(),setTimeout(function(){var e;null===(e=I.current)||void 0===e||e.focus()},i)},[]),f.createElement(Se,{className:k.modal,open:!0,onClose:V},f.createElement(ke,{className:k.root},f.createElement(xe,{value:F,inputRef:I,onChange:function(e){var t=e.target;return B(t.value)},onKeyDown:function(e){"Enter"===e.key?(e.preventDefault(),z()):"Escape"===e.key&&(e.preventDefault(),V())},size:"small",variant:"filled",autoFocus:!0,tabIndex:0,label:w,placeholder:x,InputProps:{autoFocus:!0,endAdornment:f.createElement(Le,{position:"end"},f.createElement(Ne,{edge:"end",onClick:V},f.createElement(Fe,null)))}}),f.createElement(j,{className:k.container,ref:L},f.createElement(Xi,{className:k.content,sx:{maxHeight:N.height,maxWidth:N.width},selectionMode:W,selectedRows:_,data:R,hasMore:P,loading:A,noDataLabel:Y,onSkip:T,onItemClick:D,onSelectedRows:O},H),f.createElement(Ci,{open:A})),f.createElement(si,{className:k.submit,size:"small",variant:"contained",color:"info",onClick:z},"Submit")))},el=function(e){return f.createElement(Za,a({},e))},tl=function(e){var t=Ua().push,n=Vr(e);return function(){t({id:"item-modal",render:function(){return f.createElement(el,a({},n.current))}})}},nl=function(){var e=K(function(e){return e.breakpoints.only("xs")}),t=K(function(e){return e.breakpoints.between("sm","lg")}),n=K(function(e){return e.breakpoints.up("lg")}),r=t||n,o=e;return h(function(){return{isPhone:e,isTablet:t,isDesktop:n,isWide:r,isMobile:o}},[r,o,e,t,n])},rl=p(null),ol=function(e){var t=e.children,n=l(e,["children"]);return f.createElement(rl.Provider,{value:n},t)},il=function(){return v(rl)},al=function(e,t){void 0===t&&(t=0);var n=b(!0),r=_r();return w(function(){n.current?n.current=!1:t?setTimeout(r.next,t):r.next()},e),w(function(){return function(){r.next()}},[]),y(function(){return new Promise(function(e){return r.once(function(){return e()})})},[])},ll=f.createElement(Be,{fontSize:"small"}),cl=f.createElement(_e,{fontSize:"small"}),ul=[],sl=function(e,t){return"number"==typeof e&&"number"==typeof t?e-t:"boolean"==typeof e&&"boolean"==typeof t?(e?1:0)-(t?1:0):"string"==typeof e&&"string"==typeof t?e.localeCompare(t):0},dl=function(t,n){if(Array.isArray(t)&&Array.isArray(n)){if(t.length!==n.length)return!1;var o=r([],e(t),!1).sort(sl),i=r([],e(n),!1).sort(sl);return o.every(function(e,t){return e===i[t]})}return!1},fl=f.createElement(ze,{fontSize:"small"}),ml=f.createElement(We,{fontSize:"small"}),pl=[],hl=Tn()(function(e){return{root:{height:72,display:"flex",flexWrap:"nowrap",whiteSpace:"nowrap",alignItems:"center",justifyContent:"stretch"},line:{background:A(e.palette.getContrastText(e.palette.background.default),.23),flexGrow:1,margin:15,height:1}}}),vl=function(){var t=p(null);return[function(n){var r=n.children,o=n.initialState,i=n.onChange,a=e(g(o),2),l=a[0],c=a[1];Xr(function(){i&&i(l)},[l]);var u=y(function(e){return c(e)},[]),s=h(function(){return[l,u]},[l,u]);return f.createElement(t.Provider,{value:s},r)},function(){return v(t)}]},gl=(Ui=e(vl(),2))[0],bl=Ui[1],yl=function(e,t){return Math.min(100,Math.round(Math.max(Number(e),0)/t*100))},wl=function(e,t,n){var r,o,i=void 0===n?{}:n,a=i.symbol,l=void 0===a?"0":a,u=i.allowed,s=i.replace;if(!e)return e;if(s){for(var d=e.split(""),f=0;f!==e.length;f++){var m=s(e[f])||null;null!==m&&(d[f]=m)}e=d.join("")}if(u){var p=new Set;if("function"==typeof u)for(f=0;f!==e.length;f++){u(e[f],f)||p.add(f)}else for(f=0;f!==e.length;f++){e[f].match(u)||p.add(f)}e=e.split("").filter(function(e,t){return!p.has(t)}).join("")}if(!t)return e;var h=0,v="";try{for(var g=c(t),b=g.next();!b.done;b=g.next()){var y=b.value;if(h===e.length)break;y===l||y===e[h]?(v+=e[h],h++):v+=y}}catch(e){r={error:e}}finally{try{b&&!b.done&&(o=g.return)&&o.call(g)}finally{if(r)throw r.error}}return v},El=Symbol("never-pos"),xl=function(e,t,n,r,o,i,l,c,u,s,d,m,p,h,v,g){return a(a(a({},n?{startAdornment:f.createElement(Le,{sx:{position:"relative"},position:"start"},f.createElement(Ne,{edge:"start",disabled:s,disableRipple:!v,tabIndex:l,onClick:function(){o&&o(m,e,t,function(e){return p(e,{skipReadonly:!0})},h)}},f.createElement(n,{data:e,payload:t,disabled:s,readonly:d})))}:{}),r&&!u?{endAdornment:f.createElement(Le,{sx:{position:"relative"},position:"end"},f.createElement(Ne,{edge:"end",disabled:s,disableRipple:!g,tabIndex:c,onClick:function(){i&&i(m,e,t,function(e){return p(e,{skipReadonly:!0})},h)}},f.createElement(r,{data:e,payload:t,disabled:s,readonly:d})))}:{}),u?{endAdornment:f.createElement(Le,{sx:{position:"relative"},position:"end"},f.createElement(Ne,{disabled:s,edge:"end"},f.createElement(O,{color:"inherit",size:20})))}:{})},Cl=function(e){var t=(new Date).getTimezoneOffset();return-1===Math.sign(t)?e.add(Math.abs(t)+60,"minutes"):e.subtract(Math.abs(t)+60,"minutes")},kl=function(e){var t=(new Date).getTimezoneOffset();return-1===Math.sign(t)?e.subtract(Math.abs(t)+60,"minutes"):e.add(Math.abs(t)+60,"minutes")},Sl=function(e){return void 0===e&&(e=Ue(0)),Ue(kl(e))},Ll=Tn()(function(e){return{toolbarBtn:{cursor:"pointer",color:e.palette.text.secondary},toolbarBtnSelected:{color:e.palette.text.primary}}}),Nl=function(e){var t,n=e.selected,r=void 0!==n&&n,o=e.className,i=void 0===o?"":o,c=e.label,u=void 0===c?"":c,s=l(e,["selected","className","label"]),d=Ll().classes;return f.createElement(_,a({className:xo(d.toolbarBtn,i,(t={},t[d.toolbarBtnSelected]=r,t))},s),u)},Il=Tn()(function(e){return{container:{maxHeight:320,overflowY:"auto",justifyContent:"center"},yearItem:{height:36,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",outline:"none",color:e.palette.text.primary},selectedYear:{fontSize:26,margin:"10px 0",color:e.palette.primary[500]},disabled:{pointerEvents:"none",color:e.palette.text.disabled}}}),Ml=function(e){var t=e.date,n=void 0===t?Ue():t,r=e.minDate,o=void 0===r?Ue():r,i=e.maxDate,a=void 0===i?Ue():i,l=e.onChange,c=void 0===l?function(e){return console.log({change:e})}:l,u=e.disableFuture,s=void 0!==u&&u,d=e.animateYearScrolling,m=void 0===d||d,p=Il().classes,h=b(null),v=n.get("year");E(function(){var e=h.current.getElementsByClassName(p.selectedYear)[0];e&&e.scrollIntoView({behavior:m?"smooth":"auto"})},[m]);var g=y(function(e){var t=n.clone().set("year",e);c(t)},[n,c]);return f.createElement("div",{ref:h,className:p.container},function(e,t){for(var n=t.diff(e,"years")+1,r=[],o=0;o!==n;o++)r.push(e.clone().add(o,"years"));return r}(o,a).map(function(e){var t,n=e.get("year"),r=xo(p.yearItem,((t={})[p.selectedYear]=n===v,t[p.disabled]=s&&e.isAfter(Ue()),t));return f.createElement("div",{role:"button",key:e.format("YYYY"),className:r,tabIndex:n,onClick:function(){return g(n)},onKeyPress:function(){return g(n)}},n)}))},Rl=Tn()(function(e){return{switchHeader:{display:"flex",justifyContent:"space-between",alignItems:"center",margin:"10px 0 20px"},daysHeader:{display:"flex",justifyContent:"stretch",alignItems:"stretch"},dayLabel:{flex:1,margin:"0 12px 0 12px",fontSize:13,textAlign:"center",color:e.palette.text.secondary},dayLabelStart:{textAlign:"start"},dayLabelEnd:{textAlign:"end"},monthName:{color:e.palette.text.primary}}}),Pl=function(t){var n=t.currentMonth,o=void 0===n?Ue():n,i=t.onMonthChange,a=void 0===i?function(e){return console.log({month:e})}:i,l=Rl().classes;return f.createElement("div",null,f.createElement("div",{className:l.switchHeader},f.createElement(Ne,{onClick:function(){return a(o.clone().subtract(1,"months"))}},f.createElement(Xe,null)),f.createElement("div",{className:l.monthName},o.format("MMMM YYYY")),f.createElement(Ne,{onClick:function(){return a(o.clone().add(1,"months"))}},f.createElement(Ge,null))),f.createElement("div",{className:l.daysHeader},function(){var t=Ue.Ls[Ue.locale()],n=t.weekdays,o=t.weekdaysMin,i=t.weekStart,a=void 0===i?0:i,l=o||n;return r(r([],e(l.slice(a,7)),!1),e(l.slice(0,a)),!1).map(function(e){return e.slice(0,1).toUpperCase()})}().map(function(e,t){var n;return f.createElement("div",{key:t,className:xo(l.dayLabel,(n={},n[l.dayLabelStart]=0===t,n[l.dayLabelEnd]=6===t,n))}," ",e," ")})))},Al=Tn()(function(e){return{calendar:{marginTop:10,display:"grid",gridTemplateColumns:"1fr repeat(5, 2fr) 1fr"},hidden:{opacity:0,pointerEvents:"none"},day:{width:36,height:36,fontSize:14,margin:"0 2px",color:e.palette.text.primary},selected:{color:e.palette.primary[700],backgroundColor:e.palette.primary[200]},disabled:{pointerEvents:"none",color:e.palette.text.disabled},active:{color:e.palette.primary.main,fontWeight:"bold"},cell:{display:"flex",alignItems:"center",justifyContent:"center","& :nth-of-type(7n)":{justifyContent:"flex-end"},"& :nth-of-type(7n + 1)":{justifyContent:"flex-start"}},container:{}}}),Tl=function(t){var n=t.onChange,r=void 0===n?function(e){return console.log({change:e})}:n,o=t.disableFuture,i=void 0!==o&&o,a=t.date,l=void 0===a?Ue():a,c=Al().classes,u=e(g(l.clone().startOf("month")),2),s=u[0],d=u[1],m=y(function(e){var t=e.clone().endOf("week"),n=s.get("month");return function(e,t){for(var n=t.diff(e,"days")+1,r=[],o=0;o!==n;o++)r.push(e.clone().add(o,"days"));return r}(e,t).map(function(e){var t,r=xo(c.day,c.cell,((t={})[c.hidden]=e.get("month")!==n,t[c.selected]=e.toString()===l.toString(),t[c.disabled]=i&&e.isAfter(Ue()),t[c.active]=l.isSame(e,"date"),t));return f.createElement(Ne,{key:e.toString(),className:r,onClick:function(){return h(e)}},f.createElement("span",null," ",e.format("DD")," "))})},[i,c,l,s]),p=y(function(){return function(e,t){for(var n=t.diff(e,"weeks")+1,r=[],o=0;o!==n;o++)r.push(e.clone().add(o,"weeks"));return r}(s.clone().startOf("week"),s.clone().endOf("month").endOf("week")).map(function(e){return f.createElement(k,{key:"week-".concat(e.toString())},m(e))})},[s]),h=function(e){return r(e)};return f.createElement("div",{className:c.container},f.createElement(Pl,{currentMonth:s,onMonthChange:function(e){return d(e)}}),f.createElement("div",{className:c.calendar},p()))},Dl=Tn()(function(e){return{container:{width:300,height:420},toolbar:{backgroundColor:e.palette.primary.main,display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"center",height:100}}}),jl=function(t){var n=t.date,r=void 0===n?Ue():n,o=t.minDate,i=void 0===o?Sl():o,a=t.maxDate,l=void 0===a?new Date(4102434e6):a,c=t.onChange,u=void 0===c?function(e){return console.log({change:e})}:c,s=t.disableFuture,d=void 0!==s&&s,m=t.animateYearScrolling,p=void 0===m||m,h=t.openToYearSelection,v=void 0!==h&&h,b=e(g(r),2),y=b[0],w=b[1],E=e(g(v),2),x=E[0],C=E[1],k=Dl().classes,S=y.startOf("day"),L=function(e){w(e),u(e)};return f.createElement("div",{className:k.container},f.createElement($e,{className:k.toolbar},f.createElement(Nl,{type:"subheading",onClick:function(){return C(!0)},selected:x,label:y.format("YYYY")}),f.createElement(Nl,{type:"display1",onClick:function(){return C(!1)},selected:!x,label:y.format("ddd, MMM DD")})),x?f.createElement(Ml,{date:S,onChange:function(e){C(!1),L(e)},minDate:Ue(i),maxDate:Ue(l),disableFuture:d,animateYearScrolling:p}):f.createElement(Tl,{date:S,onChange:L,disableFuture:d}))},Ol="DD/MM/YYYY",Fl="HH:MM",_l=/(?:\d\d\/\d\d\/\d\d\d\d)/g,Bl=/(?:\d\d:\d\d)/g,Hl=function(){function e(e,t){var n=this;this.hour=e,this.minute=t,this.toString=function(){return Ul(n)},this.toStamp=function(){return 60*n.hour+n.minute}}return Object.defineProperty(e.prototype,"isValid",{get:function(){var e=Sl();return(e=(e=e.set("hour",this.hour)).set("minute",this.minute)).isValid()},enumerable:!1,configurable:!0}),e.fromStamp=function(t){if(null===t)return null;var n=Sl().set("hour",0).set("minute",0).add(t,"minute");return new e(n.get("hour"),n.get("minute"))},e}(),Wl=function(){function e(e,t,n){var r=this;this.day=e,this.month=t,this.year=n,this.toString=function(){return Vl(r)},this.toStamp=function(){var e=Sl(),t=Sl().set("hour",0);return(t=(t=(t=t.set("date",r.day)).set("month",r.month-1)).set("year",r.year)).isValid()?Math.max(Math.floor(t.diff(e,"day",!0)),-1):-1}}return Object.defineProperty(e.prototype,"isValid",{get:function(){var e=Sl();return(e=(e=(e=e.set("date",this.day)).set("month",this.month-1)).set("year",this.year)).isValid()},enumerable:!1,configurable:!0}),e.fromStamp=function(t){if(null===t)return null;var n=Sl().add(t,"days").toDate();return new e(n.getDate(),n.getMonth()+1,n.getFullYear())},e}(),zl=function(t){if(!t)return null;if("string"!=typeof t)return null;var n=e(t.split("/"),3),r=n[0],o=void 0===r?"":r,i=n[1],a=void 0===i?"":i,l=n[2],c=void 0===l?"":l;if(2===o.length&&2===a.length&&4===c.length){var u=parseInt(o,10),s=parseInt(a,10),d=parseInt(c,10);return Number.isNaN(u)||Number.isNaN(s)||Number.isNaN(d)?null:new Wl(u,s,d)}return null},Vl=function(e){var t="",n="",r="";return e instanceof Wl?(t=e.day.toString(),n=e.month.toString(),r=e.year.toString(),t=1===t.length?"0"+t:t,n=1===n.length?"0"+n:n,"".concat(t,"/").concat(n,"/").concat(r)):null},Yl=function(t){if(!t)return null;if("string"!=typeof t)return null;var n=e(t.split(":"),2),r=n[0],o=n[1];if(r&&o){var i=parseInt(r),a=parseInt(o);return isNaN(i)||isNaN(a)?null:new Hl(i,a)}return null},Ul=function(e){var t="",n="";return e instanceof Hl?(t=e.hour.toString(),n=e.minute.toString(),t=1===t.length?"0"+t:t,n=1===n.length?"0"+n:n,"".concat(t,":").concat(n)):null},ql=function(){var e=new window.Date,t=new Wl(e.getDate(),e.getMonth()+1,e.getFullYear());return Vl(t)},$l=function(){var e=new window.Date,t=new Hl(e.getHours(),e.getMinutes());return Ul(t)},Xl=function(e){void 0===e&&(e=$l());var t=Yl(e);return t?t.toStamp():-1},Gl=function(e){void 0===e&&(e=ql());var t=zl(e);return t?t.toStamp():-1},Kl=Object.freeze({__proto__:null,DATE_PLACEHOLDER:Ol,TIME_PLACEHOLDER:Fl,DATE_EXPR:_l,TIME_EXPR:Bl,Time:Hl,Date:Wl,parseDate:zl,serializeDate:Vl,parseTime:Yl,serializeTime:Ul,currentDate:ql,currentTime:$l,timeStamp:Xl,dateStamp:Gl}),Ql="##/##/####",Jl=Symbol("never-pos"),Zl=Tn()(function(e,t){var n=t.size;return{root:{display:"inline-flex",alignItems:"stretch",justifyContent:"stretch",height:n,width:n},container:{position:"relative",height:n,width:n,flex:1},icon:{position:"absolute",height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center",top:0,left:0,right:0,bottom:0,zIndex:1},spinner:{position:"absolute",height:"100%",width:"100%",top:0,left:0,right:0,bottom:0,zIndex:0}}}),ec=function(r){var o=r.className,i=r.style,c=r.sx,u=r.noProgress,s=void 0!==u&&u,d=r.throwError,m=void 0!==d&&d,p=r.disabled,h=void 0!==p&&p,v=r.onLoadStart,y=r.onLoadEnd,w=r.onClick,x=void 0===w?function(){}:w,C=r.fallback,k=r.children,S=r.size,L=void 0===S?40:S,N=r.thickness,I=void 0===N?3.6:N,M=l(r,["className","style","sx","noProgress","throwError","disabled","onLoadStart","onLoadEnd","onClick","fallback","children","size","thickness"]),R=Zl({size:L,thickness:I}).classes,P=e(g(0),2),A=P[0],T=P[1],D=b(!0);E(function(){return function(){D.current=!1}},[]);var F=Vr(A);return f.createElement(j,{className:xo(o,R.root),style:i,sx:c},f.createElement(Ne,a({},M,{className:R.container,disabled:!!A||h,onClick:function(e){return t(void 0,void 0,void 0,function(){var t,r;return n(this,function(n){switch(n.label){case 0:if(F.current)return[2];t=!0,n.label=1;case 1:return n.trys.push([1,3,4,5]),v&&v(),D.current&&T(function(e){return e+1}),[4,x(e)];case 2:return n.sent(),[3,5];case 3:if(r=n.sent(),t=!1,m)throw r;return C&&C(r),[3,5];case 4:return y&&y(t),D.current&&T(function(e){return e-1}),[7];case 5:return[2]}})})}}),!!A&&!s&&f.createElement("div",{className:R.spinner},f.createElement(O,{size:L,thickness:I})),f.createElement(j,{className:R.icon},k)))},tc=Tn()(function(e){return{root:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},container:{display:"flex",alignItems:"stretch",justifyContent:"stretch",borderRadius:"50%"},backgroundPrimary:{background:e.palette.primary.main},backgroundSecondary:{background:e.palette.secondary.main},backgroundError:{background:e.palette.error.main},backgroundInfo:{background:e.palette.info.main},backgroundSuccess:{background:e.palette.success.main},backgroundWarning:{background:e.palette.warning.main}}}),nc="hours",rc="minutes",oc={x:130,y:130},ic=oc.x-oc.x,ac=0-oc.y,lc=function(e,t,n){var r=t-oc.x,o=n-oc.y,i=Math.atan2(ic,ac)-Math.atan2(r,o),a=57.29577951308232*i;return a=Math.round(a/e)*e,a%=360,Math.floor(a/e)||0},cc=Tn()(function(e){return{pointer:{width:2,backgroundColor:e.palette.primary.main,height:"40%",position:"absolute",left:"calc(50% - 1px)",bottom:"50%",transformOrigin:"center bottom 0px"},thumb:{width:4,height:4,backgroundColor:e.palette.primary.main,borderRadius:"100%",position:"absolute",top:-21,left:-15,border:"14px solid ".concat(e.palette.primary.main),boxSizing:"content-box"},noPoint:{backgroundColor:e.palette.primary.main}}}),uc=function(e){var t,n=e.hasSelected,r=void 0!==n&&n,o=e.value,i=void 0===o?0:o,a=e.max,l=void 0===a?0:a,c=cc().classes,u=y(function(){return{transform:"rotateZ(".concat(360/l*i,"deg)")}},[i,l]);return f.createElement("div",{className:c.pointer,style:u()},f.createElement("div",{className:xo(c.thumb,(t={},t[c.noPoint]=r,t))}))},sc=Tn()({container:{display:"flex",justifyContent:"center",alignItems:"flex-end",marginTop:40},clock:{backgroundColor:"rgba(0,0,0,.07)",borderRadius:"50%",height:260,width:260,position:"relative",pointerEvents:"none",userSelect:"none",cursor:"pointer"},squareMask:{width:"100%",height:"100%",position:"absolute",pointerEvents:"auto",touchAction:"none"}}),dc=new function(){var t=this;this.lastOffsetX=0,this.lastOffsetY=0,this.toMouseEvent=function(n){var r=n.target,o=n.targetTouches,i=r.getBoundingClientRect(),a=i.left,l=i.top,c=window.scrollX,u=window.scrollY,s=e(o,1)[0];if(s){var d=s.pageX,f=s.pageY;t.lastOffsetX=d-c-a,t.lastOffsetY=f-u-l}return{offsetX:t.lastOffsetX,offsetY:t.lastOffsetY}}},fc=function(e){var t=e.type,n=void 0===t?"":t,r=e.value,o=void 0===r?0:r,i=e.children,a=e.onChange,l=void 0===a?function(e){return console.log({value:e})}:a,c=sc().classes,u=function(e){var t,r,o,i=n===rc?(t=e.offsetX,r=e.offsetY,void 0===o&&(o=6),lc(o,t,r)):function(e,t){return(lc(30,e,t)||12)%12}(e.offsetX,e.offsetY);l(i)};return f.createElement("div",{className:c.container},f.createElement("div",{className:c.clock},f.createElement("div",{className:c.squareMask,onMouseMove:function(e){e.preventDefault(),1===e.buttons&&u(e.nativeEvent)},onTouchMove:function(e){return e.stopPropagation(),u(dc.toMouseEvent(e)),!0}}),f.createElement(uc,{max:n===nc?12:60,hasSelected:n===nc||o%5==0,value:o}),i))},mc=[[0,5],[55,19.6],[94.4,59.5],[109,114],[94.4,168.5],[54.5,208.4],[0,223],[-54.5,208.4],[-94.4,168.5],[-109,114],[-94.4,59.5],[-54.5,19.6]],pc=Tn()(function(e){return{clockNumber:{width:32,height:32,position:"absolute",left:"calc(50% - 16px)",display:"inline-flex",justifyContent:"center",alignItems:"center",borderRadius:"50%",pointerEvents:"all",color:e.palette.text.primary},selected:{color:e.palette.getContrastText(e.palette.text.primary)}}}),hc=function(e){var t,n=e.selected,r=void 0!==n&&n,o=e.label,i=void 0===o?"":o,c=e.index,u=void 0===c?0:c,s=l(e,["selected","label","index"]),d=pc().classes,m=xo(d.clockNumber,((t={})[d.selected]=r,t));return f.createElement("div",a({className:m,style:function(e){var t=mc[e];return{transform:"translate(".concat(t[0],"px, ").concat(t[1],"px")}}(u)},s),i)},vc=function(e){var t=e.date,n=void 0===t?Ue():t,r=e.onChange,o=void 0===r?function(e){return console.log({change:e})}:r,i=function(e){var t=n.clone().hour(e);o(t)},a=n.get("hours"),l=Number(n.format("hh"));return f.createElement(fc,{type:nc,onChange:i,value:a},f.createElement(hc,{onClick:function(){return i(12)},label:"12",selected:12===l,index:0}),f.createElement(hc,{onClick:function(){return i(1)},label:"1",selected:1===l,index:1}),f.createElement(hc,{onClick:function(){return i(2)},label:"2",selected:2===l,index:2}),f.createElement(hc,{onClick:function(){return i(3)},label:"3",selected:3===l,index:3}),f.createElement(hc,{onClick:function(){return i(4)},label:"4",selected:4===l,index:4}),f.createElement(hc,{onClick:function(){return i(5)},label:"5",selected:5===l,index:5}),f.createElement(hc,{onClick:function(){return i(6)},label:"6",selected:6===l,index:6}),f.createElement(hc,{onClick:function(){return i(7)},label:"7",selected:7===l,index:7}),f.createElement(hc,{onClick:function(){return i(8)},label:"8",selected:8===l,index:8}),f.createElement(hc,{onClick:function(){return i(9)},label:"9",selected:9===l,index:9}),f.createElement(hc,{onClick:function(){return i(10)},label:"10",selected:10===l,index:10}),f.createElement(hc,{onClick:function(){return i(11)},label:"11",selected:11===l,index:11}))},gc=function(e){var t=e.onChange,n=void 0===t?function(e){return console.log({change:e})}:t,r=e.date,o=void 0===r?Ue():r,i=o.get("minutes"),a=function(e){var t=o.clone().minute(e);n(t)};return f.createElement(fc,{type:rc,onChange:a,value:i},f.createElement(hc,{onClick:function(){return a(0)},label:"00",selected:0===i,index:0}),f.createElement(hc,{onClick:function(){return a(5)},label:"05",selected:5===i,index:1}),f.createElement(hc,{onClick:function(){return a(10)},label:"10",selected:10===i,index:2}),f.createElement(hc,{onClick:function(){return a(15)},label:"15",selected:15===i,index:3}),f.createElement(hc,{onClick:function(){return a(20)},label:"20",selected:20===i,index:4}),f.createElement(hc,{onClick:function(){return a(25)},label:"25",selected:25===i,index:5}),f.createElement(hc,{onClick:function(){return a(30)},label:"30",selected:30===i,index:6}),f.createElement(hc,{onClick:function(){return a(35)},label:"35",selected:35===i,index:7}),f.createElement(hc,{onClick:function(){return a(40)},label:"40",selected:40===i,index:8}),f.createElement(hc,{onClick:function(){return a(45)},label:"45",selected:45===i,index:9}),f.createElement(hc,{onClick:function(){return a(50)},label:"50",selected:50===i,index:10}),f.createElement(hc,{onClick:function(){return a(55)},label:"55",selected:55===i,index:11}))},bc=function(e){return{container:{width:300,height:420},toolbar:{display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"center",backgroundColor:e.palette.primary.main,height:100}}},yc=Tn()(function(e){return a(a({},bc(e)),{toolbar:a(a({},bc(e).toolbar),{flexDirection:"row",alignItems:"center",paddingLeft:50}),separator:{margin:"0 2px 0 4px",cursor:"default"},ampmSelection:{marginLeft:20,marginRight:-20},ampmLabel:{fontSize:18}})}),wc=function(t){var n=t.onChange,r=void 0===n?function(e){return console.log({change:e})}:n,o=t.date,i=void 0===o?Ue():o,l=e(g(i),2),c=l[0],u=l[1],s=yc().classes,d=e(g({meridiemMode:c.format("a"),isHourViewShown:!0}),2),m=d[0],p=d[1],h=y(function(e){if(e.format("a")!==m.meridiemMode){var t="am"===m.meridiemMode?e.hour()-12:e.hour()+12;e=e.clone().hour(t)}u(e),r(e)},[m]),v=function(e){return function(){return p(function(t){return a(a({},t),{meridiemMode:e})})}};w(function(){return h(c)},[m.meridiemMode]);return f.createElement("div",{className:s.container},f.createElement($e,{className:s.toolbar},f.createElement(Nl,{type:"display3",onClick:function(){return p(function(e){return a(a({},e),{isHourViewShown:!0})})},selected:m.isHourViewShown,label:"am"===m.meridiemMode?c.format("hh"):c.format("HH")}),f.createElement(Nl,{type:"display3",label:":",selected:!1,className:s.separator}),f.createElement(Nl,{type:"display3",onClick:function(){return p(function(e){return a(a({},e),{isHourViewShown:!1})})},selected:!m.isHourViewShown,label:c.format("mm")}),f.createElement("div",{className:s.ampmSelection},f.createElement(Nl,{className:s.ampmLabel,selected:"am"===m.meridiemMode,type:"subheading",label:"AM",onClick:v("am")}),f.createElement(Nl,{className:s.ampmLabel,selected:"pm"===m.meridiemMode,type:"subheading",label:"PM",onClick:v("pm")}))),m.isHourViewShown?f.createElement(vc,{date:c,onChange:h}):f.createElement(gc,{date:c,onChange:h}))},Ec="##:##",xc=Symbol("never-pos"),Cc=Tn()(function(e){return{switchBase:{color:"".concat(e.palette.primary.main," !important")},checked:{color:"".concat(e.palette.primary.main," !important")},track:{background:"".concat($(e.palette.primary.main,.4)," !important")}}}),kc=function(e,t,n,r,o,i,a,l,c,u,s,d){return f.createElement(Ne,{disableRipple:!d,tabIndex:u,onClick:function(){c&&c(i,t,n,function(e){return l(e,{skipReadonly:!0})},a)},edge:s},f.createElement(e,{data:t,payload:n,disabled:r,readonly:o}))},Sc=function(r,o){void 0===o&&(o={});var i=e(jr(null),2),a=i[0],l=i[1],c=Ti(function(){return t(void 0,void 0,void 0,function(){var e;return n(this,function(t){switch(t.label){case 0:return[4,r()];case 1:return e=t.sent(),l(e),[2]}})})},o),u=o.deps;w(function(){c.execute()},void 0===u?[]:u);var s=y(function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return a.current?[3,2]:[4,$n(250)];case 1:return e.sent(),[3,0];case 2:return[2,a.current]}})})},[]);return[a.current,c,l,{waitForResult:s,data$:a}]},Lc=function(e){return new Promise(function(t){var n=document.createElement("input");n.setAttribute("type","file"),n.style.display="none",e&&(n.accept=e),document.body.appendChild(n);var r=!0;n.onchange=function(){document.body.contains(n)&&document.body.removeChild(n),r=!1;var e=n.files;(null==e?void 0:e.length)&&(t(e[0]),n.value="")},new Promise(function(e){var t=function(){document.removeEventListener("mousemove",t),document.removeEventListener("touchmove",t),e()};$n(1e3).then(function(){document.addEventListener("mousemove",t),document.addEventListener("touchmove",t)})}).then(function(){setTimeout(function(){r&&(document.body.contains(n)&&document.body.removeChild(n),t(null))},1e3)}),n.click()})},Nc=[],Ic=function(e,r,o,i){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return Array.isArray(e)?[4,Promise.all(e.map(function(e){return r(e,o,i)}))]:[3,2];case 1:case 3:return[2,t.sent()];case 2:return e?[4,r(e,o,i)]:[3,4];case 4:return[2,null]}})})},Mc=Symbol("never-pos"),Rc=f.createElement(Be,{fontSize:"small"}),Pc=f.createElement(_e,{fontSize:"small"}),Ac=["Yes","No"],Tc=Tn()({item:{whiteSpace:"break-spaces"}}),Dc=function(e){var t=e.value,n=e.label,r=Tc().classes;return f.createElement(B,{className:r.item,key:t,value:t},n)},jc=Tn()({item:{whiteSpace:"break-spaces"}}),Oc=function(){var e=jc().classes;return f.createElement(B,{className:e.item},"Create item")},Fc=Tn()(function(e){return{listHeader:{background:"transparent",paddingTop:e.spacing(1.5)}}}),_c=function(e){var t=e.type,n=e.mode,r=e.pattern,o=e.getValue,i=e.loading,a=e.placeholder,l=e.autoComplete,c=e.onTextChange,u=e.reloadSubject,s=Fc().classes,d=b(null);w(function(){return u.subscribe(function(){var e=d.current;e&&(e.focus(),e.value=o())})},[]),w(function(){var e=d.current;!i&&e&&(e.focus(),e.value=o())},[i]);var m=h(function(){return Zn(function(e){c(e.target.value)},1500)},[]);w(function(){return function(){m.flush()}},[]);var p=y(function(e){"Escape"!==e.key&&e.stopPropagation()},[]);return f.createElement(rt,{className:s.listHeader},f.createElement(xe,{inputRef:d,type:t,variant:"standard",autoFocus:!0,fullWidth:!0,disabled:i,defaultValue:o,autoComplete:l,placeholder:a,inputProps:{pattern:r},InputProps:{inputMode:n,startAdornment:f.createElement(Le,{position:"start"},f.createElement(ot,null)),endAdornment:f.createElement(Le,{position:"end"},f.createElement(Ne,{disabled:i,onClick:function(){c("")}},i?f.createElement(O,{size:24}):f.createElement(Fe,null)))},onChange:m,onKeyDown:p,sx:{mb:1}}))},Bc="react-declarative__searchViewRoot",Hc=Tn()({root:{display:"flex",flexDirection:"column",alignItems:"stretch",justifyContent:"stretch",height:360,width:"100%"},item:{whiteSpace:"break-spaces"},stretch:{display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *:nth-of-type(1)":{flex:1}}}),Wc=function(t){var n=t.value,r=t.items,o=t.item,i=t.payload,a=t.loading,l=t.hasMore,c=t.SearchItem,u=t.CreateButton,s=t.onItemChange,d=t.onDataRequest,m=t.onCreate,p=t.onLoadStart,h=t.onLoadEnd,v=t.fallback,w=t.throwError,x=Hc().classes,C=b(null),k=e(g(""),2),S=k[0],L=k[1],N=e(g(0),2),I=N[0],M=N[1],R=y(function(){M(function(e){return e+1}),p&&p()},[]),P=y(function(e){M(function(e){return e-1}),h&&h(e)},[]),A=a||!!I;E(function(){var e=C.current,t=null==e?void 0:e.closest(".".concat(Bc)),n=null==t?void 0:t.querySelector("input");L((null==n?void 0:n.value)||"")},[A]);var T=y(function(){return!A&&m||o||r.length?null:f.createElement(B,{className:x.item,disabled:!0},A?"Loading":"Nothing found")},[o,r,A,m]),D=y(function(){return m&&S?o||r.length||A?null:f.createElement("div",{className:x.stretch,onClick:function(){m(S)}},f.createElement(u,{payload:i,search:S})):null},[o,r,A,S,m]);return f.createElement(j,{ref:C,p:1},f.createElement(gi,{key:"".concat(n,"-").concat(null==o?void 0:o.value),className:x.root,onDataRequest:d,onLoadStart:R,onLoadEnd:P,fallback:v,throwError:w,loading:A,hasMore:l,minRowHeight:45,bufferSize:25},o&&f.createElement("div",{className:x.stretch},f.createElement(c,{disabled:!0,payload:i,data:o.data,label:o.label,value:o.value})),T(),r.filter(function(e){return e.value!==(null==o?void 0:o.value)}).map(function(e){return f.createElement("div",{className:x.stretch,onClick:function(){return s(e)},key:e.value},f.createElement(c,{disabled:!1,payload:i,data:e.data,label:e.label,value:e.value}))}),D()))},zc=Tn()({root:{minHeight:425,minWidth:290,maxHeight:"45vh",overflowY:"auto",overflowX:"hidden"}}),Vc=function(r){var o=r.className,i=r.style,c=r.sx,u=r.type,s=void 0===u?"text":u,d=r.mode,m=void 0===d?"text":d;r.variant;var p=r.pattern,v=r.value,E=r.label,x=r.placeholder,C=r.searchText,k=r.changeSubject,S=r.onChange,L=void 0===S?function(){}:S,N=r.onTextChange,I=void 0===N?function(){}:N,M=r.delay,R=void 0===M?500:M,P=r.limit,A=void 0===P?25:P,T=r.payload,D=void 0===T?{}:T,O=r.autoComplete;r.fullWidth;var F=r.disabled,_=r.onCreate,B=r.onLoadStart,H=r.onLoadEnd,W=r.fallback,z=r.handler,V=r.inputRef,Y=r.SearchItem,U=void 0===Y?Dc:Y,q=r.SearchInput,$=void 0===q?_c:q,X=r.CreateButton,G=void 0===X?Oc:X,K=r.startAdornment,Q=void 0===K?null:K,J=r.endAdornment,Z=void 0===J?null:J,ee=r.throwError,te=l(r,["className","style","sx","type","mode","variant","pattern","value","label","placeholder","searchText","changeSubject","onChange","onTextChange","delay","limit","payload","autoComplete","fullWidth","disabled","onCreate","onLoadStart","onLoadEnd","fallback","handler","inputRef","SearchItem","SearchInput","CreateButton","startAdornment","endAdornment","throwError"]),ne=zc().classes,re=_r(),oe=b(null),ie=Fr(D),ae=e(jr(!1),2),le=ae[0],ce=ae[1],ue=e(g(function(){return{item:null,open:!1,value:""}}),2),se=ue[0],de=ue[1],fe=_r(k),me=Vr(se.value),pe=no(L),he=no(I),ve=Ta(function(){return t(void 0,void 0,void 0,function(){var e,t,r;return n(this,function(n){switch(n.label){case 0:return e={value:"",item:null,open:!1},v?"function"!=typeof v?[3,2]:[4,v()]:[3,3];case 1:return t=n.sent(),Object.assign(e,{item:t}),[3,3];case 2:v&&Object.assign(e,{item:v}),n.label=3;case 3:return C?"function"!=typeof C?[3,5]:[4,C()]:[3,6];case 4:return r=n.sent(),Object.assign(e,{value:r}),[3,6];case 5:C&&Object.assign(e,{value:C}),n.label=6;case 6:return de(e),ce(!0),[2]}})})},{onLoadStart:B,onLoadEnd:H,fallback:W,throwError:ee}).execute;w(function(){ve()},[]),w(function(){return fe.subscribe(function(){le.current&&(ce(!1),ve())})},[]);var ge=Da({reloadSubject:re,handler:function(e,r,o,i){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,z(me.current,e,r,o,i)];case 1:return[2,t.sent()]}})})},onLoadStart:B,onLoadEnd:H,fallback:W,throwError:ee,delay:R,limit:A}),be=ge.data,ye=ge.hasMore,we=ge.loading,Ee=ge.onSkip,Ce=ge.clear,ke=h(function(){var e,t=new Set([(null===(e=se.item)||void 0===e?void 0:e.value)||""]);return be.filter(function(e){var n=!t.has(e.value);return t.add(e.value),n})},[be,se.item]);Xr(function(){le.current&&(re.next(),he(se.value))},[se.value]),Xr(function(){var e;le.current&&(re.next(),pe(se.item),he((null===(e=se.item)||void 0===e?void 0:e.label)||""))},[se.item]);var Se=y(function(e){return de(function(t){return a(a({},t),{open:e})})},[]),Ie=y(function(e){return de(function(t){return a(a({},t),{value:e,item:null})})},[]),Me=y(function(e){return de(function(t){return a(a({},t),{value:e.label,open:!1,item:e})})},[]),Re=y(function(){return de(function(){return{open:!1,value:"",item:null}})},[]),Pe=no(function(){var e;return(null===(e=se.item)||void 0===e?void 0:e.label)||se.value||""}),Ae=Pe();return f.createElement(j,{ref:oe,onContextMenu:function(){return Se(!1)},className:o,style:i,sx:c},f.createElement(xe,a({},te,{fullWidth:!0,key:Ae,focused:!1,autoComplete:O,type:s,label:E,placeholder:x,ref:V,onClick:function(){return Se(!0)},value:Ae,disabled:F||!le.current,inputProps:{pattern:p},InputProps:{inputMode:m,readOnly:!0,startAdornment:Q?f.createElement(Le,{position:"start"},Q):void 0,endAdornment:f.createElement(Le,{sx:{display:se.item||Z?void 0:"none"},position:"end"},se.item?f.createElement(Ne,{size:"small",onClick:function(e){e.stopPropagation(),Re()},edge:"end"},f.createElement(Fe,null)):Z)}})),f.createElement(qe,{className:Bc,anchorEl:oe.current,open:se.open,onClose:function(){Ce(),Se(!1)}},f.createElement("div",{className:ne.root},se.open&&f.createElement($,{type:s,mode:m,pattern:p,placeholder:E||x,autoComplete:O,reloadSubject:re,loading:we,getValue:Pe,onTextChange:Ie}),se.open&&f.createElement(Wc,{items:ke,value:se.value,payload:ie,item:se.item,hasMore:ye,loading:we,onDataRequest:Ee,onLoadStart:B,onLoadEnd:H,fallback:W,throwError:ee,SearchItem:U,CreateButton:G,onItemChange:Me,onCreate:_?function(e){_(e),Se(!1)}:void 0}))))},Yc=function(){return null},Uc=function(){return null},qc=function(){throw new Error("react-declarative DictField dictValue callback is not provided")},$c=function(){throw new Error("react-declarative DictField dictSearch callback is not provided")},Xc=function(){return""},Gc=Symbol("never-pos"),Kc=function(e,t,n,r,o,i,a,l,c,u,s,d){return f.createElement(Ne,{disableRipple:!d,tabIndex:u,onClick:function(){c&&c(i,t,n,function(e){return l(e,{skipReadonly:!0})},a)},edge:s},f.createElement(e,{data:t,payload:n,disabled:r,readonly:o}))},Qc=f.createElement(ze,{fontSize:"small"}),Jc=f.createElement(We,{fontSize:"small"}),Zc=Tn()(function(e){return{ul:{listStyleType:"none",padding:0,"& > *:not(:first-of-type)":{marginLeft:"32px"}},li:{paddingBottom:"6px",paddingLeft:"16px",paddingRight:"16px"},listItem:{"&:hover":{background:"transparent !important"}},hidden:{display:"none"},icons:{fill:e.palette.action.active}}}),eu=function(t){var n=t.className,o=t.style,i=t.sx,c=t.disabled,u=t.loading,s=t.readOnly,d=t.items,m=void 0===d?[]:d,p=t.value,v=void 0===p?[]:p,y=t.onChange,E=void 0===y?function(){}:y,x=l(t,["className","style","sx","disabled","loading","readOnly","items","value","onChange"]),C=Zc().classes,k=b(!1),S=e(jr(v||[]),2),L=S[0],N=S[1],I=e(g(!1),2),M=I[0],R=I[1];Xr(function(){k.current=!0,N(v||[])},[v]);var P=Jr(),A=P.reloadTrigger,T=P.doReload,D=Gr(L.current);Xr(function(){k.current?k.current=!1:L.current.length?E(L.current):E(null)},[L.current]),w(function(){if(M){var e=D.once(function(){var t=Zn(function(e){var t=e.clientX,n=e.clientY,r=document.elementFromPoint(t,n);(null==r?void 0:r.closest(".MuiAutocomplete-popper"))||(R(!1),T())},45);document.addEventListener("mousemove",t),e=function(){document.removeEventListener("mousemove",t),t.clear()}});return function(){return e()}}},[M]);var j=h(function(){var e=m.map(function(e){var t=e.label,n=e.value,r=e.child,o=void 0===r?[]:r,i=Kr(),a=o.map(function(e){return{label:e.label,value:e.value,groupId:i}});return{label:t,value:n,groupId:i,child:a.length?a:void 0}});e=function(e){void 0===e&&(e=[]);var t=[],n=function(e){return void 0===e&&(e=[]),e.forEach(function(e){var r=e.child||[];n(r),t.push(e)})};return n(e),t}(e);var t=new Map,n=new Map;return e.forEach(function(e){if(e.child){var r={label:e.label,child:e.child.map(function(e){return e.value})};t.set(e.groupId,r),n.set(e.value,r)}}),{items:e,groupIdMap:t,groupValueMap:n}},[m]),O=j.items,_=j.groupIdMap,B=j.groupValueMap,H=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=L.current,i=new Set(o),a=t.some(function(e){return i.has(e)});t.forEach(function(e){a?i.delete(e):i.add(e)});var l=r([],e(i),!1);N(l),E(l)},W=h(function(){return O.filter(function(e){return L.current.includes(e.value)})},[L.current,O]);return f.createElement(Ee,{key:A,loading:u,className:n,style:o,sx:i,options:O,value:W,open:M,onOpen:function(){return R(!0)},onClose:function(){return R(!1)},multiple:!0,disabled:c,readOnly:s,disableCloseOnSelect:!0,groupBy:function(e){return e.groupId},getOptionLabel:function(e){return e.label||""},renderInput:function(e){return f.createElement(xe,a({},e,x,{InputProps:a(a(a({},e.InputProps),x.InputProps),{readOnly:s})}))},renderGroup:function(t){var n=_.get(t.group);if(!n)return f.createElement(f.Fragment,null,t.children);var o=n.child.every(function(e){return L.current.includes(e)}),i=n.child.some(function(e){return L.current.includes(e)});return f.createElement("li",{key:t.key},f.createElement("ul",{className:C.ul},f.createElement(Me,{key:-1,onClick:function(){return H.apply(void 0,r([],e(n.child),!1))},className:C.li,dense:!0},f.createElement(F,null,f.createElement(ve,{disableRipple:!0,icon:Qc,checkedIcon:Jc,checked:o,indeterminate:i})),f.createElement(Oe,{primary:n.label}),f.createElement(Pe,{className:C.icons})),t.children))},renderOption:function(e,t,n){var r;return f.createElement(Me,{key:t.value,className:xo(C.li,(r={},r[C.hidden]=B.has(t.value),r)),onClick:function(){return H(t.value)},dense:!0},f.createElement(F,null,f.createElement(ve,{disableRipple:!0,icon:Qc,checkedIcon:Jc,checked:n.selected})),f.createElement(Oe,{primary:t.label}))},renderTags:function(e,t){return f.createElement(f.Fragment,null,e.map(function(e,n){return f.createElement(He,a({variant:"outlined"},t({index:n}),{label:e.label,onDelete:s?void 0:function(){return H(e.value)}}))}))}})},tu=[],nu={CheckBox:function(e){var t=e.disabled,n=e.onChange,r=e.title,o=e.value;return f.createElement(be,null,f.createElement(ge,{control:f.createElement(ve,{disabled:t,checked:Boolean(o),onChange:function(e,t){return n(t)}}),label:r||""}))},Combo:function(o){var i=o.value,l=o.disabled,c=o.readonly,u=o.description,s=void 0===u?"":u,d=o.placeholder,m=void 0===d?"":d,p=o.outlined,v=void 0!==p&&p,y=o.itemList,E=void 0===y?[]:y,x=o.virtualListBox,C=o.watchItemList,k=o.labelShrink,S=o.noDeselect,L=o.freeSolo,N=o.loading,I=o.title,M=void 0===I?"":I,R=o.dirty,P=o.invalid,A=o.incorrect,T=o.fieldReadonly,D=o.withContextMenu,j=o.tr,F=void 0===j?function(e){return e.toString()}:j,_=o.onChange,B=nl().isMobile,H=qr().object,W=Mr(),z=so().requestSubject,V=Jr(),Y=V.reloadTrigger,U=V.doReload,q=e(g(function(){return{options:[],labels:{}}}),2),$=q[0],X=q[1],G=e(g(!1),2),K=G[0],Q=G[1],J=b(!1),Z=al([$],10),ee=Vr($.labels),te=h(function(){return Array.isArray(i)?e(i,1)[0]:i},[i]),ne=h(function(){return te?[te]:te},[te]),re=tl({data:H,payload:W,itemList:E,keepRaw:!1,onValueChange:_,placeholder:m,tip:void 0,title:M,tr:F,type:jn.Combo,value:ne}),oe=il().fallback,ie=Ti(function(o){return t(void 0,void 0,void 0,function(){var i,a,l,c,u,s,d;return n(this,function(f){switch(f.label){case 0:return i={},E=E||[],l=[[]],c=Set.bind,s=(u=Object).values,"function"!=typeof E?[3,2]:[4,Promise.resolve(E(o,W))];case 1:return d=f.sent(),[3,3];case 2:d=E,f.label=3;case 3:return a=r.apply(void 0,l.concat([e.apply(void 0,[new(c.apply(Set,[void 0,s.apply(u,[d])]))]),!1])),[4,Promise.all(a.map(function(e){return t(void 0,void 0,void 0,function(){var t,r;return n(this,function(n){switch(n.label){case 0:return t=i,r=e,[4,Promise.resolve(F(e,o,W))];case 1:return[2,t[r]=n.sent()]}})})}))];case 4:return f.sent(),L&&te&&!a.includes(te)&&a.push(te),X({labels:i,options:a}),J.current=!0,[4,Z()];case 5:return f.sent(),[2]}})})},{fallback:oe}),ae=ie.loading,le=ie.execute,ce=function(e){return Object.values(e||{}).sort(function(e,t){return t.localeCompare(e)}).join("-")}(te),ue=b(null),se=b(!0);w(function(){if(!se.current){if(ue.current===H)return;if(!C)return}ue.current=H,se.current=!1,le(H)},[ce,l,R,P,A,H,c]);var de=function(e,t){return function(n){return f.createElement(xe,a({},n,{sx:a({},!v&&{position:"relative",mt:1,"& .MuiFormHelperText-root":{position:"absolute",top:"100%"}}),variant:v?"outlined":"standard",placeholder:e?void 0:m,label:M,helperText:R&&(P||A)||s,error:R&&(null!==P||null!==A),InputProps:a(a({},n.InputProps),{readOnly:t,endAdornment:f.createElement(f.Fragment,null,e?f.createElement(O,{color:"inherit",size:20}):null,n.InputProps.endAdornment)}),InputLabelProps:a(a({},n.InputLabelProps),k&&{shrink:!0})}))}},fe=function(e,t,n){var r=ee.current;return f.createElement("li",a({},e),f.createElement(Ce,{icon:ll,checkedIcon:cl,style:{marginRight:8},checked:n.selected}),L?t:r[t]||"".concat(t," (unknown)"))},me=function(e){var t=ee.current;return L?e:t[e]||"".concat(e," (unknown)")},pe=_r();w(function(){if(K){var e=pe.once(function(){var t=Zn(function(e){var t=e.clientX,n=e.clientY,r=document.elementFromPoint(t,n);(null==r?void 0:r.closest(".MuiAutocomplete-popper"))||(Q(!1),U())},45);document.addEventListener("mousemove",t),e=function(){document.removeEventListener("mousemove",t),t.clear()}});return function(){return e()}}},[K]),w(function(){return D&&z.subscribe(function(){Q(!1)})},[]);return ae||!J.current||N?f.createElement(Ee,{disableCloseOnSelect:!0,disableClearable:S,disabled:!0,loading:!0,value:null,options:ul,onChange:function(){return null},freeSolo:L,ListboxComponent:x?Ei:void 0,getOptionLabel:me,renderInput:de(!0,!0),renderOption:fe}):f.createElement(Ee,{key:Y,onOpen:function(){T||(B?re():Q(!0))},onClose:function(){return Q(!1)},disableCloseOnSelect:!0,disableClearable:S,loading:ae,value:te||null,onChange:function(e,t){return function(e){_(e||null),pe.next()}(t)},getOptionLabel:me,freeSolo:L,options:$.options,disabled:l,readOnly:c,ListboxComponent:x?Ei:void 0,renderInput:de(!1,c),renderOption:fe})},Items:function(o){var i=o.value,l=o.disabled,c=o.readonly,u=o.description,s=o.placeholder,d=o.outlined,m=void 0!==d&&d,p=o.itemList,v=void 0===p?[]:p,y=o.freeSolo,E=o.noDeselect,x=o.virtualListBox,C=o.watchItemList,k=o.labelShrink,S=o.loading,L=o.dirty,N=o.invalid,I=o.incorrect,M=o.title,R=o.fieldReadonly,P=o.tr,A=void 0===P?function(e){return e.toString()}:P,T=o.onChange,D=o.withContextMenu,j=nl().isMobile,F=qr().object,_=Mr(),B=so().requestSubject,H=Jr(),W=H.reloadTrigger,z=H.doReload,V=e(g(function(){return{options:[],labels:{}}}),2),Y=V[0],U=V[1],q=e(g(!1),2),$=q[0],X=q[1],G=b(!1),K=al([Y],10),Q=Vr(Y.labels),J=h(function(){if("string"==typeof i)return[i];if(i){var e=Object.values(i);return Bn(e)?[]:e}return[]},[i]),Z=tl({data:F,payload:_,itemList:v,keepRaw:!1,onValueChange:T,placeholder:s,tip:void 0,title:M,tr:A,type:jn.Items,value:J}),ee=b(J),te=h(function(){return dl(ee.current,J)?ee.current:(ee.current=J,J)},[J]),ne=Vr(te),re=il().fallback,oe=Ti(function(o){return t(void 0,void 0,void 0,function(){var i,a,l,c,u,s,d;return n(this,function(f){switch(f.label){case 0:return i={},v=v||[],l=[[]],c=Set.bind,s=(u=Object).values,"function"!=typeof v?[3,2]:[4,Promise.resolve(v(o,_))];case 1:return d=f.sent(),[3,3];case 2:d=v,f.label=3;case 3:return a=r.apply(void 0,l.concat([e.apply(void 0,[new(c.apply(Set,[void 0,s.apply(u,[d])]))]),!1])),[4,Promise.all(a.map(function(e){return t(void 0,void 0,void 0,function(){var t,r;return n(this,function(n){switch(n.label){case 0:return t=i,r=e,[4,Promise.resolve(A(e,o,_))];case 1:return[2,t[r]=n.sent()]}})})}))];case 4:return f.sent(),y&&te.forEach(function(e){a.includes(e)||a.push(e)}),U({options:a,labels:i}),G.current=!0,[4,K()];case 5:return f.sent(),[2]}})})},{fallback:re}),ie=oe.loading,ae=oe.execute,le=function(e){return Object.values(e||{}).sort(function(e,t){return t.localeCompare(e)}).join("-")}(te),ce=b(null),ue=b(!0);w(function(){if(!ue.current){if(ce.current===F)return;if(!C)return}ce.current=F,ue.current=!1,ae(F)},[le,l,L,N,I,F,c]);var se=_r();w(function(){if($){var e=se.once(function(){var t=Zn(function(e){var t=e.clientX,n=e.clientY,r=document.elementFromPoint(t,n);(null==r?void 0:r.closest(".MuiAutocomplete-popper"))||(X(!1),z())},45);document.addEventListener("mousemove",t),e=function(){document.removeEventListener("mousemove",t),t.clear()}});return function(){return e()}}},[$]),w(function(){return D&&B.subscribe(function(){X(!1)})},[]);var de=function(e,t){var n=Q.current;return e.map(function(e,r){return f.createElement(He,a({variant:m?"outlined":"filled",label:y?e:n[e]||"".concat(e," (unknown)")},t({index:r})))})},fe=function(e){var t=Q.current;return y?e:t[e]||"".concat(e," (unknown)")},me=function(e,t){return function(n){return f.createElement(xe,a({},n,{sx:a({},!m&&{position:"relative",mt:1,"& .MuiFormHelperText-root":{position:"absolute",top:"100%"}}),variant:m?"outlined":"standard",label:M,helperText:L&&(N||I)||u,placeholder:e||ne.current.length?void 0:s,error:L&&(null!==N||null!==I),InputProps:a(a({},n.InputProps),{readOnly:t,endAdornment:f.createElement(f.Fragment,null,e?f.createElement(O,{color:"inherit",size:20}):null,n.InputProps.endAdornment)}),InputLabelProps:a(a({},n.InputLabelProps),k&&{shrink:!0})}))}},pe=function(e,t,n){var r=Q.current;return f.createElement("li",a({},e),f.createElement(ve,{icon:fl,checkedIcon:ml,style:{marginRight:8},checked:n.selected}),y?t:r[t]||"".concat(t," (unknown)"))};return ie||!G.current||S?f.createElement(Ee,{multiple:!0,disableCloseOnSelect:!0,disableClearable:E,loading:!0,disabled:!0,freeSolo:y,onChange:function(){return null},value:pl,options:pl,ListboxComponent:x?Ei:void 0,getOptionLabel:fe,renderTags:de,renderInput:me(!0,!0),renderOption:pe}):f.createElement(Ee,{key:W,multiple:!0,loading:ie,disabled:l,disableCloseOnSelect:!0,disableClearable:E,freeSolo:y,readOnly:c,open:$,onChange:function(e,t){return function(e){T((null==e?void 0:e.length)?e:null),se.next()}(t)},onOpen:function(){R||(j?Z():X(!0))},onClose:function(){return X(!1)},getOptionLabel:fe,ListboxComponent:x?Ei:void 0,value:te,options:Y.options,renderTags:de,renderInput:me(!1,!!c),renderOption:pe})},Line:function(e){var t=e.title,n=void 0===t?"":t,r=e.lineTransparent,o=void 0!==r&&r,i=hl().classes;return f.createElement(j,{className:i.root},f.createElement(_,{variant:"h5"},n),!o&&f.createElement(j,{className:i.line}))},Radio:function(t){var n=t.disabled,r=t.onChange,o=t.title,i=t.readonly,l=t.radioValue,c=t.value,u=t.name,s=void 0===u?"":u,d=e(bl(),2),m=d[0],p=d[1],h=Vr(m),v=y(function(e){return p(function(t){var n;return a(a({},t),((n={})[s]=e,n))})},[]),g=y(function(e){v(e),r(e)},[]);return w(function(){var e=h.current;c!==e[s]&&v(c)},[c]),f.createElement(be,null,f.createElement(Ve,{value:c,onChange:function(e,t){i||g(t||null)}},f.createElement(ge,{value:l,control:f.createElement(Ce,{disabled:n}),label:o||""})))},Rating:function(e){var t=e.value,n=e.disabled,r=e.readonly,o=e.onChange;return f.createElement(j,{display:"flex",justifyContent:"center",component:"fieldset",borderColor:"transparent"},f.createElement(Ye,{onChange:function(e,t){return o(t)},disabled:n,value:Number(t),readOnly:r}))},Progress:function(e){var t=e.maxPercent,n=void 0===t?1:t,r=e.showPercentLabel,o=e.value;return f.createElement(j,{display:"flex",alignItems:"center"},f.createElement(j,{width:"100%",mr:1},f.createElement(De,{variant:"determinate",value:yl(Number(o),Number(n))})),r&&f.createElement(j,{minWidth:35},f.createElement(_,{variant:"body2",color:"textSecondary"},"".concat(yl(Number(o),Number(n)),"%"))))},Typography:function(e){var t=e.value,n=void 0===t?"":t,r=e.placeholder,o=void 0===r?"":r,i=e.typoVariant,a=void 0===i?"body1":i,l=e.style;return f.createElement(_,{variant:a,style:l},n||o)},Button:function(e){var t=e.disabled,n=e.click,r=e.icon,o=e.title,i=e.value,a=e.placeholder,l=e.buttonVariant,c=e.buttonSize,u=e.buttonColor;return f.createElement(si,{variant:l,size:c,color:u,startIcon:r&&f.createElement(r,null),disabled:t,onClick:n},i||o||a)},Text:function(e){var t,n=e.invalid,r=e.incorrect,o=e.value,i=e.disabled,l=e.readonly,c=e.inputType,u=void 0===c?"text":c,s=e.inputMode,d=void 0===s?"text":s,m=e.inputPattern,p=void 0===m?void 0:m,v=e.labelShrink,g=e.description,y=void 0===g?"":g,w=e.outlined,x=void 0!==w&&w,C=e.title,k=void 0===C?"":C,S=e.leadingIcon,L=e.trailingIcon,N=e.leadingIconClick,I=e.trailingIconClick,M=e.leadingIconTabIndex,R=e.trailingIconTabIndex,P=e.leadingIconRipple,A=void 0===P||P,T=e.trailingIconRipple,D=void 0===T||T,j=e.inputRows,O=void 0===j?1:j,F=e.placeholder,_=void 0===F?"":F,B=e.inputAutocomplete,H=void 0===B?"off":B,W=e.inputFormatterSymbol,z=void 0===W?"0":W,V=e.inputFormatterAllowed,Y=e.inputFormatterReplace,U=e.inputFormatterTemplate,q=void 0===U?"":U,$=e.inputFormatter,X=void 0===$?function(e){return wl(e,q,{symbol:z,allowed:V,replace:Y})}:$,G=e.dirty,K=e.loading,Q=e.autoFocus,J=e.inputRef,Z=e.onChange,ee=Mr(),te=qr(),ne=te.object,re=te.changeObject,oe=b(),ie=h(function(){var e=El;return{render:function(){if("text"===u){var t=oe.current;"number"==typeof e&&(null==t||t.setSelectionRange(e,e),e=El)}},pos:function(){var t,n=oe.current;return n&&(e=(t=n).selectionStart||t.value.length,e+=function(e){for(var t=0,n=Math.max(e-1,0);n<q.length&&q[n]!==z;n++)t+=1;return t}(e)),e}}},[]);return E(function(){if(q){var e=oe.current,t=function(){return ie.pos()};return e&&e.addEventListener("keyup",t),e&&e.addEventListener("click",t),function(){e&&e.removeEventListener("keyup",t),e&&e.removeEventListener("click",t)}}},[oe.current]),E(function(){(q||Y||V)&&ie.render()},[o]),f.createElement(xe,a({sx:a({},!x&&{position:"relative",mt:1,"& .MuiFormHelperText-root":{position:"absolute",top:"100%"}}),inputRef:function(e){oe.current=e,J&&J(e)},variant:x?"outlined":"standard",helperText:G&&(n||r)||y,error:G&&(null!==n||null!==r),InputProps:a({autoComplete:H,readOnly:l,inputMode:d,autoFocus:Q},xl(ne,ee,S,L,N,I,M,R,K,i,!!l,(o||"").toString(),Z,re,A,D)),inputProps:{pattern:p},InputLabelProps:v?{shrink:v}:void 0,type:u,focused:Q,autoComplete:H,value:K?"Loading":String(o||""),placeholder:_,onChange:function(e){var t=e.target,n=t.value;if(q||Y||V){n="";for(var r=0;r<t.value.length;r++)n+=t.value[r],n=X(n);ie.pos()}Z(n)},label:k,disabled:i},{multiline:(t=O)>1,rows:t}))},Icon:function(e){var t,n=e.disabled,r=e.click,o=e.icon,i=void 0===o?Qe:o,a=e.iconSize,l=e.iconColor,c=e.iconBackground,u=tc().classes,s=Mr(),d=qr().object;return f.createElement("div",{className:u.root},f.createElement("div",{className:xo(u.container,(t={},t[u.backgroundPrimary]="primary"===c,t[u.backgroundSecondary]="secondary"===c,t[u.backgroundError]="error"===c,t[u.backgroundInfo]="info"===c,t[u.backgroundSuccess]="success"===c,t[u.backgroundWarning]="warning"===c,t))},f.createElement(ec,{size:a,color:l,disabled:n,onClick:r},f.createElement(i,{data:d,payload:s}))))},Date:function(t){var n=t.invalid,r=t.incorrect,o=t.value,i=t.disabled,l=t.readonly,c=t.description,u=void 0===c?"":c,s=t.outlined,d=void 0!==s&&s,m=t.title,p=void 0===m?"Text":m,v=t.placeholder,y=void 0===v?Ol:v,x=t.labelShrink,C=t.dirty,k=t.autoFocus,S=t.inputRef,L=t.onChange,N=t.withContextMenu,I=so().requestSubject,M=b(),R=b(!1),P=b(!1),A=e(f.useState(null),2),T=A[0],D=A[1],j=function(){D(null)},O=e(g(zl(o||"")?o:""),2),F=O[0],_=O[1],B=Vr(F);w(function(){P.current?P.current=!1:zl(o||"")?(R.current=!0,_(o)):B.current&&(R.current=!0,_(""))},[o]);var H=Vr(o);w(function(){if(R.current)R.current=!1;else{var e=zl(F||"");e?(P.current=!0,L(Vl(e))):H.current&&(P.current=!0,L(""))}},[F]);var W=h(function(){if(F){var e=zl(F);if(!e)return;var t=Ue();return t=(t=(t=t.set("date",e.day)).set("month",e.month-1)).set("year",e.year)}},[F]),z=h(function(){var e=Jl;return{render:function(){var t=M.current;"number"==typeof e&&(null==t||t.setSelectionRange(e,e),e=Jl)},pos:function(){var t,n=M.current;return n&&(e=(t=n).selectionStart||t.value.length,e+=function(e){for(var t=0,n=Math.max(e-1,0);n<10&&"#"!==Ql[n];n++)t+=1;return t}(e)),e}}},[]);return E(function(){var e=M.current,t=function(){return z.pos()};return e&&e.addEventListener("keyup",t),e&&e.addEventListener("click",t),function(){e&&e.removeEventListener("keyup",t),e&&e.removeEventListener("click",t)}},[M.current]),E(function(){z.render()},[F]),w(function(){return N&&I.subscribe(j)},[]),f.createElement(f.Fragment,null,f.createElement(xe,{inputRef:function(e){M.current=e,S&&S(e)},sx:a({},!d&&{position:"relative",mt:1,"& .MuiFormHelperText-root":{position:"absolute",top:"100%"}}),type:"text",InputProps:{readOnly:l,autoFocus:k,endAdornment:f.createElement(Le,{sx:{position:"relative"},position:"end"},f.createElement(Ne,{onClick:function(e){var t=e.clientX,n=e.clientY,r=e.target,o=document.elementFromPoint(t,n);D(o||r)},disabled:i,edge:"end"},f.createElement(Ke,null)))},InputLabelProps:x?{shrink:x}:void 0,disabled:i,focused:k,placeholder:y,variant:d?"outlined":"standard",value:F,label:p,helperText:C&&(n||r)||u,error:C&&(null!==n||null!==r),onChange:function(e){return function(e){for(var t="",n=0;n<e.length;n++)t+=e[n],t=wl(t,Ql,{allowed:/\d/,symbol:"#"});z.pos(),_(t)}(e.target.value)}}),f.createElement(qe,{open:!!T,anchorEl:T,onClose:j,anchorOrigin:{vertical:"bottom",horizontal:"right"}},f.createElement(jl,{date:W,onChange:function(e){if(e){var t=e.get("date"),n=e.get("month")+1,r=e.get("year");_(new Wl(t,n,r).toString())}else _(null)}})))},Time:function(t){var n=t.invalid,r=t.incorrect,o=t.value,i=t.disabled,l=t.readonly,c=t.description,u=void 0===c?"":c,s=t.outlined,d=void 0!==s&&s,m=t.title,p=void 0===m?"Text":m,v=t.labelShrink,y=t.placeholder,x=void 0===y?Fl:y,C=t.dirty,k=t.autoFocus,S=t.inputRef,L=t.onChange,N=t.withContextMenu,I=so().requestSubject,M=b(),R=b(!1),P=b(!1),A=e(f.useState(null),2),T=A[0],D=A[1],j=function(){D(null)},O=e(g(Yl(o||"")?o:""),2),F=O[0],_=O[1],B=Vr(F);w(function(){P.current?P.current=!1:Yl(o||"")?(R.current=!0,_(o)):B.current&&(R.current=!0,_(""))},[o]);var H=Vr(o);w(function(){if(R.current)R.current=!1;else{var e=Yl(F||"");e?(P.current=!0,L(Ul(e))):H.current&&(P.current=!0,L(""))}},[F]);var W=h(function(){if(F){var e=Yl(F);if(!e)return;var t=Ue();return t=(t=t.set("hour",e.hour)).set("minute",e.minute)}},[F]),z=h(function(){var e=xc;return{render:function(){var t=M.current;"number"==typeof e&&(null==t||t.setSelectionRange(e,e),e=xc)},pos:function(){var t,n=M.current;return n&&(e=(t=n).selectionStart||t.value.length,e+=function(e){for(var t=0,n=Math.max(e-1,0);n<5&&"#"!==Ec[n];n++)t+=1;return t}(e)),e}}},[]);return E(function(){var e=M.current,t=function(){return z.pos()};return e&&e.addEventListener("keyup",t),e&&e.addEventListener("click",t),function(){e&&e.removeEventListener("keyup",t),e&&e.removeEventListener("click",t)}},[M.current]),E(function(){z.render()},[F]),w(function(){return N&&I.subscribe(j)},[]),f.createElement(f.Fragment,null,f.createElement(xe,{sx:a({},!d&&{position:"relative",mt:1,"& .MuiFormHelperText-root":{position:"absolute",top:"100%"}}),inputRef:function(e){M.current=e,S&&S(e)},type:"text",InputProps:{readOnly:l,autoFocus:k,endAdornment:f.createElement(Le,{sx:{position:"relative"},position:"end"},f.createElement(Ne,{onClick:function(e){var t=e.clientX,n=e.clientY,r=e.target,o=document.elementFromPoint(t,n);D(o||r)},disabled:i,edge:"end"},f.createElement(Je,null)))},InputLabelProps:v?{shrink:v}:void 0,disabled:i,focused:k,placeholder:x,variant:d?"outlined":"standard",value:F,label:p,helperText:C&&(n||r)||u,error:C&&(null!==n||null!==r),onChange:function(e){return function(e){for(var t="",n=0;n<e.length;n++)t+=e[n],t=wl(t,Ec,{allowed:/\d/,symbol:"#"});z.pos(),_(t)}(e.target.value)}}),f.createElement(qe,{open:!!T,anchorEl:T,onClose:j,anchorOrigin:{vertical:"bottom",horizontal:"right"}},f.createElement(wc,{date:W,onChange:function(e){if(e){var t=e.get("hour"),n=e.get("minute");_(new Hl(t,n).toString())}else _(null)}})))},Switch:function(e){var t=e.disabled,n=e.value,r=e.onChange,o=e.title,i=e.switchNoColor,a=e.switchActiveLabel,l=Cc().classes,c=h(function(){return i?l:void 0},[]);return f.createElement(j,{display:"flex",alignItems:"center"},f.createElement(j,{sx:{flex:a?void 0:1,whiteSpace:"nowrap",textAlign:a?"right":void 0}},f.createElement(_,{variant:"body1"},o)),f.createElement(Ze,{disabled:t,classes:c,checked:Boolean(n),onChange:function(e,t){return r(t)}}),!!a&&f.createElement(j,{sx:{flex:1,whiteSpace:"nowrap",textAlign:"left"}},f.createElement(_,{variant:"body1"},a)))},Slider:function(e){var t=e.value,n=e.onChange,r=e.leadingIcon,o=e.trailingIcon,i=e.leadingIconClick,a=e.trailingIconClick,l=e.leadingIconTabIndex,c=e.trailingIconTabIndex,u=e.leadingIconRipple,s=void 0===u||u,d=e.trailingIconRipple,m=void 0===d||d,p=e.labelFormatSlider,h=e.stepSlider,v=e.disabled,g=e.readonly,b=e.maxSlider,y=void 0===b?100:b,w=e.minSlider,E=void 0===w?0:w,x=Mr(),C=qr(),k=C.object,S=C.changeObject;return f.createElement(j,{mr:1},f.createElement(U,{alignItems:"center",container:!0,spacing:2},f.createElement(U,{item:!0},r&&kc(r,k,x,!!v,!!g,t,S,n,i,l,"start",s)),f.createElement(U,{item:!0,xs:!0},f.createElement(et,{disabled:v,step:h,marks:!!h,min:E,max:y,"aria-labelledby":"discrete-slider",valueLabelDisplay:"auto",color:"primary",value:t||0,onChange:function(e,t){return!g&&n(t)},valueLabelFormat:p})),f.createElement(U,{item:!0},o&&kc(o,k,x,!!v,!!g,t,S,n,a,c,"end",m))))},File:function(r){var o=r.invalid,i=r.incorrect,l=r.value,c=r.disabled,u=r.readonly,s=r.description,d=void 0===s?"":s,m=r.outlined,p=void 0!==m&&m,h=r.labelShrink,v=r.title,b=void 0===v?"":v,y=r.placeholder,w=void 0===y?"No file chosen":y,E=r.dirty,x=r.loading,C=r.inputRef,k=r.onChange,S=r.fileAccept,L=r.name,N=r.upload,I=void 0===N?function(e){return e instanceof File?e.name:L}:N,M=r.view,R=r.tr,P=void 0===R?function(e){return e}:R,A=e(g(0),2),T=A[0],D=A[1],j=Mr(),O=qr().object,F=!!x||!!T,_=e(Sc(function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,P(l,O,j)];case 1:return[2,e.sent()]}})})},{onLoadStart:function(){return D(function(e){return e+1})},onLoadEnd:function(){return D(function(e){return e-1})},deps:[l]}),1),B=_[0];return f.createElement(we,{direction:"row",alignItems:p?"stretch":"center",spacing:1},f.createElement(xe,{sx:a({flex:1},!p&&{position:"relative",mt:1,"& .MuiFormHelperText-root":{position:"absolute",top:"100%"}}),inputRef:C,variant:p?"outlined":"standard",helperText:E&&(o||i)||d,error:E&&(null!==o||null!==i),InputProps:{readOnly:u,endAdornment:f.createElement(Le,{sx:{position:"relative"},position:"end"},f.createElement(Ne,{edge:"end",disabled:c||!B,onClick:function(){k(null)}},f.createElement(Fe,null)))},InputLabelProps:h?{shrink:h}:void 0,value:F?"Loading":B?String(B):"",placeholder:w,label:b,disabled:c}),!!B&&!!M&&f.createElement(si,{variant:"outlined",onLoadStart:function(){return D(function(e){return e+1})},onLoadEnd:function(){return D(function(e){return e-1})},onClick:function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,M(B,O,j)];case 1:return e.sent(),[2]}})})}},"View"),f.createElement(si,{variant:"outlined",onLoadStart:function(){return D(function(e){return e+1})},onLoadEnd:function(){return D(function(e){return e-1})},onClick:function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:return[4,Lc(S)];case 1:return(e=n.sent())?[4,I(e,O,j)]:[3,3];case 2:t=n.sent(),k(t),n.label=3;case 3:return[2]}})})}},F&&"Uploading",!F&&"Choose"))},Choose:function(r){var o=r.invalid,i=r.incorrect,l=r.value,c=r.disabled,u=r.readonly,s=r.description,d=void 0===s?"":s,m=r.outlined,p=void 0!==m&&m,h=r.title,v=void 0===h?"":h,g=r.placeholder,b=void 0===g?"Not chosen":g,y=r.labelShrink,w=void 0===y||y,E=r.dirty,x=r.loading,C=r.inputRef,k=r.onChange,S=r.choose,L=void 0===S?function(){return"unknown"}:S,N=r.tr,I=void 0===N?function(e){return e}:N,M=Mr(),R=qr().object,P=Jr(),A=P.doReload,T=P.reloadTrigger,D=e(Sc(function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,Ic(l,I,R,M)];case 1:return[2,e.sent()]}})})},{deps:[l]}),2),j=D[0],O=D[1].loading,F=ro(function(){return t(void 0,void 0,void 0,function(){var e;return n(this,function(t){switch(t.label){case 0:return l?(k(null),[2]):[4,L(R,M)];case 1:return e=t.sent(),k(Array.isArray(e)?e.length?e:null:e||null),[2]}})})}),_=F.execute,B=F.loading,H=x||O||B;return f.createElement(Ee,{key:"".concat(T,"-").concat(j),fullWidth:!0,multiple:Array.isArray(j),disableClearable:!0,disabled:c,loading:H,value:j||null,options:Nc,onChange:function(){return null},freeSolo:!0,readOnly:!0,renderInput:function(e){return f.createElement(xe,a({},e,{value:e.inputProps.value,variant:p?"outlined":"standard",helperText:E&&(o||i)||d,error:E&&(null!==o||null!==i),sx:a({flex:1},!p&&{position:"relative",mt:1,"& .MuiFormHelperText-root":{position:"absolute",top:"100%"}}),inputRef:C,onClick:function(e){var t;null===(t=e.currentTarget)||void 0===t||t.blur(),l||_(),A()},InputProps:a(a({},e.InputProps),{readOnly:!0,placeholder:b,endAdornment:H?e.InputProps.endAdornment:f.createElement(Le,{sx:{position:"relative"},position:"end"},f.createElement(si,{sx:{pointerEvents:u?"none":"all",mb:p?void 0:.5},disabled:H||c,variant:"outlined",size:"small",color:l?"secondary":"primary",onClick:function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,_()];case 1:return e.sent(),[2]}})})}},l&&"Deselect",!l&&"Choose"))}),InputLabelProps:a(a({},e.InputLabelProps),{shrink:w||void 0}),placeholder:b,label:v}))}})},Complete:function(o){var i=o.invalid,l=o.incorrect,c=o.value,u=o.disabled,s=o.readonly,d=o.inputType,m=void 0===d?"text":d,p=o.inputMode,v=void 0===p?"text":p,y=o.inputPattern,x=void 0===y?void 0:y,C=o.labelShrink,k=o.description,S=void 0===k?"":k,L=o.outlined,N=void 0!==L&&L,I=o.keepRaw,M=void 0!==I&&I,R=o.title,P=void 0===R?"":R,A=o.placeholder,T=void 0===A?"":A,D=o.inputAutocomplete,j=void 0===D?"off":D,F=o.dirty,_=o.loading,B=o.tip,H=void 0===B?function(){return["unset"]}:B,W=o.tipSelect,z=o.autoFocus,V=o.onChange,Y=o.fieldReadonly,U=o.inputFormatterSymbol,q=void 0===U?"0":U,$=o.inputFormatterAllowed,X=o.inputFormatterReplace,G=o.inputFormatterTemplate,K=void 0===G?"":G,Q=o.inputFormatter,J=void 0===Q?function(e){return wl(e,K,{symbol:q,allowed:$,replace:X})}:Q,Z=o.withContextMenu,ee=nl().isMobile,te=Mr(),ne=qr(),re=ne.object,oe=ne.changeObject,ie=so().requestSubject,ae=il().fallback,le=void 0===ae?function(e){throw e}:ae,ce=yi(),ue=ce.elementRef,se=ce.size,de=b(null),fe=e(f.useState(null),2),me=fe[0],pe=fe[1],he=function(){pe(null)},ve=e(g(-1),2),ge=ve[0],be=ve[1],ye=e(g(!1),2),we=ye[0],Ee=ye[1],Ce=e(g([]),2),ke=Ce[0],Se=Ce[1],Re=_||we,Pe=Vr(c),Ae=e(Oi(c,500),1)[0],Te=Vr(H),De=Vr(re),je=no(V),Fe=tl({data:re,payload:te,itemList:void 0,tr:void 0,tip:H,keepRaw:!1,onValueChange:V,placeholder:T,title:P,type:jn.Complete,value:c}),_e=h(function(){var e=Mc;return{render:function(){if("text"===m){var t=de.current;"number"==typeof e&&(null==t||t.setSelectionRange(e,e),e=Mc)}},pos:function(){var t,n=de.current;return n&&(e=(t=n).selectionStart||t.value.length,e+=function(e){for(var t=0,n=Math.max(e-1,0);n<K.length&&K[n]!==q;n++)t+=1;return t}(e)),e}}},[]);E(function(){if(K){var e=de.current,t=function(){return _e.pos()};return e&&e.addEventListener("keyup",t),e&&e.addEventListener("click",t),function(){e&&e.removeEventListener("keyup",t),e&&e.removeEventListener("click",t)}}},[de.current]),E(function(){(K||X||$)&&_e.render()},[c]);var Be=h(function(){return Kn(function(e){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return be(-1),[4,je(e)];case 1:return t.sent(),[2]}})})})},[]),He=h(function(){return Kn(function(){return t(void 0,void 0,void 0,function(){var t,o,i,a,l;return n(this,function(n){switch(n.label){case 0:Ee(!0),n.label=1;case 1:return n.trys.push([1,5,6,7]),"function"!=typeof Te.current?[3,3]:[4,Te.current(Pe.current||"",De.current,te)];case 2:return o=n.sent(),[3,4];case 3:o=Te.current,n.label=4;case 4:if(t=o,!Array.isArray(t))throw new Error("CompleteField tip invalid result");return!M&&Pe.current&&(i=String(Pe.current||"").toLowerCase(),a=i.split(" "),t=t.filter(function(e){var t=String(e).toLowerCase().split(" "),n=!0;return a.forEach(function(e){n=n&&t.some(function(t){return t.includes(e)})}),n})),t=t.slice(0,100),be(-1),Se(r([],e(new Set(t)),!1)),[3,7];case 5:return l=n.sent(),le(l),[3,7];case 6:return Ee(!1),[7];case 7:return[2]}})})})},[]);w(function(){open&&He()},[Ae,open]);var We=function(){var e;he(),be(-1),null===(e=de.current)||void 0===e||e.setSelectionRange(null,null)};return w(function(){return Z&&ie.subscribe(function(){We()})},[]),f.createElement(f.Fragment,null,f.createElement("div",{ref:ue},f.createElement(xe,{sx:a({},!N&&{position:"relative",mt:1,"& .MuiFormHelperText-root":{position:"absolute",top:"100%"}}),fullWidth:!0,inputRef:de,variant:N?"outlined":"standard",value:String(c||""),helperText:F&&(i||l)||S,error:F&&(null!==i||null!==l),InputProps:{onKeyDown:function(e){(function(e,t){var n;if("Escape"===e)return he(),be(-1),t(),!0;if("ArrowDown"===e)return be(function(e){return Math.min(Math.max(e+1,0),ke.length-1)}),!0;if("ArrowUp"===e)return be(function(e){return Math.min(Math.max(e-1,0),ke.length-1)}),!0;if("Enter"===e){var r=ke.find(function(e,t){return t===ge});if(r)return Be(r),null===(n=de.current)||void 0===n||n.setSelectionRange(r.length,r.length),he(),be(-1),!0}return!1})(e.key,function(){return e.currentTarget.blur()})&&e.preventDefault()},autoComplete:j,readOnly:s,inputMode:v,autoFocus:z,endAdornment:f.createElement(Le,{sx:{position:"relative"},position:"end"},f.createElement(Ne,{onClick:function(e){var t;e.preventDefault(),e.stopPropagation(),Re||open||!c||(Be(""),null===(t=de.current)||void 0===t||t.setSelectionRange(null,null))},disabled:u,edge:"end"},Re&&f.createElement(O,{color:"inherit",size:20}),!Re&&!open&&!!c&&f.createElement(nt,null)))},inputProps:{pattern:x},InputLabelProps:C?{shrink:C}:void 0,type:m,focused:z,autoComplete:j,placeholder:T,onChange:function(e){var t=e.target,n=t.value;if(K||X||$){n="";for(var r=0;r<t.value.length;r++)n+=t.value[r],n=J(n);_e.pos()}V(n)},onClick:function(e){var t=e.clientX,n=e.clientY,r=e.target;if(!Y)if(ee)Fe();else{var o=document.elementFromPoint(t,n);pe(o||r)}},label:P,disabled:u})),f.createElement(qe,{open:!!me,anchorEl:me,onClose:We,anchorOrigin:{vertical:"bottom",horizontal:"left"},disableAutoFocus:!0,disableEnforceFocus:!0,disableRestoreFocus:!0},!!me&&f.createElement(gi,{component:Ie,sx:{width:se.width,height:ke.length?Math.min(36*ke.length,250):36,mb:1,maxHeight:"45vh"},minRowHeight:36},!ke.length&&f.createElement(tt,{disableGutters:!0,dense:!0},f.createElement(Me,{disableRipple:!0,disableTouchRipple:!0},f.createElement(Oe,{primary:Re?"Loading":"No tips"}))),ke.map(function(e,t){return f.createElement(tt,{disableGutters:!0,dense:!0,key:"".concat(e,"-").concat(t)},f.createElement(Me,{selected:t===ge,onClick:function(t){t.preventDefault(),t.stopPropagation(),Be(e),W&&W(e,De.current,te,oe),he()}},f.createElement(Oe,{primary:e})))}))))},YesNo:function(r){var o=r.value,i=r.disabled,l=r.readonly,c=r.description,u=void 0===c?"":c,s=r.placeholder,d=void 0===s?"":s,m=r.outlined,p=void 0!==m&&m,v=r.virtualListBox,y=r.labelShrink,E=r.noDeselect,x=r.title,C=void 0===x?"":x,k=r.tr,S=void 0===k?function(e){return e}:k,L=r.dirty,N=r.invalid,I=r.incorrect,M=r.onChange,R=Jr(),P=R.reloadTrigger,A=R.doReload,T=e(g({}),2),D=T[0],j=T[1],F=e(g(!1),2),_=F[0],B=F[1],H=b(!1),W=Vr(D),z=Mr(),V=qr().object,Y=h(function(){return!0===o?"Yes":!1===o?"No":null},[o]),U=il().fallback,q=Ti(function(){return t(void 0,void 0,void 0,function(){var e;return n(this,function(r){switch(r.label){case 0:return e={},[4,Promise.all(Ac.map(function(r){return t(void 0,void 0,void 0,function(){var t,o;return n(this,function(n){switch(n.label){case 0:return t=e,o=r,[4,Promise.resolve(S(r,V,z))];case 1:return[2,t[o]=n.sent()]}})})}))];case 1:return r.sent(),j(e),H.current=!0,[2]}})})},{fallback:U}),$=q.loading,X=q.execute;w(function(){X()},[]);var G=function(e){return W.current[e]||e},K=function(e,t){return function(n){return f.createElement(xe,a({},n,{sx:a({},!p&&{position:"relative",mt:1,"& .MuiFormHelperText-root":{position:"absolute",top:"100%"}}),variant:p?"outlined":"standard",placeholder:e?void 0:d,label:C,helperText:L&&(N||I)||u,error:L&&(null!==N||null!==I),InputProps:a(a({},n.InputProps),{readOnly:t,endAdornment:f.createElement(f.Fragment,null,e?f.createElement(O,{color:"inherit",size:20}):null,n.InputProps.endAdornment)}),InputLabelProps:a(a({},n.InputLabelProps),y&&{shrink:!0})}))}},Q=function(e,t,n){var r=W.current;return f.createElement("li",a({},e),f.createElement(Ce,{icon:Rc,checkedIcon:Pc,style:{marginRight:8},checked:n.selected}),r[t]||t)},J=_r();w(function(){if(_){var e=J.once(function(){var t=Zn(function(e){var t=e.clientX,n=e.clientY,r=document.elementFromPoint(t,n);(null==r?void 0:r.closest(".MuiAutocomplete-popper"))||(B(!1),A())},45);document.addEventListener("mousemove",t),e=function(){document.removeEventListener("mousemove",t),t.clear()}});return function(){return e()}}},[_]);return $||!H.current?f.createElement(Ee,{disableCloseOnSelect:!0,disableClearable:E,disabled:!0,loading:!0,value:null,options:Ac,onChange:function(){return null},ListboxComponent:v?Ei:void 0,getOptionLabel:G,renderInput:K(!0,!0),renderOption:Q}):f.createElement(Ee,{key:P,onOpen:function(){return B(!0)},onClose:function(){return B(!1)},disableCloseOnSelect:!0,disableClearable:E,value:Y||null,onChange:function(e,t){return function(e){M("Yes"===e||"No"!==e&&null),J.next()}(t)},options:Ac,disabled:i,readOnly:l,ListboxComponent:v?Ei:void 0,getOptionLabel:G,renderInput:K(!1,l),renderOption:Q})},Dict:function(r){var o=r.invalid,i=r.incorrect,l=r.value,c=r.disabled,u=r.readonly,s=r.inputType,d=void 0===s?"text":s,m=r.inputMode,p=void 0===m?"text":m,v=r.inputPattern,x=void 0===v?void 0:v,C=r.inputAutocomplete,k=r.description,S=void 0===k?"":k,L=r.outlined,N=void 0!==L&&L,I=r.title,M=void 0===I?"":I,R=r.placeholder,P=void 0===R?"":R,A=r.dirty,T=r.loading,D=r.inputRef,j=r.onChange,F=r.dictLimit,_=void 0===F?25:F,B=r.dictDelay,H=void 0===B?500:B,W=r.dictOnText,z=void 0===W?Yc:W,V=r.dictOnItem,Y=void 0===V?Uc:V,U=r.dictSearch,q=void 0===U?$c:U,$=r.dictValue,X=void 0===$?qc:$,G=r.dictSearchText,K=void 0===G?Xc:G,Q=r.dictOnAppend,J=r.dictSearchItem,Z=r.dictCreateButton,ee=r.inputFormatterSymbol,te=void 0===ee?"0":ee,ne=r.inputFormatterAllowed,re=r.inputFormatterReplace,oe=r.inputFormatterTemplate,ie=void 0===oe?"":oe,ae=r.inputFormatter,le=void 0===ae?function(e){return wl(e,ie,{symbol:te,allowed:ne,replace:re})}:ae,ce=r.leadingIcon,ue=r.trailingIcon,se=r.leadingIconClick,de=r.trailingIconClick,fe=r.leadingIconRipple,me=void 0===fe||fe,pe=r.trailingIconRipple,he=void 0===pe||pe,ve=r.leadingIconTabIndex,ge=r.trailingIconTabIndex,be=Mr(),ye=qr(),we=ye.object,Ee=ye.changeObject,Ce=Gr(l),ke=h(function(){return function(t){var n=t.type,r=t.mode,o=t.pattern,i=t.getValue,a=t.loading,l=t.autoComplete,c=t.onTextChange,u=t.reloadSubject,s=e(g(i),2),m=s[0],p=s[1],v=b(null),x=h(function(){var e=Gc;return{render:function(){if("text"===d){var t=v.current;"number"==typeof e&&(null==t||t.setSelectionRange(e,e),e=Gc)}},pos:function(){var t,n=v.current;return n&&(e=(t=n).selectionStart||t.value.length,e+=function(e){for(var t=0,n=Math.max(e-1,0);n<ie.length&&ie[n]!==te;n++)t+=1;return t}(e)),e}}},[]);E(function(){if(ie){var e=v.current,t=function(){return x.pos()};return e&&e.addEventListener("keyup",t),e&&e.addEventListener("click",t),function(){e&&e.removeEventListener("keyup",t),e&&e.removeEventListener("click",t)}}},[v.current]),E(function(){(ie||re||ne)&&x.render()},[m]),w(function(){return u.subscribe(function(){var e;null===(e=v.current)||void 0===e||e.focus(),p(i)})},[]),w(function(){var e;a||(null===(e=v.current)||void 0===e||e.focus(),p(i))},[a]);var C=h(function(){return Zn(function(e){c(e)},1500)},[]);w(function(){return function(){C.flush()}},[]),w(function(){return yr(C.flush)},[]);var k=y(function(e){"Escape"!==e.key&&e.stopPropagation()},[]);return f.createElement(rt,{sx:{background:"transparent",pt:1.5}},f.createElement(xe,{inputRef:v,type:n,variant:"standard",autoFocus:!0,fullWidth:!0,disabled:a,value:m,autoComplete:l,placeholder:M||P,inputProps:{pattern:o},InputProps:{inputMode:r,startAdornment:f.createElement(Le,{sx:{position:"relative"},position:"start"},f.createElement(ot,null)),endAdornment:f.createElement(Le,{sx:{position:"relative"},position:"end"},f.createElement(Ne,{disabled:a,onClick:function(){c("")}},a?f.createElement(O,{size:24}):f.createElement(Fe,null)))},onChange:function(e){var t=e.target,n=t.value;if(ie||re||ne){n="";for(var r=0;r<t.value.length;r++)n+=t.value[r],n=le(n);x.pos()}p(n),C(n)},onKeyDown:k,sx:{mb:1}}))}},[]),Se=Vr(we);return f.createElement(Vc,{sx:a({},!N&&{position:"relative",mt:1,"& .MuiFormHelperDict-root":{position:"absolute",top:"100%"}}),startAdornment:ce&&Kc(ce,we,be,!!c,!!u,l,Ee,j,se,ve,"start",me),endAdornment:ue&&Kc(ue,we,be,!!c,!!u,l,Ee,j,de,ge,"end",he),handler:function(e,r,o,i,a){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,q({search:e,limit:r,offset:o,initial:i,data:Se.current,payload:be,rows:a})];case 1:return[2,t.sent()]}})})},changeSubject:Ce,mode:p,pattern:x,autoComplete:C,limit:_,delay:H,inputRef:D,variant:N?"outlined":"standard",helperText:A&&(o||i)||S,error:A&&(null!==o||null!==i),type:d,value:function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return l?[4,X(l,Se.current,be)]:[3,2];case 1:return[2,e.sent()||null];case 2:return[2,null]}})})},searchText:function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,K(Se.current,be)];case 1:return[2,e.sent()||""]}})})},placeholder:P,onChange:function(e){Y((null==e?void 0:e.value)||null,Se.current,be,j,Ee),j((null==e?void 0:e.value)||null)},onTextChange:function(e){return z(e,Se.current,be,j,Ee)},onCreate:Q?function(e){return Q(e,Se.current,be,j,Ee)}:void 0,label:M,payload:be,disabled:c||T||u,SearchItem:J,CreateButton:Z,SearchInput:ke})},Tree:function(r){var o=r.invalid,i=r.incorrect,l=r.value,c=r.disabled,u=r.readonly,s=r.description,d=void 0===s?"":s,m=r.outlined,p=void 0!==m&&m,h=r.title,v=void 0===h?"":h,g=r.placeholder,b=void 0===g?"":g,y=r.dirty,w=r.loading,E=r.onChange,x=r.itemTree,C=void 0===x?tu:x,k=Mr(),S=qr().object,L=e(Sc(function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return"function"!=typeof C?[3,2]:[4,C(S,k)];case 1:return[2,e.sent()];case 2:return[2,C]}})})},{deps:[l]}),2),N=L[0],I=L[1].loading,M=w||I;return f.createElement(eu,{fullWidth:!0,sx:a({flex:1},!p&&{position:"relative",mt:1,"& .MuiFormHelperText-root":{position:"absolute",top:"100%"}}),readOnly:u,loading:M,items:N||tu,value:(null==N?void 0:N.length)?l:null,disabled:c||M,variant:p?"outlined":"standard",helperText:y&&(o||i)||d,error:y&&(null!==o||null!==i),placeholder:b,label:v,onChange:E})}},ru=p(nu),ou=function(e){var t=e.children,n=l(e,["children"]),r=v(ru),o=h(function(){return a(a({},r),n)},[]);return f.createElement(ru.Provider,{value:o},t)},iu=function(e){var t=v(ru).Text;return f.createElement(t,a({},e))},au=function(e){var t=e.invalid,n=e.incorrect,r=e.value,o=e.disabled,i=e.readonly,a=e.inputType,l=void 0===a?"text":a,c=e.description,u=void 0===c?"":c,s=e.outlined,d=void 0!==s&&s,m=e.labelShrink,p=e.title,h=void 0===p?"":p,v=e.leadingIconRipple,g=e.trailingIconRipple,b=e.leadingIcon,y=e.trailingIcon,w=e.leadingIconClick,E=e.trailingIconClick,x=e.inputRows,C=void 0===x?1:x,k=e.placeholder,S=void 0===k?"":k,L=e.inputAutocomplete,N=void 0===L?"off":L,I=e.inputFormatter,M=e.inputFormatterSymbol,R=e.inputFormatterAllowed,P=e.inputFormatterTemplate,A=e.dirty,T=e.loading,D=e.onChange,j=e.autoFocus,O=e.inputRef,F=e.name,_=e.leadingIconTabIndex,B=e.trailingIconTabIndex;return f.createElement(iu,{autoFocus:j,inputRef:O,invalid:t,incorrect:n,value:r,readonly:i,disabled:o,inputType:l,description:u,outlined:d,title:h,leadingIconRipple:v,trailingIconRipple:g,leadingIcon:b,trailingIcon:y,labelShrink:m,leadingIconClick:w,trailingIconClick:E,inputRows:C,placeholder:S,inputAutocomplete:N,inputFormatter:I,inputFormatterSymbol:M,inputFormatterAllowed:R,inputFormatterTemplate:P,dirty:A,loading:T,onChange:D,name:F,leadingIconTabIndex:_,trailingIconTabIndex:B})};au.displayName="TextField";var lu=Go(au),cu=function(e){var t=v(ru).Line;return f.createElement(t,a({},e))},uu=function(e){var t=e.title,n=void 0===t?"":t,r=e.lineTransparent,o=void 0!==r&&r;return f.createElement(cu,{lineTransparent:o,title:n})};uu.displayName="LineField";var su=Go(uu,{defaultProps:{fieldRightMargin:"0",fieldBottomMargin:"0"},skipFocusBlurCall:!0}),du=function(e){var t=v(ru).Radio;return f.createElement(t,a({},e))},fu=function(e){var t=e.disabled,n=e.value,r=e.onChange,o=e.title,i=e.radioValue,a=e.readonly,l=e.name,c=void 0===l?"":l;return f.createElement(du,{value:n,disabled:t,readonly:a,onChange:r,title:o,radioValue:i,name:c})};fu.displayName="RadioField";var mu=Go(fu,{withApplyQueue:!0,skipDebounce:!0,skipDirtyClickListener:!0}),pu=function(e){var t=v(ru).Switch;return f.createElement(t,a({},e))},hu=function(e){var t=e.disabled,n=e.value,r=e.readonly,o=e.onChange,i=e.switchNoColor,a=e.switchActiveLabel,l=e.title;return f.createElement(pu,{readonly:r,disabled:t,value:n,onChange:o,switchNoColor:i,switchActiveLabel:a,title:l})};hu.displayName="SwitchField";var vu=Go(hu,{withApplyQueue:!0,skipDebounce:!0,skipDirtyClickListener:!0,skipFocusReadonly:!0}),gu=function(e){var t=v(ru).CheckBox;return f.createElement(t,a({},e))},bu=function(e){var t=e.disabled,n=e.value,r=e.readonly,o=e.onChange,i=e.title;return f.createElement(gu,{disabled:t,value:n,readonly:r,onChange:o,title:i})};bu.displayName="CheckboxField";var yu=Go(bu,{withApplyQueue:!0,skipDebounce:!0,skipDirtyClickListener:!0}),wu=function(e){var t=v(ru).Progress;return f.createElement(t,a({},e))},Eu=function(e){var t=e.maxPercent,n=void 0===t?1:t,r=e.showPercentLabel,o=e.value;return f.createElement(wu,{showPercentLabel:r,maxPercent:n,value:o})};Eu.displayName="ProgressField";var xu=Go(Eu,{skipFocusBlurCall:!0}),Cu=function(e){var t=v(ru).Slider;return f.createElement(t,a({},e))},ku=function(e){var t=e.value,n=e.onChange,r=e.leadingIconRipple,o=e.trailingIconRipple,i=e.leadingIcon,a=e.trailingIcon,l=e.leadingIconClick,c=e.trailingIconClick,u=e.stepSlider,s=e.sliderSteps,d=e.maxSlider,m=e.minSlider,p=e.labelFormatSlider,h=e.leadingIconTabIndex,v=e.trailingIconTabIndex;return f.createElement(Cu,{value:t,onChange:n,leadingIconRipple:r,trailingIconRipple:o,leadingIcon:i,trailingIcon:a,leadingIconClick:l,trailingIconClick:c,labelFormatSlider:p,stepSlider:u,maxSlider:d,sliderSteps:s,minSlider:m,leadingIconTabIndex:h,trailingIconTabIndex:v})};ku.displayName="SliderField";var Su=Go(ku,{skipDebounce:!0,withApplyQueue:!0,skipDirtyClickListener:!0}),Lu=function(e){var t=v(ru).Combo;return f.createElement(t,a({},e))},Nu=function(e){var t=e.value,n=e.disabled,r=e.readonly,o=e.description,i=void 0===o?"":o,a=e.placeholder,l=void 0===a?"":a,c=e.outlined,u=void 0!==c&&c,s=e.itemList,d=void 0===s?[]:s,m=e.freeSolo,p=void 0!==m&&m,h=e.virtualListBox,v=void 0===h||h,g=e.watchItemList,b=e.noDeselect,y=e.labelShrink,w=e.title,E=void 0===w?"":w,x=e.dirty,C=e.loading,k=e.invalid,S=e.incorrect,L=e.fieldReadonly,N=e.withContextMenu,I=e.tr,M=void 0===I?function(e){return e.toString()}:I,R=e.onChange;return f.createElement(Lu,{value:t,disabled:n,readonly:r,description:i,placeholder:l,outlined:u,itemList:d,noDeselect:b,virtualListBox:v,watchItemList:g,labelShrink:y,freeSolo:p,title:E,dirty:x,invalid:k,loading:C,incorrect:S,fieldReadonly:L,withContextMenu:N,tr:M,onChange:R})};Nu.displayName="ComboField";var Iu=Go(Nu,{withApplyQueue:!0,skipDebounce:!0,skipDirtyClickListener:!0,skipFocusReadonly:!0}),Mu=function(e){var t=v(ru).Items;return f.createElement(t,a({},e))},Ru=function(e){var t=e.value,n=e.disabled,r=e.readonly,o=e.description,i=e.placeholder,a=e.loading,l=e.outlined,c=void 0!==l&&l,u=e.itemList,s=void 0===u?[]:u,d=e.freeSolo,m=void 0!==d&&d,p=e.virtualListBox,h=void 0===p||p,v=e.labelShrink,g=e.watchItemList,b=e.noDeselect,y=e.dirty,w=e.invalid,E=e.incorrect,x=e.title,C=e.fieldReadonly,k=e.withContextMenu,S=e.tr,L=void 0===S?function(e){return e.toString()}:S,N=e.onChange;return f.createElement(Mu,{value:t,disabled:n,readonly:r,loading:a,fieldReadonly:C,description:o,placeholder:i,outlined:c,itemList:s,noDeselect:b,labelShrink:v,virtualListBox:h,watchItemList:g,freeSolo:m,dirty:y,invalid:w,incorrect:E,title:x,tr:L,onChange:N,withContextMenu:k})};Ru.displayName="ItemsField";var Pu=Go(Ru,{withApplyQueue:!0,skipDebounce:!0,skipDirtyClickListener:!0,skipFocusReadonly:!0}),Au=function(e){var t=v(ru).Rating;return f.createElement(t,a({},e))},Tu=function(e){var t=e.value,n=e.disabled,r=e.readonly,o=e.name,i=e.onChange;return f.createElement(Au,{value:t,disabled:n,readonly:r,name:o,onChange:i})};Tu.displayName="RatingField";var Du=Go(Tu,{withApplyQueue:!0,skipDebounce:!0,skipDirtyClickListener:!0,skipFocusReadonly:!0}),ju=function(e){var t=v(ru).Typography;return f.createElement(t,a({},e))},Ou=function(e){var t=e.value,n=void 0===t?"":t,r=e.placeholder,o=void 0===r?"":r,i=e.typoVariant,a=void 0===i?"body1":i,l=e.style;return f.createElement(ju,{value:n,placeholder:o,typoVariant:a,style:l})};Ou.displayName="TypographyField";var Fu=Go(Ou,{skipFocusBlurCall:!0}),_u=function(e){var t=v(ru).Date;return f.createElement(t,a({},e))},Bu=function(e){var t=e.invalid,n=e.incorrect,r=e.value,o=e.disabled,i=e.readonly,a=e.description,l=void 0===a?"":a,c=e.outlined,u=void 0!==c&&c,s=e.title,d=void 0===s?"":s,m=e.placeholder,p=void 0===m?d:m,h=e.labelShrink,v=e.dirty,g=e.autoFocus,b=e.inputRef,y=e.onChange,w=e.withContextMenu,E=e.name;return f.createElement(_u,{autoFocus:g,inputRef:b,invalid:t,incorrect:n,value:r,readonly:i,disabled:o,description:l,outlined:u,labelShrink:h,title:d,placeholder:p,withContextMenu:w,dirty:v,onChange:y,name:E})};Bu.displayName="DateField";var Hu=Go(Bu,{withApplyQueue:!0,skipDebounce:!0,skipDirtyClickListener:!0,skipFocusBlurCall:!0}),Wu=function(e){var t=v(ru).Time;return f.createElement(t,a({},e))},zu=function(e){var t=e.invalid,n=e.incorrect,r=e.value,o=e.disabled,i=e.readonly,a=e.labelShrink,l=e.description,c=void 0===l?"":l,u=e.outlined,s=void 0!==u&&u,d=e.title,m=void 0===d?"":d,p=e.placeholder,h=void 0===p?m:p,v=e.dirty,g=e.autoFocus,b=e.inputRef,y=e.onChange,w=e.name,E=e.withContextMenu;return f.createElement(Wu,{autoFocus:g,inputRef:b,invalid:t,incorrect:n,value:r,readonly:i,disabled:o,labelShrink:a,description:c,outlined:s,title:m,placeholder:h,dirty:v,onChange:y,name:w,withContextMenu:E})};zu.displayName="TimeField";var Vu=Go(zu,{withApplyQueue:!0,skipDebounce:!0,skipDirtyClickListener:!0,skipFocusBlurCall:!0}),Yu=function(e){var t=v(ru).File;return f.createElement(t,a({},e))},Uu=function(e){var t=e.invalid,n=e.value,r=e.disabled,o=e.readonly,i=e.description,a=void 0===i?"":i,l=e.outlined,c=void 0!==l&&l,u=e.title,s=void 0===u?"":u,d=e.placeholder,m=void 0===d?"":d,p=e.incorrect,h=e.upload,v=e.view,g=e.dirty,b=e.labelShrink,y=e.loading,w=e.onChange,E=e.inputRef,x=e.tr,C=e.name;return f.createElement(Yu,{inputRef:E,invalid:t,incorrect:p,value:n,readonly:o,disabled:r,description:a,outlined:c,labelShrink:b,title:s,placeholder:m,upload:h,view:v,tr:x,dirty:g,loading:y,onChange:w,name:C})};Uu.displayName="FileField";var qu=Go(Uu,{withApplyQueue:!0,skipDirtyClickListener:!0,skipDebounce:!0,skipFocusBlurCall:!0}),$u=function(e){var t=v(ru).Choose;return f.createElement(t,a({},e))},Xu=function(e){var t=e.invalid,n=e.value,r=e.disabled,o=e.readonly,i=e.incorrect,a=e.description,l=void 0===a?"":a,c=e.outlined,u=void 0!==c&&c,s=e.title,d=void 0===s?"":s,m=e.placeholder,p=void 0===m?"":m,h=e.labelShrink,v=e.choose,g=e.tr,b=e.dirty,y=e.loading,w=e.onChange,E=e.inputRef,x=e.name,C=e.withContextMenu;return f.createElement($u,{inputRef:E,invalid:t,incorrect:i,value:n,readonly:o,disabled:r,labelShrink:h,description:l,outlined:u,title:d,placeholder:p,withContextMenu:C,choose:v,tr:g,dirty:b,loading:y,onChange:w,name:x})};Xu.displayName="ChooseField";var Gu=Go(Xu,{withApplyQueue:!0,skipDirtyClickListener:!0,skipFocusReadonly:!0,skipFocusBlurCall:!0,skipDebounce:!0}),Ku=function(e){var t=v(ru).Tree;return f.createElement(t,a({},e))},Qu=function(e){var t=e.invalid,n=e.value,r=e.disabled,o=e.readonly,i=e.incorrect,a=e.description,l=void 0===a?"":a,c=e.outlined,u=void 0!==c&&c,s=e.title,d=void 0===s?"":s,m=e.placeholder,p=void 0===m?"":m,h=e.itemTree,v=e.dirty,g=e.loading,b=e.onChange,y=e.name,w=e.withContextMenu,E=e.watchItemTree;return f.createElement(Ku,{invalid:t,incorrect:i,value:n,readonly:o,disabled:r,description:l,outlined:u,watchItemTree:E,title:d,placeholder:p,withContextMenu:w,itemTree:h,dirty:v,loading:g,onChange:b,name:y})};Qu.displayName="TreeField";var Ju=Go(Qu,{withApplyQueue:!0,skipDirtyClickListener:!0,skipFocusReadonly:!0,skipDebounce:!0}),Zu=function(e){var t=v(ru).Complete;return f.createElement(t,a({},e))},es=function(e){var t=e.invalid,n=e.incorrect,r=e.value,o=e.disabled,i=e.readonly,a=e.inputType,l=void 0===a?"text":a,c=e.description,u=void 0===c?"":c,s=e.outlined,d=void 0!==s&&s,m=e.keepRaw,p=void 0!==m&&m,h=e.title,v=void 0===h?"":h,g=e.labelShrink,b=e.tip,y=e.tipSelect,w=e.placeholder,E=void 0===w?"":w,x=e.inputAutocomplete,C=void 0===x?"off":x,k=e.dirty,S=e.loading,L=e.onChange,N=e.autoFocus,I=e.inputRef,M=e.name,R=e.inputFormatter,P=e.inputFormatterAllowed,A=e.inputFormatterReplace,T=e.inputFormatterSymbol,D=e.inputFormatterTemplate,j=e.fieldReadonly,O=e.withContextMenu;return f.createElement(Zu,{autoFocus:N,inputRef:I,invalid:t,incorrect:n,value:r,readonly:i,disabled:o,inputType:l,description:u,withContextMenu:O,outlined:d,keepRaw:p,fieldReadonly:j,labelShrink:g,title:v,tip:b,tipSelect:y,placeholder:E,inputAutocomplete:C,dirty:k,loading:S,onChange:L,name:M,inputFormatter:R,inputFormatterAllowed:P,inputFormatterReplace:A,inputFormatterSymbol:T,inputFormatterTemplate:D})};es.displayName="CompleteField";var ts=Go(es),ns=function(e){var t=v(ru).YesNo;return f.createElement(t,a({},e))},rs=function(e){var t=e.value,n=e.disabled,r=e.readonly,o=e.description,i=void 0===o?"":o,a=e.placeholder,l=void 0===a?"":a,c=e.outlined,u=void 0!==c&&c,s=e.virtualListBox,d=void 0===s||s,m=e.noDeselect,p=e.labelShrink,h=e.title,v=void 0===h?"":h,g=e.tr,b=e.dirty,y=e.invalid,w=e.incorrect,E=e.onChange;return f.createElement(ns,{value:t,disabled:n,readonly:r,description:i,placeholder:l,outlined:u,noDeselect:m,virtualListBox:d,labelShrink:p,tr:g,title:v,dirty:b,invalid:y,incorrect:w,onChange:E})};rs.displayName="YesNoField";var os=Go(rs,{withApplyQueue:!0,skipDebounce:!0,skipDirtyClickListener:!0,skipFocusReadonly:!0}),is=function(e){var t=v(ru).Dict;return f.createElement(t,a({},e))},as=function(e){var t=e.invalid,n=e.incorrect,r=e.value,o=e.disabled,i=e.readonly,a=e.inputType,l=void 0===a?"text":a,c=e.inputAutocomplete,u=e.description,s=void 0===u?"":u,d=e.outlined,m=void 0!==d&&d,p=e.title,h=void 0===p?"":p,v=e.placeholder,g=void 0===v?"":v,b=e.dirty,y=e.loading,w=e.onChange,E=e.dictLimit,x=e.dictDelay,C=e.dictSearch,k=e.dictOnAppend,S=e.dictOnText,L=e.dictOnItem,N=e.dictValue,I=e.dictSearchText,M=e.dictSearchItem,R=e.dictCreateButton,P=e.inputMode,A=e.inputPattern,T=e.groupRef,D=e.inputRef,j=e.inputFormatter,O=e.inputFormatterAllowed,F=e.inputFormatterReplace,_=e.inputFormatterSymbol,B=e.inputFormatterTemplate,H=e.name,W=e.leadingIcon,z=e.trailingIcon,V=e.leadingIconClick,Y=e.trailingIconClick,U=e.leadingIconRipple,q=e.trailingIconRipple,$=e.leadingIconTabIndex,X=e.trailingIconTabIndex;return f.createElement(is,{inputRef:D,groupRef:T,invalid:t,incorrect:n,value:r,readonly:i,disabled:o,inputType:l,description:s,inputAutocomplete:c,outlined:m,title:h,placeholder:g,dirty:b,loading:y,dictLimit:E,dictDelay:x,dictSearch:C,dictOnAppend:k,dictOnText:S,dictOnItem:L,dictValue:N,dictSearchText:I,dictSearchItem:M,dictCreateButton:R,inputMode:P,inputPattern:A,onChange:w,name:H,inputFormatter:j,inputFormatterAllowed:O,inputFormatterReplace:F,inputFormatterSymbol:_,inputFormatterTemplate:B,leadingIcon:W,trailingIcon:z,leadingIconClick:V,trailingIconClick:Y,leadingIconRipple:U,trailingIconRipple:q,leadingIconTabIndex:$,trailingIconTabIndex:X})};as.displayName="DictField";var ls=Go(as,{withApplyQueue:!1,skipDirtyClickListener:!0,skipFocusReadonly:!0,skipDebounce:!0}),cs=function(e){var t=v(ru).Button;return f.createElement(t,a({},e))},us=function(e){var t=e.disabled,n=e.click,r=e.icon,o=e.title,i=e.value,a=e.buttonSize,l=e.buttonVariant,c=e.buttonColor,u=e.placeholder;return f.createElement(cs,{disabled:t,click:n,icon:r,title:o,value:i,buttonVariant:l,buttonColor:c,buttonSize:a,placeholder:u})};us.displayName="ButtonField";var ss=Go(us,{skipClickListener:!0,withApplyQueue:!0,skipDebounce:!0,skipDirtyClickListener:!0}),ds=function(e){var t=v(ru).Icon;return f.createElement(t,a({},e))},fs=function(e){var t=e.disabled,n=e.click,r=e.icon,o=e.iconSize,i=e.iconColor,a=e.iconBackground;return f.createElement(ds,{iconSize:o,iconColor:i,iconBackground:a,click:n,disabled:t,icon:r})};fs.displayName="IconField";var ms,ps=Go(fs,{skipClickListener:!0,withApplyQueue:!0,skipDebounce:!0,skipDirtyClickListener:!0}),hs=Object.create(null);Object.assign(hs,((ms={})[jn.Component]=ci,ms[jn.Text]=lu,ms[jn.Line]=su,ms[jn.Radio]=mu,ms[jn.Switch]=vu,ms[jn.Checkbox]=yu,ms[jn.Progress]=xu,ms[jn.Slider]=Su,ms[jn.Combo]=Iu,ms[jn.Items]=Pu,ms[jn.Rating]=Du,ms[jn.Typography]=Fu,ms[jn.Date]=Hu,ms[jn.Time]=Vu,ms[jn.File]=qu,ms[jn.Choose]=Gu,ms[jn.Complete]=ts,ms[jn.YesNo]=os,ms[jn.Init]=function(){return null},ms[jn.Dict]=ls,ms[jn.Tree]=Ju,ms[jn.Button]=ss,ms[jn.Icon]=ps,ms));var vs=function(e,t){void 0===t&&(t="");var n,r=e.type;if(n=hs[r])return f.createElement(n,a({},e,{key:t}));throw new Error("FieldFactory unknown key type")},gs=Tn()(function(e){return{heading:{fontSize:e.typography.pxToRem(15),flexBasis:"33.33%",flexShrink:0},secondaryHeading:{fontSize:e.typography.pxToRem(15),color:e.palette.text.secondary}}}),bs=function(t){var n=t.title,r=void 0===n?"":n,o=t.description,i=void 0===o?"":o,a=t.className,l=void 0===a?"":a,c=t.columnsOverride,u=t.isBaselineAlign,s=t.sx,d=t.style,m=t.children,p=t.expansionOpened,h=void 0!==p&&p,v=gs().classes,b=e(g(h),2),y=b[0],w=b[1];return f.createElement(Q,{sx:s,expanded:y,onChange:function(){return w(!y)},className:l,style:d},f.createElement(J,{sx:{pointerEvents:"all"},expandIcon:f.createElement(it,null)},f.createElement(X,{className:v.heading},r),f.createElement(X,{className:v.secondaryHeading},i)),f.createElement(Z,null,f.createElement(Ao,{isBaselineAlign:u,columnsOverride:c},m)))};bs.displayName="Expansion";var ys=Tn()({hidden:{display:"none !important"},disabled:{pointerEvents:"none"},readonly:{pointerEvents:"none"}}),ws=function(){return!0},Es=function(){return!1},xs=function(){return!1};function Cs(t){var n=C(t),r=function(t){var r,o=t.className,i=t.children,c=t.object,u=t.isVisible,s=void 0===u?ws:u,d=t.isReadonly,m=void 0===d?Es:d,p=t.isDisabled,v=void 0===p?xs:p,b=t.disabled,y=void 0!==b&&b,E=t.readonly,x=void 0!==E&&E,C=t.phoneHidden,k=t.tabletHidden,S=t.desktopHidden,N=t.ready,I=l(t,["className","children","object","isVisible","isReadonly","isDisabled","disabled","readonly","phoneHidden","tabletHidden","desktopHidden","ready"]),M=ys().classes,R=Mr(),P=qr().object,A=h(function(){var e="function"==typeof C?C(R):C,t="function"==typeof k?k(R):k,n="function"==typeof S?S(R):S;return{phoneHidden:e,tabletHidden:t,desktopHidden:n,hasHiddenConstraint:e||t||n}},[]),T=A.phoneHidden,D=A.tabletHidden,j=A.desktopHidden,O=A.hasHiddenConstraint?nl():{},F=O.isPhone,_=void 0!==F&&F,B=O.isTablet,H=void 0!==B&&B,W=O.isDesktop,z=void 0!==W&&W,V=P||c,Y=function(){var t=e(g(function(){return{readonly:!1,visible:!1,disabled:!1}}),2),n=t[0],r=t[1];return{state:n,action:h(function(){return{setDisabled:function(e){return r(function(t){return a(a({},t),{disabled:e})})},setReadonly:function(e){return r(function(t){return a(a({},t),{readonly:e})})},setVisible:function(e){return r(function(t){return a(a({},t),{visible:e})})}}},[])}}(),U=Y.state,q=U.disabled,$=U.readonly,X=U.visible,G=Y.action,K=G.setDisabled,Q=G.setReadonly,J=G.setVisible;w(function(){var e=v(V,R),t=s(V,R),n=m(V,R);Q(n),K(e),J(t),!t&&N()},[V]);return X?T&&_||D&&H||j&&z?null:f.createElement(n,a({className:xo(o,(r={},r[M.disabled]=q||y,r[M.readonly]=$||x,r[M.hidden]=!X,r)),ready:N,object:V},I),q||y?f.Children.map(i,function(e){return L(e,{disabled:!0})}):$||x?f.Children.map(i,function(e){return L(e,{readonly:!0})}):i):null};return r.displayName="Wrapped".concat(t.displayName||"UnknownLayout"),C(r)}var ks=Tn()(function(e){return{root:{position:"relative",display:"flex",alignItems:"stretch",justifyContent:"stretch"},content:{flexGrow:1,width:"100%"},outlinePaper:{background:"transparent",boxShadow:"none !important",border:"1px solid ".concat($(e.palette.getContrastText(e.palette.background.default),.23)),borderRadius:"4px"},transparentPaper:{background:"transparent"}}}),Ss=function(e){var t,n=e.columns,r=e.columnsOverride,o=e.sx,i=e.phoneColumns,a=e.tabletColumns,l=e.desktopColumns,c=e.isBaselineAlign,u=e.fieldRightMargin,s=void 0===u?"0":u,d=e.fieldBottomMargin,m=void 0===d?"0":d,p=e.style,h=e.className,v=e.children,g=e.title,b=e.testId,y=e.description,w=e.expansionOpened,E=e.outlinePaper,x=e.transparentPaper,C=ks().classes;return f.createElement(Ao,{className:xo(h,C.root),"data-testid":b,style:p,sx:o,isItem:!0,columns:n,phoneColumns:i,tabletColumns:a,desktopColumns:l,fieldRightMargin:s,fieldBottomMargin:m},f.createElement(bs,{className:xo(C.content,(t={},t[C.outlinePaper]=E&&!x,t[C.transparentPaper]=!E&&x,t)),columnsOverride:r,expansionOpened:w,title:g,isBaselineAlign:c,description:y},v))};Ss.displayName="ExpansionLayout";var Ls=Cs(Ss),Ns=Tn()({stretch:{position:"relative",display:"flex",alignItems:"stretch",justifyContent:"stretch"},content:{flexGrow:1,width:"100%"}}),Is=function(e){var t=e.className,n=void 0===t?"":t,r=e.style,o=e.children,i=e.columnsOverride,a=e.isBaselineAlign,l=e.sx,c=Ns().classes;return f.createElement(ee,{sx:l,className:xo(n,c.stretch),style:r},f.createElement(te,{className:c.content},f.createElement(Ao,{columnsOverride:i,isBaselineAlign:a,fieldBottomMargin:"0",fieldRightMargin:"0"},o)))};Is.displayName="Paper";var Ms=Tn()({baselineAdjust:{width:"100%"}}),Rs=function(){var e=Ms().classes;return f.createElement("div",{className:xo(e.baselineAdjust,"react-declarative__oneBaselineAdjust")})},Ps=Tn()(function(e){return{stretch:{position:"relative",display:"flex",alignItems:"stretch",justifyContent:"stretch",border:"1px solid ".concat(A(e.palette.getContrastText(e.palette.background.default),.23)),borderRadius:"4px"},content:{flexGrow:1,width:"100%"}}}),As=function(e){var t=e.className,n=void 0===t?"":t,r=e.columnsOverride,o=e.style,i=e.children,a=e.isBaselineAlign,l=e.sx,c=Ps().classes;return f.createElement(te,{className:xo(n,c.stretch),sx:l,style:o},f.createElement(te,{className:c.content},f.createElement(Ao,{isBaselineAlign:a,columnsOverride:r,fieldBottomMargin:"0",fieldRightMargin:"0"},i)))};As.displayName="Outline";var Ts=Tn()({stretch:{position:"relative",display:"flex",alignItems:"stretch",justifyContent:"stretch"},content:{flexGrow:1,width:"100%"}}),Ds=function(e){var t=e.className,n=void 0===t?"":t,r=e.columnsOverride,o=e.style,i=e.children,a=e.isBaselineAlign,l=e.sx,c=Ts().classes;return f.createElement(te,{className:xo(n,c.stretch),sx:l,style:o},f.createElement(te,{className:c.content},f.createElement(Ao,{isBaselineAlign:a,columnsOverride:r,fieldBottomMargin:"0",fieldRightMargin:"0"},i)))};Ds.displayName="Outline";var js=Tn()({root:{position:"relative",display:"flex",alignItems:"stretch",justifyContent:"stretch"},content:{flexGrow:1,width:"100%"}}),Os=function(e){var t=e.columns,n=e.columnsOverride,r=e.sx,o=e.phoneColumns,i=e.tabletColumns,a=e.desktopColumns,l=e.style,c=e.className,u=e.children,s=e.testId,d=e.isBaselineAlign,m=e.fieldRightMargin,p=void 0===m?"0":m,h=e.fieldBottomMargin,v=void 0===h?"0":h,g=e.innerPadding,b=void 0===g?"18px":g,y=e.outlinePaper,w=void 0!==y&&y,E=e.transparentPaper,x=void 0!==E&&E,C=js().classes;return f.createElement(Ao,{className:xo(c,C.root),"data-testid":s,style:l,sx:r,isItem:!0,columns:t,phoneColumns:o,tabletColumns:i,desktopColumns:a,fieldRightMargin:p,fieldBottomMargin:v},S(x?Ds:w?As:Is,{className:C.content,columnsOverride:n,isBaselineAlign:d,style:{padding:b},children:f.createElement(f.Fragment,null,u,f.createElement(Rs,null))}))};Os.displayName="PaperLayout";var Fs=Cs(Os),_s=Tn()({root:{position:"relative",display:"flex",alignItems:"stretch",justifyContent:"stretch"},content:{flexGrow:1,width:"100%"}}),Bs=function(e){var t=e.columns,n=e.columnsOverride,r=e.sx,o=e.phoneColumns,i=e.tabletColumns,a=e.desktopColumns,l=e.style,c=e.className,u=e.children,s=e.testId,d=e.isBaselineAlign,m=e.fieldRightMargin,p=void 0===m?"0":m,h=e.fieldBottomMargin,v=void 0===h?"0":h,g=e.innerPadding,b=void 0===g?"18px":g,y=_s().classes;return f.createElement(Ao,{className:xo(c,y.root),"data-testid":s,style:l,sx:r,isItem:!0,columns:t,phoneColumns:o,tabletColumns:i,desktopColumns:a,fieldRightMargin:p,fieldBottomMargin:v},f.createElement(As,{className:y.content,isBaselineAlign:d,columnsOverride:n,style:{padding:b}},u,f.createElement(Rs,null)))};Bs.displayName="OutlineLayout";var Hs=Cs(Bs),Ws=Tn()({root:{position:"relative",display:"flex",alignItems:"stretch",justifyContent:"stretch"},content:{flexGrow:1,width:"100%"}}),zs=function(e){var t=e.columns,n=e.columnsOverride,r=e.sx,o=e.phoneColumns,i=e.tabletColumns,a=e.desktopColumns,l=e.isBaselineAlign,c=e.fieldRightMargin,u=void 0===c?"0":c,s=e.fieldBottomMargin,d=void 0===s?"0":s,m=e.style,p=e.testId,h=e.className,v=e.children,g=Ws().classes;return f.createElement(Ao,{className:xo(h,g.root),"data-testid":p,style:m,sx:r,isItem:!0,columns:t,phoneColumns:o,tabletColumns:i,desktopColumns:a,fieldRightMargin:u,fieldBottomMargin:d},f.createElement(Ao,{className:g.content,isBaselineAlign:l,columnsOverride:n},v,f.createElement(Rs,null)))};zs.displayName="GroupLayout";var Vs=Cs(zs),Ys=function(t){var n=t.children,r=t.isVisible,o=void 0===r?function(){return!0}:r,i=t.ready,a=e(g(!1),2),l=a[0],c=a[1],u=Mr(),s=qr().object;return w(function(){if(s){var e=o(s,u);c(e)}i()},[s]),l?f.createElement(k,null,n):f.createElement(k,null)};Ys.displayName="FragmentLayout";var Us=function(e){var t=e.children,n=e.className,r=e.style,o=e.testId;return f.createElement("div",{className:n,style:r,"data-testid":o},t)};Us.displayName="DivLayout";var qs=Cs(Us),$s=function(e){var t=e.children,n=e.className,r=e.style,o=e.sx,i=e.testId;return f.createElement(j,{className:n,style:r,sx:o,"data-testid":i},t)};$s.displayName="BoxLayout";var Xs=Cs($s),Gs=Tn()(function(e,t,n){var r;return{root:{position:"relative",display:"flex",alignItems:"stretch",justifyContent:"stretch",overflow:"hidden","& > *":{flex:1}},keepFlow:(r={overflow:"initial !important"},r["& .".concat(n.container)]={position:"static !important"},r["& .".concat(n.content)]={overflow:"hidden !important"},r),minSize:{minWidth:225,minHeight:225},container:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column","& > *":{flex:1}},tabs:{maxHeight:48},content:{display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column",overflowY:"auto","& > *":{flex:1}},line:{background:A(e.palette.getContrastText(e.palette.background.default),.23),maxHeight:2,marginTop:-2},background:{background:A("#000",.05)}}}),Ks=function(t){var n,r,o=t.children,i=t.className,l=t.style,c=t.tabChange,u=t.tabVariant,s=void 0===u?"fullWidth":u,d=t.tabLine,m=void 0!==d&&d,p=t.tabColor,v=void 0===p?"primary":p,b=t.tabList,y=void 0===b?["Empty"]:b,w=t.tabKeepFlow,E=void 0!==w&&w,x=t.tabBackground,C=void 0!==x&&x,k=t.tabIndex,S=void 0===k?0:k,L=t.columns,N=t.columnsOverride,I=t.isBaselineAlign,M=t.sx,R=t.testId,P=t.phoneColumns,A=t.tabletColumns,T=t.desktopColumns,D=t.fieldRightMargin,O=void 0===D?"0":D,F=t.fieldBottomMargin,_=void 0===F?"0":F,B=Gs().classes,H=e(g(S),2),W=H[0],z=H[1],V=h(function(){return Array(y.length).fill({}).reduce(function(e,t,n){var r;return a(((r={})["& > *:nth-of-type(".concat(n+1,")")]={display:W===n?"inherit":"none !important"},r),e)},{})},[W]);return f.createElement(Ao,{className:i,style:l,isItem:!0,columns:L,"data-testid":R,columnsOverride:N,isBaselineAlign:I,phoneColumns:P,tabletColumns:A,desktopColumns:T,fieldRightMargin:O,fieldBottomMargin:_,sx:M},f.createElement(j,{className:xo(B.root,(n={},n[B.keepFlow]=E,n[B.minSize]=!E,n))},f.createElement(j,{className:B.container},f.createElement(lt,{value:W,indicatorColor:v,textColor:v,variant:s,onChange:function(e,t){c&&c(t),z(t)},className:xo(B.tabs,"react-declarative__tabsLayoutHeader")},y.map(function(e,t){return f.createElement(at,{key:t,label:e})})),m&&f.createElement(j,{className:B.line}),f.createElement(j,{className:xo(B.content,(r={},r[B.background]=C,r)),sx:V},o))))};Ks.displayName="TabsLayout";var Qs=Cs(Ks),Js=Tn()({root:{display:"flex",alignItems:"stretch",justifyContent:"stretch"},container:{minWidth:1,overflowY:"auto",display:"flex",alignItems:"stretch",justifyContent:"stretch",flex:1},content:{overflow:"hidden",flex:1,minHeight:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},hidden:{visibility:"hidden"}}),Zs=function(t){var n,r=t.children,o=t.className,i=t.style,a=t.innerPadding,l=void 0===a?"0px":a,c=t.columns,u=t.phoneColumns,s=t.tabletColumns,d=t.desktopColumns,m=t.columnsOverride,p=t.isBaselineAlign,h=t.testId,v=t.sx,y=t.fieldRightMargin,x=void 0===y?"0":y,C=t.fieldBottomMargin,k=void 0===C?"0":C,S=Js().classes,L=e(g(),2),N=L[0],I=L[1],M=e(g(0),2),R=M[0],P=M[1],A=e(g(!0),2),T=A[0],D=A[1],j=yi(),O=j.elementRef,F=j.size,_=b(!0);E(function(){return function(){_.current=!1}},[]),w(function(){var e=function(e){if(void 0===e&&(e=!1),N&&_.current){var t=N.getBoundingClientRect(),n=t.width,r=t.left,o=0;N.querySelectorAll(":scope > *").forEach(function(e){return o=Math.max(o,e.getBoundingClientRect().right)});var i=Math.min(o-r-n,0);P(i),e&&D(!1)}},t=ne(function(){return e(!0)},250),n=new MutationObserver(t),r=new ResizeObserver(t);return N&&(n.observe(N,{childList:!0,subtree:!0}),r.observe(N),window.addEventListener("resize",t),e(),t()),function(){t.clear(),n.disconnect(),N&&r.unobserve(N),window.removeEventListener("resize",t),r.disconnect()}},[N]);return f.createElement(Ao,{className:o,style:i,sx:v,isItem:!0,"data-testid":h,columns:c,phoneColumns:u,tabletColumns:s,desktopColumns:d,fieldRightMargin:x,fieldBottomMargin:k},f.createElement("div",{ref:O,className:S.root},f.createElement("div",{className:xo(S.container,(n={},n[S.hidden]=T,n))},f.createElement("div",{className:S.content,style:{padding:l}},f.createElement("div",{style:{marginRight:R,width:R?F.width:"100%"}},f.createElement(Ao,{columnsOverride:m,isBaselineAlign:p,ref:function(e){return I(e)}},r))))))};Zs.displayName="CenterLayout";var ed=Cs(Zs),td=Tn()({root:{position:"relative",overflowY:"auto",width:"100%",height:"100%",flex:1},container:{position:"absolute",top:0,left:0,right:0,minHeight:"100%",display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column","& > *":{flex:1}}}),nd=function(e){var t=e.children,n=e.className,r=e.style,o=e.testId,i=e.innerPadding,a=void 0===i?"0px":i,l=td().classes;return f.createElement("div",{className:xo(l.root,n),"data-testid":o,style:r},f.createElement("div",{className:l.container,style:{padding:a}},t))};nd.displayName="StretchLayout";var rd=Cs(nd),od="0px",id="100%",ad="unset",ld=Tn()({root:{position:"relative",display:"flex",alignItems:"stretch",justifyContent:"stretch"},container:{flexGrow:1,width:"100%"},content:{flex:1,position:"relative",overflow:"hidden"},item:{position:"absolute",display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *":{flexGrow:1}}}),cd=function(e,t){return matchMedia("(min-width: ".concat(e,"px) and (max-width: ").concat(t,"px)")).matches},ud=function(r){var o=r.className,i=r.bpoints,l=r.height,c=r.width,u=r.registry,s=r.children,d=r.object,m=r.element,p=e(g({}),2),h=p[0],v=p[1],y=e(g({}),2),w=y[0],x=y[1],C=function(e){var t=e.xs,n=void 0===t?0:t,r=e.sm,o=void 0===r?600:r,i=e.lg,a=void 0===i?1280:i;return{isPhone:cd(n,o),isTablet:cd(o,a),isDesktop:cd(a,1e16)}}(i),k=C.isDesktop,S=C.isTablet,L=C.isPhone,N=b(!0);return E(function(){return function(){N.current=!1}},[]),E(function(){t(void 0,void 0,void 0,function(){var e,t,r;return n(this,function(n){switch(n.label){case 0:return m?(e=a(a(a(a({},k&&(u.heroOuterDesktopStyle||u.heroOuterStyle)),S&&(u.heroOuterTabletStyle||u.heroOuterStyle)),L&&(u.heroOuterPhoneStyle||u.heroOuterStyle)),!L&&!S&&!k&&u.heroOuterStyle),t=a(a(a(a({},k&&(u.heroInnerDesktopStyle||u.heroInnerStyle)),S&&(u.heroInnerTabletStyle||u.heroInnerStyle)),L&&(u.heroInnerPhoneStyle||u.heroInnerStyle)),!L&&!S&&!k&&u.heroInnerStyle),[4,(o=m,new Promise(function(e){var t=setInterval(function(){var n=o.getBoundingClientRect(),r=n.height,i=n.width;return document.body.contains(o)?r||i?(clearInterval(t),void e()):void 0:(clearInterval(t),void e())},50)}))]):[2];case 1:if(n.sent(),r=function(e){if("function"==typeof e){var t=m.getBoundingClientRect(),n=t.height,r=t.width;return e(d,{height:n,width:r},m)}return e},k)e.minHeight=r(u.desktopMinHeight||u.minHeight||ad),e.maxHeight=r(u.desktopMaxHeight||u.maxHeight||ad),e.minWidth=r(u.desktopMinWidth||u.minWidth||ad),e.maxWidth=r(u.desktopMaxWidth||u.maxWidth||ad),e.height=r(u.desktopHeight||u.height||id),e.width=r(u.desktopWidth||u.width||id),t.top=r(u.desktopTop||u.top||od),t.left=r(u.desktopLeft||u.left||od),t.right=r(u.desktopRight||u.right||od),t.bottom=r(u.desktopBottom||u.bottom||od);else if(S)e.minHeight=r(u.tabletMinHeight||u.minHeight||ad),e.maxHeight=r(u.tabletMaxHeight||u.maxHeight||ad),e.minWidth=r(u.tabletMinWidth||u.minWidth||ad),e.maxWidth=r(u.tabletMaxWidth||u.maxWidth||ad),e.height=r(u.tabletHeight||u.height||id),e.width=r(u.tabletWidth||u.width||id),t.top=r(u.tabletTop||u.top||od),t.left=r(u.tabletLeft||u.left||od),t.right=r(u.tabletRight||u.right||od),t.bottom=r(u.tabletBottom||u.bottom||od);else{if(!L)throw new Error("HeroLayout invalid media query");e.minHeight=r(u.phoneMinHeight||u.minHeight||ad),e.maxHeight=r(u.phoneMaxHeight||u.maxHeight||ad),e.minWidth=r(u.phoneMinWidth||u.minWidth||ad),e.maxWidth=r(u.phoneMaxWidth||u.maxWidth||ad),e.height=r(u.phoneHeight||u.height||id),e.width=r(u.phoneWidth||u.width||id),t.top=r(u.phoneTop||u.top||od),t.left=r(u.phoneLeft||u.left||od),t.right=r(u.phoneRight||u.right||od),t.bottom=r(u.phoneBottom||u.bottom||od)}return N.current&&(v(e),x(t)),[2]}var o})})},[d,c,l,m]),f.createElement("div",{style:h},f.createElement("div",{className:o,style:w},s))},sd=function(t){var n=t.children,r=t.className,o=t.style,i=t.object,a=t.columns,c=t.columnsOverride,u=t.isBaselineAlign,s=t.testId,d=t.sx,m=t.phoneColumns,p=t.tabletColumns,h=t.desktopColumns,v=l(t,["children","className","style","object","columns","columnsOverride","isBaselineAlign","testId","sx","phoneColumns","tabletColumns","desktopColumns"]),b=M().breakpoints.values,y=e(g(null),2),w=y[0],E=y[1],x=ld().classes,C=yi({target:document.body}),k=C.elementRef,S=C.size;return f.createElement(Ao,{className:xo(r,x.root),"data-testid":s,ref:function(e){return E(e)},style:o,sx:d,isItem:!0,columns:a,phoneColumns:m,tabletColumns:p,desktopColumns:h,fieldRightMargin:"0",fieldBottomMargin:"0"},f.createElement(Ao,{className:x.container,isBaselineAlign:u,columnsOverride:c},f.createElement("div",{ref:k,className:x.content},f.createElement(ud,{element:w,className:x.item,bpoints:b,height:S.height,width:S.width,registry:v,object:i},n))))};sd.displayName="HeroLayout";var dd=Cs(sd),fd=function(e){var t="async";return Promise.resolve(e).then(function(){return t="sync"}),t},md=function(e){var t=null;return Promise.resolve(e).then(function(e){return t=e}),t},pd=function(o){var i=o.Else,a=void 0===i?null:i,l=o.Loading,c=void 0===l?a:l,u=o.children,s=o.condition,d=o.fallback,m=o.onLoadStart,p=o.onLoadEnd,h=o.payload,v=o.deps,y=void 0===v?[]:v,x=o.throwError,C=void 0!==x&&x,k=e(g(function(){return function(e,t){var n=!1;if("function"==typeof e){var r=e(t);n=md(r)}return!!n}(s,h)}),2),S=k[0],L=k[1],N=e(g(0),2),I=N[0],M=N[1],R=b(null),P=b(!0);E(function(){return function(){P.current=!1}},[]);var A=Vr(s);return w(function(){var e=A.current;R.current&&R.current.cancel();var r=Gn(function(){return t(void 0,void 0,void 0,function(){var t,r;return n(this,function(n){switch(n.label){case 0:t=!0,M(function(e){return e+1}),m&&m(),n.label=1;case 1:return n.trys.push([1,5,6,7]),"function"!=typeof e?[3,3]:[4,Promise.resolve(e(h))];case 2:return[2,n.sent()];case 3:return[2,e];case 4:return[3,7];case 5:throw r=n.sent(),t=!1,r;case 6:return function(e){M(function(e){return e-1}),p&&p(e)}(t),[7];case 7:return[2]}})})});R.current=r;t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,r()];case 1:return(e=n.sent())===Xn?[2]:(R.current=null,P.current&&L(e),[3,3]);case 2:if(t=n.sent(),P.current&&L(!1),C)throw t;return d&&d(t),[3,3];case 3:return[2]}})})},r([h],e(y),!1)),S?f.createElement(f.Fragment,null,u):I?f.createElement(f.Fragment,null,c):f.createElement(f.Fragment,null,a)},hd=function(t,n){var o,i=null,a=!0,l=function(){for(var l=[],c=0;c<arguments.length;c++)l[c]=arguments[c];return a||t(i,l)?(i=l,a=!1,o=n.apply(void 0,r([],e(l),!1))):o};return l.clear=function(){i=null},l},vd=function(e){var r=e.children,o=e.condition,i=void 0===o?function(){return!0}:o,a=e.shouldCondition,l=void 0===a?function(){return!1}:a,c=e.conditionLoading,u=e.conditionElse,s=e.fallback,d=void 0===s?function(e){throw e}:s,m=e.object,p=Mr(),v=h(function(){return hd(function(e,t){return l(e[0],t[0],p)},i)},[]),g=y(function(e){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,v(e,p)];case 1:return[2,t.sent()]}})})},[]);return f.createElement(pd,{condition:g,Loading:c&&f.createElement(c,{data:m,payload:p}),Else:u&&f.createElement(u,{data:m,payload:p}),fallback:d,payload:m},r)};vd.displayName="ConditionLayout";var gd=Cs(vd),bd=["dirty","fallback","readonly","invalid","loading","object","onChange","prefix","value"],yd=Tn()({root:{display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *":{flex:1}}}),wd=function(e){var t=e.children;return f.createElement(f.Fragment,null,t)},Ed=function(t){var n=t.children,r=t.className,o=t.style,i=t.sx,c=t.testId,u=t.customLayout,s=void 0===u?wd:u,d=l(t,["children","className","style","sx","testId","customLayout"]),m=yd().classes,p=qr(),v=p.object,g=p.changeObject,b=Mr(),y=h(function(){var t=Object.entries(d).filter(function(t){var n=e(t,1)[0];return!bd.includes(n)}).reduce(function(t,n){var r,o=e(n,2),i=o[0],l=o[1];return a(a({},t),((r={})[i]=l,r))},{});return a(a({},v),{onChange:g,_fieldParams:t,_fieldData:v,_payload:b})},[v]);return f.createElement(j,{className:xo(r,m.root),"data-testid":c,style:o,sx:i},f.createElement(s,a({},y),n))};Ed.displayName="CustomLayout";var xd,Cd=Cs(Ed),kd=Object.create(null);Object.assign(kd,((xd={})[jn.Group]=Vs,xd[jn.Box]=Xs,xd[jn.Paper]=Fs,xd[jn.Outline]=Hs,xd[jn.Expansion]=Ls,xd[jn.Div]=qs,xd[jn.Tabs]=Qs,xd[jn.Hero]=dd,xd[jn.Fragment]=Ys,xd[jn.Center]=ed,xd[jn.Stretch]=rd,xd[jn.Condition]=gd,xd[jn.Layout]=Cd,xd));var Sd=function(e,t,n){void 0===n&&(n="");var r,o=e.type;if(r=kd[o])return f.createElement(r,a({},e,{key:n}),t);throw new Error("FieldFactory unknown key type")},Ld=new Set([jn.Choose,jn.Combo,jn.Complete,jn.Date,jn.File,jn.Items,jn.Text,jn.Time,jn.Dict,jn.Tree,jn.Button,jn.Icon]),Nd=function(e){return e.type===jn.Fragment?Id(e):!Fn(e.type)&&(!e.outlined&&(!e.noBaseline&&(!!e.baseline||Ld.has(e.type))))},Id=function(e){var t=e.outlined,n=e.noBaseline,r=e.baseline,o=e.child,i=e.fields;return!t&&(!n&&(!!r||(o?[o]:i||[]).some(Nd)))},Md=function(e){return Fn(e.type)?Id(e):Nd(e)},Rd=p(null),Pd=function(e){var t=e.children,n=h(function(){var e=Object.create(null);return Object.assign(e,{focusMap:new Map,blurMap:new Map,menuMap:new Map,clickMap:new Map,baselineMap:new Map,fieldsMap:new Map,statefullMap:new Map,trMap:new Map,itemListMap:new Map}),e},[]);return w(function(){return function(){return Object.values(n).forEach(function(e){e.clear()})}},[]),f.createElement(Rd.Provider,{value:n},t)},Ad=["custom-layout","switch-field","line-field","file-field","group-layout","paper-layout","outline-layout","expansion-layout","radio-field","checkbox-field","text-field","date-field","time-field","progress-field","component-field","slider-field","combo-field","choose-field","init-field","complete-field","items-field","rating-field","typography-field","fragment-layout","div-layout","box-layout","tabs-layout","hero-layout","center-layout","stretch-layout","condition-layout"].reduce(function(e,t){var n;return a(a({},e),((n={})[Symbol.for(t)]=t,n))},{}),Td=function(e){return Ad[e]||e.toString()},Dd=function(e){var t=e.filter(_n).length;return Math.max(t,1)},jd=function(){return null},Od=function(){return null},Fd=function(){return null},_d=function(e,t){return e!==t},Bd=function(t,n){return e(t,1)[0]!==e(n,1)[0]},Hd=function(e,t){var n=e.itemList,r=e.shouldUpdateItemList,o=void 0===r?_d:r;if(n)return Array.isArray(n)?n:hd(function(e,n){return o(e[0],n[0],t)},n)},Wd=function(e,t){var n=e.tr,r=e.shouldUpdateTr,o=void 0===r?Bd:r;if(n)return hd(function(e,n){return o(e,n,t)},n)},zd=function(e){var r=e.rendered,o=void 0!==r&&r,i=e.fields,l=void 0===i?[]:i,c=e.features,u=e.dirty,s=e.ready,d=void 0===s?jd:s,m=e.prefix,p=void 0===m?"root":m,g=e.invalidity,E=void 0===g?Od:g,x=e.fallback,C=void 0===x?Fd:x,S=e.outlinePaper,L=void 0!==S&&S,N=e.transparentPaper,I=void 0!==N&&N,M=e.readonly,R=e.disabled,P=e.baseline,A=e.noBaseline,T=e.readTransform,D=e.writeTransform,j=e.focus,O=e.blur,F=e.click,_=e.menu,B=e.createField,H=void 0===B?vs:B,W=e.createLayout,z=void 0===W?Sd:W,V=e.isBaseline,Y=void 0===V?Md:V,U=e.withNamedPlaceholders,q=Mr(),$=v(Rd),X=$.focusMap,G=$.blurMap,K=$.menuMap,Q=$.baselineMap,J=$.fieldsMap,Z=$.clickMap,ee=$.statefullMap,te=$.trMap,ne=$.itemListMap,re=h(function(){var e=J.has(l)?J.get(l):J.set(l,l.filter(function(e){return!c||!e.features||e.features.some(function(e){return c.includes(e)})}).filter(function(e){return e.type!==jn.Phony}).filter(function(e){var t=e.hidden;return"function"==typeof t&&(t=t(q)),!t}).filter(function(e){return e.type!==jn.Init})).get(l);return{fields:e,statefull:ee.has(l)?ee.get(l):ee.set(l,Dd(e)).get(l)}},[]),oe=re.fields,ie=re.statefull,ae=b(ie),le=qr(),ce=le.object,ue=le.setObject;w(function(){0==oe.length&&d()},[]);var se=y(function(e,t){ue(e,t)},[]),de=y(function(){0===--ae.current&&d()},[d]);return ce?f.createElement(k,null,oe.map(function(e,r){var i="".concat(p,".").concat(Td(e.type),"[").concat(r,"]"),l=e.child?[e.child]:e.fields||[],s=a(a({readTransform:T,writeTransform:D,invalidity:e.invalidity||E,readonly:M||e.readonly,disabled:R||e.disabled,testId:e.testId,prefix:i,change:se,ready:de,fallback:C,isBaselineAlign:void 0===Q.get(e)?!!Q.set(e,!!P||!A&&Y(e)).get(e):!!Q.get(e)},e),{placeholder:U?"".concat(e.name||"unknown"):e.placeholder,outlinePaper:e.outlinePaper||L,transparentPaper:e.transparentPaper||I,click:Z.has(e)?Z.get(e):Z.set(e,function(r,o,i,a,l,c){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return e.click?[4,e.click(r,o,i,a,l,c)]:[3,2];case 1:t.sent(),t.label=2;case 2:return F?[4,F(r,i,a,l,c,o)]:[3,4];case 3:t.sent(),t.label=4;case 4:return[2]}})})}).get(e),focus:X.has(e)?X.get(e):X.set(e,function(t,n,r,o,i){e.focus&&e.focus(t,n,r,o,i),j&&j(t,n,r,o,i)}).get(e),blur:G.has(e)?G.get(e):G.set(e,function(t,n,r,o,i){e.blur&&e.blur(t,n,r,o,i),O&&O(t,n,r,o,i)}).get(e),menu:K.has(e)?K.get(e):K.set(e,function(t,n,r,o,i,a){e.menu&&e.menu(t,n,r,o,i,a),_&&_(t,n,r,o,i,a)}).get(e),tr:te.has(e)?te.get(e):te.set(e,Wd(e,q)).get(e),itemList:ne.has(e)?ne.get(e):ne.set(e,Hd(e,q)).get(e),object:ce,dirty:e.dirty||u}),d={rendered:o,ready:de,prefix:i,readTransform:T,writeTransform:D,readonly:M||e.readonly,disabled:R||e.disabled,outlinePaper:s.outlinePaper,transparentPaper:s.transparentPaper,withNamedPlaceholders:U,baseline:P,noBaseline:A,createField:H,createLayout:z,isBaseline:Y,fields:l,features:c,handler:ce,invalidity:E,focus:j,click:F,menu:_,blur:O,dirty:e.dirty||u};return Fn(e.type)?z(s,f.createElement(Vd,a({},d)),i):H(s,i)})):null};zd.displayName="OneInternal";var Vd=C(zd),Yd="react-declarative__oneContainer",Ud=Tn()({root:{display:"flex",flexDirection:"column",alignItems:"flex-start",width:"100%"},adjust:{flex:1}}),qd=function(e){var t=e.className,n=e.children,r=l(e,["className","children"]),o=Ud().classes;return f.createElement(j,a({className:xo(Yd,t,o.root),"data-testid":Yd},r),n,f.createElement("div",{className:o.adjust}))},$d="react-declarative__oneGenesis",Xd="react-declarative__oneGenesisReady",Gd=Tn()({readonly:{pointerEvents:"none"},rendering:{pointerEvents:"none"}}),Kd=function(){return null},Qd=function(e){return console.log({data:e})},Jd=function(e){return e},Zd=function(t){var n,r=b(!1),o=e(g(!1),2),i=o[0],l=o[1],c=Gd().classes,u=t.isBaselineForRoot,s=void 0===u?Nd:u,d=t.outgoingTransform,m=void 0===d?Jd:d,p=t.change,v=void 0===p?Qd:p,w=t.ready,E=void 0===w?Kd:w,x=t.fields,C=void 0===x?[]:x,k=t.slots,S=void 0===k?{}:k,L=t.payload,N=void 0===L?{}:L,I=t.fieldDebounce,M=void 0===I?0:I,R=t.features,P=t.context,A=t.baseline,T=t.noBaseline,D=Fr(N),j=t.className,O=t.style,F=t.sx,_=h(function(){return C},[]),B=Vr(E),H=Vr(v),W=y(function(){var e=B.current;r.current||(r.current=!0,l(!0),e())},[]),z=y(function(e,t){var n=H.current,r=!0;Ar(C).forEach(function(t){var n=t.isInvalid,o=void 0===n?function(){return null}:n,i=t.hidden;("function"==typeof i?i(D):i)||(r=r&&null===(o(e,D)||null))}),r&&n(m(e,D),t)},[]),V=a(a({},t),{context:void 0,fields:_,change:z,features:R,payload:D}),Y=a(a({},t),{context:void 0,fields:_,ready:W,features:R,payload:D,rendered:i}),U=h(function(){return!!A||!T&&_.some(s)},[]);return f.createElement(Dn,null,f.createElement(Pd,null,f.createElement(kr,{payload:M},f.createElement(Jo,{context:P},f.createElement(gl,{initialState:function(){return Ar(C).filter(function(e){return e.type===jn.Radio}).filter(function(e){return e.name}).reduce(function(e,t){var n,r=t.name,o=t.defaultValue;return a(a({},e),((n={})[r]=e[r]||String(o)||null,n))},{})}},f.createElement(ni,{features:R},f.createElement(Ir,{payload:D},f.createElement(Ur,a({},V),f.createElement(uo,null,f.createElement(ou,a({},S),f.createElement(qd,{className:j,style:O,sx:F},f.createElement(Ao,{isBaselineAlign:U,className:xo($d,(n={},n[Xd]=i,n[c.readonly]=t.readonly,n[c.rendering]=!i,n)),"data-testid":i?Xd:$d},f.createElement(Vd,a({},Y))))))))))))))};Zd.displayName="OneGenesis";var ef=function(){return f.createElement(f.Fragment,null)},tf=function(e){function t(t){var n=e.call(this,t)||this;return n.componentDidMount=function(){requestAnimationFrame(function(){n.setState({canRender:!0})})},n.render=function(){var e=n.props,t=e.children,r=e.ServerView,o=void 0===r?ef:r;return n.state.canRender?f.createElement(f.Fragment,null,t):f.createElement(o,null)},n.state={canRender:!1},n}return u(t,e),t}(f.Component),nf=function(e){var t,n,r=function(e){var t=e.name,n=e.validation,r=[];if(!t)return"continue";if(!n)return"continue";var o=n.required,i=n.pattern,a=n.minLength,l=n.maxLength,u=n.numeric,s=n.minNum,d=n.maxNum,f=n.date,m=n.time;o&&r.push(function(e){var n=zn(e,t);return!1===n||0===n||n?null:"Required"}),f&&r.push(function(e){var n;return(null===(n=zl(zn(e,t)))||void 0===n?void 0:n.isValid)?null:"The date is invalid"}),m&&r.push(function(e){var n;return(null===(n=Yl(zn(e,t)))||void 0===n?void 0:n.isValid)?null:"time date is invalid"}),u&&r.push(function(e){return isNaN(zn(e,t))?"Must be a number":null}),d&&r.push(function(e){return isNaN(zn(e,t))?"Must be a number":parseInt(zn(e,t))>d?"Maximum value reached":null}),s&&r.push(function(e){return isNaN(zn(e,t))?"Must be a number":parseInt(zn(e,t))<s?"Minimum value reached":null}),i&&r.push(function(e){return new RegExp(i.source,i.flags).test(zn(e,t))?null:"Pattern does not match"}),l&&r.push(function(e){var n;return((null===(n=zn(e,t))||void 0===n?void 0:n.length)||0)>l?"Maximum length reached":null}),a&&r.push(function(e){var n;return((null===(n=zn(e,t))||void 0===n?void 0:n.length)||0)<a?"Minimum length reached":null}),e.isInvalid||(e.isInvalid=function(e){var t,n;try{for(var o=(t=void 0,c(r)),i=o.next();!i.done;i=o.next()){var a=(0,i.value)(e);if(a)return a}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return null})};try{for(var o=c(Ar(e)),i=o.next();!i.done;i=o.next()){r(i.value)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return e},rf=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Date)return new Date(e);if(e instanceof RegExp)return new RegExp(e.source,e.flags);if(Array.isArray(e))return e.map(function(e){return rf(e)});if(Bn(e)){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=rf(e[n]));return t}return e},of=Symbol("never-value"),af=function(){return null},lf=function(){return null},cf=function(){return null},uf=function(){return null},sf=function(){return null},df=function(){return null},ff=function(){return null},mf=function(){return null},pf=function(){return null},hf=function(e){return e},vf=function(e){return e},gf=function(e){return e},bf=function(e){return e},yf=function(r){var o=function(e){var r=e.changeSubject,o=e.fields,i=e.handler,c=e.data,u=void 0===c?of:c,s=l(e,["changeSubject","fields","handler","data"]),d=Vr(u),f=h(function(){var e=rf(o);return nf(e)},[]);if(Fr(u===of))return a({handler:i,fields:f},s);var m=_r(r),p=Gr(u);return w(function(){return p.subscribe(function(e){m.next(e)})},[]),a({changeSubject:m,fields:f,handler:function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return d.current?[3,2]:[4,p.toPromise()];case 1:return[2,e.sent()];case 2:return[2,d.current]}})})}},s)}(r),i=o.createField,c=void 0===i?vs:i,u=o.createLayout,s=void 0===u?Sd:u,d=o.isBaseline,m=void 0===d?Md:d,p=o.isBaselineForRoot,v=void 0===p?Nd:p,g=o.apiRef,b=o.changeSubject,E=o.reloadSubject,x=o.updateSubject,C=no(o.onFocus||af),k=no(o.onBlur||lf),S=no(o.onMenu||cf),L=no(o.onClick||uf),N=no(o.onReady||sf),I=no(o.onChange||df),M=no(o.onInvalid||ff),R=no(o.onLoadStart||mf),P=no(o.onLoadEnd||pf),A=o.focus,T=void 0===A?C:A,D=o.blur,j=void 0===D?k:D,O=o.menu,F=void 0===O?S:O,_=o.click,B=void 0===_?L:_,H=o.ready,W=void 0===H?N:H,z=o.change,V=void 0===z?I:z,Y=o.invalidity,U=void 0===Y?M:Y,q=o.loadStart,$=void 0===q?R:q,X=o.loadEnd,G=void 0===X?P:X,K=o.features,Q=l(o,["focus","blur","menu","click","ready","change","invalidity","loadStart","loadEnd","features"]),J=no(o.readTransform||hf),Z=no(o.writeTransform||vf),ee=no(o.incomingTransform||gf),te=no(o.outgoingTransform||bf),ne={readTransform:y(function(e,t,n,r){return"string"==typeof e||Array.isArray(e)?J(e,t,n,r):e},[]),writeTransform:y(function(e,t,n,r){return"string"==typeof e||Array.isArray(e)?Z(e,t,n,r):e},[])},re={focus:T,blur:j,menu:F,click:B,ready:W,change:V,invalidity:U,loadStart:$,loadEnd:G},oe=h(function(){var t=K;return"function"==typeof K&&(t=K()),t&&!Array.isArray(t)&&(t=Object.entries(t).map(function(t){var n=e(t,2),r=n[0];return n[1]?r:null}).filter(function(e){return!!e})),t},[]),ie=a(a(a(a({},Q),re),ne),{incomingTransform:ee,outgoingTransform:te,createField:c,createLayout:s,isBaseline:m,isBaselineForRoot:v,features:oe});return f.createElement(tf,null,f.createElement(An,{apiRef:g,changeSubject:b,reloadSubject:E,updateSubject:x},f.createElement(ol,a({},ie),f.createElement(Ya,null,f.createElement(Zd,a({},ie))))))};yf.displayName="One";var wf=function(e){return f.createElement(yf,a({},e))};wf.displayName="OneTyped",yf.typed=wf;var Ef,xf="items-field",Cf=function(e){return t(void 0,[e],void 0,function(e){var r,o,i,a,l,c=e.itemList,u=void 0===c?[]:c,s=e.tr,d=void 0===s?function(e){return e}:s,f=e.payload,m=void 0===f?{}:f,p=e.object,h=void 0===p?{}:p;return n(this,function(e){switch(e.label){case 0:return r={},a=(i=Object).values,"function"!=typeof u?[3,2]:[4,Promise.resolve(u(h,m))];case 1:return l=e.sent(),[3,3];case 2:l=u,e.label=3;case 3:return o=a.apply(i,[l]),[4,Promise.all(o.map(function(e){return t(void 0,void 0,void 0,function(){var t,o;return n(this,function(n){switch(n.label){case 0:return t=r,o=e,[4,Promise.resolve(d(e,h,m))];case 1:return[2,t[o]=n.sent()]}})})}))];case 4:return e.sent(),[2,{labels:r,items:o}]}})})},kf=function(r){var o=r.itemList,i=void 0===o?[]:o,l=r.defaultList,c=void 0===l?[]:l,u=r.tr,s=void 0===u?function(e){return e}:u,d=b(!0),f=il(),m=f.loadStart,p=f.loadEnd,h=f.fallback,v=f.payload,y=qr().object,w=e(g({items:c,labels:{},loaded:!1,loading:!1}),2),x=w[0],C=w[1];return E(function(){x.loading&&!x.loaded&&t(void 0,void 0,void 0,function(){var e,t,r;return n(this,function(n){switch(n.label){case 0:e=!0,m&&m(xf),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,Cf({itemList:i,tr:s,object:y,payload:v})];case 2:return t=n.sent(),d.current&&C(a(a({},t),{loaded:!0,loading:!1})),[3,5];case 3:if(r=n.sent(),e=!1,!h)throw r;return h(r),[3,5];case 4:return p&&p(e,xf),[7];case 5:return[2]}})})},[x.loading]),E(function(){return C(function(e){return a(a({},e),{loading:!0,loaded:!1})}),function(){d.current=!1}},[]),x},Sf=function(e){var t=e.value,n=e.disabled,r=e.readonly,o=e.description,i=void 0===o?"":o,l=e.placeholder,c=void 0===l?"":l,u=e.outlined,s=void 0!==u&&u,d=e.itemList,m=void 0===d?[]:d,p=e.title,h=void 0===p?"":p,v=e.dirty,g=e.invalid,b=e.tr,y=void 0===b?function(e){return e.toString()}:b,w=e.onChange,E=il().payload,x=void 0===E?{}:E,C=qr().object,k=kf({itemList:m||[],payload:x,object:C,tr:y}),S=k.items,L=k.labels,N=k.loading,I=k.loaded;return f.createElement(Ee,{value:I&&t||null,onChange:function(e,t){return w(t)},getOptionLabel:function(e){return L[e]||""},options:S,loading:N,disabled:n,renderInput:function(e){return f.createElement(xe,a({},e,{variant:s?"outlined":"standard",label:h,placeholder:c,helperText:v&&g||i,error:v&&null!==g,value:"123",InputProps:a(a({},e.InputProps),{readOnly:r,endAdornment:f.createElement(f.Fragment,null,N?f.createElement(O,{color:"inherit",size:20}):null,e.InputProps.endAdornment)})}))}})},Lf=function(e){var t=e.value,n=e.disabled,r=e.readonly,o=e.description,i=e.placeholder,l=e.outlined,c=void 0!==l&&l,u=e.itemList,s=void 0===u?[]:u,d=e.dirty,m=e.invalid,p=e.title,h=e.tr,v=void 0===h?function(e){return e.toString()}:h,g=e.onChange,b=il().payload,y=void 0===b?{}:b,w=qr().object,E=kf({itemList:s||[],payload:y,object:w,tr:v}),x=E.items,C=E.labels,k=E.loading,S=E.loaded;return f.createElement(Ee,{multiple:!0,onChange:function(e,t){return g(t.length?t:null)},getOptionLabel:function(e){return C[e]||""},value:S&&t?Object.values(t):[],options:x,loading:k,disabled:n,renderTags:function(e,t){return e.map(function(e,n){return f.createElement(He,a({variant:c?"outlined":"filled",label:C[e]},t({index:n})))})},renderInput:function(e){return f.createElement(xe,a({variant:c?"outlined":"standard"},e,{label:p,placeholder:i,helperText:d&&m||o,error:d&&null!==m,InputProps:a(a({},e.InputProps),{readOnly:r,endAdornment:f.createElement(f.Fragment,null,k?f.createElement(O,{color:"inherit",size:20}):null,e.InputProps.endAdornment)})}))}})},Nf=new(function(){function e(){var e=this;this.abort=function(){var t;"AbortController"in window&&(null===(t=e._lastInstance)||void 0===t||t.abort(),e._lastInstance=new AbortController)},"AbortController"in window&&(this._lastInstance=new AbortController)}return Object.defineProperty(e.prototype,"signal",{get:function(){var e;return null===(e=this._lastInstance)||void 0===e?void 0:e.signal},enumerable:!1,configurable:!0}),e}()),If=function(e){function t(t,n,r){var o=e.call(this,t.message||"FetchError")||this;return o.originalError=t,o.request=n,o.response=r,o}return u(t,e),t}(Error),Mf=["POST","PUT","PATCH"],Rf=function(e,r){return t(void 0,void 0,void 0,function(){var t,o,i,l;return n(this,function(n){switch(n.label){case 0:t=e instanceof URL?e.toString():e,o=void 0,n.label=1;case 1:return n.trys.push([1,4,,5]),[4,fetch(t,a(a({},r),{headers:a(a({},Mf.includes(null===(l=null==r?void 0:r.method)||void 0===l?void 0:l.toUpperCase())&&{"Content-Type":"application/json"}),null==r?void 0:r.headers)}))];case 2:if(!(o=n.sent()).ok)throw new Error("fetchApi response not ok");return[4,o.json()];case 3:return[2,n.sent()];case 4:throw i=n.sent(),new If(i,t,o);case 5:return[2]}})})},Pf=function(e,r){var o=void 0===r?{}:r,i=o.fetch,l=void 0===i?window.fetch:i,c=o.origin,u=void 0===c?window.location.origin:c,s=o.abortSignal,d=void 0===s?Nf.signal:s,f=o.requestMap,m=void 0===f?function(e){return e}:f,p=o.responseMap,v=void 0===p?function(e){return e}:p,g=o.onLoadBegin,b=o.onLoadEnd,y=o.withAbortSignal,E=void 0===y||y,x=o.fetchParams,C=o.fallback,k=h(function(){return Kn(l)},[]),S=h(function(){return function(){return t(void 0,void 0,void 0,function(){var t,r,o,i,l;return n(this,function(n){switch(n.label){case 0:t=new URL(e,u),t=m(new URL(t)),g&&g(),r=!0,n.label=1;case 1:return n.trys.push([1,4,5,6]),[4,k(t.toString(),a({signal:d},x&&x()))];case 2:return(o=n.sent())===Xn?[2,null]:[4,o.json()];case 3:return i=n.sent(),[2,v(i)];case 4:if(l=n.sent(),k.clear(),r=!1,l instanceof If&&(l=l.originalError),l instanceof DOMException&&"AbortError"==l.name)return[2,null];if(C)return C(l),[2,null];throw l;case 5:return b&&b(r),[7];case 6:return[2]}})})}},[]);return w(function(){return function(){E&&Nf.abort()}},[]),w(function(){return function(){k.clear()}},[]),S},Af=function(e,r){return t(void 0,void 0,void 0,function(){var t,o;return n(this,function(n){switch(n.label){case 0:return"function"!=typeof e?[3,4]:(t=e(r))instanceof Promise?[4,t]:[3,2];case 1:return o=n.sent(),[3,3];case 2:o=t,n.label=3;case 3:return[2,o];case 4:return[2,e]}})})},Tf=function(r,o){var i=void 0===o?{}:o,a=i.resultMap,l=void 0===a?function(e){return e}:a,c=i.payload,u=i.onLoadBegin,s=i.onLoadEnd,d=i.fallback,f=e(g(null),2),m=f[0],p=f[1];w(function(){t(void 0,void 0,void 0,function(){var e,t,o;return n(this,function(n){switch(n.label){case 0:u&&u(),e=!0,n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,Af(r,c)];case 2:return t=n.sent(),p(l(t||{})),[3,5];case 3:if(o=n.sent(),e=!1,!d)throw o;return d(o),p(null),[3,5];case 4:return s&&s(e),[7];case 5:return[2]}})})},[]);return{data:m,change:function(e,t){t||p(e)}}},Df=function(e,r){return t(void 0,void 0,void 0,function(){var t,o;return n(this,function(n){switch(n.label){case 0:return"function"!=typeof e?[3,4]:(t=e(r))instanceof Promise?[4,t]:[3,2];case 1:return o=n.sent(),[3,3];case 2:o=t,n.label=3;case 3:return[2,o];case 4:return[2,e]}})})},jf=function(e,r){var o=void 0===r?{}:r,i=o.resultMap,a=void 0===i?function(e){return e}:i,l=o.onLoadBegin,c=o.onLoadEnd,u=o.fallback,s=h(function(){return function(r){return t(void 0,void 0,void 0,function(){var t,o,i;return n(this,function(n){switch(n.label){case 0:l&&l(),t=!0,n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,Df(e,r)];case 2:return o=n.sent(),[2,a(o||{})];case 3:if(i=n.sent(),t=!1,u)return u(i),[2,null];throw i;case 4:return c&&c(t),[7];case 5:return[2]}})})}},[]);return s},Of=function(){var e;return globalThis.location?"file:"===(null===(e=globalThis.location)||void 0===e?void 0:e.protocol)?ct():ut():ct()},Ff=p(null),_f=function(t){var n,r=t.children,o=e(g(null),2),i=o[0],a=o[1],l=y(function(e){return a(function(){return e})},[]),c={handleElement:l,handleClear:y(function(){return a(null)},[]),handleUpdate:(n=e(g(!0),2)[1],y(function(){n(function(e){return!e})},[]))};return f.createElement(tf,null,f.createElement(Dn,null,f.createElement(Ff.Provider,{value:c},r,i&&S(i))))},Bf=function(t,n){void 0===n&&(n=[]);var o=e(g(!1),2),i=o[0],a=o[1],l=v(Ff),c=l.handleElement,u=l.handleClear,s=l.handleUpdate,d=y(function(){c(t)},[]);return w(function(){i?d():u()},[i]),w(function(){i&&s()},r([i],e(n),!1)),{showModal:y(function(){a(!0)},[]),hideModal:y(function(){a(!1)},[])}},Hf=Tn()({dialog:{"&:first-of-type":{padding:0},overflow:"hidden"}}),Wf=function(e){var t=e.children,n=e.disabled,r=e.invalid,o=e.dividers,i=void 0!==o&&o,c=e.canCancel,u=void 0===c||c,s=e.noSave,d=void 0!==s&&s,m=e.onAccept,p=void 0===m?function(){return console.log("accept")}:m,h=e.onDismiss,v=void 0===h?function(){return console.log("dismiss")}:h,g=l(e,["children","disabled","invalid","dividers","canCancel","noSave","onAccept","onDismiss"]),b=Hf().classes;return f.createElement(st,a({},g),f.createElement(dt,{dividers:i,className:b.dialog},t),f.createElement(ft,null,!d&&f.createElement(ye,{disabled:n||r,color:"primary",onClick:p},"OK"),u&&f.createElement(ye,{disabled:n,color:"primary",onClick:v},"Cancel")))},zf=function(e){var t=e.onChange,n=void 0===t?function(e){return console.log({result:e})}:t,r=e.canCancel,o=void 0===r||r,i=e.title,a=e.msg,l=e.open,c=void 0===l||l;return f.createElement(Wf,{open:c,canCancel:o,onAccept:function(){return n(!0)},onDismiss:function(){return n(!1)}},f.createElement(mt,null,f.createElement(j,{mr:3},i)),f.createElement(j,{p:3},f.createElement(_,{variant:"body2"},a)))},Vf=function(r){var o=void 0===r?{}:r,i=o.title,l=void 0===i?"":i,c=o.msg,u=void 0===c?"":c,s=o.canCancel,d=void 0===s||s,m=b(),p=no(function(){return{currentCanCancel:d,currentTitle:l,currentMsg:u,open:!1}}),h=e(oo(p),2),v=h[0],g=h[1];w(function(){v.current.open||g(function(e){return a(a({},e),{currentTitle:l})})},[l]),w(function(){v.current.open||g(function(e){return a(a({},e),{currentMsg:u})})},[u]),w(function(){v.current.open||g(function(e){return a(a({},e),{currentCanCancel:d})})},[d]);var y=function(e){var t=m.current;t&&t(e),g(p),C()},E=Bf(function(){return f.createElement(zf,{open:!0,canCancel:v.current.currentCanCancel,title:v.current.currentTitle,msg:v.current.currentMsg,onChange:y})},[]),x=E.showModal,C=E.hideModal;return function(e){var r=void 0===e?{}:e,o=r.canCancel,i=r.title,a=r.msg;return new function(){var e=this;this.then=function(e){m.current=e},this.toPromise=function(){return t(e,void 0,void 0,function(){var e;return n(this,function(t){switch(t.label){case 0:return e=new lr,this.then(e.next),[4,e.toPromise()];case 1:return[2,t.sent()]}})})},g(function(e){return{currentTitle:void 0!==i?i:e.currentTitle,currentCanCancel:void 0!==o?o:e.currentCanCancel,currentMsg:void 0!==a?a:e.currentMsg,open:!0}}),x()}}},Yf="The form contains unsaved changes. Continue?",Uf=Of(),qf=function(r){var o=void 0===r?{}:r,i=o.history,l=void 0===i?Uf:i,c=o.waitForChangesDelay,u=void 0===c?1e3:c,s=o.readonly,d=void 0!==s&&s,f=o.data,m=void 0===f?null:f,p=o.onChange,h=o.onLoadStart,v=o.onLoadEnd,y=o.onBlock,x=void 0===y?function(){return function(){return null}}:y,C=o.onSave,k=void 0===C?function(){return!0}:C,S=o.onUpdate,L=void 0===S?function(){return null}:S,N=o.checkUpdate,I=void 0===N?function(){return!0}:N,M=o.checkDirty,R=void 0===M?function(){return!0}:M,P=o.shouldAutoSave,A=void 0===P?function(){return!1}:P,T=o.fallback,D=o.updateSubject,j=o.changeSubject,O=b(null),F=_r(D),_=_r(j),B=e(g(null),2),H=B[0],W=B[1],z=e(g(!1),2),V=z[0],Y=z[1],U=e(g(0),2),q=U[0],$=U[1],X=e(g(!1),2),G=X[0],K=X[1],Q=b(H),J=!!H&&!q,Z=!!q,ee=no(L),te=Vr(J),ne=Vr(Z),re=Vr(H);w(function(){return F.subscribe(function(t){var n=e(t,2),r=n[0],o=n[1];ne.current||I(r,o)&&(_.next(o),te.current&&W(o),ee(r,o))})},[]);var oe=_r();w(function(){return function(){oe.next()}},[]);var ie=b(),ae=al([H,V],10),le=Vf({title:"Continue?",msg:Yf}),ce=b(!0);E(function(){return function(){ce.current=!1}},[]);var ue=_r(),se=b(!1);w(function(){var e,r,o,i,a,c=function(){return l.block(function(e){return function(e){return t(void 0,void 0,void 0,function(){var t,r,o;return n(this,function(n){switch(n.label){case 0:return t=!1,A()?(r=t)?[3,2]:[4,fe()]:[3,3];case 1:r=n.sent(),n.label=2;case 2:t=r,n.label=3;case 3:return t?[3,6]:(o=t)?[3,5]:[4,se.current?ue.toPromise():new Promise(function(e){se.current=!0,le({msg:V?"The form contains invalid data. Continue?":Yf}).then(function(t){se.current=!1,ue.next(t),e(t)})})];case 4:o=n.sent(),n.label=5;case 5:t=o,n.label=6;case 6:return t&&u(),t&&e(),[2]}})})}(e.retry)})},u=function(){e&&e(),r&&r(),o&&o(),ie.current=null};return(H||V)&&(e=c(),i=x&&x(),r=function(){return i&&i()},a=function(e){return e.preventDefault(),Yf},window.addEventListener("beforeunload",a),o=function(){window.removeEventListener("beforeunload",a)},ie.current=u),u},[H,V]);var de=function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return ie.current&&ie.current(),ce.current?(W(null),Y(!1),[4,Promise.race([ae(),oe.toPromise()])]):[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})},fe=function(){return t(void 0,void 0,void 0,function(){var e,t,r,o;return n(this,function(n){switch(n.label){case 0:return te.current?ne.current?[2,!1]:[4,me()]:[2,!1];case 1:if(n.sent(),!(e=re.current))return[3,9];t=!0,h&&h(),$(function(e){return e+1}),n.label=2;case 2:return n.trys.push([2,6,7,8]),[4,Promise.resolve(k(e))];case 3:return(r=n.sent())?[4,de()]:[3,5];case 4:n.sent(),n.label=5;case 5:return t=!!r,[3,8];case 6:if(o=n.sent(),t=!1,ie.current&&ie.current(),!T)throw o;return T(o),[3,8];case 7:return function(e){v&&v(e),$(function(e){return e-1})}(t),[7];case 8:return[2,t];case 9:return[2,!1]}})})},me=function(){return t(void 0,void 0,void 0,function(){var e;return n(this,function(t){switch(t.label){case 0:e=l.block(function(){}),K(!0),t.label=1;case 1:return t.trys.push([1,,3,4]),[4,Promise.race([ae(),$n(u)])];case 2:return t.sent(),[3,4];case 3:return K(!1),e(),[7];case 4:return[2,re.current]}})})};return{beginSave:fe,afterSave:de,dropChanges:function(){var e=Q.current;e&&_.next(e),W(null),Y(!1)},waitForChanges:me,oneProps:a(a({apiRef:O,handler:function(){return m},change:function(e,t){void 0===t&&(t=!1);var n=re.current;R(n||{},e)&&(t||(ce.current&&W(e),ce.current&&Y(!1)),t&&(Q.current=e),p&&p(e,t))},invalidity:function(){Y(!0)},readonly:!!q||G||d},T&&{fallback:T}),{changeSubject:_}),apiRef:O,invalid:V,data:V?null:H,hasChanged:J,hasLoading:Z}},$f=function(e){return!e.noBaseline},Xf=function(e,t){void 0===t&&(t={});var n={};return Ar(e).filter(function(e){return!!e.name}).filter(function(e){return e.type!==jn.Phony}).filter(function(e){return e.type!==jn.Button}).filter(function(e){return e.type!==jn.Icon}).forEach(function(e){var r=e.type,o=e.name,i=e.defaultValue,a=e.hidden;Dr(n,o),("function"==typeof a?a(t):a)||Wn(n,o,void 0===i?zn(n,o)||Pr(r):"function"==typeof i?i(t):i)}),n},Gf=function(e,r){void 0===r&&(r={}),w(function(){var o=e();if(!(o instanceof Promise))return o;!function(e,r){t(void 0,[e,r],void 0,function(e,t){var r,o,i=t.onLoadStart,a=t.onLoadEnd,l=t.fallback,c=t.throwError;return n(this,function(t){switch(t.label){case 0:r=!0,i&&i(),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,e];case 2:return t.sent(),[3,5];case 3:if(o=t.sent(),r=!1,c)throw o;return l&&l(o),[3,5];case 4:return a&&a(r),[7];case 5:return[2]}})})}(o,r)},r.deps||[])},Kf=Tn()(function(e){return{content:{minWidth:"300px",maxWidth:"80vw",maxHeight:"80vh",overflowY:"auto",overflowX:"hidden",paddingTop:e.spacing(2),paddingLeft:e.spacing(1),paddingRight:e.spacing(1),paddingBottom:e.spacing(2)}}}),Qf=function(r){var o=r.waitForChangesDelay,i=void 0===o?600:o,c=r.fieldDebounce,u=r.noBadge,s=void 0!==u&&u,d=r.fields,m=r.handler,p=r.payload,v=void 0===p?{}:p,b=r.badgeColor,y=void 0===b?"info":b,w=r.color,E=void 0===w?"default":w,x=r.badgeOverlap,C=r.badgeSx,k=r.oneSx,S=r.isBaseline,L=r.isBaselineForRoot,N=r.onClose,I=r.onChange,M=r.onFocus,R=r.onBlur,P=r.onInvalid,A=r.reloadSubject,T=r.closeSubject,D=l(r,["waitForChangesDelay","fieldDebounce","noBadge","fields","handler","payload","badgeColor","color","badgeOverlap","badgeSx","oneSx","isBaseline","isBaselineForRoot","onClose","onChange","onFocus","onBlur","onInvalid","reloadSubject","closeSubject"]),j=Kf().classes,O=Fr(v),F=_r(A),_=_r(T),B=e(g(null),2),H=B[0],W=B[1],z=e(Sc(function(){return t(void 0,void 0,void 0,function(){var e,r,o,i;return n(this,function(a){switch(a.label){case 0:return e=function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return"function"!=typeof m?[3,2]:[4,m(O)];case 1:return[2,e.sent()];case 2:return[2,m]}})})},o=Tr,i=[{},Xf(d,O)],[4,e()];case 1:return r=o.apply(void 0,i.concat([a.sent()])),I&&I(r,!0),[2,r]}})})}),3),V=z[0],Y=z[1],U=Y.loading,q=Y.error,$=Y.execute,X=z[2];Gf(function(){return F.subscribe($)}),Gf(function(){return _.subscribe(function(){return W(null)})});var G=e(g(!1),2),K=G[0],Q=G[1],J=al([V],10),Z=Vr(V);Xr(function(){"function"!=typeof m&&X(m)},[m]);var ee=h(function(){return s?0:Object.values(V||{}).filter(function(e){return e}).length},[V]),te=h(function(){return to(function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,Promise.race([J(),$n(i)])];case 1:return e.sent(),[2]}})})];case 1:return e.sent(),I&&I(Z.current,!1),N&&N(Z.current),W(null),[2]}})})})},[]);return U||q?null:f.createElement(f.Fragment,null,f.createElement(pt,{badgeContent:ee,overlap:x,color:y,sx:C},f.createElement(Ne,a({},D,{onClick:function(e){var t=e.currentTarget;H||W(t)},color:K?"error":E}))),f.createElement(qe,{keepMounted:!0,open:!!H,anchorEl:H,onClose:te,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"right"}},f.createElement(yf,{className:j.content,sx:k,transparentPaper:!0,fieldDebounce:c,fields:d,payload:O,handler:function(){return V},isBaseline:S,isBaselineForRoot:L,onChange:function(e,t){t||(X(e),Q(!1),I&&I(e,!1))},onInvalid:function(e,t,n){Q(!0),P&&P(e,t,n)},onFocus:M,onBlur:R})))},Jf="react-declarative__oneButtonContent",Zf=Tn()(function(e){return{content:{minWidth:"300px",maxWidth:"80vw",maxHeight:"80vh",overflowY:"auto",overflowX:"hidden",paddingTop:e.spacing(2),paddingLeft:e.spacing(1),paddingRight:e.spacing(1),paddingBottom:e.spacing(2)}}}),em=function(r){var o=r.waitForChangesDelay,i=void 0===o?600:o,c=r.fieldDebounce,u=r.withCloseAfterChange,s=void 0!==u&&u,d=r.noBadge,m=void 0!==d&&d,p=r.fields,v=r.handler,b=r.payload,y=void 0===b?{}:b,E=r.badgeColor,x=void 0===E?"info":E,C=r.color,k=void 0===C?"primary":C,S=r.badgeOverlap,L=r.badgeSx,N=r.oneSx,I=r.onChange,M=void 0===I?function(){}:I,R=r.onClose,P=r.onFocus,A=r.onBlur,T=r.isBaseline,D=r.isBaselineForRoot,j=r.onInvalid,O=r.readTransform,F=r.writeTransform,_=r.incomingTransform,B=r.outgoingTransform,H=r.reloadSubject,W=r.closeSubject,z=l(r,["waitForChangesDelay","fieldDebounce","withCloseAfterChange","noBadge","fields","handler","payload","badgeColor","color","badgeOverlap","badgeSx","oneSx","onChange","onClose","onFocus","onBlur","isBaseline","isBaselineForRoot","onInvalid","readTransform","writeTransform","incomingTransform","outgoingTransform","reloadSubject","closeSubject"]),V=Zf().classes,Y=Fr(y),U=e(g(null),2),q=U[0],$=U[1],X=e(g(!1),2),G=X[0],K=X[1],Q=no(M),J=_r(H),Z=_r(W),ee=e(Sc(function(){return t(void 0,void 0,void 0,function(){var e,r,o,i;return n(this,function(a){switch(a.label){case 0:return e=function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return"function"!=typeof v?[3,2]:[4,v(Y)];case 1:return[2,e.sent()];case 2:return[2,v]}})})},o=Tr,i=[{},Xf(p,Y)],[4,e()];case 1:return r=o.apply(void 0,i.concat([a.sent()])),Q(r,!0),[2,r]}})})}),4),te=ee[0],ne=ee[1],re=ne.loading,oe=ne.error,ie=ne.execute,ae=ee[2],le=ee[3].data$;Gf(function(){return J.subscribe(ie)}),Gf(function(){return Z.subscribe(function(){return $(null)})});var ce=e(g(!1),2),ue=ce[0],se=ce[1],de=al([te],10);Xr(function(){"function"!=typeof v&&ae(v)},[v]);var fe=h(function(){return m?0:Object.values(te||{}).filter(function(e){return e}).length},[te]),me=h(function(){return to(function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return K(!0),[4,t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,Promise.race([de(),$n(i)])];case 1:return e.sent(),[2]}})})];case 1:return e.sent(),Q(le.current,!1),R&&R(le.current),$(null),K(!1),[2]}})})})},[]),pe=_r();return w(function(){if(q&&s){var e=pe.once(function(){var t=Zn(function(t){var n=t.clientX,r=t.clientY,o=document.elementFromPoint(n,r);(null==o?void 0:o.closest(".".concat(Jf)))||(me(),e&&e())},15);document.addEventListener("mousemove",t),e=function(){document.removeEventListener("mousemove",t),t.clear()}});return function(){return e()}}},[q]),re||oe?null:f.createElement(f.Fragment,null,f.createElement(pt,{badgeContent:fe,overlap:S,color:x,sx:L},f.createElement(ye,a({},z,{onClick:function(e){var t=e.currentTarget;q||$(t)},color:ue?"error":k}))),f.createElement(qe,{keepMounted:!0,open:!!q,anchorEl:q,onClose:me,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"right"}},f.createElement(yf,{className:xo(V.content,Jf),sx:N,transparentPaper:!0,fieldDebounce:c,fields:p,payload:Y,handler:function(){return te},readonly:G,isBaseline:T,isBaselineForRoot:D,onChange:function(e,t){t||(ae(e),se(!1),Q(e,!1),pe.next())},onInvalid:function(e,t,n){se(!0),j&&j(e,t,n)},readTransform:O,writeTransform:F,incomingTransform:_,outgoingTransform:B,onFocus:P,onBlur:A})))},tm="react-declarative__scrollViewTarget",nm=Tn()({root:{display:"flex",alignItems:"stretch",justifyContent:"stretch"},container:{flex:1,position:"relative"},overflowX:{overflowX:"auto"},noOverflowX:{overflowX:"hidden"},overflowY:{overflowY:"auto"},noOverflowY:{overflowY:"hidden"},hideScrollbar:{"&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"},content:{position:"absolute",top:0,left:0},stretch:{display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *":{flex:1}},center:{display:"flex",alignItems:"center",justifyContent:"center"}}),rm=function(e){var t,n,r=e.children,o=e.className,i=e.style,c=e.center,u=void 0!==c&&c,s=e.withScrollbar,d=void 0!==s&&s,m=e.hideOverflowX,p=void 0!==m&&m,h=e.hideOverflowY,v=void 0!==h&&h,g=l(e,["children","className","style","center","withScrollbar","hideOverflowX","hideOverflowY"]),b=nm().classes,y=yi(),w=y.elementRef,E=y.size,x=E.height,C=E.width;return f.createElement(j,a({className:xo(o,b.root),style:i},g),f.createElement("div",{ref:w,className:xo(b.container,tm,(t={},t[b.hideScrollbar]=!d,t[b.overflowX]=!p,t[b.overflowY]=!v,t[b.noOverflowX]=p,t[b.noOverflowY]=v,t))},f.createElement("div",{className:xo(b.content,(n={},n[b.stretch]=!u,n[b.center]=u,n)),style:{minHeight:x,minWidth:C}},r)))},om=Tn()(function(e,t){var n=t.size;return{root:{display:"inline-flex",alignItems:"stretch",justifyContent:"stretch",height:n,width:n},container:{position:"relative",height:n,width:n,flex:1},icon:{position:"absolute",height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center",top:0,left:0,right:0,bottom:0,zIndex:1},spinner:{position:"absolute",height:"100%",width:"100%",top:0,left:0,right:0,bottom:0,zIndex:0}}}),im=function(r){var o=r.className,i=r.style,c=r.sx,u=r.noProgress,s=void 0!==u&&u,d=r.throwError,m=void 0!==d&&d,p=r.disabled,h=void 0!==p&&p,v=r.size,y=void 0===v?40:v,w=r.thickness,x=void 0===w?3.6:w,C=r.color,k=void 0===C?"primary":C,S=r.onLoadStart,L=r.onLoadEnd,N=r.onClick,I=void 0===N?function(){}:N,M=r.fallback,R=r.children,P=l(r,["className","style","sx","noProgress","throwError","disabled","size","thickness","color","onLoadStart","onLoadEnd","onClick","fallback","children"]),A=om({size:y,thickness:x}).classes,T=e(g(0),2),D=T[0],F=T[1],_=b(!0);E(function(){return function(){_.current=!1}},[]);var B=Vr(D);return f.createElement(j,{className:xo(o,A.root),style:i,sx:c},f.createElement(Te,a({},P,{className:A.container,disabled:!!D||h,onClick:function(e){return t(void 0,void 0,void 0,function(){var t,r;return n(this,function(n){switch(n.label){case 0:if(B.current)return[2];t=!0,n.label=1;case 1:return n.trys.push([1,3,4,5]),S&&S(),_.current&&F(function(e){return e+1}),[4,I(e)];case 2:return n.sent(),[3,5];case 3:if(r=n.sent(),t=!1,m)throw r;return M&&M(r),[3,5];case 4:return L&&L(t),_.current&&F(function(e){return e-1}),[7];case 5:return[2]}})})},color:k}),!!D&&!s&&f.createElement("div",{className:A.spinner},f.createElement(O,{size:y,thickness:x})),f.createElement(j,{className:A.icon},R)))},am=Tn()(function(e){var t;return{root:(t={display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column",minHeight:"100%",width:"100%"},t["& .".concat(tm)]={"& > div > div":{marginBottom:e.spacing(2)}},t),container:{position:"relative",flex:1,display:"flex",alignItems:"stretch",justifyContent:"stretch"},content:{flex:1,display:"flex"},cell:{border:"1px solid ".concat(e.palette.action.active),padding:e.spacing(.5),margin:e.spacing(.5)},headerCell:{background:e.palette.primary.main,color:e.palette.getContrastText(e.palette.background.default)},fabFullscreen:{position:"absolute",transition:"opacity 150ms",opacity:0,bottom:10,right:10,zIndex:2},fabFullscreenToggle:{opacity:1}}}),lm=function(e){if("Sanitizer"in window){var t=new window.Sanitizer,n=document.createElement("div");return n.setHTML(e,{sanitizer:t}),n.innerHTML}return e},cm=x(function(t,n){var r,o=t.data,i=t.maxCols,c=void 0===i?25:i,u=t.maxRows,s=void 0===u?100:u,d=t.withHeader,m=t.withFullScreen,p=t.className,v=t.style,b=t.sx,y=l(t,["data","maxCols","maxRows","withHeader","withFullScreen","className","style","sx"]),w=am().classes,E=e(g(!1),2),x=E[0],C=E[1],k=h(function(){return function(e){var t=e.reduce(function(e,t){return Math.max(e,t.length)},0);return e.map(function(e){var n=Array(t).fill("");return e.forEach(function(e,t){return n[t]=e}),n})}(o)},[o]),S=h(function(){if(!d)return[];var t=e(k,1)[0];return(void 0===t?[]:t).slice(0,c)},[d,k,c]),L=h(function(){return d?k.slice(1,s).map(function(e){return e.slice(0,c)}):k.slice(0,s).map(function(e){return e.slice(0,c)})},[d,s,c,k]);return f.createElement(j,a({},y,{ref:n,className:xo(w.root,p),style:v,sx:b,onMouseEnter:function(){C(!0)},onMouseLeave:function(){C(!1)}}),f.createElement(j,{className:w.container},f.createElement(rm,{withScrollbar:!0,className:w.content},f.createElement("table",null,!!S.length&&f.createElement("thead",null,f.createElement("tr",null,S.map(function(e,t){return f.createElement("th",{key:"".concat(e,"-").concat(t),className:w.headerCell},e)}))),f.createElement("tbody",null,L.map(function(e,t){return f.createElement("tr",{key:"".concat(e.length,"-").concat(t)},e.map(function(e,t){return f.createElement("td",{key:"".concat(e,"-").concat(t),className:w.cell},e)}))})))),m&&f.createElement(im,{className:xo(w.fabFullscreen,(r={},r[w.fabFullscreenToggle]=x,r)),color:"primary",size:48,onClick:function(e){e.preventDefault(),e.stopPropagation();var t=function(e,t){var n="";return n+="<style>table{border-collapse:collapse;min-width:100%}td,th{border:1px solid #ddd;text-align:left;padding:8px}th{background-color:#f2f2f2}</style>",n+="<table>",e.length&&(n+="<thead>",n+="<tr>",e.forEach(function(e){n+="<th>".concat(lm(e),"</th>")}),n+="</tr>",n+="</thead>"),n+="<tbody>",t.forEach(function(e){n+="<tr>",e.forEach(function(e){n+="<td>".concat(lm(e),"</td>")}),n+="</tr>"}),n+="</tbody>"}(S,L),n=window.open("about:blank","_blank","width=600,height=400");n&&(n.document.write(t),n.document.close())}},f.createElement(ht,{color:"inherit"}))))}),um=Tn()({root:{display:"flex",alignItems:"center",justifyContent:"center"},container:{position:"relative"},content:{position:"absolute",top:0,left:0,transform:"translate(-50%, -50%)",borderRadius:"50%"}}),sm=function(e){var t=e.className,n=e.color,r=e.side,o=l(e,["className","color","side"]),i=um().classes;return f.createElement(j,a({className:xo(t,i.root)},o),f.createElement("div",{className:i.container},f.createElement(j,{className:i.content,sx:{background:n,height:r,width:r}})))},dm=f.createContext(null),fm=function(e){return f.createElement(dm.Provider,{value:e},e.children)},mm=function(){return v(dm)},pm=p(null),hm=function(){return v(pm)},vm=function(t){var n=t.children,o=t.selectedRows,i=e(g(new Set(o)),2),a=i[0],l=i[1],c=mm().onSelectedRows,u=Ni(),s=u.delay$,d=u.doDelay,f=function(t,n){void 0===n&&(n=!1),d(),c&&c(r([],e(t),!1),n),l(new Set(t))},p={selection:a,setSelection:f};return w(function(){if(o&&!s.current){var e=new Set(o);(function(e,t){if(e.size!==t.size)return!1;var n=!0;return e.forEach(function(e){!t.has(e)&&n&&(n=!1)}),t.forEach(function(t){!e.has(t)&&n&&(n=!1)}),n})(e,a)||f(e)}},[o]),m.createElement(pm.Provider,{value:p},n)},gm=function(e,t){var n=t.one,r=t.many,o=t.two,i=void 0===o?r:o;return"".concat(e," ").concat(function(){if(0===e||e>=11&&e<20)return r;var t=e%10;return 0===t?r:1===t?n:t<5?i:r}())},bm=Tn()({root:{display:"flex",alignItems:"center",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"},"& .MuiTablePagination-selectLabel":{display:"none"},"& .MuiToolbar-root":{paddingLeft:"unset !important"},"& .MuiToolbar-root > .MuiInputBase-root":{marginRight:"unset !important"},"& .MuiTablePagination-displayedRows":{transform:"translateY(-1px)",marginLeft:"10px",marginRight:"10px"},"& .MuiTablePagination-actions":{marginLeft:"unset !important"},"& .MuiToolbar-root > .MuiPagination-root":{marginLeft:"unset !important"},"& .MuiToolbar-root > .MuiPagination-root > .MuiPagination-ul":{flexWrap:"nowrap"},overflowX:"auto"},label:{margin:0,padding:0,paddingLeft:15,whiteSpace:"nowrap"},disabled:{pointerEvents:"none",opacity:.5},stretch:{flex:1}}),ym=function(e){return"Selected: ".concat(gm(e,{one:"item",many:"items"}))},wm=function(){return f.createElement(O,{size:"16px"})},Em=function(e){var t,n=bm().classes,r=hm().selection,o=mm(),i=o.loading,l=o.selectionLabel,c=void 0===l?ym:l,u=o.fallback,s=o.rows,d=o.BeforeSelectionLabel,m=no(function(){return c(r.size)});return f.createElement(j,a({},e,{className:xo(e.className,n.root,(t={},t[n.disabled]=i,t))}),d&&f.createElement(d,a({},o)),f.createElement(_,{variant:"body1",className:n.label},f.createElement(Zr,{Loader:wm,deps:[r,s],fallback:u,throwError:!0},m)),f.createElement("div",{className:n.stretch}),e.children)},xm=function(e){var t=e.className,n=e.count,r=e.page,o=e.rowsPerPage,i=e.onPageChange,l=Math.ceil(n/o),c=r+1;return f.createElement(kt,{className:t,page:c,count:-1===n?Math.max(c+1,10):l,renderItem:function(e){return f.createElement(Ct,a({components:{previous:Xe,next:Ge}},e))},size:"small",onChange:function(e,t){return i(e,t-1)}})},Cm=function(e){var t=e.width;e.height;var n=l(e,["width","height"]),r=mm(),o=r.withArrowPagination,i=void 0!==o&&o,c=r.withRangePagination,u=void 0!==c&&c,s=r.noDisplayedRows,d=void 0!==s&&s,m=r.rowsPerPage,p=r.limit,h=r.loading,v=t>500&&u?xm:void 0,g=n.count,b=n.rowsPerPage,y=n.page,E=n.onPageChange,x=no(function(e,t){if(-1===g)E(e,Math.max(y+t,0));else{var n=Math.ceil(g/b)-1;E(e,Math.min(Math.max(y+t,0),n))}});return w(function(){var e=function(e){var t=e.key;"ArrowRight"===t?x(e,1):"ArrowLeft"===t&&x(e,-1)};return i&&!h&&document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}},[i,h]),f.createElement(xt,a({},n,{sx:a(a({},d&&{"& .MuiTablePagination-displayedRows":{display:"none"}}),{width:t,overflow:"hidden",overflowX:"auto"}),component:Em,rowsPerPageOptions:m,labelDisplayedRows:function(e){var t=e.page,n=e.count;return-1===n?"#".concat(t+1):"".concat(t+1,"/").concat(Math.ceil(n/p))},labelRowsPerPage:"",ActionsComponent:v}))},km=Symbol("resize-event"),Sm=function(t){function n(){var n=t.apply(this,r([],e(arguments),!1))||this;return n.lastHeightRequest=n.props.heightRequest,n.lastWidthRequest=n.props.widthRequest,n._patchSizeRequest=function(e){e.heightRequest&&(n.lastHeightRequest=e.heightRequest),e.widthRequest&&(n.lastWidthRequest=e.widthRequest)},n.state={height:n.props.defaultHeight||0,width:n.props.defaultWidth||0,childHeight:n.props.defaultHeight||0,childWidth:n.props.defaultWidth||0},n._onResize=function(){var e=n.props.onResize;if(n._parentNode){var t=n._parentNode.offsetHeight||0,r=n._parentNode.offsetWidth||0,o=window.getComputedStyle(n._parentNode)||{},i=parseInt(o.paddingLeft,10)||0,a=parseInt(o.paddingRight,10)||0,l=t-(parseInt(o.paddingTop,10)||0)-(parseInt(o.paddingBottom,10)||0),c=r-i-a,u=n.lastHeightRequest(l),s=n.lastWidthRequest(c),d=!1;(d=(d=(d=(d=d||n.state.height!==l)||n.state.width!==c)||n.state.childHeight!==u)||n.state.childWidth!==s)&&(n.setState({height:l,width:c,childHeight:u,childWidth:s}),e({height:t,width:r}))}},n._setRef=function(e){n._autoSizer=e},n}return u(n,t),n.prototype.shouldComponentUpdate=function(e,t){this._patchSizeRequest(e);var n=!1;if(n=(n=(n=(n=n||this.state.height!==t.height)||this.state.width!==t.width)||this.state.childHeight!==t.childHeight)||this.state.childWidth!==t.childWidth)return!0;var r=!1;return r=(r=(r=(r=(r=r||e.className!==this.props.className)||e.withContainerHeight!==this.props.withContainerHeight)||e.withContainerWidth!==this.props.withContainerWidth)||!Vn(e.style,this.props.style))||e.payload!==this.props.payload},n.prototype.componentDidMount=function(){var e,t,n,r=this.props.target||this._autoSizer;this.props.closest&&(r=(null==r?void 0:r.closest(this.props.closest))||null),this.props.selector&&(r=(null==r?void 0:r.querySelector(this.props.selector))||null),r&&r.parentNode&&r.parentNode.ownerDocument&&r.parentNode.ownerDocument.defaultView&&r.parentNode instanceof r.parentNode.ownerDocument.defaultView.HTMLElement&&(this._parentNode=r.parentNode,this._detectElementResize=(e=new Un,t=function(){return e.emit(km)},n=new ResizeObserver(t),{addResizeListener:function(r,o){e.hasListeners||window.addEventListener("resize",t),n.observe(r),e.subscribe(km,o)},removeResizeListener:function(r,o){n.unobserve(r),e.unsubscribe(km,o),e.hasListeners||window.removeEventListener("resize",t)}}),this._detectElementResize.addResizeListener(this._parentNode,this._onResize),this._onResize())},n.prototype.componentWillUnmount=function(){this._detectElementResize&&this._parentNode&&this._detectElementResize.removeResizeListener(this._parentNode,this._onResize)},n.prototype.render=function(){var e=this.props,t=e.children,n=e.className,r=e.withContainerHeight,o=e.withContainerWidth,i=e.style,l=this.state,c=l.height,u=l.width,s=l.childHeight,d=l.childWidth,m={overflow:"visible"},p={payload:this.props.payload};return r&&(m.height=c),p.height=s,o&&(m.width=u),p.width=d,f.createElement("div",{className:n,ref:this._setRef,style:a(a({},m),i)},t(p))},n.defaultProps={onResize:function(){},heightRequest:function(e){return e},widthRequest:function(e){return e},withContainerHeight:!1,withContainerWidth:!1,style:{}},n}(f.Component),Lm=function(e,t){return function(n){return n>=e&&n<t}},Nm=function(e){var t=e.desktopView,n=void 0===t?function(){return f.createElement(f.Fragment,null)}:t,r=e.tabletView,o=void 0===r?n:r,i=e.phoneView,c=void 0===i?o:i,u=e.onViewChanged,s=e.params,d=l(e,["desktopView","tabletView","phoneView","onViewChanged","params"]),m=re(),p=b(""),v=h(function(){var e=m.breakpoints.values,t=e.xs,n=void 0===t?0:t,r=e.sm,o=void 0===r?600:r,i=e.lg,a=void 0===i?1280:i;return{isPhone:Lm(n,o),isTablet:Lm(o,a),isDesktop:Lm(a,1e16)}},[m]),g=v.isPhone,y=v.isTablet,w=function(e){p.current!==e&&u&&u(e),p.current=e},E=function(e){var t=e.width,r=e.payload,i="object"==typeof r?r:{payload:r};return g(t)?(w("phone"),f.createElement(c,a({},i))):y(t)?(w("tablet"),f.createElement(o,a({},i))):(w("desktop"),f.createElement(n,a({},i)))};return s?E(s):f.createElement(Sm,a({},d),E)},Im=function(e,t){return function(n){return n>=e&&n<t}},Mm=function(e){var t=re(),n=h(function(){var e=t.breakpoints.values,n=e.xs,r=void 0===n?0:n,o=e.sm,i=void 0===o?600:o,a=e.lg,l=void 0===a?1280:a;return{isPhoneFn:Im(r,i),isTabletFn:Im(i,l),isDesktopFn:Im(l,1e16)}},[t]),r=n.isPhoneFn,o=n.isTabletFn,i=n.isDesktopFn;return{isPhone:r(e),isTablet:o(e),isDesktop:i(e)}};!function(e){e.Phone="phone",e.Tablet="tablet",e.Desktop="desktop"}(Ef||(Ef={}));var Rm,Pm=Ef,Am=e(xr(),2),Tm=Am[0],Dm=Am[1],jm=f.createContext(null),Om=function(e){var t=e.children,n=e.value,r=void 0===n?{}:n;return f.createElement(jm.Provider,{value:r},t)},Fm=function(){return v(jm)},_m=f.createContext(null),Bm=function(e){var t=e.children,n=e.limit,r=e.offset,o=h(function(){return{limit:n,offset:r}},[n,r]);return f.createElement(_m.Provider,{value:o},t)},Hm=function(){return v(_m)},Wm=p(null),zm=function(e){var t=e.children,n=e.value,r=Fr(void 0===n?{}:n);return f.createElement(Wm.Provider,{value:r},t)},Vm=function(){return v(Wm)},Ym=f.createContext(null),Um=function(e){return f.createElement(Ym.Provider,{value:e.value},e.children)},qm=function(){return v(Ym)},$m=function(e){var t=v(Hh).CheckboxCell;return f.createElement(t,a({},e))},Xm=Tn()({root:{position:"relative"}}),Gm=function(e){var t=Xm().classes;return f.createElement(Et,{className:t.root,padding:"checkbox"},f.createElement($m,a({},e)))},Km=function(e){var t=v(Hh).CommonCell;return f.createElement(t,a({},e))};!function(e){e.Text="text-cell",e.Action="action-cell",e.CheckBox="checkbox-cell",e.Compute="compute-cell",e.Component="component-cell"}(Rm||(Rm={}));var Qm=Rm,Jm=Tn()({root:{position:"relative",overflow:"hidden",paddingLeft:"0px !important",paddingRight:"0 !important",overflowWrap:"break-word"}}),Zm=function(e){var t=Jm().classes,n=e.column,r=n.type===Qm.Component?"none":n.type===Qm.CheckBox?"checkbox":"normal",o=n.type===Qm.Action?"center":"left",i=n.width,l=i,c=n.minHeight;return f.createElement(Et,{className:t.root,style:{minWidth:i,maxWidth:l,minHeight:c},align:o,padding:r},f.createElement(Km,a({},e)))},ep=function(){var e=mm(),r=e.handleReload,o=e.computeKeepPageOnReload;return function(e){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return o()?[3,2]:[4,r(!1)];case 1:case 3:return[2,t.sent()];case 2:return[4,r(e)]}})})}},tp=!1,np=null,rp=new lr,op=function(){return t(void 0,void 0,void 0,function(){var e,t,r,o,i,a,l,u,s,d,f;return n(this,function(n){switch(n.label){case 0:return[4,rp.next()];case 1:if(n.sent(),tp=!0,np)return np(),[2];if(e=window.location,t=e.href,r=e.origin,o=e.protocol,!("caches"in window))return[3,10];n.label=2;case 2:return n.trys.push([2,8,9,10]),[4,window.caches.keys()];case 3:i=c.apply(void 0,[n.sent()]),a=i.next(),n.label=4;case 4:return a.done?[3,7]:(l=a.value,[4,caches.delete(l)]);case 5:n.sent(),n.label=6;case 6:return a=i.next(),[3,4];case 7:return[3,10];case 8:return u=n.sent(),d={error:u},[3,10];case 9:try{a&&!a.done&&(f=i.return)&&f.call(i)}finally{if(d)throw d.error}return[7];case 10:return"file:"!==o?((s=new URL(t,r)).pathname="/",s.search="",s.hash="",window.location.href=s.toString()):window.location.reload(!0),[2]}})})};window&&window.addEventListener&&window.addEventListener("beforeunload",function(e){tp&&e.stopImmediatePropagation()},!0),op.override=function(e){np=e},op.listen=function(e){return rp.subscribe(e)};var ip,ap=function(e){return new function(){this.getValue=function(){try{return JSON.parse(sessionStorage.getItem(e)||"null")}catch(e){return null}},this.setValue=function(t){try{sessionStorage.setItem(e,JSON.stringify(t,null,2))}catch(e){e instanceof DOMException&&(console.log("react-declarative createSsManager exceeded the quota"),sessionStorage.clear(),op())}},this.clear=function(){sessionStorage.removeItem(e)}}},lp=function(e){return e instanceof Promise?new Promise(function(r,o){return t(void 0,void 0,void 0,function(){var t,i;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,e];case 1:return t=n.sent(),r(!t),[3,3];case 2:return i=n.sent(),o(i),[3,3];case 3:return[2]}})})}):!e},cp=function(t){var n=e(t.split("_")),o=n[0],i=n.slice(1);return r(["".concat(o.charAt(0).toUpperCase()).concat(o.slice(1))],e(i),!1).join(" ")},up=p(null),sp=function(){return v(up)},dp=function(t){var n=t.children,o=t.sortModel,i=mm().withSingleSort,a=void 0!==i&&i,l=e(g(new Map(o.map(function(e){return[String(e.field),e]}))),2),c=l[0],u=l[1],s=Vr(c),d=mm().handleSortModel,f={sortModel:c,setSortModel:function(t){var n=s.current;if(a){var o=r([],e(t.values()),!1).find(function(e){var t=e.field,r=e.sort,o=n.get(t);return!o||o.sort!==r});t.forEach(function(e){var n=e.field;n!==(null==o?void 0:o.field)&&t.delete(n)})}d(r([],e(t.values()),!1)),u(new Map(t))}};return m.createElement(up.Provider,{value:f},n)},fp=Tn()(function(e,t,n){var r;return{inactive:{opacity:.5},container:{width:300,height:340},list:(r={},r["& > .".concat(n.item,":nth-of-type(2n)")]={background:$(e.palette.getContrastText(e.palette.background.paper),.04)},r),item:{"& .MuiListItemText-root > .MuiTypography-root":{maxWidth:215,overflow:"hidden",textOverflow:"ellipsis"}}}}),mp=function(t){var n=t.columns,r=t.onClose,o=fp().classes,i=sp(),c=i.sortModel,u=i.setSortModel,s=e(g(new Map(c)),2),d=s[0],m=s[1],p=n.map(function(e){var t=e.sortable,n=void 0===t||t,r=l(e,["sortable"]);return a({sortable:n},r)}).filter(function(e){return e.sortable});return f.createElement(Wf,{open:!0,onAccept:function(){u(d),r()},onDismiss:function(){r()}},f.createElement(j,{className:o.container},f.createElement(Ie,{className:o.list,disablePadding:!0},p.map(function(e,t){var n=d.get(e.field||""),r=(null==n?void 0:n.sort)||void 0,i="asc"===r?f.createElement(St,null):"desc"===r?f.createElement(Lt,null):f.createElement(St,{className:o.inactive}),a=e.headerName,l=void 0===a?cp(e.field||"")||"Unknown":a;return f.createElement(tt,{key:t,className:o.item,secondaryAction:i,onClick:function(){return function(e){var t=new Map(d),n=t.get(e);n?"asc"===n.sort?t.set(e,{field:e,sort:"desc"}):"desc"===n.sort&&t.delete(e):t.set(e,{field:e,sort:"asc"}),m(t)}(e.field)},component:Me},f.createElement(Oe,{primary:l}))}))))},pp=function(){return v(hp)},hp=p(null),vp=function(e){var t=e.children,n=mm().columns,r=h(function(){return n.filter(function(e){var t=!!e.field;return t=(t=t&&!1!==e.sortable)&&e.type!==Qm.Action})},[]),o=Bf(function(){return f.createElement(mp,{columns:r,onClose:function(){return a()}})},[]),i=o.showModal,a=o.hideModal;return f.createElement(hp.Provider,{value:function(){return i()}},t)},gp=function(e){var t=e.children;return f.createElement(_f,null,f.createElement(vp,null,t))},bp=p(null),yp=function(){return v(bp)},wp=function(t){var n=t.children,o=e(g(new Map),2),i=o[0],a=o[1],l=mm().rows,u=hm().selection;w(function(){var e,t,n,r;if(u.size){var o=function(e){var t=l.find(function(t){return t.id===e});t&&i.set(e,t)};try{for(var s=c(u),d=s.next();!d.done;d=s.next()){o(p=d.value)}}catch(t){e={error:t}}finally{try{d&&!d.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}try{for(var f=c(i.keys()),m=f.next();!m.done;m=f.next()){var p=m.value;u.has(p)||i.delete(p)}}catch(e){n={error:e}}finally{try{m&&!m.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}a(new Map(i))}else a(new Map)},[u,l]);var s=h(function(){return r([],e(u),!1).map(function(e){return i.get(e)})},[i]),d={cachedRows:i,selectedRows:s};return m.createElement(bp.Provider,{value:d},n)},Ep=function(){var e=mm().handleFilter;return function(){return e({})}},xp=e(vl(),2),Cp=xp[0],kp=xp[1],Sp=function(e){var t=v(Hh).OperationListSlot;return f.createElement(t,a({},e))},Lp=function(e){var t=v(Hh).ActionListSlot;return f.createElement(t,a({},e))},Np=function(e){var t=v(Hh).FilterListSlot;return f.createElement(t,a({},e))},Ip=function(e){var t=v(Hh).ChipListSlot;return f.createElement(t,a({},e))},Mp=function(e){var t=v(Hh).SearchSlot;return f.createElement(t,a({},e))},Rp="react-declarative__listRootMark",Pp=[],Ap=Tn()({root:{position:"relative",height:"100%",width:"100%"},container:{position:"absolute",top:0,left:0},content:{position:"relative",display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column"},inner:{position:"absolute",top:0,left:0,display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column",overflow:"hidden","& > :nth-of-type(1)":{flex:1}},stretch:{flex:1},noElevation:{background:"transparent"},beforeActionList:{width:"100%",display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *":{flex:1}},afterActionList:{width:"100%",display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *":{flex:1}},hidden:{display:"none"},rendering:{visibility:"hidden"}}),Tp=x(function(t,n){var r,o,i,a,l,c,u,s,d=Ap().classes,m=Vm(),p=Hm(),v=Dm().constraintManager,g=e(kp(),1)[0],b=nl().isMobile,y=t.className,E=t.style,x=t.filters,C=void 0===x?[]:x,k=t.actions,S=void 0===k?[]:k,L=t.actionSubject,N=t.listChips,I=t.denseHeight,M=t.isDense,R=t.heightRequest,P=void 0===R?function(e){return e}:R,A=t.widthRequest,T=void 0===A?function(e){return e}:A,D=t.operations,O=t.title,F=void 0===O?"":O,_=t.filterLabel,B=void 0===_?"":_,H=t.filterData,W=t.computeKeepPageOnReload,z=t.handleFilter,V=t.handleDefault,Y=t.handleChips,U=t.handleLimitChange,q=t.handlePageChange,$=t.handleReload,X=t.handleRerender,G=t.handleRowsChange,K=t.handleSortModel,Q=t.initComplete,J=t.children,Z=t.isChooser,ee=t.loading,te=t.withToggledFilters,ne=t.onFilterChange,re=t.onResize,oe=t.onAction,ie=t.withSearch,ae=void 0!==ie&&ie,le=t.search,ce=t.sortModel,ue=void 0===ce?Pp:ce,se=t.chips,de=t.handleSearch,fe=t.handleFiltersCollapsed,me=t.sizeByElement,pe=void 0===me||me,he=t.withOutlinePaper,ve=void 0!==he&&he,ge=t.withTransparentPaper,be=void 0!==ge&&ge,ye=t.rerender,we=void 0!==ye&&ye,Ee=t.BeforeActionList,xe=t.AfterActionList,Ce=t.BeforeOperationList,ke=t.AfterOperationList,Se=yp().selectedRows,Le=yi({target:pe?void 0:document.body,debounce:100,compute:function(e){var t=e.height,n=e.width;return{height:P(t),width:T(n)}},onResize:re}),Ne=Le.elementRef,Ie=Le.size,Me=h(function(){if(M)return!0;if(b)return!1;var e=Ie.height;return!!I&&I>e},[I,Ie.height,b,M]),Re=yi({debounce:100}),Pe=Re.elementRef,Ae=Re.size;w(function(){v.clear(),g.clear()},[H,p,ue,se,le,m]);var Te=pp(),De=Ep(),je=ep(),Oe=no(function(e){(null==S?void 0:S.length)||("update-now"===e?je():"resort-action"===e?Te():"drop-filters"===e&&De(),oe&&oe(e,Se,je))});return Gf(function(){return L&&L.subscribe(Oe)}),f.createElement(j,{ref:Ne,className:xo(d.root,y,Rp,(r={},r[d.rendering]=!Ie.height||!Ae.height,r)),style:E},f.createElement("div",{className:xo(d.container,"react-declarative__listContainerMark")},f.createElement("div",{ref:n,style:Ie,className:xo(d.content,d.stretch,"react-declarative__listContentMark")},Q&&f.createElement("div",{className:xo((o={},o[d.hidden]=Me,o))},Ee&&f.createElement(j,{className:d.beforeActionList},f.createElement(Ee,{filterData:H,chips:se,pagination:p,payload:m,search:le,sortModel:ue,computeKeepPageOnReload:W,handleFilter:z,handleDefault:V,handleChips:Y,handleLimitChange:U,handlePageChange:q,handleReload:$,handleRerender:X,handleRowsChange:G,handleSortModel:K,handleSearch:de,handleFiltersCollapsed:fe}))),f.createElement("div",null,!!(null==S?void 0:S.length)&&f.createElement(Lp,{height:Ie.height,width:Ie.width,title:F,filterData:H,actions:S})),Q&&f.createElement("div",{className:xo((i={},i[d.hidden]=Me,i))},xe&&f.createElement(j,{className:d.afterActionList},f.createElement(xe,{filterData:H,chips:se,pagination:p,payload:m,search:le,sortModel:ue,computeKeepPageOnReload:W,handleFilter:z,handleDefault:V,handleChips:Y,handleLimitChange:U,handlePageChange:q,handleReload:$,handleRerender:X,handleRowsChange:G,handleSortModel:K,handleSearch:de,handleFiltersCollapsed:fe}))),Q&&f.createElement("div",{className:xo((a={},a[d.hidden]=Me,a))},Ce&&f.createElement(j,{className:d.beforeActionList},f.createElement(Ce,{filterData:H,chips:se,pagination:p,payload:m,search:le,sortModel:ue,computeKeepPageOnReload:W,handleFilter:z,handleDefault:V,handleChips:Y,handleLimitChange:U,handlePageChange:q,handleReload:$,handleRerender:X,handleRowsChange:G,handleSortModel:K,handleSearch:de,handleFiltersCollapsed:fe}))),f.createElement("div",{className:xo((l={},l[d.hidden]=Me,l))},Array.isArray(D)&&!!D.length&&f.createElement(Sp,{operations:D,width:Ie.width})),Q&&f.createElement("div",{className:xo((c={},c[d.hidden]=Me,c))},ke&&f.createElement(j,{className:d.beforeActionList},f.createElement(ke,{filterData:H,chips:se,pagination:p,payload:m,search:le,sortModel:ue,computeKeepPageOnReload:W,handleFilter:z,handleDefault:V,handleChips:Y,handleLimitChange:U,handlePageChange:q,handleReload:$,handleRerender:X,handleRowsChange:G,handleSortModel:K,handleSearch:de,handleFiltersCollapsed:fe}))),f.createElement(oa,{className:xo(d.content,d.stretch,"react-declarative__listPaperMark",(u={},u[d.noElevation]=Z,u)),outlinePaper:ve,transparentPaper:be},f.createElement("div",null,!Z&&Array.isArray(C)&&!!C.length&&f.createElement(Np,{filterData:H,withToggledFilters:te,onFilterChange:ne,change:z,onSearchChange:de,onCollapsedChange:fe,clean:V,label:B,filters:C,loading:ee,search:le,height:Ie.height,width:Ie.width,withSearch:ae})),f.createElement("div",null,!Z&&(!Array.isArray(C)||!C.length)&&ae&&f.createElement(Mp,{onSearchChange:de,clean:V,search:le,height:Ie.height,width:Ie.width,loading:ee,label:B})),f.createElement("div",{className:xo((s={},s[d.hidden]=Me,s))},!Z&&Array.isArray(N)&&!!N.length&&f.createElement(Ip,{listChips:N,loading:ee})),f.createElement(j,{ref:Pe,className:xo(d.content,d.stretch)},f.createElement("div",{className:xo(d.inner,"react-declarative__listInnerMark"),style:Ae},!we&&f.createElement(f.Fragment,null,J)))))))}),Dp=e(xr(),2),jp=Dp[0],Op=Dp[1],Fp=ap("LIST_RESTORE_POS_ID"),_p=function(e){var r=this;this.withRestorePos=e,this.reloadSubject=new lr,this.idMap=new Map,this.viewportMap=new Map,this.isListening=!0,this.getIsVisible=function(e){return!!r.viewportMap.get(e)},this.getElementCount=function(){return r.idMap.size},this._applyScroll=function(e){var t=0;return function(n,r){return e.viewportMap.get(n)&&!(t++<3)||(r.scrollIntoView({block:"start"}),!1)}}(this),this.emitSubject=Zn(function(){r.reloadSubject.next()},450),this.intersectionObserver=new IntersectionObserver(function(e){e.forEach(function(e){var t=e.target,n=r.idMap.get(t);n?(r.viewportMap.set(n,e.isIntersecting),r.emitSubject()):console.error("List IntersectionManager id is undefined")})}),this.observe=function(e,t){r.withRestorePos&&(r.intersectionObserver.observe(t),r.idMap.set(t,e),r.viewportMap.set(e,!1))},this.unobserve=function(e,t){r.withRestorePos&&(r.idMap.delete(t),r.viewportMap.delete(e))},this.scrollIntoView=function(e){return t(r,void 0,void 0,function(){var t,r;return n(this,function(n){switch(n.label){case 0:t=0,n.label=1;case 1:return 20===t?[3,8]:(r=document.querySelector("[data-intersectionid='".concat(e,"']")))?[3,3]:[4,$n(250)];case 2:return n.sent(),[3,7];case 3:return function(e){var t=document.querySelector(".".concat(Rp)),n=function(e){for(var t=e.parentElement;t;){if(t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return null}(e);return(null==t?void 0:t.contains(n))?n:null}(r)?[3,5]:[4,$n(250)];case 4:return n.sent(),[3,7];case 5:return this._applyScroll(e,r)?[2,!0]:[4,$n(250)];case 6:n.sent(),n.label=7;case 7:return t++,[3,1];case 8:return[2,!1]}})})},this.disconnect=function(){r.intersectionObserver.disconnect(),r.isListening=!1}},Bp=function(r){var o=r.children,i=mm(),a=i.rows,l=i.withRestorePos,u=Fr(function(){return new _p(!!l)}),s=Vr(a),d=b(!0);w(function(){return function(){d.current=!1,u.disconnect()}},[]);var m=y(function(){return t(void 0,void 0,void 0,function(){var e;return n(this,function(t){switch(t.label){case 0:return e=u.getElementCount(),d.current?0!==e&&e>=s.current.length?[3,2]:[4,$n(100)]:[2];case 1:return t.sent(),[3,0];case 2:return[2]}})})},[]);return w(function(){if(l)return u.reloadSubject.subscribe(function(){var t,n,r=9999999999,o=function(e,t){if(!t)return"continue";var n=s.current.findIndex(function(t){return t.id===e});if(-1===n)return"continue";r=Math.min(n,r)};try{for(var i=c(u.viewportMap.entries()),a=i.next();!a.done;a=i.next()){var l=e(a.value,2);o(l[0],l[1])}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}var d=s.current[r];d&&Fp.setValue(d.id)})}),Sc(function(){return t(void 0,void 0,void 0,function(){var e;return n(this,function(t){switch(t.label){case 0:return e=Fp.getValue(),l&&e?[4,m()]:[2];case 1:return t.sent(),[4,lp(u.scrollIntoView(e))];case 2:return t.sent()&&console.error("List IntersectionProvider scrollIntoView failed: id=".concat(e," not found")),[2]}})})}),f.createElement(jp,{payload:u},o)},Hp=function(t){var n=e(g(null),2),r=n[0],o=n[1],i=Op();return w(function(){if(r&&i)return r.dataset.intersectionid=String(t),i.observe(t,r),function(){return i.unobserve(t,r)}},[r]),y(function(e){i&&i.withRestorePos&&(e&&(e.dataset.intersectionid=String(t)),o(e))},[])},Wp=function(t){var n=Op(),r=e(g(function(){return!!(null==n?void 0:n.getIsVisible(t))}),2),o=r[0],i=r[1],a=b(!0);return w(function(){return function(){a.current=!1}},[]),w(function(){return null==n?void 0:n.reloadSubject.subscribe(function(){queueMicrotask(function(){a.current&&i(n.getIsVisible(t))})})},[]),!n||(!n.withRestorePos||o)},zp=function(){return Fp},Vp=Tn()({root:{},cellStretch:{width:"100%"},separator:{minWidth:32,maxWidth:32},disabled:{pointerEvents:"none",opacity:.5}}),Yp=Tn()({root:{position:"relative",width:48,maxWidth:48}}),Up=function(e){var t=Yp().classes;return f.createElement(Et,{className:t.root,padding:"checkbox"},f.createElement($m,a({},e)))},qp=Object.freeze({__proto__:null,thinsp:" ",nbsp:" ",emdash:"—",endash:"–",terminator:"\0",bullet:"•"}),$p="react_declarative_listMobileCell",Xp=Tn()({root:{position:"relative",paddingBottom:"0 !important"},noGutters:{paddingLeft:"0 !important",paddingRight:"0 !important"},container:{minHeight:"100%",width:"100%",display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column",flexWrap:"wrap"},content:{position:"relative",overflow:"hidden",overflowWrap:"break-word",fontWeight:"bold",flex:1},shrinkWidth:{width:48,maxWidth:48}}),Gp=function(e){var t,n=e.className,r=e.colSpan,o=e.withLabel,i=e.fullWidth,c=e.disableGutters,u=l(e,["className","colSpan","withLabel","fullWidth","disableGutters"]),s=Xp().classes,d=u.column,m=h(function(){return d.minHeight||(d.type===Qm.Component?70:void 0)},[]),p=h(function(){return Math.max(i-35,0)},[i]),v=d.headerName,g=void 0===v?cp(d.field||"")||"Unknown":v;return f.createElement(Et,{className:xo(s.root,n,(t={},t[s.noGutters]=c,t[s.shrinkWidth]=d.type===Qm.Action,t)),colSpan:r},f.createElement(j,{className:s.container},o&&f.createElement(_,{variant:"body1"},S(k,{children:["".concat("•"," "),g]})),f.createElement(j,{className:xo(s.content,$p),style:{minHeight:m,maxWidth:p}},f.createElement(Km,a({},u,{fullWidth:i})))))},Kp=Tn()(function(e){var t;return{root:{"&:nth-of-type(2n)":{background:$(e.palette.getContrastText(e.palette.background.paper),.04)},"& > .MuiTableCell-root":{borderBottom:"1px solid ".concat(e.palette.divider)},overflow:"hidden"},row:{"& .MuiTableCell-root":{borderBottom:"0 !important",overflow:"hidden"},marginBottom:16},disabled:{pointerEvents:"none",opacity:.5},hideIfEmpty:(t={},t["&:has(.".concat($p," > :empty)")]={display:"none"},t["&:has(.".concat($p,":empty)")]={display:"none"},t)}}),Qp=function(e){var t=hm(),n=t.selection,r=t.setSelection;return function(t){return void 0===t&&(t=!1),function(o){o.preventDefault(),o.stopPropagation(),n.has(e.id)?n.delete(e.id):(t&&n.clear(),n.add(e.id)),r(n)}}},Jp=function(r){var o=r.row,i=e(g(""),2),a=i[0],l=i[1],c=b(!0),u=mm(),s=u.fallback,d=u.rowMark;return w(function(){t(void 0,void 0,void 0,function(){var e,t,r;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,6,,7]),"function"!=typeof d?[3,4]:(e=d(o))instanceof Promise?[4,e]:[3,2];case 1:return t=n.sent(),[3,3];case 2:t=e,n.label=3;case 3:return e=t,c.current&&l(e),[3,5];case 4:d&&c.current&&l(o[d]),n.label=5;case 5:return[3,7];case 6:return r=n.sent(),s&&s(r),[3,7];case 7:return[2]}})})},[o,d]),E(function(){return function(){c.current=!1}},[]),a},Zp=Tn()({root:{position:"relative"},mark:{position:"absolute",top:0,left:0,bottom:0,width:4}}),eh="list-item",th=Tn()({stretch:{position:"absolute",top:0,left:0,right:0,bottom:0,height:"100%",width:"100%",display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *:nth-of-type(1)":{flex:1}}}),nh=Tn()(function(e){return{cell:{paddingLeft:"0px !important",paddingRight:"0 !important",background:"".concat(e.palette.background.paper," !important")},bold:{fontWeight:"bold !important",opacity:.7},menu:{margin:"0 !important",padding:"0 !important",width:"unset !important",height:"unset !important","& .MuiSvgIcon-root":{height:"20px !important",width:"20px !important"}},cellStretch:{width:"100%",background:"".concat(e.palette.background.paper," !important")},separator:{minWidth:32,maxWidth:32,background:"".concat(e.palette.background.paper," !important")},checkbox:{marginLeft:"4px"}}}),rh="list-columns",oh=function(e){var t,n=e.columns,r=nh().classes,o=mm(),i=sp(),u=i.sortModel,s=i.setSortModel,d=hm(),m=d.selection,p=d.setSelection,v=yp().selectedRows,g=Vm(),b=ep(),w=o.selectionMode,E=o.loading,x=o.onColumnAction,C=o.onLoadStart,k=o.onLoadEnd,S=o.fallback,L=h(function(){var e,t;try{for(var n=c(o.rows),r=n.next();!r.done;r=n.next()){var i=r.value;if(!m.has(i.id))return!1}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return!!o.rows.length},[m,o.rows]),N=!!m.size&&!L,I=function(){return w===Li.Single?f.createElement(Ce,{className:r.checkbox,key:m.size,disabled:E,color:"primary",onChange:function(){p(new Set)}}):w===Li.Multiple?f.createElement(ve,{className:r.checkbox,disabled:E,color:"primary",checked:L,indeterminate:N,onClick:function(){w!==Li.None&&(w!==Li.Single?L?p(new Set):(o.rows.forEach(function(e){var t=e.id;return m.add(t)}),p(m)):p(new Set))}}):f.createElement(ve,{className:r.checkbox,color:"primary",disabled:!0})},M=y(function(e){var t=new Map(u),n=u.get(e);n?"asc"===n.sort?t.set(e,{field:e,sort:"desc"}):"desc"===n.sort&&t.delete(e):t.set(e,{field:e,sort:"asc"}),s(t)},[u]),R=function(){return C&&C(rh)},P=function(e){return k&&k(e,rh)};return f.createElement(wt,null,f.createElement(Et,{className:r.cell,padding:"checkbox"},w===Li.None?f.createElement(f.Fragment,null,I()):f.createElement(Nt,{title:w===Li.Single?"Deselect":N?"Select all":L?"Deselect":"Select all"},I())),(t=n.map(function(e,t){var n=u.get(e.field||""),o=(null==n?void 0:n.sort)||void 0,i=!!e.field;i=(i=i&&!1!==e.sortable)&&e.type!==Qm.Action;var c,s=e.width,d=s,m=e.type===Qm.Action?"center":"left",p=e.headerName,h=void 0===p?cp(e.field||"")||"Unknown":p;return f.createElement(f.Fragment,null,t>0&&f.createElement(Et,{className:r.separator}),f.createElement(Et,{className:r.cell,key:t,align:m,style:{minWidth:s,maxWidth:d},sortDirection:o},f.createElement(j,{sx:{width:"calc(100% - 40px)",display:"inline-block"}},i?f.createElement(It,{className:r.bold,active:!!n,direction:o,onClick:function(){i&&M(e.field)},disabled:E},h):f.createElement("span",{className:r.bold},h)),!!e.columnMenu&&f.createElement(Ca,{transparent:!0,className:r.menu,options:e.columnMenu.map(function(e){var t=e.isDisabled,n=void 0===t?function(){return!1}:t,r=e.isVisible,o=void 0===r?function(){return!0}:r,i=l(e,["isDisabled","isVisible"]);return a(a({},i),{isDisabled:function(){return n(v,g)},isVisible:function(){return o(v,g)}})}),onAction:(c=e.field||"unset-field",function(e){return x&&x(c,e,v,b)}),fallback:S,payload:v,onLoadStart:R,onLoadEnd:P,disabled:E,deps:[g],throwError:!0})))}),t),f.createElement(Et,{className:r.cellStretch}))},ih=function(){return f.createElement(f.Fragment,null)},ah="action-menu",lh=Tn()({button:{borderRadius:"50px !important",minHeight:"40px !important",paddingLeft:"15px !important",paddingRight:"15px !important",zIndex:99},fab:{zIndex:99}}),ch=e(xr(),2),uh=ch[0],sh=ch[1],dh="action-menu",fh="action-menu",mh=Tn()({button:{borderRadius:"50px !important",minHeight:"40px !important",paddingLeft:"15px !important",paddingRight:"15px !important"},fab:{zIndex:99}}),ph=e(xr(),2),hh=ph[0],vh=ph[1],gh=p(null),bh=function(){return v(gh)},yh=function(t){var n=t.children,o=t.chips,i=t.chipData,l=e(g(new Map(o.map(function(e){var t=e.name,n=e.enabled,r=void 0!==n&&n;return[t.toString(),i[t]||r]}))),2),c=l[0],u=l[1],s=mm().handleChips,d={chips:c,setChips:function(t){s(r([],e(t),!1).reduce(function(t,n){var r,o=e(n,2),i=o[0],l=o[1];return a(a({},t),((r={})[i]=l,r))},{})),u(new Map(t))}};return m.createElement(gh.Provider,{value:d},n)},wh=Tn()(function(e){return{root:{height:48,width:"100%",background:$(e.palette.getContrastText(e.palette.background.paper),.05)},stretch:{flex:1}}}),Eh=function(t){var n=t.listChips,o=void 0===n?[]:n,i=t.loading,l=wh().classes,c=bh(),u=c.chips,s=c.setChips,d=mm(),m=d.withSingleChip,p=d.AfterChips,h=function(t,n){return void 0===n&&(n=!0),function(){m&&r([],e(u.keys()),!1).forEach(function(e){return u.set(e,!1)}),u.set(t,n),s(u)}};return f.createElement(rm,{className:l.root,hideOverflowY:!0},f.createElement(we,{width:"100%",alignItems:"center",direction:"row",spacing:1,pl:1},o.map(function(e,t){var n=e.name.toString(),r=!!u.get(n);return f.createElement(ge,{key:t,sx:{pointerEvents:"none","& span:last-of-type":{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",maxWidth:"125px"}},control:f.createElement(ve,{onClick:h(n,!r),sx:{pointerEvents:"all"},checked:r}),label:e.label,disabled:i})}),f.createElement("div",{className:l.stretch}),p&&f.createElement(p,a({},t))))};!function(e){e.Add="add-action",e.Fab="fab-action",e.Menu="menu-action"}(ip||(ip={}));var xh,Ch,kh,Sh,Lh=ip,Nh=function(e){var t=v(Hh).ActionMenu;return f.createElement(t,a({},e))},Ih=function(e){var t=v(Hh).ActionAdd;return f.createElement(t,a({},e))},Mh=function(e){var t=v(Hh).ActionFab;return f.createElement(t,a({},e))},Rh=Tn()(function(e){return{root:{display:"flex",alignItems:"center",justifyContent:"stretch",minHeight:70,"& > *:nth-of-type(n + 1)":{marginLeft:e.spacing(1)},marginBottom:5},stretch:{flex:1},noData:{maxHeight:0},title:{color:e.palette.primary.main,marginLeft:"unset !important",fontWeight:"bold",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"}}}),Ph=function(e,t){var n=void 0===t?{}:t,r=n.inputFormatterSymbol,o=void 0===r?"0":r,i=n.inputFormatterAllowed,a=n.inputFormatterReplace,l=n.inputFormatterTemplate,c=void 0===l?"":l,u=n.inputFormatter,s=void 0===u?function(e){return wl(e,c,{symbol:o,allowed:i,replace:a})}:u,d="string"==typeof e?e:"";d="";for(var f=0;f<e.length;f++)d=s(d+=e[f]);return d},Ah=Symbol("never-pos"),Th=function(t){var n=t.inputFormatterSymbol,r=void 0===n?"0":n,o=t.inputFormatterAllowed,i=t.inputFormatterReplace,a=t.inputFormatterTemplate,l=void 0===a?"00000000000000000000000000000000000000000000000000":a,c=t.inputFormatter,u=void 0===c?function(e){return wl(e,l,{symbol:r,allowed:o,replace:i})}:c,s=t.value,d=void 0===s?"":s,f=t.onChange,m=b(null),p=e(g(d),2),v=p[0],w=p[1],x=Vr(v);Xr(function(){var e;d!==x.current&&(w(Ph(d,{inputFormatter:u,inputFormatterSymbol:r,inputFormatterAllowed:o,inputFormatterReplace:i,inputFormatterTemplate:l})),null===(e=m.current)||void 0===e||e.setSelectionRange(null,null))},[d]);var C=h(function(){var e=Ah;return{render:function(){var t=m.current;t&&"text"!==t.type||"number"==typeof e&&(null==t||t.setSelectionRange(e,e),e=Ah)},pos:function(){var t,n=m.current;return n&&(e=(t=n).selectionStart||t.value.length,e+=function(e){for(var t=0,n=Math.max(e-1,0);n<l.length&&l[n]!==r;n++)t+=1;return t}(e)),e}}},[]);E(function(){if(l){var e=m.current,t=function(){return C.pos()};return e&&e.addEventListener("keyup",t),e&&e.addEventListener("click",t),function(){e&&e.removeEventListener("keyup",t),e&&e.removeEventListener("click",t)}}},[m.current]),E(function(){(l||i||o)&&C.render()},[v]);var k=y(function(e){var t=e.target.value;if(l||i||o){t="";for(var n=0;n<e.target.value.length;n++)t+=e.target.value[n],t=u(t);C.pos()}w(t),f&&f(t)},[]);return{inputRef:m,inputValue:v,onInputChange:k}},Dh=Tn()(function(e){return{root:{display:"flex",alignItems:"stretch",justifyContent:"stretch",background:A(e.palette.getContrastText(e.palette.background.paper),.05)},container:{flex:1,minHeight:60,maxHeight:"50vh",overflow:"hidden",overflowY:"auto"},controls:{display:"flex",alignItems:"center"},controlsWidth:{minWidth:75,marginRight:5,flexDirection:"row-reverse"},title:{display:"flex",alignItems:"center"},disabled:{pointerEvents:"none",userSelect:"none",opacity:.5},labelContent:{display:"flex",minHeight:"60px","& > *:nth-of-type(1)":{flex:1},padding:e.spacing(1)},filters:{padding:e.spacing(1),overflowX:"hidden",overflowY:"auto"}}}),jh=function(t){var n,r,o=t.className,i=t.style,a=t.height,l=t.filterData,c=t.filters,u=t.change,s=t.label,d=t.loading,m=t.withSearch,p=t.withToggledFilters,h=t.search,v=t.onSearchChange,E=void 0===v?function(){return null}:v,x=t.onFilterChange,C=void 0===x?function(){return null}:x,k=t.onCollapsedChange,S=void 0===k?function(){return null}:k,L=Vm(),N=mm(),I=N.features,M=N.readTransform,R=N.writeTransform,P=N.incomingTransform,A=N.outgoingTransform,T=N.isBaseline,D=N.isBaselineForRoot,O=Dh().classes,F=e(g(!!p),2),B=F[0],H=F[1],W=e(g(!1),2),z=W[0],V=W[1],Y=b(!1),U=Th({value:h,onChange:E}),q=U.inputRef,$=U.inputValue,X=U.onInputChange;w(function(){Y.current&&(V(!0),setTimeout(G,1e3))},[B]),w(function(){return Y.current=!0,function(){Y.current=!1}},[]);var G=y(function(){Y.current&&(S(B),setTimeout(function(){return V(!1)},100))},[B]),K=function(){E("")};return f.createElement("div",{className:xo(o,O.root),style:i},f.createElement("div",{className:O.container},f.createElement(Dt,{onTransitionEnd:G,in:B},f.createElement(j,{className:xo(O.filters,(n={},n[O.disabled]=d,n)),sx:{maxHeight:Math.max(a/2-150,220)}},f.createElement(yf,{features:I,readTransform:M,writeTransform:R,incomingTransform:P,outgoingTransform:A,isBaseline:T,isBaselineForRoot:D,handler:l,payload:L,fields:c,change:function(e){C(e),u(e)},readonly:d}))),f.createElement(Dt,{in:!B},f.createElement(j,{className:O.labelContent},function(){var e;return m?f.createElement(xe,{label:"Search",variant:"standard",inputRef:q,value:$,onChange:X,onKeyDown:function(e){var t=e.key,n=e.currentTarget;"Enter"!==t&&"Escape"!==t||n.blur()},className:xo((e={},e[O.disabled]=d,e)),sx:{maxWidth:"max(calc(50% - 75px), 256px)"},InputProps:{readOnly:d,startAdornment:f.createElement(Le,{position:"start"},f.createElement(ot,null)),endAdornment:!!h&&f.createElement(Le,{sx:{cursor:"pointer",marginBottom:"15px"},onClick:K,position:"end"},f.createElement(Fe,null))},placeholder:s,InputLabelProps:{shrink:!0},focused:!0}):f.createElement(_,{variant:"body1",className:O.title},s)}()))),f.createElement("div",{className:xo(O.controls,(r={},r[O.controlsWidth]=!p,r))},!p&&f.createElement(Ne,{disabled:z,onClick:function(){return H(!B)}},B?f.createElement(jt,null):f.createElement(it,null))))},Oh="list-operations",Fh=Tn()(function(e){return{root:{height:50,width:"100%",background:$(e.palette.getContrastText(e.palette.background.paper),.05)},container:{minWidth:"100%",display:"flex",alignItems:"stretch",justifyContent:"stretch"},content:{flex:1,display:"flex",alignItems:"center","& > *":{marginRight:"5px !important",whiteSpace:"nowrap"}},label:{display:"flex",whiteSpace:"nowrap"},checkbox:{display:"flex",alignItems:"center"}}}),_h=Tn()(function(e){return{root:{display:"flex",alignItems:"stretch",justifyContent:"stretch",background:A(e.palette.getContrastText(e.palette.background.paper),.05)},container:{flex:1,minHeight:60,maxHeight:"50vh",overflow:"hidden",overflowY:"auto"},controls:{display:"flex",alignItems:"center",minWidth:75,marginRight:5,flexDirection:"row-reverse"},disabled:{pointerEvents:"none",userSelect:"none",opacity:.5},labelContent:{display:"flex",minHeight:"60px","& > *:nth-of-type(1)":{flex:1},padding:e.spacing(1)}}}),Bh={BodyRow:function(e){var t=mm().withMobile,n=void 0!==t&&t,r=v(Hh),o=r.MobileBodyRow,i=r.DesktopBodyRow;return e.mode===Pm.Phone&&n?f.createElement(o,a({},e)):f.createElement(i,a({},e))},CheckboxCell:function(e){var t=e.row,n=e.disabled,r=Zp().classes,o=hm().selection,i=Jp({row:t}),a=mm(),l=a.selectionMode,c=void 0===l?Li.None:l,u=a.rowMark,s=a.loading,d=Qp(t);return f.createElement(f.Fragment,null,u&&f.createElement(j,{className:r.mark,style:{background:i}}),c===Li.Single?f.createElement(Ce,{color:"primary",onClick:d(!0),checked:o.has(t.id),disabled:s||n}):c===Li.Multiple?f.createElement(ve,{color:"primary",onClick:d(!1),checked:o.has(t.id),disabled:s||n}):c===Li.None?f.createElement(ve,{color:"primary",disabled:!0}):null)},CommonCell:function(e){var r=e.column,o=e.row,i=e.disabled,c=e.onMenuToggle,u=e.onAction,s=Wp(o.id),d=th().classes,m=Vm(),p=Vr(o),h=mm(),v=h.fallback,g=h.rowActions,b=void 0===g?[]:g,y=h.onLoadStart,w=h.onLoadEnd,E=h.loading,x=function(){return y&&y(eh)},C=function(e){return w&&w(e,eh)};if(r.type===Qm.Text)return o[r.field];if(r.type===Qm.Compute)return f.createElement(Zr,{disabled:!s,payload:o,deps:[m],fallback:v,onLoadStart:x,onLoadEnd:C,throwError:!0},function(e){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return t=a(a({},e),{_payload:m}),r.element?[2,S(r.element,t)]:[3,1];case 1:return r.compute?[4,r.compute(t,m)]:[3,3];case 2:return[2,n.sent()];case 3:return[2,null]}})})});if(r.type===Qm.CheckBox)return f.createElement(ve,{color:"primary",disabled:!0,checked:o[r.field]});if(r.type===Qm.Component){var L=r.element,N=void 0===L?function(){return f.createElement(k,null)}:L;return f.createElement(j,{className:d.stretch},f.createElement(N,a({},o,{_payload:m})))}return r.type===Qm.Action?f.createElement(Ca,{transparent:!0,options:b.map(function(e){var t=e.isVisible,n=void 0===t?function(){return!0}:t,r=e.isDisabled,o=void 0===r?function(){return!1}:r,i=l(e,["isVisible","isDisabled"]);return a(a({},i),{isVisible:function(){return n(p.current,m)},isDisabled:function(){return o(p.current,m)}})}),onToggle:c,onAction:u,fallback:v,payload:o,deps:[m],onLoadStart:x,onLoadEnd:C,disabled:E||i,throwError:!0}):null},HeadRow:function(e){var t=mm().withMobile,n=void 0!==t&&t;return e.mode===Pm.Phone&&n?f.createElement(ih,a({},e)):f.createElement(oh,a({},e))},ActionAdd:function(e){var r=e.action,o=void 0===r?"add-action":r,i=e.width,a=e.label,l=e.isVisible,c=void 0===l?function(){return!0}:l,u=e.isDisabled,s=void 0===u?function(){return!1}:u,d=lh().classes,m=Vm(),p=mm(),h=ep(),v=yp().selectedRows,g=p.fallback,b=p.onAction,y=p.onLoadStart,w=p.onLoadEnd,E=no(function(e){e.stopPropagation(),b&&b(o,v,h)}),x=function(e){var t=e.disabled,n=e.onClick,r=sh(),o=mm().loading;return a&&!r?f.createElement(ye,{className:d.button,variant:"contained",disabled:o||t,size:"medium",startIcon:f.createElement(Mt,{color:"inherit"}),onClick:n},a):f.createElement(Te,{className:d.fab,disabled:o||t,size:"small",color:"primary",onClick:n},f.createElement(Mt,{color:"inherit"}))},C=i<500;return f.createElement(uh,{payload:C},f.createElement(Zr,{Loader:function(){var e=sh();return a&&!e?f.createElement(ye,{className:d.button,variant:"contained",size:"small",startIcon:f.createElement(Mt,{color:"inherit"})},a):f.createElement(Te,{className:d.fab,disabled:!0,size:"small",color:"primary"},f.createElement(Mt,{color:"inherit"}))},fallback:g,onLoadStart:function(){return y&&y(ah)},onLoadEnd:function(e){return w&&w(e,ah)},payload:v,deps:[m],throwError:!0},function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:return[4,c(v,m)];case 1:return e=n.sent(),[4,s(v,m)];case 2:return t=n.sent(),e?[2,f.createElement(x,{disabled:t,onClick:E})]:[2,null]}})})}))},ActionMenu:function(t){var n=t.options,o=void 0===n?[]:n,i=t.deps,c=void 0===i?[]:i,u=yp().selectedRows,s=pp(),d=Ep(),m=ep(),p=Vm(),h=mm(),v=h.onAction,g=h.fallback,b=h.onLoadStart,y=h.onLoadEnd,w=h.loading,E=h.actionSubject,x=no(function(e){"update-now"===e?m():"resort-action"===e?s():"drop-filters"===e&&d(),v&&v(e,u,m)});Gf(function(){return E&&E.subscribe(x)});return E?null:f.createElement(Ca,{options:o.map(function(e){var t=e.action,n=e.isDisabled,r=void 0===n?function(){return!1}:n,o=e.isVisible,i=void 0===o?function(){return!0}:o,c=l(e,["action","isDisabled","isVisible"]);return a(a({action:t},c),"update-now"===t?{icon:c.icon||Pt,isDisabled:function(){return r(u,p)},isVisible:function(){return i(u,p)},label:c.label||"Refresh manually"}:"add-action"===t?{icon:c.icon||Mt,isDisabled:function(){return r(u,p)},isVisible:function(){return i(u,p)},label:c.label||"Create new row"}:"resort-action"===t?{icon:c.icon||At,isDisabled:function(){return r(u,p)},isVisible:function(){return i(u,p)},label:c.label||"Change sort order"}:"drop-filters"===t?{icon:c.icon||Rt,isDisabled:function(){return r(u,p)},isVisible:function(){return i(u,p)},label:c.label||"Drop filters"}:{isDisabled:function(){return r(u,p)},isVisible:function(){return i(u,p)}})}),onAction:x,fallback:g,payload:u,deps:r(r([],e(c),!1),[p],!1),onLoadStart:function(){return b&&b(dh)},onLoadEnd:function(e){return y&&y(e,dh)},disabled:w})},ActionFab:function(e){var r=e.action,o=void 0===r?"fab-action":r,i=e.label,a=e.width,l=e.icon,c=void 0===l?Tt:l,u=e.isVisible,s=void 0===u?function(){return!0}:u,d=e.isDisabled,m=void 0===d?function(){return!1}:d,p=mh().classes,h=mm(),v=Vm(),g=ep(),b=yp().selectedRows,y=h.fallback,w=h.onAction,E=h.onLoadStart,x=h.onLoadEnd,C=no(function(e){e.stopPropagation(),w&&w(o,b,g)}),k=function(e){var t=e.disabled,n=e.onClick,r=vh(),o=mm().loading;return i&&!r?f.createElement(ye,{className:p.button,variant:"contained",disabled:o||t,size:"small",startIcon:f.createElement(c,{color:"inherit"}),onClick:n},i):f.createElement(Te,{className:p.fab,disabled:o||t,size:"small",color:"primary",onClick:n},f.createElement(c,{color:"inherit"}))},S=a<500;return f.createElement(hh,{payload:S},f.createElement(Zr,{Loader:function(){var e=vh();return i&&!e?f.createElement(ye,{className:p.button,variant:"contained",size:"small",startIcon:f.createElement(c,{color:"inherit"})},i):f.createElement(Te,{className:p.fab,disabled:!0,size:"small",color:"primary"},f.createElement(c,{color:"inherit"}))},fallback:y,onLoadStart:function(){return E&&E(fh)},onLoadEnd:function(e){return x&&x(e,fh)},payload:b,deps:[v],throwError:!0},function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:return[4,s(b,v)];case 1:return e=n.sent(),[4,m(b,v)];case 2:return t=n.sent(),e?[2,f.createElement(k,{disabled:t,onClick:C})]:[2,null]}})})}))},ChipListSlot:Eh,ActionListSlot:function(t){var n,o=t.className,i=t.actions,c=void 0===i?[]:i,u=t.style,s=t.title,d=t.height,m=t.width,p=t.deps,h=void 0===p?[]:p,v=Rh().classes,g=yp().selectedRows,b=mm().operations,y=Vm(),w=Array.isArray(b)&&!!b.length;return f.createElement("div",{className:xo(o,v.root,(n={},n[v.noData]=0===c.length,n)),style:u},f.createElement(_,{className:v.title,variant:"h5",sx:{marginLeft:w?"0 !important":"inherit"}},s),f.createElement("div",{className:v.stretch}),c.map(function(t,n){return f.createElement(k,{key:n},function(t){var n=t.type,o=t.options,i=void 0===o?[]:o,c=t.isDisabled,u=t.isVisible,s=t.label,p=t.icon,v=t.action;if(n===Lh.Add)return f.createElement(Ih,{label:s,action:v,isDisabled:c,isVisible:u,height:d,width:m});if(n===Lh.Fab)return f.createElement(Mh,{label:s,action:v,icon:p,isDisabled:c,isVisible:u,height:d,width:m});if(n===Lh.Menu){var b=i.map(function(e){var t=e.isDisabled,n=void 0===t?function(){return!1}:t,r=e.isVisible,o=void 0===r?function(){return!0}:r,i=l(e,["isDisabled","isVisible"]);return a(a({},i),{isDisabled:function(){return n(g,y)},isVisible:function(){return o(g,y)}})});return f.createElement(Nh,{options:b,deps:r(r([],e(h),!1),[y],!1)})}throw new Error("List Actions unknown action type")}(t))}))},FilterListSlot:jh,OperationListSlot:function(r){var o=r.className,i=r.style,a=r.operations,l=r.width,c=Fh().classes,u=Vm(),s=mm(),d=s.onOperation,m=void 0===d?function(){return null}:d,p=s.fallback,h=s.onLoadStart,v=s.onLoadEnd,b=s.loading,y=s.withAllListOperations,w=ep(),E=e(g(!1),2),x=E[0],C=E[1],k=yp().selectedRows,S=x?"all":k,L=no(m),N=function(e){return function(){L(e,k,x,w)}},I=f.createElement(ve,{disabled:b,value:x,onChange:function(){return C(!x)}}),M=!k.length&&!x,R=function(e){var t=e.available,n=e.onClick,r=e.label,o=e.icon,i=mm().loading;return f.createElement(ye,{disabled:i||!t,size:"small",variant:"contained",onClick:n,startIcon:o&&f.createElement(o,null)},r)};return f.createElement(rm,{className:c.root,hideOverflowY:!0},f.createElement(j,{className:xo(o,c.container),style:i},f.createElement(j,{className:c.content},f.createElement(Zr,{payload:S,deps:[u],Loader:function(){return f.createElement(f.Fragment,null,a.map(function(e,t){var n=e.label,r=e.icon;return f.createElement(ye,{disabled:!0,key:t,size:"small",variant:"contained",startIcon:r&&f.createElement(r,null)},f.createElement(we,{direction:"row",alignItems:"center",spacing:1},f.createElement(j,{display:"flex",alignItems:"center"},f.createElement(O,{size:"16px",color:"inherit"})),f.createElement(j,null,n)))}))},fallback:p,onLoadStart:function(){return h&&h(Oh)},onLoadEnd:function(e){return v&&v(e,Oh)},throwError:!0},function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,Promise.all(a.map(function(e,r){return t(void 0,[e,r],void 0,function(e,t){var r,o,i,a=e.action,l=void 0===a?"unknown-action":a,c=e.label,s=void 0===c?"Unknown":c,d=e.icon,m=e.isAvailable,p=void 0===m||m;return n(this,function(e){switch(e.label){case 0:return r=function(){return"function"==typeof p?p(k,x,u):p},M?(i=!1,[3,3]):[3,1];case 1:return[4,r()];case 2:i=e.sent(),e.label=3;case 3:return o=i,[2,f.createElement(R,{key:t,available:o,label:s,icon:d,onClick:N(l)})]}})})}))];case 1:return[2,e.sent()]}})})})),y&&f.createElement(j,{className:c.label},l<500?I:f.createElement(ge,{disabled:b,control:I,label:"All items"}))))},SearchSlot:function(e){var t,n=e.className,r=e.style,o=e.label,i=e.loading,a=e.search,l=e.onSearchChange,c=void 0===l?function(){return null}:l,u=_h().classes;return f.createElement("div",{className:xo(n,u.root),style:r},f.createElement("div",{className:u.container},f.createElement(j,{className:u.labelContent},f.createElement(xe,{label:"Search",variant:"standard",value:a,sx:{maxWidth:"max(calc(50% - 75px), 256px)"},onChange:function(e){var t=e.target;return c(t.value)},onKeyDown:function(e){var t=e.key,n=e.currentTarget;"Enter"!==t&&"Escape"!==t||n.blur()},className:xo((t={},t[u.disabled]=i,t)),InputProps:{readOnly:i,startAdornment:f.createElement(Le,{position:"start"},f.createElement(ot,null)),endAdornment:!!a&&f.createElement(Le,{sx:{cursor:"pointer",marginBottom:"15px"},onClick:function(){c("")},position:"end"},f.createElement(Fe,null))},placeholder:o,InputLabelProps:{shrink:!0},focused:!0}))),f.createElement("div",{className:u.controls}))},DesktopBodyRow:function(r){var o,i=r.row,a=r.mode,l=r.columns,c=r.disabled,u=r.fullWidth,s=Hp(i.id),d=e(g(!1),2),m=d[0],p=d[1],v=Vp().classes,b=mm(),y=ep(),w=hm(),E=w.selection,x=w.setSelection,C=b.onRowClick,k=b.onRowAction,S=b.rowColor,L=void 0===S?function(){return"inherit"}:S,N=e(Sc(function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,L(i)];case 1:return[2,e.sent()]}})})}),1),I=N[0],M=function(e){p(e)},R=function(e){k&&k(e,i,y)},P=h(function(){return l.map(function(e,t){return f.createElement(f.Fragment,null,t>0&&f.createElement(Et,{className:v.separator}),f.createElement(Zm,{column:e,disabled:c,row:i,key:t,idx:t,mode:a,fullWidth:u,onAction:R,onMenuToggle:M}))})},[u,i,c]);return f.createElement(wt,{ref:s,"data-testId":i.id,className:xo(v.root,(o={},o[v.disabled]=c,o)),sx:{background:I||""},selected:E.has(i.id),onClick:function(){m||(b.withSelectOnRowClick&&b.selectionMode!==Li.None?(b.selectionMode===Li.Single?E.has(i.id)&&1===E.size?E.delete(i.id):(E.clear(),E.add(i.id)):E.has(i.id)?E.delete(i.id):E.add(i.id),x(E)):C&&C(i,y))}},f.createElement(Gm,{disabled:c,row:i}),P,f.createElement(Et,{className:v.cellStretch}))},MobileBodyRow:function(r){var o,i=r.row,a=r.mode,l=r.disabled,c=r.columns,u=r.fullWidth,s=Hp(i.id),d=e(g(!1),2),m=d[0],p=d[1],v=Kp().classes,b=mm(),y=ep(),w=hm(),E=w.selection,x=w.setSelection,C=b.onRowClick,k=b.onRowAction,S=b.rowColor,L=void 0===S?function(){return"inherit"}:S,N=e(Sc(function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,L(i)];case 1:return[2,e.sent()]}})})}),1),I=N[0],M=function(e){p(e)},R=function(e){k&&k(e,i,y)},P=e(h(function(){var t=function(e,t,n,r){return function(o,c){var s;return f.createElement(Gp,{className:xo((s={},s[v.hideIfEmpty]=o.type!==Qm.Component&&b.withHideIfEmpty,s)),column:o,disabled:l,row:i,key:"".concat(t,"-").concat(c),idx:c,mode:a,colSpan:e,fullWidth:u,onAction:R,withLabel:n,disableGutters:r,onMenuToggle:M})}},n=c.filter(function(e){return e.type!==Qm.Action}),r=e(c.filter(function(e){return e.type===Qm.Action}).map(t(1,"action",!1,!0)),1)[0],o=void 0===r?null:r,s=n.slice(0,1).map(t(1,"first",!0,!0)).pop(),d=n.filter(function(e){return e.primary}).map(t(1,"primary",!0,!0)).pop();return[d||s,o,(d?n:n.slice(1)).map(t(o?3:2,"col",!0,!1))]},[u]),3),A=P[0],T=P[1],D=P[2],j=h(function(){return Math.max(u-35,0)},[u]);return f.createElement(wt,{ref:s,"data-testId":i.id,className:v.root,selected:E.has(i.id),sx:{background:I||"",maxWidth:j},onClick:function(){m||(b.withSelectOnRowClick&&b.selectionMode!==Li.None?(b.selectionMode===Li.Single?E.has(i.id)&&1===E.size?E.delete(i.id):(E.clear(),E.add(i.id)):E.has(i.id)?E.delete(i.id):E.add(i.id),x(E)):C&&C(i,y))}},f.createElement(Et,{padding:"none",sx:{maxWidth:j}},f.createElement(vt,{className:xo(v.row,(o={},o[v.disabled]=l,o))},f.createElement(gt,null,f.createElement(wt,null,f.createElement(Up,{disabled:l,row:i}),A,T),D.map(function(e,t){return f.createElement(wt,{key:t},e)})))))}},Hh=p(Bh),Wh=function(e){var t=e.children,n=l(e,["children"]),r=v(Hh),o=h(function(){return a(a({},r),n)},[]);return f.createElement(Hh.Provider,{value:o},t)},zh=function(e){var t=v(Hh).BodyRow;return f.createElement(t,a({},e))},Vh=function(t){var n=t.fullWidth,r=t.mode,o=t.row,i=mm(),a=i.columns,l=i.isRowDisabled,c=void 0===l?function(){return!1}:l,u=Dm().wrapColumns,s=Fm(),d=Hm(),m=mm(),p=m.sort,v=m.chips,g=qm(),b=Vm(),y=e(kp(),1)[0],w=h(function(){return{filterData:s,pagination:d,sortModel:p||[],chips:v||{},search:g,payload:b}},[s,d,p,v,g,b]),E=h(function(){var e=u({columns:a,visibilityRequest:w,fullWidth:n,mode:r});return y.set(o.id,c(o,w)),e},[n,w]);return f.createElement(zh,{row:o,mode:r,disabled:!!y.get(o.id),columns:E,fullWidth:n})},Yh=function(e){var t=v(Hh).HeadRow;return f.createElement(t,a({},e))},Uh=function(e){var t=e.fullWidth,n=e.mode,r=mm().columns,o=Dm().wrapColumns,i=Fm(),a=Hm(),l=mm(),c=l.sortModel,u=l.chips,s=qm(),d=Vm(),m=h(function(){return{filterData:i,pagination:a,sortModel:c||[],chips:u||{},search:s,payload:d}},[i,a,c,u,s,d]),p=h(function(){return o({columns:r,visibilityRequest:m,fullWidth:t,mode:n})},[t,m]);return f.createElement(Yh,{mode:n,columns:p,fullWidth:t})},qh=e(xr(),2),$h=qh[0],Xh=qh[1],Gh=[10,25,50],Kh=Tn()(function(e,t,n){var r;return{root:{position:"relative"},container:(r={position:"absolute",top:0,left:0,background:e.palette.background.paper},r["& .".concat(n.noBorder)]={paddingLeft:"0 !important",paddingRight:"0 !important"},r),noBorder:{border:"none !important"},tableHead:{position:"sticky",top:-1,zIndex:5,background:e.palette.background.paper}}}),Qh=function(e){var t=Kh().classes,n=Xh(),r=Dm().constraintManager,o=yi({debounce:100}),i=o.elementRef,l=o.size,c=l.height,u=l.width,s=Mm(u),d=s.isTablet,m=s.isDesktop,p=e.limit,h=e.offset,v=e.rows,g=e.loading,b=e.total,y=e.labelDisplayedRows,E=e.columns,x=void 0===E?[]:E,C=e.withLoader,S=void 0!==C&&C,L=e.withInitialLoader,N=void 0!==L&&L,I=e.handleLimitChange,M=e.handlePageChange;w(function(){return function(){n.clear()}},[]);var R=function(e){return f.createElement(f.Fragment,null,f.createElement(bt,{className:t.tableHead},f.createElement(Uh,{fullWidth:u,mode:e})),f.createElement(gt,null,S&&g||N&&g&&0===v.length||!g&&0===v.length?f.createElement(wt,null,function(e){return f.createElement(Et,{className:t.noBorder,sx:{position:"relative"},colSpan:2*x.length||999,align:"center"},f.createElement(we,{sx:{position:"sticky",top:0,left:0,width:e-65},direction:"row",alignItems:"center",justifyContent:"center",gap:1},g&&f.createElement(O,{size:24}),f.createElement(_,{variant:"body1"},g?"Loading":"Nothing found")))}(u)):v.map(function(t,n){return f.createElement(k,{key:"".concat(t.id,"-").concat(n)},f.createElement(Vh,{fullWidth:u,row:t,mode:e}))})))};return f.createElement(Tp,a({},e,{onResize:function(){return r.clear()}}),f.createElement(j,{ref:i,className:t.root},f.createElement(j,{className:t.container},f.createElement(yt,{ref:n.provideRef,style:{height:c-52,width:u}},f.createElement(vt,{stickyHeader:!0},R(m?Pm.Desktop:d?Pm.Tablet:Pm.Phone))),f.createElement(Cm,{width:u,height:c,count:b||-1,rowsPerPage:p,page:h/p,labelDisplayedRows:y,rowsPerPageOptions:Gh,onPageChange:function(e,t){return M(t)},onRowsPerPageChange:function(e){return I(e.target.value)}}))))},Jh=(xh=e(xr(),2))[0],Zh=xh[1],ev=function(o){var i=o.scrollYSubject,a=o.rows,l=_r(),c=Xh(),u=Zh(),s=b(!0),d=e(jr(a),2),f=d[0],m=d[1],p=y(function(t){return m(function(n){if(!s.current)return t;var o=new Set(n.map(function(e){return e.id})),i=new Map(t.map(function(e){return[e.id,e]}));return r(r([],e(n.map(function(e){return i.get(e.id)||e})),!1),e(t.filter(function(e){var t=e.id;return!o.has(t)})),!1)})},[]),h=y(function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,$n(500)];case 1:return e.sent(),s.current||(null==i||i.next(0),c.scrollTop()),[2]}})})},[]);return w(function(){return u.subscribe(function(e){"rows-reload"===e.type&&(s.current=!1,p(e.rows),h()),"filterdata-changed"!==e.type||e.keepPagination||(s.current=!1),"chips-changed"===e.type&&(s.current=!1),"rows-changed"===e.type&&(p(e.rows),h(),s.current=!0),"search-changed"===e.type&&(s.current=!1),"sort-changed"===e.type&&(s.current=!1),l.next()})},[]),{rows:f.current,recomputeSubject:l}},tv=Tn()({root:{position:"absolute",top:0,left:0,right:0,bottom:0,height:"100%",width:"100%",background:$("#000",.2),display:"flex",alignItems:"center",justifyContent:"center",zIndex:999},hidden:{display:"none !important"}}),nv=function(e){var t,n=e.open,r=tv().classes;return f.createElement(j,{className:xo(r.root,(t={},t[r.hidden]=!n,t))},f.createElement(O,null))},rv=function(e){var t=e.row,n=mm().selectionMode,r=hm().selection,o=Qp(t);return n===Li.Single?f.createElement(Ce,{color:"primary",onClick:o(!0),checked:r.has(t.id)}):n===Li.Multiple?f.createElement(ve,{color:"primary",onClick:o(!1),checked:r.has(t.id)}):f.createElement(ve,{color:"primary",disabled:!0})},ov=Tn()({mark:{position:"absolute",top:0,left:0,bottom:0,width:4}}),iv=function(e){var t=e.row,n=ov().classes,r=Jp({row:t});return f.createElement(j,{className:n.mark,style:{background:r}})},av="list-item",lv=function(e){var t=e.row,n=e.fallback,r=e.column,o=mm(),i=o.onLoadStart,a=o.onLoadEnd,l=Vm();return f.createElement(Zr,{fallback:n,payload:t,onLoadStart:function(){return i&&i(av)},onLoadEnd:function(e){return a&&a(e,av)},throwError:!0},function(){return r&&r.element?S(r.element,t):r&&r.compute?r.compute(t,l):r&&r.field?t[r.field]:"empty"})},cv=Tn()({root:{position:"relative",overflow:"hidden"},checkbox:{opacity:.2}}),uv=function(t){var n=t.row,r=t.style,o=e(g(!1),2),i=o[0],c=o[1],u=cv().classes,s=mm(),d=s.columns,m=void 0===d?[]:d,p=s.withSelectOnRowClick,h=s.selectionMode,v=s.rowActions,b=s.onRowClick,y=s.onRowAction,w=s.rowMark,E=s.fallback,x=s.onLoadStart,C=s.onLoadEnd,k=ep(),S=Vm(),L=hm(),N=L.selection,I=L.setSelection,M=Vr(n),R=m.find(function(e){return e.primary})||m.find(function(e){return!!e.field}),P=m.find(function(e){return e.secondary}),A=m.find(function(e){return e.avatar}),T=f.createElement(lv,{row:n,fallback:E,column:R}),D=P?f.createElement(lv,{row:n,fallback:E,column:P}):null,O=A?f.createElement(lv,{row:n,fallback:E,column:A}):null;return f.createElement(Me,{selected:N.has(n.id),className:u.root,onClick:function(){i||(p&&h!==Li.None?(h===Li.Single?N.has(n.id)&&1===N.size?N.delete(n.id):(N.clear(),N.add(n.id)):N.has(n.id)?N.delete(n.id):N.add(n.id),I(N)):b&&b(n,k))},style:r,disableRipple:i},!!w&&f.createElement(iv,{row:n}),f.createElement(F,{sx:{display:"flex",alignItems:"center",gap:"8px"}},f.createElement(rv,{row:n}),!!O&&f.createElement(j,{sx:{marginRight:"16px"}},O)),f.createElement(Oe,{primary:T,secondary:D}),!!v&&f.createElement(Ca,{transparent:!0,options:v.map(function(e){var t=e.isDisabled,n=void 0===t?function(){return!1}:t,r=e.isVisible,o=void 0===r?function(){return!0}:r,i=l(e,["isDisabled","isVisible"]);return a(a({},i),{isVisible:function(){return o(M.current,S)},isDisabled:function(){return n(M.current,S)}})}),onToggle:function(e){c(e)},onAction:function(e){y&&y(e,n,k)},fallback:E,payload:n,deps:[S],onLoadStart:function(){return x&&x(av)},onLoadEnd:function(e){return C&&C(e,av)},throwError:!0}))},sv=Tn()(function(e){return{root:{position:"relative"},container:{position:"absolute",top:0,left:0,background:e.palette.background.paper},empty:{position:"absolute",zIndex:999,top:0,left:0,right:0}}}),dv=function(e){var r=sv().classes,o=Xh(),i=_r(),l=ev({rows:e.rows,scrollYSubject:i});w(function(){return o.scrollYSubject.subscribe(function(){i.next(0)})},[]);var c=e.offset,u=e.limit,s=e.total,d=e.loading,m=e.withLoader,p=void 0!==m&&m,h=yi({target:document.body,selector:".MuiDialog-container > .MuiPaper-root"}).size.width,v=yi(),g=v.elementRef,b=v.size.height,y=e.handlePageChange,E=Math.floor(c/u)+1,x=!s||E*u<s,C=al([d]),k=ro(function(e){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return e?[2]:!0&&x&&!d?(y(E),[4,C()]):[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}})})}).execute;return f.createElement(Tp,a({},e,l),f.createElement(j,{ref:g,className:r.root},f.createElement(j,{className:r.container},f.createElement(j,{position:"relative",style:{height:b,width:h}},f.createElement(gi,{scrollYSubject:i,minRowHeight:75,onDataRequest:function(e){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,k(e)];case 1:return[2,void t.sent()]}})})},sx:{height:b,width:h}},!d&&0===l.rows.length&&f.createElement(tt,{className:r.empty},f.createElement(F,null,f.createElement(Ot,null)),f.createElement(Oe,{primary:"Empty",secondary:"Nothing found"})),l.rows.map(function(e,t){return f.createElement(uv,{key:"".concat(e.id,"-").concat(t),row:e})})),f.createElement(nv,{open:p&&d})))))},fv=Tn()({root:{position:"absolute",top:0,left:0,right:0,bottom:0,height:"100%",width:"100%",background:$("#000",.2),display:"flex",alignItems:"center",justifyContent:"center",zIndex:999},hidden:{display:"none !important"}}),mv=function(e){var t,n=e.open,r=fv().classes;return f.createElement(j,{className:xo(r.root,(t={},t[r.hidden]=!n,t))},f.createElement(O,null))},pv=function(e,r){var o=(void 0===r?{}:r).minWidth,i=void 0===o?185:o;return e.map(function(e,r){var o="".concat(e.field||"unknown","-").concat(r);return e.type===Qm.Action?null:e.type===Qm.CheckBox?{label:e.headerName||o,width:e.width,field:e.field,minWidth:i,format:function(t){return f.createElement(ve,{color:"primary",disabled:!0,checked:t[e.field]})}}:{label:e.headerName||o,width:e.width,field:e.field,minWidth:i,format:function(r,o){var i=this;return e.compute||e.element?f.createElement(Zr,{payload:r},function(r){return t(i,void 0,void 0,function(){var t,i;return n(this,function(n){switch(n.label){case 0:return t=e.element,(i=e.compute)?[4,i(r,o)]:[3,2];case 1:return[2,n.sent()];case 2:return t?[2,f.createElement(t,a({},r,{_payload:o}))]:[2,e.field?zn(r,e.field):""]}})})}):e.field?zn(r,e.field):""}}}).filter(function(e){return null!==e})},hv=Tn()(function(e){return{root:{position:"relative"},container:{position:"absolute",top:0,left:0,background:e.palette.background.paper},empty:{position:"absolute",zIndex:999,top:0,left:0,right:0}}}),vv=function(o){var i=hv().classes,l=_r(),c=ev({rows:o.rows,scrollYSubject:l}),u=hm(),s=u.selection,d=u.setSelection,m=o.offset,p=o.limit,v=o.total,g=o.loading,b=o.payload,y=o.rowMark,w=o.rowColor,E=o.columns,x=o.selectionMode,C=void 0===x?Li.None:x,k=o.withLoader,S=void 0!==k&&k,L=o.onRowClick,N=o.onRowAction,I=ep(),M=h(function(){return pv(E)},[]),R=h(function(){return r([],e(s),!1)},[s]),P=yi(),A=P.elementRef,T=P.size,D=T.height,O=T.width,F=o.handlePageChange,_=Math.floor(m/p)+1,B=!v||_*p<v,H=al([g]),W=ro(function(e){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return e?[2]:!0&&B&&!g?(F(_),[4,H()]):[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}})})}).execute;return f.createElement(Tp,a({},o,c),f.createElement(j,{ref:A,className:i.root},f.createElement(j,{className:i.container},f.createElement(j,{position:"relative",style:{height:D,width:O}},f.createElement(Aa,{scrollYSubject:l,minRowHeight:45,hasMore:B,loading:g,bufferSize:Math.min(2*p,15),selectedRows:R,onSelectedRows:function(e,t){t||d(new Set(e))},selectionMode:C,transparentPaper:!0,payload:b,rowMark:y,onRowClick:function(e){o.withSelectOnRowClick&&o.selectionMode!==Li.None?(o.selectionMode===Li.Single?s.has(e.id)&&1===s.size?s.delete(e.id):(s.clear(),s.add(e.id)):s.has(e.id)?s.delete(e.id):s.add(e.id),d(s)):L&&L(e,I)},onRowAction:function(e,t){N&&N(e,t,I)},rowKey:"id",rowColor:w,columns:M,data:c.rows,onSkip:function(e){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,W(e)];case 1:return[2,void t.sent()]}})})},sx:{height:D,width:O}}),f.createElement(mv,{open:S&&g})))))},gv=10,bv=function(){var t=new function(){var e=this;this._cache=new Map,this.memoize=function(t,n){if(e._cache.has(t))return e._cache.get(t);var r=n();return e._cache.set(t,r),r},this.clear=function(){e._cache.clear()}},n=function(e){var n=e.fullWidth,r=e.column,o=e.mode,i=e.idx;return t.memoize("column-order-".concat(n,"-").concat(i),function(){var e=0;return o===Pm.Desktop||o===Pm.Tablet?e=r.desktopOrder||0:o===Pm.Phone&&(e=r.phoneOrder||0),e})},r=function(e){var n=e.fullWidth,r=e.column,o=e.idx,i=Math.max(n-75,1);return t.memoize("column-width-".concat(n,"-").concat(o),function(){var e=r.width,t="function"==typeof e?e(i):e;return"number"==typeof t?"".concat(t,"px"):t})};return{constraintManager:t,wrapColumns:function(o){var i=o.columns,l=o.fullWidth,c=o.mode,u=o.visibilityRequest;return i.filter(function(e,n){return function(e){var n=e.column,r=e.fullWidth,o=e.visibilityRequest,i=e.idx;return t.memoize("column-visibility-".concat(r,"-").concat(i),function(){var e=!0;return n.isVisible&&(e=n.isVisible(o)),e})}({visibilityRequest:u,column:e,fullWidth:l,mode:c,idx:n})}).filter(function(e,n){return!function(e){var n=e.column,r=e.fullWidth,o=e.mode,i=e.idx;return t.memoize("column-hidden-".concat(r,"-").concat(i),function(){var e=!1;return o===Pm.Desktop?e=!!n.desktopHidden:o===Pm.Tablet?e=!!n.tabletHidden:o===Pm.Phone&&(e=!!n.phoneHidden),e})}({visibilityRequest:u,column:e,fullWidth:l,mode:c,idx:n})}).map(function(e,t){return[e,t]}).sort(function(t,r){var o=e(t,2),i=o[0],a=o[1],s=e(r,2),d=s[0],f=s[1];return n({visibilityRequest:u,fullWidth:l,column:i,idx:a,mode:c})+a-(a>f?1:0)-(n({visibilityRequest:u,fullWidth:l,column:d,idx:f,mode:c})+f-(f>a?1:0))}).map(function(t){return e(t,1)[0]}).map(function(e,t,n){var o=n.length;return a(a({},e),{width:r({visibilityRequest:u,fullWidth:l-32*o,column:e,mode:c,idx:t})})})}}},yv=new Set(["@","+","(",")","-","_","!","#","$","%","&","*","/","="]),wv=function(e){var t,n,r="";try{for(var o=c(e),i=o.next();!i.done;i=o.next()){var a=i.value;yv.has(a)?r+=" ":r+=a}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r.split(" ").filter(function(e){return e}).join(" ")},Ev=Tn()({root:{position:"absolute",top:0,left:0,right:0,bottom:0,height:"100%",width:"100%",background:$("#000",.2),display:"flex",alignItems:"center",justifyContent:"center",zIndex:999},hidden:{display:"none !important"}}),xv=function(e){var t,n=e.open,r=Ev().classes;return f.createElement(j,{className:xo(r.root,(t={},t[r.hidden]=!n,t))},f.createElement(O,null))},Cv=function(){return f.createElement(Oe,{primary:"DEFAULT_TEMPLATE",secondary:"DEFAULT_TEMPLATE"})},kv=Tn()(function(e){return{root:{position:"relative"},container:{position:"absolute",top:0,left:0,background:e.palette.background.paper},empty:{position:"absolute",zIndex:999,top:0,left:0,right:0}}}),Sv=function(o){var i=kv().classes,l=Xh(),c=_r(),u=ev({rows:o.rows,scrollYSubject:c});w(function(){return l.scrollYSubject.subscribe(function(){c.next(0)})},[]);var s=hm(),d=s.selection,m=s.setSelection,p=o.offset,v=o.limit,g=o.total,b=o.loading,y=o.payload,E=o.rowMark,x=o.rowColor,C=o.selectionMode,k=void 0===C?Li.None:C,S=o.customTemplate,L=void 0===S?Cv:S,N=o.customTemplateMinHeight,I=void 0===N?45:N,M=o.withLoader,R=void 0!==M&&M,P=o.onRowClick,A=o.tileMode,T=o.itemSx,D=ep(),O=h(function(){return r([],e(d),!1)},[d]),F=yi(),_=F.elementRef,B=F.size,H=B.height,W=B.width,z=o.handlePageChange,V=Math.floor(p/v)+1,Y=!g||V*v<g,U=al([b]),q=ro(function(e){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return e?[2]:!0&&Y&&!b?(z(V),[4,U()]):[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}})})}).execute;return f.createElement(Tp,a({},o,u),f.createElement(j,{ref:_,className:i.root},f.createElement(j,{className:i.container},f.createElement(j,{position:"relative",style:{height:H,width:W}},f.createElement(Xi,{mode:A,itemSx:T,recomputeSubject:u.recomputeSubject,scrollYSubject:c,minRowHeight:I,hasMore:Y,bufferSize:Math.min(2*v,15),selectedRows:O,onSelectedRows:function(e,t){t||m(new Set(e))},selectionMode:k,payload:y,rowMark:E,rowKey:"id",rowColor:x,data:u.rows,loading:b,onSkip:function(e){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,q(e)];case 1:return[2,void t.sent()]}})})},onItemClick:function(e){!function(e){o.withSelectOnRowClick&&o.selectionMode!==Li.None?(o.selectionMode===Li.Single?d.has(e.id)&&1===d.size?d.delete(e.id):(d.clear(),d.add(e.id)):d.has(e.id)?d.delete(e.id):d.add(e.id),m(d)):P&&P(e,D)}(e.data)},sx:{height:H,width:W}},L),f.createElement(xv,{open:R&&b})))))},Lv=function(){return f.createElement(Oe,{primary:"DEFAULT_TEMPLATE",secondary:"DEFAULT_TEMPLATE"})},Nv=[10,25,50],Iv=Tn()(function(e){return{root:{position:"relative"},container:{position:"absolute",top:0,left:0,background:e.palette.background.paper},empty:{position:"absolute",zIndex:999,top:0,left:0,right:0}}}),Mv=function(t){var n=Iv().classes,o=Xh(),i=_r();w(function(){return o.scrollYSubject.subscribe(function(){i.next(0)})},[]);var l=hm(),c=l.selection,u=l.setSelection,s=t.rows,d=t.offset,m=t.limit,p=t.total,v=t.payload,g=t.rowMark,b=t.rowColor,y=t.selectionMode,E=void 0===y?Li.None:y,x=t.pageItemTemplate,C=void 0===x?Lv:x,k=t.pageItemTemplateMinHeight,S=void 0===k?45:k,L=t.labelDisplayedRows,N=t.onRowClick,I=t.tileMode,M=t.itemSx,R=ev({rows:t.rows,scrollYSubject:i}),P=ep(),A=h(function(){return r([],e(c),!1)},[c]),T=yi(),D=T.elementRef,O=T.size,F=O.height,_=O.width,B=t.handlePageChange,H=t.handleLimitChange;return f.createElement(Tp,a({},t),f.createElement(j,{ref:D,className:n.root},f.createElement(j,{className:n.container},f.createElement(j,{position:"relative",style:{height:F-52,width:_}},f.createElement(Xi,{mode:I,itemSx:M,recomputeSubject:R.recomputeSubject,scrollYSubject:i,minRowHeight:S,hasMore:!1,loading:!1,bufferSize:Math.min(2*m,15),selectedRows:A,onSelectedRows:function(e,t){t||u(new Set(e))},selectionMode:E,payload:v,rowMark:g,rowKey:"id",rowColor:b,data:s,onItemClick:function(e){!function(e){t.withSelectOnRowClick&&t.selectionMode!==Li.None?(t.selectionMode===Li.Single?c.has(e.id)&&1===c.size?c.delete(e.id):(c.clear(),c.add(e.id)):c.has(e.id)?c.delete(e.id):c.add(e.id),u(c)):N&&N(e,P)}(e.data)},sx:{height:F-52,width:_}},C)),f.createElement(Cm,{width:_,height:F,count:p||-1,rowsPerPage:m,page:d/m,labelDisplayedRows:L,rowsPerPageOptions:Nv,onPageChange:function(e,t){return B(t)},onRowsPerPageChange:function(e){return H(e.target.value)}}))))},Rv=function(o){function i(i){var l=o.call(this,i)||this;l.stateActionEmitter=new lr,l.isMountedFlag=!1,l.isFetchingFlag=!1,l.isRerenderFlag=!1,l.isPatchingFlag=!1,l.prevState={},l.scrollManager=new function(){var e=this;this.scrollYSubject=new lr,this._lastScrollX=0,this._handleScroll=function(){if(e._currentElement){var t=e._currentElement.scrollLeft;e._lastScrollX=t}},this.provideRef=function(t){e.clear(),t&&(t.addEventListener("scroll",e._handleScroll,{passive:!0}),e._currentElement=t)},this.scrollTop=function(){e._currentElement&&e._currentElement.scrollTo(e._lastScrollX,0),e.scrollYSubject.next(0)},this.clear=function(){e._currentElement&&e._currentElement.removeEventListener("scroll",e._handleScroll),e._currentElement=void 0}},l.constraintManager=bv(),l.computeKeepPageOnReload=function(){var e=!0;return e=(e=(e=e&&!l.props.isChooser)&&!l.props.isInfinite)&&!l.props.isCustom},l.setLoading=function(e){return l.isMountedFlag&&l.setState(function(t){return a(a({},t),{loading:e})})},l.setFiltersCollapsed=function(e){return l.isMountedFlag&&l.setState(function(t){return a(a({},t),{filtersCollapsed:e})})},l.componentDidUpdate=function(){l.handleUpdateRef(),l.state.rerender?l.beginRerender():l.beginFetchQueue()},l.componentDidMount=function(){l.isMountedFlag=!0,l.handleReady(!0),l.handleUpdateRef()},l.componentWillUnmount=function(){l.isFetchingFlag=!1,l.isMountedFlag=!1,l.handleFetchQueue.clear(),l.unReloadSubject&&l.unReloadSubject(),l.unRerenderSubject&&l.unRerenderSubject(),l.unSetLimitSubject&&l.unSetLimitSubject(),l.unSetPageSubject&&l.unSetPageSubject(),l.unSetRowsSubject&&l.unSetRowsSubject()},l.beginRerender=function(){queueMicrotask(function(){return V(function(){l.isMountedFlag&&l.setState(function(e){return a(a({},e),{rerender:!1})}),l.isRerenderFlag=!0})})},l.beginFetchQueue=function(){l.prevState.filtersCollapsed===l.state.filtersCollapsed?l.handleFetchQueue():l.prevState.filtersCollapsed=l.state.filtersCollapsed},l.createHandleFetchQueue=function(e){return void 0===e&&(e=1e3),ne(function(){var e=[l.handlePageChanged,l.handleParamsChanged],t=!0;if(t=(t=t&&!l.state.loading)&&l.state.initComplete){if(!l.isFetchingFlag)return void(l.isPatchingFlag=!1);l.isRerenderFlag?l.isRerenderFlag=!1:l.isPatchingFlag?l.isPatchingFlag=!1:(l.isFetchingFlag=!1,e.reduce(function(e,t){return e?!t():e},!0))}l.prevState=a({},l.state)},e)},l.handleFetchQueue=l.createHandleFetchQueue(),l.handlePageChanged=function(){var e=!1;return(e=(e=e||l.prevState.offset===l.state.offset)||l.prevState.limit===l.state.limit)&&l.handleReload(),e},l.handleParamsChanged=function(){var e=!1;return(e=(e=(e=e||l.prevState.chips===l.state.chips)||l.prevState.sort===l.state.sort)||l.prevState.search===l.state.search)&&(l.handleFilter(l.state.filterData,!1),l.props.onPageChange(0)),e},l.handleUpdateRef=function(){var e=l.props.apiRef,r={reload:l.handleReload,setLimit:l.handleLimitChange,setPage:l.handlePageChange,setRows:l.handleRowsChange,setFilterData:l.handleFilter,getState:function(){return a({},l.state)},rerender:l.handleRerender};"function"==typeof e?e(r):e&&(e.current=r),l.props.reloadSubject&&(l.unReloadSubject&&l.unReloadSubject(),l.unReloadSubject=l.props.reloadSubject.subscribe(function(){return t(l,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return this.computeKeepPageOnReload()?[3,2]:[4,this.handleReload(!1)];case 1:case 3:return e.sent(),[2];case 2:return[4,this.handleReload()]}})})})),l.props.rerenderSubject&&(l.unRerenderSubject&&l.unRerenderSubject(),l.unRerenderSubject=l.props.rerenderSubject.subscribe(l.handleRerender)),l.props.setLimitSubject&&(l.unSetLimitSubject&&l.unSetLimitSubject(),l.unSetLimitSubject=l.props.setLimitSubject.subscribe(l.handleLimitChange)),l.props.setPageSubject&&(l.unSetPageSubject&&l.unSetPageSubject(),l.unSetPageSubject=l.props.setPageSubject.subscribe(l.handlePageChange)),l.props.setRowsSubject&&(l.unSetRowsSubject&&l.unSetRowsSubject(),l.unSetRowsSubject=l.props.setRowsSubject.subscribe(l.handleRowsChange)),l.props.setFilterDataSubject&&(l.unSetFilterDataSubject&&l.unSetFilterDataSubject(),l.unSetFilterDataSubject=l.props.setFilterDataSubject.subscribe(l.handleFilter))},l.handleReady=function(e){void 0===e&&(e=!1),l.handleDefault(e),l.prevState.filtersCollapsed=l.state.filtersCollapsed},l.handleRows=function(o){for(var i=[],a=1;a<arguments.length;a++)i[a-1]=arguments[a];return t(l,r([o],e(i),!1),void 0,function(e,t){var r,o,i,a,l,c,u,s,d,f;return void 0===t&&(t=!1),n(this,function(n){switch(n.label){case 0:return[4,$n(0)];case 1:return n.sent(),"function"!=typeof this.props.handler?[3,3]:[4,Promise.resolve(this.props.handler(e,{limit:this.state.limit,offset:t?this.state.offset:0},this.state.sort,this.state.chips,String(this.props.withRawSearch?this.state.search:wv(this.state.search)).trim(),this.state.payload))];case 2:return r=n.sent(),Array.isArray(r)?(r.length>this.state.limit&&console.warn("List rows count is more than it's capacity"),f={rows:r.slice(0,this.state.limit),total:null},this.props.onRows(f.rows),[2,f]):(i=(o=r||{}).rows,u=void 0===i?[]:i,a=o.total,d=void 0===a?null:a,u.length>this.state.limit&&console.warn("List rows count is more than it's capacity"),f={rows:u.slice(0,this.state.limit),total:d},this.props.onRows(f.rows),[2,f]);case 3:return Array.isArray(this.props.handler)?(f={rows:this.props.handler.slice(this.state.offset,this.state.limit+this.state.offset),total:this.props.handler.length},this.props.onRows(f.rows),[2,f]):(l=this.props.handler||{},c=l.rows,u=void 0===c?[]:c,s=l.total,d=void 0===s?null:s,f={rows:u.slice(this.state.offset,this.state.limit+this.state.offset),total:d},this.props.onRows(f.rows),[2,f]);case 4:return[2]}})})},l.handleFilter=function(o){for(var i=[],c=1;c<arguments.length;c++)i[c-1]=arguments[c];return t(l,r([o],e(i),!1),void 0,function(e,t){var r,o,i,l;return void 0===t&&(t=!1),n(this,function(n){switch(n.label){case 0:if(this.state.loading)return[2];this.setLoading(!0),n.label=1;case 1:return n.trys.push([1,5,6,7]),[4,this.stateActionEmitter.next({type:"filterdata-changed",keepPagination:t,filterData:e})];case 2:return n.sent(),[4,this.handleRows(e,t)];case 3:return r=n.sent(),o=r.rows,i=r.total,[4,this.stateActionEmitter.next({type:"rows-changed",rows:o,total:i})];case 4:return n.sent(),t||this.scrollManager.scrollTop(),this.isMountedFlag&&this.setState(function(n){return a(a(a({},n),{initComplete:!0,loading:!1,filterData:e,rows:o,total:i}),!t&&{offset:0})}),[3,7];case 5:return l=n.sent(),this.props.fallback(l),[3,7];case 6:return this.setLoading(!1),this.props.onFilterChange(e),[7];case 7:return[2]}})})},l.handleDefault=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return t(l,r([],e(o),!1),void 0,function(e){var t,r=this;return void 0===e&&(e=!1),n(this,function(n){switch(n.label){case 0:return t={},Ar(this.props.filters).filter(function(e){return!!e.name}).forEach(function(e){var n=e.type,o=e.name,i=e.defaultValue,a=e.hidden;Dr(t,o),("function"==typeof a?a(r.state.payload):a)||Wn(t,o,void 0===i?zn(t,o)||Pr(n):"function"==typeof i?i(r.state.payload):i)}),e&&Tr(t,this.props.filterData),[4,this.handleFilter(t,e)];case 1:return n.sent(),!e&&this.props.onPageChange(0),[2]}})})},l.handleReload=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return t(l,r([],e(o),!1),void 0,function(e){return void 0===e&&(e=!0),n(this,function(t){switch(t.label){case 0:return this.constraintManager.constraintManager.clear(),this.scrollManager.clear(),[4,this.handleFilter(this.state.filterData,e)];case 1:return t.sent(),!e&&this.props.onPageChange(0),[2]}})})},l.handlePageChange=function(e){l.isFetchingFlag=!0,l.isMountedFlag&&l.setState(function(t){return a(a({},t),{offset:e*t.limit})}),l.props.onPageChange(e)},l.handleLimitChange=function(e){l.isFetchingFlag=!0;var t=Math.floor(l.state.offset/e);l.isMountedFlag&&l.setState(function(n){return a(a({},n),{offset:t*e,limit:e})}),l.props.onLimitChange(e)},l.handleRowsChange=function(e){return t(l,void 0,void 0,function(){return n(this,function(t){return e=e.slice(0,this.state.limit).map(function(e){return a({},e)}),this.stateActionEmitter.next({type:"rows-reload",rows:e}),this.isPatchingFlag=!0,this.isMountedFlag&&this.setState(function(t){return a(a({},t),{rows:e})}),[2]})})},l.handleSortModel=function(e){return t(l,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,this.stateActionEmitter.next({type:"sort-changed",sort:e})];case 1:return t.sent(),this.isFetchingFlag=!0,this.isMountedFlag&&this.setState(function(t){return a(a({},t),{offset:0,sort:e})}),this.props.onSortModelChange(e),this.props.onPageChange(0),[2]}})})},l.handleChips=function(e){return t(l,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,this.stateActionEmitter.next({type:"chips-changed",chips:e})];case 1:return t.sent(),this.isFetchingFlag=!0,this.isMountedFlag&&this.setState(function(t){return a(a({},t),{offset:0,chips:e})}),this.props.onChipsChange(a(a({},this.state.chips),e)),this.props.onPageChange(0),[2]}})})},l.handleSearch=function(e){return t(l,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,this.stateActionEmitter.next({type:"search-changed",search:e})];case 1:return t.sent(),this.isFetchingFlag=!0,this.isMountedFlag&&this.setState(function(t){return a(a({},t),{offset:0,search:e})}),this.props.onSearchChange(e),this.props.onPageChange(0),[2]}})})},l.handleRerender=function(){queueMicrotask(function(){return V(function(){l.isMountedFlag&&l.setState(function(e){return a(a({},e),{rerender:!0})})})})},l.handleFiltersCollapsed=function(e){return l.setFiltersCollapsed(e)},l.getCallbacks=function(){return{handlePageChange:l.handlePageChange,handleLimitChange:l.handleLimitChange,handleSortModel:l.handleSortModel,handleDefault:l.handleDefault,handleFilter:l.handleFilter,handleReload:l.handleReload,handleChips:l.handleChips,handleSearch:l.handleSearch,handleRowsChange:l.handleRowsChange,handleFiltersCollapsed:l.handleFiltersCollapsed,handleRerender:l.handleRerender,computeKeepPageOnReload:l.computeKeepPageOnReload}},l.renderInner=function(){var e=l.getCallbacks();return l.state.isPageItem?f.createElement(Mv,a({},l.props,l.state,{handler:l.props.handler,filters:l.props.filters,columns:l.props.columns,actions:l.props.actions,limit:l.state.limit,offset:l.state.offset,listChips:l.props.chips},e)):l.state.isCustom?f.createElement(Sv,a({},l.props,l.state,{handler:l.props.handler,filters:l.props.filters,columns:l.props.columns,actions:l.props.actions,limit:l.state.limit,offset:l.state.offset,listChips:l.props.chips},e)):l.state.isInfinite?f.createElement(vv,a({},l.props,l.state,{handler:l.props.handler,filters:l.props.filters,columns:l.props.columns,actions:l.props.actions,limit:l.state.limit,offset:l.state.offset,listChips:l.props.chips},e)):l.state.isChooser?f.createElement(dv,a({},l.props,l.state,{handler:l.props.handler,filters:l.props.filters,columns:l.props.columns,actions:l.props.actions,limit:l.state.limit,offset:l.state.offset,listChips:l.props.chips},e)):f.createElement(Qh,a({},l.props,l.state,{handler:l.props.handler,filters:l.props.filters,columns:l.props.columns,actions:l.props.actions,limit:l.state.limit,offset:l.state.offset,listChips:l.props.chips},e))},l.render=function(){var e=l.getCallbacks();return f.createElement(tf,null,f.createElement(Dn,null,f.createElement(Jh,{payload:l.stateActionEmitter},f.createElement(fm,a({},l.props,l.state,e),f.createElement(Bp,null,f.createElement($h,{payload:l.scrollManager},f.createElement(Tm,{payload:l.constraintManager},f.createElement(vm,{selectedRows:l.props.selectedRows},f.createElement(wp,null,f.createElement(Cp,{initialState:function(){return new Map}},f.createElement(dp,{sortModel:l.props.sortModel},f.createElement(yh,{chips:l.props.chips,chipData:l.props.chipData},f.createElement(Om,{value:l.state.filterData},f.createElement(Bm,{limit:l.state.limit,offset:l.state.offset},f.createElement(Um,{value:l.state.search},f.createElement(gp,null,f.createElement(Wh,a({},l.props.slots),f.createElement(zm,{value:l.state.payload},l.renderInner()))))))))))))))))))};return l.state={initComplete:!1,payload:"function"==typeof l.props.payload?l.props.payload():l.props.payload,isChooser:l.props.isChooser,isInfinite:l.props.isInfinite,isCustom:!!l.props.customTemplate||l.props.isCustom,isPageItem:!!l.props.pageItemTemplate||l.props.isPageItem,filterData:l.props.filterData,rows:[],limit:l.props.limit,offset:l.props.isChooser||l.props.isInfinite||l.props.isCustom?0:l.props.limit*l.props.page,total:null,search:l.props.search||"",loading:!1,filtersCollapsed:l.props.withToggledFilters,sort:l.props.sortModel,chips:l.props.chips.reduce(function(e,t){var n,r=t.name,o=t.enabled,i=void 0!==o&&o;return a(a({},e),((n={})[r]=l.props.chipData[r]||i,n))},{}),rerender:!1},l.prevState=a({},l.state),l.handleFetchQueue=l.createHandleFetchQueue(i.fetchDebounce),l}return u(i,o),i.defaultProps={handler:function(){return[]},payload:{},fallback:function(e){return console.error(e)},limit:gv,page:0,isChooser:!1,isInfinite:!1,isCustom:!1,filters:[],columns:[],actions:[],onRows:function(){return null},onSortModelChange:function(){return null},onFilterChange:function(){return null},onChipsChange:function(){return null},onSearchChange:function(){return null},onPageChange:function(){return null},onLimitChange:function(){return null},labelDisplayedRows:function(e){var t=e.count,n=e.from,r=e.to;return"".concat(n,"–").concat(r," ").concat(-1!==t?"(".concat(t,")"):"")},selectionLabel:function(e){return"".concat(e||"")},filterData:{},withToggledFilters:!1,fetchDebounce:1e3,tileMode:Fi.Intersection,sortModel:[],chips:[],chipData:{},search:"",slots:{}},i}(f.Component),Pv=function(e){return f.createElement(Rv,a({},e))},Av=function(e){var t=h(function(){var t=e.columns,n=void 0===t?[]:t,r=e.rowActions,o=e.onRowAction;return(null==r?void 0:r.length)&&o?n:n.filter(function(e){return e.type!==Qm.Action})},[]);return f.createElement(Pv,a({},e,{columns:t}))},Tv=function(e){var t,n,r={};try{for(var o=c(Object.keys(e||{})),i=o.next();!i.done;i=o.next()){var a=i.value;null!==e[a]&&(""!==e[a]&&!1!==e[a]&&(r[a]=e[a]))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r},Dv={rows:[],total:null},jv=function(r,o){var i=void 0===o?{}:o,l=i.fetch,c=void 0===l?window.fetch:l,u=i.origin,s=void 0===u?window.location.origin:u,d=i.abortSignal,f=void 0===d?Nf.signal:d,m=i.removeEmptyFilters,p=void 0===m?Tv:m,v=i.fetchParams,g=i.fallback,b=i.onLoadBegin,y=i.onLoadEnd,E=i.requestMap,x=void 0===E?function(e){return e}:E,C=i.responseMap,k=void 0===C?function(e){return e}:C,S=i.filterHandler,L=void 0===S?function(t,n){return Object.entries(n).forEach(function(n){var r=e(n,2),o=r[0],i=r[1];Array.isArray(i)?i.forEach(function(e){t.searchParams.append("filter.".concat(o),"$lte:".concat(e))}):i&&t.searchParams.append("filter.".concat(o),"$lte:".concat(i))}),t}:S,N=i.chipsHandler,I=void 0===N?function(t,n){return Object.entries(n).forEach(function(n){var r=e(n,2),o=r[0];r[1]&&t.searchParams.append("filter.".concat(o),"$eq:1")}),t}:N,M=i.sortHandler,R=void 0===M?function(e,t){return t.forEach(function(t){var n=t.field,r=t.sort;r&&e.searchParams.append("sortBy","".concat(String(n),":").concat(r.toUpperCase()))}),e}:M,P=i.searchHandler,A=void 0===P?function(e,t){return e.searchParams.set("search",t),e}:P,T=i.paginationHandler,D=void 0===T?function(e,t){var n=t.limit,r=t.offset;return e.searchParams.set("limit",n.toString()),e.searchParams.set("page",(r/n).toString()),e}:T,j=i.withAbortSignal,O=void 0===j||j,F=i.withPagination,_=void 0===F||F,B=i.withFilters,H=void 0===B||B,W=i.withSearch,z=void 0===W||W,V=i.withChips,Y=void 0===V||V,U=i.withSort,q=void 0===U||U,$=h(function(){return Kn(c)},[]),X=h(function(){return function(e,o,i,l,c){return t(void 0,void 0,void 0,function(){var t,u,d,m,h;return n(this,function(n){switch(n.label){case 0:e=p(e),t=new URL(r,s),u=!0,_&&(t=D(new URL(t),o)),H&&(t=L(new URL(t),e)),Y&&(t=I(new URL(t),l)),q&&(t=R(new URL(t),i)),z&&(t=A(new URL(t),c)),t=x(new URL(t)),b&&b(),n.label=1;case 1:return n.trys.push([1,5,6,7]),[4,$(t.toString(),a({signal:f},v&&v()))];case 2:return(d=n.sent())===Xn?[2,{rows:[],total:null}]:[4,d.json()];case 3:return m=n.sent(),[4,k(m)];case 4:return[2,n.sent()];case 5:if(h=n.sent(),$.clear(),u=!1,h instanceof If&&(h=h.originalError),h instanceof DOMException&&"AbortError"==h.name)return[2,a({},Dv)];if(g)return g(h),[2,a({},Dv)];throw h;case 6:return y&&y(u),[7];case 7:return[2]}})})}},[]);return w(function(){return function(){O&&Nf.abort()}},[]),w(function(){return function(){$.clear()}},[]),X},Ov=function(t){var n=e(g({filterData:{},chipData:{},sort:[],pagination:{offset:0,limit:0},search:""}),2),r=n[0],o=n[1];return{handler:function(e,n,r,i,a,l){return e=Tv(e),o({filterData:e,pagination:n,sort:r,chipData:i,search:a}),"function"==typeof t?t(e,n,r,i,a,l):t},data:r}},Fv=function(e,t){void 0===e&&(e={}),void 0===t&&(t="");var n=Fr(e);return h(function(){var e=new URL(window.location.href,window.location.origin),r=a({},n),o="".concat(t,"_");return e.searchParams.forEach(function(e,t){t.startsWith(o)&&("true"===e?Wn(r,t.replace(o,""),!0):"false"===e?Wn(r,t.replace(o,""),!1):"null"===e?Wn(r,t.replace(o,""),null):e&&!isNaN(e)?Wn(r,t.replace(o,""),parseInt(e)):Wn(r,t.replace(o,""),e))}),r},[n])},_v=Kn(function(o,i,a){return t(void 0,[o,i,a],void 0,function(t,o,i){var a,l,u,s,d,f,m,p,h,v,g,b,y,w,E,x=t.state,C=t.action,k=o.prefix,S=void 0===k?"":k,L=o.updateDelay,N=void 0===L?500:L,I=o.noCleanupExtra,M=void 0!==I&&I,R=o.noCleanupOnLeave,P=void 0!==R&&R;return n(this,function(t){switch(t.label){case 0:return[4,$n(N)];case 1:if(t.sent(),!i.current)return[2];if("update"===C){if(a=new URL(window.location.href,window.location.origin),Object.entries(x).forEach(function(t){var n=e(t,2),r=n[0],o=n[1];Array.isArray(o)||Bn(o)?a.searchParams.set("".concat(S,"_").concat(r),JSON.stringify(o)):a.searchParams.set("".concat(S,"_").concat(r),String(o))}),!M)try{for(l=c(r([],e(a.searchParams.keys()),!1)),u=l.next();!u.done;u=l.next())(h=u.value).startsWith("".concat(S,"_"))||a.searchParams.delete(h)}catch(e){v={error:e}}finally{try{u&&!u.done&&(g=l.return)&&g.call(l)}finally{if(v)throw v.error}}window.history.pushState(null,"",a.toString())}if("unmount"===C){if(s=new URL(window.location.href,window.location.origin),P)return[2];try{for(d=c(r([],e(s.searchParams.keys()),!1)),f=d.next();!f.done;f=d.next())h=f.value,s.searchParams.delete(h)}catch(e){b={error:e}}finally{try{f&&!f.done&&(y=d.return)&&y.call(d)}finally{if(b)throw b.error}}if(!M)try{for(m=c(r([],e(s.searchParams.keys()),!1)),p=m.next();!p.done;p=m.next())(h=p.value).startsWith("".concat(S,"_"))||s.searchParams.delete(h)}catch(e){w={error:e}}finally{try{p&&!p.done&&(E=m.return)&&E.call(m)}finally{if(w)throw w.error}}window.history.pushState(null,"",s.toString())}return[2]}})})}),Bv=function(t,n){void 0===t&&(t={});var r=void 0===n?{}:n,o=r.prefix,i=void 0===o?"":o,a=r.updateDelay,l=void 0===a?500:a,c=r.noCleanupExtra,u=void 0!==c&&c,s=r.noCleanupOnLeave,d=void 0!==s&&s,f=Fv(t,i),m=e(g(f),2),p=m[0],h=m[1],v=b(!0);return w(function(){_v({action:"update",state:p},{prefix:i,updateDelay:l,noCleanupExtra:u,noCleanupOnLeave:d},v)},[p]),w(function(){return function(){_v({action:"unmount",state:p},{prefix:i,updateDelay:l,noCleanupExtra:u,noCleanupOnLeave:d},v),v.current=!1}},[]),[p,h]},Hv={filterData:{},sortModel:[],chipData:{},limit:gv,page:0,search:""},Wv=function(t,n){void 0===t&&(t=Hv);var r=void 0===n?{}:n,o=r.onFilterChange,i=void 0===o?function(){return null}:o,l=r.onLimitChange,c=void 0===l?function(){return null}:l,u=r.onPageChange,s=void 0===u?function(){return null}:u,d=r.onSortModelChange,f=void 0===d?function(){return null}:d,m=r.onChipsChange,p=void 0===m?function(){return null}:m,v=r.onSearchChange,g=void 0===v?function(){return null}:v,b=r.onChange,y=void 0===b?function(){return null}:b,w=r.removeEmptyFilters,E=void 0===w?Tv:w,x=r.prefix,C=void 0===x?"list":x,k=r.noCleanupExtra,S=r.noCleanupOnLeave,L=r.fallback,N=h(function(){return{chipData:t.chipData||Hv.chipData,filterData:t.filterData||Hv.filterData,limit:t.limit||Hv.limit,page:t.page||Hv.page,search:t.search||Hv.search,sortModel:t.sortModel||Hv.sortModel}},[]),I=e(Bv(function(){return{filterData:JSON.stringify(N.filterData)||"{}",sortModel:JSON.stringify(N.sortModel)||"[]",chipData:JSON.stringify(N.chipData)||"{}",limit:N.limit||gv,page:N.page||0,search:N.search||""}},{prefix:C,noCleanupExtra:k,noCleanupOnLeave:S}),2),M=I[0],R=I[1],P=Vr(M),A=h(function(){return{filterData:JSON.parse(M.filterData||"{}"),sortModel:JSON.parse(M.sortModel||"[]"),chipData:JSON.parse(M.chipData||"{}"),limit:M.limit||gv,page:M.page||0,search:M.search||""}},[M]),T=Vr(A);Xr(function(){y(JSON.stringify(P.current))},[M]);var D=function(e){e=E(e),R(function(t){return a(a({},t),{filterData:JSON.stringify(e||"{}")})}),i(e)},j=function(e){R(function(t){return a(a({},t),{limit:e})}),c(e)},O=function(e){R(function(t){return a(a({},t),{page:e})}),s(e)},F=function(e){R(function(t){return a(a({},t),{sortModel:JSON.stringify(e||"[]")})}),f(e)},_=function(e){R(function(t){return a(a({},t),{chipData:JSON.stringify(e||"{}")})}),p(e)},B=function(e){R(function(t){return a(a({},t),{search:e})}),g(e)},H={getFilterData:function(){return T.current.filterData||{}},getSortModel:function(){return T.current.sortModel||[]},getChipData:function(){return T.current.chipData||{}},getLimit:function(){return T.current.limit||gv},getPage:function(){return T.current.page||0},getSearch:function(){return T.current.search||""}},W={setFilterData:D,setSortModel:F,setChipData:_,setLimit:j,setPage:O,setSearch:B};return a(a({listProps:a(a({onFilterChange:D,onLimitChange:j,onPageChange:O,onSortModelChange:F,onChipsChange:_,onSearchChange:B},L&&{fallback:L}),A)},H),W)},zv=function(e){for(var t,n,r=[],o=1;o<arguments.length;o++)r[o-1]=arguments[o];var i=e;try{for(var a=c(r),l=a.next();!l.done;l=a.next()){var u=l.value;i=i.split(u).join("")}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return i},Vv=[",",";","-","@"],Yv={rows:[],total:null},Uv=["name","label","title","description"],qv=function(o,i){var l=void 0===i?{}:i,c=l.searchEntries,u=void 0===c?Uv:c,s=l.searchFilterChars,d=void 0===s?Vv:s,f=l.responseMap,m=void 0===f?function(e){return e}:f,p=l.removeEmptyFilters,v=void 0===p?Tv:p,g=l.compareFn,b=void 0===g?function(e,t,n){var r=e[n],o=t[n];return"number"==typeof r&&"number"==typeof o?r-o:"boolean"==typeof r&&"boolean"==typeof o?(r?1:0)-(o?1:0):"string"==typeof r&&"string"==typeof o?r.match(_l)&&o.match(_l)?Gl(r)-Gl(o):r.match(Bl)&&o.match(Bl)?Xl(r)-Xl(o):r.localeCompare(o):String(r||"").localeCompare(String(o||""))}:g,y=l.filterHandler,E=void 0===y?function(t,n){return Object.entries(n).forEach(function(n){var r=e(n,2),o=r[0],i=r[1];if(Array.isArray(i))t=t.filter(function(e){var t=e[o];return Array.isArray(t)?i.every(function(e){return t.includes(e)}):i.includes(t)});else if(i){var a=String(i).toLocaleLowerCase();t=t.filter(function(e){return!!e[o]&&String(e[o]).toLowerCase().includes(a)})}}),t}:y,x=l.chipsHandler,C=void 0===x?function(t,n){if(!Object.values(n).reduce(function(e,t){return e||t},!1))return t;var r=[];return Object.entries(n).forEach(function(n){var o=e(n,2),i=o[0];o[1]&&r.push(t.filter(function(e){return e[i]}))}),r.flat()}:x,k=l.sortHandler,S=void 0===k?function(e,t){return t.forEach(function(t){var n=t.field,r=t.sort;e=e.sort(function(e,t){return"asc"===r?b(e,t,n):b(t,e,n)})}),e}:k,L=l.searchHandler,N=void 0===L?function(t,n){if(t.length&&n){var o=u.every(function(e){return void 0!==t[0][e]}),i=zv.apply(void 0,r([n.toLowerCase()],e(d),!1)).split(" ");return o?t.filter(function(t){var n=!0;return i.forEach(function(o){n=n&&u.some(function(n){var i=t[n]?String(t[n]).toLowerCase():"";return!!(i=zv.apply(void 0,r([i],e(d),!1)))&&i.includes(o)})}),n}):(console.warn("react-declatative useArrayPaginator searchHandler missing field detected"),t)}return t}:L,I=l.paginationHandler,M=void 0===I?function(e,t){var n=t.limit,r=t.offset;return e.length>n?e.slice(r,n+r):e}:I,R=l.withPagination,P=void 0===R||R,A=l.withFilters,T=void 0===A||A,D=l.withChips,j=void 0===D||D,O=l.withSort,F=void 0===O||O,_=l.withTotal,B=void 0===_||_,H=l.withSearch,W=void 0===H||H,z=l.fallback,V=l.onLoadStart,Y=l.onLoadEnd,U=l.onData,q=h(function(){return Kn(function(e,r,i,a,l,c){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return"function"!=typeof o?[3,2]:[4,o(e,r,i,a,l,c)];case 1:return[2,t.sent()];case 2:return[2,o]}})})})},[]),$=h(function(){return function(o,i,l,c,u,s){return t(void 0,void 0,void 0,function(){var t,d,f,p,h,g,b;return n(this,function(n){switch(n.label){case 0:o=v(o),t=!0,n.label=1;case 1:return n.trys.push([1,4,5,6]),V&&V(),[4,q(o,i,l,c,u,s)];case 2:return(d=n.sent())===Xn?[2,{rows:[],total:null}]:(f=!Array.isArray(d),p=f?d.rows:d,p=r([],e(p),!1).map(function(e){return a({},e)}),[4,m(p)]);case 3:return p=n.sent(),U&&U(p,{filterData:o,pagination:i,sort:l,chipData:c,search:u}),T&&!f&&(p=E(p.slice(0),o)),j&&!f&&(p=C(p.slice(0),c)),F&&!f&&(p=S(p.slice(0),l)),W&&!f&&(p=N(p.slice(0),u)),h=p.length,P&&!f&&(p=M(p.slice(0),i)),g=f?d.total||null:h,[2,{rows:p,total:B?g:null}];case 4:if(b=n.sent(),q.clear(),t=!1,z)return z(b),[2,a({},Yv)];throw b;case 5:return Y&&Y(t),[7];case 6:return[2]}})})}},[]);return w(function(){return function(){return q.clear()}},[]),$},$v=function(t,n){var o=h(function(){return fo(function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];return"function"==typeof t?t.apply(void 0,r([],e(n),!1)):t})},[]);return{handler:qv(o,n),clear:o.clear}},Xv={filterData:{},sortModel:[],chipData:{},limit:gv,page:0,search:""},Gv=function(t,n){var r=void 0===n?{}:n,o=r.initialValue,i=void 0===o?Xv:o,l=r.onFilterChange,c=void 0===l?function(){return null}:l,u=r.onLimitChange,s=void 0===u?function(){return null}:u,d=r.onPageChange,f=void 0===d?function(){return null}:d,m=r.onSortModelChange,p=void 0===m?function(){return null}:m,v=r.onChipsChange,b=void 0===v?function(){return null}:v,E=r.onSearchChange,x=void 0===E?function(){return null}:E,C=r.onChange,k=void 0===C?function(){return null}:C,S=r.removeEmptyFilters,L=void 0===S?Tv:S,N=r.fallback,I=h(function(){return{chipData:i.chipData||Xv.chipData,filterData:i.filterData||Xv.filterData,limit:i.limit||Xv.limit,page:i.page||Xv.page,search:i.search||Xv.search,sortModel:i.sortModel||Xv.sortModel}},[]),M=y(function(){return t.location.state?t.location.state:{}},[]),R=e(g(function(){return a(a({},I),M())}),2),P=R[0],A=R[1],T=Vr(P);w(function(){return t.listen(function(e){var t=e.location,n=a(a({},I),t.state||{});A(n),k(n)})},[]);var D=h(function(){return{filterData:P.filterData||{},sortModel:P.sortModel||[],chipData:P.chipData||{},limit:P.limit||gv,page:P.page||0,search:P.search||""}},[P]),j=Vr(D),O=function(e){e=L(e),t.replace(t.location,a(a({},T.current),{filterData:e||{}})),c(e)},F=function(e){t.replace(t.location,a(a({},T.current),{limit:e})),s(e)},_=function(e){t.replace(t.location,a(a({},T.current),{page:e})),f(e)},B=function(e){t.replace(t.location,a(a({},T.current),{sortModel:e||[]})),p(e)},H=function(e){t.replace(t.location,a(a({},T.current),{chipData:e||{}})),b(e)},W=function(e){t.replace(t.location,a(a({},T.current),{search:e})),x(e)},z={getFilterData:function(){return j.current.filterData||{}},getSortModel:function(){return j.current.sortModel||[]},getChipData:function(){return j.current.chipData||{}},getLimit:function(){return j.current.limit||gv},getPage:function(){return j.current.page||0},getSearch:function(){return j.current.search||""}},V={setFilterData:O,setSortModel:B,setChipData:H,setLimit:F,setPage:_,setSearch:W};return a(a({listProps:a(a({onFilterChange:O,onLimitChange:F,onPageChange:_,onSortModelChange:B,onChipsChange:H,onSearchChange:W},N&&{fallback:N}),D)},z),V)},Kv=function(t){var n=void 0===t?{}:t,r=n.selectedRows,o=void 0===r?[]:r,i=n.onChange,a=e(g(o),2),l=a[0],c=a[1],u=y(function(){return c([])},[]);return Xr(function(){i&&i(l)},[l]),{selectedRows:l,listProps:{selectedRows:l,onSelectedRows:function(e){return c(e)}},deselectAll:u,setSelectedRows:c}},Qv=function(e){var r=e.onLoadStart,o=e.onLoadEnd,i=e.throwError,a=e.fallback,l=e.fetchRow,c=e.onAction,u=e.onRowAction,s=e.onSelectionChange,d=e.selectedRows,f=Kv({selectedRows:d,onChange:s}),m=f.deselectAll,p=f.listProps,h=f.selectedRows,v=Ti(function(e){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return c?[4,Promise.all(h.map(l))]:[3,3];case 1:return t=n.sent(),[4,c(e,t,m)];case 2:n.sent(),n.label=3;case 3:return[2]}})})},{onLoadStart:r,onLoadEnd:o,throwError:i,fallback:a}).execute,g=Ti(function(e){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return u?[4,u(e.action,e.row,m)]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}})})},{onLoadStart:r,onLoadEnd:o,throwError:i,fallback:a}).execute;return{deselectAll:m,selectedRows:h,listProps:p,commitAction:v,commitRowAction:function(e,t){return g({action:e,row:t})}}},Jv=Tn()(function(e){return{root:{height:48,width:"100%",background:$(e.palette.getContrastText(e.palette.background.paper),.05)},stretch:{flex:1}}}),Zv=function(t){var n=t.listChips,o=void 0===n?[]:n,i=t.loading,l=Jv().classes,c=mm(),u=c.withSingleChip,s=c.AfterChips,d=bh(),m=d.chips,p=d.setChips,h=function(t,n){return void 0===n&&(n=!0),function(){u&&r([],e(m.keys()),!1).forEach(function(e){return m.set(e,!1)}),m.set(t,n),p(m)}},v=function(e){var t=e.name.toString(),n=!!m.get(t);return f.createElement(He,{variant:n?"filled":"outlined",onClick:h(t,!n),onDelete:n?h(t,!1):void 0,color:"primary",label:e.label,disabled:i})},g=o.filter(function(e){var t=e.name;return m.get(t.toString())}).map(v),b=o.filter(function(e){var t=e.name;return!m.get(t.toString())}).map(v);return f.createElement(rm,{className:l.root,hideOverflowY:!0},f.createElement(we,{alignItems:"center",direction:"row",marginLeft:"5px",marginRight:"5px",spacing:1},g,b,f.createElement("div",{className:l.stretch}),s&&f.createElement(s,a({},t))))},eg=function(t){var n=void 0===t?{}:t,r=n.debounce,o=void 0===r?10:r,i=n.compute,a=void 0===i?function(e){return e}:i,l=n.onResize,c=y(function(){var e=a({height:Math.floor(window.innerHeight),width:Math.floor(window.innerWidth)});return e.height=Math.floor(e.height),e.width=Math.floor(e.width),e},[]),u=e(g(c),2),s=u[0],d=u[1],f=Vr(s);return w(function(){var e=Zn(function(){var e=f.current,t=c();e.height===t.height&&e.width===t.width||(d(t),l&&l(t))},o);return window.addEventListener("resize",e),window.visualViewport&&window.visualViewport.addEventListener("resize",e),function(){window.visualViewport&&window.visualViewport.removeEventListener("resize",e),window.removeEventListener("resize",e),e.clear()}},[]),s},tg=Tn()(function(e){return{root:{display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"},container:{position:"static",padding:20,display:"flex",flexDirection:"column",alignItems:"stretch",justifyContent:"stretch",backgroundColor:e.palette.background.paper,borderRadius:5,gap:5},loader:{minHeight:"".concat(4,"px"),maxHeight:"".concat(4,"px"),marginTop:"-".concat(4,"px"),zIndex:2,width:"100%"},content:{flex:1,overflowY:"auto",overflowX:"hidden",paddingTop:e.spacing(1)},title:{display:"flex",justifyContent:"stretch",alignItems:"center",paddingBottom:15,color:e.palette.text.primary},stretch:{flex:1},submit:{marginTop:15},disabled:{opacity:.5,pointerEvents:"none"}}}),ng=function(){return{height:0,width:0,sx:{maxHeight:"80%",minWidth:"330px",maxWidth:"450px",margin:"10px"}}},rg=function(e){return{height:e.height-50,width:e.width-50}},og=function(r){var o,i=r.withActionButton,l=void 0===i||i,c=r.withStaticAction,u=void 0!==c&&c,s=r.withLoader,d=void 0!==s&&s,m=r.waitForChangesDelay,p=void 0===m?u?0:1e3:m,h=r.onSubmit,v=void 0===h?function(){return!0}:h,b=r.onChange,w=void 0===b?function(){}:b,E=r.onInvalid,x=void 0===E?function(){}:E,C=r.onLoadStart,k=r.onLoadEnd,S=r.fallback,L=r.fields,N=r.param,I=r.handler,M=r.payload,R=void 0===M?{}:M,P=r.fullScreen,A=void 0!==P&&P,T=r.sizeRequest,D=void 0===T?A?rg:ng:T,O=r.title,F=r.apiRef,B=r.features,H=r.changeSubject,W=r.reloadSubject,z=r.isBaselineForRoot,V=r.isBaseline,Y=r.outlinePaper,U=void 0!==Y&&Y,q=r.transparentPaper,$=void 0!==q&&q,X=r.open,G=void 0===X||X,K=r.dirty,Q=void 0!==K&&K,J=r.hidden,Z=void 0!==J&&J,ee=r.readonly,te=void 0!==ee&&ee,ne=r.throwError,re=void 0!==ne&&ne,oe=r.submitLabel,ie=void 0===oe?"Submit":oe,ae=r.submitIcon,le=r.AfterTitle,ce=r.BeforeTitle,ue=r.readTransform,se=r.writeTransform,de=r.incomingTransform,fe=r.outgoingTransform,me=tg().classes,pe=Fr(R),he=eg({compute:function(e){var t=D(e);return{height:t.height,width:t.width,sx:t.sx}},debounce:10}),ve=e(g(null),2),ge=ve[0],be=ve[1],ye=e(jr(0),2),we=ye[0],Ee=ye[1],xe=Vr(ge),Ce=y(function(){return d&&we.current?f.createElement(De,{className:me.loader,variant:"indeterminate"}):null},[we.current]),ke=function(){Ee(function(e){return e+1}),C&&C()},Le=function(e){Ee(function(e){return e-1}),k&&k(e)},Ne=al([ge],10),Ie=function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:if(we.current)return[2];e=!0,n.label=1;case 1:return n.trys.push([1,4,5,6]),ke(),G?[4,v(null,pe,N)]:[3,3];case 2:n.sent(),n.label=3;case 3:return[3,6];case 4:if(t=n.sent(),e=!1,re)throw t;return S&&S(t),[3,6];case 5:return Le(e),[7];case 6:return[2]}})})};return f.createElement(Se,{className:me.root,open:G,sx:a({},Z&&{visibility:"hidden",opacity:0}),onClose:function(){G&&Ie()}},f.createElement(j,{className:xo(me.container,"action-modal__root"),sx:a({height:he.height||void 0,width:he.width||void 0},he.sx)},O&&f.createElement("div",{className:me.title},ce&&f.createElement(ce,{payload:pe,param:N,onClose:Ie}),f.createElement(_,{className:me.stretch,variant:"h6",component:"h2"},O),le&&f.createElement(le,{payload:pe,param:N,onClose:Ie})),Ce(),f.createElement(j,{className:me.content},f.createElement(yf,{apiRef:F,changeSubject:H,reloadSubject:W,className:xo((o={},o[me.disabled]=!!we.current,o)),isBaselineForRoot:z,isBaseline:V,readonly:!!we.current||te,outlinePaper:U,transparentPaper:$,invalidity:function(e,t){be(null),x(e,t)},change:function(e,t){be(e),w(e,t)},handler:I,payload:pe,fields:L,dirty:Q,features:B,readTransform:ue,writeTransform:se,incomingTransform:de,outgoingTransform:fe,loadStart:function(e){"one-resolve"===e&&ke()},loadEnd:function(e,t){"one-resolve"===t&&Le(e)}})),!te&&l&&f.createElement(si,{className:me.submit,startIcon:ae&&f.createElement(ae,null),disabled:!(u||!we.current&&ge),size:"large",variant:"contained",color:"info",fullWidth:!0,onClick:function(){return t(void 0,void 0,void 0,function(){var e,r;return n(this,function(o){switch(o.label){case 0:if(we.current)return[2];e=!0,o.label=1;case 1:return o.trys.push([1,5,6,7]),ke(),G?[4,t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,Promise.race([Ne(),$n(p)])];case 1:return e.sent(),[2]}})})]:[3,4];case 2:return o.sent(),[4,v(u?{}:xe.current,pe,N)];case 3:o.sent(),o.label=4;case 4:return[3,7];case 5:if(r=o.sent(),e=!1,re)throw r;return S&&S(r),[3,7];case 6:return Le(e),[7];case 7:return[2]}})})}},ie)))},ig=function(r){var o=r.hidden,i=r.fields,a=r.waitForChangesDelay,l=r.param,c=r.features,u=r.handler,s=r.fallback,d=r.apiRef,m=r.changeSubject,p=r.reloadSubject,h=r.withLoader,v=r.withActionButton,b=void 0===v||v,E=r.withStaticAction,x=r.payload,C=void 0===x?{}:x,k=r.BeforeTitle,S=r.onChange,L=r.onClose,N=r.onSubmit,I=void 0===N?function(){return!0}:N,M=r.onLoadEnd,R=r.onLoadStart,P=r.onInvalid,A=r.readTransform,T=r.writeTransform,D=r.incomingTransform,j=r.outgoingTransform,O=r.isBaseline,F=r.isBaselineForRoot,_=r.AfterTitle,B=r.outlinePaper,H=r.transparentPaper,W=r.submitLabel,z=r.submitIcon,V=r.throwError,Y=r.dirty,U=r.readonly,q=r.fullScreen,$=r.sizeRequest,X=r.title,G=Fr(C),K=e(g(!1),2),Q=K[0],J=K[1],Z=e(g(l),2),ee=Z[0],te=Z[1];w(function(){te(l)},[l]),Xr(function(){Q||L&&L()},[Q]);var ne=no(I),re=Vr(ee),oe=y(function(e){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return[4,ne(e,G,re.current)];case 1:return t=n.sent(),J(!t),[2,t]}})})},[]),ie=y(function(){return f.createElement(og,{AfterTitle:_,open:Q,hidden:o,withLoader:h,withActionButton:b,withStaticAction:E,waitForChangesDelay:a,isBaselineForRoot:F,isBaseline:O,readonly:U,fullScreen:q,apiRef:d,changeSubject:m,reloadSubject:p,outlinePaper:B,transparentPaper:H,sizeRequest:$,submitIcon:z,fields:i,handler:u,payload:G,fallback:s,onChange:S,onInvalid:P,onLoadEnd:M,onLoadStart:R,submitLabel:W,throwError:V,onSubmit:oe,features:c,readTransform:A,writeTransform:T,incomingTransform:D,outgoingTransform:j,title:X,dirty:Y,param:ee,BeforeTitle:k})},[Q,o,U,Y,i,d,m,p,u,G,s,S,P,M,R,oe,W,V,X]),ae=y(function(e){te(e),J(!0)},[]);return{open:Q,setOpen:J,render:ie,pickData:ae}},ag=function(e){return ig(e)},lg=Tn()(function(e){return{root:{display:"flex",alignItems:"stretch",justifyContent:"stretch",background:A(e.palette.getContrastText(e.palette.background.paper),.05)},container:{flex:1,minHeight:60,maxHeight:"50vh",overflow:"hidden",overflowY:"auto"},controls:{display:"flex",alignItems:"center"},controlsWidth:{marginRight:"5px"},title:{display:"flex",alignItems:"center"},disabled:{pointerEvents:"none",userSelect:"none",opacity:.5},labelContent:{display:"flex",minHeight:"60px","& > *:nth-of-type(1)":{flex:1},padding:e.spacing(1)},filters:{padding:e.spacing(1),overflowX:"hidden",overflowY:"auto"}}}),cg=function(e){var t,n=e.className,r=e.style,o=e.filterData,i=e.filters,a=e.change,l=e.label,u=e.loading,s=e.withSearch,d=e.withToggledFilters,m=e.search,p=e.onSearchChange,v=void 0===p?function(){return null}:p,g=e.onFilterChange,b=void 0===g?function(){return null}:g,y=Vm(),w=mm(),E=w.filterLabel,x=w.readTransform,C=w.writeTransform,k=w.incomingTransform,S=w.outgoingTransform,L=w.modalSizeRequest,N=w.isBaseline,I=w.isBaselineForRoot,M=Th({value:m,onChange:v}),R=M.inputRef,P=M.inputValue,A=M.onInputChange,T=ig({AfterTitle:function(e){var t=e.onClose;return f.createElement(Ne,{size:"small",onClick:t},f.createElement(Fe,null))},readTransform:x,writeTransform:C,incomingTransform:k,outgoingTransform:S,isBaseline:N,isBaselineForRoot:I,sizeRequest:L,outlinePaper:!0,handler:o,title:E,payload:y,fields:i,onSubmit:function(e){return e&&B(e),!0},readonly:u}),D=T.render,O=T.pickData,F=lg().classes,B=function(e){b(e),a(e)},H=function(){v("")},W=h(function(){var e,t,n=Object.keys(o||{}),r=0;try{for(var i=c(n),a=i.next();!a.done;a=i.next()){var l=a.value;null!==o[l]&&(""!==o[l]&&!1!==o[l]&&r++)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return r},[o]);return f.createElement("div",{className:xo(n,F.root),style:r},f.createElement("div",{className:F.container},f.createElement(j,{className:F.labelContent},function(){var e;return s?f.createElement(xe,{label:"Search",variant:"standard",inputRef:R,value:P,onChange:A,onKeyDown:function(e){var t=e.key,n=e.currentTarget;"Enter"!==t&&"Escape"!==t||n.blur()},className:xo((e={},e[F.disabled]=u,e)),sx:{maxWidth:"max(calc(50% - 75px), 256px)"},InputProps:{readOnly:u,startAdornment:f.createElement(Le,{position:"start"},f.createElement(ot,null)),endAdornment:!!m&&f.createElement(Le,{sx:{cursor:"pointer",marginBottom:"15px"},onClick:H,position:"end"},f.createElement(Fe,null))},placeholder:l,InputLabelProps:{shrink:!0},focused:!0}):f.createElement(_,{variant:"body1",className:F.title},l)}())),f.createElement("div",{className:xo(F.controls,(t={},t[F.controlsWidth]=!d,t))},f.createElement(pt,{sx:{mr:1,zIndex:99},badgeContent:W,color:"info"},f.createElement(ye,{startIcon:f.createElement(Ft,null),variant:"contained",sx:{fontWeight:"bold",ml:1},disabled:u,onClick:O},"Filters"))),D())},ug=Tn()(function(e){return{root:{display:"flex",alignItems:"stretch",justifyContent:"stretch",background:A(e.palette.getContrastText(e.palette.background.paper),.05)},container:{flex:1,minHeight:60,maxHeight:"50vh",overflow:"hidden",overflowY:"auto"},controls:{display:"flex",alignItems:"center"},controlsWidth:{marginRight:"5px"},title:{display:"flex",alignItems:"center"},disabled:{pointerEvents:"none",userSelect:"none",opacity:.5},labelContent:{display:"flex",minHeight:"60px","& > *:nth-of-type(1)":{flex:1},padding:e.spacing(1)},filters:{padding:e.spacing(1),overflowX:"hidden",overflowY:"auto"}}}),sg=function(e){var t,n=e.className,r=e.style,o=e.filterData,i=e.filters,a=e.change,l=e.label,u=e.loading,s=e.withSearch,d=e.withToggledFilters,m=e.search,p=e.onSearchChange,v=void 0===p?function(){return null}:p,g=e.onFilterChange,b=void 0===g?function(){return null}:g,y=Vm(),w=mm(),E=w.filterLabel,x=w.readTransform,C=w.writeTransform,k=w.incomingTransform,S=w.outgoingTransform,L=w.modalSizeRequest,N=w.isBaseline,I=w.isBaselineForRoot,M=Th({value:m,onChange:v}),R=M.inputRef,P=M.inputValue,A=M.onInputChange,T=ig({AfterTitle:function(e){var t=e.onClose;return f.createElement(Ne,{size:"small",onClick:t},f.createElement(Fe,null))},sizeRequest:L,isBaseline:N,isBaselineForRoot:I,fullScreen:!0,outlinePaper:!0,handler:o,title:E,readTransform:x,writeTransform:C,incomingTransform:k,outgoingTransform:S,payload:y,fields:i,onSubmit:function(e){return e&&B(e),!0},readonly:u}),D=T.render,O=T.pickData,F=ug().classes,B=function(e){b(e),a(e)},H=function(){v("")},W=h(function(){var e,t,n=Object.keys(o||{}),r=0;try{for(var i=c(n),a=i.next();!a.done;a=i.next()){var l=a.value;null!==o[l]&&(""!==o[l]&&!1!==o[l]&&r++)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return r},[o]);return f.createElement("div",{className:xo(n,F.root),style:r},f.createElement("div",{className:F.container},f.createElement(j,{className:F.labelContent},function(){var e;return s?f.createElement(xe,{label:"Search",variant:"standard",inputRef:R,value:P,onChange:A,onKeyDown:function(e){var t=e.key,n=e.currentTarget;"Enter"!==t&&"Escape"!==t||n.blur()},className:xo((e={},e[F.disabled]=u,e)),sx:{maxWidth:"max(calc(50% - 75px), 256px)"},InputProps:{readOnly:u,startAdornment:f.createElement(Le,{position:"start"},f.createElement(ot,null)),endAdornment:!!m&&f.createElement(Le,{sx:{cursor:"pointer",marginBottom:"15px"},onClick:H,position:"end"},f.createElement(Fe,null))},placeholder:l,InputLabelProps:{shrink:!0},focused:!0}):f.createElement(_,{variant:"body1",className:F.title},l)}())),f.createElement("div",{className:xo(F.controls,(t={},t[F.controlsWidth]=!d,t))},f.createElement(pt,{sx:{mr:1,zIndex:99},badgeContent:W,color:"info"},f.createElement(ye,{startIcon:f.createElement(Ft,null),variant:"contained",sx:{fontWeight:"bold",ml:1},disabled:u,onClick:O},"Filters"))),D())},dg="action-menu",fg=Tn()({button:{minHeight:"35px !important",maxHeight:"35px !important",paddingLeft:"15px !important",paddingRight:"15px !important",order:-1,zIndex:99},fab:{order:-1,zIndex:99}}),mg=e(xr(),2),pg=mg[0],hg=mg[1],vg=function(e){var r=e.action,o=void 0===r?"add-action":r,i=e.width,a=e.label,l=e.isVisible,c=void 0===l?function(){return!0}:l,u=e.isDisabled,s=void 0===u?function(){return!1}:u,d=fg().classes,m=Vm(),p=mm(),h=ep(),v=yp().selectedRows,g=p.fallback,b=p.onAction,y=p.onLoadStart,w=p.onLoadEnd,E=no(function(e){e.stopPropagation(),b&&b(o,v,h)}),x=function(e){var t=e.disabled,n=e.onClick,r=hg(),o=mm().loading;return a&&!r?f.createElement(ye,{className:d.button,variant:"contained",disabled:o||t,size:"small",startIcon:f.createElement(Mt,{color:"inherit"}),onClick:n},a):f.createElement(Te,{className:d.fab,disabled:o||t,size:"small",color:"primary",onClick:n},f.createElement(Mt,{color:"inherit"}))},C=i<500;return f.createElement(pg,{payload:C},f.createElement(Zr,{Loader:function(){var e=hg();return a&&!e?f.createElement(ye,{className:d.button,variant:"contained",size:"small",startIcon:f.createElement(Mt,{color:"inherit"})},a):f.createElement(Te,{className:d.fab,disabled:!0,size:"small",color:"primary"},f.createElement(Mt,{color:"inherit"}))},fallback:g,onLoadStart:function(){return y&&y(dg)},onLoadEnd:function(e){return w&&w(e,dg)},payload:v,deps:[m],throwError:!0},function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:return[4,c(v,m)];case 1:return e=n.sent(),[4,s(v,m)];case 2:return t=n.sent(),e?[2,f.createElement(x,{disabled:t,onClick:E})]:[2,null]}})})}))},gg="action-menu",bg=Tn()({button:{minHeight:"35px !important",maxHeight:"35px !important",paddingLeft:"15px !important",paddingRight:"15px !important"},fab:{zIndex:99,minHeight:"40px !important",maxHeight:"40px !important"}}),yg=e(xr(),2),wg=yg[0],Eg=yg[1],xg=function(e){var r=e.action,o=void 0===r?"fab-action":r,i=e.label,a=e.width,l=e.icon,c=void 0===l?Tt:l,u=e.isVisible,s=void 0===u?function(){return!0}:u,d=e.isDisabled,m=void 0===d?function(){return!1}:d,p=bg().classes,h=mm(),v=Vm(),g=ep(),b=yp().selectedRows,y=h.fallback,w=h.onAction,E=h.onLoadStart,x=h.onLoadEnd,C=no(function(e){e.stopPropagation(),w&&w(o,b,g)}),k=function(e){var t=e.disabled,n=e.onClick,r=Eg(),o=mm().loading;return i&&!r?f.createElement(ye,{className:p.button,variant:"contained",disabled:o||t,size:"small",startIcon:f.createElement(c,{color:"inherit"}),onClick:n},i):f.createElement(Te,{className:p.fab,disabled:o||t,size:"small",color:"primary",onClick:n},f.createElement(c,{color:"inherit"}))},S=a<500;return f.createElement(wg,{payload:S},f.createElement(Zr,{Loader:function(){var e=Eg();return i&&!e?f.createElement(ye,{className:p.button,variant:"contained",size:"small",startIcon:f.createElement(c,{color:"inherit"})},i):f.createElement(Te,{className:p.fab,disabled:!0,size:"small",color:"primary"},f.createElement(c,{color:"inherit"}))},fallback:y,onLoadStart:function(){return E&&E(gg)},onLoadEnd:function(e){return x&&x(e,gg)},payload:b,deps:[v],throwError:!0},function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:return[4,s(b,v)];case 1:return e=n.sent(),[4,m(b,v)];case 2:return t=n.sent(),e?[2,f.createElement(k,{disabled:t,onClick:C})]:[2,null]}})})}))},Cg="action-menu",kg=function(t){var n=t.options,o=void 0===n?[]:n,i=t.deps,c=void 0===i?[]:i,u=yp().selectedRows,s=pp(),d=Ep(),m=ep(),p=Vm(),h=mm(),v=h.onAction,g=h.fallback,b=h.onLoadStart,y=h.onLoadEnd,w=h.loading,E=h.actionSubject,x=no(function(e){"update-now"===e?m():"resort-action"===e?s():"drop-filters"===e&&d(),v&&v(e,u,m)});Gf(function(){return E&&E.subscribe(x)});return E?null:f.createElement(Ca,{options:o.map(function(e){var t=e.action,n=e.isDisabled,r=void 0===n?function(){return!1}:n,o=e.isVisible,i=void 0===o?function(){return!0}:o,c=l(e,["action","isDisabled","isVisible"]);return a(a({action:t},c),"update-now"===t?{icon:c.icon||Pt,isDisabled:function(){return r(u,p)},isVisible:function(){return i(u,p)},label:c.label||"Refresh manually"}:"add-action"===t?{icon:c.icon||Mt,isDisabled:function(){return r(u,p)},isVisible:function(){return i(u,p)},label:c.label||"Create new row"}:"resort-action"===t?{icon:c.icon||At,isDisabled:function(){return r(u,p)},isVisible:function(){return i(u,p)},label:c.label||"Change sort order"}:"drop-filters"===t?{icon:c.icon||Rt,isDisabled:function(){return r(u,p)},isVisible:function(){return i(u,p)},label:c.label||"Drop filters"}:{isDisabled:function(){return r(u,p)},isVisible:function(){return i(u,p)}})}),onAction:x,fallback:g,payload:u,deps:r(r([],e(c),!1),[p],!1),onLoadStart:function(){return b&&b(Cg)},onLoadEnd:function(e){return y&&y(e,Cg)},disabled:w})},Sg=Tn()(function(e){return{root:{display:"flex",alignItems:"stretch",justifyContent:"stretch",background:A(e.palette.getContrastText(e.palette.background.paper),.05)},container:{flex:1,minHeight:"45px",maxHeight:"50vh",overflow:"hidden",overflowY:"auto"},controls:{display:"flex",alignItems:"center",gap:e.spacing(1)},controlsWidth:{marginRight:"5px"},title:{display:"flex",alignItems:"center"},disabled:{pointerEvents:"none",userSelect:"none",opacity:.5},labelContent:{display:"flex",alignItems:"flex-end",minHeight:"45px","& > *:nth-of-type(1)":{flex:1},padding:e.spacing(1)},filters:{padding:e.spacing(1),overflowX:"hidden",overflowY:"auto"}}}),Lg=function(e){var t,n=e.className,r=e.style,o=e.filterData,i=e.filters,u=e.change,s=e.label,d=e.loading,m=e.withSearch,p=e.withToggledFilters,v=e.search,g=e.height,b=e.width,y=e.onSearchChange,w=void 0===y?function(){return null}:y,E=e.onFilterChange,x=void 0===E?function(){return null}:E,C=Vm(),S=yp().selectedRows,L=Th({value:v,onChange:w}),N=L.inputRef,I=L.inputValue,M=L.onInputChange,R=mm(),P=R.filterLabel,A=R.readTransform,T=R.writeTransform,D=R.incomingTransform,O=R.outgoingTransform,F=R.modalSizeRequest,B=R.isBaseline,H=R.isBaselineForRoot,W=R.actions,z=void 0===W?[]:W,V=ig({AfterTitle:function(e){var t=e.onClose;return f.createElement(Ne,{size:"small",onClick:t},f.createElement(Fe,null))},isBaseline:B,isBaselineForRoot:H,sizeRequest:F,fullScreen:!0,outlinePaper:!0,handler:o,title:P,readTransform:A,writeTransform:T,incomingTransform:D,outgoingTransform:O,payload:C,fields:i,onSubmit:function(e){return e&&G(e),!0},readonly:d}),Y=V.render,U=V.pickData,q=Sg(),$=q.classes,X=q.cx,G=function(e){x(e),u(e)},K=function(){w("")},Q=h(function(){var e,t,n=Object.keys(o||{}),r=0;try{for(var i=c(n),a=i.next();!a.done;a=i.next()){var l=a.value;null!==o[l]&&(""!==o[l]&&!1!==o[l]&&r++)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return r},[o]),J=b<500;return f.createElement("div",{className:X(n,$.root),style:r},f.createElement("div",{className:$.container},f.createElement(j,{className:$.labelContent},function(){var e;return m?f.createElement(xe,{inputRef:N,value:I,onChange:M,variant:"standard",onKeyDown:function(e){var t=e.key,n=e.currentTarget;"Enter"!==t&&"Escape"!==t||n.blur()},className:X((e={},e[$.disabled]=d,e)),sx:{maxWidth:"max(calc(50% - 75px), 256px)"},InputProps:{readOnly:d,startAdornment:f.createElement(Le,{position:"start"},f.createElement(ot,null)),endAdornment:!!v&&f.createElement(Le,{sx:{cursor:"pointer"},onClick:K,position:"end"},f.createElement(Fe,null))},placeholder:s||"Search",InputLabelProps:{shrink:!0},focused:!0}):f.createElement(_,{variant:"body1",className:$.title},s)}())),f.createElement("div",{className:X($.controls,(t={},t[$.controlsWidth]=!p,t))},f.createElement(pt,{sx:{zIndex:99},badgeContent:Q,color:"info"},J?f.createElement(Te,{sx:{minHeight:"40px",maxHeight:"40px"},disabled:d,size:"small",color:"primary",onClick:U},f.createElement(Ft,{color:"inherit"})):f.createElement(ye,{startIcon:f.createElement(Ft,null),variant:"contained",size:"small",sx:{minHeight:"35px",maxHeight:"35px"},disabled:d,onClick:U},"Filters")),z.map(function(e,t){return f.createElement(k,{key:t},function(e){var t=e.type,n=e.options,r=void 0===n?[]:n,o=e.isDisabled,i=e.isVisible,c=e.label,u=e.icon,s=e.action;if(t===Lh.Add)return f.createElement(vg,{label:c,action:s,isDisabled:o,isVisible:i,height:g,width:b});if(t===Lh.Fab)return f.createElement(xg,{label:c,action:s,icon:u,isDisabled:o,isVisible:i,height:g,width:b});if(t===Lh.Menu){var d=r.map(function(e){var t=e.isDisabled,n=void 0===t?function(){return!1}:t,r=e.isVisible,o=void 0===r?function(){return!0}:r,i=l(e,["isDisabled","isVisible"]);return a(a({},i),{isDisabled:function(){return n(S,C)},isVisible:function(){return o(S,C)}})});return f.createElement(kg,{options:d,deps:[C]})}throw new Error("List Actions unknown action type")}(e))})),Y())},Ng=Tn()(function(e){return{root:{display:"flex",alignItems:"stretch",justifyContent:"stretch",background:A(e.palette.getContrastText(e.palette.background.paper),.05)},container:{flex:1,minHeight:60,maxHeight:"50vh",overflow:"hidden",overflowY:"auto"},controls:{display:"flex",alignItems:"center",gap:e.spacing(1)},disabled:{pointerEvents:"none",userSelect:"none",opacity:.5},labelContent:{display:"flex",minHeight:"60px","& > *:nth-of-type(1)":{flex:1},padding:e.spacing(1)}}}),Ig=function(e){var t,n=e.className,r=e.style,o=e.label,i=e.loading,c=e.search,u=e.height,s=e.width,d=e.onSearchChange,m=void 0===d?function(){return null}:d,p=Vm(),h=Ng().classes,v=yp().selectedRows,g=Th({value:c,onChange:m}),b=g.inputRef,y=g.inputValue,w=g.onInputChange,E=mm().actions,x=void 0===E?[]:E;return f.createElement("div",{className:xo(n,h.root),style:r},f.createElement("div",{className:h.container},f.createElement(j,{className:h.labelContent},f.createElement(xe,{label:"Search",variant:"standard",inputRef:b,value:y,onChange:w,sx:{maxWidth:"max(calc(50% - 75px), 256px)"},onKeyDown:function(e){var t=e.key,n=e.currentTarget;"Enter"!==t&&"Escape"!==t||n.blur()},className:xo((t={},t[h.disabled]=i,t)),InputProps:{readOnly:i,startAdornment:f.createElement(Le,{position:"start"},f.createElement(ot,null)),endAdornment:!!c&&f.createElement(Le,{sx:{cursor:"pointer"},onClick:function(){m("")},position:"end"},f.createElement(Fe,null))},placeholder:o,InputLabelProps:{shrink:!0},focused:!0}))),f.createElement("div",{className:h.controls},x.map(function(e,t){return f.createElement(k,{key:t},function(e){var t=e.type,n=e.options,r=void 0===n?[]:n,o=e.isDisabled,i=e.isVisible,c=e.label,d=e.icon,m=e.action;if(t===Lh.Add)return f.createElement(vg,{label:c,action:m,isDisabled:o,isVisible:i,height:u,width:s});if(t===Lh.Fab)return f.createElement(xg,{label:c,action:m,icon:d,isDisabled:o,isVisible:i,height:u,width:s});if(t===Lh.Menu){var h=r.map(function(e){var t=e.isDisabled,n=void 0===t?function(){return!1}:t,r=e.isVisible,o=void 0===r?function(){return!0}:r,i=l(e,["isDisabled","isVisible"]);return a(a({},i),{isDisabled:function(){return n(v,p)},isVisible:function(){return o(v,p)}})});return f.createElement(kg,{options:h,deps:[p]})}throw new Error("List Actions unknown action type")}(e))})))},Mg=function(e){return new function(){this.getValue=function(){try{return JSON.parse(localStorage.getItem(e)||"null")}catch(e){return null}},this.setValue=function(t){try{localStorage.setItem(e,JSON.stringify(t,null,2))}catch(e){e instanceof DOMException&&(console.log("react-declarative createLsManager exceeded the quota"),localStorage.clear(),op())}},this.clear=function(){localStorage.removeItem(e)}}},Rg=Tn()(function(e,t,n){var r;return{inactive:{opacity:.5},container:{boxSizing:"border-box",width:"min(100vw - 100px, 400px)",height:340},list:(r={boxSizing:"border-box",width:"100%"},r["& > .".concat(n.item,":nth-of-type(2n)")]={background:$(e.palette.getContrastText(e.palette.background.paper),.04)},r),item:{"& .MuiListItemText-root > .MuiTypography-root":{width:"100%",overflow:"hidden",textOverflow:"ellipsis"}},item_right_side:{display:"flex",alignItems:"center",gap:"5px"},dialog_wrapper:{width:"100%",maxwidth:"400px",boxSizing:"border-box"},dialog:{"&:first-of-type":{padding:0},width:"100%",boxSizing:"border-box"}}}),Pg=function(t){var n=t.columns,o=t.storageKey,i=Rg().classes,l=e(g(!1),2),c=l[0],u=l[1],s=h(function(){var e=Mg("".concat(o,"_v1")),t=e.getValue(),r=n.filter(function(e){return e.field}).filter(function(e){return e.type!==Qm.Action}).length;return t&&t.length!==r&&e.clear(),e},[]),d=e(g(function(){var e=s.getValue();return e||(e=n.filter(function(e){return e.field}).filter(function(e){return e.type!==Qm.Action}).map(function(e){return{field:e.field,show:!0,displayName:e.fullName||e.headerName||String(e.field)}})),e}),2),m=d[0],p=d[1],v=h(function(){var e=m.filter(function(e){return e.show}).map(function(e){var t=e.field;return n.find(function(e){return e.field===t})}).filter(function(e){return e}),t=n.find(function(e){return e.type===Qm.Action});return t&&e.push(t),e},[]),b=function(){s.setValue(m),op()};return{open:c,render:function(){return f.createElement(st,{open:c,className:i.dialog_wrapper},f.createElement(dt,{className:i.dialog},f.createElement(j,{className:i.container},f.createElement(Ie,{className:i.list,disablePadding:!0},m.map(function(t,n){return f.createElement(tt,{key:n,className:i.item},f.createElement(Oe,{primary:t.displayName}),f.createElement(j,{className:i.item_right_side},f.createElement(Ne,{onClick:function(){return n=t.field,void(0!==(o=m.findIndex(function(e){return e.field===n}))&&p(function(t){var n=t[o];return t[o]=t[o-1],t[o-1]=n,r([],e(t),!1)}));var n,o},disabled:0==n||!t.show},f.createElement(St,null)),f.createElement(Ne,{onClick:function(){return n=t.field,void((o=m.findIndex(function(e){return e.field===n}))!==m.length&&p(function(t){var n=t[o];return t[o]=t[o+1],t[o+1]=n,r([],e(t),!1)}));var n,o},disabled:n==m.length-1||!t.show},f.createElement(Lt,null)),f.createElement(Ze,{checked:t.show,onClick:function(){return e=t.field,p(function(t){return t.map(function(t){return t.field===e?a(a({},t),{show:!t.show}):t})});var e}})))})))),f.createElement(ft,null,f.createElement(ye,{color:"primary",onClick:b},"OK"),f.createElement(ye,{color:"primary",onClick:function(){return u(!1)}},"Отмена")))},columns:v,pickColumns:function(){return u(!0)}}},Ag={FilterListSlot:Lg,ActionListSlot:function(){return f.createElement(f.Fragment,null)},SearchSlot:Ig},Tg=Object.freeze({__proto__:null,denceFilterRule:Ag}),Dg=function(e,t){return function(){return f.createElement(j,{sx:a({display:"flex",flexDirection:"column",height:400,width:"100%",alignItems:"center",justifyContent:"center",fontSize:18,color:"text.secondary"},t)},e)}},jg=Dg("An error acquired",{color:Wt[500],fontWeight:500,fontSize:24}),Og=Dg("Loading data"),Fg=Tn()({slideDown:{animation:"".concat(D(Ch||(Ch=s(["\n 0% {\n opacity: 0;\n transform: translateY(-10px);\n }\n 100% {\n opacity: 1;\n transform: translateY(0);\n }\n "],["\n 0% {\n opacity: 0;\n transform: translateY(-10px);\n }\n 100% {\n opacity: 1;\n transform: translateY(0);\n }\n "])))," 250ms ease-out")},fadeIn:{animation:"".concat(D(kh||(kh=s(["\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n "],["\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n "])))," 250ms ease-out")},scale:{animation:"".concat(D(Sh||(Sh=s(["\n 0% {\n transform: scale(0.4);\n }\n 100% {\n transform: scale(1);\n }\n "],["\n 0% {\n transform: scale(0.4);\n }\n 100% {\n transform: scale(1);\n }\n "])))," 250ms ease-out")}}),_g=x(function(e,t){var n,r=e.children,o=e.className,i=e.animation,c=void 0===i?"slideDown":i,u=e.appear,s=void 0===u||u,d=l(e,["children","className","animation","appear"]),m=Fg().classes,p={slideDown:m.slideDown,fadeIn:m.fadeIn,scale:m.scale};return f.createElement(j,a({ref:t,className:xo(o,(n={},n[p[c]]=s,n))},d),r)}),Bg=Tn()({root:{width:"100%"}}),Hg=function(o){var i=o.animation,c=o.className,u=o.style,s=o.Loader,d=void 0===s?Og:s,m=o.Error,p=void 0===m?jg:m,h=o.onLoadEnd,v=o.onLoadStart,b=o.children,y=o.state,w=o.payload,E=l(o,["animation","className","style","Loader","Error","onLoadEnd","onLoadStart","children","state","payload"]),x=Bg().classes,C=e(g(!1),2),k=C[0],S=C[1],L=function(e){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return"function"!=typeof y?[3,5]:(t=y(e),Array.isArray(t)?[4,Promise.all(t)]:[3,2]);case 1:return[2,n.sent()];case 2:return[4,t];case 3:return[2,[n.sent()]];case 4:return[3,6];case 5:return[2,[]];case 6:return[2]}})})};return f.createElement(_g,{className:xo(c,x.root),style:u,animation:i,appear:k},f.createElement(Zr,a({},E,{Loader:d,Error:p,onLoadStart:function(){v&&v(),S(!1)},onLoadEnd:function(e){h&&h(e),S(!0)},payload:w}),function(o){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return[4,L(o)];case 1:return t=n.sent(),[2,b.apply(void 0,r([],e(t),!1))]}})})}))},Wg=function(){return f.createElement("p",null,"Forbidden")},zg=function(){return f.createElement("p",null,"Not found")},Vg=function(){return f.createElement(je,{sx:{zIndex:function(e){return e.zIndex.drawer+1}},open:!0},f.createElement(O,{color:"primary"}))},Yg=function(){return f.createElement("p",null,"500")},Ug=function(e){return t(void 0,void 0,void 0,function(){var t,r;return n(this,function(n){switch(n.label){case 0:return t=e.guard,(r=(void 0===t?function(){return!0}:t)())instanceof Promise?[4,r]:[3,2];case 1:return[2,n.sent()];case 2:return[2,r]}})})},qg=Of(),$g=function(e){var t=e.element,n=void 0===t?Xg:t,r=e.key,o=e.params;return f.createElement(n,a({key:r},o))},Xg=function(){return f.createElement(f.Fragment,null)},Gg=new lr,Kg=function(o){var i=o.className,l=o.style,u=o.Loader,s=void 0===u?Vg:u,d=o.Forbidden,m=void 0===d?Wg:d,p=o.NotFound,v=void 0===p?zg:p,y=o.Error,E=void 0===y?Yg:y,x=o.animation,C=o.history,k=void 0===C?qg:C,S=o.children,L=void 0===S?$g:S,N=o.fallback,I=o.items,M=o.onLoadStart,R=o.onLoadEnd,P=o.onInit,A=void 0===P?function(){}:P,T=o.onDispose,D=void 0===T?function(){}:T,j=o.throwError,O=void 0!==j&&j,F=h(function(){return r([],e(I),!1).sort(function(e,t){var n,r,o,i,a=e.path,l=void 0===a?"":a,c=t.path,u=void 0===c?"":c,s=(null===(n=l.match(/\:/g))||void 0===n?void 0:n.length)||0,d=(null===(r=u.match(/\:/g))||void 0===r?void 0:r.length)||0,f=(null===(o=l.match(/\\/g))||void 0===o?void 0:o.length)||0,m=(null===(i=u.match(/\\/g))||void 0===i?void 0:i.length)||0,p=Math.max(f-s,0);return Math.max(m-d,0)-p})},[]),_=e(g(!1),2),B=_[0],H=_[1],W=b(null),z=e(g(a({},k.location)),2),V=z[0],Y=z[1];w(function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:e=!0,M&&M(),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,A()];case 2:return n.sent(),[3,5];case 3:if(t=n.sent(),e=!1,O)throw t;return N&&N(t),[3,5];case 4:return R&&R(e),H(!0),[7];case 5:return[2]}})}),function(){t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:e=!0,M&&M(),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,D()];case 2:return n.sent(),[3,5];case 3:if(t=n.sent(),e=!1,O)throw t;return N&&N(t),[3,5];case 4:return R&&R(e),[7];case 5:return[2]}})})}},[]),w(function(){return k.listen(function(e){if("REPLACE"!==e.action&&e.location.pathname!==V.pathname){var t=a({},e.location);Y(t)}})},[k,V]);var U=h(function(){return function(){return t(void 0,void 0,void 0,function(){var e,r,o,i,l,u,s,d,f,p;return n(this,function(h){switch(h.label){case 0:return e=V.pathname,r=void 0===e?"/":e,W.current?[4,W.current()]:[3,2];case 1:h.sent(),h.label=2;case 2:o=function(e){var o,i,l,c,u,s,d,f,p,h,v,g,b,y,w,E;return n(this,function(x){switch(x.label){case 0:return o=e.element,i=void 0===o?Xg:o,l=e.redirect,c=e.prefetch,u=e.unload,s=e.path,d={},p=_t(s,f=[]),h=p.test(r),v=function(){var e=p.exec(r);e&&f.forEach(function(t,n){d[t.name]=e[n+1]})},g=function(){u&&(W.current=function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,Promise.resolve(u(d))];case 1:return e.sent(),W.current=null,[2]}})})})},h?[4,Ug(e)]:[3,5];case 1:return x.sent()?(v(),c?(y=(b=Object).assign,w=[d],[4,c(d)]):[3,3]):[3,4];case 2:y.apply(b,w.concat([x.sent()])),x.label=3;case 3:return g(),"string"==typeof l?(Y(function(e){return a(a({},e),{pathname:l})}),[2,{value:{element:Xg,key:Kr(),path:s}}]):"function"==typeof l&&null!==(E=l(d)||null)?(Y(function(e){return a(a({},e),{pathname:E})}),[2,{value:{element:Xg,key:Kr(),path:s}}]):[2,{value:{element:i,key:Kr(),params:d,path:s}}];case 4:return[2,{value:{element:m,key:Kr(),path:s}}];case 5:return[2]}})},h.label=3;case 3:h.trys.push([3,8,9,10]),i=c(F),l=i.next(),h.label=4;case 4:return l.done?[3,7]:(u=l.value,[5,o(u)]);case 5:if("object"==typeof(s=h.sent()))return[2,s.value];h.label=6;case 6:return l=i.next(),[3,4];case 7:return[3,10];case 8:return d=h.sent(),f={error:d},[3,10];case 9:try{l&&!l.done&&(p=i.return)&&p.call(i)}finally{if(f)throw f.error}return[7];case 10:return[2,{element:v,key:Kr(),path:r}]}})})}},[V]);return B?f.createElement(Hg,{className:i,style:l,state:U,Loader:s,Error:E,animation:x,payload:V,fallback:N,onLoadStart:M,onLoadEnd:R,throwError:O},function(e){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,$n(0)];case 1:return t.sent(),Gg.next(e),[2,L(e)]}})})}):f.createElement(s,null)};Kg.listen=function(e){return Gg.subscribe(e)},Kg.waitForNavigate=function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,Gg.toPromise()];case 1:return[2,e.sent()]}})})};var Qg,Jg,Zg,eb,tb,nb,rb=Tn()({root:{display:"flex",alignItems:"center",justifyContent:"center"}}),ob=function(e){var t=e.className,n=l(e,["className"]),r=rb().classes;return f.createElement(j,a({className:xo(t,r.root)},n))},ib=Tn()({root:{display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden",width:"100%"},container:{position:"relative",paddingBottom:"100%",width:"100%",height:0},content:{position:"absolute",height:"100%",width:"100%",display:"flex",alignItems:"stretch",justifyContent:"stretch",top:0,left:0,right:0,bottom:0,"& > *:nth-of-type(1)":{flex:1}}}),ab=x(function(e,t){var n=e.className,r=e.children,o=l(e,["className","children"]),i=ib().classes;return f.createElement(j,a({ref:t,className:xo(n,i.root)},o),f.createElement("div",{className:i.container},f.createElement("div",{className:i.content},r)))}),lb=function(t){var n=t,r=function(t,o){void 0===o&&(o=function(e){return n=e}),"object"==typeof t&&null!==t&&(Array.isArray(t)?(t.forEach(function(e,n){return r(e,function(e){return t[n]=e})}),o(a({},t))):Object.entries(t).forEach(function(n){var o=e(n,2),i=o[0],a=o[1];return r(a,function(e){return t[i]=e})}))};return r(t),n},cb=/^\d+$/,ub=function(t,n){void 0===n&&(n=!1);var r=t,o=function(t,i){if(void 0===i&&(i=function(e){return r=e}),"object"==typeof t&&null!==t)if(function(e){return Object.keys(e).find(function(e){return cb.test(e)})}(t)||n){var a=Object.values(t);a.forEach(function(e,t){return o(e,function(e){return a[t]=e})}),i(a)}else Object.entries(t).forEach(function(n){var r=e(n,2),i=r[0],a=r[1];return o(a,function(e){return t[i]=e})})};return o(t),r},sb=function(t){var n=void 0===t?{}:t,r=n.readOnly,o=n.onFocus,i=n.onTouchStart,a=n.onContextMenu,l=e(g(!0),2),c=l[0],u=l[1];return{readOnly:r||c,onFocus:y(function(e){u(!1),o&&o(e)},[o]),onTouchStart:y(function(e){u(!1),i&&i(e)},[o]),onContextMenu:y(function(e){e.preventDefault(),e.stopPropagation(),a&&a(e)},[o])}},db=(Qg=e(xr(),2))[0],fb=Qg[1],mb=(Jg=e(xr(),2))[0],pb=Jg[1],hb=(Zg=e(xr(),2))[0],vb=Zg[1],gb=(eb=e(xr(),2))[0],bb=eb[1],yb=Tn()(function(e){return{selected:{color:"".concat(e.palette.primary.main," !important"),"& .MuiListItemIcon-root":{color:"".concat(e.palette.primary.main," !important")}},disabled:{pointerEvents:"none",opacity:.5},bold:{fontWeight:"bold"},root:{display:"flex",width:"100%",flex:1,"& .MuiListItemIcon-root":{maxWidth:"36px !important",minWidth:"36px !important"}},navLink:{color:e.palette.text.primary,"& .MuiListItemIcon-root":{color:e.palette.text.primary}}}}),wb=function(e){var t,n=e.option,r=e.style,o=e.icon,i=e.selected,a=e.className,l=e.onClick,c=e.currentPadding,u=yb().classes,s=xo(u.navLink,((t={})[u.selected]=n.name&&n.name===i,t[u.disabled]=n.disabled,t[u.bold]=n.bold,t)),d=o||$t;return f.createElement(qt,{className:xo(u.root,s,a),style:r},f.createElement(j,{style:{paddingLeft:c}}),f.createElement(tt,{onClick:function(){l(n.name||"unknown")}},f.createElement(F,{style:{maxWidth:24}},f.createElement(d,null)),f.createElement(Oe,{primary:n.label})))},Eb=function(t){var n=t.paddingLeft,r=void 0===n?-12:n,o=t.selected,i=t.options,a=t.onClick,l=function(t){var n=t.item,r=t.currentPadding,i=bb(),l=e(g(n.lifted||!1),2),c=l[0],u=l[1];w(function(){u(!!i||(n.lifted||!1))},[i]);var s=c?function(){return f.createElement(it,null)}:function(){return f.createElement(jt,null)};return f.createElement(f.Fragment,null,f.createElement(wb,{key:n.name,option:n,selected:o,onClick:function(){u(function(e){return!e})},icon:n.icon||s,currentPadding:r}),c&&f.createElement(Eb,{options:n.options,selected:o,paddingLeft:r,onClick:a}))},c=i.map(function(e,t){var n=r+12;return e.options&&e.options.length?f.createElement(l,{key:t,item:e,currentPadding:n}):f.createElement(wb,{key:t,option:e,icon:e.icon,selected:o,onClick:a,currentPadding:n})});return-12===r?f.createElement(Ie,{disablePadding:!0},c):f.createElement(f.Fragment,null,c)},xb=Tn()(function(e){return{root:{display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column",minHeight:"100vh",maxHeight:"100vh",minWidth:"100vw",maxWidth:"100vw"},container:{flex:1},title:{flexGrow:1},appBarSolidPaper:{background:"".concat(e.palette.background.paper," !important"),color:"".concat(e.palette.getContrastText(e.palette.background.paper)," !important")},drawer:{width:256,"& > .MuiPaper-root":{width:256,overflowX:"hidden"}},loaderBar:{marginTop:-4},offsetRegular:{minHeight:64},offsetDense:{minHeight:48},searchBox:{display:"inline-flex",margin:5,"& > *":{flex:1}},beforeSearch:{width:"calc(100% - 10px)",margin:"5px",marginBottom:"0px",display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *":{flex:1}},afterSearch:{width:"calc(100% - 10px)",margin:"5px",marginTop:"0px",display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *":{flex:1}}}}),Cb=function(t){for(var n,r=[],o=function(){var o=e(t),i=o[0],a=o.slice(1);null===(n=i.options)||void 0===n||n.forEach(function(e){return a.push(e)}),r.push(i),t=a};t.length;)o();return r},kb=function(e,t){var n;return e.options=null===(n=e.options)||void 0===n?void 0:n.filter(function(e){var n;return(null===(n=e.options)||void 0===n?void 0:n.length)&&!1!==e.visible?(kb(e,t),Cb(e.options).some(function(e){return t.has(e)})):!!t.has(e)})},Sb=function(t){var n,r,o=t.children,i=t.className,c=t.style,u=t.selected,s=t.title,d=void 0===s?"Scaffold":s,m=t.options,p=void 0===m?[]:m,v=t.dense,b=void 0!==v&&v,y=t.colored,w=void 0===y||y,E=t.actions,x=t.payload,C=t.roles,k=t.onOptionClick,S=t.onAction,L=void 0===S?function(){return null}:S,N=t.BeforeSearch,I=t.AfterSearch,M=t.AfterMenuContent,R=t.BeforeMenuContent,P=sb(),A=fb(),T=pb(),D=vb(),O=e(g(!1),2),F=O[0],B=O[1],H=xb().classes,W=e(g(""),2),z=W[0],V=W[1],Y=h(function(){var e,t=new Set,n=(e=ub(Hn(lb(p))),Array.isArray(e)?e:[]),r=z.toLowerCase();(function(e,t){var n=t.keyword,r=t.currentRoles;return e.filter(function(e){return e.label.toLowerCase().includes(n)}).filter(function(e){var t=e.roles;return!r||(void 0===t?[]:t).some(function(e){return r.includes(e)})}).filter(function(e){var t=e.visible;return void 0===t||t})})(Cb(n),{keyword:r,currentRoles:C}).forEach(function(e){return t.add(e)});var o={options:n};return kb(o,t),o.options},[z,C]),U=no(L);return A?f.createElement(f.Fragment,null,o):f.createElement(gb,{payload:!!z},f.createElement(j,{className:xo(i,H.root),style:c},f.createElement(Vt,null),f.createElement(Yt,{className:H.drawer,open:F,onClose:function(){return B(!1)}},N&&f.createElement(j,{className:H.beforeSearch},f.createElement(N,null)),f.createElement(j,{className:H.searchBox},f.createElement(xe,a({variant:"standard",onChange:function(e){var t=e.target;return V(t.value.toString())},value:z,placeholder:"Search",InputProps:{autoComplete:"off",endAdornment:f.createElement(Le,{position:"end"},f.createElement("div",{style:{marginRight:-10}},f.createElement(Ne,{onClick:function(){return V("")}},z?f.createElement(Fe,null):f.createElement(ot,null))))},name:"search",type:"text"},P))),I&&f.createElement(j,{className:H.afterSearch},f.createElement(I,null)),f.createElement(Eb,{selected:u,onClick:function(e){B(!1),k&&k(e)},options:Y})),f.createElement(zt,{className:xo((n={},n[H.appBarSolidPaper]=!w,n)),position:"fixed"},f.createElement($e,{disableGutters:!0,variant:b?"dense":"regular"},f.createElement(Ne,{color:"inherit",onClick:function(){return B(!F)}},f.createElement(Ut,null)),f.createElement(_,{variant:"h6",className:H.title},d),!!(null==E?void 0:E.length)&&f.createElement(Ca,{transparent:!0,sx:{color:"inherit"},payload:x,options:E.map(function(e){var t=e.isVisible,n=void 0===t?function(){return!0}:t,r=e.isDisabled,o=void 0===r?function(){return!1}:r,i=l(e,["isVisible","isDisabled"]);return a(a({},i),{isVisible:function(){return n(x)},isDisabled:function(){return o(x)}})}),onAction:U,AfterContent:M,BeforeContent:R})),T&&f.createElement(j,{className:H.loaderBar},f.createElement(De,{variant:-1===D?"indeterminate":"determinate",value:-1===D?void 0:D,color:"primary"}))),f.createElement("div",{className:xo((r={},r[H.offsetRegular]=!b,r[H.offsetDense]=b,r))}),f.createElement(rm,{className:H.container},f.createElement(j,{p:1},o))))},Lb=Tn()(function(e){return{root:{position:"fixed",top:0,left:0,right:0,bottom:0,height:"100vh",width:"100vw",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999,background:e.palette.background.paper}}}),Nb=function(){var e=Lb().classes;return f.createElement(j,{className:e.root},f.createElement(O,null))},Ib=function(t){void 0===t&&(t=[]);var n=[],o=function(t){return void 0===t&&(t=[]),t.forEach(function(t){var i=t.options||[];o(r([],e(i),!1)),n.push(t)})};return o(t),n},Mb=function(e){var r=e.roles,o=e.payload,i=e.throwError,c=e.fallback,u=e.options,s=e.loadingLine,d=void 0!==s&&s,m=e.loading,p=void 0===m?-1:m,v=e.Loader,g=void 0===v?Nb:v,b=e.withPassthrough,y=void 0!==b&&b,w=e.onInit,E=void 0===w?function(){}:w,x=l(e,["roles","payload","throwError","fallback","options","loadingLine","loading","Loader","withPassthrough","onInit"]),C=h(function(){return function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return"function"!=typeof r?[3,2]:[4,r(o)];case 1:return[2,e.sent()];case 2:return[2,r]}})})}},[r,o]),k=h(function(){return function(){return t(void 0,void 0,void 0,function(){var e;return n(this,function(r){switch(r.label){case 0:return e=ub(Hn(lb(u))),[4,Promise.all(Ib(e).map(function(e){return t(void 0,void 0,void 0,function(){var t,r,i,a,l,c,u,s,d,f,m,p;return n(this,function(n){switch(n.label){case 0:return t=e.disabled,r=void 0===t?e.isDisabled:t,i=e.visible,a=void 0===i?e.isVisible:i,l=e.bold,c=void 0===l?e.isBold:l,u=e.roles,s=void 0===u?e.getRoles:u,"function"!=typeof c?[3,2]:(d=e,[4,c(o)]);case 1:d.bold=n.sent(),n.label=2;case 2:return"function"!=typeof a?[3,4]:(f=e,[4,a(o)]);case 3:f.visible=n.sent(),n.label=4;case 4:return"function"!=typeof r?[3,6]:(m=e,[4,r(o)]);case 5:m.disabled=n.sent(),n.label=6;case 6:return"function"!=typeof s?[3,8]:(p=e,[4,s(o)]);case 7:p.roles=n.sent(),n.label=8;case 8:return[2]}})})}))];case 1:return r.sent(),[2,e]}})})}},[u,o]);return f.createElement(hb,{payload:p},f.createElement(mb,{payload:d},f.createElement(db,{payload:y},f.createElement(Zr,{throwError:i,fallback:c,payload:o,Loader:g},function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:return[4,E()];case 1:return n.sent(),[4,C()];case 2:return e=n.sent(),[4,k()];case 3:return t=n.sent(),[2,f.createElement(Sb,a({},x,{roles:e,options:t,payload:o}))]}})})}))))},Rb=function(e){var t=e.children,n=re(),r=h(function(){var e=R(n);return e.components=a(a({},e.components),{MuiTabs:{styleOverrides:{root:{marginLeft:e.spacing(1)},indicator:{height:3,background:"dark"===e.palette.mode?e.palette.primary.main:e.palette.background.default}}}}),e},[n]);return f.createElement(P,{theme:r},t)},Pb=p(null),Ab=function(e){var t=e.value,n=e.children;return f.createElement(Pb.Provider,{value:t},n)},Tb=function(){return v(Pb)},Db=function(){return h(function(){return{isAppleMobile:/iPad|iPhone|iPod/.test(window.navigator.userAgent)}},[])},jb=function(t){var n=e(t.split("_")),o=n[0],i=n.slice(1);return r(["".concat(o.charAt(0).toUpperCase()).concat(o.slice(1))],e(i),!1).join(" ")},Ob=(tb=e(vl(),2))[0],Fb=tb[1],_b=256,Bb=function(t){var n=t.className,r=t.style,o=t.sx,i=t.option,l=t.onClick,c=t.activeOptionPath,u=t.currentPadding,s=e(Fb(),2)[1],d=Tb().noOptionHover,m=i.icon||$t;return f.createElement(tt,{className:n,onMouseEnter:function(){return!d&&s(i.path)},onMouseLeave:function(){return!d&&s("")},style:r,sx:o,disablePadding:!0},f.createElement(Me,{disabled:i.disabled,selected:i.path===c,onClick:function(){return l(i.path,i.id)},sx:a({overfloxX:"hidden",maxWidth:_b,py:"2px",px:3},o)},f.createElement(j,{style:{paddingLeft:u}}),!!m&&f.createElement(F,null,f.createElement(m,null)),f.createElement(Oe,null,i.label||jb(i.id))))},Hb=function(e){var t=[],n=function(e,r){return void 0===r&&(r="root"),e.forEach(function(e){var o="".concat(r,".").concat(e.id);Array.isArray(e.children)?(e.path=o,t.push(e),n(e.children,o)):Array.isArray(e.options)?(e.path=o,t.push(e),n(e.options,o)):(e.path=o,t.push(e))})};return n(e),t},Wb=p(null),zb=function(e){var t=e.children,n=e.value;return f.createElement(Wb.Provider,{value:n},t)},Vb=function(){return v(Wb)},Yb=function(t){var n=t.option,r=t.currentPadding,o=t.disabled,i=t.activeOptionPath,l=t.onClick,c=t.onGroupClick,u=!!Vb().searchText,s=e(Fb(),1)[0],d=h(function(){return""!==s&&(s===n.path||s.startsWith(n.path))},[s]),m=no(function(){return n.lifted||i.includes(n.path)}),p=e(g(m()),2),v=p[0],b=p[1],y=Tb().onOptionGroupClick;w(function(){b(!!u||m())},[u,i]);var E=v?function(){return f.createElement(jt,null)}:function(){return f.createElement(it,null)};return n.visible?f.createElement(f.Fragment,null,f.createElement(Bb,{key:n.id,sx:n.sx,option:a(a({},n),{disabled:n.disabled||o,icon:n.icon||E}),activeOptionPath:i,onClick:function(){b(function(e){return y&&n.path!==i||!e}),c(n.path,n.id)},currentPadding:r}),(v||n.pin||d)&&f.createElement(Ub,{option:n.options,paddingLeft:r,activeOptionPath:i,disabled:o,onClick:l,onGroupClick:c})):null},Ub=function(e){var t=e.paddingLeft,n=void 0===t?-12:t,r=e.option,o=e.disabled,i=void 0!==o&&o,l=e.activeOptionPath,c=e.onClick,u=e.onGroupClick,s=h(function(){return Array.isArray(r)?r:[r]},[r]).filter(function(e){return e.visible}).sort(function(e,t){var n=e.pin,r=void 0!==n&&n,o=t.pin;return Number(void 0!==o&&o)-Number(r)}).map(function(e,t){var r,o=n+12;return(null===(r=e.options)||void 0===r?void 0:r.length)?f.createElement(Yb,{key:"".concat(e.id,"-").concat(t),option:e,activeOptionPath:l,disabled:i,onGroupClick:u,onClick:c,currentPadding:o}):e.visible?f.createElement(Bb,{key:"".concat(e.id,"-").concat(t),sx:e.sx,option:a(a({},e),{disabled:i||e.disabled}),activeOptionPath:l,onClick:c,currentPadding:o}):null});return f.createElement(f.Fragment,null,s)},qb=function(e){var t=e.className,n=e.style,r=e.sx,o=Vb(),i=o.searchText,l=o.setSearchText,c=sb();return f.createElement(Gt,a({className:t,style:n,sx:a({height:"100%"},r),fullWidth:!0,onChange:function(e){var t=e.target;return l(t.value.toString())},value:i,placeholder:"Search",autoComplete:"off",endAdornment:i?f.createElement(Le,{position:"end"},f.createElement("div",{style:{marginRight:-10}},f.createElement(Ne,{onClick:function(){return l("")}},f.createElement(Fe,null)))):void 0,name:"search",type:"text"},c))},$b={boxShadow:function(e){var t=$(e.palette.background.default,.1);return"0 -1px 0 ".concat(t," inset")},py:1.5,px:3},Xb=function(e){var t=e.sx,n=e.options,r=e.appName,o=e.noAppName,i=e.noSearch,c=e.payload,u=e.activeOptionPath,s=e.BeforeSearch,d=e.AfterSearch,m=e.BeforeContent,p=e.AfterContent,h=e.onOptionClick,v=void 0===h?function(){}:h,g=e.onOptionGroupClick,b=void 0===g?function(){}:g,y=l(e,["sx","options","appName","noAppName","noSearch","payload","activeOptionPath","BeforeSearch","AfterSearch","BeforeContent","AfterContent","onOptionClick","onOptionGroupClick"]),w=Db().isAppleMobile,E=Tb(),x=E.disableBackdropTransition,C=void 0===x||x,k=E.disableDiscovery,S=void 0===k?w:k,L=E.disableSwipeToOpen,N=void 0===L?w:L,I=E.swipeAreaWidth,M=void 0===I?20:I;return f.createElement(Xt,a({variant:"permanent",disableBackdropTransition:C,disableSwipeToOpen:N,disableDiscovery:S,swipeAreaWidth:M,sx:a(a({},t),{display:"flex",alignItems:"stretch",justifyContent:"stretch"})},y),f.createElement(ke,{className:"react-declarative__scaffold2Background",sx:{flex:1,display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column"}},m&&f.createElement(m,null),f.createElement(Ie,{sx:{flex:1},disablePadding:!0},!o&&f.createElement(tt,{sx:a(a({},$b),{py:2,fontSize:22,background:"transparent"})},r),s&&f.createElement(tt,{sx:{background:"transparent",boxShadow:function(e){var t=$(e.palette.background.default,.1);return"0 -1px 0 ".concat(t," inset")}}},f.createElement(s,{payload:c})),!i&&f.createElement(tt,{sx:$b},f.createElement(F,null,f.createElement(ot,null)),f.createElement(Oe,null,f.createElement(qb,null))),d&&f.createElement(tt,{sx:{background:"transparent",boxShadow:function(e){var t=$(e.palette.background.default,.1);return"0 -1px 0 ".concat(t," inset")}}},f.createElement(d,{payload:c})),!n.some(function(e){return e.visible})&&f.createElement(tt,{disablePadding:!0,sx:{py:2,px:3}},f.createElement(Oe,null,"Nothing found")),n.filter(function(e){return e.visible}).map(function(e,t,n){var r=e.id,o=e.path,i=e.label,l=e.disabled,c=e.noHeader,s=void 0!==c&&c,d=e.icon,m=e.children;return f.createElement(j,{key:r,sx:a({background:"transparent"},s&&{pt:0===t?0:2})},!s&&f.createElement(tt,{sx:{background:function(e){return"dark"===e.palette.mode?$(e.palette.primary.main,.023):void 0},py:2,px:3}},f.createElement(Me,{onClick:function(){return b(o,r)},disabled:l,sx:{pointerEvents:"none"},disableTouchRipple:!0,disableRipple:!0,disableGutters:!0},!!d&&f.createElement(F,null,f.createElement(d,null)),f.createElement(Oe,null,i||jb(r)))),m.filter(function(e){return e.visible}).sort(function(e,t){var n=e.pin,r=void 0!==n&&n,o=t.pin;return Number(void 0!==o&&o)-Number(r)}).map(function(e,t){return f.createElement(Ub,{key:"".concat(e.id,"-").concat(t),activeOptionPath:u,option:e,onClick:v,onGroupClick:b})}),t!==n.length-1&&f.createElement(H,{sx:{mt:2,opacity:.23}}))})),p&&f.createElement(p,null)))},Gb=Tn()({tabsRoot:{minHeight:48,height:48},tabRoot:{minHeight:48,height:48}}),Kb=function(e){var t=e.className,n=e.style,r=e.sx,o=e.payload,i=e.loading,c=e.options,u=e.isMobile,s=e.appName,d=e.activeOptionPath,m=e.activeTabPath,p=e.onDrawerToggle,v=e.onAction,g=e.onTabChange,b=e.BeforeMenuContent,w=e.AfterMenuContent,E=e.actions,x=void 0===E?[]:E,C=l(e,["className","style","sx","payload","loading","options","isMobile","appName","activeOptionPath","activeTabPath","onDrawerToggle","onAction","onTabChange","BeforeMenuContent","AfterMenuContent","actions"]),k=Tb(),S=k.dense,L=void 0!==S&&S,N=k.fixedHeader,I=void 0!==N&&N,M=k.BeforeActionMenu,R=k.AfterAppName,P=nl().isPhone,A=Gb().classes,T=h(function(){var e=Hb(c).find(function(e){var t=e.path;return d===t})||{},t=e.id,n=void 0===t?"unknown":t,r=e.path,o=void 0===r?"unknown":r,i=e.label,a=void 0===i?jb(n):i,l=e.tabs;return{id:n,path:o,label:"unknown"===n?s:a,tabs:void 0===l?[]:l}},[d,c,s]),D=T.id,O=T.path,F=T.label,B=T.tabs,H=h(function(){var e=B.find(function(e){return e.active});return e?e.path:m},[B,m]),W=h(function(){return!!B.filter(function(e){return e.visible}).length},[B]),z=y(function(e,t){g&&g(e,t,D)},[O,D]);return f.createElement(f.Fragment,null,f.createElement(we,a({className:t,style:n,sx:a(a(a({width:"100%",zIndex:999},I&&{position:"fixed",top:0,left:u?0:"256px",width:u?"100%":"calc(100% - 256px)"}),!I&&{position:"sticky",top:0,left:0,right:0}),r),alignItems:"stretch",justifyContent:"stretch"},C),f.createElement(zt,{component:"div",color:"primary",position:"static",elevation:0,sx:{zIndex:0,pb:!W||u||L?0:2}},f.createElement($e,{variant:L?"dense":"regular"},f.createElement(U,{container:!0,alignItems:"center",wrap:"nowrap",spacing:1},f.createElement(U,{sx:{display:L?void 0:{sm:"none",xs:"block"}},item:!0},f.createElement(Ne,{sx:{pointerEvents:u?"inherit":"none"},color:"inherit","aria-label":"open drawer",onClick:p,edge:"start"},f.createElement(Ut,null))),f.createElement(U,{item:!0},L?f.createElement(f.Fragment,null,!W&&f.createElement(_,{display:P?"none":void 0,whiteSpace:"nowrap",color:"inherit",variant:"h5",component:"h1"},F||s),W&&f.createElement(lt,{variant:"scrollable",value:H,textColor:"inherit",indicatorColor:"secondary",classes:{root:A.tabsRoot}},B.filter(function(e){return e.visible}).map(function(e,t){var n=e.id,r=e.label,o=e.icon,i=e.disabled,a=e.path;return f.createElement(at,{sx:{minWidth:128,fontWeight:"bold"},key:"".concat(n,"-").concat(t),value:a,label:r||jb(n),onClick:function(){return z(a,n)},disabled:i,icon:o&&f.createElement(o,null),iconPosition:"start",classes:{root:A.tabRoot}})}))):f.createElement(_,{display:P?"none":void 0,whiteSpace:"nowrap",color:"inherit",variant:"h5",component:"h1"},F||s)),!!R&&f.createElement(U,{item:!0},f.createElement(R,{payload:o})),f.createElement(U,{item:!0,xs:!0}),!!M&&f.createElement(U,{item:!0},f.createElement(M,{payload:o})),!!(null==x?void 0:x.length)&&f.createElement(U,{item:!0},f.createElement(Ca,{transparent:!0,sx:{color:"unset !important",mr:-2},BeforeContent:b,AfterContent:w,options:x.map(function(e){var t=e.isVisible,n=void 0===t?function(){return!0}:t,r=e.isDisabled,i=void 0===r?function(){return!1}:r,c=l(e,["isVisible","isDisabled"]);return a(a({},c),{isVisible:function(){return n(o)},isDisabled:function(){return i(o)}})}),onAction:v,payload:o}))))),W&&!L&&f.createElement(zt,{component:"div",position:"static",elevation:0,sx:{zIndex:0}},f.createElement(lt,{variant:"scrollable",value:H,textColor:"inherit",indicatorColor:"secondary",classes:{root:A.tabsRoot}},B.filter(function(e){return e.visible}).map(function(e,t){var n=e.id,r=e.label,o=e.icon,i=e.disabled,a=e.path;return f.createElement(at,{sx:{minWidth:"128px"},key:"".concat(n,"-").concat(t),value:a,label:r||jb(n),onClick:function(){return z(a,n)},disabled:i,icon:o&&f.createElement(o,null),iconPosition:"start",classes:{root:A.tabRoot}})}))),!!i&&f.createElement(j,{sx:{marginTop:"-4px"}},f.createElement(De,{variant:i>1?"determinate":"indeterminate",value:i>1?Number(i):void 0,color:"primary"}))),!!I&&f.createElement(j,{sx:a(a({},L&&{paddingBottom:"48px"}),!L&&a({},a({},u?W?{paddingBottom:"106px"}:{paddingBottom:"56px"}:W?{paddingBottom:"128px"}:{paddingBottom:"64px"})))}))},Qb=function(t){var n=t.className,r=t.style,o=t.sx,i=t.options,l=t.activeOptionPath,c=t.activeTabPath,u=void 0===c?l:c,s=t.actions,d=t.payload,m=t.loading,p=t.appName,h=t.noAppName,v=t.noSearch,b=t.BeforeSearch,y=t.AfterSearch,w=t.BeforeMenuContent,E=t.AfterMenuContent,x=t.Copyright,C=t.BeforeContent,k=t.AfterContent,S=t.onOptionGroupClick,L=t.onOptionClick,N=t.onTabChange,I=void 0===N?L:N,M=t.onAction,R=t.children,P=Tb(),A=P.dense,T=P.noContent,D=e(g(!1),2),O=D[0],F=D[1],_=re(),B=K(_.breakpoints.between("xs","sm")),H=function(){F(function(e){return!e})},W=function(e,t){if(S){var n=S(e,t);F(!!B&&!!n)}else F(!1)},z=function(e,t){if(L){var n=L(e,t);F(!!B&&!!n)}else F(!1)};return f.createElement(Rb,null,f.createElement(j,{className:n,style:r,sx:a({position:"relative",display:"flex",minHeight:"100vh"},o)},f.createElement(Vt,null),f.createElement(j,{component:"nav",sx:{width:A?void 0:{sm:_b},flexShrink:{sm:0}}},B&&f.createElement(Xb,{PaperProps:{style:{width:_b}},activeOptionPath:l,options:i,payload:d,appName:p,noAppName:h,noSearch:v,variant:"temporary",open:O,BeforeSearch:b,AfterSearch:y,BeforeContent:C,AfterContent:k,onClose:H,onOptionGroupClick:W,onOptionClick:z,onOpen:function(){return F(!0)}}),!B&&f.createElement(Xb,{open:!0,disableSwipeToOpen:!0,disableDiscovery:!0,PaperProps:{style:{width:_b}},sx:{display:{sm:"block",xs:"none"},width:_b},activeOptionPath:l,payload:d,options:i,appName:p,noAppName:h,noSearch:v,BeforeSearch:b,AfterSearch:y,BeforeContent:C,AfterContent:k,onOptionGroupClick:W,onOptionClick:z,onOpen:function(){},onClose:function(){}})),f.createElement(j,{sx:{flex:1,display:"flex",flexDirection:"column"}},f.createElement(Kb,{payload:d,options:i,actions:s,loading:m,appName:p,isMobile:B,BeforeMenuContent:w,AfterMenuContent:E,activeOptionPath:l,activeTabPath:u,onDrawerToggle:H,onTabChange:I,onAction:M}),f.createElement(j,{component:"main",sx:{flex:1,p:1}},R),!!x&&f.createElement(j,{component:"footer",sx:{p:2}},f.createElement(x,null))),!!T&&f.createElement(j,{sx:{position:"absolute",height:"100vh",width:"100vw",top:0,left:0,zIndex:9999,background:function(e){return e.palette.background.default}}})))},Jb=function(o){var i=o.children,c=o.appName,u=void 0===c?"Scaffold2":c,s=o.noSearch,d=void 0!==s&&s,m=o.noAppName,p=void 0!==m&&m,v=o.onInit,x=o.onLoadStart,C=o.onLoadEnd,k=o.fallback,S=o.options,L=o.payload,N=o.deps,I=void 0===N?[]:N,M=o.throwError,R=l(o,["children","appName","noSearch","noAppName","onInit","onLoadStart","onLoadEnd","fallback","options","payload","deps","throwError"]),P=function(o){var i=o.onLoadStart,a=o.onLoadEnd,l=o.onInit,c=void 0===l?function(){}:l,u=o.fallback,s=o.options,d=o.payload,f=o.deps,m=o.throwError,p=void 0!==m&&m,v=e(g(0),2),w=v[0],x=v[1],C=e(g([]),2),k=C[0],S=C[1],L=e(g(""),2),N=L[0],I=L[1],M=b(!0);E(function(){return function(){M.current=!1}},[]);var R=y(function(e){return t(void 0,void 0,void 0,function(){var r,o,l,c;return n(this,function(d){switch(d.label){case 0:r=ub(Hn(lb(s))),o=Hb(r),l=!0,d.label=1;case 1:return d.trys.push([1,3,4,5]),i&&i(),M.current&&x(function(e){return e+1}),[4,Promise.all(o.map(function(r){return t(void 0,void 0,void 0,function(){var o,i,a;return n(this,function(l){switch(l.label){case 0:return r.isVisible?(o=r,[4,r.isVisible(e)]):[3,2];case 1:return o.visible=l.sent(),[3,3];case 2:r.visible=!0,l.label=3;case 3:return r.isDisabled?(i=r,[4,r.isDisabled(e)]):[3,5];case 4:return i.disabled=l.sent(),[3,6];case 5:r.disabled=!1,l.label=6;case 6:return r.tabs?(a=r,[4,Promise.all(r.tabs.map(function(o){return t(void 0,void 0,void 0,function(){var t,i,a;return n(this,function(n){switch(n.label){case 0:return o.isVisible?(t=o,[4,o.isVisible(e)]):[3,2];case 1:return t.visible=n.sent(),[3,3];case 2:o.visible=!0,n.label=3;case 3:return o.isDisabled?(i=o,[4,o.isDisabled(e)]):[3,5];case 4:return i.disabled=n.sent(),[3,6];case 5:o.disabled=!1,n.label=6;case 6:return o.isActive?(a=o,[4,o.isActive(e)]):[3,8];case 7:return a.active=n.sent(),[3,9];case 8:o.active=!1,n.label=9;case 9:return o.path="".concat(r.path,".").concat(o.id),[2,o]}})})}))]):[3,8];case 7:a.tabs=l.sent(),l.label=8;case 8:return[2]}})})}))];case 2:return d.sent(),S(r),[3,5];case 3:if(c=d.sent(),l=!1,p)throw c;return u&&u(c),[3,5];case 4:return a&&a(l),M.current&&x(function(e){return e-1}),[7];case 5:return[2]}})})},r([s,d],e(f),!1)),P=y(function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:e=!0,n.label=1;case 1:return n.trys.push([1,4,5,6]),i&&i(),M.current&&x(function(e){return e+1}),[4,c()];case 2:return n.sent(),[4,R(d)];case 3:return n.sent(),[3,6];case 4:if(t=n.sent(),e=!1,p)throw t;return u&&u(t),[3,6];case 5:return a&&a(e),M.current&&x(function(e){return e-1}),[7];case 6:return[2]}})})},[]);Xr(function(){R(d)},r([d],e(f),!1));var A=h(function(){var e=ub(Hn(lb(k)));if(!N)return Object.values(e);var t=Hb(e),n=new Set(t.filter(function(e){var t=e.id,n=e.path,r=e.label,o=void 0===r?jb(t):r,i=N.toLowerCase(),a=!1;return(a=(a=a||o.toLowerCase().includes(i))||t.toLowerCase().includes(i))||n.toLowerCase().includes(i)}).flatMap(function(e){return function(e){for(var t=e,n=[e];t.includes(".");)t=t.slice(0,t.lastIndexOf(".")),n.push(t);return n}(e.path)}));return t.forEach(function(e){n.has(e.path)||(e.visible=!1)}),Object.values(e)},[k,N]);return{loading:!!w,searchText:N,setSearchText:I,filteredGroups:A,doInit:P}}({onInit:v,onLoadStart:x,onLoadEnd:C,fallback:k,options:S,payload:L,deps:I,throwError:M});return w(function(){P.doInit()},[]),f.createElement(zb,{value:P},f.createElement(Ab,{value:o},f.createElement(Ob,{initialState:""},f.createElement(Qb,a({appName:u,noSearch:d,noAppName:p,payload:L,options:P.filteredGroups},R),i))))},Zb=function(e){var t=e.children,n=re(),r=h(function(){var e=R(n);return e.components=a(a({},e.components),{MuiTabs:{styleOverrides:{root:{marginLeft:e.spacing(1)},indicator:{height:3,background:"dark"===e.palette.mode?e.palette.primary.main:e.palette.background.default}}}}),e},[n]);return f.createElement(P,{theme:r},t)},ey=function(t){var n=e(t.split("_")),o=n[0],i=n.slice(1);return r(["".concat(o.charAt(0).toUpperCase()).concat(o.slice(1))],e(i),!1).join(" ")},ty=(nb=e(vl(),2))[0],ny=nb[1],ry=256,oy=48,iy=p(null),ay=function(e){var t=e.value,n=e.children;return f.createElement(iy.Provider,{value:t},n)},ly=function(){return v(iy)},cy=function(e){var t=e.icon,n=e.color,r=h(function(){if(n)return $(oe(n,.5),.42)},[n]);return n?m.createElement(te,{sx:{background:r,padding:"6px",marginTop:"6px",marginBottom:"6px",marginLeft:"-2px",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center"}},m.createElement(t,{sx:{color:n}})):m.createElement(t,{sx:{color:n}})},uy=function(t){var n=t.className,r=t.style,o=t.sx,i=t.option,l=t.onClick,c=t.activeOptionPath,u=t.currentPadding,s=e(ny(),2)[1],d=ly().noOptionHover,m=i.icon||$t;return f.createElement(tt,{className:n,onMouseEnter:function(){return!d&&s(i.path)},onMouseLeave:function(){return!d&&s("")},style:r,sx:o,disablePadding:!0},f.createElement(Me,{disabled:i.disabled,selected:i.path===c,onClick:function(){return l(i.path,i.id)},sx:a({overfloxX:"hidden",maxWidth:ry,py:"2px",px:3},o)},f.createElement(j,{style:{paddingLeft:u}}),!!m&&f.createElement(F,{sx:{"& *":{color:i.iconColor},color:i.iconColor}},f.createElement(cy,{icon:m,color:i.iconColor})),f.createElement(Oe,null,i.label||ey(i.id))))},sy=function(e){var t=[],n=function(e,r){return void 0===r&&(r="root"),e.forEach(function(e){var o="".concat(r,".").concat(e.id);Array.isArray(e.children)?(e.path=o,t.push(e),n(e.children,o)):Array.isArray(e.options)?(e.path=o,t.push(e),n(e.options,o)):(e.path=o,t.push(e))})};return n(e),t},dy=p(null),fy=function(e){var t=e.children,n=e.value;return f.createElement(dy.Provider,{value:n},t)},my=function(){return v(dy)},py=function(t){var n=t.option,r=t.currentPadding,o=t.disabled,i=t.activeOptionPath,l=t.onClick,c=t.onGroupClick,u=!!my().searchText,s=e(ny(),1)[0],d=h(function(){return""!==s&&(s===n.path||s.startsWith(n.path))},[s]),m=no(function(){return n.lifted||i.includes(n.path)}),p=e(g(m()),2),v=p[0],b=p[1],y=ly().onOptionGroupClick;w(function(){b(!!u||m())},[u,i]);var E=v?function(){return f.createElement(jt,null)}:function(){return f.createElement(it,null)};return n.visible?f.createElement(f.Fragment,null,f.createElement(uy,{key:n.id,sx:n.sx,option:a(a({},n),{disabled:n.disabled||o,icon:n.icon||E}),activeOptionPath:i,onClick:function(){b(function(e){return y&&n.path!==i||!e}),c(n.path,n.id)},currentPadding:r}),(v||n.pin||d)&&f.createElement(hy,{option:n.options,paddingLeft:r,activeOptionPath:i,disabled:o,onClick:l,onGroupClick:c})):null},hy=function(e){var t=e.paddingLeft,n=void 0===t?-12:t,r=e.option,o=e.disabled,i=void 0!==o&&o,l=e.activeOptionPath,c=e.onClick,u=e.onGroupClick,s=h(function(){return Array.isArray(r)?r:[r]},[r]).filter(function(e){return e.visible}).sort(function(e,t){var n=e.pin,r=void 0!==n&&n,o=t.pin;return Number(void 0!==o&&o)-Number(r)}).map(function(e,t){var r,o=n+12;return(null===(r=e.options)||void 0===r?void 0:r.length)?f.createElement(py,{key:"".concat(e.id,"-").concat(t),option:e,activeOptionPath:l,disabled:i,onGroupClick:u,onClick:c,currentPadding:o}):e.visible?f.createElement(uy,{key:"".concat(e.id,"-").concat(t),sx:e.sx,option:a(a({},e),{disabled:i||e.disabled}),activeOptionPath:l,onClick:c,currentPadding:o}):null});return f.createElement(f.Fragment,null,s)},vy=function(e){var t=e.className,n=e.style,r=e.sx,o=my(),i=o.searchText,l=o.setSearchText,c=sb();return f.createElement(Gt,a({className:t,style:n,sx:a({height:"100%"},r),fullWidth:!0,onChange:function(e){var t=e.target;return l(t.value.toString())},value:i,placeholder:"Search",autoComplete:"off",endAdornment:i?f.createElement(Le,{position:"end"},f.createElement("div",{style:{marginRight:-10}},f.createElement(Ne,{onClick:function(){return l("")}},f.createElement(Fe,null)))):void 0,name:"search",type:"text"},c))},gy={boxShadow:function(e){var t=$(e.palette.background.default,.1);return"0 -1px 0 ".concat(t," inset")},py:1.5,px:3},by=function(e){var t=e.options,n=e.appName,r=e.noAppName,o=e.noSearch,i=e.payload,l=e.activeOptionPath,c=e.BeforeSearch,u=e.AfterSearch,s=e.BeforeContent,d=e.AfterContent,m=e.onOptionClick,p=void 0===m?function(){}:m,h=e.onOptionGroupClick,v=void 0===h?function(){}:h;return f.createElement(f.Fragment,null,s&&f.createElement(s,null),f.createElement(Ie,{sx:{flex:1},disablePadding:!0},!r&&f.createElement(tt,{sx:a(a({},gy),{py:2,fontSize:22,background:"transparent"})},n),c&&f.createElement(tt,{sx:{background:"transparent",boxShadow:function(e){var t=$(e.palette.background.default,.1);return"0 -1px 0 ".concat(t," inset")}}},f.createElement(c,{payload:i})),!o&&f.createElement(tt,{sx:gy},f.createElement(F,null,f.createElement(ot,null)),f.createElement(Oe,null,f.createElement(vy,null))),u&&f.createElement(tt,{sx:{background:"transparent",boxShadow:function(e){var t=$(e.palette.background.default,.1);return"0 -1px 0 ".concat(t," inset")}}},f.createElement(u,{payload:i})),!t.some(function(e){return e.visible})&&f.createElement(tt,{disablePadding:!0,sx:{py:2,px:3}},f.createElement(Oe,null,"Nothing found")),t.filter(function(e){return e.visible}).map(function(e,t,n){var r=e.id,o=e.path,i=e.label,c=e.disabled,u=e.noHeader,s=void 0!==u&&u,d=e.icon,m=e.iconColor,h=e.children;return f.createElement(j,{key:r,sx:a({background:"transparent"},s&&{pt:0===t?0:2})},!s&&f.createElement(tt,{sx:{background:function(e){return"dark"===e.palette.mode?$(e.palette.primary.main,.023):void 0},py:2,px:3}},f.createElement(Me,{onClick:function(){return v(o,r)},disabled:c,sx:{pointerEvents:"none"},disableTouchRipple:!0,disableRipple:!0,disableGutters:!0},!!d&&f.createElement(F,{sx:{"& *":{color:m},color:m}},f.createElement(cy,{icon:d,color:m})),f.createElement(Oe,null,i||ey(r)))),h.filter(function(e){return e.visible}).sort(function(e,t){var n=e.pin,r=void 0!==n&&n,o=t.pin;return Number(void 0!==o&&o)-Number(r)}).map(function(e,t){return f.createElement(hy,{key:"".concat(e.id,"-").concat(t),activeOptionPath:l,option:e,onClick:p,onGroupClick:v})}),t!==n.length-1&&f.createElement(H,{sx:{mt:2,opacity:.23}}))})),d&&f.createElement(d,null))},yy=Tn()({hidden:{visibility:"hidden"}}),wy=function(t){var n=t.swiping,r=t.options,o=t.onOptionClick,i=void 0===o?function(){}:o,a=t.onOptionGroupClick,l=void 0===a?function(){}:a,c=yy(),u=c.classes,s=c.cx,d=e(g(!1),2),m=d[0],p=d[1],v=h(function(){return Zn(function(){p(!1)},500)},[]),b=y(function(){v.clear()},[]),w=y(function(){v.clear(),p(!0)},[]);return f.createElement(j,{sx:{position:"relative",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"},overflowX:"hidden",overflowY:"auto",maxWidth:oy,minWidth:oy,height:"100vh"}},f.createElement(j,{sx:{position:"absolute",top:0,left:0,right:0,width:"100%",display:"flex",alignItems:"center",justifyContent:"flex-start",flexDirection:"column",gap:2,pt:2}},r.flatMap(function(e){return e.children}).filter(function(e){return e.visible}).map(function(e,t){var r,o=e.icon,a=void 0===o?$t:o,c=e.iconColor,d=e.disabled,p=e.id,h=e.path,g=e.label,y=e.options;return f.createElement(Nt,{arrow:!0,open:m,hidden:n,classes:{tooltip:s((r={},r[u.hidden]=n,r))},onMouseMove:b,onOpen:w,onClose:v,placement:"right",key:"".concat(p,"-").concat(t),title:g||p,PopperProps:{style:{zIndex:1e3}},enterTouchDelay:0},f.createElement(Te,{disabled:d,color:"primary",size:"small",sx:{"& *":{color:"white"},color:"white",background:c},onClick:function(){(null==y?void 0:y.some(function(e){return e.visible}))?l(h,p):i(h,p)}},f.createElement(a,null)))})))},Ey=Tn()({tabsRoot:{minHeight:48,height:48},tabRoot:{minHeight:48,height:48}}),xy=function(e){var t=e.className,n=e.style,r=e.sx,o=e.payload,i=e.loading,c=e.options,u=e.isMobile,s=e.appName,d=e.activeOptionPath,m=e.activeTabPath,p=e.onDrawerToggle,v=e.onAction,g=e.onTabChange,b=e.BeforeMenuContent,w=e.AfterMenuContent,E=e.actions,x=void 0===E?[]:E,C=l(e,["className","style","sx","payload","loading","options","isMobile","appName","activeOptionPath","activeTabPath","onDrawerToggle","onAction","onTabChange","BeforeMenuContent","AfterMenuContent","actions"]),k=ly(),S=k.dense,L=void 0!==S&&S,N=k.fixedHeader,I=void 0!==N&&N,M=k.BeforeActionMenu,R=k.AfterAppName,P=nl().isPhone,A=Ey().classes,T=h(function(){var e=sy(c).find(function(e){var t=e.path;return d===t})||{},t=e.id,n=void 0===t?"unknown":t,r=e.path,o=void 0===r?"unknown":r,i=e.label,a=void 0===i?ey(n):i,l=e.tabs;return{id:n,path:o,label:"unknown"===n?s:a,tabs:void 0===l?[]:l}},[d,c,s]),D=T.id,O=T.path,F=T.label,B=T.tabs,H=h(function(){var e=B.find(function(e){return e.active});return e?e.path:m},[B,m]),W=h(function(){return!!B.filter(function(e){return e.visible}).length},[B]),z=y(function(e,t){g&&g(e,t,D)},[O,D]);return f.createElement(f.Fragment,null,f.createElement(we,a({className:t,style:n,sx:a(a(a({width:"100%",zIndex:995},I&&{position:"absolute",top:0,left:0,width:"100%"}),!I&&{position:"sticky",top:0,left:0,right:0}),r),alignItems:"stretch",justifyContent:"stretch"},C),f.createElement(zt,{component:"div",color:"primary",position:"static",elevation:0,sx:{zIndex:0,pb:!W||u||L?0:2}},f.createElement($e,{variant:L?"dense":"regular"},f.createElement(U,{container:!0,alignItems:"center",wrap:"nowrap",spacing:1},f.createElement(U,{item:!0,sx:{display:L?void 0:{sm:"none",xs:"block"}}},f.createElement(Ne,{color:"inherit","aria-label":"open drawer",onClick:p,edge:"start"},f.createElement(Ut,null))),f.createElement(U,{item:!0},L?f.createElement(f.Fragment,null,!W&&f.createElement(_,{display:P?"none":void 0,whiteSpace:"nowrap",color:"inherit",variant:"h5",component:"h1"},F||s),W&&f.createElement(lt,{variant:"scrollable",value:H,textColor:"inherit",indicatorColor:"secondary",classes:{root:A.tabsRoot}},B.filter(function(e){return e.visible}).map(function(e,t){var n=e.id,r=e.label,o=e.icon,i=e.disabled,a=e.path;return f.createElement(at,{sx:{minWidth:128,fontWeight:"bold"},key:"".concat(n,"-").concat(t),value:a,label:r||ey(n),onClick:function(){return z(a,n)},disabled:i,icon:o&&f.createElement(o,null),iconPosition:"start",classes:{root:A.tabRoot}})}))):f.createElement(_,{display:P?"none":void 0,whiteSpace:"nowrap",color:"inherit",variant:"h5",component:"h1"},F||s)),!!R&&f.createElement(U,{item:!0},f.createElement(R,{payload:o})),f.createElement(U,{item:!0,xs:!0}),!!M&&f.createElement(U,{item:!0},f.createElement(M,{payload:o})),!!(null==x?void 0:x.length)&&f.createElement(U,{item:!0},f.createElement(Ca,{transparent:!0,sx:{color:"unset !important",mr:-2},BeforeContent:b,AfterContent:w,options:x.map(function(e){var t=e.isVisible,n=void 0===t?function(){return!0}:t,r=e.isDisabled,i=void 0===r?function(){return!1}:r,c=l(e,["isVisible","isDisabled"]);return a(a({},c),{isVisible:function(){return n(o)},isDisabled:function(){return i(o)}})}),onAction:v,payload:o}))))),W&&!L&&f.createElement(zt,{component:"div",position:"static",elevation:0,sx:{zIndex:0}},f.createElement(lt,{variant:"scrollable",value:H,textColor:"inherit",indicatorColor:"secondary",classes:{root:A.tabsRoot}},B.filter(function(e){return e.visible}).map(function(e,t){var n=e.id,r=e.label,o=e.icon,i=e.disabled,a=e.path;return f.createElement(at,{sx:{minWidth:"128px"},key:"".concat(n,"-").concat(t),value:a,label:r||ey(n),onClick:function(){return z(a,n)},disabled:i,icon:o&&f.createElement(o,null),iconPosition:"start",classes:{root:A.tabRoot}})}))),!!i&&f.createElement(j,{sx:{marginTop:"-4px"}},f.createElement(De,{variant:i>1?"determinate":"indeterminate",value:i>1?Number(i):void 0,color:"primary"}))),!!I&&f.createElement(j,{sx:a(a({},L&&{paddingBottom:"48px"}),!L&&a({},a({},u?W?{paddingBottom:"106px"}:{paddingBottom:"56px"}:W?{paddingBottom:"128px"}:{paddingBottom:"64px"})))}))},Cy={delta:10,preventScrollOnSwipe:!1,noPassive:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},ky={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},Sy="mousemove",Ly="mouseup";function Ny(e,t){if(0===t)return e;var n=Math.PI/180*t;return[e[0]*Math.cos(n)+e[1]*Math.sin(n),e[1]*Math.cos(n)-e[0]*Math.sin(n)]}function Iy(t,n){var r=function(e){var n="touches"in e;n&&e.touches.length>1||t(function(t,r){r.trackMouse&&!n&&(document.addEventListener(Sy,o),document.addEventListener(Ly,l));var i=n?e.touches[0]:e,c=Ny([i.clientX,i.clientY],r.rotationAngle);return r.onTouchStartOrOnMouseDown&&r.onTouchStartOrOnMouseDown({event:e}),a(a(a({},t),ky),{initial:c.slice(),xy:c,start:e.timeStamp||0})})},o=function(n){t(function(t,r){var o="touches"in n;if(o&&n.touches.length>1)return t;if(n.timeStamp-t.start>r.swipeDuration)return t.swiping?a(a({},t),{swiping:!1}):t;var i=o?n.touches[0]:n,l=i.clientX,c=i.clientY,u=e(Ny([l,c],r.rotationAngle),2),s=u[0],d=u[1],f=s-t.xy[0],m=d-t.xy[1],p=Math.abs(f),h=Math.abs(m),v=(n.timeStamp||0)-t.start,g=Math.sqrt(p*p+h*h)/(v||1),b=[f/(v||1),m/(v||1)],y=function(e,t,n,r){return e>t?n>0?"Right":"Left":r>0?"Down":"Up"}(p,h,f,m),w="number"==typeof r.delta?r.delta:r.delta[y.toLowerCase()]||Cy.delta;if(p<w&&h<w&&!t.swiping)return t;var E={absX:p,absY:h,deltaX:f,deltaY:m,dir:y,event:n,first:t.first,initial:t.initial,velocity:g,vxvy:b};E.first&&r.onSwipeStart&&r.onSwipeStart(E),r.onSwiping&&r.onSwiping(E);var x=!1;return(r.onSwiping||r.onSwiped||r["onSwiped".concat(y)])&&(x=!0),x&&r.preventScrollOnSwipe&&r.trackTouch&&n.cancelable&&n.preventDefault(),a(a({},t),{first:!1,eventData:E,swiping:!0})})},i=function(e){t(function(t,n){var r;if(t.swiping&&t.eventData){if(e.timeStamp-t.start<n.swipeDuration){r=a(a({},t.eventData),{event:e}),n.onSwiped&&n.onSwiped(r);var o=n["onSwiped".concat(r.dir)];o&&o(r)}}else n.onTap&&n.onTap({event:e});return n.onTouchEndOrOnMouseUp&&n.onTouchEndOrOnMouseUp({event:e}),a(a(a({},t),ky),{eventData:r})})},l=function(e){document.removeEventListener(Sy,o),document.removeEventListener(Ly,l),i(e)},c=function(t,n){var l=function(){};if(t&&t.addEventListener){var c=a(a({},Cy.touchEventOptions),n.touchEventOptions),u=[["touchstart",r,c],["touchmove",o,a(a({},c),n.preventScrollOnSwipe||n.noPassive?{passive:!1}:{})],["touchend",i,c]];u.forEach(function(n){var r=e(n,3),o=r[0],i=r[1],a=r[2];return t.addEventListener(o,i,a)}),l=function(){return u.forEach(function(n){var r=e(n,2),o=r[0],i=r[1];return t.removeEventListener(o,i)})}}return l},u={ref:function(e){null!==e&&t(function(t,n){if(t.el===e)return t;var r={};return t.el&&t.el!==e&&t.cleanUpTouch&&(t.cleanUpTouch(),r.cleanUpTouch=void 0),n.trackTouch&&e&&(r.cleanUpTouch=c(e,n)),a(a(a({},t),{el:e}),r)})}};return n.trackMouse&&(u.onMouseDown=r),[u,c]}function My(t){var n,r=t.trackMouse,o=f.useRef(a({},ky)),i=f.useRef(a({},Cy)),l=f.useRef(a({},i.current));for(n in l.current=a({},i.current),i.current=a(a({},Cy),t),Cy)void 0===i.current[n]&&(i.current[n]=Cy[n]);var c=e(f.useMemo(function(){return Iy(function(e){return o.current=e(o.current,i.current)},{trackMouse:r})},[r]),2),u=c[0],s=c[1];return o.current=function(e,t,n,r){return t.trackTouch&&e.el?e.cleanUpTouch?t.preventScrollOnSwipe!==n.preventScrollOnSwipe||t.touchEventOptions.passive!==n.touchEventOptions.passive?(e.cleanUpTouch(),a(a({},e),{cleanUpTouch:r(e.el,t)})):e:a(a({},e),{cleanUpTouch:r(e.el,t)}):(e.cleanUpTouch&&e.cleanUpTouch(),a(a({},e),{cleanUpTouch:void 0}))}(o.current,i.current,l.current,s),u}var Ry,Py=function(t){var n=t.variant,r=void 0===n?"temporary":n,o=t.onOpenChange,i=t.onSwipingChange,l=t.children,c=t.opened,u=e(g(ry),2),s=u[0],d=u[1],m=e(g(!1),2),p=m[0],v=m[1],y=b(c),w=h(function(){return p?s:c?ry:oy},[s,c,p]),E=My({onSwiped:function(){v(!1),o(y.current),i(!1)},onSwiping:function(t){var n=t.initial,r=t.deltaX,o=t.dir;"Left"!==o&&"Right"!==o||(v(!0),i(!0));var a=e(n,1)[0]+r,l=a>115.2;d(Math.max(Math.min(a,ry),oy)),y.current=l},noPassive:!0});return f.createElement(f.Fragment,null,f.createElement(j,a({sx:{position:"fixed",top:0,left:0,bottom:0,height:"100%",width:w,transition:p?"unset":"width 50ms",overflowX:"hidden",overflowY:"auto",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"},maxHeight:"100vh",minHeight:"100vh",background:function(e){return e.palette.background.paper},display:"flex",alignItems:"stretch",justifyContent:"stretch",zIndex:998}},E),f.createElement(j,{sx:{display:"flex",flexDirection:"column",alignItems:"stretch",justifyContent:"stretch",minWidth:ry,maxWidth:ry,pointerEvents:p?"none":"all",flex:1}},l)),"temporary"===r&&f.createElement(je,{sx:{zIndex:997},open:c||p,onClick:function(){return o(!1)}}),f.createElement(j,{sx:{minWidth:"permanent"===r?w:oy}}))},Ay=function(t){var n=t.className,r=t.style,o=t.sx,i=t.options,l=t.activeOptionPath,c=t.activeTabPath,u=void 0===c?l:c,s=t.actions,d=t.payload,m=t.loading,p=t.appName,v=t.noAppName,b=t.noSearch,y=t.BeforeSearch,E=t.AfterSearch,x=t.BeforeMenuContent,C=t.AfterMenuContent,k=t.Copyright,S=t.BeforeContent,L=t.AfterContent,N=t.onOptionGroupClick,I=t.onOptionClick,M=t.onTabChange,R=void 0===M?I:M,P=t.onAction,A=t.children,T=re(),D=eg(),O=K(T.breakpoints.between("xs","sm"));w(function(){O||H(!0)},[O]);var F=ly().noContent,_=e(g(!O),2),B=_[0],H=_[1],W=e(g(!1),2),z=W[0],V=W[1],Y=h(function(){return D.width-oy},[D.width]),U=function(e,t){if(N){var n=N(e,t);B&&H(!!O&&!!n)}else H(!1)},q=function(e,t){if(I){var n=I(e,t);B&&H(!!O&&!!n)}else H(!1)};return f.createElement(Zb,null,f.createElement(j,{className:n,style:r,sx:a({position:"relative",display:"flex",minHeight:"100vh",flexDirection:"row",overflowX:"hidden"},o)},f.createElement(Vt,null),f.createElement(Py,{variant:O?"temporary":"permanent",opened:B||!O,onOpenChange:H,onSwipingChange:V},B||!O?f.createElement(by,{activeOptionPath:l,options:i,payload:d,appName:p,noAppName:v,noSearch:b,BeforeSearch:y,AfterSearch:E,BeforeContent:S,AfterContent:L,onOptionGroupClick:U,onOptionClick:q}):f.createElement(wy,{swiping:z,options:i,onOptionGroupClick:U,onOptionClick:q})),f.createElement(j,{sx:{flex:1,display:"flex",slignItems:"stretch",justifyContent:"stretch",maxWidth:Y,"& > *":{maxWidth:Y}}},f.createElement(j,{sx:{display:"flex",flexDirection:"column",flex:1,position:"relative"}},f.createElement(xy,{payload:d,options:i,actions:s,loading:m,appName:p,isMobile:O,BeforeMenuContent:x,AfterMenuContent:C,activeOptionPath:l,activeTabPath:u,onDrawerToggle:function(){H(function(e){return!e})},onTabChange:R,onAction:P}),f.createElement(j,{component:"main",sx:{flex:1,p:1}},A),!!k&&f.createElement(j,{component:"footer",sx:{p:2}},f.createElement(k,null)))),!!F&&f.createElement(j,{sx:{position:"absolute",height:"100vh",width:"100vw",top:0,left:0,zIndex:999,background:function(e){return e.palette.background.default}}})))},Ty=function(o){var i=o.children,c=o.appName,u=void 0===c?"Scaffold3":c,s=o.noSearch,d=void 0!==s&&s,m=o.noAppName,p=void 0!==m&&m,v=o.onInit,x=o.onLoadStart,C=o.onLoadEnd,k=o.fallback,S=o.options,L=o.payload,N=o.deps,I=void 0===N?[]:N,M=o.throwError,R=l(o,["children","appName","noSearch","noAppName","onInit","onLoadStart","onLoadEnd","fallback","options","payload","deps","throwError"]),P=function(o){var i=o.onLoadStart,a=o.onLoadEnd,l=o.onInit,c=void 0===l?function(){}:l,u=o.fallback,s=o.options,d=o.payload,f=o.deps,m=o.throwError,p=void 0!==m&&m,v=e(g(0),2),w=v[0],x=v[1],C=e(g([]),2),k=C[0],S=C[1],L=e(g(""),2),N=L[0],I=L[1],M=b(!0);E(function(){return function(){M.current=!1}},[]);var R=y(function(e){return t(void 0,void 0,void 0,function(){var r,o,l,c;return n(this,function(d){switch(d.label){case 0:r=ub(Hn(lb(s))),o=sy(r),l=!0,d.label=1;case 1:return d.trys.push([1,3,4,5]),i&&i(),M.current&&x(function(e){return e+1}),[4,Promise.all(o.map(function(r){return t(void 0,void 0,void 0,function(){var o,i,a;return n(this,function(l){switch(l.label){case 0:return r.isVisible?(o=r,[4,r.isVisible(e)]):[3,2];case 1:return o.visible=l.sent(),[3,3];case 2:r.visible=!0,l.label=3;case 3:return r.isDisabled?(i=r,[4,r.isDisabled(e)]):[3,5];case 4:return i.disabled=l.sent(),[3,6];case 5:r.disabled=!1,l.label=6;case 6:return r.tabs?(a=r,[4,Promise.all(r.tabs.map(function(o){return t(void 0,void 0,void 0,function(){var t,i,a;return n(this,function(n){switch(n.label){case 0:return o.isVisible?(t=o,[4,o.isVisible(e)]):[3,2];case 1:return t.visible=n.sent(),[3,3];case 2:o.visible=!0,n.label=3;case 3:return o.isDisabled?(i=o,[4,o.isDisabled(e)]):[3,5];case 4:return i.disabled=n.sent(),[3,6];case 5:o.disabled=!1,n.label=6;case 6:return o.isActive?(a=o,[4,o.isActive(e)]):[3,8];case 7:return a.active=n.sent(),[3,9];case 8:o.active=!1,n.label=9;case 9:return o.path="".concat(r.path,".").concat(o.id),[2,o]}})})}))]):[3,8];case 7:a.tabs=l.sent(),l.label=8;case 8:return[2]}})})}))];case 2:return d.sent(),S(r),[3,5];case 3:if(c=d.sent(),l=!1,p)throw c;return u&&u(c),[3,5];case 4:return a&&a(l),M.current&&x(function(e){return e-1}),[7];case 5:return[2]}})})},r([s,d],e(f),!1)),P=y(function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:e=!0,n.label=1;case 1:return n.trys.push([1,4,5,6]),i&&i(),M.current&&x(function(e){return e+1}),[4,c()];case 2:return n.sent(),[4,R(d)];case 3:return n.sent(),[3,6];case 4:if(t=n.sent(),e=!1,p)throw t;return u&&u(t),[3,6];case 5:return a&&a(e),M.current&&x(function(e){return e-1}),[7];case 6:return[2]}})})},[]);Xr(function(){R(d)},r([d],e(f),!1));var A=h(function(){var e=ub(Hn(lb(k)));if(!N)return Object.values(e);var t=sy(e),n=new Set(t.filter(function(e){var t=e.id,n=e.path,r=e.label,o=void 0===r?ey(t):r,i=N.toLowerCase(),a=!1;return(a=(a=a||o.toLowerCase().includes(i))||t.toLowerCase().includes(i))||n.toLowerCase().includes(i)}).flatMap(function(e){return function(e){for(var t=e,n=[e];t.includes(".");)t=t.slice(0,t.lastIndexOf(".")),n.push(t);return n}(e.path)}));return t.forEach(function(e){n.has(e.path)||(e.visible=!1)}),Object.values(e)},[k,N]);return{loading:!!w,searchText:N,setSearchText:I,filteredGroups:A,doInit:P}}({onInit:v,onLoadStart:x,onLoadEnd:C,fallback:k,options:S,payload:L,deps:I,throwError:M});return w(function(){P.doInit()},[]),f.createElement(fy,{value:P},f.createElement(ay,{value:o},f.createElement(ty,{initialState:""},f.createElement(Ay,a({appName:u,noSearch:d,noAppName:p,payload:L,options:P.filteredGroups},R),i))))},Dy=m.createElement,jy=Symbol("translated"),Oy=function(t){return function(n,o){for(var i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];for(var l=0;l!==i.length;l++)"string"==typeof i[l]&&(i[l]=t(i[l]));return Dy.apply(void 0,r([n,o],e(i),!1))}},Fy=function(){function t(t,n,o){void 0===t&&(t={}),void 0===o&&(o={});var i=this;this.transform=n,this.config=o,this._skip=new Set,this._map=new Map,this._transformed=new Map,this._middleware=[],this.tryTransform=function(e){if(i.transform){if(i._transformed.has(e))return i._transformed.get(e);var t="";if(i._middleware.some(function(n){return t=n(e)})||(t=i.transform(e)),t!==e){var n=i.applyMark(t);return i._transformed.set(e,n),n}return null}return null},this.applyMark=function(e){var t=new String(e);return t[jy]=!0,t},this.tr=function(e){if(!e)return e;if(e[jy])return e;if(i._skip.has(e))return e;if(i._map.has(e))return i._map.get(e)||"";var t=i.tryTransform(e);return null!==t?t:(i._skip.add(e),e)},this.use=function(e){i._middleware.push(e)},this.jss=function(t,n){var o=Array.isArray(null==n?void 0:n.children)?(null==n?void 0:n.children)||[]:[null==n?void 0:n.children];return i.createElement.apply(i,r([t,n],e(o),!1))},this.clear=function(){i._skip.clear(),i._transformed.clear()};var a=o.rawSymbol,l=void 0===a?"撝":a,c=o.useRawMark,u=void 0!==c&&c,s=o.rawCondition,d=void 0===s?function(){return!0}:s,f=function(e){var t=i.tr(e);return t===e&&d(t)?l:t};u?(this.createElement=Oy(f),this.translateText=f):(this.createElement=Oy(this.tr),this.translateText=this.tr),Object.entries(t).forEach(function(t){var n=e(t,2),r=n[0],o=n[1];return i._map.set(r,i.applyMark(o))})}return Object.defineProperty(t.prototype,"skipList",{get:function(){return r([],e(this._skip),!1)},enumerable:!1,configurable:!0}),t.install=function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var i=new(t.bind.apply(t,r([void 0],e(n),!1)));return window.Translate=i,Object.assign(m,{createElement:i.createElement}),i},t}(),_y=Tn()(function(e){return{root:{display:"flex",alignItems:"center",justifyContent:"flex-end",flexDirection:"row",paddingTop:"10px",paddingBottom:"10px",flexWrap:"wrap",gap:e.spacing(1)},stretch:{flexGrow:1,shrink:1},button:{borderRadius:"50px !important",minHeight:"40px !important",paddingLeft:"15px !important",paddingRight:"15px !important"}}}),By=function(e){var t=e.onSave,n=e.onBack,r=e.onAction,o=e.actions,i=e.saveDisabled,c=e.payload,u=e.title,s=void 0===u?"Title":u,d=e.subtitle,m=void 0===d?"Subtitle":d,p=e.withSave,h=void 0!==p&&p,v=e.BeforeMenuContent,g=e.AfterMenuContent,b=_y().classes;return f.createElement(j,{className:b.root},f.createElement(Kt,{className:b.stretch,"aria-label":"breadcrumb"},f.createElement(Qt,{sx:{cursor:"pointer"},onClick:n,color:"inherit"},s),f.createElement(_,{sx:{cursor:"pointer"},color:"textPrimary"},m)),!!h&&f.createElement(ye,{className:b.button,variant:"contained",size:"small",onClick:function(){return t&&setTimeout(t,500)},color:"primary",disabled:i},"Save"),!!(null==o?void 0:o.length)&&f.createElement(Ca,{payload:c,options:o.map(function(e){var t=e.isVisible,n=void 0===t?function(){return!0}:t,r=e.isDisabled,o=void 0===r?function(){return!1}:r,i=l(e,["isVisible","isDisabled"]);return a(a({},i),{isVisible:function(){return n(c)},isDisabled:function(){return o(c)}})}),onAction:r,BeforeContent:v,AfterContent:g}))},Hy=Tn()({root:{zIndex:"unset !important"},container:{position:"relative",display:"flex",alignItems:"stretch",justifyContent:"stretch",overflowY:"auto",overflowX:"hidden",maxHeight:"45vh"},content:{flex:1,display:"flex",flexDirection:"column",justifyContent:"stretch"},loader:{position:"absolute",top:0,left:0,right:0,bottom:0,height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center"},beforeContent:{width:"100%",display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *":{flex:1}},afterContent:{width:"100%",display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *":{flex:1}}}),Wy=function(r){var o=r.variant,i=void 0===o?"contained":o,c=r.size,u=r.options,s=void 0===u?[]:u,d=r.disabled,m=void 0!==d&&d,p=r.throwError,v=void 0!==p&&p,y=r.fallback,w=r.onToggle,E=r.onAction,x=void 0===E?function(){return null}:E,C=r.payload,k=r.className,S=r.style,L=r.sx,N=r.deps,I=r.onLoadStart,M=r.onLoadEnd,R=r.keepMounted,P=r.BeforeContent,A=r.AfterContent,T=r.reloadSubject,D=b(null),H=e(g(null),2),z=H[0],V=H[1],Y=e(g(0),2),U=Y[0],q=Y[1],$=Hy().classes,X=no(x),K=function(){q(function(e){return e+1}),I&&I()},Q=function(e){q(function(e){return Math.max(e-1,0)}),M&&M(e)},J=e(Sc(function(){return t(void 0,void 0,void 0,function(){var r,o;return n(this,function(i){switch(i.label){case 0:return[4,Promise.all(s.map(function(e){return t(void 0,void 0,void 0,function(){var t,r,o=e.isVisible,i=void 0===o?function(){return!0}:o,c=e.isDisabled,u=void 0===c?function(){return!1}:c,s=l(e,["isVisible","isDisabled"]);return n(this,function(e){switch(e.label){case 0:return t=[a({},s)],r={},[4,i(C)];case 1:return r.visible=e.sent(),[4,u(C)];case 2:return[2,a.apply(void 0,t.concat([(r.disabled=e.sent(),r)]))]}})})}))];case 1:return r=i.sent(),o=e(r.filter(function(e){return e.visible}).filter(function(e){return!e.disabled}).filter(function(e){return!e.divider}).sort(function(e,t){var n=e.primary,r=t.primary;return("boolean"==typeof r?r?1:0:null!=r?r:0)-("boolean"==typeof n?n?1:0:null!=n?n:0)}),1),[2,o[0]||r[0]]}})})},{onLoadStart:K,onLoadEnd:Q}),4),Z=J[0],ee=J[1].loading,te=J[3].waitForResult,ne=h(function(){return ee?"Loading":Z?Z.label:"Unset"},[Z,ee]),re=Ti(X,{onLoadStart:K,onLoadEnd:Q,throwError:v,fallback:y}).execute;return f.createElement(f.Fragment,null,f.createElement(Jt,{className:xo(k,$.root),style:S,sx:L,variant:i,size:c,ref:D,disabled:m||!!U},f.createElement(si,{size:c,variant:i,sx:{pl:2.5,pr:2.5},disabled:!Z||!!U,onLoadStart:K,onLoadEnd:Q,onClick:function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return Z&&Z.action?[4,X(Z.action)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})}},ne),f.createElement(ye,{size:c,variant:i,disabled:!!U,"aria-haspopup":"menu",onClick:function(e){e.preventDefault(),e.stopPropagation(),V(D.current),w&&w(!0)}},f.createElement(Pe,null))),f.createElement(W,{keepMounted:R,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},anchorEl:m?null:z,open:!!z&&!m,onClose:function(e){e.preventDefault(),e.stopPropagation(),V(null),q(0),w&&w(!1)},MenuListProps:{disablePadding:!0,sx:{pt:P?0:1,pb:A?0:1}}},f.createElement(j,{className:$.container},0!==U&&f.createElement(j,{className:$.loader},f.createElement(O,null)),f.createElement(j,{className:$.content,sx:{visibility:0!==U?"hidden":"visible"}},P&&f.createElement(j,{className:$.beforeContent},f.createElement(P,null)),s.map(function(e,r){var o=e.label,i=void 0===o?"unknown-label":o,a=e.action,l=void 0===a?"unknown-action":a,c=e.divider,u=e.icon,s=e.isDisabled,d=void 0===s?function(){return!1}:s,m=e.isVisible,p=void 0===m?function(){return!0}:m;return f.createElement(Zr,{Loader:function(){return c?null:f.createElement(B,{sx:{visibility:"hidden",minWidth:225}},!!u&&f.createElement(F,null,f.createElement(u,null)),f.createElement(_,{variant:"inherit"},i))},throwError:v,fallback:y,key:r,onLoadStart:K,onLoadEnd:Q,reloadSubject:T,deps:N,payload:C},function(e){return t(void 0,void 0,void 0,function(){var t,r,o;return n(this,function(n){switch(n.label){case 0:return[4,$n(250)];case 1:return n.sent(),[4,d(e)];case 2:return t=n.sent(),[4,p(e)];case 3:return r=n.sent(),[4,te()];case 4:return(null==(o=n.sent())?void 0:o.action)===l?[2,null]:r?c?[2,f.createElement(G,{orientation:"horizontal"})]:[2,f.createElement(B,{disabled:t,onClick:(a=l,function(e){e.preventDefault(),e.stopPropagation(),re(a),V(null),w&&w(!1)}),sx:{minWidth:225}},!!u&&f.createElement(F,null,f.createElement(u,null)),f.createElement(_,{variant:"inherit"},i))]:[2,null]}var a})})})}),A&&f.createElement(j,{className:$.afterContent},f.createElement(A,null))))))};!function(e){e.Link="breadcrumbs2-link",e.Button="breadcrumbs2-button",e.Fab="breadcrumbs2-fab",e.ActionGroup="breadcrumbs2-actiongroup",e.Component="breadcrumbs2-component"}(Ry||(Ry={}));var zy,Vy=Ry,Yy=function(){return f.createElement(O,{size:20})},Uy=function(){return f.createElement(f.Fragment,null)},qy=Tn()(function(e){return{root:{display:"flex",alignItems:"center",justifyContent:"flex-end",flexDirection:"row",paddingTop:"10px",paddingBottom:"10px",flexWrap:"wrap",gap:e.spacing(1)},link:{cursor:"pointer"},stretch:{flexGrow:1,shrink:1},disabled:{pointerEvents:"none",opacity:.5}}}),$y=function(r){var o=r.className,i=r.style,c=r.sx,u=r.onAction,s=void 0===u?function(){}:u,d=r.items,m=r.actions,p=r.payload,h=r.BeforeMenuContent,v=r.AfterMenuContent,g=r.onLoadStart,b=r.onLoadEnd,y=r.fallback,w=r.throwError,E=qy().classes,x=e(jr(0),2),C=x[0],k=x[1],S=function(){k(function(e){return e+1}),g&&g()},L=function(e){k(function(e){return Math.max(e-1,0)}),b&&b(e)},N=no(function(e){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return C.current>1?[2]:[4,s(e)];case 1:return t.sent(),[2]}})})});return f.createElement(j,{className:xo(E.root,o),style:i,sx:c},f.createElement(j,{className:E.stretch},f.createElement(Zr,{payload:p,Loader:Yy},function(){return t(void 0,void 0,void 0,function(){var e;return n(this,function(r){switch(r.label){case 0:return[4,Promise.all(d.filter(function(e){var t=e.type;return t===Vy.Link||t===Vy.Component}).map(function(e){return t(void 0,[e],void 0,function(e){var t,r=e.action,o=e.label,i=e.type,a=e.element,l=e.compute,c=void 0===l?function(){return o}:l,u=e.isDisabled,s=void 0===u?function(){return!1}:u,d=e.isVisible,f=void 0===d?function(){return!0}:d,m=e.sx;return n(this,function(e){switch(e.label){case 0:return t={},[4,f(p)];case 1:return t.visible=e.sent(),[4,s(p)];case 2:return t.disabled=e.sent(),t.element=a,t.action=r,t.type=i,[4,c(p)];case 3:return[2,(t.label=e.sent(),t.sx=m,t)]}})})}))];case 1:return e=r.sent(),[2,f.createElement(Kt,{className:E.stretch},e.filter(function(e){return e.type===Vy.Link}).filter(function(e){return e.visible}).map(function(e,t){var n,r=e.action,o=void 0===r?"unknown-action":r,i=e.label,a=e.disabled,l=e.sx;return f.createElement(Qt,{key:"".concat(o,"-").concat(t),className:xo(E.link,(n={},n[E.disabled]=a,n)),onClick:function(e){return e.preventDefault(),N(o),!1},color:"inherit",sx:l},i)}))]}})})}),f.createElement(Zr,{payload:p,Loader:Yy},function(){return t(void 0,void 0,void 0,function(){var e;return n(this,function(r){switch(r.label){case 0:return[4,Promise.all(d.filter(function(e){return e.type===Vy.Component}).map(function(e){return t(void 0,[e],void 0,function(e){var t,r,o=e.element,i=void 0===o?function(){return f.createElement(f.Fragment,null)}:o,a=e.isDisabled,l=void 0===a?function(){return!1}:a,c=e.isVisible,u=void 0===c?function(){return!0}:c;return n(this,function(e){switch(e.label){case 0:return[4,l(p)];case 1:return t=e.sent(),r={element:function(){return f.createElement(i,{disabled:t,payload:p})}},[4,u(p)];case 2:return[2,(r.visible=e.sent(),r)]}})})}))];case 1:return e=r.sent(),[2,f.createElement(f.Fragment,null,e.filter(function(e){return e.visible}).map(function(e,t){var n=e.element;return f.createElement(n,{key:t})}))]}})})})),f.createElement(Zr,{payload:p,Loader:Uy},function(){return t(void 0,void 0,void 0,function(){var e;return n(this,function(r){switch(r.label){case 0:return[4,Promise.all(d.filter(function(e){return e.type===Vy.ActionGroup}).map(function(e){return t(void 0,[e],void 0,function(e){var t,r=e.action,o=e.label,i=e.icon,c=e.outlined,u=void 0===c||c,s=e.actions,d=void 0===s?[]:s,f=e.isDisabled,m=void 0===f?function(){return!1}:f,h=e.isVisible,v=void 0===h?function(){return!0}:h,g=e.sx;return n(this,function(e){switch(e.label){case 0:return t={},[4,v(p)];case 1:return t.visible=e.sent(),[4,m(p)];case 2:return[2,(t.disabled=e.sent(),t.actions=d.map(function(e){var t=e.isVisible,n=void 0===t?function(){return!0}:t,r=e.isDisabled,o=void 0===r?function(){return!1}:r,i=l(e,["isVisible","isDisabled"]);return a(a({},i),{isVisible:function(){return n(p)},isDisabled:function(){return o(p)}})}),t.icon=i,t.outlined=u,t.action=r,t.label=o,t.sx=g,t)]}})})}))];case 1:return e=r.sent(),[2,f.createElement(f.Fragment,null,e.filter(function(e){return e.visible}).map(function(e,t){var n=e.action,r=void 0===n?"unknown-action":n,o=e.disabled,i=e.actions,a=e.outlined,l=e.sx;return f.createElement(Wy,{key:"".concat(r,"-").concat(t),variant:a?"outlined":"contained",payload:p,options:i,disabled:o,onAction:N,BeforeContent:h,AfterContent:v,onLoadStart:S,onLoadEnd:L,fallback:y,throwError:w,sx:l})}))]}})})}),f.createElement(Zr,{payload:p,Loader:Uy},function(){return t(void 0,void 0,void 0,function(){var e;return n(this,function(r){switch(r.label){case 0:return[4,Promise.all(d.filter(function(e){return e.type===Vy.Button}).map(function(e){return t(void 0,[e],void 0,function(e){var t,r=e.action,o=e.label,i=e.icon,a=e.isDisabled,l=void 0===a?function(){return!1}:a,c=e.isVisible,u=void 0===c?function(){return!0}:c,s=e.sx,d=e.buttonColor,f=e.buttonVariant;return n(this,function(e){switch(e.label){case 0:return t={},[4,u(p)];case 1:return t.visible=e.sent(),[4,l(p)];case 2:return[2,(t.disabled=e.sent(),t.icon=i,t.action=r,t.label=o,t.sx=s,t.buttonColor=d,t.buttonVariant=f,t)]}})})}))];case 1:return e=r.sent(),[2,f.createElement(f.Fragment,null,e.filter(function(e){return e.visible}).map(function(e,t){var n=e.action,r=void 0===n?"unknown-action":n,o=e.label,i=e.buttonColor,a=e.buttonVariant,l=void 0===a?"contained":a,c=e.disabled,u=e.icon,s=e.sx;return f.createElement(si,{key:"".concat(r,"-").concat(t),color:i,variant:l,startIcon:u&&f.createElement(u,null),disabled:c,onClick:function(){return N(r)},onLoadStart:S,onLoadEnd:L,fallback:y,throwError:w,sx:s},o)}))]}})})}),f.createElement(Zr,{payload:p,Loader:Uy},function(){return t(void 0,void 0,void 0,function(){var e;return n(this,function(r){switch(r.label){case 0:return[4,Promise.all(d.filter(function(e){return e.type===Vy.Fab}).map(function(e){return t(void 0,[e],void 0,function(e){var t,r=e.action,o=e.icon,i=e.isDisabled,a=void 0===i?function(){return!1}:i,l=e.isVisible,c=void 0===l?function(){return!0}:l,u=e.label,s=e.sx,d=e.fabColor,f=void 0===d?"primary":d;return n(this,function(e){switch(e.label){case 0:return t={},[4,c(p)];case 1:return t.visible=e.sent(),[4,a(p)];case 2:return[2,(t.disabled=e.sent(),t.icon=o,t.action=r,t.label=u,t.sx=s,t.fabColor=f,t)]}})})}))];case 1:return e=r.sent(),[2,f.createElement(f.Fragment,null,e.filter(function(e){return e.visible}).map(function(e,t){var n=e.action,r=void 0===n?"unknown-action":n,o=e.label,i=e.fabColor,a=e.disabled,l=e.icon,c=e.sx;return f.createElement(ie,{title:o},f.createElement(Te,{key:"".concat(r,"-").concat(t),size:"small",color:i,disabled:a,onClick:function(){return N(r)},sx:c},l&&f.createElement(l,null)))}))]}})})}),!!(null==m?void 0:m.length)&&f.createElement(Ca,{payload:p,options:m.map(function(e){var t=e.isVisible,n=void 0===t?function(){return!0}:t,r=e.isDisabled,o=void 0===r?function(){return!1}:r,i=l(e,["isVisible","isDisabled"]);return a(a({},i),{isVisible:function(){return n(p)},isDisabled:function(){return o(p)}})}),onAction:N,BeforeContent:h,AfterContent:v,onLoadStart:S,onLoadEnd:L,fallback:y,throwError:w}))},Xy=function(e){function t(t){var n=e.call(this,t)||this;return n.componentDidMount=function(){var e;n.unReload=null===(e=n.props.reloadSubject)||void 0===e?void 0:e.subscribe(function(){n.setState({hasError:!1})})},n.componentWillUnmount=function(){n.unHistory&&n.unHistory(),n.unReload&&n.unReload()},n.componentDidUpdate=function(){var e;n.state.hasError&&(n.unHistory=null===(e=n.props.history)||void 0===e?void 0:e.listen(function(){n.setState({hasError:!1}),n.unHistory&&n.unHistory()}))},n.componentDidCatch=function(e,t){n.props.onError&&n.props.onError(e,t)},n.render=function(){return n.state.hasError?null:n.props.children},n.state={hasError:!1},n}return u(t,e),t.getDerivedStateFromError=function(){return{hasError:!0}},t}(f.Component),Gy=Tn()(function(e){return{root:{color:e.palette.action.active,cursor:"pointer",transition:"color 500ms",borderRadius:"50%",padding:0},input:{visibility:"hidden",height:0,width:0,maxHeight:0,maxWidth:0}}}),Ky=function(t){var n=t.className,r=t.value,o=void 0===r?"":r;t.sx;var i=t.onChange,c=void 0===i?function(){return null}:i,u=l(t,["className","value","sx","onChange"]),s=b(null),d=Gy().classes,m=e(g(o),2),p=m[0],v=m[1];Xr(function(){v(o)},[o]);var y=no(c),E=h(function(){return Zn(function(e){y(e),v(e)},500)},[]);return w(function(){return function(){E.clear()}},[]),f.createElement(j,a({},u,{className:xo(d.root,n),onClick:function(){var e;return null===(e=s.current)||void 0===e?void 0:e.click()},style:{color:p}}),f.createElement(Zt,null),f.createElement("input",{className:d.input,ref:s,type:"color",onChange:function(e){var t=e.target;return E(t.value)}}))},Qy=function(r){var o=r.value,i=void 0!==o&&o,c=r.withSingleValue,u=void 0!==c&&c,s=r.onChange,d=r.onLoadStart,m=r.onLoadEnd,p=r.fallback,v=r.throwError,b=l(r,["value","withSingleValue","onChange","onLoadStart","onLoadEnd","fallback","throwError"]),y=e(g(function(){return!!u||i}),2),w=y[0],E=y[1],x=ro(function(){return t(void 0,void 0,void 0,function(){var e;return n(this,function(t){switch(t.label){case 0:return s?[4,s(!w)]:[3,2];case 1:e=t.sent(),t.label=2;case 2:return u||E("boolean"==typeof e?e:!w),[2]}})})},{onLoadStart:d,onLoadEnd:m,fallback:p,throwError:v}),C=x.loading,k=x.execute,S=h(function(){return u?{}:{onDelete:k,deleteIcon:f.createElement(en,null)}},[]),L=h(function(){return u?{}:{onDelete:k,deleteIcon:f.createElement(Mt,null)}},[]);return C?f.createElement(He,a({},b,{onClick:function(){},onDelete:function(){},deleteIcon:f.createElement(O,{size:"12px",color:"inherit"}),variant:"filled"})):w?f.createElement(He,a({},b,{onClick:k},S,{variant:"filled"})):f.createElement(He,a({},b,{onClick:k},L,{variant:"outlined"}))};!function(e){e.Initial="initial-state",e.Active="active-state",e.Abort="abort-state",e.Succeed="succeed-state",e.Closed="closed-state"}(zy||(zy={}));var Jy,Zy,ew,tw=zy,nw=Tn()(function(e){var t=D(Jy||(Jy=s(["\n 0% {\n transform: scale(1,1);\n }\n 100% {\n transform: scale(0.9, 1.1) translateY(-200px);\n }\n "],["\n 0% {\n transform: scale(1,1);\n }\n 100% {\n transform: scale(0.9, 1.1) translateY(-200px);\n }\n "]))),n=D(Zy||(Zy=s(["\n 0% {\n transform: scale(1.05, 0.95) translateY(0);\n }\n 10% {\n transform: scale(1.05, 0.95) translateY(0);\n }\n 20% {\n transform: scale(1,1) translateY(-7px);\n }\n 30% {\n transform: scale(1,1) translateY(0);\n }\n 40% {\n transform: scale(1.05, 0.95) translateY(0);\n }\n 50% {\n transform: scale(1,1) translateY(-7px);\n }\n 60% {\n transform: scale(1,1) translateY(0);\n }\n 70% {\n transform: scale(1.05, 0.95) translateY(0);\n }\n 80% {\n transform: scale(1,1) translateY(-7px);\n }\n 90% {\n transform: scale(1,1) translateY(0);\n }\n 100% {\n transform: scale(1,1) translateY(0);\n }\n "],["\n 0% {\n transform: scale(1.05, 0.95) translateY(0);\n }\n 10% {\n transform: scale(1.05, 0.95) translateY(0);\n }\n 20% {\n transform: scale(1,1) translateY(-7px);\n }\n 30% {\n transform: scale(1,1) translateY(0);\n }\n 40% {\n transform: scale(1.05, 0.95) translateY(0);\n }\n 50% {\n transform: scale(1,1) translateY(-7px);\n }\n 60% {\n transform: scale(1,1) translateY(0);\n }\n 70% {\n transform: scale(1.05, 0.95) translateY(0);\n }\n 80% {\n transform: scale(1,1) translateY(-7px);\n }\n 90% {\n transform: scale(1,1) translateY(0);\n }\n 100% {\n transform: scale(1,1) translateY(0);\n }\n "]))),r=D(ew||(ew=s(["\n 0% {\n opacity: 1;\n transform: scale(0.9, 1.1) translateY(-200px);\n }\n 100% {\n opacity: 0;\n transform: scale(0.9, 1.1) translateY(-400px);\n }\n "],["\n 0% {\n opacity: 1;\n transform: scale(0.9, 1.1) translateY(-200px);\n }\n 100% {\n opacity: 0;\n transform: scale(0.9, 1.1) translateY(-400px);\n }\n "])));return{initial:{},succeed:{animation:"".concat(r," 500ms ").concat(e.transitions.easing.easeInOut),transform:"scale(0.9, 1.1) translateY(-400px)",opacity:0},active:{animation:"".concat(t," 5s ").concat(e.transitions.easing.easeInOut),transform:"scale(0.9, 1.1) translateY(-200px)"},abort:{animation:"".concat(n," 500ms ").concat(e.transitions.easing.easeInOut)},closed:{visibility:"hidden"}}}),rw=function(t){var n=t.defaultState,r=void 0===n?tw.Initial:n,o=t.onAnimationEnd,i=t.onAnimationStart,c=t.className,u=t.children,s=t.stateSubject,d=l(t,["defaultState","onAnimationEnd","onAnimationStart","className","children","stateSubject"]),m=nw().classes,p=h(function(){var e;return(e={})[tw.Initial]=m.initial,e[tw.Active]=m.active,e[tw.Abort]=m.abort,e[tw.Succeed]=m.succeed,e[tw.Closed]=m.closed,e},[]),v=e(jr(r),2),g=v[0],b=v[1];w(function(){return s.subscribe(function(e){return b(e)})},[]);var y=h(function(){return p[g.current]},[g.current]);return f.createElement(oa,a({className:xo(c,y),onAnimationEnd:function(e){o&&o(g.current,e)},onAnimationStart:function(e){i&&i(g.current,e)}},d),u)},ow=Tn()(function(e,t){var n=t.size;return{root:{display:"inline-flex",alignItems:"stretch",justifyContent:"stretch",height:n,width:n},container:{position:"relative",height:n,width:n,flex:1},icon:{position:"absolute",height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center",top:0,left:0,right:0,bottom:0,zIndex:1},spinner:{position:"absolute",height:"100%",width:"100%",top:0,left:0,right:0,bottom:0,zIndex:0}}}),iw=function(r){var o=r.className,i=r.style,c=r.sx,u=r.size,s=void 0===u?40:u,d=r.thickness,m=void 0===d?3.6:d,p=r.noProgress,h=void 0!==p&&p,v=r.throwError,y=void 0!==v&&v,w=r.disabled,x=void 0!==w&&w,C=r.onLoadStart,k=r.onLoadEnd,S=r.fallback,L=r.onClick,N=void 0===L?function(){}:L,I=r.children,M=void 0===I?f.createElement(Fe,null):I,R=l(r,["className","style","sx","size","thickness","noProgress","throwError","disabled","onLoadStart","onLoadEnd","fallback","onClick","children"]),P=ow({size:s,thickness:m}).classes,A=e(g(0),2),T=A[0],D=A[1],F=b(!0);E(function(){return function(){F.current=!1}},[]);var _=Vr(T);return f.createElement(j,{className:xo(o,P.root),style:i,sx:c},f.createElement(Ne,a({},R,{className:P.container,disabled:!!T||x,onClick:function(e){return t(void 0,void 0,void 0,function(){var t,r;return n(this,function(n){switch(n.label){case 0:if(_.current)return[2];t=!0,n.label=1;case 1:return n.trys.push([1,3,4,5]),C&&C(),F.current&&D(function(e){return e+1}),[4,N(e)];case 2:return n.sent(),[3,5];case 3:if(r=n.sent(),t=!1,y)throw r;return S&&S(r),[3,5];case 4:return k&&k(t),F.current&&D(function(e){return e-1}),[7];case 5:return[2]}})})}}),!h&&f.createElement("div",{className:P.spinner},f.createElement(O,{size:s,thickness:m})),f.createElement(j,{className:P.icon},M)))},aw=function(t){var n=t.actions,o=t.label,i=void 0===o?"Filters":o,c=t.addLabel,u=void 0===c?"Add filter":c,s=t.data,d=void 0===s?{}:s,m=t.onChange,p=void 0===m?function(){return null}:m,h=l(t,["actions","label","addLabel","data","onChange"]),v=e(g(new Map(Object.entries(d))),2),b=v[0],y=v[1],w=no(p);Xr(function(){var t=r([],e(b.entries()),!1).reduce(function(t,n){var r,o=e(n,2),i=o[0],l=o[1];return a(a({},t),((r={})[i]=l,r))},{});w(t)},[b]);var E=e(f.useState(null),2),x=E[0],C=E[1],k=n.filter(function(e){var t=e.action;return!b.has(t)});return f.createElement(j,a({},h,{sx:a({display:"flex",alignItems:"center",flexDirection:{xs:"column",sm:"row"},gap:1},h.sx)}),n.map(function(e,t){var n=b.get(e.action);if(n){var r=e.items.find(function(e){return e.value===n})||null;return f.createElement(Ee,{key:t,value:r,size:"small",options:e.items,sx:{width:{xs:"100%",sm:175}},getOptionLabel:function(e){return e.label},renderInput:function(e){return f.createElement(xe,a({},e,{label:i}))},onChange:function(t,n){y(function(t){return n?t.set(e.action,n.value):t.delete(e.action),new Map(t)})}})}return null}),f.createElement(ye,{onClick:function(e){C(e.target)},disabled:!k.length,variant:"outlined",size:"small",startIcon:f.createElement(Mt,null),sx:{whiteSpace:"nowrap",minHeight:{xs:"unset",sm:40},maxHeight:{xs:"unset",sm:40},width:{xs:"100%",sm:"unset"}}},u),f.createElement(W,{keepMounted:!0,anchorEl:x,open:!!x,onClose:function(){C(null)},MenuListProps:{sx:{maxHeight:"45vh",overflowY:"auto",overflowX:"hidden"}}},k.map(function(t,r){return f.createElement(B,{key:r,onClick:function(){return function(t){var r=n.find(function(e){return e.action===t});if(r){var o=e(r.items,1)[0];o&&(y(function(e){return e.set(t,o.value),new Map(e)}),C(null))}}(t.action)}},t.label)})))},lw=function(e){var r=e.actions,o=e.variant,i=void 0===o?"outlined":o,c=e.size,u=void 0===c?"medium":c,s=e.onAction,d=void 0===s?function(){}:s,m=e.fallback,p=e.onLoadStart,h=e.onLoadEnd,v=e.payload,g=e.deps,b=e.throwError,y=l(e,["actions","variant","size","onAction","fallback","onLoadStart","onLoadEnd","payload","deps","throwError"]),w=no(d),E={fallback:m,onLoadStart:p,onLoadEnd:h,payload:v,deps:g,throwError:b},x=function(e){return function(){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,w(e)];case 1:return[2,t.sent()]}})})}},C=function(e){var t=e.action,n=e.available,r=e.label,o=e.icon;return f.createElement(si,a({},E,{disabled:!n,size:u,variant:i,startIcon:o&&f.createElement(o,null),onClick:x(t),sx:{minWidth:{xs:"100%",sm:175}}}),r)};return f.createElement(j,a({},y,{sx:a(a({},y.sx),{display:"flex",alignItems:"center",flexDirection:{xs:"column",sm:"row"},gap:1})}),f.createElement(Zr,a({Loader:function(){return f.createElement(f.Fragment,null,r.map(function(e,t){var n=e.label,r=e.icon;return f.createElement(ye,{disabled:!0,key:t,size:u,variant:i,startIcon:r&&f.createElement(r,null),sx:{minWidth:{xs:"100%",sm:175}}},f.createElement(we,{direction:"row",alignItems:"center",spacing:1},f.createElement(j,{display:"flex",alignItems:"center"},f.createElement(O,{size:"16px",color:"inherit"})),f.createElement(j,null,n)))}))}},E),function(e){return t(void 0,void 0,void 0,function(){return n(this,function(o){switch(o.label){case 0:return[4,Promise.all(r.map(function(r,o){return t(void 0,[r,o],void 0,function(t,r){var o,i=t.action,a=void 0===i?"unknown-action":i,l=t.label,c=void 0===l?"Unknown":l,u=t.icon,s=t.isAvailable,d=void 0===s||s;return n(this,function(t){switch(t.label){case 0:return[4,function(){return"function"==typeof d?d(e):d}()];case 1:return o=t.sent(),[2,f.createElement(C,{key:r,action:a,available:o,label:c,icon:u})]}})})}))];case 1:return[2,o.sent()]}})})}))},cw=Tn()({root:{display:"inline-flex",alignItems:"center",justifyContent:"center","& > *":{pointerEvents:"none"}},disabled:{opacity:.5},active:{cursor:"pointer"}}),uw=function(r){var o,i=r.className,c=r.onClick,u=void 0===c?function(){}:c,s=r.onLoadStart,d=r.onLoadEnd,m=r.fallback,p=r.disabled,h=r.throwError,v=void 0!==h&&h,y=r.checked,x=void 0!==y&&y,C=r.defaultChecked,k=void 0!==C&&C,S=l(r,["className","onClick","onLoadStart","onLoadEnd","fallback","disabled","throwError","checked","defaultChecked"]),L=cw().classes,N=e(g(0),2),I=N[0],M=N[1],R=e(g(x||k),2),P=R[0],A=R[1],T=b(!0);E(function(){return function(){T.current=!1}},[]),w(function(){A(x)},[x]);var D=Vr(I),O=Vr(P),F=!!I||p;return f.createElement(j,a({},S,{className:xo(i,L.root,(o={},o[L.disabled]=F,o[L.active]=!F,o)),onClick:function(){return t(void 0,void 0,void 0,function(){var e,t,r,o;return n(this,function(n){switch(n.label){case 0:if(e=D.current,t=O.current,e)return[2];r=!0,n.label=1;case 1:return n.trys.push([1,3,4,5]),s&&s(),T.current&&M(function(e){return e+1}),[4,u(!t)];case 2:return n.sent(),T.current&&A(!t),[3,5];case 3:if(o=n.sent(),r=!1,v)throw o;return m&&m(o),[3,5];case 4:return d&&d(r),T.current&&M(function(e){return e-1}),[7];case 5:return[2]}})})}}),f.createElement(Ze,{disabled:F,checked:P}))},sw=function(t,n){var r=e(g(n),2),o=r[0],i=r[1];return w(function(){return t.subscribe(function(e){i(e)})},[t]),o},dw=Tn()(function(e){return{root:{display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"},container:{position:"static",display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column",backgroundColor:e.palette.background.paper,padding:20,borderRadius:5},title:{display:"flex",justifyContent:"stretch",alignItems:"center",paddingBottom:15,color:e.palette.text.primary},stretch:{flex:1},content:{flex:1,display:"flex",alignItems:"stretch",justifyContent:"stretch",maxWidth:"100%",overflow:"hidden","& > * > * > * > .MuiPaper-root":{background:"transparent",boxShadow:"none",border:"0",borderRadius:"0","& > * > *":{background:"transparent"}}},submit:{paddingTop:15},disabled:{opacity:.5,pointerEvents:"none"}}}),fw=function(){return{height:0,width:0,sx:{maxHeight:"80%",minWidth:"330px",maxWidth:"450px",margin:"10px"}}},mw=function(e){return{height:e.height-50,width:e.width-50}},pw=function(r){var o=r.fullScreen,i=void 0===o||o,c=r.sizeRequest,u=void 0===c?i?mw:fw:c,s=r.hidden,d=void 0!==s&&s,m=r.onSubmit,p=void 0===m?function(){return!0}:m,h=r.onChange,v=void 0===h?function(){}:h,b=r.onLoadStart,y=r.onLoadEnd,E=r.fallback,x=r.AfterTitle,C=r.BeforeTitle,k=r.title,S=r.openSubject,L=r.payload,N=void 0===L?{}:L;r.withInitialLoader;var I=r.selectionMode,M=void 0===I?Li.Multiple:I,R=r.data,P=r.throwError,A=void 0!==P&&P,T=r.submitLabel,D=void 0===T?"Submit":T,O=r.submitIcon,F=r.onClose,B=l(r,["fullScreen","sizeRequest","hidden","onSubmit","onChange","onLoadStart","onLoadEnd","fallback","AfterTitle","BeforeTitle","title","openSubject","payload","withInitialLoader","selectionMode","data","throwError","submitLabel","submitIcon","onClose"]),H=dw().classes,W=sw(S,!!S.data);Xr(function(){W||F&&F()},[W]);var z=eg({compute:function(e){var t=u(e);return{height:t.height,width:t.width,sx:t.sx}},debounce:10}),V=Fr(N),Y=e(g(R||[]),2),U=Y[0],q=Y[1],$=e(jr(0),2),X=$[0],G=$[1];w(function(){q(R||[])},[W]);var K=function(){G(function(e){return e+1}),b&&b()},Q=function(e){G(function(e){return e-1}),y&&y(e)},J=function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:if(X.current)return[2];e=!0,n.label=1;case 1:return n.trys.push([1,4,5,6]),K(),W?[4,p(null,V)]:[3,3];case 2:n.sent(),n.label=3;case 3:return[3,6];case 4:if(t=n.sent(),e=!1,A)throw t;return E&&E(t),[3,6];case 5:return Q(e),[7];case 6:return[2]}})})};return f.createElement(Se,{open:W,className:H.root,sx:a({},d&&{visibility:"hidden",opacity:0}),onClose:function(){W&&J()}},f.createElement(j,{className:xo(H.container,"search-modal__root"),sx:a({height:z.height||void 0,width:z.width||void 0},z.sx)},k&&f.createElement("div",{className:H.title},C&&f.createElement(C,{payload:V,onClose:J}),f.createElement(_,{className:H.stretch,variant:"h6",component:"h2"},k),x&&f.createElement(x,{payload:V,onClose:J})),f.createElement(j,{className:H.content},f.createElement(Pv,a({},B,{sizeByElement:!0,withSelectOnRowClick:!0,selectionMode:M,onLoadStart:K,onLoadEnd:Q,payload:V,selectedRows:(null==U?void 0:U.length)?U:void 0,onSelectedRows:function(e,t){q(e),v(e,t)}}))),M!==Li.None&&f.createElement(si,{className:H.submit,disabled:!!X.current||!(null==U?void 0:U.length),startIcon:O&&f.createElement(O,null),size:"large",variant:"contained",color:"info",fullWidth:!0,onClick:function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:if(X.current)return[2];e=!0,n.label=1;case 1:return n.trys.push([1,4,5,6]),K(),W?[4,p(U,V)]:[3,3];case 2:n.sent(),n.label=3;case 3:return[3,6];case 4:if(t=n.sent(),e=!1,A)throw t;return E&&E(t),[3,6];case 5:return Q(e),[7];case 6:return[2]}})})}},D)))},hw=function(e){function r(r){void 0===r&&(r=null);var o=e.call(this)||this;return o._data=r,o.next=function(r){return t(o,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return this._data=r,[4,e.prototype.next.call(this,r)];case 1:return t.sent(),[2]}})})},o.toObserver=function(){var e,t=new ir(function(){return e()});return t[rr](function(){o._data&&t.emit(o._data)}),e=o.subscribe(t.emit),t},o}return u(r,e),Object.defineProperty(r.prototype,"data",{get:function(){return this._data},enumerable:!1,configurable:!0}),r}(lr),vw=function(e){return void 0===e&&(e=null),Fr(function(){return new hw(e)})},gw=function(r){var o=r.param,i=r.selectionMode,c=r.handler,u=r.fallback,s=r.apiRef,d=r.reloadSubject,m=r.payload,p=void 0===m?{}:m,h=r.onChange,v=r.onAction,b=r.onRowAction,E=r.onSubmit,x=void 0===E?function(){return!0}:E,C=r.onLoadEnd,k=r.onLoadStart,S=r.onClose,L=r.submitLabel,N=r.submitIcon,I=r.throwError,M=r.title,R=r.hidden,P=l(r,["param","selectionMode","handler","fallback","apiRef","reloadSubject","payload","onChange","onAction","onRowAction","onSubmit","onLoadEnd","onLoadStart","onClose","submitLabel","submitIcon","throwError","title","hidden"]),A=Fr(p),T=vw(),D=e(g(o||[]),2),j=D[0],O=D[1];w(function(){O(o)},[o]);var F=no(x),_=Vr(j),B=y(function(e){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return[4,F((null==e?void 0:e.length)?e:null,A,_.current)];case 1:return t=n.sent(),T.next(!t),[2,t]}})})},[]),H=y(function(){return f.createElement(pw,a({openSubject:T,hidden:R,data:j,title:M,apiRef:s,reloadSubject:d,selectionMode:i,handler:c,payload:A,fallback:u,onClose:S,onChange:h,onLoadEnd:C,onLoadStart:k,onAction:v,onRowAction:b,submitIcon:N,submitLabel:L,throwError:I,onSubmit:B},P))},[open,R,s,d,c,A,u,h,C,k,B,L,I,M,j]),W=y(function(e){void 0===e&&(e=[]),O(e),T.next(!0)},[]);return{open:open,render:H,pickData:W,close:function(){return B(null)}}},bw=function(e){return gw(e)},yw=Tn()({root:{width:"100%",height:"100%",display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *:nth-of-type(1)":{flex:1}}}),ww=e(xr(),2),Ew=ww[0],xw=ww[1],Cw=function(t){var n=t.children,r=t.className,o=t.target,i=l(t,["children","className","target"]),c=yw().classes,u=e(g(null),2),s=u[0],d=u[1],m=e(g({height:0,width:0}),2),p=m[0],h=m[1];w(function(){var e=o||s;if(e){var t=ne(function(){var t=e.getBoundingClientRect(),n=t.height,r=t.width;h({height:n,width:r})}),n=new ResizeObserver(t);return t(),n.observe(e),function(){n.unobserve(e),t.clear()}}},[s]);return f.createElement(Ew,{payload:p},f.createElement(j,a({className:xo(c.root,r),ref:function(e){return d(e)}},i),n))},kw=e(xr(),2),Sw=kw[0],Lw=kw[1],Nw=function(t){var n=t.children,o=t.delay,i=void 0===o?5e3:o,a=e(g([]),2),l=a[0],c=a[1],u=y(function(){return l.length?l[0]:null},[l]),s=y(function(){var e=l.length;e>0&&c(l.slice(1,e))},[l]),d=u();return f.createElement(f.Fragment,null,!!d&&f.createElement(tn,{open:!0,key:d.key,anchorOrigin:{vertical:"bottom",horizontal:"center"},autoHideDuration:i,onClose:s,message:d.message}),f.createElement(Sw,{payload:function(t){return c(function(n){return r(r([],e(n),!1),[{key:Kr(),message:t}],!1)})}},n))},Iw=Tn()(function(e){return{root:{position:"fixed",bottom:e.spacing(1),right:e.spacing(1),transition:"opacity 500ms"},hidden:{opacity:0},visible:{opacity:1}}}),Mw=function(t){var n,r=t.className,o=t.style,i=t.sx,c=t.color,u=void 0===c?"primary":c,s=t.size,d=void 0===s?"medium":s,m=t.scrollTarget,p=void 0===m?document.documentElement:m,h=l(t,["className","style","sx","color","size","scrollTarget"]),v=Iw().classes,b=e(g(!1),2),y=b[0],w=b[1];E(function(){var e=function(){var e=p.scrollTop;w(e>40)};return window.addEventListener("scroll",e),function(){return window.removeEventListener("scroll",e)}},[p]);return f.createElement(Te,a({},h,{className:xo(r,v.root,(n={},n[v.visible]=y,n[v.hidden]=!y,n)),style:o,sx:i,color:u,size:d,onClick:function(){window.scrollTo({top:0,left:0,behavior:"smooth"})}}),f.createElement(nn,null))},Rw="The form contains unsaved changes. Continue?",Pw=function(){return f.createElement(f.Fragment,null)},Aw=Tn()({root:{position:"relative",width:"100%"},inner:{position:"absolute",top:0,left:0}}),Tw=function(r){var o=r.className,i=r.readonly,c=r.fullScreen,u=r.waitForChangesDelay,s=void 0===u?1e3:u,d=r.initialData,m=void 0===d?{}:d,p=r.changed,v=void 0!==p&&p,y=r.animation,E=r.routes,x=r.params,C=void 0===x?{}:x,k=r.payload,S=void 0===k?{}:k,L=r.history,N=r.fallback,I=r.onChange,M=r.onLeave,R=r.onSubmit,P=void 0===R?function(){return!0}:R,A=r.onLoadStart,T=r.onLoadEnd,D=r.changeSubject,j=r.otherProps,O=void 0===j?{}:j,F=l(r,["className","readonly","fullScreen","waitForChangesDelay","initialData","changed","animation","routes","params","payload","history","fallback","onChange","onLeave","onSubmit","onLoadStart","onLoadEnd","changeSubject","otherProps"]),_=Aw().classes,B=yi({map:function(e){return e.parentElement}}),H=B.elementRef,W=B.size,z=_r(D),V=Fr(S),Y=Fr(m),U=e(g(function(){return a(a({},E.reduce(function(e,t){var n,r=t.id;return a(a({},e),((n={})[r]=null,n))},{})),Y)}),2),q=U[0],$=U[1],X=e(g(function(){return new Set}),2),G=X[0],K=X[1],Q=e(g(function(){return"function"==typeof v?v(q,V):!!v}),2),J=Q[0],Z=Q[1],ee=e(g(0),2),te=ee[0],ne=ee[1],re=e(g(L.location.pathname),2),oe=re[0],ie=re[1];w(function(){return z.subscribe(function(t){var n=e(t,2),r=n[0],o=n[1];$(function(e){var t;return a(a({},e),((t={})[r]=o,t))}),K(function(e){return e.delete(r),new Set(e)})})},[]);var ae=e(g(function(){return{component:Pw,activeOption:""}}),2),le=ae[0],ce=ae[1],ue=le.component,se=le.activeOption,de=e(g(!1),2),fe=de[0],me=de[1],pe=Vf({title:"Continue?",msg:Rw}),he=_r(),ve=b(!1),ge=b("unknown"),be=J&&!te&&!G.size,ye=!!G.size,we=!!te,Ee=Vr(be),xe=Vr(we),Ce=Vr(ye),ke=Vr(oe),Se=Vr(q),Le=_r(),Ne=Gr(q);w(function(){return function(){Le.next()}},[]),w(function(){return Ne.subscribe(function(e){var t=Ee.current;I&&I(e,!t,V,ge.current),ge.current="unknown"})},[I]);var Ie=function(){A&&A(),ne(function(e){return e+1})},Me=function(e){T&&T(e),ne(function(e){return e-1})},Re=b(),Pe=al([ue,se],10),Ae=al([q,J],10),Te=function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return Re.current&&Re.current(),Z(!1),[4,Promise.race([Ae(),Le.toPromise()])];case 1:return e.sent(),[2]}})})};w(function(){return L.listen(function(e){var t=e.location;"PUSH"!==e.action&&(ie(t.pathname),ne(0))})},[]),w(function(){var e=L.location;ie(e.pathname)},[]),w(function(){var e,r,o,i=function(){return L.block(function(e){var r=e.retry,o=e.location;if(E.some(function(e){var t=e.isActive,n=e.isAvailable;return(void 0===n?t:n)(o.pathname)}))return Re.current&&Re.current(),M&&M(),void r();!function(e){t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return[4,ve.current?he.toPromise():new Promise(function(e){ve.current=!0,pe({msg:Rw}).then(function(t){ve.current=!1,he.next(t),e(t)})})];case 1:return(t=n.sent())&&M&&M(),t&&a(),t&&e(),[2]}})})}(r)})},a=function(){e&&e(),r&&r(),Re.current=null};return q&&J&&(e=i(),o=function(e){return e.preventDefault(),Rw},window.addEventListener("beforeunload",o),r=function(){window.removeEventListener("beforeunload",o)},Re.current=a),a},[q,J,oe]);var De=h(function(){return Kn(function(){return t(void 0,void 0,void 0,function(){var e,t,r,o;return n(this,function(n){switch(n.label){case 0:return e=ke.current,me(!0),t=E.find(function(t){return(0,t.isActive)(e)}),t?(r=t.id,o=t.element,ce({component:o,activeOption:r})):ce({component:Pw,activeOption:""}),[4,Promise.race([Pe(),$n(500)])];case 1:return n.sent(),me(!1),[2]}})})})},[]);w(function(){De()},[oe]);var je=h(function(){return{data:q,hasChanged:be,hasLoading:we,hasInvalid:ye,id:C&&C.id||"create",change:function(e){$(function(t){return a(a({},t),e)}),Z(!0)},payload:V}},[q,be,we,ye,C&&C.id||"create"]),Oe={dirty:ye||be,history:L,activeOption:se,readonly:i||be,hasChanged:be,hasLoading:we,hasInvalid:ye,beginSave:function(){return t(void 0,void 0,void 0,function(){var e,r,o,i,a,l;return n(this,function(c){switch(c.label){case 0:return xe.current||Ce.current?[2,!1]:[4,t(void 0,void 0,void 0,function(){var e;return n(this,function(t){switch(t.label){case 0:e=L.block(function(){}),Ie(),t.label=1;case 1:return t.trys.push([1,,3,4]),[4,Promise.race([Ae(),$n(s)])];case 2:return t.sent(),[3,4];case 3:return Me(!1),e(),[7];case 4:return[2]}})})];case 1:if(c.sent(),e=L.block(function(){}),!(r=Se.current))return[3,9];o=!0,Ie(),c.label=2;case 2:return c.trys.push([2,6,7,8]),i=!1,[4,Promise.resolve(P(r,V,{afterSave:function(){return t(this,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return e(),[4,Te()];case 1:return t.sent(),i=!0,[2]}})})}}))];case 3:return!(a=c.sent())||i?[3,5]:[4,Te()];case 4:c.sent(),c.label=5;case 5:return a&&M&&M(),o=!!a,[3,8];case 6:if(l=c.sent(),o=!1,Re.current&&Re.current(),!N)throw l;return N(l),[3,8];case 7:return Me(o),e(),[7];case 8:return[2,o];case 9:return[2,!1]}})})},afterSave:Te,formState:je,data:void 0===q[se]?{}:q[se],params:C,onChange:function(e,t){return void 0===t&&(t=!1),function(e,t,n){K(function(t){return t.delete(e),new Set(t)}),$(function(n){var r;return a(a({},n),((r={})[e]=t,r))}),n||Z(!0),ge.current=e}(se,e,t)},onInvalid:function(){return K(function(e){return e.add(se),new Set(e)})},payload:V,loading:!!te,setLoading:function(e){ne(function(t){return t+(e?1:-1)})}};return f.createElement(_g,a({},F,{ref:H,className:xo(o,_.root),animation:y,appear:fe}),c?f.createElement(rn,{className:_.inner,sx:W},f.createElement(ue,a(a({key:se},Oe),O))):f.createElement(ue,a(a({key:se},Oe),O)))},Dw=Tn()({root:{display:"flex",overflow:"hidden"}}),jw=function(e){var r=e.className,o=e.onLoadStart,i=e.onLoadEnd,c=e.handler,u=e.fallback,s=e.throwError,d=e.size,m=e.sx,p=e.variant,h=e.value,v=l(e,["className","onLoadStart","onLoadEnd","handler","fallback","throwError","size","sx","variant","value"]),g=Dw().classes;return w(function(){if(c){t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:e=!0,n.label=1;case 1:return n.trys.push([1,3,4,5]),o&&o(),[4,c()];case 2:return n.sent(),[3,5];case 3:if(t=n.sent(),e=!1,s)throw t;return u&&u(t),[3,5];case 4:return i&&i(e),[7];case 5:return[2]}})})}},[]),f.createElement(j,a({className:xo(r,g.root),sx:a({alignItems:"center",justifyContent:"center"},m)},v),f.createElement(O,{variant:p,value:h,size:d}))};jw.createLoader=function(e){return function(){return f.createElement(jw,{size:e})}};var Ow,Fw,_w=function(){return f.createElement(jw,{size:24,sx:{height:"100%",width:"100%"}})},Bw=Tn()(function(e){return{root:{display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"},container:{position:"static",display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column",backgroundColor:e.palette.background.paper,padding:20,borderRadius:5},title:{display:"flex",justifyContent:"stretch",alignItems:"center",paddingBottom:15,color:e.palette.text.primary},content:{flex:1,display:"flex",alignItems:"stretch",justifyContent:"stretch",maxWidth:"100%",overflowX:"hidden",overflowY:"auto","& > *":{flex:1}},submit:{paddingTop:15},disabled:{opacity:.5,pointerEvents:"none"},stretch:{flex:1}}}),Hw=function(){return{height:0,width:0,sx:{maxHeight:"80%",minWidth:"330px",maxWidth:"450px",margin:"10px"}}},Ww=function(e){return{height:e.height-50,width:e.width-50}},zw=function(r){var o=r.withActionButton,i=void 0!==o&&o,c=r.hidden,u=void 0!==c&&c,s=r.onSubmit,d=void 0===s?function(){return!0}:s,m=r.onChange,p=void 0===m?function(){}:m,h=r.mapParams,v=void 0===h?function(e){return{id:e}}:h,y=r.mapInitialData,E=void 0===y?function(e){return{id:e}}:y,x=r.mapPayload,C=void 0===x?function(e){return{id:e}}:x,k=r.fullScreen,S=void 0===k||k,L=r.sizeRequest,N=void 0===L?S?Ww:Hw:L,I=r.onLoadStart,M=r.onLoadEnd,R=r.fallback,P=r.reloadSubject,A=r.outletIdSubject,T=r.fetchState,D=void 0===T?function(){return{}}:T,O=r.AfterTitle,F=r.BeforeTitle,B=r.title,H=r.data,W=void 0===H?null:H,z=r.withStaticAction,V=void 0!==z&&z,Y=r.throwError,U=void 0!==Y&&Y,q=r.submitLabel,$=void 0===q?"Submit":q,X=r.submitIcon,G=r.waitForChangesDelay,K=void 0===G?V?0:1e3:G,Q=r.readonly,J=r.onMount,Z=r.onUnmount,ee=r.onClose,te=void 0===ee?function(){return null}:ee,ne=l(r,["withActionButton","hidden","onSubmit","onChange","mapParams","mapInitialData","mapPayload","fullScreen","sizeRequest","onLoadStart","onLoadEnd","fallback","reloadSubject","outletIdSubject","fetchState","AfterTitle","BeforeTitle","title","data","withStaticAction","throwError","submitLabel","submitIcon","waitForChangesDelay","readonly","onMount","onUnmount","onClose"]),re=e(g(A.data),2),oe=re[0],ie=re[1],ae=Bw().classes,le=eg({compute:function(e){var t=N(e);return{height:t.height,width:t.width,sx:t.sx}},debounce:10});w(function(){return A.subscribe(function(e){ie(e)})},[]),Xr(function(){oe||te&&te()},[oe]);var ce=e(g(W),2),ue=ce[0],se=ce[1],de=e(jr(0),2),fe=de[0],me=de[1],pe=b({});w(function(){return J&&J(),function(){return Z&&Z()}},[]),w(function(){se(W)},[open]);var he=function(e,t,n,r){pe.current=n,se(e),p(e,t,n,r)},ve=function(){me(function(e){return e+1}),I&&I()},ge=function(e){me(function(e){return e-1}),M&&M(e)},be=al([ue],10),ye=function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:if(fe.current)return[2];e=!0,n.label=1;case 1:return n.trys.push([1,4,5,6]),ve(),oe?[4,d(oe,null,pe.current)]:[3,3];case 2:n.sent(),n.label=3;case 3:return[3,6];case 4:if(t=n.sent(),e=!1,U)throw t;return R&&R(t),[3,6];case 5:return ge(e),[7];case 6:return[2]}})})};return f.createElement(Se,{className:ae.root,open:!!oe,sx:a({},u&&{visibility:"hidden",opacity:0}),onClose:function(){oe&&ye()}},f.createElement(j,{className:xo(ae.container,"outlet-modal__root"),sx:a({height:le.height||void 0,width:le.width||void 0},le.sx)},B&&f.createElement("div",{className:ae.title},F&&f.createElement(F,{id:oe||"unknown",data:ue,onClose:ye}),f.createElement(_,{className:ae.stretch,variant:"h6",component:"h2"},B),O&&f.createElement(O,{id:oe||"unknown",data:ue,onClose:ye})),f.createElement(j,{className:ae.content},!!oe&&f.createElement(Hg,{animation:"none",payload:oe,state:D,reloadSubject:P,fallback:R,onLoadStart:I,onLoadEnd:M,Loader:_w},function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return t(void 0,void 0,void 0,function(){var r,o,i,l,c;return n(this,function(u){switch(u.label){case 0:return o=(r=f).createElement,i=[Tw],l=[{},ne],c={fullScreen:S,fallback:R,onLoadStart:I,onLoadEnd:M},[4,E(oe,e.flat(1))];case 1:return c.initialData=u.sent(),[4,C(oe,e.flat(1))];case 2:return c.payload=u.sent(),[4,v(oe,e.flat(1))];case 3:return[2,o.apply(r,i.concat([a.apply(void 0,l.concat([(c.params=u.sent(),c.readonly=Q,c.onChange=he,c.onSubmit=function(e,r){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,d(oe,e,r)];case 1:return[2,t.sent()]}})})},c.otherProps={onClose:ye},c)]))]))]}})})})),!Q&&i&&f.createElement(si,{className:ae.submit,startIcon:X&&f.createElement(X,null),disabled:!(V||!fe.current&&ue),size:"large",variant:"contained",color:"info",fullWidth:!0,onClick:function(){return t(void 0,void 0,void 0,function(){var e,r;return n(this,function(o){switch(o.label){case 0:if(fe.current)return[2];e=!0,o.label=1;case 1:return o.trys.push([1,5,6,7]),ve(),oe?[4,t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,Promise.race([be(),$n(K)])];case 1:return e.sent(),[2]}})})]:[3,4];case 2:return o.sent(),[4,d(oe,V?{}:ue,pe.current)];case 3:o.sent(),o.label=4;case 4:return[3,7];case 5:if(r=o.sent(),e=!1,U)throw r;return R&&R(r),[3,7];case 6:return ge(e),[7];case 7:return[2]}})})}},$)))},Vw=function(e){var r=e.fallback;e.pathname;var o=e.history,i=e.fullScreen,c=void 0===i||i,u=e.onLoadEnd,s=e.onLoadStart,d=e.throwError,m=e.onChange,p=e.onSubmit,h=void 0===p?function(){return!0}:p,v=e.onMount,g=e.onUnmount,b=e.onClose,E=e.submitLabel,x=e.title,C=e.hidden,k=e.pickDataSubject,S=l(e,["fallback","pathname","history","fullScreen","onLoadEnd","onLoadStart","throwError","onChange","onSubmit","onMount","onUnmount","onClose","submitLabel","title","hidden","pickDataSubject"]),L=_r(k),N=vw(),I=Fr(function(){return o||ct()}),M=no(h),R=y(function(e,r,o){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return[4,M(e,r,o)];case 1:return(t=n.sent())&&N.next(null),[2,t]}})})},[]),P=y(function(){N.next(null),b&&b()},[]),A=y(function(){return f.createElement(zw,a({outletIdSubject:N,fullScreen:c,history:I,hidden:C,title:x,fallback:r,onChange:m,onLoadEnd:u,onMount:v,onClose:P,onUnmount:g,onLoadStart:s,submitLabel:E,throwError:d,onSubmit:R},S))},[C,r,m,u,s,R,E,d,x]),T=y(function(e){N.next(e)},[]);return w(function(){return L.subscribe(T)},[]),{open:open,render:A,pickData:T,close:function(){return R(N.data,null,{})}}},Yw=Tn()({hidden:{display:"none"}}),Uw=function(e){var t,n=e.className,r=e.items,o=void 0===r?[]:r,i=e.variant,c=void 0===i?"outlined":i,u=l(e,["className","items","variant"]),s=Yw().classes;return f.createElement(we,a({className:xo(n,(t={},t[s.hidden]=!o.length,t)),direction:"column",spacing:2},u),o.map(function(e,t){return f.createElement(on,{key:t,variant:c,severity:e.color},e.content)}))},qw=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel",$w=Tn()(function(e){return{root:{position:"relative",overflow:"hidden",width:"100%",minHeight:225,border:"1px solid ".concat(A(e.palette.getContrastText(e.palette.background.default),.23)),borderRadius:"4px"},container:{position:"absolute",height:"100%",width:"100%",top:0,left:0,right:0,bottom:0,zIndex:1,display:"flex",alignItems:"stretch",justifyContent:"stretch","&:hover":{background:A(e.palette.background.paper,.2)}},content:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",gap:15,padding:e.spacing(1),color:e.palette.action.active},dragZone:{position:"absolute",height:"100%",width:"100%",top:0,left:0,right:0,bottom:0,zIndex:2},hidden:{display:"none"},icon:{fontSize:48},dragActive:{background:A(e.palette.background.paper,.2)},disabled:{pointerEvents:"none",opacity:.5}}}),Xw=function(t){var n,r,o=t.className,i=t.style,l=t.sx,c=t.disabled,u=void 0!==c&&c,s=t.multiple,d=void 0!==s&&s,m=t.accept,p=void 0===m?qw:m,v=t.onData,b=void 0===v?function(){}:v,y=t.onReject,w=void 0===y?function(){}:y,E=$w().classes,x=e(g({inputId:Kr(),dragActive:!1}),2),C=x[0],k=x[1],S=function(e){return k(function(t){return a(a({},t),{dragActive:e})})},L=h(function(){return new Set(p.split(", "))},[p]),N=h(function(){return"*"===p},[p]),I=function(e){e.preventDefault(),e.stopPropagation(),u||("dragenter"===e.type||"dragover"===e.type?S(!0):"dragleave"===e.type&&S(!1))};return f.createElement(j,{className:xo(o,E.root,(n={},n[E.disabled]=u,n)),style:i,sx:l},f.createElement(j,{component:"form",className:xo(E.container,(r={},r[E.dragActive]=C.dragActive,r)),onDragEnter:I,onSubmit:function(e){return e.preventDefault()}},f.createElement(j,{component:"label",htmlFor:C.inputId,className:E.content},f.createElement(_,{variant:"h6"},"Drag and drop a file here or click"),f.createElement(an,{className:E.icon}))),f.createElement("input",{type:"file",id:C.inputId,multiple:d,accept:p,onChange:function(e){if(!u){e.preventDefault(),e.stopPropagation();var t=Array.from(e.target.files||[]);t.length&&(t.every(function(e){return L.has(e.type)})||N)?b(t):t.length&&w(t)}},className:E.hidden}),C.dragActive&&f.createElement("div",{className:E.dragZone,onDragEnter:I,onDragLeave:I,onDragOver:I,onDrop:function(e){if(!u){e.preventDefault(),e.stopPropagation(),S(!1);var t=Array.from(e.dataTransfer.files||[]);t.length&&(t.every(function(e){return L.has(e.type)})||N)?b(t):t.length&&w(t)}}}))},Gw=Tn()(function(e){return{root:{position:"relative",display:"flex",alignItems:"stretch",justifyContent:"stretch",overflow:"hidden"},container:{flex:1},dropModal:{position:"absolute",background:$(e.palette.background.default,.5),top:0,left:0,right:0,bottom:0,height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",gap:15,padding:e.spacing(1),color:e.palette.action.active},icon:{fontSize:48}}}),Kw=function(t){var n=t.className,r=t.children,o=t.onDropped,i=void 0===o?function(){}:o,c=l(t,["className","children","onDropped"]),u=Gw().classes,s=e(g(!1),2),d=s[0],m=s[1],p=b(0),h=b(null),v=no(i),w=y(function(e){e.preventDefault();var t=e.dataTransfer,n=Array.from(t.files);v(n)},[]),E=y(function(e){if(h.current&&h.current(),e){var t=function(e){return void 0===e&&(e=!0),function(t){t.preventDefault(),p.current+=e?1:-1,m(p.current>0)}},n=function(e){return e.preventDefault()},r=t(!1),o=t(!0);document.body.addEventListener("dragenter",o),document.body.addEventListener("dragleave",r),document.body.addEventListener("dragover",n),document.body.addEventListener("drop",w),h.current=function(){document.body.removeEventListener("dragenter",o),document.body.removeEventListener("dragleave",r),document.body.removeEventListener("dragover",n),document.body.removeEventListener("drop",w)}}},[]);return f.createElement(oa,a({ref:E,className:xo(n,u.root)},c),f.createElement("div",{className:u.container},r),d&&f.createElement("div",{className:u.dropModal},f.createElement(_,{variant:"h6"},"Drop files to continue"),f.createElement(an,{className:u.icon})))},Qw=jw.createLoader(24),Jw=function(o){var i=o.items,a=void 0===i?[]:i,l=o.className,u=o.style,s=o.sx,d=o.disabled,m=void 0!==d&&d,p=o.onUpload,h=void 0===p?function(e){return e.name}:p,v=o.onRemove,y=void 0===v?function(){}:v,w=o.onChange,x=void 0===w?function(){}:w,C=o.onClick,k=void 0===C?function(){}:C,S=o.tr,L=void 0===S?function(e){return e}:S,N=o.accept,I=void 0===N?qw:N,M=o.multiple,R=void 0!==M&&M,P=o.onLoadStart,A=o.onLoadEnd,T=o.fallback,D=o.throwError,j=void 0!==D&&D,O=e(g(0),2),F=O[0],_=O[1],B=!!F||m,H=Vf({title:"Confirmation",msg:"Are you sure you want to delete this file?"}),W=function(){_(function(e){return e+1}),P&&P()},z=function(e){_(function(e){return Math.max(e-1,0)}),A&&A(e)},V=b(!0);E(function(){return function(){V.current=!1}},[]);var Y=e(g([]),2),U=Y[0],q=Y[1],$=Vr(a),X=no(x),G=function(e){return t(void 0,void 0,void 0,function(){var t,r;return n(this,function(n){switch(n.label){case 0:t=!0,n.label=1;case 1:return n.trys.push([1,4,5,6]),W(),[4,y(e)];case 2:return n.sent(),[4,X($.current.filter(function(t){return t!==e}))];case 3:return n.sent(),[3,6];case 4:if(r=n.sent(),t=!1,j)throw r;return T&&T(r),[3,6];case 5:return z(t),[7];case 6:return[2]}})})};return f.createElement(we,{className:l,style:u,sx:s,overflow:"hidden",direction:"column",alignItems:"stretch",justifyContent:"stretch"},f.createElement(Xw,{disabled:B,accept:I,multiple:R,onData:function(o){return t(void 0,void 0,void 0,function(){var t,i,a,l,u,s,d,f,m;return n(this,function(p){switch(p.label){case 0:t=!0,p.label=1;case 1:p.trys.push([1,10,11,12]),W(),i=function(t){var o,i;return n(this,function(n){switch(n.label){case 0:return o=new String(t.name),V.current&&q(function(t){return r(r([],e(t),!1),[o],!1)}),[4,h(t)];case 1:return i=n.sent(),V.current&&q(function(e){return e.filter(function(e){return e!==o})}),[4,X(r(r([],e($.current),!1),[i],!1))];case 2:return n.sent(),[2]}})},p.label=2;case 2:p.trys.push([2,7,8,9]),a=c(o),l=a.next(),p.label=3;case 3:return l.done?[3,6]:(u=l.value,[5,i(u)]);case 4:p.sent(),p.label=5;case 5:return l=a.next(),[3,3];case 6:return[3,9];case 7:return s=p.sent(),f={error:s},[3,9];case 8:try{l&&!l.done&&(m=a.return)&&m.call(a)}finally{if(f)throw f.error}return[7];case 9:return[3,12];case 10:if(d=p.sent(),t=!1,j)throw d;return T&&T(d),[3,12];case 11:return z(t),[7];case 12:return[2]}})})}}),f.createElement(Ie,{dense:!0,disablePadding:!0,sx:{mt:1}},U.map(function(e,t){return f.createElement(tt,{disableGutters:!0,key:"".concat(e,"-").concat(t),secondaryAction:f.createElement(iw,{disabled:B},f.createElement(nt,null))},f.createElement(Me,null,f.createElement(Oe,{primary:e})))}),a.map(function(e,r){return f.createElement(tt,{disableGutters:!0,key:"".concat(e,"-").concat(r),secondaryAction:f.createElement(ec,{disabled:B,onClick:function(){return new Promise(function(r,o){H().then(function(i){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),i?[4,G(e)]:[3,2];case 1:n.sent(),n.label=2;case 2:return r(),[3,4];case 3:return t=n.sent(),o(t),[3,4];case 4:return[2]}})})})})}},f.createElement(ln,null))},f.createElement(Me,{onClick:function(){return r=e,t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:e=!0,n.label=1;case 1:return n.trys.push([1,3,4,5]),W(),[4,k(r)];case 2:return n.sent(),[3,5];case 3:if(t=n.sent(),e=!1,j)throw t;return T&&T(t),[3,5];case 4:return z(e),[7];case 5:return[2]}})});var r}},f.createElement(Zr,{payload:e,Loader:Qw},function(e){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return[4,L(e)];case 1:return t=n.sent(),[2,f.createElement(Oe,{primary:t})]}})})})))}),!a.length&&!F&&f.createElement(tt,{sx:{pointerEvents:"none"}},f.createElement(Me,null,f.createElement(Oe,{primary:"Nothing found"})))))},Zw="The form contains unsaved changes. Continue?",eE=function(t){var n=t.history,r=t.withConfirm,o=void 0!==r&&r,i=t.onLoadStart,a=t.onLoadEnd,l=e(g(0),2),c=l[0],u=l[1],s=e(g(!1),2),d=s[0],f=s[1],m=b(null),p=Vf({title:"Continue?",msg:Zw});return w(function(){var e;return c&&!d&&(m.current&&m.current(),m.current=qn(n.block(function(e){return function(e){o&&p().then(function(t){t&&(m.current&&m.current(),e())})}(e.retry)}),(e=function(e){return e.preventDefault(),Zw},window.addEventListener("beforeunload",e),function(){window.removeEventListener("beforeunload",e)}))),function(){m.current&&m.current()}},[c,d,o]),{handleLoadStart:function(){i&&i(),u(function(e){return e+1})},handleLoadEnd:function(e){a&&a(e),u(function(e){return e-1})},unblock:function(){m.current&&m.current(),f(!0)},block:function(){f(!1)},loading:!!c}},tE=function(t){var n=e(g(function(){var e=t;return"function"==typeof t&&(e=t()),Object.values(e||{})}),2),r=n[0],o=n[1];return[h(function(){return Object.values(r||{})},[r]),o]},nE=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return"string"==typeof e&&(e=[e]),t=t.map(function(e){return"string"==typeof e?e:Object.values(e||{})}).flatMap(function(e){return e}),Object.values(e||{}).some(function(e){return t.includes(e)})},rE=function(e){var t;return!!Array.isArray(e)||(!(!Bn(e)||(null===(t=Object.keys(e))||void 0===t?void 0:t.length))||null===e)},oE=function(e){if(Array.isArray(e))return e;if(Bn(e)){var t=Object.values(e);return t.length?t:null}return null},iE=Tn()(function(e){return{root:{display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"},container:{position:"static",padding:20,display:"flex",flexDirection:"column",alignItems:"stretch",justifyContent:"stretch",backgroundColor:e.palette.background.paper,borderRadius:5,gap:5},content:{flex:1,overflowY:"auto",paddingTop:e.spacing(1)},title:{display:"flex",justifyContent:"space-between",alignItems:"center",paddingBottom:15,color:e.palette.text.primary},submit:{marginTop:15},disabled:{opacity:.5,pointerEvents:"none"}}}),aE=function(){return{height:0,width:0,sx:{maxHeight:"80%",minWidth:"330px",maxWidth:"450px",margin:"10px"}}},lE=function(e){return{height:e.height-50,width:e.width-50}},cE=function(r){var o=r.data,i=void 0===o?null:o,l=r.withActionButton,c=void 0===l||l,u=r.withStaticAction,s=void 0!==u&&u,d=r.readonly,m=r.submitLabel,p=void 0===m?"Save":m,h=r.submitIcon,v=r.payload,b=void 0===v?{}:v,y=r.fullScreen,E=void 0!==y&&y,x=r.sizeRequest,C=void 0===x?E?lE:aE:x,k=r.onChange,S=r.onSubmit,L=r.tr,N=r.fallback,I=r.onLoadStart,M=r.onLoadEnd,R=r.onClick,P=r.onUpload,A=Fr(b),T=eg({compute:function(e){var t=C(e);return{height:t.height,width:t.width,sx:t.sx}},debounce:10}),D=e(g(!1),2),O=D[0],F=D[1],_=e(g(!1),2),B=_[0],H=_[1],W=e(g(0),2),z=W[0],V=W[1],Y=e(tE(i),2),U=Y[0],q=Y[1];w(function(){q(i)},[i]);var $=iE().classes,X=function(e){q(e),H(!0),k&&k(i||[],A)},G=function(){q(i),F(!1),H(!1)},K=function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return S?[4,S(s?[]:U,A)]:[3,2];case 1:e.sent(),e.label=2;case 2:return F(!1),H(!1),[2]}})})},Q=function(){V(function(e){return e+1}),I&&I()},J=function(e){V(function(e){return e-1}),M&&M(e)};return{render:function(){return f.createElement(Se,{className:$.root,open:O,onClose:G},f.createElement(j,{className:xo($.container,"files-modal__root"),sx:a({height:T.height||void 0,width:T.width||void 0},T.sx)},f.createElement(j,{className:$.content},f.createElement(Jw,{disabled:!!z,accept:"*",multiple:!0,items:U,tr:L,fallback:N,onClick:R,onUpload:P,onChange:X,onLoadStart:Q,onLoadEnd:J})),!d&&c&&f.createElement(si,{className:$.submit,disabled:!(s||!z&&B),fallback:N,onLoadStart:Q,onLoadEnd:J,startIcon:h&&f.createElement(h,null),size:"large",variant:"contained",color:"info",fullWidth:!0,onClick:K},p)))},pickFiles:function(){return F(!0)}}},uE="react-declarative__scaleContainer",sE=Tn()({root:{position:"relative",overflow:"hidden"},container:{position:"absolute",top:0,left:0,minHeight:"100%",minWidth:"100%","& > *:nth-of-type(1)":{transformOrigin:"top left"}},stretch:{display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *:nth-of-type(1)":{flex:1}},center:{display:"flex",alignItems:"center",justifyContent:"center"}}),dE=function(t){var n,r=t.children,o=t.className,i=t.style,a=t.stretch,l=void 0!==a&&a,c=t.center,u=void 0!==c&&c,s=sE().classes,d=e(g(null),2),m=d[0],p=d[1],h=e(g("none"),2),v=h[0],b=h[1],y=e(g("inherit"),2),E=y[0],x=y[1],C=e(g("inherit"),2),k=C[0],S=C[1];w(function(){var e=function(){if(m){var e=m.querySelector(".".concat(uE," > *:nth-of-type(1)"));if(e){var t=m.getBoundingClientRect(),n=t.height,r=t.width,o=e.clientHeight,i=e.clientWidth;if(n>o&&r>i)return b("none"),x("inherit"),void S("inherit");var a=Math.min(1,n/o),l=Math.min(1,r/i),c=Number(Math.min(l,a).toFixed(2));x("-".concat(o*(1-c),"px")),S("-".concat(i*(1-c),"px")),b("scale(".concat(c,")"))}}},t=ne(e,1e3),n=new ResizeObserver(t);return m&&(n.observe(m),e()),function(){m&&n.unobserve(m),t.clear()}},[m]);return f.createElement("div",{className:xo(o,s.root),ref:function(e){p(e)},style:i},f.createElement(j,{className:xo(s.container,uE,(n={},n[s.stretch]=l,n[s.center]=u,n)),sx:{"& > *:nth-of-type(1)":{transform:v,marginBottom:E,marginRight:k}}},r))},fE=Tn()(function(){return{root:{pointerEvents:"none"},none:{display:"none"},visible:{animation:"".concat(D(Ow||(Ow=s(["\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n "],["\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n "])))," 500ms ease-in-out"),opacity:1},hidden:{animation:"".concat(D(Fw||(Fw=s(["\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n "],["\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n "])))," 500ms ease-in-out"),opacity:0}}}),mE=function(e){var t,n=e.className,r=e.visible,o=e.color,i=e.none,l=e.position,c=e.zIndex,u=fE().classes,s=M(),d=h(function(){var e=o||s.palette.background.default;return{background:"linear-gradient(\n ".concat("bottom"===l?"to bottom":"to right",",\n ").concat($(e,0),",\n ").concat(e,"\n )")}},[s,o]);return f.createElement("div",{className:xo(n,u.root,(t={},t[u.visible]=r,t[u.hidden]=!r,t[u.none]=i,t)),style:a({zIndex:c},d)})},pE="react-declarative__fadeMark",hE="react-declarative__scrollViewTarget",vE=Tn()({root:{position:"relative",display:"flex",alignItems:"stretch",justifyContent:"stretch"},container:{flex:1},bottomFade:{position:"absolute",pointerEvents:"none",height:75,bottom:0,right:0,left:0},rightFade:{position:"absolute",pointerEvents:"none",width:75,bottom:0,right:0,top:0}}),gE=function(t){var n=t.className,r=t.style,o=t.color,i=t.children,l=t.disableBottom,c=void 0!==l&&l,u=t.disableRight,s=void 0!==u&&u,d=t.zIndex,m=void 0===d?9:d,p=t.Fade,h=void 0===p?mE:p,v=t.selector,y=void 0===v?".".concat(hE):v,E=vE().classes,x=e(g(),2),C=x[0],k=x[1],S=e(g({visible:!1,none:!0}),2),L=S[0],N=S[1],I=e(g({visible:!1,none:!0}),2),M=I[0],R=I[1],P=b(L),A=b(L);w(function(){P.current=L,A.current=M},[L,M]),w(function(){if(C){var e=C.querySelector(y);if(e){var t=Object.assign({},P.current),n=Object.assign({},A.current),r=ne(function(){return N(a({},t))},50),o=ne(function(){return R(a({},n))},50),i=-1,l=-1,c=-1,u=-1,s=function(){var i=e.scrollTop,a=e.scrollLeft;i!==c&&(t.visible=0===i,t.none=!1,r()),a!==u&&(n.visible=0===a,n.none=!1,o()),u=a,c=i},d=function(){var a=e.scrollHeight,c=e.scrollWidth;if(a!==i){var u=e.clientHeight;t.none=u>=a,r()}if(c!==l){var s=e.clientWidth;n.none=s>=c,o()}i=a,l=c},f=new ResizeObserver(d);return f.observe(e),s(),d(),e.addEventListener("scroll",s,{passive:!0}),window.addEventListener("resize",d,{passive:!0}),function(){e.removeEventListener("scroll",s),window.removeEventListener("resize",d),f.unobserve(e),r.clear(),o.clear()}}return function(){return null}}return function(){return null}},[y,C]);return f.createElement("div",{className:xo(E.root,n),style:r},f.createElement("div",{className:E.container,ref:function(e){return k(e)}},i),!c&&f.createElement(h,{className:xo(E.bottomFade,pE),position:"bottom",visible:L.visible,none:L.none,color:o,zIndex:m}),!s&&f.createElement(h,{className:xo(E.rightFade,pE),position:"right",visible:M.visible,none:M.none,color:o,zIndex:m}))},bE=Tn()({root:{display:"flex",alignItems:"stretch",justifyContent:"stretch",height:"100%",width:"100%"},container:{display:"flex",alignItems:"stretch",justifyContent:"stretch",flex:1},content:{position:"relative",overflow:"auto !important",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"},flex:1}}),yE=function(e){var t=e.className,n=e.style,r=e.children,o=e.Fade,i=e.color,a=e.zIndex,l=e.disableBottom,c=e.disableRight,u=bE().classes,s=yi(),d=s.elementRef,m=s.size,p=m.height,h=m.width;return f.createElement(j,{className:t,style:n},f.createElement("div",{ref:d,className:u.root},f.createElement(gE,{className:u.container,Fade:o,color:i,zIndex:a,disableBottom:l,disableRight:c},f.createElement(j,{className:xo(hE,u.content),sx:{"& > *":{minHeight:p,minWidth:h},maxHeight:p,maxWidth:h,height:"100%",width:"100%"}},f.createElement(j,{sx:{position:"absolute",top:0,left:0,display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *":{flex:1}}},r)))))},wE=function(e){var t=void 0===e?{}:e,n=t.history,r=t.pathname,o=void 0===r?"/":r,i=t.onNavigate,a=no(void 0===i?function(){}:i),l=h(function(){return ct({initialEntries:[(null==n?void 0:n.location.pathname)||o]})},[]);return w(function(){return null==n?void 0:n.listen(function(e){var t=e.action,n=e.location;"PUSH"===t&&l.push(n),"REPLACE"===t&&l.replace(n),a(e)})},[n]),{history:l}},EE=48,xE=Tn()(function(e){return{root:{display:"flex",flexDirection:"column",alignItems:"stretch",justifyContent:"stretch"},container:{position:"relative",overflow:"hidden",display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column",width:"100%",flex:1},header:{position:"absolute",top:0,left:0,marginLeft:0,height:"".concat(EE,"px"),width:"100%"},headerBg:{background:"dark"===e.palette.mode?ae(e.palette.background.paper,.06):$("#000",.05)},loader:{position:"absolute",top:44,height:"".concat(4,"px"),zIndex:2,left:0,width:"100%"},content:{flex:1,display:"flex",alignItems:"stretch",justifyContent:"stretch",overflowX:"hidden","& > *:nth-of-type(1)":{flex:1}},contentScroll:{overflowY:"auto"},adjust:{minHeight:EE,maxHeight:EE},tabsRoot:{minHeight:EE,height:EE,marginLeft:"0 !important",marginRight:"0 !important"},tabRoot:{minHeight:EE,height:EE},tabSelected:{},indicator:{height:"4px",background:"".concat(e.palette.primary.main," !important")}}}),CE=function(r){var o,i,c=r.className,u=r.style,s=r.sx,d=r.withScroll,m=r.outlinePaper,p=void 0!==m&&m,v=r.transparentPaper,E=void 0!==v&&v,x=r.transparentHeader,C=void 0!==x&&x,k=r.history,S=r.payload,L=void 0===S?{}:S,N=r.pathname,I=void 0===N?"/":N,M=r.tabs,R=r.routes,P=r.onTabChange;r.onLoadStart,r.onLoadEnd;var A=r.onSubmit,T=void 0===A?function(){return!0}:A,D=r.BeforeTabs,O=r.AfterTabs,F=r.BeforePaper,_=r.AfterPaper,B=r.fullScreen,H=r.onNavigate,W=r.otherProps,z=void 0===W?{}:W,V=l(r,["className","style","sx","withScroll","outlinePaper","transparentPaper","transparentHeader","history","payload","pathname","tabs","routes","onTabChange","onLoadStart","onLoadEnd","onSubmit","BeforeTabs","AfterTabs","BeforePaper","AfterPaper","fullScreen","onNavigate","otherProps"]),Y=yi(),U=Y.elementRef,q=Y.size,$=xE().classes,X=Fr(L),G=h(function(){return M.filter(function(e){var t=e.isVisible;return(void 0===t?function(){return!0}:t)(X)})},[]),K=wE({history:k,pathname:I,onNavigate:H}).history,Q=e(g(K.location.pathname),2),J=Q[0],Z=Q[1],ee=e(g(0),2),te=ee[0],ne=ee[1],re=e(g(0),2),oe=re[0],ie=re[1],ae=b(-1),le=h(function(){return Object.assign({size:q,loading:!!te,progress:oe,setLoading:function(e){ne(function(t){return Math.max(t+(e?1:-1),0)}),ie(0)},setProgress:function(e){ne(0),ie(e)}},z)},[q.height,q.width]);w(function(){return K.listen(function(e){var t=e.location;"REPLACE"===e.action&&(Z(t.pathname),ne(0),ie(0))})},[]);var ce=h(function(){var e=R.find(function(e){return(0,e.isActive)(J)});if(!e)return-1;var t=G.findIndex(function(t){var n=t.isMatch,r=void 0===n?function(){return!1}:n;return t.id===e.id||r(e.id)});return-1===t?ae.current:ae.current=t},[J]),ue=h(function(){var e;return null!==(e=G[ce])&&void 0!==e?e:null},[ce]),se=y(function(){return 100===oe?null:oe?f.createElement(De,{className:$.loader,value:oe,variant:"determinate"}):te?f.createElement(De,{className:$.loader,variant:"indeterminate"}):null},[te,oe]),de=no(function(e,r,o){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return te||oe&&100!==oe?[2,!1]:[4,T(e,r,o)];case 1:return[2,t.sent()]}})})}),fe=function(){return f.createElement(Tw,a({fullScreen:B,history:K,routes:R,otherProps:le,payload:X,onSubmit:de},V))};return(null==ue?void 0:ue.passthrough)?f.createElement(f.Fragment,null,fe()):f.createElement(j,{className:xo($.root,c),style:u,sx:s},F&&f.createElement(F,{activeTab:ue,history:K,payload:X}),f.createElement(oa,{className:$.container,outlinePaper:p,transparentPaper:E},f.createElement(lt,{variant:"scrollable",className:xo($.header,(o={},o[$.headerBg]=!C,o)),classes:{root:$.tabsRoot,indicator:$.indicator},value:ce,sx:{background:p||E?"transparent !important":"inherit"},onChange:function(e,t){P(G[t].id,K,X)}},D&&f.createElement(D,{activeTab:ue,history:K,payload:X}),G.map(function(e,t){var n=e.id,r=e.label,o=e.icon,i=e.passthrough;return f.createElement(at,{key:t,classes:{root:$.tabRoot,selected:$.tabSelected},sx:{display:i?"none":"inherit"},label:r||n,icon:o&&f.createElement(o,null)})}),O&&f.createElement(O,{activeTab:ue,history:K,payload:X})),se(),f.createElement("div",{className:$.adjust}),f.createElement(j,{ref:U,className:xo($.content,(i={},i[$.contentScroll]=d,i))},fe())),_&&f.createElement(_,{activeTab:ue,history:K,payload:X}))},kE=function(){return f.createElement(jw,{size:24,sx:{height:"100%",width:"100%"}})},SE=Tn()(function(e){return{root:{display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"},container:{position:"static",display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column",backgroundColor:e.palette.background.paper,padding:20,borderRadius:5},title:{display:"flex",justifyContent:"stretch",alignItems:"center",paddingBottom:15,color:e.palette.text.primary},content:{flex:1,display:"flex",alignItems:"stretch",justifyContent:"stretch",maxWidth:"100%",overflow:"hidden","& > *":{flex:1}},inner:{minHeight:"100% !important",maxHeight:"100% !important",border:"unset !important"},submit:{paddingTop:15},disabled:{opacity:.5,pointerEvents:"none"},stretch:{flex:1}}}),LE=function(){return{height:0,width:0,sx:{maxHeight:"80%",minWidth:"330px",maxWidth:"450px",margin:"10px"}}},NE=function(e){return{height:e.height-50,width:e.width-50}},IE=function(r){var o=r.withActionButton,i=void 0!==o&&o,c=r.hidden,u=void 0!==c&&c,s=r.onSubmit,d=void 0===s?function(){return!0}:s,m=r.onChange,p=void 0===m?function(){}:m,h=r.mapInitialData,v=void 0===h?function(){return{}}:h,y=r.mapPayload,E=void 0===y?function(){return{}}:y,x=r.onLoadStart,C=r.onLoadEnd,k=r.fallback,S=r.fullScreen,L=void 0===S||S,N=r.sizeRequest,I=void 0===N?L?NE:LE:N,M=r.reloadSubject,R=r.fetchState,P=void 0===R?function(){return{}}:R,A=r.AfterTitle,T=r.BeforeTitle,D=r.title,O=r.data,F=void 0===O?null:O,B=r.withStaticAction,H=void 0!==B&&B,W=r.throwError,z=void 0!==W&&W,V=r.submitLabel,Y=void 0===V?"Submit":V,U=r.submitIcon,q=r.waitForChangesDelay,$=void 0===q?H?0:1e3:q,X=r.openSubject,G=r.readonly,K=r.routes,Q=r.onMount,J=r.onUnmount,Z=r.onClose,ee=void 0===Z?function(){return null}:Z,te=l(r,["withActionButton","hidden","onSubmit","onChange","mapInitialData","mapPayload","onLoadStart","onLoadEnd","fallback","fullScreen","sizeRequest","reloadSubject","fetchState","AfterTitle","BeforeTitle","title","data","withStaticAction","throwError","submitLabel","submitIcon","waitForChangesDelay","openSubject","readonly","routes","onMount","onUnmount","onClose"]),ne=SE().classes,re=sw(X,!!X.data);Xr(function(){re||ee&&ee()},[re]);var oe=eg({compute:function(e){var t=I(e);return{height:t.height,width:t.width,sx:t.sx}},debounce:10}),ie=e(g(F),2),ae=ie[0],le=ie[1],ce=e(jr(0),2),ue=ce[0],se=ce[1],de=b({});w(function(){return Q&&Q(),function(){return J&&J()}},[]),w(function(){le(F)},[re]);var fe=function(e,t,n,r){de.current=n,le(e),p(e,t,n,r)},me=function(){se(function(e){return e+1}),x&&x()},pe=function(e){se(function(e){return e-1}),C&&C(e)},he=al([ae],10),ve=function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:if(ue.current)return[2];e=!0,n.label=1;case 1:return n.trys.push([1,3,4,5]),me(),[4,d(null,de.current)];case 2:return n.sent(),[3,5];case 3:if(t=n.sent(),e=!1,z)throw t;return k&&k(t),[3,5];case 4:return pe(e),[7];case 5:return[2]}})})};return f.createElement(Se,{className:ne.root,open:re,sx:a({},u&&{visibility:"hidden",opacity:0}),onClose:function(){re&&ve()}},f.createElement(j,{className:xo(ne.container,"outlet-modal__root"),sx:a({height:oe.height||void 0,width:oe.width||void 0},oe.sx)},D&&f.createElement("div",{className:ne.title},T&&f.createElement(T,{data:ae,onClose:ve}),f.createElement(_,{className:ne.stretch,variant:"h6",component:"h2"},D),A&&f.createElement(A,{data:ae,onClose:ve})),f.createElement(j,{className:ne.content},re&&f.createElement(Hg,{animation:"none",state:P,reloadSubject:M,fallback:k,onLoadStart:x,onLoadEnd:C,Loader:kE},function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return t(void 0,void 0,void 0,function(){var t,r,o,i,l;return n(this,function(n){switch(n.label){case 0:return r=(t=f).createElement,o=[CE],i=[{},te],l={fullScreen:L,className:ne.inner,routes:K,transparentPaper:!0,fallback:k,onLoadStart:x,onLoadEnd:C},[4,v(e.flat(1))];case 1:return l.initialData=n.sent(),[4,E(e.flat(1))];case 2:return[2,r.apply(t,o.concat([a.apply(void 0,i.concat([(l.payload=n.sent(),l.readonly=G,l.onChange=fe,l.onSubmit=d,l.otherProps={onClose:ve},l)]))]))]}})})})),!G&&i&&f.createElement(si,{className:ne.submit,disabled:!(H||!ue.current&&ae),size:"large",variant:"contained",color:"info",fullWidth:!0,startIcon:U&&f.createElement(U,null),onClick:function(){return t(void 0,void 0,void 0,function(){var e,r;return n(this,function(o){switch(o.label){case 0:if(ue.current)return[2];e=!0,o.label=1;case 1:return o.trys.push([1,4,5,6]),me(),[4,t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,Promise.race([he(),$n($)])];case 1:return e.sent(),[2]}})})];case 2:return o.sent(),[4,d(H?{}:ae,de.current)];case 3:return o.sent(),[3,6];case 4:if(r=o.sent(),e=!1,z)throw r;return k&&k(r),[3,6];case 5:return pe(e),[7];case 6:return[2]}})})}},Y)))},ME=function(e){var r=e.fallback;e.pathname;var o=e.history,i=e.fullScreen,c=void 0===i||i,u=e.onLoadEnd,s=e.onLoadStart,d=e.throwError,m=e.onChange,p=e.onSubmit,h=void 0===p?function(){return!0}:p,v=e.onMount,g=e.onUnmount,b=e.onClose,w=e.submitLabel,E=e.title,x=e.hidden,C=l(e,["fallback","pathname","history","fullScreen","onLoadEnd","onLoadStart","throwError","onChange","onSubmit","onMount","onUnmount","onClose","submitLabel","title","hidden"]),k=vw(),S=Fr(function(){return o||ct()}),L=no(h),N=y(function(e,r){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return[4,L(e,r)];case 1:return(t=n.sent())&&k.next(!1),[2,t]}})})},[]),I=y(function(){k.next(!1),b&&b()},[]),M=y(function(){return f.createElement(IE,a({openSubject:k,fullScreen:c,history:S,hidden:x,title:E,fallback:r,onChange:m,onLoadEnd:u,onMount:v,onClose:I,onUnmount:g,onLoadStart:s,submitLabel:w,throwError:d,onSubmit:N},C))},[x,r,m,u,s,N,w,d,E]),R=y(function(){k.next(!0)},[]);return{open:open,render:M,pickData:R,close:function(){return N(null,{})}}},RE=function(){return f.createElement(f.Fragment,null)},PE=function(r){var o=r.onDone,i=r.condition,c=r.Loader,u=void 0===c?RE:c,s=r.Content,d=void 0===s?RE:s,m=r.Error,p=void 0===m?RE:m,h=r.delay,v=void 0===h?1e3:h,b=r.totalAttempts,y=void 0===b?Number.POSITIVE_INFINITY:b,E=r.conditionMap,x=void 0===E?function(e){return!!e}:E,C=r.payload,k=l(r,["onDone","condition","Loader","Content","Error","delay","totalAttempts","conditionMap","payload"]),S=e(g({payload:C,attempt:0,initComplete:!1}),2),L=S[0],N=S[1];w(function(){return N({payload:C,attempt:0,initComplete:!0})},[C]);return L.initComplete?f.createElement(Zr,a({},k,{payload:L,Loader:u}),function(e){return t(void 0,[e],void 0,function(e){var t,r,l=e.payload,c=e.attempt;return n(this,function(e){switch(e.label){case 0:return[4,i()];case 1:return t=e.sent(),r={condition:t,attempt:c,payload:l},x(t)?(o&&o(c),[2,f.createElement(d,a({},r))]):c>y?[2,f.createElement(p,a({},r))]:(setTimeout(function(){return N(function(e){return a(a({},e),{attempt:e.attempt+1})})},v),[2,f.createElement(u,a({},r))])}})})}):null},AE=function(){return f.createElement(f.Fragment,null)},TE=function(r){var o=r.ping,i=r.children,a=r.onOnline,l=void 0===a?function(){return null}:a,c=r.onOffline,u=void 0===c?function(){return null}:c,s=r.Offline,d=void 0===s?AE:s,m=r.fallback,p=r.throwError,h=r.delay,v=void 0===h?5e3:h,b=r.payload,y=e(g({isOnline:!1,initComplete:!1}),2),E=y[0],x=y[1],C=function(e){x({initComplete:!0,isOnline:e}),e?l():u()};return w(function(){var e=null,r=!1,i=function(){return t(void 0,void 0,void 0,function(){var t,a;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,3,4]),[4,o(b)];case 1:return t=n.sent(),r?[2]:(C(!!t),[3,4]);case 2:if(a=n.sent(),!r&&C(!1),p)throw a;return m&&m(a),[3,4];case 3:return e=setTimeout(i,v),[7];case 4:return[2]}})})};return i(),function(){r=!0,null!==e&&clearTimeout(e)}},[b]),E.initComplete?E.isOnline?f.createElement(f.Fragment,null,i):f.createElement(d,null):null},DE=function(e,t){if("Sanitizer"in window){var n=new window.Sanitizer(t),r=document.createElement("div");return r.setHTML(e,{sanitizer:n}),r.innerHTML}return e},jE=function(o){var i=o.children,c=void 0===i?null:i,u=o.config,s=o.handler,d=o.fallback,m=o.onLoadStart,p=o.onLoadEnd,h=o.payload,v=o.deps,y=void 0===v?[]:v,x=o.throwError,C=l(o,["children","config","handler","fallback","onLoadStart","onLoadEnd","payload","deps","throwError"]),k=e(g(void 0),2),S=k[0],L=k[1],N=b(!0);return E(function(){return function(){N.current=!1}},[]),w(function(){t(void 0,void 0,void 0,function(){var e,t,r,o;return n(this,function(n){switch(n.label){case 0:e=!0,m&&m(),n.label=1;case 1:return n.trys.push([1,3,4,5]),r=DE,[4,s(h)];case 2:return t=r.apply(void 0,[n.sent(),u]),N.current&&L(t),[3,5];case 3:if(o=n.sent(),e=!1,x)throw o;return d&&d(o),[3,5];case 4:return p&&p(e),[7];case 5:return[2]}})})},r([h],e(y),!1)),f.createElement(f.Fragment,null,S?f.createElement(j,a({},C,{dangerouslySetInnerHTML:{__html:S}})):c)};jE.sanitize=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return DE.apply(void 0,r([],e(t),!1)).trim()};var OE=5e3,FE="GET",_E={url:"https://httpbin.org/get",method:FE,timeout:OE,interval:OE},BE=function(e){return t(void 0,[e],void 0,function(e){var t=e.url,r=e.timeout,o=void 0===r?OE:r,i=e.method,a=void 0===i?FE:i;return n(this,function(e){return[2,new Promise(function(e){var n=function(){return e(!1)},r=new XMLHttpRequest;r.onerror=n,r.ontimeout=n,r.onreadystatechange=function(){r.readyState===r.HEADERS_RECEIVED&&(r.status?e(!0):n())},r.open(a,t),r.timeout=o,r.send()})]})})},HE=function(r){var o=r.children,i=r.onOnline,l=r.onOffline,c=r.config,u=void 0===c?_E:c,s=r.withPolling,d=void 0!==s&&s,m=r.Offline,p=e(g({isOnline:!1,initComplete:!1}),2),h=p[0],v=p[1],b=function(e){return v(function(t){return a(a({},t),{isOnline:e})})};return w(function(){return v(function(){return{isOnline:"boolean"!=typeof navigator.onLine||navigator.onLine,initComplete:!0}}),function(e){var r=e.withPolling,o=e.config,i=e.onOnline,a=e.onOffline;if(r){var l=o.interval,c=void 0===l?OE:l,u=o.timeout,s=void 0===u?OE:u,d=o.method,f=void 0===d?FE:d,m=o.url,p=null,h=!1,v=function(){return t(void 0,void 0,void 0,function(){var e;return n(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,3,4]),[4,BE({url:m,timeout:s,method:f})];case 1:return e=t.sent(),h?[2]:(e?i():a(),[3,4]);case 2:return t.sent(),!h&&a(),[3,4];case 3:return p=setTimeout(v,c),[7];case 4:return[2]}})})};return v(),function(){h=!0,null!==p&&clearInterval(p)}}return window.addEventListener("online",i),window.addEventListener("offline",a),function(){window.removeEventListener("online",i),window.removeEventListener("offline",a)}}({onOnline:function(){b(!0),i&&i()},onOffline:function(){b(!1),l&&l()},config:u,withPolling:d})},[]),h.initComplete?m?h.isOnline?f.createElement(f.Fragment,null,o):f.createElement(m,null):f.createElement(f.Fragment,null,o):null},WE=Symbol("navigate-callback"),zE=function(e,t,n){return{type:jn.Group,isVisible:n,sx:{p:2},desktopColumns:"6",tabletColumns:"6",phoneColumns:"12",fields:[{type:jn.Typography,style:{whiteSpace:"nowrap",minWidth:"195px",overflow:"hidden",textOverflow:"ellipsis"},typoVariant:"h6",placeholder:e},{type:jn.Group,fields:t.map(function(e){var t=e.label;return function(e,t,n,r){return{type:jn.Component,desktopColumns:"6",tabletColumns:"12",phoneColumns:"12",fieldRightMargin:"1",fieldBottomMargin:"1",isVisible:r,element:function(r){var o=r.payload;return f.createElement(ke,{component:qt,onClick:function(){o[WE](e,o)},sx:{display:"flex",alignItems:"stretch",justifyContent:"stretch",width:"100%",background:function(e){return e.palette.primary.main},color:"white",fontWeight:"bold",fontSize:"18px",height:"75px",minHeight:"125px",textWrap:"wrap",padding:"16px","&:hover":{background:function(e){return oe(e.palette.primary.main,.23)}},"& > *:nth-of-type(1)":{flex:1},transition:"background 500ms"}},f.createElement(we,{direction:"row",alignItems:"center",gap:2},f.createElement(j,{flex:1}),n&&f.createElement(n,null),f.createElement(_,{textAlign:"center"},t),f.createElement(j,{flex:1})))}}}(e.to,t,e.icon,e.isVisible)})}]}},VE=function(e){var t=e.routes,n=e.data,r=e.payload,o=void 0===r?{}:r,i=e.onNavigate,l=void 0===i?function(){}:i,c=Fr(o),u=h(function(){return t.map(function(e){var t=e.label,n=e.routes,r=e.isVisible;return n?zE(t,n,r):function(e,t){return{type:jn.Component,isVisible:t,element:function(){return f.createElement(we,{direction:"row",alignItems:"center",gap:3,sx:{mt:3,mb:3}},f.createElement(_,{variant:"h4",fontWeight:"bold",sx:{opacity:.5}},e),f.createElement(H,{sx:{flex:1},orientation:"horizontal"}))}}}(t,r)})},[]),s=no(l);return f.createElement(yf,{fields:u,handler:function(){return n},payload:function(){var e;return a(((e={})[WE]=s,e),c)}})},YE=Tn()({root:{width:"100%"}}),UE=function(t){var n=t.children,r=t.className,o=t.style,i=t.animation,a=t.delay,l=void 0===a?0:a,c=t.appear,u=void 0===c||c,s=YE().classes,d=e(g(!1),2),m=d[0],p=d[1],h=b(!0);return E(function(){return function(){h.current=!1}},[]),w(function(){u&&$n(l).then(function(){h.current&&p(!0)})},[u]),f.createElement(_g,{className:xo(r,s.root),style:o,animation:i,appear:m},m&&f.createElement(f.Fragment,null,n))},qE=new Set([0,1,2,3,4,5,6,7,8,9]),$E={value:"",open:!1,approved:!1},XE=function(t){var n=t.className,r=t.style,o=t.sx,i=t.children,l=t.enabled,c=void 0===l||l,u=t.title,s=void 0===u?"Service menu":u,d=t.description,m=void 0===d?"Please type a secret\ncode to continue":d,p=t.digits,h=void 0===p?6:p,v=t.onCode,g=e(jr($E),2),b=g[0],y=g[1],E=function(){return y(a(a({},b.current),$E))};w(function(){c||E()},[c]);var x=function(e){return y(a(a({},b.current),{value:e}))},C=no(function(e){if(!b.current.approved&&c)if("Escape"!==e){if("Backspace"===e)return x(b.current.value.slice(0,Math.max(b.current.value.length-1,0))),void(b.current.value.length||E());var t,n=parseInt(e);if(qE.has(n))b.current.value||function(e){y(a(a({},b.current),{open:e}))}(!0),x("".concat(b.current.value).concat(n)),b.current.value.length===h&&(setTimeout(function(){v&&v(parseInt(b.current.value)),E()},500),t=!0,y(a(a({},b.current),{approved:t})))}else E()}),k=function(){b.current.approved||E()};return w(function(){var e=function(e){var t=!1;(t=(t=t||e.target===document.body)||b.current.open&&e.target.classList.contains("MuiDialog-container"))&&c&&C(e.key)};return document.body.addEventListener("keydown",e),function(){return document.body.removeEventListener("keydown",e)}},[]),f.createElement(f.Fragment,null,i,f.createElement(Wf,{className:n,style:r,sx:o,canCancel:!0,noSave:!0,open:b.current.open,onDismiss:k,onClose:k},f.createElement(mt,null,f.createElement(j,{mr:3},s)),f.createElement(j,{p:3,sx:{width:"100%",minWidth:"225px",minHeight:"75px",display:"flex",alignItems:"center",justifyContent:"center",whiteSpace:"nowrap"}},!!b.current.value&&f.createElement(j,null,f.createElement(_,{variant:"h4"},b.current.value),f.createElement(_,{component:"pre",variant:"body2",sx:{textAlign:"center"}},m)))))},GE=function(t){var n=e(t.split("_")),o=n[0],i=n.slice(1);return r(["".concat(o.charAt(0).toUpperCase()).concat(o.slice(1))],e(i),!1).join(" ")},KE=new Set([jn.Text,jn.Time,jn.Date,jn.Items,jn.Combo,jn.Checkbox,jn.Choose,jn.Complete,jn.Radio,jn.YesNo,jn.Switch,jn.Component,jn.Tree,jn.Phony]),QE=function(e,t){var n,r,o=void 0===t?{}:t,i=o.keyToTitle,a=void 0===i?function(e){return e}:i,l=o.ignore,u=void 0===l?function(){return!1}:l,s=[],d=function(e,t,n,r){if(!e)return"continue";if(u(e))return"continue";if(s.some(function(t){return t.value===e}))return"continue";if(KE.has(t)){var o=n||r||a(e);s.push({label:"".concat(o,", ").concat(String(Symbol.keyFor(t)||t)),value:e})}};try{for(var f=c(Ar(e)),m=f.next();!m.done;m=f.next()){var p=m.value;d(p.name,p.type,p.title,p.placeholder)}}catch(e){n={error:e}}finally{try{m&&!m.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}return s},JE=function(t){var n=t.changeSubject,r=t.outlinePaper,o=t.transparentPaper,i=t.className,l=t.style,u=t.sx,s=t.expandAll,d=t.readonly,m=t.onChange,p=t.groups,v=t.data,g=t.ignore,b=void 0===g?function(){return!1}:g,w=t.keyToTitle,E=void 0===w?GE:w,x=h(function(){return p.map(function(e,t){var n=e.fields,r=e.name,o=e.title,i=e.description,a=QE(n,{keyToTitle:E,ignore:b});return{type:jn.Expansion,fieldBottomMargin:t===p.length-1?"0":"1",expansionOpened:s,title:o||E(r),description:i,fields:a.map(function(e){var t=e.label,n=e.value;return{type:jn.Checkbox,readonly:d,name:"".concat(r,".").concat(n),title:"".concat(t," (").concat(n,")"),defaultValue:!1}})}})},[]),C=h(function(){return v?p.reduce(function(e,t){var n=t.name,r=t.fields,o=QE(r,{keyToTitle:E,ignore:b}),i=new Set(v[n]);return a(a({},e),o.reduce(function(e,t){var r,o,l=t.value;return(r={})[n]=a(a({},e[n]),((o={})[l]=i.has(l),o)),r},{}))},{}):{}},[v]),k=y(function(){return C},[v]),S=y(function(t,n){var r,o;if(!n){var i={};try{for(var a=c(Object.entries(t)),l=a.next();!l.done;l=a.next()){var u=e(l.value,2),s=u[0],d=u[1];i[s]=Object.entries(d).filter(function(t){return e(t,2)[1]}).map(function(t){return e(t,1)[0]})}}catch(e){r={error:e}}finally{try{l&&!l.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}m&&m(i)}},[]);return f.createElement(yf,{className:i,outlinePaper:r,transparentPaper:o,changeSubject:n,style:l,sx:u,handler:k,change:S,fields:x})},ZE=function(r){var o=r.groups,i=r.data,l=r.keyToTitle,u=void 0===l?GE:l,s=r.ignore,d=r.expandAll,f=r.readonly,m=r.fullScreen,p=r.fallback,v=r.onLoadStart,g=r.onLoadEnd,b=r.onSubmit,y=r.onChange,w=r.submitLabel,E=h(function(){return o.map(function(e,t){var n=e.fields,r=e.name,i=e.title,a=e.description,l=QE(n,{keyToTitle:u,ignore:s});return{type:jn.Expansion,fieldBottomMargin:t===o.length-1?"0":"1",expansionOpened:d,title:i||u(r),description:a,fields:l.map(function(e){var t=e.label,n=e.value;return{type:jn.Checkbox,name:"".concat(r,".").concat(n),readonly:f,title:"".concat(t," (").concat(n,")"),defaultValue:!1}})}})},[]),x=h(function(){return i?o.reduce(function(e,t){var n=t.name,r=t.fields,o=QE(r,{keyToTitle:u,ignore:s}),l=new Set(i[n]);return a(a({},e),o.reduce(function(e,t){var r,o,i=t.value;return(r={})[n]=a(a({},e[n]),((o={})[i]=l.has(i),o)),r},{}))},{}):{}},[i]);return ig({fullScreen:m,fallback:p,onLoadStart:v,onLoadEnd:g,handler:function(){return x},onSubmit:function(r){return t(void 0,void 0,void 0,function(){var t,o,i,a,l,u,s,d;return n(this,function(n){switch(n.label){case 0:if(!r)return[3,2];t={};try{for(o=c(Object.entries(r)),i=o.next();!i.done;i=o.next())a=e(i.value,2),l=a[0],u=a[1],t[l]=Object.entries(u).filter(function(t){return e(t,2)[1]}).map(function(t){return e(t,1)[0]})}catch(e){s={error:e}}finally{try{i&&!i.done&&(d=o.return)&&d.call(o)}finally{if(s)throw s.error}}return b?[4,b(t)]:[3,2];case 1:return[2,n.sent()];case 2:return[2,!0]}})})},onChange:function(t,n){var r,o;if(!n){var i={};try{for(var a=c(Object.entries(t)),l=a.next();!l.done;l=a.next()){var u=e(l.value,2),s=u[0],d=u[1];i[s]=Object.entries(d).filter(function(t){return e(t,2)[1]}).map(function(t){return e(t,1)[0]})}}catch(e){r={error:e}}finally{try{l&&!l.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}y&&y(i)}},submitLabel:w,transparentPaper:!0,payload:{readonly:f},fields:E})},ex=Tn()(function(e){return{root:{position:"relative",overflow:"hidden",display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column",width:"100%",minHeight:365},header:{position:"absolute",overflowX:"auto",top:0,left:0,height:"".concat(65,"px"),background:"dark"===e.palette.mode?ae(e.palette.background.paper,.06):$("#000",.05),padding:"0px !important",width:"100%"},firstStep:{paddingLeft:e.spacing(3)},lastStep:{paddingRight:e.spacing(3)},loader:{position:"absolute",top:61,height:"4px",zIndex:2,left:0,width:"100%"},content:{flex:1,display:"flex",alignItems:"stretch",justifyContent:"stretch",overflowX:"hidden","& > *:nth-of-type(1)":{flex:1}},contentScroll:{overflowY:"auto"},adjust:{minHeight:65,maxHeight:65}}}),tx=function(r){var o,i=r.className,c=r.style,u=r.sx,s=r.payload,d=void 0===s?{}:s,m=r.fullScreen,p=r.outlinePaper,v=void 0!==p&&p,E=r.transparentPaper,x=void 0!==E&&E,C=r.withScroll,k=r.history,S=r.pathname,L=void 0===S?"/":S,N=r.steps,I=r.routes;r.onLoadStart,r.onLoadEnd;var M=r.onNavigate,R=r.onSubmit,P=void 0===R?function(){return!0}:R,A=r.otherProps,T=void 0===A?{}:A,D=l(r,["className","style","sx","payload","fullScreen","outlinePaper","transparentPaper","withScroll","history","pathname","steps","routes","onLoadStart","onLoadEnd","onNavigate","onSubmit","otherProps"]),O=yi(),F=O.elementRef,_=O.size,B=Fr(d),H=h(function(){return N.filter(function(e){var t=e.isVisible;return(void 0===t?function(){return!0}:t)(B)})},[]),W=ex().classes,z=wE({history:k,pathname:L,onNavigate:M}).history,V=e(g(z.location.pathname),2),Y=V[0],U=V[1],q=e(g(0),2),$=q[0],X=q[1],G=e(g(0),2),K=G[0],Q=G[1],J=b(-1),Z=h(function(){return Object.assign({size:_,loading:!!$,progress:K,setLoading:function(e){X(function(t){return Math.max(t+(e?1:-1),0)}),Q(0)},setProgress:function(e){X(0),Q(e)}},T)},[_.height,_.width,$]);w(function(){return z.listen(function(e){var t=e.location;"REPLACE"===e.action&&(U(t.pathname),X(0),Q(0))})},[]);var ee=h(function(){var e=I.find(function(e){return(0,e.isActive)(Y)});if(!e)return-1;var t=H.findIndex(function(t){var n=t.isMatch,r=void 0===n?function(){return!1}:n;return t.id===e.id||r(e.id)});return-1===t?J.current:J.current=t},[Y]),te=h(function(){var e;return null!==(e=H[ee])&&void 0!==e?e:null},[ee]),ne=y(function(){return 100===K?null:K?f.createElement(De,{className:W.loader,value:K,variant:"determinate"}):$?f.createElement(De,{className:W.loader,variant:"indeterminate"}):null},[$,K]),re=no(function(e,r,o){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return $||K&&100!==K?[2,!1]:[4,P(e,r,o)];case 1:return[2,t.sent()]}})})}),oe=function(){return f.createElement(Tw,a({history:z,fullScreen:m,routes:I,otherProps:Z,payload:B,onSubmit:re},D))};return(null==te?void 0:te.passthrough)?f.createElement(f.Fragment,null,oe()):f.createElement(oa,{outlinePaper:v,transparentPaper:x,className:xo(W.root,i),style:c,sx:u},f.createElement(sn,{className:W.header,activeStep:ee,sx:{background:v||x?"transparent !important":"inherit"}},H.map(function(e,t){var n,r=e.id,o=e.label,i=e.icon,a=e.passthrough;return f.createElement(cn,{key:t,completed:ee>t,className:xo((n={},n[W.firstStep]=0===t,n[W.lastStep]=t===Math.max(H.length-1,0),n)),sx:{display:a?"none":"inherit"}},f.createElement(un,{StepIconComponent:i},o||r))})),ne(),f.createElement("div",{className:W.adjust}),f.createElement(j,{ref:F,className:xo(W.content,(o={},o[W.contentScroll]=C,o))},oe()))},nx=Tn()(function(e){return{root:{display:"flex",justifyContent:"stretch",alignItems:"center",flexDirection:"row",padding:e.spacing(1),gap:e.spacing(1)},stretch:{flex:1}}}),rx=function(e){var t=e.className,n=e.style,r=e.sx,o=e.disabled,i=e.fallback,c=e.onLoadStart,u=e.onLoadEnd,s=e.onPrev,d=e.onNext,m=e.AfterPrev,p=e.BeforeNext,h=e.hasPrev,v=void 0!==h&&h,g=e.hasNext,b=void 0!==g&&g,y=e.labelPrev,w=void 0===y?"Prev":y,E=e.labelNext,x=void 0===E?"Next":E,C=e.throwError,k=l(e,["className","style","sx","disabled","fallback","onLoadStart","onLoadEnd","onPrev","onNext","AfterPrev","BeforeNext","hasPrev","hasNext","labelPrev","labelNext","throwError"]),S=nx().classes,L=di({onLoadStart:c,onLoadEnd:u,disabled:o}),N=L.handleLoadStart,I=L.handleLoadEnd,M=L.loading;return f.createElement(j,a({className:xo(t,S.root),style:n,sx:r},k),f.createElement(si,{disabled:M||!v,onClick:s,variant:"contained",fallback:i,onLoadStart:N,onLoadEnd:I,throwError:C},w),m&&f.createElement(m,null),f.createElement("div",{className:S.stretch}),p&&f.createElement(p,null),f.createElement(si,{disabled:M||!b,onClick:d,variant:"contained",fallback:i,onLoadStart:N,onLoadEnd:I,throwError:C},x))},ox=Tn()({root:{display:"flex",height:"100%",width:"100%",justifyContent:"stretch",alignItems:"stretch",flexDirection:"column"},container:{flex:1}}),ix=x(function(e,t){var n=e.className,r=e.Navigation,o=e.children,i=l(e,["className","Navigation","children"]),c=ox().classes;return f.createElement(j,a({ref:t,className:xo(n,c.root)},i),f.createElement("div",{className:c.container},o),r)}),ax=function(){return f.createElement(jw,{size:24,sx:{height:"100%",width:"100%"}})},lx=Tn()(function(e){return{root:{display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"},container:{position:"static",display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column",backgroundColor:e.palette.background.paper,padding:20,borderRadius:5},title:{display:"flex",justifyContent:"stretch",alignItems:"center",paddingBottom:15,color:e.palette.text.primary},content:{flex:1,display:"flex",alignItems:"stretch",justifyContent:"stretch",maxWidth:"100%",overflow:"hidden","& > *":{flex:1}},inner:{minHeight:"100% !important",maxHeight:"100% !important",border:"unset !important"},submit:{paddingTop:15},disabled:{opacity:.5,pointerEvents:"none"},stretch:{flex:1}}}),cx=function(){return{height:0,width:0,sx:{maxHeight:"80%",minWidth:"330px",maxWidth:"450px",margin:"10px"}}},ux=function(e){return{height:e.height-50,width:e.width-50}},sx=function(r){var o=r.withActionButton,i=void 0!==o&&o,c=r.hidden,u=void 0!==c&&c,s=r.onSubmit,d=void 0===s?function(){return!0}:s,m=r.onChange,p=void 0===m?function(){}:m,h=r.mapInitialData,v=void 0===h?function(){return{}}:h,y=r.mapPayload,E=void 0===y?function(){return{}}:y,x=r.onLoadStart,C=r.onLoadEnd,k=r.fallback,S=r.fullScreen,L=void 0===S||S,N=r.sizeRequest,I=void 0===N?L?ux:cx:N,M=r.reloadSubject,R=r.fetchState,P=void 0===R?function(){return{}}:R,A=r.AfterTitle,T=r.BeforeTitle,D=r.title,O=r.data,F=void 0===O?null:O,B=r.throwError,H=void 0!==B&&B,W=r.withStaticAction,z=void 0!==W&&W,V=r.waitForChangesDelay,Y=void 0===V?z?0:1e3:V,U=r.submitLabel,q=void 0===U?"Submit":U,$=r.submitIcon,X=r.openSubject,G=r.readonly,K=r.routes,Q=r.onMount,J=r.onUnmount,Z=r.onClose,ee=void 0===Z?function(){return null}:Z,te=l(r,["withActionButton","hidden","onSubmit","onChange","mapInitialData","mapPayload","onLoadStart","onLoadEnd","fallback","fullScreen","sizeRequest","reloadSubject","fetchState","AfterTitle","BeforeTitle","title","data","throwError","withStaticAction","waitForChangesDelay","submitLabel","submitIcon","openSubject","readonly","routes","onMount","onUnmount","onClose"]),ne=lx().classes,re=sw(X,!!X.data);Xr(function(){re||ee&&ee()},[re]);var oe=eg({compute:function(e){var t=I(e);return{height:t.height,width:t.width,sx:t.sx}},debounce:10}),ie=e(g(F),2),ae=ie[0],le=ie[1],ce=e(jr(0),2),ue=ce[0],se=ce[1],de=b({});w(function(){return Q&&Q(),function(){return J&&J()}},[]),w(function(){le(F)},[re]);var fe=function(e,t,n,r){de.current=n,le(e),p(e,t,n,r)},me=function(){se(function(e){return e+1}),x&&x()},pe=function(e){se(function(e){return e-1}),C&&C(e)},he=al([ae],10),ve=function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:if(ue.current)return[2];e=!0,n.label=1;case 1:return n.trys.push([1,3,4,5]),me(),[4,d(null,de.current)];case 2:return n.sent(),[3,5];case 3:if(t=n.sent(),e=!1,H)throw t;return k&&k(t),[3,5];case 4:return pe(e),[7];case 5:return[2]}})})};return f.createElement(Se,{className:ne.root,open:re,sx:a({},u&&{visibility:"hidden",opacity:0}),onClose:function(){re&&ve()}},f.createElement(j,{className:xo(ne.container,"outlet-modal__root"),sx:a({height:oe.height||void 0,width:oe.width||void 0},oe.sx)},D&&f.createElement("div",{className:ne.title},T&&f.createElement(T,{data:ae,onClose:ve}),f.createElement(_,{className:ne.stretch,variant:"h6",component:"h2"},D),A&&f.createElement(A,{data:ae,onClose:ve})),f.createElement(j,{className:ne.content},re&&f.createElement(Hg,{animation:"none",state:P,reloadSubject:M,fallback:k,onLoadStart:x,onLoadEnd:C,Loader:ax},function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return t(void 0,void 0,void 0,function(){var t,r,o,i,l;return n(this,function(n){switch(n.label){case 0:return r=(t=f).createElement,o=[tx],i=[{},te],l={fullScreen:L,className:ne.inner,routes:K,transparentPaper:!0,fallback:k,onLoadStart:x,onLoadEnd:C},[4,v(e.flat(1))];case 1:return l.initialData=n.sent(),[4,E(e.flat(1))];case 2:return[2,r.apply(t,o.concat([a.apply(void 0,i.concat([(l.payload=n.sent(),l.readonly=G,l.onChange=fe,l.onSubmit=d,l.otherProps={onClose:ve},l)]))]))]}})})})),!G&&i&&f.createElement(si,{className:ne.submit,startIcon:$&&f.createElement($,null),disabled:!(z||!ue.current&&ae),size:"large",variant:"contained",color:"info",fullWidth:!0,onClick:function(){return t(void 0,void 0,void 0,function(){var e,r;return n(this,function(o){switch(o.label){case 0:if(ue.current)return[2];e=!0,o.label=1;case 1:return o.trys.push([1,4,5,6]),me(),[4,t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,Promise.race([he(),$n(Y)])];case 1:return e.sent(),[2]}})})];case 2:return o.sent(),[4,d(z?{}:ae,de.current)];case 3:return o.sent(),[3,6];case 4:if(r=o.sent(),e=!1,H)throw r;return k&&k(r),[3,6];case 5:return pe(e),[7];case 6:return[2]}})})}},q)))},dx=function(e){var r=e.fallback;e.pathname;var o=e.history,i=e.fullScreen,c=void 0===i||i,u=e.onLoadEnd,s=e.onLoadStart,d=e.throwError,m=e.onChange,p=e.onSubmit,h=void 0===p?function(){return!0}:p,v=e.onMount,g=e.onUnmount,b=e.onClose,w=e.submitLabel,E=e.title,x=e.hidden,C=l(e,["fallback","pathname","history","fullScreen","onLoadEnd","onLoadStart","throwError","onChange","onSubmit","onMount","onUnmount","onClose","submitLabel","title","hidden"]),k=vw(),S=Fr(function(){return o||ct()}),L=no(h),N=y(function(e,r){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return[4,L(e,r)];case 1:return(t=n.sent())&&k.next(!1),[2,t]}})})},[]),I=y(function(){k.next(!1),b&&b()},[]),M=y(function(){return f.createElement(sx,a({openSubject:k,fullScreen:c,history:S,hidden:x,title:E,fallback:r,onChange:m,onLoadEnd:u,onMount:v,onClose:I,onUnmount:g,onLoadStart:s,submitLabel:w,throwError:d,onSubmit:N},C))},[x,r,m,u,s,N,w,d,E]),R=y(function(){k.next(!0)},[]);return{open:open,render:M,pickData:R,close:function(){return N(null,{})}}},fx=function(t){function n(){var n=t.apply(this,r([],e(arguments),!1))||this;return n.element=null,n}return u(n,t),n.prototype.componentWillUnmount=function(){this.element&&document.body.removeChild(this.element),this.element=null},n.prototype.render=function(){return this.element||(this.element=document.createElement("div"),document.body.appendChild(this.element)),z.createPortal(this.props.children,this.element)},n}(f.Component),mx=function(t){var n=[],r=0,o=function(t,i){return void 0===i&&(i=""),t.forEach(function(t){var a=e(t,2),l=a[0],c=a[1],u="".concat(i,".").concat(String(l));Bn(c)?(n.push({path:u,name:String(l),value:"",deepIndex:r}),r+=1,o(Object.entries(c),u)):(n.push({path:u,name:String(l),value:String(c),deepIndex:r}),r+=1)})};return o(Object.entries(t),"root"),n},px=function(t){var n=e(t.split("_")),o=n[0],i=n.slice(1);return r(["".concat(o.charAt(0).toUpperCase()).concat(o.slice(1))],e(i),!1).join(" ")},hx=p(null),vx=function(t){var n=t.children,r=t.search,o=void 0===r?"":r,i=t.withExpandAll,l=void 0!==i&&i,c=t.withExpandRoot,u=void 0!==c&&c,s=t.withExpandLevel,d=void 0===s?0:s,m=t.expandList,p=t.data,v=t.onSearchChanged,b=void 0===v?function(){}:v,E=t.formatSearch,x=void 0===E?function(){return""}:E,C=no(b),k=y(function(){return mx(p).map(function(e){var t=e.path;return t.startsWith("root.")?t.slice(5):t}).filter(function(e){return"root"!==e}).filter(function(e){var t=zn(p,e);return Bn(t)})},[p]),S=y(function(){return mx(p).map(function(e){var t=e.path;return t.startsWith("root.")?t.replace("root.",""):t}).filter(function(e){return"root"!==e}).filter(function(e){var t=zn(p,e),n=!0;return n=(n=n&&Bn(t))&&!e.includes(".")})},[p]),L=y(function(){return mx(p).map(function(e){var t=e.path;return t.startsWith("root.")?t.replace("root.",""):t}).filter(function(e){return"root"!==e}).filter(function(e){var t=zn(p,e),n=!0;return n=(n=n&&Bn(t))&&function(e){var t;return(null===(t=e.match(/\./g))||void 0===t?void 0:t.length)||0}(e)<=d,n})},[p,d]),N=y(function(){return l?k():u?S():d?L():m?m.map(function(e){return e.startsWith("root.")?e.replace("root.",""):e}):[]},[l,u,d,k,S,L,m]),I=e(g(function(){return{checked:new Set(N()),data:p,search:o}}),2),M=I[0],R=I[1],P=Vr(M);w(function(){!P.current.search&&m&&R(function(e){return a(a({},e),{checked:new Set(N())})})},[m]),w(function(){var e,t,n={},r=mx(p),o=new Set(r.filter(function(e){var t,n,r,o,i=e.name,a=e.value,l=e.path;return t=x(i,a,l),n=M.search,r=String(n||"").toLowerCase().split(" "),o=String(t).toLowerCase().split(" "),r.every(function(e){return o.some(function(t){return t.includes(e)})})}).map(function(e){var t=e.path;return t.startsWith("root.")?t.replace("root.",""):t}).join(".").split(".")),i=r.map(function(e){var t=e.value,n=e.path,r=e.name;return{path:n.startsWith("root.")?n.replace("root.",""):n,value:t,name:r}}).filter(function(e){var t,n,r,i=e.value,a=e.path,l=e.name,c=M.search.toLowerCase(),u=!1;return u=(u=(u=(u=u||i.toLowerCase().includes(c))||a.toLowerCase().includes(c))||o.has(l))||px((t=a,n=".",r=" ",t.split(n).join(r))).toLowerCase().includes(c)}).flatMap(function(e){return function(e){for(var t=e,n=[e];t.includes(".");)t=t.slice(0,t.lastIndexOf(".")),n.push(t);return n}(e.path)});(e=i,t=[],new Set(e).forEach(function(e){return t.push(e)}),t).filter(function(e){return"root"!==e}).forEach(function(e){var t=zn(p,e);Bn(t)||(Dr(n,e),Wn(n,e,t))}),R(function(e){return a(a({},e),{data:n})})},[M.search,p]),w(function(){C(M.search)},[M.search,C]);var A=y(function(e){return R(function(t){return a(a({},t),{search:e})})},[]),T=y(function(e){var t=e.startsWith("root.")?e.replace("root.",""):e;return M.checked.has(t)},[M.checked]),D=y(function(e,t){var n=e.startsWith("root.")?e.replace("root.",""):e;t?M.checked.add(n):M.checked.delete(n),R(function(e){return a(a({},e),{checked:new Set(M.checked)})})},[M.checked]),j=h(function(){return{data:M.data,search:M.search,setSearch:A,isChecked:T,setIsChecked:D}},[M,T,A,D]);return f.createElement(hx.Provider,{value:j},n)},gx=function(){var e=v(hx),t=e.search,n=l(e,["search"]);return a({isSearching:!!t,search:t},n)},bx=Tn()(function(e){return{label:{display:"flex",cursor:"pointer",color:e.palette.primary.main},stretch:{flex:1}}}),yx=function(t){var n=t.children,r=t.title,o=t.checked,i=t.onCheck,c=t.BeforeLabel,u=t.AfterLabel,s=l(t,["children","title","checked","onCheck","BeforeLabel","AfterLabel"]),d=bx().classes,m=e(g(!1),2),p=m[0],h=m[1];w(function(){void 0!==o&&h(o)},[o]);return f.createElement(j,a({},s),f.createElement(we,{direction:"row",alignItems:"center",justifyContent:"stretch",gap:1},c&&f.createElement(c,null),f.createElement(j,{className:d.label,role:"none",onClick:function(){var e=!p;i&&i(e),h(e)}},f.createElement("strong",null,r||"Show details")," ",f.createElement(Pe,null)),f.createElement("div",{className:d.stretch}),u&&f.createElement(u,null)),f.createElement(Dt,{in:p},n))},wx=Tn()(function(e,t){var n=t.background,r=void 0===n?e.palette.background.default:n;return{key:{borderRadius:"4px","&:hover":{background:$(e.palette.getContrastText(r),.02)}},keyBlack:{background:$(e.palette.getContrastText(r),.05)},keyWhite:{backgroundColor:r}}}),Ex=function(e){var t,n,r=e.formatValue,o=e.formatKey,i=e.keyWidth,a=e.valueWidth,l=e.totalWidth,c=e.value,u=e.itemKey,s=e.path,d=e.index,m=e.background,p=e.withDarkParent,v=void 0!==p&&p,g=wx({background:m}).classes,b=h(function(){return r(u,"string"==typeof c||"number"==typeof c||"boolean"==typeof c?c:null,s.startsWith("root.")?s.replace("root.",""):s)},[u,s,c,r]);return f.createElement(U,{container:!0,columns:l,sx:{pt:2,pb:2},className:xo(g.key,v?(t={},t[g.keyBlack]=d%2!=0,t[g.keyWhite]=d%2==0,t):(n={},n[g.keyBlack]=d%2==0,n[g.keyWhite]=d%2!=0,n))},f.createElement(U,{item:!0,xs:i},f.createElement(_,{variant:"body1",sx:{ml:1,overflow:"hidden"}},o(u,s))),f.createElement(U,{item:!0,zeroMinWidth:!0,xs:a},f.createElement(_,{sx:{whiteSpace:"break-spaces",overflowWrap:"break-word",textOverflow:"ellipsis",fontWeight:"bold"},variant:"body1"},function(e){return null==e||void 0===e||""===e||"null"===e?"—":"boolean"==typeof e?String(e):e.toString().startsWith("http")?f.createElement("a",{href:e.toString(),target:"_blank",rel:"noreferrer",style:{wordBreak:"break-all"}},e):f.isValidElement(e)?e:Bn(e)?f.createElement("pre",null,JSON.stringify(e,null,2)):e}(b))))},xx="react-declarative__recordView_never_value",Cx=function(){return f.createElement(_,{variant:"body1"},"Empty")},kx=function(){return f.createElement(f.Fragment,null)},Sx=Tn()(function(e,t){var n=t.background,r=void 0===n?e.palette.background.default:n;return{group:{borderRadius:"4px"},groupKey:{textDecoration:"underline",height:"100%"},groupBlack:{background:$(e.palette.getContrastText(r),.05)},groupWrite:{backgroundColor:r}}}),Lx=function(t){var n=t.path,r=void 0===n?"root":n,o=t.data,i=t.keyWidth,c=t.valueWidth,u=t.totalWidth,s=t.formatValue,d=t.formatKey,m=t.payload,p=t.BeforeCollapseLabel,v=void 0===p?kx:p,b=t.AfterCollapseLabel,E=void 0===b?kx:b,x=t.withDarkParent,C=void 0!==x&&x,k=t.background,S=t.itemKey,L=t.EmptyItem,N=void 0===L?Cx:L,I=t.CustomItem,M=void 0===I?Ex:I,R=l(t,["path","data","keyWidth","valueWidth","totalWidth","formatValue","formatKey","payload","BeforeCollapseLabel","AfterCollapseLabel","withDarkParent","background","itemKey","EmptyItem","CustomItem"]),P=Sx({background:k}).classes,A=gx(),T=A.isSearching,D=A.isChecked,j=A.setIsChecked,O=e(g(D(r)),2),F=O[0],B=O[1];w(function(){j(r,F)},[r,F]);var H=h(function(){return function(){return f.createElement(v,{itemKey:S,payload:m,path:r})}},[r]),W=h(function(){return function(){return f.createElement(E,{itemKey:S,payload:m,path:r})}},[r]),z=y(function(){return Object.entries(o).map(function(t,n){var o,l=e(t,2),p=l[0],h=l[1],g="".concat(r,".").concat(p);return p===xx?f.createElement(N,null):Bn(h)?f.createElement(U,{key:g,container:!0,columns:u,className:xo(P.group,(o={},o[P.groupBlack]=n%2==0,o[P.groupWrite]=n%2!=0,o))},f.createElement(U,{item:!0,xs:i},f.createElement(_,{sx:{mt:3,ml:1,overflow:"hidden"},className:P.groupKey,variant:"body1"},d(p,g))),f.createElement(U,{item:!0,xs:c,sx:{mt:3,mb:3}},f.createElement(Lx,a({background:k,withDarkParent:n%2==0,formatValue:s,formatKey:d,data:h,keyWidth:i,payload:m,itemKey:p,valueWidth:c,totalWidth:u,BeforeCollapseLabel:v,AfterCollapseLabel:E,EmptyItem:N,CustomItem:M,path:g},R)))):f.createElement(M,a({background:k,withDarkParent:C,formatValue:s,formatKey:d,key:g,path:g,itemKey:p,value:h,index:n,keyWidth:i,valueWidth:c,totalWidth:u},R))})},[P,o,r,R,i,c,u,C,s,d,k]);return"root"===r?f.createElement(f.Fragment,null,z()):f.createElement(yx,{checked:F||T,onCheck:function(e){T||B(e)},BeforeLabel:H,AfterLabel:W},z())},Nx=Tn()({root:{position:"relative",maxWidth:"100%"},beforeSearch:{width:"calc(100% - 10px)",margin:"5px",marginBottom:"0px",display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *":{flex:1}},afterSearch:{width:"calc(100% - 10px)",margin:"5px",marginTop:"0px",display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *":{flex:1}}}),Ix=function(e){var t=e.formatValue,n=e.formatKey,r=e.keyWidth,o=e.valueWidth,i=e.totalWidth,c=e.background,u=e.BeforeSearch,s=e.AfterSearch,d=e.BeforeCollapseLabel,m=e.AfterCollapseLabel,p=e.EmptyItem,h=e.CustomItem,v=e.payload,g=e.className,b=e.style,y=e.sx,w=l(e,["formatValue","formatKey","keyWidth","valueWidth","totalWidth","background","BeforeSearch","AfterSearch","BeforeCollapseLabel","AfterCollapseLabel","EmptyItem","CustomItem","payload","className","style","sx"]),E=Nx().classes,x=gx(),C=x.data,k=x.search,S=x.isSearching,L=x.setSearch,N=sb();return f.createElement(j,a({className:xo(g,E.root),style:b,sx:y},w),u&&f.createElement(j,{className:E.beforeSearch},f.createElement(u,{payload:v})),f.createElement(xe,a({fullWidth:!0,sx:{mb:1},variant:"standard",onChange:function(e){var t=e.target;return L(t.value.toString())},value:k,placeholder:"Search",InputProps:{autoComplete:"off",endAdornment:f.createElement(Le,{position:"end"},f.createElement("div",{style:{marginRight:-10}},f.createElement(Ne,{onClick:function(){return L("")}},S?f.createElement(Fe,null):f.createElement(ot,null))))},name:"search",type:"text"},N)),s&&f.createElement(j,{className:E.afterSearch},f.createElement(s,{payload:v})),0===Object.keys(C).length&&f.createElement(_,{variant:"body1"},"Nothing found"),f.createElement(Lx,{data:C,payload:v,formatValue:t,formatKey:n,keyWidth:r,valueWidth:o,totalWidth:i,background:c,EmptyItem:p,CustomItem:h,itemKey:"root",BeforeCollapseLabel:d,AfterCollapseLabel:m}))},Mx=function(t,n){void 0===n&&(n="Records");var o,i=dn.utils.aoa_to_sheet((o=function(t,n){return void 0===n&&(n=[]),Object.entries(t).forEach(function(t){var i=e(t,2),a=i[0],l=i[1],c=px(a);if(Bn(l)||Array.isArray(l)){var u=o(l);n.push([c]),u.forEach(function(t){n.push(r([""],e(t),!1))})}else n.push([c,String(l)])}),n},o(t))),a=dn.utils.book_new();dn.utils.book_append_sheet(a,i,n);var l=dn.write(a,{type:"array",bookType:"xlsx"}),c=new Blob([l],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),u=URL.createObjectURL(c),s=document.createElement("a");s.href=u,s.download="".concat(n,".xlsx"),s.style.display="none",document.body.appendChild(s),s.addEventListener("click",function(){return queueMicrotask(function(){URL.revokeObjectURL(u)})},{once:!0}),s.click()},Rx=function(t){var n=function(t,r){return void 0===r&&(r={}),Object.entries(t||{}).forEach(function(t){var o,i=e(t,2),a=i[0],l=i[1];Array.isArray(l)?r[a]=n((o=l,Object.fromEntries(Object.entries(o).map(function(t){var n=e(t,2),r=n[0],o=n[1];return["Item ".concat(parseFloat(r)+1),o]})))):Bn(l)?r[a]=n(l):r[a]=l}),r};return n(t)},Px=function(e){var t=e.data,n=void 0===t?{}:t,r=e.search,o=void 0===r?"":r,i=e.onSearchChanged,c=e.formatValue,u=void 0===c?function(e,t){return t}:c,s=e.formatKey,d=void 0===s?function(e){return"".concat(px(e),": ")}:s,m=e.formatSearch,p=e.withExpandAll,v=void 0!==p&&p,g=e.withExpandRoot,b=void 0!==g&&g,y=e.withExpandLevel,w=void 0===y?0:y,E=e.expandList,x=e.keyWidth,C=void 0===x?2:x,k=e.valueWidth,S=void 0===k?10:k,L=e.totalWidth,N=e.background,I=e.BeforeSearch,M=e.AfterSearch,R=e.BeforeCollapseLabel,P=e.AfterCollapseLabel,A=e.payload,T=e.className,D=e.style,j=e.sx,O=e.EmptyItem,F=e.CustomItem,_=l(e,["data","search","onSearchChanged","formatValue","formatKey","formatSearch","withExpandAll","withExpandRoot","withExpandLevel","expandList","keyWidth","valueWidth","totalWidth","background","BeforeSearch","AfterSearch","BeforeCollapseLabel","AfterCollapseLabel","payload","className","style","sx","EmptyItem","CustomItem"]),B=h(function(){return Rx(n)},[n]);return f.createElement(vx,{search:o,data:B,withExpandAll:v,withExpandRoot:b,withExpandLevel:w,formatSearch:m,expandList:E,onSearchChanged:i},f.createElement(Ix,a({formatValue:u,formatKey:d,EmptyItem:O,CustomItem:F,keyWidth:C,valueWidth:S,totalWidth:L,background:N,BeforeSearch:I,AfterSearch:M,BeforeCollapseLabel:R,AfterCollapseLabel:P,payload:A,className:T,style:D,sx:j},_)))};Px.excelExport=Mx;var Ax,Tx,Dx=function(e){var t=e.appName;return f.createElement(_,{variant:"h2",color:"primary",width:"100%",textAlign:"center",fontWeight:"bold",sx:{textStroke:"2px #fff",WebkitTextStroke:"2px #fff"}},t)},jx=Tn()(function(e){return{root:{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:9999,background:e.palette.background.default,height:"100%",width:"100%",display:"flex",alignItems:"center",flexDirection:"column",gap:15,padding:15},container:{minWidth:375,maxWidth:375,padding:15},reveal:{width:"unset !important"}}}),Ox=function(){var e=window.location,t=e.href,n=e.origin;if("file:"!==e.protocol){var r=new URL(t,n);r.pathname="/",r.search="",r.hash="",window.location.href=r.toString()}else window.location.reload()},Fx=f.createElement(f.Fragment,null,"It looks like this app finished with uncaught exception",f.createElement("br",null),"Please reload this page and try again"),_x=function(e){var t=e.appName,n=void 0===t?"AppName":t,r=e.Logo,o=void 0===r?Dx:r,i=e.className,a=e.style,l=e.sx,c=e.buttonLabel,u=void 0===c?"Reload page":c,s=e.contentLabel,d=void 0===s?Fx:s,m=e.onButtonClick,p=void 0===m?Ox:m,h=jx().classes;return f.createElement(fx,null,f.createElement(j,{className:xo(h.root,i),style:a,sx:l},f.createElement(UE,{className:h.reveal},f.createElement(ke,{className:h.container},f.createElement(we,{direction:"column",gap:"15px"},f.createElement(o,{appName:n}),f.createElement("span",null,d),f.createElement(ye,{variant:"contained",onClick:p},u))))))},Bx=function(e){var t=e.appName;return f.createElement(_,{variant:"h2",color:"primary",width:"100%",textAlign:"center",fontWeight:"bold",sx:{textStroke:"2px #fff",WebkitTextStroke:"2px #fff"}},t)},Hx=Tn()(function(e){return{root:{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:9999,background:e.palette.background.default,height:"100%",width:"100%",display:"flex",alignItems:"center",flexDirection:"column",gap:15,padding:15},container:{minWidth:375,maxWidth:375,padding:15},reveal:{width:"unset !important"},beforeSubmit:{width:"100%",display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *":{flex:1},marginBottom:"-10px"},afterSubmit:{width:"100%",display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *":{flex:1},marginTop:"-10px"}}}),Wx=[{type:jn.Text,fieldRightMargin:"0",fieldBottomMargin:"1",title:"Login",name:"login",description:"Your login",placeholder:"tripolskypetr",isInvalid:function(e){return e.login?null:"Login should not be empty"}},{type:jn.Text,fieldRightMargin:"0",fieldBottomMargin:"0",title:"Password",name:"password",description:"Your password",placeholder:"password",inputType:"password",isInvalid:function(e){return e.password?null:"Password should not be empty"}}],zx=function(r){var o=r.className,i=r.style,a=r.sx,l=r.appName,c=void 0===l?"AppName":l,u=r.Logo,s=void 0===u?Bx:u,d=r.fields,m=void 0===d?Wx:d,p=r.onLoadStart,h=r.onLoadEnd,v=r.throwError,b=r.handler,y=r.fallback,w=r.isBaseline,E=r.isBaselineForRoot,x=r.onAuth,C=void 0===x?function(){}:x,k=r.BeforeSubmit,S=r.AfterSubmit,L=Hx().classes,N=no(function(e){return t(void 0,void 0,void 0,function(){var t,r;return n(this,function(n){switch(n.label){case 0:if(!e)return[2];t=!0,n.label=1;case 1:return n.trys.push([1,3,4,5]),p&&p(),[4,C(e)];case 2:return n.sent(),[3,5];case 3:if(r=n.sent(),t=!1,v)throw r;return y&&y(r),[3,5];case 4:return h&&h(t),[7];case 5:return[2]}})})});return f.createElement(fx,null,f.createElement(j,{className:xo(L.root,o),style:i,sx:a},f.createElement(UE,{className:L.reveal},f.createElement(ke,{className:L.container},f.createElement(we,{direction:"column",gap:"15px"},f.createElement(s,{appName:c}),f.createElement(function(){var r=e(g(null),2),o=r[0],i=r[1];return f.createElement(f.Fragment,null,f.createElement(yf,{sx:{pt:1,pb:1},handler:b,fields:m,onChange:function(e){i(e)},onInvalid:function(){i(null)},onLoadStart:p,onLoadEnd:h,fallback:y,isBaseline:w,isBaselineForRoot:E}),k&&f.createElement("div",{className:L.beforeSubmit},f.createElement(k,{data:o,onAuth:N})),f.createElement(si,{disabled:!o,variant:"contained",onClick:function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,N(o)];case 1:return[2,e.sent()]}})})},onLoadStart:p,onLoadEnd:h,fallback:y},"Sign in"),S&&f.createElement("div",{className:L.afterSubmit},f.createElement(S,{data:o,onAuth:N})))},null))))))},Vx=p(null),Yx=function(e){var t=e.children,n=e.value;return f.createElement(Vx.Provider,{value:n},t)},Ux=function(){return v(Vx)},qx=p(null),$x=function(e){var t=e.value,n=e.children;return f.createElement(qx.Provider,{value:t},n)},Xx=function(){return v(qx)},Gx=p(null),Kx=function(e){var t=e.children,n=e.value,r=Fr(n);return f.createElement(Gx.Provider,{value:r},t)},Qx=function(){return v(Gx)},Jx=p(null),Zx=function(t){var n=t.children,o=Ux(),i=o.state,a=o.action,l=e(g(function(){return new Map}),2),c=l[0],u=l[1],s=no(function(e){var t=new Set(i.selectedIds),n=new Map(c);t.has(e)?(t.delete(e),n.delete(e)):(t.add(e),n.set(e,i.items.find(function(t){return t.id===e}))),a.setSelectedIds(t),u(n)}),d=no(function(){a.setSelectedIds(new Set),u(new Map)}),m=h(function(){return{selectedItems:r([],e(c.values()),!1),toggleSelection:s,dropSelection:d}},[c]);return f.createElement(Jx.Provider,{value:m},n)},eC=function(){return v(Jx)},tC=Tn()({root:{display:"flex",alignItems:"center",justifyContent:"stretch",maxWidth:"100%",overflowY:"auto",gap:15},operations:{flex:1},disabled:{pointerEvents:"none",opacity:.5}}),nC=function(t){var n,r=t.className,o=t.style,i=t.sx,c=t.disabled,u=e(g(!1),2),s=u[0],d=u[1],m=tC().classes,p=Ux(),h=p.state,v=p.action,b=eC().selectedItems,y=Qx(),w=Xx(),E=w.operations,x=void 0===E?[]:E,C=w.fallback,k=w.onLoadStart,S=void 0===k?function(){}:k,L=w.onLoadEnd,N=void 0===L?function(){}:L,I=w.onOperation,M=void 0===I?function(){}:I,R=w.throwError,P=void 0!==R&&R;return f.createElement(j,{className:xo(m.root,r),style:o,sx:i},f.createElement(lw,{className:xo(m.operations,(n={},n[m.disabled]=c,n)),actions:x.map(function(e){var t=e.isAvailable,n=void 0===t?function(){return!0}:t,r=l(e,["isAvailable"]);return a({isAvailable:function(){return n(b,h.isAllSelected,y)}},r)}),deps:[y,b,h.isAllSelected],onAction:function(e){return M(e,b,h.isAllSelected)},onLoadStart:function(){d(!0),S()},onLoadEnd:function(e){d(!1),N(e)},fallback:C,throwError:P}),f.createElement(ge,{disabled:s||c,control:f.createElement(ve,{disabled:s,value:h.isAllSelected,onChange:function(){return v.setIsAllSelected(!h.isAllSelected)}}),label:"All items"}))},rC=Tn()(function(e){return{root:{display:"flex",alignItems:"stretch",justifyContent:"stretch",minHeight:225},container:{flex:1,position:"relative",overflow:"hidden",display:"flex",alignItems:"stretch",justifyContent:"stretch",paddingTop:5,paddingBottom:5,marginBottom:5,paddingLeft:15,paddingRight:15},header:{position:"absolute",top:0,left:0,right:0,height:45,width:"100%",background:ae(e.palette.background.paper,.06),display:"flex",alignItems:"center",justifyContent:"stretch"},content:{flex:1,display:"flex",flexDirection:"column",alignItems:"stretch"},inner:{display:"grid",gridRowGap:"10px",gridColumnGap:"10px",paddingTop:45,paddingBottom:15},innerPhone:{gridTemplateColumns:"1fr"},innerTablet:{gridTemplateColumns:"1fr 1fr"},innerDesktop:{gridTemplateColumns:"1fr 1fr 1fr"},media:{width:"100%"},mediaPhone:{gridColumnStart:1,gridColumnEnd:2},mediaTablet:{gridColumnStart:1,gridColumnEnd:3},mediaDesktop:{gridColumnStart:1,gridColumnEnd:4},textWrap:{whiteSpace:"break-spaces",overflowWrap:"break-word",textOverflow:"ellipsis",fontWeight:"bold"},titleLabel:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"calc(100% - 80px)"},opacity:{opacity:.6},stretch:{flex:1}}}),oC=x(function(t,n){var o,i,c=t.item,u=t.className,s=t.style,d=t.sx,m=l(t,["item","className","style","sx"]),p=rC().classes,v=Ux(),g=v.state,b=v.action,w=Qx(),E=Xx(),x=E.cardActions,C=E.pickFields,k=E.fallback,S=E.onLoadStart,L=E.onLoadEnd,N=E.formatMedia,I=void 0===N?function(){}:N,M=E.formatKey,R=void 0===M?function(t){return function(t){var n=e(t.split("_")),o=n[0],i=n.slice(1);return r(["".concat(o.charAt(0).toUpperCase()).concat(o.slice(1))],e(i),!1).join(" ")}(String(t))}:M,P=E.formatValue,A=void 0===P?function(e,t){return null==(n=t)||void 0===n||""===n||"null"===n?"—":"boolean"==typeof n?String(n):n.toString().startsWith("http")?f.createElement("a",{href:n.toString(),target:"_blank",rel:"noreferrer",style:{wordBreak:"break-all"}},n):f.isValidElement(n)?n:Bn(n)?f.createElement("pre",null,JSON.stringify(n,null,2)):n;var n}:P,T=E.formatCardLabel,D=void 0===T?function(e){var t=e.id;return"Id: ".concat(t)}:T,O=E.onCardClick,F=void 0===O?function(){}:O,B=E.onAction,H=void 0===B?function(){}:B,W=E.throwError,z=void 0!==W&&W,V=nl(),Y=V.isPhone,U=V.isTablet,q=V.isDesktop,$=eC().toggleSelection,X=h(function(){var t=Object.entries(c);return C&&t.filter(function(t){var n=e(t,1)[0];return C.includes(n)}),t},[C]),G=h(function(){return I(c)},[c]),K=y(function(){g.menuOpened||F(c)},[g,c,F]);return f.createElement(j,a({ref:n,className:xo(u,p.root),style:s,sx:d},m),f.createElement(ke,{className:xo(p.container)},f.createElement(j,{className:p.header},f.createElement(ve,{onClick:function(){return $(c.id)},checked:g.selectedIds.has(c.id)}),f.createElement(_,{className:p.titleLabel,variant:"body1"},D(c)),f.createElement("div",{className:p.stretch}),!!(null==x?void 0:x.length)&&f.createElement(Ca,{transparent:!0,options:x.map(function(e){var t=e.isDisabled,n=void 0===t?function(){return!1}:t,r=e.isVisible,o=void 0===r?function(){return!0}:r,i=l(e,["isDisabled","isVisible"]);return a(a({},i),{isVisible:function(){return o(c,w)},isDisabled:function(){return n(c,w)}})}),onToggle:b.setMenuOpened,onAction:function(e){return H(e,c)},fallback:k,payload:c,onLoadStart:S,onLoadEnd:L,throwError:z,sx:{color:"inherit"},deps:[w]})),f.createElement(j,{className:p.content,onClick:K},f.createElement(j,{className:xo(p.inner,(o={},o[p.innerPhone]=Y,o[p.innerTablet]=U,o[p.innerDesktop]=q,o))},!!G&&f.createElement(j,{className:xo(p.media,(i={},i[p.mediaPhone]=Y,i[p.mediaTablet]=U,i[p.mediaDesktop]=q,i))},G),X.map(function(t,n){var r=e(t,2),o=r[0],i=r[1];return f.createElement(we,{className:p.textWrap,key:"".concat(o,"-").concat(n)},f.createElement(_,{className:p.opacity,variant:"caption"},R(o)),f.createElement(_,{variant:"body1"},A(o,i)))})))))}),iC=Tn()({root:{display:"flex",alignItems:"center",gap:10,minHeight:35,maxHeight:35}}),aC=function(){var e=iC().classes,t=Ux().state,n=eC().dropSelection;return f.createElement(j,{className:e.root},!!t.selectedIds.size&&f.createElement(f.Fragment,null,f.createElement(_,{variant:"body1"},"Selected: ".concat(gm(t.selectedIds.size,{one:"item",many:"items"}))),f.createElement(Qt,{href:"#",onClick:n},"Deselect")))},lC=function(t){var n=t.disabled,r=Ux(),o=r.state,i=r.action,l=e(g(o.search),2),c=l[0],u=l[1],s=Gr(c),d=sb();return w(function(){var e=Zn(function(e){i.setSearch(e)},1e3),t=s.subscribe(e);return function(){e.clear(),t()}},[s]),f.createElement(xe,a({variant:"standard",onChange:function(e){var t=e.target;return u(t.value.toString())},disabled:n,value:c,placeholder:"Search",InputProps:{autoComplete:"off",endAdornment:f.createElement(Le,{position:"end"},f.createElement("div",{style:{marginRight:-10}},f.createElement(Ne,{onClick:function(){return!o.loading&&u("")}},o.search&&!o.loading?f.createElement(Fe,null):o.loading?null:f.createElement(ot,null),o.loading&&f.createElement(O,{size:24}))))},name:"search",type:"text"},d))},cC=Tn()({root:{position:"relative",display:"flex",flexDirection:"column",alignItems:"stretch",justifyContent:"stretch",width:"100%"},container:{flex:1,display:"flex",flexDirection:"column",alignItems:"stretch",justifyContent:"stretch",gap:5},content:{flex:1},placeholder:{display:"flex",justifyContent:"center"}}),uC=function(o){var i=o.className,l=o.style,u=o.sx,s=o.operations,d=o.handler,m=o.reloadSubject,p=o.scrollXSubject,v=o.scrollYSubject,b=o.onLoadStart,E=o.onLoadEnd,x=o.fallback,C=o.skipStep,k=void 0===C?25:C,S=o.noSearch,L=void 0!==S&&S,N=o.noFooter,I=void 0!==N&&N,M=o.throwError,R=void 0!==M&&M,P=o.payload,A=cC().classes,T=e(g(function(){return{items:[],loading:!1,hasMore:!0,search:"",skip:0,isAllSelected:!1,menuOpened:!1,selectedIds:new Set}}),2),D=T[0],O=T[1],F=y(function(e){return O(function(t){return a(a({},t),{loading:e})})},[]),B=_r(m),H=_r(v),W=no(function(o){return t(void 0,void 0,void 0,function(){var t,i,l,u;return n(this,function(n){switch(n.label){case 0:if(D.loading)return[2];if(!D.hasMore&&!o)return[2];o&&(O(function(e){return a(a({},e),{items:[]})}),H.next(0)),t=!0,n.label=1;case 1:return n.trys.push([1,5,6,7]),b&&b(),F(!0),"function"!=typeof d?[3,3]:(i=o?0:D.skip,[4,d(D.search,i)]);case 2:return l=n.sent(),O(function(t){var n,o,u=new Map(t.items.map(function(e){return[e.id,e]}));try{for(var s=c(l),d=s.next();!d.done;d=s.next()){var f=d.value;u.has(f.id)&&u.set(f.id,f)}}catch(e){n={error:e}}finally{try{d&&!d.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}var m=l.filter(function(e){var t=e.id;return!u.has(t)});return a(a({},t),{skip:i+k,hasMore:m.length>=k,items:r(r([],e(u.values()),!1),e(m),!1)})}),[3,4];case 3:O(function(e){return a(a({},e),{items:d,hasMore:!1})}),n.label=4;case 4:return[3,7];case 5:if(u=n.sent(),t=!1,R)throw u;return x&&x(u),[3,7];case 6:return E&&E(t),F(!1),[7];case 7:return[2]}})})});Xr(function(){W(!0)},[D.search]),w(B.subscribe(function(){W(!0)}),[B]);var z=h(function(){return{state:D,action:{setSearch:function(e){return O(function(t){return a(a({},t),{skip:0,search:e})})},setIsAllSelected:function(e){return O(function(t){return a(a({},t),{isAllSelected:e})})},setSelectedIds:function(e){return O(function(t){return a(a({},t),{selectedIds:e})})},setMenuOpened:function(e){return O(function(t){return a(a({},t),{menuOpened:e})})}}}},[D]);return f.createElement($x,{value:o},f.createElement(Kx,{value:P},f.createElement(Yx,{value:z},f.createElement(Zx,null,f.createElement(j,{className:xo(i,A.root),style:l,sx:u},f.createElement(j,{className:A.container},!L&&f.createElement(lC,{disabled:D.loading}),!!(null==s?void 0:s.length)&&f.createElement(nC,{disabled:D.loading}),f.createElement(gi,{className:A.content,loading:D.loading,hasMore:D.hasMore,onDataRequest:W,scrollXSubject:p,scrollYSubject:H,minRowHeight:225},!D.items.length&&f.createElement(_,{className:A.placeholder},D.loading?"Loading":"Nothing found"),D.items.map(function(e,t){return f.createElement(oC,{key:"".concat(e.id,"-").concat(t),item:e})})),!I&&f.createElement(aC,null)))))))},sC=(Ax=e(xr(),2))[0],dC=Ax[1],fC=jw.createLoader(12),mC=Tn()(function(e){return{header:{display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column",paddingLeft:e.spacing(.5),paddingRight:e.spacing(.5)},row:{display:"flex",alignItems:"center",justifyContent:"space-between"},chip:{maxWidth:150}}}),pC=function(r){var o=r.id,i=r.payload,a=r.column,l=r.columns,c=r.data,u=r.disabled,s=r.reloadSubject,d=r.withGoBack,m=r.withHeaderTooltip,p=r.label,v=void 0===p?a:p,b=r.onChangeColumn,E=r.onCardLabelClick,x=r.fallback,C=r.onLoadEnd,k=r.onLoadStart,S=r.throwError,L=mC().classes,N=dC(),I=Jr(),M=I.reloadTrigger,R=I.doReload,P=e(Sc(function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,N(o,function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return"function"!=typeof v?[3,2]:[4,v(o,c,i)];case 1:return[2,e.sent()];case 2:return[2,v]}})})})];case 1:return[2,e.sent()]}})})},{onLoadStart:k,onLoadEnd:C,fallback:x,throwError:S,deps:[c,a,M]}),1),A=P[0];w(function(){return s.subscribe(R)},[]);var T=e(g(null),2),D=T[0],O=T[1],F=e(g(null),2),_=F[0],H=F[1],z=h(function(){var e=l.findIndex(function(e){return e.column===a});return l.filter(function(t,n){return n<e}).reverse()},[a]),V=h(function(){var e=l.findIndex(function(e){return e.column===a});return l.filter(function(t,n){return n>e})},[a]),Y=y(function(){return null===A?f.createElement(fC,null):m?f.createElement(Nt,{title:A},f.createElement(He,{className:L.chip,color:"primary",onClick:E?function(){return E(o,c,i)}:void 0,label:A})):f.createElement(He,{className:L.chip,color:"primary",onClick:E?function(){return E(o,c,i)}:void 0,label:A})},[A]);return f.createElement(j,{className:L.header},f.createElement(j,{className:L.row},f.createElement(Ne,{onClick:function(e){var t=e.currentTarget;O(t),H(null)},disabled:!d||!z.length||u,size:"small"},f.createElement(Xe,null)),f.createElement(W,{anchorEl:D,open:!!D,onClose:function(){return O(null)}},z.map(function(e,t){return f.createElement(B,{key:"".concat(e,"-").concat(t),onClick:function(){b(o,e.column,c,i),O(null)}},e.label||e.column)})),Y(),f.createElement(Ne,{onClick:function(e){var t=e.currentTarget;O(null),H(t)},disabled:!V.length||u,size:"small"},f.createElement(Ge,null)),f.createElement(W,{anchorEl:_,open:!!_,onClose:function(){return H(null)}},V.map(function(e,t){return f.createElement(B,{key:"".concat(e,"-").concat(t),onClick:function(){b(o,e.column,c,i),H(null)}},e.label||e.column)}))))},hC=Tn()(function(e){return{table:{display:"grid",gridTemplateColumns:"fit-content(130px) 1fr",maxWidth:"255px","& > *":{display:"flex",alignItems:"center",justifyContent:"stretch",whiteSpace:"nowrap",padding:5,borderBottom:"1px solid ".concat($(e.palette.getContrastText(e.palette.background.default),.23)),"& > *":{flex:1},overflow:"hidden"}},row:{display:"flex",alignItems:"center",justifyContent:"space-between"},noBorder:{border:"none !important"},bold:{fontWeight:"bold !important"},link:{color:e.palette.primary.main,cursor:"pointer",textDecoration:"underline"}}}),vC=function(e){var t=e.id,n=e.data,r=e.payload,o=e.rows,i=hC().classes;return f.createElement(j,{className:i.table},o.map(function(e,a){var l,c=xo(((l={})[i.noBorder]=a===o.length-1,l));return f.createElement(f.Fragment,null,f.createElement(_,{className:c,paddingRight:"20px",variant:"body2"},e.label),function(e,o){var a=e.value,l=e.click;return l?f.createElement(_,{className:xo(i.link,o),onClick:function(){return l(t,n,r)}},a):f.createElement(_,{className:xo(i.bold,o)},a)}(e,c))}))},gC=(Tx=e(xr(),2))[0],bC=Tx[1],yC=Tn()(function(e){return{container:{position:"relative",display:"flex",alignItems:"stretch",justifyContent:"stretch",flex:1},content:{display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column",overflow:"hidden",paddingTop:e.spacing(.5),paddingBottom:e.spacing(.5),maxWidth:255,flex:1}}}),wC=function(r){var o=r.id,i=r.column,a=r.label,l=r.columns,c=r.reloadSubject,u=r.rows,s=r.withGoBack,d=r.withHeaderTooltip,m=r.data,p=r.fallback,h=r.onLoadEnd,v=r.onLoadStart,g=r.throwError,b=r.disabled,y=r.onChangeColumn,E=r.onCardLabelClick,x=r.payload,C=r.AfterCardContent,k=yC().classes,S=Jr(),L=S.reloadTrigger,N=S.doReload,I=bC(),M=e(Sc(function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,I(o,m,u)];case 1:return[2,e.sent()]}})})},{onLoadStart:v,onLoadEnd:h,fallback:p,throwError:g,deps:[m,i,L]}),1),R=M[0];w(function(){return c.subscribe(N)},[]);return f.createElement(ke,{className:k.container},f.createElement(j,{className:k.content},R?f.createElement(f.Fragment,null,f.createElement(pC,{reloadSubject:c,withGoBack:s,withHeaderTooltip:d,id:o,column:i,data:m,columns:l,disabled:b,onChangeColumn:y,onCardLabelClick:E,onLoadStart:v,onLoadEnd:h,fallback:p,throwError:g,payload:x,label:a}),f.createElement(vC,{id:o,payload:x,rows:R,data:m}),C&&f.createElement(C,{id:o,data:m,payload:x})):f.createElement(jw,{sx:{flex:1},size:48})))},EC=Tn()({root:{display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column"},stretch:{flex:1,display:"flex",alignItems:"stretch",justifyContent:"stretch"},adjust:{maxHeight:10,minHeight:10}}),xC=x(function(e,t){var n=e.className,r=e.style,o=e.disabled,i=e.id,c=e.onDrag,u=l(e,["className","style","disabled","id","onDrag"]),s=EC().classes;return f.createElement(j,{className:xo(s.root,n),style:r,ref:t},f.createElement("div",{className:s.stretch,"data-cardid":i,onDrag:function(){o||c(i)},draggable:o?"false":"true"},f.createElement(wC,a({id:i,disabled:o},u))),f.createElement("div",{className:s.adjust}))}),CC=Symbol("never"),kC=function(t,n){var o=void 0===n?{}:n,i=o.key,a=void 0===i?function(){return CC}:i,l=o.timeout,u=void 0===l?250:l,s=Hi(a,function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];return{value:t.apply(void 0,r([],e(n),!1)),ttl:Date.now()}}),d=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=Date.now(),i=s.apply(void 0,r([],e(t),!1)),l=i.value;if(o-i.ttl>u){var c=a(t);return s.clear(c),d.apply(void 0,r([],e(t),!1))}return l};return d.clear=function(e){s.clear(e)},d.gc=function(){var t,n,r=s[Bi]();try{for(var o=c(r.entries()),i=o.next();!i.done;i=o.next()){var a=e(i.value,2),l=a[0],d=a[1];Date.now()-d.current.ttl>u&&s.clear(l)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}},d.add=function(e,t){return s.add(e,{value:t,ttl:Date.now()})},d.remove=s.remove,d},SC=Tn()(function(e){var t;return{root:(t={display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column",minHeight:"100%",width:"100%"},t["& .".concat(tm)]={"& > div > div":{marginBottom:e.spacing(2)}},t),container:{position:"relative",flex:1,display:"flex",alignItems:"stretch",justifyContent:"stretch"},content:{flex:1,display:"flex"},group:{position:"relative",overflow:"hidden",display:"flex",alignItems:"stretch",justifyContent:"stretch",maxWidth:"276px",minWidth:"276px",marginRight:10,borderRadius:"6px"},groupWrapper:{flex:1,padding:10,marginTop:45},groupHeader:{position:"absolute",paddingLeft:12,top:0,left:0,height:"45px",width:"100%",background:e.palette.background.paper,display:"flex",alignItems:"center",justifyContent:"stretch",gap:8},activeGroup:{background:"".concat(e.palette.primary.main," !important")},list:{flex:1,minWidth:"256px",height:"100%"},disabled:{pointerEvents:"none",cursor:"not-allowed"},divider:{padding:"2.5px",marginRight:"15px",marginLeft:"5px",background:e.palette.action.hover}}}),LC=function(o,i){var u,s=o.reloadSubject,d=o.withUpdateOrder,m=o.columns,p=o.className,v=o.payload,y=void 0===v?{}:v,E=o.disabled,x=void 0!==E&&E,C=o.items,k=o.style,S=o.sx,L=o.deps,N=void 0===L?[]:L,I=o.withGoBack,R=void 0!==I&&I,P=o.withHeaderTooltip,A=void 0!==P&&P,T=o.filterFn,D=void 0===T?function(){return!0}:T,O=o.cardLabel,F=void 0===O?function(e){return e}:O,B=o.bufferSize,H=void 0===B?15:B,W=o.minRowHeight,z=void 0===W?125:W,V=o.rowTtl,Y=void 0===V?500:V,U=o.AfterCardContent,q=o.AfterColumnTitle,X=o.BeforeColumnTitle,G=o.onDataRequest,K=o.onChangeColumn,Q=o.onCardLabelClick,J=o.onLoadStart,Z=o.onLoadEnd,ee=o.fallback,te=o.throwError,ne=_r(s),re=yi(),oe=re.elementRef,ie=re.size,le=e(g(null),2),ce=le[0],ue=le[1],se=b(null),de=SC().classes,fe=M(),me=Fr(y),pe=Fr(m),he=h(function(){return pe.filter(function(e){return!e.divider})},[pe]),ve=h(function(){return kC(function(e,r,o){return t(void 0,void 0,void 0,function(){return n(this,function(i){switch(i.label){case 0:return[4,Promise.all(o.map(function(o){return t(void 0,void 0,void 0,function(){var t,i,c,u,s=o.value,d=o.visible,f=l(o,["value","visible"]);return n(this,function(n){switch(n.label){case 0:return"function"!=typeof d?[3,2]:[4,d(e,r,me)];case 1:return i=n.sent(),[3,3];case 2:i=void 0===d||!!d,n.label=3;case 3:return(t=i)?"function"!=typeof s?[3,5]:[4,s(e,r,me)]:[3,7];case 4:return u=n.sent(),[3,6];case 5:u=s,n.label=6;case 6:return c=u,[3,8];case 7:c=void 0,n.label=8;case 8:return[2,a({visible:t,value:c},f)]}})})}))];case 1:return[2,i.sent().filter(function(e){return e.visible})]}})})},{key:function(t){return e(t,1)[0]},timeout:Y})},[]),ge=h(function(){return kC(function(e,r){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,r()];case 1:return[2,e.sent()]}})})},{key:function(t){return e(t,1)[0]},timeout:Y})},[]);w(function(){G&&G(!0)},[]),w(function(){return pr.fromEvent("visibilitychange").connect(function(){"visible"===document.visibilityState&&G&&G(!1)})},[]),w(function(){return pr.fromInterval(45e3).connect(function(){ve.gc(),ge.gc()})},[]),w(function(){return ne.subscribe(function(){ve.clear(),ge.clear()})},[]);var be=h(function(){var e,t,n=new Map,r=C.filter(D);d&&r.sort(function(e,t){var n=e.updatedAt,r=void 0===n?Sl():n,o=t.updatedAt,i=void 0===o?Sl():o;return Ue(r).isBefore(i)?1:-1});var o=function(e){var t=r.filter(function(t){return t.column===e});n.set(e,t)};try{for(var i=c(he),a=i.next();!a.done;a=i.next()){o(a.value.column)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return n},r([C],e(N),!1));w(function(){ve.clear(),ge.clear()},r([be],e(N),!1));var ye=h(function(){return he.map(function(e){return e.column})},[]),we=h(function(){return"dark"===fe.palette.mode?ae(fe.palette.background.paper,.06):$("#000",.1)},[]);return f.createElement(gC,{payload:ve},f.createElement(sC,{payload:ge},f.createElement(j,{ref:i,className:xo(de.root,p,(u={},u[de.disabled]=x,u)),style:k,sx:S},f.createElement(j,{ref:oe,className:de.container},f.createElement(rm,{withScrollbar:!0,hideOverflowY:!0,className:de.content},pe.map(function(t,n){var o,i,c=t.divider,u=l(t,["divider"]);if(c)return f.createElement(j,{key:"divider-".concat(n),className:xo("react-declarative__kanbanDivider",de.divider),sx:{height:ie.height}});var s=u,d=s.column,m=s.rows,p=s.label,h=s.color,v=void 0===h?we:h,g=be.get(d)||[];return f.createElement(j,{key:"".concat(d,"-").concat(n),onDrop:function(){var e=C.find(function(e){return e.id===se.current});if(e){var t=ye.indexOf(e.column),n=ye.indexOf(d),r=!0;if(r=(r=r&&!R)&&t>n)return;if(t===n)return;ue(null),ge.clear(se.current),ve.clear(se.current),K&&K(se.current,d,e.data,me),se.current=null}},onDragEnd:function(){ue(null)},onDragOver:function(e){ue(d),e.preventDefault()},className:de.group},f.createElement(j,{className:de.groupHeader},f.createElement(j,{className:xo((o={},o[de.activeGroup]=ce===d,o)),sx:{borderRadius:"50%",height:"12px",width:"12px",background:v}}),X&&f.createElement(X,{column:d,payload:me}),f.createElement(_,{variant:"h6",fontWeight:"bold",sx:{opacity:.6,fontSize:"16px",flex:1}},p||String(d)),q&&f.createElement(q,{column:d,payload:me})),f.createElement(j,{className:xo(de.groupWrapper,(i={},i[de.activeGroup]=ce===d,i)),sx:{background:v}},f.createElement(gi,{bufferSize:H,className:de.list,minRowHeight:z},g.map(function(t){return f.createElement(xC,a({reloadSubject:ne,withGoBack:R,withHeaderTooltip:A,payload:me,key:t.id,onChangeColumn:function(t){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];ge.clear(t),ve.clear(t),K&&K.apply(void 0,r([t],e(n),!1))},onDrag:function(){se.current=t.id},disabled:x,columns:he,rows:m,label:t.label||F,AfterCardContent:U,onCardLabelClick:Q,onLoadStart:J,onLoadEnd:Z,fallback:ee,throwError:te},t))}))))}))))))};LC.enableScrollOnDrag=function(e,t){var n=void 0===t?{}:t,r=n.threshold,o=void 0===r?200:r,i=n.speed,a=void 0===i?15:i;return function(){var t,n=null===(t=e.current)||void 0===t?void 0:t.querySelector(".".concat(tm));if(!n)return console.warn("KanbanViewInternal enableScrollOnDrag ref is undefined"),function(){};var r=!1,i=0,l=pr.create(function(e){return document.addEventListener("dragover",e),function(){return document.removeEventListener("dragover",e)}}),c=pr.create(function(e){var t=function(t){return void 0===t&&(t=!0),function(){return e(t)}},n=t(!1),r=t(!0);return document.body.addEventListener("dragstart",r),document.body.addEventListener("dragend",n),function(){document.body.removeEventListener("dragend",n),document.body.removeEventListener("dragstart",r)}}),u=pr.create(function(e){var t=null,l=function(){if(r){var t=n.getBoundingClientRect(),l=t.left,c=t.right;i<l+o?e(Math.max(n.scrollLeft-a,0)):i>c-o&&e(n.scrollLeft+a)}},u=c.connect(function(e){t&&clearInterval(t),e&&(t=setInterval(l,10))});return qn(function(){return t&&clearInterval(t)},u)}),s=l.connect(function(e){i=e.clientX}),d=c.connect(function(e){r=e}),f=pr.create(function(e){return document.addEventListener("touchstart",e,{passive:!0}),function(){return document.removeEventListener("touchstart",e)}}),m=u.connect(function(e){n.scrollLeft=e}),p=qn(s,d,m),h=f.connect(p);return qn(p,h)}};var NC=x(LC);NC.enableScrollOnDrag=LC.enableScrollOnDrag;var IC,MC=function(t){function n(){var n=t.apply(this,r([],e(arguments),!1))||this;return n.doSubscribe=function(){n._disconnectListener&&n._disconnectListener(),n._disconnectListener=n.props.reloadTrigger.subscribe(function(){n.forceUpdate()})},n.componentDidMount=function(){n.doSubscribe()},n.componentDidUpdate=function(){n.doSubscribe()},n.componentWillUnmount=function(){n._disconnectListener&&n._disconnectListener()},n.render=function(){return f.createElement(f.Fragment,null,n.props.children)},n}return u(n,t),n}(f.Component);!function(e){e.Boolean="boolean-feature",e.Number="number-feature"}(IC||(IC={}));var RC,PC,AC=IC,TC=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return e.some(function(e){return e instanceof Promise})?new Promise(function(r,o){return t(void 0,void 0,void 0,function(){var t,i,a;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,Promise.all(e)];case 1:return t=n.sent(),i=t.reduce(function(e,t){return Boolean(e||t)},!1),r(i),[3,3];case 2:return a=n.sent(),o(a),[3,3];case 3:return[2]}})})}):e.reduce(function(e,t){return Boolean(e||t)},!1)},DC=function(e,t){var n=t.defaultValue,r=t.label,o=t.name,i=t.isDisabled,a=void 0===i?function(){return!1}:i,l=t.isVisible,c=t.map;return e===AC.Number?{type:jn.Div,style:{display:"inline-grid",gridTemplateColumns:"1fr 58px",alignItems:"center",width:"100%"},fields:[{type:jn.Component,element:function(e){return f.createElement(_,{variant:"body1",style:{opacity:e.payload.readonly||e[o]?1:.5}},r)}},{type:jn.Text,fieldRightMargin:"0",fieldBottomMargin:"0",sx:{"& input":{fontWeight:"bold",textAlign:"center"}},isInvalid:function(e){return""===e[o]?"Required":null},inputFormatterAllowed:/^[0-9]/,inputFormatterTemplate:"00000",name:o,placeholder:"0",defaultValue:n,title:""}]}:{type:jn.Div,style:{display:"inline-grid",gridTemplateColumns:"1fr auto",alignItems:"center",width:"100%"},fields:[{type:jn.Component,element:function(e){return f.createElement(_,{variant:"body1",style:{opacity:e.payload.readonly||e[o]?1:.5}},r)}},{type:jn.Switch,defaultValue:n,isDisabled:function(e,t){return TC(a(e,t),t.readonly)},isVisible:l,map:c,name:o,fieldRightMargin:"0",title:"",fieldBottomMargin:"0"}]}},jC=function(e,t){return void 0===t&&(t=!1),e.map(function(e){var n=e.title,r=e.expanded,o=void 0!==r&&r,i=e.children,l=e.isVisible,c=e.isDisabled;return{type:jn.Expansion,fieldRightMargin:"0",fieldBottomMargin:"1",expansionOpened:o||t,isVisible:l,isDisabled:c,title:n,fields:i.flatMap(function(e,t){var n=e.type,r=void 0===n?AC.Boolean:n,o=e.name,l=e.defaultValue,c=void 0!==l&&l,u=e.description,s=void 0===u?o:u,d=e.label,m=void 0===d?o:d,p=e.isDisabled,h=void 0===p?function(){return!1}:p,v=e.isVisible,g=void 0===v?function(){return!0}:v,b=e.map;return{type:jn.Box,sx:a(a(a(a(a({},t%2==0&&{background:function(e){return $(e.palette.getContrastText(e.palette.background.paper),.04)}}),{marginLeft:"-16px",marginRight:"-16px",paddingLeft:"16px",paddingRight:"8px"}),t===i.length-1&&{marginBottom:"-16px"}),t===i.length-1&&1===i.length?{paddingBottom:"16px"}:{paddingBottom:"4px"}),{width:"calc(100% + 32px) !important"}),fields:[DC(r,{label:m,name:o,defaultValue:c,isDisabled:h,isVisible:g,map:b}),{type:jn.Component,element:function(e){return f.createElement(_,{variant:"subtitle2",sx:{opacity:e.payload.readonly||e[o]?.5:.2}},s)}}]}})}})},OC=function(t){var n=t.changeSubject,r=t.outlinePaper,o=t.transparentPaper,i=t.className,l=t.style,c=t.sx,u=t.data,s=t.readonly,d=t.features,m=t.expandAll,p=t.onChange,v=h(function(){return jC(d,m)},[]),g=h(function(){return u?u.reduce(function(e,t){var n;return a(a({},e),((n={})[t]=!0,n))},{}):{}},[u]),b=y(function(){return g},[u]),w=y(function(t,n){if(t&&!n){var r=Object.entries(t).filter(function(t){var n=e(t,2);return n[0],!!n[1]}).map(function(t){return e(t,1)[0]});p&&p(r)}},[]);return f.createElement(yf,{changeSubject:n,className:i,style:l,sx:c,outlinePaper:r,transparentPaper:o,handler:b,change:w,fields:v,readonly:s,payload:{readonly:s}})},FC=function(r){var o=r.data,i=r.title,l=r.features,c=r.expandAll,u=r.readonly,s=r.fullScreen,d=r.fallback,f=r.onLoadStart,m=r.onLoadEnd,p=r.onSubmit,h=r.onChange,v=r.submitLabel,g=r.withActionButton,b=void 0===g||g,y=r.withStaticAction;return ig({title:i,withStaticAction:void 0!==y&&y,withActionButton:b,fullScreen:s,fallback:d,onLoadStart:f,onLoadEnd:m,handler:function(){return o?o.reduce(function(e,t){var n;return a(a({},e),((n={})[t]=!0,n))},{}):{}},onSubmit:function(r){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return r?(t=Object.entries(r).filter(function(t){var n=e(t,2);return n[0],!!n[1]}).map(function(t){return e(t,1)[0]}),p?[4,p(t)]:[3,2]):[3,2];case 1:return[2,n.sent()];case 2:return[2,!0]}})})},onChange:function(t,n){if(t&&!n){var r=Object.entries(t).filter(function(t){var n=e(t,2);return n[0],!!n[1]}).map(function(t){return e(t,1)[0]});h&&h(r)}},submitLabel:v,outlinePaper:!0,payload:{readonly:u},fields:jC(l,c)})},_C=(RC=e(vl(),2))[0],BC=RC[1],HC=(PC=e(xr(),2))[0],WC=PC[1];var zC=Tn()(function(e){return{container:{height:"100%",width:"100%",display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column"},stretch:{flex:1},disabled:{pointerEvents:"none",opacity:.5},monthLabel:{textAlign:"center"},noBorder:{border:"0"},arrows:{padding:"5px",color:e.palette.text.secondary},header:{display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"5px"},content:{flex:1,display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gridGap:"15px",button:{color:e.palette.text.primary}}}}),VC=function(t){var n=t.date,r=t.minDate,o=t.maxDate,i=t.onChange,a=e(g(n.get("year")),2),l=a[0],c=a[1],u=(()=>{const e=[],t=Ue().startOf("year");for(let n=0;12!==n;n++)e.push(t.clone().add(n,"months"));return e})().map(function(e){return e.get("month")}),s=(()=>{const e=Ue.localeData(),t=e.months();return(e.monthsShort()||t).map(e=>`${e.slice(0,1).toUpperCase()}${e.slice(1,3)}`)})(),d=zC().classes,m=y(function(e){var t=n.clone().set("month",e);t=t.set("year",l),n&&o.isBefore(n)?i(o.clone()):n&&r.isAfter(n)?i(r.clone()):i(t)},[l,n,o,r,i]);return f.createElement("div",{className:d.container},f.createElement("div",{className:d.header},f.createElement(Ne,{className:d.noBorder,onClick:function(){var e=l-1;e>=r.get("year")&&c(e)}},f.createElement(vn,{className:d.arrows})),f.createElement(_,{className:xo(d.monthLabel,d.stretch)},l),f.createElement(Ne,{className:d.noBorder,onClick:function(){var e=l+1;e<=o.get("year")&&c(e)}},f.createElement(gn,{className:d.arrows}))),f.createElement("div",{className:d.content},u.map(function(e){var t,n=o.get("month")<e&&o.get("year")===l||r.get("month")>e&&r.get("year")===l;return f.createElement(ye,{key:e,className:xo((t={},t[d.disabled]=n,t)),onClick:function(){return m(e)}},s[e])})))};var YC=Tn()(function(e){return{container:{height:"100%",width:"100%",display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column"},stretch:{flex:1},yearLabel:{textAlign:"center"},noBorder:{border:"0"},arrows:{padding:"5px",border:"0",color:e.palette.text.disabled},header:{display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"5px"},content:{flex:1,display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gridGap:"15px",button:{color:e.palette.text.primary}}}}),UC=function(t){var n=t.date,o=t.minDate,i=t.maxDate,a=t.onChange,l=n.get("year"),c=h(function(){return((e,t)=>{const n=t.diff(e,"years")+1,r=[];for(let t=0;t!==n;t++)r.push(e.clone().add(t,"years"));return r})(o,i).map(function(e){return e.get("year")}).reduce(function(t,n){var o=e(t.slice().reverse(),1)[0];return o.push(n),12===o.length?r(r([],e(t),!1),[[]],!1):t},[[]])},[o,i]),u=e(g(c.findIndex(function(e){return e.includes(l)})),2),s=u[0],d=u[1],m=y(function(e){var t=n.clone().set("year",e);n&&i.isBefore(n)?a(i.clone()):n&&o.isAfter(n)?a(o.clone()):a(t)},[n,i,o,a]),p=c[s]||[],v=YC().classes;return f.createElement("div",{className:v.container},f.createElement("div",{className:v.header},f.createElement(ye,{className:v.noBorder,variant:"text",onClick:function(){d(Math.max(s-1,0))}},f.createElement(vn,{className:v.arrows})),f.createElement(_,{className:xo(v.yearLabel,v.stretch)},n.format("YYYY")),f.createElement(ye,{className:v.noBorder,variant:"text",onClick:function(){var e=s+1;e<c.length&&d(e)}},f.createElement(gn,{className:v.arrows}))),f.createElement("div",{className:v.content},p.map(function(e){var t=e===l;return f.createElement(ye,{key:e,color:t?"primary":"secondary",onClick:function(){return m(e)}},e)})))};Ue.extend(hn),Ue.extend(bn);var qC=function(e,t){return void 0===e&&(e=Ue().tz("Europe/London")),void 0===t&&(t="day"),Math.floor(kl(e).diff(Sl(),t,!0))},$C=function(e,t){return void 0===t&&(t="day"),Cl(Sl().add(e,t))},XC=Tn()(function(e){return{switchHeader:{display:"flex",justifyContent:"space-between",overflowY:"auto",alignItems:"center",margin:"5px 0 10px"},daysHeader:{display:"flex",justifyContent:"stretch",alignItems:"stretch",height:"35px"},monthName:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",fontSize:"14px",button:{padding:"5px",color:e.palette.text.primary}},dayLabel:{flex:1,textAlign:"center",opacity:.5},dayLabelStart:{textAlign:"center"},dayLabelEnd:{textAlign:"center"},noBorder:{border:"0"}}}),GC=function(e){var t=e.currentMonth,n=e.onMonthChange,r=e.onHeaderMonthClick,o=e.onHeaderYearClick,i=WC(),a=i.AfterCalendarHeader,l=i.BeforeCalendarHeader,c=i.payload,u=XC().classes,s=h(function(){return qC(t.clone().startOf("week"))},[]),d=h(function(){return qC(t.clone().endOf("month").endOf("week"))},[]);return f.createElement("div",null,f.createElement("div",{className:u.switchHeader},f.createElement(Ne,{onClick:function(){return n(t.clone().subtract(1,"months"))}},f.createElement(Xe,null)),f.createElement(_,{className:u.monthName},l&&f.createElement(l,{fromStamp:s,toStamp:d,payload:c}),f.createElement(ye,{onClick:r,className:xo(u.noBorder)},t.format("MMMM")),f.createElement(ye,{onClick:o,className:xo(u.noBorder)},t.format("YYYY")),a&&f.createElement(a,{fromStamp:s,toStamp:d,payload:c})),f.createElement(Ne,{className:u.noBorder,onClick:function(){return n(t.clone().add(1,"months"))}},f.createElement(Ge,null))),f.createElement("div",{className:u.daysHeader},(()=>{const e=Ue.localeData(),t=e.weekdays(),n=e.weekdaysShort(),{weekStart:r=0}=Ue.Ls[Ue.locale()],o=n||t;return[...o.slice(r,7),...o.slice(0,r)].map(e=>`${e.slice(0,1).toUpperCase()}${e.slice(1,3)}`)})().map(function(e,t){var n;return f.createElement(_,{key:t,className:xo(u.dayLabel,(n={},n[u.dayLabelStart]=0===t,n[u.dayLabelEnd]=6===t,n))},e)})))};const KC=e=>e.isToday();var QC=Tn()(function(e){return{buttonAccient:{background:e.palette.action.hover},button:{minWidth:"unset !important",height:"100%",width:"100%","&:hover":{background:$(e.palette.getContrastText(e.palette.background.paper),.018)}},stretch:{flex:1}}}),JC=function(r){var o,i=r.onChange,l=r.day,c=QC().classes,u=WC(),s=u.BeforeDayHeader,d=u.AfterDayHeader,m=u.onItemClick,p=u.tileMode,v=u.itemSx,b=e(BC(),1)[0],y=WC(),E=y.renderItem,x=y.payload,C=y.onLoadStart,k=y.onLoadEnd,L=y.fallback,N=y.rowMark,I=y.rowColor,M=y.dotSide,R=void 0===M?7.5:M,P=e(g([]),2),A=P[0],T=P[1],D=e(g(null),2),O=D[0],F=D[1],B=A.length,H=h(function(){return qC(Cl(l))},[]),W=Ti(function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:return T([]),b?[4,b.promise]:[2];case 1:return e=n.sent(),t=e.filter(function(e){return e.stamp===H}),T(t),[2]}})})},{onLoadStart:C,onLoadEnd:k,fallback:L}).execute;w(function(){W()},[b]);return f.createElement(f.Fragment,null,f.createElement(ye,{onClick:function(e){var t=e.currentTarget;return F(t)},className:xo(c.button,(o={},o[c.buttonAccient]=KC(l),o))},f.createElement(ob,{sx:{flexDirection:"column",gap:"5px"}},l.format("DD"),!!B&&f.createElement(sm,{sx:{mt:"-2.5px"},side:R,color:l.isBefore(Ue().add(-1,"days"))?"red":B>3?"orange":"green"}))),f.createElement(qe,{open:!!O,anchorEl:O,onClose:function(){return F(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"}},0===A.length?f.createElement(_,{sx:{p:2}},"На этот день задач не назначено"):f.createElement(j,{sx:{height:"356px",maxHeight:"45vh",width:"356px"}},f.createElement(Ie,{disablePadding:!0,subheader:f.createElement(j,{sx:{display:"flex",alignItems:"center",justifyContent:"stretch",mr:1}},s&&f.createElement(s,{items:A,payload:x,stamp:H}),f.createElement(rt,{component:_,sx:{fontWeight:"bold"}},l.format("DD/MM/YYYY")),f.createElement("div",{className:c.stretch}),d&&f.createElement(d,{items:A,payload:x,stamp:H}))},f.createElement(Xi,{mode:p,itemSx:v,sx:{height:"calc(356px - 48px)",width:"356px",maxHeight:"calc(45vh - 48px)"},data:A,rowMark:N,rowColor:I,payload:x,onItemClick:function(e){var t=e.data;m&&m(t),F(null)}},function(e){var t=e.data,n=e.rowMark,r=e.index;return S(E,a(a({},t),{rowMark:n,index:r,onDaySelect:function(){return i(l)}}))})))))};var ZC=Tn()(function(e){return{container:{width:"100%",height:"100%",display:"flex",flexDirection:"column"},calendar:{flex:1,display:"grid",overflow:"hidden",background:e.palette.background.paper,gridTemplateColumns:"repeat(7, 2fr)",gridRowGap:"2px"},inactiveDay:{opacity:.5,pointerEvents:"none"},day:{"& button":{border:"0",color:e.palette.text.primary,height:"100%"}},cell:{display:"flex",alignItems:"center",justifyContent:"center","&:nth-of-type(7n)":{justifyContent:'"flex-end"'},"&:nth-of-type(7n + 1)":{justifyContent:'"flex-start"'},margin:e.spacing(.5),border:"1px solid ".concat(e.palette.action.active)}}}),ek=function(r){var o=r.onChange,i=r.onHeaderMonthClick,l=r.onHeaderYearClick,c=r.minDate,u=r.maxDate,s=r.date,d=Jr(),m=d.reloadTrigger,p=d.doReload,h=WC(),v=h.handler,b=h.payload,E=h.reloadSubject,x=_r(E),C=e(g(s.clone().startOf("month")),2),k=C[0],S=C[1],L=e(BC(),2)[1];w(function(){var e=qC(k.clone().startOf("week")),r=qC(k.clone().endOf("month").endOf("week"));L({fromStamp:e,toStamp:r,payload:b,promise:t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,v({fromStamp:e,toStamp:r,payload:b})];case 1:return[2,t.sent().map(function(e){return a(a({},e),{payload:b})})]}})})})},[k,m]),w(function(){return x.subscribe(p)},[]);var N=y(function(e){var t=e.clone().endOf("week"),n=k.get("month");return((e,t)=>{const n=t.diff(e,"days")+1,r=[];for(let t=0;t!==n;t++)r.push(e.clone().add(t,"days"));return r})(e,t).map(function(e){var t,r=s.isSame(e,"date"),i=e.get("month")!==n||u.isBefore(e)||c.isAfter(e);return f.createElement("div",{key:e.toString(),className:xo(R.day,R.cell,(t={},t[R.inactiveDay]=i,t))},f.createElement(JC,{day:e,isActive:r,onChange:o}))})},[k,s,u,c,o]),I=y(function(){return((e,t)=>{const n=t.diff(e,"weeks")+1,r=[];for(let t=0;t!==n;t++)r.push(e.clone().add(t,"weeks"));return r})(k.clone().startOf("week"),k.clone().endOf("month").endOf("week")).map(function(e){return f.createElement(f.Fragment,{key:"week-".concat(e.toString())},N(e))})},[k,N]),M=ZC(),R=M.classes,P=M.cx;return f.createElement("div",{className:R.container},f.createElement(GC,{currentMonth:k,onMonthChange:function(e){return S(e)},onHeaderMonthClick:i,onHeaderYearClick:l}),f.createElement("div",{className:P(R.calendar,"react-declarative__calendarWrapper")},I()))},tk=Sl(),nk=new Date(4102434e6),rk=Tn()(function(e){return{container:{width:"100%",minHeight:"100%",padding:e.spacing(1)}}}),ok=function(t){var n=rk().classes,r=t.className,o=t.style,i=t.sx,l=t.date,c=void 0===l?Ue():l,u=t.minDate,s=void 0===u?Ue(tk):u,d=t.maxDate,m=void 0===d?Ue(nk):d,p=t.onChange,v=void 0===p?function(){}:p,b=t.outlinePaper,y=t.transparentPaper,w=Fr(t.payload||{}),E=e(g(function(){return c.isBefore(s)?s:c}),2),x=E[0],C=E[1],k=e(g(!1),2),S=k[0],L=k[1],N=e(g(!1),2),I=N[0],M=N[1],R=function(){return L(!0)},P=function(){return M(!0)},A=x.startOf("day"),T=function(e){L(!1),C(e.clone().set("year",e.get("year")))},D=function(e){M(!1),C(e.clone().set("month",e.get("month")))},j=h(function(){return a(a({},t),{payload:w})},[]);return f.createElement(HC,{payload:j},f.createElement(oa,{className:xo(n.container,r),style:o,sx:i,outlinePaper:b,transparentPaper:y},S?f.createElement(UC,{date:A,onChange:T,minDate:s,maxDate:m}):I?f.createElement(VC,{date:A,onChange:D,minDate:s,maxDate:m}):f.createElement(_C,{initialState:null},f.createElement(ek,{date:A,onChange:v,minDate:s,maxDate:m,onHeaderMonthClick:P,onHeaderYearClick:R}))))};ok.init=function(){Ue.extend(mn),Ue.extend(hn),Ue.extend(fn),Ue.locale(pn)};var ik=null,ak=new lr,lk=function(e){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return[4,ak.next(e)];case 1:return n.sent(),ik?(ik(e),[2]):((t=document.createElement("a")).href=e,t.target="_blank",t.style.display="none",document.body.appendChild(t),t.click(),document.body.removeChild(t),[2])}})})};lk.override=function(e){ik=e},lk.listen=function(e){return ak.subscribe(e)};var ck=Tn()(function(e){return{root:{position:"relative",overflow:"hidden",background:"light"===e.palette.mode?e.palette.background.paper:ae(e.palette.background.paper,.06)},container:{position:"absolute",top:0,left:0,minHeight:"100%",minWidth:"100%"},frame:{background:"none transparent",border:"0px solid transparent"},fabFullscreen:{position:"absolute",transition:"opacity 150ms",opacity:0,bottom:10,right:10,zIndex:2},fabFullscreenToggle:{opacity:1},fabDelete:{position:"absolute",transition:"opacity 150ms",opacity:0,bottom:10,zIndex:2},fabDeleteToggle:{opacity:1},fabMenu:{position:"absolute",transition:"opacity 150ms",opacity:0,top:10,right:10,height:48,width:48,zIndex:2},fabMenuToggle:{opacity:1}}}),uk=function(t){var n,r,o,i=t.withFullScreen,c=void 0!==i&&i,u=t.withDelete,s=void 0!==u&&u,d=t.className;t.style;var m=t.src,p=t.onFullScreenClick,h=void 0===p?function(){return lk(m)}:p,v=t.onDeleteClick,b=void 0===v?function(){}:v,y=t.onLoadStart,w=t.onLoadEnd,E=t.fallback,x=t.throwError,C=void 0!==x&&x,k=t.disabled,S=void 0!==k&&k,L=t.options,N=t.onAction,I=void 0===N?function(){}:N,M=t.payload,R=t.deps,P=t.keepMounted,A=t.BeforeContent,T=t.AfterContent,D=l(t,["withFullScreen","withDelete","className","style","src","onFullScreenClick","onDeleteClick","onLoadStart","onLoadEnd","fallback","throwError","disabled","options","onAction","payload","deps","keepMounted","BeforeContent","AfterContent"]),O=ck().classes,F=e(g(!1),2),_=F[0],B=F[1],H=e(g(!1),2),W=H[0],z=H[1];return f.createElement(j,a({className:xo(d,O.root),onMouseEnter:function(){_||z(!0)},onMouseLeave:function(){_||z(!1)}},D),f.createElement(Sm,{className:O.container,payload:m},function(e){var t=e.height,n=e.width,r=e.payload;return f.createElement("iframe",{className:O.frame,allowTransparency:!0,src:r,height:t,width:n})}),!!(null==L?void 0:L.length)&&f.createElement(Ca,{className:xo(O.fabMenu,(n={},n[O.fabMenuToggle]=_||W,n)),options:L,disabled:S,onToggle:function(e){B(e),z(!1)},onAction:I,payload:M,deps:R,keepMounted:P,BeforeContent:A,AfterContent:T}),s&&f.createElement(im,{className:xo(O.fabDelete,(r={},r[O.fabDeleteToggle]=_||W,r)),disabled:S,sx:{right:c?68:10},color:"primary",size:48,onClick:b,onLoadStart:y,onLoadEnd:w,fallback:E,throwError:C},f.createElement(ln,{color:"inherit"})),c&&f.createElement(im,{className:xo(O.fabFullscreen,(o={},o[O.fabFullscreenToggle]=_||W,o)),disabled:S,color:"primary",size:48,onClick:h,onLoadStart:y,onLoadEnd:w,fallback:E,throwError:C},f.createElement(ht,{color:"inherit"})))},sk=Tn()(function(e){return{root:{position:"relative",overflow:"hidden",background:"light"===e.palette.mode?e.palette.background.paper:ae(e.palette.background.paper,.06)},container:{position:"absolute",top:0,left:0,height:"100%",width:"100%",display:"flex",alignItems:"stretch",justifyContent:"stretch"},content:{objectFit:"contain",margin:"6px",flex:1},fabFullscreen:{position:"absolute",transition:"opacity 150ms",opacity:0,bottom:10,right:10,zIndex:2},fabFullscreenToggle:{opacity:1},fabDelete:{position:"absolute",transition:"opacity 150ms",opacity:0,bottom:10,zIndex:2},fabDeleteToggle:{opacity:1},fabMenu:{position:"absolute",transition:"opacity 150ms",opacity:0,top:10,right:10,height:48,width:48,zIndex:2},fabMenuToggle:{opacity:1}}}),dk=function(t){var n,r,o,i=t.withFullScreen,c=void 0!==i&&i,u=t.withDelete,s=void 0!==u&&u,d=t.className,m=t.src,p=t.onFullScreenClick,h=void 0===p?function(){return lk(m)}:p,v=t.onDeleteClick,b=void 0===v?function(){}:v,y=t.onLoadStart,w=t.onLoadEnd,E=t.fallback,x=t.throwError,C=void 0!==x&&x,k=t.disabled,S=void 0!==k&&k,L=t.options,N=t.onAction,I=void 0===N?function(){}:N,M=t.payload,R=t.deps,P=t.keepMounted,A=t.BeforeContent,T=t.AfterContent,D=l(t,["withFullScreen","withDelete","className","src","onFullScreenClick","onDeleteClick","onLoadStart","onLoadEnd","fallback","throwError","disabled","options","onAction","payload","deps","keepMounted","BeforeContent","AfterContent"]),O=sk().classes,F=e(g(!1),2),_=F[0],B=F[1],H=e(g(!1),2),W=H[0],z=H[1];return f.createElement(j,a({className:xo(d,O.root),onMouseEnter:function(){_||z(!0)},onMouseLeave:function(){_||z(!1)}},D),f.createElement("div",{className:O.container},f.createElement("img",{className:O.content,crossOrigin:"anonymous",loading:"lazy",src:m})),!!(null==L?void 0:L.length)&&f.createElement(Ca,{className:xo(O.fabMenu,(n={},n[O.fabMenuToggle]=_||W,n)),options:L,disabled:S,onToggle:function(e){B(e),z(!1)},onAction:I,payload:M,deps:R,keepMounted:P,BeforeContent:A,AfterContent:T}),s&&f.createElement(im,{className:xo(O.fabDelete,(r={},r[O.fabDeleteToggle]=_||W,r)),disabled:S,sx:{right:c?68:10},color:"primary",size:48,onClick:b,onLoadStart:y,onLoadEnd:w,fallback:E,throwError:C},f.createElement(ln,{color:"inherit"})),c&&f.createElement(im,{className:xo(O.fabFullscreen,(o={},o[O.fabFullscreenToggle]=_||W,o)),disabled:S,color:"primary",size:48,onClick:h,onLoadStart:y,onLoadEnd:w,fallback:E,throwError:C},f.createElement(ht,{color:"inherit"})))},fk=Tn()(function(e){return{root:{display:"flex",flexDirection:"column",alignItems:"stretch",justifyContent:"stretch",height:"100%",width:"100%",overflow:"hidden",background:e.palette.background.paper},label:{display:"flex",minHeight:"35px",justifyContent:"stretch",alignItems:"center",paddingLeft:"6px",gap:e.spacing(1),background:A("#000",.1)},labelTitle:{opacity:.5},container:{position:"relative",flex:1},content:{position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *":{flex:1}},stretch:{flex:1}}}),mk=function(e){var t=e.children,n=void 0===t?null:t,r=e.outlinePaper,o=e.transparentPaper,i=e.className,a=e.style,l=e.sx,c=e.label,u=e.payload,s=e.loading,d=e.BeforeLabel,m=e.AfterLabel,p=fk().classes;return f.createElement(oa,{className:xo(p.root,i),outlinePaper:r,transparentPaper:o,sx:l,style:a},!!c&&f.createElement(j,{className:xo(p.label,"react-declarative__gridViewLabel")},!!d&&f.createElement(d,{payload:u,loading:s}),f.createElement(_,{className:p.labelTitle},c),f.createElement("div",{className:p.stretch}),!!m&&f.createElement(m,{payload:u,loading:s})),f.createElement("div",{className:p.container},f.createElement("div",{className:p.content},n)))},pk=Tn()({tile:{height:"100%"}}),hk=function(e){var t=e.className,n=e.style,r=e.sx,o=e.label,i=e.BeforeLabel,c=e.AfterLabel,u=e.payload,s=e.mobileItem,d=e.itemSx,m=e.tileMode,p=e.outlinePaper,h=e.transparentPaper,v=e.loading,g=l(e,["className","style","sx","label","BeforeLabel","AfterLabel","payload","mobileItem","itemSx","tileMode","outlinePaper","transparentPaper","loading"]),b=pk().classes,y=Fr(u),w=nl().isMobile;return f.createElement(mk,{outlinePaper:p,transparentPaper:h,className:t,style:n,sx:r,label:o,payload:y,loading:!!v,BeforeLabel:i,AfterLabel:c},w&&s?f.createElement(Xi,a({},g,{itemSx:d,className:b.tile,payload:y,loading:v,mode:m}),s):f.createElement(Aa,a({},g,{payload:y,loading:v})))},vk=function(){function o(e){this.defaultOption={delay:300},this.emptyAction={request:{type:"empty"},responses:[],onResnponsed:[]},this.defaultActionRequest={always:!1,addMessage:!0},this.state={option:a(a({},this.defaultOption),e),messages:[],action:this.emptyAction,actionHistory:[],onMessagesChanged:[],onActionChanged:[]}}return o.prototype.addMessage=function(e){var t=this;return new Promise(function(n){setTimeout(function(){var r=t.state.messages.push(e)-1;t.state.messages[r].createdAt=new Date,t.callOnMessagesChanged(),n(r)},t.state.option.delay)})},o.prototype.updateMessage=function(e,t){if(t!==this.state.messages[e]){var n=this.state.messages[e].createdAt;this.state.messages[e]=t,this.state.messages[e].createdAt=n}this.state.messages[e].updatedAt=new Date,this.callOnMessagesChanged()},o.prototype.removeMessage=function(e){this.state.messages[e].deletedAt=new Date,this.callOnMessagesChanged()},o.prototype.getMessages=function(){return this.state.messages},o.prototype.setMessages=function(t){this.clearMessages(),this.state.messages=r([],e(t),!1),this.callOnMessagesChanged()},o.prototype.clearMessages=function(){this.state.messages=[],this.callOnMessagesChanged()},o.prototype.callOnMessagesChanged=function(){var e=this;this.state.onMessagesChanged.map(function(t){return t(e.state.messages)})},o.prototype.addOnMessagesChanged=function(e){this.state.onMessagesChanged.push(e)},o.prototype.removeOnMessagesChanged=function(e){var t=this.state.onMessagesChanged.indexOf(e);this.state.onActionChanged[t]=function(){}},o.prototype.setActionRequest=function(e,t){var n=this,r={request:a(a({},this.defaultActionRequest),e),responses:[],onResnponsed:[]};return new Promise(function(o,i){if(!e.always){r.onResnponsed.push(function(e){e.error?i(e.error):o(e)})}t&&r.onResnponsed.push(t),n.state.action=r,n.state.actionHistory.push(r),n.callOnActionChanged(r.request),e.always&&o({type:"text",value:"dummy"})})},o.prototype.cancelActionRequest=function(){this.state.action=this.emptyAction,this.callOnActionChanged(this.emptyAction.request)},o.prototype.getActionRequest=function(){var e=this.state.action,t=e.request,n=e.responses;if(t.always||!(n.length>0))return t},o.prototype.setActionResponse=function(e,r){return t(this,void 0,void 0,function(){var t,o,i,a;return n(this,function(n){switch(n.label){case 0:if(t=this.state.action,o=t.request,i=t.responses,a=t.onResnponsed,e!==o)throw new Error("Invalid action.");if(!e.always&&0===a.length)throw new Error("onResponsed is not set.");return i.push(r),this.callOnActionChanged(e,r),e.addMessage?[4,this.addMessage({type:"text",content:r.value,self:!0})]:[3,2];case 1:n.sent(),n.label=2;case 2:return a.map(function(e){return e(r)}),[2]}})})},o.prototype.getActionResponses=function(){return this.state.action.responses},o.prototype.callOnActionChanged=function(e,t){this.state.onActionChanged.map(function(n){return n(e,t)})},o.prototype.addOnActionChanged=function(e){this.state.onActionChanged.push(e)},o.prototype.removeOnActionChanged=function(e){var t=this.state.onActionChanged.indexOf(e);this.state.onActionChanged[t]=function(){}},o.prototype.getOption=function(){return this.state.option},o}(),gk=function(){function e(){if(!window.MediaRecorder)throw new Error("window.MediaRecorder is undefined");this.recordChunks=[]}return e.getInstance=function(){return this.instance||(this.instance=new e),this.instance},e.prototype.initialize=function(){return t(this,void 0,void 0,function(){var e;return n(this,function(t){switch(t.label){case 0:return this.md?[2,this]:[4,navigator.mediaDevices.getUserMedia({audio:!0,video:!1})];case 1:return e=t.sent(),this.md=new MediaRecorder(e),this.recordChunks=[],[2,this]}})})},e.prototype.startRecord=function(){return t(this,void 0,void 0,function(){var e=this;return n(this,function(t){return[2,new Promise(function(t){if(!e.md)throw new Error("Must be initialized.");e.recordChunks=[],e.md.addEventListener("start",function(){t()}),e.md.addEventListener("dataavailable",function(t){t.data.size>0&&e.recordChunks.push(t.data)}),e.md.start()})]})})},e.prototype.stopRecord=function(){return t(this,void 0,void 0,function(){var e=this;return n(this,function(t){return[2,new Promise(function(t){if(!e.md)throw new Error("Must be initialized.");e.md.addEventListener("stop",function(){t(new Blob(e.recordChunks))}),e.md.stop()})]})})},e}(),bk=function(r){var o=r.chatController,i=r.actionRequest,a=o,l=e(f.useState(gk.getInstance()),1)[0],c=e(f.useState(!0),2),u=c[0],s=c[1],d=e(f.useState(),2),m=d[0],p=d[1],h=f.useCallback(function(e){var t={type:"audio",value:e.message,error:e};a.setActionResponse(i,t)},[i,a]),v=f.useCallback(function(){return t(void 0,void 0,void 0,function(){var e;return n(this,function(t){switch(t.label){case 0:return t.trys.push([0,3,,4]),[4,l.initialize()];case 1:return t.sent(),[4,l.startRecord()];case 2:return t.sent(),s(!1),[3,4];case 3:return e=t.sent(),h(e),[3,4];case 4:return[2]}})})},[l,h]),g=f.useCallback(function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,l.stopRecord()];case 1:return e=n.sent(),p(e),s(!0),[3,3];case 2:return t=n.sent(),h(t),[3,3];case 3:return[2]}})})},[l,h]),b=f.useCallback(function(){if(m){var e={type:"audio",value:"Audio",audio:m};a.setActionResponse(i,e),p(void 0)}},[i,m,a]),y=i.sendButtonText?i.sendButtonText:"Send";return f.createElement(te,{sx:{flex:"1 1 auto",display:"flex",gap:1,"& > *":{flex:"1 1 auto",minWidth:0},"& > * + *":{ml:1}}},u&&f.createElement(le,{type:"button",onClick:v,disabled:!u,variant:"contained",color:"primary",startIcon:f.createElement(En,null)},"Rec start"),!u&&f.createElement(le,{type:"button",onClick:g,disabled:u,variant:"contained",color:"primary",startIcon:f.createElement(wn,null)},"Rec stop"),f.createElement(le,{type:"button",onClick:b,disabled:!m,variant:"contained",color:"primary",startIcon:f.createElement(yn,null)},y))},yk=function(t){var n=t.chatController,r=t.actionRequest,o=n,i=e(f.useState([]),2),a=i[0],l=i[1],c=f.useCallback(function(e){var t=[];if(e)for(var n=0;n<e.length;n+=1){var r=e.item(n);r&&t.push(r)}l(t)},[]),u=f.useCallback(function(){if(a.length>0){var e={type:"file",value:a.map(function(e){return e.name}).toString(),files:a};o.setActionResponse(r,e)}},[r,o,a]),s=r.sendButtonText?r.sendButtonText:"Send";return f.createElement(te,{sx:{flex:"1 1 auto",maxWidth:"100%",display:"flex",gap:1,flexDirection:"column","& > *":{flex:"0 0 auto",maxWidth:"100%"},"& > * + *":{mt:1}}},f.createElement(ce,null,a.map(function(e){return f.createElement("div",{key:"".concat(e.name,"-").concat(e.size)},f.createElement(G,null),f.createElement(ue,{key:e.name},f.createElement(se,null,f.createElement(xn,null)),f.createElement(X,{style:{overflowWrap:"break-word",minWidth:0}},e.name)))})),f.createElement(te,{sx:{display:"flex","& > *":{flex:"1 1 auto",minWidth:0},"& > * + *":{ml:1}}},f.createElement(le,{disabled:!1,component:"label",variant:"contained",color:"primary",startIcon:f.createElement(Cn,null)},"Select file",f.createElement("input",{type:"file",accept:r.accept,multiple:r.multiple,onChange:function(e){return c(e.target.files)},style:{display:"none"}})),f.createElement(le,{type:"button",onClick:u,disabled:0===a.length,variant:"contained",color:"primary",startIcon:f.createElement(yn,null)},s)))},wk=function(t){var n=t.chatController,o=t.actionRequest,i=n,a=e(f.useState([]),2),l=a[0],c=a[1],u=f.useCallback(function(t){l.includes(t)?c(l.filter(function(e){return e!==t})):c(r(r([],e(l),!1),[t],!1))},[l]),s=f.useCallback(function(){var e=o.options.filter(function(e){return l.includes(e.value)}),t={type:"multi-select",value:e.map(function(e){return e.text}).toString(),options:e};i.setActionResponse(o,t),c([])},[o,i,l]),d=o.sendButtonText?o.sendButtonText:"Send";return f.createElement(te,{sx:{flex:"1 1 auto",display:"flex",gap:1,flexDirection:"column","& > *":{flex:"0 0 auto",maxWidth:"100%"},"& > * + *":{mt:1}}},o.options.map(function(e){return f.createElement(le,{key:o.options.indexOf(e),type:"button",value:e.value,onClick:function(e){return u(e.currentTarget.value)},variant:l.includes(e.value)?"contained":"outlined",color:"primary"},e.text)}),f.createElement(le,{type:"button",onClick:s,disabled:0===l.length,variant:"contained",color:"primary",startIcon:f.createElement(yn,null)},d))},Ek=function(e){var t=e.chatController,n=e.actionRequest,r=t,o=f.useCallback(function(e){var t=n.options.find(function(t){return t.value===e});if(!t)throw new Error("Unknown value: ".concat(e));var o={type:"select",value:t.text,option:t};r.setActionResponse(n,o)},[n,r]);return f.createElement(te,{sx:{flex:"1 1 auto",display:"flex",gap:1,flexDirection:"column","& > *":{flex:"0 0 auto",maxWidth:"100%"},"& > * + *":{mt:1}}},n.options.map(function(e){return f.createElement(le,{key:n.options.indexOf(e),type:"button",value:e.value,onClick:function(e){return o(e.currentTarget.value)},variant:"contained",color:"primary"},e.text)}))},xk=function(t){var n=t.chatController,r=t.actionRequest,o=n,i=e(f.useState(r.defaultValue),2),a=i[0],l=i[1],c=f.useCallback(function(){if(a){var e={type:"text",value:a};o.setActionResponse(r,e),l("")}},[r,o,a]),u=f.useCallback(function(e){e.nativeEvent.isComposing||"Enter"!==e.key||e.shiftKey||(e.preventDefault(),c())},[c]),s=r.sendButtonText?r.sendButtonText:"Send";return f.createElement(te,{sx:{flex:"1 1 auto",display:"flex",gap:1,"& > *":{flex:"1 1 auto",minWidth:0},"& > * + *":{ml:1},"& :last-child":{flex:"0 1 auto"}}},f.createElement(de,{placeholder:r.placeholder,value:a,onChange:function(e){return l(e.target.value)},autoFocus:!0,multiline:!0,inputProps:{onKeyDown:u},variant:"outlined",maxRows:1,minRows:1}),f.createElement(le,{type:"button",onClick:c,disabled:!a,variant:"contained",color:"primary",startIcon:f.createElement(yn,null)},s))},Ck=function(e){var t=e.id,n=e.message,r=e.showDate,o=e.showTime;if(n.deletedAt)return f.createElement("div",{id:t});var i=n.updatedAt?n.updatedAt:n.createdAt,a=f.createElement(te,{minWidth:0,flexShrink:0,ml:n.self?1:0,mr:n.self?0:1},f.createElement(fe,{alt:n.username,src:n.avatar})),l=f.createElement(te,{maxWidth:"100%",mx:1},f.createElement(X,{variant:"body2",align:n.self?"right":"left"},n.username)),c=f.createElement(te,{maxWidth:"100%",mx:1},f.createElement(X,{variant:"body2",align:n.self?"right":"left",color:"textSecondary"},null==i?void 0:i.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})));return f.createElement(me,{in:!0},f.createElement(te,{maxWidth:"100%",display:"flex",flexDirection:"column",pb:1},r&&f.createElement(X,{align:"center"},null==i?void 0:i.toLocaleDateString()),f.createElement(te,{id:t,maxWidth:"100%",pl:n.self?"20%":0,pr:n.self?0:"20%",mb:1,pb:1,display:"flex",justifyContent:n.self?"flex-end":"flex-start",style:{overflowWrap:"break-word"}},n.avatar&&!n.self&&a,f.createElement(te,{minWidth:0,display:"flex",flexDirection:"column"},n.username&&l,f.createElement(te,{maxWidth:"100%",py:3,px:2,bgcolor:n.self?"primary.main":"background.paper",color:n.self?"primary.contrastText":"text.primary",borderRadius:4,boxShadow:2},"text"===n.type&&f.createElement(X,{variant:"body1",style:{whiteSpace:"pre-wrap"}},n.content),"jsx"===n.type&&f.createElement("div",null,n.content)),o&&c),n.avatar&&n.self&&a)))},kk=Tn()(function(e){return{root:{height:"100%",width:"100%",p:1,bgcolor:e.palette.background.default,display:"flex",flexDirection:"column","& > *":{maxWidth:"100%"},"& > * + *":{mt:1}}}}),Sk=function(t){var n=t.chatController,o=t.className,i=t.style,a=t.sx,l=kk(),c=l.classes,u=l.cx,s=n,d=e(f.useState(s.getMessages()),2),m=d[0],p=d[1],h=e(f.useState(s.getActionRequest()),2),v=h[0],g=h[1],b=f.useRef(null),y=f.useCallback(function(){b.current&&(b.current.scrollTop=b.current.scrollHeight)},[b]);f.useEffect(function(){s.addOnMessagesChanged(function(){p(r([],e(s.getMessages()),!1)),y()}),s.addOnActionChanged(function(){g(s.getActionRequest()),y()}),p(s.getMessages()),g(s.getActionRequest())},[s,y]);var w=f.useMemo(function(){return v&&"custom"===v.type?v.Component:null},[v]),E={type:"text",content:"Unknown message.",self:!1},x=Ue(0),C=Ue(0);return f.createElement(te,{className:u(o,c.root),style:i,sx:a},f.createElement(te,{sx:{flex:"1 1 0%",overflowY:"auto",WebkitOverflowScrolling:"touch",display:"flex",flexDirection:"column","& > *":{maxWidth:"100%"}},ref:b},m.map(function(e){var t=!1,n=!!s.getOption().showDateTime;if(s.getOption().showDateTime&&!e.deletedAt){var r=Ue(e.updatedAt?e.updatedAt:e.createdAt);r.format("YYYYMMDD")!==x.format("YYYYMMDD")&&(t=!0),x=r,r.diff(C)<6e4?n=!1:C=r}return"text"===e.type||"jsx"===e.type?f.createElement(Ck,{key:m.indexOf(e),id:"cu-msg-".concat(m.indexOf(e)+1),message:e,showDate:t,showTime:n}):f.createElement(Ck,{key:m.indexOf(e),id:"cu-msg-".concat(m.indexOf(e)+1),message:E,showDate:t,showTime:n})})),f.createElement(te,{sx:{flex:"0 1 auto",display:"flex",alignContent:"flex-end","& > *":{minWidth:0}}},v&&"text"===v.type&&f.createElement(xk,{chatController:s,actionRequest:v}),v&&"select"===v.type&&f.createElement(Ek,{chatController:s,actionRequest:v}),v&&"multi-select"===v.type&&f.createElement(wk,{chatController:s,actionRequest:v}),v&&"file"===v.type&&f.createElement(yk,{chatController:s,actionRequest:v}),v&&"audio"===v.type&&f.createElement(bk,{chatController:s,actionRequest:v}),v&&"custom"===v.type&&f.createElement(w,{chatController:s,actionRequest:v})))};const Lk="react-declarative__roiControlRect",Nk=new class{log(...e){}};let Ik=e=>e(),Mk=(e,t)=>Nk.log({id:e,ref:t}),Rk=(e,t,...n)=>Nk.log({id:e,type:t,args:n}),Pk=(e,t)=>Nk.log({id:e,img:t}),Ak=!1;const Tk=new class{_wrappers=new Map;applyTouchWrapper(e,t=!1){const n=n=>{const{touches:r}=n;t||(n.preventDefault(),n.stopPropagation()),e(r[0])};return this._wrappers.set(e,n),n}disposeTouchWrapper(e){const t=this._wrappers.get(e);return this._wrappers.delete(e),t}},Dk=(e,t,n)=>{if(!Ak)if("mousemove"===t){const t=Tk.applyTouchWrapper(n,!0);e.addEventListener("mousemove",n),e.addEventListener("touchmove",t)}else if("mousedown"===t){const t=Tk.applyTouchWrapper(n);e.addEventListener("mousedown",n),e.addEventListener("touchstart",t)}else if("mouseup"===t){const t=Tk.applyTouchWrapper(n,!0);e.addEventListener("mouseup",n),e.addEventListener("touchend",t)}else{if("wheel"!==t)throw new Error(`area-selector on unknown event: ${t}`);e.addEventListener("wheel",n)}},jk=(e,t,n)=>{if(!Ak)if("mousemove"===t){const t=Tk.disposeTouchWrapper(n);e.removeEventListener("mousemove",n),e.removeEventListener("touchmove",t)}else if("mousedown"===t){const t=Tk.disposeTouchWrapper(n);e.removeEventListener("mousedown",n),e.removeEventListener("touchstart",t)}else if("mouseup"===t){const t=Tk.disposeTouchWrapper(n);e.removeEventListener("mouseup",n),e.removeEventListener("touchend",t)}else{if("wheel"!==t)throw new Error(`area-selector un unknown event: ${t}`);e.removeEventListener("wheel",n)}};function Ok([e,t,n,r],[o,i,a,l],c){if(!c)return[e,t,n,r];return[o-(r-l)/2,i-(n-a)/2,n,r]}const Fk={roi:(e=e=>e(),t=(e,t,...n)=>Nk.log({id:e,type:t,args:n}),n="unset",r=10,o=10,i=10,a=10,l="blue",c="rgba(0, 0, 0, 0.5)")=>{const{min:u,max:s,round:d}=Math;let f=1,m=1;const p=(e=d(r/m),l=d(o/f),c=d(i/f),u=d(a/m))=>t(n,"roi-area-changed",e,l,c,u),[h,v,g,b,y,w,E]=((e=r,t=o,n=i,u=a)=>{const s=document.createElement("div");s.style.position="absolute",s.style.top="0px",s.style.left="0px",s.style.right="0px",s.style.bottom="0px",s.style.zIndex="100",s.style.display="flex",s.style.alignItems="stretch",s.style.justifyContent="stretch";const d=(e,t=!1)=>{s.style.borderTop=`${e}px solid ${c}`,r=e,t||p()},f=(e,t=!1)=>{s.style.borderLeft=`${e}px solid ${c}`,o=e,t||p()},m=(e,t=!1)=>{s.style.borderRight=`${e}px solid ${c}`,i=e,t||p()},h=(e,t=!1)=>{s.style.borderBottom=`${e}px solid ${c}`,a=e,t||p()};[[d,e],[f,t],[m,n],[h,u]].forEach(([e,t])=>e(t,!0));const v=document.createElement("div");return v.style.flexGrow="1",v.style.position="relative",v.style.border=`1px solid ${l}`,s.appendChild(v),[s,v,(e=>{const t=document.createElement("div");t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.right="0px",t.style.bottom="0px",t.style.display="flex",t.style.alignItems="stretch",t.style.justifyContent="stretch";const n=document.createElement("div");return n.style.flexGrow="1",n.style.position="relative",n.style.overflow="hidden",t.appendChild(n),e.appendChild(t),n})(v),d,f,m,h]})(),[x,C,k,S]=[[!0,!0,y,b],[!0,!1,w,b],[!1,!0,y,E],[!1,!1,w,E]].map(t=>((t=!0,n=!0,c=e=>Nk.log(e),d=e=>Nk.log(e))=>{const f=document.createElement("div");f.classList.add(Lk),f.style.top=t?"-4px":null,f.style.left=n?"-4px":null,f.style.right=n?null:"-4px",f.style.bottom=t?null:"-4px",f.style.background=l,f.style.position="absolute",f.style.height="8px",f.style.width="8px";let[m,p]=[null,null];const v=({pageX:e,pageY:l})=>{if(Ak)return;const{scrollX:f,scrollY:v}=window;e-=f,l-=v;const{top:g,left:b,right:y,bottom:w,height:E,width:x}=h.getBoundingClientRect();m=s(n?u(e-b,x-i):u(-1*(e-y),x-o),0),p=s(t?u(l-g,E-a):u(-1*(l-w),E-r),0),c(m),d(p)};return e(()=>Dk(f,"mousedown",()=>(e(()=>Dk(window,"mousemove",v)),e(()=>Dk(window,"mouseup",()=>e(()=>jk(window,"mousemove",v)))),!1))),f})(...t));[x,C,k,S].forEach(e=>v.appendChild(e));return[h,([e,t,n])=>{const{naturalWidth:l,naturalHeight:c}=e,{width:u,height:s}=e.getBoundingClientRect(),[d,h,v,g]=[r/m,o/f,i/f,a/m];f=u/l,m=s/c,o=h*f,i=v*f,a=g*m,b(r=d*m,!0),y(o,!0),w(i,!0),E(a,!0),p()},g]},rect:(e=e=>e(),t=(e,t,...n)=>Nk.log({id:e,type:t,args:n}),n="unset",r="unset-zone",o=10,i=10,a=125,l=125,c=0,u="",s="cyan",d="",f="rgba(0, 0, 0, 0.5)")=>{const{max:m,round:p}=Math,h=document.createElement("div");h.style.transform=`rotate(${c}deg)`,h.classList.add("react-declarative__roiAreaRect"),h.dataset.data_area_id=n;let v=1,g=1;Ak&&(h.addEventListener("click",e=>{t(n,"rect-area-click",r,e)}),h.addEventListener("mouseover",e=>{e.stopPropagation(),t(n,"rect-area-hover",r,e)})),h.style.position="absolute",h.style.display="flex",h.style.alignItems="stretch",h.style.justifyContent="stretch",h.style.zIndex="99",u&&(h.style.backgroundRepeat="no-repeat",h.style.backgroundPosition="center",h.style.backgroundSize="contain",h.style.backgroundImage=`url('${u}')`),h.style.backgroundColor=f,h.style.border=`1px solid ${s}`;const b=document.createElement("div");b.style.position="relative",b.style.flexGrow="1",d&&b.appendChild((e=>{const t=document.createElement("label");return t.classList.add("react-declarative__roiAreaLabel"),t.style.position="absolute",t.style.top="50%",t.style.left="50%",t.style.transform="translate(-50%, -50%)",t.style.userSelect="none",t.style.pointerEvents="none",t.innerText=e,t})(d));const y=(e=o,u=i,s=l,d=a,f=c)=>{h.style.transform=`rotate(${c||0}deg)`,h.style.top=`${e}px`,h.style.left=`${u}px`,h.style.width=`${s}px`,h.style.height=`${d}px`,((e=p(o/g),u=p(i/v),s=p(l/v),d=p(a/g),f=c)=>{t(n,"rect-area-changed",r,e,u,d,s,f)})()};let w=!1;const E=(t=!0,n=!0)=>{const r=document.createElement("div");r.classList.add(Lk),r.style.top=t?"-4px":null,r.style.left=n?"-4px":null,r.style.right=n?null:"-4px",r.style.bottom=t?null:"-4px",r.style.background=s,r.style.position="absolute",r.style.height="8px",r.style.width="8px";let[u,d]=[null,null],[f,p]=[null,null];const v=({pageX:e,pageY:r})=>{if(Ak)return;const{scrollX:s,scrollY:v}=window;e-=s,r-=v;const[g,b]=(e=>{const t=e.getBoundingClientRect(),{scrollX:n,scrollY:r}=window;return[t.left+t.width/2+n,t.top+t.height/2+r]})(h);[e,r]=function(e,t,n,r,o){const i=o*Math.PI/180,a=e-n,l=t-r;return[a*Math.cos(i)-l*Math.sin(i)+n,a*Math.sin(i)+l*Math.cos(i)+r]}(e,r,g,b,-c);let w=null,E=null;{const{top:t,left:n,height:a,width:l}=h.parentElement.getBoundingClientRect();w=a,E=l,[u,d]=[m(e-n,0),m(r-t,0)],[f,p]=[i-u,o-d]}let[x,C,k,S]=[null,null,null,null];t&&n?[x,C,k,S]=Ok([d,u,l+f,a+p],[o,i,l,a],c):t&&!n?[x,C,k,S]=Ok([d,i,u-i,a+p],[o,i,l,a],c):!t&&n?[x,C,k,S]=Ok([o,u,l+f,d-o],[o,i,l,a],c):t||n||([x,C,k,S]=Ok([o,i,u-i,d-o],[o,i,l,a],c)),x+S>w||C+k>E||(o=S<0?o:x,i=k<0?i:C,l=k<0?l:k,a=S<0?a:S,y())};return e(()=>Dk(r,"mousedown",()=>(w=!0,e(()=>Dk(window,"mousemove",v)),e(()=>Dk(window,"mouseup",()=>{e(()=>jk(window,"mousemove",v)),w=!1})),!1))),r};[[!0,!0],[!0,!1],[!1,!0],[!1,!1]].map(e=>E(...e)).forEach(e=>b.appendChild(e));let[x,C]=[null,null];const k=({pageX:e,pageY:t})=>{if(Ak)return;const{scrollX:n,scrollY:r}=window;e-=n,t-=r;{const{top:n,left:r}=h.parentElement.getBoundingClientRect();[x,C]=[m(e-r,0),m(t-n,0)]}const[c,u]=[m(C-a/2,0),m(x-l/2,0)],{height:s,width:d}=h.parentElement.getBoundingClientRect();w||(o=c+a>s?o:c,i=u+l>d?i:u,y())};e(()=>Dk(h,"mousedown",()=>(e(()=>Dk(window,"mousemove",k)),e(()=>Dk(window,"mouseup",()=>e(()=>jk(window,"mousemove",k)))),!1))),e(()=>Dk(h,"wheel",e=>{Ak||(e.preventDefault(),e.stopPropagation(),c+=Math.sign(e.deltaY)+360,c%=360,y())}));return h.appendChild(b),[h,([e,t,n])=>{const{naturalWidth:r,naturalHeight:c}=e,{width:u,height:s}=e.getBoundingClientRect(),[d,f,m,p]=[l/v,a/g,o/g,i/v];v=u/r,g=s/c,a=f*g,l=d*v,o=m*g,i=p*v,y()}]}},_k=([e,t,n])=>{const r=n.getBoundingClientRect().height,o=e.getBoundingClientRect().height,i=(r-o)/2;t.style.height=`${o}px`,t.style.top=`${i}px`,e.style.top=`${i}px`},Bk=({setControls:e=e=>Nk.log({types:e}),obj:t={controls:[]}})=>new Proxy(Object.assign({},t),((e,t=null)=>({set:(n,r,o)=>((t||new Set(Object.keys(e))).has(r)?(n[r]=o,e[r](o)):n[r]=o,!0)}))({controls:e},new Set(Object.keys(t)))),Hk=(e,t=Ik)=>new Promise(n=>{const r=t(()=>setInterval(()=>{(()=>{const{naturalWidth:t,naturalHeight:n}=e,{width:r,height:o}=e.getBoundingClientRect();return n&&t&&o&&r})()&&(clearInterval(r),n())},50))});function Wk(e=_k){const t=Reflect.construct(HTMLElement,[],Wk),n=new class{composes=[e];cleanup=()=>this.composes=[e];addHandler=e=>this.composes.push(e);exec=([e,t,n])=>this.composes.reduce((e,t)=>([n,r,o])=>{e([n,r,o]),t([n,r,o])})([e,t,n])};let r="",o="100%",i="100%",a="unset";a=t.hasAttribute("id")?t.getAttribute("id"):a,o=t.hasAttribute("height")?t.getAttribute("height"):o,i=t.hasAttribute("width")?t.getAttribute("width"):i,r=t.hasAttribute("imageSrc")?t.getAttribute("imageSrc"):r;const l=document.createElement("div");l.style.position="relative",l.style.height=o,l.style.width=i;const c=document.createElement("img");c.onload=()=>{n.exec([c,u,l])},c.style.touchAction="none",c.style.pointerEvents="none",c.style.position="absolute",c.crossOrigin="anonymous",c.style.width="100%",c.style.zIndex="97",c.src=r;const u=document.createElement("div");u.style.position="relative",u.style.width="100%",u.style.zIndex="98",u.style.left="0px";const s=(e=>{let t=!1;return()=>{t||(e(),t=!0)}})(()=>{Ak&&u.addEventListener("mouseover",e=>{e.stopPropagation(),Rk(a,"root-area-hover","",e)})});n.addHandler(s);const d=new ResizeObserver(()=>n.exec([c,u,l]));Ik(()=>d.observe(l)),Ik(()=>d.observe(c)),t.appendChild(l),l.appendChild(u),l.appendChild(c);const f=()=>{!document.body.contains(l)&&c.parentElement&&(d.unobserve(l),d.unobserve(c),c.src="#",c.parentElement.removeChild(c),Nk.log("dispose"))},m=async e=>{u.style.visibility="hidden",(e=>{for(;;){const t=e.lastChild;if(!t)break;e.removeChild(t)}})(u),n.cleanup();for(const[t,...r]of e.sort(([e])=>"roi"===e?-1:1)){const e=Fk[t];let[o,i]=[null,null];if(!e)throw new Error("area-selector control not found "+t);[o,i]=e(Ik,Rk,a,...r),n.addHandler(i),u.appendChild(o)}await Hk(c),n.addHandler(([e])=>Pk(a,e)),n.addHandler(f),n.exec([c,u,l]),u.style.visibility="visible"};return Ik(()=>setTimeout(()=>Mk(a,Bk({setControls:m})))),t}"HTMLElement"in globalThis&&(Wk.prototype=Object.create(HTMLElement.prototype),customElements.define("react-declarative-area-selector",Wk));var zk,Vk,Yk=function(e,t){var n=!0;return n=(n=(n=(n=(n=(n=(n=n&&e.type===t.type)&&e.id===t.id)&&e.top===t.top)&&e.left===t.left)&&e.width===t.width)&&e.height===t.height)&&(e.angle||0)===(t.angle||0)},Uk=function(t){var n=Vr(t);return h(function(){return new function(){var t=this;this._cords=n.current.map(function(e){return a({},e)}),this.commitChange=function(e){var n=t._cords.find(function(t){var n=t.id;return e.id===n});n&&Object.assign(n,e)},this.getValue=function(){return function(t,n){if(t.length!==n.length)return!1;var o=r([],e(t),!1),i=r([],e(n),!1),a=function(e){return"".concat(e.type,"-").concat(e.id)};o.sort(function(e,t){return a(e).localeCompare(a(t))}),i.sort(function(e,t){return a(e).localeCompare(a(t))});for(var l=0;l<o.length;l++)if(!Yk(o[l],i[l]))return!1;return!0}(t._cords,n.current)?t._cords:t._cords=n.current.map(function(e){return a({},e)})}}},[])},qk=function(e,t,n){return void 0===t&&(t=100),void 0===n&&(n=100),e.map(function(e){var r=e.id,o=e.type,i=e.height,a=e.width,l=e.top,c=e.left,u=e.color,s=e.label,d=e.angle;return"rect"===o?((e="rect-unset-id",t=10,n=10,r=125,o=125,i=0,a="cyan",l="",c="",u="rgba(0, 0, 0, 0.5)")=>["rect",e,t,n,r,o,i,c,a,l,u])(r,l,c,i,a,d,u,s):"roi"===o?((e=10,t=10,n=10,r=10,o="blue",i="rgba(0, 0, 0, 0.5)")=>["roi",e,t,n,r,o,i])(l,c,n-c-a,t-l-i,u):console.error("lowLevelCords invalid cord type",o)})},$k=Tn()({parent:{position:"relative"}}),Xk=function(t){var n=t.src,r=void 0===n?"image.png":n,o=t.id,i=void 0===o?"unset":o,a=t.cords,l=void 0===a?[]:a,c=t.readonly,u=t.naturalHeight,s=t.naturalWidth,d=t.onChange,m=t.onClick,p=t.onHover,h=$k().classes,v=b(null),g=b(!0),y=Uk(l),w=y.getValue();return E(function(){v.current.innerHTML='\n <react-declarative-area-selector\n imageSrc="'.concat(r,'"\n id="').concat(i,'">\n </react-declarative-area-selector>\n ');var t=function(t){var n=e(t,2),r=n[0],o=n[1];m&&m(o,r)},n=function(t){var n=e(t,2),r=n[0],o=n[1];p&&p(o,r)};return function({areaRef:e=Mk,areaEvent:t=Rk,runRef:n=Ik,resizeCallback:r=Pk,readonlyFlag:o=Ak}){Mk=e,Rk=t,Pk=r,Ik=n,Ak=o}({areaRef:function(e,t){e===i&&(t.controls=qk(w,u,s))},areaEvent:function(r,o){for(var a=[],l=2;l<arguments.length;l++)a[l-2]=arguments[l];if(r===i)switch(o){case"rect-area-changed":!function(t){var n=e(t,6),r=n[0],o=n[1],i=n[2],a=n[3],l=n[4],c=n[5];if(g.current){var u={type:"rect",id:r,top:o,left:i,height:a,width:l,angle:c};y.commitChange(u),d(u)}}(a);break;case"roi-area-changed":!function(t){var n=e(t,4),r=n[0],o=n[1],i=n[2],a=n[3];if(g.current){var l={type:"roi",id:"roi",top:r,left:o,height:u-r-a,width:s-o-i,angle:0};y.commitChange(l),d(l)}}(a);break;case"rect-area-click":case"square-area-click":t(a);break;case"rect-area-hover":case"square-area-hover":case"root-area-hover":n(a);break;default:throw new Error("Selector unknown event type")}},readonlyFlag:c}),g.current=!0,function(){g.current=!1}},[r,i,w]),f.createElement("div",{className:h.parent,ref:v},f.createElement("img",{src:r}))},Gk=function(e){var t=e.src,n=void 0===t?"image.png":t,r=e.readonly,o=e.cords,i=void 0===o?[]:o,l=e.naturalHeight,c=void 0===l?100:l,u=e.naturalWidth,s=void 0===u?100:u,d=e.onChange,m=void 0===d?function(e){return console.log({cords:e})}:d,p=e.onClick,v=e.onHover,g=Vr(i),b=Jr(),y=b.reloadTrigger,w=b.doReload;Xr(w,[r]);var E=h(function(){return Zn(function(e){m(g.current.map(function(t){return t.id===e.id?a(a({},e),{color:t.color,label:t.label}):t}))},100)},[]);return f.createElement(Xk,{key:y,cords:i,readonly:r,src:n,id:n,naturalHeight:c,naturalWidth:s,onChange:function(e){!function(e){var t=e.top,n=e.left,r=e.height,o=e.width;return!(isNaN(t)||isNaN(n)||isNaN(r)||isNaN(o))}(e)?w():E(e)},onClick:p,onHover:v})},Kk=function(e){return new Promise(function(t,n){var r=document.createElement("img");r.crossOrigin="anonymous",r.onload=function(){var e=r.naturalHeight,n=r.naturalWidth;t({naturalHeight:e,naturalWidth:n})},r.onerror=function(){n()},r.src=e})},Qk=Tn()({readonly:(zk={},zk["& .".concat(Lk)]={display:"none;"},zk),root:{display:"flex","& > *":{width:"100%"},"& .react-declarative__roiAreaRect":{color:"white"}}}),Jk=x(function(r,o){var i,c=r.withNaturalSize,u=void 0!==c&&c,s=r.imageSize,d=r.className,m=r.src,p=r.cords,v=r.readonly,g=void 0!==v&&v,b=r.onLoadStart,y=r.onLoadEnd,w=r.sx,E=r.onChange,x=void 0===E?function(){}:E,C=r.onClick,k=void 0===C?function(){}:C,S=r.onHover,L=void 0===S?function(){}:S,N=l(r,["withNaturalSize","imageSize","className","src","cords","readonly","onLoadStart","onLoadEnd","sx","onChange","onClick","onHover"]),I=Qk().classes,M=no(x),R=no(k),P=no(L),A=e(Sc(function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return s?[2,s]:[4,Kk(m)];case 1:return[2,e.sent()]}})})},{onLoadStart:b,onLoadEnd:y}),2),T=A[0],D=A[1].error,j=h(function(){var e=new Set;return p.filter(function(t){return!e.has(t.id)&&e.add(t.id)})},[p]);return f.createElement(oa,a({ref:o,className:xo(d,I.root,(i={},i[I.readonly]=g,i)),sx:a(a({},u&&{height:s?s.naturalHeight:null==T?void 0:T.naturalHeight,width:s?s.naturalWidth:null==T?void 0:T.naturalWidth}),w)},N),T?f.createElement(Gk,{cords:j,naturalHeight:T.naturalHeight,naturalWidth:T.naturalWidth,onChange:M,onClick:R,onHover:P,readonly:g,src:m}):D?f.createElement(_,null,"Error aquired while fetching image"):f.createElement(_,null,"Loading..."))}),Zk=function(e){return void 0===e&&(e=1e3),{transformBox:"fill-box",transformOrigin:"center",animation:"".concat(D(Vk||(Vk=s(["\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n "],["\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n "])))," ").concat(e,"ms infinite linear")}},eS=Tn()({root:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:315,minWidth:315},spin1:Zk(1e3),spin2:Zk(1500),spin3:Zk(2500),spin4:Zk(2e3)}),tS=function(e){var t=e.className,n=l(e,["className"]),r=eS().classes,o=M(),i="light"===o.palette.mode?o.palette.primary.main:"#fff";return f.createElement(j,a({className:xo(t,r.root)},n),f.createElement("svg",{width:315,height:315,viewBox:"-25 -25 400 400"},f.createElement("circle",{className:r.spin4,stroke:i,transform:"rotate(-90 175 175)",cx:175,cy:175,r:105,strokeDasharray:1100,strokeWidth:10,strokeDashoffset:605,strokeLinecap:"round",fill:"none"}),f.createElement("circle",{className:r.spin3,stroke:i,transform:"rotate(-90 175 175)",cx:175,cy:175,r:130,strokeDasharray:1100,strokeWidth:10,strokeDashoffset:605,strokeLinecap:"round",fill:"none"}),f.createElement("circle",{className:r.spin2,stroke:i,transform:"rotate(-90 175 175)",cx:175,cy:175,r:155,strokeDasharray:1100,strokeWidth:10,strokeDashoffset:605,strokeLinecap:"round",fill:"none"}),f.createElement("circle",{className:r.spin1,stroke:i,transform:"rotate(-90 175 175)",cx:175,cy:175,r:175,strokeDasharray:1100,strokeWidth:10,strokeDashoffset:605,strokeLinecap:"round",fill:"none"})))},nS=null,rS=new lr,oS=function(e){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return t.trys.push([0,4,,5]),"copyToClipboard"in navigator?[4,window.navigator.copyToClipboard(e)]:[3,2];case 1:return t.sent(),[2];case 2:return[4,navigator.clipboard.writeText(e)];case 3:return t.sent(),[3,5];case 4:return t.sent(),function(e){var t=document.createElement("textarea");t.value=e,t.style.top="0",t.style.left="0",t.style.position="fixed",document.body.appendChild(t),t.focus(),t.select();try{var n=document.execCommand("copy")?"successful":"unsuccessful";console.log("Fallback: Copying text command was "+n)}catch(e){console.error("Fallback: Oops, unable to copy",e)}document.body.removeChild(t)}(e),[3,5];case 5:return[2]}})})},iS=function(e){return t(void 0,void 0,void 0,function(){var t,r;return n(this,function(n){switch(n.label){case 0:return[4,rS.next(e)];case 1:n.sent(),t=!0,n.label=2;case 2:return n.trys.push([2,7,8,9]),nS?[4,nS(e)]:[3,4];case 3:return n.sent(),[3,6];case 4:return[4,oS(e)];case 5:n.sent(),n.label=6;case 6:return[3,9];case 7:return r=n.sent(),console.error(r),t=!1,[3,9];case 8:return[2,t];case 9:return[2]}})})};iS.override=function(e){nS=e},iS.listen=function(e){return rS.subscribe(e)};var aS=Tn()(function(e){return{root:{display:"flex",alignItems:"center",gap:e.spacing(1)},content:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},icon:{marginRight:e.spacing(2),overflow:"hidden"},stretch:{flex:1}}}),lS=function(e){var r=e.className,o=e.content,i=e.fullWidth,c=e.transparent,u=e.children,s=void 0===u?o:u,d=e.onCopy,m=void 0===d?function(e){return function(){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||null==e?[4,iS(String(e))]:[2];case 1:return t.sent(),[2]}})})}}(o):d,p=e.onCopyClick,h=e.onLoadStart,v=e.onLoadEnd,g=e.fallback,b=e.throwError,w=void 0!==b&&b,E=l(e,["className","content","fullWidth","transparent","children","onCopy","onCopyClick","onLoadStart","onLoadEnd","fallback","throwError"]),x=aS().classes,C=y(function(e){return t(void 0,void 0,void 0,function(){var t,r;return n(this,function(n){switch(n.label){case 0:e.preventDefault(),e.stopPropagation(),t=!0,h&&h(),n.label=1;case 1:return n.trys.push([1,3,4,5]),p&&p(),[4,Promise.resolve(m(o))];case 2:return n.sent(),[3,5];case 3:if(r=n.sent(),t=!1,w)throw r;return g&&g(r),[3,5];case 4:return v&&v(t),[7];case 5:return[2]}})})},[m,h,v,g,w]);return f.createElement(j,a({className:xo(r,x.root)},E),f.createElement(_,{className:x.content,variant:"body1"},s),!!i&&f.createElement("div",{className:x.stretch}),f.createElement(ye,{className:x.icon,variant:c?"text":"outlined",onClick:C,startIcon:f.createElement(kn,null),size:"small"},!c&&"Copy"),!i&&f.createElement("div",{className:x.stretch}))},cS=function(e,t){if(!e||!t)return!1;var n=e.lat.toFixed(6),r=e.lng.toFixed(6),o=t.lat.toFixed(6),i=t.lng.toFixed(6),a=!0;return a=(a=a&&n===o)&&r===i},uS=function(e){var t=e.withZoomAdjust,n=void 0!==t&&t,r=e.value,o=e.readonly,i=void 0!==o&&o,c=e.zoom,u=void 0===c?15:c,s=e.token,d=void 0===s?"pk.eyJ1IjoidHJpcG9sc2t5cGV0ciIsImEiOiJjbHk0YWgzNmUwMGRiMmpzN3hzbjB4Z3J2In0.3oxAilQNCBFw7zO0AIbxfQ":s,m=e.onChange,p=void 0===m?function(){}:m,v=l(e,["withZoomAdjust","value","readonly","zoom","token","onChange"]),g=b(null),w=no(p),E=Vr(i),x=Vr(r),C=Gr(r),k=h(function(){return Zn(function(e){var t=function(e){var t=e.lat.toFixed(6),n=e.lng.toFixed(6);return{lat:parseFloat(t),lng:parseFloat(n)}}(e);cS(t,x.current)||w(t)},500)},[]);Gf(function(){return function(){g.current&&g.current(),k.clear()}});var S=y(function(e){var t=x.current;if(g.current&&g.current(),e&&t){window.mapboxgl.accessToken=d;var r,o=new window.mapboxgl.Map({container:e,style:"mapbox://styles/mapbox/streets-v12",center:t,zoom:u}),i=new ResizeObserver(function(){o.resize()}),a=new window.mapboxgl.Marker;if(t&&(a=a.setLngLat(t)),a.addTo(o),o.on("move",function(){if(!E.current){var e=o.getCenter(),t=e.lng,n=e.lat;a.setLngLat({lng:t,lat:n}),k({lat:n,lng:t})}}),n)o.on("zoomstart",function(){r=o.getCenter()}),o.on("zoomend",function(){o.setCenter(r),a.setLngLat(r)});a.addTo(o),i.observe(e);var l=C.subscribe(function(e){if(e){var t=o.getCenter();if(!cS(e,t)){var n=e.lng,r=e.lat;a.setLngLat({lng:n,lat:r}),o.setCenter({lng:n,lat:r})}}});g.current=fo(function(){i.unobserve(e),a.remove(),o.remove(),l()})}},[]);return r?f.createElement(j,a({ref:S},v)):f.createElement(ob,a({},v),f.createElement(_,null,"Point not choosen"))},sS=function(r){var o=r.disabled,i=r.className,a=r.style,l=r.sx,c=r.onClick,u=r.content,s=r.onCopy,d=void 0===s?function(e){return function(){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||null==e?[4,iS(String(e))]:[2];case 1:return t.sent(),[2]}})})}}(u):s,m=r.delay,p=void 0===m?800:m,v=r.variant,b=void 0===v?"text":v,y=r.size,E=void 0===y?"small":y,x=r.color,C=void 0===x?"info":x,k=r.startIcon,S=void 0===k?f.createElement(kn,null):k,L=r.label,N=void 0===L?u:L,I=e(g(!1),2),M=I[0],R=I[1],P=h(function(){return Zn(function(){R(!1)},p)},[]);return w(function(){return function(){return P.clear()}},[]),f.createElement(Nt,{className:i,style:a,sx:l,open:M,title:"Copied!",placement:"bottom",arrow:!0,disableFocusListener:!0,disableTouchListener:!0},f.createElement(ye,{disabled:o,variant:b,color:C,onClick:function(e){e.preventDefault(),e.stopPropagation(),c?c(e,function(){R(!0),d(String(u)),P()}):(R(!0),d(String(u)),P())},startIcon:S,size:E},N))},dS=function(t){function n(){var n=t.apply(this,r([],e(arguments),!1))||this;return n.componentDidMount=function(){var e;n.unsubscribe=null===(e=n.props.target)||void 0===e?void 0:e.subscribe(function(){n.forceUpdate()})},n.componentWillUnmount=function(){n.unsubscribe&&n.unsubscribe()},n.render=function(){return f.createElement(f.Fragment,null,n.props.children)},n}return u(n,t),n}(f.Component),fS=Tn()(function(e){return{root:{display:"flex",alignItems:"center",justifyContent:"center"},container:{display:"flex",alignItems:"center",justifyContent:"center",gap:e.spacing(1)}}}),mS=function(t){var n=t.className,r=t.children,o=t.expireAt,i=t.onExpire,c=void 0===i?function(){}:i,u=l(t,["className","children","expireAt","onExpire"]),s=fS().classes,d=e(g(),2),m=d[0],p=d[1],v=b(),E=no(c),x=h(function(){var e=new Date(o);return new Date(+e-Date.now())},[m]);w(function(){return v.current=setInterval(function(){p(Date.now())}),function(){clearInterval(v.current)}},[]),w(function(){+x<0&&(E(),clearInterval(v.current))},[x]);var C=y(function(){return+x<0?r?f.createElement(f.Fragment,null,r):f.createElement(f.Fragment,null,f.createElement(Sn,null),f.createElement(_,{variant:"body1"},"00:00")):f.createElement(f.Fragment,null,f.createElement(Sn,null),f.createElement(_,{variant:"body1"},x.getMinutes().toString().padStart(2,"0"),":",x.getSeconds().toString().padStart(2,"0")))},[x,r]);return f.createElement(j,a({className:xo(s.root,n)},u),f.createElement(j,{className:s.container},C()))},pS=function(e){var t=e.color,n=l(e,["color"]),r=re(),o=h(function(){return pe(a(a({},r),{palette:a(a({},r.palette),{primary:{main:t||r.palette.primary.main}})}))},[r,t]);return f.createElement(he,{theme:o},f.createElement(He,a({variant:"outlined"},n,{color:"primary"})))},hS=!1,vS=25,gS=null,bS=Tn()(function(e){var t;return{adjust:(t={},t[e.breakpoints.down("md")]={paddingBottom:vS},t),adjustForce:{paddingBottom:vS}}}),yS=function(){var e,t=bS().classes;return m.createElement("div",{className:xo((e={},e[t.adjust]=!hS,e[t.adjustForce]=hS,e))},gS&&S(gS))};yS.setAdjustForce=function(e){hS=e},yS.setAdjustHeight=function(e){vS=e},yS.setAdjustFiller=function(e){gS=e};var wS,ES=Tn()(function(e){return{root:{display:"flex",flexDirection:"column",alignItems:"stretch",justifyContent:"stretch",overflow:"hidden",background:e.palette.background.paper},label:{minHeight:"35px",width:"100%",display:"flex",alignItems:"center",background:"light"===e.palette.mode?A("#000",.05):e.palette.background.paper,"& > *":{paddingLeft:"6px",opacity:.5}},container:{position:"relative",background:"light"===e.palette.mode?e.palette.background.paper:A("#000",.05),flex:1},content:{position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *":{flex:1}},passthrough:{display:"block",width:"100%"}}}),xS=function(e){var t=e.passthrough,n=void 0!==t&&t,r=e.children,o=void 0===r?null:r,i=e.className,a=e.style,l=e.sx,c=e.label,u=ES().classes;return n?f.createElement(j,{className:xo(u.passthrough,i),sx:l,style:a},o):f.createElement(ke,{className:xo(u.root,i),sx:l,style:a},!!c&&f.createElement(j,{className:u.label},f.createElement(_,null,c)),f.createElement("div",{className:u.container},f.createElement("div",{className:u.content},o)))},CS="react-declatative__master-detail-root",kS="react-declatative__master-detail-header",SS=Tn()(function(e){return{root:{display:"flex",alignItems:"stretch",justifyContent:"stretch"},sideMenu:{flex:1,maxWidth:256,overflowY:"auto",borderRight:"1px solid ".concat(e.palette.divider)},listItem:{"&:not(:last-of-type)":{borderBottom:"1px solid ".concat(e.palette.divider)}},content:{position:"relative",flex:1,overflowY:"auto",padding:e.spacing(1)}}}),LS=function(e){var t=e.children,n=e.items,r=e.onChange,o=SS().classes;return f.createElement(j,{className:o.root},f.createElement(Ie,{disablePadding:!0,dense:!0,className:xo(o.sideMenu,kS)},n.filter(function(e){return!!e.visible}).map(function(e,t){var n=e.id,i=e.active,a=e.disabled,l=e.icon,c=e.label;return f.createElement(tt,{disableGutters:!0,disablePadding:!0,dense:!0,key:"".concat(n,"-").concat(t),className:o.listItem},f.createElement(Me,{disabled:a,selected:i,onClick:function(){return r(n)}},!!l&&f.createElement(F,null,f.createElement(l,null)),f.createElement(Oe,null,c)))})),f.createElement(j,{className:o.content},t))},NS=Tn()(function(e){return{root:{display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column"},header:{background:"light"===e.palette.mode?$("#000",.05):e.palette.background.paper},content:{position:"relative",flex:1,overflowY:"auto",padding:e.spacing(1)},tabsRoot:{marginLeft:"0 !important",minHeight:48,height:48},tabRoot:{minHeight:48,height:48}}}),IS=function(e){var t=e.items,n=e.children,r=e.onChange,o=NS().classes,i=h(function(){return t.find(function(e){return e.active})},[t]);return f.createElement(j,{className:o.root},f.createElement(lt,{className:xo(o.header,kS),variant:"scrollable",indicatorColor:"primary",value:null==i?void 0:i.id,classes:{root:o.tabsRoot},onChange:function(e,t){return r(t)}},t.filter(function(e){return e.visible}).map(function(e,t){var n=e.id,r=e.label,i=e.disabled,a=e.icon;return f.createElement(at,{key:"".concat(n,"-").concat(t),label:r,value:n,disabled:i,icon:a&&f.createElement(a,null),iconPosition:"start",classes:{root:o.tabRoot}})})),f.createElement(j,{className:o.content},n))};!function(e){e.Paper="paper",e.Outline="outline",e.Card="card",e.Tabs="tabs"}(wS||(wS={}));var MS,RS=wS,PS=Tn()(function(e,t,n){var r,o,i=t.headerAdjust;return{root:{display:"grid"},desktop:(r={gridTemplateColumns:"256px 1fr"},r["& .".concat(n.sideMenu)]={paddingRight:e.spacing(2),paddingBottom:e.spacing(2)},r),mobile:(o={gridTemplateColumns:"1fr"},o["& .".concat(n.sideMenu)]={paddingBottom:e.spacing(1)},o),outline:{border:"1px solid ".concat($(e.palette.getContrastText(e.palette.background.default),.23)),borderRadius:"4px"},sideMenu:{overflowY:"auto",maxHeight:"80vh",overflowX:"hidden",width:"100%","& > * > *":{width:"100%"}},content:{position:"relative",overflowY:"auto",overflowX:"hidden"},listItem:{"&:not(:last-of-type)":{borderBottom:"1px solid ".concat(e.palette.divider)}},fixedPos:{position:"fixed",top:i,width:240}}}),AS=function(t){var n,r=t.mode,o=t.loading,i=t.items,a=t.children,l=t.onChange,c=t.withMenuCollapse,u=t.withFixedPos,s=t.fixedPosHeaderAdjust,d=b(null),m=e(g(!1),2),p=m[0],h=m[1],v=nl().isWide,y=PS({headerAdjust:s}).classes;w(function(){var e=d.current,t=null==e?void 0:e.closest(".".concat(CS));if(u&&e&&t){var n=function(){var e=t.getBoundingClientRect().top,n=document.documentElement.scrollTop;h(n>(e+=n))};return n(),document.addEventListener("scroll",n),function(){return document.removeEventListener("scroll",n)}}},[d.current,v]);var E=function(){return f.createElement(Ie,{disablePadding:!0,dense:!0},i.map(function(e,t){var n=e.id,r=e.active,o=e.disabled,i=e.icon,a=e.label;return f.createElement(tt,{disableGutters:!0,disablePadding:!0,dense:!0,key:"".concat(n,"-").concat(t),className:y.listItem},f.createElement(Me,{disabled:o,selected:r,onClick:function(){return l(n)}},!!i&&f.createElement(F,null,f.createElement(i,null)),f.createElement(Oe,null,a)))}))};return f.createElement(j,{className:xo(y.root,(n={},n[y.desktop]=v&&!!i.length,n[y.mobile]=!v,n))},function(){var e,t;return r===RS.Paper?f.createElement(f.Fragment,null,f.createElement("div",{className:y.sideMenu},(!!i.length||!!o||!c)&&f.createElement(ee,{className:xo(kS,(e={},e[y.fixedPos]=p&&v,e)),ref:d},E())),f.createElement("div",{className:y.content},a)):r===RS.Outline?f.createElement(f.Fragment,null,f.createElement("div",{className:y.sideMenu},(!!i.length||!!o||!c)&&f.createElement(j,{className:xo(kS,y.outline,(t={},t[y.fixedPos]=p&&v,t)),ref:d},E())),f.createElement("div",{className:y.content},a)):null}())},TS=Tn()(function(e,t){var n=t.headerAdjust,r=t.width;return{root:{position:"relative",width:"100%"},header:{height:64,background:e.palette.background.default,display:"flex",alignItems:"center",zIndex:9,width:r},headerAbsolute:{position:"absolute",top:0,left:0},headerFixed:{position:"fixed",top:n},headerNone:{visibility:"hidden",pointerEvents:"none"},adjust:{paddingBottom:64},paper:{width:r,display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *":{flex:1}},tabsRoot:{minHeight:54,height:54,marginLeft:"0 !important",marginRight:"0 !important"},tabRoot:{minHeight:54,height:54},disabledTab:{opacity:.5,cursor:"not-allowed"},indicator:{height:4,background:e.palette.primary.main}}}),DS=function(t){var n,r=t.children,o=t.items,i=t.onChange,a=t.loading,l=t.withFixedPos,c=t.withTransparentTabs,u=t.fixedPosHeaderAdjust,s=b(null),d=yi(),m=d.elementRef,p=d.size.width,v=e(g(!1),2),y=v[0],E=v[1],x=TS({headerAdjust:u,width:p||"100%"}).classes;w(function(){var e=s.current,t=null==e?void 0:e.closest(".".concat(CS));if(l&&e&&t){var n=function(){var e=t.getBoundingClientRect().top,n=document.documentElement.scrollTop;E(n>(e+=n))};return n(),document.addEventListener("scroll",n),function(){return document.removeEventListener("scroll",n)}}},[s.current,a]);var C=h(function(){var e;return(null===(e=o.find(function(e){return e.active}))||void 0===e?void 0:e.id)||"unknown"},[o]),k=function(){return f.createElement(lt,{variant:"scrollable",indicatorColor:"primary",value:C,classes:{root:x.tabsRoot,indicator:x.indicator},onChange:function(e,t){return i(t)}},o.map(function(e,t){var n,r=e.id,o=e.label,i=e.disabled,a=e.icon;return f.createElement(at,{className:xo((n={},n[x.disabledTab]=i,n)),key:"".concat(r,"-").concat(t),label:o,value:r,disabled:i,icon:a&&f.createElement(a,null),iconPosition:"start",classes:{root:x.tabRoot}})}))};return f.createElement(j,{ref:m,className:x.root},function(){var e;return c?f.createElement(j,{className:kS,sx:{zIndex:9}},k()):f.createElement(j,{className:xo(kS,x.header,(e={},e[x.headerNone]=!o.length,e[x.headerAbsolute]=!y,e[x.headerFixed]=y,e))},f.createElement(ke,{className:x.paper},k()))}(),!c&&f.createElement("div",{ref:s,className:xo((n={},n[x.adjust]=!!o.length,n))}),r)},jS=function(e){var t=nl().isMobile;return e.mode===RS.Tabs?f.createElement(DS,a({},e)):e.mode===RS.Outline||e.mode===RS.Paper?f.createElement(AS,a({},e)):t||!e.items.length?f.createElement(IS,a({},e)):f.createElement(LS,a({},e))},OS=jw.createLoader(48),FS=function(){return f.createElement(f.Fragment,null)},_S=Tn()({root:{width:"100%",minHeight:225,display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *":{flex:1}}}),BS=function(o){var i=o.mode,c=void 0===i?RS.Card:i,u=o.withTransparentTabs,s=void 0!==u&&u,d=o.withMenuCollapse,m=void 0!==d&&d,p=o.withFixedPos,v=void 0!==p&&p,b=o.fixedPosHeaderAdjust,y=void 0===b?0:b,E=o.title,x=o.className,C=o.style,k=o.sx,S=o.activeOption,L=void 0===S?"":S,N=o.payload,I=o.deps,M=void 0===I?[]:I,R=o.options,P=o.children,A=o.Loader,T=void 0===A?OS:A,D=o.Error,O=void 0===D?FS:D,F=o.onActiveOptionChange,_=o.fallback,B=o.onLoadStart,H=o.onLoadEnd,W=o.throwError,z=nl().isMobile,V=_S().classes,Y=e(g(L),2),U=Y[0],q=Y[1],$=Vr(U),X=e(g([]),2),G=X[0],K=X[1],Q=Ti(function(e){return t(void 0,void 0,void 0,function(){var r,o;return n(this,function(i){switch(i.label){case 0:return[4,Promise.all(R.map(function(r){return t(void 0,void 0,void 0,function(){var t,o=r.id,i=r.label,c=r.isVisible,u=void 0===c?function(){return!0}:c,s=r.isDisabled,d=void 0===s?function(){return!1}:s,f=r.isActive,m=void 0===f?function(){return $.current===o}:f,p=l(r,["id","label","isVisible","isDisabled","isActive"]);return n(this,function(n){switch(n.label){case 0:return t={id:o},[4,u(e)];case 1:return t.visible=n.sent(),[4,d(e)];case 2:return t.disabled=n.sent(),[4,m(e)];case 3:return[2,a.apply(void 0,[(t.active=n.sent(),t.label=i||jb(o),t),p])]}})})}))];case 1:return r=(r=i.sent()).filter(function(e){return e.visible}),o=r.find(function(e){return e.active})||r[0],o&&(o.active=!0),[2,r]}})})},{onLoadStart:B,onLoadEnd:H,throwError:W,fallback:_}),J=Q.loading,Z=Q.error,ee=Q.execute;w(function(){ee(N).then(function(e){if(e){if(!$.current){var t=e.find(function(e){return e.active});t&&te(t.id,!0)}K(e)}})},r([N,U],e(M),!1));var te=function(e,t){void 0===t&&(t=!1),q(e),F&&F(e,t)},ne=h(function(){var e=!1;return e=(e=(e=e||c===RS.Outline)||c===RS.Paper)||c===RS.Tabs},[c]);return f.createElement(j,{className:xo(x,V.root),style:C,sx:k},f.createElement(xS,{className:CS,passthrough:ne,label:z?void 0:E},J?f.createElement(T,null):Z?f.createElement(O,null):f.createElement(jS,{withTransparentTabs:s,withMenuCollapse:m,withFixedPos:v,fixedPosHeaderAdjust:y,loading:J,items:G,mode:c,onChange:te},P)))},HS=function(){function t(t){void 0===t&&(t="root");var n=this;this._name=t,this.UML_STEP="\t",this.nodeMap=new Map,this.nodes=[],this.entries=[],this.provide=0,this.canceled=!1,this.createNode=function(e){return n.nodeMap.has(e)?n.nodeMap.get(e):n.nodeMap.set(e,{key:e,nodes:[]}).get(e)},this.beginProvide=function(e){n.canceled||(n.entries.unshift(n.createNode(e)),n.provide+=1)},this.endProvide=function(e){n.canceled||(n.entries.shift(),n.provide-=1)},this.beginInject=function(t,r){if(!n.canceled){r&&console.log("resolutionManager beginInject key=".concat(String(t)," root=").concat(n.isRootNodeState," pending=").concat(n.isPendingProvideState));var o=e(n.entries,1)[0],i=n.createNode(t);n.isRootNodeState&&n.nodes.push(i),n.isPendingProvideState&&o.nodes.push(i)}},this.endInject=function(e,t){n.canceled||t&&console.log("resolutionManager endInject key=".concat(String(e)," root=").concat(n.isRootNodeState," pending=").concat(n.isPendingProvideState))},this.toYamlUML=function(t){if(void 0===t&&(t=3),console.log("ResolutionManager building UML for ".concat(n._name)),n.canceled)return console.log("ResolutionManager collecting UML canceled due to async resolve found"),"";var o=[],i=function(a,l){var u,s;void 0===l&&(l=0);try{for(var d=c(a),f=d.next();!f.done;f=d.next()){var m=f.value,p=m.key,h=m.nodes,v=r([],e(new Array(l)),!1).fill(n.UML_STEP).join("");h.length&&l<t?(o.push("".concat(v).concat(String(p),":")),i(h,l+1)):o.push("".concat(v).concat(String(p),': ""'))}}catch(e){u={error:e}}finally{try{f&&!f.done&&(s=d.return)&&s.call(d)}finally{if(u)throw u.error}}};return i(n.nodes),r(r(["@startyaml"],e(o),!1),["@endyaml"],!1).join("\n")},this.cancelResolution=function(){n.canceled=!0,n.provide=0,n.nodeMap.clear(),n.nodes=[],n.entries=[]}}return Object.defineProperty(t.prototype,"isRootNodeState",{get:function(){return 0===this.provide},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isPendingProvideState",{get:function(){var t=e(this.entries,1)[0];return!!(void 0===t?null:t)},enumerable:!1,configurable:!0}),t}(),WS=function(o){void 0===o&&(o="root");var i=this;this._name=o,this.InstanceRef=function(e){var r;return(r=function(e,o){var i=this;this.queueFactory=Kn(function(e){return t(i,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,e];case 1:return[2,t.sent()]}})})}),r._waitPool.push(o),r._keys.push(e),this.queueFactory(o).then(function(e){e!==Xn&&Object.setPrototypeOf(i,e)})})._waitPool=[],r._keys=[],r.waitForProvide=function(o){return t(void 0,void 0,void 0,function(){return n(r,function(t){switch(t.label){case 0:return[4,Promise.all(this._waitPool.map(function(t,n){return t.then(function(){o&&console.info("react-declarative serviceManager ".concat(e," waitForProvide done for ").concat(String(r._keys[n])))}),t.catch(function(t){throw o&&console.info("react-declarative serviceManager ".concat(e," waitForProvide error for ").concat(String(r._keys[n]))),t}),t}))];case 1:return t.sent(),[2]}})})},r}(this._name),this._creators=new Map,this._instances=new Map,this._resolutionOrder=[],this._reverseCounter=0,this.resolutionManager=new HS(this._name),this._checkCircularDependency=function(e){var t=i._resolutionOrder.lastIndexOf(e);if(-1!==t){var n=i._resolutionOrder.length,r=i._resolutionOrder.slice(Math.max(t-1,0),n);throw r.push(r[0]),console.warn('react-declarative serviceManager "'.concat(i._name,'" circular dependency'),r.map(function(e){return e.toString()}).join("->")),new Error("Circular Dependency detected")}i._resolutionOrder.push(e)},this._updateResolutionOrder=function(t){if(0===i._reverseCounter){var n=i._resolutionOrder.slice(0,t),o=i._resolutionOrder.slice(t).reverse();i._resolutionOrder=r(r([],e(n),!1),e(o),!1)}},this.registerInstance=function(e,t){i._instances.has(e)||i._instances.set(e,t)},this.registerCreator=function(e,t){i._creators.has(e)||i._creators.set(e,function(){i.resolutionManager.beginProvide(e);var n=t();return n instanceof Promise&&i.resolutionManager.cancelResolution(),i.resolutionManager.endProvide(e),n})},this.inject=function(e,t){if(void 0===t&&(t=!0),i._instances.has(e)){i.resolutionManager.beginInject(e,t);var n=i._instances.get(e);return i.resolutionManager.endInject(e,t),n}if(i._creators.has(e)){i._checkCircularDependency(e);var r=Math.max(i._resolutionOrder.length-1,0);i._reverseCounter++,i.resolutionManager.beginInject(e,t);var o=i._creators.get(e)();return i.resolutionManager.endInject(e,t),n=o instanceof Promise?new i.InstanceRef(e,o):o,i._reverseCounter--,i._updateResolutionOrder(r),i._instances.set(e,n),n}return t&&console.error("react-declarative serviceManager ".concat(i._name," unknown service"),e),null},this.waitForProvide=fo(function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];return t(i,r([],e(o),!1),void 0,function(e){return void 0===e&&(e=!1),n(this,function(t){switch(t.label){case 0:return[4,this.InstanceRef.waitForProvide(e)];case 1:return t.sent(),[2]}})})}),this.prefetch=fo(function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];return t(i,r([],e(o),!1),void 0,function(e){var t,r,o,i,a,l,u,s,d,f,m,p,h,v;return void 0===e&&(e=!0),n(this,function(n){switch(n.label){case 0:this.unload.clear(),n.label=1;case 1:n.trys.push([1,19,,20]),t=new Set(this._resolutionOrder),n.label=2;case 2:n.trys.push([2,8,9,10]),r=c(this._resolutionOrder),o=r.next(),n.label=3;case 3:return o.done?[3,7]:(u=o.value,e&&console.info("react-declarative serviceManager ".concat(this._name," prefetch ").concat(String(u))),(s=this._instances.get(u)).prefetch?[4,s.prefetch()]:[3,5]);case 4:n.sent(),n.label=5;case 5:n.label=6;case 6:return o=r.next(),[3,3];case 7:return[3,10];case 8:return i=n.sent(),m={error:i},[3,10];case 9:try{o&&!o.done&&(p=r.return)&&p.call(r)}finally{if(m)throw m.error}return[7];case 10:n.trys.push([10,16,17,18]),a=c(this._instances.keys()),l=a.next(),n.label=11;case 11:return l.done?[3,15]:(u=l.value,t.has(u)?[3,14]:(e&&console.info("react-declarative serviceManager ".concat(this._name," prefetch ").concat(String(u))),(s=this._instances.get(u)).prefetch?[4,s.prefetch()]:[3,13]));case 12:n.sent(),n.label=13;case 13:n.label=14;case 14:return l=a.next(),[3,11];case 15:return[3,18];case 16:return d=n.sent(),h={error:d},[3,18];case 17:try{l&&!l.done&&(v=a.return)&&v.call(a)}finally{if(h)throw h.error}return[7];case 18:return[3,20];case 19:throw f=n.sent(),e&&console.error("react-declarative serviceManager ".concat(this._name," prefetch error"),f),f;case 20:return[2]}})})}),this.unload=fo(function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];return t(i,r([],e(o),!1),void 0,function(e){var t,r,o,i,a,l,u,s,d,f,m,p,h,v;return void 0===e&&(e=!0),n(this,function(n){switch(n.label){case 0:this.prefetch.clear(),n.label=1;case 1:n.trys.push([1,19,,20]),t=new Set(this._resolutionOrder),n.label=2;case 2:n.trys.push([2,8,9,10]),r=c(this._resolutionOrder),o=r.next(),n.label=3;case 3:return o.done?[3,7]:(u=o.value,e&&console.info("react-declarative serviceManager ".concat(this._name," unload ").concat(String(u))),(s=this._instances.get(u)).unload?[4,s.unload()]:[3,5]);case 4:n.sent(),n.label=5;case 5:n.label=6;case 6:return o=r.next(),[3,3];case 7:return[3,10];case 8:return i=n.sent(),m={error:i},[3,10];case 9:try{o&&!o.done&&(p=r.return)&&p.call(r)}finally{if(m)throw m.error}return[7];case 10:n.trys.push([10,16,17,18]),a=c(this._instances.keys()),l=a.next(),n.label=11;case 11:return l.done?[3,15]:(u=l.value,t.has(u)?[3,14]:(e&&console.info("react-declarative serviceManager ".concat(this._name," unload ").concat(String(u))),(s=this._instances.get(u)).unload?[4,s.unload()]:[3,13]));case 12:n.sent(),n.label=13;case 13:n.label=14;case 14:return l=a.next(),[3,11];case 15:return[3,18];case 16:return d=n.sent(),h={error:d},[3,18];case 17:try{l&&!l.done&&(v=a.return)&&v.call(a)}finally{if(h)throw h.error}return[7];case 18:return[3,20];case 19:throw f=n.sent(),e&&console.error("react-declarative serviceManager ".concat(this._name," unload error"),f),f;case 20:return[2]}})})}),this.clear=function(){i._resolutionOrder=[],i._reverseCounter=0,i._creators.clear(),i._instances.clear(),i.prefetch.clear(),i.unload.clear()},this.toUML=function(e){return void 0===e&&(e=3),i.resolutionManager.toYamlUML(e)},this.disableUML=function(){return i.resolutionManager.cancelResolution()}},zS=new function(){var o=this;this.registerInstance=function(e,t){return o._serviceManager.registerInstance(e,t)},this.registerCreator=function(e,t){return o._serviceManager.registerCreator(e,t)},this.inject=function(e,t){return void 0===t&&(t=!0),o._serviceManager.inject(e,t)},this.waitForProvide=function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];return t(o,r([],e(i),!1),void 0,function(e){return void 0===e&&(e=!0),n(this,function(t){switch(t.label){case 0:return[4,this._serviceManager.waitForProvide(e)];case 1:return[2,t.sent()]}})})},this.prefetch=function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];return t(o,r([],e(i),!1),void 0,function(e){return void 0===e&&(e=!0),n(this,function(t){switch(t.label){case 0:return[4,this._serviceManager.prefetch(e)];case 1:return[2,t.sent()]}})})},this.unload=function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];return t(o,r([],e(i),!1),void 0,function(e){return void 0===e&&(e=!0),n(this,function(t){switch(t.label){case 0:return[4,this._serviceManager.unload(e)];case 1:return[2,t.sent()]}})})},this.clear=function(){return o._serviceManager.clear()},this.toUML=function(){return o._serviceManager.toUML()},this.disableUML=function(){return o._serviceManager.disableUML()},window.__reactDeclarative_ServiceManager||(window.__reactDeclarative_ServiceManager=new WS("global")),this._serviceManager=window.__reactDeclarative_ServiceManager},VS=zS.registerCreator,YS=zS.waitForProvide,US=zS.inject,qS=zS.prefetch,$S=zS.unload,XS=function(e){void 0===e&&(e="unknown");var r=new WS(e);return{serviceManager:r,provide:r.registerCreator,inject:function(t){var n=r.inject(t,!1);if(n)return n;var o=zS.inject(t,!1);return!o&&console.error("react-declarative serviceManager ".concat(e," unknown service"),t),o},prefetch:function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,zS.prefetch()];case 1:return e.sent(),[4,r.prefetch()];case 2:return e.sent(),[2]}})})},unload:function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,r.unload()];case 1:return e.sent(),[2]}})})},dispose:function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,r.unload()];case 1:return e.sent(),[4,zS.unload()];case 2:return e.sent(),[2]}})})}}},GS=new function(){var t=this;this._closeSubject=new lr,this.init=function(){var n=t,o=function(t){function o(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];var a=t.apply(this,r([],e(o),!1))||this;return a.addEventListener("close",function(e){n._closeSubject.next(e)}),a.addEventListener("error",function(e){n._closeSubject.next(e)}),a}return u(o,t),o}(window.WebSocket);window.WebSocket=o},this.listenDisconnect=function(e){return t._closeSubject.subscribe(e)}},KS=function(e,t){var n,r;try{for(var o=c(e),i=o.next();!i.done;i=o.next()){var a=i.value,l=a.path;if(_t(void 0===l?"/":l,[]).test(t))return a}}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return null},QS=function(e,t){var n,r,o=function(e){var n={},r=[],o=_t(e,r);if(o.test(t)){var i=o.exec(t);return i&&r.forEach(function(e,t){n[e.name]=i[t+1]}),{value:n}}};try{for(var i=c(e),a=i.next();!a.done;a=i.next()){var l=o(a.value.path);if("object"==typeof l)return l.value}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return null},JS=function(e){function t(t,n){var r=e.call(this)||this;return r._item=null,r._params=null,r.dispose=function(){r._unsubscribe()},r._unsubscribe=n.listen(function(e){var n=e.location;r._params=QS(t,n.pathname),r._item=KS(t,n.pathname),r.next()}),r._params=QS(t,location.pathname),r._item=KS(t,location.pathname),r}return u(t,e),Object.defineProperty(t.prototype,"params",{get:function(){return this._params},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"item",{get:function(){return this._item},enumerable:!1,configurable:!0}),t}(lr),ZS=function(e,t){var n=new JS(e,t),r=function(){return n.params};return r.clear=n.dispose(),r},eL=function(e,t){var n=new JS(e,t),r=function(){return n.item};return r.clear=n.dispose(),r},tL=function(t){function n(o){var i=t.apply(this,r([],e(o),!1))||this;return i.includes=function(e){return i._sourceHash.has(e)},i.filter=function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];var l=o;return new n(t.prototype.filter.apply(i,r([],e(l),!1)))},i.map=function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];var l=o;return new n(t.prototype.map.apply(i,r([],e(l),!1)))},i.push=function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var a=t.prototype.push.apply(i,r([],e(n),!1));return i._sourceHash=new Set(i),a},i.pop=function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var a=t.prototype.pop.apply(i,r([],e(n),!1));return i._sourceHash=new Set(i),a},i.unshift=function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var a=t.prototype.unshift.apply(i,r([],e(n),!1));return i._sourceHash=new Set(i),a},i.shift=function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var a=t.prototype.shift.apply(i,r([],e(n),!1));return i._sourceHash=new Set(i),a},i.splice=function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var a=t.prototype.splice.apply(i,r([],e(n),!1));return i._sourceHash=new Set(i),a},i.slice=function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];return new n(t.prototype.slice.apply(i,r([],e(o),!1)))},i.concat=function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];return new n(t.prototype.concat.apply(i,r([],e(o),!1)))},i.toArray=function(){return new(Array.bind.apply(Array,r([void 0],e(i),!1)))},i._sourceHash=new Set(o),i}return u(n,t),n}(Array),nL=function(e){var t=e.readonly,n=e.value,r=e.onValueChange,o=Jr(),i=o.reloadTrigger,a=o.doReload,l=Gr(t);return w(function(){return l.subscribe(a)},[]),{key:i,readOnly:t,value:t?n:void 0,defaultValue:n,onBlur:function(e){r(e.target.value)}}},rL=Tn()({container:{position:"relative",display:"flex",alignItems:"stretch",justifyContent:"stretch",maxHeight:"45vh",overflowY:"auto",overflowX:"hidden"},content:{flex:1,display:"flex",flexDirection:"column",justifyContent:"stretch"},loader:{position:"absolute",top:0,left:0,right:0,bottom:0,height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center"},beforeContent:{width:"100%",display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *":{flex:1}},afterContent:{width:"100%",display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *":{flex:1}}}),oL=function(r){var o=r.keepMounted,i=void 0!==o&&o,a=r.AfterContent,l=r.BeforeContent,c=r.deps,u=r.payload,s=r.onLoadStart,d=r.onLoadEnd,m=r.onAction,p=void 0===m?function(){}:m,h=r.options,v=void 0===h?[]:h,b=r.fallback,y=r.reloadSubject,w=r.throwError,E=rL().classes,x=e(g(null),2),C=x[0],k=x[1],S=e(g(0),2),L=S[0],N=S[1],I=no(p),M=Vr(v),R=function(){N(function(e){return e+1}),s&&s()},P=function(e){N(function(e){return Math.max(e-1,0)}),d&&d(e)},A=Ti(I,{onLoadStart:R,onLoadEnd:P,throwError:w,fallback:b}).execute;return{elementProps:{onContextMenu:function(e){if(M.current.length){e.preventDefault(),e.stopPropagation();var t=document.elementFromPoint(e.clientX,e.clientY);k(t||e.target)}}},render:function(){return f.createElement(W,{keepMounted:i,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},anchorEl:C,open:!!C,onClose:function(){return k(null)},MenuListProps:{disablePadding:!0,sx:{pt:l?0:1,pb:a?0:1}}},f.createElement(j,{className:E.container},0!==L&&f.createElement(j,{className:E.loader},f.createElement(O,{size:14})),f.createElement(j,{className:E.content,sx:{visibility:0!==L?"hidden":"visible"}},l&&f.createElement(j,{className:E.beforeContent},f.createElement(l,null)),M.current.map(function(e,r){var o=e.label,i=void 0===o?"unknown-label":o,a=e.action,l=void 0===a?"unknown-action":a,s=e.divider,d=e.icon,m=e.isDisabled,p=void 0===m?function(){return!1}:m,h=e.isVisible,v=void 0===h?function(){return!0}:h;return f.createElement(Zr,{Loader:function(){return s?null:f.createElement(B,{sx:{visibility:"hidden",minWidth:225}},!!d&&f.createElement(F,null,f.createElement(d,null)),f.createElement(_,{variant:"inherit"},i))},throwError:w,fallback:b,key:r,onLoadStart:R,onLoadEnd:P,reloadSubject:y,deps:c,payload:u},function(e){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return[4,$n(0)];case 1:return n.sent(),[4,p(e)];case 2:return t=n.sent(),[4,v(e)];case 3:return n.sent()?s?[2,f.createElement(H,{orientation:"horizontal"})]:[2,f.createElement(B,{disabled:t,onClick:(r=l,function(e){e.preventDefault(),e.stopPropagation(),A(r),k(null)}),sx:{minWidth:225}},!!d&&f.createElement(F,null,f.createElement(d,null)),f.createElement(_,{variant:"inherit"},i))]:[2,null]}var r})})})}),a&&f.createElement(j,{className:E.afterContent},f.createElement(a,null)))))}}},iL=function(e){var t=no(e);return h(function(){return fo(t)},[])},aL=function(t,n){var r=Fr(function(){return new JS(t,n)}),o=b(!0),i=e(g(r.item),2),a=i[0],l=i[1];return w(function(){return r.subscribe(function(){o.current&&l(r.item)})},[]),w(function(){return function(){r.dispose()}},[]),E(function(){return function(){o.current=!1}},[]),a},lL=function(t,n){var r=Fr(function(){return new JS(t,n)}),o=b(!0),i=e(g(r.params),2),a=i[0],l=i[1];return w(function(){return r.subscribe(function(){o.current&&l(r.params)})},[]),w(function(){return function(){r.dispose()}},[]),E(function(){return function(){o.current=!1}},[]),a},cL=function(r){void 0===r&&(r=[]);var o=_r(),i=Vr(r),a=Xr(function(){o.next()},r),l=y(function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,o.toPromise()];case 1:return e.sent(),[2,i.current]}})})},[]);return{useChanges:function(){var t=e(g(!0),2)[1];w(function(){return o.subscribe(function(){t(function(e){return!e})})},[])},waitForChanges:l,changeSubject:o,watch:a}},uL=function(){var t=e(g(!0),2)[1];return y(function(){t(function(e){return!e})},[])},sL=function(e){var t=new function(){e&&Object.setPrototypeOf(this,e)};return{pointer:t,setPointer:function(e){Object.setPrototypeOf(t,e)}}},dL=function(e){return h(function(){var t=sL(e);return[t.pointer,t.setPointer]},[])},fL=function(e,t){return Bt(e,{encode:decodeURIComponent})(t)},mL=function(e,t){return Ht(e,{decode:decodeURIComponent})(t)||null},pL=function(e){var t,n,r="Unknown error";return"string"==typeof e?r=e:"object"==typeof e&&null!==e&&(void 0!==(null===(t=null==e?void 0:e.error)||void 0===t?void 0:t.message)?r=e.error.message:void 0!==(null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.message)?r=e.data.message:void 0!==(null==e?void 0:e.message)&&(r=e.message)),r},hL=function(o,i){var u=i.delay,s=void 0===u?0:u,d=i.onError,f=void 0===d?function(){}:d,m=i.onProgress,p=void 0===m?function(){}:m,h=i.onFinish,v=void 0===h?function(){}:h,w=i.onBegin,x=void 0===w?function(){}:w,C=i.onEnd,k=void 0===C?function(){}:C,S=l(i,["delay","onError","onProgress","onFinish","onBegin","onEnd"]),L=e(jr(function(){return{errors:[],progress:0}}),2),N=L[0],I=L[1],M=e(g(""),2),R=M[0],P=M[1],A=no(f),T=no(v),D=no(p),j=no(k),O=no(x),F=b(!0),_=y(function(e){return I(function(t){return a(a({},t),{progress:e})})},[]),B=y(function(e){return I(function(t){return a(a({},t),{errors:e})})},[]),H=y(function(t){return I(function(n){return a(a({},n),{errors:r(r([],e(n.errors),!1),[t],!1)})})},[]),W=ro(function(i){return t(void 0,void 0,void 0,function(){var a,l,u,d,f,m,p,h,v,g,b,y,w,E,x,C,k;return n(this,function(S){switch(S.label){case 0:O(),_(0),B([]),a=function(r){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return[4,Promise.all([o(r),$n(s)])];case 1:return t=e.apply(void 0,[n.sent(),1]),[2,t[0]]}})})},l=0,u=!0,d=[],S.label=1;case 1:S.trys.push([1,9,10,11]),f=c(i),m=f.next(),S.label=2;case 2:if(m.done)return[3,8];if(p=m.value,h=p.label,v=p.data,!F.current)return[2];S.label=3;case 3:return S.trys.push([3,5,6,7]),P(h),b=(g=d).push,[4,a({label:h,data:v})];case 4:return b.apply(g,[S.sent()]),[3,7];case 5:return y=S.sent(),u=!1,d.push(null),w={label:h,message:pL(y),error:y},H(w),A(r(r([],e(N.current.errors),!1),[w],!1))?[3,7]:(_(100),[3,8]);case 6:return L=++l,I=i.length,E=Math.min(100,Math.round(Math.max(L,0)/I*100)),_(E),D(E),[7];case 7:return m=f.next(),[3,2];case 8:return[3,11];case 9:return x=S.sent(),C={error:x},[3,11];case 10:try{m&&!m.done&&(k=f.return)&&k.call(f)}finally{if(C)throw C.error}return[7];case 11:return T(i.map(function(e){return e.data}),N.current.errors,d),j(u),[2]}var L,I})})},a(a({},S),{throwError:!0})),z=W.execute,V=W.loading;return E(function(){return function(){F.current=!1}},[]),a({execute:y(function(e){z(e)},[]),loading:V,label:R},N.current)},vL=function(t){var n=t.src,r=b(null),o=e(g(!1),2),i=o[0],a=o[1],l=Jr(),c=l.doReload,u=l.reloadTrigger,s=function(){a(!1)};return{audioRef:r,render:function(){return f.createElement(f.Fragment,null,i&&f.createElement("audio",{key:u,ref:r,src:n,controls:!0,autoPlay:!0,hidden:!0,onEnded:s}))},play:function(){a(!0),c()}}},gL=function(e){w(e,[])},bL=Symbol("change"),yL=Symbol("refresh"),wL=1e3,EL=function(e){function t(n,r,o){void 0===r&&(r=wL),void 0===o&&(o=function(){return i._data});var i=e.call(this)||this;return i._debounce=r,i._prevData=o,i._dropChanges=new lr,i._change=function(){i.emit(bL,i)},i.handleDropChanges=function(){i._dropChanges.next()},i.refresh=function(){return i.emit(yL,i)},i.toObject=function(){return i.data},i._data=n instanceof t?n.data:"function"==typeof n?n():n,i.setData=i.setData.bind(i),i.handleChange=i.handleChange.bind(i),i}return u(t,e),Object.defineProperty(t.prototype,"data",{get:function(){return Object.freeze(this._data)},enumerable:!1,configurable:!0}),t.prototype.setData=function(e){"function"==typeof e&&(e=e(this._prevData())),this._data=a(a({},this._data),e),this._change()},t.prototype.handleChange=function(e){var t=this,n=Zn(e,this._debounce),r=this._dropChanges.subscribe(n.clear);return this.subscribe(bL,n),this.subscribe(yL,e),function(){t.unsubscribe(bL,n),t.unsubscribe(yL,e),n.clear(),r()}},t}(Un),xL=function(){function e(e,r){var o=this;this._model$=e,this._dispose=r,this._waitForListeners=function(){return new Promise(function(e){return t(o,void 0,void 0,function(){var t,r,o,i=this;return n(this,function(n){switch(n.label){case 0:return t=!1,r=this._dispose.subscribe(function(){return t=!0}),[4,$n(0)];case 1:return n.sent(),(o=function(){i._model$.current.hasListeners||t?(r(),e(t)):setTimeout(o,10)})(),[2]}})})})},this.setData=function(e){return t(o,void 0,void 0,function(){var t=this;return n(this,function(n){switch(n.label){case 0:return[4,this._waitForListeners().then(function(n){n||t._model$.current.setData(e)})];case 1:return n.sent(),[2]}})})},this.refresh=function(){return t(o,void 0,void 0,function(){var e=this;return n(this,function(t){switch(t.label){case 0:return[4,this._waitForListeners().then(function(t){t||e._model$.current.refresh()})];case 1:return t.sent(),[2]}})})},this.toObject=function(){return o._model$.current.toObject()},this.toModel=function(){return o._model$.current}}return Object.defineProperty(e.prototype,"data",{get:function(){return this._model$.current.data},enumerable:!1,configurable:!0}),e}(),CL=function(t){var n=t.initialValue,r=t.onChange,o=void 0===r?function(){return null}:r,i=t.debounce,a=void 0===i?wL:i,l=b(null),c=Fr(function(){return new hw}),u=y(function(){return l.current.data},[]),s=e(g(function(){return new EL(n,a,u)}),2),d=s[0],f=s[1];l.current=d;var m=no(o);return w(function(){return d.handleChange(function(e){if(!c.data){var t=new EL(e,a,u);l.current=t,f(t),m(new xL(l,c))}})},[d]),E(function(){return function(){l.current.handleDropChanges(),c.next(!0)}},[]),h(function(){return new xL(l,c)},[d])},kL=function(e){function t(t,n,r){void 0===n&&(n=wL),void 0===r&&(r=function(){return o._data});var o=e.call(this,t,n,r)||this;return o.setData=function(t){"function"==typeof t&&(t=t(o._prevData())),void 0===t.id&&(t.id=Kr()),e.prototype.setData.call(o,a({},t))},o.handleChange=function(t){return e.prototype.handleChange.call(o,t)},o}return u(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._data.id},enumerable:!1,configurable:!0}),t}(EL),SL=function(){function e(e,r){var o=this;this._entity$=e,this._dispose=r,this._waitForListeners=function(){return new Promise(function(e){return t(o,void 0,void 0,function(){var t,r,o,i=this;return n(this,function(n){switch(n.label){case 0:return t=!1,r=this._dispose.subscribe(function(e){return t=e}),[4,$n(0)];case 1:return n.sent(),(o=function(){i._entity$.current.hasListeners||t?(r(),e(t)):setTimeout(o,10)})(),[2]}})})})},this.setData=function(e){return t(o,void 0,void 0,function(){var t=this;return n(this,function(n){switch(n.label){case 0:return[4,this._waitForListeners().then(function(n){n||t._entity$.current.setData(e)})];case 1:return n.sent(),[2]}})})},this.refresh=function(){return t(o,void 0,void 0,function(){var e=this;return n(this,function(t){switch(t.label){case 0:return[4,this._waitForListeners().then(function(t){t||e._entity$.current.refresh()})];case 1:return t.sent(),[2]}})})},this.toObject=function(){return o._entity$.current.toObject()},this.toEntity=function(){return o._entity$.current}}return Object.defineProperty(e.prototype,"data",{get:function(){return this._entity$.current.data},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this._entity$.current.id},enumerable:!1,configurable:!0}),e}(),LL=function(t){var n=t.initialValue,r=t.onChange,o=void 0===r?function(){return null}:r,i=t.debounce,a=void 0===i?wL:i,l=b(null),c=Fr(function(){return new hw}),u=y(function(){return l.current.data},[]),s=e(g(function(){return new kL(n,a,u)}),2),d=s[0],f=s[1];l.current=d;var m=no(o);return w(function(){return d.handleChange(function(e){if(!c.data){var t=new kL(e,a,u);l.current=t,f(t),m(new SL(l,c))}})},[d]),E(function(){return function(){l.current.handleDropChanges(),c.next(!0)}},[]),h(function(){return new SL(l,c)},[d])},NL=function(t,n){var o=n.initialValue,i=void 0===o?[]:o,a=n.onChange,l=e(g(new Map(i.map(function(e,t){return[t,e]}))),2),c=l[0],u=l[1],s=b(!0),d=h(function(){return r([],e(c.values()),!1)},[c]);w(function(){s.current?s.current=!1:a&&a(d)},[d]);return{onAddItem:function(t){var n=Math.max.apply(Math,r(r([],e(c.keys()),!1),[0],!1))+1;return c.set(n,t),u(new Map(c)),n},onUpdateItem:function(e,t){c.set(e,t),u(new Map(c))},onRemoveItem:function(e){c.delete(e),u(new Map(c))},items:d,render:function(){return m.createElement(m.Fragment,null,r([],e(c.entries()),!1).map(function(n,r){var o=e(n,2),i=o[0],a=o[1];return m.createElement(k,{key:r},t(i,a))}))}}},IL=function(r){var o=void 0===r?{}:r,i=o.fallback,a=o.onLoadStart,l=o.onLoadEnd,c=o.onChange,u=void 0===c?function(){}:c,s=o.throwError,d=void 0!==s&&s,f=o.withInitialVideo,m=void 0!==f&&f,p=o.withInitialAudio,v=void 0!==p&&p,b=o.compressFrame,y=void 0===b?.8:b,E=o.maxFps,x=void 0===E?25:E,C=e(g(""),2),k=C[0],S=C[1],L=e(g(""),2),N=L[0],I=L[1],M=e(g(""),2),R=M[0],P=M[1],A=Vr(k),T=Vr(N),D=Vr(R),j=no(u),O=h(function(){return Zn(j,100)},[]),F=Fr(function(){return new MediaStream}),_=no(function(){return t(void 0,void 0,void 0,function(){var t,r,o,c,u,s;return n(this,function(n){switch(n.label){case 0:t=!0,n.label=1;case 1:return n.trys.push([1,3,4,5]),a&&a(),[4,navigator.mediaDevices.getDisplayMedia({video:{frameRate:{max:x},width:{ideal:window.screen.width*y},height:{ideal:window.screen.height*y}},audio:!1})];case 2:return r=n.sent(),o=F.getVideoTracks().find(function(e){return e.id===R}),o&&F.removeTrack(o),c=e(r.getVideoTracks(),1),(u=c[0]).addEventListener("inactive",function(){var e=F.getVideoTracks().find(function(e){return e.id===R});e&&F.removeTrack(e),P(""),O(F,{screenCaptureId:"",audioCaptureId:A.current,cameraCaptureId:T.current})}),F.addTrack(u),P(u.id),O(F,{screenCaptureId:u.id,audioCaptureId:A.current,cameraCaptureId:T.current}),[3,5];case 3:if(s=n.sent(),t=!1,d)throw s;return i&&i(s),[3,5];case 4:return l&&l(t),[7];case 5:return[2]}})})}),B=no(function(){return t(void 0,void 0,void 0,function(){var t,r,o,c,u,s;return n(this,function(n){switch(n.label){case 0:t=!0,n.label=1;case 1:return n.trys.push([1,3,4,5]),a&&a(),[4,navigator.mediaDevices.getUserMedia({video:{facingMode:"user",frameRate:{max:x},width:{min:0,max:window.screen.width*y},height:{min:0,max:window.screen.height*y}},audio:!1})];case 2:return r=n.sent(),o=F.getVideoTracks().find(function(e){return e.id===N}),o&&F.removeTrack(o),c=e(r.getVideoTracks(),1),(u=c[0]).addEventListener("inactive",function(){var e=F.getVideoTracks().find(function(e){return e.id===N});e&&F.removeTrack(e),I(""),O(F,{screenCaptureId:D.current,audioCaptureId:A.current,cameraCaptureId:""})}),F.addTrack(u),I(u.id),O(F,{screenCaptureId:D.current,audioCaptureId:A.current,cameraCaptureId:u.id}),[3,5];case 3:if(s=n.sent(),t=!1,d)throw s;return i&&i(s),[3,5];case 4:return l&&l(t),[7];case 5:return[2]}})})}),H=no(function(){return t(void 0,void 0,void 0,function(){var t,r,o,c,u,s;return n(this,function(n){switch(n.label){case 0:t=!0,n.label=1;case 1:return n.trys.push([1,3,4,5]),a&&a(),[4,navigator.mediaDevices.getUserMedia({video:!1,audio:{sampleSize:16,channelCount:2}})];case 2:return r=n.sent(),o=F.getAudioTracks().find(function(e){return e.id===k}),o&&F.removeTrack(o),c=e(r.getAudioTracks(),1),(u=c[0]).addEventListener("inactive",function(){var e=F.getAudioTracks().find(function(e){return e.id===k});e&&F.removeTrack(e),S(""),O(F,{screenCaptureId:D.current,audioCaptureId:"",cameraCaptureId:T.current})}),F.addTrack(u),S(u.id),O(F,{screenCaptureId:D.current,audioCaptureId:u.id,cameraCaptureId:T.current}),[3,5];case 3:if(s=n.sent(),t=!1,d)throw s;return i&&i(s),[3,5];case 4:return l&&l(t),[7];case 5:return[2]}})})}),W=no(function(){var e=F.getVideoTracks().find(function(e){return e.id===R});e&&e.stop()}),z=no(function(){var e=F.getVideoTracks().find(function(e){return e.id===N});e&&e.stop()}),V=no(function(){var e=F.getAudioTracks().find(function(e){return e.id===k});e&&e.stop()});return w(function(){m&&B(),v&&H()},[]),{mediaStream:F,hasAudioCapture:!!A.current,hasCameraCapture:!!T.current,hasScreenCapture:!!D.current,requestScreenCapture:_,requestCameraCapture:B,requestAudioCapture:H,stopScreenCapture:W,stopCameraCapture:z,stopAudioCapture:V}},ML=Symbol("reorder"),RL=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t}(Error),PL=function(t){function n(o,i,a){void 0===o&&(o=[]),void 0===i&&(i=wL),void 0===a&&(a=function(){return l.items});var l=t.call(this)||this;if(l._debounce=i,l._prevData=a,l._items=new Map,l._ids=new Map,l._dropChanges=new lr,l._prevEntity=function(e){return function(){var t=l._prevData().find(function(t){return t.id===e.id});return t?t.data:e}},l._change=function(e){l.emit(bL,l,e)},l._refresh=function(e){l.emit(yL,l,e)},l._reorder=function(){l.emit(ML,l,null)},l._dispose=function(){var e,t;try{for(var n=c(l._items.values()),r=n.next();!r.done;r=n.next()){var o=r.value;o.unsubscribe(bL,l._change),o.unsubscribe(yL,l._refresh)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}l._items.clear(),l._ids.clear()},l.setData=function(e){l._dispose();for(var t=0;t!==e.length;t++){var n=e[t],r=new kL(n,l._debounce,l._prevEntity(n));l._items.set(t,r),l._ids.set(r.id,t),r.subscribe(bL,l._change),r.subscribe(yL,l._refresh)}l._reorder()},l.clear=function(){l._dispose(),l._reorder()},l.map=function(e){return l.items.map(e)},l.filter=function(e){return l.items.filter(e)},l.find=function(e){return l.items.find(e)},l.some=function(e){return l.items.some(e)},l.forEach=function(e){return l.items.forEach(e)},l.push=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=e.flat(),r=l.lastIdx,o=0;o!==n.length;o++){var i=r+o,a=n[o];void 0===a.id&&(a.id=i);var c=new kL(a,l._debounce,l._prevEntity(a));l._items.set(i,c),l._ids.set(c.id,i),c.subscribe(bL,l._change),c.subscribe(yL,l._refresh)}l._reorder()},l.upsert=function(){for(var t,n,o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];var a=o.flat(),u=new Map(a.map(function(e){return[e.id,e]})),s=new Set;try{for(var d=c(l._items.values()),f=d.next();!f.done;f=d.next()){var m=f.value,p=u.get(m.id);p&&(m.setData(p),s.add(m.id))}}catch(e){t={error:e}}finally{try{f&&!f.done&&(n=d.return)&&n.call(d)}finally{if(t)throw t.error}}l.push.apply(l,r([],e(a.filter(function(e){var t=e.id;return!s.has(t)})),!1))},l.remove=function(e){l.removeById(e.id)},l.removeById=function(t){var n,r;try{for(var o=c(l._items.entries()),i=o.next();!i.done;i=o.next()){var a=e(i.value,2),u=a[0],s=a[1];if(s.id===t)return l._items.delete(u),l._ids.delete(t),s.unsubscribe(bL,l._change),s.unsubscribe(yL,l._refresh),void l._reorder()}}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}throw new RL("removeById unknown entity id ".concat(t))},l.removeAll=function(){var t,n;try{for(var r=c(l._items.entries()),o=r.next();!o.done;o=r.next()){var i=e(o.value,2),a=i[0],u=i[1];l._items.delete(a),l._ids.delete(u.id),u.unsubscribe(bL,l._change),u.unsubscribe(yL,l._refresh)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}l._reorder()},l.findById=function(e){if(l._ids.has(e)){var t=l._ids.get(e);return l._items.get(t)}throw new RL("findById unknown entity id ".concat(e))},l.handleChange=function(e){var t=Zn(e,l._debounce),n=l._dropChanges.subscribe(t.clear);return l.subscribe(bL,t),l.subscribe(yL,e),l.subscribe(ML,e),function(){l.unsubscribe(bL,t),l.unsubscribe(yL,e),l.unsubscribe(ML,e),t.clear(),n()}},l.handleDropChanges=function(){var e,t;try{for(var n=c(l._items.values()),r=n.next();!r.done;r=n.next()){r.value.handleDropChanges()}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}l._dropChanges.next()},l.refresh=function(){return l.emit(yL,l,null)},l.toArray=function(){return l.map(function(e){return e.toObject()})},o instanceof n){var u=o.items;o._dispose(),o=u}else o="function"==typeof o?o().map(function(e){return new kL(e,l._debounce,l._prevEntity(e))}):o.map(function(e){return e instanceof kL&&(e=e.data),new kL(e,l._debounce,l._prevEntity(e))});return o.forEach(function(e,t){l._items.set(t,e),l._ids.set(e.id,t),e.subscribe(bL,l._change),e.subscribe(yL,l._refresh)}),l}return u(n,t),Object.defineProperty(n.prototype,"items",{get:function(){return r([],e(this._items.entries()),!1).sort(function(t,n){var r=e(t,1)[0],o=e(n,1)[0];return Number(r)-Number(o)}).map(function(e){return e[1]})},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"lastIdx",{get:function(){return Math.max.apply(Math,r(r([],e(this._items.keys()),!1),[-1],!1))+1},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ids",{get:function(){return r([],e(this._ids.keys()),!1)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isEmpty",{get:function(){return 0===this._items.size},enumerable:!1,configurable:!0}),n}(Un),AL=function(){function e(e,r,o){var i=this;this.id=e,this._collection$=r,this._dispose=o,this._waitForListeners=function(){return new Promise(function(e,r){return t(i,void 0,void 0,function(){var t,o,i,a=this;return n(this,function(n){switch(n.label){case 0:return t=!1,o=this._dispose.subscribe(function(e){return t=e}),[4,$n(0)];case 1:return n.sent(),(i=function(){try{a._collection$.current.findById(a.id).hasListeners||t?(o(),e(t)):setTimeout(i,TL)}catch(e){r(e)}})(),[2]}})})})},this.setData=function(e){return t(i,void 0,void 0,function(){var t,r=this;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this._waitForListeners().then(function(t){var n=r._collection$.current.findById(r.id);t||n.setData(e)})];case 1:return n.sent(),[3,3];case 2:if(!((t=n.sent())instanceof RL))throw t;return console.error("Entity (ID ".concat(this.id,") not found in collection (setData)")),[3,3];case 3:return[2]}})})},this.refresh=function(){return t(i,void 0,void 0,function(){var e,t=this;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this._waitForListeners().then(function(e){var n=t._collection$.current.findById(t.id);e||n.refresh()})];case 1:return n.sent(),[3,3];case 2:if(!((e=n.sent())instanceof RL))throw e;return console.error("Entity (ID ".concat(this.id,") not found in collection (refresh)")),[3,3];case 3:return[2]}})})},this.toObject=function(){try{return i._collection$.current.findById(i.id).toObject()}catch(e){throw e instanceof RL?new Error("Entity (ID ".concat(i.id,") not found in collection (toObject)")):e}},this.toEntity=function(){try{return i._collection$.current.findById(i.id)}catch(e){throw e instanceof RL?new Error("Entity (ID ".concat(i.id,") not found in collection (toEntity)")):e}}}return Object.defineProperty(e.prototype,"data",{get:function(){try{return this._collection$.current.findById(this.id).data}catch(e){throw e instanceof RL?new Error("Entity (ID ".concat(this.id,") not found in collection (data getter)")):e}},enumerable:!1,configurable:!0}),e}(),TL=10,DL=function(){function o(o,i){var a=this;this._collection$=o,this._dispose=i,this._waitForListeners=function(){return new Promise(function(e){return t(a,void 0,void 0,function(){var t,r,o,i=this;return n(this,function(n){switch(n.label){case 0:return t=!1,r=this._dispose.subscribe(function(e){return t=e}),[4,$n(0)];case 1:return n.sent(),(o=function(){i._collection$.current.hasListeners||t?(r(),e(t)):setTimeout(o,TL)})(),[2]}})})})},this.setData=function(e){return t(a,void 0,void 0,function(){var t=this;return n(this,function(n){switch(n.label){case 0:return[4,this._waitForListeners().then(function(n){n||t._collection$.current.setData(e)})];case 1:return n.sent(),[2]}})})},this.refresh=function(){return t(a,void 0,void 0,function(){var e=this;return n(this,function(t){switch(t.label){case 0:return[4,this._waitForListeners().then(function(t){t||e._collection$.current.refresh()})];case 1:return t.sent(),[2]}})})},this.clear=function(){return t(a,void 0,void 0,function(){var e=this;return n(this,function(t){switch(t.label){case 0:return[4,this._waitForListeners().then(function(t){t||e._collection$.current.clear()})];case 1:return t.sent(),[2]}})})},this.push=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return t(a,void 0,void 0,function(){var t=this;return n(this,function(n){switch(n.label){case 0:return[4,this._waitForListeners().then(function(n){var i;n||(i=t._collection$.current).push.apply(i,r([],e(o),!1))})];case 1:return n.sent(),[2]}})})},this.upsert=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return t(a,void 0,void 0,function(){var t=this;return n(this,function(n){switch(n.label){case 0:return[4,this._waitForListeners().then(function(n){var i;n||(i=t._collection$.current).upsert.apply(i,r([],e(o),!1))})];case 1:return n.sent(),[2]}})})},this.remove=function(e){return t(a,void 0,void 0,function(){var t=this;return n(this,function(n){switch(n.label){case 0:return[4,this._waitForListeners().then(function(n){n||t._collection$.current.remove(e)})];case 1:return n.sent(),[2]}})})},this.removeById=function(e){return t(a,void 0,void 0,function(){var t=this;return n(this,function(n){switch(n.label){case 0:return[4,this._waitForListeners().then(function(n){n||t._collection$.current.removeById(e)})];case 1:return n.sent(),[2]}})})},this.removeAll=function(){return t(a,void 0,void 0,function(){var e=this;return n(this,function(t){switch(t.label){case 0:return[4,this._waitForListeners().then(function(t){t||e._collection$.current.removeAll()})];case 1:return t.sent(),[2]}})})},this.findById=function(e){var t=a._collection$.current.findById(e);return new AL(t.id,a._collection$,a._dispose)},this.some=function(e){return a.items.some(e)},this.forEach=function(e){a.items.forEach(e)},this.find=function(e){return a.items.find(e)},this.filter=function(e){return a.items.filter(e)},this.map=function(e){return a.items.map(e)},this.toArray=function(){return a._collection$.current.toArray()},this.toCollection=function(){return a._collection$.current}}return Object.defineProperty(o.prototype,"ids",{get:function(){return this._collection$.current.ids},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"lastIdx",{get:function(){return this._collection$.current.lastIdx},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"items",{get:function(){var e=this;return this._collection$.current.items.map(function(t){var n=t.id;return new AL(n,e._collection$,e._dispose)})},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"isEmpty",{get:function(){return this._collection$.current.isEmpty},enumerable:!1,configurable:!0}),o}(),jL=function(t){var n=void 0===t?{}:t,r=n.initialValue,o=void 0===r?[]:r,i=n.onChange,a=void 0===i?function(){return null}:i,l=n.debounce,c=void 0===l?wL:l,u=b(null),s=Fr(function(){return new hw}),d=y(function(){return u.current.items},[]),f=e(g(function(){return new PL(o,c,d)}),2),m=f[0],p=f[1];u.current=m;var v=no(a);return w(function(){return m.handleChange(function(e,t){if(!s.data){var n=new PL(e,c,d);u.current=n,p(n),v(new DL(u,s),t?new AL(t.id,u,s):null)}})},[m]),E(function(){return function(){u.current.handleDropChanges(),s.next(!0)}},[]),h(function(){return new DL(u,s)},[m])},OL=function(t){var n=t.message,r=void 0===n?"Client update successful":n,o=t.noSnackOnOk,i=void 0!==o&&o,a=t.loading,l=t.error,c=t.delay,u=void 0===c?5e3:c,s=t.onClose,d=void 0===s?function(){}:s,m=e(g(null),2),p=m[0],h=m[1],v=_r(),b=function(){v.next(),h(null)},w=no(d),E=function(e){return h(function(){return f.createElement(tn,{open:!0,key:Kr(),anchorOrigin:{vertical:"bottom",horizontal:"center"},autoHideDuration:u,onClose:b,message:e})})},x=Xr(function(){l&&(E(l),v.once(function(){return w(!1)})),l||a||(i?w(!0):(E(r),v.once(function(){return w(!0)})))},[a,l]);return{beginWatch:x.beginWatch,resetWatcher:x.resetWatcher,stopWatch:x.stopWatch,render:y(function(){return f.createElement(f.Fragment,null,p)},[p])}},FL=function(e){var r=e.resultSubject,o=e.duration,i=e.message,a=e.button,l=void 0===a?"Open":a,c=di(),u=c.loading,s=c.handleLoadStart,d=c.handleLoadEnd,m=re(),p=Fr(Kr);return f.createElement(tn,{open:!0,key:p,anchorOrigin:{vertical:"bottom",horizontal:"center"},autoHideDuration:o,onClose:function(){return!1},message:i,ContentProps:{sx:{background:m.palette.background.paper,color:m.palette.getContrastText(m.palette.background.paper),"& > *":{color:m.palette.getContrastText(m.palette.background.paper)}}},action:f.createElement(we,{direction:"row",gap:1,mr:1,alignItems:"center"},f.createElement(si,{variant:"contained",disabled:u,onLoadStart:s,onLoadEnd:d,color:"primary",size:"small",onClick:function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,r.next(!0)];case 1:return e.sent(),[2]}})})}},l),f.createElement(si,{variant:"outlined",sx:{display:"flex",alignItems:"center",justifyContent:"center"},disabled:u,onLoadStart:s,onLoadEnd:d,color:"primary",size:"small",onClick:function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,r.next(!1)];case 1:return e.sent(),[2]}})})}},f.createElement(Fe,{sx:{display:"flex"}})))})},_L=function(r){var o=void 0===r?{}:r,i=o.duration,a=void 0===i?6e3:i,l=o.onResult,c=void 0===l?function(){}:l,u=e(g(null),2),s=u[0],d=u[1],m=Vr(s),p=al([s],50),h=_r();w(function(){return h.subscribe(function(){d(null)})},[]),w(function(){return h.subscribe(c)},[]);var v=y(function(e,t){return f.createElement(FL,{message:e,button:t,duration:a,resultSubject:h})},[]);return{render:function(){return f.createElement(f.Fragment,null,s)},pickData:y(function(e){return t(void 0,[e],void 0,function(e){var t=e.message,r=e.button,o=void 0===r?"Open":r;return n(this,function(e){switch(e.label){case 0:return m.current?[4,h.next(!1)]:[3,3];case 1:return e.sent(),[4,p()];case 2:e.sent(),e.label=3;case 3:return d(v(t,o)),[4,h.toPromise()];case 4:return[2,e.sent()]}})})},[]),close:y(function(){return h.next(!1)},[])}},BL=Tn()({root:(MS={display:"flex",alignItems:"stretch",justifyContent:"stretch","& .MuiPaper-root":{background:"transparent"}},MS["& .".concat(Rp)]={flex:1,height:"unset !important",width:"unset !important"},MS["& .".concat("react-declarative__mobileListRoot")]={background:"transparent !important"},MS)}),HL=function(t){var n=t.onChange,o=void 0===n?function(e){return console.log({data:e})}:n,i=t.handler,a=t.title,l=t.columns,c=t.open,u=void 0===c||c,s=t.selectionMode,d=t.selectedRows,m=void 0===d?null:d,p=t.minHeight,h=t.minWidth,v=t.rowActions,b=e(g(m),2),y=b[0],w=b[1],E=BL().classes;Xr(function(){u||w(m)},[m]);return f.createElement(Wf,{open:u,onAccept:function(){return o(y)},onDismiss:function(){return o(null)}},!!a&&f.createElement(mt,null,f.createElement(j,{mr:3},a)),f.createElement(j,{className:E.root,style:{minHeight:p,minWidth:h}},f.createElement(Pv,{sizeByElement:!0,withLoader:!0,withSelectOnRowClick:!0,isChooser:!0,handler:i,columns:l,selectedRows:y||void 0,selectionMode:s,onSelectedRows:function(e,t){t||w(e)},onRowClick:function(t){var n=t.id;return w(function(t){return t&&s===Li.Multiple?r(r([],e(t),!1),[n],!1):[n]})},rowActions:v})))},WL=function(r){var o=r.handler,i=r.columns,l=r.rowActions,c=r.payload,u=r.features,s=r.selectionMode,d=void 0===s?Li.Single:s,m=r.title,p=void 0===m?"Pick item":m,h=r.minWidth,v=void 0===h?425:h,g=r.minHeight,y=void 0===g?375:g,E=r.selectedRows,x=no(function(){return{title:p,minWidth:v,minHeight:y,selectedRows:E||null,open:!1}}),C=e(oo(x),2),k=C[0],S=C[1];w(function(){k.current.open||S(function(e){return a(a({},e),{title:p})})},[p]),w(function(){k.current.open||S(function(e){return a(a({},e),{minWidth:v})})},[v]),w(function(){k.current.open||S(function(e){return a(a({},e),{minHeight:y})})},[y]),w(function(){k.current.open||S(function(e){return a(a({},e),{selectedRows:E||null})})},[E]);var L=b(),N=function(e){var t=L.current;t&&t(e),S(x),R()},I=Bf(function(){return f.createElement(HL,{open:!0,payload:c,features:u,selectionMode:d,minHeight:k.current.minHeight,minWidth:k.current.minWidth,title:k.current.title,columns:i,handler:o,selectedRows:k.current.selectedRows,onChange:N,rowActions:l})},[]),M=I.showModal,R=I.hideModal;return function(e){var r=void 0===e?{}:e,o=r.title,i=r.minWidth,a=r.minHeight,l=r.selectedRows;return new function(){var e=this;this.then=function(e){L.current=e},this.toPromise=function(){return t(e,void 0,void 0,function(){var e;return n(this,function(t){switch(t.label){case 0:return e=new lr,this.then(e.next),[4,e.toPromise()];case 1:return[2,t.sent()]}})})},S(function(e){return{title:void 0!==o?o:e.title,minWidth:void 0!==i?i:e.minWidth,minHeight:void 0!==a?a:e.minHeight,selectedRows:void 0!==l?l:e.selectedRows,open:!0}}),M()}}},zL=function(t){var n=t.accept,o=t.onSelect,i=b(null),a=function(){var t,n=null===(t=i.current)||void 0===t?void 0:t.files;(null==n?void 0:n.length)&&(o&&o.apply(void 0,r([],e(Array.from(n)),!1)),i.current&&(i.current.value=""))};return{render:function(){return m.createElement("input",{type:"file",style:{display:"none"},onChange:a,ref:i,accept:n})},open:function(){var e;null===(e=i.current)||void 0===e||e.click()}}},VL=Tn()({password:{fontFamily:"text-security-disc","-webkit-text-security":"disc",textSecurity:"disc"}}),YL=function(t){var n,r=t.onChange,o=void 0===r?function(e){return console.log({result:e})}:r,i=t.canCancel,a=void 0===i||i,l=t.title,c=t.value,u=t.inputType,s=t.placeholder,d=t.open,m=void 0===d||d,p=t.large,h=VL().classes,v=b(null),y=e(g(c),2),E=y[0],x=y[1];w(function(){return x(c)},[c]),w(function(){var e=v.current;setTimeout(function(){if(null==e?void 0:e.value){var t=e.value.length;e.setSelectionRange(t,t)}},500)},[]);var C=function(){return o(E)},k=function(){return o(null)};return f.createElement(Wf,{open:m,canCancel:a,onAccept:C,onDismiss:k},f.createElement(mt,null,f.createElement(j,{sx:{width:p?"100vw":"unset",maxWidth:p?"100%":"unset"},mr:3},l)),f.createElement(j,{p:3},f.createElement(Gt,{className:xo((n={},n[h.password]="password"===u,n)),inputRef:v,type:u,autoFocus:!0,minRows:3,maxRows:p?20:3,multiline:!0,value:E,sx:{width:"100%"},placeholder:s,onChange:function(e){var t=e.target;return x(t.value)},onKeyDown:function(e){var t=e.key;"Enter"===t?C():"Escape"===t&&k()}})))},UL=function(r){var o=void 0===r?{}:r,i=o.title,l=void 0===i?"Prompt":i,c=o.value,u=void 0===c?"":c,s=o.placeholder,d=void 0===s?"Prompt":s,m=o.canCancel,p=void 0===m||m,h=o.large,v=void 0!==h&&h,g=o.inputType,y=b(),E=no(function(){return{currentCanCancel:p,currentPlaceholder:d,currentTitle:l,currentValue:u,open:!1}}),x=e(oo(E),2),C=x[0],k=x[1];w(function(){C.current.open||k(function(e){return a(a({},e),{currentCanCancel:p})})},[p]),w(function(){C.current.open||k(function(e){return a(a({},e),{currentPlaceholder:d})})},[d]),w(function(){C.current.open||k(function(e){return a(a({},e),{currentTitle:l})})},[l]),w(function(){C.current.open||k(function(e){return a(a({},e),{currentValue:u})})},[u]);var S=function(e){var t=y.current;t&&t(e),k(E),I()},L=Bf(function(){return f.createElement(YL,{open:!0,large:v,inputType:g,canCancel:C.current.currentCanCancel,title:C.current.currentTitle,value:C.current.currentValue,placeholder:C.current.currentPlaceholder,onChange:S})},[]),N=L.showModal,I=L.hideModal;return function(e){var r=void 0===e?{}:e,o=r.canCancel,i=r.title,a=r.placeholder,l=r.value;return new function(){var e=this;this.then=function(e){y.current=e},this.toPromise=function(){return t(e,void 0,void 0,function(){var e;return n(this,function(t){switch(t.label){case 0:return e=new lr,this.then(e.next),[4,e.toPromise()];case 1:return[2,t.sent()]}})})},k(function(e){return{currentPlaceholder:void 0!==a?a:e.currentPlaceholder,currentCanCancel:void 0!==o?o:e.currentCanCancel,currentTitle:void 0!==i?i:e.currentTitle,currentValue:void 0!==l?l:e.currentValue,open:!0}}),N()}}},qL=function(e){var t=e.onOk,n=e.title,r=e.description,o=e.open,i=void 0===o||o,a=e.large;return f.createElement(Wf,{open:i,canCancel:!1,onAccept:t},f.createElement(mt,null,f.createElement(j,{sx:{width:a?"100vw":"unset",maxWidth:a?"100%":"unset"},mr:3},n)),f.createElement(j,{p:3},f.createElement(Gt,{autoFocus:!0,readOnly:!0,minRows:3,maxRows:a?20:3,multiline:!0,value:r,sx:{width:"100%"}})))},$L=function(r){var o=void 0===r?{}:r,i=o.title,l=void 0===i?"Alert":i,c=o.description,u=void 0===c?"":c,s=o.large,d=void 0!==s&&s,m=b(),p=no(function(){return{currentDescription:u,currentTitle:l,open:!1}}),h=e(oo(p),2),v=h[0],g=h[1];w(function(){v.current.open||g(function(e){return a(a({},e),{currentTitle:l})})},[l]),w(function(){v.current.open||g(function(e){return a(a({},e),{currentDescription:u})})},[u]);var y=function(){var e=m.current;e&&e(),g(p),C()},E=Bf(function(){return f.createElement(qL,{open:!0,large:d,title:v.current.currentTitle,description:v.current.currentDescription,onOk:y})},[]),x=E.showModal,C=E.hideModal;return function(e){var r=void 0===e?{}:e,o=r.description,i=r.title;return new function(){var e=this;this.then=function(e){m.current=e},this.toPromise=function(){return t(e,void 0,void 0,function(){var e;return n(this,function(t){switch(t.label){case 0:return e=new lr,this.then(e.next),[4,e.toPromise()];case 1:return[2,t.sent()]}})})},g(function(e){return{currentTitle:void 0!==i?i:e.currentTitle,currentDescription:void 0!==o?o:e.currentDescription,open:!0}}),x()}}},XL=function(t){var n=t.onChange,r=void 0===n?function(e){return console.log({change:e})}:n,o=t.animateYearScrolling,i=void 0!==o&&o,a=t.openToYearSelection,l=void 0!==a&&a,c=t.disableFuture,u=void 0!==c&&c,s=t.now,d=void 0===s?Ue():s,m=e(g(Ue(d)),2),p=m[0],h=m[1];return f.createElement(Wf,{open:!0,onAccept:function(){return r(p)},onDismiss:function(){return r(null)}},f.createElement(jl,{date:p,onChange:function(e){return h(e)},disableFuture:u,animateYearScrolling:i,openToYearSelection:l}))},GL=function(){var e=b(),r=function(t){var n=e.current;n&&n(t),a()},o=Bf(function(){return f.createElement(XL,{open:!0,onChange:r})}),i=o.showModal,a=o.hideModal;return function(){return new function(){var r=this;this.then=function(t){e.current=t},this.toPromise=function(){return t(r,void 0,void 0,function(){var e;return n(this,function(t){switch(t.label){case 0:return e=new lr,this.then(e.next),[4,e.toPromise()];case 1:return[2,t.sent()]}})})},i()}}},KL=function(t){var n=t.onChange,r=void 0===n?function(e){return console.log({change:e})}:n,o=t.now,i=void 0===o?Ue():o,a=t.open,l=void 0===a||a,c=e(g(i),2),u=c[0],s=c[1],d=y(function(){return r(u)},[u]);return f.createElement(Wf,{open:l,onAccept:d,onDismiss:function(){return r(null)}},f.createElement(wc,{date:u,onChange:function(e){return s(e)}}))},QL=function(){var e=b(),r=function(t){var n=e.current;n&&n(t),a()},o=Bf(function(){return f.createElement(KL,{open:!0,onChange:r})}),i=o.showModal,a=o.hideModal;return function(){return new function(){var r=this;this.then=function(t){e.current=t},this.toPromise=function(){return t(r,void 0,void 0,function(){var e;return n(this,function(t){switch(t.label){case 0:return e=new lr,this.then(e.next),[4,e.toPromise()];case 1:return[2,t.sent()]}})})},i()}}},JL=function(r){var o=r.waitForChangesDelay,i=void 0===o?1e3:o,a=r.onChange,l=void 0===a?function(e){return console.log({data:e})}:a,c=r.fields,u=r.handler,s=r.payload,d=r.canCancel,m=void 0===d||d,p=r.features,h=r.slots,v=r.large,b=r.title,y=r.isBaseline,w=r.isBaselineForRoot,E=r.readTransform,x=r.writeTransform,C=r.incomingTransform,k=r.outgoingTransform,S=r.open,L=void 0===S||S,N=e(g(null),2),I=N[0],M=N[1],R=e(g(!1),2),P=R[0],A=R[1],T=e(g(!1),2),D=T[0],O=T[1],F=Vr(I),_=al([I],10);return f.createElement(Wf,{open:L,disabled:P,canCancel:m,invalid:!I||D,onAccept:function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:A(!0),e.label=1;case 1:return e.trys.push([1,,3,4]),[4,t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,Promise.race([_(),$n(i)])];case 1:return e.sent(),[2]}})})];case 2:return e.sent(),l(F.current),[3,4];case 3:return A(!1),[7];case 4:return[2]}})})},onDismiss:function(){return l(null)}},!!b&&f.createElement(mt,null,f.createElement(j,{mr:3},b)),f.createElement(j,{sx:{width:v?"100vw":"unset",maxWidth:v?"100%":"unset"},p:3},f.createElement(yf,{change:function(e){M(e),O(!1)},invalidity:function(){return O(!0)},readTransform:E,writeTransform:x,incomingTransform:C,outgoingTransform:k,isBaseline:y,isBaselineForRoot:w,handler:u,payload:s,slots:h,fields:c,features:p})))},ZL=function(r){var o=r.fields,i=r.large,l=r.slots,c=r.canCancel,u=r.title,s=r.handler,d=r.payload,m=r.waitForChangesDelay,p=r.readTransform,h=r.writeTransform,v=r.incomingTransform,g=r.outgoingTransform,y=r.isBaseline,E=r.isBaselineForRoot,x=r.features,C=b(),k=no(function(){return{currentHandler:s,currentPayload:d,currentTitle:u,open:!1}}),S=e(oo(k),2),L=S[0],N=S[1];w(function(){L.current.open||N(function(e){return a(a({},e),{currentHandler:s})})},[s]),w(function(){L.current.open||N(function(e){return a(a({},e),{currentPayload:d})})},[d]),w(function(){L.current.open||N(function(e){return a(a({},e),{currentTitle:u})})},[u]);var I=function(e){var t=C.current;t&&t(e),N(k),P()},M=Bf(function(){return f.createElement(JL,{open:!0,large:i,slots:l,canCancel:c,waitForChangesDelay:m,fields:o,title:L.current.currentTitle,handler:L.current.currentHandler,payload:L.current.currentPayload,readTransform:p,writeTransform:h,incomingTransform:v,outgoingTransform:g,onChange:I,isBaseline:y,isBaselineForRoot:E,features:x})},[]),R=M.showModal,P=M.hideModal;return function(e){var r=void 0===e?{}:e,o=r.handler,i=r.payload,a=r.title;return new function(){var e=this;this.then=function(e){C.current=e},this.toPromise=function(){return t(e,void 0,void 0,function(){var e;return n(this,function(t){switch(t.label){case 0:return e=new lr,this.then(e.next),[4,e.toPromise()];case 1:return[2,t.sent()]}})})},N(function(e){return{currentHandler:void 0!==o?o:e.currentHandler,currentPayload:void 0!==i?i:e.currentPayload,currentTitle:void 0!==a?a:e.currentTitle,open:!0}}),R()}}},eN=function(e){return ZL(e)},tN=function(e){var t=Object.create(null);return Object.assign(t,e),Object.freeze(t)},nN=function(){var t=null,n=null,r=new Promise(function(r,o){var i;i=e([r,o],2),t=i[0],n=i[1]});return[r,{resolve:function(e){return t&&t(e)},reject:function(e){return n&&n(e)}}]},rN=null,oN=new lr,iN=function(e,r){return t(void 0,void 0,void 0,function(){return n(this,function(o){switch(o.label){case 0:return[4,oN.next({url:e,name:r})];case 1:return o.sent(),rN?(rN(e,r),[2]):(fetch(e,{mode:"no-cors"}).then(function(e){return e.blob()}).then(function(e){return t(void 0,void 0,void 0,function(){var t,r;return n(this,function(n){switch(n.label){case 0:return[4,Ln(e)];case 1:return t=n.sent(),r=(null==t?void 0:t.mime)||e.type,[2,new Blob([e],{type:r})]}})})}).then(function(e){var t=URL.createObjectURL(e),n=document.createElement("a");n.href=t,n.download=r,n.style.display="none",n.target="_blank",document.body.appendChild(n),n.addEventListener("click",function(){return queueMicrotask(function(){URL.revokeObjectURL(t)})},{once:!0}),n.click()}),[2])}})})};iN.override=function(e){rN=e},iN.listen=function(e){return oN.subscribe(e)};var aN=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=e;return t.forEach(function(e){return r=r.split(e).join("").trim()}),r},lN=function(e,t){return void 0===t&&(t=!1),new Promise(function(n,r){var o=document.createElement("script");o.crossOrigin="anonymous",o.addEventListener("load",function(){n()}),o.addEventListener("error",function(){r()}),t&&(o.async=!0),document.body.appendChild(o),o.src=e})},cN=function(t){return new Promise(function(n){var o=document.createElement("input");o.setAttribute("type","file"),o.setAttribute("multiple","1"),o.style.display="none",t&&(o.accept=t),document.body.appendChild(o);var i=!0;o.onchange=function(){document.body.contains(o)&&document.body.removeChild(o),i=!1;var t=o.files;(null==t?void 0:t.length)&&(n(r([],e(t),!1)),o.value="")},new Promise(function(e){var t=function(){document.removeEventListener("mousemove",t),document.removeEventListener("touchmove",t),e()};$n(1e3).then(function(){document.addEventListener("mousemove",t),document.addEventListener("touchmove",t)})}).then(function(){setTimeout(function(){i&&(document.body.contains(o)&&document.body.removeChild(o),n(null))},1e3)}),o.click()})},uN=function(){var e=function(e){if(1===e.touches.length){var t=e.touches[0];(t.clientX<.1*window.innerWidth||t.clientX>.9*window.innerWidth)&&e.preventDefault()}};return window.addEventListener("touchstart",e,{passive:!1}),function(){return window.removeEventListener("touchstart",e)}},sN=function(e){var t=Object.getOwnPropertyNames(e),n={};return t.forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t)||{};"value"in r&&(n[t]=r.value)}),n},dN=function(e,t){return window.innerWidth>=e&&window.innerWidth<t},fN=function(e){var t=void 0===e?{}:e,n=t.xs,r=void 0===n?0:n,o=t.sm,i=void 0===o?600:o,a=t.lg,l=void 0===a?1280:a,c=dN(r,i),u=dN(i,l),s=dN(l,1e16);return{isPhone:c,isTablet:u,isDesktop:s,isWide:u||s,isMobile:c}},mN=function(e){return document.evaluate(e,document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue},pN=function(e){var t;if("HTML"==e.tagName)return"/HTML[1]";if(e===document.body)return"/HTML[1]/BODY[1]";for(var n=0,r=(null===(t=e.parentNode)||void 0===t?void 0:t.childNodes)||[],o=0;o<r.length;o++){var i=r[o];if(i===e&&e.parentNode)return pN(e.parentNode)+"/"+e.tagName+"["+(n+1)+"]";1===i.nodeType&&i.tagName===e.tagName&&n++}return null},hN=function(t){var n=ap(t),r=e(vl(),2),o=r[0];return[function(e){var t=e.children,r=e.initialState,i=e.onChange;return f.createElement(o,{initialState:n.getValue()||r,onChange:function(e){n.setValue(e),i&&i(e)}},t)},r[1]]},vN=function(t){var n=Mg(t),r=e(vl(),2),o=r[0];return[function(e){var t=e.children,r=e.initialState,i=e.onChange;return f.createElement(o,{initialState:n.getValue()||r,onChange:function(e){n.setValue(e),i&&i(e)}},t)},r[1]]},gN=function(e,t){return void 0===t&&(t=8),new Intl.NumberFormat("en-US",{style:"decimal",minimumFractionDigits:t,maximumFractionDigits:t}).format(e)},bN=function(e){var t=void 0===e?{}:e,n=t.maxHeight,r=void 0===n?1e3:n,o=t.maxWidth,i=void 0===o?1e3:o;return function(e){var t=e.height,n=e.width,o=n>i?i/n:1,a=t>r?r/t:1,l=Math.min(o,a);return{width:n*l,height:t*l}}},yN=bN(),wN=function(o,i){var a=void 0===i?{}:i,l=a.maxExec,c=void 0===l?3:l,u=a.delay,s=void 0===u?10:u,d=new Set,f=[],m=function(t){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var a=o.apply(void 0,r([],e(n),!1));d.add(a),a.finally(function(){d.delete(a)}),t.resolve(a)},p=to(function(){return t(void 0,void 0,void 0,function(){var t,o,i;return n(this,function(n){switch(n.label){case 0:return f.length?d.size?[4,Promise.race(d)]:[3,2]:[3,5];case 1:n.sent(),n.label=2;case 2:return d.size>=c?[4,$n(s)]:[3,4];case 3:return n.sent(),[3,0];case 4:return t=f.pop(),o=t.args,i=t.awaiter,m.apply(void 0,r([i],e(o),!1)),[3,0];case 5:return[2]}})})}),h=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return t(void 0,void 0,void 0,function(){var t,i,a;return n(this,function(n){switch(n.label){case 0:return t=e(nN(),2),i=t[0],a=t[1],d.size<c?m.apply(void 0,r([a],e(o),!1)):(f.unshift({awaiter:a,args:o}),p()),[4,i];case 1:return[2,n.sent()]}})})};return h.clear=function(){for(;f.length;)f.pop();d.clear(),p.clear()},h},EN=function(e){return new Promise(function(t,n){var r=new Image,o=URL.createObjectURL(e);r.src=o,r.onerror=function(){URL.revokeObjectURL(o),n(new Error("react-declarative compressImage load error"))},r.onload=function(){URL.revokeObjectURL(o);var e=yN({height:r.naturalHeight,width:r.naturalWidth}),i=e.height,a=e.width,l=document.createElement("canvas");l.width=a,l.height=i;var c=l.getContext("2d");if(!c)throw new Error("react-declarative compressImage null canvas ctx");c.drawImage(r,0,0,a,i);try{l.toBlob(function(e){e?t(e):n(new Error("react-declarative compressImage null blob"))},"image/jpeg",.8)}catch(e){console.error(e),n(new Error("react-declarative compressImage unknown error"))}}})},xN=function(e,r){return void 0===e&&(e=20971520),void 0===r&&(r=10),wN(function(r){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,3,,5]),r.size>e?[4,EN(r)]:[3,2];case 1:case 4:return[2,n.sent()];case 2:return[3,5];case 3:return t=n.sent(),console.error("react-declarative compressImage error",t),[4,new Promise(function(e){var t=document.createElement("canvas");t.width=10,t.height=10;var n=t.getContext("2d");return n&&(n.fillStyle="rgba(0, 0, 0, 0)",n.fillRect(0,0,10,10)),t.toBlob(function(t){e(t||new Blob([],{type:"image/png"}))},"image/png")})];case 5:return[2,r]}})})},{maxExec:r})},CN=xN(),kN=Symbol("timeout"),SN=function(o,i){void 0===i&&(i=3e4);return function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,Promise.race([o.apply(void 0,r([],e(a),!1)),$n(i).then(function(){return kN})])];case 1:return[2,t.sent()]}})})}},LN=function(o,i){for(var a=[],l=2;l<arguments.length;l++)a[l-2]=arguments[l];return t(void 0,r([o,i],e(a),!1),void 0,function(t,r,o){var i,a,l,c,u;return void 0===o&&(o=0),n(this,function(n){return a=!1,l=e(nN(),2),c=l[0],u=l[1].resolve,i=t.subscribe(function(e){r(e)&&(i&&i(),a=!0,u(e))}),o&&$n(o).then(function(){a||(i&&i(),u(kN))}),[2,c]})})},NN=Kr(),IN="Method marked as obsolete. Type ".concat(NN," to continue"),MN=function(e,t){var n,r;if(!t)return"unknown";if("object"!=typeof t)return"unknown";try{for(var o=c(Object.keys(t)),i=o.next();!i.done;i=o.next()){var a=i.value;if(t[a]===e)return a}}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return MN(e,Object.getPrototypeOf(t))},RN=function(o){var i="",a=function(){for(var l=[],c=0;c<arguments.length;c++)l[c]=arguments[c];return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return i=i||MN(a,this),console.log("react-declarative obsolete hof call method_name=".concat(i)),"prompt"in window?window.prompt(IN)!==NN?[3,2]:[4,o.apply(void 0,r([],e(l),!1))]:[3,2];case 1:return[2,t.sent()];case 2:throw new Error("react-declarative obsolete hof call")}})})};return a},PN=function(t){var n=null,o=fo(t);return function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var a=o.apply(void 0,r([],e(t),!1));return null!==n&&clearTimeout(n),n=setTimeout(function(){o.clear(),n=null},PN.delay),a}};PN.delay=0;var AN=function(t){var n=!1,o=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return n?t.apply(void 0,r([],e(o),!1)):(n=!0,Promise.resolve())};return o.clear=function(){n=!1},o},TN=function(o,i){void 0===i&&(i=5);var a=Kn(function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];return t(void 0,void 0,void 0,function(){var l,c;return n(this,function(u){switch(u.label){case 0:return l=i,c=function(){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,4]),[4,o.apply(void 0,r([],e(a),!1))];case 1:case 3:return[2,n.sent()];case 2:if(t=n.sent(),0===--l)throw t;return[4,c()];case 4:return[2]}})})},[4,c()];case 1:return[2,u.sent()]}})})});return a},DN=function(t){return Array.isArray(t)&&e(t,1)[0]||null},jN=Symbol("never"),ON=function(o){var i=0,a=new hw(i),l=Kn(function(){for(var i=[],l=0;l<arguments.length;l++)i[l]=arguments[l];return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,new Promise(function(e){var t=function(){0!==a.data?a.once(t):e()};t()})];case 1:return t.sent(),DN(i)===jN?[2,null]:[4,o.apply(void 0,r([],e(i),!1))];case 2:return[2,t.sent()]}})})}),c=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,l.apply(void 0,r([],e(o),!1))];case 1:return[2,t.sent()]}})})};return c.clear=function(){a.next(0),a=new hw(i=0),l.clear()},c.cancel=function(){c.clear(),l.cancel()},c.beginLock=function(){i+=1,a.next(i)},c.endLock=function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return i=Math.max(i-1,0),a.next(i),[4,l(jN)];case 1:return e.sent(),[2]}})})},c},FN=Symbol("never"),_N=function(){return function(e){return e.reduce(function(e,t){return e.value===t?{value:t,count:e.count+1}:{value:t,count:0}},{value:FN,count:0})}},BN=Symbol("never"),HN=function(e){return void 0===e&&(e=function(e){return e}),function(t){var n=BN;return t.map(function(t){return{value:t,compare:e(t)}}).filter(function(e){return e.compare!==n}).tap(function(e){var t=e.compare;return n=t}).map(function(e){return e.value})}},WN=function(t){return function(n){return n.reduce(function(n,o){return n.length===t?[o]:r(r([],e(n),!1),[o],!1)},[]).filter(function(e){return e.length===t})}},zN=Symbol("never"),VN=function(e){return function(t){return t.reduce(function(e,t){return{value:t,idx:e.idx+1}},{value:zN,idx:0}).filter(function(t){return t.idx<=e}).map(function(e){return e.value})}},YN=Symbol("never"),UN=function(e,t){return void 0===t&&(t=5e3),function(n){var r=!0;return pr.merge([pr.fromInterval(t).filter(function(){var e=r;return r=!1,!e}).operator(VN(1)).tap(e).map(function(){return YN}),n.tap(function(){r=!0})]).filter(function(e){return e!==YN})}},qN=function(t){return void 0===t&&(t=2),function(n){return n.reduce(function(n,o){return r(r([],e(n),!1),[o],!1).slice(-t)},[]).filter(function(e){return e.length===t})}},$N=Symbol("never"),XN=function(e){return function(t){return t.reduce(function(e,t){return{value:t,idx:e.idx+1}},{value:$N,idx:0}).filter(function(t){return t.idx>e}).map(function(e){return e.value})}},GN=function(t,n){return void 0===n&&(n=Math.floor(t/2)),function(o){var i=-1,a=-1,l=-1,c=!1;return o.tap(function(e){if(-1===i&&(i=e.length,a=Math.ceil((i-t)/n),l=a+((c=a*t!==i)?1:0),t>i||n>t))throw new Error("react-declarative strideTricks too big stride")}).flatMap(function(e){if(e.length!==i)throw new Error("react-declarative strideTricks unshaped data");for(var r=[],o=0;o!==a;o++){var l=o*n;r.push(e.slice(l,l+t))}if(c){var u=e.slice(i-t,i);u.lastStep=!0,r.push(u)}return r.flat(1)}).reduce(function(n,o){return n.length===t?[o]:r(r([],e(n),!1),[o],!1)},[]).filter(function(e){return e.length===t}).reduce(function(t,n){return t.length===l?[n]:r(r([],e(t),!1),[n],!1)},[]).filter(function(e){return e.length===l})}},KN=function(){function e(){}return e.take=VN,e.skip=XN,e.pair=qN,e.group=WN,e.strideTricks=GN,e.distinct=HN,e.liveness=UN,e.count=_N,e}(),QN=function(e,t){return e instanceof Array?e.includes(t):e instanceof Set||e instanceof Map?e.has(t):!!e&&e===t},JN=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return e.some(function(e){return e instanceof Promise})?new Promise(function(r,o){return t(void 0,void 0,void 0,function(){var t,i,a;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,Promise.all(e)];case 1:return t=n.sent(),i=t.reduce(function(e,t){return Boolean(e&&t)},!0),r(i),[3,3];case 2:return a=n.sent(),o(a),[3,3];case 3:return[2]}})})}):e.reduce(function(e,t){return Boolean(e&&t)},!0)},ZN=function(e){var r=e.condition,o=e.run,i=e.not,a=void 0!==i&&i,l="function"==typeof r?r():r,c="function"==typeof o?o():o,u=a;return c instanceof Promise||l instanceof Promise||u instanceof Promise?new Promise(function(e,r){return t(void 0,void 0,void 0,function(){var t,o,i;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,5,,6]),[4,l];case 1:return n.sent()?(t=e,[4,c]):[3,3];case 2:return t.apply(void 0,[n.sent()]),[2];case 3:return o=e,[4,u];case 4:return o.apply(void 0,[n.sent()]),[3,6];case 5:return i=n.sent(),r(i),[3,6];case 6:return[2]}})})}):l?c:u},eI=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t=t.flat(1),r([],e(new Set(t.flatMap(function(e){return Array.isArray(e)?eI(e):e}).filter(Boolean))),!1)},tI=function(t){return Array.isArray(t)&&e(t.slice(-1),1)[0]||null},nI=function(e){return(null==e?void 0:e.filter(function(e){return e}))||[]},rI=function(t,n,o,i){var a,l,u=(l=a=i,"function"==typeof a&&(l=a()),l&&!Array.isArray(l)&&(l=Object.entries(l).map(function(t){var n=e(t,2),r=n[0];return n[1]?r:null}).filter(function(e){return!!e})),l);return function(t,n,o){var i=new Set,a=function(e,t,n,r){var o,l;void 0===r&&(r=!1);var u=e.isVisible,s=void 0===u?function(){return!0}:u;if(("function"==typeof e.hidden?e.hidden(n):e.hidden)&&(r=!0),s(t,n)||(r=!0),r&&i.add(e),e.fields)try{for(var d=c(e.fields),f=d.next();!f.done;f=d.next()){var m=f.value;a(m,t,n,r)}}catch(e){o={error:e}}finally{try{f&&!f.done&&(l=d.return)&&l.call(d)}finally{if(o)throw o.error}}e.child&&a(e.child,t,n,r)};(t=Ar(t)).forEach(function(e){return a(e,n,o)}),t=t.filter(function(e){return!i.has(e)});var l=r([],e(i),!1).filter(function(e){var n=e.name;return!t.some(function(e){return e.name===n})});return{visible:t,hidden:l}}(t.filter(function(e){return!u||!e.features||e.features.some(function(e){return u.includes(e)})}),n,o)},oI=function(e,t){var n,r;void 0===t&&(t=function(){return!1});var o=Object.keys(e||{}),i=0;try{for(var a=c(o),l=a.next();!l.done;l=a.next()){var u=l.value;null!==e[u]&&(""!==e[u]&&!1!==e[u]&&(t(u,e[u])||i++))}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i},iI=function(e,t,n){var r=[],o=nf(rf(e));return Ar(o).forEach(function(e){var o=e.isInvalid,i=void 0===o?function(){return null}:o,a=e.hidden;if(!("function"==typeof a?a(n):a)){var l=i(t,n)||null;null!==l&&r.push({field:e,error:l,name:e.name,title:e.title||(e.name?To(e.name):e.title)})}}),r.length?r:null},aI=function(t,n,r){var o=iI(t,n,r);return o?e(o,1)[0].error:null},lI=new Set([jn.Text,jn.Time,jn.Date,jn.Items,jn.Combo,jn.Checkbox,jn.Choose,jn.Complete,jn.Radio,jn.YesNo,jn.Switch,jn.Component,jn.Tree,jn.Phony]),cI=function(e,t){var n,r,o=void 0===t?{}:t,i=o.keyToTitle,a=void 0===i?function(e){return e}:i,l=o.ignore,u=void 0===l?function(){return!1}:l,s=[],d=function(e,t,n,r){if(!e)return"continue";if(u(e))return"continue";if(s.some(function(t){return t.value===e}))return"continue";if(lI.has(t)){var o=n||r||a(e);s.push({label:"".concat(o,", ").concat(String(Symbol.keyFor(t)||t)),value:e})}};try{for(var f=c(Ar(e)),m=f.next();!m.done;m=f.next()){var p=m.value;d(p.name,p.type,p.title,p.placeholder)}}catch(e){n={error:e}}finally{try{m&&!m.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}return s},uI=function(t,n,r,o){var i=iI(t,n,r);if(i){var a=e(i,1)[0],l=a.error,c=a.title,u=a.name;return o&&o(l,c,u),!0}return!1},sI=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.flat(1/0)},dI=function(e){var t;do{t=e.length,e=e.split(" ").join(" ")}while(t!==e.length);return e},fI=function(t,n,r){var o=t,i=sI([n]),a=sI([r]);if(i.length!==a.length){var l=e(a,1)[0],c=void 0===l?"":l;i.forEach(function(e){return o=o.split(e).join(c)})}else i.forEach(function(e,t){return o=o.split(e).join(a[t])});return o},mI=function(e,t,n){void 0===t&&(t=2),void 0===n&&(n=",");var r="string"==typeof e?Number(e.replaceAll(" ","")):e,o=r.toFixed(t);return(r<1e4?o:o.replace(/(\d)(?=(\d{3})+(\.|$))/g,"$1".concat(" "))).replace(/.00$/,"").replace(".",n)},pI=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=t.reduce(function(e,t){return a(a({},e),t)},{});return e.replace(/{[a-zA-Z_\-0-9]+}/g,function(e){var t=e.replace(/{|}/g,"");return void 0!==r[t]?String(r[t]):""})},hI=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=-1;return e.replace(/{\d}|{}/g,function(e){if(r+=1,"{}"===e)return void 0!==t[r]?String(t[r]):"";var n=parseInt(e.replace(/{|}/g,""));return void 0!==t[n]?String(t[n]):""})},vI=function(e,t){var n=void 0===t?{}:t,r=n.allowed,o=void 0===r?function(){return!0}:r,i=n.map,a=void 0===i?function(e){return e}:i,l=ap(e),c=l.getValue();c&&(c=o(c)?c:null);var u=ct(c?{initialEntries:[{pathname:c}]}:void 0);return u.listen(function(e){var t=e.location,n=a(t.pathname);l.setValue(n)}),u},gI=function(t){var n=ap(t),o=new Set(n.getValue()||[]);return{has:function(e){return o.has(e)},add:function(t){o.add(t),n.setValue(r([],e(o),!1))},delete:function(t){o.delete(t),n.setValue(r([],e(o),!1))},toSet:function(){return o},clear:function(){o.clear(),n.setValue(r([],e(o),!1))}}},bI=function(t){var n=Mg(t),o=new Set(n.getValue()||[]);return{has:function(e){return o.has(e)},add:function(t){o.add(t),n.setValue(r([],e(o),!1))},delete:function(t){o.delete(t),n.setValue(r([],e(o),!1))},toSet:function(){return o},clear:function(){o.clear(),n.setValue(r([],e(o),!1))}}},yI=fo(function(){var e=new lr;return new MutationObserver(Zn(function(){return e.next()},1e3)).observe(document.body,{childList:!0,subtree:!0}),e}),wI=function(e,t,n){void 0===e&&(e="bgcolor-red"),void 0===t&&(t="");var r=void 0===n?{}:n,o=r.onClick,i=r.onInit;function a(){var e=Reflect.construct(HTMLElement,[],a);if(e.setAttribute("style",t),i){var n=i(e);"function"==typeof n&&function(e,t){var n=yI().subscribe(function(){document.contains(e)||(n(),t())})}(e,n)}return o&&(e.onclick=o),e}"HTMLElement"in globalThis&&(a.prototype=Object.create(HTMLElement.prototype),customElements.define(e,a))},EI=function(e){document.head.innerHTML+='\n <meta name="theme-color" content="'.concat(e,'">\n <style>\n html {\n background: ').concat(e," !important;\n }\n </style>\n ")},xI=new function(){var e=this;this._cacheMap=new Map,this.createPromise=function(t){var n;return e._cacheMap.has(t)||e._cacheMap.set(t,(n=t,new Promise(function(e){var t=document.createElement("img"),r=document.createElement("canvas"),o=r.getContext("2d");t.onload=function(t){var n=t.target;r.width=n.naturalWidth,r.height=n.naturalHeight,o.drawImage(n,0,0),r.toBlob(function(t){return e(t)},"image/png",1)},t.crossOrigin="",t.src=n}))),e._cacheMap.get(t)}},CI=function(e){return{ref:function(t){t&&(t.style.visibility="hidden",xI.createPromise(e).then(function(e){document.contains(t)&&(t.src=URL.createObjectURL(e),t.style.visibility="visible")}))}}},kI=new function(){var e=this;this._keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",this.encode=function(t){for(var n,r,o,i,a,l,c,u="",s=0;s<t.length;)i=(n=t.charCodeAt(s++))>>2,a=(3&n)<<4|(r=t.charCodeAt(s++))>>4,l=(15&r)<<2|(o=t.charCodeAt(s++))>>6,c=63&o,isNaN(r)?l=c=64:isNaN(o)&&(c=64),u=u+e._keyStr.charAt(i)+e._keyStr.charAt(a)+e._keyStr.charAt(l)+e._keyStr.charAt(c);return u},this.decode=function(t){var n,r,o,i,a,l,c="",u=0;for(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");u<t.length;)n=e._keyStr.indexOf(t.charAt(u++))<<2|(i=e._keyStr.indexOf(t.charAt(u++)))>>4,r=(15&i)<<4|(a=e._keyStr.indexOf(t.charAt(u++)))>>2,o=(3&a)<<6|(l=e._keyStr.indexOf(t.charAt(u++))),c+=String.fromCharCode(n),64!=a&&(c+=String.fromCharCode(r)),64!=l&&(c+=String.fromCharCode(o));return c}},SI=function(e){try{return JSON.parse(kI.decode(e))}catch(e){return null}},LI=function(e){return kI.encode(JSON.stringify(e))},NI=function(t){try{var n=t.map(function(e){return String.fromCharCode(e)}).join("");return Object.fromEntries(n.split(";").map(function(e){return e.split("=")}).map(function(t){var n=e(t,2),r=n[0],o=n[1];return"true"===o?[r,!0]:"false"===o?[r,!1]:"null"===o?[r,null]:Number.isNaN(parseFloat(o))?[r,o]:[r,parseFloat(o)]}))}catch(e){return null}},II=function(t){var n=Object.entries(t);n.forEach(function(t){var n=e(t,2);n[0];var r=n[1];if("string"==typeof r){var o=!1;if(o=(o=o||r.includes("="))||r.includes(";"))throw new Error("String param must not include = or ; symbols")}});var o=n.map(function(t){var n=e(t,2),r=n[0],o=n[1];return"".concat(r,"=").concat(o)}).join(";");return r([],e(o),!1).map(function(e){return e.charCodeAt(0)})},MI=function(t){for(var n=r([],e(new Array(32)),!1).fill("\0"),o=0;o!==t.length;o++)n[o]=t[o];t=n.join("");var i="";for(o=0;o<t.length;o++){var a=t.charCodeAt(o).toString(16);i+=a.length<2?"0"+a:a}return"0x"+i},RI=function(e){if(!function(e){return"string"==typeof e&&/^(-)?0x[0-9a-f]*$/i.test(e)}(e))throw new Error("The parameter must be a valid HEX string.");var t="",n=0,r=e.length;for("0x"===e.substring(0,2)&&(n=2);n<r;n+=2){var o=parseInt(e.slice(n,n+2),16);t+=String.fromCharCode(o)}return t.split("").filter(function(e){return"\0"!==e}).join("")};var PI=Object.freeze({__proto__:null,crypt:(e,t)=>{if(!t)return"";const n=e=>e.split("").map(e=>e.charCodeAt(0));return t.split("").map(n).map(t=>n(e).reduce((e,t)=>e^t,t)).map(e=>("0"+Number(e).toString(16)).substr(-2)).join("")},decrypt:(e,t)=>{if(!t)return"";return t.match(/.{1,2}/g).map(e=>parseInt(e,16)).map(t=>{return(n=e,n.split("").map(e=>e.charCodeAt(0))).reduce((e,t)=>e^t,t);var n}).map(e=>String.fromCharCode(e)).join("")}}),AI=function(e){return void 0===e&&(e=Ue()),60*e.get("hour")+e.get("minute")},TI=function(e){return Ue().set("hour",0).set("minute",0).add(e,"minute")},DI=function(e){return new Date(e.getTime()+60*e.getTimezoneOffset()*1e3)},jI=function(e,t){var n=[];return function(r){var o,i;void 0===r&&(r=[]);try{for(var a=c(r),l=a.next();!l.done;l=a.next()){var u=l.value;if(t>0)t-=1;else{if(!(e>0))break;n.push(u),e-=1}}}catch(e){o={error:e}}finally{try{l&&!l.done&&(i=a.return)&&i.call(a)}finally{if(o)throw o.error}}return{rows:n,done:e<=0}}},OI=function(e,r,o){return t(void 0,void 0,void 0,function(){var t,i,a,l,c,u,s,f,m,p;return n(this,function(n){switch(n.label){case 0:t=jI(r,o),n.label=1;case 1:n.trys.push([1,6,7,12]),l=!0,c=d(e),n.label=2;case 2:return[4,c.next()];case 3:if(u=n.sent(),s=u.done)return[3,5];if(p=u.value,l=!1,i=[p].flatMap(function(e){return e}),t(i).done)return[3,5];n.label=4;case 4:return l=!0,[3,2];case 5:return[3,12];case 6:return a=n.sent(),f={error:a},[3,12];case 7:return n.trys.push([7,,10,11]),l||s||!(m=c.return)?[3,9]:[4,m.call(c)];case 8:n.sent(),n.label=9;case 9:return[3,11];case 10:if(f)throw f.error;return[7];case 11:return[7];case 12:return[2,t().rows]}})})};function FI(e){return o(this,arguments,function(){var t,r,o,a,l,u,s,f,m,p,h,v,g,b,y,w;return n(this,function(n){switch(n.label){case 0:t=new Set,n.label=1;case 1:n.trys.push([1,14,15,20]),r=!0,o=d(e),n.label=2;case 2:return[4,i(o.next())];case 3:if(a=n.sent(),g=a.done)return[3,13];w=a.value,r=!1,l=[w].flatMap(function(e){return e}),n.label=4;case 4:n.trys.push([4,10,11,12]),h=void 0,u=c(l),s=u.next(),n.label=5;case 5:return s.done?[3,9]:(f=s.value,t.has(f.id)?[3,8]:(t.add(f.id),[4,i(f)]));case 6:return[4,n.sent()];case 7:n.sent(),n.label=8;case 8:return s=u.next(),[3,5];case 9:return[3,12];case 10:return m=n.sent(),h={error:m},[3,12];case 11:try{s&&!s.done&&(v=u.return)&&v.call(u)}finally{if(h)throw h.error}return[7];case 12:return r=!0,[3,2];case 13:return[3,20];case 14:return p=n.sent(),b={error:p},[3,20];case 15:return n.trys.push([15,,18,19]),r||g||!(y=o.return)?[3,17]:[4,i(y.call(o))];case 16:n.sent(),n.label=17;case 17:return[3,19];case 18:if(b)throw b.error;return[7];case 19:return[7];case 20:return[2]}})})}var _I=function(e){return t(void 0,void 0,void 0,function(){var t,r,o,i,a,l,c,u,s,f;return n(this,function(n){switch(n.label){case 0:t=[],n.label=1;case 1:n.trys.push([1,6,7,12]),i=!0,a=d(e),n.label=2;case 2:return[4,a.next()];case 3:if(l=n.sent(),c=l.done)return[3,5];f=l.value,i=!1,r=f,t.push(r),n.label=4;case 4:return i=!0,[3,2];case 5:return[3,12];case 6:return o=n.sent(),u={error:o},[3,12];case 7:return n.trys.push([7,,10,11]),i||c||!(s=a.return)?[3,9]:[4,s.call(a)];case 8:n.sent(),n.label=9;case 9:return[3,11];case 10:if(u)throw u.error;return[7];case 11:return[7];case 12:return[2,t.flatMap(function(e){return e})]}})})};function BI(e,t){return o(this,arguments,function(){var r,o,a,l,u,s,f,m,p,h,v,g,b,y,w;return n(this,function(n){switch(n.label){case 0:n.trys.push([0,14,15,20]),r=!0,o=d(e),n.label=1;case 1:return[4,i(o.next())];case 2:if(a=n.sent(),g=a.done)return[3,13];w=a.value,r=!1,l=[w].flatMap(function(e){return e}),n.label=3;case 3:n.trys.push([3,10,11,12]),h=void 0,u=c(l),s=u.next(),n.label=4;case 4:return s.done?[3,9]:(f=s.value,[4,i(t(f))]);case 5:return n.sent()?[4,i(f)]:[3,8];case 6:return[4,n.sent()];case 7:n.sent(),n.label=8;case 8:return s=u.next(),[3,4];case 9:return[3,12];case 10:return m=n.sent(),h={error:m},[3,12];case 11:try{s&&!s.done&&(v=u.return)&&v.call(u)}finally{if(h)throw h.error}return[7];case 12:return r=!0,[3,1];case 13:return[3,20];case 14:return p=n.sent(),b={error:p},[3,20];case 15:return n.trys.push([15,,18,19]),r||g||!(y=o.return)?[3,17]:[4,i(y.call(o))];case 16:n.sent(),n.label=17;case 17:return[3,19];case 18:if(b)throw b.error;return[7];case 19:return[7];case 20:return[2]}})})}function HI(e,t){return o(this,arguments,function(){var r,o,a,l,u,s,f,m,p,h,v,g,b,y,w;return n(this,function(n){switch(n.label){case 0:n.trys.push([0,14,15,20]),r=!0,o=d(e),n.label=1;case 1:return[4,i(o.next())];case 2:if(a=n.sent(),g=a.done)return[3,13];w=a.value,r=!1,l=[w].flatMap(function(e){return e}),n.label=3;case 3:n.trys.push([3,10,11,12]),h=void 0,u=c(l),s=u.next(),n.label=4;case 4:return s.done?[3,9]:(f=s.value,[4,i(t(f))]);case 5:return[4,i.apply(void 0,[n.sent()])];case 6:return[4,n.sent()];case 7:n.sent(),n.label=8;case 8:return s=u.next(),[3,4];case 9:return[3,12];case 10:return m=n.sent(),h={error:m},[3,12];case 11:try{s&&!s.done&&(v=u.return)&&v.call(u)}finally{if(h)throw h.error}return[7];case 12:return r=!0,[3,1];case 13:return[3,20];case 14:return p=n.sent(),b={error:p},[3,20];case 15:return n.trys.push([15,,18,19]),r||g||!(y=o.return)?[3,17]:[4,i(y.call(o))];case 16:n.sent(),n.label=17;case 17:return[3,19];case 18:if(b)throw b.error;return[7];case 19:return[7];case 20:return[2]}})})}var WI=function(a){return o(this,arguments,function(o){var a,l,c,u,s,d=this,f=o.totalDocuments,m=void 0===f?1e4:f,p=o.limit,h=void 0===p?5e3:p,v=o.delay,g=void 0===v?100:v,b=o.createRequest,y=void 0===b?function(){return[]}:b;return n(this,function(o){switch(o.label){case 0:a=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return t(d,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return[4,Promise.all([y.apply(void 0,r([],e(o),!1)),$n(g)])];case 1:return t=e.apply(void 0,[n.sent(),1]),[2,t[0]]}})})},l=0,c=null,u=a({lastId:null,offset:0,page:0,limit:h}),o.label=1;case 1:return l<m?[4,i(u)]:[3,8];case 2:return(s=o.sent()).length<h?[4,i(s)]:[3,5];case 3:return[4,o.sent()];case 4:return o.sent(),[3,8];case 5:if(s.length>h)throw new Error("react-declarative iterateDocuments response.length > limit");return c=s[s.length-1].id||null,u=a({lastId:c,offset:l+=h,page:Math.ceil(l/h),limit:h}),[4,i(s)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,1];case 8:return[2]}})})};function zI(e){return o(this,arguments,function(){var t,r,o,a,l,u;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,7,8,9]),[4,i(e())];case 1:t=c.apply(void 0,[n.sent()]),r=t.next(),n.label=2;case 2:return r.done?[3,6]:(o=r.value,[4,i(o)]);case 3:return[4,n.sent()];case 4:n.sent(),n.label=5;case 5:return r=t.next(),[3,2];case 6:return[3,9];case 7:return a=n.sent(),l={error:a},[3,9];case 8:try{r&&!r.done&&(u=t.return)&&u.call(t)}finally{if(l)throw l.error}return[7];case 9:return[2]}})})}var VI=function(e){return function(t,r){return o(this,arguments,function(){var o,a,l,u,s,f,m,p,h,v,g,b,y,w,E,x,C,k,S,L,N,I;return n(this,function(n){switch(n.label){case 0:o=new Set,n.label=1;case 1:n.trys.push([1,26,27,28]),a=c(e),l=a.next(),n.label=2;case 2:if(l.done)return[3,25];u=l.value,n.label=3;case 3:n.trys.push([3,18,19,24]),s=!0,L=void 0,f=d(u),n.label=4;case 4:return[4,i(f.next())];case 5:if(m=n.sent(),S=m.done)return[3,17];I=m.value,s=!1,p=[I].flatMap(function(e){return e}),n.label=6;case 6:n.trys.push([6,14,15,16]),C=void 0,h=c(p),v=h.next(),n.label=7;case 7:return v.done?[3,13]:(g=v.value,o.has(g.id)?[3,12]:r>0?(r-=1,[3,12]):t>0?(o.add(g.id),[4,i(g)]):[3,10]);case 8:return[4,n.sent()];case 9:return n.sent(),t-=1,[3,12];case 10:return[4,i(void 0)];case 11:return[2,n.sent()];case 12:return v=h.next(),[3,7];case 13:return[3,16];case 14:return b=n.sent(),C={error:b},[3,16];case 15:try{v&&!v.done&&(k=h.return)&&k.call(h)}finally{if(C)throw C.error}return[7];case 16:return s=!0,[3,4];case 17:return[3,24];case 18:return y=n.sent(),L={error:y},[3,24];case 19:return n.trys.push([19,,22,23]),s||S||!(N=f.return)?[3,21]:[4,i(N.call(f))];case 20:n.sent(),n.label=21;case 21:return[3,23];case 22:if(L)throw L.error;return[7];case 23:return[7];case 24:return l=a.next(),[3,2];case 25:return[3,28];case 26:return w=n.sent(),E={error:w},[3,28];case 27:try{l&&!l.done&&(x=a.return)&&x.call(a)}finally{if(E)throw E.error}return[7];case 28:return[2]}})})}};function YI(e){return o(this,arguments,function(e,t){var r,o,a,l,u,s;return void 0===t&&(t=function(e){return Promise.resolve(e)}),n(this,function(n){switch(n.label){case 0:n.trys.push([0,7,8,9]),r=c(e),o=r.next(),n.label=1;case 1:return o.done?[3,6]:(a=o.value,[4,i(t(a))]);case 2:return[4,i.apply(void 0,[n.sent()])];case 3:return[4,n.sent()];case 4:n.sent(),n.label=5;case 5:return o=r.next(),[3,1];case 6:return[3,9];case 7:return l=n.sent(),u={error:l},[3,9];case 8:try{o&&!o.done&&(s=r.return)&&s.call(r)}finally{if(u)throw u.error}return[7];case 9:return[2]}})})}var UI=function(e,t){var n=t.sizeOriginal,r=t.onProgress;return new Promise(function(t,o){var i=new XMLHttpRequest;i.addEventListener("progress",function(e){e.lengthComputable?r&&r(e.loaded/e.total*100):n?r&&r(Math.min(e.loaded/n*100,100)):console.log("downloadBlob file length is not computable")}),i.addEventListener("error",function(e){o(e)}),i.addEventListener("loadend",function(){r&&r(100),200===i.status?4!==i.readyState||t(i.response):o(new Error("downloadBlob status !== 200"))}),i.responseType="blob",i.open("GET",e,!0),i.setRequestHeader("Content-Type","application/octet-stream"),i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.setRequestHeader("Access-Control-Allow-Origin","*"),i.send()})},qI=Gn(function(e,r,o){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:console.log("useOpenDocument downloadXHR",{url:e}),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,UI(e,{onProgress:r,sizeOriginal:o})];case 2:return[2,n.sent()];case 3:return t=n.sent(),console.log("useOpenDocument downloadXHR error",t),r&&r(0),[2,null];case 4:return[2]}})})}),$I=Gn(function(e,r){return t(void 0,void 0,void 0,function(){var t,o,i;return n(this,function(n){switch(n.label){case 0:console.log("useOpenDocument downloadFetch",{url:e}),n.label=1;case 1:return n.trys.push([1,4,,5]),[4,fetch(e,{method:"GET",headers:{"Content-Type":"application/octet-stream","X-Requested-With":"XMLHttpRequest","Access-Control-Allow-Origin":"*"},mode:"no-cors"})];case 2:if(!(t=n.sent()).ok)throw t;return[4,t.blob()];case 3:return o=n.sent(),r&&r(100),[2,o];case 4:return i=n.sent(),r&&r(0),console.log("useOpenDocument downloadFetch error",i),[2,null];case 5:return[2]}})})}),XI=function(e){var t=e.primary,n=e.secondary;return f.createElement(tt,{sx:{ml:-1}},f.createElement(In,null,f.createElement(Nn,null,f.createElement(Mn,null))),f.createElement(Oe,{primary:t,secondary:n}))},GI=[{id:"main",element:function(r){var o=r.onChange,i=r.history,l=r.data,c=e(g(0),2),u=c[0],s=c[1],d=al([l],10);return Sc(function(){return t(void 0,void 0,void 0,function(){var e,t,r,c,u;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,6,,7]),[4,qI(l.url,s,l.sizeOriginal)];case 1:return(e=n.sent())===Xn?[2]:e?[3,3]:[4,$I(l.url,s)];case 2:e=n.sent(),n.label=3;case 3:return e===Xn?[2]:e?[4,Ln(e)]:(console.log("useOpenDocument failed to fetch"),i.replace("/error"),[2]);case 4:return t=n.sent(),r=(null==t?void 0:t.mime)||e.type,c=URL.createObjectURL(new Blob([e],{type:r})),o(a(a({},l),{blob:e,url:c,mime:r})),[4,d()];case 5:return n.sent(),r.startsWith("image/")?i.replace("/image"):r.startsWith("audio/")?i.replace("/audio"):r.startsWith("video/")?i.replace("/video"):r.endsWith("/pdf")?i.replace("/pdf"):"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"===r||"application/x-cfb"===r?i.replace("/sheet"):i.replace("/file"),[3,7];case 6:return u=n.sent(),console.error(u),i.replace("/error"),[3,7];case 7:return[2]}})})}),w(function(){return function(){$I.cancel(),qI.cancel()}},[]),f.createElement(jw,{variant:0!==u&&100!==u?"determinate":"indeterminate",value:0!==u&&100!==u?u:void 0,size:48,sx:{height:275}})},isActive:function(e){return!!mL("/",e)}},{id:"file",element:function(e){var t=e.formState;return w(function(){return function(){URL.revokeObjectURL(t.data.main.url)}},[]),f.createElement(j,{mt:1,mb:2},f.createElement(XI,{primary:t.data.main.fileName,secondary:t.data.main.placeholder||t.data.main.mime}))},isActive:function(e){return!!mL("/file",e)}},{id:"pdf",element:function(e){var t=e.formState;return w(function(){return function(){URL.revokeObjectURL(t.data.main.url)}},[]),f.createElement(j,{mt:1,mb:2},f.createElement(uk,{withFullScreen:!0,src:t.data.main.url,sx:{height:275,width:"100%",objectFit:"contain"}}),f.createElement(XI,{primary:t.data.main.fileName,secondary:t.data.main.placeholder||t.data.main.mime}))},isActive:function(e){return!!mL("/pdf",e)}},{id:"image",element:function(e){var t=e.formState;return w(function(){return function(){URL.revokeObjectURL(t.data.main.url)}},[]),f.createElement(j,{mt:1,mb:2},f.createElement(dk,{withFullScreen:!0,src:t.data.main.url,sx:{height:275,width:"100%",objectFit:"contain"}}),f.createElement(XI,{primary:t.data.main.fileName,secondary:t.data.main.placeholder||t.data.main.mime}))},isActive:function(e){return!!mL("/image",e)}},{id:"video",element:function(e){var t=e.formState;return w(function(){return function(){URL.revokeObjectURL(t.data.main.url)}},[]),f.createElement(j,{mt:1,mb:2},f.createElement(j,{component:"video",src:t.data.main.url,controls:!0,muted:!0,autoPlay:!0,sx:{height:275,width:"100%",objectFit:"contain"}}),f.createElement(XI,{primary:t.data.main.fileName,secondary:t.data.main.placeholder||t.data.main.mime}))},isActive:function(e){return!!mL("/video",e)}},{id:"audio",element:function(e){var t=e.formState;return w(function(){return function(){URL.revokeObjectURL(t.data.main.url)}},[]),f.createElement(j,{mt:1,mb:2},f.createElement(j,{component:"audio",src:t.data.main.url,controls:!0,autoPlay:!0,sx:{width:"100%"}}),f.createElement(XI,{primary:t.data.main.fileName,secondary:t.data.main.placeholder||t.data.main.mime}))},isActive:function(e){return!!mL("/audio",e)}},{id:"sheet",element:function(r){var o=r.formState,i=r.history,a=e(g([]),2),l=a[0],c=a[1],u=b(!1);return w(function(){return function(){u.current||URL.revokeObjectURL(o.data.main.url)}},[]),w(function(){t(void 0,void 0,void 0,function(){var e,t,r,a,l,s,d;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),r=(t=dn).read,[4,o.data.main.blob.arrayBuffer()];case 1:return e=r.apply(t,[n.sent(),{type:"binary"}]),a=e.SheetNames[0],l=e.Sheets[a],s=dn.utils.sheet_to_json(l,{header:1}),d=s.map(Object.values),c(d),[3,3];case 2:return n.sent(),u.current=!0,i.replace("/file"),[3,3];case 3:return[2]}})})},[]),f.createElement(j,{mt:1,mb:2},f.createElement(cm,{withFullScreen:!0,data:l,sx:{height:275,width:"100%"}}),f.createElement(XI,{primary:o.data.main.fileName,secondary:o.data.main.placeholder||o.data.main.mime}))},isActive:function(e){return!!mL("/sheet",e)}},{id:"error",element:function(){return f.createElement(_,{sx:{height:275,width:"100%",whiteSpace:"wrap"},color:"red",variant:"body1"},"An error aquired while downloading a preview")},isActive:function(e){return!!mL("/error",e)}}],KI=ct(),QI=function(t){var n=void 0===t?{}:t,r=n.onLoadStart,o=n.onLoadEnd,i=n.fallback,l=n.onMount,c=n.onUnmount,u=n.onSubmit,s=n.onClose,d=n.title,m=void 0===d?"Document preview":d,p=n.submitLabel,h=void 0===p?"Download":p,v=n.submitIcon,g=e(oo(null),2),b=g[0],w=g[1],E=Vw({title:m,AfterTitle:function(e){var t=e.onClose;return f.createElement(Ne,{size:"small",onClick:t},f.createElement(Fe,null))},withActionButton:!0,withStaticAction:!1,onSubmit:u,onLoadStart:r,onLoadEnd:o,fallback:i,onMount:l,onUnmount:function(){w(null),c&&c()},onClose:s,submitLabel:h,submitIcon:v,routes:GI,history:KI,fullScreen:!1,mapInitialData:function(){return{main:a({blob:null,mime:null},b.current)}}}),x=E.render,C=E.pickData;return{render:x,pickData:y(function(e){w(e),KI.push("/"),C(e.url)},[])}},JI=function(e,t){var n=(void 0===t?{}:t).loaderSize,r=void 0===n?48:n,o=N(e);return function(e){return f.createElement(I,{fallback:f.createElement(jw,{sx:{width:"100%",height:"80vh"},size:r})},f.createElement(o,a({},e)))}},ZI=wS,eM=Fy.install,tM=Ry,nM=a({},qp),rM=a({},Kl),oM=a({},PI);export{rw as ActionBounce,si as ActionButton,Qy as ActionChip,im as ActionFab,aw as ActionFilter,Wy as ActionGroup,ec as ActionIcon,Ca as ActionMenu,og as ActionModal,zy as ActionState,iw as ActionStopIcon,uw as ActionToggle,lw as ActionTrigger,ip as ActionType,Uw as AlertView,tL as ArraySet,Zr as Async,zx as AuthView,Sm as AutoSizer,hw as BehaviorSubject,By as Breadcrumbs,$y as Breadcrumbs2,tM as Breadcrumbs2Type,Xn as CANCELED_PROMISE_SYMBOL,ok as CalendarView,uC as CardView,ob as Center,vk as ChatController,Sk as ChatView,pS as Chip,Zv as ClassicChipListSlot,jh as ClassicFilterListSlot,PL as Collection,Ky as ColorButton,Rm as ColumnType,Nm as ConstraintView,lS as Copy,sS as CopyButton,mS as Countdown,jl as DatePicker,Lg as DenseFilterListSlot,Ig as DenseSearchSlot,cg as DialogFilterListSlot,uk as DocumentView,sm as Dot,Xw as DragDropView,Kw as DropAreaView,kL as Entity,RL as EntityNotFoundError,Xy as ErrorBoundary,_x as ErrorView,Un as EventEmitter,yE as FadeView,IC as FeatureType,OC as FeatureView,If as FetchError,Hg as FetchView,Rn as FieldType,Jw as FilesView,Aa as Grid,hk as GridView,jE as HtmlView,pd as If,dk as ImageView,Si as InfiniteView,NC as KanbanView,rg as LARGE_SIZE_REQUEST,Pv as List,vg as ListActionAdd,xg as ListActionFab,kg as ListActionMenu,Bh as ListDefaultSlots,Tg as ListRules,Wh as ListSlotFactory,Av as ListTyped,jw as LoaderView,kS as MASTER_DETAIL_HEADER,CS as MASTER_DETAIL_ROOT,uS as Map,BS as MasterDetail,ZI as MasterDetailMode,VE as MetroView,sg as ModalFilterListSlot,Ya as ModalManagerProvider,_f as ModalProvider,EL as Model,Eh as ModernChipListSlot,tf as NoSsr,ir as Observer,HE as OfflineView,yf as One,em as OneButton,Fo as OneConfig,nu as OneDefaultSlots,Qf as OneIcon,ou as OneSlotFactory,wf as OneTyped,KN as Operator,Sf as OtherComboSlot,Lf as OtherItemsSlot,Tw as OutletView,oa as PaperView,TE as PingView,fx as PortalView,xx as RECORD_NEVER_VALUE,Px as RecordView,MC as ReloadView,UE as RevealView,Jk as RoiView,JS as RouteManager,ng as SMALL_SIZE_REQUEST,Mb as Scaffold,Jb as Scaffold2,Ty as Scaffold3,dE as ScaleView,yS as ScrollAdjust,Mw as ScrollTopView,rm as ScrollView,pw as SearchModal,Vc as SearchView,XE as SecretView,bi as SelectionMode,cm as Sheet,Cw as SizeProvider,Nw as SnackProvider,pr as Source,tS as Spinner,ab as Square,lr as Subject,dS as SubjectBinding,Kg as Switch,kN as TIMEOUT_SYMBOL,CE as TabsView,eo as Task,Xi as Tile,Gi as TileCheckbox,Fi as TileMode,wc as TimePicker,Fy as Translate,eu as TreeView,pi as VIRTUAL_VIEW_CHILD,mi as VIRTUAL_VIEW_ROOT,Ei as VirtualListBox,gi as VirtualView,JE as VisibilityView,PE as WaitView,ix as WizardContainer,rx as WizardNavigation,tx as WizardView,Cl as addUtcOffset,AN as afterinit,JN as and,ub as arrays,CI as cacheSrc,hd as cached,Gn as cancelable,Lc as chooseFile,cN as chooseMultipleFiles,dl as compareArray,Ga as compareFulltext,qn as compose,iS as copyToClipboard,nN as createAwaiter,wI as createCustomTag,tN as createDict,vs as createField,Sd as createLayout,Mg as createLsManager,bI as createLsSet,vN as createLsStateProvider,vI as createManagedHistory,sL as createPointer,eL as createRouteItemManager,ZS as createRouteParamsManager,bN as createScaleRect,xN as createScaleToSize,XS as createServiceManager,ap as createSsManager,gI as createSsSet,hN as createSsStateProvider,vl as createStateProvider,xr as createValueProvider,Of as createWindowHistory,oM as crypt,rM as datetime,Zn as debounce,Ar as deepFlat,FI as distinctDocuments,iN as downloadBlank,sN as errorData,wN as execpool,Rf as fetchApi,BI as filterDocuments,DN as first,sI as flatArray,mI as formatAmount,hI as formatStr,wl as formatText,RI as fromBytes32,$C as fromMomentStamp,TI as fromTimeStamp,rI as getAvailableFields,mN as getElementFromXPath,pL as getErrorMessage,cI as getFieldVariant,aI as getFieldsError,oI as getFilterCount,Sl as getGenesisStamp,Xf as getInitialData,iI as getInvalidFields,fN as getMediaContext,qC as getMomentStamp,KS as getRouteItem,QS as getRouteParams,AI as getTimeStamp,pN as getXPathFromElement,QN as has,JI as heavy,US as inject,Md as isBaseline,Nd as isBaselineForRoot,$f as isBaselineSimple,uI as isInvalidFieldData,Bn as isObject,rE as isOneArray,WI as iterateDocuments,YI as iterateList,zI as iteratePromise,VI as iterateUnion,eI as join,tI as last,pv as list2grid,lN as loadScript,ON as lock,EI as mainColor,Go as makeField,Cs as makeLayout,HI as mapDocuments,ZN as match,Hi as memoize,Ph as normalizeText,lp as not,lb as objects,RN as obsolete,nE as oneArrayIncludes,lk as openBlank,TC as or,OI as paginateDocuments,NI as parseAsciiParams,SI as parseBase64Json,mL as parseRouteUrl,jI as pickDocuments,qS as prefetch,uN as preventBrowserHistorySwipeGestures,fd as promiseState,md as promiseValue,VS as provide,Kn as queued,Kr as randomString,Mx as recordToExcelExport,eM as registerTr,op as reloadPage,dI as removeExtraSpaces,aN as removeSubstring,kl as removeUtcOffset,fI as replaceSubstring,_I as resolveDocuments,TN as retry,gN as roundTicks,yN as scaleRect,CN as scaleToSize,II as serializeAsciiParams,zS as serviceManager,to as singlerun,fo as singleshot,PN as singletick,$n as sleep,LI as stringifyBase64Json,pI as templateStr,SN as timeout,MI as toBytes32,oE as toOneArray,fL as toRouteUrl,DI as toUtcDate,nI as truely,ho as trycatch,kC as ttl,nM as typo,$S as unload,ig as useActionModal,ag as useActionModalTyped,_L as useActionSnackbar,no as useActualCallback,oo as useActualRef,jr as useActualState,Vr as useActualValue,$L as useAlert,Pf as useApiHandler,jv as useApiPaginator,qv as useArrayPaginator,Ti as useAsyncAction,hL as useAsyncProgress,Sc as useAsyncValue,vL as useAudioPlayer,vw as useBehaviorSubject,$v as useCachedPaginator,Xr as useChange,Ni as useChangeDelay,Gr as useChangeSubject,jL as useCollection,Pg as useColumnConfig,Vf as useConfirm,Mm as useConstraint,oL as useContextMenu,ja as useCursorPaginator,GL as useDate,Oi as useDebounce,Di as useDebouncedCallback,_i as useDeepChangeSubject,yi as useElementSize,LL as useEntity,FC as useFeatureView,zL as useFile,cE as useFilesView,uL as useForceUpdate,Fa as useGridAction,ca as useGridProps,Oa as useGridSelection,Gv as useHistoryStatePagination,tl as useItemModal,Ov as useLastPagination,WL as useList,Qv as useListAction,yp as useListCachedRows,bh as useListChips,Ep as useListDropFilters,NL as useListEditor,Hp as useListIntersectionConnect,Wp as useListIntersectionListen,zp as useListIntersectionStorage,pp as useListModalSort,Vm as useListPayload,mm as useListProps,ep as useListReload,Kv as useListSelection,hm as useListSelectionState,Zh as useListStateAction,Qp as useListToggleHandler,ev as useListUpsertManager,Tf as useLocalHandler,wE as useLocalHistory,Th as useManagedCursor,nl as useMediaContext,IL as useMediaStreamBuilder,Bf as useModal,Ua as useModalManager,CL as useModel,Da as useOffsetPaginator,Gf as useOnce,ZL as useOne,tE as useOneArray,Zo as useOneContext,ri as useOneFeatures,nL as useOneInput,so as useOneMenu,Mr as useOnePayload,il as useOneProps,bl as useOneRadio,qr as useOneState,eN as useOneTyped,QI as useOpenDocument,Vw as useOutletModal,dL as usePointer,di as usePreventAction,sb as usePreventAutofill,qf as usePreventLeave,eE as usePreventNavigate,UL as usePrompt,Wv as useQueryPagination,Ta as useQueuedAction,Jr as useReloadTrigger,al as useRenderWaiter,OL as useRequestSnackbar,aL as useRouteItem,lL as useRouteParams,gw as useSearchModal,bw as useSearchModalTyped,Fv as useSearchParams,Bv as useSearchState,ro as useSinglerunAction,iL as useSingleshot,Fr as useSingleton,xw as useSize,Lw as useSnack,jf as useStaticHandler,_r as useSubject,sw as useSubjectValue,gL as useSubscription,ME as useTabsModal,QL as useTime,Db as useUserAgent,ZE as useVisibilityView,cL as useWatchChanges,eg as useWindowSize,dx as useWizardModal,yr as waitForMove,LN as waitForNext,YS as waitForProvide,GS as websocketManager,gm as wordForm};
1
+ import{__read as e,__awaiter as t,__generator as n,__spreadArray as r,__asyncGenerator as o,__await as i,__assign as a,__rest as l,__values as c,__extends as u,__makeTemplateObject as s,__asyncValues as d}from"tslib";import*as f from"react";import m,{createContext as p,useMemo as h,useContext as v,useState as g,useRef as b,useCallback as y,useEffect as w,useLayoutEffect as E,forwardRef as x,memo as C,Fragment as k,createElement as S,cloneElement as L,lazy as N,Suspense as I}from"react";import{useTheme as M,createTheme as R,ThemeProvider as P,alpha as A}from"@mui/material/styles";import{createMakeAndWithStyles as T,keyframes as D}from"tss-react";import j from"@mui/material/Box";import O from"@mui/material/CircularProgress";import F from"@mui/material/ListItemIcon";import _ from"@mui/material/Typography";import B from"@mui/material/MenuItem";import H from"@mui/material/Divider";import W from"@mui/material/Menu";import*as z from"react-dom";import{flushSync as V}from"react-dom";import{v4 as Y}from"uuid";import U from"@mui/material/Grid";import{Grid as q,alpha as $,Typography as X,Divider as G,useMediaQuery as K,Accordion as Q,AccordionSummary as J,AccordionDetails as Z,Paper as ee,Box as te,debounce as ne,useTheme as re,lighten as oe,Tooltip as ie,darken as ae,Button as le,List as ce,ListItem as ue,ListItemIcon as se,TextField as de,Avatar as fe,Grow as me,createTheme as pe,ThemeProvider as he}from"@mui/material";import ve from"@mui/material/Checkbox";import ge from"@mui/material/FormControlLabel";import be from"@mui/material/FormGroup";import ye from"@mui/material/Button";import we from"@mui/material/Stack";import Ee from"@mui/material/Autocomplete";import xe from"@mui/material/TextField";import Ce from"@mui/material/Radio";import ke from"@mui/material/Paper";import Se from"@mui/material/Modal";import Le from"@mui/material/InputAdornment";import Ne from"@mui/material/IconButton";import Ie from"@mui/material/List";import Me from"@mui/material/ListItemButton";import Re from"@mui/icons-material/ArrowDropUp";import Pe from"@mui/icons-material/ArrowDropDown";import Ae from"@mui/icons-material/MoreVert";import Te from"@mui/material/Fab";import De from"@mui/material/LinearProgress";import je from"@mui/material/Backdrop";import Oe from"@mui/material/ListItemText";import Fe from"@mui/icons-material/Close";import _e from"@mui/icons-material/RadioButtonChecked";import Be from"@mui/icons-material/RadioButtonUnchecked";import He from"@mui/material/Chip";import We from"@mui/icons-material/CheckBox";import ze from"@mui/icons-material/CheckBoxOutlineBlank";import Ve from"@mui/material/RadioGroup";import Ye from"@mui/material/Rating";import Ue from"dayjs";export{default as dayjs}from"dayjs";import qe from"@mui/material/Popover";import $e from"@mui/material/Toolbar";import Xe from"@mui/icons-material/KeyboardArrowLeft";import Ge from"@mui/icons-material/KeyboardArrowRight";import Ke from"@mui/icons-material/CalendarTodayOutlined";import Qe from"@mui/icons-material/ArrowForward";import Je from"@mui/icons-material/AlarmOutlined";import Ze from"@mui/material/Switch";import et from"@mui/material/Slider";import tt from"@mui/material/ListItem";import nt from"@mui/icons-material/Clear";import rt from"@mui/material/ListSubheader";import ot from"@mui/icons-material/Search";import it from"@mui/icons-material/ExpandMore";import at from"@mui/material/Tab";import lt from"@mui/material/Tabs";import{createMemoryHistory as ct,createBrowserHistory as ut}from"history";import st from"@mui/material/Dialog";import dt from"@mui/material/DialogContent";import ft from"@mui/material/DialogActions";import mt from"@mui/material/DialogTitle";import pt from"@mui/material/Badge";import ht from"@mui/icons-material/Fullscreen";import vt from"@mui/material/Table";import gt from"@mui/material/TableBody";import bt from"@mui/material/TableHead";import yt from"@mui/material/TableContainer";import wt from"@mui/material/TableRow";import Et from"@mui/material/TableCell";import xt from"@mui/material/TablePagination";import Ct from"@mui/material/PaginationItem";import kt from"@mui/material/Pagination";import St from"@mui/icons-material/ArrowUpward";import Lt from"@mui/icons-material/ArrowDownward";import Nt from"@mui/material/Tooltip";import It from"@mui/material/TableSortLabel";import Mt from"@mui/icons-material/Add";import Rt from"@mui/icons-material/CleaningServicesOutlined";import Pt from"@mui/icons-material/Refresh";import At from"@mui/icons-material/Sort";import Tt from"@mui/icons-material/Settings";import Dt from"@mui/material/Collapse";import jt from"@mui/icons-material/ExpandLess";import Ot from"@mui/icons-material/NotInterested";import Ft from"@mui/icons-material/FilterList";import{pathToRegexp as _t,compile as Bt,match as Ht}from"path-to-regexp";import{red as Wt}from"@mui/material/colors";import zt from"@mui/material/AppBar";import Vt from"@mui/material/CssBaseline";import Yt from"@mui/material/Drawer";import Ut from"@mui/icons-material/Menu";import qt from"@mui/material/ButtonBase";import $t from"@mui/icons-material/OutlinedFlag";import Xt from"@mui/material/SwipeableDrawer";import Gt from"@mui/material/InputBase";import Kt from"@mui/material/Breadcrumbs";import Qt from"@mui/material/Link";import Jt from"@mui/material/ButtonGroup";import Zt from"@mui/icons-material/Palette";import en from"@mui/icons-material/Remove";import tn from"@mui/material/Snackbar";import nn from"@mui/icons-material/KeyboardArrowUp";import rn from"@mui/material/Box/Box";import on from"@mui/material/Alert";import an from"@mui/icons-material/CloudUpload";import ln from"@mui/icons-material/Delete";import cn from"@mui/material/Step";import un from"@mui/material/StepLabel";import sn from"@mui/material/Stepper";import dn from"dayjs/plugin/isToday";import fn from"dayjs/plugin/localeData";import mn from"dayjs/locale/en-gb";import pn from"dayjs/plugin/utc";import hn from"@mui/icons-material/ArrowBackIos";import vn from"@mui/icons-material/ArrowForwardIos";import gn from"dayjs/plugin/timezone";import bn from"@mui/icons-material/Send";import yn from"@mui/icons-material/Stop";import wn from"@mui/icons-material/KeyboardVoice";import En from"@mui/icons-material/AttachFile";import xn from"@mui/icons-material/Folder";import Cn from"@mui/icons-material/ContentCopy";import kn from"@mui/icons-material/AccessTime";import{fileTypeFromBlob as Sn}from"file-type/core";import Ln from"@mui/material/Avatar";import Nn from"@mui/material/ListItemAvatar";import In from"@mui/icons-material/CloudSync";globalThis.window||(globalThis.window=globalThis);var Mn,Rn=p(null),Pn=function(e){var t=e.children,n=e.apiRef,r=void 0===n?null:n,o=e.reloadSubject,i=void 0===o?null:o,a=e.changeSubject,l=void 0===a?null:a,c=e.updateSubject,u=void 0===c?null:c,s=h(function(){return{apiRef:r,reloadSubject:i,changeSubject:l,updateSubject:u}},[r,i,l,u]);return f.createElement(Rn.Provider,{value:s},t)},An=T({useTheme:M}).makeStyles,Tn=function(e){var t=e.children,n=M(),r=h(function(){return R(n)},[n]);return f.createElement(P,{theme:r},t)};!function(e){e.Layout="custom-layout",e.Switch="switch-field",e.YesNo="yesno-field",e.Line="line-field",e.File="file-field",e.Group="group-layout",e.Paper="paper-layout",e.Outline="outline-layout",e.Expansion="expansion-layout",e.Radio="radio-field",e.Checkbox="checkbox-field",e.Text="text-field",e.Date="date-field",e.Time="time-field",e.Progress="progress-field",e.Component="component-field",e.Slider="slider-field",e.Combo="combo-field",e.Choose="choose-field",e.Tree="tree-field",e.Dict="dict-field",e.Init="init-field",e.Phony="phony-field",e.Button="button-field",e.Icon="icon-field",e.Complete="complete-field",e.Items="items-field",e.Rating="rating-field",e.Typography="typography-field",e.Fragment="fragment-layout",e.Div="div-layout",e.Box="box-layout",e.Tabs="tabs-layout",e.Hero="hero-layout",e.Center="center-layout",e.Stretch="stretch-layout",e.Condition="condition-layout"}(Mn||(Mn={})),Object.entries(Mn).forEach(function(t){var n=e(t,2),r=n[0],o=n[1];Mn[r]=Symbol.for(o)});var Dn=Mn,jn=new Set([Dn.Group,Dn.Box,Dn.Paper,Dn.Outline,Dn.Expansion,Dn.Div,Dn.Tabs,Dn.Hero,Dn.Fragment,Dn.Center,Dn.Stretch,Dn.Condition,Dn.Layout]),On=function(e){return jn.has(e)},Fn=function(e){var t=e.type;return e.name&&!jn.has(t)},_n=function(e){return"object"==typeof e&&null!==e&&Object.getPrototypeOf(e)===Object.prototype},Bn=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(Array.isArray(e[n])?t[n]=e[n].slice(0):_n(e[n])?t[n]=Bn(e[n]):t[n]=e[n]);return t},Hn=function(t,n,r){var o=(Array.isArray(n)?n:n.split(".").filter(function(e){return e})).flatMap(function(e){return"string"==typeof e?e.split("."):e}),i=o.slice(0,o.length-1).reduce(function(e,t){return e&&e[t]},t),a=e(o.reverse(),1)[0];try{return i[a]=r,!0}catch(e){return!1}},Wn=function(e,t){return(Array.isArray(t)?t:t.split(".").filter(function(e){return e})).flatMap(function(e){return"string"==typeof e?e.split("."):e}).reduce(function(e,t){return e&&e[t]},e)},zn=function(e,t){if(e===t)return!0;if(_n(e)&&_n(t)){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!zn(e[n],t[n]))return!1;return!0}return!1};var Vn,Yn=function(){function o(){var o=this;this._events={},this.getListeners=function(e){return o._events[e]||[]},this.subscribe=function(e,t){!o._events[e]&&(o._events[e]=[]),o._events[e].push(t)},this.unsubscribe=function(e,t){!o._events[e]&&(o._events[e]=[]),o._events[e]=o._events[e].filter(function(e){return t!==e})},this.unsubscribeAll=function(){o._events={}},this.once=function(i,a){var l=function(){for(var c=[],u=0;u<arguments.length;u++)c[u]=arguments[u];return t(o,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,a.apply(void 0,r([],e(c),!1))];case 1:return t.sent(),this.unsubscribe(i,l),[2]}})})};return o.subscribe(i,l),function(){o.unsubscribe(i,l)}},this.emit=function(i){for(var a=[],l=1;l<arguments.length;l++)a[l-1]=arguments[l];return t(o,void 0,void 0,function(){var t,o;return n(this,function(n){switch(n.label){case 0:t=r([],e(this._events&&this._events[i]||[]),!1),o=0,n.label=1;case 1:return o===t.length?[3,4]:[4,t[o].apply(t,r([],e(a),!1))];case 2:n.sent(),n.label=3;case 3:return o++,[3,1];case 4:return[2]}})})}}return Object.defineProperty(o.prototype,"hasListeners",{get:function(){return e=this._events,!(0===Object.getOwnPropertySymbols(e).length&&0===Object.getOwnPropertyNames(e).length);var e},enumerable:!1,configurable:!0}),o}(),Un=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce(function(t,n){return function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return t(n.apply(void 0,r([],e(o),!1)))}})},qn=function(e){return void 0===e&&(e=1e3),new Promise(function(t){return setTimeout(function(){return t()},e)})},$n=Symbol("cancelable-canceled"),Xn=function(t){var n,o=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return new Promise(function(i,a){var l=!1;n&&n(),n=function(){l=!0,i($n)};var c=t.apply(void 0,r([],e(o),!1));c.then(function(e){l||i(e)}),c.catch(function(e){l||a(e)})})};return o.cancel=function(){n&&n()},o},Gn=function(o){var i=Promise.resolve(),a=void 0,l=function(){for(var c=[],u=0;u<arguments.length;u++)c[u]=arguments[u];var s=!1,d=function(){s=!0};return a=a?Un(a,d):d,i=i.then(function(){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return s?[3,2]:[4,o.apply(void 0,r([],e(c),!1))];case 1:return[2,t.sent()];case 2:return[2,$n]}})})}).finally(function(){l.clear(),a=void 0}),i};return l.clear=function(){i=Promise.resolve(),a=void 0},l.cancel=function(){i=Promise.resolve(),a&&a(),a=void 0},l},Kn=function(e){return requestAnimationFrame(e)},Qn=function(e){return cancelAnimationFrame(e)},Jn=function(t,n){var o;void 0===n&&(n=1e3);var i=null,a=n?setTimeout:Kn,l=n?clearTimeout:Qn,c=function(){for(var c=[],u=0;u<arguments.length;u++)c[u]=arguments[u];null!==o&&l(o);var s=function(){i=null,o=null,t.apply(void 0,r([],e(c),!1))};i=s,o=a(s,n)};return c.clear=function(){null!==o&&l(o),o=null,i=null},c.flush=function(){null!==o&&l(o),i&&i(),o=null,i=null},c.pending=function(){return!!i},c},Zn=Symbol("observer-subscribe"),er=Symbol("observer-connect"),tr=Symbol("observer-disconnect"),nr=Symbol("observer-connect-listen"),rr=Symbol("observer-disconnect-listen"),or=function(){function e(r){var a=this;this.dispose=r,this.broadcast=new Yn,this._isShared=!1,this._subscribe=function(e,t){a.broadcast.subscribe(Zn,t),e[nr](function(){a.broadcast.emit(er)}),e[rr](function(){a.hasListeners||a.broadcast.emit(tr)})},this._unsubscribe=function(e){a.broadcast.unsubscribe(Zn,e)},this.tryDispose=function(){a.hasListeners||a._isShared||(a.dispose(),a.broadcast.emit(tr))},this.map=function(t){var n,r=new e(Un(function(){return a.tryDispose()},function(){return n()})),o=function(e){var n=t(e);r.emit(n)};return a._subscribe(r,o),n=function(){return a._unsubscribe(o)},r},this.flatMap=function(t){var n,r=new e(Un(function(){return a.tryDispose()},function(){return n()})),o=function(e){var n=t(e);Array.isArray(n)?n.forEach(function(e){r.emit(e)}):r.emit(n)};return a._subscribe(r,o),n=function(){return a._unsubscribe(o)},r},this.operator=function(e){return e(a)},this.reduce=function(t,n){var r,o=n,i=new e(Un(function(){return a.tryDispose()},function(){return r()})),l=function(e){var n=t(o,e);o=n,i.emit(n)};return a._subscribe(i,l),r=function(){return a._unsubscribe(l)},i},this.split=function(){var t,n=new e(Un(function(){return a.tryDispose()},function(){return t()})),r=function(e){Array.isArray(e)?e.flat(Number.POSITIVE_INFINITY).forEach(function(e){n.emit(e)}):n.emit(e)};return a._subscribe(n,r),t=function(){return a._unsubscribe(r)},n},this.mapAsync=function(r,o){var i,l=new e(Un(function(){return a.tryDispose()},function(){return i()})),c=Gn(r),u=function(e){return t(a,void 0,void 0,function(){var t,r;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,c(e)];case 1:return(t=n.sent())!==$n&&l.emit(t),[3,3];case 2:if(r=n.sent(),!o)throw r;return o(r),[3,3];case 3:return[2]}})})};return a._subscribe(l,u),i=Un(function(){return a._unsubscribe(u)},function(){return c.clear()}),l},this.filter=function(t){var n,r=new e(Un(function(){return a.tryDispose()},function(){return n()})),o=function(e){t(e)&&r.emit(e)};return a._subscribe(r,o),n=function(){return a._unsubscribe(o)},r},this.tap=function(t){var n,r=new e(Un(function(){return a.tryDispose()},function(){return n()})),o=function(e){t(e),r.emit(e)};return a._subscribe(r,o),n=function(){return a._unsubscribe(o)},r},this.debounce=function(t){var n,r=new e(Un(function(){return a.tryDispose()},function(){return n()})),o=Jn(function(e){r.emit(e)},t);return a._subscribe(r,o),n=Un(function(){return o.clear()},function(){return a._unsubscribe(o)}),r},this.delay=function(r){var o,i=new e(Un(function(){return a.tryDispose()},function(){return o()})),l=!1,c=Gn(function(e){return t(a,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,qn(r)];case 1:return t.sent(),l?[3,3]:[4,i.emit(e)];case 2:t.sent(),t.label=3;case 3:return[2]}})})});return a._subscribe(i,c),o=Un(function(){return c.clear()},function(){return a._unsubscribe(c)},function(){l=!0}),i},this.emit=function(e){return t(a,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,this.broadcast.emit(Zn,e)];case 1:return t.sent(),[2]}})})},this.connect=function(e){return a.broadcast.subscribe(Zn,e),a.broadcast.emit(er),Un(function(){return a.tryDispose()},function(){return a._unsubscribe(e)})},this.once=function(e){var t;return t=a.connect(function(n){e(n),t()})},this.share=function(){return a._isShared=!0,a},this.repeat=function(t){var n,r;void 0===t&&(t=1e3);var o=new e(Un(function(){return a.tryDispose()},function(){return n()},function(){return void 0!==r&&clearTimeout(r)})),i=function(e){void 0!==r&&clearTimeout(r),o.emit(e),a.hasListeners&&(r=setTimeout(i,t,e))};return a._subscribe(o,i),n=function(){return a._unsubscribe(i)},o},this.merge=function(t){var n,r=new e(Un(function(){return a.tryDispose()},function(){return n()})),o=function(e){r.emit(e)};a._subscribe(r,o);var i=function(){};return r[nr](function(){i=t.connect(o)||function(){}}),n=Un(function(){return a._unsubscribe(o)},function(){return i()}),r},this.unsubscribe=function(){a.broadcast.unsubscribeAll(),a.broadcast.emit(tr),a.dispose()},this.toPromise=function(){return new Promise(function(e){a.once(function(t){return e(t)})})},this.toIteratorContext=function(){var e=a,t=!1;return{iterate:function(){return o(this,arguments,function(){var r;return n(this,function(n){switch(n.label){case 0:return t?[3,4]:[4,i(e.toPromise())];case 1:return r=n.sent(),[4,i(r)];case 2:return[4,n.sent()];case 3:return n.sent(),[3,0];case 4:return[2]}})})},done:function(){t=!0}}}}return Object.defineProperty(e.prototype,"isShared",{get:function(){return this._isShared},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasListeners",{get:function(){return!!this.broadcast.getListeners(Zn).length},enumerable:!1,configurable:!0}),e.prototype[nr]=function(e){this.broadcast.once(er,e)},e.prototype[rr]=function(e){this.broadcast.once(tr,e)},e}(),ir=Symbol("react-declarative-subject"),ar=function(){function e(){var e=this;this._emitter=new Yn,this.map=function(t){var n,r=new or(function(){return n()});return n=e.subscribe(r.emit),r.map(t)},this.flatMap=function(t){var n,r=new or(function(){return n()});return n=e.subscribe(r.emit),r.flatMap(t)},this.reduce=function(t,n){var r,o=new or(function(){return r()});return r=e.subscribe(o.emit),o.reduce(t,n)},this.mapAsync=function(t,n){var r,o=new or(function(){return r()});return r=e.subscribe(o.emit),o.mapAsync(t,n)},this.filter=function(t){var n,r=new or(function(){return n()});return n=e.subscribe(r.emit),r.filter(t)},this.tap=function(t){var n,r=new or(function(){return n()});return n=e.subscribe(r.emit),r.tap(t)},this.operator=function(t){var n,r=new or(function(){return n()});return n=e.subscribe(r.emit),r.operator(t)},this.split=function(){var t,n=new or(function(){return t()});return t=e.subscribe(n.emit),n.split()},this.debounce=function(t){var n,r=new or(function(){return n()});return n=e.subscribe(r.emit),r.debounce(t)},this.delay=function(t){var n,r=new or(function(){return n()});return n=e.subscribe(r.emit),r.delay(t)},this.repeat=function(t){var n,r=new or(function(){return n()});return n=e.subscribe(r.emit),r.repeat(t)},this.merge=function(t){var n,r=new or(function(){return n()});return n=e.subscribe(r.emit),r.merge(t)},this.subscribe=function(t){return e._emitter.subscribe(ir,t),function(){e._emitter.unsubscribe(ir,t)}},this.unsubscribeAll=function(){e._emitter.unsubscribeAll()},this.once=function(t){return e._emitter.once(ir,t)},this.toPromise=function(){return e.toObserver().toPromise()},this.toIteratorContext=function(){return e.toObserver().toIteratorContext()},this.next=this.next.bind(this),this.toObserver=this.toObserver.bind(this),this.toIteratorContext=this.toIteratorContext.bind(this)}return e.prototype.next=function(e){return t(this,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,this._emitter.emit(ir,e)];case 1:return t.sent(),[2]}})})},e.prototype.toObserver=function(){var e,t=new or(function(){return e()});return e=this.subscribe(t.emit),t},e}(),lr=function(e){var t,n=0,r=new or(function(){void 0!==t&&clearTimeout(t)}),o=function(){r.emit(n),n++,t=setTimeout(o,e)};return r[nr](function(){o()}),r},cr=function(e,r){var o=!1,i=new or(function(){o=!0});return i[nr](function(){t(void 0,void 0,void 0,function(){var t,a;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,e()];case 1:return t=n.sent(),o||i.emit(t),[3,3];case 2:if(a=n.sent(),!r)throw a;return r(a),[3,3];case 3:return[2]}})})}),i},ur=function(e){var t,n=new or(function(){void 0!==t&&clearTimeout(t)}),r=function(){t=void 0,n.emit()};return n[nr](function(){setTimeout(r,e)}),n},sr=function(e){var t=new or(function(){});return t[nr](function(){Array.isArray(e)?e.flat(Number.POSITIVE_INFINITY).forEach(function(e){t.emit(e)}):t.emit(e)}),t},dr=function(e){var t=new or(function(){document.removeEventListener(e,t.emit)});if("document"in globalThis){t[nr](function(){document.addEventListener(e,t.emit)})}return t},fr=function(e){return{tap:function(t){return e().tap(t)},debounce:function(t){return e().debounce(t)},delay:function(t){return e().delay(t)},repeat:function(t){return e().repeat(t)},filter:function(t){return e().filter(t)},map:function(t){return e().map(t)},flatMap:function(t){return e().flatMap(t)},operator:function(t){return e().operator(t)},reduce:function(t,n){return e().reduce(t,n)},mapAsync:function(t,n){return e().mapAsync(t,n)},merge:function(t){return e().merge(t)},split:function(){return e().split()},connect:function(t){return e().connect(t)},once:function(t){return e().once(t)},unsubscribe:function(){return e().unsubscribe()},share:function(){return e().share()},toPromise:function(){return e().toPromise()},toIteratorContext:function(){return e().toIteratorContext()}}},mr=function(){function t(){}var n;return n=t,t.merge=function(e){var t=(new ar).toObserver();return e.forEach(function(e){e&&(t=t.merge(e))}),t},t.join=function(t,n){var o=void 0===n?{}:n,i=o.race,a=void 0!==i&&i,l=o.buffer,c=void 0===l?[]:l,u=function(){},s=new or(function(){return u()});t=t.filter(function(e){return!!e}),c=r([],e(new Array(t.length)),!1).map(function(e,t){return c[t]});var d=[],f=function(){c.every(function(e){return void 0!==e})&&(s.emit(r([],e(c),!1)),!a&&c.fill(void 0))};return s[nr](function(){t.forEach(function(e,t){if(e){var n=e.connect(function(e){c[t]=e,f()});d.push(function(){return n()})}}),u=Un.apply(void 0,r([],e(d),!1))}),s},t.unicast=function(e){return a(a({},fr(e)),{isUnicasted:!0})},t.multicast=function(e){var t;return a(a({},fr(function(){return t||(t=e())[rr](function(){t=void 0}),t})),{getRef:function(){return t},isMulticasted:!0})},t.createHot=function(e){var t,n=new or(function(){return t()});return t=e(n.emit)||function(){},n},t.createCold=function(e){var t=function(){},n=new or(function(){return t()});return n[nr](function(){t=e(n.emit)||function(){}}),n},t.create=n.createCold,t.pipe=function(e,t){var n=function(){},r=new or(function(){return n()});return r[nr](function(){var o=new ar,i=e.connect(o.next),a=t(o,r.emit)||function(){};n=Un(function(){return a()},function(){return i()})}),r},t.fromInterval=lr,t.fromPromise=cr,t.fromDelay=ur,t.fromArray=sr,t.fromEvent=dr,t.fromValue=function(e){var t=new or(function(){});return t[nr](function(){"function"==typeof e?t.emit(e()):t.emit(e)}),t},t.fromSubject=function(e){var t,n=new or(function(){return t()});return t=e.subscribe(n.emit),n},t.fromBehaviorSubject=function(e){var t,n=new or(function(){return t()});return n[nr](function(){e.data&&n.emit(e.data)}),t=e.subscribe(n.emit),n},t}(),pr=mr.create(function(e){return document.addEventListener("mousemove",e),function(){return document.removeEventListener("mousemove",e)}}),hr=mr.create(function(e){return document.addEventListener("touchmove",e),function(){return document.removeEventListener("touchmove",e)}}),vr=mr.create(function(e){return document.addEventListener("scroll",e),function(){return document.removeEventListener("scroll",e)}}),gr=mr.unicast(function(){var e=0;return mr.merge([pr,hr,vr]).filter(function(){return 20===e||(e+=1,!1)}).tap(function(){e=0}).share()}),br=function(e){return gr.connect(e)},yr=mr.unicast(function(){return mr.create(function(e){return mr.fromEvent("keydown").connect(function(t){"Tab"===t.code&&e()})}).share()}),wr=mr.unicast(function(){return mr.create(function(e){return document.addEventListener("touchstart",e,{passive:!1}),document.addEventListener("mousedown",e),function(){document.removeEventListener("touchstart",e),document.removeEventListener("mousedown",e)}}).share()}),Er=function(e){var t=p(e||null);return[function(e){var n=e.children,r=e.payload;return m.createElement(t.Provider,{value:r},n)},function(){return v(t)}]},xr=e(Er(),2),Cr=xr[0],kr=xr[1],Sr=p(null),Lr={},Nr=function(e){var t=e.children,n=e.payload,r=void 0===n?Lr:n;return f.createElement(Sr.Provider,{value:r},t)},Ir=function(){return v(Sr)},Mr=((Vn={})[Dn.Checkbox]=!1,Vn[Dn.Radio]=null,Vn[Dn.Text]="",Vn[Dn.Switch]=!1,Vn[Dn.Progress]=1,Vn[Dn.Slider]=0,Vn[Dn.Combo]=null,Vn[Dn.Items]=null,Vn[Dn.Rating]=3,Vn[Dn.Typography]="",Vn[Dn.Date]="",Vn[Dn.Time]="",Vn[Dn.File]=null,Vn[Dn.Choose]=null,Vn[Dn.Component]=null,Vn[Dn.Complete]="",Vn[Dn.Init]=null,Vn[Dn.YesNo]=null,Vn[Dn.Dict]=null,Vn[Dn.Tree]=null,Vn),Rr=function(e){var t=Mr[e];return void 0===t?void console.warn("react-declarative One initialValue unknown type ".concat(String(e))):t},Pr=function(t){void 0===t&&(t=[]);var n=[],o=function(t){return void 0===t&&(t=[]),null==t?void 0:t.forEach(function(t){var i=t.fields||[],a=t.child?[t.child]:[];o(r(r([],e(i),!1),e(a),!1)),n.push(t)})};return o(t),n},Ar=function(t){for(var n,o,i=[],a=1;a<arguments.length;a++)i[a-1]=arguments[a];if(!i.length)return t;var l=i.shift();if(_n(t)&&_n(l))for(var c in l)Array.isArray(l[c])?t[c]=l[c].slice(0):_n(l[c])?(t[c]||Object.assign(t,((n={})[c]={},n)),Ar(t[c],l[c])):Object.assign(t,((o={})[c]=l[c],o));return Ar.apply(void 0,r([t],e(i),!1))},Tr=function(e,t){var n=(Array.isArray(t)?t:t.split(".").filter(function(e){return e})).flatMap(function(e){return"string"==typeof e?e.split("."):e});n.slice(0,n.length-1).reduce(function(e,t){return e[t]=e[t]?e[t]:{}},e)},Dr=function(t){var n=e(g(t),2),r=n[0],o=n[1],i=b(r),a=y(function(e){var t;t="function"==typeof e?e(i.current):e,i.current=t,o(t)},[]);return[i,a]},jr=Symbol("empty-value"),Or=function(e){var t=b(jr);return t.current===jr&&(t.current=function(e){return"function"==typeof e?e():e}(e)),t.current},Fr=function(e){var t=Or(function(){return new ar});return w(function(){var n=void 0;return e&&(n=e.subscribe(t.next)),n},[e]),t},_r="one-resolve",Br=function(e){return e},Hr=function(e,t,n){var r={};return e&&Pr(e).filter(function(e){return!n||!e.features||e.features.some(function(e){return n.includes(e)})}).filter(function(e){return e.type!==Dn.Phony}).filter(function(e){return e.type!==Dn.Button}).filter(function(e){return e.type!==Dn.Icon}).forEach(function(e){if(Fn(e)){if(Tr(r,e.name),"function"==typeof e.hidden?e.hidden(t):e.hidden)return;void 0===e.defaultValue?Hn(r,e.name,Wn(r,e.name)||Rr(e.type)):"function"==typeof e.defaultValue?Hn(r,e.name,e.defaultValue(t)):Hn(r,e.name,e.defaultValue)}}),r},Wr=function(r){var o=r.handler,i=r.fallback,l=r.fields,c=r.features,u=r.payload,s=r.change,d=r.loadStart,f=r.loadEnd,m=r.incomingTransform,p=void 0===m?Br:m,h=e(Dr(null),2),g=h[0],x=h[1],C=v(Rn),k=C.apiRef,S=C.changeSubject,L=C.reloadSubject,N=C.updateSubject,I=b(!0),M=b(!1),R=Fr(S),P=Fr(L),A=Fr(N);w(function(){var e,r=function(){return t(void 0,void 0,void 0,function(){var e,t,r,a,m,h,v;return n(this,function(n){switch(n.label){case 0:return M.current?[2]:[3,1];case 1:if("function"!=typeof o)return[3,9];e=!0,d&&d(_r),n.label=2;case 2:return n.trys.push([2,6,7,8]),(t=o(u))instanceof Promise?(r=Ar,a=[{},Hr(l,u,c)],m=Bn,[4,t]):[3,4];case 3:return v=r.apply(void 0,a.concat([m.apply(void 0,[n.sent()])])),s(v,!0),I.current&&x(p(v,u)),[3,5];case 4:v=Ar({},Hr(l,u,c),Bn(t)),s(v,!0),I.current&&x(p(v,u)),n.label=5;case 5:return[3,8];case 6:if(h=n.sent(),e=!1,!i)throw h;return i(h),[3,8];case 7:return f&&f(e,_r),M.current=!0,[7];case 8:return[3,10];case 9:o&&!zn(g.current,o)&&(v=Ar({},Hr(l,u,c),Bn(o)),I.current&&x(p(v,u))),n.label=10;case 10:return[2]}})})};r(),e={reload:r,change:function(e,t){void 0===t&&(t=!1),x(p(e,u)),s(e,t)},getData:function(){return a({},g.current||{})}},"function"==typeof k?k(e):k&&(k.current=e),P.unsubscribeAll(),P.subscribe(e.reload),R.unsubscribeAll(),R.subscribe(function(t){t&&t!==g.current&&e.change(t,!0)}),A.unsubscribeAll(),A.subscribe(function(t){t&&t!==g.current&&e.change(t,!1)})},[o]),E(function(){return function(){I.current=!1}},[]);var T=y(function(){return g.current},[]);return[g.current,x,T]},zr=function(e){var t=b(e);return t.current=e,t},Vr=p(null),Yr=function(t){var n=t.children,r=l(t,["children"]),o=b({}),i=b(!1),c=r.fields,u=void 0===c?[]:c,s=r.features,d=r.change,m=void 0===d?function(){return null}:d,p=r.fallback,v=void 0===p?function(){return null}:p,g=r.handler,w=void 0===g?function(){return{}}:g,E=r.payload,x=r.loadStart,C=r.loadEnd,k=r.incomingTransform,S=e(Wr({handler:w,fallback:v,fields:u,features:s,payload:E,change:m,loadStart:x,loadEnd:C,incomingTransform:k}),3),L=S[0],N=S[1],I=S[2],M=zr(L),R=y(function(t,n){var r=o.current,a=M.current;N(t),Object.entries(n).forEach(function(t){var n=e(t,2),o=n[0],i=n[1];r[o]=i}),Object.values(r).some(function(e){return e})?i.current=!0:(t!==a||i.current)&&(i.current=!1,m(t,!1))},[]),P=y(function(e){return R(Bn(a(a({},M.current),e)),{})},[]),A=h(function(){return{object:L,setObject:R,changeObject:P,getObjectRef:I}},[L]);return f.createElement(Vr.Provider,{value:A},!!L&&n)},Ur=function(){return v(Vr)},qr=function(){},$r=function(e,t,n){void 0===t&&(t=[]),void 0===n&&(n=!1);var r=b(!0),o=b(n);return w(function(){return r.current?(r.current=!1,qr):o.current?qr:e()||qr},t),h(function(){return{resetWatcher:function(){r.current=!0},beginWatch:function(){r.current=!1,o.current=!1},stopWatch:function(){o.current=!0}}},[])},Xr=function(e){var t=Or(function(){return new ar});return $r(function(){t.next(e)},[e]),t},Gr=function(){return Y()},Kr=Gr(),Qr=function(t){void 0===t&&(t=0);var n=e(g(Kr),2),r=n[0],o=n[1],i=y(function(){return o(Gr())},[]);return w(function(){var e;return t&&(e=setTimeout(function(){e=void 0,i()},t)),function(){void 0!==e&&clearTimeout(e)}},[r,t,i]),{reloadTrigger:r,doReload:i}},Jr=function(o){var i=o.reloadSubject,a=o.loading,l=o.disabled,c=o.children,u=o.fallback,s=o.Loader,d=void 0===s?function(){return null}:s,m=o.Error,p=void 0===m?function(){return null}:m,h=o.onLoadStart,v=o.onLoadEnd,y=o.payload,x=o.deps,C=void 0===x?[]:x,k=o.throwError,S=void 0!==k&&k,L=e(g(""),2),N=L[0],I=L[1],M=e(g(l),2),R=M[0],P=M[1],A=Xr(l);w(function(){return A.subscribe(function(e){e||P(!1)})},[]);var T=Qr(),D=T.reloadTrigger,j=T.doReload,O=Fr(i);w(function(){return O.subscribe(function(){j()})},[]);var F=b(null),_=e(g(!1),2),B=_[0],H=_[1],W=e(g(!1),2),z=W[0],Y=W[1],U=b(!0),q=a||B;return E(function(){return function(){U.current=!1}},[]),w(function(){if(!R){F.current&&F.current.cancel();var e=Xn(function(){return t(void 0,void 0,void 0,function(){var e,t,r;return n(this,function(n){switch(n.label){case 0:e=!0,h&&h(),n.label=1;case 1:return n.trys.push([1,5,6,7]),(t=c(y))instanceof Promise?[4,t]:[3,3];case 2:return[2,n.sent()||null];case 3:return[2,t||null];case 4:return[3,7];case 5:throw r=n.sent(),e=!1,r;case 6:return v&&v(e),[7];case 7:return[2]}})})});F.current=e;t(void 0,void 0,void 0,function(){var t,r,o;return n(this,function(n){switch(n.label){case 0:t=!1,U.current&&H(!0),U.current&&Y(!1),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,e()];case 2:return(r=n.sent())===$n?(t=!0,[2]):(F.current=null,U.current&&queueMicrotask(function(){return V(function(){I(r)})}),[3,5]);case 3:if(o=n.sent(),U.current&&Y(!0),S)throw o;return u&&u(o),[3,5];case 4:return t||U.current&&H(!1),[7];case 5:return[2]}})})}},r(r([y,R],e(C),!1),[D],!1)),q?f.createElement(d,{payload:y}):z?f.createElement(p,{payload:y}):f.createElement(f.Fragment,null,N)},Zr=function(){function e(e){var t=this;this.target=e,this._status="pending",e.then(function(){return t._status="fulfilled"}),e.catch(function(){return t._status="rejected"})}return Object.defineProperty(e.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),e}(),eo=function(t){var n=void 0,o=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return"pending"!==(null==n?void 0:n.status)&&(n=new Zr(t.apply(void 0,r([],e(o),!1)))),null==n?void 0:n.target};return o.clear=function(){n=void 0},o.getStatus=function(){return(null==n?void 0:n.status)||"ready"},o},to=function(t,n){void 0===n&&(n=[]);var o=b(t);return o.current=t,y(function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return o.current.apply(o,r([],e(t),!1))},n)},no=function(r,o){var i=void 0===o?{}:o,a=i.onLoadStart,l=i.onLoadEnd,c=i.fallback,u=i.throwError,s=e(g(!1),2),d=s[0],f=s[1],m=e(g(!1),2),p=m[0],v=m[1],y=b(!0),w=to(r);E(function(){return function(){y.current=!1}},[]);var x=h(function(){return eo(function(e){return t(void 0,void 0,void 0,function(){var r,o,i;return n(this,function(s){switch(s.label){case 0:r=function(){return t(void 0,void 0,void 0,function(){var t,r,o;return n(this,function(n){switch(n.label){case 0:t=!0,a&&a(),n.label=1;case 1:return n.trys.push([1,5,6,7]),(r=w(e))instanceof Promise?[4,r]:[3,3];case 2:return[2,n.sent()||null];case 3:return[2,r||null];case 4:return[3,7];case 5:throw o=n.sent(),t=!1,o;case 6:return l&&l(t),[7];case 7:return[2]}})})},y.current&&f(!0),y.current&&v(!1),o=!1,s.label=1;case 1:return s.trys.push([1,3,4,5]),[4,r()];case 2:return[2,s.sent()];case 3:if(i=s.sent(),y.current&&v(!0),u)throw i;return c&&c(i),[3,5];case 4:return o||y.current&&f(!1),[7];case 5:return[2,null]}})})})},[]);return{loading:d,error:p,execute:x}},ro=function(e){var t=Or(e),n=b(t),r=y(function(e){var t;t="function"==typeof e?e(n.current):e,n.current=t},[]);return[n,r]},oo={name:"",menu:function(){return null},menuItems:[],onValueChange:function(){return null}},io=An()({container:{position:"relative",display:"flex",alignItems:"stretch",justifyContent:"stretch",maxHeight:"45vh",overflowY:"auto",overflowX:"hidden"},content:{flex:1,display:"flex",flexDirection:"column",justifyContent:"stretch"},loader:{position:"absolute",top:0,left:0,right:0,bottom:0,height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center"}}),ao=function(r){var o=r.requestSubject,i=io().classes,c=e(g(null),2),u=c[0],s=c[1],d=e(g(0),2),m=d[0],p=d[1],v=e(ro(oo),2),b=v[0],E=v[1],x=e(ro(0),2),C=x[0],k=x[1],S=Ur(),L=S.object,N=S.changeObject,I=Ir(),M=y(function(){p(function(e){return e+1})},[]),R=y(function(){p(function(e){return Math.max(e-1,0)})},[]),P=no(function(e){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,b.current.menu(b.current.name,e,A.current,I,b.current.onValueChange,N)];case 1:return t.sent(),s(null),[2]}})})},{onLoadStart:M,onLoadEnd:R}).execute,A=zr(L),T=h(function(){return b.current.menuItems.map(function(e){var t=e.isDisabled,n=void 0===t?function(){return!1}:t,r=e.isVisible,o=void 0===r?function(){return!0}:r,i=l(e,["isDisabled","isVisible"]);return a(a({},i),{isDisabled:function(){return n(A.current,I)},isVisible:function(){return o(A.current,I)}})})},[b.current.menuItems]),D=zr(T);return w(function(){return o.subscribe(Gn(function(e){return t(void 0,[e],void 0,function(e){var t,r=e.event,o=e.menuItems,i=e.menu,a=e.name,l=e.onValueChange;return n(this,function(e){switch(e.label){case 0:return[4,qn(350)];case 1:return e.sent(),k(function(e){return e+1}),E({name:a,menuItems:o,onValueChange:l,menu:i}),t=document.elementFromPoint(r.clientX,r.clientY),s(t||r.target),[2]}})})}))},[]),f.createElement(W,{key:C.current,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},anchorEl:u,open:!!u,onClose:function(){return s(null)},MenuListProps:{disablePadding:!0}},f.createElement("div",{className:i.container},0!==m&&f.createElement("div",{className:i.loader},f.createElement(O,{size:14})),f.createElement("div",{className:i.content},D.current.map(function(e,r){var o=e.label,i=void 0===o?"unknown-label":o,a=e.action,l=void 0===a?"unknown-action":a,c=e.divider,u=e.onClick,d=e.icon,m=e.isDisabled,p=void 0===m?function(){return!1}:m,h=e.isVisible,v=void 0===h?function(){return!0}:h;return f.createElement(Jr,{Loader:function(){return c?null:f.createElement(B,{sx:{visibility:"hidden",minWidth:225}},!!d&&f.createElement(F,null,f.createElement(d,null)),f.createElement(_,{variant:"inherit"},i))},onLoadStart:M,onLoadEnd:R,key:"".concat(C.current,"-").concat(r),payload:I},function(e){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return[4,qn(0)];case 1:return n.sent(),[4,p(e)];case 2:return t=n.sent(),[4,v(e)];case 3:return n.sent()?c?[2,f.createElement(H,{orientation:"horizontal"})]:[2,f.createElement(B,{disabled:t,onClick:function(){if(u)return u(A.current,e,b.current.onValueChange,N),void s(null);P(l)},sx:{minWidth:225}},!!d&&f.createElement(F,null,f.createElement(d,null)),f.createElement(_,{variant:"inherit"},i))]:[2,null]}})})})}))))},lo=p(null),co=function(e){var r=e.children,o=Fr(),i=h(function(){return{createContextMenu:function(e){var r=e.menuItems,i=void 0===r?[]:r,a=e.onValueChange,l=void 0===a?function(){return null}:a,c=e.menu,u=e.name;return function(e){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return i?(e.preventDefault(),e.stopPropagation(),(null==i?void 0:i.length)?[4,o.next({name:u,menu:c,event:e,menuItems:i,onValueChange:l})]:[2]):[2];case 1:return[2,t.sent()]}})})}},requestSubject:o}},[]);return f.createElement(lo.Provider,{value:i},r,f.createElement(ao,{requestSubject:o}))},uo=function(){return v(lo)};var so=function(t){var n=!1,o=null,i=function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];return n||(n=!0,o=t.apply(void 0,r([],e(i),!1))),o};return i.clear=function(){n=!1},i},fo=function(){return!0},mo=function(e,t){var n=e.compute,r=e.type,o=e.readTransform,i=e.name,a=e.object,l=e.payload,c=e.config;if(n&&c.WITH_SYNC_COMPUTE){var u=t?n(a,l):Rr(r);return!(u instanceof Promise)&&u}return!(n||!i)&&(o(Wn(a,i),i,a,l)||Rr(r))},po=function(o,i){var a=void 0===i?{}:i,l=a.allowedErrors,u=a.fallback,s=a.defaultValue,d=void 0===s?null:s;return function(){for(var i,a,s=[],f=0;f<arguments.length;f++)s[f]=arguments[f];try{var m=o.apply(void 0,r([],e(s),!1));return m instanceof Promise?function(e,r){return t(void 0,[e,r],void 0,function(e,t){var r,o=t.fallback,i=t.defaultValue;return n(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,e];case 1:return[2,t.sent()];case 2:return r=t.sent(),o&&o(r),[2,i];case 3:return[2]}})})}(m,{fallback:u,defaultValue:d}):m}catch(e){if(u&&u(e),l){try{for(var p=c(l),h=p.next();!h.done;h=p.next()){if(e instanceof h.value)return d}}catch(e){i={error:e}}finally{try{h&&!h.done&&(a=p.return)&&a.call(p)}finally{if(i)throw i.error}}throw e}return d}}},ho=function(){return!1},vo=function(){return!0},go=function(){return null},bo=function(){return null},yo=function(){return!1},wo=function(e,t,n){var r="".concat(t,"(").concat(e||"unknown",")");return function(e){console.error("react-declarative ".concat(r," ").concat(n," exception"),e)}},Eo=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=[];return t.forEach(function(t){if(t)if("string"==typeof t)o.push(t);else if(Array.isArray(t)){if(t.length){var n=Eo.apply(void 0,r([],e(t),!1));n&&o.push(n)}}else"object"==typeof t&&(t.toString!==Object.prototype.toString?o.push(t.toString()):Object.entries(t).filter(function(t){var n=e(t,2);return n[0],!!n[1]}).forEach(function(t){var n=e(t,1)[0];return o.push(n)}))}),o.join(" ")},xo="12",Co=function(e){return Number(e)},ko=An()({root:{position:"relative",display:"flex",alignItems:"stretch",justifyContent:"stretch"},container:{flex:1,display:"flex",alignItems:"stretch",justifyContent:"stretch",width:"100%","& > *":{flex:1}}}),So=function(e,t){var n=e.className,r=e.style,o=e.sx,i=e.columns,c=void 0===i?"":i,u=e.phoneColumns,s=void 0===u?"":u,d=e.tabletColumns,m=void 0===d?"":d,p=e.desktopColumns,v=void 0===p?"":p,g=e.fieldRightMargin,b=void 0===g?"1":g,y=e.fieldBottomMargin,w=void 0===y?"2":y,E=e.children,x=e.onClick,C=e.onFocus,k=e.onContextMenu,S=l(e,["className","style","sx","columns","phoneColumns","tabletColumns","desktopColumns","fieldRightMargin","fieldBottomMargin","children","onClick","onFocus","onContextMenu"]),L=ko().classes,N=h(function(){return{xs:Co(s||c||xo),sm:Co(m||c||xo),md:Co(m||c||xo),lg:Co(v||c||xo),xl:Co(v||c||xo),mr:Co(b),mb:Co(w)}},[]),I=N.xs,M=N.sm,R=N.md,P=N.lg,A=N.xl,T=N.mr,D=N.mb;return f.createElement(U,a({},S,{ref:t,item:!0,className:Eo(n,L.root),style:r,onFocus:C,onClick:x,xs:I,sm:M,md:R,lg:P,xl:A,sx:o,onContextMenu:k}),f.createElement(j,{className:L.container,mr:T,mb:D},E))};So.displayName="Item";var Lo=x(So),No=function(e,t){var n=e.className,r=e.style,o=e.children,i=e.onFocus,c=e.onClick,u=e.isBaselineAlign,s=e.columnsOverride,d=e.sx,m=e.onContextMenu,p=l(e,["className","style","children","onFocus","onClick","isBaselineAlign","columnsOverride","sx","onContextMenu"]),v=h(function(){return s&&Number(s)},[]);return f.createElement(q,a({},p,{ref:t,container:!0,alignItems:u?"flex-end":"flex-start",className:n,style:r,onClick:c,onFocus:i,columns:v,onContextMenu:m,sx:d}),o)};No.displayName="Container";var Io=x(No),Mo=An()({root:{position:"relative","& > *":{width:"100%"}}}),Ro=function(e,t){var n=e.className,r=void 0===n?"":n,o=e.columns,i=void 0===o?"":o,c=e.phoneColumns,u=void 0===c?"":c,s=e.tabletColumns,d=void 0===s?"":s,m=e.desktopColumns,p=void 0===m?"":m,h=e.children,v=e.isItem,g=e.isBaselineAlign,b=e.style,y=e.columnsOverride,w=e.sx,E=e.fieldRightMargin,x=void 0===E?"1":E,C=e.fieldBottomMargin,k=void 0===C?"2":C,S=e.onClick,L=e.onFocus,N=e.onContextMenu,I=l(e,["className","columns","phoneColumns","tabletColumns","desktopColumns","children","isItem","isBaselineAlign","style","columnsOverride","sx","fieldRightMargin","fieldBottomMargin","onClick","onFocus","onContextMenu"]),M=Mo().classes;return v?f.createElement(Lo,a({},I,{ref:t,className:Eo(M.root,r),style:b,columns:i,phoneColumns:u,tabletColumns:d,desktopColumns:p,fieldRightMargin:x,fieldBottomMargin:k,onFocus:L,onClick:S,onContextMenu:N,sx:w}),h):f.createElement(Io,a({},I,{ref:t,className:Eo(M.root,r),isBaselineAlign:g,columnsOverride:y,style:b,onFocus:L,onContextMenu:N,onClick:S,sx:w}),h)};Ro.displayName="Group";var Po=x(Ro),Ao=function(t){if(t){if(t.includes(".")){var n=t.split(".");t=e(n.reverse(),1)[0]}var o=e(t.split("_")),i=o[0],a=o.slice(1);return r(["".concat(i.charAt(0).toUpperCase()).concat(i.slice(1))],e(a),!1).join(" ")}},To={WITH_DIRTY_CLICK_LISTENER:!0,WITH_MOBILE_READONLY_FALLBACK:!0,WITH_WAIT_FOR_MOVE_LISTENER:!0,WITH_WAIT_FOR_TAB_LISTENER:!0,WITH_WAIT_FOR_TOUCH_LISTENER:!0,WITH_DISMOUNT_LISTENER:!0,WITH_SYNC_COMPUTE:!1,CUSTOM_FIELD_DEBOUNCE:800,FIELD_BLUR_DEBOUNCE:100},Do=function(){var e=this;this._config=To,this.getRef=function(){return e._config},this.setValue=function(t){Object.assign(e._config,To,t)}},jo=Symbol("get-reference"),Oo=function(){function e(){}var t;return t=jo,e.instance=new Do,e[t]=e.instance.getRef,e.setValue=e.instance.setValue,e}(),Fo={display:"flex",alignItems:"stretch",justifyContent:"stretch"},_o=An()(function(e){var t,n,r;return{root:a(a({},Fo),{"& > *":a(a({},Fo),{flexGrow:1}),"& > * > *":{flexGrow:1},pointerEvents:"all"}),hidden:{display:"none !important"},fieldReadonly:{"& > *":{pointerEvents:"none !important"}},phoneHidden:(t={},t[e.breakpoints.only("xs")]={display:"none !important"},t),tabletHidden:(n={},n[e.breakpoints.between("sm","lg")]={display:"none !important"},n),desktopHidden:(r={},r[e.breakpoints.up("lg")]={display:"none !important"},r)}}),Bo=function(e){return console.log({v:e})},Ho=function(){return null},Wo=function(){return null},zo=function(e){return e},Vo=function(){},Yo=function(){return null},Uo=function(){return null},qo=function(e){return e},$o=function(e){return e};function Xo(o,i){var c=this;void 0===i&&(i={withApplyQueue:!1,skipDirtyClickListener:!1,skipClickListener:!1,skipFocusReadonly:!1,skipFocusBlurCall:!1,skipDebounce:!1,defaultProps:{}});var u=C(o),s=Oo[jo](),d=function(d){var m,p,v,b,x,C,k,S=d.className,L=void 0===S?"":S,N=d.sx,I=d.columns,M=void 0===I?"":I,R=d.phoneColumns,P=void 0===R?"":R,A=d.tabletColumns,T=void 0===A?"":A,D=d.desktopColumns,j=void 0===D?"":D,O=d.phoneHidden,F=void 0!==O&&O,_=d.tabletHidden,B=void 0!==_&&_,H=d.desktopHidden,W=void 0!==H&&H,z=d.isDisabled,V=d.isVisible,Y=d.isInvalid,U=d.isIncorrect,q=d.isReadonly,$=d.readTransform,X=void 0===$?qo:$,G=d.writeTransform,K=void 0===G?$o:G,Q=d.change,J=void 0===Q?Bo:Q,Z=d.fallback,ee=void 0===Z?Ho:Z,te=d.ready,ne=void 0===te?Wo:te,re=d.compute,oe=d.shouldRecompute,ie=d.click,ae=void 0===ie?Vo:ie,le=d.map,ce=void 0===le?zo:le,ue=d.object,se=d.name,de=void 0===se?"":se,fe=d.title,me=void 0===fe?Ao(de)||void 0:fe,pe=d.menu,he=void 0===pe?Uo:pe,ve=d.type,ge=d.debug,be=d.focus,ye=d.blur,we=d.invalidity,Ee=d.prefix,xe=d.dirty,Ce=void 0!==xe&&xe,ke=d.disabled,Se=void 0!==ke&&ke,Le=d.readonly,Ne=void 0!==Le&&Le,Ie=d.autoFocus,Me=d.style,Re=d.menuItems,Pe=d.groupRef,Ae=void 0===Pe?Yo:Pe,Te=d.fieldRightMargin,De=void 0===Te?null===(p=i.defaultProps)||void 0===p?void 0:p.fieldRightMargin:Te,je=d.fieldBottomMargin,Oe=void 0===je?null===(v=i.defaultProps)||void 0===v?void 0:v.fieldBottomMargin:je,Fe=d.outlinePaper,_e=void 0!==Fe&&Fe,Be=d.transparentPaper,He=void 0!==Be&&Be,We=d.testId,ze=void 0===We?de:We,Ve=l(d,["className","sx","columns","phoneColumns","tabletColumns","desktopColumns","phoneHidden","tabletHidden","desktopHidden","isDisabled","isVisible","isInvalid","isIncorrect","isReadonly","readTransform","writeTransform","change","fallback","ready","compute","shouldRecompute","click","map","object","name","title","menu","type","debug","focus","blur","invalidity","prefix","dirty","disabled","readonly","autoFocus","style","menuItems","groupRef","fieldRightMargin","fieldBottomMargin","outlinePaper","transparentPaper","testId"]),Ye=Ur(),Ue=Ye.object,qe=Ye.changeObject,$e=Ye.getObjectRef,Xe=Ir(),Ge=uo().createContextMenu,Ke=function(e){var t=e.prefix,n=e.name,r=e.isDisabled,o=void 0===r?ho:r,i=e.isVisible,a=void 0===i?vo:i,l=e.isInvalid,c=void 0===l?go:l,u=e.isIncorrect,s=void 0===u?bo:u,d=e.isReadonly,f=void 0===d?yo:d;return h(function(){return{isDisabled:po(o,{defaultValue:!1,fallback:wo(n,t,"isDisabled")}),isVisible:po(a,{defaultValue:!1,fallback:wo(n,t,"isVisible")}),isInvalid:po(c,{defaultValue:null,fallback:wo(n,t,"isInvalid")}),isIncorrect:po(s,{defaultValue:null,fallback:wo(n,t,"isIncorrect")}),isReadonly:po(f,{defaultValue:!1,fallback:wo(n,t,"isReadonly")})}},[])}({prefix:Ee,name:de,isDisabled:z,isVisible:V,isInvalid:Y,isIncorrect:U,isReadonly:q}),Qe=Ke.isDisabled,Je=Ke.isVisible,Ze=Ke.isInvalid,et=Ke.isIncorrect,tt=Ke.isReadonly,nt=Ue||ue,rt=_o().classes,ot=function(e){var t=e.compute,n=e.shouldRecompute,r=void 0===n?fo:n;return h(function(){var e=null;if(t){var n=so(t);return function(t,o){return e&&r(e,t,o)&&n.clear(),e=t,n(t,o)}}},[])}({compute:re,shouldRecompute:oe}),it=function(t,n){var r=e(g(function(){var e=function(e){var t=e.phoneHidden,n=e.tabletHidden,r=e.desktopHidden,o=e.isReadonly,i=e.isInvalid,a=e.isDisabled,l=e.isVisible,c=e.isIncorrect,u=e.object,s=e.payload;return{phoneHidden:"function"==typeof t?t(s):t,tabletHidden:"function"==typeof n?n(s):n,desktopHidden:"function"==typeof r?r(s):r,fieldReadonly:o(u,s),invalid:i(u,s),visible:l(u,s),incorrect:c(u,s),disabled:a(u,s)}}(n);return a(a(a({groupRef:null,focusReadonly:!0,loading:!1},e),{value:mo(n,e.visible)}),t)}),2),o=r[0],i=r[1];return{state:o,action:h(function(){return{setGroupRef:function(e){return i(function(t){return a(a({},t),{groupRef:e})})},setFocusReadonly:function(e){return i(function(t){return a(a({},t),{focusReadonly:e})})},setFieldReadonly:function(e){return i(function(t){return a(a({},t),{fieldReadonly:e})})},setDisabled:function(e){return i(function(t){return a(a({},t),{disabled:e})})},setInvalid:function(e){return i(function(t){return a(a({},t),{invalid:e})})},setIncorrect:function(e){return i(function(t){return a(a({},t),{incorrect:e})})},setVisible:function(e){return i(function(t){return a(a({},t),{visible:e})})},setLoading:function(e){return i(function(t){return a(a({},t),{loading:e})})},setDirty:function(e){return i(function(t){return a(a({},t),{dirty:e})})},setValue:function(e){return i(function(t){return a(a({},t),{value:e})})}}},[])}}({dirty:Ce},{compute:ot,type:ve,readTransform:X,config:s,name:de,object:nt,payload:Xe,isVisible:Je,isDisabled:Qe,isInvalid:Ze,isIncorrect:et,isReadonly:tt,phoneHidden:F,tabletHidden:B,desktopHidden:W}),at=it.state,lt=at.phoneHidden,ct=at.tabletHidden,ut=at.desktopHidden,st=at.dirty,dt=at.disabled,ft=at.fieldReadonly,mt=at.focusReadonly,pt=at.groupRef,ht=at.invalid,vt=at.incorrect,gt=at.loading,bt=at.value,yt=at.visible,wt=it.action,Et=wt.setDirty,xt=wt.setDisabled,Ct=wt.setFieldReadonly,kt=wt.setFocusReadonly,St=wt.setGroupRef,Lt=wt.setInvalid,Nt=wt.setIncorrect,It=wt.setLoading,Mt=wt.setValue,Rt=wt.setVisible,Pt=(x=s,C=kr(),k=x.CUSTOM_FIELD_DEBOUNCE,C||k),At=e(function(t,n){var r=e(g(function(){return{value:t}}),2),o=r[0],i=r[1],a=h(function(){return Jn(function(e){return i({value:e})},n)},[]);return w(function(){return function(){return a.clear()}},[]),[o,a,a]}(bt,i.skipDebounce?0:Pt),3),Tt=At[0],Dt=At[1],jt=At[2],Ot=jt.pending,Ft=jt.flush,_t=function(e){var t=e.prefix,n=e.name,r=e.clickDisabled,o=e.lastObject,i=e.debouncedValue$,a=e.fieldReadonly$,l=e.focusReadonly$,c=e.invalid$,u=e.upperReadonly$,s=e.value$,d=e.groupRef$,f=h(function(){return{inputUpdate:!1,objectUpdate:!1,initComplete:!1,fieldName:"".concat(t,"(").concat(n||"unknown",")"),lastObject:o,isMounted:!0,clickDisabled:!1,debouncedValue$:null,fieldReadonly$:null,focusReadonly$:null,invalid$:null,upperReadonly$:null,value$:null,groupRef$:null}},[]);return f.debouncedValue$=i,f.fieldReadonly$=a,f.focusReadonly$=l,f.invalid$=c,f.upperReadonly$=u,f.value$=s,f.groupRef$=d,f.clickDisabled=r,{memory:f}}({prefix:Ee,name:de,clickDisabled:Se||dt,lastObject:null,debouncedValue$:Tt.value,fieldReadonly$:ft,focusReadonly$:mt,invalid$:ht,upperReadonly$:Ne,groupRef$:pt,value$:bt}).memory,Bt=to(function(e){Mt(e),Dt(e),_t.initComplete=!0},[]);s.WITH_DISMOUNT_LISTENER&&E(function(){return function(){_t.isMounted=!1}},[]),s.WITH_WAIT_FOR_MOVE_LISTENER&&w(function(){return br(function(){Ot()&&Ft()})},[]),s.WITH_WAIT_FOR_TAB_LISTENER&&w(function(){return e=function(){Ot()&&Ft()},yr.connect(e);var e},[]),s.WITH_WAIT_FOR_TOUCH_LISTENER&&w(function(){return e=function(){Ot()&&Ft()},wr.connect(e);var e},[]);var Ht=y(function(){var e,t=$e(),n=_t.invalid$,r=_t.value$,o=!!n;if(_t.objectUpdate=!0,_t.inputUpdate=!1,ot){var i=Je(t,Xe),a=!!i&&ot(t,Xe);a instanceof Promise?(It(!0),a.then(function(e){return _t.isMounted&&Bt(e)}).catch(function(e){return _t.isMounted&&ee(e)}).finally(function(){return _t.isMounted&&It(!1)})):Bt(a);var l=Qe(t,Xe),c=tt(t,Xe),u=Ze(t,Xe)||null,s=et(t,Xe)||null;Ct(c),Lt(u),Nt(s),xt(l),Rt(i)}else if(de){var d=Qe(t,Xe),f=Je(t,Xe),m=Ze(t,Xe)||null,p=et(t,Xe)||null,h=(c=tt(t,Xe),X(Wn(t,de),de,t,Xe)),v=h!==r;(v=v&&!o)&&(_t.inputUpdate=!0,Bt(h),Lt(m),null!==m&&we(de,m,Xe),J(t,((e={})[_t.fieldName]=!!m,e))),Ct(c),Nt(p),xt(d),Rt(f)}else{var g=Qe(t,Xe),b=Je(t,Xe),c=tt(t,Xe);Ct(c),xt(g),Rt(b)}ne()},[nt]),Wt=y(function(){var e,t,n=$e(),r=_t.debouncedValue$,o=!!_t.invalid$;if(_t.inputUpdate)_t.inputUpdate=!1;else if(_t.objectUpdate)_t.objectUpdate=!1;else{if(ot)return;var a=Bn(n),l=Hn(a,de,K(r,de,n,Xe)),c=Ze(a,Xe)||null,u=et(a,Xe)||null;if(Lt(c),Nt(u),Et(!0),!de)return;if(!l)throw new Error('One error invalid name specified "'.concat(de,'"'));null!==c?(we(de,c,Xe),J(a,((e={})[_t.fieldName]=!!c,e))):zn(n,a)&&!o||J(i.skipDebounce?ce(a,Xe):a,((t={})[_t.fieldName]=!!c,t))}},[]),zt=y(function(){var e,t;if(_t.initComplete&&!_t.inputUpdate){var n=$e(),r=_t.invalid$,o=_t.value$,a=Bn(n);Hn(a,de,K(o,de,n,Xe));var l=Ze(a,Xe)||null,c=et(a,Xe)||null;!l&&r&&(Lt(l),J(i.skipDebounce?ce(a,Xe):a,((e={})[_t.fieldName]=!!l,e))),l&&!r&&(Lt(l),J(n,((t={})[_t.fieldName]=!!l,t))),Nt(c)}},[]);w(function(){Ot()?Ft():(_t.lastObject!==nt&&(Ht(),zt()),Wt(),_t.lastObject=nt)},[Tt,nt]),s.WITH_MOBILE_READONLY_FALLBACK&&w(function(){var e=function(){return kt(!1)};return pt&&pt.addEventListener("touchstart",e,{passive:!1}),function(){return pt&&pt.removeEventListener("touchstart",e)}},[pt]),s.WITH_DIRTY_CLICK_LISTENER&&w(function(){if(!i.skipDirtyClickListener){var e=function(){return Et(!0)};return pt&&pt.addEventListener("click",e,{passive:!0}),function(){return pt&&pt.removeEventListener("click",e)}}},[pt]);var Vt=y(function(){return t(c,void 0,void 0,function(){var e;return n(this,function(t){for(e=0;60!==e&&(_t.inputUpdate||_t.objectUpdate);e++)qn(10);return _t.inputUpdate=!1,_t.objectUpdate=!1,[2]})})},[]),Yt=h(function(){return Xn(function(){return t(c,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,Vt()];case 1:return e.sent(),[2,!0]}})})})},[]),Ut=h(function(){return Gn(function(o){for(var a=[],l=1;l<arguments.length;l++)a[l-1]=arguments[l];return t(c,r([o],e(a),!1),void 0,function(e,t){return void 0===t&&(t={}),n(this,function(n){switch(n.label){case 0:return i.withApplyQueue?[4,Yt().then(function(n){n!==$n&&qt(e,t)})]:[3,2];case 1:return n.sent(),[2];case 2:return[2,qt(e,t)]}})})})},[]),qt=y(function(e,t){var n=(void 0===t?{}:t).skipReadonly,r=_t.fieldReadonly$,o=_t.upperReadonly$;_t.inputUpdate||_t.objectUpdate||_t.isMounted&&(r&&!n||o&&!n||ot&&!n||Bt(e))},[]),$t=y(function(e){e&&St(e),Ae(e)},[]),Xt=y(function(){var e=$e(),t=_t.fieldReadonly$,n=_t.upperReadonly$,r=_t.groupRef$;_t.isMounted&&(t||n||kt(!1),i.skipFocusBlurCall||(r&&function(e,t){return void 0===t&&(t=50),new Promise(function(n){var r=setInterval(function(){var t=document.activeElement!==e&&!e.contains(document.activeElement);(t=t||!document.body.contains(e))&&(clearInterval(r),n())},t)})}(r,s.FIELD_BLUR_DEBOUNCE).then(function(){Ot()&&Ft(),ye&&ye(de,e,Xe,function(e){return tn.onChange(e,{skipReadonly:!0})},qe),kt(!0)}),be&&be(de,e,Xe,function(e){return tn.onChange(e,{skipReadonly:!0})},qe)))},[]),Gt=h(function(){return Re?Ge({name:de,menu:he,menuItems:Re,onValueChange:function(e){return tn.onChange(e,{skipReadonly:!0})}}):void 0},[]),Kt=y(function(e){return t(c,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return _t.clickDisabled?[2]:(t=$e(),[4,ae(de,e,t,Xe,function(e){return tn.onChange(e,{skipReadonly:!0})},qe)]);case 1:return n.sent(),[2]}})})},[]),Qt=y(function(e){return t(c,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return i.skipClickListener?[2]:[4,Kt(e)];case 1:return[2,t.sent()]}})})},[]),Jt=a(a({},i.defaultProps),{columns:M,phoneColumns:P,tabletColumns:T,desktopColumns:j,fieldRightMargin:De,fieldBottomMargin:Oe,sx:a(a({},N),null===(b=i.defaultProps)||void 0===b?void 0:b.sx)}),Zt=y(function(){var e=_t.fieldReadonly$,t=_t.upperReadonly$,n=_t.focusReadonly$,r=!1;return r=r||t,i.skipFocusReadonly||(r=r||n),r=(r=r||e)||!!ot},[]),en=y(function(){var e=_t.fieldReadonly$,t=_t.upperReadonly$,n=!1;return n=(n=(n=n||t)||e)||!!ot},[]),tn=a(a({onChange:i.withApplyQueue?Ut:qt,click:Kt,fallback:ee,disabled:Se||dt,readonly:Zt(),dirty:st||Ce,autoFocus:Ie,invalid:ht,incorrect:vt,value:bt,name:de,loading:gt,object:nt,prefix:Ee,outlinePaper:_e,transparentPaper:He,withContextMenu:!!(null==Re?void 0:Re.length)||void 0},Ve),{fieldReadonly:en()});ge&&ge({managedProps:tn,originalComponent:o,payload:Xe});var nn=((m={})[rt.hidden]=!yt,m[rt.fieldReadonly]=ft,m[rt.phoneHidden]=lt,m[rt.tabletHidden]=ct,m[rt.desktopHidden]=ut,m),rn=a(a(a({},i.defaultProps),tn),me&&{title:me});return yt?f.createElement(Po,a({ref:$t,"data-testid":ze,"data-path":_t.fieldName,isItem:!0,style:Me,className:Eo(L,rt.root,nn)},Jt,{onFocus:Xt,onContextMenu:Gt,onClick:Qt}),f.createElement(u,a({},rn))):null};return d.displayName="Managed".concat(o.displayName||"UnknownField"),C(d)}var Go={},Ko=p(Go),Qo=function(e){var t=e.context,n=void 0===t?Go:t,r=e.children;return f.createElement(Ko.Provider,{value:n},r)},Jo=function(){return v(Ko)||Go},Zo=p(null),ei=[],ti=function(e){var t=e.children,n=e.features,r=void 0===n?ei:n;return f.createElement(Zo.Provider,{value:r},t)},ni=function(){return v(Zo)},ri=["dirty","fallback","readonly","invalid","loading","object","onChange","prefix","value"],oi=An()({root:{display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *":{flex:1}},disabled:{pointerEvents:"none",opacity:.5},readonly:{pointerEvents:"none"}}),ii=function(e){var t=e.Element,n=l(e,["Element"]),r=Jo();return f.createElement(t,a({},n,{context:r}))},ai=function(t){var n,r=t.disabled,o=t.invalid,i=t.incorrect,c=t.readonly,u=t.value,s=t.watchOneContext,d=t.element,m=void 0===d?function(){return f.createElement(k,null)}:d,p=t.outlinePaper,v=t.transparentPaper,g=t.object,b=t.onChange,y=t.click,w=l(t,["disabled","invalid","incorrect","readonly","value","watchOneContext","element","outlinePaper","transparentPaper","object","onChange","click"]),E=oi().classes,x=Ur().changeObject,C=Ir(),S=ni(),L=h(function(){var t=Object.entries(w).filter(function(t){var n=e(t,1)[0];return!ri.includes(n)}).reduce(function(t,n){var r,o=e(n,2),i=o[0],l=o[1];return a(a({},t),((r={})[i]=l,r))},{});return a(a({},g),{onChange:x,onValueChange:b,onClick:y,_fieldParams:t,_fieldData:g,outlinePaper:p,transparentPaper:v,invalid:o,incorrect:i,payload:C,disabled:r,readonly:c,features:S})},[g,r,o,i,c]);return f.createElement(j,{className:Eo(E.root,(n={},n[E.disabled]=r,n[E.readonly]=c,n))},s?f.createElement(ii,a({},L,{value:u,Element:m})):f.createElement(m,a({},L,{value:u,context:Go})))};ai.displayName="ComponentField";var li=Xo(ai,{defaultProps:{fieldRightMargin:"0",fieldBottomMargin:"0"},withApplyQueue:!0,skipDirtyClickListener:!0,skipFocusReadonly:!0,skipFocusBlurCall:!0,skipDebounce:!1}),ci=function(e){var t=e.loading,n=e.children;return f.createElement(we,{direction:"row",alignItems:"center",spacing:1},!!t&&f.createElement(j,{display:"flex",alignItems:"center"},f.createElement(O,{size:"16px",color:"inherit"})),f.createElement(j,null,n))},ui=function(r){var o=r.Progress,i=void 0===o?ci:o,c=r.onClick,u=void 0===c?function(){}:c,s=r.onLoadStart,d=r.onLoadEnd,m=r.fallback,p=r.children,h=r.disabled,v=r.throwError,y=void 0!==v&&v,w=r.variant,x=void 0===w?"outlined":w,C=l(r,["Progress","onClick","onLoadStart","onLoadEnd","fallback","children","disabled","throwError","variant"]),k=e(g(0),2),S=k[0],L=k[1],N=b(!0);E(function(){return function(){N.current=!1}},[]);var I=zr(S);return f.createElement(ye,a({},C,{onClick:function(e){return t(void 0,void 0,void 0,function(){var t,r;return n(this,function(n){switch(n.label){case 0:if(I.current)return[2];t=!0,n.label=1;case 1:return n.trys.push([1,3,4,5]),s&&s(),N.current&&L(function(e){return e+1}),[4,u(e)];case 2:return n.sent(),[3,5];case 3:if(r=n.sent(),t=!1,y)throw r;return m&&m(r),[3,5];case 4:return d&&d(t),N.current&&L(function(e){return e-1}),[7];case 5:return[2]}})})},disabled:!!S||h,variant:x}),f.createElement(i,{loading:!!S},p))},si=function(t){var n=void 0===t?{}:t,r=n.onLoadStart,o=n.onLoadEnd,i=n.disabled,a=e(g(0),2),l=a[0],c=a[1];return{handleLoadStart:function(){r&&r(),c(function(e){return e+1})},handleLoadEnd:function(e){o&&o(e),c(function(e){return e-1})},loading:!!l||i}},di=function(t,n){void 0===n&&(n=1e3);var o=0,i=function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];var l=Date.now()-o,c=function(){o=Date.now(),t.apply(void 0,r([],e(i),!1))};c(),l>n&&c()};return i.clear=function(){},i},fi="virtual-view-root",mi="virtual-view-child",pi="list_item_idx",hi=An()({root:{position:"relative",overflowY:"auto",minHeight:"50px"},hideScrollbar:{"&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"},adjust:{position:"absolute",visibility:"hidden",height:1,width:1,left:0}}),vi=function(r){var o,i=r.className,c=r.sx,u=r.withScrollbar,s=void 0!==u&&u,d=r.minRowHeight,m=void 0===d?60:d,p=r.bufferSize,v=void 0===p?5:p,x=r.children,C=r.hasMore,k=void 0===C||C,S=r.loading,L=void 0!==S&&S,N=r.onDataRequest,I=void 0===N?function(){}:N,M=r.onLoadStart,R=r.onLoadEnd,P=r.fallback,A=r.scrollXSubject,T=r.scrollYSubject,D=r.throwError,O=void 0!==D&&D,F=l(r,["className","sx","withScrollbar","minRowHeight","bufferSize","children","hasMore","loading","onDataRequest","onLoadStart","onLoadEnd","fallback","scrollXSubject","scrollYSubject","throwError"]),_=hi().classes,B=b(!0),H=b(!1),W=Fr(A),z=Fr(T),V=h(function(){return H.current=!0,f.Children.toArray(x)},[x]),Y=e(g(0),2),U=Y[0],q=Y[1],$=e(g(function(){return new Map}),2),X=$[0],G=$[1],K=!!U||L,Q=zr(k),J=zr(m),Z=zr(K),ee=to(function(e){return t(void 0,void 0,void 0,function(){var t,r;return n(this,function(n){switch(n.label){case 0:if(K)return[2];t=!0,n.label=1;case 1:return n.trys.push([1,5,6,7]),M&&M(),B.current&&q(function(e){return e+1}),I?[4,qn(0)]:[3,4];case 2:return n.sent(),[4,I(e)];case 3:n.sent(),n.label=4;case 4:return[3,7];case 5:if(r=n.sent(),t=!1,O)throw r;return P&&P(r),[3,7];case 6:return R&&R(t),B.current&&q(function(e){return e-1}),[7];case 7:return[2]}})})}),te=Or(function(){return new Map}),ne=e(g(null),2),re=ne[0],oe=ne[1],ie=e(g(0),2),ae=ie[0],le=ie[1],ce=e(g(0),2),ue=ce[0],se=ce[1],de=h(function(){return Math.max(Math.floor(ue/m),v)},[m,v,ue]),fe=Or(function(){return new ResizeObserver(function(e){return e.forEach(function(e){var t=e.target;if(t){var n=e.contentRect.height;if(t.classList.contains(fi)&&(se(n),te.forEach(function(e){if(document.body.contains(e)){var t=Number(e.dataset[pi]);if(!Number.isNaN(t)){var n=e.offsetHeight;G(function(e){return e.get(t)!==n?(e.set(t,Math.max(n,J.current)),new Map(e)):e})}}})),t.classList.contains(mi)){var r=Number(t.dataset[pi]);Number.isNaN(r)||G(function(e){return e.get(r)!==n?(e.set(r,Math.max(n,J.current)),new Map(e)):e})}}})})}),me=y(function(e){var t=e,n=0;return V.forEach(function(){t>=0&&(t-=X.get(n)||m,n+=1)}),Math.max(n-de,0)},[X,de,m,V]),pe=y(function(e,t){var n=e+ue,r=0;return V.forEach(function(){n>=0&&(n-=X.get(r)||m,r+=1)}),Math.min(r-1+de,t-1)},[X,de,ue,m,V]),he=y(function(e){var t=0;return V.slice(0,e).forEach(function(e,n){t+=X.get(n)||m}),t},[X,m,V]),ve=h(function(){var e=0;return V.forEach(function(t,n){e+=X.get(n)||m}),e},[X,V,m]),ge=y(function(){if(re){if(re.clientHeight>=re.scrollHeight)return!1;var e=re.scrollHeight-re.scrollTop-re.clientHeight;return Math.abs(e)<10}return!1},[re]),be=f.useMemo(function(){var t=me(ae),n=pe(ae,V.length);Array.from(te.entries()).forEach(function(r){var o=e(r,2),i=o[0],a=o[1];(i<t||i>n)&&(fe.unobserve(a),te.delete(i))});var r=!0;return(r=(r=(r=(r=r&&Q.current)&&!Z.current)&&ge())&&V.length===n+1)&&!H.current&&queueMicrotask(function(){return ee(!1)}),H.current=!1,V.slice(t,n+1).map(function(e,n){return f.cloneElement(e,{ref:function(e){if(e){var r=t+n,o=te.get(r);o!==e&&(o&&fe.unobserve(o),e.classList.add(mi),e.dataset[pi]=String(r),fe.observe(e),te.set(r,e),G(function(t){return t.get(r)!==e.offsetHeight?(t.set(r,Math.max(e.offsetHeight,m)),new Map(t)):t}))}},style:{position:"absolute",top:he(t+n),minHeight:m,minWidth:"100%",left:0}})})},[Q,Z,V,m,ae,X,me,pe,he,ge,ee]),ye=y(function(e){e&&(e.addEventListener("scroll",di(function(e){le(e.target.scrollTop)},50)),se(e.offsetHeight),W.unsubscribeAll(),W.subscribe(function(t){e.scrollLeft!==t&&e.scrollTo(Math.min(t,e.scrollWidth),e.scrollTop)}),z.unsubscribeAll(),z.subscribe(function(t){e.scrollLeft!==t&&e.scrollTo(Math.min(t,e.scrollWidth),e.scrollTop)}),oe(e),fe.observe(e))},[]);return w(function(){return function(){fe.disconnect(),W.unsubscribeAll(),z.unsubscribeAll()}},[]),w(function(){ee(!0)},[]),E(function(){return function(){B.current=!1}},[]),f.createElement(j,a({className:Eo(i,_.root,fi,(o={},o[_.hideScrollbar]=!s,o)),sx:a({width:"100%"},c)},F,{ref:ye}),be,f.createElement("div",{className:_.adjust,style:{top:ve}}))};vi.virtualize=function(e){return x(function(t,n){var r=t,o=r.className,i=r.style,c=l(r,["className","style"]);return f.createElement("div",{className:o,style:i,ref:n},f.createElement(e,a({},c)))})};var gi,bi=function(t){var n=void 0===t?{}:t,r=n.defaultSize,o=void 0===r?{height:0,width:0}:r,i=o.height,l=o.width,c=n.target,u=void 0===c?null:c,s=n.map,d=n.closest,f=n.selector,m=n.debounce,p=void 0===m?0:m,h=n.compute,v=void 0===h?function(e){return e}:h,y=n.onResize,w=b(null),x=b(!0);E(function(){return function(){x.current=!1}},[]);var C=e(g({height:i,width:l}),2),k=C[0],S=C[1],L=zr(k);return E(function(){var e=w.current,t=u||e;if(t&&(d&&(t=(null==t?void 0:t.closest(d))||null),f&&(t=(null==t?void 0:t.querySelector(f))||null),s&&(t=t?s(t):t),t)){var n=Jn(function(e){var t=a({},v(e));t.height=Math.floor(t.height),t.width=Math.floor(t.width);var n=L.current;n.height===t.height&&n.width===t.width||(x.current&&S(t),y&&y(t))},p),r=new ResizeObserver(function(){var e=t.getBoundingClientRect(),r=e.height,o=e.width;n({height:r,width:o})}),o=a({},v(a({},t.getBoundingClientRect())));o.height=Math.floor(o.height),o.width=Math.floor(o.width),S(o),r.observe(t);var i=function(){var e=t.getBoundingClientRect(),r=e.height,o=e.width;n({height:r,width:o})};return window.visualViewport&&window.visualViewport.addEventListener("resize",i),function(){window.visualViewport&&window.visualViewport.removeEventListener("resize",i),r.disconnect(),n.clear()}}},[w.current,u,d,f]),{elementRef:w,size:k}},yi=An()({listBox:{overflow:"hidden !important"}}),wi=x(function(e,t){var n=e.className,r=e.children,o=e.role,i=l(e,["className","children","role"]),c=yi().classes,u=bi(),s=u.elementRef,d=u.size,m=Array.isArray(r)?r.length:0;return f.createElement("div",{ref:t},f.createElement("div",a({},i,{ref:s,className:Eo(c.listBox,n)}),f.createElement(vi,{role:o,sx:{width:d.width,height:"min(".concat(m?Math.min(54*m,300):54,"px, 45vh)"),maxHeight:"45vh"},minRowHeight:54},r)))}),Ei=An()(function(e){return{root:{position:"absolute",top:0,left:0,right:0,bottom:0,height:"100%",width:"100%",background:e.palette.background.paper,display:"flex",alignItems:"center",justifyContent:"center",zIndex:999},hidden:{display:"none !important"}}}),xi=function(e){var t,n=e.open,r=Ei().classes;return f.createElement(j,{className:Eo(r.root,(t={},t[r.hidden]=!n,t))},f.createElement(O,null))},Ci=An()({root:{position:"relative",minHeight:"50px",width:"100%",overflowY:"auto",overflowX:"hidden"},hideScrollbar:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},container:{position:"absolute",top:0,left:0,right:0,width:"100%",display:"flex",flexDirection:"column",alignItems:"stretch"}}),ki=function(r){var o,i=r.withScrollbar,c=void 0!==i&&i,u=r.className,s=r.style,d=r.sx,m=r.loading,p=void 0!==m&&m,v=r.throwError,x=void 0!==v&&v,C=r.hasMore,k=void 0===C||C,S=r.children,L=r.scrollXSubject,N=r.scrollYSubject,I=r.onDataRequest,M=r.onLoadStart,R=r.onLoadEnd,P=r.fallback,A=l(r,["withScrollbar","className","style","sx","loading","throwError","hasMore","children","scrollXSubject","scrollYSubject","onDataRequest","onLoadStart","onLoadEnd","fallback"]),T=Ci().classes,D=Fr(L),O=Fr(N),F=e(g(0),2),_=F[0],B=F[1],H=b(),W=b(!0),z=b(!1),V=h(function(){return z.current=!0,S},[S]);E(function(){return function(){W.current=!1}},[]);var Y=!!_||p,U=zr(Y),q=zr(k),$=to(function(e){return t(void 0,void 0,void 0,function(){var t,r;return n(this,function(n){switch(n.label){case 0:if(Y)return[2];t=!0,n.label=1;case 1:return n.trys.push([1,5,6,7]),M&&M(),W.current&&B(function(e){return e+1}),I?[4,qn(0)]:[3,4];case 2:return n.sent(),[4,I(e)];case 3:n.sent(),n.label=4;case 4:return[3,7];case 5:if(r=n.sent(),t=!1,x)throw r;return P&&P(r),[3,7];case 6:return R&&R(t),W.current&&B(function(e){return e-1}),[7];case 7:return[2]}})})}),X=y(function(t){Y||(H.current&&H.current.disconnect(),H.current=new IntersectionObserver(function(t){var n=e(t,1)[0],r=!0;r=(r=r&&q.current)&&!U.current,(null==n?void 0:n.isIntersecting)&&r&&!z.current&&$(!1),z.current=!1}),t&&H.current.observe(t))},[k,Y,I]);w(function(){$(!0)},[]),w(function(){return function(){H.current&&H.current.disconnect(),D.unsubscribeAll(),O.unsubscribeAll()}},[]);var G=y(function(e){e&&(D.unsubscribeAll(),D.subscribe(function(t){e.scrollLeft!==t&&e.scrollTo(Math.min(t,e.scrollWidth),e.scrollTop)}),O.unsubscribeAll(),O.subscribe(function(t){e.scrollLeft!==t&&e.scrollTo(Math.min(t,e.scrollWidth),e.scrollTop)}))},[]);return f.createElement(j,a({},A,{className:Eo(u,T.root,(o={},o[T.hideScrollbar]=!c,o)),style:s,sx:d,ref:G}),f.createElement(j,{className:T.container},V,f.createElement("div",{style:{height:1},ref:X})))};!function(e){e.Single="single-selection",e.Multiple="multiple-selection",e.None="none-selection"}(gi||(gi={}));var Si=gi,Li=function(r){void 0===r&&(r=750);var o=e(Dr(!1),2),i=o[0],a=o[1],l=h(function(){return eo(function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,qn(r)];case 1:return e.sent(),a(!1),[2]}})})})},[]),c=y(function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return a(!0),[4,l()];case 1:return e.sent(),[2]}})})},[]);return{delay$:i,doDelay:c}},Ni=p(null),Ii=function(){return v(Ni)},Mi=function(t){var n=t.children,o=t.selectedRows,i=t.onSelectedRows,a=e(g(new Set(o)),2),l=a[0],c=a[1],u=Li(),s=u.delay$,d=u.doDelay,f=function(t,n){void 0===n&&(n=!1),d(),i&&i(r([],e(t),!1),n),c(new Set(t))},p={selection:l,setSelection:f};return w(function(){if(o&&!s.current){var e=new Set(o);(function(e,t){if(e.size!==t.size)return!1;var n=!0;return e.forEach(function(e){!t.has(e)&&n&&(n=!1)}),t.forEach(function(t){!e.has(t)&&n&&(n=!1)}),n})(e,l)||f(e)}},[o]),m.createElement(Ni.Provider,{value:p},n)},Ri=An()(function(e){return{root:{position:"relative",display:"flex",alignItems:"stretch",justifyContent:"stretch"},container:{flex:1,display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column","& > *":{flex:1}},header:{display:"flex",flexDirection:"row",gap:e.spacing(1),alignItems:"center",width:"100%",height:"35px",maxHeight:"35px",borderBottom:"1px solid ".concat($(e.palette.getContrastText(e.palette.background.default),.23)),scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},headerLabel:{opacity:.65}}}),Pi=function(e){var t,n=e.className,r=e.style,o=e.sx,i=e.selectionMode,a=void 0===i?Si.None:i,l=e.headerLabel,c=void 0===l?"List":l,u=e.data,s=e.withHeader,d=void 0!==s&&s,f=e.children,p=Ri().classes,h=Ii(),v=h.selection,g=h.setSelection;return m.createElement(j,{className:Eo(n,p.root),style:r,sx:o},m.createElement("div",{className:p.container},d?m.createElement("div",{className:p.header},(t=function(){a!==Si.None&&(a!==Si.Single?v.size?g(new Set):(u.forEach(function(e){var t=e.id;return v.add(t)}),g(v)):g(new Set))},a===Si.Single?m.createElement(Ce,{onClick:t,color:"primary"}):a===Si.Multiple?m.createElement(ve,{checked:!!v.size,onClick:t,color:"primary"}):a===Si.None?m.createElement(ve,{color:"primary",onClick:t,disabled:!0}):null),!!c&&m.createElement(X,{variant:"body1",className:p.headerLabel},c)):null,f))},Ai=function(r,o){var i=void 0===o?{}:o,a=i.onLoadStart,l=i.onLoadEnd,c=i.fallback,u=i.throwError,s=b(null),d=e(g(!1),2),f=d[0],m=d[1],p=e(g(!1),2),h=p[0],v=p[1],w=b(!0);E(function(){return function(){w.current=!1}},[]);var x=to(r),C=y(function(e){return t(void 0,void 0,void 0,function(){var r,o,i,d;return n(this,function(f){switch(f.label){case 0:s.current&&s.current.cancel(),r=Xn(function(){return t(void 0,void 0,void 0,function(){var t,r,o;return n(this,function(n){switch(n.label){case 0:t=!0,a&&a(),n.label=1;case 1:return n.trys.push([1,5,6,7]),(r=x(e))instanceof Promise?[4,r]:[3,3];case 2:return[2,n.sent()||null];case 3:return[2,r||null];case 4:return[3,7];case 5:throw o=n.sent(),t=!1,o;case 6:return l&&l(t),[7];case 7:return[2]}})})}),s.current=r,w.current&&m(!0),w.current&&v(!1),o=!1,f.label=1;case 1:return f.trys.push([1,3,4,5]),[4,r()];case 2:return(i=f.sent())===$n?(o=!0,[2,null]):(s.current=null,[2,i]);case 3:if(d=f.sent(),w.current&&v(!0),u)throw d;return c&&c(d),[3,5];case 4:return o||w.current&&m(!1),[7];case 5:return[2,null]}})})},[]);return{loading:f,error:h,execute:C}};function Ti(e,t,n){var r=this,o=b(null),i=b(0),a=b(null),l=b([]),c=b(),u=b(),s=b(e),d=b(!0);s.current=e;var f=!t&&0!==t&&"undefined"!=typeof window;if("function"!=typeof e)throw new TypeError("Expected a function");t=+t||0;var m=!!(n=n||{}).leading,p=!("trailing"in n)||!!n.trailing,v="maxWait"in n,g=v?Math.max(+n.maxWait||0,t):null,E=y(function(e){var t=l.current,n=c.current;return l.current=c.current=null,i.current=e,u.current=s.current.apply(n,t)},[]),x=y(function(e,t){f&&cancelAnimationFrame(a.current),a.current=f?requestAnimationFrame(e):setTimeout(e,t)},[f]),C=y(function(e){if(!d.current)return!1;var n=e-o.current,r=e-i.current;return!o.current||n>=t||n<0||v&&r>=g},[g,v,t]),k=y(function(e){return a.current=null,p&&l.current?E(e):(l.current=c.current=null,u.current)},[E,p]),S=y(function(){if(d.current){var e=Date.now();if(C(e))return k(e);var n=e-o.current,r=e-i.current,a=t-n,l=v?Math.min(a,g-r):a;x(S,l)}},[g,v,C,x,k,t]),L=y(function(){a.current&&(f?cancelAnimationFrame(a.current):clearTimeout(a.current)),i.current=0,l.current=o.current=c.current=a.current=null},[f]),N=y(function(){return a.current?k(Date.now()):u.current},[k]);w(function(){return d.current=!0,function(){d.current=!1}},[]);var I=y(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(!d.current)return u.current;var s=Date.now(),f=C(s);if(l.current=e,c.current=r,o.current=s,f){if(!a.current&&d.current)return i.current=o.current,x(S,t),m?E(o.current):u.current;if(v)return x(S,t),E(o.current)}return a.current||x(S,t),u.current},[E,m,v,C,x,S,t]),M=y(function(){return!!a.current},[]);return h(function(){return{callback:I,cancel:L,flush:N,pending:M}},[I,L,N,M])}function Di(e,t){return e===t}function ji(t,n,r){var o=r&&r.equalityFn||Di,i=e(g(t),2),a=i[0],l=i[1],c=Ti(y(function(e){return l(e)},[]),n,r),u=b(t);return w(function(){o(u.current,t)||(c.callback(t),u.current=t)},[t,c,o]),[a,{cancel:c.cancel,pending:c.pending,flush:c.flush}]}var Oi,Fi=function(t){var n=e(ji(t,800),1)[0],r=b(t),o=Fr(),i=b(!0);return w(function(){i.current?i.current=!1:zn(n,r.current)||(r.current=n,o.next(n))},[n]),o},_i=Symbol("get-value-map"),Bi=function(t,n){var o=new Map,i=function(){for(var i,a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];var c=t(a),u=null===(i=o.get(c))||void 0===i?void 0:i.current;if(void 0===u){var s={current:void 0};o.set(c,s),u=s.current=n.apply(void 0,r([],e(a),!1))}return u};return i[_i]=function(){return o},i.clear=function(e){e?o.delete(e):o.clear()},i.add=function(e,t){var n=o.get(e);void 0===n?n={current:t}:n.current=t,o.set(e,n)},i.remove=function(e){return o.delete(e)},i},Hi=new ar,Wi=p(null),zi=function(t){var n=t.children,r=t.rowKey,o=void 0===r?"id":r,i=t.recomputeSubject,a=t.rowMark,l=void 0===a?function(){return""}:a,c=t.rowColor,u=void 0===c?function(){return""}:c,s=Fr(i),d=h(function(){return Bi(function(t){var n=e(t,1)[0];return n[o]||n},l)},[]),f=h(function(){return Bi(function(t){var n=e(t,1)[0];return n[o]||n},u)},[]);w(function(){return s.subscribe(function(){d.clear(),f.clear(),Hi.next()})},[]),w(function(){return function(){d.clear(),f.clear()}},[]);var p=h(function(){return{rowMark:d,rowColor:f}},[]);return m.createElement(Wi.Provider,{value:p},n)},Vi=x(function(r,o){var i=r.className,l=r.style,c=r.index,u=r.data,s=r.sx,d=r.payload,m=r.rowKey,p=r.selectionMode,b=r.children,E=r.onItemClick,x=zr(u),C=Fi(u),k=y(function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,Promise.race([C.toPromise(),qn(7500)])];case 1:return e.sent(),[2]}})})},[]),S=e(g(""),2),L=S[0],N=S[1],I=e(g(""),2),M=I[0],R=I[1],P=Ii(),A=P.selection,T=P.setSelection,D=v(Wi),j=D.rowMark,O=D.rowColor,F=Ai(function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:return e=N,[4,j(x.current)];case 1:return e.apply(void 0,[n.sent()]),t=R,[4,O(x.current)];case 2:return t.apply(void 0,[n.sent()]),[2]}})})}).execute;w(function(){return F(),function(){j.clear(u[m]||u)}},[]),w(function(){return Hi.subscribe(function(){k().then(F)})},[]);var _=y(function(){var e=u[m];e&&p!==Si.None&&(p===Si.Single?A.has(e)&&1===A.size?A.delete(e):(A.clear(),A.add(e)):A.has(e)?A.delete(e):A.add(e),T(new Set(A)))},[A]),B=h(function(){return A.has(u[m])},[A]);return f.createElement(Me,{ref:o,disableRipple:!0,className:i,style:l,sx:a({background:M,"&:hover":{background:M||"transparent"}},s),selected:B,onClick:function(){return E&&E({data:u,payload:d,toggleSelection:_,isSelected:B})}},f.createElement(b,{toggleSelection:_,data:u,payload:d,index:c,rowMark:L,isSelected:B}))});!function(e){e.Virtual="virtual",e.Intersection="intersection"}(Oi||(Oi={}));var Yi,Ui=Oi,qi=An()({noData:{display:"flex",justifyContent:"center",alignItems:"center",padding:"12px"}}),$i=function(e){var t,n=e.className,r=e.style,o=e.sx,i=e.itemSx,a=e.data,l=e.loading,c=e.hasMore,u=e.mode,s=void 0===u?Ui.Virtual:u,d=e.bufferSize,m=void 0===d?25:d,p=e.minRowHeight,h=void 0===p?72:p,v=e.payload,g=void 0===v?{}:v,b=e.rowKey,y=void 0===b?"id":b,w=e.noDataLabel,E=void 0===w?"No data":w,x=e.errorMessage,C=e.children,k=e.onSkip,L=e.onButtonSkip,N=e.onItemClick,I=e.onSelectedRows,M=e.selectedRows,R=e.selectionMode,P=e.recomputeSubject,A=e.scrollXSubject,T=e.scrollYSubject,D=e.withHeader,O=e.headerLabel,F=e.rowMark,B=void 0===F?function(){return""}:F,H=e.rowColor,W=void 0===H?function(){return""}:H,z=qi().classes,V=Or(g);return f.createElement(Mi,{onSelectedRows:I,selectedRows:M},f.createElement(zi,{recomputeSubject:P,rowKey:y,rowMark:B,rowColor:W},f.createElement(Pi,{className:n,style:r,sx:o,data:a,selectionMode:R,withHeader:D,headerLabel:O},S(s===Ui.Virtual?vi:ki,{withScrollbar:!0,component:Ie,scrollYSubject:T,scrollXSubject:A,minRowHeight:h,bufferSize:m,loading:l,hasMore:c,onDataRequest:function(e){k&&c&&k(e)},children:(t=[],l||x||0!==a.length||t.push(f.createElement(j,{className:z.noData},f.createElement(_,{variant:"body1"},E))),x&&t.push(f.createElement(j,{className:z.noData},f.createElement(_,{color:"error",variant:"body1"},x))),a.forEach(function(e,n){return t.push(f.createElement(Vi,{key:e[y]||n,sx:i,index:n,payload:V,data:e,rowKey:y,selectionMode:R,onItemClick:N},C))}),a.length>0&&!x&&L&&!k&&!l&&c&&t.push(f.createElement(j,{className:z.noData},f.createElement(ye,{variant:"outlined",onClick:L},"Show More"))),t)}))))},Xi=function(e){var t=e.isSelected,n=e.selectionMode,r=void 0===n?Si.None:n,o=e.toggleSelection,i=e.disabled;return r===Si.Single?f.createElement(Ce,{color:"primary",onClick:function(e){e.stopPropagation(),o()},checked:t,disabled:i}):r===Si.Multiple?f.createElement(ve,{color:"primary",onClick:function(e){e.stopPropagation(),o()},checked:t,disabled:i}):f.createElement(ve,{color:"primary",disabled:!0})},Gi=p(null),Ki=function(){return v(Gi)},Qi=function(e){var t=e.children,n=e.constraintManager;return f.createElement(Gi.Provider,{value:n},t)},Ji=p(null),Zi=function(){return v(Ji)},ea=function(e){var t=e.children,n=e.size;return f.createElement(Ji.Provider,{value:n},t)},ta="react-declatative__PaperView-root",na=An()(function(e){return{outline:{border:"1px solid ".concat($(e.palette.getContrastText(e.palette.background.default),.23)),background:e.palette.background.paper,borderRadius:"4px"}}}),ra=x(function(e,t){var n=e.component,r=e.className,o=e.outlinePaper,i=e.transparentPaper,c=l(e,["component","className","outlinePaper","transparentPaper"]),u=na().classes;return i?f.createElement(j,a({className:Eo(r,ta)},c,{ref:t})):o?f.createElement(j,a({className:Eo(r,u.outline,ta)},c,{component:n,ref:t})):f.createElement(ke,a({className:Eo(r,ta)},c,{component:n,ref:t}))}),oa=An()(function(e){return{root:{width:"100%",overflow:"hidden",display:"flex",alignItems:"stretch",justifyContent:"stretch",background:"light"===e.palette.mode?e.palette.background.paper:$("#000",.05)},container:{display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column",flex:1},content:{display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column",flex:1},header:{minHeight:"35px",width:"100%",display:"flex",alignItems:"center",background:"light"===e.palette.mode?$("#000",.05):e.palette.background.paper}}}),ia=function(t){var n=t.outlinePaper,r=t.transparentPaper,o=t.className,i=t.style,a=t.sx,l=t.header,c=t.children,u=oa().classes,s=Ki(),d=h(function(){return function(){var e=document.createElement("div");e.style.position="fixed",e.style.left="-100%",e.style.visibility="hidden",e.style.overflow="scroll",document.body.appendChild(e);var t=document.createElement("div");e.appendChild(t);var n=e.offsetWidth-t.offsetWidth;return document.body.removeChild(e),n}()},[]),m=h(function(){return function(){var e=document.createElement("div");e.style.position="fixed",e.style.left="-100%",e.style.visibility="hidden",e.style.overflow="scroll",document.body.appendChild(e);var t=document.createElement("div");e.appendChild(t);var n=e.offsetHeight-t.offsetHeight;return document.body.removeChild(e),n}()},[]),p=e(g({height:0,width:0}),2),v=p[0],b=p[1],E=Or(function(){return new ResizeObserver(function(t){var n=e(t,1)[0].target;n&&(s.clear(),b({height:Math.max(n.offsetHeight-m,0),width:Math.max(n.offsetWidth-d,0)}))})}),x=y(function(e){e&&(b({height:Math.max(e.offsetHeight-m,0),width:Math.max(e.offsetWidth-d,0)}),E.observe(e))},[E,d,m]);return w(function(){return function(){E.disconnect()}},[E]),f.createElement(ea,{size:v},f.createElement(ra,{outlinePaper:n,transparentPaper:r,className:Eo(o,u.root),style:i,sx:a},f.createElement("div",{className:u.container},!!l&&f.createElement("div",{className:u.header},l),f.createElement("div",{className:u.content,ref:x},c))))},aa=p(null),la=function(){return v(aa)},ca=function(e){var t=e.children,n=e.value;return f.createElement(aa.Provider,{value:n},t)},ua=125,sa=75,da=function(e){var t=e.className,n=e.style,r=e.sx,o=e.column,i=e.idx,c=e.children,u=l(e,["className","style","sx","column","idx","children"]),s=Ki(),d=Zi().width,m=la(),p=m.rowActions,v=m.selectionMode,g=void 0===v?Si.None:v,b=h(function(){return Math.max(d-(p?ua:0)-(g===Si.None?0:sa),0)},[d,p]),y=h(function(){return s.memoize("column-width-".concat(b,"-").concat(i),function(){var e=o.width||165,t="function"==typeof e?e(b):e;return"number"==typeof t?"".concat(t,"px"):t})},[o.width,b,i,s]);return f.createElement(j,a({className:t,style:n,sx:a(a({},r),{position:"relative",overflow:"hidden",minWidth:y,maxWidth:y})},u),c)},fa=function(e){var t=e.className,n=e.style,r=e.sx,o=e.children;return f.createElement(j,{className:t,style:n,sx:a(a({},r),{display:"flex",justifyContent:"center !important",alignItems:"center !important"})},o)},ma=p(null),pa=function(){return v(ma)},ha=function(t){var n=t.children,o=la(),i=o.selectedRows,a=o.onSelectedRows,l=e(g(new Set(i)),2),c=l[0],u=l[1],s=Li(),d=s.delay$,f=s.doDelay,p=function(t,n){void 0===n&&(n=!1),f(),a&&a(r([],e(t),!1),n),u(new Set(t))},h={selection:c,setSelection:p};return w(function(){if(i&&!d.current){var e=new Set(i);(function(e,t){if(e.size!==t.size)return!1;var n=!0;return e.forEach(function(e){!t.has(e)&&n&&(n=!1)}),t.forEach(function(t){!e.has(t)&&n&&(n=!1)}),n})(e,c)||p(e)}},[i]),m.createElement(ma.Provider,{value:h},n)},va=Gr(),ga=Gr(),ba=An()(function(e){return{root:{position:"relative",overflowX:"auto",overflowY:"hidden",width:"100%",height:"35px",borderBottom:"1px solid ".concat($(e.palette.getContrastText(e.palette.background.default),.23)),scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},container:{position:"absolute",top:0,left:0,bottom:0,height:"100%",minWidth:"100%",display:"flex",alignItems:"stretch",justifyContent:"stretch"},headerCell:{display:"flex",userSelect:"none",flexDirection:"column",justifyContent:"center",paddingLeft:"5px",paddingRight:"5px",paddingTop:"7.5px",paddingBottom:"7.5px",width:"100%",whiteSpace:"break-spaces",overflowWrap:"anywhere",textOverflow:"ellipsis",overflow:"hidden",fontWeight:"bold"},headerCellOpacity:{opacity:.7},headerCellClick:{"&:hover":{backgroundColor:"#f9f9f9",cursor:"pointer"}},coloredHeaderCell:{background:$(e.palette.background.paper,.2)},headerCellSortable:{display:"flex",justifyContent:"space-between",width:"100%","&>*:nth-of-type(n+1)":{marginLeft:e.spacing(1)}},noWrap:{whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"}}}),ya=function(e){var t=e.className,n=e.style,r=e.sx,o=e.columns,i=e.sort,a=e.rowActions,l=e.scrollXSubject,c=e.onClickHeaderColumn,u=e.onScrollX,s=ba().classes,d=la(),m=d.data,p=d.selectionMode,h=void 0===p?Si.None:p,v=pa(),g=v.selection,b=v.setSelection,w=zr(m),E=zr(g),x=y(function(e){e&&l.subscribe(function(t){e.scrollLeft!==t&&e.scrollTo(Math.min(t,e.scrollWidth),e.scrollTop)})},[l]),C=y(function(){var e=w.current,t=E.current,n=function(){h!==Si.None&&(h!==Si.Single?t.size?b(new Set):(e.forEach(function(e){var n=e.id;return t.add(n)}),b(t)):b(new Set))};return h===Si.Single?f.createElement(Ce,{onClick:n,color:"primary"}):h===Si.Multiple?f.createElement(ve,{checked:!!t.size,onClick:n,color:"primary"}):h===Si.None?f.createElement(ve,{color:"primary",onClick:n,disabled:!0}):null},[]);return f.createElement(j,{ref:x,className:Eo(t,s.root),style:n,sx:r,onScroll:function(e){var t=e.target;u&&u(t.scrollLeft)}},f.createElement(j,{className:s.container},h!==Si.None&&f.createElement(fa,{className:s.headerCell,key:ga,sx:{minWidth:sa,maxWidth:sa}},C()),o.map(function(e,t){var n,r,o="".concat(String(e.field),"-").concat(t);return f.createElement(da,{key:o,className:Eo(s.headerCell,s.headerCellOpacity,(n={},n[s.headerCellClick]=Boolean(c),n[s.coloredHeaderCell]=i&&i.value===e.field,n)),column:e,idx:t,onClick:function(){c&&c(e.field)}},f.createElement("div",{className:Eo(s.noWrap,(r={},r[s.headerCellSortable]=Boolean(i),r))},e.label,i&&i.value===e.field?"ASC"===(null==i?void 0:i.sortDirection)?f.createElement(Re,null):f.createElement(Pe,null):null))}),!!(null==a?void 0:a.length)&&f.createElement(fa,{className:Eo(s.headerCell,s.headerCellOpacity),key:va,sx:{minWidth:ua,maxWidth:ua}},"Actions")))},wa=x(function(e,t){var n=e.className,r=e.style,o=e.sx,i=e.columns,l=e.children,c=e.withRowActions,u=Ki(),s=Zi().width,d=h(function(){return Math.max(s-(c?ua:0),0)},[s,c]),m=h(function(){var e=i.map(function(e,t){return parseFloat(u.memoize("column-width-".concat(d,"-").concat(t),function(e){return function(){var t=e.width||165,n="function"==typeof t?t(d):t;return"string"==typeof n?parseFloat(n):n}}(e)))}).reduce(function(e,t){return e+t},0);return c&&(e+=ua),"".concat(e+=sa,"px !important")},[i,d,c,u]);return f.createElement(j,{ref:t,className:Eo(n,mi),style:r,sx:a(a({},o),{minWidth:m,maxWidth:m})},l)}),Ea=An()({root:{zIndex:"unset !important"},container:{position:"relative",display:"flex",alignItems:"stretch",justifyContent:"stretch",overflowY:"auto",overflowX:"hidden",maxHeight:"45vh"},content:{flex:1,display:"flex",flexDirection:"column",justifyContent:"stretch"},loader:{position:"absolute",top:0,left:0,right:0,bottom:0,height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center"},beforeContent:{width:"100%",display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *":{flex:1}},afterContent:{width:"100%",display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *":{flex:1}}}),xa=function(r){var o=r.options,i=void 0===o?[]:o,l=r.transparent,c=void 0!==l&&l,u=r.disabled,s=void 0!==u&&u,d=r.throwError,m=void 0!==d&&d,p=r.fallback,h=r.onToggle,v=r.onAction,y=void 0===v?function(){return null}:v,w=r.payload,E=r.className,x=r.style,C=r.sx,k=r.deps,S=r.onLoadStart,L=r.onLoadEnd,N=r.keepMounted,I=r.BeforeContent,M=r.AfterContent,R=r.reloadSubject,P=b(null),A=e(g(null),2),T=A[0],D=A[1],H=e(g(0),2),z=H[0],V=H[1],Y=Ea().classes,U=to(y),q=function(){V(function(e){return e+1}),S&&S()},X=function(e){V(function(e){return Math.max(e-1,0)}),L&&L(e)},K=Ai(U,{onLoadStart:q,onLoadEnd:X,throwError:m,fallback:p}).execute;return f.createElement(f.Fragment,null,f.createElement(Te,{ref:P,className:Eo(E,Y.root),style:x,sx:a(a({},c?{boxShadow:"none !important",background:"transparent !important",color:function(e){return"".concat($(e.palette.getContrastText(e.palette.background.default),.4)," !important")}}:void 0),C),disableFocusRipple:c,disableRipple:c,disabled:s||!!z,size:"small",color:"primary","aria-label":"more","aria-haspopup":"true",onClick:function(e){e.preventDefault(),e.stopPropagation(),D(P.current),h&&h(!0)}},f.createElement(Ae,{color:"inherit"})),f.createElement(W,{keepMounted:N,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},anchorEl:s?null:T,open:!!T&&!s,onClose:function(e){e.preventDefault(),e.stopPropagation(),D(null),V(0),h&&h(!1)},MenuListProps:{disablePadding:!0,sx:{pt:I?0:1,pb:M?0:1}}},f.createElement(j,{className:Y.container},0!==z&&f.createElement(j,{className:Y.loader},f.createElement(O,null)),f.createElement(j,{className:Y.content,sx:{visibility:0!==z?"hidden":"visible"}},I&&f.createElement(j,{className:Y.beforeContent},f.createElement(I,null)),i.map(function(e,r){var o=e.label,i=void 0===o?"unknown-label":o,a=e.action,l=void 0===a?"unknown-action":a,c=e.divider,u=e.icon,s=e.isDisabled,d=void 0===s?function(){return!1}:s,v=e.isVisible,g=void 0===v?function(){return!0}:v;return f.createElement(Jr,{Loader:function(){return c?null:f.createElement(B,{sx:{visibility:"hidden",minWidth:225}},!!u&&f.createElement(F,null,f.createElement(u,null)),f.createElement(_,{variant:"inherit"},i))},throwError:m,fallback:p,key:r,onLoadStart:q,onLoadEnd:X,reloadSubject:R,deps:k,payload:w},function(e){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return[4,qn(250)];case 1:return n.sent(),[4,d(e)];case 2:return t=n.sent(),[4,g(e)];case 3:return n.sent()?c?[2,f.createElement(G,{orientation:"horizontal"})]:[2,f.createElement(B,{disabled:t,onClick:(r=l,function(e){e.preventDefault(),e.stopPropagation(),K(r),D(null),h&&h(!1)}),sx:{minWidth:225}},!!u&&f.createElement(F,null,f.createElement(u,null)),f.createElement(_,{variant:"inherit"},i))]:[2,null]}var r})})})}),M&&f.createElement(j,{className:Y.afterContent},f.createElement(M,null))))))},Ca=new ar,ka=Gr(),Sa=Gr(),La=An()(function(e){return{wrapper:{display:"flex",alignItems:"stretch",justifyContent:"stretch"},contentRow:{flex:1,position:"relative",display:"flex",alignItems:"stretch",justifyContent:"stretch",overflow:"hidden",minHeight:"50px",borderBottom:"1px solid ".concat($(e.palette.getContrastText(e.palette.background.default),.23)),"&:hover":{background:$(e.palette.background.paper,.2)}},contentCell:{display:"flex",flexDirection:"column",justifyContent:"center",paddingLeft:"5px",paddingRight:"5px",paddingTop:"7.5px",paddingBottom:"7.5px",width:"100%",whiteSpace:"break-spaces",overflowWrap:"anywhere",textOverflow:"ellipsis",overflow:"hidden"},alignLeft:{alignItems:"flex-start"},alignRight:{alignItems:"flex-end"},alignCenter:{alignItems:"center"},alignStretch:{alignItems:"stretch","& > *:nth-of-type(1)":{flex:1}},rowOnClick:{"&:hover":{cursor:"pointer"}},mark:{position:"absolute",top:0,left:0,bottom:0,width:4},noPadding:{padding:0}}}),Na=x(function(r,o){var i=r.className,c=r.style,u=r.sx,s=r.rowKey,d=void 0===s?"id":s,m=r.columns,p=r.rowActions,h=r.payload,v=r.row,b=r.onTableRowClick,E=r.onRowAction,x=r.rowMark,C=r.rowColor,k=La().classes,S=e(g(""),2),L=S[0],N=S[1],I=e(g(""),2),M=I[0],R=I[1],P=la().selectionMode,A=void 0===P?Si.None:P,T=pa(),D=T.selection,O=T.setSelection,F=zr(v),_=Fi(v),B=y(function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,Promise.race([_.toPromise(),qn(7500)])];case 1:return e.sent(),[2]}})})},[]),H=Ai(function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:return e=N,[4,x(F.current)];case 1:return e.apply(void 0,[n.sent()]),t=R,[4,C(F.current)];case 2:return t.apply(void 0,[n.sent()]),[2]}})})}).execute;w(function(){return H(),function(){x.clear(v[d]||v),C.clear(v[d]||v)}},[]),w(function(){return Ca.subscribe(function(){B().then(H)})},[]);var W=y(function(e){e.preventDefault(),e.stopPropagation();var t=v[d];t&&(A===Si.Single?D.has(t)&&1===D.size?D.delete(t):(D.clear(),D.add(t)):D.has(t)?D.delete(t):D.add(t),O(new Set(D)))},[D]),z=y(function(){return A===Si.Single?f.createElement(Ce,{color:"primary",onClick:W,checked:D.has(v.id)}):A===Si.Multiple?f.createElement(ve,{color:"primary",onClick:W,checked:D.has(v.id)}):A===Si.None?f.createElement(ve,{color:"primary",disabled:!0}):null},[D]);return f.createElement(Me,{disableGutters:!0,disableRipple:!0,selected:D.has(v[d]),ref:o,sx:{background:M},className:Eo(mi,i,k.noPadding),style:c},f.createElement(j,{className:k.contentRow,sx:u},L&&f.createElement(j,{className:k.mark,style:{background:L}}),A!==Si.None&&f.createElement(fa,{className:k.contentCell,key:Sa,sx:{minWidth:sa,maxWidth:sa}},z()),m.map(function(e,t){var n,r="".concat(Wn(v,d),"-").concat(t);return f.createElement(da,{className:Eo(k.contentCell,(n={},n[k.rowOnClick]=Boolean(b),n[k.alignLeft]="left"===e.align,n[k.alignRight]="right"===e.align,n[k.alignCenter]="center"===e.align,n[k.alignStretch]="stretch"===e.align,n)),onClick:function(e){b&&b(e,v)},key:r,column:e,idx:t},e.format?e.format(v,h):e.field?String(Wn(v,e.field)):null)}),!!(null==p?void 0:p.length)&&f.createElement(fa,{className:k.contentCell,key:ka,sx:{minWidth:ua,maxWidth:ua}},f.createElement(xa,{transparent:!0,payload:h,options:p.map(function(e){var t=e.isDisabled,n=void 0===t?function(){return!1}:t,r=e.isVisible,o=void 0===r?function(){return!0}:r,i=l(e,["isDisabled","isVisible"]);return a({isVisible:function(e){return o(v,e)},isDisabled:function(e){return n(v,e)}},i)}),onAction:function(e){E&&E(e,v)}}))))}),Ia=An()({content:{height:"calc(100% - 35px)"},noData:{display:"flex",justifyContent:"center",alignItems:"center",padding:"12px"}}),Ma=function(t){var n=t.className,r=t.style,o=t.sx,i=t.recomputeSubject,a=t.scrollXSubject,l=t.scrollYSubject,c=t.columns,u=t.loading,s=t.data,d=t.rowKey,m=void 0===d?"id":d,p=t.hasMore,v=t.errorMessage,g=t.rowActions,b=t.payload,y=t.minRowHeight,E=void 0===y?50:y,x=t.bufferSize,C=t.onTableRowClick,k=t.onRowAction,S=t.onButtonSkip,L=t.onSkip,N=t.onScrollX,I=t.noDataLabel,M=void 0===I?"No data":I,R=t.rowMark,P=void 0===R?function(){return""}:R,A=t.rowColor,T=void 0===A?function(){return""}:A,D=Ia().classes,O=Zi().width,F=Fr(i),B=h(function(){return Bi(function(t){var n=e(t,1)[0];return n[m]||n},P)},[]),H=h(function(){return Bi(function(t){var n=e(t,1)[0];return n[m]||n},T)},[]);return w(function(){return F.subscribe(function(){B.clear(),H.clear(),Ca.next()})},[]),w(function(){return function(){B.clear(),H.clear()}},[]),f.createElement(vi,{withScrollbar:!0,className:Eo(n,D.content),style:r,sx:o,scrollXSubject:a,scrollYSubject:l,minRowHeight:E,bufferSize:x,loading:u,hasMore:p,onDataRequest:function(e){L&&p&&L(e)},onScroll:function(e){var t=e.target;N&&N(t.scrollLeft)}},!u&&!v&&0===s.length&&f.createElement(wa,{columns:c,withRowActions:!!(null==g?void 0:g.length)},f.createElement(j,{className:D.noData,sx:{position:"sticky",left:0,width:O}},f.createElement(_,{variant:"body1"},M))),v&&f.createElement(wa,{columns:c,withRowActions:!!(null==g?void 0:g.length)},f.createElement(j,{className:D.noData,sx:{position:"sticky",left:0,width:O}},f.createElement(_,{color:"error",variant:"body1"},v))),s.map(function(e,t){var n="".concat(Wn(e,m),"-").concat(t);return f.createElement(Na,{key:n,rowMark:B,rowColor:H,columns:c,row:e,recomputeSubject:F,onTableRowClick:C,onRowAction:k,rowActions:g,payload:b,rowKey:m})}),s.length>0&&!v&&S&&!L&&!u&&p&&f.createElement(wa,{columns:c,withRowActions:!!(null==g?void 0:g.length)},f.createElement(j,{className:D.noData,sx:{position:"sticky",left:0,width:O}},f.createElement(ye,{variant:"outlined",onClick:S},"Show More"))))},Ra=function(){var e=Zi().width;return f.createElement(De,{sx:{width:"".concat(e,"px"),marginLeft:"-1px",marginTop:"-4px",zIndex:10}})},Pa=function(e){var t=e.className,n=e.style,r=e.sx,o=e.outlinePaper,i=e.transparentPaper,c=e.header,u=e.columns,s=e.data,d=e.errorMessage,m=e.hasMore,p=e.loading,v=e.rowActions,g=e.payload,b=e.rowKey,y=e.sort,E=e.minRowHeight,x=e.bufferSize,C=void 0===x?25:x,k=e.onButtonSkip,S=e.onClickHeaderColumn,L=e.onRowAction,N=e.onSkip,I=e.rowMark,M=e.rowColor,R=e.onTableRowClick,P=e.onRowClick,A=e.noDataLabel,T=e.recomputeSubject,D=e.scrollXSubject,j=e.scrollYSubject,O=Or(g),F=Or(function(){return e=new Map,{memoize:function(t,n){if(!e.has(t)){var r=n();return e.set(t,r),r}return e.get(t)},clear:function(){e.clear()}};var e}),_=Fr(D),B=h(function(){return e=u.length,function(t){var n=Math.floor(t/e);return Math.max(n,165)};var e},[u]),H=h(function(){return u.map(function(e){var t=e.width,n=void 0===t?B:t,r=e.minWidth,o=void 0===r?0:r,i=l(e,["width","minWidth"]);return a({minWidth:o,width:function(e){var t="function"==typeof n?n(e):n,r="string"==typeof t?parseFloat(t):t,i="function"==typeof n?10:0;return Math.max(r-i,o)}},i)})},[u,B]);w(function(){if(T)return T.subscribe(function(){F.clear()})},[T,F]);var W=h(function(){return di(function(e){_.next(e)},5)},[_]);return w(function(){return function(){W.clear()}},[W]),f.createElement(Qi,{constraintManager:F},f.createElement(ca,{value:e},f.createElement(ha,null,f.createElement(ia,{outlinePaper:o,transparentPaper:i,className:t,header:c,style:n,sx:r},f.createElement(ya,{columns:H,sort:y,rowActions:v,onClickHeaderColumn:S,onScrollX:W,scrollXSubject:_}),!!p&&f.createElement(Ra,null),f.createElement(Ma,{recomputeSubject:T,noDataLabel:A,rowMark:I,rowColor:M,columns:H,data:s,errorMessage:d,hasMore:m,loading:p,rowActions:v,payload:O,rowKey:b,minRowHeight:E,bufferSize:C,onSkip:N,onTableRowClick:function(e,t){R?R(e,t):P&&P(t)},onRowAction:L,onButtonSkip:k,onScrollX:W,scrollXSubject:_,scrollYSubject:j})))))},Aa=function(r,o){var i=void 0===o?{}:o,a=i.onLoadStart,l=i.onLoadEnd,c=i.fallback,u=i.throwError,s=e(g(!1),2),d=s[0],f=s[1],m=e(g(!1),2),p=m[0],v=m[1],y=b(!0);E(function(){return function(){y.current=!1}},[]);var w=to(r),x=h(function(){return Gn(function(e){return t(void 0,void 0,void 0,function(){var t,r,o;return n(this,function(n){switch(n.label){case 0:t=!0,a&&a(),n.label=1;case 1:return n.trys.push([1,5,6,7]),(r=w(e))instanceof Promise?[4,r]:[3,3];case 2:return[2,n.sent()||null];case 3:return[2,r||null];case 4:return[3,7];case 5:throw o=n.sent(),t=!1,o;case 6:return l&&l(t),[7];case 7:return[2]}})})})},[]),C=h(function(){return function(e){return t(void 0,void 0,void 0,function(){var t,r;return n(this,function(n){switch(n.label){case 0:y.current&&f(!0),y.current&&v(!1),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,x(e)];case 2:return(t=n.sent())===$n?[2,null]:[2,t];case 3:if(r=n.sent(),y.current&&v(!0),u)throw r;return c&&c(r),[3,5];case 4:return y.current&&f(!1),[7];case 5:return[2,null]}})})}},[]);return Object.assign(C,{clear:function(){x.clear()},cancel:function(){x.cancel()}}),{loading:d,error:p,execute:C}},Ta=function(o){var i=o.reloadSubject,c=o.initialData,u=void 0===c?[]:c,s=o.handler,d=o.limit,f=void 0===d?25:d,m=o.delay,p=void 0===m?100:m,h=l(o,["reloadSubject","initialData","handler","limit","delay"]),v=Fr(i),g=e(Dr(u),2),b=g[0],E=g[1],x=e(Dr(function(){return{data:b.current,prevOffset:-f-b.current.length,hasMore:!0}}),2),C=x[0],k=x[1],S=to(s),L=Aa(function(e){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,S(f,C.current.prevOffset+f+b.current.length,e,C.current.data)];case 1:return[2,t.sent()]}})})}).execute,N=no(function(o){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return[4,L(o)];case 1:return(t=n.sent())?(k({prevOffset:C.current.prevOffset+f+b.current.length,data:o?t:r(r([],e(C.current.data),!1),e(t),!1),hasMore:t.length>=f}),[4,qn(p)]):[2];case 2:return n.sent(),[2]}})})},h),I=N.execute,M=N.loading,R=N.error;w(function(){return v.subscribe(function(){E([]),L.cancel(),I.clear(),k({data:[],hasMore:!0,prevOffset:-f}),I(!0)})},[]);var P=y(function(e){return k(function(t){return a(a({},t),{data:"function"==typeof e?e(t.data):e})})},[]),A=y(function(){E([]),L.cancel(),I.clear(),k({data:[],hasMore:!0,prevOffset:-f})},[]);return{data:C.current.data,setData:P,offset:C.current.prevOffset+f+b.current.length,hasMore:C.current.hasMore,loading:M,error:R,onSkip:I,reloadSubject:v,clear:A}},Da=function(o){var i=o.reloadSubject,c=o.initialData,u=void 0===c?[]:c,s=o.handler,d=o.delay,f=void 0===d?100:d,m=o.limit,p=void 0===m?25:m,v=l(o,["reloadSubject","initialData","handler","delay","limit"]),g=Fr(i),b=e(Dr(u),2),E=b[0],x=b[1],C=e(Dr(function(){return{data:E.current,hasMore:!0}}),2),k=C[0],S=C[1],L=to(s),N=Aa(function(r){return t(void 0,void 0,void 0,function(){var t,o,i;return n(this,function(n){switch(n.label){case 0:return t=e(k.current.data.slice(-1),1),o=t[0],i=(void 0===o?{}:o).id,[4,L(void 0===i?null:i,r,p,k.current.data)];case 1:return[2,n.sent()]}})})}).execute,I=no(function(o){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return N.cancel(),[4,N(o)];case 1:return(t=n.sent())?(S({data:o?t:r(r([],e(k.current.data),!1),e(t),!1),hasMore:t.length>=p}),[4,qn(f)]):[2];case 2:return n.sent(),[2]}})})},v),M=I.execute,R=I.loading,P=I.error;w(function(){return g.subscribe(function(){N.cancel(),M.clear(),x([]),S({data:[],hasMore:!0}),M(!0)})},[]);var A=h(function(){var t=e(k.current.data.slice(-1),1)[0],n=(void 0===t?{}:t).id;return void 0===n?null:n},[k.current.data]),T=y(function(e){return S(function(t){return a(a({},t),{data:"function"==typeof e?e(t.data):e})})},[]);return{data:k.current.data,setData:T,hasMore:k.current.hasMore,lastCursor:A,loading:R,error:P,onSkip:M,reloadSubject:g}},ja=function(t){var n=void 0===t?{}:t,r=n.selectedRows,o=void 0===r?[]:r,i=n.onChange,a=e(g(o),2),l=a[0],c=a[1],u=y(function(){return c([])},[]);return $r(function(){i&&i(l)},[l]),{selectedRows:l,gridProps:{selectedRows:l,onSelectedRows:function(e){return c(e)}},deselectAll:u,setSelectedRows:c}},Oa=function(e){var r=e.onLoadStart,o=e.onLoadEnd,i=e.throwError,a=e.fallback,l=e.fetchRow,c=e.onAction,u=e.onRowAction,s=e.onSelectionChange,d=e.selectedRows,f=ja({onChange:s,selectedRows:d}),m=f.deselectAll,p=f.gridProps,h=f.selectedRows,v=Ai(function(e){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return c?[4,Promise.all(h.map(l))]:[3,3];case 1:return t=n.sent(),[4,c(e,t,m)];case 2:n.sent(),n.label=3;case 3:return[2]}})})},{onLoadStart:r,onLoadEnd:o,throwError:i,fallback:a}).execute,g=Ai(function(e){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return u?[4,u(e.action,e.row,m)]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}})})},{onLoadStart:r,onLoadEnd:o,throwError:i,fallback:a}).execute;return{deselectAll:m,selectedRows:h,gridProps:p,commitAction:v,commitRowAction:function(e,t){return g({action:e,row:t})}}},Fa=p({modalStack:[],pop:function(){throw new Error("ModalManager no context provided")},push:function(){throw new Error("ModalManager no context provided")},clear:function(){throw new Error("ModalManager no context provided")}}),_a=function(t){var n=t.render,r=t.onMount,o=t.onUnmount,i=t.count,a=t.modalStack,l=e(g(!1),2),c=l[0],u=l[1];return w(function(){return r&&r(i,a),u(!0),function(){o&&o(i,a)}},[]),c?f.createElement(f.Fragment,null,n()):null},Ba={key:Gr(),id:"unknown",render:function(){return null}},Ha={modalStack:[],count:0},Wa=An()({backdrop:{color:A("#000",.5),zIndex:1300}}),za=new ar,Va=function(o){var i=o.children,c=o.fallback,u=o.throwError,s=o.onLoadEnd,d=o.onLoadStart,m=Wa().classes,p=M(),v=e(g(Ha),2),b=v[0],E=b.modalStack,x=b.count,C=v[1],k=zr(E),S=y(function(e){return C(function(t){var n=t.count;return{modalStack:e,count:0===e.length?0:n+1}})},[]),L=Aa(function(e){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return e?[4,e()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}})})},{onLoadStart:d,onLoadEnd:s,fallback:c,throwError:u}).execute,N=h(function(){return{modalStack:k.current,pop:function(){return S(k.current.slice(1))},push:function(o){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,L(o.onInit)];case 1:return t.sent(),S(r([a(a({},o),{key:Gr()})],e(k.current),!1)),[2]}})})},clear:function(){za.next()}}},[E]);w(function(){return za.subscribe(function(){C(Ha)})},[]);var I=h(function(){var t=e(E,1)[0],n=void 0===t?Ba:t,o=n.onInit,i=void 0===o?function(){}:o,c=n.onMount,u=void 0===c?function(){}:c,s=n.onUnmount,d=void 0===s?function(){}:s,f=l(n,["onInit","onMount","onUnmount"]);return a({onInit:function(){L(i)},onMount:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];L(function(){return u.apply(void 0,r([],e(t),!1))})},onUnmount:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];L(function(){return d.apply(void 0,r([],e(t),!1))})}},f)},[E]),A=h(function(){return R(a(a({},p),{components:a(a({},p.components),{MuiBackdrop:{styleOverrides:{root:{background:"transparent"}}}})}))},[p]),T=h(function(){return E.slice(1,E.length)},[E]);return f.createElement(Fa.Provider,{value:N},i,f.createElement(P,{theme:A},f.createElement(_a,a({},I,{modalStack:T,count:x}))),!!E.length&&f.createElement(je,{open:!0,className:m.backdrop}))},Ya=function(){var e=v(Fa);return{total:e.modalStack.length,push:e.push,pop:e.pop,clear:e.clear}},Ua=function(e){var t=e.data.label,n=e.isSelected;return f.createElement(f.Fragment,null,f.createElement(F,null,f.createElement(ve,{edge:"start",checked:n,tabIndex:-1,disableRipple:!0})),f.createElement(Oe,{primary:t}))},qa=function(e){var t=e.data.label,n=e.isSelected;return f.createElement(f.Fragment,null,f.createElement(F,null,f.createElement(Ce,{edge:"start",checked:n,tabIndex:-1,disableRipple:!0})),f.createElement(Oe,{primary:t}))},$a=function(e){var t=e.data.label;return f.createElement(Oe,{primary:t})},Xa=function(e,t){for(var n,r,o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];var a=String(t||"").toLowerCase().split(" "),l=function(t){var n=String(e[t]||"").toLowerCase().split(" ");return a.every(function(e){return n.some(function(t){return t.includes(e)})})},u=!1;try{for(var s=c(o),d=s.next();!d.done;d=s.next()){var f=d.value;u=u||l(f)}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return u},Ga=function(e){return t(void 0,[e],void 0,function(e){var r,o,i=e.data,a=e.payload,l=e.itemList,c=e.tr,u=void 0===c?function(e){return e}:c;return n(this,function(e){switch(e.label){case 0:return"function"!=typeof l?[3,2]:[4,l(i,a)];case 1:return o=e.sent(),[3,3];case 2:o=l,e.label=3;case 3:return r=o,[4,Promise.all(r.map(function(e){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return t={id:e},[4,u(e,i,a)];case 1:return[2,(t.label=n.sent(),t)]}})})}))];case 4:return[2,e.sent()]}})})},Ka=function(e){return t(void 0,[e],void 0,function(e){var t,r=e.tip,o=e.searchText,i=e.data,a=e.payload;return n(this,function(e){switch(e.label){case 0:return"function"!=typeof r?[3,2]:[4,r(o,i,a)];case 1:return t=e.sent(),[3,3];case 2:t=r,e.label=3;case 3:return[2,t.map(function(e){return{id:e,label:e}})]}})})},Qa=An()(function(e,t){var n=t.height;return{root:{marginTop:"10px",marginLeft:"10px",marginRight:"10px",gap:e.spacing(1),height:"calc(min(50vh, 60dvh) - 20px)",width:"calc(100vw - 20px)",minHeight:"".concat(Math.floor(n/2)-20,"px"),maxWidth:"450px",display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column"},container:{position:"relative",overflow:"hidden",display:"flex",alignItems:"stretch",justifyContent:"stretch",flex:1},content:{flex:1},submit:{width:"calc(100% - 16px)",margin:"8px"},modal:{display:"flex",justifyContent:"center"}}}),Ja=function(r){var o=r._autofocusDelay,i=void 0===o?650:o,l=r.type,c=r.data,u=r.payload,s=r.itemList,d=r.tip,m=r.tr,p=r.keepRaw,v=r.value,g=r.title,w=void 0===g?"Search":g,x=r.placeholder,C=r.onValueChange,k=Qa(window.screen).classes,S=bi(),L=S.elementRef,N=S.size,I=b(null),M=function(r){var o=r.data,i=r.type,l=r.payload,c=r.value,u=r.itemList,s=r.tip,d=r.tr,m=r.keepRaw,p=void 0!==m&&m,v=r.onValueChange,g=Fr(),b=Ya().clear,w=e(Dr(function(){return"string"==typeof c?c:""}),2),E=w[0],x=w[1],C=e(Dr(function(){return Array.isArray(c)?c:[]}),2),k=C[0],S=C[1],L=to(function(){return t(void 0,void 0,void 0,function(){var e;return n(this,function(t){switch(t.label){case 0:return e=new Set,s?[4,Ka({tip:s,data:o,payload:l,searchText:E.current})]:[3,2];case 1:return[2,t.sent().filter(function(t){var n=t.id;return!e.has(n)})];case 2:return u?[4,Ga({data:o,payload:l,itemList:u,tr:d})]:[3,4];case 3:return[2,t.sent().filter(function(t){var n=t.id;return!e.has(n)})];case 4:return[2,[]]}})})}),N=y(function(){return i===Dn.Items||i===Dn.Combo?k.current.length?k.current:null:E.current},[]),I=Ta({handler:function(){return t(void 0,void 0,void 0,function(){var e;return n(this,function(t){switch(t.label){case 0:return[4,L()];case 1:return e=t.sent(),s?[2,p?e:e.filter(function(e){return Xa(e,E.current,"label")})]:[2,e.filter(function(e){return Xa(e,E.current,"label")})]}})})},limit:1e4,reloadSubject:g}),M=I.data,R=I.hasMore,P=I.loading,A=I.onSkip,T=h(function(){return Jn(function(){g.next()},1e3)},[]),D=h(function(){return i===Dn.Items?Si.Multiple:i===Dn.Combo?Si.Single:Si.None},[]),j=h(function(){return i===Dn.Complete?"":"No data"},[]),O=y(function(){v(N(),{skipReadonly:!0}),b()},[]);return{items:M,hasMore:R,loading:P,onSkip:A,selectionMode:D,reloadSubject:g,onItemClick:y(function(e){var t=e.data,n=e.toggleSelection;if(i===Dn.Complete)return x(t.id),void O();n()},[]),onSelectedRows:y(function(e,t){t||S(e)},[]),renderItem:y(function(e){return i===Dn.Items?f.createElement(Ua,a({},e)):i===Dn.Combo?f.createElement(qa,a({},e)):f.createElement($a,a({},e))},[]),noDataLabel:j,searchText:E.current,selectedRows:k.current,setSearchText:y(function(e){x(e),T()},[]),beginSubmit:O,cancelSubmit:y(function(){b()},[])}}({type:l,data:c,payload:u,value:v,itemList:s,tip:d,keepRaw:p,tr:m,onValueChange:C}),R=M.items,P=M.hasMore,A=M.loading,T=M.onSkip,D=M.onItemClick,O=M.onSelectedRows,F=M.searchText,_=M.selectedRows,B=M.setSearchText,H=M.renderItem,W=M.selectionMode,z=M.beginSubmit,V=M.cancelSubmit,Y=M.noDataLabel;return E(function(){var e;null===(e=I.current)||void 0===e||e.focus(),setTimeout(function(){var e;null===(e=I.current)||void 0===e||e.focus()},i)},[]),f.createElement(Se,{className:k.modal,open:!0,onClose:V},f.createElement(ke,{className:k.root},f.createElement(xe,{value:F,inputRef:I,onChange:function(e){var t=e.target;return B(t.value)},onKeyDown:function(e){"Enter"===e.key?(e.preventDefault(),z()):"Escape"===e.key&&(e.preventDefault(),V())},size:"small",variant:"filled",autoFocus:!0,tabIndex:0,label:w,placeholder:x,InputProps:{autoFocus:!0,endAdornment:f.createElement(Le,{position:"end"},f.createElement(Ne,{edge:"end",onClick:V},f.createElement(Fe,null)))}}),f.createElement(j,{className:k.container,ref:L},f.createElement($i,{className:k.content,sx:{maxHeight:N.height,maxWidth:N.width},selectionMode:W,selectedRows:_,data:R,hasMore:P,loading:A,noDataLabel:Y,onSkip:T,onItemClick:D,onSelectedRows:O},H),f.createElement(xi,{open:A})),f.createElement(ui,{className:k.submit,size:"small",variant:"contained",color:"info",onClick:z},"Submit")))},Za=function(e){return f.createElement(Ja,a({},e))},el=function(e){var t=Ya().push,n=zr(e);return function(){t({id:"item-modal",render:function(){return f.createElement(Za,a({},n.current))}})}},tl=function(){var e=K(function(e){return e.breakpoints.only("xs")}),t=K(function(e){return e.breakpoints.between("sm","lg")}),n=K(function(e){return e.breakpoints.up("lg")}),r=t||n,o=e;return h(function(){return{isPhone:e,isTablet:t,isDesktop:n,isWide:r,isMobile:o}},[r,o,e,t,n])},nl=p(null),rl=function(e){var t=e.children,n=l(e,["children"]);return f.createElement(nl.Provider,{value:n},t)},ol=function(){return v(nl)},il=function(e,t){void 0===t&&(t=0);var n=b(!0),r=Fr();return w(function(){n.current?n.current=!1:t?setTimeout(r.next,t):r.next()},e),w(function(){return function(){r.next()}},[]),y(function(){return new Promise(function(e){return r.once(function(){return e()})})},[])},al=f.createElement(Be,{fontSize:"small"}),ll=f.createElement(_e,{fontSize:"small"}),cl=[],ul=function(e,t){return"number"==typeof e&&"number"==typeof t?e-t:"boolean"==typeof e&&"boolean"==typeof t?(e?1:0)-(t?1:0):"string"==typeof e&&"string"==typeof t?e.localeCompare(t):0},sl=function(t,n){if(Array.isArray(t)&&Array.isArray(n)){if(t.length!==n.length)return!1;var o=r([],e(t),!1).sort(ul),i=r([],e(n),!1).sort(ul);return o.every(function(e,t){return e===i[t]})}return!1},dl=f.createElement(ze,{fontSize:"small"}),fl=f.createElement(We,{fontSize:"small"}),ml=[],pl=An()(function(e){return{root:{height:72,display:"flex",flexWrap:"nowrap",whiteSpace:"nowrap",alignItems:"center",justifyContent:"stretch"},line:{background:A(e.palette.getContrastText(e.palette.background.default),.23),flexGrow:1,margin:15,height:1}}}),hl=function(){var t=p(null);return[function(n){var r=n.children,o=n.initialState,i=n.onChange,a=e(g(o),2),l=a[0],c=a[1];$r(function(){i&&i(l)},[l]);var u=y(function(e){return c(e)},[]),s=h(function(){return[l,u]},[l,u]);return f.createElement(t.Provider,{value:s},r)},function(){return v(t)}]},vl=(Yi=e(hl(),2))[0],gl=Yi[1],bl=function(e,t){return Math.min(100,Math.round(Math.max(Number(e),0)/t*100))},yl=function(e,t,n){var r,o,i=void 0===n?{}:n,a=i.symbol,l=void 0===a?"0":a,u=i.allowed,s=i.replace;if(!e)return e;if(s){for(var d=e.split(""),f=0;f!==e.length;f++){var m=s(e[f])||null;null!==m&&(d[f]=m)}e=d.join("")}if(u){var p=new Set;if("function"==typeof u)for(f=0;f!==e.length;f++){u(e[f],f)||p.add(f)}else for(f=0;f!==e.length;f++){e[f].match(u)||p.add(f)}e=e.split("").filter(function(e,t){return!p.has(t)}).join("")}if(!t)return e;var h=0,v="";try{for(var g=c(t),b=g.next();!b.done;b=g.next()){var y=b.value;if(h===e.length)break;y===l||y===e[h]?(v+=e[h],h++):v+=y}}catch(e){r={error:e}}finally{try{b&&!b.done&&(o=g.return)&&o.call(g)}finally{if(r)throw r.error}}return v},wl=Symbol("never-pos"),El=function(e,t,n,r,o,i,l,c,u,s,d,m,p,h,v,g){return a(a(a({},n?{startAdornment:f.createElement(Le,{sx:{position:"relative"},position:"start"},f.createElement(Ne,{edge:"start",disabled:s,disableRipple:!v,tabIndex:l,onClick:function(){o&&o(m,e,t,function(e){return p(e,{skipReadonly:!0})},h)}},f.createElement(n,{data:e,payload:t,disabled:s,readonly:d})))}:{}),r&&!u?{endAdornment:f.createElement(Le,{sx:{position:"relative"},position:"end"},f.createElement(Ne,{edge:"end",disabled:s,disableRipple:!g,tabIndex:c,onClick:function(){i&&i(m,e,t,function(e){return p(e,{skipReadonly:!0})},h)}},f.createElement(r,{data:e,payload:t,disabled:s,readonly:d})))}:{}),u?{endAdornment:f.createElement(Le,{sx:{position:"relative"},position:"end"},f.createElement(Ne,{disabled:s,edge:"end"},f.createElement(O,{color:"inherit",size:20})))}:{})},xl=function(e){var t=(new Date).getTimezoneOffset();return-1===Math.sign(t)?e.add(Math.abs(t)+60,"minutes"):e.subtract(Math.abs(t)+60,"minutes")},Cl=function(e){var t=(new Date).getTimezoneOffset();return-1===Math.sign(t)?e.subtract(Math.abs(t)+60,"minutes"):e.add(Math.abs(t)+60,"minutes")},kl=function(e){return void 0===e&&(e=Ue(0)),Ue(Cl(e))},Sl=An()(function(e){return{toolbarBtn:{cursor:"pointer",color:e.palette.text.secondary},toolbarBtnSelected:{color:e.palette.text.primary}}}),Ll=function(e){var t,n=e.selected,r=void 0!==n&&n,o=e.className,i=void 0===o?"":o,c=e.label,u=void 0===c?"":c,s=l(e,["selected","className","label"]),d=Sl().classes;return f.createElement(_,a({className:Eo(d.toolbarBtn,i,(t={},t[d.toolbarBtnSelected]=r,t))},s),u)},Nl=An()(function(e){return{container:{maxHeight:320,overflowY:"auto",justifyContent:"center"},yearItem:{height:36,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",outline:"none",color:e.palette.text.primary},selectedYear:{fontSize:26,margin:"10px 0",color:e.palette.primary[500]},disabled:{pointerEvents:"none",color:e.palette.text.disabled}}}),Il=function(e){var t=e.date,n=void 0===t?Ue():t,r=e.minDate,o=void 0===r?Ue():r,i=e.maxDate,a=void 0===i?Ue():i,l=e.onChange,c=void 0===l?function(e){return console.log({change:e})}:l,u=e.disableFuture,s=void 0!==u&&u,d=e.animateYearScrolling,m=void 0===d||d,p=Nl().classes,h=b(null),v=n.get("year");E(function(){var e=h.current.getElementsByClassName(p.selectedYear)[0];e&&e.scrollIntoView({behavior:m?"smooth":"auto"})},[m]);var g=y(function(e){var t=n.clone().set("year",e);c(t)},[n,c]);return f.createElement("div",{ref:h,className:p.container},function(e,t){for(var n=t.diff(e,"years")+1,r=[],o=0;o!==n;o++)r.push(e.clone().add(o,"years"));return r}(o,a).map(function(e){var t,n=e.get("year"),r=Eo(p.yearItem,((t={})[p.selectedYear]=n===v,t[p.disabled]=s&&e.isAfter(Ue()),t));return f.createElement("div",{role:"button",key:e.format("YYYY"),className:r,tabIndex:n,onClick:function(){return g(n)},onKeyPress:function(){return g(n)}},n)}))},Ml=An()(function(e){return{switchHeader:{display:"flex",justifyContent:"space-between",alignItems:"center",margin:"10px 0 20px"},daysHeader:{display:"flex",justifyContent:"stretch",alignItems:"stretch"},dayLabel:{flex:1,margin:"0 12px 0 12px",fontSize:13,textAlign:"center",color:e.palette.text.secondary},dayLabelStart:{textAlign:"start"},dayLabelEnd:{textAlign:"end"},monthName:{color:e.palette.text.primary}}}),Rl=function(t){var n=t.currentMonth,o=void 0===n?Ue():n,i=t.onMonthChange,a=void 0===i?function(e){return console.log({month:e})}:i,l=Ml().classes;return f.createElement("div",null,f.createElement("div",{className:l.switchHeader},f.createElement(Ne,{onClick:function(){return a(o.clone().subtract(1,"months"))}},f.createElement(Xe,null)),f.createElement("div",{className:l.monthName},o.format("MMMM YYYY")),f.createElement(Ne,{onClick:function(){return a(o.clone().add(1,"months"))}},f.createElement(Ge,null))),f.createElement("div",{className:l.daysHeader},function(){var t=Ue.Ls[Ue.locale()],n=t.weekdays,o=t.weekdaysMin,i=t.weekStart,a=void 0===i?0:i,l=o||n;return r(r([],e(l.slice(a,7)),!1),e(l.slice(0,a)),!1).map(function(e){return e.slice(0,1).toUpperCase()})}().map(function(e,t){var n;return f.createElement("div",{key:t,className:Eo(l.dayLabel,(n={},n[l.dayLabelStart]=0===t,n[l.dayLabelEnd]=6===t,n))}," ",e," ")})))},Pl=An()(function(e){return{calendar:{marginTop:10,display:"grid",gridTemplateColumns:"1fr repeat(5, 2fr) 1fr"},hidden:{opacity:0,pointerEvents:"none"},day:{width:36,height:36,fontSize:14,margin:"0 2px",color:e.palette.text.primary},selected:{color:e.palette.primary[700],backgroundColor:e.palette.primary[200]},disabled:{pointerEvents:"none",color:e.palette.text.disabled},active:{color:e.palette.primary.main,fontWeight:"bold"},cell:{display:"flex",alignItems:"center",justifyContent:"center","& :nth-of-type(7n)":{justifyContent:"flex-end"},"& :nth-of-type(7n + 1)":{justifyContent:"flex-start"}},container:{}}}),Al=function(t){var n=t.onChange,r=void 0===n?function(e){return console.log({change:e})}:n,o=t.disableFuture,i=void 0!==o&&o,a=t.date,l=void 0===a?Ue():a,c=Pl().classes,u=e(g(l.clone().startOf("month")),2),s=u[0],d=u[1],m=y(function(e){var t=e.clone().endOf("week"),n=s.get("month");return function(e,t){for(var n=t.diff(e,"days")+1,r=[],o=0;o!==n;o++)r.push(e.clone().add(o,"days"));return r}(e,t).map(function(e){var t,r=Eo(c.day,c.cell,((t={})[c.hidden]=e.get("month")!==n,t[c.selected]=e.toString()===l.toString(),t[c.disabled]=i&&e.isAfter(Ue()),t[c.active]=l.isSame(e,"date"),t));return f.createElement(Ne,{key:e.toString(),className:r,onClick:function(){return h(e)}},f.createElement("span",null," ",e.format("DD")," "))})},[i,c,l,s]),p=y(function(){return function(e,t){for(var n=t.diff(e,"weeks")+1,r=[],o=0;o!==n;o++)r.push(e.clone().add(o,"weeks"));return r}(s.clone().startOf("week"),s.clone().endOf("month").endOf("week")).map(function(e){return f.createElement(k,{key:"week-".concat(e.toString())},m(e))})},[s]),h=function(e){return r(e)};return f.createElement("div",{className:c.container},f.createElement(Rl,{currentMonth:s,onMonthChange:function(e){return d(e)}}),f.createElement("div",{className:c.calendar},p()))},Tl=An()(function(e){return{container:{width:300,height:420},toolbar:{backgroundColor:e.palette.primary.main,display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"center",height:100}}}),Dl=function(t){var n=t.date,r=void 0===n?Ue():n,o=t.minDate,i=void 0===o?kl():o,a=t.maxDate,l=void 0===a?new Date(4102434e6):a,c=t.onChange,u=void 0===c?function(e){return console.log({change:e})}:c,s=t.disableFuture,d=void 0!==s&&s,m=t.animateYearScrolling,p=void 0===m||m,h=t.openToYearSelection,v=void 0!==h&&h,b=e(g(r),2),y=b[0],w=b[1],E=e(g(v),2),x=E[0],C=E[1],k=Tl().classes,S=y.startOf("day"),L=function(e){w(e),u(e)};return f.createElement("div",{className:k.container},f.createElement($e,{className:k.toolbar},f.createElement(Ll,{type:"subheading",onClick:function(){return C(!0)},selected:x,label:y.format("YYYY")}),f.createElement(Ll,{type:"display1",onClick:function(){return C(!1)},selected:!x,label:y.format("ddd, MMM DD")})),x?f.createElement(Il,{date:S,onChange:function(e){C(!1),L(e)},minDate:Ue(i),maxDate:Ue(l),disableFuture:d,animateYearScrolling:p}):f.createElement(Al,{date:S,onChange:L,disableFuture:d}))},jl="DD/MM/YYYY",Ol="HH:MM",Fl=/(?:\d\d\/\d\d\/\d\d\d\d)/g,_l=/(?:\d\d:\d\d)/g,Bl=function(){function e(e,t){var n=this;this.hour=e,this.minute=t,this.toString=function(){return Yl(n)},this.toStamp=function(){return 60*n.hour+n.minute}}return Object.defineProperty(e.prototype,"isValid",{get:function(){var e=kl();return(e=(e=e.set("hour",this.hour)).set("minute",this.minute)).isValid()},enumerable:!1,configurable:!0}),e.fromStamp=function(t){if(null===t)return null;var n=kl().set("hour",0).set("minute",0).add(t,"minute");return new e(n.get("hour"),n.get("minute"))},e}(),Hl=function(){function e(e,t,n){var r=this;this.day=e,this.month=t,this.year=n,this.toString=function(){return zl(r)},this.toStamp=function(){var e=kl(),t=kl().set("hour",0);return(t=(t=(t=t.set("date",r.day)).set("month",r.month-1)).set("year",r.year)).isValid()?Math.max(Math.floor(t.diff(e,"day",!0)),-1):-1}}return Object.defineProperty(e.prototype,"isValid",{get:function(){var e=kl();return(e=(e=(e=e.set("date",this.day)).set("month",this.month-1)).set("year",this.year)).isValid()},enumerable:!1,configurable:!0}),e.fromStamp=function(t){if(null===t)return null;var n=kl().add(t,"days").toDate();return new e(n.getDate(),n.getMonth()+1,n.getFullYear())},e}(),Wl=function(t){if(!t)return null;if("string"!=typeof t)return null;var n=e(t.split("/"),3),r=n[0],o=void 0===r?"":r,i=n[1],a=void 0===i?"":i,l=n[2],c=void 0===l?"":l;if(2===o.length&&2===a.length&&4===c.length){var u=parseInt(o,10),s=parseInt(a,10),d=parseInt(c,10);return Number.isNaN(u)||Number.isNaN(s)||Number.isNaN(d)?null:new Hl(u,s,d)}return null},zl=function(e){var t="",n="",r="";return e instanceof Hl?(t=e.day.toString(),n=e.month.toString(),r=e.year.toString(),t=1===t.length?"0"+t:t,n=1===n.length?"0"+n:n,"".concat(t,"/").concat(n,"/").concat(r)):null},Vl=function(t){if(!t)return null;if("string"!=typeof t)return null;var n=e(t.split(":"),2),r=n[0],o=n[1];if(r&&o){var i=parseInt(r),a=parseInt(o);return isNaN(i)||isNaN(a)?null:new Bl(i,a)}return null},Yl=function(e){var t="",n="";return e instanceof Bl?(t=e.hour.toString(),n=e.minute.toString(),t=1===t.length?"0"+t:t,n=1===n.length?"0"+n:n,"".concat(t,":").concat(n)):null},Ul=function(){var e=new window.Date,t=new Hl(e.getDate(),e.getMonth()+1,e.getFullYear());return zl(t)},ql=function(){var e=new window.Date,t=new Bl(e.getHours(),e.getMinutes());return Yl(t)},$l=function(e){void 0===e&&(e=ql());var t=Vl(e);return t?t.toStamp():-1},Xl=function(e){void 0===e&&(e=Ul());var t=Wl(e);return t?t.toStamp():-1},Gl=Object.freeze({__proto__:null,DATE_PLACEHOLDER:jl,TIME_PLACEHOLDER:Ol,DATE_EXPR:Fl,TIME_EXPR:_l,Time:Bl,Date:Hl,parseDate:Wl,serializeDate:zl,parseTime:Vl,serializeTime:Yl,currentDate:Ul,currentTime:ql,timeStamp:$l,dateStamp:Xl}),Kl="##/##/####",Ql=Symbol("never-pos"),Jl=An()(function(e,t){var n=t.size;return{root:{display:"inline-flex",alignItems:"stretch",justifyContent:"stretch",height:n,width:n},container:{position:"relative",height:n,width:n,flex:1},icon:{position:"absolute",height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center",top:0,left:0,right:0,bottom:0,zIndex:1},spinner:{position:"absolute",height:"100%",width:"100%",top:0,left:0,right:0,bottom:0,zIndex:0}}}),Zl=function(r){var o=r.className,i=r.style,c=r.sx,u=r.noProgress,s=void 0!==u&&u,d=r.throwError,m=void 0!==d&&d,p=r.disabled,h=void 0!==p&&p,v=r.onLoadStart,y=r.onLoadEnd,w=r.onClick,x=void 0===w?function(){}:w,C=r.fallback,k=r.children,S=r.size,L=void 0===S?40:S,N=r.thickness,I=void 0===N?3.6:N,M=l(r,["className","style","sx","noProgress","throwError","disabled","onLoadStart","onLoadEnd","onClick","fallback","children","size","thickness"]),R=Jl({size:L,thickness:I}).classes,P=e(g(0),2),A=P[0],T=P[1],D=b(!0);E(function(){return function(){D.current=!1}},[]);var F=zr(A);return f.createElement(j,{className:Eo(o,R.root),style:i,sx:c},f.createElement(Ne,a({},M,{className:R.container,disabled:!!A||h,onClick:function(e){return t(void 0,void 0,void 0,function(){var t,r;return n(this,function(n){switch(n.label){case 0:if(F.current)return[2];t=!0,n.label=1;case 1:return n.trys.push([1,3,4,5]),v&&v(),D.current&&T(function(e){return e+1}),[4,x(e)];case 2:return n.sent(),[3,5];case 3:if(r=n.sent(),t=!1,m)throw r;return C&&C(r),[3,5];case 4:return y&&y(t),D.current&&T(function(e){return e-1}),[7];case 5:return[2]}})})}}),!!A&&!s&&f.createElement("div",{className:R.spinner},f.createElement(O,{size:L,thickness:I})),f.createElement(j,{className:R.icon},k)))},ec=An()(function(e){return{root:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},container:{display:"flex",alignItems:"stretch",justifyContent:"stretch",borderRadius:"50%"},backgroundPrimary:{background:e.palette.primary.main},backgroundSecondary:{background:e.palette.secondary.main},backgroundError:{background:e.palette.error.main},backgroundInfo:{background:e.palette.info.main},backgroundSuccess:{background:e.palette.success.main},backgroundWarning:{background:e.palette.warning.main}}}),tc="hours",nc="minutes",rc={x:130,y:130},oc=rc.x-rc.x,ic=0-rc.y,ac=function(e,t,n){var r=t-rc.x,o=n-rc.y,i=Math.atan2(oc,ic)-Math.atan2(r,o),a=57.29577951308232*i;return a=Math.round(a/e)*e,a%=360,Math.floor(a/e)||0},lc=An()(function(e){return{pointer:{width:2,backgroundColor:e.palette.primary.main,height:"40%",position:"absolute",left:"calc(50% - 1px)",bottom:"50%",transformOrigin:"center bottom 0px"},thumb:{width:4,height:4,backgroundColor:e.palette.primary.main,borderRadius:"100%",position:"absolute",top:-21,left:-15,border:"14px solid ".concat(e.palette.primary.main),boxSizing:"content-box"},noPoint:{backgroundColor:e.palette.primary.main}}}),cc=function(e){var t,n=e.hasSelected,r=void 0!==n&&n,o=e.value,i=void 0===o?0:o,a=e.max,l=void 0===a?0:a,c=lc().classes,u=y(function(){return{transform:"rotateZ(".concat(360/l*i,"deg)")}},[i,l]);return f.createElement("div",{className:c.pointer,style:u()},f.createElement("div",{className:Eo(c.thumb,(t={},t[c.noPoint]=r,t))}))},uc=An()({container:{display:"flex",justifyContent:"center",alignItems:"flex-end",marginTop:40},clock:{backgroundColor:"rgba(0,0,0,.07)",borderRadius:"50%",height:260,width:260,position:"relative",pointerEvents:"none",userSelect:"none",cursor:"pointer"},squareMask:{width:"100%",height:"100%",position:"absolute",pointerEvents:"auto",touchAction:"none"}}),sc=new function(){var t=this;this.lastOffsetX=0,this.lastOffsetY=0,this.toMouseEvent=function(n){var r=n.target,o=n.targetTouches,i=r.getBoundingClientRect(),a=i.left,l=i.top,c=window.scrollX,u=window.scrollY,s=e(o,1)[0];if(s){var d=s.pageX,f=s.pageY;t.lastOffsetX=d-c-a,t.lastOffsetY=f-u-l}return{offsetX:t.lastOffsetX,offsetY:t.lastOffsetY}}},dc=function(e){var t=e.type,n=void 0===t?"":t,r=e.value,o=void 0===r?0:r,i=e.children,a=e.onChange,l=void 0===a?function(e){return console.log({value:e})}:a,c=uc().classes,u=function(e){var t,r,o,i=n===nc?(t=e.offsetX,r=e.offsetY,void 0===o&&(o=6),ac(o,t,r)):function(e,t){return(ac(30,e,t)||12)%12}(e.offsetX,e.offsetY);l(i)};return f.createElement("div",{className:c.container},f.createElement("div",{className:c.clock},f.createElement("div",{className:c.squareMask,onMouseMove:function(e){e.preventDefault(),1===e.buttons&&u(e.nativeEvent)},onTouchMove:function(e){return e.stopPropagation(),u(sc.toMouseEvent(e)),!0}}),f.createElement(cc,{max:n===tc?12:60,hasSelected:n===tc||o%5==0,value:o}),i))},fc=[[0,5],[55,19.6],[94.4,59.5],[109,114],[94.4,168.5],[54.5,208.4],[0,223],[-54.5,208.4],[-94.4,168.5],[-109,114],[-94.4,59.5],[-54.5,19.6]],mc=An()(function(e){return{clockNumber:{width:32,height:32,position:"absolute",left:"calc(50% - 16px)",display:"inline-flex",justifyContent:"center",alignItems:"center",borderRadius:"50%",pointerEvents:"all",color:e.palette.text.primary},selected:{color:e.palette.getContrastText(e.palette.text.primary)}}}),pc=function(e){var t,n=e.selected,r=void 0!==n&&n,o=e.label,i=void 0===o?"":o,c=e.index,u=void 0===c?0:c,s=l(e,["selected","label","index"]),d=mc().classes,m=Eo(d.clockNumber,((t={})[d.selected]=r,t));return f.createElement("div",a({className:m,style:function(e){var t=fc[e];return{transform:"translate(".concat(t[0],"px, ").concat(t[1],"px")}}(u)},s),i)},hc=function(e){var t=e.date,n=void 0===t?Ue():t,r=e.onChange,o=void 0===r?function(e){return console.log({change:e})}:r,i=function(e){var t=n.clone().hour(e);o(t)},a=n.get("hours"),l=Number(n.format("hh"));return f.createElement(dc,{type:tc,onChange:i,value:a},f.createElement(pc,{onClick:function(){return i(12)},label:"12",selected:12===l,index:0}),f.createElement(pc,{onClick:function(){return i(1)},label:"1",selected:1===l,index:1}),f.createElement(pc,{onClick:function(){return i(2)},label:"2",selected:2===l,index:2}),f.createElement(pc,{onClick:function(){return i(3)},label:"3",selected:3===l,index:3}),f.createElement(pc,{onClick:function(){return i(4)},label:"4",selected:4===l,index:4}),f.createElement(pc,{onClick:function(){return i(5)},label:"5",selected:5===l,index:5}),f.createElement(pc,{onClick:function(){return i(6)},label:"6",selected:6===l,index:6}),f.createElement(pc,{onClick:function(){return i(7)},label:"7",selected:7===l,index:7}),f.createElement(pc,{onClick:function(){return i(8)},label:"8",selected:8===l,index:8}),f.createElement(pc,{onClick:function(){return i(9)},label:"9",selected:9===l,index:9}),f.createElement(pc,{onClick:function(){return i(10)},label:"10",selected:10===l,index:10}),f.createElement(pc,{onClick:function(){return i(11)},label:"11",selected:11===l,index:11}))},vc=function(e){var t=e.onChange,n=void 0===t?function(e){return console.log({change:e})}:t,r=e.date,o=void 0===r?Ue():r,i=o.get("minutes"),a=function(e){var t=o.clone().minute(e);n(t)};return f.createElement(dc,{type:nc,onChange:a,value:i},f.createElement(pc,{onClick:function(){return a(0)},label:"00",selected:0===i,index:0}),f.createElement(pc,{onClick:function(){return a(5)},label:"05",selected:5===i,index:1}),f.createElement(pc,{onClick:function(){return a(10)},label:"10",selected:10===i,index:2}),f.createElement(pc,{onClick:function(){return a(15)},label:"15",selected:15===i,index:3}),f.createElement(pc,{onClick:function(){return a(20)},label:"20",selected:20===i,index:4}),f.createElement(pc,{onClick:function(){return a(25)},label:"25",selected:25===i,index:5}),f.createElement(pc,{onClick:function(){return a(30)},label:"30",selected:30===i,index:6}),f.createElement(pc,{onClick:function(){return a(35)},label:"35",selected:35===i,index:7}),f.createElement(pc,{onClick:function(){return a(40)},label:"40",selected:40===i,index:8}),f.createElement(pc,{onClick:function(){return a(45)},label:"45",selected:45===i,index:9}),f.createElement(pc,{onClick:function(){return a(50)},label:"50",selected:50===i,index:10}),f.createElement(pc,{onClick:function(){return a(55)},label:"55",selected:55===i,index:11}))},gc=function(e){return{container:{width:300,height:420},toolbar:{display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"center",backgroundColor:e.palette.primary.main,height:100}}},bc=An()(function(e){return a(a({},gc(e)),{toolbar:a(a({},gc(e).toolbar),{flexDirection:"row",alignItems:"center",paddingLeft:50}),separator:{margin:"0 2px 0 4px",cursor:"default"},ampmSelection:{marginLeft:20,marginRight:-20},ampmLabel:{fontSize:18}})}),yc=function(t){var n=t.onChange,r=void 0===n?function(e){return console.log({change:e})}:n,o=t.date,i=void 0===o?Ue():o,l=e(g(i),2),c=l[0],u=l[1],s=bc().classes,d=e(g({meridiemMode:c.format("a"),isHourViewShown:!0}),2),m=d[0],p=d[1],h=y(function(e){if(e.format("a")!==m.meridiemMode){var t="am"===m.meridiemMode?e.hour()-12:e.hour()+12;e=e.clone().hour(t)}u(e),r(e)},[m]),v=function(e){return function(){return p(function(t){return a(a({},t),{meridiemMode:e})})}};w(function(){return h(c)},[m.meridiemMode]);return f.createElement("div",{className:s.container},f.createElement($e,{className:s.toolbar},f.createElement(Ll,{type:"display3",onClick:function(){return p(function(e){return a(a({},e),{isHourViewShown:!0})})},selected:m.isHourViewShown,label:"am"===m.meridiemMode?c.format("hh"):c.format("HH")}),f.createElement(Ll,{type:"display3",label:":",selected:!1,className:s.separator}),f.createElement(Ll,{type:"display3",onClick:function(){return p(function(e){return a(a({},e),{isHourViewShown:!1})})},selected:!m.isHourViewShown,label:c.format("mm")}),f.createElement("div",{className:s.ampmSelection},f.createElement(Ll,{className:s.ampmLabel,selected:"am"===m.meridiemMode,type:"subheading",label:"AM",onClick:v("am")}),f.createElement(Ll,{className:s.ampmLabel,selected:"pm"===m.meridiemMode,type:"subheading",label:"PM",onClick:v("pm")}))),m.isHourViewShown?f.createElement(hc,{date:c,onChange:h}):f.createElement(vc,{date:c,onChange:h}))},wc="##:##",Ec=Symbol("never-pos"),xc=An()(function(e){return{switchBase:{color:"".concat(e.palette.primary.main," !important")},checked:{color:"".concat(e.palette.primary.main," !important")},track:{background:"".concat($(e.palette.primary.main,.4)," !important")}}}),Cc=function(e,t,n,r,o,i,a,l,c,u,s,d){return f.createElement(Ne,{disableRipple:!d,tabIndex:u,onClick:function(){c&&c(i,t,n,function(e){return l(e,{skipReadonly:!0})},a)},edge:s},f.createElement(e,{data:t,payload:n,disabled:r,readonly:o}))},kc=function(r,o){void 0===o&&(o={});var i=e(Dr(null),2),a=i[0],l=i[1],c=Ai(function(){return t(void 0,void 0,void 0,function(){var e;return n(this,function(t){switch(t.label){case 0:return[4,r()];case 1:return e=t.sent(),l(e),[2]}})})},o),u=o.deps;w(function(){c.execute()},void 0===u?[]:u);var s=y(function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return a.current?[3,2]:[4,qn(250)];case 1:return e.sent(),[3,0];case 2:return[2,a.current]}})})},[]);return[a.current,c,l,{waitForResult:s,data$:a}]},Sc=function(e){return new Promise(function(t){var n=document.createElement("input");n.setAttribute("type","file"),n.style.display="none",e&&(n.accept=e),document.body.appendChild(n);var r=!0;n.onchange=function(){document.body.contains(n)&&document.body.removeChild(n),r=!1;var e=n.files;(null==e?void 0:e.length)&&(t(e[0]),n.value="")},new Promise(function(e){var t=function(){document.removeEventListener("mousemove",t),document.removeEventListener("touchmove",t),e()};qn(1e3).then(function(){document.addEventListener("mousemove",t),document.addEventListener("touchmove",t)})}).then(function(){setTimeout(function(){r&&(document.body.contains(n)&&document.body.removeChild(n),t(null))},1e3)}),n.click()})},Lc=[],Nc=function(e,r,o,i){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return Array.isArray(e)?[4,Promise.all(e.map(function(e){return r(e,o,i)}))]:[3,2];case 1:case 3:return[2,t.sent()];case 2:return e?[4,r(e,o,i)]:[3,4];case 4:return[2,null]}})})},Ic=Symbol("never-pos"),Mc=f.createElement(Be,{fontSize:"small"}),Rc=f.createElement(_e,{fontSize:"small"}),Pc=["Yes","No"],Ac=An()({item:{whiteSpace:"break-spaces"}}),Tc=function(e){var t=e.value,n=e.label,r=Ac().classes;return f.createElement(B,{className:r.item,key:t,value:t},n)},Dc=An()({item:{whiteSpace:"break-spaces"}}),jc=function(){var e=Dc().classes;return f.createElement(B,{className:e.item},"Create item")},Oc=An()(function(e){return{listHeader:{background:"transparent",paddingTop:e.spacing(1.5)}}}),Fc=function(e){var t=e.type,n=e.mode,r=e.pattern,o=e.getValue,i=e.loading,a=e.placeholder,l=e.autoComplete,c=e.onTextChange,u=e.reloadSubject,s=Oc().classes,d=b(null);w(function(){return u.subscribe(function(){var e=d.current;e&&(e.focus(),e.value=o())})},[]),w(function(){var e=d.current;!i&&e&&(e.focus(),e.value=o())},[i]);var m=h(function(){return Jn(function(e){c(e.target.value)},1500)},[]);w(function(){return function(){m.flush()}},[]);var p=y(function(e){"Escape"!==e.key&&e.stopPropagation()},[]);return f.createElement(rt,{className:s.listHeader},f.createElement(xe,{inputRef:d,type:t,variant:"standard",autoFocus:!0,fullWidth:!0,disabled:i,defaultValue:o,autoComplete:l,placeholder:a,inputProps:{pattern:r},InputProps:{inputMode:n,startAdornment:f.createElement(Le,{position:"start"},f.createElement(ot,null)),endAdornment:f.createElement(Le,{position:"end"},f.createElement(Ne,{disabled:i,onClick:function(){c("")}},i?f.createElement(O,{size:24}):f.createElement(Fe,null)))},onChange:m,onKeyDown:p,sx:{mb:1}}))},_c="react-declarative__searchViewRoot",Bc=An()({root:{display:"flex",flexDirection:"column",alignItems:"stretch",justifyContent:"stretch",height:360,width:"100%"},item:{whiteSpace:"break-spaces"},stretch:{display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *:nth-of-type(1)":{flex:1}}}),Hc=function(t){var n=t.value,r=t.items,o=t.item,i=t.payload,a=t.loading,l=t.hasMore,c=t.SearchItem,u=t.CreateButton,s=t.onItemChange,d=t.onDataRequest,m=t.onCreate,p=t.onLoadStart,h=t.onLoadEnd,v=t.fallback,w=t.throwError,x=Bc().classes,C=b(null),k=e(g(""),2),S=k[0],L=k[1],N=e(g(0),2),I=N[0],M=N[1],R=y(function(){M(function(e){return e+1}),p&&p()},[]),P=y(function(e){M(function(e){return e-1}),h&&h(e)},[]),A=a||!!I;E(function(){var e=C.current,t=null==e?void 0:e.closest(".".concat(_c)),n=null==t?void 0:t.querySelector("input");L((null==n?void 0:n.value)||"")},[A]);var T=y(function(){return!A&&m||o||r.length?null:f.createElement(B,{className:x.item,disabled:!0},A?"Loading":"Nothing found")},[o,r,A,m]),D=y(function(){return m&&S?o||r.length||A?null:f.createElement("div",{className:x.stretch,onClick:function(){m(S)}},f.createElement(u,{payload:i,search:S})):null},[o,r,A,S,m]);return f.createElement(j,{ref:C,p:1},f.createElement(vi,{key:"".concat(n,"-").concat(null==o?void 0:o.value),className:x.root,onDataRequest:d,onLoadStart:R,onLoadEnd:P,fallback:v,throwError:w,loading:A,hasMore:l,minRowHeight:45,bufferSize:25},o&&f.createElement("div",{className:x.stretch},f.createElement(c,{disabled:!0,payload:i,data:o.data,label:o.label,value:o.value})),T(),r.filter(function(e){return e.value!==(null==o?void 0:o.value)}).map(function(e){return f.createElement("div",{className:x.stretch,onClick:function(){return s(e)},key:e.value},f.createElement(c,{disabled:!1,payload:i,data:e.data,label:e.label,value:e.value}))}),D()))},Wc=An()({root:{minHeight:425,minWidth:290,maxHeight:"45vh",overflowY:"auto",overflowX:"hidden"}}),zc=function(r){var o=r.className,i=r.style,c=r.sx,u=r.type,s=void 0===u?"text":u,d=r.mode,m=void 0===d?"text":d;r.variant;var p=r.pattern,v=r.value,E=r.label,x=r.placeholder,C=r.searchText,k=r.changeSubject,S=r.onChange,L=void 0===S?function(){}:S,N=r.onTextChange,I=void 0===N?function(){}:N,M=r.delay,R=void 0===M?500:M,P=r.limit,A=void 0===P?25:P,T=r.payload,D=void 0===T?{}:T,O=r.autoComplete;r.fullWidth;var F=r.disabled,_=r.onCreate,B=r.onLoadStart,H=r.onLoadEnd,W=r.fallback,z=r.handler,V=r.inputRef,Y=r.SearchItem,U=void 0===Y?Tc:Y,q=r.SearchInput,$=void 0===q?Fc:q,X=r.CreateButton,G=void 0===X?jc:X,K=r.startAdornment,Q=void 0===K?null:K,J=r.endAdornment,Z=void 0===J?null:J,ee=r.throwError,te=l(r,["className","style","sx","type","mode","variant","pattern","value","label","placeholder","searchText","changeSubject","onChange","onTextChange","delay","limit","payload","autoComplete","fullWidth","disabled","onCreate","onLoadStart","onLoadEnd","fallback","handler","inputRef","SearchItem","SearchInput","CreateButton","startAdornment","endAdornment","throwError"]),ne=Wc().classes,re=Fr(),oe=b(null),ie=Or(D),ae=e(Dr(!1),2),le=ae[0],ce=ae[1],ue=e(g(function(){return{item:null,open:!1,value:""}}),2),se=ue[0],de=ue[1],fe=Fr(k),me=zr(se.value),pe=to(L),he=to(I),ve=Aa(function(){return t(void 0,void 0,void 0,function(){var e,t,r;return n(this,function(n){switch(n.label){case 0:return e={value:"",item:null,open:!1},v?"function"!=typeof v?[3,2]:[4,v()]:[3,3];case 1:return t=n.sent(),Object.assign(e,{item:t}),[3,3];case 2:v&&Object.assign(e,{item:v}),n.label=3;case 3:return C?"function"!=typeof C?[3,5]:[4,C()]:[3,6];case 4:return r=n.sent(),Object.assign(e,{value:r}),[3,6];case 5:C&&Object.assign(e,{value:C}),n.label=6;case 6:return de(e),ce(!0),[2]}})})},{onLoadStart:B,onLoadEnd:H,fallback:W,throwError:ee}).execute;w(function(){ve()},[]),w(function(){return fe.subscribe(function(){le.current&&(ce(!1),ve())})},[]);var ge=Ta({reloadSubject:re,handler:function(e,r,o,i){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,z(me.current,e,r,o,i)];case 1:return[2,t.sent()]}})})},onLoadStart:B,onLoadEnd:H,fallback:W,throwError:ee,delay:R,limit:A}),be=ge.data,ye=ge.hasMore,we=ge.loading,Ee=ge.onSkip,Ce=ge.clear,ke=h(function(){var e,t=new Set([(null===(e=se.item)||void 0===e?void 0:e.value)||""]);return be.filter(function(e){var n=!t.has(e.value);return t.add(e.value),n})},[be,se.item]);$r(function(){le.current&&(re.next(),he(se.value))},[se.value]),$r(function(){var e;le.current&&(re.next(),pe(se.item),he((null===(e=se.item)||void 0===e?void 0:e.label)||""))},[se.item]);var Se=y(function(e){return de(function(t){return a(a({},t),{open:e})})},[]),Ie=y(function(e){return de(function(t){return a(a({},t),{value:e,item:null})})},[]),Me=y(function(e){return de(function(t){return a(a({},t),{value:e.label,open:!1,item:e})})},[]),Re=y(function(){return de(function(){return{open:!1,value:"",item:null}})},[]),Pe=to(function(){var e;return(null===(e=se.item)||void 0===e?void 0:e.label)||se.value||""}),Ae=Pe();return f.createElement(j,{ref:oe,onContextMenu:function(){return Se(!1)},className:o,style:i,sx:c},f.createElement(xe,a({},te,{fullWidth:!0,key:Ae,focused:!1,autoComplete:O,type:s,label:E,placeholder:x,ref:V,onClick:function(){return Se(!0)},value:Ae,disabled:F||!le.current,inputProps:{pattern:p},InputProps:{inputMode:m,readOnly:!0,startAdornment:Q?f.createElement(Le,{position:"start"},Q):void 0,endAdornment:f.createElement(Le,{sx:{display:se.item||Z?void 0:"none"},position:"end"},se.item?f.createElement(Ne,{size:"small",onClick:function(e){e.stopPropagation(),Re()},edge:"end"},f.createElement(Fe,null)):Z)}})),f.createElement(qe,{className:_c,anchorEl:oe.current,open:se.open,onClose:function(){Ce(),Se(!1)}},f.createElement("div",{className:ne.root},se.open&&f.createElement($,{type:s,mode:m,pattern:p,placeholder:E||x,autoComplete:O,reloadSubject:re,loading:we,getValue:Pe,onTextChange:Ie}),se.open&&f.createElement(Hc,{items:ke,value:se.value,payload:ie,item:se.item,hasMore:ye,loading:we,onDataRequest:Ee,onLoadStart:B,onLoadEnd:H,fallback:W,throwError:ee,SearchItem:U,CreateButton:G,onItemChange:Me,onCreate:_?function(e){_(e),Se(!1)}:void 0}))))},Vc=function(){return null},Yc=function(){return null},Uc=function(){throw new Error("react-declarative DictField dictValue callback is not provided")},qc=function(){throw new Error("react-declarative DictField dictSearch callback is not provided")},$c=function(){return""},Xc=Symbol("never-pos"),Gc=function(e,t,n,r,o,i,a,l,c,u,s,d){return f.createElement(Ne,{disableRipple:!d,tabIndex:u,onClick:function(){c&&c(i,t,n,function(e){return l(e,{skipReadonly:!0})},a)},edge:s},f.createElement(e,{data:t,payload:n,disabled:r,readonly:o}))},Kc=f.createElement(ze,{fontSize:"small"}),Qc=f.createElement(We,{fontSize:"small"}),Jc=An()(function(e){return{ul:{listStyleType:"none",padding:0,"& > *:not(:first-of-type)":{marginLeft:"32px"}},li:{paddingBottom:"6px",paddingLeft:"16px",paddingRight:"16px"},listItem:{"&:hover":{background:"transparent !important"}},hidden:{display:"none"},icons:{fill:e.palette.action.active}}}),Zc=function(t){var n=t.className,o=t.style,i=t.sx,c=t.disabled,u=t.loading,s=t.readOnly,d=t.items,m=void 0===d?[]:d,p=t.value,v=void 0===p?[]:p,y=t.onChange,E=void 0===y?function(){}:y,x=l(t,["className","style","sx","disabled","loading","readOnly","items","value","onChange"]),C=Jc().classes,k=b(!1),S=e(Dr(v||[]),2),L=S[0],N=S[1],I=e(g(!1),2),M=I[0],R=I[1];$r(function(){k.current=!0,N(v||[])},[v]);var P=Qr(),A=P.reloadTrigger,T=P.doReload,D=Xr(L.current);$r(function(){k.current?k.current=!1:L.current.length?E(L.current):E(null)},[L.current]),w(function(){if(M){var e=D.once(function(){var t=Jn(function(e){var t=e.clientX,n=e.clientY,r=document.elementFromPoint(t,n);(null==r?void 0:r.closest(".MuiAutocomplete-popper"))||(R(!1),T())},45);document.addEventListener("mousemove",t),e=function(){document.removeEventListener("mousemove",t),t.clear()}});return function(){return e()}}},[M]);var j=h(function(){var e=m.map(function(e){var t=e.label,n=e.value,r=e.child,o=void 0===r?[]:r,i=Gr(),a=o.map(function(e){return{label:e.label,value:e.value,groupId:i}});return{label:t,value:n,groupId:i,child:a.length?a:void 0}});e=function(e){void 0===e&&(e=[]);var t=[],n=function(e){return void 0===e&&(e=[]),e.forEach(function(e){var r=e.child||[];n(r),t.push(e)})};return n(e),t}(e);var t=new Map,n=new Map;return e.forEach(function(e){if(e.child){var r={label:e.label,child:e.child.map(function(e){return e.value})};t.set(e.groupId,r),n.set(e.value,r)}}),{items:e,groupIdMap:t,groupValueMap:n}},[m]),O=j.items,_=j.groupIdMap,B=j.groupValueMap,H=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=L.current,i=new Set(o),a=t.some(function(e){return i.has(e)});t.forEach(function(e){a?i.delete(e):i.add(e)});var l=r([],e(i),!1);N(l),E(l)},W=h(function(){return O.filter(function(e){return L.current.includes(e.value)})},[L.current,O]);return f.createElement(Ee,{key:A,loading:u,className:n,style:o,sx:i,options:O,value:W,open:M,onOpen:function(){return R(!0)},onClose:function(){return R(!1)},multiple:!0,disabled:c,readOnly:s,disableCloseOnSelect:!0,groupBy:function(e){return e.groupId},getOptionLabel:function(e){return e.label||""},renderInput:function(e){return f.createElement(xe,a({},e,x,{InputProps:a(a(a({},e.InputProps),x.InputProps),{readOnly:s})}))},renderGroup:function(t){var n=_.get(t.group);if(!n)return f.createElement(f.Fragment,null,t.children);var o=n.child.every(function(e){return L.current.includes(e)}),i=n.child.some(function(e){return L.current.includes(e)});return f.createElement("li",{key:t.key},f.createElement("ul",{className:C.ul},f.createElement(Me,{key:-1,onClick:function(){return H.apply(void 0,r([],e(n.child),!1))},className:C.li,dense:!0},f.createElement(F,null,f.createElement(ve,{disableRipple:!0,icon:Kc,checkedIcon:Qc,checked:o,indeterminate:i})),f.createElement(Oe,{primary:n.label}),f.createElement(Pe,{className:C.icons})),t.children))},renderOption:function(e,t,n){var r;return f.createElement(Me,{key:t.value,className:Eo(C.li,(r={},r[C.hidden]=B.has(t.value),r)),onClick:function(){return H(t.value)},dense:!0},f.createElement(F,null,f.createElement(ve,{disableRipple:!0,icon:Kc,checkedIcon:Qc,checked:n.selected})),f.createElement(Oe,{primary:t.label}))},renderTags:function(e,t){return f.createElement(f.Fragment,null,e.map(function(e,n){return f.createElement(He,a({variant:"outlined"},t({index:n}),{label:e.label,onDelete:s?void 0:function(){return H(e.value)}}))}))}})},eu=[],tu={CheckBox:function(e){var t=e.disabled,n=e.onChange,r=e.title,o=e.value;return f.createElement(be,null,f.createElement(ge,{control:f.createElement(ve,{disabled:t,checked:Boolean(o),onChange:function(e,t){return n(t)}}),label:r||""}))},Combo:function(o){var i=o.value,l=o.disabled,c=o.readonly,u=o.description,s=void 0===u?"":u,d=o.placeholder,m=void 0===d?"":d,p=o.outlined,v=void 0!==p&&p,y=o.itemList,E=void 0===y?[]:y,x=o.virtualListBox,C=o.watchItemList,k=o.labelShrink,S=o.noDeselect,L=o.freeSolo,N=o.loading,I=o.title,M=void 0===I?"":I,R=o.dirty,P=o.invalid,A=o.incorrect,T=o.fieldReadonly,D=o.withContextMenu,j=o.tr,F=void 0===j?function(e){return e.toString()}:j,_=o.onChange,B=tl().isMobile,H=Ur().object,W=Ir(),z=uo().requestSubject,V=Qr(),Y=V.reloadTrigger,U=V.doReload,q=e(g(function(){return{options:[],labels:{}}}),2),$=q[0],X=q[1],G=e(g(!1),2),K=G[0],Q=G[1],J=b(!1),Z=il([$],10),ee=zr($.labels),te=h(function(){return Array.isArray(i)?e(i,1)[0]:i},[i]),ne=h(function(){return te?[te]:te},[te]),re=el({data:H,payload:W,itemList:E,keepRaw:!1,onValueChange:_,placeholder:m,tip:void 0,title:M,tr:F,type:Dn.Combo,value:ne}),oe=ol().fallback,ie=Ai(function(o){return t(void 0,void 0,void 0,function(){var i,a,l,c,u,s,d;return n(this,function(f){switch(f.label){case 0:return i={},E=E||[],l=[[]],c=Set.bind,s=(u=Object).values,"function"!=typeof E?[3,2]:[4,Promise.resolve(E(o,W))];case 1:return d=f.sent(),[3,3];case 2:d=E,f.label=3;case 3:return a=r.apply(void 0,l.concat([e.apply(void 0,[new(c.apply(Set,[void 0,s.apply(u,[d])]))]),!1])),[4,Promise.all(a.map(function(e){return t(void 0,void 0,void 0,function(){var t,r;return n(this,function(n){switch(n.label){case 0:return t=i,r=e,[4,Promise.resolve(F(e,o,W))];case 1:return[2,t[r]=n.sent()]}})})}))];case 4:return f.sent(),L&&te&&!a.includes(te)&&a.push(te),X({labels:i,options:a}),J.current=!0,[4,Z()];case 5:return f.sent(),[2]}})})},{fallback:oe}),ae=ie.loading,le=ie.execute,ce=function(e){return Object.values(e||{}).sort(function(e,t){return t.localeCompare(e)}).join("-")}(te),ue=b(null),se=b(!0);w(function(){if(!se.current){if(ue.current===H)return;if(!C)return}ue.current=H,se.current=!1,le(H)},[ce,l,R,P,A,H,c]);var de=function(e,t){return function(n){return f.createElement(xe,a({},n,{sx:a({},!v&&{position:"relative",mt:1,"& .MuiFormHelperText-root":{position:"absolute",top:"100%"}}),variant:v?"outlined":"standard",placeholder:e?void 0:m,label:M,helperText:R&&(P||A)||s,error:R&&(null!==P||null!==A),InputProps:a(a({},n.InputProps),{readOnly:t,endAdornment:f.createElement(f.Fragment,null,e?f.createElement(O,{color:"inherit",size:20}):null,n.InputProps.endAdornment)}),InputLabelProps:a(a({},n.InputLabelProps),k&&{shrink:!0})}))}},fe=function(e,t,n){var r=ee.current;return f.createElement("li",a({},e),f.createElement(Ce,{icon:al,checkedIcon:ll,style:{marginRight:8},checked:n.selected}),L?t:r[t]||"".concat(t," (unknown)"))},me=function(e){var t=ee.current;return L?e:t[e]||"".concat(e," (unknown)")},pe=Fr();w(function(){if(K){var e=pe.once(function(){var t=Jn(function(e){var t=e.clientX,n=e.clientY,r=document.elementFromPoint(t,n);(null==r?void 0:r.closest(".MuiAutocomplete-popper"))||(Q(!1),U())},45);document.addEventListener("mousemove",t),e=function(){document.removeEventListener("mousemove",t),t.clear()}});return function(){return e()}}},[K]),w(function(){return D&&z.subscribe(function(){Q(!1)})},[]);return ae||!J.current||N?f.createElement(Ee,{disableCloseOnSelect:!0,disableClearable:S,disabled:!0,loading:!0,value:null,options:cl,onChange:function(){return null},freeSolo:L,ListboxComponent:x?wi:void 0,getOptionLabel:me,renderInput:de(!0,!0),renderOption:fe}):f.createElement(Ee,{key:Y,onOpen:function(){T||(B?re():Q(!0))},onClose:function(){return Q(!1)},disableCloseOnSelect:!0,disableClearable:S,loading:ae,value:te||null,onChange:function(e,t){return function(e){_(e||null),pe.next()}(t)},getOptionLabel:me,freeSolo:L,options:$.options,disabled:l,readOnly:c,ListboxComponent:x?wi:void 0,renderInput:de(!1,c),renderOption:fe})},Items:function(o){var i=o.value,l=o.disabled,c=o.readonly,u=o.description,s=o.placeholder,d=o.outlined,m=void 0!==d&&d,p=o.itemList,v=void 0===p?[]:p,y=o.freeSolo,E=o.noDeselect,x=o.virtualListBox,C=o.watchItemList,k=o.labelShrink,S=o.loading,L=o.dirty,N=o.invalid,I=o.incorrect,M=o.title,R=o.fieldReadonly,P=o.tr,A=void 0===P?function(e){return e.toString()}:P,T=o.onChange,D=o.withContextMenu,j=tl().isMobile,F=Ur().object,_=Ir(),B=uo().requestSubject,H=Qr(),W=H.reloadTrigger,z=H.doReload,V=e(g(function(){return{options:[],labels:{}}}),2),Y=V[0],U=V[1],q=e(g(!1),2),$=q[0],X=q[1],G=b(!1),K=il([Y],10),Q=zr(Y.labels),J=h(function(){if("string"==typeof i)return[i];if(i){var e=Object.values(i);return _n(e)?[]:e}return[]},[i]),Z=el({data:F,payload:_,itemList:v,keepRaw:!1,onValueChange:T,placeholder:s,tip:void 0,title:M,tr:A,type:Dn.Items,value:J}),ee=b(J),te=h(function(){return sl(ee.current,J)?ee.current:(ee.current=J,J)},[J]),ne=zr(te),re=ol().fallback,oe=Ai(function(o){return t(void 0,void 0,void 0,function(){var i,a,l,c,u,s,d;return n(this,function(f){switch(f.label){case 0:return i={},v=v||[],l=[[]],c=Set.bind,s=(u=Object).values,"function"!=typeof v?[3,2]:[4,Promise.resolve(v(o,_))];case 1:return d=f.sent(),[3,3];case 2:d=v,f.label=3;case 3:return a=r.apply(void 0,l.concat([e.apply(void 0,[new(c.apply(Set,[void 0,s.apply(u,[d])]))]),!1])),[4,Promise.all(a.map(function(e){return t(void 0,void 0,void 0,function(){var t,r;return n(this,function(n){switch(n.label){case 0:return t=i,r=e,[4,Promise.resolve(A(e,o,_))];case 1:return[2,t[r]=n.sent()]}})})}))];case 4:return f.sent(),y&&te.forEach(function(e){a.includes(e)||a.push(e)}),U({options:a,labels:i}),G.current=!0,[4,K()];case 5:return f.sent(),[2]}})})},{fallback:re}),ie=oe.loading,ae=oe.execute,le=function(e){return Object.values(e||{}).sort(function(e,t){return t.localeCompare(e)}).join("-")}(te),ce=b(null),ue=b(!0);w(function(){if(!ue.current){if(ce.current===F)return;if(!C)return}ce.current=F,ue.current=!1,ae(F)},[le,l,L,N,I,F,c]);var se=Fr();w(function(){if($){var e=se.once(function(){var t=Jn(function(e){var t=e.clientX,n=e.clientY,r=document.elementFromPoint(t,n);(null==r?void 0:r.closest(".MuiAutocomplete-popper"))||(X(!1),z())},45);document.addEventListener("mousemove",t),e=function(){document.removeEventListener("mousemove",t),t.clear()}});return function(){return e()}}},[$]),w(function(){return D&&B.subscribe(function(){X(!1)})},[]);var de=function(e,t){var n=Q.current;return e.map(function(e,r){return f.createElement(He,a({variant:m?"outlined":"filled",label:y?e:n[e]||"".concat(e," (unknown)")},t({index:r})))})},fe=function(e){var t=Q.current;return y?e:t[e]||"".concat(e," (unknown)")},me=function(e,t){return function(n){return f.createElement(xe,a({},n,{sx:a({},!m&&{position:"relative",mt:1,"& .MuiFormHelperText-root":{position:"absolute",top:"100%"}}),variant:m?"outlined":"standard",label:M,helperText:L&&(N||I)||u,placeholder:e||ne.current.length?void 0:s,error:L&&(null!==N||null!==I),InputProps:a(a({},n.InputProps),{readOnly:t,endAdornment:f.createElement(f.Fragment,null,e?f.createElement(O,{color:"inherit",size:20}):null,n.InputProps.endAdornment)}),InputLabelProps:a(a({},n.InputLabelProps),k&&{shrink:!0})}))}},pe=function(e,t,n){var r=Q.current;return f.createElement("li",a({},e),f.createElement(ve,{icon:dl,checkedIcon:fl,style:{marginRight:8},checked:n.selected}),y?t:r[t]||"".concat(t," (unknown)"))};return ie||!G.current||S?f.createElement(Ee,{multiple:!0,disableCloseOnSelect:!0,disableClearable:E,loading:!0,disabled:!0,freeSolo:y,onChange:function(){return null},value:ml,options:ml,ListboxComponent:x?wi:void 0,getOptionLabel:fe,renderTags:de,renderInput:me(!0,!0),renderOption:pe}):f.createElement(Ee,{key:W,multiple:!0,loading:ie,disabled:l,disableCloseOnSelect:!0,disableClearable:E,freeSolo:y,readOnly:c,open:$,onChange:function(e,t){return function(e){T((null==e?void 0:e.length)?e:null),se.next()}(t)},onOpen:function(){R||(j?Z():X(!0))},onClose:function(){return X(!1)},getOptionLabel:fe,ListboxComponent:x?wi:void 0,value:te,options:Y.options,renderTags:de,renderInput:me(!1,!!c),renderOption:pe})},Line:function(e){var t=e.title,n=void 0===t?"":t,r=e.lineTransparent,o=void 0!==r&&r,i=pl().classes;return f.createElement(j,{className:i.root},f.createElement(_,{variant:"h5"},n),!o&&f.createElement(j,{className:i.line}))},Radio:function(t){var n=t.disabled,r=t.onChange,o=t.title,i=t.readonly,l=t.radioValue,c=t.value,u=t.name,s=void 0===u?"":u,d=e(gl(),2),m=d[0],p=d[1],h=zr(m),v=y(function(e){return p(function(t){var n;return a(a({},t),((n={})[s]=e,n))})},[]),g=y(function(e){v(e),r(e)},[]);return w(function(){var e=h.current;c!==e[s]&&v(c)},[c]),f.createElement(be,null,f.createElement(Ve,{value:c,onChange:function(e,t){i||g(t||null)}},f.createElement(ge,{value:l,control:f.createElement(Ce,{disabled:n}),label:o||""})))},Rating:function(e){var t=e.value,n=e.disabled,r=e.readonly,o=e.onChange;return f.createElement(j,{display:"flex",justifyContent:"center",component:"fieldset",borderColor:"transparent"},f.createElement(Ye,{onChange:function(e,t){return o(t)},disabled:n,value:Number(t),readOnly:r}))},Progress:function(e){var t=e.maxPercent,n=void 0===t?1:t,r=e.showPercentLabel,o=e.value;return f.createElement(j,{display:"flex",alignItems:"center"},f.createElement(j,{width:"100%",mr:1},f.createElement(De,{variant:"determinate",value:bl(Number(o),Number(n))})),r&&f.createElement(j,{minWidth:35},f.createElement(_,{variant:"body2",color:"textSecondary"},"".concat(bl(Number(o),Number(n)),"%"))))},Typography:function(e){var t=e.value,n=void 0===t?"":t,r=e.placeholder,o=void 0===r?"":r,i=e.typoVariant,a=void 0===i?"body1":i,l=e.style;return f.createElement(_,{variant:a,style:l},n||o)},Button:function(e){var t=e.disabled,n=e.click,r=e.icon,o=e.title,i=e.value,a=e.placeholder,l=e.buttonVariant,c=e.buttonSize,u=e.buttonColor;return f.createElement(ui,{variant:l,size:c,color:u,startIcon:r&&f.createElement(r,null),disabled:t,onClick:n},i||o||a)},Text:function(e){var t,n=e.invalid,r=e.incorrect,o=e.value,i=e.disabled,l=e.readonly,c=e.inputType,u=void 0===c?"text":c,s=e.inputMode,d=void 0===s?"text":s,m=e.inputPattern,p=void 0===m?void 0:m,v=e.labelShrink,g=e.description,y=void 0===g?"":g,w=e.outlined,x=void 0!==w&&w,C=e.title,k=void 0===C?"":C,S=e.leadingIcon,L=e.trailingIcon,N=e.leadingIconClick,I=e.trailingIconClick,M=e.leadingIconTabIndex,R=e.trailingIconTabIndex,P=e.leadingIconRipple,A=void 0===P||P,T=e.trailingIconRipple,D=void 0===T||T,j=e.inputRows,O=void 0===j?1:j,F=e.placeholder,_=void 0===F?"":F,B=e.inputAutocomplete,H=void 0===B?"off":B,W=e.inputFormatterSymbol,z=void 0===W?"0":W,V=e.inputFormatterAllowed,Y=e.inputFormatterReplace,U=e.inputFormatterTemplate,q=void 0===U?"":U,$=e.inputFormatter,X=void 0===$?function(e){return yl(e,q,{symbol:z,allowed:V,replace:Y})}:$,G=e.dirty,K=e.loading,Q=e.autoFocus,J=e.inputRef,Z=e.onChange,ee=Ir(),te=Ur(),ne=te.object,re=te.changeObject,oe=b(),ie=h(function(){var e=wl;return{render:function(){if("text"===u){var t=oe.current;"number"==typeof e&&(null==t||t.setSelectionRange(e,e),e=wl)}},pos:function(){var t,n=oe.current;return n&&(e=(t=n).selectionStart||t.value.length,e+=function(e){for(var t=0,n=Math.max(e-1,0);n<q.length&&q[n]!==z;n++)t+=1;return t}(e)),e}}},[]);return E(function(){if(q){var e=oe.current,t=function(){return ie.pos()};return e&&e.addEventListener("keyup",t),e&&e.addEventListener("click",t),function(){e&&e.removeEventListener("keyup",t),e&&e.removeEventListener("click",t)}}},[oe.current]),E(function(){(q||Y||V)&&ie.render()},[o]),f.createElement(xe,a({sx:a({},!x&&{position:"relative",mt:1,"& .MuiFormHelperText-root":{position:"absolute",top:"100%"}}),inputRef:function(e){oe.current=e,J&&J(e)},variant:x?"outlined":"standard",helperText:G&&(n||r)||y,error:G&&(null!==n||null!==r),InputProps:a({autoComplete:H,readOnly:l,inputMode:d,autoFocus:Q},El(ne,ee,S,L,N,I,M,R,K,i,!!l,(o||"").toString(),Z,re,A,D)),inputProps:{pattern:p},InputLabelProps:v?{shrink:v}:void 0,type:u,focused:Q,autoComplete:H,value:K?"Loading":String(o||""),placeholder:_,onChange:function(e){var t=e.target,n=t.value;if(q||Y||V){n="";for(var r=0;r<t.value.length;r++)n+=t.value[r],n=X(n);ie.pos()}Z(n)},label:k,disabled:i},{multiline:(t=O)>1,rows:t}))},Icon:function(e){var t,n=e.disabled,r=e.click,o=e.icon,i=void 0===o?Qe:o,a=e.iconSize,l=e.iconColor,c=e.iconBackground,u=ec().classes,s=Ir(),d=Ur().object;return f.createElement("div",{className:u.root},f.createElement("div",{className:Eo(u.container,(t={},t[u.backgroundPrimary]="primary"===c,t[u.backgroundSecondary]="secondary"===c,t[u.backgroundError]="error"===c,t[u.backgroundInfo]="info"===c,t[u.backgroundSuccess]="success"===c,t[u.backgroundWarning]="warning"===c,t))},f.createElement(Zl,{size:a,color:l,disabled:n,onClick:r},f.createElement(i,{data:d,payload:s}))))},Date:function(t){var n=t.invalid,r=t.incorrect,o=t.value,i=t.disabled,l=t.readonly,c=t.description,u=void 0===c?"":c,s=t.outlined,d=void 0!==s&&s,m=t.title,p=void 0===m?"Text":m,v=t.placeholder,y=void 0===v?jl:v,x=t.labelShrink,C=t.dirty,k=t.autoFocus,S=t.inputRef,L=t.onChange,N=t.withContextMenu,I=uo().requestSubject,M=b(),R=b(!1),P=b(!1),A=e(f.useState(null),2),T=A[0],D=A[1],j=function(){D(null)},O=e(g(Wl(o||"")?o:""),2),F=O[0],_=O[1],B=zr(F);w(function(){P.current?P.current=!1:Wl(o||"")?(R.current=!0,_(o)):B.current&&(R.current=!0,_(""))},[o]);var H=zr(o);w(function(){if(R.current)R.current=!1;else{var e=Wl(F||"");e?(P.current=!0,L(zl(e))):H.current&&(P.current=!0,L(""))}},[F]);var W=h(function(){if(F){var e=Wl(F);if(!e)return;var t=Ue();return t=(t=(t=t.set("date",e.day)).set("month",e.month-1)).set("year",e.year)}},[F]),z=h(function(){var e=Ql;return{render:function(){var t=M.current;"number"==typeof e&&(null==t||t.setSelectionRange(e,e),e=Ql)},pos:function(){var t,n=M.current;return n&&(e=(t=n).selectionStart||t.value.length,e+=function(e){for(var t=0,n=Math.max(e-1,0);n<10&&"#"!==Kl[n];n++)t+=1;return t}(e)),e}}},[]);return E(function(){var e=M.current,t=function(){return z.pos()};return e&&e.addEventListener("keyup",t),e&&e.addEventListener("click",t),function(){e&&e.removeEventListener("keyup",t),e&&e.removeEventListener("click",t)}},[M.current]),E(function(){z.render()},[F]),w(function(){return N&&I.subscribe(j)},[]),f.createElement(f.Fragment,null,f.createElement(xe,{inputRef:function(e){M.current=e,S&&S(e)},sx:a({},!d&&{position:"relative",mt:1,"& .MuiFormHelperText-root":{position:"absolute",top:"100%"}}),type:"text",InputProps:{readOnly:l,autoFocus:k,endAdornment:f.createElement(Le,{sx:{position:"relative"},position:"end"},f.createElement(Ne,{onClick:function(e){var t=e.clientX,n=e.clientY,r=e.target,o=document.elementFromPoint(t,n);D(o||r)},disabled:i,edge:"end"},f.createElement(Ke,null)))},InputLabelProps:x?{shrink:x}:void 0,disabled:i,focused:k,placeholder:y,variant:d?"outlined":"standard",value:F,label:p,helperText:C&&(n||r)||u,error:C&&(null!==n||null!==r),onChange:function(e){return function(e){for(var t="",n=0;n<e.length;n++)t+=e[n],t=yl(t,Kl,{allowed:/\d/,symbol:"#"});z.pos(),_(t)}(e.target.value)}}),f.createElement(qe,{open:!!T,anchorEl:T,onClose:j,anchorOrigin:{vertical:"bottom",horizontal:"right"}},f.createElement(Dl,{date:W,onChange:function(e){if(e){var t=e.get("date"),n=e.get("month")+1,r=e.get("year");_(new Hl(t,n,r).toString())}else _(null)}})))},Time:function(t){var n=t.invalid,r=t.incorrect,o=t.value,i=t.disabled,l=t.readonly,c=t.description,u=void 0===c?"":c,s=t.outlined,d=void 0!==s&&s,m=t.title,p=void 0===m?"Text":m,v=t.labelShrink,y=t.placeholder,x=void 0===y?Ol:y,C=t.dirty,k=t.autoFocus,S=t.inputRef,L=t.onChange,N=t.withContextMenu,I=uo().requestSubject,M=b(),R=b(!1),P=b(!1),A=e(f.useState(null),2),T=A[0],D=A[1],j=function(){D(null)},O=e(g(Vl(o||"")?o:""),2),F=O[0],_=O[1],B=zr(F);w(function(){P.current?P.current=!1:Vl(o||"")?(R.current=!0,_(o)):B.current&&(R.current=!0,_(""))},[o]);var H=zr(o);w(function(){if(R.current)R.current=!1;else{var e=Vl(F||"");e?(P.current=!0,L(Yl(e))):H.current&&(P.current=!0,L(""))}},[F]);var W=h(function(){if(F){var e=Vl(F);if(!e)return;var t=Ue();return t=(t=t.set("hour",e.hour)).set("minute",e.minute)}},[F]),z=h(function(){var e=Ec;return{render:function(){var t=M.current;"number"==typeof e&&(null==t||t.setSelectionRange(e,e),e=Ec)},pos:function(){var t,n=M.current;return n&&(e=(t=n).selectionStart||t.value.length,e+=function(e){for(var t=0,n=Math.max(e-1,0);n<5&&"#"!==wc[n];n++)t+=1;return t}(e)),e}}},[]);return E(function(){var e=M.current,t=function(){return z.pos()};return e&&e.addEventListener("keyup",t),e&&e.addEventListener("click",t),function(){e&&e.removeEventListener("keyup",t),e&&e.removeEventListener("click",t)}},[M.current]),E(function(){z.render()},[F]),w(function(){return N&&I.subscribe(j)},[]),f.createElement(f.Fragment,null,f.createElement(xe,{sx:a({},!d&&{position:"relative",mt:1,"& .MuiFormHelperText-root":{position:"absolute",top:"100%"}}),inputRef:function(e){M.current=e,S&&S(e)},type:"text",InputProps:{readOnly:l,autoFocus:k,endAdornment:f.createElement(Le,{sx:{position:"relative"},position:"end"},f.createElement(Ne,{onClick:function(e){var t=e.clientX,n=e.clientY,r=e.target,o=document.elementFromPoint(t,n);D(o||r)},disabled:i,edge:"end"},f.createElement(Je,null)))},InputLabelProps:v?{shrink:v}:void 0,disabled:i,focused:k,placeholder:x,variant:d?"outlined":"standard",value:F,label:p,helperText:C&&(n||r)||u,error:C&&(null!==n||null!==r),onChange:function(e){return function(e){for(var t="",n=0;n<e.length;n++)t+=e[n],t=yl(t,wc,{allowed:/\d/,symbol:"#"});z.pos(),_(t)}(e.target.value)}}),f.createElement(qe,{open:!!T,anchorEl:T,onClose:j,anchorOrigin:{vertical:"bottom",horizontal:"right"}},f.createElement(yc,{date:W,onChange:function(e){if(e){var t=e.get("hour"),n=e.get("minute");_(new Bl(t,n).toString())}else _(null)}})))},Switch:function(e){var t=e.disabled,n=e.value,r=e.onChange,o=e.title,i=e.switchNoColor,a=e.switchActiveLabel,l=xc().classes,c=h(function(){return i?l:void 0},[]);return f.createElement(j,{display:"flex",alignItems:"center"},f.createElement(j,{sx:{flex:a?void 0:1,whiteSpace:"nowrap",textAlign:a?"right":void 0}},f.createElement(_,{variant:"body1"},o)),f.createElement(Ze,{disabled:t,classes:c,checked:Boolean(n),onChange:function(e,t){return r(t)}}),!!a&&f.createElement(j,{sx:{flex:1,whiteSpace:"nowrap",textAlign:"left"}},f.createElement(_,{variant:"body1"},a)))},Slider:function(e){var t=e.value,n=e.onChange,r=e.leadingIcon,o=e.trailingIcon,i=e.leadingIconClick,a=e.trailingIconClick,l=e.leadingIconTabIndex,c=e.trailingIconTabIndex,u=e.leadingIconRipple,s=void 0===u||u,d=e.trailingIconRipple,m=void 0===d||d,p=e.labelFormatSlider,h=e.stepSlider,v=e.disabled,g=e.readonly,b=e.maxSlider,y=void 0===b?100:b,w=e.minSlider,E=void 0===w?0:w,x=Ir(),C=Ur(),k=C.object,S=C.changeObject;return f.createElement(j,{mr:1},f.createElement(U,{alignItems:"center",container:!0,spacing:2},f.createElement(U,{item:!0},r&&Cc(r,k,x,!!v,!!g,t,S,n,i,l,"start",s)),f.createElement(U,{item:!0,xs:!0},f.createElement(et,{disabled:v,step:h,marks:!!h,min:E,max:y,"aria-labelledby":"discrete-slider",valueLabelDisplay:"auto",color:"primary",value:t||0,onChange:function(e,t){return!g&&n(t)},valueLabelFormat:p})),f.createElement(U,{item:!0},o&&Cc(o,k,x,!!v,!!g,t,S,n,a,c,"end",m))))},File:function(r){var o=r.invalid,i=r.incorrect,l=r.value,c=r.disabled,u=r.readonly,s=r.description,d=void 0===s?"":s,m=r.outlined,p=void 0!==m&&m,h=r.labelShrink,v=r.title,b=void 0===v?"":v,y=r.placeholder,w=void 0===y?"No file chosen":y,E=r.dirty,x=r.loading,C=r.inputRef,k=r.onChange,S=r.fileAccept,L=r.name,N=r.upload,I=void 0===N?function(e){return e instanceof File?e.name:L}:N,M=r.view,R=r.tr,P=void 0===R?function(e){return e}:R,A=e(g(0),2),T=A[0],D=A[1],j=Ir(),O=Ur().object,F=!!x||!!T,_=e(kc(function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,P(l,O,j)];case 1:return[2,e.sent()]}})})},{onLoadStart:function(){return D(function(e){return e+1})},onLoadEnd:function(){return D(function(e){return e-1})},deps:[l]}),1),B=_[0];return f.createElement(we,{direction:"row",alignItems:p?"stretch":"center",spacing:1},f.createElement(xe,{sx:a({flex:1},!p&&{position:"relative",mt:1,"& .MuiFormHelperText-root":{position:"absolute",top:"100%"}}),inputRef:C,variant:p?"outlined":"standard",helperText:E&&(o||i)||d,error:E&&(null!==o||null!==i),InputProps:{readOnly:u,endAdornment:f.createElement(Le,{sx:{position:"relative"},position:"end"},f.createElement(Ne,{edge:"end",disabled:c||!B,onClick:function(){k(null)}},f.createElement(Fe,null)))},InputLabelProps:h?{shrink:h}:void 0,value:F?"Loading":B?String(B):"",placeholder:w,label:b,disabled:c}),!!B&&!!M&&f.createElement(ui,{variant:"outlined",onLoadStart:function(){return D(function(e){return e+1})},onLoadEnd:function(){return D(function(e){return e-1})},onClick:function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,M(B,O,j)];case 1:return e.sent(),[2]}})})}},"View"),f.createElement(ui,{variant:"outlined",onLoadStart:function(){return D(function(e){return e+1})},onLoadEnd:function(){return D(function(e){return e-1})},onClick:function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:return[4,Sc(S)];case 1:return(e=n.sent())?[4,I(e,O,j)]:[3,3];case 2:t=n.sent(),k(t),n.label=3;case 3:return[2]}})})}},F&&"Uploading",!F&&"Choose"))},Choose:function(r){var o=r.invalid,i=r.incorrect,l=r.value,c=r.disabled,u=r.readonly,s=r.description,d=void 0===s?"":s,m=r.outlined,p=void 0!==m&&m,h=r.title,v=void 0===h?"":h,g=r.placeholder,b=void 0===g?"Not chosen":g,y=r.labelShrink,w=void 0===y||y,E=r.dirty,x=r.loading,C=r.inputRef,k=r.onChange,S=r.choose,L=void 0===S?function(){return"unknown"}:S,N=r.tr,I=void 0===N?function(e){return e}:N,M=Ir(),R=Ur().object,P=Qr(),A=P.doReload,T=P.reloadTrigger,D=e(kc(function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,Nc(l,I,R,M)];case 1:return[2,e.sent()]}})})},{deps:[l]}),2),j=D[0],O=D[1].loading,F=no(function(){return t(void 0,void 0,void 0,function(){var e;return n(this,function(t){switch(t.label){case 0:return l?(k(null),[2]):[4,L(R,M)];case 1:return e=t.sent(),k(Array.isArray(e)?e.length?e:null:e||null),[2]}})})}),_=F.execute,B=F.loading,H=x||O||B;return f.createElement(Ee,{key:"".concat(T,"-").concat(j),fullWidth:!0,multiple:Array.isArray(j),disableClearable:!0,disabled:c,loading:H,value:j||null,options:Lc,onChange:function(){return null},freeSolo:!0,readOnly:!0,renderInput:function(e){return f.createElement(xe,a({},e,{value:e.inputProps.value,variant:p?"outlined":"standard",helperText:E&&(o||i)||d,error:E&&(null!==o||null!==i),sx:a({flex:1},!p&&{position:"relative",mt:1,"& .MuiFormHelperText-root":{position:"absolute",top:"100%"}}),inputRef:C,onClick:function(e){var t;null===(t=e.currentTarget)||void 0===t||t.blur(),l||_(),A()},InputProps:a(a({},e.InputProps),{readOnly:!0,placeholder:b,endAdornment:H?e.InputProps.endAdornment:f.createElement(Le,{sx:{position:"relative"},position:"end"},f.createElement(ui,{sx:{pointerEvents:u?"none":"all",mb:p?void 0:.5},disabled:H||c,variant:"outlined",size:"small",color:l?"secondary":"primary",onClick:function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,_()];case 1:return e.sent(),[2]}})})}},l&&"Deselect",!l&&"Choose"))}),InputLabelProps:a(a({},e.InputLabelProps),{shrink:w||void 0}),placeholder:b,label:v}))}})},Complete:function(o){var i=o.invalid,l=o.incorrect,c=o.value,u=o.disabled,s=o.readonly,d=o.inputType,m=void 0===d?"text":d,p=o.inputMode,v=void 0===p?"text":p,y=o.inputPattern,x=void 0===y?void 0:y,C=o.labelShrink,k=o.description,S=void 0===k?"":k,L=o.outlined,N=void 0!==L&&L,I=o.keepRaw,M=void 0!==I&&I,R=o.title,P=void 0===R?"":R,A=o.placeholder,T=void 0===A?"":A,D=o.inputAutocomplete,j=void 0===D?"off":D,F=o.dirty,_=o.loading,B=o.tip,H=void 0===B?function(){return["unset"]}:B,W=o.tipSelect,z=o.autoFocus,V=o.onChange,Y=o.fieldReadonly,U=o.inputFormatterSymbol,q=void 0===U?"0":U,$=o.inputFormatterAllowed,X=o.inputFormatterReplace,G=o.inputFormatterTemplate,K=void 0===G?"":G,Q=o.inputFormatter,J=void 0===Q?function(e){return yl(e,K,{symbol:q,allowed:$,replace:X})}:Q,Z=o.withContextMenu,ee=tl().isMobile,te=Ir(),ne=Ur(),re=ne.object,oe=ne.changeObject,ie=uo().requestSubject,ae=ol().fallback,le=void 0===ae?function(e){throw e}:ae,ce=bi(),ue=ce.elementRef,se=ce.size,de=b(null),fe=e(f.useState(null),2),me=fe[0],pe=fe[1],he=function(){pe(null)},ve=e(g(-1),2),ge=ve[0],be=ve[1],ye=e(g(!1),2),we=ye[0],Ee=ye[1],Ce=e(g([]),2),ke=Ce[0],Se=Ce[1],Re=_||we,Pe=zr(c),Ae=e(ji(c,500),1)[0],Te=zr(H),De=zr(re),je=to(V),Fe=el({data:re,payload:te,itemList:void 0,tr:void 0,tip:H,keepRaw:!1,onValueChange:V,placeholder:T,title:P,type:Dn.Complete,value:c}),_e=h(function(){var e=Ic;return{render:function(){if("text"===m){var t=de.current;"number"==typeof e&&(null==t||t.setSelectionRange(e,e),e=Ic)}},pos:function(){var t,n=de.current;return n&&(e=(t=n).selectionStart||t.value.length,e+=function(e){for(var t=0,n=Math.max(e-1,0);n<K.length&&K[n]!==q;n++)t+=1;return t}(e)),e}}},[]);E(function(){if(K){var e=de.current,t=function(){return _e.pos()};return e&&e.addEventListener("keyup",t),e&&e.addEventListener("click",t),function(){e&&e.removeEventListener("keyup",t),e&&e.removeEventListener("click",t)}}},[de.current]),E(function(){(K||X||$)&&_e.render()},[c]);var Be=h(function(){return Gn(function(e){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return be(-1),[4,je(e)];case 1:return t.sent(),[2]}})})})},[]),He=h(function(){return Gn(function(){return t(void 0,void 0,void 0,function(){var t,o,i,a,l;return n(this,function(n){switch(n.label){case 0:Ee(!0),n.label=1;case 1:return n.trys.push([1,5,6,7]),"function"!=typeof Te.current?[3,3]:[4,Te.current(Pe.current||"",De.current,te)];case 2:return o=n.sent(),[3,4];case 3:o=Te.current,n.label=4;case 4:if(t=o,!Array.isArray(t))throw new Error("CompleteField tip invalid result");return!M&&Pe.current&&(i=String(Pe.current||"").toLowerCase(),a=i.split(" "),t=t.filter(function(e){var t=String(e).toLowerCase().split(" "),n=!0;return a.forEach(function(e){n=n&&t.some(function(t){return t.includes(e)})}),n})),t=t.slice(0,100),be(-1),Se(r([],e(new Set(t)),!1)),[3,7];case 5:return l=n.sent(),le(l),[3,7];case 6:return Ee(!1),[7];case 7:return[2]}})})})},[]);w(function(){open&&He()},[Ae,open]);var We=function(){var e;he(),be(-1),null===(e=de.current)||void 0===e||e.setSelectionRange(null,null)};return w(function(){return Z&&ie.subscribe(function(){We()})},[]),f.createElement(f.Fragment,null,f.createElement("div",{ref:ue},f.createElement(xe,{sx:a({},!N&&{position:"relative",mt:1,"& .MuiFormHelperText-root":{position:"absolute",top:"100%"}}),fullWidth:!0,inputRef:de,variant:N?"outlined":"standard",value:String(c||""),helperText:F&&(i||l)||S,error:F&&(null!==i||null!==l),InputProps:{onKeyDown:function(e){(function(e,t){var n;if("Escape"===e)return he(),be(-1),t(),!0;if("ArrowDown"===e)return be(function(e){return Math.min(Math.max(e+1,0),ke.length-1)}),!0;if("ArrowUp"===e)return be(function(e){return Math.min(Math.max(e-1,0),ke.length-1)}),!0;if("Enter"===e){var r=ke.find(function(e,t){return t===ge});if(r)return Be(r),null===(n=de.current)||void 0===n||n.setSelectionRange(r.length,r.length),he(),be(-1),!0}return!1})(e.key,function(){return e.currentTarget.blur()})&&e.preventDefault()},autoComplete:j,readOnly:s,inputMode:v,autoFocus:z,endAdornment:f.createElement(Le,{sx:{position:"relative"},position:"end"},f.createElement(Ne,{onClick:function(e){var t;e.preventDefault(),e.stopPropagation(),Re||open||!c||(Be(""),null===(t=de.current)||void 0===t||t.setSelectionRange(null,null))},disabled:u,edge:"end"},Re&&f.createElement(O,{color:"inherit",size:20}),!Re&&!open&&!!c&&f.createElement(nt,null)))},inputProps:{pattern:x},InputLabelProps:C?{shrink:C}:void 0,type:m,focused:z,autoComplete:j,placeholder:T,onChange:function(e){var t=e.target,n=t.value;if(K||X||$){n="";for(var r=0;r<t.value.length;r++)n+=t.value[r],n=J(n);_e.pos()}V(n)},onClick:function(e){var t=e.clientX,n=e.clientY,r=e.target;if(!Y)if(ee)Fe();else{var o=document.elementFromPoint(t,n);pe(o||r)}},label:P,disabled:u})),f.createElement(qe,{open:!!me,anchorEl:me,onClose:We,anchorOrigin:{vertical:"bottom",horizontal:"left"},disableAutoFocus:!0,disableEnforceFocus:!0,disableRestoreFocus:!0},!!me&&f.createElement(vi,{component:Ie,sx:{width:se.width,height:ke.length?Math.min(36*ke.length,250):36,mb:1,maxHeight:"45vh"},minRowHeight:36},!ke.length&&f.createElement(tt,{disableGutters:!0,dense:!0},f.createElement(Me,{disableRipple:!0,disableTouchRipple:!0},f.createElement(Oe,{primary:Re?"Loading":"No tips"}))),ke.map(function(e,t){return f.createElement(tt,{disableGutters:!0,dense:!0,key:"".concat(e,"-").concat(t)},f.createElement(Me,{selected:t===ge,onClick:function(t){t.preventDefault(),t.stopPropagation(),Be(e),W&&W(e,De.current,te,oe),he()}},f.createElement(Oe,{primary:e})))}))))},YesNo:function(r){var o=r.value,i=r.disabled,l=r.readonly,c=r.description,u=void 0===c?"":c,s=r.placeholder,d=void 0===s?"":s,m=r.outlined,p=void 0!==m&&m,v=r.virtualListBox,y=r.labelShrink,E=r.noDeselect,x=r.title,C=void 0===x?"":x,k=r.tr,S=void 0===k?function(e){return e}:k,L=r.dirty,N=r.invalid,I=r.incorrect,M=r.onChange,R=Qr(),P=R.reloadTrigger,A=R.doReload,T=e(g({}),2),D=T[0],j=T[1],F=e(g(!1),2),_=F[0],B=F[1],H=b(!1),W=zr(D),z=Ir(),V=Ur().object,Y=h(function(){return!0===o?"Yes":!1===o?"No":null},[o]),U=ol().fallback,q=Ai(function(){return t(void 0,void 0,void 0,function(){var e;return n(this,function(r){switch(r.label){case 0:return e={},[4,Promise.all(Pc.map(function(r){return t(void 0,void 0,void 0,function(){var t,o;return n(this,function(n){switch(n.label){case 0:return t=e,o=r,[4,Promise.resolve(S(r,V,z))];case 1:return[2,t[o]=n.sent()]}})})}))];case 1:return r.sent(),j(e),H.current=!0,[2]}})})},{fallback:U}),$=q.loading,X=q.execute;w(function(){X()},[]);var G=function(e){return W.current[e]||e},K=function(e,t){return function(n){return f.createElement(xe,a({},n,{sx:a({},!p&&{position:"relative",mt:1,"& .MuiFormHelperText-root":{position:"absolute",top:"100%"}}),variant:p?"outlined":"standard",placeholder:e?void 0:d,label:C,helperText:L&&(N||I)||u,error:L&&(null!==N||null!==I),InputProps:a(a({},n.InputProps),{readOnly:t,endAdornment:f.createElement(f.Fragment,null,e?f.createElement(O,{color:"inherit",size:20}):null,n.InputProps.endAdornment)}),InputLabelProps:a(a({},n.InputLabelProps),y&&{shrink:!0})}))}},Q=function(e,t,n){var r=W.current;return f.createElement("li",a({},e),f.createElement(Ce,{icon:Mc,checkedIcon:Rc,style:{marginRight:8},checked:n.selected}),r[t]||t)},J=Fr();w(function(){if(_){var e=J.once(function(){var t=Jn(function(e){var t=e.clientX,n=e.clientY,r=document.elementFromPoint(t,n);(null==r?void 0:r.closest(".MuiAutocomplete-popper"))||(B(!1),A())},45);document.addEventListener("mousemove",t),e=function(){document.removeEventListener("mousemove",t),t.clear()}});return function(){return e()}}},[_]);return $||!H.current?f.createElement(Ee,{disableCloseOnSelect:!0,disableClearable:E,disabled:!0,loading:!0,value:null,options:Pc,onChange:function(){return null},ListboxComponent:v?wi:void 0,getOptionLabel:G,renderInput:K(!0,!0),renderOption:Q}):f.createElement(Ee,{key:P,onOpen:function(){return B(!0)},onClose:function(){return B(!1)},disableCloseOnSelect:!0,disableClearable:E,value:Y||null,onChange:function(e,t){return function(e){M("Yes"===e||"No"!==e&&null),J.next()}(t)},options:Pc,disabled:i,readOnly:l,ListboxComponent:v?wi:void 0,getOptionLabel:G,renderInput:K(!1,l),renderOption:Q})},Dict:function(r){var o=r.invalid,i=r.incorrect,l=r.value,c=r.disabled,u=r.readonly,s=r.inputType,d=void 0===s?"text":s,m=r.inputMode,p=void 0===m?"text":m,v=r.inputPattern,x=void 0===v?void 0:v,C=r.inputAutocomplete,k=r.description,S=void 0===k?"":k,L=r.outlined,N=void 0!==L&&L,I=r.title,M=void 0===I?"":I,R=r.placeholder,P=void 0===R?"":R,A=r.dirty,T=r.loading,D=r.inputRef,j=r.onChange,F=r.dictLimit,_=void 0===F?25:F,B=r.dictDelay,H=void 0===B?500:B,W=r.dictOnText,z=void 0===W?Vc:W,V=r.dictOnItem,Y=void 0===V?Yc:V,U=r.dictSearch,q=void 0===U?qc:U,$=r.dictValue,X=void 0===$?Uc:$,G=r.dictSearchText,K=void 0===G?$c:G,Q=r.dictOnAppend,J=r.dictSearchItem,Z=r.dictCreateButton,ee=r.inputFormatterSymbol,te=void 0===ee?"0":ee,ne=r.inputFormatterAllowed,re=r.inputFormatterReplace,oe=r.inputFormatterTemplate,ie=void 0===oe?"":oe,ae=r.inputFormatter,le=void 0===ae?function(e){return yl(e,ie,{symbol:te,allowed:ne,replace:re})}:ae,ce=r.leadingIcon,ue=r.trailingIcon,se=r.leadingIconClick,de=r.trailingIconClick,fe=r.leadingIconRipple,me=void 0===fe||fe,pe=r.trailingIconRipple,he=void 0===pe||pe,ve=r.leadingIconTabIndex,ge=r.trailingIconTabIndex,be=Ir(),ye=Ur(),we=ye.object,Ee=ye.changeObject,Ce=Xr(l),ke=h(function(){return function(t){var n=t.type,r=t.mode,o=t.pattern,i=t.getValue,a=t.loading,l=t.autoComplete,c=t.onTextChange,u=t.reloadSubject,s=e(g(i),2),m=s[0],p=s[1],v=b(null),x=h(function(){var e=Xc;return{render:function(){if("text"===d){var t=v.current;"number"==typeof e&&(null==t||t.setSelectionRange(e,e),e=Xc)}},pos:function(){var t,n=v.current;return n&&(e=(t=n).selectionStart||t.value.length,e+=function(e){for(var t=0,n=Math.max(e-1,0);n<ie.length&&ie[n]!==te;n++)t+=1;return t}(e)),e}}},[]);E(function(){if(ie){var e=v.current,t=function(){return x.pos()};return e&&e.addEventListener("keyup",t),e&&e.addEventListener("click",t),function(){e&&e.removeEventListener("keyup",t),e&&e.removeEventListener("click",t)}}},[v.current]),E(function(){(ie||re||ne)&&x.render()},[m]),w(function(){return u.subscribe(function(){var e;null===(e=v.current)||void 0===e||e.focus(),p(i)})},[]),w(function(){var e;a||(null===(e=v.current)||void 0===e||e.focus(),p(i))},[a]);var C=h(function(){return Jn(function(e){c(e)},1500)},[]);w(function(){return function(){C.flush()}},[]),w(function(){return br(C.flush)},[]);var k=y(function(e){"Escape"!==e.key&&e.stopPropagation()},[]);return f.createElement(rt,{sx:{background:"transparent",pt:1.5}},f.createElement(xe,{inputRef:v,type:n,variant:"standard",autoFocus:!0,fullWidth:!0,disabled:a,value:m,autoComplete:l,placeholder:M||P,inputProps:{pattern:o},InputProps:{inputMode:r,startAdornment:f.createElement(Le,{sx:{position:"relative"},position:"start"},f.createElement(ot,null)),endAdornment:f.createElement(Le,{sx:{position:"relative"},position:"end"},f.createElement(Ne,{disabled:a,onClick:function(){c("")}},a?f.createElement(O,{size:24}):f.createElement(Fe,null)))},onChange:function(e){var t=e.target,n=t.value;if(ie||re||ne){n="";for(var r=0;r<t.value.length;r++)n+=t.value[r],n=le(n);x.pos()}p(n),C(n)},onKeyDown:k,sx:{mb:1}}))}},[]),Se=zr(we);return f.createElement(zc,{sx:a({},!N&&{position:"relative",mt:1,"& .MuiFormHelperDict-root":{position:"absolute",top:"100%"}}),startAdornment:ce&&Gc(ce,we,be,!!c,!!u,l,Ee,j,se,ve,"start",me),endAdornment:ue&&Gc(ue,we,be,!!c,!!u,l,Ee,j,de,ge,"end",he),handler:function(e,r,o,i,a){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,q({search:e,limit:r,offset:o,initial:i,data:Se.current,payload:be,rows:a})];case 1:return[2,t.sent()]}})})},changeSubject:Ce,mode:p,pattern:x,autoComplete:C,limit:_,delay:H,inputRef:D,variant:N?"outlined":"standard",helperText:A&&(o||i)||S,error:A&&(null!==o||null!==i),type:d,value:function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return l?[4,X(l,Se.current,be)]:[3,2];case 1:return[2,e.sent()||null];case 2:return[2,null]}})})},searchText:function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,K(Se.current,be)];case 1:return[2,e.sent()||""]}})})},placeholder:P,onChange:function(e){Y((null==e?void 0:e.value)||null,Se.current,be,j,Ee),j((null==e?void 0:e.value)||null)},onTextChange:function(e){return z(e,Se.current,be,j,Ee)},onCreate:Q?function(e){return Q(e,Se.current,be,j,Ee)}:void 0,label:M,payload:be,disabled:c||T||u,SearchItem:J,CreateButton:Z,SearchInput:ke})},Tree:function(r){var o=r.invalid,i=r.incorrect,l=r.value,c=r.disabled,u=r.readonly,s=r.description,d=void 0===s?"":s,m=r.outlined,p=void 0!==m&&m,h=r.title,v=void 0===h?"":h,g=r.placeholder,b=void 0===g?"":g,y=r.dirty,w=r.loading,E=r.onChange,x=r.itemTree,C=void 0===x?eu:x,k=Ir(),S=Ur().object,L=e(kc(function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return"function"!=typeof C?[3,2]:[4,C(S,k)];case 1:return[2,e.sent()];case 2:return[2,C]}})})},{deps:[l]}),2),N=L[0],I=L[1].loading,M=w||I;return f.createElement(Zc,{fullWidth:!0,sx:a({flex:1},!p&&{position:"relative",mt:1,"& .MuiFormHelperText-root":{position:"absolute",top:"100%"}}),readOnly:u,loading:M,items:N||eu,value:(null==N?void 0:N.length)?l:null,disabled:c||M,variant:p?"outlined":"standard",helperText:y&&(o||i)||d,error:y&&(null!==o||null!==i),placeholder:b,label:v,onChange:E})}},nu=p(tu),ru=function(e){var t=e.children,n=l(e,["children"]),r=v(nu),o=h(function(){return a(a({},r),n)},[]);return f.createElement(nu.Provider,{value:o},t)},ou=function(e){var t=v(nu).Text;return f.createElement(t,a({},e))},iu=function(e){var t=e.invalid,n=e.incorrect,r=e.value,o=e.disabled,i=e.readonly,a=e.inputType,l=void 0===a?"text":a,c=e.description,u=void 0===c?"":c,s=e.outlined,d=void 0!==s&&s,m=e.labelShrink,p=e.title,h=void 0===p?"":p,v=e.leadingIconRipple,g=e.trailingIconRipple,b=e.leadingIcon,y=e.trailingIcon,w=e.leadingIconClick,E=e.trailingIconClick,x=e.inputRows,C=void 0===x?1:x,k=e.placeholder,S=void 0===k?"":k,L=e.inputAutocomplete,N=void 0===L?"off":L,I=e.inputFormatter,M=e.inputFormatterSymbol,R=e.inputFormatterAllowed,P=e.inputFormatterTemplate,A=e.dirty,T=e.loading,D=e.onChange,j=e.autoFocus,O=e.inputRef,F=e.name,_=e.leadingIconTabIndex,B=e.trailingIconTabIndex;return f.createElement(ou,{autoFocus:j,inputRef:O,invalid:t,incorrect:n,value:r,readonly:i,disabled:o,inputType:l,description:u,outlined:d,title:h,leadingIconRipple:v,trailingIconRipple:g,leadingIcon:b,trailingIcon:y,labelShrink:m,leadingIconClick:w,trailingIconClick:E,inputRows:C,placeholder:S,inputAutocomplete:N,inputFormatter:I,inputFormatterSymbol:M,inputFormatterAllowed:R,inputFormatterTemplate:P,dirty:A,loading:T,onChange:D,name:F,leadingIconTabIndex:_,trailingIconTabIndex:B})};iu.displayName="TextField";var au=Xo(iu),lu=function(e){var t=v(nu).Line;return f.createElement(t,a({},e))},cu=function(e){var t=e.title,n=void 0===t?"":t,r=e.lineTransparent,o=void 0!==r&&r;return f.createElement(lu,{lineTransparent:o,title:n})};cu.displayName="LineField";var uu=Xo(cu,{defaultProps:{fieldRightMargin:"0",fieldBottomMargin:"0"},skipFocusBlurCall:!0}),su=function(e){var t=v(nu).Radio;return f.createElement(t,a({},e))},du=function(e){var t=e.disabled,n=e.value,r=e.onChange,o=e.title,i=e.radioValue,a=e.readonly,l=e.name,c=void 0===l?"":l;return f.createElement(su,{value:n,disabled:t,readonly:a,onChange:r,title:o,radioValue:i,name:c})};du.displayName="RadioField";var fu=Xo(du,{withApplyQueue:!0,skipDebounce:!0,skipDirtyClickListener:!0}),mu=function(e){var t=v(nu).Switch;return f.createElement(t,a({},e))},pu=function(e){var t=e.disabled,n=e.value,r=e.readonly,o=e.onChange,i=e.switchNoColor,a=e.switchActiveLabel,l=e.title;return f.createElement(mu,{readonly:r,disabled:t,value:n,onChange:o,switchNoColor:i,switchActiveLabel:a,title:l})};pu.displayName="SwitchField";var hu=Xo(pu,{withApplyQueue:!0,skipDebounce:!0,skipDirtyClickListener:!0,skipFocusReadonly:!0}),vu=function(e){var t=v(nu).CheckBox;return f.createElement(t,a({},e))},gu=function(e){var t=e.disabled,n=e.value,r=e.readonly,o=e.onChange,i=e.title;return f.createElement(vu,{disabled:t,value:n,readonly:r,onChange:o,title:i})};gu.displayName="CheckboxField";var bu=Xo(gu,{withApplyQueue:!0,skipDebounce:!0,skipDirtyClickListener:!0}),yu=function(e){var t=v(nu).Progress;return f.createElement(t,a({},e))},wu=function(e){var t=e.maxPercent,n=void 0===t?1:t,r=e.showPercentLabel,o=e.value;return f.createElement(yu,{showPercentLabel:r,maxPercent:n,value:o})};wu.displayName="ProgressField";var Eu=Xo(wu,{skipFocusBlurCall:!0}),xu=function(e){var t=v(nu).Slider;return f.createElement(t,a({},e))},Cu=function(e){var t=e.value,n=e.onChange,r=e.leadingIconRipple,o=e.trailingIconRipple,i=e.leadingIcon,a=e.trailingIcon,l=e.leadingIconClick,c=e.trailingIconClick,u=e.stepSlider,s=e.sliderSteps,d=e.maxSlider,m=e.minSlider,p=e.labelFormatSlider,h=e.leadingIconTabIndex,v=e.trailingIconTabIndex;return f.createElement(xu,{value:t,onChange:n,leadingIconRipple:r,trailingIconRipple:o,leadingIcon:i,trailingIcon:a,leadingIconClick:l,trailingIconClick:c,labelFormatSlider:p,stepSlider:u,maxSlider:d,sliderSteps:s,minSlider:m,leadingIconTabIndex:h,trailingIconTabIndex:v})};Cu.displayName="SliderField";var ku=Xo(Cu,{skipDebounce:!0,withApplyQueue:!0,skipDirtyClickListener:!0}),Su=function(e){var t=v(nu).Combo;return f.createElement(t,a({},e))},Lu=function(e){var t=e.value,n=e.disabled,r=e.readonly,o=e.description,i=void 0===o?"":o,a=e.placeholder,l=void 0===a?"":a,c=e.outlined,u=void 0!==c&&c,s=e.itemList,d=void 0===s?[]:s,m=e.freeSolo,p=void 0!==m&&m,h=e.virtualListBox,v=void 0===h||h,g=e.watchItemList,b=e.noDeselect,y=e.labelShrink,w=e.title,E=void 0===w?"":w,x=e.dirty,C=e.loading,k=e.invalid,S=e.incorrect,L=e.fieldReadonly,N=e.withContextMenu,I=e.tr,M=void 0===I?function(e){return e.toString()}:I,R=e.onChange;return f.createElement(Su,{value:t,disabled:n,readonly:r,description:i,placeholder:l,outlined:u,itemList:d,noDeselect:b,virtualListBox:v,watchItemList:g,labelShrink:y,freeSolo:p,title:E,dirty:x,invalid:k,loading:C,incorrect:S,fieldReadonly:L,withContextMenu:N,tr:M,onChange:R})};Lu.displayName="ComboField";var Nu=Xo(Lu,{withApplyQueue:!0,skipDebounce:!0,skipDirtyClickListener:!0,skipFocusReadonly:!0}),Iu=function(e){var t=v(nu).Items;return f.createElement(t,a({},e))},Mu=function(e){var t=e.value,n=e.disabled,r=e.readonly,o=e.description,i=e.placeholder,a=e.loading,l=e.outlined,c=void 0!==l&&l,u=e.itemList,s=void 0===u?[]:u,d=e.freeSolo,m=void 0!==d&&d,p=e.virtualListBox,h=void 0===p||p,v=e.labelShrink,g=e.watchItemList,b=e.noDeselect,y=e.dirty,w=e.invalid,E=e.incorrect,x=e.title,C=e.fieldReadonly,k=e.withContextMenu,S=e.tr,L=void 0===S?function(e){return e.toString()}:S,N=e.onChange;return f.createElement(Iu,{value:t,disabled:n,readonly:r,loading:a,fieldReadonly:C,description:o,placeholder:i,outlined:c,itemList:s,noDeselect:b,labelShrink:v,virtualListBox:h,watchItemList:g,freeSolo:m,dirty:y,invalid:w,incorrect:E,title:x,tr:L,onChange:N,withContextMenu:k})};Mu.displayName="ItemsField";var Ru=Xo(Mu,{withApplyQueue:!0,skipDebounce:!0,skipDirtyClickListener:!0,skipFocusReadonly:!0}),Pu=function(e){var t=v(nu).Rating;return f.createElement(t,a({},e))},Au=function(e){var t=e.value,n=e.disabled,r=e.readonly,o=e.name,i=e.onChange;return f.createElement(Pu,{value:t,disabled:n,readonly:r,name:o,onChange:i})};Au.displayName="RatingField";var Tu=Xo(Au,{withApplyQueue:!0,skipDebounce:!0,skipDirtyClickListener:!0,skipFocusReadonly:!0}),Du=function(e){var t=v(nu).Typography;return f.createElement(t,a({},e))},ju=function(e){var t=e.value,n=void 0===t?"":t,r=e.placeholder,o=void 0===r?"":r,i=e.typoVariant,a=void 0===i?"body1":i,l=e.style;return f.createElement(Du,{value:n,placeholder:o,typoVariant:a,style:l})};ju.displayName="TypographyField";var Ou=Xo(ju,{skipFocusBlurCall:!0}),Fu=function(e){var t=v(nu).Date;return f.createElement(t,a({},e))},_u=function(e){var t=e.invalid,n=e.incorrect,r=e.value,o=e.disabled,i=e.readonly,a=e.description,l=void 0===a?"":a,c=e.outlined,u=void 0!==c&&c,s=e.title,d=void 0===s?"":s,m=e.placeholder,p=void 0===m?d:m,h=e.labelShrink,v=e.dirty,g=e.autoFocus,b=e.inputRef,y=e.onChange,w=e.withContextMenu,E=e.name;return f.createElement(Fu,{autoFocus:g,inputRef:b,invalid:t,incorrect:n,value:r,readonly:i,disabled:o,description:l,outlined:u,labelShrink:h,title:d,placeholder:p,withContextMenu:w,dirty:v,onChange:y,name:E})};_u.displayName="DateField";var Bu=Xo(_u,{withApplyQueue:!0,skipDebounce:!0,skipDirtyClickListener:!0,skipFocusBlurCall:!0}),Hu=function(e){var t=v(nu).Time;return f.createElement(t,a({},e))},Wu=function(e){var t=e.invalid,n=e.incorrect,r=e.value,o=e.disabled,i=e.readonly,a=e.labelShrink,l=e.description,c=void 0===l?"":l,u=e.outlined,s=void 0!==u&&u,d=e.title,m=void 0===d?"":d,p=e.placeholder,h=void 0===p?m:p,v=e.dirty,g=e.autoFocus,b=e.inputRef,y=e.onChange,w=e.name,E=e.withContextMenu;return f.createElement(Hu,{autoFocus:g,inputRef:b,invalid:t,incorrect:n,value:r,readonly:i,disabled:o,labelShrink:a,description:c,outlined:s,title:m,placeholder:h,dirty:v,onChange:y,name:w,withContextMenu:E})};Wu.displayName="TimeField";var zu=Xo(Wu,{withApplyQueue:!0,skipDebounce:!0,skipDirtyClickListener:!0,skipFocusBlurCall:!0}),Vu=function(e){var t=v(nu).File;return f.createElement(t,a({},e))},Yu=function(e){var t=e.invalid,n=e.value,r=e.disabled,o=e.readonly,i=e.description,a=void 0===i?"":i,l=e.outlined,c=void 0!==l&&l,u=e.title,s=void 0===u?"":u,d=e.placeholder,m=void 0===d?"":d,p=e.incorrect,h=e.upload,v=e.view,g=e.dirty,b=e.labelShrink,y=e.loading,w=e.onChange,E=e.inputRef,x=e.tr,C=e.name;return f.createElement(Vu,{inputRef:E,invalid:t,incorrect:p,value:n,readonly:o,disabled:r,description:a,outlined:c,labelShrink:b,title:s,placeholder:m,upload:h,view:v,tr:x,dirty:g,loading:y,onChange:w,name:C})};Yu.displayName="FileField";var Uu=Xo(Yu,{withApplyQueue:!0,skipDirtyClickListener:!0,skipDebounce:!0,skipFocusBlurCall:!0}),qu=function(e){var t=v(nu).Choose;return f.createElement(t,a({},e))},$u=function(e){var t=e.invalid,n=e.value,r=e.disabled,o=e.readonly,i=e.incorrect,a=e.description,l=void 0===a?"":a,c=e.outlined,u=void 0!==c&&c,s=e.title,d=void 0===s?"":s,m=e.placeholder,p=void 0===m?"":m,h=e.labelShrink,v=e.choose,g=e.tr,b=e.dirty,y=e.loading,w=e.onChange,E=e.inputRef,x=e.name,C=e.withContextMenu;return f.createElement(qu,{inputRef:E,invalid:t,incorrect:i,value:n,readonly:o,disabled:r,labelShrink:h,description:l,outlined:u,title:d,placeholder:p,withContextMenu:C,choose:v,tr:g,dirty:b,loading:y,onChange:w,name:x})};$u.displayName="ChooseField";var Xu=Xo($u,{withApplyQueue:!0,skipDirtyClickListener:!0,skipFocusReadonly:!0,skipFocusBlurCall:!0,skipDebounce:!0}),Gu=function(e){var t=v(nu).Tree;return f.createElement(t,a({},e))},Ku=function(e){var t=e.invalid,n=e.value,r=e.disabled,o=e.readonly,i=e.incorrect,a=e.description,l=void 0===a?"":a,c=e.outlined,u=void 0!==c&&c,s=e.title,d=void 0===s?"":s,m=e.placeholder,p=void 0===m?"":m,h=e.itemTree,v=e.dirty,g=e.loading,b=e.onChange,y=e.name,w=e.withContextMenu,E=e.watchItemTree;return f.createElement(Gu,{invalid:t,incorrect:i,value:n,readonly:o,disabled:r,description:l,outlined:u,watchItemTree:E,title:d,placeholder:p,withContextMenu:w,itemTree:h,dirty:v,loading:g,onChange:b,name:y})};Ku.displayName="TreeField";var Qu=Xo(Ku,{withApplyQueue:!0,skipDirtyClickListener:!0,skipFocusReadonly:!0,skipDebounce:!0}),Ju=function(e){var t=v(nu).Complete;return f.createElement(t,a({},e))},Zu=function(e){var t=e.invalid,n=e.incorrect,r=e.value,o=e.disabled,i=e.readonly,a=e.inputType,l=void 0===a?"text":a,c=e.description,u=void 0===c?"":c,s=e.outlined,d=void 0!==s&&s,m=e.keepRaw,p=void 0!==m&&m,h=e.title,v=void 0===h?"":h,g=e.labelShrink,b=e.tip,y=e.tipSelect,w=e.placeholder,E=void 0===w?"":w,x=e.inputAutocomplete,C=void 0===x?"off":x,k=e.dirty,S=e.loading,L=e.onChange,N=e.autoFocus,I=e.inputRef,M=e.name,R=e.inputFormatter,P=e.inputFormatterAllowed,A=e.inputFormatterReplace,T=e.inputFormatterSymbol,D=e.inputFormatterTemplate,j=e.fieldReadonly,O=e.withContextMenu;return f.createElement(Ju,{autoFocus:N,inputRef:I,invalid:t,incorrect:n,value:r,readonly:i,disabled:o,inputType:l,description:u,withContextMenu:O,outlined:d,keepRaw:p,fieldReadonly:j,labelShrink:g,title:v,tip:b,tipSelect:y,placeholder:E,inputAutocomplete:C,dirty:k,loading:S,onChange:L,name:M,inputFormatter:R,inputFormatterAllowed:P,inputFormatterReplace:A,inputFormatterSymbol:T,inputFormatterTemplate:D})};Zu.displayName="CompleteField";var es=Xo(Zu),ts=function(e){var t=v(nu).YesNo;return f.createElement(t,a({},e))},ns=function(e){var t=e.value,n=e.disabled,r=e.readonly,o=e.description,i=void 0===o?"":o,a=e.placeholder,l=void 0===a?"":a,c=e.outlined,u=void 0!==c&&c,s=e.virtualListBox,d=void 0===s||s,m=e.noDeselect,p=e.labelShrink,h=e.title,v=void 0===h?"":h,g=e.tr,b=e.dirty,y=e.invalid,w=e.incorrect,E=e.onChange;return f.createElement(ts,{value:t,disabled:n,readonly:r,description:i,placeholder:l,outlined:u,noDeselect:m,virtualListBox:d,labelShrink:p,tr:g,title:v,dirty:b,invalid:y,incorrect:w,onChange:E})};ns.displayName="YesNoField";var rs=Xo(ns,{withApplyQueue:!0,skipDebounce:!0,skipDirtyClickListener:!0,skipFocusReadonly:!0}),os=function(e){var t=v(nu).Dict;return f.createElement(t,a({},e))},is=function(e){var t=e.invalid,n=e.incorrect,r=e.value,o=e.disabled,i=e.readonly,a=e.inputType,l=void 0===a?"text":a,c=e.inputAutocomplete,u=e.description,s=void 0===u?"":u,d=e.outlined,m=void 0!==d&&d,p=e.title,h=void 0===p?"":p,v=e.placeholder,g=void 0===v?"":v,b=e.dirty,y=e.loading,w=e.onChange,E=e.dictLimit,x=e.dictDelay,C=e.dictSearch,k=e.dictOnAppend,S=e.dictOnText,L=e.dictOnItem,N=e.dictValue,I=e.dictSearchText,M=e.dictSearchItem,R=e.dictCreateButton,P=e.inputMode,A=e.inputPattern,T=e.groupRef,D=e.inputRef,j=e.inputFormatter,O=e.inputFormatterAllowed,F=e.inputFormatterReplace,_=e.inputFormatterSymbol,B=e.inputFormatterTemplate,H=e.name,W=e.leadingIcon,z=e.trailingIcon,V=e.leadingIconClick,Y=e.trailingIconClick,U=e.leadingIconRipple,q=e.trailingIconRipple,$=e.leadingIconTabIndex,X=e.trailingIconTabIndex;return f.createElement(os,{inputRef:D,groupRef:T,invalid:t,incorrect:n,value:r,readonly:i,disabled:o,inputType:l,description:s,inputAutocomplete:c,outlined:m,title:h,placeholder:g,dirty:b,loading:y,dictLimit:E,dictDelay:x,dictSearch:C,dictOnAppend:k,dictOnText:S,dictOnItem:L,dictValue:N,dictSearchText:I,dictSearchItem:M,dictCreateButton:R,inputMode:P,inputPattern:A,onChange:w,name:H,inputFormatter:j,inputFormatterAllowed:O,inputFormatterReplace:F,inputFormatterSymbol:_,inputFormatterTemplate:B,leadingIcon:W,trailingIcon:z,leadingIconClick:V,trailingIconClick:Y,leadingIconRipple:U,trailingIconRipple:q,leadingIconTabIndex:$,trailingIconTabIndex:X})};is.displayName="DictField";var as=Xo(is,{withApplyQueue:!1,skipDirtyClickListener:!0,skipFocusReadonly:!0,skipDebounce:!0}),ls=function(e){var t=v(nu).Button;return f.createElement(t,a({},e))},cs=function(e){var t=e.disabled,n=e.click,r=e.icon,o=e.title,i=e.value,a=e.buttonSize,l=e.buttonVariant,c=e.buttonColor,u=e.placeholder;return f.createElement(ls,{disabled:t,click:n,icon:r,title:o,value:i,buttonVariant:l,buttonColor:c,buttonSize:a,placeholder:u})};cs.displayName="ButtonField";var us=Xo(cs,{skipClickListener:!0,withApplyQueue:!0,skipDebounce:!0,skipDirtyClickListener:!0}),ss=function(e){var t=v(nu).Icon;return f.createElement(t,a({},e))},ds=function(e){var t=e.disabled,n=e.click,r=e.icon,o=e.iconSize,i=e.iconColor,a=e.iconBackground;return f.createElement(ss,{iconSize:o,iconColor:i,iconBackground:a,click:n,disabled:t,icon:r})};ds.displayName="IconField";var fs,ms=Xo(ds,{skipClickListener:!0,withApplyQueue:!0,skipDebounce:!0,skipDirtyClickListener:!0}),ps=Object.create(null);Object.assign(ps,((fs={})[Dn.Component]=li,fs[Dn.Text]=au,fs[Dn.Line]=uu,fs[Dn.Radio]=fu,fs[Dn.Switch]=hu,fs[Dn.Checkbox]=bu,fs[Dn.Progress]=Eu,fs[Dn.Slider]=ku,fs[Dn.Combo]=Nu,fs[Dn.Items]=Ru,fs[Dn.Rating]=Tu,fs[Dn.Typography]=Ou,fs[Dn.Date]=Bu,fs[Dn.Time]=zu,fs[Dn.File]=Uu,fs[Dn.Choose]=Xu,fs[Dn.Complete]=es,fs[Dn.YesNo]=rs,fs[Dn.Init]=function(){return null},fs[Dn.Dict]=as,fs[Dn.Tree]=Qu,fs[Dn.Button]=us,fs[Dn.Icon]=ms,fs));var hs=function(e,t){void 0===t&&(t="");var n,r=e.type;if(n=ps[r])return f.createElement(n,a({},e,{key:t}));throw new Error("FieldFactory unknown key type")},vs=An()(function(e){return{heading:{fontSize:e.typography.pxToRem(15),flexBasis:"33.33%",flexShrink:0},secondaryHeading:{fontSize:e.typography.pxToRem(15),color:e.palette.text.secondary}}}),gs=function(t){var n=t.title,r=void 0===n?"":n,o=t.description,i=void 0===o?"":o,a=t.className,l=void 0===a?"":a,c=t.columnsOverride,u=t.isBaselineAlign,s=t.sx,d=t.style,m=t.children,p=t.expansionOpened,h=void 0!==p&&p,v=vs().classes,b=e(g(h),2),y=b[0],w=b[1];return f.createElement(Q,{sx:s,expanded:y,onChange:function(){return w(!y)},className:l,style:d},f.createElement(J,{sx:{pointerEvents:"all"},expandIcon:f.createElement(it,null)},f.createElement(X,{className:v.heading},r),f.createElement(X,{className:v.secondaryHeading},i)),f.createElement(Z,null,f.createElement(Po,{isBaselineAlign:u,columnsOverride:c},m)))};gs.displayName="Expansion";var bs=An()({hidden:{display:"none !important"},disabled:{pointerEvents:"none"},readonly:{pointerEvents:"none"}}),ys=function(){return!0},ws=function(){return!1},Es=function(){return!1};function xs(t){var n=C(t),r=function(t){var r,o=t.className,i=t.children,c=t.object,u=t.isVisible,s=void 0===u?ys:u,d=t.isReadonly,m=void 0===d?ws:d,p=t.isDisabled,v=void 0===p?Es:p,b=t.disabled,y=void 0!==b&&b,E=t.readonly,x=void 0!==E&&E,C=t.phoneHidden,k=t.tabletHidden,S=t.desktopHidden,N=t.ready,I=l(t,["className","children","object","isVisible","isReadonly","isDisabled","disabled","readonly","phoneHidden","tabletHidden","desktopHidden","ready"]),M=bs().classes,R=Ir(),P=Ur().object,A=h(function(){var e="function"==typeof C?C(R):C,t="function"==typeof k?k(R):k,n="function"==typeof S?S(R):S;return{phoneHidden:e,tabletHidden:t,desktopHidden:n,hasHiddenConstraint:e||t||n}},[]),T=A.phoneHidden,D=A.tabletHidden,j=A.desktopHidden,O=A.hasHiddenConstraint?tl():{},F=O.isPhone,_=void 0!==F&&F,B=O.isTablet,H=void 0!==B&&B,W=O.isDesktop,z=void 0!==W&&W,V=P||c,Y=function(){var t=e(g(function(){return{readonly:!1,visible:!1,disabled:!1}}),2),n=t[0],r=t[1];return{state:n,action:h(function(){return{setDisabled:function(e){return r(function(t){return a(a({},t),{disabled:e})})},setReadonly:function(e){return r(function(t){return a(a({},t),{readonly:e})})},setVisible:function(e){return r(function(t){return a(a({},t),{visible:e})})}}},[])}}(),U=Y.state,q=U.disabled,$=U.readonly,X=U.visible,G=Y.action,K=G.setDisabled,Q=G.setReadonly,J=G.setVisible;w(function(){var e=v(V,R),t=s(V,R),n=m(V,R);Q(n),K(e),J(t),!t&&N()},[V]);return X?T&&_||D&&H||j&&z?null:f.createElement(n,a({className:Eo(o,(r={},r[M.disabled]=q||y,r[M.readonly]=$||x,r[M.hidden]=!X,r)),ready:N,object:V},I),q||y?f.Children.map(i,function(e){return L(e,{disabled:!0})}):$||x?f.Children.map(i,function(e){return L(e,{readonly:!0})}):i):null};return r.displayName="Wrapped".concat(t.displayName||"UnknownLayout"),C(r)}var Cs=An()(function(e){return{root:{position:"relative",display:"flex",alignItems:"stretch",justifyContent:"stretch"},content:{flexGrow:1,width:"100%"},outlinePaper:{background:"transparent",boxShadow:"none !important",border:"1px solid ".concat($(e.palette.getContrastText(e.palette.background.default),.23)),borderRadius:"4px"},transparentPaper:{background:"transparent"}}}),ks=function(e){var t,n=e.columns,r=e.columnsOverride,o=e.sx,i=e.phoneColumns,a=e.tabletColumns,l=e.desktopColumns,c=e.isBaselineAlign,u=e.fieldRightMargin,s=void 0===u?"0":u,d=e.fieldBottomMargin,m=void 0===d?"0":d,p=e.style,h=e.className,v=e.children,g=e.title,b=e.testId,y=e.description,w=e.expansionOpened,E=e.outlinePaper,x=e.transparentPaper,C=Cs().classes;return f.createElement(Po,{className:Eo(h,C.root),"data-testid":b,style:p,sx:o,isItem:!0,columns:n,phoneColumns:i,tabletColumns:a,desktopColumns:l,fieldRightMargin:s,fieldBottomMargin:m},f.createElement(gs,{className:Eo(C.content,(t={},t[C.outlinePaper]=E&&!x,t[C.transparentPaper]=!E&&x,t)),columnsOverride:r,expansionOpened:w,title:g,isBaselineAlign:c,description:y},v))};ks.displayName="ExpansionLayout";var Ss=xs(ks),Ls=An()({stretch:{position:"relative",display:"flex",alignItems:"stretch",justifyContent:"stretch"},content:{flexGrow:1,width:"100%"}}),Ns=function(e){var t=e.className,n=void 0===t?"":t,r=e.style,o=e.children,i=e.columnsOverride,a=e.isBaselineAlign,l=e.sx,c=Ls().classes;return f.createElement(ee,{sx:l,className:Eo(n,c.stretch),style:r},f.createElement(te,{className:c.content},f.createElement(Po,{columnsOverride:i,isBaselineAlign:a,fieldBottomMargin:"0",fieldRightMargin:"0"},o)))};Ns.displayName="Paper";var Is=An()({baselineAdjust:{width:"100%"}}),Ms=function(){var e=Is().classes;return f.createElement("div",{className:Eo(e.baselineAdjust,"react-declarative__oneBaselineAdjust")})},Rs=An()(function(e){return{stretch:{position:"relative",display:"flex",alignItems:"stretch",justifyContent:"stretch",border:"1px solid ".concat(A(e.palette.getContrastText(e.palette.background.default),.23)),borderRadius:"4px"},content:{flexGrow:1,width:"100%"}}}),Ps=function(e){var t=e.className,n=void 0===t?"":t,r=e.columnsOverride,o=e.style,i=e.children,a=e.isBaselineAlign,l=e.sx,c=Rs().classes;return f.createElement(te,{className:Eo(n,c.stretch),sx:l,style:o},f.createElement(te,{className:c.content},f.createElement(Po,{isBaselineAlign:a,columnsOverride:r,fieldBottomMargin:"0",fieldRightMargin:"0"},i)))};Ps.displayName="Outline";var As=An()({stretch:{position:"relative",display:"flex",alignItems:"stretch",justifyContent:"stretch"},content:{flexGrow:1,width:"100%"}}),Ts=function(e){var t=e.className,n=void 0===t?"":t,r=e.columnsOverride,o=e.style,i=e.children,a=e.isBaselineAlign,l=e.sx,c=As().classes;return f.createElement(te,{className:Eo(n,c.stretch),sx:l,style:o},f.createElement(te,{className:c.content},f.createElement(Po,{isBaselineAlign:a,columnsOverride:r,fieldBottomMargin:"0",fieldRightMargin:"0"},i)))};Ts.displayName="Outline";var Ds=An()({root:{position:"relative",display:"flex",alignItems:"stretch",justifyContent:"stretch"},content:{flexGrow:1,width:"100%"}}),js=function(e){var t=e.columns,n=e.columnsOverride,r=e.sx,o=e.phoneColumns,i=e.tabletColumns,a=e.desktopColumns,l=e.style,c=e.className,u=e.children,s=e.testId,d=e.isBaselineAlign,m=e.fieldRightMargin,p=void 0===m?"0":m,h=e.fieldBottomMargin,v=void 0===h?"0":h,g=e.innerPadding,b=void 0===g?"18px":g,y=e.outlinePaper,w=void 0!==y&&y,E=e.transparentPaper,x=void 0!==E&&E,C=Ds().classes;return f.createElement(Po,{className:Eo(c,C.root),"data-testid":s,style:l,sx:r,isItem:!0,columns:t,phoneColumns:o,tabletColumns:i,desktopColumns:a,fieldRightMargin:p,fieldBottomMargin:v},S(x?Ts:w?Ps:Ns,{className:C.content,columnsOverride:n,isBaselineAlign:d,style:{padding:b},children:f.createElement(f.Fragment,null,u,f.createElement(Ms,null))}))};js.displayName="PaperLayout";var Os=xs(js),Fs=An()({root:{position:"relative",display:"flex",alignItems:"stretch",justifyContent:"stretch"},content:{flexGrow:1,width:"100%"}}),_s=function(e){var t=e.columns,n=e.columnsOverride,r=e.sx,o=e.phoneColumns,i=e.tabletColumns,a=e.desktopColumns,l=e.style,c=e.className,u=e.children,s=e.testId,d=e.isBaselineAlign,m=e.fieldRightMargin,p=void 0===m?"0":m,h=e.fieldBottomMargin,v=void 0===h?"0":h,g=e.innerPadding,b=void 0===g?"18px":g,y=Fs().classes;return f.createElement(Po,{className:Eo(c,y.root),"data-testid":s,style:l,sx:r,isItem:!0,columns:t,phoneColumns:o,tabletColumns:i,desktopColumns:a,fieldRightMargin:p,fieldBottomMargin:v},f.createElement(Ps,{className:y.content,isBaselineAlign:d,columnsOverride:n,style:{padding:b}},u,f.createElement(Ms,null)))};_s.displayName="OutlineLayout";var Bs=xs(_s),Hs=An()({root:{position:"relative",display:"flex",alignItems:"stretch",justifyContent:"stretch"},content:{flexGrow:1,width:"100%"}}),Ws=function(e){var t=e.columns,n=e.columnsOverride,r=e.sx,o=e.phoneColumns,i=e.tabletColumns,a=e.desktopColumns,l=e.isBaselineAlign,c=e.fieldRightMargin,u=void 0===c?"0":c,s=e.fieldBottomMargin,d=void 0===s?"0":s,m=e.style,p=e.testId,h=e.className,v=e.children,g=Hs().classes;return f.createElement(Po,{className:Eo(h,g.root),"data-testid":p,style:m,sx:r,isItem:!0,columns:t,phoneColumns:o,tabletColumns:i,desktopColumns:a,fieldRightMargin:u,fieldBottomMargin:d},f.createElement(Po,{className:g.content,isBaselineAlign:l,columnsOverride:n},v,f.createElement(Ms,null)))};Ws.displayName="GroupLayout";var zs=xs(Ws),Vs=function(t){var n=t.children,r=t.isVisible,o=void 0===r?function(){return!0}:r,i=t.ready,a=e(g(!1),2),l=a[0],c=a[1],u=Ir(),s=Ur().object;return w(function(){if(s){var e=o(s,u);c(e)}i()},[s]),l?f.createElement(k,null,n):f.createElement(k,null)};Vs.displayName="FragmentLayout";var Ys=function(e){var t=e.children,n=e.className,r=e.style,o=e.testId;return f.createElement("div",{className:n,style:r,"data-testid":o},t)};Ys.displayName="DivLayout";var Us=xs(Ys),qs=function(e){var t=e.children,n=e.className,r=e.style,o=e.sx,i=e.testId;return f.createElement(j,{className:n,style:r,sx:o,"data-testid":i},t)};qs.displayName="BoxLayout";var $s=xs(qs),Xs=An()(function(e,t,n){var r;return{root:{position:"relative",display:"flex",alignItems:"stretch",justifyContent:"stretch",overflow:"hidden","& > *":{flex:1}},keepFlow:(r={overflow:"initial !important"},r["& .".concat(n.container)]={position:"static !important"},r["& .".concat(n.content)]={overflow:"hidden !important"},r),minSize:{minWidth:225,minHeight:225},container:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column","& > *":{flex:1}},tabs:{maxHeight:48},content:{display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column",overflowY:"auto","& > *":{flex:1}},line:{background:A(e.palette.getContrastText(e.palette.background.default),.23),maxHeight:2,marginTop:-2},background:{background:A("#000",.05)}}}),Gs=function(t){var n,r,o=t.children,i=t.className,l=t.style,c=t.tabChange,u=t.tabVariant,s=void 0===u?"fullWidth":u,d=t.tabLine,m=void 0!==d&&d,p=t.tabColor,v=void 0===p?"primary":p,b=t.tabList,y=void 0===b?["Empty"]:b,w=t.tabKeepFlow,E=void 0!==w&&w,x=t.tabBackground,C=void 0!==x&&x,k=t.tabIndex,S=void 0===k?0:k,L=t.columns,N=t.columnsOverride,I=t.isBaselineAlign,M=t.sx,R=t.testId,P=t.phoneColumns,A=t.tabletColumns,T=t.desktopColumns,D=t.fieldRightMargin,O=void 0===D?"0":D,F=t.fieldBottomMargin,_=void 0===F?"0":F,B=Xs().classes,H=e(g(S),2),W=H[0],z=H[1],V=h(function(){return Array(y.length).fill({}).reduce(function(e,t,n){var r;return a(((r={})["& > *:nth-of-type(".concat(n+1,")")]={display:W===n?"inherit":"none !important"},r),e)},{})},[W]);return f.createElement(Po,{className:i,style:l,isItem:!0,columns:L,"data-testid":R,columnsOverride:N,isBaselineAlign:I,phoneColumns:P,tabletColumns:A,desktopColumns:T,fieldRightMargin:O,fieldBottomMargin:_,sx:M},f.createElement(j,{className:Eo(B.root,(n={},n[B.keepFlow]=E,n[B.minSize]=!E,n))},f.createElement(j,{className:B.container},f.createElement(lt,{value:W,indicatorColor:v,textColor:v,variant:s,onChange:function(e,t){c&&c(t),z(t)},className:Eo(B.tabs,"react-declarative__tabsLayoutHeader")},y.map(function(e,t){return f.createElement(at,{key:t,label:e})})),m&&f.createElement(j,{className:B.line}),f.createElement(j,{className:Eo(B.content,(r={},r[B.background]=C,r)),sx:V},o))))};Gs.displayName="TabsLayout";var Ks=xs(Gs),Qs=An()({root:{display:"flex",alignItems:"stretch",justifyContent:"stretch"},container:{minWidth:1,overflowY:"auto",display:"flex",alignItems:"stretch",justifyContent:"stretch",flex:1},content:{overflow:"hidden",flex:1,minHeight:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},hidden:{visibility:"hidden"}}),Js=function(t){var n,r=t.children,o=t.className,i=t.style,a=t.innerPadding,l=void 0===a?"0px":a,c=t.columns,u=t.phoneColumns,s=t.tabletColumns,d=t.desktopColumns,m=t.columnsOverride,p=t.isBaselineAlign,h=t.testId,v=t.sx,y=t.fieldRightMargin,x=void 0===y?"0":y,C=t.fieldBottomMargin,k=void 0===C?"0":C,S=Qs().classes,L=e(g(),2),N=L[0],I=L[1],M=e(g(0),2),R=M[0],P=M[1],A=e(g(!0),2),T=A[0],D=A[1],j=bi(),O=j.elementRef,F=j.size,_=b(!0);E(function(){return function(){_.current=!1}},[]),w(function(){var e=function(e){if(void 0===e&&(e=!1),N&&_.current){var t=N.getBoundingClientRect(),n=t.width,r=t.left,o=0;N.querySelectorAll(":scope > *").forEach(function(e){return o=Math.max(o,e.getBoundingClientRect().right)});var i=Math.min(o-r-n,0);P(i),e&&D(!1)}},t=ne(function(){return e(!0)},250),n=new MutationObserver(t),r=new ResizeObserver(t);return N&&(n.observe(N,{childList:!0,subtree:!0}),r.observe(N),window.addEventListener("resize",t),e(),t()),function(){t.clear(),n.disconnect(),N&&r.unobserve(N),window.removeEventListener("resize",t),r.disconnect()}},[N]);return f.createElement(Po,{className:o,style:i,sx:v,isItem:!0,"data-testid":h,columns:c,phoneColumns:u,tabletColumns:s,desktopColumns:d,fieldRightMargin:x,fieldBottomMargin:k},f.createElement("div",{ref:O,className:S.root},f.createElement("div",{className:Eo(S.container,(n={},n[S.hidden]=T,n))},f.createElement("div",{className:S.content,style:{padding:l}},f.createElement("div",{style:{marginRight:R,width:R?F.width:"100%"}},f.createElement(Po,{columnsOverride:m,isBaselineAlign:p,ref:function(e){return I(e)}},r))))))};Js.displayName="CenterLayout";var Zs=xs(Js),ed=An()({root:{position:"relative",overflowY:"auto",width:"100%",height:"100%",flex:1},container:{position:"absolute",top:0,left:0,right:0,minHeight:"100%",display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column","& > *":{flex:1}}}),td=function(e){var t=e.children,n=e.className,r=e.style,o=e.testId,i=e.innerPadding,a=void 0===i?"0px":i,l=ed().classes;return f.createElement("div",{className:Eo(l.root,n),"data-testid":o,style:r},f.createElement("div",{className:l.container,style:{padding:a}},t))};td.displayName="StretchLayout";var nd=xs(td),rd="0px",od="100%",id="unset",ad=An()({root:{position:"relative",display:"flex",alignItems:"stretch",justifyContent:"stretch"},container:{flexGrow:1,width:"100%"},content:{flex:1,position:"relative",overflow:"hidden"},item:{position:"absolute",display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *":{flexGrow:1}}}),ld=function(e,t){return matchMedia("(min-width: ".concat(e,"px) and (max-width: ").concat(t,"px)")).matches},cd=function(r){var o=r.className,i=r.bpoints,l=r.height,c=r.width,u=r.registry,s=r.children,d=r.object,m=r.element,p=e(g({}),2),h=p[0],v=p[1],y=e(g({}),2),w=y[0],x=y[1],C=function(e){var t=e.xs,n=void 0===t?0:t,r=e.sm,o=void 0===r?600:r,i=e.lg,a=void 0===i?1280:i;return{isPhone:ld(n,o),isTablet:ld(o,a),isDesktop:ld(a,1e16)}}(i),k=C.isDesktop,S=C.isTablet,L=C.isPhone,N=b(!0);return E(function(){return function(){N.current=!1}},[]),E(function(){t(void 0,void 0,void 0,function(){var e,t,r;return n(this,function(n){switch(n.label){case 0:return m?(e=a(a(a(a({},k&&(u.heroOuterDesktopStyle||u.heroOuterStyle)),S&&(u.heroOuterTabletStyle||u.heroOuterStyle)),L&&(u.heroOuterPhoneStyle||u.heroOuterStyle)),!L&&!S&&!k&&u.heroOuterStyle),t=a(a(a(a({},k&&(u.heroInnerDesktopStyle||u.heroInnerStyle)),S&&(u.heroInnerTabletStyle||u.heroInnerStyle)),L&&(u.heroInnerPhoneStyle||u.heroInnerStyle)),!L&&!S&&!k&&u.heroInnerStyle),[4,(o=m,new Promise(function(e){var t=setInterval(function(){var n=o.getBoundingClientRect(),r=n.height,i=n.width;return document.body.contains(o)?r||i?(clearInterval(t),void e()):void 0:(clearInterval(t),void e())},50)}))]):[2];case 1:if(n.sent(),r=function(e){if("function"==typeof e){var t=m.getBoundingClientRect(),n=t.height,r=t.width;return e(d,{height:n,width:r},m)}return e},k)e.minHeight=r(u.desktopMinHeight||u.minHeight||id),e.maxHeight=r(u.desktopMaxHeight||u.maxHeight||id),e.minWidth=r(u.desktopMinWidth||u.minWidth||id),e.maxWidth=r(u.desktopMaxWidth||u.maxWidth||id),e.height=r(u.desktopHeight||u.height||od),e.width=r(u.desktopWidth||u.width||od),t.top=r(u.desktopTop||u.top||rd),t.left=r(u.desktopLeft||u.left||rd),t.right=r(u.desktopRight||u.right||rd),t.bottom=r(u.desktopBottom||u.bottom||rd);else if(S)e.minHeight=r(u.tabletMinHeight||u.minHeight||id),e.maxHeight=r(u.tabletMaxHeight||u.maxHeight||id),e.minWidth=r(u.tabletMinWidth||u.minWidth||id),e.maxWidth=r(u.tabletMaxWidth||u.maxWidth||id),e.height=r(u.tabletHeight||u.height||od),e.width=r(u.tabletWidth||u.width||od),t.top=r(u.tabletTop||u.top||rd),t.left=r(u.tabletLeft||u.left||rd),t.right=r(u.tabletRight||u.right||rd),t.bottom=r(u.tabletBottom||u.bottom||rd);else{if(!L)throw new Error("HeroLayout invalid media query");e.minHeight=r(u.phoneMinHeight||u.minHeight||id),e.maxHeight=r(u.phoneMaxHeight||u.maxHeight||id),e.minWidth=r(u.phoneMinWidth||u.minWidth||id),e.maxWidth=r(u.phoneMaxWidth||u.maxWidth||id),e.height=r(u.phoneHeight||u.height||od),e.width=r(u.phoneWidth||u.width||od),t.top=r(u.phoneTop||u.top||rd),t.left=r(u.phoneLeft||u.left||rd),t.right=r(u.phoneRight||u.right||rd),t.bottom=r(u.phoneBottom||u.bottom||rd)}return N.current&&(v(e),x(t)),[2]}var o})})},[d,c,l,m]),f.createElement("div",{style:h},f.createElement("div",{className:o,style:w},s))},ud=function(t){var n=t.children,r=t.className,o=t.style,i=t.object,a=t.columns,c=t.columnsOverride,u=t.isBaselineAlign,s=t.testId,d=t.sx,m=t.phoneColumns,p=t.tabletColumns,h=t.desktopColumns,v=l(t,["children","className","style","object","columns","columnsOverride","isBaselineAlign","testId","sx","phoneColumns","tabletColumns","desktopColumns"]),b=M().breakpoints.values,y=e(g(null),2),w=y[0],E=y[1],x=ad().classes,C=bi({target:document.body}),k=C.elementRef,S=C.size;return f.createElement(Po,{className:Eo(r,x.root),"data-testid":s,ref:function(e){return E(e)},style:o,sx:d,isItem:!0,columns:a,phoneColumns:m,tabletColumns:p,desktopColumns:h,fieldRightMargin:"0",fieldBottomMargin:"0"},f.createElement(Po,{className:x.container,isBaselineAlign:u,columnsOverride:c},f.createElement("div",{ref:k,className:x.content},f.createElement(cd,{element:w,className:x.item,bpoints:b,height:S.height,width:S.width,registry:v,object:i},n))))};ud.displayName="HeroLayout";var sd=xs(ud),dd=function(e){var t="async";return Promise.resolve(e).then(function(){return t="sync"}),t},fd=function(e){var t=null;return Promise.resolve(e).then(function(e){return t=e}),t},md=function(o){var i=o.Else,a=void 0===i?null:i,l=o.Loading,c=void 0===l?a:l,u=o.children,s=o.condition,d=o.fallback,m=o.onLoadStart,p=o.onLoadEnd,h=o.payload,v=o.deps,y=void 0===v?[]:v,x=o.throwError,C=void 0!==x&&x,k=e(g(function(){return function(e,t){var n=!1;if("function"==typeof e){var r=e(t);n=fd(r)}return!!n}(s,h)}),2),S=k[0],L=k[1],N=e(g(0),2),I=N[0],M=N[1],R=b(null),P=b(!0);E(function(){return function(){P.current=!1}},[]);var A=zr(s);return w(function(){var e=A.current;R.current&&R.current.cancel();var r=Xn(function(){return t(void 0,void 0,void 0,function(){var t,r;return n(this,function(n){switch(n.label){case 0:t=!0,M(function(e){return e+1}),m&&m(),n.label=1;case 1:return n.trys.push([1,5,6,7]),"function"!=typeof e?[3,3]:[4,Promise.resolve(e(h))];case 2:return[2,n.sent()];case 3:return[2,e];case 4:return[3,7];case 5:throw r=n.sent(),t=!1,r;case 6:return function(e){M(function(e){return e-1}),p&&p(e)}(t),[7];case 7:return[2]}})})});R.current=r;t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,r()];case 1:return(e=n.sent())===$n?[2]:(R.current=null,P.current&&L(e),[3,3]);case 2:if(t=n.sent(),P.current&&L(!1),C)throw t;return d&&d(t),[3,3];case 3:return[2]}})})},r([h],e(y),!1)),S?f.createElement(f.Fragment,null,u):I?f.createElement(f.Fragment,null,c):f.createElement(f.Fragment,null,a)},pd=function(t,n){var o,i=null,a=!0,l=function(){for(var l=[],c=0;c<arguments.length;c++)l[c]=arguments[c];return a||t(i,l)?(i=l,a=!1,o=n.apply(void 0,r([],e(l),!1))):o};return l.clear=function(){i=null},l},hd=function(e){var r=e.children,o=e.condition,i=void 0===o?function(){return!0}:o,a=e.shouldCondition,l=void 0===a?function(){return!1}:a,c=e.conditionLoading,u=e.conditionElse,s=e.fallback,d=void 0===s?function(e){throw e}:s,m=e.object,p=Ir(),v=h(function(){return pd(function(e,t){return l(e[0],t[0],p)},i)},[]),g=y(function(e){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,v(e,p)];case 1:return[2,t.sent()]}})})},[]);return f.createElement(md,{condition:g,Loading:c&&f.createElement(c,{data:m,payload:p}),Else:u&&f.createElement(u,{data:m,payload:p}),fallback:d,payload:m},r)};hd.displayName="ConditionLayout";var vd=xs(hd),gd=["dirty","fallback","readonly","invalid","loading","object","onChange","prefix","value"],bd=An()({root:{display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *":{flex:1}}}),yd=function(e){var t=e.children;return f.createElement(f.Fragment,null,t)},wd=function(t){var n=t.children,r=t.className,o=t.style,i=t.sx,c=t.testId,u=t.customLayout,s=void 0===u?yd:u,d=l(t,["children","className","style","sx","testId","customLayout"]),m=bd().classes,p=Ur(),v=p.object,g=p.changeObject,b=Ir(),y=h(function(){var t=Object.entries(d).filter(function(t){var n=e(t,1)[0];return!gd.includes(n)}).reduce(function(t,n){var r,o=e(n,2),i=o[0],l=o[1];return a(a({},t),((r={})[i]=l,r))},{});return a(a({},v),{onChange:g,_fieldParams:t,_fieldData:v,_payload:b})},[v]);return f.createElement(j,{className:Eo(r,m.root),"data-testid":c,style:o,sx:i},f.createElement(s,a({},y),n))};wd.displayName="CustomLayout";var Ed,xd=xs(wd),Cd=Object.create(null);Object.assign(Cd,((Ed={})[Dn.Group]=zs,Ed[Dn.Box]=$s,Ed[Dn.Paper]=Os,Ed[Dn.Outline]=Bs,Ed[Dn.Expansion]=Ss,Ed[Dn.Div]=Us,Ed[Dn.Tabs]=Ks,Ed[Dn.Hero]=sd,Ed[Dn.Fragment]=Vs,Ed[Dn.Center]=Zs,Ed[Dn.Stretch]=nd,Ed[Dn.Condition]=vd,Ed[Dn.Layout]=xd,Ed));var kd=function(e,t,n){void 0===n&&(n="");var r,o=e.type;if(r=Cd[o])return f.createElement(r,a({},e,{key:n}),t);throw new Error("FieldFactory unknown key type")},Sd=new Set([Dn.Choose,Dn.Combo,Dn.Complete,Dn.Date,Dn.File,Dn.Items,Dn.Text,Dn.Time,Dn.Dict,Dn.Tree,Dn.Button,Dn.Icon]),Ld=function(e){return e.type===Dn.Fragment?Nd(e):!On(e.type)&&(!e.outlined&&(!e.noBaseline&&(!!e.baseline||Sd.has(e.type))))},Nd=function(e){var t=e.outlined,n=e.noBaseline,r=e.baseline,o=e.child,i=e.fields;return!t&&(!n&&(!!r||(o?[o]:i||[]).some(Ld)))},Id=function(e){return On(e.type)?Nd(e):Ld(e)},Md=p(null),Rd=function(e){var t=e.children,n=h(function(){var e=Object.create(null);return Object.assign(e,{focusMap:new Map,blurMap:new Map,menuMap:new Map,clickMap:new Map,baselineMap:new Map,fieldsMap:new Map,statefullMap:new Map,trMap:new Map,itemListMap:new Map}),e},[]);return w(function(){return function(){return Object.values(n).forEach(function(e){e.clear()})}},[]),f.createElement(Md.Provider,{value:n},t)},Pd=["custom-layout","switch-field","line-field","file-field","group-layout","paper-layout","outline-layout","expansion-layout","radio-field","checkbox-field","text-field","date-field","time-field","progress-field","component-field","slider-field","combo-field","choose-field","init-field","complete-field","items-field","rating-field","typography-field","fragment-layout","div-layout","box-layout","tabs-layout","hero-layout","center-layout","stretch-layout","condition-layout"].reduce(function(e,t){var n;return a(a({},e),((n={})[Symbol.for(t)]=t,n))},{}),Ad=function(e){return Pd[e]||e.toString()},Td=function(e){var t=e.filter(Fn).length;return Math.max(t,1)},Dd=function(){return null},jd=function(){return null},Od=function(){return null},Fd=function(e,t){return e!==t},_d=function(t,n){return e(t,1)[0]!==e(n,1)[0]},Bd=function(e,t){var n=e.itemList,r=e.shouldUpdateItemList,o=void 0===r?Fd:r;if(n)return Array.isArray(n)?n:pd(function(e,n){return o(e[0],n[0],t)},n)},Hd=function(e,t){var n=e.tr,r=e.shouldUpdateTr,o=void 0===r?_d:r;if(n)return pd(function(e,n){return o(e,n,t)},n)},Wd=function(e){var r=e.rendered,o=void 0!==r&&r,i=e.fields,l=void 0===i?[]:i,c=e.features,u=e.dirty,s=e.ready,d=void 0===s?Dd:s,m=e.prefix,p=void 0===m?"root":m,g=e.invalidity,E=void 0===g?jd:g,x=e.fallback,C=void 0===x?Od:x,S=e.outlinePaper,L=void 0!==S&&S,N=e.transparentPaper,I=void 0!==N&&N,M=e.readonly,R=e.disabled,P=e.baseline,A=e.noBaseline,T=e.readTransform,D=e.writeTransform,j=e.focus,O=e.blur,F=e.click,_=e.menu,B=e.createField,H=void 0===B?hs:B,W=e.createLayout,z=void 0===W?kd:W,V=e.isBaseline,Y=void 0===V?Id:V,U=e.withNamedPlaceholders,q=Ir(),$=v(Md),X=$.focusMap,G=$.blurMap,K=$.menuMap,Q=$.baselineMap,J=$.fieldsMap,Z=$.clickMap,ee=$.statefullMap,te=$.trMap,ne=$.itemListMap,re=h(function(){var e=J.has(l)?J.get(l):J.set(l,l.filter(function(e){return!c||!e.features||e.features.some(function(e){return c.includes(e)})}).filter(function(e){return e.type!==Dn.Phony}).filter(function(e){var t=e.hidden;return"function"==typeof t&&(t=t(q)),!t}).filter(function(e){return e.type!==Dn.Init})).get(l);return{fields:e,statefull:ee.has(l)?ee.get(l):ee.set(l,Td(e)).get(l)}},[]),oe=re.fields,ie=re.statefull,ae=b(ie),le=Ur(),ce=le.object,ue=le.setObject;w(function(){0==oe.length&&d()},[]);var se=y(function(e,t){ue(e,t)},[]),de=y(function(){0===--ae.current&&d()},[d]);return ce?f.createElement(k,null,oe.map(function(e,r){var i="".concat(p,".").concat(Ad(e.type),"[").concat(r,"]"),l=e.child?[e.child]:e.fields||[],s=a(a({readTransform:T,writeTransform:D,invalidity:e.invalidity||E,readonly:M||e.readonly,disabled:R||e.disabled,testId:e.testId,prefix:i,change:se,ready:de,fallback:C,isBaselineAlign:void 0===Q.get(e)?!!Q.set(e,!!P||!A&&Y(e)).get(e):!!Q.get(e)},e),{placeholder:U?"".concat(e.name||"unknown"):e.placeholder,outlinePaper:e.outlinePaper||L,transparentPaper:e.transparentPaper||I,click:Z.has(e)?Z.get(e):Z.set(e,function(r,o,i,a,l,c){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return e.click?[4,e.click(r,o,i,a,l,c)]:[3,2];case 1:t.sent(),t.label=2;case 2:return F?[4,F(r,i,a,l,c,o)]:[3,4];case 3:t.sent(),t.label=4;case 4:return[2]}})})}).get(e),focus:X.has(e)?X.get(e):X.set(e,function(t,n,r,o,i){e.focus&&e.focus(t,n,r,o,i),j&&j(t,n,r,o,i)}).get(e),blur:G.has(e)?G.get(e):G.set(e,function(t,n,r,o,i){e.blur&&e.blur(t,n,r,o,i),O&&O(t,n,r,o,i)}).get(e),menu:K.has(e)?K.get(e):K.set(e,function(t,n,r,o,i,a){e.menu&&e.menu(t,n,r,o,i,a),_&&_(t,n,r,o,i,a)}).get(e),tr:te.has(e)?te.get(e):te.set(e,Hd(e,q)).get(e),itemList:ne.has(e)?ne.get(e):ne.set(e,Bd(e,q)).get(e),object:ce,dirty:e.dirty||u}),d={rendered:o,ready:de,prefix:i,readTransform:T,writeTransform:D,readonly:M||e.readonly,disabled:R||e.disabled,outlinePaper:s.outlinePaper,transparentPaper:s.transparentPaper,withNamedPlaceholders:U,baseline:P,noBaseline:A,createField:H,createLayout:z,isBaseline:Y,fields:l,features:c,handler:ce,invalidity:E,focus:j,click:F,menu:_,blur:O,dirty:e.dirty||u};return On(e.type)?z(s,f.createElement(zd,a({},d)),i):H(s,i)})):null};Wd.displayName="OneInternal";var zd=C(Wd),Vd="react-declarative__oneContainer",Yd=An()({root:{display:"flex",flexDirection:"column",alignItems:"flex-start",width:"100%"},adjust:{flex:1}}),Ud=function(e){var t=e.className,n=e.children,r=l(e,["className","children"]),o=Yd().classes;return f.createElement(j,a({className:Eo(Vd,t,o.root),"data-testid":Vd},r),n,f.createElement("div",{className:o.adjust}))},qd="react-declarative__oneGenesis",$d="react-declarative__oneGenesisReady",Xd=An()({readonly:{pointerEvents:"none"},rendering:{pointerEvents:"none"}}),Gd=function(){return null},Kd=function(e){return console.log({data:e})},Qd=function(e){return e},Jd=function(t){var n,r=b(!1),o=e(g(!1),2),i=o[0],l=o[1],c=Xd().classes,u=t.isBaselineForRoot,s=void 0===u?Ld:u,d=t.outgoingTransform,m=void 0===d?Qd:d,p=t.change,v=void 0===p?Kd:p,w=t.ready,E=void 0===w?Gd:w,x=t.fields,C=void 0===x?[]:x,k=t.slots,S=void 0===k?{}:k,L=t.payload,N=void 0===L?{}:L,I=t.fieldDebounce,M=void 0===I?0:I,R=t.features,P=t.context,A=t.baseline,T=t.noBaseline,D=Or(N),j=t.className,O=t.style,F=t.sx,_=h(function(){return C},[]),B=zr(E),H=zr(v),W=y(function(){var e=B.current;r.current||(r.current=!0,l(!0),e())},[]),z=y(function(e,t){var n=H.current,r=!0;Pr(C).forEach(function(t){var n=t.isInvalid,o=void 0===n?function(){return null}:n,i=t.hidden;("function"==typeof i?i(D):i)||(r=r&&null===(o(e,D)||null))}),r&&n(m(e,D),t)},[]),V=a(a({},t),{context:void 0,fields:_,change:z,features:R,payload:D}),Y=a(a({},t),{context:void 0,fields:_,ready:W,features:R,payload:D,rendered:i}),U=h(function(){return!!A||!T&&_.some(s)},[]);return f.createElement(Tn,null,f.createElement(Rd,null,f.createElement(Cr,{payload:M},f.createElement(Qo,{context:P},f.createElement(vl,{initialState:function(){return Pr(C).filter(function(e){return e.type===Dn.Radio}).filter(function(e){return e.name}).reduce(function(e,t){var n,r=t.name,o=t.defaultValue;return a(a({},e),((n={})[r]=e[r]||String(o)||null,n))},{})}},f.createElement(ti,{features:R},f.createElement(Nr,{payload:D},f.createElement(Yr,a({},V),f.createElement(co,null,f.createElement(ru,a({},S),f.createElement(Ud,{className:j,style:O,sx:F},f.createElement(Po,{isBaselineAlign:U,className:Eo(qd,(n={},n[$d]=i,n[c.readonly]=t.readonly,n[c.rendering]=!i,n)),"data-testid":i?$d:qd},f.createElement(zd,a({},Y))))))))))))))};Jd.displayName="OneGenesis";var Zd=function(){return f.createElement(f.Fragment,null)},ef=function(e){function t(t){var n=e.call(this,t)||this;return n.componentDidMount=function(){requestAnimationFrame(function(){n.setState({canRender:!0})})},n.render=function(){var e=n.props,t=e.children,r=e.ServerView,o=void 0===r?Zd:r;return n.state.canRender?f.createElement(f.Fragment,null,t):f.createElement(o,null)},n.state={canRender:!1},n}return u(t,e),t}(f.Component),tf=function(e){var t,n,r=function(e){var t=e.name,n=e.validation,r=[];if(!t)return"continue";if(!n)return"continue";var o=n.required,i=n.pattern,a=n.minLength,l=n.maxLength,u=n.numeric,s=n.minNum,d=n.maxNum,f=n.date,m=n.time;o&&r.push(function(e){var n=Wn(e,t);return!1===n||0===n||n?null:"Required"}),f&&r.push(function(e){var n;return(null===(n=Wl(Wn(e,t)))||void 0===n?void 0:n.isValid)?null:"The date is invalid"}),m&&r.push(function(e){var n;return(null===(n=Vl(Wn(e,t)))||void 0===n?void 0:n.isValid)?null:"time date is invalid"}),u&&r.push(function(e){return isNaN(Wn(e,t))?"Must be a number":null}),d&&r.push(function(e){return isNaN(Wn(e,t))?"Must be a number":parseInt(Wn(e,t))>d?"Maximum value reached":null}),s&&r.push(function(e){return isNaN(Wn(e,t))?"Must be a number":parseInt(Wn(e,t))<s?"Minimum value reached":null}),i&&r.push(function(e){return new RegExp(i.source,i.flags).test(Wn(e,t))?null:"Pattern does not match"}),l&&r.push(function(e){var n;return((null===(n=Wn(e,t))||void 0===n?void 0:n.length)||0)>l?"Maximum length reached":null}),a&&r.push(function(e){var n;return((null===(n=Wn(e,t))||void 0===n?void 0:n.length)||0)<a?"Minimum length reached":null}),e.isInvalid||(e.isInvalid=function(e){var t,n;try{for(var o=(t=void 0,c(r)),i=o.next();!i.done;i=o.next()){var a=(0,i.value)(e);if(a)return a}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return null})};try{for(var o=c(Pr(e)),i=o.next();!i.done;i=o.next()){r(i.value)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return e},nf=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Date)return new Date(e);if(e instanceof RegExp)return new RegExp(e.source,e.flags);if(Array.isArray(e))return e.map(function(e){return nf(e)});if(_n(e)){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=nf(e[n]));return t}return e},rf=Symbol("never-value"),of=function(){return null},af=function(){return null},lf=function(){return null},cf=function(){return null},uf=function(){return null},sf=function(){return null},df=function(){return null},ff=function(){return null},mf=function(){return null},pf=function(e){return e},hf=function(e){return e},vf=function(e){return e},gf=function(e){return e},bf=function(r){var o=function(e){var r=e.changeSubject,o=e.fields,i=e.handler,c=e.data,u=void 0===c?rf:c,s=l(e,["changeSubject","fields","handler","data"]),d=zr(u),f=h(function(){var e=nf(o);return tf(e)},[]);if(Or(u===rf))return a({handler:i,fields:f},s);var m=Fr(r),p=Xr(u);return w(function(){return p.subscribe(function(e){m.next(e)})},[]),a({changeSubject:m,fields:f,handler:function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return d.current?[3,2]:[4,p.toPromise()];case 1:return[2,e.sent()];case 2:return[2,d.current]}})})}},s)}(r),i=o.createField,c=void 0===i?hs:i,u=o.createLayout,s=void 0===u?kd:u,d=o.isBaseline,m=void 0===d?Id:d,p=o.isBaselineForRoot,v=void 0===p?Ld:p,g=o.apiRef,b=o.changeSubject,E=o.reloadSubject,x=o.updateSubject,C=to(o.onFocus||of),k=to(o.onBlur||af),S=to(o.onMenu||lf),L=to(o.onClick||cf),N=to(o.onReady||uf),I=to(o.onChange||sf),M=to(o.onInvalid||df),R=to(o.onLoadStart||ff),P=to(o.onLoadEnd||mf),A=o.focus,T=void 0===A?C:A,D=o.blur,j=void 0===D?k:D,O=o.menu,F=void 0===O?S:O,_=o.click,B=void 0===_?L:_,H=o.ready,W=void 0===H?N:H,z=o.change,V=void 0===z?I:z,Y=o.invalidity,U=void 0===Y?M:Y,q=o.loadStart,$=void 0===q?R:q,X=o.loadEnd,G=void 0===X?P:X,K=o.features,Q=l(o,["focus","blur","menu","click","ready","change","invalidity","loadStart","loadEnd","features"]),J=to(o.readTransform||pf),Z=to(o.writeTransform||hf),ee=to(o.incomingTransform||vf),te=to(o.outgoingTransform||gf),ne={readTransform:y(function(e,t,n,r){return"string"==typeof e||Array.isArray(e)?J(e,t,n,r):e},[]),writeTransform:y(function(e,t,n,r){return"string"==typeof e||Array.isArray(e)?Z(e,t,n,r):e},[])},re={focus:T,blur:j,menu:F,click:B,ready:W,change:V,invalidity:U,loadStart:$,loadEnd:G},oe=h(function(){var t=K;return"function"==typeof K&&(t=K()),t&&!Array.isArray(t)&&(t=Object.entries(t).map(function(t){var n=e(t,2),r=n[0];return n[1]?r:null}).filter(function(e){return!!e})),t},[]),ie=a(a(a(a({},Q),re),ne),{incomingTransform:ee,outgoingTransform:te,createField:c,createLayout:s,isBaseline:m,isBaselineForRoot:v,features:oe});return f.createElement(ef,null,f.createElement(Pn,{apiRef:g,changeSubject:b,reloadSubject:E,updateSubject:x},f.createElement(rl,a({},ie),f.createElement(Va,null,f.createElement(Jd,a({},ie))))))};bf.displayName="One";var yf=function(e){return f.createElement(bf,a({},e))};yf.displayName="OneTyped",bf.typed=yf;var wf,Ef="items-field",xf=function(e){return t(void 0,[e],void 0,function(e){var r,o,i,a,l,c=e.itemList,u=void 0===c?[]:c,s=e.tr,d=void 0===s?function(e){return e}:s,f=e.payload,m=void 0===f?{}:f,p=e.object,h=void 0===p?{}:p;return n(this,function(e){switch(e.label){case 0:return r={},a=(i=Object).values,"function"!=typeof u?[3,2]:[4,Promise.resolve(u(h,m))];case 1:return l=e.sent(),[3,3];case 2:l=u,e.label=3;case 3:return o=a.apply(i,[l]),[4,Promise.all(o.map(function(e){return t(void 0,void 0,void 0,function(){var t,o;return n(this,function(n){switch(n.label){case 0:return t=r,o=e,[4,Promise.resolve(d(e,h,m))];case 1:return[2,t[o]=n.sent()]}})})}))];case 4:return e.sent(),[2,{labels:r,items:o}]}})})},Cf=function(r){var o=r.itemList,i=void 0===o?[]:o,l=r.defaultList,c=void 0===l?[]:l,u=r.tr,s=void 0===u?function(e){return e}:u,d=b(!0),f=ol(),m=f.loadStart,p=f.loadEnd,h=f.fallback,v=f.payload,y=Ur().object,w=e(g({items:c,labels:{},loaded:!1,loading:!1}),2),x=w[0],C=w[1];return E(function(){x.loading&&!x.loaded&&t(void 0,void 0,void 0,function(){var e,t,r;return n(this,function(n){switch(n.label){case 0:e=!0,m&&m(Ef),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,xf({itemList:i,tr:s,object:y,payload:v})];case 2:return t=n.sent(),d.current&&C(a(a({},t),{loaded:!0,loading:!1})),[3,5];case 3:if(r=n.sent(),e=!1,!h)throw r;return h(r),[3,5];case 4:return p&&p(e,Ef),[7];case 5:return[2]}})})},[x.loading]),E(function(){return C(function(e){return a(a({},e),{loading:!0,loaded:!1})}),function(){d.current=!1}},[]),x},kf=function(e){var t=e.value,n=e.disabled,r=e.readonly,o=e.description,i=void 0===o?"":o,l=e.placeholder,c=void 0===l?"":l,u=e.outlined,s=void 0!==u&&u,d=e.itemList,m=void 0===d?[]:d,p=e.title,h=void 0===p?"":p,v=e.dirty,g=e.invalid,b=e.tr,y=void 0===b?function(e){return e.toString()}:b,w=e.onChange,E=ol().payload,x=void 0===E?{}:E,C=Ur().object,k=Cf({itemList:m||[],payload:x,object:C,tr:y}),S=k.items,L=k.labels,N=k.loading,I=k.loaded;return f.createElement(Ee,{value:I&&t||null,onChange:function(e,t){return w(t)},getOptionLabel:function(e){return L[e]||""},options:S,loading:N,disabled:n,renderInput:function(e){return f.createElement(xe,a({},e,{variant:s?"outlined":"standard",label:h,placeholder:c,helperText:v&&g||i,error:v&&null!==g,value:"123",InputProps:a(a({},e.InputProps),{readOnly:r,endAdornment:f.createElement(f.Fragment,null,N?f.createElement(O,{color:"inherit",size:20}):null,e.InputProps.endAdornment)})}))}})},Sf=function(e){var t=e.value,n=e.disabled,r=e.readonly,o=e.description,i=e.placeholder,l=e.outlined,c=void 0!==l&&l,u=e.itemList,s=void 0===u?[]:u,d=e.dirty,m=e.invalid,p=e.title,h=e.tr,v=void 0===h?function(e){return e.toString()}:h,g=e.onChange,b=ol().payload,y=void 0===b?{}:b,w=Ur().object,E=Cf({itemList:s||[],payload:y,object:w,tr:v}),x=E.items,C=E.labels,k=E.loading,S=E.loaded;return f.createElement(Ee,{multiple:!0,onChange:function(e,t){return g(t.length?t:null)},getOptionLabel:function(e){return C[e]||""},value:S&&t?Object.values(t):[],options:x,loading:k,disabled:n,renderTags:function(e,t){return e.map(function(e,n){return f.createElement(He,a({variant:c?"outlined":"filled",label:C[e]},t({index:n})))})},renderInput:function(e){return f.createElement(xe,a({variant:c?"outlined":"standard"},e,{label:p,placeholder:i,helperText:d&&m||o,error:d&&null!==m,InputProps:a(a({},e.InputProps),{readOnly:r,endAdornment:f.createElement(f.Fragment,null,k?f.createElement(O,{color:"inherit",size:20}):null,e.InputProps.endAdornment)})}))}})},Lf=new(function(){function e(){var e=this;this.abort=function(){var t;"AbortController"in window&&(null===(t=e._lastInstance)||void 0===t||t.abort(),e._lastInstance=new AbortController)},"AbortController"in window&&(this._lastInstance=new AbortController)}return Object.defineProperty(e.prototype,"signal",{get:function(){var e;return null===(e=this._lastInstance)||void 0===e?void 0:e.signal},enumerable:!1,configurable:!0}),e}()),Nf=function(e){function t(t,n,r){var o=e.call(this,t.message||"FetchError")||this;return o.originalError=t,o.request=n,o.response=r,o}return u(t,e),t}(Error),If=["POST","PUT","PATCH"],Mf=function(e,r){return t(void 0,void 0,void 0,function(){var t,o,i,l;return n(this,function(n){switch(n.label){case 0:t=e instanceof URL?e.toString():e,o=void 0,n.label=1;case 1:return n.trys.push([1,4,,5]),[4,fetch(t,a(a({},r),{headers:a(a({},If.includes(null===(l=null==r?void 0:r.method)||void 0===l?void 0:l.toUpperCase())&&{"Content-Type":"application/json"}),null==r?void 0:r.headers)}))];case 2:if(!(o=n.sent()).ok)throw new Error("fetchApi response not ok");return[4,o.json()];case 3:return[2,n.sent()];case 4:throw i=n.sent(),new Nf(i,t,o);case 5:return[2]}})})},Rf=function(e,r){var o=void 0===r?{}:r,i=o.fetch,l=void 0===i?window.fetch:i,c=o.origin,u=void 0===c?window.location.origin:c,s=o.abortSignal,d=void 0===s?Lf.signal:s,f=o.requestMap,m=void 0===f?function(e){return e}:f,p=o.responseMap,v=void 0===p?function(e){return e}:p,g=o.onLoadBegin,b=o.onLoadEnd,y=o.withAbortSignal,E=void 0===y||y,x=o.fetchParams,C=o.fallback,k=h(function(){return Gn(l)},[]),S=h(function(){return function(){return t(void 0,void 0,void 0,function(){var t,r,o,i,l;return n(this,function(n){switch(n.label){case 0:t=new URL(e,u),t=m(new URL(t)),g&&g(),r=!0,n.label=1;case 1:return n.trys.push([1,4,5,6]),[4,k(t.toString(),a({signal:d},x&&x()))];case 2:return(o=n.sent())===$n?[2,null]:[4,o.json()];case 3:return i=n.sent(),[2,v(i)];case 4:if(l=n.sent(),k.clear(),r=!1,l instanceof Nf&&(l=l.originalError),l instanceof DOMException&&"AbortError"==l.name)return[2,null];if(C)return C(l),[2,null];throw l;case 5:return b&&b(r),[7];case 6:return[2]}})})}},[]);return w(function(){return function(){E&&Lf.abort()}},[]),w(function(){return function(){k.clear()}},[]),S},Pf=function(e,r){return t(void 0,void 0,void 0,function(){var t,o;return n(this,function(n){switch(n.label){case 0:return"function"!=typeof e?[3,4]:(t=e(r))instanceof Promise?[4,t]:[3,2];case 1:return o=n.sent(),[3,3];case 2:o=t,n.label=3;case 3:return[2,o];case 4:return[2,e]}})})},Af=function(r,o){var i=void 0===o?{}:o,a=i.resultMap,l=void 0===a?function(e){return e}:a,c=i.payload,u=i.onLoadBegin,s=i.onLoadEnd,d=i.fallback,f=e(g(null),2),m=f[0],p=f[1];w(function(){t(void 0,void 0,void 0,function(){var e,t,o;return n(this,function(n){switch(n.label){case 0:u&&u(),e=!0,n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,Pf(r,c)];case 2:return t=n.sent(),p(l(t||{})),[3,5];case 3:if(o=n.sent(),e=!1,!d)throw o;return d(o),p(null),[3,5];case 4:return s&&s(e),[7];case 5:return[2]}})})},[]);return{data:m,change:function(e,t){t||p(e)}}},Tf=function(e,r){return t(void 0,void 0,void 0,function(){var t,o;return n(this,function(n){switch(n.label){case 0:return"function"!=typeof e?[3,4]:(t=e(r))instanceof Promise?[4,t]:[3,2];case 1:return o=n.sent(),[3,3];case 2:o=t,n.label=3;case 3:return[2,o];case 4:return[2,e]}})})},Df=function(e,r){var o=void 0===r?{}:r,i=o.resultMap,a=void 0===i?function(e){return e}:i,l=o.onLoadBegin,c=o.onLoadEnd,u=o.fallback,s=h(function(){return function(r){return t(void 0,void 0,void 0,function(){var t,o,i;return n(this,function(n){switch(n.label){case 0:l&&l(),t=!0,n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,Tf(e,r)];case 2:return o=n.sent(),[2,a(o||{})];case 3:if(i=n.sent(),t=!1,u)return u(i),[2,null];throw i;case 4:return c&&c(t),[7];case 5:return[2]}})})}},[]);return s},jf=function(){var e;return globalThis.location?"file:"===(null===(e=globalThis.location)||void 0===e?void 0:e.protocol)?ct():ut():ct()},Of=p(null),Ff=function(t){var n,r=t.children,o=e(g(null),2),i=o[0],a=o[1],l=y(function(e){return a(function(){return e})},[]),c={handleElement:l,handleClear:y(function(){return a(null)},[]),handleUpdate:(n=e(g(!0),2)[1],y(function(){n(function(e){return!e})},[]))};return f.createElement(ef,null,f.createElement(Tn,null,f.createElement(Of.Provider,{value:c},r,i&&S(i))))},_f=function(t,n){void 0===n&&(n=[]);var o=e(g(!1),2),i=o[0],a=o[1],l=v(Of),c=l.handleElement,u=l.handleClear,s=l.handleUpdate,d=y(function(){c(t)},[]);return w(function(){i?d():u()},[i]),w(function(){i&&s()},r([i],e(n),!1)),{showModal:y(function(){a(!0)},[]),hideModal:y(function(){a(!1)},[])}},Bf=An()({dialog:{"&:first-of-type":{padding:0},overflow:"hidden"}}),Hf=function(e){var t=e.children,n=e.disabled,r=e.invalid,o=e.dividers,i=void 0!==o&&o,c=e.canCancel,u=void 0===c||c,s=e.noSave,d=void 0!==s&&s,m=e.onAccept,p=void 0===m?function(){return console.log("accept")}:m,h=e.onDismiss,v=void 0===h?function(){return console.log("dismiss")}:h,g=l(e,["children","disabled","invalid","dividers","canCancel","noSave","onAccept","onDismiss"]),b=Bf().classes;return f.createElement(st,a({},g),f.createElement(dt,{dividers:i,className:b.dialog},t),f.createElement(ft,null,!d&&f.createElement(ye,{disabled:n||r,color:"primary",onClick:p},"OK"),u&&f.createElement(ye,{disabled:n,color:"primary",onClick:v},"Cancel")))},Wf=function(e){var t=e.onChange,n=void 0===t?function(e){return console.log({result:e})}:t,r=e.canCancel,o=void 0===r||r,i=e.title,a=e.msg,l=e.open,c=void 0===l||l;return f.createElement(Hf,{open:c,canCancel:o,onAccept:function(){return n(!0)},onDismiss:function(){return n(!1)}},f.createElement(mt,null,f.createElement(j,{mr:3},i)),f.createElement(j,{p:3},f.createElement(_,{variant:"body2"},a)))},zf=function(r){var o=void 0===r?{}:r,i=o.title,l=void 0===i?"":i,c=o.msg,u=void 0===c?"":c,s=o.canCancel,d=void 0===s||s,m=b(),p=to(function(){return{currentCanCancel:d,currentTitle:l,currentMsg:u,open:!1}}),h=e(ro(p),2),v=h[0],g=h[1];w(function(){v.current.open||g(function(e){return a(a({},e),{currentTitle:l})})},[l]),w(function(){v.current.open||g(function(e){return a(a({},e),{currentMsg:u})})},[u]),w(function(){v.current.open||g(function(e){return a(a({},e),{currentCanCancel:d})})},[d]);var y=function(e){var t=m.current;t&&t(e),g(p),C()},E=_f(function(){return f.createElement(Wf,{open:!0,canCancel:v.current.currentCanCancel,title:v.current.currentTitle,msg:v.current.currentMsg,onChange:y})},[]),x=E.showModal,C=E.hideModal;return function(e){var r=void 0===e?{}:e,o=r.canCancel,i=r.title,a=r.msg;return new function(){var e=this;this.then=function(e){m.current=e},this.toPromise=function(){return t(e,void 0,void 0,function(){var e;return n(this,function(t){switch(t.label){case 0:return e=new ar,this.then(e.next),[4,e.toPromise()];case 1:return[2,t.sent()]}})})},g(function(e){return{currentTitle:void 0!==i?i:e.currentTitle,currentCanCancel:void 0!==o?o:e.currentCanCancel,currentMsg:void 0!==a?a:e.currentMsg,open:!0}}),x()}}},Vf="The form contains unsaved changes. Continue?",Yf=jf(),Uf=function(r){var o=void 0===r?{}:r,i=o.history,l=void 0===i?Yf:i,c=o.waitForChangesDelay,u=void 0===c?1e3:c,s=o.readonly,d=void 0!==s&&s,f=o.data,m=void 0===f?null:f,p=o.onChange,h=o.onLoadStart,v=o.onLoadEnd,y=o.onBlock,x=void 0===y?function(){return function(){return null}}:y,C=o.onSave,k=void 0===C?function(){return!0}:C,S=o.onUpdate,L=void 0===S?function(){return null}:S,N=o.checkUpdate,I=void 0===N?function(){return!0}:N,M=o.checkDirty,R=void 0===M?function(){return!0}:M,P=o.shouldAutoSave,A=void 0===P?function(){return!1}:P,T=o.fallback,D=o.updateSubject,j=o.changeSubject,O=b(null),F=Fr(D),_=Fr(j),B=e(g(null),2),H=B[0],W=B[1],z=e(g(!1),2),V=z[0],Y=z[1],U=e(g(0),2),q=U[0],$=U[1],X=e(g(!1),2),G=X[0],K=X[1],Q=b(H),J=!!H&&!q,Z=!!q,ee=to(L),te=zr(J),ne=zr(Z),re=zr(H);w(function(){return F.subscribe(function(t){var n=e(t,2),r=n[0],o=n[1];ne.current||I(r,o)&&(_.next(o),te.current&&W(o),ee(r,o))})},[]);var oe=Fr();w(function(){return function(){oe.next()}},[]);var ie=b(),ae=il([H,V],10),le=zf({title:"Continue?",msg:Vf}),ce=b(!0);E(function(){return function(){ce.current=!1}},[]);var ue=Fr(),se=b(!1);w(function(){var e,r,o,i,a,c=function(){return l.block(function(e){return function(e){return t(void 0,void 0,void 0,function(){var t,r,o;return n(this,function(n){switch(n.label){case 0:return t=!1,A()?(r=t)?[3,2]:[4,fe()]:[3,3];case 1:r=n.sent(),n.label=2;case 2:t=r,n.label=3;case 3:return t?[3,6]:(o=t)?[3,5]:[4,se.current?ue.toPromise():new Promise(function(e){se.current=!0,le({msg:V?"The form contains invalid data. Continue?":Vf}).then(function(t){se.current=!1,ue.next(t),e(t)})})];case 4:o=n.sent(),n.label=5;case 5:t=o,n.label=6;case 6:return t&&u(),t&&e(),[2]}})})}(e.retry)})},u=function(){e&&e(),r&&r(),o&&o(),ie.current=null};return(H||V)&&(e=c(),i=x&&x(),r=function(){return i&&i()},a=function(e){return e.preventDefault(),Vf},window.addEventListener("beforeunload",a),o=function(){window.removeEventListener("beforeunload",a)},ie.current=u),u},[H,V]);var de=function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return ie.current&&ie.current(),ce.current?(W(null),Y(!1),[4,Promise.race([ae(),oe.toPromise()])]):[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})},fe=function(){return t(void 0,void 0,void 0,function(){var e,t,r,o;return n(this,function(n){switch(n.label){case 0:return te.current?ne.current?[2,!1]:[4,me()]:[2,!1];case 1:if(n.sent(),!(e=re.current))return[3,9];t=!0,h&&h(),$(function(e){return e+1}),n.label=2;case 2:return n.trys.push([2,6,7,8]),[4,Promise.resolve(k(e))];case 3:return(r=n.sent())?[4,de()]:[3,5];case 4:n.sent(),n.label=5;case 5:return t=!!r,[3,8];case 6:if(o=n.sent(),t=!1,ie.current&&ie.current(),!T)throw o;return T(o),[3,8];case 7:return function(e){v&&v(e),$(function(e){return e-1})}(t),[7];case 8:return[2,t];case 9:return[2,!1]}})})},me=function(){return t(void 0,void 0,void 0,function(){var e;return n(this,function(t){switch(t.label){case 0:e=l.block(function(){}),K(!0),t.label=1;case 1:return t.trys.push([1,,3,4]),[4,Promise.race([ae(),qn(u)])];case 2:return t.sent(),[3,4];case 3:return K(!1),e(),[7];case 4:return[2,re.current]}})})};return{beginSave:fe,afterSave:de,dropChanges:function(){var e=Q.current;e&&_.next(e),W(null),Y(!1)},waitForChanges:me,oneProps:a(a({apiRef:O,handler:function(){return m},change:function(e,t){void 0===t&&(t=!1);var n=re.current;R(n||{},e)&&(t||(ce.current&&W(e),ce.current&&Y(!1)),t&&(Q.current=e),p&&p(e,t))},invalidity:function(){Y(!0)},readonly:!!q||G||d},T&&{fallback:T}),{changeSubject:_}),apiRef:O,invalid:V,data:V?null:H,hasChanged:J,hasLoading:Z}},qf=function(e){return!e.noBaseline},$f=function(e,t){void 0===t&&(t={});var n={};return Pr(e).filter(function(e){return!!e.name}).filter(function(e){return e.type!==Dn.Phony}).filter(function(e){return e.type!==Dn.Button}).filter(function(e){return e.type!==Dn.Icon}).forEach(function(e){var r=e.type,o=e.name,i=e.defaultValue,a=e.hidden;Tr(n,o),("function"==typeof a?a(t):a)||Hn(n,o,void 0===i?Wn(n,o)||Rr(r):"function"==typeof i?i(t):i)}),n},Xf=function(e,r){void 0===r&&(r={}),w(function(){var o=e();if(!(o instanceof Promise))return o;!function(e,r){t(void 0,[e,r],void 0,function(e,t){var r,o,i=t.onLoadStart,a=t.onLoadEnd,l=t.fallback,c=t.throwError;return n(this,function(t){switch(t.label){case 0:r=!0,i&&i(),t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,e];case 2:return t.sent(),[3,5];case 3:if(o=t.sent(),r=!1,c)throw o;return l&&l(o),[3,5];case 4:return a&&a(r),[7];case 5:return[2]}})})}(o,r)},r.deps||[])},Gf=An()(function(e){return{content:{minWidth:"300px",maxWidth:"80vw",maxHeight:"80vh",overflowY:"auto",overflowX:"hidden",paddingTop:e.spacing(2),paddingLeft:e.spacing(1),paddingRight:e.spacing(1),paddingBottom:e.spacing(2)}}}),Kf=function(r){var o=r.waitForChangesDelay,i=void 0===o?600:o,c=r.fieldDebounce,u=r.noBadge,s=void 0!==u&&u,d=r.fields,m=r.handler,p=r.payload,v=void 0===p?{}:p,b=r.badgeColor,y=void 0===b?"info":b,w=r.color,E=void 0===w?"default":w,x=r.badgeOverlap,C=r.badgeSx,k=r.oneSx,S=r.isBaseline,L=r.isBaselineForRoot,N=r.onClose,I=r.onChange,M=r.onFocus,R=r.onBlur,P=r.onInvalid,A=r.reloadSubject,T=r.closeSubject,D=l(r,["waitForChangesDelay","fieldDebounce","noBadge","fields","handler","payload","badgeColor","color","badgeOverlap","badgeSx","oneSx","isBaseline","isBaselineForRoot","onClose","onChange","onFocus","onBlur","onInvalid","reloadSubject","closeSubject"]),j=Gf().classes,O=Or(v),F=Fr(A),_=Fr(T),B=e(g(null),2),H=B[0],W=B[1],z=e(kc(function(){return t(void 0,void 0,void 0,function(){var e,r,o,i;return n(this,function(a){switch(a.label){case 0:return e=function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return"function"!=typeof m?[3,2]:[4,m(O)];case 1:return[2,e.sent()];case 2:return[2,m]}})})},o=Ar,i=[{},$f(d,O)],[4,e()];case 1:return r=o.apply(void 0,i.concat([a.sent()])),I&&I(r,!0),[2,r]}})})}),3),V=z[0],Y=z[1],U=Y.loading,q=Y.error,$=Y.execute,X=z[2];Xf(function(){return F.subscribe($)}),Xf(function(){return _.subscribe(function(){return W(null)})});var G=e(g(!1),2),K=G[0],Q=G[1],J=il([V],10),Z=zr(V);$r(function(){"function"!=typeof m&&X(m)},[m]);var ee=h(function(){return s?0:Object.values(V||{}).filter(function(e){return e}).length},[V]),te=h(function(){return eo(function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,Promise.race([J(),qn(i)])];case 1:return e.sent(),[2]}})})];case 1:return e.sent(),I&&I(Z.current,!1),N&&N(Z.current),W(null),[2]}})})})},[]);return U||q?null:f.createElement(f.Fragment,null,f.createElement(pt,{badgeContent:ee,overlap:x,color:y,sx:C},f.createElement(Ne,a({},D,{onClick:function(e){var t=e.currentTarget;H||W(t)},color:K?"error":E}))),f.createElement(qe,{keepMounted:!0,open:!!H,anchorEl:H,onClose:te,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"right"}},f.createElement(bf,{className:j.content,sx:k,transparentPaper:!0,fieldDebounce:c,fields:d,payload:O,handler:function(){return V},isBaseline:S,isBaselineForRoot:L,onChange:function(e,t){t||(X(e),Q(!1),I&&I(e,!1))},onInvalid:function(e,t,n){Q(!0),P&&P(e,t,n)},onFocus:M,onBlur:R})))},Qf="react-declarative__oneButtonContent",Jf=An()(function(e){return{content:{minWidth:"300px",maxWidth:"80vw",maxHeight:"80vh",overflowY:"auto",overflowX:"hidden",paddingTop:e.spacing(2),paddingLeft:e.spacing(1),paddingRight:e.spacing(1),paddingBottom:e.spacing(2)}}}),Zf=function(r){var o=r.waitForChangesDelay,i=void 0===o?600:o,c=r.fieldDebounce,u=r.withCloseAfterChange,s=void 0!==u&&u,d=r.noBadge,m=void 0!==d&&d,p=r.fields,v=r.handler,b=r.payload,y=void 0===b?{}:b,E=r.badgeColor,x=void 0===E?"info":E,C=r.color,k=void 0===C?"primary":C,S=r.badgeOverlap,L=r.badgeSx,N=r.oneSx,I=r.onChange,M=void 0===I?function(){}:I,R=r.onClose,P=r.onFocus,A=r.onBlur,T=r.isBaseline,D=r.isBaselineForRoot,j=r.onInvalid,O=r.readTransform,F=r.writeTransform,_=r.incomingTransform,B=r.outgoingTransform,H=r.reloadSubject,W=r.closeSubject,z=l(r,["waitForChangesDelay","fieldDebounce","withCloseAfterChange","noBadge","fields","handler","payload","badgeColor","color","badgeOverlap","badgeSx","oneSx","onChange","onClose","onFocus","onBlur","isBaseline","isBaselineForRoot","onInvalid","readTransform","writeTransform","incomingTransform","outgoingTransform","reloadSubject","closeSubject"]),V=Jf().classes,Y=Or(y),U=e(g(null),2),q=U[0],$=U[1],X=e(g(!1),2),G=X[0],K=X[1],Q=to(M),J=Fr(H),Z=Fr(W),ee=e(kc(function(){return t(void 0,void 0,void 0,function(){var e,r,o,i;return n(this,function(a){switch(a.label){case 0:return e=function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return"function"!=typeof v?[3,2]:[4,v(Y)];case 1:return[2,e.sent()];case 2:return[2,v]}})})},o=Ar,i=[{},$f(p,Y)],[4,e()];case 1:return r=o.apply(void 0,i.concat([a.sent()])),Q(r,!0),[2,r]}})})}),4),te=ee[0],ne=ee[1],re=ne.loading,oe=ne.error,ie=ne.execute,ae=ee[2],le=ee[3].data$;Xf(function(){return J.subscribe(ie)}),Xf(function(){return Z.subscribe(function(){return $(null)})});var ce=e(g(!1),2),ue=ce[0],se=ce[1],de=il([te],10);$r(function(){"function"!=typeof v&&ae(v)},[v]);var fe=h(function(){return m?0:Object.values(te||{}).filter(function(e){return e}).length},[te]),me=h(function(){return eo(function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return K(!0),[4,t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,Promise.race([de(),qn(i)])];case 1:return e.sent(),[2]}})})];case 1:return e.sent(),Q(le.current,!1),R&&R(le.current),$(null),K(!1),[2]}})})})},[]),pe=Fr();return w(function(){if(q&&s){var e=pe.once(function(){var t=Jn(function(t){var n=t.clientX,r=t.clientY,o=document.elementFromPoint(n,r);(null==o?void 0:o.closest(".".concat(Qf)))||(me(),e&&e())},15);document.addEventListener("mousemove",t),e=function(){document.removeEventListener("mousemove",t),t.clear()}});return function(){return e()}}},[q]),re||oe?null:f.createElement(f.Fragment,null,f.createElement(pt,{badgeContent:fe,overlap:S,color:x,sx:L},f.createElement(ye,a({},z,{onClick:function(e){var t=e.currentTarget;q||$(t)},color:ue?"error":k}))),f.createElement(qe,{keepMounted:!0,open:!!q,anchorEl:q,onClose:me,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"right"}},f.createElement(bf,{className:Eo(V.content,Qf),sx:N,transparentPaper:!0,fieldDebounce:c,fields:p,payload:Y,handler:function(){return te},readonly:G,isBaseline:T,isBaselineForRoot:D,onChange:function(e,t){t||(ae(e),se(!1),Q(e,!1),pe.next())},onInvalid:function(e,t,n){se(!0),j&&j(e,t,n)},readTransform:O,writeTransform:F,incomingTransform:_,outgoingTransform:B,onFocus:P,onBlur:A})))},em="react-declarative__scrollViewTarget",tm=An()({root:{display:"flex",alignItems:"stretch",justifyContent:"stretch"},container:{flex:1,position:"relative"},overflowX:{overflowX:"auto"},noOverflowX:{overflowX:"hidden"},overflowY:{overflowY:"auto"},noOverflowY:{overflowY:"hidden"},hideScrollbar:{"&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"},content:{position:"absolute",top:0,left:0},stretch:{display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *":{flex:1}},center:{display:"flex",alignItems:"center",justifyContent:"center"}}),nm=function(e){var t,n,r=e.children,o=e.className,i=e.style,c=e.center,u=void 0!==c&&c,s=e.withScrollbar,d=void 0!==s&&s,m=e.hideOverflowX,p=void 0!==m&&m,h=e.hideOverflowY,v=void 0!==h&&h,g=l(e,["children","className","style","center","withScrollbar","hideOverflowX","hideOverflowY"]),b=tm().classes,y=bi(),w=y.elementRef,E=y.size,x=E.height,C=E.width;return f.createElement(j,a({className:Eo(o,b.root),style:i},g),f.createElement("div",{ref:w,className:Eo(b.container,em,(t={},t[b.hideScrollbar]=!d,t[b.overflowX]=!p,t[b.overflowY]=!v,t[b.noOverflowX]=p,t[b.noOverflowY]=v,t))},f.createElement("div",{className:Eo(b.content,(n={},n[b.stretch]=!u,n[b.center]=u,n)),style:{minHeight:x,minWidth:C}},r)))},rm=An()(function(e,t){var n=t.size;return{root:{display:"inline-flex",alignItems:"stretch",justifyContent:"stretch",height:n,width:n},container:{position:"relative",height:n,width:n,flex:1},icon:{position:"absolute",height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center",top:0,left:0,right:0,bottom:0,zIndex:1},spinner:{position:"absolute",height:"100%",width:"100%",top:0,left:0,right:0,bottom:0,zIndex:0}}}),om=function(r){var o=r.className,i=r.style,c=r.sx,u=r.noProgress,s=void 0!==u&&u,d=r.throwError,m=void 0!==d&&d,p=r.disabled,h=void 0!==p&&p,v=r.size,y=void 0===v?40:v,w=r.thickness,x=void 0===w?3.6:w,C=r.color,k=void 0===C?"primary":C,S=r.onLoadStart,L=r.onLoadEnd,N=r.onClick,I=void 0===N?function(){}:N,M=r.fallback,R=r.children,P=l(r,["className","style","sx","noProgress","throwError","disabled","size","thickness","color","onLoadStart","onLoadEnd","onClick","fallback","children"]),A=rm({size:y,thickness:x}).classes,T=e(g(0),2),D=T[0],F=T[1],_=b(!0);E(function(){return function(){_.current=!1}},[]);var B=zr(D);return f.createElement(j,{className:Eo(o,A.root),style:i,sx:c},f.createElement(Te,a({},P,{className:A.container,disabled:!!D||h,onClick:function(e){return t(void 0,void 0,void 0,function(){var t,r;return n(this,function(n){switch(n.label){case 0:if(B.current)return[2];t=!0,n.label=1;case 1:return n.trys.push([1,3,4,5]),S&&S(),_.current&&F(function(e){return e+1}),[4,I(e)];case 2:return n.sent(),[3,5];case 3:if(r=n.sent(),t=!1,m)throw r;return M&&M(r),[3,5];case 4:return L&&L(t),_.current&&F(function(e){return e-1}),[7];case 5:return[2]}})})},color:k}),!!D&&!s&&f.createElement("div",{className:A.spinner},f.createElement(O,{size:y,thickness:x})),f.createElement(j,{className:A.icon},R)))},im=An()(function(e){var t;return{root:(t={display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column",minHeight:"100%",width:"100%"},t["& .".concat(em)]={"& > div > div":{marginBottom:e.spacing(2)}},t),container:{position:"relative",flex:1,display:"flex",alignItems:"stretch",justifyContent:"stretch"},content:{flex:1,display:"flex"},cell:{border:"1px solid ".concat(e.palette.action.active),padding:e.spacing(.5),margin:e.spacing(.5)},headerCell:{background:e.palette.primary.main,color:e.palette.getContrastText(e.palette.background.default)},fabFullscreen:{position:"absolute",transition:"opacity 150ms",opacity:0,bottom:10,right:10,zIndex:2},fabFullscreenToggle:{opacity:1}}}),am=function(e){if("Sanitizer"in window){var t=new window.Sanitizer,n=document.createElement("div");return n.setHTML(e,{sanitizer:t}),n.innerHTML}return e},lm=x(function(t,n){var r,o=t.data,i=t.maxCols,c=void 0===i?25:i,u=t.maxRows,s=void 0===u?100:u,d=t.withHeader,m=t.withFullScreen,p=t.className,v=t.style,b=t.sx,y=l(t,["data","maxCols","maxRows","withHeader","withFullScreen","className","style","sx"]),w=im().classes,E=e(g(!1),2),x=E[0],C=E[1],k=h(function(){return function(e){var t=e.reduce(function(e,t){return Math.max(e,t.length)},0);return e.map(function(e){var n=Array(t).fill("");return e.forEach(function(e,t){return n[t]=e}),n})}(o)},[o]),S=h(function(){if(!d)return[];var t=e(k,1)[0];return(void 0===t?[]:t).slice(0,c)},[d,k,c]),L=h(function(){return d?k.slice(1,s).map(function(e){return e.slice(0,c)}):k.slice(0,s).map(function(e){return e.slice(0,c)})},[d,s,c,k]);return f.createElement(j,a({},y,{ref:n,className:Eo(w.root,p),style:v,sx:b,onMouseEnter:function(){C(!0)},onMouseLeave:function(){C(!1)}}),f.createElement(j,{className:w.container},f.createElement(nm,{withScrollbar:!0,className:w.content},f.createElement("table",null,!!S.length&&f.createElement("thead",null,f.createElement("tr",null,S.map(function(e,t){return f.createElement("th",{key:"".concat(e,"-").concat(t),className:w.headerCell},e)}))),f.createElement("tbody",null,L.map(function(e,t){return f.createElement("tr",{key:"".concat(e.length,"-").concat(t)},e.map(function(e,t){return f.createElement("td",{key:"".concat(e,"-").concat(t),className:w.cell},e)}))})))),m&&f.createElement(om,{className:Eo(w.fabFullscreen,(r={},r[w.fabFullscreenToggle]=x,r)),color:"primary",size:48,onClick:function(e){e.preventDefault(),e.stopPropagation();var t=function(e,t){var n="";return n+="<style>table{border-collapse:collapse;min-width:100%}td,th{border:1px solid #ddd;text-align:left;padding:8px}th{background-color:#f2f2f2}</style>",n+="<table>",e.length&&(n+="<thead>",n+="<tr>",e.forEach(function(e){n+="<th>".concat(am(e),"</th>")}),n+="</tr>",n+="</thead>"),n+="<tbody>",t.forEach(function(e){n+="<tr>",e.forEach(function(e){n+="<td>".concat(am(e),"</td>")}),n+="</tr>"}),n+="</tbody>"}(S,L),n=window.open("about:blank","_blank","width=600,height=400");n&&(n.document.write(t),n.document.close())}},f.createElement(ht,{color:"inherit"}))))}),cm=An()({root:{display:"flex",alignItems:"center",justifyContent:"center"},container:{position:"relative"},content:{position:"absolute",top:0,left:0,transform:"translate(-50%, -50%)",borderRadius:"50%"}}),um=function(e){var t=e.className,n=e.color,r=e.side,o=l(e,["className","color","side"]),i=cm().classes;return f.createElement(j,a({className:Eo(t,i.root)},o),f.createElement("div",{className:i.container},f.createElement(j,{className:i.content,sx:{background:n,height:r,width:r}})))},sm=f.createContext(null),dm=function(e){return f.createElement(sm.Provider,{value:e},e.children)},fm=function(){return v(sm)},mm=p(null),pm=function(){return v(mm)},hm=function(t){var n=t.children,o=t.selectedRows,i=e(g(new Set(o)),2),a=i[0],l=i[1],c=fm().onSelectedRows,u=Li(),s=u.delay$,d=u.doDelay,f=function(t,n){void 0===n&&(n=!1),d(),c&&c(r([],e(t),!1),n),l(new Set(t))},p={selection:a,setSelection:f};return w(function(){if(o&&!s.current){var e=new Set(o);(function(e,t){if(e.size!==t.size)return!1;var n=!0;return e.forEach(function(e){!t.has(e)&&n&&(n=!1)}),t.forEach(function(t){!e.has(t)&&n&&(n=!1)}),n})(e,a)||f(e)}},[o]),m.createElement(mm.Provider,{value:p},n)},vm=function(e,t){var n=t.one,r=t.many,o=t.two,i=void 0===o?r:o;return"".concat(e," ").concat(function(){if(0===e||e>=11&&e<20)return r;var t=e%10;return 0===t?r:1===t?n:t<5?i:r}())},gm=An()({root:{display:"flex",alignItems:"center",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"},"& .MuiTablePagination-selectLabel":{display:"none"},"& .MuiToolbar-root":{paddingLeft:"unset !important"},"& .MuiToolbar-root > .MuiInputBase-root":{marginRight:"unset !important"},"& .MuiTablePagination-displayedRows":{transform:"translateY(-1px)",marginLeft:"10px",marginRight:"10px"},"& .MuiTablePagination-actions":{marginLeft:"unset !important"},"& .MuiToolbar-root > .MuiPagination-root":{marginLeft:"unset !important"},"& .MuiToolbar-root > .MuiPagination-root > .MuiPagination-ul":{flexWrap:"nowrap"},overflowX:"auto"},label:{margin:0,padding:0,paddingLeft:15,whiteSpace:"nowrap"},disabled:{pointerEvents:"none",opacity:.5},stretch:{flex:1}}),bm=function(e){return"Selected: ".concat(vm(e,{one:"item",many:"items"}))},ym=function(){return f.createElement(O,{size:"16px"})},wm=function(e){var t,n=gm().classes,r=pm().selection,o=fm(),i=o.loading,l=o.selectionLabel,c=void 0===l?bm:l,u=o.fallback,s=o.rows,d=o.BeforeSelectionLabel,m=to(function(){return c(r.size)});return f.createElement(j,a({},e,{className:Eo(e.className,n.root,(t={},t[n.disabled]=i,t))}),d&&f.createElement(d,a({},o)),f.createElement(_,{variant:"body1",className:n.label},f.createElement(Jr,{Loader:ym,deps:[r,s],fallback:u,throwError:!0},m)),f.createElement("div",{className:n.stretch}),e.children)},Em=function(e){var t=e.className,n=e.count,r=e.page,o=e.rowsPerPage,i=e.onPageChange,l=Math.ceil(n/o),c=r+1;return f.createElement(kt,{className:t,page:c,count:-1===n?Math.max(c+1,10):l,renderItem:function(e){return f.createElement(Ct,a({components:{previous:Xe,next:Ge}},e))},size:"small",onChange:function(e,t){return i(e,t-1)}})},xm=function(e){var t=e.width;e.height;var n=l(e,["width","height"]),r=fm(),o=r.withArrowPagination,i=void 0!==o&&o,c=r.withRangePagination,u=void 0!==c&&c,s=r.noDisplayedRows,d=void 0!==s&&s,m=r.rowsPerPage,p=r.limit,h=r.loading,v=t>500&&u?Em:void 0,g=n.count,b=n.rowsPerPage,y=n.page,E=n.onPageChange,x=to(function(e,t){if(-1===g)E(e,Math.max(y+t,0));else{var n=Math.ceil(g/b)-1;E(e,Math.min(Math.max(y+t,0),n))}});return w(function(){var e=function(e){var t=e.key;"ArrowRight"===t?x(e,1):"ArrowLeft"===t&&x(e,-1)};return i&&!h&&document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}},[i,h]),f.createElement(xt,a({},n,{sx:a(a({},d&&{"& .MuiTablePagination-displayedRows":{display:"none"}}),{width:t,overflow:"hidden",overflowX:"auto"}),component:wm,rowsPerPageOptions:m,labelDisplayedRows:function(e){var t=e.page,n=e.count;return-1===n?"#".concat(t+1):"".concat(t+1,"/").concat(Math.ceil(n/p))},labelRowsPerPage:"",ActionsComponent:v}))},Cm=Symbol("resize-event"),km=function(t){function n(){var n=t.apply(this,r([],e(arguments),!1))||this;return n.lastHeightRequest=n.props.heightRequest,n.lastWidthRequest=n.props.widthRequest,n._patchSizeRequest=function(e){e.heightRequest&&(n.lastHeightRequest=e.heightRequest),e.widthRequest&&(n.lastWidthRequest=e.widthRequest)},n.state={height:n.props.defaultHeight||0,width:n.props.defaultWidth||0,childHeight:n.props.defaultHeight||0,childWidth:n.props.defaultWidth||0},n._onResize=function(){var e=n.props.onResize;if(n._parentNode){var t=n._parentNode.offsetHeight||0,r=n._parentNode.offsetWidth||0,o=window.getComputedStyle(n._parentNode)||{},i=parseInt(o.paddingLeft,10)||0,a=parseInt(o.paddingRight,10)||0,l=t-(parseInt(o.paddingTop,10)||0)-(parseInt(o.paddingBottom,10)||0),c=r-i-a,u=n.lastHeightRequest(l),s=n.lastWidthRequest(c),d=!1;(d=(d=(d=(d=d||n.state.height!==l)||n.state.width!==c)||n.state.childHeight!==u)||n.state.childWidth!==s)&&(n.setState({height:l,width:c,childHeight:u,childWidth:s}),e({height:t,width:r}))}},n._setRef=function(e){n._autoSizer=e},n}return u(n,t),n.prototype.shouldComponentUpdate=function(e,t){this._patchSizeRequest(e);var n=!1;if(n=(n=(n=(n=n||this.state.height!==t.height)||this.state.width!==t.width)||this.state.childHeight!==t.childHeight)||this.state.childWidth!==t.childWidth)return!0;var r=!1;return r=(r=(r=(r=(r=r||e.className!==this.props.className)||e.withContainerHeight!==this.props.withContainerHeight)||e.withContainerWidth!==this.props.withContainerWidth)||!zn(e.style,this.props.style))||e.payload!==this.props.payload},n.prototype.componentDidMount=function(){var e,t,n,r=this.props.target||this._autoSizer;this.props.closest&&(r=(null==r?void 0:r.closest(this.props.closest))||null),this.props.selector&&(r=(null==r?void 0:r.querySelector(this.props.selector))||null),r&&r.parentNode&&r.parentNode.ownerDocument&&r.parentNode.ownerDocument.defaultView&&r.parentNode instanceof r.parentNode.ownerDocument.defaultView.HTMLElement&&(this._parentNode=r.parentNode,this._detectElementResize=(e=new Yn,t=function(){return e.emit(Cm)},n=new ResizeObserver(t),{addResizeListener:function(r,o){e.hasListeners||window.addEventListener("resize",t),n.observe(r),e.subscribe(Cm,o)},removeResizeListener:function(r,o){n.unobserve(r),e.unsubscribe(Cm,o),e.hasListeners||window.removeEventListener("resize",t)}}),this._detectElementResize.addResizeListener(this._parentNode,this._onResize),this._onResize())},n.prototype.componentWillUnmount=function(){this._detectElementResize&&this._parentNode&&this._detectElementResize.removeResizeListener(this._parentNode,this._onResize)},n.prototype.render=function(){var e=this.props,t=e.children,n=e.className,r=e.withContainerHeight,o=e.withContainerWidth,i=e.style,l=this.state,c=l.height,u=l.width,s=l.childHeight,d=l.childWidth,m={overflow:"visible"},p={payload:this.props.payload};return r&&(m.height=c),p.height=s,o&&(m.width=u),p.width=d,f.createElement("div",{className:n,ref:this._setRef,style:a(a({},m),i)},t(p))},n.defaultProps={onResize:function(){},heightRequest:function(e){return e},widthRequest:function(e){return e},withContainerHeight:!1,withContainerWidth:!1,style:{}},n}(f.Component),Sm=function(e,t){return function(n){return n>=e&&n<t}},Lm=function(e){var t=e.desktopView,n=void 0===t?function(){return f.createElement(f.Fragment,null)}:t,r=e.tabletView,o=void 0===r?n:r,i=e.phoneView,c=void 0===i?o:i,u=e.onViewChanged,s=e.params,d=l(e,["desktopView","tabletView","phoneView","onViewChanged","params"]),m=re(),p=b(""),v=h(function(){var e=m.breakpoints.values,t=e.xs,n=void 0===t?0:t,r=e.sm,o=void 0===r?600:r,i=e.lg,a=void 0===i?1280:i;return{isPhone:Sm(n,o),isTablet:Sm(o,a),isDesktop:Sm(a,1e16)}},[m]),g=v.isPhone,y=v.isTablet,w=function(e){p.current!==e&&u&&u(e),p.current=e},E=function(e){var t=e.width,r=e.payload,i="object"==typeof r?r:{payload:r};return g(t)?(w("phone"),f.createElement(c,a({},i))):y(t)?(w("tablet"),f.createElement(o,a({},i))):(w("desktop"),f.createElement(n,a({},i)))};return s?E(s):f.createElement(km,a({},d),E)},Nm=function(e,t){return function(n){return n>=e&&n<t}},Im=function(e){var t=re(),n=h(function(){var e=t.breakpoints.values,n=e.xs,r=void 0===n?0:n,o=e.sm,i=void 0===o?600:o,a=e.lg,l=void 0===a?1280:a;return{isPhoneFn:Nm(r,i),isTabletFn:Nm(i,l),isDesktopFn:Nm(l,1e16)}},[t]),r=n.isPhoneFn,o=n.isTabletFn,i=n.isDesktopFn;return{isPhone:r(e),isTablet:o(e),isDesktop:i(e)}};!function(e){e.Phone="phone",e.Tablet="tablet",e.Desktop="desktop"}(wf||(wf={}));var Mm,Rm=wf,Pm=e(Er(),2),Am=Pm[0],Tm=Pm[1],Dm=f.createContext(null),jm=function(e){var t=e.children,n=e.value,r=void 0===n?{}:n;return f.createElement(Dm.Provider,{value:r},t)},Om=function(){return v(Dm)},Fm=f.createContext(null),_m=function(e){var t=e.children,n=e.limit,r=e.offset,o=h(function(){return{limit:n,offset:r}},[n,r]);return f.createElement(Fm.Provider,{value:o},t)},Bm=function(){return v(Fm)},Hm=p(null),Wm=function(e){var t=e.children,n=e.value,r=Or(void 0===n?{}:n);return f.createElement(Hm.Provider,{value:r},t)},zm=function(){return v(Hm)},Vm=f.createContext(null),Ym=function(e){return f.createElement(Vm.Provider,{value:e.value},e.children)},Um=function(){return v(Vm)},qm=function(e){var t=v(Bh).CheckboxCell;return f.createElement(t,a({},e))},$m=An()({root:{position:"relative"}}),Xm=function(e){var t=$m().classes;return f.createElement(Et,{className:t.root,padding:"checkbox"},f.createElement(qm,a({},e)))},Gm=function(e){var t=v(Bh).CommonCell;return f.createElement(t,a({},e))};!function(e){e.Text="text-cell",e.Action="action-cell",e.CheckBox="checkbox-cell",e.Compute="compute-cell",e.Component="component-cell"}(Mm||(Mm={}));var Km=Mm,Qm=An()({root:{position:"relative",overflow:"hidden",paddingLeft:"0px !important",paddingRight:"0 !important",overflowWrap:"break-word"}}),Jm=function(e){var t=Qm().classes,n=e.column,r=n.type===Km.Component?"none":n.type===Km.CheckBox?"checkbox":"normal",o=n.type===Km.Action?"center":"left",i=n.width,l=i,c=n.minHeight;return f.createElement(Et,{className:t.root,style:{minWidth:i,maxWidth:l,minHeight:c},align:o,padding:r},f.createElement(Gm,a({},e)))},Zm=function(){var e=fm(),r=e.handleReload,o=e.computeKeepPageOnReload;return function(e){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return o()?[3,2]:[4,r(!1)];case 1:case 3:return[2,t.sent()];case 2:return[4,r(e)]}})})}},ep=!1,tp=null,np=new ar,rp=function(){return t(void 0,void 0,void 0,function(){var e,t,r,o,i,a,l,u,s,d,f;return n(this,function(n){switch(n.label){case 0:return[4,np.next()];case 1:if(n.sent(),ep=!0,tp)return tp(),[2];if(e=window.location,t=e.href,r=e.origin,o=e.protocol,!("caches"in window))return[3,10];n.label=2;case 2:return n.trys.push([2,8,9,10]),[4,window.caches.keys()];case 3:i=c.apply(void 0,[n.sent()]),a=i.next(),n.label=4;case 4:return a.done?[3,7]:(l=a.value,[4,caches.delete(l)]);case 5:n.sent(),n.label=6;case 6:return a=i.next(),[3,4];case 7:return[3,10];case 8:return u=n.sent(),d={error:u},[3,10];case 9:try{a&&!a.done&&(f=i.return)&&f.call(i)}finally{if(d)throw d.error}return[7];case 10:return"file:"!==o?((s=new URL(t,r)).pathname="/",s.search="",s.hash="",window.location.href=s.toString()):window.location.reload(!0),[2]}})})};window&&window.addEventListener&&window.addEventListener("beforeunload",function(e){ep&&e.stopImmediatePropagation()},!0),rp.override=function(e){tp=e},rp.listen=function(e){return np.subscribe(e)};var op,ip=function(e){return new function(){this.getValue=function(){try{return JSON.parse(sessionStorage.getItem(e)||"null")}catch(e){return null}},this.setValue=function(t){try{sessionStorage.setItem(e,JSON.stringify(t,null,2))}catch(e){e instanceof DOMException&&(console.log("react-declarative createSsManager exceeded the quota"),sessionStorage.clear(),rp())}},this.clear=function(){sessionStorage.removeItem(e)}}},ap=function(e){return e instanceof Promise?new Promise(function(r,o){return t(void 0,void 0,void 0,function(){var t,i;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,e];case 1:return t=n.sent(),r(!t),[3,3];case 2:return i=n.sent(),o(i),[3,3];case 3:return[2]}})})}):!e},lp=function(t){var n=e(t.split("_")),o=n[0],i=n.slice(1);return r(["".concat(o.charAt(0).toUpperCase()).concat(o.slice(1))],e(i),!1).join(" ")},cp=p(null),up=function(){return v(cp)},sp=function(t){var n=t.children,o=t.sortModel,i=fm().withSingleSort,a=void 0!==i&&i,l=e(g(new Map(o.map(function(e){return[String(e.field),e]}))),2),c=l[0],u=l[1],s=zr(c),d=fm().handleSortModel,f={sortModel:c,setSortModel:function(t){var n=s.current;if(a){var o=r([],e(t.values()),!1).find(function(e){var t=e.field,r=e.sort,o=n.get(t);return!o||o.sort!==r});t.forEach(function(e){var n=e.field;n!==(null==o?void 0:o.field)&&t.delete(n)})}d(r([],e(t.values()),!1)),u(new Map(t))}};return m.createElement(cp.Provider,{value:f},n)},dp=An()(function(e,t,n){var r;return{inactive:{opacity:.5},container:{width:300,height:340},list:(r={},r["& > .".concat(n.item,":nth-of-type(2n)")]={background:$(e.palette.getContrastText(e.palette.background.paper),.04)},r),item:{"& .MuiListItemText-root > .MuiTypography-root":{maxWidth:215,overflow:"hidden",textOverflow:"ellipsis"}}}}),fp=function(t){var n=t.columns,r=t.onClose,o=dp().classes,i=up(),c=i.sortModel,u=i.setSortModel,s=e(g(new Map(c)),2),d=s[0],m=s[1],p=n.map(function(e){var t=e.sortable,n=void 0===t||t,r=l(e,["sortable"]);return a({sortable:n},r)}).filter(function(e){return e.sortable});return f.createElement(Hf,{open:!0,onAccept:function(){u(d),r()},onDismiss:function(){r()}},f.createElement(j,{className:o.container},f.createElement(Ie,{className:o.list,disablePadding:!0},p.map(function(e,t){var n=d.get(e.field||""),r=(null==n?void 0:n.sort)||void 0,i="asc"===r?f.createElement(St,null):"desc"===r?f.createElement(Lt,null):f.createElement(St,{className:o.inactive}),a=e.headerName,l=void 0===a?lp(e.field||"")||"Unknown":a;return f.createElement(tt,{key:t,className:o.item,secondaryAction:i,onClick:function(){return function(e){var t=new Map(d),n=t.get(e);n?"asc"===n.sort?t.set(e,{field:e,sort:"desc"}):"desc"===n.sort&&t.delete(e):t.set(e,{field:e,sort:"asc"}),m(t)}(e.field)},component:Me},f.createElement(Oe,{primary:l}))}))))},mp=function(){return v(pp)},pp=p(null),hp=function(e){var t=e.children,n=fm().columns,r=h(function(){return n.filter(function(e){var t=!!e.field;return t=(t=t&&!1!==e.sortable)&&e.type!==Km.Action})},[]),o=_f(function(){return f.createElement(fp,{columns:r,onClose:function(){return a()}})},[]),i=o.showModal,a=o.hideModal;return f.createElement(pp.Provider,{value:function(){return i()}},t)},vp=function(e){var t=e.children;return f.createElement(Ff,null,f.createElement(hp,null,t))},gp=p(null),bp=function(){return v(gp)},yp=function(t){var n=t.children,o=e(g(new Map),2),i=o[0],a=o[1],l=fm().rows,u=pm().selection;w(function(){var e,t,n,r;if(u.size){var o=function(e){var t=l.find(function(t){return t.id===e});t&&i.set(e,t)};try{for(var s=c(u),d=s.next();!d.done;d=s.next()){o(p=d.value)}}catch(t){e={error:t}}finally{try{d&&!d.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}try{for(var f=c(i.keys()),m=f.next();!m.done;m=f.next()){var p=m.value;u.has(p)||i.delete(p)}}catch(e){n={error:e}}finally{try{m&&!m.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}a(new Map(i))}else a(new Map)},[u,l]);var s=h(function(){return r([],e(u),!1).map(function(e){return i.get(e)})},[i]),d={cachedRows:i,selectedRows:s};return m.createElement(gp.Provider,{value:d},n)},wp=function(){var e=fm().handleFilter;return function(){return e({})}},Ep=e(hl(),2),xp=Ep[0],Cp=Ep[1],kp=function(e){var t=v(Bh).OperationListSlot;return f.createElement(t,a({},e))},Sp=function(e){var t=v(Bh).ActionListSlot;return f.createElement(t,a({},e))},Lp=function(e){var t=v(Bh).FilterListSlot;return f.createElement(t,a({},e))},Np=function(e){var t=v(Bh).ChipListSlot;return f.createElement(t,a({},e))},Ip=function(e){var t=v(Bh).SearchSlot;return f.createElement(t,a({},e))},Mp="react-declarative__listRootMark",Rp=[],Pp=An()({root:{position:"relative",height:"100%",width:"100%"},container:{position:"absolute",top:0,left:0},content:{position:"relative",display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column"},inner:{position:"absolute",top:0,left:0,display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column",overflow:"hidden","& > :nth-of-type(1)":{flex:1}},stretch:{flex:1},noElevation:{background:"transparent"},beforeActionList:{width:"100%",display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *":{flex:1}},afterActionList:{width:"100%",display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *":{flex:1}},hidden:{display:"none"},rendering:{visibility:"hidden"}}),Ap=x(function(t,n){var r,o,i,a,l,c,u,s,d=Pp().classes,m=zm(),p=Bm(),v=Tm().constraintManager,g=e(Cp(),1)[0],b=tl().isMobile,y=t.className,E=t.style,x=t.filters,C=void 0===x?[]:x,k=t.actions,S=void 0===k?[]:k,L=t.actionSubject,N=t.listChips,I=t.denseHeight,M=t.isDense,R=t.heightRequest,P=void 0===R?function(e){return e}:R,A=t.widthRequest,T=void 0===A?function(e){return e}:A,D=t.operations,O=t.title,F=void 0===O?"":O,_=t.filterLabel,B=void 0===_?"":_,H=t.filterData,W=t.computeKeepPageOnReload,z=t.handleFilter,V=t.handleDefault,Y=t.handleChips,U=t.handleLimitChange,q=t.handlePageChange,$=t.handleReload,X=t.handleRerender,G=t.handleRowsChange,K=t.handleSortModel,Q=t.initComplete,J=t.children,Z=t.isChooser,ee=t.loading,te=t.withToggledFilters,ne=t.onFilterChange,re=t.onResize,oe=t.onAction,ie=t.withSearch,ae=void 0!==ie&&ie,le=t.search,ce=t.sortModel,ue=void 0===ce?Rp:ce,se=t.chips,de=t.handleSearch,fe=t.handleFiltersCollapsed,me=t.sizeByElement,pe=void 0===me||me,he=t.withOutlinePaper,ve=void 0!==he&&he,ge=t.withTransparentPaper,be=void 0!==ge&&ge,ye=t.rerender,we=void 0!==ye&&ye,Ee=t.BeforeActionList,xe=t.AfterActionList,Ce=t.BeforeOperationList,ke=t.AfterOperationList,Se=bp().selectedRows,Le=bi({target:pe?void 0:document.body,debounce:100,compute:function(e){var t=e.height,n=e.width;return{height:P(t),width:T(n)}},onResize:re}),Ne=Le.elementRef,Ie=Le.size,Me=h(function(){if(M)return!0;if(b)return!1;var e=Ie.height;return!!I&&I>e},[I,Ie.height,b,M]),Re=bi({debounce:100}),Pe=Re.elementRef,Ae=Re.size;w(function(){v.clear(),g.clear()},[H,p,ue,se,le,m]);var Te=mp(),De=wp(),je=Zm(),Oe=to(function(e){(null==S?void 0:S.length)||("update-now"===e?je():"resort-action"===e?Te():"drop-filters"===e&&De(),oe&&oe(e,Se,je))});return Xf(function(){return L&&L.subscribe(Oe)}),f.createElement(j,{ref:Ne,className:Eo(d.root,y,Mp,(r={},r[d.rendering]=!Ie.height||!Ae.height,r)),style:E},f.createElement("div",{className:Eo(d.container,"react-declarative__listContainerMark")},f.createElement("div",{ref:n,style:Ie,className:Eo(d.content,d.stretch,"react-declarative__listContentMark")},Q&&f.createElement("div",{className:Eo((o={},o[d.hidden]=Me,o))},Ee&&f.createElement(j,{className:d.beforeActionList},f.createElement(Ee,{filterData:H,chips:se,pagination:p,payload:m,search:le,sortModel:ue,computeKeepPageOnReload:W,handleFilter:z,handleDefault:V,handleChips:Y,handleLimitChange:U,handlePageChange:q,handleReload:$,handleRerender:X,handleRowsChange:G,handleSortModel:K,handleSearch:de,handleFiltersCollapsed:fe}))),f.createElement("div",null,!!(null==S?void 0:S.length)&&f.createElement(Sp,{height:Ie.height,width:Ie.width,title:F,filterData:H,actions:S})),Q&&f.createElement("div",{className:Eo((i={},i[d.hidden]=Me,i))},xe&&f.createElement(j,{className:d.afterActionList},f.createElement(xe,{filterData:H,chips:se,pagination:p,payload:m,search:le,sortModel:ue,computeKeepPageOnReload:W,handleFilter:z,handleDefault:V,handleChips:Y,handleLimitChange:U,handlePageChange:q,handleReload:$,handleRerender:X,handleRowsChange:G,handleSortModel:K,handleSearch:de,handleFiltersCollapsed:fe}))),Q&&f.createElement("div",{className:Eo((a={},a[d.hidden]=Me,a))},Ce&&f.createElement(j,{className:d.beforeActionList},f.createElement(Ce,{filterData:H,chips:se,pagination:p,payload:m,search:le,sortModel:ue,computeKeepPageOnReload:W,handleFilter:z,handleDefault:V,handleChips:Y,handleLimitChange:U,handlePageChange:q,handleReload:$,handleRerender:X,handleRowsChange:G,handleSortModel:K,handleSearch:de,handleFiltersCollapsed:fe}))),f.createElement("div",{className:Eo((l={},l[d.hidden]=Me,l))},Array.isArray(D)&&!!D.length&&f.createElement(kp,{operations:D,width:Ie.width})),Q&&f.createElement("div",{className:Eo((c={},c[d.hidden]=Me,c))},ke&&f.createElement(j,{className:d.beforeActionList},f.createElement(ke,{filterData:H,chips:se,pagination:p,payload:m,search:le,sortModel:ue,computeKeepPageOnReload:W,handleFilter:z,handleDefault:V,handleChips:Y,handleLimitChange:U,handlePageChange:q,handleReload:$,handleRerender:X,handleRowsChange:G,handleSortModel:K,handleSearch:de,handleFiltersCollapsed:fe}))),f.createElement(ra,{className:Eo(d.content,d.stretch,"react-declarative__listPaperMark",(u={},u[d.noElevation]=Z,u)),outlinePaper:ve,transparentPaper:be},f.createElement("div",null,!Z&&Array.isArray(C)&&!!C.length&&f.createElement(Lp,{filterData:H,withToggledFilters:te,onFilterChange:ne,change:z,onSearchChange:de,onCollapsedChange:fe,clean:V,label:B,filters:C,loading:ee,search:le,height:Ie.height,width:Ie.width,withSearch:ae})),f.createElement("div",null,!Z&&(!Array.isArray(C)||!C.length)&&ae&&f.createElement(Ip,{onSearchChange:de,clean:V,search:le,height:Ie.height,width:Ie.width,loading:ee,label:B})),f.createElement("div",{className:Eo((s={},s[d.hidden]=Me,s))},!Z&&Array.isArray(N)&&!!N.length&&f.createElement(Np,{listChips:N,loading:ee})),f.createElement(j,{ref:Pe,className:Eo(d.content,d.stretch)},f.createElement("div",{className:Eo(d.inner,"react-declarative__listInnerMark"),style:Ae},!we&&f.createElement(f.Fragment,null,J)))))))}),Tp=e(Er(),2),Dp=Tp[0],jp=Tp[1],Op=ip("LIST_RESTORE_POS_ID"),Fp=function(e){var r=this;this.withRestorePos=e,this.reloadSubject=new ar,this.idMap=new Map,this.viewportMap=new Map,this.isListening=!0,this.getIsVisible=function(e){return!!r.viewportMap.get(e)},this.getElementCount=function(){return r.idMap.size},this._applyScroll=function(e){var t=0;return function(n,r){return e.viewportMap.get(n)&&!(t++<3)||(r.scrollIntoView({block:"start"}),!1)}}(this),this.emitSubject=Jn(function(){r.reloadSubject.next()},450),this.intersectionObserver=new IntersectionObserver(function(e){e.forEach(function(e){var t=e.target,n=r.idMap.get(t);n?(r.viewportMap.set(n,e.isIntersecting),r.emitSubject()):console.error("List IntersectionManager id is undefined")})}),this.observe=function(e,t){r.withRestorePos&&(r.intersectionObserver.observe(t),r.idMap.set(t,e),r.viewportMap.set(e,!1))},this.unobserve=function(e,t){r.withRestorePos&&(r.idMap.delete(t),r.viewportMap.delete(e))},this.scrollIntoView=function(e){return t(r,void 0,void 0,function(){var t,r;return n(this,function(n){switch(n.label){case 0:t=0,n.label=1;case 1:return 20===t?[3,8]:(r=document.querySelector("[data-intersectionid='".concat(e,"']")))?[3,3]:[4,qn(250)];case 2:return n.sent(),[3,7];case 3:return function(e){var t=document.querySelector(".".concat(Mp)),n=function(e){for(var t=e.parentElement;t;){if(t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return null}(e);return(null==t?void 0:t.contains(n))?n:null}(r)?[3,5]:[4,qn(250)];case 4:return n.sent(),[3,7];case 5:return this._applyScroll(e,r)?[2,!0]:[4,qn(250)];case 6:n.sent(),n.label=7;case 7:return t++,[3,1];case 8:return[2,!1]}})})},this.disconnect=function(){r.intersectionObserver.disconnect(),r.isListening=!1}},_p=function(r){var o=r.children,i=fm(),a=i.rows,l=i.withRestorePos,u=Or(function(){return new Fp(!!l)}),s=zr(a),d=b(!0);w(function(){return function(){d.current=!1,u.disconnect()}},[]);var m=y(function(){return t(void 0,void 0,void 0,function(){var e;return n(this,function(t){switch(t.label){case 0:return e=u.getElementCount(),d.current?0!==e&&e>=s.current.length?[3,2]:[4,qn(100)]:[2];case 1:return t.sent(),[3,0];case 2:return[2]}})})},[]);return w(function(){if(l)return u.reloadSubject.subscribe(function(){var t,n,r=9999999999,o=function(e,t){if(!t)return"continue";var n=s.current.findIndex(function(t){return t.id===e});if(-1===n)return"continue";r=Math.min(n,r)};try{for(var i=c(u.viewportMap.entries()),a=i.next();!a.done;a=i.next()){var l=e(a.value,2);o(l[0],l[1])}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}var d=s.current[r];d&&Op.setValue(d.id)})}),kc(function(){return t(void 0,void 0,void 0,function(){var e;return n(this,function(t){switch(t.label){case 0:return e=Op.getValue(),l&&e?[4,m()]:[2];case 1:return t.sent(),[4,ap(u.scrollIntoView(e))];case 2:return t.sent()&&console.error("List IntersectionProvider scrollIntoView failed: id=".concat(e," not found")),[2]}})})}),f.createElement(Dp,{payload:u},o)},Bp=function(t){var n=e(g(null),2),r=n[0],o=n[1],i=jp();return w(function(){if(r&&i)return r.dataset.intersectionid=String(t),i.observe(t,r),function(){return i.unobserve(t,r)}},[r]),y(function(e){i&&i.withRestorePos&&(e&&(e.dataset.intersectionid=String(t)),o(e))},[])},Hp=function(t){var n=jp(),r=e(g(function(){return!!(null==n?void 0:n.getIsVisible(t))}),2),o=r[0],i=r[1],a=b(!0);return w(function(){return function(){a.current=!1}},[]),w(function(){return null==n?void 0:n.reloadSubject.subscribe(function(){queueMicrotask(function(){a.current&&i(n.getIsVisible(t))})})},[]),!n||(!n.withRestorePos||o)},Wp=function(){return Op},zp=An()({root:{},cellStretch:{width:"100%"},separator:{minWidth:32,maxWidth:32},disabled:{pointerEvents:"none",opacity:.5}}),Vp=An()({root:{position:"relative",width:48,maxWidth:48}}),Yp=function(e){var t=Vp().classes;return f.createElement(Et,{className:t.root,padding:"checkbox"},f.createElement(qm,a({},e)))},Up=Object.freeze({__proto__:null,thinsp:" ",nbsp:" ",emdash:"—",endash:"–",terminator:"\0",bullet:"•"}),qp="react_declarative_listMobileCell",$p=An()({root:{position:"relative",paddingBottom:"0 !important"},noGutters:{paddingLeft:"0 !important",paddingRight:"0 !important"},container:{minHeight:"100%",width:"100%",display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column",flexWrap:"wrap"},content:{position:"relative",overflow:"hidden",overflowWrap:"break-word",fontWeight:"bold",flex:1},shrinkWidth:{width:48,maxWidth:48}}),Xp=function(e){var t,n=e.className,r=e.colSpan,o=e.withLabel,i=e.fullWidth,c=e.disableGutters,u=l(e,["className","colSpan","withLabel","fullWidth","disableGutters"]),s=$p().classes,d=u.column,m=h(function(){return d.minHeight||(d.type===Km.Component?70:void 0)},[]),p=h(function(){return Math.max(i-35,0)},[i]),v=d.headerName,g=void 0===v?lp(d.field||"")||"Unknown":v;return f.createElement(Et,{className:Eo(s.root,n,(t={},t[s.noGutters]=c,t[s.shrinkWidth]=d.type===Km.Action,t)),colSpan:r},f.createElement(j,{className:s.container},o&&f.createElement(_,{variant:"body1"},S(k,{children:["".concat("•"," "),g]})),f.createElement(j,{className:Eo(s.content,qp),style:{minHeight:m,maxWidth:p}},f.createElement(Gm,a({},u,{fullWidth:i})))))},Gp=An()(function(e){var t;return{root:{"&:nth-of-type(2n)":{background:$(e.palette.getContrastText(e.palette.background.paper),.04)},"& > .MuiTableCell-root":{borderBottom:"1px solid ".concat(e.palette.divider)},overflow:"hidden"},row:{"& .MuiTableCell-root":{borderBottom:"0 !important",overflow:"hidden"},marginBottom:16},disabled:{pointerEvents:"none",opacity:.5},hideIfEmpty:(t={},t["&:has(.".concat(qp," > :empty)")]={display:"none"},t["&:has(.".concat(qp,":empty)")]={display:"none"},t)}}),Kp=function(e){var t=pm(),n=t.selection,r=t.setSelection;return function(t){return void 0===t&&(t=!1),function(o){o.preventDefault(),o.stopPropagation(),n.has(e.id)?n.delete(e.id):(t&&n.clear(),n.add(e.id)),r(n)}}},Qp=function(r){var o=r.row,i=e(g(""),2),a=i[0],l=i[1],c=b(!0),u=fm(),s=u.fallback,d=u.rowMark;return w(function(){t(void 0,void 0,void 0,function(){var e,t,r;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,6,,7]),"function"!=typeof d?[3,4]:(e=d(o))instanceof Promise?[4,e]:[3,2];case 1:return t=n.sent(),[3,3];case 2:t=e,n.label=3;case 3:return e=t,c.current&&l(e),[3,5];case 4:d&&c.current&&l(o[d]),n.label=5;case 5:return[3,7];case 6:return r=n.sent(),s&&s(r),[3,7];case 7:return[2]}})})},[o,d]),E(function(){return function(){c.current=!1}},[]),a},Jp=An()({root:{position:"relative"},mark:{position:"absolute",top:0,left:0,bottom:0,width:4}}),Zp="list-item",eh=An()({stretch:{position:"absolute",top:0,left:0,right:0,bottom:0,height:"100%",width:"100%",display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *:nth-of-type(1)":{flex:1}}}),th=An()(function(e){return{cell:{paddingLeft:"0px !important",paddingRight:"0 !important",background:"".concat(e.palette.background.paper," !important")},bold:{fontWeight:"bold !important",opacity:.7},menu:{margin:"0 !important",padding:"0 !important",width:"unset !important",height:"unset !important","& .MuiSvgIcon-root":{height:"20px !important",width:"20px !important"}},cellStretch:{width:"100%",background:"".concat(e.palette.background.paper," !important")},separator:{minWidth:32,maxWidth:32,background:"".concat(e.palette.background.paper," !important")},checkbox:{marginLeft:"4px"}}}),nh="list-columns",rh=function(e){var t,n=e.columns,r=th().classes,o=fm(),i=up(),u=i.sortModel,s=i.setSortModel,d=pm(),m=d.selection,p=d.setSelection,v=bp().selectedRows,g=zm(),b=Zm(),w=o.selectionMode,E=o.loading,x=o.onColumnAction,C=o.onLoadStart,k=o.onLoadEnd,S=o.fallback,L=h(function(){var e,t;try{for(var n=c(o.rows),r=n.next();!r.done;r=n.next()){var i=r.value;if(!m.has(i.id))return!1}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return!!o.rows.length},[m,o.rows]),N=!!m.size&&!L,I=function(){return w===Si.Single?f.createElement(Ce,{className:r.checkbox,key:m.size,disabled:E,color:"primary",onChange:function(){p(new Set)}}):w===Si.Multiple?f.createElement(ve,{className:r.checkbox,disabled:E,color:"primary",checked:L,indeterminate:N,onClick:function(){w!==Si.None&&(w!==Si.Single?L?p(new Set):(o.rows.forEach(function(e){var t=e.id;return m.add(t)}),p(m)):p(new Set))}}):f.createElement(ve,{className:r.checkbox,color:"primary",disabled:!0})},M=y(function(e){var t=new Map(u),n=u.get(e);n?"asc"===n.sort?t.set(e,{field:e,sort:"desc"}):"desc"===n.sort&&t.delete(e):t.set(e,{field:e,sort:"asc"}),s(t)},[u]),R=function(){return C&&C(nh)},P=function(e){return k&&k(e,nh)};return f.createElement(wt,null,f.createElement(Et,{className:r.cell,padding:"checkbox"},w===Si.None?f.createElement(f.Fragment,null,I()):f.createElement(Nt,{title:w===Si.Single?"Deselect":N?"Select all":L?"Deselect":"Select all"},I())),(t=n.map(function(e,t){var n=u.get(e.field||""),o=(null==n?void 0:n.sort)||void 0,i=!!e.field;i=(i=i&&!1!==e.sortable)&&e.type!==Km.Action;var c,s=e.width,d=s,m=e.type===Km.Action?"center":"left",p=e.headerName,h=void 0===p?lp(e.field||"")||"Unknown":p;return f.createElement(f.Fragment,null,t>0&&f.createElement(Et,{className:r.separator}),f.createElement(Et,{className:r.cell,key:t,align:m,style:{minWidth:s,maxWidth:d},sortDirection:o},f.createElement(j,{sx:{width:"calc(100% - 40px)",display:"inline-block"}},i?f.createElement(It,{className:r.bold,active:!!n,direction:o,onClick:function(){i&&M(e.field)},disabled:E},h):f.createElement("span",{className:r.bold},h)),!!e.columnMenu&&f.createElement(xa,{transparent:!0,className:r.menu,options:e.columnMenu.map(function(e){var t=e.isDisabled,n=void 0===t?function(){return!1}:t,r=e.isVisible,o=void 0===r?function(){return!0}:r,i=l(e,["isDisabled","isVisible"]);return a(a({},i),{isDisabled:function(){return n(v,g)},isVisible:function(){return o(v,g)}})}),onAction:(c=e.field||"unset-field",function(e){return x&&x(c,e,v,b)}),fallback:S,payload:v,onLoadStart:R,onLoadEnd:P,disabled:E,deps:[g],throwError:!0})))}),t),f.createElement(Et,{className:r.cellStretch}))},oh=function(){return f.createElement(f.Fragment,null)},ih="action-menu",ah=An()({button:{borderRadius:"50px !important",minHeight:"40px !important",paddingLeft:"15px !important",paddingRight:"15px !important",zIndex:99},fab:{zIndex:99}}),lh=e(Er(),2),ch=lh[0],uh=lh[1],sh="action-menu",dh="action-menu",fh=An()({button:{borderRadius:"50px !important",minHeight:"40px !important",paddingLeft:"15px !important",paddingRight:"15px !important"},fab:{zIndex:99}}),mh=e(Er(),2),ph=mh[0],hh=mh[1],vh=p(null),gh=function(){return v(vh)},bh=function(t){var n=t.children,o=t.chips,i=t.chipData,l=e(g(new Map(o.map(function(e){var t=e.name,n=e.enabled,r=void 0!==n&&n;return[t.toString(),i[t]||r]}))),2),c=l[0],u=l[1],s=fm().handleChips,d={chips:c,setChips:function(t){s(r([],e(t),!1).reduce(function(t,n){var r,o=e(n,2),i=o[0],l=o[1];return a(a({},t),((r={})[i]=l,r))},{})),u(new Map(t))}};return m.createElement(vh.Provider,{value:d},n)},yh=An()(function(e){return{root:{height:48,width:"100%",background:$(e.palette.getContrastText(e.palette.background.paper),.05)},stretch:{flex:1}}}),wh=function(t){var n=t.listChips,o=void 0===n?[]:n,i=t.loading,l=yh().classes,c=gh(),u=c.chips,s=c.setChips,d=fm(),m=d.withSingleChip,p=d.AfterChips,h=function(t,n){return void 0===n&&(n=!0),function(){m&&r([],e(u.keys()),!1).forEach(function(e){return u.set(e,!1)}),u.set(t,n),s(u)}};return f.createElement(nm,{className:l.root,hideOverflowY:!0},f.createElement(we,{width:"100%",alignItems:"center",direction:"row",spacing:1,pl:1},o.map(function(e,t){var n=e.name.toString(),r=!!u.get(n);return f.createElement(ge,{key:t,sx:{pointerEvents:"none","& span:last-of-type":{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",maxWidth:"125px"}},control:f.createElement(ve,{onClick:h(n,!r),sx:{pointerEvents:"all"},checked:r}),label:e.label,disabled:i})}),f.createElement("div",{className:l.stretch}),p&&f.createElement(p,a({},t))))};!function(e){e.Add="add-action",e.Fab="fab-action",e.Menu="menu-action"}(op||(op={}));var Eh,xh,Ch,kh,Sh=op,Lh=function(e){var t=v(Bh).ActionMenu;return f.createElement(t,a({},e))},Nh=function(e){var t=v(Bh).ActionAdd;return f.createElement(t,a({},e))},Ih=function(e){var t=v(Bh).ActionFab;return f.createElement(t,a({},e))},Mh=An()(function(e){return{root:{display:"flex",alignItems:"center",justifyContent:"stretch",minHeight:70,"& > *:nth-of-type(n + 1)":{marginLeft:e.spacing(1)},marginBottom:5},stretch:{flex:1},noData:{maxHeight:0},title:{color:e.palette.primary.main,marginLeft:"unset !important",fontWeight:"bold",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"}}}),Rh=function(e,t){var n=void 0===t?{}:t,r=n.inputFormatterSymbol,o=void 0===r?"0":r,i=n.inputFormatterAllowed,a=n.inputFormatterReplace,l=n.inputFormatterTemplate,c=void 0===l?"":l,u=n.inputFormatter,s=void 0===u?function(e){return yl(e,c,{symbol:o,allowed:i,replace:a})}:u,d="string"==typeof e?e:"";d="";for(var f=0;f<e.length;f++)d=s(d+=e[f]);return d},Ph=Symbol("never-pos"),Ah=function(t){var n=t.inputFormatterSymbol,r=void 0===n?"0":n,o=t.inputFormatterAllowed,i=t.inputFormatterReplace,a=t.inputFormatterTemplate,l=void 0===a?"00000000000000000000000000000000000000000000000000":a,c=t.inputFormatter,u=void 0===c?function(e){return yl(e,l,{symbol:r,allowed:o,replace:i})}:c,s=t.value,d=void 0===s?"":s,f=t.onChange,m=b(null),p=e(g(d),2),v=p[0],w=p[1],x=zr(v);$r(function(){var e;d!==x.current&&(w(Rh(d,{inputFormatter:u,inputFormatterSymbol:r,inputFormatterAllowed:o,inputFormatterReplace:i,inputFormatterTemplate:l})),null===(e=m.current)||void 0===e||e.setSelectionRange(null,null))},[d]);var C=h(function(){var e=Ph;return{render:function(){var t=m.current;t&&"text"!==t.type||"number"==typeof e&&(null==t||t.setSelectionRange(e,e),e=Ph)},pos:function(){var t,n=m.current;return n&&(e=(t=n).selectionStart||t.value.length,e+=function(e){for(var t=0,n=Math.max(e-1,0);n<l.length&&l[n]!==r;n++)t+=1;return t}(e)),e}}},[]);E(function(){if(l){var e=m.current,t=function(){return C.pos()};return e&&e.addEventListener("keyup",t),e&&e.addEventListener("click",t),function(){e&&e.removeEventListener("keyup",t),e&&e.removeEventListener("click",t)}}},[m.current]),E(function(){(l||i||o)&&C.render()},[v]);var k=y(function(e){var t=e.target.value;if(l||i||o){t="";for(var n=0;n<e.target.value.length;n++)t+=e.target.value[n],t=u(t);C.pos()}w(t),f&&f(t)},[]);return{inputRef:m,inputValue:v,onInputChange:k}},Th=An()(function(e){return{root:{display:"flex",alignItems:"stretch",justifyContent:"stretch",background:A(e.palette.getContrastText(e.palette.background.paper),.05)},container:{flex:1,minHeight:60,maxHeight:"50vh",overflow:"hidden",overflowY:"auto"},controls:{display:"flex",alignItems:"center"},controlsWidth:{minWidth:75,marginRight:5,flexDirection:"row-reverse"},title:{display:"flex",alignItems:"center"},disabled:{pointerEvents:"none",userSelect:"none",opacity:.5},labelContent:{display:"flex",minHeight:"60px","& > *:nth-of-type(1)":{flex:1},padding:e.spacing(1)},filters:{padding:e.spacing(1),overflowX:"hidden",overflowY:"auto"}}}),Dh=function(t){var n,r,o=t.className,i=t.style,a=t.height,l=t.filterData,c=t.filters,u=t.change,s=t.label,d=t.loading,m=t.withSearch,p=t.withToggledFilters,h=t.search,v=t.onSearchChange,E=void 0===v?function(){return null}:v,x=t.onFilterChange,C=void 0===x?function(){return null}:x,k=t.onCollapsedChange,S=void 0===k?function(){return null}:k,L=zm(),N=fm(),I=N.features,M=N.readTransform,R=N.writeTransform,P=N.incomingTransform,A=N.outgoingTransform,T=N.isBaseline,D=N.isBaselineForRoot,O=Th().classes,F=e(g(!!p),2),B=F[0],H=F[1],W=e(g(!1),2),z=W[0],V=W[1],Y=b(!1),U=Ah({value:h,onChange:E}),q=U.inputRef,$=U.inputValue,X=U.onInputChange;w(function(){Y.current&&(V(!0),setTimeout(G,1e3))},[B]),w(function(){return Y.current=!0,function(){Y.current=!1}},[]);var G=y(function(){Y.current&&(S(B),setTimeout(function(){return V(!1)},100))},[B]),K=function(){E("")};return f.createElement("div",{className:Eo(o,O.root),style:i},f.createElement("div",{className:O.container},f.createElement(Dt,{onTransitionEnd:G,in:B},f.createElement(j,{className:Eo(O.filters,(n={},n[O.disabled]=d,n)),sx:{maxHeight:Math.max(a/2-150,220)}},f.createElement(bf,{features:I,readTransform:M,writeTransform:R,incomingTransform:P,outgoingTransform:A,isBaseline:T,isBaselineForRoot:D,handler:l,payload:L,fields:c,change:function(e){C(e),u(e)},readonly:d}))),f.createElement(Dt,{in:!B},f.createElement(j,{className:O.labelContent},function(){var e;return m?f.createElement(xe,{label:"Search",variant:"standard",inputRef:q,value:$,onChange:X,onKeyDown:function(e){var t=e.key,n=e.currentTarget;"Enter"!==t&&"Escape"!==t||n.blur()},className:Eo((e={},e[O.disabled]=d,e)),sx:{maxWidth:"max(calc(50% - 75px), 256px)"},InputProps:{readOnly:d,startAdornment:f.createElement(Le,{position:"start"},f.createElement(ot,null)),endAdornment:!!h&&f.createElement(Le,{sx:{cursor:"pointer",marginBottom:"15px"},onClick:K,position:"end"},f.createElement(Fe,null))},placeholder:s,InputLabelProps:{shrink:!0},focused:!0}):f.createElement(_,{variant:"body1",className:O.title},s)}()))),f.createElement("div",{className:Eo(O.controls,(r={},r[O.controlsWidth]=!p,r))},!p&&f.createElement(Ne,{disabled:z,onClick:function(){return H(!B)}},B?f.createElement(jt,null):f.createElement(it,null))))},jh="list-operations",Oh=An()(function(e){return{root:{height:50,width:"100%",background:$(e.palette.getContrastText(e.palette.background.paper),.05)},container:{minWidth:"100%",display:"flex",alignItems:"stretch",justifyContent:"stretch"},content:{flex:1,display:"flex",alignItems:"center","& > *":{marginRight:"5px !important",whiteSpace:"nowrap"}},label:{display:"flex",whiteSpace:"nowrap"},checkbox:{display:"flex",alignItems:"center"}}}),Fh=An()(function(e){return{root:{display:"flex",alignItems:"stretch",justifyContent:"stretch",background:A(e.palette.getContrastText(e.palette.background.paper),.05)},container:{flex:1,minHeight:60,maxHeight:"50vh",overflow:"hidden",overflowY:"auto"},controls:{display:"flex",alignItems:"center",minWidth:75,marginRight:5,flexDirection:"row-reverse"},disabled:{pointerEvents:"none",userSelect:"none",opacity:.5},labelContent:{display:"flex",minHeight:"60px","& > *:nth-of-type(1)":{flex:1},padding:e.spacing(1)}}}),_h={BodyRow:function(e){var t=fm().withMobile,n=void 0!==t&&t,r=v(Bh),o=r.MobileBodyRow,i=r.DesktopBodyRow;return e.mode===Rm.Phone&&n?f.createElement(o,a({},e)):f.createElement(i,a({},e))},CheckboxCell:function(e){var t=e.row,n=e.disabled,r=Jp().classes,o=pm().selection,i=Qp({row:t}),a=fm(),l=a.selectionMode,c=void 0===l?Si.None:l,u=a.rowMark,s=a.loading,d=Kp(t);return f.createElement(f.Fragment,null,u&&f.createElement(j,{className:r.mark,style:{background:i}}),c===Si.Single?f.createElement(Ce,{color:"primary",onClick:d(!0),checked:o.has(t.id),disabled:s||n}):c===Si.Multiple?f.createElement(ve,{color:"primary",onClick:d(!1),checked:o.has(t.id),disabled:s||n}):c===Si.None?f.createElement(ve,{color:"primary",disabled:!0}):null)},CommonCell:function(e){var r=e.column,o=e.row,i=e.disabled,c=e.onMenuToggle,u=e.onAction,s=Hp(o.id),d=eh().classes,m=zm(),p=zr(o),h=fm(),v=h.fallback,g=h.rowActions,b=void 0===g?[]:g,y=h.onLoadStart,w=h.onLoadEnd,E=h.loading,x=function(){return y&&y(Zp)},C=function(e){return w&&w(e,Zp)};if(r.type===Km.Text)return o[r.field];if(r.type===Km.Compute)return f.createElement(Jr,{disabled:!s,payload:o,deps:[m],fallback:v,onLoadStart:x,onLoadEnd:C,throwError:!0},function(e){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return t=a(a({},e),{_payload:m}),r.element?[2,S(r.element,t)]:[3,1];case 1:return r.compute?[4,r.compute(t,m)]:[3,3];case 2:return[2,n.sent()];case 3:return[2,null]}})})});if(r.type===Km.CheckBox)return f.createElement(ve,{color:"primary",disabled:!0,checked:o[r.field]});if(r.type===Km.Component){var L=r.element,N=void 0===L?function(){return f.createElement(k,null)}:L;return f.createElement(j,{className:d.stretch},f.createElement(N,a({},o,{_payload:m})))}return r.type===Km.Action?f.createElement(xa,{transparent:!0,options:b.map(function(e){var t=e.isVisible,n=void 0===t?function(){return!0}:t,r=e.isDisabled,o=void 0===r?function(){return!1}:r,i=l(e,["isVisible","isDisabled"]);return a(a({},i),{isVisible:function(){return n(p.current,m)},isDisabled:function(){return o(p.current,m)}})}),onToggle:c,onAction:u,fallback:v,payload:o,deps:[m],onLoadStart:x,onLoadEnd:C,disabled:E||i,throwError:!0}):null},HeadRow:function(e){var t=fm().withMobile,n=void 0!==t&&t;return e.mode===Rm.Phone&&n?f.createElement(oh,a({},e)):f.createElement(rh,a({},e))},ActionAdd:function(e){var r=e.action,o=void 0===r?"add-action":r,i=e.width,a=e.label,l=e.isVisible,c=void 0===l?function(){return!0}:l,u=e.isDisabled,s=void 0===u?function(){return!1}:u,d=ah().classes,m=zm(),p=fm(),h=Zm(),v=bp().selectedRows,g=p.fallback,b=p.onAction,y=p.onLoadStart,w=p.onLoadEnd,E=to(function(e){e.stopPropagation(),b&&b(o,v,h)}),x=function(e){var t=e.disabled,n=e.onClick,r=uh(),o=fm().loading;return a&&!r?f.createElement(ye,{className:d.button,variant:"contained",disabled:o||t,size:"medium",startIcon:f.createElement(Mt,{color:"inherit"}),onClick:n},a):f.createElement(Te,{className:d.fab,disabled:o||t,size:"small",color:"primary",onClick:n},f.createElement(Mt,{color:"inherit"}))},C=i<500;return f.createElement(ch,{payload:C},f.createElement(Jr,{Loader:function(){var e=uh();return a&&!e?f.createElement(ye,{className:d.button,variant:"contained",size:"small",startIcon:f.createElement(Mt,{color:"inherit"})},a):f.createElement(Te,{className:d.fab,disabled:!0,size:"small",color:"primary"},f.createElement(Mt,{color:"inherit"}))},fallback:g,onLoadStart:function(){return y&&y(ih)},onLoadEnd:function(e){return w&&w(e,ih)},payload:v,deps:[m],throwError:!0},function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:return[4,c(v,m)];case 1:return e=n.sent(),[4,s(v,m)];case 2:return t=n.sent(),e?[2,f.createElement(x,{disabled:t,onClick:E})]:[2,null]}})})}))},ActionMenu:function(t){var n=t.options,o=void 0===n?[]:n,i=t.deps,c=void 0===i?[]:i,u=bp().selectedRows,s=mp(),d=wp(),m=Zm(),p=zm(),h=fm(),v=h.onAction,g=h.fallback,b=h.onLoadStart,y=h.onLoadEnd,w=h.loading,E=h.actionSubject,x=to(function(e){"update-now"===e?m():"resort-action"===e?s():"drop-filters"===e&&d(),v&&v(e,u,m)});Xf(function(){return E&&E.subscribe(x)});return E?null:f.createElement(xa,{options:o.map(function(e){var t=e.action,n=e.isDisabled,r=void 0===n?function(){return!1}:n,o=e.isVisible,i=void 0===o?function(){return!0}:o,c=l(e,["action","isDisabled","isVisible"]);return a(a({action:t},c),"update-now"===t?{icon:c.icon||Pt,isDisabled:function(){return r(u,p)},isVisible:function(){return i(u,p)},label:c.label||"Refresh manually"}:"add-action"===t?{icon:c.icon||Mt,isDisabled:function(){return r(u,p)},isVisible:function(){return i(u,p)},label:c.label||"Create new row"}:"resort-action"===t?{icon:c.icon||At,isDisabled:function(){return r(u,p)},isVisible:function(){return i(u,p)},label:c.label||"Change sort order"}:"drop-filters"===t?{icon:c.icon||Rt,isDisabled:function(){return r(u,p)},isVisible:function(){return i(u,p)},label:c.label||"Drop filters"}:{isDisabled:function(){return r(u,p)},isVisible:function(){return i(u,p)}})}),onAction:x,fallback:g,payload:u,deps:r(r([],e(c),!1),[p],!1),onLoadStart:function(){return b&&b(sh)},onLoadEnd:function(e){return y&&y(e,sh)},disabled:w})},ActionFab:function(e){var r=e.action,o=void 0===r?"fab-action":r,i=e.label,a=e.width,l=e.icon,c=void 0===l?Tt:l,u=e.isVisible,s=void 0===u?function(){return!0}:u,d=e.isDisabled,m=void 0===d?function(){return!1}:d,p=fh().classes,h=fm(),v=zm(),g=Zm(),b=bp().selectedRows,y=h.fallback,w=h.onAction,E=h.onLoadStart,x=h.onLoadEnd,C=to(function(e){e.stopPropagation(),w&&w(o,b,g)}),k=function(e){var t=e.disabled,n=e.onClick,r=hh(),o=fm().loading;return i&&!r?f.createElement(ye,{className:p.button,variant:"contained",disabled:o||t,size:"small",startIcon:f.createElement(c,{color:"inherit"}),onClick:n},i):f.createElement(Te,{className:p.fab,disabled:o||t,size:"small",color:"primary",onClick:n},f.createElement(c,{color:"inherit"}))},S=a<500;return f.createElement(ph,{payload:S},f.createElement(Jr,{Loader:function(){var e=hh();return i&&!e?f.createElement(ye,{className:p.button,variant:"contained",size:"small",startIcon:f.createElement(c,{color:"inherit"})},i):f.createElement(Te,{className:p.fab,disabled:!0,size:"small",color:"primary"},f.createElement(c,{color:"inherit"}))},fallback:y,onLoadStart:function(){return E&&E(dh)},onLoadEnd:function(e){return x&&x(e,dh)},payload:b,deps:[v],throwError:!0},function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:return[4,s(b,v)];case 1:return e=n.sent(),[4,m(b,v)];case 2:return t=n.sent(),e?[2,f.createElement(k,{disabled:t,onClick:C})]:[2,null]}})})}))},ChipListSlot:wh,ActionListSlot:function(t){var n,o=t.className,i=t.actions,c=void 0===i?[]:i,u=t.style,s=t.title,d=t.height,m=t.width,p=t.deps,h=void 0===p?[]:p,v=Mh().classes,g=bp().selectedRows,b=fm().operations,y=zm(),w=Array.isArray(b)&&!!b.length;return f.createElement("div",{className:Eo(o,v.root,(n={},n[v.noData]=0===c.length,n)),style:u},f.createElement(_,{className:v.title,variant:"h5",sx:{marginLeft:w?"0 !important":"inherit"}},s),f.createElement("div",{className:v.stretch}),c.map(function(t,n){return f.createElement(k,{key:n},function(t){var n=t.type,o=t.options,i=void 0===o?[]:o,c=t.isDisabled,u=t.isVisible,s=t.label,p=t.icon,v=t.action;if(n===Sh.Add)return f.createElement(Nh,{label:s,action:v,isDisabled:c,isVisible:u,height:d,width:m});if(n===Sh.Fab)return f.createElement(Ih,{label:s,action:v,icon:p,isDisabled:c,isVisible:u,height:d,width:m});if(n===Sh.Menu){var b=i.map(function(e){var t=e.isDisabled,n=void 0===t?function(){return!1}:t,r=e.isVisible,o=void 0===r?function(){return!0}:r,i=l(e,["isDisabled","isVisible"]);return a(a({},i),{isDisabled:function(){return n(g,y)},isVisible:function(){return o(g,y)}})});return f.createElement(Lh,{options:b,deps:r(r([],e(h),!1),[y],!1)})}throw new Error("List Actions unknown action type")}(t))}))},FilterListSlot:Dh,OperationListSlot:function(r){var o=r.className,i=r.style,a=r.operations,l=r.width,c=Oh().classes,u=zm(),s=fm(),d=s.onOperation,m=void 0===d?function(){return null}:d,p=s.fallback,h=s.onLoadStart,v=s.onLoadEnd,b=s.loading,y=s.withAllListOperations,w=Zm(),E=e(g(!1),2),x=E[0],C=E[1],k=bp().selectedRows,S=x?"all":k,L=to(m),N=function(e){return function(){L(e,k,x,w)}},I=f.createElement(ve,{disabled:b,value:x,onChange:function(){return C(!x)}}),M=!k.length&&!x,R=function(e){var t=e.available,n=e.onClick,r=e.label,o=e.icon,i=fm().loading;return f.createElement(ye,{disabled:i||!t,size:"small",variant:"contained",onClick:n,startIcon:o&&f.createElement(o,null)},r)};return f.createElement(nm,{className:c.root,hideOverflowY:!0},f.createElement(j,{className:Eo(o,c.container),style:i},f.createElement(j,{className:c.content},f.createElement(Jr,{payload:S,deps:[u],Loader:function(){return f.createElement(f.Fragment,null,a.map(function(e,t){var n=e.label,r=e.icon;return f.createElement(ye,{disabled:!0,key:t,size:"small",variant:"contained",startIcon:r&&f.createElement(r,null)},f.createElement(we,{direction:"row",alignItems:"center",spacing:1},f.createElement(j,{display:"flex",alignItems:"center"},f.createElement(O,{size:"16px",color:"inherit"})),f.createElement(j,null,n)))}))},fallback:p,onLoadStart:function(){return h&&h(jh)},onLoadEnd:function(e){return v&&v(e,jh)},throwError:!0},function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,Promise.all(a.map(function(e,r){return t(void 0,[e,r],void 0,function(e,t){var r,o,i,a=e.action,l=void 0===a?"unknown-action":a,c=e.label,s=void 0===c?"Unknown":c,d=e.icon,m=e.isAvailable,p=void 0===m||m;return n(this,function(e){switch(e.label){case 0:return r=function(){return"function"==typeof p?p(k,x,u):p},M?(i=!1,[3,3]):[3,1];case 1:return[4,r()];case 2:i=e.sent(),e.label=3;case 3:return o=i,[2,f.createElement(R,{key:t,available:o,label:s,icon:d,onClick:N(l)})]}})})}))];case 1:return[2,e.sent()]}})})})),y&&f.createElement(j,{className:c.label},l<500?I:f.createElement(ge,{disabled:b,control:I,label:"All items"}))))},SearchSlot:function(e){var t,n=e.className,r=e.style,o=e.label,i=e.loading,a=e.search,l=e.onSearchChange,c=void 0===l?function(){return null}:l,u=Fh().classes;return f.createElement("div",{className:Eo(n,u.root),style:r},f.createElement("div",{className:u.container},f.createElement(j,{className:u.labelContent},f.createElement(xe,{label:"Search",variant:"standard",value:a,sx:{maxWidth:"max(calc(50% - 75px), 256px)"},onChange:function(e){var t=e.target;return c(t.value)},onKeyDown:function(e){var t=e.key,n=e.currentTarget;"Enter"!==t&&"Escape"!==t||n.blur()},className:Eo((t={},t[u.disabled]=i,t)),InputProps:{readOnly:i,startAdornment:f.createElement(Le,{position:"start"},f.createElement(ot,null)),endAdornment:!!a&&f.createElement(Le,{sx:{cursor:"pointer",marginBottom:"15px"},onClick:function(){c("")},position:"end"},f.createElement(Fe,null))},placeholder:o,InputLabelProps:{shrink:!0},focused:!0}))),f.createElement("div",{className:u.controls}))},DesktopBodyRow:function(r){var o,i=r.row,a=r.mode,l=r.columns,c=r.disabled,u=r.fullWidth,s=Bp(i.id),d=e(g(!1),2),m=d[0],p=d[1],v=zp().classes,b=fm(),y=Zm(),w=pm(),E=w.selection,x=w.setSelection,C=b.onRowClick,k=b.onRowAction,S=b.rowColor,L=void 0===S?function(){return"inherit"}:S,N=e(kc(function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,L(i)];case 1:return[2,e.sent()]}})})}),1),I=N[0],M=function(e){p(e)},R=function(e){k&&k(e,i,y)},P=h(function(){return l.map(function(e,t){return f.createElement(f.Fragment,null,t>0&&f.createElement(Et,{className:v.separator}),f.createElement(Jm,{column:e,disabled:c,row:i,key:t,idx:t,mode:a,fullWidth:u,onAction:R,onMenuToggle:M}))})},[u,i,c]);return f.createElement(wt,{ref:s,"data-testId":i.id,className:Eo(v.root,(o={},o[v.disabled]=c,o)),sx:{background:I||""},selected:E.has(i.id),onClick:function(){m||(b.withSelectOnRowClick&&b.selectionMode!==Si.None?(b.selectionMode===Si.Single?E.has(i.id)&&1===E.size?E.delete(i.id):(E.clear(),E.add(i.id)):E.has(i.id)?E.delete(i.id):E.add(i.id),x(E)):C&&C(i,y))}},f.createElement(Xm,{disabled:c,row:i}),P,f.createElement(Et,{className:v.cellStretch}))},MobileBodyRow:function(r){var o,i=r.row,a=r.mode,l=r.disabled,c=r.columns,u=r.fullWidth,s=Bp(i.id),d=e(g(!1),2),m=d[0],p=d[1],v=Gp().classes,b=fm(),y=Zm(),w=pm(),E=w.selection,x=w.setSelection,C=b.onRowClick,k=b.onRowAction,S=b.rowColor,L=void 0===S?function(){return"inherit"}:S,N=e(kc(function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,L(i)];case 1:return[2,e.sent()]}})})}),1),I=N[0],M=function(e){p(e)},R=function(e){k&&k(e,i,y)},P=e(h(function(){var t=function(e,t,n,r){return function(o,c){var s;return f.createElement(Xp,{className:Eo((s={},s[v.hideIfEmpty]=o.type!==Km.Component&&b.withHideIfEmpty,s)),column:o,disabled:l,row:i,key:"".concat(t,"-").concat(c),idx:c,mode:a,colSpan:e,fullWidth:u,onAction:R,withLabel:n,disableGutters:r,onMenuToggle:M})}},n=c.filter(function(e){return e.type!==Km.Action}),r=e(c.filter(function(e){return e.type===Km.Action}).map(t(1,"action",!1,!0)),1)[0],o=void 0===r?null:r,s=n.slice(0,1).map(t(1,"first",!0,!0)).pop(),d=n.filter(function(e){return e.primary}).map(t(1,"primary",!0,!0)).pop();return[d||s,o,(d?n:n.slice(1)).map(t(o?3:2,"col",!0,!1))]},[u]),3),A=P[0],T=P[1],D=P[2],j=h(function(){return Math.max(u-35,0)},[u]);return f.createElement(wt,{ref:s,"data-testId":i.id,className:v.root,selected:E.has(i.id),sx:{background:I||"",maxWidth:j},onClick:function(){m||(b.withSelectOnRowClick&&b.selectionMode!==Si.None?(b.selectionMode===Si.Single?E.has(i.id)&&1===E.size?E.delete(i.id):(E.clear(),E.add(i.id)):E.has(i.id)?E.delete(i.id):E.add(i.id),x(E)):C&&C(i,y))}},f.createElement(Et,{padding:"none",sx:{maxWidth:j}},f.createElement(vt,{className:Eo(v.row,(o={},o[v.disabled]=l,o))},f.createElement(gt,null,f.createElement(wt,null,f.createElement(Yp,{disabled:l,row:i}),A,T),D.map(function(e,t){return f.createElement(wt,{key:t},e)})))))}},Bh=p(_h),Hh=function(e){var t=e.children,n=l(e,["children"]),r=v(Bh),o=h(function(){return a(a({},r),n)},[]);return f.createElement(Bh.Provider,{value:o},t)},Wh=function(e){var t=v(Bh).BodyRow;return f.createElement(t,a({},e))},zh=function(t){var n=t.fullWidth,r=t.mode,o=t.row,i=fm(),a=i.columns,l=i.isRowDisabled,c=void 0===l?function(){return!1}:l,u=Tm().wrapColumns,s=Om(),d=Bm(),m=fm(),p=m.sort,v=m.chips,g=Um(),b=zm(),y=e(Cp(),1)[0],w=h(function(){return{filterData:s,pagination:d,sortModel:p||[],chips:v||{},search:g,payload:b}},[s,d,p,v,g,b]),E=h(function(){var e=u({columns:a,visibilityRequest:w,fullWidth:n,mode:r});return y.set(o.id,c(o,w)),e},[n,w]);return f.createElement(Wh,{row:o,mode:r,disabled:!!y.get(o.id),columns:E,fullWidth:n})},Vh=function(e){var t=v(Bh).HeadRow;return f.createElement(t,a({},e))},Yh=function(e){var t=e.fullWidth,n=e.mode,r=fm().columns,o=Tm().wrapColumns,i=Om(),a=Bm(),l=fm(),c=l.sortModel,u=l.chips,s=Um(),d=zm(),m=h(function(){return{filterData:i,pagination:a,sortModel:c||[],chips:u||{},search:s,payload:d}},[i,a,c,u,s,d]),p=h(function(){return o({columns:r,visibilityRequest:m,fullWidth:t,mode:n})},[t,m]);return f.createElement(Vh,{mode:n,columns:p,fullWidth:t})},Uh=e(Er(),2),qh=Uh[0],$h=Uh[1],Xh=[10,25,50],Gh=An()(function(e,t,n){var r;return{root:{position:"relative"},container:(r={position:"absolute",top:0,left:0,background:e.palette.background.paper},r["& .".concat(n.noBorder)]={paddingLeft:"0 !important",paddingRight:"0 !important"},r),noBorder:{border:"none !important"},tableHead:{position:"sticky",top:-1,zIndex:5,background:e.palette.background.paper}}}),Kh=function(e){var t=Gh().classes,n=$h(),r=Tm().constraintManager,o=bi({debounce:100}),i=o.elementRef,l=o.size,c=l.height,u=l.width,s=Im(u),d=s.isTablet,m=s.isDesktop,p=e.limit,h=e.offset,v=e.rows,g=e.loading,b=e.total,y=e.labelDisplayedRows,E=e.columns,x=void 0===E?[]:E,C=e.withLoader,S=void 0!==C&&C,L=e.withInitialLoader,N=void 0!==L&&L,I=e.handleLimitChange,M=e.handlePageChange;w(function(){return function(){n.clear()}},[]);var R=function(e){return f.createElement(f.Fragment,null,f.createElement(bt,{className:t.tableHead},f.createElement(Yh,{fullWidth:u,mode:e})),f.createElement(gt,null,S&&g||N&&g&&0===v.length||!g&&0===v.length?f.createElement(wt,null,function(e){return f.createElement(Et,{className:t.noBorder,sx:{position:"relative"},colSpan:2*x.length||999,align:"center"},f.createElement(we,{sx:{position:"sticky",top:0,left:0,width:e-65},direction:"row",alignItems:"center",justifyContent:"center",gap:1},g&&f.createElement(O,{size:24}),f.createElement(_,{variant:"body1"},g?"Loading":"Nothing found")))}(u)):v.map(function(t,n){return f.createElement(k,{key:"".concat(t.id,"-").concat(n)},f.createElement(zh,{fullWidth:u,row:t,mode:e}))})))};return f.createElement(Ap,a({},e,{onResize:function(){return r.clear()}}),f.createElement(j,{ref:i,className:t.root},f.createElement(j,{className:t.container},f.createElement(yt,{ref:n.provideRef,style:{height:c-52,width:u}},f.createElement(vt,{stickyHeader:!0},R(m?Rm.Desktop:d?Rm.Tablet:Rm.Phone))),f.createElement(xm,{width:u,height:c,count:b||-1,rowsPerPage:p,page:h/p,labelDisplayedRows:y,rowsPerPageOptions:Xh,onPageChange:function(e,t){return M(t)},onRowsPerPageChange:function(e){return I(e.target.value)}}))))},Qh=(Eh=e(Er(),2))[0],Jh=Eh[1],Zh=function(o){var i=o.scrollYSubject,a=o.rows,l=Fr(),c=$h(),u=Jh(),s=b(!0),d=e(Dr(a),2),f=d[0],m=d[1],p=y(function(t){return m(function(n){if(!s.current)return t;var o=new Set(n.map(function(e){return e.id})),i=new Map(t.map(function(e){return[e.id,e]}));return r(r([],e(n.map(function(e){return i.get(e.id)||e})),!1),e(t.filter(function(e){var t=e.id;return!o.has(t)})),!1)})},[]),h=y(function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,qn(500)];case 1:return e.sent(),s.current||(null==i||i.next(0),c.scrollTop()),[2]}})})},[]);return w(function(){return u.subscribe(function(e){"rows-reload"===e.type&&(s.current=!1,p(e.rows),h()),"filterdata-changed"!==e.type||e.keepPagination||(s.current=!1),"chips-changed"===e.type&&(s.current=!1),"rows-changed"===e.type&&(p(e.rows),h(),s.current=!0),"search-changed"===e.type&&(s.current=!1),"sort-changed"===e.type&&(s.current=!1),l.next()})},[]),{rows:f.current,recomputeSubject:l}},ev=An()({root:{position:"absolute",top:0,left:0,right:0,bottom:0,height:"100%",width:"100%",background:$("#000",.2),display:"flex",alignItems:"center",justifyContent:"center",zIndex:999},hidden:{display:"none !important"}}),tv=function(e){var t,n=e.open,r=ev().classes;return f.createElement(j,{className:Eo(r.root,(t={},t[r.hidden]=!n,t))},f.createElement(O,null))},nv=function(e){var t=e.row,n=fm().selectionMode,r=pm().selection,o=Kp(t);return n===Si.Single?f.createElement(Ce,{color:"primary",onClick:o(!0),checked:r.has(t.id)}):n===Si.Multiple?f.createElement(ve,{color:"primary",onClick:o(!1),checked:r.has(t.id)}):f.createElement(ve,{color:"primary",disabled:!0})},rv=An()({mark:{position:"absolute",top:0,left:0,bottom:0,width:4}}),ov=function(e){var t=e.row,n=rv().classes,r=Qp({row:t});return f.createElement(j,{className:n.mark,style:{background:r}})},iv="list-item",av=function(e){var t=e.row,n=e.fallback,r=e.column,o=fm(),i=o.onLoadStart,a=o.onLoadEnd,l=zm();return f.createElement(Jr,{fallback:n,payload:t,onLoadStart:function(){return i&&i(iv)},onLoadEnd:function(e){return a&&a(e,iv)},throwError:!0},function(){return r&&r.element?S(r.element,t):r&&r.compute?r.compute(t,l):r&&r.field?t[r.field]:"empty"})},lv=An()({root:{position:"relative",overflow:"hidden"},checkbox:{opacity:.2}}),cv=function(t){var n=t.row,r=t.style,o=e(g(!1),2),i=o[0],c=o[1],u=lv().classes,s=fm(),d=s.columns,m=void 0===d?[]:d,p=s.withSelectOnRowClick,h=s.selectionMode,v=s.rowActions,b=s.onRowClick,y=s.onRowAction,w=s.rowMark,E=s.fallback,x=s.onLoadStart,C=s.onLoadEnd,k=Zm(),S=zm(),L=pm(),N=L.selection,I=L.setSelection,M=zr(n),R=m.find(function(e){return e.primary})||m.find(function(e){return!!e.field}),P=m.find(function(e){return e.secondary}),A=m.find(function(e){return e.avatar}),T=f.createElement(av,{row:n,fallback:E,column:R}),D=P?f.createElement(av,{row:n,fallback:E,column:P}):null,O=A?f.createElement(av,{row:n,fallback:E,column:A}):null;return f.createElement(Me,{selected:N.has(n.id),className:u.root,onClick:function(){i||(p&&h!==Si.None?(h===Si.Single?N.has(n.id)&&1===N.size?N.delete(n.id):(N.clear(),N.add(n.id)):N.has(n.id)?N.delete(n.id):N.add(n.id),I(N)):b&&b(n,k))},style:r,disableRipple:i},!!w&&f.createElement(ov,{row:n}),f.createElement(F,{sx:{display:"flex",alignItems:"center",gap:"8px"}},f.createElement(nv,{row:n}),!!O&&f.createElement(j,{sx:{marginRight:"16px"}},O)),f.createElement(Oe,{primary:T,secondary:D}),!!v&&f.createElement(xa,{transparent:!0,options:v.map(function(e){var t=e.isDisabled,n=void 0===t?function(){return!1}:t,r=e.isVisible,o=void 0===r?function(){return!0}:r,i=l(e,["isDisabled","isVisible"]);return a(a({},i),{isVisible:function(){return o(M.current,S)},isDisabled:function(){return n(M.current,S)}})}),onToggle:function(e){c(e)},onAction:function(e){y&&y(e,n,k)},fallback:E,payload:n,deps:[S],onLoadStart:function(){return x&&x(iv)},onLoadEnd:function(e){return C&&C(e,iv)},throwError:!0}))},uv=An()(function(e){return{root:{position:"relative"},container:{position:"absolute",top:0,left:0,background:e.palette.background.paper},empty:{position:"absolute",zIndex:999,top:0,left:0,right:0}}}),sv=function(e){var r=uv().classes,o=$h(),i=Fr(),l=Zh({rows:e.rows,scrollYSubject:i});w(function(){return o.scrollYSubject.subscribe(function(){i.next(0)})},[]);var c=e.offset,u=e.limit,s=e.total,d=e.loading,m=e.withLoader,p=void 0!==m&&m,h=bi({target:document.body,selector:".MuiDialog-container > .MuiPaper-root"}).size.width,v=bi(),g=v.elementRef,b=v.size.height,y=e.handlePageChange,E=Math.floor(c/u)+1,x=!s||E*u<s,C=il([d]),k=no(function(e){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return e?[2]:!0&&x&&!d?(y(E),[4,C()]):[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}})})}).execute;return f.createElement(Ap,a({},e,l),f.createElement(j,{ref:g,className:r.root},f.createElement(j,{className:r.container},f.createElement(j,{position:"relative",style:{height:b,width:h}},f.createElement(vi,{scrollYSubject:i,minRowHeight:75,onDataRequest:function(e){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,k(e)];case 1:return[2,void t.sent()]}})})},sx:{height:b,width:h}},!d&&0===l.rows.length&&f.createElement(tt,{className:r.empty},f.createElement(F,null,f.createElement(Ot,null)),f.createElement(Oe,{primary:"Empty",secondary:"Nothing found"})),l.rows.map(function(e,t){return f.createElement(cv,{key:"".concat(e.id,"-").concat(t),row:e})})),f.createElement(tv,{open:p&&d})))))},dv=An()({root:{position:"absolute",top:0,left:0,right:0,bottom:0,height:"100%",width:"100%",background:$("#000",.2),display:"flex",alignItems:"center",justifyContent:"center",zIndex:999},hidden:{display:"none !important"}}),fv=function(e){var t,n=e.open,r=dv().classes;return f.createElement(j,{className:Eo(r.root,(t={},t[r.hidden]=!n,t))},f.createElement(O,null))},mv=function(e,r){var o=(void 0===r?{}:r).minWidth,i=void 0===o?185:o;return e.map(function(e,r){var o="".concat(e.field||"unknown","-").concat(r);return e.type===Km.Action?null:e.type===Km.CheckBox?{label:e.headerName||o,width:e.width,field:e.field,minWidth:i,format:function(t){return f.createElement(ve,{color:"primary",disabled:!0,checked:t[e.field]})}}:{label:e.headerName||o,width:e.width,field:e.field,minWidth:i,format:function(r,o){var i=this;return e.compute||e.element?f.createElement(Jr,{payload:r},function(r){return t(i,void 0,void 0,function(){var t,i;return n(this,function(n){switch(n.label){case 0:return t=e.element,(i=e.compute)?[4,i(r,o)]:[3,2];case 1:return[2,n.sent()];case 2:return t?[2,f.createElement(t,a({},r,{_payload:o}))]:[2,e.field?Wn(r,e.field):""]}})})}):e.field?Wn(r,e.field):""}}}).filter(function(e){return null!==e})},pv=An()(function(e){return{root:{position:"relative"},container:{position:"absolute",top:0,left:0,background:e.palette.background.paper},empty:{position:"absolute",zIndex:999,top:0,left:0,right:0}}}),hv=function(o){var i=pv().classes,l=Fr(),c=Zh({rows:o.rows,scrollYSubject:l}),u=pm(),s=u.selection,d=u.setSelection,m=o.offset,p=o.limit,v=o.total,g=o.loading,b=o.payload,y=o.rowMark,w=o.rowColor,E=o.columns,x=o.selectionMode,C=void 0===x?Si.None:x,k=o.withLoader,S=void 0!==k&&k,L=o.onRowClick,N=o.onRowAction,I=Zm(),M=h(function(){return mv(E)},[]),R=h(function(){return r([],e(s),!1)},[s]),P=bi(),A=P.elementRef,T=P.size,D=T.height,O=T.width,F=o.handlePageChange,_=Math.floor(m/p)+1,B=!v||_*p<v,H=il([g]),W=no(function(e){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return e?[2]:!0&&B&&!g?(F(_),[4,H()]):[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}})})}).execute;return f.createElement(Ap,a({},o,c),f.createElement(j,{ref:A,className:i.root},f.createElement(j,{className:i.container},f.createElement(j,{position:"relative",style:{height:D,width:O}},f.createElement(Pa,{scrollYSubject:l,minRowHeight:45,hasMore:B,loading:g,bufferSize:Math.min(2*p,15),selectedRows:R,onSelectedRows:function(e,t){t||d(new Set(e))},selectionMode:C,transparentPaper:!0,payload:b,rowMark:y,onRowClick:function(e){o.withSelectOnRowClick&&o.selectionMode!==Si.None?(o.selectionMode===Si.Single?s.has(e.id)&&1===s.size?s.delete(e.id):(s.clear(),s.add(e.id)):s.has(e.id)?s.delete(e.id):s.add(e.id),d(s)):L&&L(e,I)},onRowAction:function(e,t){N&&N(e,t,I)},rowKey:"id",rowColor:w,columns:M,data:c.rows,onSkip:function(e){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,W(e)];case 1:return[2,void t.sent()]}})})},sx:{height:D,width:O}}),f.createElement(fv,{open:S&&g})))))},vv=10,gv=function(){var t=new function(){var e=this;this._cache=new Map,this.memoize=function(t,n){if(e._cache.has(t))return e._cache.get(t);var r=n();return e._cache.set(t,r),r},this.clear=function(){e._cache.clear()}},n=function(e){var n=e.fullWidth,r=e.column,o=e.mode,i=e.idx;return t.memoize("column-order-".concat(n,"-").concat(i),function(){var e=0;return o===Rm.Desktop||o===Rm.Tablet?e=r.desktopOrder||0:o===Rm.Phone&&(e=r.phoneOrder||0),e})},r=function(e){var n=e.fullWidth,r=e.column,o=e.idx,i=Math.max(n-75,1);return t.memoize("column-width-".concat(n,"-").concat(o),function(){var e=r.width,t="function"==typeof e?e(i):e;return"number"==typeof t?"".concat(t,"px"):t})};return{constraintManager:t,wrapColumns:function(o){var i=o.columns,l=o.fullWidth,c=o.mode,u=o.visibilityRequest;return i.filter(function(e,n){return function(e){var n=e.column,r=e.fullWidth,o=e.visibilityRequest,i=e.idx;return t.memoize("column-visibility-".concat(r,"-").concat(i),function(){var e=!0;return n.isVisible&&(e=n.isVisible(o)),e})}({visibilityRequest:u,column:e,fullWidth:l,mode:c,idx:n})}).filter(function(e,n){return!function(e){var n=e.column,r=e.fullWidth,o=e.mode,i=e.idx;return t.memoize("column-hidden-".concat(r,"-").concat(i),function(){var e=!1;return o===Rm.Desktop?e=!!n.desktopHidden:o===Rm.Tablet?e=!!n.tabletHidden:o===Rm.Phone&&(e=!!n.phoneHidden),e})}({visibilityRequest:u,column:e,fullWidth:l,mode:c,idx:n})}).map(function(e,t){return[e,t]}).sort(function(t,r){var o=e(t,2),i=o[0],a=o[1],s=e(r,2),d=s[0],f=s[1];return n({visibilityRequest:u,fullWidth:l,column:i,idx:a,mode:c})+a-(a>f?1:0)-(n({visibilityRequest:u,fullWidth:l,column:d,idx:f,mode:c})+f-(f>a?1:0))}).map(function(t){return e(t,1)[0]}).map(function(e,t,n){var o=n.length;return a(a({},e),{width:r({visibilityRequest:u,fullWidth:l-32*o,column:e,mode:c,idx:t})})})}}},bv=new Set(["@","+","(",")","-","_","!","#","$","%","&","*","/","="]),yv=function(e){var t,n,r="";try{for(var o=c(e),i=o.next();!i.done;i=o.next()){var a=i.value;bv.has(a)?r+=" ":r+=a}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r.split(" ").filter(function(e){return e}).join(" ")},wv=An()({root:{position:"absolute",top:0,left:0,right:0,bottom:0,height:"100%",width:"100%",background:$("#000",.2),display:"flex",alignItems:"center",justifyContent:"center",zIndex:999},hidden:{display:"none !important"}}),Ev=function(e){var t,n=e.open,r=wv().classes;return f.createElement(j,{className:Eo(r.root,(t={},t[r.hidden]=!n,t))},f.createElement(O,null))},xv=function(){return f.createElement(Oe,{primary:"DEFAULT_TEMPLATE",secondary:"DEFAULT_TEMPLATE"})},Cv=An()(function(e){return{root:{position:"relative"},container:{position:"absolute",top:0,left:0,background:e.palette.background.paper},empty:{position:"absolute",zIndex:999,top:0,left:0,right:0}}}),kv=function(o){var i=Cv().classes,l=$h(),c=Fr(),u=Zh({rows:o.rows,scrollYSubject:c});w(function(){return l.scrollYSubject.subscribe(function(){c.next(0)})},[]);var s=pm(),d=s.selection,m=s.setSelection,p=o.offset,v=o.limit,g=o.total,b=o.loading,y=o.payload,E=o.rowMark,x=o.rowColor,C=o.selectionMode,k=void 0===C?Si.None:C,S=o.customTemplate,L=void 0===S?xv:S,N=o.customTemplateMinHeight,I=void 0===N?45:N,M=o.withLoader,R=void 0!==M&&M,P=o.onRowClick,A=o.tileMode,T=o.itemSx,D=Zm(),O=h(function(){return r([],e(d),!1)},[d]),F=bi(),_=F.elementRef,B=F.size,H=B.height,W=B.width,z=o.handlePageChange,V=Math.floor(p/v)+1,Y=!g||V*v<g,U=il([b]),q=no(function(e){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return e?[2]:!0&&Y&&!b?(z(V),[4,U()]):[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}})})}).execute;return f.createElement(Ap,a({},o,u),f.createElement(j,{ref:_,className:i.root},f.createElement(j,{className:i.container},f.createElement(j,{position:"relative",style:{height:H,width:W}},f.createElement($i,{mode:A,itemSx:T,recomputeSubject:u.recomputeSubject,scrollYSubject:c,minRowHeight:I,hasMore:Y,bufferSize:Math.min(2*v,15),selectedRows:O,onSelectedRows:function(e,t){t||m(new Set(e))},selectionMode:k,payload:y,rowMark:E,rowKey:"id",rowColor:x,data:u.rows,loading:b,onSkip:function(e){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,q(e)];case 1:return[2,void t.sent()]}})})},onItemClick:function(e){!function(e){o.withSelectOnRowClick&&o.selectionMode!==Si.None?(o.selectionMode===Si.Single?d.has(e.id)&&1===d.size?d.delete(e.id):(d.clear(),d.add(e.id)):d.has(e.id)?d.delete(e.id):d.add(e.id),m(d)):P&&P(e,D)}(e.data)},sx:{height:H,width:W}},L),f.createElement(Ev,{open:R&&b})))))},Sv=function(){return f.createElement(Oe,{primary:"DEFAULT_TEMPLATE",secondary:"DEFAULT_TEMPLATE"})},Lv=[10,25,50],Nv=An()(function(e){return{root:{position:"relative"},container:{position:"absolute",top:0,left:0,background:e.palette.background.paper},empty:{position:"absolute",zIndex:999,top:0,left:0,right:0}}}),Iv=function(t){var n=Nv().classes,o=$h(),i=Fr();w(function(){return o.scrollYSubject.subscribe(function(){i.next(0)})},[]);var l=pm(),c=l.selection,u=l.setSelection,s=t.rows,d=t.offset,m=t.limit,p=t.total,v=t.payload,g=t.rowMark,b=t.rowColor,y=t.selectionMode,E=void 0===y?Si.None:y,x=t.pageItemTemplate,C=void 0===x?Sv:x,k=t.pageItemTemplateMinHeight,S=void 0===k?45:k,L=t.labelDisplayedRows,N=t.onRowClick,I=t.tileMode,M=t.itemSx,R=Zh({rows:t.rows,scrollYSubject:i}),P=Zm(),A=h(function(){return r([],e(c),!1)},[c]),T=bi(),D=T.elementRef,O=T.size,F=O.height,_=O.width,B=t.handlePageChange,H=t.handleLimitChange;return f.createElement(Ap,a({},t),f.createElement(j,{ref:D,className:n.root},f.createElement(j,{className:n.container},f.createElement(j,{position:"relative",style:{height:F-52,width:_}},f.createElement($i,{mode:I,itemSx:M,recomputeSubject:R.recomputeSubject,scrollYSubject:i,minRowHeight:S,hasMore:!1,loading:!1,bufferSize:Math.min(2*m,15),selectedRows:A,onSelectedRows:function(e,t){t||u(new Set(e))},selectionMode:E,payload:v,rowMark:g,rowKey:"id",rowColor:b,data:s,onItemClick:function(e){!function(e){t.withSelectOnRowClick&&t.selectionMode!==Si.None?(t.selectionMode===Si.Single?c.has(e.id)&&1===c.size?c.delete(e.id):(c.clear(),c.add(e.id)):c.has(e.id)?c.delete(e.id):c.add(e.id),u(c)):N&&N(e,P)}(e.data)},sx:{height:F-52,width:_}},C)),f.createElement(xm,{width:_,height:F,count:p||-1,rowsPerPage:m,page:d/m,labelDisplayedRows:L,rowsPerPageOptions:Lv,onPageChange:function(e,t){return B(t)},onRowsPerPageChange:function(e){return H(e.target.value)}}))))},Mv=function(o){function i(i){var l=o.call(this,i)||this;l.stateActionEmitter=new ar,l.isMountedFlag=!1,l.isFetchingFlag=!1,l.isRerenderFlag=!1,l.isPatchingFlag=!1,l.prevState={},l.scrollManager=new function(){var e=this;this.scrollYSubject=new ar,this._lastScrollX=0,this._handleScroll=function(){if(e._currentElement){var t=e._currentElement.scrollLeft;e._lastScrollX=t}},this.provideRef=function(t){e.clear(),t&&(t.addEventListener("scroll",e._handleScroll,{passive:!0}),e._currentElement=t)},this.scrollTop=function(){e._currentElement&&e._currentElement.scrollTo(e._lastScrollX,0),e.scrollYSubject.next(0)},this.clear=function(){e._currentElement&&e._currentElement.removeEventListener("scroll",e._handleScroll),e._currentElement=void 0}},l.constraintManager=gv(),l.computeKeepPageOnReload=function(){var e=!0;return e=(e=(e=e&&!l.props.isChooser)&&!l.props.isInfinite)&&!l.props.isCustom},l.setLoading=function(e){return l.isMountedFlag&&l.setState(function(t){return a(a({},t),{loading:e})})},l.setFiltersCollapsed=function(e){return l.isMountedFlag&&l.setState(function(t){return a(a({},t),{filtersCollapsed:e})})},l.componentDidUpdate=function(){l.handleUpdateRef(),l.state.rerender?l.beginRerender():l.beginFetchQueue()},l.componentDidMount=function(){l.isMountedFlag=!0,l.handleReady(!0),l.handleUpdateRef()},l.componentWillUnmount=function(){l.isFetchingFlag=!1,l.isMountedFlag=!1,l.handleFetchQueue.clear(),l.unReloadSubject&&l.unReloadSubject(),l.unRerenderSubject&&l.unRerenderSubject(),l.unSetLimitSubject&&l.unSetLimitSubject(),l.unSetPageSubject&&l.unSetPageSubject(),l.unSetRowsSubject&&l.unSetRowsSubject()},l.beginRerender=function(){queueMicrotask(function(){return V(function(){l.isMountedFlag&&l.setState(function(e){return a(a({},e),{rerender:!1})}),l.isRerenderFlag=!0})})},l.beginFetchQueue=function(){l.prevState.filtersCollapsed===l.state.filtersCollapsed?l.handleFetchQueue():l.prevState.filtersCollapsed=l.state.filtersCollapsed},l.createHandleFetchQueue=function(e){return void 0===e&&(e=1e3),ne(function(){var e=[l.handlePageChanged,l.handleParamsChanged],t=!0;if(t=(t=t&&!l.state.loading)&&l.state.initComplete){if(!l.isFetchingFlag)return void(l.isPatchingFlag=!1);l.isRerenderFlag?l.isRerenderFlag=!1:l.isPatchingFlag?l.isPatchingFlag=!1:(l.isFetchingFlag=!1,e.reduce(function(e,t){return e?!t():e},!0))}l.prevState=a({},l.state)},e)},l.handleFetchQueue=l.createHandleFetchQueue(),l.handlePageChanged=function(){var e=!1;return(e=(e=e||l.prevState.offset===l.state.offset)||l.prevState.limit===l.state.limit)&&l.handleReload(),e},l.handleParamsChanged=function(){var e=!1;return(e=(e=(e=e||l.prevState.chips===l.state.chips)||l.prevState.sort===l.state.sort)||l.prevState.search===l.state.search)&&(l.handleFilter(l.state.filterData,!1),l.props.onPageChange(0)),e},l.handleUpdateRef=function(){var e=l.props.apiRef,r={reload:l.handleReload,setLimit:l.handleLimitChange,setPage:l.handlePageChange,setRows:l.handleRowsChange,setFilterData:l.handleFilter,getState:function(){return a({},l.state)},rerender:l.handleRerender};"function"==typeof e?e(r):e&&(e.current=r),l.props.reloadSubject&&(l.unReloadSubject&&l.unReloadSubject(),l.unReloadSubject=l.props.reloadSubject.subscribe(function(){return t(l,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return this.computeKeepPageOnReload()?[3,2]:[4,this.handleReload(!1)];case 1:case 3:return e.sent(),[2];case 2:return[4,this.handleReload()]}})})})),l.props.rerenderSubject&&(l.unRerenderSubject&&l.unRerenderSubject(),l.unRerenderSubject=l.props.rerenderSubject.subscribe(l.handleRerender)),l.props.setLimitSubject&&(l.unSetLimitSubject&&l.unSetLimitSubject(),l.unSetLimitSubject=l.props.setLimitSubject.subscribe(l.handleLimitChange)),l.props.setPageSubject&&(l.unSetPageSubject&&l.unSetPageSubject(),l.unSetPageSubject=l.props.setPageSubject.subscribe(l.handlePageChange)),l.props.setRowsSubject&&(l.unSetRowsSubject&&l.unSetRowsSubject(),l.unSetRowsSubject=l.props.setRowsSubject.subscribe(l.handleRowsChange)),l.props.setFilterDataSubject&&(l.unSetFilterDataSubject&&l.unSetFilterDataSubject(),l.unSetFilterDataSubject=l.props.setFilterDataSubject.subscribe(l.handleFilter))},l.handleReady=function(e){void 0===e&&(e=!1),l.handleDefault(e),l.prevState.filtersCollapsed=l.state.filtersCollapsed},l.handleRows=function(o){for(var i=[],a=1;a<arguments.length;a++)i[a-1]=arguments[a];return t(l,r([o],e(i),!1),void 0,function(e,t){var r,o,i,a,l,c,u,s,d,f;return void 0===t&&(t=!1),n(this,function(n){switch(n.label){case 0:return[4,qn(0)];case 1:return n.sent(),"function"!=typeof this.props.handler?[3,3]:[4,Promise.resolve(this.props.handler(e,{limit:this.state.limit,offset:t?this.state.offset:0},this.state.sort,this.state.chips,String(this.props.withRawSearch?this.state.search:yv(this.state.search)).trim(),this.state.payload))];case 2:return r=n.sent(),Array.isArray(r)?(r.length>this.state.limit&&console.warn("List rows count is more than it's capacity"),f={rows:r.slice(0,this.state.limit),total:null},this.props.onRows(f.rows),[2,f]):(i=(o=r||{}).rows,u=void 0===i?[]:i,a=o.total,d=void 0===a?null:a,u.length>this.state.limit&&console.warn("List rows count is more than it's capacity"),f={rows:u.slice(0,this.state.limit),total:d},this.props.onRows(f.rows),[2,f]);case 3:return Array.isArray(this.props.handler)?(f={rows:this.props.handler.slice(this.state.offset,this.state.limit+this.state.offset),total:this.props.handler.length},this.props.onRows(f.rows),[2,f]):(l=this.props.handler||{},c=l.rows,u=void 0===c?[]:c,s=l.total,d=void 0===s?null:s,f={rows:u.slice(this.state.offset,this.state.limit+this.state.offset),total:d},this.props.onRows(f.rows),[2,f]);case 4:return[2]}})})},l.handleFilter=function(o){for(var i=[],c=1;c<arguments.length;c++)i[c-1]=arguments[c];return t(l,r([o],e(i),!1),void 0,function(e,t){var r,o,i,l;return void 0===t&&(t=!1),n(this,function(n){switch(n.label){case 0:if(this.state.loading)return[2];this.setLoading(!0),n.label=1;case 1:return n.trys.push([1,5,6,7]),[4,this.stateActionEmitter.next({type:"filterdata-changed",keepPagination:t,filterData:e})];case 2:return n.sent(),[4,this.handleRows(e,t)];case 3:return r=n.sent(),o=r.rows,i=r.total,[4,this.stateActionEmitter.next({type:"rows-changed",rows:o,total:i})];case 4:return n.sent(),t||this.scrollManager.scrollTop(),this.isMountedFlag&&this.setState(function(n){return a(a(a({},n),{initComplete:!0,loading:!1,filterData:e,rows:o,total:i}),!t&&{offset:0})}),[3,7];case 5:return l=n.sent(),this.props.fallback(l),[3,7];case 6:return this.setLoading(!1),this.props.onFilterChange(e),[7];case 7:return[2]}})})},l.handleDefault=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return t(l,r([],e(o),!1),void 0,function(e){var t,r=this;return void 0===e&&(e=!1),n(this,function(n){switch(n.label){case 0:return t={},Pr(this.props.filters).filter(function(e){return!!e.name}).forEach(function(e){var n=e.type,o=e.name,i=e.defaultValue,a=e.hidden;Tr(t,o),("function"==typeof a?a(r.state.payload):a)||Hn(t,o,void 0===i?Wn(t,o)||Rr(n):"function"==typeof i?i(r.state.payload):i)}),e&&Ar(t,this.props.filterData),[4,this.handleFilter(t,e)];case 1:return n.sent(),!e&&this.props.onPageChange(0),[2]}})})},l.handleReload=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return t(l,r([],e(o),!1),void 0,function(e){return void 0===e&&(e=!0),n(this,function(t){switch(t.label){case 0:return this.constraintManager.constraintManager.clear(),this.scrollManager.clear(),[4,this.handleFilter(this.state.filterData,e)];case 1:return t.sent(),!e&&this.props.onPageChange(0),[2]}})})},l.handlePageChange=function(e){l.isFetchingFlag=!0,l.isMountedFlag&&l.setState(function(t){return a(a({},t),{offset:e*t.limit})}),l.props.onPageChange(e)},l.handleLimitChange=function(e){l.isFetchingFlag=!0;var t=Math.floor(l.state.offset/e);l.isMountedFlag&&l.setState(function(n){return a(a({},n),{offset:t*e,limit:e})}),l.props.onLimitChange(e)},l.handleRowsChange=function(e){return t(l,void 0,void 0,function(){return n(this,function(t){return e=e.slice(0,this.state.limit).map(function(e){return a({},e)}),this.stateActionEmitter.next({type:"rows-reload",rows:e}),this.isPatchingFlag=!0,this.isMountedFlag&&this.setState(function(t){return a(a({},t),{rows:e})}),[2]})})},l.handleSortModel=function(e){return t(l,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,this.stateActionEmitter.next({type:"sort-changed",sort:e})];case 1:return t.sent(),this.isFetchingFlag=!0,this.isMountedFlag&&this.setState(function(t){return a(a({},t),{offset:0,sort:e})}),this.props.onSortModelChange(e),this.props.onPageChange(0),[2]}})})},l.handleChips=function(e){return t(l,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,this.stateActionEmitter.next({type:"chips-changed",chips:e})];case 1:return t.sent(),this.isFetchingFlag=!0,this.isMountedFlag&&this.setState(function(t){return a(a({},t),{offset:0,chips:e})}),this.props.onChipsChange(a(a({},this.state.chips),e)),this.props.onPageChange(0),[2]}})})},l.handleSearch=function(e){return t(l,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,this.stateActionEmitter.next({type:"search-changed",search:e})];case 1:return t.sent(),this.isFetchingFlag=!0,this.isMountedFlag&&this.setState(function(t){return a(a({},t),{offset:0,search:e})}),this.props.onSearchChange(e),this.props.onPageChange(0),[2]}})})},l.handleRerender=function(){queueMicrotask(function(){return V(function(){l.isMountedFlag&&l.setState(function(e){return a(a({},e),{rerender:!0})})})})},l.handleFiltersCollapsed=function(e){return l.setFiltersCollapsed(e)},l.getCallbacks=function(){return{handlePageChange:l.handlePageChange,handleLimitChange:l.handleLimitChange,handleSortModel:l.handleSortModel,handleDefault:l.handleDefault,handleFilter:l.handleFilter,handleReload:l.handleReload,handleChips:l.handleChips,handleSearch:l.handleSearch,handleRowsChange:l.handleRowsChange,handleFiltersCollapsed:l.handleFiltersCollapsed,handleRerender:l.handleRerender,computeKeepPageOnReload:l.computeKeepPageOnReload}},l.renderInner=function(){var e=l.getCallbacks();return l.state.isPageItem?f.createElement(Iv,a({},l.props,l.state,{handler:l.props.handler,filters:l.props.filters,columns:l.props.columns,actions:l.props.actions,limit:l.state.limit,offset:l.state.offset,listChips:l.props.chips},e)):l.state.isCustom?f.createElement(kv,a({},l.props,l.state,{handler:l.props.handler,filters:l.props.filters,columns:l.props.columns,actions:l.props.actions,limit:l.state.limit,offset:l.state.offset,listChips:l.props.chips},e)):l.state.isInfinite?f.createElement(hv,a({},l.props,l.state,{handler:l.props.handler,filters:l.props.filters,columns:l.props.columns,actions:l.props.actions,limit:l.state.limit,offset:l.state.offset,listChips:l.props.chips},e)):l.state.isChooser?f.createElement(sv,a({},l.props,l.state,{handler:l.props.handler,filters:l.props.filters,columns:l.props.columns,actions:l.props.actions,limit:l.state.limit,offset:l.state.offset,listChips:l.props.chips},e)):f.createElement(Kh,a({},l.props,l.state,{handler:l.props.handler,filters:l.props.filters,columns:l.props.columns,actions:l.props.actions,limit:l.state.limit,offset:l.state.offset,listChips:l.props.chips},e))},l.render=function(){var e=l.getCallbacks();return f.createElement(ef,null,f.createElement(Tn,null,f.createElement(Qh,{payload:l.stateActionEmitter},f.createElement(dm,a({},l.props,l.state,e),f.createElement(_p,null,f.createElement(qh,{payload:l.scrollManager},f.createElement(Am,{payload:l.constraintManager},f.createElement(hm,{selectedRows:l.props.selectedRows},f.createElement(yp,null,f.createElement(xp,{initialState:function(){return new Map}},f.createElement(sp,{sortModel:l.props.sortModel},f.createElement(bh,{chips:l.props.chips,chipData:l.props.chipData},f.createElement(jm,{value:l.state.filterData},f.createElement(_m,{limit:l.state.limit,offset:l.state.offset},f.createElement(Ym,{value:l.state.search},f.createElement(vp,null,f.createElement(Hh,a({},l.props.slots),f.createElement(Wm,{value:l.state.payload},l.renderInner()))))))))))))))))))};return l.state={initComplete:!1,payload:"function"==typeof l.props.payload?l.props.payload():l.props.payload,isChooser:l.props.isChooser,isInfinite:l.props.isInfinite,isCustom:!!l.props.customTemplate||l.props.isCustom,isPageItem:!!l.props.pageItemTemplate||l.props.isPageItem,filterData:l.props.filterData,rows:[],limit:l.props.limit,offset:l.props.isChooser||l.props.isInfinite||l.props.isCustom?0:l.props.limit*l.props.page,total:null,search:l.props.search||"",loading:!1,filtersCollapsed:l.props.withToggledFilters,sort:l.props.sortModel,chips:l.props.chips.reduce(function(e,t){var n,r=t.name,o=t.enabled,i=void 0!==o&&o;return a(a({},e),((n={})[r]=l.props.chipData[r]||i,n))},{}),rerender:!1},l.prevState=a({},l.state),l.handleFetchQueue=l.createHandleFetchQueue(i.fetchDebounce),l}return u(i,o),i.defaultProps={handler:function(){return[]},payload:{},fallback:function(e){return console.error(e)},limit:vv,page:0,isChooser:!1,isInfinite:!1,isCustom:!1,filters:[],columns:[],actions:[],onRows:function(){return null},onSortModelChange:function(){return null},onFilterChange:function(){return null},onChipsChange:function(){return null},onSearchChange:function(){return null},onPageChange:function(){return null},onLimitChange:function(){return null},labelDisplayedRows:function(e){var t=e.count,n=e.from,r=e.to;return"".concat(n,"–").concat(r," ").concat(-1!==t?"(".concat(t,")"):"")},selectionLabel:function(e){return"".concat(e||"")},filterData:{},withToggledFilters:!1,fetchDebounce:1e3,tileMode:Oi.Intersection,sortModel:[],chips:[],chipData:{},search:"",slots:{}},i}(f.Component),Rv=function(e){return f.createElement(Mv,a({},e))},Pv=function(e){var t=h(function(){var t=e.columns,n=void 0===t?[]:t,r=e.rowActions,o=e.onRowAction;return(null==r?void 0:r.length)&&o?n:n.filter(function(e){return e.type!==Km.Action})},[]);return f.createElement(Rv,a({},e,{columns:t}))},Av=function(e){var t,n,r={};try{for(var o=c(Object.keys(e||{})),i=o.next();!i.done;i=o.next()){var a=i.value;null!==e[a]&&(""!==e[a]&&!1!==e[a]&&(r[a]=e[a]))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return r},Tv={rows:[],total:null},Dv=function(r,o){var i=void 0===o?{}:o,l=i.fetch,c=void 0===l?window.fetch:l,u=i.origin,s=void 0===u?window.location.origin:u,d=i.abortSignal,f=void 0===d?Lf.signal:d,m=i.removeEmptyFilters,p=void 0===m?Av:m,v=i.fetchParams,g=i.fallback,b=i.onLoadBegin,y=i.onLoadEnd,E=i.requestMap,x=void 0===E?function(e){return e}:E,C=i.responseMap,k=void 0===C?function(e){return e}:C,S=i.filterHandler,L=void 0===S?function(t,n){return Object.entries(n).forEach(function(n){var r=e(n,2),o=r[0],i=r[1];Array.isArray(i)?i.forEach(function(e){t.searchParams.append("filter.".concat(o),"$lte:".concat(e))}):i&&t.searchParams.append("filter.".concat(o),"$lte:".concat(i))}),t}:S,N=i.chipsHandler,I=void 0===N?function(t,n){return Object.entries(n).forEach(function(n){var r=e(n,2),o=r[0];r[1]&&t.searchParams.append("filter.".concat(o),"$eq:1")}),t}:N,M=i.sortHandler,R=void 0===M?function(e,t){return t.forEach(function(t){var n=t.field,r=t.sort;r&&e.searchParams.append("sortBy","".concat(String(n),":").concat(r.toUpperCase()))}),e}:M,P=i.searchHandler,A=void 0===P?function(e,t){return e.searchParams.set("search",t),e}:P,T=i.paginationHandler,D=void 0===T?function(e,t){var n=t.limit,r=t.offset;return e.searchParams.set("limit",n.toString()),e.searchParams.set("page",(r/n).toString()),e}:T,j=i.withAbortSignal,O=void 0===j||j,F=i.withPagination,_=void 0===F||F,B=i.withFilters,H=void 0===B||B,W=i.withSearch,z=void 0===W||W,V=i.withChips,Y=void 0===V||V,U=i.withSort,q=void 0===U||U,$=h(function(){return Gn(c)},[]),X=h(function(){return function(e,o,i,l,c){return t(void 0,void 0,void 0,function(){var t,u,d,m,h;return n(this,function(n){switch(n.label){case 0:e=p(e),t=new URL(r,s),u=!0,_&&(t=D(new URL(t),o)),H&&(t=L(new URL(t),e)),Y&&(t=I(new URL(t),l)),q&&(t=R(new URL(t),i)),z&&(t=A(new URL(t),c)),t=x(new URL(t)),b&&b(),n.label=1;case 1:return n.trys.push([1,5,6,7]),[4,$(t.toString(),a({signal:f},v&&v()))];case 2:return(d=n.sent())===$n?[2,{rows:[],total:null}]:[4,d.json()];case 3:return m=n.sent(),[4,k(m)];case 4:return[2,n.sent()];case 5:if(h=n.sent(),$.clear(),u=!1,h instanceof Nf&&(h=h.originalError),h instanceof DOMException&&"AbortError"==h.name)return[2,a({},Tv)];if(g)return g(h),[2,a({},Tv)];throw h;case 6:return y&&y(u),[7];case 7:return[2]}})})}},[]);return w(function(){return function(){O&&Lf.abort()}},[]),w(function(){return function(){$.clear()}},[]),X},jv=function(t){var n=e(g({filterData:{},chipData:{},sort:[],pagination:{offset:0,limit:0},search:""}),2),r=n[0],o=n[1];return{handler:function(e,n,r,i,a,l){return e=Av(e),o({filterData:e,pagination:n,sort:r,chipData:i,search:a}),"function"==typeof t?t(e,n,r,i,a,l):t},data:r}},Ov=function(e,t){void 0===e&&(e={}),void 0===t&&(t="");var n=Or(e);return h(function(){var e=new URL(window.location.href,window.location.origin),r=a({},n),o="".concat(t,"_");return e.searchParams.forEach(function(e,t){t.startsWith(o)&&("true"===e?Hn(r,t.replace(o,""),!0):"false"===e?Hn(r,t.replace(o,""),!1):"null"===e?Hn(r,t.replace(o,""),null):e&&!isNaN(e)?Hn(r,t.replace(o,""),parseInt(e)):Hn(r,t.replace(o,""),e))}),r},[n])},Fv=Gn(function(o,i,a){return t(void 0,[o,i,a],void 0,function(t,o,i){var a,l,u,s,d,f,m,p,h,v,g,b,y,w,E,x=t.state,C=t.action,k=o.prefix,S=void 0===k?"":k,L=o.updateDelay,N=void 0===L?500:L,I=o.noCleanupExtra,M=void 0!==I&&I,R=o.noCleanupOnLeave,P=void 0!==R&&R;return n(this,function(t){switch(t.label){case 0:return[4,qn(N)];case 1:if(t.sent(),!i.current)return[2];if("update"===C){if(a=new URL(window.location.href,window.location.origin),Object.entries(x).forEach(function(t){var n=e(t,2),r=n[0],o=n[1];Array.isArray(o)||_n(o)?a.searchParams.set("".concat(S,"_").concat(r),JSON.stringify(o)):a.searchParams.set("".concat(S,"_").concat(r),String(o))}),!M)try{for(l=c(r([],e(a.searchParams.keys()),!1)),u=l.next();!u.done;u=l.next())(h=u.value).startsWith("".concat(S,"_"))||a.searchParams.delete(h)}catch(e){v={error:e}}finally{try{u&&!u.done&&(g=l.return)&&g.call(l)}finally{if(v)throw v.error}}window.history.pushState(null,"",a.toString())}if("unmount"===C){if(s=new URL(window.location.href,window.location.origin),P)return[2];try{for(d=c(r([],e(s.searchParams.keys()),!1)),f=d.next();!f.done;f=d.next())h=f.value,s.searchParams.delete(h)}catch(e){b={error:e}}finally{try{f&&!f.done&&(y=d.return)&&y.call(d)}finally{if(b)throw b.error}}if(!M)try{for(m=c(r([],e(s.searchParams.keys()),!1)),p=m.next();!p.done;p=m.next())(h=p.value).startsWith("".concat(S,"_"))||s.searchParams.delete(h)}catch(e){w={error:e}}finally{try{p&&!p.done&&(E=m.return)&&E.call(m)}finally{if(w)throw w.error}}window.history.pushState(null,"",s.toString())}return[2]}})})}),_v=function(t,n){void 0===t&&(t={});var r=void 0===n?{}:n,o=r.prefix,i=void 0===o?"":o,a=r.updateDelay,l=void 0===a?500:a,c=r.noCleanupExtra,u=void 0!==c&&c,s=r.noCleanupOnLeave,d=void 0!==s&&s,f=Ov(t,i),m=e(g(f),2),p=m[0],h=m[1],v=b(!0);return w(function(){Fv({action:"update",state:p},{prefix:i,updateDelay:l,noCleanupExtra:u,noCleanupOnLeave:d},v)},[p]),w(function(){return function(){Fv({action:"unmount",state:p},{prefix:i,updateDelay:l,noCleanupExtra:u,noCleanupOnLeave:d},v),v.current=!1}},[]),[p,h]},Bv={filterData:{},sortModel:[],chipData:{},limit:vv,page:0,search:""},Hv=function(t,n){void 0===t&&(t=Bv);var r=void 0===n?{}:n,o=r.onFilterChange,i=void 0===o?function(){return null}:o,l=r.onLimitChange,c=void 0===l?function(){return null}:l,u=r.onPageChange,s=void 0===u?function(){return null}:u,d=r.onSortModelChange,f=void 0===d?function(){return null}:d,m=r.onChipsChange,p=void 0===m?function(){return null}:m,v=r.onSearchChange,g=void 0===v?function(){return null}:v,b=r.onChange,y=void 0===b?function(){return null}:b,w=r.removeEmptyFilters,E=void 0===w?Av:w,x=r.prefix,C=void 0===x?"list":x,k=r.noCleanupExtra,S=r.noCleanupOnLeave,L=r.fallback,N=h(function(){return{chipData:t.chipData||Bv.chipData,filterData:t.filterData||Bv.filterData,limit:t.limit||Bv.limit,page:t.page||Bv.page,search:t.search||Bv.search,sortModel:t.sortModel||Bv.sortModel}},[]),I=e(_v(function(){return{filterData:JSON.stringify(N.filterData)||"{}",sortModel:JSON.stringify(N.sortModel)||"[]",chipData:JSON.stringify(N.chipData)||"{}",limit:N.limit||vv,page:N.page||0,search:N.search||""}},{prefix:C,noCleanupExtra:k,noCleanupOnLeave:S}),2),M=I[0],R=I[1],P=zr(M),A=h(function(){return{filterData:JSON.parse(M.filterData||"{}"),sortModel:JSON.parse(M.sortModel||"[]"),chipData:JSON.parse(M.chipData||"{}"),limit:M.limit||vv,page:M.page||0,search:M.search||""}},[M]),T=zr(A);$r(function(){y(JSON.stringify(P.current))},[M]);var D=function(e){e=E(e),R(function(t){return a(a({},t),{filterData:JSON.stringify(e||"{}")})}),i(e)},j=function(e){R(function(t){return a(a({},t),{limit:e})}),c(e)},O=function(e){R(function(t){return a(a({},t),{page:e})}),s(e)},F=function(e){R(function(t){return a(a({},t),{sortModel:JSON.stringify(e||"[]")})}),f(e)},_=function(e){R(function(t){return a(a({},t),{chipData:JSON.stringify(e||"{}")})}),p(e)},B=function(e){R(function(t){return a(a({},t),{search:e})}),g(e)},H={getFilterData:function(){return T.current.filterData||{}},getSortModel:function(){return T.current.sortModel||[]},getChipData:function(){return T.current.chipData||{}},getLimit:function(){return T.current.limit||vv},getPage:function(){return T.current.page||0},getSearch:function(){return T.current.search||""}},W={setFilterData:D,setSortModel:F,setChipData:_,setLimit:j,setPage:O,setSearch:B};return a(a({listProps:a(a({onFilterChange:D,onLimitChange:j,onPageChange:O,onSortModelChange:F,onChipsChange:_,onSearchChange:B},L&&{fallback:L}),A)},H),W)},Wv=function(e){for(var t,n,r=[],o=1;o<arguments.length;o++)r[o-1]=arguments[o];var i=e;try{for(var a=c(r),l=a.next();!l.done;l=a.next()){var u=l.value;i=i.split(u).join("")}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return i},zv=[",",";","-","@"],Vv={rows:[],total:null},Yv=["name","label","title","description"],Uv=function(o,i){var l=void 0===i?{}:i,c=l.searchEntries,u=void 0===c?Yv:c,s=l.searchFilterChars,d=void 0===s?zv:s,f=l.responseMap,m=void 0===f?function(e){return e}:f,p=l.removeEmptyFilters,v=void 0===p?Av:p,g=l.compareFn,b=void 0===g?function(e,t,n){var r=e[n],o=t[n];return"number"==typeof r&&"number"==typeof o?r-o:"boolean"==typeof r&&"boolean"==typeof o?(r?1:0)-(o?1:0):"string"==typeof r&&"string"==typeof o?r.match(Fl)&&o.match(Fl)?Xl(r)-Xl(o):r.match(_l)&&o.match(_l)?$l(r)-$l(o):r.localeCompare(o):String(r||"").localeCompare(String(o||""))}:g,y=l.filterHandler,E=void 0===y?function(t,n){return Object.entries(n).forEach(function(n){var r=e(n,2),o=r[0],i=r[1];if(Array.isArray(i))t=t.filter(function(e){var t=e[o];return Array.isArray(t)?i.every(function(e){return t.includes(e)}):i.includes(t)});else if(i){var a=String(i).toLocaleLowerCase();t=t.filter(function(e){return!!e[o]&&String(e[o]).toLowerCase().includes(a)})}}),t}:y,x=l.chipsHandler,C=void 0===x?function(t,n){if(!Object.values(n).reduce(function(e,t){return e||t},!1))return t;var r=[];return Object.entries(n).forEach(function(n){var o=e(n,2),i=o[0];o[1]&&r.push(t.filter(function(e){return e[i]}))}),r.flat()}:x,k=l.sortHandler,S=void 0===k?function(e,t){return t.forEach(function(t){var n=t.field,r=t.sort;e=e.sort(function(e,t){return"asc"===r?b(e,t,n):b(t,e,n)})}),e}:k,L=l.searchHandler,N=void 0===L?function(t,n){if(t.length&&n){var o=u.every(function(e){return void 0!==t[0][e]}),i=Wv.apply(void 0,r([n.toLowerCase()],e(d),!1)).split(" ");return o?t.filter(function(t){var n=!0;return i.forEach(function(o){n=n&&u.some(function(n){var i=t[n]?String(t[n]).toLowerCase():"";return!!(i=Wv.apply(void 0,r([i],e(d),!1)))&&i.includes(o)})}),n}):(console.warn("react-declatative useArrayPaginator searchHandler missing field detected"),t)}return t}:L,I=l.paginationHandler,M=void 0===I?function(e,t){var n=t.limit,r=t.offset;return e.length>n?e.slice(r,n+r):e}:I,R=l.withPagination,P=void 0===R||R,A=l.withFilters,T=void 0===A||A,D=l.withChips,j=void 0===D||D,O=l.withSort,F=void 0===O||O,_=l.withTotal,B=void 0===_||_,H=l.withSearch,W=void 0===H||H,z=l.fallback,V=l.onLoadStart,Y=l.onLoadEnd,U=l.onData,q=h(function(){return Gn(function(e,r,i,a,l,c){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return"function"!=typeof o?[3,2]:[4,o(e,r,i,a,l,c)];case 1:return[2,t.sent()];case 2:return[2,o]}})})})},[]),$=h(function(){return function(o,i,l,c,u,s){return t(void 0,void 0,void 0,function(){var t,d,f,p,h,g,b;return n(this,function(n){switch(n.label){case 0:o=v(o),t=!0,n.label=1;case 1:return n.trys.push([1,4,5,6]),V&&V(),[4,q(o,i,l,c,u,s)];case 2:return(d=n.sent())===$n?[2,{rows:[],total:null}]:(f=!Array.isArray(d),p=f?d.rows:d,p=r([],e(p),!1).map(function(e){return a({},e)}),[4,m(p)]);case 3:return p=n.sent(),U&&U(p,{filterData:o,pagination:i,sort:l,chipData:c,search:u}),T&&!f&&(p=E(p.slice(0),o)),j&&!f&&(p=C(p.slice(0),c)),F&&!f&&(p=S(p.slice(0),l)),W&&!f&&(p=N(p.slice(0),u)),h=p.length,P&&!f&&(p=M(p.slice(0),i)),g=f?d.total||null:h,[2,{rows:p,total:B?g:null}];case 4:if(b=n.sent(),q.clear(),t=!1,z)return z(b),[2,a({},Vv)];throw b;case 5:return Y&&Y(t),[7];case 6:return[2]}})})}},[]);return w(function(){return function(){return q.clear()}},[]),$},qv=function(t,n){var o=h(function(){return so(function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];return"function"==typeof t?t.apply(void 0,r([],e(n),!1)):t})},[]);return{handler:Uv(o,n),clear:o.clear}},$v={filterData:{},sortModel:[],chipData:{},limit:vv,page:0,search:""},Xv=function(t,n){var r=void 0===n?{}:n,o=r.initialValue,i=void 0===o?$v:o,l=r.onFilterChange,c=void 0===l?function(){return null}:l,u=r.onLimitChange,s=void 0===u?function(){return null}:u,d=r.onPageChange,f=void 0===d?function(){return null}:d,m=r.onSortModelChange,p=void 0===m?function(){return null}:m,v=r.onChipsChange,b=void 0===v?function(){return null}:v,E=r.onSearchChange,x=void 0===E?function(){return null}:E,C=r.onChange,k=void 0===C?function(){return null}:C,S=r.removeEmptyFilters,L=void 0===S?Av:S,N=r.fallback,I=h(function(){return{chipData:i.chipData||$v.chipData,filterData:i.filterData||$v.filterData,limit:i.limit||$v.limit,page:i.page||$v.page,search:i.search||$v.search,sortModel:i.sortModel||$v.sortModel}},[]),M=y(function(){return t.location.state?t.location.state:{}},[]),R=e(g(function(){return a(a({},I),M())}),2),P=R[0],A=R[1],T=zr(P);w(function(){return t.listen(function(e){var t=e.location,n=a(a({},I),t.state||{});A(n),k(n)})},[]);var D=h(function(){return{filterData:P.filterData||{},sortModel:P.sortModel||[],chipData:P.chipData||{},limit:P.limit||vv,page:P.page||0,search:P.search||""}},[P]),j=zr(D),O=function(e){e=L(e),t.replace(t.location,a(a({},T.current),{filterData:e||{}})),c(e)},F=function(e){t.replace(t.location,a(a({},T.current),{limit:e})),s(e)},_=function(e){t.replace(t.location,a(a({},T.current),{page:e})),f(e)},B=function(e){t.replace(t.location,a(a({},T.current),{sortModel:e||[]})),p(e)},H=function(e){t.replace(t.location,a(a({},T.current),{chipData:e||{}})),b(e)},W=function(e){t.replace(t.location,a(a({},T.current),{search:e})),x(e)},z={getFilterData:function(){return j.current.filterData||{}},getSortModel:function(){return j.current.sortModel||[]},getChipData:function(){return j.current.chipData||{}},getLimit:function(){return j.current.limit||vv},getPage:function(){return j.current.page||0},getSearch:function(){return j.current.search||""}},V={setFilterData:O,setSortModel:B,setChipData:H,setLimit:F,setPage:_,setSearch:W};return a(a({listProps:a(a({onFilterChange:O,onLimitChange:F,onPageChange:_,onSortModelChange:B,onChipsChange:H,onSearchChange:W},N&&{fallback:N}),D)},z),V)},Gv=function(t){var n=void 0===t?{}:t,r=n.selectedRows,o=void 0===r?[]:r,i=n.onChange,a=e(g(o),2),l=a[0],c=a[1],u=y(function(){return c([])},[]);return $r(function(){i&&i(l)},[l]),{selectedRows:l,listProps:{selectedRows:l,onSelectedRows:function(e){return c(e)}},deselectAll:u,setSelectedRows:c}},Kv=function(e){var r=e.onLoadStart,o=e.onLoadEnd,i=e.throwError,a=e.fallback,l=e.fetchRow,c=e.onAction,u=e.onRowAction,s=e.onSelectionChange,d=e.selectedRows,f=Gv({selectedRows:d,onChange:s}),m=f.deselectAll,p=f.listProps,h=f.selectedRows,v=Ai(function(e){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return c?[4,Promise.all(h.map(l))]:[3,3];case 1:return t=n.sent(),[4,c(e,t,m)];case 2:n.sent(),n.label=3;case 3:return[2]}})})},{onLoadStart:r,onLoadEnd:o,throwError:i,fallback:a}).execute,g=Ai(function(e){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return u?[4,u(e.action,e.row,m)]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}})})},{onLoadStart:r,onLoadEnd:o,throwError:i,fallback:a}).execute;return{deselectAll:m,selectedRows:h,listProps:p,commitAction:v,commitRowAction:function(e,t){return g({action:e,row:t})}}},Qv=An()(function(e){return{root:{height:48,width:"100%",background:$(e.palette.getContrastText(e.palette.background.paper),.05)},stretch:{flex:1}}}),Jv=function(t){var n=t.listChips,o=void 0===n?[]:n,i=t.loading,l=Qv().classes,c=fm(),u=c.withSingleChip,s=c.AfterChips,d=gh(),m=d.chips,p=d.setChips,h=function(t,n){return void 0===n&&(n=!0),function(){u&&r([],e(m.keys()),!1).forEach(function(e){return m.set(e,!1)}),m.set(t,n),p(m)}},v=function(e){var t=e.name.toString(),n=!!m.get(t);return f.createElement(He,{variant:n?"filled":"outlined",onClick:h(t,!n),onDelete:n?h(t,!1):void 0,color:"primary",label:e.label,disabled:i})},g=o.filter(function(e){var t=e.name;return m.get(t.toString())}).map(v),b=o.filter(function(e){var t=e.name;return!m.get(t.toString())}).map(v);return f.createElement(nm,{className:l.root,hideOverflowY:!0},f.createElement(we,{alignItems:"center",direction:"row",marginLeft:"5px",marginRight:"5px",spacing:1},g,b,f.createElement("div",{className:l.stretch}),s&&f.createElement(s,a({},t))))},Zv=function(t){var n=void 0===t?{}:t,r=n.debounce,o=void 0===r?10:r,i=n.compute,a=void 0===i?function(e){return e}:i,l=n.onResize,c=y(function(){var e=a({height:Math.floor(window.innerHeight),width:Math.floor(window.innerWidth)});return e.height=Math.floor(e.height),e.width=Math.floor(e.width),e},[]),u=e(g(c),2),s=u[0],d=u[1],f=zr(s);return w(function(){var e=Jn(function(){var e=f.current,t=c();e.height===t.height&&e.width===t.width||(d(t),l&&l(t))},o);return window.addEventListener("resize",e),window.visualViewport&&window.visualViewport.addEventListener("resize",e),function(){window.visualViewport&&window.visualViewport.removeEventListener("resize",e),window.removeEventListener("resize",e),e.clear()}},[]),s},eg=An()(function(e){return{root:{display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"},container:{position:"static",padding:20,display:"flex",flexDirection:"column",alignItems:"stretch",justifyContent:"stretch",backgroundColor:e.palette.background.paper,borderRadius:5,gap:5},loader:{minHeight:"".concat(4,"px"),maxHeight:"".concat(4,"px"),marginTop:"-".concat(4,"px"),zIndex:2,width:"100%"},content:{flex:1,overflowY:"auto",overflowX:"hidden",paddingTop:e.spacing(1)},title:{display:"flex",justifyContent:"stretch",alignItems:"center",paddingBottom:15,color:e.palette.text.primary},stretch:{flex:1},submit:{marginTop:15},disabled:{opacity:.5,pointerEvents:"none"}}}),tg=function(){return{height:0,width:0,sx:{maxHeight:"80%",minWidth:"330px",maxWidth:"450px",margin:"10px"}}},ng=function(e){return{height:e.height-50,width:e.width-50}},rg=function(r){var o,i=r.withActionButton,l=void 0===i||i,c=r.withStaticAction,u=void 0!==c&&c,s=r.withLoader,d=void 0!==s&&s,m=r.waitForChangesDelay,p=void 0===m?u?0:1e3:m,h=r.onSubmit,v=void 0===h?function(){return!0}:h,b=r.onChange,w=void 0===b?function(){}:b,E=r.onInvalid,x=void 0===E?function(){}:E,C=r.onLoadStart,k=r.onLoadEnd,S=r.fallback,L=r.fields,N=r.param,I=r.handler,M=r.payload,R=void 0===M?{}:M,P=r.fullScreen,A=void 0!==P&&P,T=r.sizeRequest,D=void 0===T?A?ng:tg:T,O=r.title,F=r.apiRef,B=r.features,H=r.changeSubject,W=r.reloadSubject,z=r.isBaselineForRoot,V=r.isBaseline,Y=r.outlinePaper,U=void 0!==Y&&Y,q=r.transparentPaper,$=void 0!==q&&q,X=r.open,G=void 0===X||X,K=r.dirty,Q=void 0!==K&&K,J=r.hidden,Z=void 0!==J&&J,ee=r.readonly,te=void 0!==ee&&ee,ne=r.throwError,re=void 0!==ne&&ne,oe=r.submitLabel,ie=void 0===oe?"Submit":oe,ae=r.submitIcon,le=r.AfterTitle,ce=r.BeforeTitle,ue=r.readTransform,se=r.writeTransform,de=r.incomingTransform,fe=r.outgoingTransform,me=eg().classes,pe=Or(R),he=Zv({compute:function(e){var t=D(e);return{height:t.height,width:t.width,sx:t.sx}},debounce:10}),ve=e(g(null),2),ge=ve[0],be=ve[1],ye=e(Dr(0),2),we=ye[0],Ee=ye[1],xe=zr(ge),Ce=y(function(){return d&&we.current?f.createElement(De,{className:me.loader,variant:"indeterminate"}):null},[we.current]),ke=function(){Ee(function(e){return e+1}),C&&C()},Le=function(e){Ee(function(e){return e-1}),k&&k(e)},Ne=il([ge],10),Ie=function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:if(we.current)return[2];e=!0,n.label=1;case 1:return n.trys.push([1,4,5,6]),ke(),G?[4,v(null,pe,N)]:[3,3];case 2:n.sent(),n.label=3;case 3:return[3,6];case 4:if(t=n.sent(),e=!1,re)throw t;return S&&S(t),[3,6];case 5:return Le(e),[7];case 6:return[2]}})})};return f.createElement(Se,{className:me.root,open:G,sx:a({},Z&&{visibility:"hidden",opacity:0}),onClose:function(){G&&Ie()}},f.createElement(j,{className:Eo(me.container,"action-modal__root"),sx:a({height:he.height||void 0,width:he.width||void 0},he.sx)},O&&f.createElement("div",{className:me.title},ce&&f.createElement(ce,{payload:pe,param:N,onClose:Ie}),f.createElement(_,{className:me.stretch,variant:"h6",component:"h2"},O),le&&f.createElement(le,{payload:pe,param:N,onClose:Ie})),Ce(),f.createElement(j,{className:me.content},f.createElement(bf,{apiRef:F,changeSubject:H,reloadSubject:W,className:Eo((o={},o[me.disabled]=!!we.current,o)),isBaselineForRoot:z,isBaseline:V,readonly:!!we.current||te,outlinePaper:U,transparentPaper:$,invalidity:function(e,t){be(null),x(e,t)},change:function(e,t){be(e),w(e,t)},handler:I,payload:pe,fields:L,dirty:Q,features:B,readTransform:ue,writeTransform:se,incomingTransform:de,outgoingTransform:fe,loadStart:function(e){"one-resolve"===e&&ke()},loadEnd:function(e,t){"one-resolve"===t&&Le(e)}})),!te&&l&&f.createElement(ui,{className:me.submit,startIcon:ae&&f.createElement(ae,null),disabled:!(u||!we.current&&ge),size:"large",variant:"contained",color:"info",fullWidth:!0,onClick:function(){return t(void 0,void 0,void 0,function(){var e,r;return n(this,function(o){switch(o.label){case 0:if(we.current)return[2];e=!0,o.label=1;case 1:return o.trys.push([1,5,6,7]),ke(),G?[4,t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,Promise.race([Ne(),qn(p)])];case 1:return e.sent(),[2]}})})]:[3,4];case 2:return o.sent(),[4,v(u?{}:xe.current,pe,N)];case 3:o.sent(),o.label=4;case 4:return[3,7];case 5:if(r=o.sent(),e=!1,re)throw r;return S&&S(r),[3,7];case 6:return Le(e),[7];case 7:return[2]}})})}},ie)))},og=function(r){var o=r.hidden,i=r.fields,a=r.waitForChangesDelay,l=r.param,c=r.features,u=r.handler,s=r.fallback,d=r.apiRef,m=r.changeSubject,p=r.reloadSubject,h=r.withLoader,v=r.withActionButton,b=void 0===v||v,E=r.withStaticAction,x=r.payload,C=void 0===x?{}:x,k=r.BeforeTitle,S=r.onChange,L=r.onClose,N=r.onSubmit,I=void 0===N?function(){return!0}:N,M=r.onLoadEnd,R=r.onLoadStart,P=r.onInvalid,A=r.readTransform,T=r.writeTransform,D=r.incomingTransform,j=r.outgoingTransform,O=r.isBaseline,F=r.isBaselineForRoot,_=r.AfterTitle,B=r.outlinePaper,H=r.transparentPaper,W=r.submitLabel,z=r.submitIcon,V=r.throwError,Y=r.dirty,U=r.readonly,q=r.fullScreen,$=r.sizeRequest,X=r.title,G=Or(C),K=e(g(!1),2),Q=K[0],J=K[1],Z=e(g(l),2),ee=Z[0],te=Z[1];w(function(){te(l)},[l]),$r(function(){Q||L&&L()},[Q]);var ne=to(I),re=zr(ee),oe=y(function(e){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return[4,ne(e,G,re.current)];case 1:return t=n.sent(),J(!t),[2,t]}})})},[]),ie=y(function(){return f.createElement(rg,{AfterTitle:_,open:Q,hidden:o,withLoader:h,withActionButton:b,withStaticAction:E,waitForChangesDelay:a,isBaselineForRoot:F,isBaseline:O,readonly:U,fullScreen:q,apiRef:d,changeSubject:m,reloadSubject:p,outlinePaper:B,transparentPaper:H,sizeRequest:$,submitIcon:z,fields:i,handler:u,payload:G,fallback:s,onChange:S,onInvalid:P,onLoadEnd:M,onLoadStart:R,submitLabel:W,throwError:V,onSubmit:oe,features:c,readTransform:A,writeTransform:T,incomingTransform:D,outgoingTransform:j,title:X,dirty:Y,param:ee,BeforeTitle:k})},[Q,o,U,Y,i,d,m,p,u,G,s,S,P,M,R,oe,W,V,X]),ae=y(function(e){te(e),J(!0)},[]);return{open:Q,setOpen:J,render:ie,pickData:ae}},ig=function(e){return og(e)},ag=An()(function(e){return{root:{display:"flex",alignItems:"stretch",justifyContent:"stretch",background:A(e.palette.getContrastText(e.palette.background.paper),.05)},container:{flex:1,minHeight:60,maxHeight:"50vh",overflow:"hidden",overflowY:"auto"},controls:{display:"flex",alignItems:"center"},controlsWidth:{marginRight:"5px"},title:{display:"flex",alignItems:"center"},disabled:{pointerEvents:"none",userSelect:"none",opacity:.5},labelContent:{display:"flex",minHeight:"60px","& > *:nth-of-type(1)":{flex:1},padding:e.spacing(1)},filters:{padding:e.spacing(1),overflowX:"hidden",overflowY:"auto"}}}),lg=function(e){var t,n=e.className,r=e.style,o=e.filterData,i=e.filters,a=e.change,l=e.label,u=e.loading,s=e.withSearch,d=e.withToggledFilters,m=e.search,p=e.onSearchChange,v=void 0===p?function(){return null}:p,g=e.onFilterChange,b=void 0===g?function(){return null}:g,y=zm(),w=fm(),E=w.filterLabel,x=w.readTransform,C=w.writeTransform,k=w.incomingTransform,S=w.outgoingTransform,L=w.modalSizeRequest,N=w.isBaseline,I=w.isBaselineForRoot,M=Ah({value:m,onChange:v}),R=M.inputRef,P=M.inputValue,A=M.onInputChange,T=og({AfterTitle:function(e){var t=e.onClose;return f.createElement(Ne,{size:"small",onClick:t},f.createElement(Fe,null))},readTransform:x,writeTransform:C,incomingTransform:k,outgoingTransform:S,isBaseline:N,isBaselineForRoot:I,sizeRequest:L,outlinePaper:!0,handler:o,title:E,payload:y,fields:i,onSubmit:function(e){return e&&B(e),!0},readonly:u}),D=T.render,O=T.pickData,F=ag().classes,B=function(e){b(e),a(e)},H=function(){v("")},W=h(function(){var e,t,n=Object.keys(o||{}),r=0;try{for(var i=c(n),a=i.next();!a.done;a=i.next()){var l=a.value;null!==o[l]&&(""!==o[l]&&!1!==o[l]&&r++)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return r},[o]);return f.createElement("div",{className:Eo(n,F.root),style:r},f.createElement("div",{className:F.container},f.createElement(j,{className:F.labelContent},function(){var e;return s?f.createElement(xe,{label:"Search",variant:"standard",inputRef:R,value:P,onChange:A,onKeyDown:function(e){var t=e.key,n=e.currentTarget;"Enter"!==t&&"Escape"!==t||n.blur()},className:Eo((e={},e[F.disabled]=u,e)),sx:{maxWidth:"max(calc(50% - 75px), 256px)"},InputProps:{readOnly:u,startAdornment:f.createElement(Le,{position:"start"},f.createElement(ot,null)),endAdornment:!!m&&f.createElement(Le,{sx:{cursor:"pointer",marginBottom:"15px"},onClick:H,position:"end"},f.createElement(Fe,null))},placeholder:l,InputLabelProps:{shrink:!0},focused:!0}):f.createElement(_,{variant:"body1",className:F.title},l)}())),f.createElement("div",{className:Eo(F.controls,(t={},t[F.controlsWidth]=!d,t))},f.createElement(pt,{sx:{mr:1,zIndex:99},badgeContent:W,color:"info"},f.createElement(ye,{startIcon:f.createElement(Ft,null),variant:"contained",sx:{fontWeight:"bold",ml:1},disabled:u,onClick:O},"Filters"))),D())},cg=An()(function(e){return{root:{display:"flex",alignItems:"stretch",justifyContent:"stretch",background:A(e.palette.getContrastText(e.palette.background.paper),.05)},container:{flex:1,minHeight:60,maxHeight:"50vh",overflow:"hidden",overflowY:"auto"},controls:{display:"flex",alignItems:"center"},controlsWidth:{marginRight:"5px"},title:{display:"flex",alignItems:"center"},disabled:{pointerEvents:"none",userSelect:"none",opacity:.5},labelContent:{display:"flex",minHeight:"60px","& > *:nth-of-type(1)":{flex:1},padding:e.spacing(1)},filters:{padding:e.spacing(1),overflowX:"hidden",overflowY:"auto"}}}),ug=function(e){var t,n=e.className,r=e.style,o=e.filterData,i=e.filters,a=e.change,l=e.label,u=e.loading,s=e.withSearch,d=e.withToggledFilters,m=e.search,p=e.onSearchChange,v=void 0===p?function(){return null}:p,g=e.onFilterChange,b=void 0===g?function(){return null}:g,y=zm(),w=fm(),E=w.filterLabel,x=w.readTransform,C=w.writeTransform,k=w.incomingTransform,S=w.outgoingTransform,L=w.modalSizeRequest,N=w.isBaseline,I=w.isBaselineForRoot,M=Ah({value:m,onChange:v}),R=M.inputRef,P=M.inputValue,A=M.onInputChange,T=og({AfterTitle:function(e){var t=e.onClose;return f.createElement(Ne,{size:"small",onClick:t},f.createElement(Fe,null))},sizeRequest:L,isBaseline:N,isBaselineForRoot:I,fullScreen:!0,outlinePaper:!0,handler:o,title:E,readTransform:x,writeTransform:C,incomingTransform:k,outgoingTransform:S,payload:y,fields:i,onSubmit:function(e){return e&&B(e),!0},readonly:u}),D=T.render,O=T.pickData,F=cg().classes,B=function(e){b(e),a(e)},H=function(){v("")},W=h(function(){var e,t,n=Object.keys(o||{}),r=0;try{for(var i=c(n),a=i.next();!a.done;a=i.next()){var l=a.value;null!==o[l]&&(""!==o[l]&&!1!==o[l]&&r++)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return r},[o]);return f.createElement("div",{className:Eo(n,F.root),style:r},f.createElement("div",{className:F.container},f.createElement(j,{className:F.labelContent},function(){var e;return s?f.createElement(xe,{label:"Search",variant:"standard",inputRef:R,value:P,onChange:A,onKeyDown:function(e){var t=e.key,n=e.currentTarget;"Enter"!==t&&"Escape"!==t||n.blur()},className:Eo((e={},e[F.disabled]=u,e)),sx:{maxWidth:"max(calc(50% - 75px), 256px)"},InputProps:{readOnly:u,startAdornment:f.createElement(Le,{position:"start"},f.createElement(ot,null)),endAdornment:!!m&&f.createElement(Le,{sx:{cursor:"pointer",marginBottom:"15px"},onClick:H,position:"end"},f.createElement(Fe,null))},placeholder:l,InputLabelProps:{shrink:!0},focused:!0}):f.createElement(_,{variant:"body1",className:F.title},l)}())),f.createElement("div",{className:Eo(F.controls,(t={},t[F.controlsWidth]=!d,t))},f.createElement(pt,{sx:{mr:1,zIndex:99},badgeContent:W,color:"info"},f.createElement(ye,{startIcon:f.createElement(Ft,null),variant:"contained",sx:{fontWeight:"bold",ml:1},disabled:u,onClick:O},"Filters"))),D())},sg="action-menu",dg=An()({button:{minHeight:"35px !important",maxHeight:"35px !important",paddingLeft:"15px !important",paddingRight:"15px !important",order:-1,zIndex:99},fab:{order:-1,zIndex:99}}),fg=e(Er(),2),mg=fg[0],pg=fg[1],hg=function(e){var r=e.action,o=void 0===r?"add-action":r,i=e.width,a=e.label,l=e.isVisible,c=void 0===l?function(){return!0}:l,u=e.isDisabled,s=void 0===u?function(){return!1}:u,d=dg().classes,m=zm(),p=fm(),h=Zm(),v=bp().selectedRows,g=p.fallback,b=p.onAction,y=p.onLoadStart,w=p.onLoadEnd,E=to(function(e){e.stopPropagation(),b&&b(o,v,h)}),x=function(e){var t=e.disabled,n=e.onClick,r=pg(),o=fm().loading;return a&&!r?f.createElement(ye,{className:d.button,variant:"contained",disabled:o||t,size:"small",startIcon:f.createElement(Mt,{color:"inherit"}),onClick:n},a):f.createElement(Te,{className:d.fab,disabled:o||t,size:"small",color:"primary",onClick:n},f.createElement(Mt,{color:"inherit"}))},C=i<500;return f.createElement(mg,{payload:C},f.createElement(Jr,{Loader:function(){var e=pg();return a&&!e?f.createElement(ye,{className:d.button,variant:"contained",size:"small",startIcon:f.createElement(Mt,{color:"inherit"})},a):f.createElement(Te,{className:d.fab,disabled:!0,size:"small",color:"primary"},f.createElement(Mt,{color:"inherit"}))},fallback:g,onLoadStart:function(){return y&&y(sg)},onLoadEnd:function(e){return w&&w(e,sg)},payload:v,deps:[m],throwError:!0},function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:return[4,c(v,m)];case 1:return e=n.sent(),[4,s(v,m)];case 2:return t=n.sent(),e?[2,f.createElement(x,{disabled:t,onClick:E})]:[2,null]}})})}))},vg="action-menu",gg=An()({button:{minHeight:"35px !important",maxHeight:"35px !important",paddingLeft:"15px !important",paddingRight:"15px !important"},fab:{zIndex:99,minHeight:"40px !important",maxHeight:"40px !important"}}),bg=e(Er(),2),yg=bg[0],wg=bg[1],Eg=function(e){var r=e.action,o=void 0===r?"fab-action":r,i=e.label,a=e.width,l=e.icon,c=void 0===l?Tt:l,u=e.isVisible,s=void 0===u?function(){return!0}:u,d=e.isDisabled,m=void 0===d?function(){return!1}:d,p=gg().classes,h=fm(),v=zm(),g=Zm(),b=bp().selectedRows,y=h.fallback,w=h.onAction,E=h.onLoadStart,x=h.onLoadEnd,C=to(function(e){e.stopPropagation(),w&&w(o,b,g)}),k=function(e){var t=e.disabled,n=e.onClick,r=wg(),o=fm().loading;return i&&!r?f.createElement(ye,{className:p.button,variant:"contained",disabled:o||t,size:"small",startIcon:f.createElement(c,{color:"inherit"}),onClick:n},i):f.createElement(Te,{className:p.fab,disabled:o||t,size:"small",color:"primary",onClick:n},f.createElement(c,{color:"inherit"}))},S=a<500;return f.createElement(yg,{payload:S},f.createElement(Jr,{Loader:function(){var e=wg();return i&&!e?f.createElement(ye,{className:p.button,variant:"contained",size:"small",startIcon:f.createElement(c,{color:"inherit"})},i):f.createElement(Te,{className:p.fab,disabled:!0,size:"small",color:"primary"},f.createElement(c,{color:"inherit"}))},fallback:y,onLoadStart:function(){return E&&E(vg)},onLoadEnd:function(e){return x&&x(e,vg)},payload:b,deps:[v],throwError:!0},function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:return[4,s(b,v)];case 1:return e=n.sent(),[4,m(b,v)];case 2:return t=n.sent(),e?[2,f.createElement(k,{disabled:t,onClick:C})]:[2,null]}})})}))},xg="action-menu",Cg=function(t){var n=t.options,o=void 0===n?[]:n,i=t.deps,c=void 0===i?[]:i,u=bp().selectedRows,s=mp(),d=wp(),m=Zm(),p=zm(),h=fm(),v=h.onAction,g=h.fallback,b=h.onLoadStart,y=h.onLoadEnd,w=h.loading,E=h.actionSubject,x=to(function(e){"update-now"===e?m():"resort-action"===e?s():"drop-filters"===e&&d(),v&&v(e,u,m)});Xf(function(){return E&&E.subscribe(x)});return E?null:f.createElement(xa,{options:o.map(function(e){var t=e.action,n=e.isDisabled,r=void 0===n?function(){return!1}:n,o=e.isVisible,i=void 0===o?function(){return!0}:o,c=l(e,["action","isDisabled","isVisible"]);return a(a({action:t},c),"update-now"===t?{icon:c.icon||Pt,isDisabled:function(){return r(u,p)},isVisible:function(){return i(u,p)},label:c.label||"Refresh manually"}:"add-action"===t?{icon:c.icon||Mt,isDisabled:function(){return r(u,p)},isVisible:function(){return i(u,p)},label:c.label||"Create new row"}:"resort-action"===t?{icon:c.icon||At,isDisabled:function(){return r(u,p)},isVisible:function(){return i(u,p)},label:c.label||"Change sort order"}:"drop-filters"===t?{icon:c.icon||Rt,isDisabled:function(){return r(u,p)},isVisible:function(){return i(u,p)},label:c.label||"Drop filters"}:{isDisabled:function(){return r(u,p)},isVisible:function(){return i(u,p)}})}),onAction:x,fallback:g,payload:u,deps:r(r([],e(c),!1),[p],!1),onLoadStart:function(){return b&&b(xg)},onLoadEnd:function(e){return y&&y(e,xg)},disabled:w})},kg=An()(function(e){return{root:{display:"flex",alignItems:"stretch",justifyContent:"stretch",background:A(e.palette.getContrastText(e.palette.background.paper),.05)},container:{flex:1,minHeight:"45px",maxHeight:"50vh",overflow:"hidden",overflowY:"auto"},controls:{display:"flex",alignItems:"center",gap:e.spacing(1)},controlsWidth:{marginRight:"5px"},title:{display:"flex",alignItems:"center"},disabled:{pointerEvents:"none",userSelect:"none",opacity:.5},labelContent:{display:"flex",alignItems:"flex-end",minHeight:"45px","& > *:nth-of-type(1)":{flex:1},padding:e.spacing(1)},filters:{padding:e.spacing(1),overflowX:"hidden",overflowY:"auto"}}}),Sg=function(e){var t,n=e.className,r=e.style,o=e.filterData,i=e.filters,u=e.change,s=e.label,d=e.loading,m=e.withSearch,p=e.withToggledFilters,v=e.search,g=e.height,b=e.width,y=e.onSearchChange,w=void 0===y?function(){return null}:y,E=e.onFilterChange,x=void 0===E?function(){return null}:E,C=zm(),S=bp().selectedRows,L=Ah({value:v,onChange:w}),N=L.inputRef,I=L.inputValue,M=L.onInputChange,R=fm(),P=R.filterLabel,A=R.readTransform,T=R.writeTransform,D=R.incomingTransform,O=R.outgoingTransform,F=R.modalSizeRequest,B=R.isBaseline,H=R.isBaselineForRoot,W=R.actions,z=void 0===W?[]:W,V=og({AfterTitle:function(e){var t=e.onClose;return f.createElement(Ne,{size:"small",onClick:t},f.createElement(Fe,null))},isBaseline:B,isBaselineForRoot:H,sizeRequest:F,fullScreen:!0,outlinePaper:!0,handler:o,title:P,readTransform:A,writeTransform:T,incomingTransform:D,outgoingTransform:O,payload:C,fields:i,onSubmit:function(e){return e&&G(e),!0},readonly:d}),Y=V.render,U=V.pickData,q=kg(),$=q.classes,X=q.cx,G=function(e){x(e),u(e)},K=function(){w("")},Q=h(function(){var e,t,n=Object.keys(o||{}),r=0;try{for(var i=c(n),a=i.next();!a.done;a=i.next()){var l=a.value;null!==o[l]&&(""!==o[l]&&!1!==o[l]&&r++)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return r},[o]),J=b<500;return f.createElement("div",{className:X(n,$.root),style:r},f.createElement("div",{className:$.container},f.createElement(j,{className:$.labelContent},function(){var e;return m?f.createElement(xe,{inputRef:N,value:I,onChange:M,variant:"standard",onKeyDown:function(e){var t=e.key,n=e.currentTarget;"Enter"!==t&&"Escape"!==t||n.blur()},className:X((e={},e[$.disabled]=d,e)),sx:{maxWidth:"max(calc(50% - 75px), 256px)"},InputProps:{readOnly:d,startAdornment:f.createElement(Le,{position:"start"},f.createElement(ot,null)),endAdornment:!!v&&f.createElement(Le,{sx:{cursor:"pointer"},onClick:K,position:"end"},f.createElement(Fe,null))},placeholder:s||"Search",InputLabelProps:{shrink:!0},focused:!0}):f.createElement(_,{variant:"body1",className:$.title},s)}())),f.createElement("div",{className:X($.controls,(t={},t[$.controlsWidth]=!p,t))},f.createElement(pt,{sx:{zIndex:99},badgeContent:Q,color:"info"},J?f.createElement(Te,{sx:{minHeight:"40px",maxHeight:"40px"},disabled:d,size:"small",color:"primary",onClick:U},f.createElement(Ft,{color:"inherit"})):f.createElement(ye,{startIcon:f.createElement(Ft,null),variant:"contained",size:"small",sx:{minHeight:"35px",maxHeight:"35px"},disabled:d,onClick:U},"Filters")),z.map(function(e,t){return f.createElement(k,{key:t},function(e){var t=e.type,n=e.options,r=void 0===n?[]:n,o=e.isDisabled,i=e.isVisible,c=e.label,u=e.icon,s=e.action;if(t===Sh.Add)return f.createElement(hg,{label:c,action:s,isDisabled:o,isVisible:i,height:g,width:b});if(t===Sh.Fab)return f.createElement(Eg,{label:c,action:s,icon:u,isDisabled:o,isVisible:i,height:g,width:b});if(t===Sh.Menu){var d=r.map(function(e){var t=e.isDisabled,n=void 0===t?function(){return!1}:t,r=e.isVisible,o=void 0===r?function(){return!0}:r,i=l(e,["isDisabled","isVisible"]);return a(a({},i),{isDisabled:function(){return n(S,C)},isVisible:function(){return o(S,C)}})});return f.createElement(Cg,{options:d,deps:[C]})}throw new Error("List Actions unknown action type")}(e))})),Y())},Lg=An()(function(e){return{root:{display:"flex",alignItems:"stretch",justifyContent:"stretch",background:A(e.palette.getContrastText(e.palette.background.paper),.05)},container:{flex:1,minHeight:60,maxHeight:"50vh",overflow:"hidden",overflowY:"auto"},controls:{display:"flex",alignItems:"center",gap:e.spacing(1)},disabled:{pointerEvents:"none",userSelect:"none",opacity:.5},labelContent:{display:"flex",minHeight:"60px","& > *:nth-of-type(1)":{flex:1},padding:e.spacing(1)}}}),Ng=function(e){var t,n=e.className,r=e.style,o=e.label,i=e.loading,c=e.search,u=e.height,s=e.width,d=e.onSearchChange,m=void 0===d?function(){return null}:d,p=zm(),h=Lg().classes,v=bp().selectedRows,g=Ah({value:c,onChange:m}),b=g.inputRef,y=g.inputValue,w=g.onInputChange,E=fm().actions,x=void 0===E?[]:E;return f.createElement("div",{className:Eo(n,h.root),style:r},f.createElement("div",{className:h.container},f.createElement(j,{className:h.labelContent},f.createElement(xe,{label:"Search",variant:"standard",inputRef:b,value:y,onChange:w,sx:{maxWidth:"max(calc(50% - 75px), 256px)"},onKeyDown:function(e){var t=e.key,n=e.currentTarget;"Enter"!==t&&"Escape"!==t||n.blur()},className:Eo((t={},t[h.disabled]=i,t)),InputProps:{readOnly:i,startAdornment:f.createElement(Le,{position:"start"},f.createElement(ot,null)),endAdornment:!!c&&f.createElement(Le,{sx:{cursor:"pointer"},onClick:function(){m("")},position:"end"},f.createElement(Fe,null))},placeholder:o,InputLabelProps:{shrink:!0},focused:!0}))),f.createElement("div",{className:h.controls},x.map(function(e,t){return f.createElement(k,{key:t},function(e){var t=e.type,n=e.options,r=void 0===n?[]:n,o=e.isDisabled,i=e.isVisible,c=e.label,d=e.icon,m=e.action;if(t===Sh.Add)return f.createElement(hg,{label:c,action:m,isDisabled:o,isVisible:i,height:u,width:s});if(t===Sh.Fab)return f.createElement(Eg,{label:c,action:m,icon:d,isDisabled:o,isVisible:i,height:u,width:s});if(t===Sh.Menu){var h=r.map(function(e){var t=e.isDisabled,n=void 0===t?function(){return!1}:t,r=e.isVisible,o=void 0===r?function(){return!0}:r,i=l(e,["isDisabled","isVisible"]);return a(a({},i),{isDisabled:function(){return n(v,p)},isVisible:function(){return o(v,p)}})});return f.createElement(Cg,{options:h,deps:[p]})}throw new Error("List Actions unknown action type")}(e))})))},Ig=function(e){return new function(){this.getValue=function(){try{return JSON.parse(localStorage.getItem(e)||"null")}catch(e){return null}},this.setValue=function(t){try{localStorage.setItem(e,JSON.stringify(t,null,2))}catch(e){e instanceof DOMException&&(console.log("react-declarative createLsManager exceeded the quota"),localStorage.clear(),rp())}},this.clear=function(){localStorage.removeItem(e)}}},Mg=An()(function(e,t,n){var r;return{inactive:{opacity:.5},container:{boxSizing:"border-box",width:"min(100vw - 100px, 400px)",height:340},list:(r={boxSizing:"border-box",width:"100%"},r["& > .".concat(n.item,":nth-of-type(2n)")]={background:$(e.palette.getContrastText(e.palette.background.paper),.04)},r),item:{"& .MuiListItemText-root > .MuiTypography-root":{width:"100%",overflow:"hidden",textOverflow:"ellipsis"}},item_right_side:{display:"flex",alignItems:"center",gap:"5px"},dialog_wrapper:{width:"100%",maxwidth:"400px",boxSizing:"border-box"},dialog:{"&:first-of-type":{padding:0},width:"100%",boxSizing:"border-box"}}}),Rg=function(t){var n=t.columns,o=t.storageKey,i=Mg().classes,l=e(g(!1),2),c=l[0],u=l[1],s=h(function(){var e=Ig("".concat(o,"_v1")),t=e.getValue(),r=n.filter(function(e){return e.field}).filter(function(e){return e.type!==Km.Action}).length;return t&&t.length!==r&&e.clear(),e},[]),d=e(g(function(){var e=s.getValue();return e||(e=n.filter(function(e){return e.field}).filter(function(e){return e.type!==Km.Action}).map(function(e){return{field:e.field,show:!0,displayName:e.fullName||e.headerName||String(e.field)}})),e}),2),m=d[0],p=d[1],v=h(function(){var e=m.filter(function(e){return e.show}).map(function(e){var t=e.field;return n.find(function(e){return e.field===t})}).filter(function(e){return e}),t=n.find(function(e){return e.type===Km.Action});return t&&e.push(t),e},[]),b=function(){s.setValue(m),rp()};return{open:c,render:function(){return f.createElement(st,{open:c,className:i.dialog_wrapper},f.createElement(dt,{className:i.dialog},f.createElement(j,{className:i.container},f.createElement(Ie,{className:i.list,disablePadding:!0},m.map(function(t,n){return f.createElement(tt,{key:n,className:i.item},f.createElement(Oe,{primary:t.displayName}),f.createElement(j,{className:i.item_right_side},f.createElement(Ne,{onClick:function(){return n=t.field,void(0!==(o=m.findIndex(function(e){return e.field===n}))&&p(function(t){var n=t[o];return t[o]=t[o-1],t[o-1]=n,r([],e(t),!1)}));var n,o},disabled:0==n||!t.show},f.createElement(St,null)),f.createElement(Ne,{onClick:function(){return n=t.field,void((o=m.findIndex(function(e){return e.field===n}))!==m.length&&p(function(t){var n=t[o];return t[o]=t[o+1],t[o+1]=n,r([],e(t),!1)}));var n,o},disabled:n==m.length-1||!t.show},f.createElement(Lt,null)),f.createElement(Ze,{checked:t.show,onClick:function(){return e=t.field,p(function(t){return t.map(function(t){return t.field===e?a(a({},t),{show:!t.show}):t})});var e}})))})))),f.createElement(ft,null,f.createElement(ye,{color:"primary",onClick:b},"OK"),f.createElement(ye,{color:"primary",onClick:function(){return u(!1)}},"Отмена")))},columns:v,pickColumns:function(){return u(!0)}}},Pg={FilterListSlot:Sg,ActionListSlot:function(){return f.createElement(f.Fragment,null)},SearchSlot:Ng},Ag=Object.freeze({__proto__:null,denceFilterRule:Pg}),Tg=function(e,t){return function(){return f.createElement(j,{sx:a({display:"flex",flexDirection:"column",height:400,width:"100%",alignItems:"center",justifyContent:"center",fontSize:18,color:"text.secondary"},t)},e)}},Dg=Tg("An error acquired",{color:Wt[500],fontWeight:500,fontSize:24}),jg=Tg("Loading data"),Og=An()({slideDown:{animation:"".concat(D(xh||(xh=s(["\n 0% {\n opacity: 0;\n transform: translateY(-10px);\n }\n 100% {\n opacity: 1;\n transform: translateY(0);\n }\n "],["\n 0% {\n opacity: 0;\n transform: translateY(-10px);\n }\n 100% {\n opacity: 1;\n transform: translateY(0);\n }\n "])))," 250ms ease-out")},fadeIn:{animation:"".concat(D(Ch||(Ch=s(["\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n "],["\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n "])))," 250ms ease-out")},scale:{animation:"".concat(D(kh||(kh=s(["\n 0% {\n transform: scale(0.4);\n }\n 100% {\n transform: scale(1);\n }\n "],["\n 0% {\n transform: scale(0.4);\n }\n 100% {\n transform: scale(1);\n }\n "])))," 250ms ease-out")}}),Fg=x(function(e,t){var n,r=e.children,o=e.className,i=e.animation,c=void 0===i?"slideDown":i,u=e.appear,s=void 0===u||u,d=l(e,["children","className","animation","appear"]),m=Og().classes,p={slideDown:m.slideDown,fadeIn:m.fadeIn,scale:m.scale};return f.createElement(j,a({ref:t,className:Eo(o,(n={},n[p[c]]=s,n))},d),r)}),_g=An()({root:{width:"100%"}}),Bg=function(o){var i=o.animation,c=o.className,u=o.style,s=o.Loader,d=void 0===s?jg:s,m=o.Error,p=void 0===m?Dg:m,h=o.onLoadEnd,v=o.onLoadStart,b=o.children,y=o.state,w=o.payload,E=l(o,["animation","className","style","Loader","Error","onLoadEnd","onLoadStart","children","state","payload"]),x=_g().classes,C=e(g(!1),2),k=C[0],S=C[1],L=function(e){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return"function"!=typeof y?[3,5]:(t=y(e),Array.isArray(t)?[4,Promise.all(t)]:[3,2]);case 1:return[2,n.sent()];case 2:return[4,t];case 3:return[2,[n.sent()]];case 4:return[3,6];case 5:return[2,[]];case 6:return[2]}})})};return f.createElement(Fg,{className:Eo(c,x.root),style:u,animation:i,appear:k},f.createElement(Jr,a({},E,{Loader:d,Error:p,onLoadStart:function(){v&&v(),S(!1)},onLoadEnd:function(e){h&&h(e),S(!0)},payload:w}),function(o){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return[4,L(o)];case 1:return t=n.sent(),[2,b.apply(void 0,r([],e(t),!1))]}})})}))},Hg=function(){return f.createElement("p",null,"Forbidden")},Wg=function(){return f.createElement("p",null,"Not found")},zg=function(){return f.createElement(je,{sx:{zIndex:function(e){return e.zIndex.drawer+1}},open:!0},f.createElement(O,{color:"primary"}))},Vg=function(){return f.createElement("p",null,"500")},Yg=function(e){return t(void 0,void 0,void 0,function(){var t,r;return n(this,function(n){switch(n.label){case 0:return t=e.guard,(r=(void 0===t?function(){return!0}:t)())instanceof Promise?[4,r]:[3,2];case 1:return[2,n.sent()];case 2:return[2,r]}})})},Ug=jf(),qg=function(e){var t=e.element,n=void 0===t?$g:t,r=e.key,o=e.params;return f.createElement(n,a({key:r},o))},$g=function(){return f.createElement(f.Fragment,null)},Xg=new ar,Gg=function(o){var i=o.className,l=o.style,u=o.Loader,s=void 0===u?zg:u,d=o.Forbidden,m=void 0===d?Hg:d,p=o.NotFound,v=void 0===p?Wg:p,y=o.Error,E=void 0===y?Vg:y,x=o.animation,C=o.history,k=void 0===C?Ug:C,S=o.children,L=void 0===S?qg:S,N=o.fallback,I=o.items,M=o.onLoadStart,R=o.onLoadEnd,P=o.onInit,A=void 0===P?function(){}:P,T=o.onDispose,D=void 0===T?function(){}:T,j=o.throwError,O=void 0!==j&&j,F=h(function(){return r([],e(I),!1).sort(function(e,t){var n,r,o,i,a=e.path,l=void 0===a?"":a,c=t.path,u=void 0===c?"":c,s=(null===(n=l.match(/\:/g))||void 0===n?void 0:n.length)||0,d=(null===(r=u.match(/\:/g))||void 0===r?void 0:r.length)||0,f=(null===(o=l.match(/\\/g))||void 0===o?void 0:o.length)||0,m=(null===(i=u.match(/\\/g))||void 0===i?void 0:i.length)||0,p=Math.max(f-s,0);return Math.max(m-d,0)-p})},[]),_=e(g(!1),2),B=_[0],H=_[1],W=b(null),z=e(g(a({},k.location)),2),V=z[0],Y=z[1];w(function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:e=!0,M&&M(),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,A()];case 2:return n.sent(),[3,5];case 3:if(t=n.sent(),e=!1,O)throw t;return N&&N(t),[3,5];case 4:return R&&R(e),H(!0),[7];case 5:return[2]}})}),function(){t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:e=!0,M&&M(),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,D()];case 2:return n.sent(),[3,5];case 3:if(t=n.sent(),e=!1,O)throw t;return N&&N(t),[3,5];case 4:return R&&R(e),[7];case 5:return[2]}})})}},[]),w(function(){return k.listen(function(e){if("REPLACE"!==e.action&&e.location.pathname!==V.pathname){var t=a({},e.location);Y(t)}})},[k,V]);var U=h(function(){return function(){return t(void 0,void 0,void 0,function(){var e,r,o,i,l,u,s,d,f,p;return n(this,function(h){switch(h.label){case 0:return e=V.pathname,r=void 0===e?"/":e,W.current?[4,W.current()]:[3,2];case 1:h.sent(),h.label=2;case 2:o=function(e){var o,i,l,c,u,s,d,f,p,h,v,g,b,y,w,E;return n(this,function(x){switch(x.label){case 0:return o=e.element,i=void 0===o?$g:o,l=e.redirect,c=e.prefetch,u=e.unload,s=e.path,d={},p=_t(s,f=[]),h=p.test(r),v=function(){var e=p.exec(r);e&&f.forEach(function(t,n){d[t.name]=e[n+1]})},g=function(){u&&(W.current=function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,Promise.resolve(u(d))];case 1:return e.sent(),W.current=null,[2]}})})})},h?[4,Yg(e)]:[3,5];case 1:return x.sent()?(v(),c?(y=(b=Object).assign,w=[d],[4,c(d)]):[3,3]):[3,4];case 2:y.apply(b,w.concat([x.sent()])),x.label=3;case 3:return g(),"string"==typeof l?(Y(function(e){return a(a({},e),{pathname:l})}),[2,{value:{element:$g,key:Gr(),path:s}}]):"function"==typeof l&&null!==(E=l(d)||null)?(Y(function(e){return a(a({},e),{pathname:E})}),[2,{value:{element:$g,key:Gr(),path:s}}]):[2,{value:{element:i,key:Gr(),params:d,path:s}}];case 4:return[2,{value:{element:m,key:Gr(),path:s}}];case 5:return[2]}})},h.label=3;case 3:h.trys.push([3,8,9,10]),i=c(F),l=i.next(),h.label=4;case 4:return l.done?[3,7]:(u=l.value,[5,o(u)]);case 5:if("object"==typeof(s=h.sent()))return[2,s.value];h.label=6;case 6:return l=i.next(),[3,4];case 7:return[3,10];case 8:return d=h.sent(),f={error:d},[3,10];case 9:try{l&&!l.done&&(p=i.return)&&p.call(i)}finally{if(f)throw f.error}return[7];case 10:return[2,{element:v,key:Gr(),path:r}]}})})}},[V]);return B?f.createElement(Bg,{className:i,style:l,state:U,Loader:s,Error:E,animation:x,payload:V,fallback:N,onLoadStart:M,onLoadEnd:R,throwError:O},function(e){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,qn(0)];case 1:return t.sent(),Xg.next(e),[2,L(e)]}})})}):f.createElement(s,null)};Gg.listen=function(e){return Xg.subscribe(e)},Gg.waitForNavigate=function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,Xg.toPromise()];case 1:return[2,e.sent()]}})})};var Kg,Qg,Jg,Zg,eb,tb,nb=An()({root:{display:"flex",alignItems:"center",justifyContent:"center"}}),rb=function(e){var t=e.className,n=l(e,["className"]),r=nb().classes;return f.createElement(j,a({className:Eo(t,r.root)},n))},ob=An()({root:{display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden",width:"100%"},container:{position:"relative",paddingBottom:"100%",width:"100%",height:0},content:{position:"absolute",height:"100%",width:"100%",display:"flex",alignItems:"stretch",justifyContent:"stretch",top:0,left:0,right:0,bottom:0,"& > *:nth-of-type(1)":{flex:1}}}),ib=x(function(e,t){var n=e.className,r=e.children,o=l(e,["className","children"]),i=ob().classes;return f.createElement(j,a({ref:t,className:Eo(n,i.root)},o),f.createElement("div",{className:i.container},f.createElement("div",{className:i.content},r)))}),ab=function(t){var n=t,r=function(t,o){void 0===o&&(o=function(e){return n=e}),"object"==typeof t&&null!==t&&(Array.isArray(t)?(t.forEach(function(e,n){return r(e,function(e){return t[n]=e})}),o(a({},t))):Object.entries(t).forEach(function(n){var o=e(n,2),i=o[0],a=o[1];return r(a,function(e){return t[i]=e})}))};return r(t),n},lb=/^\d+$/,cb=function(t,n){void 0===n&&(n=!1);var r=t,o=function(t,i){if(void 0===i&&(i=function(e){return r=e}),"object"==typeof t&&null!==t)if(function(e){return Object.keys(e).find(function(e){return lb.test(e)})}(t)||n){var a=Object.values(t);a.forEach(function(e,t){return o(e,function(e){return a[t]=e})}),i(a)}else Object.entries(t).forEach(function(n){var r=e(n,2),i=r[0],a=r[1];return o(a,function(e){return t[i]=e})})};return o(t),r},ub=function(t){var n=void 0===t?{}:t,r=n.readOnly,o=n.onFocus,i=n.onTouchStart,a=n.onContextMenu,l=e(g(!0),2),c=l[0],u=l[1];return{readOnly:r||c,onFocus:y(function(e){u(!1),o&&o(e)},[o]),onTouchStart:y(function(e){u(!1),i&&i(e)},[o]),onContextMenu:y(function(e){e.preventDefault(),e.stopPropagation(),a&&a(e)},[o])}},sb=(Kg=e(Er(),2))[0],db=Kg[1],fb=(Qg=e(Er(),2))[0],mb=Qg[1],pb=(Jg=e(Er(),2))[0],hb=Jg[1],vb=(Zg=e(Er(),2))[0],gb=Zg[1],bb=An()(function(e){return{selected:{color:"".concat(e.palette.primary.main," !important"),"& .MuiListItemIcon-root":{color:"".concat(e.palette.primary.main," !important")}},disabled:{pointerEvents:"none",opacity:.5},bold:{fontWeight:"bold"},root:{display:"flex",width:"100%",flex:1,"& .MuiListItemIcon-root":{maxWidth:"36px !important",minWidth:"36px !important"}},navLink:{color:e.palette.text.primary,"& .MuiListItemIcon-root":{color:e.palette.text.primary}}}}),yb=function(e){var t,n=e.option,r=e.style,o=e.icon,i=e.selected,a=e.className,l=e.onClick,c=e.currentPadding,u=bb().classes,s=Eo(u.navLink,((t={})[u.selected]=n.name&&n.name===i,t[u.disabled]=n.disabled,t[u.bold]=n.bold,t)),d=o||$t;return f.createElement(qt,{className:Eo(u.root,s,a),style:r},f.createElement(j,{style:{paddingLeft:c}}),f.createElement(tt,{onClick:function(){l(n.name||"unknown")}},f.createElement(F,{style:{maxWidth:24}},f.createElement(d,null)),f.createElement(Oe,{primary:n.label})))},wb=function(t){var n=t.paddingLeft,r=void 0===n?-12:n,o=t.selected,i=t.options,a=t.onClick,l=function(t){var n=t.item,r=t.currentPadding,i=gb(),l=e(g(n.lifted||!1),2),c=l[0],u=l[1];w(function(){u(!!i||(n.lifted||!1))},[i]);var s=c?function(){return f.createElement(it,null)}:function(){return f.createElement(jt,null)};return f.createElement(f.Fragment,null,f.createElement(yb,{key:n.name,option:n,selected:o,onClick:function(){u(function(e){return!e})},icon:n.icon||s,currentPadding:r}),c&&f.createElement(wb,{options:n.options,selected:o,paddingLeft:r,onClick:a}))},c=i.map(function(e,t){var n=r+12;return e.options&&e.options.length?f.createElement(l,{key:t,item:e,currentPadding:n}):f.createElement(yb,{key:t,option:e,icon:e.icon,selected:o,onClick:a,currentPadding:n})});return-12===r?f.createElement(Ie,{disablePadding:!0},c):f.createElement(f.Fragment,null,c)},Eb=An()(function(e){return{root:{display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column",minHeight:"100vh",maxHeight:"100vh",minWidth:"100vw",maxWidth:"100vw"},container:{flex:1},title:{flexGrow:1},appBarSolidPaper:{background:"".concat(e.palette.background.paper," !important"),color:"".concat(e.palette.getContrastText(e.palette.background.paper)," !important")},drawer:{width:256,"& > .MuiPaper-root":{width:256,overflowX:"hidden"}},loaderBar:{marginTop:-4},offsetRegular:{minHeight:64},offsetDense:{minHeight:48},searchBox:{display:"inline-flex",margin:5,"& > *":{flex:1}},beforeSearch:{width:"calc(100% - 10px)",margin:"5px",marginBottom:"0px",display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *":{flex:1}},afterSearch:{width:"calc(100% - 10px)",margin:"5px",marginTop:"0px",display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *":{flex:1}}}}),xb=function(t){for(var n,r=[],o=function(){var o=e(t),i=o[0],a=o.slice(1);null===(n=i.options)||void 0===n||n.forEach(function(e){return a.push(e)}),r.push(i),t=a};t.length;)o();return r},Cb=function(e,t){var n;return e.options=null===(n=e.options)||void 0===n?void 0:n.filter(function(e){var n;return(null===(n=e.options)||void 0===n?void 0:n.length)&&!1!==e.visible?(Cb(e,t),xb(e.options).some(function(e){return t.has(e)})):!!t.has(e)})},kb=function(t){var n,r,o=t.children,i=t.className,c=t.style,u=t.selected,s=t.title,d=void 0===s?"Scaffold":s,m=t.options,p=void 0===m?[]:m,v=t.dense,b=void 0!==v&&v,y=t.colored,w=void 0===y||y,E=t.actions,x=t.payload,C=t.roles,k=t.onOptionClick,S=t.onAction,L=void 0===S?function(){return null}:S,N=t.BeforeSearch,I=t.AfterSearch,M=t.AfterMenuContent,R=t.BeforeMenuContent,P=ub(),A=db(),T=mb(),D=hb(),O=e(g(!1),2),F=O[0],B=O[1],H=Eb().classes,W=e(g(""),2),z=W[0],V=W[1],Y=h(function(){var e,t=new Set,n=(e=cb(Bn(ab(p))),Array.isArray(e)?e:[]),r=z.toLowerCase();(function(e,t){var n=t.keyword,r=t.currentRoles;return e.filter(function(e){return e.label.toLowerCase().includes(n)}).filter(function(e){var t=e.roles;return!r||(void 0===t?[]:t).some(function(e){return r.includes(e)})}).filter(function(e){var t=e.visible;return void 0===t||t})})(xb(n),{keyword:r,currentRoles:C}).forEach(function(e){return t.add(e)});var o={options:n};return Cb(o,t),o.options},[z,C]),U=to(L);return A?f.createElement(f.Fragment,null,o):f.createElement(vb,{payload:!!z},f.createElement(j,{className:Eo(i,H.root),style:c},f.createElement(Vt,null),f.createElement(Yt,{className:H.drawer,open:F,onClose:function(){return B(!1)}},N&&f.createElement(j,{className:H.beforeSearch},f.createElement(N,null)),f.createElement(j,{className:H.searchBox},f.createElement(xe,a({variant:"standard",onChange:function(e){var t=e.target;return V(t.value.toString())},value:z,placeholder:"Search",InputProps:{autoComplete:"off",endAdornment:f.createElement(Le,{position:"end"},f.createElement("div",{style:{marginRight:-10}},f.createElement(Ne,{onClick:function(){return V("")}},z?f.createElement(Fe,null):f.createElement(ot,null))))},name:"search",type:"text"},P))),I&&f.createElement(j,{className:H.afterSearch},f.createElement(I,null)),f.createElement(wb,{selected:u,onClick:function(e){B(!1),k&&k(e)},options:Y})),f.createElement(zt,{className:Eo((n={},n[H.appBarSolidPaper]=!w,n)),position:"fixed"},f.createElement($e,{disableGutters:!0,variant:b?"dense":"regular"},f.createElement(Ne,{color:"inherit",onClick:function(){return B(!F)}},f.createElement(Ut,null)),f.createElement(_,{variant:"h6",className:H.title},d),!!(null==E?void 0:E.length)&&f.createElement(xa,{transparent:!0,sx:{color:"inherit"},payload:x,options:E.map(function(e){var t=e.isVisible,n=void 0===t?function(){return!0}:t,r=e.isDisabled,o=void 0===r?function(){return!1}:r,i=l(e,["isVisible","isDisabled"]);return a(a({},i),{isVisible:function(){return n(x)},isDisabled:function(){return o(x)}})}),onAction:U,AfterContent:M,BeforeContent:R})),T&&f.createElement(j,{className:H.loaderBar},f.createElement(De,{variant:-1===D?"indeterminate":"determinate",value:-1===D?void 0:D,color:"primary"}))),f.createElement("div",{className:Eo((r={},r[H.offsetRegular]=!b,r[H.offsetDense]=b,r))}),f.createElement(nm,{className:H.container},f.createElement(j,{p:1},o))))},Sb=An()(function(e){return{root:{position:"fixed",top:0,left:0,right:0,bottom:0,height:"100vh",width:"100vw",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999,background:e.palette.background.paper}}}),Lb=function(){var e=Sb().classes;return f.createElement(j,{className:e.root},f.createElement(O,null))},Nb=function(t){void 0===t&&(t=[]);var n=[],o=function(t){return void 0===t&&(t=[]),t.forEach(function(t){var i=t.options||[];o(r([],e(i),!1)),n.push(t)})};return o(t),n},Ib=function(e){var r=e.roles,o=e.payload,i=e.throwError,c=e.fallback,u=e.options,s=e.loadingLine,d=void 0!==s&&s,m=e.loading,p=void 0===m?-1:m,v=e.Loader,g=void 0===v?Lb:v,b=e.withPassthrough,y=void 0!==b&&b,w=e.onInit,E=void 0===w?function(){}:w,x=l(e,["roles","payload","throwError","fallback","options","loadingLine","loading","Loader","withPassthrough","onInit"]),C=h(function(){return function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return"function"!=typeof r?[3,2]:[4,r(o)];case 1:return[2,e.sent()];case 2:return[2,r]}})})}},[r,o]),k=h(function(){return function(){return t(void 0,void 0,void 0,function(){var e;return n(this,function(r){switch(r.label){case 0:return e=cb(Bn(ab(u))),[4,Promise.all(Nb(e).map(function(e){return t(void 0,void 0,void 0,function(){var t,r,i,a,l,c,u,s,d,f,m,p;return n(this,function(n){switch(n.label){case 0:return t=e.disabled,r=void 0===t?e.isDisabled:t,i=e.visible,a=void 0===i?e.isVisible:i,l=e.bold,c=void 0===l?e.isBold:l,u=e.roles,s=void 0===u?e.getRoles:u,"function"!=typeof c?[3,2]:(d=e,[4,c(o)]);case 1:d.bold=n.sent(),n.label=2;case 2:return"function"!=typeof a?[3,4]:(f=e,[4,a(o)]);case 3:f.visible=n.sent(),n.label=4;case 4:return"function"!=typeof r?[3,6]:(m=e,[4,r(o)]);case 5:m.disabled=n.sent(),n.label=6;case 6:return"function"!=typeof s?[3,8]:(p=e,[4,s(o)]);case 7:p.roles=n.sent(),n.label=8;case 8:return[2]}})})}))];case 1:return r.sent(),[2,e]}})})}},[u,o]);return f.createElement(pb,{payload:p},f.createElement(fb,{payload:d},f.createElement(sb,{payload:y},f.createElement(Jr,{throwError:i,fallback:c,payload:o,Loader:g},function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:return[4,E()];case 1:return n.sent(),[4,C()];case 2:return e=n.sent(),[4,k()];case 3:return t=n.sent(),[2,f.createElement(kb,a({},x,{roles:e,options:t,payload:o}))]}})})}))))},Mb=function(e){var t=e.children,n=re(),r=h(function(){var e=R(n);return e.components=a(a({},e.components),{MuiTabs:{styleOverrides:{root:{marginLeft:e.spacing(1)},indicator:{height:3,background:"dark"===e.palette.mode?e.palette.primary.main:e.palette.background.default}}}}),e},[n]);return f.createElement(P,{theme:r},t)},Rb=p(null),Pb=function(e){var t=e.value,n=e.children;return f.createElement(Rb.Provider,{value:t},n)},Ab=function(){return v(Rb)},Tb=function(){return h(function(){return{isAppleMobile:/iPad|iPhone|iPod/.test(window.navigator.userAgent)}},[])},Db=function(t){var n=e(t.split("_")),o=n[0],i=n.slice(1);return r(["".concat(o.charAt(0).toUpperCase()).concat(o.slice(1))],e(i),!1).join(" ")},jb=(eb=e(hl(),2))[0],Ob=eb[1],Fb=256,_b=function(t){var n=t.className,r=t.style,o=t.sx,i=t.option,l=t.onClick,c=t.activeOptionPath,u=t.currentPadding,s=e(Ob(),2)[1],d=Ab().noOptionHover,m=i.icon||$t;return f.createElement(tt,{className:n,onMouseEnter:function(){return!d&&s(i.path)},onMouseLeave:function(){return!d&&s("")},style:r,sx:o,disablePadding:!0},f.createElement(Me,{disabled:i.disabled,selected:i.path===c,onClick:function(){return l(i.path,i.id)},sx:a({overfloxX:"hidden",maxWidth:Fb,py:"2px",px:3},o)},f.createElement(j,{style:{paddingLeft:u}}),!!m&&f.createElement(F,null,f.createElement(m,null)),f.createElement(Oe,null,i.label||Db(i.id))))},Bb=function(e){var t=[],n=function(e,r){return void 0===r&&(r="root"),e.forEach(function(e){var o="".concat(r,".").concat(e.id);Array.isArray(e.children)?(e.path=o,t.push(e),n(e.children,o)):Array.isArray(e.options)?(e.path=o,t.push(e),n(e.options,o)):(e.path=o,t.push(e))})};return n(e),t},Hb=p(null),Wb=function(e){var t=e.children,n=e.value;return f.createElement(Hb.Provider,{value:n},t)},zb=function(){return v(Hb)},Vb=function(t){var n=t.option,r=t.currentPadding,o=t.disabled,i=t.activeOptionPath,l=t.onClick,c=t.onGroupClick,u=!!zb().searchText,s=e(Ob(),1)[0],d=h(function(){return""!==s&&(s===n.path||s.startsWith(n.path))},[s]),m=to(function(){return n.lifted||i.includes(n.path)}),p=e(g(m()),2),v=p[0],b=p[1],y=Ab().onOptionGroupClick;w(function(){b(!!u||m())},[u,i]);var E=v?function(){return f.createElement(jt,null)}:function(){return f.createElement(it,null)};return n.visible?f.createElement(f.Fragment,null,f.createElement(_b,{key:n.id,sx:n.sx,option:a(a({},n),{disabled:n.disabled||o,icon:n.icon||E}),activeOptionPath:i,onClick:function(){b(function(e){return y&&n.path!==i||!e}),c(n.path,n.id)},currentPadding:r}),(v||n.pin||d)&&f.createElement(Yb,{option:n.options,paddingLeft:r,activeOptionPath:i,disabled:o,onClick:l,onGroupClick:c})):null},Yb=function(e){var t=e.paddingLeft,n=void 0===t?-12:t,r=e.option,o=e.disabled,i=void 0!==o&&o,l=e.activeOptionPath,c=e.onClick,u=e.onGroupClick,s=h(function(){return Array.isArray(r)?r:[r]},[r]).filter(function(e){return e.visible}).sort(function(e,t){var n=e.pin,r=void 0!==n&&n,o=t.pin;return Number(void 0!==o&&o)-Number(r)}).map(function(e,t){var r,o=n+12;return(null===(r=e.options)||void 0===r?void 0:r.length)?f.createElement(Vb,{key:"".concat(e.id,"-").concat(t),option:e,activeOptionPath:l,disabled:i,onGroupClick:u,onClick:c,currentPadding:o}):e.visible?f.createElement(_b,{key:"".concat(e.id,"-").concat(t),sx:e.sx,option:a(a({},e),{disabled:i||e.disabled}),activeOptionPath:l,onClick:c,currentPadding:o}):null});return f.createElement(f.Fragment,null,s)},Ub=function(e){var t=e.className,n=e.style,r=e.sx,o=zb(),i=o.searchText,l=o.setSearchText,c=ub();return f.createElement(Gt,a({className:t,style:n,sx:a({height:"100%"},r),fullWidth:!0,onChange:function(e){var t=e.target;return l(t.value.toString())},value:i,placeholder:"Search",autoComplete:"off",endAdornment:i?f.createElement(Le,{position:"end"},f.createElement("div",{style:{marginRight:-10}},f.createElement(Ne,{onClick:function(){return l("")}},f.createElement(Fe,null)))):void 0,name:"search",type:"text"},c))},qb={boxShadow:function(e){var t=$(e.palette.background.default,.1);return"0 -1px 0 ".concat(t," inset")},py:1.5,px:3},$b=function(e){var t=e.sx,n=e.options,r=e.appName,o=e.noAppName,i=e.noSearch,c=e.payload,u=e.activeOptionPath,s=e.BeforeSearch,d=e.AfterSearch,m=e.BeforeContent,p=e.AfterContent,h=e.onOptionClick,v=void 0===h?function(){}:h,g=e.onOptionGroupClick,b=void 0===g?function(){}:g,y=l(e,["sx","options","appName","noAppName","noSearch","payload","activeOptionPath","BeforeSearch","AfterSearch","BeforeContent","AfterContent","onOptionClick","onOptionGroupClick"]),w=Tb().isAppleMobile,E=Ab(),x=E.disableBackdropTransition,C=void 0===x||x,k=E.disableDiscovery,S=void 0===k?w:k,L=E.disableSwipeToOpen,N=void 0===L?w:L,I=E.swipeAreaWidth,M=void 0===I?20:I;return f.createElement(Xt,a({variant:"permanent",disableBackdropTransition:C,disableSwipeToOpen:N,disableDiscovery:S,swipeAreaWidth:M,sx:a(a({},t),{display:"flex",alignItems:"stretch",justifyContent:"stretch"})},y),f.createElement(ke,{className:"react-declarative__scaffold2Background",sx:{flex:1,display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column"}},m&&f.createElement(m,null),f.createElement(Ie,{sx:{flex:1},disablePadding:!0},!o&&f.createElement(tt,{sx:a(a({},qb),{py:2,fontSize:22,background:"transparent"})},r),s&&f.createElement(tt,{sx:{background:"transparent",boxShadow:function(e){var t=$(e.palette.background.default,.1);return"0 -1px 0 ".concat(t," inset")}}},f.createElement(s,{payload:c})),!i&&f.createElement(tt,{sx:qb},f.createElement(F,null,f.createElement(ot,null)),f.createElement(Oe,null,f.createElement(Ub,null))),d&&f.createElement(tt,{sx:{background:"transparent",boxShadow:function(e){var t=$(e.palette.background.default,.1);return"0 -1px 0 ".concat(t," inset")}}},f.createElement(d,{payload:c})),!n.some(function(e){return e.visible})&&f.createElement(tt,{disablePadding:!0,sx:{py:2,px:3}},f.createElement(Oe,null,"Nothing found")),n.filter(function(e){return e.visible}).map(function(e,t,n){var r=e.id,o=e.path,i=e.label,l=e.disabled,c=e.noHeader,s=void 0!==c&&c,d=e.icon,m=e.children;return f.createElement(j,{key:r,sx:a({background:"transparent"},s&&{pt:0===t?0:2})},!s&&f.createElement(tt,{sx:{background:function(e){return"dark"===e.palette.mode?$(e.palette.primary.main,.023):void 0},py:2,px:3}},f.createElement(Me,{onClick:function(){return b(o,r)},disabled:l,sx:{pointerEvents:"none"},disableTouchRipple:!0,disableRipple:!0,disableGutters:!0},!!d&&f.createElement(F,null,f.createElement(d,null)),f.createElement(Oe,null,i||Db(r)))),m.filter(function(e){return e.visible}).sort(function(e,t){var n=e.pin,r=void 0!==n&&n,o=t.pin;return Number(void 0!==o&&o)-Number(r)}).map(function(e,t){return f.createElement(Yb,{key:"".concat(e.id,"-").concat(t),activeOptionPath:u,option:e,onClick:v,onGroupClick:b})}),t!==n.length-1&&f.createElement(H,{sx:{mt:2,opacity:.23}}))})),p&&f.createElement(p,null)))},Xb=An()({tabsRoot:{minHeight:48,height:48},tabRoot:{minHeight:48,height:48}}),Gb=function(e){var t=e.className,n=e.style,r=e.sx,o=e.payload,i=e.loading,c=e.options,u=e.isMobile,s=e.appName,d=e.activeOptionPath,m=e.activeTabPath,p=e.onDrawerToggle,v=e.onAction,g=e.onTabChange,b=e.BeforeMenuContent,w=e.AfterMenuContent,E=e.actions,x=void 0===E?[]:E,C=l(e,["className","style","sx","payload","loading","options","isMobile","appName","activeOptionPath","activeTabPath","onDrawerToggle","onAction","onTabChange","BeforeMenuContent","AfterMenuContent","actions"]),k=Ab(),S=k.dense,L=void 0!==S&&S,N=k.fixedHeader,I=void 0!==N&&N,M=k.BeforeActionMenu,R=k.AfterAppName,P=tl().isPhone,A=Xb().classes,T=h(function(){var e=Bb(c).find(function(e){var t=e.path;return d===t})||{},t=e.id,n=void 0===t?"unknown":t,r=e.path,o=void 0===r?"unknown":r,i=e.label,a=void 0===i?Db(n):i,l=e.tabs;return{id:n,path:o,label:"unknown"===n?s:a,tabs:void 0===l?[]:l}},[d,c,s]),D=T.id,O=T.path,F=T.label,B=T.tabs,H=h(function(){var e=B.find(function(e){return e.active});return e?e.path:m},[B,m]),W=h(function(){return!!B.filter(function(e){return e.visible}).length},[B]),z=y(function(e,t){g&&g(e,t,D)},[O,D]);return f.createElement(f.Fragment,null,f.createElement(we,a({className:t,style:n,sx:a(a(a({width:"100%",zIndex:999},I&&{position:"fixed",top:0,left:u?0:"256px",width:u?"100%":"calc(100% - 256px)"}),!I&&{position:"sticky",top:0,left:0,right:0}),r),alignItems:"stretch",justifyContent:"stretch"},C),f.createElement(zt,{component:"div",color:"primary",position:"static",elevation:0,sx:{zIndex:0,pb:!W||u||L?0:2}},f.createElement($e,{variant:L?"dense":"regular"},f.createElement(U,{container:!0,alignItems:"center",wrap:"nowrap",spacing:1},f.createElement(U,{sx:{display:L?void 0:{sm:"none",xs:"block"}},item:!0},f.createElement(Ne,{sx:{pointerEvents:u?"inherit":"none"},color:"inherit","aria-label":"open drawer",onClick:p,edge:"start"},f.createElement(Ut,null))),f.createElement(U,{item:!0},L?f.createElement(f.Fragment,null,!W&&f.createElement(_,{display:P?"none":void 0,whiteSpace:"nowrap",color:"inherit",variant:"h5",component:"h1"},F||s),W&&f.createElement(lt,{variant:"scrollable",value:H,textColor:"inherit",indicatorColor:"secondary",classes:{root:A.tabsRoot}},B.filter(function(e){return e.visible}).map(function(e,t){var n=e.id,r=e.label,o=e.icon,i=e.disabled,a=e.path;return f.createElement(at,{sx:{minWidth:128,fontWeight:"bold"},key:"".concat(n,"-").concat(t),value:a,label:r||Db(n),onClick:function(){return z(a,n)},disabled:i,icon:o&&f.createElement(o,null),iconPosition:"start",classes:{root:A.tabRoot}})}))):f.createElement(_,{display:P?"none":void 0,whiteSpace:"nowrap",color:"inherit",variant:"h5",component:"h1"},F||s)),!!R&&f.createElement(U,{item:!0},f.createElement(R,{payload:o})),f.createElement(U,{item:!0,xs:!0}),!!M&&f.createElement(U,{item:!0},f.createElement(M,{payload:o})),!!(null==x?void 0:x.length)&&f.createElement(U,{item:!0},f.createElement(xa,{transparent:!0,sx:{color:"unset !important",mr:-2},BeforeContent:b,AfterContent:w,options:x.map(function(e){var t=e.isVisible,n=void 0===t?function(){return!0}:t,r=e.isDisabled,i=void 0===r?function(){return!1}:r,c=l(e,["isVisible","isDisabled"]);return a(a({},c),{isVisible:function(){return n(o)},isDisabled:function(){return i(o)}})}),onAction:v,payload:o}))))),W&&!L&&f.createElement(zt,{component:"div",position:"static",elevation:0,sx:{zIndex:0}},f.createElement(lt,{variant:"scrollable",value:H,textColor:"inherit",indicatorColor:"secondary",classes:{root:A.tabsRoot}},B.filter(function(e){return e.visible}).map(function(e,t){var n=e.id,r=e.label,o=e.icon,i=e.disabled,a=e.path;return f.createElement(at,{sx:{minWidth:"128px"},key:"".concat(n,"-").concat(t),value:a,label:r||Db(n),onClick:function(){return z(a,n)},disabled:i,icon:o&&f.createElement(o,null),iconPosition:"start",classes:{root:A.tabRoot}})}))),!!i&&f.createElement(j,{sx:{marginTop:"-4px"}},f.createElement(De,{variant:i>1?"determinate":"indeterminate",value:i>1?Number(i):void 0,color:"primary"}))),!!I&&f.createElement(j,{sx:a(a({},L&&{paddingBottom:"48px"}),!L&&a({},a({},u?W?{paddingBottom:"106px"}:{paddingBottom:"56px"}:W?{paddingBottom:"128px"}:{paddingBottom:"64px"})))}))},Kb=function(t){var n=t.className,r=t.style,o=t.sx,i=t.options,l=t.activeOptionPath,c=t.activeTabPath,u=void 0===c?l:c,s=t.actions,d=t.payload,m=t.loading,p=t.appName,h=t.noAppName,v=t.noSearch,b=t.BeforeSearch,y=t.AfterSearch,w=t.BeforeMenuContent,E=t.AfterMenuContent,x=t.Copyright,C=t.BeforeContent,k=t.AfterContent,S=t.onOptionGroupClick,L=t.onOptionClick,N=t.onTabChange,I=void 0===N?L:N,M=t.onAction,R=t.children,P=Ab(),A=P.dense,T=P.noContent,D=e(g(!1),2),O=D[0],F=D[1],_=re(),B=K(_.breakpoints.between("xs","sm")),H=function(){F(function(e){return!e})},W=function(e,t){if(S){var n=S(e,t);F(!!B&&!!n)}else F(!1)},z=function(e,t){if(L){var n=L(e,t);F(!!B&&!!n)}else F(!1)};return f.createElement(Mb,null,f.createElement(j,{className:n,style:r,sx:a({position:"relative",display:"flex",minHeight:"100vh"},o)},f.createElement(Vt,null),f.createElement(j,{component:"nav",sx:{width:A?void 0:{sm:Fb},flexShrink:{sm:0}}},B&&f.createElement($b,{PaperProps:{style:{width:Fb}},activeOptionPath:l,options:i,payload:d,appName:p,noAppName:h,noSearch:v,variant:"temporary",open:O,BeforeSearch:b,AfterSearch:y,BeforeContent:C,AfterContent:k,onClose:H,onOptionGroupClick:W,onOptionClick:z,onOpen:function(){return F(!0)}}),!B&&f.createElement($b,{open:!0,disableSwipeToOpen:!0,disableDiscovery:!0,PaperProps:{style:{width:Fb}},sx:{display:{sm:"block",xs:"none"},width:Fb},activeOptionPath:l,payload:d,options:i,appName:p,noAppName:h,noSearch:v,BeforeSearch:b,AfterSearch:y,BeforeContent:C,AfterContent:k,onOptionGroupClick:W,onOptionClick:z,onOpen:function(){},onClose:function(){}})),f.createElement(j,{sx:{flex:1,display:"flex",flexDirection:"column"}},f.createElement(Gb,{payload:d,options:i,actions:s,loading:m,appName:p,isMobile:B,BeforeMenuContent:w,AfterMenuContent:E,activeOptionPath:l,activeTabPath:u,onDrawerToggle:H,onTabChange:I,onAction:M}),f.createElement(j,{component:"main",sx:{flex:1,p:1}},R),!!x&&f.createElement(j,{component:"footer",sx:{p:2}},f.createElement(x,null))),!!T&&f.createElement(j,{sx:{position:"absolute",height:"100vh",width:"100vw",top:0,left:0,zIndex:9999,background:function(e){return e.palette.background.default}}})))},Qb=function(o){var i=o.children,c=o.appName,u=void 0===c?"Scaffold2":c,s=o.noSearch,d=void 0!==s&&s,m=o.noAppName,p=void 0!==m&&m,v=o.onInit,x=o.onLoadStart,C=o.onLoadEnd,k=o.fallback,S=o.options,L=o.payload,N=o.deps,I=void 0===N?[]:N,M=o.throwError,R=l(o,["children","appName","noSearch","noAppName","onInit","onLoadStart","onLoadEnd","fallback","options","payload","deps","throwError"]),P=function(o){var i=o.onLoadStart,a=o.onLoadEnd,l=o.onInit,c=void 0===l?function(){}:l,u=o.fallback,s=o.options,d=o.payload,f=o.deps,m=o.throwError,p=void 0!==m&&m,v=e(g(0),2),w=v[0],x=v[1],C=e(g([]),2),k=C[0],S=C[1],L=e(g(""),2),N=L[0],I=L[1],M=b(!0);E(function(){return function(){M.current=!1}},[]);var R=y(function(e){return t(void 0,void 0,void 0,function(){var r,o,l,c;return n(this,function(d){switch(d.label){case 0:r=cb(Bn(ab(s))),o=Bb(r),l=!0,d.label=1;case 1:return d.trys.push([1,3,4,5]),i&&i(),M.current&&x(function(e){return e+1}),[4,Promise.all(o.map(function(r){return t(void 0,void 0,void 0,function(){var o,i,a;return n(this,function(l){switch(l.label){case 0:return r.isVisible?(o=r,[4,r.isVisible(e)]):[3,2];case 1:return o.visible=l.sent(),[3,3];case 2:r.visible=!0,l.label=3;case 3:return r.isDisabled?(i=r,[4,r.isDisabled(e)]):[3,5];case 4:return i.disabled=l.sent(),[3,6];case 5:r.disabled=!1,l.label=6;case 6:return r.tabs?(a=r,[4,Promise.all(r.tabs.map(function(o){return t(void 0,void 0,void 0,function(){var t,i,a;return n(this,function(n){switch(n.label){case 0:return o.isVisible?(t=o,[4,o.isVisible(e)]):[3,2];case 1:return t.visible=n.sent(),[3,3];case 2:o.visible=!0,n.label=3;case 3:return o.isDisabled?(i=o,[4,o.isDisabled(e)]):[3,5];case 4:return i.disabled=n.sent(),[3,6];case 5:o.disabled=!1,n.label=6;case 6:return o.isActive?(a=o,[4,o.isActive(e)]):[3,8];case 7:return a.active=n.sent(),[3,9];case 8:o.active=!1,n.label=9;case 9:return o.path="".concat(r.path,".").concat(o.id),[2,o]}})})}))]):[3,8];case 7:a.tabs=l.sent(),l.label=8;case 8:return[2]}})})}))];case 2:return d.sent(),S(r),[3,5];case 3:if(c=d.sent(),l=!1,p)throw c;return u&&u(c),[3,5];case 4:return a&&a(l),M.current&&x(function(e){return e-1}),[7];case 5:return[2]}})})},r([s,d],e(f),!1)),P=y(function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:e=!0,n.label=1;case 1:return n.trys.push([1,4,5,6]),i&&i(),M.current&&x(function(e){return e+1}),[4,c()];case 2:return n.sent(),[4,R(d)];case 3:return n.sent(),[3,6];case 4:if(t=n.sent(),e=!1,p)throw t;return u&&u(t),[3,6];case 5:return a&&a(e),M.current&&x(function(e){return e-1}),[7];case 6:return[2]}})})},[]);$r(function(){R(d)},r([d],e(f),!1));var A=h(function(){var e=cb(Bn(ab(k)));if(!N)return Object.values(e);var t=Bb(e),n=new Set(t.filter(function(e){var t=e.id,n=e.path,r=e.label,o=void 0===r?Db(t):r,i=N.toLowerCase(),a=!1;return(a=(a=a||o.toLowerCase().includes(i))||t.toLowerCase().includes(i))||n.toLowerCase().includes(i)}).flatMap(function(e){return function(e){for(var t=e,n=[e];t.includes(".");)t=t.slice(0,t.lastIndexOf(".")),n.push(t);return n}(e.path)}));return t.forEach(function(e){n.has(e.path)||(e.visible=!1)}),Object.values(e)},[k,N]);return{loading:!!w,searchText:N,setSearchText:I,filteredGroups:A,doInit:P}}({onInit:v,onLoadStart:x,onLoadEnd:C,fallback:k,options:S,payload:L,deps:I,throwError:M});return w(function(){P.doInit()},[]),f.createElement(Wb,{value:P},f.createElement(Pb,{value:o},f.createElement(jb,{initialState:""},f.createElement(Kb,a({appName:u,noSearch:d,noAppName:p,payload:L,options:P.filteredGroups},R),i))))},Jb=function(e){var t=e.children,n=re(),r=h(function(){var e=R(n);return e.components=a(a({},e.components),{MuiTabs:{styleOverrides:{root:{marginLeft:e.spacing(1)},indicator:{height:3,background:"dark"===e.palette.mode?e.palette.primary.main:e.palette.background.default}}}}),e},[n]);return f.createElement(P,{theme:r},t)},Zb=function(t){var n=e(t.split("_")),o=n[0],i=n.slice(1);return r(["".concat(o.charAt(0).toUpperCase()).concat(o.slice(1))],e(i),!1).join(" ")},ey=(tb=e(hl(),2))[0],ty=tb[1],ny=256,ry=48,oy=p(null),iy=function(e){var t=e.value,n=e.children;return f.createElement(oy.Provider,{value:t},n)},ay=function(){return v(oy)},ly=function(e){var t=e.icon,n=e.color,r=h(function(){if(n)return $(oe(n,.5),.42)},[n]);return n?m.createElement(te,{sx:{background:r,padding:"6px",marginTop:"6px",marginBottom:"6px",marginLeft:"-2px",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center"}},m.createElement(t,{sx:{color:n}})):m.createElement(t,{sx:{color:n}})},cy=function(t){var n=t.className,r=t.style,o=t.sx,i=t.option,l=t.onClick,c=t.activeOptionPath,u=t.currentPadding,s=e(ty(),2)[1],d=ay().noOptionHover,m=i.icon||$t;return f.createElement(tt,{className:n,onMouseEnter:function(){return!d&&s(i.path)},onMouseLeave:function(){return!d&&s("")},style:r,sx:o,disablePadding:!0},f.createElement(Me,{disabled:i.disabled,selected:i.path===c,onClick:function(){return l(i.path,i.id)},sx:a({overfloxX:"hidden",maxWidth:ny,py:"2px",px:3},o)},f.createElement(j,{style:{paddingLeft:u}}),!!m&&f.createElement(F,{sx:{"& *":{color:i.iconColor},color:i.iconColor}},f.createElement(ly,{icon:m,color:i.iconColor})),f.createElement(Oe,null,i.label||Zb(i.id))))},uy=function(e){var t=[],n=function(e,r){return void 0===r&&(r="root"),e.forEach(function(e){var o="".concat(r,".").concat(e.id);Array.isArray(e.children)?(e.path=o,t.push(e),n(e.children,o)):Array.isArray(e.options)?(e.path=o,t.push(e),n(e.options,o)):(e.path=o,t.push(e))})};return n(e),t},sy=p(null),dy=function(e){var t=e.children,n=e.value;return f.createElement(sy.Provider,{value:n},t)},fy=function(){return v(sy)},my=function(t){var n=t.option,r=t.currentPadding,o=t.disabled,i=t.activeOptionPath,l=t.onClick,c=t.onGroupClick,u=!!fy().searchText,s=e(ty(),1)[0],d=h(function(){return""!==s&&(s===n.path||s.startsWith(n.path))},[s]),m=to(function(){return n.lifted||i.includes(n.path)}),p=e(g(m()),2),v=p[0],b=p[1],y=ay().onOptionGroupClick;w(function(){b(!!u||m())},[u,i]);var E=v?function(){return f.createElement(jt,null)}:function(){return f.createElement(it,null)};return n.visible?f.createElement(f.Fragment,null,f.createElement(cy,{key:n.id,sx:n.sx,option:a(a({},n),{disabled:n.disabled||o,icon:n.icon||E}),activeOptionPath:i,onClick:function(){b(function(e){return y&&n.path!==i||!e}),c(n.path,n.id)},currentPadding:r}),(v||n.pin||d)&&f.createElement(py,{option:n.options,paddingLeft:r,activeOptionPath:i,disabled:o,onClick:l,onGroupClick:c})):null},py=function(e){var t=e.paddingLeft,n=void 0===t?-12:t,r=e.option,o=e.disabled,i=void 0!==o&&o,l=e.activeOptionPath,c=e.onClick,u=e.onGroupClick,s=h(function(){return Array.isArray(r)?r:[r]},[r]).filter(function(e){return e.visible}).sort(function(e,t){var n=e.pin,r=void 0!==n&&n,o=t.pin;return Number(void 0!==o&&o)-Number(r)}).map(function(e,t){var r,o=n+12;return(null===(r=e.options)||void 0===r?void 0:r.length)?f.createElement(my,{key:"".concat(e.id,"-").concat(t),option:e,activeOptionPath:l,disabled:i,onGroupClick:u,onClick:c,currentPadding:o}):e.visible?f.createElement(cy,{key:"".concat(e.id,"-").concat(t),sx:e.sx,option:a(a({},e),{disabled:i||e.disabled}),activeOptionPath:l,onClick:c,currentPadding:o}):null});return f.createElement(f.Fragment,null,s)},hy=function(e){var t=e.className,n=e.style,r=e.sx,o=fy(),i=o.searchText,l=o.setSearchText,c=ub();return f.createElement(Gt,a({className:t,style:n,sx:a({height:"100%"},r),fullWidth:!0,onChange:function(e){var t=e.target;return l(t.value.toString())},value:i,placeholder:"Search",autoComplete:"off",endAdornment:i?f.createElement(Le,{position:"end"},f.createElement("div",{style:{marginRight:-10}},f.createElement(Ne,{onClick:function(){return l("")}},f.createElement(Fe,null)))):void 0,name:"search",type:"text"},c))},vy={boxShadow:function(e){var t=$(e.palette.background.default,.1);return"0 -1px 0 ".concat(t," inset")},py:1.5,px:3},gy=function(e){var t=e.options,n=e.appName,r=e.noAppName,o=e.noSearch,i=e.payload,l=e.activeOptionPath,c=e.BeforeSearch,u=e.AfterSearch,s=e.BeforeContent,d=e.AfterContent,m=e.onOptionClick,p=void 0===m?function(){}:m,h=e.onOptionGroupClick,v=void 0===h?function(){}:h;return f.createElement(f.Fragment,null,s&&f.createElement(s,null),f.createElement(Ie,{sx:{flex:1},disablePadding:!0},!r&&f.createElement(tt,{sx:a(a({},vy),{py:2,fontSize:22,background:"transparent"})},n),c&&f.createElement(tt,{sx:{background:"transparent",boxShadow:function(e){var t=$(e.palette.background.default,.1);return"0 -1px 0 ".concat(t," inset")}}},f.createElement(c,{payload:i})),!o&&f.createElement(tt,{sx:vy},f.createElement(F,null,f.createElement(ot,null)),f.createElement(Oe,null,f.createElement(hy,null))),u&&f.createElement(tt,{sx:{background:"transparent",boxShadow:function(e){var t=$(e.palette.background.default,.1);return"0 -1px 0 ".concat(t," inset")}}},f.createElement(u,{payload:i})),!t.some(function(e){return e.visible})&&f.createElement(tt,{disablePadding:!0,sx:{py:2,px:3}},f.createElement(Oe,null,"Nothing found")),t.filter(function(e){return e.visible}).map(function(e,t,n){var r=e.id,o=e.path,i=e.label,c=e.disabled,u=e.noHeader,s=void 0!==u&&u,d=e.icon,m=e.iconColor,h=e.children;return f.createElement(j,{key:r,sx:a({background:"transparent"},s&&{pt:0===t?0:2})},!s&&f.createElement(tt,{sx:{background:function(e){return"dark"===e.palette.mode?$(e.palette.primary.main,.023):void 0},py:2,px:3}},f.createElement(Me,{onClick:function(){return v(o,r)},disabled:c,sx:{pointerEvents:"none"},disableTouchRipple:!0,disableRipple:!0,disableGutters:!0},!!d&&f.createElement(F,{sx:{"& *":{color:m},color:m}},f.createElement(ly,{icon:d,color:m})),f.createElement(Oe,null,i||Zb(r)))),h.filter(function(e){return e.visible}).sort(function(e,t){var n=e.pin,r=void 0!==n&&n,o=t.pin;return Number(void 0!==o&&o)-Number(r)}).map(function(e,t){return f.createElement(py,{key:"".concat(e.id,"-").concat(t),activeOptionPath:l,option:e,onClick:p,onGroupClick:v})}),t!==n.length-1&&f.createElement(H,{sx:{mt:2,opacity:.23}}))})),d&&f.createElement(d,null))},by=An()({hidden:{visibility:"hidden"}}),yy=function(t){var n=t.swiping,r=t.options,o=t.onOptionClick,i=void 0===o?function(){}:o,a=t.onOptionGroupClick,l=void 0===a?function(){}:a,c=by(),u=c.classes,s=c.cx,d=e(g(!1),2),m=d[0],p=d[1],v=h(function(){return Jn(function(){p(!1)},500)},[]),b=y(function(){v.clear()},[]),w=y(function(){v.clear(),p(!0)},[]);return f.createElement(j,{sx:{position:"relative",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"},overflowX:"hidden",overflowY:"auto",maxWidth:ry,minWidth:ry,height:"100vh"}},f.createElement(j,{sx:{position:"absolute",top:0,left:0,right:0,width:"100%",display:"flex",alignItems:"center",justifyContent:"flex-start",flexDirection:"column",gap:2,pt:2}},r.flatMap(function(e){return e.children}).filter(function(e){return e.visible}).map(function(e,t){var r,o=e.icon,a=void 0===o?$t:o,c=e.iconColor,d=e.disabled,p=e.id,h=e.path,g=e.label,y=e.options;return f.createElement(Nt,{arrow:!0,open:m,hidden:n,classes:{tooltip:s((r={},r[u.hidden]=n,r))},onMouseMove:b,onOpen:w,onClose:v,placement:"right",key:"".concat(p,"-").concat(t),title:g||p,PopperProps:{style:{zIndex:1e3}},enterTouchDelay:0},f.createElement(Te,{disabled:d,color:"primary",size:"small",sx:{"& *":{color:"white"},color:"white",background:c},onClick:function(){(null==y?void 0:y.some(function(e){return e.visible}))?l(h,p):i(h,p)}},f.createElement(a,null)))})))},wy=An()({tabsRoot:{minHeight:48,height:48},tabRoot:{minHeight:48,height:48}}),Ey=function(e){var t=e.className,n=e.style,r=e.sx,o=e.payload,i=e.loading,c=e.options,u=e.isMobile,s=e.appName,d=e.activeOptionPath,m=e.activeTabPath,p=e.onDrawerToggle,v=e.onAction,g=e.onTabChange,b=e.BeforeMenuContent,w=e.AfterMenuContent,E=e.actions,x=void 0===E?[]:E,C=l(e,["className","style","sx","payload","loading","options","isMobile","appName","activeOptionPath","activeTabPath","onDrawerToggle","onAction","onTabChange","BeforeMenuContent","AfterMenuContent","actions"]),k=ay(),S=k.dense,L=void 0!==S&&S,N=k.fixedHeader,I=void 0!==N&&N,M=k.BeforeActionMenu,R=k.AfterAppName,P=tl().isPhone,A=wy().classes,T=h(function(){var e=uy(c).find(function(e){var t=e.path;return d===t})||{},t=e.id,n=void 0===t?"unknown":t,r=e.path,o=void 0===r?"unknown":r,i=e.label,a=void 0===i?Zb(n):i,l=e.tabs;return{id:n,path:o,label:"unknown"===n?s:a,tabs:void 0===l?[]:l}},[d,c,s]),D=T.id,O=T.path,F=T.label,B=T.tabs,H=h(function(){var e=B.find(function(e){return e.active});return e?e.path:m},[B,m]),W=h(function(){return!!B.filter(function(e){return e.visible}).length},[B]),z=y(function(e,t){g&&g(e,t,D)},[O,D]);return f.createElement(f.Fragment,null,f.createElement(we,a({className:t,style:n,sx:a(a(a({width:"100%",zIndex:995},I&&{position:"absolute",top:0,left:0,width:"100%"}),!I&&{position:"sticky",top:0,left:0,right:0}),r),alignItems:"stretch",justifyContent:"stretch"},C),f.createElement(zt,{component:"div",color:"primary",position:"static",elevation:0,sx:{zIndex:0,pb:!W||u||L?0:2}},f.createElement($e,{variant:L?"dense":"regular"},f.createElement(U,{container:!0,alignItems:"center",wrap:"nowrap",spacing:1},f.createElement(U,{item:!0,sx:{display:L?void 0:{sm:"none",xs:"block"}}},f.createElement(Ne,{color:"inherit","aria-label":"open drawer",onClick:p,edge:"start"},f.createElement(Ut,null))),f.createElement(U,{item:!0},L?f.createElement(f.Fragment,null,!W&&f.createElement(_,{display:P?"none":void 0,whiteSpace:"nowrap",color:"inherit",variant:"h5",component:"h1"},F||s),W&&f.createElement(lt,{variant:"scrollable",value:H,textColor:"inherit",indicatorColor:"secondary",classes:{root:A.tabsRoot}},B.filter(function(e){return e.visible}).map(function(e,t){var n=e.id,r=e.label,o=e.icon,i=e.disabled,a=e.path;return f.createElement(at,{sx:{minWidth:128,fontWeight:"bold"},key:"".concat(n,"-").concat(t),value:a,label:r||Zb(n),onClick:function(){return z(a,n)},disabled:i,icon:o&&f.createElement(o,null),iconPosition:"start",classes:{root:A.tabRoot}})}))):f.createElement(_,{display:P?"none":void 0,whiteSpace:"nowrap",color:"inherit",variant:"h5",component:"h1"},F||s)),!!R&&f.createElement(U,{item:!0},f.createElement(R,{payload:o})),f.createElement(U,{item:!0,xs:!0}),!!M&&f.createElement(U,{item:!0},f.createElement(M,{payload:o})),!!(null==x?void 0:x.length)&&f.createElement(U,{item:!0},f.createElement(xa,{transparent:!0,sx:{color:"unset !important",mr:-2},BeforeContent:b,AfterContent:w,options:x.map(function(e){var t=e.isVisible,n=void 0===t?function(){return!0}:t,r=e.isDisabled,i=void 0===r?function(){return!1}:r,c=l(e,["isVisible","isDisabled"]);return a(a({},c),{isVisible:function(){return n(o)},isDisabled:function(){return i(o)}})}),onAction:v,payload:o}))))),W&&!L&&f.createElement(zt,{component:"div",position:"static",elevation:0,sx:{zIndex:0}},f.createElement(lt,{variant:"scrollable",value:H,textColor:"inherit",indicatorColor:"secondary",classes:{root:A.tabsRoot}},B.filter(function(e){return e.visible}).map(function(e,t){var n=e.id,r=e.label,o=e.icon,i=e.disabled,a=e.path;return f.createElement(at,{sx:{minWidth:"128px"},key:"".concat(n,"-").concat(t),value:a,label:r||Zb(n),onClick:function(){return z(a,n)},disabled:i,icon:o&&f.createElement(o,null),iconPosition:"start",classes:{root:A.tabRoot}})}))),!!i&&f.createElement(j,{sx:{marginTop:"-4px"}},f.createElement(De,{variant:i>1?"determinate":"indeterminate",value:i>1?Number(i):void 0,color:"primary"}))),!!I&&f.createElement(j,{sx:a(a({},L&&{paddingBottom:"48px"}),!L&&a({},a({},u?W?{paddingBottom:"106px"}:{paddingBottom:"56px"}:W?{paddingBottom:"128px"}:{paddingBottom:"64px"})))}))},xy={delta:10,preventScrollOnSwipe:!1,noPassive:!1,rotationAngle:0,trackMouse:!1,trackTouch:!0,swipeDuration:1/0,touchEventOptions:{passive:!0}},Cy={first:!0,initial:[0,0],start:0,swiping:!1,xy:[0,0]},ky="mousemove",Sy="mouseup";function Ly(e,t){if(0===t)return e;var n=Math.PI/180*t;return[e[0]*Math.cos(n)+e[1]*Math.sin(n),e[1]*Math.cos(n)-e[0]*Math.sin(n)]}function Ny(t,n){var r=function(e){var n="touches"in e;n&&e.touches.length>1||t(function(t,r){r.trackMouse&&!n&&(document.addEventListener(ky,o),document.addEventListener(Sy,l));var i=n?e.touches[0]:e,c=Ly([i.clientX,i.clientY],r.rotationAngle);return r.onTouchStartOrOnMouseDown&&r.onTouchStartOrOnMouseDown({event:e}),a(a(a({},t),Cy),{initial:c.slice(),xy:c,start:e.timeStamp||0})})},o=function(n){t(function(t,r){var o="touches"in n;if(o&&n.touches.length>1)return t;if(n.timeStamp-t.start>r.swipeDuration)return t.swiping?a(a({},t),{swiping:!1}):t;var i=o?n.touches[0]:n,l=i.clientX,c=i.clientY,u=e(Ly([l,c],r.rotationAngle),2),s=u[0],d=u[1],f=s-t.xy[0],m=d-t.xy[1],p=Math.abs(f),h=Math.abs(m),v=(n.timeStamp||0)-t.start,g=Math.sqrt(p*p+h*h)/(v||1),b=[f/(v||1),m/(v||1)],y=function(e,t,n,r){return e>t?n>0?"Right":"Left":r>0?"Down":"Up"}(p,h,f,m),w="number"==typeof r.delta?r.delta:r.delta[y.toLowerCase()]||xy.delta;if(p<w&&h<w&&!t.swiping)return t;var E={absX:p,absY:h,deltaX:f,deltaY:m,dir:y,event:n,first:t.first,initial:t.initial,velocity:g,vxvy:b};E.first&&r.onSwipeStart&&r.onSwipeStart(E),r.onSwiping&&r.onSwiping(E);var x=!1;return(r.onSwiping||r.onSwiped||r["onSwiped".concat(y)])&&(x=!0),x&&r.preventScrollOnSwipe&&r.trackTouch&&n.cancelable&&n.preventDefault(),a(a({},t),{first:!1,eventData:E,swiping:!0})})},i=function(e){t(function(t,n){var r;if(t.swiping&&t.eventData){if(e.timeStamp-t.start<n.swipeDuration){r=a(a({},t.eventData),{event:e}),n.onSwiped&&n.onSwiped(r);var o=n["onSwiped".concat(r.dir)];o&&o(r)}}else n.onTap&&n.onTap({event:e});return n.onTouchEndOrOnMouseUp&&n.onTouchEndOrOnMouseUp({event:e}),a(a(a({},t),Cy),{eventData:r})})},l=function(e){document.removeEventListener(ky,o),document.removeEventListener(Sy,l),i(e)},c=function(t,n){var l=function(){};if(t&&t.addEventListener){var c=a(a({},xy.touchEventOptions),n.touchEventOptions),u=[["touchstart",r,c],["touchmove",o,a(a({},c),n.preventScrollOnSwipe||n.noPassive?{passive:!1}:{})],["touchend",i,c]];u.forEach(function(n){var r=e(n,3),o=r[0],i=r[1],a=r[2];return t.addEventListener(o,i,a)}),l=function(){return u.forEach(function(n){var r=e(n,2),o=r[0],i=r[1];return t.removeEventListener(o,i)})}}return l},u={ref:function(e){null!==e&&t(function(t,n){if(t.el===e)return t;var r={};return t.el&&t.el!==e&&t.cleanUpTouch&&(t.cleanUpTouch(),r.cleanUpTouch=void 0),n.trackTouch&&e&&(r.cleanUpTouch=c(e,n)),a(a(a({},t),{el:e}),r)})}};return n.trackMouse&&(u.onMouseDown=r),[u,c]}function Iy(t){var n,r=t.trackMouse,o=f.useRef(a({},Cy)),i=f.useRef(a({},xy)),l=f.useRef(a({},i.current));for(n in l.current=a({},i.current),i.current=a(a({},xy),t),xy)void 0===i.current[n]&&(i.current[n]=xy[n]);var c=e(f.useMemo(function(){return Ny(function(e){return o.current=e(o.current,i.current)},{trackMouse:r})},[r]),2),u=c[0],s=c[1];return o.current=function(e,t,n,r){return t.trackTouch&&e.el?e.cleanUpTouch?t.preventScrollOnSwipe!==n.preventScrollOnSwipe||t.touchEventOptions.passive!==n.touchEventOptions.passive?(e.cleanUpTouch(),a(a({},e),{cleanUpTouch:r(e.el,t)})):e:a(a({},e),{cleanUpTouch:r(e.el,t)}):(e.cleanUpTouch&&e.cleanUpTouch(),a(a({},e),{cleanUpTouch:void 0}))}(o.current,i.current,l.current,s),u}var My,Ry=function(t){var n=t.variant,r=void 0===n?"temporary":n,o=t.onOpenChange,i=t.onSwipingChange,l=t.children,c=t.opened,u=e(g(ny),2),s=u[0],d=u[1],m=e(g(!1),2),p=m[0],v=m[1],y=b(c),w=h(function(){return p?s:c?ny:ry},[s,c,p]),E=Iy({onSwiped:function(){v(!1),o(y.current),i(!1)},onSwiping:function(t){var n=t.initial,r=t.deltaX,o=t.dir;"Left"!==o&&"Right"!==o||(v(!0),i(!0));var a=e(n,1)[0]+r,l=a>115.2;d(Math.max(Math.min(a,ny),ry)),y.current=l},noPassive:!0});return f.createElement(f.Fragment,null,f.createElement(j,a({sx:{position:"fixed",top:0,left:0,bottom:0,height:"100%",width:w,transition:p?"unset":"width 50ms",overflowX:"hidden",overflowY:"auto",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"},maxHeight:"100vh",minHeight:"100vh",background:function(e){return e.palette.background.paper},display:"flex",alignItems:"stretch",justifyContent:"stretch",zIndex:998}},E),f.createElement(j,{sx:{display:"flex",flexDirection:"column",alignItems:"stretch",justifyContent:"stretch",minWidth:ny,maxWidth:ny,pointerEvents:p?"none":"all",flex:1}},l)),"temporary"===r&&f.createElement(je,{sx:{zIndex:997},open:c||p,onClick:function(){return o(!1)}}),f.createElement(j,{sx:{minWidth:"permanent"===r?w:ry}}))},Py=function(t){var n=t.className,r=t.style,o=t.sx,i=t.options,l=t.activeOptionPath,c=t.activeTabPath,u=void 0===c?l:c,s=t.actions,d=t.payload,m=t.loading,p=t.appName,v=t.noAppName,b=t.noSearch,y=t.BeforeSearch,E=t.AfterSearch,x=t.BeforeMenuContent,C=t.AfterMenuContent,k=t.Copyright,S=t.BeforeContent,L=t.AfterContent,N=t.onOptionGroupClick,I=t.onOptionClick,M=t.onTabChange,R=void 0===M?I:M,P=t.onAction,A=t.children,T=re(),D=Zv(),O=K(T.breakpoints.between("xs","sm"));w(function(){O||H(!0)},[O]);var F=ay().noContent,_=e(g(!O),2),B=_[0],H=_[1],W=e(g(!1),2),z=W[0],V=W[1],Y=h(function(){return D.width-ry},[D.width]),U=function(e,t){if(N){var n=N(e,t);B&&H(!!O&&!!n)}else H(!1)},q=function(e,t){if(I){var n=I(e,t);B&&H(!!O&&!!n)}else H(!1)};return f.createElement(Jb,null,f.createElement(j,{className:n,style:r,sx:a({position:"relative",display:"flex",minHeight:"100vh",flexDirection:"row",overflowX:"hidden"},o)},f.createElement(Vt,null),f.createElement(Ry,{variant:O?"temporary":"permanent",opened:B||!O,onOpenChange:H,onSwipingChange:V},B||!O?f.createElement(gy,{activeOptionPath:l,options:i,payload:d,appName:p,noAppName:v,noSearch:b,BeforeSearch:y,AfterSearch:E,BeforeContent:S,AfterContent:L,onOptionGroupClick:U,onOptionClick:q}):f.createElement(yy,{swiping:z,options:i,onOptionGroupClick:U,onOptionClick:q})),f.createElement(j,{sx:{flex:1,display:"flex",slignItems:"stretch",justifyContent:"stretch",maxWidth:Y,"& > *":{maxWidth:Y}}},f.createElement(j,{sx:{display:"flex",flexDirection:"column",flex:1,position:"relative"}},f.createElement(Ey,{payload:d,options:i,actions:s,loading:m,appName:p,isMobile:O,BeforeMenuContent:x,AfterMenuContent:C,activeOptionPath:l,activeTabPath:u,onDrawerToggle:function(){H(function(e){return!e})},onTabChange:R,onAction:P}),f.createElement(j,{component:"main",sx:{flex:1,p:1}},A),!!k&&f.createElement(j,{component:"footer",sx:{p:2}},f.createElement(k,null)))),!!F&&f.createElement(j,{sx:{position:"absolute",height:"100vh",width:"100vw",top:0,left:0,zIndex:999,background:function(e){return e.palette.background.default}}})))},Ay=function(o){var i=o.children,c=o.appName,u=void 0===c?"Scaffold3":c,s=o.noSearch,d=void 0!==s&&s,m=o.noAppName,p=void 0!==m&&m,v=o.onInit,x=o.onLoadStart,C=o.onLoadEnd,k=o.fallback,S=o.options,L=o.payload,N=o.deps,I=void 0===N?[]:N,M=o.throwError,R=l(o,["children","appName","noSearch","noAppName","onInit","onLoadStart","onLoadEnd","fallback","options","payload","deps","throwError"]),P=function(o){var i=o.onLoadStart,a=o.onLoadEnd,l=o.onInit,c=void 0===l?function(){}:l,u=o.fallback,s=o.options,d=o.payload,f=o.deps,m=o.throwError,p=void 0!==m&&m,v=e(g(0),2),w=v[0],x=v[1],C=e(g([]),2),k=C[0],S=C[1],L=e(g(""),2),N=L[0],I=L[1],M=b(!0);E(function(){return function(){M.current=!1}},[]);var R=y(function(e){return t(void 0,void 0,void 0,function(){var r,o,l,c;return n(this,function(d){switch(d.label){case 0:r=cb(Bn(ab(s))),o=uy(r),l=!0,d.label=1;case 1:return d.trys.push([1,3,4,5]),i&&i(),M.current&&x(function(e){return e+1}),[4,Promise.all(o.map(function(r){return t(void 0,void 0,void 0,function(){var o,i,a;return n(this,function(l){switch(l.label){case 0:return r.isVisible?(o=r,[4,r.isVisible(e)]):[3,2];case 1:return o.visible=l.sent(),[3,3];case 2:r.visible=!0,l.label=3;case 3:return r.isDisabled?(i=r,[4,r.isDisabled(e)]):[3,5];case 4:return i.disabled=l.sent(),[3,6];case 5:r.disabled=!1,l.label=6;case 6:return r.tabs?(a=r,[4,Promise.all(r.tabs.map(function(o){return t(void 0,void 0,void 0,function(){var t,i,a;return n(this,function(n){switch(n.label){case 0:return o.isVisible?(t=o,[4,o.isVisible(e)]):[3,2];case 1:return t.visible=n.sent(),[3,3];case 2:o.visible=!0,n.label=3;case 3:return o.isDisabled?(i=o,[4,o.isDisabled(e)]):[3,5];case 4:return i.disabled=n.sent(),[3,6];case 5:o.disabled=!1,n.label=6;case 6:return o.isActive?(a=o,[4,o.isActive(e)]):[3,8];case 7:return a.active=n.sent(),[3,9];case 8:o.active=!1,n.label=9;case 9:return o.path="".concat(r.path,".").concat(o.id),[2,o]}})})}))]):[3,8];case 7:a.tabs=l.sent(),l.label=8;case 8:return[2]}})})}))];case 2:return d.sent(),S(r),[3,5];case 3:if(c=d.sent(),l=!1,p)throw c;return u&&u(c),[3,5];case 4:return a&&a(l),M.current&&x(function(e){return e-1}),[7];case 5:return[2]}})})},r([s,d],e(f),!1)),P=y(function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:e=!0,n.label=1;case 1:return n.trys.push([1,4,5,6]),i&&i(),M.current&&x(function(e){return e+1}),[4,c()];case 2:return n.sent(),[4,R(d)];case 3:return n.sent(),[3,6];case 4:if(t=n.sent(),e=!1,p)throw t;return u&&u(t),[3,6];case 5:return a&&a(e),M.current&&x(function(e){return e-1}),[7];case 6:return[2]}})})},[]);$r(function(){R(d)},r([d],e(f),!1));var A=h(function(){var e=cb(Bn(ab(k)));if(!N)return Object.values(e);var t=uy(e),n=new Set(t.filter(function(e){var t=e.id,n=e.path,r=e.label,o=void 0===r?Zb(t):r,i=N.toLowerCase(),a=!1;return(a=(a=a||o.toLowerCase().includes(i))||t.toLowerCase().includes(i))||n.toLowerCase().includes(i)}).flatMap(function(e){return function(e){for(var t=e,n=[e];t.includes(".");)t=t.slice(0,t.lastIndexOf(".")),n.push(t);return n}(e.path)}));return t.forEach(function(e){n.has(e.path)||(e.visible=!1)}),Object.values(e)},[k,N]);return{loading:!!w,searchText:N,setSearchText:I,filteredGroups:A,doInit:P}}({onInit:v,onLoadStart:x,onLoadEnd:C,fallback:k,options:S,payload:L,deps:I,throwError:M});return w(function(){P.doInit()},[]),f.createElement(dy,{value:P},f.createElement(iy,{value:o},f.createElement(ey,{initialState:""},f.createElement(Py,a({appName:u,noSearch:d,noAppName:p,payload:L,options:P.filteredGroups},R),i))))},Ty=m.createElement,Dy=Symbol("translated"),jy=function(t){return function(n,o){for(var i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];for(var l=0;l!==i.length;l++)"string"==typeof i[l]&&(i[l]=t(i[l]));return Ty.apply(void 0,r([n,o],e(i),!1))}},Oy=function(){function t(t,n,o){void 0===t&&(t={}),void 0===o&&(o={});var i=this;this.transform=n,this.config=o,this._skip=new Set,this._map=new Map,this._transformed=new Map,this._middleware=[],this.tryTransform=function(e){if(i.transform){if(i._transformed.has(e))return i._transformed.get(e);var t="";if(i._middleware.some(function(n){return t=n(e)})||(t=i.transform(e)),t!==e){var n=i.applyMark(t);return i._transformed.set(e,n),n}return null}return null},this.applyMark=function(e){var t=new String(e);return t[Dy]=!0,t},this.tr=function(e){if(!e)return e;if(e[Dy])return e;if(i._skip.has(e))return e;if(i._map.has(e))return i._map.get(e)||"";var t=i.tryTransform(e);return null!==t?t:(i._skip.add(e),e)},this.use=function(e){i._middleware.push(e)},this.jss=function(t,n){var o=Array.isArray(null==n?void 0:n.children)?(null==n?void 0:n.children)||[]:[null==n?void 0:n.children];return i.createElement.apply(i,r([t,n],e(o),!1))},this.clear=function(){i._skip.clear(),i._transformed.clear()};var a=o.rawSymbol,l=void 0===a?"撝":a,c=o.useRawMark,u=void 0!==c&&c,s=o.rawCondition,d=void 0===s?function(){return!0}:s,f=function(e){var t=i.tr(e);return t===e&&d(t)?l:t};u?(this.createElement=jy(f),this.translateText=f):(this.createElement=jy(this.tr),this.translateText=this.tr),Object.entries(t).forEach(function(t){var n=e(t,2),r=n[0],o=n[1];return i._map.set(r,i.applyMark(o))})}return Object.defineProperty(t.prototype,"skipList",{get:function(){return r([],e(this._skip),!1)},enumerable:!1,configurable:!0}),t.install=function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var i=new(t.bind.apply(t,r([void 0],e(n),!1)));return window.Translate=i,Object.assign(m,{createElement:i.createElement}),i},t}(),Fy=An()(function(e){return{root:{display:"flex",alignItems:"center",justifyContent:"flex-end",flexDirection:"row",paddingTop:"10px",paddingBottom:"10px",flexWrap:"wrap",gap:e.spacing(1)},stretch:{flexGrow:1,shrink:1},button:{borderRadius:"50px !important",minHeight:"40px !important",paddingLeft:"15px !important",paddingRight:"15px !important"}}}),_y=function(e){var t=e.onSave,n=e.onBack,r=e.onAction,o=e.actions,i=e.saveDisabled,c=e.payload,u=e.title,s=void 0===u?"Title":u,d=e.subtitle,m=void 0===d?"Subtitle":d,p=e.withSave,h=void 0!==p&&p,v=e.BeforeMenuContent,g=e.AfterMenuContent,b=Fy().classes;return f.createElement(j,{className:b.root},f.createElement(Kt,{className:b.stretch,"aria-label":"breadcrumb"},f.createElement(Qt,{sx:{cursor:"pointer"},onClick:n,color:"inherit"},s),f.createElement(_,{sx:{cursor:"pointer"},color:"textPrimary"},m)),!!h&&f.createElement(ye,{className:b.button,variant:"contained",size:"small",onClick:function(){return t&&setTimeout(t,500)},color:"primary",disabled:i},"Save"),!!(null==o?void 0:o.length)&&f.createElement(xa,{payload:c,options:o.map(function(e){var t=e.isVisible,n=void 0===t?function(){return!0}:t,r=e.isDisabled,o=void 0===r?function(){return!1}:r,i=l(e,["isVisible","isDisabled"]);return a(a({},i),{isVisible:function(){return n(c)},isDisabled:function(){return o(c)}})}),onAction:r,BeforeContent:v,AfterContent:g}))},By=An()({root:{zIndex:"unset !important"},container:{position:"relative",display:"flex",alignItems:"stretch",justifyContent:"stretch",overflowY:"auto",overflowX:"hidden",maxHeight:"45vh"},content:{flex:1,display:"flex",flexDirection:"column",justifyContent:"stretch"},loader:{position:"absolute",top:0,left:0,right:0,bottom:0,height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center"},beforeContent:{width:"100%",display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *":{flex:1}},afterContent:{width:"100%",display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *":{flex:1}}}),Hy=function(r){var o=r.variant,i=void 0===o?"contained":o,c=r.size,u=r.options,s=void 0===u?[]:u,d=r.disabled,m=void 0!==d&&d,p=r.throwError,v=void 0!==p&&p,y=r.fallback,w=r.onToggle,E=r.onAction,x=void 0===E?function(){return null}:E,C=r.payload,k=r.className,S=r.style,L=r.sx,N=r.deps,I=r.onLoadStart,M=r.onLoadEnd,R=r.keepMounted,P=r.BeforeContent,A=r.AfterContent,T=r.reloadSubject,D=b(null),H=e(g(null),2),z=H[0],V=H[1],Y=e(g(0),2),U=Y[0],q=Y[1],$=By().classes,X=to(x),K=function(){q(function(e){return e+1}),I&&I()},Q=function(e){q(function(e){return Math.max(e-1,0)}),M&&M(e)},J=e(kc(function(){return t(void 0,void 0,void 0,function(){var r,o;return n(this,function(i){switch(i.label){case 0:return[4,Promise.all(s.map(function(e){return t(void 0,void 0,void 0,function(){var t,r,o=e.isVisible,i=void 0===o?function(){return!0}:o,c=e.isDisabled,u=void 0===c?function(){return!1}:c,s=l(e,["isVisible","isDisabled"]);return n(this,function(e){switch(e.label){case 0:return t=[a({},s)],r={},[4,i(C)];case 1:return r.visible=e.sent(),[4,u(C)];case 2:return[2,a.apply(void 0,t.concat([(r.disabled=e.sent(),r)]))]}})})}))];case 1:return r=i.sent(),o=e(r.filter(function(e){return e.visible}).filter(function(e){return!e.disabled}).filter(function(e){return!e.divider}).sort(function(e,t){var n=e.primary,r=t.primary;return("boolean"==typeof r?r?1:0:null!=r?r:0)-("boolean"==typeof n?n?1:0:null!=n?n:0)}),1),[2,o[0]||r[0]]}})})},{onLoadStart:K,onLoadEnd:Q}),4),Z=J[0],ee=J[1].loading,te=J[3].waitForResult,ne=h(function(){return ee?"Loading":Z?Z.label:"Unset"},[Z,ee]),re=Ai(X,{onLoadStart:K,onLoadEnd:Q,throwError:v,fallback:y}).execute;return f.createElement(f.Fragment,null,f.createElement(Jt,{className:Eo(k,$.root),style:S,sx:L,variant:i,size:c,ref:D,disabled:m||!!U},f.createElement(ui,{size:c,variant:i,sx:{pl:2.5,pr:2.5},disabled:!Z||!!U,onLoadStart:K,onLoadEnd:Q,onClick:function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return Z&&Z.action?[4,X(Z.action)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})}},ne),f.createElement(ye,{size:c,variant:i,disabled:!!U,"aria-haspopup":"menu",onClick:function(e){e.preventDefault(),e.stopPropagation(),V(D.current),w&&w(!0)}},f.createElement(Pe,null))),f.createElement(W,{keepMounted:R,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},anchorEl:m?null:z,open:!!z&&!m,onClose:function(e){e.preventDefault(),e.stopPropagation(),V(null),q(0),w&&w(!1)},MenuListProps:{disablePadding:!0,sx:{pt:P?0:1,pb:A?0:1}}},f.createElement(j,{className:$.container},0!==U&&f.createElement(j,{className:$.loader},f.createElement(O,null)),f.createElement(j,{className:$.content,sx:{visibility:0!==U?"hidden":"visible"}},P&&f.createElement(j,{className:$.beforeContent},f.createElement(P,null)),s.map(function(e,r){var o=e.label,i=void 0===o?"unknown-label":o,a=e.action,l=void 0===a?"unknown-action":a,c=e.divider,u=e.icon,s=e.isDisabled,d=void 0===s?function(){return!1}:s,m=e.isVisible,p=void 0===m?function(){return!0}:m;return f.createElement(Jr,{Loader:function(){return c?null:f.createElement(B,{sx:{visibility:"hidden",minWidth:225}},!!u&&f.createElement(F,null,f.createElement(u,null)),f.createElement(_,{variant:"inherit"},i))},throwError:v,fallback:y,key:r,onLoadStart:K,onLoadEnd:Q,reloadSubject:T,deps:N,payload:C},function(e){return t(void 0,void 0,void 0,function(){var t,r,o;return n(this,function(n){switch(n.label){case 0:return[4,qn(250)];case 1:return n.sent(),[4,d(e)];case 2:return t=n.sent(),[4,p(e)];case 3:return r=n.sent(),[4,te()];case 4:return(null==(o=n.sent())?void 0:o.action)===l?[2,null]:r?c?[2,f.createElement(G,{orientation:"horizontal"})]:[2,f.createElement(B,{disabled:t,onClick:(a=l,function(e){e.preventDefault(),e.stopPropagation(),re(a),V(null),w&&w(!1)}),sx:{minWidth:225}},!!u&&f.createElement(F,null,f.createElement(u,null)),f.createElement(_,{variant:"inherit"},i))]:[2,null]}var a})})})}),A&&f.createElement(j,{className:$.afterContent},f.createElement(A,null))))))};!function(e){e.Link="breadcrumbs2-link",e.Button="breadcrumbs2-button",e.Fab="breadcrumbs2-fab",e.ActionGroup="breadcrumbs2-actiongroup",e.Component="breadcrumbs2-component"}(My||(My={}));var Wy,zy=My,Vy=function(){return f.createElement(O,{size:20})},Yy=function(){return f.createElement(f.Fragment,null)},Uy=An()(function(e){return{root:{display:"flex",alignItems:"center",justifyContent:"flex-end",flexDirection:"row",paddingTop:"10px",paddingBottom:"10px",flexWrap:"wrap",gap:e.spacing(1)},link:{cursor:"pointer"},stretch:{flexGrow:1,shrink:1},disabled:{pointerEvents:"none",opacity:.5}}}),qy=function(r){var o=r.className,i=r.style,c=r.sx,u=r.onAction,s=void 0===u?function(){}:u,d=r.items,m=r.actions,p=r.payload,h=r.BeforeMenuContent,v=r.AfterMenuContent,g=r.onLoadStart,b=r.onLoadEnd,y=r.fallback,w=r.throwError,E=Uy().classes,x=e(Dr(0),2),C=x[0],k=x[1],S=function(){k(function(e){return e+1}),g&&g()},L=function(e){k(function(e){return Math.max(e-1,0)}),b&&b(e)},N=to(function(e){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return C.current>1?[2]:[4,s(e)];case 1:return t.sent(),[2]}})})});return f.createElement(j,{className:Eo(E.root,o),style:i,sx:c},f.createElement(j,{className:E.stretch},f.createElement(Jr,{payload:p,Loader:Vy},function(){return t(void 0,void 0,void 0,function(){var e;return n(this,function(r){switch(r.label){case 0:return[4,Promise.all(d.filter(function(e){var t=e.type;return t===zy.Link||t===zy.Component}).map(function(e){return t(void 0,[e],void 0,function(e){var t,r=e.action,o=e.label,i=e.type,a=e.element,l=e.compute,c=void 0===l?function(){return o}:l,u=e.isDisabled,s=void 0===u?function(){return!1}:u,d=e.isVisible,f=void 0===d?function(){return!0}:d,m=e.sx;return n(this,function(e){switch(e.label){case 0:return t={},[4,f(p)];case 1:return t.visible=e.sent(),[4,s(p)];case 2:return t.disabled=e.sent(),t.element=a,t.action=r,t.type=i,[4,c(p)];case 3:return[2,(t.label=e.sent(),t.sx=m,t)]}})})}))];case 1:return e=r.sent(),[2,f.createElement(Kt,{className:E.stretch},e.filter(function(e){return e.type===zy.Link}).filter(function(e){return e.visible}).map(function(e,t){var n,r=e.action,o=void 0===r?"unknown-action":r,i=e.label,a=e.disabled,l=e.sx;return f.createElement(Qt,{key:"".concat(o,"-").concat(t),className:Eo(E.link,(n={},n[E.disabled]=a,n)),onClick:function(e){return e.preventDefault(),N(o),!1},color:"inherit",sx:l},i)}))]}})})}),f.createElement(Jr,{payload:p,Loader:Vy},function(){return t(void 0,void 0,void 0,function(){var e;return n(this,function(r){switch(r.label){case 0:return[4,Promise.all(d.filter(function(e){return e.type===zy.Component}).map(function(e){return t(void 0,[e],void 0,function(e){var t,r,o=e.element,i=void 0===o?function(){return f.createElement(f.Fragment,null)}:o,a=e.isDisabled,l=void 0===a?function(){return!1}:a,c=e.isVisible,u=void 0===c?function(){return!0}:c;return n(this,function(e){switch(e.label){case 0:return[4,l(p)];case 1:return t=e.sent(),r={element:function(){return f.createElement(i,{disabled:t,payload:p})}},[4,u(p)];case 2:return[2,(r.visible=e.sent(),r)]}})})}))];case 1:return e=r.sent(),[2,f.createElement(f.Fragment,null,e.filter(function(e){return e.visible}).map(function(e,t){var n=e.element;return f.createElement(n,{key:t})}))]}})})})),f.createElement(Jr,{payload:p,Loader:Yy},function(){return t(void 0,void 0,void 0,function(){var e;return n(this,function(r){switch(r.label){case 0:return[4,Promise.all(d.filter(function(e){return e.type===zy.ActionGroup}).map(function(e){return t(void 0,[e],void 0,function(e){var t,r=e.action,o=e.label,i=e.icon,c=e.outlined,u=void 0===c||c,s=e.actions,d=void 0===s?[]:s,f=e.isDisabled,m=void 0===f?function(){return!1}:f,h=e.isVisible,v=void 0===h?function(){return!0}:h,g=e.sx;return n(this,function(e){switch(e.label){case 0:return t={},[4,v(p)];case 1:return t.visible=e.sent(),[4,m(p)];case 2:return[2,(t.disabled=e.sent(),t.actions=d.map(function(e){var t=e.isVisible,n=void 0===t?function(){return!0}:t,r=e.isDisabled,o=void 0===r?function(){return!1}:r,i=l(e,["isVisible","isDisabled"]);return a(a({},i),{isVisible:function(){return n(p)},isDisabled:function(){return o(p)}})}),t.icon=i,t.outlined=u,t.action=r,t.label=o,t.sx=g,t)]}})})}))];case 1:return e=r.sent(),[2,f.createElement(f.Fragment,null,e.filter(function(e){return e.visible}).map(function(e,t){var n=e.action,r=void 0===n?"unknown-action":n,o=e.disabled,i=e.actions,a=e.outlined,l=e.sx;return f.createElement(Hy,{key:"".concat(r,"-").concat(t),variant:a?"outlined":"contained",payload:p,options:i,disabled:o,onAction:N,BeforeContent:h,AfterContent:v,onLoadStart:S,onLoadEnd:L,fallback:y,throwError:w,sx:l})}))]}})})}),f.createElement(Jr,{payload:p,Loader:Yy},function(){return t(void 0,void 0,void 0,function(){var e;return n(this,function(r){switch(r.label){case 0:return[4,Promise.all(d.filter(function(e){return e.type===zy.Button}).map(function(e){return t(void 0,[e],void 0,function(e){var t,r=e.action,o=e.label,i=e.icon,a=e.isDisabled,l=void 0===a?function(){return!1}:a,c=e.isVisible,u=void 0===c?function(){return!0}:c,s=e.sx,d=e.buttonColor,f=e.buttonVariant;return n(this,function(e){switch(e.label){case 0:return t={},[4,u(p)];case 1:return t.visible=e.sent(),[4,l(p)];case 2:return[2,(t.disabled=e.sent(),t.icon=i,t.action=r,t.label=o,t.sx=s,t.buttonColor=d,t.buttonVariant=f,t)]}})})}))];case 1:return e=r.sent(),[2,f.createElement(f.Fragment,null,e.filter(function(e){return e.visible}).map(function(e,t){var n=e.action,r=void 0===n?"unknown-action":n,o=e.label,i=e.buttonColor,a=e.buttonVariant,l=void 0===a?"contained":a,c=e.disabled,u=e.icon,s=e.sx;return f.createElement(ui,{key:"".concat(r,"-").concat(t),color:i,variant:l,startIcon:u&&f.createElement(u,null),disabled:c,onClick:function(){return N(r)},onLoadStart:S,onLoadEnd:L,fallback:y,throwError:w,sx:s},o)}))]}})})}),f.createElement(Jr,{payload:p,Loader:Yy},function(){return t(void 0,void 0,void 0,function(){var e;return n(this,function(r){switch(r.label){case 0:return[4,Promise.all(d.filter(function(e){return e.type===zy.Fab}).map(function(e){return t(void 0,[e],void 0,function(e){var t,r=e.action,o=e.icon,i=e.isDisabled,a=void 0===i?function(){return!1}:i,l=e.isVisible,c=void 0===l?function(){return!0}:l,u=e.label,s=e.sx,d=e.fabColor,f=void 0===d?"primary":d;return n(this,function(e){switch(e.label){case 0:return t={},[4,c(p)];case 1:return t.visible=e.sent(),[4,a(p)];case 2:return[2,(t.disabled=e.sent(),t.icon=o,t.action=r,t.label=u,t.sx=s,t.fabColor=f,t)]}})})}))];case 1:return e=r.sent(),[2,f.createElement(f.Fragment,null,e.filter(function(e){return e.visible}).map(function(e,t){var n=e.action,r=void 0===n?"unknown-action":n,o=e.label,i=e.fabColor,a=e.disabled,l=e.icon,c=e.sx;return f.createElement(ie,{title:o},f.createElement(Te,{key:"".concat(r,"-").concat(t),size:"small",color:i,disabled:a,onClick:function(){return N(r)},sx:c},l&&f.createElement(l,null)))}))]}})})}),!!(null==m?void 0:m.length)&&f.createElement(xa,{payload:p,options:m.map(function(e){var t=e.isVisible,n=void 0===t?function(){return!0}:t,r=e.isDisabled,o=void 0===r?function(){return!1}:r,i=l(e,["isVisible","isDisabled"]);return a(a({},i),{isVisible:function(){return n(p)},isDisabled:function(){return o(p)}})}),onAction:N,BeforeContent:h,AfterContent:v,onLoadStart:S,onLoadEnd:L,fallback:y,throwError:w}))},$y=function(e){function t(t){var n=e.call(this,t)||this;return n.componentDidMount=function(){var e;n.unReload=null===(e=n.props.reloadSubject)||void 0===e?void 0:e.subscribe(function(){n.setState({hasError:!1})})},n.componentWillUnmount=function(){n.unHistory&&n.unHistory(),n.unReload&&n.unReload()},n.componentDidUpdate=function(){var e;n.state.hasError&&(n.unHistory=null===(e=n.props.history)||void 0===e?void 0:e.listen(function(){n.setState({hasError:!1}),n.unHistory&&n.unHistory()}))},n.componentDidCatch=function(e,t){n.props.onError&&n.props.onError(e,t)},n.render=function(){return n.state.hasError?null:n.props.children},n.state={hasError:!1},n}return u(t,e),t.getDerivedStateFromError=function(){return{hasError:!0}},t}(f.Component),Xy=An()(function(e){return{root:{color:e.palette.action.active,cursor:"pointer",transition:"color 500ms",borderRadius:"50%",padding:0},input:{visibility:"hidden",height:0,width:0,maxHeight:0,maxWidth:0}}}),Gy=function(t){var n=t.className,r=t.value,o=void 0===r?"":r;t.sx;var i=t.onChange,c=void 0===i?function(){return null}:i,u=l(t,["className","value","sx","onChange"]),s=b(null),d=Xy().classes,m=e(g(o),2),p=m[0],v=m[1];$r(function(){v(o)},[o]);var y=to(c),E=h(function(){return Jn(function(e){y(e),v(e)},500)},[]);return w(function(){return function(){E.clear()}},[]),f.createElement(j,a({},u,{className:Eo(d.root,n),onClick:function(){var e;return null===(e=s.current)||void 0===e?void 0:e.click()},style:{color:p}}),f.createElement(Zt,null),f.createElement("input",{className:d.input,ref:s,type:"color",onChange:function(e){var t=e.target;return E(t.value)}}))},Ky=function(r){var o=r.value,i=void 0!==o&&o,c=r.withSingleValue,u=void 0!==c&&c,s=r.onChange,d=r.onLoadStart,m=r.onLoadEnd,p=r.fallback,v=r.throwError,b=l(r,["value","withSingleValue","onChange","onLoadStart","onLoadEnd","fallback","throwError"]),y=e(g(function(){return!!u||i}),2),w=y[0],E=y[1],x=no(function(){return t(void 0,void 0,void 0,function(){var e;return n(this,function(t){switch(t.label){case 0:return s?[4,s(!w)]:[3,2];case 1:e=t.sent(),t.label=2;case 2:return u||E("boolean"==typeof e?e:!w),[2]}})})},{onLoadStart:d,onLoadEnd:m,fallback:p,throwError:v}),C=x.loading,k=x.execute,S=h(function(){return u?{}:{onDelete:k,deleteIcon:f.createElement(en,null)}},[]),L=h(function(){return u?{}:{onDelete:k,deleteIcon:f.createElement(Mt,null)}},[]);return C?f.createElement(He,a({},b,{onClick:function(){},onDelete:function(){},deleteIcon:f.createElement(O,{size:"12px",color:"inherit"}),variant:"filled"})):w?f.createElement(He,a({},b,{onClick:k},S,{variant:"filled"})):f.createElement(He,a({},b,{onClick:k},L,{variant:"outlined"}))};!function(e){e.Initial="initial-state",e.Active="active-state",e.Abort="abort-state",e.Succeed="succeed-state",e.Closed="closed-state"}(Wy||(Wy={}));var Qy,Jy,Zy,ew=Wy,tw=An()(function(e){var t=D(Qy||(Qy=s(["\n 0% {\n transform: scale(1,1);\n }\n 100% {\n transform: scale(0.9, 1.1) translateY(-200px);\n }\n "],["\n 0% {\n transform: scale(1,1);\n }\n 100% {\n transform: scale(0.9, 1.1) translateY(-200px);\n }\n "]))),n=D(Jy||(Jy=s(["\n 0% {\n transform: scale(1.05, 0.95) translateY(0);\n }\n 10% {\n transform: scale(1.05, 0.95) translateY(0);\n }\n 20% {\n transform: scale(1,1) translateY(-7px);\n }\n 30% {\n transform: scale(1,1) translateY(0);\n }\n 40% {\n transform: scale(1.05, 0.95) translateY(0);\n }\n 50% {\n transform: scale(1,1) translateY(-7px);\n }\n 60% {\n transform: scale(1,1) translateY(0);\n }\n 70% {\n transform: scale(1.05, 0.95) translateY(0);\n }\n 80% {\n transform: scale(1,1) translateY(-7px);\n }\n 90% {\n transform: scale(1,1) translateY(0);\n }\n 100% {\n transform: scale(1,1) translateY(0);\n }\n "],["\n 0% {\n transform: scale(1.05, 0.95) translateY(0);\n }\n 10% {\n transform: scale(1.05, 0.95) translateY(0);\n }\n 20% {\n transform: scale(1,1) translateY(-7px);\n }\n 30% {\n transform: scale(1,1) translateY(0);\n }\n 40% {\n transform: scale(1.05, 0.95) translateY(0);\n }\n 50% {\n transform: scale(1,1) translateY(-7px);\n }\n 60% {\n transform: scale(1,1) translateY(0);\n }\n 70% {\n transform: scale(1.05, 0.95) translateY(0);\n }\n 80% {\n transform: scale(1,1) translateY(-7px);\n }\n 90% {\n transform: scale(1,1) translateY(0);\n }\n 100% {\n transform: scale(1,1) translateY(0);\n }\n "]))),r=D(Zy||(Zy=s(["\n 0% {\n opacity: 1;\n transform: scale(0.9, 1.1) translateY(-200px);\n }\n 100% {\n opacity: 0;\n transform: scale(0.9, 1.1) translateY(-400px);\n }\n "],["\n 0% {\n opacity: 1;\n transform: scale(0.9, 1.1) translateY(-200px);\n }\n 100% {\n opacity: 0;\n transform: scale(0.9, 1.1) translateY(-400px);\n }\n "])));return{initial:{},succeed:{animation:"".concat(r," 500ms ").concat(e.transitions.easing.easeInOut),transform:"scale(0.9, 1.1) translateY(-400px)",opacity:0},active:{animation:"".concat(t," 5s ").concat(e.transitions.easing.easeInOut),transform:"scale(0.9, 1.1) translateY(-200px)"},abort:{animation:"".concat(n," 500ms ").concat(e.transitions.easing.easeInOut)},closed:{visibility:"hidden"}}}),nw=function(t){var n=t.defaultState,r=void 0===n?ew.Initial:n,o=t.onAnimationEnd,i=t.onAnimationStart,c=t.className,u=t.children,s=t.stateSubject,d=l(t,["defaultState","onAnimationEnd","onAnimationStart","className","children","stateSubject"]),m=tw().classes,p=h(function(){var e;return(e={})[ew.Initial]=m.initial,e[ew.Active]=m.active,e[ew.Abort]=m.abort,e[ew.Succeed]=m.succeed,e[ew.Closed]=m.closed,e},[]),v=e(Dr(r),2),g=v[0],b=v[1];w(function(){return s.subscribe(function(e){return b(e)})},[]);var y=h(function(){return p[g.current]},[g.current]);return f.createElement(ra,a({className:Eo(c,y),onAnimationEnd:function(e){o&&o(g.current,e)},onAnimationStart:function(e){i&&i(g.current,e)}},d),u)},rw=An()(function(e,t){var n=t.size;return{root:{display:"inline-flex",alignItems:"stretch",justifyContent:"stretch",height:n,width:n},container:{position:"relative",height:n,width:n,flex:1},icon:{position:"absolute",height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center",top:0,left:0,right:0,bottom:0,zIndex:1},spinner:{position:"absolute",height:"100%",width:"100%",top:0,left:0,right:0,bottom:0,zIndex:0}}}),ow=function(r){var o=r.className,i=r.style,c=r.sx,u=r.size,s=void 0===u?40:u,d=r.thickness,m=void 0===d?3.6:d,p=r.noProgress,h=void 0!==p&&p,v=r.throwError,y=void 0!==v&&v,w=r.disabled,x=void 0!==w&&w,C=r.onLoadStart,k=r.onLoadEnd,S=r.fallback,L=r.onClick,N=void 0===L?function(){}:L,I=r.children,M=void 0===I?f.createElement(Fe,null):I,R=l(r,["className","style","sx","size","thickness","noProgress","throwError","disabled","onLoadStart","onLoadEnd","fallback","onClick","children"]),P=rw({size:s,thickness:m}).classes,A=e(g(0),2),T=A[0],D=A[1],F=b(!0);E(function(){return function(){F.current=!1}},[]);var _=zr(T);return f.createElement(j,{className:Eo(o,P.root),style:i,sx:c},f.createElement(Ne,a({},R,{className:P.container,disabled:!!T||x,onClick:function(e){return t(void 0,void 0,void 0,function(){var t,r;return n(this,function(n){switch(n.label){case 0:if(_.current)return[2];t=!0,n.label=1;case 1:return n.trys.push([1,3,4,5]),C&&C(),F.current&&D(function(e){return e+1}),[4,N(e)];case 2:return n.sent(),[3,5];case 3:if(r=n.sent(),t=!1,y)throw r;return S&&S(r),[3,5];case 4:return k&&k(t),F.current&&D(function(e){return e-1}),[7];case 5:return[2]}})})}}),!h&&f.createElement("div",{className:P.spinner},f.createElement(O,{size:s,thickness:m})),f.createElement(j,{className:P.icon},M)))},iw=function(t){var n=t.actions,o=t.label,i=void 0===o?"Filters":o,c=t.addLabel,u=void 0===c?"Add filter":c,s=t.data,d=void 0===s?{}:s,m=t.onChange,p=void 0===m?function(){return null}:m,h=l(t,["actions","label","addLabel","data","onChange"]),v=e(g(new Map(Object.entries(d))),2),b=v[0],y=v[1],w=to(p);$r(function(){var t=r([],e(b.entries()),!1).reduce(function(t,n){var r,o=e(n,2),i=o[0],l=o[1];return a(a({},t),((r={})[i]=l,r))},{});w(t)},[b]);var E=e(f.useState(null),2),x=E[0],C=E[1],k=n.filter(function(e){var t=e.action;return!b.has(t)});return f.createElement(j,a({},h,{sx:a({display:"flex",alignItems:"center",flexDirection:{xs:"column",sm:"row"},gap:1},h.sx)}),n.map(function(e,t){var n=b.get(e.action);if(n){var r=e.items.find(function(e){return e.value===n})||null;return f.createElement(Ee,{key:t,value:r,size:"small",options:e.items,sx:{width:{xs:"100%",sm:175}},getOptionLabel:function(e){return e.label},renderInput:function(e){return f.createElement(xe,a({},e,{label:i}))},onChange:function(t,n){y(function(t){return n?t.set(e.action,n.value):t.delete(e.action),new Map(t)})}})}return null}),f.createElement(ye,{onClick:function(e){C(e.target)},disabled:!k.length,variant:"outlined",size:"small",startIcon:f.createElement(Mt,null),sx:{whiteSpace:"nowrap",minHeight:{xs:"unset",sm:40},maxHeight:{xs:"unset",sm:40},width:{xs:"100%",sm:"unset"}}},u),f.createElement(W,{keepMounted:!0,anchorEl:x,open:!!x,onClose:function(){C(null)},MenuListProps:{sx:{maxHeight:"45vh",overflowY:"auto",overflowX:"hidden"}}},k.map(function(t,r){return f.createElement(B,{key:r,onClick:function(){return function(t){var r=n.find(function(e){return e.action===t});if(r){var o=e(r.items,1)[0];o&&(y(function(e){return e.set(t,o.value),new Map(e)}),C(null))}}(t.action)}},t.label)})))},aw=function(e){var r=e.actions,o=e.variant,i=void 0===o?"outlined":o,c=e.size,u=void 0===c?"medium":c,s=e.onAction,d=void 0===s?function(){}:s,m=e.fallback,p=e.onLoadStart,h=e.onLoadEnd,v=e.payload,g=e.deps,b=e.throwError,y=l(e,["actions","variant","size","onAction","fallback","onLoadStart","onLoadEnd","payload","deps","throwError"]),w=to(d),E={fallback:m,onLoadStart:p,onLoadEnd:h,payload:v,deps:g,throwError:b},x=function(e){return function(){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,w(e)];case 1:return[2,t.sent()]}})})}},C=function(e){var t=e.action,n=e.available,r=e.label,o=e.icon;return f.createElement(ui,a({},E,{disabled:!n,size:u,variant:i,startIcon:o&&f.createElement(o,null),onClick:x(t),sx:{minWidth:{xs:"100%",sm:175}}}),r)};return f.createElement(j,a({},y,{sx:a(a({},y.sx),{display:"flex",alignItems:"center",flexDirection:{xs:"column",sm:"row"},gap:1})}),f.createElement(Jr,a({Loader:function(){return f.createElement(f.Fragment,null,r.map(function(e,t){var n=e.label,r=e.icon;return f.createElement(ye,{disabled:!0,key:t,size:u,variant:i,startIcon:r&&f.createElement(r,null),sx:{minWidth:{xs:"100%",sm:175}}},f.createElement(we,{direction:"row",alignItems:"center",spacing:1},f.createElement(j,{display:"flex",alignItems:"center"},f.createElement(O,{size:"16px",color:"inherit"})),f.createElement(j,null,n)))}))}},E),function(e){return t(void 0,void 0,void 0,function(){return n(this,function(o){switch(o.label){case 0:return[4,Promise.all(r.map(function(r,o){return t(void 0,[r,o],void 0,function(t,r){var o,i=t.action,a=void 0===i?"unknown-action":i,l=t.label,c=void 0===l?"Unknown":l,u=t.icon,s=t.isAvailable,d=void 0===s||s;return n(this,function(t){switch(t.label){case 0:return[4,function(){return"function"==typeof d?d(e):d}()];case 1:return o=t.sent(),[2,f.createElement(C,{key:r,action:a,available:o,label:c,icon:u})]}})})}))];case 1:return[2,o.sent()]}})})}))},lw=An()({root:{display:"inline-flex",alignItems:"center",justifyContent:"center","& > *":{pointerEvents:"none"}},disabled:{opacity:.5},active:{cursor:"pointer"}}),cw=function(r){var o,i=r.className,c=r.onClick,u=void 0===c?function(){}:c,s=r.onLoadStart,d=r.onLoadEnd,m=r.fallback,p=r.disabled,h=r.throwError,v=void 0!==h&&h,y=r.checked,x=void 0!==y&&y,C=r.defaultChecked,k=void 0!==C&&C,S=l(r,["className","onClick","onLoadStart","onLoadEnd","fallback","disabled","throwError","checked","defaultChecked"]),L=lw().classes,N=e(g(0),2),I=N[0],M=N[1],R=e(g(x||k),2),P=R[0],A=R[1],T=b(!0);E(function(){return function(){T.current=!1}},[]),w(function(){A(x)},[x]);var D=zr(I),O=zr(P),F=!!I||p;return f.createElement(j,a({},S,{className:Eo(i,L.root,(o={},o[L.disabled]=F,o[L.active]=!F,o)),onClick:function(){return t(void 0,void 0,void 0,function(){var e,t,r,o;return n(this,function(n){switch(n.label){case 0:if(e=D.current,t=O.current,e)return[2];r=!0,n.label=1;case 1:return n.trys.push([1,3,4,5]),s&&s(),T.current&&M(function(e){return e+1}),[4,u(!t)];case 2:return n.sent(),T.current&&A(!t),[3,5];case 3:if(o=n.sent(),r=!1,v)throw o;return m&&m(o),[3,5];case 4:return d&&d(r),T.current&&M(function(e){return e-1}),[7];case 5:return[2]}})})}}),f.createElement(Ze,{disabled:F,checked:P}))},uw=function(t,n){var r=e(g(n),2),o=r[0],i=r[1];return w(function(){return t.subscribe(function(e){i(e)})},[t]),o},sw=An()(function(e){return{root:{display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"},container:{position:"static",display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column",backgroundColor:e.palette.background.paper,padding:20,borderRadius:5},title:{display:"flex",justifyContent:"stretch",alignItems:"center",paddingBottom:15,color:e.palette.text.primary},stretch:{flex:1},content:{flex:1,display:"flex",alignItems:"stretch",justifyContent:"stretch",maxWidth:"100%",overflow:"hidden","& > * > * > * > .MuiPaper-root":{background:"transparent",boxShadow:"none",border:"0",borderRadius:"0","& > * > *":{background:"transparent"}}},submit:{paddingTop:15},disabled:{opacity:.5,pointerEvents:"none"}}}),dw=function(){return{height:0,width:0,sx:{maxHeight:"80%",minWidth:"330px",maxWidth:"450px",margin:"10px"}}},fw=function(e){return{height:e.height-50,width:e.width-50}},mw=function(r){var o=r.fullScreen,i=void 0===o||o,c=r.sizeRequest,u=void 0===c?i?fw:dw:c,s=r.hidden,d=void 0!==s&&s,m=r.onSubmit,p=void 0===m?function(){return!0}:m,h=r.onChange,v=void 0===h?function(){}:h,b=r.onLoadStart,y=r.onLoadEnd,E=r.fallback,x=r.AfterTitle,C=r.BeforeTitle,k=r.title,S=r.openSubject,L=r.payload,N=void 0===L?{}:L;r.withInitialLoader;var I=r.selectionMode,M=void 0===I?Si.Multiple:I,R=r.data,P=r.throwError,A=void 0!==P&&P,T=r.submitLabel,D=void 0===T?"Submit":T,O=r.submitIcon,F=r.onClose,B=l(r,["fullScreen","sizeRequest","hidden","onSubmit","onChange","onLoadStart","onLoadEnd","fallback","AfterTitle","BeforeTitle","title","openSubject","payload","withInitialLoader","selectionMode","data","throwError","submitLabel","submitIcon","onClose"]),H=sw().classes,W=uw(S,!!S.data);$r(function(){W||F&&F()},[W]);var z=Zv({compute:function(e){var t=u(e);return{height:t.height,width:t.width,sx:t.sx}},debounce:10}),V=Or(N),Y=e(g(R||[]),2),U=Y[0],q=Y[1],$=e(Dr(0),2),X=$[0],G=$[1];w(function(){q(R||[])},[W]);var K=function(){G(function(e){return e+1}),b&&b()},Q=function(e){G(function(e){return e-1}),y&&y(e)},J=function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:if(X.current)return[2];e=!0,n.label=1;case 1:return n.trys.push([1,4,5,6]),K(),W?[4,p(null,V)]:[3,3];case 2:n.sent(),n.label=3;case 3:return[3,6];case 4:if(t=n.sent(),e=!1,A)throw t;return E&&E(t),[3,6];case 5:return Q(e),[7];case 6:return[2]}})})};return f.createElement(Se,{open:W,className:H.root,sx:a({},d&&{visibility:"hidden",opacity:0}),onClose:function(){W&&J()}},f.createElement(j,{className:Eo(H.container,"search-modal__root"),sx:a({height:z.height||void 0,width:z.width||void 0},z.sx)},k&&f.createElement("div",{className:H.title},C&&f.createElement(C,{payload:V,onClose:J}),f.createElement(_,{className:H.stretch,variant:"h6",component:"h2"},k),x&&f.createElement(x,{payload:V,onClose:J})),f.createElement(j,{className:H.content},f.createElement(Rv,a({},B,{sizeByElement:!0,withSelectOnRowClick:!0,selectionMode:M,onLoadStart:K,onLoadEnd:Q,payload:V,selectedRows:(null==U?void 0:U.length)?U:void 0,onSelectedRows:function(e,t){q(e),v(e,t)}}))),M!==Si.None&&f.createElement(ui,{className:H.submit,disabled:!!X.current||!(null==U?void 0:U.length),startIcon:O&&f.createElement(O,null),size:"large",variant:"contained",color:"info",fullWidth:!0,onClick:function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:if(X.current)return[2];e=!0,n.label=1;case 1:return n.trys.push([1,4,5,6]),K(),W?[4,p(U,V)]:[3,3];case 2:n.sent(),n.label=3;case 3:return[3,6];case 4:if(t=n.sent(),e=!1,A)throw t;return E&&E(t),[3,6];case 5:return Q(e),[7];case 6:return[2]}})})}},D)))},pw=function(e){function r(r){void 0===r&&(r=null);var o=e.call(this)||this;return o._data=r,o.next=function(r){return t(o,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return this._data=r,[4,e.prototype.next.call(this,r)];case 1:return t.sent(),[2]}})})},o.toObserver=function(){var e,t=new or(function(){return e()});return t[nr](function(){o._data&&t.emit(o._data)}),e=o.subscribe(t.emit),t},o}return u(r,e),Object.defineProperty(r.prototype,"data",{get:function(){return this._data},enumerable:!1,configurable:!0}),r}(ar),hw=function(e){return void 0===e&&(e=null),Or(function(){return new pw(e)})},vw=function(r){var o=r.param,i=r.selectionMode,c=r.handler,u=r.fallback,s=r.apiRef,d=r.reloadSubject,m=r.payload,p=void 0===m?{}:m,h=r.onChange,v=r.onAction,b=r.onRowAction,E=r.onSubmit,x=void 0===E?function(){return!0}:E,C=r.onLoadEnd,k=r.onLoadStart,S=r.onClose,L=r.submitLabel,N=r.submitIcon,I=r.throwError,M=r.title,R=r.hidden,P=l(r,["param","selectionMode","handler","fallback","apiRef","reloadSubject","payload","onChange","onAction","onRowAction","onSubmit","onLoadEnd","onLoadStart","onClose","submitLabel","submitIcon","throwError","title","hidden"]),A=Or(p),T=hw(),D=e(g(o||[]),2),j=D[0],O=D[1];w(function(){O(o)},[o]);var F=to(x),_=zr(j),B=y(function(e){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return[4,F((null==e?void 0:e.length)?e:null,A,_.current)];case 1:return t=n.sent(),T.next(!t),[2,t]}})})},[]),H=y(function(){return f.createElement(mw,a({openSubject:T,hidden:R,data:j,title:M,apiRef:s,reloadSubject:d,selectionMode:i,handler:c,payload:A,fallback:u,onClose:S,onChange:h,onLoadEnd:C,onLoadStart:k,onAction:v,onRowAction:b,submitIcon:N,submitLabel:L,throwError:I,onSubmit:B},P))},[open,R,s,d,c,A,u,h,C,k,B,L,I,M,j]),W=y(function(e){void 0===e&&(e=[]),O(e),T.next(!0)},[]);return{open:open,render:H,pickData:W,close:function(){return B(null)}}},gw=function(e){return vw(e)},bw=An()({root:{width:"100%",height:"100%",display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *:nth-of-type(1)":{flex:1}}}),yw=e(Er(),2),ww=yw[0],Ew=yw[1],xw=function(t){var n=t.children,r=t.className,o=t.target,i=l(t,["children","className","target"]),c=bw().classes,u=e(g(null),2),s=u[0],d=u[1],m=e(g({height:0,width:0}),2),p=m[0],h=m[1];w(function(){var e=o||s;if(e){var t=ne(function(){var t=e.getBoundingClientRect(),n=t.height,r=t.width;h({height:n,width:r})}),n=new ResizeObserver(t);return t(),n.observe(e),function(){n.unobserve(e),t.clear()}}},[s]);return f.createElement(ww,{payload:p},f.createElement(j,a({className:Eo(c.root,r),ref:function(e){return d(e)}},i),n))},Cw=e(Er(),2),kw=Cw[0],Sw=Cw[1],Lw=function(t){var n=t.children,o=t.delay,i=void 0===o?5e3:o,a=e(g([]),2),l=a[0],c=a[1],u=y(function(){return l.length?l[0]:null},[l]),s=y(function(){var e=l.length;e>0&&c(l.slice(1,e))},[l]),d=u();return f.createElement(f.Fragment,null,!!d&&f.createElement(tn,{open:!0,key:d.key,anchorOrigin:{vertical:"bottom",horizontal:"center"},autoHideDuration:i,onClose:s,message:d.message}),f.createElement(kw,{payload:function(t){return c(function(n){return r(r([],e(n),!1),[{key:Gr(),message:t}],!1)})}},n))},Nw=An()(function(e){return{root:{position:"fixed",bottom:e.spacing(1),right:e.spacing(1),transition:"opacity 500ms"},hidden:{opacity:0},visible:{opacity:1}}}),Iw=function(t){var n,r=t.className,o=t.style,i=t.sx,c=t.color,u=void 0===c?"primary":c,s=t.size,d=void 0===s?"medium":s,m=t.scrollTarget,p=void 0===m?document.documentElement:m,h=l(t,["className","style","sx","color","size","scrollTarget"]),v=Nw().classes,b=e(g(!1),2),y=b[0],w=b[1];E(function(){var e=function(){var e=p.scrollTop;w(e>40)};return window.addEventListener("scroll",e),function(){return window.removeEventListener("scroll",e)}},[p]);return f.createElement(Te,a({},h,{className:Eo(r,v.root,(n={},n[v.visible]=y,n[v.hidden]=!y,n)),style:o,sx:i,color:u,size:d,onClick:function(){window.scrollTo({top:0,left:0,behavior:"smooth"})}}),f.createElement(nn,null))},Mw="The form contains unsaved changes. Continue?",Rw=function(){return f.createElement(f.Fragment,null)},Pw=An()({root:{position:"relative",width:"100%"},inner:{position:"absolute",top:0,left:0}}),Aw=function(r){var o=r.className,i=r.readonly,c=r.fullScreen,u=r.waitForChangesDelay,s=void 0===u?1e3:u,d=r.initialData,m=void 0===d?{}:d,p=r.changed,v=void 0!==p&&p,y=r.animation,E=r.routes,x=r.params,C=void 0===x?{}:x,k=r.payload,S=void 0===k?{}:k,L=r.history,N=r.fallback,I=r.onChange,M=r.onLeave,R=r.onSubmit,P=void 0===R?function(){return!0}:R,A=r.onLoadStart,T=r.onLoadEnd,D=r.changeSubject,j=r.otherProps,O=void 0===j?{}:j,F=l(r,["className","readonly","fullScreen","waitForChangesDelay","initialData","changed","animation","routes","params","payload","history","fallback","onChange","onLeave","onSubmit","onLoadStart","onLoadEnd","changeSubject","otherProps"]),_=Pw().classes,B=bi({map:function(e){return e.parentElement}}),H=B.elementRef,W=B.size,z=Fr(D),V=Or(S),Y=Or(m),U=e(g(function(){return a(a({},E.reduce(function(e,t){var n,r=t.id;return a(a({},e),((n={})[r]=null,n))},{})),Y)}),2),q=U[0],$=U[1],X=e(g(function(){return new Set}),2),G=X[0],K=X[1],Q=e(g(function(){return"function"==typeof v?v(q,V):!!v}),2),J=Q[0],Z=Q[1],ee=e(g(0),2),te=ee[0],ne=ee[1],re=e(g(L.location.pathname),2),oe=re[0],ie=re[1];w(function(){return z.subscribe(function(t){var n=e(t,2),r=n[0],o=n[1];$(function(e){var t;return a(a({},e),((t={})[r]=o,t))}),K(function(e){return e.delete(r),new Set(e)})})},[]);var ae=e(g(function(){return{component:Rw,activeOption:""}}),2),le=ae[0],ce=ae[1],ue=le.component,se=le.activeOption,de=e(g(!1),2),fe=de[0],me=de[1],pe=zf({title:"Continue?",msg:Mw}),he=Fr(),ve=b(!1),ge=b("unknown"),be=J&&!te&&!G.size,ye=!!G.size,we=!!te,Ee=zr(be),xe=zr(we),Ce=zr(ye),ke=zr(oe),Se=zr(q),Le=Fr(),Ne=Xr(q);w(function(){return function(){Le.next()}},[]),w(function(){return Ne.subscribe(function(e){var t=Ee.current;I&&I(e,!t,V,ge.current),ge.current="unknown"})},[I]);var Ie=function(){A&&A(),ne(function(e){return e+1})},Me=function(e){T&&T(e),ne(function(e){return e-1})},Re=b(),Pe=il([ue,se],10),Ae=il([q,J],10),Te=function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return Re.current&&Re.current(),Z(!1),[4,Promise.race([Ae(),Le.toPromise()])];case 1:return e.sent(),[2]}})})};w(function(){return L.listen(function(e){var t=e.location;"PUSH"!==e.action&&(ie(t.pathname),ne(0))})},[]),w(function(){var e=L.location;ie(e.pathname)},[]),w(function(){var e,r,o,i=function(){return L.block(function(e){var r=e.retry,o=e.location;if(E.some(function(e){var t=e.isActive,n=e.isAvailable;return(void 0===n?t:n)(o.pathname)}))return Re.current&&Re.current(),M&&M(),void r();!function(e){t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return[4,ve.current?he.toPromise():new Promise(function(e){ve.current=!0,pe({msg:Mw}).then(function(t){ve.current=!1,he.next(t),e(t)})})];case 1:return(t=n.sent())&&M&&M(),t&&a(),t&&e(),[2]}})})}(r)})},a=function(){e&&e(),r&&r(),Re.current=null};return q&&J&&(e=i(),o=function(e){return e.preventDefault(),Mw},window.addEventListener("beforeunload",o),r=function(){window.removeEventListener("beforeunload",o)},Re.current=a),a},[q,J,oe]);var De=h(function(){return Gn(function(){return t(void 0,void 0,void 0,function(){var e,t,r,o;return n(this,function(n){switch(n.label){case 0:return e=ke.current,me(!0),t=E.find(function(t){return(0,t.isActive)(e)}),t?(r=t.id,o=t.element,ce({component:o,activeOption:r})):ce({component:Rw,activeOption:""}),[4,Promise.race([Pe(),qn(500)])];case 1:return n.sent(),me(!1),[2]}})})})},[]);w(function(){De()},[oe]);var je=h(function(){return{data:q,hasChanged:be,hasLoading:we,hasInvalid:ye,id:C&&C.id||"create",change:function(e){$(function(t){return a(a({},t),e)}),Z(!0)},payload:V}},[q,be,we,ye,C&&C.id||"create"]),Oe={dirty:ye||be,history:L,activeOption:se,readonly:i||be,hasChanged:be,hasLoading:we,hasInvalid:ye,beginSave:function(){return t(void 0,void 0,void 0,function(){var e,r,o,i,a,l;return n(this,function(c){switch(c.label){case 0:return xe.current||Ce.current?[2,!1]:[4,t(void 0,void 0,void 0,function(){var e;return n(this,function(t){switch(t.label){case 0:e=L.block(function(){}),Ie(),t.label=1;case 1:return t.trys.push([1,,3,4]),[4,Promise.race([Ae(),qn(s)])];case 2:return t.sent(),[3,4];case 3:return Me(!1),e(),[7];case 4:return[2]}})})];case 1:if(c.sent(),e=L.block(function(){}),!(r=Se.current))return[3,9];o=!0,Ie(),c.label=2;case 2:return c.trys.push([2,6,7,8]),i=!1,[4,Promise.resolve(P(r,V,{afterSave:function(){return t(this,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return e(),[4,Te()];case 1:return t.sent(),i=!0,[2]}})})}}))];case 3:return!(a=c.sent())||i?[3,5]:[4,Te()];case 4:c.sent(),c.label=5;case 5:return a&&M&&M(),o=!!a,[3,8];case 6:if(l=c.sent(),o=!1,Re.current&&Re.current(),!N)throw l;return N(l),[3,8];case 7:return Me(o),e(),[7];case 8:return[2,o];case 9:return[2,!1]}})})},afterSave:Te,formState:je,data:void 0===q[se]?{}:q[se],params:C,onChange:function(e,t){return void 0===t&&(t=!1),function(e,t,n){K(function(t){return t.delete(e),new Set(t)}),$(function(n){var r;return a(a({},n),((r={})[e]=t,r))}),n||Z(!0),ge.current=e}(se,e,t)},onInvalid:function(){return K(function(e){return e.add(se),new Set(e)})},payload:V,loading:!!te,setLoading:function(e){ne(function(t){return t+(e?1:-1)})}};return f.createElement(Fg,a({},F,{ref:H,className:Eo(o,_.root),animation:y,appear:fe}),c?f.createElement(rn,{className:_.inner,sx:W},f.createElement(ue,a(a({key:se},Oe),O))):f.createElement(ue,a(a({key:se},Oe),O)))},Tw=An()({root:{display:"flex",overflow:"hidden"}}),Dw=function(e){var r=e.className,o=e.onLoadStart,i=e.onLoadEnd,c=e.handler,u=e.fallback,s=e.throwError,d=e.size,m=e.sx,p=e.variant,h=e.value,v=l(e,["className","onLoadStart","onLoadEnd","handler","fallback","throwError","size","sx","variant","value"]),g=Tw().classes;return w(function(){if(c){t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:e=!0,n.label=1;case 1:return n.trys.push([1,3,4,5]),o&&o(),[4,c()];case 2:return n.sent(),[3,5];case 3:if(t=n.sent(),e=!1,s)throw t;return u&&u(t),[3,5];case 4:return i&&i(e),[7];case 5:return[2]}})})}},[]),f.createElement(j,a({className:Eo(r,g.root),sx:a({alignItems:"center",justifyContent:"center"},m)},v),f.createElement(O,{variant:p,value:h,size:d}))};Dw.createLoader=function(e){return function(){return f.createElement(Dw,{size:e})}};var jw,Ow,Fw=function(){return f.createElement(Dw,{size:24,sx:{height:"100%",width:"100%"}})},_w=An()(function(e){return{root:{display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"},container:{position:"static",display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column",backgroundColor:e.palette.background.paper,padding:20,borderRadius:5},title:{display:"flex",justifyContent:"stretch",alignItems:"center",paddingBottom:15,color:e.palette.text.primary},content:{flex:1,display:"flex",alignItems:"stretch",justifyContent:"stretch",maxWidth:"100%",overflowX:"hidden",overflowY:"auto","& > *":{flex:1}},submit:{paddingTop:15},disabled:{opacity:.5,pointerEvents:"none"},stretch:{flex:1}}}),Bw=function(){return{height:0,width:0,sx:{maxHeight:"80%",minWidth:"330px",maxWidth:"450px",margin:"10px"}}},Hw=function(e){return{height:e.height-50,width:e.width-50}},Ww=function(r){var o=r.withActionButton,i=void 0!==o&&o,c=r.hidden,u=void 0!==c&&c,s=r.onSubmit,d=void 0===s?function(){return!0}:s,m=r.onChange,p=void 0===m?function(){}:m,h=r.mapParams,v=void 0===h?function(e){return{id:e}}:h,y=r.mapInitialData,E=void 0===y?function(e){return{id:e}}:y,x=r.mapPayload,C=void 0===x?function(e){return{id:e}}:x,k=r.fullScreen,S=void 0===k||k,L=r.sizeRequest,N=void 0===L?S?Hw:Bw:L,I=r.onLoadStart,M=r.onLoadEnd,R=r.fallback,P=r.reloadSubject,A=r.outletIdSubject,T=r.fetchState,D=void 0===T?function(){return{}}:T,O=r.AfterTitle,F=r.BeforeTitle,B=r.title,H=r.data,W=void 0===H?null:H,z=r.withStaticAction,V=void 0!==z&&z,Y=r.throwError,U=void 0!==Y&&Y,q=r.submitLabel,$=void 0===q?"Submit":q,X=r.submitIcon,G=r.waitForChangesDelay,K=void 0===G?V?0:1e3:G,Q=r.readonly,J=r.onMount,Z=r.onUnmount,ee=r.onClose,te=void 0===ee?function(){return null}:ee,ne=l(r,["withActionButton","hidden","onSubmit","onChange","mapParams","mapInitialData","mapPayload","fullScreen","sizeRequest","onLoadStart","onLoadEnd","fallback","reloadSubject","outletIdSubject","fetchState","AfterTitle","BeforeTitle","title","data","withStaticAction","throwError","submitLabel","submitIcon","waitForChangesDelay","readonly","onMount","onUnmount","onClose"]),re=e(g(A.data),2),oe=re[0],ie=re[1],ae=_w().classes,le=Zv({compute:function(e){var t=N(e);return{height:t.height,width:t.width,sx:t.sx}},debounce:10});w(function(){return A.subscribe(function(e){ie(e)})},[]),$r(function(){oe||te&&te()},[oe]);var ce=e(g(W),2),ue=ce[0],se=ce[1],de=e(Dr(0),2),fe=de[0],me=de[1],pe=b({});w(function(){return J&&J(),function(){return Z&&Z()}},[]),w(function(){se(W)},[open]);var he=function(e,t,n,r){pe.current=n,se(e),p(e,t,n,r)},ve=function(){me(function(e){return e+1}),I&&I()},ge=function(e){me(function(e){return e-1}),M&&M(e)},be=il([ue],10),ye=function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:if(fe.current)return[2];e=!0,n.label=1;case 1:return n.trys.push([1,4,5,6]),ve(),oe?[4,d(oe,null,pe.current)]:[3,3];case 2:n.sent(),n.label=3;case 3:return[3,6];case 4:if(t=n.sent(),e=!1,U)throw t;return R&&R(t),[3,6];case 5:return ge(e),[7];case 6:return[2]}})})};return f.createElement(Se,{className:ae.root,open:!!oe,sx:a({},u&&{visibility:"hidden",opacity:0}),onClose:function(){oe&&ye()}},f.createElement(j,{className:Eo(ae.container,"outlet-modal__root"),sx:a({height:le.height||void 0,width:le.width||void 0},le.sx)},B&&f.createElement("div",{className:ae.title},F&&f.createElement(F,{id:oe||"unknown",data:ue,onClose:ye}),f.createElement(_,{className:ae.stretch,variant:"h6",component:"h2"},B),O&&f.createElement(O,{id:oe||"unknown",data:ue,onClose:ye})),f.createElement(j,{className:ae.content},!!oe&&f.createElement(Bg,{animation:"none",payload:oe,state:D,reloadSubject:P,fallback:R,onLoadStart:I,onLoadEnd:M,Loader:Fw},function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return t(void 0,void 0,void 0,function(){var r,o,i,l,c;return n(this,function(u){switch(u.label){case 0:return o=(r=f).createElement,i=[Aw],l=[{},ne],c={fullScreen:S,fallback:R,onLoadStart:I,onLoadEnd:M},[4,E(oe,e.flat(1))];case 1:return c.initialData=u.sent(),[4,C(oe,e.flat(1))];case 2:return c.payload=u.sent(),[4,v(oe,e.flat(1))];case 3:return[2,o.apply(r,i.concat([a.apply(void 0,l.concat([(c.params=u.sent(),c.readonly=Q,c.onChange=he,c.onSubmit=function(e,r){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,d(oe,e,r)];case 1:return[2,t.sent()]}})})},c.otherProps={onClose:ye},c)]))]))]}})})})),!Q&&i&&f.createElement(ui,{className:ae.submit,startIcon:X&&f.createElement(X,null),disabled:!(V||!fe.current&&ue),size:"large",variant:"contained",color:"info",fullWidth:!0,onClick:function(){return t(void 0,void 0,void 0,function(){var e,r;return n(this,function(o){switch(o.label){case 0:if(fe.current)return[2];e=!0,o.label=1;case 1:return o.trys.push([1,5,6,7]),ve(),oe?[4,t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,Promise.race([be(),qn(K)])];case 1:return e.sent(),[2]}})})]:[3,4];case 2:return o.sent(),[4,d(oe,V?{}:ue,pe.current)];case 3:o.sent(),o.label=4;case 4:return[3,7];case 5:if(r=o.sent(),e=!1,U)throw r;return R&&R(r),[3,7];case 6:return ge(e),[7];case 7:return[2]}})})}},$)))},zw=function(e){var r=e.fallback;e.pathname;var o=e.history,i=e.fullScreen,c=void 0===i||i,u=e.onLoadEnd,s=e.onLoadStart,d=e.throwError,m=e.onChange,p=e.onSubmit,h=void 0===p?function(){return!0}:p,v=e.onMount,g=e.onUnmount,b=e.onClose,E=e.submitLabel,x=e.title,C=e.hidden,k=e.pickDataSubject,S=l(e,["fallback","pathname","history","fullScreen","onLoadEnd","onLoadStart","throwError","onChange","onSubmit","onMount","onUnmount","onClose","submitLabel","title","hidden","pickDataSubject"]),L=Fr(k),N=hw(),I=Or(function(){return o||ct()}),M=to(h),R=y(function(e,r,o){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return[4,M(e,r,o)];case 1:return(t=n.sent())&&N.next(null),[2,t]}})})},[]),P=y(function(){N.next(null),b&&b()},[]),A=y(function(){return f.createElement(Ww,a({outletIdSubject:N,fullScreen:c,history:I,hidden:C,title:x,fallback:r,onChange:m,onLoadEnd:u,onMount:v,onClose:P,onUnmount:g,onLoadStart:s,submitLabel:E,throwError:d,onSubmit:R},S))},[C,r,m,u,s,R,E,d,x]),T=y(function(e){N.next(e)},[]);return w(function(){return L.subscribe(T)},[]),{open:open,render:A,pickData:T,close:function(){return R(N.data,null,{})}}},Vw=An()({hidden:{display:"none"}}),Yw=function(e){var t,n=e.className,r=e.items,o=void 0===r?[]:r,i=e.variant,c=void 0===i?"outlined":i,u=l(e,["className","items","variant"]),s=Vw().classes;return f.createElement(we,a({className:Eo(n,(t={},t[s.hidden]=!o.length,t)),direction:"column",spacing:2},u),o.map(function(e,t){return f.createElement(on,{key:t,variant:c,severity:e.color},e.content)}))},Uw=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel",qw=An()(function(e){return{root:{position:"relative",overflow:"hidden",width:"100%",minHeight:225,border:"1px solid ".concat(A(e.palette.getContrastText(e.palette.background.default),.23)),borderRadius:"4px"},container:{position:"absolute",height:"100%",width:"100%",top:0,left:0,right:0,bottom:0,zIndex:1,display:"flex",alignItems:"stretch",justifyContent:"stretch","&:hover":{background:A(e.palette.background.paper,.2)}},content:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",gap:15,padding:e.spacing(1),color:e.palette.action.active},dragZone:{position:"absolute",height:"100%",width:"100%",top:0,left:0,right:0,bottom:0,zIndex:2},hidden:{display:"none"},icon:{fontSize:48},dragActive:{background:A(e.palette.background.paper,.2)},disabled:{pointerEvents:"none",opacity:.5}}}),$w=function(t){var n,r,o=t.className,i=t.style,l=t.sx,c=t.disabled,u=void 0!==c&&c,s=t.multiple,d=void 0!==s&&s,m=t.accept,p=void 0===m?Uw:m,v=t.onData,b=void 0===v?function(){}:v,y=t.onReject,w=void 0===y?function(){}:y,E=qw().classes,x=e(g({inputId:Gr(),dragActive:!1}),2),C=x[0],k=x[1],S=function(e){return k(function(t){return a(a({},t),{dragActive:e})})},L=h(function(){return new Set(p.split(", "))},[p]),N=h(function(){return"*"===p},[p]),I=function(e){e.preventDefault(),e.stopPropagation(),u||("dragenter"===e.type||"dragover"===e.type?S(!0):"dragleave"===e.type&&S(!1))};return f.createElement(j,{className:Eo(o,E.root,(n={},n[E.disabled]=u,n)),style:i,sx:l},f.createElement(j,{component:"form",className:Eo(E.container,(r={},r[E.dragActive]=C.dragActive,r)),onDragEnter:I,onSubmit:function(e){return e.preventDefault()}},f.createElement(j,{component:"label",htmlFor:C.inputId,className:E.content},f.createElement(_,{variant:"h6"},"Drag and drop a file here or click"),f.createElement(an,{className:E.icon}))),f.createElement("input",{type:"file",id:C.inputId,multiple:d,accept:p,onChange:function(e){if(!u){e.preventDefault(),e.stopPropagation();var t=Array.from(e.target.files||[]);t.length&&(t.every(function(e){return L.has(e.type)})||N)?b(t):t.length&&w(t)}},className:E.hidden}),C.dragActive&&f.createElement("div",{className:E.dragZone,onDragEnter:I,onDragLeave:I,onDragOver:I,onDrop:function(e){if(!u){e.preventDefault(),e.stopPropagation(),S(!1);var t=Array.from(e.dataTransfer.files||[]);t.length&&(t.every(function(e){return L.has(e.type)})||N)?b(t):t.length&&w(t)}}}))},Xw=An()(function(e){return{root:{position:"relative",display:"flex",alignItems:"stretch",justifyContent:"stretch",overflow:"hidden"},container:{flex:1},dropModal:{position:"absolute",background:$(e.palette.background.default,.5),top:0,left:0,right:0,bottom:0,height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",gap:15,padding:e.spacing(1),color:e.palette.action.active},icon:{fontSize:48}}}),Gw=function(t){var n=t.className,r=t.children,o=t.onDropped,i=void 0===o?function(){}:o,c=l(t,["className","children","onDropped"]),u=Xw().classes,s=e(g(!1),2),d=s[0],m=s[1],p=b(0),h=b(null),v=to(i),w=y(function(e){e.preventDefault();var t=e.dataTransfer,n=Array.from(t.files);v(n)},[]),E=y(function(e){if(h.current&&h.current(),e){var t=function(e){return void 0===e&&(e=!0),function(t){t.preventDefault(),p.current+=e?1:-1,m(p.current>0)}},n=function(e){return e.preventDefault()},r=t(!1),o=t(!0);document.body.addEventListener("dragenter",o),document.body.addEventListener("dragleave",r),document.body.addEventListener("dragover",n),document.body.addEventListener("drop",w),h.current=function(){document.body.removeEventListener("dragenter",o),document.body.removeEventListener("dragleave",r),document.body.removeEventListener("dragover",n),document.body.removeEventListener("drop",w)}}},[]);return f.createElement(ra,a({ref:E,className:Eo(n,u.root)},c),f.createElement("div",{className:u.container},r),d&&f.createElement("div",{className:u.dropModal},f.createElement(_,{variant:"h6"},"Drop files to continue"),f.createElement(an,{className:u.icon})))},Kw=Dw.createLoader(24),Qw=function(o){var i=o.items,a=void 0===i?[]:i,l=o.className,u=o.style,s=o.sx,d=o.disabled,m=void 0!==d&&d,p=o.onUpload,h=void 0===p?function(e){return e.name}:p,v=o.onRemove,y=void 0===v?function(){}:v,w=o.onChange,x=void 0===w?function(){}:w,C=o.onClick,k=void 0===C?function(){}:C,S=o.tr,L=void 0===S?function(e){return e}:S,N=o.accept,I=void 0===N?Uw:N,M=o.multiple,R=void 0!==M&&M,P=o.onLoadStart,A=o.onLoadEnd,T=o.fallback,D=o.throwError,j=void 0!==D&&D,O=e(g(0),2),F=O[0],_=O[1],B=!!F||m,H=zf({title:"Confirmation",msg:"Are you sure you want to delete this file?"}),W=function(){_(function(e){return e+1}),P&&P()},z=function(e){_(function(e){return Math.max(e-1,0)}),A&&A(e)},V=b(!0);E(function(){return function(){V.current=!1}},[]);var Y=e(g([]),2),U=Y[0],q=Y[1],$=zr(a),X=to(x),G=function(e){return t(void 0,void 0,void 0,function(){var t,r;return n(this,function(n){switch(n.label){case 0:t=!0,n.label=1;case 1:return n.trys.push([1,4,5,6]),W(),[4,y(e)];case 2:return n.sent(),[4,X($.current.filter(function(t){return t!==e}))];case 3:return n.sent(),[3,6];case 4:if(r=n.sent(),t=!1,j)throw r;return T&&T(r),[3,6];case 5:return z(t),[7];case 6:return[2]}})})};return f.createElement(we,{className:l,style:u,sx:s,overflow:"hidden",direction:"column",alignItems:"stretch",justifyContent:"stretch"},f.createElement($w,{disabled:B,accept:I,multiple:R,onData:function(o){return t(void 0,void 0,void 0,function(){var t,i,a,l,u,s,d,f,m;return n(this,function(p){switch(p.label){case 0:t=!0,p.label=1;case 1:p.trys.push([1,10,11,12]),W(),i=function(t){var o,i;return n(this,function(n){switch(n.label){case 0:return o=new String(t.name),V.current&&q(function(t){return r(r([],e(t),!1),[o],!1)}),[4,h(t)];case 1:return i=n.sent(),V.current&&q(function(e){return e.filter(function(e){return e!==o})}),[4,X(r(r([],e($.current),!1),[i],!1))];case 2:return n.sent(),[2]}})},p.label=2;case 2:p.trys.push([2,7,8,9]),a=c(o),l=a.next(),p.label=3;case 3:return l.done?[3,6]:(u=l.value,[5,i(u)]);case 4:p.sent(),p.label=5;case 5:return l=a.next(),[3,3];case 6:return[3,9];case 7:return s=p.sent(),f={error:s},[3,9];case 8:try{l&&!l.done&&(m=a.return)&&m.call(a)}finally{if(f)throw f.error}return[7];case 9:return[3,12];case 10:if(d=p.sent(),t=!1,j)throw d;return T&&T(d),[3,12];case 11:return z(t),[7];case 12:return[2]}})})}}),f.createElement(Ie,{dense:!0,disablePadding:!0,sx:{mt:1}},U.map(function(e,t){return f.createElement(tt,{disableGutters:!0,key:"".concat(e,"-").concat(t),secondaryAction:f.createElement(ow,{disabled:B},f.createElement(nt,null))},f.createElement(Me,null,f.createElement(Oe,{primary:e})))}),a.map(function(e,r){return f.createElement(tt,{disableGutters:!0,key:"".concat(e,"-").concat(r),secondaryAction:f.createElement(Zl,{disabled:B,onClick:function(){return new Promise(function(r,o){H().then(function(i){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),i?[4,G(e)]:[3,2];case 1:n.sent(),n.label=2;case 2:return r(),[3,4];case 3:return t=n.sent(),o(t),[3,4];case 4:return[2]}})})})})}},f.createElement(ln,null))},f.createElement(Me,{onClick:function(){return r=e,t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:e=!0,n.label=1;case 1:return n.trys.push([1,3,4,5]),W(),[4,k(r)];case 2:return n.sent(),[3,5];case 3:if(t=n.sent(),e=!1,j)throw t;return T&&T(t),[3,5];case 4:return z(e),[7];case 5:return[2]}})});var r}},f.createElement(Jr,{payload:e,Loader:Kw},function(e){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return[4,L(e)];case 1:return t=n.sent(),[2,f.createElement(Oe,{primary:t})]}})})})))}),!a.length&&!F&&f.createElement(tt,{sx:{pointerEvents:"none"}},f.createElement(Me,null,f.createElement(Oe,{primary:"Nothing found"})))))},Jw="The form contains unsaved changes. Continue?",Zw=function(t){var n=t.history,r=t.withConfirm,o=void 0!==r&&r,i=t.onLoadStart,a=t.onLoadEnd,l=e(g(0),2),c=l[0],u=l[1],s=e(g(!1),2),d=s[0],f=s[1],m=b(null),p=zf({title:"Continue?",msg:Jw});return w(function(){var e;return c&&!d&&(m.current&&m.current(),m.current=Un(n.block(function(e){return function(e){o&&p().then(function(t){t&&(m.current&&m.current(),e())})}(e.retry)}),(e=function(e){return e.preventDefault(),Jw},window.addEventListener("beforeunload",e),function(){window.removeEventListener("beforeunload",e)}))),function(){m.current&&m.current()}},[c,d,o]),{handleLoadStart:function(){i&&i(),u(function(e){return e+1})},handleLoadEnd:function(e){a&&a(e),u(function(e){return e-1})},unblock:function(){m.current&&m.current(),f(!0)},block:function(){f(!1)},loading:!!c}},eE=function(t){var n=e(g(function(){var e=t;return"function"==typeof t&&(e=t()),Object.values(e||{})}),2),r=n[0],o=n[1];return[h(function(){return Object.values(r||{})},[r]),o]},tE=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return"string"==typeof e&&(e=[e]),t=t.map(function(e){return"string"==typeof e?e:Object.values(e||{})}).flatMap(function(e){return e}),Object.values(e||{}).some(function(e){return t.includes(e)})},nE=function(e){var t;return!!Array.isArray(e)||(!(!_n(e)||(null===(t=Object.keys(e))||void 0===t?void 0:t.length))||null===e)},rE=function(e){if(Array.isArray(e))return e;if(_n(e)){var t=Object.values(e);return t.length?t:null}return null},oE=An()(function(e){return{root:{display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"},container:{position:"static",padding:20,display:"flex",flexDirection:"column",alignItems:"stretch",justifyContent:"stretch",backgroundColor:e.palette.background.paper,borderRadius:5,gap:5},content:{flex:1,overflowY:"auto",paddingTop:e.spacing(1)},title:{display:"flex",justifyContent:"space-between",alignItems:"center",paddingBottom:15,color:e.palette.text.primary},submit:{marginTop:15},disabled:{opacity:.5,pointerEvents:"none"}}}),iE=function(){return{height:0,width:0,sx:{maxHeight:"80%",minWidth:"330px",maxWidth:"450px",margin:"10px"}}},aE=function(e){return{height:e.height-50,width:e.width-50}},lE=function(r){var o=r.data,i=void 0===o?null:o,l=r.withActionButton,c=void 0===l||l,u=r.withStaticAction,s=void 0!==u&&u,d=r.readonly,m=r.submitLabel,p=void 0===m?"Save":m,h=r.submitIcon,v=r.payload,b=void 0===v?{}:v,y=r.fullScreen,E=void 0!==y&&y,x=r.sizeRequest,C=void 0===x?E?aE:iE:x,k=r.onChange,S=r.onSubmit,L=r.tr,N=r.fallback,I=r.onLoadStart,M=r.onLoadEnd,R=r.onClick,P=r.onUpload,A=Or(b),T=Zv({compute:function(e){var t=C(e);return{height:t.height,width:t.width,sx:t.sx}},debounce:10}),D=e(g(!1),2),O=D[0],F=D[1],_=e(g(!1),2),B=_[0],H=_[1],W=e(g(0),2),z=W[0],V=W[1],Y=e(eE(i),2),U=Y[0],q=Y[1];w(function(){q(i)},[i]);var $=oE().classes,X=function(e){q(e),H(!0),k&&k(i||[],A)},G=function(){q(i),F(!1),H(!1)},K=function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return S?[4,S(s?[]:U,A)]:[3,2];case 1:e.sent(),e.label=2;case 2:return F(!1),H(!1),[2]}})})},Q=function(){V(function(e){return e+1}),I&&I()},J=function(e){V(function(e){return e-1}),M&&M(e)};return{render:function(){return f.createElement(Se,{className:$.root,open:O,onClose:G},f.createElement(j,{className:Eo($.container,"files-modal__root"),sx:a({height:T.height||void 0,width:T.width||void 0},T.sx)},f.createElement(j,{className:$.content},f.createElement(Qw,{disabled:!!z,accept:"*",multiple:!0,items:U,tr:L,fallback:N,onClick:R,onUpload:P,onChange:X,onLoadStart:Q,onLoadEnd:J})),!d&&c&&f.createElement(ui,{className:$.submit,disabled:!(s||!z&&B),fallback:N,onLoadStart:Q,onLoadEnd:J,startIcon:h&&f.createElement(h,null),size:"large",variant:"contained",color:"info",fullWidth:!0,onClick:K},p)))},pickFiles:function(){return F(!0)}}},cE="react-declarative__scaleContainer",uE=An()({root:{position:"relative",overflow:"hidden"},container:{position:"absolute",top:0,left:0,minHeight:"100%",minWidth:"100%","& > *:nth-of-type(1)":{transformOrigin:"top left"}},stretch:{display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *:nth-of-type(1)":{flex:1}},center:{display:"flex",alignItems:"center",justifyContent:"center"}}),sE=function(t){var n,r=t.children,o=t.className,i=t.style,a=t.stretch,l=void 0!==a&&a,c=t.center,u=void 0!==c&&c,s=uE().classes,d=e(g(null),2),m=d[0],p=d[1],h=e(g("none"),2),v=h[0],b=h[1],y=e(g("inherit"),2),E=y[0],x=y[1],C=e(g("inherit"),2),k=C[0],S=C[1];w(function(){var e=function(){if(m){var e=m.querySelector(".".concat(cE," > *:nth-of-type(1)"));if(e){var t=m.getBoundingClientRect(),n=t.height,r=t.width,o=e.clientHeight,i=e.clientWidth;if(n>o&&r>i)return b("none"),x("inherit"),void S("inherit");var a=Math.min(1,n/o),l=Math.min(1,r/i),c=Number(Math.min(l,a).toFixed(2));x("-".concat(o*(1-c),"px")),S("-".concat(i*(1-c),"px")),b("scale(".concat(c,")"))}}},t=ne(e,1e3),n=new ResizeObserver(t);return m&&(n.observe(m),e()),function(){m&&n.unobserve(m),t.clear()}},[m]);return f.createElement("div",{className:Eo(o,s.root),ref:function(e){p(e)},style:i},f.createElement(j,{className:Eo(s.container,cE,(n={},n[s.stretch]=l,n[s.center]=u,n)),sx:{"& > *:nth-of-type(1)":{transform:v,marginBottom:E,marginRight:k}}},r))},dE=An()(function(){return{root:{pointerEvents:"none"},none:{display:"none"},visible:{animation:"".concat(D(jw||(jw=s(["\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n "],["\n 0% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n "])))," 500ms ease-in-out"),opacity:1},hidden:{animation:"".concat(D(Ow||(Ow=s(["\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n "],["\n 0% {\n opacity: 1;\n }\n 100% {\n opacity: 0;\n }\n "])))," 500ms ease-in-out"),opacity:0}}}),fE=function(e){var t,n=e.className,r=e.visible,o=e.color,i=e.none,l=e.position,c=e.zIndex,u=dE().classes,s=M(),d=h(function(){var e=o||s.palette.background.default;return{background:"linear-gradient(\n ".concat("bottom"===l?"to bottom":"to right",",\n ").concat($(e,0),",\n ").concat(e,"\n )")}},[s,o]);return f.createElement("div",{className:Eo(n,u.root,(t={},t[u.visible]=r,t[u.hidden]=!r,t[u.none]=i,t)),style:a({zIndex:c},d)})},mE="react-declarative__fadeMark",pE="react-declarative__scrollViewTarget",hE=An()({root:{position:"relative",display:"flex",alignItems:"stretch",justifyContent:"stretch"},container:{flex:1},bottomFade:{position:"absolute",pointerEvents:"none",height:75,bottom:0,right:0,left:0},rightFade:{position:"absolute",pointerEvents:"none",width:75,bottom:0,right:0,top:0}}),vE=function(t){var n=t.className,r=t.style,o=t.color,i=t.children,l=t.disableBottom,c=void 0!==l&&l,u=t.disableRight,s=void 0!==u&&u,d=t.zIndex,m=void 0===d?9:d,p=t.Fade,h=void 0===p?fE:p,v=t.selector,y=void 0===v?".".concat(pE):v,E=hE().classes,x=e(g(),2),C=x[0],k=x[1],S=e(g({visible:!1,none:!0}),2),L=S[0],N=S[1],I=e(g({visible:!1,none:!0}),2),M=I[0],R=I[1],P=b(L),A=b(L);w(function(){P.current=L,A.current=M},[L,M]),w(function(){if(C){var e=C.querySelector(y);if(e){var t=Object.assign({},P.current),n=Object.assign({},A.current),r=ne(function(){return N(a({},t))},50),o=ne(function(){return R(a({},n))},50),i=-1,l=-1,c=-1,u=-1,s=function(){var i=e.scrollTop,a=e.scrollLeft;i!==c&&(t.visible=0===i,t.none=!1,r()),a!==u&&(n.visible=0===a,n.none=!1,o()),u=a,c=i},d=function(){var a=e.scrollHeight,c=e.scrollWidth;if(a!==i){var u=e.clientHeight;t.none=u>=a,r()}if(c!==l){var s=e.clientWidth;n.none=s>=c,o()}i=a,l=c},f=new ResizeObserver(d);return f.observe(e),s(),d(),e.addEventListener("scroll",s,{passive:!0}),window.addEventListener("resize",d,{passive:!0}),function(){e.removeEventListener("scroll",s),window.removeEventListener("resize",d),f.unobserve(e),r.clear(),o.clear()}}return function(){return null}}return function(){return null}},[y,C]);return f.createElement("div",{className:Eo(E.root,n),style:r},f.createElement("div",{className:E.container,ref:function(e){return k(e)}},i),!c&&f.createElement(h,{className:Eo(E.bottomFade,mE),position:"bottom",visible:L.visible,none:L.none,color:o,zIndex:m}),!s&&f.createElement(h,{className:Eo(E.rightFade,mE),position:"right",visible:M.visible,none:M.none,color:o,zIndex:m}))},gE=An()({root:{display:"flex",alignItems:"stretch",justifyContent:"stretch",height:"100%",width:"100%"},container:{display:"flex",alignItems:"stretch",justifyContent:"stretch",flex:1},content:{position:"relative",overflow:"auto !important",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"},flex:1}}),bE=function(e){var t=e.className,n=e.style,r=e.children,o=e.Fade,i=e.color,a=e.zIndex,l=e.disableBottom,c=e.disableRight,u=gE().classes,s=bi(),d=s.elementRef,m=s.size,p=m.height,h=m.width;return f.createElement(j,{className:t,style:n},f.createElement("div",{ref:d,className:u.root},f.createElement(vE,{className:u.container,Fade:o,color:i,zIndex:a,disableBottom:l,disableRight:c},f.createElement(j,{className:Eo(pE,u.content),sx:{"& > *":{minHeight:p,minWidth:h},maxHeight:p,maxWidth:h,height:"100%",width:"100%"}},f.createElement(j,{sx:{position:"absolute",top:0,left:0,display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *":{flex:1}}},r)))))},yE=function(e){var t=void 0===e?{}:e,n=t.history,r=t.pathname,o=void 0===r?"/":r,i=t.onNavigate,a=to(void 0===i?function(){}:i),l=h(function(){return ct({initialEntries:[(null==n?void 0:n.location.pathname)||o]})},[]);return w(function(){return null==n?void 0:n.listen(function(e){var t=e.action,n=e.location;"PUSH"===t&&l.push(n),"REPLACE"===t&&l.replace(n),a(e)})},[n]),{history:l}},wE=48,EE=An()(function(e){return{root:{display:"flex",flexDirection:"column",alignItems:"stretch",justifyContent:"stretch"},container:{position:"relative",overflow:"hidden",display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column",width:"100%",flex:1},header:{position:"absolute",top:0,left:0,marginLeft:0,height:"".concat(wE,"px"),width:"100%"},headerBg:{background:"dark"===e.palette.mode?ae(e.palette.background.paper,.06):$("#000",.05)},loader:{position:"absolute",top:44,height:"".concat(4,"px"),zIndex:2,left:0,width:"100%"},content:{flex:1,display:"flex",alignItems:"stretch",justifyContent:"stretch",overflowX:"hidden","& > *:nth-of-type(1)":{flex:1}},contentScroll:{overflowY:"auto"},adjust:{minHeight:wE,maxHeight:wE},tabsRoot:{minHeight:wE,height:wE,marginLeft:"0 !important",marginRight:"0 !important"},tabRoot:{minHeight:wE,height:wE},tabSelected:{},indicator:{height:"4px",background:"".concat(e.palette.primary.main," !important")}}}),xE=function(r){var o,i,c=r.className,u=r.style,s=r.sx,d=r.withScroll,m=r.outlinePaper,p=void 0!==m&&m,v=r.transparentPaper,E=void 0!==v&&v,x=r.transparentHeader,C=void 0!==x&&x,k=r.history,S=r.payload,L=void 0===S?{}:S,N=r.pathname,I=void 0===N?"/":N,M=r.tabs,R=r.routes,P=r.onTabChange;r.onLoadStart,r.onLoadEnd;var A=r.onSubmit,T=void 0===A?function(){return!0}:A,D=r.BeforeTabs,O=r.AfterTabs,F=r.BeforePaper,_=r.AfterPaper,B=r.fullScreen,H=r.onNavigate,W=r.otherProps,z=void 0===W?{}:W,V=l(r,["className","style","sx","withScroll","outlinePaper","transparentPaper","transparentHeader","history","payload","pathname","tabs","routes","onTabChange","onLoadStart","onLoadEnd","onSubmit","BeforeTabs","AfterTabs","BeforePaper","AfterPaper","fullScreen","onNavigate","otherProps"]),Y=bi(),U=Y.elementRef,q=Y.size,$=EE().classes,X=Or(L),G=h(function(){return M.filter(function(e){var t=e.isVisible;return(void 0===t?function(){return!0}:t)(X)})},[]),K=yE({history:k,pathname:I,onNavigate:H}).history,Q=e(g(K.location.pathname),2),J=Q[0],Z=Q[1],ee=e(g(0),2),te=ee[0],ne=ee[1],re=e(g(0),2),oe=re[0],ie=re[1],ae=b(-1),le=h(function(){return Object.assign({size:q,loading:!!te,progress:oe,setLoading:function(e){ne(function(t){return Math.max(t+(e?1:-1),0)}),ie(0)},setProgress:function(e){ne(0),ie(e)}},z)},[q.height,q.width]);w(function(){return K.listen(function(e){var t=e.location;"REPLACE"===e.action&&(Z(t.pathname),ne(0),ie(0))})},[]);var ce=h(function(){var e=R.find(function(e){return(0,e.isActive)(J)});if(!e)return-1;var t=G.findIndex(function(t){var n=t.isMatch,r=void 0===n?function(){return!1}:n;return t.id===e.id||r(e.id)});return-1===t?ae.current:ae.current=t},[J]),ue=h(function(){var e;return null!==(e=G[ce])&&void 0!==e?e:null},[ce]),se=y(function(){return 100===oe?null:oe?f.createElement(De,{className:$.loader,value:oe,variant:"determinate"}):te?f.createElement(De,{className:$.loader,variant:"indeterminate"}):null},[te,oe]),de=to(function(e,r,o){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return te||oe&&100!==oe?[2,!1]:[4,T(e,r,o)];case 1:return[2,t.sent()]}})})}),fe=function(){return f.createElement(Aw,a({fullScreen:B,history:K,routes:R,otherProps:le,payload:X,onSubmit:de},V))};return(null==ue?void 0:ue.passthrough)?f.createElement(f.Fragment,null,fe()):f.createElement(j,{className:Eo($.root,c),style:u,sx:s},F&&f.createElement(F,{activeTab:ue,history:K,payload:X}),f.createElement(ra,{className:$.container,outlinePaper:p,transparentPaper:E},f.createElement(lt,{variant:"scrollable",className:Eo($.header,(o={},o[$.headerBg]=!C,o)),classes:{root:$.tabsRoot,indicator:$.indicator},value:ce,sx:{background:p||E?"transparent !important":"inherit"},onChange:function(e,t){P(G[t].id,K,X)}},D&&f.createElement(D,{activeTab:ue,history:K,payload:X}),G.map(function(e,t){var n=e.id,r=e.label,o=e.icon,i=e.passthrough;return f.createElement(at,{key:t,classes:{root:$.tabRoot,selected:$.tabSelected},sx:{display:i?"none":"inherit"},label:r||n,icon:o&&f.createElement(o,null)})}),O&&f.createElement(O,{activeTab:ue,history:K,payload:X})),se(),f.createElement("div",{className:$.adjust}),f.createElement(j,{ref:U,className:Eo($.content,(i={},i[$.contentScroll]=d,i))},fe())),_&&f.createElement(_,{activeTab:ue,history:K,payload:X}))},CE=function(){return f.createElement(Dw,{size:24,sx:{height:"100%",width:"100%"}})},kE=An()(function(e){return{root:{display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"},container:{position:"static",display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column",backgroundColor:e.palette.background.paper,padding:20,borderRadius:5},title:{display:"flex",justifyContent:"stretch",alignItems:"center",paddingBottom:15,color:e.palette.text.primary},content:{flex:1,display:"flex",alignItems:"stretch",justifyContent:"stretch",maxWidth:"100%",overflow:"hidden","& > *":{flex:1}},inner:{minHeight:"100% !important",maxHeight:"100% !important",border:"unset !important"},submit:{paddingTop:15},disabled:{opacity:.5,pointerEvents:"none"},stretch:{flex:1}}}),SE=function(){return{height:0,width:0,sx:{maxHeight:"80%",minWidth:"330px",maxWidth:"450px",margin:"10px"}}},LE=function(e){return{height:e.height-50,width:e.width-50}},NE=function(r){var o=r.withActionButton,i=void 0!==o&&o,c=r.hidden,u=void 0!==c&&c,s=r.onSubmit,d=void 0===s?function(){return!0}:s,m=r.onChange,p=void 0===m?function(){}:m,h=r.mapInitialData,v=void 0===h?function(){return{}}:h,y=r.mapPayload,E=void 0===y?function(){return{}}:y,x=r.onLoadStart,C=r.onLoadEnd,k=r.fallback,S=r.fullScreen,L=void 0===S||S,N=r.sizeRequest,I=void 0===N?L?LE:SE:N,M=r.reloadSubject,R=r.fetchState,P=void 0===R?function(){return{}}:R,A=r.AfterTitle,T=r.BeforeTitle,D=r.title,O=r.data,F=void 0===O?null:O,B=r.withStaticAction,H=void 0!==B&&B,W=r.throwError,z=void 0!==W&&W,V=r.submitLabel,Y=void 0===V?"Submit":V,U=r.submitIcon,q=r.waitForChangesDelay,$=void 0===q?H?0:1e3:q,X=r.openSubject,G=r.readonly,K=r.routes,Q=r.onMount,J=r.onUnmount,Z=r.onClose,ee=void 0===Z?function(){return null}:Z,te=l(r,["withActionButton","hidden","onSubmit","onChange","mapInitialData","mapPayload","onLoadStart","onLoadEnd","fallback","fullScreen","sizeRequest","reloadSubject","fetchState","AfterTitle","BeforeTitle","title","data","withStaticAction","throwError","submitLabel","submitIcon","waitForChangesDelay","openSubject","readonly","routes","onMount","onUnmount","onClose"]),ne=kE().classes,re=uw(X,!!X.data);$r(function(){re||ee&&ee()},[re]);var oe=Zv({compute:function(e){var t=I(e);return{height:t.height,width:t.width,sx:t.sx}},debounce:10}),ie=e(g(F),2),ae=ie[0],le=ie[1],ce=e(Dr(0),2),ue=ce[0],se=ce[1],de=b({});w(function(){return Q&&Q(),function(){return J&&J()}},[]),w(function(){le(F)},[re]);var fe=function(e,t,n,r){de.current=n,le(e),p(e,t,n,r)},me=function(){se(function(e){return e+1}),x&&x()},pe=function(e){se(function(e){return e-1}),C&&C(e)},he=il([ae],10),ve=function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:if(ue.current)return[2];e=!0,n.label=1;case 1:return n.trys.push([1,3,4,5]),me(),[4,d(null,de.current)];case 2:return n.sent(),[3,5];case 3:if(t=n.sent(),e=!1,z)throw t;return k&&k(t),[3,5];case 4:return pe(e),[7];case 5:return[2]}})})};return f.createElement(Se,{className:ne.root,open:re,sx:a({},u&&{visibility:"hidden",opacity:0}),onClose:function(){re&&ve()}},f.createElement(j,{className:Eo(ne.container,"outlet-modal__root"),sx:a({height:oe.height||void 0,width:oe.width||void 0},oe.sx)},D&&f.createElement("div",{className:ne.title},T&&f.createElement(T,{data:ae,onClose:ve}),f.createElement(_,{className:ne.stretch,variant:"h6",component:"h2"},D),A&&f.createElement(A,{data:ae,onClose:ve})),f.createElement(j,{className:ne.content},re&&f.createElement(Bg,{animation:"none",state:P,reloadSubject:M,fallback:k,onLoadStart:x,onLoadEnd:C,Loader:CE},function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return t(void 0,void 0,void 0,function(){var t,r,o,i,l;return n(this,function(n){switch(n.label){case 0:return r=(t=f).createElement,o=[xE],i=[{},te],l={fullScreen:L,className:ne.inner,routes:K,transparentPaper:!0,fallback:k,onLoadStart:x,onLoadEnd:C},[4,v(e.flat(1))];case 1:return l.initialData=n.sent(),[4,E(e.flat(1))];case 2:return[2,r.apply(t,o.concat([a.apply(void 0,i.concat([(l.payload=n.sent(),l.readonly=G,l.onChange=fe,l.onSubmit=d,l.otherProps={onClose:ve},l)]))]))]}})})})),!G&&i&&f.createElement(ui,{className:ne.submit,disabled:!(H||!ue.current&&ae),size:"large",variant:"contained",color:"info",fullWidth:!0,startIcon:U&&f.createElement(U,null),onClick:function(){return t(void 0,void 0,void 0,function(){var e,r;return n(this,function(o){switch(o.label){case 0:if(ue.current)return[2];e=!0,o.label=1;case 1:return o.trys.push([1,4,5,6]),me(),[4,t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,Promise.race([he(),qn($)])];case 1:return e.sent(),[2]}})})];case 2:return o.sent(),[4,d(H?{}:ae,de.current)];case 3:return o.sent(),[3,6];case 4:if(r=o.sent(),e=!1,z)throw r;return k&&k(r),[3,6];case 5:return pe(e),[7];case 6:return[2]}})})}},Y)))},IE=function(e){var r=e.fallback;e.pathname;var o=e.history,i=e.fullScreen,c=void 0===i||i,u=e.onLoadEnd,s=e.onLoadStart,d=e.throwError,m=e.onChange,p=e.onSubmit,h=void 0===p?function(){return!0}:p,v=e.onMount,g=e.onUnmount,b=e.onClose,w=e.submitLabel,E=e.title,x=e.hidden,C=l(e,["fallback","pathname","history","fullScreen","onLoadEnd","onLoadStart","throwError","onChange","onSubmit","onMount","onUnmount","onClose","submitLabel","title","hidden"]),k=hw(),S=Or(function(){return o||ct()}),L=to(h),N=y(function(e,r){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return[4,L(e,r)];case 1:return(t=n.sent())&&k.next(!1),[2,t]}})})},[]),I=y(function(){k.next(!1),b&&b()},[]),M=y(function(){return f.createElement(NE,a({openSubject:k,fullScreen:c,history:S,hidden:x,title:E,fallback:r,onChange:m,onLoadEnd:u,onMount:v,onClose:I,onUnmount:g,onLoadStart:s,submitLabel:w,throwError:d,onSubmit:N},C))},[x,r,m,u,s,N,w,d,E]),R=y(function(){k.next(!0)},[]);return{open:open,render:M,pickData:R,close:function(){return N(null,{})}}},ME=function(){return f.createElement(f.Fragment,null)},RE=function(r){var o=r.onDone,i=r.condition,c=r.Loader,u=void 0===c?ME:c,s=r.Content,d=void 0===s?ME:s,m=r.Error,p=void 0===m?ME:m,h=r.delay,v=void 0===h?1e3:h,b=r.totalAttempts,y=void 0===b?Number.POSITIVE_INFINITY:b,E=r.conditionMap,x=void 0===E?function(e){return!!e}:E,C=r.payload,k=l(r,["onDone","condition","Loader","Content","Error","delay","totalAttempts","conditionMap","payload"]),S=e(g({payload:C,attempt:0,initComplete:!1}),2),L=S[0],N=S[1];w(function(){return N({payload:C,attempt:0,initComplete:!0})},[C]);return L.initComplete?f.createElement(Jr,a({},k,{payload:L,Loader:u}),function(e){return t(void 0,[e],void 0,function(e){var t,r,l=e.payload,c=e.attempt;return n(this,function(e){switch(e.label){case 0:return[4,i()];case 1:return t=e.sent(),r={condition:t,attempt:c,payload:l},x(t)?(o&&o(c),[2,f.createElement(d,a({},r))]):c>y?[2,f.createElement(p,a({},r))]:(setTimeout(function(){return N(function(e){return a(a({},e),{attempt:e.attempt+1})})},v),[2,f.createElement(u,a({},r))])}})})}):null},PE=function(){return f.createElement(f.Fragment,null)},AE=function(r){var o=r.ping,i=r.children,a=r.onOnline,l=void 0===a?function(){return null}:a,c=r.onOffline,u=void 0===c?function(){return null}:c,s=r.Offline,d=void 0===s?PE:s,m=r.fallback,p=r.throwError,h=r.delay,v=void 0===h?5e3:h,b=r.payload,y=e(g({isOnline:!1,initComplete:!1}),2),E=y[0],x=y[1],C=function(e){x({initComplete:!0,isOnline:e}),e?l():u()};return w(function(){var e=null,r=!1,i=function(){return t(void 0,void 0,void 0,function(){var t,a;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,3,4]),[4,o(b)];case 1:return t=n.sent(),r?[2]:(C(!!t),[3,4]);case 2:if(a=n.sent(),!r&&C(!1),p)throw a;return m&&m(a),[3,4];case 3:return e=setTimeout(i,v),[7];case 4:return[2]}})})};return i(),function(){r=!0,null!==e&&clearTimeout(e)}},[b]),E.initComplete?E.isOnline?f.createElement(f.Fragment,null,i):f.createElement(d,null):null},TE=function(e,t){if("Sanitizer"in window){var n=new window.Sanitizer(t),r=document.createElement("div");return r.setHTML(e,{sanitizer:n}),r.innerHTML}return e},DE=function(o){var i=o.children,c=void 0===i?null:i,u=o.config,s=o.handler,d=o.fallback,m=o.onLoadStart,p=o.onLoadEnd,h=o.payload,v=o.deps,y=void 0===v?[]:v,x=o.throwError,C=l(o,["children","config","handler","fallback","onLoadStart","onLoadEnd","payload","deps","throwError"]),k=e(g(void 0),2),S=k[0],L=k[1],N=b(!0);return E(function(){return function(){N.current=!1}},[]),w(function(){t(void 0,void 0,void 0,function(){var e,t,r,o;return n(this,function(n){switch(n.label){case 0:e=!0,m&&m(),n.label=1;case 1:return n.trys.push([1,3,4,5]),r=TE,[4,s(h)];case 2:return t=r.apply(void 0,[n.sent(),u]),N.current&&L(t),[3,5];case 3:if(o=n.sent(),e=!1,x)throw o;return d&&d(o),[3,5];case 4:return p&&p(e),[7];case 5:return[2]}})})},r([h],e(y),!1)),f.createElement(f.Fragment,null,S?f.createElement(j,a({},C,{dangerouslySetInnerHTML:{__html:S}})):c)};DE.sanitize=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return TE.apply(void 0,r([],e(t),!1)).trim()};var jE,OE,FE=5e3,_E="GET",BE={url:"https://httpbin.org/get",method:_E,timeout:FE,interval:FE},HE=function(e){return t(void 0,[e],void 0,function(e){var t=e.url,r=e.timeout,o=void 0===r?FE:r,i=e.method,a=void 0===i?_E:i;return n(this,function(e){return[2,new Promise(function(e){var n=function(){return e(!1)},r=new XMLHttpRequest;r.onerror=n,r.ontimeout=n,r.onreadystatechange=function(){r.readyState===r.HEADERS_RECEIVED&&(r.status?e(!0):n())},r.open(a,t),r.timeout=o,r.send()})]})})},WE=function(r){var o=r.children,i=r.onOnline,l=r.onOffline,c=r.config,u=void 0===c?BE:c,s=r.withPolling,d=void 0!==s&&s,m=r.Offline,p=e(g({isOnline:!1,initComplete:!1}),2),h=p[0],v=p[1],b=function(e){return v(function(t){return a(a({},t),{isOnline:e})})};return w(function(){return v(function(){return{isOnline:"boolean"!=typeof navigator.onLine||navigator.onLine,initComplete:!0}}),function(e){var r=e.withPolling,o=e.config,i=e.onOnline,a=e.onOffline;if(r){var l=o.interval,c=void 0===l?FE:l,u=o.timeout,s=void 0===u?FE:u,d=o.method,f=void 0===d?_E:d,m=o.url,p=null,h=!1,v=function(){return t(void 0,void 0,void 0,function(){var e;return n(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,3,4]),[4,HE({url:m,timeout:s,method:f})];case 1:return e=t.sent(),h?[2]:(e?i():a(),[3,4]);case 2:return t.sent(),!h&&a(),[3,4];case 3:return p=setTimeout(v,c),[7];case 4:return[2]}})})};return v(),function(){h=!0,null!==p&&clearInterval(p)}}return window.addEventListener("online",i),window.addEventListener("offline",a),function(){window.removeEventListener("online",i),window.removeEventListener("offline",a)}}({onOnline:function(){b(!0),i&&i()},onOffline:function(){b(!1),l&&l()},config:u,withPolling:d})},[]),h.initComplete?m?h.isOnline?f.createElement(f.Fragment,null,o):f.createElement(m,null):f.createElement(f.Fragment,null,o):null},zE=Symbol("navigate-callback"),VE=function(e,t,n){return{type:Dn.Group,isVisible:n,sx:{p:2},desktopColumns:"6",tabletColumns:"6",phoneColumns:"12",fields:[{type:Dn.Typography,style:{whiteSpace:"nowrap",minWidth:"195px",overflow:"hidden",textOverflow:"ellipsis"},typoVariant:"h6",placeholder:e},{type:Dn.Group,fields:t.map(function(e){var t=e.label;return function(e,t,n,r){return{type:Dn.Component,desktopColumns:"6",tabletColumns:"12",phoneColumns:"12",fieldRightMargin:"1",fieldBottomMargin:"1",isVisible:r,element:function(r){var o=r.payload;return f.createElement(ke,{component:qt,onClick:function(){o[zE](e,o)},sx:{display:"flex",alignItems:"stretch",justifyContent:"stretch",width:"100%",background:function(e){return e.palette.primary.main},color:"white",fontWeight:"bold",fontSize:"18px",height:"75px",minHeight:"125px",textWrap:"wrap",padding:"16px","&:hover":{background:function(e){return oe(e.palette.primary.main,.23)}},"& > *:nth-of-type(1)":{flex:1},transition:"background 500ms"}},f.createElement(we,{direction:"row",alignItems:"center",gap:2},f.createElement(j,{flex:1}),n&&f.createElement(n,null),f.createElement(_,{textAlign:"center"},t),f.createElement(j,{flex:1})))}}}(e.to,t,e.icon,e.isVisible)})}]}},YE=function(e){var t=e.routes,n=e.data,r=e.payload,o=void 0===r?{}:r,i=e.onNavigate,l=void 0===i?function(){}:i,c=Or(o),u=h(function(){return t.map(function(e){var t=e.label,n=e.routes,r=e.isVisible;return n?VE(t,n,r):function(e,t){return{type:Dn.Component,isVisible:t,element:function(){return f.createElement(we,{direction:"row",alignItems:"center",gap:3,sx:{mt:3,mb:3}},f.createElement(_,{variant:"h4",fontWeight:"bold",sx:{opacity:.5}},e),f.createElement(H,{sx:{flex:1},orientation:"horizontal"}))}}}(t,r)})},[]),s=to(l);return f.createElement(bf,{fields:u,handler:function(){return n},payload:function(){var e;return a(((e={})[zE]=s,e),c)}})},UE=An()({root:{width:"100%"}}),qE=function(t){var n=t.children,r=t.className,o=t.style,i=t.animation,a=t.delay,l=void 0===a?0:a,c=t.appear,u=void 0===c||c,s=UE().classes,d=e(g(!1),2),m=d[0],p=d[1],h=b(!0);return E(function(){return function(){h.current=!1}},[]),w(function(){u&&qn(l).then(function(){h.current&&p(!0)})},[u]),f.createElement(Fg,{className:Eo(r,s.root),style:o,animation:i,appear:m},m&&f.createElement(f.Fragment,null,n))},$E=new Set([0,1,2,3,4,5,6,7,8,9]),XE={value:"",open:!1,approved:!1},GE=function(t){var n=t.className,r=t.style,o=t.sx,i=t.children,l=t.enabled,c=void 0===l||l,u=t.title,s=void 0===u?"Service menu":u,d=t.description,m=void 0===d?"Please type a secret\ncode to continue":d,p=t.digits,h=void 0===p?6:p,v=t.onCode,g=e(Dr(XE),2),b=g[0],y=g[1],E=function(){return y(a(a({},b.current),XE))};w(function(){c||E()},[c]);var x=function(e){return y(a(a({},b.current),{value:e}))},C=to(function(e){if(!b.current.approved&&c)if("Escape"!==e){if("Backspace"===e)return x(b.current.value.slice(0,Math.max(b.current.value.length-1,0))),void(b.current.value.length||E());var t,n=parseInt(e);if($E.has(n))b.current.value||function(e){y(a(a({},b.current),{open:e}))}(!0),x("".concat(b.current.value).concat(n)),b.current.value.length===h&&(setTimeout(function(){v&&v(parseInt(b.current.value)),E()},500),t=!0,y(a(a({},b.current),{approved:t})))}else E()}),k=function(){b.current.approved||E()};return w(function(){var e=function(e){var t=!1;(t=(t=t||e.target===document.body)||b.current.open&&e.target.classList.contains("MuiDialog-container"))&&c&&C(e.key)};return document.body.addEventListener("keydown",e),function(){return document.body.removeEventListener("keydown",e)}},[]),f.createElement(f.Fragment,null,i,f.createElement(Hf,{className:n,style:r,sx:o,canCancel:!0,noSave:!0,open:b.current.open,onDismiss:k,onClose:k},f.createElement(mt,null,f.createElement(j,{mr:3},s)),f.createElement(j,{p:3,sx:{width:"100%",minWidth:"225px",minHeight:"75px",display:"flex",alignItems:"center",justifyContent:"center",whiteSpace:"nowrap"}},!!b.current.value&&f.createElement(j,null,f.createElement(_,{variant:"h4"},b.current.value),f.createElement(_,{component:"pre",variant:"body2",sx:{textAlign:"center"}},m)))))},KE=function(t){var n=e(t.split("_")),o=n[0],i=n.slice(1);return r(["".concat(o.charAt(0).toUpperCase()).concat(o.slice(1))],e(i),!1).join(" ")},QE=new Set([Dn.Text,Dn.Time,Dn.Date,Dn.Items,Dn.Combo,Dn.Checkbox,Dn.Choose,Dn.Complete,Dn.Radio,Dn.YesNo,Dn.Switch,Dn.Component,Dn.Tree,Dn.Phony]),JE=function(e,t){var n,r,o=void 0===t?{}:t,i=o.keyToTitle,a=void 0===i?function(e){return e}:i,l=o.ignore,u=void 0===l?function(){return!1}:l,s=[],d=function(e,t,n,r){if(!e)return"continue";if(u(e))return"continue";if(s.some(function(t){return t.value===e}))return"continue";if(QE.has(t)){var o=n||r||a(e);s.push({label:"".concat(o,", ").concat(String(Symbol.keyFor(t)||t)),value:e})}};try{for(var f=c(Pr(e)),m=f.next();!m.done;m=f.next()){var p=m.value;d(p.name,p.type,p.title,p.placeholder)}}catch(e){n={error:e}}finally{try{m&&!m.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}return s},ZE=function(t){var n=t.changeSubject,r=t.outlinePaper,o=t.transparentPaper,i=t.className,l=t.style,u=t.sx,s=t.expandAll,d=t.readonly,m=t.onChange,p=t.groups,v=t.data,g=t.ignore,b=void 0===g?function(){return!1}:g,w=t.keyToTitle,E=void 0===w?KE:w,x=h(function(){return p.map(function(e,t){var n=e.fields,r=e.name,o=e.title,i=e.description,a=JE(n,{keyToTitle:E,ignore:b});return{type:Dn.Expansion,fieldBottomMargin:t===p.length-1?"0":"1",expansionOpened:s,title:o||E(r),description:i,fields:a.map(function(e){var t=e.label,n=e.value;return{type:Dn.Checkbox,readonly:d,name:"".concat(r,".").concat(n),title:"".concat(t," (").concat(n,")"),defaultValue:!1}})}})},[]),C=h(function(){return v?p.reduce(function(e,t){var n=t.name,r=t.fields,o=JE(r,{keyToTitle:E,ignore:b}),i=new Set(v[n]);return a(a({},e),o.reduce(function(e,t){var r,o,l=t.value;return(r={})[n]=a(a({},e[n]),((o={})[l]=i.has(l),o)),r},{}))},{}):{}},[v]),k=y(function(){return C},[v]),S=y(function(t,n){var r,o;if(!n){var i={};try{for(var a=c(Object.entries(t)),l=a.next();!l.done;l=a.next()){var u=e(l.value,2),s=u[0],d=u[1];i[s]=Object.entries(d).filter(function(t){return e(t,2)[1]}).map(function(t){return e(t,1)[0]})}}catch(e){r={error:e}}finally{try{l&&!l.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}m&&m(i)}},[]);return f.createElement(bf,{className:i,outlinePaper:r,transparentPaper:o,changeSubject:n,style:l,sx:u,handler:k,change:S,fields:x})},ex=function(r){var o=r.groups,i=r.data,l=r.keyToTitle,u=void 0===l?KE:l,s=r.ignore,d=r.expandAll,f=r.readonly,m=r.fullScreen,p=r.fallback,v=r.onLoadStart,g=r.onLoadEnd,b=r.onSubmit,y=r.onChange,w=r.submitLabel,E=h(function(){return o.map(function(e,t){var n=e.fields,r=e.name,i=e.title,a=e.description,l=JE(n,{keyToTitle:u,ignore:s});return{type:Dn.Expansion,fieldBottomMargin:t===o.length-1?"0":"1",expansionOpened:d,title:i||u(r),description:a,fields:l.map(function(e){var t=e.label,n=e.value;return{type:Dn.Checkbox,name:"".concat(r,".").concat(n),readonly:f,title:"".concat(t," (").concat(n,")"),defaultValue:!1}})}})},[]),x=h(function(){return i?o.reduce(function(e,t){var n=t.name,r=t.fields,o=JE(r,{keyToTitle:u,ignore:s}),l=new Set(i[n]);return a(a({},e),o.reduce(function(e,t){var r,o,i=t.value;return(r={})[n]=a(a({},e[n]),((o={})[i]=l.has(i),o)),r},{}))},{}):{}},[i]);return og({fullScreen:m,fallback:p,onLoadStart:v,onLoadEnd:g,handler:function(){return x},onSubmit:function(r){return t(void 0,void 0,void 0,function(){var t,o,i,a,l,u,s,d;return n(this,function(n){switch(n.label){case 0:if(!r)return[3,2];t={};try{for(o=c(Object.entries(r)),i=o.next();!i.done;i=o.next())a=e(i.value,2),l=a[0],u=a[1],t[l]=Object.entries(u).filter(function(t){return e(t,2)[1]}).map(function(t){return e(t,1)[0]})}catch(e){s={error:e}}finally{try{i&&!i.done&&(d=o.return)&&d.call(o)}finally{if(s)throw s.error}}return b?[4,b(t)]:[3,2];case 1:return[2,n.sent()];case 2:return[2,!0]}})})},onChange:function(t,n){var r,o;if(!n){var i={};try{for(var a=c(Object.entries(t)),l=a.next();!l.done;l=a.next()){var u=e(l.value,2),s=u[0],d=u[1];i[s]=Object.entries(d).filter(function(t){return e(t,2)[1]}).map(function(t){return e(t,1)[0]})}}catch(e){r={error:e}}finally{try{l&&!l.done&&(o=a.return)&&o.call(a)}finally{if(r)throw r.error}}y&&y(i)}},submitLabel:w,transparentPaper:!0,payload:{readonly:f},fields:E})},tx=An()(function(e){return{root:{position:"relative",overflow:"hidden",display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column",width:"100%",minHeight:365},header:{position:"absolute",overflowX:"auto",top:0,left:0,height:"".concat(65,"px"),background:"dark"===e.palette.mode?ae(e.palette.background.paper,.06):$("#000",.05),padding:"0px !important",width:"100%"},firstStep:{paddingLeft:e.spacing(3)},lastStep:{paddingRight:e.spacing(3)},loader:{position:"absolute",top:61,height:"4px",zIndex:2,left:0,width:"100%"},content:{flex:1,display:"flex",alignItems:"stretch",justifyContent:"stretch",overflowX:"hidden","& > *:nth-of-type(1)":{flex:1}},contentScroll:{overflowY:"auto"},adjust:{minHeight:65,maxHeight:65}}}),nx=function(r){var o,i=r.className,c=r.style,u=r.sx,s=r.payload,d=void 0===s?{}:s,m=r.fullScreen,p=r.outlinePaper,v=void 0!==p&&p,E=r.transparentPaper,x=void 0!==E&&E,C=r.withScroll,k=r.history,S=r.pathname,L=void 0===S?"/":S,N=r.steps,I=r.routes;r.onLoadStart,r.onLoadEnd;var M=r.onNavigate,R=r.onSubmit,P=void 0===R?function(){return!0}:R,A=r.otherProps,T=void 0===A?{}:A,D=l(r,["className","style","sx","payload","fullScreen","outlinePaper","transparentPaper","withScroll","history","pathname","steps","routes","onLoadStart","onLoadEnd","onNavigate","onSubmit","otherProps"]),O=bi(),F=O.elementRef,_=O.size,B=Or(d),H=h(function(){return N.filter(function(e){var t=e.isVisible;return(void 0===t?function(){return!0}:t)(B)})},[]),W=tx().classes,z=yE({history:k,pathname:L,onNavigate:M}).history,V=e(g(z.location.pathname),2),Y=V[0],U=V[1],q=e(g(0),2),$=q[0],X=q[1],G=e(g(0),2),K=G[0],Q=G[1],J=b(-1),Z=h(function(){return Object.assign({size:_,loading:!!$,progress:K,setLoading:function(e){X(function(t){return Math.max(t+(e?1:-1),0)}),Q(0)},setProgress:function(e){X(0),Q(e)}},T)},[_.height,_.width,$]);w(function(){return z.listen(function(e){var t=e.location;"REPLACE"===e.action&&(U(t.pathname),X(0),Q(0))})},[]);var ee=h(function(){var e=I.find(function(e){return(0,e.isActive)(Y)});if(!e)return-1;var t=H.findIndex(function(t){var n=t.isMatch,r=void 0===n?function(){return!1}:n;return t.id===e.id||r(e.id)});return-1===t?J.current:J.current=t},[Y]),te=h(function(){var e;return null!==(e=H[ee])&&void 0!==e?e:null},[ee]),ne=y(function(){return 100===K?null:K?f.createElement(De,{className:W.loader,value:K,variant:"determinate"}):$?f.createElement(De,{className:W.loader,variant:"indeterminate"}):null},[$,K]),re=to(function(e,r,o){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return $||K&&100!==K?[2,!1]:[4,P(e,r,o)];case 1:return[2,t.sent()]}})})}),oe=function(){return f.createElement(Aw,a({history:z,fullScreen:m,routes:I,otherProps:Z,payload:B,onSubmit:re},D))};return(null==te?void 0:te.passthrough)?f.createElement(f.Fragment,null,oe()):f.createElement(ra,{outlinePaper:v,transparentPaper:x,className:Eo(W.root,i),style:c,sx:u},f.createElement(sn,{className:W.header,activeStep:ee,sx:{background:v||x?"transparent !important":"inherit"}},H.map(function(e,t){var n,r=e.id,o=e.label,i=e.icon,a=e.passthrough;return f.createElement(cn,{key:t,completed:ee>t,className:Eo((n={},n[W.firstStep]=0===t,n[W.lastStep]=t===Math.max(H.length-1,0),n)),sx:{display:a?"none":"inherit"}},f.createElement(un,{StepIconComponent:i},o||r))})),ne(),f.createElement("div",{className:W.adjust}),f.createElement(j,{ref:F,className:Eo(W.content,(o={},o[W.contentScroll]=C,o))},oe()))},rx=An()(function(e){return{root:{display:"flex",justifyContent:"stretch",alignItems:"center",flexDirection:"row",padding:e.spacing(1),gap:e.spacing(1)},stretch:{flex:1}}}),ox=function(e){var t=e.className,n=e.style,r=e.sx,o=e.disabled,i=e.fallback,c=e.onLoadStart,u=e.onLoadEnd,s=e.onPrev,d=e.onNext,m=e.AfterPrev,p=e.BeforeNext,h=e.hasPrev,v=void 0!==h&&h,g=e.hasNext,b=void 0!==g&&g,y=e.labelPrev,w=void 0===y?"Prev":y,E=e.labelNext,x=void 0===E?"Next":E,C=e.throwError,k=l(e,["className","style","sx","disabled","fallback","onLoadStart","onLoadEnd","onPrev","onNext","AfterPrev","BeforeNext","hasPrev","hasNext","labelPrev","labelNext","throwError"]),S=rx().classes,L=si({onLoadStart:c,onLoadEnd:u,disabled:o}),N=L.handleLoadStart,I=L.handleLoadEnd,M=L.loading;return f.createElement(j,a({className:Eo(t,S.root),style:n,sx:r},k),f.createElement(ui,{disabled:M||!v,onClick:s,variant:"contained",fallback:i,onLoadStart:N,onLoadEnd:I,throwError:C},w),m&&f.createElement(m,null),f.createElement("div",{className:S.stretch}),p&&f.createElement(p,null),f.createElement(ui,{disabled:M||!b,onClick:d,variant:"contained",fallback:i,onLoadStart:N,onLoadEnd:I,throwError:C},x))},ix=An()({root:{display:"flex",height:"100%",width:"100%",justifyContent:"stretch",alignItems:"stretch",flexDirection:"column"},container:{flex:1}}),ax=x(function(e,t){var n=e.className,r=e.Navigation,o=e.children,i=l(e,["className","Navigation","children"]),c=ix().classes;return f.createElement(j,a({ref:t,className:Eo(n,c.root)},i),f.createElement("div",{className:c.container},o),r)}),lx=function(){return f.createElement(Dw,{size:24,sx:{height:"100%",width:"100%"}})},cx=An()(function(e){return{root:{display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"},container:{position:"static",display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column",backgroundColor:e.palette.background.paper,padding:20,borderRadius:5},title:{display:"flex",justifyContent:"stretch",alignItems:"center",paddingBottom:15,color:e.palette.text.primary},content:{flex:1,display:"flex",alignItems:"stretch",justifyContent:"stretch",maxWidth:"100%",overflow:"hidden","& > *":{flex:1}},inner:{minHeight:"100% !important",maxHeight:"100% !important",border:"unset !important"},submit:{paddingTop:15},disabled:{opacity:.5,pointerEvents:"none"},stretch:{flex:1}}}),ux=function(){return{height:0,width:0,sx:{maxHeight:"80%",minWidth:"330px",maxWidth:"450px",margin:"10px"}}},sx=function(e){return{height:e.height-50,width:e.width-50}},dx=function(r){var o=r.withActionButton,i=void 0!==o&&o,c=r.hidden,u=void 0!==c&&c,s=r.onSubmit,d=void 0===s?function(){return!0}:s,m=r.onChange,p=void 0===m?function(){}:m,h=r.mapInitialData,v=void 0===h?function(){return{}}:h,y=r.mapPayload,E=void 0===y?function(){return{}}:y,x=r.onLoadStart,C=r.onLoadEnd,k=r.fallback,S=r.fullScreen,L=void 0===S||S,N=r.sizeRequest,I=void 0===N?L?sx:ux:N,M=r.reloadSubject,R=r.fetchState,P=void 0===R?function(){return{}}:R,A=r.AfterTitle,T=r.BeforeTitle,D=r.title,O=r.data,F=void 0===O?null:O,B=r.throwError,H=void 0!==B&&B,W=r.withStaticAction,z=void 0!==W&&W,V=r.waitForChangesDelay,Y=void 0===V?z?0:1e3:V,U=r.submitLabel,q=void 0===U?"Submit":U,$=r.submitIcon,X=r.openSubject,G=r.readonly,K=r.routes,Q=r.onMount,J=r.onUnmount,Z=r.onClose,ee=void 0===Z?function(){return null}:Z,te=l(r,["withActionButton","hidden","onSubmit","onChange","mapInitialData","mapPayload","onLoadStart","onLoadEnd","fallback","fullScreen","sizeRequest","reloadSubject","fetchState","AfterTitle","BeforeTitle","title","data","throwError","withStaticAction","waitForChangesDelay","submitLabel","submitIcon","openSubject","readonly","routes","onMount","onUnmount","onClose"]),ne=cx().classes,re=uw(X,!!X.data);$r(function(){re||ee&&ee()},[re]);var oe=Zv({compute:function(e){var t=I(e);return{height:t.height,width:t.width,sx:t.sx}},debounce:10}),ie=e(g(F),2),ae=ie[0],le=ie[1],ce=e(Dr(0),2),ue=ce[0],se=ce[1],de=b({});w(function(){return Q&&Q(),function(){return J&&J()}},[]),w(function(){le(F)},[re]);var fe=function(e,t,n,r){de.current=n,le(e),p(e,t,n,r)},me=function(){se(function(e){return e+1}),x&&x()},pe=function(e){se(function(e){return e-1}),C&&C(e)},he=il([ae],10),ve=function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:if(ue.current)return[2];e=!0,n.label=1;case 1:return n.trys.push([1,3,4,5]),me(),[4,d(null,de.current)];case 2:return n.sent(),[3,5];case 3:if(t=n.sent(),e=!1,H)throw t;return k&&k(t),[3,5];case 4:return pe(e),[7];case 5:return[2]}})})};return f.createElement(Se,{className:ne.root,open:re,sx:a({},u&&{visibility:"hidden",opacity:0}),onClose:function(){re&&ve()}},f.createElement(j,{className:Eo(ne.container,"outlet-modal__root"),sx:a({height:oe.height||void 0,width:oe.width||void 0},oe.sx)},D&&f.createElement("div",{className:ne.title},T&&f.createElement(T,{data:ae,onClose:ve}),f.createElement(_,{className:ne.stretch,variant:"h6",component:"h2"},D),A&&f.createElement(A,{data:ae,onClose:ve})),f.createElement(j,{className:ne.content},re&&f.createElement(Bg,{animation:"none",state:P,reloadSubject:M,fallback:k,onLoadStart:x,onLoadEnd:C,Loader:lx},function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return t(void 0,void 0,void 0,function(){var t,r,o,i,l;return n(this,function(n){switch(n.label){case 0:return r=(t=f).createElement,o=[nx],i=[{},te],l={fullScreen:L,className:ne.inner,routes:K,transparentPaper:!0,fallback:k,onLoadStart:x,onLoadEnd:C},[4,v(e.flat(1))];case 1:return l.initialData=n.sent(),[4,E(e.flat(1))];case 2:return[2,r.apply(t,o.concat([a.apply(void 0,i.concat([(l.payload=n.sent(),l.readonly=G,l.onChange=fe,l.onSubmit=d,l.otherProps={onClose:ve},l)]))]))]}})})})),!G&&i&&f.createElement(ui,{className:ne.submit,startIcon:$&&f.createElement($,null),disabled:!(z||!ue.current&&ae),size:"large",variant:"contained",color:"info",fullWidth:!0,onClick:function(){return t(void 0,void 0,void 0,function(){var e,r;return n(this,function(o){switch(o.label){case 0:if(ue.current)return[2];e=!0,o.label=1;case 1:return o.trys.push([1,4,5,6]),me(),[4,t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,Promise.race([he(),qn(Y)])];case 1:return e.sent(),[2]}})})];case 2:return o.sent(),[4,d(z?{}:ae,de.current)];case 3:return o.sent(),[3,6];case 4:if(r=o.sent(),e=!1,H)throw r;return k&&k(r),[3,6];case 5:return pe(e),[7];case 6:return[2]}})})}},q)))},fx=function(e){var r=e.fallback;e.pathname;var o=e.history,i=e.fullScreen,c=void 0===i||i,u=e.onLoadEnd,s=e.onLoadStart,d=e.throwError,m=e.onChange,p=e.onSubmit,h=void 0===p?function(){return!0}:p,v=e.onMount,g=e.onUnmount,b=e.onClose,w=e.submitLabel,E=e.title,x=e.hidden,C=l(e,["fallback","pathname","history","fullScreen","onLoadEnd","onLoadStart","throwError","onChange","onSubmit","onMount","onUnmount","onClose","submitLabel","title","hidden"]),k=hw(),S=Or(function(){return o||ct()}),L=to(h),N=y(function(e,r){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return[4,L(e,r)];case 1:return(t=n.sent())&&k.next(!1),[2,t]}})})},[]),I=y(function(){k.next(!1),b&&b()},[]),M=y(function(){return f.createElement(dx,a({openSubject:k,fullScreen:c,history:S,hidden:x,title:E,fallback:r,onChange:m,onLoadEnd:u,onMount:v,onClose:I,onUnmount:g,onLoadStart:s,submitLabel:w,throwError:d,onSubmit:N},C))},[x,r,m,u,s,N,w,d,E]),R=y(function(){k.next(!0)},[]);return{open:open,render:M,pickData:R,close:function(){return N(null,{})}}},mx=function(t){function n(){var n=t.apply(this,r([],e(arguments),!1))||this;return n.element=null,n}return u(n,t),n.prototype.componentWillUnmount=function(){this.element&&document.body.removeChild(this.element),this.element=null},n.prototype.render=function(){return this.element||(this.element=document.createElement("div"),document.body.appendChild(this.element)),z.createPortal(this.props.children,this.element)},n}(f.Component),px=function(t){var n=[],r=0,o=function(t,i){return void 0===i&&(i=""),t.forEach(function(t){var a=e(t,2),l=a[0],c=a[1],u="".concat(i,".").concat(String(l));_n(c)?(n.push({path:u,name:String(l),value:"",deepIndex:r}),r+=1,o(Object.entries(c),u)):(n.push({path:u,name:String(l),value:String(c),deepIndex:r}),r+=1)})};return o(Object.entries(t),"root"),n},hx=function(t){var n=e(t.split("_")),o=n[0],i=n.slice(1);return r(["".concat(o.charAt(0).toUpperCase()).concat(o.slice(1))],e(i),!1).join(" ")},vx=p(null),gx=function(t){var n=t.children,r=t.search,o=void 0===r?"":r,i=t.withExpandAll,l=void 0!==i&&i,c=t.withExpandRoot,u=void 0!==c&&c,s=t.withExpandLevel,d=void 0===s?0:s,m=t.expandList,p=t.data,v=t.onSearchChanged,b=void 0===v?function(){}:v,E=t.formatSearch,x=void 0===E?function(){return""}:E,C=to(b),k=y(function(){return px(p).map(function(e){var t=e.path;return t.startsWith("root.")?t.slice(5):t}).filter(function(e){return"root"!==e}).filter(function(e){var t=Wn(p,e);return _n(t)})},[p]),S=y(function(){return px(p).map(function(e){var t=e.path;return t.startsWith("root.")?t.replace("root.",""):t}).filter(function(e){return"root"!==e}).filter(function(e){var t=Wn(p,e),n=!0;return n=(n=n&&_n(t))&&!e.includes(".")})},[p]),L=y(function(){return px(p).map(function(e){var t=e.path;return t.startsWith("root.")?t.replace("root.",""):t}).filter(function(e){return"root"!==e}).filter(function(e){var t=Wn(p,e),n=!0;return n=(n=n&&_n(t))&&function(e){var t;return(null===(t=e.match(/\./g))||void 0===t?void 0:t.length)||0}(e)<=d,n})},[p,d]),N=y(function(){return l?k():u?S():d?L():m?m.map(function(e){return e.startsWith("root.")?e.replace("root.",""):e}):[]},[l,u,d,k,S,L,m]),I=e(g(function(){return{checked:new Set(N()),data:p,search:o}}),2),M=I[0],R=I[1],P=zr(M);w(function(){!P.current.search&&m&&R(function(e){return a(a({},e),{checked:new Set(N())})})},[m]),w(function(){var e,t,n={},r=px(p),o=new Set(r.filter(function(e){var t,n,r,o,i=e.name,a=e.value,l=e.path;return t=x(i,a,l),n=M.search,r=String(n||"").toLowerCase().split(" "),o=String(t).toLowerCase().split(" "),r.every(function(e){return o.some(function(t){return t.includes(e)})})}).map(function(e){var t=e.path;return t.startsWith("root.")?t.replace("root.",""):t}).join(".").split(".")),i=r.map(function(e){var t=e.value,n=e.path,r=e.name;return{path:n.startsWith("root.")?n.replace("root.",""):n,value:t,name:r}}).filter(function(e){var t,n,r,i=e.value,a=e.path,l=e.name,c=M.search.toLowerCase(),u=!1;return u=(u=(u=(u=u||i.toLowerCase().includes(c))||a.toLowerCase().includes(c))||o.has(l))||hx((t=a,n=".",r=" ",t.split(n).join(r))).toLowerCase().includes(c)}).flatMap(function(e){return function(e){for(var t=e,n=[e];t.includes(".");)t=t.slice(0,t.lastIndexOf(".")),n.push(t);return n}(e.path)});(e=i,t=[],new Set(e).forEach(function(e){return t.push(e)}),t).filter(function(e){return"root"!==e}).forEach(function(e){var t=Wn(p,e);_n(t)||(Tr(n,e),Hn(n,e,t))}),R(function(e){return a(a({},e),{data:n})})},[M.search,p]),w(function(){C(M.search)},[M.search,C]);var A=y(function(e){return R(function(t){return a(a({},t),{search:e})})},[]),T=y(function(e){var t=e.startsWith("root.")?e.replace("root.",""):e;return M.checked.has(t)},[M.checked]),D=y(function(e,t){var n=e.startsWith("root.")?e.replace("root.",""):e;t?M.checked.add(n):M.checked.delete(n),R(function(e){return a(a({},e),{checked:new Set(M.checked)})})},[M.checked]),j=h(function(){return{data:M.data,search:M.search,setSearch:A,isChecked:T,setIsChecked:D}},[M,T,A,D]);return f.createElement(vx.Provider,{value:j},n)},bx=function(){var e=v(vx),t=e.search,n=l(e,["search"]);return a({isSearching:!!t,search:t},n)},yx=An()(function(e){return{label:{display:"flex",cursor:"pointer",color:e.palette.primary.main},stretch:{flex:1}}}),wx=function(t){var n=t.children,r=t.title,o=t.checked,i=t.onCheck,c=t.BeforeLabel,u=t.AfterLabel,s=l(t,["children","title","checked","onCheck","BeforeLabel","AfterLabel"]),d=yx().classes,m=e(g(!1),2),p=m[0],h=m[1];w(function(){void 0!==o&&h(o)},[o]);return f.createElement(j,a({},s),f.createElement(we,{direction:"row",alignItems:"center",justifyContent:"stretch",gap:1},c&&f.createElement(c,null),f.createElement(j,{className:d.label,role:"none",onClick:function(){var e=!p;i&&i(e),h(e)}},f.createElement("strong",null,r||"Show details")," ",f.createElement(Pe,null)),f.createElement("div",{className:d.stretch}),u&&f.createElement(u,null)),f.createElement(Dt,{in:p},n))},Ex=An()(function(e,t){var n=t.background,r=void 0===n?e.palette.background.default:n;return{key:{borderRadius:"4px","&:hover":{background:$(e.palette.getContrastText(r),.02)}},keyBlack:{background:$(e.palette.getContrastText(r),.05)},keyWhite:{backgroundColor:r}}}),xx=function(e){var t,n,r=e.formatValue,o=e.formatKey,i=e.keyWidth,a=e.valueWidth,l=e.totalWidth,c=e.value,u=e.itemKey,s=e.path,d=e.index,m=e.background,p=e.withDarkParent,v=void 0!==p&&p,g=Ex({background:m}).classes,b=h(function(){return r(u,"string"==typeof c||"number"==typeof c||"boolean"==typeof c?c:null,s.startsWith("root.")?s.replace("root.",""):s)},[u,s,c,r]);return f.createElement(U,{container:!0,columns:l,sx:{pt:2,pb:2},className:Eo(g.key,v?(t={},t[g.keyBlack]=d%2!=0,t[g.keyWhite]=d%2==0,t):(n={},n[g.keyBlack]=d%2==0,n[g.keyWhite]=d%2!=0,n))},f.createElement(U,{item:!0,xs:i},f.createElement(_,{variant:"body1",sx:{ml:1,overflow:"hidden"}},o(u,s))),f.createElement(U,{item:!0,zeroMinWidth:!0,xs:a},f.createElement(_,{sx:{whiteSpace:"break-spaces",overflowWrap:"break-word",textOverflow:"ellipsis",fontWeight:"bold"},variant:"body1"},function(e){return null==e||void 0===e||""===e||"null"===e?"—":"boolean"==typeof e?String(e):e.toString().startsWith("http")?f.createElement("a",{href:e.toString(),target:"_blank",rel:"noreferrer",style:{wordBreak:"break-all"}},e):f.isValidElement(e)?e:_n(e)?f.createElement("pre",null,JSON.stringify(e,null,2)):e}(b))))},Cx="react-declarative__recordView_never_value",kx=function(){return f.createElement(_,{variant:"body1"},"Empty")},Sx=function(){return f.createElement(f.Fragment,null)},Lx=An()(function(e,t){var n=t.background,r=void 0===n?e.palette.background.default:n;return{group:{borderRadius:"4px"},groupKey:{textDecoration:"underline",height:"100%"},groupBlack:{background:$(e.palette.getContrastText(r),.05)},groupWrite:{backgroundColor:r}}}),Nx=function(t){var n=t.path,r=void 0===n?"root":n,o=t.data,i=t.keyWidth,c=t.valueWidth,u=t.totalWidth,s=t.formatValue,d=t.formatKey,m=t.payload,p=t.BeforeCollapseLabel,v=void 0===p?Sx:p,b=t.AfterCollapseLabel,E=void 0===b?Sx:b,x=t.withDarkParent,C=void 0!==x&&x,k=t.background,S=t.itemKey,L=t.EmptyItem,N=void 0===L?kx:L,I=t.CustomItem,M=void 0===I?xx:I,R=l(t,["path","data","keyWidth","valueWidth","totalWidth","formatValue","formatKey","payload","BeforeCollapseLabel","AfterCollapseLabel","withDarkParent","background","itemKey","EmptyItem","CustomItem"]),P=Lx({background:k}).classes,A=bx(),T=A.isSearching,D=A.isChecked,j=A.setIsChecked,O=e(g(D(r)),2),F=O[0],B=O[1];w(function(){j(r,F)},[r,F]);var H=h(function(){return function(){return f.createElement(v,{itemKey:S,payload:m,path:r})}},[r]),W=h(function(){return function(){return f.createElement(E,{itemKey:S,payload:m,path:r})}},[r]),z=y(function(){return Object.entries(o).map(function(t,n){var o,l=e(t,2),p=l[0],h=l[1],g="".concat(r,".").concat(p);return p===Cx?f.createElement(N,null):_n(h)?f.createElement(U,{key:g,container:!0,columns:u,className:Eo(P.group,(o={},o[P.groupBlack]=n%2==0,o[P.groupWrite]=n%2!=0,o))},f.createElement(U,{item:!0,xs:i},f.createElement(_,{sx:{mt:3,ml:1,overflow:"hidden"},className:P.groupKey,variant:"body1"},d(p,g))),f.createElement(U,{item:!0,xs:c,sx:{mt:3,mb:3}},f.createElement(Nx,a({background:k,withDarkParent:n%2==0,formatValue:s,formatKey:d,data:h,keyWidth:i,payload:m,itemKey:p,valueWidth:c,totalWidth:u,BeforeCollapseLabel:v,AfterCollapseLabel:E,EmptyItem:N,CustomItem:M,path:g},R)))):f.createElement(M,a({background:k,withDarkParent:C,formatValue:s,formatKey:d,key:g,path:g,itemKey:p,value:h,index:n,keyWidth:i,valueWidth:c,totalWidth:u},R))})},[P,o,r,R,i,c,u,C,s,d,k]);return"root"===r?f.createElement(f.Fragment,null,z()):f.createElement(wx,{checked:F||T,onCheck:function(e){T||B(e)},BeforeLabel:H,AfterLabel:W},z())},Ix=An()({root:{position:"relative",maxWidth:"100%"},beforeSearch:{width:"calc(100% - 10px)",margin:"5px",marginBottom:"0px",display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *":{flex:1}},afterSearch:{width:"calc(100% - 10px)",margin:"5px",marginTop:"0px",display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *":{flex:1}}}),Mx=function(e){var t=e.formatValue,n=e.formatKey,r=e.keyWidth,o=e.valueWidth,i=e.totalWidth,c=e.background,u=e.BeforeSearch,s=e.AfterSearch,d=e.BeforeCollapseLabel,m=e.AfterCollapseLabel,p=e.EmptyItem,h=e.CustomItem,v=e.payload,g=e.className,b=e.style,y=e.sx,w=l(e,["formatValue","formatKey","keyWidth","valueWidth","totalWidth","background","BeforeSearch","AfterSearch","BeforeCollapseLabel","AfterCollapseLabel","EmptyItem","CustomItem","payload","className","style","sx"]),E=Ix().classes,x=bx(),C=x.data,k=x.search,S=x.isSearching,L=x.setSearch,N=ub();return f.createElement(j,a({className:Eo(g,E.root),style:b,sx:y},w),u&&f.createElement(j,{className:E.beforeSearch},f.createElement(u,{payload:v})),f.createElement(xe,a({fullWidth:!0,sx:{mb:1},variant:"standard",onChange:function(e){var t=e.target;return L(t.value.toString())},value:k,placeholder:"Search",InputProps:{autoComplete:"off",endAdornment:f.createElement(Le,{position:"end"},f.createElement("div",{style:{marginRight:-10}},f.createElement(Ne,{onClick:function(){return L("")}},S?f.createElement(Fe,null):f.createElement(ot,null))))},name:"search",type:"text"},N)),s&&f.createElement(j,{className:E.afterSearch},f.createElement(s,{payload:v})),0===Object.keys(C).length&&f.createElement(_,{variant:"body1"},"Nothing found"),f.createElement(Nx,{data:C,payload:v,formatValue:t,formatKey:n,keyWidth:r,valueWidth:o,totalWidth:i,background:c,EmptyItem:p,CustomItem:h,itemKey:"root",BeforeCollapseLabel:d,AfterCollapseLabel:m}))},Rx=function(t){var n=function(t,r){return void 0===r&&(r={}),Object.entries(t||{}).forEach(function(t){var o,i=e(t,2),a=i[0],l=i[1];Array.isArray(l)?r[a]=n((o=l,Object.fromEntries(Object.entries(o).map(function(t){var n=e(t,2),r=n[0],o=n[1];return["Item ".concat(parseFloat(r)+1),o]})))):_n(l)?r[a]=n(l):r[a]=l}),r};return n(t)},Px=function(e){var t=e.data,n=void 0===t?{}:t,r=e.search,o=void 0===r?"":r,i=e.onSearchChanged,c=e.formatValue,u=void 0===c?function(e,t){return t}:c,s=e.formatKey,d=void 0===s?function(e){return"".concat(hx(e),": ")}:s,m=e.formatSearch,p=e.withExpandAll,v=void 0!==p&&p,g=e.withExpandRoot,b=void 0!==g&&g,y=e.withExpandLevel,w=void 0===y?0:y,E=e.expandList,x=e.keyWidth,C=void 0===x?2:x,k=e.valueWidth,S=void 0===k?10:k,L=e.totalWidth,N=e.background,I=e.BeforeSearch,M=e.AfterSearch,R=e.BeforeCollapseLabel,P=e.AfterCollapseLabel,A=e.payload,T=e.className,D=e.style,j=e.sx,O=e.EmptyItem,F=e.CustomItem,_=l(e,["data","search","onSearchChanged","formatValue","formatKey","formatSearch","withExpandAll","withExpandRoot","withExpandLevel","expandList","keyWidth","valueWidth","totalWidth","background","BeforeSearch","AfterSearch","BeforeCollapseLabel","AfterCollapseLabel","payload","className","style","sx","EmptyItem","CustomItem"]),B=h(function(){return Rx(n)},[n]);return f.createElement(gx,{search:o,data:B,withExpandAll:v,withExpandRoot:b,withExpandLevel:w,formatSearch:m,expandList:E,onSearchChanged:i},f.createElement(Mx,a({formatValue:u,formatKey:d,EmptyItem:O,CustomItem:F,keyWidth:C,valueWidth:S,totalWidth:L,background:N,BeforeSearch:I,AfterSearch:M,BeforeCollapseLabel:R,AfterCollapseLabel:P,payload:A,className:T,style:D,sx:j},_)))},Ax=function(e){var t=e.appName;return f.createElement(_,{variant:"h2",color:"primary",width:"100%",textAlign:"center",fontWeight:"bold",sx:{textStroke:"2px #fff",WebkitTextStroke:"2px #fff"}},t)},Tx=An()(function(e){return{root:{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:9999,background:e.palette.background.default,height:"100%",width:"100%",display:"flex",alignItems:"center",flexDirection:"column",gap:15,padding:15},container:{minWidth:375,maxWidth:375,padding:15},reveal:{width:"unset !important"}}}),Dx=function(){var e=window.location,t=e.href,n=e.origin;if("file:"!==e.protocol){var r=new URL(t,n);r.pathname="/",r.search="",r.hash="",window.location.href=r.toString()}else window.location.reload()},jx=f.createElement(f.Fragment,null,"It looks like this app finished with uncaught exception",f.createElement("br",null),"Please reload this page and try again"),Ox=function(e){var t=e.appName,n=void 0===t?"AppName":t,r=e.Logo,o=void 0===r?Ax:r,i=e.className,a=e.style,l=e.sx,c=e.buttonLabel,u=void 0===c?"Reload page":c,s=e.contentLabel,d=void 0===s?jx:s,m=e.onButtonClick,p=void 0===m?Dx:m,h=Tx().classes;return f.createElement(mx,null,f.createElement(j,{className:Eo(h.root,i),style:a,sx:l},f.createElement(qE,{className:h.reveal},f.createElement(ke,{className:h.container},f.createElement(we,{direction:"column",gap:"15px"},f.createElement(o,{appName:n}),f.createElement("span",null,d),f.createElement(ye,{variant:"contained",onClick:p},u))))))},Fx=function(e){var t=e.appName;return f.createElement(_,{variant:"h2",color:"primary",width:"100%",textAlign:"center",fontWeight:"bold",sx:{textStroke:"2px #fff",WebkitTextStroke:"2px #fff"}},t)},_x=An()(function(e){return{root:{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:9999,background:e.palette.background.default,height:"100%",width:"100%",display:"flex",alignItems:"center",flexDirection:"column",gap:15,padding:15},container:{minWidth:375,maxWidth:375,padding:15},reveal:{width:"unset !important"},beforeSubmit:{width:"100%",display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *":{flex:1},marginBottom:"-10px"},afterSubmit:{width:"100%",display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *":{flex:1},marginTop:"-10px"}}}),Bx=[{type:Dn.Text,fieldRightMargin:"0",fieldBottomMargin:"1",title:"Login",name:"login",description:"Your login",placeholder:"tripolskypetr",isInvalid:function(e){return e.login?null:"Login should not be empty"}},{type:Dn.Text,fieldRightMargin:"0",fieldBottomMargin:"0",title:"Password",name:"password",description:"Your password",placeholder:"password",inputType:"password",isInvalid:function(e){return e.password?null:"Password should not be empty"}}],Hx=function(r){var o=r.className,i=r.style,a=r.sx,l=r.appName,c=void 0===l?"AppName":l,u=r.Logo,s=void 0===u?Fx:u,d=r.fields,m=void 0===d?Bx:d,p=r.onLoadStart,h=r.onLoadEnd,v=r.throwError,b=r.handler,y=r.fallback,w=r.isBaseline,E=r.isBaselineForRoot,x=r.onAuth,C=void 0===x?function(){}:x,k=r.BeforeSubmit,S=r.AfterSubmit,L=_x().classes,N=to(function(e){return t(void 0,void 0,void 0,function(){var t,r;return n(this,function(n){switch(n.label){case 0:if(!e)return[2];t=!0,n.label=1;case 1:return n.trys.push([1,3,4,5]),p&&p(),[4,C(e)];case 2:return n.sent(),[3,5];case 3:if(r=n.sent(),t=!1,v)throw r;return y&&y(r),[3,5];case 4:return h&&h(t),[7];case 5:return[2]}})})});return f.createElement(mx,null,f.createElement(j,{className:Eo(L.root,o),style:i,sx:a},f.createElement(qE,{className:L.reveal},f.createElement(ke,{className:L.container},f.createElement(we,{direction:"column",gap:"15px"},f.createElement(s,{appName:c}),f.createElement(function(){var r=e(g(null),2),o=r[0],i=r[1];return f.createElement(f.Fragment,null,f.createElement(bf,{sx:{pt:1,pb:1},handler:b,fields:m,onChange:function(e){i(e)},onInvalid:function(){i(null)},onLoadStart:p,onLoadEnd:h,fallback:y,isBaseline:w,isBaselineForRoot:E}),k&&f.createElement("div",{className:L.beforeSubmit},f.createElement(k,{data:o,onAuth:N})),f.createElement(ui,{disabled:!o,variant:"contained",onClick:function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,N(o)];case 1:return[2,e.sent()]}})})},onLoadStart:p,onLoadEnd:h,fallback:y},"Sign in"),S&&f.createElement("div",{className:L.afterSubmit},f.createElement(S,{data:o,onAuth:N})))},null))))))},Wx=p(null),zx=function(e){var t=e.children,n=e.value;return f.createElement(Wx.Provider,{value:n},t)},Vx=function(){return v(Wx)},Yx=p(null),Ux=function(e){var t=e.value,n=e.children;return f.createElement(Yx.Provider,{value:t},n)},qx=function(){return v(Yx)},$x=p(null),Xx=function(e){var t=e.children,n=e.value,r=Or(n);return f.createElement($x.Provider,{value:r},t)},Gx=function(){return v($x)},Kx=p(null),Qx=function(t){var n=t.children,o=Vx(),i=o.state,a=o.action,l=e(g(function(){return new Map}),2),c=l[0],u=l[1],s=to(function(e){var t=new Set(i.selectedIds),n=new Map(c);t.has(e)?(t.delete(e),n.delete(e)):(t.add(e),n.set(e,i.items.find(function(t){return t.id===e}))),a.setSelectedIds(t),u(n)}),d=to(function(){a.setSelectedIds(new Set),u(new Map)}),m=h(function(){return{selectedItems:r([],e(c.values()),!1),toggleSelection:s,dropSelection:d}},[c]);return f.createElement(Kx.Provider,{value:m},n)},Jx=function(){return v(Kx)},Zx=An()({root:{display:"flex",alignItems:"center",justifyContent:"stretch",maxWidth:"100%",overflowY:"auto",gap:15},operations:{flex:1},disabled:{pointerEvents:"none",opacity:.5}}),eC=function(t){var n,r=t.className,o=t.style,i=t.sx,c=t.disabled,u=e(g(!1),2),s=u[0],d=u[1],m=Zx().classes,p=Vx(),h=p.state,v=p.action,b=Jx().selectedItems,y=Gx(),w=qx(),E=w.operations,x=void 0===E?[]:E,C=w.fallback,k=w.onLoadStart,S=void 0===k?function(){}:k,L=w.onLoadEnd,N=void 0===L?function(){}:L,I=w.onOperation,M=void 0===I?function(){}:I,R=w.throwError,P=void 0!==R&&R;return f.createElement(j,{className:Eo(m.root,r),style:o,sx:i},f.createElement(aw,{className:Eo(m.operations,(n={},n[m.disabled]=c,n)),actions:x.map(function(e){var t=e.isAvailable,n=void 0===t?function(){return!0}:t,r=l(e,["isAvailable"]);return a({isAvailable:function(){return n(b,h.isAllSelected,y)}},r)}),deps:[y,b,h.isAllSelected],onAction:function(e){return M(e,b,h.isAllSelected)},onLoadStart:function(){d(!0),S()},onLoadEnd:function(e){d(!1),N(e)},fallback:C,throwError:P}),f.createElement(ge,{disabled:s||c,control:f.createElement(ve,{disabled:s,value:h.isAllSelected,onChange:function(){return v.setIsAllSelected(!h.isAllSelected)}}),label:"All items"}))},tC=An()(function(e){return{root:{display:"flex",alignItems:"stretch",justifyContent:"stretch",minHeight:225},container:{flex:1,position:"relative",overflow:"hidden",display:"flex",alignItems:"stretch",justifyContent:"stretch",paddingTop:5,paddingBottom:5,marginBottom:5,paddingLeft:15,paddingRight:15},header:{position:"absolute",top:0,left:0,right:0,height:45,width:"100%",background:ae(e.palette.background.paper,.06),display:"flex",alignItems:"center",justifyContent:"stretch"},content:{flex:1,display:"flex",flexDirection:"column",alignItems:"stretch"},inner:{display:"grid",gridRowGap:"10px",gridColumnGap:"10px",paddingTop:45,paddingBottom:15},innerPhone:{gridTemplateColumns:"1fr"},innerTablet:{gridTemplateColumns:"1fr 1fr"},innerDesktop:{gridTemplateColumns:"1fr 1fr 1fr"},media:{width:"100%"},mediaPhone:{gridColumnStart:1,gridColumnEnd:2},mediaTablet:{gridColumnStart:1,gridColumnEnd:3},mediaDesktop:{gridColumnStart:1,gridColumnEnd:4},textWrap:{whiteSpace:"break-spaces",overflowWrap:"break-word",textOverflow:"ellipsis",fontWeight:"bold"},titleLabel:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"calc(100% - 80px)"},opacity:{opacity:.6},stretch:{flex:1}}}),nC=x(function(t,n){var o,i,c=t.item,u=t.className,s=t.style,d=t.sx,m=l(t,["item","className","style","sx"]),p=tC().classes,v=Vx(),g=v.state,b=v.action,w=Gx(),E=qx(),x=E.cardActions,C=E.pickFields,k=E.fallback,S=E.onLoadStart,L=E.onLoadEnd,N=E.formatMedia,I=void 0===N?function(){}:N,M=E.formatKey,R=void 0===M?function(t){return function(t){var n=e(t.split("_")),o=n[0],i=n.slice(1);return r(["".concat(o.charAt(0).toUpperCase()).concat(o.slice(1))],e(i),!1).join(" ")}(String(t))}:M,P=E.formatValue,A=void 0===P?function(e,t){return null==(n=t)||void 0===n||""===n||"null"===n?"—":"boolean"==typeof n?String(n):n.toString().startsWith("http")?f.createElement("a",{href:n.toString(),target:"_blank",rel:"noreferrer",style:{wordBreak:"break-all"}},n):f.isValidElement(n)?n:_n(n)?f.createElement("pre",null,JSON.stringify(n,null,2)):n;var n}:P,T=E.formatCardLabel,D=void 0===T?function(e){var t=e.id;return"Id: ".concat(t)}:T,O=E.onCardClick,F=void 0===O?function(){}:O,B=E.onAction,H=void 0===B?function(){}:B,W=E.throwError,z=void 0!==W&&W,V=tl(),Y=V.isPhone,U=V.isTablet,q=V.isDesktop,$=Jx().toggleSelection,X=h(function(){var t=Object.entries(c);return C&&t.filter(function(t){var n=e(t,1)[0];return C.includes(n)}),t},[C]),G=h(function(){return I(c)},[c]),K=y(function(){g.menuOpened||F(c)},[g,c,F]);return f.createElement(j,a({ref:n,className:Eo(u,p.root),style:s,sx:d},m),f.createElement(ke,{className:Eo(p.container)},f.createElement(j,{className:p.header},f.createElement(ve,{onClick:function(){return $(c.id)},checked:g.selectedIds.has(c.id)}),f.createElement(_,{className:p.titleLabel,variant:"body1"},D(c)),f.createElement("div",{className:p.stretch}),!!(null==x?void 0:x.length)&&f.createElement(xa,{transparent:!0,options:x.map(function(e){var t=e.isDisabled,n=void 0===t?function(){return!1}:t,r=e.isVisible,o=void 0===r?function(){return!0}:r,i=l(e,["isDisabled","isVisible"]);return a(a({},i),{isVisible:function(){return o(c,w)},isDisabled:function(){return n(c,w)}})}),onToggle:b.setMenuOpened,onAction:function(e){return H(e,c)},fallback:k,payload:c,onLoadStart:S,onLoadEnd:L,throwError:z,sx:{color:"inherit"},deps:[w]})),f.createElement(j,{className:p.content,onClick:K},f.createElement(j,{className:Eo(p.inner,(o={},o[p.innerPhone]=Y,o[p.innerTablet]=U,o[p.innerDesktop]=q,o))},!!G&&f.createElement(j,{className:Eo(p.media,(i={},i[p.mediaPhone]=Y,i[p.mediaTablet]=U,i[p.mediaDesktop]=q,i))},G),X.map(function(t,n){var r=e(t,2),o=r[0],i=r[1];return f.createElement(we,{className:p.textWrap,key:"".concat(o,"-").concat(n)},f.createElement(_,{className:p.opacity,variant:"caption"},R(o)),f.createElement(_,{variant:"body1"},A(o,i)))})))))}),rC=An()({root:{display:"flex",alignItems:"center",gap:10,minHeight:35,maxHeight:35}}),oC=function(){var e=rC().classes,t=Vx().state,n=Jx().dropSelection;return f.createElement(j,{className:e.root},!!t.selectedIds.size&&f.createElement(f.Fragment,null,f.createElement(_,{variant:"body1"},"Selected: ".concat(vm(t.selectedIds.size,{one:"item",many:"items"}))),f.createElement(Qt,{href:"#",onClick:n},"Deselect")))},iC=function(t){var n=t.disabled,r=Vx(),o=r.state,i=r.action,l=e(g(o.search),2),c=l[0],u=l[1],s=Xr(c),d=ub();return w(function(){var e=Jn(function(e){i.setSearch(e)},1e3),t=s.subscribe(e);return function(){e.clear(),t()}},[s]),f.createElement(xe,a({variant:"standard",onChange:function(e){var t=e.target;return u(t.value.toString())},disabled:n,value:c,placeholder:"Search",InputProps:{autoComplete:"off",endAdornment:f.createElement(Le,{position:"end"},f.createElement("div",{style:{marginRight:-10}},f.createElement(Ne,{onClick:function(){return!o.loading&&u("")}},o.search&&!o.loading?f.createElement(Fe,null):o.loading?null:f.createElement(ot,null),o.loading&&f.createElement(O,{size:24}))))},name:"search",type:"text"},d))},aC=An()({root:{position:"relative",display:"flex",flexDirection:"column",alignItems:"stretch",justifyContent:"stretch",width:"100%"},container:{flex:1,display:"flex",flexDirection:"column",alignItems:"stretch",justifyContent:"stretch",gap:5},content:{flex:1},placeholder:{display:"flex",justifyContent:"center"}}),lC=function(o){var i=o.className,l=o.style,u=o.sx,s=o.operations,d=o.handler,m=o.reloadSubject,p=o.scrollXSubject,v=o.scrollYSubject,b=o.onLoadStart,E=o.onLoadEnd,x=o.fallback,C=o.skipStep,k=void 0===C?25:C,S=o.noSearch,L=void 0!==S&&S,N=o.noFooter,I=void 0!==N&&N,M=o.throwError,R=void 0!==M&&M,P=o.payload,A=aC().classes,T=e(g(function(){return{items:[],loading:!1,hasMore:!0,search:"",skip:0,isAllSelected:!1,menuOpened:!1,selectedIds:new Set}}),2),D=T[0],O=T[1],F=y(function(e){return O(function(t){return a(a({},t),{loading:e})})},[]),B=Fr(m),H=Fr(v),W=to(function(o){return t(void 0,void 0,void 0,function(){var t,i,l,u;return n(this,function(n){switch(n.label){case 0:if(D.loading)return[2];if(!D.hasMore&&!o)return[2];o&&(O(function(e){return a(a({},e),{items:[]})}),H.next(0)),t=!0,n.label=1;case 1:return n.trys.push([1,5,6,7]),b&&b(),F(!0),"function"!=typeof d?[3,3]:(i=o?0:D.skip,[4,d(D.search,i)]);case 2:return l=n.sent(),O(function(t){var n,o,u=new Map(t.items.map(function(e){return[e.id,e]}));try{for(var s=c(l),d=s.next();!d.done;d=s.next()){var f=d.value;u.has(f.id)&&u.set(f.id,f)}}catch(e){n={error:e}}finally{try{d&&!d.done&&(o=s.return)&&o.call(s)}finally{if(n)throw n.error}}var m=l.filter(function(e){var t=e.id;return!u.has(t)});return a(a({},t),{skip:i+k,hasMore:m.length>=k,items:r(r([],e(u.values()),!1),e(m),!1)})}),[3,4];case 3:O(function(e){return a(a({},e),{items:d,hasMore:!1})}),n.label=4;case 4:return[3,7];case 5:if(u=n.sent(),t=!1,R)throw u;return x&&x(u),[3,7];case 6:return E&&E(t),F(!1),[7];case 7:return[2]}})})});$r(function(){W(!0)},[D.search]),w(B.subscribe(function(){W(!0)}),[B]);var z=h(function(){return{state:D,action:{setSearch:function(e){return O(function(t){return a(a({},t),{skip:0,search:e})})},setIsAllSelected:function(e){return O(function(t){return a(a({},t),{isAllSelected:e})})},setSelectedIds:function(e){return O(function(t){return a(a({},t),{selectedIds:e})})},setMenuOpened:function(e){return O(function(t){return a(a({},t),{menuOpened:e})})}}}},[D]);return f.createElement(Ux,{value:o},f.createElement(Xx,{value:P},f.createElement(zx,{value:z},f.createElement(Qx,null,f.createElement(j,{className:Eo(i,A.root),style:l,sx:u},f.createElement(j,{className:A.container},!L&&f.createElement(iC,{disabled:D.loading}),!!(null==s?void 0:s.length)&&f.createElement(eC,{disabled:D.loading}),f.createElement(vi,{className:A.content,loading:D.loading,hasMore:D.hasMore,onDataRequest:W,scrollXSubject:p,scrollYSubject:H,minRowHeight:225},!D.items.length&&f.createElement(_,{className:A.placeholder},D.loading?"Loading":"Nothing found"),D.items.map(function(e,t){return f.createElement(nC,{key:"".concat(e.id,"-").concat(t),item:e})})),!I&&f.createElement(oC,null)))))))},cC=(jE=e(Er(),2))[0],uC=jE[1],sC=Dw.createLoader(12),dC=An()(function(e){return{header:{display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column",paddingLeft:e.spacing(.5),paddingRight:e.spacing(.5)},row:{display:"flex",alignItems:"center",justifyContent:"space-between"},chip:{maxWidth:150}}}),fC=function(r){var o=r.id,i=r.payload,a=r.column,l=r.columns,c=r.data,u=r.disabled,s=r.reloadSubject,d=r.withGoBack,m=r.withHeaderTooltip,p=r.label,v=void 0===p?a:p,b=r.onChangeColumn,E=r.onCardLabelClick,x=r.fallback,C=r.onLoadEnd,k=r.onLoadStart,S=r.throwError,L=dC().classes,N=uC(),I=Qr(),M=I.reloadTrigger,R=I.doReload,P=e(kc(function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,N(o,function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return"function"!=typeof v?[3,2]:[4,v(o,c,i)];case 1:return[2,e.sent()];case 2:return[2,v]}})})})];case 1:return[2,e.sent()]}})})},{onLoadStart:k,onLoadEnd:C,fallback:x,throwError:S,deps:[c,a,M]}),1),A=P[0];w(function(){return s.subscribe(R)},[]);var T=e(g(null),2),D=T[0],O=T[1],F=e(g(null),2),_=F[0],H=F[1],z=h(function(){var e=l.findIndex(function(e){return e.column===a});return l.filter(function(t,n){return n<e}).reverse()},[a]),V=h(function(){var e=l.findIndex(function(e){return e.column===a});return l.filter(function(t,n){return n>e})},[a]),Y=y(function(){return null===A?f.createElement(sC,null):m?f.createElement(Nt,{title:A},f.createElement(He,{className:L.chip,color:"primary",onClick:E?function(){return E(o,c,i)}:void 0,label:A})):f.createElement(He,{className:L.chip,color:"primary",onClick:E?function(){return E(o,c,i)}:void 0,label:A})},[A]);return f.createElement(j,{className:L.header},f.createElement(j,{className:L.row},f.createElement(Ne,{onClick:function(e){var t=e.currentTarget;O(t),H(null)},disabled:!d||!z.length||u,size:"small"},f.createElement(Xe,null)),f.createElement(W,{anchorEl:D,open:!!D,onClose:function(){return O(null)}},z.map(function(e,t){return f.createElement(B,{key:"".concat(e,"-").concat(t),onClick:function(){b(o,e.column,c,i),O(null)}},e.label||e.column)})),Y(),f.createElement(Ne,{onClick:function(e){var t=e.currentTarget;O(null),H(t)},disabled:!V.length||u,size:"small"},f.createElement(Ge,null)),f.createElement(W,{anchorEl:_,open:!!_,onClose:function(){return H(null)}},V.map(function(e,t){return f.createElement(B,{key:"".concat(e,"-").concat(t),onClick:function(){b(o,e.column,c,i),H(null)}},e.label||e.column)}))))},mC=An()(function(e){return{table:{display:"grid",gridTemplateColumns:"fit-content(130px) 1fr",maxWidth:"255px","& > *":{display:"flex",alignItems:"center",justifyContent:"stretch",whiteSpace:"nowrap",padding:5,borderBottom:"1px solid ".concat($(e.palette.getContrastText(e.palette.background.default),.23)),"& > *":{flex:1},overflow:"hidden"}},row:{display:"flex",alignItems:"center",justifyContent:"space-between"},noBorder:{border:"none !important"},bold:{fontWeight:"bold !important"},link:{color:e.palette.primary.main,cursor:"pointer",textDecoration:"underline"}}}),pC=function(e){var t=e.id,n=e.data,r=e.payload,o=e.rows,i=mC().classes;return f.createElement(j,{className:i.table},o.map(function(e,a){var l,c=Eo(((l={})[i.noBorder]=a===o.length-1,l));return f.createElement(f.Fragment,null,f.createElement(_,{className:c,paddingRight:"20px",variant:"body2"},e.label),function(e,o){var a=e.value,l=e.click;return l?f.createElement(_,{className:Eo(i.link,o),onClick:function(){return l(t,n,r)}},a):f.createElement(_,{className:Eo(i.bold,o)},a)}(e,c))}))},hC=(OE=e(Er(),2))[0],vC=OE[1],gC=An()(function(e){return{container:{position:"relative",display:"flex",alignItems:"stretch",justifyContent:"stretch",flex:1},content:{display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column",overflow:"hidden",paddingTop:e.spacing(.5),paddingBottom:e.spacing(.5),maxWidth:255,flex:1}}}),bC=function(r){var o=r.id,i=r.column,a=r.label,l=r.columns,c=r.reloadSubject,u=r.rows,s=r.withGoBack,d=r.withHeaderTooltip,m=r.data,p=r.fallback,h=r.onLoadEnd,v=r.onLoadStart,g=r.throwError,b=r.disabled,y=r.onChangeColumn,E=r.onCardLabelClick,x=r.payload,C=r.AfterCardContent,k=gC().classes,S=Qr(),L=S.reloadTrigger,N=S.doReload,I=vC(),M=e(kc(function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,I(o,m,u)];case 1:return[2,e.sent()]}})})},{onLoadStart:v,onLoadEnd:h,fallback:p,throwError:g,deps:[m,i,L]}),1),R=M[0];w(function(){return c.subscribe(N)},[]);return f.createElement(ke,{className:k.container},f.createElement(j,{className:k.content},R?f.createElement(f.Fragment,null,f.createElement(fC,{reloadSubject:c,withGoBack:s,withHeaderTooltip:d,id:o,column:i,data:m,columns:l,disabled:b,onChangeColumn:y,onCardLabelClick:E,onLoadStart:v,onLoadEnd:h,fallback:p,throwError:g,payload:x,label:a}),f.createElement(pC,{id:o,payload:x,rows:R,data:m}),C&&f.createElement(C,{id:o,data:m,payload:x})):f.createElement(Dw,{sx:{flex:1},size:48})))},yC=An()({root:{display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column"},stretch:{flex:1,display:"flex",alignItems:"stretch",justifyContent:"stretch"},adjust:{maxHeight:10,minHeight:10}}),wC=x(function(e,t){var n=e.className,r=e.style,o=e.disabled,i=e.id,c=e.onDrag,u=l(e,["className","style","disabled","id","onDrag"]),s=yC().classes;return f.createElement(j,{className:Eo(s.root,n),style:r,ref:t},f.createElement("div",{className:s.stretch,"data-cardid":i,onDrag:function(){o||c(i)},draggable:o?"false":"true"},f.createElement(bC,a({id:i,disabled:o},u))),f.createElement("div",{className:s.adjust}))}),EC=Symbol("never"),xC=function(t,n){var o=void 0===n?{}:n,i=o.key,a=void 0===i?function(){return EC}:i,l=o.timeout,u=void 0===l?250:l,s=Bi(a,function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];return{value:t.apply(void 0,r([],e(n),!1)),ttl:Date.now()}}),d=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=Date.now(),i=s.apply(void 0,r([],e(t),!1)),l=i.value;if(o-i.ttl>u){var c=a(t);return s.clear(c),d.apply(void 0,r([],e(t),!1))}return l};return d.clear=function(e){s.clear(e)},d.gc=function(){var t,n,r=s[_i]();try{for(var o=c(r.entries()),i=o.next();!i.done;i=o.next()){var a=e(i.value,2),l=a[0],d=a[1];Date.now()-d.current.ttl>u&&s.clear(l)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}},d.add=function(e,t){return s.add(e,{value:t,ttl:Date.now()})},d.remove=s.remove,d},CC=An()(function(e){var t;return{root:(t={display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column",minHeight:"100%",width:"100%"},t["& .".concat(em)]={"& > div > div":{marginBottom:e.spacing(2)}},t),container:{position:"relative",flex:1,display:"flex",alignItems:"stretch",justifyContent:"stretch"},content:{flex:1,display:"flex"},group:{position:"relative",overflow:"hidden",display:"flex",alignItems:"stretch",justifyContent:"stretch",maxWidth:"276px",minWidth:"276px",marginRight:10,borderRadius:"6px"},groupWrapper:{flex:1,padding:10,marginTop:45},groupHeader:{position:"absolute",paddingLeft:12,top:0,left:0,height:"45px",width:"100%",background:e.palette.background.paper,display:"flex",alignItems:"center",justifyContent:"stretch",gap:8},activeGroup:{background:"".concat(e.palette.primary.main," !important")},list:{flex:1,minWidth:"256px",height:"100%"},disabled:{pointerEvents:"none",cursor:"not-allowed"},divider:{padding:"2.5px",marginRight:"15px",marginLeft:"5px",background:e.palette.action.hover}}}),kC=function(o,i){var u,s=o.reloadSubject,d=o.withUpdateOrder,m=o.columns,p=o.className,v=o.payload,y=void 0===v?{}:v,E=o.disabled,x=void 0!==E&&E,C=o.items,k=o.style,S=o.sx,L=o.deps,N=void 0===L?[]:L,I=o.withGoBack,R=void 0!==I&&I,P=o.withHeaderTooltip,A=void 0!==P&&P,T=o.filterFn,D=void 0===T?function(){return!0}:T,O=o.cardLabel,F=void 0===O?function(e){return e}:O,B=o.bufferSize,H=void 0===B?15:B,W=o.minRowHeight,z=void 0===W?125:W,V=o.rowTtl,Y=void 0===V?500:V,U=o.AfterCardContent,q=o.AfterColumnTitle,X=o.BeforeColumnTitle,G=o.onDataRequest,K=o.onChangeColumn,Q=o.onCardLabelClick,J=o.onLoadStart,Z=o.onLoadEnd,ee=o.fallback,te=o.throwError,ne=Fr(s),re=bi(),oe=re.elementRef,ie=re.size,le=e(g(null),2),ce=le[0],ue=le[1],se=b(null),de=CC().classes,fe=M(),me=Or(y),pe=Or(m),he=h(function(){return pe.filter(function(e){return!e.divider})},[pe]),ve=h(function(){return xC(function(e,r,o){return t(void 0,void 0,void 0,function(){return n(this,function(i){switch(i.label){case 0:return[4,Promise.all(o.map(function(o){return t(void 0,void 0,void 0,function(){var t,i,c,u,s=o.value,d=o.visible,f=l(o,["value","visible"]);return n(this,function(n){switch(n.label){case 0:return"function"!=typeof d?[3,2]:[4,d(e,r,me)];case 1:return i=n.sent(),[3,3];case 2:i=void 0===d||!!d,n.label=3;case 3:return(t=i)?"function"!=typeof s?[3,5]:[4,s(e,r,me)]:[3,7];case 4:return u=n.sent(),[3,6];case 5:u=s,n.label=6;case 6:return c=u,[3,8];case 7:c=void 0,n.label=8;case 8:return[2,a({visible:t,value:c},f)]}})})}))];case 1:return[2,i.sent().filter(function(e){return e.visible})]}})})},{key:function(t){return e(t,1)[0]},timeout:Y})},[]),ge=h(function(){return xC(function(e,r){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,r()];case 1:return[2,e.sent()]}})})},{key:function(t){return e(t,1)[0]},timeout:Y})},[]);w(function(){G&&G(!0)},[]),w(function(){return mr.fromEvent("visibilitychange").connect(function(){"visible"===document.visibilityState&&G&&G(!1)})},[]),w(function(){return mr.fromInterval(45e3).connect(function(){ve.gc(),ge.gc()})},[]),w(function(){return ne.subscribe(function(){ve.clear(),ge.clear()})},[]);var be=h(function(){var e,t,n=new Map,r=C.filter(D);d&&r.sort(function(e,t){var n=e.updatedAt,r=void 0===n?kl():n,o=t.updatedAt,i=void 0===o?kl():o;return Ue(r).isBefore(i)?1:-1});var o=function(e){var t=r.filter(function(t){return t.column===e});n.set(e,t)};try{for(var i=c(he),a=i.next();!a.done;a=i.next()){o(a.value.column)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return n},r([C],e(N),!1));w(function(){ve.clear(),ge.clear()},r([be],e(N),!1));var ye=h(function(){return he.map(function(e){return e.column})},[]),we=h(function(){return"dark"===fe.palette.mode?ae(fe.palette.background.paper,.06):$("#000",.1)},[]);return f.createElement(hC,{payload:ve},f.createElement(cC,{payload:ge},f.createElement(j,{ref:i,className:Eo(de.root,p,(u={},u[de.disabled]=x,u)),style:k,sx:S},f.createElement(j,{ref:oe,className:de.container},f.createElement(nm,{withScrollbar:!0,hideOverflowY:!0,className:de.content},pe.map(function(t,n){var o,i,c=t.divider,u=l(t,["divider"]);if(c)return f.createElement(j,{key:"divider-".concat(n),className:Eo("react-declarative__kanbanDivider",de.divider),sx:{height:ie.height}});var s=u,d=s.column,m=s.rows,p=s.label,h=s.color,v=void 0===h?we:h,g=be.get(d)||[];return f.createElement(j,{key:"".concat(d,"-").concat(n),onDrop:function(){var e=C.find(function(e){return e.id===se.current});if(e){var t=ye.indexOf(e.column),n=ye.indexOf(d),r=!0;if(r=(r=r&&!R)&&t>n)return;if(t===n)return;ue(null),ge.clear(se.current),ve.clear(se.current),K&&K(se.current,d,e.data,me),se.current=null}},onDragEnd:function(){ue(null)},onDragOver:function(e){ue(d),e.preventDefault()},className:de.group},f.createElement(j,{className:de.groupHeader},f.createElement(j,{className:Eo((o={},o[de.activeGroup]=ce===d,o)),sx:{borderRadius:"50%",height:"12px",width:"12px",background:v}}),X&&f.createElement(X,{column:d,payload:me}),f.createElement(_,{variant:"h6",fontWeight:"bold",sx:{opacity:.6,fontSize:"16px",flex:1}},p||String(d)),q&&f.createElement(q,{column:d,payload:me})),f.createElement(j,{className:Eo(de.groupWrapper,(i={},i[de.activeGroup]=ce===d,i)),sx:{background:v}},f.createElement(vi,{bufferSize:H,className:de.list,minRowHeight:z},g.map(function(t){return f.createElement(wC,a({reloadSubject:ne,withGoBack:R,withHeaderTooltip:A,payload:me,key:t.id,onChangeColumn:function(t){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];ge.clear(t),ve.clear(t),K&&K.apply(void 0,r([t],e(n),!1))},onDrag:function(){se.current=t.id},disabled:x,columns:he,rows:m,label:t.label||F,AfterCardContent:U,onCardLabelClick:Q,onLoadStart:J,onLoadEnd:Z,fallback:ee,throwError:te},t))}))))}))))))};kC.enableScrollOnDrag=function(e,t){var n=void 0===t?{}:t,r=n.threshold,o=void 0===r?200:r,i=n.speed,a=void 0===i?15:i;return function(){var t,n=null===(t=e.current)||void 0===t?void 0:t.querySelector(".".concat(em));if(!n)return console.warn("KanbanViewInternal enableScrollOnDrag ref is undefined"),function(){};var r=!1,i=0,l=mr.create(function(e){return document.addEventListener("dragover",e),function(){return document.removeEventListener("dragover",e)}}),c=mr.create(function(e){var t=function(t){return void 0===t&&(t=!0),function(){return e(t)}},n=t(!1),r=t(!0);return document.body.addEventListener("dragstart",r),document.body.addEventListener("dragend",n),function(){document.body.removeEventListener("dragend",n),document.body.removeEventListener("dragstart",r)}}),u=mr.create(function(e){var t=null,l=function(){if(r){var t=n.getBoundingClientRect(),l=t.left,c=t.right;i<l+o?e(Math.max(n.scrollLeft-a,0)):i>c-o&&e(n.scrollLeft+a)}},u=c.connect(function(e){t&&clearInterval(t),e&&(t=setInterval(l,10))});return Un(function(){return t&&clearInterval(t)},u)}),s=l.connect(function(e){i=e.clientX}),d=c.connect(function(e){r=e}),f=mr.create(function(e){return document.addEventListener("touchstart",e,{passive:!0}),function(){return document.removeEventListener("touchstart",e)}}),m=u.connect(function(e){n.scrollLeft=e}),p=Un(s,d,m),h=f.connect(p);return Un(p,h)}};var SC=x(kC);SC.enableScrollOnDrag=kC.enableScrollOnDrag;var LC,NC=function(t){function n(){var n=t.apply(this,r([],e(arguments),!1))||this;return n.doSubscribe=function(){n._disconnectListener&&n._disconnectListener(),n._disconnectListener=n.props.reloadTrigger.subscribe(function(){n.forceUpdate()})},n.componentDidMount=function(){n.doSubscribe()},n.componentDidUpdate=function(){n.doSubscribe()},n.componentWillUnmount=function(){n._disconnectListener&&n._disconnectListener()},n.render=function(){return f.createElement(f.Fragment,null,n.props.children)},n}return u(n,t),n}(f.Component);!function(e){e.Boolean="boolean-feature",e.Number="number-feature"}(LC||(LC={}));var IC,MC,RC=LC,PC=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return e.some(function(e){return e instanceof Promise})?new Promise(function(r,o){return t(void 0,void 0,void 0,function(){var t,i,a;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,Promise.all(e)];case 1:return t=n.sent(),i=t.reduce(function(e,t){return Boolean(e||t)},!1),r(i),[3,3];case 2:return a=n.sent(),o(a),[3,3];case 3:return[2]}})})}):e.reduce(function(e,t){return Boolean(e||t)},!1)},AC=function(e,t){var n=t.defaultValue,r=t.label,o=t.name,i=t.isDisabled,a=void 0===i?function(){return!1}:i,l=t.isVisible,c=t.map;return e===RC.Number?{type:Dn.Div,style:{display:"inline-grid",gridTemplateColumns:"1fr 58px",alignItems:"center",width:"100%"},fields:[{type:Dn.Component,element:function(e){return f.createElement(_,{variant:"body1",style:{opacity:e.payload.readonly||e[o]?1:.5}},r)}},{type:Dn.Text,fieldRightMargin:"0",fieldBottomMargin:"0",sx:{"& input":{fontWeight:"bold",textAlign:"center"}},isInvalid:function(e){return""===e[o]?"Required":null},inputFormatterAllowed:/^[0-9]/,inputFormatterTemplate:"00000",name:o,placeholder:"0",defaultValue:n,title:""}]}:{type:Dn.Div,style:{display:"inline-grid",gridTemplateColumns:"1fr auto",alignItems:"center",width:"100%"},fields:[{type:Dn.Component,element:function(e){return f.createElement(_,{variant:"body1",style:{opacity:e.payload.readonly||e[o]?1:.5}},r)}},{type:Dn.Switch,defaultValue:n,isDisabled:function(e,t){return PC(a(e,t),t.readonly)},isVisible:l,map:c,name:o,fieldRightMargin:"0",title:"",fieldBottomMargin:"0"}]}},TC=function(e,t){return void 0===t&&(t=!1),e.map(function(e){var n=e.title,r=e.expanded,o=void 0!==r&&r,i=e.children,l=e.isVisible,c=e.isDisabled;return{type:Dn.Expansion,fieldRightMargin:"0",fieldBottomMargin:"1",expansionOpened:o||t,isVisible:l,isDisabled:c,title:n,fields:i.flatMap(function(e,t){var n=e.type,r=void 0===n?RC.Boolean:n,o=e.name,l=e.defaultValue,c=void 0!==l&&l,u=e.description,s=void 0===u?o:u,d=e.label,m=void 0===d?o:d,p=e.isDisabled,h=void 0===p?function(){return!1}:p,v=e.isVisible,g=void 0===v?function(){return!0}:v,b=e.map;return{type:Dn.Box,sx:a(a(a(a(a({},t%2==0&&{background:function(e){return $(e.palette.getContrastText(e.palette.background.paper),.04)}}),{marginLeft:"-16px",marginRight:"-16px",paddingLeft:"16px",paddingRight:"8px"}),t===i.length-1&&{marginBottom:"-16px"}),t===i.length-1&&1===i.length?{paddingBottom:"16px"}:{paddingBottom:"4px"}),{width:"calc(100% + 32px) !important"}),fields:[AC(r,{label:m,name:o,defaultValue:c,isDisabled:h,isVisible:g,map:b}),{type:Dn.Component,element:function(e){return f.createElement(_,{variant:"subtitle2",sx:{opacity:e.payload.readonly||e[o]?.5:.2}},s)}}]}})}})},DC=function(t){var n=t.changeSubject,r=t.outlinePaper,o=t.transparentPaper,i=t.className,l=t.style,c=t.sx,u=t.data,s=t.readonly,d=t.features,m=t.expandAll,p=t.onChange,v=h(function(){return TC(d,m)},[]),g=h(function(){return u?u.reduce(function(e,t){var n;return a(a({},e),((n={})[t]=!0,n))},{}):{}},[u]),b=y(function(){return g},[u]),w=y(function(t,n){if(t&&!n){var r=Object.entries(t).filter(function(t){var n=e(t,2);return n[0],!!n[1]}).map(function(t){return e(t,1)[0]});p&&p(r)}},[]);return f.createElement(bf,{changeSubject:n,className:i,style:l,sx:c,outlinePaper:r,transparentPaper:o,handler:b,change:w,fields:v,readonly:s,payload:{readonly:s}})},jC=function(r){var o=r.data,i=r.title,l=r.features,c=r.expandAll,u=r.readonly,s=r.fullScreen,d=r.fallback,f=r.onLoadStart,m=r.onLoadEnd,p=r.onSubmit,h=r.onChange,v=r.submitLabel,g=r.withActionButton,b=void 0===g||g,y=r.withStaticAction;return og({title:i,withStaticAction:void 0!==y&&y,withActionButton:b,fullScreen:s,fallback:d,onLoadStart:f,onLoadEnd:m,handler:function(){return o?o.reduce(function(e,t){var n;return a(a({},e),((n={})[t]=!0,n))},{}):{}},onSubmit:function(r){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return r?(t=Object.entries(r).filter(function(t){var n=e(t,2);return n[0],!!n[1]}).map(function(t){return e(t,1)[0]}),p?[4,p(t)]:[3,2]):[3,2];case 1:return[2,n.sent()];case 2:return[2,!0]}})})},onChange:function(t,n){if(t&&!n){var r=Object.entries(t).filter(function(t){var n=e(t,2);return n[0],!!n[1]}).map(function(t){return e(t,1)[0]});h&&h(r)}},submitLabel:v,outlinePaper:!0,payload:{readonly:u},fields:TC(l,c)})},OC=(IC=e(hl(),2))[0],FC=IC[1],_C=(MC=e(Er(),2))[0],BC=MC[1];var HC=An()(function(e){return{container:{height:"100%",width:"100%",display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column"},stretch:{flex:1},disabled:{pointerEvents:"none",opacity:.5},monthLabel:{textAlign:"center"},noBorder:{border:"0"},arrows:{padding:"5px",color:e.palette.text.secondary},header:{display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"5px"},content:{flex:1,display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gridGap:"15px",button:{color:e.palette.text.primary}}}}),WC=function(t){var n=t.date,r=t.minDate,o=t.maxDate,i=t.onChange,a=e(g(n.get("year")),2),l=a[0],c=a[1],u=(()=>{const e=[],t=Ue().startOf("year");for(let n=0;12!==n;n++)e.push(t.clone().add(n,"months"));return e})().map(function(e){return e.get("month")}),s=(()=>{const e=Ue.localeData(),t=e.months();return(e.monthsShort()||t).map(e=>`${e.slice(0,1).toUpperCase()}${e.slice(1,3)}`)})(),d=HC().classes,m=y(function(e){var t=n.clone().set("month",e);t=t.set("year",l),n&&o.isBefore(n)?i(o.clone()):n&&r.isAfter(n)?i(r.clone()):i(t)},[l,n,o,r,i]);return f.createElement("div",{className:d.container},f.createElement("div",{className:d.header},f.createElement(Ne,{className:d.noBorder,onClick:function(){var e=l-1;e>=r.get("year")&&c(e)}},f.createElement(hn,{className:d.arrows})),f.createElement(_,{className:Eo(d.monthLabel,d.stretch)},l),f.createElement(Ne,{className:d.noBorder,onClick:function(){var e=l+1;e<=o.get("year")&&c(e)}},f.createElement(vn,{className:d.arrows}))),f.createElement("div",{className:d.content},u.map(function(e){var t,n=o.get("month")<e&&o.get("year")===l||r.get("month")>e&&r.get("year")===l;return f.createElement(ye,{key:e,className:Eo((t={},t[d.disabled]=n,t)),onClick:function(){return m(e)}},s[e])})))};var zC=An()(function(e){return{container:{height:"100%",width:"100%",display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column"},stretch:{flex:1},yearLabel:{textAlign:"center"},noBorder:{border:"0"},arrows:{padding:"5px",border:"0",color:e.palette.text.disabled},header:{display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"5px"},content:{flex:1,display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gridGap:"15px",button:{color:e.palette.text.primary}}}}),VC=function(t){var n=t.date,o=t.minDate,i=t.maxDate,a=t.onChange,l=n.get("year"),c=h(function(){return((e,t)=>{const n=t.diff(e,"years")+1,r=[];for(let t=0;t!==n;t++)r.push(e.clone().add(t,"years"));return r})(o,i).map(function(e){return e.get("year")}).reduce(function(t,n){var o=e(t.slice().reverse(),1)[0];return o.push(n),12===o.length?r(r([],e(t),!1),[[]],!1):t},[[]])},[o,i]),u=e(g(c.findIndex(function(e){return e.includes(l)})),2),s=u[0],d=u[1],m=y(function(e){var t=n.clone().set("year",e);n&&i.isBefore(n)?a(i.clone()):n&&o.isAfter(n)?a(o.clone()):a(t)},[n,i,o,a]),p=c[s]||[],v=zC().classes;return f.createElement("div",{className:v.container},f.createElement("div",{className:v.header},f.createElement(ye,{className:v.noBorder,variant:"text",onClick:function(){d(Math.max(s-1,0))}},f.createElement(hn,{className:v.arrows})),f.createElement(_,{className:Eo(v.yearLabel,v.stretch)},n.format("YYYY")),f.createElement(ye,{className:v.noBorder,variant:"text",onClick:function(){var e=s+1;e<c.length&&d(e)}},f.createElement(vn,{className:v.arrows}))),f.createElement("div",{className:v.content},p.map(function(e){var t=e===l;return f.createElement(ye,{key:e,color:t?"primary":"secondary",onClick:function(){return m(e)}},e)})))};Ue.extend(pn),Ue.extend(gn);var YC=function(e,t){return void 0===e&&(e=Ue().tz("Europe/London")),void 0===t&&(t="day"),Math.floor(Cl(e).diff(kl(),t,!0))},UC=function(e,t){return void 0===t&&(t="day"),xl(kl().add(e,t))},qC=An()(function(e){return{switchHeader:{display:"flex",justifyContent:"space-between",overflowY:"auto",alignItems:"center",margin:"5px 0 10px"},daysHeader:{display:"flex",justifyContent:"stretch",alignItems:"stretch",height:"35px"},monthName:{display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",fontSize:"14px",button:{padding:"5px",color:e.palette.text.primary}},dayLabel:{flex:1,textAlign:"center",opacity:.5},dayLabelStart:{textAlign:"center"},dayLabelEnd:{textAlign:"center"},noBorder:{border:"0"}}}),$C=function(e){var t=e.currentMonth,n=e.onMonthChange,r=e.onHeaderMonthClick,o=e.onHeaderYearClick,i=BC(),a=i.AfterCalendarHeader,l=i.BeforeCalendarHeader,c=i.payload,u=qC().classes,s=h(function(){return YC(t.clone().startOf("week"))},[]),d=h(function(){return YC(t.clone().endOf("month").endOf("week"))},[]);return f.createElement("div",null,f.createElement("div",{className:u.switchHeader},f.createElement(Ne,{onClick:function(){return n(t.clone().subtract(1,"months"))}},f.createElement(Xe,null)),f.createElement(_,{className:u.monthName},l&&f.createElement(l,{fromStamp:s,toStamp:d,payload:c}),f.createElement(ye,{onClick:r,className:Eo(u.noBorder)},t.format("MMMM")),f.createElement(ye,{onClick:o,className:Eo(u.noBorder)},t.format("YYYY")),a&&f.createElement(a,{fromStamp:s,toStamp:d,payload:c})),f.createElement(Ne,{className:u.noBorder,onClick:function(){return n(t.clone().add(1,"months"))}},f.createElement(Ge,null))),f.createElement("div",{className:u.daysHeader},(()=>{const e=Ue.localeData(),t=e.weekdays(),n=e.weekdaysShort(),{weekStart:r=0}=Ue.Ls[Ue.locale()],o=n||t;return[...o.slice(r,7),...o.slice(0,r)].map(e=>`${e.slice(0,1).toUpperCase()}${e.slice(1,3)}`)})().map(function(e,t){var n;return f.createElement(_,{key:t,className:Eo(u.dayLabel,(n={},n[u.dayLabelStart]=0===t,n[u.dayLabelEnd]=6===t,n))},e)})))};const XC=e=>e.isToday();var GC=An()(function(e){return{buttonAccient:{background:e.palette.action.hover},button:{minWidth:"unset !important",height:"100%",width:"100%","&:hover":{background:$(e.palette.getContrastText(e.palette.background.paper),.018)}},stretch:{flex:1}}}),KC=function(r){var o,i=r.onChange,l=r.day,c=GC().classes,u=BC(),s=u.BeforeDayHeader,d=u.AfterDayHeader,m=u.onItemClick,p=u.tileMode,v=u.itemSx,b=e(FC(),1)[0],y=BC(),E=y.renderItem,x=y.payload,C=y.onLoadStart,k=y.onLoadEnd,L=y.fallback,N=y.rowMark,I=y.rowColor,M=y.dotSide,R=void 0===M?7.5:M,P=e(g([]),2),A=P[0],T=P[1],D=e(g(null),2),O=D[0],F=D[1],B=A.length,H=h(function(){return YC(xl(l))},[]),W=Ai(function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:return T([]),b?[4,b.promise]:[2];case 1:return e=n.sent(),t=e.filter(function(e){return e.stamp===H}),T(t),[2]}})})},{onLoadStart:C,onLoadEnd:k,fallback:L}).execute;w(function(){W()},[b]);return f.createElement(f.Fragment,null,f.createElement(ye,{onClick:function(e){var t=e.currentTarget;return F(t)},className:Eo(c.button,(o={},o[c.buttonAccient]=XC(l),o))},f.createElement(rb,{sx:{flexDirection:"column",gap:"5px"}},l.format("DD"),!!B&&f.createElement(um,{sx:{mt:"-2.5px"},side:R,color:l.isBefore(Ue().add(-1,"days"))?"red":B>3?"orange":"green"}))),f.createElement(qe,{open:!!O,anchorEl:O,onClose:function(){return F(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"}},0===A.length?f.createElement(_,{sx:{p:2}},"На этот день задач не назначено"):f.createElement(j,{sx:{height:"356px",maxHeight:"45vh",width:"356px"}},f.createElement(Ie,{disablePadding:!0,subheader:f.createElement(j,{sx:{display:"flex",alignItems:"center",justifyContent:"stretch",mr:1}},s&&f.createElement(s,{items:A,payload:x,stamp:H}),f.createElement(rt,{component:_,sx:{fontWeight:"bold"}},l.format("DD/MM/YYYY")),f.createElement("div",{className:c.stretch}),d&&f.createElement(d,{items:A,payload:x,stamp:H}))},f.createElement($i,{mode:p,itemSx:v,sx:{height:"calc(356px - 48px)",width:"356px",maxHeight:"calc(45vh - 48px)"},data:A,rowMark:N,rowColor:I,payload:x,onItemClick:function(e){var t=e.data;m&&m(t),F(null)}},function(e){var t=e.data,n=e.rowMark,r=e.index;return S(E,a(a({},t),{rowMark:n,index:r,onDaySelect:function(){return i(l)}}))})))))};var QC=An()(function(e){return{container:{width:"100%",height:"100%",display:"flex",flexDirection:"column"},calendar:{flex:1,display:"grid",overflow:"hidden",background:e.palette.background.paper,gridTemplateColumns:"repeat(7, 2fr)",gridRowGap:"2px"},inactiveDay:{opacity:.5,pointerEvents:"none"},day:{"& button":{border:"0",color:e.palette.text.primary,height:"100%"}},cell:{display:"flex",alignItems:"center",justifyContent:"center","&:nth-of-type(7n)":{justifyContent:'"flex-end"'},"&:nth-of-type(7n + 1)":{justifyContent:'"flex-start"'},margin:e.spacing(.5),border:"1px solid ".concat(e.palette.action.active)}}}),JC=function(r){var o=r.onChange,i=r.onHeaderMonthClick,l=r.onHeaderYearClick,c=r.minDate,u=r.maxDate,s=r.date,d=Qr(),m=d.reloadTrigger,p=d.doReload,h=BC(),v=h.handler,b=h.payload,E=h.reloadSubject,x=Fr(E),C=e(g(s.clone().startOf("month")),2),k=C[0],S=C[1],L=e(FC(),2)[1];w(function(){var e=YC(k.clone().startOf("week")),r=YC(k.clone().endOf("month").endOf("week"));L({fromStamp:e,toStamp:r,payload:b,promise:t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,v({fromStamp:e,toStamp:r,payload:b})];case 1:return[2,t.sent().map(function(e){return a(a({},e),{payload:b})})]}})})})},[k,m]),w(function(){return x.subscribe(p)},[]);var N=y(function(e){var t=e.clone().endOf("week"),n=k.get("month");return((e,t)=>{const n=t.diff(e,"days")+1,r=[];for(let t=0;t!==n;t++)r.push(e.clone().add(t,"days"));return r})(e,t).map(function(e){var t,r=s.isSame(e,"date"),i=e.get("month")!==n||u.isBefore(e)||c.isAfter(e);return f.createElement("div",{key:e.toString(),className:Eo(R.day,R.cell,(t={},t[R.inactiveDay]=i,t))},f.createElement(KC,{day:e,isActive:r,onChange:o}))})},[k,s,u,c,o]),I=y(function(){return((e,t)=>{const n=t.diff(e,"weeks")+1,r=[];for(let t=0;t!==n;t++)r.push(e.clone().add(t,"weeks"));return r})(k.clone().startOf("week"),k.clone().endOf("month").endOf("week")).map(function(e){return f.createElement(f.Fragment,{key:"week-".concat(e.toString())},N(e))})},[k,N]),M=QC(),R=M.classes,P=M.cx;return f.createElement("div",{className:R.container},f.createElement($C,{currentMonth:k,onMonthChange:function(e){return S(e)},onHeaderMonthClick:i,onHeaderYearClick:l}),f.createElement("div",{className:P(R.calendar,"react-declarative__calendarWrapper")},I()))},ZC=kl(),ek=new Date(4102434e6),tk=An()(function(e){return{container:{width:"100%",minHeight:"100%",padding:e.spacing(1)}}}),nk=function(t){var n=tk().classes,r=t.className,o=t.style,i=t.sx,l=t.date,c=void 0===l?Ue():l,u=t.minDate,s=void 0===u?Ue(ZC):u,d=t.maxDate,m=void 0===d?Ue(ek):d,p=t.onChange,v=void 0===p?function(){}:p,b=t.outlinePaper,y=t.transparentPaper,w=Or(t.payload||{}),E=e(g(function(){return c.isBefore(s)?s:c}),2),x=E[0],C=E[1],k=e(g(!1),2),S=k[0],L=k[1],N=e(g(!1),2),I=N[0],M=N[1],R=function(){return L(!0)},P=function(){return M(!0)},A=x.startOf("day"),T=function(e){L(!1),C(e.clone().set("year",e.get("year")))},D=function(e){M(!1),C(e.clone().set("month",e.get("month")))},j=h(function(){return a(a({},t),{payload:w})},[]);return f.createElement(_C,{payload:j},f.createElement(ra,{className:Eo(n.container,r),style:o,sx:i,outlinePaper:b,transparentPaper:y},S?f.createElement(VC,{date:A,onChange:T,minDate:s,maxDate:m}):I?f.createElement(WC,{date:A,onChange:D,minDate:s,maxDate:m}):f.createElement(OC,{initialState:null},f.createElement(JC,{date:A,onChange:v,minDate:s,maxDate:m,onHeaderMonthClick:P,onHeaderYearClick:R}))))};nk.init=function(){Ue.extend(fn),Ue.extend(pn),Ue.extend(dn),Ue.locale(mn)};var rk=null,ok=new ar,ik=function(e){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return[4,ok.next(e)];case 1:return n.sent(),rk?(rk(e),[2]):((t=document.createElement("a")).href=e,t.target="_blank",t.style.display="none",document.body.appendChild(t),t.click(),document.body.removeChild(t),[2])}})})};ik.override=function(e){rk=e},ik.listen=function(e){return ok.subscribe(e)};var ak=An()(function(e){return{root:{position:"relative",overflow:"hidden",background:"light"===e.palette.mode?e.palette.background.paper:ae(e.palette.background.paper,.06)},container:{position:"absolute",top:0,left:0,minHeight:"100%",minWidth:"100%"},frame:{background:"none transparent",border:"0px solid transparent"},fabFullscreen:{position:"absolute",transition:"opacity 150ms",opacity:0,bottom:10,right:10,zIndex:2},fabFullscreenToggle:{opacity:1},fabDelete:{position:"absolute",transition:"opacity 150ms",opacity:0,bottom:10,zIndex:2},fabDeleteToggle:{opacity:1},fabMenu:{position:"absolute",transition:"opacity 150ms",opacity:0,top:10,right:10,height:48,width:48,zIndex:2},fabMenuToggle:{opacity:1}}}),lk=function(t){var n,r,o,i=t.withFullScreen,c=void 0!==i&&i,u=t.withDelete,s=void 0!==u&&u,d=t.className;t.style;var m=t.src,p=t.onFullScreenClick,h=void 0===p?function(){return ik(m)}:p,v=t.onDeleteClick,b=void 0===v?function(){}:v,y=t.onLoadStart,w=t.onLoadEnd,E=t.fallback,x=t.throwError,C=void 0!==x&&x,k=t.disabled,S=void 0!==k&&k,L=t.options,N=t.onAction,I=void 0===N?function(){}:N,M=t.payload,R=t.deps,P=t.keepMounted,A=t.BeforeContent,T=t.AfterContent,D=l(t,["withFullScreen","withDelete","className","style","src","onFullScreenClick","onDeleteClick","onLoadStart","onLoadEnd","fallback","throwError","disabled","options","onAction","payload","deps","keepMounted","BeforeContent","AfterContent"]),O=ak().classes,F=e(g(!1),2),_=F[0],B=F[1],H=e(g(!1),2),W=H[0],z=H[1];return f.createElement(j,a({className:Eo(d,O.root),onMouseEnter:function(){_||z(!0)},onMouseLeave:function(){_||z(!1)}},D),f.createElement(km,{className:O.container,payload:m},function(e){var t=e.height,n=e.width,r=e.payload;return f.createElement("iframe",{className:O.frame,allowTransparency:!0,src:r,height:t,width:n})}),!!(null==L?void 0:L.length)&&f.createElement(xa,{className:Eo(O.fabMenu,(n={},n[O.fabMenuToggle]=_||W,n)),options:L,disabled:S,onToggle:function(e){B(e),z(!1)},onAction:I,payload:M,deps:R,keepMounted:P,BeforeContent:A,AfterContent:T}),s&&f.createElement(om,{className:Eo(O.fabDelete,(r={},r[O.fabDeleteToggle]=_||W,r)),disabled:S,sx:{right:c?68:10},color:"primary",size:48,onClick:b,onLoadStart:y,onLoadEnd:w,fallback:E,throwError:C},f.createElement(ln,{color:"inherit"})),c&&f.createElement(om,{className:Eo(O.fabFullscreen,(o={},o[O.fabFullscreenToggle]=_||W,o)),disabled:S,color:"primary",size:48,onClick:h,onLoadStart:y,onLoadEnd:w,fallback:E,throwError:C},f.createElement(ht,{color:"inherit"})))},ck=An()(function(e){return{root:{position:"relative",overflow:"hidden",background:"light"===e.palette.mode?e.palette.background.paper:ae(e.palette.background.paper,.06)},container:{position:"absolute",top:0,left:0,height:"100%",width:"100%",display:"flex",alignItems:"stretch",justifyContent:"stretch"},content:{objectFit:"contain",margin:"6px",flex:1},fabFullscreen:{position:"absolute",transition:"opacity 150ms",opacity:0,bottom:10,right:10,zIndex:2},fabFullscreenToggle:{opacity:1},fabDelete:{position:"absolute",transition:"opacity 150ms",opacity:0,bottom:10,zIndex:2},fabDeleteToggle:{opacity:1},fabMenu:{position:"absolute",transition:"opacity 150ms",opacity:0,top:10,right:10,height:48,width:48,zIndex:2},fabMenuToggle:{opacity:1}}}),uk=function(t){var n,r,o,i=t.withFullScreen,c=void 0!==i&&i,u=t.withDelete,s=void 0!==u&&u,d=t.className,m=t.src,p=t.onFullScreenClick,h=void 0===p?function(){return ik(m)}:p,v=t.onDeleteClick,b=void 0===v?function(){}:v,y=t.onLoadStart,w=t.onLoadEnd,E=t.fallback,x=t.throwError,C=void 0!==x&&x,k=t.disabled,S=void 0!==k&&k,L=t.options,N=t.onAction,I=void 0===N?function(){}:N,M=t.payload,R=t.deps,P=t.keepMounted,A=t.BeforeContent,T=t.AfterContent,D=l(t,["withFullScreen","withDelete","className","src","onFullScreenClick","onDeleteClick","onLoadStart","onLoadEnd","fallback","throwError","disabled","options","onAction","payload","deps","keepMounted","BeforeContent","AfterContent"]),O=ck().classes,F=e(g(!1),2),_=F[0],B=F[1],H=e(g(!1),2),W=H[0],z=H[1];return f.createElement(j,a({className:Eo(d,O.root),onMouseEnter:function(){_||z(!0)},onMouseLeave:function(){_||z(!1)}},D),f.createElement("div",{className:O.container},f.createElement("img",{className:O.content,crossOrigin:"anonymous",loading:"lazy",src:m})),!!(null==L?void 0:L.length)&&f.createElement(xa,{className:Eo(O.fabMenu,(n={},n[O.fabMenuToggle]=_||W,n)),options:L,disabled:S,onToggle:function(e){B(e),z(!1)},onAction:I,payload:M,deps:R,keepMounted:P,BeforeContent:A,AfterContent:T}),s&&f.createElement(om,{className:Eo(O.fabDelete,(r={},r[O.fabDeleteToggle]=_||W,r)),disabled:S,sx:{right:c?68:10},color:"primary",size:48,onClick:b,onLoadStart:y,onLoadEnd:w,fallback:E,throwError:C},f.createElement(ln,{color:"inherit"})),c&&f.createElement(om,{className:Eo(O.fabFullscreen,(o={},o[O.fabFullscreenToggle]=_||W,o)),disabled:S,color:"primary",size:48,onClick:h,onLoadStart:y,onLoadEnd:w,fallback:E,throwError:C},f.createElement(ht,{color:"inherit"})))},sk=An()(function(e){return{root:{display:"flex",flexDirection:"column",alignItems:"stretch",justifyContent:"stretch",height:"100%",width:"100%",overflow:"hidden",background:e.palette.background.paper},label:{display:"flex",minHeight:"35px",justifyContent:"stretch",alignItems:"center",paddingLeft:"6px",gap:e.spacing(1),background:A("#000",.1)},labelTitle:{opacity:.5},container:{position:"relative",flex:1},content:{position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *":{flex:1}},stretch:{flex:1}}}),dk=function(e){var t=e.children,n=void 0===t?null:t,r=e.outlinePaper,o=e.transparentPaper,i=e.className,a=e.style,l=e.sx,c=e.label,u=e.payload,s=e.loading,d=e.BeforeLabel,m=e.AfterLabel,p=sk().classes;return f.createElement(ra,{className:Eo(p.root,i),outlinePaper:r,transparentPaper:o,sx:l,style:a},!!c&&f.createElement(j,{className:Eo(p.label,"react-declarative__gridViewLabel")},!!d&&f.createElement(d,{payload:u,loading:s}),f.createElement(_,{className:p.labelTitle},c),f.createElement("div",{className:p.stretch}),!!m&&f.createElement(m,{payload:u,loading:s})),f.createElement("div",{className:p.container},f.createElement("div",{className:p.content},n)))},fk=An()({tile:{height:"100%"}}),mk=function(e){var t=e.className,n=e.style,r=e.sx,o=e.label,i=e.BeforeLabel,c=e.AfterLabel,u=e.payload,s=e.mobileItem,d=e.itemSx,m=e.tileMode,p=e.outlinePaper,h=e.transparentPaper,v=e.loading,g=l(e,["className","style","sx","label","BeforeLabel","AfterLabel","payload","mobileItem","itemSx","tileMode","outlinePaper","transparentPaper","loading"]),b=fk().classes,y=Or(u),w=tl().isMobile;return f.createElement(dk,{outlinePaper:p,transparentPaper:h,className:t,style:n,sx:r,label:o,payload:y,loading:!!v,BeforeLabel:i,AfterLabel:c},w&&s?f.createElement($i,a({},g,{itemSx:d,className:b.tile,payload:y,loading:v,mode:m}),s):f.createElement(Pa,a({},g,{payload:y,loading:v})))},pk=function(){function o(e){this.defaultOption={delay:300},this.emptyAction={request:{type:"empty"},responses:[],onResnponsed:[]},this.defaultActionRequest={always:!1,addMessage:!0},this.state={option:a(a({},this.defaultOption),e),messages:[],action:this.emptyAction,actionHistory:[],onMessagesChanged:[],onActionChanged:[]}}return o.prototype.addMessage=function(e){var t=this;return new Promise(function(n){setTimeout(function(){var r=t.state.messages.push(e)-1;t.state.messages[r].createdAt=new Date,t.callOnMessagesChanged(),n(r)},t.state.option.delay)})},o.prototype.updateMessage=function(e,t){if(t!==this.state.messages[e]){var n=this.state.messages[e].createdAt;this.state.messages[e]=t,this.state.messages[e].createdAt=n}this.state.messages[e].updatedAt=new Date,this.callOnMessagesChanged()},o.prototype.removeMessage=function(e){this.state.messages[e].deletedAt=new Date,this.callOnMessagesChanged()},o.prototype.getMessages=function(){return this.state.messages},o.prototype.setMessages=function(t){this.clearMessages(),this.state.messages=r([],e(t),!1),this.callOnMessagesChanged()},o.prototype.clearMessages=function(){this.state.messages=[],this.callOnMessagesChanged()},o.prototype.callOnMessagesChanged=function(){var e=this;this.state.onMessagesChanged.map(function(t){return t(e.state.messages)})},o.prototype.addOnMessagesChanged=function(e){this.state.onMessagesChanged.push(e)},o.prototype.removeOnMessagesChanged=function(e){var t=this.state.onMessagesChanged.indexOf(e);this.state.onActionChanged[t]=function(){}},o.prototype.setActionRequest=function(e,t){var n=this,r={request:a(a({},this.defaultActionRequest),e),responses:[],onResnponsed:[]};return new Promise(function(o,i){if(!e.always){r.onResnponsed.push(function(e){e.error?i(e.error):o(e)})}t&&r.onResnponsed.push(t),n.state.action=r,n.state.actionHistory.push(r),n.callOnActionChanged(r.request),e.always&&o({type:"text",value:"dummy"})})},o.prototype.cancelActionRequest=function(){this.state.action=this.emptyAction,this.callOnActionChanged(this.emptyAction.request)},o.prototype.getActionRequest=function(){var e=this.state.action,t=e.request,n=e.responses;if(t.always||!(n.length>0))return t},o.prototype.setActionResponse=function(e,r){return t(this,void 0,void 0,function(){var t,o,i,a;return n(this,function(n){switch(n.label){case 0:if(t=this.state.action,o=t.request,i=t.responses,a=t.onResnponsed,e!==o)throw new Error("Invalid action.");if(!e.always&&0===a.length)throw new Error("onResponsed is not set.");return i.push(r),this.callOnActionChanged(e,r),e.addMessage?[4,this.addMessage({type:"text",content:r.value,self:!0})]:[3,2];case 1:n.sent(),n.label=2;case 2:return a.map(function(e){return e(r)}),[2]}})})},o.prototype.getActionResponses=function(){return this.state.action.responses},o.prototype.callOnActionChanged=function(e,t){this.state.onActionChanged.map(function(n){return n(e,t)})},o.prototype.addOnActionChanged=function(e){this.state.onActionChanged.push(e)},o.prototype.removeOnActionChanged=function(e){var t=this.state.onActionChanged.indexOf(e);this.state.onActionChanged[t]=function(){}},o.prototype.getOption=function(){return this.state.option},o}(),hk=function(){function e(){if(!window.MediaRecorder)throw new Error("window.MediaRecorder is undefined");this.recordChunks=[]}return e.getInstance=function(){return this.instance||(this.instance=new e),this.instance},e.prototype.initialize=function(){return t(this,void 0,void 0,function(){var e;return n(this,function(t){switch(t.label){case 0:return this.md?[2,this]:[4,navigator.mediaDevices.getUserMedia({audio:!0,video:!1})];case 1:return e=t.sent(),this.md=new MediaRecorder(e),this.recordChunks=[],[2,this]}})})},e.prototype.startRecord=function(){return t(this,void 0,void 0,function(){var e=this;return n(this,function(t){return[2,new Promise(function(t){if(!e.md)throw new Error("Must be initialized.");e.recordChunks=[],e.md.addEventListener("start",function(){t()}),e.md.addEventListener("dataavailable",function(t){t.data.size>0&&e.recordChunks.push(t.data)}),e.md.start()})]})})},e.prototype.stopRecord=function(){return t(this,void 0,void 0,function(){var e=this;return n(this,function(t){return[2,new Promise(function(t){if(!e.md)throw new Error("Must be initialized.");e.md.addEventListener("stop",function(){t(new Blob(e.recordChunks))}),e.md.stop()})]})})},e}(),vk=function(r){var o=r.chatController,i=r.actionRequest,a=o,l=e(f.useState(hk.getInstance()),1)[0],c=e(f.useState(!0),2),u=c[0],s=c[1],d=e(f.useState(),2),m=d[0],p=d[1],h=f.useCallback(function(e){var t={type:"audio",value:e.message,error:e};a.setActionResponse(i,t)},[i,a]),v=f.useCallback(function(){return t(void 0,void 0,void 0,function(){var e;return n(this,function(t){switch(t.label){case 0:return t.trys.push([0,3,,4]),[4,l.initialize()];case 1:return t.sent(),[4,l.startRecord()];case 2:return t.sent(),s(!1),[3,4];case 3:return e=t.sent(),h(e),[3,4];case 4:return[2]}})})},[l,h]),g=f.useCallback(function(){return t(void 0,void 0,void 0,function(){var e,t;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,l.stopRecord()];case 1:return e=n.sent(),p(e),s(!0),[3,3];case 2:return t=n.sent(),h(t),[3,3];case 3:return[2]}})})},[l,h]),b=f.useCallback(function(){if(m){var e={type:"audio",value:"Audio",audio:m};a.setActionResponse(i,e),p(void 0)}},[i,m,a]),y=i.sendButtonText?i.sendButtonText:"Send";return f.createElement(te,{sx:{flex:"1 1 auto",display:"flex",gap:1,"& > *":{flex:"1 1 auto",minWidth:0},"& > * + *":{ml:1}}},u&&f.createElement(le,{type:"button",onClick:v,disabled:!u,variant:"contained",color:"primary",startIcon:f.createElement(wn,null)},"Rec start"),!u&&f.createElement(le,{type:"button",onClick:g,disabled:u,variant:"contained",color:"primary",startIcon:f.createElement(yn,null)},"Rec stop"),f.createElement(le,{type:"button",onClick:b,disabled:!m,variant:"contained",color:"primary",startIcon:f.createElement(bn,null)},y))},gk=function(t){var n=t.chatController,r=t.actionRequest,o=n,i=e(f.useState([]),2),a=i[0],l=i[1],c=f.useCallback(function(e){var t=[];if(e)for(var n=0;n<e.length;n+=1){var r=e.item(n);r&&t.push(r)}l(t)},[]),u=f.useCallback(function(){if(a.length>0){var e={type:"file",value:a.map(function(e){return e.name}).toString(),files:a};o.setActionResponse(r,e)}},[r,o,a]),s=r.sendButtonText?r.sendButtonText:"Send";return f.createElement(te,{sx:{flex:"1 1 auto",maxWidth:"100%",display:"flex",gap:1,flexDirection:"column","& > *":{flex:"0 0 auto",maxWidth:"100%"},"& > * + *":{mt:1}}},f.createElement(ce,null,a.map(function(e){return f.createElement("div",{key:"".concat(e.name,"-").concat(e.size)},f.createElement(G,null),f.createElement(ue,{key:e.name},f.createElement(se,null,f.createElement(En,null)),f.createElement(X,{style:{overflowWrap:"break-word",minWidth:0}},e.name)))})),f.createElement(te,{sx:{display:"flex","& > *":{flex:"1 1 auto",minWidth:0},"& > * + *":{ml:1}}},f.createElement(le,{disabled:!1,component:"label",variant:"contained",color:"primary",startIcon:f.createElement(xn,null)},"Select file",f.createElement("input",{type:"file",accept:r.accept,multiple:r.multiple,onChange:function(e){return c(e.target.files)},style:{display:"none"}})),f.createElement(le,{type:"button",onClick:u,disabled:0===a.length,variant:"contained",color:"primary",startIcon:f.createElement(bn,null)},s)))},bk=function(t){var n=t.chatController,o=t.actionRequest,i=n,a=e(f.useState([]),2),l=a[0],c=a[1],u=f.useCallback(function(t){l.includes(t)?c(l.filter(function(e){return e!==t})):c(r(r([],e(l),!1),[t],!1))},[l]),s=f.useCallback(function(){var e=o.options.filter(function(e){return l.includes(e.value)}),t={type:"multi-select",value:e.map(function(e){return e.text}).toString(),options:e};i.setActionResponse(o,t),c([])},[o,i,l]),d=o.sendButtonText?o.sendButtonText:"Send";return f.createElement(te,{sx:{flex:"1 1 auto",display:"flex",gap:1,flexDirection:"column","& > *":{flex:"0 0 auto",maxWidth:"100%"},"& > * + *":{mt:1}}},o.options.map(function(e){return f.createElement(le,{key:o.options.indexOf(e),type:"button",value:e.value,onClick:function(e){return u(e.currentTarget.value)},variant:l.includes(e.value)?"contained":"outlined",color:"primary"},e.text)}),f.createElement(le,{type:"button",onClick:s,disabled:0===l.length,variant:"contained",color:"primary",startIcon:f.createElement(bn,null)},d))},yk=function(e){var t=e.chatController,n=e.actionRequest,r=t,o=f.useCallback(function(e){var t=n.options.find(function(t){return t.value===e});if(!t)throw new Error("Unknown value: ".concat(e));var o={type:"select",value:t.text,option:t};r.setActionResponse(n,o)},[n,r]);return f.createElement(te,{sx:{flex:"1 1 auto",display:"flex",gap:1,flexDirection:"column","& > *":{flex:"0 0 auto",maxWidth:"100%"},"& > * + *":{mt:1}}},n.options.map(function(e){return f.createElement(le,{key:n.options.indexOf(e),type:"button",value:e.value,onClick:function(e){return o(e.currentTarget.value)},variant:"contained",color:"primary"},e.text)}))},wk=function(t){var n=t.chatController,r=t.actionRequest,o=n,i=e(f.useState(r.defaultValue),2),a=i[0],l=i[1],c=f.useCallback(function(){if(a){var e={type:"text",value:a};o.setActionResponse(r,e),l("")}},[r,o,a]),u=f.useCallback(function(e){e.nativeEvent.isComposing||"Enter"!==e.key||e.shiftKey||(e.preventDefault(),c())},[c]),s=r.sendButtonText?r.sendButtonText:"Send";return f.createElement(te,{sx:{flex:"1 1 auto",display:"flex",gap:1,"& > *":{flex:"1 1 auto",minWidth:0},"& > * + *":{ml:1},"& :last-child":{flex:"0 1 auto"}}},f.createElement(de,{placeholder:r.placeholder,value:a,onChange:function(e){return l(e.target.value)},autoFocus:!0,multiline:!0,inputProps:{onKeyDown:u},variant:"outlined",maxRows:1,minRows:1}),f.createElement(le,{type:"button",onClick:c,disabled:!a,variant:"contained",color:"primary",startIcon:f.createElement(bn,null)},s))},Ek=function(e){var t=e.id,n=e.message,r=e.showDate,o=e.showTime;if(n.deletedAt)return f.createElement("div",{id:t});var i=n.updatedAt?n.updatedAt:n.createdAt,a=f.createElement(te,{minWidth:0,flexShrink:0,ml:n.self?1:0,mr:n.self?0:1},f.createElement(fe,{alt:n.username,src:n.avatar})),l=f.createElement(te,{maxWidth:"100%",mx:1},f.createElement(X,{variant:"body2",align:n.self?"right":"left"},n.username)),c=f.createElement(te,{maxWidth:"100%",mx:1},f.createElement(X,{variant:"body2",align:n.self?"right":"left",color:"textSecondary"},null==i?void 0:i.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})));return f.createElement(me,{in:!0},f.createElement(te,{maxWidth:"100%",display:"flex",flexDirection:"column",pb:1},r&&f.createElement(X,{align:"center"},null==i?void 0:i.toLocaleDateString()),f.createElement(te,{id:t,maxWidth:"100%",pl:n.self?"20%":0,pr:n.self?0:"20%",mb:1,pb:1,display:"flex",justifyContent:n.self?"flex-end":"flex-start",style:{overflowWrap:"break-word"}},n.avatar&&!n.self&&a,f.createElement(te,{minWidth:0,display:"flex",flexDirection:"column"},n.username&&l,f.createElement(te,{maxWidth:"100%",py:3,px:2,bgcolor:n.self?"primary.main":"background.paper",color:n.self?"primary.contrastText":"text.primary",borderRadius:4,boxShadow:2},"text"===n.type&&f.createElement(X,{variant:"body1",style:{whiteSpace:"pre-wrap"}},n.content),"jsx"===n.type&&f.createElement("div",null,n.content)),o&&c),n.avatar&&n.self&&a)))},xk=An()(function(e){return{root:{height:"100%",width:"100%",p:1,bgcolor:e.palette.background.default,display:"flex",flexDirection:"column","& > *":{maxWidth:"100%"},"& > * + *":{mt:1}}}}),Ck=function(t){var n=t.chatController,o=t.className,i=t.style,a=t.sx,l=xk(),c=l.classes,u=l.cx,s=n,d=e(f.useState(s.getMessages()),2),m=d[0],p=d[1],h=e(f.useState(s.getActionRequest()),2),v=h[0],g=h[1],b=f.useRef(null),y=f.useCallback(function(){b.current&&(b.current.scrollTop=b.current.scrollHeight)},[b]);f.useEffect(function(){s.addOnMessagesChanged(function(){p(r([],e(s.getMessages()),!1)),y()}),s.addOnActionChanged(function(){g(s.getActionRequest()),y()}),p(s.getMessages()),g(s.getActionRequest())},[s,y]);var w=f.useMemo(function(){return v&&"custom"===v.type?v.Component:null},[v]),E={type:"text",content:"Unknown message.",self:!1},x=Ue(0),C=Ue(0);return f.createElement(te,{className:u(o,c.root),style:i,sx:a},f.createElement(te,{sx:{flex:"1 1 0%",overflowY:"auto",WebkitOverflowScrolling:"touch",display:"flex",flexDirection:"column","& > *":{maxWidth:"100%"}},ref:b},m.map(function(e){var t=!1,n=!!s.getOption().showDateTime;if(s.getOption().showDateTime&&!e.deletedAt){var r=Ue(e.updatedAt?e.updatedAt:e.createdAt);r.format("YYYYMMDD")!==x.format("YYYYMMDD")&&(t=!0),x=r,r.diff(C)<6e4?n=!1:C=r}return"text"===e.type||"jsx"===e.type?f.createElement(Ek,{key:m.indexOf(e),id:"cu-msg-".concat(m.indexOf(e)+1),message:e,showDate:t,showTime:n}):f.createElement(Ek,{key:m.indexOf(e),id:"cu-msg-".concat(m.indexOf(e)+1),message:E,showDate:t,showTime:n})})),f.createElement(te,{sx:{flex:"0 1 auto",display:"flex",alignContent:"flex-end","& > *":{minWidth:0}}},v&&"text"===v.type&&f.createElement(wk,{chatController:s,actionRequest:v}),v&&"select"===v.type&&f.createElement(yk,{chatController:s,actionRequest:v}),v&&"multi-select"===v.type&&f.createElement(bk,{chatController:s,actionRequest:v}),v&&"file"===v.type&&f.createElement(gk,{chatController:s,actionRequest:v}),v&&"audio"===v.type&&f.createElement(vk,{chatController:s,actionRequest:v}),v&&"custom"===v.type&&f.createElement(w,{chatController:s,actionRequest:v})))};const kk="react-declarative__roiControlRect",Sk=new class{log(...e){}};let Lk=e=>e(),Nk=(e,t)=>Sk.log({id:e,ref:t}),Ik=(e,t,...n)=>Sk.log({id:e,type:t,args:n}),Mk=(e,t)=>Sk.log({id:e,img:t}),Rk=!1;const Pk=new class{_wrappers=new Map;applyTouchWrapper(e,t=!1){const n=n=>{const{touches:r}=n;t||(n.preventDefault(),n.stopPropagation()),e(r[0])};return this._wrappers.set(e,n),n}disposeTouchWrapper(e){const t=this._wrappers.get(e);return this._wrappers.delete(e),t}},Ak=(e,t,n)=>{if(!Rk)if("mousemove"===t){const t=Pk.applyTouchWrapper(n,!0);e.addEventListener("mousemove",n),e.addEventListener("touchmove",t)}else if("mousedown"===t){const t=Pk.applyTouchWrapper(n);e.addEventListener("mousedown",n),e.addEventListener("touchstart",t)}else if("mouseup"===t){const t=Pk.applyTouchWrapper(n,!0);e.addEventListener("mouseup",n),e.addEventListener("touchend",t)}else{if("wheel"!==t)throw new Error(`area-selector on unknown event: ${t}`);e.addEventListener("wheel",n)}},Tk=(e,t,n)=>{if(!Rk)if("mousemove"===t){const t=Pk.disposeTouchWrapper(n);e.removeEventListener("mousemove",n),e.removeEventListener("touchmove",t)}else if("mousedown"===t){const t=Pk.disposeTouchWrapper(n);e.removeEventListener("mousedown",n),e.removeEventListener("touchstart",t)}else if("mouseup"===t){const t=Pk.disposeTouchWrapper(n);e.removeEventListener("mouseup",n),e.removeEventListener("touchend",t)}else{if("wheel"!==t)throw new Error(`area-selector un unknown event: ${t}`);e.removeEventListener("wheel",n)}};function Dk([e,t,n,r],[o,i,a,l],c){if(!c)return[e,t,n,r];return[o-(r-l)/2,i-(n-a)/2,n,r]}const jk={roi:(e=e=>e(),t=(e,t,...n)=>Sk.log({id:e,type:t,args:n}),n="unset",r=10,o=10,i=10,a=10,l="blue",c="rgba(0, 0, 0, 0.5)")=>{const{min:u,max:s,round:d}=Math;let f=1,m=1;const p=(e=d(r/m),l=d(o/f),c=d(i/f),u=d(a/m))=>t(n,"roi-area-changed",e,l,c,u),[h,v,g,b,y,w,E]=((e=r,t=o,n=i,u=a)=>{const s=document.createElement("div");s.style.position="absolute",s.style.top="0px",s.style.left="0px",s.style.right="0px",s.style.bottom="0px",s.style.zIndex="100",s.style.display="flex",s.style.alignItems="stretch",s.style.justifyContent="stretch";const d=(e,t=!1)=>{s.style.borderTop=`${e}px solid ${c}`,r=e,t||p()},f=(e,t=!1)=>{s.style.borderLeft=`${e}px solid ${c}`,o=e,t||p()},m=(e,t=!1)=>{s.style.borderRight=`${e}px solid ${c}`,i=e,t||p()},h=(e,t=!1)=>{s.style.borderBottom=`${e}px solid ${c}`,a=e,t||p()};[[d,e],[f,t],[m,n],[h,u]].forEach(([e,t])=>e(t,!0));const v=document.createElement("div");return v.style.flexGrow="1",v.style.position="relative",v.style.border=`1px solid ${l}`,s.appendChild(v),[s,v,(e=>{const t=document.createElement("div");t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.right="0px",t.style.bottom="0px",t.style.display="flex",t.style.alignItems="stretch",t.style.justifyContent="stretch";const n=document.createElement("div");return n.style.flexGrow="1",n.style.position="relative",n.style.overflow="hidden",t.appendChild(n),e.appendChild(t),n})(v),d,f,m,h]})(),[x,C,k,S]=[[!0,!0,y,b],[!0,!1,w,b],[!1,!0,y,E],[!1,!1,w,E]].map(t=>((t=!0,n=!0,c=e=>Sk.log(e),d=e=>Sk.log(e))=>{const f=document.createElement("div");f.classList.add(kk),f.style.top=t?"-4px":null,f.style.left=n?"-4px":null,f.style.right=n?null:"-4px",f.style.bottom=t?null:"-4px",f.style.background=l,f.style.position="absolute",f.style.height="8px",f.style.width="8px";let[m,p]=[null,null];const v=({pageX:e,pageY:l})=>{if(Rk)return;const{scrollX:f,scrollY:v}=window;e-=f,l-=v;const{top:g,left:b,right:y,bottom:w,height:E,width:x}=h.getBoundingClientRect();m=s(n?u(e-b,x-i):u(-1*(e-y),x-o),0),p=s(t?u(l-g,E-a):u(-1*(l-w),E-r),0),c(m),d(p)};return e(()=>Ak(f,"mousedown",()=>(e(()=>Ak(window,"mousemove",v)),e(()=>Ak(window,"mouseup",()=>e(()=>Tk(window,"mousemove",v)))),!1))),f})(...t));[x,C,k,S].forEach(e=>v.appendChild(e));return[h,([e,t,n])=>{const{naturalWidth:l,naturalHeight:c}=e,{width:u,height:s}=e.getBoundingClientRect(),[d,h,v,g]=[r/m,o/f,i/f,a/m];f=u/l,m=s/c,o=h*f,i=v*f,a=g*m,b(r=d*m,!0),y(o,!0),w(i,!0),E(a,!0),p()},g]},rect:(e=e=>e(),t=(e,t,...n)=>Sk.log({id:e,type:t,args:n}),n="unset",r="unset-zone",o=10,i=10,a=125,l=125,c=0,u="",s="cyan",d="",f="rgba(0, 0, 0, 0.5)")=>{const{max:m,round:p}=Math,h=document.createElement("div");h.style.transform=`rotate(${c}deg)`,h.classList.add("react-declarative__roiAreaRect"),h.dataset.data_area_id=n;let v=1,g=1;Rk&&(h.addEventListener("click",e=>{t(n,"rect-area-click",r,e)}),h.addEventListener("mouseover",e=>{e.stopPropagation(),t(n,"rect-area-hover",r,e)})),h.style.position="absolute",h.style.display="flex",h.style.alignItems="stretch",h.style.justifyContent="stretch",h.style.zIndex="99",u&&(h.style.backgroundRepeat="no-repeat",h.style.backgroundPosition="center",h.style.backgroundSize="contain",h.style.backgroundImage=`url('${u}')`),h.style.backgroundColor=f,h.style.border=`1px solid ${s}`;const b=document.createElement("div");b.style.position="relative",b.style.flexGrow="1",d&&b.appendChild((e=>{const t=document.createElement("label");return t.classList.add("react-declarative__roiAreaLabel"),t.style.position="absolute",t.style.top="50%",t.style.left="50%",t.style.transform="translate(-50%, -50%)",t.style.userSelect="none",t.style.pointerEvents="none",t.innerText=e,t})(d));const y=(e=o,u=i,s=l,d=a,f=c)=>{h.style.transform=`rotate(${c||0}deg)`,h.style.top=`${e}px`,h.style.left=`${u}px`,h.style.width=`${s}px`,h.style.height=`${d}px`,((e=p(o/g),u=p(i/v),s=p(l/v),d=p(a/g),f=c)=>{t(n,"rect-area-changed",r,e,u,d,s,f)})()};let w=!1;const E=(t=!0,n=!0)=>{const r=document.createElement("div");r.classList.add(kk),r.style.top=t?"-4px":null,r.style.left=n?"-4px":null,r.style.right=n?null:"-4px",r.style.bottom=t?null:"-4px",r.style.background=s,r.style.position="absolute",r.style.height="8px",r.style.width="8px";let[u,d]=[null,null],[f,p]=[null,null];const v=({pageX:e,pageY:r})=>{if(Rk)return;const{scrollX:s,scrollY:v}=window;e-=s,r-=v;const[g,b]=(e=>{const t=e.getBoundingClientRect(),{scrollX:n,scrollY:r}=window;return[t.left+t.width/2+n,t.top+t.height/2+r]})(h);[e,r]=function(e,t,n,r,o){const i=o*Math.PI/180,a=e-n,l=t-r;return[a*Math.cos(i)-l*Math.sin(i)+n,a*Math.sin(i)+l*Math.cos(i)+r]}(e,r,g,b,-c);let w=null,E=null;{const{top:t,left:n,height:a,width:l}=h.parentElement.getBoundingClientRect();w=a,E=l,[u,d]=[m(e-n,0),m(r-t,0)],[f,p]=[i-u,o-d]}let[x,C,k,S]=[null,null,null,null];t&&n?[x,C,k,S]=Dk([d,u,l+f,a+p],[o,i,l,a],c):t&&!n?[x,C,k,S]=Dk([d,i,u-i,a+p],[o,i,l,a],c):!t&&n?[x,C,k,S]=Dk([o,u,l+f,d-o],[o,i,l,a],c):t||n||([x,C,k,S]=Dk([o,i,u-i,d-o],[o,i,l,a],c)),x+S>w||C+k>E||(o=S<0?o:x,i=k<0?i:C,l=k<0?l:k,a=S<0?a:S,y())};return e(()=>Ak(r,"mousedown",()=>(w=!0,e(()=>Ak(window,"mousemove",v)),e(()=>Ak(window,"mouseup",()=>{e(()=>Tk(window,"mousemove",v)),w=!1})),!1))),r};[[!0,!0],[!0,!1],[!1,!0],[!1,!1]].map(e=>E(...e)).forEach(e=>b.appendChild(e));let[x,C]=[null,null];const k=({pageX:e,pageY:t})=>{if(Rk)return;const{scrollX:n,scrollY:r}=window;e-=n,t-=r;{const{top:n,left:r}=h.parentElement.getBoundingClientRect();[x,C]=[m(e-r,0),m(t-n,0)]}const[c,u]=[m(C-a/2,0),m(x-l/2,0)],{height:s,width:d}=h.parentElement.getBoundingClientRect();w||(o=c+a>s?o:c,i=u+l>d?i:u,y())};e(()=>Ak(h,"mousedown",()=>(e(()=>Ak(window,"mousemove",k)),e(()=>Ak(window,"mouseup",()=>e(()=>Tk(window,"mousemove",k)))),!1))),e(()=>Ak(h,"wheel",e=>{Rk||(e.preventDefault(),e.stopPropagation(),c+=Math.sign(e.deltaY)+360,c%=360,y())}));return h.appendChild(b),[h,([e,t,n])=>{const{naturalWidth:r,naturalHeight:c}=e,{width:u,height:s}=e.getBoundingClientRect(),[d,f,m,p]=[l/v,a/g,o/g,i/v];v=u/r,g=s/c,a=f*g,l=d*v,o=m*g,i=p*v,y()}]}},Ok=([e,t,n])=>{const r=n.getBoundingClientRect().height,o=e.getBoundingClientRect().height,i=(r-o)/2;t.style.height=`${o}px`,t.style.top=`${i}px`,e.style.top=`${i}px`},Fk=({setControls:e=e=>Sk.log({types:e}),obj:t={controls:[]}})=>new Proxy(Object.assign({},t),((e,t=null)=>({set:(n,r,o)=>((t||new Set(Object.keys(e))).has(r)?(n[r]=o,e[r](o)):n[r]=o,!0)}))({controls:e},new Set(Object.keys(t)))),_k=(e,t=Lk)=>new Promise(n=>{const r=t(()=>setInterval(()=>{(()=>{const{naturalWidth:t,naturalHeight:n}=e,{width:r,height:o}=e.getBoundingClientRect();return n&&t&&o&&r})()&&(clearInterval(r),n())},50))});function Bk(e=Ok){const t=Reflect.construct(HTMLElement,[],Bk),n=new class{composes=[e];cleanup=()=>this.composes=[e];addHandler=e=>this.composes.push(e);exec=([e,t,n])=>this.composes.reduce((e,t)=>([n,r,o])=>{e([n,r,o]),t([n,r,o])})([e,t,n])};let r="",o="100%",i="100%",a="unset";a=t.hasAttribute("id")?t.getAttribute("id"):a,o=t.hasAttribute("height")?t.getAttribute("height"):o,i=t.hasAttribute("width")?t.getAttribute("width"):i,r=t.hasAttribute("imageSrc")?t.getAttribute("imageSrc"):r;const l=document.createElement("div");l.style.position="relative",l.style.height=o,l.style.width=i;const c=document.createElement("img");c.onload=()=>{n.exec([c,u,l])},c.style.touchAction="none",c.style.pointerEvents="none",c.style.position="absolute",c.crossOrigin="anonymous",c.style.width="100%",c.style.zIndex="97",c.src=r;const u=document.createElement("div");u.style.position="relative",u.style.width="100%",u.style.zIndex="98",u.style.left="0px";const s=(e=>{let t=!1;return()=>{t||(e(),t=!0)}})(()=>{Rk&&u.addEventListener("mouseover",e=>{e.stopPropagation(),Ik(a,"root-area-hover","",e)})});n.addHandler(s);const d=new ResizeObserver(()=>n.exec([c,u,l]));Lk(()=>d.observe(l)),Lk(()=>d.observe(c)),t.appendChild(l),l.appendChild(u),l.appendChild(c);const f=()=>{!document.body.contains(l)&&c.parentElement&&(d.unobserve(l),d.unobserve(c),c.src="#",c.parentElement.removeChild(c),Sk.log("dispose"))},m=async e=>{u.style.visibility="hidden",(e=>{for(;;){const t=e.lastChild;if(!t)break;e.removeChild(t)}})(u),n.cleanup();for(const[t,...r]of e.sort(([e])=>"roi"===e?-1:1)){const e=jk[t];let[o,i]=[null,null];if(!e)throw new Error("area-selector control not found "+t);[o,i]=e(Lk,Ik,a,...r),n.addHandler(i),u.appendChild(o)}await _k(c),n.addHandler(([e])=>Mk(a,e)),n.addHandler(f),n.exec([c,u,l]),u.style.visibility="visible"};return Lk(()=>setTimeout(()=>Nk(a,Fk({setControls:m})))),t}"HTMLElement"in globalThis&&(Bk.prototype=Object.create(HTMLElement.prototype),customElements.define("react-declarative-area-selector",Bk));var Hk,Wk,zk=function(e,t){var n=!0;return n=(n=(n=(n=(n=(n=(n=n&&e.type===t.type)&&e.id===t.id)&&e.top===t.top)&&e.left===t.left)&&e.width===t.width)&&e.height===t.height)&&(e.angle||0)===(t.angle||0)},Vk=function(t){var n=zr(t);return h(function(){return new function(){var t=this;this._cords=n.current.map(function(e){return a({},e)}),this.commitChange=function(e){var n=t._cords.find(function(t){var n=t.id;return e.id===n});n&&Object.assign(n,e)},this.getValue=function(){return function(t,n){if(t.length!==n.length)return!1;var o=r([],e(t),!1),i=r([],e(n),!1),a=function(e){return"".concat(e.type,"-").concat(e.id)};o.sort(function(e,t){return a(e).localeCompare(a(t))}),i.sort(function(e,t){return a(e).localeCompare(a(t))});for(var l=0;l<o.length;l++)if(!zk(o[l],i[l]))return!1;return!0}(t._cords,n.current)?t._cords:t._cords=n.current.map(function(e){return a({},e)})}}},[])},Yk=function(e,t,n){return void 0===t&&(t=100),void 0===n&&(n=100),e.map(function(e){var r=e.id,o=e.type,i=e.height,a=e.width,l=e.top,c=e.left,u=e.color,s=e.label,d=e.angle;return"rect"===o?((e="rect-unset-id",t=10,n=10,r=125,o=125,i=0,a="cyan",l="",c="",u="rgba(0, 0, 0, 0.5)")=>["rect",e,t,n,r,o,i,c,a,l,u])(r,l,c,i,a,d,u,s):"roi"===o?((e=10,t=10,n=10,r=10,o="blue",i="rgba(0, 0, 0, 0.5)")=>["roi",e,t,n,r,o,i])(l,c,n-c-a,t-l-i,u):console.error("lowLevelCords invalid cord type",o)})},Uk=An()({parent:{position:"relative"}}),qk=function(t){var n=t.src,r=void 0===n?"image.png":n,o=t.id,i=void 0===o?"unset":o,a=t.cords,l=void 0===a?[]:a,c=t.readonly,u=t.naturalHeight,s=t.naturalWidth,d=t.onChange,m=t.onClick,p=t.onHover,h=Uk().classes,v=b(null),g=b(!0),y=Vk(l),w=y.getValue();return E(function(){v.current.innerHTML='\n <react-declarative-area-selector\n imageSrc="'.concat(r,'"\n id="').concat(i,'">\n </react-declarative-area-selector>\n ');var t=function(t){var n=e(t,2),r=n[0],o=n[1];m&&m(o,r)},n=function(t){var n=e(t,2),r=n[0],o=n[1];p&&p(o,r)};return function({areaRef:e=Nk,areaEvent:t=Ik,runRef:n=Lk,resizeCallback:r=Mk,readonlyFlag:o=Rk}){Nk=e,Ik=t,Mk=r,Lk=n,Rk=o}({areaRef:function(e,t){e===i&&(t.controls=Yk(w,u,s))},areaEvent:function(r,o){for(var a=[],l=2;l<arguments.length;l++)a[l-2]=arguments[l];if(r===i)switch(o){case"rect-area-changed":!function(t){var n=e(t,6),r=n[0],o=n[1],i=n[2],a=n[3],l=n[4],c=n[5];if(g.current){var u={type:"rect",id:r,top:o,left:i,height:a,width:l,angle:c};y.commitChange(u),d(u)}}(a);break;case"roi-area-changed":!function(t){var n=e(t,4),r=n[0],o=n[1],i=n[2],a=n[3];if(g.current){var l={type:"roi",id:"roi",top:r,left:o,height:u-r-a,width:s-o-i,angle:0};y.commitChange(l),d(l)}}(a);break;case"rect-area-click":case"square-area-click":t(a);break;case"rect-area-hover":case"square-area-hover":case"root-area-hover":n(a);break;default:throw new Error("Selector unknown event type")}},readonlyFlag:c}),g.current=!0,function(){g.current=!1}},[r,i,w]),f.createElement("div",{className:h.parent,ref:v},f.createElement("img",{src:r}))},$k=function(e){var t=e.src,n=void 0===t?"image.png":t,r=e.readonly,o=e.cords,i=void 0===o?[]:o,l=e.naturalHeight,c=void 0===l?100:l,u=e.naturalWidth,s=void 0===u?100:u,d=e.onChange,m=void 0===d?function(e){return console.log({cords:e})}:d,p=e.onClick,v=e.onHover,g=zr(i),b=Qr(),y=b.reloadTrigger,w=b.doReload;$r(w,[r]);var E=h(function(){return Jn(function(e){m(g.current.map(function(t){return t.id===e.id?a(a({},e),{color:t.color,label:t.label}):t}))},100)},[]);return f.createElement(qk,{key:y,cords:i,readonly:r,src:n,id:n,naturalHeight:c,naturalWidth:s,onChange:function(e){!function(e){var t=e.top,n=e.left,r=e.height,o=e.width;return!(isNaN(t)||isNaN(n)||isNaN(r)||isNaN(o))}(e)?w():E(e)},onClick:p,onHover:v})},Xk=function(e){return new Promise(function(t,n){var r=document.createElement("img");r.crossOrigin="anonymous",r.onload=function(){var e=r.naturalHeight,n=r.naturalWidth;t({naturalHeight:e,naturalWidth:n})},r.onerror=function(){n()},r.src=e})},Gk=An()({readonly:(Hk={},Hk["& .".concat(kk)]={display:"none;"},Hk),root:{display:"flex","& > *":{width:"100%"},"& .react-declarative__roiAreaRect":{color:"white"}}}),Kk=x(function(r,o){var i,c=r.withNaturalSize,u=void 0!==c&&c,s=r.imageSize,d=r.className,m=r.src,p=r.cords,v=r.readonly,g=void 0!==v&&v,b=r.onLoadStart,y=r.onLoadEnd,w=r.sx,E=r.onChange,x=void 0===E?function(){}:E,C=r.onClick,k=void 0===C?function(){}:C,S=r.onHover,L=void 0===S?function(){}:S,N=l(r,["withNaturalSize","imageSize","className","src","cords","readonly","onLoadStart","onLoadEnd","sx","onChange","onClick","onHover"]),I=Gk().classes,M=to(x),R=to(k),P=to(L),A=e(kc(function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return s?[2,s]:[4,Xk(m)];case 1:return[2,e.sent()]}})})},{onLoadStart:b,onLoadEnd:y}),2),T=A[0],D=A[1].error,j=h(function(){var e=new Set;return p.filter(function(t){return!e.has(t.id)&&e.add(t.id)})},[p]);return f.createElement(ra,a({ref:o,className:Eo(d,I.root,(i={},i[I.readonly]=g,i)),sx:a(a({},u&&{height:s?s.naturalHeight:null==T?void 0:T.naturalHeight,width:s?s.naturalWidth:null==T?void 0:T.naturalWidth}),w)},N),T?f.createElement($k,{cords:j,naturalHeight:T.naturalHeight,naturalWidth:T.naturalWidth,onChange:M,onClick:R,onHover:P,readonly:g,src:m}):D?f.createElement(_,null,"Error aquired while fetching image"):f.createElement(_,null,"Loading..."))}),Qk=function(e){return void 0===e&&(e=1e3),{transformBox:"fill-box",transformOrigin:"center",animation:"".concat(D(Wk||(Wk=s(["\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n "],["\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n "])))," ").concat(e,"ms infinite linear")}},Jk=An()({root:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:315,minWidth:315},spin1:Qk(1e3),spin2:Qk(1500),spin3:Qk(2500),spin4:Qk(2e3)}),Zk=function(e){var t=e.className,n=l(e,["className"]),r=Jk().classes,o=M(),i="light"===o.palette.mode?o.palette.primary.main:"#fff";return f.createElement(j,a({className:Eo(t,r.root)},n),f.createElement("svg",{width:315,height:315,viewBox:"-25 -25 400 400"},f.createElement("circle",{className:r.spin4,stroke:i,transform:"rotate(-90 175 175)",cx:175,cy:175,r:105,strokeDasharray:1100,strokeWidth:10,strokeDashoffset:605,strokeLinecap:"round",fill:"none"}),f.createElement("circle",{className:r.spin3,stroke:i,transform:"rotate(-90 175 175)",cx:175,cy:175,r:130,strokeDasharray:1100,strokeWidth:10,strokeDashoffset:605,strokeLinecap:"round",fill:"none"}),f.createElement("circle",{className:r.spin2,stroke:i,transform:"rotate(-90 175 175)",cx:175,cy:175,r:155,strokeDasharray:1100,strokeWidth:10,strokeDashoffset:605,strokeLinecap:"round",fill:"none"}),f.createElement("circle",{className:r.spin1,stroke:i,transform:"rotate(-90 175 175)",cx:175,cy:175,r:175,strokeDasharray:1100,strokeWidth:10,strokeDashoffset:605,strokeLinecap:"round",fill:"none"})))},eS=null,tS=new ar,nS=function(e){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return t.trys.push([0,4,,5]),"copyToClipboard"in navigator?[4,window.navigator.copyToClipboard(e)]:[3,2];case 1:return t.sent(),[2];case 2:return[4,navigator.clipboard.writeText(e)];case 3:return t.sent(),[3,5];case 4:return t.sent(),function(e){var t=document.createElement("textarea");t.value=e,t.style.top="0",t.style.left="0",t.style.position="fixed",document.body.appendChild(t),t.focus(),t.select();try{var n=document.execCommand("copy")?"successful":"unsuccessful";console.log("Fallback: Copying text command was "+n)}catch(e){console.error("Fallback: Oops, unable to copy",e)}document.body.removeChild(t)}(e),[3,5];case 5:return[2]}})})},rS=function(e){return t(void 0,void 0,void 0,function(){var t,r;return n(this,function(n){switch(n.label){case 0:return[4,tS.next(e)];case 1:n.sent(),t=!0,n.label=2;case 2:return n.trys.push([2,7,8,9]),eS?[4,eS(e)]:[3,4];case 3:return n.sent(),[3,6];case 4:return[4,nS(e)];case 5:n.sent(),n.label=6;case 6:return[3,9];case 7:return r=n.sent(),console.error(r),t=!1,[3,9];case 8:return[2,t];case 9:return[2]}})})};rS.override=function(e){eS=e},rS.listen=function(e){return tS.subscribe(e)};var oS=An()(function(e){return{root:{display:"flex",alignItems:"center",gap:e.spacing(1)},content:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},icon:{marginRight:e.spacing(2),overflow:"hidden"},stretch:{flex:1}}}),iS=function(e){var r=e.className,o=e.content,i=e.fullWidth,c=e.transparent,u=e.children,s=void 0===u?o:u,d=e.onCopy,m=void 0===d?function(e){return function(){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||null==e?[4,rS(String(e))]:[2];case 1:return t.sent(),[2]}})})}}(o):d,p=e.onCopyClick,h=e.onLoadStart,v=e.onLoadEnd,g=e.fallback,b=e.throwError,w=void 0!==b&&b,E=l(e,["className","content","fullWidth","transparent","children","onCopy","onCopyClick","onLoadStart","onLoadEnd","fallback","throwError"]),x=oS().classes,C=y(function(e){return t(void 0,void 0,void 0,function(){var t,r;return n(this,function(n){switch(n.label){case 0:e.preventDefault(),e.stopPropagation(),t=!0,h&&h(),n.label=1;case 1:return n.trys.push([1,3,4,5]),p&&p(),[4,Promise.resolve(m(o))];case 2:return n.sent(),[3,5];case 3:if(r=n.sent(),t=!1,w)throw r;return g&&g(r),[3,5];case 4:return v&&v(t),[7];case 5:return[2]}})})},[m,h,v,g,w]);return f.createElement(j,a({className:Eo(r,x.root)},E),f.createElement(_,{className:x.content,variant:"body1"},s),!!i&&f.createElement("div",{className:x.stretch}),f.createElement(ye,{className:x.icon,variant:c?"text":"outlined",onClick:C,startIcon:f.createElement(Cn,null),size:"small"},!c&&"Copy"),!i&&f.createElement("div",{className:x.stretch}))},aS=function(e,t){if(!e||!t)return!1;var n=e.lat.toFixed(6),r=e.lng.toFixed(6),o=t.lat.toFixed(6),i=t.lng.toFixed(6),a=!0;return a=(a=a&&n===o)&&r===i},lS=function(e){var t=e.withZoomAdjust,n=void 0!==t&&t,r=e.value,o=e.readonly,i=void 0!==o&&o,c=e.zoom,u=void 0===c?15:c,s=e.token,d=void 0===s?"pk.eyJ1IjoidHJpcG9sc2t5cGV0ciIsImEiOiJjbHk0YWgzNmUwMGRiMmpzN3hzbjB4Z3J2In0.3oxAilQNCBFw7zO0AIbxfQ":s,m=e.onChange,p=void 0===m?function(){}:m,v=l(e,["withZoomAdjust","value","readonly","zoom","token","onChange"]),g=b(null),w=to(p),E=zr(i),x=zr(r),C=Xr(r),k=h(function(){return Jn(function(e){var t=function(e){var t=e.lat.toFixed(6),n=e.lng.toFixed(6);return{lat:parseFloat(t),lng:parseFloat(n)}}(e);aS(t,x.current)||w(t)},500)},[]);Xf(function(){return function(){g.current&&g.current(),k.clear()}});var S=y(function(e){var t=x.current;if(g.current&&g.current(),e&&t){window.mapboxgl.accessToken=d;var r,o=new window.mapboxgl.Map({container:e,style:"mapbox://styles/mapbox/streets-v12",center:t,zoom:u}),i=new ResizeObserver(function(){o.resize()}),a=new window.mapboxgl.Marker;if(t&&(a=a.setLngLat(t)),a.addTo(o),o.on("move",function(){if(!E.current){var e=o.getCenter(),t=e.lng,n=e.lat;a.setLngLat({lng:t,lat:n}),k({lat:n,lng:t})}}),n)o.on("zoomstart",function(){r=o.getCenter()}),o.on("zoomend",function(){o.setCenter(r),a.setLngLat(r)});a.addTo(o),i.observe(e);var l=C.subscribe(function(e){if(e){var t=o.getCenter();if(!aS(e,t)){var n=e.lng,r=e.lat;a.setLngLat({lng:n,lat:r}),o.setCenter({lng:n,lat:r})}}});g.current=so(function(){i.unobserve(e),a.remove(),o.remove(),l()})}},[]);return r?f.createElement(j,a({ref:S},v)):f.createElement(rb,a({},v),f.createElement(_,null,"Point not choosen"))},cS=function(r){var o=r.disabled,i=r.className,a=r.style,l=r.sx,c=r.onClick,u=r.content,s=r.onCopy,d=void 0===s?function(e){return function(){return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||null==e?[4,rS(String(e))]:[2];case 1:return t.sent(),[2]}})})}}(u):s,m=r.delay,p=void 0===m?800:m,v=r.variant,b=void 0===v?"text":v,y=r.size,E=void 0===y?"small":y,x=r.color,C=void 0===x?"info":x,k=r.startIcon,S=void 0===k?f.createElement(Cn,null):k,L=r.label,N=void 0===L?u:L,I=e(g(!1),2),M=I[0],R=I[1],P=h(function(){return Jn(function(){R(!1)},p)},[]);return w(function(){return function(){return P.clear()}},[]),f.createElement(Nt,{className:i,style:a,sx:l,open:M,title:"Copied!",placement:"bottom",arrow:!0,disableFocusListener:!0,disableTouchListener:!0},f.createElement(ye,{disabled:o,variant:b,color:C,onClick:function(e){e.preventDefault(),e.stopPropagation(),c?c(e,function(){R(!0),d(String(u)),P()}):(R(!0),d(String(u)),P())},startIcon:S,size:E},N))},uS=function(t){function n(){var n=t.apply(this,r([],e(arguments),!1))||this;return n.componentDidMount=function(){var e;n.unsubscribe=null===(e=n.props.target)||void 0===e?void 0:e.subscribe(function(){n.forceUpdate()})},n.componentWillUnmount=function(){n.unsubscribe&&n.unsubscribe()},n.render=function(){return f.createElement(f.Fragment,null,n.props.children)},n}return u(n,t),n}(f.Component),sS=An()(function(e){return{root:{display:"flex",alignItems:"center",justifyContent:"center"},container:{display:"flex",alignItems:"center",justifyContent:"center",gap:e.spacing(1)}}}),dS=function(t){var n=t.className,r=t.children,o=t.expireAt,i=t.onExpire,c=void 0===i?function(){}:i,u=l(t,["className","children","expireAt","onExpire"]),s=sS().classes,d=e(g(),2),m=d[0],p=d[1],v=b(),E=to(c),x=h(function(){var e=new Date(o);return new Date(+e-Date.now())},[m]);w(function(){return v.current=setInterval(function(){p(Date.now())}),function(){clearInterval(v.current)}},[]),w(function(){+x<0&&(E(),clearInterval(v.current))},[x]);var C=y(function(){return+x<0?r?f.createElement(f.Fragment,null,r):f.createElement(f.Fragment,null,f.createElement(kn,null),f.createElement(_,{variant:"body1"},"00:00")):f.createElement(f.Fragment,null,f.createElement(kn,null),f.createElement(_,{variant:"body1"},x.getMinutes().toString().padStart(2,"0"),":",x.getSeconds().toString().padStart(2,"0")))},[x,r]);return f.createElement(j,a({className:Eo(s.root,n)},u),f.createElement(j,{className:s.container},C()))},fS=function(e){var t=e.color,n=l(e,["color"]),r=re(),o=h(function(){return pe(a(a({},r),{palette:a(a({},r.palette),{primary:{main:t||r.palette.primary.main}})}))},[r,t]);return f.createElement(he,{theme:o},f.createElement(He,a({variant:"outlined"},n,{color:"primary"})))},mS=!1,pS=25,hS=null,vS=An()(function(e){var t;return{adjust:(t={},t[e.breakpoints.down("md")]={paddingBottom:pS},t),adjustForce:{paddingBottom:pS}}}),gS=function(){var e,t=vS().classes;return m.createElement("div",{className:Eo((e={},e[t.adjust]=!mS,e[t.adjustForce]=mS,e))},hS&&S(hS))};gS.setAdjustForce=function(e){mS=e},gS.setAdjustHeight=function(e){pS=e},gS.setAdjustFiller=function(e){hS=e};var bS,yS=An()(function(e){return{root:{display:"flex",flexDirection:"column",alignItems:"stretch",justifyContent:"stretch",overflow:"hidden",background:e.palette.background.paper},label:{minHeight:"35px",width:"100%",display:"flex",alignItems:"center",background:"light"===e.palette.mode?A("#000",.05):e.palette.background.paper,"& > *":{paddingLeft:"6px",opacity:.5}},container:{position:"relative",background:"light"===e.palette.mode?e.palette.background.paper:A("#000",.05),flex:1},content:{position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *":{flex:1}},passthrough:{display:"block",width:"100%"}}}),wS=function(e){var t=e.passthrough,n=void 0!==t&&t,r=e.children,o=void 0===r?null:r,i=e.className,a=e.style,l=e.sx,c=e.label,u=yS().classes;return n?f.createElement(j,{className:Eo(u.passthrough,i),sx:l,style:a},o):f.createElement(ke,{className:Eo(u.root,i),sx:l,style:a},!!c&&f.createElement(j,{className:u.label},f.createElement(_,null,c)),f.createElement("div",{className:u.container},f.createElement("div",{className:u.content},o)))},ES="react-declatative__master-detail-root",xS="react-declatative__master-detail-header",CS=An()(function(e){return{root:{display:"flex",alignItems:"stretch",justifyContent:"stretch"},sideMenu:{flex:1,maxWidth:256,overflowY:"auto",borderRight:"1px solid ".concat(e.palette.divider)},listItem:{"&:not(:last-of-type)":{borderBottom:"1px solid ".concat(e.palette.divider)}},content:{position:"relative",flex:1,overflowY:"auto",padding:e.spacing(1)}}}),kS=function(e){var t=e.children,n=e.items,r=e.onChange,o=CS().classes;return f.createElement(j,{className:o.root},f.createElement(Ie,{disablePadding:!0,dense:!0,className:Eo(o.sideMenu,xS)},n.filter(function(e){return!!e.visible}).map(function(e,t){var n=e.id,i=e.active,a=e.disabled,l=e.icon,c=e.label;return f.createElement(tt,{disableGutters:!0,disablePadding:!0,dense:!0,key:"".concat(n,"-").concat(t),className:o.listItem},f.createElement(Me,{disabled:a,selected:i,onClick:function(){return r(n)}},!!l&&f.createElement(F,null,f.createElement(l,null)),f.createElement(Oe,null,c)))})),f.createElement(j,{className:o.content},t))},SS=An()(function(e){return{root:{display:"flex",alignItems:"stretch",justifyContent:"stretch",flexDirection:"column"},header:{background:"light"===e.palette.mode?$("#000",.05):e.palette.background.paper},content:{position:"relative",flex:1,overflowY:"auto",padding:e.spacing(1)},tabsRoot:{marginLeft:"0 !important",minHeight:48,height:48},tabRoot:{minHeight:48,height:48}}}),LS=function(e){var t=e.items,n=e.children,r=e.onChange,o=SS().classes,i=h(function(){return t.find(function(e){return e.active})},[t]);return f.createElement(j,{className:o.root},f.createElement(lt,{className:Eo(o.header,xS),variant:"scrollable",indicatorColor:"primary",value:null==i?void 0:i.id,classes:{root:o.tabsRoot},onChange:function(e,t){return r(t)}},t.filter(function(e){return e.visible}).map(function(e,t){var n=e.id,r=e.label,i=e.disabled,a=e.icon;return f.createElement(at,{key:"".concat(n,"-").concat(t),label:r,value:n,disabled:i,icon:a&&f.createElement(a,null),iconPosition:"start",classes:{root:o.tabRoot}})})),f.createElement(j,{className:o.content},n))};!function(e){e.Paper="paper",e.Outline="outline",e.Card="card",e.Tabs="tabs"}(bS||(bS={}));var NS,IS=bS,MS=An()(function(e,t,n){var r,o,i=t.headerAdjust;return{root:{display:"grid"},desktop:(r={gridTemplateColumns:"256px 1fr"},r["& .".concat(n.sideMenu)]={paddingRight:e.spacing(2),paddingBottom:e.spacing(2)},r),mobile:(o={gridTemplateColumns:"1fr"},o["& .".concat(n.sideMenu)]={paddingBottom:e.spacing(1)},o),outline:{border:"1px solid ".concat($(e.palette.getContrastText(e.palette.background.default),.23)),borderRadius:"4px"},sideMenu:{overflowY:"auto",maxHeight:"80vh",overflowX:"hidden",width:"100%","& > * > *":{width:"100%"}},content:{position:"relative",overflowY:"auto",overflowX:"hidden"},listItem:{"&:not(:last-of-type)":{borderBottom:"1px solid ".concat(e.palette.divider)}},fixedPos:{position:"fixed",top:i,width:240}}}),RS=function(t){var n,r=t.mode,o=t.loading,i=t.items,a=t.children,l=t.onChange,c=t.withMenuCollapse,u=t.withFixedPos,s=t.fixedPosHeaderAdjust,d=b(null),m=e(g(!1),2),p=m[0],h=m[1],v=tl().isWide,y=MS({headerAdjust:s}).classes;w(function(){var e=d.current,t=null==e?void 0:e.closest(".".concat(ES));if(u&&e&&t){var n=function(){var e=t.getBoundingClientRect().top,n=document.documentElement.scrollTop;h(n>(e+=n))};return n(),document.addEventListener("scroll",n),function(){return document.removeEventListener("scroll",n)}}},[d.current,v]);var E=function(){return f.createElement(Ie,{disablePadding:!0,dense:!0},i.map(function(e,t){var n=e.id,r=e.active,o=e.disabled,i=e.icon,a=e.label;return f.createElement(tt,{disableGutters:!0,disablePadding:!0,dense:!0,key:"".concat(n,"-").concat(t),className:y.listItem},f.createElement(Me,{disabled:o,selected:r,onClick:function(){return l(n)}},!!i&&f.createElement(F,null,f.createElement(i,null)),f.createElement(Oe,null,a)))}))};return f.createElement(j,{className:Eo(y.root,(n={},n[y.desktop]=v&&!!i.length,n[y.mobile]=!v,n))},function(){var e,t;return r===IS.Paper?f.createElement(f.Fragment,null,f.createElement("div",{className:y.sideMenu},(!!i.length||!!o||!c)&&f.createElement(ee,{className:Eo(xS,(e={},e[y.fixedPos]=p&&v,e)),ref:d},E())),f.createElement("div",{className:y.content},a)):r===IS.Outline?f.createElement(f.Fragment,null,f.createElement("div",{className:y.sideMenu},(!!i.length||!!o||!c)&&f.createElement(j,{className:Eo(xS,y.outline,(t={},t[y.fixedPos]=p&&v,t)),ref:d},E())),f.createElement("div",{className:y.content},a)):null}())},PS=An()(function(e,t){var n=t.headerAdjust,r=t.width;return{root:{position:"relative",width:"100%"},header:{height:64,background:e.palette.background.default,display:"flex",alignItems:"center",zIndex:9,width:r},headerAbsolute:{position:"absolute",top:0,left:0},headerFixed:{position:"fixed",top:n},headerNone:{visibility:"hidden",pointerEvents:"none"},adjust:{paddingBottom:64},paper:{width:r,display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *":{flex:1}},tabsRoot:{minHeight:54,height:54,marginLeft:"0 !important",marginRight:"0 !important"},tabRoot:{minHeight:54,height:54},disabledTab:{opacity:.5,cursor:"not-allowed"},indicator:{height:4,background:e.palette.primary.main}}}),AS=function(t){var n,r=t.children,o=t.items,i=t.onChange,a=t.loading,l=t.withFixedPos,c=t.withTransparentTabs,u=t.fixedPosHeaderAdjust,s=b(null),d=bi(),m=d.elementRef,p=d.size.width,v=e(g(!1),2),y=v[0],E=v[1],x=PS({headerAdjust:u,width:p||"100%"}).classes;w(function(){var e=s.current,t=null==e?void 0:e.closest(".".concat(ES));if(l&&e&&t){var n=function(){var e=t.getBoundingClientRect().top,n=document.documentElement.scrollTop;E(n>(e+=n))};return n(),document.addEventListener("scroll",n),function(){return document.removeEventListener("scroll",n)}}},[s.current,a]);var C=h(function(){var e;return(null===(e=o.find(function(e){return e.active}))||void 0===e?void 0:e.id)||"unknown"},[o]),k=function(){return f.createElement(lt,{variant:"scrollable",indicatorColor:"primary",value:C,classes:{root:x.tabsRoot,indicator:x.indicator},onChange:function(e,t){return i(t)}},o.map(function(e,t){var n,r=e.id,o=e.label,i=e.disabled,a=e.icon;return f.createElement(at,{className:Eo((n={},n[x.disabledTab]=i,n)),key:"".concat(r,"-").concat(t),label:o,value:r,disabled:i,icon:a&&f.createElement(a,null),iconPosition:"start",classes:{root:x.tabRoot}})}))};return f.createElement(j,{ref:m,className:x.root},function(){var e;return c?f.createElement(j,{className:xS,sx:{zIndex:9}},k()):f.createElement(j,{className:Eo(xS,x.header,(e={},e[x.headerNone]=!o.length,e[x.headerAbsolute]=!y,e[x.headerFixed]=y,e))},f.createElement(ke,{className:x.paper},k()))}(),!c&&f.createElement("div",{ref:s,className:Eo((n={},n[x.adjust]=!!o.length,n))}),r)},TS=function(e){var t=tl().isMobile;return e.mode===IS.Tabs?f.createElement(AS,a({},e)):e.mode===IS.Outline||e.mode===IS.Paper?f.createElement(RS,a({},e)):t||!e.items.length?f.createElement(LS,a({},e)):f.createElement(kS,a({},e))},DS=Dw.createLoader(48),jS=function(){return f.createElement(f.Fragment,null)},OS=An()({root:{width:"100%",minHeight:225,display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *":{flex:1}}}),FS=function(o){var i=o.mode,c=void 0===i?IS.Card:i,u=o.withTransparentTabs,s=void 0!==u&&u,d=o.withMenuCollapse,m=void 0!==d&&d,p=o.withFixedPos,v=void 0!==p&&p,b=o.fixedPosHeaderAdjust,y=void 0===b?0:b,E=o.title,x=o.className,C=o.style,k=o.sx,S=o.activeOption,L=void 0===S?"":S,N=o.payload,I=o.deps,M=void 0===I?[]:I,R=o.options,P=o.children,A=o.Loader,T=void 0===A?DS:A,D=o.Error,O=void 0===D?jS:D,F=o.onActiveOptionChange,_=o.fallback,B=o.onLoadStart,H=o.onLoadEnd,W=o.throwError,z=tl().isMobile,V=OS().classes,Y=e(g(L),2),U=Y[0],q=Y[1],$=zr(U),X=e(g([]),2),G=X[0],K=X[1],Q=Ai(function(e){return t(void 0,void 0,void 0,function(){var r,o;return n(this,function(i){switch(i.label){case 0:return[4,Promise.all(R.map(function(r){return t(void 0,void 0,void 0,function(){var t,o=r.id,i=r.label,c=r.isVisible,u=void 0===c?function(){return!0}:c,s=r.isDisabled,d=void 0===s?function(){return!1}:s,f=r.isActive,m=void 0===f?function(){return $.current===o}:f,p=l(r,["id","label","isVisible","isDisabled","isActive"]);return n(this,function(n){switch(n.label){case 0:return t={id:o},[4,u(e)];case 1:return t.visible=n.sent(),[4,d(e)];case 2:return t.disabled=n.sent(),[4,m(e)];case 3:return[2,a.apply(void 0,[(t.active=n.sent(),t.label=i||Db(o),t),p])]}})})}))];case 1:return r=(r=i.sent()).filter(function(e){return e.visible}),o=r.find(function(e){return e.active})||r[0],o&&(o.active=!0),[2,r]}})})},{onLoadStart:B,onLoadEnd:H,throwError:W,fallback:_}),J=Q.loading,Z=Q.error,ee=Q.execute;w(function(){ee(N).then(function(e){if(e){if(!$.current){var t=e.find(function(e){return e.active});t&&te(t.id,!0)}K(e)}})},r([N,U],e(M),!1));var te=function(e,t){void 0===t&&(t=!1),q(e),F&&F(e,t)},ne=h(function(){var e=!1;return e=(e=(e=e||c===IS.Outline)||c===IS.Paper)||c===IS.Tabs},[c]);return f.createElement(j,{className:Eo(x,V.root),style:C,sx:k},f.createElement(wS,{className:ES,passthrough:ne,label:z?void 0:E},J?f.createElement(T,null):Z?f.createElement(O,null):f.createElement(TS,{withTransparentTabs:s,withMenuCollapse:m,withFixedPos:v,fixedPosHeaderAdjust:y,loading:J,items:G,mode:c,onChange:te},P)))},_S=function(){function t(t){void 0===t&&(t="root");var n=this;this._name=t,this.UML_STEP="\t",this.nodeMap=new Map,this.nodes=[],this.entries=[],this.provide=0,this.canceled=!1,this.createNode=function(e){return n.nodeMap.has(e)?n.nodeMap.get(e):n.nodeMap.set(e,{key:e,nodes:[]}).get(e)},this.beginProvide=function(e){n.canceled||(n.entries.unshift(n.createNode(e)),n.provide+=1)},this.endProvide=function(e){n.canceled||(n.entries.shift(),n.provide-=1)},this.beginInject=function(t,r){if(!n.canceled){r&&console.log("resolutionManager beginInject key=".concat(String(t)," root=").concat(n.isRootNodeState," pending=").concat(n.isPendingProvideState));var o=e(n.entries,1)[0],i=n.createNode(t);n.isRootNodeState&&n.nodes.push(i),n.isPendingProvideState&&o.nodes.push(i)}},this.endInject=function(e,t){n.canceled||t&&console.log("resolutionManager endInject key=".concat(String(e)," root=").concat(n.isRootNodeState," pending=").concat(n.isPendingProvideState))},this.toYamlUML=function(t){if(void 0===t&&(t=3),console.log("ResolutionManager building UML for ".concat(n._name)),n.canceled)return console.log("ResolutionManager collecting UML canceled due to async resolve found"),"";var o=[],i=function(a,l){var u,s;void 0===l&&(l=0);try{for(var d=c(a),f=d.next();!f.done;f=d.next()){var m=f.value,p=m.key,h=m.nodes,v=r([],e(new Array(l)),!1).fill(n.UML_STEP).join("");h.length&&l<t?(o.push("".concat(v).concat(String(p),":")),i(h,l+1)):o.push("".concat(v).concat(String(p),': ""'))}}catch(e){u={error:e}}finally{try{f&&!f.done&&(s=d.return)&&s.call(d)}finally{if(u)throw u.error}}};return i(n.nodes),r(r(["@startyaml"],e(o),!1),["@endyaml"],!1).join("\n")},this.cancelResolution=function(){n.canceled=!0,n.provide=0,n.nodeMap.clear(),n.nodes=[],n.entries=[]}}return Object.defineProperty(t.prototype,"isRootNodeState",{get:function(){return 0===this.provide},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isPendingProvideState",{get:function(){var t=e(this.entries,1)[0];return!!(void 0===t?null:t)},enumerable:!1,configurable:!0}),t}(),BS=function(o){void 0===o&&(o="root");var i=this;this._name=o,this.InstanceRef=function(e){var r;return(r=function(e,o){var i=this;this.queueFactory=Gn(function(e){return t(i,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,e];case 1:return[2,t.sent()]}})})}),r._waitPool.push(o),r._keys.push(e),this.queueFactory(o).then(function(e){e!==$n&&Object.setPrototypeOf(i,e)})})._waitPool=[],r._keys=[],r.waitForProvide=function(o){return t(void 0,void 0,void 0,function(){return n(r,function(t){switch(t.label){case 0:return[4,Promise.all(this._waitPool.map(function(t,n){return t.then(function(){o&&console.info("react-declarative serviceManager ".concat(e," waitForProvide done for ").concat(String(r._keys[n])))}),t.catch(function(t){throw o&&console.info("react-declarative serviceManager ".concat(e," waitForProvide error for ").concat(String(r._keys[n]))),t}),t}))];case 1:return t.sent(),[2]}})})},r}(this._name),this._creators=new Map,this._instances=new Map,this._resolutionOrder=[],this._reverseCounter=0,this.resolutionManager=new _S(this._name),this._checkCircularDependency=function(e){var t=i._resolutionOrder.lastIndexOf(e);if(-1!==t){var n=i._resolutionOrder.length,r=i._resolutionOrder.slice(Math.max(t-1,0),n);throw r.push(r[0]),console.warn('react-declarative serviceManager "'.concat(i._name,'" circular dependency'),r.map(function(e){return e.toString()}).join("->")),new Error("Circular Dependency detected")}i._resolutionOrder.push(e)},this._updateResolutionOrder=function(t){if(0===i._reverseCounter){var n=i._resolutionOrder.slice(0,t),o=i._resolutionOrder.slice(t).reverse();i._resolutionOrder=r(r([],e(n),!1),e(o),!1)}},this.registerInstance=function(e,t){i._instances.has(e)||i._instances.set(e,t)},this.registerCreator=function(e,t){i._creators.has(e)||i._creators.set(e,function(){i.resolutionManager.beginProvide(e);var n=t();return n instanceof Promise&&i.resolutionManager.cancelResolution(),i.resolutionManager.endProvide(e),n})},this.inject=function(e,t){if(void 0===t&&(t=!0),i._instances.has(e)){i.resolutionManager.beginInject(e,t);var n=i._instances.get(e);return i.resolutionManager.endInject(e,t),n}if(i._creators.has(e)){i._checkCircularDependency(e);var r=Math.max(i._resolutionOrder.length-1,0);i._reverseCounter++,i.resolutionManager.beginInject(e,t);var o=i._creators.get(e)();return i.resolutionManager.endInject(e,t),n=o instanceof Promise?new i.InstanceRef(e,o):o,i._reverseCounter--,i._updateResolutionOrder(r),i._instances.set(e,n),n}return t&&console.error("react-declarative serviceManager ".concat(i._name," unknown service"),e),null},this.waitForProvide=so(function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];return t(i,r([],e(o),!1),void 0,function(e){return void 0===e&&(e=!1),n(this,function(t){switch(t.label){case 0:return[4,this.InstanceRef.waitForProvide(e)];case 1:return t.sent(),[2]}})})}),this.prefetch=so(function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];return t(i,r([],e(o),!1),void 0,function(e){var t,r,o,i,a,l,u,s,d,f,m,p,h,v;return void 0===e&&(e=!0),n(this,function(n){switch(n.label){case 0:this.unload.clear(),n.label=1;case 1:n.trys.push([1,19,,20]),t=new Set(this._resolutionOrder),n.label=2;case 2:n.trys.push([2,8,9,10]),r=c(this._resolutionOrder),o=r.next(),n.label=3;case 3:return o.done?[3,7]:(u=o.value,e&&console.info("react-declarative serviceManager ".concat(this._name," prefetch ").concat(String(u))),(s=this._instances.get(u)).prefetch?[4,s.prefetch()]:[3,5]);case 4:n.sent(),n.label=5;case 5:n.label=6;case 6:return o=r.next(),[3,3];case 7:return[3,10];case 8:return i=n.sent(),m={error:i},[3,10];case 9:try{o&&!o.done&&(p=r.return)&&p.call(r)}finally{if(m)throw m.error}return[7];case 10:n.trys.push([10,16,17,18]),a=c(this._instances.keys()),l=a.next(),n.label=11;case 11:return l.done?[3,15]:(u=l.value,t.has(u)?[3,14]:(e&&console.info("react-declarative serviceManager ".concat(this._name," prefetch ").concat(String(u))),(s=this._instances.get(u)).prefetch?[4,s.prefetch()]:[3,13]));case 12:n.sent(),n.label=13;case 13:n.label=14;case 14:return l=a.next(),[3,11];case 15:return[3,18];case 16:return d=n.sent(),h={error:d},[3,18];case 17:try{l&&!l.done&&(v=a.return)&&v.call(a)}finally{if(h)throw h.error}return[7];case 18:return[3,20];case 19:throw f=n.sent(),e&&console.error("react-declarative serviceManager ".concat(this._name," prefetch error"),f),f;case 20:return[2]}})})}),this.unload=so(function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];return t(i,r([],e(o),!1),void 0,function(e){var t,r,o,i,a,l,u,s,d,f,m,p,h,v;return void 0===e&&(e=!0),n(this,function(n){switch(n.label){case 0:this.prefetch.clear(),n.label=1;case 1:n.trys.push([1,19,,20]),t=new Set(this._resolutionOrder),n.label=2;case 2:n.trys.push([2,8,9,10]),r=c(this._resolutionOrder),o=r.next(),n.label=3;case 3:return o.done?[3,7]:(u=o.value,e&&console.info("react-declarative serviceManager ".concat(this._name," unload ").concat(String(u))),(s=this._instances.get(u)).unload?[4,s.unload()]:[3,5]);case 4:n.sent(),n.label=5;case 5:n.label=6;case 6:return o=r.next(),[3,3];case 7:return[3,10];case 8:return i=n.sent(),m={error:i},[3,10];case 9:try{o&&!o.done&&(p=r.return)&&p.call(r)}finally{if(m)throw m.error}return[7];case 10:n.trys.push([10,16,17,18]),a=c(this._instances.keys()),l=a.next(),n.label=11;case 11:return l.done?[3,15]:(u=l.value,t.has(u)?[3,14]:(e&&console.info("react-declarative serviceManager ".concat(this._name," unload ").concat(String(u))),(s=this._instances.get(u)).unload?[4,s.unload()]:[3,13]));case 12:n.sent(),n.label=13;case 13:n.label=14;case 14:return l=a.next(),[3,11];case 15:return[3,18];case 16:return d=n.sent(),h={error:d},[3,18];case 17:try{l&&!l.done&&(v=a.return)&&v.call(a)}finally{if(h)throw h.error}return[7];case 18:return[3,20];case 19:throw f=n.sent(),e&&console.error("react-declarative serviceManager ".concat(this._name," unload error"),f),f;case 20:return[2]}})})}),this.clear=function(){i._resolutionOrder=[],i._reverseCounter=0,i._creators.clear(),i._instances.clear(),i.prefetch.clear(),i.unload.clear()},this.toUML=function(e){return void 0===e&&(e=3),i.resolutionManager.toYamlUML(e)},this.disableUML=function(){return i.resolutionManager.cancelResolution()}},HS=new function(){var o=this;this.registerInstance=function(e,t){return o._serviceManager.registerInstance(e,t)},this.registerCreator=function(e,t){return o._serviceManager.registerCreator(e,t)},this.inject=function(e,t){return void 0===t&&(t=!0),o._serviceManager.inject(e,t)},this.waitForProvide=function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];return t(o,r([],e(i),!1),void 0,function(e){return void 0===e&&(e=!0),n(this,function(t){switch(t.label){case 0:return[4,this._serviceManager.waitForProvide(e)];case 1:return[2,t.sent()]}})})},this.prefetch=function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];return t(o,r([],e(i),!1),void 0,function(e){return void 0===e&&(e=!0),n(this,function(t){switch(t.label){case 0:return[4,this._serviceManager.prefetch(e)];case 1:return[2,t.sent()]}})})},this.unload=function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];return t(o,r([],e(i),!1),void 0,function(e){return void 0===e&&(e=!0),n(this,function(t){switch(t.label){case 0:return[4,this._serviceManager.unload(e)];case 1:return[2,t.sent()]}})})},this.clear=function(){return o._serviceManager.clear()},this.toUML=function(){return o._serviceManager.toUML()},this.disableUML=function(){return o._serviceManager.disableUML()},window.__reactDeclarative_ServiceManager||(window.__reactDeclarative_ServiceManager=new BS("global")),this._serviceManager=window.__reactDeclarative_ServiceManager},WS=HS.registerCreator,zS=HS.waitForProvide,VS=HS.inject,YS=HS.prefetch,US=HS.unload,qS=function(e){void 0===e&&(e="unknown");var r=new BS(e);return{serviceManager:r,provide:r.registerCreator,inject:function(t){var n=r.inject(t,!1);if(n)return n;var o=HS.inject(t,!1);return!o&&console.error("react-declarative serviceManager ".concat(e," unknown service"),t),o},prefetch:function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,HS.prefetch()];case 1:return e.sent(),[4,r.prefetch()];case 2:return e.sent(),[2]}})})},unload:function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,r.unload()];case 1:return e.sent(),[2]}})})},dispose:function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,r.unload()];case 1:return e.sent(),[4,HS.unload()];case 2:return e.sent(),[2]}})})}}},$S=new function(){var t=this;this._closeSubject=new ar,this.init=function(){var n=t,o=function(t){function o(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];var a=t.apply(this,r([],e(o),!1))||this;return a.addEventListener("close",function(e){n._closeSubject.next(e)}),a.addEventListener("error",function(e){n._closeSubject.next(e)}),a}return u(o,t),o}(window.WebSocket);window.WebSocket=o},this.listenDisconnect=function(e){return t._closeSubject.subscribe(e)}},XS=function(e,t){var n,r;try{for(var o=c(e),i=o.next();!i.done;i=o.next()){var a=i.value,l=a.path;if(_t(void 0===l?"/":l,[]).test(t))return a}}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return null},GS=function(e,t){var n,r,o=function(e){var n={},r=[],o=_t(e,r);if(o.test(t)){var i=o.exec(t);return i&&r.forEach(function(e,t){n[e.name]=i[t+1]}),{value:n}}};try{for(var i=c(e),a=i.next();!a.done;a=i.next()){var l=o(a.value.path);if("object"==typeof l)return l.value}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return null},KS=function(e){function t(t,n){var r=e.call(this)||this;return r._item=null,r._params=null,r.dispose=function(){r._unsubscribe()},r._unsubscribe=n.listen(function(e){var n=e.location;r._params=GS(t,n.pathname),r._item=XS(t,n.pathname),r.next()}),r._params=GS(t,location.pathname),r._item=XS(t,location.pathname),r}return u(t,e),Object.defineProperty(t.prototype,"params",{get:function(){return this._params},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"item",{get:function(){return this._item},enumerable:!1,configurable:!0}),t}(ar),QS=function(e,t){var n=new KS(e,t),r=function(){return n.params};return r.clear=n.dispose(),r},JS=function(e,t){var n=new KS(e,t),r=function(){return n.item};return r.clear=n.dispose(),r},ZS=function(t){function n(o){var i=t.apply(this,r([],e(o),!1))||this;return i.includes=function(e){return i._sourceHash.has(e)},i.filter=function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];var l=o;return new n(t.prototype.filter.apply(i,r([],e(l),!1)))},i.map=function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];var l=o;return new n(t.prototype.map.apply(i,r([],e(l),!1)))},i.push=function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var a=t.prototype.push.apply(i,r([],e(n),!1));return i._sourceHash=new Set(i),a},i.pop=function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var a=t.prototype.pop.apply(i,r([],e(n),!1));return i._sourceHash=new Set(i),a},i.unshift=function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var a=t.prototype.unshift.apply(i,r([],e(n),!1));return i._sourceHash=new Set(i),a},i.shift=function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var a=t.prototype.shift.apply(i,r([],e(n),!1));return i._sourceHash=new Set(i),a},i.splice=function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var a=t.prototype.splice.apply(i,r([],e(n),!1));return i._sourceHash=new Set(i),a},i.slice=function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];return new n(t.prototype.slice.apply(i,r([],e(o),!1)))},i.concat=function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];return new n(t.prototype.concat.apply(i,r([],e(o),!1)))},i.toArray=function(){return new(Array.bind.apply(Array,r([void 0],e(i),!1)))},i._sourceHash=new Set(o),i}return u(n,t),n}(Array),eL=function(e){var t=e.readonly,n=e.value,r=e.onValueChange,o=Qr(),i=o.reloadTrigger,a=o.doReload,l=Xr(t);return w(function(){return l.subscribe(a)},[]),{key:i,readOnly:t,value:t?n:void 0,defaultValue:n,onBlur:function(e){r(e.target.value)}}},tL=An()({container:{position:"relative",display:"flex",alignItems:"stretch",justifyContent:"stretch",maxHeight:"45vh",overflowY:"auto",overflowX:"hidden"},content:{flex:1,display:"flex",flexDirection:"column",justifyContent:"stretch"},loader:{position:"absolute",top:0,left:0,right:0,bottom:0,height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center"},beforeContent:{width:"100%",display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *":{flex:1}},afterContent:{width:"100%",display:"flex",alignItems:"stretch",justifyContent:"stretch","& > *":{flex:1}}}),nL=function(r){var o=r.keepMounted,i=void 0!==o&&o,a=r.AfterContent,l=r.BeforeContent,c=r.deps,u=r.payload,s=r.onLoadStart,d=r.onLoadEnd,m=r.onAction,p=void 0===m?function(){}:m,h=r.options,v=void 0===h?[]:h,b=r.fallback,y=r.reloadSubject,w=r.throwError,E=tL().classes,x=e(g(null),2),C=x[0],k=x[1],S=e(g(0),2),L=S[0],N=S[1],I=to(p),M=zr(v),R=function(){N(function(e){return e+1}),s&&s()},P=function(e){N(function(e){return Math.max(e-1,0)}),d&&d(e)},A=Ai(I,{onLoadStart:R,onLoadEnd:P,throwError:w,fallback:b}).execute;return{elementProps:{onContextMenu:function(e){if(M.current.length){e.preventDefault(),e.stopPropagation();var t=document.elementFromPoint(e.clientX,e.clientY);k(t||e.target)}}},render:function(){return f.createElement(W,{keepMounted:i,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},anchorEl:C,open:!!C,onClose:function(){return k(null)},MenuListProps:{disablePadding:!0,sx:{pt:l?0:1,pb:a?0:1}}},f.createElement(j,{className:E.container},0!==L&&f.createElement(j,{className:E.loader},f.createElement(O,{size:14})),f.createElement(j,{className:E.content,sx:{visibility:0!==L?"hidden":"visible"}},l&&f.createElement(j,{className:E.beforeContent},f.createElement(l,null)),M.current.map(function(e,r){var o=e.label,i=void 0===o?"unknown-label":o,a=e.action,l=void 0===a?"unknown-action":a,s=e.divider,d=e.icon,m=e.isDisabled,p=void 0===m?function(){return!1}:m,h=e.isVisible,v=void 0===h?function(){return!0}:h;return f.createElement(Jr,{Loader:function(){return s?null:f.createElement(B,{sx:{visibility:"hidden",minWidth:225}},!!d&&f.createElement(F,null,f.createElement(d,null)),f.createElement(_,{variant:"inherit"},i))},throwError:w,fallback:b,key:r,onLoadStart:R,onLoadEnd:P,reloadSubject:y,deps:c,payload:u},function(e){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return[4,qn(0)];case 1:return n.sent(),[4,p(e)];case 2:return t=n.sent(),[4,v(e)];case 3:return n.sent()?s?[2,f.createElement(H,{orientation:"horizontal"})]:[2,f.createElement(B,{disabled:t,onClick:(r=l,function(e){e.preventDefault(),e.stopPropagation(),A(r),k(null)}),sx:{minWidth:225}},!!d&&f.createElement(F,null,f.createElement(d,null)),f.createElement(_,{variant:"inherit"},i))]:[2,null]}var r})})})}),a&&f.createElement(j,{className:E.afterContent},f.createElement(a,null)))))}}},rL=function(e){var t=to(e);return h(function(){return so(t)},[])},oL=function(t,n){var r=Or(function(){return new KS(t,n)}),o=b(!0),i=e(g(r.item),2),a=i[0],l=i[1];return w(function(){return r.subscribe(function(){o.current&&l(r.item)})},[]),w(function(){return function(){r.dispose()}},[]),E(function(){return function(){o.current=!1}},[]),a},iL=function(t,n){var r=Or(function(){return new KS(t,n)}),o=b(!0),i=e(g(r.params),2),a=i[0],l=i[1];return w(function(){return r.subscribe(function(){o.current&&l(r.params)})},[]),w(function(){return function(){r.dispose()}},[]),E(function(){return function(){o.current=!1}},[]),a},aL=function(r){void 0===r&&(r=[]);var o=Fr(),i=zr(r),a=$r(function(){o.next()},r),l=y(function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,o.toPromise()];case 1:return e.sent(),[2,i.current]}})})},[]);return{useChanges:function(){var t=e(g(!0),2)[1];w(function(){return o.subscribe(function(){t(function(e){return!e})})},[])},waitForChanges:l,changeSubject:o,watch:a}},lL=function(){var t=e(g(!0),2)[1];return y(function(){t(function(e){return!e})},[])},cL=function(e){var t=new function(){e&&Object.setPrototypeOf(this,e)};return{pointer:t,setPointer:function(e){Object.setPrototypeOf(t,e)}}},uL=function(e){return h(function(){var t=cL(e);return[t.pointer,t.setPointer]},[])},sL=function(e,t){return Bt(e,{encode:decodeURIComponent})(t)},dL=function(e,t){return Ht(e,{decode:decodeURIComponent})(t)||null},fL=function(e){var t,n,r="Unknown error";return"string"==typeof e?r=e:"object"==typeof e&&null!==e&&(void 0!==(null===(t=null==e?void 0:e.error)||void 0===t?void 0:t.message)?r=e.error.message:void 0!==(null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.message)?r=e.data.message:void 0!==(null==e?void 0:e.message)&&(r=e.message)),r},mL=function(o,i){var u=i.delay,s=void 0===u?0:u,d=i.onError,f=void 0===d?function(){}:d,m=i.onProgress,p=void 0===m?function(){}:m,h=i.onFinish,v=void 0===h?function(){}:h,w=i.onBegin,x=void 0===w?function(){}:w,C=i.onEnd,k=void 0===C?function(){}:C,S=l(i,["delay","onError","onProgress","onFinish","onBegin","onEnd"]),L=e(Dr(function(){return{errors:[],progress:0}}),2),N=L[0],I=L[1],M=e(g(""),2),R=M[0],P=M[1],A=to(f),T=to(v),D=to(p),j=to(k),O=to(x),F=b(!0),_=y(function(e){return I(function(t){return a(a({},t),{progress:e})})},[]),B=y(function(e){return I(function(t){return a(a({},t),{errors:e})})},[]),H=y(function(t){return I(function(n){return a(a({},n),{errors:r(r([],e(n.errors),!1),[t],!1)})})},[]),W=no(function(i){return t(void 0,void 0,void 0,function(){var a,l,u,d,f,m,p,h,v,g,b,y,w,E,x,C,k;return n(this,function(S){switch(S.label){case 0:O(),_(0),B([]),a=function(r){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return[4,Promise.all([o(r),qn(s)])];case 1:return t=e.apply(void 0,[n.sent(),1]),[2,t[0]]}})})},l=0,u=!0,d=[],S.label=1;case 1:S.trys.push([1,9,10,11]),f=c(i),m=f.next(),S.label=2;case 2:if(m.done)return[3,8];if(p=m.value,h=p.label,v=p.data,!F.current)return[2];S.label=3;case 3:return S.trys.push([3,5,6,7]),P(h),b=(g=d).push,[4,a({label:h,data:v})];case 4:return b.apply(g,[S.sent()]),[3,7];case 5:return y=S.sent(),u=!1,d.push(null),w={label:h,message:fL(y),error:y},H(w),A(r(r([],e(N.current.errors),!1),[w],!1))?[3,7]:(_(100),[3,8]);case 6:return L=++l,I=i.length,E=Math.min(100,Math.round(Math.max(L,0)/I*100)),_(E),D(E),[7];case 7:return m=f.next(),[3,2];case 8:return[3,11];case 9:return x=S.sent(),C={error:x},[3,11];case 10:try{m&&!m.done&&(k=f.return)&&k.call(f)}finally{if(C)throw C.error}return[7];case 11:return T(i.map(function(e){return e.data}),N.current.errors,d),j(u),[2]}var L,I})})},a(a({},S),{throwError:!0})),z=W.execute,V=W.loading;return E(function(){return function(){F.current=!1}},[]),a({execute:y(function(e){z(e)},[]),loading:V,label:R},N.current)},pL=function(t){var n=t.src,r=b(null),o=e(g(!1),2),i=o[0],a=o[1],l=Qr(),c=l.doReload,u=l.reloadTrigger,s=function(){a(!1)};return{audioRef:r,render:function(){return f.createElement(f.Fragment,null,i&&f.createElement("audio",{key:u,ref:r,src:n,controls:!0,autoPlay:!0,hidden:!0,onEnded:s}))},play:function(){a(!0),c()}}},hL=function(e){w(e,[])},vL=Symbol("change"),gL=Symbol("refresh"),bL=1e3,yL=function(e){function t(n,r,o){void 0===r&&(r=bL),void 0===o&&(o=function(){return i._data});var i=e.call(this)||this;return i._debounce=r,i._prevData=o,i._dropChanges=new ar,i._change=function(){i.emit(vL,i)},i.handleDropChanges=function(){i._dropChanges.next()},i.refresh=function(){return i.emit(gL,i)},i.toObject=function(){return i.data},i._data=n instanceof t?n.data:"function"==typeof n?n():n,i.setData=i.setData.bind(i),i.handleChange=i.handleChange.bind(i),i}return u(t,e),Object.defineProperty(t.prototype,"data",{get:function(){return Object.freeze(this._data)},enumerable:!1,configurable:!0}),t.prototype.setData=function(e){"function"==typeof e&&(e=e(this._prevData())),this._data=a(a({},this._data),e),this._change()},t.prototype.handleChange=function(e){var t=this,n=Jn(e,this._debounce),r=this._dropChanges.subscribe(n.clear);return this.subscribe(vL,n),this.subscribe(gL,e),function(){t.unsubscribe(vL,n),t.unsubscribe(gL,e),n.clear(),r()}},t}(Yn),wL=function(){function e(e,r){var o=this;this._model$=e,this._dispose=r,this._waitForListeners=function(){return new Promise(function(e){return t(o,void 0,void 0,function(){var t,r,o,i=this;return n(this,function(n){switch(n.label){case 0:return t=!1,r=this._dispose.subscribe(function(){return t=!0}),[4,qn(0)];case 1:return n.sent(),(o=function(){i._model$.current.hasListeners||t?(r(),e(t)):setTimeout(o,10)})(),[2]}})})})},this.setData=function(e){return t(o,void 0,void 0,function(){var t=this;return n(this,function(n){switch(n.label){case 0:return[4,this._waitForListeners().then(function(n){n||t._model$.current.setData(e)})];case 1:return n.sent(),[2]}})})},this.refresh=function(){return t(o,void 0,void 0,function(){var e=this;return n(this,function(t){switch(t.label){case 0:return[4,this._waitForListeners().then(function(t){t||e._model$.current.refresh()})];case 1:return t.sent(),[2]}})})},this.toObject=function(){return o._model$.current.toObject()},this.toModel=function(){return o._model$.current}}return Object.defineProperty(e.prototype,"data",{get:function(){return this._model$.current.data},enumerable:!1,configurable:!0}),e}(),EL=function(t){var n=t.initialValue,r=t.onChange,o=void 0===r?function(){return null}:r,i=t.debounce,a=void 0===i?bL:i,l=b(null),c=Or(function(){return new pw}),u=y(function(){return l.current.data},[]),s=e(g(function(){return new yL(n,a,u)}),2),d=s[0],f=s[1];l.current=d;var m=to(o);return w(function(){return d.handleChange(function(e){if(!c.data){var t=new yL(e,a,u);l.current=t,f(t),m(new wL(l,c))}})},[d]),E(function(){return function(){l.current.handleDropChanges(),c.next(!0)}},[]),h(function(){return new wL(l,c)},[d])},xL=function(e){function t(t,n,r){void 0===n&&(n=bL),void 0===r&&(r=function(){return o._data});var o=e.call(this,t,n,r)||this;return o.setData=function(t){"function"==typeof t&&(t=t(o._prevData())),void 0===t.id&&(t.id=Gr()),e.prototype.setData.call(o,a({},t))},o.handleChange=function(t){return e.prototype.handleChange.call(o,t)},o}return u(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._data.id},enumerable:!1,configurable:!0}),t}(yL),CL=function(){function e(e,r){var o=this;this._entity$=e,this._dispose=r,this._waitForListeners=function(){return new Promise(function(e){return t(o,void 0,void 0,function(){var t,r,o,i=this;return n(this,function(n){switch(n.label){case 0:return t=!1,r=this._dispose.subscribe(function(e){return t=e}),[4,qn(0)];case 1:return n.sent(),(o=function(){i._entity$.current.hasListeners||t?(r(),e(t)):setTimeout(o,10)})(),[2]}})})})},this.setData=function(e){return t(o,void 0,void 0,function(){var t=this;return n(this,function(n){switch(n.label){case 0:return[4,this._waitForListeners().then(function(n){n||t._entity$.current.setData(e)})];case 1:return n.sent(),[2]}})})},this.refresh=function(){return t(o,void 0,void 0,function(){var e=this;return n(this,function(t){switch(t.label){case 0:return[4,this._waitForListeners().then(function(t){t||e._entity$.current.refresh()})];case 1:return t.sent(),[2]}})})},this.toObject=function(){return o._entity$.current.toObject()},this.toEntity=function(){return o._entity$.current}}return Object.defineProperty(e.prototype,"data",{get:function(){return this._entity$.current.data},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this._entity$.current.id},enumerable:!1,configurable:!0}),e}(),kL=function(t){var n=t.initialValue,r=t.onChange,o=void 0===r?function(){return null}:r,i=t.debounce,a=void 0===i?bL:i,l=b(null),c=Or(function(){return new pw}),u=y(function(){return l.current.data},[]),s=e(g(function(){return new xL(n,a,u)}),2),d=s[0],f=s[1];l.current=d;var m=to(o);return w(function(){return d.handleChange(function(e){if(!c.data){var t=new xL(e,a,u);l.current=t,f(t),m(new CL(l,c))}})},[d]),E(function(){return function(){l.current.handleDropChanges(),c.next(!0)}},[]),h(function(){return new CL(l,c)},[d])},SL=function(t,n){var o=n.initialValue,i=void 0===o?[]:o,a=n.onChange,l=e(g(new Map(i.map(function(e,t){return[t,e]}))),2),c=l[0],u=l[1],s=b(!0),d=h(function(){return r([],e(c.values()),!1)},[c]);w(function(){s.current?s.current=!1:a&&a(d)},[d]);return{onAddItem:function(t){var n=Math.max.apply(Math,r(r([],e(c.keys()),!1),[0],!1))+1;return c.set(n,t),u(new Map(c)),n},onUpdateItem:function(e,t){c.set(e,t),u(new Map(c))},onRemoveItem:function(e){c.delete(e),u(new Map(c))},items:d,render:function(){return m.createElement(m.Fragment,null,r([],e(c.entries()),!1).map(function(n,r){var o=e(n,2),i=o[0],a=o[1];return m.createElement(k,{key:r},t(i,a))}))}}},LL=function(r){var o=void 0===r?{}:r,i=o.fallback,a=o.onLoadStart,l=o.onLoadEnd,c=o.onChange,u=void 0===c?function(){}:c,s=o.throwError,d=void 0!==s&&s,f=o.withInitialVideo,m=void 0!==f&&f,p=o.withInitialAudio,v=void 0!==p&&p,b=o.compressFrame,y=void 0===b?.8:b,E=o.maxFps,x=void 0===E?25:E,C=e(g(""),2),k=C[0],S=C[1],L=e(g(""),2),N=L[0],I=L[1],M=e(g(""),2),R=M[0],P=M[1],A=zr(k),T=zr(N),D=zr(R),j=to(u),O=h(function(){return Jn(j,100)},[]),F=Or(function(){return new MediaStream}),_=to(function(){return t(void 0,void 0,void 0,function(){var t,r,o,c,u,s;return n(this,function(n){switch(n.label){case 0:t=!0,n.label=1;case 1:return n.trys.push([1,3,4,5]),a&&a(),[4,navigator.mediaDevices.getDisplayMedia({video:{frameRate:{max:x},width:{ideal:window.screen.width*y},height:{ideal:window.screen.height*y}},audio:!1})];case 2:return r=n.sent(),o=F.getVideoTracks().find(function(e){return e.id===R}),o&&F.removeTrack(o),c=e(r.getVideoTracks(),1),(u=c[0]).addEventListener("inactive",function(){var e=F.getVideoTracks().find(function(e){return e.id===R});e&&F.removeTrack(e),P(""),O(F,{screenCaptureId:"",audioCaptureId:A.current,cameraCaptureId:T.current})}),F.addTrack(u),P(u.id),O(F,{screenCaptureId:u.id,audioCaptureId:A.current,cameraCaptureId:T.current}),[3,5];case 3:if(s=n.sent(),t=!1,d)throw s;return i&&i(s),[3,5];case 4:return l&&l(t),[7];case 5:return[2]}})})}),B=to(function(){return t(void 0,void 0,void 0,function(){var t,r,o,c,u,s;return n(this,function(n){switch(n.label){case 0:t=!0,n.label=1;case 1:return n.trys.push([1,3,4,5]),a&&a(),[4,navigator.mediaDevices.getUserMedia({video:{facingMode:"user",frameRate:{max:x},width:{min:0,max:window.screen.width*y},height:{min:0,max:window.screen.height*y}},audio:!1})];case 2:return r=n.sent(),o=F.getVideoTracks().find(function(e){return e.id===N}),o&&F.removeTrack(o),c=e(r.getVideoTracks(),1),(u=c[0]).addEventListener("inactive",function(){var e=F.getVideoTracks().find(function(e){return e.id===N});e&&F.removeTrack(e),I(""),O(F,{screenCaptureId:D.current,audioCaptureId:A.current,cameraCaptureId:""})}),F.addTrack(u),I(u.id),O(F,{screenCaptureId:D.current,audioCaptureId:A.current,cameraCaptureId:u.id}),[3,5];case 3:if(s=n.sent(),t=!1,d)throw s;return i&&i(s),[3,5];case 4:return l&&l(t),[7];case 5:return[2]}})})}),H=to(function(){return t(void 0,void 0,void 0,function(){var t,r,o,c,u,s;return n(this,function(n){switch(n.label){case 0:t=!0,n.label=1;case 1:return n.trys.push([1,3,4,5]),a&&a(),[4,navigator.mediaDevices.getUserMedia({video:!1,audio:{sampleSize:16,channelCount:2}})];case 2:return r=n.sent(),o=F.getAudioTracks().find(function(e){return e.id===k}),o&&F.removeTrack(o),c=e(r.getAudioTracks(),1),(u=c[0]).addEventListener("inactive",function(){var e=F.getAudioTracks().find(function(e){return e.id===k});e&&F.removeTrack(e),S(""),O(F,{screenCaptureId:D.current,audioCaptureId:"",cameraCaptureId:T.current})}),F.addTrack(u),S(u.id),O(F,{screenCaptureId:D.current,audioCaptureId:u.id,cameraCaptureId:T.current}),[3,5];case 3:if(s=n.sent(),t=!1,d)throw s;return i&&i(s),[3,5];case 4:return l&&l(t),[7];case 5:return[2]}})})}),W=to(function(){var e=F.getVideoTracks().find(function(e){return e.id===R});e&&e.stop()}),z=to(function(){var e=F.getVideoTracks().find(function(e){return e.id===N});e&&e.stop()}),V=to(function(){var e=F.getAudioTracks().find(function(e){return e.id===k});e&&e.stop()});return w(function(){m&&B(),v&&H()},[]),{mediaStream:F,hasAudioCapture:!!A.current,hasCameraCapture:!!T.current,hasScreenCapture:!!D.current,requestScreenCapture:_,requestCameraCapture:B,requestAudioCapture:H,stopScreenCapture:W,stopCameraCapture:z,stopAudioCapture:V}},NL=Symbol("reorder"),IL=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t}(Error),ML=function(t){function n(o,i,a){void 0===o&&(o=[]),void 0===i&&(i=bL),void 0===a&&(a=function(){return l.items});var l=t.call(this)||this;if(l._debounce=i,l._prevData=a,l._items=new Map,l._ids=new Map,l._dropChanges=new ar,l._prevEntity=function(e){return function(){var t=l._prevData().find(function(t){return t.id===e.id});return t?t.data:e}},l._change=function(e){l.emit(vL,l,e)},l._refresh=function(e){l.emit(gL,l,e)},l._reorder=function(){l.emit(NL,l,null)},l._dispose=function(){var e,t;try{for(var n=c(l._items.values()),r=n.next();!r.done;r=n.next()){var o=r.value;o.unsubscribe(vL,l._change),o.unsubscribe(gL,l._refresh)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}l._items.clear(),l._ids.clear()},l.setData=function(e){l._dispose();for(var t=0;t!==e.length;t++){var n=e[t],r=new xL(n,l._debounce,l._prevEntity(n));l._items.set(t,r),l._ids.set(r.id,t),r.subscribe(vL,l._change),r.subscribe(gL,l._refresh)}l._reorder()},l.clear=function(){l._dispose(),l._reorder()},l.map=function(e){return l.items.map(e)},l.filter=function(e){return l.items.filter(e)},l.find=function(e){return l.items.find(e)},l.some=function(e){return l.items.some(e)},l.forEach=function(e){return l.items.forEach(e)},l.push=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=e.flat(),r=l.lastIdx,o=0;o!==n.length;o++){var i=r+o,a=n[o];void 0===a.id&&(a.id=i);var c=new xL(a,l._debounce,l._prevEntity(a));l._items.set(i,c),l._ids.set(c.id,i),c.subscribe(vL,l._change),c.subscribe(gL,l._refresh)}l._reorder()},l.upsert=function(){for(var t,n,o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];var a=o.flat(),u=new Map(a.map(function(e){return[e.id,e]})),s=new Set;try{for(var d=c(l._items.values()),f=d.next();!f.done;f=d.next()){var m=f.value,p=u.get(m.id);p&&(m.setData(p),s.add(m.id))}}catch(e){t={error:e}}finally{try{f&&!f.done&&(n=d.return)&&n.call(d)}finally{if(t)throw t.error}}l.push.apply(l,r([],e(a.filter(function(e){var t=e.id;return!s.has(t)})),!1))},l.remove=function(e){l.removeById(e.id)},l.removeById=function(t){var n,r;try{for(var o=c(l._items.entries()),i=o.next();!i.done;i=o.next()){var a=e(i.value,2),u=a[0],s=a[1];if(s.id===t)return l._items.delete(u),l._ids.delete(t),s.unsubscribe(vL,l._change),s.unsubscribe(gL,l._refresh),void l._reorder()}}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}throw new IL("removeById unknown entity id ".concat(t))},l.removeAll=function(){var t,n;try{for(var r=c(l._items.entries()),o=r.next();!o.done;o=r.next()){var i=e(o.value,2),a=i[0],u=i[1];l._items.delete(a),l._ids.delete(u.id),u.unsubscribe(vL,l._change),u.unsubscribe(gL,l._refresh)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}l._reorder()},l.findById=function(e){if(l._ids.has(e)){var t=l._ids.get(e);return l._items.get(t)}throw new IL("findById unknown entity id ".concat(e))},l.handleChange=function(e){var t=Jn(e,l._debounce),n=l._dropChanges.subscribe(t.clear);return l.subscribe(vL,t),l.subscribe(gL,e),l.subscribe(NL,e),function(){l.unsubscribe(vL,t),l.unsubscribe(gL,e),l.unsubscribe(NL,e),t.clear(),n()}},l.handleDropChanges=function(){var e,t;try{for(var n=c(l._items.values()),r=n.next();!r.done;r=n.next()){r.value.handleDropChanges()}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}l._dropChanges.next()},l.refresh=function(){return l.emit(gL,l,null)},l.toArray=function(){return l.map(function(e){return e.toObject()})},o instanceof n){var u=o.items;o._dispose(),o=u}else o="function"==typeof o?o().map(function(e){return new xL(e,l._debounce,l._prevEntity(e))}):o.map(function(e){return e instanceof xL&&(e=e.data),new xL(e,l._debounce,l._prevEntity(e))});return o.forEach(function(e,t){l._items.set(t,e),l._ids.set(e.id,t),e.subscribe(vL,l._change),e.subscribe(gL,l._refresh)}),l}return u(n,t),Object.defineProperty(n.prototype,"items",{get:function(){return r([],e(this._items.entries()),!1).sort(function(t,n){var r=e(t,1)[0],o=e(n,1)[0];return Number(r)-Number(o)}).map(function(e){return e[1]})},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"lastIdx",{get:function(){return Math.max.apply(Math,r(r([],e(this._items.keys()),!1),[-1],!1))+1},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ids",{get:function(){return r([],e(this._ids.keys()),!1)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isEmpty",{get:function(){return 0===this._items.size},enumerable:!1,configurable:!0}),n}(Yn),RL=function(){function e(e,r,o){var i=this;this.id=e,this._collection$=r,this._dispose=o,this._waitForListeners=function(){return new Promise(function(e,r){return t(i,void 0,void 0,function(){var t,o,i,a=this;return n(this,function(n){switch(n.label){case 0:return t=!1,o=this._dispose.subscribe(function(e){return t=e}),[4,qn(0)];case 1:return n.sent(),(i=function(){try{a._collection$.current.findById(a.id).hasListeners||t?(o(),e(t)):setTimeout(i,PL)}catch(e){r(e)}})(),[2]}})})})},this.setData=function(e){return t(i,void 0,void 0,function(){var t,r=this;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this._waitForListeners().then(function(t){var n=r._collection$.current.findById(r.id);t||n.setData(e)})];case 1:return n.sent(),[3,3];case 2:if(!((t=n.sent())instanceof IL))throw t;return console.error("Entity (ID ".concat(this.id,") not found in collection (setData)")),[3,3];case 3:return[2]}})})},this.refresh=function(){return t(i,void 0,void 0,function(){var e,t=this;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this._waitForListeners().then(function(e){var n=t._collection$.current.findById(t.id);e||n.refresh()})];case 1:return n.sent(),[3,3];case 2:if(!((e=n.sent())instanceof IL))throw e;return console.error("Entity (ID ".concat(this.id,") not found in collection (refresh)")),[3,3];case 3:return[2]}})})},this.toObject=function(){try{return i._collection$.current.findById(i.id).toObject()}catch(e){throw e instanceof IL?new Error("Entity (ID ".concat(i.id,") not found in collection (toObject)")):e}},this.toEntity=function(){try{return i._collection$.current.findById(i.id)}catch(e){throw e instanceof IL?new Error("Entity (ID ".concat(i.id,") not found in collection (toEntity)")):e}}}return Object.defineProperty(e.prototype,"data",{get:function(){try{return this._collection$.current.findById(this.id).data}catch(e){throw e instanceof IL?new Error("Entity (ID ".concat(this.id,") not found in collection (data getter)")):e}},enumerable:!1,configurable:!0}),e}(),PL=10,AL=function(){function o(o,i){var a=this;this._collection$=o,this._dispose=i,this._waitForListeners=function(){return new Promise(function(e){return t(a,void 0,void 0,function(){var t,r,o,i=this;return n(this,function(n){switch(n.label){case 0:return t=!1,r=this._dispose.subscribe(function(e){return t=e}),[4,qn(0)];case 1:return n.sent(),(o=function(){i._collection$.current.hasListeners||t?(r(),e(t)):setTimeout(o,PL)})(),[2]}})})})},this.setData=function(e){return t(a,void 0,void 0,function(){var t=this;return n(this,function(n){switch(n.label){case 0:return[4,this._waitForListeners().then(function(n){n||t._collection$.current.setData(e)})];case 1:return n.sent(),[2]}})})},this.refresh=function(){return t(a,void 0,void 0,function(){var e=this;return n(this,function(t){switch(t.label){case 0:return[4,this._waitForListeners().then(function(t){t||e._collection$.current.refresh()})];case 1:return t.sent(),[2]}})})},this.clear=function(){return t(a,void 0,void 0,function(){var e=this;return n(this,function(t){switch(t.label){case 0:return[4,this._waitForListeners().then(function(t){t||e._collection$.current.clear()})];case 1:return t.sent(),[2]}})})},this.push=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return t(a,void 0,void 0,function(){var t=this;return n(this,function(n){switch(n.label){case 0:return[4,this._waitForListeners().then(function(n){var i;n||(i=t._collection$.current).push.apply(i,r([],e(o),!1))})];case 1:return n.sent(),[2]}})})},this.upsert=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return t(a,void 0,void 0,function(){var t=this;return n(this,function(n){switch(n.label){case 0:return[4,this._waitForListeners().then(function(n){var i;n||(i=t._collection$.current).upsert.apply(i,r([],e(o),!1))})];case 1:return n.sent(),[2]}})})},this.remove=function(e){return t(a,void 0,void 0,function(){var t=this;return n(this,function(n){switch(n.label){case 0:return[4,this._waitForListeners().then(function(n){n||t._collection$.current.remove(e)})];case 1:return n.sent(),[2]}})})},this.removeById=function(e){return t(a,void 0,void 0,function(){var t=this;return n(this,function(n){switch(n.label){case 0:return[4,this._waitForListeners().then(function(n){n||t._collection$.current.removeById(e)})];case 1:return n.sent(),[2]}})})},this.removeAll=function(){return t(a,void 0,void 0,function(){var e=this;return n(this,function(t){switch(t.label){case 0:return[4,this._waitForListeners().then(function(t){t||e._collection$.current.removeAll()})];case 1:return t.sent(),[2]}})})},this.findById=function(e){var t=a._collection$.current.findById(e);return new RL(t.id,a._collection$,a._dispose)},this.some=function(e){return a.items.some(e)},this.forEach=function(e){a.items.forEach(e)},this.find=function(e){return a.items.find(e)},this.filter=function(e){return a.items.filter(e)},this.map=function(e){return a.items.map(e)},this.toArray=function(){return a._collection$.current.toArray()},this.toCollection=function(){return a._collection$.current}}return Object.defineProperty(o.prototype,"ids",{get:function(){return this._collection$.current.ids},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"lastIdx",{get:function(){return this._collection$.current.lastIdx},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"items",{get:function(){var e=this;return this._collection$.current.items.map(function(t){var n=t.id;return new RL(n,e._collection$,e._dispose)})},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"isEmpty",{get:function(){return this._collection$.current.isEmpty},enumerable:!1,configurable:!0}),o}(),TL=function(t){var n=void 0===t?{}:t,r=n.initialValue,o=void 0===r?[]:r,i=n.onChange,a=void 0===i?function(){return null}:i,l=n.debounce,c=void 0===l?bL:l,u=b(null),s=Or(function(){return new pw}),d=y(function(){return u.current.items},[]),f=e(g(function(){return new ML(o,c,d)}),2),m=f[0],p=f[1];u.current=m;var v=to(a);return w(function(){return m.handleChange(function(e,t){if(!s.data){var n=new ML(e,c,d);u.current=n,p(n),v(new AL(u,s),t?new RL(t.id,u,s):null)}})},[m]),E(function(){return function(){u.current.handleDropChanges(),s.next(!0)}},[]),h(function(){return new AL(u,s)},[m])},DL=function(t){var n=t.message,r=void 0===n?"Client update successful":n,o=t.noSnackOnOk,i=void 0!==o&&o,a=t.loading,l=t.error,c=t.delay,u=void 0===c?5e3:c,s=t.onClose,d=void 0===s?function(){}:s,m=e(g(null),2),p=m[0],h=m[1],v=Fr(),b=function(){v.next(),h(null)},w=to(d),E=function(e){return h(function(){return f.createElement(tn,{open:!0,key:Gr(),anchorOrigin:{vertical:"bottom",horizontal:"center"},autoHideDuration:u,onClose:b,message:e})})},x=$r(function(){l&&(E(l),v.once(function(){return w(!1)})),l||a||(i?w(!0):(E(r),v.once(function(){return w(!0)})))},[a,l]);return{beginWatch:x.beginWatch,resetWatcher:x.resetWatcher,stopWatch:x.stopWatch,render:y(function(){return f.createElement(f.Fragment,null,p)},[p])}},jL=function(e){var r=e.resultSubject,o=e.duration,i=e.message,a=e.button,l=void 0===a?"Open":a,c=si(),u=c.loading,s=c.handleLoadStart,d=c.handleLoadEnd,m=re(),p=Or(Gr);return f.createElement(tn,{open:!0,key:p,anchorOrigin:{vertical:"bottom",horizontal:"center"},autoHideDuration:o,onClose:function(){return!1},message:i,ContentProps:{sx:{background:m.palette.background.paper,color:m.palette.getContrastText(m.palette.background.paper),"& > *":{color:m.palette.getContrastText(m.palette.background.paper)}}},action:f.createElement(we,{direction:"row",gap:1,mr:1,alignItems:"center"},f.createElement(ui,{variant:"contained",disabled:u,onLoadStart:s,onLoadEnd:d,color:"primary",size:"small",onClick:function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,r.next(!0)];case 1:return e.sent(),[2]}})})}},l),f.createElement(ui,{variant:"outlined",sx:{display:"flex",alignItems:"center",justifyContent:"center"},disabled:u,onLoadStart:s,onLoadEnd:d,color:"primary",size:"small",onClick:function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,r.next(!1)];case 1:return e.sent(),[2]}})})}},f.createElement(Fe,{sx:{display:"flex"}})))})},OL=function(r){var o=void 0===r?{}:r,i=o.duration,a=void 0===i?6e3:i,l=o.onResult,c=void 0===l?function(){}:l,u=e(g(null),2),s=u[0],d=u[1],m=zr(s),p=il([s],50),h=Fr();w(function(){return h.subscribe(function(){d(null)})},[]),w(function(){return h.subscribe(c)},[]);var v=y(function(e,t){return f.createElement(jL,{message:e,button:t,duration:a,resultSubject:h})},[]);return{render:function(){return f.createElement(f.Fragment,null,s)},pickData:y(function(e){return t(void 0,[e],void 0,function(e){var t=e.message,r=e.button,o=void 0===r?"Open":r;return n(this,function(e){switch(e.label){case 0:return m.current?[4,h.next(!1)]:[3,3];case 1:return e.sent(),[4,p()];case 2:e.sent(),e.label=3;case 3:return d(v(t,o)),[4,h.toPromise()];case 4:return[2,e.sent()]}})})},[]),close:y(function(){return h.next(!1)},[])}},FL=An()({root:(NS={display:"flex",alignItems:"stretch",justifyContent:"stretch","& .MuiPaper-root":{background:"transparent"}},NS["& .".concat(Mp)]={flex:1,height:"unset !important",width:"unset !important"},NS["& .".concat("react-declarative__mobileListRoot")]={background:"transparent !important"},NS)}),_L=function(t){var n=t.onChange,o=void 0===n?function(e){return console.log({data:e})}:n,i=t.handler,a=t.title,l=t.columns,c=t.open,u=void 0===c||c,s=t.selectionMode,d=t.selectedRows,m=void 0===d?null:d,p=t.minHeight,h=t.minWidth,v=t.rowActions,b=e(g(m),2),y=b[0],w=b[1],E=FL().classes;$r(function(){u||w(m)},[m]);return f.createElement(Hf,{open:u,onAccept:function(){return o(y)},onDismiss:function(){return o(null)}},!!a&&f.createElement(mt,null,f.createElement(j,{mr:3},a)),f.createElement(j,{className:E.root,style:{minHeight:p,minWidth:h}},f.createElement(Rv,{sizeByElement:!0,withLoader:!0,withSelectOnRowClick:!0,isChooser:!0,handler:i,columns:l,selectedRows:y||void 0,selectionMode:s,onSelectedRows:function(e,t){t||w(e)},onRowClick:function(t){var n=t.id;return w(function(t){return t&&s===Si.Multiple?r(r([],e(t),!1),[n],!1):[n]})},rowActions:v})))},BL=function(r){var o=r.handler,i=r.columns,l=r.rowActions,c=r.payload,u=r.features,s=r.selectionMode,d=void 0===s?Si.Single:s,m=r.title,p=void 0===m?"Pick item":m,h=r.minWidth,v=void 0===h?425:h,g=r.minHeight,y=void 0===g?375:g,E=r.selectedRows,x=to(function(){return{title:p,minWidth:v,minHeight:y,selectedRows:E||null,open:!1}}),C=e(ro(x),2),k=C[0],S=C[1];w(function(){k.current.open||S(function(e){return a(a({},e),{title:p})})},[p]),w(function(){k.current.open||S(function(e){return a(a({},e),{minWidth:v})})},[v]),w(function(){k.current.open||S(function(e){return a(a({},e),{minHeight:y})})},[y]),w(function(){k.current.open||S(function(e){return a(a({},e),{selectedRows:E||null})})},[E]);var L=b(),N=function(e){var t=L.current;t&&t(e),S(x),R()},I=_f(function(){return f.createElement(_L,{open:!0,payload:c,features:u,selectionMode:d,minHeight:k.current.minHeight,minWidth:k.current.minWidth,title:k.current.title,columns:i,handler:o,selectedRows:k.current.selectedRows,onChange:N,rowActions:l})},[]),M=I.showModal,R=I.hideModal;return function(e){var r=void 0===e?{}:e,o=r.title,i=r.minWidth,a=r.minHeight,l=r.selectedRows;return new function(){var e=this;this.then=function(e){L.current=e},this.toPromise=function(){return t(e,void 0,void 0,function(){var e;return n(this,function(t){switch(t.label){case 0:return e=new ar,this.then(e.next),[4,e.toPromise()];case 1:return[2,t.sent()]}})})},S(function(e){return{title:void 0!==o?o:e.title,minWidth:void 0!==i?i:e.minWidth,minHeight:void 0!==a?a:e.minHeight,selectedRows:void 0!==l?l:e.selectedRows,open:!0}}),M()}}},HL=function(t){var n=t.accept,o=t.onSelect,i=b(null),a=function(){var t,n=null===(t=i.current)||void 0===t?void 0:t.files;(null==n?void 0:n.length)&&(o&&o.apply(void 0,r([],e(Array.from(n)),!1)),i.current&&(i.current.value=""))};return{render:function(){return m.createElement("input",{type:"file",style:{display:"none"},onChange:a,ref:i,accept:n})},open:function(){var e;null===(e=i.current)||void 0===e||e.click()}}},WL=An()({password:{fontFamily:"text-security-disc","-webkit-text-security":"disc",textSecurity:"disc"}}),zL=function(t){var n,r=t.onChange,o=void 0===r?function(e){return console.log({result:e})}:r,i=t.canCancel,a=void 0===i||i,l=t.title,c=t.value,u=t.inputType,s=t.placeholder,d=t.open,m=void 0===d||d,p=t.large,h=WL().classes,v=b(null),y=e(g(c),2),E=y[0],x=y[1];w(function(){return x(c)},[c]),w(function(){var e=v.current;setTimeout(function(){if(null==e?void 0:e.value){var t=e.value.length;e.setSelectionRange(t,t)}},500)},[]);var C=function(){return o(E)},k=function(){return o(null)};return f.createElement(Hf,{open:m,canCancel:a,onAccept:C,onDismiss:k},f.createElement(mt,null,f.createElement(j,{sx:{width:p?"100vw":"unset",maxWidth:p?"100%":"unset"},mr:3},l)),f.createElement(j,{p:3},f.createElement(Gt,{className:Eo((n={},n[h.password]="password"===u,n)),inputRef:v,type:u,autoFocus:!0,minRows:3,maxRows:p?20:3,multiline:!0,value:E,sx:{width:"100%"},placeholder:s,onChange:function(e){var t=e.target;return x(t.value)},onKeyDown:function(e){var t=e.key;"Enter"===t?C():"Escape"===t&&k()}})))},VL=function(r){var o=void 0===r?{}:r,i=o.title,l=void 0===i?"Prompt":i,c=o.value,u=void 0===c?"":c,s=o.placeholder,d=void 0===s?"Prompt":s,m=o.canCancel,p=void 0===m||m,h=o.large,v=void 0!==h&&h,g=o.inputType,y=b(),E=to(function(){return{currentCanCancel:p,currentPlaceholder:d,currentTitle:l,currentValue:u,open:!1}}),x=e(ro(E),2),C=x[0],k=x[1];w(function(){C.current.open||k(function(e){return a(a({},e),{currentCanCancel:p})})},[p]),w(function(){C.current.open||k(function(e){return a(a({},e),{currentPlaceholder:d})})},[d]),w(function(){C.current.open||k(function(e){return a(a({},e),{currentTitle:l})})},[l]),w(function(){C.current.open||k(function(e){return a(a({},e),{currentValue:u})})},[u]);var S=function(e){var t=y.current;t&&t(e),k(E),I()},L=_f(function(){return f.createElement(zL,{open:!0,large:v,inputType:g,canCancel:C.current.currentCanCancel,title:C.current.currentTitle,value:C.current.currentValue,placeholder:C.current.currentPlaceholder,onChange:S})},[]),N=L.showModal,I=L.hideModal;return function(e){var r=void 0===e?{}:e,o=r.canCancel,i=r.title,a=r.placeholder,l=r.value;return new function(){var e=this;this.then=function(e){y.current=e},this.toPromise=function(){return t(e,void 0,void 0,function(){var e;return n(this,function(t){switch(t.label){case 0:return e=new ar,this.then(e.next),[4,e.toPromise()];case 1:return[2,t.sent()]}})})},k(function(e){return{currentPlaceholder:void 0!==a?a:e.currentPlaceholder,currentCanCancel:void 0!==o?o:e.currentCanCancel,currentTitle:void 0!==i?i:e.currentTitle,currentValue:void 0!==l?l:e.currentValue,open:!0}}),N()}}},YL=function(e){var t=e.onOk,n=e.title,r=e.description,o=e.open,i=void 0===o||o,a=e.large;return f.createElement(Hf,{open:i,canCancel:!1,onAccept:t},f.createElement(mt,null,f.createElement(j,{sx:{width:a?"100vw":"unset",maxWidth:a?"100%":"unset"},mr:3},n)),f.createElement(j,{p:3},f.createElement(Gt,{autoFocus:!0,readOnly:!0,minRows:3,maxRows:a?20:3,multiline:!0,value:r,sx:{width:"100%"}})))},UL=function(r){var o=void 0===r?{}:r,i=o.title,l=void 0===i?"Alert":i,c=o.description,u=void 0===c?"":c,s=o.large,d=void 0!==s&&s,m=b(),p=to(function(){return{currentDescription:u,currentTitle:l,open:!1}}),h=e(ro(p),2),v=h[0],g=h[1];w(function(){v.current.open||g(function(e){return a(a({},e),{currentTitle:l})})},[l]),w(function(){v.current.open||g(function(e){return a(a({},e),{currentDescription:u})})},[u]);var y=function(){var e=m.current;e&&e(),g(p),C()},E=_f(function(){return f.createElement(YL,{open:!0,large:d,title:v.current.currentTitle,description:v.current.currentDescription,onOk:y})},[]),x=E.showModal,C=E.hideModal;return function(e){var r=void 0===e?{}:e,o=r.description,i=r.title;return new function(){var e=this;this.then=function(e){m.current=e},this.toPromise=function(){return t(e,void 0,void 0,function(){var e;return n(this,function(t){switch(t.label){case 0:return e=new ar,this.then(e.next),[4,e.toPromise()];case 1:return[2,t.sent()]}})})},g(function(e){return{currentTitle:void 0!==i?i:e.currentTitle,currentDescription:void 0!==o?o:e.currentDescription,open:!0}}),x()}}},qL=function(t){var n=t.onChange,r=void 0===n?function(e){return console.log({change:e})}:n,o=t.animateYearScrolling,i=void 0!==o&&o,a=t.openToYearSelection,l=void 0!==a&&a,c=t.disableFuture,u=void 0!==c&&c,s=t.now,d=void 0===s?Ue():s,m=e(g(Ue(d)),2),p=m[0],h=m[1];return f.createElement(Hf,{open:!0,onAccept:function(){return r(p)},onDismiss:function(){return r(null)}},f.createElement(Dl,{date:p,onChange:function(e){return h(e)},disableFuture:u,animateYearScrolling:i,openToYearSelection:l}))},$L=function(){var e=b(),r=function(t){var n=e.current;n&&n(t),a()},o=_f(function(){return f.createElement(qL,{open:!0,onChange:r})}),i=o.showModal,a=o.hideModal;return function(){return new function(){var r=this;this.then=function(t){e.current=t},this.toPromise=function(){return t(r,void 0,void 0,function(){var e;return n(this,function(t){switch(t.label){case 0:return e=new ar,this.then(e.next),[4,e.toPromise()];case 1:return[2,t.sent()]}})})},i()}}},XL=function(t){var n=t.onChange,r=void 0===n?function(e){return console.log({change:e})}:n,o=t.now,i=void 0===o?Ue():o,a=t.open,l=void 0===a||a,c=e(g(i),2),u=c[0],s=c[1],d=y(function(){return r(u)},[u]);return f.createElement(Hf,{open:l,onAccept:d,onDismiss:function(){return r(null)}},f.createElement(yc,{date:u,onChange:function(e){return s(e)}}))},GL=function(){var e=b(),r=function(t){var n=e.current;n&&n(t),a()},o=_f(function(){return f.createElement(XL,{open:!0,onChange:r})}),i=o.showModal,a=o.hideModal;return function(){return new function(){var r=this;this.then=function(t){e.current=t},this.toPromise=function(){return t(r,void 0,void 0,function(){var e;return n(this,function(t){switch(t.label){case 0:return e=new ar,this.then(e.next),[4,e.toPromise()];case 1:return[2,t.sent()]}})})},i()}}},KL=function(r){var o=r.waitForChangesDelay,i=void 0===o?1e3:o,a=r.onChange,l=void 0===a?function(e){return console.log({data:e})}:a,c=r.fields,u=r.handler,s=r.payload,d=r.canCancel,m=void 0===d||d,p=r.features,h=r.slots,v=r.large,b=r.title,y=r.isBaseline,w=r.isBaselineForRoot,E=r.readTransform,x=r.writeTransform,C=r.incomingTransform,k=r.outgoingTransform,S=r.open,L=void 0===S||S,N=e(g(null),2),I=N[0],M=N[1],R=e(g(!1),2),P=R[0],A=R[1],T=e(g(!1),2),D=T[0],O=T[1],F=zr(I),_=il([I],10);return f.createElement(Hf,{open:L,disabled:P,canCancel:m,invalid:!I||D,onAccept:function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:A(!0),e.label=1;case 1:return e.trys.push([1,,3,4]),[4,t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return[4,Promise.race([_(),qn(i)])];case 1:return e.sent(),[2]}})})];case 2:return e.sent(),l(F.current),[3,4];case 3:return A(!1),[7];case 4:return[2]}})})},onDismiss:function(){return l(null)}},!!b&&f.createElement(mt,null,f.createElement(j,{mr:3},b)),f.createElement(j,{sx:{width:v?"100vw":"unset",maxWidth:v?"100%":"unset"},p:3},f.createElement(bf,{change:function(e){M(e),O(!1)},invalidity:function(){return O(!0)},readTransform:E,writeTransform:x,incomingTransform:C,outgoingTransform:k,isBaseline:y,isBaselineForRoot:w,handler:u,payload:s,slots:h,fields:c,features:p})))},QL=function(r){var o=r.fields,i=r.large,l=r.slots,c=r.canCancel,u=r.title,s=r.handler,d=r.payload,m=r.waitForChangesDelay,p=r.readTransform,h=r.writeTransform,v=r.incomingTransform,g=r.outgoingTransform,y=r.isBaseline,E=r.isBaselineForRoot,x=r.features,C=b(),k=to(function(){return{currentHandler:s,currentPayload:d,currentTitle:u,open:!1}}),S=e(ro(k),2),L=S[0],N=S[1];w(function(){L.current.open||N(function(e){return a(a({},e),{currentHandler:s})})},[s]),w(function(){L.current.open||N(function(e){return a(a({},e),{currentPayload:d})})},[d]),w(function(){L.current.open||N(function(e){return a(a({},e),{currentTitle:u})})},[u]);var I=function(e){var t=C.current;t&&t(e),N(k),P()},M=_f(function(){return f.createElement(KL,{open:!0,large:i,slots:l,canCancel:c,waitForChangesDelay:m,fields:o,title:L.current.currentTitle,handler:L.current.currentHandler,payload:L.current.currentPayload,readTransform:p,writeTransform:h,incomingTransform:v,outgoingTransform:g,onChange:I,isBaseline:y,isBaselineForRoot:E,features:x})},[]),R=M.showModal,P=M.hideModal;return function(e){var r=void 0===e?{}:e,o=r.handler,i=r.payload,a=r.title;return new function(){var e=this;this.then=function(e){C.current=e},this.toPromise=function(){return t(e,void 0,void 0,function(){var e;return n(this,function(t){switch(t.label){case 0:return e=new ar,this.then(e.next),[4,e.toPromise()];case 1:return[2,t.sent()]}})})},N(function(e){return{currentHandler:void 0!==o?o:e.currentHandler,currentPayload:void 0!==i?i:e.currentPayload,currentTitle:void 0!==a?a:e.currentTitle,open:!0}}),R()}}},JL=function(e){return QL(e)},ZL=function(e){var t=Object.create(null);return Object.assign(t,e),Object.freeze(t)},eN=function(){var t=null,n=null,r=new Promise(function(r,o){var i;i=e([r,o],2),t=i[0],n=i[1]});return[r,{resolve:function(e){return t&&t(e)},reject:function(e){return n&&n(e)}}]},tN=null,nN=new ar,rN=function(e,r){return t(void 0,void 0,void 0,function(){return n(this,function(o){switch(o.label){case 0:return[4,nN.next({url:e,name:r})];case 1:return o.sent(),tN?(tN(e,r),[2]):(fetch(e,{mode:"no-cors"}).then(function(e){return e.blob()}).then(function(e){return t(void 0,void 0,void 0,function(){var t,r;return n(this,function(n){switch(n.label){case 0:return[4,Sn(e)];case 1:return t=n.sent(),r=(null==t?void 0:t.mime)||e.type,[2,new Blob([e],{type:r})]}})})}).then(function(e){var t=URL.createObjectURL(e),n=document.createElement("a");n.href=t,n.download=r,n.style.display="none",n.target="_blank",document.body.appendChild(n),n.addEventListener("click",function(){return queueMicrotask(function(){URL.revokeObjectURL(t)})},{once:!0}),n.click()}),[2])}})})};rN.override=function(e){tN=e},rN.listen=function(e){return nN.subscribe(e)};var oN=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=e;return t.forEach(function(e){return r=r.split(e).join("").trim()}),r},iN=function(e,t){return void 0===t&&(t=!1),new Promise(function(n,r){var o=document.createElement("script");o.crossOrigin="anonymous",o.addEventListener("load",function(){n()}),o.addEventListener("error",function(){r()}),t&&(o.async=!0),document.body.appendChild(o),o.src=e})},aN=function(t){return new Promise(function(n){var o=document.createElement("input");o.setAttribute("type","file"),o.setAttribute("multiple","1"),o.style.display="none",t&&(o.accept=t),document.body.appendChild(o);var i=!0;o.onchange=function(){document.body.contains(o)&&document.body.removeChild(o),i=!1;var t=o.files;(null==t?void 0:t.length)&&(n(r([],e(t),!1)),o.value="")},new Promise(function(e){var t=function(){document.removeEventListener("mousemove",t),document.removeEventListener("touchmove",t),e()};qn(1e3).then(function(){document.addEventListener("mousemove",t),document.addEventListener("touchmove",t)})}).then(function(){setTimeout(function(){i&&(document.body.contains(o)&&document.body.removeChild(o),n(null))},1e3)}),o.click()})},lN=function(){var e=function(e){if(1===e.touches.length){var t=e.touches[0];(t.clientX<.1*window.innerWidth||t.clientX>.9*window.innerWidth)&&e.preventDefault()}};return window.addEventListener("touchstart",e,{passive:!1}),function(){return window.removeEventListener("touchstart",e)}},cN=function(e){var t=Object.getOwnPropertyNames(e),n={};return t.forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t)||{};"value"in r&&(n[t]=r.value)}),n},uN=function(e,t){return window.innerWidth>=e&&window.innerWidth<t},sN=function(e){var t=void 0===e?{}:e,n=t.xs,r=void 0===n?0:n,o=t.sm,i=void 0===o?600:o,a=t.lg,l=void 0===a?1280:a,c=uN(r,i),u=uN(i,l),s=uN(l,1e16);return{isPhone:c,isTablet:u,isDesktop:s,isWide:u||s,isMobile:c}},dN=function(e){return document.evaluate(e,document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue},fN=function(e){var t;if("HTML"==e.tagName)return"/HTML[1]";if(e===document.body)return"/HTML[1]/BODY[1]";for(var n=0,r=(null===(t=e.parentNode)||void 0===t?void 0:t.childNodes)||[],o=0;o<r.length;o++){var i=r[o];if(i===e&&e.parentNode)return fN(e.parentNode)+"/"+e.tagName+"["+(n+1)+"]";1===i.nodeType&&i.tagName===e.tagName&&n++}return null},mN=function(t){var n=ip(t),r=e(hl(),2),o=r[0];return[function(e){var t=e.children,r=e.initialState,i=e.onChange;return f.createElement(o,{initialState:n.getValue()||r,onChange:function(e){n.setValue(e),i&&i(e)}},t)},r[1]]},pN=function(t){var n=Ig(t),r=e(hl(),2),o=r[0];return[function(e){var t=e.children,r=e.initialState,i=e.onChange;return f.createElement(o,{initialState:n.getValue()||r,onChange:function(e){n.setValue(e),i&&i(e)}},t)},r[1]]},hN=function(e,t){return void 0===t&&(t=8),new Intl.NumberFormat("en-US",{style:"decimal",minimumFractionDigits:t,maximumFractionDigits:t}).format(e)},vN=function(e){var t=void 0===e?{}:e,n=t.maxHeight,r=void 0===n?1e3:n,o=t.maxWidth,i=void 0===o?1e3:o;return function(e){var t=e.height,n=e.width,o=n>i?i/n:1,a=t>r?r/t:1,l=Math.min(o,a);return{width:n*l,height:t*l}}},gN=vN(),bN=function(o,i){var a=void 0===i?{}:i,l=a.maxExec,c=void 0===l?3:l,u=a.delay,s=void 0===u?10:u,d=new Set,f=[],m=function(t){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var a=o.apply(void 0,r([],e(n),!1));d.add(a),a.finally(function(){d.delete(a)}),t.resolve(a)},p=eo(function(){return t(void 0,void 0,void 0,function(){var t,o,i;return n(this,function(n){switch(n.label){case 0:return f.length?d.size?[4,Promise.race(d)]:[3,2]:[3,5];case 1:n.sent(),n.label=2;case 2:return d.size>=c?[4,qn(s)]:[3,4];case 3:return n.sent(),[3,0];case 4:return t=f.pop(),o=t.args,i=t.awaiter,m.apply(void 0,r([i],e(o),!1)),[3,0];case 5:return[2]}})})}),h=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return t(void 0,void 0,void 0,function(){var t,i,a;return n(this,function(n){switch(n.label){case 0:return t=e(eN(),2),i=t[0],a=t[1],d.size<c?m.apply(void 0,r([a],e(o),!1)):(f.unshift({awaiter:a,args:o}),p()),[4,i];case 1:return[2,n.sent()]}})})};return h.clear=function(){for(;f.length;)f.pop();d.clear(),p.clear()},h},yN=function(e){return new Promise(function(t,n){var r=new Image,o=URL.createObjectURL(e);r.src=o,r.onerror=function(){URL.revokeObjectURL(o),n(new Error("react-declarative compressImage load error"))},r.onload=function(){URL.revokeObjectURL(o);var e=gN({height:r.naturalHeight,width:r.naturalWidth}),i=e.height,a=e.width,l=document.createElement("canvas");l.width=a,l.height=i;var c=l.getContext("2d");if(!c)throw new Error("react-declarative compressImage null canvas ctx");c.drawImage(r,0,0,a,i);try{l.toBlob(function(e){e?t(e):n(new Error("react-declarative compressImage null blob"))},"image/jpeg",.8)}catch(e){console.error(e),n(new Error("react-declarative compressImage unknown error"))}}})},wN=function(e,r){return void 0===e&&(e=20971520),void 0===r&&(r=10),bN(function(r){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,3,,5]),r.size>e?[4,yN(r)]:[3,2];case 1:case 4:return[2,n.sent()];case 2:return[3,5];case 3:return t=n.sent(),console.error("react-declarative compressImage error",t),[4,new Promise(function(e){var t=document.createElement("canvas");t.width=10,t.height=10;var n=t.getContext("2d");return n&&(n.fillStyle="rgba(0, 0, 0, 0)",n.fillRect(0,0,10,10)),t.toBlob(function(t){e(t||new Blob([],{type:"image/png"}))},"image/png")})];case 5:return[2,r]}})})},{maxExec:r})},EN=wN(),xN=Symbol("timeout"),CN=function(o,i){void 0===i&&(i=3e4);return function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,Promise.race([o.apply(void 0,r([],e(a),!1)),qn(i).then(function(){return xN})])];case 1:return[2,t.sent()]}})})}},kN=function(o,i){for(var a=[],l=2;l<arguments.length;l++)a[l-2]=arguments[l];return t(void 0,r([o,i],e(a),!1),void 0,function(t,r,o){var i,a,l,c,u;return void 0===o&&(o=0),n(this,function(n){return a=!1,l=e(eN(),2),c=l[0],u=l[1].resolve,i=t.subscribe(function(e){r(e)&&(i&&i(),a=!0,u(e))}),o&&qn(o).then(function(){a||(i&&i(),u(xN))}),[2,c]})})},SN=Gr(),LN="Method marked as obsolete. Type ".concat(SN," to continue"),NN=function(e,t){var n,r;if(!t)return"unknown";if("object"!=typeof t)return"unknown";try{for(var o=c(Object.keys(t)),i=o.next();!i.done;i=o.next()){var a=i.value;if(t[a]===e)return a}}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return NN(e,Object.getPrototypeOf(t))},IN=function(o){var i="",a=function(){for(var l=[],c=0;c<arguments.length;c++)l[c]=arguments[c];return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return i=i||NN(a,this),console.log("react-declarative obsolete hof call method_name=".concat(i)),"prompt"in window?window.prompt(LN)!==SN?[3,2]:[4,o.apply(void 0,r([],e(l),!1))]:[3,2];case 1:return[2,t.sent()];case 2:throw new Error("react-declarative obsolete hof call")}})})};return a},MN=function(t){var n=null,o=so(t);return function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var a=o.apply(void 0,r([],e(t),!1));return null!==n&&clearTimeout(n),n=setTimeout(function(){o.clear(),n=null},MN.delay),a}};MN.delay=0;var RN=function(t){var n=!1,o=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return n?t.apply(void 0,r([],e(o),!1)):(n=!0,Promise.resolve())};return o.clear=function(){n=!1},o},PN=function(o,i){void 0===i&&(i=5);var a=Gn(function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];return t(void 0,void 0,void 0,function(){var l,c;return n(this,function(u){switch(u.label){case 0:return l=i,c=function(){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,4]),[4,o.apply(void 0,r([],e(a),!1))];case 1:case 3:return[2,n.sent()];case 2:if(t=n.sent(),0===--l)throw t;return[4,c()];case 4:return[2]}})})},[4,c()];case 1:return[2,u.sent()]}})})});return a},AN=function(t){return Array.isArray(t)&&e(t,1)[0]||null},TN=Symbol("never"),DN=function(o){var i=0,a=new pw(i),l=Gn(function(){for(var i=[],l=0;l<arguments.length;l++)i[l]=arguments[l];return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,new Promise(function(e){var t=function(){0!==a.data?a.once(t):e()};t()})];case 1:return t.sent(),AN(i)===TN?[2,null]:[4,o.apply(void 0,r([],e(i),!1))];case 2:return[2,t.sent()]}})})}),c=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return t(void 0,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,l.apply(void 0,r([],e(o),!1))];case 1:return[2,t.sent()]}})})};return c.clear=function(){a.next(0),a=new pw(i=0),l.clear()},c.cancel=function(){c.clear(),l.cancel()},c.beginLock=function(){i+=1,a.next(i)},c.endLock=function(){return t(void 0,void 0,void 0,function(){return n(this,function(e){switch(e.label){case 0:return i=Math.max(i-1,0),a.next(i),[4,l(TN)];case 1:return e.sent(),[2]}})})},c},jN=Symbol("never"),ON=function(){return function(e){return e.reduce(function(e,t){return e.value===t?{value:t,count:e.count+1}:{value:t,count:0}},{value:jN,count:0})}},FN=Symbol("never"),_N=function(e){return void 0===e&&(e=function(e){return e}),function(t){var n=FN;return t.map(function(t){return{value:t,compare:e(t)}}).filter(function(e){return e.compare!==n}).tap(function(e){var t=e.compare;return n=t}).map(function(e){return e.value})}},BN=function(t){return function(n){return n.reduce(function(n,o){return n.length===t?[o]:r(r([],e(n),!1),[o],!1)},[]).filter(function(e){return e.length===t})}},HN=Symbol("never"),WN=function(e){return function(t){return t.reduce(function(e,t){return{value:t,idx:e.idx+1}},{value:HN,idx:0}).filter(function(t){return t.idx<=e}).map(function(e){return e.value})}},zN=Symbol("never"),VN=function(e,t){return void 0===t&&(t=5e3),function(n){var r=!0;return mr.merge([mr.fromInterval(t).filter(function(){var e=r;return r=!1,!e}).operator(WN(1)).tap(e).map(function(){return zN}),n.tap(function(){r=!0})]).filter(function(e){return e!==zN})}},YN=function(t){return void 0===t&&(t=2),function(n){return n.reduce(function(n,o){return r(r([],e(n),!1),[o],!1).slice(-t)},[]).filter(function(e){return e.length===t})}},UN=Symbol("never"),qN=function(e){return function(t){return t.reduce(function(e,t){return{value:t,idx:e.idx+1}},{value:UN,idx:0}).filter(function(t){return t.idx>e}).map(function(e){return e.value})}},$N=function(t,n){return void 0===n&&(n=Math.floor(t/2)),function(o){var i=-1,a=-1,l=-1,c=!1;return o.tap(function(e){if(-1===i&&(i=e.length,a=Math.ceil((i-t)/n),l=a+((c=a*t!==i)?1:0),t>i||n>t))throw new Error("react-declarative strideTricks too big stride")}).flatMap(function(e){if(e.length!==i)throw new Error("react-declarative strideTricks unshaped data");for(var r=[],o=0;o!==a;o++){var l=o*n;r.push(e.slice(l,l+t))}if(c){var u=e.slice(i-t,i);u.lastStep=!0,r.push(u)}return r.flat(1)}).reduce(function(n,o){return n.length===t?[o]:r(r([],e(n),!1),[o],!1)},[]).filter(function(e){return e.length===t}).reduce(function(t,n){return t.length===l?[n]:r(r([],e(t),!1),[n],!1)},[]).filter(function(e){return e.length===l})}},XN=function(){function e(){}return e.take=WN,e.skip=qN,e.pair=YN,e.group=BN,e.strideTricks=$N,e.distinct=_N,e.liveness=VN,e.count=ON,e}(),GN=function(e,t){return e instanceof Array?e.includes(t):e instanceof Set||e instanceof Map?e.has(t):!!e&&e===t},KN=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return e.some(function(e){return e instanceof Promise})?new Promise(function(r,o){return t(void 0,void 0,void 0,function(){var t,i,a;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,Promise.all(e)];case 1:return t=n.sent(),i=t.reduce(function(e,t){return Boolean(e&&t)},!0),r(i),[3,3];case 2:return a=n.sent(),o(a),[3,3];case 3:return[2]}})})}):e.reduce(function(e,t){return Boolean(e&&t)},!0)},QN=function(e){var r=e.condition,o=e.run,i=e.not,a=void 0!==i&&i,l="function"==typeof r?r():r,c="function"==typeof o?o():o,u=a;return c instanceof Promise||l instanceof Promise||u instanceof Promise?new Promise(function(e,r){return t(void 0,void 0,void 0,function(){var t,o,i;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,5,,6]),[4,l];case 1:return n.sent()?(t=e,[4,c]):[3,3];case 2:return t.apply(void 0,[n.sent()]),[2];case 3:return o=e,[4,u];case 4:return o.apply(void 0,[n.sent()]),[3,6];case 5:return i=n.sent(),r(i),[3,6];case 6:return[2]}})})}):l?c:u},JN=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t=t.flat(1),r([],e(new Set(t.flatMap(function(e){return Array.isArray(e)?JN(e):e}).filter(Boolean))),!1)},ZN=function(t){return Array.isArray(t)&&e(t.slice(-1),1)[0]||null},eI=function(e){return(null==e?void 0:e.filter(function(e){return e}))||[]},tI=function(t,n,o,i){var a,l,u=(l=a=i,"function"==typeof a&&(l=a()),l&&!Array.isArray(l)&&(l=Object.entries(l).map(function(t){var n=e(t,2),r=n[0];return n[1]?r:null}).filter(function(e){return!!e})),l);return function(t,n,o){var i=new Set,a=function(e,t,n,r){var o,l;void 0===r&&(r=!1);var u=e.isVisible,s=void 0===u?function(){return!0}:u;if(("function"==typeof e.hidden?e.hidden(n):e.hidden)&&(r=!0),s(t,n)||(r=!0),r&&i.add(e),e.fields)try{for(var d=c(e.fields),f=d.next();!f.done;f=d.next()){var m=f.value;a(m,t,n,r)}}catch(e){o={error:e}}finally{try{f&&!f.done&&(l=d.return)&&l.call(d)}finally{if(o)throw o.error}}e.child&&a(e.child,t,n,r)};(t=Pr(t)).forEach(function(e){return a(e,n,o)}),t=t.filter(function(e){return!i.has(e)});var l=r([],e(i),!1).filter(function(e){var n=e.name;return!t.some(function(e){return e.name===n})});return{visible:t,hidden:l}}(t.filter(function(e){return!u||!e.features||e.features.some(function(e){return u.includes(e)})}),n,o)},nI=function(e,t){var n,r;void 0===t&&(t=function(){return!1});var o=Object.keys(e||{}),i=0;try{for(var a=c(o),l=a.next();!l.done;l=a.next()){var u=l.value;null!==e[u]&&(""!==e[u]&&!1!==e[u]&&(t(u,e[u])||i++))}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i},rI=function(e,t,n){var r=[],o=tf(nf(e));return Pr(o).forEach(function(e){var o=e.isInvalid,i=void 0===o?function(){return null}:o,a=e.hidden;if(!("function"==typeof a?a(n):a)){var l=i(t,n)||null;null!==l&&r.push({field:e,error:l,name:e.name,title:e.title||(e.name?Ao(e.name):e.title)})}}),r.length?r:null},oI=function(t,n,r){var o=rI(t,n,r);return o?e(o,1)[0].error:null},iI=new Set([Dn.Text,Dn.Time,Dn.Date,Dn.Items,Dn.Combo,Dn.Checkbox,Dn.Choose,Dn.Complete,Dn.Radio,Dn.YesNo,Dn.Switch,Dn.Component,Dn.Tree,Dn.Phony]),aI=function(e,t){var n,r,o=void 0===t?{}:t,i=o.keyToTitle,a=void 0===i?function(e){return e}:i,l=o.ignore,u=void 0===l?function(){return!1}:l,s=[],d=function(e,t,n,r){if(!e)return"continue";if(u(e))return"continue";if(s.some(function(t){return t.value===e}))return"continue";if(iI.has(t)){var o=n||r||a(e);s.push({label:"".concat(o,", ").concat(String(Symbol.keyFor(t)||t)),value:e})}};try{for(var f=c(Pr(e)),m=f.next();!m.done;m=f.next()){var p=m.value;d(p.name,p.type,p.title,p.placeholder)}}catch(e){n={error:e}}finally{try{m&&!m.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}return s},lI=function(t,n,r,o){var i=rI(t,n,r);if(i){var a=e(i,1)[0],l=a.error,c=a.title,u=a.name;return o&&o(l,c,u),!0}return!1},cI=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.flat(1/0)},uI=function(e){var t;do{t=e.length,e=e.split(" ").join(" ")}while(t!==e.length);return e},sI=function(t,n,r){var o=t,i=cI([n]),a=cI([r]);if(i.length!==a.length){var l=e(a,1)[0],c=void 0===l?"":l;i.forEach(function(e){return o=o.split(e).join(c)})}else i.forEach(function(e,t){return o=o.split(e).join(a[t])});return o},dI=function(e,t,n){void 0===t&&(t=2),void 0===n&&(n=",");var r="string"==typeof e?Number(e.replaceAll(" ","")):e,o=r.toFixed(t);return(r<1e4?o:o.replace(/(\d)(?=(\d{3})+(\.|$))/g,"$1".concat(" "))).replace(/.00$/,"").replace(".",n)},fI=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=t.reduce(function(e,t){return a(a({},e),t)},{});return e.replace(/{[a-zA-Z_\-0-9]+}/g,function(e){var t=e.replace(/{|}/g,"");return void 0!==r[t]?String(r[t]):""})},mI=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=-1;return e.replace(/{\d}|{}/g,function(e){if(r+=1,"{}"===e)return void 0!==t[r]?String(t[r]):"";var n=parseInt(e.replace(/{|}/g,""));return void 0!==t[n]?String(t[n]):""})},pI=function(e,t){var n=void 0===t?{}:t,r=n.allowed,o=void 0===r?function(){return!0}:r,i=n.map,a=void 0===i?function(e){return e}:i,l=ip(e),c=l.getValue();c&&(c=o(c)?c:null);var u=ct(c?{initialEntries:[{pathname:c}]}:void 0);return u.listen(function(e){var t=e.location,n=a(t.pathname);l.setValue(n)}),u},hI=function(t){var n=ip(t),o=new Set(n.getValue()||[]);return{has:function(e){return o.has(e)},add:function(t){o.add(t),n.setValue(r([],e(o),!1))},delete:function(t){o.delete(t),n.setValue(r([],e(o),!1))},toSet:function(){return o},clear:function(){o.clear(),n.setValue(r([],e(o),!1))}}},vI=function(t){var n=Ig(t),o=new Set(n.getValue()||[]);return{has:function(e){return o.has(e)},add:function(t){o.add(t),n.setValue(r([],e(o),!1))},delete:function(t){o.delete(t),n.setValue(r([],e(o),!1))},toSet:function(){return o},clear:function(){o.clear(),n.setValue(r([],e(o),!1))}}},gI=so(function(){var e=new ar;return new MutationObserver(Jn(function(){return e.next()},1e3)).observe(document.body,{childList:!0,subtree:!0}),e}),bI=function(e,t,n){void 0===e&&(e="bgcolor-red"),void 0===t&&(t="");var r=void 0===n?{}:n,o=r.onClick,i=r.onInit;function a(){var e=Reflect.construct(HTMLElement,[],a);if(e.setAttribute("style",t),i){var n=i(e);"function"==typeof n&&function(e,t){var n=gI().subscribe(function(){document.contains(e)||(n(),t())})}(e,n)}return o&&(e.onclick=o),e}"HTMLElement"in globalThis&&(a.prototype=Object.create(HTMLElement.prototype),customElements.define(e,a))},yI=function(e){document.head.innerHTML+='\n <meta name="theme-color" content="'.concat(e,'">\n <style>\n html {\n background: ').concat(e," !important;\n }\n </style>\n ")},wI=new function(){var e=this;this._cacheMap=new Map,this.createPromise=function(t){var n;return e._cacheMap.has(t)||e._cacheMap.set(t,(n=t,new Promise(function(e){var t=document.createElement("img"),r=document.createElement("canvas"),o=r.getContext("2d");t.onload=function(t){var n=t.target;r.width=n.naturalWidth,r.height=n.naturalHeight,o.drawImage(n,0,0),r.toBlob(function(t){return e(t)},"image/png",1)},t.crossOrigin="",t.src=n}))),e._cacheMap.get(t)}},EI=function(e){return{ref:function(t){t&&(t.style.visibility="hidden",wI.createPromise(e).then(function(e){document.contains(t)&&(t.src=URL.createObjectURL(e),t.style.visibility="visible")}))}}},xI=new function(){var e=this;this._keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",this.encode=function(t){for(var n,r,o,i,a,l,c,u="",s=0;s<t.length;)i=(n=t.charCodeAt(s++))>>2,a=(3&n)<<4|(r=t.charCodeAt(s++))>>4,l=(15&r)<<2|(o=t.charCodeAt(s++))>>6,c=63&o,isNaN(r)?l=c=64:isNaN(o)&&(c=64),u=u+e._keyStr.charAt(i)+e._keyStr.charAt(a)+e._keyStr.charAt(l)+e._keyStr.charAt(c);return u},this.decode=function(t){var n,r,o,i,a,l,c="",u=0;for(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");u<t.length;)n=e._keyStr.indexOf(t.charAt(u++))<<2|(i=e._keyStr.indexOf(t.charAt(u++)))>>4,r=(15&i)<<4|(a=e._keyStr.indexOf(t.charAt(u++)))>>2,o=(3&a)<<6|(l=e._keyStr.indexOf(t.charAt(u++))),c+=String.fromCharCode(n),64!=a&&(c+=String.fromCharCode(r)),64!=l&&(c+=String.fromCharCode(o));return c}},CI=function(e){try{return JSON.parse(xI.decode(e))}catch(e){return null}},kI=function(e){return xI.encode(JSON.stringify(e))},SI=function(t){try{var n=t.map(function(e){return String.fromCharCode(e)}).join("");return Object.fromEntries(n.split(";").map(function(e){return e.split("=")}).map(function(t){var n=e(t,2),r=n[0],o=n[1];return"true"===o?[r,!0]:"false"===o?[r,!1]:"null"===o?[r,null]:Number.isNaN(parseFloat(o))?[r,o]:[r,parseFloat(o)]}))}catch(e){return null}},LI=function(t){var n=Object.entries(t);n.forEach(function(t){var n=e(t,2);n[0];var r=n[1];if("string"==typeof r){var o=!1;if(o=(o=o||r.includes("="))||r.includes(";"))throw new Error("String param must not include = or ; symbols")}});var o=n.map(function(t){var n=e(t,2),r=n[0],o=n[1];return"".concat(r,"=").concat(o)}).join(";");return r([],e(o),!1).map(function(e){return e.charCodeAt(0)})},NI=function(t){for(var n=r([],e(new Array(32)),!1).fill("\0"),o=0;o!==t.length;o++)n[o]=t[o];t=n.join("");var i="";for(o=0;o<t.length;o++){var a=t.charCodeAt(o).toString(16);i+=a.length<2?"0"+a:a}return"0x"+i},II=function(e){if(!function(e){return"string"==typeof e&&/^(-)?0x[0-9a-f]*$/i.test(e)}(e))throw new Error("The parameter must be a valid HEX string.");var t="",n=0,r=e.length;for("0x"===e.substring(0,2)&&(n=2);n<r;n+=2){var o=parseInt(e.slice(n,n+2),16);t+=String.fromCharCode(o)}return t.split("").filter(function(e){return"\0"!==e}).join("")};var MI=Object.freeze({__proto__:null,crypt:(e,t)=>{if(!t)return"";const n=e=>e.split("").map(e=>e.charCodeAt(0));return t.split("").map(n).map(t=>n(e).reduce((e,t)=>e^t,t)).map(e=>("0"+Number(e).toString(16)).substr(-2)).join("")},decrypt:(e,t)=>{if(!t)return"";return t.match(/.{1,2}/g).map(e=>parseInt(e,16)).map(t=>{return(n=e,n.split("").map(e=>e.charCodeAt(0))).reduce((e,t)=>e^t,t);var n}).map(e=>String.fromCharCode(e)).join("")}}),RI=function(e){return void 0===e&&(e=Ue()),60*e.get("hour")+e.get("minute")},PI=function(e){return Ue().set("hour",0).set("minute",0).add(e,"minute")},AI=function(e){return new Date(e.getTime()+60*e.getTimezoneOffset()*1e3)},TI=function(e,t){var n=[];return function(r){var o,i;void 0===r&&(r=[]);try{for(var a=c(r),l=a.next();!l.done;l=a.next()){var u=l.value;if(t>0)t-=1;else{if(!(e>0))break;n.push(u),e-=1}}}catch(e){o={error:e}}finally{try{l&&!l.done&&(i=a.return)&&i.call(a)}finally{if(o)throw o.error}}return{rows:n,done:e<=0}}},DI=function(e,r,o){return t(void 0,void 0,void 0,function(){var t,i,a,l,c,u,s,f,m,p;return n(this,function(n){switch(n.label){case 0:t=TI(r,o),n.label=1;case 1:n.trys.push([1,6,7,12]),l=!0,c=d(e),n.label=2;case 2:return[4,c.next()];case 3:if(u=n.sent(),s=u.done)return[3,5];if(p=u.value,l=!1,i=[p].flatMap(function(e){return e}),t(i).done)return[3,5];n.label=4;case 4:return l=!0,[3,2];case 5:return[3,12];case 6:return a=n.sent(),f={error:a},[3,12];case 7:return n.trys.push([7,,10,11]),l||s||!(m=c.return)?[3,9]:[4,m.call(c)];case 8:n.sent(),n.label=9;case 9:return[3,11];case 10:if(f)throw f.error;return[7];case 11:return[7];case 12:return[2,t().rows]}})})};function jI(e){return o(this,arguments,function(){var t,r,o,a,l,u,s,f,m,p,h,v,g,b,y,w;return n(this,function(n){switch(n.label){case 0:t=new Set,n.label=1;case 1:n.trys.push([1,14,15,20]),r=!0,o=d(e),n.label=2;case 2:return[4,i(o.next())];case 3:if(a=n.sent(),g=a.done)return[3,13];w=a.value,r=!1,l=[w].flatMap(function(e){return e}),n.label=4;case 4:n.trys.push([4,10,11,12]),h=void 0,u=c(l),s=u.next(),n.label=5;case 5:return s.done?[3,9]:(f=s.value,t.has(f.id)?[3,8]:(t.add(f.id),[4,i(f)]));case 6:return[4,n.sent()];case 7:n.sent(),n.label=8;case 8:return s=u.next(),[3,5];case 9:return[3,12];case 10:return m=n.sent(),h={error:m},[3,12];case 11:try{s&&!s.done&&(v=u.return)&&v.call(u)}finally{if(h)throw h.error}return[7];case 12:return r=!0,[3,2];case 13:return[3,20];case 14:return p=n.sent(),b={error:p},[3,20];case 15:return n.trys.push([15,,18,19]),r||g||!(y=o.return)?[3,17]:[4,i(y.call(o))];case 16:n.sent(),n.label=17;case 17:return[3,19];case 18:if(b)throw b.error;return[7];case 19:return[7];case 20:return[2]}})})}var OI=function(e){return t(void 0,void 0,void 0,function(){var t,r,o,i,a,l,c,u,s,f;return n(this,function(n){switch(n.label){case 0:t=[],n.label=1;case 1:n.trys.push([1,6,7,12]),i=!0,a=d(e),n.label=2;case 2:return[4,a.next()];case 3:if(l=n.sent(),c=l.done)return[3,5];f=l.value,i=!1,r=f,t.push(r),n.label=4;case 4:return i=!0,[3,2];case 5:return[3,12];case 6:return o=n.sent(),u={error:o},[3,12];case 7:return n.trys.push([7,,10,11]),i||c||!(s=a.return)?[3,9]:[4,s.call(a)];case 8:n.sent(),n.label=9;case 9:return[3,11];case 10:if(u)throw u.error;return[7];case 11:return[7];case 12:return[2,t.flatMap(function(e){return e})]}})})};function FI(e,t){return o(this,arguments,function(){var r,o,a,l,u,s,f,m,p,h,v,g,b,y,w;return n(this,function(n){switch(n.label){case 0:n.trys.push([0,14,15,20]),r=!0,o=d(e),n.label=1;case 1:return[4,i(o.next())];case 2:if(a=n.sent(),g=a.done)return[3,13];w=a.value,r=!1,l=[w].flatMap(function(e){return e}),n.label=3;case 3:n.trys.push([3,10,11,12]),h=void 0,u=c(l),s=u.next(),n.label=4;case 4:return s.done?[3,9]:(f=s.value,[4,i(t(f))]);case 5:return n.sent()?[4,i(f)]:[3,8];case 6:return[4,n.sent()];case 7:n.sent(),n.label=8;case 8:return s=u.next(),[3,4];case 9:return[3,12];case 10:return m=n.sent(),h={error:m},[3,12];case 11:try{s&&!s.done&&(v=u.return)&&v.call(u)}finally{if(h)throw h.error}return[7];case 12:return r=!0,[3,1];case 13:return[3,20];case 14:return p=n.sent(),b={error:p},[3,20];case 15:return n.trys.push([15,,18,19]),r||g||!(y=o.return)?[3,17]:[4,i(y.call(o))];case 16:n.sent(),n.label=17;case 17:return[3,19];case 18:if(b)throw b.error;return[7];case 19:return[7];case 20:return[2]}})})}function _I(e,t){return o(this,arguments,function(){var r,o,a,l,u,s,f,m,p,h,v,g,b,y,w;return n(this,function(n){switch(n.label){case 0:n.trys.push([0,14,15,20]),r=!0,o=d(e),n.label=1;case 1:return[4,i(o.next())];case 2:if(a=n.sent(),g=a.done)return[3,13];w=a.value,r=!1,l=[w].flatMap(function(e){return e}),n.label=3;case 3:n.trys.push([3,10,11,12]),h=void 0,u=c(l),s=u.next(),n.label=4;case 4:return s.done?[3,9]:(f=s.value,[4,i(t(f))]);case 5:return[4,i.apply(void 0,[n.sent()])];case 6:return[4,n.sent()];case 7:n.sent(),n.label=8;case 8:return s=u.next(),[3,4];case 9:return[3,12];case 10:return m=n.sent(),h={error:m},[3,12];case 11:try{s&&!s.done&&(v=u.return)&&v.call(u)}finally{if(h)throw h.error}return[7];case 12:return r=!0,[3,1];case 13:return[3,20];case 14:return p=n.sent(),b={error:p},[3,20];case 15:return n.trys.push([15,,18,19]),r||g||!(y=o.return)?[3,17]:[4,i(y.call(o))];case 16:n.sent(),n.label=17;case 17:return[3,19];case 18:if(b)throw b.error;return[7];case 19:return[7];case 20:return[2]}})})}var BI=function(a){return o(this,arguments,function(o){var a,l,c,u,s,d=this,f=o.totalDocuments,m=void 0===f?1e4:f,p=o.limit,h=void 0===p?5e3:p,v=o.delay,g=void 0===v?100:v,b=o.createRequest,y=void 0===b?function(){return[]}:b;return n(this,function(o){switch(o.label){case 0:a=function(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return t(d,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:return[4,Promise.all([y.apply(void 0,r([],e(o),!1)),qn(g)])];case 1:return t=e.apply(void 0,[n.sent(),1]),[2,t[0]]}})})},l=0,c=null,u=a({lastId:null,offset:0,page:0,limit:h}),o.label=1;case 1:return l<m?[4,i(u)]:[3,8];case 2:return(s=o.sent()).length<h?[4,i(s)]:[3,5];case 3:return[4,o.sent()];case 4:return o.sent(),[3,8];case 5:if(s.length>h)throw new Error("react-declarative iterateDocuments response.length > limit");return c=s[s.length-1].id||null,u=a({lastId:c,offset:l+=h,page:Math.ceil(l/h),limit:h}),[4,i(s)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,1];case 8:return[2]}})})};function HI(e){return o(this,arguments,function(){var t,r,o,a,l,u;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,7,8,9]),[4,i(e())];case 1:t=c.apply(void 0,[n.sent()]),r=t.next(),n.label=2;case 2:return r.done?[3,6]:(o=r.value,[4,i(o)]);case 3:return[4,n.sent()];case 4:n.sent(),n.label=5;case 5:return r=t.next(),[3,2];case 6:return[3,9];case 7:return a=n.sent(),l={error:a},[3,9];case 8:try{r&&!r.done&&(u=t.return)&&u.call(t)}finally{if(l)throw l.error}return[7];case 9:return[2]}})})}var WI=function(e){return function(t,r){return o(this,arguments,function(){var o,a,l,u,s,f,m,p,h,v,g,b,y,w,E,x,C,k,S,L,N,I;return n(this,function(n){switch(n.label){case 0:o=new Set,n.label=1;case 1:n.trys.push([1,26,27,28]),a=c(e),l=a.next(),n.label=2;case 2:if(l.done)return[3,25];u=l.value,n.label=3;case 3:n.trys.push([3,18,19,24]),s=!0,L=void 0,f=d(u),n.label=4;case 4:return[4,i(f.next())];case 5:if(m=n.sent(),S=m.done)return[3,17];I=m.value,s=!1,p=[I].flatMap(function(e){return e}),n.label=6;case 6:n.trys.push([6,14,15,16]),C=void 0,h=c(p),v=h.next(),n.label=7;case 7:return v.done?[3,13]:(g=v.value,o.has(g.id)?[3,12]:r>0?(r-=1,[3,12]):t>0?(o.add(g.id),[4,i(g)]):[3,10]);case 8:return[4,n.sent()];case 9:return n.sent(),t-=1,[3,12];case 10:return[4,i(void 0)];case 11:return[2,n.sent()];case 12:return v=h.next(),[3,7];case 13:return[3,16];case 14:return b=n.sent(),C={error:b},[3,16];case 15:try{v&&!v.done&&(k=h.return)&&k.call(h)}finally{if(C)throw C.error}return[7];case 16:return s=!0,[3,4];case 17:return[3,24];case 18:return y=n.sent(),L={error:y},[3,24];case 19:return n.trys.push([19,,22,23]),s||S||!(N=f.return)?[3,21]:[4,i(N.call(f))];case 20:n.sent(),n.label=21;case 21:return[3,23];case 22:if(L)throw L.error;return[7];case 23:return[7];case 24:return l=a.next(),[3,2];case 25:return[3,28];case 26:return w=n.sent(),E={error:w},[3,28];case 27:try{l&&!l.done&&(x=a.return)&&x.call(a)}finally{if(E)throw E.error}return[7];case 28:return[2]}})})}};function zI(e){return o(this,arguments,function(e,t){var r,o,a,l,u,s;return void 0===t&&(t=function(e){return Promise.resolve(e)}),n(this,function(n){switch(n.label){case 0:n.trys.push([0,7,8,9]),r=c(e),o=r.next(),n.label=1;case 1:return o.done?[3,6]:(a=o.value,[4,i(t(a))]);case 2:return[4,i.apply(void 0,[n.sent()])];case 3:return[4,n.sent()];case 4:n.sent(),n.label=5;case 5:return o=r.next(),[3,1];case 6:return[3,9];case 7:return l=n.sent(),u={error:l},[3,9];case 8:try{o&&!o.done&&(s=r.return)&&s.call(r)}finally{if(u)throw u.error}return[7];case 9:return[2]}})})}var VI=function(e,t){var n=t.sizeOriginal,r=t.onProgress;return new Promise(function(t,o){var i=new XMLHttpRequest;i.addEventListener("progress",function(e){e.lengthComputable?r&&r(e.loaded/e.total*100):n?r&&r(Math.min(e.loaded/n*100,100)):console.log("downloadBlob file length is not computable")}),i.addEventListener("error",function(e){o(e)}),i.addEventListener("loadend",function(){r&&r(100),200===i.status?4!==i.readyState||t(i.response):o(new Error("downloadBlob status !== 200"))}),i.responseType="blob",i.open("GET",e,!0),i.setRequestHeader("Content-Type","application/octet-stream"),i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.setRequestHeader("Access-Control-Allow-Origin","*"),i.send()})},YI=Xn(function(e,r,o){return t(void 0,void 0,void 0,function(){var t;return n(this,function(n){switch(n.label){case 0:console.log("useOpenDocument downloadXHR",{url:e}),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,VI(e,{onProgress:r,sizeOriginal:o})];case 2:return[2,n.sent()];case 3:return t=n.sent(),console.log("useOpenDocument downloadXHR error",t),r&&r(0),[2,null];case 4:return[2]}})})}),UI=Xn(function(e,r){return t(void 0,void 0,void 0,function(){var t,o,i;return n(this,function(n){switch(n.label){case 0:console.log("useOpenDocument downloadFetch",{url:e}),n.label=1;case 1:return n.trys.push([1,4,,5]),[4,fetch(e,{method:"GET",headers:{"Content-Type":"application/octet-stream","X-Requested-With":"XMLHttpRequest","Access-Control-Allow-Origin":"*"},mode:"no-cors"})];case 2:if(!(t=n.sent()).ok)throw t;return[4,t.blob()];case 3:return o=n.sent(),r&&r(100),[2,o];case 4:return i=n.sent(),r&&r(0),console.log("useOpenDocument downloadFetch error",i),[2,null];case 5:return[2]}})})}),qI=function(e){var t=e.primary,n=e.secondary;return f.createElement(tt,{sx:{ml:-1}},f.createElement(Nn,null,f.createElement(Ln,null,f.createElement(In,null))),f.createElement(Oe,{primary:t,secondary:n}))},$I=[{id:"main",element:function(r){var o=r.onChange,i=r.history,l=r.data,c=e(g(0),2),u=c[0],s=c[1],d=il([l],10);return kc(function(){return t(void 0,void 0,void 0,function(){var e,t,r,c,u;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,6,,7]),[4,YI(l.url,s,l.sizeOriginal)];case 1:return(e=n.sent())===$n?[2]:e?[3,3]:[4,UI(l.url,s)];case 2:e=n.sent(),n.label=3;case 3:return e===$n?[2]:e?[4,Sn(e)]:(console.log("useOpenDocument failed to fetch"),i.replace("/error"),[2]);case 4:return t=n.sent(),r=(null==t?void 0:t.mime)||e.type,c=URL.createObjectURL(new Blob([e],{type:r})),o(a(a({},l),{blob:e,url:c,mime:r})),[4,d()];case 5:return n.sent(),r.startsWith("image/")?i.replace("/image"):r.startsWith("audio/")?i.replace("/audio"):r.startsWith("video/")?i.replace("/video"):r.endsWith("/pdf")?i.replace("/pdf"):"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"===r||"application/x-cfb"===r?i.replace("/sheet"):i.replace("/file"),[3,7];case 6:return u=n.sent(),console.error(u),i.replace("/error"),[3,7];case 7:return[2]}})})}),w(function(){return function(){UI.cancel(),YI.cancel()}},[]),f.createElement(Dw,{variant:0!==u&&100!==u?"determinate":"indeterminate",value:0!==u&&100!==u?u:void 0,size:48,sx:{height:275}})},isActive:function(e){return!!dL("/",e)}},{id:"file",element:function(e){var t=e.formState;return w(function(){return function(){URL.revokeObjectURL(t.data.main.url)}},[]),f.createElement(j,{mt:1,mb:2},f.createElement(qI,{primary:t.data.main.fileName,secondary:t.data.main.placeholder||t.data.main.mime}))},isActive:function(e){return!!dL("/file",e)}},{id:"pdf",element:function(e){var t=e.formState;return w(function(){return function(){URL.revokeObjectURL(t.data.main.url)}},[]),f.createElement(j,{mt:1,mb:2},f.createElement(lk,{withFullScreen:!0,src:t.data.main.url,sx:{height:275,width:"100%",objectFit:"contain"}}),f.createElement(qI,{primary:t.data.main.fileName,secondary:t.data.main.placeholder||t.data.main.mime}))},isActive:function(e){return!!dL("/pdf",e)}},{id:"image",element:function(e){var t=e.formState;return w(function(){return function(){URL.revokeObjectURL(t.data.main.url)}},[]),f.createElement(j,{mt:1,mb:2},f.createElement(uk,{withFullScreen:!0,src:t.data.main.url,sx:{height:275,width:"100%",objectFit:"contain"}}),f.createElement(qI,{primary:t.data.main.fileName,secondary:t.data.main.placeholder||t.data.main.mime}))},isActive:function(e){return!!dL("/image",e)}},{id:"video",element:function(e){var t=e.formState;return w(function(){return function(){URL.revokeObjectURL(t.data.main.url)}},[]),f.createElement(j,{mt:1,mb:2},f.createElement(j,{component:"video",src:t.data.main.url,controls:!0,muted:!0,autoPlay:!0,sx:{height:275,width:"100%",objectFit:"contain"}}),f.createElement(qI,{primary:t.data.main.fileName,secondary:t.data.main.placeholder||t.data.main.mime}))},isActive:function(e){return!!dL("/video",e)}},{id:"audio",element:function(e){var t=e.formState;return w(function(){return function(){URL.revokeObjectURL(t.data.main.url)}},[]),f.createElement(j,{mt:1,mb:2},f.createElement(j,{component:"audio",src:t.data.main.url,controls:!0,autoPlay:!0,sx:{width:"100%"}}),f.createElement(qI,{primary:t.data.main.fileName,secondary:t.data.main.placeholder||t.data.main.mime}))},isActive:function(e){return!!dL("/audio",e)}},{id:"sheet",element:function(r){var o=r.formState,i=r.history,a=e(g([]),2),l=a[0],c=a[1],u=b(!1);return w(function(){return function(){u.current||URL.revokeObjectURL(o.data.main.url)}},[]),w(function(){t(void 0,void 0,void 0,function(){var e,t,r,a,l,s,d;return n(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),window.XLSX?(r=(t=window.XLSX).read,[4,o.data.main.blob.arrayBuffer()]):(console.warn("Looks like XLSX library is not provided"),console.warn("It being linked using global object"),console.warn("Use the next code in index to use SheetView"),console.warn('import * as XLSX from "xlsx"'),console.warn("Object.assign(globalThis, { XLSX })"),u.current=!0,i.replace("/file"),[2]);case 1:return e=r.apply(t,[n.sent(),{type:"binary"}]),a=e.SheetNames[0],l=e.Sheets[a],s=window.XLSX.utils.sheet_to_json(l,{header:1}),d=s.map(Object.values),c(d),[3,3];case 2:return n.sent(),u.current=!0,i.replace("/file"),[3,3];case 3:return[2]}})})},[]),f.createElement(j,{mt:1,mb:2},f.createElement(lm,{withFullScreen:!0,data:l,sx:{height:275,width:"100%"}}),f.createElement(qI,{primary:o.data.main.fileName,secondary:o.data.main.placeholder||o.data.main.mime}))},isActive:function(e){return!!dL("/sheet",e)}},{id:"error",element:function(){return f.createElement(_,{sx:{height:275,width:"100%",whiteSpace:"wrap"},color:"red",variant:"body1"},"An error aquired while downloading a preview")},isActive:function(e){return!!dL("/error",e)}}],XI=ct(),GI=function(t){var n=void 0===t?{}:t,r=n.onLoadStart,o=n.onLoadEnd,i=n.fallback,l=n.onMount,c=n.onUnmount,u=n.onSubmit,s=n.onClose,d=n.title,m=void 0===d?"Document preview":d,p=n.submitLabel,h=void 0===p?"Download":p,v=n.submitIcon,g=e(ro(null),2),b=g[0],w=g[1],E=zw({title:m,AfterTitle:function(e){var t=e.onClose;return f.createElement(Ne,{size:"small",onClick:t},f.createElement(Fe,null))},withActionButton:!0,withStaticAction:!1,onSubmit:u,onLoadStart:r,onLoadEnd:o,fallback:i,onMount:l,onUnmount:function(){w(null),c&&c()},onClose:s,submitLabel:h,submitIcon:v,routes:$I,history:XI,fullScreen:!1,mapInitialData:function(){return{main:a({blob:null,mime:null},b.current)}}}),x=E.render,C=E.pickData;return{render:x,pickData:y(function(e){w(e),XI.push("/"),C(e.url)},[])}},KI=function(e,t){var n=(void 0===t?{}:t).loaderSize,r=void 0===n?48:n,o=N(e);return function(e){return f.createElement(I,{fallback:f.createElement(Dw,{sx:{width:"100%",height:"80vh"},size:r})},f.createElement(o,a({},e)))}},QI=bS,JI=Oy.install,ZI=My,eM=a({},Up),tM=a({},Gl),nM=a({},MI);export{nw as ActionBounce,ui as ActionButton,Ky as ActionChip,om as ActionFab,iw as ActionFilter,Hy as ActionGroup,Zl as ActionIcon,xa as ActionMenu,rg as ActionModal,Wy as ActionState,ow as ActionStopIcon,cw as ActionToggle,aw as ActionTrigger,op as ActionType,Yw as AlertView,ZS as ArraySet,Jr as Async,Hx as AuthView,km as AutoSizer,pw as BehaviorSubject,_y as Breadcrumbs,qy as Breadcrumbs2,ZI as Breadcrumbs2Type,$n as CANCELED_PROMISE_SYMBOL,nk as CalendarView,lC as CardView,rb as Center,pk as ChatController,Ck as ChatView,fS as Chip,Jv as ClassicChipListSlot,Dh as ClassicFilterListSlot,ML as Collection,Gy as ColorButton,Mm as ColumnType,Lm as ConstraintView,iS as Copy,cS as CopyButton,dS as Countdown,Dl as DatePicker,Sg as DenseFilterListSlot,Ng as DenseSearchSlot,lg as DialogFilterListSlot,lk as DocumentView,um as Dot,$w as DragDropView,Gw as DropAreaView,xL as Entity,IL as EntityNotFoundError,$y as ErrorBoundary,Ox as ErrorView,Yn as EventEmitter,bE as FadeView,LC as FeatureType,DC as FeatureView,Nf as FetchError,Bg as FetchView,Mn as FieldType,Qw as FilesView,Pa as Grid,mk as GridView,DE as HtmlView,md as If,uk as ImageView,ki as InfiniteView,SC as KanbanView,ng as LARGE_SIZE_REQUEST,Rv as List,hg as ListActionAdd,Eg as ListActionFab,Cg as ListActionMenu,_h as ListDefaultSlots,Ag as ListRules,Hh as ListSlotFactory,Pv as ListTyped,Dw as LoaderView,xS as MASTER_DETAIL_HEADER,ES as MASTER_DETAIL_ROOT,lS as Map,FS as MasterDetail,QI as MasterDetailMode,YE as MetroView,ug as ModalFilterListSlot,Va as ModalManagerProvider,Ff as ModalProvider,yL as Model,wh as ModernChipListSlot,ef as NoSsr,or as Observer,WE as OfflineView,bf as One,Zf as OneButton,Oo as OneConfig,tu as OneDefaultSlots,Kf as OneIcon,ru as OneSlotFactory,yf as OneTyped,XN as Operator,kf as OtherComboSlot,Sf as OtherItemsSlot,Aw as OutletView,ra as PaperView,AE as PingView,mx as PortalView,Cx as RECORD_NEVER_VALUE,Px as RecordView,NC as ReloadView,qE as RevealView,Kk as RoiView,KS as RouteManager,tg as SMALL_SIZE_REQUEST,Ib as Scaffold,Qb as Scaffold2,Ay as Scaffold3,sE as ScaleView,gS as ScrollAdjust,Iw as ScrollTopView,nm as ScrollView,mw as SearchModal,zc as SearchView,GE as SecretView,gi as SelectionMode,lm as Sheet,xw as SizeProvider,Lw as SnackProvider,mr as Source,Zk as Spinner,ib as Square,ar as Subject,uS as SubjectBinding,Gg as Switch,xN as TIMEOUT_SYMBOL,xE as TabsView,Zr as Task,$i as Tile,Xi as TileCheckbox,Oi as TileMode,yc as TimePicker,Oy as Translate,Zc as TreeView,mi as VIRTUAL_VIEW_CHILD,fi as VIRTUAL_VIEW_ROOT,wi as VirtualListBox,vi as VirtualView,ZE as VisibilityView,RE as WaitView,ax as WizardContainer,ox as WizardNavigation,nx as WizardView,xl as addUtcOffset,RN as afterinit,KN as and,cb as arrays,EI as cacheSrc,pd as cached,Xn as cancelable,Sc as chooseFile,aN as chooseMultipleFiles,sl as compareArray,Xa as compareFulltext,Un as compose,rS as copyToClipboard,eN as createAwaiter,bI as createCustomTag,ZL as createDict,hs as createField,kd as createLayout,Ig as createLsManager,vI as createLsSet,pN as createLsStateProvider,pI as createManagedHistory,cL as createPointer,JS as createRouteItemManager,QS as createRouteParamsManager,vN as createScaleRect,wN as createScaleToSize,qS as createServiceManager,ip as createSsManager,hI as createSsSet,mN as createSsStateProvider,hl as createStateProvider,Er as createValueProvider,jf as createWindowHistory,nM as crypt,tM as datetime,Jn as debounce,Pr as deepFlat,jI as distinctDocuments,rN as downloadBlank,cN as errorData,bN as execpool,Mf as fetchApi,FI as filterDocuments,AN as first,cI as flatArray,dI as formatAmount,mI as formatStr,yl as formatText,II as fromBytes32,UC as fromMomentStamp,PI as fromTimeStamp,tI as getAvailableFields,dN as getElementFromXPath,fL as getErrorMessage,aI as getFieldVariant,oI as getFieldsError,nI as getFilterCount,kl as getGenesisStamp,$f as getInitialData,rI as getInvalidFields,sN as getMediaContext,YC as getMomentStamp,XS as getRouteItem,GS as getRouteParams,RI as getTimeStamp,fN as getXPathFromElement,GN as has,KI as heavy,VS as inject,Id as isBaseline,Ld as isBaselineForRoot,qf as isBaselineSimple,lI as isInvalidFieldData,_n as isObject,nE as isOneArray,BI as iterateDocuments,zI as iterateList,HI as iteratePromise,WI as iterateUnion,JN as join,ZN as last,mv as list2grid,iN as loadScript,DN as lock,yI as mainColor,Xo as makeField,xs as makeLayout,_I as mapDocuments,QN as match,Bi as memoize,Rh as normalizeText,ap as not,ab as objects,IN as obsolete,tE as oneArrayIncludes,ik as openBlank,PC as or,DI as paginateDocuments,SI as parseAsciiParams,CI as parseBase64Json,dL as parseRouteUrl,TI as pickDocuments,YS as prefetch,lN as preventBrowserHistorySwipeGestures,dd as promiseState,fd as promiseValue,WS as provide,Gn as queued,Gr as randomString,JI as registerTr,rp as reloadPage,uI as removeExtraSpaces,oN as removeSubstring,Cl as removeUtcOffset,sI as replaceSubstring,OI as resolveDocuments,PN as retry,hN as roundTicks,gN as scaleRect,EN as scaleToSize,LI as serializeAsciiParams,HS as serviceManager,eo as singlerun,so as singleshot,MN as singletick,qn as sleep,kI as stringifyBase64Json,fI as templateStr,CN as timeout,NI as toBytes32,rE as toOneArray,sL as toRouteUrl,AI as toUtcDate,eI as truely,po as trycatch,xC as ttl,eM as typo,US as unload,og as useActionModal,ig as useActionModalTyped,OL as useActionSnackbar,to as useActualCallback,ro as useActualRef,Dr as useActualState,zr as useActualValue,UL as useAlert,Rf as useApiHandler,Dv as useApiPaginator,Uv as useArrayPaginator,Ai as useAsyncAction,mL as useAsyncProgress,kc as useAsyncValue,pL as useAudioPlayer,hw as useBehaviorSubject,qv as useCachedPaginator,$r as useChange,Li as useChangeDelay,Xr as useChangeSubject,TL as useCollection,Rg as useColumnConfig,zf as useConfirm,Im as useConstraint,nL as useContextMenu,Da as useCursorPaginator,$L as useDate,ji as useDebounce,Ti as useDebouncedCallback,Fi as useDeepChangeSubject,bi as useElementSize,kL as useEntity,jC as useFeatureView,HL as useFile,lE as useFilesView,lL as useForceUpdate,Oa as useGridAction,la as useGridProps,ja as useGridSelection,Xv as useHistoryStatePagination,el as useItemModal,jv as useLastPagination,BL as useList,Kv as useListAction,bp as useListCachedRows,gh as useListChips,wp as useListDropFilters,SL as useListEditor,Bp as useListIntersectionConnect,Hp as useListIntersectionListen,Wp as useListIntersectionStorage,mp as useListModalSort,zm as useListPayload,fm as useListProps,Zm as useListReload,Gv as useListSelection,pm as useListSelectionState,Jh as useListStateAction,Kp as useListToggleHandler,Zh as useListUpsertManager,Af as useLocalHandler,yE as useLocalHistory,Ah as useManagedCursor,tl as useMediaContext,LL as useMediaStreamBuilder,_f as useModal,Ya as useModalManager,EL as useModel,Ta as useOffsetPaginator,Xf as useOnce,QL as useOne,eE as useOneArray,Jo as useOneContext,ni as useOneFeatures,eL as useOneInput,uo as useOneMenu,Ir as useOnePayload,ol as useOneProps,gl as useOneRadio,Ur as useOneState,JL as useOneTyped,GI as useOpenDocument,zw as useOutletModal,uL as usePointer,si as usePreventAction,ub as usePreventAutofill,Uf as usePreventLeave,Zw as usePreventNavigate,VL as usePrompt,Hv as useQueryPagination,Aa as useQueuedAction,Qr as useReloadTrigger,il as useRenderWaiter,DL as useRequestSnackbar,oL as useRouteItem,iL as useRouteParams,vw as useSearchModal,gw as useSearchModalTyped,Ov as useSearchParams,_v as useSearchState,no as useSinglerunAction,rL as useSingleshot,Or as useSingleton,Ew as useSize,Sw as useSnack,Df as useStaticHandler,Fr as useSubject,uw as useSubjectValue,hL as useSubscription,IE as useTabsModal,GL as useTime,Tb as useUserAgent,ex as useVisibilityView,aL as useWatchChanges,Zv as useWindowSize,fx as useWizardModal,br as waitForMove,kN as waitForNext,zS as waitForProvide,$S as websocketManager,vm as wordForm};