=t:e>t);case"cbc":return"CBC"===e;case"unlimited":return"UNLIMITED"===e;case"nr":return"NR"===e;case"blanks":return""===e;default:return console.warn("Invalid operator name ",a),!1}}var Ue=function(e){return Ae.includes(e)};var Be=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=Object(n.useState)(e),a=Object(d.a)(t,2),r=a[0],c=a[1],l=Object(n.useCallback)((function(){c((function(e){return!e}))}),[c]);return[r,l]},He=a(725),ze=a(726),Ve=a(147);var Ge=function(e){var t=e.component,a=e.column,c=a.filterValue,l=void 0===c?[]:c,s=a.id,o=a.setFilter,i=a.metadata,u=void 0===i?{}:i,m=Be(!1),f=Object(d.a)(m,2),b=f[0],E=f[1],h=Object(p.b)(),g=Object(n.useState)(l),y=Object(d.a)(g,2),N=y[0],O=y[1],j=Object(n.useCallback)((function(){Sn(N)?(o(N),h({type:"ADD_TABLE_FILTER",payload:{id:s,value:N}})):(o(void 0),h(ie(s))),E()}),[h,o,N,s]),x=Object(n.useCallback)((function(){o(void 0),O([]),h(ie(s)),E()}),[h,o]);return r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{onClick:function(e){return e.stopPropagation()}},r.a.createElement(v.a,{id:"popover-".concat(s),color:"link",type:"button",size:"lg",className:"noFocus filterbtn"},Sn(l)?r.a.createElement(Ve.a,{className:"filtered"}):r.a.createElement(Ve.b,null)),r.a.createElement(He.a,{trigger:"legacy",placement:"bottom",isOpen:b,target:"popover-".concat(s),toggle:E},r.a.createElement(ze.a,{className:"filter__popover p-0"},r.a.createElement("div",null,r.a.createElement(t,{filterOptions:N,setFilterOptions:O,metadata:u})),r.a.createElement("div",{className:"d-flex justify-content-end pl-8 pr-8 pb-8"},r.a.createElement(v.a,{size:"sm",color:"link",onClick:x,className:"text-decoration-none noFocus"},"Clear"),r.a.createElement(v.a,{size:"sm",color:"primary",onClick:j,className:"noFocus"},"Apply"))))))},Ye=a(729),We=a(350),Je=a(349),Qe=function(e){var t=e.allowDecimal,a=(e.digitLimit,Object(fe.a)(e,["allowDecimal","digitLimit"])),n="undefined"===typeof t||t;return r.a.createElement(Je.a,Object.assign({decimalScale:n?2:0,isAllowed:function(t){var a=t.formattedValue,n=t.floatValue,r=e.digitLimit?parseFloat(e.digitLimit):1e10;return""===a||n<=r}},a))};Qe.defaultProps={isNumericString:!0,customInput:b.a,maxLength:11};var Ke=Qe;var Xe=function(e){var t=e.filterOptions,a=e.setFilterOptions,c=e.metadata,l=(c=void 0===c?{}:c).format,s=void 0===l?"":l,o=Object(n.useState)(Ue(t.operator)),i=Object(d.a)(o,2),u=i[0],p=i[1];return Object(n.useEffect)((function(){a((function(e){return Object(m.a)(Object(m.a)({},e),{},{operator:e.operator?e.operator:"gt",value:e.value?e.value:""})}))}),[a]),r.a.createElement("div",{className:"p-8"},r.a.createElement(b.a,{type:"select",className:"mb-8 noFocus",onChange:function(e){var n=e.target.value,r=Ue(n),c=r?"":t.value;a((function(e){return Object(m.a)(Object(m.a)({},e),{},{operator:n,value:c})})),p(r)},defaultValue:"gt",value:t.operator},Pe.map((function(e){return r.a.createElement("option",{value:e.value,key:e.value},e.label)}))),r.a.createElement(f.a,null,D===s&&r.a.createElement(Ye.a,{addonType:"prepend"},r.a.createElement(We.a,null,"$")),r.a.createElement(Ke,{className:"noFocus",value:t.value,onValueChange:function(e){a((function(t){return Object(m.a)(Object(m.a)({},t),{},{value:e.value})}))},disabled:u}),R===s&&r.a.createElement(Ye.a,{addonType:"append"},r.a.createElement(We.a,null,"%"))))},$e=a(351),Ze=a.n($e),et=(a(457),r.a.memo((function(e){var t=e.mode,a=e.data,n=e.onChange,c=e.placeHolder;return r.a.createElement("div",null,r.a.createElement(Ze.a,{keepTreeOnSearch:!0,mode:t,data:a,onChange:n,showDropdown:"always",texts:{placeholder:c||"Search"},showPartiallySelected:!0}))}))),tt=r.a.memo((function(e){var t=e.filterOptions,a=e.setFilterOptions,c=Object(p.c)((function(e){return e.lenders.list})),l=r.a.useMemo((function(){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],a=[],n=ne.a.groupBy(e,"category");return Object.entries(n).forEach((function(e){var n=Object(d.a)(e,2),r=n[0],c=n[1],l={label:r,category:r,leaf:!1,className:"tree-node"},s=c.map((function(e){return{label:e.name,checked:t[e.category]&&t[e.category].includes(e.lenderId),leaf:!0,lenderId:e.lenderId,className:"tree-node",category:e.category}}));t[r]&&t[r].length===c.length&&(l=Object(m.a)(Object(m.a)({},l),{},{checked:!0})),l=Object(m.a)(Object(m.a)({},l),{},{children:s}),a.push(l)})),a}(c,t)}),[c]),s=Object(n.useCallback)((function(e,t){var n={};t.forEach((function(e){var t=e.category;if(e.leaf)n[t]=ne.a.isEmpty(n[t])?[e.lenderId]:[].concat(Object(u.a)(n[t]),[e.lenderId]);else{var a=c.filter((function(e){return e.category===t})).map((function(e){return e.lenderId}));n[t]=ne.a.isEmpty(n[t])?n[t]=Object(u.a)(a):ne.a.uniq([].concat(Object(u.a)(n[t]),Object(u.a)(a)))}})),a(n)}),[c,a]);return r.a.createElement("div",null,r.a.createElement(et,{mode:"multiSelect",data:l,onChange:s}))})),at=r.a.memo((function(e){var t=e.filterOptions,a=e.setFilterOptions,n=e.metadata,c=(n=void 0===n?{}:n).format,l=n.properties,s=void 0===l?"":l,o=r.a.useMemo((function(){var e=Ie;return F.ENUM!==c&&F.ENUM_MULTI!==c||(e=function(e){var t=e.split(",").map((function(e){var t=e.trim();if(!Se.includes(t))return{label:t,value:t.toLowerCase(),className:"tree-node"}}));return t=(t=ne.a.compact(t)).concat(_e)}(s)),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.map((function(e){var a=!ne.a.isUndefined(ne.a.find(t,(function(t){return e.label===t.label})));return Object(m.a)(Object(m.a)({},e),{},{checked:a})}))}(e,t)}),[t,c,s]),i=r.a.useCallback((function(e,t){a(t.map((function(e){return ne.a.pick(e,["label","value"])})))}),[a]);return r.a.createElement("div",null,r.a.createElement(et,{mode:"multiSelect",data:o,onChange:i}))})),nt="gt",rt="m",ct=[{label:"Days",value:"d"},{label:"Months",value:"m"},{label:"Years",value:"y"}];var lt=function(e){var t=e.filterOptions,a=e.setFilterOptions,c=Object(n.useState)(Ue(t.operator)),l=Object(d.a)(c,2),s=l[0],o=l[1],i=function(e){if(e.target.name){var n=e.target.name,r=e.target.value,c=!1;"operator"===n&&(c=Ue(r),o(c));var l=c?"":t.value;a((function(e){var t;return Object(m.a)(Object(m.a)({},e),{},(t={},Object(pe.a)(t,n,r),Object(pe.a)(t,"value",l),t))}))}};return Object(n.useEffect)((function(){a((function(e){return Object(m.a)(Object(m.a)({},e),{},{operator:e.operator?e.operator:nt,value:e.value?e.value:"",unit:e.unit?e.unit:rt})}))}),[a]),r.a.createElement("div",{className:"p-8"},r.a.createElement(b.a,{type:"select",className:"mb-8 noFocus",onChange:i,value:t.operator,name:"operator"},Pe.map((function(e){return r.a.createElement("option",{value:e.value,key:e.value},e.label)}))),r.a.createElement(f.a,null,r.a.createElement(Ke,{className:"noFocus",value:t.value,onValueChange:function(e){a((function(t){return Object(m.a)(Object(m.a)({},t),{},{value:e.value})}))},disabled:s}),r.a.createElement(b.a,{type:"select",className:"mb-2 noFocus",onChange:i,value:t.unit,name:"unit",disabled:s},ct.map((function(e){return r.a.createElement("option",{value:e.value,key:e.value},e.label)})))))};var st=function(){var e;return e={},Object(pe.a)(e,he,Xe),Object(pe.a)(e,Ee,tt),Object(pe.a)(e,ge,at),Object(pe.a)(e,ye,lt),e}(),ot=a(200),it=function(e){return{type:"SET_CELL_DATA",payload:e}},ut=function(e,t){return{type:"SET_REQUEST_STATUS",payload:{requestId:e,status:t}}},mt=a(756),dt=a(734),pt=a(735),ft=a(740),bt=a(741),vt=a(742),Et=a(743),ht=a(744),gt=a(13),yt=a.n(gt),Nt=X,Ot=function(){var e=Object(O.a)(N.a.mark((function e(t,a){var n;return N.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={body:{type:a.type,source:a.source,requestValue:a.requestValue,cellId:t,columnLabel:a.columnLabel,lenderName:a.lenderName,nicheId:a.nicheId,nicheLabel:a.nicheLabel,nicheName:a.nicheName,columnFormat:a.columnFormat}},e.next=3,j.a.post(Nt,"/request",n);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),jt=function(){var e=Object(O.a)(N.a.mark((function e(t){return N.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,j.a.get(Nt,"/request?cellId=".concat(t));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),xt=function(e){return j.a.del(Nt,"/request/".concat(e))},Ct=function(){var e=Object(O.a)(N.a.mark((function e(t,a){var n;return N.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={body:{cellId:t,type:a.type,source:a.source,requestValue:a.requestValue,color:a.color,columnLabel:a.columnLabel,lenderName:a.lenderName,nicheId:a.nicheId,nicheLabel:a.nicheLabel,nicheName:a.nicheName,columnFormat:a.columnFormat}},e.next=3,j.a.post(Nt,"/request/admin",n);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),kt=function(){var e=Object(O.a)(N.a.mark((function e(t,a){var n;return N.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={body:{status:a.status}},a.status===I.REJECTED&&(n.body.rejectionReason=a.rejectionReason?a.rejectionReason:""),e.next=4,j.a.patch(Nt,"/request/".concat(t,"/review"),n);case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}(),wt=function(e){return j.a.patch(Nt,"/request/".concat(e,"/vote"))},Tt=function(){var e=Object(O.a)(N.a.mark((function e(t){return N.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",j.a.patch(Nt,"/niche-cell/".concat(t,"/last-verified")));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),It=a(170),St=a(58),At={autoClose:5e3};var _t={updateOrCreate:function(e,t){return e&&St.b.isActive(e)?St.b.update(e,Object(m.a)(Object(m.a)({},At),t)):Object(St.b)(t.render,Object(m.a)(Object(m.a)({},At),t))}},Pt=function(e){var t={title:e.title,message:e.message,buttons:e.buttons.map((function(e){var t=e.text,a=e.onClick,n=Object(fe.a)(e,["text","onClick"]);return Object(m.a)({label:t,onClick:a},n)})),closeOnEscape:!0};Object(It.confirmAlert)(t)},Rt=function(e){St.b.success(e,{position:St.b.POSITION.TOP_RIGHT})},Dt=function(e){St.b.error(e,{autoClose:!1})},Lt=document.getElementsByTagName("body")[0],Ft=document.getElementsByClassName("modal-content"),Mt=function(){Object.keys(Ft).forEach((function(e){Ft[e].classList.add("wait")})),Lt.classList.add("wait"),document.onkeydown=function(){return!1}},qt=function(){Object.keys(Ft).forEach((function(e){Ft[e].classList.remove("wait")})),Lt.classList.remove("wait"),document.onkeydown=function(){return!0}},Ut=function(e,t,a,n){return function(){var r=Object(O.a)(N.a.mark((function r(c){return N.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,Mt(),x!==t.type&&(t.requestValue=t.type),T===t.type&&(t.requestValue=""),r.next=6,Ot(e.id,t);case 6:c(de({rowIndex:e.rowIndex,key:"hasActivePendingRequests",value:!0,column:e.columnId})),a(!1),r.next=14;break;case 10:return r.prev=10,r.t0=r.catch(0),console.error(r.t0),r.abrupt("return",r.t0.response.status);case 14:return r.prev=14,n(!1),qt(),r.finish(14);case 18:case"end":return r.stop()}}),r,null,[[0,10,14,18]])})));return function(e){return r.apply(this,arguments)}}()},Bt=function(e,t,a,n){return function(r,c){try{var l=c().user.userAttributes,s=l.name,o=l.email,i=l.picture,u=l.sub;Pt({title:"",message:"Are you sure you want to change this value?",buttons:[{text:"Yes",className:"btn btn-link",onClick:function(){var n=Object(O.a)(N.a.mark((function n(){var c,l,m,p,f,b,v,E,h;return N.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return Mt(),x!==t.type&&(t.requestValue=t.type),T===t.type&&(t.requestValue=""),n.prev=3,n.next=6,Ct(e.id,t);case 6:m=n.sent,p=(null===m||void 0===m||null===(c=m.data)||void 0===c?void 0:c.lastUpdatedAt)||(null===m||void 0===m||null===(l=m.data)||void 0===l?void 0:l.updatedAt),f={value:t.requestValue,hasActivePendingRequests:m.data.hasActivePendingRequest,updatedAt:p,colorCode:t.color?t.color:""},b=e.nicheName,v=e.rowIndex,E="".concat(b,"_last_verified"),Object.entries(f).forEach((function(t){var a=Object(d.a)(t,2),n=a[0],c=a[1];r(de({rowIndex:e.rowIndex,key:n,value:c,column:e.columnId}))})),h={updatedBy:{name:s,email:o,avatar:i,userId:u},updatedAt:new Date},Object.entries(h).forEach((function(e){var t=Object(d.a)(e,2),a=t[0],n=t[1];r(de({rowIndex:v,key:a,value:n,column:E}))})),Rt("Value changed successfully"),n.next=20;break;case 17:n.prev=17,n.t0=n.catch(3),Dt("Error occurred",n.t0);case 20:return n.prev=20,a(!1),qt(),n.finish(20);case 24:case"end":return n.stop()}}),n,null,[[3,17,20,24]])})));return function(){return n.apply(this,arguments)}}()},{text:"Cancel",className:"btn btn-primary",onClick:function(){var e=Object(O.a)(N.a.mark((function e(){return N.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n(!1),console.log("cancelled");case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()}]})}catch(m){a(!1),Dt("Error occurred"),console.log("error",m)}}},Ht=function(e,t){return function(){var a=Object(O.a)(N.a.mark((function a(n,r){var c,l,s,o,i,u,m,p,f,b,v,E,h,g,y;return N.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return Mt(),a.prev=1,c=r(),l=c.cellRequest,s=l.rowIndex,o=l.columnId,i=l.id,u=l.nicheName,a.next=6,kt(e,t);case 6:if(m=a.sent,p=t.status,n(ut(e,p)),t.status===I.APPROVED&&(f=c.user.userAttributes,b=f.name,v=f.email,E=f.picture,h=f.sub,g="".concat(u,"_last_verified"),y={updatedBy:{name:b,email:v,avatar:E,userId:h},updatedAt:new Date},Object.entries(y).forEach((function(e){var t=Object(d.a)(e,2),a=t[0],r=t[1];n(de({rowIndex:s,key:a,value:r,column:g}))}))),![I.APPROVED,I.REJECTED].includes(p)){a.next=15;break}return n(de({rowIndex:s,key:"hasActivePendingRequests",value:m.data.hasActivePendingRequest,column:o})),n(de({rowIndex:s,key:"updatedAt",value:m.data.lastUpdatedAt,column:o})),a.next=15,n(zt(i));case 15:p===I.APPROVED&&n(de({rowIndex:s,key:"value",value:m.data.value,column:o})),a.next=21;break;case 18:a.prev=18,a.t0=a.catch(1),console.log("error",a.t0);case 21:return a.prev=21,qt(),a.finish(21);case 24:case"end":return a.stop()}}),a,null,[[1,18,21,24]])})));return function(e,t){return a.apply(this,arguments)}}()},zt=function(e){return function(){var t=Object(O.a)(N.a.mark((function t(a){var n;return N.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,jt(e);case 2:n=t.sent,a(it(n.data));case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},Vt=a(730),Gt=a(755),Yt=a(731),Wt=a(732),Jt=function(e){var t=e.currentValue,a=e.dropDownItems,n=e.onItemClickCallBack,c=e.disabled;return r.a.createElement(Vt.a,{disabled:c},r.a.createElement(Gt.a,{caret:!0,color:"primary",className:"btn btn-sm"},t),r.a.createElement(Yt.a,{className:"smallDropdown"},a.map((function(e,t){return r.a.createElement(Wt.a,{onClick:function(t){return a=e.value,void n(a);var a},key:t},e.text)}))))},Qt=function(){var e=Object(p.c)((function(e){return e.user.userAttributes.hasFullPermission}));return Object(n.useMemo)((function(){return!0===e}),[e])},Kt=function(e){return Object(p.c)((function(e){return e.user.userAttributes.sub}))===e.id?r.a.createElement(r.a.Fragment,null,e.children):null},Xt=Object(n.createContext)(),$t=function(e){var t=Object(n.useState)(!1),a=Object(d.a)(t,2),c=a[0],l=a[1];return r.a.createElement(Xt.Provider,{value:[c,l]},e.children)},Zt=a(733),ea=function(e){var t=Be(!1),a=Object(d.a)(t,2),n=a[0],c=a[1],l=e.trigger,s=e.target,o=e.delay,i=e.children,u=e.placement,m=Object(fe.a)(e,["trigger","target","delay","children","placement"]);return r.a.createElement(Zt.a,Object.assign({placement:u,trigger:l,isOpen:n,target:s,delay:o,toggle:c},m),i)};ea.defaultProps={trigger:"hover",delay:{show:300,hide:50},placement:"right"};var ta=function(e){var t=Object(p.c)((function(e){return e.user.userAttributes.sub}));return Object(n.useMemo)((function(){return t===e}),[t,e])},aa=function(e){var t=e.cellData,a=Object(p.b)(),c=Object(n.useContext)(Xt),l=Object(d.a)(c,2)[1],s=Qt(),o=Object(n.useState)(t.hasVoted),i=Object(d.a)(o,2),u=i[0],m=i[1],f=Object(n.useState)(t.votes),b=Object(d.a)(f,2),h=b[0],g=b[1],y=Object(n.useState)(!1),j=Object(d.a)(y,2),x=j[0],C=j[1],k=ta(t.requestedBy),w=function(e){a(function(e,t){return function(){var a=Object(O.a)(N.a.mark((function a(n,r){var c;return N.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:try{c=null,Object(It.confirmAlert)({message:S,buttons:[{label:"Yes",className:" btn btn-link",onClick:function(){var a=Object(O.a)(N.a.mark((function a(){var l,s,o,i,u,m,d,p,f;return N.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,t(!1),c=St.b.info(A.DELETING_REQUEST,{autoClose:!1}),l=r(),s=l.cellRequest,o=s.rowIndex,i=s.columnId,a.next=7,xt(e);case 7:u=a.sent,n(de({rowIndex:o,key:"hasActivePendingRequests",value:u.data.hasActivePendingRequest,column:i})),_t.updateOrCreate(c,{type:St.b.TYPE.SUCCESS,render:A.SUCCESS}),a.next=18;break;case 12:a.prev=12,a.t0=a.catch(0),m=a.t0.response,d=void 0===m?{}:m,p=A.ERROR_GENERIC,422===d.status&&((f=d.data.message).includes(I.APPROVED)?p=A.ERROR_ALREADY_APPROVED:f.includes(I.REJECTED)&&(p=A.ERROR_ALREADY_REJECTED)),_t.updateOrCreate(c,{type:St.b.TYPE.ERROR,render:p});case 18:case"end":return a.stop()}}),a,null,[[0,12]])})));return function(){return a.apply(this,arguments)}}()},{label:"No",className:"btn btn-primary"}],closeOnClickOutside:!1})}catch(l){console.error(l)}case 1:case"end":return a.stop()}}),a)})));return function(e,t){return a.apply(this,arguments)}}()}(e,l))};return Object(n.useEffect)((function(){var e=u||k||[I.APPROVED,I.REJECTED].includes(t.status);C(e)}),[u,t.status,k]),r.a.createElement(r.a.Fragment,null,s?null:r.a.createElement("div",{className:"d-flex"},r.a.createElement("div",{className:" d-flex align-items-center flex-column pl-15 text-center"},r.a.createElement("div",{className:"d-flex align-items-center"},r.a.createElement(v.a,{size:"sm",outline:!u,color:"primary",className:"outline mr-1",id:"support-vote-".concat(t.id),disabled:x,onClick:function(){var e;x||(a((e=t.id,Object(O.a)(N.a.mark((function t(){return N.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,wt(e);case 3:t.next=9;break;case 5:t.prev=5,t.t0=t.catch(0),St.b.error(_.ERROR_GENERIC),console.error("Error ",t.t0);case 9:case"end":return t.stop()}}),t,null,[[0,5]])}))))),m(!0),g((function(e){return e+1})))}},r.a.createElement("span",null," ",r.a.createElement("b",null,"+1"))),!u&&r.a.createElement(ea,{key:"support-vote-".concat(t.id),target:"support-vote-".concat(t.id)},"Click and support"),r.a.createElement("span",null,h)),r.a.createElement("div",{className:"d-flex"},r.a.createElement("div",{className:"text-muted f10 mt-1"},u?"You have supported!":"Support this request"))),r.a.createElement("div",{className:"ml-2"},r.a.createElement(Kt,{id:t.requestedBy,className:"mt-2"},r.a.createElement("span",{className:"deleteRequest"},r.a.createElement(E.h,{cursor:"pointer",onClick:function(){return w(t.id)},title:"Delete this request"}))))))},na=a(27),ra=a.n(na),ca=function(e){var t=e.children,a=e.isOpen,n=e.toggle,c=e.modalHeader;return r.a.createElement(mt.a,{isOpen:a,toggle:n},r.a.createElement(dt.a,{toggle:n,className:"p-8 f16"},c),r.a.createElement(pt.a,{className:"p-8"},!ne.a.isEmpty(t)&&r.a.createElement("div",{className:"noteHeight"},ra()(t))))},la=a(366),sa=function(e){var t=r.a.useState(!1),a=Object(d.a)(t,2),c=a[0],l=a[1],s=r.a.useState(!1),o=Object(d.a)(s,2),i=o[0],u=o[1],m=Be(!1),p=Object(d.a)(m,2),f=p[0],b=p[1],v=Object(n.useRef)(null),E=function(t){t.preventDefault(),"modal"===e.toggleType?b():l((function(e){return!e}))};return r.a.createElement(r.a.Fragment,null,"modal"===e.toggleType&&r.a.createElement(ca,{isOpen:f,toggle:b,modalHeader:e.modalHeader},e.value?e.value:e.children),!c&&r.a.createElement(la.a,{ref:v,lines:e.lines+1,onTruncate:function(e){u(e)},ellipsis:r.a.createElement("span",null,r.a.createElement("br",null),r.a.createElement("a",{href:"#",onClick:E},e.moreText))},r.a.createElement("div",null,isNaN(e.children)?e.children:"".concat(e.children))),i&&c&&r.a.createElement("div",null,e.children,r.a.createElement("span",null,r.a.createElement("br",null),r.a.createElement("a",{href:"#",onClick:E},e.lessText))))};sa.defaultProps={lines:5,moreText:"Read more",lessText:"Read less",toggleType:"inline",modalHeader:"Modal"};var oa=r.a.memo(sa),ia=a(736),ua=I.REJECTED,ma=function(){var e=Object(p.b)(),t=Object(p.c)((function(e){return e.cellRequest})),a=t.showRequestRejectionModal,c=t.requestId,l=Object(n.useState)(""),s=Object(d.a)(l,2),o=s[0],i=s[1],u=Object(n.useState)(210),m=Object(d.a)(u,2),f=m[0],b=m[1],E=function(){e({type:"CLOSE_REQUEST_REJECTION_MODAL"})},h=function(){var t=Object(O.a)(N.a.mark((function t(){return N.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e(Ht(c,{status:ua,rejectionReason:o}));case 2:E();case 3:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return r.a.createElement(mt.a,{isOpen:a,toggle:E},r.a.createElement(dt.a,{toggle:E,className:"p-15 f16"},"Reason For Rejection (Optional)"),r.a.createElement(pt.a,{className:"p-15"},r.a.createElement("textarea",{className:"form-control rejectionModal",value:o,onChange:function(e){var t=e.target.value.replace(/ +/g," ");b(210-t.length),i(t)},maxLength:210}),r.a.createElement("span",{className:"rightAlign"},"".concat(f," characters left"))),r.a.createElement(ia.a,null,r.a.createElement(v.a,{className:"btn btn-link dark",color:"link",onClick:E},"Cancel"),r.a.createElement(v.a,{className:"btn btn-primary",color:"primary",onClick:h},"Reject")))},da=function(e){var t,a,c=e.requestData,l=e.format,s=Object(p.b)(),o=[{value:"Pending",text:"Pending"},{value:"In Review",text:"In Review"},{value:"Approved",text:"Approved"},{value:"Rejected",text:"Rejected"}],i=Qt(),u=c.id,m=c.userAvatar,d=c.userName,f=c.createdAt,b=c.status,v=c.source,E=c.lenderName,h=c.columnLabel,g=c.value,y=c.rejectionReason,N=(t=b)===I.APPROVED||t===I.REJECTED,O=Object(n.useCallback)((function(e,t){e!==I.REJECTED?s(Ht(t,{status:e})):s(function(e){return{type:"SHOW_REQUEST_REJECTION_MODAL",payload:{requestId:e}}}(t))}),[s]);return r.a.createElement("div",{className:"previousRequest p-8"},r.a.createElement("div",{className:"request__userImage d-flex justify-content-between"},r.a.createElement("div",{className:"d-flex align-items-start "},r.a.createElement("div",{className:"roundedImage mr-2"}," ",r.a.createElement("img",{src:m,className:"img-fluid",alt:"U"})),r.a.createElement("div",{className:"mr-15 fixWidth"},r.a.createElement("div",{className:"request__name "}," ",d),r.a.createElement("div",{className:"request__date text-muted "},(a=(a=f).split("T")[0],De()(a).format("D MMM YYYY")))),r.a.createElement("div",{className:"".concat(b," statusWrapper")},i?r.a.createElement(Jt,{currentValue:b,dropDownItems:o,onItemClickCallBack:function(e){return O(e,u)},disabled:N}):r.a.createElement("h4",{className:"badgeWrp"},r.a.createElement(ke.a,{className:b,color:"primary"},b))),b===I.REJECTED&&y&&r.a.createElement("span",{id:"cellRequest-".concat(u),className:"mt-1 ml-2 info-icon"},r.a.createElement(ot.c,{size:"24"}),r.a.createElement(ea,{key:"cellRequest-".concat(u),target:"cellRequest-".concat(u)},y)),r.a.createElement(ma,null)),r.a.createElement(aa,{cellData:c})),r.a.createElement("div",{className:"mb-3 mt-1"},r.a.createElement("span",null," ",ra()(h)," "),"for ",r.a.createElement("i",null,E,":"),r.a.createElement("div",{className:"f600 text-break"},r.a.createElement(oa,{lines:3},function(e,t){switch(t){case F.TIME_VALUE:return Le(e);case F.STRING:return ra()(e);default:return e}}(g,l)))),r.a.createElement("div",null,r.a.createElement("div",{className:"f600 text-muted"},r.a.createElement("i",null,"Source")),r.a.createElement("div",{className:"text-break"},r.a.createElement(oa,{lines:3},v))))},pa=a(101);var fa=function(){return r.a.createElement("div",{className:"wrapper logoLoader"},r.a.createElement("div",{className:"wrapperInner"},r.a.createElement("div",{className:"outer"},r.a.createElement("span",{className:"first mb"})),r.a.createElement("div",{className:"outer"},r.a.createElement("span",{className:"second mb"}),r.a.createElement("span",{className:"third mb"})),r.a.createElement("div",{className:"outer"},r.a.createElement("span",{className:"fourth mb"}),r.a.createElement("span",{className:"fifth mb"})),r.a.createElement("div",{className:"outer"},r.a.createElement("span",{className:"sixth mb"})),r.a.createElement("div",{className:"outer"},r.a.createElement("span",{className:"seventh"}),r.a.createElement("span",{className:"eighth"}))))},ba=function(e){var t=e.format,a=Object(p.c)((function(e){return e.cell.cellData})),c=Object(p.c)((function(e){return e.cellRequest})),l=Object(n.useState)(!0),s=Object(d.a)(l,2),o=s[0],i=s[1],u=Object(p.b)();return Object(n.useEffect)((function(){Object(O.a)(N.a.mark((function e(){return N.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u(zt(c.id));case 2:i(!1);case 3:case"end":return e.stop()}}),e)})))()}),[]),r.a.createElement(pa.Scrollbars,{autoHeight:!0,autoHeightMin:200,autoHeightMax:450},r.a.createElement("div",{className:"pr-4"},o||ne.a.isEmpty(a)?r.a.createElement("div",null,o&&r.a.createElement("div",{className:"listLogoLoader"},r.a.createElement(fa,null)),!o&&r.a.createElement("div",{className:"d-flex align-items-center justify-content-center blankInfo"}," There has been no update requests yet.")):a.map((function(e,a){return r.a.createElement(da,{requestData:e,key:a,format:t})}))))},va=a(25),Ea=a(34),ha=function(e,t,a){var n={yesNo:Ea.d().required("This field is required"),percentage:Ea.b().min(0,"Percentage must be 0 or more").required("This field is required"),string:Ea.d().required("This field is required"),timeValue:Ea.b().min(0,"Time value must be 0 or more").required("This field is required"),number:Ea.b().integer("This field cannot have a decimal point.").required("This field is required and should be a number."),float:Ea.b().required("This field is required."),currency:Ea.d().required("This field is required")},r=e;return e===F.NUMBER&&t===F.FLOAT&&(r=F.FLOAT),Ea.c({type:Ea.d().required("This field is required"),requestValue:"general"===a?n[r]:Ea.a(),source:Ea.d().transform((function(e){return e.trim()})).required("This field is required"),color:Ea.a(),nicheId:Ea.d(),nicheLabel:Ea.d(),nicheName:Ea.d(),lenderName:Ea.d(),columnLabel:Ea.d(),columnFormat:Ea.d()})},ga=a(104),ya=function(e){var t=e.label,a=(e.type,e.name),n=e.id,c=e.value,l=e.inputClassNames,s=e.labelClassNames,o=(e.isDisabled,e.onClick),i=e.fieldOptions,u=Object(fe.a)(e,["label","type","name","id","value","inputClassNames","labelClassNames","isDisabled","onClick","fieldOptions"]);return"undefined"===typeof i||ne.a.isEmpty(i)?r.a.createElement(h.a,{check:!0},r.a.createElement(g.a,{check:!0,className:"mr-3 mt-8"},r.a.createElement(va.b,Object.assign({className:"form-control ".concat(l),type:"radio",id:n,name:a,value:c,onClick:o},u))," ",r.a.createElement("label",{className:s,htmlFor:n}," ",t)),r.a.createElement(va.a,{className:"errorMsg",name:a,component:"div"})):i.map((function(e,t){return r.a.createElement(h.a,{key:t,check:!0},r.a.createElement(g.a,{check:!0,className:"mr-3 mt-8"},r.a.createElement(va.b,Object.assign({className:"form-control ".concat(l),type:"radio",id:e.id,name:a,value:e.value,onClick:o},u))," ",r.a.createElement("label",{className:s,htmlFor:e.id}," ",ra()(e.label))))}))};function Na(e){var t=e.onSourceChange,a=Object(fe.a)(e,["onSourceChange"]);return r.a.createElement("textarea",Object.assign({},a,{onChange:function(e){a.onChange(e),t(e)}}))}var Oa=function(e){var t=e.label,a=(e.type,e.name),n=e.id,c=(e.value,e.inputClassNames),l=e.labelClassNames,s=Object(fe.a)(e,["label","type","name","id","value","inputClassNames","labelClassNames"]);return r.a.createElement(h.a,null,r.a.createElement(g.a,{for:n,className:l},ra()(t)),r.a.createElement(va.b,Object.assign({className:"form-control ".concat(c),as:Na,name:a},s)),r.a.createElement(va.a,{className:"errorMsg",name:a,component:"div"}))},ja=function(e){var t=e.label,a=(e.type,e.name),n=e.id,c=(e.value,e.inputClassNames),l=e.labelClassNames,s=(e.isDisabled,e.onClick),o=Object(fe.a)(e,["label","type","name","id","value","inputClassNames","labelClassNames","isDisabled","onClick"]);return r.a.createElement(h.a,null,r.a.createElement(g.a,{for:n,className:l},ra()(t)),r.a.createElement("div",{className:"d-flex mb-15"},K.map((function(e,t){return r.a.createElement("div",{key:t,className:"custom-radios mb-1"},r.a.createElement("div",{className:"mr-1"},r.a.createElement(va.b,Object.assign({className:"form-control ".concat(c),type:"radio",id:e.id,name:a,value:e.value,onClick:s},o))," ",r.a.createElement("label",{className:"".concat(l," hide-default-radio"),htmlFor:e.id},r.a.createElement("span",{className:"d-flex align-items-center justify-content-center"},r.a.createElement(E.i,{className:"tick"})))))}))))},xa=function(e){var t=e.control,a=e.component,n=Object(fe.a)(e,["control","component"]);switch(t){case"custom":var c=a;return r.a.createElement(c,n);case"radio":return r.a.createElement(ya,n);case"textarea":return r.a.createElement(Oa,n);case"colorRadio":return r.a.createElement(ja,n);default:return null}},Ca=function(e){var t,a=e.label,n=e.name,c=e.id,l=e.value,s=e.isDisabled,o=e.onChange,i=(t=l,{years:Math.floor(t/365),months:Math.floor(t%365/30),days:Math.floor(t%365%30)}),u="year",m="month",d="day",p=function(e,t){var a,n,r,c=parseInt(e.target.value),l=isNaN(c)?0:c;switch(t){case u:a=i.days,n=Me(l),r=Fe(i.months);break;case m:a=i.days,n=Me(i.years),r=Fe(l);break;case d:a=l,n=Me(i.years),r=Fe(i.months);break;default:return null}o({target:{value:n+r+a}})};return r.a.createElement(h.a,null,r.a.createElement(g.a,{for:c},ra()(a)),r.a.createElement(f.a,null,r.a.createElement(Ke,{name:n,displayType:"input",className:"form-control",defaultValue:i.years,onChange:function(e){return p(e,u)},allowNegative:!1,disabled:s,allowDecimal:!1}),r.a.createElement(Ye.a,{addonType:"append"},r.a.createElement(We.a,null,"years")),r.a.createElement(Ke,{name:n,displayType:"input",className:"form-control",defaultValue:i.months,onChange:function(e){return p(e,m)},allowNegative:!1,disabled:s,allowDecimal:!1,digitLimit:"11"}),r.a.createElement(Ye.a,{addonType:"append"},r.a.createElement(We.a,null,"months")),r.a.createElement(Ke,{name:n,displayType:"input",className:"form-control",defaultValue:i.days,onChange:function(e){return p(e,d)},allowNegative:!1,disabled:s,allowDecimal:!1,digitLimit:"29"}),r.a.createElement(Ye.a,{addonType:"append"},r.a.createElement(We.a,null,"days"))),r.a.createElement(va.a,{className:"errorMsg",name:n,component:"div"}))},ka=function(e){var t=e.label,a=e.name,n=e.id,c=e.value,l=e.inputClassNames,s=e.labelClassNames,o=e.isDisabled,i=e.selectOptions,u=e.onChange;return r.a.createElement(h.a,null,r.a.createElement(g.a,{for:n,className:s},ra()(t)),r.a.createElement(va.b,{className:"form-control ".concat(l),as:"select",name:a,value:c,disabled:o,onChange:u},i.map((function(e,t){return r.a.createElement("option",{key:t,value:e.trim()},e.trim())}))),r.a.createElement(va.a,{className:"errorMsg",name:a,component:"div"}))},wa=function(e){var t=e.label,a=e.name,n=e.id,c=e.inputClassNames,l=e.labelClassNames,s=e.value,o=e.isDisabled,i=Object(fe.a)(e,["label","name","id","inputClassNames","labelClassNames","value","isDisabled"]);return r.a.createElement(h.a,null,r.a.createElement(g.a,{for:n,className:l},ra()(t)),r.a.createElement(f.a,null,r.a.createElement(va.b,Object.assign({className:"form-control ".concat(c),type:"number",min:0,value:s,name:a,disabled:o},i)),r.a.createElement(Ye.a,{addonType:"append"},r.a.createElement(We.a,null,"%"))),r.a.createElement(va.a,{className:"errorMsg",name:a,component:"div"}))},Ta=function(e){var t=e.label,a=e.name,n=e.id,c=e.inputClassNames,l=e.labelClassNames,s=e.value,o=e.isDisabled,i=Object(fe.a)(e,["label","name","id","inputClassNames","labelClassNames","value","isDisabled"]);return r.a.createElement(h.a,null,r.a.createElement(g.a,{for:n,className:l},ra()(t)),r.a.createElement(f.a,null,r.a.createElement(Ye.a,{addonType:"prepend"},r.a.createElement(We.a,null,"$")),r.a.createElement(va.b,Object.assign({className:"form-control ".concat(c),type:"text",value:s,name:a,disabled:o,as:Ke},i))),r.a.createElement(va.a,{className:"errorMsg",name:a,component:"div"}))},Ia=function(e){var t=e.label,a=e.type,n=e.name,c=e.id,l=e.value,s=e.inputClassNames,o=e.labelClassNames,i=e.isDisabled,u=Object(fe.a)(e,["label","type","name","id","value","inputClassNames","labelClassNames","isDisabled"]);return r.a.createElement(h.a,null,r.a.createElement(g.a,{for:c,className:o},ra()(t)),r.a.createElement(va.b,Object.assign({className:"form-control ".concat(s),type:a,name:n,value:l,disabled:i},u)),r.a.createElement(va.a,{className:"errorMsg",name:n,component:"div"}))},Sa=a(215);function Aa(e){var t=e.options,a=e.onChange,n=e.value,c=e.disabled;return r.a.createElement(Sa.a,{isDisabled:c,type:"select",isMulti:!0,options:t,className:"basic-multi-select",classNamePrefix:"select",onChange:function(e){var t={target:{value:Array.isArray(e)?e.map((function(e){return e.value})).join(","):""}};a(t)},value:function(){var e=n.split(",").map(ne.a.trim);return t.filter((function(t){return e.includes(t.value)}))}(),theme:function(e){return Object(m.a)(Object(m.a)({},e),{},{colors:Object(m.a)(Object(m.a)({},e.colors),{},{danger:"white",dangerLight:"#27ADE7",primary:"#9ad9f4"})})}})}var _a=function(e){var t=e.label,a=e.name,n=e.id,c=e.value,l=e.inputClassNames,s=e.labelClassNames,o=e.isDisabled,i=e.selectOptions,u=Object(fe.a)(e,["label","name","id","value","inputClassNames","labelClassNames","isDisabled","selectOptions"]),m=r.a.useMemo((function(){return i.map((function(e){var t=e.trim();return{label:t,value:t}}))}),[i]);return r.a.createElement(h.a,null,r.a.createElement(g.a,{for:n,className:s},ra()(t)),r.a.createElement(va.b,Object.assign({className:"form-control ".concat(l),name:a,value:c,disabled:o,options:m},u,{as:Aa})),r.a.createElement(va.a,{className:"errorMsg",name:a,component:"div"}))},Pa=function(e){var t=e.label,a=e.type,n=e.name,c=e.id,l=e.value,s=e.inputClassNames,o=e.labelClassNames,i=e.isDisabled,u=Object(fe.a)(e,["label","type","name","id","value","inputClassNames","labelClassNames","isDisabled"]);return r.a.createElement(h.a,null,r.a.createElement(g.a,{for:c,className:o},ra()(t)),r.a.createElement(va.b,Object.assign({className:"form-control ".concat(s),type:a,name:n,value:l,disabled:i,as:Ke},u)),r.a.createElement(va.a,{className:"errorMsg",name:n,component:"div"}))},Ra=a(251),Da=a.n(Ra),La={display:["INLINE_STYLE_BUTTONS","BLOCK_TYPE_BUTTONS","LINK_BUTTONS"],INLINE_STYLE_BUTTONS:[{label:"Bold",style:"BOLD"},{label:"Italic",style:"ITALIC"},{label:"Underline",style:"UNDERLINE"}],BLOCK_TYPE_BUTTONS:[{label:"UL",style:"unordered-list-item"},{label:"OL",style:"ordered-list-item"}]},Fa=function(e){var t=e.value,a=e.onChange,n=e.setFieldTouched,c=Object(fe.a)(e,["value","onChange","setFieldTouched"]),l=r.a.useState((function(){return Da.a.createValueFromString(t,"html")})),s=Object(d.a)(l,2),o=s[0],i=s[1];return r.a.createElement(Da.a,Object.assign({value:o,onChange:function(e){i(e);var t=e.toString("html"),n={target:{value:""===An(t).trim()?"":t}};a&&a(n)},toolbarConfig:La},c,{onBlur:function(){n&&n(c.name,!0)}}))};Fa.defaultProps={value:"",onChange:function(){}};var Ma=Fa,qa=function(e){var t=e.label,a=(e.type,e.name),n=e.id,c=e.value,l=(e.inputClassNames,e.labelClassNames),s=e.isDisabled,o=Object(fe.a)(e,["label","type","name","id","value","inputClassNames","labelClassNames","isDisabled"]);return r.a.createElement(h.a,null,r.a.createElement(g.a,{for:n,className:l},ra()(t)),r.a.createElement(va.b,Object.assign({name:a,value:c,disabled:s,readOnly:s},o,{as:Ma})),r.a.createElement(va.a,{className:"errorMsg",name:a,component:"div"}))},Ua=function(e){var t=e.column,a=Object(fe.a)(e,["column"]);if("undefined"===typeof t)return null;switch(t.format){case F.YES_NO:return r.a.createElement(ka,Object.assign({},a,{selectOptions:["Yes","No"]}));case F.PERCENTAGE:return r.a.createElement(wa,a);case F.STRING:return r.a.createElement(qa,a);case F.TIME_VALUE:return r.a.createElement(Ca,a);case F.NUMBER:return t.type===F.FLOAT?r.a.createElement(Pa,Object.assign({type:"text"},a)):r.a.createElement(Ia,Object.assign({type:"number"},a));case F.FLOAT:return r.a.createElement(Ia,Object.assign({type:"number",step:"0.01"},a));case F.CURRENCY:return r.a.createElement(Ta,a);case F.ENUM:return r.a.createElement(ka,Object.assign({},a,{selectOptions:t.properties.split(",")}));case F.ENUM_MULTI:return r.a.createElement(_a,Object.assign({},a,{selectOptions:t.properties.split(",")}));default:return null}},Ba=function(e){var t=e.hasFullPermission,a=e.headerInfo,c=Object(p.b)(),l=Object(n.useState)(t),s=Object(d.a)(l,1)[0],o=Object(n.useContext)(Xt),i=Object(d.a)(o,2)[1],u=Object(p.c)((function(e){return e.cellRequest})),f=Object(n.useRef)(function(e){return""===e?T:[C,k,w,T].includes(e)?e:x}(u.value)),b=Object(n.useState)(f.current),h=Object(d.a)(b,2),g=h[0],y=h[1],j=Object(n.useRef)(function(e,t,a){return x!==t?"":F.STRING!==a||/<[a-z/][\s\S]*>/i.test(e)?e:"".concat(e.replace(/\n/g,""),"
")}(u.value,g,a.metadata.format)),I=Object(n.useState)(j.current),S=Object(d.a)(I,2),A=S[0],_=S[1],P=Object(n.useState)(x!==g),R=Object(d.a)(P,2),D=R[0],L=R[1],q=Object(n.useState)(!1),U=Object(d.a)(q,2),B=U[0],H=U[1],z=Object(n.useState)(!0),V=Object(d.a)(z,2),G=V[0],Y=V[1],W=Object(n.useState)(""),J=Object(d.a)(W,2),Q=J[0],K=J[1],X=Object(p.c)((function(e){return e.cell.cellData})),$=Object(p.c)((function(e){return e.user.userAttributes.id})),Z=Object(n.useState)(""),ee=Object(d.a)(Z,2),te=ee[0],ae=ee[1],re=Object(n.useRef)(u.colorCode||"White"),ce=Object(n.useState)(re.current),le=Object(d.a)(ce,2),se=le[0],oe=le[1],ie=function(e,t,a){return!t&&e.some((function(e){return e.requestedBy===a&&["Pending","In Review"].includes(e.status)}))}(X,t,$),ue=["number","float"].includes(a.metadata.type),me=function(e){var t=e.target.value,n=!0;if(y(t),x!==t)L(!0),n=t===f.current;else switch(L(!1),a.metadata.format){case F.YES_NO:_("Yes"),n=!1;break;case F.ENUM:var r=a.metadata.properties||"";_(r.substring(0,r.indexOf(","))),n=""===r.trim();break;default:n=(A===j.current||""===A)&&se===re.current}ae(""),Y(n)},de=function(e,t){return(ie||""===e||e===j.current||!function(e){if(a.metadata.format!==F.ENUM_MULTI)return!0;var t=j.current?j.current.split(",").map((function(e){return e.trim()})):[],n=e.split(",");return e.length>0&&ne.a.xor(n,t).length>0}(e))&&t===re.current},pe=function(e){var t=e.target.value,a=t&&ue?+t:t;Y(de(a,se)),_(a),ae("")},fe=function(e){K(e.target.value)},be=function(){var e=Object(O.a)(N.a.mark((function e(t){var a;return N.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(H(!0),a=Object(m.a)(Object(m.a)({},t),{},{requestValue:ue?+t.requestValue:t.requestValue,source:t.source.trim()}),!s){e.next=6;break}c(Bt(u,a,i,H)),e.next=10;break;case 6:return e.next=8,c(Ut(u,a,i,H));case 8:409===e.sent&&ae("The same request already exists. Please support this request from the current requests tab.");case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ve=function(e){var t=e.target.value;oe(t),Y(de(A,t)&&g===f.current)};return r.a.createElement(va.d,{initialValues:{type:g,requestValue:A,source:Q,color:se,nicheId:u.nicheId,nicheLabel:u.nicheLabel,nicheName:u.nicheName,lenderName:u.lenderName,columnLabel:u.columnLabel,columnFormat:u.columnFormat},validationSchema:ha(a.metadata.format,a.metadata.type,g),onSubmit:be,enableReinitialize:!0},(function(e){return r.a.createElement(va.c,{noValidate:!0},ie?r.a.createElement("div",{className:"d-flex mb-15 warningMsg warningPanel align-items-top"},r.a.createElement(E.l,{className:"iconfont mr-1"}),r.a.createElement("span",null,"You already have an existing request in this cell. Delete it first to add a new one.")):r.a.createElement("div",{className:"d-flex mb-15"},r.a.createElement(xa,{control:"radio",name:"type",onClick:me,fieldOptions:M,labelClassNames:"innerCheckBox"})),r.a.createElement(va.a,{className:"errorMsg",name:"type",component:"div"}),r.a.createElement(xa,{control:"custom",component:Ua,label:a.Header,name:"requestValue",isDisabled:D,onChange:pe,value:A,column:a.metadata,setFieldTouched:e.setFieldTouched}),s&&r.a.createElement(xa,{control:"colorRadio",name:"color",onClick:ve,label:"Color"}),r.a.createElement(xa,{control:"textarea",label:"Add Source",name:"source",id:"requestSource",onSourceChange:fe}),te?r.a.createElement("div",{className:"d-flex mb-15 warningMsg warningPanel align-items-top"},r.a.createElement(E.l,{className:"iconfont mr-1"}),r.a.createElement("span",null,te)):"",r.a.createElement("div",{className:"d-flex justify-content-end mt-8"},r.a.createElement(v.a,{size:"sm",color:"link",className:"mr-2",disabled:B,onClick:function(){return i(!1)}}," Cancel "),r.a.createElement(v.a,{type:B||G?"button":"submit",size:"sm",color:"primary",disabled:B||G,className:"d-flex align-items-center justify-content-center"},r.a.createElement("div",{className:"mr-4 loderSmall"},r.a.createElement(ga.ClipLoader,{size:15,color:"#fff",loading:B})),!0===t?"Update":"Send request")))}))},Ha=function(e){var t=e.headerInfo,a=Object(n.useState)(1),c=Object(d.a)(a,2),l=c[0],s=c[1],o=Qt(),i=Object(p.b)(),u=Object(n.useContext)(Xt),m=Object(d.a)(u,2),f=m[0],b=m[1],v=function(e){l!==e&&s(e)},E=function(){i(function(){var e=Object(O.a)(N.a.mark((function e(t){return N.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t(it([]));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),b(!f)};return r.a.createElement(mt.a,{isOpen:f,toggle:E,onClosed:function(){return s(1)}},r.a.createElement(dt.a,{toggle:E,className:"p-15 f16"}," Update request"),r.a.createElement(pt.a,{className:"p-15"},r.a.createElement(ft.a,{tabs:!0},r.a.createElement(bt.a,null,r.a.createElement(vt.a,{className:yt()({active:1===l}),onClick:function(){v(1)}},"Current requests")),r.a.createElement(bt.a,null,r.a.createElement(vt.a,{className:yt()({active:2===l}),onClick:function(){v(2)}},!0===o?"Update value":"New request"))),r.a.createElement(Et.a,{activeTab:l},r.a.createElement(ht.a,{tabId:1,className:"pt-8"},r.a.createElement(ba,{format:t.metadata.format})),r.a.createElement(ht.a,{tabId:2,className:"pt-8"},r.a.createElement(Ba,{hasFullPermission:o,headerInfo:t})))))},za=function(e){var t=e.cellInfo,a=e.headerInfo,c=e.rowIndex,l=e.id,s=e.rowInfo,o=Object(p.b)(),i=Object(n.useContext)(Xt),u=Object(d.a)(i,2)[1];return r.a.createElement(r.a.Fragment,null,r.a.createElement(E.j,{onClick:function(){var e,n,r,l,i,d;u(!0),o(me()),o(function(e,t){return{type:"SET_REQUEST_FORM_METADATA",payload:Object(m.a)(Object(m.a)({},e),{},{rowIndex:t,colorCode:e.colorCode||""})}}(Object(m.a)(Object(m.a)({},t),{},{lenderName:null===s||void 0===s||null===(e=s.original)||void 0===e||null===(n=e.lender)||void 0===n?void 0:n.name,nicheName:null===a||void 0===a||null===(r=a.parent)||void 0===r?void 0:r.id,nicheLabel:null===a||void 0===a||null===(l=a.parent)||void 0===l?void 0:l.Header,nicheId:null===a||void 0===a||null===(i=a.parent)||void 0===i?void 0:i.nicheId,columnLabel:null===a||void 0===a?void 0:a.Header,columnFormat:null===a||void 0===a||null===(d=a.metadata)||void 0===d?void 0:d.format}),c))},id:l}),r.a.createElement(Ha,{headerInfo:a}))},Va=a(745),Ga=function(e){var t=e.value,a=e.isModalOpen,n=e.toggle,c=function(e){return n(!e)};return r.a.createElement(mt.a,{isOpen:a,toggle:c},r.a.createElement(dt.a,{toggle:c,className:"p-8 f16"},"Notes"),r.a.createElement(pt.a,{className:"p-8"},ne.a.isEmpty(t)?r.a.createElement(Va.a,{color:"secondary",className:"text-center"},"No notes available"):r.a.createElement("div",{className:"noteHeight"},ra()(t))))},Ya=function(e){var t=e.value,a=Be(!1),n=Object(d.a)(a,2),c=n[0],l=n[1],s=function(e){return l(!e)};return t?r.a.createElement(r.a.Fragment,null,r.a.createElement(v.a,{size:"sm",color:"link",onClick:s},"View"),r.a.createElement(Ga,{isModalOpen:c,toggle:s,value:t})):null},Wa=a(243),Ja=a.n(Wa);var Qa=function(e){var t=e.value,a=e.isModalOpen,c=e.toggle,l=Object(p.b)(),s=t.updatedAt,o=t.updatedBy,i=t.cellId,u=t.rowIndex,m=t.columnId,d=Object(n.useCallback)((function(e){return c(!e)}),[]),f=Object(n.useCallback)((function(){l(function(e){var t=e.cellId,a=e.rowIndex,n=e.columnId,r=e.toggleModal;return function(e,c){try{var l=c().user.userAttributes,s=l.name,o=l.email,i=l.picture,u=l.sub;Pt({title:"",message:"Are you sure you want to verify these niche policies?",buttons:[{text:"Yes",className:"btn btn-link",onClick:function(){var c=Object(O.a)(N.a.mark((function c(){var l,m;return N.a.wrap((function(c){for(;;)switch(c.prev=c.next){case 0:return Mt(),c.prev=1,c.next=4,Tt(t);case 4:l=c.sent,m=l.data.updatedAt,e(de({rowIndex:a,key:"updatedBy",value:{name:s,email:o,avatar:i,userId:u},column:n})),e(de({rowIndex:a,key:"updatedAt",value:m,column:n})),Rt("Verified successfully"),c.next=15;break;case 11:c.prev=11,c.t0=c.catch(1),Dt("Error occurred",c.t0),r();case 15:return c.prev=15,qt(),r(),c.finish(15);case 19:case"end":return c.stop()}}),c,null,[[1,11,15,19]])})));return function(){return c.apply(this,arguments)}}()},{text:"Cancel",className:"btn btn-primary",onClick:function(){var e=Object(O.a)(N.a.mark((function e(){return N.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:console.info("cancelled");case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()}]})}catch(m){Dt("Error occurred"),console.error("Error:",m)}}}({cellId:i,rowIndex:u,columnId:m,toggleModal:d}))}),[l,d,i,u,m]),b=r.a.useMemo((function(){return o&&"object"===typeof o&&o.name?o.name:"System"}),[o]);return r.a.createElement(mt.a,{isOpen:a,toggle:d},r.a.createElement(dt.a,{toggle:d,className:"p-8 f16"},"Last Verified"),r.a.createElement(pt.a,{className:"p-8"},r.a.createElement("p",null,r.a.createElement("em",null,s)),r.a.createElement("p",null,r.a.createElement("em",null,b)),r.a.createElement(v.a,{color:"primary",onClick:f},"Verify Now")))},Ka=function(e){var t=e.value,a=Be(!1),n=Object(d.a)(a,2),c=n[0],l=n[1],s=function(e){for(var t=Math.floor((new Date-new Date(e))/1e3),a=0,n=[{label:"year",seconds:31536e3},{label:"month",seconds:2592e3},{label:"week",seconds:604800},{label:"day",seconds:86400},{label:"hour",seconds:3600},{label:"minute",seconds:60},{label:"second",seconds:1}];a=1)return 1===c?"".concat(c," ").concat(r.label," ago"):"".concat(c," ").concat(r.label,"s ago")}return"Just now"}(t.updatedAt),o=function(e){return l(!e)};return r.a.createElement("div",{style:{marginTop:"1em"}},r.a.createElement("em",null,s||""),r.a.createElement(v.a,{size:"sm",color:"link",onClick:o},"More details"),r.a.createElement(Qa,{isModalOpen:c,toggle:o,value:Object(m.a)(Object(m.a)({},t),{},{updatedAt:s})}))};var Xa=function(e){var t,a=e.cellInfo,c=e.headerInfo,l=e.rowInfo,s=a.value,o=a.updatedAt,i=a.hasActivePendingRequests,u=a.columnId,m=a.updatedBy,d=a.id,f=l.id,b=l.index,v=De()(o).format("MMM DD, YYYY h:mm a"),E=De()(v).fromNow(!0),h="".concat(Ja()(l,"values.lender.value","")," - ").concat(c.Header),g=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=t.format;if(ne.a.isNull(e)||Se.includes(e))return e;switch(a){case R:return Te()(e).format("0.00%");case D:return Te()(e).format("$0,0.00");case L:return Le(e);case F.STRING:return An(e);default:return e}}(s,c.metadata),y=Object(p.c)((function(e){return e.tableInfo.focusCell}));return Object(n.useEffect)((function(){""!==y&&y===a.id&&document.getElementById("focus-cell").scrollIntoView({block:"center",behavior:"smooth"})}),[y]),r.a.createElement($t,null,r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{className:"cellItemInner"},r.a.createElement("div",{className:" cellHover d-flex align-items-center justify-content-between"},null===c.id.match(Y)&&r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{className:"ml-n2"},i&&r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{className:"pendingNotation",id:"pending-request-".concat(f)}),r.a.createElement(ea,{key:"pending-request-".concat(f),target:"pending-request-".concat(f)},"Has a pending request")),r.a.createElement("div",{className:"hoverItems"},r.a.createElement("span",{id:"calendar-".concat(f,"-").concat(u),className:"dateEdit"},r.a.createElement("div",{className:"d-flex align-items-center justify-content-between"},r.a.createElement(ot.a,null),r.a.createElement("div",{className:"mt-1 ml-1"},function(e){var t=e.split(" ");return t.map((function(e,a){if("hour"===e||"hours"===e||"minute"===e||"minutes"===e||"second"===e||"seconds"===e||"a"===t[a-1]&&"few"===e&&"seconds"===t[a+1])return"0 day";if("day"===e||"days"===e){if("a"===t[a-1])return"1 day";if(!isNaN(parseInt(t[a-1])))return t[a-1]+" days"}else if("month"===e||"months"===e){if("a"===t[a-1])return"1 month";if(!isNaN(parseInt(t[a-1])))return t[a-1]+" months"}else if("year"===e||"years"===e){if("a"===t[a-1])return"1 year";if(!isNaN(parseInt(t[a-1])))return t[a-1]+" years"}return e}))[1]}(E))),r.a.createElement(ea,{key:"calendar-".concat(f,"-").concat(u),target:"calendar-".concat(f,"-").concat(u)},v)))),r.a.createElement("div",{className:"hoverItems"},r.a.createElement("span",{className:"pointer cellEdit"},r.a.createElement(za,{cellInfo:a,headerInfo:c,rowInfo:l,rowIndex:f,id:"cell-request-".concat(f)}),r.a.createElement(ea,{key:"cell-request-".concat(f),target:"cell-request-".concat(f)},"Update this information"))))),r.a.createElement("div",{className:"text-center text-break "},null!==c.id.match(G)?r.a.createElement(Ya,{value:s}):null!==c.id.match(Y)?r.a.createElement(Ka,{value:{updatedAt:o,updatedBy:m,cellId:d,rowIndex:b,columnId:u}}):(t=c.metadata)&&t.type===F.STRING&&[F.STRING,F.ENUM_MULTI].includes(t.format)?r.a.createElement(oa,{lines:5,toggleType:"modal",modalHeader:h,value:s,width:c.width},g):g))))};var $a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.column,a=void 0===t?{}:t,c=e.columnIdsToHide,l=void 0===c?[]:c,s=e.actionType,o=e.onExpandCloseCallback,i=Object(n.useRef)(),u=Object(p.c)((function(e){return e.tableInfo.focusOn})),m=Object(p.c)((function(e){return e.niches.selected})),d=Object(p.b)();Object(n.useEffect)((function(){a.defaultColumnId&&a.defaultColumnId.toLowerCase()===u.toLowerCase()&&i.current.focus()}),[a.defaultColumnId,u]);var f=a.columns.some((function(e){return void 0!==e.filterValue||e.isSorted})),b=function(){var e=ne.a.findKey(m,(function(e){return e.defaultColumnId===a.defaultColumnId}));e&&d(Fn(m[e],!1))};return r.a.createElement(r.a.Fragment,null,r.a.createElement("button",{ref:i,className:"btn btn-sm btn-link expandBtn p-0 noFocus",onClick:function(){return o(a.defaultColumnId,l,s)}},s&&r.a.createElement(E.s,{className:s===jn.EXPAND?"angle":"angle rotate",title:s===jn.EXPAND?"Expand":"Collapse"})),f&&r.a.createElement("span",{className:"hasFilterOrSorting d-flex",title:"Filter applied"}),r.a.createElement("button",{className:"btn btn-sm btn-link noFocus closeBtn",title:"Remove this niche",onClick:b},r.a.createElement(E.g,{color:"#9D2A2A"})))};function Za(e,t){switch(e){case q:return t?Number.MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER-1;case U:return t?Number.MIN_SAFE_INTEGER:Number.MAX_SAFE_INTEGER;case B:return t?Number.MIN_SAFE_INTEGER-1:Number.MAX_SAFE_INTEGER+1;case H:return t?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY;default:return e}}var en=a(746),tn=a(356),an=a.n(tn),nn=a(357),rn=a.n(nn),cn=X,ln=function(){var e=Object(O.a)(N.a.mark((function e(){return N.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,j.a.get(cn,"/lenders");case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),sn=function(){var e=Object(O.a)(N.a.mark((function e(t,a){var n;return N.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={body:a},e.next=3,j.a.post(cn,"/lenders/".concat(t,"/bdm"),n);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)})));return function(t,a){return e.apply(this,arguments)}}();function on(){return function(){var e=Object(O.a)(N.a.mark((function e(t){var a,n;return N.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,Mt(),e.next=4,ln();case 4:return a=e.sent,t({type:"FETCH_LENDER_LIST",payload:a.data}),n=a.data.map((function(e){return Object(pe.a)({},"lender",Object(m.a)({value:e.name},e))})),e.next=9,t(ce(n));case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(0),console.error(e.t0);case 14:return e.prev=14,qt(),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[0,11,14,17]])})));return function(t){return e.apply(this,arguments)}}()}var un={isEditing:!1},mn="BDM/RESET-FORM",dn="BDM/EDIT",pn=function(e,t){switch(t.type){case dn:return Object(m.a)(Object(m.a)({},e),{},{isEditing:!0});case mn:return Object(m.a)(Object(m.a)(Object(m.a)({},e),t.payload),{},{isEditing:!1});default:return e}},fn=Ea.c({name:Ea.d(),contactNo:Ea.d(),email:Ea.d(),brokerPortalUrl:Ea.d(),scenarioTeamContactNo:Ea.d(),scenarioTeamEmail:Ea.d(),preferableContact:Ea.d()}),bn=function(e){var t=Object(p.b)(),a=e.bdmDetails,n=a.name,c=a.contactNo,l=a.email,s=a.brokerPortalUrl,o=a.scenarioTeamContactNo,i=a.scenarioTeamEmail,u=a.preferableContact;return r.a.createElement(va.d,{initialValues:{name:n,contactNo:c,email:l,brokerPortalUrl:s,scenarioTeamContactNo:o,scenarioTeamEmail:i,preferableContact:u},validationSchema:fn,onSubmit:function(a,n){var r,c,l;an()(e.bdmDetails,a)?n.setSubmitting(!1):t((r={lenderId:e.lender.id,lenderName:e.lender.value,rowIndex:e.rowIndex},c=a,l=e.onUpdateSuccess,function(){var e=Object(O.a)(N.a.mark((function e(t){return N.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,Mt(),e.next=4,sn(r.lenderId,c);case 4:return e.next=6,t(de({rowIndex:r.rowIndex,key:"bdmDetails",value:c,column:"lender"}));case 6:Rt("Lender BDM successfully updated for ".concat(r.lenderName)),l&&l(),e.next=14;break;case 10:e.prev=10,e.t0=e.catch(0),console.error(e.t0),Dt("Failed to update BDM details.");case 14:return e.prev=14,qt(),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[0,10,14,17]])})));return function(t){return e.apply(this,arguments)}}()))}},(function(t){return r.a.createElement(va.c,{noValidate:!0},r.a.createElement(xa,{control:"custom",component:En,name:"name",label:"BDM name",value:t.values.name}),r.a.createElement(xa,{control:"custom",component:En,name:"contactNo",label:"BDM phone",value:t.values.contactNo}),r.a.createElement(xa,{control:"custom",component:En,name:"email",label:"Email",value:t.values.email}),r.a.createElement(xa,{control:"custom",component:En,name:"brokerPortalUrl",label:"Broker Portal URL",value:t.values.brokerPortalUrl}),r.a.createElement(xa,{control:"custom",component:En,name:"scenarioTeamContactNo",label:"Scenario team phone",value:t.values.scenarioTeamContactNo}),r.a.createElement(xa,{control:"custom",component:En,name:"scenarioTeamEmail",label:"Scenario team email",value:t.values.scenarioTeamEmail}),r.a.createElement(xa,{control:"custom",component:En,name:"preferableContact",label:"Preferable contact",value:t.values.preferableContact}),r.a.createElement("div",{className:"d-flex justify-content-end mt-8"},r.a.createElement(v.a,{size:"sm",color:"link",className:"mr-2",disabled:t.isSubmitting,onClick:e.toggle},"Cancel"),r.a.createElement(v.a,{type:"submit",size:"sm",color:"primary",disabled:t.isSubmitting,className:"d-flex align-items-center justify-content-center"},r.a.createElement("div",{className:"mr-4 loderSmall"},r.a.createElement(ga.ClipLoader,{size:15,color:"#fff",loading:t.isSubmitting})),"Update")))}))},vn=function(e){var t=e.bdmDetails,a=void 0===t?{}:t,n=a.name,c=a.contactNo,l=a.email,s=a.brokerPortalUrl,o=a.scenarioTeamContactNo,i=a.scenarioTeamEmail,u=a.preferableContact;return r.a.createElement(r.a.Fragment,null,n&&r.a.createElement("div",{className:"mb-2 d-flex"},r.a.createElement("div",null,r.a.createElement(E.p,{className:"f-18 mr-2 lender-info-icon"})),r.a.createElement("div",{className:"overflow-auto"},n," (BDM)")),c&&r.a.createElement("div",{className:"mb-2 d-flex"},r.a.createElement("div",null,r.a.createElement(E.r,{className:"f-18 mr-2 lender-info-icon"})),r.a.createElement("div",{className:"overflow-auto"},r.a.createElement("a",{href:"tel:".concat(c)},c))),l&&r.a.createElement("div",{className:"mb-2 d-flex"},r.a.createElement("div",null,r.a.createElement(E.k,{className:" f-18 mr-2 lender-info-icon"})),r.a.createElement("div",{className:"overflow-auto"},r.a.createElement("a",{href:"mailto:".concat(l)},l))),s&&r.a.createElement("div",{className:"mb-2 d-flex"},r.a.createElement("div",null,r.a.createElement(E.n,{className:"f-18 mr-2 lender-info-icon"})),r.a.createElement("div",{className:"overflow-auto"},r.a.createElement("a",{href:"".concat(s),rel:"noopener noreferrer",target:"_blank"},s))),o&&r.a.createElement("div",{className:"mb-2 d-flex"},r.a.createElement("div",null,r.a.createElement(E.r,{className:"f-18 mr-2 lender-info-icon"})),r.a.createElement("div",{className:"overflow-auto"},r.a.createElement("a",{href:"tel:".concat(o)}," ",o," (Scenario team)"))),i&&r.a.createElement("div",{className:"mb-2 d-flex"},r.a.createElement("div",null,r.a.createElement(E.k,{className:"f-18 mr-2 lender-info-icon"})),r.a.createElement("div",{className:"overflow-auto"},r.a.createElement("a",{href:"mailto:".concat(i)},i)," (Scenario team)")),u&&r.a.createElement("div",{className:"mb-2 d-flex"},r.a.createElement("div",null,r.a.createElement(E.q,{className:"f-18 mr-2 lender-info-icon"})),r.a.createElement("div",{className:"overflow-auto"},u," (Preferable)")))},En=function(e){var t=e.label,a=e.type,c=void 0===a?"text":a,l=e.name,s=e.value,o=e.isDisabled,i=Object(fe.a)(e,["label","type","name","value","isDisabled"]),u=Object(n.useMemo)((function(){return function(e){switch(e){case"name":return E.p;case"contactNo":case"scenarioTeamContactNo":return E.r;case"email":case"scenarioTeamEmail":return E.k;case"brokerPortalUrl":return E.n;case"preferableContact":return E.q;default:return null}}(l)}),[l]);return r.a.createElement(h.a,null,r.a.createElement(g.a,{for:l},t),r.a.createElement(f.a,null,r.a.createElement(Ye.a,{addonType:"prepend"},r.a.createElement(We.a,null,u&&r.a.createElement(u,{className:"f-18 mr-2 lender-info-icon"}))),r.a.createElement(va.b,Object.assign({id:l,className:"form-control",type:c,name:l,disabled:o,value:s,autoComplete:"off"},i))))};var hn,gn,yn=function(e){var t=e.lender,a=void 0===t?{}:t,c=e.rowIndex,l=Be(),s=Object(d.a)(l,2),o=s[0],i=s[1],u=a.bdmDetails?a.bdmDetails:{},p=Object(n.useReducer)(pn,Object(m.a)(Object(m.a)({},un),a.bdmDetails)),f=Object(d.a)(p,2),b=f[0],h=f[1],g=Qt(),y=Object(n.useCallback)((function(){h({type:mn,payload:Object(m.a)({},a.bdmDetails)}),i()}),[a.bdmDetails,i]),N=Object(n.useCallback)((function(){h({type:mn})}),[]);return r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{className:"hoverItems"},r.a.createElement(v.a,{id:"popover-".concat(a.lenderId),size:"sm",color:"primary",className:"noFocus badgeBtn"},"More Info")),r.a.createElement(He.a,{trigger:"legacy",placement:"right",isOpen:o,target:"popover-".concat(a.lenderId),toggle:y},r.a.createElement(en.a,null,r.a.createElement("div",{className:"lenderCell d-flex justify-content-between align-items-center"},r.a.createElement("div",{className:"d-flex align-items-center"},r.a.createElement("div",{className:"imgWrp small mr-2"},r.a.createElement("img",{src:"img/lender_logos/".concat(rn()(a.lenderId),".png"),alt:"".concat(a.value,"-logo")})),r.a.createElement("div",{className:"d-flex flex-column"},r.a.createElement("div",{className:"lenderInner",id:"lender-".concat(a.lenderId)}," ",a.value," "),r.a.createElement("div",{className:"block"},a&&r.a.createElement(ke.a,{className:"lendersType",color:"light"},a.category))),g&&r.a.createElement("button",{type:"button",className:"close f-18","aria-label":"Edit",onClick:function(){h({type:dn})}},r.a.createElement(E.j,null))),r.a.createElement("button",{type:"button",className:"close f-18","aria-label":"Close",onClick:i},r.a.createElement(E.g,null)))),r.a.createElement(ze.a,{className:"filter__popover p-8"},b.isEditing?r.a.createElement(bn,{bdmDetails:u,toggle:y,lender:a,rowIndex:c,onUpdateSuccess:N}):r.a.createElement(vn,{bdmDetails:u}))))};function Nn(e){var t=ne.a.get(e,"value",null),a=t.value,n=void 0===a?"":a,c=Object(fe.a)(t,["value"]);return n?r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{className:"cellHover lenderCell d-flex ",style:{marginTop:"0px"}},r.a.createElement("div",{className:"imgWrp mr-2"},r.a.createElement("img",{src:"img/lender_logos/".concat(ne.a.toLower(c.lenderId),".png"),alt:"".concat(n,"-logo")})),r.a.createElement("div",{className:"d-flex flex-column"},r.a.createElement("div",{className:"lenderName",id:"lender-".concat(c.lenderId)}," ",n," "),r.a.createElement(ea,{key:"lender-".concat(c.lenderId),target:"lender-".concat(c.lenderId)},n),r.a.createElement("div",{className:"block d-flex"},c&&r.a.createElement(ke.a,{className:"lendersType",color:"light"},c.category),r.a.createElement(yn,{lender:e.value,rowIndex:e.cell.row.id}))))):On()}function On(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.value,a=void 0===t?{}:t,n=e.column,c=void 0===n?{}:n,l=e.row,s=void 0===l?{}:l;return r.a.createElement(Xa,{cellInfo:a,headerInfo:c,rowInfo:s})}Te.a.options.scalePercentBy100=!1;var jn={EXPAND:"Expand",COLLAPSE:"Collapse"};function xn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,a=t.find((function(t){return t.id===e.id})),n=Tn(e.type,e.format),r=In(e.type);return ne.a.omitBy({Header:e.label,accessor:e.id,Cell:Symbol.keyFor(ve),Filter:n,filter:n,sortType:r,disableSortBy:null!==e.id.match(G),metadata:{type:a.type,format:a.format,properties:a.properties},minWidth:130,maxWidth:1e3},ne.a.isNull)}function Cn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],a={};e.cellData.forEach((function(e){return a[e.columnId]=Object(m.a)({value:e.value},e)}));var n=e.name,r=e.lenderId,c=t.findIndex((function(e){return e.lender.lenderId===r}));return-1===c&&(a.lender={value:n,lenderId:r,category:e.category}),c>=0?Object(m.a)(Object(m.a)({},t[c]),a):a}function kn(e){if(e.columns)return Object(m.a)(Object(m.a)({},e),{},{columns:e.columns.map(kn)});var t=Object(m.a)(Object(m.a)({},e),{},{Cell:_n[Symbol.for(e.Cell)]});return e.Filter&&(t.Filter=function(t){return r.a.createElement(Ge,Object.assign({key:t.column.filterValue,component:st[Symbol.for(e.Filter)]},t))}),e.filter&&(t.filter=e.filter),t}var wn=(hn={},Object(pe.a)(hn,Symbol.keyFor(he),(function(e,t,a){return e.filter((function(e){return qe(e.values[t].value,a.value,a.operator)}))})),Object(pe.a)(hn,Symbol.keyFor(Ee),(function(e,t,a){return e.filter((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.values,n=void 0===t?{}:t,r=n.lender,c=r.category,l=r.lenderId;return a[c]&&a[c].includes(l)}))})),Object(pe.a)(hn,Symbol.keyFor(ge),(function(e,t,a){return e.filter((function(e){return ne.a.findIndex(a,(function(a){var n=e.values[t].value.toLowerCase(),r=!!(n?n.split(",").reduce((function(e,t){var a=Object(u.a)(e),n=null===t||void 0===t?void 0:t.trim();return n&&a.push(n),a}),[]):[]).find((function(e){return e===a.value}));return"Blanks"!==a.label?r:""===n}))>=0}))})),Object(pe.a)(hn,Symbol.keyFor(ye),(function(e,t,a){var n=function(e,t){if(isNaN(e))return 0;switch(t){case"m":case"M":return 365*Math.floor(e/12)+e%12*30;case"y":case"Y":return 365*e;default:return e}}(a.value,a.unit);return e.filter((function(e){return qe(e.values[t].value,n,a.operator)}))})),hn);function Tn(e,t){var a=F.ENUM,n=F.YES_NO,r=F.ENUM_MULTI,c=F.TIME_VALUE;if([a,n,r].includes(t))return Symbol.keyFor(ge);if(t===c)return Symbol.keyFor(ye);switch(e){case"number":case"float":return Symbol.keyFor(he);default:return null}}function In(e){switch(e){case"number":case"float":case"percentage":case"currency":return Symbol.keyFor(Ne);default:return Symbol.keyFor(Oe)}}function Sn(e){return!(ne.a.isEmpty(e)&&!ne.a.isNumber(e))&&(!!Ae.includes(e.operator)||(!e.hasOwnProperty("value")||(ne.a.isNumber(e.value)||!ne.a.isEmpty(e.value))))}var An=function(e){var t=document.createElement("div");return t.innerHTML=e,t.textContent};var _n=function(){var e;return e={},Object(pe.a)(e,be,Nn),Object(pe.a)(e,ve,On),e}(),Pn=(gn={},Object(pe.a)(gn,Symbol.keyFor(Ne),(function(e,t,a,n){return Za(e.values[a].value,n)>Za(t.values[a].value,n)?1:-1})),Object(pe.a)(gn,Symbol.keyFor(Oe),(function(e,t,a,n){var r=e.values[a].value,c=t.values[a].value;return H===r&&(r=n?V:z),H===c&&(c=n?V:z),r>c?1:-1})),gn),Rn=function(e){return{type:"ADD_SELECTED_NICHE",payload:e}};function Dn(e){return function(){var t=Object(O.a)(N.a.mark((function t(a,n){var r,c,l,s,o,i,u,m,d,p,f;return N.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,ee(e);case 3:if(t.t1=r=t.sent,t.t0=null===t.t1,t.t0){t.next=7;break}t.t0=void 0===r;case 7:if(!t.t0){t.next=11;break}t.t2=void 0,t.next=12;break;case 11:t.t2=r.data;case 12:return c=t.t2,l=n(),s=ne.a.get(l,"tableInfo.tableData",[]),o=ne.a.get(l,"tableInfo.defaultColumns",[]),i=ne.a.get(l,"tableInfo.columnsToHideMapping",[]),u=c.defaultColumn,m=c.columns,d=m.filter((function(e){return e.id!==u})).map((function(e){return e.id})),o.includes(u)||a(le(u)),a(se(u,d)),a(oe(ne.a.flatten(Object.keys(i).map((function(e){return i[e]}))))),p=c.rowData.map((function(e){return Cn(e,s)})),a(ce(p)),f={columns:c.columns.map((function(e){return xn(e,m)})),Header:c.label,accessor:c.name,defaultColumnId:c.defaultColumn,disableSortBy:!0,nicheId:c.id},a(re(f)),a(ue(u)),t.abrupt("return",c);case 30:t.prev=30,t.t3=t.catch(0),console.error(t.t3);case 33:case"end":return t.stop()}}),t,null,[[0,30]])})));return function(e,a){return t.apply(this,arguments)}}()}function Ln(e){var t=e.nicheId,a=e.nicheName,n=e.cellId;return function(){var e=Object(O.a)(N.a.mark((function e(r,c){var l,s,o,i,u,m,d,p,f,b,v;return N.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Mt(),e.prev=1,l=c(),s=ne.a.get(l,"niches.selected",{}),o=!ne.a.isUndefined(s[t]),i=null,o){e.next=16;break}return e.next=9,r(Dn(a));case 9:u=e.sent,m=u.defaultColumn,d=u.id,p=u.label,f=u.name,r({type:"UPDATE_SELECTED_NICHE_LIST",payload:{niche:{id:d,defaultColumnId:i=m,label:p,name:f},isActive:!0}});case 16:return i||(i=s[t]&&s[t].defaultColumnId),b=ne.a.get(l,"tableInfo.columnsToHideMapping",[]),v=ne.a.flatten(ne.a.filter(b,(function(e,t){return t!==i}))),r(oe(v)),e.next=22,r(ue(i));case 22:return e.next=24,r(me(n));case 24:e.next=29;break;case 26:e.prev=26,e.t0=e.catch(1),console.error(e.t0);case 29:return e.prev=29,qt(),e.finish(29);case 32:case"end":return e.stop()}}),e,null,[[1,26,29,32]])})));return function(t,a){return e.apply(this,arguments)}}()}function Fn(e,t){return function(){var a=Object(O.a)(N.a.mark((function a(n){return N.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(a.prev=0,Mt(),n({type:"UPDATE_SELECTED_NICHE_LIST",payload:{niche:e,isActive:t}}),!t){a.next=8;break}return a.next=6,n(Dn(e.name));case 6:a.next=10;break;case 8:return a.next=10,n({type:"REMOVE_TABLE_INFO",payload:e.defaultColumnId});case 10:a.next=15;break;case 12:a.prev=12,a.t0=a.catch(0),console.error("Error while updating selected niche list");case 15:return a.prev=15,qt(),a.finish(15);case 18:case"end":return a.stop()}}),a,null,[[0,12,15,18]])})));return function(e){return a.apply(this,arguments)}}()}var Mn=function(e){var t=e.nicheMenu,a=e.index,n=e.toggleNicheMenu,c=document.getElementById("sideMenu")&&document.getElementById("sideMenu").getBoundingClientRect(),l=Object(p.b)(),s=Object(p.c)((function(e){return e.niches.selected}));return r.a.createElement("div",null,r.a.createElement("div",{className:t.open?"d-flex justify-content-between py-8 px-15 align-items-center list-item opened":"d-flex justify-content-between py-8 px-15 align-items-center list-item ",onClick:function(){return n(a)}}," ",r.a.createElement("div",{className:"grow-1"}," ",t.category," ")," ",r.a.createElement("div",null," ",t.open?r.a.createElement(E.v,{className:"iconfont"}):r.a.createElement(E.b,{className:"iconfont"}))," "),t.open&&r.a.createElement("div",{className:"submenu",style:{top:"0",left:"".concat(c.right,"px")}},r.a.createElement("header",{className:"p-8 bg-grey d-flex align-items-center justify-content-between"}," ",t.category," ",r.a.createElement(E.g,{className:"subClose",onClick:function(){return n(a)}})),r.a.createElement(pa.Scrollbars,{style:{height:"calc(100vh - 96px)"}},r.a.createElement("div",{className:"item p-8"},t.niches.map((function(e,t){return r.a.createElement(h.a,{check:!0,key:t},r.a.createElement(g.a,{check:!0,className:"d-flex align-item-start innerLable py-8 "},r.a.createElement(b.a,{type:"checkbox",id:e.id,checked:(a=e.id,void 0!==s[a]),onChange:function(t){return function(e,t){var a=e.target.checked;l(Fn(t,a))}(t,e)}}),r.a.createElement("span",{className:"pl-1"}," ",e.label)));var a}))))))},qn=a(252),Un=a(358),Bn=a.n(Un);var Hn=function(e){var t=e.columnNames,a=void 0===t?[]:t,n=e.searchValue;return 0===a.length?null:r.a.createElement("ul",null,a.filter((function(e){return new RegExp(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(n),"ig").test(Bn()(e))})).slice(0,3).map((function(e,t){return r.a.createElement("li",{className:"text-break",key:t},ra()(e))})))},zn=function(e){var t=e.filteredNiches,a=e.searchValue,n=Object(p.b)(),c=Object(p.c)((function(e){return e.niches.selected}));return r.a.createElement("div",null,ne.a.isEmpty(t)?r.a.createElement("div",{className:"p-8 text-center mt-15"},"We couldn't find any matches"):Object.keys(t).map((function(e,l){return r.a.createElement("div",{key:l,className:"mb-15"},r.a.createElement("header",{className:"px-15 searchTitle"}," ",e),r.a.createElement("div",{className:"item px-15 "},t[e].map((function(e,t){return r.a.createElement(h.a,{check:!0,key:t,className:"py-8"},r.a.createElement(g.a,{check:!0,className:"d-flex align-item-start innerLable "},r.a.createElement(b.a,{type:"checkbox",id:e.id,checked:(l=e.id,void 0!==c[l]),onChange:function(t){return function(e,t){var a=e.target.checked;n(Fn(t,a))}(t,e)}}),r.a.createElement("span",{className:"pl-1"}," ",e.label)),r.a.createElement(Hn,{columnNames:e.columnNames,searchValue:a}));var l}))))})))},Vn=[{term:"arrears",synonyms:["late payment","late repayment","missed payment","missed repayment","overdue payment","worst repayment history","wrhi","overdue","in arrears","bad credit","credit issue","bad debt","credit history"]},{term:"defaults",synonyms:["paid defaults","unpaid defaults","worst repayment history","wrhi","bad credit","credit issue","credit history","bad debt"]},{term:"discharged bankrupt",synonyms:["discharged part ix","bankrupt","bankruptcy","credit issue","bad credit","part ix","debt agreement","credit history"]},{term:"gambling history",synonyms:["bet","betting","bad credit","credit issue","credit history"]},{term:"no credit scoring",synonyms:["credit check","credit rating","credit score","credit file","credit history","multiple enquiries"]},{term:"common debt reducer",synonyms:["cdr","joint debts","shared debts","shared living expenses","joint living expenses","common commitments","common debts","common living expenses","common liability"]},{term:"living overseas - acceptable currencies",synonyms:["expat","currency"]},{term:"living overseas - foreign rental",synonyms:["expat"]},{term:"living overseas - max lvr",synonyms:["AU citizen living overseas","PR living overseas","living overseas purchase","overseas purchase","non resident","non resi","non resi with AU citizen","non resi with PR"]},{term:"living overseas - other purpose",synonyms:["expat refinance","overseas refinance","foreign refinance","expat cashout","overseas cashout","foreign cashout","expat land only","overseas land only","foreign land only","expat construction","overseas construction","foreign construction","expat company","overseas company","foreign company","expat trust","overseas trust","foreign trust"]},{term:"living overseas - others",synonyms:["abroad","expat negative gearing","overseas negative gearing","foreign negative gearing","expat pension","overseas pension","foreign pension","expat housing allowance","overseas housing allowance","foreign housing allowance","expat cdr expenses","overseas cdr expenses","foreign cdr expenses","expat cdr debts","overseas cdr debts","foreign cdr debts","overseas debts","foreign debts"]},{term:"living overseas - payg income",synonyms:["abroad","expat overtime","overseas overtime","foreign overtime","expat allowance","overseas allowance","foreign allowance","expat bonus","overseas bonus","foreign bonus","expat commission","overseas commission","foreign commission","overseas income","foreign income"]},{term:"living overseas - self employed income",synonyms:["se expat","self employed expat","se living overseas"]},{term:"living in au - acceptable visa types",synonyms:["temporary visa","business innovation and investment visa","160 visa","161 visa","spouse visa","business skills visa","164 visa","165 visa","partner visa","skilled regional sponsored visa","405 visa","420 visa","prospective marriage visa","special program visa","475 visa","422 visa","skilled regional visa","investor retirement visa","487 visa","temporary work visa","media and film staff visa","162 visa","163 visa","temporary skill shortage visa","religious worker visa","188 visa","416 visa","nz citizen family relationship visa","medical practitioner visa","423 visa","428 visa","contributory aged parent visa","contributory parent visa","173 visa","202 visa","global special humanitarian visa","visa"]},{term:"living in au - aus citizen/pr with tr/bridging",synonyms:["temp resident with AU citizen","temp resident with PR","temporary resident","bridging visa"]},{term:"fixed rates",synonyms:["fixed term","max term on fixed rate","max fixed rate term","rate lock","ratelock fee"]},{term:"interest only loan",synonyms:["io","io loan","io term","max io term"]},{term:"loan increases",synonyms:["top up","loan top up","variation","loan variation"]},{term:"pre-approval",synonyms:["aip"]},{term:"pricing: investment loans secured on o/o property",synonyms:["cross collateralize","pricing on purpose"]},{term:"cashout for business purpose",synonyms:["business purpose"]},{term:"consolidation of tax debt",synonyms:["ato debt","tax debt","consolidate tax debt","payout tax debt","payoff tax debt"]},{term:"debt consolidation",synonyms:["consolidate debt","consolidation","unsecured debt","refinance debt"]},{term:"owner builder construction",synonyms:["licensed builder","unusual property","unusual security"]},{term:"refinance and cash out",synonyms:["refi","equity release","renovation","access equity"]},{term:"ownership structure",synonyms:["min ownership","property ownership","title ownership","property share","part owner","% ownership"]},{term:"two on loan one on title",synonyms:["1 on title","one on title","single title","sole title","2 on loan 1 on title"]},{term:"personal loan as deposit",synonyms:["no savings","low savings","low deposit","no deposit"]},{term:"guarantor loan",synonyms:["guarantee","guarantor support","family pledge","pledge","second mortgage","no LMI","low deposit","100% loan","family security"]},{term:"genuine savings",synonyms:["gen savings","rent as gen savings"]},{term:"maximum lvr",synonyms:["max lvr","max final lvr","max base lvr","oop lvr","inv lvr","high lvr","purchase"]},{term:"maximum loan size",synonyms:["loan amount","max amount","max loan","loan size","max loan size"]},{term:"bridging finance",synonyms:["peak debt","end debt","relocation","bridging loan"]},{term:"private banking",synonyms:["high net worth clients","professional investor"]},{term:"rent to buy & vendor finance",synonyms:["financed deposit","buy later","installment plan"]},{term:"adf medical discharge pension",synonyms:["adf pension","military super","medically discharged","invalidity benefits","disability pension","defense medical pension"]},{term:"centrelink income",synonyms:["pension","disability pension","veteran affairs pension","carer's payment","age pension","old age pension","single parent payment","parenting payment"]},{term:"child support income",synonyms:["support payment","child maintenance income","csa"]},{term:"dhoas home loan",synonyms:["defense home ownership","australian defense force","adf subsidy","adf housing","adf"]},{term:"family tax benefits",synonyms:["ftb","ftb part a","ftb part b"]},{term:"income protection insurance",synonyms:["income protection payments","temporary disability","permanent disability"]},{term:"rent from a housemate",synonyms:["apartment with roommates","leasing to a subtenant"]},{term:"scholarship income",synonyms:["scholars"]},{term:"share and dividend income",synonyms:["investment income"]},{term:"transport accident commission (tac) payments",synonyms:["road accident compensation","TAC home loan"]},{term:"worker's compensation",synonyms:["worker's comp income","disability income","temporary disability","permanent disability"]},{term:"exit strategy",synonyms:["max age","retirement strategy"]},{term:"clawback",synonyms:["short term loan fee"]},{term:"commission (lender)",synonyms:["ufc","upfront commission","trail commission"]},{term:"favorable purchase",synonyms:["purchase below market price","unusual security","unusual property","gifted equity","off the market transaction","buying below market value"]},{term:"living expenses",synonyms:["basic expenses"]}];var Gn=function(){var e=Object(p.b)(),t=Object(p.c)((function(e){return e.niches.list})),a=Object(n.useState)([]),c=Object(d.a)(a,2),l=c[0],s=c[1],o=Object(n.useState)(!0),i=Object(d.a)(o,2),h=i[0],g=i[1],y=Object(n.useState)({}),j=Object(d.a)(y,2),x=j[0],C=j[1],k=Object(n.useState)(""),w=Object(d.a)(k,2),T=w[0],I=w[1],S=function(e){s(l.map((function(t,a){return Object(m.a)(Object(m.a)({},t),{},{open:a===e&&!t.open})})))};Object(n.useEffect)((function(){document.body.classList.add("sideMenuOpen"),ne.a.isEmpty(t)&&e(function(){var e=Object(O.a)(N.a.mark((function e(t){var a;return N.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Z();case 3:a=e.sent,t({type:"FETCH_NICHE_LIST",payload:a.data}),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.error(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t){return e.apply(this,arguments)}}())}),[t]),Object(n.useEffect)((function(){t&&s(t)}),[t]);var A=Object(n.useRef)(null);Object(n.useEffect)((function(){function e(e){A.current&&!A.current.contains(e.target)&&s((function(e){return e.map((function(e){return Object(m.a)(Object(m.a)({},e),{},{open:!1})}))}))}return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[A,l]);var _=Object(n.useMemo)((function(){var e=[];return t.forEach((function(t){var a=t.niches.map((function(e){return Object(m.a)(Object(m.a)({},e),{},{category:t.category})}));e.push.apply(e,Object(u.a)(a))})),e}),[t]),P=Object(n.useMemo)((function(){return new qn.a(_,{keys:["category","label","name","columnNames"],useExtendedSearch:!0,shouldSort:!0,isCaseSensitive:!1,threshold:.3,includeMatches:!0,includeScore:!0,findAllMatches:!0})}),[t]),R=Object(n.useMemo)((function(){return new qn.a(Vn,{keys:["synonyms"],shouldSort:!0,isCaseSensitive:!1,threshold:.2,includeMatches:!0,includeScore:!0,findAllMatches:!0})}),[Vn]);return r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{className:"sideMenu",id:"sideMenu",ref:A},r.a.createElement("div",{className:"p-15 position-relative searchPanel"},r.a.createElement(f.a,{size:"sm"},r.a.createElement(b.a,{type:"text",name:"niche",id:"leftSearch",placeholder:"search",value:T,onChange:function(e){var t=e.target.value;I(t);var a=function(e){var t=e.split(" "),a=Object(u.a)(t),n="",r=R.search(e);if(r){var c=r.reduce((function(e,t){var a=t.item.term;return e.list.push(),e.text=e.text+' | ="'.concat(a,'"'),e}),{list:[],text:""});a=[e].concat(Object(u.a)(c.list||[])),n=c.text}return a.join(" | ")+n}(t),n=P.search(a).reduce((function(e,t){var a=t.item.category,n=t.item;return e[a]||(e[a]=[]),e[a].push(n),e}),{});C(n)},autoComplete:"off"})),r.a.createElement(E.w,{className:"searchIcon"}),T&&r.a.createElement(v.a,{color:"link",className:"noFocus clearBtn",onClick:function(){I("")},disabled:!T},r.a.createElement(E.f,null))),r.a.createElement("div",{className:"sidemenuToggle menuArrow",onClick:function(){g((function(e){return!e})),h?document.body.classList.remove("sideMenuOpen"):document.body.classList.add("sideMenuOpen")}}," ",r.a.createElement(v.a,{color:"link",className:"noFocus arrowBtn",size:"sm"},r.a.createElement(E.m,{className:h?"arrowOpened":"arrowOpened rotate180"}))," "),r.a.createElement(pa.Scrollbars,{style:{height:"calc(100vh - 111px)"}},T?r.a.createElement(zn,{filteredNiches:x,searchValue:T}):!ne.a.isEmpty(l)&&l.map((function(e,t){return r.a.createElement(Mn,{nicheMenu:e,key:t,index:t,toggleNicheMenu:S})})))))},Yn=a(748),Wn=a(749),Jn=a(171),Qn=a(164),Kn=function(){var e=Object(O.a)(N.a.mark((function e(t){return N.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,j.a.get("userDirectoryApi","/user/".concat(t,"/permission?app=").concat("credit_hive"));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Xn=function(){var e=Object(O.a)(N.a.mark((function e(t){var a;return N.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a={body:{name:ne.a.get(t,"name"),email:ne.a.get(t,"email"),avatar:ne.a.get(t,"picture"),appName:"credit_hive"}},e.abrupt("return",j.a.post("userDirectoryApi","/user",a));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function $n(e){return function(){var t=Object(O.a)(N.a.mark((function t(a){var n,r,c,l,s,o;return N.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e){t.next=2;break}return t.abrupt("return",!1);case 2:if(t.prev=2,n=e.attributes,r=ne.a.get(n,"custom:savedInDB"),c={"custom:savedInDB":!0},r){t.next=16;break}return t.next=9,Xn(n);case 9:return l=t.sent,s=l.data,t.next=13,new Promise((function(e,t){j.a.post("plfApi","/user-attributes").then((function(a){void 0!==a&&!1!==ne.a.get(a,"status",null)||t("Unfortunately something went wrong."),e(a)})).catch((function(e){console.error(e),t("Unfortunately something went wrong.")}))}));case 13:n=Object(m.a)(Object(m.a)(Object(m.a)({},n),c),{},{hasFullPermission:P===s.permission,permission:s.permission}),t.next=20;break;case 16:return t.next=18,Kn(n.sub);case 18:o=t.sent,n=Object(m.a)(Object(m.a)({},n),{},{hasFullPermission:o.data.permissions.includes(P),permission:o.data.permissions});case 20:a({type:"STORE_USER_ATTRIBUTES",payload:n}),t.next=27;break;case 23:throw t.prev=23,t.t0=t.catch(2),console.error(t.t0),t.t0;case 27:case"end":return t.stop()}}),t,null,[[2,23]])})));return function(e){return t.apply(this,arguments)}}()}var Zn=function(){return function(){var e=Object(O.a)(N.a.mark((function e(t){return N.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return localStorage.removeItem("state"),e.prev=1,e.next=4,Qn.a.currentAuthenticatedUser();case 4:return e.next=6,Qn.a.signOut();case 6:t({type:"INITIAL_USER_STATE"}),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(1),console.error(e.t0),window.location.reload(!0);case 13:case"end":return e.stop()}}),e,null,[[1,9]])})));return function(t){return e.apply(this,arguments)}}()},er=a(747),tr=X,ar=function(){var e=Object(O.a)(N.a.mark((function e(){return N.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,j.a.get(tr,"/request/tasks");case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),nr=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=t.page,n=void 0===a?1:a,r=t.perPage,c=void 0===r?10:r,l=e||"Pending";return j.a.get(tr,"/request/tasks?type=list&filter=".concat(l,"&page=").concat(n,"&perPage=").concat(c))},rr=function(e,t){return function(){var a=Object(O.a)(N.a.mark((function a(n,r){var c,l,s,o,i,u;return N.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,s=r(),o=(null===s||void 0===s||null===(c=s.cellRequest)||void 0===c||null===(l=c.paginatedTasks)||void 0===l?void 0:l.paginator)||{},i=o.perPage,Mt(),n({type:"FETCHING_PAGINATED_REQUEST_TASKS"}),a.next=7,nr(e,i&&!t?{perPage:i}:t);case 7:u=a.sent,n({type:"SET_PAGINATED_REQUEST_TASKS",payload:u.data}),a.next=15;break;case 11:a.prev=11,a.t0=a.catch(0),n({type:"FETCHING_PAGINATED_REQUEST_TASKS_FAILED"}),console.error(a.t0);case 15:return a.prev=15,qt(),a.finish(15);case 18:case"end":return a.stop()}}),a,null,[[0,11,15,18]])})));return function(e,t){return a.apply(this,arguments)}}()},cr=a(359),lr=a.n(cr);var sr=function(){var e=Object(n.useState)({width:0,height:0}),t=Object(d.a)(e,2),a=t[0],r=t[1];return Object(n.useEffect)((function(){function e(){r({width:window.innerWidth,height:window.innerHeight})}return window.addEventListener("resize",e),e(),function(){return window.removeEventListener("resize",e)}}),[]),a};De.a.extend(lr.a);var or=function(e){var t=e.handleClick,a=e.requests,n=sr();if(ne.a.isEmpty(a))return"";return r.a.createElement(Yt.a,{className:"notificationDropdown"},r.a.createElement(pa.Scrollbars,{autoHeight:!0,autoHeightMin:100,autoHeightMax:n.height-110},a.map((function(e,a){return r.a.createElement(Wt.a,{className:"d-flex",onClick:function(){return t(e.nicheId,e.nicheName,e.nicheCellId)},key:a},r.a.createElement("div",{className:"d-flex align-items-center"},r.a.createElement("div",{className:"roundedImage mr-2"},r.a.createElement("img",{id:"task-".concat(e._id),src:e.requester.avatar||"img/avatar.png",className:"img-fluid",alt:"Avatar for ".concat(e.requester.name)})),r.a.createElement(ea,{key:"task-".concat(e._id),target:"task-".concat(e._id)},e.requester.name||"Unknown")),r.a.createElement("div",null,r.a.createElement("div",{className:"f13 mb-1 taskDescription"},r.a.createElement("span",{className:"text-break"}," ",e.nicheLabel),": ",r.a.createElement("span",{className:"text-break"},e.columnLabel)," of ",r.a.createElement("span",{className:"text-break"},e.lenderName)," : ",r.a.createElement("span",{className:"value text-break"},function(e,t){var a=e;return F.TIME_VALUE===t&&(a=Le(a)),ne.a.truncate(An(a),{length:80})}(e.value,e.columnFormat))),r.a.createElement("div",{className:"d-flex"},r.a.createElement("div",{className:"d-flex align-items-center"},r.a.createElement("span",{className:"text-muted mr-1 clockFont"}," ",r.a.createElement(E.a,null)),r.a.createElement("span",{className:"f12 text-muted"}," ",De()(e.createdAt).fromNow())),r.a.createElement("span",{className:"f12 d-flex align-items-center text-success"},I.IN_REVIEW!==e.status?"":r.a.createElement("span",{className:"text-success"},r.a.createElement("span",{className:"circle"}),e.status)))))}))),r.a.createElement(Wt.a,{divider:!0}),r.a.createElement("div",null,r.a.createElement(s.b,{to:"requests"},r.a.createElement(Wt.a,{className:"text-center"},"See all"))))},ir=function(){var e=Object(p.b)(),t=Object(p.c)((function(e){return e.cellRequest})),a=Be(!1),c=Object(d.a)(a,2),l=c[0],s=c[1],o=Object(n.useState)(!0),i=Object(d.a)(o,2),u=i[0],m=i[1];Object(n.useEffect)((function(){var t=!1;return e(function(){var e=Object(O.a)(N.a.mark((function e(t){var a;return N.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,ar();case 3:a=e.sent,t({type:"SET_REQUEST_TASKS",payload:a.data}),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.error(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t){return e.apply(this,arguments)}}()).then((function(){!t&&m(!1)})),function(){t=!0}}),[]);return r.a.createElement(er.a,{isOpen:l,toggle:s},r.a.createElement(Gt.a,{caret:!u,color:"primary",className:"px-8 py-4 taskDropdown"},u?r.a.createElement(ga.ClipLoader,{css:"display: block; margin: 0 auto; border-color: white",size:20,color:"#27ade7",loading:u}):r.a.createElement(r.a.Fragment,null,r.a.createElement(E.c,{size:20})," ",r.a.createElement(ke.a,{className:"taskCount"},t.totalPendingRequests))),r.a.createElement(or,{handleClick:function(t,a,n){e(Ln({nicheId:t,nicheName:a,cellId:n}))},requests:t.tasks}))};var ur=function(){var e=Be(!1),t=Object(d.a)(e,2),a=t[0],n=t[1],c=Object(p.c)((function(e){return e.user.userAttributes})),l=Object(p.b)(),o=Qt();return r.a.createElement(Yn.a,{fixed:"top",light:!0,expand:"md",className:" header d-flex justify-content-between"},r.a.createElement(s.b,{to:"/",className:"navbar-brand"}," ",r.a.createElement("img",{className:"dashlogo",alt:"HLE Logo",src:"img/login_icons/creditHive.svg"})),r.a.createElement(Wn.a,null,r.a.createElement("div",{className:"container"},r.a.createElement("div",{className:"row align-items-center"},o&&r.a.createElement("div",{className:"col-md p-0"},r.a.createElement(ir,null)),r.a.createElement("div",{className:"col-md"},r.a.createElement(Jn.a,{isOpen:a,toggle:n},r.a.createElement(Gt.a,{caret:!0,color:"link",className:"d-flex align-items-center p-0 text-decoration-none noFocus"},r.a.createElement("div",{className:"d-flex align-items-center"},r.a.createElement("div",{className:"roundedImage mr-2"}," ",r.a.createElement("img",{src:c?c.picture:"",className:"img-fluid",alt:"user"})),r.a.createElement("div",null,c?c.name:""))),r.a.createElement(Yt.a,{right:!0,className:"p-0"},r.a.createElement(Wt.a,{className:"p-8 d-flex align-items-center",onClick:function(){l(Zn())}}," ",r.a.createElement(E.t,{className:"logoutBtn mr-4"})," Logout"," ")))," ")))))},mr=a(115),dr=a(255),pr=function(e){var t=e.headerGroups,a=e.setHiddenColumns,c=e.hiddenColumns,l=e.resizingColumn,s=Object(p.b)(),o=Object(p.c)((function(e){return e.tableInfo.columnsToHideMapping})),i=Object(n.useCallback)((function(e,t,n){a((function(a){var r=function(e,t,a,n,r){var c=[];if(a===jn.EXPAND)for(var l in n)l!==e&&(c=[].concat(Object(u.a)(c),Object(u.a)(n[l])));else c=[].concat(Object(u.a)(r),Object(u.a)(t));return c}(e,t,n,o,a);return s(oe(r)),r}))}),[a,o,s]),m=Object(n.useCallback)((function(e){var t=e&&o[e];return t&&0===o[e].length?null:t&&c.includes(o[e][0])?jn.EXPAND:jn.COLLAPSE}),[o,c]);return t.map((function(e){return r.a.createElement("div",Object.assign({},e.getHeaderGroupProps(),{className:"headerWrap"}),e.headers.map((function(e){var t=e.defaultColumnId,a=m(t),n=e.render("Header"),c="object"===typeof n?n:ra()(n);return r.a.createElement("div",Object.assign({},e.getHeaderProps(),{title:"",className:yt()({headerItems:!0,parentHeader:e.columns,opened:"lender"!==e.id&&a===jn.COLLAPSE,"user-select-none":null!=l})}),"lender"!==e.id&&t&&function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],a=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;return n||(console.warn("onExpandCloseCallback cannot be null or undefined",n),n=ne.a.noop),r.a.createElement($a,{column:e,columnIdsToHide:t,actionType:a,onExpandCloseCallback:n})}(e,o[t],a,i),r.a.createElement("div",Object.assign({className:"d-flex justify-content-between"},e.getSortByToggleProps()),r.a.createElement("div",{className:"d-flex align-items-center padding2"},r.a.createElement("div",{className:"clip2",id:"table-header-".concat(e.id)},c,r.a.createElement(ea,{key:"table-header-".concat(e.id),target:"table-header-".concat(e.id)},c))),"lender"===e.id&&r.a.createElement("span",{className:"lenderName"}," Lenders"),r.a.createElement("div",{className:"d-flex align-items-center"},r.a.createElement("span",null,e.headers||e.disableSortBy||!e.isSortedDesc?!1===e.isSortedDesc?r.a.createElement(dr.b,null):"":r.a.createElement(dr.a,null)),e.canFilter&&e.render("Filter"))),e.canResize&&e.getResizerProps&&r.a.createElement("div",Object.assign({},e.getResizerProps(),{className:"resizer ".concat(e.isResizing?"isResizing":""),onClick:function(e){return e.stopPropagation()}})))})))}))},fr=function(e){return e.column.parent.defaultColumnId===e.value.columnId?"defaultCell":""},br=r.a.memo((function(e){var t=e.rows,a=e.prepareRow,n=e.cellToFocus;return t.map((function(e){return a(e),r.a.createElement("div",Object.assign({},e.getRowProps(),{className:"relative rowItem"}),e.cells.map((function(e,t){if(0===t)return r.a.createElement("div",Object.assign({className:"sticky columnItem"},e.getCellProps()),e.render("Cell"));var a,c="";return e.value.id===n&&(c="focus-cell"),r.a.createElement("div",Object.assign({id:"".concat(c),className:"columnItem ".concat((a=e.value,a.hasOwnProperty("colorCode")?a.colorCode.toLowerCase():"")," ").concat(fr(e))},e.getCellProps()),e.render("Cell"))})))}))}));var vr=function(e){var t=e.columns,a=e.data,c=Object(p.c)((function(e){return e.tableInfo.hiddenColumns})),l=Object(p.c)((function(e){return e.tableInfo.tableFilters})),s=Object(p.c)((function(e){return e.tableInfo.focusCell})),o=Object(p.c)((function(e){return e.tableInfo.sortTableBy})),i=Object(p.b)(),m=Object(n.useMemo)((function(){return{Filter:function(){return null},width:150,sortDescFirst:!0}}),[]),f=Object(n.useMemo)((function(){return wn}),[]),b=Object(n.useMemo)((function(){return Pn}),[]),v=Object(mr.useTable)({columns:t,data:a,initialState:{hiddenColumns:c,filters:l,sortBy:o},autoResetHiddenColumns:!1,defaultColumn:m,autoResetFilters:!1,filterTypes:f,disableMultiSort:!0,autoResetSortBy:!1,sortTypes:b},mr.useFilters,mr.useBlockLayout,mr.useSortBy,mr.useResizeColumns),E=v.getTableProps,h=v.getTableBodyProps,g=v.headerGroups,y=v.rows,N=v.prepareRow,O=v.setHiddenColumns,j=v.state,x=v.setAllFilters,C=v.setSortBy;Object(n.useEffect)((function(){ne.a.xor(j.hiddenColumns,c).length>0&&O(c)}),[j.hiddenColumns,O,c]),Object(n.useEffect)((function(){ne.a.xorBy(j.filters,l,"id").length>0&&x(Object(u.a)(l))}),[l]),Object(n.useEffect)((function(){i({type:"SAVE_TABLE_SORTING",payload:j.sortBy})}),[j.sortBy]),Object(n.useEffect)((function(){C(o)}),[o]);var k=r.a.useState(0),w=Object(d.a)(k,2),T=w[0],I=w[1];return Object(n.useEffect)((function(){null===j.columnResizing.isResizingColumn&&I((function(e){return+!e}))}),[j.columnResizing.isResizingColumn]),r.a.createElement("div",Object.assign({},E(),{className:"relative"}),r.a.createElement("div",{className:"stickyHeader"},r.a.createElement(pr,{headerGroups:g,setHiddenColumns:O,hiddenColumns:c,resizingColumn:j.columnResizing.isResizingColumn})),r.a.createElement("div",Object.assign({},h(),{className:"grouping"}),r.a.createElement(br,{rows:y,prepareRow:N,render:T,cellToFocus:s})))},Er=a(128);a(614);var hr=function(e){var t=e.lenders,a=e.selectedLender,c=Object(p.b)(),l=Object(n.useMemo)((function(){return t.list.map((function(e){return{value:e.id,label:e.name,shortName:e.lenderId}}))}),[t]);return r.a.createElement(h.a,null,r.a.createElement(g.a,null,"Lender"),r.a.createElement(Sa.a,{options:l,menuPlacement:"top",isClearable:!0,onChange:function(e){c({type:"SET_LENDER",payload:e})},value:null==(null===a||void 0===a?void 0:a.value)?"":a,maxMenuHeight:250,minMenuHeight:250,required:!0,placeholder:"Select a lender",filterOption:Object(Er.b)({matchFrom:"any",stringify:function(e){return"".concat(e.label)}})}))};var gr=function(e){for(var t=String.fromCharCode.apply(String,Object(u.a)(e)),a=new ArrayBuffer(t.length),n=new Uint8Array(a),r=0;r!==t.length;++r)n[r]=255&t.charCodeAt(r);return a},yr=function(e){var t=e.niches,a=e.selectedNiches,n=Object(p.b)(),c=r.a.useMemo((function(){return function(e,t){var a=[];return e.forEach((function(e){var n=[];e.niches.forEach((function(e){n.push({id:e.id,label:e.label,value:e.id,name:e.name,checked:null===t||void 0===t?void 0:t.includes(e.id)})}));var r={label:e.category,children:n};a.push(r)})),a}(t.list,a)}),[t]),l=r.a.useCallback((function(e,t){var a=function(e){var t=[];return e.forEach((function(e){e._children?t.push.apply(t,Object(u.a)(e._children)):t.push(e.id)})),t}(t);n(function(e){return{type:"SET_SELECTED_NICHES",payload:e}}(a))}),[]);return r.a.createElement(h.a,null,r.a.createElement(g.a,null,"Niches"),r.a.createElement(et,{mode:"multiSelect",data:c,onChange:l,placeHolder:"Search for niches",id:"niches-tree-filter"}))},Nr=function(){var e=Object(p.b)(),t=Object(p.c)((function(e){return e})),a=t.exportData,c=t.lenders,l=t.niches,s=Object(n.useCallback)((function(){e({type:"CLOSE_EXPORT_DATA_MODAL"})}),[e]),o=Object(n.useCallback)((function(){e({type:"ENABLE_EXPORT_DATA"}),window.open("/export-data","_blank")}),[e]),i=Object(n.useMemo)((function(){var e,t;return(null===a||void 0===a||null===(e=a.lender)||void 0===e?void 0:e.value)&&(null===a||void 0===a||null===(t=a.niches)||void 0===t?void 0:t.length)>0}),[a]);return r.a.createElement(mt.a,{isOpen:a.isModalOpen,id:"exportModal"},r.a.createElement(dt.a,{toggle:s,className:"p-8 f16"},"Export Data"),r.a.createElement(pt.a,{className:"p-10"},r.a.createElement(hr,{lenders:c,selectedLender:a.lender}),r.a.createElement(yr,{niches:l,selectedNiches:a.niches}),r.a.createElement("div",{className:"rightAlign"},r.a.createElement(v.a,{color:"link",onClick:s},"Cancel")," ",r.a.createElement(v.a,{color:"primary",disabled:!i,onClick:o},"Export"))))};var Or=function(){var e=Object(p.b)(),t=Object(p.c)((function(e){return!ne.a.isEmpty(e.tableInfo.tableFilters)||!ne.a.isEmpty(e.tableInfo.sortTableBy)})),a=Qt(),c=Object(n.useCallback)((function(){e({type:"CLEAR_TABLE_FILTER_AND_SORT"})}),[e]),l=Object(n.useCallback)((function(){e(function(){var e=Object(O.a)(N.a.mark((function e(t){return N.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t({type:"INITIALIZE_TABLE_INFO"}),t({type:"CLEAR_SELECTED_NICHES"}),t(on());case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())}),[e]),s=Object(n.useCallback)((function(){e({type:"OPEN_EXPORT_DATA_MODAL"})}),[e]);return r.a.createElement("div",{className:"d-flex actionBar"},r.a.createElement(v.a,{size:"sm",outline:!0,color:"primary",onClick:l,className:"mb-8 mr-8 d-flex align-items-center noFocus",title:"Removes all selected niches"},r.a.createElement("div",{className:" mr-1"},"Clear table"),r.a.createElement(E.u,null)),t&&r.a.createElement(v.a,{size:"sm",outline:!0,color:"primary",onClick:c,className:"mb-8 d-flex align-items-center noFocus",title:"Removes all applied filters"},r.a.createElement("div",{className:" mr-1"},"Remove all filters"),r.a.createElement(Ve.c,null)),a&&r.a.createElement(r.a.Fragment,null,r.a.createElement(v.a,{size:"sm",outline:!0,color:"secondary",onClick:s,className:"mb-8 d-flex align-items-center noFocus rightAlign",title:"Export lender niches"},r.a.createElement("div",{className:" mr-1"},"Export Data"),r.a.createElement(ot.b,null)),r.a.createElement(Nr,null)))};var jr=function(){var e=Object(p.c)((function(e){return e.niches.selected}));return ne.a.isEmpty(e)?r.a.createElement("div",{className:"animContainer"},r.a.createElement("div",{className:"relative"},r.a.createElement("div",{className:"click click-1"}," "),r.a.createElement("div",{className:"click click-2"}," "),r.a.createElement("div",{className:"click click-3"}," "),r.a.createElement("div",null,r.a.createElement("div",{className:"firstPanel"},r.a.createElement("div",{className:"d-flex list-1 chlist"},r.a.createElement("div",{className:"line"}),r.a.createElement("div",{className:"plus"})),r.a.createElement("div",{className:"d-flex list-1 chlist"},r.a.createElement("div",{className:"line"}),r.a.createElement("div",{className:"plus"})))),r.a.createElement("div",{className:"openPanel"},r.a.createElement("div",{className:"d-flex chekbox-1 checkbox mb15"},r.a.createElement("div",{className:" form-check"},r.a.createElement("label",{className:"d-flex align-item-start innerLable form-check-label"},r.a.createElement("input",{type:"checkbox",className:"form-check-input"}),r.a.createElement("span",{className:"pl-1"}))),r.a.createElement("div",{className:"line line-right"}," ")),r.a.createElement("div",{className:"d-flex chekbox-2 checkbox mb15"},r.a.createElement("div",{className:" form-check"},r.a.createElement("label",{className:"d-flex align-item-start innerLable form-check-label"},r.a.createElement("input",{type:"checkbox",className:"form-check-input",defaultChecked:!0}),r.a.createElement("span",{className:"pl-1"}))),r.a.createElement("div",{className:"line line-right"}," ")),r.a.createElement("div",{className:"d-flex chekbox-3 checkbox mb15"},r.a.createElement("div",{className:" form-check"},r.a.createElement("label",{className:"d-flex align-item-start innerLable form-check-label"},r.a.createElement("input",{type:"checkbox",className:"form-check-input"}),r.a.createElement("span",{className:"pl-1"}))),r.a.createElement("div",{className:"line line-right"}," ")),r.a.createElement("div",{className:"d-flex chekbox-4 checkbox mb15"},r.a.createElement("div",{className:"form-check"},r.a.createElement("label",{className:"d-flex align-item-start innerLable form-check-label"},r.a.createElement("input",{type:"checkbox",className:"form-check-input",defaultChecked:!0})," ",r.a.createElement("span",{className:"pl-1"}))),r.a.createElement("div",{className:"line line-right"}," ")),r.a.createElement("div",{className:"d-flex chekbox-5 checkbox"},r.a.createElement("div",{className:"form-check"},r.a.createElement("label",{className:"d-flex align-item-start innerLable form-check-label"},r.a.createElement("input",{type:"checkbox",className:"form-check-input"}),r.a.createElement("span",{className:"pl-1"}))),r.a.createElement("div",{className:"line line-right"}," "))),r.a.createElement("div",{className:"bottompanel bottom-1 "},"Expand the categories and add the niches"))):null};var xr=function(){var e=Object(p.b)(),t=Object(p.c)((function(e){return e.tableInfo.tableHeaders})),a=Object(p.c)((function(e){return e.tableInfo.tableData})),c=Object(p.c)((function(e){return e.lenders.list})),l=r.a.useMemo((function(){return t.map(kn)}),[t]),s=r.a.useMemo((function(){return Object(u.a)(a)}),[a]);return Object(n.useEffect)((function(){ne.a.isEmpty(c)&&e(on())}),[e,c]),r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{className:"pageContent"},r.a.createElement(Or,null),r.a.createElement("div",{className:"tableContent"},r.a.createElement(jr,null),r.a.createElement(vr,{columns:l,data:s}))))},Cr=a(61),kr="ab8063b4-0946-4037-8877-06c127267981",wr="pub7ba60af71b502d5ae16aecb8de129051",Tr={dev:{oauth:{domain:"id.dev.homeloanexperts.net.au",scope:["email","profile","openid","aws.cognito.signin.user.admin"],redirectSignIn:"https://credithive.dev.homeloanexperts.net.au",redirectSignOut:"https://credithive.dev.homeloanexperts.net.au",responseType:"code",options:{AdvancedSecurityDataCollectionFlag:!0}},amplify:{Auth:{identityPoolId:"ap-southeast-2:5b6a0224-efe2-43ce-84f3-58c951a1906e",region:"ap-southeast-2",userPoolId:"ap-southeast-2_UImWnhQ8j",userPoolWebClientId:"6kiv5i324i3ttem6nlrgj6vph3",cookieStorage:{domain:".homeloanexperts.com.au",path:"/",sameSite:"lax",secure:!0}},API:{endpoints:[{name:X,region:"ap-southeast-2",endpoint:"https://credithive-api.dev.homeloanexperts.net.au",custom_header:function(){var e=Object(O.a)(N.a.mark((function e(){return N.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Qn.a.currentUserInfo();case 2:if(!e.sent){e.next=4;break}return e.abrupt("return",Ir());case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{name:"plfApi",region:"ap-southeast-2",endpoint:"https://plf-api.dev.homeloanexperts.net.au",custom_header:function(){var e=Object(O.a)(N.a.mark((function e(){return N.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ir();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{name:"userDirectoryApi",region:"ap-southeast-2",endpoint:"https://pmx-api.dev.homeloanexperts.net.au/directory",custom_header:function(){var e=Object(O.a)(N.a.mark((function e(){return N.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ir();case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()}]}},scripts:{hotjar:"(function(h,o,t,j,a,r){h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};h._hjSettings={hjid:2232541,hjsv:6};a=o.getElementsByTagName('head')[0];r=o.createElement('script');r.async=1;r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;a.appendChild(r);})(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');",pendo:"(function(apiKey){(function(p,e,n,d,o){var v,w,x,y,z;o=p[d]=p[d]||{};o._q=o._q||[];v=['initialize','identify','updateOptions','pageLoad','track'];for(w=0,x=v.length;wl||o<=0)&&(d=Ur()(1,i+1)),Hr()(d,p).length>0&&(d=Ur()(p[0]-i,p[0])),Object(m.a)(Object(m.a)(Object(m.a)({},e),t.payload),{},{pageNumbersToShow:Qr(d,p),leftPageCount:i,rightPageCount:u,currentPage:o>l||o<=0?1:+o});case Gr:var f=Object(m.a)({},e);if(!e.pageNumbersToShow.includes(t.payload.pageNo)){var b=t.payload.pageNo0&&(E=Ur()(v[0]-e.leftPageCount,v[0])),f.pageNumbersToShow=Qr(E,v)}return Object(m.a)(Object(m.a)({},f),{},{currentPage:t.payload.pageNo,disableActions:e.disableOnLoad});case Wr:return Object(m.a)(Object(m.a)({},e),{},{itemsPerPage:t.payload.itemsPerPage,disableActions:e.disableOnLoad,currentPage:e.autoResetPage?1:e.currentPage});case Yr:return Object(m.a)(Object(m.a)({},e),{},{disableActions:!1});default:throw new Error("Invalid action type")}}function Qr(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...",n=e[e.length-1]+1!==t[0];return n?[].concat(Object(u.a)(e),[a],Object(u.a)(t)):[].concat(Object(u.a)(e),Object(u.a)(t))}var Kr=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.totalPages,a=e.onPageChange,r=e.noOfPagesToShow,c=void 0===r?10:r,l=e.defaultSelectedPage,s=void 0===l?1:l,o=e.disableOnLoad,i=void 0===o||o,u=e.autoResetPage,p=void 0===u||u,f=e.itemsPerPage,b=void 0===f?10:f,v=Object(n.useReducer)(Jr,Object(m.a)(Object(m.a)({},zr),{},{currentPage:s,disableOnLoad:i,autoResetPage:p,itemsPerPage:b})),E=Object(d.a)(v,2),h=E[0],g=E[1];Object(n.useEffect)((function(){g({type:Vr,payload:{totalPages:t,noOfPagesToShow:c>t?t:c,currentPage:s,disableOnLoad:i}})}),[s,i,g,c,t]);var y=Object(n.useCallback)((function(){g({type:Yr})}),[g]),N=Object(n.useCallback)((function(e){a&&i?a(e,y):a(e)}),[i,y,a]),O=Object(n.useCallback)((function(e){if(!h.disableActions&&e!==h.currentPage&&e>0&&e<=t){g({type:Gr,payload:{pageNo:e}});var a={pageNo:e,itemsPerPage:h.itemsPerPage};N(a)}}),[N,h.currentPage,h.disableActions,h.itemsPerPage,t]),j=Object(n.useCallback)((function(){1!==h.currentPage&&O(h.currentPage-1)}),[O,h.currentPage]),x=Object(n.useCallback)((function(){h.currentPage!==t&&O(h.currentPage+1)}),[O,h.currentPage,t]),C=Object(n.useCallback)((function(){1!==h.currentPage&&O(1)}),[O,h.currentPage]),k=Object(n.useCallback)((function(){h.currentPage!==t&&O(t)}),[O,h.currentPage,t]),w=Object(n.useCallback)((function(e){if(!h.disableActions){g({type:Wr,payload:{itemsPerPage:e}});var t={pageNo:h.autoResetPage?1:h.currentPage,itemsPerPage:e};N(t)}}),[N,h.autoResetPage,h.currentPage,h.disableActions]);return{disableActions:h.disableActions,currentPage:h.currentPage,pageNumbersDisplay:h.pageNumbersToShow,canNext:h.currentPage!==t,canPrevious:1!==h.currentPage,itemsPerPage:parseInt(h.itemsPerPage),onPreviousPage:j,onNextPage:x,goToPage:O,goToFirst:C,goToLast:k,onItemsPerPageChange:w}};function Xr(e){var t=e.totalPages,a=e.defaultCurrentPage,n=e.onPageChange,c=e.disableOnLoad,l=e.perPage,s=Kr({totalPages:t,onPageChange:n,noOfPagesToShow:t,defaultSelectedPage:a,disableOnLoad:c,itemsPerPage:l}),o=s.currentPage,i=s.disableActions,u=s.canNext,m=s.canPrevious,d=s.onPreviousPage,p=s.goToPage,f=s.onNextPage,b=s.onItemsPerPageChange,h=s.itemsPerPage;return r.a.createElement("div",{className:" d-flex customPagination"},r.a.createElement(Mr.a,{inline:!0,onSubmit:function(e){return e.preventDefault()}},r.a.createElement(Fr,{label:"Row per page",onChangeCallback:b,disabled:i,currentItemsPerPage:h}),r.a.createElement("div",{className:"d-flex align-items-center"},r.a.createElement("div",{className:"ch-page-number-section d-flex align-items-center"},r.a.createElement("span",{className:"ch-caption"},"Page "),r.a.createElement($r,{className:"ch-page-field li",currentPage:o,onChange:p,disabled:i,totalPages:t}),r.a.createElement("span",null," of ",r.a.createElement("span",{className:"ch-total-page-count"},t," ")," ")),r.a.createElement("div",{className:"ch-arrow-section"},r.a.createElement(v.a,{color:"link",className:" p-0 arrowBtn ch-left-arrow",disabled:!m||i,onClick:d},r.a.createElement(E.d,null)),r.a.createElement(v.a,{color:"link",className:"p-0 arrowBtn ch-right-arrow",disabled:!u||i,onClick:f},r.a.createElement(E.e,null))))))}function $r(e){var t=e.currentPage,a=e.onChange,n=e.totalPages,c=Object(fe.a)(e,["currentPage","onChange","totalPages"]),l=r.a.useState(t),s=Object(d.a)(l,2),o=s[0],i=s[1];r.a.useEffect((function(){i(t)}),[t]);var u=r.a.useCallback((function(){(o>n||o<=0)&&i(t),a&&a(o)}),[t,o,a,n]);return r.a.createElement("input",Object.assign({"data-digits-length":o.toString().length,value:o,onChange:function(e){return!isNaN(+e.target.value)&&i(+e.target.value)},onKeyDown:function(e){return"Enter"===e.key&&u()},onBlur:u},c))}Xr.defaultProps={defaultCurrentPage:1,disableOnLoad:!0};var Zr=function(e){var t=e.setFilter,a=e.selected,n=e.toggle;return r.a.createElement("div",{className:"m-3"},r.a.createElement("select",{className:"statusFilter",name:"statusFilter",value:a,onChange:function(e){t(e.target.value),n()}},r.a.createElement("option",{className:"dropdownValue",value:"All"},"All"),r.a.createElement("option",{className:"dropdownValue",value:"Pending",defaultValue:"Pending"},"Pending"),r.a.createElement("option",{className:"dropdownValue",value:"In Review"},"In Review "),r.a.createElement("option",{className:"dropdownValue",value:"Approved"},"Approved"),r.a.createElement("option",{className:"dropdownValue",value:"Rejected"},"Rejected")))};var ec=function(e){var t=e.id,a=e.selected,n=e.setFilter,c=Be(!1),l=Object(d.a)(c,2),s=l[0],o=l[1];return r.a.createElement(r.a.Fragment,null,"Status",r.a.createElement(v.a,{id:"popover-".concat(t),color:"link",type:"button",size:"lg",className:"noFocus filterbtn fltrbtn"},"All"!==a?r.a.createElement(Ve.a,{className:"filtered"}):r.a.createElement(Ve.b,null)),r.a.createElement(He.a,{trigger:"legacy",placement:"bottom",isOpen:s,target:"popover-".concat(t),toggle:o},r.a.createElement(ze.a,{className:"filter__popover p-0"},r.a.createElement("div",null,r.a.createElement(Zr,{setFilter:n,selected:a,toggle:o})))))},tc=function(e){var t=e.value;return r.a.createElement(r.a.Fragment,null,r.a.createElement("span",{id:"requestDetails-".concat(t.id)},t.columnLabel,": ",r.a.createElement("span",{className:"value"},ne.a.truncate(An(t.value),{length:12}))),r.a.createElement(ea,{target:"requestDetails-".concat(t.id),autohide:!1},ra()(t.value)))},ac=function(){var e,t=Object(p.c)((function(e){return e.cellRequest})),a=t.paginatedTasks,c=void 0===a?{data:[],paginator:{}}:a,l=t.isLoading,o=Object(p.b)(),i=Object(n.useState)("Pending"),u=Object(d.a)(i,2),m=u[0],f=u[1],b=(null===c||void 0===c?void 0:c.paginator)||{},v=b.totalPages,E=b.currentPage,h=void 0===E?1:E,y=b.perPage,N=void 0===y?10:y,O=b.total;Object(n.useEffect)((function(){o(rr(m))}),[o,m]),Object(n.useEffect)((function(){o(me())}),[]);var j=r.a.useMemo((function(){return[{Header:"Requested by",accessor:"requestedBy",classes:"requestedBy"},{Header:"Niche",accessor:"nicheLabel",Cell:function(e){return r.a.createElement(s.b,{to:{pathname:"/urlhandler",search:"?nicheId=".concat(e.row.original.nicheId,"&nicheName=").concat(e.row.original.nicheName,"&cellId=").concat(e.row.original.nicheCellId)}},e.value)},classes:"niche"},{Header:"Lender",accessor:"lenderName",classes:"lender"},{Header:"Request details",accessor:function(e){return{columnLabel:e.columnLabel,value:e.value,id:e._id}},Cell:tc,classes:"requestDetails"},{Header:"Status",accessor:"status",Cell:function(e){return r.a.createElement("span",{className:"badge badge-".concat(e.value)},e.value)},classes:"status"},{Header:"Admin",accessor:"reviewedBy",classes:"admin"},{Header:"Updated",accessor:"updatedAt",Cell:function(e){return r.a.createElement("span",null,De()(e.value).fromNow())},classes:"time"}]}),[]),x=r.a.useMemo((function(){return c.data||[]}),[c.data]),C=Object(mr.useTable)({columns:j,data:x}),k=C.getTableProps,w=C.getTableBodyProps,T=C.headerGroups,I=C.rows,S=C.prepareRow,A=Object(n.useCallback)((function(e,t){o(rr(m,{page:e.pageNo,perPage:e.itemsPerPage})),t&&t()}),[o,m]);return r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{className:"ch-table-container"},r.a.createElement(Dr.a,k(),r.a.createElement("thead",null,T.map((function(e){return r.a.createElement("tr",e.getHeaderGroupProps(),e.headers.map((function(e){return r.a.createElement("th",Object.assign({},e.getHeaderProps(),{className:e.classes?"th-".concat(e.classes):""}),"Status"===e.render("Header")?r.a.createElement(ec,{id:"request-status",selected:m,setFilter:function(e){return f(e)}}):r.a.createElement("div",{className:"header-title"},e.render("Header")))})))}))),r.a.createElement("tbody",w(),I.map((function(e,t){return S(e),r.a.createElement("tr",e.getRowProps(),e.cells.map((function(e){return r.a.createElement("td",e.getCellProps(),e.render("Cell"))})))})),0===I.length&&(l?r.a.createElement("tr",null,r.a.createElement("td",{colSpan:6,style:{textAlign:"center"}},r.a.createElement(ga.ClipLoader,{size:50,color:"#27ade7",loading:l,className:"listLoader"}))):r.a.createElement("tr",null,r.a.createElement("td",{colSpan:6,style:{textAlign:"center",background:"#ffe0e0"}},r.a.createElement("span",null,"No Requests"))))))),(null===c||void 0===c||null===(e=c.data)||void 0===e?void 0:e.length)>0&&r.a.createElement("div",{className:"ch-table-pagination-section d-flex container-fluid"},r.a.createElement("div",{className:"ch-desc"},r.a.createElement(g.a,null,"Total requests ",r.a.createElement("span",null,O))),r.a.createElement(Xr,{onPageChange:A,totalPages:v,defaultCurrentPage:+h,perPage:N})))},nc=function(){return Qt()?r.a.createElement(ac,null):r.a.createElement(o.a,{to:"/"})},rc=function(e){var t=e.actionType,a=e.actions,n=cc(t,a);return r.a.createElement(v.a,{size:"lg",color:"accent",onClick:n.onClick,className:"lgLogoutBtn d-flex align-items-center justify-content-center noFocus",title:"Try Again"},r.a.createElement("div",{className:" mr-1"},n.label),n.icon)},cc=function(e,t){switch(e){case W:return{label:"Try Again",icon:r.a.createElement(E.u,null),onClick:function(){return t.redirect("/")}};case J:return{label:"Go to Home",icon:r.a.createElement(E.u,null),onClick:function(){return t.redirect("/")}};default:return{label:"Log out",icon:r.a.createElement(E.t,null),onClick:function(){return t.logOut()}}}},lc=function(e){var t=Object(p.b)(),a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"DEFAULT";return{title:Q[e=Q[e]?e:"DEFAULT"].TITLE,body:Q[e].BODY,actionType:Q[e].ACTION_TYPE}}(e.type),n=a.title,c=a.body,l=a.actionType;return r.a.createElement("div",{className:"d-flex align-items-center justify-content-center flex-column errorWrp"},r.a.createElement("div",{className:"innerBound"},r.a.createElement("img",{className:"errorMsg",src:"img/error.png",alt:""}),r.a.createElement("h3",{className:"mt-1 mb-3"},n),r.a.createElement(rc,{actionType:l,actions:{redirect:function(e){window.location.href=e},logOut:function(){t(Zn())}}}),r.a.createElement("p",{className:"mb-1 text-center"},ra()(c))))},sc=function(){return r.a.createElement(lc,{type:"NOT_FOUND"})},oc=function(e){var t=Object(p.b)(),a=new URL(window.location.href);return r.a.useEffect((function(){var e=a.searchParams.get("nicheId"),n=a.searchParams.get("nicheName"),r=a.searchParams.get("niches"),c=a.searchParams.get("cellId");if(e&&n)t(Ln({nicheId:e,nicheName:n,cellId:c}));else if(r)try{var l=JSON.parse(window.atob(decodeURIComponent(r)));t(function(e){return function(){var t=Object(O.a)(N.a.mark((function t(a,n){var r,c,l;return N.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Mt(),t.prev=1,a({type:"INITIALIZE_TABLE_INFO"}),a({type:"CLEAR_SELECTED_NICHES"}),t.next=6,te(e);case 6:if(t.t1=r=t.sent,t.t0=null===t.t1,t.t0){t.next=10;break}t.t0=void 0===r;case 10:if(!t.t0){t.next=14;break}t.t2=void 0,t.next=15;break;case 14:t.t2=r.data;case 15:(c=t.t2)&&(l=[],c.forEach((function(e){var t=e.defaultColumn,n=e.columns,r=e.id,c=e.label,s=e.name,o=n.filter((function(e){return e.id!==t})).map((function(e){return e.id}));a({type:"ADD_HIDDEN_COLUMNS",payload:o}),a(le(t)),a(se(t,o)),l=e.rowData.map((function(e){return Cn(e,l)}));var i={columns:e.columns.map((function(e){return xn(e,n)})),Header:e.label,accessor:e.name,defaultColumnId:e.defaultColumn,disableSortBy:!0};a(re(i)),a(Rn({id:r,defaultColumnId:t,label:c,name:s}))})),a(ce(l))),t.next=22;break;case 19:t.prev=19,t.t3=t.catch(1),console.error(t.t3);case 22:return t.prev=22,qt(),t.finish(22);case 25:case"end":return t.stop()}}),t,null,[[1,19,22,25]])})));return function(e,a){return t.apply(this,arguments)}}()}(l))}catch(s){console.log("Invalid niche names")}}),[]),r.a.createElement(o.a,{to:"/"})},ic=a(361),uc=a.n(ic),mc="",dc=function(){var e=Object(o.h)(),t=Object(o.g)(),a=uc.a.parse(e.search);return""===mc&&""!==a.type&&(mc=a.type,t.push("/sorry")),r.a.createElement(lc,{type:mc})},pc=a(50),fc=a(51),bc=a(80),vc=a(79),Ec=function(e){Object(bc.a)(a,e);var t=Object(vc.a)(a);function a(e){var n;return Object(pc.a)(this,a),(n=t.call(this,e)).state={hasError:!1},n}return Object(fc.a)(a,[{key:"componentDidCatch",value:function(e,t){console.error(e,t)}},{key:"render",value:function(){return this.state.hasError?r.a.createElement(lc,null):this.props.children}}],[{key:"getDerivedStateFromError",value:function(){return{hasError:!0}}}]),a}(r.a.Component),hc=function(){var e=Object(O.a)(N.a.mark((function e(t){var a;return N.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a={body:{lender:{id:t.lender.value,name:t.lender.shortName},nichesIds:t.niches},responseType:"application/json"},e.abrupt("return",j.a.post(X,"/niches/export",a));case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();var gc=a(752),yc=function(){var e=Object(p.b)(),t=Object(p.c)((function(e){return e})).exportData;Object(n.useEffect)((function(){var a;t.enableExport&&e((a=t,function(){var e=Object(O.a)(N.a.mark((function e(t){var n,r,c,l;return N.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t({type:"SET_LOADING"}),e.next=4,hc(a);case 4:n=e.sent,r=window.URL.createObjectURL(new Blob([gr(n.data.data.data)],{type:""})),(c=document.createElement("a")).href=r,l=n.data.filename,c.setAttribute("download",l),document.body.appendChild(c),c.click(),t({type:"DISABLE_EXPORT_DATA"}),window.close(),e.next=19;break;case 16:e.prev=16,e.t0=e.catch(0),console.error(e.t0);case 19:return e.prev=19,t({type:"UNSET_LOADING"}),e.finish(19);case 22:case"end":return e.stop()}}),e,null,[[0,16,19,22]])})));return function(t){return e.apply(this,arguments)}}()))}),[]);return r.a.createElement("div",{className:"mt-5 text-center"},r.a.createElement("div",null,t.loading?"Downloading file...":"Error Occurred: Unable to export particular data"),function(){if(t.loading)return r.a.createElement(gc.a,{style:{width:"3rem",height:"3rem"},type:"grow"})}())};var Nc=function(){var e=Object(o.i)().path;return r.a.createElement(Ec,null,r.a.createElement(i.a,{fluid:!0,className:"p-0"},r.a.createElement(ur,null),r.a.createElement(i.a,{fluid:!0,className:"belowHeader"},r.a.createElement(o.d,null,r.a.createElement(Rr,{exact:!0,path:e,component:function(){return r.a.createElement(r.a.Fragment,null,r.a.createElement(Gn,null),"\xa0",r.a.createElement(xr,null))}}),r.a.createElement(Rr,{exact:!0,path:"/requests",component:nc}),r.a.createElement(Rr,{exact:!0,path:"/sorry",component:dc}),r.a.createElement(Rr,{exact:!0,path:"/urlhandler",component:oc}),r.a.createElement(Rr,{exact:!0,path:"/export-data",component:yc}),r.a.createElement(o.b,{component:sc})))))},Oc=a(365);var jc=Object(Oc.a)((function(){return r.a.createElement("div",{className:"d-flex justify-content-center login-bg"},r.a.createElement("div",{className:"d-flex align-items-flex-start justify-content-center align-items-start loginWrp"},r.a.createElement("div",{className:"hlogin"},r.a.createElement("img",{className:"titlelogo",alt:"HLE Logo",src:"img/login_icons/creditHive.svg"}),r.a.createElement("button",{className:"hprimarybtn btn btn-block google_btn",onClick:function(){return Qn.a.federatedSignIn({provider:"Google"})}}," ",r.a.createElement("span",null," ",r.a.createElement("img",{className:"gi",alt:"Google Logo",src:"img/login_icons/google.svg"}))," ",r.a.createElement("div",{className:"d-flex justify-content-center text"},"Sign in with Google")))))})),xc=a(754);var Cc=function(e){var t=Object(n.useState)(!1),a=Object(d.a)(t,2),c=a[0],l=a[1],s=Object(n.useState)(!1),o=Object(d.a)(s,2),u=o[0],m=o[1],p=Object(n.useState)(!1),f=Object(d.a)(p,2),y=f[0],N=f[1],O=Object(n.useState)(!1),j=Object(d.a)(O,2),x=j[0],C=j[1],k=Object(n.useState)(!0),w=Object(d.a)(k,2),T=w[0],I=w[1],S=e.className,A=Object(n.useState)(!1),_=Object(d.a)(A,2),P=_[0],R=_[1],D=function(){return R(!P)},L=Object(n.useState)("1"),F=Object(d.a)(L,2),M=F[0],q=F[1],U=function(e){M!==e&&q(e)};Object(n.useEffect)((function(){document.body.classList.add("sideMenuOpen")}),[]);var B=Object(n.useState)([{parent:"Maximum LVRs and Genuine Savings",child:["Obtaining Personal Loan as Deposit","Maximum Loan Size"],open:!1},{parent:"PAYG Income",child:["Allowances","Bonus Income","Casual / Temporary Employees","Commission Income","Maternity Leave","Overtime","PAYG Contractor","Probation & Short Term Permanent Employment","Employed by Family Business","Salary Packaging - Tax Free Arrangement"],open:!1},{parent:"Self Employed",child:["AirBnB Income"," ADF Medical Discharge Pension"," Adult Workers"," Centrelink Income: Newstart, Pensions & Disability"," Child Support"," Common Debt Reducer"," DHOAS Home Loan(Defence subsidy)"," Family Tax Benefits","Income Protection Insurance","Parenting Payments, Carer\u2019s Allowance & Other Benefits"," Scholarship Income","Share & Dividend Income"," Workers Compensation","Rent for a Housemate","Transport Accident Commission(TAC) payments"],open:!1}]),H=Object(d.a)(B,2),z=H[0],V=H[1],G=function(e){V(z.map((function(t,a){return t.open=a===e&&!t.open,t})))};return r.a.createElement(i.a,{fluid:!0,className:"p-0"},r.a.createElement(Yn.a,{color:"light",fixed:"top",light:!0,expand:"md",className:" header d-flex justify-content-between"},r.a.createElement(xc.a,{href:"/"},"Credit Square"),r.a.createElement(Wn.a,null,r.a.createElement(Jn.a,{isOpen:c,toggle:function(){return l((function(e){return!e}))}},r.a.createElement(Gt.a,{caret:!0,color:"link",className:"d-flex align-items-center p-0 text-decoration-none noFocus"},r.a.createElement("div",{className:"d-flex align-items-center"},r.a.createElement("div",{className:"roundedImage mr-2"}," ",r.a.createElement("img",{src:"/img/jenishManandhar.jpg",className:"img-fluid",alt:"j"})),r.a.createElement("div",null,"Jenish Manandhar"))),r.a.createElement(Yt.a,{right:!0,className:"p-0"},r.a.createElement(Wt.a,{header:!0,className:"p-8 d-flex align-items-center"}," ",r.a.createElement(E.t,{className:"logoutBtn mr-4"})," Log 0ut ")))," ")),r.a.createElement(i.a,{fluid:!0,className:"belowHeader"},r.a.createElement("div",{className:"sideMenu"},r.a.createElement("div",{className:"p-8 position-relative"},r.a.createElement(b.a,{type:"email",name:"email",id:"leftSearch",placeholder:"search"}),r.a.createElement(E.w,{className:"searchIcon"})),r.a.createElement("div",{className:"sidemenuToggle menuArrow",onClick:function(){I((function(e){return!e})),T?document.body.classList.remove("sideMenuOpen"):document.body.classList.add("sideMenuOpen")}}," ",r.a.createElement(v.a,{color:"link",className:"noFocus arrowBtn"},r.a.createElement(E.m,{className:T?"arrowOpened":"arrowOpened rotate180"}))," "),z.map((function(e,t){return r.a.createElement(Mn,{nicheMenu:e,index:t,toggleNicheMenu:G})}))),r.a.createElement("div",{className:"pageContent"},r.a.createElement("div",{className:"pageHeader d-flex align-items-center justify-content-end mb-8"},r.a.createElement(Jn.a,{isOpen:u,toggle:function(){return m((function(e){return!e}))}},r.a.createElement(Gt.a,{color:"primary",className:"d-flex align-items-center py-4 px-8 text-decoration-none noFocus btn btn-sm mr-8"},r.a.createElement("div",null,"Save combination")),r.a.createElement(Yt.a,{right:!0,className:"p-0"},r.a.createElement(Wt.a,{header:!0,className:"p-8"},r.a.createElement(h.a,{check:!0},r.a.createElement(g.a,{check:!0,className:"d-flex align-items-center"},r.a.createElement(b.a,{type:"checkbox"}),r.a.createElement("span",{className:"pl-1"}," niche sheet")))))),r.a.createElement(Jn.a,{isOpen:y,toggle:function(){return N((function(e){return!e}))}},r.a.createElement(Gt.a,{color:"link",className:"d-flex align-items-center p-0 text-decoration-none noFocus btn btn-sm "},r.a.createElement(E.x,{className:"gearIcon"})),r.a.createElement(Yt.a,{right:!0,className:"p-0"},r.a.createElement(Wt.a,{header:!0,className:"p-8"},r.a.createElement(h.a,{check:!0},r.a.createElement(g.a,{check:!0,className:"d-flex align-items-center"},r.a.createElement(b.a,{type:"checkbox"}),r.a.createElement("span",{className:"pl-1"}," niche sheet"))))))),r.a.createElement(v.a,{color:"link",size:"sm",onClick:D}," ",r.a.createElement(E.o,null)),r.a.createElement(mt.a,{isOpen:P,toggle:D,className:S},r.a.createElement(dt.a,{toggle:D,className:"p-8 f16"}," Update request"),r.a.createElement(pt.a,{className:"p-8"},r.a.createElement(ft.a,{tabs:!0},r.a.createElement(bt.a,null,r.a.createElement(vt.a,{className:yt()({active:"1"===M}),onClick:function(){U("1")}},"Current requests")),r.a.createElement(bt.a,null,r.a.createElement(vt.a,{className:yt()({active:"2"===M}),onClick:function(){U("2")}},"New request"))),r.a.createElement(Et.a,{activeTab:M},r.a.createElement(ht.a,{tabId:"1",className:"py-8"},r.a.createElement("div",{className:"previousRequest p-8"},r.a.createElement("div",{className:"request__userImage d-flex justify-content-between"},r.a.createElement("div",{className:"d-flex "},r.a.createElement("div",{className:"roundedImage mr-2"}," ",r.a.createElement("img",{src:"/img/jenishManandhar.jpg",className:"img-fluid",alt:"j"})),r.a.createElement("div",{className:"mr-15"},r.a.createElement("div",{className:"request__name f600"}," Mohit Lal Pradhan"),r.a.createElement("div",{className:"request__date text-muted"}," 12 jan 2018")),r.a.createElement("div",null," ",r.a.createElement(Jn.a,{isOpen:x,toggle:function(){return C((function(e){return!e}))}},r.a.createElement(Gt.a,{caret:!0,color:"primary",className:"btn btn-sm"},"Pending"),r.a.createElement(Yt.a,{className:"smallDropdown"},r.a.createElement(Wt.a,null,"Approved"),r.a.createElement(Wt.a,{divider:!0}),r.a.createElement(Wt.a,null,"In review"),r.a.createElement(Wt.a,{divider:!0}),r.a.createElement(Wt.a,null,"Rejected"))))),r.a.createElement("div",{className:" d-flex align-items-center flex-column pl-15 text-center"},r.a.createElement("div",{className:"d-flex align-items-center"},r.a.createElement(v.a,{size:"sm",outline:!0,color:"primary",className:"outline mr-1",title:"click and support"}," ",r.a.createElement("span",null," ",r.a.createElement("b",null,"+1"))," "),r.a.createElement("span",null," 100")),r.a.createElement("div",{className:"text-muted f10"}," Support this request "))),r.a.createElement("div",{className:"mb-1"},"Accepted ",r.a.createElement("span",{className:"f600"}," unpaid defaults "),"for ",r.a.createElement("i",null,"stgorge:")," ",r.a.createElement("span",{className:"text-muted"},"yes")),r.a.createElement("div",null,r.a.createElement("div",{className:"f600 text-muted"}," ",r.a.createElement("i",null,"Source")," "),r.a.createElement("div",null," Resent update in brokerpedia ",r.a.createElement("a",{href:"#"},"www.brokerpedia.com"))))),r.a.createElement(ht.a,{tabId:"2",className:"py-8"},r.a.createElement("div",{className:"d-flex mb-15"},r.a.createElement(h.a,{check:!0},r.a.createElement(g.a,{check:!0,className:"mr-3 mt-8"},r.a.createElement(b.a,{type:"radio",name:"radio1"})," ","General")),r.a.createElement(h.a,{check:!0,className:"mr-3 mt-8"},r.a.createElement(g.a,{check:!0},r.a.createElement(b.a,{type:"radio",name:"radio1"})," ","Case by case")),r.a.createElement(h.a,{check:!0,className:"mr-3 mt-8"},r.a.createElement(g.a,{check:!0},r.a.createElement(b.a,{type:"radio",name:"radio1"})," ","Unlimited")),r.a.createElement(h.a,{check:!0,className:"mr-3 mt-8"},r.a.createElement(g.a,{check:!0},r.a.createElement(b.a,{type:"radio",name:"radio1"})," ","No information"))),r.a.createElement(h.a,null,r.a.createElement(g.a,{for:"exampleSelect"},"Accept paid default?"),r.a.createElement(b.a,{type:"select",name:"select"},r.a.createElement("option",null,"Yes"),r.a.createElement("option",null,"No"))),r.a.createElement(g.a,{for:"exampleSelect"},"Change priority"),r.a.createElement("div",{className:"custom-radios mb-1"},r.a.createElement("div",{className:"mr-1"},r.a.createElement("input",{type:"radio",id:"color-1",name:"color",value:"color-1"}),r.a.createElement("label",{htmlFor:"color-1"},r.a.createElement("span",{className:"d-flex align-items-center justify-content-center"},r.a.createElement(E.i,{className:"tick"})))),r.a.createElement("div",{className:"mr-1"},r.a.createElement("input",{type:"radio",id:"color-2",name:"color",value:"color-2"}),r.a.createElement("label",{htmlFor:"color-2"},r.a.createElement("span",{className:"d-flex align-items-center justify-content-center"},r.a.createElement(E.i,{className:"tick"})))),r.a.createElement("div",{className:"mr-1"},r.a.createElement("input",{type:"radio",id:"color-3",name:"color",value:"color-3"}),r.a.createElement("label",{htmlFor:"color-3"},r.a.createElement("span",{className:"d-flex align-items-center justify-content-center"},r.a.createElement(E.i,{className:"tick"})))),r.a.createElement("div",{className:"mr-1"},r.a.createElement("input",{type:"radio",id:"color-4",name:"color",value:"color-4"}),r.a.createElement("label",{htmlFor:"color-4"},r.a.createElement("span",{className:"d-flex align-items-center justify-content-center"},r.a.createElement(E.i,{className:"tick"})))),r.a.createElement("div",{className:"mr-1"},r.a.createElement("input",{type:"radio",id:"color-5",name:"color",value:"color-5"}),r.a.createElement("label",{htmlFor:"color-5"},r.a.createElement("span",{className:"d-flex align-items-center justify-content-center"},r.a.createElement(E.i,{className:"tick"}))))),r.a.createElement(h.a,null,r.a.createElement(g.a,{for:"exampleText"},"Add Source"),r.a.createElement(b.a,{type:"textarea",name:"text",id:"exampleText"})),r.a.createElement("div",{className:"d-flex justify-content-end"},r.a.createElement(v.a,{size:"sm",color:"link",className:"mr-2",onClick:D}," Cancel "),r.a.createElement(v.a,{size:"sm",color:"primary",onClick:D}," Send request ")))))),r.a.createElement(Dr.a,{responsive:!0},r.a.createElement("thead",null,r.a.createElement("tr",null,r.a.createElement("th",null,"#"),r.a.createElement("th",null,"Table heading"),r.a.createElement("th",null,"Table heading"),r.a.createElement("th",null,"Table heading"),r.a.createElement("th",null,"Table heading"),r.a.createElement("th",null,"Table heading"),r.a.createElement("th",null,"Table heading"))),r.a.createElement("tbody",null,r.a.createElement("tr",null,r.a.createElement("th",{scope:"row"},"1"),r.a.createElement("td",null,"Table cell"),r.a.createElement("td",null,"Table cell"),r.a.createElement("td",null,"Table cell"),r.a.createElement("td",null,"Table cell"),r.a.createElement("td",null,"Table cell"),r.a.createElement("td",null,"Table cell")),r.a.createElement("tr",null,r.a.createElement("th",{scope:"row"},"2"),r.a.createElement("td",null,"Table cell"),r.a.createElement("td",null,"Table cell"),r.a.createElement("td",null,"Table cell"),r.a.createElement("td",null,"Table cell"),r.a.createElement("td",null,"Table cell"),r.a.createElement("td",null,"Table cell")),r.a.createElement("tr",null,r.a.createElement("th",{scope:"row"},"3"),r.a.createElement("td",null,"Table cell"),r.a.createElement("td",null,"Table cell"),r.a.createElement("td",null,"Table cell"),r.a.createElement("td",null,"Table cell"),r.a.createElement("td",null,"Table cell"),r.a.createElement("td",null,"Table cell"))))," ")))},kc=function(e){var t=Object.assign({},e),a=Object(n.useState)(!1),c=Object(d.a)(a,2),l=c[0],s=c[1];return Object(n.useEffect)((function(){function e(){return(e=Object(O.a)(N.a.mark((function e(){return N.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Qn.a.currentAuthenticatedUser();case 3:if(!e.sent){e.next=5;break}s(!0);case 5:e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.error(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[]),l?r.a.createElement(o.a,{to:"/"}):r.a.createElement(o.b,t)},wc=function(){return Object(n.useEffect)((function(){for(var e=0,t=Object.values(Ar.scripts);e0&&void 0!==arguments[0]?arguments[0]:Sc,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"STORE_USER_ATTRIBUTES":var a=t.payload;return a.id=a.sub,{loggedIn:!0,userAttributes:Object(m.a)({},t.payload)};case"INITIAL_USER_STATE":return Sc;default:return e}},_c={list:[],selected:{}},Pc=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_c,t=arguments.length>1?arguments[1]:void 0,a=t.payload,n=t.type;switch(n){case"FETCH_NICHE_LIST":return Object(m.a)(Object(m.a)({},e),{},{list:a});case"UPDATE_SELECTED_NICHE_LIST":var r=a.niche.id,c=a.isActive;return Object(m.a)(Object(m.a)({},e),{},{selected:c?Object(m.a)(Object(m.a)({},e.selected),{},Object(pe.a)({},r,Object(m.a)({},a.niche))):Object(ae.omit)(e.selected,[r])});case"CLEAR_SELECTED_NICHES":return Object(m.a)(Object(m.a)({},e),{},{selected:{}});case"ADD_SELECTED_NICHE":return Object(m.a)(Object(m.a)({},e),{},{selected:Object(m.a)(Object(m.a)({},e.selected),{},Object(pe.a)({},a.id,Object(m.a)({},a)))});default:return e}},Rc={list:{}},Dc=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Rc,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"FETCH_LENDER_LIST":var a=t.payload;return Object(m.a)(Object(m.a)({},e),{},{list:a});case"INITIAL_LENDER_STATE":return Rc;default:return e}},Lc={totalPendingRequests:0,tasks:[],showRequestRejectionModal:!1,requestId:null,paginatedTasks:[],isLoading:!1},Fc=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Lc,t=arguments.length>1?arguments[1]:void 0,a=t.payload;switch(t.type){case"SET_REQUEST_FORM_METADATA":return Object(m.a)(Object(m.a)({},e),a);case"SET_REQUEST_TASKS":return Object(m.a)(Object(m.a)({},e),{},{totalPendingRequests:a.totalPendingRequests,tasks:a.data});case"SET_PAGINATED_REQUEST_TASKS":return Object(m.a)(Object(m.a)({},e),{},{paginatedTasks:a,isLoading:!1});case"FETCHING_PAGINATED_REQUEST_TASKS":return Object(m.a)(Object(m.a)({},e),{},{isLoading:!0});case"FETCHING_PAGINATED_REQUEST_TASKS_FAILED":return Object(m.a)(Object(m.a)({},e),{},{isLoading:!1});case"SHOW_REQUEST_REJECTION_MODAL":return Object(m.a)(Object(m.a)({},e),{},{showRequestRejectionModal:!0,requestId:a.requestId});case"CLOSE_REQUEST_REJECTION_MODAL":return Object(m.a)(Object(m.a)({},e),{},{showRequestRejectionModal:!1});default:return e}},Mc={cellData:[]},qc=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Mc,t=arguments.length>1?arguments[1]:void 0,a=t.payload;switch(t.type){case"SET_CELL_DATA":return Object(m.a)(Object(m.a)({},e),{},{cellData:a});case"SET_REQUEST_STATUS":var n=a.status,r=a.requestId,c=e.cellData;return Object(m.a)(Object(m.a)({},e),{},{cellData:c.map((function(e){return e.id===r?Object(m.a)(Object(m.a)({},e),{},{status:n}):Object(m.a)({},e)}))});default:return e}},Uc={niches:[],lender:{value:"",label:""},isModalOpen:!1,enableExport:!1,loading:!1},Bc=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Uc,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"OPEN_EXPORT_DATA_MODAL":return Object(m.a)(Object(m.a)({},e),{},{isModalOpen:!0});case"CLOSE_EXPORT_DATA_MODAL":return Uc;case"SET_LENDER":return Object(m.a)(Object(m.a)({},e),{},{lender:t.payload});case"SET_SELECTED_NICHES":return Object(m.a)(Object(m.a)({},e),{},{niches:t.payload});case"ENABLE_EXPORT_DATA":return Object(m.a)(Object(m.a)({},e),{},{enableExport:!0});case"DISABLE_EXPORT_DATA":return Object(m.a)(Object(m.a)({},e),{},{enableExport:!1});case"SET_LOADING":return Object(m.a)(Object(m.a)({},e),{},{loading:!0});case"UNSET_LOADING":return Object(m.a)(Object(m.a)({},e),{},{loading:!1});default:return e}},Hc=Object(Tc.c)({user:Ac,niches:Pc,lenders:Dc,tableInfo:Ce,cellRequest:Fc,cell:qc,exportData:Bc}),zc=function(e,t){return"@@INIT"===t.type&&(e=Object(m.a)(Object(m.a)({},e),{},{cellRequest:{}})),Hc(e,t)},Vc=a(364),Gc=a.n(Vc);Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));a(693);var Yc=a(258),Wc=function(){var e=Tc.d,t=[Ic.a],a=function(){try{var e=localStorage.getItem("state");if(null===e)return;return JSON.parse(e)}catch(t){return void console.error("Error while loading state ",t)}}(),n=Object(Tc.e)(zc,a,e(Tc.a.apply(void 0,t)));return n.subscribe(Gc()((function(){!function(e){try{var t=JSON.stringify(e);localStorage.setItem("state",t)}catch(a){console.error("Error saving state ",a)}}(n.getState())}),200)),n}();Ar.datadogClientToken&&Ar.datadogApplicationId&&Ar.datadogServiceName&&(Yc.a.init({applicationId:Ar.datadogApplicationId,clientToken:Ar.datadogClientToken,service:Ar.datadogServiceName,env:Ar.env,sampleRate:100,trackInteractions:!0,defaultPrivacyLevel:"allow",allowedTracingOrigins:[/https:\/\/.*\.?homeloanexperts\.(net|com).*/]}),Yc.a.startSessionReplayRecording()),l.a.render(r.a.createElement(p.a,{store:Wc},r.a.createElement(s.a,null,r.a.createElement(r.a.StrictMode,null,r.a.createElement(wc,null),r.a.createElement(St.a,{autoClose:3e3})))),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()})).catch((function(e){console.error(e.message)}))}},[[381,1,2]]]);