import{G as Z,f as j,p as G,g as J,r as u,af as U,o as d,k as _,m as i,n as M,l as a,a as l,t as e,c as A,b as h,R as w,z,F as W,x as Y,ap as Q,Y as X,y as aa,J as oa,K as sa,v as T,d as ta}from"./entry.b033db08.js";const m=t=>(oa("data-v-6e2cf965"),t=t(),sa(),t),ea={class:"relative app_modal_bg"},la=m(()=>a("img",{class:"w-4 h-4",src:z,alt:"close"},null,-1)),na=[la],da={class:"app_modal_box"},pa={class:"app_modal_box_left"},_a=["src","alt"],ia={key:0,class:"app_modal_box_right"},ca={class:"app_modal_text_1"},ra={class:"app_modal_text_2"},ua=m(()=>a("svg",{class:"app_modal_warn_icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},[a("path",{d:"M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"})],-1)),ma={class:"text"},va={class:"app_modal_text_3"},ha={class:"flex items-center"},wa=m(()=>a("svg",{class:"icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},[a("path",{d:"M3 14s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H3Zm5-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"})],-1)),ga={class:"text"},ba=m(()=>a("div",{class:"app_modal_line"},null,-1)),fa={class:"app_modal_text_3"},ya={class:"flex items-center"},Ma=m(()=>a("svg",{class:"icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},[a("path",{d:"M3.5 11.5a3.5 3.5 0 1 1 3.163-5H14L15.5 8 14 9.5l-1-1-1 1-1-1-1 1-1-1-1 1H6.663a3.5 3.5 0 0 1-3.163 2zM2.5 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2z"})],-1)),xa={class:"text"},ka=m(()=>a("div",{class:"app_modal_line"},null,-1)),Da={key:0,class:"app_modal_change_password_text"},$a={class:"app_modal_button"},Ca=["href"],Va=["disabled"],Sa=["disabled"],Ba={key:1,class:"app_modal_box_right"},Ia={class:"app_modal_text_1"},Ua={class:"app_modal_input_container"},Aa={class:"label"},Ta={class:"app_modal_input_container"},za={class:"label"},La={key:0,class:"app_modal_button"},qa={type:"submit",class:"app_modal_btn_2"},Ha={key:1,class:"app_modal_button"},Na={class:"absolute top-4 right-4"},Ea={class:"text-center mx-4"},Fa={__name:"AppModal",props:{show:Boolean,appModalData:Object},emits:["close"],setup(t,{emit:L}){const c=t,x=j(),{isMobile:Ra,isIos:q,isAndroid:H}=G(),g=J(),v=u("app"),{$pub:N}=T(),E=ta(),k=o=>{L("close")},F=o=>o?`${E.public.COMMON_BUCKET}game/provider/${o.toUpperCase()}.png`:N("/img/logo.png"),b=u(!0),{$api:D,$toast:$}=T(),C=async o=>{if(!b.value)return;b.value=!1;const s=await D("game/auto-transfer",{provider_id:c.appModalData.provider_data.id,gid:c.appModalData.provider_data.game_id,currency:x.data.currency});$(s.status,s.msg),b.value=!0,s.status},f=u(!1),R=async()=>{var o;if((o=c.appModalData)!=null&&o.play_link){const s=window.open(c.appModalData.play_link,"_blank");await C(),setTimeout(async()=>{s.closed||(s.close(),f.value=!0)},2e3)}},p=u(""),r=u(""),y=u(!1),O=async o=>{if(!o.isValid)return;y.value=!0;const s=await D("game/change-app-password",{provider_id:c.appModalData.provider_data.id,password:p.value,currency:x.data.currency});if(y.value=!1,!s.status){$(s.status,s.msg);return}c.appModalData.password=p.value,v.value="app"};return(o,s)=>{const V=Y,S=Q,B=U("DError"),P=X,K=U("DForm"),I=aa;return d(),_(W,null,[i(I,{show:t.show,"max-width":600,clickClose:"",containerClass:"!px-0 !pt-0 h-full md:h-auto rounded-none md:rounded-[5px]",onClose:k},{default:M(()=>[a("div",ea,[a("button",{type:"button",class:"absolute top-[22px] right-[20px]",onClick:k},na),a("div",da,[a("div",pa,[a("img",{class:"w-[100px]",draggable:"false",src:F(t.appModalData.provider),alt:`provider_${t.appModalData.provider}`},null,8,_a)]),l(v)=="app"?(d(),_("div",ia,[a("div",ca,e(t.appModalData.provider_name),1),a("div",ra,[ua,a("div",ma,e(l(g).loggedIn?o.$t("please_download_app_before_playing"):o.$t("please_download_app_before_playing_not_login")),1)]),a("div",va,[a("div",ha,[wa,a("div",ga,e(t.appModalData.username),1)]),t.appModalData.username?(d(),A(V,{key:0,copyText:t.appModalData.username},null,8,["copyText"])):h("",!0)]),ba,a("div",fa,[a("div",ya,[Ma,a("div",xa,e(t.appModalData.password),1)]),t.appModalData.password?(d(),A(V,{key:0,copyText:t.appModalData.password},null,8,["copyText"])):h("",!0)]),ka,t.appModalData.username&&t.appModalData.password?(d(),_("div",Da,[a("div",null,e(o.$t("would_like_to_change_password_question")),1),a("button",{onClick:s[0]||(s[0]=n=>v.value="password"),type:"button",class:"app_modal_click_here_btn"},e(o.$t("click_here")),1)])):h("",!0),a("div",$a,[a("a",{href:t.appModalData.url,target:"_blank",class:"app_modal_btn_1"},e(o.$t("download")),9,Ca),l(q)||l(H)?(d(),_("button",{key:0,onClick:R,type:"button",class:"app_modal_btn_2",disabled:!l(g).loggedIn},e(o.$t("play_now")),9,Va)):(d(),_("button",{key:1,onClick:C,type:"button",class:"app_modal_btn_2",disabled:!l(g).loggedIn},e(o.$t("transfer")),9,Sa))])])):h("",!0),l(v)=="password"?(d(),_("div",Ba,[a("div",Ia,e(o.$t("change_password")),1),i(K,{onSubmit:O,novalidate:""},{default:M(()=>[a("div",Ua,[a("div",Aa,e(o.$t("new_password")),1),i(S,{modelValue:l(p),"onUpdate:modelValue":s[1]||(s[1]=n=>w(p)?p.value=n:null),placeholder:o.$t("enter_new_password")},null,8,["modelValue","placeholder"]),i(B,{modelValue:l(p),"onUpdate:modelValue":s[2]||(s[2]=n=>w(p)?p.value=n:null),required:"",validpassword:""},null,8,["modelValue"])]),a("div",Ta,[a("div",za,e(o.$t("confirm_password")),1),i(S,{modelValue:l(r),"onUpdate:modelValue":s[3]||(s[3]=n=>w(r)?r.value=n:null),placeholder:o.$t("enter_confirm_password")},null,8,["modelValue","placeholder"]),i(B,{modelValue:l(r),"onUpdate:modelValue":s[4]||(s[4]=n=>w(r)?r.value=n:null),required:"",equalto:l(p)},null,8,["modelValue","equalto"])]),l(y)?(d(),_("div",Ha,[i(P)])):(d(),_("div",La,[a("button",{onClick:s[5]||(s[5]=n=>v.value="app"),type:"button",class:"app_modal_btn_3"},e(o.$t("back")),1),a("button",qa,e(o.$t("confirm")),1)]))]),_:1})])):h("",!0)])])]),_:1},8,["show"]),i(I,{show:l(f)},{default:M(()=>[a("div",null,[a("button",Na,[a("img",{src:z,class:"w-4 h-4",onClick:s[6]||(s[6]=n=>f.value=!1)})]),a("div",Ea,e(o.$t("please_download_app_before_playing_7_11")),1)])]),_:1},8,["show"])],64)}}},Pa=Z(Fa,[["__scopeId","data-v-6e2cf965"]]),Ka=""+globalThis.__publicAssetsURL("img/icons/app_tag.png");export{Pa as _,Ka as a};