1import{j as w,l as g,m as H,w as O,M as D,c as a,d as e,t as y,e as t,g as x,I as L,h as N,v as j,x as z,aB as A,f as E,i as F,o as n}from"./CkHvFIio.js";import{a as P}from"./D8dTf_Wk.js";import{u as U}from"./BHkQhHcc.js";import{s as q}from"./BhQcPibS.js";import"./BWzXqvI3.js";const G=()=>{const v=g(""),c=g(""),p=g(!0),l=g(!1),r=g(null),u=g(60),m=g(!1);let i=null;const k=w(()=>{const o=Math.floor(u.value/60),h=u.value%60;return`${String(o).padStart(2,"0")}:${String(h).padStart(2,"0")}`}),d=w(()=>p.value?v.value.trim().length>0:c.value.trim().length>0),b=()=>{u.value=60,m.value=!1,i&&clearInterval(i),i=q(()=>{u.value>0?u.value--:(i&&clearInterval(i),m.value=!0)},1e3)},f=()=>{i&&(clearInterval(i),i=null)};return{mobileNumber:v,verificationCode:c,isMobileStep:p,isLoading:l,loginError:r,timer:u,isResendEnabled:m,formattedTimer:k,isFormValid:d,sendMobile:async()=>{l.value=!0,r.value=null;try{const o={mobileNumber:v.value.trim()},h=await $fetch("/api/auth/send-code",{method:"POST",body:o});p.value=!1,b(),r.value=null}catch(o){r.value=o.data?.message||o.statusMessage||"خطا در ارسا٠شÙ
ار٠Ù
ÙØ¨Ø§ÛÙ. ÙØ·ÙØ§Ù Ø¯ÙØ¨Ø§Ø±Ù ØªÙØ§Ø´ Ú©ÙÛØ¯."}finally{l.value=!1}},verifyCode:async()=>{l.value=!0,r.value=null;try{const o={mobileNumber:v.value.trim(),verificationCode:c.value.trim()},h=await $fetch("/api/auth/verify-code",{method:"POST",body:o});await U().loginSuccess({token:h.token,user:h.user},"/user/dashboard")}catch(o){r.value=o.data?.message||o.statusMessage||"کد تاÛÛØ¯ اشتبا٠است. ÙØ·ÙØ§Ù Ø¯ÙØ¨Ø§Ø±Ù ØªÙØ§Ø´ Ú©ÙÛØ¯."}finally{l.value=!1}},resendCode:async()=>{l.value=!0,r.value=null;try{const o={mobileNumber:v.value.trim()};await $fetch("/api/auth/send-code",{method:"POST",body:o}),b(),r.value=null}catch(o){r.value=o.data?.message||o.statusMessage||"خطا در ارسا٠Ù
جدد کد. ÙØ·ÙØ§Ù Ø¯ÙØ¨Ø§Ø±Ù ØªÙØ§Ø´ Ú©ÙÛØ¯."}finally{l.value=!1}},goBackToMobile:()=>{p.value=!0,c.value="",r.value=null,f()},cleanup:()=>{f()}}},J={class:"max-w-screen-xl mx-auto px-5 py-20"},K={class:"grid grid-cols-1 lg:grid-cols-12 gap-8"},Q={class:"lg:col-span-4"},W={class:"w-full bg-white rounded-lg shadow dark:border md:mt-0 sm:max-w-md xl:p-0 dark:bg-gray-800 dark:border-gray-700"},X={class:"p-6 space-y-4 md:space-y-6 sm:p-8"},Y={class:"text-xl font-bold leading-tight tracking-tight text-gray-900 md:text-2xl dark:text-white"},Z={key:0,class:"relative rounded-lg border border-red-200 bg-red-50 p-4 text-sm text-red-800 dark:border-red-300 dark:bg-red-900/20 dark:text-red-200 flex items-start gap-3"},ee={class:"input-text"},te={class:"relative"},se=["disabled"],oe=["disabled"],le={key:0,class:"animate-spin h-5 w-5 mr-2",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},ae={key:1},ne={key:2},re={class:"input-text"},ie={class:"relative"},de=["disabled"],ce={class:"flex items-center justify-between"},ue={class:"flex items-start"},pe={class:"ml-3 text-sm"},me={key:0},he={class:"font-bold text-primary-600"},ge={key:1,class:"text-green-600 font-medium"},ve=["disabled"],be=["disabled"],fe={key:0,class:"animate-spin h-5 w-5 mr-2",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},ye={key:1},xe={key:2},we=["disabled"],_e={class:"lg:col-span-6 flex flex-col justify-center"},ke={class:"text-2xl font-bold mb-4"},Ce={class:"text-primary-500 text-3xl"},Me=["innerHTML"],je=H({__name:"login",async setup(v){let c,p;const{data:l}=([c,p]=O(()=>F("/api/page/login","$fAbHnE57iO")),c=await c,p(),c),r=w(()=>l.value?.seo),u=w(()=>l.value?.title);P(r,u,null,w(()=>l.value?.faqs||[]));const{mobileNumber:m,verificationCode:i,isMobileStep:k,isLoading:d,loginError:b,timer:f,isResendEnabled:_,isFormValid:C,sendMobile:S,verifyCode:T,resendCode:B,goBackToMobile:o,cleanup:h}=G();D(()=>{h()});const V=async()=>{await S()},I=async()=>{await T()},R=async()=>{await B()},$=()=>{o()};return(Se,s)=>(n(),a("section",null,[e("div",J,[e("div",K,[e("div",Q,[e("div",W,[e("div",X,[e("h2",Y,y(t(l)?.altTitle),1),e("p",null,y(t(l)?.description),1),t(b)?(n(),a("div",Z,[s[2]||(s[2]=e("svg",{class:"h-5 w-5 flex-shrink-0 mt-0.5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[e("path",{"fill-rule":"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","clip-rule":"evenodd"})],-1)),e("span",null,y(t(b)),1)])):x("",!0),t(k)?(n(),a("form",{key:1,onSubmit:L(V,["prevent"]),class:"space-y-4 md:space-y-6 ss02"},[e("div",ee,[e("div",te,[s[3]||(s[3]=N('<div class="absolute inset-y-0 h-13 start-0 flex items-center ps-3 pointer-events-none"><svg class="w-7 h-7 text-gray-500" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"><path stroke-width="1.5" d="M13.5 2h-3c-2.357 0-3.536 0-4.268.732S5.5 4.643 5.5 7v10c0 2.357 0 3.535.732 4.268C7.035 22 8.143 22 10.5 22h3c2.357 0 3.535 0 4.268-.732c.732-.733.732-1.911.732-4.268V7c0-2.357 0-3.536-.732-4.268C17.035 2 15.857 2 13.5 2"></path><path stroke-width="1.2" d="M12 19h.01"></path></g></svg></div>',1)),j(e("input",{"onUpdate:modelValue":s[0]||(s[0]=M=>A(m)?m.value=M:null),type:"tel",inputmode:"numeric",class:"bg-white border border-gray-300 text-right text-gray-600 text-base font-semibold rounded-lg focus:ring-primary-500 focus:border-primary-500 block w-full pe-12 p-3.5",placeholder:"Ø´Ù
ار٠Ù
ÙØ¨Ø§ÛÙ",maxlength:"11",disabled:t(d)},null,8,se),[[z,t(m)]])])]),e("button",{type:"submit",disabled:t(d)||!t(C),class:"w-full inline-flex items-center justify-center text-white bg-gradient-to-r from-primary-400 to-primary-500 hover:bg-gradient-to-br focus:ring-4 focus:outline-none focus:ring-blue-300 shadow-lg shadow-blue-500/50 font-medium rounded-lg text-base px-5 py-2.5 text-center disabled:opacity-50 disabled:cursor-not-allowed transition"},[t(d)?(n(),a("svg",le,[...s[4]||(s[4]=[e("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)])])):x("",!0),t(d)?(n(),a("span",ae,"در ØØ§Ù ارساÙ...")):(n(),a("span",ne,"ÙØ±Ùد"))],8,oe)],32)):(n(),a("form",{key:2,onSubmit:L(I,["prevent"]),class:"space-y-4 md:space-y-6 ss02"},[e("div",re,[e("div",ie,[s[5]||(s[5]=N('<div class="absolute inset-y-0 h-13 start-0 flex items-center ps-3 pointer-events-none"><svg class="w-7 h-7 text-gray-500" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"><path stroke-width="1.5" d="M13.5 2h-3c-2.357 0-3.536 0-4.268.732S5.5 4.643 5.5 7v10c0 2.357 0 3.535.732 4.268C7.035 22 8.143 22 10.5 22h3c2.357 0 3.535 0 4.268-.732c.732-.733.732-1.911.732-4.268V7c0-2.357 0-3.536-.732-4.268C17.035 2 15.857 2 13.5 2"></path><path stroke-width="1.2" d="M12 19h.01"></path></g></svg></div>',1)),j(e("input",{"onUpdate:modelValue":s[1]||(s[1]=M=>A(i)?i.value=M:null),type:"tel",inputmode:"numeric",class:"bg-white border border-gray-300 text-right text-gray-600 text-base font-semibold rounded-lg focus:ring-primary-500 focus:border-primary-500 block w-full pe-12 p-3.5",placeholder:"کد تاÛÛØ¯",maxlength:"5",disabled:t(d)},null,8,de),[[z,t(i)]])])]),e("div",ce,[e("div",ue,[e("div",pe,[t(f)>0&&!t(_)?(n(),a("span",me,[s[6]||(s[6]=E(" ارسا٠Ù
جدد کد تا ",-1)),e("span",he,y(t(f)),1),s[7]||(s[7]=E(" ثاÙÛ٠دÛگر ",-1))])):t(_)?(n(),a("span",ge," Ø¢ÛØ§ کد را Ø¯Ø±ÛØ§Ùت ÙÚ©Ø±Ø¯Ù Ø§ÛØ¯Ø ")):x("",!0)])]),t(_)?(n(),a("button",{key:0,t
1ype:"button",onClick:R,disabled:t(d),class:"text-sm font-medium text-primary-600 hover:underline dark:text-primary-500 disabled:opacity-50 disabled:cursor-not-allowed"}," ارسا٠Ù
جدد کد ",8,ve)):x("",!0)]),e("button",{type:"submit",disabled:t(d)||!t(C),class:"w-full inline-flex items-center justify-center text-white bg-gradient-to-r from-primary-400 to-primary-500 hover:bg-gradient-to-br focus:ring-4 focus:outline-none focus:ring-blue-300 shadow-lg shadow-blue-500/50 font-medium rounded-lg text-base px-5 py-2.5 text-center disabled:opacity-50 disabled:cursor-not-allowed transition"},[t(d)?(n(),a("svg",fe,[...s[8]||(s[8]=[e("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)])])):x("",!0),t(d)?(n(),a("span",ye,"در ØØ§Ù بررسÛ...")):(n(),a("span",xe,"ÙØ±Ùد"))],8,be),e("button",{type:"button",onClick:$,disabled:t(d),class:"w-full text-sm font-medium text-primary-600 hover:underline dark:text-primary-500 disabled:opacity-50 disabled:cursor-not-allowed"}," تغÛÛØ± Ø´Ù
ار٠Ù
ÙØ¨Ø§ÛÙ ",8,we)],32))])])]),s[9]||(s[9]=e("div",{class:"hidden lg:block lg:col-span-2"},null,-1)),e("div",_e,[e("h1",ke,[e("span",Ce,y(t(l)?.title),1)]),e("div",{class:"text-gray-600 text-lg text-justify",innerHTML:t(l)?.content},null,8,Me)])])])]))}});export{je 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.