{"version":3,"file":"angulartics2-kissmetrics.js","sources":["ng://angulartics2/kissmetrics/kissmetrics.ts","ng://angulartics2/kissmetrics/angulartics2-kissmetrics.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\n\nimport { Angulartics2 } from 'angulartics2';\n\ndeclare var _kmq: any;\n\n@Injectable({ providedIn: 'root' })\nexport class Angulartics2Kissmetrics {\n\n constructor(\n private angulartics2: Angulartics2\n ) {\n if (typeof (_kmq) === 'undefined') {\n _kmq = [];\n }\n this.angulartics2.setUsername\n .subscribe((x: string) => this.setUsername(x));\n this.angulartics2.setUserProperties\n .subscribe((x) => this.setUserProperties(x));\n }\n\n startTracking(): void {\n this.angulartics2.pageTrack\n .pipe(this.angulartics2.filterDeveloperMode())\n .subscribe((x) => this.pageTrack(x.path));\n this.angulartics2.eventTrack\n .pipe(this.angulartics2.filterDeveloperMode())\n .subscribe((x) => this.eventTrack(x.action, x.properties));\n }\n\n pageTrack(path: string) {\n _kmq.push(['record', 'Pageview', { Page: path }]);\n }\n\n eventTrack(action: string, properties: any) {\n _kmq.push(['record', action, properties]);\n }\n\n setUsername(userId: string) {\n _kmq.push(['identify', userId]);\n }\n\n setUserProperties(properties: any) {\n _kmq.push(['set', properties]);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './kissmetrics';\n"],"names":[],"mappings":";;;;;IASE,iCACU,YAA0B;QADpC,iBAUC;QATS,iBAAY,GAAZ,YAAY,CAAc;QAElC,IAAI,QAAQ,IAAI,CAAC,KAAK,WAAW,EAAE;YACjC,IAAI,GAAG,EAAE,CAAC;SACX;QACD,IAAI,CAAC,YAAY,CAAC,WAAW;aAC1B,SAAS,CAAC,UAAC,CAAS,IAAK,OAAA,KAAI,CAAC,WAAW,CAAC,CAAC,CAAC,GAAA,CAAC,CAAC;QACjD,IAAI,CAAC,YAAY,CAAC,iBAAiB;aAChC,SAAS,CAAC,UAAC,CAAC,IAAK,OAAA,KAAI,CAAC,iBAAiB,CAAC,CAAC,CA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