const u=new Set(["en","ja","zh","ko","fr","de","es","pt","it","ru","ar","nl","sv","pl","tr","vi","th","id"]);function h(n){const c=n.toLowerCase().split(/[-_]/),o={},s=[];for(const t of c)t==="light"||t==="dark"?(o.theme=t,s.push(t.charAt(0).toUpperCase()+t.slice(1))):u.has(t)?(o.locale=t,s.push(t.toUpperCase())):s.push(t.charAt(0).toUpperCase()+t.slice(1));return{...o,label:s.join(" ")}}function d(n={}){const c=n.parseName??h,o=n.minFiles??1,s=n.dirPattern;return t=>{const l=new Map;for(const e of t){const r=e.path.indexOf("/");if(r>0){const a=e.path.slice(0,r);l.set(a,(l.get(a)??0)+1)}}const i=[];for(const[e,r]of l){if(e.startsWith(".")||r<o||s&&!s.test(e))continue;const a=c(e);if(!a)continue;const{label:p,...f}=a;i.push({prefix:e,label:p||e,traits:f})}return i.length<2?[]:(i.sort((e,r)=>e.prefix.localeCompare(r.prefix)),i)}}export{d as c};
