PageSourceSearch

https://panel.eroadvertising.com/assets/AdminLogin-BitlZ1a0.js

js eroadvertising.com collected 2026-10-09 17:35:04 UTC 10,272 bytes, 1 lines download raw bytes

1import{u as J,a8 as X,b as Z,c as b,r as u,d as G,o as Q,e as c,f as p,g as o,h as M,i as r,_ as W,t as i,k as z,l as ee,w as te,j as x,m as k,p as q,v as se,q as oe,s as ae,x as re,y as ne,A as ie,C as le,z as ue,D as l,n as de,E as ce}from"./index-KZr-FxSz.js";import{_ as me}from"./TwoFactorVerify-BfwwLxeR.js";const pe={key:0,class:"absolute inset-0 bg-slate-900/70"},fe={class:"w-full max-w-md space-y-8 relative z-10"},ve={class:"text-center"},ge={key:1,class:"mx-auto w-12 h-12 bg-primary rounded-lg flex items-center justify-center mb-4","aria-hidden":"true"},he={class:"flex items-center justify-center gap-2"},_e={class:"text-3xl font-bold text-white"},be=["aria-label"],ye={key:2,class:"mt-2 text-sm text-slate-400"},we={key:0,role:"alert","aria-live":"assertive",class:"rounded-md bg-red-500/10 border border-red-500/20 p-4 text-sm text-red-400"},xe={class:"space-y-4"},ke=["aria-invalid"],Se={key:0,role:"alert",class:"mt-1 text-xs text-destructive"},Ce={class:"relative mt-1"},Te=["type","aria-invalid"],Be=["aria-pressed","aria-label"],qe={key:0,role:"alert",class:"mt-1 text-xs text-destructive"},Ae={class:"flex items-start"},Le={class:"ms-2"},Pe={for:"admin-remember-me",class:"block text-sm text-slate-200 cursor-pointer"},Ve={id:"admin-remember-me-hint",class:"mt-0.5 text-xs text-slate-400"},je=["disabled","aria-busy"],Re={key:0,class:"animate-spin -ms-1 me-2 h-4 w-4",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false"},Me={class:"text-center"},Oe={__name:"AdminLogin",setup(ze){const{t}=J(),D=le(),N=ue(),S=X(),h=Z(),A=b(()=>h.files?.logo_userpanel_login||null),O=b(()=>h.cdnFallback(h.files?.logo_userpanel_login)),C=b(()=>h.files?.background_loginpage||null),H=b(()=>h.cdnFallback(C.value)),U=b(()=>{const s=C.value,e=H.value;if(!s&&!e)return{};const n=[];return s&&n.push(`url(${s})`),e&&e!==s&&n.push(`url(${e})`),{backgroundImage:n.join(", "),backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat"}}),y=u(""),w=u(""),f=u(!1),T=u(!1),v=u(""),m=u(!1),d=u({}),E=u(!1);function L(s,e="text-slate-200"){return["block text-sm font-medium",d.value[s]?"text-destructive":e]}function P(s){return d.value[s]?"ring-1 ring-destructive border-destructive":""}function F(s,e,n){s&&de(()=>{const a=document.getElementById(s);if(!a)return;ce({overlayOpacity:.5,stagePadding:6,stageRadius:8,popoverOffset:10,animate:!0,smoothScroll:!0,showProgress:!1,showButtons:["next","close"],doneBtnText:t("global.ok","OK"),nextBtnText:t("global.ok","OK"),steps:[{element:"#"+s,popover:{title:e,description:n,side:"bottom",align:"start",onPopoverRender:()=>a.scrollIntoView({behavior:"smooth",block:"center"})}}],onDestroyed:()=>{typeof a.focus=="function"&&a.focus({preventScroll:!0})}}).drive()})}const I=[{id:"username",title:t("login.username","Username"),description:t("admin_login.help.username","Your admin username — typically firstname.lastname or what an existing admin set up for you.")},{id:"password",title:t("login.password","Password"),description:t("admin_login.help.password","Your admin password — distinct from any user-side account password.")},{id:"admin-remember-me",title:t("login.remember_me","Remember me"),description:t("admin_login.help.remember_me","Leave this off and the panel signs you out after 10 hours without activity — which is why it asks again each morning. Tick it on your own machine to stay signed in for 30 days. Never tick it on a shared or public computer.")}],{startFullTour:V}=G(I),g=u("credentials"),B=u(""),j=u(null);Q(()=>{g.value==="credentials"&&j.value?.focus()});async function $(){if(m.value)return;v.value="",d.value={};const s={};if(y.value.trim()||(s.username=t("signup.required","This field is required")),w.value||(s.password=t("signup.required","This field is required")),Object.keys(s).length>0){d.value=s,E.value=!0;const n=["username","password"].find(a=>s[a]);if(n){const a=n==="username"?t("login.username","Username"):t("login.password","Password");F(n,t("campaigns.required_field_overlay_title","Required field"),t("campaigns.required_field_overlay_body","{field} needs a value before you can continue.",{field:a}))}return}m.value=!0;try{const e=localStorage.getItem("admin_trusted_device_token"),n={"Content-Type":"application/json"};e&&(n["X-Trusted-Device"]=e);const a=await fetch("/api/admin/auth/login",{method:"POST",headers:n,body:JSON.stringify({username:y.value,password:w.value,remember:T.value})}),_=await a.json();if(a.status===202&&_.requires_2fa){B.value=_.pending_token,g.value="two-factor",m.value=!1;return}if(!a.ok){v.value=_.message||t("admin_login.login_failed","Login failed"),m.value=!1;return}R(_)}catch{v.value=t("admin_login.failed_retry","Login failed. Please try again.")}m.value=!1}function R(s){S.admin=s.admin,S.token=s.access_token,S.systemModules=s.system?.modules||[],localStorage.setItem("admin_token",s.access_token),s.trusted_device_token&&localStorage.setItem("admin_trusted_device_token",s.trusted_device_token);const e=N.query.redirect||"/admin";D.push(e)}function K(s){R(s)}function Y(){g.value="credentials",B.value="",v.value=""}return(s,e)=>{const n=ie("router-link");return l(),c("div",{class:"min-h-screen flex items-center justify-center bg-slate-900 px-4 py-12 sm:px-6 lg:px-8 relative",style:ne(U.value)},[C.value?(l(),c("div",pe)):p("",!0),o("div",fe,[o("div",ve,[A.value?(l(),M(W,{key:0,src:A.value,fallback:O.value,alt:r(t)("global.logo","Logo"),class:"mx-auto h-16 w-auto mb-4"},null,8,["src","fallback","alt"])):(l(),c("div",ge,[...e[5]||(e[5]=[o("svg",{"aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-7 h-7 text-primary-foreground",focusable:"false"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12.75 11.25 15 15 9.75m-3-7.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.749
1c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285Z"})],-1)])])),o("div",he,[o("h1",_e,i(r(t)("login.log_in_admin","Admin Panel")),1),g.value==="credentials"?(l(),c("button",{key:0,type:"button",onClick:e[0]||(e[0]=(...a)=>r(V)&&r(V)(...a)),"aria-label":r(t)("global.help","Help"),class:"rounded-full text-slate-400 hover:text-white transition-colors"},[z(r(ee),{class:"w-6 h-6","aria-hidden":"true"})],8,be)):p("",!0)]),g.value==="credentials"?(l(),c("p",ye,i(r(t)("login.sign_in_to_continue","Sign in to continue")),1)):p("",!0)]),g.value==="two-factor"?(l(),M(me,{key:0,"pending-token":B.value,"is-admin":!0,onVerified:K,onCancel:Y},null,8,["pending-token"])):(l(),c("form",{key:1,class:"mt-8 space-y-6",novalidate:"",onSubmit:te($,["prevent"])},[v.value?(l(),c("div",we,i(v.value),1)):p("",!0),o("div",xe,[o("div",null,[o("label",{for:"username",class:x(L("username"))},[k(i(r(t)("login.username","Username"))+" ",1),e[6]||(e[6]=o("span",{class:"text-destructive","aria-hidden":"true"},"*",-1))],2),q(o("input",{id:"username",ref_key:"usernameRef",ref:j,"onUpdate:modelValue":e[1]||(e[1]=a=>y.value=a),type:"text",autocomplete:"username",required:"",class:x(["mt-1 block w-full rounded-md border border-slate-600 bg-slate-800 px-3 py-2 text-white placeholder-slate-400 shadow-sm focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary sm:text-sm",P("username")]),"aria-invalid":d.value.username?"true":void 0,placeholder:"admin"},null,10,ke),[[se,y.value]]),d.value.username?(l(),c("p",Se,i(d.value.username),1)):p("",!0)]),o("div",null,[o("label",{for:"password",class:x(L("password"))},[k(i(r(t)("login.password","Password"))+" ",1),e[7]||(e[7]=o("span",{class:"text-destructive","aria-hidden":"true"},"*",-1))],2),o("div",Ce,[q(o("input",{id:"password","onUpdate:modelValue":e[2]||(e[2]=a=>w.value=a),type:f.value?"text":"password",autocomplete:"current-password",required:"",class:x(["block w-full rounded-md border border-slate-600 bg-slate-800 px-3 py-2 pe-14 text-white placeholder-slate-400 shadow-sm focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary sm:text-sm",P("password")]),"aria-invalid":d.value.password?"true":void 0,placeholder:"••••••••"},null,10,Te),[[oe,w.value]]),o("button",{type:"button","aria-pressed":f.value,"aria-label":f.value?r(t)("auth.hide_password_aria","Hide password"):r(t)("auth.show_password_aria","Show password"),class:"absolute inset-y-0 end-0 flex items-center px-3 text-xs text-slate-300 hover:text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary rounded",onClick:e[3]||(e[3]=a=>f.value=!f.value)},i(f.value?r(t)("auth.hide","Hide"):r(t)("auth.show","Show")),9,Be)]),d.value.password?(l(),c("p",qe,i(d.value.password),1)):p("",!0)])]),o("div",Ae,[q(o("input",{id:"admin-remember-me","onUpdate:modelValue":e[4]||(e[4]=a=>T.value=a),type:"checkbox",class:"mt-0.5 h-4 w-4 shrink-0 rounded border-slate-600 bg-slate-800 text-primary focus:ring-2 focus:ring-primary focus:ring-offset-2 focus:ring-offset-slate-900","aria-describedby":"admin-remember-me-hint"},null,512),[[ae,T.value]]),o("div",Le,[o("label",Pe,i(r(t)("login.remember_me","Remember me")),1),o("p",Ve,i(r(t)("admin_login.remember_me_hint","Stay signed in for 30 days. Leave this off on shared computers.")),1)])]),o("button",{type:"submit",disabled:m.value,"aria-busy":m.value,class:"w-full flex justify-center rounded-md bg-primary px-4 py-2 text-sm font-semibold text-primary-foreground shadow-sm hover:bg-primary/90 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 focus:ring-offset-slate-900 disabled:opacity-50 disabled:cursor-not-allowed transition-colors"},[m.value?(l(),c("svg",Re,[...e[8]||(e[8]=[o("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),o("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)])])):p("",!0),k(" "+i(m.value?r(t)("global.loading","Loading..."):r(t)("login.log_in","Sign in")),1)],8,je),o("div",Me,[z(n,{to:"/login",class:"text-sm text-slate-400 hover:text-primary transition-colors"},{default:re(()=>[k(i(r(t)("login.back_to_user_login","Back to user login")),1)]),_:1})])],32))])],4)}}};export{Oe as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.