import{i as k,d as h,T as x,c as b,w as a,o as c,g as l,t as e,u as s,a as o,e as d,F as B,h as S,f as C,b as u,V as L,n as V}from"./app-WJL2kJBE.js";import{_ as M}from"./ActionMessage-CbAgcH97.js";import{_ as O}from"./ActionSection-0k724LuI.js";import{_ as y}from"./Button-B1uOz4tP.js";import{_ as $}from"./DialogModal-B87MAZJT.js";import{_ as I}from"./Input-C4-VG2dv.js";import{_ as F}from"./InputError-idDGfizs.js";import{_ as N}from"./SecondaryButton-DT9RUAGX.js";import"./SectionTitle-DsJypKOL.js";import"./Modal-B9NNWAdE.js";const T={class:"max-w-xl text-sm"},z={key:0,class:"mt-5 space-y-6"},U={key:0,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",viewBox:"0 0 24 24",stroke:"currentColor",class:"w-8 h-8 text-gray-500 dark:text-gray-400"},j={key:1,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor",fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:"w-8 h-8 text-gray-500 dark:text-gray-400"},D={class:"ml-3"},E={class:"text-sm"},H={class:"text-xs text-gray-500 dark:text-gray-400"},K={key:0,class:"text-green-500 font-semibold"},P={key:1},A={class:"flex items-center mt-5"},q={class:"mt-4"},ts={__name:"LogoutOtherBrowserSessionsForm",props:{sessions:Array},setup(p){const{t}=k({}),m=h(!1),f=h(null),n=x({password:""}),g=()=>{m.value=!0,setTimeout(()=>f.value.focus(),250)},w=()=>{n.delete(route("other-browser-sessions.destroy"),{preserveScroll:!0,onSuccess:()=>_(),onError:()=>f.value.focus(),onFinish:()=>n.reset()})},_=()=>{m.value=!1,n.reset()};return(G,i)=>(c(),b(O,null,{title:a(()=>[l(e(s(t)("Browser Sessions")),1)]),description:a(()=>[l(e(s(t)("Manage and log out your active sessions on other browsers and devices.")),1)]),content:a(()=>[o("div",T,e(s(t)("If necessary, you may log out of all of your other browser sessions across all of your devices. Some of your recent sessions are listed below; however, this list may not be exhaustive. If you feel your account has been compromised, you should also update your password.")),1),p.sessions.length>0?(c(),d("div",z,[(c(!0),d(B,null,S(p.sessions,(r,v)=>(c(),d("div",{key:v,class:"flex items-center"},[o("div",null,[r.agent.is_desktop?(c(),d("svg",U,i[1]||(i[1]=[o("path",{d:"M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"},null,-1)]))):(c(),d("svg",j,i[2]||(i[2]=[o("path",{d:"M0 0h24v24H0z",stroke:"none"},null,-1),o("rect",{x:"7",y:"4",width:"10",height:"16",rx:"1"},null,-1),o("path",{d:"M11 5h2M12 17v.01"},null,-1)])))]),o("div",D,[o("div",E,e(r.agent.platform?r.agent.platform:"Unknown")+" - "+e(r.agent.browser?r.agent.browser:"Unknown"),1),o("div",null,[o("div",H,[l(e(r.ip_address)+", ",1),r.is_current_device?(c(),d("span",K,e(s(t)("This device")),1)):(c(),d("span",P,e(s(t)("Last active"))+" "+e(r.last_active),1))])])])]))),128))])):C("",!0),o("div",A,[u(y,{onClick:g},{default:a(()=>[l(e(s(t)("Log Out Other Browser Sessions")),1)]),_:1}),u(M,{on:s(n).recentlySuccessful,class:"ml-3"},{default:a(()=>i[3]||(i[3]=[l(" Done. ")])),_:1},8,["on"])]),u($,{show:m.value,onClose:_,"max-width":"lg"},{title:a(()=>[l(e(s(t)("Log Out Other Browser Sessions")),1)]),content:a(()=>[l(e(s(t)("Please enter your password to confirm you would like to log out of your other browser sessions across all of your devices."))+" ",1),o("div",q,[u(I,{type:"password",ref_key:"passwordInput",ref:f,modelValue:s(n).password,"onUpdate:modelValue":i[0]||(i[0]=r=>s(n).password=r),placeholder:"Password",class:"mt-1 block w-full",onKeyup:L(w,["enter"])},null,8,["modelValue"]),u(F,{message:s(n).errors.password,class:"mt-2"},null,8,["message"])])]),footer:a(()=>[u(N,{onClick:_},{default:a(()=>[l(e(s(t)("Cancel")),1)]),_:1}),u(y,{class:V(["ml-3",{"opacity-25":s(n).processing}]),disabled:s(n).processing,onClick:w},{default:a(()=>[l(e(s(t)("Log Out Other Browser Sessions")),1)]),_:1},8,["class","disabled"])]),_:1},8,["show"])]),_:1}))}};export{ts as default};
