affiliate-front-shared 1.3.23 → 1.3.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/popup-mfa/mfa-all-popups/SelectMFAMethod.d.ts +1 -1
- package/dist/components/popup-mfa/mfa-all-popups/index.d.ts +4 -3
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +10 -3
- package/dist/index.mjs.map +1 -1
- package/dist/utils/PackageServicesProvider.d.ts +3 -3
- package/package.json +1 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const SelectMFAMethod: ({ onClose, setCurrentStep, setConfirmationToken,
|
|
1
|
+
declare const SelectMFAMethod: ({ onClose, setCurrentStep, setConfirmationToken, enableTwoFactorService, setRefetch, setIdOf2FA, }: any) => import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
export default SelectMFAMethod;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
1
2
|
export declare enum MFA_STEP {
|
|
2
3
|
SELECT_MFA_OPTION = 0,
|
|
3
4
|
SELECT_AUTHENTICATOR_APP = 1,
|
|
@@ -12,8 +13,8 @@ interface ModalManagerProps {
|
|
|
12
13
|
isOpen: boolean;
|
|
13
14
|
setIsOpen: (open: boolean) => void;
|
|
14
15
|
modal?: MFA_STEP;
|
|
15
|
-
setRefetch?:
|
|
16
|
-
|
|
16
|
+
setRefetch?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
17
|
+
enableTwoFactorService?: () => Promise<any>;
|
|
17
18
|
}
|
|
18
|
-
declare const ModalManager: ({ isOpen, setIsOpen, modal, setRefetch,
|
|
19
|
+
declare const ModalManager: ({ isOpen, setIsOpen, modal, setRefetch, enableTwoFactorService, }: ModalManagerProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
20
|
export default ModalManager;
|
package/dist/index.cjs
CHANGED
|
@@ -2402,7 +2402,7 @@
|
|
|
2402
2402
|
max-width: 500px;
|
|
2403
2403
|
position: relative;
|
|
2404
2404
|
animation: fadeIn 0.3s ease;
|
|
2405
|
-
`,Ia=document.getElementById("modal-root")||(()=>{const r=document.createElement("div");return r.id="modal-root",document.body.appendChild(r),r})();function wt({isOpen:r,onClose:e,children:t}){return x.useEffect(()=>{const n=i=>{i.key==="Escape"&&e()};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[e]),r?Pn.createPortal(o.jsx(Ta,{onClick:e,children:o.jsx($a,{onClick:n=>n.stopPropagation(),children:t})}),Ia):null}const Ma={1:"Enable2FaFirst",2:"ToViewOtpContactInfoDesc",3:"ToViewTotpContactInfoDesc",4:"ToViewBackupCodeContactInfoDesc"},nn=({isVisible:r,setVisible:e,code:t,mfaType:n,id:i,isBlocked:a,onBlockStateClose:s})=>{const{confirmContactInfo:l,confirmContactInfoBackup:d}=me(),{setUser:c}=Ee(),[u,p]=x.useState(""),[h,f]=x.useState([]),[g,v]=x.useState(!1);function L(S){p(S)}async function M(){const S=l;if(S)try{f([]);const z=await S(t,u,i);c(z.data.value),O()}catch(z){if(console.log(z),z.status===400){const U=z.response.data,Y=$e(U.errors);f(Y)}}}async function j(S){const z=d;if(z)try{f([]);const U=await z(S);c(U.data.value)}catch(U){if(console.log(U),U.status===400){const Y=U.response.data,B=$e(Y.errors);f(B)}}}function O(){p(""),e(!1),f([])}return a?o.jsx(wt,{isOpen:a,onClose:s,children:o.jsxs(ba,{children:[o.jsxs(wa,{children:[o.jsxs(Ca,{children:[o.jsx("span",{children:V("ContactInformationBlocked")}),o.jsx("span",{onClick:s,children:o.jsx(At,{})})]}),o.jsx(ja,{children:V("ContactInformationBlockedDesc")})]}),o.jsxs(Sa,{children:[V("TryAgain"),o.jsx(ce,{})]})]})}):o.jsx(wt,{isOpen:r,onClose:O,children:g?o.jsx(Bt,{setBackupActivated:v,backupCodeEndpoint:j,confirmationToken:t,id:i,setVisible:e}):o.jsxs(Qr,{children:[o.jsx("h2",{children:G("EnterVerificationCode")}),o.jsx("p",{children:n!==void 0?V(Ma[n]):""}),n!==1&&o.jsxs(o.Fragment,{children:[o.jsxs(va,{className:h.length>0?"verification-error":"",children:[o.jsx(T.Input.OTP,{value:u,onChange:L}),o.jsxs(ya,{children:[G("DidnReceiveCode")," ",o.jsx(en,{onClick:()=>v(!0),children:G("EnterBackupCode")})]}),h.map(S=>o.jsxs("span",{children:[o.jsx(Ze,{}),S.errors[0]]},S.name))]}),o.jsxs("button",{onClick:M,disabled:u.length!==6,children:[Z("ShowContactInformation"),o.jsx(ce,{})]})]})]})})},an=()=>{const{enableContactInfo:r,disableContactInfo:e}=me(),{setUser:t}=Ee(),[n,i]=x.useState(!1),[a,s]=x.useState(null),[l,d]=x.useState(!1),c=async()=>{var h,f,g,v,L,M,j;if(r)try{d(!1);const O=await r();s({token:(f=(h=O.data)==null?void 0:h.value)==null?void 0:f.token,id:(v=(g=O.data)==null?void 0:g.value)==null?void 0:v.id,mfaType:(M=(L=O.data)==null?void 0:L.value)==null?void 0:M.mfaType}),i(!0)}catch(O){const S=(j=O.response)==null?void 0:j.data,z=S==null?void 0:S.errors;(z&&Array.isArray(z[""])&&z[""][0]==="TooManyAttempts"||z[""][0]==="IsNotAllowed")&&d(!0)}};async function u(){if(!e)return;const h=await e();t(h.data.value)}const p=()=>{d(!1),i(!1)};return{isContactInfoModalVisible:n,setIsContactInfoModalVisible:i,isBlocked:l,setIsBlocked:d,onBlockStateClose:p,handleEnableContactInfo:c,handleDisableContactInfo:u,ContactInfoModalProps:{isVisible:n,setVisible:i,code:a==null?void 0:a.token,mfaType:a==null?void 0:a.mfaType,id:a==null?void 0:a.id,isBlocked:l,onBlockStateClose:p}}},Pa=({close:r})=>{var M;const{user:e}=Ee(),t=D(j=>j.columns),n=D(j=>j.groupByArr),i=D(j=>j.hideItems),a=D(j=>j.activeTableView),s=D(j=>j.setActiveTableView),l=D(j=>j.setGroupByArr),d=D(j=>j.setHideItems),c=D(j=>j.resetStore),{handleEnableContactInfo:u,handleDisableContactInfo:p,ContactInfoModalProps:h}=an();function f(j){const O=t.find(S=>S.dataIndex==j.value);l([O])}function g(j,O){d({...i,[j.dataIndex]:!!O})}function v(j,O){const S=new Date(j),z=new Date(O),U=Math.abs(z.getTime()-S.getTime()),Y=Math.floor(U/(1e3*60))%60,B=Math.floor(U/(1e3*60*60))%24,F=[];return B>0&&F.push(`${B}h`),Y>0&&F.push(`${Y}m`),F.join(" ")}function L(){c(),r()}return o.jsxs(ma,{children:[o.jsxs("header",{children:[o.jsx("span",{children:V("ViewOptions")}),o.jsx("button",{onClick:r,children:o.jsx(tr,{})})]}),o.jsxs("div",{className:"setting-sidebar-content",children:[o.jsxs("ul",{className:"table-view-list",children:[o.jsxs("li",{className:a==we.TABLE?"active":"",onClick:()=>s(we.TABLE),children:[o.jsx(rr,{}),o.jsx("span",{children:V("Table")})]}),o.jsxs("li",{className:a==we.LIST?"active":"",onClick:()=>s(we.LIST),children:[o.jsx(at,{}),o.jsx("span",{children:V("List")})]})]}),o.jsx("ul",{className:"grouping-list",children:o.jsxs("li",{children:[o.jsx("span",{children:V("Grouping")}),o.jsx(T.Select,{className:"teeest",showSearch:!0,options:t.map(j=>({value:j.dataIndex,label:j.title})),labelInValue:!0,placeholder:o.jsxs(xa,{children:[o.jsx(at,{}),V("NoGrouping")]}),value:((M=n[0])==null?void 0:M.dataIndex)||null,onChange:f})]})}),o.jsxs("div",{className:"properties-list",children:[o.jsx("span",{children:V("ShowProperties")}),o.jsx("ul",{children:t.map(j=>o.jsx("li",{className:i[j.dataIndex]===!0?"hide":"",onClick:()=>g(j,i[j.dataIndex]!==!0),children:j.title},j.dataIndex))})]})]}),o.jsxs("footer",{children:[e!=null&&e.sensitiveDataExpiration&&new Date(e==null?void 0:e.sensitiveDataExpiration)>new Date?o.jsxs("button",{onClick:p,children:[V("HideContactInfo")," •"," ",v(new Date(e==null?void 0:e.sensitiveDataExpiration),new Date),o.jsx(tr,{})]}):o.jsxs("button",{onClick:u,children:[Z("ShowContactInformation")," ",o.jsx(rr,{})]}),o.jsxs("button",{onClick:L,children:[Z("ResetAllOptions"),o.jsx(_r,{})]})]}),o.jsx(nn,{...h})]})},za=({columns:r,getData:e,update:t,hasCreateBtn:n,GridPageTopLeftComponent:i,contentAfterPageHeader:a,onRowClick:s,checkedValue:l,rowKey:d,pagination:c,CustomFilters:u,initialFilterValues:p,tableAdditionalFields:h,createIsModal:f,editButton:g,noPagination:v,noDataProps:L,exportButton:M,hasSelect:j,selectProps:O,TableComponent:S,tableProps:z={},noNeedSidebarResponsiveButton:U,loadedData:Y=()=>{}})=>{var Q,xe,ue;const{user:B}=Ee(),F=D(q=>q.filters),H=D(q=>q.filterItems),y=D(q=>q.sortItems),R=D(q=>q.hideItems),_=D(q=>q.activeTableView),E=D(q=>q.setColumns),k=D(q=>q.setHasCreateBtn),w=D(q=>q.setHasSelect),b=D(q=>q.setCheckedValue),{response:C,loading:I}=$t(()=>e({...F,...p}),[F,B,t]);Si(),x.useEffect(()=>{C!=null&&C.data&&Y(C.data)},[C,Y]);const[P,A]=x.useState(!1),W=x.useRef(null),K=Rr(W),J=x.useMemo(()=>r.filter(ve=>R[ve.dataIndex]!==!0),[r,R]);return x.useEffect(()=>{k(n||!1),w(j||!1)},[j]),x.useEffect(()=>{E(r)},[r]),x.useEffect(()=>{b(l)},[l]),o.jsxs(Li,{children:[o.jsxs(Oi,{ref:W,children:[o.jsx(Fi,{noNeedSidebarResponsiveButton:U,hasSelect:j,selectProps:O,exportButton:M,setisSettingPopupVisible:A,CustomFilters:u,tableAdditionalFields:h,createIsModal:f,GridPageTopLeftComponent:i}),a,(H.length>0||y.length>0)&&o.jsx(Zi,{})]}),o.jsx(zi,{height:`calc(100vh - ${`${K}px`})`,children:S?o.jsx(S,{dataSource:((Q=C==null?void 0:C.data)==null?void 0:Q.items)||[],...z,rowKey:d||"id",columns:[{title:"",dataIndex:""},...J],loading:I,pagination:{current:F.Page,pageSize:F.PageSize,items:c==null?void 0:c.items}}):o.jsx(ga,{noPagination:v,editButton:g,createIsModal:f,rowKey:d||"id",columns:[{title:"",dataIndex:""},...J],dataSource:((xe=C==null?void 0:C.data)==null?void 0:xe.items)||[],loading:I,pagination:{current:F.Page,pageSize:F.PageSize,items:c==null?void 0:c.items},activeTableView:_,totalItemCount:((ue=C==null?void 0:C.data)==null?void 0:ue.totalItemCount)||0,onRowClick:s,noDataProps:L||null})}),P&&o.jsx(Pa,{close:()=>A(!1)})]})},Ha=r=>o.jsx(ji,{children:o.jsx(za,{...r})}),Ra=()=>{const r=Le(v=>v.isOpen),e=Le(v=>v.options),t=Le(v=>v.close),n=re.useLocation();if(x.useEffect(()=>{r&&t()},[n.pathname]),!e||!r)return null;const{title:i,component:a,componentProps:s,popupOptions:l,footerOptions:d,hideFooter:c,showCloseButton:u,onOk:p,onCancel:h}=e,f=()=>{h==null||h()},g=()=>{p==null||p()};return o.jsxs(dt,{centered:!0,title:i||u?o.jsxs(Ur,{children:[o.jsx("span",{children:i}),u&&o.jsx(Gr,{onClick:t,children:o.jsx(At,{})})]}):void 0,...l,children:[a&&o.jsx(a,{...s}),!c&&o.jsxs(Re,{children:[o.jsx(te,{onClick:f,children:d==null?void 0:d.cancelText}),o.jsx(Wr,{onClick:g,role:"button",tabIndex:0,onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&g()},children:d==null?void 0:d.okText})]})]})},on=({displayAddRuleModal:r,onClose:e,title:t,hideFooter:n=!1,children:i})=>o.jsx(dt,{open:r,onCancel:e,closeIcon:!1,title:t,footer:n?null:void 0,destroyOnClose:!0,centered:!0,children:i}),nr=({onClose:r,setCurrentStep:e,setConfirmationToken:t,enableTwoFactor:n,setRefetch:i,setIdOf2FA:a})=>{async function s(){var d,c,u,p;const l=n;if(l)try{const h=await l();(c=(d=h.data)==null?void 0:d.value)!=null&&c.isTwoFactorRequired?(t(h.data.value.token),a(h.data.value.id),e(Me.VERIFY_EMAIL_CODE)):((u=h==null?void 0:h.data)!=null&&u.success&&!((p=h==null?void 0:h.data)!=null&&p.value)&&i(f=>!f),r())}catch(h){console.error("Failed to toggle 2FA:",h)}}return o.jsxs("div",{children:[o.jsx(je,{children:o.jsxs(Se,{children:[G("SetupTwoFactorAuthentication"),o.jsx(le,{children:G("SetupTwoFactorAuthenticationDesc")})]})}),o.jsx(pe,{onClick:s,children:o.jsx(Re,{children:o.jsxs(te,{children:[o.jsx("span",{children:V("Email")}),o.jsx(ce,{})]})})}),o.jsx(pe,{onClick:()=>e(Me.SELECT_AUTHENTICATOR_APP),children:o.jsx(Re,{children:o.jsxs(te,{children:[o.jsx("span",{children:G("AuthenticatorApp")}),o.jsx(ce,{})]})})}),o.jsx(pe,{children:o.jsx(te,{onClick:r,children:Z("Cancel")})})]})},Na=({onClose:r,setCurrentStep:e,setBackupCodes:t,setRefetch:n})=>{const{verifyMFA:i}=me(),[a,s]=x.useState(""),[l,d]=x.useState([]);function c(p){s(p)}async function u(){var h;const p=i;if(p)try{const f=await p(a);(h=f.data)!=null&&h.success&&(e(Me.BACKUP_CODES),t(f.data.value.recoveryCodes))}catch(f){console.log(f)}finally{n(f=>f+1)}}return o.jsxs("div",{children:[o.jsxs(Se,{children:[G("EnterVerificationCode"),o.jsx(le,{children:G("YouMaySeeVerificationCode")})]}),o.jsxs(rn,{children:[o.jsx(T.Input.OTP,{value:a,onChange:c}),l.map(p=>o.jsxs("span",{children:[o.jsx(Ze,{}),p.errors[0]]},p.name))]}),o.jsxs(pe,{children:[o.jsx(te,{onClick:r,children:Z("Cancel")}),o.jsxs(te,{onClick:u,children:[o.jsx("span",{children:Z("Continue")}),o.jsx(ce,{})]})]})]})},Aa=({onClose:r,setCurrentStep:e})=>{const t=[G("Microsoft"),G("Google"),G("Other")];return o.jsxs("div",{children:[o.jsx(je,{children:o.jsxs(Se,{children:[G("SetupTwoFactorAuthentication"),o.jsxs(le,{children:[" ",G("SetupTwoFactorAuthenticationDesc")]})]})}),t.map(n=>o.jsx(pe,{onClick:()=>e(Me.CONNECT_AUTHENTICATOR),children:o.jsx(Re,{children:o.jsxs(te,{children:[o.jsx("span",{children:n}),o.jsx(ce,{})]})})},n)),o.jsx(pe,{children:o.jsx(te,{onClick:r,children:Z("Cancel")})})]})},Fa=m.div`
|
|
2405
|
+
`,Ia=document.getElementById("modal-root")||(()=>{const r=document.createElement("div");return r.id="modal-root",document.body.appendChild(r),r})();function wt({isOpen:r,onClose:e,children:t}){return x.useEffect(()=>{const n=i=>{i.key==="Escape"&&e()};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[e]),r?Pn.createPortal(o.jsx(Ta,{onClick:e,children:o.jsx($a,{onClick:n=>n.stopPropagation(),children:t})}),Ia):null}const Ma={1:"Enable2FaFirst",2:"ToViewOtpContactInfoDesc",3:"ToViewTotpContactInfoDesc",4:"ToViewBackupCodeContactInfoDesc"},nn=({isVisible:r,setVisible:e,code:t,mfaType:n,id:i,isBlocked:a,onBlockStateClose:s})=>{const{confirmContactInfo:l,confirmContactInfoBackup:d}=me(),{setUser:c}=Ee(),[u,p]=x.useState(""),[h,f]=x.useState([]),[g,v]=x.useState(!1);function L(S){p(S)}async function M(){const S=l;if(S)try{f([]);const z=await S(t,u,i);c(z.data.value),O()}catch(z){if(console.log(z),z.status===400){const U=z.response.data,Y=$e(U.errors);f(Y)}}}async function j(S){const z=d;if(z)try{f([]);const U=await z(S);c(U.data.value)}catch(U){if(console.log(U),U.status===400){const Y=U.response.data,B=$e(Y.errors);f(B)}}}function O(){p(""),e(!1),f([])}return a?o.jsx(wt,{isOpen:a,onClose:s,children:o.jsxs(ba,{children:[o.jsxs(wa,{children:[o.jsxs(Ca,{children:[o.jsx("span",{children:V("ContactInformationBlocked")}),o.jsx("span",{onClick:s,children:o.jsx(At,{})})]}),o.jsx(ja,{children:V("ContactInformationBlockedDesc")})]}),o.jsxs(Sa,{children:[V("TryAgain"),o.jsx(ce,{})]})]})}):o.jsx(wt,{isOpen:r,onClose:O,children:g?o.jsx(Bt,{setBackupActivated:v,backupCodeEndpoint:j,confirmationToken:t,id:i,setVisible:e}):o.jsxs(Qr,{children:[o.jsx("h2",{children:G("EnterVerificationCode")}),o.jsx("p",{children:n!==void 0?V(Ma[n]):""}),n!==1&&o.jsxs(o.Fragment,{children:[o.jsxs(va,{className:h.length>0?"verification-error":"",children:[o.jsx(T.Input.OTP,{value:u,onChange:L}),o.jsxs(ya,{children:[G("DidnReceiveCode")," ",o.jsx(en,{onClick:()=>v(!0),children:G("EnterBackupCode")})]}),h.map(S=>o.jsxs("span",{children:[o.jsx(Ze,{}),S.errors[0]]},S.name))]}),o.jsxs("button",{onClick:M,disabled:u.length!==6,children:[Z("ShowContactInformation"),o.jsx(ce,{})]})]})]})})},an=()=>{const{enableContactInfo:r,disableContactInfo:e}=me(),{setUser:t}=Ee(),[n,i]=x.useState(!1),[a,s]=x.useState(null),[l,d]=x.useState(!1),c=async()=>{var h,f,g,v,L,M,j;if(r)try{d(!1);const O=await r();s({token:(f=(h=O.data)==null?void 0:h.value)==null?void 0:f.token,id:(v=(g=O.data)==null?void 0:g.value)==null?void 0:v.id,mfaType:(M=(L=O.data)==null?void 0:L.value)==null?void 0:M.mfaType}),i(!0)}catch(O){const S=(j=O.response)==null?void 0:j.data,z=S==null?void 0:S.errors;(z&&Array.isArray(z[""])&&z[""][0]==="TooManyAttempts"||z[""][0]==="IsNotAllowed")&&d(!0)}};async function u(){if(!e)return;const h=await e();t(h.data.value)}const p=()=>{d(!1),i(!1)};return{isContactInfoModalVisible:n,setIsContactInfoModalVisible:i,isBlocked:l,setIsBlocked:d,onBlockStateClose:p,handleEnableContactInfo:c,handleDisableContactInfo:u,ContactInfoModalProps:{isVisible:n,setVisible:i,code:a==null?void 0:a.token,mfaType:a==null?void 0:a.mfaType,id:a==null?void 0:a.id,isBlocked:l,onBlockStateClose:p}}},Pa=({close:r})=>{var M;const{user:e}=Ee(),t=D(j=>j.columns),n=D(j=>j.groupByArr),i=D(j=>j.hideItems),a=D(j=>j.activeTableView),s=D(j=>j.setActiveTableView),l=D(j=>j.setGroupByArr),d=D(j=>j.setHideItems),c=D(j=>j.resetStore),{handleEnableContactInfo:u,handleDisableContactInfo:p,ContactInfoModalProps:h}=an();function f(j){const O=t.find(S=>S.dataIndex==j.value);l([O])}function g(j,O){d({...i,[j.dataIndex]:!!O})}function v(j,O){const S=new Date(j),z=new Date(O),U=Math.abs(z.getTime()-S.getTime()),Y=Math.floor(U/(1e3*60))%60,B=Math.floor(U/(1e3*60*60))%24,F=[];return B>0&&F.push(`${B}h`),Y>0&&F.push(`${Y}m`),F.join(" ")}function L(){c(),r()}return o.jsxs(ma,{children:[o.jsxs("header",{children:[o.jsx("span",{children:V("ViewOptions")}),o.jsx("button",{onClick:r,children:o.jsx(tr,{})})]}),o.jsxs("div",{className:"setting-sidebar-content",children:[o.jsxs("ul",{className:"table-view-list",children:[o.jsxs("li",{className:a==we.TABLE?"active":"",onClick:()=>s(we.TABLE),children:[o.jsx(rr,{}),o.jsx("span",{children:V("Table")})]}),o.jsxs("li",{className:a==we.LIST?"active":"",onClick:()=>s(we.LIST),children:[o.jsx(at,{}),o.jsx("span",{children:V("List")})]})]}),o.jsx("ul",{className:"grouping-list",children:o.jsxs("li",{children:[o.jsx("span",{children:V("Grouping")}),o.jsx(T.Select,{className:"teeest",showSearch:!0,options:t.map(j=>({value:j.dataIndex,label:j.title})),labelInValue:!0,placeholder:o.jsxs(xa,{children:[o.jsx(at,{}),V("NoGrouping")]}),value:((M=n[0])==null?void 0:M.dataIndex)||null,onChange:f})]})}),o.jsxs("div",{className:"properties-list",children:[o.jsx("span",{children:V("ShowProperties")}),o.jsx("ul",{children:t.map(j=>o.jsx("li",{className:i[j.dataIndex]===!0?"hide":"",onClick:()=>g(j,i[j.dataIndex]!==!0),children:j.title},j.dataIndex))})]})]}),o.jsxs("footer",{children:[e!=null&&e.sensitiveDataExpiration&&new Date(e==null?void 0:e.sensitiveDataExpiration)>new Date?o.jsxs("button",{onClick:p,children:[V("HideContactInfo")," •"," ",v(new Date(e==null?void 0:e.sensitiveDataExpiration),new Date),o.jsx(tr,{})]}):o.jsxs("button",{onClick:u,children:[Z("ShowContactInformation")," ",o.jsx(rr,{})]}),o.jsxs("button",{onClick:L,children:[Z("ResetAllOptions"),o.jsx(_r,{})]})]}),o.jsx(nn,{...h})]})},za=({columns:r,getData:e,update:t,hasCreateBtn:n,GridPageTopLeftComponent:i,contentAfterPageHeader:a,onRowClick:s,checkedValue:l,rowKey:d,pagination:c,CustomFilters:u,initialFilterValues:p,tableAdditionalFields:h,createIsModal:f,editButton:g,noPagination:v,noDataProps:L,exportButton:M,hasSelect:j,selectProps:O,TableComponent:S,tableProps:z={},noNeedSidebarResponsiveButton:U,loadedData:Y=()=>{}})=>{var Q,xe,ue;const{user:B}=Ee(),F=D(q=>q.filters),H=D(q=>q.filterItems),y=D(q=>q.sortItems),R=D(q=>q.hideItems),_=D(q=>q.activeTableView),E=D(q=>q.setColumns),k=D(q=>q.setHasCreateBtn),w=D(q=>q.setHasSelect),b=D(q=>q.setCheckedValue),{response:C,loading:I}=$t(()=>e({...F,...p}),[F,B,t]);Si(),x.useEffect(()=>{C!=null&&C.data&&Y(C.data)},[C,Y]);const[P,A]=x.useState(!1),W=x.useRef(null),K=Rr(W),J=x.useMemo(()=>r.filter(ve=>R[ve.dataIndex]!==!0),[r,R]);return x.useEffect(()=>{k(n||!1),w(j||!1)},[j]),x.useEffect(()=>{E(r)},[r]),x.useEffect(()=>{b(l)},[l]),o.jsxs(Li,{children:[o.jsxs(Oi,{ref:W,children:[o.jsx(Fi,{noNeedSidebarResponsiveButton:U,hasSelect:j,selectProps:O,exportButton:M,setisSettingPopupVisible:A,CustomFilters:u,tableAdditionalFields:h,createIsModal:f,GridPageTopLeftComponent:i}),a,(H.length>0||y.length>0)&&o.jsx(Zi,{})]}),o.jsx(zi,{height:`calc(100vh - ${`${K}px`})`,children:S?o.jsx(S,{dataSource:((Q=C==null?void 0:C.data)==null?void 0:Q.items)||[],...z,rowKey:d||"id",columns:[{title:"",dataIndex:""},...J],loading:I,pagination:{current:F.Page,pageSize:F.PageSize,items:c==null?void 0:c.items}}):o.jsx(ga,{noPagination:v,editButton:g,createIsModal:f,rowKey:d||"id",columns:[{title:"",dataIndex:""},...J],dataSource:((xe=C==null?void 0:C.data)==null?void 0:xe.items)||[],loading:I,pagination:{current:F.Page,pageSize:F.PageSize,items:c==null?void 0:c.items},activeTableView:_,totalItemCount:((ue=C==null?void 0:C.data)==null?void 0:ue.totalItemCount)||0,onRowClick:s,noDataProps:L||null})}),P&&o.jsx(Pa,{close:()=>A(!1)})]})},Ha=r=>o.jsx(ji,{children:o.jsx(za,{...r})}),Ra=()=>{const r=Le(v=>v.isOpen),e=Le(v=>v.options),t=Le(v=>v.close),n=re.useLocation();if(x.useEffect(()=>{r&&t()},[n.pathname]),!e||!r)return null;const{title:i,component:a,componentProps:s,popupOptions:l,footerOptions:d,hideFooter:c,showCloseButton:u,onOk:p,onCancel:h}=e,f=()=>{h==null||h()},g=()=>{p==null||p()};return o.jsxs(dt,{centered:!0,title:i||u?o.jsxs(Ur,{children:[o.jsx("span",{children:i}),u&&o.jsx(Gr,{onClick:t,children:o.jsx(At,{})})]}):void 0,...l,children:[a&&o.jsx(a,{...s}),!c&&o.jsxs(Re,{children:[o.jsx(te,{onClick:f,children:d==null?void 0:d.cancelText}),o.jsx(Wr,{onClick:g,role:"button",tabIndex:0,onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&g()},children:d==null?void 0:d.okText})]})]})},on=({displayAddRuleModal:r,onClose:e,title:t,hideFooter:n=!1,children:i})=>o.jsx(dt,{open:r,onCancel:e,closeIcon:!1,title:t,footer:n?null:void 0,destroyOnClose:!0,centered:!0,children:i}),nr=({onClose:r,setCurrentStep:e,setConfirmationToken:t,enableTwoFactorService:n,setRefetch:i,setIdOf2FA:a})=>{async function s(){var d,c,u,p;const l=n;if(l)try{const h=await l();(c=(d=h.data)==null?void 0:d.value)!=null&&c.isTwoFactorRequired?(t(h.data.value.token),a(h.data.value.id),e(Me.VERIFY_EMAIL_CODE)):((u=h==null?void 0:h.data)!=null&&u.success&&!((p=h==null?void 0:h.data)!=null&&p.value)&&i(f=>!f),r())}catch(h){console.error("Failed to toggle 2FA:",h)}}return o.jsxs("div",{children:[o.jsx(je,{children:o.jsxs(Se,{children:[G("SetupTwoFactorAuthentication"),o.jsx(le,{children:G("SetupTwoFactorAuthenticationDesc")})]})}),o.jsx(pe,{onClick:s,children:o.jsx(Re,{children:o.jsxs(te,{children:[o.jsx("span",{children:V("Email")}),o.jsx(ce,{})]})})}),o.jsx(pe,{onClick:()=>e(Me.SELECT_AUTHENTICATOR_APP),children:o.jsx(Re,{children:o.jsxs(te,{children:[o.jsx("span",{children:G("AuthenticatorApp")}),o.jsx(ce,{})]})})}),o.jsx(pe,{children:o.jsx(te,{onClick:r,children:Z("Cancel")})})]})},Na=({onClose:r,setCurrentStep:e,setBackupCodes:t,setRefetch:n})=>{const{verifyMFA:i}=me(),[a,s]=x.useState(""),[l,d]=x.useState([]);function c(p){s(p)}async function u(){var h;const p=i;if(p)try{const f=await p(a);(h=f.data)!=null&&h.success&&(e(Me.BACKUP_CODES),t(f.data.value.recoveryCodes))}catch(f){console.log(f)}finally{n(f=>f+1)}}return o.jsxs("div",{children:[o.jsxs(Se,{children:[G("EnterVerificationCode"),o.jsx(le,{children:G("YouMaySeeVerificationCode")})]}),o.jsxs(rn,{children:[o.jsx(T.Input.OTP,{value:a,onChange:c}),l.map(p=>o.jsxs("span",{children:[o.jsx(Ze,{}),p.errors[0]]},p.name))]}),o.jsxs(pe,{children:[o.jsx(te,{onClick:r,children:Z("Cancel")}),o.jsxs(te,{onClick:u,children:[o.jsx("span",{children:Z("Continue")}),o.jsx(ce,{})]})]})]})},Aa=({onClose:r,setCurrentStep:e})=>{const t=[G("Microsoft"),G("Google"),G("Other")];return o.jsxs("div",{children:[o.jsx(je,{children:o.jsxs(Se,{children:[G("SetupTwoFactorAuthentication"),o.jsxs(le,{children:[" ",G("SetupTwoFactorAuthenticationDesc")]})]})}),t.map(n=>o.jsx(pe,{onClick:()=>e(Me.CONNECT_AUTHENTICATOR),children:o.jsx(Re,{children:o.jsxs(te,{children:[o.jsx("span",{children:n}),o.jsx(ce,{})]})})},n)),o.jsx(pe,{children:o.jsx(te,{onClick:r,children:Z("Cancel")})})]})},Fa=m.div`
|
|
2406
2406
|
display: flex;
|
|
2407
2407
|
justify-content: center;
|
|
2408
2408
|
`,Va=m.div`
|
|
@@ -2495,7 +2495,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
2495
2495
|
`,So=function(e){var t=x.useContext(sn),n=t.csp,i=t.prefixCls,a=t.layer,s=jo;i&&(s=s.replace(/anticon/g,i)),a&&(s="@layer ".concat(a,` {
|
|
2496
2496
|
`).concat(s,`
|
|
2497
2497
|
}`)),x.useEffect(function(){var l=e.current,d=go(l);fo(s,"@ant-design-icons",{prepend:!a,csp:n,attachTo:d})},[])},ko=["icon","className","onClick","style","primaryColor","secondaryColor"],Ge={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function Lo(r){var e=r.primaryColor,t=r.secondaryColor;Ge.primaryColor=e,Ge.secondaryColor=t||xn(e),Ge.calculated=!!t}function Eo(){return he({},Ge)}var Ae=function(e){var t=e.icon,n=e.className,i=e.onClick,a=e.style,s=e.primaryColor,l=e.secondaryColor,d=cn(e,ko),c=$.useRef(),u=Ge;if(s&&(u={primaryColor:s,secondaryColor:l||xn(s)}),So(c),Co(hr(t),"icon should be icon definiton, but got ".concat(t)),!hr(t))return null;var p=t;return p&&typeof p.icon=="function"&&(p=he(he({},p),{},{icon:p.icon(u.primaryColor,u.secondaryColor)})),kt(p.icon,"svg-".concat(p.name),he(he({className:n,onClick:i,style:a,"data-icon":p.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},d),{},{ref:c}))};Ae.displayName="IconReact";Ae.getTwoToneColors=Eo;Ae.setTwoToneColors=Lo;function yn(r){var e=vn(r),t=ln(e,2),n=t[0],i=t[1];return Ae.setTwoToneColors({primaryColor:n,secondaryColor:i})}function Oo(){var r=Ae.getTwoToneColors();return r.calculated?[r.primaryColor,r.secondaryColor]:r.primaryColor}var Do=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];yn(Ct.primary);var Je=$.forwardRef(function(r,e){var t=r.className,n=r.icon,i=r.spin,a=r.rotate,s=r.tabIndex,l=r.onClick,d=r.twoToneColor,c=cn(r,Do),u=$.useContext(sn),p=u.prefixCls,h=p===void 0?"anticon":p,f=u.rootClassName,g=eo(f,h,ie(ie({},"".concat(h,"-").concat(n.name),!!n.name),"".concat(h,"-spin"),!!i||n.name==="loading"),t),v=s;v===void 0&&l&&(v=-1);var L=a?{msTransform:"rotate(".concat(a,"deg)"),transform:"rotate(".concat(a,"deg)")}:void 0,M=vn(d),j=ln(M,2),O=j[0],S=j[1];return $.createElement("span",Ke({role:"img","aria-label":n.name},c,{ref:e,tabIndex:v,onClick:l,className:g}),$.createElement(Ae,{icon:n,primaryColor:O,secondaryColor:S,style:L}))});Je.displayName="AntdIcon";Je.getTwoToneColor=Oo;Je.setTwoToneColor=yn;var To={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"}}]},name:"copy",theme:"outlined"},$o=function(e,t){return $.createElement(Je,Ke({},e,{ref:t,icon:To}))},bn=$.forwardRef($o);process.env.NODE_ENV!=="production"&&(bn.displayName="CopyOutlined");var Io={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"download",theme:"outlined"},Mo=function(e,t){return $.createElement(Je,Ke({},e,{ref:t,icon:Io}))},wn=$.forwardRef(Mo);process.env.NODE_ENV!=="production"&&(wn.displayName="DownloadOutlined");const Po=({onClose:r,setCurrentStep:e})=>{const{initiateMFA:t}=me(),[n,i]=x.useState(null);async function a(){if(t)try{const s=await t();i(s.data.value)}catch(s){console.log(s)}}return x.useEffect(()=>{a()},[]),o.jsx("div",{children:n?o.jsxs(o.Fragment,{children:[o.jsx(je,{children:o.jsx(Se,{children:G("EnterAuthenticationCode")})}),o.jsx(Fa,{children:o.jsx("img",{src:`data:image/png;base64,${n.qrCodeImage}`})}),o.jsx("br",{}),o.jsxs(_a,{children:[o.jsxs(le,{children:[" ",G("CopyCodeManually")]}),o.jsxs(Va,{onClick:()=>Kr(n.totpSecret),children:[o.jsx(pt,{value:n.totpSecret,disabled:!0}),o.jsx(Ba,{children:o.jsx(bn,{})})]})]}),o.jsx(Re,{children:o.jsxs(Ua,{children:[o.jsx(te,{onClick:r,children:Z("Cancel")}),o.jsxs(te,{onClick:()=>e(Me.VERIFY_AUTHENTICATOR_CODE),children:[o.jsx("span",{children:Z("Continue")}),o.jsx(ce,{})]})]})})]}):o.jsx(Vt,{children:o.jsx(T.Spin,{})})})},zo=({onClose:r,setRefetch:e})=>{const{disableMFA:t}=me(),[n,i]=x.useState("");function a(l){i(l.target.value)}async function s(){if(t)try{await t(n),r()}catch(l){console.log(l,"err")}finally{e(l=>l+1)}}return o.jsxs("div",{children:[o.jsx(je,{children:o.jsxs(Se,{children:[G("DisableTwoFactor"),o.jsx(le,{children:G("DisableTwoFactorDesc")})]})}),o.jsxs(Ea,{children:[o.jsx(le,{children:V("Password")}),o.jsx(Da,{value:n,onChange:a,placeholder:V("EnterPassword")})]}),o.jsxs(pe,{children:[o.jsx(te,{onClick:r,children:Z("Cancel")}),o.jsxs(Ne,{onClick:s,children:[o.jsx("span",{children:Z("Continue")}),o.jsx(ce,{})]})]})]})},Ho=({onClose:r,confirmationToken:e,setRefetch:t,idOf2FA:n})=>{const{confirmTwoFactor:i}=me(),[a,s]=x.useState(""),[l,d]=x.useState([]);function c(p){s(p)}async function u(){if(i)try{(await i({confirmationToken:e,code:a,id:n})).data.success&&r()}catch(p){console.log(p)}finally{t(p=>p+1)}}return o.jsx("div",{children:e?o.jsxs(o.Fragment,{children:[o.jsxs(Se,{children:[o.jsx("div",{children:G("EnterVerificationCode")}),o.jsx(le,{children:G("BackupCodesDesc")})]}),o.jsxs(rn,{children:[o.jsx(T.Input.OTP,{value:a,onChange:c}),l.map(p=>o.jsxs("span",{children:[o.jsx(Ze,{}),p.errors[0]]},p.name))]}),o.jsxs(pe,{children:[o.jsx(te,{onClick:r,children:Z("Cancel")}),o.jsxs(te,{onClick:u,disabled:(a==null?void 0:a.length)!=6,children:[o.jsx("span",{children:Z("Continue")}),o.jsx(ce,{})]})]})]}):o.jsx(Vt,{children:o.jsx(T.Spin,{})})})},Ro=({onClose:r,backupCodes:e})=>{const t=()=>{const n=e.join(`
|
|
2498
|
-
`),i=new Blob([n],{type:"text/plain;charset=utf-8"}),a=URL.createObjectURL(i),s=document.createElement("a");s.href=a,s.download="backup-codes.txt",s.click(),URL.revokeObjectURL(a)};return o.jsxs("div",{children:[o.jsx(je,{children:o.jsxs(Se,{children:[G("EnterVerificationCode"),o.jsx(le,{children:G("BackupCodesDesc")})]})}),o.jsx(Oa,{children:o.jsx(T.Button,{type:"primary",icon:o.jsx(wn,{}),onClick:t,children:G("DownloadBackupCodes")})}),o.jsx(pe,{children:o.jsx(te,{onClick:r,children:Z("Cancel")})})]})};var Me=(r=>(r[r.SELECT_MFA_OPTION=0]="SELECT_MFA_OPTION",r[r.SELECT_AUTHENTICATOR_APP=1]="SELECT_AUTHENTICATOR_APP",r[r.CONNECT_AUTHENTICATOR=2]="CONNECT_AUTHENTICATOR",r[r.VERIFY_AUTHENTICATOR_CODE=3]="VERIFY_AUTHENTICATOR_CODE",r[r.VERIFY_EMAIL_CODE=4]="VERIFY_EMAIL_CODE",r[r.DISABLE_AUTHENTICATOR=5]="DISABLE_AUTHENTICATOR",r[r.BACKUP_CODES=6]="BACKUP_CODES",r[r.ENTER_BACKUP_CODE=7]="ENTER_BACKUP_CODE",r))(Me||{});const No=({isOpen:r,setIsOpen:e,modal:t=0,setRefetch:n,
|
|
2498
|
+
`),i=new Blob([n],{type:"text/plain;charset=utf-8"}),a=URL.createObjectURL(i),s=document.createElement("a");s.href=a,s.download="backup-codes.txt",s.click(),URL.revokeObjectURL(a)};return o.jsxs("div",{children:[o.jsx(je,{children:o.jsxs(Se,{children:[G("EnterVerificationCode"),o.jsx(le,{children:G("BackupCodesDesc")})]})}),o.jsx(Oa,{children:o.jsx(T.Button,{type:"primary",icon:o.jsx(wn,{}),onClick:t,children:G("DownloadBackupCodes")})}),o.jsx(pe,{children:o.jsx(te,{onClick:r,children:Z("Cancel")})})]})};var Me=(r=>(r[r.SELECT_MFA_OPTION=0]="SELECT_MFA_OPTION",r[r.SELECT_AUTHENTICATOR_APP=1]="SELECT_AUTHENTICATOR_APP",r[r.CONNECT_AUTHENTICATOR=2]="CONNECT_AUTHENTICATOR",r[r.VERIFY_AUTHENTICATOR_CODE=3]="VERIFY_AUTHENTICATOR_CODE",r[r.VERIFY_EMAIL_CODE=4]="VERIFY_EMAIL_CODE",r[r.DISABLE_AUTHENTICATOR=5]="DISABLE_AUTHENTICATOR",r[r.BACKUP_CODES=6]="BACKUP_CODES",r[r.ENTER_BACKUP_CODE=7]="ENTER_BACKUP_CODE",r))(Me||{});const No=({isOpen:r,setIsOpen:e,modal:t=0,setRefetch:n,enableTwoFactorService:i})=>{const[a,s]=x.useState(t),[l,d]=x.useState(""),[c,u]=x.useState(),[p,h]=x.useState("");function f(){e(!1)}const g=x.useMemo(()=>{switch(a){case 0:return nr;case 1:return Aa;case 2:return Po;case 3:return Na;case 4:return Ho;case 5:return zo;case 6:return Ro;default:return nr}},[a]),v=x.useMemo(()=>{switch(a){case 0:return{onClose:f,setCurrentStep:s,setConfirmationToken:d,setRefetch:n,setIdOf2FA:u,enableTwoFactorService:i};case 1:return{onClose:f,setCurrentStep:s};case 2:return{onClose:f,setCurrentStep:s};case 3:return{onClose:f,setCurrentStep:s,setBackupCodes:h,setRefetch:n};case 4:return{onClose:f,setCurrentStep:s,confirmationToken:l,setRefetch:n,idOf2FA:c};case 5:return{onClose:f,setRefetch:n};case 6:return{onClose:f,backupCodes:p};case 7:return{onClose:f,confirmationToken:l,setRefetch:n,idOf2FA:c};default:return{onClose:f}}},[a,l,p]);return o.jsx(on,{displayAddRuleModal:r,onClose:f,hideFooter:!0,children:o.jsx(g,{...v})})},Ao=m.div`
|
|
2499
2499
|
height: var(--size-800, 4rem);
|
|
2500
2500
|
display: flex;
|
|
2501
2501
|
justify-content: space-between;
|