Files
haos_config/custom_components/hacs/hacs_frontend/frontend_latest/925.71a91781c4fa3c11.js
2026-01-30 23:31:00 -06:00

3 lines
11 KiB
JavaScript

/*! For license information please see 925.71a91781c4fa3c11.js.LICENSE.txt */
export const ids=["925"];export const modules={20095:function(e,t,i){var o=i(44249),n=i(31622),a=i(57243),s=i(50778),l=i(22344);(0,o.Z)([(0,s.Mo)("ha-button")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",static:!0,key:"styles",value:()=>[l.W,a.iv`::slotted([slot=icon]){margin-inline-start:0px;margin-inline-end:8px;direction:var(--direction);display:block}.mdc-button{height:var(--button-height,36px)}.trailing-icon{display:flex}.slot-container{overflow:var(--button-slot-container-overflow,visible)}`]}]}}),n.z)},14002:function(e,t,i){var o=i(44249),n=i(72621),a=(i(22139),i(39527),i(99790),i(57243)),s=i(50778),l=i(11297);(0,o.Z)([(0,s.Mo)("ha-sortable")],(function(e,t){class o extends t{constructor(...t){super(...t),e(this)}}return{F:o,d:[{kind:"field",key:"_sortable",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,s.Cb)({type:Boolean,attribute:"no-style"})],key:"noStyle",value:()=>!1},{kind:"field",decorators:[(0,s.Cb)({type:String,attribute:"draggable-selector"})],key:"draggableSelector",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:String,attribute:"handle-selector"})],key:"handleSelector",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:String,attribute:"filter"})],key:"filter",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:String})],key:"group",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean,attribute:"invert-swap"})],key:"invertSwap",value:()=>!1},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"options",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"rollback",value:()=>!0},{kind:"method",key:"updated",value:function(e){e.has("disabled")&&(this.disabled?this._destroySortable():this._createSortable())}},{kind:"field",key:"_shouldBeDestroy",value:()=>!1},{kind:"method",key:"disconnectedCallback",value:function(){(0,n.Z)(o,"disconnectedCallback",this,3)([]),this._shouldBeDestroy=!0,setTimeout((()=>{this._shouldBeDestroy&&(this._destroySortable(),this._shouldBeDestroy=!1)}),1)}},{kind:"method",key:"connectedCallback",value:function(){(0,n.Z)(o,"connectedCallback",this,3)([]),this._shouldBeDestroy=!1,this.hasUpdated&&!this.disabled&&this._createSortable()}},{kind:"method",key:"createRenderRoot",value:function(){return this}},{kind:"method",key:"render",value:function(){return this.noStyle?a.Ld:a.dy` <style>.sortable-fallback{display:none!important}.sortable-ghost{box-shadow:0 0 0 2px var(--primary-color);background:rgba(var(--rgb-primary-color),.25);border-radius:4px;opacity:.4}.sortable-drag{border-radius:4px;opacity:1;background:var(--card-background-color);box-shadow:0px 4px 8px 3px #00000026;cursor:grabbing}</style> `}},{kind:"method",key:"_createSortable",value:async function(){if(this._sortable)return;const e=this.children[0];if(!e)return;const t=(await Promise.all([i.e("4153"),i.e("9358")]).then(i.bind(i,97659))).default,o={scroll:!0,forceAutoScrollFallback:!0,scrollSpeed:20,animation:150,...this.options,onChoose:this._handleChoose,onStart:this._handleStart,onEnd:this._handleEnd,onUpdate:this._handleUpdate,onAdd:this._handleAdd,onRemove:this._handleRemove};this.draggableSelector&&(o.draggable=this.draggableSelector),this.handleSelector&&(o.handle=this.handleSelector),void 0!==this.invertSwap&&(o.invertSwap=this.invertSwap),this.group&&(o.group=this.group),this.filter&&(o.filter=this.filter),this._sortable=new t(e,o)}},{kind:"field",key:"_handleUpdate",value(){return e=>{(0,l.B)(this,"item-moved",{newIndex:e.newIndex,oldIndex:e.oldIndex})}}},{kind:"field",key:"_handleAdd",value(){return e=>{(0,l.B)(this,"item-added",{index:e.newIndex,data:e.item.sortableData})}}},{kind:"field",key:"_handleRemove",value(){return e=>{(0,l.B)(this,"item-removed",{index:e.oldIndex})}}},{kind:"field",key:"_handleEnd",value(){return async e=>{(0,l.B)(this,"drag-end"),this.rollback&&e.item.placeholder&&(e.item.placeholder.replaceWith(e.item),delete e.item.placeholder)}}},{kind:"field",key:"_handleStart",value(){return()=>{(0,l.B)(this,"drag-start")}}},{kind:"field",key:"_handleChoose",value(){return e=>{this.rollback&&(e.item.placeholder=document.createComment("sort-placeholder"),e.item.after(e.item.placeholder))}}},{kind:"method",key:"_destroySortable",value:function(){this._sortable&&(this._sortable.destroy(),this._sortable=void 0)}}]}}),a.oi)},38344:function(e,t,i){i.r(t);var o=i(44249),n=(i(2060),i(57243)),a=i(50778),s=i(91583),l=i(11297),d=(i(20095),i(59897),i(74064),i(14002),i(70596),i(4557)),r=i(66193);(0,o.Z)([(0,a.Mo)("ha-input_select-form")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,a.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,a.Cb)({type:Boolean})],key:"new",value:()=>!1},{kind:"field",key:"_item",value:void 0},{kind:"field",decorators:[(0,a.SB)()],key:"_name",value:void 0},{kind:"field",decorators:[(0,a.SB)()],key:"_icon",value:void 0},{kind:"field",decorators:[(0,a.SB)()],key:"_options",value:()=>[]},{kind:"field",decorators:[(0,a.IO)("#option_input",!0)],key:"_optionInput",value:void 0},{kind:"method",key:"_optionMoved",value:function(e){e.stopPropagation();const{oldIndex:t,newIndex:i}=e.detail,o=this._options.concat(),n=o.splice(t,1)[0];o.splice(i,0,n),(0,l.B)(this,"value-changed",{value:{...this._item,options:o}})}},{kind:"set",key:"item",value:function(e){this._item=e,e?(this._name=e.name||"",this._icon=e.icon||"",this._options=e.options||[]):(this._name="",this._icon="",this._options=[])}},{kind:"method",key:"focus",value:function(){this.updateComplete.then((()=>this.shadowRoot?.querySelector("[dialogInitialFocus]")?.focus()))}},{kind:"method",key:"render",value:function(){return this.hass?n.dy` <div class="form"> <ha-textfield dialogInitialFocus autoValidate required .validationMessage="${this.hass.localize("ui.dialogs.helper_settings.required_error_msg")}" .value="${this._name}" .label="${this.hass.localize("ui.dialogs.helper_settings.generic.name")}" .configValue="${"name"}" @input="${this._valueChanged}"></ha-textfield> <ha-icon-picker .hass="${this.hass}" .value="${this._icon}" .configValue="${"icon"}" @value-changed="${this._valueChanged}" .label="${this.hass.localize("ui.dialogs.helper_settings.generic.icon")}"></ha-icon-picker> <div class="header"> ${this.hass.localize("ui.dialogs.helper_settings.input_select.options")}: </div> <ha-sortable @item-moved="${this._optionMoved}" handle-selector=".handle"> <mwc-list class="options"> ${this._options.length?(0,s.r)(this._options,(e=>e),((e,t)=>n.dy` <ha-list-item class="option" hasMeta> <div class="optioncontent"> <div class="handle"> <ha-svg-icon .path="${"M7,19V17H9V19H7M11,19V17H13V19H11M15,19V17H17V19H15M7,15V13H9V15H7M11,15V13H13V15H11M15,15V13H17V15H15M7,11V9H9V11H7M11,11V9H13V11H11M15,11V9H17V11H15M7,7V5H9V7H7M11,7V5H13V7H11M15,7V5H17V7H15Z"}"></ha-svg-icon> </div> ${e} </div> <ha-icon-button slot="meta" .index="${t}" .label="${this.hass.localize("ui.dialogs.helper_settings.input_select.remove_option")}" @click="${this._removeOption}" .path="${"M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z"}"></ha-icon-button> </ha-list-item> `)):n.dy` <ha-list-item noninteractive> ${this.hass.localize("ui.dialogs.helper_settings.input_select.no_options")} </ha-list-item> `} </mwc-list> </ha-sortable> <div class="layout horizontal center"> <ha-textfield class="flex-auto" id="option_input" .label="${this.hass.localize("ui.dialogs.helper_settings.input_select.add_option")}" @keydown="${this._handleKeyAdd}"></ha-textfield> <ha-button @click="${this._addOption}">${this.hass.localize("ui.dialogs.helper_settings.input_select.add")}</ha-button> </div> </div> `:n.Ld}},{kind:"method",key:"_handleKeyAdd",value:function(e){e.stopPropagation(),"Enter"===e.key&&this._addOption()}},{kind:"method",key:"_addOption",value:function(){const e=this._optionInput;e?.value&&((0,l.B)(this,"value-changed",{value:{...this._item,options:[...this._options,e.value]}}),e.value="")}},{kind:"method",key:"_removeOption",value:async function(e){const t=e.target.index;if(!await(0,d.g7)(this,{title:this.hass.localize("ui.dialogs.helper_settings.input_select.confirm_delete.delete"),text:this.hass.localize("ui.dialogs.helper_settings.input_select.confirm_delete.prompt"),destructive:!0}))return;const i=[...this._options];i.splice(t,1),(0,l.B)(this,"value-changed",{value:{...this._item,options:i}})}},{kind:"method",key:"_valueChanged",value:function(e){if(!this.new&&!this._item)return;e.stopPropagation();const t=e.target.configValue,i=e.detail?.value||e.target.value;if(this[`_${t}`]===i)return;const o={...this._item};i?o[t]=i:delete o[t],(0,l.B)(this,"value-changed",{value:o})}},{kind:"get",static:!0,key:"styles",value:function(){return[r.Qx,n.iv`.form{color:var(--primary-text-color)}.option{border:1px solid var(--divider-color);border-radius:4px;margin-top:4px;--mdc-icon-button-size:24px;--mdc-ripple-color:transparent;--mdc-list-side-padding:16px;cursor:default;background-color:var(--card-background-color)}mwc-button{margin-left:8px;margin-inline-start:8px;margin-inline-end:initial}ha-textfield{display:block;margin-bottom:8px}#option_input{margin-top:8px}.header{margin-top:8px;margin-bottom:8px}.handle{cursor:move;cursor:grab;padding-right:12px;padding-inline-end:12px;padding-inline-start:initial}.handle ha-svg-icon{pointer-events:none;height:24px}.optioncontent{display:flex;align-items:center}`]}}]}}),n.oi)},87319:function(e,t,i){var o=i(9065),n=i(50778),a=i(65703),s=i(46289);let l=class extends a.K{};l.styles=[s.W],l=(0,o.gn)([(0,n.Mo)("mwc-list-item")],l)},91583:function(e,t,i){i.d(t,{r:()=>l});var o=i("2841"),n=i("45779"),a=i("53232");const s=(e,t,i)=>{const o=new Map;for(let n=t;n<=i;n++)o.set(e[n],n);return o},l=(0,n.XM)(class extends n.Xe{constructor(e){if(super(e),e.type!==n.pX.CHILD)throw Error("repeat() can only be used in text expressions")}ct(e,t,i){let o;void 0===i?i=t:void 0!==t&&(o=t);const n=[],a=[];let s=0;for(const t of e)n[s]=o?o(t,s):s,a[s]=i(t,s),s++;return{values:a,keys:n}}render(e,t,i){return this.ct(e,t,i).values}update(e,[t,i,n]){var l;const d=(0,a.i9)(e),{values:r,keys:h}=this.ct(t,i,n);if(!Array.isArray(d))return this.ut=h,r;const c=null!==(l=this.ut)&&void 0!==l?l:this.ut=[],u=[];let p,v,k=0,f=d.length-1,g=0,_=r.length-1;for(;k<=f&&g<=_;)if(null===d[k])k++;else if(null===d[f])f--;else if(c[k]===h[g])u[g]=(0,a.fk)(d[k],r[g]),k++,g++;else if(c[f]===h[_])u[_]=(0,a.fk)(d[f],r[_]),f--,_--;else if(c[k]===h[_])u[_]=(0,a.fk)(d[k],r[_]),(0,a._Y)(e,u[_+1],d[k]),k++,_--;else if(c[f]===h[g])u[g]=(0,a.fk)(d[f],r[g]),(0,a._Y)(e,d[k],d[f]),f--,g++;else if(void 0===p&&(p=s(h,g,_),v=s(c,k,f)),p.has(c[k]))if(p.has(c[f])){const t=v.get(h[g]),i=void 0!==t?d[t]:null;if(null===i){const t=(0,a._Y)(e,d[k]);(0,a.fk)(t,r[g]),u[g]=t}else u[g]=(0,a.fk)(i,r[g]),(0,a._Y)(e,d[k],i),d[t]=null;g++}else(0,a.ws)(d[f]),f--;else(0,a.ws)(d[k]),k++;for(;g<=_;){const t=(0,a._Y)(e,u[_+1]);(0,a.fk)(t,r[g]),u[g++]=t}for(;k<=f;){const e=d[k++];null!==e&&(0,a.ws)(e)}return this.ut=h,(0,a.hl)(e,u),o.Jb}})}};
//# sourceMappingURL=925.71a91781c4fa3c11.js.map