import{n as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-C21x__mS.js";function n(){let e=``;for(let t=0;t<arguments.length;t++){let n=arguments[t];if(!(!n||n===!0)){if(typeof n==`string`){e=e?e+` `+n:n;continue}if(!(typeof n!=`object`||Array.isArray(n)))for(let t in n)n[t]&&(e=e?e+` `+t:t)}}return e}function r(e){return e===`Enter`||e===` `}function i(e,t,n={}){return n.disabled||!r(e.key)?!1:(e.preventDefault(),t(),!0)}function a({currentIndex:e,itemCount:t,key:n,orientation:r,wrap:i=!0}){if(t<=0)return null;let a=Math.min(t-1,Math.max(0,e));return n===`Home`?0:n===`End`?t-1:n===(r===`horizontal`?`ArrowLeft`:`ArrowUp`)?a>0?a-1:i?t-1:0:n===(r===`horizontal`?`ArrowRight`:`ArrowDown`)?a<t-1?a+1:i?0:t-1:null}function o(...e){globalThis.console.error(...e)}function s(e,t){for(let n=0;n<e.length;n+=1)if(!t?.(e[n]))return n;return-1}function c(e,t){for(let n=e.length-1;n>=0;--n)if(!t?.(e[n]))return n;return-1}function l(e,t,n,r,i={}){let{wrap:a=!1}=i,o=t>=0&&t<e.length?t:-1,s=(t,i)=>{for(let a=t;n===1?a<=i:a>=i;a+=n)if(!r?.(e[a]))return a;return null},c=s(t+n,n===1?e.length-1:0);return c===null?!a||e.length===0?o:(n===1?s(0,Math.min(t-1,e.length-1)):s(e.length-1,Math.max(t+1,0)))??o:c}function u(){return(u=e((()=>{t()})))()}export{n as a,o as c,u as i,i as n,a as o,s as r,c as s,l as t};