-
Notifications
You must be signed in to change notification settings - Fork 1
/
announcement-bar-announcement-bar-module-ngfactory.a6c0de9904c59aa96f6e.js.map
1 lines (1 loc) · 12.9 KB
/
announcement-bar-announcement-bar-module-ngfactory.a6c0de9904c59aa96f6e.js.map
1
{"version":3,"sources":["webpack:///./src/app/custom-elements/announcement-bar/announcement-bar.component.ts","webpack:///./src/app/custom-elements/announcement-bar/announcement-bar.module.ts","webpack:///./src/app/custom-elements/announcement-bar/announcement-bar.component.ngfactory.js.pre-build-optimizer.js","webpack:///./src/app/custom-elements/announcement-bar/announcement-bar.component.ts.AnnouncementBarComponent.html","webpack:///./src/app/custom-elements/announcement-bar/announcement-bar.module.ngfactory.js.pre-build-optimizer.js"],"names":["announcementsPath","announcement_bar_component_AnnouncementBarComponent","AnnouncementBarComponent","http","logger","this","prototype","ngOnInit","_this","get","pipe","Object","catchError","error","Error","message","map","announcements","findCurrentAnnouncement","subscribe","announcement","filter","Date","startDate","valueOf","now","endDate","announcement_bar_module_AnnouncementBarModule","customElementComponent","RenderType_AnnouncementBarComponent","core","encapsulation","styles","data","View_AnnouncementBarComponent_1","_l","_ck","_v","_co","component","imageUrl","linkUrl","View_AnnouncementBarComponent_0","common","ngIf","View_AnnouncementBarComponent_Host_0","logger_service","AnnouncementBarComponentNgFactory","__webpack_require__","d","__webpack_exports__","AnnouncementBarModuleNgFactory","p0_0","shared_module"],"mappings":"0IAKMA,YAAoB,EAAqB,qBAsC/CC,EAAA,WAcE,SAAAC,EAAoBC,EAA0BC,GAA1BC,KAAAF,OAA0BE,KAAAD,SA2BhD,OAzBEF,EAAAI,UAAAC,SAAA,eAAAC,EAAAH,KACEA,KAAKF,KAAKM,IAAoBT,GAC3BU,KACCC,OAAAC,EAAA,EAAAD,CAAW,SAAAE,GAET,OADAL,EAAKJ,OAAOS,MAAM,IAAIC,MAASd,EAAiB,oBAAoBa,EAAME,UACnE,KAETJ,OAAAK,EAAA,EAAAL,CAAI,SAAAM,GAAiB,OAAAT,EAAKU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A,EAAA,GAAQ,KAAM3B,EAAA,EAAeA,EAAA,EAAe,CAACA,EAAA,IAAkB2B,EAAA,GAAQ,WAAYa,EAAA,EAAiBA,EAAA,EAAiB,IAAKb,EAAA,GAAQ,WAAYuB,EAAA,EAAiBA,EAAA,EAAiB,IAAKvB,EAAA,GAAQ,WAAY3B,EAAA,EAAyBA,EAAA,EAAyB,IAAK2B,EAAA,GAAQ,WAAY3B,EAAA,EAAqBA,EAAA,EAAqB,IAAK2B,EAAA,GAAQ,WAAYH,EAA0BA,EAA0B,IAAKG,EAAA,GAAQ,IAAK3B,EAAA,EAAyC,aAAc,IAAK2B,EAAA,GAAQ,IAAK3B,EAAA,EAAyC,eAAgB","file":"announcement-bar-announcement-bar-module-ngfactory.a6c0de9904c59aa96f6e.js","sourcesContent":["import { Component, OnInit } from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\nimport { catchError, map } from 'rxjs/operators';\nimport { Logger } from 'app/shared/logger.service';\nimport { CONTENT_URL_PREFIX } from 'app/documents/document.service';\nconst announcementsPath = CONTENT_URL_PREFIX + 'announcements.json';\n\nexport interface Announcement {\n imageUrl: string;\n message: string;\n linkUrl: string;\n startDate: string;\n endDate: string;\n}\n\n/**\n * Display the latest live announcement. This is used on the homepage.\n *\n * The data for the announcements is kept in `aio/content/marketing/announcements.json`.\n *\n * The format for that data file looks like:\n *\n * ```\n * [\n * {\n * \"startDate\": \"2018-02-01\",\n * \"endDate\": \"2018-03-01\",\n * \"message\": \"This is an <b>important</b> announcement\",\n * \"imageUrl\": \"url/to/image\",\n * \"linkUrl\": \"url/to/website\"\n * },\n * ...\n * ]\n * ```\n *\n * Only one announcement will be shown at any time. This is determined as the first \"live\"\n * announcement in the file, where \"live\" means that its start date is before today, and its\n * end date is after today.\n *\n * **Security Note:**\n * The `message` field can contain unsanitized HTML but this field should only updated by\n * verified members of the Angular team.\n */\n@Component({\n selector: 'aio-announcement-bar',\n template: `\n <div class=\"homepage-container\" *ngIf=\"announcement\">\n <div class=\"announcement-bar\">\n <img [src]=\"announcement.imageUrl\" alt=\"\">\n <p [innerHTML]=\"announcement.message\"></p>\n <a class=\"button\" [href]=\"announcement.linkUrl\">Learn More</a>\n </div>\n </div>`\n})\nexport class AnnouncementBarComponent implements OnInit {\n announcement: Announcement;\n\n constructor(private http: HttpClient, private logger: Logger) {}\n\n ngOnInit() {\n this.http.get<Announcement[]>(announcementsPath)\n .pipe(\n catchError(error => {\n this.logger.error(new Error(`${announcementsPath} request failed: ${error.message}`));\n return [];\n }),\n map(announcements => this.findCurrentAnnouncement(announcements)),\n catchError(error => {\n this.logger.error(new Error(`${announcementsPath} contains invalid data: ${error.message}`));\n return [];\n }),\n )\n .subscribe(announcement => this.announcement = announcement);\n }\n\n /**\n * Get the first date in the list that is \"live\" now\n */\n private findCurrentAnnouncement(announcements: Announcement[]) {\n return announcements\n .filter(announcement => new Date(announcement.startDate).valueOf() < Date.now())\n .filter(announcement => new Date(announcement.endDate).valueOf() > Date.now())\n [0];\n }\n}\n","import { NgModule, Type } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { HttpClientModule } from '@angular/common/http';\nimport { SharedModule } from '../../shared/shared.module';\nimport { AnnouncementBarComponent } from './announcement-bar.component';\nimport { WithCustomElementComponent } from '../element-registry';\n\n@NgModule({\n imports: [ CommonModule, SharedModule, HttpClientModule ],\n declarations: [ AnnouncementBarComponent ],\n entryComponents: [ AnnouncementBarComponent ],\n})\nexport class AnnouncementBarModule implements WithCustomElementComponent {\n customElementComponent: Type<any> = AnnouncementBarComponent;\n}\n","/**\n * @fileoverview This file was generated by the Angular template compiler. Do not edit.\n *\n * @suppress {suspiciousCode,uselessCode,missingProperties,missingOverride,checkTypes}\n * tslint:disable\n */ \nimport * as i0 from \"@angular/core\";\nimport * as i1 from \"@angular/common\";\nimport * as i2 from \"./announcement-bar.component\";\nimport * as i3 from \"@angular/common/http\";\nimport * as i4 from \"../../shared/logger.service\";\nvar styles_AnnouncementBarComponent = [];\nvar RenderType_AnnouncementBarComponent = i0.ɵcrt({ encapsulation: 2, styles: styles_AnnouncementBarComponent, data: {} });\nexport { RenderType_AnnouncementBarComponent as RenderType_AnnouncementBarComponent };\nfunction View_AnnouncementBarComponent_1(_l) { return i0.ɵvid(0, [(_l()(), i0.ɵeld(0, 0, null, null, 5, \"div\", [[\"class\", \"homepage-container\"]], null, null, null, null, null)), (_l()(), i0.ɵeld(1, 0, null, null, 4, \"div\", [[\"class\", \"announcement-bar\"]], null, null, null, null, null)), (_l()(), i0.ɵeld(2, 0, null, null, 0, \"img\", [[\"alt\", \"\"]], [[8, \"src\", 4]], null, null, null, null)), (_l()(), i0.ɵeld(3, 0, null, null, 0, \"p\", [], [[8, \"innerHTML\", 1]], null, null, null, null)), (_l()(), i0.ɵeld(4, 0, null, null, 1, \"a\", [[\"class\", \"button\"]], [[8, \"href\", 4]], null, null, null, null)), (_l()(), i0.ɵted(-1, null, [\"Learn More\"]))], null, function (_ck, _v) { var _co = _v.component; var currVal_0 = _co.announcement.imageUrl; _ck(_v, 2, 0, currVal_0); var currVal_1 = _co.announcement.message; _ck(_v, 3, 0, currVal_1); var currVal_2 = _co.announcement.linkUrl; _ck(_v, 4, 0, currVal_2); }); }\nexport function View_AnnouncementBarComponent_0(_l) { return i0.ɵvid(0, [(_l()(), i0.ɵand(16777216, null, null, 1, null, View_AnnouncementBarComponent_1)), i0.ɵdid(1, 16384, null, 0, i1.NgIf, [i0.ViewContainerRef, i0.TemplateRef], { ngIf: [0, \"ngIf\"] }, null)], function (_ck, _v) { var _co = _v.component; var currVal_0 = _co.announcement; _ck(_v, 1, 0, currVal_0); }, null); }\nexport function View_AnnouncementBarComponent_Host_0(_l) { return i0.ɵvid(0, [(_l()(), i0.ɵeld(0, 0, null, null, 1, \"aio-announcement-bar\", [], null, null, null, View_AnnouncementBarComponent_0, RenderType_AnnouncementBarComponent)), i0.ɵdid(1, 114688, null, 0, i2.AnnouncementBarComponent, [i3.HttpClient, i4.Logger], null, null)], function (_ck, _v) { _ck(_v, 1, 0); }, null); }\nvar AnnouncementBarComponentNgFactory = i0.ɵccf(\"aio-announcement-bar\", i2.AnnouncementBarComponent, View_AnnouncementBarComponent_Host_0, {}, {}, []);\nexport { AnnouncementBarComponentNgFactory as AnnouncementBarComponentNgFactory };\n","\n <div class=\"homepage-container\" *ngIf=\"announcement\">\n <div class=\"announcement-bar\">\n <img [src]=\"announcement.imageUrl\" alt=\"\">\n <p [innerHTML]=\"announcement.message\"></p>\n <a class=\"button\" [href]=\"announcement.linkUrl\">Learn More</a>\n </div>\n </div>","/**\n * @fileoverview This file was generated by the Angular template compiler. Do not edit.\n *\n * @suppress {suspiciousCode,uselessCode,missingProperties,missingOverride,checkTypes}\n * tslint:disable\n */ \nimport * as i0 from \"@angular/core\";\nimport * as i1 from \"./announcement-bar.module\";\nimport * as i2 from \"./announcement-bar.component.ngfactory\";\nimport * as i3 from \"@angular/common\";\nimport * as i4 from \"@angular/common/http\";\nimport * as i5 from \"../../shared/shared.module\";\nvar AnnouncementBarModuleNgFactory = i0.ɵcmf(i1.AnnouncementBarModule, [], function (_l) { return i0.ɵmod([i0.ɵmpd(512, i0.ComponentFactoryResolver, i0.ɵCodegenComponentFactoryResolver, [[8, [i2.AnnouncementBarComponentNgFactory]], [3, i0.ComponentFactoryResolver], i0.NgModuleRef]), i0.ɵmpd(4608, i3.NgLocalization, i3.NgLocaleLocalization, [i0.LOCALE_ID, [2, i3.ɵangular_packages_common_common_a]]), i0.ɵmpd(4608, i4.HttpXsrfTokenExtractor, i4.ɵangular_packages_common_http_http_g, [i3.DOCUMENT, i0.PLATFORM_ID, i4.ɵangular_packages_common_http_http_e]), i0.ɵmpd(4608, i4.ɵangular_packages_common_http_http_h, i4.ɵangular_packages_common_http_http_h, [i4.HttpXsrfTokenExtractor, i4.ɵangular_packages_common_http_http_f]), i0.ɵmpd(5120, i4.HTTP_INTERCEPTORS, function (p0_0) { return [p0_0]; }, [i4.ɵangular_packages_common_http_http_h]), i0.ɵmpd(4608, i4.ɵangular_packages_common_http_http_d, i4.ɵangular_packages_common_http_http_d, []), i0.ɵmpd(6144, i4.XhrFactory, null, [i4.ɵangular_packages_common_http_http_d]), i0.ɵmpd(4608, i4.HttpXhrBackend, i4.HttpXhrBackend, [i4.XhrFactory]), i0.ɵmpd(6144, i4.HttpBackend, null, [i4.HttpXhrBackend]), i0.ɵmpd(4608, i4.HttpHandler, i4.ɵHttpInterceptingHandler, [i4.HttpBackend, i0.Injector]), i0.ɵmpd(4608, i4.HttpClient, i4.HttpClient, [i4.HttpHandler]), i0.ɵmpd(1073742336, i3.CommonModule, i3.CommonModule, []), i0.ɵmpd(1073742336, i5.SharedModule, i5.SharedModule, []), i0.ɵmpd(1073742336, i4.HttpClientXsrfModule, i4.HttpClientXsrfModule, []), i0.ɵmpd(1073742336, i4.HttpClientModule, i4.HttpClientModule, []), i0.ɵmpd(1073742336, i1.AnnouncementBarModule, i1.AnnouncementBarModule, []), i0.ɵmpd(256, i4.ɵangular_packages_common_http_http_e, \"XSRF-TOKEN\", []), i0.ɵmpd(256, i4.ɵangular_packages_common_http_http_f, \"X-XSRF-TOKEN\", [])]); });\nexport { AnnouncementBarModuleNgFactory as AnnouncementBarModuleNgFactory };\n"],"sourceRoot":""}