PageSourceSearch

https://www.scoredetect.com/_next/static/chunks/pages/dashboard/settings-1bdf554438ee5740.js

js scoredetect.com collected 2026-09-25 14:08:14 UTC 99,116 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6130],{20473:function(e,n,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/dashboard/settings",function(){return a(40618)}])},74496:function(e,n,a){"use strict";var c=a(85893),u=a(67294),p=a(93967),h=a.n(p);n.Z=e=>{let{title:n,description:a,footer:p,children:x,isCollapsed:y,onCollapseToggle:b,canCollapse:N=!0,badge:C}=e,[S,A]=(0,u.useState)(null!=y&&y);return(0,u.useEffect)(()=>{A(null!=y&&y)},[y]),(0,c.jsxs)("div",{className:"border border-base-300 max-w-3xl w-full rounded-md m-auto bg-white/50 backdrop-blur-xl",children:[(0,c.jsxs)("div",{className:"px-5 py-4",children:[(0,c.jsxs)("h3",{className:h()("text-2xl mb-1 font-medium flex items-center justify-between",{"cursor-pointer":N}),onClick:()=>{if(!N)return;let e=!S;A(e),b&&b(e)},children:[(0,c.jsxs)("div",{className:"flex items-center gap-2",children:[n,C&&(0,c.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded-full text-xs font-medium bg-blue-100 text-blue-800",children:C})]}),N&&(0,c.jsx)("svg",{className:"ml-2 h-4 w-4 transition-transform ".concat(S?"transform rotate-90":""),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 9l-7 7-7-7"})})]}),!S&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("p",{className:"base-300",children:a}),x]})]}),p&&(0,c.jsx)("div",{className:"border-t border-base-300 p-4 rounded-b-md",children:p})]})}},36657:function(e,n,a){"use strict";var c=a(85893),u=a(17871),p=a(9008),h=a.n(p),x=a(11163);n.Z=e=>{let{metadata:n}=e,a=(0,x.useRouter)(),{asPath:p}=a,y=(0,u.Ax)().replace(/\/$/,""),b="".concat(y).concat("/"===p?"":p),N={title:"ScoreDetect | Content, Brand, and Copyright Protection",description:"ScoreDetect protects your content, brand, and intellectual property. Learn more about our solutions for businesses, creators, and more.",cardImage:"".concat((0,u.Ax)(),"opengraph-image.png")},C={...N,...n};return(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)(h(),{children:[(0,c.jsx)("title",{children:C.title},"title"),C.robots&&(0,c.jsx)("meta",{name:"robots",content:C.robots},"robots"),(0,c.jsx)(()=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("link",{rel:"apple-touch-icon",sizes:"180x180",href:"/apple-touch-icon.png"},"apple-touch-icon"),(0,c.jsx)("link",{rel:"icon",type:"image/png",sizes:"32x32",href:"/favicon-32x32.png"},"favicon-32x32-".concat(a.asPath)),(0,c.jsx)("link",{rel:"icon",type:"image/png",sizes:"16x16",href:"/favicon-16x16.png"},"favicon-16x16-".concat(a.asPath)),(0,c.jsx)("link",{rel:"manifest",href:"/site.webmanifest"},"manifest"),(0,c.jsx)("meta",{name:"msapplication-TileColor",content:"#da532c"},"msapplication-TileColor")]}),{}),(0,c.jsx)("meta",{name:"theme-color",content:"#ffffff"},"theme-color"),(0,c.jsx)("link",{rel:"canonical",href:b}),(0,c.jsx)("meta",{name:"description",content:C.description},"description"),(0,c.jsx)("meta",{property:"og:url",content:"https://www.scoredetect.com".concat(a.asPath)},"og:url"),(0,c.jsx)("meta",{property:"og:type",content:"website"},"og:type"),(0,c.jsx)("meta",{property:"og:site_name",content:C.title},"og:site_name"),(0,c.jsx)("meta",{property:"og:description",content:C.description},"og:description"),(0,c.jsx)("meta",{property:"og:title",content:C.title},"og:title"),(0,c.jsx)("meta",{property:"og:image",content:C.cardImage},"og:image"),(0,c.jsx)("meta",{property:"og:image:type",content:"image/png"},"og:image:type"),(0,c.jsx)("meta",{property:"og:image:width",content:"1686"},"og:image:width"),(0,c.jsx)("meta",{property:"og:image:height",content:"882"},"og:image:height"),(0,c.jsx)("meta",{property:"og:locale",content:"en"}),(0,c.jsx)("meta",{name:"twitter:card",content:"summary_large_image"},"twitter:card"),(0,c.jsx)("meta",{name:"twitter:site",content:"@scoredetect"},"twitter:site"),(0,c.jsx)("meta",{name:"twitter:creator",content:"@scoredetect"},"twitter:creator"),(0,c.jsx)("meta",{name:"twitter:title",content:C.title},"twitter:title"),(0,c.jsx)("meta",{name:"twitter:description",content:C.description},"twitter:description"),(0,c.jsx)("meta",{name:"twitter:image",content:C.cardImage},"twitter:image")]})})}},47508:function(e,n,a){"use strict";a.d(n,{Z:function(){return components_SecurityQuestionSetup}});var c=a(85893),u=a(67294),p=a(11163),h=a(17871);let x=["What is your mother's maiden name?","What is the name of your first pet?","In what city were you born?","What was the name of your first school?","What was your childhood nickname?","What is the name of the street you grew up on?","What is your favorite book?","What was the make of your first car?","What is the name of your favorite childhood friend?","What is your favorite movie?"].map((e,n)=>({value:e,label:e,id:n+1}));var y=a(13713),components_SecurityQuestionSetup=e=>{let{onComplete:n,title:a="Set Up Security Question",description:b="This will help you recover your account if you lose access to your Multi-Factor Authentication (MFA) device."}=e,N=(0,p.useRouter)(),[C,S]=(0,u.useState)(""),[A,k]=(0,u.useState)(""),[E,_]=(0,u.useState)(!1),[D,R]=(0,u.useState)(""),handleSubmit=async e=>{if(e.preventDefault(),R(""),!C){R("Please select a security question.");return}if(!A.trim()){R("Please provide an answer to your security question.");return}if(A.trim().length<2){R("Security answer must be at least 2 characters long.");return}if(A.trim().length>100){R("Security answer must be less than 100 characters.");return}_(!0);try{let e=await (0,h.qC)({url:"/api/save-security-question",data:{question:C,answer:A.trim()}});if(e.error){R(e.error.message||"Failed to save security question.");return}(0,h.Cv)("Security question saved successfully"),n?n():N.push("/dashboard/certificates")}catch(e){(0,h.V3)("Error saving security question:",e),R("Failed to save security question. Please try again.")}finally{_(!1)}};return(0,c.jsxs)("div",{className:"max-w-md mx-auto p-6 bg-white rounded-lg shadow-md",children:[(0,c.jsxs)("div",{className:"text-center mb-6",children:[(0,c.jsx)("h2",{className:"text-2xl font-bold text-gray-900 mb-2",children:a}),(0,c.jsx)("p",{className:"text-gray-600",children:b})]}),(0,c.jsxs)("form",{onSubmit:handleSubmit,className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)("label",{htmlFor:"security-question",className:"block text-sm font-medium text-gray-700 mb-2",children:"Security Question"}),(0,c.jsxs)("select",{id:"security-question",value:C,onChange:e=>S(e.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-purple-500",required:!0,children:[(0,c.jsx)("option",{value:"",children:"Select a security question..."}),x.map(e=>(0,c.jsx)("option",{value:e.value,children:e.label},e.id))]})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)("label",{htmlFor:"security-answer",className:"block text-sm font-medium text-gray-700 mb-2",children:"Answer"}),(0,c.jsx)("input",{type:"text",id:"security-answer",value:A,onChange:e=>k(e.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-purple-500",placeholder:"Enter your answer",maxLength:100,required:!0}),(0,c.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Your answer is case-insensitive and will be securely stored."})]}),D&&(0,c.jsx)("div",{className:"text-red-600 text-sm bg-red-50 p-3 rounded-md",children:D}),(0,c.jsx)("button",{type:"submit",disabled:E,className:"w-full bg-purple-600 text-white py-2 px-4 roun
1ded-md hover:bg-purple-700 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:E?(0,c.jsx)("div",{className:"flex items-center justify-center",children:(0,c.jsx)(y.Z,{})}):"Save Security Question"})]}),(0,c.jsx)("div",{className:"mt-4 text-center",children:(0,c.jsx)("p",{className:"text-sm text-gray-500",children:"A Security question is required to help you recover your account if you lose access to your Multi-Factor Authentication (MFA) device."})})]})}},97205:function(e,n){"use strict";n.Z=e=>{let n=document.getElementById("toast-box");if(!n)return;let a=document.createElement("div");a.className="card card-body bg-base-100 shadow-lg transition-all duration-300 ease-in-out opacity-100 border border-base-300";let c=document.createElement("span");c.textContent=e,a.appendChild(c),n.appendChild(a),setTimeout(()=>{a.classList.add("opacity-0"),a.classList.remove("opacity-100"),setTimeout(()=>{a.remove()},300)},5e3)}},13713:function(e,n,a){"use strict";a.d(n,{Z:function(){return LoadingDots_LoadingDots}});var c=a(85893),u=a(7351),p=a.n(u),LoadingDots_LoadingDots=()=>(0,c.jsxs)("span",{className:p().root,children:[(0,c.jsx)("span",{}),(0,c.jsx)("span",{}),(0,c.jsx)("span",{})]})},40618:function(e,n,a){"use strict";a.r(n),a.d(n,{__N_SSP:function(){return $},default:function(){return Settings}});var c=a(85893),u=a(67294);let p={},h;function F(e={}){p={animate:!0,allowClose:!0,overlayClickBehavior:"close",overlayOpacity:.7,smoothScroll:!1,disableActiveInteraction:!1,showProgress:!1,stagePadding:10,stageRadius:5,popoverOffset:10,showButtons:["next","previous","close"],disableButtons:[],overlayColor:"#000",...e}}function s(e){return e?p[e]:p}let x={};function L(e){var n;null==(n=x[e])||n.call(x)}function O(e,n,a,c){return(e/=c/2)<1?a/2*e*e+n:-a/2*(--e*(e-2)-1)+n}function U(e){let n='a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])';return e.flatMap(e=>{let a=e.matches(n),c=Array.from(e.querySelectorAll(n));return[...a?[e]:[],...c]}).filter(e=>"none"!==getComputedStyle(e).pointerEvents&&!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length))}function ee(e){if(!e||function(e){let n=e.getBoundingClientRect();return n.top>=0&&n.left>=0&&n.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&n.right<=(window.innerWidth||document.documentElement.clientWidth)}(e))return;let n=s("smoothScroll"),a=e.offsetHeight>window.innerHeight;e.scrollIntoView({behavior:!n||function(e){if(!e||!e.parentElement)return;let n=e.parentElement;return n.scrollHeight>n.clientHeight}(e)?"auto":"smooth",inline:"center",block:a?"start":"center"})}let y={};function l(e){return e?y[e]:y}function te(e){if(!e)return;let n=e.getBoundingClientRect(),a={x:n.x,y:n.y,width:n.width,height:n.height};y.__activeStagePosition=a,oe(a)}function oe(e){let n=l("__overlaySvg");if(!n){!function(e){let n=function(e){let n=window.innerWidth,a=window.innerHeight,c=document.createElementNS("http://www.w3.org/2000/svg","svg");c.classList.add("driver-overlay","driver-overlay-animated"),c.setAttribute("viewBox",`0 0 ${n} ${a}`),c.setAttribute("xmlSpace","preserve"),c.setAttribute("xmlnsXlink","http://www.w3.org/1999/xlink"),c.setAttribute("version","1.1"),c.setAttribute("preserveAspectRatio","xMinYMin slice"),c.style.fillRule="evenodd",c.style.clipRule="evenodd",c.style.strokeLinejoin="round",c.style.strokeMiterlimit="2",c.style.zIndex="10000",c.style.position="fixed",c.style.top="0",c.style.left="0",c.style.width="100%",c.style.height="100%";let u=document.createElementNS("http://www.w3.org/2000/svg","path");return u.setAttribute("d",ie(e)),u.style.fill=s("overlayColor")||"rgb(0,0,0)",u.style.opacity=`${s("overlayOpacity")}`,u.style.pointerEvents="auto",u.style.cursor="auto",c.appendChild(u),c}(e);document.body.appendChild(n),re(n,e=>{"path"===e.target.tagName&&L("overlayClick")}),y.__overlaySvg=n}(e);return}let a=n.firstElementChild;if((null==a?void 0:a.tagName)!=="path")throw Error("no path element found in stage svg");a.setAttribute("d",ie(e))}function ie(e){let n=window.innerWidth,a=window.innerHeight,c=s("stagePadding")||0,u=s("stageRadius")||0,p=e.width+2*c,h=e.height+2*c,x=Math.floor(Math.max(Math.min(u,p/2,h/2),0)),y=e.x-c+x,b=e.y-c,N=p-2*x,C=h-2*x;return`M${n},0L0,0L0,${a}L${n},${a}L${n},0Z
2    M${y},${b} h${N} a${x},${x} 0 0 1 ${x},${x} v${C} a${x},${x} 0 0 1 -${x},${x} h-${N} a${x},${x} 0 0 1 -${x},-${x} v-${C} a${x},${x} 0 0 1 ${x},-${x} z`}function j(e){let{element:n}=e,a="function"==typeof n?n():"string"==typeof n?document.querySelector(n):n;a||(a=function(){let e=document.getElementById("driver-dummy-element");
2if(e)return e;let n=document.createElement("div");return n.id="driver-dummy-element",n.style.width="0",n.style.height="0",n.style.pointerEvents="none",n.style.opacity="0",n.style.position="fixed",n.style.top="50%",n.style.left="50%",document.body.appendChild(n),n}()),function(e,n){var a;let c=Date.now(),u=l("__activeStep"),p=l("__activeElement")||e,x=!p||p===e,b="driver-dummy-element"===e.id,N="driver-dummy-element"===p.id,C=s("animate"),S=n.onHighlightStarted||s("onHighlightStarted"),A=(null==n?void 0:n.onHighlighted)||s("onHighlighted"),k=(null==u?void 0:u.onDeselected)||s("onDeselected"),E=s(),_=l();!x&&k&&k(N?void 0:p,u,{config:E,state:_,driver:h}),S&&S(b?void 0:e,n,{config:E,state:_,driver:h});let D=!x&&C,R=!1;(function(){let e=l("popover");e&&(e.wrapper.style.display="none")})(),y.previousStep=u,y.previousElement=p,y.activeStep=n,y.activeElement=e;let m=()=>{if(l("__transitionCallback")!==m)return;let a=Date.now()-c,x=400-a<=200;n.popover&&x&&!R&&D&&(Q(e,n),R=!0),s("animate")&&a<400?function(e,n,a,c){var u;let p=l("__activeStagePosition"),h=p||a.getBoundingClientRect(),x=c.getBoundingClientRect(),b=O(e,h.x,x.x-h.x,n),N=O(e,h.y,x.y-h.y,n),C=O(e,h.width,x.width-h.width,n),S=O(e,h.height,x.height-h.height,n);oe(p={x:b,y:N,width:C,height:S}),u=p,y.__activeStagePosition=u}(a,400,p,e):(te(e),A&&A(b?void 0:e,n,{config:s(),state:l(),driver:h}),y.__transitionCallback=void 0,y.__previousStep=u,y.__previousElement=p,y.__activeStep=n,y.__activeElement=e),window.requestAnimationFrame(m)};y.__transitionCallback=m,window.requestAnimationFrame(m),ee(e),!D&&n.popover&&Q(e,n),p.classList.remove("driver-active-element","driver-no-interaction"),p.removeAttribute("aria-haspopup"),p.removeAttribute("aria-expanded"),p.removeAttribute("aria-controls"),(null!=(a=n.disableActiveInteraction)?a:s("disableActiveInteraction"))&&e.classList.add("driver-no-interaction"),e.classList.add("driver-active-element"),e.setAttribute("aria-haspopup","dialog"),e.setAttribute("aria-expanded","true"),e.setAttribute("aria-controls","driver-popover-content")}(a,e)}function xe(){let e=l("__activeElement"),n=l("__activeStep");e&&(te(e),function(){let e=l("__activeStagePosition"),n=l("__overlaySvg");if(!e)return;if(!n){console.warn("No stage svg found.");return}let a=window.innerWidth,c=window.innerHeight;n.setAttribute("viewBox",`0 0 ${a} ${c}`)}(),ae(e,n))}function M(){var e;let n=l("__resizeTimeout");n&&window.cancelAnimationFrame(n),e=window.requestAnimationFrame(xe),y.__resizeTimeout=e}function Pe(e){var n;if(!l("isInitialized")||!("Tab"===e.key||9===e.keyCode))return;let a=l("__activeElement"),c=null==(n=l("popover"))?void 0:n.wrapper,u=U([...c?[c]:[],...a?[a]:[]]),p=u[0],h=u[u.length-1];if(e.preventDefault(),e.shiftKey){let e=u[u.indexOf(document.activeElement)-1]||h;null==e||e.focus()}else{let e=u[u.indexOf(document.activeElement)+1]||p;null==e||e.focus()}}function ne(e){var n;(null==(n=s("allowKeyboardControl"))||n)&&("Escape"===e.key?L("escapePress"):"ArrowRight"===e.key?L("arrowRightPress"):"ArrowLeft"===e.key&&L("arrowLeftPress"))}function re(e,n,a){let i=(n,c)=>{let u=n.target;e.contains(u)&&((!a||a(u))&&(n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation()),null==c||c(n))};document.addEventListener("pointerdown",i,!0),document.addEventListener("mousedown",i,!0),document.addEventListener("pointerup",i,!0),document.addEventListener("mouseup",i,!0),document.addEventListener("click",e=>{i(e,n)},!0)}function Q(e,n){var a,c,u;let p=l("popover");p&&document.body.removeChild(p.wrapper),p=function(){let e=document.createElement("div");e.classList.add("driver-popover");let n=document.createElement("div");n.classList.add("driver-popover-arrow");let a=document.createElement("header");a.id="driver-popover-title",a.classList.add("driver-popover-title"),a.style.display="none",a.innerText="Popover Title";let c=document.createElement("div");c.id="driver-popover-description",c.classList.add("driver-popover-description"),c.style.display="none",c.innerText="Popover description is here";let u=document.createElement("button");u.type="button",u.classList.add("driver-popover-close-btn"),u.setAttribute("aria-label","Close"),u.innerHTML="&times;";let p=document.createElement("footer");p.classList.add("driver-popover-footer");let h=document.createElement("span");h.classList.add("driver-popover-progress-text"),h.innerText="";let x=document.createElement("span");x.classList.add("driver-popover-navigation-btns");let y=document.createElement("button");y.type="button",y.classList.add("driver-popover-prev-btn"),y.innerHTML="&larr; Previous";let b=document.createElement("button");return b.type="button",b.classList.add("driver-popover-next-btn"),b.innerHTML="Next &rarr;",x.appendChild(y),x.appendChild(b),p.appendChild(h),p.appendChild(x),e.appendChild(u),e.appendChild(n),e.appendChild(a),e.appendChild(c),e.appendChild(p),{wrapper:e,arrow:n,title:a,description:c,footer:p,previousButton:y,nextButton:b,closeButton:u,footerButtons:x,progress:h}}(),document.body.appendChild(p.wrapper);let{title:x,description:b,showButtons:N,disableButtons:C,showProgress:S,nextBtnText:A=s("nextBtnText")||"Next &rarr;",prevBtnText:k=s("prevBtnText")||"&larr; Previous",progressText:E=s("progressText")||"{current} of {total}"}=n.popover||{};p.nextButton.innerHTML=A,p.previousButton.innerHTML=k,p.progress.innerHTML=E,x?(p.title.innerHTML=x,p.title.style.display="block"):p.title.style.display="none",b?(p.description.innerHTML=b,p.description.style.display="block"):p.description.style.display="none";let _=N||s("showButtons"),D=S||s("showProgress")||!1,R=(null==_?void 0:_.includes("next"))||(null==_?void 0:_.includes("previous"))||D;p.closeButton.style.display=_.includes("close")?"block":"none",R?(p.footer.style.display="flex",p.progress.style.display=D?"block":"none",p.nextButton.style.display=_.includes("next")?"block":"none",p.previousButton.style.display=_.includes("previous")?"block":"none"):p.footer.style.display="none";let P=C||s("disableButtons")||[];null!=P&&P.includes("next")&&(p.nextButton.disabled=!0,p.nextButton.classList.add("driver-popover-btn-disabled")),null!=P&&P.includes("previous")&&(p.previousButton.disabled=!0,p.previousButton.classList.add("driver-popover-btn-disabled")),null!=P&&P.includes("close")&&(p.closeButton.disabled=!0,p.closeButton.classList.add("driver-popover-btn-disabled"));let T=p.wrapper;T.style.display="block",T.style.left="",T.style.top="",T.style.bottom="",T.style.right="",T.id="driver-popover-content",T.setAttribute("role","dialog"),T.setAttribute("aria-labelledby","driver-popover-title"),T.setAttribute("aria-describedby","driver-popover-description");let I=p.arrow;I.className="driver-popover-arrow";let q=(null==(a=n.popover)?void 0:a.popoverClass)||s("popoverClass")||"";T.className=`driver-popover ${q}`.trim(),re(p.wrapper,a=>{var c,u,p;let x=a.target,y=(null==(c=n.popover)?void 0:c.onNextClick)||s("onNextClick"),b=(null==(u=n.popover)?void 0:u.onPrevClick)||s("onPrevClick"),N=(null==(p=n.popover)?void 0:p.onCloseClick)||s("onCloseClick");return x.closest(".driver-popover-next-btn")?y?y(e,n,{config:s(),state:l(),driver:h}):L("nextClick"):x.closest(".driver-popover-prev-btn")?b?b(e,n,{config:s(),state:l(),driver:h}):L("prevClick"):x.closest(".driver-popover-close-btn")?N?N(e,n,{config:s(),state:l(),driver:h}):L("closeClick"):void 0},e=>!(null!=p&&p.description.contains(e))&&!(null!=p&&p.title.contains(e))&&"string"==typeof e.className&&e.className.includes("driver-popover")),u=p,y.popover=u;
2let B=(null==(c=n.popover)?void 0:c.onPopoverRender)||s("onPopoverRender");B&&B(p,{config:s(),state:l(),driver:h}),ae(e,n),ee(T);let H=e.classList.contains("driver-dummy-element"),W=U([T,...H?[]:[e]]);W.length>0&&W[0].focus()}function se(){let e=l("popover");if(!(null!=e&&e.wrapper))return;let n=e.wrapper.getBoundingClientRect(),a=s("stagePadding")||0,c=s("popoverOffset")||0;return{width:n.width+a+c,height:n.height+a+c,realWidth:n.width,realHeight:n.height}}function Z(e,n){let{elementDimensions:a,popoverDimensions:c,popoverPadding:u,popoverArrowDimensions:p}=n;return"start"===e?Math.max(Math.min(a.top-u,window.innerHeight-c.realHeight-p.width),p.width):"end"===e?Math.max(Math.min(a.top-(null==c?void 0:c.realHeight)+a.height+u,window.innerHeight-(null==c?void 0:c.realHeight)-p.width),p.width):"center"===e?Math.max(Math.min(a.top+a.height/2-(null==c?void 0:c.realHeight)/2,window.innerHeight-(null==c?void 0:c.realHeight)-p.width),p.width):0}function G(e,n){let{elementDimensions:a,popoverDimensions:c,popoverPadding:u,popoverArrowDimensions:p}=n;return"start"===e?Math.max(Math.min(a.left-u,window.innerWidth-c.realWidth-p.width),p.width):"end"===e?Math.max(Math.min(a.left-(null==c?void 0:c.realWidth)+a.width+u,window.innerWidth-(null==c?void 0:c.realWidth)-p.width),p.width):"center"===e?Math.max(Math.min(a.left+a.width/2-(null==c?void 0:c.realWidth)/2,window.innerWidth-(null==c?void 0:c.realWidth)-p.width),p.width):0}function ae(e,n){let a=l("popover");if(!a)return;let{align:c="start",side:u="left"}=(null==n?void 0:n.popover)||{},p="driver-dummy-element"===e.id?"over":u,h=s("stagePadding")||0,x=se(),y=a.arrow.getBoundingClientRect(),b=e.getBoundingClientRect(),N=b.top-x.height,C=N>=0,S=window.innerHeight-(b.bottom+x.height),A=S>=0,k=b.left-x.width,E=k>=0,_=window.innerWidth-(b.right+x.width),D=_>=0,R=!C&&!A&&!E&&!D,P=p;if("top"===p&&C?D=E=A=!1:"bottom"===p&&A?D=E=C=!1:"left"===p&&E?D=C=A=!1:"right"===p&&D&&(E=C=A=!1),"over"===p){let e=window.innerWidth/2-x.realWidth/2,n=window.innerHeight/2-x.realHeight/2;a.wrapper.style.left=`${e}px`,a.wrapper.style.right="auto",a.wrapper.style.top=`${n}px`,a.wrapper.style.bottom="auto"}else if(R){let e=window.innerWidth/2-(null==x?void 0:x.realWidth)/2;a.wrapper.style.left=`${e}px`,a.wrapper.style.right="auto",a.wrapper.style.bottom="10px",a.wrapper.style.top="auto"}else if(E){let e=Math.min(k,window.innerWidth-(null==x?void 0:x.realWidth)-y.width),n=Z(c,{elementDimensions:b,popoverDimensions:x,popoverPadding:h,popoverArrowDimensions:y});a.wrapper.style.left=`${e}px`,a.wrapper.style.top=`${n}px`,a.wrapper.style.bottom="auto",a.wrapper.style.right="auto",P="left"}else if(D){let e=Math.min(_,window.innerWidth-(null==x?void 0:x.realWidth)-y.width),n=Z(c,{elementDimensions:b,popoverDimensions:x,popoverPadding:h,popoverArrowDimensions:y});a.wrapper.style.right=`${e}px`,a.wrapper.style.top=`${n}px`,a.wrapper.style.bottom="auto",a.wrapper.style.left="auto",P="right"}else if(C){let e=Math.min(N,window.innerHeight-x.realHeight-y.width),n=G(c,{elementDimensions:b,popoverDimensions:x,popoverPadding:h,popoverArrowDimensions:y});a.wrapper.style.top=`${e}px`,a.wrapper.style.left=`${n}px`,a.wrapper.style.bottom="auto",a.wrapper.style.right="auto",P="top"}else if(A){let e=Math.min(S,window.innerHeight-(null==x?void 0:x.realHeight)-y.width),n=G(c,{elementDimensions:b,popoverDimensions:x,popoverPadding:h,popoverArrowDimensions:y});a.wrapper.style.left=`${n}px`,a.wrapper.style.bottom=`${e}px`,a.wrapper.style.top="auto",a.wrapper.style.right="auto",P="bottom"}R?a.arrow.classList.add("driver-popover-arrow-none"):function(e,n,a){let c=l("popover");if(!c)return;let u=a.getBoundingClientRect(),p=se(),h=c.arrow,x=p.width,y=window.innerWidth,b=u.width,N=u.left,C=p.height,S=window.innerHeight,A=u.top,k=u.height;h.className="driver-popover-arrow";let E=n,_=e;if("top"===n?(N+b<=0?(E="right",_="end"):N+b-x<=0&&(E="top",_="start"),N>=y?(E="left",_="end"):N+x>=y&&(E="top",_="end")):"bottom"===n?(N+b<=0?(E="right",_="start"):N+b-x<=0&&(E="bottom",_="start"),N>=y?(E="left",_="start"):N+x>=y&&(E="bottom",_="end")):"left"===n?(A+k<=0?(E="bottom",_="end"):A+k-C<=0&&(E="left",_="start"),A>=S?(E="top",_="end"):A+C>=S&&(E="left",_="end")):"right"===n&&(A+k<=0?(E="bottom",_="start"):A+k-C<=0&&(E="right",_="start"),A>=S?(E="top",_="start"):A+C>=S&&(E="right",_="end")),E){h.classList.add(`driver-popover-arrow-side-${E}`),h.classList.add(`driver-popover-arrow-align-${_}`);let e=a.getBoundingClientRect(),u=h.getBoundingClientRect(),p=s("stagePadding")||0,x=e.left-p<window.innerWidth&&e.right+p>0&&e.top-p<window.innerHeight&&e.bottom+p>0;"bottom"===n&&x&&(u.x>e.x&&u.x+u.width<e.x+e.width?c.wrapper.style.transform="translateY(0)":(h.classList.remove(`driver-popover-arrow-align-${_}`),h.classList.add("driver-popover-arrow-none"),c.wrapper.style.transform=`translateY(-${p/2}px)`))}else h.classList.add("driver-popover-arrow-none")}(c,P,e)}function Ae(e={}){function o(){s("allowClose")&&g()}function t(){let e=s("overlayClickBehavior");if(s("allowClose")&&"close"===e){g();return}"nextStep"===e&&i()}function i(){let e=l("activeIndex"),n=s("steps")||[];if(void 0===e)return;let a=e+1;n[a]?v(a):g()}function d(){let e=l("activeIndex"),n=s("steps")||[];if(void 0===e)return;let a=e-1;n[a]?v(a):g()}function f(){var e;if(l("__transitionCallback"))return;let n=l("activeIndex"),a=l("__activeStep"),c=l("__activeElement");
2if(void 0===n||void 0===a||void 0===l("activeIndex"))return;let u=(null==(e=a.popover)?void 0:e.onPrevClick)||s("onPrevClick");if(u)return u(c,a,{config:s(),state:l(),driver:h});d()}function w(){var e;if(l("__transitionCallback"))return;let n=l("activeIndex"),a=l("__activeStep"),c=l("__activeElement");if(void 0===n||void 0===a)return;let u=(null==(e=a.popover)?void 0:e.onNextClick)||s("onNextClick");if(u)return u(c,a,{config:s(),state:l(),driver:h});i()}function r(){l("isInitialized")||(y.isInitialized=!0,document.body.classList.add("driver-active",s("animate")?"driver-fade":"driver-simple"),window.addEventListener("keyup",ne,!1),window.addEventListener("keydown",Pe,!1),window.addEventListener("resize",M),window.addEventListener("scroll",M),x.overlayClick=t,x.escapePress=o,x.arrowLeftPress=f,x.arrowRightPress=w)}function v(e=0){var n,a,c,u,p,h,x,b,N;let C=s("steps");if(!C){console.error("No steps to drive through"),g();return}if(!C[e]){g();return}N=document.activeElement,y.__activeOnDestroyed=N,y.activeIndex=e;let S=C[e],A=C[e+1],k=C[e-1],E=(null==(n=S.popover)?void 0:n.doneBtnText)||s("doneBtnText")||"Done",_=s("allowClose"),D=void 0!==(null==(a=S.popover)?void 0:a.showProgress)?null==(c=S.popover)?void 0:c.showProgress:s("showProgress"),R=((null==(u=S.popover)?void 0:u.progressText)||s("progressText")||"{{current}} of {{total}}").replace("{{current}}",`${e+1}`).replace("{{total}}",`${C.length}`),P=(null==(p=S.popover)?void 0:p.showButtons)||s("showButtons"),T=["next","previous",..._?["close"]:[]].filter(e=>!(null!=P&&P.length)||P.includes(e)),I=(null==(h=S.popover)?void 0:h.onNextClick)||s("onNextClick"),q=(null==(x=S.popover)?void 0:x.onPrevClick)||s("onPrevClick"),B=(null==(b=S.popover)?void 0:b.onCloseClick)||s("onCloseClick");j({...S,popover:{showButtons:T,nextBtnText:A?void 0:E,disableButtons:[...k?[]:["previous"]],showProgress:D,progressText:R,onNextClick:I||(()=>{A?v(e+1):g()}),onPrevClick:q||(()=>{v(e-1)}),onCloseClick:B||(()=>{g()}),...(null==S?void 0:S.popover)||{}}})}function g(e=!0){var n;let a=l("__activeElement"),c=l("__activeStep"),u=l("__activeOnDestroyed"),p=s("onDestroyStarted");if(e&&p){let e=!a||(null==a?void 0:a.id)==="driver-dummy-element";p(e?void 0:a,c,{config:s(),state:l(),driver:h});return}let b=(null==c?void 0:c.onDeselected)||s("onDeselected"),N=s("onDestroyed");if(document.body.classList.remove("driver-active","driver-fade","driver-simple"),window.removeEventListener("keyup",ne),window.removeEventListener("resize",M),window.removeEventListener("scroll",M),function(){var e;let n=l("popover");n&&(null==(e=n.wrapper.parentElement)||e.removeChild(n.wrapper))}(),null==(n=document.getElementById("driver-dummy-element"))||n.remove(),document.querySelectorAll(".driver-active-element").forEach(e=>{e.classList.remove("driver-active-element","driver-no-interaction"),e.removeAttribute("aria-haspopup"),e.removeAttribute("aria-expanded"),e.removeAttribute("aria-controls")}),function(){let e=l("__overlaySvg");e&&e.remove()}(),x={},y={},a&&c){let e="driver-dummy-element"===a.id;b&&b(e?void 0:a,c,{config:s(),state:l(),driver:h}),N&&N(e?void 0:a,c,{config:s(),state:l(),driver:h})}u&&u.focus()}F(e);let n={isActive:()=>l("isInitialized")||!1,refresh:M,drive:(e=0)=>{r(),v(e)},setConfig:F,setSteps:e=>{y={},F({...s(),steps:e})},getConfig:s,getState:l,getActiveIndex:()=>l("activeIndex"),isFirstStep:()=>0===l("activeIndex"),isLastStep:()=>{let e=s("steps")||[],n=l("activeIndex");return void 0!==n&&n===e.length-1},getActiveStep:()=>l("activeStep"),getActiveElement:()=>l("activeElement"),getPreviousElement:()=>l("previousElement"),getPreviousStep:()=>l("previousStep"),moveNext:i,movePrevious:d,moveTo:function(e){(s("steps")||[])[e]?v(e):g()},hasNextStep:()=>{let e=s("steps")||[],n=l("activeIndex");return void 0!==n&&!!e[n+1]},hasPreviousStep:()=>{let e=s("steps")||[],n=l("activeIndex");return void 0!==n&&!!e[n-1]},highlight:e=>{r(),j({...e,popover:e.popover?{showButtons:[],showProgress:!1,progressText:"",...e.popover}:void 0})},destroy:()=>{g(!1)}};return h=n,n}var b=a(74496),N=a(55922),C=a(17871),S=a(11163),A=a(84053),k=a(36657),E=a(97205),_=a(25675),D=a.n(_),R=a(13713),P=a(58192),T=a(41664),I=a.n(T),q=a(19692),B=a(12002);function EnrollMFA(e){let{onEnrolled:n,onCancelled:a,onError:p,onCompleteSetupVisible:h}=e,[x,y]=(0,u.useState)(""),[b,N]=(0,u.useState)(""),[S,A]=(0,u.useState)(""),[k,_]=(0,u.useState)(""),[D,P]=(0,u.useState)(""),[T,I]=(0,u.useState)(!1),[q,B]=(0,u.useState)(!0),[H,W]=(0,u.useState)(!1),[Y,z]=(0,u.useState)(!1),[$,V]=(0,u.useState)(""),[K,X]=(0,u.useState)(!1),[J,et]=(0,u.useState)(!1),[er,es]=(0,u.useState)(!1),[en,ea]=(0,u.useState)(!1),eo=(0,u.useRef)(!1),ei=(0,u.useRef)(null),el=(0,u.useRef)(!1);(0,u.useEffect)(()=>{y(""),N(""),A(""),_(""),P(""),I(!1),B(!0),W(!1),z(!1),V(""),X(!1),et(!1),es(!1),ea(!1),eo.current=!1,ei.current=null,el.current=!1},[]);let onEnableClicked=async()=>
2{if(!k.trim()){P("Please enter a verification code.");return}if(!er){P(""),I(!0);try{var e;let a=await (0,C.qC)({url:"/api/mfa/challenge",data:{factorId:x}});if(er)return;if(a.error)throw Error(a.error.message);let c=a.data.id,u=await (0,C.qC)({url:"/api/mfa/verify-enrollment",data:{factorId:x,challengeId:c,code:k.trim()}});if(er)return;if(u.error)throw Error(u.error.message);(null===(e=u.data)||void 0===e?void 0:e.recoveryCode)?(V(u.data.recoveryCode),X(!0),ea(!0),setTimeout(()=>{var e;if(!er&&(null===(e=u.data)||void 0===e?void 0:e.recoveryCode))try{let e=u.data.recoveryCode,n=createRecoveryCodeInstructions(e),a=new Blob([n],{type:"text/plain"}),c=URL.createObjectURL(a),p=document.createElement("a");p.href=c;let h=new Date,pad=e=>e.toString().padStart(2,"0"),x="".concat(h.getFullYear()).concat(pad(h.getMonth()+1)).concat(pad(h.getDate()),"_").concat(pad(h.getHours())).concat(pad(h.getMinutes())).concat(pad(h.getSeconds()));p.download="mfa-recovery-code-scoredetect-".concat(x,".txt"),document.body.appendChild(p),p.click(),document.body.removeChild(p),URL.revokeObjectURL(c),(0,E.Z)("✅ Recovery code with instructions automatically downloaded! Keep it safe.")}catch(e){(0,E.Z)("⚠️ Recovery code generated but auto-download failed. Please download manually.")}},500)):er||(ea(!0),n())}catch(e){if(!er){let n=e.message||"Failed to verify MFA code.";P(n),p&&p(n)}}finally{er||I(!1)}}};(0,u.useEffect)(()=>{let e=!0,enrollMFA=async()=>{er||!e||eo.current||ei.current||el.current||(eo.current=!0,ei.current=(async()=>{try{B(!0),P("");let n=await (0,C.qC)({url:"/api/mfa/enroll",data:{}});if(er||!e)return;if(n.error){if(n.error.message.includes("Existing MFA factors detected")||n.error.message.includes("MFA is already enabled"))throw Error('MFA is already set up. Please use the "Reset MFA" option in settings to start fresh.');throw Error(n.error.message)}if(er||!e)return;y(n.data.id),N(n.data.totp.qr_code),A(n.data.totp.secret)}catch(a){if(er||!e)return;let n=a.message||"Failed to start MFA enrollment. Please try again.";P(n),p&&p(n)}finally{!er&&e&&B(!1),ei.current=null}})(),await ei.current)};return enrollMFA(),()=>{e=!1,es(!0)}},[]),(0,u.useEffect)(()=>{K&&h&&setTimeout(()=>{h()},100)},[K,h]);let handleCopySecret=async()=>{try{await navigator.clipboard.writeText(S),z(!0),(0,E.Z)("Secret copied!"),setTimeout(()=>{z(!1)},2e3)}catch(e){(0,E.Z)("Failed to copy secret")}},handleCopyRecoveryCode=async()=>{try{await navigator.clipboard.writeText($),et(!0),(0,E.Z)("Recovery code copied!"),setTimeout(()=>{et(!1)},2e3)}catch(e){(0,E.Z)("Failed to copy recovery code")}},createRecoveryCodeInstructions=e=>"SCOREDETECT MFA RECOVERY CODE\n=====================================\n\nIMPORTANT: Keep this file secure and treat it like a password!\n\nWHAT IS THIS RECOVERY CODE?\nThis recovery code is your backup method to access your ScoreDetect account if you lose access to your Multi-Factor Authentication (MFA) device (like your phone with the authenticator app).\n\nYOUR RECOVERY CODE:\n".concat(e,'\n\nSECURITY INSTRUCTIONS:\n• Store this file in a secure location (password manager, encrypted drive, or safe physical location)\n• Do NOT share this code with anyone - treat it like your password\n• Do NOT store this file in unsecured locations (desktop, email drafts, cloud storage without encryption)\n• This code can only be used ONCE - after using it, you\'ll need to generate a new one\n• If you suspect this code has been compromised, generate a new recovery code immediately\n\nWHEN TO USE THIS CODE:\n• When you lose or break your phone with the authenticator app\n• When you can\'t access your MFA device for any reason\n• As a last resort to regain access to your account\n\nHOW TO USE THIS CODE:\n1. Go to the ScoreDetect login page\n2. Enter your email and password\n3. When prompted for MFA, look for "Use recovery code" or "Lost your device?" option\n4. Enter the recovery code above: ').concat(e,"\n5. After successful login, immediately set up a new MFA device and generate a new recovery code\n\nIMPORTANT NOTES:\n• This recovery code was generated on: ").concat(new Date().toLocaleStr
2ing(),"\n• Each recovery code can only be used once\n• After using this code, you must generate a new one for future use\n• Keep this file updated - old recovery codes become invalid when new ones are generated\n\nNEED HELP?\nIf you have trouble using this recovery code or need assistance, contact our support team.\n\nGenerated by ScoreDetect Security System\nhttps://scoredetect.com"),handleDownloadRecoveryCode=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=createRecoveryCodeInstructions($),a=new Blob([n],{type:"text/plain"}),c=URL.createObjectURL(a),u=document.createElement("a");u.href=c;let p=new Date,pad=e=>e.toString().padStart(2,"0"),h="".concat(p.getFullYear()).concat(pad(p.getMonth()+1)).concat(pad(p.getDate()),"_").concat(pad(p.getHours())).concat(pad(p.getMinutes())).concat(pad(p.getSeconds()));u.download="mfa-recovery-code-scoredetect-".concat(h,".txt"),document.body.appendChild(u),u.click(),document.body.removeChild(u),URL.revokeObjectURL(c),e||(0,E.Z)("Recovery code with instructions downloaded!")};return q?(0,c.jsxs)("div",{className:"flex flex-col items-center justify-center p-8 space-y-4",children:[(0,c.jsx)(R.Z,{}),(0,c.jsx)("p",{className:"text-sm text-gray-600",children:"Setting up MFA enrollment..."}),(0,c.jsx)("p",{className:"text-xs text-gray-500",children:"Please wait while we prepare your MFA setup..."})]}):D?(0,c.jsxs)("div",{className:"max-w-md mx-auto p-6 bg-white rounded-lg shadow-lg border border-gray-200",children:[(0,c.jsxs)("div",{className:"text-center mb-6",children:[(0,c.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:"MFA Setup Error"}),(0,c.jsx)("p",{className:"text-sm text-gray-600",children:"There was an issue setting up MFA. Please try again."})]}),(0,c.jsx)("div",{className:"mb-4 p-3 bg-red-50 border border-red-200 rounded-md",children:(0,c.jsx)("p",{className:"text-sm text-red-600",children:D})}),(0,c.jsxs)("div",{className:"flex space-x-3",children:[(0,c.jsx)("button",{type:"button",onClick:()=>{P(""),B(!0),es(!1),y(""),N(""),A(""),_("")},className:"flex-1 px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",children:"Try Again"}),(0,c.jsx)("button",{type:"button",onClick:()=>{es(!0),a()},className:"px-4 py-2 border border-gray-300 text-gray-700 rounded-md hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-gray-500 focus:ring-offset-2",children:"Cancel"})]})]}):K?(0,c.jsxs)("div",{className:"max-w-md mx-auto p-6 bg-white rounded-lg shadow-lg border border-gray-200",children:[(0,c.jsxs)("div",{className:"text-center mb-6",children:[(0,c.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:"✅ MFA Setup Complete!"}),(0,c.jsx)("p",{className:"text-sm text-gray-600",children:"Store this recovery code in a safe place - you can use it to access your account if you lose your authenticator device."})]}),(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Recovery Code"}),(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("code",{className:"flex-1 p-3 bg-gray-100 text-lg font-mono rounded border text-center tracking-wider",children:$}),(0,c.jsxs)("div",{className:"flex space-x-2",children:[(0,c.jsx)("button",{type:"button",onClick:handleCopyRecoveryCode,className:"px-3 py-2 text-sm rounded transition-all duration-200 ".concat(J?"bg-green-500 text-white focus:ring-2 focus:ring-green-500 focus:ring-offset-2":"bg-gray-100 hover:bg-gray-200 focus:ring-2 focus:ring-gray-500 focus:ring-offset-2 border border-gray-300"),children:J?"Copied!":"Copy"}),(0,c.jsx)("button",{type:"button",onClick:()=>{handleDownloadRecoveryCode(!1)},className:"px-3 py-2 text-sm text-gray-600 bg-gray-100 border border-gray-300 rounded-md hover:bg-gray-200 hover:text-gray-700 focus:outline-none focus:ring-1 focus:ring-gray-400 focus:ring-offset-1 transition-colors duration-200",children:"\uD83D\uDCE5 Download"})]})]}),(0,c.jsx)("p",{className:"text-xs text-gray-500",children:"Click the copy button or download button to save your recovery code."})]}),(0,c.jsx)("div",{className:"p-4 bg-yellow-50 border border-yellow-200 rounded-md",children:(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("div",{className:"flex-shrink-0",children:(0,c.jsx)("svg",{className:"h-5 w-5 text-yellow-400",viewBox:"0 0 20 20",fill:"currentColor",children:(0,c.jsx)("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})})}),(0,c.jsxs)("div",{className:"ml-3",children:[(0,c.jsx)("h3",{className:"text-sm font-medium text-yellow-800",children:"Important Security Notice"}),(0,c.jsx)("div",{className:"mt-2 text-sm text-yellow-700",children:(0,c.jsx)("p",{children:"Keep this recovery code secure and private. Anyone with this code can access your account if you lose your authenticator device."})})]})]})}),(0,c.jsxs)("div",{className:"pt-6",children:[(0,c.jsx)("button",{type:"button",onClick:()=>{X(!1),ea(!0),(0,E.Z)("✅ MFA setup completed successfully!"),n&&n()},className:"w-full px-6 py-3 text-lg font-semibold bg-blue-600 text-white rounded-lg hover:bg-blue-700 focus:outline-none focus:ring-4 focus:ring-blue-300 focus:ring-offset-2 shadow-lg hover:shadow-xl transform hover:scale-[1.02] transition-all duration-200",children:"✅ Complete Setup"}),(0,c.jsx)("p",{className:"text-sm text-gray-600 text-center mt-2",children:"Click to finish setting up your MFA security"})]})]})]}):en?(0,c.jsxs)("div",{className:"flex flex-col items-center justify-center p-8 space-y-4",children:[(0,c.jsx)(R.Z,{}),(0,c.jsx)("p",{className:"text-sm text-gray-600",children:"Completing MFA setup..."}),(0,c.jsx)("p",{className:"text-xs text-gray-500",children:"Please wait while we finalize your MFA setup..."})]}):x&&b&&S?(0,c.jsxs)("div",{className:"max-w-md mx-auto p-6 bg-white rounded-lg shadow-lg border border-gray-200",children:[(0,c.jsxs)("div",{className:"text-center mb-6",children:[(0,c.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:"Set Up Two-Factor Authentication"}),(0,c.jsx)("p",{className:"text-sm text-gray-600",children:"Scan the QR code with your authenticator app to set up MFA."})]}),D&&(0,c.jsx)("div",{className:"mb-4 p-3 bg-red-50 border border-red-200 rounded-md",children:(0,c.jsx)("p",{className:"text-sm text-red-600",children:D})}),(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsx)("div",{className:"flex justify-center",children:b&&(0,c.jsx)("div",{className:"p-4 bg-white border border-gray-300 rounded-lg",children:(0,c.jsx)("img",{src:b,alt:"QR Code for MFA setup",className:"w-48 h-48"})})}),(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsxs)("div",{className:"flex items-center justify-between",children:[(0,c.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Manual Entry Secret"}),(0,c.jsx)("button",{type:"button",onClick:()=>W(!H),className:"text-xs text-blue-600 hover:text-blue-800",children:H?"Hide":"Show"})]}),H&&(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("code",{className:"flex-1 p-2 bg-gray-100 text-sm font-mono rounded border",children:S}),(0,c.jsx)("button",{type:"button",onClick:handleCopySecret,className:"px-3 py-1 text-xs rounded transition-all duration-200 ".concat(Y?"bg-green-500 text-white focus:ring-2 focus:ring-green-500 focus:ring-offset-2":"bg-gray-200 hover:bg-gray-300 focus:ring-2 focus:ring-gray-500 focus:ring-offset-2"),children:Y?"Copied!":"Copy"})]}),(0,c.jsx)("p",{className:"text-xs text-gray-500",children:"Use this secret if you can't scan the QR code. Enter it manually in your authenticator app."})]}),(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsx)("label",{htmlFor:"verifyCode",className:"block text-sm font-medium text-gray-700",children:"Verification Code"}),(0,c.jsx)("input",{id:"verifyCode",type:"text",value:k,onChange:e=>_(e.target.value),onKeyDown:e=>{"Enter"===e.key&&k.trim()&&!T&&onEnableClicked()},placeholder:"Enter 6-digit code from your app",className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",maxLength:6,pattern:"[0-9]*",inputMode:"numeric"}),(0,c.jsx)("p",{className:"text-xs text-gray-500",children:"Enter the 6-digit code from your authenticator app."})]}),(0,c.jsxs)("div",{className:"flex space-x-3 pt-4",children:[(0,c.jsx)("button",{type:"button",onClick:onEnableClicked,disabled:T||!k.trim(),className:"flex-1 px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed",children:T?(0,c.jsxs)("div",{className:"flex items-center justify-center",children:[(0,c.jsx)(R.Z,{}),(0,c.jsx)("span",{className:"ml-2",children:"Verifying..."})]}):"Enable MFA"}),(0,c.jsx)("button",{type:"button",onClick:()=>{es(!0),a()},disabled:T,className:"px-4 py-2 border border-gray-300 text-gray-700 rounded-md hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-gray-500 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed",children:"Cancel"})]})]}),(0,c.jsxs)("div",{className:"mt-6 p-4 bg-blue-50 rounded-md",children:[(0,c.jsx)("h4",{className:"text-sm font-medium text-blue-900 mb-2",children:"Instructions:"}),(0,c.jsxs)("ol",{className:"text-xs text-blue-800 space-y-1 list-decimal list-inside",children:[(0,c.jsx)("li",{children:"Open your authenticator app (Google Authenticator, Authy, etc.)"}),(0,c.jsx)("li",{children:"Scan the QR code above or manually enter the secret"}),(0,c.jsx)("li",{children:"Enter the 6-digit code from your app"}),(0,c.jsx)("li",{children:'Click "Enable MFA" to complete setup'})]})]})]}):(0,c.jsxs)("div",{className:"flex flex-col items-center justify-center p-8 space-y-4",children:[(0,c.jsx)(R.Z,{}),(0,c.jsx)("p",{className:"text-sm text-gray-600",children:"Preparing MFA setup..."}),(0,c.jsx)("p",{className:"text-xs text-gray-500",children:"Please wait while we generate your QR code..."})]})}let ErrorBoundary=class ErrorBoundary extends u.Component{static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,n){}render(){return this.state.hasError?this.props.fallback||(0,c.jsxs)("div",{className:"p-4 bg-red-50 border border-red-200 rounded-md",children:[(0,c.jsx)("h3",{className:"text-lg font-medium text-red-800 mb
2-2",children:"Something went wrong"}),(0,c.jsx)("p",{className:"text-sm text-red-600",children:"An error occurred while loading this component. Please try refreshing the page."}),(0,c.jsx)("button",{onClick:()=>this.setState({hasError:!1}),className:"mt-2 px-3 py-1 text-sm bg-red-600 text-white rounded hover:bg-red-700",children:"Try Again"})]}):this.props.children}constructor(e){super(e),this.state={hasError:!1}}};var H=a(47508),W=a(58853),Y=a(48108),z=a(21876).Buffer,$=!0;function Settings(e){var n,a,p;let{initialSession:h,user:x,customUsername:y,copyrightOwnerName:_,additionalCopyrightOwners:T,accountType:$,customDomain:V,getCNAMEExplorerVerified:K,zuploConsumerApiKey:X,userAvatar:J,userLanguage:et}=e,[er,es]=(0,u.useState)(!1),{isLoading:en,subscription:ea}=(0,N.aF)(),[eo,ei]=(0,u.useState)(""),[el,ec]=(0,u.useState)(""),[ed,eu]=(0,u.useState)(""),[em,ep]=(0,u.useState)(""),[eh,ex]=(0,u.useState)(T||[]),[eg,ey]=(0,u.useState)(""),[ev,ef]=(0,u.useState)(""),[eb,ew]=(0,u.useState)(""),[ej,eN]=(0,u.useState)([]),[eC,eS]=(0,u.useState)([]),[eA,ek]=(0,u.useState)(!1),[eE,eM]=(0,u.useState)(!1),[eF,e_]=(0,u.useState)(!1),[eD,eR]=(0,u.useState)(!1),[eL,eP]=(0,u.useState)(null),[eT,eO]=(0,u.useState)(""),[eZ,eI]=(0,u.useState)(""),[eq,eB]=(0,u.useState)(!1),[eH,eU]=(0,u.useState)(""),[eW,eY]=(0,u.useState)(!1),[ez,e$]=(0,u.useState)(!1),[eQ,eG]=(0,u.useState)(!1),[eV,eK]=(0,u.useState)(""),[eX,eJ]=(0,u.useState)(!1),e0=(0,u.useRef)(null),e1=(0,u.useRef)(null),e2=(0,u.useRef)(null),e3=(0,u.useRef)(null),e4=(0,u.useRef)(null),e5=(0,u.useRef)(null),e6=(0,u.useRef)(null),e8=(0,u.useRef)(null),[e7,e9]=(0,u.useState)(!0),[tt,tr]=(0,u.useState)(!1),[ts,tn]=(0,u.useState)(!0),ta=(0,S.useRouter)(),to=(0,A.useSupabaseClient)(),ti=(0,P.U0)();(0,u.useEffect)(()=>{let e=!0,checkMFAStatus=async()=>{try{let{data:a,error:c}=await to.auth.mfa.listFactors();if(!e)return;if(c){var n;if("user_not_found"===c.code||(null===(n=c.message)||void 0===n?void 0:n.includes("User from sub claim in JWT does not exist"))){(0,C.Cv)("User not found in auth system, likely deleted");return}ta.replace("/dashboard/settings#multi-factor-authentication");return}let u=(null==a?void 0:a.totp)||[],p=u.some(e=>"verified"===e.status),h=await (0,C.mZ)();if(!e)return;p&&(p&&!h?ta.replace("/dashboard/mfa"):p&&h&&!ea&&ta.asPath.includes("#multi-factor-authentication")&&ta.replace("/dashboard/pricing"))}catch(n){if(!e)return}},initializeData=async()=>{await checkMFAStatus(),await loadSecurityQuestion()};return initializeData(),()=>{e=!1}},[ta,to,ea]),(0,u.useEffect)(()=>{let initializeDriver=()=>{if("#multi-factor-authentication"===window.location.hash){let e=document.getElementById("multi-factor-authentication"),n=e?e.querySelector("div"):null;if(n){e8.current&&(e8.current.destroy(),e8.current=null);let e=Ae({showProgress:!1,showButtons:["close"],allowClose:!0,steps:[{element:"#multi-factor-authentication div",popover:{title:"Multi-Factor Authentication",description:"This is a requirement to use ScoreDetect for protection of your data and certificates. Set up your multi-factor authentication to avoid losing your data.",side:"bottom",align:"start"}}]});e8.current=e,setTimeout(()=>{e.drive()},100)}}};initializeDriver();let handleHashChange=()=>{"#multi-factor-authentication"===window.location.hash&&initializeDriver()};return window.addEventListener("hashchange",handleHashChange),()=>{window.removeEventListener("hashchange",handleHashChange),e8.current&&(e8.current.destroy(),e8.current=null)}},[]);let redirectToCustomerPortal=async()=>{es(!0);try{let{url:e,error:n}=await (0,C.qC)({url:"/api/create-portal-link"});window.location.assign(e)}catch(e){if(es(!1),e)return alert(e.message)}},handleCloseAllModals=e=>{var n,a;e.preventDefault(),null===(n=e0.current)||void 0===n||n.close(),null===(a=e2.current)||void 0===a||a.close()},handleDeleteAccount=async e=>{e.preventDefault(),es(!0);try{let{data:e,error:n}=await (0,C.qC)({url:"/api/delete-account",data:{feedback:{why:eo,why_other:eb}}});if(n)throw n;(0,q.sendGAEvent)({event:"delete_account"}),ti.capture("delete_account"),(0,E.Z)("Account deleted successfully"),await to.auth.signOut(),window.location.href="/"}catch(e){es(!1),alert("Failed to delete account: ".concat(e.message))}},handleDeletingAccountWhy=e=>{if(ei(e.target.value),"other"===e.target.value){var n,a;null===(n=e1.current)||void 0===n||n.classList.remove("hidden"),null===(a=e1.current)||void 0===a||a.focus()}},handleCopyApiKey=async e=>{e.preventDefault(),await navigator.clipboard.writeText(X).then(()=>{(0,E.Z)("API Key to clipboard")}
2).catch(e=>{})},handleChangePassword=async e=>{e.preventDefault(),es(!0);try{let{data:e,error:n}=await (0,C.qC)({url:"/api/change-password",data:{newPassword:el}});if(n)throw n;(0,E.Z)("Password successfully changed"),ec(""),(0,q.sendGAEvent)({event:"reset_password",method:x.app_metadata.provider}),ti.capture("reset_password",{method:x.app_metadata.provider})}catch(e){if(e)return es(!1),alert(e.message)}es(!1)},handleChangeCustomDomain=async e=>{if(e.preventDefault(),!(0,C.hS)(ev)||!ev)return alert("Please enter a valid domain.");es(!0);try{let{data:e,error:n}=await (0,C.qC)({url:"/api/change-custom-domain",data:{newCustomDomain:ev}});if(n)throw n;(0,E.Z)("Successfully changed"),ef("")}catch(e){if(e)return es(!1),alert(e.message)}es(!1),ta.reload()},handleResetCustomDomain=async e=>{e.preventDefault(),es(!0);try{let{data:e,error:n}=await (0,C.qC)({url:"/api/change-custom-domain",data:{newCustomDomain:""}});if(n)throw n;(0,E.Z)("Successfully changed"),ef("")}catch(e){if(e)return es(!1),alert(e.message)}es(!1),ta.reload()},handleChangeUsername=async e=>{e.preventDefault(),es(!0);try{let{data:e,error:n}=await (0,C.qC)({url:"/api/change-username",data:{newUsername:ed}});if(n)throw n;(0,E.Z)("Successfully changed"),eu(""),(0,q.sendGAEvent)({event:"change_username"}),ti.capture("change_username")}catch(e){if(e)return es(!1),alert(e.message)}es(!1),ta.reload()},handleChangeCopyrightOwnerName=async e=>{e.preventDefault(),es(!0);try{let{data:e,error:n}=await (0,C.qC)({url:"/api/change-copyright-owner-name",data:{newCopyrightOwnerName:em}});if(n)throw n;(0,E.Z)("Successfully changed"),ep(""),(0,q.sendGAEvent)({event:"change_copyright_owner_name"}),ti.capture("change_copyright_owner_name")}catch(e){if(e)return es(!1),alert(e.message)}es(!1),ta.reload()},handleChangeAdditionalCopyrightOwners=async e=>{e.preventDefault(),es(!0);try{let{data:e,error:n}=await (0,C.qC)({url:"/api/change-additional-copyright-owners",data:{additionalCopyrightOwners:eh}});if(n)throw n;(0,E.Z)("Successfully changed"),(0,q.sendGAEvent)({event:"change_additional_copyright_owners"}),ti.capture("change_additional_copyright_owners")}catch(e){if(e)return es(!1),alert(e.message)}es(!1),ta.reload()},handleRemoveAdditionalCopyrightOwner=e=>{ex(eh.filter((n,a)=>a!==e))},handleUpdateAdditionalCopyrightOwner=(e,n)=>{let a=[...eh];a[e]=n,ex(a)},handleChangeLanguage=async e=>{e.preventDefault(),es(!0);try{let{data:e,error:n}=await (0,C.qC)({url:"/api/change-language",data:{newLanguage:eg}});if(n)throw n;(0,E.Z)("Successfully changed"),ey(""),(0,q.sendGAEvent)({event:"change_language"}),ti.capture("change_language")}catch(e){if(e)return es(!1),alert(e.message)}es(!1),ta.reload()},handleResetUsername=async e=>{e.preventDefault(),es(!0);try{let{data:e,error:n}=await (0,C.qC)({url:"/api/reset-username",data:{}});if(n)throw n;(0,E.Z)("Successfully reset."),eu(""),(0,q.sendGAEvent)({event:"reset_username"}),ti.capture("reset_username")}catch(e){if(e)return es(!1),alert(e.message)}es(!1),ta.reload()},resetUserAvatar=async e=>{e.preventDefault(),es(!0);try{let{data:e,error:n}=await (0,C.qC)({url:"/api/update-user-avatar",data:{avatarUrl:""}});if(n)throw n;(0,E.Z)("Successfully reset avatar."),ta.reload()}catch(e){e&&(es(!1),alert(e.message))}es(!1)},loadMFAFactors=async()=>{try{eR(!0),eP(null);let e=await (0,C.Yu)({url:"/api/mfa/factors"});if(e.error)throw Error(e.error.message);let n=e.data.all||[],a=e.data.totp||[],c=e.data.hasEnrolledFactors||!1;eN(n),eS(a),ek(c)}catch(e){eP(e.message||"Failed to load MFA status")}finally{eR(!1)}},handleMFAEnrolled=async()=>{(0,E.Z)("✅ MFA enrolled successfully!"),eM(!1),eP(null),await loadMFAFactors(),await checkSecuritySetupCompletion(),ta.asPath.includes("#multi-factor-authentication")&&(e8.current&&(e8.current.destroy(),e8.current=null),setTimeout(()=>{ta.push("/dashboard/pricing")},1500))},handleResetMFA=async e=>{confirm("Are you sure you want to reset MFA? You will need to set it up again with your authenticator app.")&&e_(!0)},handleResetMFASubmit=async()=>{if(!eT.trim()){(0,E.Z)("Please enter a verification code.");return}try{eR(!0);let e=await (0,C.qC)({url:"/api/mfa/unenroll-with-security-question",data:{factorId:eC[0].id,verificationCode:eT.trim()}});if(e.error)throw Error(e.error.message);(0,E.Z)("MFA reset successfully. You can now set it up again."),e_(!1),eB(!1),eO(""),eI(""),(0,C.M3)(),eN([]),eS([]),ek(!1),eP(null);try{await to.auth.refreshSession()}catch(e){}await new Promise(e=>setTimeout(e,1e3)),await loadMFAFactors()}catch(e){(0,E.Z)("Failed to reset MFA: ".concat(e.message))}finally{eR(!1)}},loadSecurityQuestion=async()=>{try{let p=await fetch("/api/mfa/get-security-question",{method:"GET",headers:{"Content-Type":"application/json"}}),h=await p.json();if(p.ok)h.data&&h.data.question?(eU(h.data.question),eY(!0)):eY(!1);else{var e,n,a,c,u;404===p.status?(null===(n=h.error)||void 0===n?void 0:null===(e=n.message)||void 0===e?void 0:e.includes("No security question configured"))?((0,C.Cv)("No security question configured for user"),eY(!1)):(null===(c=h.error)||void 0===c?void 0:null===(a=c.message)||void 0===a?void 0:a.includes("User account not found"))&&(0,C.Cv)("User account not found - likely deleted"):(0,C.V3)("Error loading security question:",null===(u=h.error)||void 0===u?void 0:u.message)}}catch(e){(0,C.V3)("Error loading security question:",e)}},handleUseSecurityQuestion=async()=>{eB(!0),eP(null),await loadSecurityQuestion()},handleSecurityQuestionSubmit=async()=>
2{if(!eZ.trim()){(0,E.Z)("Please provide an answer to your security question.");return}try{eR(!0);let e=await (0,C.qC)({url:"/api/mfa/unenroll-with-security-question",data:{factorId:eC[0].id,securityAnswer:eZ.trim()}});if(e.error)throw Error(e.error.message);(0,E.Z)("MFA reset successfully. You can now set it up again."),e_(!1),eB(!1),eO(""),eI(""),(0,C.M3)(),eN([]),eS([]),ek(!1),eP(null);try{await to.auth.refreshSession()}catch(e){}await new Promise(e=>setTimeout(e,1e3)),await loadMFAFactors()}catch(e){(0,E.Z)("Failed to reset MFA: ".concat(e.message))}finally{eR(!1)}},checkSecuritySetupCompletion=async()=>{try{eA&&eW&&((0,E.Z)("✅ Security setup complete! Please choose a plan"),setTimeout(()=>{ta.push("/dashboard/pricing")},1500))}catch(e){(0,C.V3)("Error checking security setup completion:",e)}},handleSecurityQuestionSetupComplete=async()=>{e$(!1),await loadSecurityQuestion(),await checkSecuritySetupCompletion()},handleForceMFACleanup=async()=>{if(confirm("This will clean up ALL MFA factors and reset your MFA setup. Continue?"))try{eR(!0),eP(null);let e=await (0,C.qC)({url:"/api/mfa/force-cleanup",data:{}});if(e.error)throw Error(e.error.message);(0,E.Z)("MFA factors cleaned up successfully. You can now set up MFA again."),eM(!1),(0,C.M3)(),eN([]),eS([]),ek(!1),eP(null);try{await to.auth.refreshSession()}catch(e){}await new Promise(e=>setTimeout(e,2e3)),await loadMFAFactors()}catch(e){(0,E.Z)("Failed to clean up MFA: ".concat(e.message)),eP(e.message)}finally{eR(!1)}},handleGenerateRecoveryCode=async()=>{eR(!0),eP(null);try{let e=await (0,C.qC)({url:"/api/mfa/generate-recovery-code",data:{}});if(e.error)throw Error(e.error.message);eK(e.data.recoveryCode),eG(!0),(0,E.Z)("✅ New recovery code generated successfully!")}catch(n){let e=n.message||"Failed to generate recovery code. Please try again.";eP(e),(0,E.Z)("Recovery code generation failed: ".concat(e))}finally{eR(!1)}},handleCopyRecoveryCode=async()=>{try{await navigator.clipboard.writeText(eV),eJ(!0),(0,E.Z)("Recovery code copied!"),setTimeout(()=>{eJ(!1)},2e3)}catch(e){(0,E.Z)("Failed to copy recovery code")}};(0,u.useEffect)(()=>{let e=!0,loadFactors=async()=>{e&&await loadMFAFactors()};return loadFactors(),()=>{e=!1}},[]);let handleDrop=async e=>{if(e.length>0)try{let n=e[0],a=await n.arrayBuffer(),c=n.type,u=n.size;if(u>2097152){(0,E.Z)("Invalid file size. Please upload a file that is less than 2MB.");return}if(!["image/jpeg","image/jpg","image/png"].includes(c)){(0,E.Z)("Invalid file type. Please upload a valid image file.");return}let p=z.from(a).toString("base64"),h="data:".concat(c,";base64,").concat(p),x=await (0,C.qC)({url:"/api/update-user-avatar",data:{avatarUrl:h}});if(!x)throw Error("Error uploading your avatar.");(0,E.Z)("Successfully uploaded your avatar."),ta.reload()}catch(e){throw Error("Error calculating the checksum")}},tl=""!==y?y:(0,C.xD)(x),tc=[{value:"en",label:"English"},{value:"es",label:"Spanish (Espa\xf1ol)"},{value:"fr",label:"French (Fran\xe7ais)"},{value:"de",label:"German (Deutsche)"},{value:"it",label:"Italian (Italiano)"},{value:"pt",label:"Portuguese (Portugu\xeas)"},{value:"ru",label:"Russian (Русский)"},{value:"zh-Hans",label:"Chinese, Simplified (简化字)"},{value:"zh-Hant",label:"Chinese, Traditional (繁體字)"},{value:"ja",label:"Japanese (日本語)"},{value:"ko",label:"Korean (한국어)"}];return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(k.Z,{metadata:{title:"Settings – ScoreDetect"}}),(0,c.jsx)(Y.Z,{className:"fixed top-4 left-1/2 transform -translate-x-1/2 z-20"}),(0,c.jsxs)("section",{className:"",children:[(0,c.jsx)("header",{className:"border-b border-base-300 bg-white/50 backdrop-blur-xl",children:(0,c.jsx)("div",{className:"max-w-6xl mx-auto px-4 py-12",children:(0,c.jsxs)("div",{className:"sm:flex sm:flex-col sm:align-center",children:[(0,c.jsx)("h1",{className:"font-medium text-4xl ",children:"Settings"}),(0,c.jsx)("p",{className:"mt-4 base-300",children:"Manage your account settings and set your preferences."}),(0,c.jsx)("div",{children:tl&&(0,c.jsxs)("span",{className:"flex gap-4 items-center mt-4",children:[(0,c.jsx)(D(),{className:"rounded-full",src:J,alt:tl,width:32,height:32,title:tl}),(0,c.jsx)("div",{className:"flex flex-col",children:(0,c.jsx)("div",{children:(0,C.qp)()+", ".concat(tl,"!")})})]})})]})})}),(0,c.jsxs)("article",{className:"px-4 pt-6 pb-32 flex flex-col gap-12",children:[(0,c.jsx)("section",{id:"api-key",children:(0,c.jsx)(b.Z,{title:"API Key",description:"Your API key is used to authenticate your requests to the ScoreDetect API. You can use it to integrate ScoreDetect with your own applications, including Zapier.",footer:X&&(0,c.jsxs)("div",{className:"flex items-start justify-between flex-col sm:flex-row sm:items-center",children:[(0,c.jsx)("p",{className:"mb-4 sm:mb-0",children:"Click the button to copy your API key to your clipboard."}),(0,c.jsx)("button",{className:"btn btn-secondary",disabled:er,onClick:handleCopyApiKey,children:"Copy API key"})]}),children:(0,c.jsx)("div",{className:"mt-6 md:flex gap-12",children:(0,c.jsxs)("div",{className:"mt-4 md:mt-0 col-span-3",children:[(0,c.jsx)("div",{className:"uppercase text-xs font-medium mb-2",children:"Your API Key"}),(0,c.jsx)("div",{className:"font-semibold ... truncate overflow-hidden w-[250px] md:w-auto",children:X||(0,c.jsx)(c.Fragment,{children:(0,c.jsx)("p",{children:"No API key. Upgrade to ScoreDetect Pro or higher."})})})]})})})}),(0,c.jsx)("section",{id:"plan",children:(0,c.jsx)(b.Z,{title:"Your Plan",description:"",footer:(0,c.jsx)("div",{className:"flex items-start justify-between flex-col sm:flex-row sm:items-center",children:ea?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("p",{className:"pb-4 sm:pb-0",children:"Manage your subscription on Stripe."}),(0,c.jsx)("button",{className:"btn btn-neutral",disabled:er||!ea,onClick:redirectToCustomerPortal,children:"Open customer portal"})]}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("p",{className:"pb-4 sm:pb-0",children:"Select your plan to get started."}),(0,c.jsx)(I(),{className:"btn btn-neutral",href:"/pricing",children:"Choose your plan"})]})}),children:ea&&(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)("span",{children:["You are currently on the"," ",(0,c.jsx)("span",{className:"font-bold",children:null==ea?void 0:null===(a=ea.prices)||void 0===a?void 0:null===(n=a.products)||void 0===n?void 0:n.name})," ","plan."]})})})}),"business"===$&&(0,c.jsx)(c.Fragment,{children:(0,c.jsx)("section",{id:"change-profile-photo",children:(0,c.jsx)(b.Z,{title:"business"===$?"Change Organization Logo":"Change Profile Photo",description:"business"===$?"You can change your organization logo here. Recommended size is 128x128 pixels.":"You can change your profile photo here.",isCollapsed:!1,children:(0,c.jsx)("div",{className:"mt-6",children:(0,c.jsxs)("div",{className:"mt-4 mx-auto max-w-screen-sm",children:[(0,c.jsx)("div",{className:"uppercase text-xs font-medium mb-2",children:"business"===$?"Your Organization Logo":"Your Profile Photo"}),(0,c.jsxs)("div",{className:"grid gap-3",children:[(0,c.jsx)("div",{children:er?(0,c.jsx)("div",{className:"h-12 mb-6",children:(0,c.jsx)(R.Z,{})}):(0,c.jsx)(c.Fragment,{children:(0,c.jsx)(function(){let{acceptedFiles:e,getRootProps:n,getInputProps:a}=(0,B.uI)({multiple:!1,onDrop:handleDrop});return(0,c.jsx)("div",{children:(0,c.jsxs)("div",{...n({className:"backdrop-blur-xl flex flex-col mx-auto items-center justify-center w-full max-w-screen-sm h-64 border-2 border-base-300 border-dashed rounded-lg cursor-pointer bg-gray-50/50 dark:hover:bg-gray-800/50 dark:bg-gray-700/50 hover:bg-gray-100/50 dark:border-gray-600 dark:hover:border-gray-500 dark:hover:bg-gray-600/50\xa7 transition duration-150 ease-in-out select-none"}),children:[(0,c.jsx)("input",{...a()}),(0,c.jsxs)("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:[(0,c.jsx)("svg",{className:"w-10 h-10 mb-3 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"})}),(0,c.jsxs)("p",{className:"mb-2 text-sm text-gray-500 dark:text-gray-400",children:[(0,c.jsx)("span",{className:"font-semibold",children:"Click here to upload"})," or drag and drop"]}),(0,c.jsx)("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:"Only jpg, jpeg, and png are supported."})]})]})})},{})})}),(0,c.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)("div",{className:"uppercase text-xs font-medium mb-2",children:"Image Preview"}),tl&&x&&(0,c.jsx)("div",{className:"dragon-container flex flex-col flex-1",children:(0,c.jsxs)("span",{className:"flex gap-4 items-center",children:[(0,c.jsx)(D(),{className:"rounded-full",src:J,alt:tl,width:32,height:32,title:tl}),(0,c.jsxs)("div",{className:"flex flex-col",children:[(0,c.jsx)("span",{className:"dragon-ellipsis",children:"".concat(new Date().toLocaleStr
2ing("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}))}),(0,c.jsx)("div",{children:"by ".concat(tl)})]})]})})]}),(0,c.jsx)("div",{children:(0,c.jsx)("button",{className:"btn btn-ghost",disabled:er,onClick:resetUserAvatar,children:"Reset"})})]})]})]})})})})}),ea&&(0,c.jsx)("section",{id:"change-name",children:(0,c.jsx)(b.Z,{title:"business"===$?"Change Organization Name":"Change Username",description:"business"===$?"You can change your organization name here.":"You can change your username here.",isCollapsed:!1,children:er?(0,c.jsx)(c.Fragment,{children:(0,c.jsx)("div",{className:"m-6",children:(0,c.jsx)(R.Z,{})})}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:"mt-6 md:flex gap-12",children:(0,c.jsxs)("div",{className:"mt-4 md:mt-0 col-span-3",children:[(0,c.jsx)("div",{className:"uppercase text-xs font-medium mb-2",children:"business"===$?"Your Current Organization Name":"Your Current Username"}),(0,c.jsx)("div",{className:"font-semibold ... truncate overflow-hidden w-[250px] md:w-auto",children:tl})]})}),(0,c.jsxs)("div",{className:"flex items-start justify-between flex-col sm:flex-row sm:items-center mt-4 gap-4",children:[(0,c.jsx)("input",{type:"text",className:"input input-bordered w-[300px] max-w-full",placeholder:"business"===$?"Your new organization name":"Your new username",onChange:e=>eu(e.target.value),ref:e4}),(0,c.jsxs)("div",{className:"sm:flex gap-2",children:[(0,c.jsx)("button",{className:"btn btn-primary",type:"button",onClick:handleChangeUsername,children:"business"===$?"Change Organization Name":"Change Username"}),(0,c.jsx)("button",{className:"btn btn-ghost",type:"button",onClick:handleResetUsername,children:"Reset"})]})]})]})})}),(0,c.jsx)("section",{id:"change-copyright-owner-name",children:(0,c.jsx)(b.Z,{title:"Change Copyright Owner Name",description:"You can change your copyright owner name here. This name will be displayed on your certificates when exporting pdf.",isCollapsed:!1,children:er?(0,c.jsx)(c.Fragment,{children:(0,c.jsx)("div",{className:"m-6",children:(0,c.jsx)(R.Z,{})})}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:"mt-6 md:flex gap-12",children:(0,c.jsxs)("div",{className:"mt-4 md:mt-0 col-span-3",children:[(0,c.jsx)("div",{className:"uppercase text-xs font-medium mb-2",children:"Your Current Copyright Owner Name"}),(0,c.jsx)("div",{className:"font-semibold ... truncate overflow-hidden w-[250px] md:w-auto",children:_||"Not set"})]})}),(0,c.jsxs)("div",{className:"flex items-start justify-between flex-col sm:flex-row sm:items-center mt-4 gap-4",children:[(0,c.jsx)("input",{type:"text",className:"input input-bordered w-[300px] max-w-full",placeholder:"Your new copyright owner name",onChange:e=>ep(e.target.value),maxLength:46,minLength:3}),(0,c.jsx)("div",{className:"sm:flex gap-2",children:(0,c.jsx)("button",{className:"btn btn-primary",type:"button",onClick:handleChangeCopyrightOwnerName,children:"Change Copyright Owner Name"})})]})]})})}),(0,c.jsx)("section",{id:"additional-copyright-owners",children:(0,c.jsx)(b.Z,{title:"Additional Copyright Owners",description:"You can add up to 3 additional copyright owners here. These names will be displayed alongside your primary copyright owner name on your certificates when exporting PDF.",isCollapsed:!1,children:er?(0,c.jsx)(c.Fragment,{children:(0,c.jsx)("div",{className:"m-6",children:(0,c.jsx)(R.Z,{})})}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:"mt-6 md:flex gap-12",children:(0,c.jsxs)("div",{className:"mt-4 md:mt-0 col-span-3",children:[(0,c.jsx)("div",{className:"uppercase text-xs font-medium mb-2",children:"Your Current Additional Copyright Owners"}),(0,c.jsx)("div",{className:"font-semibold ... truncate overflow-hidden w-[250px] md:w-auto",children:eh.length>0?(0,c.jsx)("ul",{className:"list-disc list-inside",children:eh.map((e,n)=>(0,c.jsx)("li",{children:e||"Empty"},n))}):"None set"})]})}),(0,c.jsxs)("div",{className:"mt-4 space-y-4",children:[eh.map((e,n)=>(0,c.jsxs)("div",{className:"flex items-center gap-4",children:[(0,c.jsx)("input",{type:"text",className:"input input-bordered flex-1",placeholder:"Additional copyright owner ".concat(n+1),value:e,onCh
2ange:e=>handleUpdateAdditionalCopyrightOwner(n,e.target.value),maxLength:46,minLength:3}),(0,c.jsx)("button",{className:"btn btn-ghost btn-sm",onClick:()=>handleRemoveAdditionalCopyrightOwner(n),type:"button",children:"Remove"})]},n)),eh.length<3&&(0,c.jsx)("button",{className:"btn btn-ghost btn-sm",onClick:()=>{if(eh.length>=3){(0,E.Z)("Maximum of 3 additional copyright owners allowed");return}ex([...eh,""])},type:"button",children:"+ Add Additional Copyright Owner"}),(0,c.jsx)("div",{className:"flex items-start justify-between flex-col sm:flex-row sm:items-center gap-4",children:(0,c.jsx)("div",{className:"sm:flex gap-2",children:(0,c.jsx)("button",{className:"btn btn-primary",type:"button",onClick:handleChangeAdditionalCopyrightOwners,children:"Save Additional Copyright Owners"})})})]})]})})}),(0,c.jsx)("section",{id:"change-language",children:(0,c.jsx)(b.Z,{title:"Change Language",description:"Set the language to display for your certificates.",isCollapsed:!1,children:er?(0,c.jsx)(c.Fragment,{children:(0,c.jsx)("div",{className:"m-6",children:(0,c.jsx)(R.Z,{})})}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:"mt-6 md:flex gap-12",children:(0,c.jsxs)("div",{className:"mt-4 md:mt-0 col-span-3",children:[(0,c.jsx)("div",{className:"uppercase text-xs font-medium mb-2",children:"Your Current Language"}),(0,c.jsx)("div",{className:"font-semibold ... truncate overflow-hidden w-[250px] md:w-auto",children:null===(p=tc.find(e=>e.value===et))||void 0===p?void 0:p.label})]})}),(0,c.jsxs)("div",{className:"flex items-start justify-between flex-col sm:flex-row sm:items-center mt-4 gap-4",children:[(0,c.jsxs)("select",{className:"select select-bordered w-[300px] max-w-full",onChange:e=>ey(e.target.value),ref:e5,children:[(0,c.jsx)("option",{disabled:!0,selected:!0,value:"",children:"-- Select a Language --"}),tc.map(e=>(0,c.jsx)("option",{value:e.value,children:e.label},e.value))]}),(0,c.jsx)("div",{className:"sm:flex gap-2",children:(0,c.jsx)("button",{className:"btn btn-primary",type:"button",onClick:handleChangeLanguage,children:"Change Language"})})]})]})})}),(0,c.jsx)("section",{id:"multi-factor-authentication",children:(0,c.jsxs)(b.Z,{title:"Multi-Factor Authentication",badge:"new",description:"Multi-factor authentication is required for all users. Add an extra layer of security to your account by enabling two-factor authentication using an authenticator app. This helps protect your data and certificates from unauthorized access. You will also receive a recovery code — keep it safe like a password. If you experience any issues, please contact [email protected].",isCollapsed:!1,children:[(0,c.jsx)("div",{className:"my-3",children:(0,c.jsx)(W.Z,{href:"https://docs.scoredetect.com/faq/how-to-setup-multi-factor-authentication-mfa-on-scoredetect",className:"link link-primary",children:"How to video and instructions"})}),eD?(0,c.jsx)("div",{className:"m-6",children:(0,c.jsx)(R.Z,{})}):eL?(0,c.jsx)("div",{className:"m-6 p-4 bg-red-50 border border-red-200 rounded-md",children:(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("div",{className:"flex-shrink-0",children:(0,c.jsx)("svg",{className:"h-5 w-5 text-red-400",viewBox:"0 0 20 20",fill:"currentColor",children:(0,c.jsx)("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})})}),(0,c.jsxs)("div",{className:"ml-3",children:[(0,c.jsx)("h3",{className:"text-sm font-medium text-red-800",children:"Error loading MFA status"}),(0,c.jsxs)("div",{className:"mt-2 text-sm text-red-700",children:[(0,c.jsx)("p",{children:eL}),(0,c.jsx)("button",{type:"button",onClick:loadMFAFactors,className:"mt-2 text-red-600 hover:text-red-500 underline",children:"Try again"})]})]})]})}):eE&&!eA?(0,c.jsx)(ErrorBoundary,{children:(0,c.jsx)(EnrollMFA,{onEnrolled:handleMFAEnrolled,onCancelled:()=>{eM(!1),eP(null),loadMFAFactors()},onError:e=>{(0,E.Z)("MFA setup failed: ".concat(e)),e.includes("Maximum number of verified factors reached")?eP('Maximum number of MFA factors reached. Please use the "Reset MFA setup" button below to clean up existing factors before trying again.'):eP(e)},onCompleteSetupVisible:()=>{let e=document.querySelectorAll("button"),n=null;
2if(Array.from(e).forEach(e=>{var a;(null===(a=e.textContent)||void 0===a?void 0:a.includes("Complete Setup"))&&(n=e)}),n){e8.current&&(e8.current.destroy(),e8.current=null);let e=Ae({showProgress:!1,showButtons:["close"],allowClose:!0,steps:[{element:n,popover:{title:"Done! One more step to go...",description:"Click this button to move to the next step, choosing your ScoreDetect subscription.",side:"top",align:"center"}}]});e8.current=e,e.drive()}}})}):eF?eq?(0,c.jsxs)("div",{className:"max-w-md mx-auto p-6 bg-white rounded-lg shadow-md",children:[(0,c.jsxs)("div",{className:"text-center mb-6",children:[(0,c.jsx)("h2",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Security Question"}),(0,c.jsx)("p",{className:"text-gray-600",children:"Please answer your security question to reset MFA."})]}),(0,c.jsxs)("form",{onSubmit:e=>{e.preventDefault(),handleSecurityQuestionSubmit()},className:"space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Question"}),(0,c.jsx)("div",{className:"p-3 bg-gray-50 border border-gray-300 rounded-md text-gray-900",children:eH||"Loading security question..."})]}),(0,c.jsxs)("div",{children:[(0,c.jsx)("label",{htmlFor:"security-answer",className:"block text-sm font-medium text-gray-700 mb-2",children:"Answer"}),(0,c.jsx)("input",{type:"text",id:"security-answer",value:eZ,onChange:e=>eI(e.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-purple-500",placeholder:"Enter your answer",required:!0}),(0,c.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Your answer is case-insensitive."})]}),(0,c.jsxs)("div",{className:"flex space-x-3",children:[(0,c.jsx)("button",{type:"button",onClick:()=>{eB(!1),eI(""),eP(null)},className:"flex-1 bg-gray-600 text-white py-2 px-4 rounded-md hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-gray-500 focus:ring-offset-2 transition-colors",children:"Cancel"}),(0,c.jsx)("button",{type:"submit",disabled:eD,className:"flex-1 bg-purple-600 text-white py-2 px-4 rounded-md hover:bg-purple-700 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:eD?(0,c.jsx)("div",{className:"flex items-center justify-center",children:(0,c.jsx)(R.Z,{})}):"Reset MFA"})]})]})]}):(0,c.jsxs)("div",{className:"max-w-md mx-auto p-6 bg-white rounded-lg shadow-lg border border-gray-200",children:[(0,c.jsxs)("div",{className:"text-center mb-6",children:[(0,c.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:"Reset Two-Factor Authentication"}),(0,c.jsx)("p",{className:"text-sm text-gray-600",children:"Enter the verification code from your authenticator app to reset MFA. You will need to set it up again."})]}),(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsx)("label",{htmlFor:"unenrollCode",className:"block text-sm font-medium text-gray-700",children:"Verification Code"}),(0,c.jsx)("input",{id:"unenrollCode",type:"text",value:eT,onChange:e=>eO(e.target.value),placeholder:"Enter 6-digit code from your app",className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",maxLength:6,pattern:"[0-9]*",inputMode:"numeric"}),(0,c.jsx)("p",{className:"text-xs text-gray-500",children:"Enter the 6-digit code from your authenticator app."})]}),(0,c.jsxs)("div",{className:"flex space-x-3 pt-4",children:[(0,c.jsx)("button",{type:"button",onClick:handleResetMFASubmit,disabled:eD||!eT.trim(),className:"flex-1 px-4 py-2 bg-red-600 text-white rounded-md hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed",children:eD?(0,c.jsxs)("div",{className:"flex items-center justify-center",children:[(0,c.jsx)(R.Z,{}),(0,c.jsx)("span",{className:"ml-2",children:"Resetting..."})]}):"Reset MFA"}),(0,c.jsx)("button",{type:"button",onClick:()=>{e_(!1),eB(!1),eO(""),eI("")},disabled:eD,className:"px-4 py-2 border border-gray-300 text-gray-700 rounded-md hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-gray-500 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed",children:"Cancel"})]}),(0,c.jsx)("div",{className:"pt-4 border-t border-gray-200",children:(0,c.jsx)("button",{type:"button",onClick:handleUseSecurityQuestion,className:"w-full px-4 py-2 text-sm text-blue-600 hover:text-blue-800 underline",children:"Can't access your authenticator? Use security question"})})]})]}):(0,c.jsxs)("div",{className:"mt-6 space-y-4",children:[(0,c.jsxs)("div",{className:"flex items-center justify-between",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)("h4",{className:"text-lg font-medium text-gray-900",children:"Authenticator App (TOTP)"}),(0,c.jsx)("p",{className:"text-sm text-gray-600",children:"Use an authenticator app like Google Authenticator or Authy to generate time-based codes."})]}),(0,c.jsx)("div",{className:"flex items-center space-x-2",children:eA?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800",children:"Enabled"}),(0,c.jsx)("button",{type:"button",onClick:()=>handleResetMFA(eC[0].id),className:"btn btn-ghost btn-sm",disabled:eD,children:"Reset MFA"})]}):(0,c.jsx)("button",{type:"button",onClick:()=>
2{if(eA){(0,E.Z)("MFA is already enabled. Please remove existing MFA first.");return}eM(!0)},className:"btn btn-primary btn-sm",disabled:eD,children:"Setup MFA"})})]}),!eA&&(0,c.jsx)("div",{className:"p-4 bg-red-50 border border-red-200 rounded-md",children:(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("div",{className:"flex-shrink-0",children:(0,c.jsx)("svg",{className:"h-5 w-5 text-red-400",viewBox:"0 0 20 20",fill:"currentColor",children:(0,c.jsx)("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})})}),(0,c.jsxs)("div",{className:"ml-3",children:[(0,c.jsx)("h3",{className:"text-sm font-medium text-red-800",children:"Two-factor authentication is required"}),(0,c.jsxs)("div",{className:"mt-2 text-sm text-red-700",children:[(0,c.jsx)("p",{children:"Multi-factor authentication (MFA) is required for all users. You must enable two-factor authentication to access your dashboard and protect your data."}),eL&&(0,c.jsx)("div",{className:"mt-2 p-2 bg-red-100 border border-red-300 rounded",children:(0,c.jsx)("p",{className:"text-xs text-red-800 font-medium",children:eL})}),(0,c.jsx)("div",{className:"mt-2 space-y-1",children:(0,c.jsx)("button",{type:"button",onClick:handleForceMFACleanup,className:"text-red-600 hover:text-red-500 underline text-xs",disabled:eD,children:eD?"Cleaning up...":"Reset MFA setup"})})]})]})]})}),eA&&(0,c.jsxs)("div",{className:"mt-8 pt-6 border-t border-gray-200",children:[(0,c.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)("h4",{className:"text-lg font-medium text-gray-900",children:"Recovery Code"}),(0,c.jsx)("p",{className:"text-sm text-gray-600",children:"Generate a new recovery code to access your account if you lose your authenticator device."})]}),(0,c.jsx)("button",{type:"button",onClick:handleGenerateRecoveryCode,className:"btn btn-primary btn-sm",disabled:eD,children:"Generate New Code"})]}),eQ&&(0,c.jsx)("div",{className:"p-4 bg-blue-50 border border-blue-200 rounded-md",children:(0,c.jsxs)("div",{className:"space-y-4",children:[(0,c.jsxs)("div",{className:"space-y-2",children:[(0,c.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"New Recovery Code"}),(0,c.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,c.jsx)("code",{className:"flex-1 p-3 bg-white text-lg font-mono rounded border text-center tracking-wider",children:eV}),(0,c.jsxs)("div",{className:"flex flex-col space-y-2",children:[(0,c.jsx)("button",{type:"button",onClick:handleCopyRecoveryCode,"aria-label":eX?"Recovery code copied to clipboard":"Copy recovery code to clipboard",className:"px-3 py-2 text-sm rounded transition-all duration-200 ".concat(eX?"bg-green-500 text-white focus:ring-2 focus:ring-green-500 focus:ring-offset-2":"bg-gray-200 hover:bg-gray-300 focus:ring-2 focus:ring-gray-500 focus:ring-offset-2"),children:eX?"Copied!":"Copy"}),(0,c.jsx)("button",{type:"button",onClick:()=>{let e="SCOREDETECT MFA RECOVERY CODE\n=====================================\n\nIMPORTANT: Keep this file secure and treat it like a password!\n\nWHAT IS THIS RECOVERY CODE?\nThis recovery code is your backup method to access your ScoreDetect account if you lose access to your Multi-Factor Authentication (MFA) device (like your phone with the authenticator app).\n\nYOUR RECOVERY CODE:\n".concat(eV,'\n\nSECURITY INSTRUCTIONS:\n• Store this file in a secure location (password manager, encrypted drive, or safe physical location)\n• Do NOT share this code with anyone - treat it like your password\n• Do NOT store this file in unsecured locations (desktop, email drafts, cloud storage without encryption)\n• This code can only be used ONCE - after using it, you\'ll need to generate a new one\n• If you suspect this code has been compromised, generate a new recovery code immediately\n\nWHEN TO USE THIS CODE:\n• When you lose or break your phone with the authenticator app\n• When you can\'t access your MFA device for any reason\n• As a last resort to regain access to your account\n\nHOW TO USE THIS CODE:\n1. Go to the ScoreDetect login page\n2. Enter your email and password\n3. When prompted for MFA, look for "Use recovery code" or "Lost your device?" option\n4. Enter the recovery code above: ').concat(eV,"\n5. After successful login, immediately set up a new MFA device and generate a new recovery code\n\nIMPORTANT NOTES:\n• This recovery code was generated on: ").concat(new Date().toLocaleStr
2ing(),"\n• Each recovery code can only be used once\n• After using this code, you must generate a new one for future use\n• Keep this file updated - old recovery codes become invalid when new ones are generated\n\nNEED HELP?\nIf you have trouble using this recovery code or need assistance, contact our support team.\n\nGenerated by ScoreDetect Security System\nhttps://www.scoredetect.com"),n=new Blob([e],{type:"text/plain"}),a=URL.createObjectURL(n),c=document.createElement("a");c.href=a;let u=new Date,pad=e=>e.toString().padStart(2,"0"),p="".concat(u.getFullYear()).concat(pad(u.getMonth()+1)).concat(pad(u.getDate()),"_").concat(pad(u.getHours())).concat(pad(u.getMinutes())).concat(pad(u.getSeconds()));c.download="mfa-recovery-code-scoredetect-".concat(p,".txt"),document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(a),(0,E.Z)("Recovery code with instructions downloaded!")},className:"px-3 py-2 text-sm bg-blue-600 text-white rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",children:"Download"})]})]}),(0,c.jsx)("p",{className:"text-xs text-gray-500",children:"Click the copy button or download button to save your recovery code."})]}),(0,c.jsx)("div",{className:"p-3 bg-yellow-50 border border-yellow-200 rounded-md",children:(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("div",{className:"flex-shrink-0",children:(0,c.jsx)("svg",{className:"h-5 w-5 text-yellow-400",viewBox:"0 0 20 20",fill:"currentColor",children:(0,c.jsx)("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})})}),(0,c.jsxs)("div",{className:"ml-3",children:[(0,c.jsx)("h3",{className:"text-sm font-medium text-yellow-800",children:"Important Security Notice"}),(0,c.jsx)("div",{className:"mt-2 text-sm text-yellow-700",children:(0,c.jsx)("p",{children:"Keep this recovery code secure and private. Anyone with this code can access your account if you lose your authenticator device."})})]})]})}),(0,c.jsx)("div",{className:"pt-2",children:(0,c.jsx)("button",{type:"button",onClick:()=>{eG(!1),eK(""),eJ(!1)},className:"w-full px-4 py-2 bg-gray-600 text-white rounded-md hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-gray-500 focus:ring-offset-2",children:"Close"})})]})})]})]})]})}),(0,c.jsx)("section",{id:"security-question",children:(0,c.jsxs)(b.Z,{title:"Security Question",description:"Your security question helps you recover your account if you lose access to your MFA device. Security questions cannot be changed after initial setup for security and compliance purposes.",isCollapsed:ts,onCollapseToggle:e=>{tn(e)},children:[(0,c.jsx)("div",{className:"my-3",children:(0,c.jsx)(W.Z,{href:"https://docs.scoredetect.com/faq/how-to-setup-my-security-question-on-scoredetect",className:"link link-primary",children:"How to video and instructions"})}),eD?(0,c.jsx)("div",{className:"m-6",children:(0,c.jsx)(R.Z,{})}):ez?(0,c.jsx)("div",{className:"mt-6",children:(0,c.jsx)(H.Z,{onComplete:handleSecurityQuestionSetupComplete,title:"Set Up Security Question",description:"This will help you recover your account if you lose access to your MFA device. Once set up, security questions cannot be changed."})}):eW?(0,c.jsxs)("div",{className:"mt-6 space-y-4",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)("h4",{className:"text-lg font-medium text-gray-900",children:"Current Security Question"}),(0,c.jsx)("p",{className:"text-sm text-gray-600",children:eH})]}),(0,c.jsx)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4",children:(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("div",{className:"flex-shrink-0",children:(0,c.jsx)("svg",{className:"h-5 w-5 text-blue-400",viewBox:"0 0 20 20",fill:"currentColor",children:(0,c.jsx)("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z",clipRule:"evenodd"})})}),(0,c.jsxs)("div",{className:"ml-3",children:[(0,c.jsx)("h3",{className:"text-sm font-medium text-blue-800",children:"Security Question Change Request"}),(0,c.jsx)("div",{className:"mt-2 text-sm text-blue-700",children:(0,c.jsxs)("p",{children:["For security and compliance purposes, security questions cannot be modified through the user interface after initial setup. If you need to change your security question, please contact our support team at"," ",(0,c.jsx)("a",{href:"mailto:[email protected]",className:"font-medium underline hover:text-blue-600",children:"[email protected]"}),". Additional identity verification will be required to process your request."]})})]})]})})]}):(0,c.jsxs)("div",{className:"mt-6 space-y-4",children:[(0,c.jsx)("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4",children:(0,c.jsxs)("div",{className:"flex",children:[(0,c.jsx)("div",{className:"flex-shrink-0",children:(0,c.jsx)("svg",{className:"h-5 w-5 text-yellow-400",viewBox:"0 0 20 20",fill:"currentColor",children:(0,c.jsx)("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})})}),(0,c.jsxs)("div",{className:"ml-3",children:[(0,c.jsx)("h3",{className:"text-sm font-medium text-yellow-800",children:"Security Question Not Set Up"}),(0,c.jsx)("div",{className:"mt-2 text-sm text-yellow-700",children:(0,c.jsx)("p",{children:"You haven't set up a security question yet. This is required to help you recover your account if you lose access to your MFA device."})})]})]})}),(0,c.jsx)("button",{onClick:()=>
2e$(!0),className:"bg-purple-600 text-white py-2 px-4 rounded-md hover:bg-purple-700 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-offset-2 transition-colors",children:"Set Up Security Question"})]})]})}),"business"===$&&(0,c.jsx)("section",{id:"custom-domain",children:(0,c.jsx)(b.Z,{title:"Custom Domain",description:'Enter your custom domain to white-label all your certificates. We recommend using a subdomain e.g. "trust.yourdomain.com".',isCollapsed:!1,children:er?(0,c.jsxs)(c.Fragment,{children:[" ",(0,c.jsx)("div",{className:"m-6",children:(0,c.jsx)(R.Z,{})})]}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("div",{className:"mt-6 md:flex gap-12",children:(0,c.jsxs)("div",{className:"mt-4 md:mt-0 col-span-3",children:[(0,c.jsx)("div",{className:"uppercase text-xs font-medium mb-2",children:"Custom Domain"}),""!==V&&(0,c.jsx)("div",{className:"font-semibold ... truncate overflow-hidden w-[250px] md:w-auto inline-flex",children:V}),""!==V&&(0,c.jsx)("div",{className:"inline-flex align-middle ml-12 items-center gap-2 text-sm font-normal",children:(0,c.jsx)(c.Fragment,{children:K?(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)("span",{className:"text-left cursor-help tooltip tooltip-bottom","data-tip":"Your custom domain is verified and active.",children:[(0,c.jsx)("span",{className:"inline-flex rounded-full bg-cyan-500 w-2 h-2"})," ",(0,c.jsx)("span",{className:"underline decoration-dotted underline-offset-2",children:"Active"}),(0,c.jsx)(D(),{src:"/info-icon.svg",width:16,height:16,alt:"tooltip icon",className:"inline-block align-text-middle ml-1"})]})}):(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)("span",{className:"text-left cursor-help tooltip tooltip-bottom","data-tip":"Please wait for the DNS to propagate. It may take up to 2 hours. You may refresh the page to update the status. If you have any questions, please contact [email protected]",children:[(0,c.jsx)("span",{className:"inline-flex rounded-full bg-yellow-500 w-2 h-2"})," ",(0,c.jsx)("span",{className:"underline decoration-dotted underline-offset-2",children:"Pending DNS verification"}),(0,c.jsx)(D(),{src:"/info-icon.svg",width:16,height:16,alt:"tooltip icon",className:"inline-block align-text-middle ml-1"})]})})})})]})}),(0,c.jsxs)("div",{className:"flex items-start justify-between flex-col sm:flex-row sm:items-center mt-4 gap-4",children:[(0,c.jsx)("div",{className:"inline-flex gap-4 items-center",children:(0,c.jsx)("input",{type:"text",className:"input input-bordered w-[300px] max-w-full",placeholder:"E.g. trust.yourdomain.com",onChange:e=>ef(e.target.value),ref:e6})}),(0,c.jsxs)("div",{className:"sm:flex gap-2",children:[(0,c.jsx)("button",{className:"btn btn-primary",type:"button",onClick:handleChangeCustomDomain,children:"Change Domain"}),(0,c.jsx)("button",{className:"btn btn-ghost",type:"button",onClick:handleResetCustomDomain,children:"Reset"})]})]}),(0,c.jsx)("p",{className:"mt-4 mb-4",children:"After you have added your custom domain, you will need to configure your DNS with a new entry."}),(0,c.jsx)("div",{className:"mb-4",children:(0,c.jsxs)("div",{className:"",children:[(0,c.jsxs)("div",{className:"flex lg:grid grid-cols-12 gap-2",children:[(0,c.jsx)("span",{className:"font-bold",children:"Type:"}),(0,c.jsx)("span",{className:"col-span-11",children:(0,c.jsx)("code",{children:"CNAME"})})]}),(0,c.jsxs)("div",{className:"flex lg:grid grid-cols-12 gap-2",children:[(0,c.jsx)("span",{className:"font-bold",children:"Name:"}),(0,c.jsx)("span",{className:"col-span-11",children:(0,c.jsx)("code",{children:V||"trust.yourdomain.com"})})]}),(0,c.jsxs)("div",{className:"flex lg:grid grid-cols-12 gap-2",children:[(0,c.jsx)("span",{className:"font-bold",children:"Value:"}),(0,c.jsx)("span",{className:"col-span-11",children:(0,c.jsx)("code",{children:"cname-explorer.scoredetect.com"})})]}),(0,c.jsxs)("div",{className:"flex lg:grid grid-cols-12 gap-2",children:[(0,c.jsx)("span",{className:"font-bold",children:"TTL:"}),(0,c.jsx)("span",{className:"col-span-11",children:(0,c.jsx)("em",{children:"60s or auto"})})]})]})}),(0,c.jsxs)("p",{className:"mb-4 text-sm",children:["Note that it does sometimes take up to 2 hours for records to propagate and for the SSL certificate to be created. For complex custom domain configurations, please contact us at"," ",(0,c.jsx)(I(),{href:"mailto:[email protected]",className:"link link-hover link-primary",children:"[email protected]"})]})]})})}),(0,c.jsx)("section",{id:"change-password",children:(0,c.jsx)(b.Z,{title:"Change Password",description:"You can change your password here.",isCollapsed:e7,onCollapseToggle:e=>{e9(e)},children:er?(0,c.jsxs)(c.Fragment,{children:[" ",(0,c.jsx)("div",{className:"m-6",children:(0,c.jsx)(R.Z,{})})]}):(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)("div",{className:"flex items-start justify-between flex-col sm:flex-row sm:items-center mt-4 gap-4",children:[(0,c.jsx)("input",{type:"password",className:"input input-bordered w-[300px] max-w-full",placeholder:"Your new password",onChange:e=>ec(e.target.value),ref:e3,autoComplete:"new-password"}),(0,c.jsx)("button",{className:"btn btn-primary",type:"button",onClick:handleChangePassword,children:"Change Password"})]})})})}),(0,c.jsxs)("section",{id:"danger-zone",children:[(0,c.jsxs)(b.Z,{title:"Danger Zone",description:"",isCollapsed:!0,children:[(0,c.jsxs)("div",{className:"prose mt-4",children:[(0,c.jsx)("h3",{className:"text-lg",children:"Delete Account"}),(0,c.jsx)("p",{children:"We are sorry to see you go. Please note that this action is irreversible. All your data and your certificates will be deleted. You will be logged out after this action. You can always sign up again later."})]}),(0,c.jsxs)("div",{className:"flex items-start justify-between flex-col sm:flex-row sm:items-center mt-4",children:[(0,c.jsx)("p",{className:"mb-4 sm:mb-0",children:"Do you wish to delete your account?"}),(0,c.jsx)("button",{className:"btn btn-warning",disabled:er,onClick:e=>{var n;e.preventDefault(),null===(n=e0.current)||void 0===n||n.showModal()},children:"Delete account?"})]})]}),(0,c.jsxs)("dialog",{id:"deleting_account_modal_why",className:"modal",ref:e0,children:[(0,c.jsxs)("div",{className:"modal-box",children:[(0,c.jsx)("form",{method:"dialog",onSubmit:handleCloseAllModals,children:(0,c.jsx)("button",{className:"btn btn-sm btn-circle btn-ghost absolute right-2 top-2",children:"✕"})}),(0,c.jsx)("form",{children:(0,c.jsxs)("fieldset",{className:"block",children:[(0,c.jsx)("legend",{className:"text-gray-700",children:"Why are you deleting your account?"}),(0,c.jsxs)("div",{className:"mt-2",children:[(0,c.jsx)("div",{children:(0,c.jsxs)("label",{className:"inline-flex items-center cursor-pointer",children:[(0,c.jsx)("input",{type:"radio",name:"deleting_account_why",value:"i_dont_need_it_anymore",className:"radio radio-primary",checked:"i_dont_need_it_anymore"===eo,onChange:handleDeletingAccountWhy}),(0,c.jsx)("span",{className:"ml-2",children:"I don't need it anymore"})]})}),(0,c.jsx)("div",{children:(0,c.jsxs)("label",{className:"inline-flex items-center cursor-pointer",children:[(0,c.jsx)("input",{type:"radio",name:"deleting_account_why",value:"its_too_expensive",className:"radio radio-primary",checked:"its_too_expensive"===eo,onChange:handleDeletingAccountWhy}),(0,c.jsx)("span",{className:"ml-2",children:"It's too expensive"})]})}),(0,c.jsx)("div",{children:(0,c.jsxs)("label",{className:"inline-flex items-center cursor-pointer",children:[(0,c.jsx)("input",{type:"radio",name:"deleting_account_why",value:"im_switching_to_someone_else",className:"radio radio-primary",checked:"im_switching_to_someone_else"===eo,onChange:handleDeletingAccountWhy}),(0,c.jsx)("span",{className:"ml-2",children:"I'm switching to someone else"})]})}),(0,c.jsx)("div",{children:(0,c.jsxs)("label",{className:"inline-flex items-center cursor-pointer",children:[(0,c.jsx)("input",{type:"radio",name:"deleting_account_why",value:"other",className:"radio radio-primary",checked:"other"===eo,onChange:handleDeletingAccountWhy}),(0,c.jsx)("span",{className:"ml-2",children:"Other"})]})}),(0,c.jsx)("div",{children:(0,c.jsx)("textarea",{className:"textarea textarea-bordered w-full mt-2 border-primary hidden",placeholder:"We are using our listening ears \uD83D\uDC42 - please let us know why you wish to delete your account.",onChange:e=>{ew(e.target.value)},maxLength:1e4,ref:e1})})]})]})}),(0,c.jsx)("div",{className:"mt-2",children:(0,c.jsx)("button",{className:"btn btn-warning",disabled:er,onClick:e=>{var n,a;e.preventDefault(),null===(n=e0.current)||void 0===n||n.close(),null===(a=e2.current)||void 0===a||a.showModal()},children:"Delete account?"})})]}),(0,c.jsx)("form",{method:"dialog",className:"modal-backdrop",onSubmit:handleCloseAllModals,children:(0,c.jsx)("button",{children:"close"})})]}),(0,c.jsxs)("dialog",{id:"deleting_account_modal_explain",className:"modal",ref:e2,children:[(0,c.jsxs)("div",{className:"modal-box",children:[(0,c.jsx)("form",{method:"dialog",onSubmit:handleCloseAllModals,children:(0,c.jsx)("button",{className:"btn btn-sm btn-circle btn-ghost absolute right-2 top-2",children:"✕"})}),(0,c.jsxs)("form",{children:[(0,c.jsxs)("fieldset",{className:"block",children:[(0,c.jsx)("legend",{className:"text-gray-700",children:"Deleting your account will do the following:"}),(0,c.jsx)("div",{className:"mt-2 prose text-error font-semibold",children:(0,c.jsxs)("ul",{children:[(0,c.jsx)("li",{children:"Log you out of ScoreDetect on all devices"}),(0,c.jsx)("li",{children:"Delete all of your ScoreDetect account information"}),(0,c.jsx)("li",{children:"Delete all of your ScoreDetect certificates"}),(0,c.jsx)("li",{children:"Cancel your Subscription"}),(0,c.jsx)("li",{children:"Unsubscribe from all ScoreDetect email and notifications"})]})})]}),(0,c.jsx)("button",{className:"btn btn-error mt-4",onClick:handleDeleteAccount,children:"Delete account"})]})]}),(0,c.jsx)("form",{method:"dialog",className:"modal-backdrop",onSubmit:handleCloseAllModals,children:(0,c.jsx)("button",{children:"close"})})]})]})]})]})]})}},7351:function(e){e.exports={root:"LoadingDots_root__8o4w0",blink:"LoadingDots_blink__iunUN"}}},function(e){e.O(0,[315,9774,2888,179],function(){return e(e.s=20473)}),_N_E=e.O()}]);

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.