"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["21832"],{83387:function(o,a,i){i.a(o,async function(o,s){try{i.r(a),i.d(a,{DialogManageCloudhook:function(){return y}});i(3362),i(62953);var t=i(40445),e=i(96196),l=i(77845),n=i(1087),h=(i(93444),i(65063)),c=i(14503),d=i(36918),r=i(18350),u=i(99887),g=i(72554),p=o([r,u,g]);[r,u,g]=p.then?(await p)():p;let _,m,k,b,f=o=>o;const $="M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z";class y extends e.WF{showDialog(o){this._params=o,this._open=!0}closeDialog(){this._open=!1}_dialogClosed(){this._open=!1,this._params=void 0,(0,n.r)(this,"dialog-closed",{dialog:this.localName})}render(){if(!this._params)return e.s6;const{webhook:o,cloudhook:a}=this._params,i="automation"===o.domain?(0,d.o)(this.hass,"/docs/automation/trigger/#webhook-trigger"):(0,d.o)(this.hass,`/integrations/${o.domain}/`);return(0,e.qy)(_||(_=f` <ha-dialog .hass="${0}" .open="${0}" header-title="${0}" @closed="${0}"> <div> <p> ${0} </p> <ha-copy-textfield .hass="${0}" .value="${0}" .label="${0}"></ha-copy-textfield> </div> <ha-dialog-footer slot="footer"> <ha-button slot="secondaryAction" href="${0}" target="_blank" rel="noreferrer" appearance="plain"> ${0} <ha-svg-icon slot="end" .path="${0}"></ha-svg-icon> </ha-button> <ha-button slot="primaryAction" @click="${0}"> ${0} </ha-button> </ha-dialog-footer> </ha-dialog> `),this.hass,this._open,this.hass.localize("ui.panel.config.cloud.dialog_cloudhook.webhook_for",{name:o.name}),this._dialogClosed,a.managed?(0,e.qy)(k||(k=f` ${0} <button class="link" @click="${0}"> ${0}</button>. `),this.hass.localize("ui.panel.config.cloud.dialog_cloudhook.info_disable_webhook"),this._disableWebhook,this.hass.localize("ui.panel.config.cloud.dialog_cloudhook.link_disable_webhook")):(0,e.qy)(m||(m=f` ${0} `),this.hass.localize("ui.panel.config.cloud.dialog_cloudhook.managed_by_integration")),this.hass,a.cloudhook_url,this.hass.localize("ui.panel.config.common.copy_link"),i,this.hass.localize("ui.panel.config.cloud.dialog_cloudhook.view_documentation"),$,this.closeDialog,this.hass.localize("ui.panel.config.cloud.dialog_cloudhook.close"))}async _disableWebhook(){await(0,h.dk)(this,{title:this.hass.localize("ui.panel.config.cloud.dialog_cloudhook.confirm_disable_title"),text:this.hass.localize("ui.panel.config.cloud.dialog_cloudhook.confirm_disable_text",{name:this._params.webhook.name}),dismissText:this.hass.localize("ui.common.cancel"),confirmText:this.hass.localize("ui.common.disable"),destructive:!0})&&(this._params.disableHook(),this.closeDialog())}static get styles(){return[c.RF,c.nA,(0,e.AH)(b||(b=f`button.link{color:var(--primary-color);text-decoration:none}p{margin-top:0;margin-bottom:16px}`))]}constructor(...o){super(...o),this._open=!1}}(0,t.Cg)([(0,l.wk)()],y.prototype,"_params",void 0),(0,t.Cg)([(0,l.wk)()],y.prototype,"_open",void 0),y=(0,t.Cg)([(0,l.EM)("dialog-manage-cloudhook")],y),s()}catch(_){s(_)}})}}]);
//# sourceMappingURL=21832.0da46ffb2f1cfa86.js.map