/*! maintenance_supporter frontend 2.95.0 */ import{a as Ke,b as Ge,c as Ye,g as si}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-SCLV5YEV.js";import{a as k}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-XSFV5MUM.js";import{a as ni,b as li,c as ci,d as oe,e as di,f as ke}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-YKVD2DJ5.js";import{A as Si,B as Ei,C as Ri,D as Oi,E as Ci,L as Mi,O as Di,a as st,b as ft,c as yt,d as Yt,e as Mt,f as ae,g as ei,h as ii,i as re,j as ri,k as oi,l as O,m as Ft,n as _t,o as Et,p as At,q as je,r as le,s as ce,t as bi,u as fi,v as ki,w as $i,x as ji,y as Ti,z as pe}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-UN244A6U.js";import{b as de,d as yi,e as xi,f as wi}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-45NFFEKB.js";import{a as ne}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-E7KPGZZO.js";import{a as We,b as te,c as xt,d as ee,e as qt,f as ie}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-S7ZP4PVX.js";import{a as Gt,c as Ct}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-ODPGZXCU.js";import"/maintenance_supporter_panelfiles/panel-chunks/chunk-3WM7WAL2.js";import"/maintenance_supporter_panelfiles/panel-chunks/chunk-2SARE4MS.js";import"/maintenance_supporter_panelfiles/panel-chunks/chunk-FQOUX6W2.js";import{a as mi,b as vi}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-GTEFDN23.js";import{c as _i}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-XCDM7D5I.js";import{a as A,b as Z,c as V}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-YQT7IJJB.js";import{a as se,b as wt,d as Qe,e as Je,f as Xe,g as Ze}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-JEWIFUZC.js";import{b as ti,h as ai}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-ZCC7RQPW.js";import"/maintenance_supporter_panelfiles/panel-chunks/chunk-UVBHIULM.js";import"/maintenance_supporter_panelfiles/panel-chunks/chunk-AHDRR46D.js";import{a as we}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-WUMSAU4G.js";import{c as pi,d as $e,e as hi}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-UJICOAU3.js";import{k as Ut}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-LEWJHPDY.js";import{a as P,b as ui,c as gi}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-GGJ6YWZO.js";import{B as Y,C as Q,D as Xt,F as G,G as qe,H as jt,I as Fe,J as Bt,M as Ue,N as Ve,P as St,Q as Nt,T as Zt,a as g,b as N,c as o,d as J,f as p,h as q,i as xe,j as Le,k as He,l as R,m as _,n as Qt,o as Be,p as Lt,s as a,t as Ne,u as at,w as Jt,x as Dt,y as K,z as Ht}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-4XNVTWGC.js";var ns=["assignee_pool","required_completion_fields","checklist","labels","mirror_todo_entities","next_event_titles","history","readings"],ls=["checklist_progress"],cs=["tasks","parts"],ds=["manual_docs","battery_fleet_excluded"];function Te(l,d,t=[]){for(let e of d)l[e]===void 0&&(l[e]=[]);for(let e of t)l[e]===void 0&&(l[e]={})}function ps(l){let d=l;Te(d,cs),d.object&&typeof d.object=="object"&&Te(d.object,ds);for(let t of d.tasks)Te(t,ns,ls);return l}function Vt(l){for(let d of l)ps(d);return l}function hs(l,d){if(d.objects)return d.objects;let t=d.delta||[],e=d.removed||[];if(!t.length&&!e.length)return null;let i=new Map(l.map(s=>[s.entry_id,s]));for(let s of t)i.set(s.entry_id,s);for(let s of e)i.delete(s);return[...i.values()]}function Ai(l,d){return d.objects&&Vt(d.objects),d.delta&&Vt(d.delta),hs(l,d)}var Se=["today","dashboard","calendar","settings"];var us=168*3600*1e3;function Ii(){try{let l=Z(A.objectsCache);if(!l)return null;let d=JSON.parse(l);return d.v!==xe||!Number.isFinite(d.at)||Date.now()-d.at>us||!Array.isArray(d.objects)||d.objects.length===0?null:{objects:d.objects,stats:d.stats??null}}catch{return null}}function Ee(l,d){if(!(!Array.isArray(l)||l.length===0))try{let t={v:xe,at:Date.now(),objects:l,stats:d};V(A.objectsCache,JSON.stringify(t))}catch{}}function zi(l,d,t,e,i,s){let n=[[t.manufacturer,l.manufacturer],[t.model,l.model],[t.serial,l.serial_number],[t.installed,l.installation_date?e(l.installation_date):null],[t.warranty,l.warranty_expiry?e(l.warranty_expiry):null]].filter(([,u])=>!!u),c=d.map(u=>{let h=t.scheduleLabel(u);return` ${k(u.name)} ${k(t.typeLabel(u.type))} ${k(t.statusLabel(u.status))} ${k(h)} ${k(u.last_performed?e(u.last_performed):t.none)} ${k(u.next_due?e(u.next_due):t.none)} ${u.times_performed??0} ${k(i(u.total_cost??0))} `}).join(""),r=d.reduce((u,h)=>u+(h.total_cost??0),0);return` ${k(t.title)} \u2014 ${k(l.name)}

${k(l.name)}

${k(t.title)} \xB7 ${k(t.generated)}: ${k(e(s))}

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

${k(t.tasksHeading)} (${d.length})

${c||``}
${k(t.colTask)}${k(t.colType)}${k(t.colStatus)} ${k(t.colSchedule)}${k(t.colLastDone)}${k(t.colNextDue)} ${k(t.colTimes)}${k(t.colCost)}
${k(t.none)}
${k(t.totalCost)}${k(i(r))}
${l.notes?`
${k(t.notes)}: ${k(l.notes)}
`:""} `}function Re(l,d=new Date){if(!l)return{kind:"none",days:null,date:null};let t=new Date(`${l}T00:00:00`);if(isNaN(t.getTime()))return{kind:"none",days:null,date:null};let e=Date.UTC(d.getFullYear(),d.getMonth(),d.getDate()),i=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()),s=Math.round((i-e)/864e5);return s<0?{kind:"expired",days:s,date:l}:s<=60?{kind:"expiring",days:s,date:l}:{kind:"valid",days:s,date:l}}function gs(l,d){let t=new Date(l);return Number.isNaN(t.getTime())?l.slice(0,10):d(wt(t))}var B=l=>String(l??"").replace(/[&<>"']/g,d=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[d]);function Pi(l,d,t,e,i,s,n,c,r,u=[],h=null){let m=[[t.object,B(d)],[t.type,B(t.typeLabel(l.type))],[t.interval,B(i(l))],[t.nextDue,l.next_due?B(e(l.next_due)):"\u2014"],[t.lastDone,l.last_performed?B(e(l.last_performed)):B(t.never)]];l.priority&&l.priority!=="normal"&&m.push([t.priority,B(l.priority)]);let v=(l.checklist||[]).map(y=>`
  • ${B(y)}
  • `).join(""),b=(y,M)=>y?`
    ${B(M)}
    `:"";return` ${B(l.name)} \u2014 ${B(t.title)}

    ${B(l.name)}${h?` #${B(h)}`:""}

    ${B(d)}
    ${b(s,t.scanView)} ${b(n,t.scanComplete)}
    ${m.map(([y,M])=>``).join("")}
    ${B(y)}${M}
    ${v?`

    ${B(t.checklist)}

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

    ${B(t.parts)}

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

    ${B(t.notes)}

    ${B(l.notes)}
    `:""} ${c?`

    ${B(t.manualExcerpt)}

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