PageSourceSearch

https://app.xrouten.de/_nuxt/wsBmnk6l.js

js xrouten.de collected 2026-10-08 21:20:13 UTC 13,263 bytes, 3 lines download raw bytes

1import{D as v,E as b,On as s,_ as n,b as _,bt as E,g as f,k as ye,mt as i,o as L,qt as c,tr as d,un as he,v as k,vn as y,xn as be,y as U}from"./D6WHS1fr.js";import{n as ke}from"./_M0T3Ajy.js";import{L as xe,m as p}from"./vzfjObSJ.js";import{n as x}from"./cyl1wqhB.js";import{u as Ce}from"./C8AATz1e.js";import{t as we}from"./CSt4_oPS2.js";import{t as Ae}from"./CLoAutzH.js";import{t as Pe}from"./sNg3Yvxj.js";import{t as Se}from"./h3fLHPNv.js";import{t as De}from"./B6ohFzDU.js";import{t as M}from"./_c3ft1t-2.js";import{t as G}from"./CK-0bgm_2.js";import{t as X}from"./B_rhTCXC2.js";import{t as T}from"./Ch5yaWv12.js";import{t as z}from"./BAnK1nrr.js";import{t as Te}from"./CvXEJT792.js";import{t as Ve}from"./BMRUlzL92.js";import{t as Ie}from"./C7grN9Jc2.js";import{t as Le}from"./BT8My9uN2.js";import{t as Ue}from"./QwzqcPAE2.js";import{t as $e}from"./C2K-dika.js";import{t as Re}from"./D4K6wCZX.js";import{t as Ee}from"./CJ-Yn_Mb.js";(function(){try{var h=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};h.SENTRY_RELEASE={id:"2e8dfcbf6f3796e3e06db87f2dcb866f53d3cce2"};var t=new h.Error().stack;t&&(h._sentryDebugIds=h._sentryDebugIds||{},h._sentryDebugIds[t]="2d0a8d79-1e21-4f3e-9949-7a6640a00865",h._sentryDebugIdIdentifier="sentry-dbid-2d0a8d79-1e21-4f3e-9949-7a6640a00865")}catch{}})();var Me={class:"flex h-24 w-full items-center justify-between"},ze={class:"flex items-center gap-2"},Ne={class:"text-sm text-muted"},Oe={class:"space-y-4"},je={key:0,class:"text-sm text-muted"},Be={key:1,class:"text-sm text-muted"},Fe={key:2,class:"space-y-8 p-4"},qe={class:"text-muted-foreground border-b pb-2 text-xl font-bold"},Ke={class:"ml-2 text-sm font-normal text-muted"},He={class:"space-y-4"},Qe={class:"flex cursor-pointer flex-col gap-2 sm:flex-row sm:items-center sm:justify-between"},Ge={class:"flex flex-wrap items-center gap-2"},Xe={class:"text-lg font-semibold"},Ye={class:"flex w-full items-center justify-between gap-2 sm:w-auto sm:justify-end"},Je={class:"text-sm text-muted"},We={class:"divide-border mt-2 divide-y"},Ze={class:"flex flex-wrap items-center gap-2"},et={class:"text-base font-medium"},tt={class:"text-sm text-muted"},at=ye({__name:"active-users",setup(h){const{t}=ke();function N(e){if(e<60)return t("settings.field.last_minutes",{count:e});if(e===60)return t("settings.field.last_hour");if(e<1440){const a=Math.round(e/60);return t("settings.field.last_hours",{count:a})}if(e<43200){const a=Math.round(e/1440);return a===1?t("settings.field.last_day"):t("settings.field.last_days",{count:a})}const o=Math.round(e/43200);return o===1?t("settings.field.last_month"):t("settings.field.last_months",{count:o})}const Y=[5,15,30,60,180,360,720,1440,2880,4320,10080,20160,43200,129600,259200].map(e=>({label:N(e),value:e})),V=y(5),w=y(void 0),A=y(!1),C=y([]),P=y(""),S=y(),g=y([{id:"employeeCount",desc:!0}]),J=f(()=>[{value:"activeUsers",label:t("user.term.active")},{value:"employeeCount",label:t("user.term.employee_count")},{value:"name",label:t("company.term.label")}]),O=f(()=>[{value:"trial",label:t("company.value.service_package_trial")},{value:"pro",label:t("company.value.service_package_pro")},{value:"proPlus",label:t("company.value.service_package_pro_plus")},{value:"enterprise",label:t("company.value.service_package_enterprise")},{value:"paused",label:t("company.value.service_package_paused")}]);$e({title:e=>e("global_search.term.user.active"),shortcuts:["ctrl","X"],roles:[p.xRoutenAdmin],layout:"admin",globalSearch:{icon:x.users,name:e=>e("global_search.term.user.active")}});const j={[p.xRoutenAdmin]:6,[p.companiesManager]:5,[p.companyAdmin]:4,[p.api]:3,[p.driver]:2,[p.spectator]:1};function B(e){return e.reduce((o,a)=>o?j[a]>j[o]?a:o:a,void 0)}function F(e){switch(e){case p.xRoutenAdmin:return{label:t("user.value.role_xrouten_admin"),icon:"i-heroicons-shield-check",color:"error"};case p.companiesManager:return{label:t("user.value.role_companies_manager"),description:t("user.description.role_companies_manager"),leadingIcon:"i-lucide-shield-check"};case p.companyAdmin:return{label:t("user.value.role_admin"),icon:"i-heroicons-user-circle",color:"info"};case p.api:return{label:t("user.value.role_api"),icon:"i-heroicons-key",color:"info"};case p.driver:return{label:t("user.value.role_employee"),icon:"i-heroicons-truck",color:"success"};case p.spectator:return{label:t("user.value.role_observer"),icon:"i-heroicons-eye",color:"neutral"};
1default:return{label:e||"-",icon:"i-heroicons-question-mark-circle",color:"neutral"}}}const W=f(()=>[...Object.values(p).map(e=>({value:e,label:F(e).label}))].filter(Boolean));function Z(e){const o=xe(e);return o?t(o):e}function ee(e){if(!e)return null;const o=new Date(e);return new Date(o.getTime()+336*60*60*1e3)}function te(e){if(!e)return;const o=[];if(e.servicePackage==="trial"&&e.trialStartedAt){const a=new Date(e.trialStartedAt).toLocaleDateString(),r=ee(e.trialStartedAt)?.toLocaleDateString();o.push(`${t("company.field.trial_started")}: ${a}`),r&&o.push(`${t("company.field.trial_ends")}: ${r}`)}if(e.features?.length){o.push(t("company.field.features.title"));for(const a of e.features)o.push(`• ${Z(a)}`)}else e.servicePackage!=="trial"&&o.push(t("app.term.no_special_features"));return o.length>0?o.join(`
2`):void 0}function ae(e){if(!e)return;const o=e.adminCount??0,a=e.driverCount??0,r=e.spectatorCount??0,l=e.employeeCount??0,m=Math.max(0,l-o-a-r),u=[];return o>0&&u.push(`${t("user.value.role_admin")}: ${o}`),a>0&&u.push(`${t("user.value.role_employee")}: ${a}`),r>0&&u.push(`${t("user.value.role_observer")}: ${r}`),m>0&&u.push(`${t("user.name")}: ${m}`),u.length>0?u.join(`
3`):void 0}function oe(e){if(e)return O.value.find(o=>o.value===e)?.label??e}function re(e){if(e?.servicePackage==="trial")return e.trialEnded?"error":"success";switch(e?.servicePackage){case"paused":return"warning";case"pro":return"info";case"proPlus":return"primary";case"enterprise":return"success";default:return"neutral"}}const se=f(()=>[{type:"sort",isActive:g.value.length>0,component:Ue,props:{modelValue:g.value[0]?{column:g.value[0].id,direction:g.value[0].desc?"desc":"asc"}:void 0,"onUpdate:modelValue":e=>{e.column?g.value=[{id:e.column,desc:e.direction==="desc"}]:g.value=[]},options:J.value},label:t("app.term.label")},{type:"servicePackage",isActive:!!w.value,component:z,props:{modelValue:w.value,"onUpdate:modelValue":e=>w.value=e,items:O.value,placeholder:t("company.value.service_package_title"),size:"sm"},label:t("company.value.service_package_title")},{type:"activeMinutes",isActive:!0,component:z,props:{modelValue:V.value,"onUpdate:modelValue":e=>V.value=e,items:Y,required:!0,size:"sm"},label:t("app.term.time_range")},{type:"hasCurrentTour",isActive:A.value,component:Pe,props:{modelValue:A.value,"onUpdate:modelValue":e=>A.value=e},label:t("tour.term.has_current")},{type:"role",isActive:C.value.length>0,component:z,props:{modelValue:C.value,"onUpdate:modelValue":e=>C.value=e??[],items:W.value,placeholder:t("app.column.role"),size:"sm",required:!1,multiple:!0},label:t("app.column.role")},{type:"archived",isActive:!!S.value,component:De,props:{modelValue:!!S.value,"onUpdate:modelValue":e=>{S.value=e?"true":void 0}},label:t("administration.field.archived")}]);function le(){P.value="",w.value=void 0,V.value=5,A.value=!1,g.value=[{id:"employeeCount",desc:!0}],C.value=[],S.value=void 0}const q=y(new Date),{data:ne,isLoading:ie,isFetching:K,refetch:ue}=we({...Ae(f(()=>{const e=q.value;return{"lastActivity[after]":new Date(e.getTime()-V.value*60*1e3).toISOString(),"company.servicePackage":w.value,"exists[currentTour]":A.value?!0:void 0,search:P.value,archived:S.value}})),placeholderData:Ce}),H=f(()=>{let e=ne.value??[];return C.value.length>0&&(e=e.filter(o=>{const a=B(o.roles);return a?C.value.includes(a):!1})),e});function ce(e){return e?.servicePackage==="trial"?e.trialEnded?"trial_ended":"trial_active":e?.servicePackage??"paused"}function de(e){switch(e){case"enterprise":return t("company.value.service_package_enterprise");case"proPlus":return t("company.value.service_package_pro_plus");case"pro":return t("company.value.service_package_pro");case"trial_active":return t("company.value.service_package_trial_active");case"trial_ended":return t("company.value.service_package_trial_ended");case"paused":return t("company.value.service_package_paused");default:return e}}const Q=["enterprise","proPlus","pro","trial_active","trial_ended","paused"],pe=f(()=>{const e=new Map;for(const a of H.value){const r=a.company?.name??t("company.field.unknown"),l=a.company?.id??r;e.has(l)||e.set(l,{companyId:l,companyName:r,company:a.company,users:[]}),e.get(l).users.push({...a,roleConfig:F(B(a.roles))})}for(const a of e.values())a.users.sort((r,l)=>{const m=r.lastActivity?new Date(r.lastActivity).getTime():0;return(l.lastActivity?new Date(l.lastActivity).getTime():0)-m});const o=g.value[0];return Array.from(e.values()).sort((a,r)=>{if(!o)return 0;const l=o.desc;if(o.id==="employeeCount"){const m=a.company?.employeeCount??0,u=r.company?.employeeCount??0;return l?u-m:m-u}if(o.id==="activeUsers"){const m=a.users.length,u=r.users.length;return l?u-m:m-u}if(o.id==="name"){const m=a.companyName.toLowerCase(),u=r.companyName.toLowerCase();return l?u.localeCompare(m):m.localeCompare(u)}return 0})}),I=f(()=>{const e=new Map;for(const a of Q)e.set(a,[]);for(const a of pe.value){const r=ce(a.company);e.get(r)?.push(a)}const o=[];for(const a of Q){const r=e.get(a)??[];r.length>0&&o.push({key:a,label:de(a),companies:r})}return o}
3),D=be(new Set),$=f(()=>I.value.flatMap(e=>e.companies.map(o=>o.companyId))),R=f(()=>$.value.length===0?!1:$.value.every(e=>D.value.has(e))),me=f(()=>R.value?t("app.action.collapse_all"):t("app.action.expand_all")),ve=f(()=>R.value?x.collapse:x.expand);function fe(e,o){const a=new Set(D.value);o?a.add(e):a.delete(e),D.value=a}function _e(e){D.value=e?new Set($.value):new Set}function ge(){q.value=new Date,ue()}return(e,o)=>(i(),k(Re,null,{header:c(()=>[v(Ee,{title:s(t)("administration.field.active_users")},{"title-image":c(()=>[v(M,{size:"large",name:s(x).users},null,8,["name"])]),more:c(()=>[n("div",Me,[v(Le,{modelValue:s(P),"onUpdate:modelValue":o[1]||(o[1]=a=>he(P)?P.value=a:null),"filter-config":s(se),loading:s(K),onResetToDefaults:le},{"additional-controls":c(()=>[n("div",ze,[v(G,{size:"sm",variant:"ghost",color:"neutral",icon:s(ve),disabled:s(I).length===0,onClick:o[0]||(o[0]=a=>_e(!s(R)))},{default:c(()=>[b(d(s(me)),1)]),_:1},8,["icon","disabled"]),v(G,{size:"sm",variant:"ghost",color:"neutral",icon:s(x).refresh,loading:s(K),onClick:ge},{default:c(()=>[b(d(s(t)("app.action.refresh")),1)]),_:1},8,["icon","loading"])])]),_:1},8,["modelValue","filter-config","loading"]),n("span",Ne," ("+d(s(H).length)+") ",1)])]),_:1},8,["title"])]),default:c(()=>[n("div",Oe,[s(ie)?(i(),_("div",je,d(s(t)("app.term.loading_2")),1)):s(I).length===0?(i(),_("div",Be,d(s(t)("administration.message.empty")),1)):(i(),_("div",Fe,[(i(!0),_(L,null,E(s(I),a=>(i(),_("div",{key:a.key,class:"space-y-4"},[n("h2",qe,[b(d(a.label)+" ",1),n("span",Ke," ("+d(a.companies.length)+" "+d(s(t)("administration.field.companies_count"))+") ",1)]),n("div",He,[(i(!0),_(L,null,E(a.companies,r=>(i(),k(Se,{key:r.companyId,"default-open":!1,open:s(D).has(r.companyId),class:"border-border bg-card rounded-lg border p-4 shadow-sm","onUpdate:open":l=>fe(r.companyId,l??!1)},{default:c(({open:l})=>
3[n("div",Qe,[n("div",Ge,[n("h3",Xe,[v(Ie,{company:r.company},null,8,["company"])]),r.company?.servicePackage?(i(),k(X,{key:0,text:te(r.company),ui:{text:"whitespace-pre-line"}},{default:c(()=>[v(T,{label:oe(r.company?.servicePackage),color:re(r.company),variant:"subtle",size:"md"},null,8,["label","color"])]),_:2},1032,["text"])):U("",!0),r.company?.employeeCount!==void 0?(i(),k(X,{key:1,text:ae(r.company),ui:{text:"whitespace-pre-line"}},{default:c(()=>[v(T,{color:"neutral",variant:"subtle",size:"md"},{default:c(()=>[b(d(r.company.employeeCount)+" "+d(s(t)("administration.field.employees")),1)]),_:2},1024)]),_:2},1032,["text"])):U("",!0)]),n("div",Ye,[r.company?.employeeCount!==void 0?(i(),k(T,{key:0,color:"info",variant:"subtle",size:"md"},{default:c(()=>[n("span",Je,d(s(t)("administration.field.count",{count:r.users.length})),1)]),_:2},1024)):U("",!0),v(M,{name:l?"i-heroicons-chevron-up":"i-heroicons-chevron-down",class:"h-4 w-4 transition-transform duration-200"},null,8,["name"])])])]),content:c(()=>[n("ul",We,[(i(!0),_(L,null,E(r.users,l=>(i(),_("li",{key:l.id,class:"flex flex-col gap-2 py-2 sm:flex-row sm:items-center sm:justify-between sm:gap-0"},[n("div",Ze,[v(M,{name:s(x).user,class:"h-4 w-4 text-muted"},null,8,["name"]),v(T,{color:l.roleConfig.color,variant:"subtle",size:"md"},{default:c(()=>[b(d(l.roleConfig.label),1)]),_:2},1032,["color"]),n("span",et,[v(Te,{user:l},null,8,["user"])]),l.currentTour?(i(),k(T,{key:0,color:"success",variant:"subtle",size:"md",icon:s(x).tour},{default:c(()=>[b(d(s(t)("tour.term.on")),1)]),_:1},8,["icon"])):U("",!0)]),n("span",tt,[l.lastActivity?(i(),k(Ve,{key:0,date:l.lastActivity,"with-seconds":""},null,8,["date"])):(i(),_(L,{key:1},[b(d(s(t)("app.term.unknown")),1)],64))])]))),128))])]),_:2},1032,["open","onUpdate:open"]))),128))])]))),128))]))])]),_:1}))}}),Pt=at;export{Pt 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.