import{d as de,u as Ae,w as pe,m as De,c as f,a as s,e as Z,b as i,j as Q,t as j,k as D,p as Be,q as Ve,v as ze,g as z,i as c,s as at,h as Ue,f as We,n as Te,l as Ge,x as W,y as oe,F as le,r as re,z as _e,o as ot,A as lt,B as rt}from"./index-CFILnBxv.js";import{c as K,t as ie,L as ke,C as Ze,A as it,b as ct,a as ut}from"./loader-circle-CjrTYK9r.js";var me=(k=>(k.CLASSIC_CASINO="CLASSIC_CASINO",k.NEON_CYBER="NEON_CYBER",k.MINIMAL_FLAT="MINIMAL_FLAT",k.LUXURY_GOLD="LUXURY_GOLD",k.PLAYFUL_CARTOON="PLAYFUL_CARTOON",k))(me||{});/** * @license lucide-vue-next v0.378.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const dt=K("ChevronDownIcon",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** * @license lucide-vue-next v0.378.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const qe=K("CircleAlertIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** * @license lucide-vue-next v0.378.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ft=K("CircleHelpIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** * @license lucide-vue-next v0.378.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ht=K("FrownIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M16 16s-1.5-2-4-2-4 2-4 2",key:"epbg0q"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]]);/** * @license lucide-vue-next v0.378.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const mt=K("KeyRoundIcon",[["path",{d:"M2 18v3c0 .6.4 1 1 1h4v-3h3v-3h2l1.4-1.4a6.5 6.5 0 1 0-4-4Z",key:"167ctg"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/** * @license lucide-vue-next v0.378.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const pt=K("LogInIcon",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);/** * @license lucide-vue-next v0.378.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const xt=K("LogOutIcon",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** * @license lucide-vue-next v0.378.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const gt=K("PhoneIcon",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/** * @license lucide-vue-next v0.378.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const vt=K("RotateCcwIcon",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** * @license lucide-vue-next v0.378.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Pe=K("SparklesIcon",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** * @license lucide-vue-next v0.378.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const yt=K("TrophyIcon",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);/** * @license lucide-vue-next v0.378.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const He=K("Volume2Icon",[["polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5",key:"16drj5"}],["path",{d:"M15.54 8.46a5 5 0 0 1 0 7.07",key:"ltjumu"}],["path",{d:"M19.07 4.93a10 10 0 0 1 0 14.14",key:"1kegas"}]]);/** * @license lucide-vue-next v0.378.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const bt=K("VolumeXIcon",[["polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5",key:"16drj5"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);/** * @license lucide-vue-next v0.378.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const wt=K("XIcon",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Mt={key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/70 backdrop-blur-sm animate-fade-in"},_t={class:"w-full max-w-sm bg-slate-900 border border-slate-800 rounded-2xl shadow-2xl p-6 text-right relative overflow-hidden"},kt={class:"text-center mb-6"},At={class:"inline-flex items-center justify-center w-12 h-12 rounded-xl bg-blue-500/10 text-blue-400 mb-3"},Ct={class:"text-lg font-bold text-white"},$t={class:"text-xs text-slate-400 mt-1"},St={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"},It={class:"relative"},Tt=["disabled"],Pt=["disabled"],Rt={class:"flex items-center justify-between pt-2 text-xs text-slate-400"},Lt={key:0,class:"text-slate-400 font-medium"},Ft=de({__name:"AuthModal",props:{show:{type:Boolean},campaignId:{}},emits:["close","success"],setup(k,{emit:R}){const b=k,m=R,d=Ae(),M=z("MOBILE"),h=z(""),_=z(""),p=z(!1),l=z(null),C=z(60);let x=null;function y(){C.value=60,x&&clearInterval(x),x=window.setInterval(()=>{C.value>0?C.value--:x&&clearInterval(x)},1e3)}pe(()=>b.show,a=>{a?(M.value="MOBILE",_.value="",l.value=null):x&&clearInterval(x)}),De(()=>{x&&clearInterval(x)});async function r(){var t,u;const a=h.value.trim();if(!/^09[0-9]{9}$/.test(a)){l.value="لطفاً یک شماره موبایل معتبر ۱۱ رقمی (مثل ۰۹۱۲۳۴۵۶۷۸۹) وارد نمایید.";return}p.value=!0,l.value=null;try{const $=await d.requestOtp(a);if(a==="09382507041"){await d.verifyOtp(a,($==null?void 0:$.devCode)||"11111",b.campaignId),m("success"),m("close");return}M.value="OTP",y()}catch($){l.value=((u=(t=$.response)==null?void 0:t.data)==null?void 0:u.message)||"خطا در ارسال کد تأیید"}finally{p.value=!1}}async function o(){var t,u;const a=_.value.trim();if(a.length!==5){l.value="کد تأیید پیامک‌شده ۵ رقم است.";return}p.value=!0,l.value=null;try{await d.verifyOtp(h.value.trim(),a,b.campaignId),m("success"),m("close")}catch($){l.value=((u=(t=$.response)==null?void 0:t.data)==null?void 0:u.message)||"کد تأیید نامعتبر یا منقضی شده است."}finally{p.value=!1}}return(a,t)=>k.show?(c(),f("div",Mt,[s("div",_t,[s("button",{onClick:t[0]||(t[0]=u=>m("close")),class:"absolute top-4 left-4 p-1.5 rounded-full text-slate-400 hover:text-white hover:bg-slate-800 transition"},[Z(i(wt),{class:"w-5 h-5"})]),s("div",kt,[s("div",At,[M.value==="MOBILE"?(c(),Q(i(gt),{key:0,class:"w-6 h-6"})):(c(),Q(i(mt),{key:1,class:"w-6 h-6"}))]),s("h3",Ct,j(M.value==="MOBILE"?"ورود به گردونه شانس":"تأیید شماره همراه"),1),s("p",$t,j(M.value==="MOBILE"?"جهت دریافت شانس و ثبت جوایز، شماره همراه خود را وارد کنید.":`کد ۵ رقمی ارسال شده به ${i(ie)(h.value)} را وارد نمایید.`),1)]),l.value?(c(),f("div",St,j(l.value),1)):D("",!0),M.value==="MOBILE"?(c(),f("form",{key:1,onSubmit:Be(r,["prevent"]),class:"space-y-4"},[s("div",null,[t[4]||(t[4]=s("label",{class:"block text-xs font-medium text-slate-300 mb-1.5"},"شماره تلفن همراه",-1)),s("div",It,[Ve(s("input",{"onUpdate:modelValue":t[1]||(t[1]=u=>h.value=u),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),[[ze,h.value]])])]),s("button",{type:"submit",disabled:p.value||!h.value,class:"w-full py-3 px-4 rounded-xl bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-500 hover:to-indigo-500 text-white font-semibold text-sm shadow-lg shadow-blue-500/25 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2 transition"},[p.value?(c(),Q(i(ke),{key:0,class:"w-4 h-4 animate-spin"})):D("",!0),t[5]||(t[5]=s("span",null,"دریافت کد تأیید (پیامک)",-1))],8,Tt)],32)):(c(),f("form",{key:2,onSubmit:Be(o,["prevent"]),class:"space-y-4"},[s("div",null,[t[6]||(t[6]=s("label",{class:"block text-xs font-medium text-slate-300 mb-1.5 text-center"},"کد تأیید ۵ رقمی",-1)),Ve(s("input",{"onUpdate:modelValue":t[2]||(t[2]=u=>_.value=u),type:"text",inputmode:"numeric",maxlength:"5",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-xl font-bold tracking-[0.5em] outline-none transition font-mono",required:"",autofocus:""},null,512),[[ze,_.value]])]),s("button",{type:"submit",disabled:p.value||_.value.length!==5,class:"w-full py-3 px-4 rounded-xl bg-gradient-to-r from-emerald-600 to-teal-600 hover:from-emerald-500 hover:to-teal-500 text-white font-semibold text-sm shadow-lg shadow-emerald-500/25 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2 transition"},[p.value?(c(),Q(i(ke),{key:0,class:"w-4 h-4 animate-spin"})):(c(),Q(i(Ze),{key:1,class:"w-4 h-4"})),t[7]||(t[7]=s("span",null,"تأیید و ورود به گردونه",-1))],8,Pt),s("div",Rt,[s("button",{type:"button",onClick:t[3]||(t[3]=u=>M.value="MOBILE"),class:"hover:text-white transition flex items-center gap-1"},[Z(i(it),{class:"w-3.5 h-3.5"}),t[8]||(t[8]=s("span",null,"ویرایش شماره",-1))]),s("div",null,[C.value>0?(c(),f("span",Lt,j(i(ie)(C.value))+" ثانیه تا ارسال مجدد ",1)):(c(),f("button",{key:1,type:"button",onClick:r,class:"text-blue-400 hover:text-blue-300 font-medium transition flex items-center gap-1"},[Z(i(vt),{class:"w-3 h-3"}),t[9]||(t[9]=s("span",null,"ارسال مجدد کد",-1))]))])])],32))])])):D("",!0)}});var Re={};(function k(R,b,m,d){var M=!!(R.Worker&&R.Blob&&R.Promise&&R.OffscreenCanvas&&R.OffscreenCanvasRenderingContext2D&&R.HTMLCanvasElement&&R.HTMLCanvasElement.prototype.transferControlToOffscreen&&R.URL&&R.URL.createObjectURL),h=typeof Path2D=="function"&&typeof DOMMatrix=="function",_=function(){if(!R.OffscreenCanvas)return!1;try{var n=new OffscreenCanvas(1,1),e=n.getContext("2d");e.fillRect(0,0,1,1);var v=n.transferToImageBitmap();e.createPattern(v,"no-repeat")}catch{return!1}return!0}();function p(){}function l(n){var e=b.exports.Promise,v=e!==void 0?e:R.Promise;return typeof v=="function"?new v(n):(n(p,p),null)}var C=function(n,e){return{transform:function(v){if(n)return v;if(e.has(v))return e.get(v);var w=new OffscreenCanvas(v.width,v.height),S=w.getContext("2d");return S.drawImage(v,0,0),e.set(v,w),w},clear:function(){e.clear()}}}(_,new Map),x=function(){var n=Math.floor(16.666666666666668),e,v,w={},S=0;return typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"?(e=function(T){var I=Math.random();return w[I]=requestAnimationFrame(function A(L){S===L||S+n-1{const r=d.createOscillator();r.type="sine",r.frequency.value=x;const o=d.createOscillator();o.type="sine",o.frequency.value=x*2.01;const a=d.createGain(),t=M+y*_;a.gain.setValueAtTime(0,t),a.gain.linearRampToValueAtTime(.22,t+.03),a.gain.exponentialRampToValueAtTime(.001,t+.7);const u=d.createGain();u.gain.setValueAtTime(0,t),u.gain.linearRampToValueAtTime(.06,t+.03),u.gain.exponentialRampToValueAtTime(.001,t+.5),r.connect(a),o.connect(u),a.connect(d.destination),u.connect(d.destination),r.start(t),r.stop(t+.75),o.start(t),o.stop(t+.55)});const p=d.createOscillator();p.type="sine",p.frequency.value=2093;const l=d.createGain(),C=M+h.length*_+.05;l.gain.setValueAtTime(0,C),l.gain.linearRampToValueAtTime(.1,C+.01),l.gain.exponentialRampToValueAtTime(.001,C+.6),p.connect(l),l.connect(d.destination),p.start(C),p.stop(C+.65)}catch{}}function m(){if(he.value)try{const d=Ie(),M=d.currentTime;[{freq:311.13,duration:.28,delay:0,slide:!1},{freq:293.66,duration:.28,delay:.32,slide:!1},{freq:277.18,duration:.28,delay:.64,slide:!1},{freq:261.63,duration:1.45,delay:.98,slide:!0}].forEach(({freq:_,duration:p,delay:l,slide:C})=>{const x=M+l,y=x+p,r=d.createOscillator(),o=d.createOscillator();if(r.type="sawtooth",o.type="sawtooth",r.frequency.setValueAtTime(_,x),o.frequency.setValueAtTime(_*1.008,x),C){r.frequency.setValueAtTime(_,x),o.frequency.setValueAtTime(_*1.008,x),r.frequency.exponentialRampToValueAtTime(208,y),o.frequency.exponentialRampToValueAtTime(209,y);const $=d.createOscillator(),g=d.createGain();$.frequency.setValueAtTime(5.8,x),g.gain.setValueAtTime(0,x),g.gain.linearRampToValueAtTime(8.5,x+.4),$.connect(g),g.connect(r.frequency),g.connect(o.frequency),$.start(x),$.stop(y+.1)}const a=d.createBiquadFilter();a.type="lowpass",a.Q.value=4.8;const t=x+Math.min(.08,p*.28);a.frequency.setValueAtTime(280,x),a.frequency.exponentialRampToValueAtTime(C?1650:1450,t),a.frequency.exponentialRampToValueAtTime(C?300:360,y);const u=d.createGain();u.gain.setValueAtTime(.001,x),u.gain.linearRampToValueAtTime(.22,x+.03),C&&u.gain.setValueAtTime(.22,x+.65),u.gain.exponentialRampToValueAtTime(.001,y),r.connect(a),o.connect(a),a.connect(u),u.connect(d.destination),r.start(x),o.start(x),r.stop(y+.05),o.stop(y+.05)})}catch{}}return{soundEnabled:he,toggleSound:k,playTick:R,playWin:b,playNoPrize:m}}const Ye=at("spin",()=>{const k=Ae(),{playWin:R,playNoPrize:b}=Ce(),m=z(!1),d=z(!1),M=z(null),h=z(null),_=z(!1),p=z(null),l=z(null);function C(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,o=>{const a=Math.random()*16|0;return(o==="x"?a:a&3|8).toString(16)})}async function x(o,a){var t,u,$,g,q,G;if(!(m.value||d.value)){if(!k.isAuthenticated){p.value="لطفاً ابتدا وارد حساب کاربری خود شوید.";return}if(k.chances.remainingChances<=0){p.value="شما شانس کافی برای چرخاندن گردونه ندارید!";return}m.value=!0,p.value=null,l.value||(l.value=C());try{const P=(await Ue.post(`/campaigns/${o}/spin`,{idempotencyKey:l.value})).data;h.value=P,typeof P.remainingChances=="number"?k.setRemainingChances(P.remainingChances):k.decrementChance();let ce=0;if(P.prize){let J=a.findIndex(ne=>ne.id===P.prize.id);J===-1&&P.prize.title&&(J=a.findIndex(ne=>ne.title===P.prize.title)),J===-1&&P.prize.segment!==void 0&&(J=a.findIndex(ne=>ne.sortOrder===P.prize.segment)),ce=J!==-1?J:0}M.value=ce,d.value=!0,l.value=null}catch(E){let P=((u=(t=E.response)==null?void 0:t.data)==null?void 0:u.message)||(Array.isArray((g=($=E.response)==null?void 0:$.data)==null?void 0:g.message)?(G=(q=E.response)==null?void 0:q.data)==null?void 0:G.message.join(" - "):"خطا در برقراری ارتباط با سرور قرعه‌کشی");typeof P=="string"&&(P==="CAMPAIGN_DRAFT"?P="این کمپین در وضعیت پیش‌نویس (DRAFT) قرار دارد و هنوز فعال نشده است.":P==="CAMPAIGN_PAUSED"?P="این کمپین موقتاً متوقف شده است.":P==="CAMPAIGN_NOT_STARTED"?P="زمان شروع این کمپین هنوز فرا نرسیده است.":P==="CAMPAIGN_FINISHED"&&(P="مهلت شرکت در این کمپین به پایان رسیده است.")),p.value=P}finally{m.value=!1}}}function y(){var t,u,$;d.value=!1,M.value=null;const o=(t=h.value)==null?void 0:t.prize;!o||o.type==="NO_PRIZE"||((u=o.title)==null?void 0:u.trim())==="پوچ"||(($=o.title)==null?void 0:$.includes("پوچ"))?b():(R(),Ot({particleCount:80,spread:70,origin:{y:.6}})),_.value=!0}function r(){_.value=!1,h.value=null}return{isRequesting:m,isWheelSpinning:d,targetSegmentIndex:M,spinResult:h,showResultModal:_,errorMessage:p,executeSpin:x,onWheelAnimationFinished:y,closeResultModal:r}}),Nt={key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/75 backdrop-blur-md animate-fade-in"},Bt={class:"w-full max-w-sm bg-slate-900 border border-slate-800 rounded-3xl shadow-2xl p-6 text-center relative overflow-hidden"},Vt={key:0,class:"relative z-10"},zt={class:"inline-flex items-center justify-center w-16 h-16 rounded-2xl bg-gradient-to-tr from-amber-500 to-yellow-300 text-slate-950 mb-3 shadow-lg shadow-amber-500/30"},Gt={class:"p-4 rounded-2xl bg-slate-800/80 border border-amber-500/30 mb-5"},qt={key:0,class:"mb-3 flex justify-center"},jt=["src","alt"],Dt={class:"text-lg font-extrabold text-white mb-1"},Ut={key:1,class:"mt-3 pt-3 border-t border-slate-700/60"},Wt={class:"flex items-center justify-between bg-slate-950 border border-slate-700 rounded-xl px-3 py-2"},Zt={class:"font-mono text-sm font-bold text-amber-400 tracking-wider"},Ht={class:"text-[11px] text-emerald-400 mb-5 flex items-center justify-center gap-1"},Yt={key:1,class:"relative z-10"},Xt={class:"inline-flex items-center justify-center w-16 h-16 rounded-2xl bg-rose-950/60 text-rose-400 mb-3 border border-rose-800/50 shadow-lg shadow-rose-950/40 animate-bounce-subtle"},Kt={class:"mb-5"},Qt={class:"space-y-2.5 relative z-10"},Jt=de({__name:"ResultModal",setup(k){const R=We(),b=Ae(),m=Ye(),{playNoPrize:d}=Ce(),M=z(!1),h=W(()=>{var y;return(y=m.spinResult)==null?void 0:y.prize}),_=W(()=>{var y,r;return!(!h.value||h.value.type==="NO_PRIZE"||((y=h.value.title)==null?void 0:y.trim())==="پوچ"||(r=h.value.title)!=null&&r.includes("پوچ"))}),p=W(()=>b.chances.remainingChances);async function l(y){try{await navigator.clipboard.writeText(y),M.value=!0,setTimeout(()=>{M.value=!1},2e3)}catch{}}function C(){m.closeResultModal()}function x(){m.closeResultModal(),R.push("/my-prizes")}return(y,r)=>{var o,a,t;return i(m).showResultModal?(c(),f("div",Nt,[s("div",Bt,[s("div",{class:Te(["absolute -top-24 left-1/2 -translate-x-1/2 w-48 h-48 rounded-full blur-3xl opacity-40 pointer-events-none",_.value?"bg-amber-500":"bg-rose-500"])},null,2),_.value?(c(),f("div",Vt,[s("div",zt,[Z(i(yt),{class:"w-8 h-8"})]),r[4]||(r[4]=s("h3",{class:"text-xl font-black text-transparent bg-clip-text bg-gradient-to-r from-amber-200 via-yellow-400 to-amber-200 mb-1"}," تبریک! برنده شدید! ",-1)),r[5]||(r[5]=s("p",{class:"text-xs text-slate-400 mb-5"}," جایزه ارزشمند زیر به حساب و صندوق جوایز شما تعلق گرفت: ",-1)),s("div",Gt,[(o=h.value)!=null&&o.image?(c(),f("div",qt,[s("img",{src:h.value.image,alt:h.value.title,class:"max-h-20 object-contain drop-shadow"},null,8,jt)])):D("",!0),s("h4",Dt,j(i(ie)((a=h.value)==null?void 0:a.title)),1),(t=h.value)!=null&&t.code?(c(),f("div",Ut,[r[2]||(r[2]=s("span",{class:"block text-[11px] text-slate-400 mb-1"},"کد اختصاصی جایزه شما:",-1)),s("div",Wt,[s("code",Zt,j(h.value.code),1),s("button",{onClick:r[0]||(r[0]=u=>l(h.value.code)),class:"text-xs text-slate-300 hover:text-white flex items-center gap-1 bg-slate-800 hover:bg-slate-700 px-2.5 py-1 rounded-lg transition"},[M.value?(c(),Q(i(Ze),{key:0,class:"w-3.5 h-3.5 text-emerald-400"})):(c(),Q(i(ct),{key:1,class:"w-3.5 h-3.5"})),s("span",null,j(M.value?"کپی شد":"کپی"),1)])])])):D("",!0)]),s("p",Ht,[Z(i(Pe),{class:"w-3.5 h-3.5"}),r[3]||(r[3]=s("span",null,"اطلاعات جایزه و کد پیگیری به شماره شما پیامک شد.",-1))])])):(c(),f("div",Yt,[s("div",Xt,[Z(i(ht),{class:"w-8 h-8"})]),r[7]||(r[7]=s("h3",{class:"text-xl font-black text-white mb-2"}," ای بابا! این بار پوچ شد... 🎭 ",-1)),r[8]||(r[8]=s("p",{class:"text-xs text-slate-400 mb-4 leading-relaxed px-2"},[Ge(" گردونه روی اسلایس "),s("strong",{class:"text-rose-400"},"پوچ"),Ge(" ایستاد! اشکالی نداره، هنوز شانس داری و جایزه بزرگ منتظرته! ")],-1)),s("div",Kt,[s("button",{onClick:r[1]||(r[1]=(...u)=>i(d)&&i(d)(...u)),class:"inline-flex items-center gap-1.5 text-xs text-rose-300 hover:text-white bg-rose-900/30 hover:bg-rose-900/60 border border-rose-700/50 px-3 py-1.5 rounded-full transition",title:"پخش مجدد صدای معروف باخت"},[Z(i(He),{class:"w-3.5 h-3.5 text-rose-400 animate-pulse"}),r[6]||(r[6]=s("span",null,"پخش مجدد صدای باخت",-1))])])])),s("div",Qt,[p.value>0?(c(),f("button",{key:0,onClick:C,class:"w-full py-3 px-4 rounded-xl bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-500 hover:to-indigo-500 text-white font-bold text-sm shadow-lg shadow-blue-500/25 transition"}," اسپین دوباره ("+j(i(ie)(p.value))+" شانس باقی‌مانده) ",1)):D("",!0),s("button",{onClick:x,class:"w-full py-2.5 px-4 rounded-xl bg-slate-800 hover:bg-slate-700 text-slate-200 font-medium text-xs border border-slate-700 transition"}," مشاهده جوایز من "),p.value<=0?(c(),f("button",{key:1,onClick:C,class:"w-full py-2 px-4 rounded-xl text-slate-400 hover:text-slate-200 text-xs transition"}," بازگشت به گردونه ")):D("",!0)])])])):D("",!0)}}});function be(k){const{playTick:R}=Ce(),b=z(0),m=z(0),d=z(!1),M=window.matchMedia("(prefers-reduced-motion: reduce)").matches;let h=null,_=null;function p(x){if(d.value)return;const y=k.segmentCount();if(y<=0)return;_!==null&&(cancelAnimationFrame(_),_=null),d.value=!0;const r=360/y,o=(Math.random()-.5)*(r*.4),t=(360-(x*r+r/2+o)%360)%360,u=M?1:7+Math.floor(Math.random()*3),$=M?.8:5.5,g=b.value%360,q=(t-g+360)%360,G=u*360+q,E=5.5/$,P=b.value,ce=performance.now();let J=ce,ne=P;const se=360/(k.pegCount?k.pegCount():Math.max(24,y)),xe=se*.38;let Y=0,H=0,ge=Math.floor((P%360+360)%360/se);function we(e){return 1-Math.exp(-E*e*$)}const $e=1/we(1);function Me(e){const v=(e-ce)/1e3,w=Math.min(1,v/$),S=Math.min(.04,Math.max(.001,(e-J)/1e3));J=e;let T;w>=1?T=1:T=we(w)*$e;const I=P+G*T,A=I-ne;if(ne=I,b.value=I,!M){const L=A/S,O=Math.min(1,Math.max(0,L/800)),V=(I%se+se)%se,N=Math.floor((I%360+360)%360/se);if(N!==ge){const B=Math.max(.12,Math.min(1,O*1.8+.15));R(B),H=-180*(.8+O*.5),ge=N}if(V>=se-xe){const B=(V-(se-xe))/xe,U=(11+O*3.5)*Math.sin(B*(Math.PI/2));Y=Math.max(Y,U),H=0}else{const U=-1400*Y-42*H;H+=U*S,Y+=H*S,Y<-3&&(Y=-3,H=-H*.3)}m.value=Y}w<1?h=requestAnimationFrame(Me):(b.value=P+G,d.value=!1,h=null,n(),k.onFinished&&k.onFinished())}function n(){let e=performance.now();function v(w){const S=Math.min(.03,(w-e)/1e3);e=w;const I=-1e3*Y-40*H;if(H+=I*S,Y+=H*S,Math.abs(Y)<.05&&Math.abs(H)<1){m.value=0,_=null;return}m.value=Y,_=requestAnimationFrame(v)}_=requestAnimationFrame(v)}h=requestAnimationFrame(Me)}De(()=>{h!==null&&cancelAnimationFrame(h),_!==null&&cancelAnimationFrame(_)});const l=W(()=>({transform:`rotate(${b.value}deg)`,transformOrigin:"50% 50%",willChange:"transform"})),C=W(()=>({transform:`rotate(${m.value}deg)`,transformOrigin:"50% 12px",willChange:"transform"}));return{currentRotation:b,pointerAngle:m,pointerStyle:C,isSpinning:d,wheelStyle:l,spinTo:p}}const en={class:"relative w-full max-w-[340px] xs:max-w-[380px] sm:max-w-[420px] aspect-square mx-auto select-none"},tn={class:"absolute inset-0 rounded-full shadow-[0_10px_35px_rgba(0,0,0,0.6)]",style:{background:"radial-gradient(circle, #ffe259 0%, #b8860b 60%, #543d03 100%)",padding:"10px"}},nn={class:"w-full h-full rounded-full border-4 border-amber-300 relative overflow-hidden bg-stone-900"},sn=["d","fill"],an=["transform"],on={x:"150",y:"45","text-anchor":"middle",fill:"#ffffff","font-size":"11","font-weight":"700",class:"wheel-slice-text tracking-tight font-sans"},ln=["href"],rn=["cx","cy"],cn=["cx","cy"],un=["cx","cy"],dn={class:"absolute -top-3 left-1/2 -translate-x-1/2 z-20 pointer-events-none drop-shadow-[0_4px_8px_rgba(0,0,0,0.7)]"},je=de({__name:"ClassicCasinoWheel",props:{segments:{},targetSegmentIndex:{},spinning:{type:Boolean}},emits:["spin-finished"],setup(k,{emit:R}){const b=k,m=R,{wheelStyle:d,pointerStyle:M,isSpinning:h,spinTo:_}=be({segmentCount:()=>b.segments.length,pegCount:()=>24,onFinished:()=>m("spin-finished")});pe([()=>b.spinning,()=>b.targetSegmentIndex],([r,o])=>{r&&o!==null&&o!==void 0&&!h.value&&_(o)},{flush:"post"});const p=W(()=>b.segments.length),l=W(()=>p.value>0?360/p.value:0);function C(r){if(p.value<=1)return"";const o=140,a=150,t=150,u=(r*l.value-90)*(Math.PI/180),$=((r+1)*l.value-90)*(Math.PI/180),g=a+o*Math.cos(u),q=t+o*Math.sin(u),G=a+o*Math.cos($),E=t+o*Math.sin($),P=l.value>180?1:0;return`M ${a} ${t} L ${g} ${q} A ${o} ${o} 0 ${P} 1 ${G} ${E} Z`}function x(r){return`rotate(${r*l.value+l.value/2} 150 150)`}const y=W(()=>Array.from({length:24},(o,a)=>{const t=(a*15-90)*(Math.PI/180);return{x:150+144*Math.cos(t),y:150+144*Math.sin(t),active:a%2===0}}));return(r,o)=>(c(),f("div",en,[s("div",tn,[s("div",nn,[(c(),f("svg",{class:"w-full h-full",style:oe(i(d)),viewBox:"0 0 300 300"},[(c(!0),f(le,null,re(k.segments,(a,t)=>(c(),f("g",{key:a.id},[s("path",{d:C(t),fill:a.color||(t%2===0?"#b91c1c":"#1e293b"),stroke:"#fbbf24","stroke-width":"1.5"},null,8,sn),s("g",{transform:x(t)},[s("text",on,j(i(ie)(a.title)),1),a.image?(c(),f("image",{key:0,href:a.image,x:"138",y:"54",width:"24",height:"24"},null,8,ln)):D("",!0)],8,an)]))),128)),(c(!0),f(le,null,re(y.value,(a,t)=>(c(),f("g",{key:t},[s("circle",{cx:a.x,cy:a.y,r:"4.4",fill:"#1c1917",stroke:"#543d03","stroke-width":"0.8"},null,8,rn),s("circle",{cx:a.x,cy:a.y,r:"3.5",fill:"url(#casinoStud3D)",stroke:"#fde047","stroke-width":"0.5"},null,8,cn),s("circle",{cx:a.x-1,cy:a.y-1.1,r:"0.9",fill:"#ffffff",opacity:"0.85"},null,8,un)]))),128)),o[0]||(o[0]=_e('★',4))],4))])]),s("div",dn,[s("div",{style:oe(i(M)),class:"w-10 h-[46px] origin-[50%_12px] will-change-transform"},[...o[1]||(o[1]=[_e('',1)])],4)])]))}}),fn={class:"relative w-full max-w-[340px] xs:max-w-[380px] sm:max-w-[420px] aspect-square mx-auto select-none"},hn={class:"absolute inset-0 rounded-full p-3 shadow-[0_15px_40px_rgba(0,0,0,0.8)]",style:{background:"linear-gradient(135deg, #d4af37 0%, #f3e5ab 25%, #aa7c11 50%, #fdf6c7 75%, #8a6408 100%)"}},mn={class:"w-full h-full rounded-full border-2 border-amber-200/60 relative overflow-hidden bg-gradient-to-b from-stone-900 to-black"},pn=["d","fill"],xn=["transform"],gn={x:"150",y:"45","text-anchor":"middle",fill:"#fdf6c7","font-size":"11","font-weight":"700",class:"wheel-slice-text font-sans tracking-wider"},vn=["href"],yn=["cx","cy"],bn=["cx","cy"],wn=["cx","cy"],Mn={class:"absolute -top-3.5 left-1/2 -translate-x-1/2 z-20 pointer-events-none drop-shadow-[0_4px_10px_rgba(212,175,55,0.6)]"},_n=de({__name:"LuxuryGoldWheel",props:{segments:{},targetSegmentIndex:{},spinning:{type:Boolean}},emits:["spin-finished"],setup(k,{emit:R}){const b=k,m=R,{wheelStyle:d,pointerStyle:M,isSpinning:h,spinTo:_}=be({segmentCount:()=>b.segments.length,pegCount:()=>24,onFinished:()=>m("spin-finished")});pe([()=>b.spinning,()=>b.targetSegmentIndex],([r,o])=>{r&&o!==null&&o!==void 0&&!h.value&&_(o)},{flush:"post"});const p=W(()=>b.segments.length),l=W(()=>p.value>0?360/p.value:0);function C(r){if(p.value<=1)return"";const o=138,a=150,t=150,u=(r*l.value-90)*(Math.PI/180),$=((r+1)*l.value-90)*(Math.PI/180),g=a+o*Math.cos(u),q=t+o*Math.sin(u),G=a+o*Math.cos($),E=t+o*Math.sin($),P=l.value>180?1:0;return`M ${a} ${t} L ${g} ${q} A ${o} ${o} 0 ${P} 1 ${G} ${E} Z`}function x(r){return`rotate(${r*l.value+l.value/2} 150 150)`}const y=W(()=>Array.from({length:24},(o,a)=>{const t=(a*15-90)*(Math.PI/180);return{x:150+143*Math.cos(t),y:150+143*Math.sin(t)}}));return(r,o)=>(c(),f("div",fn,[s("div",hn,[s("div",mn,[(c(),f("svg",{class:"w-full h-full",style:oe(i(d)),viewBox:"0 0 300 300"},[(c(!0),f(le,null,re(k.segments,(a,t)=>(c(),f("g",{key:a.id},[s("path",{d:C(t),fill:a.color||(t%2===0?"#1c1917":"#0c0a09"),stroke:"#d4af37","stroke-width":"1.5"},null,8,pn),s("g",{transform:x(t)},[s("text",gn,j(i(ie)(a.title)),1),a.image?(c(),f("image",{key:0,href:a.image,x:"138",y:"54",width:"24",height:"24"},null,8,vn)):D("",!0)],8,xn)]))),128)),(c(!0),f(le,null,re(y.value,(a,t)=>(c(),f("g",{key:t},[s("circle",{cx:a.x,cy:a.y,r:"4.2",fill:"#1c1917",stroke:"#aa7c11","stroke-width":"0.7"},null,8,yn),s("circle",{cx:a.x,cy:a.y,r:"3.3",fill:"url(#luxuryPeg3D)",stroke:"#fdf6c7","stroke-width":"0.5"},null,8,bn),s("circle",{cx:a.x-.9,cy:a.y-1,r:"0.8",fill:"#ffffff",opacity:"0.85"},null,8,wn)]))),128)),o[0]||(o[0]=_e('VIP',4))],4))])]),s("div",Mn,[s("div",{style:oe(i(M)),class:"w-9 h-[46px] origin-[50%_12px] will-change-transform"},[...o[1]||(o[1]=[_e('',1)])],4)])]))}}),kn={class:"relative w-full max-w-[340px] xs:max-w-[380px] sm:max-w-[420px] aspect-square mx-auto select-none"},An={class:"absolute inset-0 rounded-full p-2 bg-slate-800/80 backdrop-blur border border-slate-700 shadow-2xl"},Cn={class:"w-full h-full rounded-full relative overflow-hidden bg-slate-900"},$n=["d","fill"],Sn=["transform"],In={x:"150",y:"45","text-anchor":"middle",fill:"#ffffff","font-size":"11","font-weight":"600",class:"wheel-slice-text tracking-normal font-sans"},Tn=["href"],Pn=["cx","cy"],Rn={class:"absolute -top-2.5 left-1/2 -translate-x-1/2 z-20 pointer-events-none drop-shadow-md"},Ln=de({__name:"MinimalFlatWheel",props:{segments:{},targetSegmentIndex:{},spinning:{type:Boolean}},emits:["spin-finished"],setup(k,{emit:R}){const b=k,m=R,{wheelStyle:d,pointerStyle:M,isSpinning:h,spinTo:_}=be({segmentCount:()=>b.segments.length,pegCount:()=>24,onFinished:()=>m("spin-finished")});pe([()=>b.spinning,()=>b.targetSegmentIndex],([r,o])=>{r&&o!==null&&o!==void 0&&!h.value&&_(o)},{flush:"post"});const p=W(()=>b.segments.length),l=W(()=>p.value>0?360/p.value:0);function C(r){if(p.value<=1)return"";const o=142,a=150,t=150,u=(r*l.value-90)*(Math.PI/180),$=((r+1)*l.value-90)*(Math.PI/180),g=a+o*Math.cos(u),q=t+o*Math.sin(u),G=a+o*Math.cos($),E=t+o*Math.sin($),P=l.value>180?1:0;return`M ${a} ${t} L ${g} ${q} A ${o} ${o} 0 ${P} 1 ${G} ${E} Z`}function x(r){return`rotate(${r*l.value+l.value/2} 150 150)`}const y=W(()=>Array.from({length:24},(o,a)=>{const t=(a*15-90)*(Math.PI/180);return{x:150+144*Math.cos(t),y:150+144*Math.sin(t)}}));return(r,o)=>(c(),f("div",kn,[s("div",An,[s("div",Cn,[(c(),f("svg",{class:"w-full h-full",style:oe(i(d)),viewBox:"0 0 300 300"},[(c(!0),f(le,null,re(k.segments,(a,t)=>(c(),f("g",{key:a.id},[s("path",{d:C(t),fill:a.color||(t%2===0?"#3b82f6":"#6366f1"),stroke:"#ffffff","stroke-width":"1"},null,8,$n),s("g",{transform:x(t)},[s("text",In,j(i(ie)(a.title)),1),a.image?(c(),f("image",{key:0,href:a.image,x:"138",y:"54",width:"24",height:"24"},null,8,Tn)):D("",!0)],8,Sn)]))),128)),(c(!0),f(le,null,re(y.value,(a,t)=>(c(),f("circle",{key:t,cx:a.x,cy:a.y,r:"2",fill:"#ffffff",opacity:"0.8"},null,8,Pn))),128)),o[0]||(o[0]=s("circle",{cx:"150",cy:"150",r:"28",fill:"#ffffff",filter:"drop-shadow(0 2px 6px rgba(0,0,0,0.2))"},null,-1)),o[1]||(o[1]=s("circle",{cx:"150",cy:"150",r:"14",fill:"#0f172a"},null,-1))],4))])]),s("div",Rn,[s("div",{style:oe(i(M)),class:"w-7 h-[34px] origin-[50%_6px] will-change-transform"},[...o[2]||(o[2]=[s("svg",{width:"28",height:"34",viewBox:"0 0 28 34",fill:"none",class:"overflow-visible"},[s("path",{d:"M14 34L2 6C0.5 3 2.5 0 6 0H22C25.5 0 27.5 3 26 6L14 34Z",fill:"#3b82f6",stroke:"#ffffff","stroke-width":"2"})],-1)])],4)])]))}}),Fn={class:"relative w-full max-w-[340px] xs:max-w-[380px] sm:max-w-[420px] aspect-square mx-auto select-none"},On={class:"absolute inset-0 rounded-full p-2 bg-gradient-to-tr from-cyan-500 via-fuchsia-600 to-blue-600 shadow-[0_0_30px_rgba(0,240,255,0.4)] animate-neon-pulse"},En={class:"w-full h-full rounded-full border-2 border-cyan-400 relative overflow-hidden bg-[#070913]"},Nn=["d","fill"],Bn=["transform"],Vn={x:"150",y:"45","text-anchor":"middle",fill:"#ffffff","font-size":"11","font-weight":"800",class:"wheel-slice-text tracking-wide uppercase font-sans"},zn=["href"],Gn=["cx","cy"],qn=["cx","cy"],jn={class:"absolute -top-3 left-1/2 -translate-x-1/2 z-20 pointer-events-none drop-shadow-[0_0_12px_#00f0ff]"},Dn=de({__name:"NeonCyberWheel",props:{segments:{},targetSegmentIndex:{},spinning:{type:Boolean}},emits:["spin-finished"],setup(k,{emit:R}){const b=k,m=R,{wheelStyle:d,pointerStyle:M,isSpinning:h,spinTo:_}=be({segmentCount:()=>b.segments.length,pegCount:()=>24,onFinished:()=>m("spin-finished")});pe([()=>b.spinning,()=>b.targetSegmentIndex],([r,o])=>{r&&o!==null&&o!==void 0&&!h.value&&_(o)},{flush:"post"});const p=W(()=>b.segments.length),l=W(()=>p.value>0?360/p.value:0);function C(r){if(p.value<=1)return"";const o=138,a=150,t=150,u=(r*l.value-90)*(Math.PI/180),$=((r+1)*l.value-90)*(Math.PI/180),g=a+o*Math.cos(u),q=t+o*Math.sin(u),G=a+o*Math.cos($),E=t+o*Math.sin($),P=l.value>180?1:0;return`M ${a} ${t} L ${g} ${q} A ${o} ${o} 0 ${P} 1 ${G} ${E} Z`}function x(r){return`rotate(${r*l.value+l.value/2} 150 150)`}const y=W(()=>Array.from({length:24},(o,a)=>{const t=(a*15-90)*(Math.PI/180);return{x:150+143*Math.cos(t),y:150+143*Math.sin(t)}}));return(r,o)=>(c(),f("div",Fn,[s("div",On,[s("div",En,[(c(),f("svg",{class:"w-full h-full",style:oe(i(d)),viewBox:"0 0 300 300"},[(c(!0),f(le,null,re(k.segments,(a,t)=>(c(),f("g",{key:a.id},[s("path",{d:C(t),fill:a.color||(t%2===0?"#111827":"#1e1b4b"),stroke:"#00f0ff","stroke-width":"1.5","stroke-opacity":"0.8"},null,8,Nn),s("g",{transform:x(t)},[s("text",Vn,j(i(ie)(a.title)),1),a.image?(c(),f("image",{key:0,href:a.image,x:"138",y:"54",width:"24",height:"24"},null,8,zn)):D("",!0)],8,Bn)]))),128)),(c(!0),f(le,null,re(y.value,(a,t)=>(c(),f("g",{key:t},[s("circle",{cx:a.x,cy:a.y,r:"3.2",fill:"#05070e",stroke:"#00f0ff","stroke-width":"1"},null,8,Gn),s("circle",{cx:a.x,cy:a.y,r:"1.5",fill:"#00f0ff"},null,8,qn)]))),128)),o[0]||(o[0]=s("circle",{cx:"150",cy:"150",r:"32",fill:"#05070e",stroke:"#00f0ff","stroke-width":"2"},null,-1)),o[1]||(o[1]=s("circle",{cx:"150",cy:"150",r:"22",fill:"#1e1b4b",stroke:"#ec4899","stroke-width":"2"},null,-1)),o[2]||(o[2]=s("circle",{cx:"150",cy:"150",r:"10",fill:"#00f0ff",class:"animate-ping",opacity:"0.3"},null,-1)),o[3]||(o[3]=s("circle",{cx:"150",cy:"150",r:"8",fill:"#00f0ff"},null,-1))],4))])]),s("div",jn,[s("div",{style:oe(i(M)),class:"w-[34px] h-[42px] origin-[50%_10px] will-change-transform"},[...o[4]||(o[4]=[s("svg",{width:"34",height:"42",viewBox:"0 0 34 42",fill:"none",class:"overflow-visible"},[s("path",{d:"M17 42L4 12C2 7 6 2 11 2H23C28 2 32 7 30 12L17 42Z",fill:"#00f0ff",stroke:"#ffffff","stroke-width":"1.5"}),s("circle",{cx:"17",cy:"10",r:"4",fill:"#ff007f"})],-1)])],4)])]))}}),Un={class:"relative w-full max-w-[340px] xs:max-w-[380px] sm:max-w-[420px] aspect-square mx-auto select-none"},Wn={class:"absolute inset-0 rounded-full p-3.5 bg-amber-400 border-4 border-amber-600 shadow-[0_12px_0_#b45309,0_20px_25px_rgba(0,0,0,0.5)]"},Zn={class:"w-full h-full rounded-full border-4 border-white relative overflow-hidden bg-amber-50"},Hn=["d","fill"],Yn=["transform"],Xn={x:"150",y:"45","text-anchor":"middle",fill:"#ffffff","font-size":"12","font-weight":"900",class:"wheel-slice-text font-sans tracking-wide",style:{"paint-order":"stroke fill",stroke:"rgba(0,0,0,0.3)","stroke-width":"2px"}},Kn=["href"],Qn=["cx","cy"],Jn=["cx","cy","fill"],es=["cx","cy"],ts={class:"absolute -top-4 left-1/2 -translate-x-1/2 z-20 pointer-events-none drop-shadow-[0_6px_0_#991b1b]"},ns=de({__name:"PlayfulCartoonWheel",props:{segments:{},targetSegmentIndex:{},spinning:{type:Boolean}},emits:["spin-finished"],setup(k,{emit:R}){const b=k,m=R,{wheelStyle:d,pointerStyle:M,isSpinning:h,spinTo:_}=be({segmentCount:()=>b.segments.length,pegCount:()=>24,onFinished:()=>m("spin-finished")});pe([()=>b.spinning,()=>b.targetSegmentIndex],([o,a])=>{o&&a!==null&&a!==void 0&&!h.value&&_(a)},{flush:"post"});const p=W(()=>b.segments.length),l=W(()=>p.value>0?360/p.value:0);function C(o){if(p.value<=1)return"";const a=138,t=150,u=150,$=(o*l.value-90)*(Math.PI/180),g=((o+1)*l.value-90)*(Math.PI/180),q=t+a*Math.cos($),G=u+a*Math.sin($),E=t+a*Math.cos(g),P=u+a*Math.sin(g),ce=l.value>180?1:0;return`M ${t} ${u} L ${q} ${G} A ${a} ${a} 0 ${ce} 1 ${E} ${P} Z`}function x(o){return`rotate(${o*l.value+l.value/2} 150 150)`}const y=["#f43f5e","#8b5cf6","#06b6d4","#10b981","#f59e0b","#ec4899"],r=W(()=>Array.from({length:24},(a,t)=>{const u=(t*15-90)*(Math.PI/180);return{x:150+142*Math.cos(u),y:150+142*Math.sin(u),color:y[t%y.length]}}));return(o,a)=>(c(),f("div",Un,[s("div",Wn,[s("div",Zn,[(c(),f("svg",{class:"w-full h-full",style:oe(i(d)),viewBox:"0 0 300 300"},[(c(!0),f(le,null,re(k.segments,(t,u)=>(c(),f("g",{key:t.id},[s("path",{d:C(u),fill:t.color||y[u%y.length],stroke:"#ffffff","stroke-width":"3"},null,8,Hn),s("g",{transform:x(u)},[s("text",Xn,j(i(ie)(t.title)),1),t.image?(c(),f("image",{key:0,href:t.image,x:"138",y:"54",width:"24",height:"24"},null,8,Kn)):D("",!0)],8,Yn)]))),128)),(c(!0),f(le,null,re(r.value,(t,u)=>(c(),f("g",{key:u},[s("circle",{cx:t.x,cy:t.y,r:"4",fill:"#ffffff",stroke:"#b45309","stroke-width":"1.5"},null,8,Qn),s("circle",{cx:t.x,cy:t.y,r:"2.8",fill:t.color},null,8,Jn),s("circle",{cx:t.x-.8,cy:t.y-.8,r:"0.8",fill:"#ffffff"},null,8,es)]))),128)),a[0]||(a[0]=s("circle",{cx:"150",cy:"150",r:"32",fill:"#ef4444",stroke:"#ffffff","stroke-width":"4"},null,-1)),a[1]||(a[1]=s("circle",{cx:"150",cy:"150",r:"22",fill:"#facc15",stroke:"#b45309","stroke-width":"2"},null,-1)),a[2]||(a[2]=s("text",{x:"150",y:"157","text-anchor":"middle","font-size":"20"},"✨",-1))],4))])]),s("div",ts,[s("div",{style:oe(i(M)),class:"w-[42px] h-[50px] origin-[50%_14px] will-change-transform"},[...a[3]||(a[3]=[s("svg",{width:"42",height:"50",viewBox:"0 0 42 50",fill:"none",class:"overflow-visible"},[s("path",{d:"M21 50L6 16C4 11 8 4 14 4H28C34 4 38 11 36 16L21 50Z",fill:"#ef4444",stroke:"#ffffff","stroke-width":"3"}),s("circle",{cx:"21",cy:"14",r:"6",fill:"#facc15",stroke:"#ffffff","stroke-width":"2"})],-1)])],4)])]))}}),ss={class:"min-h-screen flex flex-col bg-slate-950 text-slate-100 overflow-x-hidden"},as={class:"w-full max-w-md mx-auto px-4 py-3 flex items-center justify-between border-b border-slate-800/80 bg-slate-900/50 backdrop-blur sticky top-0 z-40"},os={class:"flex items-center gap-2"},ls=["title"],rs={class:"flex items-center gap-2"},is={key:0,class:"flex items-center gap-2"},cs={class:"text-xs text-slate-300 font-mono"},us={class:"flex-1 w-full max-w-md mx-auto px-4 py-4 flex flex-col justify-between"},ds={key:0,class:"flex-1 flex flex-col items-center justify-center py-20 text-slate-400"},fs={key:1,class:"flex-1 flex flex-col items-center justify-center py-16 text-center"},hs={class:"w-14 h-14 rounded-2xl bg-rose-500/10 text-rose-400 flex items-center justify-center mb-3"},ms={class:"text-xs text-slate-400 max-w-xs mb-5"},ps={key:2,class:"flex flex-col items-center"},xs={key:0,class:"w-full max-w-sm mb-4 rounded-2xl overflow-hidden shadow-lg border border-slate-800/80 bg-slate-900"},gs=["src","alt"],vs={class:"text-center mb-4"},ys={key:0,class:"mb-2.5 flex justify-center"},bs=["src","alt"],ws={class:"text-xl font-extrabold text-white tracking-tight"},Ms={key:1,class:"text-xs text-slate-400 mt-1 max-w-xs mx-auto line-clamp-2"},_s={class:"mb-4"},ks={key:0,class:"inline-flex items-center gap-2 px-4 py-1.5 rounded-full bg-slate-900 border border-slate-800 text-xs shadow-inner"},As={class:"font-extrabold text-sm text-emerald-400 font-sans"},Cs={key:1,class:"inline-flex items-center gap-1.5 px-3 py-1 rounded-full bg-blue-500/10 border border-blue-500/20 text-[11px] text-blue-300"},$s={key:1,class:"w-full max-w-xs mb-3 p-3 rounded-2xl bg-amber-500/10 border border-amber-500/25 text-amber-300 text-xs text-center flex items-center justify-center gap-2"},Ss={key:2,class:"w-full max-w-xs mb-3 p-2.5 rounded-xl bg-rose-500/10 border border-rose-500/20 text-rose-400 text-xs text-center font-medium"},Is={class:"w-full my-2 flex justify-center"},Ts={class:"w-full max-w-xs mt-6 mb-4"},Ps=["disabled"],Rs={key:3,class:"w-full max-w-xs mt-2"},Ls={class:"flex items-center gap-1.5"},Fs={key:0,class:"mt-1.5 p-3 rounded-xl bg-slate-900/60 border border-slate-800 text-[11px] text-slate-400 leading-relaxed whitespace-pre-line text-right"},Ns=de({__name:"CampaignWheelView",setup(k){const R=rt(),b=We(),m=Ae(),d=Ye(),{soundEnabled:M,toggleSound:h}=Ce(),_=z(R.params.slug||""),p=z(!0),l=z(null),C=z(null),x=z(!1),y=z(!1),r={[me.CLASSIC_CASINO]:je,[me.NEON_CYBER]:Dn,[me.MINIMAL_FLAT]:Ln,[me.LUXURY_GOLD]:_n,[me.PLAYFUL_CARTOON]:ns},o=W(()=>{var g;const $=((g=l.value)==null?void 0:g.wheelDesign)||me.CLASSIC_CASINO;return r[$]||je});async function a(){var $,g,q,G;if(_.value){p.value=!0,C.value=null;try{const P=(await Ue.get(`/campaigns/${_.value}/wheel`)).data;l.value={...P.campaign||P,segments:P.segments||(($=P.campaign)==null?void 0:$.segments)||[]},m.isAuthenticated&&((g=l.value)!=null&&g.id)&&await m.loadChances(l.value.id)}catch(E){C.value=((G=(q=E.response)==null?void 0:q.data)==null?void 0:G.message)||"کمپین مورد نظر یافت نشد یا در حال حاضر غیرفعال است."}finally{p.value=!1}}}async function t(){if(!m.isAuthenticated){x.value=!0;return}m.chances.remainingChances<=0||await d.executeSpin(l.value.id,l.value.segments)}async function u(){var $;($=l.value)!=null&&$.id&&await m.loadChances(l.value.id)}return ot(()=>{a()}),($,g)=>{var q,G;return c(),f("div",ss,[s("header",as,[s("div",os,[s("button",{onClick:g[0]||(g[0]=(...E)=>i(h)&&i(h)(...E)),class:"p-2 rounded-xl bg-slate-800 text-slate-300 hover:text-white transition",title:i(M)?"قطع صدا":"وصل صدا"},[i(M)?(c(),Q(i(He),{key:0,class:"w-4 h-4 text-emerald-400"})):(c(),Q(i(bt),{key:1,class:"w-4 h-4 text-slate-500"}))],8,ls),i(m).isAuthenticated?(c(),f("button",{key:0,onClick:g[1]||(g[1]=E=>i(b).push("/my-prizes")),class:"flex items-center gap-1.5 px-3 py-1.5 rounded-xl bg-blue-500/10 border border-blue-500/20 text-blue-400 text-xs font-medium hover:bg-blue-500/20 transition"},[Z(i(ut),{class:"w-3.5 h-3.5"}),g[6]||(g[6]=s("span",null,"جوایز من",-1))])):D("",!0)]),s("div",rs,[i(m).isAuthenticated?(c(),f("div",is,[s("span",cs,j((q=i(m).user)==null?void 0:q.mobile),1),s("button",{onClick:g[2]||(g[2]=E=>i(m).logout()),class:"p-1.5 rounded-lg text-slate-500 hover:text-rose-400 hover:bg-slate-800 transition",title:"خروج"},[Z(i(xt),{class:"w-4 h-4"})])])):(c(),f("button",{key:1,onClick:g[3]||(g[3]=E=>x.value=!0),class:"flex items-center gap-1 px-3 py-1.5 rounded-xl bg-blue-600 hover:bg-blue-500 text-white text-xs font-semibold shadow-sm transition"},[Z(i(pt),{class:"w-3.5 h-3.5"}),g[7]||(g[7]=s("span",null,"ورود / ثبت‌نام",-1))]))])]),s("main",us,[p.value?(c(),f("div",ds,[Z(i(ke),{class:"w-10 h-10 animate-spin text-blue-500 mb-3"}),g[8]||(g[8]=s("span",{class:"text-sm font-medium"},"در حال بارگذاری گردونه شانس...",-1))])):C.value?(c(),f("div",fs,[s("div",hs,[Z(i(qe),{class:"w-7 h-7"})]),g[9]||(g[9]=s("h3",{class:"text-base font-bold text-white mb-1"},"خطا در بارگذاری کمپین",-1)),s("p",ms,j(C.value),1),s("button",{onClick:a,class:"px-4 py-2 rounded-xl bg-slate-800 hover:bg-slate-700 text-xs font-medium text-white transition"}," تلاش مجدد ")])):l.value?(c(),f("div",ps,[l.value.banner?(c(),f("div",xs,[s("img",{src:l.value.banner,alt:l.value.title,class:"w-full max-h-36 object-cover"},null,8,gs)])):D("",!0),s("div",vs,[l.value.logo?(c(),f("div",ys,[s("img",{src:l.value.logo,alt:l.value.title,class:"max-h-14 max-w-[180px] object-contain drop-shadow-md"},null,8,bs)])):D("",!0),s("h1",ws,j(l.value.title),1),l.value.description?(c(),f("p",Ms,j(l.value.description),1)):D("",!0)]),s("div",_s,[i(m).isAuthenticated?(c(),f("div",ks,[Z(i(Pe),{class:"w-3.5 h-3.5 text-amber-400"}),g[10]||(g[10]=s("span",{class:"text-slate-300"},"فرصت‌های باقیمانده شما:",-1)),s("span",As,j(i(ie)(i(m).chances.remainingChances)),1)])):(c(),f("div",Cs,[...g[11]||(g[11]=[s("span",null,"جهت دریافت شانس و چرخاندن، وارد شوید",-1)])]))]),!l.value.isAvailable||l.value.availabilityError?(c(),f("div",$s,[Z(i(qe),{class:"w-4 h-4 flex-shrink-0 text-amber-400"}),s("span",null,j(l.value.availabilityError==="CAMPAIGN_DRAFT"?"این کمپین در وضعیت پیش‌نویس (DRAFT) است و به زودی فعال خواهد شد.":l.value.availabilityError==="CAMPAIGN_PAUSED"?"این کمپین موقتاً متوقف شده است.":l.value.availabilityError==="CAMPAIGN_NOT_STARTED"?"زمان شروع این کمپین هنوز فرا نرسیده است.":l.value.availabilityError==="CAMPAIGN_FINISHED"?"مهلت شرکت در این کمپین به پایان رسیده است.":"این کمپین در حال حاضر فعال نمی‌باشد."),1)])):D("",!0),i(d).errorMessage?(c(),f("div",Ss,j(i(d).errorMessage),1)):D("",!0),s("div",Is,[(c(),Q(lt(o.value),{segments:l.value.segments||[],"target-segment-index":i(d).targetSegmentIndex,spinning:i(d).isWheelSpinning,onSpinFinished:i(d).onWheelAnimationFinished},null,40,["segments","target-segment-index","spinning","onSpinFinished"]))]),s("div",Ts,[s("button",{onClick:t,disabled:!l.value.isAvailable||i(d).isRequesting||i(d).isWheelSpinning||i(m).isAuthenticated&&i(m).chances.remainingChances<=0,class:Te(["w-full py-3.5 px-6 rounded-2xl font-extrabold text-base text-white shadow-xl flex items-center justify-center gap-2 transition transform active:scale-95 disabled:opacity-50 disabled:cursor-not-allowed disabled:transform-none",l.value.isAvailable?i(m).isAuthenticated&&i(m).chances.remainingChances<=0?"bg-slate-800 text-slate-500 border border-slate-700":"bg-gradient-to-r from-amber-500 via-orange-500 to-amber-600 hover:from-amber-400 hover:to-orange-400 shadow-amber-500/25 animate-pulse-glow":"bg-slate-800 text-slate-400 border border-slate-700"])},[i(d).isRequesting||i(d).isWheelSpinning?(c(),Q(i(ke),{key:0,class:"w-5 h-5 animate-spin"})):(c(),Q(i(Pe),{key:1,class:"w-5 h-5 text-yellow-200"})),s("span",null,j(l.value.isAvailable?i(m).isAuthenticated?i(m).chances.remainingChances<=0?"فرصت شما به پایان رسیده":l.value.ctaText||"بچرخون و برنده شو!":"ورود و چرخاندن گردونه":l.value.availabilityError==="CAMPAIGN_DRAFT"?"کمپین در وضعیت پیش‌نویس است":"کمپین غیرفعال است"),1)],10,Ps)]),l.value.rules?(c(),f("div",Rs,[s("button",{onClick:g[4]||(g[4]=E=>y.value=!y.value),class:"w-full py-2 px-3 rounded-xl bg-slate-900 border border-slate-800 text-slate-400 hover:text-slate-200 text-xs flex items-center justify-between transition"},[s("div",Ls,[Z(i(ft),{class:"w-3.5 h-3.5 text-blue-400"}),g[12]||(g[12]=s("span",null,"قوانین و شرایط قرعه‌کشی",-1))]),Z(i(dt),{class:Te(["w-3.5 h-3.5 transition-transform",{"rotate-180":y.value}])},null,8,["class"])]),y.value?(c(),f("div",Fs,j(l.value.rules),1)):D("",!0)])):D("",!0)])):D("",!0)]),Z(Ft,{show:x.value,"campaign-id":(G=l.value)==null?void 0:G.id,onClose:g[5]||(g[5]=E=>x.value=!1),onSuccess:u},null,8,["show","campaign-id"]),Z(Jt)])}}});export{Ns as default};