@campxdev/campx-web-utils 2.0.13 → 2.0.15

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.
Files changed (64) hide show
  1. package/dist/cjs/index.js +1 -1
  2. package/dist/cjs/types/src/components/Exotel/CallButton.d.ts +10 -0
  3. package/dist/cjs/types/src/components/Exotel/CallDispositionForm.d.ts +29 -0
  4. package/dist/cjs/types/src/components/Exotel/ExotelPhone.d.ts +10 -0
  5. package/dist/cjs/types/src/components/Exotel/ExotelWrapper.d.ts +14 -0
  6. package/dist/cjs/types/src/components/Exotel/MicrophonePermission.d.ts +6 -0
  7. package/dist/cjs/types/src/components/Exotel/index.d.ts +6 -0
  8. package/dist/cjs/types/src/config/index.d.ts +1 -0
  9. package/dist/cjs/types/src/config/voip.config.d.ts +18 -0
  10. package/dist/cjs/types/src/constants/exotel.constants.d.ts +7 -0
  11. package/dist/cjs/types/src/providers/ExotelProvider.d.ts +79 -0
  12. package/dist/cjs/types/src/providers/VoIPProvider.d.ts +33 -0
  13. package/dist/cjs/types/src/providers/index.d.ts +2 -0
  14. package/dist/cjs/types/src/services/crypto/CryptoService.d.ts +23 -0
  15. package/dist/cjs/types/src/services/exotel/ExotelService.d.ts +47 -0
  16. package/dist/cjs/types/src/services/exotel/api.d.ts +158 -0
  17. package/dist/cjs/types/src/services/exotel/index.d.ts +2 -0
  18. package/dist/cjs/types/src/utils/exotel/formatters.d.ts +8 -0
  19. package/dist/cjs/types/src/utils/exotel/index.d.ts +1 -0
  20. package/dist/esm/index.js +2 -2
  21. package/dist/esm/types/src/components/Exotel/CallButton.d.ts +10 -0
  22. package/dist/esm/types/src/components/Exotel/CallDispositionForm.d.ts +29 -0
  23. package/dist/esm/types/src/components/Exotel/ExotelPhone.d.ts +10 -0
  24. package/dist/esm/types/src/components/Exotel/ExotelWrapper.d.ts +14 -0
  25. package/dist/esm/types/src/components/Exotel/MicrophonePermission.d.ts +6 -0
  26. package/dist/esm/types/src/components/Exotel/index.d.ts +6 -0
  27. package/dist/esm/types/src/config/index.d.ts +1 -0
  28. package/dist/esm/types/src/config/voip.config.d.ts +18 -0
  29. package/dist/esm/types/src/constants/exotel.constants.d.ts +7 -0
  30. package/dist/esm/types/src/providers/ExotelProvider.d.ts +79 -0
  31. package/dist/esm/types/src/providers/VoIPProvider.d.ts +33 -0
  32. package/dist/esm/types/src/providers/index.d.ts +2 -0
  33. package/dist/esm/types/src/services/crypto/CryptoService.d.ts +23 -0
  34. package/dist/esm/types/src/services/exotel/ExotelService.d.ts +47 -0
  35. package/dist/esm/types/src/services/exotel/api.d.ts +158 -0
  36. package/dist/esm/types/src/services/exotel/index.d.ts +2 -0
  37. package/dist/esm/types/src/utils/exotel/formatters.d.ts +8 -0
  38. package/dist/esm/types/src/utils/exotel/index.d.ts +1 -0
  39. package/dist/index.d.ts +357 -3
  40. package/dist/styles.css +337 -47
  41. package/dist/types/exotel-crm-websdk.d.ts +46 -0
  42. package/export.ts +6 -0
  43. package/package.json +4 -1
  44. package/src/components/Exotel/CallButton.tsx +164 -0
  45. package/src/components/Exotel/CallDispositionForm.tsx +213 -0
  46. package/src/components/Exotel/ExotelPhone.tsx +482 -0
  47. package/src/components/Exotel/ExotelWrapper.tsx +80 -0
  48. package/src/components/Exotel/MicrophonePermission.tsx +97 -0
  49. package/src/components/Exotel/index.ts +10 -0
  50. package/src/config/index.ts +1 -0
  51. package/src/config/voip.config.ts +26 -0
  52. package/src/constants/exotel.constants.ts +7 -0
  53. package/src/providers/ExotelProvider.tsx +526 -0
  54. package/src/providers/VoIPProvider.tsx +143 -0
  55. package/src/providers/index.ts +2 -0
  56. package/src/selectors/ResearchStageSelector.tsx +1 -0
  57. package/src/services/crypto/CryptoService.ts +112 -0
  58. package/src/services/exotel/ExotelService.ts +238 -0
  59. package/src/services/exotel/api.ts +319 -0
  60. package/src/services/exotel/index.ts +2 -0
  61. package/src/utils/constants.ts +1 -0
  62. package/src/utils/exotel/formatters.ts +17 -0
  63. package/src/utils/exotel/index.ts +1 -0
  64. package/types/exotel-crm-websdk.d.ts +46 -0
package/dist/cjs/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";var e=require("axios"),t=require("pullstate"),n=require("react/jsx-runtime"),r=require("@campxdev/react-blueprint"),o=require("react"),i=require("react-query"),s=require("react-router-dom"),a=require("@hookform/resolvers"),c=require("react-hook-form"),u=require("device-detector-js"),l=require("yup"),d=require("react-redux");function p(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 f=p(o),h=p(l),y=function(){return y=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},y.apply(this,arguments)};function m(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(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(s,a)}c((r=r.apply(e,t||[])).next())})}function b(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}function v(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 g=function e(t,n){function r(e,r,o){if("undefined"!=typeof document){"number"==typeof(o=v({},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 s in o)o[s]&&(i+="; "+s,!0!==o[s]&&(i+="="+o[s].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("="),s=i.slice(1).join("=");try{var a=decodeURIComponent(i[0]);if(r[a]=t.read(s,a),e===a)break}catch(e){}}return e?r[e]:r}},remove:function(e,t){r(e,"",v({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,v({},this.attributes,t))},withConverter:function(t){return e(v({},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:"/"}),w={isLoginDialogOpen:!1,snackbar:{open:!1,message:"",severity:"success"},confirmDialog:{isOpen:!1,title:"",message:"",onConfirm:function(){},onCancel:function(){},type:"confirm"},user:void 0,institutionInfo:void 0,asset:void 0},x=new t.Store(w),_=window.location.hostname.includes("localhost"),E=window.location.hostname.split(".")[0],S=window.location.pathname.split("/")[1],O=window.location.pathname.split("/")[2],j={"student-workspace":"/student-api","faculty-workspace":"/faculty-api","department-workspace":"/department-api","academic-coordinator-workspace":"/academic-coordinator-api","feedback-coordinator-workspace":"/feedback-coordinator-api","course-coordinator-workspace":"/course-coordinator-api","classroom-coordinator-workspace":"/classroom-coordinator-api","coe-workspace":"/coe-api","academic-admin-workspace":"/academic-admin-api","hostel-admin-workspace":"/hostel-admin-api","transport-coordinator-workspace":"/transport-coordinator-api","employee-workspace":"/employee-api","librarian-workspace":"/librarian-api","fee-terminal":"/fee-terminal-api","accounts-officer-workspace":"accounts-officer-api","finance-officer-workspace":"finance-officer-api","outreach-agent-workspace":"outreach-agent-api","prospect-workspace":"prospect-api","research-coordinator-workspace":"research-coordinator-api","tele-counsellor-workspace":"tele-counsellor-api","team-owner-workspace":"/team-owner-api","admissions-counsellor-workspace":"/admissions-counsellor-api","admissions-officer-workspace":"/admissions-officer-api"},k=e.create({baseURL:process.env.REACT_APP_API_HOST||"",withCredentials:!0,headers:{"x-tenant-id":E,"x-institution-code":S}});k.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);if(!1!==e.workspace&&O&&j[O]&&"common-workspace"!==O){var n=j[O];e.url="".concat(n).concat(e.url)}var r=g.get("campx_session_key"),o=g.get("campx_open_payments_key"),i=g.get("campx_student_key");return _&&r&&e.headers.set("campx_session_key",r),_&&i&&e.headers.set("campx_student_key",i),o&&e.headers.set("campx_open_payments_key",o),e.skipInstitutionCode&&e.headers.delete("x-institution-code"),y(y({},e),{params:t})},function(e){return Promise.reject(e)}),k.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)&&x.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,413].includes(null===(r=e.response)||void 0===r?void 0:r.status)&&x.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)&&x.update(function(t){t.snackbar.open=!0,t.snackbar.message=e.response.data.message||"Not Found",t.snackbar.severity="error"}),Promise.reject(e)});var N=e.create({baseURL:process.env.REACT_APP_API_HOST||"",withCredentials:!0,workspace:!1,headers:{"x-tenant-id":E,"x-institution-code":S}});N.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=g.get("campx_session_key"),r=g.get("campx_open_payments_key"),o=g.get("campx_student_key");return _&&n&&e.headers.set("campx_session_key",n),_&&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"),y(y({},e),{params:t})},function(e){return Promise.reject(e)}),N.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)&&x.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)&&x.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)&&x.update(function(t){t.snackbar.open=!0,t.snackbar.message=e.response.data.message||"Not Found",t.snackbar.severity="error"}),Promise.reject(e)});var P=o.createContext({showConfirmDialog:function(){}}),A=function(e){var t=e.children,o=x.useState(function(e){return e.confirmDialog}),i=function(){x.update(function(e){e.confirmDialog.isOpen=!1})};return n.jsxs(P.Provider,{value:{showConfirmDialog:function(e,t,n,r,o,i,s){void 0===o&&(o="confirm"),x.update(function(a){a.confirmDialog={isOpen:!0,title:e,message:t,onConfirm:n,onCancel:r,type:o,confirmButtonText:i,cancelButtonText:s}})}},children:[t,n.jsx(r.ConfirmDialog,{isOpen:o.isOpen,title:o.title,message:o.message,type:o.type,confirmButtonText:o.confirmButtonText,cancelButtonText:o.cancelButtonText,onConfirm:function(){o.onConfirm(),i()},onCancel:function(){o.onCancel(),i()}})]})};function D(e,t){return D=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},D(e,t)}var C={error:null},I=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=C,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,D(e,t)}(t,e),t.getDerivedStateFromError=function(e){return{error:e}};var n=t.prototype;return n.reset=function(){this.setState(C)},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,s=this.state.error,a=this.props.resetKeys;null!==s&&null!==t.error&&(void 0===(o=e.resetKeys)&&(o=[]),void 0===(i=a)&&(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,a),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(f.isValidElement(o))return o;if("function"==typeof n)return n(i);if(r)return f.createElement(r,i);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},t}(f.Component),V=function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),function(r,o,i){try{return Promise.resolve(function(s,c){try{var u=(t.context&&process.env.NODE_ENV,Promise.resolve(e["sync"===n.mode?"validateSync":"validate"](r,Object.assign({abortEarly:!1},t,{context:o}))).then(function(e){return i.shouldUseNativeValidation&&a.validateFieldsNatively({},i),{values:n.rawValues?r:e,errors:{}}}))}catch(e){return c(e)}return u&&u.then?u.then(void 0,c):u}(0,function(e){if(!e.inner)throw e;return{values:{},errors:a.toNestError((t=e,n=!i.shouldUseNativeValidation&&"all"===i.criteriaMode,(t.inner||[]).reduce(function(e,t){if(e[t.path]||(e[t.path]={message:t.message,type:t.type}),n){var r=e[t.path].types,o=r&&r[t.type];e[t.path]=c.appendErrors(t.path,n,e,t.type,o?[].concat(o,t.message):t.message)}return e},{})),i)};var t,n}))}catch(e){return Promise.reject(e)}}},T=function(e){return m(void 0,void 0,void 0,function(){var t;return b(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,k.post("/auth-server/auth-v2/login",e,{workspace:!1}).then(function(e){return e.data})]}})})},R=h.object().shape({username:h.string().required("Username is required"),password:h.string().required("Password is required")}),L=function(e){var t=e.close,a=o.useState({deviceInformation:{deviceType:"browser",clientName:"unknown",os:"unknown",osVersion:"unknown",latitude:null,longitude:null,tokenType:"WEB"},isLocationAllowed:!0}),l=a[0],d=a[1],p=s.useNavigate();o.useEffect(function(){navigator.geolocation.getCurrentPosition(function(e){d(function(t){return y(y({},t),{deviceInformation:y(y({},t.deviceInformation),{latitude:e.coords.latitude,longitude:e.coords.longitude})})})}),navigator.permissions.query({name:"geolocation"}).then(function(e){"denied"===e.state&&d(function(e){return y(y({},e),{isLocationAllowed:!1})})});var e=(new u).parse(navigator.userAgent);d(function(t){var n,r,o;return y(y({},t),{deviceInformation:y(y({},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 f=c.useForm({resolver:V(R)}),h=f.handleSubmit,v=f.control,w=f.formState.errors,x=i.useMutation(T,{onSuccess:function(e){_&&(g.remove("campx_session_key"),g.set("campx_session_key",e.session.token),t(),p("/".concat(e.session.institutionCode,"/workspace")),window.location.reload())}}),E=x.mutate,S=x.isLoading;return n.jsxs("div",{className:"flex flex-col gap-8 justify-center items-center p-8",children:[n.jsx("div",{className:"flex items-center justify-center h-9 w-48",children:n.jsx(r.Icons.CampxFullLogoIcon,{})}),n.jsxs("div",{className:"flex flex-col gap-4 w-full max-w-[400px]",children:[n.jsx(c.Controller,{control:v,render:function(e){var t=e.field;return n.jsx(r.TextField,{name:"username",placeholder:"Enter Username or Email",onChange:t.onChange,label:"Username or Email",error:!!w.username,required:!0,fullWidth:!0})},name:"username"}),n.jsx(c.Controller,{control:v,render:function(e){var t=e.field;return n.jsx(r.PasswordField,{name:"password",placeholder:"Enter password",onChange:t.onChange,label:"Password",error:!!w.password,required:!0,fullWidth:!0})},name:"password"}),n.jsx(r.Button,{type:"submit",color:"primary",variant:"default",onClick:h(function(e){return m(void 0,void 0,void 0,function(){return b(this,function(t){return E(y(y(y({},e),l.deviceInformation),{loginId:e.username,loginType:"USER"})),[2]})})}),disabled:S,loading:S,fullWidth:!0,children:"Login"})]})]})},K=function(e){var t,o,i,s,a,c,u,l=e.error,d=e.resetErrorBoundary;if(null===(t=null==l?void 0:l.response)||void 0===t?void 0:t.status)switch(null===(o=null==l?void 0:l.response)||void 0===o?void 0:o.status){case 401:return n.jsx(F,{});case 500:return n.jsx(r.InternalServerError,{resetBoundary:d});case 404:return n.jsx(r.ResourceNotFound,{message:null===(s=null===(i=null==l?void 0:l.response)||void 0===i?void 0:i.data)||void 0===s?void 0:s.message})}return"ERR_NETWORK"===(null==l?void 0:l.code)?n.jsx(r.NoInterneConnection,{resetBoundary:d}):n.jsx("div",{className:"mt-4 p-5",children:n.jsxs("div",{className:"relative h-15 border border-red-200 bg-red-50 flex items-center rounded-md px-2",children:[n.jsx("div",{className:"flex-1 text-red-700 bg-transparent",children:null!==(u=null===(c=null===(a=null==l?void 0:l.response)||void 0===a?void 0:a.data)||void 0===c?void 0:c.message)&&void 0!==u?u:null==l?void 0:l.message}),n.jsx(r.Button,{onClick:function(){return d()},size:"sm",variant:"link",className:"hover:no-underline text-destructive",children:"Try Again"})]})})},F=function(){var e=s.useNavigate(),t=o.useState(!1),i=t[0],a=t[1],c=g.get("campx_session_key");return n.jsx(r.UnAuthorized,{component:n.jsxs(n.Fragment,{children:[n.jsx(r.Button,{className:"mt-5",variant:"default",onClick:function(){"localhost"===window.location.hostname.split(".")[1]?a(!0):c||e("prospect-workspace"===O?"".concat(S,"/ats/login"):"/auth/login")},children:"Click Here To Login"}),n.jsx(r.Dialog,{open:i,onClose:function(){return a(!1)},content:function(e){var t=e.close;return n.jsx(L,{close:t})}})]})})};function B(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 M=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),$=()=>Math.random().toString(36).substring(7).split("").join("."),z={INIT:`@@redux/INIT${$()}`,REPLACE:`@@redux/REPLACE${$()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${$()}`};function q(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 U(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 W(e){let t=typeof e;return"production"!==process.env.NODE_ENV&&(t=U(e)),t}function Y(e,t,n){if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?B(2):`Expected the root reducer to be a function. Instead, received: '${W(e)}'`);if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error("production"===process.env.NODE_ENV?B(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?B(1):`Expected the enhancer to be a function. Instead, received: '${W(n)}'`);return n(Y)(e,t)}let r=e,o=t,i=new Map,s=i,a=0,c=!1;function u(){s===i&&(s=new Map,i.forEach((e,t)=>{s.set(t,e)}))}function l(){if(c)throw new Error("production"===process.env.NODE_ENV?B(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?B(4):`Expected the listener to be a function. Instead, received: '${W(e)}'`);if(c)throw new Error("production"===process.env.NODE_ENV?B(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=a++;return s.set(n,e),function(){if(t){if(c)throw new Error("production"===process.env.NODE_ENV?B(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(),s.delete(n),i=null}}}function p(e){if(!q(e))throw new Error("production"===process.env.NODE_ENV?B(7):`Actions must be plain objects. Instead, the actual type was: '${W(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?B(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?B(17):`Action "type" property must be a string. Instead, the actual type was: '${W(e.type)}'. Value was: '${e.type}' (stringified)`);if(c)throw new Error("production"===process.env.NODE_ENV?B(9):"Reducers may not dispatch actions.");try{c=!0,o=r(o,e)}finally{c=!1}return(i=s).forEach(e=>{e()}),e}p({type:z.INIT});return{dispatch:p,subscribe:d,getState:l,replaceReducer:function(e){if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?B(10):`Expected the nextReducer to be a function. Instead, received: '${W(e)}`);r=e,p({type:z.REPLACE})},[M]:function(){const e=d;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error("production"===process.env.NODE_ENV?B(11):`Expected the observer to be an object. Instead, received: '${W(t)}'`);function n(){const e=t;e.next&&e.next(l())}n();return{unsubscribe:e(n)}},[M](){return this}}}}}function H(e){"undefined"!=typeof console&&console.error;try{throw new Error(e)}catch(e){}}function X(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]&&H(`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:z.INIT}))throw new Error("production"===process.env.NODE_ENV?B(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:z.PROBE_UNKNOWN_ACTION()}))throw new Error("production"===process.env.NODE_ENV?B(13):`The slice reducer for key "${t}" returned undefined when probed with a random type. Don't try to handle '${z.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===z.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(!q(e))return`The ${i} has unexpected type of "${W(e)}". Expected argument to be an object with the following keys: "${o.join('", "')}"`;const s=Object.keys(e).filter(e=>!t.hasOwnProperty(e)&&!r[e]);return s.forEach(e=>{r[e]=!0}),n&&n.type===z.REPLACE?void 0:s.length>0?`Unexpected ${s.length>1?"keys":"key"} "${s.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&&H(r)}let s=!1;const a={};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?B(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.`)}a[i]=l,s=s||l!==u}return s=s||r.length!==Object.keys(e).length,s?a:e}}function Q(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce((e,t)=>(...n)=>e(t(...n)))}var G=Symbol.for("immer-nothing"),J=Symbol.for("immer-draftable"),Z=Symbol.for("immer-state"),ee="production"!==process.env.NODE_ENV?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function te(e,...t){if("production"!==process.env.NODE_ENV){const n=ee[e],r="function"==typeof n?n.apply(null,t):n;throw new Error(`[Immer] ${r}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ne=Object.getPrototypeOf;function re(e){return!!e&&!!e[Z]}function oe(e){return!!e&&(ae(e)||Array.isArray(e)||!!e[J]||!!e.constructor?.[J]||pe(e)||fe(e))}var ie=Object.prototype.constructor.toString(),se=new WeakMap;function ae(e){if(!e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);if(null===t||t===Object.prototype)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(n===Object)return!0;if("function"!=typeof n)return!1;let r=se.get(n);return void 0===r&&(r=Function.toString.call(n),se.set(n,r)),r===ie}function ce(e,t,n=!0){if(0===ue(e)){(n?Reflect.ownKeys(e):Object.keys(e)).forEach(n=>{t(n,e[n],e)})}else e.forEach((n,r)=>t(r,n,e))}function ue(e){const t=e[Z];return t?t.type_:Array.isArray(e)?1:pe(e)?2:fe(e)?3:0}function le(e,t){return 2===ue(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function de(e,t,n){const r=ue(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function pe(e){return e instanceof Map}function fe(e){return e instanceof Set}function he(e){return e.copy_||e.base_}function ye(e,t){if(pe(e))return new Map(e);if(fe(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=ae(e);if(!0===t||"class_only"===t&&!n){const t=Object.getOwnPropertyDescriptors(e);delete t[Z];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){const o=n[r],i=t[o];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(t[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[o]})}return Object.create(ne(e),t)}{const t=ne(e);if(null!==t&&n)return{...e};const r=Object.create(t);return Object.assign(r,e)}}function me(e,t=!1){return ve(e)||re(e)||!oe(e)||(ue(e)>1&&Object.defineProperties(e,{set:be,add:be,clear:be,delete:be}),Object.freeze(e),t&&Object.values(e).forEach(e=>me(e,!0))),e}var be={value:function(){te(2)}};function ve(e){return null===e||"object"!=typeof e||Object.isFrozen(e)}var ge,we={};function xe(e){const t=we[e];return t||te(0,e),t}function _e(){return ge}function Ee(e,t){t&&(xe("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Se(e){Oe(e),e.drafts_.forEach(ke),e.drafts_=null}function Oe(e){e===ge&&(ge=e.parent_)}function je(e){return ge={drafts_:[],parent_:ge,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function ke(e){const t=e[Z];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Ne(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[Z].modified_&&(Se(t),te(4)),oe(e)&&(e=Pe(t,e),t.parent_||De(t,e)),t.patches_&&xe("Patches").generateReplacementPatches_(n[Z].base_,e,t.patches_,t.inversePatches_)):e=Pe(t,n,[]),Se(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==G?e:void 0}function Pe(e,t,n){if(ve(t))return t;const r=e.immer_.shouldUseStrictIteration(),o=t[Z];if(!o)return ce(t,(r,i)=>Ae(e,o,t,r,i,n),r),t;if(o.scope_!==e)return t;if(!o.modified_)return De(e,o.base_,!0),o.base_;if(!o.finalized_){o.finalized_=!0,o.scope_.unfinalizedDrafts_--;const t=o.copy_;let i=t,s=!1;3===o.type_&&(i=new Set(t),t.clear(),s=!0),ce(i,(r,i)=>Ae(e,o,t,r,i,n,s),r),De(e,t,!1),n&&e.patches_&&xe("Patches").generatePatches_(o,n,e.patches_,e.inversePatches_)}return o.copy_}function Ae(e,t,n,r,o,i,s){if(null==o)return;if("object"!=typeof o&&!s)return;const a=ve(o);if(!a||s){if("production"!==process.env.NODE_ENV&&o===n&&te(5),re(o)){const s=Pe(e,o,i&&t&&3!==t.type_&&!le(t.assigned_,r)?i.concat(r):void 0);if(de(n,r,s),!re(s))return;e.canAutoFreeze_=!1}else s&&n.add(o);if(oe(o)&&!a){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;if(t&&t.base_&&t.base_[r]===o&&a)return;Pe(e,o),t&&t.scope_.parent_||"symbol"==typeof r||!(pe(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))||De(e,o)}}}function De(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&me(t,n)}var Ce={get(e,t){if(t===Z)return e;const n=he(e);if(!le(n,t))return function(e,t,n){const r=Te(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}(e,n,t);const r=n[t];return e.finalized_||!oe(r)?r:r===Ve(e.base_,t)?(Le(e),e.copy_[t]=Ke(r,e)):r},has:(e,t)=>t in he(e),ownKeys:e=>Reflect.ownKeys(he(e)),set(e,t,n){const r=Te(he(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=Ve(he(e),t),s=r?.[Z];if(s&&s.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(((o=n)===(i=r)?0!==o||1/o==1/i:o!=o&&i!=i)&&(void 0!==n||le(e.base_,t)))return!0;Le(e),Re(e)}var o,i;return e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==Ve(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,Le(e),Re(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=he(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty(){te(11)},getPrototypeOf:e=>ne(e.base_),setPrototypeOf(){te(12)}},Ie={};function Ve(e,t){const n=e[Z];return(n?he(n):e)[t]}function Te(e,t){if(!(t in e))return;let n=ne(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=ne(n)}}function Re(e){e.modified_||(e.modified_=!0,e.parent_&&Re(e.parent_))}function Le(e){e.copy_||(e.copy_=ye(e.base_,e.scope_.immer_.useStrictShallowCopy_))}ce(Ce,(e,t)=>{Ie[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Ie.deleteProperty=function(e,t){return"production"!==process.env.NODE_ENV&&isNaN(parseInt(t))&&te(13),Ie.set.call(this,e,t,void 0)},Ie.set=function(e,t,n){return"production"!==process.env.NODE_ENV&&"length"!==t&&isNaN(parseInt(t))&&te(14),Ce.set.call(this,e[0],t,n,e[0])};function Ke(e,t){const n=pe(e)?xe("MapSet").proxyMap_(e,t):fe(e)?xe("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:_e(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=Ce;n&&(o=[r],i=Ie);const{revoke:s,proxy:a}=Proxy.revocable(o,i);return r.draft_=a,r.revoke_=s,a}(e,t);return(t?t.scope_:_e()).drafts_.push(n),n}function Fe(e){if(!oe(e)||ve(e))return e;const t=e[Z];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=ye(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=ye(e,!0);return ce(n,(e,t)=>{de(n,e,Fe(t))},r),t&&(t.finalized_=!1),n}var Be=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(e,t,n)=>{if("function"==typeof e&&"function"!=typeof t){const n=t;t=e;const r=this;return function(e=n,...o){return r.produce(e,e=>t.call(this,e,...o))}}let r;if("function"!=typeof t&&te(6),void 0!==n&&"function"!=typeof n&&te(7),oe(e)){const o=je(this),i=Ke(e,void 0);let s=!0;try{r=t(i),s=!1}finally{s?Se(o):Oe(o)}return Ee(o,n),Ne(r,o)}if(!e||"object"!=typeof e){if(r=t(e),void 0===r&&(r=e),r===G&&(r=void 0),this.autoFreeze_&&me(r,!0),n){const t=[],o=[];xe("Patches").generateReplacementPatches_(e,r,t,o),n(t,o)}return r}te(1,e)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),"boolean"==typeof e?.useStrictIteration&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){oe(e)||te(8),re(e)&&(e=function(e){re(e)||te(10,e);return Fe(e)}(e));const t=je(this),n=Ke(e,void 0);return n[Z].isManual_=!0,Oe(t),n}finishDraft(e,t){const n=e&&e[Z];n&&n.isManual_||te(9);const{scope_:r}=n;return Ee(r,t),Ne(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));const r=xe("Patches").applyPatches_;return re(e)?r(e,t):this.produce(e,e=>r(e,t))}};Be.produce;var Me=Be.setUseStrictIteration.bind(Be);function $e(e){return({dispatch:t,getState:n})=>r=>o=>"function"==typeof o?o(t,n,e):r(o)}var ze=$e(),qe=$e,Ue="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?Q:Q.apply(null,arguments)};function We(e){return"function"==typeof e&&"type"in e&&((t=e)&&"function"==typeof t.match);var t}function Ye(e,t){let n=0;return{measureTime(e){const t=Date.now();try{return e()}finally{const e=Date.now();n+=e-t}},warnIfExceeded(){}}}var He=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 Xe(e){return"object"!=typeof e||null==e||Object.isFrozen(e)}function Qe(e,t,n){const r=Ge(e,t,n);return{detectMutations:()=>Je(e,t,r,n)}}function Ge(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 s=r?r+"."+o:o;t.length&&-1!==t.indexOf(s)||(i.children[o]=Ge(e,t,n[o],s))}}return i}function Je(e,t=[],n,r,o=!1,i=""){const s=n?n.value:void 0,a=s===r;if(o&&!a&&!Number.isNaN(r))return{wasMutated:!0,path:i};if(e(s)||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 s=i?i+"."+o:o;if(u){if(t.some(e=>e instanceof RegExp?e.test(s):s===e))continue}const c=Je(e,t,n.children[o],r[o],a,s);if(c.wasMutated)return c}return{wasMutated:!1}}function Ze(e){const t=typeof e;return null==e||"string"===t||"boolean"===t||"number"===t||Array.isArray(e)||q(e)}function et(e,t="",n=Ze,r,o=[],i){let s;if(!n(e))return{keyPath:t||"<root>",value:e};if("object"!=typeof e||null===e)return!1;if(i?.has(e))return!1;const a=null!=r?r(e):Object.entries(e),c=o.length>0;for(const[e,u]of a){const a=t?t+"."+e:e;if(c){if(o.some(e=>e instanceof RegExp?e.test(a):a===e))continue}if(!n(u))return{keyPath:a,value:u};if("object"==typeof u&&(s=et(u,a,n,r,o,i),s))return s}return i&&tt(e)&&i.add(e),!1}function tt(e){if(!Object.isFrozen(e))return!1;for(const t of Object.values(e))if("object"==typeof t&&null!==t&&!tt(t))return!1;return!0}function nt(e={}){if("production"===process.env.NODE_ENV)return()=>e=>t=>e(t);{const{isSerializable:t=Ze,getEntries:n,ignoredActions:r=[],ignoredActionPaths:o=["meta.arg","meta.baseQueryMeta"],ignoredPaths:i=[],warnAfter:s=32,ignoreState:a=!1,ignoreActions:c=!1,disableCache:u=!1}=e,l=!u&&WeakSet?new WeakSet:void 0;return e=>s=>u=>{if(!function(e){return q(e)&&"type"in e&&"string"==typeof e.type}(u))return s(u);const d=s(u),p=Ye();return c||r.length&&-1!==r.indexOf(u.type)||p.measureTime(()=>{const e=et(u,"",t,n,o,l);if(e){const{keyPath:t,value:n}=e}}),a||(p.measureTime(()=>{const r=et(e.getState(),"",t,n,i,l);if(r){const{keyPath:e,value:t}=r}}),p.warnIfExceeded()),d}}}function rt(e){return"boolean"==typeof e}var ot=()=>function(e){const{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:o=!0}=e??{};let i=new He;if(t&&(rt(t)?i.push(ze):i.push(qe(t.extraArgument))),"production"!==process.env.NODE_ENV){if(n){let e={};rt(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 s=n.indexOf(this);~s?n.splice(s+1):n.push(this),~s?r.splice(s,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=Xe,ignoredPaths:o,warnAfter:i=32}=e;const s=Qe.bind(null,r,o);return({getState:e})=>{let n,r=e(),o=s(r);return i=>a=>{const c=Ye();c.measureTime(()=>{if(r=e(),n=o.detectMutations(),o=s(r),n.wasMutated)throw new Error("production"===process.env.NODE_ENV?ct(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 u=i(a);return c.measureTime(()=>{if(r=e(),n=o.detectMutations(),o=s(r),n.wasMutated)throw new Error("production"===process.env.NODE_ENV?ct(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(a)}. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`)}),c.warnIfExceeded(),u}}}}(e))}if(r){let e={};rt(r)||(e=r),i.push(nt(e))}if(o){let e={};rt(o)||(e=o),i.unshift(function(e={}){if("production"===process.env.NODE_ENV)return()=>e=>t=>e(t);const{isActionCreator:t=We}=e;return()=>e=>n=>(t(n),e(n))}(e))}}return i},it=e=>t=>{setTimeout(t,e)},st=e=>function(t){const{autoBatch:n=!0}=t??{};let r=new He(e);return n&&r.push(((e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let o=!0,i=!1,s=!1;const a=new Set,c="tick"===e.type?queueMicrotask:"raf"===e.type?"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:it(10):"callback"===e.type?e.queueNotification:it(e.timeout),u=()=>{s=!1,i&&(i=!1,a.forEach(e=>e()))};return Object.assign({},r,{subscribe(e){const t=r.subscribe(()=>o&&e());return a.add(e),()=>{t(),a.delete(e)}},dispatch(e){try{return o=!e?.meta?.RTK_autoBatch,i=!o,i&&(s||(s=!0,c(u))),r.dispatch(e)}finally{o=!0}}})})("object"==typeof n?n:void 0)),r};function at(e){const t=ot(),{reducer:n,middleware:r,devTools:o=!0,duplicateMiddlewareCheck:i=!0,preloadedState:s,enhancers:a}=e||{};let c,u;if("function"==typeof n)c=n;else{if(!q(n))throw new Error("production"===process.env.NODE_ENV?ct(1):"`reducer` is a required argument, and must be a function or an object of functions that can be passed to combineReducers");c=X(n)}if("production"!==process.env.NODE_ENV&&r&&"function"!=typeof r)throw new Error("production"===process.env.NODE_ENV?ct(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?ct(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?ct(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?ct(42):"Duplicate middleware references found when creating the store. Ensure that each middleware is only included once.");e.add(t)})}let l=Q;o&&(l=Ue({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?B(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")};const s={getState:o.getState,dispatch:(e,...t)=>i(e,...t)},a=e.map(e=>e(s));return i=Q(...a)(o.dispatch),{...o,dispatch:i}}}(...u),p=st(d);if("production"!==process.env.NODE_ENV&&a&&"function"!=typeof a)throw new Error("production"===process.env.NODE_ENV?ct(5):"`enhancers` field must be a callback");let f="function"==typeof a?a(p):p();if("production"!==process.env.NODE_ENV&&!Array.isArray(f))throw new Error("production"===process.env.NODE_ENV?ct(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?ct(7):"each enhancer provided to configureStore must be a function");"production"!==process.env.NODE_ENV&&u.length&&f.includes(d);return Y(c,s,l(...f))}function ct(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. `}Me(!1);var ut=o.createContext(void 0),lt=function(e){var t=e.children,o=x.useState(function(e){return e.snackbar});return n.jsxs(ut.Provider,{value:{showSnackbar:function(e,t){void 0===t&&(t="info"),x.update(function(n){n.snackbar.open=!0,n.snackbar.message=e,n.snackbar.severity=t})}},children:[t,n.jsx(r.Snackbar,{open:o.open,message:o.message,severity:o.severity,autoHideDuration:1500,onClose:function(){x.update(function(e){e.snackbar.open=!1})}})]})},dt={isOpen:!1,title:"",message:"",confirmButtonText:"",cancelButtonText:"",type:"confirm",onConfirm:function(){},onCancel:function(){}},pt=[{label:"All",value:null},{label:"REGULAR",value:"R"},{label:"SUPPLEMENTARY",value:"S"}],ft=[{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"}],ht=Array.from({length:6},function(e,t){return(new Date).getFullYear()-t});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 s.BrowserRouter}}),exports.ApplicationStore=x,exports.BatchSelector=function(e){return n.jsx(r.SingleSelect,y({label:"Batch"},e,{externalAxios:N,optionsApiEndPoint:"/dropdowns/batches"}))},exports.ConfirmDialogProvider=A,exports.CourseSelector=function(e){return n.jsx(r.SingleSelect,y({dbLabelProps:{labelKey:"courseName",subLabelKey:"level"}},e,{externalAxios:N,optionsApiEndPoint:"/dropdowns/courses"}))},exports.DepartmentMongoMultiSelector=function(e){return n.jsx(r.MultiSelect,y({dbLabelProps:{labelKey:"name",subLabelKey:"type",useSubLabelStartCase:!0},dbValueProps:{valueKey:"_id",isObjectId:!0}},e,{externalAxios:N,optionsApiEndPoint:"/dropdowns/departments"}))},exports.DepartmentSelector=function(e){return n.jsx(r.SingleSelect,y({dbLabelProps:{labelKey:"name",subLabelKey:"type",useSubLabelStartCase:!0},dbValueProps:{valueKey:"_id",isObjectId:!0}},e,{externalAxios:N,optionsApiEndPoint:"/dropdowns/departments"}))},exports.DepartmentSqlMultiSelector=function(e){return n.jsx(r.MultiSelect,y({dbLabelProps:{labelKey:"name",subLabelKey:"type",useSubLabelStartCase:!0},dbValueProps:{valueKey:"id",isInt:!0}},e,{externalAxios:N,optionsApiEndPoint:"/dropdowns/departments-sql"}))},exports.EmployeesSelector=function(e){return n.jsx(r.SingleSelect,y({dbValueProps:{valueKey:"_id",isObjectId:!0},dbLabelProps:{labelKey:"fullName",subLabelKey:"employeeId"}},e,{externalAxios:N,optionsApiEndPoint:"/dropdowns/employees"}))},exports.ErrorBoundary=function(e){var t=s.useLocation();return n.jsx(i.QueryErrorResetBoundary,{children:function(r){var o=r.reset;return n.jsx(I,{onReset:o,FallbackComponent:K,children:e.children},null==t?void 0:t.pathname)}})},exports.ExamTypeSelector=function(e){return n.jsx(r.SingleSelect,y({label:"Exam Type",options:pt},e))},exports.ExamsRegulationSelector=function(e){return n.jsx(r.SingleSelect,y({label:"Regulation"},e,{externalAxios:N,optionsApiEndPoint:"/dropdowns/exam-regulations",dbLabelProps:{labelKey:"r.name"},dbValueProps:{valueKey:"r.name"}}))},exports.FeeTypeSelector=function(e){return n.jsx(r.SingleSelect,y({label:"Fee Type",options:null==ft?void 0:ft.map(function(e){return{label:e.label,value:e.value}})},e))},exports.HostelBlockSelector=function(e){return n.jsx(r.SingleSelect,y({dbValueProps:{valueKey:"id",isInt:!0},dbLabelProps:{labelKey:"name",subLabelKey:"type",useLabelStartCase:!0,useSubLabelStartCase:!0}},e,{externalAxios:N,optionsApiEndPoint:"/dropdowns/hostel-blocks"}))},exports.HostelFloorSelector=function(e){return n.jsx(r.SingleSelect,y({label:"Hostel Room No.",dbValueProps:{valueKey:"floor"},dbLabelProps:{labelKey:"floor"}},e,{externalAxios:N,optionsApiEndPoint:"dropdowns/floors"}))},exports.HostelRoomSelector=function(e){return n.jsx(r.SingleSelect,y({label:"Hostel Room",dbValueProps:{valueKey:"id"},dbLabelProps:{labelKey:"room_number",useLabelStartCase:!0}},e,{optionsApiEndPoint:"dropdowns/hostel-rooms",externalAxios:N}))},exports.MonthYearSelector=function(e){return n.jsx(r.SingleSelect,y({label:"Month & Year"},e,{externalAxios:N,optionsApiEndPoint:"/dropdowns/month-years"}))},exports.PrintFormatSelector=function(e){return n.jsx(r.SingleSelect,y({dbLabelProps:{labelKey:"name",subLabelKey:"type",useSubLabelStartCase:!0}},e,{externalAxios:N,optionsApiEndPoint:"/dropdowns/print-formats"}))},exports.ProgramSelector=function(e){return n.jsx(r.SingleSelect,y({dbLabelProps:{labelKey:"branchCode",subLabelKey:"branchDisplay"}},e,{externalAxios:N,optionsApiEndPoint:"/dropdowns/programs"}))},exports.Providers=function(e){var t=e.children,r=e.basename,a=e.reducers,c=void 0===a?{}:a,u=new i.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:!1,useErrorBoundary:!0}}}),l=E&&S&&O?"/".concat(S,"/").concat(O):"/";o.useEffect(function(){"/"===window.location.pathname&&S&&O&&E&&window.location.replace(window.location.origin+"/".concat(S,"/").concat(O))},[S,E,O]);var p=at({reducer:X(c)});return n.jsx(d.Provider,{store:p,children:n.jsx(s.BrowserRouter,{basename:null!=r?r:l,children:n.jsx(i.QueryClientProvider,{client:u,children:n.jsx(lt,{children:n.jsx(A,{children:t})})})})})},exports.RegulationSelector=function(e){return n.jsx(r.SingleSelect,y({label:"Regulation",dbValueProps:{valueKey:"regulation_id"},dbLabelProps:{labelKey:"r.name"}},e,{optionsApiEndPoint:"dropdowns/regulations",externalAxios:N}))},exports.ResearchExpertDesignationSelector=function(e){return n.jsx(r.SingleSelect,y({dbLabelProps:{labelKey:"name"},dbValueProps:{valueKey:"id",isInt:!0}},e,{externalAxios:N,optionsApiEndPoint:"/dropdowns/research-expert-designations"}))},exports.ResearchExpertSelector=function(e){return n.jsx(r.SingleSelect,y({dbValueProps:{valueKey:"id"},dbLabelProps:{labelKey:"name",subLabelKey:"type"}},e,{optionsApiEndPoint:"dropdowns/research-experts",externalAxios:N}))},exports.ResearchStageSelector=function(e){return n.jsx(r.SingleSelect,y({dbValueProps:{valueKey:"id"},dbLabelProps:{labelKey:"name",subLabelKey:"`order`"}},e,{optionsApiEndPoint:"dropdowns/research-stages",externalAxios:N}))},exports.SemesterSelector=function(e){return n.jsx(r.SingleSelect,y({dbLabelProps:{labelKey:"name",subLabelKey:"year"}},e,{optionsApiEndPoint:"/dropdowns/semesters",externalAxios:N}))},exports.SnackbarProvider=lt,exports.StudentSelector=function(e){return n.jsx(r.SingleSelect,y({dbLabelProps:{labelKey:"slug",useLabelStartCase:!0},dbValueProps:{valueKey:"id"}},e,{externalAxios:N,optionsApiEndPoint:"/dropdowns/students"}))},exports.StudentServicesSelector=function(e){return n.jsx(r.SingleSelect,y({dbLabelProps:{labelKey:"slug",useLabelStartCase:!0},dbValueProps:{valueKey:"id"}},e,{externalAxios:N,optionsApiEndPoint:"/dropdowns/student-services"}))},exports.YearRangeSelector=function(e){var t=e.suffix,o=void 0===t?null:t,i=e.valueKey,s=void 0===i?"yearRange":i,a=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}(e,["suffix","valueKey"]);return n.jsx(r.SingleSelect,y({label:"Year Range",options:null==ht?void 0:ht.map(function(e){return{label:o?"".concat(o," ").concat(e," - ").concat(e+1):"".concat(e," - ").concat(e+1),value:"yearRange"===s?"".concat(e," - ").concat(e+1):e}})},a))},exports.axios=k,exports.createRsbuildSharedConfig=function(e,t,n){return n.reduce(function(n,r){var o=e[r];return o&&(n[r]=y({singleton:!0,requiredVersion:o,version:o.replace(/^[\^~]/,"")},t.includes(r)?{eager:!0}:{})),n},{})},exports.initialApplicationState=w,exports.institutionCode=S,exports.isDevelopment=_,exports.nonWorkspaceAxios=N,exports.openInNewTab=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=window.location.pathname.split("/"),o=[];!t&&r[1]&&o.push(r[1]),!n&&r[2]&&o.push(r[2]);var i=o.length>0?"/"+o.join("/"):"",s="".concat(window.location.origin).concat(i,"/").concat(e);window.open(s,"_blank")},exports.tenantCode=E,exports.useConfirm=function(){var e=function(){x.update(function(e){e.confirmDialog=dt})};return function(t){var n=t.title,r=t.message,o=t.confirmButtonText,i=t.cancelButtonText,s=t.type,a=void 0===s?"confirm":s;return new Promise(function(t){x.update(function(s){s.confirmDialog={isOpen:!0,title:n,message:r,confirmButtonText:o,cancelButtonText:i,type:a,onConfirm:function(){t(!0),e()},onCancel:function(){t(!1),e()}}})})}},exports.workspace=O,exports.workspaceApiMapping=j;
1
+ "use strict";var e=require("axios"),t=require("js-cookie"),n=require("pullstate"),r=require("react/jsx-runtime"),o=require("@campxdev/react-blueprint"),i=require("react"),s=require("react-query"),a=require("react-router-dom"),c=require("@hookform/resolvers"),l=require("react-hook-form"),u=require("device-detector-js"),d=require("yup"),p=require("react-redux"),f=require("@exotel-npm-dev/exotel-ip-calling-crm-websdk"),h=require("react-dom"),m=require("lucide-react"),v=require("scrypt-js");function b(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 y=b(i),g=b(d),x=function(){return x=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},x.apply(this,arguments)};function w(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(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(s,a)}c((r=r.apply(e,t||[])).next())})}function E(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}"function"==typeof SuppressedError&&SuppressedError;var S={isLoginDialogOpen:!1,snackbar:{open:!1,message:"",severity:"success"},confirmDialog:{isOpen:!1,title:"",message:"",onConfirm:function(){},onCancel:function(){},type:"confirm"},user:void 0,institutionInfo:void 0,asset:void 0},N=new n.Store(S),_=window.location.hostname.includes("localhost"),j=window.location.hostname.split(".")[0],k=window.location.pathname.split("/")[1],C=window.location.pathname.split("/")[2],O={"student-workspace":"/student-api","faculty-workspace":"/faculty-api","department-workspace":"/department-api","academic-coordinator-workspace":"/academic-coordinator-api","feedback-coordinator-workspace":"/feedback-coordinator-api","course-coordinator-workspace":"/course-coordinator-api","classroom-coordinator-workspace":"/classroom-coordinator-api","coe-workspace":"/coe-api","academic-admin-workspace":"/academic-admin-api","hostel-admin-workspace":"/hostel-admin-api","transport-coordinator-workspace":"/transport-coordinator-api","employee-workspace":"/employee-api","librarian-workspace":"/librarian-api","fee-terminal":"/fee-terminal-api","accounts-officer-workspace":"accounts-officer-api","finance-officer-workspace":"finance-officer-api","outreach-agent-workspace":"outreach-agent-api","prospect-workspace":"prospect-api","external-expert-workspace":"external-expert-api","research-coordinator-workspace":"research-coordinator-api","tele-counsellor-workspace":"tele-counsellor-api","team-owner-workspace":"/team-owner-api","admissions-counsellor-workspace":"/admissions-counsellor-api","admissions-officer-workspace":"/admissions-officer-api"},P=e.create({baseURL:process.env.REACT_APP_API_HOST||"",withCredentials:!0,headers:{"x-tenant-id":j,"x-institution-code":k}});P.interceptors.request.use(function(e){var n=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);if(!1!==e.workspace&&C&&O[C]&&"common-workspace"!==C){var r=O[C];e.url="".concat(r).concat(e.url)}var o=t.get("campx_session_key"),i=t.get("campx_open_payments_key"),s=t.get("campx_student_key");return _&&o&&e.headers.set("campx_session_key",o),_&&s&&e.headers.set("campx_student_key",s),i&&e.headers.set("campx_open_payments_key",i),e.skipInstitutionCode&&e.headers.delete("x-institution-code"),x(x({},e),{params:n})},function(e){return Promise.reject(e)}),P.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)&&N.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,413].includes(null===(r=e.response)||void 0===r?void 0:r.status)&&N.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)&&N.update(function(t){t.snackbar.open=!0,t.snackbar.message=e.response.data.message||"Not Found",t.snackbar.severity="error"}),Promise.reject(e)});var D=e.create({baseURL:process.env.REACT_APP_API_HOST||"",withCredentials:!0,workspace:!1,headers:{"x-tenant-id":j,"x-institution-code":k}});D.interceptors.request.use(function(e){var n=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),r=t.get("campx_session_key"),o=t.get("campx_open_payments_key"),i=t.get("campx_student_key");return _&&r&&e.headers.set("campx_session_key",r),_&&i&&e.headers.set("campx_student_key",i),o&&e.headers.set("campx_open_payments_key",o),e.skipInstitutionCode&&e.headers.delete("x-institution-code"),x(x({},e),{params:n})},function(e){return Promise.reject(e)}),D.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)&&N.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)&&N.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)&&N.update(function(t){t.snackbar.open=!0,t.snackbar.message=e.response.data.message||"Not Found",t.snackbar.severity="error"}),Promise.reject(e)});var I=["admissions-officer-workspace","tele-counsellor-workspace"];function A(e){return I.includes(e)}var T=i.createContext({showConfirmDialog:function(){}}),V=function(e){var t=e.children,n=N.useState(function(e){return e.confirmDialog}),i=function(){N.update(function(e){e.confirmDialog.isOpen=!1})};return r.jsxs(T.Provider,{value:{showConfirmDialog:function(e,t,n,r,o,i,s){void 0===o&&(o="confirm"),N.update(function(a){a.confirmDialog={isOpen:!0,title:e,message:t,onConfirm:n,onCancel:r,type:o,confirmButtonText:i,cancelButtonText:s}})}},children:[t,r.jsx(o.ConfirmDialog,{isOpen:n.isOpen,title:n.title,message:n.message,type:n.type,confirmButtonText:n.confirmButtonText,cancelButtonText:n.cancelButtonText,onConfirm:function(){n.onConfirm(),i()},onCancel:function(){n.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 L={error:null},R=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=L,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(L)},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,s=this.state.error,a=this.props.resetKeys;null!==s&&null!==t.error&&(void 0===(o=e.resetKeys)&&(o=[]),void 0===(i=a)&&(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,a),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(y.isValidElement(o))return o;if("function"==typeof n)return n(i);if(r)return y.createElement(r,i);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},t}(y.Component),F=function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),function(r,o,i){try{return Promise.resolve(function(s,a){try{var l=(t.context&&process.env.NODE_ENV,Promise.resolve(e["sync"===n.mode?"validateSync":"validate"](r,Object.assign({abortEarly:!1},t,{context:o}))).then(function(e){return i.shouldUseNativeValidation&&c.validateFieldsNatively({},i),{values:n.rawValues?r:e,errors:{}}}))}catch(e){return a(e)}return l&&l.then?l.then(void 0,a):l}(0,function(e){if(!e.inner)throw e;return{values:{},errors:c.toNestError((t=e,n=!i.shouldUseNativeValidation&&"all"===i.criteriaMode,(t.inner||[]).reduce(function(e,t){if(e[t.path]||(e[t.path]={message:t.message,type:t.type}),n){var r=e[t.path].types,o=r&&r[t.type];e[t.path]=l.appendErrors(t.path,n,e,t.type,o?[].concat(o,t.message):t.message)}return e},{})),i)};var t,n}))}catch(e){return Promise.reject(e)}}},K=function(e){return w(void 0,void 0,void 0,function(){var t;return E(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,P.post("/auth-server/auth-v2/login",e,{workspace:!1}).then(function(e){return e.data})]}})})},q=g.object().shape({username:g.string().required("Username is required"),password:g.string().required("Password is required")}),B=function(e){var n=e.close,c=i.useState({deviceInformation:{deviceType:"browser",clientName:"unknown",os:"unknown",osVersion:"unknown",latitude:null,longitude:null,tokenType:"WEB"},isLocationAllowed:!0}),d=c[0],p=c[1],f=a.useNavigate();i.useEffect(function(){navigator.geolocation.getCurrentPosition(function(e){p(function(t){return x(x({},t),{deviceInformation:x(x({},t.deviceInformation),{latitude:e.coords.latitude,longitude:e.coords.longitude})})})}),navigator.permissions.query({name:"geolocation"}).then(function(e){"denied"===e.state&&p(function(e){return x(x({},e),{isLocationAllowed:!1})})});var e=(new u).parse(navigator.userAgent);p(function(t){var n,r,o;return x(x({},t),{deviceInformation:x(x({},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 h=l.useForm({resolver:F(q)}),m=h.handleSubmit,v=h.control,b=h.formState.errors,y=s.useMutation(K,{onSuccess:function(e){_&&(t.remove("campx_session_key"),t.set("campx_session_key",e.session.token),n(),f("/".concat(e.session.institutionCode,"/workspace")),window.location.reload())}}),g=y.mutate,S=y.isLoading;return r.jsxs("div",{className:"flex flex-col gap-8 justify-center items-center p-8",children:[r.jsx("div",{className:"flex items-center justify-center h-9 w-48",children:r.jsx(o.Icons.CampxFullLogoIcon,{})}),r.jsxs("div",{className:"flex flex-col gap-4 w-full max-w-[400px]",children:[r.jsx(l.Controller,{control:v,render:function(e){var t=e.field;return r.jsx(o.TextField,{name:"username",placeholder:"Enter Username or Email",onChange:t.onChange,label:"Username or Email",error:!!b.username,required:!0,fullWidth:!0})},name:"username"}),r.jsx(l.Controller,{control:v,render:function(e){var t=e.field;return r.jsx(o.PasswordField,{name:"password",placeholder:"Enter password",onChange:t.onChange,label:"Password",error:!!b.password,required:!0,fullWidth:!0})},name:"password"}),r.jsx(o.Button,{type:"submit",color:"primary",variant:"default",onClick:m(function(e){return w(void 0,void 0,void 0,function(){return E(this,function(t){return g(x(x(x({},e),d.deviceInformation),{loginId:e.username,loginType:"USER"})),[2]})})}),disabled:S,loading:S,fullWidth:!0,children:"Login"})]})]})},z=function(e){var t,n,i,s,a,c,l,u=e.error,d=e.resetErrorBoundary;if(null===(t=null==u?void 0:u.response)||void 0===t?void 0:t.status)switch(null===(n=null==u?void 0:u.response)||void 0===n?void 0:n.status){case 401:return r.jsx(U,{});case 500:return r.jsx(o.InternalServerError,{resetBoundary:d});case 404:return r.jsx(o.ResourceNotFound,{message:null===(s=null===(i=null==u?void 0:u.response)||void 0===i?void 0:i.data)||void 0===s?void 0:s.message})}return"ERR_NETWORK"===(null==u?void 0:u.code)?r.jsx(o.NoInterneConnection,{resetBoundary:d}):r.jsx("div",{className:"mt-4 p-5",children:r.jsxs("div",{className:"relative h-15 border border-red-200 bg-red-50 flex items-center rounded-md px-2",children:[r.jsx("div",{className:"flex-1 text-red-700 bg-transparent",children:null!==(l=null===(c=null===(a=null==u?void 0:u.response)||void 0===a?void 0:a.data)||void 0===c?void 0:c.message)&&void 0!==l?l:null==u?void 0:u.message}),r.jsx(o.Button,{onClick:function(){return d()},size:"sm",variant:"link",className:"hover:no-underline text-destructive",children:"Try Again"})]})})},U=function(){var e=a.useNavigate(),n=i.useState(!1),s=n[0],c=n[1],l=t.get("campx_session_key");return r.jsx(o.UnAuthorized,{component:r.jsxs(r.Fragment,{children:[r.jsx(o.Button,{className:"mt-5",variant:"default",onClick:function(){"localhost"===window.location.hostname.split(".")[1]?c(!0):l||e("prospect-workspace"===C?"".concat(k,"/ats/login"):"/auth/login")},children:"Click Here To Login"}),r.jsx(o.Dialog,{open:s,onClose:function(){return c(!1)},content:function(e){var t=e.close;return r.jsx(B,{close:t})}})]})})};function $(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 W=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),H=()=>Math.random().toString(36).substring(7).split("").join("."),Y={INIT:`@@redux/INIT${H()}`,REPLACE:`@@redux/REPLACE${H()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${H()}`};function X(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 Q(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 G(e){let t=typeof e;return"production"!==process.env.NODE_ENV&&(t=Q(e)),t}function J(e,t,n){if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?$(2):`Expected the root reducer to be a function. Instead, received: '${G(e)}'`);if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error("production"===process.env.NODE_ENV?$(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?$(1):`Expected the enhancer to be a function. Instead, received: '${G(n)}'`);return n(J)(e,t)}let r=e,o=t,i=new Map,s=i,a=0,c=!1;function l(){s===i&&(s=new Map,i.forEach((e,t)=>{s.set(t,e)}))}function u(){if(c)throw new Error("production"===process.env.NODE_ENV?$(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?$(4):`Expected the listener to be a function. Instead, received: '${G(e)}'`);if(c)throw new Error("production"===process.env.NODE_ENV?$(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;l();const n=a++;return s.set(n,e),function(){if(t){if(c)throw new Error("production"===process.env.NODE_ENV?$(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,l(),s.delete(n),i=null}}}function p(e){if(!X(e))throw new Error("production"===process.env.NODE_ENV?$(7):`Actions must be plain objects. Instead, the actual type was: '${G(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?$(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?$(17):`Action "type" property must be a string. Instead, the actual type was: '${G(e.type)}'. Value was: '${e.type}' (stringified)`);if(c)throw new Error("production"===process.env.NODE_ENV?$(9):"Reducers may not dispatch actions.");try{c=!0,o=r(o,e)}finally{c=!1}return(i=s).forEach(e=>{e()}),e}p({type:Y.INIT});return{dispatch:p,subscribe:d,getState:u,replaceReducer:function(e){if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?$(10):`Expected the nextReducer to be a function. Instead, received: '${G(e)}`);r=e,p({type:Y.REPLACE})},[W]:function(){const e=d;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error("production"===process.env.NODE_ENV?$(11):`Expected the observer to be an object. Instead, received: '${G(t)}'`);function n(){const e=t;e.next&&e.next(u())}n();return{unsubscribe:e(n)}},[W](){return this}}}}}function Z(e){"undefined"!=typeof console&&console.error;try{throw new Error(e)}catch(e){}}function ee(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]&&Z(`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:Y.INIT}))throw new Error("production"===process.env.NODE_ENV?$(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:Y.PROBE_UNKNOWN_ACTION()}))throw new Error("production"===process.env.NODE_ENV?$(13):`The slice reducer for key "${t}" returned undefined when probed with a random type. Don't try to handle '${Y.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===Y.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(!X(e))return`The ${i} has unexpected type of "${G(e)}". Expected argument to be an object with the following keys: "${o.join('", "')}"`;const s=Object.keys(e).filter(e=>!t.hasOwnProperty(e)&&!r[e]);return s.forEach(e=>{r[e]=!0}),n&&n.type===Y.REPLACE?void 0:s.length>0?`Unexpected ${s.length>1?"keys":"key"} "${s.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&&Z(r)}let s=!1;const a={};for(let o=0;o<r.length;o++){const i=r[o],c=n[i],l=e[i],u=c(l,t);if(void 0===u){const e=t&&t.type;throw new Error("production"===process.env.NODE_ENV?$(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.`)}a[i]=u,s=s||u!==l}return s=s||r.length!==Object.keys(e).length,s?a:e}}function te(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce((e,t)=>(...n)=>e(t(...n)))}var ne=Symbol.for("immer-nothing"),re=Symbol.for("immer-draftable"),oe=Symbol.for("immer-state"),ie="production"!==process.env.NODE_ENV?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function se(e,...t){if("production"!==process.env.NODE_ENV){const n=ie[e],r="function"==typeof n?n.apply(null,t):n;throw new Error(`[Immer] ${r}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ae=Object.getPrototypeOf;function ce(e){return!!e&&!!e[oe]}function le(e){return!!e&&(pe(e)||Array.isArray(e)||!!e[re]||!!e.constructor?.[re]||be(e)||ye(e))}var ue=Object.prototype.constructor.toString(),de=new WeakMap;function pe(e){if(!e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);if(null===t||t===Object.prototype)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(n===Object)return!0;if("function"!=typeof n)return!1;let r=de.get(n);return void 0===r&&(r=Function.toString.call(n),de.set(n,r)),r===ue}function fe(e,t,n=!0){if(0===he(e)){(n?Reflect.ownKeys(e):Object.keys(e)).forEach(n=>{t(n,e[n],e)})}else e.forEach((n,r)=>t(r,n,e))}function he(e){const t=e[oe];return t?t.type_:Array.isArray(e)?1:be(e)?2:ye(e)?3:0}function me(e,t){return 2===he(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function ve(e,t,n){const r=he(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function be(e){return e instanceof Map}function ye(e){return e instanceof Set}function ge(e){return e.copy_||e.base_}function xe(e,t){if(be(e))return new Map(e);if(ye(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=pe(e);if(!0===t||"class_only"===t&&!n){const t=Object.getOwnPropertyDescriptors(e);delete t[oe];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){const o=n[r],i=t[o];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(t[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[o]})}return Object.create(ae(e),t)}{const t=ae(e);if(null!==t&&n)return{...e};const r=Object.create(t);return Object.assign(r,e)}}function we(e,t=!1){return Se(e)||ce(e)||!le(e)||(he(e)>1&&Object.defineProperties(e,{set:Ee,add:Ee,clear:Ee,delete:Ee}),Object.freeze(e),t&&Object.values(e).forEach(e=>we(e,!0))),e}var Ee={value:function(){se(2)}};function Se(e){return null===e||"object"!=typeof e||Object.isFrozen(e)}var Ne,_e={};function je(e){const t=_e[e];return t||se(0,e),t}function ke(){return Ne}function Ce(e,t){t&&(je("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Oe(e){Pe(e),e.drafts_.forEach(Ie),e.drafts_=null}function Pe(e){e===Ne&&(Ne=e.parent_)}function De(e){return Ne={drafts_:[],parent_:Ne,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Ie(e){const t=e[oe];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Ae(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[oe].modified_&&(Oe(t),se(4)),le(e)&&(e=Te(t,e),t.parent_||Me(t,e)),t.patches_&&je("Patches").generateReplacementPatches_(n[oe].base_,e,t.patches_,t.inversePatches_)):e=Te(t,n,[]),Oe(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==ne?e:void 0}function Te(e,t,n){if(Se(t))return t;const r=e.immer_.shouldUseStrictIteration(),o=t[oe];if(!o)return fe(t,(r,i)=>Ve(e,o,t,r,i,n),r),t;if(o.scope_!==e)return t;if(!o.modified_)return Me(e,o.base_,!0),o.base_;if(!o.finalized_){o.finalized_=!0,o.scope_.unfinalizedDrafts_--;const t=o.copy_;let i=t,s=!1;3===o.type_&&(i=new Set(t),t.clear(),s=!0),fe(i,(r,i)=>Ve(e,o,t,r,i,n,s),r),Me(e,t,!1),n&&e.patches_&&je("Patches").generatePatches_(o,n,e.patches_,e.inversePatches_)}return o.copy_}function Ve(e,t,n,r,o,i,s){if(null==o)return;if("object"!=typeof o&&!s)return;const a=Se(o);if(!a||s){if("production"!==process.env.NODE_ENV&&o===n&&se(5),ce(o)){const s=Te(e,o,i&&t&&3!==t.type_&&!me(t.assigned_,r)?i.concat(r):void 0);if(ve(n,r,s),!ce(s))return;e.canAutoFreeze_=!1}else s&&n.add(o);if(le(o)&&!a){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;if(t&&t.base_&&t.base_[r]===o&&a)return;Te(e,o),t&&t.scope_.parent_||"symbol"==typeof r||!(be(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))||Me(e,o)}}}function Me(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&we(t,n)}var Le={get(e,t){if(t===oe)return e;const n=ge(e);if(!me(n,t))return function(e,t,n){const r=Ke(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}(e,n,t);const r=n[t];return e.finalized_||!le(r)?r:r===Fe(e.base_,t)?(Be(e),e.copy_[t]=ze(r,e)):r},has:(e,t)=>t in ge(e),ownKeys:e=>Reflect.ownKeys(ge(e)),set(e,t,n){const r=Ke(ge(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=Fe(ge(e),t),s=r?.[oe];if(s&&s.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(((o=n)===(i=r)?0!==o||1/o==1/i:o!=o&&i!=i)&&(void 0!==n||me(e.base_,t)))return!0;Be(e),qe(e)}var o,i;return e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==Fe(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,Be(e),qe(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=ge(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty(){se(11)},getPrototypeOf:e=>ae(e.base_),setPrototypeOf(){se(12)}},Re={};function Fe(e,t){const n=e[oe];return(n?ge(n):e)[t]}function Ke(e,t){if(!(t in e))return;let n=ae(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=ae(n)}}function qe(e){e.modified_||(e.modified_=!0,e.parent_&&qe(e.parent_))}function Be(e){e.copy_||(e.copy_=xe(e.base_,e.scope_.immer_.useStrictShallowCopy_))}fe(Le,(e,t)=>{Re[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Re.deleteProperty=function(e,t){return"production"!==process.env.NODE_ENV&&isNaN(parseInt(t))&&se(13),Re.set.call(this,e,t,void 0)},Re.set=function(e,t,n){return"production"!==process.env.NODE_ENV&&"length"!==t&&isNaN(parseInt(t))&&se(14),Le.set.call(this,e[0],t,n,e[0])};function ze(e,t){const n=be(e)?je("MapSet").proxyMap_(e,t):ye(e)?je("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:ke(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=Le;n&&(o=[r],i=Re);const{revoke:s,proxy:a}=Proxy.revocable(o,i);return r.draft_=a,r.revoke_=s,a}(e,t);return(t?t.scope_:ke()).drafts_.push(n),n}function Ue(e){if(!le(e)||Se(e))return e;const t=e[oe];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=xe(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=xe(e,!0);return fe(n,(e,t)=>{ve(n,e,Ue(t))},r),t&&(t.finalized_=!1),n}var $e=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(e,t,n)=>{if("function"==typeof e&&"function"!=typeof t){const n=t;t=e;const r=this;return function(e=n,...o){return r.produce(e,e=>t.call(this,e,...o))}}let r;if("function"!=typeof t&&se(6),void 0!==n&&"function"!=typeof n&&se(7),le(e)){const o=De(this),i=ze(e,void 0);let s=!0;try{r=t(i),s=!1}finally{s?Oe(o):Pe(o)}return Ce(o,n),Ae(r,o)}if(!e||"object"!=typeof e){if(r=t(e),void 0===r&&(r=e),r===ne&&(r=void 0),this.autoFreeze_&&we(r,!0),n){const t=[],o=[];je("Patches").generateReplacementPatches_(e,r,t,o),n(t,o)}return r}se(1,e)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),"boolean"==typeof e?.useStrictIteration&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){le(e)||se(8),ce(e)&&(e=function(e){ce(e)||se(10,e);return Ue(e)}(e));const t=De(this),n=ze(e,void 0);return n[oe].isManual_=!0,Pe(t),n}finishDraft(e,t){const n=e&&e[oe];n&&n.isManual_||se(9);const{scope_:r}=n;return Ce(r,t),Ae(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));const r=je("Patches").applyPatches_;return ce(e)?r(e,t):this.produce(e,e=>r(e,t))}};$e.produce;var We=$e.setUseStrictIteration.bind($e);function He(e){return({dispatch:t,getState:n})=>r=>o=>"function"==typeof o?o(t,n,e):r(o)}var Ye=He(),Xe=He,Qe="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?te:te.apply(null,arguments)};function Ge(e){return"function"==typeof e&&"type"in e&&((t=e)&&"function"==typeof t.match);var t}function Je(e,t){let n=0;return{measureTime(e){const t=Date.now();try{return e()}finally{const e=Date.now();n+=e-t}},warnIfExceeded(){}}}var Ze=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 et(e){return"object"!=typeof e||null==e||Object.isFrozen(e)}function tt(e,t,n){const r=nt(e,t,n);return{detectMutations:()=>rt(e,t,r,n)}}function nt(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 s=r?r+"."+o:o;t.length&&-1!==t.indexOf(s)||(i.children[o]=nt(e,t,n[o],s))}}return i}function rt(e,t=[],n,r,o=!1,i=""){const s=n?n.value:void 0,a=s===r;if(o&&!a&&!Number.isNaN(r))return{wasMutated:!0,path:i};if(e(s)||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 l=t.length>0;for(let o in c){const s=i?i+"."+o:o;if(l){if(t.some(e=>e instanceof RegExp?e.test(s):s===e))continue}const c=rt(e,t,n.children[o],r[o],a,s);if(c.wasMutated)return c}return{wasMutated:!1}}function ot(e){const t=typeof e;return null==e||"string"===t||"boolean"===t||"number"===t||Array.isArray(e)||X(e)}function it(e,t="",n=ot,r,o=[],i){let s;if(!n(e))return{keyPath:t||"<root>",value:e};if("object"!=typeof e||null===e)return!1;if(i?.has(e))return!1;const a=null!=r?r(e):Object.entries(e),c=o.length>0;for(const[e,l]of a){const a=t?t+"."+e:e;if(c){if(o.some(e=>e instanceof RegExp?e.test(a):a===e))continue}if(!n(l))return{keyPath:a,value:l};if("object"==typeof l&&(s=it(l,a,n,r,o,i),s))return s}return i&&st(e)&&i.add(e),!1}function st(e){if(!Object.isFrozen(e))return!1;for(const t of Object.values(e))if("object"==typeof t&&null!==t&&!st(t))return!1;return!0}function at(e={}){if("production"===process.env.NODE_ENV)return()=>e=>t=>e(t);{const{isSerializable:t=ot,getEntries:n,ignoredActions:r=[],ignoredActionPaths:o=["meta.arg","meta.baseQueryMeta"],ignoredPaths:i=[],warnAfter:s=32,ignoreState:a=!1,ignoreActions:c=!1,disableCache:l=!1}=e,u=!l&&WeakSet?new WeakSet:void 0;return e=>s=>l=>{if(!function(e){return X(e)&&"type"in e&&"string"==typeof e.type}(l))return s(l);const d=s(l),p=Je();return c||r.length&&-1!==r.indexOf(l.type)||p.measureTime(()=>{const e=it(l,"",t,n,o,u);if(e){const{keyPath:t,value:n}=e}}),a||(p.measureTime(()=>{const r=it(e.getState(),"",t,n,i,u);if(r){const{keyPath:e,value:t}=r}}),p.warnIfExceeded()),d}}}function ct(e){return"boolean"==typeof e}var lt=()=>function(e){const{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:o=!0}=e??{};let i=new Ze;if(t&&(ct(t)?i.push(Ye):i.push(Xe(t.extraArgument))),"production"!==process.env.NODE_ENV){if(n){let e={};ct(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 s=n.indexOf(this);~s?n.splice(s+1):n.push(this),~s?r.splice(s,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=et,ignoredPaths:o,warnAfter:i=32}=e;const s=tt.bind(null,r,o);return({getState:e})=>{let n,r=e(),o=s(r);return i=>a=>{const c=Je();c.measureTime(()=>{if(r=e(),n=o.detectMutations(),o=s(r),n.wasMutated)throw new Error("production"===process.env.NODE_ENV?ft(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=i(a);return c.measureTime(()=>{if(r=e(),n=o.detectMutations(),o=s(r),n.wasMutated)throw new Error("production"===process.env.NODE_ENV?ft(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(a)}. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`)}),c.warnIfExceeded(),l}}}}(e))}if(r){let e={};ct(r)||(e=r),i.push(at(e))}if(o){let e={};ct(o)||(e=o),i.unshift(function(e={}){if("production"===process.env.NODE_ENV)return()=>e=>t=>e(t);const{isActionCreator:t=Ge}=e;return()=>e=>n=>(t(n),e(n))}(e))}}return i},ut=e=>t=>{setTimeout(t,e)},dt=e=>function(t){const{autoBatch:n=!0}=t??{};let r=new Ze(e);return n&&r.push(((e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let o=!0,i=!1,s=!1;const a=new Set,c="tick"===e.type?queueMicrotask:"raf"===e.type?"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:ut(10):"callback"===e.type?e.queueNotification:ut(e.timeout),l=()=>{s=!1,i&&(i=!1,a.forEach(e=>e()))};return Object.assign({},r,{subscribe(e){const t=r.subscribe(()=>o&&e());return a.add(e),()=>{t(),a.delete(e)}},dispatch(e){try{return o=!e?.meta?.RTK_autoBatch,i=!o,i&&(s||(s=!0,c(l))),r.dispatch(e)}finally{o=!0}}})})("object"==typeof n?n:void 0)),r};function pt(e){const t=lt(),{reducer:n,middleware:r,devTools:o=!0,duplicateMiddlewareCheck:i=!0,preloadedState:s,enhancers:a}=e||{};let c,l;if("function"==typeof n)c=n;else{if(!X(n))throw new Error("production"===process.env.NODE_ENV?ft(1):"`reducer` is a required argument, and must be a function or an object of functions that can be passed to combineReducers");c=ee(n)}if("production"!==process.env.NODE_ENV&&r&&"function"!=typeof r)throw new Error("production"===process.env.NODE_ENV?ft(2):"`middleware` field must be a callback");if("function"==typeof r){if(l=r(t),"production"!==process.env.NODE_ENV&&!Array.isArray(l))throw new Error("production"===process.env.NODE_ENV?ft(3):"when using a middleware builder function, an array of middleware must be returned")}else l=t();if("production"!==process.env.NODE_ENV&&l.some(e=>"function"!=typeof e))throw new Error("production"===process.env.NODE_ENV?ft(4):"each middleware provided to configureStore must be a function");if("production"!==process.env.NODE_ENV&&i){let e=new Set;l.forEach(t=>{if(e.has(t))throw new Error("production"===process.env.NODE_ENV?ft(42):"Duplicate middleware references found when creating the store. Ensure that each middleware is only included once.");e.add(t)})}let u=te;o&&(u=Qe({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?$(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")};const s={getState:o.getState,dispatch:(e,...t)=>i(e,...t)},a=e.map(e=>e(s));return i=te(...a)(o.dispatch),{...o,dispatch:i}}}(...l),p=dt(d);if("production"!==process.env.NODE_ENV&&a&&"function"!=typeof a)throw new Error("production"===process.env.NODE_ENV?ft(5):"`enhancers` field must be a callback");let f="function"==typeof a?a(p):p();if("production"!==process.env.NODE_ENV&&!Array.isArray(f))throw new Error("production"===process.env.NODE_ENV?ft(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?ft(7):"each enhancer provided to configureStore must be a function");"production"!==process.env.NODE_ENV&&l.length&&f.includes(d);return J(c,s,u(...f))}function ft(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. `}We(!1);var ht=i.createContext(void 0),mt=function(e){var t=e.children,n=N.useState(function(e){return e.snackbar});return r.jsxs(ht.Provider,{value:{showSnackbar:function(e,t){void 0===t&&(t="info"),N.update(function(n){n.snackbar.open=!0,n.snackbar.message=e,n.snackbar.severity=t})}},children:[t,r.jsx(o.Snackbar,{open:n.open,message:n.message,severity:n.severity,autoHideDuration:1500,onClose:function(){N.update(function(e){e.snackbar.open=!1})}})]})},vt={isOpen:!1,title:"",message:"",confirmButtonText:"",cancelButtonText:"",type:"confirm",onConfirm:function(){},onCancel:function(){}},bt=[{label:"All",value:null},{label:"REGULAR",value:"R"},{label:"SUPPLEMENTARY",value:"S"}],yt=[{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"}],gt=Array.from({length:6},function(e,t){return(new Date).getFullYear()-t});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)}});var xt=function(){function e(){var e=this;this.exotelSDK=null,this.webPhone=null,this.callListeners=new Set,this.registerListeners=new Set,this.sessionListeners=new Set,this.permissionStatus="unknown",this.handleCallEvent=function(t,n){e.callListeners.forEach(function(e){return e(t,n)})},this.handleRegisterEvent=function(t){e.registerListeners.forEach(function(e){return e(t)})},this.handleSessionEvent=function(t,n){e.sessionListeners.forEach(function(e){return e(t,n)})}}return e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},e.prototype.initialize=function(e,t){return w(this,arguments,void 0,function(e,t,n){var r;return void 0===n&&(n=!0),E(this,function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),[4,this.checkAudioPermissions()];case 1:return o.sent(),this.exotelSDK=new f(e,t,n),[4,this.exotelSDK.Initialize(this.handleCallEvent,this.handleRegisterEvent,this.handleSessionEvent)];case 2:return r=o.sent(),this.webPhone=r||null,[2,!!this.webPhone];case 3:return o.sent(),[2,!1];case 4:return[2]}})})},e.prototype.checkAudioPermissions=function(){return w(this,void 0,void 0,function(){var e,t,n=this;return E(this,function(r){switch(r.label){case 0:return r.trys.push([0,6,,7]),[4,navigator.mediaDevices.enumerateDevices()];case 1:if(e=r.sent(),!e.some(function(e){return"audioinput"===e.kind}))return this.permissionStatus="denied",[2,!1];if(!navigator.permissions||!navigator.permissions.query)return[3,5];r.label=2;case 2:return r.trys.push([2,4,,5]),[4,navigator.permissions.query({name:"microphone"})];case 3:return t=r.sent(),this.permissionStatus=t.state,t.onchange=function(){n.permissionStatus=t.state},[2,"granted"===t.state];case 4:return r.sent(),[3,5];case 5:return[2,!0];case 6:return r.sent(),[2,!1];case 7:return[2]}})})},e.prototype.requestMicrophoneAccess=function(){return w(this,void 0,void 0,function(){return E(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,navigator.mediaDevices.getUserMedia({audio:!0})];case 1:return e.sent().getTracks().forEach(function(e){return e.stop()}),this.permissionStatus="granted",[2,!0];case 2:return e.sent(),this.permissionStatus="denied",[2,!1];case 3:return[2]}})})},e.prototype.makeCall=function(e){var t=this;return new Promise(function(n,r){t.webPhone?t.webPhone.MakeCall(e,function(e,t){"success"===e?n(t):r(t)}):r(new Error("Web phone not initialized"))})},e.prototype.acceptCall=function(){return w(this,void 0,void 0,function(){return E(this,function(e){switch(e.label){case 0:if(!this.webPhone)throw new Error("Web phone not initialized");return"granted"===this.permissionStatus?[3,2]:[4,this.requestMicrophoneAccess()];case 1:if(!e.sent())throw new Error("Microphone access denied");e.label=2;case 2:return this.webPhone.AcceptCall(),[2]}})})},e.prototype.hangupCall=function(){var e;null===(e=this.webPhone)||void 0===e||e.HangupCall()},e.prototype.rejectCall=function(){var e;null===(e=this.webPhone)||void 0===e||e.HangupCall()},e.prototype.toggleHold=function(){var e;null===(e=this.webPhone)||void 0===e||e.ToggleHold()},e.prototype.toggleMute=function(){var e;null===(e=this.webPhone)||void 0===e||e.ToggleMute()},e.prototype.sendDTMF=function(e){var t;null===(t=this.webPhone)||void 0===t||t.SendDTMF(e)},e.prototype.registerDevice=function(){return w(this,void 0,void 0,function(){var e;return E(this,function(t){switch(t.label){case 0:return"granted"===this.permissionStatus?[3,2]:[4,this.requestMicrophoneAccess()];case 1:if(!t.sent())throw new Error("Microphone access denied");t.label=2;case 2:return null===(e=this.webPhone)||void 0===e||e.RegisterDevice(),[2]}})})},e.prototype.unregisterDevice=function(){var e;null===(e=this.webPhone)||void 0===e||e.UnRegisterDevice()},e.prototype.getPermissionStatus=function(){return this.permissionStatus},e.prototype.addCallListener=function(e){this.callListeners.add(e)},e.prototype.removeCallListener=function(e){this.callListeners.delete(e)},e.prototype.addRegisterListener=function(e){this.registerListeners.add(e)},e.prototype.removeRegisterListener=function(e){this.registerListeners.delete(e)},e.prototype.addSessionListener=function(e){this.sessionListeners.add(e)},e.prototype.removeSessionListener=function(e){this.sessionListeners.delete(e)},e}(),wt=function(){return w(void 0,void 0,void 0,function(){var e,t,n,r,o,i;return E(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,P.get("/notifications/notification-configs")];case 1:return e=s.sent().data,(null==(t=null==e?void 0:e.config)?void 0:t.enableVoice)?(n=null===(r=t.voiceConfigs)||void 0===r?void 0:r.find(function(e){return!0===e.isEnabled}))?[2,{enabled:!0,hasValidToken:!!((null===(o=n.EXOTEL)||void 0===o?void 0:o.token)&&(null===(i=n.EXOTEL)||void 0===i?void 0:i.tokenExpiresAt)&&new Date(n.EXOTEL.tokenExpiresAt)>new Date)}]:[2,{enabled:!1,hasValidToken:!1}]:[2,{enabled:!1,hasValidToken:!1}];case 2:return s.sent(),[2,{enabled:!1,hasValidToken:!1}];case 3:return[2]}})})},Et=function(){return w(void 0,void 0,void 0,function(){return E(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,P.get("/notifications/notification-configs/voice-config/active-token")];case 1:return[2,e.sent().data];case 2:return e.sent(),[2,null];case 3:return[2]}})})},St=function(e){return w(void 0,void 0,void 0,function(){var t;return E(this,function(n){switch(n.label){case 0:return t="common-workspace"===C?"/paymentx/call-activities":"/call-activities",[4,P.post("".concat(t,"/initiate"),e)];case 1:return[2,n.sent().data]}})})},Nt=function(e){return w(void 0,void 0,void 0,function(){var t;return E(this,function(n){switch(n.label){case 0:return t="common-workspace"===C?"/paymentx/call-activities":"/call-activities",[4,P.post("".concat(t,"/register-incoming"),e)];case 1:return[2,n.sent().data]}})})},_t=function(e){return w(void 0,void 0,void 0,function(){var t,n;return E(this,function(r){switch(r.label){case 0:return t="common-workspace"===C?"/paymentx/call-activities":"/call-activities",n={callStatusDisposition:e.callStatusDisposition,dispositionCategory:e.dispositionCategory,dispositionNotes:e.dispositionNotes,callbackScheduledAt:e.callbackScheduledAt},[4,P.post("".concat(t,"/").concat(e.callId,"/disposition"),n)];case 1:return[2,r.sent().data]}})})},jt=function(e){return w(void 0,void 0,void 0,function(){var t;return E(this,function(n){switch(n.label){case 0:return t="common-workspace"===C?"/paymentx/call-activities":"/call-activities",[4,P.post("".concat(t,"/cancel"),e)];case 1:return[2,n.sent().data]}})})},kt="__EXOTEL_CONTEXT__",Ct={phase:"idle",callData:null,isOnHold:!1,isMuted:!1,isSpeakerOff:!1,callDirection:null,callStartTime:null,callDuration:0,callerName:null,callerNumber:null,callActivityId:null,exotelCallSid:null,prospectUniqueId:null,wasAccepted:!1},Ot=function(e){if(!e||e.length<4)return"**********";var t="",n=e;e.startsWith("+91")?(t="+91",n=e.substring(3)):e.startsWith("91")&&e.length>10&&(t="91",n=e.substring(2));var r=n.replace(/\D/g,"");return r.length<4?t+"**********":t+r.substring(0,2)+"*".repeat(r.length-4)+r.substring(r.length-2)},Pt=(window[kt]||(window[kt]=i.createContext(void 0)),window[kt]),Dt=function(e){var t=e.children,n=e.accessToken,o=e.agentUserId,s=e.autoConnectVOIP,a=void 0===s||s,c=e.callerName;e.callerNumber;var l=i.useState(!1),u=l[0],d=l[1],p=i.useState(!1),f=p[0],h=p[1],m=i.useState("unknown"),v=m[0],b=m[1],y=i.useState(Ct),g=y[0],S=y[1],N=i.useState(null),_=N[0],j=N[1],k=i.useRef(null),C=i.useRef(g),O=xt.getInstance();i.useEffect(function(){C.current=g},[g]),i.useEffect(function(){return"connected"===g.phase&&g.callStartTime?k.current=setInterval(function(){S(function(e){return x(x({},e),{callDuration:Math.floor((Date.now()-e.callStartTime)/1e3)})})},1e3):k.current&&(clearInterval(k.current),k.current=null),function(){k.current&&clearInterval(k.current)}},[g.phase,g.callStartTime]),i.useEffect(function(){var e=function(){return w(void 0,void 0,void 0,function(){return E(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,navigator.mediaDevices.getUserMedia({audio:!0})];case 1:return e.sent().getTracks().forEach(function(e){return e.stop()}),b("granted"),[3,3];case 2:return e.sent(),b("denied"),[3,3];case 3:return[2]}})})};navigator.permissions&&navigator.permissions.query?navigator.permissions.query({name:"microphone"}).then(function(t){b(t.state),t.onchange=function(){b(t.state)},"prompt"===t.state&&e()}).catch(function(t){e()}):e()},[]),i.useEffect(function(){if(n&&o&&!u){w(void 0,void 0,void 0,function(){var e;return E(this,function(t){switch(t.label){case 0:return[4,O.initialize(n,o,a)];case 1:return e=t.sent(),d(e),[2]}})})}},[n,o,a]),i.useEffect(function(){if(u){var e=function(e,t){switch(e){case"incoming":if("outbound"===C.current.callDirection)S(function(e){return x(x({},e),{callData:t,isOnHold:!1,isMuted:!1})});else{var n=t.callFromNumber||t.remoteId||null;S(function(e){return x(x({},e),{phase:"incoming",callData:t,callDirection:"inbound",callerName:t.remoteDisplayName||null,callerNumber:n?Ot(n):null,isOnHold:!1,isMuted:!1})}),(t.callId||t.sessionId)&&Nt({callSid:t.callId||t.sessionId,fromNumber:t.callFromNumber||t.remoteId||"",toNumber:t.remoteDisplayName||""}).then(function(e){var t,n=null===(t=e.prospect)||void 0===t?void 0:t.mobile;S(function(t){var r,o,i;return x(x({},t),{callActivityId:(null===(r=e.data)||void 0===r?void 0:r.id)||t.callActivityId,callerName:(null===(o=e.prospect)||void 0===o?void 0:o.name)||t.callerName,callerNumber:n?Ot(n):t.callerNumber,prospectUniqueId:(null===(i=e.prospect)||void 0===i?void 0:i.uniqueId)||t.prospectUniqueId})})}).catch(function(e){})}break;case"connected":S(function(e){return x(x({},e),{phase:"connected",callData:t,callStartTime:Date.now(),callDuration:0})});break;case"callEnded":S(function(e){var n,r;if(e.wasAccepted||"connected"===e.phase||e.callDuration>0){var o={callId:e.callActivityId||t.callId||(null===(n=e.callData)||void 0===n?void 0:n.callId)||"",exotelCallId:t.callId||(null===(r=e.callData)||void 0===r?void 0:r.callId)||"",callDirection:e.callDirection||"outbound",callDuration:e.callDuration,callerName:e.callerName,callerNumber:e.callerNumber};j(o)}return x(x({},Ct),{phase:"ended",callData:t})});break;case"holdtoggle":S(function(e){return x(x({},e),{isOnHold:!e.isOnHold,callData:t})});break;case"mutetoggle":S(function(e){return x(x({},e),{isMuted:!e.isMuted,callData:t})})}},t=function(e){h("registered"===e)},n=function(e,t){};return O.addCallListener(e),O.addRegisterListener(t),O.addSessionListener(n),function(){O.removeCallListener(e),O.removeRegisterListener(t),O.removeSessionListener(n)}}},[u]),i.useEffect(function(){u&&b(O.getPermissionStatus())},[u]);var P=i.useCallback(function(e,t,n,r){return w(void 0,void 0,void 0,function(){return E(this,function(o){switch(o.label){case 0:return S(function(o){return x(x({},o),{phase:"ready_to_call",callDirection:"outbound",callerName:t||c||null,callerNumber:r||e,callActivityId:n||null,isOnHold:!1,isMuted:!1,callStartTime:null,callDuration:0})}),[4,O.makeCall(e)];case 1:return[2,o.sent()]}})})},[c]),D=i.useCallback(function(){return w(void 0,void 0,void 0,function(){return E(this,function(e){switch(e.label){case 0:return[4,O.acceptCall()];case 1:return e.sent(),S(function(e){return"outbound"===e.callDirection?x(x({},e),{phase:"calling",wasAccepted:!0}):x(x({},e),{wasAccepted:!0})}),[2]}})})},[]),I=i.useCallback(function(){O.hangupCall()},[]),A=i.useCallback(function(){S(function(e){return x(x({},e),{isSpeakerOff:!e.isSpeakerOff})})},[]),T=i.useCallback(function(){j(null),S(Ct)},[]),V=i.useCallback(function(e){S(function(t){return x(x({},t),{callActivityId:e})})},[]),M=i.useCallback(function(e){S(function(t){return x(x({},t),{exotelCallSid:e})})},[]),L={isInitialized:u,isConnected:f,callState:g,permissionStatus:v,dispositionData:_,makeCall:P,acceptCall:D,hangupCall:I,rejectCall:function(){return O.rejectCall()},toggleHold:function(){return O.toggleHold()},toggleMute:function(){return O.toggleMute()},toggleSpeaker:A,sendDTMF:function(e){return O.sendDTMF(e)},registerDevice:function(){return O.registerDevice()},unregisterDevice:function(){return O.unregisterDevice()},requestMicrophoneAccess:function(){return O.requestMicrophoneAccess()},clearDisposition:T,setCallActivityId:V,setExotelCallSid:M};return r.jsx(Pt.Provider,{value:L,children:t})},It=function(){var e=i.useContext(Pt);if(void 0===e)throw new Error("useExotel must be used within an ExotelProvider");return e},At=function(){var e=i.useContext(Pt);return null!=e?e:null},Tt=999999,Vt=999998,Mt="16px",Lt=2e3,Rt=[{label:"Connected",value:"connected"},{label:"Not Connected",value:"not_connected"}],Ft=[{label:"Interested",value:"interested"},{label:"Not Interested",value:"not_interested"},{label:"Not Sure",value:"not_sure"},{label:"Not Eligible",value:"not_eligible"},{label:"Wrong Number",value:"wrong_number"},{label:"Campus Visit",value:"campus_visit"},{label:"Call Back",value:"call_back"},{label:"After JEE Mains",value:"after_jee_mains"},{label:"After IPE",value:"after_ipe"},{label:"After EAPCET",value:"after_eapcet"}],Kt=[{label:"Not Answering",value:"not_answering"},{label:"Not Connected",value:"not_connected"},{label:"Fail to Call",value:"fail_to_call"}],qt=function(e){var t=e.dispositionData,n=e.prospectId,a=e.onClose,c=e.onSave,l=e.existingData,u=s.useQueryClient(),d=!!(null==l?void 0:l.dispositionCategory),p=i.useState((null==l?void 0:l.callStatusDisposition)||""),f=p[0],h=p[1],m=i.useState((null==l?void 0:l.dispositionCategory)||""),v=m[0],b=m[1],y=i.useState((null==l?void 0:l.dispositionNotes)||""),g=y[0],x=y[1],w=s.useMutation(function(e){return c(e)},{onSuccess:function(){u.invalidateQueries("getOneProspect"),u.invalidateQueries("callHistory"),a()}}),E=w.mutate,S=w.isLoading,N=function(e){h(e),b("")},_=function(e){b(e)},j=function(){if(f&&v){var e={prospectId:n,callId:t.callId,channel:"phone",direction:t.callDirection,duration:t.callDuration,callStatusDisposition:f,dispositionCategory:v,remarks:g||"",callerName:t.callerName||"",callerNumber:t.callerNumber||""};E(e)}},k="connected"===f?Ft:"not_connected"===f?Kt:[];return r.jsx(o.Dialog,{open:!0,onClose:a,title:d?"Edit Disposition":"Call Disposition",maxWidth:"md",content:function(){return r.jsxs("div",{className:"flex flex-col gap-4 p-4",children:[r.jsx(o.Typography,{variant:"muted",children:d?"Update the disposition details":"Add details about your call with ".concat(t.callerName||"Unknown")}),r.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-100 rounded-lg",children:[r.jsx(o.Typography,{variant:"small",className:"text-gray-600",children:"Call Duration"}),r.jsx(o.Typography,{variant:"small",className:"font-semibold",children:(e=t.callDuration,n=Math.floor(e/60),i=e%60,"".concat(n,"m ").concat(i,"s"))})]}),r.jsx(o.RadioGroup,{name:"callStatusDisposition",label:"Call Status",required:!0,options:Rt,direction:"row",value:f,onChange:N}),f&&r.jsx(o.SingleSelect,{name:"dispositionCategory",label:"Call Disposition",required:!0,fullWidth:!0,placeholder:"Search disposition...",options:k,value:v,onChange:_},f),r.jsx(o.Textarea,{name:"remarks",label:"Remarks",placeholder:"Add any additional notes about this call...",rows:3,fullWidth:!0,value:g,onChange:function(e){return x(e.target.value)},className:"break-all"}),r.jsxs("div",{className:"flex justify-start gap-2 pt-4 border-t",children:[r.jsx(o.Button,{onClick:j,disabled:!f||!v,loading:S,children:d?"Update Disposition":"Save Disposition"}),r.jsx(o.Button,{variant:"outline",onClick:a,children:"Cancel"})]})]});var e,n,i}})},Bt=function(e){var t=e.className,n=e.prospectId,s=e.prospectName,a=e.prospectNumber,c=e.onSaveDisposition,l=It(),u=l.callState,d=l.dispositionData,p=l.acceptCall,f=l.hangupCall,v=l.rejectCall,b=l.toggleHold,y=l.toggleMute,g=l.toggleSpeaker,S=l.clearDisposition,N=i.useState(!1),_=N[0],j=N[1],k=i.useState(!1),C=k[0],O=k[1],P=i.useRef(null);i.useEffect(function(){var e="exotel-phone-animations";if(!document.getElementById(e)){var t=document.createElement("style");t.id=e,t.textContent="\n@keyframes pulse-ring {\n 0% {\n transform: scale(1);\n opacity: 1;\n }\n 50% {\n transform: scale(1.15);\n opacity: 0.7;\n }\n 100% {\n transform: scale(1);\n opacity: 1;\n }\n}\n\n@keyframes pulse-dot {\n 0%, 100% {\n box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.7);\n }\n 50% {\n box-shadow: 0 0 0 20px rgba(249, 115, 22, 0);\n }\n}\n\n.animate-pulse-ring {\n animation: pulse-ring 1.5s ease-in-out infinite;\n}\n\n.animate-pulse-dot {\n animation: pulse-dot 1.5s ease-in-out infinite;\n}\n",document.head.appendChild(t)}},[]);var D=u.phase;u.callData;var I=u.isOnHold,A=u.isMuted,T=u.isSpeakerOff,V=u.callDirection,M=u.callDuration,L=u.callerName,R=u.callerNumber,F=u.callActivityId,K=u.exotelCallSid,q=u.prospectUniqueId,B=s||L||"Unknown",z=a||R||"No number",U=function(){return w(void 0,void 0,void 0,function(){var e;return E(this,function(t){switch(t.label){case 0:if(O(!0),"incoming"===D||"ready_to_call"===D?v():f(),!(e=K||F))return[3,4];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,jt({callSid:e,reason:"connected"===D?"ended":"declined"})];case 2:return t.sent(),[3,4];case 3:return t.sent(),[3,4];case 4:return P.current=setTimeout(function(){O(!1)},Lt),[2]}})})};i.useEffect(function(){"idle"!==D&&"ended"!==D||(P.current&&(clearTimeout(P.current),P.current=null),O(!1))},[D]);if(i.useEffect(function(){return function(){P.current&&clearTimeout(P.current)}},[]),d){var $=s||d.callerName||L||"Unknown",W=x(x({},d),{callerName:$,callerNumber:z});return r.jsx(qt,{dispositionData:W,prospectId:n,onClose:S,onSave:function(e){return w(void 0,void 0,void 0,function(){return E(this,function(t){return c?[2,c(e)]:[2,_t({callId:e.callId,prospectId:e.prospectId||n||"",callStatusDisposition:e.callStatusDisposition,dispositionCategory:e.dispositionCategory,dispositionNotes:e.remarks||void 0})]})})}})}if("idle"===D||"ended"===D)return null;var H,Y,X,Q="outbound"===V,G="inbound"===V,J="connected"===D?"bg-green-500":Q?"bg-blue-500":"bg-orange-500",Z=function(){return"calling"===D?"Connecting to ".concat(B,"..."):null},ee=r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"fixed inset-0 bg-black/50",style:{zIndex:Vt},onClick:U}),r.jsx("div",{className:"fixed inset-0 flex items-center justify-center p-4 ".concat(t),style:{zIndex:Tt},children:r.jsxs("div",{className:"bg-white shadow-2xl w-full max-w-md p-6 relative",style:{borderRadius:Mt,border:"1px solid #e5e7eb"},onClick:function(e){return e.stopPropagation()},children:[r.jsx("button",{onClick:U,className:"absolute top-4 right-4 p-1 hover:bg-gray-100 rounded-full transition-colors",children:r.jsx(m.X,{className:"w-5 h-5 text-gray-500"})}),r.jsx("div",{className:"flex justify-center mb-6",children:r.jsxs("span",{className:"inline-flex items-center gap-1.5 px-3 py-1 rounded-full text-sm font-medium border ".concat(Q?"text-blue-600 border-blue-200 bg-blue-50":"text-green-600 border-green-200 bg-green-50"),children:[Q?r.jsx(m.PhoneOutgoing,{className:"w-4 h-4"}):r.jsx(m.PhoneIncoming,{className:"w-4 h-4"}),Q?"Outgoing Call":"Incoming Call"]})}),r.jsx("div",{className:"flex justify-center mb-4",children:r.jsx("div",{className:"w-24 h-24 rounded-full ".concat(J," flex items-center justify-center ").concat("incoming"===D||"ready_to_call"===D?"animate-pulse-ring animate-pulse-dot":""),children:G&&"incoming"===D?r.jsx(m.PhoneIncoming,{className:"w-10 h-10 text-white"}):r.jsx(m.Phone,{className:"w-10 h-10 text-white"})})}),r.jsxs("div",{className:"text-center mb-4",children:[r.jsx(o.Typography,{variant:"h3",className:"text-xl font-semibold text-gray-900",children:B}),q&&r.jsxs(o.Typography,{variant:"small",className:"text-blue-600 font-medium",children:["ID: ",q]}),r.jsx(o.Typography,{variant:"muted",children:z})]}),r.jsx("div",{className:"text-center mb-6",children:"connected"===D?r.jsx(o.Typography,{variant:"p",className:"text-green-500 text-lg font-medium",children:(H=M,Y=Math.floor(H/60),X=H%60,"".concat(Y.toString().padStart(2,"0"),":").concat(X.toString().padStart(2,"0")))}):r.jsx(o.Typography,{variant:"muted",children:function(){switch(D){case"ready_to_call":return"Ready to call...";case"calling":return"Calling...";case"incoming":return"Incoming call...";default:return null}}()})}),"connected"===D&&r.jsxs("div",{className:"flex justify-center gap-6 mb-6",children:[r.jsxs("div",{className:"text-center",children:[r.jsx("button",{onClick:y,className:"w-12 h-12 rounded-full border-2 flex items-center justify-center transition-colors ".concat(A?"bg-gray-200 border-gray-300":"bg-white border-gray-200 hover:bg-gray-50"),children:A?r.jsx(m.MicOff,{className:"w-5 h-5 text-gray-600"}):r.jsx(m.Mic,{className:"w-5 h-5 text-gray-600"})}),r.jsx("p",{className:"text-xs text-gray-500 mt-1",children:A?"Unmute":"Mute"})]}),r.jsxs("div",{className:"text-center",children:[r.jsx("button",{onClick:b,className:"w-12 h-12 rounded-full border-2 flex items-center justify-center transition-colors ".concat(I?"bg-gray-200 border-gray-300":"bg-white border-gray-200 hover:bg-gray-50"),children:I?r.jsx(m.Play,{className:"w-5 h-5 text-gray-600"}):r.jsx(m.Pause,{className:"w-5 h-5 text-gray-600"})}),r.jsx("p",{className:"text-xs text-gray-500 mt-1",children:I?"Resume":"Hold"})]}),r.jsxs("div",{className:"text-center",children:[r.jsx("button",{onClick:g,className:"w-12 h-12 rounded-full border-2 flex items-center justify-center transition-colors ".concat(T?"bg-gray-200 border-gray-300":"bg-white border-gray-200 hover:bg-gray-50"),children:T?r.jsx(m.VolumeX,{className:"w-5 h-5 text-gray-600"}):r.jsx(m.Volume2,{className:"w-5 h-5 text-gray-600"})}),r.jsx("p",{className:"text-xs text-gray-500 mt-1",children:T?"Speaker On":"Speaker Off"})]})]}),r.jsxs("div",{className:"flex justify-center gap-4",children:[("ready_to_call"===D||"incoming"===D)&&r.jsxs(r.Fragment,{children:[r.jsxs(o.Button,{variant:"destructive",onClick:U,disabled:C,className:"gap-2 px-6",children:[r.jsx(m.PhoneOff,{className:"w-4 h-4"}),C?"Declining...":"Decline"]}),r.jsxs(o.Button,{variant:"default",onClick:function(){return w(void 0,void 0,void 0,function(){return E(this,function(e){switch(e.label){case 0:j(!0),e.label=1;case 1:return e.trys.push([1,3,4,5]),[4,p()];case 2:return e.sent(),[3,5];case 3:return e.sent(),[3,5];case 4:return j(!1),[7];case 5:return[2]}})})},disabled:_||C,style:{backgroundColor:"#22c55e"},className:"gap-2 px-6 hover:bg-green-600",children:[r.jsx(m.Phone,{className:"w-4 h-4"}),"Accept"]})]}),"calling"===D&&r.jsxs(o.Button,{variant:"destructive",onClick:U,disabled:C,className:"gap-2 px-6",children:[r.jsx(m.PhoneOff,{className:"w-4 h-4"}),C?"Ending...":"End Call"]}),"connected"===D&&r.jsxs(o.Button,{variant:"destructive",onClick:U,disabled:C,className:"gap-2 px-8",children:[r.jsx(m.PhoneOff,{className:"w-4 h-4"}),C?"Ending...":"End Call"]})]}),Z()&&r.jsx(o.Typography,{variant:"small",className:"text-center text-gray-500 mt-4",children:Z()})]})})]});return h.createPortal(ee,document.body)},zt=function(){function e(){this.algorithm="aes-256-cbc",this.secretKey=null,this.initialized=!1}return e.prototype.ensureInitialized=function(){if(!this.initialized)try{var e="431fef99-47dc-4d2a-9175-2e8f19b20225";if(e){var t=(new TextEncoder).encode(e),n=(new TextEncoder).encode("salt");this.secretKey=v.syncScrypt(t,n,16384,8,1,32)}this.initialized=!0}catch(e){this.initialized=!0}},e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},e.prototype.decryptData=function(e){if(this.ensureInitialized(),!e||!this.secretKey)return"";try{var t=e.split(":"),n=t[0],r=t[1];if(!n||!r)return"";var o=require("crypto"),i=Buffer.from(n,"hex"),s=o.createDecipheriv(this.algorithm,Buffer.from(this.secretKey),i),a=s.update(r,"hex","utf8");return a+=s.final("utf8")}catch(e){return""}},e.prototype.maskMobile=function(e){if(!e||e.length<4)return"**********";var t="",n=e;e.startsWith("+91")?(t="+91",n=e.substring(3)):e.startsWith("91")&&e.length>10&&(t="91",n=e.substring(2));var r=n.replace(/\D/g,"");return r.length<4?t+"**********":t+r.substring(0,2)+"*".repeat(r.length-4)+r.substring(r.length-2)},e}().getInstance();Object.defineProperty(exports,"BrowserRouter",{enumerable:!0,get:function(){return a.BrowserRouter}}),exports.ApplicationStore=N,exports.BatchSelector=function(e){return r.jsx(o.SingleSelect,x({label:"Batch"},e,{externalAxios:D,optionsApiEndPoint:"/dropdowns/batches"}))},exports.CallButton=function(e){var t=e.phoneNumber,n=e.encryptedPhoneNumber,s=e.callerName,a=e.prospectId,c=e.className,l=e.disabled,u=At(),d=i.useState(!1),p=d[0],f=d[1],h=i.useState(null),v=h[0],b=h[1];if(!u)return null;var y=u.makeCall,g=u.isConnected,x=u.callState,S=u.permissionStatus,N=u.requestMicrophoneAccess,_=u.setCallActivityId,j=u.setExotelCallSid,k="idle"!==x.phase&&"ended"!==x.phase,C=t||n,O=l||!C||!g||k||p;return r.jsxs("div",{className:c,children:[r.jsxs(o.Button,{variant:"outline",size:"sm",onClick:function(){return w(void 0,void 0,void 0,function(){var e,r,o,i,c,l,u,d,p;return E(this,function(h){switch(h.label){case 0:if(!g||"idle"!==x.phase&&"ended"!==x.phase)return[2];if(b(null),e=t,n&&!e)try{if(!(e=zt.decryptData(n)))return b("Failed to decrypt phone number"),[2]}catch(e){return b("Failed to decrypt phone number"),[2]}return e?(r=zt.maskMobile(e),[4,xt.getInstance().checkAudioPermissions()]):(b("No phone number available"),[2]);case 1:return h.sent()?[3,3]:[4,N()];case 2:if(!h.sent())return b("Microphone access is required to make calls"),[2];h.label=3;case 3:return h.trys.push([3,9,10,11]),f(!0),[4,y(e,s,void 0,r)];case 4:if(o=h.sent(),(i=null===(d=null==o?void 0:o.Data)||void 0===d?void 0:d.CallSid)&&j(i),!a||!i)return[3,8];h.label=5;case 5:return h.trys.push([5,7,,8]),[4,St({prospectId:a,toNumber:e,callSid:i})];case 6:return c=h.sent(),(l=null===(p=c.data)||void 0===p?void 0:p.id)&&_(l),[3,8];case 7:return h.sent(),[3,8];case 8:return[3,11];case 9:return u=h.sent(),b(u.message||"Failed to make call"),[3,11];case 10:return f(!1),[7];case 11:return[2]}})})},disabled:O,title:g?k?"Call in progress":C?"denied"===S?"Microphone access denied":"Call ".concat(s||"prospect"):"No phone number":"VoIP not connected",className:"gap-1.5",children:["denied"===S?r.jsx(m.MicOff,{className:"w-4 h-4"}):r.jsx(m.Phone,{className:"w-4 h-4"}),p?"Calling...":"Call"]}),v&&r.jsx("p",{className:"text-red-500 text-xs mt-1",children:v})]})},exports.CallDispositionForm=qt,exports.ConfirmDialogProvider=V,exports.CourseSelector=function(e){return r.jsx(o.SingleSelect,x({dbLabelProps:{labelKey:"courseName",subLabelKey:"level"}},e,{externalAxios:D,optionsApiEndPoint:"/dropdowns/courses"}))},exports.DepartmentMongoMultiSelector=function(e){return r.jsx(o.MultiSelect,x({dbLabelProps:{labelKey:"name",subLabelKey:"type",useSubLabelStartCase:!0},dbValueProps:{valueKey:"_id",isObjectId:!0}},e,{externalAxios:D,optionsApiEndPoint:"/dropdowns/departments"}))},exports.DepartmentSelector=function(e){return r.jsx(o.SingleSelect,x({dbLabelProps:{labelKey:"name",subLabelKey:"type",useSubLabelStartCase:!0},dbValueProps:{valueKey:"_id",isObjectId:!0}},e,{externalAxios:D,optionsApiEndPoint:"/dropdowns/departments"}))},exports.DepartmentSqlMultiSelector=function(e){return r.jsx(o.MultiSelect,x({dbLabelProps:{labelKey:"name",subLabelKey:"type",useSubLabelStartCase:!0},dbValueProps:{valueKey:"id",isInt:!0}},e,{externalAxios:D,optionsApiEndPoint:"/dropdowns/departments-sql"}))},exports.EmployeesSelector=function(e){return r.jsx(o.SingleSelect,x({dbValueProps:{valueKey:"_id",isObjectId:!0},dbLabelProps:{labelKey:"fullName",subLabelKey:"employeeId"}},e,{externalAxios:D,optionsApiEndPoint:"/dropdowns/employees"}))},exports.ErrorBoundary=function(e){var t=a.useLocation();return r.jsx(s.QueryErrorResetBoundary,{children:function(n){var o=n.reset;return r.jsx(R,{onReset:o,FallbackComponent:z,children:e.children},null==t?void 0:t.pathname)}})},exports.ExamTypeSelector=function(e){return r.jsx(o.SingleSelect,x({label:"Exam Type",options:bt},e))},exports.ExamsRegulationSelector=function(e){return r.jsx(o.SingleSelect,x({label:"Regulation"},e,{externalAxios:D,optionsApiEndPoint:"/dropdowns/exam-regulations",dbLabelProps:{labelKey:"r.name"},dbValueProps:{valueKey:"r.name"}}))},exports.ExotelPhone=Bt,exports.ExotelProvider=Dt,exports.ExotelWrapper=function(e){var t=e.children,n=e.enabled,o=void 0===n||n,s=e.prospectId,a=e.prospectName,c=e.prospectNumber,l=i.useState(null),u=l[0],d=l[1],p=i.useState(!0);p[0];var f=p[1],h=i.useState(null),m=h[0],v=h[1];return i.useEffect(function(){if(o){w(void 0,void 0,void 0,function(){var e,t;return E(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,3,4]),f(!0),[4,Et()];case 1:return(null==(e=n.sent())?void 0:e.token)?d(e.token):v("Voice calling not configured"),[3,4];case 2:return t=n.sent(),v(t.message||"Failed to initialize calling"),[3,4];case 3:return f(!1),[7];case 4:return[2]}})})}else f(!1)},[o]),o&&!m&&u?r.jsxs(Dt,{accessToken:u,agentUserId:"0047",autoConnectVOIP:!0,children:[t,r.jsx(Bt,{prospectId:s,prospectName:a,prospectNumber:c})]}):r.jsx(r.Fragment,{children:t})},exports.FeeTypeSelector=function(e){return r.jsx(o.SingleSelect,x({label:"Fee Type",options:null==yt?void 0:yt.map(function(e){return{label:e.label,value:e.value}})},e))},exports.HostelBlockSelector=function(e){return r.jsx(o.SingleSelect,x({dbValueProps:{valueKey:"id",isInt:!0},dbLabelProps:{labelKey:"name",subLabelKey:"type",useLabelStartCase:!0,useSubLabelStartCase:!0}},e,{externalAxios:D,optionsApiEndPoint:"/dropdowns/hostel-blocks"}))},exports.HostelFloorSelector=function(e){return r.jsx(o.SingleSelect,x({label:"Hostel Room No.",dbValueProps:{valueKey:"floor"},dbLabelProps:{labelKey:"floor"}},e,{externalAxios:D,optionsApiEndPoint:"dropdowns/floors"}))},exports.HostelRoomSelector=function(e){return r.jsx(o.SingleSelect,x({label:"Hostel Room",dbValueProps:{valueKey:"id"},dbLabelProps:{labelKey:"room_number",useLabelStartCase:!0}},e,{optionsApiEndPoint:"dropdowns/hostel-rooms",externalAxios:D}))},exports.MicrophonePermission=function(e){var t=e.onPermissionGranted,n=e.onPermissionDenied,s=It(),a=s.permissionStatus,c=s.requestMicrophoneAccess,l=i.useState(!1),u=l[0],d=l[1],p=i.useState(null),f=p[0],h=p[1];return"granted"===a?r.jsxs("div",{className:"flex items-center gap-2 text-green-600",children:[r.jsx(m.Mic,{className:"w-4 h-4"}),r.jsx("span",{className:"text-sm",children:"Microphone access granted"})]}):"denied"===a?r.jsxs("div",{className:"p-4 bg-red-50 rounded-lg border border-red-200",children:[r.jsxs("div",{className:"flex items-center gap-2 text-red-600 mb-2",children:[r.jsx(m.MicOff,{className:"w-5 h-5"}),r.jsx("span",{className:"font-medium",children:"Microphone Access Denied"})]}),r.jsx("p",{className:"text-sm text-red-600 mb-3",children:"To use the calling feature, you need to enable microphone access in your browser settings."}),r.jsxs("div",{className:"text-xs text-gray-600",children:[r.jsx("p",{className:"font-medium mb-1",children:"How to enable:"}),r.jsxs("ol",{className:"list-decimal list-inside space-y-1",children:[r.jsx("li",{children:"Click the lock/info icon in your browser's address bar"}),r.jsx("li",{children:'Find "Microphone" in the permissions list'}),r.jsx("li",{children:'Change the setting to "Allow"'}),r.jsx("li",{children:"Refresh the page"})]})]})]}):r.jsxs("div",{className:"p-4 bg-blue-50 rounded-lg border border-blue-200",children:[r.jsxs("div",{className:"flex items-center gap-2 text-blue-600 mb-2",children:[r.jsx(m.AlertCircle,{className:"w-5 h-5"}),r.jsx("span",{className:"font-medium",children:"Microphone Permission Required"})]}),r.jsx("p",{className:"text-sm text-gray-600 mb-3",children:"To make and receive calls, we need access to your microphone. Click the button below to grant permission."}),r.jsxs(o.Button,{variant:"default",size:"sm",onClick:function(){return w(void 0,void 0,void 0,function(){var e;return E(this,function(r){switch(r.label){case 0:d(!0),h(null),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,c()];case 2:return r.sent()?null==t||t():(h("Microphone access was denied"),null==n||n()),[3,5];case 3:return e=r.sent(),h(e.message||"Failed to request microphone access"),null==n||n(),[3,5];case 4:return d(!1),[7];case 5:return[2]}})})},loading:u,className:"gap-1.5",children:[r.jsx(m.Mic,{className:"w-4 h-4"}),"Allow Microphone Access"]}),f&&r.jsx("p",{className:"text-red-500 text-xs mt-2",children:f})]})},exports.MonthYearSelector=function(e){return r.jsx(o.SingleSelect,x({label:"Month & Year"},e,{externalAxios:D,optionsApiEndPoint:"/dropdowns/month-years"}))},exports.PrintFormatSelector=function(e){return r.jsx(o.SingleSelect,x({dbLabelProps:{labelKey:"name",subLabelKey:"type",useSubLabelStartCase:!0}},e,{externalAxios:D,optionsApiEndPoint:"/dropdowns/print-formats"}))},exports.ProgramSelector=function(e){return r.jsx(o.SingleSelect,x({dbLabelProps:{labelKey:"branchCode",subLabelKey:"branchDisplay"}},e,{externalAxios:D,optionsApiEndPoint:"/dropdowns/programs"}))},exports.Providers=function(e){var t=e.children,n=e.basename,o=e.reducers,c=void 0===o?{}:o,l=new s.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:!1,useErrorBoundary:!0}}}),u=j&&k&&C?"/".concat(k,"/").concat(C):"/";i.useEffect(function(){"/"===window.location.pathname&&k&&C&&j&&window.location.replace(window.location.origin+"/".concat(k,"/").concat(C))},[k,j,C]);var d=pt({reducer:ee(c)});return r.jsx(p.Provider,{store:d,children:r.jsx(a.BrowserRouter,{basename:null!=n?n:u,children:r.jsx(s.QueryClientProvider,{client:l,children:r.jsx(mt,{children:r.jsx(V,{children:t})})})})})},exports.RegulationSelector=function(e){return r.jsx(o.SingleSelect,x({label:"Regulation",dbValueProps:{valueKey:"regulation_id"},dbLabelProps:{labelKey:"r.name"}},e,{optionsApiEndPoint:"dropdowns/regulations",externalAxios:D}))},exports.ResearchExpertDesignationSelector=function(e){return r.jsx(o.SingleSelect,x({dbLabelProps:{labelKey:"name"},dbValueProps:{valueKey:"id",isInt:!0}},e,{externalAxios:D,optionsApiEndPoint:"/dropdowns/research-expert-designations"}))},exports.ResearchExpertSelector=function(e){return r.jsx(o.SingleSelect,x({dbValueProps:{valueKey:"id"},dbLabelProps:{labelKey:"name",subLabelKey:"type"}},e,{optionsApiEndPoint:"dropdowns/research-experts",externalAxios:D}))},exports.ResearchStageSelector=function(e){return r.jsx(o.SingleSelect,x({dbValueProps:{valueKey:"id",isInt:!0},dbLabelProps:{labelKey:"name",subLabelKey:"`order`"}},e,{optionsApiEndPoint:"dropdowns/research-stages",externalAxios:D}))},exports.SemesterSelector=function(e){return r.jsx(o.SingleSelect,x({dbLabelProps:{labelKey:"name",subLabelKey:"year"}},e,{optionsApiEndPoint:"/dropdowns/semesters",externalAxios:D}))},exports.SnackbarProvider=mt,exports.StudentSelector=function(e){return r.jsx(o.SingleSelect,x({dbLabelProps:{labelKey:"slug",useLabelStartCase:!0},dbValueProps:{valueKey:"id"}},e,{externalAxios:D,optionsApiEndPoint:"/dropdowns/students"}))},exports.StudentServicesSelector=function(e){return r.jsx(o.SingleSelect,x({dbLabelProps:{labelKey:"slug",useLabelStartCase:!0},dbValueProps:{valueKey:"id"}},e,{externalAxios:D,optionsApiEndPoint:"/dropdowns/student-services"}))},exports.VOIP_ENABLED_WORKSPACES=I,exports.VoIPProvider=function(e){var t=e.children,n=e.workspace,o=e.agentUserId,s=e.prospectId,a=e.prospectName,c=e.prospectNumber,l=e.onSaveDisposition,u=i.useState(null),d=u[0],p=u[1],f=i.useState(!0),h=f[0],m=f[1],v=i.useState(null),b=v[0],y=v[1],g=A(n),x=!!o,S=i.useCallback(function(e){return w(void 0,void 0,void 0,function(){return E(this,function(t){return l?[2,l(e)]:[2,_t({callId:e.callId,prospectId:e.prospectId,callStatusDisposition:e.callStatusDisposition,dispositionCategory:e.dispositionCategory,dispositionReason:e.dispositionReason||void 0,dispositionNotes:e.remarks||void 0})]})})},[l]);return i.useEffect(function(){if(g&&x){w(void 0,void 0,void 0,function(){var e,t;return E(this,function(n){switch(n.label){case 0:return n.trys.push([0,3,4,5]),m(!0),y(null),[4,wt()];case 1:return n.sent().enabled?[4,Et()]:(y("Voice calling not enabled for this tenant"),m(!1),[2]);case 2:return(null==(e=n.sent())?void 0:e.token)?p(e.token):y("Voice calling token not available"),[3,5];case 3:return t=n.sent(),y(t.message||"Failed to initialize calling"),[3,5];case 4:return m(!1),[7];case 5:return[2]}})})}else m(!1)},[g,x]),g&&x?h||b||!d?r.jsx(r.Fragment,{children:t}):r.jsxs(Dt,{accessToken:d,agentUserId:o,autoConnectVOIP:!0,children:[t,r.jsx(Bt,{prospectId:s,prospectName:a,prospectNumber:c,onSaveDisposition:S})]}):r.jsx(r.Fragment,{children:t})},exports.YearRangeSelector=function(e){var t=e.suffix,n=void 0===t?null:t,i=e.valueKey,s=void 0===i?"yearRange":i,a=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}(e,["suffix","valueKey"]);return r.jsx(o.SingleSelect,x({label:"Year Range",options:null==gt?void 0:gt.map(function(e){return{label:n?"".concat(n," ").concat(e," - ").concat(e+1):"".concat(e," - ").concat(e+1),value:"yearRange"===s?"".concat(e," - ").concat(e+1):e}})},a))},exports.axios=P,exports.cancelCall=jt,exports.checkVoIPEnabled=wt,exports.createExotelAppToken=function(){return w(void 0,void 0,void 0,function(){var e;return E(this,function(t){switch(t.label){case 0:return[4,Et()];case 1:if(!(e=t.sent()))throw new Error("No active voice configuration found");return[2,{Data:e.token}]}})})},exports.createRsbuildSharedConfig=function(e,t,n){return n.reduce(function(n,r){var o=e[r];return o&&(n[r]=x({singleton:!0,requiredVersion:o,version:o.replace(/^[\^~]/,"")},t.includes(r)?{eager:!0}:{})),n},{})},exports.fetchCallHistory=function(e){return w(void 0,void 0,void 0,function(){var t;return E(this,function(n){switch(n.label){case 0:return t="common-workspace"===C?"/paymentx/call-activities":"/call-activities",[4,P.get("".concat(t,"/by-prospect"),{params:{prospectId:e}})];case 1:return[2,n.sent().data]}})})},exports.getActiveVoiceToken=Et,exports.getCallActivityByCallSid=function(e){return w(void 0,void 0,void 0,function(){var t;return E(this,function(n){switch(n.label){case 0:return t="common-workspace"===C?"/paymentx/call-activities":"/call-activities",[4,P.get("".concat(t,"/by-call-sid"),{params:{callSid:e}})];case 1:return[2,n.sent().data]}})})},exports.getCallActivityById=function(e){return w(void 0,void 0,void 0,function(){var t;return E(this,function(n){switch(n.label){case 0:return t="common-workspace"===C?"/paymentx/call-activities":"/call-activities",[4,P.get("".concat(t,"/").concat(e))];case 1:return[2,n.sent().data]}})})},exports.getCallCountByProspect=function(e){return w(void 0,void 0,void 0,function(){var t,n;return E(this,function(r){switch(r.label){case 0:return t="common-workspace"===C?"/paymentx/call-activities":"/call-activities",[4,P.get("".concat(t,"/count-by-prospect"),{params:{prospectId:e}})];case 1:return[2,(null==(n=r.sent().data)?void 0:n.count)||0]}})})},exports.initialApplicationState=S,exports.initiateCallActivity=St,exports.institutionCode=k,exports.isDevelopment=_,exports.isVoIPEnabledForWorkspace=A,exports.nonWorkspaceAxios=D,exports.openInNewTab=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var r=window.location.pathname.split("/"),o=[];!t&&r[1]&&o.push(r[1]),!n&&r[2]&&o.push(r[2]);var i=o.length>0?"/"+o.join("/"):"",s="".concat(window.location.origin).concat(i,"/").concat(e);window.open(s,"_blank")},exports.registerIncomingCall=Nt,exports.saveCallDisposition=_t,exports.tenantCode=j,exports.useConfirm=function(){var e=function(){N.update(function(e){e.confirmDialog=vt})};return function(t){var n=t.title,r=t.message,o=t.confirmButtonText,i=t.cancelButtonText,s=t.type,a=void 0===s?"confirm":s;return new Promise(function(t){N.update(function(s){s.confirmDialog={isOpen:!0,title:n,message:r,confirmButtonText:o,cancelButtonText:i,type:a,onConfirm:function(){t(!0),e()},onCancel:function(){t(!1),e()}}})})}},exports.useExotel=It,exports.useExotelSafe=At,exports.workspace=C,exports.workspaceApiMapping=O;
@@ -0,0 +1,10 @@
1
+ interface CallButtonProps {
2
+ phoneNumber?: string;
3
+ encryptedPhoneNumber?: string;
4
+ callerName?: string;
5
+ prospectId?: string;
6
+ className?: string;
7
+ disabled?: boolean;
8
+ }
9
+ declare const CallButton: ({ phoneNumber, encryptedPhoneNumber, callerName, prospectId, className, disabled, }: CallButtonProps) => import("react/jsx-runtime").JSX.Element;
10
+ export default CallButton;
@@ -0,0 +1,29 @@
1
+ import type { CallDispositionData } from '../../providers/ExotelProvider';
2
+ type CallStatusType = 'connected' | 'not_connected';
3
+ export interface DispositionFormData {
4
+ prospectId?: string;
5
+ callId: string;
6
+ channel: string;
7
+ direction: string;
8
+ duration: number;
9
+ callStatusDisposition: CallStatusType;
10
+ dispositionReason?: string;
11
+ dispositionCategory: string;
12
+ remarks: string;
13
+ callerName: string;
14
+ callerNumber: string;
15
+ }
16
+ export interface ExistingDispositionData {
17
+ callStatusDisposition?: CallStatusType;
18
+ dispositionCategory?: string;
19
+ dispositionNotes?: string;
20
+ }
21
+ interface CallDispositionFormProps {
22
+ dispositionData: CallDispositionData;
23
+ prospectId?: string;
24
+ onClose: () => void;
25
+ onSave: (data: DispositionFormData) => Promise<any>;
26
+ existingData?: ExistingDispositionData;
27
+ }
28
+ declare const CallDispositionForm: ({ dispositionData, prospectId, onClose, onSave, existingData, }: CallDispositionFormProps) => import("react/jsx-runtime").JSX.Element;
29
+ export default CallDispositionForm;
@@ -0,0 +1,10 @@
1
+ import { type DispositionFormData } from './CallDispositionForm';
2
+ interface ExotelPhoneProps {
3
+ className?: string;
4
+ prospectId?: string;
5
+ prospectName?: string;
6
+ prospectNumber?: string;
7
+ onSaveDisposition?: (data: DispositionFormData) => Promise<any>;
8
+ }
9
+ declare const ExotelPhone: ({ className, prospectId, prospectName, prospectNumber, onSaveDisposition }: ExotelPhoneProps) => import("react/jsx-runtime").JSX.Element;
10
+ export default ExotelPhone;
@@ -0,0 +1,14 @@
1
+ import { ReactNode } from 'react';
2
+ interface ExotelWrapperProps {
3
+ children: ReactNode;
4
+ enabled?: boolean;
5
+ prospectId?: string;
6
+ prospectName?: string;
7
+ prospectNumber?: string;
8
+ }
9
+ /**
10
+ * Wrapper component that initializes Exotel VoIP functionality
11
+ * Fetches the access token from backend and provides the Exotel context to children
12
+ */
13
+ declare const ExotelWrapper: ({ children, enabled, prospectId, prospectName, prospectNumber, }: ExotelWrapperProps) => import("react/jsx-runtime").JSX.Element;
14
+ export default ExotelWrapper;
@@ -0,0 +1,6 @@
1
+ interface MicrophonePermissionProps {
2
+ onPermissionGranted?: () => void;
3
+ onPermissionDenied?: () => void;
4
+ }
5
+ declare const MicrophonePermission: ({ onPermissionGranted, onPermissionDenied, }: MicrophonePermissionProps) => import("react/jsx-runtime").JSX.Element;
6
+ export default MicrophonePermission;
@@ -0,0 +1,6 @@
1
+ export { default as ExotelPhone } from './ExotelPhone';
2
+ export { default as CallButton } from './CallButton';
3
+ export { default as CallDispositionForm } from './CallDispositionForm';
4
+ export { default as MicrophonePermission } from './MicrophonePermission';
5
+ export { default as ExotelWrapper } from './ExotelWrapper';
6
+ export type { DispositionFormData, ExistingDispositionData, } from './CallDispositionForm';
@@ -1,3 +1,4 @@
1
1
  export * from './axios';
2
2
  export * from './createRsbuildSharedConfig';
3
3
  export * from './nonWorkspaceAxios';
4
+ export * from './voip.config';
@@ -0,0 +1,18 @@
1
+ /**
2
+ * VoIP Configuration Module
3
+ *
4
+ * This module manages VoIP/Exotel configuration for workspaces.
5
+ * Only workspaces listed in VOIP_ENABLED_WORKSPACES will have VoIP functionality.
6
+ */
7
+ /**
8
+ * List of workspaces that have VoIP/Exotel calling enabled.
9
+ * Add workspace names here to enable VoIP for that workspace.
10
+ */
11
+ export declare const VOIP_ENABLED_WORKSPACES: string[];
12
+ /**
13
+ * Check if VoIP is enabled for a given workspace
14
+ *
15
+ * @param workspaceName - The name of the workspace to check
16
+ * @returns boolean indicating if VoIP is enabled for the workspace
17
+ */
18
+ export declare function isVoIPEnabledForWorkspace(workspaceName: string): boolean;
@@ -0,0 +1,7 @@
1
+ export declare const EXOTEL_CONSTANTS: {
2
+ MODAL_Z_INDEX: number;
3
+ MODAL_BACKDROP_Z_INDEX: number;
4
+ MODAL_BORDER_RADIUS: string;
5
+ DECLINE_TIMEOUT_MS: number;
6
+ TIMER_INTERVAL_MS: number;
7
+ };
@@ -0,0 +1,79 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { PermissionStatus } from '../services/exotel/ExotelService';
3
+ export interface CallEventData {
4
+ callId: string;
5
+ remoteId: string;
6
+ remoteDisplayName: string;
7
+ callDirection: string;
8
+ callState: string;
9
+ callDuration: string;
10
+ callStartedTime: string;
11
+ callEstablishedTime: string;
12
+ callEndedTime: string;
13
+ callAnswerTime: string;
14
+ callEndReason: string;
15
+ sessionId: string;
16
+ callFromNumber?: string;
17
+ status?: string;
18
+ }
19
+ export type CallPhase = 'idle' | 'ready_to_call' | 'calling' | 'incoming' | 'connected' | 'ended';
20
+ export interface CallState {
21
+ phase: CallPhase;
22
+ callData: CallEventData | null;
23
+ isOnHold: boolean;
24
+ isMuted: boolean;
25
+ isSpeakerOff: boolean;
26
+ callDirection: 'outbound' | 'inbound' | null;
27
+ callStartTime: number | null;
28
+ callDuration: number;
29
+ callerName: string | null;
30
+ callerNumber: string | null;
31
+ callActivityId: string | null;
32
+ exotelCallSid: string | null;
33
+ prospectUniqueId: number | null;
34
+ wasAccepted: boolean;
35
+ }
36
+ export interface CallDispositionData {
37
+ callId: string;
38
+ exotelCallId: string;
39
+ callDirection: 'outbound' | 'inbound';
40
+ callDuration: number;
41
+ callerName: string | null;
42
+ callerNumber: string | null;
43
+ }
44
+ export interface ExotelContextType {
45
+ isInitialized: boolean;
46
+ isConnected: boolean;
47
+ callState: CallState;
48
+ permissionStatus: PermissionStatus;
49
+ dispositionData: CallDispositionData | null;
50
+ makeCall: (phoneNumber: string, callerName?: string, callActivityId?: string, maskedNumber?: string) => Promise<any>;
51
+ acceptCall: () => Promise<void>;
52
+ hangupCall: () => void;
53
+ rejectCall: () => void;
54
+ toggleHold: () => void;
55
+ toggleMute: () => void;
56
+ toggleSpeaker: () => void;
57
+ sendDTMF: (digit: string) => void;
58
+ registerDevice: () => Promise<void>;
59
+ unregisterDevice: () => void;
60
+ requestMicrophoneAccess: () => Promise<boolean>;
61
+ clearDisposition: () => void;
62
+ setCallActivityId: (callActivityId: string) => void;
63
+ setExotelCallSid: (callSid: string) => void;
64
+ }
65
+ export interface ExotelProviderProps {
66
+ children: ReactNode;
67
+ accessToken: string;
68
+ agentUserId: string;
69
+ autoConnectVOIP?: boolean;
70
+ callerName?: string;
71
+ callerNumber?: string;
72
+ }
73
+ export declare const ExotelProvider: React.FC<ExotelProviderProps>;
74
+ export declare const useExotel: () => ExotelContextType;
75
+ /**
76
+ * Safe version of useExotel that returns null when outside the provider
77
+ * Use this in components that may render outside of ExotelProvider
78
+ */
79
+ export declare const useExotelSafe: () => ExotelContextType | null;
@@ -0,0 +1,33 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { DispositionFormData } from '../components/Exotel';
3
+ export type { DispositionFormData } from '../components/Exotel';
4
+ interface VoIPProviderProps {
5
+ children: ReactNode;
6
+ workspace: string;
7
+ agentUserId?: string;
8
+ prospectId?: string;
9
+ prospectName?: string;
10
+ prospectNumber?: string;
11
+ onSaveDisposition?: (data: DispositionFormData) => Promise<any>;
12
+ }
13
+ /**
14
+ * VoIPProvider - Workspace-level VoIP/Exotel integration
15
+ *
16
+ * This provider checks if VoIP is enabled for the current workspace AND tenant
17
+ * and initializes the Exotel SDK if enabled.
18
+ *
19
+ * VoIP is enabled only when ALL conditions are met:
20
+ * 1. Workspace is in VOIP_ENABLED_WORKSPACES (common-workspace, tele-caller-workspace)
21
+ * 2. Tenant has enableVoice: true in notification config
22
+ * 3. Tenant has at least one enabled voice config (voiceConfigs[].isEnabled: true)
23
+ * 4. Active token is available
24
+ *
25
+ * Features:
26
+ * - Workspace-level VoIP enablement
27
+ * - Tenant-level VoIP configuration check
28
+ * - Automatic token fetching from backend
29
+ * - Microphone permission handling
30
+ * - Floating phone UI for active calls
31
+ */
32
+ export declare const VoIPProvider: React.FC<VoIPProviderProps>;
33
+ export default VoIPProvider;
@@ -0,0 +1,2 @@
1
+ export * from './ExotelProvider';
2
+ export * from './VoIPProvider';
@@ -0,0 +1,23 @@
1
+ declare class CryptoService {
2
+ private static instance;
3
+ private readonly algorithm;
4
+ private secretKey;
5
+ private initialized;
6
+ private constructor();
7
+ private ensureInitialized;
8
+ static getInstance(): CryptoService;
9
+ /**
10
+ * Decrypt data using AES-256-CBC (same as backend)
11
+ * Format: "iv_hex:encrypted_hex"
12
+ */
13
+ decryptData(encryptedData: string): string;
14
+ /**
15
+ * Mask mobile number for display (first 2 and last 2 of actual number visible)
16
+ * Handles country code prefix (+91)
17
+ * e.g., "+919876543210" -> "+9198******10"
18
+ * e.g., "9876543210" -> "98******10"
19
+ */
20
+ maskMobile(mobile: string): string;
21
+ }
22
+ declare const _default: CryptoService;
23
+ export default _default;