var __awaiter=this&&this.__awaiter||function(t,e,n,r){function i(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,a){function c(t){try{u(r.next(t))}catch(t){a(t)}}function o(t){try{u(r["throw"](t))}catch(t){a(t)}}function u(t){t.done?n(t.value):i(t.value).then(c,o)}u((r=r.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,c;return c={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(c[Symbol.iterator]=function(){return this}),c;function o(t){return function(e){return u([t,e])}}function u(c){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,i&&(a=c[0]&2?i["return"]:c[0]?i["throw"]||((a=i["return"])&&a.call(i),0):i.next)&&!(a=a.call(i,c[1])).done)return a;if(i=0,a)c=[c[0]&2,a.value];switch(c[0]){case 0:case 1:a=c;break;case 4:n.label++;return{value:c[1],done:false};case 5:n.label++;i=c[1];c=[0];continue;case 7:c=n.ops.pop();n.trys.pop();continue;default:if(!(a=n.trys,a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){n.label=c[1];break}if(c[0]===6&&n.label<a[1]){n.label=a[1];a=c;break}if(a&&n.label<a[2]){n.label=a[2];n.ops.push(c);break}if(a[2])n.ops.pop();n.trys.pop();continue}c=e.call(t,n)}catch(t){c=[6,t];i=0}finally{r=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};import{B as BackendApiClient}from"./api-client-a68152b8.js";var BenefitsEventTrackingApi=function(){function t(){}t.prototype.postTrackEventAsync=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,BackendApiClient.instance.url("benefits/track-event").post(t).res()]}))}))};return t}();var benefitsEventTrackingApi=new BenefitsEventTrackingApi;var BenefitsEventTrackingService=function(){function t(){}t.prototype.trackAppLoadedAsync=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.trackEventAsync("appLoaded")]}))}))};t.prototype.trackPageViewedAsync=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.trackEventAsync({pageViewed:t})]}))}))};t.prototype.trackBenefitLinkClickedAsync=function(t){var e=t.benefitId,n=t.benefit;return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){t={benefitId:e,attachment:"link",category:n.category,subtitle:n.subtitle,title:n.title};return[2,this.trackEventAsync({benefitSelected:t})]}))}))};t.prototype.trackBenefitAttachmentClickedAsync=function(t){var e=t.benefitId,n=t.benefit;return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){t={benefitId:e,attachment:"document",category:n.category,subtitle:n.subtitle,title:n.title};return[2,this.trackEventAsync({benefitSelected:t})]}))}))};t.prototype.trackEventAsync=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,benefitsEventTrackingApi.postTrackEventAsync({event:t})];case 1:n.sent();return[3,3];case 2:e=n.sent();return[2];case 3:return[2]}}))}))};return t}();var benefitsEventTrackingService=new BenefitsEventTrackingService;export{benefitsEventTrackingService as b};