-
Notifications
You must be signed in to change notification settings - Fork 2
/
announcement-bar-announcement-bar-module-es5.fefdea16e83528997b8e.js
2 lines (2 loc) · 2.38 KB
/
announcement-bar-announcement-bar-module-es5.fefdea16e83528997b8e.js
1
2
function _classCallCheck(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function _createClass(n,e,t){return e&&_defineProperties(n.prototype,e),t&&_defineProperties(n,t),n}(window.webpackJsonp=window.webpackJsonp||[]).push([[2],{"5UAH":function(n,e,t){"use strict";t.r(e),t.d(e,"AnnouncementBarModule",(function(){return d}));var r=t("ofXK"),a=t("tk/3"),c=t("PCNd"),o=t("JIr8"),i=t("lJxs"),u=t("jn67"),s=t("fXoL"),f=t("vHPH");function l(n,e){if(1&n&&(s.Rb(0,"div",1),s.Rb(1,"div",2),s.Nb(2,"img",3),s.Nb(3,"p",4),s.Rb(4,"a",5),s.yc(5,"Learn More"),s.Qb(),s.Qb(),s.Qb()),2&n){var t=s.cc();s.zb(2),s.hc("src",t.announcement.imageUrl,s.sc),s.zb(1),s.hc("innerHTML",t.announcement.message,s.rc),s.zb(1),s.hc("href",t.announcement.linkUrl,s.sc)}}var b,m,p=u.a+"announcements.json",h=((m=function(){function n(e,t){_classCallCheck(this,n),this.http=e,this.logger=t}return _createClass(n,[{key:"ngOnInit",value:function(){var n=this;this.http.get(p).pipe(Object(o.a)((function(e){return n.logger.error(new Error("".concat(p," request failed: ").concat(e.message))),[]})),Object(i.a)((function(e){return n.findCurrentAnnouncement(e)})),Object(o.a)((function(e){return n.logger.error(new Error("".concat(p," contains invalid data: ").concat(e.message))),[]}))).subscribe((function(e){return n.announcement=e}))}},{key:"findCurrentAnnouncement",value:function(n){return n.filter((function(n){return new Date(n.startDate).valueOf()<Date.now()})).filter((function(n){return new Date(n.endDate).valueOf()>Date.now()}))[0]}}]),n}()).\u0275fac=function(n){return new(n||m)(s.Mb(a.a),s.Mb(f.a))},m.\u0275cmp=s.Gb({type:m,selectors:[["aio-announcement-bar"]],decls:1,vars:1,consts:[["class","homepage-container",4,"ngIf"],[1,"homepage-container"],[1,"announcement-bar"],["alt","",3,"src"],[3,"innerHTML"],[1,"button",3,"href"]],template:function(n,e){1&n&&s.xc(0,l,6,3,"div",0),2&n&&s.hc("ngIf",e.announcement)},directives:[r.k],encapsulation:2}),m),d=((b=function n(){_classCallCheck(this,n),this.customElementComponent=h}).\u0275mod=s.Kb({type:b}),b.\u0275inj=s.Jb({factory:function(n){return new(n||b)},imports:[[r.c,c.a,a.b]]}),b)}}]);
//# sourceMappingURL=announcement-bar-announcement-bar-module-es5.fefdea16e83528997b8e.js.map