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,EAEQ,EAAA,UAAA,cAAR,SAAsB,GACpB,KAAK,oBAAoB,KAAK,IAAI,oBAAoB,GACxD,EAEQ,EAAA,UAAA,aAAR,eAAA,EAAA,KACE,KAAK,QAAQ,OACX,KAAK,GAAI,CACP,MAAO,KAAK,MACZ,MAAO,KAAK,OACZ,OAAQ,KAAK,QACb,UAAW,KAAK,WAChB,MAAO,KAAK,MACZ,UAAW,SAAC,GAAsC,OAAA,EAAK,cAAc,EAAnB,EAClD,UAAW,WAAM,OAAA,EAAK,eAAL,GAEvB,EAhGA,WAAA,CAAC,OAAA,Q,8DAQD,WAAA,CAAC,OAAA,Q,4DAUD,WAAA,CAAC,OAAA,Q,6DAWD,WAAA,CAAC,OAAA,Q,gEAID,WAAA,CAAC,OAAA,Q,8DAGD,WAAA,CAAC,OAAA,Q,iEACD,WAAA,CAAC,OAAA,Q,qEAQD,WAAA,CAAC,OAAA,Q,wEAID,WAAA,CAAC,OAAA,Q,qEACD,WAAA,CAAC,OAAA,Q,oEAED,WAAA,CAAC,OAAA,S,yFAED,WAAA,CAAC,OAAA,S,yFA/DH,EAAA,WAAA,CAAC,OAAA,UAAU,CACT,SAAU,gBACV,SAAU,wBACV,gBAAiB,OAAA,wBAAwB,S,sCAuG3C,CArGA,GAAa,QAAA,sBAAqB","file":"/npm/angular-google-signin@0.1.5/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/angular-google-signin@0.1.5/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","import {Component, AfterViewInit, ChangeDetectionStrategy, Input, Output, EventEmitter} from '@angular/core';\r\n\r\nexport class GoogleSignInSuccess {\r\n  public googleUser: gapi.auth2.GoogleUser;\r\n\r\n  constructor(googleUser: gapi.auth2.GoogleUser) {\r\n    this.googleUser = googleUser;\r\n  }\r\n}\r\n\r\nexport class GoogleSignInFailure {\r\n}\r\n\r\n@Component({\r\n  selector: 'google-signin',\r\n  template: '<div [id]=\"id\"></div>',\r\n  changeDetection: ChangeDetectionStrategy.OnPush\r\n})\r\nexport class GoogleSignInComponent implements AfterViewInit {\r\n  private id: string = 'google-signin2';\r\n\r\n  // Render options\r\n  @Input() private scope: string;\r\n\r\n  private _width: number;\r\n\r\n  get width(): string {\r\n    return this._width.toString();\r\n  }\r\n\r\n  @Input() set width(value: string) {\r\n    this._width = Number(value);\r\n  }\r\n\r\n  private _height: number;\r\n\r\n  get height(): string {\r\n    return this._height.toString();\r\n  }\r\n\r\n  @Input() set height(value: string) {\r\n    this._height = Number(value);\r\n    gapi.load('', '');\r\n  }\r\n\r\n  private _longTitle: boolean;\r\n\r\n  get longTitle(): string {\r\n    return this._longTitle.toString();\r\n  }\r\n\r\n  @Input() set longTitle(value: string) {\r\n    this._longTitle = Boolean(value);\r\n  }\r\n\r\n  @Input() private theme: string;\r\n\r\n  // Init params\r\n  @Input() private clientId: string;\r\n  @Input() private cookiePolicy: string;\r\n\r\n  private _fetchBasicProfile: boolean;\r\n\r\n  get fetchBasicProfile(): string {\r\n    return this._fetchBasicProfile.toString();\r\n  }\r\n\r\n  @Input() set fetchBasicProfile(s: string) {\r\n    this._fetchBasicProfile = Boolean(s);\r\n  }\r\n\r\n  @Input() private hostedDomain: string;\r\n  @Input() private openidRealm: string;\r\n\r\n  @Output() googleSignInSuccess: EventEmitter<GoogleSignInSuccess> = new EventEmitter<GoogleSignInSuccess>();\r\n\r\n  @Output() googleSignInFailure: EventEmitter<GoogleSignInFailure> = new EventEmitter<GoogleSignInFailure>();\r\n\r\n  ngAfterViewInit() {\r\n    this.auth2Init();\r\n    this.renderButton();\r\n  }\r\n\r\n  private auth2Init() {\r\n    if (this.clientId == null)\r\n      throw new Error(\r\n        'clientId property is necessary. (<google-signin [clientId]=\"...\"></google-signin>)');\r\n\r\n    gapi.load('auth2', () => {\r\n      gapi.auth2.init({\r\n        client_id: this.clientId,\r\n        cookie_policy: this.cookiePolicy,\r\n        fetch_basic_profile: this._fetchBasicProfile,\r\n        hosted_domain: this.hostedDomain,\r\n        openid_realm: this.openidRealm\r\n      });\r\n    });\r\n  }\r\n\r\n  private handleFailure() {\r\n    this.googleSignInFailure.next(new GoogleSignInFailure());\r\n  }\r\n\r\n  private handleSuccess(googleUser: gapi.auth2.GoogleUser) {\r\n    this.googleSignInSuccess.next(new GoogleSignInSuccess(googleUser));\r\n  }\r\n\r\n  private renderButton() {\r\n    gapi.signin2.render(\r\n      this.id, {\r\n        scope: this.scope,\r\n        width: this._width,\r\n        height: this._height,\r\n        longtitle: this._longTitle,\r\n        theme: this.theme,\r\n        onsuccess: (googleUser: gapi.auth2.GoogleUser) => this.handleSuccess(googleUser),\r\n        onfailure: () => this.handleFailure()\r\n      });\r\n  }\r\n}\r\n"]}