var __awaiter=this&&this.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,s){function o(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r["throw"](e))}catch(e){s(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,a)}c((r=r.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(t){return c([e,t])}}function c(o){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,i&&(s=o[0]&2?i["return"]:o[0]?i["throw"]||((s=i["return"])&&s.call(i),0):i.next)&&!(s=s.call(i,o[1])).done)return s;if(i=0,s)o=[o[0]&2,s.value];switch(o[0]){case 0:case 1:s=o;break;case 4:n.label++;return{value:o[1],done:false};case 5:n.label++;i=o[1];o=[0];continue;case 7:o=n.ops.pop();n.trys.pop();continue;default:if(!(s=n.trys,s=s.length>0&&s[s.length-1])&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!s||o[1]>s[0]&&o[1]<s[3])){n.label=o[1];break}if(o[0]===6&&n.label<s[1]){n.label=s[1];s=o;break}if(s&&n.label<s[2]){n.label=s[2];n.ops.push(o);break}if(s[2])n.ops.pop();n.trys.pop();continue}o=t.call(e,n)}catch(e){o=[6,e];i=0}finally{r=s=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};System.register(["./p-6c8594d0.system.js","./p-9a8c9350.system.js","./p-b41f72c8.system.js","./p-63ad215f.system.js","./p-45d6fbc2.system.js","./p-0045ce79.system.js","./p-19b00569.system.js","./p-6efcc4fd.system.js","./p-0eebae53.system.js","./p-d19c8a5d.system.js"],(function(e){"use strict";var t,n,r,i,s,o,a,c,u;return{setters:[function(e){t=e.r;n=e.h;r=e.H},function(e){i=e.b;s=e.n;o=e.c;a=e.s},function(e){c=e.b},function(e){u=e.b},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){var f=function(){function e(){}e.prototype.getViewPageState=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,c.getBenefitsAsync()]}))}))};e.prototype.getShopifyUrl=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:e=i;return[4,c.getShopifyUrl()];case 1:return[2,e.apply(void 0,[t.sent().redirectUrl])]}}))}))};return e}();var l=new f;var p=e("ap_ben_benefits_page",function(){function e(e){t(this,e);this.shopifyUrl=s;this.urlRefreshHandle=s}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:e=this;return[4,l.getViewPageState()];case 1:e.state=t.sent();return[2]}}))}))};e.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:e=this;return[4,l.getShopifyUrl()];case 1:e.shopifyUrl=t.sent();this.setupShopifyUrlRefresh();return[4,u.trackPageViewedAsync({pageId:"viewBenefits"})];case 2:t.sent();return[2]}}))}))};e.prototype.disconnectedCallback=function(){if(o(this.urlRefreshHandle)){window.clearInterval(this.urlRefreshHandle.value)}};e.prototype.render=function(){return n(r,{class:"w-100 mb-4"},n("ap-ben-ui-container",{class:"mt-4 d-none"},n("div",{class:"row"},n("div",{class:"col-12"},n("ap-ben-hero-banner",{shopifyUrl:this.shopifyUrl}))),n("div",{class:"row"},n("div",{class:"col-12"},n("ap-ben-promoted-benefits",{benefits:this.state.promotedBenefits}))),n("div",{class:"row"},n("div",{class:"col-12"},n("ap-ben-benefits-list",{benefits:this.state.availableBenefits})))))};e.prototype.setupShopifyUrlRefresh=function(){var e=this;var t=2*60*1e3;this.urlRefreshHandle=a(window.setInterval((function(){return __awaiter(e,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:e=this;return[4,l.getShopifyUrl()];case 1:e.shopifyUrl=t.sent();return[2]}}))}))}),t))};return e}())}}}));