UNPKG

iobroker.lovelace

Version:

With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI

6 lines 28.2 kB
/*! For license information please see 7964.7670e9f51430ef3e.js.LICENSE.txt */ export const __webpack_ids__=["7964"];export const __webpack_modules__={93958:function(t,e,i){i.d(e,{F:()=>h});var s=i(9065),n=i(15093),o=i(92444),a=i(76688);let r=class extends o.A{};r.styles=[a.W],r=(0,s.__decorate)([(0,n.Mo)("mwc-checkbox")],r);var l=i(57243),d=i(35359),c=i(65703);class h extends c.K{constructor(){super(...arguments),this.left=!1,this.graphic="control"}render(){const t={"mdc-deprecated-list-item__graphic":this.left,"mdc-deprecated-list-item__meta":!this.left},e=this.renderText(),i=this.graphic&&"control"!==this.graphic&&!this.left?this.renderGraphic():l.dy``,s=this.hasMeta&&this.left?this.renderMeta():l.dy``,n=this.renderRipple();return l.dy` ${n} ${i} ${this.left?"":e} <span class="${(0,d.$)(t)}"> <mwc-checkbox reducedTouchTarget tabindex="${this.tabindex}" .checked="${this.selected}" ?disabled="${this.disabled}" @change="${this.onChange}"> </mwc-checkbox> </span> ${this.left?e:""} ${s}`}async onChange(t){const e=t.target;this.selected===e.checked||(this._skipPropRequest=!0,this.selected=e.checked,await this.updateComplete,this._skipPropRequest=!1)}}(0,s.__decorate)([(0,n.IO)("slot")],h.prototype,"slotElement",void 0),(0,s.__decorate)([(0,n.IO)("mwc-checkbox")],h.prototype,"checkboxElement",void 0),(0,s.__decorate)([(0,n.Cb)({type:Boolean})],h.prototype,"left",void 0),(0,s.__decorate)([(0,n.Cb)({type:String,reflect:!0})],h.prototype,"graphic",void 0)},97536:function(t,e,i){i.d(e,{W:()=>s});const s=i(57243).iv`:host(:not([twoline])){height:56px}:host(:not([left])) .mdc-deprecated-list-item__meta{height:40px;width:40px}`},59826:function(t,e,i){var s=i(44249),n=i(31622),o=i(57243),a=i(15093),r=i(22344);(0,s.Z)([(0,a.Mo)("ha-button")],(function(t,e){return{F:class extends e{constructor(...e){super(...e),t(this)}},d:[{kind:"field",static:!0,key:"styles",value:()=>[r.W,o.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)}:host([destructive]){--mdc-theme-primary:var(--error-color)}`]}]}}),n.Button)},48103:function(t,e,i){var s=i(44249),n=i(72621),o=i(57243),a=i(93958),r=i(97536),l=i(46289),d=i(15093),c=i(36522);(0,s.Z)([(0,d.Mo)("ha-check-list-item")],(function(t,e){class i extends e{constructor(...e){super(...e),t(this)}}return{F:i,d:[{kind:"method",key:"onChange",value:async function(t){(0,n.Z)(i,"onChange",this,3)([t]),(0,c.B)(this,t.type)}},{kind:"field",static:!0,key:"styles",value:()=>[l.W,r.W,o.iv`:host{--mdc-theme-secondary:var(--primary-color)}:host([graphic=avatar]) .mdc-deprecated-list-item__graphic,:host([graphic=control]) .mdc-deprecated-list-item__graphic,:host([graphic=large]) .mdc-deprecated-list-item__graphic,:host([graphic=medium]) .mdc-deprecated-list-item__graphic{margin-inline-end:var(--mdc-list-item-graphic-margin,16px);margin-inline-start:0px;direction:var(--direction)}.mdc-deprecated-list-item__meta{flex-shrink:0;direction:var(--direction);margin-inline-start:auto;margin-inline-end:0}.mdc-deprecated-list-item__graphic{margin-top:var(--check-list-item-graphic-margin-top)}:host([graphic=icon]) .mdc-deprecated-list-item__graphic{margin-inline-start:0;margin-inline-end:var(--mdc-list-item-graphic-margin,32px)}`]}]}}),a.F)},95198:function(t,e,i){var s=i(44249),n=i(57243),o=i(15093);(0,s.Z)([(0,o.Mo)("ha-dialog-header")],(function(t,e){return{F:class extends e{constructor(...e){super(...e),t(this)}},d:[{kind:"method",key:"render",value:function(){return n.dy` <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[n.iv`: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}`]}}]}}),n.oi)},73729:function(t,e,i){i.d(e,{i:()=>h});var s=i(44249),n=i(72621),o=i(74966),a=i(51408),r=i(57243),l=i(15093),d=i(76525);i(23334);const c=["button","ha-list-item"],h=(t,e)=>r.dy` <div class="header_title"> <ha-icon-button .label="${t?.localize("ui.common.close")??"Close"}" .path="${"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"}" dialogAction="close" class="header_button"></ha-icon-button> <span>${e}</span> </div> `;(0,s.Z)([(0,l.Mo)("ha-dialog")],(function(t,e){class i extends e{constructor(...e){super(...e),t(this)}}return{F:i,d:[{kind:"field",key:d.gA,value:void 0},{kind:"method",key:"scrollToPos",value:function(t,e){this.contentElement?.scrollTo(t,e)}},{kind:"method",key:"renderHeading",value:function(){return r.dy`<slot name="heading"> ${(0,n.Z)(i,"renderHeading",this,3)([])} </slot>`}},{kind:"method",key:"firstUpdated",value:function(){(0,n.Z)(i,"firstUpdated",this,3)([]),this.suppressDefaultPressSelector=[this.suppressDefaultPressSelector,c].join(", "),this._updateScrolledAttribute(),this.contentElement?.addEventListener("scroll",this._onScroll,{passive:!0})}},{kind:"method",key:"disconnectedCallback",value:function(){(0,n.Z)(i,"disconnectedCallback",this,3)([]),this.contentElement.removeEventListener("scroll",this._onScroll)}},{kind:"field",key:"_onScroll",value(){return()=>{this._updateScrolledAttribute()}}},{kind:"method",key:"_updateScrolledAttribute",value:function(){this.contentElement&&this.toggleAttribute("scrolled",0!==this.contentElement.scrollTop)}},{kind:"field",static:!0,key:"styles",value:()=>[a.W,r.iv`:host([scrolled]) ::slotted(ha-dialog-header){border-bottom:1px solid var(--mdc-dialog-scroll-divider-color,rgba(0,0,0,.12))}.mdc-dialog{--mdc-dialog-scroll-divider-color:var( --dialog-scroll-divider-color, var(--divider-color) );z-index:var(--dialog-z-index,8);-webkit-backdrop-filter:var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none));backdrop-filter:var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none));--mdc-dialog-box-shadow:var(--dialog-box-shadow, none);--mdc-typography-headline6-font-weight:400;--mdc-typography-headline6-font-size:1.574rem}.mdc-dialog__actions{justify-content:var(--justify-action-buttons,flex-end);padding-bottom:max(env(safe-area-inset-bottom),24px)}.mdc-dialog__actions span:first-child{flex:var(--secondary-action-button-flex,unset)}.mdc-dialog__actions span:nth-child(2){flex:var(--primary-action-button-flex,unset)}.mdc-dialog__container{align-items:var(--vertical-align-dialog,center)}.mdc-dialog__title{padding:24px 24px 0 24px}.mdc-dialog__title:has(span){padding:12px 12px 0}.mdc-dialog__actions{padding:12px 24px 12px 24px}.mdc-dialog__title::before{content:unset}.mdc-dialog .mdc-dialog__content{position:var(--dialog-content-position,relative);padding:var(--dialog-content-padding,24px)}:host([hideactions]) .mdc-dialog .mdc-dialog__content{padding-bottom:max(var(--dialog-content-padding,24px),env(safe-area-inset-bottom))}.mdc-dialog .mdc-dialog__surface{position:var(--dialog-surface-position,relative);top:var(--dialog-surface-top);margin-top:var(--dialog-surface-margin-top);min-height:var(--mdc-dialog-min-height,auto);border-radius:var(--ha-dialog-border-radius,28px);-webkit-backdrop-filter:var(--ha-dialog-surface-backdrop-filter,none);backdrop-filter:var(--ha-dialog-surface-backdrop-filter,none);background:var(--ha-dialog-surface-background,var(--mdc-theme-surface,#fff))}:host([flexContent]) .mdc-dialog .mdc-dialog__content{display:flex;flex-direction:column}.header_title{display:flex;align-items:center;direction:var(--direction)}.header_title span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;padding-left:4px}.header_button{text-decoration:none;color:inherit;inset-inline-start:initial;inset-inline-end:-12px;direction:var(--direction)}.dialog-actions{inset-inline-start:initial!important;inset-inline-end:0px!important;direction:var(--direction)}`]}]}}),o.M)},95076:function(t,e,i){var s=i(44249),n=i(57243),o=i(15093);i(37583);(0,s.Z)([(0,o.Mo)("ha-tip")],(function(t,e){return{F:class extends e{constructor(...e){super(...e),t(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"method",key:"render",value:function(){return this.hass?n.dy` <ha-svg-icon .path="${"M12,2A7,7 0 0,1 19,9C19,11.38 17.81,13.47 16,14.74V17A1,1 0 0,1 15,18H9A1,1 0 0,1 8,17V14.74C6.19,13.47 5,11.38 5,9A7,7 0 0,1 12,2M9,21V20H15V21A1,1 0 0,1 14,22H10A1,1 0 0,1 9,21M12,4A5,5 0 0,0 7,9C7,11.05 8.23,12.81 10,13.58V16H14V13.58C15.77,12.81 17,11.05 17,9A5,5 0 0,0 12,4Z"}"></ha-svg-icon> <span class="prefix">${this.hass.localize("ui.panel.config.tips.tip")}</span> <span class="text"><slot></slot></span> `:n.Ld}},{kind:"field",static:!0,key:"styles",value:()=>n.iv`:host{display:block;text-align:center}.text{direction:var(--direction);margin-left:2px;margin-inline-start:2px;margin-inline-end:initial;color:var(--secondary-text-color)}.prefix{font-weight:500}`}]}}),n.oi)},70643:function(t,e,i){i.a(t,(async function(t,s){try{i.r(e);var n=i(44249),o=(i(92745),i(9359),i(56475),i(31526),i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814),i(15108)),a=(i(2060),i(87319),i(57243)),r=i(15093),l=i(91583),d=i(36522),c=i(20172),h=i(89890),p=i(1079),m=i(6343),u=i(76131),g=i(28008),f=(i(59826),i(48103),i(17170)),v=(i(73729),i(95198),i(37583),i(95076),i(10177)),_=i(79846),y=i(72344),b=t([f,v,_]);[f,v,_]=b.then?(await b)():b;const k="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",x="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z";(0,n.Z)([(0,r.Mo)("dialog-media-manage")],(function(t,e){return{F:class extends e{constructor(...e){super(...e),t(this)}},d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_currentItem",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_params",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_uploading",value:()=>!1},{kind:"field",decorators:[(0,r.SB)()],key:"_deleting",value:()=>!1},{kind:"field",decorators:[(0,r.SB)()],key:"_selected",value:()=>new Set},{kind:"field",key:"_filesChanged",value:()=>!1},{kind:"method",key:"showDialog",value:function(t){this._params=t,this._refreshMedia()}},{kind:"method",key:"closeDialog",value:function(){this._filesChanged&&this._params.onClose&&this._params.onClose(),this._params=void 0,this._currentItem=void 0,this._uploading=!1,this._deleting=!1,this._filesChanged=!1,(0,d.B)(this,"dialog-closed",{dialog:this.localName})}},{kind:"method",key:"render",value:function(){if(!this._params)return a.Ld;const t=this._currentItem?.children?.filter((t=>!t.can_expand))||[];let e=0;return a.dy` <ha-dialog open scrimClickAction escapeKeyAction hideActions flexContent .heading="${this._params.currentItem.title}" @closed="${this.closeDialog}"> <ha-dialog-header slot="heading"> ${0===this._selected.size?a.dy` <span slot="title"> ${this.hass.localize("ui.components.media-browser.file_management.title")} </span> <ha-media-upload-button .disabled="${this._deleting}" .hass="${this.hass}" .currentItem="${this._params.currentItem}" @uploading="${this._startUploading}" @media-refresh="${this._doneUploading}" slot="actionItems"></ha-media-upload-button> ${this._uploading?"":a.dy` <ha-icon-button .label="${this.hass.localize("ui.common.close")}" .path="${k}" dialogAction="close" slot="navigationIcon" dir="${(0,c.Zu)(this.hass)}"></ha-icon-button> `} `:a.dy` <ha-button class="danger" slot="navigationIcon" .disabled="${this._deleting}" .label="${this.hass.localize("ui.components.media-browser.file_management."+(this._deleting?"deleting":"delete"),{count:this._selected.size})}" @click="${this._handleDelete}"> <ha-svg-icon .path="${x}" slot="icon"></ha-svg-icon> </ha-button> ${this._deleting?"":a.dy` <ha-button slot="actionItems" .label="${this.hass.localize("ui.components.media-browser.file_management.deselect_all")}" @click="${this._handleDeselectAll}"> <ha-svg-icon .path="${k}" slot="icon"></ha-svg-icon> </ha-button> `} `} </ha-dialog-header> ${this._currentItem?t.length?a.dy` <mwc-list multi @selected="${this._handleSelected}"> ${(0,l.r)(t,(t=>t.media_content_id),(t=>{const i=a.dy` <ha-svg-icon slot="graphic" .path="${h.Fn["directory"===t.media_class&&t.children_media_class||t.media_class].icon}"></ha-svg-icon> `;return a.dy` <ha-check-list-item ${(0,o.jt)({id:t.media_content_id,skipInitial:!0})} graphic="icon" .disabled="${this._uploading||this._deleting}" .selected="${this._selected.has(e++)}" .item="${t}"> ${i} ${t.title} </ha-check-list-item> `}))} </mwc-list> `:a.dy`<div class="no-items"> <p> ${this.hass.localize("ui.components.media-browser.file_management.no_items")} </p> ${this._currentItem?.children?.length?a.dy`<span class="folders">${this.hass.localize("ui.components.media-browser.file_management.folders_not_supported")}</span>`:""} </div>`:a.dy` <div class="refresh"> <ha-spinner></ha-spinner> </div> `} ${(0,y.p)(this.hass,"hassio")?a.dy`<ha-tip .hass="${this.hass}"> ${this.hass.localize("ui.components.media-browser.file_management.tip_media_storage",{storage:a.dy`<a href="/config/storage" @click="${this.closeDialog}"> ${this.hass.localize("ui.components.media-browser.file_management.tip_storage_panel")}</a>`})} </ha-tip>`:a.Ld} </ha-dialog> `}},{kind:"method",key:"_handleSelected",value:function(t){this._selected=t.detail.index}},{kind:"method",key:"_startUploading",value:function(){this._uploading=!0,this._filesChanged=!0}},{kind:"method",key:"_doneUploading",value:function(){this._uploading=!1,this._refreshMedia()}},{kind:"method",key:"_handleDeselectAll",value:function(){this._selected.size&&(this._selected=new Set)}},{kind:"method",key:"_handleDelete",value:async function(){if(!await(0,u.showConfirmationDialog)(this,{text:this.hass.localize("ui.components.media-browser.file_management.confirm_delete",{count:this._selected.size}),warning:!0}))return;this._filesChanged=!0,this._deleting=!0;const t=[];let e=0;this._currentItem.children.forEach((i=>{i.can_expand||this._selected.has(e++)&&t.push(i)}));try{await Promise.all(t.map((async t=>{if((0,p.aV)(t.media_content_id))await(0,p.Qr)(this.hass,t.media_content_id);else if((0,p.IB)(t.media_content_id)){const e=(0,m.TT)(t.media_content_id);e&&await(0,m.ao)(this.hass,e)}this._currentItem={...this._currentItem,children:this._currentItem.children.filter((e=>e!==t))}})))}finally{this._deleting=!1,this._selected=new Set}}},{kind:"method",key:"_refreshMedia",value:async function(){this._selected=new Set,this._currentItem=void 0,this._currentItem=await(0,p.b)(this.hass,this._params.currentItem.media_content_id)}},{kind:"get",static:!0,key:"styles",value:function(){return[g.yu,a.iv`ha-dialog{--dialog-z-index:9;--dialog-content-padding:0}@media (min-width:800px){ha-dialog{--mdc-dialog-max-width:800px;--dialog-surface-position:fixed;--dialog-surface-top:40px;--mdc-dialog-max-height:calc(100vh - 72px)}}ha-dialog-header ha-button,ha-dialog-header ha-media-upload-button{--mdc-theme-primary:var(--primary-text-color);margin:6px;display:block}.danger{--mdc-theme-primary:var(--error-color)}ha-svg-icon[slot=icon]{vertical-align:middle}ha-tip{margin:16px}ha-svg-icon[slot=icon]{margin-inline-start:0px!important;margin-inline-end:8px!important;direction:var(--direction)}.refresh{display:flex;height:200px;justify-content:center;align-items:center}.no-items{text-align:center;padding:16px}.folders{color:var(--secondary-text-color);font-style:italic}`]}}]}}),a.oi);s()}catch(t){s(t)}}))},79846:function(t,e,i){i.a(t,(async function(t,e){try{var s=i(44249),n=(i(31622),i(57243)),o=i(15093),a=i(36522),r=i(1079),l=i(76131),d=i(17170),c=(i(37583),t([d]));d=(c.then?(await c)():c)[0];const h="M9,16V10H5L12,3L19,10H15V16H9M5,20V18H19V20H5Z";(0,s.Z)([(0,o.Mo)("ha-media-upload-button")],(function(t,e){return{F:class extends e{constructor(...e){super(...e),t(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"currentItem",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_uploading",value:()=>0},{kind:"method",key:"render",value:function(){return this.currentItem&&(0,r.aV)(this.currentItem.media_content_id||"")?n.dy` <mwc-button .label="${this._uploading>0?this.hass.localize("ui.components.media-browser.file_management.uploading",{count:this._uploading}):this.hass.localize("ui.components.media-browser.file_management.add_media")}" .disabled="${this._uploading>0}" @click="${this._startUpload}"> ${this._uploading>0?n.dy` <ha-spinner size="small" area-label="Uploading" slot="icon"></ha-spinner> `:n.dy` <ha-svg-icon .path="${h}" slot="icon"></ha-svg-icon> `} </mwc-button> `:n.Ld}},{kind:"method",key:"_startUpload",value:async function(){if(this._uploading>0)return;const t=document.createElement("input");t.type="file",t.accept="audio/*,video/*,image/*",t.multiple=!0,t.addEventListener("change",(async()=>{(0,a.B)(this,"uploading");const e=t.files;document.body.removeChild(t);const i=this.currentItem.media_content_id;for(let t=0;t<e.length;t++){this._uploading=e.length-t;try{await(0,r.oE)(this.hass,i,e[t])}catch(t){(0,l.showAlertDialog)(this,{text:this.hass.localize("ui.components.media-browser.file_management.upload_failed",{reason:t.message||t})});break}}this._uploading=0,(0,a.B)(this,"media-refresh")}),{once:!0}),t.style.display="none",document.body.append(t),t.click()}},{kind:"field",static:!0,key:"styles",value:()=>n.iv`mwc-button{--mdc-button-disabled-ink-color:--mdc-theme-primary}ha-spinner[slot=icon],ha-svg-icon[slot=icon]{vertical-align:middle}ha-svg-icon[slot=icon]{margin-inline-start:0px;margin-inline-end:8px;direction:var(--direction)}`}]}}),n.oi);e()}catch(t){e(t)}}))},6343:function(t,e,i){i.d(e,{Bi:()=>r,JS:()=>s,TT:()=>o,ao:()=>l,dg:()=>n,n$:()=>d,p6:()=>a});const s="/api/image/serve/",n="media-source://image_upload",o=t=>{let e;if(t.startsWith(s)){e=t.substring(s.length);const i=e.indexOf("/");i>=0&&(e=e.substring(0,i))}else t.startsWith(n)&&(e=t.substring(n.length+1));return e},a=(t,e,i=!1)=>{if(!i&&!e)throw new Error("Size must be provided if original is false");return i?`/api/image/serve/${t}/original`:`/api/image/serve/${t}/${e}x${e}`},r=async(t,e)=>{const i=new FormData;i.append("file",e);const s=await t.fetchWithAuth("/api/image/upload",{method:"POST",body:i});if(413===s.status)throw new Error(`Uploaded image is too large (${e.name})`);if(200!==s.status)throw new Error("Unknown error");return s.json()},l=(t,e)=>t.callWS({type:"image/delete",image_id:e}),d=async(t,e)=>{const i=await fetch(t.hassUrl(e));if(!i.ok)throw new Error(`Failed to fetch image: ${i.statusText?i.statusText:i.status}`);return i.blob()}},15108:function(t,e,i){i.d(e,{jt:()=>_});i(92745),i(9359),i(68107),i(56475),i(31526),i(70104);var s=i(2841),n=i(45779),o=i(67753);i(52924),i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814);const a=new WeakMap;let r=0;const l=new Map,d=new WeakSet,c=()=>new Promise((t=>requestAnimationFrame(t))),h=(t,e)=>{const i=t-e;return 0===i?void 0:i},p=(t,e)=>{const i=t/e;return 1===i?void 0:i},m={left:(t,e)=>{const i=h(t,e);return{value:i,transform:null==i||isNaN(i)?void 0:`translateX(${i}px)`}},top:(t,e)=>{const i=h(t,e);return{value:i,transform:null==i||isNaN(i)?void 0:`translateY(${i}px)`}},width:(t,e)=>{let i;0===e&&(e=1,i={width:"1px"});const s=p(t,e);return{value:s,overrideFrom:i,transform:null==s||isNaN(s)?void 0:`scaleX(${s})`}},height:(t,e)=>{let i;0===e&&(e=1,i={height:"1px"});const s=p(t,e);return{value:s,overrideFrom:i,transform:null==s||isNaN(s)?void 0:`scaleY(${s})`}}},u={duration:333,easing:"ease-in-out"},g=["left","top","width","height","opacity","color","background"],f=new WeakMap;class v extends o.sR{constructor(t){if(super(t),this.t=!1,this.i=null,this.o=null,this.h=!0,this.shouldLog=!1,t.type===n.pX.CHILD)throw Error("The `animate` directive must be used in attribute position.");this.createFinished()}createFinished(){this.resolveFinished?.(),this.finished=new Promise((t=>{this.l=t}))}async resolveFinished(){this.l?.(),this.l=void 0}render(t){return s.Ld}getController(){return a.get(this.u)}isDisabled(){return this.options.disabled||this.getController()?.disabled}update(t,[e]){const i=void 0===this.u;return i&&(this.u=t.options?.host,this.u.addController(this),this.u.updateComplete.then((t=>this.t=!0)),this.element=t.element,f.set(this.element,this)),this.optionsOrCallback=e,(i||"function"!=typeof e)&&this.p(e),this.render(e)}p(t){t=t??{};const e=this.getController();void 0!==e&&((t={...e.defaultOptions,...t}).keyframeOptions={...e.defaultOptions.keyframeOptions,...t.keyframeOptions}),t.properties??=g,this.options=t}m(){const t={},e=this.element.getBoundingClientRect(),i=getComputedStyle(this.element);return this.options.properties.forEach((s=>{const n=e[s]??(m[s]?void 0:i[s]),o=Number(n);t[s]=isNaN(o)?n+"":o})),t}v(){let t,e=!0;return this.options.guard&&(t=this.options.guard(),e=((t,e)=>{if(Array.isArray(t)){if(Array.isArray(e)&&e.length===t.length&&t.every(((t,i)=>t===e[i])))return!1}else if(e===t)return!1;return!0})(t,this._)),this.h=this.t&&!this.isDisabled()&&!this.isAnimating()&&e&&this.element.isConnected,this.h&&(this._=Array.isArray(t)?Array.from(t):t),this.h}hostUpdate(){"function"==typeof this.optionsOrCallback&&this.p(this.optionsOrCallback()),this.v()&&(this.A=this.m(),this.i=this.i??this.element.parentNode,this.o=this.element.nextSibling)}async hostUpdated(){if(!this.h||!this.element.isConnected||this.options.skipInitial&&!this.isHostRendered)return;let t;this.prepare(),await c;const e=this.O(),i=this.j(this.options.keyframeOptions,e),s=this.m();if(void 0!==this.A){const{from:i,to:n}=this.N(this.A,s,e);this.log("measured",[this.A,s,i,n]),t=this.calculateKeyframes(i,n)}else{const i=l.get(this.options.inId);if(i){l.delete(this.options.inId);const{from:n,to:o}=this.N(i,s,e);t=this.calculateKeyframes(n,o),t=this.options.in?[{...this.options.in[0],...t[0]},...this.options.in.slice(1),t[1]]:t,r++,t.forEach((t=>t.zIndex=r))}else this.options.in&&(t=[...this.options.in,{}])}this.animate(t,i)}resetStyles(){void 0!==this.P&&(this.element.setAttribute("style",this.P??""),this.P=void 0)}commitStyles(){this.P=this.element.getAttribute("style"),this.webAnimation?.commitStyles(),this.webAnimation?.cancel()}reconnected(){}async disconnected(){if(!this.h)return;if(void 0!==this.options.id&&l.set(this.options.id,this.A),void 0===this.options.out)return;if(this.prepare(),await c(),this.i?.isConnected){const t=this.o&&this.o.parentNode===this.i?this.o:null;if(this.i.insertBefore(this.element,t),this.options.stabilizeOut){const t=this.m();this.log("stabilizing out");const e=this.A.left-t.left,i=this.A.top-t.top;!("static"===getComputedStyle(this.element).position)||0===e&&0===i||(this.element.style.position="relative"),0!==e&&(this.element.style.left=e+"px"),0!==i&&(this.element.style.top=i+"px")}}const t=this.j(this.options.keyframeOptions);await this.animate(this.options.out,t),this.element.remove()}prepare(){this.createFinished()}start(){this.options.onStart?.(this)}didFinish(t){t&&this.options.onComplete?.(this),this.A=void 0,this.animatingProperties=void 0,this.frames=void 0,this.resolveFinished()}O(){const t=[];for(let e=this.element.parentNode;e;e=e?.parentNode){const i=f.get(e);i&&!i.isDisabled()&&i&&t.push(i)}return t}get isHostRendered(){const t=d.has(this.u);return t||this.u.updateComplete.then((()=>{d.add(this.u)})),t}j(t,e=this.O()){const i={...u};return e.forEach((t=>Object.assign(i,t.options.keyframeOptions))),Object.assign(i,t),i}N(t,e,i){t={...t},e={...e};const s=i.map((t=>t.animatingProperties)).filter((t=>void 0!==t));let n=1,o=1;return s.length>0&&(s.forEach((t=>{t.width&&(n/=t.width),t.height&&(o/=t.height)})),void 0!==t.left&&void 0!==e.left&&(t.left=n*t.left,e.left=n*e.left),void 0!==t.top&&void 0!==e.top&&(t.top=o*t.top,e.top=o*e.top)),{from:t,to:e}}calculateKeyframes(t,e,i=!1){const s={},n={};let o=!1;const a={};for(const i in e){const r=t[i],l=e[i];if(i in m){const t=m[i];if(void 0===r||void 0===l)continue;const e=t(r,l);void 0!==e.transform&&(a[i]=e.value,o=!0,s.transform=`${s.transform??""} ${e.transform}`,void 0!==e.overrideFrom&&Object.assign(s,e.overrideFrom))}else r!==l&&void 0!==r&&void 0!==l&&(o=!0,s[i]=r,n[i]=l)}return s.transformOrigin=n.transformOrigin=i?"center center":"top left",this.animatingProperties=a,o?[s,n]:void 0}async animate(t,e=this.options.keyframeOptions){this.start(),this.frames=t;let i=!1;if(!this.isAnimating()&&!this.isDisabled()&&(this.options.onFrames&&(this.frames=t=this.options.onFrames(this),this.log("modified frames",t)),void 0!==t)){this.log("animate",[t,e]),i=!0,this.webAnimation=this.element.animate(t,e);const s=this.getController();s?.add(this);try{await this.webAnimation.finished}catch(t){}s?.remove(this)}return this.didFinish(i),i}isAnimating(){return"running"===this.webAnimation?.playState||this.webAnimation?.pending}log(t,e){this.shouldLog&&!this.isDisabled()&&console.log(t,this.options.id,e)}}const _=(0,n.XM)(v),y=["top","right","bottom","left"];class b extends o.sR{constructor(t){if(super(t),t.type!==n.pX.ELEMENT)throw Error("The `position` directive must be used in attribute position.")}render(t,e){return s.Ld}update(t,[e,i]){return void 0===this.u&&(this.u=t.options?.host,this.u.addController(this)),this.S=t.element,this.C=e,this.F=i??["left","top","width","height"],this.render(e,i)}hostUpdated(){this.$()}$(){const t="function"==typeof this.C?this.C():this.C?.value,e=t.offsetParent;if(void 0===t||!e)return;const i=t.getBoundingClientRect(),s=e.getBoundingClientRect();this.F?.forEach((t=>{const e=y.includes(t)?i[t]-s[t]:i[t];this.S.style[t]=e+"px"}))}}(0,n.XM)(b)},91583:function(t,e,i){i.d(e,{r:()=>r});var s=i(2841),n=i(45779),o=i(53232);const a=(t,e,i)=>{const s=new Map;for(let n=e;n<=i;n++)s.set(t[n],n);return s},r=(0,n.XM)(class extends n.Xe{constructor(t){if(super(t),t.type!==n.pX.CHILD)throw Error("repeat() can only be used in text expressions")}ct(t,e,i){let s;void 0===i?i=e:void 0!==e&&(s=e);const n=[],o=[];let a=0;for(const e of t)n[a]=s?s(e,a):a,o[a]=i(e,a),a++;return{values:o,keys:n}}render(t,e,i){return this.ct(t,e,i).values}update(t,[e,i,n]){var r;const l=(0,o.i9)(t),{values:d,keys:c}=this.ct(e,i,n);if(!Array.isArray(l))return this.ut=c,d;const h=null!==(r=this.ut)&&void 0!==r?r:this.ut=[],p=[];let m,u,g=0,f=l.length-1,v=0,_=d.length-1;for(;g<=f&&v<=_;)if(null===l[g])g++;else if(null===l[f])f--;else if(h[g]===c[v])p[v]=(0,o.fk)(l[g],d[v]),g++,v++;else if(h[f]===c[_])p[_]=(0,o.fk)(l[f],d[_]),f--,_--;else if(h[g]===c[_])p[_]=(0,o.fk)(l[g],d[_]),(0,o._Y)(t,p[_+1],l[g]),g++,_--;else if(h[f]===c[v])p[v]=(0,o.fk)(l[f],d[v]),(0,o._Y)(t,l[g],l[f]),f--,v++;else if(void 0===m&&(m=a(c,v,_),u=a(h,g,f)),m.has(h[g]))if(m.has(h[f])){const e=u.get(c[v]),i=void 0!==e?l[e]:null;if(null===i){const e=(0,o._Y)(t,l[g]);(0,o.fk)(e,d[v]),p[v]=e}else p[v]=(0,o.fk)(i,d[v]),(0,o._Y)(t,l[g],i),l[e]=null;v++}else(0,o.ws)(l[f]),f--;else(0,o.ws)(l[g]),g++;for(;v<=_;){const e=(0,o._Y)(t,p[_+1]);(0,o.fk)(e,d[v]),p[v++]=e}for(;g<=f;){const t=l[g++];null!==t&&(0,o.ws)(t)}return this.ut=c,(0,o.hl)(t,p),s.Jb}})}}; //# sourceMappingURL=7964.7670e9f51430ef3e.js.map