PageSourceSearch

https://app.emovid.com/static/js/async/tn.583196757b.js

js emovid.com collected 2026-09-25 19:58:28 UTC 61,525 bytes, 1 lines download raw bytes

1"use strict";(self.rspackChunkemovid_ui=self.rspackChunkemovid_ui||[]).push([["tn"],{tc8(e,t,s){s.d(t,{cq:()=>n,nJ:()=>i,pi:()=>l}),s("dA");var a=s("x");let l=async e=>{let t=e;if(!e.startsWith("blob:")&&!e.startsWith("data:"))try{let s=await fetch(e,{mode:"cors"});if(s.ok){let e=await s.blob();t=URL.createObjectURL(e)}}catch(s){t=e}return new Promise((s,a)=>{let l=new Image;l.onload=()=>{t!==e&&URL.revokeObjectURL(t),s(l)},l.onerror=s=>{t!==e&&URL.revokeObjectURL(t),a(s)},t.startsWith("blob:")||t.startsWith("data:")||l.setAttribute("crossOrigin","anonymous"),l.src=t})};async function i(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{horizontal:!1,vertical:!1},n=await l(e),r=document.createElement("canvas"),o=r.getContext("2d");if(!o)throw Error("Canvas not supported! Please use a modern browser");let c=n.naturalHeight/300,d=t.x*c,m=t.y*c,u=t.width*c,p=t.height*c,h=Math.min(1,2048/Math.max(u,p,1)),x=Math.round(u*h),f=Math.round(p*h);r.width=x,r.height=f;let j=s*Math.PI/180;return o.translate(x/2,f/2),o.rotate(j),o.scale(i.horizontal?-1:1,i.vertical?-1:1),o.translate(-x/2,-f/2),o.drawImage(n,d,m,u,p,0,0,x,f),new Promise((t,s)=>{r.toBlob(l=>{if(!l){try{let s=r.toDataURL("image/jpeg",1);t(function(e,t){let s=e.split(","),a=s[0].match(/:(.*?);/)[1],l=atob(s[1]),i=l.length,n=new Uint8Array(i);for(;i--;)n[i]=l.charCodeAt(i);return new File([n],t,{type:a})}(s,e))}catch(e){(0,a.vVN)("Canvas toBlob and toDataURL both failed",2),s(Error("canvas.toBlob returned null — canvas may be tainted or empty on this device"))}return}t(new File([l],e,{type:"image/jpeg"}))},"image/jpeg",1)})}function n(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"image/png",l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.95;return new Promise((i,n)=>{let r="image/jpeg"===s?null!=l?l:.95:void 0;e.toBlob(e=>{e?(e.name=t,i(new File([e],t,{type:s}))):((0,a.vVN)("Canvas is empty",2),n("Canvas is empty"))},s,r)})}},dA(e,t,s){var a=s("X"),l=s("u"),i=s("i9"),n=s("tc8"),r=s("Vi");t.A=e=>{let t=(0,l.useRef)(null),[s,o]=(0,l.useState)(e.crop),c=async t=>{if(e.onCropComplete)try{let s=await (0,n.nJ)(e.imageSrc,t,1);e.onCropComplete(s)}catch(e){var s;console.error("getCroppedImg failed:",e),r.A.userError(e instanceof Error?e.message:"Failed to crop image: ".concat(null!=(s=JSON.stringify(e))?s:String(e)))}};return(0,a.jsx)(a.Fragment,{children:!!e.imageSrc&&(0,a.jsx)(i.Ay,{crop:s,onChange:(t,s)=>{var a;o(t),null==(a=e.onCropChange)||a.call(e,t)},onComplete:e=>c(e),aspect:e.aspect,minHeight:60,keepSelection:!0,circularCrop:e.circularCrop,children:(0,a.jsx)("img",{ref:t,alt:"Cropped",src:e.imageSrc,style:{height:"".concat(300,"px")},onLoad:t=>{if(e.aspect){var s;let{width:a,height:l}=t.currentTarget,n=(s=e.aspect,(0,i.ge)((0,i.dS)({unit:"px",width:120},s,a,l),a,l));o(n),c(n)}}})})})}},zQb(e,t,s){var a=s("P"),l=s("qz"),i=s("X"),n=s("u"),r=s("mR"),o=s("gd"),c=s("TG"),d=s("MA"),m=s("x"),u=s("Vi");s("dA");let p={flex:1,display:"flex",alignItems:"center",padding:"20px",borderWidth:2,borderRadius:2,borderColor:"#eeeeee",borderStyle:"dashed",outline:"none",height:"".concat(300,"px"),transition:"border .24s ease-in-out",cursor:"pointer","&:hover":{borderColor:"#2196f3"}},h={top:"-21px",right:"-30px"},x={borderColor:"#2196f3"},f={borderColor:"#00e676"},j={borderColor:"#ff1744"},y={maxWidth:"200px",maxHeight:"200px"},b=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return"This file type is not supported. Please use a .jpg, .jpeg, .png or .bmp for images".concat(e?", or use .mp4 for videos.":".")};t.A=e=>{let[t,s]=(0,n.useState)(e.selectedFile),[v,g]=(0,n.useState)(()=>e.selectedFile?URL.createObjectURL(e.selectedFile):void 0),[N,A]=(0,n.use
1State)(e.url);(0,n.useEffect)(()=>{e.selectedFile&&F(e.selectedFile)},[e.selectedFile]),(0,n.useEffect)(()=>()=>{v&&URL.revokeObjectURL(v)},[v]);let w=(0,n.useCallback)(t=>{0===t.length?u.A.userError(b(e.allowVideo)):["image/jpg","image/jpeg","image/png","image/bmp",e.allowVideo?"video/mp4":""].includes(t[0].type)?F(t[0]):u.A.userError(b(e.allowVideo))},[]),_=t=>{t.stopPropagation(),e.isUploadingImage||(s(void 0),g(void 0),A(void 0),e.onSelectFile())},{getRootProps:S,getInputProps:C,isDragActive:k,isDragAccept:E,isDragReject:I}=(0,r.VB)({accept:e.allowVideo?{"image/*":[".jpg",".jpeg",".png",".bmp"],"video/*":[".mp4"]}:{"image/*":[".jpg",".jpeg",".png",".bmp"]},onDrop:w}),P=(0,n.useMemo)(()=>(0,a._)({},p,e.customStyles,k?x:{},E?f:{},I?j:{}),[k,I,E]),F=t=>{(0,m.cz2)(t,null==e?void 0:e.maxFileSizeInMB)&&(s(t),g(URL.createObjectURL(t)),e.onSelectFile(t))};return N||e.url?(0,i.jsx)("div",(0,l._)((0,a._)({className:"p-4"},S({style:P})),{children:(0,i.jsxs)("div",{className:"text-center w-100 d-flex justify-content-center align-items-center position-relative",children:[(0,i.jsx)("p",{className:"mb-0 px-4",children:(0,i.jsx)("img",{style:y,src:N||e.url,alt:"Preview"})}),(0,i.jsx)(d.A,{className:"close-icon",onClick:e=>_(e),style:h,children:(0,i.jsx)(c.A,{"data-testid":"CloseIcon",sx:{fontSize:30}})})]})})):(0,i.jsxs)(i.Fragment,{children:[(!t||e.no_preview)&&(0,i.jsxs)("div",(0,l._)((0,a._)({className:"file-drop-container p-4"},S({style:P})),{children:[(0,i.jsx)("input",(0,l._)((0,a._)({},C()),{style:{opacity:0,position:"absolute",top:"-100%"}})),(0,i.jsxs)("div",{className:"text-center w-100",children:[(0,i.jsx)(d.A,{className:"text-white",children:(0,i.jsx)(o.A,{"data-testid":"CloudUploadIcon",sx:{fontSize:30}})}),(0,i.jsxs)("p",{children:["Drag & drop file here or ",(0,i.jsx)("span",{className:"active-text",children:"click"})," to select"]})]})]})),e.customMessage&&(0,i.jsx)("div",{className:"text-white text-small pt-2",children:e.customMessage}),t&&!e.no_preview&&(0,i.jsxs)("div",(0,l._)((0,a._)({className:"p-4 position-relative"},S({style:P})),{children:[(0,i.jsx)("div",{className:"text-center w-100 d-flex justify-content-center align-items-center position-relative",children:(0,i.jsx)("p",{className:"mb-0 px-4",children:(0,i.jsx)("img",{style:y,src:v,alt:"Preview"})})}),(0,i.jsx)(d.A,{disabled:e.isUploadingImage,className:["position-absolute text-white",e.isUploadingImage?"disabled":""].join(" "),onClick:_,style:{right:0,top:0},children:(0,i.jsx)(c.A,{"data-testid":"CloseIcon",sx:{fontSize:30}})})]}))]})}},zS(e,t,s){s.r(t),s.d(t,{MyAccountTab:()=>eJ,default:()=>e$});
1var a,l=s("X"),i=s("S5"),n=s("rN"),r=s("ge"),o=s("hV"),c=s("qM"),d=s("llN"),m=s("u"),u=s("lw"),p=s("cJ"),h=s("ne"),x=s("yh"),f=s("jS"),j=s("in"),y=s("x"),b=s("cF"),v=s("Vi"),g=s("s5"),N=s("d5"),A=()=>{let[e,t]=(0,m.useState)(""),s=async()=>{try{t("Fetching ...");let e=await (0,y.gfx)((0,y.hQ)()?void 0:window.location.href);(0,y.hQ)()?await g.P.open({url:e.url}):window.location.href=e.url}catch(e){v.A.alertableError(e.message||"Unable to fetch details",e)}finally{t("")}};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"user-preferences col-sm-9 col-xs-12",children:[(0,l.jsx)("h5",{className:"text-white text-center",children:"Plan & Billing Details"}),(0,l.jsx)("div",{className:"row m-auto",children:(0,l.jsx)("div",{className:"d-flex justify-content-center mt-5",children:(0,l.jsx)("button",{className:"btn btn-primary m-2",onClick:s,children:"Subscription Details"})})})]}),(0,l.jsx)(N.A,{open:!!e,loadingMessage:e})]})},w=s("hM"),_=s("S1"),S=s("db");let C={linkedin:{displayName:"LinkedIn",icon:"/icons/linkedin.svg",connectUrl:"/v1/social/post/accounts/linkedin/connect"}};var k=()=>{var e;let t=(0,w.jE)(),[s,a]=(0,m.useState)(!1),{data:i,isLoading:n}=(0,f.I)({queryKey:["socialPostingAccounts"],refetchOnWindowFocus:!1,retry:!1,queryFn:()=>(0,y.KXo)()});if(n)return(0,l.jsx)("div",{className:"account-info col-sm-9 col-xs-12 d-flex justify-content-center mt-5",children:(0,l.jsx)(_.A,{})});let r=new Set((null!=(e=null==i?void 0:i.accounts)?e:[]).filter(e=>"connected"===e.connection_status).map(e=>e.platform)),o=async e=>{try{let t=await S.Ay.postFormData("/v1/social/post/generate/url",{platform:e}),s=null==t?void 0:t.url;if(!s)throw Error("No URL returned from server");window.location.href=s}catch(e){v.A.alertableError("Failed to generate authentication URL. Please try again later.")}},c=async e=>{try{var s;a(!0);let l=null==i||null==(s=i.accounts)?void 0:s.find(t=>t.platform===e&&"connected"===t.connection_status);if(!l)return;await S.Ay.delete("/v1/social/post/account/".concat(l.id)),t.invalidateQueries({queryKey:["socialPostingAccounts"]})}catch(e){v.A.alertableError("Failed to disconnect the account. Please try again later.")}finally{a(!1)}};return(0,l.jsxs)("div",{className:"account-info col-sm-9 col-xs-12",children:[(0,l.jsx)("h5",{className:"text-white text-center",children:"Social Posting Accounts"}),(0,l.jsx)("p",{className:"text-center mt-3 mb-4 social-accounts__subtitle",children:"Connect your social accounts to post directly from Emovid."}),(0,l.jsx)("div",{className:"col-md-7 col-sm-12 m-auto social-accounts",children:Object.entries(C).map(e=>{let[t,a]=e,i=r.has(t);return(0,l.jsxs)("div",{className:"social-accounts__card",children:[(0,l.jsx)("img",{src:a.icon,alt:a.displayName}),(0,l.jsx)("div",{className:"social-accounts__info",children:(0,l.jsx)("div",{className:"social-accounts__info__name",children:a.displayName})}),i?(0,l.jsx)("button",{type:"button",className:"btn social-accounts__disconnect-btn",onClick:()=>c(t),disabled:s,children:"Disconnect"}):(0,l.jsx)("button",{onClick:()=>o(t),className:"btn btn-primary social-accounts__connect-btn",children:"Connect"})]},t)})})]})},E=s("ry"),I=s("yN"),P=s("P"),F=s("qz"),O=s("tA"),R=s("GL"),D=s("oj"),U=s("WmM"),T=s("GC"),L=s("Xj"),M=s("FN"),z=s("dyd"),V=s("xX"),W=s("PJ"),H=s("L4"),G=s("ur"),q=s("MA"),B=s("cnm"),J=s("bG"),Y=s("Le"),$=s("Cuo"),Q=s("Ha"),X=s("S0"),K=s("G"),Z=s("rY"),ee=s("zSP"),et=s("HZ"),es=s("TG"),ea=s("mOO");let el={Table:e=>(0,l.jsx)(R.A,(0,F._)((0,P._)({},e),{sx:{borderCollapse:"separate",tableLayout:"fixed"}})),TableHead:e=>{let{ref:t}=e,s=(0,O._)(e,["ref"]);return(0,l.jsx)(D.A,(0,F._)((0,P._)({},s),{ref:t}))},TableRow:U.A,TableBody:e=>{let{ref:t}=e,s=(0,O._)(e,["ref"]);return(0,l.jsx)(T.A,(0,F._)((0,P._)({},s),{ref:t}))}};var ei=()=>{let e=(0,I.A)(),t=(0,m.useRef)(null),[s,a]=(0,m.useState)(!1),[i,n]=(0,m.useState)(!1),[r,o]=(0,m.useState)(""),[c,d]=(0,m.useState)(""),[u,p]=(0,m.useState)(K.Role.USER),[h,f]=(0,m.useState)(!1),[j,b]=(0,m.useState)(!1),[g,N]=(0,m.useState)([]);(0,m.useEffect)(()=>{A()},[]);let A=async()=>{try{a(!0);let e=await (0,y.GJM)();
1e.forEach(e=>{e.bgColor=(0,y.IH5)()}),e.sort((e,t)=>(e.name||e.email).localeCompare(t.name||e.email)),N(e)}catch(e){v.A.userError("Failed to load users. Please try again.")}finally{a(!1)}},w=async(e,t)=>{try{b(!0),e.id&&await (0,y.v_$)(e.id,t),N(s=>s.map(s=>s.id===e.id?(0,F._)((0,P._)({},s),{role:t}):s)),v.A.success("User role updated.")}catch(e){v.A.userError("Failed to update user role. Please try again.")}finally{b(!1)}},S=async()=>{try{n(!0);let e=(0,y.j8h)(r);await (0,y.xqh)(e.join(","),u),v.A.success("Invite sent."),f(!1),A()}catch(e){v.A.userError("Failed to invite users. Please try again.")}finally{n(!1)}},C=e=>e.role===K.Role.SUPER_ADMIN||e.role===K.Role.ADMIN?(0,l.jsx)(G.A,{title:"Site-level role — managed from the admin console",children:(0,l.jsx)("div",{className:"p-2 text-nowrap",children:e.role===K.Role.SUPER_ADMIN?"Site Super Admin":"Site Admin"})}):(0,l.jsx)(M.A,{variant:"standard",style:{maxWidth:"200px"},children:(0,l.jsxs)(z.A,{className:"text-light",value:e.role,disabled:j,onChange:t=>w(e,t.target.value),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"}},children:[(0,l.jsx)(V.A,{value:K.Role.COMPANY_SUPER_ADMIN,children:"Super Admin"}),(0,l.jsx)(V.A,{value:K.Role.COMPANY_ADMIN,children:"Admin"}),(0,l.jsx)(V.A,{value:K.Role.USER,children:"User"})]})});return(0,l.jsxs)("div",{className:"user-preferences col-sm-9 col-xs-12",children:[(0,l.jsxs)("div",{className:"position-relative",children:[(0,l.jsx)("h4",{className:"text-white text-center",children:"Company Admin Panel"}),(0,l.jsx)(E.X,{children:(0,l.jsx)("div",{className:"d-none position-absolute",style:{right:0,top:"-6px"},children:(0,l.jsx)("button",{className:"btn btn-outline-secondary",onClick:()=>f(!0),children:"Invite Members"})})})]}),(0,l.jsxs)("div",{className:"card p-3 mt-4 text-white",style:{backgroundColor:"#777"},children:[(0,l.jsxs)("div",{className:"position-relative",children:[(0,l.jsx)("h5",{className:"text-center",children:"Member Summary"}),(0,l.jsx)(E.f,{children:(0,l.jsx)("div",{className:"d-none position-absolute",style:{right:0,top:"-6px"},children:(0,l.jsx)(q.A,{onClick:()=>f(!0),children:(0,l.jsx)(et.A,{"data-testid":"AddCircleRoundedIcon"})})})})]}),(0,l.jsxs)("div",{className:"row",children:[(0,l.jsxs)("div",{className:"col-md-4 col-sm-12 text-center fw-bold",children:[(0,l.jsx)("div",{children:(0,l.jsxs)("span",{className:"position-relative",children:["Super Admins ",(0,l.jsx)(G.A,{placement:"top",title:"Super Admins have unrestricted access to all Emovid features, including full control over uploads, folder organization, and content moderation within the Company Library. They can view and manage videos across all folders and subfolders, and the admin panel is accessible only to Super Admins.",enterTouchDelay:0,children:(0,l.jsx)(Z.A,{"data-testid":"InfoOutlinedIcon",className:"position-absolute",sx:{fontSize:"20px",right:"-15px",top:"-10px"}})})]})}),(0,l.jsx)("div",{children:g.filter(e=>e.role===K.Role.COMPANY_SUPER_ADMIN).length})]}),(0,l.jsxs)("div",{className:"col-md-4 col-sm-12 text-center fw-bold",children:[(0,l.jsx)("div",{children:(0,l.jsxs)("span",{className:"position-relative",children:["Admins ",(0,l.jsx)(G.A,{placement:"top",title:"In addition to full access to Emovid functionality, Admins can manage uploads, subfolders, and moderation within their assigned folders in the Company Library. Any uploads to folders beyond their assigned scope require approval from a Super Admin or another designated admin.",enterTouchDelay:0,children:(0,l.jsx)(Z.A,{"data-testid":"InfoOutlinedIcon",className:"position-absolute",sx:{fontSize:"20px",right:"-15px",top:"-10px"}})})]})}),(0,l.jsx)("div",{children:g.filter(e=>e.role===K.Role.COMPANY_ADMIN).length})]}),(0,l.jsxs)("div",{className:"col-md-4 col-sm-12 text-center fw-bold",children:[(0,l.jsx)("div",{children:(0,l.jsxs)("span",{className:"position-relative",children:["Users ",(0,l.jsx)(G.A,{placement:"top",title:"Users have full access to all Emovid features and can submit content to the Company Library, which becomes visible after approval by an assigned admin or Super Admin.",enterTouchDelay:0,children:(0,l.jsx)(Z.A,{"data-testid":"InfoOutlinedIcon",className:"position-absolute",sx:{fontSize:"20px",right:"-15px",top:"-10px"}})})]})}),(0,l.jsx)("div",{children:g.filter(e=>e.role===K.Role.USER).length})]})]})]}),s&&(0,l.jsx)("div",{className:"p-5 text-center",children:(0,l.jsx)(_.A,{color:"inherit"})}),!s&&(0,l.jsx)("div",{className:"mt-4",style:{height:400,width:"100%"},children:(0,l.jsx)(ee.Sd,{data:g,components:el,fixedHeaderContent:()=>(0,l.jsx)(E.X,{children:(0,l.jsx)(U.A,{children:["Member","Role","Status","Created"].map(e=>(0,l.jsx)(L.A,{variant:"head",className:"text-center fw-bold",sx:{backgroundColor:"#333"},children:e},e))})}),itemContent:(e,t)=>
1(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(E.f,{children:(0,l.jsxs)(L.A,{className:"text-truncate pe-0 pb-0",children:[(0,l.jsxs)("div",{className:"d-flex justify-content-between",children:[(0,l.jsx)(G.A,{title:null==t?void 0:t.email,children:(0,l.jsxs)("div",{className:"d-flex",children:[(0,l.jsx)(W.A,{alt:(null==t?void 0:t.name)||(null==t?void 0:t.email),sx:{width:24,height:24,fontSize:"12px",marginRight:"0.5rem",bgcolor:t.bgColor},children:((null==t?void 0:t.name)||(null==t?void 0:t.email)||"")[0]}),(0,l.jsx)("div",{className:"break-word-pre-wrap",style:{lineHeight:"24px",maxWidth:"160px"},children:(null==t?void 0:t.name)||(null==t?void 0:t.email)||"-"})]})}),C(t)]}),(0,l.jsxs)("div",{className:"d-flex justify-content-between",children:[(0,l.jsx)("div",{className:"p-2",children:t.is_active?"Active":"Inactive"}),(0,l.jsx)("div",{className:"text-center p-1 "+(t.created_at?"":"text-disabled"),children:t.created_at?(0,y.wc4)(t.created_at,!0):"-"})]})]})}),(0,l.jsx)(E.X,{children:(0,l.jsxs)(m.Fragment,{children:[(0,l.jsx)(L.A,{className:"text-truncate p-1",children:(0,l.jsx)(G.A,{title:null==t?void 0:t.email,children:(0,l.jsxs)("div",{className:"d-flex",children:[(0,l.jsx)(W.A,{alt:(null==t?void 0:t.name)||(null==t?void 0:t.email),sx:{width:24,height:24,fontSize:"12px",marginRight:"0.5rem",bgcolor:t.bgColor},children:((null==t?void 0:t.name)||(null==t?void 0:t.email)||"")[0]}),(0,l.jsx)("div",{className:"break-word",style:{lineHeight:"24px"},children:(null==t?void 0:t.name)||(null==t?void 0:t.email)||"-"})]})})}),(0,l.jsx)(L.A,{className:"text-center p-1",children:C(t)}),(0,l.jsx)(L.A,{className:"text-center p-1",children:(0,l.jsx)("div",{className:"p-2",children:t.is_active?"Active":"Inactive"})}),(0,l.jsx)(L.A,{className:"text-center p-1 "+(t.created_at?"":"text-disabled"),children:(0,l.jsx)("div",{className:"p-2",children:t.created_at?(0,y.wc4)(t.created_at,!0):"-"})})]})})]})})}),(0,l.jsxs)(B.A,{open:h,className:"more-popup","aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",onClose:()=>f(!1),children:[(0,l.jsxs)(J.A,{id:"alert-dialog-title",className:"text-dark w-100 p-4 text-center",children:[(0,l.jsx)("span",{className:"text-white h4 pe-3",children:"Invite members to Emovid"}),(0,l.jsx)(q.A,{className:"close-icon text-white","aria-label":"Close",disabled:s,onClick:()=>f(!1),style:{top:"20px"},children:(0,l.jsx)(es.A,{"data-testid":"CloseIcon",sx:{fontSize:30}})})]}),(0,l.jsx)(Y.A,{className:"w-100"}),(0,l.jsx)($.A,{id:"alert-dialog-description",children:(0,l.jsxs)("div",{className:"w-100 overflow-auto",style:{maxHeight:"500px",minWidth:x.xl||x.v1?"360px":"240px"},children:[(0,l.jsx)(M.A,{fullWidth:!0,className:"w-100 mt-2",children:(0,l.jsx)(H.A,{id:"outlined-basic",label:"Email addresses",variant:"outlined",type:"email",ref:t,autoFocus:!0,autoComplete:"off",placeholder:"Enter comma separated emails",className:"w-100 form-control show-focus mt-0 "+(c&&r?" has-error ":""),style:{marginTop:"5px"},onChange:t=>{var s;let a=t.target.value||"";o(a);let l=!0,i=!0,n=(null==(s=e.user)?void 0:s.email.split("@")[1])||"emovid.com",r=(0,y.j8h)(a);r.forEach(e=>l=l&&(0,y.xf$)(e.trim())),r.forEach(e=>i=i&&e.indexOf(n)>0),l?i?d(""):d("Please enter work email addresses from ".concat(n,".")):d("Please enter valid email addresses.")}})}),(0,l.jsx)(ea.A,{children:c}),(0,l.jsxs)(M.A,{fullWidth:!0,className:"w-100 mt-4",children:[(0,l.jsx)(Q.A,{children:"Invite as"}),(0,l.jsxs)(z.A,{className:"text-light",value:u,disabled:i,onChange:e=>p(e.target.value),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"}},children:[(0,l.jsx)(V.A,{value:K.Role.COMPANY_SUPER_ADMIN,children:"Super Admin"}),(0,l.jsx)(V.A,{value:K.Role.COMPANY_ADMIN,children:"Admin"}),(0,l.jsx)(V.A,{value:K.Role.USER,children:"User"})]})]})]})}),(0,l.jsx)(Y.A,{className:"w-100"}),(0,l.jsxs)(X.A,{className:"no-min-width pb-3 pt-3 pe-4",children:[(0,l.jsx)(G.A,{title:"Cancel selection",children:(0,l.jsx)("button",{className:"btn btn-outline-light",onClick:()=>f(!1),disabled:s,children:"Cancel"})}),(0,l.jsx)(G.A,{title:"Send invites to entered emails",children:(0,l.jsx)("button",{className:"btn btn-primary",onClick:S,disabled:i,children:"Send"})})]})]})]})},en=s("O1"),er=s("lC"),eo=s("Nx"),ec=s("EC"),ed=s("FJ"),em=s("ma"),eu=s("H"),ep=s("FO"),eh=e=>{var t,s,a,i,n,r;let{idVerificationStatus:o,isIdVerificationStatusLoading:c,isIdVerificationStatusError:d,refetchIdVerificationStatus:u}=e,p=(0,I.A)(),[h,x]=(0,m.useState)(!1),[f,j]=(0,m.useState)(!1),[b,g]=(0,m.useState)((null==(t=p.user)?void 0:t.faceLivenessConsentStatus)===K.FaceLivenessConsentType.GRANTED),[N,A]=(0,m.useState)((null==(s=p.user)?void 0:s.faceLivenessConsentStatus)===K.FaceLivenessConsentType.PENDING),[w,_]=(0,m.useState)(!1),[C,k]=(0,m.useState)(()=>(0,y.ENV)()),[E,O]=(0,m.useState)(),[R,D]=(0,m.useState)(!1);(0,m.useEffect)(()=>{U()},[null==(i=e.user)||null==(a=i.preferences)?void 0:a.language]),(0,m.useEffect)(()=>{R&&T()},[R]);let U=()=>{var t,s;(null==e||null==(s=e.user)||null==(t=s.preferences)?void 0:t.language)?O(eu.Mo.find(t=>{var s;return t.key===(null==(s=e.user.preferences)?void 0:s.language)})):O({key:"Original",value:"Original"})},T=async()=>{try{var t,s;x(!0),await S.Ay.putFormData("/v1/user/".concat(null==(t=p.user)?void 0:t.userId),(0,F._)((0,P._)({},null==(s=e.user)?void 0:s.preferences),{language:(null==E?void 0:E.key)||""}),!1,!0);let a=(0,y.gL$)();if(a&&(a.preferences=(0,F._)((0,P._)({},null==a?void 0:a.preferences),{language:(null==E?void 0:E.key)||""}),localStorage.setItem("userData",JSON.stringify(a)),p.setUserData(a)),await e.refetch(),v.A.success("Language preference updated successfully"),R){(0,y.DDt)("e_set_preferred_translation_language",{preferred_translation_language:null==E?void 0:E.key});let e=new eo.T$;e.set("preferred_translation_language",(null==E?void 0:E.key)||""),ec.ls(e),D(!1)}}catch(e){v.A.alertableError(e.message?JSON.parse(e.message).message:"Unknown error",e)}finally{x(!1)}},L=e=>{(0,y.WmS)(e),p.updateFromSession(),g(e===K.FaceLivenessConsentType.GRANTED),A(e===K.FaceLivenessConsentType.PENDING)},M=async()=>{b?W():_(!0)},z=async e=>{try{var t,s;x(!0),_(!1),await (0,y.T0I)((null==p||null==(t=p.user)?void 0:t.userId)||"",K.FaceLivenessConsentType.GRANTED),await (0,y.Myj)({user_id:(null==p||null==(s=p.user)?void 0:s.userId)||"",liveness_consent_form_id:e,ip_address:p.ipAddress||""}),L(K.FaceLivenessConsentType.GRANTED),v.A.success("Verified Human Seal enabled successfully")}catch(e){v.A.alertableError("Unable to toggle preference. Please try again",e)}finally{x(!1)}},V=async()=>{try{j(!0),await (0,y.kKf)(),await u(),v.A.success("ID verification reset successfully")}catch(e){v.A.alertableError("Unable to reset ID verification. Please try again",e)}finally{j(!1)}},W=async()=>{try{var e;x(!0),_(!1),await (0,y.T0I)((null==p||null==(e=p.user)?void 0:e.userId)||"",K.FaceLivenessConsentType.DENIED),L(K.FaceLivenessConsentType.DENIED),v.A.success("Consent declined 
1successfully. Human verification has been turned off.")}catch(e){v.A.alertableError("Unable to toggle preference. Please try again",e)}finally{x(!1)}};return(0,l.jsxs)("div",{className:"user-preferences col-sm-9 col-xs-12",children:[(0,l.jsx)("h5",{className:"text-white text-center",children:"User Preferences"}),(0,l.jsx)("div",{className:"row m-auto",children:(0,l.jsx)("form",{id:"user-preferences-form",onSubmit:T,className:"mt-4 mt-md-5 text-center",children:(0,l.jsxs)("div",{className:"row",children:[(0,l.jsxs)("div",{className:"form-group line-item d-flex flex-wrap justify-content-center",children:[(0,l.jsxs)("label",{children:["AI Summary/Transcript Language",(0,l.jsx)(G.A,{title:"By default, we will translate all video summaries and transcripts you receive into this language.",enterTouchDelay:0,children:(0,l.jsx)(q.A,{children:(0,l.jsx)(en.A,{"data-testid":"HelpRoundedIcon",fontSize:"small"})})})]}),(0,l.jsx)("div",{style:{marginTop:"2px"},children:(0,l.jsx)(ep.A,{isDisabled:h,showDefaultLabelOriginal:!0,defaultOpen:!1,onSelectLanguage:e=>{O(eu.Mo.find(t=>t.key===e)),D(!0)},selectedLanguageObject:E,isUserPreference:!0})})]}),(0,l.jsxs)("div",{className:"form-group line-item d-flex flex-wrap justify-content-center mt-4",children:[(0,l.jsxs)("label",{className:"pt-1",children:["Activate Verified Human Seal",(0,l.jsx)(G.A,{title:"When enabled, we check that a real person is present while recording. If the check passes, your video will display the Verified Human Seal.",enterTouchDelay:0,children:(0,l.jsx)(q.A,{children:(0,l.jsx)(en.A,{"data-testid":"HelpRoundedIcon",fontSize:"small"})})})]}),(0,l.jsxs)("div",{className:"position-relative",style:{marginTop:"2px"},children:[(0,l.jsx)(er.A,{checked:b,disabled:h||!!N&&!(null==(n=p.user)?void 0:n.faceLivenessEnabled),onChange:M,slotProps:{input:{"aria-label":"Toggle Verified Human Seal"}}}),!(null==(r=p.user)?void 0:r.faceLivenessEnabled)&&(0,l.jsx)("sup",{style:{top:"-0.9em"},children:(0,l.jsx)(em.A,{pending:N})})]})]}),(0,y.$$b)()&&C&&(0,l.jsxs)("div",{className:"form-group line-item d-flex flex-wrap justify-content-center mt-4",children:[(0,l.jsxs)("label",{className:"pt-1",children:["AI Data Sharing",(0,l.jsx)(G.A,{title:"Recordings, prompts and conversation content may be sent to OpenAI to generate transcripts, summaries and AI suggestions/analysis. Withdrawing consent here doesn't retroactively delete anything already processed.",enterTouchDelay:0,children:(0,l.jsx)(q.A,{children:(0,l.jsx)(en.A,{"data-testid":"HelpRoundedIcon",fontSize:"small"})})})]}),(0,l.jsx)("button",{type:"button",className:"btn btn-link",onClick:()=>{(0,y.mgS)(),k(!1),v.A.success("AI data-sharing consent withdrawn. You'll be asked again next time you record or use an AI feature.")},children:"Withdraw Consent"})]}),!(0,y.hQ)()&&(0,l.jsx)("div",{className:"form-group line-item d-flex flex-wrap justify-content-center mt-4",children:(0,l.jsx)("a",{href:"#",className:"cky-banner-element",children:"Change Cookie Preferences"})}),!c&&!d&&(null==o?void 0:o.status)===200&&(0,l.jsx)("div",{className:"form-group line-item d-flex flex-wrap justify-content-center mt-4",children:(0,l.jsx)("button",{type:"button",className:"btn btn-link",disabled:f||(null==o?void 0:o.review_status)==="init",onClick:V,children:"Reset ID Verification"})})]})})}),(0,l.jsx)(ed.A,{isOpen:w,onClose:W,onConsent:z})]})},ex=s("Yg"),ef=e=>{var t,s;let[a,i]=(0,m.useState)(""),[n,r]=(0,m.useState)(!1),o=async()=>{try{if(a){var t;r(!0),await S.Ay.postFormData("/v1/mfa/verify",{secret:null==(t=e.generatedSecret)?void 0:t.secret,code:a,mfa_type:"AUTHENTICATOR"}),r(!1),e.handleClose("AUTHENTICATOR",!0)}}catch(e){v.A.userError("Invalid code"),r(!1)}};return(0,l.jsxs)("div",{className:"container verify-dialog p-4",children:[(0,l.jsx)(q.A,{className:"close-icon text-white",onClick:()=>e.handleClose("AUTHENTICATOR"),children:(0,l.jsx)(es.A,{"data-testid":"CloseIcon",sx:{fontSize:30}})}),(0,l.jsx)("h3",{className:"m-auto pb-1 text-center",children:"Setup Authenticator"}),(0,l.jsx)("h5",{className:"pt-2 pb-1",children:"Configuring Google/Microsoft Authenticator or Authy"}),(0,l.jsxs)("ol",{className:"text-wrap",children:[(0,l.jsx)("li",{children:"Install Google Authenticator (iOS - Android) or Authy (iOS - Android)"}),(0,l.jsx)("li",{children:"In the authenticator app, select '+' icon"}),(0,l.jsx)("li",{children:"Select 'Scan a barcode (or QR code)' and use the phone's camera to scan this barcode"})]}),(0,l.jsx)("h5",{className:"pt-1 pb-1",children:"Scan QR Code"}),(0,l.jsx)("div",{className:"text-center",children:(0,l.jsx)("img",{src:null==(t=e.generatedSecret)?void 0:t.qr_image,alt:"QR Code"})}),(0,l.jsx)("h5",{className:"pt-2 pb-1",children:"OR Enter below code into your app"}),(0,l.jsx)("p",{className:"pt-2 text-break",children:null==e||null==(s=e.generatedSecret)?void 0:s.secret}),(0,l.jsx)("h5",{className:"pt-1 pb-1",children:"Verify Code"}),(0,l.jsx)("input",{type:"text",className:"form-control mb-3",placeholder:"Enter code shown in app",maxLength:6,inputMode:"numeric",pattern:"[0-9]*",onChange:e=>i(e.target.value.replace(/\D/g,""))}),(0,l.jsxs)("div",{className:"d-flex justify-content-center",children:[(0,l.jsx)("button",{className:"btn btn-primary mb-3 px-3 text-white animated-text me-3",disabled:!a||n,onClick:o,children:"Activate"}),n&&(0,l.jsx)(_.A,{})]})]})},ej=s("QM"),ey=s("Fu"),eb=()=>{let e=(0,I.A)(),{user:t}=e,[s,a]=(0,m.useState)(!1),[i,n]=(0,m.useState)(!1),[r,o]=(0,m.useState)(!1),[c,d]=(0,m.useState)(null),u=async()=>{a(!0);try{let e=await S.Ay.postFormData("/v1/mfa/generate/secret",null);e&&d(e)}catch(e){v.A.alertableError("Unable to setup 2FA",e)}},p=async()=>{a(!0),await u(),n(!0),a(!1)},h=function(t){let s=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("AUTHENTICATOR"===t?n(!1):o(!1),s){let t=(0,y.gL$)();t&&(t.mfaEnabled=!0,localStorage.setItem("userData",JSON.stringify(t)),e.setUserData(t)),e.signOut(),v.A.success("MFA successfully enabled. Logging out.")}},x=async()=>
1{if(null==t?void 0:t.mfaEnabled)try{await S.Ay.postFormData("/v1/mfa/disable",null);let t=(0,y.gL$)();t&&(t.mfaEnabled=!1,localStorage.setItem("userData",JSON.stringify(t)),e.setUserData(t)),v.A.success("MFA disabled successfully")}catch(e){v.A.alertableError("Unable to disable 2FA",e)}};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"multi-factor-auth col-sm-9 col-xs-12",children:[(0,l.jsx)("h5",{className:"text-white text-center",children:"Multi factor authentication (2FA)"}),!(null==t?void 0:t.mfaEnabled)&&(0,l.jsx)("h6",{className:"pt-3 pb-3 text-center",children:"Click on below option to setup 2FA"}),(0,l.jsxs)("div",{className:"mfa-buttons mt-4",children:[(null==t?void 0:t.mfaEnabled)&&(0,l.jsxs)("div",{className:"d-flex m-auto",children:[(0,l.jsx)("button",{className:"btn btn-primary mb-3 px-3 text-white animated-text me-3",disabled:s,onClick:x,children:(null==t?void 0:t.mfaEnabled)?"Disable 2FA":"Setup 2FA"}),s&&(0,l.jsx)(_.A,{})]}),!(null==t?void 0:t.mfaEnabled)&&(0,l.jsxs)("div",{className:"position-relative",children:[(0,l.jsx)("button",{className:"btn btn-primary mb-3 px-3 text-white animated-text d-block w-100 "+((0,y.oY9)(e)?"":"disabled"),disabled:!(0,y.oY9)(e),onClick:()=>void p(),children:"MFA via Authenticator App"}),!(0,y.oY9)(e)&&(0,l.jsx)("div",{className:"position-absolute",style:{top:"-18px",right:"-3px"},children:(0,l.jsx)(ey.A,{featureKey:"mfa_support"})})]})]})]}),(0,l.jsx)(ex.A,{className:"mfa-popup",isOpen:i,onClose:()=>n(!1),children:(0,l.jsx)(ef,{handleClose:h,generatedSecret:c})}),(0,l.jsx)(ex.A,{className:"mfa-popup",isOpen:r,onClose:()=>o(!1),children:(0,l.jsx)(ej.A,{handleClose:h,generatedSecret:c})})]})},ev=s("E9"),eg=s("nW"),eN=s("vQ"),eA=s("E0"),ew=s("Wf"),e_=s("tET"),eS=s("zQb"),eC=s("dA");function ek(){let e=(0,eA._)(["\n  position: relative;\n  height: ","px;\n"]);return ek=function(){return e},e}function eE(){let e=(0,eA._)(["\n  position: absolute;\n  top: 0;\n  left: 0;\n  right: 0;\n  bottom: 0;\n"]);return eE=function(){return e},e}let eI=(0,e_.Ay)(ew.A)(ek(),300);(0,e_.Ay)(ew.A)(eE());var eP=e=>{let t=(0,m.useRef)(null),[s,a]=(0,m.useState)({unit:"px",x:0,y:0,width:160,height:160}),[i,n]=(0,m.useState)(!1),[r,o]=(0,m.useState)(!1),[c,d]=(0,m.useState)(),[u,p]=(0,m.useState)(),[h,x]=(0,m.useState)();(0,m.useEffect)(()=>{x(u?URL.createObjectURL(u):e.imageUrl),d(void 0)},[u]);let f=(0,m.useCallback)(e=>{d(e)},[]),j=async()=>{if(!c)return void v.A.alertableError("Image processing failed. Please try again.",Error("croppedImageFile is undefined"));try{n(!0);let t=await (0,y.Sko)(c),s=await S.Ay.postFormData("/v1/user/profile/image/upload",{file:t,file_name:"profile-image-".concat((0,y.llI)(),".jpg")},!1,!0);n(!1),e.handleSave(s.profile_image_url)}catch(e){n(!1),v.A.alertableError(e.message||"Unknown error",e)}},g=async()=>{o(!1),e.handleDelete(),p(null)};return(0,l.jsxs)("div",{className:"public-profile-image mt-3",children:[(0,l.jsx)("h6",{className:"text-white text-center",children:"Add or upload a profile image"}),e.imageUrl&&(0,l.jsxs)("div",{className:"d-flex flex-wrap col-md-9 col-sm-12 m-auto justify-content-between",children:[(0,l.jsxs)("div",{className:"m-0",children:[(0,l.jsx)("input",{type:"file",id:"file",ref:t,style:{display:"none"},accept:"image/jpg, image/jpeg, image/png, image/bmp",onChange:e=>{e.stopPropagation(),e.preventDefault(),(0,y.cz2)(e.target.files[0])&&p(e.target.files[0])}}),(0,l.jsx)("button",{type:"button",className:"btn btn-outline-light mt-2",onClick:()=>{var e;null==(e=t.current)||e.click()},children:u?"Upload: ".concat(u.name):"Upload"})]}),(0,l.jsx)("div",{className:"ms-auto",children:(0,l.jsx)("button",{type:"button",className:"btn btn-outline-light mt-2",onClick:()=>{o(!0)},children:"Delete Profile Image"})})]}),(0,l.jsxs)("div",{className:"col-md-9 col-sm-12 m-auto mt-3",children:[(0,l.jsxs)(eI,{children:[h&&(0,l.jsx)("div",{className:"d-flex justify-content-center",children:(0,l.jsx)(eC.A,{imageSrc:h||"",crop:s,aspect:1,circularCrop:!0,onCropChange:a,onCropComplete:f})}),!u&&!e.imageUrl&&(0,l.jsx)(eS.A,{onSelectFile:e=>{p(e)},maxFileSizeInMB:5,selectedFile:u,customStyles:{height:"100%"}})]}),(0,l.jsxs)("div",{className:"d-flex justify-content-between mt-3",children:[(0,l.jsx)("button",{type:"button",className:"btn btn-outline-light gray-btn",onClick:e.handleCancel,children:"Cancel"}),(0,l.jsxs)("button",{type:"submit",disabled:i||!u&&!e.imageUrl,className:"btn btn-primary",onClick:j,children:[i&&(0,l.jsx)(_.A,{size:"1rem",className:"me-1"}),"Save"]})]})]}),(0,l.jsx)(b.A,{show:r,title:"Confirm",message:"Are you sure you want to delete current profile image?",cancelButtonText:"Cancel",confirmButtonText:"Yes, Delete",showCloseButton:!0,onClose:()=>o(!1),onConfirmClick:g,onCancelClick:()=>o(!1)})]})},eF=e=>{var t,s,a,i;let n=(0,I.A)(),[r,o]=(0,m.useState)(!1),[c,d]=(0,m.useState)(!1),[u,p]=(0,m.useState)(!1),[h,x]=(0,m.useState)(""),{register:f,formState:j,handleSubmit:b,trigger:g,setValue:N,getValues:A,watch:w,reset:C}=(0,eN.mN)({defaultValues:{firstName:"",lastName:"",title:"",company:"",company_website:""},mode:"onChange"});(0,m.useEffect)(()=>{k(e.user),g()},[e.user]),(0,m.useEffect)(()=>{let e=w(()=>{p(D())});return()=>e.unsubscribe()},[w]);let k=e=>{N("firstName",(e.name||"").split(" ")[0]),N("lastName",(e.name||"").split(" ")[1]),N("title",e.title||""),N("company_website",e.company_website||""),N("company",e.company||""),x(e.profile_image_url||""),p(D())},E=async t=>{try{var s;o(!0);let a={name:t.firstName+" "+t.lastName,title:t.title,company:t.company,company_website:t.company_website,profile_image_url:h};await S.Ay.putFormData("/v1/user/".concat(null==(s=n.user)?void 0:s.userId),a,!1,!0);let l=(0,y.gL$)();l&&(l.name=a.name,l.profileImageUrl=h,localStorage.setItem("userData",JSON.stringify(l)),n.setUserData(l)),o(!1),await e.refetch(),v.A.success("Profile updated successfully")}catch(e){o(!1),v.A.alertableError(e.message?JSON.parse(e.message).message:"Unknown error",e)}},O=async e=>{d(!1),await R(e)},R=async e=>{var t;x(e),await S.Ay.putFormData("/v1/user/".concat(null==(t=n.user)?void 0:t.userId),{profile_image_url:e},!1,!0);let s=(0,y.gL$)();s&&(s.profileImageUrl=e,localStorage.setItem("userData",JSON.stringify(s)),n.setUserData(s))},D=()=>!!r||Object.keys(j.errors).length>0||A("firstName")===(e.user.name||"").split(" ")[0]&&A("lastName")===(e.user.name||"").split(" ")[1]&&A("title")===(e.user.title||"")&&A("company_website")===(e.user.company_website||"")&&A("company")===(e.user.company||"");return(0,l.jsx)(l.Fragment,{children:(0,l.jsxs)("div",{className:"public-profile col-sm-9 col-xs-12",children:[(0,l.jsx)("h5",{className:"text-white text-center",children:"Public Profile"}),c&&(0,l.jsx)(eP,{imageUrl:h,handleSave:O,handleCancel:()=>{d(!1)},handleDelete:()=>{x(""),R(""),d(!0)}}),!c&&(0,l.jsxs)("div",{className:"row m-auto",children:[(0,l.jsx)("div",{className:"col-md-2"}),(0,l.jsxs)("div",{className:"col-md-3 mt-2 mt-md-5 d-flex flex-column align-items-center position-relative p-0",children:[(0,l.jsxs)("div",{className:"profile-avatar",children:[!h&&(0,l.jsx)(W.A,{className:"avatar-image",alt:(null==(t=e.user)?void 0:t.name)||(null==(s=e.user)?void 0:s.email)||"",src:"/static/images/avatar/3.jpg"}),h&&(0,l.jsx)(W.A,{className:"avatar-image",src:h})]}),(0,l.jsx)("button",{type:"button",className:"btn btn-outline-light mt-3",onClick:()=>{d(!0)},children:h?"Edit Profile Image":"Add Profile Image"})]}),(0,l.jsx)("div",{className:"col-md-1"}),(0,l.jsx)("div",{className:"col-md-6",children:(0,l.jsxs)("form",{id:"public-profile-form",onSubmit:b(E),className:"mt-4 mt-md-5 mb-5",children:[(0,l.jsxs)("div",{className:"d-flex row",children:[(0,l.jsxs)("div",{className:"form-group line-item col-md-6 col-sm-12",children:[(0,l.jsx)("label",{className:"pb-2",children:"First name"}),(0,l.jsx)("input",(0,F._)((0,P._)({type:"text",className:j.errors.firstName&&j.touchedFields.firstName?"form-control error pb-2 pt-2":"form-control pb-2 pt-2"},f("firstName",{required:!0})),{placeholder:"Enter first name"})),j.errors.firstName&&(null==(a=j.errors.firstName)?void 0:a.type)==="required"&&(0,l.jsx)(ea.A,{children:"Please enter first name"})]}),(0,l.jsxs)("div",{className:"form-group line-item col-md-6 col-sm-12",children:[(0,l.jsx)("label",{className:"pb-2",children:"Last name"}),(0,l.jsx)("input",(0,F._)((0,P._)({type:"text",className:j.errors.lastName&&j.touchedFields.lastName?"form-control error pb-2 pt-2":"form-control pb-2 pt-2"},f("lastName",{required:!0})),{placeholder:"Enter last name"})),j.errors.lastName&&(null==(i=j.errors.lastName)?void 0:i.type)==="required"&&(0,l.jsx)(ea.A,{children:"Please enter last name"})]})]}),(0,l.jsxs)("div",{className:"form-group line-item",children:[(0,l.jsx)("label",{className:"pb-2",children:"Company (optional)"}),(0,l.jsx)("input",(0,F._)((0,P._)({type:"text",className:j.errors.company&&j.touchedFields.company?"form-control error pb-2 pt-2":"form-control pb-2 pt-2"},f("company")),{placeholder:"Enter company"}))]}),(0,l.jsxs)("div",{className:"form-group line-item",children:[(0,l.jsx)("label",{className:"pb-2",children:"Company Website (
1optional)"}),(0,l.jsx)("input",(0,F._)((0,P._)({type:"text",className:j.errors.company_website&&j.touchedFields.company_website?"form-control error pb-2 pt-2":"form-control pb-2 pt-2"},f("company_website")),{placeholder:"Enter company website"}))]}),(0,l.jsxs)("div",{className:"form-group line-item",children:[(0,l.jsx)("label",{className:"pb-2",children:"Title (optional)"}),(0,l.jsx)("input",(0,F._)((0,P._)({type:"text",className:j.errors.title&&j.touchedFields.title?"form-control error pb-2 pt-2":"form-control pb-2 pt-2"},f("title")),{placeholder:"Enter title"}))]}),(0,l.jsxs)("div",{className:"d-flex justify-content-between mt-2 mt-md-5",children:[(0,l.jsx)("button",{type:"button",disabled:u,className:"btn btn-outline-light gray-btn mt-2",onClick:()=>{C(),k(e.user)},children:"Cancel"}),(0,l.jsxs)("button",{type:"submit",disabled:u,className:"btn btn-primary mt-2",children:[r&&(0,l.jsx)(_.A,{size:"1rem",className:"me-1"}),"Update"]})]})]})})]})]})})},eO=s("Ie"),eR=s("tn"),eD=s("Cl");let eU=Array.from({length:24},(e,t)=>t),eT=e=>"daily_summary"===e||"both"===e,eL=[{value:"off",title:"Off",description:"No email notifications"},{value:"immediate",title:"Immediate email notifications",description:"Receive an email for each new feedback or reply"},{value:"daily_summary",title:"Daily summary",description:"Receive a daily summary email at the time of your choice"},{value:"both",title:"Both",description:"Receive individual emails plus a daily summary"}],eM=e=>e?e.survey_response_received&&e.survey_responses_daily_summary?"both":e.survey_response_received?"immediate":e.survey_responses_daily_summary?"daily_summary":"off":"daily_summary",ez=e=>{let t=null==e?void 0:e.survey_responses_daily_summary_hour;return"number"==typeof t?t:9};var eV=e=>{var t,s,a,i,n,r;let o=(0,I.A)(),[c,d]=(0,m.useState)(!1),[u,p]=(0,m.useState)(()=>{var t;return eM(null==(t=e.user)?void 0:t.notifications)}),[h,x]=(0,m.useState)(u),[f,j]=(0,m.useState)(()=>{var t;return ez(null==(t=e.user)?void 0:t.notifications)}),[b,g]=(0,m.useState)(f);(0,m.useEffect)(()=>{var t,s;let a=eM(null==(t=e.user)?void 0:t.notifications),l=ez(null==(s=e.user)?void 0:s.notifications);p(a),x(a),j(l),g(l)},[null==(s=e.user)||null==(t=s.notifications)?void 0:t.survey_response_received,null==(i=e.user)||null==(a=i.notifications)?void 0:a.survey_responses_daily_summary,null==(r=e.user)||null==(n=r.notifications)?void 0:n.survey_responses_daily_summary_hour]);let N=eT(h),A=h!==u||N&&b!==f,w=async()=>{try{let t;d(!0);let s=(t=eT(h),{survey_response_received:"immediate"===h||"both"===h,survey_responses_daily_summary:t,survey_responses_daily_summary_hour:t?b:void 0});await S.Ay.postFormData("/v1/user/notifications/survey-feedback",s);let a=(0,y.gL$)();a&&(a.notifications=s,localStorage.setItem("userData",JSON.stringify(a)),o.setUserData(a)),p(h),j(b),await e.refetch(),v.A.success("Notification preference updated successfully")}catch(e){v.A.alertableError(e.message?JSON.parse(e.message).message:"Unknown error",e)}finally{d(!1)}};return(0,l.jsxs)("div",{className:"notifications col-sm-9 col-xs-12 pb-5",children:[(0,l.jsx)("h5",{className:"text-white text-center",children:"Notifications"}),(0,l.jsx)("div",{className:"row m-auto",children:(0,l.jsxs)("div",{className:"col-md-8 col-sm-12 m-auto mt-4 mt-md-5",children:[(0,l.jsx)("h6",{className:"text-white",children:"Survey Feedback Notifications"}),(0,l.jsxs)("p",{className:"text-gray",children:["Choose how you'd like to receive notifications when new feedback or replies are received on surveys you create or are authorized to access.",!(0,y.dR5)(o)&&(0,l.jsx)(G.A,{title:(0,l.jsxs)(l.Fragment,{children:["To know more about Surveys, please email us at"," ",(0,l.jsx)("a",{href:"mailto:[email protected]",children:"[email protected]"})]}),children:(0,l.jsx)(Z.A,{"data-testid":"InfoOutlinedIcon",fontSize:"small",className:"ms-1 mb-1"})})]}),(0,l.jsx)(eO.A,{"aria-label":"Survey Feedback Notifications",value:h,onChange:e=>x(e.target.value),children:eL.map(e=>(0,l.jsxs)(m.Fragment,{children:[(0,l.jsx)(eR.A,{value:e.value,disabled:c,className:"notification-option d-flex "+(h===e.value?"selected":""),control:(0,l.jsx)(eD.A,{}),label:(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"notification-option__title",children:e.title}),(0,l.jsx)("div",{className:"notification-option__description",children:e.description})]})}),h===e.value&&N&&(0,l.jsx)("div",{className:"mb-2 ms-4",children:(0,l.jsxs)(M.A,{size:"small",disabled:c,
1children:[(0,l.jsx)(Q.A,{id:"daily-summary-hour-label",children:"Send summary e-mail at"}),(0,l.jsx)(z.A,{labelId:"daily-summary-hour-label",label:"Send summary at",value:b,style:{minWidth:"200px"},onChange:e=>g(Number(e.target.value)),children:eU.map(e=>{let t,s;return(0,l.jsx)(V.A,{value:e,children:(s=Math.floor((t=((60*e-new Date().getTimezoneOffset())%1440+1440)%1440)/60),"".concat(s%12==0?12:s%12,":").concat((t%60).toString().padStart(2,"0")," ").concat(s<12?"AM":"PM"))},e)})})]})})]},e.value))}),(0,l.jsxs)("button",{type:"button",className:"btn btn-primary mt-4",disabled:c||!A,onClick:w,children:[c&&(0,l.jsx)(_.A,{size:"1rem",className:"me-1"}),"Save Changes"]})]})})]})},eW=s("vS"),eH=s("mCs"),eG=e=>{let t=(0,I.A)(),{register:s,formState:a,handleSubmit:i,trigger:n,setValue:r}=(0,eN.mN)({defaultValues:{email:"",password:""},mode:"onChange"}),o=(0,eN.mN)({defaultValues:{password:""},mode:"onChange"}),[c,d]=(0,m.useState)({}),[u,p]=(0,m.useState)(!1),[h,x]=(0,m.useState)(""),[f,j]=(0,m.useState)(!1),[b,g]=(0,m.useState)(!1);(0,m.useEffect)(()=>{N(e.user),n()},[e.user]);let N=e=>{r("email",e.email),r("password","********"),x(e.phone_number||"")},A=async s=>{try{var a;p(!0);let l={email:s.email||e.user.email,phone_number:h||""};s.password.includes("*")||(l.password=s.password),await S.Ay.putFormData("/v1/user/".concat(null==(a=t.user)?void 0:a.userId),l,!1,!0);let i=(0,y.gL$)();i&&(i.email=l.email,i.phoneNumber=l.phone_number,localStorage.setItem("userData",JSON.stringify(i)),t.setUserData(i)),p(!1),await e.refetch(),v.A.success("Account details updated successfully")}catch(e){p(!1),v.A.alertableError(e.message||"Unknown error",e)}},w=async t=>{(d(t),t.email!==e.user.email)?j(!0):await A(t)},C=()=>{let t=u;if(h===e.user.phone_number)return!0;if(e.user.account_type!==K.AccountType.EMAIL){if(!b)return!0}else{if(!a.isDirty&&!b)return!0;t=u||!a.isValid}return h&&!(0,eW.h1)(h)&&(t=!0),t},k=async e=>{try{var s;let a={user_id:null==(s=t.user)?void 0:s.userId,password:e.password,phone_number:h};if(!(await S.Ay.postFormData("/v1/user/password/validate",a,!1,!0)).is_valid)return void v.A.userError("Invalid password");j(!1),await A(c)}catch(e){(0,y.vVN)("Error in password validation: ",3,e)}};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"account-info col-sm-9 col-xs-12",children:[(0,l.jsx)("h5",{className:"text-white text-center",children:"Account Details"}),(0,l.jsx)("div",{className:"col-md-6 col-sm-12 m-auto",children:(0,l.jsxs)("form",{id:"account-update-form",onSubmit:i(w),className:"mt-5",children:[e.user.account_type===K.AccountType.EMAIL&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"d-flex justify-content-between align-items-center line-item",children:[(0,l.jsx)("label",{children:"Login via"}),(0,l.jsx)(eH.A,{"data-testid":"EmailRoundedIcon",fontSize:"large"})]}),(0,l.jsxs)("div",{className:"form-group line-item",children:[(0,l.jsx)("label",{className:"pb-2",children:"Primary Email"}),(0,l.jsx)("div",{className:"text-white break-word",style:{maxWidth:"90vw"},children:e.user.email})]}),(0,l.jsxs)("div",{className:"form-group line-item",children:[(0,l.jsx)("label",{className:"pb-2",children:"Password"}),(0,l.jsx)("input",(0,F._)((0,P._)({type:"password",className:a.errors.password&&a.touchedFields.password?"form-control error pb-2 pt-2":"form-control pb-2 pt-2"},s("password",{required:e.user.account_type===K.AccountType.EMAIL})),{placeholder:"Enter password"})),a.errors.password&&(0,l.jsx)(ea.A,{children:"Please enter password"})]})]}),e.user.account_type!==K.AccountType.EMAIL&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(E.X,{children:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"d-flex justify-content-between align-items-center line-item",children:[(0,l.jsx)("label",{children:"Login via"}),(0,l.jsxs)("div",{className:"managed-by-icon",children:[e.user.account_type===K.AccountType.GOOGLE&&(0,l.jsx)("img",{className:"icon",src:"/icons/google.svg",alt:"google"}),e.user.account_type===K.AccountType.MICROSOFT&&(0,l.jsx)("img",{className:"icon",src:"/icons/microsoft.svg",alt:"microsoft"})]})]}),(0,l.jsxs)("div",{className:"d-flex justify-content-between line-item",children:[(0,l.jsx)("label",{children:"Primary Email"}),(0,l.jsx)("div",{className:"text-white break-word",style:{maxWidth:"250px"},children:e.user.email})]})]})}),(0,l.jsx)(E.f,{children:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"d-flex align-items-center flex-column line-item",children:[(0,l.jsx)("label",{className:"mb-2",children:"Login Via"}),(0,l.jsxs)("div",{className:"managed-by-icon",children:[e.user.account_type===K.AccountType.GOOGLE&&(0,l.jsx)("img",{className:"icon",src:"/icons/google.svg",alt:"google"}),e.user.account_type===K.AccountType.MICROSOFT&&(0,l.jsx)("img",{className:"icon",src:"/icons/microsoft.svg",alt:"microsoft"})]})]}),(0,l.jsxs)("div",{className:"d-flex align-items-center flex-column line-item",children:[(0,l.jsx)("label",{className:"mb-1",children:"Primary Email"}),(0,l.jsx)("div",{className:"text-white break-word text-center",style:{maxWidth:"90vw"},children:e.user.email})]})]})})]}),(0,l.jsxs)("div",{className:"form-group line-item",children:[(0,l.jsx)("label",{className:"pb-2",children:"Phone (optional)"}),(0,l.jsx)(eW.Ay,{className:"w-100 phone-input "+(h&&!(0,eW.h1)(h)?"error":""),placeholder:"Enter phone",style:(0,F._)((0,P._)({},ej.z),{fontSize:"16px"}),defaultCountry:"US",value:h,onChange:e=>{n(),x(e),g(!0)}}),h&&!(0,eW.h1)(h)&&(0,l.jsx)(ea.A,{children:"Invalid phone number"})]}),(0,l.jsxs)("div",{className:"d-flex justify-content-between mt-5",children:[(0,l.jsx)("button",{type:"button",disabled:C(),className:"btn btn-outline-light gray-btn mt-3",onClick:()=>{N(e.user)},children:"Cancel"}),(0,l.jsxs)("button",{type:"submit",disabled:C(),className:"btn btn-primary mt-3",children:[u&&(0,l.jsx)(_.A,{size:"1rem",className:"me-1"}),"Update"]})]})]})})]}),(0,l.jsx)(ex.A,{isOpen:f,onClose:()=>j(!1),className:"verify-password-popup",children:(0,l.jsxs)("div",{className:"container p-3",children:[(0,l.jsx)(q.A,{className:"close-icon text-white","aria-label":"Close",onClick:()=>j(!1),children:(0,l.jsx)(es.A,{"data-testid":"CloseIcon",sx:{fontSize:20}})}),(0,l.jsx)("h5",{className:"text-dark m-auto pb-3 text-white text-center",children:"Enter Password to change Email"}),(0,l.jsxs)("form",{id:"account-info-verify-password-form",onSubmit:o.handleSubmit(k),className:"mt-1",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("input",(0,F._)((0,P._)({type:"password",className:o.formState.errors.password&&o.formState.touchedFields.password?"form-control error pb-2 pt-2":"form-control pb-2 pt-2"},o.register("password",{required:!0})),{placeholder:"Enter password"})),o.formState.errors.password&&(0,l.jsx)(ea.A,{children:"Please enter password"})]}),(0,l.jsxs)("div",{className:"mt-4 d-flex justify-content-center",children:[(0,l.jsx)("button",{className:"btn btn-outline-primary text-white me-3","data-tip":"Cancel",onClick:()=>j(!1),children:"Cancel"}),(0,l.jsx)("button",{type:"submit",disabled:!o.formState.isValid,className:"btn btn-primary text-white ms-3","data-tip":"Verify",children:"Verify"})]})]})]})})]})},eq=s("qP"),eB=()=>{let[e,t]=(0,m.useState)("automatic"),[s,a]=(0,m.useState)(!1),[i,n]=(0,m.useState)(!1);(0,m.useEffect)(()=>{r()},[]);let r=()=>{t(localStorage.getItem("segmentation_preset")||"automatic"),a("true"===localStorage.getItem("lower_camera_resolution")),n("true"===localStorage.getItem("enable_frame_skipping"))};return(0,l.jsx)(l.Fragment,{children:(0,l.jsxs)("div",{className:"user-preferences col-sm-9 col-xs-12",children:[(0,l.jsx)("h5",{className:"text-white text-center",children:"Tweaks"}),(0,l.jsx)("h6",{className:"pt-3 pb-3 text-center",children:"Select options below as instructed by support"}),(0,l.jsx)("div",{className:"row m-auto",children:(0,l.jsxs)("form",{id:"user-preferences-form",onSubmit:t=>{t.preventDefault(),localStorage.setItem("segmentation_preset",e),localStorage.setItem("lower_camera_resolution",String(s)),localStorage.setItem("enable_frame_skipping",String(i)),v.A.success("Settings saved successfully!")},className:"mt-4 mt-md-5 text-center",children:[(0,l.jsxs)("div",{className:"row",children:[(0,l.jsxs)("div",{className:"form-group line-item d-flex flex-wrap justify-content-center",children:[(0,l.jsx)("label",{className:"pb-2",style:{marginTop:"18px"},children:"Segmentation Preset "}),(0,l.jsx)("div",{style:{marginTop:"2px"},children:(0,l.jsxs)(z.A,{id:"segmentation-select",className:"language-select",value:e,onCh
1ange:e=>t(e.target.value),label:"Segmentation Preset",children:[(0,l.jsx)(V.A,{value:"automatic",children:"Automatic"},"automatic"),(0,l.jsx)(V.A,{value:"speed",children:"Speed"},"speed"),(0,l.jsx)(V.A,{value:"balanced",children:"Balanced"},"balanced"),(0,l.jsx)(V.A,{value:"quality",children:"Quality"},"quality")]})})]}),(0,l.jsx)("div",{className:"form-group line-item d-flex flex-wrap justify-content-center",children:(0,l.jsx)(eR.A,{control:(0,l.jsx)(eq.A,{id:"lower-camera-resolution",checked:s,onChange:e=>a(e.target.checked)}),label:"Lower Camera Resolution"})}),(0,l.jsx)("div",{className:"form-group line-item d-flex flex-wrap justify-content-center",children:(0,l.jsx)(eR.A,{control:(0,l.jsx)(eq.A,{id:"enable-frame-skipping",checked:i,onChange:e=>n(e.target.checked)}),label:"Enable Frame Skipping"})})]}),(0,l.jsxs)("div",{className:"d-flex justify-content-around mt-2 mt-md-5",children:[(0,l.jsx)("button",{type:"button",disabled:!1,className:"btn btn-outline-light gray-btn mt-2",onClick:()=>{r()},children:"Cancel"}),(0,l.jsx)("button",{type:"submit",disabled:!1,className:"btn btn-primary mt-2",children:"Save"})]})]})})]})})},eJ=((a={}).PUBLIC_PROFILE="public_profile",a.ACCOUNT_DETAILS="account_details",a.USER_PREFERENCES="user_preferences",a.NOTIFICATIONS="notifications",a.PLAN_BILLING="plan_billing",a.COMPANY_ADMIN_PANEL="company_admin_panel",a.MFA="mfa",a.TWEAKS="tweaks",a.SOCIAL_POSTING_ACCOUNTS="social_posting_accounts",a.CONNECTED_PARTNERS="connected_partners",a);let eY=e=>e&&"connected_partners"!==e?e:"account_details";var e$=()=>{var e,t;let[s]=(0,p.ok)(),a=(0,h.Zp)(),b=(0,I.A)(),[g,N]=(0,m.useState)(()=>eY(s.get("page"))),[w,_]=(0,m.useState)(),[S,C]=(0,m.useState)(!1);(0,m.useEffect)(()=>{N(eY(s.get("page")))},[s]);let P=e=>{a("".concat(ev.Jh.myAccount,"?page=").concat(e)),C(!1)},{refetch:F,data:O,error:R}=(0,f.I)({queryKey:["MyAccount",(null==(e=b.user)?void 0:e.userId)||"user-id-not-found"],enabled:(0,y.V$2)(b),refetchOnWindowFocus:!1,retry:!1,queryFn:()=>{var e;return(0,y.ugX)((null==(e=b.user)?void 0:e.userId)||"")}}),D=["idVerificationStatus",null==(t=b.user)?void 0:t.userId],{data:U,isLoading:T,isError:L,refetch:M}=(0,f.I)({queryKey:D,refetchOnWindowFocus:!1,retry:!1,gcTime:1,enabled:(0,y.V$2)(b),queryFn:()=>(0,y.LWL)()});return((0,m.useEffect)(()=>{R&&v.A.alertableError(R.message,R)},[R]),(0,m.useEffect)(()=>{if(O){var e;_(O),(0,y.WmS)(O.faceLivenessConsentStatus,O.faceLivenessEnabled),null==(e=b.setUserData)||e.call(b,(0,y.gL$)()||{})}},[O]),w)?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(j.A,{theme:"dark"}),(0,l.jsxs)("div",{id:"myaccount-content",className:"position-relative "+(x.v1?"pt-5":""),style:{height:"100%"},children:[(0,l.jsxs)("div",{className:"container my-account",children:[(0,l.jsx)(E.f,{children:(0,l.jsx)(i.A,{className:"text-white position-absolute",style:{left:0,top:"1.2rem"},onClick:()=>{C(!S)},children:(0,l.jsx)(u.A,{"data-testid":"SortRoundedIcon"})})}),(0,l.jsxs)("div",{className:"d-flex justify-content-center my-account-body "+(x.Fr?"ps-2 pe-2 pt-4":"p-5 ps-3 pe-3"),children:[(0,l.jsx)(E.X,{children:(0,l.jsxs)("div",{className:"d-none d-sm-block col col-sm-3 my-account-nav",children:[(0,l.jsx)("h6",{children:"My Account"}),(0,l.jsxs)("div",{className:"nav-links",children:[(0,l.jsx)(i.A,{className:"link d-block "+("account_details"===g?"text-primary":"text-white"),onClick:()=>P("account_details"),children:"Account Details"}),(0,l.jsx)(i.A,{className:"link d-block "+("public_profile"===g?"text-primary":"text-white"),onClick:()=>P("public_profile"),children:"Public Profile"}),(0,l.jsx)(i.A,{className:"link d-block "+("user_preferences"===g?"text-primary":"text-white"),onClick:()=>P("user_preferences"),children:"User Preferences"}),(0,l.jsx)(i.A,{className:"link d-block "+("notifications"===g?"text-primary":"text-white"),onClick:()=>P("notifications"),children:"Notifications"}),!(0,y.RS9)(b)&&(0,l.jsx)(i.A,{className:"link d-block "+("plan_billing"===g?"text-primary":"text-white"),onClick:()=>P("plan_billing"),children:"Plan & Billing Details"}),(0,l.jsx)(i.A,{className:"link d-block "+("mfa"===g?"text-primary":"text-white"),onClick:()=>P("mfa"),children:"Multi Factor Auth"}),(0,y.oFY)(b)&&(0,l.jsx)(i.A,{className:"link d-block "+("company_admin_panel"===g?"text-primary":"text-white"),onClick:()=>P("company_admin_panel"),children:"Company Admin Panel"}),"tweaks"===g&&(0,l.jsx)(i.A,{className:"link d-block "+("tweaks"===g?"text-primary":"text-white"),onClick:()=>P("tweaks"),children:"Tweaks"}),O.isSocialPostingEnabled&&(0,l.jsx)(i.A,{className:"link d-block "+("social_posting_accounts"===g?"text-primary":"text-white"),onClick:()=>P("social_posting_accounts"),children:"Social Posting Accounts"}),!1]})]})}),"public_profile"===g&&(0,l.jsx)(eF,{user:w,refetch:F}),"account_details"===g&&(0,l.jsx)(eG,{user:w,refetch:F}),"user_preferences"===g&&(0,l.jsx)(eh,{user:w,refetch:F,idVerificationStatus:U,isIdVerificationStatusLoading:T,isIdVerificationStatusError:L,refetchIdVerificationStatus:M}),"notifications"===g&&(0,l.jsx)(eV,{user:w,refetch:F}),"company_admin_panel"===g&&(0,y.oFY)(b)&&(0,l.jsx)(ei,{}),"plan_billing"===g&&!(0,y.RS9)(b)&&(0,l.jsx)(A,{}),"mfa"===g&&(0,l.jsx)(eb,{}),"tweaks"===g&&(0,l.jsx)(eB,{}),O.isSocialPostingEnabled&&"social_posting_accounts"===g&&(0,l.jsx)(k,{}),!1]})]}),(0,l.jsx)(E.f,{children:(0,l.jsx)(n.Ay,{variant:"temporary",open:S,anch
1or:"left",onClose:()=>C(!1),hideBackdrop:!1,slotProps:{paper:{style:{position:"fixed",top:"".concat((0,y.hRn)(b)+(0,y.Gm)(),"px")}},backdrop:{style:{position:"fixed",top:"".concat((0,y.hRn)(b)+(0,y.Gm)(),"px")}}},ModalProps:{container:document.getElementById("myaccount-content"),style:{position:"fixed"},keepMounted:!0},sx:{"& .MuiDrawer-paper":{boxSizing:"border-box",width:280,backgroundColor:"rgba(0,0,0,0.9) !important"}},children:(0,l.jsxs)(r.A,{children:[(0,l.jsx)(o.Ay,{disablePadding:!0,children:(0,l.jsx)(c.A,{children:(0,l.jsx)(d.A,{primary:"My Account",className:"text-white"})})}),(0,l.jsx)(o.Ay,{disablePadding:!0,children:(0,l.jsx)(c.A,{onClick:()=>P("account_details"),children:(0,l.jsx)(d.A,{primary:"Account Details",className:"ps-3 "+("account_details"===g?"text-primary":"text-white")})})}),(0,l.jsx)(o.Ay,{disablePadding:!0,children:(0,l.jsx)(c.A,{onClick:()=>P("public_profile"),children:(0,l.jsx)(d.A,{primary:"Public Profile",className:"ps-3 "+("public_profile"===g?"text-primary":"text-white")})})}),(0,l.jsx)(o.Ay,{disablePadding:!0,children:(0,l.jsx)(c.A,{onClick:()=>P("user_preferences"),children:(0,l.jsx)(d.A,{primary:"User Preferences",className:"ps-3 "+("user_preferences"===g?"text-primary":"text-white")})})}),(0,l.jsx)(o.Ay,{disablePadding:!0,children:(0,l.jsx)(c.A,{onClick:()=>P("notifications"),children:(0,l.jsx)(d.A,{primary:"Notifications",className:"ps-3 "+("notifications"===g?"text-primary":"text-white")})})}),!(0,y.hQ)()&&!(0,y.RS9)(b)&&(0,l.jsx)(o.Ay,{disablePadding:!0,children:(0,l.jsx)(c.A,{onClick:()=>P("plan_billing"),children:(0,l.jsx)(d.A,{primary:"Plan & Billing Details",className:"ps-3 "+("plan_billing"===g?"text-primary":"text-white")})})}),(0,l.jsx)(o.Ay,{disablePadding:!0,children:(0,l.jsx)(c.A,{onClick:()=>P("mfa"),children:(0,l.jsx)(d.A,{primary:"Multi Factor Auth",className:"ps-3 "+("mfa"===g?"text-primary":"text-white")})})}),(0,y.oFY)(b)&&(0,l.jsx)(o.Ay,{disablePadding:!0,children:(0,l.jsx)(c.A,{onClick:()=>P("company_admin_panel"),children:(0,l.jsx)(d.A,{primary:"Company Admin Panel",className:"ps-3 "+("company_admin_panel"===g?"text-primary":"text-white")})})}),O.isSocialPostingEnabled&&(0,l.jsx)(o.Ay,{disablePadding:!0,children:(0,l.jsx)(c.A,{onClick:()=>P("social_posting_accounts"),children:(0,l.jsx)(d.A,{primary:"Social Posting Accounts",className:"ps-3 "+("social_posting_accounts"===g?"text-primary":"text-white")})})}),!1]})})})]})]}):(0,l.jsx)(eg.A,{})}},QM(e,t,s){var a=s("P"),l=s("qz"),i=s("X"),n=s("u"),r=s("JG"),o=s("MA"),c=s("TG"),d=s("S1"),m=s("Wf"),u=s("vS"),p=s("db"),h=s("Vi"),x=s("yN"),f=s("mOO"),j=s("x");let y={cursor:"pointer",border:0,width:"50px",height:"50px",fontSize:"24px",borderRadius:0,borderBottom:"3px solid #cbcbcb"};t.A=e=>{var t,s,b,v;
1let g=(0,x.A)(),[N,A]=(0,n.useState)(""),[w,_]=(0,n.useState)(!1),[S,C]=(0,n.useState)(null==(t=g.user)?void 0:t.phoneNumber),k=(0,r.n)({mutationFn:()=>{var t;return(0,j.XG6)({secret:null==(t=e.generatedSecret)?void 0:t.secret,mfa_type:"PHONE_OTP"})}}),E=(0,n.useRef)(!1);(0,n.useEffect)(()=>{S&&!E.current&&(k.mutate(),E.current=!0)},[]);let I=async()=>{k.mutate()},P=async()=>{if(S)try{var e;await p.Ay.putFormData("/v1/user/".concat(null==(e=g.user)?void 0:e.userId),{phone_number:S});let t=(0,j.gL$)();t&&(t.phoneNumber=S,localStorage.setItem("userData",JSON.stringify(t)),g.setUserData(t)),h.A.success("Phone number updated successfully."),k.mutate()}catch(e){h.A.alertableError((null==e?void 0:e.message)||"Error updating phone number")}},F=async()=>{try{if(N){var t;_(!0),await p.Ay.postFormData("/v1/mfa/verify",{secret:null==(t=e.generatedSecret)?void 0:t.secret,code:N,mfa_type:"PHONE_OTP"}),_(!1),e.handleClose("PHONE_OTP",!0)}}catch(e){h.A.userError("Invalid code"),_(!1)}};return w?(0,i.jsx)(d.A,{}):(0,i.jsxs)("div",{className:"container verify-dialog p-4",children:[(0,i.jsx)(o.A,{className:"close-icon text-white",onClick:()=>e.handleClose("PHONE_OTP"),children:(0,i.jsx)(c.A,{"data-testid":"CloseIcon",sx:{fontSize:30}})}),!(null==(s=g.user)?void 0:s.phoneNumber)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("h3",{className:"m-auto pb-1 text-center",children:"Update phone number"}),(0,i.jsx)("h6",{className:"pt-3 pb-3",children:"Please update phone number to proceed"}),(0,i.jsxs)("div",{children:[(0,i.jsx)(u.Ay,{className:"w-100 phone-input mb-1 mt-2 "+(S&&!(0,u.g0)(S)?"error":""),placeholder:"Enter phone",style:(0,l._)((0,a._)({},y),{fontSize:"16px"}),defaultCountry:"US",value:S,onChange:C}),S&&!(0,u.g0)(S)&&(0,i.jsx)(f.A,{children:"Invalid phone number"})]}),(0,i.jsx)("div",{className:"d-flex mt-3",children:(0,i.jsx)("button",{className:"btn btn-primary mb-3 px-3 text-white animated-text me-3 m-auto",disabled:!S||!(0,u.g0)(S),onClick:P,children:"Submit"})})]}),(null==(b=g.user)?void 0:b.phoneNumber)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("h3",{className:"m-auto pb-1 text-center",children:"Validate code"}),(0,i.jsxs)("h6",{className:"pt-3 pb-3",children:["Please enter code sent to phone"," ",(0,i.jsxs)(m.A,{sx:{fontWeight:"bold",display:"inline"},children:[" ",(0,j.kYg)(null==(v=g.user)?void 0:v.phoneNumber)]})]}),(0,i.jsx)("input",{type:"text",className:"form-control mb-3 mt-2",placeholder:"Enter code",onChange:e=>A(e.target.value)}),(0,i.jsxs)("div",{className:"d-flex mt-4 justify-content-center",children:[(0,i.jsx)("button",{className:"btn btn-primary mb-3 px-3 text-white animated-text me-3",onClick:I,children:"Resend Code"}),(0,i.jsx)("button",{className:"btn btn-primary mb-3 px-3 text-white animated-text me-3",disabled:!N||w,onClick:F,children:"Activate"})]})]})]})},s.d(t,{},{z:y})}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.