{"version":3,"names":["BcAmplitude","componentWillLoad","amplitudeArgs","amplitudeApiKey","this","amplitudeUserId","accountPlanName","accountCreatedAt","accountEmail","accountStatus","user","planName","createdAt","email","status","offLocationChange","init","disconnectedCallback"],"sources":["app/javascript/components/global/bc-amplitude/bc-amplitude.tsx"],"sourcesContent":["import { Component, Prop, ComponentInterface } from \"@stencil/core\";\nimport { init, AmplitudeInitArgs } from \"./amplitude\";\n\n@Component({\n tag: \"bc-amplitude\",\n shadow: true,\n})\nexport class BcAmplitude implements ComponentInterface {\n @Prop() amplitudeApiKey!: string;\n @Prop() amplitudeUserId?: string;\n @Prop() accountPlanName?: string;\n @Prop() accountCreatedAt?: string;\n @Prop() accountEmail?: string;\n @Prop() accountStatus?: string;\n offLocationChange?: () => void;\n\n async componentWillLoad() {\n var amplitudeArgs: AmplitudeInitArgs = {\n amplitudeApiKey: this.amplitudeApiKey,\n amplitudeUserId: this.amplitudeUserId,\n };\n\n if (\n this.accountPlanName &&\n this.accountCreatedAt &&\n this.accountEmail &&\n this.accountStatus\n ) {\n amplitudeArgs.user = {\n planName: this.accountPlanName,\n createdAt: this.accountCreatedAt,\n email: this.accountEmail,\n status: this.accountStatus,\n };\n }\n\n this.offLocationChange = await init(amplitudeArgs);\n }\n\n disconnectedCallback() {\n if (this.offLocationChange) this.offLocationChange();\n }\n}\n"],"mappings":"sJAOaA,EAAW,M,+MAStB,uBAAMC,GACJ,IAAIC,EAAmC,CACrCC,gBAAiBC,KAAKD,gBACtBE,gBAAiBD,KAAKC,iBAGxB,GACED,KAAKE,iBACLF,KAAKG,kBACLH,KAAKI,cACLJ,KAAKK,cACL,CACAP,EAAcQ,KAAO,CACnBC,SAAUP,KAAKE,gBACfM,UAAWR,KAAKG,iBAChBM,MAAOT,KAAKI,aACZM,OAAQV,KAAKK,c,CAIjBL,KAAKW,wBAA0BC,EAAKd,E,CAGtC,oBAAAe,GACE,GAAIb,KAAKW,kBAAmBX,KAAKW,mB","ignoreList":[]}