{"version":3,"file":"keycloakify-angular-lib-directives-attributes.mjs","names":[],"sources":["../../src/lib/directives/attributes/attributes.directive.ts"],"sourcesContent":["import { Directive, effect, ElementRef, inject, input, Renderer2 } from '@angular/core';\n\n@Directive({ selector: '[kcAttributes]' })\nexport class AttributesDirective {\n    kcAttributes = input<Record<string, string>>();\n    readonly #el = inject<ElementRef<HTMLElement>>(ElementRef);\n    readonly #renderer = inject(Renderer2);\n\n    constructor() {\n        effect(() => {\n            const attributes = this.kcAttributes();\n            if (attributes) {\n                Object.entries(attributes).forEach(([key, value]) => {\n                    this.#renderer.setAttribute(\n                        this.#el.nativeElement,\n                        `data-${key}`,\n                        value\n                    );\n                });\n            }\n        });\n    }\n}\n"],"mappings":";;AAGA,IAAa,sBAAb,MAAa,oBAAmB;CAEnB;CACA;CAET,cAAA;EAJA,KAAA,eAAe,MAA+B,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,eAAA,CAAA,+BAAA,CAAA,CAAA;EACrC,KAAA,MAAM,OAAgC,UAAU;EAChD,KAAA,YAAY,OAAO,SAAS;EAGjC,aAAY;GACR,MAAM,aAAa,KAAK,aAAY;GACpC,IAAI,YACA,OAAO,QAAQ,UAAU,CAAC,CAAC,SAAS,CAAC,KAAK,WAAU;IAChD,KAAK,UAAU,aACX,KAAK,IAAI,eACT,QAAQ,OACR,KAAK;GAEb,CAAC;EAET,CAAC;CACL;CAlBS;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAmB,MAAA,CAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAAnB;EAAA,KAAA,OAAA,GAAA,qBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,MAAA;GAAmB,cAAA;GAAA,UAAA;GAAA,QAAA,EAAA,cAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA,EAAA;GAAA,UAAA;EAAA,CAAA;CAAA;;AAAnB,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAmB,YAAA,CAAA;EAD/B,MAAA;EAAU,MAAA,CAAA,EAAE,UAAU,iBAAgB,CAAE"}