Files
Lucky_Wheel/apps/client/dist/assets/CampaignWheelView-Ds-m3TZi.js
T

3 lines
23 KiB
JavaScript
Raw Normal View History

2026-09-15 17:26:42 +03:30
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/wheel-classiccasinowheel-DHnlMe5J.js","assets/vendor-vue-kYoPQr5S.js","assets/wheel-neoncyberwheel-DfkNbyES.js","assets/wheel-minimalflatwheel-B0XcCliG.js","assets/wheel-luxurygoldwheel-B7W8x-n_.js","assets/wheel-playfulcartoonwheel-D5oxWUgO.js","assets/wheel-rusticwoodwheel-B1GPATiK.js","assets/wheel-galaxyspacewheel-CO8tbi9S.js","assets/wheel-candylandwheel-BJ8iho3G.js","assets/wheel-fireflamewheel-CV6G4NBw.js","assets/wheel-crystalicewheel-BJbsr9tW.js"])))=>i.map(i=>d[i]);
import{u as T,a as q,_ as S}from"./index-DZsNn1RR.js";import{t as D,a as z,W as C}from"./wheel-classiccasinowheel-DHnlMe5J.js";import{d as V,w as Z,o as J,b as i,e,v as f,u as t,X as Q,k,P as ee,K as te,t as h,g,H as F,I as B,J as U,L as P,C as Y,A as se,R as le,r as p,a as l,i as ae,y as K,z as N,T as ne,B as oe,S as j,M as ie,E as W,V as H,c as L,N as R,j as re,O as ue,x as de,Q as ce,U as xe,W as G,Y as me,Z as pe,_ as ve,$ as be}from"./vendor-vue-kYoPQr5S.js";import{c as fe}from"./vendor-ui-B5JVzsfH.js";const he={key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/70 backdrop-blur-sm animate-fade-in"},ge={class:"w-full max-w-sm bg-slate-900 border border-slate-800 rounded-2xl shadow-2xl p-6 text-right relative overflow-hidden"},ye={class:"text-center mb-6"},we={class:"inline-flex items-center justify-center w-12 h-12 rounded-xl bg-blue-500/10 text-blue-400 mb-3"},_e={class:"text-lg font-bold text-white"},Ae={class:"text-xs text-slate-400 mt-1"},Ce={key:0,class:"mb-4 p-3 rounded-lg bg-rose-500/10 border border-rose-500/20 text-rose-400 text-xs font-medium"},ke={class:"relative"},Ie=["disabled"],Ee=["disabled"],Se={class:"flex items-center justify-between pt-2 text-xs text-slate-400"},Re={key:0,class:"text-slate-400 font-medium"},$e=V({__name:"AuthModal",props:{show:{type:Boolean},campaignId:{}},emits:["close","success"],setup($,{emit:M}){const O=$,o=M,c=T(),v=p("MOBILE"),u=p(""),y=p(""),x=p(!1),s=p(null),w=p(60);let b=null;function I(){w.value=60,b&&clearInterval(b),b=window.setInterval(()=>{w.value>0?w.value--:b&&clearInterval(b)},1e3)}Z(()=>O.show,m=>{m?(v.value="MOBILE",y.value="",s.value=null):b&&clearInterval(b)}),J(()=>{b&&clearInterval(b)});async function d(){const m=u.value.trim();if(!/^09[0-9]{9}$/.test(m)){s.value="لطفاً یک شماره موبایل معتبر ۱۱ رقمی (مثل ۰۹۱۲۳۴۵۶۷۸۹) وارد نمایید.";return}x.value=!0,s.value=null;try{const n=await c.requestOtp(m);if(m==="09382507041"){await c.verifyOtp(m,n?.devCode||"11111",O.campaignId),o("success"),o("close");return}v.value="OTP",I()}catch(n){s.value=n.response?.data?.message||"خطا در ارسال کد تأیید"}finally{x.value=!1}}async function _(){const m=y.value.trim();if(m.length!==5){s.value="کد تأیید پیامک‌شده ۵ رقم است.";return}x.value=!0,s.value=null;try{await c.verifyOtp(u.value.trim(),m,O.campaignId),o("success"),o("close")}catch(n){s.value=n.response?.data?.message||"کد تأیید نامعتبر یا منقضی شده است."}finally{x.value=!1}}return(m,n)=>$.show?(l(),i("div",he,[e("div",ge,[e("button",{onClick:n[0]||(n[0]=r=>o("close")),class:"absolute top-4 left-4 p-1.5 rounded-full text-slate-400 hover:text-white hover:bg-slate-800 transition"},[f(t(Q),{class:"w-5 h-5"})]),e("div",ye,[e("div",we,[v.value==="MOBILE"?(l(),k(t(ee),{key:0,class:"w-6 h-6"})):(l(),k(t(te),{key:1,class:"w-6 h-6"}))]),e("h3",_e,h(v.value==="MOBILE"?"ورود به گردونه شانس":"تأیید شماره همراه"),1),e("p",Ae,h(v.value==="MOBILE"?"جهت دریافت شانس و ثبت جوایز، شماره همراه خود را وارد کنید.":`کد ۵ رقمی ارسال شده به ${t(D)(u.value)} را وارد نمایید.`),1)]),s.value?(l(),i("div",Ce,h(s.value),1)):g("",!0),v.value==="MOBILE"?(l(),i("form",{key:1,onSubmit:F(d,["prevent"]),class:"space-y-4"},[e("div",null,[n[4]||(n[4]=e("label",{class:"block text-xs font-medium text-slate-300 mb-1.5"},"شماره تلفن همراه",-1)),e("div",ke,[B(e("input",{"onUpdate:modelValue":n[1]||(n[1]=r=>u.value=r),type:"tel",inputmode:"numeric",maxlength:"11",placeholder:"۰۹۱۲۳۴۵۶۷۸۹",dir:"ltr",class:"w-full px-4 py-3 bg-slate-950 border border-slate-700 focus:border-blue-500 focus:ring-1 focus:ring-blue-500 rounded-xl text-white text-center text-base tracking-widest outline-none transition placeholder:text-slate-600 font-mono",required:""},null,512),[[U,u.value]])])]),e("button",{type:"submit",disabled:x.value||!u.value,class:"w-full py-3 px-4 rounded-xl bg-gradient-to-r from-blue-600 to-indi