import{useRef}from"react";import{o as o$1}from"./keyboard-D0PLkOsr.js";let a=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function o(b){var c,d;let e=null==(c=b.innerText)?"":c,g=b.cloneNode(!0);if(!(g instanceof HTMLElement))return e;let h=!1;for(let a of g.querySelectorAll("[hidden],[aria-hidden],[role=\"img\"]"))a.remove(),h=!0;let f=h?null==(d=g.innerText)?"":d:e;return a.test(f)&&(f=f.replace(a,"")),f}function g(a){let b=a.getAttribute("aria-label");if("string"==typeof b)return b.trim();let c=a.getAttribute("aria-labelledby");if(c){let a=c.split(" ").map(a=>{let b=document.getElementById(a);if(b){let a=b.getAttribute("aria-label");return"string"==typeof a?a.trim():o(b).trim()}return null}).filter(Boolean);if(0<a.length)return a.join(", ")}return o(a).trim()}function s(a){let b=useRef(""),c=useRef("");return o$1(()=>{let d=a.current;if(!d)return"";let e=d.innerText;if(b.current===e)return c.current;let f=g(d).trim().toLowerCase();return b.current=e,c.current=f,f})}export{s};