186 files
This commit is contained in:
1 parent
6be1e92941
commit
bd8280defe
186 files changed
+14904
-1087
No files matched your search
@@ -1,9 +1,9 @@
|
||||
/*! maintenance_supporter frontend 2.86.0 */
|
||||
/*! maintenance_supporter frontend 2.87.0 */
|
||||
var Ai=Object.defineProperty;var Rs=Object.getOwnPropertyDescriptor;var w=(s,r,e)=>()=>{if(e)throw e[0];try{return s&&(r=s(s=0)),r}catch(t){throw e=[t],t}};var Ps=(s,r)=>{for(var e in r)Ai(s,e,{get:r[e],enumerable:!0})};var d=(s,r,e,t)=>{for(var i=t>1?void 0:t?Rs(r,e):r,a=s.length-1,l;a>=0;a--)(l=s[a])&&(i=(t?l(r,e,i):l(i))||i);return t&&i&&Ai(r,e,i),i};var st,nt,At,Ci,Oe,Ii,k,Ri,Ct,It=w(()=>{st=globalThis,nt=st.ShadowRoot&&(st.ShadyCSS===void 0||st.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,At=Symbol(),Ci=new WeakMap,Oe=class{constructor(r,e,t){if(this._$cssResult$=!0,t!==At)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=r,this.t=e}get styleSheet(){let r=this.o,e=this.t;if(nt&&r===void 0){let t=e!==void 0&&e.length===1;t&&(r=Ci.get(e)),r===void 0&&((this.o=r=new CSSStyleSheet).replaceSync(this.cssText),t&&Ci.set(e,r))}return r}toString(){return this.cssText}},Ii=s=>new Oe(typeof s=="string"?s:s+"",void 0,At),k=(s,...r)=>{let e=s.length===1?s[0]:r.reduce((t,i,a)=>t+(l=>{if(l._$cssResult$===!0)return l.cssText;if(typeof l=="number")return l;throw Error("Value passed to 'css' function must be a 'css' function result: "+l+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+s[a+1],s[0]);return new Oe(e,s,At)},Ri=(s,r)=>{if(nt)s.adoptedStyleSheets=r.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of r){let t=document.createElement("style"),i=st.litNonce;i!==void 0&&t.setAttribute("nonce",i),t.textContent=e.cssText,s.appendChild(t)}},Ct=nt?s=>s:s=>s instanceof CSSStyleSheet?(r=>{let e="";for(let t of r.cssRules)e+=t.cssText;return Ii(e)})(s):s});var Ls,Ns,js,Hs,Os,qs,at,Pi,Ds,Ms,qe,De,ot,Li,ee,Me=w(()=>{It();It();({is:Ls,defineProperty:Ns,getOwnPropertyDescriptor:js,getOwnPropertyNames:Hs,getOwnPropertySymbols:Os,getPrototypeOf:qs}=Object),at=globalThis,Pi=at.trustedTypes,Ds=Pi?Pi.emptyScript:"",Ms=at.reactiveElementPolyfillSupport,qe=(s,r)=>s,De={toAttribute(s,r){switch(r){case Boolean:s=s?Ds:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,r){let e=s;switch(r){case Boolean:e=s!==null;break;case Number:e=s===null?null:Number(s);break;case Object:case Array:try{e=JSON.parse(s)}catch{e=null}}return e}},ot=(s,r)=>!Ls(s,r),Li={attribute:!0,type:String,converter:De,reflect:!1,useDefault:!1,hasChanged:ot};Symbol.metadata??=Symbol("metadata"),at.litPropertyMetadata??=new WeakMap;ee=class extends HTMLElement{static addInitializer(r){this._$Ei(),(this.l??=[]).push(r)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(r,e=Li){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(r)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(r,e),!e.noAccessor){let t=Symbol(),i=this.getPropertyDescriptor(r,t,e);i!==void 0&&Ns(this.prototype,r,i)}}static getPropertyDescriptor(r,e,t){let{get:i,set:a}=js(this.prototype,r)??{get(){return this[e]},set(l){this[e]=l}};return{get:i,set(l){let u=i?.call(this);a?.call(this,l),this.requestUpdate(r,u,t)},configurable:!0,enumerable:!0}}static getPropertyOptions(r){return this.elementProperties.get(r)??Li}static _$Ei(){if(this.hasOwnProperty(qe("elementProperties")))return;let r=qs(this);r.finalize(),r.l!==void 0&&(this.l=[...r.l]),this.elementProperties=new Map(r.elementProperties)}static finalize(){if(this.hasOwnProperty(qe("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(qe("properties"))){let e=this.properties,t=[...Hs(e),...Os(e)];for(let i of t)this.createProperty(i,e[i])}let r=this[Symbol.metadata];if(r!==null){let e=litPropertyMetadata.get(r);if(e!==void 0)for(let[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let i=this._$Eu(e,t);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(r){let e=[];if(Array.isArray(r)){let t=new Set(r.flat(1/0).reverse());for(let i of t)e.unshift(Ct(i))}else r!==void 0&&e.push(Ct(r));return e}static _$Eu(r,e){let t=e.attribute;return t===!1?void 0:typeof t=="string"?t:typeof r=="string"?r.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(r=>this.enableUpdating=r),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(r=>r(this))}addController(r){(this._$EO??=new Set).add(r),this.renderRoot!==void 0&&this.isConnected&&r.hostConnected?.()}removeController(r){this._$EO?.delete(r)}_$E_(){let r=new Map,e=this.constructor.elementProperties;for(let t of e.keys())this.hasOwnProperty(t)&&(r.set(t,this[t]),delete this[t]);r.size>0&&(this._$Ep=r)}createRenderRoot(){let r=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Ri(r,this.constructor.elementStyles),r}connectedCallback(){this.renderRoot??=tLine truncated
|
||||
\f\r]`,ze=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Hi=/-->/g,Oi=/>/g,_e=RegExp(`>|${Rt}(?:([^\\s"'>=/]+)(${Rt}*=${Rt}*(?:[^
|
||||
\f\r"'\`<>=]|("|')|))|$)`,"g"),qi=/'/g,Di=/"/g,Ui=/^(?:script|style|textarea|title)$/i,Dt=s=>(r,...e)=>({_$litType$:s,strings:r,values:e}),o=Dt(1),Ee=Dt(2),ba=Dt(3),fe=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),Mi=new WeakMap,me=ge.createTreeWalker(ge,129);Us=(s,r)=>{let e=s.length-1,t=[],i,a=r===2?"<svg>":r===3?"<math>":"",l=ze;for(let u=0;u<e;u++){let h=s[u],_,m,b=-1,y=0;for(;y<h.length&&(l.lastIndex=y,m=l.exec(h),m!==null);)y=l.lastIndex,l===ze?m[1]==="!--"?l=Hi:m[1]!==void 0?l=Oi:m[2]!==void 0?(Ui.test(m[2])&&(i=RegExp("</"+m[2],"g")),l=_e):m[3]!==void 0&&(l=_e):l===_e?m[0]===">"?(l=i??ze,b=-1):m[1]===void 0?b=-2:(b=l.lastIndex-m[2].length,_=m[1],l=m[3]===void 0?_e:m[3]==='"'?Di:qi):l===Di||l===qi?l=_e:l===Hi||l===Oi?l=ze:(l=_e,i=void 0);let x=l===_e&&s[u+1].startsWith("/>")?" ":"";a+=l===ze?h+zs:b>=0?(t.push(_),h.slice(0,b)+zi+h.slice(b)+oe+x):h+oe+(b===-2?u:x)}return[Bi(s,a+(s[e]||"<?>")+(r===2?"</svg>":r===3?"</math>":"")),t]},Be=class s{constructor({strings:r,_$litType$:e},t){let i;this.parts=[];let a=0,l=0,u=r.length-1,h=this.parts,[_,m]=Us(r,e);if(this.el=s.createElement(_,t),me.currentNode=this.el.content,e===2||e===3){let b=this.el.content.firstChild;b.replaceWith(...b.childNodes)}for(;(i=me.nextNode())!==null&&h.length<u;){if(i.nodeType===1){if(i.hasAttributes())for(let b of i.getAttributeNames())if(b.endsWith(zi)){let y=m[l++],x=i.getAttribute(b).split(oe),g=/([.?@])?(.*)/.exec(y);h.push({type:1,index:a,name:g[2],strings:x,ctor:g[1]==="."?Lt:g[1]==="?"?Nt:g[1]==="@"?jt:ke}),i.removeAttribute(b)}else b.startsWith(oe)&&(h.push({type:6,index:a}),i.removeAttribute(b));if(Ui.test(i.tagName)){let b=i.textContent.split(oe),y=b.length-1;if(y>0){i.textContent=lt?lt.emptyScript:"";for(let x=0;x<y;x++)i.append(b[x],Fe()),me.nextNode(),h.push({type:2,index:++a});i.append(b[y],Fe())}}}else if(i.nodeType===8)if(i.data===Fi)h.push({type:2,index:a});else{let b=-1;for(;(b=i.data.indexOf(oe,b+1))!==-1;)h.push({type:7,index:a}),b+=oe.length-1}a++}}static createElement(r,e){let t=ge.createElement("template");return t.innerHTML=r,t}};Pt=class{constructor(r,e){this._$AV=[],this._$AN=void 0,this._$AD=r,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(r){let{el:{content:e},parts:t}=this._$AD,i=(r?.creationScope??ge).importNode(e,!0);me.currentNode=i;let a=me.nextNode(),l=0,u=0,h=t[0];for(;h!==void 0;){if(l===h.index){let _;h.type===2?_=new Ve(a,a.nextSibling,this,r):h.type===1?_=new h.ctor(a,h.name,h.strings,this,r):h.type===6&&(_=new Ht(a,this,r)),this._$AV.push(_),h=t[++u]}l!==h?.index&&(a=me.nextNode(),l++)}return me.currentNode=ge,i}p(r){let e=0;for(let t of this._$AV)t!==void 0&&(t.strings!==void 0?(t._$AI(r,t,e),e+=t.strings.length-2):t._$AI(r[e])),e++}},Ve=class s{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(r,e,t,i){this.type=2,this._$AH=c,this._$AN=void 0,this._$AA=r,this._$AB=e,this._$AM=t,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let r=this._$AA.parentNode,e=this._$AM;return e!==void 0&&r?.nodeType===11&&(r=e.parentNode),r}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(r,e=this){r=$e(this,r,e),Ue(r)?r===c||r==null||r===""?(this._$AH!==c&&this._$AR(),this._$AH=c):r!==this._$AH&&r!==fe&&this._(r):r._$litType$!==void 0?this.$(r):r.nodeType!==void 0?this.T(r):Fs(r)?this.k(r):this._(r)}O(r){return this._$AA.parentNode.insertBefore(r,this._$AB)}T(r){this._$AH!==r&&(this._$AR(),this._$AH=this.O(r))}_(r){this._$AH!==c&&Ue(this._$AH)?this._$AA.nextSibling.data=r:this.T(ge.createTextNode(r)),this._$AH=r}$(r){let{values:e,_$litType$:t}=r,i=typeof t=="number"?this._$AC(r):(t.el===void 0&&(t.el=Be.createElement(Bi(t.h,t.h[0]),this.options)),t);if(this._$AH?._$AD===i)this._$AH.p(e);else{let a=new Pt(i,this),l=a.u(this.options);a.p(e),this.T(l),this._$AH=a}}_$AC(r){let e=Mi.get(r.strings);return e===void 0&&Mi.set(r.strings,e=new Be(r)),e}k(r){qt(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,t,i=0;for(let a of r)i===e.length?e.push(t=new s(this.O(Fe()),this.O(Fe()),this,this.options)):t=e[i],t._$AI(a),i++;i<e.length&&(this._$AR(t&&t._$AB.nextSibling,i),e.length=i)}_$AR(r=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);r!==this._$AB;){let t=Ni(r).nextSibling;Ni(r).remove(),r=t}}setConnected(r){this._$AM===void 0&&(this._$Cv=r,this._$AP?.(r))}},ke=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(r,e,t,i,a){this.type=1,this._$AH=c,this._$AN=void 0,this.element=r,this.name=e,this._$AM=i,this.options=a,t.length>2||t[0]!==""||t[1]!==""?(this._$AH=Array(t.length-1).fill(new String),this.strings=t):this._$AH=c}_$AI(r,e=this,t,i){let a=this.strings,l=!1;if(a===void 0)r=$e(this,r,e,0),l=!Ue(r)||r!==this._$AH&&r!==fe,l&&(this._$AH=r);else{let u=r,h,_;for(r=a[0],h=0;h<a.length-1;h++)_=$e(this,u[t+h],e,h),_===fe&&(_=this._$AH[h]),l||=!Ue(_)||_!==this._$AH[h],_===c?r=c:r!==c&&(r+=(_??"")+a[h+1]),this._$AH[h]=_}l&&!i&&this.j(r)}j(r){r===c?this.element.removeAttribute(this.naLine truncated
|
||||
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",ws_err_not_found:"Not found \u2014 it may have been deleted meanwhile",ws_err_invalid_input:"Invalid input",ws_err_invalid_date:"Invalid date",ws_err_invalid_format:"Invalid format",ws_err_invalid_url:"Invalid link",ws_err_not_configured:"Not set up yet",ws_err_not_loaded:"Not loaded yet \u2014 try again in a moment",ws_err_limit_reached:"Limit reached",ws_err_too_many:"Too many entries",ws_err_too_large:"Too large",ws_err_not_archived:"Not archived",ws_err_invalid_target:"Invalid target",ws_err_create_failed:"Could not be created",ws_err_archived:"Archived \u2014 restore it first",ws_err_already_archived:"Already archived",ws_err_unavailable:"Currently unavailable",ws_err_unauthorized:"Not permitted for your user",ws_err_too_many_views:"Too many saved views",ws_err_storage_unavailable:"Storage is not available",ws_err_replace_failed:"Replacement failed",ws_err_not_paused:"Not paused",ws_err_not_available:"Nothing available",ws_err_no_url:"No link given",ws_err_no_phases:"This task has no phases",ws_err_invalid_view:"Invalid view",ws_err_invalid_user:"Unknown user",ws_err_invalid_range:"Invalid range",ws_err_invalid_parent:"Invalid parent object",ws_err_invalid_device:"Unknown device",ws_err_empty_csv:"The CSV file is empty",ws_err_empty:"Nothing to import",ws_err_duplicate_failed:"Could not duplicate",ws_err_already_paused:"Already paused",ws_err_invalid_cursor:"Invalid phase position",ws_err_invalid_entity_slug:"Invalid entity name",ws_err_invalid_trigger_config:"Invalid trigger configuration",ws_err_no_defaults:"No quick-complete defaults set",ws_err_self_link_device:"An object cannot be linked to itself",ws_err_too_early:"Too early \u2014 this task can only be completed closer to its due date",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_toggle:"Due at a specific time",schedule_time_help:"Empty = midnight (default). HA timezone.",at_time:"at",notes_optional:"Notes (optional)",notes_markdown_hint:"Markdown is supported \u2014 **bold**, lists, [links](\u2026)",cost_optional:"Cost (optional)",duration_minutes:"Duration in minutes (optional)",completed_at_optional:"Completed at (optional, empty = now)",completed_at_pick:"Set date & time",completed_at_future_error:"The completion date cannot be in the future.",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",all_priorities:"All priorities",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",all_parts:"All parts",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",trigger_equals:"Trigger when equal to (=)",trigger_not_equals:"Trigger when
Line truncated
|
||||
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",ws_err_not_found:"Not found \u2014 it may have been deleted meanwhile",ws_err_invalid_input:"Invalid input",ws_err_invalid_date:"Invalid date",ws_err_invalid_format:"Invalid format",ws_err_invalid_url:"Invalid link",ws_err_invalid_mirror_todo:"Invalid to-do list",ws_err_not_configured:"Not set up yet",ws_err_not_loaded:"Not loaded yet \u2014 try again in a moment",ws_err_limit_reached:"Limit reached",ws_err_too_many:"Too many entries",ws_err_too_large:"Too large",ws_err_not_archived:"Not archived",ws_err_invalid_target:"Invalid target",ws_err_create_failed:"Could not be created",ws_err_archived:"Archived \u2014 restore it first",ws_err_already_archived:"Already archived",ws_err_unavailable:"Currently unavailable",ws_err_unauthorized:"Not permitted for your user",ws_err_too_many_views:"Too many saved views",ws_err_storage_unavailable:"Storage is not available",ws_err_replace_failed:"Replacement failed",ws_err_not_paused:"Not paused",ws_err_not_available:"Nothing available",ws_err_no_url:"No link given",ws_err_no_phases:"This task has no phases",ws_err_invalid_view:"Invalid view",ws_err_invalid_user:"Unknown user",ws_err_invalid_range:"Invalid range",ws_err_invalid_parent:"Invalid parent object",ws_err_invalid_device:"Unknown device",ws_err_empty_csv:"The CSV file is empty",ws_err_empty:"Nothing to import",ws_err_duplicate_failed:"Could not duplicate",ws_err_already_paused:"Already paused",ws_err_invalid_cursor:"Invalid phase position",ws_err_invalid_entity_slug:"Invalid entity name",ws_err_invalid_trigger_config:"Invalid trigger configuration",ws_err_no_defaults:"No quick-complete defaults set",ws_err_self_link_device:"An object cannot be linked to itself",ws_err_too_early:"Too early \u2014 this task can only be completed closer to its due date",ws_err_invalid_search_template:"The search link must be an http(s) URL containing {q}",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_toggle:"Due at a specific time",schedule_time_help:"Empty = midnight (default). HA timezone.",at_time:"at",notes_optional:"Notes (optional)",notes_markdown_hint:"Markdown is supported \u2014 **bold**, lists, [links](\u2026)",cost_optional:"Cost (optional)",duration_minutes:"Duration in minutes (optional)",completed_at_optional:"Completed at (optional, empty = now)",completed_at_pick:"Set date & time",completed_at_future_error:"The completion date cannot be in the future.",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.",task_mirror_todo:"Mirror into to-do lists",task_mirror_todo_hint:"The task appears in these lists while it is due; checking it off there completes it here.",priority_low:"Low",priority_normal:"Normal",priority_high:"High",all_priorities:"All priorities",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",all_parts:"All parts",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
Line truncated
|
||||
.field { display: flex; flex-direction: column; gap: 4px; }
|
||||
.field-label { font-size: 12px; color: var(--secondary-text-color); }
|
||||
.field-input {
|
||||
@@ -1245,7 +1245,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
||||
.stat-item .stat-label { font-size: 11px; white-space: normal; text-align: center; line-height: 1.2; hyphens: auto; overflow-wrap: anywhere; }
|
||||
.stat-value { font-size: 20px; }
|
||||
}
|
||||
`});function br(s,r,e){let t=new Blob([s],{type:e}),i=URL.createObjectURL(t),a=document.createElement("a");a.href=i,a.download=r,a.target="_blank",a.rel="noopener",a.style.display="none",document.body.appendChild(a),a.dispatchEvent(new MouseEvent("click")),document.body.removeChild(a),setTimeout(()=>URL.revokeObjectURL(i),6e4)}var Yt=w(()=>{"use strict"});async function pn(s,r,e=300){return(await s.connection.sendMessagePromise({type:"auth/sign_path",path:r,expires:e})).path}async function Gt(s,r,e=300){return pn(s,`/api/maintenance_supporter/document/${r}`,e)}async function yr(s,r,e=""){let t=window.open("about:blank","_blank");try{let i=await Gt(s,r);t&&(t.location.href=new URL(i+e,window.location.origin).href)}catch(i){throw t&&t.close(),i}}var Qt=w(()=>{"use strict";Yt()});function mt(s){return!!s&&/^https?:\/\//i.test(s)}var Jt=w(()=>{"use strict"});function hn(s){let r=(s||"").split(/\s+/).filter(Boolean);return r.length===0?"?":r.length===1?r[0][0].toUpperCase():(r[0][0]+r[r.length-1][0]).toUpperCase()}function un(s){let r=0;for(let e of s)r=r*31+e.charCodeAt(0)>>>0;return xr[r%xr.length]}function gt(s){return s?{id:s.id,name:s.name,initials:s.initials||hn(s.name),color:s.color||un(s.id)}:null}function Zt(s){return s?o`<span class="person-avatar" style="--person-color: ${s.color}" title=${s.name}>${s.initials}</span>`:c}var xr,Xt=w(()=>{"use strict";I();xr=["#c62828","#ad1457","#6a1b9a","#4527a0","#283593","#1565c0","#00838f","#2e7d32","#558b2f","#ef6c00","#6d4c41","#546e7a"]});var Ie,ei=w(()=>{"use strict";Xt();Ie=class{constructor(r){this.usersCache=null;this.cacheTimestamp=0;this.CACHE_TTL_MS=6e4;this.hass=r}updateHass(r){this.hass=r}async getUsers(r=!1){let e=Date.now();if(!r&&this.usersCache&&e-this.cacheTimestamp<this.CACHE_TTL_MS)return this.usersCache;try{let t=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/users/list"});return this.usersCache=t.users,this.cacheTimestamp=e,this.usersCache}catch(t){return console.error("Failed to fetch users:",t),this.usersCache||[]}}async assignUser(r,e,t){await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/task/assign_user",entry_id:r,task_id:e,user_id:t})}async getTasksByUser(r){return(await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/tasks/by_user",user_id:r})).tasks}getUserName(r){return!r||!this.usersCache?null:this.usersCache.find(t=>t.id===r)?.name||null}getPerson(r){return gt(this.getUser(r))}getUser(r){return!r||!this.usersCache?null:this.usersCache.find(e=>e.id===r)||null}getCurrentUserId(){return this.hass.user?.id||null}isCurrentUser(r){return r?r===this.getCurrentUserId():!1}clearCache(){this.usersCache=null,this.cacheTimestamp=0}}});function _n(s,r){if(r<=0)return 0;let e=typeof s=="number"&&Number.isFinite(s)?Math.trunc(s):0;return e<0?0:e%r}function mn(s){return!!(s?.phases&&s.phase_sequence&&s.phase_sequence.length>0)}function ti(s){if(!s||!mn(s))return null;let r=s.phase_sequence,e=_n(s.phase_cursor,r.length),t=r[e],i=s.phases?.[t];return i?{id:t,name:i.name,index:e,count:r.length,notes:i.notes,checklist:i.checklist!==void 0?i.checklist:s.checklist??[],consumesParts:i.consumes_parts!==void 0?i.consumes_parts:s.consumes_parts??[],requiredFields:i.required_completion_fields!==void 0?i.required_completion_fields:s.required_completion_fields??[]}:null}function de(s){let r=ti(s);return r?`${r.index+1}/${r.count} \xB7 ${r.name}`:""}var ft=w(()=>{"use strict"});function wr(){let s=new Uint8Array(4);return(globalThis.crypto??{getRandomValues:r=>r.map(()=>Math.floor(Math.random()*256))}).getRandomValues(s),Array.from(s,r=>r.toString(16).padStart(2,"0")).join("")}function ce(s){let r=s?.reading_values;if(!Array.isArray(r))return[];let e=[],t=new Set;for(let i of r){if(!i||typeof i!="object")continue;let a=i;typeof a.id!="string"||!a.id||t.has(a.id)||typeof a.value!="number"||!Number.isFinite(a.value)||(t.add(a.id),e.push({id:a.id,name:typeof a.name=="string"?a.name:a.id,unit:typeof a.unit=="string"?a.unit:null,value:a.value}))}return e}function $r(s){return s.filter(r=>r.type==="completed"&&(r.reading_value!=null||ce(r).length>0)).sort((r,e)=>r.timestamp.localeCompare(e.timestamp))}function kr(s){return $r(s??[]).map(r=>({timestamp:r.timestamp,values:ce(r)})).filter(r=>r.values.length>0)}function Er(s,r,e){let t;for(let i of s){if(e!==void 0){let l=new Date(i.timestamp).getTime();if(!isNaN(l)&&l>=e)break}let a=i.values.find(l=>l.id===r);a&&(t=a)}return t}function Sr(s,r,e){let t=ce(r).find(a=>a.id===e);if(!t)return null;let i=null;for(let a of $r(s)){if(a.timestamp>=r.timestamp)break;let l=ce(a).find(u=>u.id===e);l&&(i=l.value)}return i==null?null:t.value-i}function Tr(s){let r=new Set,e=new Set;for(let t of s){let i=(t.name||"").trim().toLowerCase();i&&(r.has(i)?e.add(t.id):r.add(i))}return e}function Ar(s){let r=[],e=new Set,t=new Set;for(let i of s){let a=(i.name||"").trim();if(!(!a||e.has(i.id)||t.has(a.toLowerCase()))&&(e.add(i.id),t.add(a.toLowerCase()),r.push({id:i.id,Line truncated
|
||||
`});function br(s,r,e){let t=new Blob([s],{type:e}),i=URL.createObjectURL(t),a=document.createElement("a");a.href=i,a.download=r,a.target="_blank",a.rel="noopener",a.style.display="none",document.body.appendChild(a),a.dispatchEvent(new MouseEvent("click")),document.body.removeChild(a),setTimeout(()=>URL.revokeObjectURL(i),6e4)}var Yt=w(()=>{"use strict"});async function pn(s,r,e=300){return(await s.connection.sendMessagePromise({type:"auth/sign_path",path:r,expires:e})).path}async function Gt(s,r,e=300){return pn(s,`/api/maintenance_supporter/document/${r}`,e)}async function yr(s,r,e=""){let t=window.open("about:blank","_blank");try{let i=await Gt(s,r);t&&(t.location.href=new URL(i+e,window.location.origin).href)}catch(i){throw t&&t.close(),i}}var Qt=w(()=>{"use strict";Yt()});function mt(s){return!!s&&/^https?:\/\//i.test(s)}var Jt=w(()=>{"use strict"});function hn(s){let r=(s||"").split(/\s+/).filter(Boolean);return r.length===0?"?":r.length===1?r[0][0].toUpperCase():(r[0][0]+r[r.length-1][0]).toUpperCase()}function un(s){let r=0;for(let e of s)r=r*31+e.charCodeAt(0)>>>0;return xr[r%xr.length]}function gt(s){return s?{id:s.id,name:s.name,initials:s.initials||hn(s.name),color:s.color||un(s.id)}:null}function Zt(s){return s?o`<span class="person-avatar" style="--person-color: ${s.color}" title=${s.name}>${s.initials}</span>`:c}var xr,Xt=w(()=>{"use strict";I();xr=["#c62828","#ad1457","#6a1b9a","#4527a0","#283593","#1565c0","#00838f","#2e7d32","#558b2f","#ef6c00","#6d4c41","#546e7a"]});var Ie,ei=w(()=>{"use strict";Xt();Ie=class{constructor(r){this.usersCache=null;this.cacheTimestamp=0;this.CACHE_TTL_MS=6e4;this.hass=r}updateHass(r){this.hass=r}async getUsers(r=!1){let e=Date.now();if(!r&&this.usersCache&&e-this.cacheTimestamp<this.CACHE_TTL_MS)return this.usersCache;try{let t=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/users/list"});return this.usersCache=t.users,this.cacheTimestamp=e,this.usersCache}catch(t){return console.error("Failed to fetch users:",t),this.usersCache||[]}}async assignUser(r,e,t){await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/task/assign_user",entry_id:r,task_id:e,user_id:t})}async getTasksByUser(r){return(await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/tasks/by_user",user_id:r})).tasks}getUserName(r){return!r||!this.usersCache?null:this.usersCache.find(t=>t.id===r)?.name||null}getPerson(r){return gt(this.getUser(r))}getUser(r){return!r||!this.usersCache?null:this.usersCache.find(e=>e.id===r)||null}getCurrentUserId(){return this.hass.user?.id||null}isCurrentUser(r){return r?r===this.getCurrentUserId():!1}clearCache(){this.usersCache=null,this.cacheTimestamp=0}}});function _n(s,r){if(r<=0)return 0;let e=typeof s=="number"&&Number.isFinite(s)?Math.trunc(s):0;return e<0?0:e%r}function mn(s){return!!(s?.phases&&s.phase_sequence&&s.phase_sequence.length>0)}function ti(s){if(!s||!mn(s))return null;let r=s.phase_sequence,e=_n(s.phase_cursor,r.length),t=r[e],i=s.phases?.[t];return i?{id:t,name:i.name,index:e,count:r.length,notes:i.notes,checklist:i.checklist!==void 0?i.checklist:s.checklist??[],consumesParts:i.consumes_parts!==void 0?i.consumes_parts:s.consumes_parts??[],requiredFields:i.required_completion_fields!==void 0?i.required_completion_fields:s.required_completion_fields??[]}:null}function de(s){let r=ti(s);return r?`${r.index+1}/${r.count} \xB7 ${r.name}`:""}var ft=w(()=>{"use strict"});function wr(){let s=new Uint8Array(4);return(globalThis.crypto??{getRandomValues:r=>r.map(()=>Math.floor(Math.random()*256))}).getRandomValues(s),Array.from(s,r=>r.toString(16).padStart(2,"0")).join("")}function ce(s){let r=s?.reading_values;if(!Array.isArray(r))return[];let e=[],t=new Set;for(let i of r){if(!i||typeof i!="object")continue;let a=i;typeof a.id!="string"||!a.id||t.has(a.id)||typeof a.value!="number"||!Number.isFinite(a.value)||(t.add(a.id),e.push({id:a.id,name:typeof a.name=="string"?a.name:a.id,unit:typeof a.unit=="string"?a.unit:null,value:a.value}))}return e}function $r(s){return s.filter(r=>r.type==="completed"&&(r.reading_value!=null||ce(r).length>0)).sort((r,e)=>r.timestamp.localeCompare(e.timestamp))}function kr(s){return $r(s??[]).map(r=>({timestamp:r.timestamp,values:ce(r)})).filter(r=>r.values.length>0)}function Er(s,r,e){let t;for(let i of s){if(e!==void 0){let l=new Date(i.timestamp).getTime();if(!isNaN(l)&&l>=e)break}let a=i.values.find(l=>l.id===r);a&&(t=a)}return t}function Sr(s,r,e){let t=ce(r).find(a=>a.id===e);if(!t)return null;let i=null;for(let a of $r(s)){if(a.timestamp>=r.timestamp)break;let l=ce(a).find(u=>u.id===e);l&&(i=l.value)}return i==null?null:t.value-i}function Tr(s){let r=new Set,e=new Set;for(let t of s){let i=(t.name||"").trim().toLowerCase();i&&(r.has(i)?e.add(t.id):r.add(i))}return e}function Ar(s){let r=[],e=new Set,t=new Set;for(let i of s){let a=(i.name||"").trim();if(!(!a||e.has(i.id)||t.has(a.toLowerCase()))&&(e.add(i.id),t.add(a.toLowerCase()),r.push({id:i.id,Line truncated
|
||||
<div class="field">
|
||||
${this.label?o`<span class="label">${this.label}${this.required?o`<span class="req">*</span>`:c}</span>`:c}
|
||||
<div class="row">
|
||||
@@ -1331,7 +1331,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
||||
}
|
||||
input.typed[aria-invalid="true"] { border-color: var(--error-color, #f44336); }
|
||||
input.typed:focus { outline: 2px solid var(--primary-color); outline-offset: -1px; }
|
||||
`,d([v({attribute:!1})],M.prototype,"hass",2),d([v()],M.prototype,"kind",2),d([v()],M.prototype,"label",2),d([v()],M.prototype,"value",2),d([v()],M.prototype,"helper",2),d([v({type:Boolean})],M.prototype,"clearable",2),d([v({type:Boolean})],M.prototype,"disabled",2),d([v({type:Boolean})],M.prototype,"required",2),d([v()],M.prototype,"lang",2),d([p()],M.prototype,"_typing",2),d([p()],M.prototype,"_typed",2),d([p()],M.prototype,"_typedInvalid",2);customElements.get("ms-date-field")||customElements.define("ms-date-field",M)});function wt(){if(window.externalApp!==void 0)return!0;let r=typeof navigator<"u"&&navigator.userAgent||"";return/Home Assistant\//.test(r)&&/Android/.test(r)}var ai=w(()=>{"use strict"});function tt(s){try{return localStorage.getItem(s)}catch{return null}}function it(s,r){try{localStorage.setItem(s,r)}catch{}}var pe,oi=w(()=>{"use strict";pe={printOptions:"msp-print-options",batteryRosterOpen:"msp-bf-roster-open",docSort:"msp-doc-sort",cameraDevice:"msp-camera-device",overviewTab:"msp-overview-tab",collapsedSections:"msp-collapsed-sections",chartRange:"msp-chart-range",chartHideOutliers:"msp-chart-hide-outliers",taskSort:"maintenance_supporter_sort",objectSort:"maintenance_supporter_object_sort",groupBy:"maintenance_supporter_groupby",objectView:"maintenance_supporter_object_view",objectsCache:"msp-objects-cache",gettingStartedDismissed:"msp-gs-dismissed",batteryRosterSort:"ms_bf_roster_sort"}});function qr(){if(!wt())return!1;let s=typeof navigator<"u"?navigator.mediaDevices:void 0;return!!s&&typeof s.getUserMedia=="function"}var Tn,An,he,li=w(()=>{"use strict";I();q();C();ai();oi();Tn=1920,An=.88,he=class extends E{constructor(){super(...arguments);this.lang="en";this._open=!1;this._busy=!1;this._devices=[];this._stream=null}async open(){if(this._open)return;let e=typeof navigator<"u"?navigator.mediaDevices:void 0;if(!e||typeof e.getUserMedia!="function"){this._unavailable("no_media_devices");return}let t=tt(pe.cameraDevice),i=!1;if(t)try{this._stream=await e.getUserMedia({video:{deviceId:{exact:t}},audio:!1}),i=!0}catch{}if(!i){try{this._stream=await e.getUserMedia({video:{facingMode:{ideal:"environment"},advanced:[{zoom:1}]},audio:!1})}catch(l){this._unavailable(l instanceof Error?l.name||l.message:String(l));return}await this._preferMainBackCamera(e)}await this._applyZoomOne(),await this._listDevices(e),this._open=!0,await this.updateComplete;let a=this._video;if(a&&this._stream){a.srcObject=this._stream;try{await a.play()}catch{}}}async _preferMainBackCamera(e){if(typeof e.enumerateDevices!="function")return;let t=[];try{t=await e.enumerateDevices()}catch{return}let i=h=>{let _=/camera2?\s*(\d+)/i.exec(h.label);return _?Number(_[1]):Number.MAX_SAFE_INTEGER},a=t.filter(h=>h.kind==="videoinput"&&h.deviceId&&/back|rear|environment|rück|hinten/i.test(h.label)).sort((h,_)=>i(h)-i(_)),u=this._stream?.getVideoTracks()[0]?.getSettings().deviceId;if(a.length>1&&a[0].deviceId!==u)try{let h=await e.getUserMedia({video:{deviceId:{exact:a[0].deviceId}},audio:!1});for(let _ of this._stream?.getTracks()??[])_.stop();this._stream=h}catch{}}async _applyZoomOne(){let e=this._stream?.getVideoTracks()[0],t=e&&typeof e.getCapabilities=="function"?e.getCapabilities():void 0;if(t?.zoom&&typeof t.zoom.min=="number"&&t.zoom.min<1&&(t.zoom.max??1)>=1)try{await e.applyConstraints({advanced:[{zoom:1}]})}catch{}}async _listDevices(e){if(typeof e.enumerateDevices=="function")try{this._devices=(await e.enumerateDevices()).filter(t=>t.kind==="videoinput"&&!!t.deviceId)}catch{this._devices=[]}}get _currentDeviceId(){return this._stream?.getVideoTracks()[0]?.getSettings().deviceId}async _switchCamera(){let e=typeof navigator<"u"?navigator.mediaDevices:void 0;if(!e||this._devices.length<2||this._busy)return;let t=this._devices.map(l=>l.deviceId),i=t.indexOf(this._currentDeviceId??""),a=t[(i+1)%t.length];this._busy=!0;try{let l=await e.getUserMedia({video:{deviceId:{exact:a}},audio:!1});for(let h of this._stream?.getTracks()??[])h.stop();this._stream=l,await this._applyZoomOne(),it(pe.cameraDevice,a);let u=this._video;if(u){u.srcObject=l;try{await u.play()}catch{}}}catch{}finally{this._busy=!1}}close(){this._stopStream(),this._open=!1,this._busy=!1}disconnectedCallback(){super.disconnectedCallback(),this._stopStream()}get _video(){return this.shadowRoot?.querySelector("video")??null}_stopStream(){for(let t of this._stream?.getTracks()??[])t.stop();this._stream=null;let e=this._video;e&&(e.srcObject=null)}_unavailable(e){this._stopStream(),this._open=!1,this.dispatchEvent(new CustomEvent("capture-unavailable",{detail:{reason:e},bubbles:!0,composed:!0}))}async _shoot(){let e=this._video;if(!(!e||this._busy)){this._busy=!0;try{let t=e.videoWidth||640,i=e.videoHeight||480,a=Math.min(1,Tn/Math.max(t,i)),l=document.createElement("canvas");l.width=Math.round(t*a),l.height=Math.round(i*a);let u=l.getContext("2d");if(!u)throw new Error("no_canvas");u.drawImage(e,0,0,l.width,l.height);let h=await new Promise(b=>l.toBlob(b,"
Line truncated
|
||||
`,d([v({attribute:!1})],M.prototype,"hass",2),d([v()],M.prototype,"kind",2),d([v()],M.prototype,"label",2),d([v()],M.prototype,"value",2),d([v()],M.prototype,"helper",2),d([v({type:Boolean})],M.prototype,"clearable",2),d([v({type:Boolean})],M.prototype,"disabled",2),d([v({type:Boolean})],M.prototype,"required",2),d([v()],M.prototype,"lang",2),d([p()],M.prototype,"_typing",2),d([p()],M.prototype,"_typed",2),d([p()],M.prototype,"_typedInvalid",2);customElements.get("ms-date-field")||customElements.define("ms-date-field",M)});function wt(){if(window.externalApp!==void 0)return!0;let r=typeof navigator<"u"&&navigator.userAgent||"";return/Home Assistant\//.test(r)&&/Android/.test(r)}var ai=w(()=>{"use strict"});function tt(s){try{return localStorage.getItem(s)}catch{return null}}function it(s,r){try{localStorage.setItem(s,r)}catch{}}var pe,oi=w(()=>{"use strict";pe={objectSections:"msp-object-sections",printOptions:"msp-print-options",batteryRosterOpen:"msp-bf-roster-open",docSort:"msp-doc-sort",cameraDevice:"msp-camera-device",overviewTab:"msp-overview-tab",collapsedSections:"msp-collapsed-sections",chartRange:"msp-chart-range",chartHideOutliers:"msp-chart-hide-outliers",taskSort:"maintenance_supporter_sort",objectSort:"maintenance_supporter_object_sort",groupBy:"maintenance_supporter_groupby",objectView:"maintenance_supporter_object_view",objectsCache:"msp-objects-cache",gettingStartedDismissed:"msp-gs-dismissed",batteryRosterSort:"ms_bf_roster_sort"}});function qr(){if(!wt())return!1;let s=typeof navigator<"u"?navigator.mediaDevices:void 0;return!!s&&typeof s.getUserMedia=="function"}var Tn,An,he,li=w(()=>{"use strict";I();q();C();ai();oi();Tn=1920,An=.88,he=class extends E{constructor(){super(...arguments);this.lang="en";this._open=!1;this._busy=!1;this._devices=[];this._stream=null}async open(){if(this._open)return;let e=typeof navigator<"u"?navigator.mediaDevices:void 0;if(!e||typeof e.getUserMedia!="function"){this._unavailable("no_media_devices");return}let t=tt(pe.cameraDevice),i=!1;if(t)try{this._stream=await e.getUserMedia({video:{deviceId:{exact:t}},audio:!1}),i=!0}catch{}if(!i){try{this._stream=await e.getUserMedia({video:{facingMode:{ideal:"environment"},advanced:[{zoom:1}]},audio:!1})}catch(l){this._unavailable(l instanceof Error?l.name||l.message:String(l));return}await this._preferMainBackCamera(e)}await this._applyZoomOne(),await this._listDevices(e),this._open=!0,await this.updateComplete;let a=this._video;if(a&&this._stream){a.srcObject=this._stream;try{await a.play()}catch{}}}async _preferMainBackCamera(e){if(typeof e.enumerateDevices!="function")return;let t=[];try{t=await e.enumerateDevices()}catch{return}let i=h=>{let _=/camera2?\s*(\d+)/i.exec(h.label);return _?Number(_[1]):Number.MAX_SAFE_INTEGER},a=t.filter(h=>h.kind==="videoinput"&&h.deviceId&&/back|rear|environment|rück|hinten/i.test(h.label)).sort((h,_)=>i(h)-i(_)),u=this._stream?.getVideoTracks()[0]?.getSettings().deviceId;if(a.length>1&&a[0].deviceId!==u)try{let h=await e.getUserMedia({video:{deviceId:{exact:a[0].deviceId}},audio:!1});for(let _ of this._stream?.getTracks()??[])_.stop();this._stream=h}catch{}}async _applyZoomOne(){let e=this._stream?.getVideoTracks()[0],t=e&&typeof e.getCapabilities=="function"?e.getCapabilities():void 0;if(t?.zoom&&typeof t.zoom.min=="number"&&t.zoom.min<1&&(t.zoom.max??1)>=1)try{await e.applyConstraints({advanced:[{zoom:1}]})}catch{}}async _listDevices(e){if(typeof e.enumerateDevices=="function")try{this._devices=(await e.enumerateDevices()).filter(t=>t.kind==="videoinput"&&!!t.deviceId)}catch{this._devices=[]}}get _currentDeviceId(){return this._stream?.getVideoTracks()[0]?.getSettings().deviceId}async _switchCamera(){let e=typeof navigator<"u"?navigator.mediaDevices:void 0;if(!e||this._devices.length<2||this._busy)return;let t=this._devices.map(l=>l.deviceId),i=t.indexOf(this._currentDeviceId??""),a=t[(i+1)%t.length];this._busy=!0;try{let l=await e.getUserMedia({video:{deviceId:{exact:a}},audio:!1});for(let h of this._stream?.getTracks()??[])h.stop();this._stream=l,await this._applyZoomOne(),it(pe.cameraDevice,a);let u=this._video;if(u){u.srcObject=l;try{await u.play()}catch{}}}catch{}finally{this._busy=!1}}close(){this._stopStream(),this._open=!1,this._busy=!1}disconnectedCallback(){super.disconnectedCallback(),this._stopStream()}get _video(){return this.shadowRoot?.querySelector("video")??null}_stopStream(){for(let t of this._stream?.getTracks()??[])t.stop();this._stream=null;let e=this._video;e&&(e.srcObject=null)}_unavailable(e){this._stopStream(),this._open=!1,this.dispatchEvent(new CustomEvent("capture-unavailable",{detail:{reason:e},bubbles:!0,composed:!0}))}async _shoot(){let e=this._video;if(!(!e||this._busy)){this._busy=!0;try{let t=e.videoWidth||640,i=e.videoHeight||480,a=Math.min(1,Tn/Math.max(t,i)),l=document.createElement("canvas");l.width=Math.round(t*a),l.height=Math.round(i*a);let u=l.getContext("2d");if(!u)throw new Error("no_canvas");u.drawImage(e,0,0,l.width,l.height);le
Line truncated
|
||||
<div class="overlay" role="dialog" aria-modal="true" aria-label=${n("doc_camera",e)}>
|
||||
<video autoplay playsinline muted></video>
|
||||
<div class="bar">
|
||||
@@ -2005,9 +2005,9 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
||||
color: var(--error-color, #f44336);
|
||||
font-size: 13px;
|
||||
}
|
||||
`,d([v({attribute:!1})],N.prototype,"hass",2),d([v({attribute:!1})],N.prototype,"objects",2),d([p()],N.prototype,"_open",2),d([p()],N.prototype,"_loading",2),d([p()],N.prototype,"_error",2),d([p()],N.prototype,"_name",2),d([p()],N.prototype,"_manufacturer",2),d([p()],N.prototype,"_model",2),d([p()],N.prototype,"_serialNumber",2),d([p()],N.prototype,"_areaId",2),d([p()],N.prototype,"_installationDate",2),d([p()],N.prototype,"_warrantyExpiry",2),d([p()],N.prototype,"_documentationUrl",2),d([p()],N.prototype,"_notes",2),d([p()],N.prototype,"_haDeviceId",2),d([p()],N.prototype,"_parentEntryId",2),d([p()],N.prototype,"_entryId",2);customElements.get("maintenance-object-dialog")||customElements.define("maintenance-object-dialog",N)});var hi,Mr,zr,Fr=w(()=>{"use strict";hi=["sensor","binary_sensor","number","input_number","input_boolean","switch","climate","vacuum","cover","fan","light","water_heater","humidifier","media_player","weather","air_quality","valve","lawn_mower","lock"],Mr=["sensor"],zr=["temperature","humidity","pressure"]});async function ui(s,r,e={}){e.busy?.(!0);try{return await s.hass.connection.sendMessagePromise(r)}catch(t){let i=P(s.hass);e.onError?.(R(t,i,e.fallbackKey?n(e.fallbackKey,i):void 0));return}finally{e.busy?.(!1)}}var Ur=w(()=>{"use strict";ie();C()});function Nn(){return{entityIds:"",type:"threshold",attribute:"",above:"",below:"",equals:"",notEquals:"",forMinutes:"0",targetValue:"",deltaMode:!1,fromState:"",toState:"",targetChanges:"",runtimeHours:"",onStates:"",carry:{}}}function Hn(s){return{entityIds:(s.entity_ids||(s.entity_id?[s.entity_id]:[])).join(", "),type:s.type||"threshold",attribute:s.attribute||"",above:s.trigger_above?.toString()??"",below:s.trigger_below?.toString()??"",equals:s.trigger_equals?.toString()??"",notEquals:s.trigger_not_equals?.toString()??"",forMinutes:s.trigger_for_minutes?.toString()??"0",targetValue:s.trigger_target_value?.toString()??"",deltaMode:s.trigger_delta_mode||!1,fromState:s.trigger_from_state||"",toState:s.trigger_to_state||"",targetChanges:s.trigger_target_changes?.toString()??"",runtimeHours:s.trigger_runtime_hours?.toString()??"",onStates:(s.trigger_on_states||[]).join(", "),carry:Object.fromEntries(Object.entries(s).filter(([e])=>!jn.has(e)&&!e.startsWith("_")))}}function On(s){let r=s.entityIds.split(",").map(t=>t.trim()).filter(Boolean);if(r.length===0)return null;let e={...s.carry||{},entity_id:r[0],entity_ids:r,type:s.type};if(s.attribute&&(e.attribute=s.attribute),s.type==="threshold"){let t=parseFloat(s.above);isNaN(t)||(e.trigger_above=t);let i=parseFloat(s.below);isNaN(i)||(e.trigger_below=i);let a=parseFloat(s.equals);isNaN(a)||(e.trigger_equals=a);let l=parseFloat(s.notEquals);isNaN(l)||(e.trigger_not_equals=l);let u=parseInt(s.forMinutes,10);isNaN(u)||(e.trigger_for_minutes=u)}else if(s.type==="counter"){let t=parseFloat(s.targetValue);isNaN(t)||(e.trigger_target_value=t),e.trigger_delta_mode=s.deltaMode}else if(s.type==="state_change"){s.fromState&&(e.trigger_from_state=s.fromState),s.toState&&(e.trigger_to_state=s.toState);let t=parseInt(s.targetChanges,10);isNaN(t)||(e.trigger_target_changes=t)}else if(s.type==="runtime"){let t=parseFloat(s.runtimeHours);isNaN(t)||(e.trigger_runtime_hours=t);let i=(s.onStates||"").split(",").map(a=>a.trim()).filter(Boolean);i.length>0&&(e.trigger_on_states=i)}return e}function qn(s){return Array.from({length:7},(r,e)=>Ge(e,s,"short"))}function Dn(s){return Array.from({length:12},(r,e)=>mr(e,s,"short"))}var In,Rn,Pn,Et,Br,Vr,Ln,re,jn,f,_i,Wr=w(()=>{"use strict";I();q();C();ei();vt();ye();Fr();ie();Ur();ri();pi();Le();In=["cleaning","inspection","replacement","calibration","service","reading","custom"],Rn=["low","normal","high"],Pn=["time_based","weekdays","nth_weekday","day_of_month","sensor_based","one_time","manual"],Et=["weekdays","nth_weekday","day_of_month"],Br=["time_based","one_time",...Et],Vr=["threshold","counter","state_change","runtime"],Ln=[...Vr,"compound"],re={alpha:"0.3",min:"7",max:"365"};jn=new Set(["entity_id","entity_ids","type","attribute","trigger_above","trigger_below","trigger_equals","trigger_not_equals","trigger_for_minutes","trigger_target_value","trigger_delta_mode","trigger_from_state","trigger_to_state","trigger_target_changes","trigger_runtime_hours","trigger_on_states"]);f=class f extends E{constructor(){super(...arguments);this.checklistsEnabled=!1;this.scheduleTimeEnabled=!1;this.completionActionsEnabled=!1;this.defaultWarningDays=7;this.parts=[];this._foreignOwners=[];this._open=!1;this._entityPickerFallback=!1;this._pickerProbeStrikes=0;this._loading=!1;this._error="";this._warning="";this._entryId="";this._taskId=null;this._objectChoices=[];this._name="";this._type="custom";this._scheduleType="time_based";this._intervalDays="30";this._intervalUnit="days";this._dueDate="";this._warningDays="7";this._earliestCompletionDays="";this._intervalAnchor="completion";this._weekdays=[];this._nth="1";this._nthWeekday="5";this._domDay="1";this._domLastDay=!1;this._
Line truncated
|
||||
`,d([v({attribute:!1})],N.prototype,"hass",2),d([v({attribute:!1})],N.prototype,"objects",2),d([p()],N.prototype,"_open",2),d([p()],N.prototype,"_loading",2),d([p()],N.prototype,"_error",2),d([p()],N.prototype,"_name",2),d([p()],N.prototype,"_manufacturer",2),d([p()],N.prototype,"_model",2),d([p()],N.prototype,"_serialNumber",2),d([p()],N.prototype,"_areaId",2),d([p()],N.prototype,"_installationDate",2),d([p()],N.prototype,"_warrantyExpiry",2),d([p()],N.prototype,"_documentationUrl",2),d([p()],N.prototype,"_notes",2),d([p()],N.prototype,"_haDeviceId",2),d([p()],N.prototype,"_parentEntryId",2),d([p()],N.prototype,"_entryId",2);customElements.get("maintenance-object-dialog")||customElements.define("maintenance-object-dialog",N)});var hi,Mr,zr,Fr=w(()=>{"use strict";hi=["sensor","binary_sensor","number","input_number","input_boolean","switch","climate","vacuum","cover","fan","light","water_heater","humidifier","media_player","weather","air_quality","valve","lawn_mower","lock"],Mr=["sensor"],zr=["temperature","humidity","pressure"]});async function ui(s,r,e={}){e.busy?.(!0);try{return await s.hass.connection.sendMessagePromise(r)}catch(t){let i=P(s.hass);e.onError?.(R(t,i,e.fallbackKey?n(e.fallbackKey,i):void 0));return}finally{e.busy?.(!1)}}var Ur=w(()=>{"use strict";ie();C()});function Nn(){return{entityIds:"",type:"threshold",attribute:"",above:"",below:"",equals:"",notEquals:"",forMinutes:"0",targetValue:"",deltaMode:!1,fromState:"",toState:"",targetChanges:"",runtimeHours:"",onStates:"",carry:{}}}function Hn(s){return{entityIds:(s.entity_ids||(s.entity_id?[s.entity_id]:[])).join(", "),type:s.type||"threshold",attribute:s.attribute||"",above:s.trigger_above?.toString()??"",below:s.trigger_below?.toString()??"",equals:s.trigger_equals?.toString()??"",notEquals:s.trigger_not_equals?.toString()??"",forMinutes:s.trigger_for_minutes?.toString()??"0",targetValue:s.trigger_target_value?.toString()??"",deltaMode:s.trigger_delta_mode||!1,fromState:s.trigger_from_state||"",toState:s.trigger_to_state||"",targetChanges:s.trigger_target_changes?.toString()??"",runtimeHours:s.trigger_runtime_hours?.toString()??"",onStates:(s.trigger_on_states||[]).join(", "),carry:Object.fromEntries(Object.entries(s).filter(([e])=>!jn.has(e)&&!e.startsWith("_")))}}function On(s){let r=s.entityIds.split(",").map(t=>t.trim()).filter(Boolean);if(r.length===0)return null;let e={...s.carry||{},entity_id:r[0],entity_ids:r,type:s.type};if(s.attribute&&(e.attribute=s.attribute),s.type==="threshold"){let t=parseFloat(s.above);isNaN(t)||(e.trigger_above=t);let i=parseFloat(s.below);isNaN(i)||(e.trigger_below=i);let a=parseFloat(s.equals);isNaN(a)||(e.trigger_equals=a);let l=parseFloat(s.notEquals);isNaN(l)||(e.trigger_not_equals=l);let u=parseInt(s.forMinutes,10);isNaN(u)||(e.trigger_for_minutes=u)}else if(s.type==="counter"){let t=parseFloat(s.targetValue);isNaN(t)||(e.trigger_target_value=t),e.trigger_delta_mode=s.deltaMode}else if(s.type==="state_change"){s.fromState&&(e.trigger_from_state=s.fromState),s.toState&&(e.trigger_to_state=s.toState);let t=parseInt(s.targetChanges,10);isNaN(t)||(e.trigger_target_changes=t)}else if(s.type==="runtime"){let t=parseFloat(s.runtimeHours);isNaN(t)||(e.trigger_runtime_hours=t);let i=(s.onStates||"").split(",").map(a=>a.trim()).filter(Boolean);i.length>0&&(e.trigger_on_states=i)}return e}function qn(s){return Array.from({length:7},(r,e)=>Ge(e,s,"short"))}function Dn(s){return Array.from({length:12},(r,e)=>mr(e,s,"short"))}var In,Rn,Pn,Et,Br,Vr,Ln,re,jn,f,_i,Wr=w(()=>{"use strict";I();q();C();ei();vt();ye();Fr();ie();Ur();ri();pi();Le();In=["cleaning","inspection","replacement","calibration","service","reading","custom"],Rn=["low","normal","high"],Pn=["time_based","weekdays","nth_weekday","day_of_month","sensor_based","one_time","manual"],Et=["weekdays","nth_weekday","day_of_month"],Br=["time_based","one_time",...Et],Vr=["threshold","counter","state_change","runtime"],Ln=[...Vr,"compound"],re={alpha:"0.3",min:"7",max:"365"};jn=new Set(["entity_id","entity_ids","type","attribute","trigger_above","trigger_below","trigger_equals","trigger_not_equals","trigger_for_minutes","trigger_target_value","trigger_delta_mode","trigger_from_state","trigger_to_state","trigger_target_changes","trigger_runtime_hours","trigger_on_states"]);f=class f extends E{constructor(){super(...arguments);this.checklistsEnabled=!1;this.scheduleTimeEnabled=!1;this.completionActionsEnabled=!1;this.defaultWarningDays=7;this.parts=[];this._foreignOwners=[];this._open=!1;this._entityPickerFallback=!1;this._pickerProbeStrikes=0;this._loading=!1;this._error="";this._warning="";this._entryId="";this._taskId=null;this._objectChoices=[];this._name="";this._type="custom";this._scheduleType="time_based";this._intervalDays="30";this._intervalUnit="days";this._dueDate="";this._warningDays="7";this._earliestCompletionDays="";this._intervalAnchor="completion";this._weekdays=[];this._nth="1";this._nthWeekday="5";this._domDay="1";this._domLastDay=!1;this._
Line truncated
|
||||
`),this._phaseDefs=Object.entries(t.phases||{}).map(([_,m])=>{let{name:b,checklist:y,consumes_parts:x,required_completion_fields:g,...$}=m,z=m.consumes_parts||[],L=z.findIndex(H=>!H.entry_id),A=L>=0?z[L]:void 0;return{id:_,name:m.name||_,checklistText:(m.checklist||[]).join(`
|
||||
`),partId:A?.part_id||"",partQty:A?.quantity!=null?String(A.quantity):"",reqOverride:m.required_completion_fields!==void 0,reqFields:[...m.required_completion_fields||[]],extraParts:z.filter((H,we)=>we!==L).map(H=>({...H})),carry:$}}),this._phaseSeq=[...t.phase_sequence||[]],this._requiredCompletion=[...t.required_completion_fields||[]],this._scheduleTime=t.schedule_time||"",this._scheduleTimeOn=!!t.schedule_time;let l=t.on_complete_action;if(l&&l.service){this._actionService=l.service;let _=l.target?.entity_id;this._actionTargetEntity=Array.isArray(_)?_[0]||"":_||"",this._actionData=l.data&&typeof l.data=="object"?{...l.data}:{},this._actionDataJsonFallback=""}else this._actionService="",this._actionTargetEntity="",this._actionData={},this._actionDataJsonFallback="";let u=t.quick_complete_defaults;this._qcNotes=u?.notes||"",this._qcCost=u?.cost!=null?String(u.cost):"",this._qcDuration=u?.duration!=null?String(u.duration):"",this._qcFeedback=u?.feedback||"";let h=t.adaptive_config||{};if(this._environmentalEntity=h.environmental_entity||"",this._environmentalAttribute=h.environmental_attribute||"",this._environmentalInitial=this._environmentalEntity,this._environmentalAttributeInitial=this._environmentalAttribute,this._adaptiveEnabled=!!h.enabled,this._adaptiveAlpha=h.ewa_alpha?.toString()??re.alpha,this._adaptiveMin=h.min_interval_days?.toString()??re.min,this._adaptiveMax=h.max_interval_days?.toString()??re.max,this._adaptiveSeasonal=h.seasonal_enabled!==!1,this._adaptivePrediction=h.sensor_prediction_enabled!==!1,this._adaptiveInitial=this._adaptiveSnapshot(),t.trigger_config){let _=t.trigger_config;this._triggerEntityId=_.entity_id||_.entity_ids&&_.entity_ids[0]||"",this._triggerEntityIds=_.entity_ids||(_.entity_id?[_.entity_id]:[]),this._triggerEntityLogic=_.entity_logic||"any",this._triggerAttribute=_.attribute||"",this._triggerType=_.type||"threshold",this._triggerAbove=_.trigger_above?.toString()||"",this._triggerBelow=_.trigger_below?.toString()||"",this._triggerEquals=_.trigger_equals?.toString()||"",this._triggerNotEquals=_.trigger_not_equals?.toString()||"",this._triggerForMinutes=_.trigger_for_minutes?.toString()||"0",this._triggerCombinator=_.trigger_combinator==="all"?"all":"any",this._triggerTargetValue=_.trigger_target_value?.toString()||"",this._triggerDeltaMode=_.trigger_delta_mode||!1,this._triggerBaselineValue=_.trigger_baseline_value?.toString()||"",this._liveBaselineValue=t.trigger_baseline_value??null,this._autoCompleteOnRecovery=_.auto_complete_on_recovery||!1,this._triggerFromState=_.trigger_from_state||"",this._triggerToState=_.trigger_to_state||"",this._triggerTargetChanges=_.trigger_target_changes?.toString()||"",this._triggerRuntimeHours=_.trigger_runtime_hours?.toString()||"",this._triggerRuntimeMaxSession=_.trigger_runtime_max_session_seconds?.toString()||"",this._triggerOnStates=(_.trigger_on_states||[]).join(", "),_.type==="compound"?(this._compoundLogic=_.compound_logic==="OR"?"OR":"AND",this._compoundConditions=(_.conditions||[]).map(Hn)):(this._compoundLogic="AND",this._compoundConditions=[])}else this._resetTriggerFields();this._triggerEntityId&&this._fetchEntityAttributes(this._triggerEntityId),await Promise.all([this._loadUsers(),this._loadTags(),this._loadParts(),this._loadForeignPools()]),this._open=!0}_resetFields(){this._name="",this._type="custom",this._scheduleType="time_based",this._intervalDays="30",this._intervalUnit="days",this._dueDate="",this._warningDays=String(this.defaultWarningDays),this._earliestCompletionDays="",this._intervalAnchor="completion",this._weekdays=[],this._nth="1",this._nthWeekday="5",this._domDay="1",this._domLastDay=!1,this._domBusiness=!1,this._calOffset="0",this._seasonMonths=[],this._endsMode="never",this._endsCount="",this._endsUntil="",this._notes="",this._documentationUrl="",this._customIcon="",this._priority="normal",this._labels="",this._enabled=!0,this._lastPerformed="",this._nfcTagId="",this._requireTagScan=!1,this._allowSkip=!0,this._readingUnit="",this._readings=[],this._consumesParts={},this._responsibleUserId=null,this._assigneePool=[],this._rotationStrategy="",this._checklistText="",this._phaseDefs=[],this._phaseSeq=[],this._requiredCompletion=[],this._scheduleTime="",this._scheduleTimeOn=!1,this._environmentalEntity="",this._environmentalAttribute="",this._environmentalInitial="",this._environmentalAttributeInitial="",this._adaptiveEnabled=!1,this._adaptiveAlpha=re.alpha,this._adaptiveMin=re.min,this._adaptiveMax=re.max,this._adaptiveSeasonal=!0,this._adaptivePrediction=!0,this._adaptiveInitial=this._adaptiveSnapshot(),this._actionService="",this._actionTargetEntity="",this._actionData={},this._actionDataJsonFallback="",this._actionTesting=!1,this._actionTestResult="",this._qcNotes="",this._qcCost="",this._qcDuration="",this._qcFeedback="",this._resetTriggerFields()}_resetTriggerFields(){this._triggerEntityId="",this._triggerEntityIds=[],this._triggerEntityLogic="any",this._triggerAttribute="",this._suggestedAttributes
Line truncated
|
||||
`),partId:A?.part_id||"",partQty:A?.quantity!=null?String(A.quantity):"",reqOverride:m.required_completion_fields!==void 0,reqFields:[...m.required_completion_fields||[]],extraParts:z.filter((H,we)=>we!==L).map(H=>({...H})),carry:$}}),this._phaseSeq=[...t.phase_sequence||[]],this._requiredCompletion=[...t.required_completion_fields||[]],this._scheduleTime=t.schedule_time||"",this._scheduleTimeOn=!!t.schedule_time;let l=t.on_complete_action;if(l&&l.service){this._actionService=l.service;let _=l.target?.entity_id;this._actionTargetEntity=Array.isArray(_)?_[0]||"":_||"",this._actionData=l.data&&typeof l.data=="object"?{...l.data}:{},this._actionDataJsonFallback=""}else this._actionService="",this._actionTargetEntity="",this._actionData={},this._actionDataJsonFallback="";let u=t.quick_complete_defaults;this._qcNotes=u?.notes||"",this._qcCost=u?.cost!=null?String(u.cost):"",this._qcDuration=u?.duration!=null?String(u.duration):"",this._qcFeedback=u?.feedback||"";let h=t.adaptive_config||{};if(this._environmentalEntity=h.environmental_entity||"",this._environmentalAttribute=h.environmental_attribute||"",this._environmentalInitial=this._environmentalEntity,this._environmentalAttributeInitial=this._environmentalAttribute,this._adaptiveEnabled=!!h.enabled,this._adaptiveAlpha=h.ewa_alpha?.toString()??re.alpha,this._adaptiveMin=h.min_interval_days?.toString()??re.min,this._adaptiveMax=h.max_interval_days?.toString()??re.max,this._adaptiveSeasonal=h.seasonal_enabled!==!1,this._adaptivePrediction=h.sensor_prediction_enabled!==!1,this._adaptiveInitial=this._adaptiveSnapshot(),t.trigger_config){let _=t.trigger_config;this._triggerEntityId=_.entity_id||_.entity_ids&&_.entity_ids[0]||"",this._triggerEntityIds=_.entity_ids||(_.entity_id?[_.entity_id]:[]),this._triggerEntityLogic=_.entity_logic||"any",this._triggerAttribute=_.attribute||"",this._triggerType=_.type||"threshold",this._triggerAbove=_.trigger_above?.toString()||"",this._triggerBelow=_.trigger_below?.toString()||"",this._triggerEquals=_.trigger_equals?.toString()||"",this._triggerNotEquals=_.trigger_not_equals?.toString()||"",this._triggerForMinutes=_.trigger_for_minutes?.toString()||"0",this._triggerCombinator=_.trigger_combinator==="all"?"all":"any",this._triggerTargetValue=_.trigger_target_value?.toString()||"",this._triggerDeltaMode=_.trigger_delta_mode||!1,this._triggerBaselineValue=_.trigger_baseline_value?.toString()||"",this._liveBaselineValue=t.trigger_baseline_value??null,this._autoCompleteOnRecovery=_.auto_complete_on_recovery||!1,this._triggerFromState=_.trigger_from_state||"",this._triggerToState=_.trigger_to_state||"",this._triggerTargetChanges=_.trigger_target_changes?.toString()||"",this._triggerRuntimeHours=_.trigger_runtime_hours?.toString()||"",this._triggerRuntimeMaxSession=_.trigger_runtime_max_session_seconds?.toString()||"",this._triggerOnStates=(_.trigger_on_states||[]).join(", "),_.type==="compound"?(this._compoundLogic=_.compound_logic==="OR"?"OR":"AND",this._compoundConditions=(_.conditions||[]).map(Hn)):(this._compoundLogic="AND",this._compoundConditions=[])}else this._resetTriggerFields();this._triggerEntityId&&this._fetchEntityAttributes(this._triggerEntityId),await Promise.all([this._loadUsers(),this._loadTags(),this._loadParts(),this._loadForeignPools()]),this._open=!0}_resetFields(){this._name="",this._type="custom",this._scheduleType="time_based",this._intervalDays="30",this._intervalUnit="days",this._dueDate="",this._warningDays=String(this.defaultWarningDays),this._earliestCompletionDays="",this._intervalAnchor="completion",this._weekdays=[],this._nth="1",this._nthWeekday="5",this._domDay="1",this._domLastDay=!1,this._domBusiness=!1,this._calOffset="0",this._seasonMonths=[],this._endsMode="never",this._endsCount="",this._endsUntil="",this._notes="",this._documentationUrl="",this._customIcon="",this._priority="normal",this._labels="",this._mirrorTodoEntities=[],this._enabled=!0,this._lastPerformed="",this._nfcTagId="",this._requireTagScan=!1,this._allowSkip=!0,this._readingUnit="",this._readings=[],this._consumesParts={},this._responsibleUserId=null,this._assigneePool=[],this._rotationStrategy="",this._checklistText="",this._phaseDefs=[],this._phaseSeq=[],this._requiredCompletion=[],this._scheduleTime="",this._scheduleTimeOn=!1,this._environmentalEntity="",this._environmentalAttribute="",this._environmentalInitial="",this._environmentalAttributeInitial="",this._adaptiveEnabled=!1,this._adaptiveAlpha=re.alpha,this._adaptiveMin=re.min,this._adaptiveMax=re.max,this._adaptiveSeasonal=!0,this._adaptivePrediction=!0,this._adaptiveInitial=this._adaptiveSnapshot(),this._actionService="",this._actionTargetEntity="",this._actionData={},this._actionDataJsonFallback="",this._actionTesting=!1,this._actionTestResult="",this._qcNotes="",this._qcCost="",this._qcDuration="",this._qcFeedback="",this._resetTriggerFields()}_resetTriggerFields(){this._triggerEntityId="",this._triggerEntityIds=[],this._triggerEntityLogic="any",this._triggerAttribute=
Line truncated
|
||||
<details class="ca-section">
|
||||
<summary>${n("on_complete_action_title",e)}</summary>
|
||||
<p class="field-help">${n("on_complete_action_desc",e)}</p>
|
||||
@@ -2217,7 +2217,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
||||
</select>
|
||||
</div>
|
||||
`:c}
|
||||
`}async _save(){if(!this._loading&&this._name.trim()){if(this._adaptiveSnapshot()!==this._adaptiveInitial){let e=parseInt(this._adaptiveMin,10),t=parseInt(this._adaptiveMax,10);if(!isNaN(e)&&!isNaN(t)&&e>t){this._error=`${n("adaptive_min_interval",this._lang)} > ${n("adaptive_max_interval",this._lang)}`;return}}if(this._triggerType==="threshold"&&this._thresholdLimitsOverlap()){this._error=n("trigger_hint_overlap",this._lang);return}this._loading=!0,this._error="";try{let e={type:this._taskId?"maintenance_supporter/task/update":"maintenance_supporter/task/create",entry_id:this._entryId,name:this._name,task_type:this._type,schedule_type:this._scheduleType,warning_days:Number.isNaN(parseInt(this._warningDays,10))?this.defaultWarningDays:Math.max(0,parseInt(this._warningDays,10))},t=this._earliestCompletionDays.trim();e.earliest_completion_days=t===""?null:Math.max(0,parseInt(t,10)||0),this._taskId&&(e.task_id=this._taskId),this._scheduleType==="one_time"?(e.due_date=this._dueDate||null,e.interval_days=null):Et.includes(this._scheduleType)?(e.schedule={...this._buildSchedule(),...this._recurrenceExtras()},e.interval_days=null,this._taskId&&(e.due_date=null)):(this._taskId&&(e.due_date=null),this._scheduleType!=="manual"&&this._intervalDays?(e.interval_days=parseInt(this._intervalDays,10),e.interval_unit=this._intervalUnit,e.interval_anchor=this._intervalAnchor,this._scheduleType==="time_based"&&(e.schedule={kind:"interval",...this._recurrenceExtras()})):this._taskId&&(e.interval_days=null,e.interval_anchor="completion")),e.notes=this._notes||null,e.documentation_url=this._documentationUrl||null,e.custom_icon=this._customIcon||null,e.priority=this._priority,e.labels=this._labels.split(",").map(h=>h.trim()).filter(Boolean),e.enabled=this._enabled,e.last_performed=this._lastPerformed||null,e.nfc_tag_id=this._nfcTagId||null,e.require_tag_scan=this._requireTagScan,e.allow_skip=this._allowSkip,e.notify_enabled=this._notifyEnabled,e.reading_unit=this._readingUnit.trim()||null,e.readings=Ar(this._readings);{let h={};for(let m of this._phaseDefs){if(!m.name.trim())continue;let b={...m.carry,name:m.name.trim()},y=m.checklistText.split(`
|
||||
`}async _save(){if(!this._loading&&this._name.trim()){if(this._adaptiveSnapshot()!==this._adaptiveInitial){let e=parseInt(this._adaptiveMin,10),t=parseInt(this._adaptiveMax,10);if(!isNaN(e)&&!isNaN(t)&&e>t){this._error=`${n("adaptive_min_interval",this._lang)} > ${n("adaptive_max_interval",this._lang)}`;return}}if(this._triggerType==="threshold"&&this._thresholdLimitsOverlap()){this._error=n("trigger_hint_overlap",this._lang);return}this._loading=!0,this._error="";try{let e={type:this._taskId?"maintenance_supporter/task/update":"maintenance_supporter/task/create",entry_id:this._entryId,name:this._name,task_type:this._type,schedule_type:this._scheduleType,warning_days:Number.isNaN(parseInt(this._warningDays,10))?this.defaultWarningDays:Math.max(0,parseInt(this._warningDays,10))},t=this._earliestCompletionDays.trim();e.earliest_completion_days=t===""?null:Math.max(0,parseInt(t,10)||0),this._taskId&&(e.task_id=this._taskId),this._scheduleType==="one_time"?(e.due_date=this._dueDate||null,e.interval_days=null):Et.includes(this._scheduleType)?(e.schedule={...this._buildSchedule(),...this._recurrenceExtras()},e.interval_days=null,this._taskId&&(e.due_date=null)):(this._taskId&&(e.due_date=null),this._scheduleType!=="manual"&&this._intervalDays?(e.interval_days=parseInt(this._intervalDays,10),e.interval_unit=this._intervalUnit,e.interval_anchor=this._intervalAnchor,this._scheduleType==="time_based"&&(e.schedule={kind:"interval",...this._recurrenceExtras()})):this._taskId&&(e.interval_days=null,e.interval_anchor="completion")),e.notes=this._notes||null,e.documentation_url=this._documentationUrl||null,e.custom_icon=this._customIcon||null,e.priority=this._priority,e.labels=this._labels.split(",").map(h=>h.trim()).filter(Boolean),e.mirror_todo_entities=this._mirrorTodoEntities.filter(Boolean),e.enabled=this._enabled,e.last_performed=this._lastPerformed||null,e.nfc_tag_id=this._nfcTagId||null,e.require_tag_scan=this._requireTagScan,e.allow_skip=this._allowSkip,e.notify_enabled=this._notifyEnabled,e.reading_unit=this._readingUnit.trim()||null,e.readings=Ar(this._readings);{let h={};for(let m of this._phaseDefs){if(!m.name.trim())continue;let b={...m.carry,name:m.name.trim()},y=m.checklistText.split(`
|
||||
`).map(g=>g.trim()).filter(Boolean);y.length&&(b.checklist=y);let x=[];if(m.partId){let g=parseFloat(m.partQty);x.push({part_id:m.partId,quantity:Number.isFinite(g)&&g>0?g:1})}for(let g of m.extraParts)x.push(g.entry_id?{part_id:g.part_id,quantity:g.quantity,entry_id:g.entry_id}:{part_id:g.part_id,quantity:g.quantity});x.length&&(b.consumes_parts=x),m.reqOverride&&(b.required_completion_fields=[...m.reqFields]),h[m.id]=b}let _=this._phaseSeq.filter(m=>m in h);e.phases=Object.keys(h).length&&_.length?h:null,e.phase_sequence=e.phases?_:null}if((this.parts.length||this._foreignOwners.length)&&(e.consumes_parts=Object.values(this._consumesParts).map(h=>h.entry_id?{part_id:h.part_id,quantity:h.quantity,entry_id:h.entry_id}:{part_id:h.part_id,quantity:h.quantity})),e.responsible_user_id=this._responsibleUserId,e.assignee_pool=this._assigneePool,e.required_completion_fields=this._requiredCompletion,e.rotation_strategy=this._assigneePool.length>=2&&this._rotationStrategy?this._rotationStrategy:null,this._scheduleType==="sensor_based"&&this._triggerType==="compound"){let h=this._compoundConditions.map(On).filter(_=>_!==null);if(h.length>0){let _={type:"compound",compound_logic:this._compoundLogic,conditions:h};this._autoCompleteOnRecovery&&(_.auto_complete_on_recovery=!0),this._triggerCombinator==="all"&&(_.trigger_combinator="all"),e.trigger_config=_}else this._taskId&&(e.trigger_config=null)}else if(this._scheduleType==="sensor_based"&&this._triggerEntityId){let h=this._triggerEntityIds.length>0?this._triggerEntityIds:[this._triggerEntityId],_={entity_id:h[0],entity_ids:h,type:this._triggerType};if(this._triggerAttribute&&(_.attribute=this._triggerAttribute),this._autoCompleteOnRecovery&&(_.auto_complete_on_recovery=!0),this._triggerCombinator==="all"&&(_.trigger_combinator="all"),h.length>1&&(_.entity_logic=this._triggerEntityLogic),this._triggerType==="threshold"){if(this._triggerAbove){let m=parseFloat(this._triggerAbove);isNaN(m)||(_.trigger_above=m)}if(this._triggerBelow){let m=parseFloat(this._triggerBelow);isNaN(m)||(_.trigger_below=m)}if(this._triggerEquals){let m=parseFloat(this._triggerEquals);isNaN(m)||(_.trigger_equals=m)}if(this._triggerNotEquals){let m=parseFloat(this._triggerNotEquals);isNaN(m)||(_.trigger_not_equals=m)}if(this._triggerForMinutes){let m=parseInt(this._triggerForMinutes,10);isNaN(m)||(_.trigger_for_minutes=m)}}else if(this._triggerType==="counter"){if(this._triggerTargetValue){let m=parseFloat(this._triggerTargetValue);isNaN(m)||(_.trigger_target_value=m)}if(_.trigger_delta_mode=this._triggerDeltaMode,this._triggerDeltaMode&&this._triggerBaselineValue){let m=parseFloat(this._triggerBaselineValue);!isNaN(m)&&m>=0&&(_.trigger_baseline_value=m)}}else if(this._triggerType==="state_change"){if(this._triggerFromState&&(_.trigger_from_state=this._triggerFromState),this._triggerToState&&(_.trigger_to_state=this._triggerToState),this._triggerTargetChanges){let m=parseInt(this._triggerTargetChanges,10);isNaN(m)||(_.trigger_target_changes=m)}if(this._triggerForMinutes){let m=parseInt(this._triggerForMinutes,10);isNaN(m)||(_.trigger_for_minutes=m)}}else if(this._triggerType==="runtime"){if(this._triggerRuntimeHours){let b=parseFloat(this._triggerRuntimeHours);isNaN(b)||(_.trigger_runtime_hours=b)}if(this._triggerRuntimeMaxSession){let b=parseInt(this._triggerRuntimeMaxSession,10);!isNaN(b)&&b>0&&(_.trigger_runtime_max_session_seconds=b)}let m=this._triggerOnStates.split(",").map(b=>b.trim()).filter(Boolean);m.length>0&&(_.trigger_on_states=m)}e.trigger_config=_}else this._taskId&&(e.trigger_config=null);if(this.scheduleTimeEnabled&&Br.includes(this._scheduleType)){let h=this._scheduleTimeOn?this._scheduleTime.trim():"";e.schedule_time=/^([01]\d|2[0-3]):[0-5]\d$/.test(h)?h:null}if(this.checklistsEnabled){let h=this._checklistText.split(`
|
||||
`).map(_=>_.trim()).filter(Boolean).slice(0,100);e.checklist=h.length?h:null}if(this.completionActionsEnabled){let h=this._actionService.trim();if(h&&/^[a-z][a-z0-9_]*\.[a-z0-9_]+$/.test(h)){let y={service:h},x=this._actionTargetEntity.trim();x&&(y.target={entity_id:x});let g=this._buildActionData();Object.keys(g).length>0&&(y.data=g),e.on_complete_action=y}else e.on_complete_action=null;let _={};this._qcNotes.trim()&&(_.notes=this._qcNotes.trim());let m=parseFloat(this._qcCost);!isNaN(m)&&m>=0&&(_.cost=m);let b=parseInt(this._qcDuration,10);!isNaN(b)&&b>=0&&(_.duration=b),this._qcFeedback&&(_.feedback=this._qcFeedback),e.quick_complete_defaults=Object.keys(_).length?_:null}let i=await this.hass.connection.sendMessagePromise(e),a=this._taskId||i?.task_id,l=this._environmentalEntity!==this._environmentalInitial||this._environmentalAttribute!==this._environmentalAttributeInitial;this._warning="";let u=h=>{this._warning=n("subsave_warning",this._lang).replace("{detail}",h)};if(a&&this._scheduleType==="sensor_based"&&l&&await ui(this,{type:"maintenance_supporter/task/set_environmental_entity",entry_id:this._entryId,task_id:a,environmental_entity:this._environmentalEntity||null,environmental_attribute:this._environmentalAttribute||null},{onError:u})!==void 0&&(this._environmentalInitial=this._environmentalEntity,this._environmentalAttributeInitial=this._environmentalAttribute),a&&this._adaptiveSnapshot()!==this._adaptiveInitial){let h=parseFloat(this._adaptiveAlpha),_=parseInt(this._adaptiveMin,10),m=parseInt(this._adaptiveMax,10);await ui(this,{type:"maintenance_supporter/task/set_adaptive",entry_id:this._entryId,task_id:a,enabled:this._adaptiveEnabled,...h>=.1&&h<=.9?{ewa_alpha:h}:{},...!isNaN(_)&&_>=1?{min_interval_days:_}:{},...!isNaN(m)&&m>=1?{max_interval_days:m}:{},seasonal_enabled:this._adaptiveSeasonal,sensor_prediction_enabled:this._adaptivePrediction},{onError:u})!==void 0&&(this._adaptiveInitial=this._adaptiveSnapshot())}this._warning?a&&(this._taskId=a):this._open=!1,this.dispatchEvent(new CustomEvent("task-saved"))}catch(e){this._error=R(e,this._lang,n("save_error",this._lang))}finally{this._loading=!1}}}_close(){this._open=!1,this._warning="",this._pickerProbeTimer!==void 0&&(clearTimeout(this._pickerProbeTimer),this._pickerProbeTimer=void 0),this._pickerProbeStrikes=0}_renderTriggerFields(){if(this._scheduleType!=="sensor_based")return c;let e=this._lang,t=this._triggerType==="compound";return o`
|
||||
<h3>${n("trigger_configuration",e)}</h3>
|
||||
@@ -2758,6 +2758,25 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
||||
/>
|
||||
<div class="field-help">${n("labels_help",e)}</div>
|
||||
</div>
|
||||
<div class="field mirror-todo-field">
|
||||
${this._entityPickerFallback?o`
|
||||
<ms-textfield
|
||||
label="${n("task_mirror_todo",e)}"
|
||||
placeholder="todo.family, todo.kids"
|
||||
.value=${this._mirrorTodoEntities.join(", ")}
|
||||
@input=${i=>{this._mirrorTodoEntities=i.target.value.split(",").map(a=>a.trim()).filter(Boolean)}}
|
||||
></ms-textfield>
|
||||
`:o`
|
||||
<ha-form
|
||||
class="entity-picker-form"
|
||||
.hass=${this.hass}
|
||||
.schema=${[{name:"mirror_todo_entities",selector:{entity:{multiple:!0,domain:["todo"]}}}]}
|
||||
.data=${{mirror_todo_entities:this._mirrorTodoEntities}}
|
||||
.computeLabel=${()=>n("task_mirror_todo",e)}
|
||||
@value-changed=${i=>{let a=(i.detail.value.mirror_todo_entities||[]).filter(Boolean);this._mirrorTodoEntities=a}}
|
||||
></ha-form>`}
|
||||
<div class="field-help">${n("task_mirror_todo_hint",e)}</div>
|
||||
</div>
|
||||
<div class="select-row">
|
||||
<label>${n("schedule_type",e)}</label>
|
||||
<select
|
||||
@@ -3415,7 +3434,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
}
|
||||
`,d([v({attribute:!1})],f.prototype,"hass",2),d([v({type:Boolean,attribute:"checklists-enabled"})],f.prototype,"checklistsEnabled",2),d([v({type:Boolean,attribute:"schedule-time-enabled"})],f.prototype,"scheduleTimeEnabled",2),d([v({type:Boolean,attribute:"completion-actions-enabled"})],f.prototype,"completionActionsEnabled",2),d([v({type:Number,attribute:"default-warning-days"})],f.prototype,"defaultWarningDays",2),d([p()],f.prototype,"parts",2),d([p()],f.prototype,"_foreignOwners",2),d([p()],f.prototype,"_open",2),d([p()],f.prototype,"_entityPickerFallback",2),d([p()],f.prototype,"_loading",2),d([p()],f.prototype,"_error",2),d([p()],f.prototype,"_warning",2),d([p()],f.prototype,"_entryId",2),d([p()],f.prototype,"_taskId",2),d([p()],f.prototype,"_objectChoices",2),d([p()],f.prototype,"_name",2),d([p()],f.prototype,"_type",2),d([p()],f.prototype,"_scheduleType",2),d([p()],f.prototype,"_intervalDays",2),d([p()],f.prototype,"_intervalUnit",2),d([p()],f.prototype,"_dueDate",2),d([p()],f.prototype,"_warningDays",2),d([p()],f.prototype,"_earliestCompletionDays",2),d([p()],f.prototype,"_intervalAnchor",2),d([p()],f.prototype,"_weekdays",2),d([p()],f.prototype,"_nth",2),d([p()],f.prototype,"_nthWeekday",2),d([p()],f.prototype,"_domDay",2),d([p()],f.prototype,"_domLastDay",2),d([p()],f.prototype,"_domBusiness",2),d([p()],f.prototype,"_calOffset",2),d([p()],f.prototype,"_seasonMonths",2),d([p()],f.prototype,"_endsMode",2),d([p()],f.prototype,"_endsCount",2),d([p()],f.prototype,"_endsUntil",2),d([p()],f.prototype,"_schedulePreview",2),d([p()],f.prototype,"_schedulePreviewEnded",2),d([p()],f.prototype,"_notes",2),d([p()],f.prototype,"_documentationUrl",2),d([p()],f.prototype,"_customIcon",2),d([p()],f.prototype,"_priority",2),d([p()],f.prototype,"_labels",2),d([p()],f.prototype,"_enabled",2),d([p()],f.prototype,"_triggerEntityId",2),d([p()],f.prototype,"_triggerEntityIds",2),d([p()],f.prototype,"_triggerEntityLogic",2),d([p()],f.prototype,"_triggerAttribute",2),d([p()],f.prototype,"_triggerType",2),d([p()],f.prototype,"_triggerAbove",2),d([p()],f.prototype,"_triggerBelow",2),d([p()],f.prototype,"_triggerEquals",2),d([p()],f.prototype,"_triggerNotEquals",2),d([p()],f.prototype,"_triggerForMinutes",2),d([p()],f.prototype,"_triggerCombinator",2),d([p()],f.prototype,"_triggerTargetValue",2),d([p()],f.prototype,"_triggerDeltaMode",2),d([p()],f.prototype,"_triggerBaselineValue",2),d([p()],f.prototype,"_liveBaselineValue",2),d([p()],f.prototype,"_autoCompleteOnRecovery",2),d([p()],f.prototype,"_triggerFromState",2),d([p()],f.prototype,"_triggerToState",2),d([p()],f.prototype,"_triggerTargetChanges",2),d([p()],f.prototype,"_triggerRuntimeHours",2),d([p()],f.prototype,"_triggerRuntimeMaxSession",2),d([p()],f.prototype,"_triggerOnStates",2),d([p()],f.prototype,"_compoundLogic",2),d([p()],f.prototype,"_compoundConditions",2),d([p()],f.prototype,"_suggestedAttributes",2),d([p()],f.prototype,"_availableAttributes",2),d([p()],f.prototype,"_entityDomain",2),d([p()],f.prototype,"_lastPerformed",2),d([p()],f.prototype,"_nfcTagId",2),d([p()],f.prototype,"_requireTagScan",2),d([p()],f.prototype,"_allowSkip",2),d([p()],f.prototype,"_notifyEnabled",2),d([p()],f.prototype,"_readingUnit",2),d([p()],f.prototype,"_readings",2),d([p()],f.prototype,"_consumesParts",2),d([p()],f.prototype,"_partsLoadFailed",2),d([p()],f.prototype,"_availableTags",2),d([p()],f.prototype,"_responsibleUserId",2),d([p()],f.prototype,"_assigneePool",2),d([p()],f.prototype,"_rotationStrategy",2),d([p()],f.prototype,"_availableUsers",2),d([p()],f.prototype,"_checklistText",2),d([p()],f.prototype,"_phaseDefs",2),d([p()],f.prototype,"_phaseSeq",2),d([p()],f.prototype,"_requiredCompletion",2),d([p()],f.prototype,"_scheduleTime",2),d([p()],f.prototype,"_scheduleTimeOn",2),d([p()],f.prototype,"_actionService",2),d([p()],f.prototype,"_actionTargetEntity",2),d([p()],f.prototype,"_actionData",2),d([p()],f.prototype,"_actionDataJsonFallback",2),d([p()],f.prototype,"_actionTesting",2),d([p()],f.prototype,"_actionTestResult",2),d([p()],f.prototype,"_actionTestError",2),d([p()],f.prototype,"_qcNotes",2),d([p()],f.prototype,"_qcCost",2),d([p()],f.prototype,"_qcDuration",2),d([p()],f.prototype,"_qcFeedback",2),d([p()],f.prototype,"_environmentalEntity",2),d([p()],f.prototype,"_environmentalAttribute",2),d([p()],f.prototype,"_adaptiveEnabled",2),d([p()],f.prototype,"_adaptiveAlpha",2),d([p()],f.prototype,"_adaptiveMin",2),d([p()],f.prototype,"_adaptiveMax",2),d([p()],f.prototype,"_adaptiveSeasonal",2),d([p()],f.prototype,"_adaptivePrediction",2),d([p()],f.prototype,"_conditionAttrOptions",2);_i=f;customElements.get("maintenance-task-dialog")||customElements.define("maintenance-task-dialog",_i)});var ue,mi=w(()=>{"use strict";I();q();Qt();ue=class extends E{constructor(){super(...arguments);this.docId="";this._url="";this._failed=!1;this._signedFor=""}updated(){this.hass&&this.docId&&this._signedFor!==this.docId&&(this._signedFor=this.docId,this._url="",this._failed=!1,this._sign()
Line truncated
|
||||
`,d([v({attribute:!1})],f.prototype,"hass",2),d([v({type:Boolean,attribute:"checklists-enabled"})],f.prototype,"checklistsEnabled",2),d([v({type:Boolean,attribute:"schedule-time-enabled"})],f.prototype,"scheduleTimeEnabled",2),d([v({type:Boolean,attribute:"completion-actions-enabled"})],f.prototype,"completionActionsEnabled",2),d([v({type:Number,attribute:"default-warning-days"})],f.prototype,"defaultWarningDays",2),d([p()],f.prototype,"parts",2),d([p()],f.prototype,"_foreignOwners",2),d([p()],f.prototype,"_open",2),d([p()],f.prototype,"_entityPickerFallback",2),d([p()],f.prototype,"_loading",2),d([p()],f.prototype,"_error",2),d([p()],f.prototype,"_warning",2),d([p()],f.prototype,"_entryId",2),d([p()],f.prototype,"_taskId",2),d([p()],f.prototype,"_objectChoices",2),d([p()],f.prototype,"_name",2),d([p()],f.prototype,"_type",2),d([p()],f.prototype,"_scheduleType",2),d([p()],f.prototype,"_intervalDays",2),d([p()],f.prototype,"_intervalUnit",2),d([p()],f.prototype,"_dueDate",2),d([p()],f.prototype,"_warningDays",2),d([p()],f.prototype,"_earliestCompletionDays",2),d([p()],f.prototype,"_intervalAnchor",2),d([p()],f.prototype,"_weekdays",2),d([p()],f.prototype,"_nth",2),d([p()],f.prototype,"_nthWeekday",2),d([p()],f.prototype,"_domDay",2),d([p()],f.prototype,"_domLastDay",2),d([p()],f.prototype,"_domBusiness",2),d([p()],f.prototype,"_calOffset",2),d([p()],f.prototype,"_seasonMonths",2),d([p()],f.prototype,"_endsMode",2),d([p()],f.prototype,"_endsCount",2),d([p()],f.prototype,"_endsUntil",2),d([p()],f.prototype,"_schedulePreview",2),d([p()],f.prototype,"_schedulePreviewEnded",2),d([p()],f.prototype,"_notes",2),d([p()],f.prototype,"_documentationUrl",2),d([p()],f.prototype,"_customIcon",2),d([p()],f.prototype,"_priority",2),d([p()],f.prototype,"_labels",2),d([p()],f.prototype,"_mirrorTodoEntities",2),d([p()],f.prototype,"_enabled",2),d([p()],f.prototype,"_triggerEntityId",2),d([p()],f.prototype,"_triggerEntityIds",2),d([p()],f.prototype,"_triggerEntityLogic",2),d([p()],f.prototype,"_triggerAttribute",2),d([p()],f.prototype,"_triggerType",2),d([p()],f.prototype,"_triggerAbove",2),d([p()],f.prototype,"_triggerBelow",2),d([p()],f.prototype,"_triggerEquals",2),d([p()],f.prototype,"_triggerNotEquals",2),d([p()],f.prototype,"_triggerForMinutes",2),d([p()],f.prototype,"_triggerCombinator",2),d([p()],f.prototype,"_triggerTargetValue",2),d([p()],f.prototype,"_triggerDeltaMode",2),d([p()],f.prototype,"_triggerBaselineValue",2),d([p()],f.prototype,"_liveBaselineValue",2),d([p()],f.prototype,"_autoCompleteOnRecovery",2),d([p()],f.prototype,"_triggerFromState",2),d([p()],f.prototype,"_triggerToState",2),d([p()],f.prototype,"_triggerTargetChanges",2),d([p()],f.prototype,"_triggerRuntimeHours",2),d([p()],f.prototype,"_triggerRuntimeMaxSession",2),d([p()],f.prototype,"_triggerOnStates",2),d([p()],f.prototype,"_compoundLogic",2),d([p()],f.prototype,"_compoundConditions",2),d([p()],f.prototype,"_suggestedAttributes",2),d([p()],f.prototype,"_availableAttributes",2),d([p()],f.prototype,"_entityDomain",2),d([p()],f.prototype,"_lastPerformed",2),d([p()],f.prototype,"_nfcTagId",2),d([p()],f.prototype,"_requireTagScan",2),d([p()],f.prototype,"_allowSkip",2),d([p()],f.prototype,"_notifyEnabled",2),d([p()],f.prototype,"_readingUnit",2),d([p()],f.prototype,"_readings",2),d([p()],f.prototype,"_consumesParts",2),d([p()],f.prototype,"_partsLoadFailed",2),d([p()],f.prototype,"_availableTags",2),d([p()],f.prototype,"_responsibleUserId",2),d([p()],f.prototype,"_assigneePool",2),d([p()],f.prototype,"_rotationStrategy",2),d([p()],f.prototype,"_availableUsers",2),d([p()],f.prototype,"_checklistText",2),d([p()],f.prototype,"_phaseDefs",2),d([p()],f.prototype,"_phaseSeq",2),d([p()],f.prototype,"_requiredCompletion",2),d([p()],f.prototype,"_scheduleTime",2),d([p()],f.prototype,"_scheduleTimeOn",2),d([p()],f.prototype,"_actionService",2),d([p()],f.prototype,"_actionTargetEntity",2),d([p()],f.prototype,"_actionData",2),d([p()],f.prototype,"_actionDataJsonFallback",2),d([p()],f.prototype,"_actionTesting",2),d([p()],f.prototype,"_actionTestResult",2),d([p()],f.prototype,"_actionTestError",2),d([p()],f.prototype,"_qcNotes",2),d([p()],f.prototype,"_qcCost",2),d([p()],f.prototype,"_qcDuration",2),d([p()],f.prototype,"_qcFeedback",2),d([p()],f.prototype,"_environmentalEntity",2),d([p()],f.prototype,"_environmentalAttribute",2),d([p()],f.prototype,"_adaptiveEnabled",2),d([p()],f.prototype,"_adaptiveAlpha",2),d([p()],f.prototype,"_adaptiveMin",2),d([p()],f.prototype,"_adaptiveMax",2),d([p()],f.prototype,"_adaptiveSeasonal",2),d([p()],f.prototype,"_adaptivePrediction",2),d([p()],f.prototype,"_conditionAttrOptions",2);_i=f;customElements.get("maintenance-task-dialog")||customElements.define("maintenance-task-dialog",_i)});var ue,mi=w(()=>{"use strict";I();q();Qt();ue=class extends E{constructor(){super(...arguments);this.docId="";this._url="";this._failed=!1;this._signedFor=""}updated(){this.hass&&this.docId&&this._signedFor!==this.docId&&(this._signedFor=this.do
Line truncated
|
||||
<a href=${this._url} target="_blank" rel="noopener" class="wrap">
|
||||
<img src=${this._url} alt="" loading="lazy"
|
||||
@error=${()=>this._failed=!0} />
|
||||
@@ -4542,7 +4561,7 @@ ${h?`<div class="sub">${h}</div>`:""}
|
||||
.btn ha-icon { --mdc-icon-size: 16px; }
|
||||
.loading { padding: 24px; text-align: center; color: var(--secondary-text-color); }
|
||||
.error { padding: 8px; border-radius: 6px; background: rgba(211,47,47,0.1); color: var(--error-color); font-size: 13px; }
|
||||
`,d([v({attribute:!1})],X.prototype,"hass",2),d([p()],X.prototype,"_open",2),d([p()],X.prototype,"_entryId",2),d([p()],X.prototype,"_data",2),d([p()],X.prototype,"_busy",2),d([p()],X.prototype,"_error",2);customElements.get("maintenance-object-quick-actions-dialog")||customElements.define("maintenance-object-quick-actions-dialog",X)});function xs(){let s=window;return s.__msSettingsCache??={promise:null}}function St(s){let r=xs();if(r.promise)return r.promise;let e=s.connection.sendMessagePromise({type:"maintenance_supporter/settings"}).then(t=>({features:t.features??fi.features,defaultWarningDays:t.general?.default_warning_days??7,rowActionStyle:t.general?.row_action_style??fi.rowActionStyle})).catch(()=>(r.promise===e&&(r.promise=null),fi));return r.promise=e,e}function ws(){xs().promise=null}var fi,$s=w(()=>{"use strict";fi={features:{adaptive:!1,predictions:!1,seasonal:!1,environmental:!1,budget:!1,groups:!1,checklists:!1,schedule_time:!1,completion_actions:!1},defaultWarningDays:7,rowActionStyle:"buttons_compact"}});var se={};Ps(se,{__resetSettingsCacheForTests:()=>ra,getRowActionStyle:()=>vi,openCompleteDialog:()=>oa,openCreateObjectDialog:()=>bi,openCreateTaskDialog:()=>yi,openEditObjectDialog:()=>sa,openEditTaskDialog:()=>na,openHistoryEditDialog:()=>aa,openObjectQuickActions:()=>da,openQrDialog:()=>la,openTaskQuickActions:()=>xi});function Tt(){return document.querySelector("home-assistant")?.hass}function ia(){return document.querySelector("home-assistant")?.shadowRoot??document.body}function ne(s){let r=ia(),e=r.querySelector(s)??document.body.querySelector(s);return e?e.parentNode!==r&&r.appendChild(e):(e=document.createElement(s),r.appendChild(e)),e}function ae(s){let r=Tt();if(!r)return!1;s.hass=r;let e=P(r);return Vt(e)||Je(e).then(()=>{s.requestUpdate?.()}),Wt(r.locale,r.config?.country),!0}function vi(s){return St(s).then(r=>r.rowActionStyle)}function ra(){ws()}function bi(){let s=ne(ks);return ae(s)?(s.openCreate(),!0):!1}function sa(s,r){let e=ne(ks);return ae(e)?(e.openEdit(s,r),!0):!1}function yi(s="",r){let e=ne(Es);if(!ae(e))return!1;let t=Tt();return t?((async()=>{let i=await St(t),a=e;a.checklistsEnabled=i.features.checklists,a.scheduleTimeEnabled=i.features.schedule_time,a.completionActionsEnabled=i.features.completion_actions,a.defaultWarningDays=i.defaultWarningDays,a.openCreate(s,r)})(),!0):!1}function na(s,r){let e=ne(Es);if(!ae(e))return!1;let t=Tt();return t?((async()=>{try{let[i,a]=await Promise.all([t.connection.sendMessagePromise({type:"maintenance_supporter/object",entry_id:s}),St(t)]),l=(i.tasks||[]).find(h=>h.id===r);if(!l){console.warn(`openEditTaskDialog: task ${r} not found in entry ${s}`);return}let u=e;u.checklistsEnabled=a.features.checklists,u.scheduleTimeEnabled=a.features.schedule_time,u.completionActionsEnabled=a.features.completion_actions,u.defaultWarningDays=a.defaultWarningDays,await u.openEdit(s,l)}catch(i){console.warn("openEditTaskDialog: failed to load task/features",i)}})(),!0):!1}function aa(s){let r=ne(Jn);return ae(r)?(r.openEdit(s),!0):!1}function oa(s){let r=ne(Zn);return ae(r)?(Xe(r,s,P(Tt())),!0):!1}function la(s){let r=ne(Xn);return ae(r)?(r.openForTask(s.entry_id,s.task_id,s.object_name,s.task_name),!0):!1}function xi(s,r){let e=ne(ea);return ae(e)?(e.openFor(s,r),!0):!1}function da(s){let r=ne(ta);return ae(r)?(r.openFor(s),!0):!1}var ks,Es,Jn,Zn,Xn,ea,ta,Z=w(()=>{"use strict";Dr();Wr();di();Kr();Gr();fs();ys();C();bt();$s();ks="maintenance-object-dialog",Es="maintenance-task-dialog",Jn="maintenance-history-edit-dialog",Zn="maintenance-complete-dialog",Xn="maintenance-qr-dialog",ea="maintenance-task-quick-actions-dialog",ta="maintenance-object-quick-actions-dialog"});I();var Ws=["assignee_pool","required_completion_fields","checklist","labels","history","readings"],Ks=["checklist_progress"],Ys=["tasks","parts"],Gs=["manual_docs","battery_fleet_excluded"];function zt(s,r,e=[]){for(let t of r)s[t]===void 0&&(s[t]=[]);for(let t of e)s[t]===void 0&&(s[t]={})}function Qs(s){let r=s;zt(r,Ys),r.object&&typeof r.object=="object"&&zt(r.object,Gs);for(let e of r.tasks)zt(e,Ws,Ks);return s}function We(s){for(let r of s)Qs(r);return s}function Js(s,r){if(r.objects)return r.objects;let e=r.delta||[],t=r.removed||[];if(!e.length&&!t.length)return null;let i=new Map(s.map(a=>[a.entry_id,a]));for(let a of e)i.set(a.entry_id,a);for(let a of t)i.delete(a);return[...i.values()]}function Yi(s,r){return r.objects&&We(r.objects),r.delta&&We(r.delta),Js(s,r)}q();C();Qt();Jt();function Ce(s){let r=window;r.customCards=r.customCards||[],r.customCards.some(e=>e.type===s.type)||r.customCards.push(s)}ei();Xt();ft();bt();I();q();C();var gn=["overdue","triggered","due_soon","ok"],J=class extends E{constructor(){super(...arguments);this._config={type:"custom:maintenance-supporter-card"};this._objects=[];this._loadingObjects=!0;this._loadError=!1;this._views=[];this._objectsLoaded=!1;this._onEntitiesChanged=e=>{this._valueChanged("entity_ids",e.detail.value||[])}}get _l
Line truncated
|
||||
`,d([v({attribute:!1})],X.prototype,"hass",2),d([p()],X.prototype,"_open",2),d([p()],X.prototype,"_entryId",2),d([p()],X.prototype,"_data",2),d([p()],X.prototype,"_busy",2),d([p()],X.prototype,"_error",2);customElements.get("maintenance-object-quick-actions-dialog")||customElements.define("maintenance-object-quick-actions-dialog",X)});function xs(){let s=window;return s.__msSettingsCache??={promise:null}}function St(s){let r=xs();if(r.promise)return r.promise;let e=s.connection.sendMessagePromise({type:"maintenance_supporter/settings"}).then(t=>({features:t.features??fi.features,defaultWarningDays:t.general?.default_warning_days??7,rowActionStyle:t.general?.row_action_style??fi.rowActionStyle})).catch(()=>(r.promise===e&&(r.promise=null),fi));return r.promise=e,e}function ws(){xs().promise=null}var fi,$s=w(()=>{"use strict";fi={features:{adaptive:!1,predictions:!1,seasonal:!1,environmental:!1,budget:!1,groups:!1,checklists:!1,schedule_time:!1,completion_actions:!1},defaultWarningDays:7,rowActionStyle:"buttons_compact"}});var se={};Ps(se,{__resetSettingsCacheForTests:()=>ra,getRowActionStyle:()=>vi,openCompleteDialog:()=>oa,openCreateObjectDialog:()=>bi,openCreateTaskDialog:()=>yi,openEditObjectDialog:()=>sa,openEditTaskDialog:()=>na,openHistoryEditDialog:()=>aa,openObjectQuickActions:()=>da,openQrDialog:()=>la,openTaskQuickActions:()=>xi});function Tt(){return document.querySelector("home-assistant")?.hass}function ia(){return document.querySelector("home-assistant")?.shadowRoot??document.body}function ne(s){let r=ia(),e=r.querySelector(s)??document.body.querySelector(s);return e?e.parentNode!==r&&r.appendChild(e):(e=document.createElement(s),r.appendChild(e)),e}function ae(s){let r=Tt();if(!r)return!1;s.hass=r;let e=P(r);return Vt(e)||Je(e).then(()=>{s.requestUpdate?.()}),Wt(r.locale,r.config?.country),!0}function vi(s){return St(s).then(r=>r.rowActionStyle)}function ra(){ws()}function bi(){let s=ne(ks);return ae(s)?(s.openCreate(),!0):!1}function sa(s,r){let e=ne(ks);return ae(e)?(e.openEdit(s,r),!0):!1}function yi(s="",r){let e=ne(Es);if(!ae(e))return!1;let t=Tt();return t?((async()=>{let i=await St(t),a=e;a.checklistsEnabled=i.features.checklists,a.scheduleTimeEnabled=i.features.schedule_time,a.completionActionsEnabled=i.features.completion_actions,a.defaultWarningDays=i.defaultWarningDays,a.openCreate(s,r)})(),!0):!1}function na(s,r){let e=ne(Es);if(!ae(e))return!1;let t=Tt();return t?((async()=>{try{let[i,a]=await Promise.all([t.connection.sendMessagePromise({type:"maintenance_supporter/object",entry_id:s}),St(t)]),l=(i.tasks||[]).find(h=>h.id===r);if(!l){console.warn(`openEditTaskDialog: task ${r} not found in entry ${s}`);return}let u=e;u.checklistsEnabled=a.features.checklists,u.scheduleTimeEnabled=a.features.schedule_time,u.completionActionsEnabled=a.features.completion_actions,u.defaultWarningDays=a.defaultWarningDays,await u.openEdit(s,l)}catch(i){console.warn("openEditTaskDialog: failed to load task/features",i)}})(),!0):!1}function aa(s){let r=ne(Jn);return ae(r)?(r.openEdit(s),!0):!1}function oa(s){let r=ne(Zn);return ae(r)?(Xe(r,s,P(Tt())),!0):!1}function la(s){let r=ne(Xn);return ae(r)?(r.openForTask(s.entry_id,s.task_id,s.object_name,s.task_name),!0):!1}function xi(s,r){let e=ne(ea);return ae(e)?(e.openFor(s,r),!0):!1}function da(s){let r=ne(ta);return ae(r)?(r.openFor(s),!0):!1}var ks,Es,Jn,Zn,Xn,ea,ta,Z=w(()=>{"use strict";Dr();Wr();di();Kr();Gr();fs();ys();C();bt();$s();ks="maintenance-object-dialog",Es="maintenance-task-dialog",Jn="maintenance-history-edit-dialog",Zn="maintenance-complete-dialog",Xn="maintenance-qr-dialog",ea="maintenance-task-quick-actions-dialog",ta="maintenance-object-quick-actions-dialog"});I();var Ws=["assignee_pool","required_completion_fields","checklist","labels","mirror_todo_entities","history","readings"],Ks=["checklist_progress"],Ys=["tasks","parts"],Gs=["manual_docs","battery_fleet_excluded"];function zt(s,r,e=[]){for(let t of r)s[t]===void 0&&(s[t]=[]);for(let t of e)s[t]===void 0&&(s[t]={})}function Qs(s){let r=s;zt(r,Ys),r.object&&typeof r.object=="object"&&zt(r.object,Gs);for(let e of r.tasks)zt(e,Ws,Ks);return s}function We(s){for(let r of s)Qs(r);return s}function Js(s,r){if(r.objects)return r.objects;let e=r.delta||[],t=r.removed||[];if(!e.length&&!t.length)return null;let i=new Map(s.map(a=>[a.entry_id,a]));for(let a of e)i.set(a.entry_id,a);for(let a of t)i.delete(a);return[...i.values()]}function Yi(s,r){return r.objects&&We(r.objects),r.delta&&We(r.delta),Js(s,r)}q();C();Qt();Jt();function Ce(s){let r=window;r.customCards=r.customCards||[],r.customCards.some(e=>e.type===s.type)||r.customCards.push(s)}ei();Xt();ft();bt();I();q();C();var gn=["overdue","triggered","due_soon","ok"],J=class extends E{constructor(){super(...arguments);this._config={type:"custom:maintenance-supporter-card"};this._objects=[];this._loadingObjects=!0;this._loadError=!1;this._views=[];this._objectsLoaded=!1;this._onEntitiesChanged=e=>{this._valueChanged("entity_ids",e.de
Line truncated
|
||||
<div class="editor">
|
||||
<ha-textfield
|
||||
label="${n("card_title",e)}"
|
||||
@@ -4823,7 +4842,7 @@ ${h?`<div class="sub">${h}</div>`:""}
|
||||
@click=${()=>this._toggleTypeFilter(t)}
|
||||
>
|
||||
${i}× ${t}
|
||||
</button>`)}_toggleTypeFilter(e){if(this._typeFilter=this._typeFilter===e?null:e,this._typeFilter!==null){let t=this.shadowRoot?.querySelector("details.bf-roster");t&&!t.open&&(t.open=!0)}}async _recordJump(e,t){if(!this._marking){this._marking=!0,this._error="";try{await this.hass.callService("battery_notes","set_battery_replaced",{device_id:t.device_id,datetime_replaced:new Date(t.at*1e3).toISOString()}),this._recorded=[...this._recorded,e],await this._load()}catch(i){this._error=R(i,this._lang)}finally{this._marking=!1}}}_levelBar(e){let t=e.level;if(t==null)return c;let i=e.low_threshold??20,a=t<=i?"bad":t<=i+20?"warn":"good";return o`<span class="bf-bar" aria-hidden="true"
|
||||
</button>`)}_toggleTypeFilter(e){if(this._typeFilter=this._typeFilter===e?null:e,this._typeFilter!==null){let t=this.shadowRoot?.querySelector("details.bf-roster");t&&!t.open&&(t.open=!0)}}async _recordJump(e,t){if(!this._marking){this._marking=!0,this._error="";try{await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/battery_fleet/record_replacement",entity_id:e,replaced_at:new Date(t.at*1e3).toISOString()}),this._recorded=[...this._recorded,e],await this._load()}catch(i){this._error=R(i,this._lang)}finally{this._marking=!1}}}_levelBar(e){let t=e.level;if(t==null)return c;let i=e.low_threshold??20,a=t<=i?"bad":t<=i+20?"warn":"good";return o`<span class="bf-bar" aria-hidden="true"
|
||||
><span class="bf-bar-fill bf-bar-${a}" style="width: ${Math.min(100,Math.max(0,t))}%"></span
|
||||
></span>`}_jumpButton(e,t){let i=this._history?.[e.entity_id]?.jump;return!i||this._recorded.includes(e.entity_id)?c:o`<button
|
||||
class="bf-mark bf-jump"
|
||||
|
||||
Reference in new issue
Block a user