@campxdev/campx-web-utils 1.0.2 → 1.0.3-alpha.1

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/cjs/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";var e=require("react/jsx-runtime"),t=require("@mui/material"),n=require("react"),r=require("react-hook-form"),o=require("@campxdev/react-blueprint"),i=require("@mui/icons-material"),a=require("react-toastify"),s=require("axios"),c=require("pullstate"),u=require("react-query"),l=require("react-router-dom"),d=require("@hookform/resolvers"),p=require("device-detector-js"),f=require("yup"),h=require("@mui/x-date-pickers"),m=require("@mui/x-date-pickers/AdapterDateFns"),y=require("react-redux"),v=require("framer-motion"),g=require("@mui/material/Box"),b=require("@mui/material/SpeedDial"),x=require("@mui/material/SpeedDialAction"),w="undefined"!=typeof document?document.currentScript:null;function E(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var j=E(n),k=E(f),O=function(){return O=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},O.apply(this,arguments)};function S(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))}function N(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}function C(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}
2
2
  /*! js-cookie v3.0.5 | MIT */
3
- function _(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}"function"==typeof SuppressedError&&SuppressedError;var P=function e(t,n){function r(e,r,o){if("undefined"!=typeof document){"number"==typeof(o=_({},n,o)).expires&&(o.expires=new Date(Date.now()+864e5*o.expires)),o.expires&&(o.expires=o.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var i="";for(var a in o)o[a]&&(i+="; "+a,!0!==o[a]&&(i+="="+o[a].split(";")[0]));return document.cookie=e+"="+t.write(r,e)+i}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],r={},o=0;o<n.length;o++){var i=n[o].split("="),a=i.slice(1).join("=");try{var s=decodeURIComponent(i[0]);if(r[s]=t.read(a,s),e===s)break}catch(e){}}return e?r[e]:r}},remove:function(e,t){r(e,"",_({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,_({},this.attributes,t))},withConverter:function(t){return e(_({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"}),D={isLoginDialogOpen:!1,snackbar:{open:!1,message:"",severity:"success"},confirmDialog:{isOpen:!1,title:"",message:"",onConfirm:function(){},onCancel:function(){},type:"confirm"},user:void 0,institution:void 0,asset:void 0},I=new c.Store(D),A=P.get("campx_tenant"),T=P.get("campx_institution"),V="localhost"===window.location.hostname,B="development"===process.env.NODE_ENV||V,R=V?A:window.location.hostname.split(".")[0],F=""!==window.location.pathname.split("/")[1]?window.location.pathname.split("/")[1]:T,L=function(){return"undefined"==typeof document?require("url").pathToFileURL(__filename).href:w&&"SCRIPT"===w.tagName.toUpperCase()&&w.src||new URL("index.js",document.baseURI).href,process.env.REACT_APP_API_HOST||""},q=function(e){var t;return Object.fromEntries(null===(t=Object.entries(null!=e?e:{}))||void 0===t?void 0:t.map((function(e){return[e[0],"__empty__"===e[1]?"":e[1]]})))},$=s.create({baseURL:L(),withCredentials:!0,headers:{"x-tenant-id":R,"x-institution-code":F}});$.interceptors.request.use((function(e){var t=q(null==e?void 0:e.params),n=P.get("campx_session_key"),r=P.get("campx_open_payments_key"),o=P.get("campx_student_key");return B&&n&&e.headers.set("campx_session_key",n),B&&o&&e.headers.set("campx_student_key",o),r&&e.headers.set("campx_open_payments_key",r),O(O({},e),{params:t})}),(function(e){return Promise.reject(e)})),$.interceptors.response.use((function(e){return e.config.method&&["put","post","delete","patch"].includes(e.config.method)&&[200,201,202].includes(e.status)&&I.update((function(t){t.snackbar.open=!0,t.snackbar.message=e.data.message,t.snackbar.severity="success"})),e}),(function(e){return[400,422].includes(e.response.status)&&I.update((function(t){t.snackbar.open=!0,t.snackbar.message=e.response.data.message||"Bad Request",t.snackbar.severity="error"})),e.response.config.method&&["put","post","delete","patch"].includes(e.response.config.method)&&[404].includes(e.response.status)&&I.update((function(t){t.snackbar.open=!0,t.snackbar.message=e.response.data.message,t.snackbar.severity="error"})),Promise.reject(e)}));var M=t.styled(t.MenuItem)((function(){return{display:"flex",alignItems:"center",gap:"5px","& .MuiListItemIcon-root":{minWidth:"24px"},"& .MuiSvgIcon-root":{height:"14px",width:"14px"}}}));function K(s){var c=this,u=s.close,l=n.useState({oldPassword:!1,newPassword:!1,confirmPassword:!1}),d=l[0],p=l[1],f=n.useState(!1),h=f[0],m=f[1],y=r.useForm(),v=y.handleSubmit,g=y.control,b=y.reset;return e.jsx("form",{onSubmit:v((function(e){return S(c,void 0,void 0,(function(){var t,n,r,o;return N(this,(function(i){switch(i.label){case 0:if(m(!0),t=e.oldPassword,n=e.newPassword,r=e.confirmPassword,n!==r)return[3,5];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,$.post(B?"https://api.campx.dev/auth-server/auth/change-password":"https://api.campx.in/auth-server/auth/change-password",{oldPassword:t,newPassword:n})];case 2:return i.sent(),a.toast.success("Password Changed Successfully"),m(!1),b(),u(),[3,4];case 3:return o=i.sent(),console.log(o,"this is error"),m(!1),[3,4];case 4:return[3,6];case 5:a.toast.error("New Password, Confirm Password must be same"),m(!1),i.label=6;case 6:return[2]}}))}))})),children:e.jsx(o.FormControlWrapper,{control:g,children:e.jsxs(t.Stack,{gap:1,direction:"column",children:[[{label:"Old Password",name:"oldPassword"},{label:"New Password",name:"newPassword"},{label:"Confirm Password",name:"confirmPassword"}].map((function(n){return e.jsx(e.Fragment,{children:e.jsx(o.TextField,{label:n.label,name:n.name,type:d[n.name]?"text":"password",required:!0,InputProps:{endAdornment:e.jsx(t.InputAdornment,{position:"end",children:e.jsx(t.IconButton,{size:"small",onClick:function(){return p((function(e){var t;return O(O({},e),((t={})[n.name]=!e[n.name],t))}))},edge:"end",children:d[n.name]?e.jsx(i.Visibility,{}):e.jsx(i.VisibilityOff,{})})})}})})})),e.jsxs(t.Stack,{direction:"row",gap:2,sx:{marginTop:"15px"},children:[e.jsx(o.Button,{variant:"outlined",onClick:u,children:"Cancel"}),e.jsx(o.Button,{type:"submit",variant:"contained",endIcon:h&&e.jsx(t.CircularProgress,{style:{color:"white"},size:"30px",thickness:1.7}),children:"Submit"})]})]})})})}var z=function(){return e.jsx(e.Fragment,{children:e.jsx(o.DialogButton,{anchor:function(t){var n=t.open;return e.jsx(M,{onClick:function(){n()},children:"Change Password"})},content:function(t){var n=t.close;return e.jsx(K,{close:n})},title:"Change Password"})})},U=n.createContext({showConfirmDialog:function(){}}),W=function(t){var n=t.children,r=I.useState((function(e){return e.confirmDialog})),i=function(){I.update((function(e){e.confirmDialog.isOpen=!1}))};return e.jsxs(U.Provider,{value:{showConfirmDialog:function(e,t,n,r,o,i,a){void 0===o&&(o="confirm"),I.update((function(s){s.confirmDialog={isOpen:!0,title:e,message:t,onConfirm:n,onCancel:r,type:o,confirmButtonText:i,cancelButtonText:a}}))}},children:[n,e.jsx(o.ConfirmDialog,{isOpen:r.isOpen,title:r.title,message:r.message,type:r.type,confirmButtonText:r.confirmButtonText,cancelButtonText:r.cancelButtonText,onConfirm:function(){r.onConfirm(),i()},onCancel:function(){r.onCancel(),i()}})]})};function Y(e,t){return Y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Y(e,t)}var H={error:null},Q=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).state=H,t.resetErrorBoundary=function(){for(var e,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];null==t.props.onReset||(e=t.props).onReset.apply(e,r),t.reset()},t}!function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Y(e,t)}(t,e),t.getDerivedStateFromError=function(e){return{error:e}};var n=t.prototype;return n.reset=function(){this.setState(H)},n.componentDidCatch=function(e,t){var n,r;null==(n=(r=this.props).onError)||n.call(r,e,t)},n.componentDidUpdate=function(e,t){var n,r,o,i,a=this.state.error,s=this.props.resetKeys;null!==a&&null!==t.error&&(void 0===(o=e.resetKeys)&&(o=[]),void 0===(i=s)&&(i=[]),o.length!==i.length||o.some((function(e,t){return!Object.is(e,i[t])})))&&(null==(n=(r=this.props).onResetKeysChange)||n.call(r,e.resetKeys,s),this.reset())},n.render=function(){var e=this.state.error,t=this.props,n=t.fallbackRender,r=t.FallbackComponent,o=t.fallback;if(null!==e){var i={error:e,resetErrorBoundary:this.resetErrorBoundary};if(j.isValidElement(o))return o;if("function"==typeof n)return n(i);if(r)return j.createElement(r,i);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},t}(j.Component),X=function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),function(o,i,a){try{return Promise.resolve(function(r,s){try{var c=(t.context&&"development"===process.env.NODE_ENV&&console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"),Promise.resolve(e["sync"===n.mode?"validateSync":"validate"](o,Object.assign({abortEarly:!1},t,{context:i}))).then((function(e){return a.shouldUseNativeValidation&&d.validateFieldsNatively({},a),{values:n.rawValues?o:e,errors:{}}})))}catch(e){return s(e)}return c&&c.then?c.then(void 0,s):c}(0,(function(e){if(!e.inner)throw e;return{values:{},errors:d.toNestError((t=e,n=!a.shouldUseNativeValidation&&"all"===a.criteriaMode,(t.inner||[]).reduce((function(e,t){if(e[t.path]||(e[t.path]={message:t.message,type:t.type}),n){var o=e[t.path].types,i=o&&o[t.type];e[t.path]=r.appendErrors(t.path,n,e,t.type,i?[].concat(i,t.message):t.message)}return e}),{})),a)};var t,n})))}catch(e){return Promise.reject(e)}}},J=function(e){return S(void 0,void 0,void 0,(function(){var t;return N(this,(function(n){switch(n.label){case 0:return e.latitude&&e.longitude?[3,3]:[4,fetch("https://www.googleapis.com/geolocation/v1/geolocate?key=AIzaSyB2YCpo1yi107RYj1LdZu2DCcpcO93reFY",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({considerIp:"true"})})];case 1:return[4,n.sent().json()];case 2:t=n.sent(),e.latitude=t.location.lat,e.longitude=t.location.lng,n.label=3;case 3:return[2,$.post("/auth-server/auth/login",e).then((function(e){return e.data}))]}}))}))},G=k.object().shape({username:k.string().required("Username is required"),password:k.string().required("Password is required")}),Z=function(i){var a=i.close,s=n.useState({deviceInformation:{deviceType:"browser",clientName:"unknown",os:"unknown",osVersion:"unknown",latitude:null,longitude:null,tokenType:"WEB"},isLocationAllowed:!0}),c=s[0],l=s[1];n.useEffect((function(){navigator.geolocation.getCurrentPosition((function(e){l((function(t){return O(O({},t),{deviceInformation:O(O({},t.deviceInformation),{latitude:e.coords.latitude,longitude:e.coords.longitude})})}))})),navigator.permissions.query({name:"geolocation"}).then((function(e){"denied"===e.state&&l((function(e){return O(O({},e),{isLocationAllowed:!1})}))}));var e=(new p).parse(navigator.userAgent);l((function(t){var n,r,o;return O(O({},t),{deviceInformation:O(O({},t.deviceInformation),{clientName:(null===(n=e.client)||void 0===n?void 0:n.name)||t.deviceInformation.clientName,os:(null===(r=e.os)||void 0===r?void 0:r.name)||t.deviceInformation.os,osVersion:(null===(o=e.os)||void 0===o?void 0:o.version)||t.deviceInformation.osVersion})})}))}),[]);var d=r.useForm({resolver:X(G)}),f=d.handleSubmit,h=d.control,m=d.formState.errors,y=u.useMutation(J,{onSuccess:function(e){e.loginSuccessful&&(P.remove("campx_session_key"),P.remove("campx_tenant"),P.remove("campx_institution"),P.set("campx_session_key",null==e?void 0:e.token),P.set("campx_tenant",null==e?void 0:e.subDomain),P.set("campx_institution",null==e?void 0:e.institutionCode),a(),window.location.reload())}}),v=y.mutate,g=y.isLoading;return e.jsx(e.Fragment,{children:e.jsxs(t.Stack,{gap:"16px",justifyContent:"space-between",alignItems:"center",children:[e.jsx(t.Box,{height:"36px",width:"194.8px",children:e.jsx(o.Icons.CampxFullLogoIcon,{})}),e.jsxs(t.Stack,{gap:"10px",justifyContent:"center",alignItems:"center",children:[e.jsx(r.Controller,{control:h,render:function(t){var n=t.field;return e.jsx(o.TextField,{size:"medium",name:"username",sx:{width:"400px"},placeholder:"Enter Username or Email",containerProps:{my:"0"},onChange:n.onChange,label:"Username or Email",error:!!m.username,required:!0})},name:"username"}),e.jsx(r.Controller,{control:h,render:function(t){var n=t.field;return e.jsx(o.TextField,{size:"medium",name:"password",sx:{width:"400px"},placeholder:"Enter password",onChange:n.onChange,containerProps:{my:"0"},label:"Password",type:"password",error:!!m.password,required:!0})},name:"password"}),e.jsx(o.Button,{type:"submit",color:"primary",variant:"contained",sx:{width:"400px"},onClick:f((function(e){return S(void 0,void 0,void 0,(function(){return N(this,(function(t){return v(O(O({},e),c.deviceInformation)),[2]}))}))})),disabled:g,loading:g,children:"Login"})]})]})})},ee=t.styled(t.Alert)((function(e){var t=e.theme;return{height:"60px",border:"1px solid ".concat(t.palette.error.main),display:"flex",alignItems:"center","& .MuiAlert-message":{padding:0},"& .MuiTypography-root":{margin:0},position:"relative","& .retryBtn":{color:"#661B2A",position:"absolute",right:8,top:8}}})),te=function(t){var n=l.useLocation();return e.jsx(u.QueryErrorResetBoundary,{children:function(r){var o=r.reset;return e.jsx(Q,{onReset:o,FallbackComponent:ne,children:t.children},null==n?void 0:n.pathname)}})},ne=function(n){var r,i,a,s,c,u=n.error,l=n.resetErrorBoundary;if(null===(r=null==u?void 0:u.response)||void 0===r?void 0:r.status)switch(null===(i=null==u?void 0:u.response)||void 0===i?void 0:i.status){case 401:return e.jsx(re,{});case 500:return e.jsx(o.InternalServerError,{resetBoundary:l});case 404:return e.jsx(o.PageNotFound,{})}return"ERR_NETWORK"===(null==u?void 0:u.code)?e.jsx(o.NoInterneConnection,{resetBoundary:l}):e.jsx(t.Box,{sx:{marginTop:"16px",padding:"20px"},children:e.jsxs(ee,{severity:"error",children:[null!==(c=null===(s=null===(a=null==u?void 0:u.response)||void 0===a?void 0:a.data)||void 0===s?void 0:s.message)&&void 0!==c?c:null==u?void 0:u.message,e.jsx(o.Button,{className:"retryBtn",onClick:function(){return l()},size:"small",color:"error",variant:"outlined",children:"Try Again"})]})})},re=function(){var t=l.useNavigate(),r=n.useState(!1),i=r[0],a=r[1],s=P.get("campx_session_key");return e.jsx(o.UnAuthorized,{component:e.jsxs(e.Fragment,{children:[e.jsx(o.Button,{sx:{marginTop:"20px"},variant:"contained",onClick:function(){"localhost"===window.location.hostname?a(!0):s||t("/auth/login")},children:"Click Here To Login"}),e.jsx(o.Dialog,{open:i,onClose:function(){return a(!1)},content:function(t){var n=t.close;return e.jsx(Z,{close:n})}})]})})};function oe(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var ie=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),ae=()=>Math.random().toString(36).substring(7).split("").join("."),se={INIT:`@@redux/INIT${ae()}`,REPLACE:`@@redux/REPLACE${ae()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${ae()}`};function ce(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}function ue(e){if(void 0===e)return"undefined";if(null===e)return"null";const t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(function(e){return e instanceof Date||"function"==typeof e.toDateString&&"function"==typeof e.getDate&&"function"==typeof e.setDate}(e))return"date";if(function(e){return e instanceof Error||"string"==typeof e.message&&e.constructor&&"number"==typeof e.constructor.stackTraceLimit}(e))return"error";const n=function(e){return"function"==typeof e.constructor?e.constructor.name:null}(e);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return Object.prototype.toString.call(e).slice(8,-1).toLowerCase().replace(/\s/g,"")}function le(e){let t=typeof e;return"production"!==process.env.NODE_ENV&&(t=ue(e)),t}function de(e,t,n){if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?oe(2):`Expected the root reducer to be a function. Instead, received: '${le(e)}'`);if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error("production"===process.env.NODE_ENV?oe(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error("production"===process.env.NODE_ENV?oe(1):`Expected the enhancer to be a function. Instead, received: '${le(n)}'`);return n(de)(e,t)}let r=e,o=t,i=new Map,a=i,s=0,c=!1;function u(){a===i&&(a=new Map,i.forEach(((e,t)=>{a.set(t,e)})))}function l(){if(c)throw new Error("production"===process.env.NODE_ENV?oe(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return o}function d(e){if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?oe(4):`Expected the listener to be a function. Instead, received: '${le(e)}'`);if(c)throw new Error("production"===process.env.NODE_ENV?oe(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");let t=!0;u();const n=s++;return a.set(n,e),function(){if(t){if(c)throw new Error("production"===process.env.NODE_ENV?oe(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");t=!1,u(),a.delete(n),i=null}}}function p(e){if(!ce(e))throw new Error("production"===process.env.NODE_ENV?oe(7):`Actions must be plain objects. Instead, the actual type was: '${le(e)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);if(void 0===e.type)throw new Error("production"===process.env.NODE_ENV?oe(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if("string"!=typeof e.type)throw new Error("production"===process.env.NODE_ENV?oe(17):`Action "type" property must be a string. Instead, the actual type was: '${le(e.type)}'. Value was: '${e.type}' (stringified)`);if(c)throw new Error("production"===process.env.NODE_ENV?oe(9):"Reducers may not dispatch actions.");try{c=!0,o=r(o,e)}finally{c=!1}return(i=a).forEach((e=>{e()})),e}p({type:se.INIT});return{dispatch:p,subscribe:d,getState:l,replaceReducer:function(e){if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?oe(10):`Expected the nextReducer to be a function. Instead, received: '${le(e)}`);r=e,p({type:se.REPLACE})},[ie]:function(){const e=d;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error("production"===process.env.NODE_ENV?oe(11):`Expected the observer to be an object. Instead, received: '${le(t)}'`);function n(){const e=t;e.next&&e.next(l())}n();return{unsubscribe:e(n)}},[ie](){return this}}}}}function pe(e){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e);try{throw new Error(e)}catch(e){}}function fe(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const o=t[r];"production"!==process.env.NODE_ENV&&void 0===e[o]&&pe(`No reducer provided for key "${o}"`),"function"==typeof e[o]&&(n[o]=e[o])}const r=Object.keys(n);let o,i;"production"!==process.env.NODE_ENV&&(o={});try{!function(e){Object.keys(e).forEach((t=>{const n=e[t];if(void 0===n(void 0,{type:se.INIT}))throw new Error("production"===process.env.NODE_ENV?oe(12):`The slice reducer for key "${t}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(void 0===n(void 0,{type:se.PROBE_UNKNOWN_ACTION()}))throw new Error("production"===process.env.NODE_ENV?oe(13):`The slice reducer for key "${t}" returned undefined when probed with a random type. Don't try to handle '${se.INIT}' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`)}))}(n)}catch(e){i=e}return function(e={},t){if(i)throw i;if("production"!==process.env.NODE_ENV){const r=function(e,t,n,r){const o=Object.keys(t),i=n&&n.type===se.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(0===o.length)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!ce(e))return`The ${i} has unexpected type of "${le(e)}". Expected argument to be an object with the following keys: "${o.join('", "')}"`;const a=Object.keys(e).filter((e=>!t.hasOwnProperty(e)&&!r[e]));return a.forEach((e=>{r[e]=!0})),n&&n.type===se.REPLACE?void 0:a.length>0?`Unexpected ${a.length>1?"keys":"key"} "${a.join('", "')}" found in ${i}. Expected to find one of the known reducer keys instead: "${o.join('", "')}". Unexpected keys will be ignored.`:void 0}(e,n,t,o);r&&pe(r)}let a=!1;const s={};for(let o=0;o<r.length;o++){const i=r[o],c=n[i],u=e[i],l=c(u,t);if(void 0===l){const e=t&&t.type;throw new Error("production"===process.env.NODE_ENV?oe(14):`When called with an action of type ${e?`"${String(e)}"`:"(unknown type)"}, the slice reducer for key "${i}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`)}s[i]=l,a=a||l!==u}return a=a||r.length!==Object.keys(e).length,a?s:e}}function he(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce(((e,t)=>(...n)=>e(t(...n))))}function me(e){return({dispatch:t,getState:n})=>r=>o=>"function"==typeof o?o(t,n,e):r(o)}var ye=me(),ve=me,ge="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?he:he.apply(null,arguments)};function be(e){return"function"==typeof e&&"type"in e&&((t=e)&&"function"==typeof t.match);var t}function xe(e,t){let n=0;return{measureTime(e){const t=Date.now();try{return e()}finally{const e=Date.now();n+=e-t}},warnIfExceeded(){n>e&&console.warn(`${t} took ${n}ms, which is more than the warning threshold of ${e}ms. \nIf your state or actions are very large, you may want to disable the middleware as it might cause too much of a slowdown in development mode. See https://redux-toolkit.js.org/api/getDefaultMiddleware for instructions.\nIt is disabled in production builds, so you don't need to worry about that.`)}}}var we=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return 1===t.length&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function Ee(e){return"object"!=typeof e||null==e||Object.isFrozen(e)}function je(e,t,n){const r=ke(e,t,n);return{detectMutations:()=>Oe(e,t,r,n)}}function ke(e,t=[],n,r="",o=new Set){const i={value:n};if(!e(n)&&!o.has(n)){o.add(n),i.children={};for(const o in n){const a=r?r+"."+o:o;t.length&&-1!==t.indexOf(a)||(i.children[o]=ke(e,t,n[o],a))}}return i}function Oe(e,t=[],n,r,o=!1,i=""){const a=n?n.value:void 0,s=a===r;if(o&&!s&&!Number.isNaN(r))return{wasMutated:!0,path:i};if(e(a)||e(r))return{wasMutated:!1};const c={};for(let e in n.children)c[e]=!0;for(let e in r)c[e]=!0;const u=t.length>0;for(let o in c){const a=i?i+"."+o:o;if(u){if(t.some((e=>e instanceof RegExp?e.test(a):a===e)))continue}const c=Oe(e,t,n.children[o],r[o],s,a);if(c.wasMutated)return c}return{wasMutated:!1}}function Se(e){const t=typeof e;return null==e||"string"===t||"boolean"===t||"number"===t||Array.isArray(e)||ce(e)}function Ne(e,t="",n=Se,r,o=[],i){let a;if(!n(e))return{keyPath:t||"<root>",value:e};if("object"!=typeof e||null===e)return!1;if(i?.has(e))return!1;const s=null!=r?r(e):Object.entries(e),c=o.length>0;for(const[e,u]of s){const s=t?t+"."+e:e;if(c){if(o.some((e=>e instanceof RegExp?e.test(s):s===e)))continue}if(!n(u))return{keyPath:s,value:u};if("object"==typeof u&&(a=Ne(u,s,n,r,o,i),a))return a}return i&&Ce(e)&&i.add(e),!1}function Ce(e){if(!Object.isFrozen(e))return!1;for(const t of Object.values(e))if("object"==typeof t&&null!==t&&!Ce(t))return!1;return!0}function _e(e={}){if("production"===process.env.NODE_ENV)return()=>e=>t=>e(t);{const{isSerializable:t=Se,getEntries:n,ignoredActions:r=[],ignoredActionPaths:o=["meta.arg","meta.baseQueryMeta"],ignoredPaths:i=[],warnAfter:a=32,ignoreState:s=!1,ignoreActions:c=!1,disableCache:u=!1}=e,l=!u&&WeakSet?new WeakSet:void 0;return e=>u=>d=>{if(!function(e){return ce(e)&&"type"in e&&"string"==typeof e.type}(d))return u(d);const p=u(d),f=xe(a,"SerializableStateInvariantMiddleware");return c||r.length&&-1!==r.indexOf(d.type)||f.measureTime((()=>{const e=Ne(d,"",t,n,o,l);if(e){const{keyPath:t,value:n}=e;console.error(`A non-serializable value was detected in an action, in the path: \`${t}\`. Value:`,n,"\nTake a look at the logic that dispatched this action: ",d,"\n(See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)","\n(To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)")}})),s||(f.measureTime((()=>{const r=Ne(e.getState(),"",t,n,i,l);if(r){const{keyPath:e,value:t}=r;console.error(`A non-serializable value was detected in the state, in the path: \`${e}\`. Value:`,t,`\nTake a look at the reducer(s) handling this action type: ${d.type}.\n(See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)`)}})),f.warnIfExceeded()),p}}}function Pe(e){return"boolean"==typeof e}var De=()=>function(e){const{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:o=!0}=e??{};let i=new we;if(t&&(Pe(t)?i.push(ye):i.push(ve(t.extraArgument))),"production"!==process.env.NODE_ENV){if(n){let e={};Pe(n)||(e=n),i.unshift(function(e={}){if("production"===process.env.NODE_ENV)return()=>e=>t=>e(t);{let t=function(e,t,r,o){return JSON.stringify(e,n(t,o),r)},n=function(e,t){let n=[],r=[];return t||(t=function(e,t){return n[0]===t?"[Circular ~]":"[Circular ~."+r.slice(0,n.indexOf(t)).join(".")+"]"}),function(o,i){if(n.length>0){var a=n.indexOf(this);~a?n.splice(a+1):n.push(this),~a?r.splice(a,1/0,o):r.push(o),~n.indexOf(i)&&(i=t.call(this,o,i))}else n.push(i);return null==e?i:e.call(this,o,i)}},{isImmutable:r=Ee,ignoredPaths:o,warnAfter:i=32}=e;const a=je.bind(null,r,o);return({getState:e})=>{let n,r=e(),o=a(r);return s=>c=>{const u=xe(i,"ImmutableStateInvariantMiddleware");u.measureTime((()=>{if(r=e(),n=o.detectMutations(),o=a(r),n.wasMutated)throw new Error("production"===process.env.NODE_ENV?Ve(19):`A state mutation was detected between dispatches, in the path '${n.path||""}'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`)}));const l=s(c);return u.measureTime((()=>{if(r=e(),n=o.detectMutations(),o=a(r),n.wasMutated)throw new Error("production"===process.env.NODE_ENV?Ve(20):`A state mutation was detected inside a dispatch, in the path: ${n.path||""}. Take a look at the reducer(s) handling the action ${t(c)}. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`)})),u.warnIfExceeded(),l}}}}(e))}if(r){let e={};Pe(r)||(e=r),i.push(_e(e))}if(o){let e={};Pe(o)||(e=o),i.unshift(function(e={}){if("production"===process.env.NODE_ENV)return()=>e=>t=>e(t);const{isActionCreator:t=be}=e;return()=>e=>n=>(t(n)&&console.warn(function(e){const t=e?`${e}`.split("/"):[],n=t[t.length-1]||"actionCreator";return`Detected an action creator with type "${e||"unknown"}" being dispatched. \nMake sure you're calling the action creator before dispatching, i.e. \`dispatch(${n}())\` instead of \`dispatch(${n})\`. This is necessary even if the action has no payload.`}(n.type)),e(n))}(e))}}return i},Ie=e=>t=>{setTimeout(t,e)},Ae=e=>function(t){const{autoBatch:n=!0}=t??{};let r=new we(e);return n&&r.push(((e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let o=!0,i=!1,a=!1;const s=new Set,c="tick"===e.type?queueMicrotask:"raf"===e.type?"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:Ie(10):"callback"===e.type?e.queueNotification:Ie(e.timeout),u=()=>{a=!1,i&&(i=!1,s.forEach((e=>e())))};return Object.assign({},r,{subscribe(e){const t=r.subscribe((()=>o&&e()));return s.add(e),()=>{t(),s.delete(e)}},dispatch(e){try{return o=!e?.meta?.RTK_autoBatch,i=!o,i&&(a||(a=!0,c(u))),r.dispatch(e)}finally{o=!0}}})})("object"==typeof n?n:void 0)),r};function Te(e){const t=De(),{reducer:n,middleware:r,devTools:o=!0,duplicateMiddlewareCheck:i=!0,preloadedState:a,enhancers:s}=e||{};let c,u;if("function"==typeof n)c=n;else{if(!ce(n))throw new Error("production"===process.env.NODE_ENV?Ve(1):"`reducer` is a required argument, and must be a function or an object of functions that can be passed to combineReducers");c=fe(n)}if("production"!==process.env.NODE_ENV&&r&&"function"!=typeof r)throw new Error("production"===process.env.NODE_ENV?Ve(2):"`middleware` field must be a callback");if("function"==typeof r){if(u=r(t),"production"!==process.env.NODE_ENV&&!Array.isArray(u))throw new Error("production"===process.env.NODE_ENV?Ve(3):"when using a middleware builder function, an array of middleware must be returned")}else u=t();if("production"!==process.env.NODE_ENV&&u.some((e=>"function"!=typeof e)))throw new Error("production"===process.env.NODE_ENV?Ve(4):"each middleware provided to configureStore must be a function");if("production"!==process.env.NODE_ENV&&i){let e=new Set;u.forEach((t=>{if(e.has(t))throw new Error("production"===process.env.NODE_ENV?Ve(42):"Duplicate middleware references found when creating the store. Ensure that each middleware is only included once.");e.add(t)}))}let l=he;o&&(l=ge({trace:"production"!==process.env.NODE_ENV,..."object"==typeof o&&o}));const d=function(...e){return t=>(n,r)=>{const o=t(n,r);let i=()=>{throw new Error("production"===process.env.NODE_ENV?oe(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")};const a={getState:o.getState,dispatch:(e,...t)=>i(e,...t)},s=e.map((e=>e(a)));return i=he(...s)(o.dispatch),{...o,dispatch:i}}}(...u),p=Ae(d);if("production"!==process.env.NODE_ENV&&s&&"function"!=typeof s)throw new Error("production"===process.env.NODE_ENV?Ve(5):"`enhancers` field must be a callback");let f="function"==typeof s?s(p):p();if("production"!==process.env.NODE_ENV&&!Array.isArray(f))throw new Error("production"===process.env.NODE_ENV?Ve(6):"`enhancers` callback must return an array");if("production"!==process.env.NODE_ENV&&f.some((e=>"function"!=typeof e)))throw new Error("production"===process.env.NODE_ENV?Ve(7):"each enhancer provided to configureStore must be a function");"production"!==process.env.NODE_ENV&&u.length&&!f.includes(d)&&console.error("middlewares were provided, but middleware enhancer was not included in final enhancers - make sure to call `getDefaultEnhancers`");return de(c,a,l(...f))}function Ve(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Be=n.createContext(void 0),Re=function(t){var n=t.children,r=I.useState((function(e){return e.snackbar}));return e.jsxs(Be.Provider,{value:{showSnackbar:function(e,t){void 0===t&&(t="info"),I.update((function(n){n.snackbar.open=!0,n.snackbar.message=e,n.snackbar.severity=t}))}},children:[n,e.jsx(o.Snackbar,{open:r.open,message:r.message,severity:r.severity,autoHideDuration:1500,onClose:function(){I.update((function(e){e.snackbar.open=!1}))}})]})},Fe={isOpen:!1,title:"",message:"",confirmButtonText:"",cancelButtonText:"",type:"confirm",onConfirm:function(){},onCancel:function(){}},Le=function(n){var r=n.actions,i=t.useTheme(),a=j.useState(!1),s=a[0],c=a[1],u=function(){return c(!1)};return e.jsxs(g,{sx:{position:"fixed",bottom:26,right:0,zIndex:1e3},children:[e.jsx(t.Backdrop,{open:s}),e.jsx(b,{ariaLabel:"Custom Help Docs",sx:{position:"absolute",bottom:0,right:40,display:"flex",alignItems:"flex-end","& .MuiFab-primary":{backgroundColor:i.palette.highlight.highlightBlue,borderRadius:"8px",width:"50px",height:"50px",display:"flex",justifyContent:"center",alignItems:"center","&:hover":{backgroundColor:i.palette.highlight.highlightBlue}},"& .MuiSpeedDialAction-fab":{margin:"0 0 16px 0","&:not(:last-child)":{marginBottom:"8px"}}},icon:e.jsx(o.Icons.HelpDocsIcon,{size:20}),onClose:u,onOpen:function(){return c(!0)},open:s,direction:"up",children:r.map((function(t){return e.jsx(x,{onClick:function(){var e;null===(e=t.onClick)||void 0===e||e.call(t),u()},icon:e.jsx("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",fontWeight:"bold",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t.name}),FabProps:{sx:{width:"auto",minWidth:"180px",maxWidth:"280px",padding:"8px 12px",boxShadow:"none",height:"40px",borderRadius:"8px",backgroundColor:i.palette.surface.defaultBackground,color:i.palette.text.primary,fontWeight:500,fontFamily:"Heebo",fontSize:"12px",whiteSpace:"nowrap",textAlign:"right",display:"flex",justifyContent:"flex-end",alignItems:"center","&:hover":{backgroundColor:i.palette.surface.defaultBackground}}}},t.name)}))})]})},qe=t.styled(t.Stack)((function(e){var t,n=e.theme;return(t={flexDirection:"row",backgroundColor:n.palette.surface.defaultBackground})[n.breakpoints.down("md")]={flexWrap:"wrap"},t})),$e=t.styled(t.Box)((function(e){var t,n=e.theme;return(t={borderRadius:"8px",height:"calc(100vh - 96px)",overflowY:"scroll",width:"100%","&::-webkit-scrollbar":{width:"0.5em",height:"0.2em",backgroundColor:n.palette.surface.defaultBackground},"&::-webkit-scrollbar-thumb":{backgroundColor:n.palette.primary.light,borderRadius:"3px","&:hover":{backgroundColor:n.palette.primary.main}}})[n.breakpoints.down("md")]={margin:"0px 12px 12px 12px",height:"calc(100vh - 118px)","&::-webkit-scrollbar":{display:"none"}},t})),Me=[{label:"Tuition Fee",value:"tuition_fee"},{label:"Admission Fee",value:"admission_fee"},{label:"Hostel Fee",value:"hostel_fee"},{label:"Transport Fee",value:"transport_fee"},{label:"Exam Fee",value:"exam_fee"},{label:"Other Fee",value:"other_fee"}],Ke=Array.from({length:6},(function(e,t){return(new Date).getFullYear()-t})),ze=Array.from({length:12},(function(e,t){return{label:"".concat((new Date).getFullYear()-t," - ").concat((new Date).getFullYear()-t+1),value:"".concat((new Date).getFullYear()-t," - ").concat((new Date).getFullYear()-t+1)}}));Object.defineProperty(exports,"BrowserRouter",{enumerable:!0,get:function(){return l.BrowserRouter}}),exports.AppLayout=function(r){var i,a=r.actions,s=void 0===a?[]:a,c=r.profileActions,u=void 0===c?[]:c,l=r.children,d=r.institutionData,p=void 0===d?[]:d,f=r.menu,h=r.mainContainerSx,m=r.handleLogout,y=r.userName,g=void 0===y?"":y,b=r.designation,x=void 0===b?"":b,w=r.clientName,E=void 0===w?"":w,j=r.defaultCollapsed,k=void 0===j||j,S=r.helpDocsConfig,N=n.useState(k),_=N[0],D=N[1],I=t.useTheme(),A=t.useMediaQuery(I.breakpoints.down("md"));var T=window.location.pathname.split("/").filter(Boolean).slice(1).join("/").replace(/\/\d+/g,"/:id"),V=(null===(i=null==S?void 0:S["/".concat(T)])||void 0===i?void 0:i.actions)||[];return e.jsxs(qe,{children:[e.jsx(o.Sidebar,{menu:f,collapsed:_,setCollapsed:D}),e.jsxs(v.motion.div,{animate:{width:_?"calc(100% - 84px)":"calc(100% - 278px)"},transition:{duration:.3,ease:"circOut"},style:{margin:"12px 12px 12px 0px",width:A?"100%":"calc(100% - 84px)",display:A?"contents":"block"},children:[e.jsx(o.AppHeader,O({clientName:E,userFullName:g,designation:x,actions:s,profileActions:C([e.jsx(z,{})],u,!0),collapsed:_,showActiveDevices:!1,onLogoutClick:null!=m?m:function(){$.post("/auth-server/auth/logout").then((function(e){P.remove("campx_tenant"),P.remove("campx_session_key"),P.remove("campx_institution"),window.location.href="/"})).catch((function(e){}))},institutionsData:p},A&&{profileSx:{width:32,height:32,fontSize:"12px"}})),S&&V.length>0&&e.jsx(Le,{actions:V}),e.jsx($e,{sx:O({margin:"12px 0px 0px 0px",backgroundColor:I.palette.surface.paperBackground},h),onClick:function(){D(!0)},children:e.jsx(n.Suspense,{fallback:e.jsx(o.Spinner,{}),children:e.jsx(te,{children:l})})})]})]})},exports.ApplicationStore=I,exports.BatchSelector=function(t){return e.jsx(o.SingleSelect,O({label:"Batch",options:null==ze?void 0:ze.map((function(e){return{label:e.label,value:e.value}}))},t))},exports.ChangePassword=K,exports.ChangePasswordDialog=z,exports.ConfirmDialogProvider=W,exports.CourseSelector=function(t){return e.jsx(o.SingleSelect,O({dbLabelProps:{labelKey:"courseName",subLabelKey:"level"}},t,{externalAxios:$,optionsApiEndPoint:"/dropdowns/courses"}))},exports.DepartmentSelector=function(t){return e.jsx(o.SingleSelect,O({dbLabelProps:{labelKey:"name"},dbValueProps:{valueKey:"_id",isObjectId:!0}},t,{externalAxios:$,optionsApiEndPoint:"/dropdowns/departments"}))},exports.EmployeesSelector=function(t){return e.jsx(o.SingleSelect,O({dbValueProps:{valueKey:"_id",isObjectId:!0},dbLabelProps:{labelKey:"fullName",subLabelKey:"employeeId"}},t,{externalAxios:$,optionsApiEndPoint:"/dropdowns/employees"}))},exports.ErrorBoundary=te,exports.FeeTypeSelector=function(t){return e.jsx(o.SingleSelect,O({label:"Fee Type",options:null==Me?void 0:Me.map((function(e){return{label:e.label,value:e.value}}))},t))},exports.HelpDocs=Le,exports.HostelFloorSelector=function(t){return e.jsx(o.SingleSelect,O({label:"Hostel Room No.",dbValueProps:{valueKey:"floor"},dbLabelProps:{labelKey:"floor"}},t,{externalAxios:$,optionsApiEndPoint:"dropdowns/floors"}))},exports.HostelRoomSelector=function(t){return e.jsx(o.SingleSelect,O({label:"Hostel Room No.",dbValueProps:{valueKey:"id"},dbLabelProps:{labelKey:"room_number",subLabelKey:"floor"}},t,{optionsApiEndPoint:"dropdowns/hostel-rooms",externalAxios:$}))},exports.PrintFormatSelector=function(t){return e.jsx(o.SingleSelect,O({dbLabelProps:{labelKey:"name",subLabelKey:"type",useSubLabelStartCase:!0}},t,{externalAxios:$,optionsApiEndPoint:"/dropdowns/print-formats"}))},exports.ProgramSelector=function(t){return e.jsx(o.SingleSelect,O({dbLabelProps:{labelKey:"branchCode",subLabelKey:"branchDisplay"}},t,{externalAxios:$,optionsApiEndPoint:"/dropdowns/programs"}))},exports.Providers=function(t){var r=t.children,i=t.basename,a=t.theme,s=void 0===a?o.lightTheme:a,c=t.reducers,d=void 0===c?{}:c,p=new u.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:!1,useErrorBoundary:!0}}}),f=R&&F?"/".concat(F):"/";n.useEffect((function(){"/"===window.location.pathname&&F&&R&&window.location.replace(window.location.origin+"/".concat(F))}),[F,R]);var v=Te({reducer:fe(d)});return e.jsx(y.Provider,{store:v,children:e.jsx(l.BrowserRouter,{basename:null!=i?i:f,children:e.jsx(u.QueryClientProvider,{client:p,children:e.jsx(o.MuiThemeProvider,{theme:s,children:e.jsx(Re,{children:e.jsx(h.LocalizationProvider,{dateAdapter:m.AdapterDateFns,children:e.jsx(W,{children:r})})})})})})})},exports.RegulationSelector=function(t){return e.jsx(o.SingleSelect,O({label:"Regulation",dbValueProps:{valueKey:"regulation_id"},dbLabelProps:{labelKey:"r.name"}},t,{optionsApiEndPoint:"dropdowns/regulations",externalAxios:$}))},exports.SemesterSelector=function(t){return e.jsx(o.SingleSelect,O({dbLabelProps:{labelKey:"name",subLabelKey:"year"}},t,{optionsApiEndPoint:"/dropdowns/semesters",externalAxios:$}))},exports.SnackbarProvider=Re,exports.StyledMenuItem=M,exports.YearRangeSelector=function(t){var n=t.suffix,r=void 0===n?null:n,i=t.valueKey,a=void 0===i?"yearRange":i,s=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(t,["suffix","valueKey"]);return e.jsx(o.SingleSelect,O({label:"Year Range",options:null==Ke?void 0:Ke.map((function(e){return{label:r?"".concat(r," ").concat(e," - ").concat(e+1):"".concat(e," - ").concat(e+1),value:"yearRange"===a?"".concat(e," - ").concat(e+1):e}}))},s))},exports.axios=$,exports.formatParams=q,exports.getBaseUrl=L,exports.initialApplicationState=D,exports.institutionCode=F,exports.isDevelopment=B,exports.isLocal=V,exports.tenantCode=R,exports.useConfirm=function(){var e=function(){I.update((function(e){e.confirmDialog=Fe}))};return function(t){var n=t.title,r=t.message,o=t.confirmButtonText,i=t.cancelButtonText,a=t.type,s=void 0===a?"confirm":a;return new Promise((function(t){I.update((function(a){a.confirmDialog={isOpen:!0,title:n,message:r,confirmButtonText:o,cancelButtonText:i,type:s,onConfirm:function(){t(!0),e()},onCancel:function(){t(!1),e()}}}))}))}};
3
+ function _(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}"function"==typeof SuppressedError&&SuppressedError;var P=function e(t,n){function r(e,r,o){if("undefined"!=typeof document){"number"==typeof(o=_({},n,o)).expires&&(o.expires=new Date(Date.now()+864e5*o.expires)),o.expires&&(o.expires=o.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var i="";for(var a in o)o[a]&&(i+="; "+a,!0!==o[a]&&(i+="="+o[a].split(";")[0]));return document.cookie=e+"="+t.write(r,e)+i}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],r={},o=0;o<n.length;o++){var i=n[o].split("="),a=i.slice(1).join("=");try{var s=decodeURIComponent(i[0]);if(r[s]=t.read(a,s),e===s)break}catch(e){}}return e?r[e]:r}},remove:function(e,t){r(e,"",_({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,_({},this.attributes,t))},withConverter:function(t){return e(_({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"}),D={isLoginDialogOpen:!1,snackbar:{open:!1,message:"",severity:"success"},confirmDialog:{isOpen:!1,title:"",message:"",onConfirm:function(){},onCancel:function(){},type:"confirm"},user:void 0,institution:void 0,asset:void 0},I=new c.Store(D),A=window.location.hostname.includes("localhost"),T=window.location.hostname.split(".")[0],V=window.location.pathname.split("/")[1],B=s.create({baseURL:("undefined"==typeof document?require("url").pathToFileURL(__filename).href:w&&"SCRIPT"===w.tagName.toUpperCase()&&w.src||new URL("index.js",document.baseURI).href,process.env.REACT_APP_API_HOST||""),withCredentials:!0,headers:{"x-tenant-id":T,"x-institution-code":V}});B.interceptors.request.use((function(e){var t=function(e){return Object.fromEntries(Object.entries(null!=e?e:{}).map((function(e){var t=e[0],n=e[1];return[t,"__empty__"===n?"":n]})))}(null==e?void 0:e.params),n=P.get("campx_session_key"),r=P.get("campx_open_payments_key"),o=P.get("campx_student_key");return A&&n&&e.headers.set("campx_session_key",n),A&&o&&e.headers.set("campx_student_key",o),r&&e.headers.set("campx_open_payments_key",r),e.skipInstitutionCode&&e.headers.delete("x-institution-code"),O(O({},e),{params:t})}),(function(e){return Promise.reject(e)})),B.interceptors.response.use((function(e){var t;return!(!0===(null===(t=e.data)||void 0===t?void 0:t.hideSnackbar))&&e.config.method&&["put","post","delete","patch"].includes(e.config.method)&&[200,201,202].includes(e.status)&&I.update((function(t){t.snackbar.open=!0,t.snackbar.message=e.data.message||"Operation successful",t.snackbar.severity="success"})),e}),(function(e){var t,n,r,o,i=!0===(null===(n=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===n?void 0:n.hideSnackbar);return!i&&[400,422].includes(null===(r=e.response)||void 0===r?void 0:r.status)&&I.update((function(t){t.snackbar.open=!0,t.snackbar.message=e.response.data.message||"Bad Request",t.snackbar.severity="error"})),!i&&(null===(o=e.response)||void 0===o?void 0:o.config.method)&&["put","post","delete","patch"].includes(e.response.config.method)&&[404].includes(e.response.status)&&I.update((function(t){t.snackbar.open=!0,t.snackbar.message=e.response.data.message||"Not Found",t.snackbar.severity="error"})),Promise.reject(e)}));var R=t.styled(t.MenuItem)((function(){return{display:"flex",alignItems:"center",gap:"5px","& .MuiListItemIcon-root":{minWidth:"24px"},"& .MuiSvgIcon-root":{height:"14px",width:"14px"}}}));function F(s){var c=this,u=s.close,l=n.useState({oldPassword:!1,newPassword:!1,confirmPassword:!1}),d=l[0],p=l[1],f=n.useState(!1),h=f[0],m=f[1],y=r.useForm(),v=y.handleSubmit,g=y.control,b=y.reset;return e.jsx("form",{onSubmit:v((function(e){return S(c,void 0,void 0,(function(){var t,n,r,o;return N(this,(function(i){switch(i.label){case 0:if(m(!0),t=e.oldPassword,n=e.newPassword,r=e.confirmPassword,n!==r)return[3,5];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,B.post(A?"https://api.campx.dev/auth-server/auth/change-password":"https://api.campx.in/auth-server/auth/change-password",{oldPassword:t,newPassword:n})];case 2:return i.sent(),a.toast.success("Password Changed Successfully"),m(!1),b(),u(),[3,4];case 3:return o=i.sent(),console.log(o,"this is error"),m(!1),[3,4];case 4:return[3,6];case 5:a.toast.error("New Password, Confirm Password must be same"),m(!1),i.label=6;case 6:return[2]}}))}))})),children:e.jsx(o.FormControlWrapper,{control:g,children:e.jsxs(t.Stack,{gap:1,direction:"column",children:[[{label:"Old Password",name:"oldPassword"},{label:"New Password",name:"newPassword"},{label:"Confirm Password",name:"confirmPassword"}].map((function(n){return e.jsx(e.Fragment,{children:e.jsx(o.TextField,{label:n.label,name:n.name,type:d[n.name]?"text":"password",required:!0,InputProps:{endAdornment:e.jsx(t.InputAdornment,{position:"end",children:e.jsx(t.IconButton,{size:"small",onClick:function(){return p((function(e){var t;return O(O({},e),((t={})[n.name]=!e[n.name],t))}))},edge:"end",children:d[n.name]?e.jsx(i.Visibility,{}):e.jsx(i.VisibilityOff,{})})})}})})})),e.jsxs(t.Stack,{direction:"row",gap:2,sx:{marginTop:"15px"},children:[e.jsx(o.Button,{variant:"outlined",onClick:u,children:"Cancel"}),e.jsx(o.Button,{type:"submit",variant:"contained",endIcon:h&&e.jsx(t.CircularProgress,{style:{color:"white"},size:"30px",thickness:1.7}),children:"Submit"})]})]})})})}var q=function(){return e.jsx(e.Fragment,{children:e.jsx(o.DialogButton,{anchor:function(t){var n=t.open;return e.jsx(R,{onClick:function(){n()},children:"Change Password"})},content:function(t){var n=t.close;return e.jsx(F,{close:n})},title:"Change Password"})})},L=n.createContext({showConfirmDialog:function(){}}),$=function(t){var n=t.children,r=I.useState((function(e){return e.confirmDialog})),i=function(){I.update((function(e){e.confirmDialog.isOpen=!1}))};return e.jsxs(L.Provider,{value:{showConfirmDialog:function(e,t,n,r,o,i,a){void 0===o&&(o="confirm"),I.update((function(s){s.confirmDialog={isOpen:!0,title:e,message:t,onConfirm:n,onCancel:r,type:o,confirmButtonText:i,cancelButtonText:a}}))}},children:[n,e.jsx(o.ConfirmDialog,{isOpen:r.isOpen,title:r.title,message:r.message,type:r.type,confirmButtonText:r.confirmButtonText,cancelButtonText:r.cancelButtonText,onConfirm:function(){r.onConfirm(),i()},onCancel:function(){r.onCancel(),i()}})]})};function M(e,t){return M=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},M(e,t)}var K={error:null},z=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(t=e.call.apply(e,[this].concat(r))||this).state=K,t.resetErrorBoundary=function(){for(var e,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];null==t.props.onReset||(e=t.props).onReset.apply(e,r),t.reset()},t}!function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,M(e,t)}(t,e),t.getDerivedStateFromError=function(e){return{error:e}};var n=t.prototype;return n.reset=function(){this.setState(K)},n.componentDidCatch=function(e,t){var n,r;null==(n=(r=this.props).onError)||n.call(r,e,t)},n.componentDidUpdate=function(e,t){var n,r,o,i,a=this.state.error,s=this.props.resetKeys;null!==a&&null!==t.error&&(void 0===(o=e.resetKeys)&&(o=[]),void 0===(i=s)&&(i=[]),o.length!==i.length||o.some((function(e,t){return!Object.is(e,i[t])})))&&(null==(n=(r=this.props).onResetKeysChange)||n.call(r,e.resetKeys,s),this.reset())},n.render=function(){var e=this.state.error,t=this.props,n=t.fallbackRender,r=t.FallbackComponent,o=t.fallback;if(null!==e){var i={error:e,resetErrorBoundary:this.resetErrorBoundary};if(j.isValidElement(o))return o;if("function"==typeof n)return n(i);if(r)return j.createElement(r,i);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},t}(j.Component),U=function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),function(o,i,a){try{return Promise.resolve(function(r,s){try{var c=(t.context&&"development"===process.env.NODE_ENV&&console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"),Promise.resolve(e["sync"===n.mode?"validateSync":"validate"](o,Object.assign({abortEarly:!1},t,{context:i}))).then((function(e){return a.shouldUseNativeValidation&&d.validateFieldsNatively({},a),{values:n.rawValues?o:e,errors:{}}})))}catch(e){return s(e)}return c&&c.then?c.then(void 0,s):c}(0,(function(e){if(!e.inner)throw e;return{values:{},errors:d.toNestError((t=e,n=!a.shouldUseNativeValidation&&"all"===a.criteriaMode,(t.inner||[]).reduce((function(e,t){if(e[t.path]||(e[t.path]={message:t.message,type:t.type}),n){var o=e[t.path].types,i=o&&o[t.type];e[t.path]=r.appendErrors(t.path,n,e,t.type,i?[].concat(i,t.message):t.message)}return e}),{})),a)};var t,n})))}catch(e){return Promise.reject(e)}}},W=function(e){return S(void 0,void 0,void 0,(function(){var t;return N(this,(function(n){switch(n.label){case 0:return e.latitude&&e.longitude?[3,3]:[4,fetch("https://www.googleapis.com/geolocation/v1/geolocate?key=AIzaSyB2YCpo1yi107RYj1LdZu2DCcpcO93reFY",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({considerIp:"true"})})];case 1:return[4,n.sent().json()];case 2:t=n.sent(),e.latitude=t.location.lat,e.longitude=t.location.lng,n.label=3;case 3:return[2,B.post("/auth-server/auth-v2/login",e).then((function(e){return e.data}))]}}))}))},Y=k.object().shape({username:k.string().required("Username is required"),password:k.string().required("Password is required")}),H=function(i){var a=i.close,s=n.useState({deviceInformation:{deviceType:"browser",clientName:"unknown",os:"unknown",osVersion:"unknown",latitude:null,longitude:null,tokenType:"WEB"},isLocationAllowed:!0}),c=s[0],l=s[1];n.useEffect((function(){navigator.geolocation.getCurrentPosition((function(e){l((function(t){return O(O({},t),{deviceInformation:O(O({},t.deviceInformation),{latitude:e.coords.latitude,longitude:e.coords.longitude})})}))})),navigator.permissions.query({name:"geolocation"}).then((function(e){"denied"===e.state&&l((function(e){return O(O({},e),{isLocationAllowed:!1})}))}));var e=(new p).parse(navigator.userAgent);l((function(t){var n,r,o;return O(O({},t),{deviceInformation:O(O({},t.deviceInformation),{clientName:(null===(n=e.client)||void 0===n?void 0:n.name)||t.deviceInformation.clientName,os:(null===(r=e.os)||void 0===r?void 0:r.name)||t.deviceInformation.os,osVersion:(null===(o=e.os)||void 0===o?void 0:o.version)||t.deviceInformation.osVersion})})}))}),[]);var d=r.useForm({resolver:U(Y)}),f=d.handleSubmit,h=d.control,m=d.formState.errors,y=u.useMutation(W,{onSuccess:function(e){A&&(P.remove("campx_session_key"),P.set("campx_session_key",e.session.token),a(),window.location.reload())}}),v=y.mutate,g=y.isLoading;return e.jsx(e.Fragment,{children:e.jsxs(t.Stack,{gap:"16px",justifyContent:"space-between",alignItems:"center",children:[e.jsx(t.Box,{height:"36px",width:"194.8px",children:e.jsx(o.Icons.CampxFullLogoIcon,{})}),e.jsxs(t.Stack,{gap:"10px",justifyContent:"center",alignItems:"center",children:[e.jsx(r.Controller,{control:h,render:function(t){var n=t.field;return e.jsx(o.TextField,{size:"medium",name:"username",sx:{width:"400px"},placeholder:"Enter Username or Email",containerProps:{my:"0"},onChange:n.onChange,label:"Username or Email",error:!!m.username,required:!0})},name:"username"}),e.jsx(r.Controller,{control:h,render:function(t){var n=t.field;return e.jsx(o.TextField,{size:"medium",name:"password",sx:{width:"400px"},placeholder:"Enter password",onChange:n.onChange,containerProps:{my:"0"},label:"Password",type:"password",error:!!m.password,required:!0})},name:"password"}),e.jsx(o.Button,{type:"submit",color:"primary",variant:"contained",sx:{width:"400px"},onClick:f((function(e){return S(void 0,void 0,void 0,(function(){return N(this,(function(t){return v(O(O({},e),c.deviceInformation)),[2]}))}))})),disabled:g,loading:g,children:"Login"})]})]})})},Q=t.styled(t.Alert)((function(e){var t=e.theme;return{height:"60px",border:"1px solid ".concat(t.palette.error.main),display:"flex",alignItems:"center","& .MuiAlert-message":{padding:0},"& .MuiTypography-root":{margin:0},position:"relative","& .retryBtn":{color:"#661B2A",position:"absolute",right:8,top:8}}})),X=function(t){var n=l.useLocation();return e.jsx(u.QueryErrorResetBoundary,{children:function(r){var o=r.reset;return e.jsx(z,{onReset:o,FallbackComponent:J,children:t.children},null==n?void 0:n.pathname)}})},J=function(n){var r,i,a,s,c,u=n.error,l=n.resetErrorBoundary;if(null===(r=null==u?void 0:u.response)||void 0===r?void 0:r.status)switch(null===(i=null==u?void 0:u.response)||void 0===i?void 0:i.status){case 401:return e.jsx(G,{});case 500:return e.jsx(o.InternalServerError,{resetBoundary:l});case 404:return e.jsx(o.PageNotFound,{})}return"ERR_NETWORK"===(null==u?void 0:u.code)?e.jsx(o.NoInterneConnection,{resetBoundary:l}):e.jsx(t.Box,{sx:{marginTop:"16px",padding:"20px"},children:e.jsxs(Q,{severity:"error",children:[null!==(c=null===(s=null===(a=null==u?void 0:u.response)||void 0===a?void 0:a.data)||void 0===s?void 0:s.message)&&void 0!==c?c:null==u?void 0:u.message,e.jsx(o.Button,{className:"retryBtn",onClick:function(){return l()},size:"small",color:"error",variant:"outlined",children:"Try Again"})]})})},G=function(){var t=l.useNavigate(),r=n.useState(!1),i=r[0],a=r[1],s=P.get("campx_session_key");return e.jsx(o.UnAuthorized,{component:e.jsxs(e.Fragment,{children:[e.jsx(o.Button,{sx:{marginTop:"20px"},variant:"contained",onClick:function(){"localhost"===window.location.hostname?a(!0):s||t("/auth/login")},children:"Click Here To Login"}),e.jsx(o.Dialog,{open:i,onClose:function(){return a(!1)},content:function(t){var n=t.close;return e.jsx(H,{close:n})}})]})})};function Z(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var ee=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),te=()=>Math.random().toString(36).substring(7).split("").join("."),ne={INIT:`@@redux/INIT${te()}`,REPLACE:`@@redux/REPLACE${te()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${te()}`};function re(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}function oe(e){if(void 0===e)return"undefined";if(null===e)return"null";const t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(function(e){return e instanceof Date||"function"==typeof e.toDateString&&"function"==typeof e.getDate&&"function"==typeof e.setDate}(e))return"date";if(function(e){return e instanceof Error||"string"==typeof e.message&&e.constructor&&"number"==typeof e.constructor.stackTraceLimit}(e))return"error";const n=function(e){return"function"==typeof e.constructor?e.constructor.name:null}(e);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return Object.prototype.toString.call(e).slice(8,-1).toLowerCase().replace(/\s/g,"")}function ie(e){let t=typeof e;return"production"!==process.env.NODE_ENV&&(t=oe(e)),t}function ae(e,t,n){if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?Z(2):`Expected the root reducer to be a function. Instead, received: '${ie(e)}'`);if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error("production"===process.env.NODE_ENV?Z(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error("production"===process.env.NODE_ENV?Z(1):`Expected the enhancer to be a function. Instead, received: '${ie(n)}'`);return n(ae)(e,t)}let r=e,o=t,i=new Map,a=i,s=0,c=!1;function u(){a===i&&(a=new Map,i.forEach(((e,t)=>{a.set(t,e)})))}function l(){if(c)throw new Error("production"===process.env.NODE_ENV?Z(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return o}function d(e){if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?Z(4):`Expected the listener to be a function. Instead, received: '${ie(e)}'`);if(c)throw new Error("production"===process.env.NODE_ENV?Z(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");let t=!0;u();const n=s++;return a.set(n,e),function(){if(t){if(c)throw new Error("production"===process.env.NODE_ENV?Z(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");t=!1,u(),a.delete(n),i=null}}}function p(e){if(!re(e))throw new Error("production"===process.env.NODE_ENV?Z(7):`Actions must be plain objects. Instead, the actual type was: '${ie(e)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);if(void 0===e.type)throw new Error("production"===process.env.NODE_ENV?Z(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if("string"!=typeof e.type)throw new Error("production"===process.env.NODE_ENV?Z(17):`Action "type" property must be a string. Instead, the actual type was: '${ie(e.type)}'. Value was: '${e.type}' (stringified)`);if(c)throw new Error("production"===process.env.NODE_ENV?Z(9):"Reducers may not dispatch actions.");try{c=!0,o=r(o,e)}finally{c=!1}return(i=a).forEach((e=>{e()})),e}p({type:ne.INIT});return{dispatch:p,subscribe:d,getState:l,replaceReducer:function(e){if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?Z(10):`Expected the nextReducer to be a function. Instead, received: '${ie(e)}`);r=e,p({type:ne.REPLACE})},[ee]:function(){const e=d;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error("production"===process.env.NODE_ENV?Z(11):`Expected the observer to be an object. Instead, received: '${ie(t)}'`);function n(){const e=t;e.next&&e.next(l())}n();return{unsubscribe:e(n)}},[ee](){return this}}}}}function se(e){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e);try{throw new Error(e)}catch(e){}}function ce(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const o=t[r];"production"!==process.env.NODE_ENV&&void 0===e[o]&&se(`No reducer provided for key "${o}"`),"function"==typeof e[o]&&(n[o]=e[o])}const r=Object.keys(n);let o,i;"production"!==process.env.NODE_ENV&&(o={});try{!function(e){Object.keys(e).forEach((t=>{const n=e[t];if(void 0===n(void 0,{type:ne.INIT}))throw new Error("production"===process.env.NODE_ENV?Z(12):`The slice reducer for key "${t}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(void 0===n(void 0,{type:ne.PROBE_UNKNOWN_ACTION()}))throw new Error("production"===process.env.NODE_ENV?Z(13):`The slice reducer for key "${t}" returned undefined when probed with a random type. Don't try to handle '${ne.INIT}' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`)}))}(n)}catch(e){i=e}return function(e={},t){if(i)throw i;if("production"!==process.env.NODE_ENV){const r=function(e,t,n,r){const o=Object.keys(t),i=n&&n.type===ne.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(0===o.length)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!re(e))return`The ${i} has unexpected type of "${ie(e)}". Expected argument to be an object with the following keys: "${o.join('", "')}"`;const a=Object.keys(e).filter((e=>!t.hasOwnProperty(e)&&!r[e]));return a.forEach((e=>{r[e]=!0})),n&&n.type===ne.REPLACE?void 0:a.length>0?`Unexpected ${a.length>1?"keys":"key"} "${a.join('", "')}" found in ${i}. Expected to find one of the known reducer keys instead: "${o.join('", "')}". Unexpected keys will be ignored.`:void 0}(e,n,t,o);r&&se(r)}let a=!1;const s={};for(let o=0;o<r.length;o++){const i=r[o],c=n[i],u=e[i],l=c(u,t);if(void 0===l){const e=t&&t.type;throw new Error("production"===process.env.NODE_ENV?Z(14):`When called with an action of type ${e?`"${String(e)}"`:"(unknown type)"}, the slice reducer for key "${i}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`)}s[i]=l,a=a||l!==u}return a=a||r.length!==Object.keys(e).length,a?s:e}}function ue(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce(((e,t)=>(...n)=>e(t(...n))))}function le(e){return({dispatch:t,getState:n})=>r=>o=>"function"==typeof o?o(t,n,e):r(o)}var de=le(),pe=le,fe="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?ue:ue.apply(null,arguments)};function he(e){return"function"==typeof e&&"type"in e&&((t=e)&&"function"==typeof t.match);var t}function me(e,t){let n=0;return{measureTime(e){const t=Date.now();try{return e()}finally{const e=Date.now();n+=e-t}},warnIfExceeded(){n>e&&console.warn(`${t} took ${n}ms, which is more than the warning threshold of ${e}ms. \nIf your state or actions are very large, you may want to disable the middleware as it might cause too much of a slowdown in development mode. See https://redux-toolkit.js.org/api/getDefaultMiddleware for instructions.\nIt is disabled in production builds, so you don't need to worry about that.`)}}}var ye=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return 1===t.length&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function ve(e){return"object"!=typeof e||null==e||Object.isFrozen(e)}function ge(e,t,n){const r=be(e,t,n);return{detectMutations:()=>xe(e,t,r,n)}}function be(e,t=[],n,r="",o=new Set){const i={value:n};if(!e(n)&&!o.has(n)){o.add(n),i.children={};for(const o in n){const a=r?r+"."+o:o;t.length&&-1!==t.indexOf(a)||(i.children[o]=be(e,t,n[o],a))}}return i}function xe(e,t=[],n,r,o=!1,i=""){const a=n?n.value:void 0,s=a===r;if(o&&!s&&!Number.isNaN(r))return{wasMutated:!0,path:i};if(e(a)||e(r))return{wasMutated:!1};const c={};for(let e in n.children)c[e]=!0;for(let e in r)c[e]=!0;const u=t.length>0;for(let o in c){const a=i?i+"."+o:o;if(u){if(t.some((e=>e instanceof RegExp?e.test(a):a===e)))continue}const c=xe(e,t,n.children[o],r[o],s,a);if(c.wasMutated)return c}return{wasMutated:!1}}function we(e){const t=typeof e;return null==e||"string"===t||"boolean"===t||"number"===t||Array.isArray(e)||re(e)}function Ee(e,t="",n=we,r,o=[],i){let a;if(!n(e))return{keyPath:t||"<root>",value:e};if("object"!=typeof e||null===e)return!1;if(i?.has(e))return!1;const s=null!=r?r(e):Object.entries(e),c=o.length>0;for(const[e,u]of s){const s=t?t+"."+e:e;if(c){if(o.some((e=>e instanceof RegExp?e.test(s):s===e)))continue}if(!n(u))return{keyPath:s,value:u};if("object"==typeof u&&(a=Ee(u,s,n,r,o,i),a))return a}return i&&je(e)&&i.add(e),!1}function je(e){if(!Object.isFrozen(e))return!1;for(const t of Object.values(e))if("object"==typeof t&&null!==t&&!je(t))return!1;return!0}function ke(e={}){if("production"===process.env.NODE_ENV)return()=>e=>t=>e(t);{const{isSerializable:t=we,getEntries:n,ignoredActions:r=[],ignoredActionPaths:o=["meta.arg","meta.baseQueryMeta"],ignoredPaths:i=[],warnAfter:a=32,ignoreState:s=!1,ignoreActions:c=!1,disableCache:u=!1}=e,l=!u&&WeakSet?new WeakSet:void 0;return e=>u=>d=>{if(!function(e){return re(e)&&"type"in e&&"string"==typeof e.type}(d))return u(d);const p=u(d),f=me(a,"SerializableStateInvariantMiddleware");return c||r.length&&-1!==r.indexOf(d.type)||f.measureTime((()=>{const e=Ee(d,"",t,n,o,l);if(e){const{keyPath:t,value:n}=e;console.error(`A non-serializable value was detected in an action, in the path: \`${t}\`. Value:`,n,"\nTake a look at the logic that dispatched this action: ",d,"\n(See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)","\n(To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)")}})),s||(f.measureTime((()=>{const r=Ee(e.getState(),"",t,n,i,l);if(r){const{keyPath:e,value:t}=r;console.error(`A non-serializable value was detected in the state, in the path: \`${e}\`. Value:`,t,`\nTake a look at the reducer(s) handling this action type: ${d.type}.\n(See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)`)}})),f.warnIfExceeded()),p}}}function Oe(e){return"boolean"==typeof e}var Se=()=>function(e){const{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:o=!0}=e??{};let i=new ye;if(t&&(Oe(t)?i.push(de):i.push(pe(t.extraArgument))),"production"!==process.env.NODE_ENV){if(n){let e={};Oe(n)||(e=n),i.unshift(function(e={}){if("production"===process.env.NODE_ENV)return()=>e=>t=>e(t);{let t=function(e,t,r,o){return JSON.stringify(e,n(t,o),r)},n=function(e,t){let n=[],r=[];return t||(t=function(e,t){return n[0]===t?"[Circular ~]":"[Circular ~."+r.slice(0,n.indexOf(t)).join(".")+"]"}),function(o,i){if(n.length>0){var a=n.indexOf(this);~a?n.splice(a+1):n.push(this),~a?r.splice(a,1/0,o):r.push(o),~n.indexOf(i)&&(i=t.call(this,o,i))}else n.push(i);return null==e?i:e.call(this,o,i)}},{isImmutable:r=ve,ignoredPaths:o,warnAfter:i=32}=e;const a=ge.bind(null,r,o);return({getState:e})=>{let n,r=e(),o=a(r);return s=>c=>{const u=me(i,"ImmutableStateInvariantMiddleware");u.measureTime((()=>{if(r=e(),n=o.detectMutations(),o=a(r),n.wasMutated)throw new Error("production"===process.env.NODE_ENV?Pe(19):`A state mutation was detected between dispatches, in the path '${n.path||""}'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`)}));const l=s(c);return u.measureTime((()=>{if(r=e(),n=o.detectMutations(),o=a(r),n.wasMutated)throw new Error("production"===process.env.NODE_ENV?Pe(20):`A state mutation was detected inside a dispatch, in the path: ${n.path||""}. Take a look at the reducer(s) handling the action ${t(c)}. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`)})),u.warnIfExceeded(),l}}}}(e))}if(r){let e={};Oe(r)||(e=r),i.push(ke(e))}if(o){let e={};Oe(o)||(e=o),i.unshift(function(e={}){if("production"===process.env.NODE_ENV)return()=>e=>t=>e(t);const{isActionCreator:t=he}=e;return()=>e=>n=>(t(n)&&console.warn(function(e){const t=e?`${e}`.split("/"):[],n=t[t.length-1]||"actionCreator";return`Detected an action creator with type "${e||"unknown"}" being dispatched. \nMake sure you're calling the action creator before dispatching, i.e. \`dispatch(${n}())\` instead of \`dispatch(${n})\`. This is necessary even if the action has no payload.`}(n.type)),e(n))}(e))}}return i},Ne=e=>t=>{setTimeout(t,e)},Ce=e=>function(t){const{autoBatch:n=!0}=t??{};let r=new ye(e);return n&&r.push(((e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let o=!0,i=!1,a=!1;const s=new Set,c="tick"===e.type?queueMicrotask:"raf"===e.type?"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:Ne(10):"callback"===e.type?e.queueNotification:Ne(e.timeout),u=()=>{a=!1,i&&(i=!1,s.forEach((e=>e())))};return Object.assign({},r,{subscribe(e){const t=r.subscribe((()=>o&&e()));return s.add(e),()=>{t(),s.delete(e)}},dispatch(e){try{return o=!e?.meta?.RTK_autoBatch,i=!o,i&&(a||(a=!0,c(u))),r.dispatch(e)}finally{o=!0}}})})("object"==typeof n?n:void 0)),r};function _e(e){const t=Se(),{reducer:n,middleware:r,devTools:o=!0,duplicateMiddlewareCheck:i=!0,preloadedState:a,enhancers:s}=e||{};let c,u;if("function"==typeof n)c=n;else{if(!re(n))throw new Error("production"===process.env.NODE_ENV?Pe(1):"`reducer` is a required argument, and must be a function or an object of functions that can be passed to combineReducers");c=ce(n)}if("production"!==process.env.NODE_ENV&&r&&"function"!=typeof r)throw new Error("production"===process.env.NODE_ENV?Pe(2):"`middleware` field must be a callback");if("function"==typeof r){if(u=r(t),"production"!==process.env.NODE_ENV&&!Array.isArray(u))throw new Error("production"===process.env.NODE_ENV?Pe(3):"when using a middleware builder function, an array of middleware must be returned")}else u=t();if("production"!==process.env.NODE_ENV&&u.some((e=>"function"!=typeof e)))throw new Error("production"===process.env.NODE_ENV?Pe(4):"each middleware provided to configureStore must be a function");if("production"!==process.env.NODE_ENV&&i){let e=new Set;u.forEach((t=>{if(e.has(t))throw new Error("production"===process.env.NODE_ENV?Pe(42):"Duplicate middleware references found when creating the store. Ensure that each middleware is only included once.");e.add(t)}))}let l=ue;o&&(l=fe({trace:"production"!==process.env.NODE_ENV,..."object"==typeof o&&o}));const d=function(...e){return t=>(n,r)=>{const o=t(n,r);let i=()=>{throw new Error("production"===process.env.NODE_ENV?Z(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")};const a={getState:o.getState,dispatch:(e,...t)=>i(e,...t)},s=e.map((e=>e(a)));return i=ue(...s)(o.dispatch),{...o,dispatch:i}}}(...u),p=Ce(d);if("production"!==process.env.NODE_ENV&&s&&"function"!=typeof s)throw new Error("production"===process.env.NODE_ENV?Pe(5):"`enhancers` field must be a callback");let f="function"==typeof s?s(p):p();if("production"!==process.env.NODE_ENV&&!Array.isArray(f))throw new Error("production"===process.env.NODE_ENV?Pe(6):"`enhancers` callback must return an array");if("production"!==process.env.NODE_ENV&&f.some((e=>"function"!=typeof e)))throw new Error("production"===process.env.NODE_ENV?Pe(7):"each enhancer provided to configureStore must be a function");"production"!==process.env.NODE_ENV&&u.length&&!f.includes(d)&&console.error("middlewares were provided, but middleware enhancer was not included in final enhancers - make sure to call `getDefaultEnhancers`");return ae(c,a,l(...f))}function Pe(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var De=n.createContext(void 0),Ie=function(t){var n=t.children,r=I.useState((function(e){return e.snackbar}));return e.jsxs(De.Provider,{value:{showSnackbar:function(e,t){void 0===t&&(t="info"),I.update((function(n){n.snackbar.open=!0,n.snackbar.message=e,n.snackbar.severity=t}))}},children:[n,e.jsx(o.Snackbar,{open:r.open,message:r.message,severity:r.severity,autoHideDuration:1500,onClose:function(){I.update((function(e){e.snackbar.open=!1}))}})]})},Ae={isOpen:!1,title:"",message:"",confirmButtonText:"",cancelButtonText:"",type:"confirm",onConfirm:function(){},onCancel:function(){}},Te=function(n){var r=n.actions,i=t.useTheme(),a=j.useState(!1),s=a[0],c=a[1],u=function(){return c(!1)};return e.jsxs(g,{sx:{position:"fixed",bottom:26,right:0,zIndex:1e3},children:[e.jsx(t.Backdrop,{open:s}),e.jsx(b,{ariaLabel:"Custom Help Docs",sx:{position:"absolute",bottom:0,right:40,display:"flex",alignItems:"flex-end","& .MuiFab-primary":{backgroundColor:i.palette.highlight.highlightBlue,borderRadius:"8px",width:"50px",height:"50px",display:"flex",justifyContent:"center",alignItems:"center","&:hover":{backgroundColor:i.palette.highlight.highlightBlue}},"& .MuiSpeedDialAction-fab":{margin:"0 0 16px 0","&:not(:last-child)":{marginBottom:"8px"}}},icon:e.jsx(o.Icons.HelpDocsIcon,{size:20}),onClose:u,onOpen:function(){return c(!0)},open:s,direction:"up",children:r.map((function(t){return e.jsx(x,{onClick:function(){var e;null===(e=t.onClick)||void 0===e||e.call(t),u()},icon:e.jsx("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",fontWeight:"bold",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t.name}),FabProps:{sx:{width:"auto",minWidth:"180px",maxWidth:"280px",padding:"8px 12px",boxShadow:"none",height:"40px",borderRadius:"8px",backgroundColor:i.palette.surface.defaultBackground,color:i.palette.text.primary,fontWeight:500,fontFamily:"Heebo",fontSize:"12px",whiteSpace:"nowrap",textAlign:"right",display:"flex",justifyContent:"flex-end",alignItems:"center","&:hover":{backgroundColor:i.palette.surface.defaultBackground}}}},t.name)}))})]})},Ve=t.styled(t.Stack)((function(e){var t,n=e.theme;return(t={flexDirection:"row",backgroundColor:n.palette.surface.defaultBackground})[n.breakpoints.down("md")]={flexWrap:"wrap"},t})),Be=t.styled(t.Box)((function(e){var t,n=e.theme;return(t={borderRadius:"8px",height:"calc(100vh - 96px)",overflowY:"scroll",width:"100%","&::-webkit-scrollbar":{width:"0.5em",height:"0.2em",backgroundColor:n.palette.surface.defaultBackground},"&::-webkit-scrollbar-thumb":{backgroundColor:n.palette.primary.light,borderRadius:"3px","&:hover":{backgroundColor:n.palette.primary.main}}})[n.breakpoints.down("md")]={margin:"0px 12px 12px 12px",height:"calc(100vh - 118px)","&::-webkit-scrollbar":{display:"none"}},t})),Re=[{label:"Tuition Fee",value:"tuition_fee"},{label:"Admission Fee",value:"admission_fee"},{label:"Hostel Fee",value:"hostel_fee"},{label:"Transport Fee",value:"transport_fee"},{label:"Exam Fee",value:"exam_fee"},{label:"Other Fee",value:"other_fee"}],Fe=Array.from({length:6},(function(e,t){return(new Date).getFullYear()-t})),qe=Array.from({length:12},(function(e,t){return{label:"".concat((new Date).getFullYear()-t," - ").concat((new Date).getFullYear()-t+1),value:"".concat((new Date).getFullYear()-t," - ").concat((new Date).getFullYear()-t+1)}}));Object.defineProperty(exports,"BrowserRouter",{enumerable:!0,get:function(){return l.BrowserRouter}}),exports.AppLayout=function(r){var i,a=r.actions,s=void 0===a?[]:a,c=r.profileActions,u=void 0===c?[]:c,l=r.children,d=r.institutionData,p=void 0===d?[]:d,f=r.menu,h=r.mainContainerSx,m=r.handleLogout,y=r.userName,g=void 0===y?"":y,b=r.designation,x=void 0===b?"":b,w=r.clientName,E=void 0===w?"":w,j=r.defaultCollapsed,k=void 0===j||j,S=r.helpDocsConfig,N=n.useState(k),_=N[0],D=N[1],I=t.useTheme(),A=t.useMediaQuery(I.breakpoints.down("md"));var T=window.location.pathname.split("/").filter(Boolean).slice(1).join("/").replace(/\/\d+/g,"/:id"),V=(null===(i=null==S?void 0:S["/".concat(T)])||void 0===i?void 0:i.actions)||[];return e.jsxs(Ve,{children:[e.jsx(o.Sidebar,{menu:f,collapsed:_,setCollapsed:D}),e.jsxs(v.motion.div,{animate:{width:_?"calc(100% - 84px)":"calc(100% - 278px)"},transition:{duration:.3,ease:"circOut"},style:{margin:"12px 12px 12px 0px",width:A?"100%":"calc(100% - 84px)",display:A?"contents":"block"},children:[e.jsx(o.AppHeader,O({clientName:E,userFullName:g,designation:x,actions:s,profileActions:C([e.jsx(q,{})],u,!0),collapsed:_,showActiveDevices:!1,onLogoutClick:null!=m?m:function(){B.post("/auth-server/auth/logout").then((function(e){P.remove("campx_tenant"),P.remove("campx_session_key"),P.remove("campx_institution"),window.location.href="/"})).catch((function(e){}))},institutionsData:p},A&&{profileSx:{width:32,height:32,fontSize:"12px"}})),S&&V.length>0&&e.jsx(Te,{actions:V}),e.jsx(Be,{sx:O({margin:"12px 0px 0px 0px",backgroundColor:I.palette.surface.paperBackground},h),onClick:function(){D(!0)},children:e.jsx(n.Suspense,{fallback:e.jsx(o.Spinner,{}),children:e.jsx(X,{children:l})})})]})]})},exports.ApplicationStore=I,exports.BatchSelector=function(t){return e.jsx(o.SingleSelect,O({label:"Batch",options:null==qe?void 0:qe.map((function(e){return{label:e.label,value:e.value}}))},t))},exports.ChangePassword=F,exports.ChangePasswordDialog=q,exports.ConfirmDialogProvider=$,exports.CourseSelector=function(t){return e.jsx(o.SingleSelect,O({dbLabelProps:{labelKey:"courseName",subLabelKey:"level"}},t,{externalAxios:B,optionsApiEndPoint:"/dropdowns/courses"}))},exports.DepartmentSelector=function(t){return e.jsx(o.SingleSelect,O({dbLabelProps:{labelKey:"name"},dbValueProps:{valueKey:"_id",isObjectId:!0}},t,{externalAxios:B,optionsApiEndPoint:"/dropdowns/departments"}))},exports.EmployeesSelector=function(t){return e.jsx(o.SingleSelect,O({dbValueProps:{valueKey:"_id",isObjectId:!0},dbLabelProps:{labelKey:"fullName",subLabelKey:"employeeId"}},t,{externalAxios:B,optionsApiEndPoint:"/dropdowns/employees"}))},exports.ErrorBoundary=X,exports.FeeTypeSelector=function(t){return e.jsx(o.SingleSelect,O({label:"Fee Type",options:null==Re?void 0:Re.map((function(e){return{label:e.label,value:e.value}}))},t))},exports.HelpDocs=Te,exports.HostelFloorSelector=function(t){return e.jsx(o.SingleSelect,O({label:"Hostel Room No.",dbValueProps:{valueKey:"floor"},dbLabelProps:{labelKey:"floor"}},t,{externalAxios:B,optionsApiEndPoint:"dropdowns/floors"}))},exports.HostelRoomSelector=function(t){return e.jsx(o.SingleSelect,O({label:"Hostel Room No.",dbValueProps:{valueKey:"id"},dbLabelProps:{labelKey:"room_number",subLabelKey:"floor"}},t,{optionsApiEndPoint:"dropdowns/hostel-rooms",externalAxios:B}))},exports.PrintFormatSelector=function(t){return e.jsx(o.SingleSelect,O({dbLabelProps:{labelKey:"name",subLabelKey:"type",useSubLabelStartCase:!0}},t,{externalAxios:B,optionsApiEndPoint:"/dropdowns/print-formats"}))},exports.ProgramSelector=function(t){return e.jsx(o.SingleSelect,O({dbLabelProps:{labelKey:"branchCode",subLabelKey:"branchDisplay"}},t,{externalAxios:B,optionsApiEndPoint:"/dropdowns/programs"}))},exports.Providers=function(t){var r=t.children,i=t.basename,a=t.theme,s=void 0===a?o.lightTheme:a,c=t.reducers,d=void 0===c?{}:c,p=new u.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:!1,useErrorBoundary:!0}}}),f=T&&V?"/".concat(V):"/";n.useEffect((function(){"/"===window.location.pathname&&V&&T&&window.location.replace(window.location.origin+"/".concat(V))}),[V,T]);var v=_e({reducer:ce(d)});return e.jsx(y.Provider,{store:v,children:e.jsx(l.BrowserRouter,{basename:null!=i?i:f,children:e.jsx(u.QueryClientProvider,{client:p,children:e.jsx(o.MuiThemeProvider,{theme:s,children:e.jsx(Ie,{children:e.jsx(h.LocalizationProvider,{dateAdapter:m.AdapterDateFns,children:e.jsx($,{children:r})})})})})})})},exports.RegulationSelector=function(t){return e.jsx(o.SingleSelect,O({label:"Regulation",dbValueProps:{valueKey:"regulation_id"},dbLabelProps:{labelKey:"r.name"}},t,{optionsApiEndPoint:"dropdowns/regulations",externalAxios:B}))},exports.SemesterSelector=function(t){return e.jsx(o.SingleSelect,O({dbLabelProps:{labelKey:"name",subLabelKey:"year"}},t,{optionsApiEndPoint:"/dropdowns/semesters",externalAxios:B}))},exports.SnackbarProvider=Ie,exports.StyledMenuItem=R,exports.YearRangeSelector=function(t){var n=t.suffix,r=void 0===n?null:n,i=t.valueKey,a=void 0===i?"yearRange":i,s=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(t,["suffix","valueKey"]);return e.jsx(o.SingleSelect,O({label:"Year Range",options:null==Fe?void 0:Fe.map((function(e){return{label:r?"".concat(r," ").concat(e," - ").concat(e+1):"".concat(e," - ").concat(e+1),value:"yearRange"===a?"".concat(e," - ").concat(e+1):e}}))},s))},exports.axios=B,exports.initialApplicationState=D,exports.institutionCode=V,exports.isDevelopment=A,exports.tenantCode=T,exports.useConfirm=function(){var e=function(){I.update((function(e){e.confirmDialog=Ae}))};return function(t){var n=t.title,r=t.message,o=t.confirmButtonText,i=t.cancelButtonText,a=t.type,s=void 0===a?"confirm":a;return new Promise((function(t){I.update((function(a){a.confirmDialog={isOpen:!0,title:n,message:r,confirmButtonText:o,cancelButtonText:i,type:s,onConfirm:function(){t(!0),e()},onCancel:function(){t(!1),e()}}}))}))}};
4
4
  //# sourceMappingURL=index.js.map