{"version":3,"file":"protoarch.angular-validation-message-provider-i18next.mjs","sources":["../../../../libs/validation-message/provider-i18next/I18NextValidationMessageComponent.ts","../../../../libs/validation-message/provider-i18next/I18NextValidationMessageModule.ts","../../../../libs/validation-message/provider-i18next/protoarch.angular-validation-message-provider-i18next.ts"],"sourcesContent":["/* eslint-disable @angular-eslint/component-max-inline-declarations */\r\n/* eslint-disable @angular-eslint/prefer-on-push-component-change-detection */\r\nimport {Component, Inject, ViewEncapsulation} from '@angular/core';\r\nimport {ValidationMessageComponent} from '@protoarch.angular/validation-message';\r\nimport {I18NEXT_NAMESPACE} from 'angular-i18next';\r\n\r\n@Component({\r\n    selector: 'i18next-validation-message',\r\n    template: `\r\n        <div class=\"error-container\">{{ i18nextKey | i18nextCap: firstMessage.params }}</div>\r\n        <i class=\"error-icon\"></i>\r\n    `,\r\n    styles: `\r\n        i18next-validation-message {\r\n            display: none;\r\n            width: 100%;\r\n            position: relative;\r\n        }\r\n        i18next-validation-message.standalone,\r\n        .ng-dirty.ng-invalid + i18next-validation-message {\r\n            display: block;\r\n        }\r\n    `,\r\n    encapsulation: ViewEncapsulation.None,\r\n    standalone: false,\r\n})\r\nexport class I18NextValidationMessageComponent extends ValidationMessageComponent {\r\n    private _validationString = 'validation';\r\n\r\n    constructor(@Inject(I18NEXT_NAMESPACE) private i18nextNamespace: string | string[]) {\r\n        super();\r\n    }\r\n\r\n    get i18nextKey(): string | string[] {\r\n        if (!this.firstMessage.key) return '';\r\n\r\n        const specificKey = [\r\n            this._validationString,\r\n            ['control_specific', this.controlPath, this.firstMessage.key].join('.'),\r\n        ].join(':');\r\n        const commonKey = [this._validationString, this.firstMessage.key].join(':');\r\n\r\n        const i18nextKeys = [];\r\n\r\n        if (this.i18nextNamespace && this.i18nextNamespace !== this._validationString) {\r\n            i18nextKeys.push([this.i18nextNamespace, specificKey].join('.'));\r\n            i18nextKeys.push([this.i18nextNamespace, commonKey].join('.'));\r\n        }\r\n        i18nextKeys.push(specificKey);\r\n        i18nextKeys.push(commonKey);\r\n\r\n        return i18nextKeys;\r\n    }\r\n}\r\n","import {NgModule} from '@angular/core';\r\nimport {\r\n    ValidationMessageComponent,\r\n    ValidationMessageModule,\r\n} from '@protoarch.angular/validation-message';\r\nimport {I18NextModule} from 'angular-i18next';\r\n\r\nimport {I18NextValidationMessageComponent} from './I18NextValidationMessageComponent';\r\n\r\nconst declarations = [I18NextValidationMessageComponent];\r\n\r\nexport const providers = [\r\n    {\r\n        provide: ValidationMessageComponent,\r\n        useValue: I18NextValidationMessageComponent,\r\n    },\r\n];\r\n\r\n@NgModule({\r\n    declarations: declarations,\r\n    exports: [declarations, ValidationMessageModule],\r\n    imports: [I18NextModule, ValidationMessageModule],\r\n    providers: providers,\r\n})\r\nexport class I18NextValidationMessageModule {}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;AACA;AAyBM,MAAO,iCAAkC,SAAQ,0BAA0B,CAAA;AAG9B,IAAA,gBAAA;IAFvC,iBAAiB,GAAG,YAAY;AAExC,IAAA,WAAA,CAA+C,gBAAmC,EAAA;AAC9E,QAAA,KAAK,EAAE;QADoC,IAAgB,CAAA,gBAAA,GAAhB,gBAAgB;;AAI/D,IAAA,IAAI,UAAU,GAAA;AACV,QAAA,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG;AAAE,YAAA,OAAO,EAAE;AAErC,QAAA,MAAM,WAAW,GAAG;AAChB,YAAA,IAAI,CAAC,iBAAiB;AACtB,YAAA,CAAC,kBAAkB,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;AAC1E,SAAA,CAAC,IAAI,CAAC,GAAG,CAAC;AACX,QAAA,MAAM,SAAS,GAAG,CAAC,IAAI,CAAC,iBAAiB,EAAE,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;Q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