1518 lines
92 KiB
JavaScript
1518 lines
92 KiB
JavaScript
var Xe=Object.defineProperty;var Ze=Object.getOwnPropertyDescriptor;var v=(n,e,t,o)=>{for(var r=o>1?void 0:o?Ze(e,t):e,a=n.length-1,i;a>=0;a--)(i=n[a])&&(r=(o?i(e,t,r):i(r))||r);return o&&r&&Xe(e,t,r),r};var K=globalThis,J=K.ShadowRoot&&(K.ShadyCSS===void 0||K.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ie=Symbol(),ve=new WeakMap,U=class{constructor(e,t,o){if(this._$cssResult$=!0,o!==ie)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(J&&e===void 0){let o=t!==void 0&&t.length===1;o&&(e=ve.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),o&&ve.set(t,e))}return e}toString(){return this.cssText}},xe=n=>new U(typeof n=="string"?n:n+"",void 0,ie),S=(n,...e)=>{let t=n.length===1?n[0]:e.reduce((o,r,a)=>o+(i=>{if(i._$cssResult$===!0)return i.cssText;if(typeof i=="number")return i;throw Error("Value passed to 'css' function must be a 'css' function result: "+i+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+n[a+1],n[0]);return new U(t,n,ie)},we=(n,e)=>{if(J)n.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let o=document.createElement("style"),r=K.litNonce;r!==void 0&&o.setAttribute("nonce",r),o.textContent=t.cssText,n.appendChild(o)}},se=J?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let t="";for(let o of e.cssRules)t+=o.cssText;return xe(t)})(n):n;var{is:et,defineProperty:tt,getOwnPropertyDescriptor:ot,getOwnPropertyNames:rt,getOwnPropertySymbols:nt,getPrototypeOf:at}=Object,X=globalThis,ke=X.trustedTypes,it=ke?ke.emptyScript:"",st=X.reactiveElementPolyfillSupport,H=(n,e)=>n,q={toAttribute(n,e){switch(e){case Boolean:n=n?it:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,e){let t=n;switch(e){case Boolean:t=n!==null;break;case Number:t=n===null?null:Number(n);break;case Object:case Array:try{t=JSON.parse(n)}catch{t=null}}return t}},Z=(n,e)=>!et(n,e),$e={attribute:!0,type:String,converter:q,reflect:!1,useDefault:!1,hasChanged:Z};Symbol.metadata??=Symbol("metadata"),X.litPropertyMetadata??=new WeakMap;var x=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=$e){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let o=Symbol(),r=this.getPropertyDescriptor(e,o,t);r!==void 0&&tt(this.prototype,e,r)}}static getPropertyDescriptor(e,t,o){let{get:r,set:a}=ot(this.prototype,e)??{get(){return this[t]},set(i){this[t]=i}};return{get:r,set(i){let s=r?.call(this);a?.call(this,i),this.requestUpdate(e,s,o)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??$e}static _$Ei(){if(this.hasOwnProperty(H("elementProperties")))return;let e=at(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(H("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(H("properties"))){let t=this.properties,o=[...rt(t),...nt(t)];for(let r of o)this.createProperty(r,t[r])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[o,r]of t)this.elementProperties.set(o,r)}this._$Eh=new Map;for(let[t,o]of this.elementProperties){let r=this._$Eu(t,o);r!==void 0&&this._$Eh.set(r,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let o=new Set(e.flat(1/0).reverse());for(let r of o)t.unshift(se(r))}else e!==void 0&&t.push(se(e));return t}static _$Eu(e,t){let o=t.attribute;return o===!1?void 0:typeof o=="string"?o:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let o of t.keys())this.hasOwnProperty(o)&&(e.set(o,this[o]),delete this[o]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return we(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,o){this._$AK(e,o)}_$ET(e,t){let o=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,o);if(r!==void 0&&o.reflect===!0){let a=(o.converter?.toAttribute!==void 0?o.converter:q).toAttribute(t,o.type);this._$Em=e,a==null?this.removeAttribute(r):this.setAttribute(r,a),this._$Em=null}}_$AK(e,t){let o=this.constructor,r=o._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let a=o.getPropertyOptions(r),i=typeof a.converter=="function"?{fromAttribute:a.converter}:a.converter?.fromAttribute!==void 0?a.converter:q;this._$Em=r;let s=i.fromAttribute(t,a.type);this[r]=s??this._$Ej?.get(r)??s,this._$Em=null}}requestUpdate(e,t,o,r=!1,a){if(e!==void 0){let i=this.constructor;if(r===!1&&(a=this[e]),o??=i.getPropertyOptions(e),!((o.hasChanged??Z)(a,t)||o.useDefault&&o.reflect&&a===this._$Ej?.get(e)&&!this.hasAttribute(i._$Eu(e,o))))return;this.C(e,t,o)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:o,reflect:r,wrapped:a},i){o&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,i??t??this[e]),a!==!0||i!==void 0)||(this._$AL.has(e)||(this.hasUpdated||o||(t=void 0),this._$AL.set(e,t)),r===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[r,a]of this._$Ep)this[r]=a;this._$Ep=void 0}let o=this.constructor.elementProperties;if(o.size>0)for(let[r,a]of o){let{wrapped:i}=a,s=this[r];i!==!0||this._$AL.has(r)||s===void 0||this.C(r,void 0,a,s)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(o=>o.hostUpdate?.()),this.update(t)):this._$EM()}catch(o){throw e=!1,this._$EM(),o}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(e){}firstUpdated(e){}};x.elementStyles=[],x.shadowRootOptions={mode:"open"},x[H("elementProperties")]=new Map,x[H("finalized")]=new Map,st?.({ReactiveElement:x}),(X.reactiveElementVersions??=[]).push("2.1.2");var he=globalThis,Se=n=>n,ee=he.trustedTypes,Ae=ee?ee.createPolicy("lit-html",{createHTML:n=>n}):void 0,Ne="$lit$",A=`lit$${Math.random().toFixed(9).slice(2)}$`,Re="?"+A,lt=`<${Re}>`,j=document,F=()=>j.createComment(""),B=n=>n===null||typeof n!="object"&&typeof n!="function",ge=Array.isArray,ct=n=>ge(n)||typeof n?.[Symbol.iterator]=="function",le=`[
|
||
\f\r]`,I=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ce=/-->/g,Ee=/>/g,C=RegExp(`>|${le}(?:([^\\s"'>=/]+)(${le}*=${le}*(?:[^
|
||
\f\r"'\`<>=]|("|')|))|$)`,"g"),je=/'/g,De=/"/g,ze=/^(?:script|style|textarea|title)$/i,me=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),m=me(1),Tt=me(2),Nt=me(3),D=Symbol.for("lit-noChange"),g=Symbol.for("lit-nothing"),Te=new WeakMap,E=j.createTreeWalker(j,129);function Pe(n,e){if(!ge(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ae!==void 0?Ae.createHTML(e):e}var dt=(n,e)=>{let t=n.length-1,o=[],r,a=e===2?"<svg>":e===3?"<math>":"",i=I;for(let s=0;s<t;s++){let c=n[s],p,u,d=-1,_=0;for(;_<c.length&&(i.lastIndex=_,u=i.exec(c),u!==null);)_=i.lastIndex,i===I?u[1]==="!--"?i=Ce:u[1]!==void 0?i=Ee:u[2]!==void 0?(ze.test(u[2])&&(r=RegExp("</"+u[2],"g")),i=C):u[3]!==void 0&&(i=C):i===C?u[0]===">"?(i=r??I,d=-1):u[1]===void 0?d=-2:(d=i.lastIndex-u[2].length,p=u[1],i=u[3]===void 0?C:u[3]==='"'?De:je):i===De||i===je?i=C:i===Ce||i===Ee?i=I:(i=C,r=void 0);let h=i===C&&n[s+1].startsWith("/>")?" ":"";a+=i===I?c+lt:d>=0?(o.push(p),c.slice(0,d)+Ne+c.slice(d)+A+h):c+A+(d===-2?s:h)}return[Pe(n,a+(n[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),o]},W=class n{constructor({strings:e,_$litType$:t},o){let r;this.parts=[];let a=0,i=0,s=e.length-1,c=this.parts,[p,u]=dt(e,t);if(this.el=n.createElement(p,o),E.currentNode=this.el.content,t===2||t===3){let d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(r=E.nextNode())!==null&&c.length<s;){if(r.nodeType===1){if(r.hasAttributes())for(let d of r.getAttributeNames())if(d.endsWith(Ne)){let _=u[i++],h=r.getAttribute(d).split(A),y=/([.?@])?(.*)/.exec(_);c.push({type:1,index:a,name:y[2],strings:h,ctor:y[1]==="."?de:y[1]==="?"?pe:y[1]==="@"?ue:P}),r.removeAttribute(d)}else d.startsWith(A)&&(c.push({type:6,index:a}),r.removeAttribute(d));if(ze.test(r.tagName)){let d=r.textContent.split(A),_=d.length-1;if(_>0){r.textContent=ee?ee.emptyScript:"";for(let h=0;h<_;h++)r.append(d[h],F()),E.nextNode(),c.push({type:2,index:++a});r.append(d[_],F())}}}else if(r.nodeType===8)if(r.data===Re)c.push({type:2,index:a});else{let d=-1;for(;(d=r.data.indexOf(A,d+1))!==-1;)c.push({type:7,index:a}),d+=A.length-1}a++}}static createElement(e,t){let o=j.createElement("template");return o.innerHTML=e,o}};function z(n,e,t=n,o){if(e===D)return e;let r=o!==void 0?t._$Co?.[o]:t._$Cl,a=B(e)?void 0:e._$litDirective$;return r?.constructor!==a&&(r?._$AO?.(!1),a===void 0?r=void 0:(r=new a(n),r._$AT(n,t,o)),o!==void 0?(t._$Co??=[])[o]=r:t._$Cl=r),r!==void 0&&(e=z(n,r._$AS(n,e.values),r,o)),e}var ce=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:o}=this._$AD,r=(e?.creationScope??j).importNode(t,!0);E.currentNode=r;let a=E.nextNode(),i=0,s=0,c=o[0];for(;c!==void 0;){if(i===c.index){let p;c.type===2?p=new G(a,a.nextSibling,this,e):c.type===1?p=new c.ctor(a,c.name,c.strings,this,e):c.type===6&&(p=new _e(a,this,e)),this._$AV.push(p),c=o[++s]}i!==c?.index&&(a=E.nextNode(),i++)}return E.currentNode=j,r}p(e){let t=0;for(let o of this._$AV)o!==void 0&&(o.strings!==void 0?(o._$AI(e,o,t),t+=o.strings.length-2):o._$AI(e[t])),t++}},G=class n{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,o,r){this.type=2,this._$AH=g,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=o,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=z(this,e,t),B(e)?e===g||e==null||e===""?(this._$AH!==g&&this._$AR(),this._$AH=g):e!==this._$AH&&e!==D&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):ct(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==g&&B(this._$AH)?this._$AA.nextSibling.data=e:this.T(j.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:o}=e,r=typeof o=="number"?this._$AC(e):(o.el===void 0&&(o.el=W.createElement(Pe(o.h,o.h[0]),this.options)),o);if(this._$AH?._$AD===r)this._$AH.p(t);else{let a=new ce(r,this),i=a.u(this.options);a.p(t),this.T(i),this._$AH=a}}_$AC(e){let t=Te.get(e.strings);return t===void 0&&Te.set(e.strings,t=new W(e)),t}k(e){ge(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,o,r=0;for(let a of e)r===t.length?t.push(o=new n(this.O(F()),this.O(F()),this,this.options)):o=t[r],o._$AI(a),r++;r<t.length&&(this._$AR(o&&o._$AB.nextSibling,r),t.length=r)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let o=Se(e).nextSibling;Se(e).remove(),e=o}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},P=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,o,r,a){this.type=1,this._$AH=g,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=a,o.length>2||o[0]!==""||o[1]!==""?(this._$AH=Array(o.length-1).fill(new String),this.strings=o):this._$AH=g}_$AI(e,t=this,o,r){let a=this.strings,i=!1;if(a===void 0)e=z(this,e,t,0),i=!B(e)||e!==this._$AH&&e!==D,i&&(this._$AH=e);else{let s=e,c,p;for(e=a[0],c=0;c<a.length-1;c++)p=z(this,s[o+c],t,c),p===D&&(p=this._$AH[c]),i||=!B(p)||p!==this._$AH[c],p===g?e=g:e!==g&&(e+=(p??"")+a[c+1]),this._$AH[c]=p}i&&!r&&this.j(e)}j(e){e===g?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},de=class extends P{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===g?void 0:e}},pe=class extends P{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==g)}},ue=class extends P{constructor(e,t,o,r,a){super(e,t,o,r,a),this.type=5}_$AI(e,t=this){if((e=z(this,e,t,0)??g)===D)return;let o=this._$AH,r=e===g&&o!==g||e.capture!==o.capture||e.once!==o.once||e.passive!==o.passive,a=e!==g&&(o===g||r);r&&this.element.removeEventListener(this.name,this,o),a&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},_e=class{constructor(e,t,o){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=o}get _$AU(){return this._$AM._$AU}_$AI(e){z(this,e)}};var pt=he.litHtmlPolyfillSupport;pt?.(W,G),(he.litHtmlVersions??=[]).push("3.3.2");var Oe=(n,e,t)=>{let o=t?.renderBefore??e,r=o._$litPart$;if(r===void 0){let a=t?.renderBefore??null;o._$litPart$=r=new G(e.insertBefore(F(),a),a,void 0,t??{})}return r._$AI(n),r};var fe=globalThis,w=class extends x{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Oe(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return D}};w._$litElement$=!0,w.finalized=!0,fe.litElementHydrateSupport?.({LitElement:w});var ut=fe.litElementPolyfillSupport;ut?.({LitElement:w});(fe.litElementVersions??=[]).push("4.2.2");var _t={attribute:!0,type:String,converter:q,reflect:!1,hasChanged:Z},ht=(n=_t,e,t)=>{let{kind:o,metadata:r}=t,a=globalThis.litPropertyMetadata.get(r);if(a===void 0&&globalThis.litPropertyMetadata.set(r,a=new Map),o==="setter"&&((n=Object.create(n)).wrapped=!0),a.set(t.name,n),o==="accessor"){let{name:i}=t;return{set(s){let c=e.get.call(this);e.set.call(this,s),this.requestUpdate(i,c,n,!0,s)},init(s){return s!==void 0&&this.C(i,void 0,n,s),s}}}if(o==="setter"){let{name:i}=t;return function(s){let c=this[i];e.call(this,s),this.requestUpdate(i,c,n,!0,s)}}throw Error("Unsupported decorator location: "+o)};function V(n){return(e,t)=>typeof t=="object"?ht(n,e,t):((o,r,a)=>{let i=r.hasOwnProperty(a);return r.constructor.createProperty(a,o),i?Object.getOwnPropertyDescriptor(r,a):void 0})(n,e,t)}function k(n){return V({...n,state:!0,attribute:!1})}var gt={days:1,weeks:7,months:30.4368,years:365.25};function Le(n,e){return!n||n<=0?0:n*(gt[e||"days"]??1)}var Me=5;function Y(n){let e=n.getFullYear(),t=String(n.getMonth()+1).padStart(2,"0"),o=String(n.getDate()).padStart(2,"0");return`${e}-${t}-${o}`}function mt(n,e){let t=[];for(let o=0;o<e;o++){let r=new Date(n);r.setDate(r.getDate()+o),r.setHours(0,0,0,0),t.push(Y(r))}return t}function oe(n,e){let[t,o,r]=n.split("-").map(Number),a=new Date(t,o-1,r);return a.setDate(a.getDate()+e),Y(a)}function ft(n){if(!n||n.length===0)return null;let e=n.map(t=>t.cost).filter(t=>typeof t=="number");return e.length===0?null:e.reduce((t,o)=>t+o,0)/e.length}function yt(n){let{windowStart:e,windowEnd:t,task:o,entryId:r,objectName:a}=n,i=[],s=(d,_)=>({date:d,entry_id:r,task_id:o.id,task_name:o.name,object_name:a,status:_&&(o.status==="overdue"||o.status==="triggered")?"ok":o.status,days_until_due:_?null:o.days_until_due??null,projected:_,schedule_type:o.schedule_type,interval_days:o.interval_days??null,interval_unit:o.interval_unit??null,responsible_user_id:o.responsible_user_id??null,avg_cost:ft(o.history),adaptive_enabled:!!o.adaptive_config?.enabled,prediction_confidence:o.threshold_prediction_confidence??null}),c=Math.max(1,Math.round(Le(o.interval_days,o.interval_unit)));if(o.status==="overdue"||o.status==="triggered"){if(i.push(s(e,!1)),o.schedule_type==="time_based"&&o.interval_days&&o.interval_days>0){let d=oe(e,c),_=1;for(;d<=t&&_<Me;)i.push(s(d,!0)),_++,d=oe(d,c)}return i}let p=o.next_due;if(typeof p!="string"||!p)return i;let u=p.slice(0,10);if(u>=e&&u<=t)i.push(s(u,!1));else if(u>t)return i;if(o.schedule_type==="time_based"&&o.interval_days&&o.interval_days>0){let d=oe(u,c),_=i.length;for(;d<=t&&_<Me;)d>=e&&(i.push(s(d,!0)),_++),d=oe(d,c)}return i}var Ue={overdue:0,triggered:1,due_soon:2,ok:3};function He(n,e,t,o=null){let r=mt(e,t),a=r[0],i=r[r.length-1],s=[];for(let p of n){let u=p.object?.name||"",d=p.entry_id,_=p.tasks||[];for(let h of _){if(o&&h.responsible_user_id!==o||h.enabled===!1)continue;let y=yt({windowStart:a,windowEnd:i,task:h,entryId:d,objectName:u});s.push(...y)}}let c=new Map;for(let p of r)c.set(p,[]);for(let p of s){let u=c.get(p.date);u&&u.push(p)}for(let[,p]of c)p.sort((u,d)=>{let _=Ue[u.status]??99,h=Ue[d.status]??99;if(_!==h)return _-h;if(u.projected!==d.projected)return u.projected?1:-1;let y=u.object_name.localeCompare(d.object_name);return y!==0?y:u.task_name.localeCompare(d.task_name)});return r.map(p=>({date:p,events:c.get(p)??[]}))}var bt={completed:"ok",reset:"ok",skipped:"due_soon",triggered:"triggered",trigger_replaced:"triggered",trigger_removed:"ok"};function vt(n,e){let t=[];for(let o=e-1;o>=0;o--){let r=new Date(n);r.setDate(r.getDate()-o),r.setHours(0,0,0,0),t.push(Y(r))}return t}function qe(n,e,t,o=null){let r=vt(e,t),a=r[0],i=r[r.length-1],s=new Map;for(let p of r)s.set(p,[]);for(let p of n){let u=p.object?.name||"",d=p.entry_id,_=p.tasks||[];for(let h of _){if(o&&h.responsible_user_id!==o)continue;let y=h.history||[];for(let l of y){if(typeof l?.timestamp!="string")continue;let $=l.timestamp.slice(0,10);if($<a||$>i)continue;let N=s.get($);if(!N)continue;let R=l.type??"completed";N.push({date:$,entry_id:d,task_id:h.id,task_name:h.name,object_name:u,status:bt[R]??"ok",days_until_due:null,projected:!1,schedule_type:h.schedule_type,interval_days:h.interval_days??null,responsible_user_id:h.responsible_user_id??null,avg_cost:typeof l.cost=="number"?l.cost:null,adaptive_enabled:!!h.adaptive_config?.enabled,prediction_confidence:null,history_timestamp:l.timestamp,history_type:R,history_cost:typeof l.cost=="number"?l.cost:null,history_notes:typeof l.notes=="string"?l.notes:null,history_duration:typeof l.duration=="number"?l.duration:null})}}}let c={completed:0,reset:1,skipped:2,triggered:3,trigger_replaced:4};for(let[,p]of s)p.sort((u,d)=>{let _=c[u.history_type??""]??99,h=c[d.history_type??""]??99;if(_!==h)return _-h;let y=u.object_name.localeCompare(d.object_name);return y!==0?y:u.task_name.localeCompare(d.task_name)});return r.map(p=>({date:p,events:s.get(p)??[]}))}var Ie=S`
|
||
.cal-controls {
|
||
display: flex;
|
||
gap: 12px;
|
||
align-items: center;
|
||
flex-wrap: wrap;
|
||
padding: 12px 16px;
|
||
border-bottom: 1px solid var(--divider-color);
|
||
}
|
||
.cal-window-chips {
|
||
display: flex;
|
||
gap: 4px;
|
||
background: var(--card-background-color, var(--ha-card-background, #1c1c1c));
|
||
border-radius: 999px;
|
||
padding: 3px;
|
||
}
|
||
.cal-window-chip {
|
||
padding: 6px 14px;
|
||
border: none;
|
||
background: transparent;
|
||
color: var(--secondary-text-color);
|
||
font-size: 13px;
|
||
font-weight: 500;
|
||
cursor: pointer;
|
||
border-radius: 999px;
|
||
transition: background 0.12s, color 0.12s;
|
||
}
|
||
.cal-window-chip:hover { color: var(--primary-text-color); }
|
||
.cal-window-chip.active {
|
||
background: var(--primary-color);
|
||
color: var(--text-primary-color, #fff);
|
||
}
|
||
/* v2.2.0 — past-window chips: visually distinguished from forward chips
|
||
so the user grasps the time-direction switch at a glance. Uses a
|
||
muted secondary tone instead of the primary blue. v2.3.x: explicit
|
||
"−N d" / "+N d" prefixes + dot separator so past vs forward groups
|
||
read at a glance instead of being two pill rows that look identical
|
||
except for a small arrow. (User feedback: *"das −30 und die + sind
|
||
noch schlecht angeordnet"*.) */
|
||
.cal-past-chips {
|
||
/* margin-right replaced by explicit separator below */
|
||
}
|
||
.cal-past-chip.active {
|
||
background: var(--secondary-text-color, #888);
|
||
}
|
||
.cal-chip-separator {
|
||
color: var(--divider-color);
|
||
font-size: 8px;
|
||
align-self: center;
|
||
margin: 0 2px;
|
||
line-height: 1;
|
||
}
|
||
.cal-user-filter {
|
||
margin-left: auto;
|
||
padding: 6px 10px;
|
||
background: var(--card-background-color, var(--ha-card-background, #1c1c1c));
|
||
color: var(--primary-text-color);
|
||
border: 1px solid var(--divider-color);
|
||
border-radius: 6px;
|
||
font-size: 13px;
|
||
cursor: pointer;
|
||
}
|
||
.cal-rolling { padding: 8px 16px 32px; }
|
||
.cal-day-row {
|
||
display: flex;
|
||
gap: 12px;
|
||
padding: 12px 0;
|
||
border-bottom: 1px solid var(--divider-color);
|
||
}
|
||
.cal-day-pill {
|
||
width: 56px;
|
||
height: 56px;
|
||
border-radius: 12px;
|
||
background: var(--card-background-color, var(--ha-card-background, #1c1c1c));
|
||
border: 1px solid var(--divider-color);
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
justify-content: center;
|
||
flex-shrink: 0;
|
||
}
|
||
.cal-day-pill.cal-today {
|
||
background: var(--primary-color);
|
||
border-color: var(--primary-color);
|
||
}
|
||
.cal-pill-weekday {
|
||
font-size: 10px;
|
||
font-weight: 600;
|
||
text-transform: uppercase;
|
||
letter-spacing: 0.4px;
|
||
color: var(--secondary-text-color);
|
||
}
|
||
.cal-pill-day {
|
||
font-size: 20px;
|
||
font-weight: 700;
|
||
color: var(--primary-text-color);
|
||
line-height: 1.1;
|
||
}
|
||
.cal-day-pill.cal-today .cal-pill-weekday,
|
||
.cal-day-pill.cal-today .cal-pill-day {
|
||
color: var(--text-primary-color, #fff);
|
||
}
|
||
.cal-day-content { flex: 1; min-width: 0; }
|
||
.cal-day-header {
|
||
display: flex;
|
||
align-items: baseline;
|
||
gap: 8px;
|
||
margin-bottom: 6px;
|
||
}
|
||
.cal-day-month { color: var(--secondary-text-color); font-size: 13px; }
|
||
.cal-day-today-badge {
|
||
color: var(--primary-color);
|
||
font-size: 11px;
|
||
font-weight: 600;
|
||
text-transform: uppercase;
|
||
letter-spacing: 0.5px;
|
||
}
|
||
.cal-empty {
|
||
color: var(--secondary-text-color);
|
||
font-size: 13px;
|
||
font-style: italic;
|
||
padding: 4px 0 4px;
|
||
}
|
||
.cal-event {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 10px;
|
||
padding: 8px 0;
|
||
cursor: pointer;
|
||
border-radius: 4px;
|
||
transition: background 0.12s;
|
||
}
|
||
.cal-event:hover { background: var(--state-icon-color, rgba(255,255,255,0.04)); }
|
||
.cal-event-projected { opacity: 0.55; }
|
||
.cal-event-body { flex: 1; min-width: 0; }
|
||
.cal-event-title {
|
||
font-size: 14px;
|
||
color: var(--primary-text-color);
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
white-space: nowrap;
|
||
}
|
||
.cal-event-recur {
|
||
display: block;
|
||
font-size: 11px;
|
||
color: var(--secondary-text-color);
|
||
margin-top: 2px;
|
||
}
|
||
.cal-event-icon {
|
||
--mdc-icon-size: 18px;
|
||
flex-shrink: 0;
|
||
}
|
||
.cal-source-time { color: var(--secondary-text-color); }
|
||
.cal-source-sensor { color: var(--primary-color); }
|
||
.cal-event-prediction {
|
||
display: inline-block;
|
||
font-size: 11px;
|
||
margin-top: 2px;
|
||
padding: 1px 6px;
|
||
border-radius: 999px;
|
||
background: var(--card-background-color, var(--ha-card-background, #1c1c1c));
|
||
border: 1px solid var(--divider-color);
|
||
}
|
||
.cal-conf-high { color: var(--success-color, #4caf50); border-color: #4caf5044; }
|
||
.cal-conf-medium { color: var(--warning-color, #f9a825); border-color: #f9a82544; }
|
||
.cal-conf-low { color: var(--error-color, #d32f2f); border-color: #d32f2f44; }
|
||
.cal-event-cost {
|
||
font-size: 12px;
|
||
color: var(--secondary-text-color);
|
||
flex-shrink: 0;
|
||
}
|
||
.cal-status-pill {
|
||
flex-shrink: 0;
|
||
padding: 2px 8px;
|
||
border-radius: 999px;
|
||
font-size: 10px;
|
||
font-weight: 700;
|
||
text-transform: uppercase;
|
||
letter-spacing: 0.4px;
|
||
color: #fff;
|
||
}
|
||
.cal-status-overdue { background: #d32f2f; }
|
||
.cal-status-triggered { background: #038fc7; }
|
||
.cal-status-due_soon { background: #f9a825; color: #000; }
|
||
.cal-status-ok { background: #2e7d32; }
|
||
|
||
@media (max-width: 600px) {
|
||
.cal-controls { padding: 10px 12px; }
|
||
.cal-rolling { padding: 6px 12px 24px; }
|
||
.cal-day-pill { width: 48px; height: 48px; }
|
||
.cal-pill-day { font-size: 17px; }
|
||
.cal-user-filter { margin-left: 0; width: 100%; }
|
||
}
|
||
`;var Fe={maintenance:"Maintenance",objects:"Objects",tasks:"Tasks",overdue:"Overdue",due_soon:"Due Soon",triggered:"Triggered",trigger_replaced:"Trigger replaced",ok:"OK",all:"All",new_object:"+ New Object",templates_from:"From template",templates_title:"Start from a template",templates_task_count:"{n} tasks",template_created:"Created from template",onboard_hint:"Add your first object to start tracking maintenance.",edit:"Edit",duplicate:"Duplicate",task_duplicated:"Task duplicated",object_duplicated:"Object duplicated",delete:"Delete",add_task:"+ Add Task",complete:"Complete",completed:"Completed",skip:"Skip",skipped:"Skipped",missed:"Missed",reset:"Reset",snooze:"Snooze",snoozed:"Snoozed",cancel:"Cancel",bulk_select:"Select",bulk_select_all:"Select all",bulk_n_selected:"{n} selected",bulk_completed:"{n} tasks completed",bulk_archived:"{n} tasks archived",completing:"Completing\u2026",interval:"Interval",warning:"Warning",last_performed:"Last performed",next_due:"Next due",days_until_due:"Days until due",avg_duration:"Avg duration",trigger:"Trigger",trigger_type:"Trigger type",threshold_above:"Upper limit",threshold_below:"Lower limit",threshold:"Threshold",counter:"Counter",state_change:"State change",runtime:"Runtime",runtime_hours:"Target runtime (hours)",target_value:"Target value",baseline:"Baseline",target_changes:"Target changes",for_minutes:"For (minutes)",time_based:"Time-based",sensor_based:"Sensor-based",manual:"Manual",one_time:"One-time",weekdays:"Weekdays",nth_weekday:"Nth weekday of month",day_of_month:"Day of month",recurrence_on_days:"Repeat on",recurrence_occurrence:"Occurrence",recurrence_weekday:"Weekday",recurrence_day:"Day of month (1\u201331)",recurrence_last_day:"Last day of the month",recurrence_business_day:"Business days only (roll back from weekend)",recurrence_offset:"Offset (days, \xB1)",recurrence_offset_help:"Shift the date by \xB1N days, e.g. -2 = two days before.",last_day_month:"Last day of month",last_business_day_month:"Last business day",ord_1:"1st",ord_2:"2nd",ord_3:"3rd",ord_4:"4th",ord_5:"5th",ord_last:"Last",day_word:"Day",interval_value:"Interval",interval_unit:"Unit",unit_days:"Days",unit_weeks:"Weeks",unit_months:"Months",unit_years:"Years",due_date:"Due date",cleaning:"Cleaning",inspection:"Inspection",replacement:"Replacement",calibration:"Calibration",service:"Service",reading:"Reading",custom:"Custom",history:"History",cost:"Cost",report_button:"Report",report_title:"Maintenance report",report_generated:"Generated",report_times_done:"Done",report_total_cost:"Total cost",report_every:"every {n} {unit}",report_notes:"Notes",report_col_type:"Type",report_col_status:"Status",report_col_schedule:"Schedule",duration:"Duration",both:"Both",trigger_val:"Trigger value",complete_title:"Complete: ",checklist:"Checklist",checklist_steps_optional:"Checklist steps (optional)",checklist_placeholder:`Clean filter
|
||
Replace seal
|
||
Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"{field}: too long (max {n} characters)",err_too_short:"{field}: too short (min {n} characters)",err_value_too_high:"{field}: too large (max {n})",err_value_too_low:"{field}: too small (min {n})",err_required:"{field}: required",err_wrong_type:"{field}: wrong type (expected: {type})",err_invalid_choice:"{field}: not an allowed value",err_invalid_value:"{field}: invalid value",feat_schedule_time:"Time-of-day scheduling",feat_schedule_time_desc:"Tasks become overdue at a specific time of day instead of midnight.",schedule_time_optional:"Due at time (optional, HH:MM)",schedule_time_help:"Empty = midnight (default). HA timezone.",at_time:"at",notes_optional:"Notes (optional)",cost_optional:"Cost (optional)",duration_minutes:"Duration in minutes (optional)",days:"days",day:"day",today:"Today",d_overdue:"d overdue",no_tasks:"No maintenance tasks yet. Create an object to get started.",no_tasks_short:"No tasks",no_history:"No history entries yet.",show_all:"Show all",cost_duration_chart:"Cost & Duration",installed:"Installed",confirm_delete_object:"Delete this object and all its tasks?",confirm_delete_task:"Delete this task?",min:"Min",max:"Max",save:"Save",saving:"Saving\u2026",edit_task:"Edit Task",new_task:"New Maintenance Task",task_name:"Task name",maintenance_type:"Maintenance type",priority:"Priority",labels:"Labels",labels_placeholder:"e.g. safety, seasonal, tenant-visible",labels_help:"Comma-separated tags for filtering and reporting.",priority_low:"Low",priority_normal:"Normal",priority_high:"High",schedule_type:"Schedule type",interval_days:"Interval (days)",warning_days:"Warning days",earliest_completion_days:"Earliest completion (days before due)",earliest_completion_days_help:"Leave empty to allow completing any time. 0 = only on/after the due date.",last_performed_optional:"Last performed (optional)",interval_anchor:"Interval anchor",anchor_completion:"From completion date",anchor_planned:"From planned date (no drift)",edit_object:"Edit Object",name:"Name",manufacturer_optional:"Manufacturer (optional)",model_optional:"Model (optional)",serial_number_optional:"Serial number (optional)",serial_number_label:"S/N",documentation_url_label:"Manual",object_notes_label:"Notes",sort_due_date:"Due date",sort_object:"Object name",sort_type:"Type",sort_task_name:"Task name",all_objects:"All objects",tasks_lower:"tasks",no_tasks_yet:"No tasks yet",add_first_task:"Add first task",trigger_configuration:"Trigger Configuration",entity_id:"Entity ID",comma_separated:"comma-separated",entity_logic:"Entity logic",entity_logic_any:"Any entity triggers",entity_logic_all:"All entities must trigger",entities:"entities",attribute_optional:"Attribute (optional, blank = state)",use_entity_state:"Use entity state (no attribute)",trigger_above:"Trigger above",trigger_below:"Trigger below",for_at_least_minutes:"For at least (minutes)",safety_interval_days:"Safety interval (days, optional)",safety_interval:"Safety interval (optional)",delta_mode:"Delta mode",from_state_optional:"From state (optional)",to_state_optional:"To state (optional)",documentation_url_optional:"Documentation URL (optional)",object_notes_optional:"Notes (optional)",nfc_tag_id_optional:"NFC Tag ID (optional)",nfc_tags_empty_help:"No NFC tags registered in Home Assistant yet.",nfc_tags_open_settings:"Open Tags settings",nfc_tags_refresh:"Refresh",environmental_entity_optional:"Environmental sensor (optional)",environmental_entity_helper:"e.g. sensor.outdoor_temperature \u2014 adjusts the interval based on environmental conditions",environmental_attribute_optional:"Environmental attribute (optional)",nfc_tag_id:"NFC Tag ID",nfc_linked:"NFC tag linked",nfc_link_hint:"Click to link NFC tag",responsible_user:"Responsible User",shared_with:"Shared with (rotation)",shared_with_help:"Pick multiple people to share this task; the responsible person rotates on each completion.",rotation_strategy:"Rotation",rotation_none:"No rotation",rotation_round_robin:"Round-robin",rotation_least_completed:"Least completed",rotation_random:"Random",no_user_assigned:"(No user assigned)",all_users:"All Users",my_tasks:"My Tasks",tab_calendar:"Calendar",cal_no_events:"No maintenance",cal_window_7:"7 days",cal_window_14:"14 days",cal_window_30:"30 days",cal_window_365:"1 year",cal_every_n_days:"every {n} days",cal_source_time:"Time-based",cal_source_time_adaptive:"Time-based (adaptive)",cal_source_sensor:"Sensor-based",cal_predicted:"predicted",cal_confidence_high:"high confidence",cal_confidence_medium:"medium confidence",cal_confidence_low:"low confidence",budget_monthly:"Monthly budget",budget_yearly:"Yearly budget",groups:"Groups",new_group:"New group",edit_group:"Edit group",no_groups:"No groups yet",delete_group:"Delete group",delete_group_confirm:"Delete group '{name}'?",group_select_tasks:"Select tasks",group_name_required:"Name is required",description_optional:"Description (optional)",selected:"Selected",loading_chart:"Loading chart data...",hide_outliers:"Hide outliers (sensor glitches)",was_maintenance_needed:"Was this maintenance needed?",feedback_needed:"Needed",feedback_not_needed:"Not needed",feedback_not_sure:"Not sure",suggested_interval:"Suggested interval",apply_suggestion:"Apply",reanalyze:"Re-analyze",reanalyze_result:"New analysis",reanalyze_insufficient_data:"Not enough data to produce a recommendation",data_points:"data points",dismiss_suggestion:"Dismiss",confidence_low:"Low",confidence_medium:"Medium",confidence_high:"High",recommended:"recommended",seasonal_awareness:"Seasonal Awareness",edit_seasonal_overrides:"Edit seasonal factors",seasonal_overrides_title:"Seasonal factors (override)",seasonal_overrides_hint:"Factor per month (0.1\u20135.0). Empty = learned automatically.",seasonal_override_invalid:"Invalid value",seasonal_override_range:"Factor must be between 0.1 and 5.0",clear_all:"Clear all",seasonal_chart_title:"Seasonal Factors",seasonal_learned:"Learned",seasonal_manual:"Manual",month_jan:"Jan",month_feb:"Feb",month_mar:"Mar",month_apr:"Apr",month_may:"May",month_jun:"Jun",month_jul:"Jul",month_aug:"Aug",month_sep:"Sep",month_oct:"Oct",month_nov:"Nov",month_dec:"Dec",sensor_prediction:"Sensor Prediction",degradation_trend:"Trend",trend_rising:"Rising",trend_falling:"Falling",trend_stable:"Stable",trend_insufficient_data:"Insufficient data",days_until_threshold:"Days until threshold",threshold_exceeded:"Threshold exceeded",environmental_adjustment:"Environmental factor",sensor_prediction_urgency:"Sensor predicts threshold in ~{days} days",day_short:"day",weibull_reliability_curve:"Reliability Curve",weibull_failure_probability:"Failure Probability",weibull_r_squared:"Fit R\xB2",beta_early_failures:"Early Failures",beta_random_failures:"Random Failures",beta_wear_out:"Wear-out",beta_highly_predictable:"Highly Predictable",confidence_interval:"Confidence Interval",confidence_conservative:"Conservative",confidence_aggressive:"Optimistic",current_interval_marker:"Current interval",recommended_marker:"Recommended",characteristic_life:"Characteristic life",chart_mini_sparkline:"Trend sparkline",chart_history:"Cost and duration history",chart_seasonal:"Seasonal factors, 12 months",chart_weibull:"Weibull reliability curve",chart_sparkline:"Sensor trigger value chart",days_progress:"Days progress",qr_code:"QR Code",qr_generating:"Generating QR code\u2026",qr_error:"Failed to generate QR code.",qr_error_no_url:"No HA URL configured. Please set an external or internal URL in Settings \u2192 System \u2192 Network.",save_error:"Failed to save. Please try again.",qr_print:"Print",qr_download:"Download SVG",qr_action:"Action on scan",qr_action_view:"View maintenance info",qr_action_complete:"Mark maintenance as complete",qr_url_mode:"Link type",qr_mode_companion:"Companion App",qr_mode_local:"Local (mDNS)",qr_mode_server:"Server URL",overview:"Overview",analysis:"Analysis",recent_activities:"Recent Activities",search_notes:"Search notes",avg_cost:"Avg Cost",no_advanced_features:"No advanced features enabled",no_advanced_features_hint:"Enable \u201CAdaptive Intervals\u201D or \u201CSeasonal Patterns\u201D in the integration settings to see analysis data here.",analysis_not_enough_data:"Not enough data for analysis yet.",analysis_not_enough_data_hint:"Weibull analysis requires at least 5 completed maintenances; seasonal patterns become visible after 6+ data points per month.",analysis_manual_task_hint:"Manual tasks without an interval do not generate analysis data.",completions:"completions",current:"Current",shorter:"Shorter",longer:"Longer",normal:"Normal",disabled:"Disabled",compound_logic:"Compound logic",compound:"Compound (multiple conditions)",compound_logic_and:"AND \u2014 all conditions must trigger",compound_logic_or:"OR \u2014 any condition triggers",compound_help:"Combine several sensor conditions into one trigger.",compound_no_conditions:"No conditions yet \u2014 add at least one.",compound_add_condition:"Add condition",compound_condition:"Condition",compound_remove_condition:"Remove condition",card_title:"Title",card_show_header:"Show header with statistics",card_show_actions:"Show action buttons",card_compact:"Compact mode",card_max_items:"Max items (0 = all)",card_filter_status:"Filter by status",card_filter_status_help:"Empty = show all statuses.",card_filter_objects:"Filter by objects",card_filter_objects_help:"Empty = show all objects.",card_filter_entities:"Filter by entities (entity_ids)",card_filter_entities_help:"Pick sensor / binary_sensor entities from this integration. Empty = all.",card_loading_objects:"Loading objects\u2026",card_load_error:"Could not load objects \u2014 check the WebSocket connection.",card_no_tasks_title:"No maintenance tasks yet",card_no_tasks_cta:"\u2192 Create one in the Maintenance panel",no_objects:"No objects yet.",action_error:"Action failed. Please try again.",area_id_optional:"Area (optional)",installation_date_optional:"Installation date (optional)",warranty_expiry_optional:"Warranty expiry (optional)",warranty:"Warranty",warranty_valid_until:"valid until {date}",warranty_expires_in:"expires in {days} days",warranty_expired:"expired",cal_past_windows:"Past windows",cal_forward_windows:"Forward windows",history_edit_title:"Edit history entry",history_edit_timestamp:"Timestamp",manufacturer:"Manufacturer",model:"Model",area:"Area",actions:"Actions",view_mode_label:"View",view_cards:"Card view",view_table:"Table view",objects_table_columns_label:"Objects table columns",objects_table_columns_hint:"Choose which columns appear in the objects table view.",custom_icon_optional:"Icon (optional, e.g. mdi:wrench)",task_enabled:"Task enabled",skip_reason_prompt:"Skip this task?",reason_optional:"Reason (optional)",reset_date_prompt:"Mark task as performed?",reset_date_optional:"Last performed date (optional, defaults to today)",notes_label:"Notes",documentation_label:"Documentation",no_nfc_tag:"\u2014 No tag \u2014",dashboard:"Dashboard",tab_today:"Today",palette_placeholder:"Search objects and tasks\u2026",palette_no_results:"No matches",palette_hint:"\u2191\u2193 to navigate \xB7 Enter to open \xB7 Esc to close",today_all_caught_up:"All caught up! Nothing due this week.",today_overdue:"Overdue",today_due_today:"Due today",today_this_week:"This week",settings:"Settings",settings_features:"Advanced Features",settings_features_desc:"Enable or disable advanced features. Disabling hides them from the UI but does not delete data.",feat_adaptive:"Adaptive Scheduling",feat_adaptive_desc:"Learn optimal intervals from maintenance history",feat_predictions:"Sensor Predictions",feat_predictions_desc:"Predict trigger dates from sensor degradation",feat_seasonal:"Seasonal Adjustments",feat_seasonal_desc:"Adjust intervals based on seasonal patterns",feat_environmental:"Environmental Correlation",feat_environmental_desc:"Correlate intervals with temperature/humidity",feat_budget:"Budget Tracking",feat_budget_desc:"Track monthly and yearly maintenance spending",feat_groups:"Task Groups",feat_groups_desc:"Organize tasks into logical groups",feat_checklists:"Checklists",feat_checklists_desc:"Multi-step procedures for task completion",settings_general:"General",settings_default_warning:"Default warning days",settings_panel_enabled:"Sidebar panel",settings_panel_title:"Sidebar panel title",settings_notifications:"Notifications",settings_notify_service:"Notification service",test_notification:"Test notification",send_test:"Send test",testing:"Sending\u2026",test_notification_success:"Test notification sent",test_notification_failed:"Test notification failed",settings_notify_due_soon:"Notify when due soon",settings_notify_overdue:"Notify when overdue",settings_notify_triggered:"Notify when triggered",settings_interval_hours:"Repeat interval (hours, 0 = once)",settings_quiet_hours:"Quiet hours",settings_quiet_start:"Start",settings_quiet_end:"End",settings_max_per_day:"Max notifications per day (0 = unlimited)",settings_bundling:"Bundle notifications",settings_bundle_threshold:"Bundle threshold",settings_reminder_leads:"Extra reminders (days before due)",settings_reminder_leads_hint:"Comma-separated lead times, e.g. 14, 3, 0 \u2014 one extra reminder fires on each matching day. Empty = off.",settings_actions:"Mobile Action Buttons",settings_action_complete:"Show 'Complete' button",settings_action_skip:"Show 'Skip' button",settings_action_snooze:"Show 'Snooze' button",settings_weekly_digest:"Weekly digest",settings_weekly_digest_hint:"A single summary notification on Monday morning when tasks are due.",settings_warranty_reminder:"Warranty expiry reminder",settings_warranty_reminder_days:"Days before expiry",settings_warranty_reminder_hint:"Notify once when an object's warranty is this many days from expiring.",settings_snooze_hours:"Snooze duration (hours)",settings_budget:"Budget",settings_currency:"Currency",settings_budget_monthly:"Monthly budget",settings_budget_yearly:"Yearly budget",settings_budget_alerts:"Budget alerts",settings_budget_threshold:"Alert threshold (%)",settings_import_export:"Import / Export",settings_export_json:"Export JSON",settings_export_yaml:"Export YAML",settings_export_csv:"Export CSV",settings_import_csv:"Import CSV",settings_import_placeholder:"Paste JSON or CSV content here\u2026",settings_import_btn:"Import",settings_import_success:"{count} objects imported successfully.",settings_export_success:"Export downloaded.",settings_saved:"Setting saved.",settings_include_history:"Include history",sort_alphabetical:"Alphabetical",sort_due_soonest:"Due soonest",sort_task_count:"Task count",sort_area:"Area",sort_assigned_user:"Assigned user",sort_group:"Group",groupby_none:"No grouping",groupby_area:"By area",groupby_group:"By group",groupby_user:"By user",filter_label:"Filter",user_label:"User",sort_label:"Sort",group_by_label:"Group by",state_value_help:'Use the HA state value (usually lowercase, e.g. "on"/"off"). Case is normalised on save.',target_changes_help:"Number of matching transitions before the trigger fires (default: 1).",qr_print_title:"Print QR codes",qr_print_desc:"Generate a printable page of QR codes to cut out and stick on your equipment.",qr_print_load:"Load objects",qr_print_filter:"Filter",qr_print_objects:"Objects",qr_print_actions:"Actions",qr_print_url_mode:"Link type",qr_print_estimate:"Estimated QR codes",qr_print_over_limit:"cap is 200, narrow the filter",qr_print_generate:"Generate QR codes",qr_print_generating:"Generating\u2026",qr_print_ready:"QR codes ready",qr_print_print_button:"Print",qr_print_empty:"Nothing to generate",qr_action_skip:"Skip",vacation_title:"Vacation mode",vacation_active:"active",vacation_ended:"ended",vacation_desc:"Plan a vacation: notifications are paused during the period plus a buffer of days. You can opt specific tasks back in.",vacation_enable:"Enable vacation mode",vacation_start:"Start",vacation_end:"End",vacation_buffer:"Buffer (days)",vacation_exempt_title:"Notify anyway during vacation",vacation_exempt_desc:"Pick tasks that should still notify during vacation (e.g. critical pool chemistry).",vacation_load_tasks:"Load tasks",vacation_preview_btn:"Show preview",vacation_preview_affected:"tasks affected",vacation_event_due_soon:"becomes due soon",vacation_event_overdue:"becomes overdue",vacation_event_triggered_est:"sensor trigger possible",vacation_sensor_based:"(sensor-based)",vacation_action_notify:"Notify anyway",vacation_action_unsilence:"Silence again",vacation_marked_complete:"Marked complete",vacation_marked_skip:"Skipped",vacation_end_now:"End vacation now",add:"Add",show_stats:"Show stats + graphs",hide_stats:"Hide stats",adaptive_no_data:"Not enough completion history yet for adaptive analysis. Complete this task a few more times to unlock interval recommendations and reliability charts.",suggestion_applied:"Suggested interval applied",vacation_mode:"Vacation mode",vacation_status_active:"Active now",vacation_status_scheduled:"Scheduled",vacation_status_inactive:"Inactive",vacation_end_now_confirm:"End vacation immediately?",vacation_exempt_count:"exempt",vacation_advanced:"Advanced\u2026",vacation_open_panel:"Open in panel",enable:"Enable",saved:"Saved",budget_monthly_set:"Set monthly",budget_yearly_set:"Set yearly",budget_advanced:"Currency, alerts\u2026",budget_open_panel:"Open in panel",groups_empty:"No groups yet.",group_new_placeholder:"Add group\u2026",group_delete_confirm:'Delete group "{name}"?',groups_manage_tasks:"Manage task assignments\u2026",groups_open_panel:"Open in panel",unassigned:"Unassigned",no_area:"No area",has_overdue:"Has overdue tasks",object:"Object",settings_panel_access:"Panel access",settings_panel_access_desc:"Admins always have full access. To delegate create, edit and delete to specific non-admins, switch this on and pick them below \u2014 everyone else sees only Complete and Skip.",settings_operator_write:"Allow selected users to create, edit & delete",settings_operator_write_desc:"Off: only admins can change content. On: the selected users below get full access too.",no_non_admin_users:"No non-admin users found. Add some in Settings \u2192 People.",owner_label:"Owner",feat_completion_actions:"Completion actions",feat_completion_actions_desc:"Per-task HA action on complete + quick-complete QR with pre-set values.",on_complete_action_title:"On complete: trigger HA action (optional)",on_complete_action_desc:"Calls an HA service when the task is completed \u2014 e.g. reset a counter on the device.",on_complete_action_service:"Service",on_complete_action_target:"Target entity",on_complete_action_target_hint:"Note: the entity domain must match the service \u2014 e.g. 'button.press' only works on button.*, 'counter.increment' only on counter.*, 'input_button.press' only on input_button.* etc. On a mismatch the action will silently fail (HA logs 'Referenced entities ... missing or not currently available').",on_complete_action_data:"Data (JSON, optional)",on_complete_action_test:"Validate configuration",on_complete_action_test_success:"\u2713 Configuration valid (action will fire only on task completion)",on_complete_action_test_failed:"Failed",quick_complete_defaults_title:"Quick-complete defaults (for QR scans, optional)",quick_complete_defaults_desc:"Pre-set values for quick-complete QR scans. Without these, the QR opens the complete dialog.",quick_complete_defaults_notes:"Notes",quick_complete_defaults_cost:"Cost",quick_complete_defaults_duration:"Duration (minutes)",quick_complete_defaults_feedback_none:"No feedback",quick_complete_defaults_feedback_needed:"Was needed",quick_complete_defaults_feedback_not_needed:"Not needed",quick_complete_success:"Quickly marked complete",show_all_objects:"Show all objects",show_all_tasks:"Clear filter \u2014 show all tasks",filter_to_overdue:"Filter task list to overdue only",filter_to_due_soon:"Filter task list to due-soon only",filter_to_triggered:"Filter task list to triggered only",open_task:"Open task",show_details:"Show history + stats",hide_details:"Hide details",history_empty:"No history yet.",history_edit_button:"Edit entry",total_cost:"Total cost",times_performed:"Performed",older_entries:"older",open_in_panel:"Open in Maintenance panel",skip_reason:"Skip reason (optional)",reset_to_date:"Reset last_performed to",delete_task_confirm:"Delete this task and its history?",delete_object_confirm:"Delete this object and all its tasks?",loading:"Loading\u2026",archive:"Archive",undo:"Undo",task_archived:"Task archived",object_archived:"Object archived",unarchive:"Unarchive",archived:"Archived",show_archived:"Show archived",hide_archived:"Hide archived",confirm_archive_object:"Archive this object and its tasks? They keep their history and can be unarchived later.",settings_archive:"Archive & Retention",settings_archive_desc:"Retire completed one-off tasks without deleting them. Archived items are hidden and inert but keep their history and cost.",settings_archive_oneoff_days:"Auto-archive completed one-off tasks after (days, 0 = off)",settings_delete_archived_oneoff_days:"Auto-delete archived one-off tasks after (days, 0 = never)",archive_object:"Archive object",unarchive_object:"Unarchive object",documents:"Documents",documents_empty:"No documents yet.",doc_upload:"Upload file",doc_uploading:"Uploading\u2026",doc_add_link:"Add link",doc_link_url:"URL (https://\u2026)",doc_link_title:"Title (optional)",doc_open:"Open",doc_delete_confirm:'Delete "{name}"?',doc_too_large:"File is too large (max 25 MB).",doc_upload_failed:"Upload failed.",completion_photo_optional:"Completion photo (optional)",add_photo:"Add photo",uploading:"Uploading\u2026",remove:"Remove",doc_deduped:"Already stored elsewhere \u2014 shared, no extra space used.",doc_dup_in_object:"This file is already attached to this object.",doc_link_invalid:"Only http/https links are allowed.",doc_cat_manual:"Manual",doc_cat_warranty:"Warranty",doc_cat_invoice:"Invoice",doc_cat_spare_parts:"Spare parts",doc_cat_photo:"Photo",doc_cat_other:"Other",doc_link_badge:"Link",doc_storage_title:"Document storage",doc_storage_saved:"Saved via deduplication",doc_storage_refresh:"Refresh",doc_download:"Download",doc_close:"Close",doc_camera:"Take photo",doc_drop_hint:"Drop files here",doc_task_none:"No documents linked to this task.",doc_link_existing:"Link a document\u2026",doc_attach:"Link",doc_unlink:"Unlink",doc_page:"Page",chart_range_7d:"7d",chart_range_30d:"30d",chart_range_90d:"90d",chart_range_1y:"1y",chart_since_service:"since last service",chart_no_stats:"No long-term statistics for this entity \u2014 showing maintenance-event values only",auto_complete_on_recovery:"Auto-complete when the sensor recovers",auto_complete_on_recovery_help:"Records a completion (sets last performed) when the trigger clears itself \u2014 e.g. salt refilled, filter replaced.",doc_search:"Search documents\u2026",doc_search_none:"No matching documents",link_device_optional:"Link to existing device (optional)",parent_object_optional:"Parent object (optional)",parent_none:"(No parent)",paused:"Paused",pause_object:"Pause",resume_object:"Resume",pause_until_prompt:"Freeze this object's schedules \u2014 nothing becomes due and nothing notifies until it is resumed. Optionally set an auto-resume date.",pause_until_label:"Resume on (optional)",object_paused:"Object paused",object_resumed:"Object resumed \u2014 schedules restarted",object_paused_badge:"Paused",paused_until_label:"until",replace_object:"Replace\u2026",replace_object_prompt:"Retire this object and create a successor. History and costs stay archived on the old one; tasks and documents carry over to the new one, counters start fresh.",replace_name_label:"Successor name",object_replaced:"Object replaced \u2014 successor created",reading_unit_label:"Reading unit (e.g. kWh, m\xB3)",reading_unit_help:"Shown next to the recorded value when completing this task.",reading_value_label:"Reading value",reading_label:"Reading",settings_templates_label:"Template gallery",settings_templates_hint:`Untick templates you'll never need \u2014 they disappear from the "From template" pickers (panel and config flow). Nothing else changes; you can re-enable them any time.`,worksheet:"Work sheet",worksheet_scan_view:"Scan to open the task",worksheet_scan_complete:"Scan to complete",worksheet_manual_excerpt:"Manual excerpt",worksheet_pages:"pages",worksheet_printed:"Printed",worksheet_never:"Never",card_all_caught_up:"All caught up \u2014 nothing needs attention",postpone:"Postpone",postpone_date_prompt:"Postpone this occurrence to which date?",postpone_date_label:"New due date",postponed:"Postponed",postponed_to:"Postponed to",season_window_label:"Seasonal window (months)",season_window_hint:"Only due in the selected months; off-season dates roll to the next active month. None = all year.",series_end_label:"Ends",series_end_never:"Never (repeats indefinitely)",series_end_after_count:"After a number of times",series_end_until:"On a date",series_end_count_label:"Number of times",series_end_until_label:"End date"};var Be="\u20AC";var ye="en",We=(()=>{let n=window;return n.__msLocales||(n.__msLocales={store:{},inflight:{}}),n.__msLocales})(),T=We.store;T.en||(T.en=Fe);var wt=new Set(["de","nl","fr","it","es","pt","ru","uk","pl","cs","sv","zh","da","fi","nb","ja","hi"]),kt="/maintenance_supporter_locales",Q=We.inflight;function be(n){return(n||ye).substring(0,2).toLowerCase()}function f(n,e){let t=be(e);return T[t]?.[n]??T.en[n]??n}function Ge(n){let e=be(n);return e===ye||e in T}function Ve(n){let e=be(n);return e===ye||e in T||!wt.has(e)?Promise.resolve():(e in Q||(Q[e]=fetch(`${kt}/${e}.json`).then(t=>t.ok?t.json():null).then(t=>{t?T[e]=t:delete Q[e]}).catch(()=>{delete Q[e]})),Q[e])}var Ye=S`
|
||
:host {
|
||
--maint-ok-color: var(--success-color, #4caf50);
|
||
--maint-due-soon-color: var(--warning-color, #ff9800);
|
||
--maint-overdue-color: var(--error-color, #f44336);
|
||
--maint-triggered-color: #ff5722;
|
||
}
|
||
|
||
.status-badge {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
gap: 4px;
|
||
padding: 2px 8px;
|
||
border-radius: 12px;
|
||
font-size: 12px;
|
||
font-weight: 500;
|
||
color: white;
|
||
white-space: nowrap;
|
||
/* Fixed minimum so OK / Due Soon / Overdue / Triggered pills are uniform
|
||
width in the task table — keeps the object-name column aligned. */
|
||
min-width: 70px;
|
||
box-sizing: border-box;
|
||
}
|
||
/* Shape icon so status is not conveyed by colour alone (accessibility). */
|
||
.status-badge ha-icon { --mdc-icon-size: 14px; margin-left: -1px; }
|
||
|
||
.status-badge.ok { background-color: var(--maint-ok-color); }
|
||
.status-badge.due_soon { background-color: var(--maint-due-soon-color); }
|
||
.status-badge.overdue { background-color: var(--maint-overdue-color); }
|
||
.status-badge.triggered { background-color: var(--maint-triggered-color); }
|
||
/* Completed one-time task ("done") — muted blue-grey. */
|
||
.status-badge.done { background-color: var(--maint-done-color, #78909c); }
|
||
/* v2.10.0: archived (retire-but-retain) — neutral grey, clearly inert. */
|
||
.status-badge.archived { background-color: var(--disabled-color, #9e9e9e); }
|
||
/* v2.20 (N3): paused — frozen but present, info blue. */
|
||
.status-badge.paused { background-color: var(--info-color, #2196f3); }
|
||
|
||
/* v1.4.7: 5-column grid so all 5 KPIs (Objects/Tasks/Overdue/Due Soon/
|
||
Triggered) always stay in one row. The previous flex-wrap layout was
|
||
wrapping the 5th item (Triggered, the widest label) onto its own row
|
||
on narrow viewports because the natural width of the items pushed past
|
||
the container width. Grid forces equal 1/5 distribution regardless of
|
||
label length. */
|
||
.stats-bar {
|
||
display: grid;
|
||
grid-template-columns: repeat(5, 1fr);
|
||
gap: 16px;
|
||
padding: 16px;
|
||
}
|
||
|
||
.stat-item {
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
min-width: 0;
|
||
}
|
||
.stat-item .stat-label {
|
||
/* Allow long labels to ellipsis rather than overflow the grid cell. */
|
||
max-width: 100%;
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
white-space: nowrap;
|
||
}
|
||
.stat-item.clickable { cursor: pointer; border-radius: 8px; padding: 4px 8px; transition: background 0.15s, box-shadow 0.15s; }
|
||
.stat-item.clickable:hover { background: var(--secondary-background-color); }
|
||
/* v2.1.0 — KPIs that map to a status filter highlight when active so the
|
||
user can see at a glance which filter is on, even after scrolling away. */
|
||
.stat-item.clickable.active {
|
||
background: var(--secondary-background-color);
|
||
box-shadow: inset 0 -3px 0 var(--primary-color);
|
||
}
|
||
|
||
.objects-grid {
|
||
display: grid;
|
||
grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
|
||
gap: 16px;
|
||
padding: 16px 0;
|
||
}
|
||
.object-card {
|
||
padding: 16px;
|
||
background: var(--card-background-color);
|
||
border-radius: 8px;
|
||
cursor: pointer;
|
||
border: 1px solid var(--divider-color);
|
||
transition: transform 0.15s, box-shadow 0.15s;
|
||
/* Large installs (100+ objects): skip rendering off-screen cards. The
|
||
intrinsic size keeps the scrollbar stable while they're skipped. */
|
||
content-visibility: auto;
|
||
contain-intrinsic-size: auto 120px;
|
||
}
|
||
.object-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
|
||
.object-card-header { display: flex; justify-content: space-between; align-items: center; }
|
||
.object-card-name { font-weight: 500; font-size: 16px; }
|
||
.object-card-count { color: var(--secondary-text-color); font-size: 13px; }
|
||
.object-card-meta { color: var(--secondary-text-color); font-size: 13px; margin-top: 4px; }
|
||
.object-card-empty { color: var(--warning-color); font-size: 13px; margin-top: 8px; font-style: italic; }
|
||
|
||
/* Overdue indicator dot on object cards (#35) */
|
||
.object-card { position: relative; }
|
||
.object-card-overdue { border-left: 3px solid var(--error-color); }
|
||
.overdue-dot {
|
||
position: absolute;
|
||
top: 12px;
|
||
right: 12px;
|
||
width: 10px;
|
||
height: 10px;
|
||
border-radius: 50%;
|
||
background: var(--error-color);
|
||
box-shadow: 0 0 0 2px var(--card-background-color);
|
||
}
|
||
|
||
/* Group-by collapsible sections (#35 + #36) */
|
||
.group-section {
|
||
margin: 12px 0;
|
||
border: 1px solid var(--divider-color);
|
||
border-radius: 8px;
|
||
background: var(--card-background-color);
|
||
}
|
||
.group-section[open] { padding-bottom: 8px; }
|
||
.group-section-header {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 8px;
|
||
padding: 12px 16px;
|
||
cursor: pointer;
|
||
font-weight: 500;
|
||
list-style: none;
|
||
user-select: none;
|
||
}
|
||
.group-section-header::-webkit-details-marker { display: none; }
|
||
.group-section-header::before {
|
||
content: "▶";
|
||
font-size: 10px;
|
||
color: var(--secondary-text-color);
|
||
transition: transform 0.15s;
|
||
}
|
||
.group-section[open] .group-section-header::before { transform: rotate(90deg); }
|
||
.group-section-count {
|
||
color: var(--secondary-text-color);
|
||
font-size: 13px;
|
||
font-weight: 400;
|
||
}
|
||
.group-section .objects-grid,
|
||
.group-section .task-table {
|
||
padding: 0 12px;
|
||
}
|
||
|
||
.empty-state-centered { text-align: center; padding: 32px 16px; }
|
||
.empty-state-centered ha-button { margin-top: 16px; }
|
||
|
||
.stat-value {
|
||
font-size: 24px;
|
||
font-weight: bold;
|
||
color: var(--primary-text-color);
|
||
}
|
||
|
||
.stat-label {
|
||
font-size: 12px;
|
||
color: var(--secondary-text-color);
|
||
}
|
||
|
||
.card-header {
|
||
display: flex;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
padding: 16px;
|
||
}
|
||
|
||
.card-header h1 {
|
||
margin: 0;
|
||
font-size: 20px;
|
||
font-weight: 500;
|
||
}
|
||
|
||
.action-buttons {
|
||
display: flex;
|
||
gap: 8px;
|
||
flex-wrap: wrap;
|
||
}
|
||
|
||
.action-buttons ha-button {
|
||
--ha-button-font-size: 13px;
|
||
}
|
||
|
||
.history-timeline { padding: 0 16px 16px; }
|
||
|
||
.history-entry {
|
||
display: flex;
|
||
gap: 12px;
|
||
padding: 8px 0;
|
||
border-bottom: 1px solid var(--divider-color);
|
||
/* Long histories: skip painting off-screen entries (flex, not subgrid, so
|
||
safe — subgrid task rows can't use this without breaking alignment). */
|
||
content-visibility: auto;
|
||
contain-intrinsic-size: auto 48px;
|
||
}
|
||
.history-entry:last-child { border-bottom: none; }
|
||
|
||
.history-icon {
|
||
flex-shrink: 0;
|
||
width: 32px;
|
||
height: 32px;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
border-radius: 50%;
|
||
color: white;
|
||
}
|
||
|
||
.history-icon.completed { background: var(--maint-ok-color); }
|
||
.history-icon.skipped { background: var(--secondary-text-color); }
|
||
.history-icon.reset { background: var(--info-color, #2196f3); }
|
||
.history-icon.triggered { background: var(--maint-triggered-color); }
|
||
|
||
.history-content { flex: 1; min-width: 0; }
|
||
|
||
/* v2.2.0 — row holds the type label + the small Edit button */
|
||
.history-row {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
gap: 8px;
|
||
}
|
||
.history-edit-btn {
|
||
background: transparent;
|
||
color: var(--secondary-text-color);
|
||
border: none;
|
||
border-radius: 4px;
|
||
padding: 4px;
|
||
cursor: pointer;
|
||
display: inline-flex;
|
||
align-items: center;
|
||
transition: background 0.15s, color 0.15s;
|
||
}
|
||
.history-edit-btn:hover {
|
||
background: var(--secondary-background-color);
|
||
color: var(--primary-color);
|
||
}
|
||
.history-edit-btn ha-icon { --mdc-icon-size: 16px; }
|
||
|
||
.history-date {
|
||
font-size: 12px;
|
||
color: var(--secondary-text-color);
|
||
}
|
||
|
||
.history-details {
|
||
display: flex;
|
||
gap: 12px;
|
||
font-size: 13px;
|
||
color: var(--secondary-text-color);
|
||
margin-top: 4px;
|
||
}
|
||
|
||
/* History filter chips */
|
||
.history-filters {
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
gap: 8px;
|
||
margin-bottom: 12px;
|
||
}
|
||
|
||
.filter-chip {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
padding: 4px 12px;
|
||
border-radius: 16px;
|
||
font-size: 12px;
|
||
cursor: pointer;
|
||
background: var(--secondary-background-color, #f5f5f5);
|
||
color: var(--primary-text-color);
|
||
border: 1px solid var(--divider-color);
|
||
transition: all 0.2s;
|
||
user-select: none;
|
||
}
|
||
|
||
.filter-chip:hover { background: var(--divider-color); }
|
||
|
||
.filter-chip.active {
|
||
background: var(--primary-color);
|
||
color: var(--text-primary-color, #fff);
|
||
border-color: var(--primary-color);
|
||
}
|
||
|
||
.filter-chip.clear {
|
||
font-style: italic;
|
||
opacity: 0.7;
|
||
}
|
||
|
||
/* Cost/Duration history chart */
|
||
.history-chart {
|
||
width: 100%;
|
||
height: 200px;
|
||
display: block;
|
||
}
|
||
|
||
.chart-legend {
|
||
display: flex;
|
||
justify-content: center;
|
||
gap: 16px;
|
||
margin-top: 4px;
|
||
font-size: 11px;
|
||
color: var(--secondary-text-color);
|
||
}
|
||
|
||
.legend-item {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
gap: 4px;
|
||
}
|
||
|
||
.legend-swatch {
|
||
display: inline-block;
|
||
width: 12px;
|
||
height: 12px;
|
||
border-radius: 2px;
|
||
}
|
||
|
||
.empty-state {
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
justify-content: center;
|
||
padding: 48px 16px;
|
||
color: var(--secondary-text-color);
|
||
}
|
||
|
||
.empty-state ha-svg-icon {
|
||
--mdc-icon-size: 48px;
|
||
margin-bottom: 16px;
|
||
}
|
||
|
||
/* Sparkline chart */
|
||
.sparkline-container { position: relative; margin: 8px 0; }
|
||
|
||
.sparkline-svg {
|
||
width: 100%;
|
||
height: 140px;
|
||
display: block;
|
||
}
|
||
|
||
/* Trigger info card */
|
||
.trigger-card {
|
||
background: var(--card-background-color, #fff);
|
||
border-radius: 12px;
|
||
padding: 12px 16px;
|
||
margin: 8px 0;
|
||
border: 1px solid var(--divider-color);
|
||
}
|
||
|
||
.trigger-header {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 8px;
|
||
margin-bottom: 4px;
|
||
}
|
||
|
||
.trigger-entity-name { font-weight: 500; font-size: 14px; }
|
||
.trigger-entity-id { font-size: 11px; color: var(--secondary-text-color); font-family: monospace; }
|
||
|
||
.entity-link {
|
||
cursor: pointer;
|
||
text-decoration: underline dotted;
|
||
text-underline-offset: 2px;
|
||
}
|
||
.entity-link:hover {
|
||
color: var(--primary-color);
|
||
text-decoration: underline solid;
|
||
}
|
||
|
||
.trigger-value-row {
|
||
display: flex;
|
||
align-items: baseline;
|
||
gap: 6px;
|
||
margin: 4px 0;
|
||
}
|
||
|
||
.trigger-current { font-size: 28px; font-weight: 700; color: var(--primary-text-color); }
|
||
.trigger-current.active { color: var(--maint-triggered-color); }
|
||
.trigger-unit { font-size: 14px; color: var(--secondary-text-color); }
|
||
|
||
/* Counter progress ("8,507 / 15,000 km · 57 %" + bar) */
|
||
.counter-progress { margin: 6px 0 4px; }
|
||
.counter-progress-nums {
|
||
display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
|
||
}
|
||
.counter-progress-main { font-size: 26px; font-weight: 700; color: var(--primary-text-color); }
|
||
.counter-progress-target { font-size: 15px; font-weight: 500; color: var(--secondary-text-color); }
|
||
.counter-progress-pct { font-size: 15px; font-weight: 700; }
|
||
.counter-progress-pct.ok { color: var(--success-color, #4caf50); }
|
||
.counter-progress-pct.near { color: var(--warning-color, #ff9800); }
|
||
.counter-progress-pct.over { color: var(--error-color, #f44336); }
|
||
.counter-progress-bar {
|
||
height: 8px; border-radius: 4px; margin: 6px 0 4px; overflow: hidden;
|
||
background: var(--secondary-background-color, rgba(0, 0, 0, 0.08));
|
||
}
|
||
.counter-progress-fill { height: 100%; border-radius: 4px; transition: width 0.3s ease; }
|
||
.counter-progress-fill.ok { background: var(--success-color, #4caf50); }
|
||
.counter-progress-fill.near { background: var(--warning-color, #ff9800); }
|
||
.counter-progress-fill.over { background: var(--error-color, #f44336); }
|
||
.counter-progress-caption { font-size: 12px; color: var(--secondary-text-color); }
|
||
|
||
/* Note under a chart that fell back to sparse maintenance-event values */
|
||
.chart-note {
|
||
display: flex; align-items: center; gap: 6px; margin-top: 2px;
|
||
font-size: 12px; color: var(--secondary-text-color);
|
||
}
|
||
.chart-note ha-icon { --mdc-icon-size: 15px; flex: none; }
|
||
|
||
.trigger-limits {
|
||
display: flex;
|
||
gap: 16px;
|
||
font-size: 13px;
|
||
color: var(--secondary-text-color);
|
||
margin: 6px 0;
|
||
flex-wrap: wrap;
|
||
}
|
||
|
||
.trigger-limit-item {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 4px;
|
||
}
|
||
|
||
.trigger-limit-item .dot {
|
||
width: 8px;
|
||
height: 8px;
|
||
border-radius: 50%;
|
||
flex-shrink: 0;
|
||
}
|
||
.trigger-limit-item .dot.warn { background: var(--error-color, #f44336); }
|
||
.trigger-limit-item .dot.range { background: var(--secondary-text-color); }
|
||
.trigger-limit-item .dot.ok { background: var(--maint-ok-color); }
|
||
|
||
/* Row action buttons */
|
||
.row-actions {
|
||
display: flex;
|
||
gap: 0;
|
||
flex-shrink: 0;
|
||
margin-left: auto;
|
||
}
|
||
|
||
.row-actions mwc-icon-button {
|
||
--mdc-icon-button-size: 32px;
|
||
--mdc-icon-size: 18px;
|
||
}
|
||
|
||
.row-actions .btn-complete { color: var(--maint-ok-color); }
|
||
.row-actions .btn-skip { color: var(--secondary-text-color); }
|
||
|
||
/* Days bar for overview */
|
||
.due-cell {
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: flex-end;
|
||
min-width: 90px;
|
||
gap: 2px;
|
||
}
|
||
|
||
.due-text { font-size: 13px; }
|
||
|
||
.days-bar {
|
||
width: 100%;
|
||
height: 3px;
|
||
background: var(--divider-color);
|
||
border-radius: 2px;
|
||
overflow: hidden;
|
||
}
|
||
|
||
.days-bar-fill {
|
||
height: 100%;
|
||
border-radius: 2px;
|
||
transition: width 0.3s;
|
||
}
|
||
|
||
/* Trigger progress bar (overview rows). width:100% — the due-cell doesn't
|
||
stretch its children (align-items: flex-end), so without it the bar
|
||
shrinks to its label and reads shorter than the days-bar in other rows. */
|
||
.trigger-progress {
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 2px;
|
||
width: 100%;
|
||
min-width: 90px;
|
||
}
|
||
|
||
.trigger-progress-bar {
|
||
width: 100%;
|
||
height: 6px;
|
||
background: var(--divider-color);
|
||
border-radius: 3px;
|
||
overflow: hidden;
|
||
}
|
||
|
||
.trigger-progress-fill {
|
||
height: 100%;
|
||
border-radius: 2px;
|
||
transition: width 0.3s;
|
||
}
|
||
|
||
.trigger-progress-label {
|
||
font-size: 12px;
|
||
color: var(--secondary-text-color);
|
||
text-align: right;
|
||
}
|
||
|
||
/* Days progress bar (detail view) */
|
||
.days-progress {
|
||
margin: 8px 0 16px;
|
||
padding: 12px 16px;
|
||
background: var(--card-background-color, #fff);
|
||
border-radius: 12px;
|
||
border: 1px solid var(--divider-color);
|
||
}
|
||
|
||
.days-progress-labels {
|
||
display: flex;
|
||
justify-content: space-between;
|
||
font-size: 12px;
|
||
color: var(--secondary-text-color);
|
||
margin-bottom: 6px;
|
||
}
|
||
|
||
.days-progress-bar {
|
||
width: 100%;
|
||
height: 6px;
|
||
background: var(--divider-color);
|
||
border-radius: 3px;
|
||
overflow: hidden;
|
||
}
|
||
|
||
.days-progress-fill {
|
||
height: 100%;
|
||
border-radius: 3px;
|
||
transition: width 0.3s;
|
||
}
|
||
|
||
.days-progress-text {
|
||
font-size: 13px;
|
||
font-weight: 500;
|
||
text-align: center;
|
||
margin-top: 6px;
|
||
color: var(--primary-text-color);
|
||
}
|
||
|
||
/* Mini-sparkline in overview rows */
|
||
.mini-sparkline {
|
||
width: 60px;
|
||
height: 20px;
|
||
display: block;
|
||
margin-top: 2px;
|
||
opacity: 0.7;
|
||
}
|
||
|
||
/* Overflow indicator for overdue progress bars */
|
||
.days-bar-fill.overflow,
|
||
.days-progress-fill.overflow,
|
||
.trigger-progress-fill.overflow {
|
||
background-image: repeating-linear-gradient(
|
||
-45deg,
|
||
transparent,
|
||
transparent 3px,
|
||
rgba(255,255,255,0.2) 3px,
|
||
rgba(255,255,255,0.2) 6px
|
||
);
|
||
animation: overflow-pulse 2s ease-in-out infinite;
|
||
}
|
||
|
||
@keyframes overflow-pulse {
|
||
0%, 100% { opacity: 1; }
|
||
50% { opacity: 0.7; }
|
||
}
|
||
|
||
/* Budget bars */
|
||
.budget-bars {
|
||
display: flex;
|
||
gap: 16px;
|
||
padding: 8px 16px;
|
||
flex-wrap: wrap;
|
||
}
|
||
|
||
.budget-item {
|
||
flex: 1;
|
||
min-width: 200px;
|
||
}
|
||
|
||
.budget-label {
|
||
display: flex;
|
||
justify-content: space-between;
|
||
font-size: 12px;
|
||
color: var(--secondary-text-color);
|
||
margin-bottom: 4px;
|
||
}
|
||
|
||
.budget-bar {
|
||
width: 100%;
|
||
height: 6px;
|
||
background: var(--divider-color);
|
||
border-radius: 3px;
|
||
overflow: hidden;
|
||
}
|
||
|
||
.budget-bar-fill {
|
||
height: 100%;
|
||
border-radius: 3px;
|
||
transition: width 0.3s;
|
||
}
|
||
|
||
/* Groups section */
|
||
.groups-section {
|
||
padding: 8px 16px 16px;
|
||
}
|
||
|
||
.groups-section h3 {
|
||
font-size: 14px;
|
||
font-weight: 500;
|
||
color: var(--secondary-text-color);
|
||
margin: 0 0 8px;
|
||
}
|
||
|
||
.groups-grid {
|
||
display: flex;
|
||
gap: 12px;
|
||
flex-wrap: wrap;
|
||
}
|
||
|
||
.group-card {
|
||
background: var(--card-background-color, #fff);
|
||
border: 1px solid var(--divider-color);
|
||
border-radius: 12px;
|
||
padding: 12px 16px;
|
||
min-width: 180px;
|
||
flex: 1;
|
||
max-width: 300px;
|
||
cursor: default;
|
||
}
|
||
|
||
.group-card-head {
|
||
display: flex;
|
||
justify-content: space-between;
|
||
align-items: flex-start;
|
||
gap: 8px;
|
||
}
|
||
|
||
.group-card-name {
|
||
font-weight: 500;
|
||
font-size: 14px;
|
||
margin-bottom: 4px;
|
||
}
|
||
|
||
.group-card-actions {
|
||
display: flex;
|
||
gap: 0;
|
||
}
|
||
.group-card-actions mwc-icon-button {
|
||
--mdc-icon-button-size: 28px;
|
||
--mdc-icon-size: 16px;
|
||
color: var(--secondary-text-color);
|
||
}
|
||
|
||
.groups-header {
|
||
display: flex;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
gap: 8px;
|
||
margin-bottom: 8px;
|
||
}
|
||
.groups-header h3 { margin: 0; }
|
||
|
||
.seasonal-actions {
|
||
display: flex;
|
||
justify-content: flex-end;
|
||
padding: 4px 0;
|
||
}
|
||
|
||
.group-card-desc {
|
||
font-size: 12px;
|
||
color: var(--secondary-text-color);
|
||
margin-bottom: 8px;
|
||
}
|
||
|
||
.group-card-tasks {
|
||
display: flex;
|
||
gap: 6px;
|
||
flex-wrap: wrap;
|
||
}
|
||
|
||
.group-task-chip {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
gap: 4px;
|
||
font-size: 11px;
|
||
padding: 2px 8px;
|
||
border-radius: 10px;
|
||
background: var(--secondary-background-color, #f5f5f5);
|
||
color: var(--primary-text-color);
|
||
}
|
||
|
||
/* Adaptive scheduling suggestion badge */
|
||
.suggestion-badge {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
gap: 6px;
|
||
padding: 4px 10px;
|
||
border-radius: 16px;
|
||
font-size: 12px;
|
||
font-weight: 500;
|
||
background: var(--info-color, #2196f3);
|
||
color: white;
|
||
margin-left: 8px;
|
||
}
|
||
|
||
.suggestion-actions {
|
||
display: flex;
|
||
gap: 8px;
|
||
margin-top: 8px;
|
||
}
|
||
|
||
.suggestion-actions ha-button {
|
||
--ha-button-font-size: 12px;
|
||
}
|
||
|
||
.confidence-dot {
|
||
display: inline-block;
|
||
width: 8px;
|
||
height: 8px;
|
||
border-radius: 50%;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.confidence-dot.low { background: var(--secondary-text-color); }
|
||
.confidence-dot.medium { background: var(--warning-color, #ff9800); }
|
||
.confidence-dot.high { background: var(--success-color, #4caf50); }
|
||
|
||
/* Feedback toggle buttons in complete dialog */
|
||
.feedback-section {
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 8px;
|
||
padding: 8px 0;
|
||
border-top: 1px solid var(--divider-color);
|
||
}
|
||
|
||
.feedback-label {
|
||
font-weight: 500;
|
||
font-size: 13px;
|
||
color: var(--secondary-text-color);
|
||
}
|
||
|
||
.feedback-buttons {
|
||
display: flex;
|
||
gap: 8px;
|
||
}
|
||
|
||
.feedback-btn {
|
||
flex: 1;
|
||
padding: 8px 12px;
|
||
border: 1px solid var(--divider-color);
|
||
border-radius: 8px;
|
||
background: var(--card-background-color, #fff);
|
||
color: var(--primary-text-color);
|
||
font-size: 13px;
|
||
cursor: pointer;
|
||
text-align: center;
|
||
transition: all 0.2s;
|
||
}
|
||
|
||
.feedback-btn:hover {
|
||
background: var(--secondary-background-color, #f5f5f5);
|
||
}
|
||
|
||
.feedback-btn.selected {
|
||
background: var(--primary-color);
|
||
color: var(--text-primary-color, #fff);
|
||
border-color: var(--primary-color);
|
||
}
|
||
|
||
/* Seasonal chart */
|
||
.seasonal-chart {
|
||
padding: 12px 16px;
|
||
margin: 8px 0;
|
||
background: var(--card-background-color, #fff);
|
||
border-radius: 12px;
|
||
border: 1px solid var(--divider-color);
|
||
}
|
||
|
||
.seasonal-chart-title {
|
||
font-size: 13px;
|
||
font-weight: 500;
|
||
color: var(--secondary-text-color);
|
||
margin-bottom: 8px;
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 6px;
|
||
}
|
||
|
||
.seasonal-chart-title .source-tag {
|
||
font-size: 10px;
|
||
padding: 1px 6px;
|
||
border-radius: 8px;
|
||
background: var(--secondary-background-color, #f5f5f5);
|
||
color: var(--secondary-text-color);
|
||
font-weight: 400;
|
||
}
|
||
|
||
.seasonal-chart svg {
|
||
width: 100%;
|
||
height: 100px;
|
||
display: block;
|
||
}
|
||
|
||
.seasonal-labels {
|
||
display: flex;
|
||
justify-content: space-between;
|
||
padding: 0 2px;
|
||
margin-top: 4px;
|
||
}
|
||
|
||
.seasonal-label {
|
||
font-size: 10px;
|
||
color: var(--secondary-text-color);
|
||
text-align: center;
|
||
flex: 1;
|
||
}
|
||
|
||
.seasonal-label.active-month {
|
||
font-weight: 700;
|
||
color: var(--primary-color);
|
||
}
|
||
|
||
.seasonal-factor-tag {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
gap: 4px;
|
||
padding: 2px 8px;
|
||
border-radius: 10px;
|
||
font-size: 11px;
|
||
font-weight: 500;
|
||
background: var(--secondary-background-color, #f5f5f5);
|
||
color: var(--secondary-text-color);
|
||
margin-left: 6px;
|
||
}
|
||
|
||
.seasonal-factor-tag.short {
|
||
background: rgba(76, 175, 80, 0.15);
|
||
color: var(--success-color, #4caf50);
|
||
}
|
||
|
||
.seasonal-factor-tag.long {
|
||
background: rgba(255, 152, 0, 0.15);
|
||
color: var(--warning-color, #ff9800);
|
||
}
|
||
|
||
/* --- Sensor Prediction Section (Phase 3) --- */
|
||
|
||
.prediction-section {
|
||
margin: 16px 0;
|
||
padding: 12px 16px;
|
||
background: var(--card-background-color, #fff);
|
||
border-radius: 12px;
|
||
border: 1px solid var(--divider-color, #e0e0e0);
|
||
}
|
||
|
||
.prediction-urgency-banner {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 8px;
|
||
padding: 8px 12px;
|
||
margin-bottom: 12px;
|
||
border-radius: 8px;
|
||
background: rgba(255, 152, 0, 0.15);
|
||
color: var(--warning-color, #ff9800);
|
||
font-size: 13px;
|
||
font-weight: 500;
|
||
}
|
||
.prediction-urgency-banner ha-svg-icon {
|
||
--mdc-icon-size: 18px;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.prediction-title {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 6px;
|
||
font-size: 13px;
|
||
font-weight: 600;
|
||
color: var(--primary-text-color);
|
||
margin-bottom: 10px;
|
||
}
|
||
.prediction-title ha-svg-icon {
|
||
--mdc-icon-size: 16px;
|
||
color: var(--primary-color);
|
||
}
|
||
|
||
.prediction-grid {
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
gap: 12px;
|
||
}
|
||
|
||
.prediction-item {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 6px;
|
||
font-size: 12px;
|
||
color: var(--secondary-text-color);
|
||
}
|
||
.prediction-item ha-svg-icon {
|
||
--mdc-icon-size: 14px;
|
||
color: var(--secondary-text-color);
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.prediction-label {
|
||
font-weight: 500;
|
||
}
|
||
|
||
.prediction-value {
|
||
font-weight: 600;
|
||
color: var(--primary-text-color);
|
||
}
|
||
.prediction-value.rising { color: var(--error-color, #f44336); }
|
||
.prediction-value.falling { color: var(--info-color, #2196f3); }
|
||
.prediction-value.stable { color: var(--success-color, #4caf50); }
|
||
.prediction-value.exceeded { color: var(--error-color, #f44336); font-weight: 700; }
|
||
.prediction-value.urgent { color: var(--warning-color, #ff9800); font-weight: 700; }
|
||
|
||
.prediction-rate {
|
||
font-size: 11px;
|
||
opacity: 0.7;
|
||
font-family: monospace;
|
||
}
|
||
|
||
.prediction-date {
|
||
font-size: 11px;
|
||
opacity: 0.7;
|
||
}
|
||
|
||
.prediction-entity {
|
||
font-size: 10px;
|
||
opacity: 0.6;
|
||
font-family: monospace;
|
||
}
|
||
|
||
/* --- Weibull Reliability Section (Phase 4) --- */
|
||
|
||
.weibull-section {
|
||
margin: 16px 0;
|
||
padding: 12px 16px;
|
||
background: var(--card-background-color, #fff);
|
||
border-radius: 12px;
|
||
border: 1px solid var(--divider-color, #e0e0e0);
|
||
}
|
||
|
||
.weibull-title {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 6px;
|
||
font-size: 13px;
|
||
font-weight: 600;
|
||
color: var(--primary-text-color);
|
||
margin-bottom: 10px;
|
||
}
|
||
.weibull-title ha-svg-icon {
|
||
--mdc-icon-size: 16px;
|
||
color: var(--primary-color);
|
||
}
|
||
|
||
.weibull-chart svg {
|
||
width: 100%;
|
||
height: 160px;
|
||
display: block;
|
||
}
|
||
|
||
.weibull-info-row {
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
gap: 16px;
|
||
margin-top: 10px;
|
||
}
|
||
|
||
.weibull-info-item {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 6px;
|
||
font-size: 12px;
|
||
color: var(--secondary-text-color);
|
||
}
|
||
|
||
.weibull-info-value {
|
||
font-weight: 600;
|
||
color: var(--primary-text-color);
|
||
}
|
||
|
||
/* Beta interpretation badge */
|
||
.beta-badge {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
gap: 4px;
|
||
padding: 2px 10px;
|
||
border-radius: 12px;
|
||
font-size: 11px;
|
||
font-weight: 600;
|
||
white-space: nowrap;
|
||
}
|
||
.beta-badge ha-svg-icon {
|
||
--mdc-icon-size: 14px;
|
||
}
|
||
|
||
.beta-badge.early_failures {
|
||
background: rgba(244, 67, 54, 0.15);
|
||
color: var(--error-color, #f44336);
|
||
}
|
||
.beta-badge.random_failures {
|
||
background: var(--secondary-background-color, #f5f5f5);
|
||
color: var(--secondary-text-color);
|
||
}
|
||
.beta-badge.wear_out {
|
||
background: rgba(255, 152, 0, 0.15);
|
||
color: var(--warning-color, #ff9800);
|
||
}
|
||
.beta-badge.highly_predictable {
|
||
background: rgba(76, 175, 80, 0.15);
|
||
color: var(--success-color, #4caf50);
|
||
}
|
||
|
||
/* Confidence interval range bar */
|
||
.confidence-range {
|
||
margin-top: 12px;
|
||
}
|
||
|
||
.confidence-range-title {
|
||
font-size: 12px;
|
||
font-weight: 500;
|
||
color: var(--secondary-text-color);
|
||
margin-bottom: 6px;
|
||
}
|
||
|
||
.confidence-bar {
|
||
position: relative;
|
||
width: 100%;
|
||
height: 8px;
|
||
background: var(--divider-color, #e0e0e0);
|
||
border-radius: 4px;
|
||
overflow: visible;
|
||
}
|
||
|
||
.confidence-fill {
|
||
position: absolute;
|
||
height: 100%;
|
||
border-radius: 4px;
|
||
background: var(--primary-color, #03a9f4);
|
||
opacity: 0.25;
|
||
}
|
||
|
||
.confidence-marker {
|
||
position: absolute;
|
||
top: -4px;
|
||
width: 3px;
|
||
height: 16px;
|
||
border-radius: 1px;
|
||
transform: translateX(-50%);
|
||
}
|
||
.confidence-marker.recommended {
|
||
background: var(--success-color, #4caf50);
|
||
}
|
||
.confidence-marker.current {
|
||
background: var(--primary-color, #03a9f4);
|
||
}
|
||
|
||
.confidence-labels {
|
||
display: flex;
|
||
justify-content: space-between;
|
||
margin-top: 4px;
|
||
}
|
||
|
||
.confidence-text {
|
||
font-size: 10px;
|
||
color: var(--secondary-text-color);
|
||
}
|
||
.confidence-text.low {
|
||
text-align: left;
|
||
}
|
||
.confidence-text.high {
|
||
text-align: right;
|
||
}
|
||
|
||
.task-disabled { opacity: 0.5; }
|
||
.badge-disabled {
|
||
font-size: 10px;
|
||
padding: 1px 6px;
|
||
border-radius: 8px;
|
||
background: var(--disabled-color, #9e9e9e);
|
||
color: white;
|
||
}
|
||
|
||
/* ── Shared responsive styles (panel + card) ── */
|
||
@media (max-width: 600px) {
|
||
.row-actions mwc-icon-button {
|
||
--mdc-icon-button-size: 44px;
|
||
--mdc-icon-size: 22px;
|
||
}
|
||
|
||
.due-cell { min-width: 70px; }
|
||
|
||
.trigger-card { padding: 10px 12px; }
|
||
.trigger-current { font-size: 22px; }
|
||
|
||
.prediction-grid { flex-direction: column; gap: 8px; }
|
||
|
||
.weibull-info-row { flex-direction: column; gap: 8px; }
|
||
|
||
.budget-bars { flex-direction: column; }
|
||
.budget-item { min-width: 0; }
|
||
|
||
.group-card { min-width: 0; max-width: 100%; }
|
||
|
||
.filter-chip { padding: 6px 12px; font-size: 13px; }
|
||
|
||
.history-details { flex-wrap: wrap; gap: 6px; }
|
||
|
||
.sparkline-container { max-width: 100%; overflow: hidden; }
|
||
.sparkline-svg { height: 100px; }
|
||
|
||
.stats-bar { gap: 8px; padding: 12px; }
|
||
.stat-item { min-width: 60px; }
|
||
.stat-value { font-size: 20px; }
|
||
}
|
||
`;var b=class extends w{constructor(){super(...arguments);this._config={type:"custom:maintenance-supporter-calendar-card"};this._objects=[];this._stats=null;this._windowDays=30;this._pastDays=0;this._userFilter="";this._unsub=null;this._dataLoaded=!1;this._lastConnection=null}static getConfigElement(){return document.createElement("maintenance-supporter-calendar-card-editor")}static getStubConfig(){return{type:"custom:maintenance-supporter-calendar-card",window_days:30,show_window_chips:!0,show_user_filter:!0}}setConfig(t){this._config={...t},t.past_days&&[30,90].includes(t.past_days)?this._pastDays=t.past_days:t.window_days&&[7,14,30,365].includes(t.window_days)&&(this._windowDays=t.window_days,this._pastDays=0),typeof t.user_filter=="string"&&(this._userFilter=t.user_filter)}getCardSize(){return 6}get _lang(){return this.hass?.language||"en"}disconnectedCallback(){if(super.disconnectedCallback(),this._unsub){try{this._unsub()}catch{}this._unsub=null}this._dataLoaded=!1,this._lastConnection=null}updated(t){super.updated(t);let o=this.hass?.language;if(o&&!Ge(o)&&Ve(o).then(()=>this.requestUpdate()),t.has("hass")&&this.hass){if(!this._dataLoaded)this._dataLoaded=!0,this._lastConnection=this.hass.connection,this._loadData(),this._subscribe();else if(this.hass.connection!==this._lastConnection){if(this._lastConnection=this.hass.connection,this._unsub){try{this._unsub()}catch{}this._unsub=null}this._subscribe(),this._loadData()}}}async _loadData(){try{let[t,o]=await Promise.all([this.hass.connection.sendMessagePromise({type:"maintenance_supporter/objects"}),this.hass.connection.sendMessagePromise({type:"maintenance_supporter/statistics"})]);this._objects=t.objects,this._stats=o}catch{}}async _subscribe(){try{let t=await this.hass.connection.subscribeMessage(o=>{let r=o;this._objects=r.objects},{type:"maintenance_supporter/subscribe"});if(!this.isConnected){t();return}this._unsub=t}catch{}}_onEventClick(t){if(t.history_timestamp){this.dispatchEvent(new CustomEvent("ll-custom",{detail:{type:"maintenance-supporter:edit-history",entry_id:t.entry_id,task_id:t.task_id,original_timestamp:t.history_timestamp},bubbles:!0,composed:!0}));return}this.dispatchEvent(new CustomEvent("ll-custom",{detail:{type:"maintenance-supporter:open-task",entry_id:t.entry_id,task_id:t.task_id},bubbles:!0,composed:!0}))}render(){if(!this.hass)return g;let t=this._lang,o=this._config.show_window_chips!==!1,r=this._config.show_user_filter!==!1,a=this._config.title,i=null;this._userFilter&&(i=this._userFilter==="current_user"?this.hass?.user?.id??null:this._userFilter);let s=new Date;s.setHours(0,0,0,0);let c=this._pastDays>0,p=c?qe(this._objects,s,this._pastDays,i):He(this._objects,s,this._windowDays,i),u=Y(s),d=this._windowDays===365||c,_=d?p.filter(l=>l.events.length>0):p,h=l=>{let $=`cal-status-${l.status}`,N=l.projected?"cal-event-projected":"",R=l.status==="overdue"&&l.days_until_due!=null?` (${Math.abs(l.days_until_due)}d ${f("overdue",t).toLowerCase()})`:"",L=l.projected&&l.interval_days?m`<span class="cal-event-recur">${l.interval_unit&&l.interval_unit!=="days"?`${l.interval_days} ${f("unit_"+l.interval_unit,t)}`:f("cal_every_n_days",t).replace("{n}",String(l.interval_days))}</span>`:g,M=l.schedule_type==="sensor_based",ne=M?m`<ha-icon class="cal-event-icon cal-source-sensor"
|
||
title="${f("cal_source_sensor",t)}" icon="mdi:trending-up"></ha-icon>`:m`<ha-icon class="cal-event-icon cal-source-time"
|
||
title="${l.adaptive_enabled?f("cal_source_time_adaptive",t):f("cal_source_time",t)}"
|
||
icon="${l.adaptive_enabled?"mdi:clock-time-four-outline":"mdi:clock-outline"}"></ha-icon>`,ae=M&&l.prediction_confidence&&l.status!=="triggered"&&!l.projected?m`<span class="cal-event-prediction cal-conf-${l.prediction_confidence}">
|
||
${f("cal_predicted",t)} · ${f(`cal_confidence_${l.prediction_confidence}`,t)}
|
||
</span>`:g,Ke=this._stats?.budget?.currency_symbol||Be,Je=l.history_type?f(l.history_type,t):f(l.status,t);return m`
|
||
<div class="cal-event ${N}"
|
||
@click=${()=>this._onEventClick(l)}>
|
||
${ne}
|
||
<span class="cal-status-pill ${$}">${Je}</span>
|
||
<div class="cal-event-body">
|
||
<div class="cal-event-title">${l.object_name} · ${l.task_name}${R}</div>
|
||
${ae}
|
||
${L}
|
||
</div>
|
||
${l.avg_cost!=null&&l.avg_cost>0?m`<span class="cal-event-cost">${l.avg_cost.toFixed(0)} ${Ke}</span>`:g}
|
||
</div>
|
||
`},y=l=>{let[$,N,R]=l.date.split("-").map(Number),L=new Date($,N-1,R),M=l.date===u,ne=L.toLocaleDateString(t,{weekday:"short"}),ae=L.toLocaleDateString(t,{month:"long"});return m`
|
||
<div class="cal-day-row">
|
||
<div class="cal-day-pill ${M?"cal-today":""}">
|
||
<span class="cal-pill-weekday">${ne}</span>
|
||
<span class="cal-pill-day">${L.getDate()}</span>
|
||
</div>
|
||
<div class="cal-day-content">
|
||
<div class="cal-day-header">
|
||
<span class="cal-day-month">${ae}</span>
|
||
${M?m`<span class="cal-day-today-badge">${f("today",t)}</span>`:g}
|
||
</div>
|
||
${l.events.length===0?m`<div class="cal-empty">${f("cal_no_events",t)}</div>`:l.events.map(h)}
|
||
</div>
|
||
</div>
|
||
`};return m`
|
||
<ha-card .header=${a}>
|
||
${o||r?m`
|
||
<div class="cal-controls">
|
||
${o?m`
|
||
<div class="cal-window-chips cal-past-chips" title="${f("cal_past_windows",t)||"Past windows"}">
|
||
${[30,90].map(l=>m`
|
||
<button class="cal-window-chip cal-past-chip ${this._pastDays===l?"active":""}"
|
||
@click=${()=>{this._pastDays=l}}>
|
||
−${l}d
|
||
</button>
|
||
`)}
|
||
</div>
|
||
<span class="cal-chip-separator" aria-hidden="true">●</span>
|
||
<div class="cal-window-chips" title="${f("cal_forward_windows",t)||"Forward windows"}">
|
||
${[7,14,30,365].map(l=>m`
|
||
<button class="cal-window-chip ${this._pastDays===0&&this._windowDays===l?"active":""}"
|
||
@click=${()=>{this._windowDays=l,this._pastDays=0}}>
|
||
${l===365?"+1y":`+${l}d`}
|
||
</button>
|
||
`)}
|
||
</div>
|
||
`:g}
|
||
${r?m`
|
||
<select class="cal-user-filter"
|
||
.value=${this._userFilter}
|
||
@change=${l=>{this._userFilter=l.target.value}}>
|
||
<option value="">${f("all_users",t)}</option>
|
||
<option value="current_user">${f("my_tasks",t)}</option>
|
||
</select>
|
||
`:g}
|
||
</div>
|
||
`:g}
|
||
<div class="cal-rolling">
|
||
${_.length===0&&d?m`<div class="cal-empty">${f("cal_no_events",t)}</div>`:_.map(y)}
|
||
</div>
|
||
</ha-card>
|
||
`}};b.styles=[Ye,Ie,S`
|
||
:host { display: block; }
|
||
ha-card { padding: 0; overflow: hidden; }
|
||
`],v([V({attribute:!1})],b.prototype,"hass",2),v([k()],b.prototype,"_config",2),v([k()],b.prototype,"_objects",2),v([k()],b.prototype,"_stats",2),v([k()],b.prototype,"_windowDays",2),v([k()],b.prototype,"_pastDays",2),v([k()],b.prototype,"_userFilter",2),v([k()],b.prototype,"_unsub",2);var $t=[{value:7,label:"Week (7 days)"},{value:14,label:"Fortnight (14 days)"},{value:30,label:"Month (30 days, default)"},{value:365,label:"Year (365 days, empty days collapsed)"}],O=class extends w{constructor(){super(...arguments);this._config={type:"custom:maintenance-supporter-calendar-card"}}setConfig(t){this._config={...t}}_valueChanged(t,o){let r={...this._config,[t]:o};t==="show_window_chips"&&o===!0&&delete r.show_window_chips,t==="show_user_filter"&&o===!0&&delete r.show_user_filter,t==="title"&&(!o||typeof o=="string"&&o.trim()==="")&&delete r.title,t==="user_filter"&&o===""&&delete r.user_filter,this._config=r,this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:r},bubbles:!0,composed:!0}))}render(){let t=this._config.window_days??30,o=this._config.show_window_chips!==!1,r=this._config.show_user_filter!==!1,a=this._config.user_filter??"",i=this._config.title??"";return m`
|
||
<div class="editor">
|
||
<div class="row">
|
||
<label for="title">Title (optional)</label>
|
||
<input
|
||
id="title"
|
||
type="text"
|
||
.value=${i}
|
||
@input=${s=>this._valueChanged("title",s.target.value)}
|
||
/>
|
||
</div>
|
||
<div class="row">
|
||
<label for="window">Default window</label>
|
||
<select
|
||
id="window"
|
||
@change=${s=>this._valueChanged("window_days",Number(s.target.value))}
|
||
>
|
||
${$t.map(s=>m`<option value="${s.value}" ?selected=${s.value===t}>${s.label}</option>`)}
|
||
</select>
|
||
</div>
|
||
<div class="row toggle">
|
||
<label for="chips">Show window chips inside the card</label>
|
||
<input
|
||
id="chips"
|
||
type="checkbox"
|
||
.checked=${o}
|
||
@change=${s=>this._valueChanged("show_window_chips",s.target.checked)}
|
||
/>
|
||
</div>
|
||
<div class="hint">
|
||
Hide the chips when the card is embedded in a strategy view that
|
||
already serves as the window selector.
|
||
</div>
|
||
<div class="row toggle">
|
||
<label for="userf">Show user filter dropdown</label>
|
||
<input
|
||
id="userf"
|
||
type="checkbox"
|
||
.checked=${r}
|
||
@change=${s=>this._valueChanged("show_user_filter",s.target.checked)}
|
||
/>
|
||
</div>
|
||
<div class="row">
|
||
<label for="userv">Default user filter</label>
|
||
<select
|
||
id="userv"
|
||
@change=${s=>this._valueChanged("user_filter",s.target.value)}
|
||
>
|
||
<option value="" ?selected=${a===""}>All users</option>
|
||
<option value="current_user" ?selected=${a==="current_user"}>
|
||
My tasks (current user)
|
||
</option>
|
||
</select>
|
||
</div>
|
||
</div>
|
||
`}};O.styles=S`
|
||
:host { display: block; padding: 8px 0; }
|
||
.editor { display: flex; flex-direction: column; gap: 12px; }
|
||
.row { display: flex; flex-direction: column; gap: 4px; }
|
||
.row.toggle {
|
||
flex-direction: row;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
gap: 12px;
|
||
}
|
||
label { font-weight: 500; color: var(--primary-text-color); font-size: 14px; }
|
||
input[type="text"], select {
|
||
padding: 8px;
|
||
font-size: 14px;
|
||
background: var(--card-background-color, white);
|
||
color: var(--primary-text-color, black);
|
||
border: 1px solid var(--divider-color, #e0e0e0);
|
||
border-radius: 4px;
|
||
}
|
||
.hint {
|
||
margin-top: -4px;
|
||
font-size: 12px;
|
||
color: var(--secondary-text-color, #666);
|
||
}
|
||
`,v([V({attribute:!1})],O.prototype,"hass",2),v([k()],O.prototype,"_config",2);customElements.get("maintenance-supporter-calendar-card")||customElements.define("maintenance-supporter-calendar-card",b);customElements.get("maintenance-supporter-calendar-card-editor")||customElements.define("maintenance-supporter-calendar-card-editor",O);var re=window;re.customCards=re.customCards||[];var Qe="maintenance-supporter-calendar-card",St=re.customCards.some(n=>n.type===Qe);St||re.customCards.push({type:Qe,name:"Maintenance Supporter \u2014 Calendar",description:"Rolling calendar of maintenance tasks with 7/14/30/365 day windows, source icons, and prediction-confidence pills.",preview:!0});export{b as MaintenanceCalendarCard};
|
||
/*! Bundled license information:
|
||
|
||
@lit/reactive-element/css-tag.js:
|
||
(**
|
||
* @license
|
||
* Copyright 2019 Google LLC
|
||
* SPDX-License-Identifier: BSD-3-Clause
|
||
*)
|
||
|
||
@lit/reactive-element/reactive-element.js:
|
||
lit-html/lit-html.js:
|
||
lit-element/lit-element.js:
|
||
@lit/reactive-element/decorators/custom-element.js:
|
||
@lit/reactive-element/decorators/property.js:
|
||
@lit/reactive-element/decorators/state.js:
|
||
@lit/reactive-element/decorators/event-options.js:
|
||
@lit/reactive-element/decorators/base.js:
|
||
@lit/reactive-element/decorators/query.js:
|
||
@lit/reactive-element/decorators/query-all.js:
|
||
@lit/reactive-element/decorators/query-async.js:
|
||
@lit/reactive-element/decorators/query-assigned-nodes.js:
|
||
(**
|
||
* @license
|
||
* Copyright 2017 Google LLC
|
||
* SPDX-License-Identifier: BSD-3-Clause
|
||
*)
|
||
|
||
lit-html/is-server.js:
|
||
(**
|
||
* @license
|
||
* Copyright 2022 Google LLC
|
||
* SPDX-License-Identifier: BSD-3-Clause
|
||
*)
|
||
|
||
@lit/reactive-element/decorators/query-assigned-elements.js:
|
||
(**
|
||
* @license
|
||
* Copyright 2021 Google LLC
|
||
* SPDX-License-Identifier: BSD-3-Clause
|
||
*)
|
||
*/
|