// Helpers export const get = val => typeof val === "function" ? val() : val; export const getBy = (item, field = 'label') => (item && typeof item === 'object') ? item[field] : item; export const cls = (...classes) => classes.filter(Boolean).join(' ').trim(); export const isFn = f => typeof f === "function"; export const filterBy = (items, query, field = 'label', q = String(query).toLowerCase()) => !query ? get(items) : get(items).filter(item => String(item && typeof item === 'object' ? item[field] : item).toLowerCase().includes(q)); export const rand = (r) => `${r}-${Math.random().toString(36).slice(2, 9)}` export const hide = () => document.activeElement?.blur()