{"version":3,"file":"angulartics2-facebook.js","sources":["ng://angulartics2/facebook/facebook.ts","ng://angulartics2/facebook/angulartics2-facebook.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\n\nimport { Angulartics2 } from 'angulartics2';\n\ndeclare const fbq: facebook.Pixel.Event;\n\nconst facebookEventList = [\n 'ViewContent',\n 'Search',\n 'AddToCart',\n 'AddToWishlist',\n 'InitiateCheckout',\n 'AddPaymentInfo',\n 'Purchase',\n 'Lead',\n 'CompleteRegistration',\n];\n\n@Injectable({ providedIn: 'root' })\nexport class Angulartics2Facebook {\n constructor(private angulartics2: Angulartics2) { }\n\n startTracking(): void {\n this.angulartics2.eventTrack\n .pipe(this.angulartics2.filterDeveloperMode())\n .subscribe(x => this.eventTrack(x.action, x.properties));\n }\n\n /**\n * Send interactions to the Pixel, i.e. for event tracking in Pixel\n *\n * @param action action associated with the event\n */\n eventTrack(action: string, properties: any = {}) {\n if (typeof fbq === 'undefined') {\n return;\n }\n if (facebookEventList.indexOf(action) === -1) {\n return fbq('trackCustom', action, properties);\n }\n return fbq('track', action, properties);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './facebook';\n"],"names":[],"mappings":";;;;AAMA,MAAM,iBAAiB,GAAG;IACxB,aAAa;IACb,QAAQ;IACR,WAAW;IACX,eAAe;IACf,kBAAkB;IAClB,gBAAgB;IAChB,UAAU;IACV,MAAM;IACN,sBAAsB;CACvB,CAAC;AAGF,IAAa,oBAAoB,GAAjC,MAAa,oBAAoB;IAC/B,YAAoB,YAA0B;QAA1B,iBAAY,GAAZ,YAAY,CAAc;KAAK;IAEnD,aAAa;QACX,IAAI,CAAC,YAAY,CAAC,UAAU;aACzB,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,mBAAmB,EAAE,CAAC;aAC7C,SAAS,CAAC,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;KAC5D;;;;;;IAOD,UAAU,CAAC,MAAc,EAAE,aAAkB,EAAE;QAC7C,IAAI,OAAO,GAAG,KAAK,WAAW,EAAE;YAC9B,OAAO;SACR;QACD,IAAI,iBAAiB,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE;YAC5C,OAAO,GAAG,CAAC,aAAa,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;SAC/C;QACD,OAAO,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;KACzC;CACF,CAAA;;AAvBY,oBAAoB;IADhC,UAAU,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC;qCAEC,YAAY;GADnC,oBAAoB,CAuBhC;;AC1CD;;GAEG;;;;"}