PageSourceSearch

https://www.imtilak.net/build/assets/TwoFactor-6abe7ec5.js

js imtilak.net collected 2026-10-02 11:25:06 UTC 6,545 bytes, 4 lines download raw bytes

1import{_ as L,o as z,V as U,u as q,D as m,j as r,a as d,c as u,i as C,l as B,g as k,b as t,a2 as D,d as n,q as b,e as g,s as R,w as A,v as H,n as S,F as O,N as x,t as c,a1 as P,a0 as G}from"./app-3768782b.js";import"./_commonjsHelpers-23102255.js";const J=["dir"],K={class:"container"},Q={class:"auth-card-container"},W={class:"auth-card"},X={class:"auth-card-header"},Y={class:"card-title"},Z={class:"card-subtitle"},tt={key:0,class:"status-alert",role:"status"},et={key:1,class:"error-alert",role:"alert"},ot={class:"input-field-group"},nt={class:"input-label",for:"otp-input"},at={class:"input-wrapper"},st={key:0,class:"field-error-text",role:"alert"},rt=["disabled"],it={key:0,class:"spinner-icon"},lt={class:"resend-countdown-section"},dt=["disabled"],ut={key:0,class:"spinner-icon mini-spinner"},ct={class:"countdown-number"},pt={class:"auth-footer-prompt"},vt={__name:"TwoFactor",setup(ft){z(()=>{typeof document<"u"&&document.body.classList.add("auth-page"),y=setInterval(()=>{s.value<=0||(s.value-=1)},1e3)}),U(()=>{typeof document<"u"&&document.body.classList.remove("auth-page"),y&&clearInterval(y)});const $=q(),w=m(()=>$.props.locale||"en"),M=m(()=>["ar","fa"].includes(w.value)),a=r(""),p=r(!1),v=r(!1),i=r(""),f=r({}),h=r(""),s=r(300);let y=null;const F=e=>{if(e<=0)return"00:00";const o=Math.floor(e/60),l=e%60;return`${String(o).padStart(2,"0")}:${String(l).padStart(2,"0")}`},j=m(()=>F(s.value)),_=e=>{var l;const o=(l=f.value)==null?void 0:l[e];return Array.isArray(o)&&o.length?o[0]:typeof o=="string"?o:""},V=()=>{a.value=(a.value||"").replace(/[^0-9]/g,"").slice(0,6)},N=m(()=>`/${w.value}/2fa/verify`),E=m(()=>`/${w.value}/2fa/resend`),I=()=>{if(!p.value){if(i.value="",f.value={},h.value="",V(),!a.value||a.value.length!==6){f.value={otp:[c("validation.size.string",{attribute:"otp",size:6})||c("validation.required")||"Enter the 6-digit code"]};return}x.post(N.value,{otp:a.value},{onStart:()=>{p.value=!0},onError:e=>{f.value=e||{},i.value=_("otp")||c("common.auth.login_failed_try_again")||"Verification failed"},onFinish:()=>{p.value=!1}})}},T=()=>{v.value||(i.value="",h.value="",f.value={},x.post(E.value,{},{onStart:()=>{v.value=!0},onSuccess:()=>{h.value=c("common.two_factor.resent_successfully")||c("auth.two_factor.resent_successfully")||"Verification code resent successfully.",s.value=300},onError:()=>{i.value=c("common.auth.login_failed_try_again")||"Failed to resend code"},onFinish:()=>{v.value=!1}}))};return(e,o)=>(d(),u(O,null,[C(k(P),null,{default:B(()=>[t("title",null,`
2      `+n(e.$t("common.two_factor.title")||e.$t("auth.two_factor.title"))+` ||
3      `+n(k($).props.site_name||"Imtilak")+`
4    `,1)]),_:1}),t("div",{class:"two-factor-page",dir:M.value?"rtl":"ltr"},[t("div",K,[t("div",Q,[t("div",W,[t("div",X,[o[2]||(o[2]=D('<div class="auth-icon-badge" aria-hidden="true" data-v-6cdd4346><svg width="26" height="26" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" data-v-6cdd4346><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" data-v-6cdd4346></path><circle cx="12" cy="11" r="1" data-v-6cdd4346></circle><path d="m9 11 2 2 4-4" data-v-6cdd4346></path></svg></div>',1)),t("h1",Y,n(e.$t("common.two_factor.title")||e.$t("auth.two_factor.title")),1),t("p",Z,[b(n(e.$t("common.two_factor.description_line1")||e.$t("auth.two_factor.description_line1"))+" ",1),o[1]||(o[1]=t("br",null,null,-1)),b(" "+n(e.$t("common.two_factor.description_line2")||e.$t("auth.two_factor.description_line2")),1)])]),h.value?(d(),u("div",tt,[o[3]||(o[3]=t("svg",{class:"alert-icon",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[t("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),t("polyline",{points:"22 4 12 14.01 9 11.01"})],-1)),t("span",null,n(h.value),1)])):g("",!0),i.value&&!_("otp")?(d(),u("div",et,[o[4]||(o[4]=t("svg",{class:"alert-icon",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[t("circle",{cx:"12",cy:"12",r:"10"}),t("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),t("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})],-1)),t("span",null,n(i.value),1)])):g("",!0),t("form",{class:"auth-form",onSubmit:R(I,["prevent"])},[t("div",ot,[t("label",nt,n(e.$t("common.two_factor.verification_code")||e.$t("auth.two_factor.verification_code")||"Verification Code"),1),t("div",at,[A(t("input",{id:"otp-in
4put","onUpdate:modelValue":o[0]||(o[0]=l=>a.value=l),type:"text",name:"otp",class:S(["card-input otp-input",{"has-error":_("otp")}]),maxlength:"6",autocomplete:"one-time-code",inputmode:"numeric",placeholder:"------",autofocus:"",required:"",onInput:V},null,34),[[H,a.value]])]),_("otp")?(d(),u("span",st,n(_("otp")),1)):g("",!0)]),t("button",{type:"submit",class:"btn-auth-submit",disabled:p.value||a.value.length!==6},[p.value?(d(),u("span",it,[...o[5]||(o[5]=[t("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},[t("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})],-1)])])):g("",!0),t("span",null,n(e.$t("common.two_factor.verify_login")||e.$t("auth.two_factor.verify_login")),1)],8,rt),t("div",lt,[t("button",{type:"button",class:"btn-resend-link",disabled:v.value||s.value>0,onClick:T},[v.value?(d(),u("span",ut,[...o[6]||(o[6]=[t("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},[t("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})],-1)])])):g("",!0),t("span",null,n(e.$t("common.two_factor.resend_code")||e.$t("auth.two_factor.resend_code")),1)],8,dt),t("div",{class:S(["countdown-badge",{"is-expiring":s.value<60&&s.value>0,"is-expired":s.value<=0}])},[o[7]||(o[7]=t("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[t("circle",{cx:"12",cy:"12",r:"10"}),t("polyline",{points:"12 6 12 12 16 14"})],-1)),t("span",null,n(e.$t("common.two_factor.code_expires_in")||e.$t("auth.two_factor.code_expires_in")),1),t("span",ct,n(j.value),1)],2)]),t("div",pt,[C(k(G),{href:`/${w.value}/login`,class:"login-prompt-link"},{default:B(()=>[b(" ← "+n(e.$t("common.auth.login")||e.$t("trans.auth.login")||"Back to Login"),1)]),_:1},8,["href"])])],32)])])])],8,J)],64))}},mt=L(vt,[["__scopeId","data-v-6cdd4346"]]);export{mt as default};

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.