import{dasV,iasl,xasA,oasD,casS,easo,wasp,basr,fasL,Kasj,lask,Gas_,_asJ}from"./index-6d0cd65e.js";import{_asW}from"./BasicModal.vue_vue_type_style_index_0_lang-9330561a.js";import{_asX}from"./BasicMainCard-8291a0be.js";import{_asG,uasK}from"./useBaseTable-05b26333.js";import{_asq}from"./button.vue_vue_type_style_index_0_lang-bd7de123.js";import{easz,fasH,hasQ}from"./competition-9d5cd7e0.js";import{tasY,aasZ}from"./useDataTime-af597da2.js";import{IasC}from"./Icon-26941971.js";import{_asee}from"./TextPreview.vue_vue_type_script_setup_true_lang-ebd8971b.js";import{_aste}from"./index-b2a6c339.js";import"./index-1d24a383.js";import"./isSymbol-94624ad1.js";import"./_plugin-vue_export-helper-057121dd.js";import"./vnode-272c72c0.js";import"./index-1fdbf8ec.js";import"./DialogWrap-b6637bda.js";import"./shallowequal-969229a1.js";import"./omit-0042b203.js";import"./pickAttrs-ae9bd1c0.js";import"./index-eddc2482.js";import"./styleChecker-0273aaa3.js";import"./FormItemContext-b6ebc5a2.js";import"./Grid-849ebb25.js";import"./index-ae4857ed.js";import"./index-0e770d03.js";import"./index-8d45f2c0.js";import"./useState-6a654be9.js";import"./useRefs-b0f30c2d.js";import"./_flatRest-2e1bd5be.js";import"./isMobile-e2e89480.js";import"./index-a30aaa52.js";import"./Col-27d7ac55.js";import"./isPlainObject-d2ad9b1e.js";import"./updateLocale-cd480df1.js";import"./useMemo-fb6ccae7.js";import"./lodash-6c37e040.js";import"./BaseSwitch.vue_vue_type_script_setup_true_lang-8a3278c2.js";import"./index-0a3c8350.js";import"./SearchOutlined-f7ba34a1.js";import"./index-61e1d708.js";import"./Badge-a066a44e.js";import"./isNumeric-3f69e2aa.js";import"./index-08466728.js";import"./index-19225493.js";import"./index-cbd32094.js";import"./css-aae66f86.js";import"./toArray-5fe0a9e6.js";import"./index-3f13e53b.js";import"./textUtils-c37780ad.js";constoe=[{title:"ردیف",dataIndex:"id",key:"id",filterable:!1,width:70,align:"center",customRender:u=>u.record.index+1},{title:"نام مسابقه",dataIndex:"match_title",key:"match_title"},{title:"شرح مسابقه",dataIndex:"match_description",key:"match_description",slot:"match_description"},{title:"نام کاربر",dataIndex:"user_name",key:"user_name"},{title:"شماره همراه",dataIndex:"user_mobile",key:"user_mobile"},{title:"امتیاز کسب شده",dataIndex:"score",key:"score",align:"center",customRender:u=>u.record.score||0},{title:"زمان",dataIndex:"created_at",key:"created_at",customRender:u=>Y(u.record.created_at)}],ae={class:"flex justify-between items-center mb-4"},le=r("h2",null,"امتیازات و برندگان مسابقات",-1),ie={class:"flex gap-2"},re={class:"space-y-4"},ne=r("div",{class:"mb-1 text-sm text-gray-600"},"انتخاب مسابقه",-1),se={class:"space-y-4"},ce=r("div",{class:"mb-1 text-sm text-gray-600"},"انتخاب مسابقه",-1),rt=V({__name:"index",setup(u){constw=te,B=l(null),[E,de]=K(),f=l(!1),g=l(!1),n=l(void0),s=l(void0),d=l([]),h=l(!1),b=l(!1),$=l(!1),T=l({columns:oe,api:z,defaultPageLimit:20});asyncfunctiony(){try{h.value=!0;constt=awaitH();d.value=(t||[]).map(e=>({label:e.title||`مسابقه ${e.id}`,value:e.id}))}catch(t){console.error("Error loading matchs:",t),_.error("خطا در بارگذاری لیست مسابقات")}finally{h.value=!1}}functionR(){n.value=void0,f.value=!0,d.value.length===0&&y()}functionI(){f.value=!1,n.value=void0}functionF(){s.value=void0,g.value=!0,d.value.length===0&&y()}functionM(){g.value=!1,s.value=void0}functionN(){if(!s.value){_.warning("لطفاً مسابقه را انتخاب کنید");return}constt=d.value.find(v=>v.value===s.value),e=encodeURIComponent((t==null?void0:t.label)||`مسابقه_${s.value}`),i=`/lottery?matchId=${s.value}&title=${e}`;window.open(i,"_blank","width=1200,height=800"),M()}asyncfunctionP(){if(!n.value){_.warning("لطفاً مسابقه را انتخاب کنید");return}try{b.value=!0;constt=awaitQ(n.value);if(t.length===0){_.warning("برای این مسابقه برندهای یافت نشد");return}c