1 line
44 KiB
Plaintext
1 line
44 KiB
Plaintext
{"version":3,"file":"ngx-captcha.mjs","sources":["../../src/lib/services/script.service.ts","../../src/lib/components/base-re-captcha-component.directive.ts","../../src/lib/models/recaptcha-type.enum.ts","../../src/lib/components/invisible-recaptcha.component.ts","../../src/lib/components/recaptcha-2.component.ts","../../src/lib/services/recaptcha_v3.service.ts","../../src/lib/ngx-captcha.module.ts","../../src/public_api.ts","../../src/ngx-captcha.ts"],"sourcesContent":["import { Injectable, NgZone } from \"@angular/core\";\r\nimport { RecaptchaConfiguration } from \"../models/recaptcha-configuration\";\r\n\r\n@Injectable({\r\n providedIn: \"root\",\r\n})\r\nexport class ScriptService {\r\n private readonly scriptElemId: string = \"ngx-catpcha-script\";\r\n\r\n /**\r\n * Name of the global google recaptcha script\r\n */\r\n protected readonly windowGrecaptcha = \"grecaptcha\";\r\n\r\n /**\r\n * Name of enterpise property in the global google recaptcha script\r\n */\r\n protected readonly windowGrecaptchaEnterprise = \"enterprise\";\r\n\r\n /**\r\n * Name of the global callback\r\n */\r\n protected readonly windowOnLoadCallbackProperty =\r\n \"ngx_captcha_onload_callback\";\r\n\r\n /**\r\n * Name of the global callback for enterprise\r\n */\r\n protected readonly windowOnLoadEnterpriseCallbackProperty =\r\n \"ngx_captcha_onload_enterprise_callback\";\r\n\r\n protected readonly globalDomain: string = \"recaptcha.net\";\r\n\r\n protected readonly defaultDomain: string = \"google.com\";\r\n\r\n protected readonly enterpriseApi: string = \"enterprise.js\";\r\n\r\n protected readonly defaultApi: string = \"api.js\";\r\n\r\n constructor(protected zone: NgZone) {}\r\n\r\n registerCaptchaScript(\r\n config: RecaptchaConfiguration,\r\n render: string,\r\n onLoad: (grecaptcha: any) => void,\r\n language?: string\r\n ): void {\r\n if (this.grecaptchaScriptLoaded(config.useEnterprise)) {\r\n // recaptcha script is already loaded\r\n // just call the callback\r\n if (config.useEnterprise) {\r\n this.zone.run(() => {\r\n onLoad(\r\n (window as any)[this.windowGrecaptcha][\r\n this.windowGrecaptchaEnterprise\r\n ]\r\n );\r\n });\r\n } else {\r\n this.zone.run(() => {\r\n onLoad((window as any)[this.windowGrecaptcha]);\r\n });\r\n }\r\n return;\r\n }\r\n\r\n // we need to patch the callback through global variable, otherwise callback is not accessible\r\n // note: https://github.com/Enngage/ngx-captcha/issues/2\r\n if (config.useEnterprise) {\r\n (window as any)[this.getCallbackName(true)] = <any>(\r\n (() =>\r\n this.zone.run(\r\n onLoad.bind(\r\n this,\r\n (window as any)[this.windowGrecaptcha][\r\n this.windowGrecaptchaEnterprise\r\n ]\r\n )\r\n ))\r\n );\r\n } else {\r\n (window as any)[this.getCallbackName(false)] = <any>(\r\n (() =>\r\n this.zone.run(\r\n onLoad.bind(this, (window as any)[this.windowGrecaptcha])\r\n ))\r\n );\r\n }\r\n\r\n // prepare script elem\r\n const scriptElem = document.createElement(\"script\");\r\n scriptElem.id = this.scriptElemId;\r\n scriptElem.innerHTML = \"\";\r\n scriptElem.src = this.getCaptchaScriptUrl(config, render, language);\r\n scriptElem.async = true;\r\n scriptElem.defer = true;\r\n\r\n // add script to header\r\n document.getElementsByTagName(\"head\")[0].appendChild(scriptElem);\r\n }\r\n\r\n cleanup(): void {\r\n const elem = document.getElementById(this.scriptElemId);\r\n\r\n if (elem) {\r\n elem.remove();\r\n }\r\n (window as any)[this.getCallbackName()] = undefined;\r\n (window as any)[this.windowGrecaptcha] = undefined;\r\n }\r\n\r\n /**\r\n * Indicates if google recaptcha script is available and ready to be used\r\n */\r\n private grecaptchaScriptLoaded(useEnterprise?: boolean): boolean {\r\n if (\r\n !(window as any)[this.getCallbackName(useEnterprise)] ||\r\n !(window as any)[this.windowGrecaptcha]\r\n ) {\r\n return false;\r\n } else if (\r\n useEnterprise &&\r\n (window as any)[this.windowGrecaptcha][this.windowGrecaptchaEnterprise]\r\n ) {\r\n return true;\r\n // if only enterprise script is loaded we need to check some v3's method\r\n } else if ((window as any)[this.windowGrecaptcha].execute) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n * Gets global callback name\r\n * @param useEnterprise Optional flag for enterprise script\r\n * @private\r\n */\r\n private getCallbackName(useEnterprise?: boolean): string {\r\n return useEnterprise\r\n ? this.windowOnLoadEnterpriseCallbackProperty\r\n : this.windowOnLoadCallbackProperty;\r\n }\r\n\r\n /**\r\n * Gets language param used in script url\r\n */\r\n private getLanguageParam(hl?: string): string {\r\n if (!hl) {\r\n return \"\";\r\n }\r\n\r\n return `&hl=${hl}`;\r\n }\r\n\r\n /**\r\n * Url to google api script\r\n */\r\n private getCaptchaScriptUrl(\r\n config: RecaptchaConfiguration,\r\n render: string,\r\n language?: string\r\n ): string {\r\n const domain = config.useGlobalDomain\r\n ? this.globalDomain\r\n : this.defaultDomain;\r\n const api = config.useEnterprise ? this.enterpriseApi : this.defaultApi;\r\n const callback = this.getCallbackName(config.useEnterprise);\r\n\r\n return `https://www.${domain}/recaptcha/${api}?onload=${callback}&render=${render}${this.getLanguageParam(\r\n language\r\n )}`;\r\n }\r\n}\r\n","import {\r\n AfterViewChecked,\r\n AfterViewInit,\r\n Directive,\r\n ElementRef,\r\n EventEmitter,\r\n InjectFlags,\r\n Injector,\r\n Input,\r\n NgZone,\r\n OnChanges,\r\n Output,\r\n Renderer2,\r\n SimpleChanges,\r\n} from \"@angular/core\";\r\nimport {\r\n AbstractControl,\r\n ControlValueAccessor,\r\n NgControl,\r\n} from \"@angular/forms\";\r\n\r\nimport { ReCaptchaType } from \"../models/recaptcha-type.enum\";\r\nimport { ScriptService } from \"../services/script.service\";\r\n\r\n@Directive()\r\nexport abstract class BaseReCaptchaComponentDirective\r\n implements OnChanges, ControlValueAccessor, AfterViewInit, AfterViewChecked\r\n{\r\n /**\r\n * Prefix of the captcha element\r\n */\r\n protected readonly captchaElemPrefix = \"ngx_captcha_id_\";\r\n\r\n private setupCaptcha: boolean = true;\r\n\r\n /**\r\n * Google's site key.\r\n * You can find this under https://www.google.com/recaptcha\r\n */\r\n @Input() siteKey?: string;\r\n\r\n /**\r\n * Indicates if global domain 'recaptcha.net' should be used instead of default domain ('google.com')\r\n */\r\n @Input() useGlobalDomain: boolean = false;\r\n\r\n @Input() useEnterprise: boolean = false;\r\n\r\n /**\r\n * Type\r\n */\r\n @Input() type: \"audio\" | \"image\" = \"image\";\r\n\r\n /**\r\n * Language code. Auto-detects the user's language if unspecified.\r\n */\r\n @Input() hl?: string;\r\n\r\n /**\r\n * Tab index\r\n */\r\n @Input() tabIndex = 0;\r\n\r\n /**\r\n * Called when captcha receives successful response.\r\n * Captcha response token is passed to event.\r\n */\r\n @Output() success = new EventEmitter<string>();\r\n\r\n /**\r\n * Called when captcha is loaded. Event receives id of the captcha\r\n */\r\n @Output() load = new EventEmitter<void>();\r\n\r\n /**\r\n * Called when captcha is reset.\r\n */\r\n @Output() reset = new EventEmitter<void>();\r\n\r\n /**\r\n * Called when captcha is loaded & ready. I.e. when you need to execute captcha on component load.\r\n */\r\n @Output() ready = new EventEmitter<void>();\r\n\r\n /**\r\n * Error callback\r\n */\r\n @Output() error = new EventEmitter<void>();\r\n\r\n /**\r\n * Expired callback\r\n */\r\n @Output() expire = new EventEmitter<void>();\r\n\r\n abstract captchaWrapperElem?: ElementRef;\r\n\r\n /**\r\n * Indicates if captcha should be set on load\r\n */\r\n private setupAfterLoad = false;\r\n\r\n /**\r\n * Captcha element\r\n */\r\n protected captchaElem?: HTMLElement;\r\n\r\n /**\r\n * Id of the captcha elem\r\n */\r\n protected captchaId?: number;\r\n\r\n /**\r\n * Holds last response value\r\n */\r\n protected currentResponse?: string;\r\n\r\n /**\r\n * If enabled, captcha will reset after receiving success response. This is useful\r\n * when invisible captcha need to be resolved multiple times on same page\r\n */\r\n protected resetCaptchaAfterSuccess = false;\r\n\r\n /**\r\n * Captcha type\r\n */\r\n protected abstract recaptchaType: ReCaptchaType;\r\n\r\n /**\r\n * Required by ControlValueAccessor\r\n */\r\n protected onChange: (value: string | undefined) => void = (val) => {};\r\n protected onTouched: (value: string | undefined) => void = (val) => {};\r\n\r\n /**\r\n * Indicates if captcha is loaded\r\n */\r\n public isLoaded = false;\r\n\r\n /**\r\n * Reference to global reCaptcha API\r\n */\r\n public reCaptchaApi?: any;\r\n\r\n /**\r\n * Id of the DOM element wrapping captcha\r\n */\r\n public captchaElemId?: string;\r\n\r\n /**\r\n * Form Control to be enable usage in reactive forms\r\n */\r\n public control?: AbstractControl | null;\r\n\r\n protected constructor(\r\n protected renderer: Renderer2,\r\n protected zone: NgZone,\r\n protected injector: Injector,\r\n protected scriptService: ScriptService\r\n ) {}\r\n\r\n ngAfterViewInit() {\r\n this.control = this.injector.get<NgControl | undefined>(\r\n NgControl,\r\n undefined,\r\n InjectFlags.Optional\r\n )?.control;\r\n }\r\n\r\n ngAfterViewChecked(): void {\r\n if (this.setupCaptcha) {\r\n this.setupCaptcha = false;\r\n this.setupComponent();\r\n }\r\n }\r\n\r\n /**\r\n * Gets reCaptcha properties\r\n */\r\n protected abstract getCaptchaProperties(): any;\r\n\r\n /**\r\n * Used for captcha specific setup\r\n */\r\n protected abstract captchaSpecificSetup(): void;\r\n\r\n ngOnChanges(changes: SimpleChanges): void {\r\n // cleanup scripts if language changed because they need to be reloaded\r\n if (changes && changes.hl) {\r\n // cleanup scripts when language changes\r\n if (\r\n !changes.hl.firstChange &&\r\n changes.hl.currentValue !== changes.hl.previousValue\r\n ) {\r\n this.scriptService.cleanup();\r\n }\r\n }\r\n\r\n if (changes && changes.useGlobalDomain) {\r\n // cleanup scripts when domain changes\r\n if (\r\n !changes.useGlobalDomain.firstChange &&\r\n changes.useGlobalDomain.currentValue !==\r\n changes.useGlobalDomain.previousValue\r\n ) {\r\n this.scriptService.cleanup();\r\n }\r\n }\r\n\r\n this.setupCaptcha = true;\r\n }\r\n\r\n /**\r\n * Gets captcha response as per reCaptcha docs\r\n */\r\n getResponse(): string {\r\n return this.reCaptchaApi.getResponse(this.captchaId);\r\n }\r\n\r\n /**\r\n * Gets Id of captcha widget\r\n */\r\n getCaptchaId(): number | undefined {\r\n return this.captchaId;\r\n }\r\n\r\n /**\r\n * Resets captcha\r\n */\r\n resetCaptcha(): void {\r\n this.zone.run(() => {\r\n // reset captcha using Google js api\r\n this.reCaptchaApi.reset();\r\n\r\n // required due to forms\r\n this.onChange(undefined);\r\n this.onTouched(undefined);\r\n\r\n // trigger reset event\r\n this.reset.next();\r\n });\r\n }\r\n\r\n /**\r\n * Gets last submitted captcha response\r\n */\r\n getCurrentResponse(): string | undefined {\r\n return this.currentResponse;\r\n }\r\n\r\n /**\r\n * Reload captcha. Useful when properties (i.e. theme) changed and captcha need to reflect them\r\n */\r\n reloadCaptcha(): void {\r\n this.setupComponent();\r\n }\r\n\r\n protected ensureCaptchaElem(captchaElemId: string): void {\r\n const captchaElem = document.getElementById(captchaElemId);\r\n\r\n if (!captchaElem) {\r\n throw Error(`Captcha element with id '${captchaElemId}' was not found`);\r\n }\r\n\r\n // assign captcha alem\r\n this.captchaElem = captchaElem;\r\n }\r\n\r\n /**\r\n * Responsible for instantiating captcha element\r\n */\r\n protected renderReCaptcha(): void {\r\n // run outside angular zone due to timeout issues when testing\r\n // details: https://github.com/Enngage/ngx-captcha/issues/26\r\n this.zone.runOutsideAngular(() => {\r\n // to fix reCAPTCHA placeholder element must be an element or id\r\n // https://github.com/Enngage/ngx-captcha/issues/96\r\n setTimeout(() => {\r\n this.captchaId = this.reCaptchaApi.render(\r\n this.captchaElemId,\r\n this.getCaptchaProperties()\r\n );\r\n this.ready.next();\r\n }, 0);\r\n });\r\n }\r\n\r\n /**\r\n * Called when captcha receives response\r\n * @param callback Callback\r\n */\r\n protected handleCallback(callback: any): void {\r\n this.currentResponse = callback;\r\n this.success.next(callback);\r\n\r\n this.zone.run(() => {\r\n this.onChange(callback);\r\n this.onTouched(callback);\r\n });\r\n\r\n if (this.resetCaptchaAfterSuccess) {\r\n this.resetCaptcha();\r\n }\r\n }\r\n\r\n private getPseudoUniqueNumber(): number {\r\n return new Date().getUTCMilliseconds() + Math.floor(Math.random() * 9999);\r\n }\r\n\r\n private setupComponent(): void {\r\n // captcha specific setup\r\n this.captchaSpecificSetup();\r\n\r\n // create captcha wrapper\r\n this.createAndSetCaptchaElem();\r\n\r\n this.scriptService.registerCaptchaScript(\r\n {\r\n useGlobalDomain: this.useGlobalDomain,\r\n useEnterprise: this.useEnterprise,\r\n },\r\n \"explicit\",\r\n (grecaptcha) => {\r\n this.onloadCallback(grecaptcha);\r\n },\r\n this.hl\r\n );\r\n }\r\n\r\n /**\r\n * Called when google's recaptcha script is ready\r\n */\r\n private onloadCallback(grecapcha: any): void {\r\n // assign reference to reCaptcha Api once its loaded\r\n this.reCaptchaApi = grecapcha;\r\n\r\n if (!this.reCaptchaApi) {\r\n throw Error(`ReCaptcha Api was not initialized correctly`);\r\n }\r\n\r\n // loaded flag\r\n this.isLoaded = true;\r\n\r\n // fire load event\r\n this.load.next();\r\n\r\n // render captcha\r\n this.renderReCaptcha();\r\n\r\n // setup component if it was flagged as such\r\n if (this.setupAfterLoad) {\r\n this.setupAfterLoad = false;\r\n this.setupComponent();\r\n }\r\n }\r\n\r\n private generateNewElemId(): string {\r\n return this.captchaElemPrefix + this.getPseudoUniqueNumber();\r\n }\r\n\r\n private createAndSetCaptchaElem(): void {\r\n // generate new captcha id\r\n this.captchaElemId = this.generateNewElemId();\r\n\r\n if (!this.captchaElemId) {\r\n throw Error(`Captcha elem Id is not set`);\r\n }\r\n\r\n if (!this.captchaWrapperElem) {\r\n throw Error(`Captcha DOM element is not initialized`);\r\n }\r\n\r\n // remove old html\r\n this.captchaWrapperElem.nativeElement.innerHTML = \"\";\r\n\r\n // create new wrapper for captcha\r\n const newElem = this.renderer.createElement(\"div\");\r\n newElem.id = this.captchaElemId;\r\n\r\n this.renderer.appendChild(this.captchaWrapperElem.nativeElement, newElem);\r\n\r\n // when use captcha in cdk stepper then throwing error Captcha element with id 'ngx_captcha_id_XXXX' not found\r\n // to fix it checking ensureCaptchaElem in timeout so that its check in next call and its able to find element\r\n setTimeout(() => {\r\n // update captcha elem\r\n if (this.captchaElemId) {\r\n this.ensureCaptchaElem(this.captchaElemId);\r\n }\r\n }, 0);\r\n }\r\n\r\n /**\r\n * To be aligned with the ControlValueAccessor interface we need to implement this method\r\n * However as we don't want to update the recaptcha, this doesn't need to be implemented\r\n */\r\n public writeValue(obj: any): void {}\r\n\r\n /**\r\n * This method helps us tie together recaptcha and our formControl values\r\n */\r\n public registerOnChange(fn: any): void {\r\n this.onChange = fn;\r\n }\r\n\r\n /**\r\n * At some point we might be interested whether the user has touched our component\r\n */\r\n public registerOnTouched(fn: any): void {\r\n this.onTouched = fn;\r\n }\r\n\r\n /**\r\n * Handles error callback\r\n */\r\n protected handleErrorCallback(): void {\r\n this.zone.run(() => {\r\n this.onChange(undefined);\r\n this.onTouched(undefined);\r\n });\r\n\r\n this.error.next();\r\n }\r\n\r\n /**\r\n * Handles expired callback\r\n */\r\n protected handleExpireCallback(): void {\r\n this.expire.next();\r\n\r\n // reset captcha on expire callback\r\n this.resetCaptcha();\r\n }\r\n}\r\n","export enum ReCaptchaType {\r\n\r\n InvisibleReCaptcha,\r\n ReCaptcha2\r\n}\r\n","import {\r\n Component,\r\n ElementRef,\r\n forwardRef,\r\n Injector,\r\n Input,\r\n NgZone,\r\n OnChanges,\r\n Renderer2,\r\n SimpleChanges,\r\n ViewChild,\r\n} from '@angular/core';\r\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\r\n\r\nimport { ReCaptchaType } from '../models/recaptcha-type.enum';\r\nimport { ScriptService } from '../services/script.service';\r\nimport { BaseReCaptchaComponentDirective } from './base-re-captcha-component.directive';\r\n\r\n@Component({\r\n selector: 'ngx-invisible-recaptcha',\r\n template: `\r\n <div #captchaWrapperElem></div>`,\r\n providers: [\r\n {\r\n provide: NG_VALUE_ACCESSOR,\r\n useExisting: forwardRef(() => InvisibleReCaptchaComponent),\r\n multi: true,\r\n }\r\n ]\r\n})\r\nexport class InvisibleReCaptchaComponent extends BaseReCaptchaComponentDirective implements OnChanges {\r\n\r\n /**\r\n * This size representing invisible captcha\r\n */\r\n protected readonly size = 'invisible';\r\n\r\n /**\r\n * Theme\r\n */\r\n @Input() theme: 'dark' | 'light' = 'light';\r\n\r\n /**\r\n * Badge\r\n */\r\n @Input() badge: 'bottomright' | 'bottomleft' | 'inline' = 'bottomright';\r\n\r\n @ViewChild('captchaWrapperElem', { static: false }) captchaWrapperElem?: ElementRef;\r\n\r\n protected recaptchaType: ReCaptchaType = ReCaptchaType.InvisibleReCaptcha;\r\n\r\n constructor(\r\n protected renderer: Renderer2,\r\n protected zone: NgZone,\r\n protected injector: Injector,\r\n protected scriptService: ScriptService\r\n ) {\r\n super(renderer, zone, injector, scriptService);\r\n }\r\n\r\n ngOnChanges(changes: SimpleChanges): void {\r\n super.ngOnChanges(changes);\r\n }\r\n\r\n /**\r\n * Programatically invoke the reCAPTCHA check. Used if the invisible reCAPTCHA is on a div instead of a button.\r\n */\r\n execute(): void {\r\n // execute captcha\r\n this.zone.runOutsideAngular(() => this.reCaptchaApi.execute(this.captchaId));\r\n }\r\n\r\n protected captchaSpecificSetup(): void {\r\n }\r\n\r\n /**\r\n * Gets reCaptcha properties\r\n */\r\n protected getCaptchaProperties(): any {\r\n return {\r\n 'sitekey': this.siteKey,\r\n 'callback': (response: any) => this.zone.run(() => this.handleCallback(response)),\r\n 'expired-callback': () => this.zone.run(() => this.handleExpireCallback()),\r\n 'error-callback': () => this.zone.run(() => this.handleErrorCallback()),\r\n 'badge': this.badge,\r\n 'type': this.type,\r\n 'tabindex': this.tabIndex,\r\n 'size': this.size,\r\n 'theme': this.theme\r\n };\r\n }\r\n\r\n\r\n}\r\n\r\n","import {\r\n Component,\r\n ElementRef,\r\n forwardRef,\r\n Injector,\r\n Input,\r\n NgZone,\r\n OnChanges,\r\n OnDestroy,\r\n Renderer2,\r\n SimpleChanges,\r\n ViewChild,\r\n} from '@angular/core';\r\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\r\n\r\nimport { ReCaptchaType } from '../models/recaptcha-type.enum';\r\nimport { ScriptService } from '../services/script.service';\r\nimport { BaseReCaptchaComponentDirective } from './base-re-captcha-component.directive';\r\n\r\n@Component({\r\n selector: 'ngx-recaptcha2',\r\n template: `\r\n <div #captchaWrapperElem></div>`,\r\n providers: [\r\n {\r\n provide: NG_VALUE_ACCESSOR,\r\n useExisting: forwardRef(() => ReCaptcha2Component),\r\n multi: true,\r\n }\r\n ]\r\n})\r\nexport class ReCaptcha2Component extends BaseReCaptchaComponentDirective implements OnChanges, OnDestroy {\r\n\r\n /**\r\n * Name of the global expire callback\r\n */\r\n protected readonly windowOnErrorCallbackProperty = 'ngx_captcha_error_callback';\r\n\r\n /**\r\n * Name of the global error callback\r\n */\r\n protected readonly windowOnExpireCallbackProperty = 'ngx_captcha_expire_callback';\r\n\r\n /**\r\n * Theme\r\n */\r\n @Input() theme: 'dark' | 'light' = 'light';\r\n\r\n /**\r\n * Size\r\n */\r\n @Input() size: 'compact' | 'normal' = 'normal';\r\n\r\n @ViewChild('captchaWrapperElem', { static: false}) captchaWrapperElem?: ElementRef;\r\n\r\n protected recaptchaType: ReCaptchaType = ReCaptchaType.ReCaptcha2;\r\n\r\n constructor(\r\n protected renderer: Renderer2,\r\n protected zone: NgZone,\r\n protected injector: Injector,\r\n protected scriptService: ScriptService,\r\n ) {\r\n super(renderer, zone, injector, scriptService);\r\n }\r\n\r\n ngOnChanges(changes: SimpleChanges): void {\r\n super.ngOnChanges(changes);\r\n }\r\n\r\n ngOnDestroy(): void {\r\n (window as any)[this.windowOnErrorCallbackProperty] = {};\r\n (window as any)[this.windowOnExpireCallbackProperty] = {};\r\n }\r\n\r\n protected captchaSpecificSetup(): void {\r\n this.registerCallbacks();\r\n }\r\n\r\n /**\r\n * Gets reCaptcha properties\r\n */\r\n protected getCaptchaProperties(): any {\r\n return {\r\n 'sitekey': this.siteKey,\r\n 'callback': (response: any) => this.zone.run(() => this.handleCallback(response)),\r\n 'expired-callback': () => this.zone.run(() => this.handleExpireCallback()),\r\n 'error-callback': () => this.zone.run(() => this.handleErrorCallback()),\r\n 'theme': this.theme,\r\n 'type': this.type,\r\n 'size': this.size,\r\n 'tabindex': this.tabIndex\r\n };\r\n }\r\n\r\n /**\r\n * Registers global callbacks\r\n */\r\n private registerCallbacks(): void {\r\n (window as any)[this.windowOnErrorCallbackProperty] = super.handleErrorCallback.bind(this);\r\n (window as any)[this.windowOnExpireCallbackProperty] = super.handleExpireCallback.bind(this);\r\n }\r\n}\r\n\r\n","import { Injectable, NgZone } from \"@angular/core\";\r\n\r\nimport { ScriptService } from \"./script.service\";\r\nimport { RecaptchaConfiguration } from \"../models/recaptcha-configuration\";\r\n\r\n@Injectable({\r\n providedIn: \"root\",\r\n})\r\nexport class ReCaptchaV3Service {\r\n constructor(protected scriptService: ScriptService, protected zone: NgZone) {}\r\n\r\n /**\r\n * Executes reCaptcha v3/Enterprise with given action and passes token via callback. You need to verify\r\n * this callback in your backend to get meaningful results.\r\n *\r\n * For more information see https://developers.google.com/recaptcha/docs/v3\r\n * For enterprise see https://cloud.google.com/recaptcha-enterprise/docs\r\n *\r\n * @param siteKey Site key found in your google admin panel\r\n * @param action Action to log\r\n * @param callback Callback function to to handle token\r\n * @param config Optional configuration like useGlobalDomain to be provided\r\n * @param errorCallback Optional Callback function to handle errors\r\n */\r\n execute(\r\n siteKey: string,\r\n action: string,\r\n callback: (token: string) => void,\r\n config?: RecaptchaConfiguration,\r\n errorCallback?: (error: any) => void\r\n ): void {\r\n this.executeAsPromise(siteKey, action, config)\r\n .then(callback)\r\n .catch((error) =>\r\n errorCallback ? errorCallback(error) : console.error(error)\r\n );\r\n }\r\n\r\n /**\r\n * Executes reCaptcha v3/Enterprise with given action and returns token via Promise. You need to verify\r\n * this token in your backend to get meaningful results.\r\n *\r\n * For more information see https://developers.google.com/recaptcha/docs/v3\r\n * For enterprise see https://cloud.google.com/recaptcha-enterprise/docs\r\n *\r\n * @param siteKey Site key found in your google admin panel\r\n * @param action Action to log\r\n * @param config Optional configuration like useGlobalDomain to be provided\r\n */\r\n executeAsPromise(\r\n siteKey: string,\r\n action: string,\r\n config?: RecaptchaConfiguration\r\n ): Promise<string> {\r\n return new Promise((resolve, reject) => {\r\n const configuration = config || {};\r\n\r\n const onRegister = (grecaptcha: any) => {\r\n this.zone.runOutsideAngular(() => {\r\n try {\r\n grecaptcha\r\n .execute(siteKey, { action })\r\n .then((token: any) => this.zone.run(() => resolve(token)));\r\n } catch (error) {\r\n reject(error);\r\n }\r\n });\r\n };\r\n\r\n this.scriptService.registerCaptchaScript(\r\n configuration,\r\n siteKey,\r\n onRegister\r\n );\r\n });\r\n }\r\n}\r\n","import { CommonModule } from '@angular/common';\r\nimport { NgModule } from '@angular/core';\r\n\r\nimport { InvisibleReCaptchaComponent } from './components/invisible-recaptcha.component';\r\nimport { ReCaptcha2Component } from './components/recaptcha-2.component';\r\nimport { ReCaptchaV3Service } from './services/recaptcha_v3.service';\r\nimport { ScriptService } from './services/script.service';\r\n\r\n@NgModule({\r\n imports: [\r\n CommonModule\r\n ],\r\n declarations: [\r\n ReCaptcha2Component,\r\n InvisibleReCaptchaComponent\r\n ],\r\n providers: [\r\n ScriptService,\r\n ReCaptchaV3Service\r\n ],\r\n exports: [\r\n ReCaptcha2Component,\r\n InvisibleReCaptchaComponent\r\n ]\r\n})\r\nexport class NgxCaptchaModule {\r\n}\r\n\r\n\r\n","/*\r\n * Public API\r\n */\r\n\r\nexport * from './lib/index';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1.ScriptService"],"mappings":";;;;;MAMa,aAAa,CAAA;AAiCxB,IAAA,WAAA,CAAsB,IAAY,EAAA;AAAZ,QAAA,IAAI,CAAA,IAAA,GAAJ,IAAI,CAAQ;AAhCjB,QAAA,IAAY,CAAA,YAAA,GAAW,oBAAoB,CAAC;AAE7D;;AAEG;AACgB,QAAA,IAAgB,CAAA,gBAAA,GAAG,YAAY,CAAC;AAEnD;;AAEG;AACgB,QAAA,IAA0B,CAAA,0B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