export const __rspack_esm_id="19434";export const __rspack_esm_ids=["19434"];export const __webpack_modules__={63130(t,i,s){s.d(i,{l:()=>a});var e=s(50248);const a=async(t,i)=>{if(navigator.clipboard)try{return void await navigator.clipboard.writeText(t)}catch{}const s=i||(()=>{const t=(0,e.n)();if(t instanceof HTMLElement){let i=t.getRootNode(),s=null;for(;i instanceof ShadowRoot&&i.host instanceof HTMLElement;)s=i.host,i=i.host.getRootNode();if(s)return s}return document.body})(),a=document.createElement("textarea");a.value=t,a.setAttribute("readonly",""),a.style.position="fixed",a.style.top="0",a.style.left="0",a.style.opacity="0",s.appendChild(a),a.select(),document.execCommand("copy"),s.removeChild(a)}},53073(t,i,s){s.a(t,async function(t,e){try{s.r(i);s(18111),s(61701);var a=s(62826),o=s(96196),n=s(97735),l=s(1087),c=s(63130),r=(s(8630),s(18350)),d=(s(93444),s(28732),s(65829)),h=s(72554),p=s(20559),g=s(14503),_=s(81619),u=t([r,d,h]);[r,d,h]=u.then?(await u)():u;const m="M13,13H11V7H13M13,17H11V15H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z",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",v="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";class y extends o.WF{async showDialog(t){this.device_id=t.device_id,this._open=!0}async _copyIpToClipboard(t){const i=t.currentTarget.ip;await(0,c.l)(i),(0,_.P)(this,{message:this.hass.localize("ui.common.copied_clipboard")})}render(){return this.device_id?o.qy` <ha-dialog .hass="${this.hass}" .open="${this._open}" header-title="${this.hass.localize("ui.panel.config.matter.ping_node.title")}" @closed="${this._dialogClosed}"> ${"failed"===this._status?o.qy` <div class="flex-container"> <ha-svg-icon .path="${v}" class="failed"></ha-svg-icon> <div class="status"> <p> ${this.hass.localize(this._pingResultEntries?"ui.panel.config.matter.ping_node.no_ip_found":"ui.panel.config.matter.ping_node.ping_failed")} </p> </div> </div> `:this._pingResultEntries?o.qy` <h2> ${this.hass.localize("ui.panel.config.matter.ping_node.ping_complete")} </h2> <ha-list> ${this._pingResultEntries.map(([t,i])=>o.qy`<ha-list-item hasMeta .ip="${t}" @click="${this._copyIpToClipboard}">${t} <ha-svg-icon slot="meta" .path="${i?f:m}" class="${i?"success":"failed"}"></ha-svg-icon> </ha-list-item>`)} </ha-list> `:"started"===this._status?o.qy` <div class="flex-container"> <ha-spinner></ha-spinner> <div class="status"> <p> <b> ${this.hass.localize("ui.panel.config.matter.ping_node.in_progress")} </b> </p> </div> </div> `:o.qy` <p> ${this.hass.localize("ui.panel.config.matter.ping_node.introduction")} </p> <p> <em> ${this.hass.localize("ui.panel.config.matter.ping_node.battery_device_warning")} </em> </p> `} <ha-dialog-footer slot="footer"> ${"failed"===this._status||this._pingResultEntries||"started"===this._status?o.qy` <ha-button slot="primaryAction" @click="${this.closeDialog}"> ${this.hass.localize("ui.common.close")} </ha-button> `:o.qy` <ha-button slot="primaryAction" @click="${this._startPing}"> ${this.hass.localize("ui.panel.config.matter.ping_node.start_ping")} </ha-button> `} </ha-dialog-footer> </ha-dialog> `:o.s6}async _startPing(){if(this.hass){this._status="started";try{const t=await(0,p.OW)(this.hass,this.device_id),i=Object.entries(t);0===i.length&&(this._status="failed"),this._pingResultEntries=i}catch(t){this._status="failed"}}}closeDialog(){this._open=!1}_dialogClosed(){this.device_id=void 0,this._status=void 0,this._pingResultEntries=void 0,(0,l.r)(this,"dialog-closed",{dialog:this.localName})}static get styles(){return[g.RF,g.nA,o.AH`.success{color:var(--success-color)}.failed{color:var(--error-color)}.flex-container{display:flex;align-items:center}.stages{margin-top:16px}.stage{padding:8px}ha-list{--mdc-list-side-padding:0}.flex-container ha-spinner,.flex-container ha-svg-icon{margin-right:20px}.flex-container ha-svg-icon{width:68px;height:48px}`]}constructor(...t){super(...t),this._open=!1}}(0,a.Cg)([(0,n.MZ)({attribute:!1})],y.prototype,"hass",void 0),(0,a.Cg)([(0,n.wk)()],y.prototype,"device_id",void 0),(0,a.Cg)([(0,n.wk)()],y.prototype,"_status",void 0),(0,a.Cg)([(0,n.wk)()],y.prototype,"_pingResultEntries",void 0),(0,a.Cg)([(0,n.wk)()],y.prototype,"_open",void 0),y=(0,a.Cg)([(0,n.EM)("dialog-matter-ping-node")],y),e()}catch(t){e(t)}})}};
//# sourceMappingURL=19434.b2415205da4f9eb5.js.map