"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["5222"],{76517:function(e,o,n){n.d(o,{attachExternalToApp:function(){return d},v:function(){return c}});n(23792),n(18111),n(7588),n(26099),n(31415),n(17642),n(58004),n(33853),n(45876),n(32475),n(15024),n(31698),n(47764),n(23500),n(62953);var a=n(1087),s=n(63091),t=n(91926),i=n(88249),r=new Set,d=function(e){window.addEventListener("haptic",function(o){return e.hass.auth.external.fireMessage({type:"haptic",payload:{hapticType:o.detail}})}),e.hass.auth.external.addCommandHandler(function(o){return l(e,o)})},c=function(e){return r.add(e),function(){r.delete(e)}},l=function(e,o){var n=e.hass.auth.external;if("restart"===o.command)e.hass.connection.reconnect(!0);else if("navigate"===o.command)(0,t.o)(o.payload.path,o.payload.options);else if("notifications/show"===o.command)(0,a.r)(e,"hass-show-notifications");else if("sidebar/toggle"===o.command){var d;if(null!==(d=s.G.history.state)&&void 0!==d&&d.open)return n.fireMessage({id:o.id,type:"result",success:!1,error:{code:"not_allowed",message:"dialog open"}}),!0;(0,a.r)(e,"hass-toggle-menu")}else if("sidebar/show"===o.command){var c;if(null!==(c=s.G.history.state)&&void 0!==c&&c.open)return n.fireMessage({id:o.id,type:"result",success:!1,error:{code:"not_allowed",message:"dialog open"}}),!0;(0,a.r)(e,"hass-toggle-menu",{open:!0})}else if("automation/editor/show"===o.command){var l;(0,i.mX)(null===(l=o.payload)||void 0===l?void 0:l.config)}else if("improv/discovered_device"===o.command)(0,a.r)(window,"improv-discovered-device",o.payload);else if("improv/device_setup_done"===o.command)(0,a.r)(window,"improv-device-setup-done");else if("bar_code/scan_result"===o.command)r.forEach(function(e){return e(o)});else if("bar_code/aborted"===o.command)r.forEach(function(e){return e(o)});else{if("kiosk_mode/set"!==o.command)return!1;(0,a.r)(window,"hass-kiosk-mode",{enable:o.payload.enable})}return n.fireMessage({id:o.id,type:"result",success:!0,result:null}),!0}}}]);
//# sourceMappingURL=5222.4ad297b3d1c5e14a.js.map