"use strict";let t=null;function l(o,e="assertive",i=7e3){t?t.announce(o,e,i):(t=new h,(typeof IS_REACT_ACT_ENVIRONMENT=="boolean"?IS_REACT_ACT_ENVIRONMENT:typeof jest<"u")?t.announce(o,e,i):setTimeout(()=>{t?.isAttached()&&t?.announce(o,e,i)},100))}function s(o){t&&t.clear(o)}class h{isAttached(){var e;return(e=this.node)===null||e===void 0?void 0:e.isConnected}createLog(e){let i=document.createElement("div");return i.setAttribute("role","log"),i.setAttribute("aria-live",e),i.setAttribute("aria-relevant","additions"),i}destroy(){this.node&&(document.body.removeChild(this.node),this.node=null)}announce(e,i="assertive",r=7e3){var d,a;if(!this.node)return;let n=document.createElement("div");typeof e=="object"?(n.setAttribute("role","img"),n.setAttribute("aria-labelledby",e["aria-labelledby"])):n.textContent=e,i==="assertive"?(d=this.assertiveLog)===null||d===void 0||d.appendChild(n):(a=this.politeLog)===null||a===void 0||a.appendChild(n),e!==""&&setTimeout(()=>{n.remove()},r)}clear(e){this.node&&((!e||e==="assertive")&&this.assertiveLog&&(this.assertiveLog.innerHTML=""),(!e||e==="polite")&&this.politeLog&&(this.politeLog.innerHTML=""))}constructor(){this.node=null,this.assertiveLog=null,this.politeLog=null,typeof document<"u"&&(this.node=document.createElement("div"),this.node.dataset.liveAnnouncer="true",Object.assign(this.node.style,{border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"}),this.assertiveLog=this.createLog("assertive"),this.node.appendChild(this.assertiveLog),this.politeLog=this.createLog("polite"),this.node.appendChild(this.politeLog),document.body.prepend(this.node))}}exports.$319e236875307eab$export$a9b970dcc4ae71a9=l;exports.$319e236875307eab$export$d10ae4f68404609a=s;
//# sourceMappingURL=LiveAnnouncer-BkrEjKY8.cjs.js.map
