PageSourceSearch

https://www.pacifichistoricalmuseum.org/_nuxt/Di4L3Yar.js

js pacifichistoricalmuseum.org collected 2026-10-09 17:10:26 UTC 2,088 bytes, 1 lines download raw bytes

1import{_ as U,a as C,b as k}from"./Bh5DriGv.js";import{d as N,j as T,aC as $,k as A,l as B,a as F,x as w,p as x,c as P,e as r,m as s,w as t,h as j,i as q,n as m,b as z,q as E,g,_ as I,s as D,r as L,aD as M}from"./CIxJSTE4.js";import{f as O}from"./CfUfye_a.js";import"./DU9D8jnE.js";const G={key:0,class:"mx-auto max-w-md pt-16"},H={class:"flex items-center justify-between gap-4"},X=N({__name:"index",async setup(J){let o,n;const v=T({email:A,password:$}),a=D({email:void 0,password:void 0}),i=L(!1),d=B(),{user:c,fetch:y}=F(),p=q(()=>M(c.value?.role));c.value?.mustSetPassword?([o,n]=w(()=>m("/admin/set-password")),await o,n()):p.value&&([o,n]=w(()=>m("/admin/research-requests")),await o,n());async function b(u){i.value=!0;try{await $fetch("/api/admin/login",{method:"POST",body:u.data}),await y(),a.password=void 0,d.add({title:"Signed in",color:"primary"}),await m("/admin/research-requests")}catch(e){d.add({title:"Could not sign in",description:O(e,"Invalid email or password"),color:"error"})}finally{i.value=!1}}return(u,e)=>{const f=k,_=C,V=E,S=I,h=U;return x(p)?j("",!0):(z(),P("div",G,[e[4]||(e[4]=r("h1",{class:"text-2xl font-semibold"},"Admin sign in",-1)),e[5]||(e[5]=r("p",{class:"mt-2 text-sm text-zinc-600"}," Sign in to review submissions and manage records. ",-1)),s(h,{schema:x(v),state:a,class:"mt-8 space-y-4",onSubmit:b},{default:t(()=>[s(_,{label:"Email",name:"email"},{default:t(()=>[s(f,{modelValue:a.email,"onUpdate:modelValue":e[0]||(e[0]=l=>a.email=l),type:"email",class:"w-full"},null,8,["modelValue"])]),_:1}),s(_,{label:"Password",name:"password"},{default:t(()=>[s(f,{modelValue:a.password,"onUpdate:modelValue":e[1]||(e[1]=l=>a.password=l),type:"password",class:"w-full"},null,8,["modelValue"])]),_:1}),r("div",H,[s(V,{type:"submit",color:"primary",loading:i.value},{default:t(()=>[...e[2]||(e[2]=[g(" Sign in ",-1)])]),_:1},8,["loading"]),s(S,{to:"/admin/forgot-password",class:"text-sm text-zinc-600 hover:text-zinc-900"},{default:t(()=>[...e[3]||(e[3]=[g(" Forgot password ",-1)])]),_:1})])]),_:1},8,["schema","state"])]))}}});
1export{X 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.