/*! maintenance_supporter frontend 2.70.0 */ import{a as he,b as Ht,c as vt,d as Nt,e as Ct,f as ue,g as ge,h as me}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-UGIIDVTL.js";import{a as W,b as Bt,c as Vt,d as ve,e as be,f as Ut,g as fe,h as ye,i as we,j as $e,k as ke,l as Te,m as je,n as Se,o as Ee,p as Me,w as Ce,z as Re}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-S2O7XNSC.js";import"/maintenance_supporter_panelfiles/panel-chunks/chunk-JSY4RS7D.js";import"/maintenance_supporter_panelfiles/panel-chunks/chunk-VZ2E6UPO.js";import"/maintenance_supporter_panelfiles/panel-chunks/chunk-SYT5D73A.js";import"/maintenance_supporter_panelfiles/panel-chunks/chunk-SBOLPJAX.js";import{b as _e}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-VFPFVFKO.js";import"/maintenance_supporter_panelfiles/panel-chunks/chunk-MKNEWK2D.js";import{a as Jt}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-3L2PFMVS.js";import{a as xe}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-J4OBOTUE.js";import{a as S}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-KKI2ZPWC.js";import{A as Et,B as Mt,C as pe,D as Ft,a as u,b as R,c as r,d as H,f as d,h as O,i as Zt,j as le,k as ce,l as w,m,n as zt,o as It,p as Pt,q as s,r as Lt,s as L,t as de,u as Y,v as V,w as kt,x as _t}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-VSV22GFT.js";var ii=["assignee_pool","required_completion_fields","checklist","labels","history"],si=["checklist_progress"],ai=["tasks","parts"],ri=["manual_docs","battery_fleet_excluded"];function te(o,l,t=[]){for(let e of l)o[e]===void 0&&(o[e]=[]);for(let e of t)o[e]===void 0&&(o[e]={})}function oi(o){let l=o;te(l,ai),l.object&&typeof l.object=="object"&&te(l.object,ri);for(let t of l.tasks)te(t,ii,si);return o}function Rt(o){for(let l of o)oi(l);return o}function ni(o,l){if(l.objects)return l.objects;let t=l.delta||[],e=l.removed||[];if(!t.length&&!e.length)return null;let i=new Map(o.map(a=>[a.entry_id,a]));for(let a of t)i.set(a.entry_id,a);for(let a of e)i.delete(a);return[...i.values()]}function Oe(o,l){return l.objects&&Rt(l.objects),l.delta&&Rt(l.delta),ni(o,l)}var A={overviewTab:"msp-overview-tab",collapsedSections:"msp-collapsed-sections",chartRange:"msp-chart-range",chartHideOutliers:"msp-chart-hide-outliers",taskSort:"maintenance_supporter_sort",objectSort:"maintenance_supporter_object_sort",groupBy:"maintenance_supporter_groupby",objectView:"maintenance_supporter_object_view",objectsCache:"msp-objects-cache",gettingStartedDismissed:"msp-gs-dismissed",batteryRosterSort:"ms_bf_roster_sort"};function Z(o){try{return localStorage.getItem(o)}catch{return null}}function q(o,l){try{localStorage.setItem(o,l)}catch{}}var li=168*3600*1e3;function De(){try{let o=Z(A.objectsCache);if(!o)return null;let l=JSON.parse(o);return l.v!==Zt||!Number.isFinite(l.at)||Date.now()-l.at>li||!Array.isArray(l.objects)||l.objects.length===0?null:{objects:l.objects,stats:l.stats??null}}catch{return null}}function ee(o,l){if(!(!Array.isArray(o)||o.length===0))try{let t={v:Zt,at:Date.now(),objects:o,stats:l};q(A.objectsCache,JSON.stringify(t))}catch{}}function D(o){return String(o??"").replace(/[&<>"']/g,l=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[l])}function Ae(o,l,t,e,i,a){let n=[[t.manufacturer,o.manufacturer],[t.model,o.model],[t.serial,o.serial_number],[t.installed,o.installation_date?e(o.installation_date):null],[t.warranty,o.warranty_expiry?e(o.warranty_expiry):null]].filter(([,h])=>!!h),p=l.map(h=>{let g=t.scheduleLabel(h);return` ${D(h.name)} ${D(t.typeLabel(h.type))} ${D(t.statusLabel(h.status))} ${D(g)} ${D(h.last_performed?e(h.last_performed):t.none)} ${D(h.next_due?e(h.next_due):t.none)} ${h.times_performed??0} ${(h.total_cost??0).toFixed(2)} ${D(i)} `}).join(""),c=l.reduce((h,g)=>h+(g.total_cost??0),0);return` ${D(t.title)} \u2014 ${D(o.name)}

${D(o.name)}

${D(t.title)} \xB7 ${D(t.generated)}: ${D(e(a))}

${n.length?`
${n.map(([h,g])=>`
${D(h)}
${D(g)}
`).join("")}
`:""}

${D(t.tasksHeading)} (${l.length})

${p||``}
${D(t.colTask)}${D(t.colType)}${D(t.colStatus)} ${D(t.colSchedule)}${D(t.colLastDone)}${D(t.colNextDue)} ${D(t.colTimes)}${D(t.colCost)}
${D(t.none)}
${D(t.totalCost)}${c.toFixed(2)} ${D(i)}
${o.notes?`
${D(t.notes)}: ${D(o.notes)}
`:""} `}function ie(o,l=new Date){if(!o)return{kind:"none",days:null,date:null};let t=new Date(`${o}T00:00:00`);if(isNaN(t.getTime()))return{kind:"none",days:null,date:null};let e=Date.UTC(l.getFullYear(),l.getMonth(),l.getDate()),i=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()),a=Math.round((i-e)/864e5);return a<0?{kind:"expired",days:a,date:o}:a<=60?{kind:"expiring",days:a,date:o}:{kind:"valid",days:a,date:o}}var I=o=>String(o??"").replace(/[&<>"']/g,l=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[l]);function ze(o,l,t,e,i,a,n,p,c,h=[]){let g=[[t.object,I(l)],[t.type,I(t.typeLabel(o.type))],[t.interval,I(i(o))],[t.nextDue,o.next_due?I(e(o.next_due)):"\u2014"],[t.lastDone,o.last_performed?I(e(o.last_performed)):I(t.never)]];o.priority&&o.priority!=="normal"&&g.push([t.priority,I(o.priority)]);let v=(o.checklist||[]).map(y=>`
  • ${I(y)}
  • `).join(""),_=(y,k)=>y?`
    ${I(k)}
    `:"";return` ${I(o.name)} \u2014 ${I(t.title)}

    ${I(o.name)}

    ${I(l)}
    ${_(a,t.scanView)} ${_(n,t.scanComplete)}
    ${g.map(([y,k])=>``).join("")}
    ${I(y)}${k}
    ${v?`

    ${I(t.checklist)}

    `:""} ${h.length?`

    ${I(t.parts)}

    `:""} ${o.notes?`

    ${I(t.notes)}

    ${I(o.notes)}
    `:""} ${p?`

    ${I(t.manualExcerpt)}

    ${I(p.title)} \u2014 ${I(t.pages)} ${p.startPage}\u2013${p.endPage}: PDF
    ${p.vendorBase?`