PageSourceSearch

https://donito.me/_nuxt/6967e1943733/DJv1yql7.js

js donito.me collected 2026-09-24 21:06:58 UTC 9,143 bytes, 1 lines download raw bytes

1import{g as ee,n as L,a as te,b as ne,r as ae,v as oe,_ as ie,c as se}from"./kosRCU1r.js";import{K as le,x as ue,M as re,r as o,c as m,m as ce,v as de,a as pe,o as r,b as c,e as n,E as ve,h as x,g as _e,T as fe,R as U,V as S,t as d,C as T,n as me,i as ye,L as he,z as ge,D as be,_ as ke}from"./BafG0enI.js";import{g as we}from"./Dv4m7iBK.js";import{u as Ce}from"./BbwJrXS9.js";import{t as xe}from"./b7c24pf3.js";import{s as Se}from"./DhHT-QsW.js";import"./BporYn2C.js";const Te={class:"social-continuation",dir:"rtl"},Me={key:"loading",class:"social-continuation__state","aria-live":"polite"},Ae={key:"phone"},Ie={"aria-hidden":"true"},qe={class:"social-continuation__description"},Ve={key:0,class:"social-continuation__email",dir:"ltr"},Ee={key:"otp"},De=["disabled"],Ne={class:"social-continuation__description"},$e={dir:"ltr"},Pe={class:"social-continuation__resend"},Re={key:0,class:"social-continuation__checking"},Fe={key:2},Oe={key:"error",class:"social-continuation__state social-continuation__state--error"},ze={class:"social-continuation__error-icon","aria-hidden":"true"},Be=le({__name:"auth-social-continue",setup(Ke){ue({title:"تکمیل ورود",meta:[{name:"robots",content:"noindex, nofollow"}]});const M=re(),N=Ce(),u=o("loading"),y=o("google"),A=o(null),$=o(null),I=o(""),l=o(!1),p=o(0),b=o(0),P=o("ورود تکمیل نشد"),R=o("در انجام ورود مشکلی پیش آمد. لطفاً دوباره تلاش کنید."),v=o(null),q=o(null);let k=null;const F=m({get:()=>I.value,set:e=>{I.value=L(e)}}),w=m(()=>L(I.value)),O=m(()=>/^09\d{9}$/.test(w.value)),h=m(()=>te(y.value)),W=m(()=>({google:"G",twitch:"T",kick:"K"})[y.value]),V=m(()=>ne($.value||E(M.query.return_to)));function E(e){return Array.isArray(e)?e[0]:e}function z(e){const t=E(e);return t==="twitch"||t==="kick"?t:"google"}function G(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():`${Date.now()}-${Math.random().toString(16).slice(2)}`}function H(e){be().$toast.error((e==null?void 0:e.message)||"در انجام درخواست مشکلی پیش آمد. دوباره تلاش کنید.",{theme:"colored",type:"error"})}function i(e,t){g(),P.value=e,R.value=t,u.value="error"}function D(e){const t=String((e==null?void 0:e.readable_code)||"");return(e==null?void 0:e.status)===410||t==="social_auth_flow_expired"?(i("زمان ورود به پایان رسید","برای حفظ امنیت، این فرایند منقضی شده است. ورود را دوباره آغاز کنید."),!0):t==="account_link_conflict"||t==="social_identity_conflict"||t==="ambiguous_cellphone"?(i("اتصال حساب نیاز به بررسی دارد","این اطلاعات به بیش از یک حساب مرتبط است. برای جلوگیری از اتصال اشتباه، با پشتیبانی دونیتو در تماس باشید."),!0):(e==null?void 0:e.status)===403||t==="user_is_not_active"?(i("حساب در دسترس نیست","این حساب در حال حاضر امکان ورود ندارد. برای بررسی بیشتر با پشتیبانی تماس بگیرید."),!0):(H(e),!1)}async function j(e=null){try{const t=await we();return t.data&&N.addME(t.data),t.data||e}catch{return e&&N.addME(e),e}}async function B(e=null){const t=await j(e);if(!t){i("نشست ورود ساخته نشد","ورود تایید شد اما دریافت اطلاعات حساب ممکن نبود. لطفاً دوباره وارد شوید.");return}const a=t.is_kyc_complete?V.value||"/panel/dashboard":"/panel/kyc";await U(a)}async function J(){var e;try{const a=(await ee()).data||{};if(a.status!=="phone_required"){i("وضعیت ورود معتبر نیست","این فرایند قابل ادامه نیست. ورود را دوباره آغاز کنید.");return}y.value=z(a.provider),A.value=typeof a.masked_email=="string"?a.masked_email:null,$.value=typeof a.return_to=="string"?a.return_to:null,u.value="phone",await S(),(e=q.value)==null||e.focus()}catch(t){D(t)||i("ارتباط برقرار نشد","دریافت وضعیت ورود ممکن نبود. لطفاً ورود را دوباره آغاز کنید.")}}async function K(){var t,a,_,f,s;if(!O.value||l.value)return;l.value=!0,b.value++,u.value==="otp"&&((t=v.value)==null||t.listenForWebOtp());let e=!1;try{const C=await ae(w.value,G());e=!0,u.value="otp",Y(Number(((a=C.data)==null?void 0:a.retry_after)||120))}catch(C){(_=v.value)==null||_.reset(),D(C)}finally{l.value=!1}e&&(await S(),await((f=v.value)==null?void 0:f.focus(0)),(s=v.value)==null||s.listenForWebOtp())}async function Q(e){var a,_,f;if(e.length!==6||l.value)return;l.value=!0;let t=!1;try{const s=await oe(w.value,e);await B(((a=s.data)==null?void 0:a.user)||null)}catch(s){b.value++,(_=v.value)==null||_.reset(),String((s==null?void 0:s.readable_code)||"")==="otp_expired"&&(p.value=0),D(s),t=u.value==="otp"}finally{l.value=!1}t&&(await S(),await((f=v.value)==null?void 0:f.focus(0)))}async function X(){var e;b.value++,g(),u.value="phone",await S(),(e=q.value)==null||e.focus()}function Y(e){g(),p.value=Math.max(0,e),k=Se(()=>{p.value=Math.max(0,p.value-1),p.value===0&&g()},1e3)}function g(){k&&clearInterval(k),k=null}async function Z(){const e=V.value?{redirect:V.value}:void 0;await U({path:"/auth",query:e})}return ce(async()=>{y.value=z(M.query.provider);const e=E(M.query.result);if(e==="authenticated"){await B();return}if(e==="cancelled"){i("ورود لغو شد",`ورود با ${h.value} توسط شما لغو شد.`);return}if(e==="expired"){i("زمان ورود به پایان رسید","برای حفظ امنیت، این فرایند منقضی شده است. ورود را دوباره آغاز کنید.");return}if(e==="provider_error"){i("ارتباط برقرار نشد",`دریافت اطلاعات از ${h.value} ممکن نبود. چند لحظه دیگر دوباره تلاش کنید.`);return}if(e==="account_unavailable"){i("حساب در دسترس نیست","این حساب در حال حاضر امکان ورود ندارد. برای بررسی بیشتر با پشتیبانی دونیتو در تماس باشید.");return}if(e==="conflict"){i("اتصال حساب نیاز به بررسی دارد","این حساب اجتماعی قبلاً به حساب دیگری متصل شده است. برای جلوگیری از اتصال اشتباه، با پشتیبانی دونیتو در تماس باشید.");return}await J()}),de(()=>g()),(e,t)=>{const a=ie,_=se,f=pe("font-awesome-icon");return r(),c("section",Te,[t[11]||(t[11]=n("div",{class:"social-continuation__mark"},[n("img",{src:ve,alt:"دونیتو"})],-1)),x(fe,{name:"social-step",mode:"out-in"},{default:_e(()=>[u.value==="loading"?(r(),c("div",Me,[t[2]||(t[2]=n("span",{class:"social-continuation__loader","aria-hidden":"true"},null,-1)),t[3]||(t[3]=n("h1",null,"در حال تکمیل ورود",-1)),n("p",null,"ارتباط امن با "+d(h.value)+" در حال بررسی است.",1)])):u.value==="phone"?(r(
1),c("div",Ae,[n("span",{class:me(["social-continuation__provider",`is-${y.value}`])},[n("b",Ie,d(W.value),1),T(" "+d(h.value)+" متصل شد ",1)],2),t[4]||(t[4]=n("h1",null,"شماره موبایل را تایید کنید",-1)),n("p",qe," برای اتصال امن "+d(h.value)+" به حساب دونیتو، شماره موبایل خود را وارد کنید. ",1),A.value?(r(),c("p",Ve,d(A.value),1)):ye("",!0),x(a,{ref_key:"mobileInput",ref:q,modelValue:F.value,"onUpdate:modelValue":t[0]||(t[0]=s=>F.value=s),"input-id":"social-auth-cellphone",valid:O.value,loading:l.value,autofocus:"",onSubmit:K},null,8,["modelValue","valid","loading"]),t[5]||(t[5]=n("p",{class:"social-continuation__hint"}," اگر این شماره قبلاً در دونیتو ثبت شده باشد، اتصال به همان حساب انجام می‌شود. ",-1))])):u.value==="otp"?(r(),c("div",Ee,[n("button",{type:"button",class:"social-continuation__back",disabled:l.value,onClick:X},t[6]||(t[6]=[n("span",{"aria-hidden":"true"},"→",-1),n("span",null,"تغییر شماره",-1)]),8,De),t[10]||(t[10]=n("h1",null,"کد تایید را وارد کنید",-1)),n("p",Ne,[t[7]||(t[7]=T(" کد شش‌رقمی ارسال‌شده به ")),n("b",$e,d(w.value),1),t[8]||(t[8]=T(" را وارد کنید. "))]),n("form",{class:"social-continuation__otp",onSubmit:t[1]||(t[1]=he(()=>{},["prevent"]))},[x(_,{ref_key:"otpInput",ref:v,"id-prefix":"social-auth-code",disabled:l.value,"reset-key":b.value,onComplete:Q},null,8,["disabled","reset-key"])],32),n("div",Pe,[l.value?(r(),c("span",Re,t[9]||(t[9]=[n("span",{class:"social-continuation__spinner"},null,-1),T(" در حال بررسی کد ")]))):p.value===0?(r(),c("button",{key:1,type:"button",onClick:K}," ارسال مجدد کد ")):(r(),c("span",Fe,"ارسال مجدد تا "+d(ge(xe)(p.value))+" ثانیه",1))])])):(r(),c("div",Oe,[n("span",ze,[x(f,{icon:"exclamation-triangle"})]),n("h1",null,d(P.value),1),n("p",null,d(R.value),1),n("button",{type:"button",class:"social-continuation__retry",onClick:Z}," بازگشت به صفحه ورود ")]))]),_:1})])}}}),Qe=ke(Be,[["__scopeId","data-v-c52f00d0"]]);export{Qe 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.