landingpage/rootfs/usr/share/www/frontend_es5/980.dgsBpjxm4Ws.js

2 lines
16 KiB
JavaScript

"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[980],{31980:function(e,t,i){var a,n,o=i(64599),r=i(33994),l=i(22858),d=i(35806),s=i(71008),c=i(62193),p=i(2816),h=i(34441),f=(i(81027),i(70663)),u=i(15224),m=i(85323),g=i(10977),v=i(34897),x=i(35890),y=i(41981),_=(i(71499),i(95737),i(26098),i(39790),i(66457),i(99019),i(96858),i(61453)),k=i(60207),b=void 0;_.m.addInitializer(function(){var e=(0,l.A)((0,r.A)().mark((function e(t){var i,a,n;return(0,r.A)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.updateComplete;case 2:(i=t).dialog.prepend(i.scrim),i.scrim.style.inset=0,i.scrim.style.zIndex=0,a=i.getOpenAnimation,n=i.getCloseAnimation,i.getOpenAnimation=function(){var e,t,i=a.call(b);return i.container=[].concat((0,y.A)(null!==(e=i.container)&&void 0!==e?e:[]),(0,y.A)(null!==(t=i.dialog)&&void 0!==t?t:[])),i.dialog=[],i},i.getCloseAnimation=function(){var e,t,i=n.call(b);return i.container=[].concat((0,y.A)(null!==(e=i.container)&&void 0!==e?e:[]),(0,y.A)(null!==(t=i.dialog)&&void 0!==t?t:[])),i.dialog=[],i};case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());(0,h.A)([(0,u.EM)("ha-md-dialog")],(function(e,t){var h,m,g=function(t){function a(){var t;return(0,s.A)(this,a),t=(0,c.A)(this,a),e(t),t.addEventListener("cancel",t._handleCancel),"function"!=typeof HTMLDialogElement&&(t.addEventListener("open",t._handleOpen),n||(n=i.e(314).then(i.bind(i,81314)))),void 0===t.animate&&(t.quick=!0),void 0===t.animate&&(t.quick=!0),t}return(0,p.A)(a,t),(0,d.A)(a)}(t);return{F:g,d:[{kind:"field",decorators:[(0,u.MZ)({attribute:"disable-cancel-action",type:Boolean})],key:"disableCancelAction",value:function(){return!1}},{kind:"field",key:"_polyfillDialogRegistered",value:function(){return!1}},{kind:"method",key:"_handleOpen",value:(m=(0,l.A)((0,r.A)().mark((function e(t){var i,a;return(0,r.A)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.preventDefault(),!this._polyfillDialogRegistered){e.next=3;break}return e.abrupt("return");case 3:return this._polyfillDialogRegistered=!0,this._loadPolyfillStylesheet("/static/polyfills/dialog-polyfill.css"),a=null===(i=this.shadowRoot)||void 0===i?void 0:i.querySelector("dialog"),e.next=8,n;case 8:e.sent.default.registerDialog(a),this.removeEventListener("open",this._handleOpen),this.show();case 12:case"end":return e.stop()}}),e,this)}))),function(e){return m.apply(this,arguments)})},{kind:"method",key:"_loadPolyfillStylesheet",value:(h=(0,l.A)((0,r.A)().mark((function e(t){var i,a=this;return(0,r.A)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(i=document.createElement("link")).rel="stylesheet",i.href=t,e.abrupt("return",new Promise((function(e,n){var o;i.onload=function(){return e()},i.onerror=function(){return n(new Error("Stylesheet failed to load: ".concat(t)))},null===(o=a.shadowRoot)||void 0===o||o.appendChild(i)})));case 4:case"end":return e.stop()}}),e)}))),function(e){return h.apply(this,arguments)})},{kind:"method",key:"_handleCancel",value:function(e){if(this.disableCancelAction){var t;e.preventDefault();var i=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("dialog .container");void 0!==this.animate&&(null==i||i.animate([{transform:"rotate(-1deg)","animation-timing-function":"ease-in"},{transform:"rotate(1.5deg)","animation-timing-function":"ease-out"},{transform:"rotate(0deg)","animation-timing-function":"ease-in"}],{duration:200,iterations:2}))}}},{kind:"field",static:!0,key:"styles",value:function(){return[].concat((0,y.A)((0,x.A)(g,"styles",this)),[(0,f.AH)(a||(a=(0,o.A)([":host{--md-dialog-container-color:var(--card-background-color);--md-dialog-headline-color:var(--primary-text-color);--md-dialog-supporting-text-color:var(--primary-text-color);--md-sys-color-scrim:#000000;--md-dialog-headline-weight:400;--md-dialog-headline-size:1.574rem;--md-dialog-supporting-text-size:1rem;--md-dialog-supporting-text-line-height:1.5rem}:host([type=alert]){min-width:320px}@media all and (max-width:450px),all and (max-height:500px){:host(:not([type=alert])){min-width:calc(100vw - env(safe-area-inset-right) - env(safe-area-inset-left));max-width:calc(100vw - env(safe-area-inset-right) - env(safe-area-inset-left));min-height:100%;max-height:100%;--md-dialog-container-shape:0}}::slotted(ha-dialog-header[slot=headline]){display:contents}.scroller{overflow:var(--dialog-content-overflow,auto)}slot[name=content]::slotted(*){padding:var(--dialog-content-padding,24px)}.scrim{z-index:10}"])))])}}]}}),_.m),Object.assign(Object.assign({},k.T),{},{dialog:[[[{transform:"translateY(50px)"},{transform:"translateY(0)"}],{duration:500,easing:"cubic-bezier(.3,0,0,1)"}]],container:[[[{opacity:0},{opacity:1}],{duration:50,easing:"linear",pseudoElement:"::before"}]]}),Object.assign(Object.assign({},k.N),{},{dialog:[[[{transform:"translateY(0)"},{transform:"translateY(50px)"}],{duration:150,easing:"cubic-bezier(.3,0,0,1)"}]],container:[[[{opacity:"1"},{opacity:"0"}],{delay:100,duration:50,easing:"linear",pseudoElement:"::before"}]]}),(0,h.A)([(0,u.EM)("ha-dialog-header")],(function(e,t){var i=function(t){function i(){var t;(0,s.A)(this,i);for(var a=arguments.length,n=new Array(a),o=0;o<a;o++)n[o]=arguments[o];return t=(0,c.A)(this,i,[].concat(n)),e(t),t}return(0,p.A)(i,t),(0,d.A)(i)}(t);return{F:i,d:[{kind:"method",key:"render",value:function(){return(0,f.qy)(A||(A=(0,o.A)([' <header class="header"> <div class="header-bar"> <section class="header-navigation-icon"> <slot name="navigationIcon"></slot> </section> <section class="header-content"> <div class="header-title"> <slot name="title"></slot> </div> <div class="header-subtitle"> <slot name="subtitle"></slot> </div> </section> <section class="header-action-items"> <slot name="actionItems"></slot> </section> </div> <slot></slot> </header> '])))}},{kind:"get",static:!0,key:"styles",value:function(){return[(0,f.AH)(w||(w=(0,o.A)([":host{display:block}:host([show-border]){border-bottom:1px solid var(--mdc-dialog-scroll-divider-color,rgba(0,0,0,.12))}.header-bar{display:flex;flex-direction:row;align-items:flex-start;padding:4px;box-sizing:border-box}.header-content{flex:1;padding:10px 4px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.header-title{font-size:22px;line-height:28px;font-weight:400}.header-subtitle{font-size:14px;line-height:20px;color:var(--secondary-text-color)}@media all and (min-width:450px) and (min-height:500px){.header-bar{padding:12px}}.header-navigation-icon{flex:none;min-width:8px;height:100%;display:flex;flex-direction:row}.header-action-items{flex:none;min-width:8px;height:100%;display:flex;flex-direction:row}"])))]}}]}}),f.WF),i(88400),i(7460);var A,w,M,E,z,C,S,D,H,q,F,I,O=i(20822),T=i(67449),Z=i(542);(0,h.A)([(0,u.EM)("ha-textfield")],(function(e,t){var i=function(t){function i(){var t;(0,s.A)(this,i);for(var a=arguments.length,n=new Array(a),o=0;o<a;o++)n[o]=arguments[o];return t=(0,c.A)(this,i,[].concat(n)),e(t),t}return(0,p.A)(i,t),(0,d.A)(i)}(t);return{F:i,d:[{kind:"field",decorators:[(0,u.MZ)({type:Boolean})],key:"invalid",value:void 0},{kind:"field",decorators:[(0,u.MZ)({attribute:"error-message"})],key:"errorMessage",value:void 0},{kind:"field",decorators:[(0,u.MZ)({type:Boolean})],key:"icon",value:function(){return!1}},{kind:"field",decorators:[(0,u.MZ)({type:Boolean})],key:"iconTrailing",value:function(){return!1}},{kind:"field",decorators:[(0,u.MZ)()],key:"autocomplete",value:void 0},{kind:"field",decorators:[(0,u.MZ)()],key:"autocorrect",value:void 0},{kind:"field",decorators:[(0,u.MZ)({attribute:"input-spellcheck"})],key:"inputSpellcheck",value:void 0},{kind:"field",decorators:[(0,u.P)("input")],key:"formElement",value:void 0},{kind:"method",key:"updated",value:function(e){(0,x.A)(i,"updated",this,3)([e]),(e.has("invalid")||e.has("errorMessage"))&&(this.setCustomValidity(this.invalid?this.errorMessage||this.validationMessage||"Invalid":""),(this.invalid||this.validateOnInitialRender||e.has("invalid")&&void 0!==e.get("invalid"))&&this.reportValidity()),e.has("autocomplete")&&(this.autocomplete?this.formElement.setAttribute("autocomplete",this.autocomplete):this.formElement.removeAttribute("autocomplete")),e.has("autocorrect")&&(this.autocorrect?this.formElement.setAttribute("autocorrect",this.autocorrect):this.formElement.removeAttribute("autocorrect")),e.has("inputSpellcheck")&&(this.inputSpellcheck?this.formElement.setAttribute("spellcheck",this.inputSpellcheck):this.formElement.removeAttribute("spellcheck"))}},{kind:"method",key:"renderIcon",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=t?"trailing":"leading";return(0,f.qy)(M||(M=(0,o.A)([' <span class="mdc-text-field__icon mdc-text-field__icon--','" tabindex="','"> <slot name="','Icon"></slot> </span> '])),i,t?1:-1,i)}},{kind:"field",static:!0,key:"styles",value:function(){return[T.R,(0,f.AH)(E||(E=(0,o.A)([".mdc-text-field__input{width:var(--ha-textfield-input-width,100%)}.mdc-text-field:not(.mdc-text-field--with-leading-icon){padding:var(--text-field-padding,0px 16px)}.mdc-text-field__affix--suffix{padding-left:var(--text-field-suffix-padding-left,12px);padding-right:var(--text-field-suffix-padding-right,0px);padding-inline-start:var(--text-field-suffix-padding-left,12px);padding-inline-end:var(--text-field-suffix-padding-right,0px);direction:ltr}.mdc-text-field--with-leading-icon{padding-inline-start:var(--text-field-suffix-padding-left,0px);padding-inline-end:var(--text-field-suffix-padding-right,16px);direction:var(--direction)}.mdc-text-field--with-leading-icon.mdc-text-field--with-trailing-icon{padding-left:var(--text-field-suffix-padding-left,0px);padding-right:var(--text-field-suffix-padding-right,0px);padding-inline-start:var(--text-field-suffix-padding-left,0px);padding-inline-end:var(--text-field-suffix-padding-right,0px)}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__affix--suffix{color:var(--secondary-text-color)}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__icon{color:var(--secondary-text-color)}.mdc-text-field__icon--leading{margin-inline-start:16px;margin-inline-end:8px;direction:var(--direction)}.mdc-text-field__icon--trailing{padding:var(--textfield-icon-trailing-padding,12px)}.mdc-floating-label:not(.mdc-floating-label--float-above){text-overflow:ellipsis;width:inherit;padding-right:30px;padding-inline-end:30px;padding-inline-start:initial;box-sizing:border-box;direction:var(--direction)}input{text-align:var(--text-field-text-align,start)}::-ms-reveal{display:none}:host([no-spinner]) input::-webkit-inner-spin-button,:host([no-spinner]) input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}:host([no-spinner]) input[type=number]{-moz-appearance:textfield}.mdc-text-field__ripple{overflow:hidden}.mdc-text-field{overflow:var(--text-field-overflow)}.mdc-floating-label{inset-inline-start:16px!important;inset-inline-end:initial!important;transform-origin:var(--float-start);direction:var(--direction);text-align:var(--float-start)}.mdc-text-field--with-leading-icon.mdc-text-field--filled .mdc-floating-label{max-width:calc(100% - 48px - var(--text-field-suffix-padding-left,0px));inset-inline-start:calc(48px + var(--text-field-suffix-padding-left,0px))!important;inset-inline-end:initial!important;direction:var(--direction)}.mdc-text-field__input[type=number]{direction:var(--direction)}.mdc-text-field__affix--prefix{padding-right:var(--text-field-prefix-padding-right,2px);padding-inline-end:var(--text-field-prefix-padding-right,2px);padding-inline-start:initial}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__affix--prefix{color:var(--mdc-text-field-label-ink-color)}"]))),"rtl"===Z.G.document.dir?(0,f.AH)(z||(z=(0,o.A)([".mdc-floating-label,.mdc-text-field--with-leading-icon,.mdc-text-field--with-leading-icon.mdc-text-field--filled .mdc-floating-label,.mdc-text-field__icon--leading,.mdc-text-field__input[type=number]{direction:rtl;--direction:rtl}"]))):(0,f.AH)(C||(C=(0,o.A)([""])))]}}]}}),O.J),(0,h.A)([(0,u.EM)("dialog-box")],(function(e,t){var i,a=function(t){function i(){var t;(0,s.A)(this,i);for(var a=arguments.length,n=new Array(a),o=0;o<a;o++)n[o]=arguments[o];return t=(0,c.A)(this,i,[].concat(n)),e(t),t}return(0,p.A)(i,t),(0,d.A)(i)}(t);return{F:a,d:[{kind:"field",decorators:[(0,u.MZ)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,u.wk)()],key:"_params",value:void 0},{kind:"field",decorators:[(0,u.wk)()],key:"_closeState",value:void 0},{kind:"field",decorators:[(0,u.P)("ha-textfield")],key:"_textField",value:void 0},{kind:"field",decorators:[(0,u.P)("ha-md-dialog")],key:"_dialog",value:void 0},{kind:"method",key:"showDialog",value:(i=(0,l.A)((0,r.A)().mark((function e(t){return(0,r.A)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this._params=t;case 1:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{kind:"method",key:"closeDialog",value:function(){var e,t;return!(null!==(e=this._params)&&void 0!==e&&e.confirmation||null!==(t=this._params)&&void 0!==t&&t.prompt)&&(!this._params||(this._dismiss(),!0))}},{kind:"method",key:"render",value:function(){if(!this._params)return f.s6;var e=this._params.confirmation||this._params.prompt,t=this._params.title||this._params.confirmation&&this.hass.localize("ui.dialogs.generic.default_confirmation_title");return(0,f.qy)(S||(S=(0,o.A)([' <ha-md-dialog open .disableCancelAction="','" @closed="','" type="alert" aria-labelledby="dialog-box-title" aria-describedby="dialog-box-description"> <div slot="headline"> <span .title="','" id="dialog-box-title"> '," ",' </span> </div> <div slot="content" id="dialog-box-description"> '," ",' </div> <div slot="actions"> ',' <ha-button @click="','" ?dialogInitialFocus="','" class="','"> '," </ha-button> </div> </ha-md-dialog> "])),e||!1,this._dialogClosed,t,this._params.warning?(0,f.qy)(D||(D=(0,o.A)(['<ha-svg-icon .path="','" style="color:var(--warning-color)"></ha-svg-icon> '])),"M12,2L1,21H23M12,6L19.53,19H4.47M11,10V14H13V10M11,16V18H13V16"):f.s6,t,this._params.text?(0,f.qy)(H||(H=(0,o.A)([" <p>","</p> "])),this._params.text):"",this._params.prompt?(0,f.qy)(q||(q=(0,o.A)([' <ha-textfield dialogInitialFocus value="','" .placeholder="','" .label="','" .type="','" .min="','" .max="','"></ha-textfield> '])),(0,g.J)(this._params.defaultValue),this._params.placeholder,this._params.inputLabel?this._params.inputLabel:"",this._params.inputType?this._params.inputType:"text",this._params.inputMin,this._params.inputMax):"",e&&(0,f.qy)(F||(F=(0,o.A)([' <ha-button @click="','" ?dialogInitialFocus="','"> '," </ha-button> "])),this._dismiss,!this._params.prompt&&this._params.destructive,this._params.dismissText?this._params.dismissText:this.hass.localize("ui.dialogs.generic.cancel")),this._confirm,!this._params.prompt&&!this._params.destructive,(0,m.H)({destructive:this._params.destructive||!1}),this._params.confirmText?this._params.confirmText:this.hass.localize("ui.dialogs.generic.ok"))}},{kind:"method",key:"_cancel",value:function(){var e;null!==(e=this._params)&&void 0!==e&&e.cancel&&this._params.cancel()}},{kind:"method",key:"_dismiss",value:function(){this._closeState="canceled",this._closeDialog(),this._cancel()}},{kind:"method",key:"_confirm",value:function(){var e;(this._closeState="confirmed",this._closeDialog(),this._params.confirm)&&this._params.confirm(null===(e=this._textField)||void 0===e?void 0:e.value)}},{kind:"method",key:"_closeDialog",value:function(){var e;(0,v.r)(this,"dialog-closed",{dialog:this.localName}),null===(e=this._dialog)||void 0===e||e.close()}},{kind:"method",key:"_dialogClosed",value:function(){this._closeState||((0,v.r)(this,"dialog-closed",{dialog:this.localName}),this._cancel()),this._closeState=void 0,this._params=void 0}},{kind:"get",static:!0,key:"styles",value:function(){return(0,f.AH)(I||(I=(0,o.A)([":host([inert]){pointer-events:initial!important;cursor:initial!important}a{color:var(--primary-color)}p{margin:0;color:var(--primary-text-color)}.no-bottom-padding{padding-bottom:0}.secondary{color:var(--secondary-text-color)}.destructive{--mdc-theme-primary:var(--error-color)}ha-textfield{width:100%}"])))}}]}}),f.WF)}}]);
//# sourceMappingURL=980.dgsBpjxm4Ws.js.map