{"version":3,"file":"light-dom.cjs","names":[],"sources":["../../src/core/light-dom.ts"],"sourcesContent":["// ── Slot / light-DOM query helpers ────────────────────────────────────────────\n// Utilities for querying slotted light-DOM children and resolving labels from\n// option elements. Used by group components (checkbox-group, radio-group) and\n// choice-field components (select, combobox).\n\n/**\n * Returns all light-DOM descendants matching `tag` inside `host`.\n * Uses `getElementsByTagName` on the host's light DOM \\u2014 not Shadow DOM slot assignment.\n */\nexport const getLightChildrenByTag = (host: HTMLElement, tag: string): HTMLElement[] =>\n  Array.from(host.getElementsByTagName(tag)) as HTMLElement[];\n\n/**\n * Returns the `textContent` of the item whose `value` attribute matches `value`,\n * falling back to `value` itself when no match is found.\n * Used by choice-field components to derive labels for emitted change events.\n */\nexport const getChoiceLabel = (items: HTMLElement[], value: string): string => {\n  const item = items.find((el) => (el.getAttribute('value') ?? '') === value);\n\n  return item?.textContent?.replace(/\\s+/g, ' ').trim() || value;\n};\n"],"mappings":"AASA,IAAa,GAAyB,EAAmB,IACvD,MAAM,KAAK,EAAK,qBAAqB,CAAG,CAAC,EAO9B,GAAkB,EAAsB,IACtC,EAAM,KAAM,IAAQ,EAAG,aAAa,OAAO,GAAK,MAAQ,CAE9D,CAAA,EAAM,aAAa,QAAQ,OAAQ,GAAG,CAAC,CAAC,KAAK,GAAK"}