import{d as D,q as G,j as b,f as O,l as d,o as l,a as y,b as _,N as M,J as n,w as t,u as s,c as i,a4 as g,a5 as j,a6 as C,m as c,O as T,M as Z,v as F,B as H,z as J,A as h,Z as K,$ as Q,_ as Y}from"./__uno-D1Fc7LNY.js";import{u as ee,_ as X,s as se,a as oe}from"./popup-B0Dhd1u8.js";import"./modulepreload-polyfill-B5Qt9EMX.js";const ae="/dist/assets/logo-TOgHhrrG.png",te=p=>(K("data-v-59777763"),p=p(),Q(),p),re={class:"u-text-right u-text-14px u-mt--10px"},le={key:1},ne=te(()=>_("span",{class:"u-mr-4px"},"独立部署用户",-1)),ie={class:"u-text-left u-mt-4px"},E="login",ue=D({__name:"index",setup(p){const v=G(),{username:S,password:$,isX:I,xorigin:z,rememberMe:U}=v,{getWebLocal:B,setWebLocal:N}=oe(),x=b(!1),k=b(),u=b(!1),e=O({username:S,password:atob($),isX:I,origin:z,rememberMe:U});(()=>{const r=B();!e.isX&&r.isX==="true"&&(e.isX=!0),!e.rememberMe&&r.rememberMe==="true"&&(e.rememberMe=!0),e.rememberMe&&(!e.username&&r.username&&(e.username=r.username),!e.password&&r.password&&(e.password=atob(r.password))),!e.origin&&r.xorigin&&(e.origin=r.xorigin)})();const P=".app.gerpgo.com",{next:V}=ee(),m=()=>{k.value.validate(async r=>{if(!r){x.value=!0;try{await v.login({...e}),N({username:e.username,password:btoa(e.password),isX:e.isX,xorigin:e.origin,rememberMe:e.rememberMe}),await F.storage.local.set({WebExtFresh:!1}),H.GjMessage.success("登录成功"),await V(),await Promise.all([se({fn:"initData"}),J(h.temu.detect,null)]),V()}finally{x.value=!1}}})};return(r,o)=>{const f=d("gj-input"),w=d("gj-form-item"),q=d("gj-link"),A=d("gj-switch"),L=d("gj-checkbox"),R=d("gj-form"),W=d("gj-button");return l(),y("div",{class:M(E)},[_("img",{src:ae,class:M(`${E}-logo`)},null,2),n(R,{ref_key:"formRef",ref:k,model:s(e)},{default:t(()=>[n(w,{field:"username","hide-label":"",rules:[{required:!0,message:"请输入用户名/手机号"}]},{default:t(()=>[n(f,{modelValue:s(e).username,"onUpdate:modelValue":o[0]||(o[0]=a=>s(e).username=a),"allow-clear":"",placeholder:"请输入用户名/手机号",onPressEnter:m},null,8,["modelValue"])]),_:1}),n(w,{field:"password","hide-label":"",rules:[{required:!0,message:"请输入密码"}]},{default:t(()=>[s(u)?(l(),i(f,{key:1,modelValue:s(e).password,"onUpdate:modelValue":o[8]||(o[8]=a=>s(e).password=a),"allow-clear":"",placeholder:"请输入密码",onPressEnter:m},{suffix:t(()=>[n(s(X),{onClick:o[5]||(o[5]=a=>u.value=!s(u)),onMousedown:o[6]||(o[6]=g(()=>{},["prevent"])),onMouseup:o[7]||(o[7]=g(()=>{},["prevent"])),class:"u-font-size-16px"},{default:t(()=>[s(u)?(l(),i(s(C),{key:1})):(l(),i(s(j),{key:0}))]),_:1})]),_:1},8,["modelValue"])):(l(),i(f,{key:0,modelValue:s(e).password,"onUpdate:modelValue":o[4]||(o[4]=a=>s(e).password=a),"allow-clear":"",placeholder:"请输入密码",type:"password",onPressEnter:m},{suffix:t(()=>[n(s(X),{onClick:o[1]||(o[1]=a=>u.value=!s(u)),onMousedown:o[2]||(o[2]=g(()=>{},["prevent"])),onMouseup:o[3]||(o[3]=g(()=>{},["prevent"])),class:"u-font-size-16px"},{default:t(()=>[s(u)?(l(),i(s(C),{key:1})):(l(),i(s(j),{key:0}))]),_:1})]),_:1},8,["modelValue"]))]),_:1}),s(e).isX?(l(),i(w,{key:0,field:"origin","hide-label":"",rules:[{required:!0,message:"请输入访问链接前缀"},{match:/^[a-zA-Z0-9_.-]{1,}$/,message:"请输入正确的访问链接前缀"}]},{default:t(()=>[n(f,{modelValue:s(e).origin,"onUpdate:modelValue":o[9]||(o[9]=a=>s(e).origin=a),placeholder:"输入访问链接前缀","allow-clear":"",onPressEnter:m},{append:t(()=>[c(T(s(P)),1)]),_:1},8,["modelValue"])]),_:1})):Z("",!0),_("div",re,[s(e).isX?(l(),y("div",le,[ne,n(A,{"model-value":s(e).isX,onClick:o[11]||(o[11]=a=>s(e).isX=!1)},null,8,["model-value"])])):(l(),i(q,{key:0,class:"u-text-14px",hoverable:!1,onClick:o[10]||(o[10]=a=>s(e).isX=!0)},{default:t(()=>[c("我是独立部署用户")]),_:1}))]),_("div",ie,[n(L,{modelValue:s(e).rememberMe,"onUpdate:modelValue":o[12]||(o[12]=a=>s(e).rememberMe=a),class:"u-text-14px"},{default:t(()=>[c("记住密码")]),_:1},8,["modelValue"])])]),_:1},8,["model"]),n(W,{type:"primary",long:"",loading:s(x),class:"u-h40px u-mt-12px u-text-14px",onClick:m},{default:t(()=>[c("登录")]),_:1},8,["loading"])])}}}),ge=Y(ue,[["__scopeId","data-v-59777763"]]);export{ge as default};
