UNPKG

iobroker.lovelace

Version:

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

11 lines 22.4 kB
/*! For license information please see 32307.272d2dbecea92e6c.js.LICENSE.txt */ export const __rspack_esm_id=32307;export const __rspack_esm_ids=[32307];export const __webpack_modules__={41060(e,t,i){i.a(e,async function(e,t){try{i(18111),i(61701);var a=i(62826),s=i(5124),r=i(22441),o=i(6412),n=i(44537),l=i(1087),d=i(67258),h=i(46187),c=i(18350),p=i(26300),u=i(94355),g=e([c,p,u]);[c,p,u]=g.then?(await g)():g;const v="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",_="M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M13.5,16V19H10.5V16H8L12,12L16,16H13.5M13,9V3.5L18.5,9H13Z";class m extends s.WF{firstUpdated(e){super.firstUpdated(e),this.autoOpenFileDialog&&this._openFilePicker()}get _name(){if(void 0===this.value)return"";if("string"==typeof this.value)return this.value;return(this.value instanceof FileList?Array.from(this.value):(0,n.e)(this.value)).map(e=>e.name).join(", ")}render(){const e=this.localize||this.hass.localize;return s.qy` ${this.uploading?s.qy`<div class="container"> <div class="uploading"> <span class="header">${this.uploadingLabel||(this.value?e("ui.components.file-upload.uploading_name",{name:this._name}):e("ui.components.file-upload.uploading"))}</span> ${this.progress?s.qy`<div class="progress"> ${this.progress}${this.hass&&(0,d.d)(this.hass.locale)}% </div>`:s.s6} </div> <ha-progress-bar .indeterminate="${!this.progress}" .value="${this.progress}" loading></ha-progress-bar> </div>`:s.qy`<label for="${this.value?"":"input"}" class="container ${(0,o.H)({dragged:this._drag,multiple:this.multiple,value:Boolean(this.value)})}" @drop="${this._handleDrop}" @dragenter="${this._handleDragStart}" @dragover="${this._handleDragStart}" @dragleave="${this._handleDragEnd}" @dragend="${this._handleDragEnd}">${this.value?"string"==typeof this.value?s.qy`<div class="row"> <div class="value" @click="${this._openFilePicker}"> <ha-svg-icon .path="${this.icon||_}"></ha-svg-icon> ${this.value} </div> <ha-icon-button @click="${this._clearValue}" .label="${this.deleteLabel||e("ui.common.delete")}" .path="${v}"></ha-icon-button> </div>`:(this.value instanceof FileList?Array.from(this.value):(0,n.e)(this.value)).map(t=>s.qy`<div class="row"> <div class="value" @click="${this._openFilePicker}"> <ha-svg-icon .path="${this.icon||_}"></ha-svg-icon> ${t.name} - ${(0,h.A)(t.size)} </div> <ha-icon-button @click="${this._clearValue}" .label="${this.deleteLabel||e("ui.common.delete")}" .path="${v}"></ha-icon-button> </div>`):s.qy`<ha-button size="small" appearance="filled" @click="${this._openFilePicker}"> <ha-svg-icon slot="start" .path="${this.icon||_}"></ha-svg-icon> ${this.label||e("ui.components.file-upload.label")} </ha-button> <span class="secondary">${this.secondary||e("ui.components.file-upload.secondary")}</span> <span class="supports">${this.supports}</span>`} <input id="input" type="file" class="file" .accept="${this.accept}" .multiple="${this.multiple}" @change="${this._handleFilePicked}"></label>`} `}_openFilePicker(){this._input?.click()}_handleDrop(e){e.preventDefault(),e.stopPropagation(),e.dataTransfer?.files&&(0,l.r)(this,"file-picked",{files:this.multiple||1===e.dataTransfer.files.length?Array.from(e.dataTransfer.files):[e.dataTransfer.files[0]]}),this._drag=!1}_handleDragStart(e){e.preventDefault(),e.stopPropagation(),this._drag=!0}_handleDragEnd(e){e.preventDefault(),e.stopPropagation(),this._drag=!1}_handleFilePicked(e){0!==e.target.files.length&&(this.value=e.target.files,(0,l.r)(this,"file-picked",{files:e.target.files}))}_clearValue(e){e.preventDefault(),this._input.value="",this.value=void 0,(0,l.r)(this,"change"),(0,l.r)(this,"files-cleared")}constructor(...e){super(...e),this.multiple=!1,this.disabled=!1,this.uploading=!1,this.autoOpenFileDialog=!1,this._drag=!1}}m.styles=s.AH`:host{display:block;height:240px}:host([disabled]){pointer-events:none;color:var(--disabled-text-color)}.container{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:center;border:solid 1px var(--mdc-text-field-idle-line-color,rgba(0,0,0,.42));border-radius:var(--mdc-shape-small,var(--ha-border-radius-sm));height:100%}.row{display:flex;align-items:center}label.container{border:dashed 1px var(--mdc-text-field-idle-line-color,rgba(0,0,0,.42));cursor:pointer}.container .uploading{display:flex;flex-direction:column;width:100%;align-items:flex-start;padding:0 32px;box-sizing:border-box}:host([disabled]) .container{border-color:var(--disabled-color)}label.dragged,label:hover{border-style:solid}label.dragged{border-color:var(--primary-color)}.dragged:before{position:absolute;top:0;right:0;bottom:0;left:0;background-color:var(--primary-color);content:"";opacity:var(--dark-divider-opacity);pointer-events:none;border-radius:var(--mdc-shape-small,4px)}label.value{cursor:default}label.value.multiple{justify-content:unset;overflow:auto}.highlight{color:var(--primary-color)}ha-button{margin-bottom:8px}.supports{color:var(--secondary-text-color);font-size:var(--ha-font-size-s)}:host([disabled]) .secondary{color:var(--disabled-text-color)}input.file{display:none}.value{cursor:pointer}.value ha-svg-icon{margin-right:8px;margin-inline-end:8px;margin-inline-start:initial}ha-button{--mdc-button-outline-color:var(--primary-color);--ha-icon-button-size:24px}ha-progress-bar{width:100%;padding:8px 32px;box-sizing:border-box}.header{font-weight:var(--ha-font-weight-medium)}.progress{color:var(--secondary-text-color)}button.link{background:0 0;border:none;padding:0;font-size:var(--ha-font-size-m);color:var(--primary-color);text-decoration:underline;cursor:pointer}`,(0,a.Cg)([(0,r.MZ)({attribute:!1})],m.prototype,"hass",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],m.prototype,"localize",void 0),(0,a.Cg)([(0,r.MZ)()],m.prototype,"accept",void 0),(0,a.Cg)([(0,r.MZ)()],m.prototype,"icon",void 0),(0,a.Cg)([(0,r.MZ)()],m.prototype,"label",void 0),(0,a.Cg)([(0,r.MZ)()],m.prototype,"secondary",void 0),(0,a.Cg)([(0,r.MZ)({attribute:"uploading-label"})],m.prototype,"uploadingLabel",void 0),(0,a.Cg)([(0,r.MZ)({attribute:"delete-label"})],m.prototype,"deleteLabel",void 0),(0,a.Cg)([(0,r.MZ)()],m.prototype,"supports",void 0),(0,a.Cg)([(0,r.MZ)({type:Object})],m.prototype,"value",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean})],m.prototype,"multiple",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],m.prototype,"disabled",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean})],m.prototype,"uploading",void 0),(0,a.Cg)([(0,r.MZ)({type:Number})],m.prototype,"progress",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,attribute:"auto-open-file-dialog"})],m.prototype,"autoOpenFileDialog",void 0),(0,a.Cg)([(0,r.wk)()],m.prototype,"_drag",void 0),(0,a.Cg)([(0,r.P)("#input")],m.prototype,"_input",void 0),m=(0,a.Cg)([(0,r.EM)("ha-file-upload")],m),t()}catch(e){t(e)}})},94355(e,t,i){i.a(e,async function(e,t){try{var a=i(62826),s=i(88590),r=i(5124),o=i(22441),n=e([s]);s=(n.then?(await n)():n)[0];class l extends s.A{static get styles(){return[s.A.styles,r.AH`:host{--indicator-color:var( --ha-progress-bar-indicator-color, var(--ha-color-on-primary-normal) );--track-color:var( --ha-progress-bar-track-color, var(--ha-color-fill-neutral-normal-hover) );--track-height:var(--ha-progress-bar-track-height, 12px);--wa-transition-slow:var(--ha-animation-duration-slow);position:relative}.progress-bar{border-radius:var(--ha-progress-bar-border-radius,var(--ha-border-radius-pill))}.indicator{background:var(--ha-progress-bar-indicator-background,var(--indicator-color))}:host([indeterminate]) .indicator{animation:wa-progress-indeterminate var(--ha-progress-bar-animation-duration,2.5s) infinite cubic-bezier(.37,0,.63,1)}@keyframes slide-highlight{0%{transform:translateX(-200%)}100%{transform:translateX(200%)}}:host([loading]:not([indeterminate])) .progress-bar::after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,transparent 0%,oklch(from var(--indicator-color) 85% c h) 50%,transparent 100%);opacity:.5;animation:slide-highlight var(--ha-progress-bar-animation-duration,2.5s) infinite cubic-bezier(.37,0,.63,1);width:50%}:host::after{--width:var( --ha-progress-bar-indicator-highlight-width, calc(var(--track-height) * 2) );width:var(--width);height:var(--ha-progress-bar-indicator-highlight-height,calc(var(--track-height) * 2));content:"";position:absolute;inset-inline-start:clamp(var(--width)/ 2,var(--percentage,0%),calc(100% - var(--width)/ 2));top:50%;transform:translate(-50%,-50%);background-image:var(--ha-progress-bar-indicator-highlight-image);background-size:contain;background-repeat:no-repeat;background-position:center;pointer-events:none;transition:inset-inline-start var(--wa-transition-slow, 200ms) var(--wa-transition-easing, ease)}:host([indeterminate])::after{display:none}`]}constructor(...e){super(...e),this.loading=!1}}(0,a.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],l.prototype,"loading",void 0),l=(0,a.Cg)([(0,o.EM)("ha-progress-bar")],l),t()}catch(e){t(e)}})},42048(e,t,i){i.a(e,async function(e,a){try{i.r(t);var s=i(62826),r=i(5124),o=i(22441),n=i(1087),l=i(37981),d=i(18350),h=i(72554),c=(i(93444),i(41060)),p=i(52763),u=(i(67094),i(94355)),g=i(72001),v=i(65063),_=i(14503),m=e([d,h,c,p,u]);[d,h,c,p,u]=m.then?(await m)():m;const f="M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41 10.59L10 14.17L17.59 6.58L19 8L10 17Z",b="M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z",w="M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M13.5,16V19H10.5V16H8L12,12L16,16H13.5M13,9V3.5L18.5,9H13Z",y=[{name:"firmware_target",type:"integer",valueMin:0}];class $ extends r.WF{showDialog(e){this._deviceName=(0,l.T)(e.device,this.hass.localize,this.hass.states),this.device=e.device,this._open=!0,this._fetchData(),this._subscribeNodeStatus()}closeDialog(){this._open=!1}_dialogClosed(){this._unsubscribeNodeFirmwareUpdate(),this._unsubscribeNodeStatus(),this.device=void 0,this._updateProgressMessage=void 0,this._updateFinishedMessage=void 0,this._firmwareFile=void 0,this._nodeStatus=void 0,this._firmwareTarget=void 0,this._uploading=this._updateInProgress=!1,(0,n.r)(this,"dialog-closed",{dialog:this.localName})}render(){if(!this.device||!this._nodeStatus||void 0===this._updateInProgress)return r.s6;const e=r.qy`<ha-file-upload .hass="${this.hass}" .uploading="${this._uploading}" .icon="${w}" .label="${this.hass.localize("ui.panel.config.zwave_js.update_firmware.upload_firmware")}" .uploadingLabel="${this.hass.localize("ui.panel.config.zwave_js.update_firmware.uploading",{name:this._firmwareFile?.name})}" .value="${this._firmwareFile}" @file-picked="${this._uploadFile}"></ha-file-upload> ${this._nodeStatus.is_controller_node?r.s6:r.qy`<p class="${this._uploading?"disabled":""}"> ${this.hass.localize("ui.panel.config.zwave_js.update_firmware.firmware_target_intro")} </p> <ha-form .hass="${this.hass}" .data="${{firmware_target:this._firmwareTarget}}" .schema="${y}" @value-changed="${this._firmwareTargetChanged}" .disabled="${this._uploading}"></ha-form>`} `,t=this._updateFinishedMessage?this._updateFinishedMessage.success?"success":"error":void 0,i=this._nodeStatus.is_controller_node?"_controller":"",a=r.qy` <ha-button slot="primaryAction" @click="${this._beginFirmwareUpdate}" .disabled="${void 0===this._firmwareFile||this._uploading}"> ${this.hass.localize("ui.panel.config.zwave_js.update_firmware.begin_update")} </ha-button> `,s=this._nodeStatus.is_controller_node?r.s6:r.qy` <ha-button slot="secondaryAction" appearance="plain" @click="${this._abortFirmwareUpdate}" variant="danger"> ${this.hass.localize("ui.panel.config.zwave_js.update_firmware.abort")} </ha-button> `,o=r.qy` <ha-button slot="primaryAction" @click="${this.closeDialog}"> ${this.hass.localize("ui.common.close")} </ha-button> `;return r.qy` <ha-dialog .open="${this._open}" header-title="${this.hass.localize("ui.panel.config.zwave_js.update_firmware.title")}" @closed="${this._dialogClosed}"> ${this._updateProgressMessage||this._updateFinishedMessage?this._updateProgressMessage&&!this._updateFinishedMessage?r.qy` <p> ${this.hass.localize("ui.panel.config.zwave_js.update_firmware.in_progress",{device:r.qy`<strong>${this._deviceName}</strong>`,progress:(100*this._updateProgressMessage.sent_fragments/this._updateProgressMessage.total_fragments).toFixed(2)})} </p> <ha-progress-bar loading .value="${this._updateProgressMessage.sent_fragments/this._updateProgressMessage.total_fragments*100}"></ha-progress-bar> <p> ${this.hass.localize("ui.panel.config.zwave_js.update_firmware.close",{device:r.qy`<strong>${this._deviceName}</strong>`})} </p> `:r.qy` <div class="flex-container"> <ha-svg-icon .path="${this._updateFinishedMessage.success?f:b}" .class="${t}"></ha-svg-icon> <div class="status"> <p> ${this.hass.localize(`ui.panel.config.zwave_js.update_firmware.finished_status.${t}`,{device:r.qy`<strong>${this._deviceName}</strong>`,message:this.hass.localize(`ui.panel.config.zwave_js.update_firmware.finished_status.${this._nodeStatus.is_controller_node?g.DE[this._updateFinishedMessage.status]:g.VL[this._updateFinishedMessage.status]}`)})} </p> </div> </div> ${this._updateFinishedMessage.success?r.qy`<p> ${this.hass.localize(`ui.panel.config.zwave_js.update_firmware.finished_status.done${i}`)} </p>`:r.qy`<p> ${this.hass.localize("ui.panel.config.zwave_js.update_firmware.finished_status.try_again")} </p> ${e}`} `:this._updateInProgress?r.qy` <p> ${this._nodeStatus.status===g.zI.Asleep?this.hass.localize("ui.panel.config.zwave_js.update_firmware.queued",{device:r.qy`<strong>${this._deviceName}</strong>`}):this.hass.localize("ui.panel.config.zwave_js.update_firmware.awake",{device:r.qy`<strong>${this._deviceName}</strong>`})} </p> <p> ${this._nodeStatus.status===g.zI.Asleep?this.hass.localize("ui.panel.config.zwave_js.update_firmware.close_queued",{device:r.qy`<strong>${this._deviceName}</strong>`}):this.hass.localize("ui.panel.config.zwave_js.update_firmware.close",{device:r.qy`<strong>${this._deviceName}</strong>`})} </p> `:r.qy` <p class="${this._uploading?"disabled":""}"> ${this.hass.localize(`ui.panel.config.zwave_js.update_firmware.introduction${i}`,{device:r.qy`<strong>${this._deviceName}</strong>`})} </p> ${e} ${this._uploading&&this._nodeStatus.status===g.zI.Asleep?r.qy`<p class="wakeup"> ${this.hass.localize("ui.panel.config.zwave_js.update_firmware.device_asleep")} </p>`:r.s6} `} <ha-dialog-footer slot="footer"> ${this._updateProgressMessage||this._updateFinishedMessage?this._updateProgressMessage&&!this._updateFinishedMessage?r.qy` ${s} ${o} `:this._updateFinishedMessage.success?r.qy` ${o} `:r.qy` ${a} `:this._updateInProgress?r.qy` ${s} ${o} `:r.qy` ${this._uploading?s:r.s6} ${a} `} </ha-dialog-footer> </ha-dialog> `}async _fetchData(){[this._nodeStatus,this._updateInProgress]=await Promise.all([(0,g.mQ)(this.hass,this.device.id),(0,g.Cr)(this.hass,this.device.id)]),this._updateInProgress&&this._subscribeNodeFirmwareUpdate()}async _beginFirmwareUpdate(){this._uploading=!0,this._updateProgressMessage=this._updateFinishedMessage=void 0;try{this._subscribeNodeFirmwareUpdate(),await new Promise((e,t)=>{const i=new AbortController;this._cancelUpload=()=>{this._cancelUpload=void 0,i.abort(),e()},(0,g.mR)(this.hass,this.device.id,this._firmwareFile,this._firmwareTarget,i.signal).then(()=>this._cancelUpload?.()).catch(t)}),this._updateInProgress=!0}catch(e){this._unsubscribeNodeFirmwareUpdate(),(0,v.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.zwave_js.update_firmware.upload_failed"),text:e.message,confirmText:this.hass.localize("ui.common.close")})}finally{this._uploading=!1}}async _abortFirmwareUpdate(){if(await(0,v.dk)(this,{text:this.hass.localize("ui.panel.config.zwave_js.update_firmware.confirm_abort",{device:r.qy`<strong>${this._deviceName}</strong>`}),dismissText:this.hass.localize("ui.common.no"),confirmText:this.hass.localize("ui.common.yes")})){this._cancelUpload?.(),this._unsubscribeNodeFirmwareUpdate();try{await(0,g.of)(this.hass,this.device.id)}catch(e){(0,v.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.zwave_js.update_firmware.abort_failed"),text:e.message,confirmText:this.hass.localize("ui.common.close")})}this._firmwareFile=void 0,this._updateFinishedMessage=void 0,this._updateProgressMessage=void 0,this._updateInProgress=!1,this._uploading=!1}}_subscribeNodeStatus(){this.hass&&this.device&&!this._subscribedNodeStatus&&(this._subscribedNodeStatus=(0,g.sb)(this.hass,this.device.id,e=>{this._nodeStatus.status=e.status}))}_unsubscribeNodeStatus(){this._subscribedNodeStatus&&(this._subscribedNodeStatus.then(e=>e()),this._subscribedNodeStatus=void 0)}_subscribeNodeFirmwareUpdate(){this.hass&&this.device&&!this._subscribedNodeFirmwareUpdate&&(this._subscribedNodeFirmwareUpdate=(0,g.mX)(this.hass,this.device.id,e=>{"firmware update progress"===e.event?this._updateFinishedMessage||(this._updateProgressMessage=e):(this._unsubscribeNodeFirmwareUpdate(),this._updateProgressMessage=void 0,this._updateInProgress=!1,this._updateFinishedMessage=e)}))}_unsubscribeNodeFirmwareUpdate(){this._subscribedNodeFirmwareUpdate&&(this._subscribedNodeFirmwareUpdate.then(e=>e()),this._subscribedNodeFirmwareUpdate=void 0)}async _firmwareTargetChanged(e){this._firmwareTarget=e.detail.value.firmware_target}async _uploadFile(e){this._firmwareFile=e.detail.files[0]}static get styles(){return[_.nA,r.AH`.success{color:var(--success-color)}.error{color:var(--error-color)}.flex-container{display:flex;align-items:center;margin-bottom:5px}ha-svg-icon{width:68px;height:48px}p.disabled{color:var(--disabled-text-color)}p.wakeup{color:var(--warning-color);font-weight:var(--ha-font-weight-bold);margin-top:24px;margin-bottom:0}`]}constructor(...e){super(...e),this._uploading=!1,this._updateInProgress=!1,this._open=!1}}(0,s.Cg)([(0,o.MZ)({attribute:!1})],$.prototype,"hass",void 0),(0,s.Cg)([(0,o.wk)()],$.prototype,"device",void 0),(0,s.Cg)([(0,o.wk)()],$.prototype,"_uploading",void 0),(0,s.Cg)([(0,o.wk)()],$.prototype,"_updateFinishedMessage",void 0),(0,s.Cg)([(0,o.wk)()],$.prototype,"_updateProgressMessage",void 0),(0,s.Cg)([(0,o.wk)()],$.prototype,"_updateInProgress",void 0),(0,s.Cg)([(0,o.wk)()],$.prototype,"_firmwareFile",void 0),(0,s.Cg)([(0,o.wk)()],$.prototype,"_nodeStatus",void 0),(0,s.Cg)([(0,o.wk)()],$.prototype,"_firmwareTarget",void 0),(0,s.Cg)([(0,o.wk)()],$.prototype,"_open",void 0),$=(0,s.Cg)([(0,o.EM)("dialog-zwave_js-update-firmware-node")],$),a()}catch(e){a(e)}})},46187(e,t,i){i.d(t,{A:()=>a});const a=(e=0,t=2)=>{if(0===e)return"0 Bytes";t=t<0?0:t;const i=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/1024**i).toFixed(t))} ${["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][i]}`}},48646(e,t,i){var a=i(69565),s=i(28551),r=i(1767),o=i(50851);e.exports=function(e,t){t&&"string"==typeof e||s(e);var i=o(e);return r(s(void 0!==i?a(i,e):e))}},30531(e,t,i){var a=i(46518),s=i(69565),r=i(79306),o=i(28551),n=i(1767),l=i(48646),d=i(19462),h=i(9539),c=i(96395),p=i(30684),u=i(84549);var g=!c&&!p("flatMap",function(){}),v=!c&&!g&&u("flatMap",TypeError),_=c||g||v||function(){try{var e=Iterator.prototype.flatMap.call(new Map([[4,5]]).entries(),function(e){return e});e.next(),e.return()}catch(e){return!0}}(),m=d(function(){for(var e,t,i=this.iterator,a=this.mapper;;){if(t=this.inner)try{if(!(e=o(s(t.next,t.iterator))).done)return e.value;this.inner=null}catch(e){h(i,"throw",e)}if(e=o(s(this.next,i)),this.done=!!e.done)return;try{this.inner=l(a(e.value,this.counter++),!1)}catch(e){h(i,"throw",e)}}});a({target:"Iterator",proto:!0,real:!0,forced:_},{flatMap:function(e){o(this);try{r(e)}catch(e){h(this,"throw",e)}return v?s(v,this,e):new m(n(this),{mapper:e,inner:null})}})},88590(e,t,i){i.a(e,async function(e,a){try{i.d(t,{A:()=>v});var s=i(5124),r=i(22441),o=i(63672),n=i(95010),l=i(717),d=i(17060),h=i(4168),c=e([d]);d=(c.then?(await c)():c)[0];var p=Object.defineProperty,u=Object.getOwnPropertyDescriptor,g=(e,t,i,a)=>{for(var s,r=a>1?void 0:a?u(t,i):t,o=e.length-1;o>=0;o--)(s=e[o])&&(r=(a?s(t,i,r):s(r))||r);return a&&r&&p(t,i,r),r};let v=class extends l.A{updated(e){e.has("value")&&requestAnimationFrame(()=>{this.style.setProperty("--percentage",`${(0,n.q)(this.value,0,100)}%`)})}render(){return s.qy` <div part="base" class="progress-bar" role="progressbar" title="${(0,o.J)(this.title)}" aria-label="${this.label.length>0?this.label:this.localize.term("progress")}" aria-valuemin="0" aria-valuemax="100" aria-valuenow="${this.indeterminate?"0":this.value}"> <div part="indicator" class="indicator"> ${this.indeterminate?"":s.qy` <slot part="label" class="label"></slot> `} </div> </div> `}constructor(){super(...arguments),this.localize=new d.c(this),this.value=0,this.indeterminate=!1,this.label=""}};v.css=h.A,g([(0,r.MZ)({type:Number,reflect:!0})],v.prototype,"value",2),g([(0,r.MZ)({type:Boolean,reflect:!0})],v.prototype,"indeterminate",2),g([(0,r.MZ)()],v.prototype,"label",2),v=g([(0,r.EM)("wa-progress-bar")],v),a()}catch(e){a(e)}})},4168(e,t,i){i.d(t,{A:()=>a});var a=i(5124).AH`:host{--track-height:1rem;--track-color:var(--wa-color-neutral-fill-normal);--indicator-color:var(--wa-color-brand-fill-loud);display:flex}.progress-bar{flex:1 1 auto;display:flex;position:relative;overflow:hidden;height:var(--track-height);border-radius:var(--wa-border-radius-pill);background-color:var(--track-color);color:var(--wa-color-brand-on-loud);font-size:var(--wa-font-size-s)}.indicator{width:var(--percentage);display:flex;align-items:center;justify-content:center;background-color:var(--indicator-color);text-align:center;white-space:nowrap;overflow:hidden;line-height:1;font-weight:var(--wa-font-weight-semibold);transition:all var(--wa-transition-slow, 200ms) var(--wa-transition-easing, ease);user-select:none;-webkit-user-select:none}:host([indeterminate]) .indicator{position:absolute;inset-block:0;inline-size:50%;animation:wa-progress-indeterminate 2.5s infinite cubic-bezier(.37,0,.63,1)}@media (forced-colors:active){.progress-bar{outline:solid 1px SelectedItem;background-color:var(--wa-color-surface-default)}.indicator{outline:solid 1px SelectedItem;background-color:SelectedItem}}@keyframes wa-progress-indeterminate{0%{inset-inline-start:-50%}100%,75%{inset-inline-start:100%}}`}};