From aba2cb88a372990f6a91da0581030f04684f1c1e Mon Sep 17 00:00:00 2001 From: Ian Richardson Date: Tue, 5 Nov 2019 13:49:11 -0600 Subject: [PATCH] fix build --- .eslintrc.js | 13 +++++ .eslintrc.yaml | 22 -------- .prettierrc.js | 7 +++ README.md | 7 +++ dist/boilerplate-card.js | 8 +-- package.json | 91 ++++++++++++++++--------------- src/action-handler-directive.ts | 97 +++++++++++++-------------------- src/boilerplate-card.ts | 48 ++++++++-------- src/const.ts | 1 + src/types.ts | 2 +- yarn.lock | 41 ++++++++++++-- 11 files changed, 180 insertions(+), 157 deletions(-) create mode 100644 .eslintrc.js delete mode 100644 .eslintrc.yaml create mode 100644 .prettierrc.js create mode 100644 src/const.ts diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..d680a14 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,13 @@ +module.exports = { + parser: '@typescript-eslint/parser', // Specifies the ESLint parser + extends: [ + 'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin + 'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier + 'plugin:prettier/recommended', // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array. + ], + parserOptions: { + ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features + sourceType: 'module', // Allows for the use of imports + experimentalDecorators: true, + }, +}; diff --git a/.eslintrc.yaml b/.eslintrc.yaml deleted file mode 100644 index 5ba5687..0000000 --- a/.eslintrc.yaml +++ /dev/null @@ -1,22 +0,0 @@ -extends: airbnb-base -parser: "@typescript-eslint/parser" -rules: - no-else-return: 0 - no-underscore-dangle: 0 - nonblock-statement-body-position: 0 - curly: 0 - no-return-assign: 0 - consistent-return: 0 - no-mixed-operators: 0 - class-methods-use-this: 0 - no-nested-ternary: 0 - camelcase: 0 - no-unused-vars: 0 - quotes: 0 - comma-dangle: 0 - import/no-unresolved: 0 - import/prefer-default-export: 0 -globals: - window: true - Event: true - customElements: true diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 0000000..93f1e1c --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,7 @@ +module.exports = { + semi: true, + trailingComma: 'all', + singleQuote: true, + printWidth: 120, + tabWidth: 2, +}; \ No newline at end of file diff --git a/README.md b/README.md index a000393..6cadd4a 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,12 @@ A community driven boilerplate of best practices for Home Assistant Lovelace cus [![Discord][discord-shield]][discord] [![Community Forum][forum-shield]][forum] +## Support + +Hey dude! Help me out for a couple of :beers: or a :coffee:! + +[![coffee](https://www.buymeacoffee.com/assets/img/custom_images/black_img.png)](https://www.buymeacoffee.com/zJtVxUAgH) + ## Options | Name | Type | Requirement | Description | Default | @@ -35,6 +41,7 @@ A community driven boilerplate of best practices for Home Assistant Lovelace cus | service | string | **Optional** | Service to call (e.g. media_player.media_play_pause) when action defined as call-service | `none` | | service_data | object | **Optional** | Service data to include (e.g. entity_id: media_player.bedroom) when action defined as call-service | `none` | | haptic | string | **Optional** | Haptic feedback for the [Beta IOS App](http://home-assistant.io/ios/beta) _success, warning, failure, light, medium, heavy, selection_ | `none` | +| repeat | number | **Optional** | How often to repeat the `hold_action` in milliseconds. | `non` | ## Starting a new card from boilerplate-card diff --git a/dist/boilerplate-card.js b/dist/boilerplate-card.js index c16b170..4288575 100644 --- a/dist/boilerplate-card.js +++ b/dist/boilerplate-card.js @@ -1,4 +1,4 @@ -function t(t,e,n,s){var i,r=arguments.length,o=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(o=(r<3?i(o):r>3?i(e,n,o):i(e,n))||o);return r>3&&o&&Object.defineProperty(e,n,o),o}const e=new WeakMap,n=t=>"function"==typeof t&&e.has(t),s=void 0!==window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,i=(t,e,n=null)=>{for(;e!==n;){const n=e.nextSibling;t.removeChild(e),e=n}},r={},o={},a=`{{lit-${String(Math.random()).slice(2)}}}`,c=`\x3c!--${a}--\x3e`,l=new RegExp(`${a}|${c}`),d="$lit$";class h{constructor(t,e){this.parts=[],this.element=e;const n=[],s=[],i=document.createTreeWalker(e.content,133,null,!1);let r=0,o=-1,c=0;const{strings:h,values:{length:p}}=t;for(;c0;){const e=h[c],n=f.exec(e)[2],s=n.toLowerCase()+d,i=t.getAttribute(s);t.removeAttribute(s);const r=i.split(l);this.parts.push({type:"attribute",index:o,name:n,strings:r}),c+=r.length-1}}"TEMPLATE"===t.tagName&&(s.push(t),i.currentNode=t.content)}else if(3===t.nodeType){const e=t.data;if(e.indexOf(a)>=0){const s=t.parentNode,i=e.split(l),r=i.length-1;for(let e=0;e{const n=t.length-e.length;return n>=0&&t.slice(n)===e},p=t=>-1!==t.index,m=()=>document.createComment(""),f=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=\/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;class _{constructor(t,e,n){this.__parts=[],this.template=t,this.processor=e,this.options=n}update(t){let e=0;for(const n of this.__parts)void 0!==n&&n.setValue(t[e]),e++;for(const t of this.__parts)void 0!==t&&t.commit()}_clone(){const t=s?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),e=[],n=this.template.parts,i=document.createTreeWalker(t,133,null,!1);let r,o=0,a=0,c=i.nextNode();for(;o-1||n)&&-1===t.indexOf("--\x3e",i+1);const r=f.exec(t);e+=null===r?t+(n?g:c):t.substr(0,r.index)+r[1]+r[2]+d+r[3]+a}return e+=this.strings[t]}getTemplateElement(){const t=document.createElement("template");return t.innerHTML=this.getHTML(),t}}const v=t=>null===t||!("object"==typeof t||"function"==typeof t),S=t=>Array.isArray(t)||!(!t||!t[Symbol.iterator]);class w{constructor(t,e,n){this.dirty=!0,this.element=t,this.name=e,this.strings=n,this.parts=[];for(let t=0;tthis.handleEvent(t)}setValue(t){this.__pendingValue=t}commit(){for(;n(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=r,t(this)}if(this.__pendingValue===r)return;const t=this.__pendingValue,e=this.value,s=null==t||null!=e&&(t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive),i=null!=t&&(null==e||s);s&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),i&&(this.__options=T(t),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=t,this.__pendingValue=r}handleEvent(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)}}const T=t=>t&&(M?{capture:t.capture,passive:t.passive,once:t.once}:t.capture);const A=new class{handleAttributeExpressions(t,e,n,s){const i=e[0];if("."===i){return new C(t,e.slice(1),n).parts}return"@"===i?[new E(t,e.slice(1),s.eventContext)]:"?"===i?[new P(t,e.slice(1),n)]:new w(t,e,n).parts}handleTextExpression(t){return new x(t)}};function k(t){let e=D.get(t.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},D.set(t.type,e));let n=e.stringsArray.get(t.strings);if(void 0!==n)return n;const s=t.strings.join(a);return void 0===(n=e.keyString.get(s))&&(n=new h(t,t.getTemplateElement()),e.keyString.set(s,n)),e.stringsArray.set(t.strings,n),n}const D=new Map,V=new WeakMap;(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.1.2");const O=(t,...e)=>new y(t,e,"html",A),Y=133;function H(t,e){const{element:{content:n},parts:s}=t,i=document.createTreeWalker(n,Y,null,!1);let r=U(s),o=s[r],a=-1,c=0;const l=[];let d=null;for(;i.nextNode();){a++;const t=i.currentNode;for(t.previousSibling===d&&(d=null),e.has(t)&&(l.push(t),null===d&&(d=t)),null!==d&&c++;void 0!==o&&o.index===a;)o.index=null!==d?-1:o.index-c,o=s[r=U(s,r)]}l.forEach(t=>t.parentNode.removeChild(t))}const R=t=>{let e=11===t.nodeType?0:1;const n=document.createTreeWalker(t,Y,null,!1);for(;n.nextNode();)e++;return e},U=(t,e=-1)=>{for(let n=e+1;n`${t}--${e}`;let j=!0;void 0===window.ShadyCSS?j=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),j=!1);const F=t=>e=>{const n=L(e.type,t);let s=D.get(n);void 0===s&&(s={stringsArray:new WeakMap,keyString:new Map},D.set(n,s));let i=s.stringsArray.get(e.strings);if(void 0!==i)return i;const r=e.strings.join(a);if(void 0===(i=s.keyString.get(r))){const n=e.getTemplateElement();j&&window.ShadyCSS.prepareTemplateDom(n,t),i=new h(e,n),s.keyString.set(r,i)}return s.stringsArray.set(e.strings,i),i},z=["html","svg"],$=new Set,q=(t,e,n)=>{$.add(t);const s=n?n.element:document.createElement("template"),i=e.querySelectorAll("style"),{length:r}=i;if(0===r)return void window.ShadyCSS.prepareTemplateStyles(s,t);const o=document.createElement("style");for(let t=0;t{z.forEach(e=>{const n=D.get(L(e,t));void 0!==n&&n.keyString.forEach(t=>{const{element:{content:e}}=t,n=new Set;Array.from(e.querySelectorAll("style")).forEach(t=>{n.add(t)}),H(t,n)})})})(t);const a=s.content;n?function(t,e,n=null){const{element:{content:s},parts:i}=t;if(null==n)return void s.appendChild(e);const r=document.createTreeWalker(s,Y,null,!1);let o=U(i),a=0,c=-1;for(;r.nextNode();){for(c++,r.currentNode===n&&(a=R(e),n.parentNode.insertBefore(e,n));-1!==o&&i[o].index===c;){if(a>0){for(;-1!==o;)i[o].index+=a,o=U(i,o);return}o=U(i,o)}}}(n,o,a.firstChild):a.insertBefore(o,a.firstChild),window.ShadyCSS.prepareTemplateStyles(s,t);const c=a.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==c)e.insertBefore(c.cloneNode(!0),e.firstChild);else if(n){a.insertBefore(o,a.firstChild);const t=new Set;t.add(o),H(n,t)}};window.JSCompiler_renameProperty=(t,e)=>t;const I={toAttribute(t,e){switch(e){case Boolean:return t?"":null;case Object:case Array:return null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){switch(e){case Boolean:return null!==t;case Number:return null===t?null:Number(t);case Object:case Array:return JSON.parse(t)}return t}},B=(t,e)=>e!==t&&(e==e||t==t),W={attribute:!0,type:String,converter:I,reflect:!1,hasChanged:B},J=Promise.resolve(!0),Z=1,X=4,G=8,K=16,Q=32,tt="finalized";class et extends HTMLElement{constructor(){super(),this._updateState=0,this._instanceProperties=void 0,this._updatePromise=J,this._hasConnectedResolver=void 0,this._changedProperties=new Map,this._reflectingProperties=void 0,this.initialize()}static get observedAttributes(){this.finalize();const t=[];return this._classProperties.forEach((e,n)=>{const s=this._attributeNameForProperty(n,e);void 0!==s&&(this._attributeToPropertyMap.set(s,n),t.push(s))}),t}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;const t=Object.getPrototypeOf(this)._classProperties;void 0!==t&&t.forEach((t,e)=>this._classProperties.set(e,t))}}static createProperty(t,e=W){if(this._ensureClassProperties(),this._classProperties.set(t,e),e.noAccessor||this.prototype.hasOwnProperty(t))return;const n="symbol"==typeof t?Symbol():`__${t}`;Object.defineProperty(this.prototype,t,{get(){return this[n]},set(e){const s=this[t];this[n]=e,this._requestUpdate(t,s)},configurable:!0,enumerable:!0})}static finalize(){const t=Object.getPrototypeOf(this);if(t.hasOwnProperty(tt)||t.finalize(),this[tt]=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){const t=this.properties,e=[...Object.getOwnPropertyNames(t),..."function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t):[]];for(const n of e)this.createProperty(n,t[n])}}static _attributeNameForProperty(t,e){const n=e.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof t?t.toLowerCase():void 0}static _valueHasChanged(t,e,n=B){return n(t,e)}static _propertyValueFromAttribute(t,e){const n=e.type,s=e.converter||I,i="function"==typeof s?s:s.fromAttribute;return i?i(t,n):t}static _propertyValueToAttribute(t,e){if(void 0===e.reflect)return;const n=e.type,s=e.converter;return(s&&s.toAttribute||I.toAttribute)(t,n)}initialize(){this._saveInstanceProperties(),this._requestUpdate()}_saveInstanceProperties(){this.constructor._classProperties.forEach((t,e)=>{if(this.hasOwnProperty(e)){const t=this[e];delete this[e],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(e,t)}})}_applyInstanceProperties(){this._instanceProperties.forEach((t,e)=>this[e]=t),this._instanceProperties=void 0}connectedCallback(){this._updateState=this._updateState|Q,this._hasConnectedResolver&&(this._hasConnectedResolver(),this._hasConnectedResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(t,e,n){e!==n&&this._attributeToProperty(t,n)}_propertyToAttribute(t,e,n=W){const s=this.constructor,i=s._attributeNameForProperty(t,n);if(void 0!==i){const t=s._propertyValueToAttribute(e,n);if(void 0===t)return;this._updateState=this._updateState|G,null==t?this.removeAttribute(i):this.setAttribute(i,t),this._updateState=this._updateState&~G}}_attributeToProperty(t,e){if(this._updateState&G)return;const n=this.constructor,s=n._attributeToPropertyMap.get(t);if(void 0!==s){const t=n._classProperties.get(s)||W;this._updateState=this._updateState|K,this[s]=n._propertyValueFromAttribute(e,t),this._updateState=this._updateState&~K}}_requestUpdate(t,e){let n=!0;if(void 0!==t){const s=this.constructor,i=s._classProperties.get(t)||W;s._valueHasChanged(this[t],e,i.hasChanged)?(this._changedProperties.has(t)||this._changedProperties.set(t,e),!0!==i.reflect||this._updateState&K||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(t,i))):n=!1}!this._hasRequestedUpdate&&n&&this._enqueueUpdate()}requestUpdate(t,e){return this._requestUpdate(t,e),this.updateComplete}async _enqueueUpdate(){let t,e;this._updateState=this._updateState|X;const n=this._updatePromise;this._updatePromise=new Promise((n,s)=>{t=n,e=s});try{await n}catch(t){}this._hasConnected||await new Promise(t=>this._hasConnectedResolver=t);try{const t=this.performUpdate();null!=t&&await t}catch(t){e(t)}t(!this._hasRequestedUpdate)}get _hasConnected(){return this._updateState&Q}get _hasRequestedUpdate(){return this._updateState&X}get hasUpdated(){return this._updateState&Z}performUpdate(){this._instanceProperties&&this._applyInstanceProperties();let t=!1;const e=this._changedProperties;try{(t=this.shouldUpdate(e))&&this.update(e)}catch(e){throw t=!1,e}finally{this._markUpdated()}t&&(this._updateState&Z||(this._updateState=this._updateState|Z,this.firstUpdated(e)),this.updated(e))}_markUpdated(){this._changedProperties=new Map,this._updateState=this._updateState&~X}get updateComplete(){return this._getUpdateComplete()}_getUpdateComplete(){return this._updatePromise}shouldUpdate(t){return!0}update(t){void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach((t,e)=>this._propertyToAttribute(e,this[e],t)),this._reflectingProperties=void 0)}updated(t){}firstUpdated(t){}}et[tt]=!0;const nt=(t,e)=>"method"!==e.kind||!e.descriptor||"value"in e.descriptor?{kind:"field",key:Symbol(),placement:"own",descriptor:{},initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(n){n.createProperty(e.key,t)}}:Object.assign({},e,{finisher(n){n.createProperty(e.key,t)}}),st=(t,e,n)=>{e.constructor.createProperty(n,t)};function it(t){return(e,n)=>void 0!==n?st(t,e,n):nt(t,e)}const rt="adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ot=Symbol();class at{constructor(t,e){if(e!==ot)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}get styleSheet(){return void 0===this._styleSheet&&(rt?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}const ct=(t,...e)=>{const n=e.reduce((e,n,s)=>e+(t=>{if(t instanceof at)return t.cssText;if("number"==typeof t)return t;throw new Error(`Value passed to 'css' function must be a 'css' function result: ${t}. Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security.`)})(n)+t[s+1],t[0]);return new at(n,ot)};(window.litElementVersions||(window.litElementVersions=[])).push("2.2.1");const lt=t=>t.flat?t.flat(1/0):function t(e,n=[]){for(let s=0,i=e.length;s(t.add(e),t),new Set).forEach(t=>e.unshift(t))}else t&&e.push(t);return e}initialize(){super.initialize(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){const t=this.constructor._styles;0!==t.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?rt?this.renderRoot.adoptedStyleSheets=t.map(t=>t.styleSheet):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(t.map(t=>t.cssText),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(t){super.update(t);const e=this.render();e instanceof y&&this.constructor.render(e,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(t=>{const e=document.createElement("style");e.textContent=t.cssText,this.renderRoot.appendChild(e)}))}render(){}}dt.finalized=!0,dt.render=(t,e,n)=>{if(!n||"object"!=typeof n||!n.scopeName)throw new Error("The `scopeName` option is required.");const s=n.scopeName,r=V.has(e),o=j&&11===e.nodeType&&!!e.host,a=o&&!$.has(s),c=a?document.createDocumentFragment():e;if(((t,e,n)=>{let s=V.get(e);void 0===s&&(i(e,e.firstChild),V.set(e,s=new x(Object.assign({templateFactory:k},n))),s.appendInto(e)),s.setValue(t),s.commit()})(t,c,Object.assign({templateFactory:F(s)},n)),a){const t=V.get(c);V.delete(c);const n=t.value instanceof _?t.value.template:void 0;q(s,c,n),i(e,e.firstChild),e.appendChild(c),V.set(e,t)}!r&&o&&window.ShadyCSS.styleElement(e.host)};var ht={},ut=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,pt="[^\\s]+",mt=/\[([^]*?)\]/gm,ft=function(){};function _t(t,e){for(var n=[],s=0,i=t.length;s3?0:(t-t%10!=10)*t%10]}};var xt={D:function(t){return t.getDate()},DD:function(t){return yt(t.getDate())},Do:function(t,e){return e.DoFn(t.getDate())},d:function(t){return t.getDay()},dd:function(t){return yt(t.getDay())},ddd:function(t,e){return e.dayNamesShort[t.getDay()]},dddd:function(t,e){return e.dayNames[t.getDay()]},M:function(t){return t.getMonth()+1},MM:function(t){return yt(t.getMonth()+1)},MMM:function(t,e){return e.monthNamesShort[t.getMonth()]},MMMM:function(t,e){return e.monthNames[t.getMonth()]},YY:function(t){return yt(String(t.getFullYear()),4).substr(2)},YYYY:function(t){return yt(t.getFullYear(),4)},h:function(t){return t.getHours()%12||12},hh:function(t){return yt(t.getHours()%12||12)},H:function(t){return t.getHours()},HH:function(t){return yt(t.getHours())},m:function(t){return t.getMinutes()},mm:function(t){return yt(t.getMinutes())},s:function(t){return t.getSeconds()},ss:function(t){return yt(t.getSeconds())},S:function(t){return Math.round(t.getMilliseconds()/100)},SS:function(t){return yt(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return yt(t.getMilliseconds(),3)},a:function(t,e){return t.getHours()<12?e.amPm[0]:e.amPm[1]},A:function(t,e){return t.getHours()<12?e.amPm[0].toUpperCase():e.amPm[1].toUpperCase()},ZZ:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+yt(100*Math.floor(Math.abs(e)/60)+Math.abs(e)%60,4)}},Pt={D:["\\d\\d?",function(t,e){t.day=e}],Do:["\\d\\d?"+pt,function(t,e){t.day=parseInt(e,10)}],M:["\\d\\d?",function(t,e){t.month=e-1}],YY:["\\d\\d?",function(t,e){var n=+(""+(new Date).getFullYear()).substr(0,2);t.year=""+(e>68?n-1:n)+e}],h:["\\d\\d?",function(t,e){t.hour=e}],m:["\\d\\d?",function(t,e){t.minute=e}],s:["\\d\\d?",function(t,e){t.second=e}],YYYY:["\\d{4}",function(t,e){t.year=e}],S:["\\d",function(t,e){t.millisecond=100*e}],SS:["\\d{2}",function(t,e){t.millisecond=10*e}],SSS:["\\d{3}",function(t,e){t.millisecond=e}],d:["\\d\\d?",ft],ddd:[pt,ft],MMM:[pt,gt("monthNamesShort")],MMMM:[pt,gt("monthNames")],a:[pt,function(t,e,n){var s=e.toLowerCase();s===n.amPm[0]?t.isPm=!1:s===n.amPm[1]&&(t.isPm=!0)}],ZZ:["[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z",function(t,e){var n,s=(e+"").match(/([+-]|\d\d)/gi);s&&(n=60*s[1]+parseInt(s[2],10),t.timezoneOffset="+"===s[0]?n:-n)}]};Pt.dd=Pt.d,Pt.dddd=Pt.ddd,Pt.DD=Pt.D,Pt.mm=Pt.m,Pt.hh=Pt.H=Pt.HH=Pt.h,Pt.MM=Pt.M,Pt.ss=Pt.s,Pt.A=Pt.a,ht.masks={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},ht.format=function(t,e,n){var s=n||ht.i18n;if("number"==typeof t&&(t=new Date(t)),"[object Date]"!==Object.prototype.toString.call(t)||isNaN(t.getTime()))throw new Error("Invalid Date in fecha.format");e=ht.masks[e]||e||ht.masks.default;var i=[];return(e=(e=e.replace(mt,function(t,e){return i.push(e),"@@@"})).replace(ut,function(e){return e in xt?xt[e](t,s):e.slice(1,e.length-1)})).replace(/@@@/g,function(){return i.shift()})},ht.parse=function(t,e,n){var s=n||ht.i18n;if("string"!=typeof e)throw new Error("Invalid format in fecha.parse");if(e=ht.masks[e]||e,t.length>1e3)return null;var i={},r=[],o=[];e=e.replace(mt,function(t,e){return o.push(e),"@@@"});var a,c=(a=e,a.replace(/[|\\{()[^$+*?.-]/g,"\\$&")).replace(ut,function(t){if(Pt[t]){var e=Pt[t];return r.push(e[1]),"("+e[0]+")"}return t});c=c.replace(/@@@/g,function(){return o.shift()});var l=t.match(new RegExp(c,"i"));if(!l)return null;for(var d=1;d0||navigator.msMaxTouchPoints>0;customElements.define("action-handler-boilerplate",class extends HTMLElement{constructor(){super(),this.holdTime=500,this.ripple=document.createElement("mwc-ripple"),this.timer=void 0,this.held=!1,this.cooldownStart=!1,this.cooldownEnd=!1}connectedCallback(){Object.assign(this.style,{position:"absolute",width:At?"100px":"50px",height:At?"100px":"50px",transform:"translate(-50%, -50%)",pointerEvents:"none"}),this.appendChild(this.ripple),this.ripple.primary=!0,["touchcancel","mouseout","mouseup","touchmove","mousewheel","wheel","scroll"].forEach(t=>{document.addEventListener(t,()=>{clearTimeout(this.timer),this.stopAnimation(),this.timer=void 0},{passive:!0})})}bind(t,e){if(t.actionHandler)return;t.actionHandler=!0,t.addEventListener("contextmenu",t=>{const e=t||window.event;return e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0,e.returnValue=!1,!1});const n=t=>{if(this.cooldownStart)return;let n,s;this.held=!1,t.touches?(n=t.touches[0].pageX,s=t.touches[0].pageY):(n=t.pageX,s=t.pageY),e.hasHold&&(this.timer=window.setTimeout(()=>{this.startAnimation(n,s),this.held=!0},this.holdTime)),this.cooldownStart=!0,window.setTimeout(()=>this.cooldownStart=!1,100)},s=n=>{this.cooldownEnd||["touchend","touchcancel"].includes(n.type)&&void 0===this.timer||(clearTimeout(this.timer),this.stopAnimation(),this.timer=void 0,this.held?Nt(t,"action",{action:"hold"}):e.hasDoubleTap?1===n.detail?this.dblClickTimeout=window.setTimeout(()=>{Nt(t,"action",{action:"tap"})},250):(clearTimeout(this.dblClickTimeout),Nt(t,"action",{action:"double_tap"})):Nt(t,"action",{action:"tap"}),this.cooldownEnd=!0,window.setTimeout(()=>this.cooldownEnd=!1,100))};t.addEventListener("touchstart",n,{passive:!0}),t.addEventListener("touchend",s),t.addEventListener("touchcancel",s),window.navigator.userAgent.match(/iPhone OS 13_/)||(t.addEventListener("mousedown",n,{passive:!0}),t.addEventListener("click",s))}startAnimation(t,e){Object.assign(this.style,{left:`${t}px`,top:`${e}px`,display:null}),this.ripple.disabled=!1,this.ripple.active=!0,this.ripple.unbounded=!0}stopAnimation(){this.ripple.active=!1,this.ripple.disabled=!0,this.style.display="none"}});const kt=(t,e)=>{const n=(()=>{const t=document.body;if(t.querySelector("action-handler-boilerplate"))return t.querySelector("action-handler-boilerplate");const e=document.createElement("action-handler-boilerplate");return t.appendChild(e),e})();n&&n.bind(t,e)},Dt=(t=>(...n)=>{const s=t(...n);return e.set(s,!0),s})((t={})=>e=>{kt(e.committer.element,t)});let Vt=class extends dt{setConfig(t){if(!t||t.show_error)throw new Error("Invalid configuration");this._config=Object.assign({name:"Boilerplate"},t)}shouldUpdate(t){return function(t,e,n){if(e.has("config")||n)return!0;if(t._config.entity){var s=e.get("hass");return!s||s.states[t._config.entity]!==t.hass.states[t._config.entity]}return!1}(this,t,!1)}render(){return this._config&&this.hass?this._config.show_warning?O` +function t(t,e,n,s){var i,o=arguments.length,r=o<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,n,s);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(r=(o<3?i(r):o>3?i(e,n,r):i(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r}const e=new WeakMap,n=t=>"function"==typeof t&&e.has(t),s=void 0!==window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,i=(t,e,n=null)=>{for(;e!==n;){const n=e.nextSibling;t.removeChild(e),e=n}},o={},r={},a=`{{lit-${String(Math.random()).slice(2)}}}`,c=`\x3c!--${a}--\x3e`,l=new RegExp(`${a}|${c}`),d="$lit$";class h{constructor(t,e){this.parts=[],this.element=e;const n=[],s=[],i=document.createTreeWalker(e.content,133,null,!1);let o=0,r=-1,c=0;const{strings:h,values:{length:p}}=t;for(;c0;){const e=h[c],n=f.exec(e)[2],s=n.toLowerCase()+d,i=t.getAttribute(s);t.removeAttribute(s);const o=i.split(l);this.parts.push({type:"attribute",index:r,name:n,strings:o}),c+=o.length-1}}"TEMPLATE"===t.tagName&&(s.push(t),i.currentNode=t.content)}else if(3===t.nodeType){const e=t.data;if(e.indexOf(a)>=0){const s=t.parentNode,i=e.split(l),o=i.length-1;for(let e=0;e{const n=t.length-e.length;return n>=0&&t.slice(n)===e},p=t=>-1!==t.index,m=()=>document.createComment(""),f=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=\/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;class g{constructor(t,e,n){this.__parts=[],this.template=t,this.processor=e,this.options=n}update(t){let e=0;for(const n of this.__parts)void 0!==n&&n.setValue(t[e]),e++;for(const t of this.__parts)void 0!==t&&t.commit()}_clone(){const t=s?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),e=[],n=this.template.parts,i=document.createTreeWalker(t,133,null,!1);let o,r=0,a=0,c=i.nextNode();for(;r-1||n)&&-1===t.indexOf("--\x3e",i+1);const o=f.exec(t);e+=null===o?t+(n?_:c):t.substr(0,o.index)+o[1]+o[2]+d+o[3]+a}return e+=this.strings[t]}getTemplateElement(){const t=document.createElement("template");return t.innerHTML=this.getHTML(),t}}const v=t=>null===t||!("object"==typeof t||"function"==typeof t),S=t=>Array.isArray(t)||!(!t||!t[Symbol.iterator]);class w{constructor(t,e,n){this.dirty=!0,this.element=t,this.name=e,this.strings=n,this.parts=[];for(let t=0;tthis.handleEvent(t)}setValue(t){this.__pendingValue=t}commit(){for(;n(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=o,t(this)}if(this.__pendingValue===o)return;const t=this.__pendingValue,e=this.value,s=null==t||null!=e&&(t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive),i=null!=t&&(null==e||s);s&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),i&&(this.__options=T(t),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=t,this.__pendingValue=o}handleEvent(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)}}const T=t=>t&&(M?{capture:t.capture,passive:t.passive,once:t.once}:t.capture);const A=new class{handleAttributeExpressions(t,e,n,s){const i=e[0];if("."===i){return new C(t,e.slice(1),n).parts}return"@"===i?[new E(t,e.slice(1),s.eventContext)]:"?"===i?[new P(t,e.slice(1),n)]:new w(t,e,n).parts}handleTextExpression(t){return new x(t)}};function k(t){let e=D.get(t.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},D.set(t.type,e));let n=e.stringsArray.get(t.strings);if(void 0!==n)return n;const s=t.strings.join(a);return void 0===(n=e.keyString.get(s))&&(n=new h(t,t.getTemplateElement()),e.keyString.set(s,n)),e.stringsArray.set(t.strings,n),n}const D=new Map,V=new WeakMap;(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.1.2");const O=(t,...e)=>new y(t,e,"html",A),Y=133;function H(t,e){const{element:{content:n},parts:s}=t,i=document.createTreeWalker(n,Y,null,!1);let o=U(s),r=s[o],a=-1,c=0;const l=[];let d=null;for(;i.nextNode();){a++;const t=i.currentNode;for(t.previousSibling===d&&(d=null),e.has(t)&&(l.push(t),null===d&&(d=t)),null!==d&&c++;void 0!==r&&r.index===a;)r.index=null!==d?-1:r.index-c,r=s[o=U(s,o)]}l.forEach(t=>t.parentNode.removeChild(t))}const R=t=>{let e=11===t.nodeType?0:1;const n=document.createTreeWalker(t,Y,null,!1);for(;n.nextNode();)e++;return e},U=(t,e=-1)=>{for(let n=e+1;n`${t}--${e}`;let j=!0;void 0===window.ShadyCSS?j=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),j=!1);const F=t=>e=>{const n=L(e.type,t);let s=D.get(n);void 0===s&&(s={stringsArray:new WeakMap,keyString:new Map},D.set(n,s));let i=s.stringsArray.get(e.strings);if(void 0!==i)return i;const o=e.strings.join(a);if(void 0===(i=s.keyString.get(o))){const n=e.getTemplateElement();j&&window.ShadyCSS.prepareTemplateDom(n,t),i=new h(e,n),s.keyString.set(o,i)}return s.stringsArray.set(e.strings,i),i},z=["html","svg"],I=new Set,$=(t,e,n)=>{I.add(t);const s=n?n.element:document.createElement("template"),i=e.querySelectorAll("style"),{length:o}=i;if(0===o)return void window.ShadyCSS.prepareTemplateStyles(s,t);const r=document.createElement("style");for(let t=0;t{z.forEach(e=>{const n=D.get(L(e,t));void 0!==n&&n.keyString.forEach(t=>{const{element:{content:e}}=t,n=new Set;Array.from(e.querySelectorAll("style")).forEach(t=>{n.add(t)}),H(t,n)})})})(t);const a=s.content;n?function(t,e,n=null){const{element:{content:s},parts:i}=t;if(null==n)return void s.appendChild(e);const o=document.createTreeWalker(s,Y,null,!1);let r=U(i),a=0,c=-1;for(;o.nextNode();){for(c++,o.currentNode===n&&(a=R(e),n.parentNode.insertBefore(e,n));-1!==r&&i[r].index===c;){if(a>0){for(;-1!==r;)i[r].index+=a,r=U(i,r);return}r=U(i,r)}}}(n,r,a.firstChild):a.insertBefore(r,a.firstChild),window.ShadyCSS.prepareTemplateStyles(s,t);const c=a.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==c)e.insertBefore(c.cloneNode(!0),e.firstChild);else if(n){a.insertBefore(r,a.firstChild);const t=new Set;t.add(r),H(n,t)}};window.JSCompiler_renameProperty=(t,e)=>t;const q={toAttribute(t,e){switch(e){case Boolean:return t?"":null;case Object:case Array:return null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){switch(e){case Boolean:return null!==t;case Number:return null===t?null:Number(t);case Object:case Array:return JSON.parse(t)}return t}},B=(t,e)=>e!==t&&(e==e||t==t),W={attribute:!0,type:String,converter:q,reflect:!1,hasChanged:B},J=Promise.resolve(!0),Z=1,X=4,G=8,K=16,Q=32,tt="finalized";class et extends HTMLElement{constructor(){super(),this._updateState=0,this._instanceProperties=void 0,this._updatePromise=J,this._hasConnectedResolver=void 0,this._changedProperties=new Map,this._reflectingProperties=void 0,this.initialize()}static get observedAttributes(){this.finalize();const t=[];return this._classProperties.forEach((e,n)=>{const s=this._attributeNameForProperty(n,e);void 0!==s&&(this._attributeToPropertyMap.set(s,n),t.push(s))}),t}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;const t=Object.getPrototypeOf(this)._classProperties;void 0!==t&&t.forEach((t,e)=>this._classProperties.set(e,t))}}static createProperty(t,e=W){if(this._ensureClassProperties(),this._classProperties.set(t,e),e.noAccessor||this.prototype.hasOwnProperty(t))return;const n="symbol"==typeof t?Symbol():`__${t}`;Object.defineProperty(this.prototype,t,{get(){return this[n]},set(e){const s=this[t];this[n]=e,this._requestUpdate(t,s)},configurable:!0,enumerable:!0})}static finalize(){const t=Object.getPrototypeOf(this);if(t.hasOwnProperty(tt)||t.finalize(),this[tt]=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){const t=this.properties,e=[...Object.getOwnPropertyNames(t),..."function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t):[]];for(const n of e)this.createProperty(n,t[n])}}static _attributeNameForProperty(t,e){const n=e.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof t?t.toLowerCase():void 0}static _valueHasChanged(t,e,n=B){return n(t,e)}static _propertyValueFromAttribute(t,e){const n=e.type,s=e.converter||q,i="function"==typeof s?s:s.fromAttribute;return i?i(t,n):t}static _propertyValueToAttribute(t,e){if(void 0===e.reflect)return;const n=e.type,s=e.converter;return(s&&s.toAttribute||q.toAttribute)(t,n)}initialize(){this._saveInstanceProperties(),this._requestUpdate()}_saveInstanceProperties(){this.constructor._classProperties.forEach((t,e)=>{if(this.hasOwnProperty(e)){const t=this[e];delete this[e],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(e,t)}})}_applyInstanceProperties(){this._instanceProperties.forEach((t,e)=>this[e]=t),this._instanceProperties=void 0}connectedCallback(){this._updateState=this._updateState|Q,this._hasConnectedResolver&&(this._hasConnectedResolver(),this._hasConnectedResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(t,e,n){e!==n&&this._attributeToProperty(t,n)}_propertyToAttribute(t,e,n=W){const s=this.constructor,i=s._attributeNameForProperty(t,n);if(void 0!==i){const t=s._propertyValueToAttribute(e,n);if(void 0===t)return;this._updateState=this._updateState|G,null==t?this.removeAttribute(i):this.setAttribute(i,t),this._updateState=this._updateState&~G}}_attributeToProperty(t,e){if(this._updateState&G)return;const n=this.constructor,s=n._attributeToPropertyMap.get(t);if(void 0!==s){const t=n._classProperties.get(s)||W;this._updateState=this._updateState|K,this[s]=n._propertyValueFromAttribute(e,t),this._updateState=this._updateState&~K}}_requestUpdate(t,e){let n=!0;if(void 0!==t){const s=this.constructor,i=s._classProperties.get(t)||W;s._valueHasChanged(this[t],e,i.hasChanged)?(this._changedProperties.has(t)||this._changedProperties.set(t,e),!0!==i.reflect||this._updateState&K||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(t,i))):n=!1}!this._hasRequestedUpdate&&n&&this._enqueueUpdate()}requestUpdate(t,e){return this._requestUpdate(t,e),this.updateComplete}async _enqueueUpdate(){let t,e;this._updateState=this._updateState|X;const n=this._updatePromise;this._updatePromise=new Promise((n,s)=>{t=n,e=s});try{await n}catch(t){}this._hasConnected||await new Promise(t=>this._hasConnectedResolver=t);try{const t=this.performUpdate();null!=t&&await t}catch(t){e(t)}t(!this._hasRequestedUpdate)}get _hasConnected(){return this._updateState&Q}get _hasRequestedUpdate(){return this._updateState&X}get hasUpdated(){return this._updateState&Z}performUpdate(){this._instanceProperties&&this._applyInstanceProperties();let t=!1;const e=this._changedProperties;try{(t=this.shouldUpdate(e))&&this.update(e)}catch(e){throw t=!1,e}finally{this._markUpdated()}t&&(this._updateState&Z||(this._updateState=this._updateState|Z,this.firstUpdated(e)),this.updated(e))}_markUpdated(){this._changedProperties=new Map,this._updateState=this._updateState&~X}get updateComplete(){return this._getUpdateComplete()}_getUpdateComplete(){return this._updatePromise}shouldUpdate(t){return!0}update(t){void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach((t,e)=>this._propertyToAttribute(e,this[e],t)),this._reflectingProperties=void 0)}updated(t){}firstUpdated(t){}}et[tt]=!0;const nt=(t,e)=>"method"!==e.kind||!e.descriptor||"value"in e.descriptor?{kind:"field",key:Symbol(),placement:"own",descriptor:{},initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(n){n.createProperty(e.key,t)}}:Object.assign({},e,{finisher(n){n.createProperty(e.key,t)}}),st=(t,e,n)=>{e.constructor.createProperty(n,t)};function it(t){return(e,n)=>void 0!==n?st(t,e,n):nt(t,e)}const ot="adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,rt=Symbol();class at{constructor(t,e){if(e!==rt)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}get styleSheet(){return void 0===this._styleSheet&&(ot?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}const ct=(t,...e)=>{const n=e.reduce((e,n,s)=>e+(t=>{if(t instanceof at)return t.cssText;if("number"==typeof t)return t;throw new Error(`Value passed to 'css' function must be a 'css' function result: ${t}. Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security.`)})(n)+t[s+1],t[0]);return new at(n,rt)};(window.litElementVersions||(window.litElementVersions=[])).push("2.2.1");const lt=t=>t.flat?t.flat(1/0):function t(e,n=[]){for(let s=0,i=e.length;s(t.add(e),t),new Set).forEach(t=>e.unshift(t))}else t&&e.push(t);return e}initialize(){super.initialize(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){const t=this.constructor._styles;0!==t.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?ot?this.renderRoot.adoptedStyleSheets=t.map(t=>t.styleSheet):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(t.map(t=>t.cssText),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(t){super.update(t);const e=this.render();e instanceof y&&this.constructor.render(e,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(t=>{const e=document.createElement("style");e.textContent=t.cssText,this.renderRoot.appendChild(e)}))}render(){}}dt.finalized=!0,dt.render=(t,e,n)=>{if(!n||"object"!=typeof n||!n.scopeName)throw new Error("The `scopeName` option is required.");const s=n.scopeName,o=V.has(e),r=j&&11===e.nodeType&&!!e.host,a=r&&!I.has(s),c=a?document.createDocumentFragment():e;if(((t,e,n)=>{let s=V.get(e);void 0===s&&(i(e,e.firstChild),V.set(e,s=new x(Object.assign({templateFactory:k},n))),s.appendInto(e)),s.setValue(t),s.commit()})(t,c,Object.assign({templateFactory:F(s)},n)),a){const t=V.get(c);V.delete(c);const n=t.value instanceof g?t.value.template:void 0;$(s,c,n),i(e,e.firstChild),e.appendChild(c),V.set(e,t)}!o&&r&&window.ShadyCSS.styleElement(e.host)};var ht={},ut=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,pt="[^\\s]+",mt=/\[([^]*?)\]/gm,ft=function(){};function gt(t,e){for(var n=[],s=0,i=t.length;s3?0:(t-t%10!=10)*t%10]}};var xt={D:function(t){return t.getDate()},DD:function(t){return yt(t.getDate())},Do:function(t,e){return e.DoFn(t.getDate())},d:function(t){return t.getDay()},dd:function(t){return yt(t.getDay())},ddd:function(t,e){return e.dayNamesShort[t.getDay()]},dddd:function(t,e){return e.dayNames[t.getDay()]},M:function(t){return t.getMonth()+1},MM:function(t){return yt(t.getMonth()+1)},MMM:function(t,e){return e.monthNamesShort[t.getMonth()]},MMMM:function(t,e){return e.monthNames[t.getMonth()]},YY:function(t){return yt(String(t.getFullYear()),4).substr(2)},YYYY:function(t){return yt(t.getFullYear(),4)},h:function(t){return t.getHours()%12||12},hh:function(t){return yt(t.getHours()%12||12)},H:function(t){return t.getHours()},HH:function(t){return yt(t.getHours())},m:function(t){return t.getMinutes()},mm:function(t){return yt(t.getMinutes())},s:function(t){return t.getSeconds()},ss:function(t){return yt(t.getSeconds())},S:function(t){return Math.round(t.getMilliseconds()/100)},SS:function(t){return yt(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return yt(t.getMilliseconds(),3)},a:function(t,e){return t.getHours()<12?e.amPm[0]:e.amPm[1]},A:function(t,e){return t.getHours()<12?e.amPm[0].toUpperCase():e.amPm[1].toUpperCase()},ZZ:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+yt(100*Math.floor(Math.abs(e)/60)+Math.abs(e)%60,4)}},Pt={D:["\\d\\d?",function(t,e){t.day=e}],Do:["\\d\\d?"+pt,function(t,e){t.day=parseInt(e,10)}],M:["\\d\\d?",function(t,e){t.month=e-1}],YY:["\\d\\d?",function(t,e){var n=+(""+(new Date).getFullYear()).substr(0,2);t.year=""+(e>68?n-1:n)+e}],h:["\\d\\d?",function(t,e){t.hour=e}],m:["\\d\\d?",function(t,e){t.minute=e}],s:["\\d\\d?",function(t,e){t.second=e}],YYYY:["\\d{4}",function(t,e){t.year=e}],S:["\\d",function(t,e){t.millisecond=100*e}],SS:["\\d{2}",function(t,e){t.millisecond=10*e}],SSS:["\\d{3}",function(t,e){t.millisecond=e}],d:["\\d\\d?",ft],ddd:[pt,ft],MMM:[pt,_t("monthNamesShort")],MMMM:[pt,_t("monthNames")],a:[pt,function(t,e,n){var s=e.toLowerCase();s===n.amPm[0]?t.isPm=!1:s===n.amPm[1]&&(t.isPm=!0)}],ZZ:["[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z",function(t,e){var n,s=(e+"").match(/([+-]|\d\d)/gi);s&&(n=60*s[1]+parseInt(s[2],10),t.timezoneOffset="+"===s[0]?n:-n)}]};Pt.dd=Pt.d,Pt.dddd=Pt.ddd,Pt.DD=Pt.D,Pt.mm=Pt.m,Pt.hh=Pt.H=Pt.HH=Pt.h,Pt.MM=Pt.M,Pt.ss=Pt.s,Pt.A=Pt.a,ht.masks={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},ht.format=function(t,e,n){var s=n||ht.i18n;if("number"==typeof t&&(t=new Date(t)),"[object Date]"!==Object.prototype.toString.call(t)||isNaN(t.getTime()))throw new Error("Invalid Date in fecha.format");e=ht.masks[e]||e||ht.masks.default;var i=[];return(e=(e=e.replace(mt,function(t,e){return i.push(e),"@@@"})).replace(ut,function(e){return e in xt?xt[e](t,s):e.slice(1,e.length-1)})).replace(/@@@/g,function(){return i.shift()})},ht.parse=function(t,e,n){var s=n||ht.i18n;if("string"!=typeof e)throw new Error("Invalid format in fecha.parse");if(e=ht.masks[e]||e,t.length>1e3)return null;var i={},o=[],r=[];e=e.replace(mt,function(t,e){return r.push(e),"@@@"});var a,c=(a=e,a.replace(/[|\\{()[^$+*?.-]/g,"\\$&")).replace(ut,function(t){if(Pt[t]){var e=Pt[t];return o.push(e[1]),"("+e[0]+")"}return t});c=c.replace(/@@@/g,function(){return r.shift()});var l=t.match(new RegExp(c,"i"));if(!l)return null;for(var d=1;d0||navigator.msMaxTouchPoints>0;customElements.define("action-handler-boilerplate",class extends HTMLElement{constructor(){super(),this.holdTime=500,this.ripple=document.createElement("mwc-ripple"),this.timer=void 0,this.held=!1,this.cooldownStart=!1,this.cooldownEnd=!1}connectedCallback(){Object.assign(this.style,{position:"absolute",width:At?"100px":"50px",height:At?"100px":"50px",transform:"translate(-50%, -50%)",pointerEvents:"none"}),this.appendChild(this.ripple),this.ripple.primary=!0,["touchcancel","mouseout","mouseup","touchmove","mousewheel","wheel","scroll"].forEach(t=>{document.addEventListener(t,()=>{clearTimeout(this.timer),this.stopAnimation(),this.timer=void 0},{passive:!0})})}bind(t,e){if(t.actionHandler)return;t.actionHandler=!0,t.addEventListener("contextmenu",t=>{const e=t||window.event;e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0,e.returnValue=!1});const n=t=>{if(this.cooldownStart)return;let n,s;this.held=!1,t.touches?(n=t.touches[0].pageX,s=t.touches[0].pageY):(n=t.pageX,s=t.pageY),e.hasHold&&(this.timer=window.setTimeout(()=>{this.startAnimation(n,s),this.held=!0},this.holdTime)),this.cooldownStart=!0,window.setTimeout(()=>this.cooldownStart=!1,100)},s=n=>{this.cooldownEnd||["touchend","touchcancel"].includes(n.type)&&void 0===this.timer||(clearTimeout(this.timer),this.stopAnimation(),this.timer=void 0,this.held?Nt(t,"action",{action:"hold"}):e.hasDoubleTap?1===n.detail?this.dblClickTimeout=window.setTimeout(()=>{Nt(t,"action",{action:"tap"})},250):(clearTimeout(this.dblClickTimeout),Nt(t,"action",{action:"double_tap"})):Nt(t,"action",{action:"tap"}),this.cooldownEnd=!0,window.setTimeout(()=>this.cooldownEnd=!1,100))};t.addEventListener("touchstart",n,{passive:!0}),t.addEventListener("touchend",s),t.addEventListener("touchcancel",s),window.navigator.userAgent.match(/iPhone OS 13_/)||(t.addEventListener("mousedown",n,{passive:!0}),t.addEventListener("click",s))}startAnimation(t,e){Object.assign(this.style,{left:`${t}px`,top:`${e}px`,display:null}),this.ripple.disabled=!1,this.ripple.active=!0,this.ripple.unbounded=!0}stopAnimation(){this.ripple.active=!1,this.ripple.disabled=!0,this.style.display="none"}});const kt=(t,e)=>{const n=(()=>{const t=document.body;if(t.querySelector("action-handler-boilerplate"))return t.querySelector("action-handler-boilerplate");const e=document.createElement("action-handler-boilerplate");return t.appendChild(e),e})();n&&n.bind(t,e)},Dt=(t=>(...n)=>{const s=t(...n);return e.set(s,!0),s})((t={})=>e=>{kt(e.committer.element,t)});console.info("%c BOILERPLATE-CARD \n%c Version 1.1.2 ","color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: dimgray");let Vt=class extends dt{setConfig(t){if(!t||t.show_error)throw new Error("Invalid configuration");this._config=Object.assign({name:"Boilerplate"},t)}shouldUpdate(t){return function(t,e,n){if(e.has("config")||n)return!0;if(t._config.entity){var s=e.get("hass");return!s||s.states[t._config.entity]!==t.hass.states[t._config.entity]}return!1}(this,t,!1)}render(){return this._config&&this.hass?this._config.show_warning?O`
Show Warning
@@ -6,13 +6,13 @@ function t(t,e,n,s){var i,r=arguments.length,o=r<3?e:null===s?s=Object.getOwnPro - `:O``}_handleAction(t){Et(this,this.hass,this._config,t.detail.action)}static get styles(){return ct` + `:O``}_handleAction(t){this.hass&&this._config&&t.detail.action&&Et(this,this.hass,this._config,t.detail.action)}static get styles(){return ct` .warning { display: block; color: black; background-color: #fce588; padding: 8px; } - `}};t([it()],Vt.prototype,"hass",void 0),t([it()],Vt.prototype,"_config",void 0),Vt=t([(t=>e=>"function"==typeof e?((t,e)=>(window.customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:n,elements:s}=e;return{kind:n,elements:s,finisher(e){window.customElements.define(t,e)}}})(t,e))("boilerplate-card")],Vt); + `}};t([it()],Vt.prototype,"hass",void 0),t([it()],Vt.prototype,"_config",void 0),Vt=t([(t=>e=>"function"==typeof e?((t,e)=>(window.customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:n,elements:s}=e;return{kind:n,elements:s,finisher(e){window.customElements.define(t,e)}}})(t,e))("boilerplate-card")],Vt);export{Vt as BoilerplateCard}; diff --git a/package.json b/package.json index de34451..88e4a7f 100644 --- a/package.json +++ b/package.json @@ -1,46 +1,49 @@ { - "name": "boilerplate-card", - "version": "1.1.1", - "description": "Lovelace boilerplate-card", - "keywords": [ - "home-assistant", - "homeassistant", - "hass", - "automation", - "lovelace", - "custom-cards" - ], - "module": "boilerplate-card.js", - "repository": "git@github.com:custom_cards/boilerplate-card.git", - "author": "Ian Richardson ", - "license": "MIT", - "dependencies": { - "custom-card-helpers": "^1.3.5", - "home-assistant-js-websocket": "^4.4.0", - "lit-element": "^2.2.1" - }, - "devDependencies": { - "@babel/core": "^7.6.4", - "@babel/plugin-proposal-class-properties": "^7.5.5", - "@babel/plugin-proposal-decorators": "^7.4.0", - "@typescript-eslint/eslint-plugin": "^2.6.0", - "@typescript-eslint/parser": "^2.6.0", - "eslint": "^6.6.0", - "eslint-config-airbnb-base": "^14.0.0", - "eslint-plugin-import": "^2.18.2", - "prettier": "^1.18.2", - "rollup": "^1.26.0", - "rollup-plugin-babel": "^4.3.3", - "rollup-plugin-node-resolve": "^5.2.0", - "rollup-plugin-terser": "^5.1.2", - "rollup-plugin-typescript2": "^0.24.3", - "rollup-plugin-uglify": "^6.0.3", - "typescript": "^3.6.4" - }, - "scripts": { - "start": "rollup -c --watch", - "build": "npm run lint && npm run rollup", - "lint": "eslint src/*.ts", - "rollup": "rollup -c" - } + "name": "boilerplate-card", + "version": "1.1.1", + "description": "Lovelace boilerplate-card", + "keywords": [ + "home-assistant", + "homeassistant", + "hass", + "automation", + "lovelace", + "custom-cards" + ], + "module": "boilerplate-card.js", + "repository": "git@github.com:custom_cards/boilerplate-card.git", + "author": "Ian Richardson ", + "license": "MIT", + "dependencies": { + "custom-card-helpers": "^1.3.9", + "home-assistant-js-websocket": "^4.4.0", + "lit-element": "^2.2.1", + "lit-html": "^1.1.2" + }, + "devDependencies": { + "@babel/core": "^7.6.4", + "@babel/plugin-proposal-class-properties": "^7.5.5", + "@babel/plugin-proposal-decorators": "^7.4.0", + "@typescript-eslint/eslint-plugin": "^2.6.0", + "@typescript-eslint/parser": "^2.6.0", + "eslint": "^6.6.0", + "eslint-config-airbnb-base": "^14.0.0", + "eslint-config-prettier": "^6.5.0", + "eslint-plugin-import": "^2.18.2", + "eslint-plugin-prettier": "^3.1.1", + "prettier": "^1.18.2", + "rollup": "^1.26.0", + "rollup-plugin-babel": "^4.3.3", + "rollup-plugin-node-resolve": "^5.2.0", + "rollup-plugin-terser": "^5.1.2", + "rollup-plugin-typescript2": "^0.24.3", + "rollup-plugin-uglify": "^6.0.3", + "typescript": "^3.6.4" + }, + "scripts": { + "start": "rollup -c --watch", + "build": "npm run lint && npm run rollup", + "lint": "eslint src/*.ts", + "rollup": "rollup -c" + } } diff --git a/src/action-handler-directive.ts b/src/action-handler-directive.ts index ed0b7ca..c1f0767 100644 --- a/src/action-handler-directive.ts +++ b/src/action-handler-directive.ts @@ -1,10 +1,7 @@ -import { directive, PropertyPart } from "lit-html"; -import { fireEvent, ActionHandlerOptions } from "custom-card-helpers"; +import { directive, PropertyPart } from 'lit-html'; +import { fireEvent, ActionHandlerOptions } from 'custom-card-helpers'; -const isTouch = - "ontouchstart" in window || - navigator.maxTouchPoints > 0 || - navigator.msMaxTouchPoints > 0; +const isTouch = 'ontouchstart' in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0; interface ActionHandler extends HTMLElement { holdTime: number; @@ -16,6 +13,7 @@ interface ActionHandlerElement extends Element { class ActionHandler extends HTMLElement implements ActionHandler { public holdTime: number; + /* eslint-disable-next-line @typescript-eslint/no-explicit-any */ public ripple: any; protected timer: number | undefined; protected held: boolean; @@ -26,34 +24,26 @@ class ActionHandler extends HTMLElement implements ActionHandler { constructor() { super(); this.holdTime = 500; - this.ripple = document.createElement("mwc-ripple"); + this.ripple = document.createElement('mwc-ripple'); this.timer = undefined; this.held = false; this.cooldownStart = false; this.cooldownEnd = false; } - public connectedCallback() { + public connectedCallback(): void { Object.assign(this.style, { - position: "absolute", - width: isTouch ? "100px" : "50px", - height: isTouch ? "100px" : "50px", - transform: "translate(-50%, -50%)", - pointerEvents: "none", + position: 'absolute', + width: isTouch ? '100px' : '50px', + height: isTouch ? '100px' : '50px', + transform: 'translate(-50%, -50%)', + pointerEvents: 'none', }); this.appendChild(this.ripple); this.ripple.primary = true; - [ - "touchcancel", - "mouseout", - "mouseup", - "touchmove", - "mousewheel", - "wheel", - "scroll", - ].forEach((ev) => { + ['touchcancel', 'mouseout', 'mouseup', 'touchmove', 'mousewheel', 'wheel', 'scroll'].forEach(ev => { document.addEventListener( ev, () => { @@ -61,18 +51,18 @@ class ActionHandler extends HTMLElement implements ActionHandler { this.stopAnimation(); this.timer = undefined; }, - { passive: true } + { passive: true }, ); }); } - public bind(element: ActionHandlerElement, options) { + public bind(element: ActionHandlerElement, options): void { if (element.actionHandler) { return; } element.actionHandler = true; - element.addEventListener("contextmenu", (ev: Event) => { + element.addEventListener('contextmenu', (ev: Event) => { const e = ev || window.event; if (e.preventDefault) { e.preventDefault(); @@ -82,10 +72,10 @@ class ActionHandler extends HTMLElement implements ActionHandler { } e.cancelBubble = true; e.returnValue = false; - return false; + return; }); - const clickStart = (ev: Event) => { + const clickStart = (ev: Event): void => { if (this.cooldownStart) { return; } @@ -111,38 +101,34 @@ class ActionHandler extends HTMLElement implements ActionHandler { window.setTimeout(() => (this.cooldownStart = false), 100); }; - const clickEnd = (ev: Event) => { - if ( - this.cooldownEnd || - (["touchend", "touchcancel"].includes(ev.type) && - this.timer === undefined) - ) { + const clickEnd = (ev: Event): void => { + if (this.cooldownEnd || (['touchend', 'touchcancel'].includes(ev.type) && this.timer === undefined)) { return; } clearTimeout(this.timer); this.stopAnimation(); this.timer = undefined; if (this.held) { - fireEvent(element as HTMLElement, "action", { action: "hold" }); + fireEvent(element as HTMLElement, 'action', { action: 'hold' }); } else if (options.hasDoubleTap) { if ((ev as MouseEvent).detail === 1) { this.dblClickTimeout = window.setTimeout(() => { - fireEvent(element as HTMLElement, "action", { action: "tap" }); + fireEvent(element as HTMLElement, 'action', { action: 'tap' }); }, 250); } else { clearTimeout(this.dblClickTimeout); - fireEvent(element as HTMLElement, "action", { action: "double_tap" }); + fireEvent(element as HTMLElement, 'action', { action: 'double_tap' }); } } else { - fireEvent(element as HTMLElement, "action", { action: "tap" }); + fireEvent(element as HTMLElement, 'action', { action: 'tap' }); } this.cooldownEnd = true; window.setTimeout(() => (this.cooldownEnd = false), 100); }; - element.addEventListener("touchstart", clickStart, { passive: true }); - element.addEventListener("touchend", clickEnd); - element.addEventListener("touchcancel", clickEnd); + element.addEventListener('touchstart', clickStart, { passive: true }); + element.addEventListener('touchend', clickEnd); + element.addEventListener('touchcancel', clickEnd); // iOS 13 sends a complete normal touchstart-touchend series of events followed by a mousedown-click series. // That might be a bug, but until it's fixed, this should make action-handler work. @@ -150,12 +136,12 @@ class ActionHandler extends HTMLElement implements ActionHandler { // Note that all events (both touch and mouse) must be listened for in order to work on computers with both mouse and touchscreen. const isIOS13 = window.navigator.userAgent.match(/iPhone OS 13_/); if (!isIOS13) { - element.addEventListener("mousedown", clickStart, { passive: true }); - element.addEventListener("click", clickEnd); + element.addEventListener('mousedown', clickStart, { passive: true }); + element.addEventListener('click', clickEnd); } } - private startAnimation(x: number, y: number) { + private startAnimation(x: number, y: number): void { Object.assign(this.style, { left: `${x}px`, top: `${y}px`, @@ -166,32 +152,29 @@ class ActionHandler extends HTMLElement implements ActionHandler { this.ripple.unbounded = true; } - private stopAnimation() { + private stopAnimation(): void { this.ripple.active = false; this.ripple.disabled = true; - this.style.display = "none"; + this.style.display = 'none'; } } // TODO You need to replace all instances of "action-handler-boilerplate" with "action-handler-" -customElements.define("action-handler-boilerplate", ActionHandler); +customElements.define('action-handler-boilerplate', ActionHandler); const geActionHandler = (): ActionHandler => { const body = document.body; - if (body.querySelector("action-handler-boilerplate")) { - return body.querySelector("action-handler-boilerplate") as ActionHandler; + if (body.querySelector('action-handler-boilerplate')) { + return body.querySelector('action-handler-boilerplate') as ActionHandler; } - const actionhandler = document.createElement("action-handler-boilerplate"); + const actionhandler = document.createElement('action-handler-boilerplate'); body.appendChild(actionhandler); return actionhandler as ActionHandler; }; -export const actionHandlerBind = ( - element: ActionHandlerElement, - options: ActionHandlerOptions -) => { +export const actionHandlerBind = (element: ActionHandlerElement, options: ActionHandlerOptions): void => { const actionhandler: ActionHandler = geActionHandler(); if (!actionhandler) { return; @@ -199,8 +182,6 @@ export const actionHandlerBind = ( actionhandler.bind(element, options); }; -export const actionHandler = directive( - (options: ActionHandlerOptions = {}) => (part: PropertyPart) => { - actionHandlerBind(part.committer.element, options); - } -); \ No newline at end of file +export const actionHandler = directive((options: ActionHandlerOptions = {}) => (part: PropertyPart): void => { + actionHandlerBind(part.committer.element, options); +}); diff --git a/src/boilerplate-card.ts b/src/boilerplate-card.ts index 9b9123b..0da35a8 100644 --- a/src/boilerplate-card.ts +++ b/src/boilerplate-card.ts @@ -1,27 +1,26 @@ -import { - LitElement, - html, - customElement, - property, - CSSResult, - TemplateResult, - css, - PropertyValues -} from "lit-element"; +import { LitElement, html, customElement, property, CSSResult, TemplateResult, css, PropertyValues } from 'lit-element'; import { HomeAssistant, hasConfigOrEntityChanged, hasAction, ActionHandlerEvent, - handleAction -} from "custom-card-helpers"; + handleAction, +} from 'custom-card-helpers'; + +import { BoilerplateConfig } from './types'; +import { actionHandler } from './action-handler-directive'; +import { CARD_VERSION } from './const'; -import { BoilerplateConfig } from "./types"; -import { actionHandler } from "./action-handler-directive"; +/* eslint no-console: 0 */ +console.info( + `%c BOILERPLATE-CARD \n%c Version ${CARD_VERSION} `, + 'color: orange; font-weight: bold; background: black', + 'color: white; font-weight: bold; background: dimgray', +); // TODO Name your custom element -@customElement("boilerplate-card") -class BoilerplateCard extends LitElement { +@customElement('boilerplate-card') +export class BoilerplateCard extends LitElement { // TODO Add any properities that should cause your element to re-render here @property() public hass?: HomeAssistant; @property() private _config?: BoilerplateConfig; @@ -29,12 +28,12 @@ class BoilerplateCard extends LitElement { public setConfig(config: BoilerplateConfig): void { // TODO Check for required fields and that they are of the proper format if (!config || config.show_error) { - throw new Error("Invalid configuration"); + throw new Error('Invalid configuration'); } this._config = { - name: "Boilerplate", - ...config + name: 'Boilerplate', + ...config, }; } @@ -61,15 +60,18 @@ class BoilerplateCard extends LitElement { .header=${this._config.name} @action=${this._handleAction} .actionHandler=${actionHandler({ - hasHold: hasAction(this._config!.hold_action), - hasDoubleTap: hasAction(this._config!.double_tap_action) + hasHold: hasAction(this._config.hold_action), + hasDoubleTap: hasAction(this._config.double_tap_action), + repeat: this._config.hold_action ? this._config.hold_action.repeat : undefined, })} > `; } - private _handleAction(ev: ActionHandlerEvent) { - handleAction(this, this.hass!, this._config!, ev.detail.action!); + private _handleAction(ev: ActionHandlerEvent): void { + if (this.hass && this._config && ev.detail.action) { + handleAction(this, this.hass, this._config, ev.detail.action); + } } static get styles(): CSSResult { diff --git a/src/const.ts b/src/const.ts new file mode 100644 index 0000000..87304d2 --- /dev/null +++ b/src/const.ts @@ -0,0 +1 @@ +export const CARD_VERSION = '1.1.2'; diff --git a/src/types.ts b/src/types.ts index 8ae65ea..6a04c0f 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,4 +1,4 @@ -import { ActionConfig, HASSDomEvent } from "custom-card-helpers"; +import { ActionConfig } from 'custom-card-helpers'; // TODO Add your configuration elements here for type-checking export interface BoilerplateConfig { diff --git a/yarn.lock b/yarn.lock index 1c5faf4..62394a1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -485,10 +485,10 @@ cross-spawn@^6.0.5: shebang-command "^1.2.0" which "^1.2.9" -custom-card-helpers@^1.3.5: - version "1.3.5" - resolved "https://registry.yarnpkg.com/custom-card-helpers/-/custom-card-helpers-1.3.5.tgz#6e55a813ce9e8b83ccdd34011501b8b094d36ab5" - integrity sha512-fEcqN6ESAHpfaYWGn+0EkzG9eH7DBqY66CCvp1OqdWwdZQ9jxOYRm16ZQjEnXaSvfUy9QYDfDmowQQ3SjofxDw== +custom-card-helpers@^1.3.9: + version "1.3.9" + resolved "https://registry.yarnpkg.com/custom-card-helpers/-/custom-card-helpers-1.3.9.tgz#ec4794bd9aadebc93a0d87f79e1d19bdb9610e23" + integrity sha512-lpgkIHLWf6l6leSd9kA4oW9jW7mrXKwlW3jV/0ON04r8qqdhaOtSqaRqecBW+Jqk87bIb0WC4F9Xq2+HpNRwKw== dependencies: fecha "^3.0.3" home-assistant-js-websocket "^4.4.0" @@ -589,6 +589,13 @@ eslint-config-airbnb-base@^14.0.0: object.assign "^4.1.0" object.entries "^1.1.0" +eslint-config-prettier@^6.5.0: + version "6.5.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-6.5.0.tgz#aaf9a495e2a816865e541bfdbb73a65cc162b3eb" + integrity sha512-cjXp8SbO9VFGW/Z7mbTydqS9to8Z58E5aYhj3e1+Hx7lS9s6gL5ILKNpCqZAFOVYRcSkWPFYljHrEh8QFEK5EQ== + dependencies: + get-stdin "^6.0.0" + eslint-import-resolver-node@^0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz#58f15fb839b8d0576ca980413476aab2472db66a" @@ -622,6 +629,13 @@ eslint-plugin-import@^2.18.2: read-pkg-up "^2.0.0" resolve "^1.11.0" +eslint-plugin-prettier@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.1.tgz#507b8562410d02a03f0ddc949c616f877852f2ba" + integrity sha512-A+TZuHZ0KU0cnn56/9mfR7/KjUJ9QNVXUhwvRFSR7PGPe0zQR6PTkmyqg1AtUUEOzTqeRsUwyKFh0oVZKVCrtA== + dependencies: + prettier-linter-helpers "^1.0.0" + eslint-scope@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.0.0.tgz#e87c8887c73e8d1ec84f1ca591645c358bfc8fb9" @@ -749,6 +763,11 @@ fast-deep-equal@^2.0.1: resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= +fast-diff@^1.1.2: + version "1.2.0" + resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03" + integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w== + fast-json-stable-stringify@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" @@ -857,6 +876,11 @@ functional-red-black-tree@^1.0.1: resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= +get-stdin@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b" + integrity sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g== + glob-parent@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.0.0.tgz#1dc99f0f39b006d3e92c2c284068382f0c20e954" @@ -1157,7 +1181,7 @@ lit-element@^2.1.0, lit-element@^2.2.1: dependencies: lit-html "^1.0.0" -lit-html@^1.0.0: +lit-html@^1.0.0, lit-html@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/lit-html/-/lit-html-1.1.2.tgz#2e3560a7075210243649c888ad738eaf0daa8374" integrity sha512-FFlUMKHKi+qG1x1iHNZ1hrtc/zHmfYTyrSvs3/wBTvaNtpZjOZGWzU7efGYVpgp6KvWeKF6ql9/KsCq6Z/mEDA== @@ -1455,6 +1479,13 @@ prelude-ls@~1.1.2: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= +prettier-linter-helpers@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" + integrity sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w== + dependencies: + fast-diff "^1.1.2" + prettier@^1.18.2: version "1.18.2" resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.18.2.tgz#6823e7c5900017b4bd3acf46fe9ac4b4d7bda9ea"