PageSourceSearch

https://crisiscleanup.org/assets/CommandCenterDashboard-CPIKVBow.js

js crisiscleanup.org collected 2026-10-02 16:31:29 UTC 9,946 bytes, 8 lines download raw bytes

1import{_ as J,u as F,c as S,d as G,e as H,b as U,q as V,n as X,O as E,U as Y,m as ee,I as te}from"./index-D5O7lgDh.js";import{O as b,ac as $,ai as k,af as e,ap as z,aj as s,ah as O,ab as W,aS as u,ak as w,al as Z,a9 as se,a3 as ae,z as A,a4 as oe,ae as I,ar as L,as as N,ad as ne,k as le}from"./vendor-vue-BR-eKINF.js";import{A as ie}from"./Accordion-BuqkEZ1w.js";import{A as re}from"./AccordionItem-BEJXcjhG.js";import{u as de}from"./useWorksiteMapRefactored-0Fyg3O4w.js";import{g as ce,b as ue}from"./dashboard-BPXo8jNa.js";import{S as me}from"./SimpleMap-BWBAY3An.js";import{u as _e}from"./useDashboardActionItems-Dd8kkLt9.js";import{l as j,g as pe}from"./map-BjrB6nGp.js";import{_ as fe}from"./ccu_app-Ch6ztqwy.js";import{Q as he}from"./QRCode-B5JZX7Tl.js";import{l as ve}from"./worksite-DRjbsuWz.js";import"./index-CslkhFo6.js";import"./leaflet-heat-D6XHV0-6.js";import"./useWorktypeImages-Jo9oGsGV.js";import"./ColoredCircle.vue_vue_type_script_setup_true_lang-CPhiKWuD.js";import"./db.service-BXYbV7xM.js";(function(){try{var v=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},l=new v.Error().stack;l&&(v._sentryDebugIds=v._sentryDebugIds||{},v._sentryDebugIds[l]="02fe2857-a13c-4e78-8397-e2109c6f584b",v._sentryDebugIdIdentifier="sentry-dbid-02fe2857-a13c-4e78-8397-e2109c6f584b")}catch{}})();const ge={class:"status-card border rounded p-4 shadow"},be={class:"flex items-center justify-between"},$e={class:"text-6xl font-bold"},we={class:"text-right"},ye={href:"#",class:"text-blue-600"},ke={href:"#",class:"text-blue-600"},xe={href:"#",class:"text-blue-600"},Ce={class:"my-4"},Ie={class:"relative w-full h-4 rounded bg-gray-200"},ze={__name:"TeamCompletion",props:{teams:{type:Array,required:!0}},setup(v){const l=v,i=b(()=>l.teams.reduce((a,d)=>a+d.assigned_work_types.filter(y=>y.status.includes("closed")).length,0)),_=b(()=>l.teams.reduce((a,d)=>a+d.assigned_work_types.filter(y=>y.status.includes("open")).length,0)),p=b(()=>l.teams.reduce((a,d)=>a+d.assigned_work_types.filter(y=>y.status==="open_unassigned").length,0)),f=b(()=>{const a=i.value+_.value+p.value;return a?Math.round(i.value/a*100):0}),m=b(()=>{const a=i.value+_.value+p.value;return`${i.value/a*100}%`}),r=b(()=>{const a=i.value+_.value+p.value;return`${_.value/a*100}%`}),o=b(()=>{const a=i.value+_.value+p.value;return`${p.value/a*100}%`});return(a,d)=>($(),k("div",ge,[e("div",be,[e("div",$e,[z(s(f.value),1),d[0]||(d[0]=e("span",{class:"text-2xl"},"%",-1))]),e("div",we,[e("a",ye,s(i.value)+" "+s(a.$t("teams.cases_closed")),1),d[1]||(d[1]=e("br",null,null,-1)),e("a",ke,s(_.value)+" "+s(a.$t("teams.open_cases")),1),d[2]||(d[2]=e("br",null,null,-1)),e("a",xe,s(p.value)+" "+s(a.$t("teams.overdue_cases")),1)])]),e("div",Ce,[e("div",Ie,[e("div",{class:"absolute left-0 h-4 rounded-l",style:O({width:m.value,backgroundColor:"#8dd362"})},null,4),e("div",{class:"absolute h-4",style:O({left:m.value,width:r.value,backgroundColor:"#f2b85d"})},null,4),e("div",{class:"absolute h-4",style:O({left:`${parseFloat(m.value)+parseFloat(r.value)}%`,width:o.value,backgroundColor:"#f05454"})},null,4)])])]))}},Oe={key:0,class:"flex items-center bg-crisiscleanup-light-smoke relative px-4 pt-2"},Ae={class:"relative"},Le={class:"rounded-lg relative"},Te={class:"p-6 ml-20"},Be={class:"text-3xl font-bold mb-4"},De={class:"mb-4"},Me={class:"flex gap-4 mb-4"},Se={class:"flex items-center gap-2"},Ve=["href"],Ee=["alt"],Ne=["href"],je=["alt"],Fe={__name:"DownloadAppBannerTeams",emits:["update:show"],setup(v,{emit:l}){const i=()=>"https://www.crisiscleanup.org/apps",{updateCurrentUser:_,userPreferences:p}=F();async function f(){await _({preferences:{...p.value,hideTeamsAppBanner:!0}})}return(m,r)=>{const o=W("ccu-icon");return u(p).hideTeamsAppBanner?Z("",!0):($(),k("div",Oe,[e("div",Ae,[r[1]||(r[1]=e("img",{src:fe},null,-1)),w(he,{class:"absolute left-24 top-10 shadow",value:i(),width:"100"},null,8,["value"])]),e("div",Le,[e("div",Te,[e("h2",Be,s(m.$t("dashboard.ask_teams_to_download_app")),1),e("p",De,s(m.$t("dashboard.mobile_app_features_see_teams")),1),e("div",Me,[e("div",Se,[e("a",{ref:"downloadIos",href:u(S).apple,target:"_blank",class:"download-l
1ink"},[e("img",{"data-testid":"testDownloadIosLink",alt:m.$t("nav.ccu_ios"),src:G,width:"120"},null,8,Ee)],8,Ve),e("a",{ref:"downloadAndroid",href:u(S).android,target:"_blank",class:"download-link"},[e("img",{"data-testid":"testDownloadAndroidLink",alt:m.$t("nav.ccu_android"),src:H,width:"120"},null,8,je)],8,Ne)])])])]),w(o,{"data-testid":"testModalCancel2Icon",alt:m.$t("actions.cancel"),size:"xs",type:"cancel",class:"absolute right-5 top-5",onClick:r[0]||(r[0]=()=>{f()})},null,8,["alt"])]))}}},We=J(Fe,[["__scopeId","data-v-fc22e1ba"]]),Ze={class:"grid md:grid-cols-2 grid-cols-1 md:min-h-180 gap-4 p-2 md:p-0"},Pe={class:"p-2 overflow-x-auto"},Qe={class:"font-semibold text-lg mb-3 flex justify-between"},Re={class:"grid grid-cols-3 text-xs gap-2"},qe={class:"col-span-3 grid gap-1 grid-cols-3 font-semibold bg-crisiscleanup-light-smoke rounded p-0.5"},Ke={class:"text-gray-700"},Je={class:"text-gray-700"},Ge={class:"text-gray-700"},He={class:"flex items-center"},Ue={class:"flex flex-col gap-4 p-2"},Xe={class:"font-semibold text-lg mb-3 flex justify-between"},Ye={class:"text-crisiscleanup-dark-blue text-sm hover:underline"},et={class:"relative h-64 md:h-84"},tt={key:0,class:"grid grid-cols-2 gap-2"},st={class:"stats-card"},at={class:"stats-card"},ot={class:"stats-card"},nt={class:"stats-card"},lt={class:"text-primary-dark cursor-pointer"},it={class:"md:mt-6"},rt={class:"font-semibold text-lg mb-3 flex justify-between"},It=se({__name:"CommandCenterDashboard",setup(v){var B;const{currentIncidentId:l,currentIncident:i}=U(),{currentUser:_}=F(),{t:p}=ae(),f=A([]),m=A({}),r=A({});let o;const{loadingActionItems:a}=_e(l.value,(B=_.value)==null?void 0:B.organization.id,_.value),d=async()=>{const t=await le.get("https://api.crisiscleanup.org/affiliated_teams",{params:{limit:500,incident:l.value}});f.value=t.data.results,f.value.length>0&&await E.api().get(`/organizations?id__in=${f.value.map(c=>c.organization).join(",")}`,{dataKey:"results"})},y=b(()=>{const t={};for(const c of f.value)t[c.organization]||(t[c.organization]=[]),t[c.organization].push(c);return t}),P=t=>{const c=E.find(t);return c?c.name:""};function Q(){o==null||o.getMap().zoomIn()}function R(){o==null||o.getMap().zoomOut()}function T(){const{incident_center:t}=te.find(l.value);return t?[t.coordinates[1],t.coordinates[0]]:[35.7465122599185,-96.41150963125656]}function q(){o==null||o.getMap().setView(T(),6)}function K(){o==null||o.getMap().setView(T(),V)}return oe(async()=>{await d(),await ve().then(t=>{m.value=t}),ce(l.value).then(t=>{o=de(t,t.map(c=>c.id),()=>{},(c,g)=>{i.incident_center?g.setView([i.incident_center.coordinates[1],i.incident_center.coordinates[0]],V):g.setView([35.7465122599185,-96.41150963125656],5);for(let h of f.value)j.geoJson(h.cases_area,{color:h.color}).addTo(g);pe(m.value,h=>
1{const n=Y.find(h.user_id);if(n){const x=n.email?`<div class="text-sm"><a href="mailto:${n.email}" class="ml-1">${n.email}</a></div>`:"",C=n.mobile?`<div class="text-sm"><a href="tel:${n.mobile}" class="ml-1">${n.mobile}</a></div>`:"",M=j.popup({closeButton:!0,closeOnClick:!0,autoClose:!1,closeOnEscapeKey:!0}).setContent(`<div class="flex flex-col items-center">
2          <div class="text-sm font-bold">${n.full_name}</div>
3          ${x}
4          ${C}
5          <div class="text-sm">${n.organization.name}</div>
6          <div class="text-xs italic">${p("casesVue.last_seen")} ${ee(h.timestamp)}</div>
7        </div>`);M.setLatLng([h.location[1],h.location[0]]),M.openOn(g)}}).addTo(g)})}),ue({incidentId:l.value}).then(t=>{r.value=t}).catch(t=>{console.error("Error fetching dashboard statistics:",t)})}),(t,c)=>{const g=W("router-link");return $(),k(L,null,[w(We),e("div",Ze,[e("div",Pe,[e("h2",Qe,s(t.$t("dashboard.affiliated_organizations")),1),w(ie,null,{default:I(()=>[($(!0),k(L,null,N(u(y),(D,h)=>($(),ne(re,{key:h,name:P(h),"icon-position":"left","button-classes":"w-full text-left px-2 pt-0.5 focus:outline-none flex gap-1 items-center bg-crisiscleanup-light-smoke rounded p-0.5 font-semibold",classes:"text-sm","body-classes":"py-1","start-open":""},{default:I(()=>[e("div",Re,[e("div",qe,[e("span",Ke,s(t.$t("dashboard.team_name")),1),e("span",Je,s(t.$t("dashboard.team_size")),1),e("span",Ge,s(t.$t("dashboard.team_cases")),1)]),($(!0),k(L,null,N((D||[]).filter(Boolean),n=>{var x,C;return $(),k("div",{key:n.id,class:"col-span-3 grid gap-1 grid-cols-3"},[e("div",He,[e("div",{class:"w-2 h-2 rounded-full mr-2",style:O({backgroundColor:n.color})},null,4),z(" "+s(n.name),1)]),e("span",null,s(((x=n.users)==null?void 0:x.length)??0),1),e("span",null,s(((C=n.assigned_work_types)==null?void 0:C.length)??0),1)])}),128))])]),_:2},1032,["name"]))),128))]),_:1})]),e("div",Ue,[e("h2",Xe,[z(s(t.$t("dashboard.teams_map"))+" ",1),w(g,{to:"/organization/teams"},{default:I(()=>[e("span",Ye,s(t.$t("dashboard.go_to_teams")),1)]),_:1})]),e("div",et,[w(me,{"map-loading":u(a),"data-testid":"testSimpleMapContent","show-zoom-buttons":"","remove-legend":"",onOnZoomIn:Q,onOnZoomOut:R,onOnZoomIncidentCenter:q,onOnZoomInteractive:K},null,8,["map-loading"])]),u(r)?($(),k("div",tt,[e("div",st,[e("p",null,s(t.$t("dashboard.total_value")),1),e("p",null,"$"+s(u(X)(u(r).total_commercial_value)),1)]),e("div",at,[e("p",null,s(t.$t("dashboard.members_served")),1),e("p",null,s(u(r).members_served),1)]),e("div",ot,[e("p",null,s(t.$t("dashboard.total_cases")),1),e("p",null,[w(g,{to:`/incident/${u(l)}/work`},{default:I(()=>[z(s(u(r).total_cases),1)]),_:1},8,["to"])])]),e("div",nt,[e("p",null,s(t.$t("dashboard.active_users_today")),1),e("p",lt,s(u(r).active_users_today),1)])])):Z("",!0),e("div",it,[e("h2",rt,s(t.$t("dashboard.completion_rate")),1),w(ze,{teams:u(f)},null,8,["teams"])])])])],64)}}});export{It as default};
8//# sourceMappingURL=CommandCenterDashboard-CPIKVBow.js.map

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.