import "../../chunks/chunk.QU3DSPNU.js";
import {
  Directive,
  directive,
  PartType
} from "lit/directive.js";
import { nothing } from "lit/html.js";
class ForwardAttributesDirective extends Directive {
  constructor(partInfo) {
    super(partInfo);
    if (partInfo.type !== PartType.ELEMENT) {
      throw new Error(
        "The `forwardAttributes` directive must be used in element bindings"
      );
    }
  }
  render(_filter) {
    return nothing;
  }
  update(part, [filter]) {
    const element = part.element;
    const host = part.options?.host;
    Array.from(host.attributes).forEach((attr) => {
      if (filter(attr)) {
        element.setAttribute(attr.name.replace("gds-", ""), attr.value);
      }
    });
  }
}
const forwardAttributes = directive(ForwardAttributesDirective);
export {
  forwardAttributes
};
