platform-browser.js 112 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868
  1. /**
  2. * @license Angular v8.1.3
  3. * (c) 2010-2019 Google LLC. https://angular.io/
  4. * License: MIT
  5. */
  6. import { ɵparseCookieValue, PlatformLocation, DOCUMENT, isPlatformServer, CommonModule, ɵPLATFORM_BROWSER_ID } from '@angular/common';
  7. import { ɵglobal, Injectable, Inject, InjectionToken, ApplicationInitStatus, APP_INITIALIZER, Injector, setTestabilityGetter, NgProbeToken, Optional, ApplicationRef, NgZone, getDebugNode, ViewEncapsulation, APP_ID, RendererStyleFlags2, PLATFORM_ID, ɵConsole, SecurityContext, ɵ_sanitizeHtml, ɵ_sanitizeStyle, ɵ_sanitizeUrl, PLATFORM_INITIALIZER, Sanitizer, createPlatformFactory, platformCore, ErrorHandler, ɵAPP_ROOT, RendererFactory2, Testability, NgModule, ApplicationModule, SkipSelf, ɵɵinject, ɵɵdefineInjectable, Version } from '@angular/core';
  8. /**
  9. * @fileoverview added by tsickle
  10. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  11. */
  12. /**
  13. * @license
  14. * Copyright Google Inc. All Rights Reserved.
  15. *
  16. * Use of this source code is governed by an MIT-style license that can be
  17. * found in the LICENSE file at https://angular.io/license
  18. */
  19. /** @type {?} */
  20. let _DOM = (/** @type {?} */ (null));
  21. /**
  22. * @return {?}
  23. */
  24. function getDOM() {
  25. return _DOM;
  26. }
  27. /**
  28. * @param {?} adapter
  29. * @return {?}
  30. */
  31. function setRootDomAdapter(adapter) {
  32. if (!_DOM) {
  33. _DOM = adapter;
  34. }
  35. }
  36. /* tslint:disable:requireParameterType */
  37. /**
  38. * Provides DOM operations in an environment-agnostic way.
  39. *
  40. * \@security Tread carefully! Interacting with the DOM directly is dangerous and
  41. * can introduce XSS risks.
  42. * @abstract
  43. */
  44. class DomAdapter {
  45. constructor() {
  46. this.resourceLoaderType = (/** @type {?} */ (null));
  47. }
  48. /**
  49. * Maps attribute names to their corresponding property names for cases
  50. * where attribute name doesn't match property name.
  51. * @return {?}
  52. */
  53. get attrToPropMap() { return this._attrToPropMap; }
  54. /**
  55. * @param {?} value
  56. * @return {?}
  57. */
  58. set attrToPropMap(value) { this._attrToPropMap = value; }
  59. }
  60. /**
  61. * @fileoverview added by tsickle
  62. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  63. */
  64. /**
  65. * Provides DOM operations in any browser environment.
  66. *
  67. * \@security Tread carefully! Interacting with the DOM directly is dangerous and
  68. * can introduce XSS risks.
  69. * @abstract
  70. */
  71. class GenericBrowserDomAdapter extends DomAdapter {
  72. constructor() {
  73. super();
  74. this._animationPrefix = null;
  75. this._transitionEnd = null;
  76. try {
  77. /** @type {?} */
  78. const element = this.createElement('div', document);
  79. if (this.getStyle(element, 'animationName') != null) {
  80. this._animationPrefix = '';
  81. }
  82. else {
  83. /** @type {?} */
  84. const domPrefixes = ['Webkit', 'Moz', 'O', 'ms'];
  85. for (let i = 0; i < domPrefixes.length; i++) {
  86. if (this.getStyle(element, domPrefixes[i] + 'AnimationName') != null) {
  87. this._animationPrefix = '-' + domPrefixes[i].toLowerCase() + '-';
  88. break;
  89. }
  90. }
  91. }
  92. /** @type {?} */
  93. const transEndEventNames = {
  94. WebkitTransition: 'webkitTransitionEnd',
  95. MozTransition: 'transitionend',
  96. OTransition: 'oTransitionEnd otransitionend',
  97. transition: 'transitionend'
  98. };
  99. Object.keys(transEndEventNames).forEach((/**
  100. * @param {?} key
  101. * @return {?}
  102. */
  103. (key) => {
  104. if (this.getStyle(element, key) != null) {
  105. this._transitionEnd = transEndEventNames[key];
  106. }
  107. }));
  108. }
  109. catch (_a) {
  110. this._animationPrefix = null;
  111. this._transitionEnd = null;
  112. }
  113. }
  114. /**
  115. * @param {?} el
  116. * @return {?}
  117. */
  118. getDistributedNodes(el) { return ((/** @type {?} */ (el))).getDistributedNodes(); }
  119. /**
  120. * @param {?} el
  121. * @param {?} baseUrl
  122. * @param {?} href
  123. * @return {?}
  124. */
  125. resolveAndSetHref(el, baseUrl, href) {
  126. el.href = href == null ? baseUrl : baseUrl + '/../' + href;
  127. }
  128. /**
  129. * @return {?}
  130. */
  131. supportsDOMEvents() { return true; }
  132. /**
  133. * @return {?}
  134. */
  135. supportsNativeShadowDOM() {
  136. return typeof ((/** @type {?} */ (document.body))).createShadowRoot === 'function';
  137. }
  138. /**
  139. * @return {?}
  140. */
  141. getAnimationPrefix() { return this._animationPrefix ? this._animationPrefix : ''; }
  142. /**
  143. * @return {?}
  144. */
  145. getTransitionEnd() { return this._transitionEnd ? this._transitionEnd : ''; }
  146. /**
  147. * @return {?}
  148. */
  149. supportsAnimation() {
  150. return this._animationPrefix != null && this._transitionEnd != null;
  151. }
  152. }
  153. /**
  154. * @fileoverview added by tsickle
  155. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  156. */
  157. /** @type {?} */
  158. const _attrToPropMap = {
  159. 'class': 'className',
  160. 'innerHtml': 'innerHTML',
  161. 'readonly': 'readOnly',
  162. 'tabindex': 'tabIndex',
  163. };
  164. /** @type {?} */
  165. const DOM_KEY_LOCATION_NUMPAD = 3;
  166. // Map to convert some key or keyIdentifier values to what will be returned by getEventKey
  167. /** @type {?} */
  168. const _keyMap = {
  169. // The following values are here for cross-browser compatibility and to match the W3C standard
  170. // cf http://www.w3.org/TR/DOM-Level-3-Events-key/
  171. '\b': 'Backspace',
  172. '\t': 'Tab',
  173. '\x7F': 'Delete',
  174. '\x1B': 'Escape',
  175. 'Del': 'Delete',
  176. 'Esc': 'Escape',
  177. 'Left': 'ArrowLeft',
  178. 'Right': 'ArrowRight',
  179. 'Up': 'ArrowUp',
  180. 'Down': 'ArrowDown',
  181. 'Menu': 'ContextMenu',
  182. 'Scroll': 'ScrollLock',
  183. 'Win': 'OS'
  184. };
  185. // There is a bug in Chrome for numeric keypad keys:
  186. // https://code.google.com/p/chromium/issues/detail?id=155654
  187. // 1, 2, 3 ... are reported as A, B, C ...
  188. /** @type {?} */
  189. const _chromeNumKeyPadMap = {
  190. 'A': '1',
  191. 'B': '2',
  192. 'C': '3',
  193. 'D': '4',
  194. 'E': '5',
  195. 'F': '6',
  196. 'G': '7',
  197. 'H': '8',
  198. 'I': '9',
  199. 'J': '*',
  200. 'K': '+',
  201. 'M': '-',
  202. 'N': '.',
  203. 'O': '/',
  204. '\x60': '0',
  205. '\x90': 'NumLock'
  206. };
  207. const ɵ0 = /**
  208. * @return {?}
  209. */
  210. () => {
  211. if (ɵglobal['Node']) {
  212. return ɵglobal['Node'].prototype.contains || (/**
  213. * @param {?} node
  214. * @return {?}
  215. */
  216. function (node) {
  217. return !!(this.compareDocumentPosition(node) & 16);
  218. });
  219. }
  220. return (/** @type {?} */ (undefined));
  221. };
  222. /** @type {?} */
  223. const nodeContains = ((ɵ0))();
  224. /**
  225. * A `DomAdapter` powered by full browser DOM APIs.
  226. *
  227. * \@security Tread carefully! Interacting with the DOM directly is dangerous and
  228. * can introduce XSS risks.
  229. */
  230. /* tslint:disable:requireParameterType no-console */
  231. class BrowserDomAdapter extends GenericBrowserDomAdapter {
  232. /**
  233. * @param {?} templateHtml
  234. * @return {?}
  235. */
  236. parse(templateHtml) { throw new Error('parse not implemented'); }
  237. /**
  238. * @return {?}
  239. */
  240. static makeCurrent() { setRootDomAdapter(new BrowserDomAdapter()); }
  241. /**
  242. * @param {?} element
  243. * @param {?} name
  244. * @return {?}
  245. */
  246. hasProperty(element, name) { return name in element; }
  247. /**
  248. * @param {?} el
  249. * @param {?} name
  250. * @param {?} value
  251. * @return {?}
  252. */
  253. setProperty(el, name, value) { ((/** @type {?} */ (el)))[name] = value; }
  254. /**
  255. * @param {?} el
  256. * @param {?} name
  257. * @return {?}
  258. */
  259. getProperty(el, name) { return ((/** @type {?} */ (el)))[name]; }
  260. /**
  261. * @param {?} el
  262. * @param {?} methodName
  263. * @param {?} args
  264. * @return {?}
  265. */
  266. invoke(el, methodName, args) { ((/** @type {?} */ (el)))[methodName](...args); }
  267. // TODO(tbosch): move this into a separate environment class once we have it
  268. /**
  269. * @param {?} error
  270. * @return {?}
  271. */
  272. logError(error) {
  273. if (window.console) {
  274. if (console.error) {
  275. console.error(error);
  276. }
  277. else {
  278. console.log(error);
  279. }
  280. }
  281. }
  282. /**
  283. * @param {?} error
  284. * @return {?}
  285. */
  286. log(error) {
  287. if (window.console) {
  288. window.console.log && window.console.log(error);
  289. }
  290. }
  291. /**
  292. * @param {?} error
  293. * @return {?}
  294. */
  295. logGroup(error) {
  296. if (window.console) {
  297. window.console.group && window.console.group(error);
  298. }
  299. }
  300. /**
  301. * @return {?}
  302. */
  303. logGroupEnd() {
  304. if (window.console) {
  305. window.console.groupEnd && window.console.groupEnd();
  306. }
  307. }
  308. /**
  309. * @return {?}
  310. */
  311. get attrToPropMap() { return _attrToPropMap; }
  312. /**
  313. * @param {?} nodeA
  314. * @param {?} nodeB
  315. * @return {?}
  316. */
  317. contains(nodeA, nodeB) { return nodeContains.call(nodeA, nodeB); }
  318. /**
  319. * @param {?} el
  320. * @param {?} selector
  321. * @return {?}
  322. */
  323. querySelector(el, selector) { return el.querySelector(selector); }
  324. /**
  325. * @param {?} el
  326. * @param {?} selector
  327. * @return {?}
  328. */
  329. querySelectorAll(el, selector) { return el.querySelectorAll(selector); }
  330. /**
  331. * @param {?} el
  332. * @param {?} evt
  333. * @param {?} listener
  334. * @return {?}
  335. */
  336. on(el, evt, listener) { el.addEventListener(evt, listener, false); }
  337. /**
  338. * @param {?} el
  339. * @param {?} evt
  340. * @param {?} listener
  341. * @return {?}
  342. */
  343. onAndCancel(el, evt, listener) {
  344. el.addEventListener(evt, listener, false);
  345. // Needed to follow Dart's subscription semantic, until fix of
  346. // https://code.google.com/p/dart/issues/detail?id=17406
  347. return (/**
  348. * @return {?}
  349. */
  350. () => { el.removeEventListener(evt, listener, false); });
  351. }
  352. /**
  353. * @param {?} el
  354. * @param {?} evt
  355. * @return {?}
  356. */
  357. dispatchEvent(el, evt) { el.dispatchEvent(evt); }
  358. /**
  359. * @param {?} eventType
  360. * @return {?}
  361. */
  362. createMouseEvent(eventType) {
  363. /** @type {?} */
  364. const evt = this.getDefaultDocument().createEvent('MouseEvent');
  365. evt.initEvent(eventType, true, true);
  366. return evt;
  367. }
  368. /**
  369. * @param {?} eventType
  370. * @return {?}
  371. */
  372. createEvent(eventType) {
  373. /** @type {?} */
  374. const evt = this.getDefaultDocument().createEvent('Event');
  375. evt.initEvent(eventType, true, true);
  376. return evt;
  377. }
  378. /**
  379. * @param {?} evt
  380. * @return {?}
  381. */
  382. preventDefault(evt) {
  383. evt.preventDefault();
  384. evt.returnValue = false;
  385. }
  386. /**
  387. * @param {?} evt
  388. * @return {?}
  389. */
  390. isPrevented(evt) {
  391. return evt.defaultPrevented || evt.returnValue != null && !evt.returnValue;
  392. }
  393. /**
  394. * @param {?} el
  395. * @return {?}
  396. */
  397. getInnerHTML(el) { return el.innerHTML; }
  398. /**
  399. * @param {?} el
  400. * @return {?}
  401. */
  402. getTemplateContent(el) {
  403. return 'content' in el && this.isTemplateElement(el) ? ((/** @type {?} */ (el))).content : null;
  404. }
  405. /**
  406. * @param {?} el
  407. * @return {?}
  408. */
  409. getOuterHTML(el) { return el.outerHTML; }
  410. /**
  411. * @param {?} node
  412. * @return {?}
  413. */
  414. nodeName(node) { return node.nodeName; }
  415. /**
  416. * @param {?} node
  417. * @return {?}
  418. */
  419. nodeValue(node) { return node.nodeValue; }
  420. /**
  421. * @param {?} node
  422. * @return {?}
  423. */
  424. type(node) { return node.type; }
  425. /**
  426. * @param {?} node
  427. * @return {?}
  428. */
  429. content(node) {
  430. if (this.hasProperty(node, 'content')) {
  431. return ((/** @type {?} */ (node))).content;
  432. }
  433. else {
  434. return node;
  435. }
  436. }
  437. /**
  438. * @param {?} el
  439. * @return {?}
  440. */
  441. firstChild(el) { return el.firstChild; }
  442. /**
  443. * @param {?} el
  444. * @return {?}
  445. */
  446. nextSibling(el) { return el.nextSibling; }
  447. /**
  448. * @param {?} el
  449. * @return {?}
  450. */
  451. parentElement(el) { return el.parentNode; }
  452. /**
  453. * @param {?} el
  454. * @return {?}
  455. */
  456. childNodes(el) { return el.childNodes; }
  457. /**
  458. * @param {?} el
  459. * @return {?}
  460. */
  461. childNodesAsList(el) {
  462. /** @type {?} */
  463. const childNodes = el.childNodes;
  464. /** @type {?} */
  465. const res = new Array(childNodes.length);
  466. for (let i = 0; i < childNodes.length; i++) {
  467. res[i] = childNodes[i];
  468. }
  469. return res;
  470. }
  471. /**
  472. * @param {?} el
  473. * @return {?}
  474. */
  475. clearNodes(el) {
  476. while (el.firstChild) {
  477. el.removeChild(el.firstChild);
  478. }
  479. }
  480. /**
  481. * @param {?} el
  482. * @param {?} node
  483. * @return {?}
  484. */
  485. appendChild(el, node) { el.appendChild(node); }
  486. /**
  487. * @param {?} el
  488. * @param {?} node
  489. * @return {?}
  490. */
  491. removeChild(el, node) { el.removeChild(node); }
  492. /**
  493. * @param {?} el
  494. * @param {?} newChild
  495. * @param {?} oldChild
  496. * @return {?}
  497. */
  498. replaceChild(el, newChild, oldChild) { el.replaceChild(newChild, oldChild); }
  499. /**
  500. * @param {?} node
  501. * @return {?}
  502. */
  503. remove(node) {
  504. if (node.parentNode) {
  505. node.parentNode.removeChild(node);
  506. }
  507. return node;
  508. }
  509. /**
  510. * @param {?} parent
  511. * @param {?} ref
  512. * @param {?} node
  513. * @return {?}
  514. */
  515. insertBefore(parent, ref, node) { parent.insertBefore(node, ref); }
  516. /**
  517. * @param {?} parent
  518. * @param {?} ref
  519. * @param {?} nodes
  520. * @return {?}
  521. */
  522. insertAllBefore(parent, ref, nodes) {
  523. nodes.forEach((/**
  524. * @param {?} n
  525. * @return {?}
  526. */
  527. (n) => parent.insertBefore(n, ref)));
  528. }
  529. /**
  530. * @param {?} parent
  531. * @param {?} ref
  532. * @param {?} node
  533. * @return {?}
  534. */
  535. insertAfter(parent, ref, node) { parent.insertBefore(node, ref.nextSibling); }
  536. /**
  537. * @param {?} el
  538. * @param {?} value
  539. * @return {?}
  540. */
  541. setInnerHTML(el, value) { el.innerHTML = value; }
  542. /**
  543. * @param {?} el
  544. * @return {?}
  545. */
  546. getText(el) { return el.textContent; }
  547. /**
  548. * @param {?} el
  549. * @param {?} value
  550. * @return {?}
  551. */
  552. setText(el, value) { el.textContent = value; }
  553. /**
  554. * @param {?} el
  555. * @return {?}
  556. */
  557. getValue(el) { return el.value; }
  558. /**
  559. * @param {?} el
  560. * @param {?} value
  561. * @return {?}
  562. */
  563. setValue(el, value) { el.value = value; }
  564. /**
  565. * @param {?} el
  566. * @return {?}
  567. */
  568. getChecked(el) { return el.checked; }
  569. /**
  570. * @param {?} el
  571. * @param {?} value
  572. * @return {?}
  573. */
  574. setChecked(el, value) { el.checked = value; }
  575. /**
  576. * @param {?} text
  577. * @return {?}
  578. */
  579. createComment(text) { return this.getDefaultDocument().createComment(text); }
  580. /**
  581. * @param {?} html
  582. * @return {?}
  583. */
  584. createTemplate(html) {
  585. /** @type {?} */
  586. const t = this.getDefaultDocument().createElement('template');
  587. t.innerHTML = html;
  588. return t;
  589. }
  590. /**
  591. * @param {?} tagName
  592. * @param {?=} doc
  593. * @return {?}
  594. */
  595. createElement(tagName, doc) {
  596. doc = doc || this.getDefaultDocument();
  597. return doc.createElement(tagName);
  598. }
  599. /**
  600. * @param {?} ns
  601. * @param {?} tagName
  602. * @param {?=} doc
  603. * @return {?}
  604. */
  605. createElementNS(ns, tagName, doc) {
  606. doc = doc || this.getDefaultDocument();
  607. return doc.createElementNS(ns, tagName);
  608. }
  609. /**
  610. * @param {?} text
  611. * @param {?=} doc
  612. * @return {?}
  613. */
  614. createTextNode(text, doc) {
  615. doc = doc || this.getDefaultDocument();
  616. return doc.createTextNode(text);
  617. }
  618. /**
  619. * @param {?} attrName
  620. * @param {?} attrValue
  621. * @param {?=} doc
  622. * @return {?}
  623. */
  624. createScriptTag(attrName, attrValue, doc) {
  625. doc = doc || this.getDefaultDocument();
  626. /** @type {?} */
  627. const el = (/** @type {?} */ (doc.createElement('SCRIPT')));
  628. el.setAttribute(attrName, attrValue);
  629. return el;
  630. }
  631. /**
  632. * @param {?} css
  633. * @param {?=} doc
  634. * @return {?}
  635. */
  636. createStyleElement(css, doc) {
  637. doc = doc || this.getDefaultDocument();
  638. /** @type {?} */
  639. const style = (/** @type {?} */ (doc.createElement('style')));
  640. this.appendChild(style, this.createTextNode(css, doc));
  641. return style;
  642. }
  643. /**
  644. * @param {?} el
  645. * @return {?}
  646. */
  647. createShadowRoot(el) { return ((/** @type {?} */ (el))).createShadowRoot(); }
  648. /**
  649. * @param {?} el
  650. * @return {?}
  651. */
  652. getShadowRoot(el) { return ((/** @type {?} */ (el))).shadowRoot; }
  653. /**
  654. * @param {?} el
  655. * @return {?}
  656. */
  657. getHost(el) { return ((/** @type {?} */ (el))).host; }
  658. /**
  659. * @param {?} node
  660. * @return {?}
  661. */
  662. clone(node) { return node.cloneNode(true); }
  663. /**
  664. * @param {?} element
  665. * @param {?} name
  666. * @return {?}
  667. */
  668. getElementsByClassName(element, name) {
  669. return element.getElementsByClassName(name);
  670. }
  671. /**
  672. * @param {?} element
  673. * @param {?} name
  674. * @return {?}
  675. */
  676. getElementsByTagName(element, name) {
  677. return element.getElementsByTagName(name);
  678. }
  679. /**
  680. * @param {?} element
  681. * @return {?}
  682. */
  683. classList(element) { return Array.prototype.slice.call(element.classList, 0); }
  684. /**
  685. * @param {?} element
  686. * @param {?} className
  687. * @return {?}
  688. */
  689. addClass(element, className) { element.classList.add(className); }
  690. /**
  691. * @param {?} element
  692. * @param {?} className
  693. * @return {?}
  694. */
  695. removeClass(element, className) { element.classList.remove(className); }
  696. /**
  697. * @param {?} element
  698. * @param {?} className
  699. * @return {?}
  700. */
  701. hasClass(element, className) {
  702. return element.classList.contains(className);
  703. }
  704. /**
  705. * @param {?} element
  706. * @param {?} styleName
  707. * @param {?} styleValue
  708. * @return {?}
  709. */
  710. setStyle(element, styleName, styleValue) {
  711. element.style[styleName] = styleValue;
  712. }
  713. /**
  714. * @param {?} element
  715. * @param {?} stylename
  716. * @return {?}
  717. */
  718. removeStyle(element, stylename) {
  719. // IE requires '' instead of null
  720. // see https://github.com/angular/angular/issues/7916
  721. element.style[stylename] = '';
  722. }
  723. /**
  724. * @param {?} element
  725. * @param {?} stylename
  726. * @return {?}
  727. */
  728. getStyle(element, stylename) { return element.style[stylename]; }
  729. /**
  730. * @param {?} element
  731. * @param {?} styleName
  732. * @param {?=} styleValue
  733. * @return {?}
  734. */
  735. hasStyle(element, styleName, styleValue) {
  736. /** @type {?} */
  737. const value = this.getStyle(element, styleName) || '';
  738. return styleValue ? value == styleValue : value.length > 0;
  739. }
  740. /**
  741. * @param {?} element
  742. * @return {?}
  743. */
  744. tagName(element) { return element.tagName; }
  745. /**
  746. * @param {?} element
  747. * @return {?}
  748. */
  749. attributeMap(element) {
  750. /** @type {?} */
  751. const res = new Map();
  752. /** @type {?} */
  753. const elAttrs = element.attributes;
  754. for (let i = 0; i < elAttrs.length; i++) {
  755. /** @type {?} */
  756. const attrib = elAttrs.item(i);
  757. res.set(attrib.name, attrib.value);
  758. }
  759. return res;
  760. }
  761. /**
  762. * @param {?} element
  763. * @param {?} attribute
  764. * @return {?}
  765. */
  766. hasAttribute(element, attribute) {
  767. return element.hasAttribute(attribute);
  768. }
  769. /**
  770. * @param {?} element
  771. * @param {?} ns
  772. * @param {?} attribute
  773. * @return {?}
  774. */
  775. hasAttributeNS(element, ns, attribute) {
  776. return element.hasAttributeNS(ns, attribute);
  777. }
  778. /**
  779. * @param {?} element
  780. * @param {?} attribute
  781. * @return {?}
  782. */
  783. getAttribute(element, attribute) {
  784. return element.getAttribute(attribute);
  785. }
  786. /**
  787. * @param {?} element
  788. * @param {?} ns
  789. * @param {?} name
  790. * @return {?}
  791. */
  792. getAttributeNS(element, ns, name) {
  793. return element.getAttributeNS(ns, name);
  794. }
  795. /**
  796. * @param {?} element
  797. * @param {?} name
  798. * @param {?} value
  799. * @return {?}
  800. */
  801. setAttribute(element, name, value) { element.setAttribute(name, value); }
  802. /**
  803. * @param {?} element
  804. * @param {?} ns
  805. * @param {?} name
  806. * @param {?} value
  807. * @return {?}
  808. */
  809. setAttributeNS(element, ns, name, value) {
  810. element.setAttributeNS(ns, name, value);
  811. }
  812. /**
  813. * @param {?} element
  814. * @param {?} attribute
  815. * @return {?}
  816. */
  817. removeAttribute(element, attribute) { element.removeAttribute(attribute); }
  818. /**
  819. * @param {?} element
  820. * @param {?} ns
  821. * @param {?} name
  822. * @return {?}
  823. */
  824. removeAttributeNS(element, ns, name) {
  825. element.removeAttributeNS(ns, name);
  826. }
  827. /**
  828. * @param {?} el
  829. * @return {?}
  830. */
  831. templateAwareRoot(el) { return this.isTemplateElement(el) ? this.content(el) : el; }
  832. /**
  833. * @return {?}
  834. */
  835. createHtmlDocument() {
  836. return document.implementation.createHTMLDocument('fakeTitle');
  837. }
  838. /**
  839. * @return {?}
  840. */
  841. getDefaultDocument() { return document; }
  842. /**
  843. * @param {?} el
  844. * @return {?}
  845. */
  846. getBoundingClientRect(el) {
  847. try {
  848. return el.getBoundingClientRect();
  849. }
  850. catch (_a) {
  851. return { top: 0, bottom: 0, left: 0, right: 0, width: 0, height: 0 };
  852. }
  853. }
  854. /**
  855. * @param {?} doc
  856. * @return {?}
  857. */
  858. getTitle(doc) { return doc.title; }
  859. /**
  860. * @param {?} doc
  861. * @param {?} newTitle
  862. * @return {?}
  863. */
  864. setTitle(doc, newTitle) { doc.title = newTitle || ''; }
  865. /**
  866. * @param {?} n
  867. * @param {?} selector
  868. * @return {?}
  869. */
  870. elementMatches(n, selector) {
  871. if (this.isElementNode(n)) {
  872. return n.matches && n.matches(selector) ||
  873. n.msMatchesSelector && n.msMatchesSelector(selector) ||
  874. n.webkitMatchesSelector && n.webkitMatchesSelector(selector);
  875. }
  876. return false;
  877. }
  878. /**
  879. * @param {?} el
  880. * @return {?}
  881. */
  882. isTemplateElement(el) {
  883. return this.isElementNode(el) && el.nodeName === 'TEMPLATE';
  884. }
  885. /**
  886. * @param {?} node
  887. * @return {?}
  888. */
  889. isTextNode(node) { return node.nodeType === Node.TEXT_NODE; }
  890. /**
  891. * @param {?} node
  892. * @return {?}
  893. */
  894. isCommentNode(node) { return node.nodeType === Node.COMMENT_NODE; }
  895. /**
  896. * @param {?} node
  897. * @return {?}
  898. */
  899. isElementNode(node) { return node.nodeType === Node.ELEMENT_NODE; }
  900. /**
  901. * @param {?} node
  902. * @return {?}
  903. */
  904. hasShadowRoot(node) {
  905. return node.shadowRoot != null && node instanceof HTMLElement;
  906. }
  907. /**
  908. * @param {?} node
  909. * @return {?}
  910. */
  911. isShadowRoot(node) { return node instanceof DocumentFragment; }
  912. /**
  913. * @param {?} node
  914. * @return {?}
  915. */
  916. importIntoDoc(node) { return document.importNode(this.templateAwareRoot(node), true); }
  917. /**
  918. * @param {?} node
  919. * @return {?}
  920. */
  921. adoptNode(node) { return document.adoptNode(node); }
  922. /**
  923. * @param {?} el
  924. * @return {?}
  925. */
  926. getHref(el) { return (/** @type {?} */ (el.getAttribute('href'))); }
  927. /**
  928. * @param {?} event
  929. * @return {?}
  930. */
  931. getEventKey(event) {
  932. /** @type {?} */
  933. let key = event.key;
  934. if (key == null) {
  935. key = event.keyIdentifier;
  936. // keyIdentifier is defined in the old draft of DOM Level 3 Events implemented by Chrome and
  937. // Safari cf
  938. // http://www.w3.org/TR/2007/WD-DOM-Level-3-Events-20071221/events.html#Events-KeyboardEvents-Interfaces
  939. if (key == null) {
  940. return 'Unidentified';
  941. }
  942. if (key.startsWith('U+')) {
  943. key = String.fromCharCode(parseInt(key.substring(2), 16));
  944. if (event.location === DOM_KEY_LOCATION_NUMPAD && _chromeNumKeyPadMap.hasOwnProperty(key)) {
  945. // There is a bug in Chrome for numeric keypad keys:
  946. // https://code.google.com/p/chromium/issues/detail?id=155654
  947. // 1, 2, 3 ... are reported as A, B, C ...
  948. key = ((/** @type {?} */ (_chromeNumKeyPadMap)))[key];
  949. }
  950. }
  951. }
  952. return _keyMap[key] || key;
  953. }
  954. /**
  955. * @param {?} doc
  956. * @param {?} target
  957. * @return {?}
  958. */
  959. getGlobalEventTarget(doc, target) {
  960. if (target === 'window') {
  961. return window;
  962. }
  963. if (target === 'document') {
  964. return doc;
  965. }
  966. if (target === 'body') {
  967. return doc.body;
  968. }
  969. return null;
  970. }
  971. /**
  972. * @return {?}
  973. */
  974. getHistory() { return window.history; }
  975. /**
  976. * @return {?}
  977. */
  978. getLocation() { return window.location; }
  979. /**
  980. * @param {?} doc
  981. * @return {?}
  982. */
  983. getBaseHref(doc) {
  984. /** @type {?} */
  985. const href = getBaseElementHref();
  986. return href == null ? null : relativePath(href);
  987. }
  988. /**
  989. * @return {?}
  990. */
  991. resetBaseElement() { baseElement = null; }
  992. /**
  993. * @return {?}
  994. */
  995. getUserAgent() { return window.navigator.userAgent; }
  996. /**
  997. * @param {?} element
  998. * @param {?} name
  999. * @param {?} value
  1000. * @return {?}
  1001. */
  1002. setData(element, name, value) {
  1003. this.setAttribute(element, 'data-' + name, value);
  1004. }
  1005. /**
  1006. * @param {?} element
  1007. * @param {?} name
  1008. * @return {?}
  1009. */
  1010. getData(element, name) {
  1011. return this.getAttribute(element, 'data-' + name);
  1012. }
  1013. /**
  1014. * @param {?} element
  1015. * @return {?}
  1016. */
  1017. getComputedStyle(element) { return getComputedStyle(element); }
  1018. // TODO(tbosch): move this into a separate environment class once we have it
  1019. /**
  1020. * @return {?}
  1021. */
  1022. supportsWebAnimation() {
  1023. return typeof ((/** @type {?} */ (Element))).prototype['animate'] === 'function';
  1024. }
  1025. /**
  1026. * @return {?}
  1027. */
  1028. performanceNow() {
  1029. // performance.now() is not available in all browsers, see
  1030. // http://caniuse.com/#search=performance.now
  1031. return window.performance && window.performance.now ? window.performance.now() :
  1032. new Date().getTime();
  1033. }
  1034. /**
  1035. * @return {?}
  1036. */
  1037. supportsCookies() { return true; }
  1038. /**
  1039. * @param {?} name
  1040. * @return {?}
  1041. */
  1042. getCookie(name) { return ɵparseCookieValue(document.cookie, name); }
  1043. /**
  1044. * @param {?} name
  1045. * @param {?} value
  1046. * @return {?}
  1047. */
  1048. setCookie(name, value) {
  1049. // document.cookie is magical, assigning into it assigns/overrides one cookie value, but does
  1050. // not clear other cookies.
  1051. document.cookie = encodeURIComponent(name) + '=' + encodeURIComponent(value);
  1052. }
  1053. }
  1054. /** @type {?} */
  1055. let baseElement = null;
  1056. /**
  1057. * @return {?}
  1058. */
  1059. function getBaseElementHref() {
  1060. if (!baseElement) {
  1061. baseElement = (/** @type {?} */ (document.querySelector('base')));
  1062. if (!baseElement) {
  1063. return null;
  1064. }
  1065. }
  1066. return baseElement.getAttribute('href');
  1067. }
  1068. // based on urlUtils.js in AngularJS 1
  1069. /** @type {?} */
  1070. let urlParsingNode;
  1071. /**
  1072. * @param {?} url
  1073. * @return {?}
  1074. */
  1075. function relativePath(url) {
  1076. if (!urlParsingNode) {
  1077. urlParsingNode = document.createElement('a');
  1078. }
  1079. urlParsingNode.setAttribute('href', url);
  1080. return (urlParsingNode.pathname.charAt(0) === '/') ? urlParsingNode.pathname :
  1081. '/' + urlParsingNode.pathname;
  1082. }
  1083. /**
  1084. * @fileoverview added by tsickle
  1085. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  1086. */
  1087. /**
  1088. * @license
  1089. * Copyright Google Inc. All Rights Reserved.
  1090. *
  1091. * Use of this source code is governed by an MIT-style license that can be
  1092. * found in the LICENSE file at https://angular.io/license
  1093. */
  1094. /**
  1095. * @return {?}
  1096. */
  1097. function supportsState() {
  1098. return !!window.history.pushState;
  1099. }
  1100. /**
  1101. * @fileoverview added by tsickle
  1102. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  1103. */
  1104. /**
  1105. * `PlatformLocation` encapsulates all of the direct calls to platform APIs.
  1106. * This class should not be used directly by an application developer. Instead, use
  1107. * {\@link Location}.
  1108. */
  1109. class BrowserPlatformLocation extends PlatformLocation {
  1110. /**
  1111. * @param {?} _doc
  1112. */
  1113. constructor(_doc) {
  1114. super();
  1115. this._doc = _doc;
  1116. this._init();
  1117. }
  1118. // This is moved to its own method so that `MockPlatformLocationStrategy` can overwrite it
  1119. /**
  1120. * \@internal
  1121. * @return {?}
  1122. */
  1123. _init() {
  1124. ((/** @type {?} */ (this))).location = getDOM().getLocation();
  1125. this._history = getDOM().getHistory();
  1126. }
  1127. /**
  1128. * @return {?}
  1129. */
  1130. getBaseHrefFromDOM() { return (/** @type {?} */ (getDOM().getBaseHref(this._doc))); }
  1131. /**
  1132. * @param {?} fn
  1133. * @return {?}
  1134. */
  1135. onPopState(fn) {
  1136. getDOM().getGlobalEventTarget(this._doc, 'window').addEventListener('popstate', fn, false);
  1137. }
  1138. /**
  1139. * @param {?} fn
  1140. * @return {?}
  1141. */
  1142. onHashChange(fn) {
  1143. getDOM().getGlobalEventTarget(this._doc, 'window').addEventListener('hashchange', fn, false);
  1144. }
  1145. /**
  1146. * @return {?}
  1147. */
  1148. get href() { return this.location.href; }
  1149. /**
  1150. * @return {?}
  1151. */
  1152. get protocol() { return this.location.protocol; }
  1153. /**
  1154. * @return {?}
  1155. */
  1156. get hostname() { return this.location.hostname; }
  1157. /**
  1158. * @return {?}
  1159. */
  1160. get port() { return this.location.port; }
  1161. /**
  1162. * @return {?}
  1163. */
  1164. get pathname() { return this.location.pathname; }
  1165. /**
  1166. * @return {?}
  1167. */
  1168. get search() { return this.location.search; }
  1169. /**
  1170. * @return {?}
  1171. */
  1172. get hash() { return this.location.hash; }
  1173. /**
  1174. * @param {?} newPath
  1175. * @return {?}
  1176. */
  1177. set pathname(newPath) { this.location.pathname = newPath; }
  1178. /**
  1179. * @param {?} state
  1180. * @param {?} title
  1181. * @param {?} url
  1182. * @return {?}
  1183. */
  1184. pushState(state, title, url) {
  1185. if (supportsState()) {
  1186. this._history.pushState(state, title, url);
  1187. }
  1188. else {
  1189. this.location.hash = url;
  1190. }
  1191. }
  1192. /**
  1193. * @param {?} state
  1194. * @param {?} title
  1195. * @param {?} url
  1196. * @return {?}
  1197. */
  1198. replaceState(state, title, url) {
  1199. if (supportsState()) {
  1200. this._history.replaceState(state, title, url);
  1201. }
  1202. else {
  1203. this.location.hash = url;
  1204. }
  1205. }
  1206. /**
  1207. * @return {?}
  1208. */
  1209. forward() { this._history.forward(); }
  1210. /**
  1211. * @return {?}
  1212. */
  1213. back() { this._history.back(); }
  1214. /**
  1215. * @return {?}
  1216. */
  1217. getState() { return this._history.state; }
  1218. }
  1219. BrowserPlatformLocation.decorators = [
  1220. { type: Injectable }
  1221. ];
  1222. /** @nocollapse */
  1223. BrowserPlatformLocation.ctorParameters = () => [
  1224. { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
  1225. ];
  1226. /**
  1227. * @fileoverview added by tsickle
  1228. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  1229. */
  1230. /**
  1231. * An id that identifies a particular application being bootstrapped, that should
  1232. * match across the client/server boundary.
  1233. * @type {?}
  1234. */
  1235. const TRANSITION_ID = new InjectionToken('TRANSITION_ID');
  1236. /**
  1237. * @param {?} transitionId
  1238. * @param {?} document
  1239. * @param {?} injector
  1240. * @return {?}
  1241. */
  1242. function appInitializerFactory(transitionId, document, injector) {
  1243. return (/**
  1244. * @return {?}
  1245. */
  1246. () => {
  1247. // Wait for all application initializers to be completed before removing the styles set by
  1248. // the server.
  1249. injector.get(ApplicationInitStatus).donePromise.then((/**
  1250. * @return {?}
  1251. */
  1252. () => {
  1253. /** @type {?} */
  1254. const dom = getDOM();
  1255. /** @type {?} */
  1256. const styles = Array.prototype.slice.apply(dom.querySelectorAll(document, `style[ng-transition]`));
  1257. styles.filter((/**
  1258. * @param {?} el
  1259. * @return {?}
  1260. */
  1261. el => dom.getAttribute(el, 'ng-transition') === transitionId))
  1262. .forEach((/**
  1263. * @param {?} el
  1264. * @return {?}
  1265. */
  1266. el => dom.remove(el)));
  1267. }));
  1268. });
  1269. }
  1270. /** @type {?} */
  1271. const SERVER_TRANSITION_PROVIDERS = [
  1272. {
  1273. provide: APP_INITIALIZER,
  1274. useFactory: appInitializerFactory,
  1275. deps: [TRANSITION_ID, DOCUMENT, Injector],
  1276. multi: true
  1277. },
  1278. ];
  1279. /**
  1280. * @fileoverview added by tsickle
  1281. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  1282. */
  1283. class BrowserGetTestability {
  1284. /**
  1285. * @return {?}
  1286. */
  1287. static init() { setTestabilityGetter(new BrowserGetTestability()); }
  1288. /**
  1289. * @param {?} registry
  1290. * @return {?}
  1291. */
  1292. addToWindow(registry) {
  1293. ɵglobal['getAngularTestability'] = (/**
  1294. * @param {?} elem
  1295. * @param {?=} findInAncestors
  1296. * @return {?}
  1297. */
  1298. (elem, findInAncestors = true) => {
  1299. /** @type {?} */
  1300. const testability = registry.findTestabilityInTree(elem, findInAncestors);
  1301. if (testability == null) {
  1302. throw new Error('Could not find testability for element.');
  1303. }
  1304. return testability;
  1305. });
  1306. ɵglobal['getAllAngularTestabilities'] = (/**
  1307. * @return {?}
  1308. */
  1309. () => registry.getAllTestabilities());
  1310. ɵglobal['getAllAngularRootElements'] = (/**
  1311. * @return {?}
  1312. */
  1313. () => registry.getAllRootElements());
  1314. /** @type {?} */
  1315. const whenAllStable = (/**
  1316. * @param {?} callback
  1317. * @return {?}
  1318. */
  1319. (callback /** TODO #9100 */) => {
  1320. /** @type {?} */
  1321. const testabilities = ɵglobal['getAllAngularTestabilities']();
  1322. /** @type {?} */
  1323. let count = testabilities.length;
  1324. /** @type {?} */
  1325. let didWork = false;
  1326. /** @type {?} */
  1327. const decrement = (/**
  1328. * @param {?} didWork_
  1329. * @return {?}
  1330. */
  1331. function (didWork_ /** TODO #9100 */) {
  1332. didWork = didWork || didWork_;
  1333. count--;
  1334. if (count == 0) {
  1335. callback(didWork);
  1336. }
  1337. });
  1338. testabilities.forEach((/**
  1339. * @param {?} testability
  1340. * @return {?}
  1341. */
  1342. function (testability /** TODO #9100 */) {
  1343. testability.whenStable(decrement);
  1344. }));
  1345. });
  1346. if (!ɵglobal['frameworkStabilizers']) {
  1347. ɵglobal['frameworkStabilizers'] = [];
  1348. }
  1349. ɵglobal['frameworkStabilizers'].push(whenAllStable);
  1350. }
  1351. /**
  1352. * @param {?} registry
  1353. * @param {?} elem
  1354. * @param {?} findInAncestors
  1355. * @return {?}
  1356. */
  1357. findTestabilityInTree(registry, elem, findInAncestors) {
  1358. if (elem == null) {
  1359. return null;
  1360. }
  1361. /** @type {?} */
  1362. const t = registry.getTestability(elem);
  1363. if (t != null) {
  1364. return t;
  1365. }
  1366. else if (!findInAncestors) {
  1367. return null;
  1368. }
  1369. if (getDOM().isShadowRoot(elem)) {
  1370. return this.findTestabilityInTree(registry, getDOM().getHost(elem), true);
  1371. }
  1372. return this.findTestabilityInTree(registry, getDOM().parentElement(elem), true);
  1373. }
  1374. }
  1375. /**
  1376. * @fileoverview added by tsickle
  1377. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  1378. */
  1379. /**
  1380. * Exports the value under a given `name` in the global property `ng`. For example `ng.probe` if
  1381. * `name` is `'probe'`.
  1382. * @param {?} name Name under which it will be exported. Keep in mind this will be a property of the
  1383. * global `ng` object.
  1384. * @param {?} value The value to export.
  1385. * @return {?}
  1386. */
  1387. function exportNgVar(name, value) {
  1388. if (typeof COMPILED === 'undefined' || !COMPILED) {
  1389. // Note: we can't export `ng` when using closure enhanced optimization as:
  1390. // - closure declares globals itself for minified names, which sometimes clobber our `ng` global
  1391. // - we can't declare a closure extern as the namespace `ng` is already used within Google
  1392. // for typings for angularJS (via `goog.provide('ng....')`).
  1393. /** @type {?} */
  1394. const ng = ɵglobal['ng'] = ((/** @type {?} */ (ɵglobal['ng']))) || {};
  1395. ng[name] = value;
  1396. }
  1397. }
  1398. /**
  1399. * @fileoverview added by tsickle
  1400. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  1401. */
  1402. const ɵ0$1 = /**
  1403. * @return {?}
  1404. */
  1405. () => ({
  1406. 'ApplicationRef': ApplicationRef,
  1407. 'NgZone': NgZone,
  1408. });
  1409. /** @type {?} */
  1410. const CORE_TOKENS = ((ɵ0$1))();
  1411. /** @type {?} */
  1412. const INSPECT_GLOBAL_NAME = 'probe';
  1413. /** @type {?} */
  1414. const CORE_TOKENS_GLOBAL_NAME = 'coreTokens';
  1415. /**
  1416. * Returns a {\@link DebugElement} for the given native DOM element, or
  1417. * null if the given native element does not have an Angular view associated
  1418. * with it.
  1419. * @param {?} element
  1420. * @return {?}
  1421. */
  1422. function inspectNativeElement(element) {
  1423. return getDebugNode(element);
  1424. }
  1425. /**
  1426. * @param {?} coreTokens
  1427. * @return {?}
  1428. */
  1429. function _createNgProbe(coreTokens) {
  1430. exportNgVar(INSPECT_GLOBAL_NAME, inspectNativeElement);
  1431. exportNgVar(CORE_TOKENS_GLOBAL_NAME, Object.assign({}, CORE_TOKENS, _ngProbeTokensToMap(coreTokens || [])));
  1432. return (/**
  1433. * @return {?}
  1434. */
  1435. () => inspectNativeElement);
  1436. }
  1437. /**
  1438. * @param {?} tokens
  1439. * @return {?}
  1440. */
  1441. function _ngProbeTokensToMap(tokens) {
  1442. return tokens.reduce((/**
  1443. * @param {?} prev
  1444. * @param {?} t
  1445. * @return {?}
  1446. */
  1447. (prev, t) => (prev[t.name] = t.token, prev)), {});
  1448. }
  1449. /**
  1450. * In Ivy, we don't support NgProbe because we have our own set of testing utilities
  1451. * with more robust functionality.
  1452. *
  1453. * We shouldn't bring in NgProbe because it prevents DebugNode and friends from
  1454. * tree-shaking properly.
  1455. * @type {?}
  1456. */
  1457. const ELEMENT_PROBE_PROVIDERS__POST_R3__ = [];
  1458. /**
  1459. * Providers which support debugging Angular applications (e.g. via `ng.probe`).
  1460. * @type {?}
  1461. */
  1462. const ELEMENT_PROBE_PROVIDERS__PRE_R3__ = [
  1463. {
  1464. provide: APP_INITIALIZER,
  1465. useFactory: _createNgProbe,
  1466. deps: [
  1467. [NgProbeToken, new Optional()],
  1468. ],
  1469. multi: true,
  1470. },
  1471. ];
  1472. /** @type {?} */
  1473. const ELEMENT_PROBE_PROVIDERS = ELEMENT_PROBE_PROVIDERS__PRE_R3__;
  1474. /**
  1475. * @fileoverview added by tsickle
  1476. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  1477. */
  1478. /**
  1479. * The injection token for the event-manager plug-in service.
  1480. *
  1481. * \@publicApi
  1482. * @type {?}
  1483. */
  1484. const EVENT_MANAGER_PLUGINS = new InjectionToken('EventManagerPlugins');
  1485. /**
  1486. * An injectable service that provides event management for Angular
  1487. * through a browser plug-in.
  1488. *
  1489. * \@publicApi
  1490. */
  1491. class EventManager {
  1492. /**
  1493. * Initializes an instance of the event-manager service.
  1494. * @param {?} plugins
  1495. * @param {?} _zone
  1496. */
  1497. constructor(plugins, _zone) {
  1498. this._zone = _zone;
  1499. this._eventNameToPlugin = new Map();
  1500. plugins.forEach((/**
  1501. * @template THIS
  1502. * @this {THIS}
  1503. * @param {?} p
  1504. * @return {THIS}
  1505. */
  1506. p => p.manager = this));
  1507. this._plugins = plugins.slice().reverse();
  1508. }
  1509. /**
  1510. * Registers a handler for a specific element and event.
  1511. *
  1512. * @param {?} element The HTML element to receive event notifications.
  1513. * @param {?} eventName The name of the event to listen for.
  1514. * @param {?} handler A function to call when the notification occurs. Receives the
  1515. * event object as an argument.
  1516. * @return {?} A callback function that can be used to remove the handler.
  1517. */
  1518. addEventListener(element, eventName, handler) {
  1519. /** @type {?} */
  1520. const plugin = this._findPluginFor(eventName);
  1521. return plugin.addEventListener(element, eventName, handler);
  1522. }
  1523. /**
  1524. * Registers a global handler for an event in a target view.
  1525. *
  1526. * @param {?} target A target for global event notifications. One of "window", "document", or "body".
  1527. * @param {?} eventName The name of the event to listen for.
  1528. * @param {?} handler A function to call when the notification occurs. Receives the
  1529. * event object as an argument.
  1530. * @return {?} A callback function that can be used to remove the handler.
  1531. */
  1532. addGlobalEventListener(target, eventName, handler) {
  1533. /** @type {?} */
  1534. const plugin = this._findPluginFor(eventName);
  1535. return plugin.addGlobalEventListener(target, eventName, handler);
  1536. }
  1537. /**
  1538. * Retrieves the compilation zone in which event listeners are registered.
  1539. * @return {?}
  1540. */
  1541. getZone() { return this._zone; }
  1542. /**
  1543. * \@internal
  1544. * @param {?} eventName
  1545. * @return {?}
  1546. */
  1547. _findPluginFor(eventName) {
  1548. /** @type {?} */
  1549. const plugin = this._eventNameToPlugin.get(eventName);
  1550. if (plugin) {
  1551. return plugin;
  1552. }
  1553. /** @type {?} */
  1554. const plugins = this._plugins;
  1555. for (let i = 0; i < plugins.length; i++) {
  1556. /** @type {?} */
  1557. const plugin = plugins[i];
  1558. if (plugin.supports(eventName)) {
  1559. this._eventNameToPlugin.set(eventName, plugin);
  1560. return plugin;
  1561. }
  1562. }
  1563. throw new Error(`No event manager plugin found for event ${eventName}`);
  1564. }
  1565. }
  1566. EventManager.decorators = [
  1567. { type: Injectable }
  1568. ];
  1569. /** @nocollapse */
  1570. EventManager.ctorParameters = () => [
  1571. { type: Array, decorators: [{ type: Inject, args: [EVENT_MANAGER_PLUGINS,] }] },
  1572. { type: NgZone }
  1573. ];
  1574. /**
  1575. * @abstract
  1576. */
  1577. class EventManagerPlugin {
  1578. /**
  1579. * @param {?} _doc
  1580. */
  1581. constructor(_doc) {
  1582. this._doc = _doc;
  1583. }
  1584. /**
  1585. * @param {?} element
  1586. * @param {?} eventName
  1587. * @param {?} handler
  1588. * @return {?}
  1589. */
  1590. addGlobalEventListener(element, eventName, handler) {
  1591. /** @type {?} */
  1592. const target = getDOM().getGlobalEventTarget(this._doc, element);
  1593. if (!target) {
  1594. throw new Error(`Unsupported event target ${target} for event ${eventName}`);
  1595. }
  1596. return this.addEventListener(target, eventName, handler);
  1597. }
  1598. }
  1599. /**
  1600. * @fileoverview added by tsickle
  1601. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  1602. */
  1603. class SharedStylesHost {
  1604. constructor() {
  1605. /**
  1606. * \@internal
  1607. */
  1608. this._stylesSet = new Set();
  1609. }
  1610. /**
  1611. * @param {?} styles
  1612. * @return {?}
  1613. */
  1614. addStyles(styles) {
  1615. /** @type {?} */
  1616. const additions = new Set();
  1617. styles.forEach((/**
  1618. * @param {?} style
  1619. * @return {?}
  1620. */
  1621. style => {
  1622. if (!this._stylesSet.has(style)) {
  1623. this._stylesSet.add(style);
  1624. additions.add(style);
  1625. }
  1626. }));
  1627. this.onStylesAdded(additions);
  1628. }
  1629. /**
  1630. * @param {?} additions
  1631. * @return {?}
  1632. */
  1633. onStylesAdded(additions) { }
  1634. /**
  1635. * @return {?}
  1636. */
  1637. getAllStyles() { return Array.from(this._stylesSet); }
  1638. }
  1639. SharedStylesHost.decorators = [
  1640. { type: Injectable }
  1641. ];
  1642. class DomSharedStylesHost extends SharedStylesHost {
  1643. /**
  1644. * @param {?} _doc
  1645. */
  1646. constructor(_doc) {
  1647. super();
  1648. this._doc = _doc;
  1649. this._hostNodes = new Set();
  1650. this._styleNodes = new Set();
  1651. this._hostNodes.add(_doc.head);
  1652. }
  1653. /**
  1654. * @private
  1655. * @param {?} styles
  1656. * @param {?} host
  1657. * @return {?}
  1658. */
  1659. _addStylesToHost(styles, host) {
  1660. styles.forEach((/**
  1661. * @param {?} style
  1662. * @return {?}
  1663. */
  1664. (style) => {
  1665. /** @type {?} */
  1666. const styleEl = this._doc.createElement('style');
  1667. styleEl.textContent = style;
  1668. this._styleNodes.add(host.appendChild(styleEl));
  1669. }));
  1670. }
  1671. /**
  1672. * @param {?} hostNode
  1673. * @return {?}
  1674. */
  1675. addHost(hostNode) {
  1676. this._addStylesToHost(this._stylesSet, hostNode);
  1677. this._hostNodes.add(hostNode);
  1678. }
  1679. /**
  1680. * @param {?} hostNode
  1681. * @return {?}
  1682. */
  1683. removeHost(hostNode) { this._hostNodes.delete(hostNode); }
  1684. /**
  1685. * @param {?} additions
  1686. * @return {?}
  1687. */
  1688. onStylesAdded(additions) {
  1689. this._hostNodes.forEach((/**
  1690. * @param {?} hostNode
  1691. * @return {?}
  1692. */
  1693. hostNode => this._addStylesToHost(additions, hostNode)));
  1694. }
  1695. /**
  1696. * @return {?}
  1697. */
  1698. ngOnDestroy() { this._styleNodes.forEach((/**
  1699. * @param {?} styleNode
  1700. * @return {?}
  1701. */
  1702. styleNode => getDOM().remove(styleNode))); }
  1703. }
  1704. DomSharedStylesHost.decorators = [
  1705. { type: Injectable }
  1706. ];
  1707. /** @nocollapse */
  1708. DomSharedStylesHost.ctorParameters = () => [
  1709. { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
  1710. ];
  1711. /**
  1712. * @fileoverview added by tsickle
  1713. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  1714. */
  1715. /** @type {?} */
  1716. const NAMESPACE_URIS = {
  1717. 'svg': 'http://www.w3.org/2000/svg',
  1718. 'xhtml': 'http://www.w3.org/1999/xhtml',
  1719. 'xlink': 'http://www.w3.org/1999/xlink',
  1720. 'xml': 'http://www.w3.org/XML/1998/namespace',
  1721. 'xmlns': 'http://www.w3.org/2000/xmlns/',
  1722. };
  1723. /** @type {?} */
  1724. const COMPONENT_REGEX = /%COMP%/g;
  1725. /** @type {?} */
  1726. const COMPONENT_VARIABLE = '%COMP%';
  1727. /** @type {?} */
  1728. const HOST_ATTR = `_nghost-${COMPONENT_VARIABLE}`;
  1729. /** @type {?} */
  1730. const CONTENT_ATTR = `_ngcontent-${COMPONENT_VARIABLE}`;
  1731. /**
  1732. * @param {?} componentShortId
  1733. * @return {?}
  1734. */
  1735. function shimContentAttribute(componentShortId) {
  1736. return CONTENT_ATTR.replace(COMPONENT_REGEX, componentShortId);
  1737. }
  1738. /**
  1739. * @param {?} componentShortId
  1740. * @return {?}
  1741. */
  1742. function shimHostAttribute(componentShortId) {
  1743. return HOST_ATTR.replace(COMPONENT_REGEX, componentShortId);
  1744. }
  1745. /**
  1746. * @param {?} compId
  1747. * @param {?} styles
  1748. * @param {?} target
  1749. * @return {?}
  1750. */
  1751. function flattenStyles(compId, styles, target) {
  1752. for (let i = 0; i < styles.length; i++) {
  1753. /** @type {?} */
  1754. let style = styles[i];
  1755. if (Array.isArray(style)) {
  1756. flattenStyles(compId, style, target);
  1757. }
  1758. else {
  1759. style = style.replace(COMPONENT_REGEX, compId);
  1760. target.push(style);
  1761. }
  1762. }
  1763. return target;
  1764. }
  1765. /**
  1766. * @param {?} eventHandler
  1767. * @return {?}
  1768. */
  1769. function decoratePreventDefault(eventHandler) {
  1770. return (/**
  1771. * @param {?} event
  1772. * @return {?}
  1773. */
  1774. (event) => {
  1775. /** @type {?} */
  1776. const allowDefaultBehavior = eventHandler(event);
  1777. if (allowDefaultBehavior === false) {
  1778. // TODO(tbosch): move preventDefault into event plugins...
  1779. event.preventDefault();
  1780. event.returnValue = false;
  1781. }
  1782. });
  1783. }
  1784. class DomRendererFactory2 {
  1785. /**
  1786. * @param {?} eventManager
  1787. * @param {?} sharedStylesHost
  1788. * @param {?} appId
  1789. */
  1790. constructor(eventManager, sharedStylesHost, appId) {
  1791. this.eventManager = eventManager;
  1792. this.sharedStylesHost = sharedStylesHost;
  1793. this.appId = appId;
  1794. this.rendererByCompId = new Map();
  1795. this.defaultRenderer = new DefaultDomRenderer2(eventManager);
  1796. }
  1797. /**
  1798. * @param {?} element
  1799. * @param {?} type
  1800. * @return {?}
  1801. */
  1802. createRenderer(element, type) {
  1803. if (!element || !type) {
  1804. return this.defaultRenderer;
  1805. }
  1806. switch (type.encapsulation) {
  1807. case ViewEncapsulation.Emulated: {
  1808. /** @type {?} */
  1809. let renderer = this.rendererByCompId.get(type.id);
  1810. if (!renderer) {
  1811. renderer = new EmulatedEncapsulationDomRenderer2(this.eventManager, this.sharedStylesHost, type, this.appId);
  1812. this.rendererByCompId.set(type.id, renderer);
  1813. }
  1814. ((/** @type {?} */ (renderer))).applyToHost(element);
  1815. return renderer;
  1816. }
  1817. case ViewEncapsulation.Native:
  1818. case ViewEncapsulation.ShadowDom:
  1819. return new ShadowDomRenderer(this.eventManager, this.sharedStylesHost, element, type);
  1820. default: {
  1821. if (!this.rendererByCompId.has(type.id)) {
  1822. /** @type {?} */
  1823. const styles = flattenStyles(type.id, type.styles, []);
  1824. this.sharedStylesHost.addStyles(styles);
  1825. this.rendererByCompId.set(type.id, this.defaultRenderer);
  1826. }
  1827. return this.defaultRenderer;
  1828. }
  1829. }
  1830. }
  1831. /**
  1832. * @return {?}
  1833. */
  1834. begin() { }
  1835. /**
  1836. * @return {?}
  1837. */
  1838. end() { }
  1839. }
  1840. DomRendererFactory2.decorators = [
  1841. { type: Injectable }
  1842. ];
  1843. /** @nocollapse */
  1844. DomRendererFactory2.ctorParameters = () => [
  1845. { type: EventManager },
  1846. { type: DomSharedStylesHost },
  1847. { type: String, decorators: [{ type: Inject, args: [APP_ID,] }] }
  1848. ];
  1849. class DefaultDomRenderer2 {
  1850. /**
  1851. * @param {?} eventManager
  1852. */
  1853. constructor(eventManager) {
  1854. this.eventManager = eventManager;
  1855. this.data = Object.create(null);
  1856. }
  1857. /**
  1858. * @return {?}
  1859. */
  1860. destroy() { }
  1861. /**
  1862. * @param {?} name
  1863. * @param {?=} namespace
  1864. * @return {?}
  1865. */
  1866. createElement(name, namespace) {
  1867. if (namespace) {
  1868. // In cases where Ivy (not ViewEngine) is giving us the actual namespace, the look up by key
  1869. // will result in undefined, so we just return the namespace here.
  1870. return document.createElementNS(NAMESPACE_URIS[namespace] || namespace, name);
  1871. }
  1872. return document.createElement(name);
  1873. }
  1874. /**
  1875. * @param {?} value
  1876. * @return {?}
  1877. */
  1878. createComment(value) { return document.createComment(value); }
  1879. /**
  1880. * @param {?} value
  1881. * @return {?}
  1882. */
  1883. createText(value) { return document.createTextNode(value); }
  1884. /**
  1885. * @param {?} parent
  1886. * @param {?} newChild
  1887. * @return {?}
  1888. */
  1889. appendChild(parent, newChild) { parent.appendChild(newChild); }
  1890. /**
  1891. * @param {?} parent
  1892. * @param {?} newChild
  1893. * @param {?} refChild
  1894. * @return {?}
  1895. */
  1896. insertBefore(parent, newChild, refChild) {
  1897. if (parent) {
  1898. parent.insertBefore(newChild, refChild);
  1899. }
  1900. }
  1901. /**
  1902. * @param {?} parent
  1903. * @param {?} oldChild
  1904. * @return {?}
  1905. */
  1906. removeChild(parent, oldChild) {
  1907. if (parent) {
  1908. parent.removeChild(oldChild);
  1909. }
  1910. }
  1911. /**
  1912. * @param {?} selectorOrNode
  1913. * @param {?=} preserveContent
  1914. * @return {?}
  1915. */
  1916. selectRootElement(selectorOrNode, preserveContent) {
  1917. /** @type {?} */
  1918. let el = typeof selectorOrNode === 'string' ? document.querySelector(selectorOrNode) :
  1919. selectorOrNode;
  1920. if (!el) {
  1921. throw new Error(`The selector "${selectorOrNode}" did not match any elements`);
  1922. }
  1923. if (!preserveContent) {
  1924. el.textContent = '';
  1925. }
  1926. return el;
  1927. }
  1928. /**
  1929. * @param {?} node
  1930. * @return {?}
  1931. */
  1932. parentNode(node) { return node.parentNode; }
  1933. /**
  1934. * @param {?} node
  1935. * @return {?}
  1936. */
  1937. nextSibling(node) { return node.nextSibling; }
  1938. /**
  1939. * @param {?} el
  1940. * @param {?} name
  1941. * @param {?} value
  1942. * @param {?=} namespace
  1943. * @return {?}
  1944. */
  1945. setAttribute(el, name, value, namespace) {
  1946. if (namespace) {
  1947. name = namespace + ':' + name;
  1948. // TODO(benlesh): Ivy may cause issues here because it's passing around
  1949. // full URIs for namespaces, therefore this lookup will fail.
  1950. /** @type {?} */
  1951. const namespaceUri = NAMESPACE_URIS[namespace];
  1952. if (namespaceUri) {
  1953. el.setAttributeNS(namespaceUri, name, value);
  1954. }
  1955. else {
  1956. el.setAttribute(name, value);
  1957. }
  1958. }
  1959. else {
  1960. el.setAttribute(name, value);
  1961. }
  1962. }
  1963. /**
  1964. * @param {?} el
  1965. * @param {?} name
  1966. * @param {?=} namespace
  1967. * @return {?}
  1968. */
  1969. removeAttribute(el, name, namespace) {
  1970. if (namespace) {
  1971. // TODO(benlesh): Ivy may cause issues here because it's passing around
  1972. // full URIs for namespaces, therefore this lookup will fail.
  1973. /** @type {?} */
  1974. const namespaceUri = NAMESPACE_URIS[namespace];
  1975. if (namespaceUri) {
  1976. el.removeAttributeNS(namespaceUri, name);
  1977. }
  1978. else {
  1979. // TODO(benlesh): Since ivy is passing around full URIs for namespaces
  1980. // this could result in properties like `http://www.w3.org/2000/svg:cx="123"`,
  1981. // which is wrong.
  1982. el.removeAttribute(`${namespace}:${name}`);
  1983. }
  1984. }
  1985. else {
  1986. el.removeAttribute(name);
  1987. }
  1988. }
  1989. /**
  1990. * @param {?} el
  1991. * @param {?} name
  1992. * @return {?}
  1993. */
  1994. addClass(el, name) { el.classList.add(name); }
  1995. /**
  1996. * @param {?} el
  1997. * @param {?} name
  1998. * @return {?}
  1999. */
  2000. removeClass(el, name) { el.classList.remove(name); }
  2001. /**
  2002. * @param {?} el
  2003. * @param {?} style
  2004. * @param {?} value
  2005. * @param {?} flags
  2006. * @return {?}
  2007. */
  2008. setStyle(el, style, value, flags) {
  2009. if (flags & RendererStyleFlags2.DashCase) {
  2010. el.style.setProperty(style, value, !!(flags & RendererStyleFlags2.Important) ? 'important' : '');
  2011. }
  2012. else {
  2013. el.style[style] = value;
  2014. }
  2015. }
  2016. /**
  2017. * @param {?} el
  2018. * @param {?} style
  2019. * @param {?} flags
  2020. * @return {?}
  2021. */
  2022. removeStyle(el, style, flags) {
  2023. if (flags & RendererStyleFlags2.DashCase) {
  2024. el.style.removeProperty(style);
  2025. }
  2026. else {
  2027. // IE requires '' instead of null
  2028. // see https://github.com/angular/angular/issues/7916
  2029. el.style[style] = '';
  2030. }
  2031. }
  2032. /**
  2033. * @param {?} el
  2034. * @param {?} name
  2035. * @param {?} value
  2036. * @return {?}
  2037. */
  2038. setProperty(el, name, value) {
  2039. checkNoSyntheticProp(name, 'property');
  2040. el[name] = value;
  2041. }
  2042. /**
  2043. * @param {?} node
  2044. * @param {?} value
  2045. * @return {?}
  2046. */
  2047. setValue(node, value) { node.nodeValue = value; }
  2048. /**
  2049. * @param {?} target
  2050. * @param {?} event
  2051. * @param {?} callback
  2052. * @return {?}
  2053. */
  2054. listen(target, event, callback) {
  2055. checkNoSyntheticProp(event, 'listener');
  2056. if (typeof target === 'string') {
  2057. return (/** @type {?} */ (this.eventManager.addGlobalEventListener(target, event, decoratePreventDefault(callback))));
  2058. }
  2059. return (/** @type {?} */ ((/** @type {?} */ (this.eventManager.addEventListener(target, event, decoratePreventDefault(callback))))));
  2060. }
  2061. }
  2062. const ɵ0$2 = /**
  2063. * @return {?}
  2064. */
  2065. () => '@'.charCodeAt(0);
  2066. /** @type {?} */
  2067. const AT_CHARCODE = ((ɵ0$2))();
  2068. /**
  2069. * @param {?} name
  2070. * @param {?} nameKind
  2071. * @return {?}
  2072. */
  2073. function checkNoSyntheticProp(name, nameKind) {
  2074. if (name.charCodeAt(0) === AT_CHARCODE) {
  2075. throw new Error(`Found the synthetic ${nameKind} ${name}. Please include either "BrowserAnimationsModule" or "NoopAnimationsModule" in your application.`);
  2076. }
  2077. }
  2078. class EmulatedEncapsulationDomRenderer2 extends DefaultDomRenderer2 {
  2079. /**
  2080. * @param {?} eventManager
  2081. * @param {?} sharedStylesHost
  2082. * @param {?} component
  2083. * @param {?} appId
  2084. */
  2085. constructor(eventManager, sharedStylesHost, component, appId) {
  2086. super(eventManager);
  2087. this.component = component;
  2088. /** @type {?} */
  2089. const styles = flattenStyles(appId + '-' + component.id, component.styles, []);
  2090. sharedStylesHost.addStyles(styles);
  2091. this.contentAttr = shimContentAttribute(appId + '-' + component.id);
  2092. this.hostAttr = shimHostAttribute(appId + '-' + component.id);
  2093. }
  2094. /**
  2095. * @param {?} element
  2096. * @return {?}
  2097. */
  2098. applyToHost(element) { super.setAttribute(element, this.hostAttr, ''); }
  2099. /**
  2100. * @param {?} parent
  2101. * @param {?} name
  2102. * @return {?}
  2103. */
  2104. createElement(parent, name) {
  2105. /** @type {?} */
  2106. const el = super.createElement(parent, name);
  2107. super.setAttribute(el, this.contentAttr, '');
  2108. return el;
  2109. }
  2110. }
  2111. class ShadowDomRenderer extends DefaultDomRenderer2 {
  2112. /**
  2113. * @param {?} eventManager
  2114. * @param {?} sharedStylesHost
  2115. * @param {?} hostEl
  2116. * @param {?} component
  2117. */
  2118. constructor(eventManager, sharedStylesHost, hostEl, component) {
  2119. super(eventManager);
  2120. this.sharedStylesHost = sharedStylesHost;
  2121. this.hostEl = hostEl;
  2122. this.component = component;
  2123. if (component.encapsulation === ViewEncapsulation.ShadowDom) {
  2124. this.shadowRoot = ((/** @type {?} */ (hostEl))).attachShadow({ mode: 'open' });
  2125. }
  2126. else {
  2127. this.shadowRoot = ((/** @type {?} */ (hostEl))).createShadowRoot();
  2128. }
  2129. this.sharedStylesHost.addHost(this.shadowRoot);
  2130. /** @type {?} */
  2131. const styles = flattenStyles(component.id, component.styles, []);
  2132. for (let i = 0; i < styles.length; i++) {
  2133. /** @type {?} */
  2134. const styleEl = document.createElement('style');
  2135. styleEl.textContent = styles[i];
  2136. this.shadowRoot.appendChild(styleEl);
  2137. }
  2138. }
  2139. /**
  2140. * @private
  2141. * @param {?} node
  2142. * @return {?}
  2143. */
  2144. nodeOrShadowRoot(node) { return node === this.hostEl ? this.shadowRoot : node; }
  2145. /**
  2146. * @return {?}
  2147. */
  2148. destroy() { this.sharedStylesHost.removeHost(this.shadowRoot); }
  2149. /**
  2150. * @param {?} parent
  2151. * @param {?} newChild
  2152. * @return {?}
  2153. */
  2154. appendChild(parent, newChild) {
  2155. return super.appendChild(this.nodeOrShadowRoot(parent), newChild);
  2156. }
  2157. /**
  2158. * @param {?} parent
  2159. * @param {?} newChild
  2160. * @param {?} refChild
  2161. * @return {?}
  2162. */
  2163. insertBefore(parent, newChild, refChild) {
  2164. return super.insertBefore(this.nodeOrShadowRoot(parent), newChild, refChild);
  2165. }
  2166. /**
  2167. * @param {?} parent
  2168. * @param {?} oldChild
  2169. * @return {?}
  2170. */
  2171. removeChild(parent, oldChild) {
  2172. return super.removeChild(this.nodeOrShadowRoot(parent), oldChild);
  2173. }
  2174. /**
  2175. * @param {?} node
  2176. * @return {?}
  2177. */
  2178. parentNode(node) {
  2179. return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(node)));
  2180. }
  2181. }
  2182. /**
  2183. * @fileoverview added by tsickle
  2184. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  2185. */
  2186. const ɵ0$3 = /**
  2187. * @return {?}
  2188. */
  2189. () => (typeof Zone !== 'undefined') && ((/** @type {?} */ (Zone)))['__symbol__'] ||
  2190. (/**
  2191. * @param {?} v
  2192. * @return {?}
  2193. */
  2194. function (v) { return '__zone_symbol__' + v; });
  2195. /**
  2196. * Detect if Zone is present. If it is then use simple zone aware 'addEventListener'
  2197. * since Angular can do much more
  2198. * efficient bookkeeping than Zone can, because we have additional information. This speeds up
  2199. * addEventListener by 3x.
  2200. * @type {?}
  2201. */
  2202. const __symbol__ = ((ɵ0$3))();
  2203. /** @type {?} */
  2204. const ADD_EVENT_LISTENER = __symbol__('addEventListener');
  2205. /** @type {?} */
  2206. const REMOVE_EVENT_LISTENER = __symbol__('removeEventListener');
  2207. /** @type {?} */
  2208. const symbolNames = {};
  2209. /** @type {?} */
  2210. const FALSE = 'FALSE';
  2211. /** @type {?} */
  2212. const ANGULAR = 'ANGULAR';
  2213. /** @type {?} */
  2214. const NATIVE_ADD_LISTENER = 'addEventListener';
  2215. /** @type {?} */
  2216. const NATIVE_REMOVE_LISTENER = 'removeEventListener';
  2217. // use the same symbol string which is used in zone.js
  2218. /** @type {?} */
  2219. const stopSymbol = '__zone_symbol__propagationStopped';
  2220. /** @type {?} */
  2221. const stopMethodSymbol = '__zone_symbol__stopImmediatePropagation';
  2222. const ɵ1 = /**
  2223. * @return {?}
  2224. */
  2225. () => {
  2226. /** @type {?} */
  2227. const blackListedEvents = (typeof Zone !== 'undefined') && ((/** @type {?} */ (Zone)))[__symbol__('BLACK_LISTED_EVENTS')];
  2228. if (blackListedEvents) {
  2229. /** @type {?} */
  2230. const res = {};
  2231. blackListedEvents.forEach((/**
  2232. * @param {?} eventName
  2233. * @return {?}
  2234. */
  2235. eventName => { res[eventName] = eventName; }));
  2236. return res;
  2237. }
  2238. return undefined;
  2239. };
  2240. /** @type {?} */
  2241. const blackListedMap = ((ɵ1))();
  2242. /** @type {?} */
  2243. const isBlackListedEvent = (/**
  2244. * @param {?} eventName
  2245. * @return {?}
  2246. */
  2247. function (eventName) {
  2248. if (!blackListedMap) {
  2249. return false;
  2250. }
  2251. return blackListedMap.hasOwnProperty(eventName);
  2252. });
  2253. // a global listener to handle all dom event,
  2254. // so we do not need to create a closure every time
  2255. /** @type {?} */
  2256. const globalListener = (/**
  2257. * @param {?} event
  2258. * @return {?}
  2259. */
  2260. function (event) {
  2261. /** @type {?} */
  2262. const symbolName = symbolNames[event.type];
  2263. if (!symbolName) {
  2264. return;
  2265. }
  2266. /** @type {?} */
  2267. const taskDatas = this[symbolName];
  2268. if (!taskDatas) {
  2269. return;
  2270. }
  2271. /** @type {?} */
  2272. const args = [event];
  2273. if (taskDatas.length === 1) {
  2274. // if taskDatas only have one element, just invoke it
  2275. /** @type {?} */
  2276. const taskData = taskDatas[0];
  2277. if (taskData.zone !== Zone.current) {
  2278. // only use Zone.run when Zone.current not equals to stored zone
  2279. return taskData.zone.run(taskData.handler, this, args);
  2280. }
  2281. else {
  2282. return taskData.handler.apply(this, args);
  2283. }
  2284. }
  2285. else {
  2286. // copy tasks as a snapshot to avoid event handlers remove
  2287. // itself or others
  2288. /** @type {?} */
  2289. const copiedTasks = taskDatas.slice();
  2290. for (let i = 0; i < copiedTasks.length; i++) {
  2291. // if other listener call event.stopImmediatePropagation
  2292. // just break
  2293. if (((/** @type {?} */ (event)))[stopSymbol] === true) {
  2294. break;
  2295. }
  2296. /** @type {?} */
  2297. const taskData = copiedTasks[i];
  2298. if (taskData.zone !== Zone.current) {
  2299. // only use Zone.run when Zone.current not equals to stored zone
  2300. taskData.zone.run(taskData.handler, this, args);
  2301. }
  2302. else {
  2303. taskData.handler.apply(this, args);
  2304. }
  2305. }
  2306. }
  2307. });
  2308. class DomEventsPlugin extends EventManagerPlugin {
  2309. /**
  2310. * @param {?} doc
  2311. * @param {?} ngZone
  2312. * @param {?} platformId
  2313. */
  2314. constructor(doc, ngZone, platformId) {
  2315. super(doc);
  2316. this.ngZone = ngZone;
  2317. if (!platformId || !isPlatformServer(platformId)) {
  2318. this.patchEvent();
  2319. }
  2320. }
  2321. /**
  2322. * @private
  2323. * @return {?}
  2324. */
  2325. patchEvent() {
  2326. if (typeof Event === 'undefined' || !Event || !Event.prototype) {
  2327. return;
  2328. }
  2329. if (((/** @type {?} */ (Event.prototype)))[stopMethodSymbol]) {
  2330. // already patched by zone.js
  2331. return;
  2332. }
  2333. /** @type {?} */
  2334. const delegate = ((/** @type {?} */ (Event.prototype)))[stopMethodSymbol] =
  2335. Event.prototype.stopImmediatePropagation;
  2336. Event.prototype.stopImmediatePropagation = (/**
  2337. * @return {?}
  2338. */
  2339. function () {
  2340. if (this) {
  2341. this[stopSymbol] = true;
  2342. }
  2343. // should call native delegate in case
  2344. // in some environment part of the application
  2345. // will not use the patched Event
  2346. delegate && delegate.apply(this, arguments);
  2347. });
  2348. }
  2349. // This plugin should come last in the list of plugins, because it accepts all
  2350. // events.
  2351. /**
  2352. * @param {?} eventName
  2353. * @return {?}
  2354. */
  2355. supports(eventName) { return true; }
  2356. /**
  2357. * @param {?} element
  2358. * @param {?} eventName
  2359. * @param {?} handler
  2360. * @return {?}
  2361. */
  2362. addEventListener(element, eventName, handler) {
  2363. /** @type {?} */
  2364. const zoneJsLoaded = element[ADD_EVENT_LISTENER];
  2365. /** @type {?} */
  2366. let callback = (/** @type {?} */ (handler));
  2367. // if zonejs is loaded and current zone is not ngZone
  2368. // we keep Zone.current on target for later restoration.
  2369. if (zoneJsLoaded && (!NgZone.isInAngularZone() || isBlackListedEvent(eventName))) {
  2370. /** @type {?} */
  2371. let symbolName = symbolNames[eventName];
  2372. if (!symbolName) {
  2373. symbolName = symbolNames[eventName] = __symbol__(ANGULAR + eventName + FALSE);
  2374. }
  2375. /** @type {?} */
  2376. let taskDatas = ((/** @type {?} */ (element)))[symbolName];
  2377. /** @type {?} */
  2378. const globalListenerRegistered = taskDatas && taskDatas.length > 0;
  2379. if (!taskDatas) {
  2380. taskDatas = ((/** @type {?} */ (element)))[symbolName] = [];
  2381. }
  2382. /** @type {?} */
  2383. const zone = isBlackListedEvent(eventName) ? Zone.root : Zone.current;
  2384. if (taskDatas.length === 0) {
  2385. taskDatas.push({ zone: zone, handler: callback });
  2386. }
  2387. else {
  2388. /** @type {?} */
  2389. let callbackRegistered = false;
  2390. for (let i = 0; i < taskDatas.length; i++) {
  2391. if (taskDatas[i].handler === callback) {
  2392. callbackRegistered = true;
  2393. break;
  2394. }
  2395. }
  2396. if (!callbackRegistered) {
  2397. taskDatas.push({ zone: zone, handler: callback });
  2398. }
  2399. }
  2400. if (!globalListenerRegistered) {
  2401. element[ADD_EVENT_LISTENER](eventName, globalListener, false);
  2402. }
  2403. }
  2404. else {
  2405. element[NATIVE_ADD_LISTENER](eventName, callback, false);
  2406. }
  2407. return (/**
  2408. * @return {?}
  2409. */
  2410. () => this.removeEventListener(element, eventName, callback));
  2411. }
  2412. /**
  2413. * @param {?} target
  2414. * @param {?} eventName
  2415. * @param {?} callback
  2416. * @return {?}
  2417. */
  2418. removeEventListener(target, eventName, callback) {
  2419. /** @type {?} */
  2420. let underlyingRemove = target[REMOVE_EVENT_LISTENER];
  2421. // zone.js not loaded, use native removeEventListener
  2422. if (!underlyingRemove) {
  2423. return target[NATIVE_REMOVE_LISTENER].apply(target, [eventName, callback, false]);
  2424. }
  2425. /** @type {?} */
  2426. let symbolName = symbolNames[eventName];
  2427. /** @type {?} */
  2428. let taskDatas = symbolName && target[symbolName];
  2429. if (!taskDatas) {
  2430. // addEventListener not using patched version
  2431. // just call native removeEventListener
  2432. return target[NATIVE_REMOVE_LISTENER].apply(target, [eventName, callback, false]);
  2433. }
  2434. // fix issue 20532, should be able to remove
  2435. // listener which was added inside of ngZone
  2436. /** @type {?} */
  2437. let found = false;
  2438. for (let i = 0; i < taskDatas.length; i++) {
  2439. // remove listener from taskDatas if the callback equals
  2440. if (taskDatas[i].handler === callback) {
  2441. found = true;
  2442. taskDatas.splice(i, 1);
  2443. break;
  2444. }
  2445. }
  2446. if (found) {
  2447. if (taskDatas.length === 0) {
  2448. // all listeners are removed, we can remove the globalListener from target
  2449. underlyingRemove.apply(target, [eventName, globalListener, false]);
  2450. }
  2451. }
  2452. else {
  2453. // not found in taskDatas, the callback may be added inside of ngZone
  2454. // use native remove listener to remove the callback
  2455. target[NATIVE_REMOVE_LISTENER].apply(target, [eventName, callback, false]);
  2456. }
  2457. }
  2458. }
  2459. DomEventsPlugin.decorators = [
  2460. { type: Injectable }
  2461. ];
  2462. /** @nocollapse */
  2463. DomEventsPlugin.ctorParameters = () => [
  2464. { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
  2465. { type: NgZone },
  2466. { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [PLATFORM_ID,] }] }
  2467. ];
  2468. /**
  2469. * @fileoverview added by tsickle
  2470. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  2471. */
  2472. /**
  2473. * Supported HammerJS recognizer event names.
  2474. * @type {?}
  2475. */
  2476. const EVENT_NAMES = {
  2477. // pan
  2478. 'pan': true,
  2479. 'panstart': true,
  2480. 'panmove': true,
  2481. 'panend': true,
  2482. 'pancancel': true,
  2483. 'panleft': true,
  2484. 'panright': true,
  2485. 'panup': true,
  2486. 'pandown': true,
  2487. // pinch
  2488. 'pinch': true,
  2489. 'pinchstart': true,
  2490. 'pinchmove': true,
  2491. 'pinchend': true,
  2492. 'pinchcancel': true,
  2493. 'pinchin': true,
  2494. 'pinchout': true,
  2495. // press
  2496. 'press': true,
  2497. 'pressup': true,
  2498. // rotate
  2499. 'rotate': true,
  2500. 'rotatestart': true,
  2501. 'rotatemove': true,
  2502. 'rotateend': true,
  2503. 'rotatecancel': true,
  2504. // swipe
  2505. 'swipe': true,
  2506. 'swipeleft': true,
  2507. 'swiperight': true,
  2508. 'swipeup': true,
  2509. 'swipedown': true,
  2510. // tap
  2511. 'tap': true,
  2512. };
  2513. /**
  2514. * DI token for providing [HammerJS](http://hammerjs.github.io/) support to Angular.
  2515. * @see `HammerGestureConfig`
  2516. *
  2517. * \@publicApi
  2518. * @type {?}
  2519. */
  2520. const HAMMER_GESTURE_CONFIG = new InjectionToken('HammerGestureConfig');
  2521. /**
  2522. * Injection token used to provide a {\@link HammerLoader} to Angular.
  2523. *
  2524. * \@publicApi
  2525. * @type {?}
  2526. */
  2527. const HAMMER_LOADER = new InjectionToken('HammerLoader');
  2528. /**
  2529. * An injectable [HammerJS Manager](http://hammerjs.github.io/api/#hammer.manager)
  2530. * for gesture recognition. Configures specific event recognition.
  2531. * \@publicApi
  2532. */
  2533. class HammerGestureConfig {
  2534. constructor() {
  2535. /**
  2536. * A set of supported event names for gestures to be used in Angular.
  2537. * Angular supports all built-in recognizers, as listed in
  2538. * [HammerJS documentation](http://hammerjs.github.io/).
  2539. */
  2540. this.events = [];
  2541. /**
  2542. * Maps gesture event names to a set of configuration options
  2543. * that specify overrides to the default values for specific properties.
  2544. *
  2545. * The key is a supported event name to be configured,
  2546. * and the options object contains a set of properties, with override values
  2547. * to be applied to the named recognizer event.
  2548. * For example, to disable recognition of the rotate event, specify
  2549. * `{"rotate": {"enable": false}}`.
  2550. *
  2551. * Properties that are not present take the HammerJS default values.
  2552. * For information about which properties are supported for which events,
  2553. * and their allowed and default values, see
  2554. * [HammerJS documentation](http://hammerjs.github.io/).
  2555. *
  2556. */
  2557. this.overrides = {};
  2558. }
  2559. /**
  2560. * Creates a [HammerJS Manager](http://hammerjs.github.io/api/#hammer.manager)
  2561. * and attaches it to a given HTML element.
  2562. * @param {?} element The element that will recognize gestures.
  2563. * @return {?} A HammerJS event-manager object.
  2564. */
  2565. buildHammer(element) {
  2566. /** @type {?} */
  2567. const mc = new (/** @type {?} */ (Hammer))(element, this.options);
  2568. mc.get('pinch').set({ enable: true });
  2569. mc.get('rotate').set({ enable: true });
  2570. for (const eventName in this.overrides) {
  2571. mc.get(eventName).set(this.overrides[eventName]);
  2572. }
  2573. return mc;
  2574. }
  2575. }
  2576. HammerGestureConfig.decorators = [
  2577. { type: Injectable }
  2578. ];
  2579. class HammerGesturesPlugin extends EventManagerPlugin {
  2580. /**
  2581. * @param {?} doc
  2582. * @param {?} _config
  2583. * @param {?} console
  2584. * @param {?=} loader
  2585. */
  2586. constructor(doc, _config, console, loader) {
  2587. super(doc);
  2588. this._config = _config;
  2589. this.console = console;
  2590. this.loader = loader;
  2591. }
  2592. /**
  2593. * @param {?} eventName
  2594. * @return {?}
  2595. */
  2596. supports(eventName) {
  2597. if (!EVENT_NAMES.hasOwnProperty(eventName.toLowerCase()) && !this.isCustomEvent(eventName)) {
  2598. return false;
  2599. }
  2600. if (!((/** @type {?} */ (window))).Hammer && !this.loader) {
  2601. this.console.warn(`The "${eventName}" event cannot be bound because Hammer.JS is not ` +
  2602. `loaded and no custom loader has been specified.`);
  2603. return false;
  2604. }
  2605. return true;
  2606. }
  2607. /**
  2608. * @param {?} element
  2609. * @param {?} eventName
  2610. * @param {?} handler
  2611. * @return {?}
  2612. */
  2613. addEventListener(element, eventName, handler) {
  2614. /** @type {?} */
  2615. const zone = this.manager.getZone();
  2616. eventName = eventName.toLowerCase();
  2617. // If Hammer is not present but a loader is specified, we defer adding the event listener
  2618. // until Hammer is loaded.
  2619. if (!((/** @type {?} */ (window))).Hammer && this.loader) {
  2620. // This `addEventListener` method returns a function to remove the added listener.
  2621. // Until Hammer is loaded, the returned function needs to *cancel* the registration rather
  2622. // than remove anything.
  2623. /** @type {?} */
  2624. let cancelRegistration = false;
  2625. /** @type {?} */
  2626. let deregister = (/**
  2627. * @return {?}
  2628. */
  2629. () => { cancelRegistration = true; });
  2630. this.loader()
  2631. .then((/**
  2632. * @return {?}
  2633. */
  2634. () => {
  2635. // If Hammer isn't actually loaded when the custom loader resolves, give up.
  2636. if (!((/** @type {?} */ (window))).Hammer) {
  2637. this.console.warn(`The custom HAMMER_LOADER completed, but Hammer.JS is not present.`);
  2638. deregister = (/**
  2639. * @return {?}
  2640. */
  2641. () => { });
  2642. return;
  2643. }
  2644. if (!cancelRegistration) {
  2645. // Now that Hammer is loaded and the listener is being loaded for real,
  2646. // the deregistration function changes from canceling registration to removal.
  2647. deregister = this.addEventListener(element, eventName, handler);
  2648. }
  2649. }))
  2650. .catch((/**
  2651. * @return {?}
  2652. */
  2653. () => {
  2654. this.console.warn(`The "${eventName}" event cannot be bound because the custom ` +
  2655. `Hammer.JS loader failed.`);
  2656. deregister = (/**
  2657. * @return {?}
  2658. */
  2659. () => { });
  2660. }));
  2661. // Return a function that *executes* `deregister` (and not `deregister` itself) so that we
  2662. // can change the behavior of `deregister` once the listener is added. Using a closure in
  2663. // this way allows us to avoid any additional data structures to track listener removal.
  2664. return (/**
  2665. * @return {?}
  2666. */
  2667. () => { deregister(); });
  2668. }
  2669. return zone.runOutsideAngular((/**
  2670. * @return {?}
  2671. */
  2672. () => {
  2673. // Creating the manager bind events, must be done outside of angular
  2674. /** @type {?} */
  2675. const mc = this._config.buildHammer(element);
  2676. /** @type {?} */
  2677. const callback = (/**
  2678. * @param {?} eventObj
  2679. * @return {?}
  2680. */
  2681. function (eventObj) {
  2682. zone.runGuarded((/**
  2683. * @return {?}
  2684. */
  2685. function () { handler(eventObj); }));
  2686. });
  2687. mc.on(eventName, callback);
  2688. return (/**
  2689. * @return {?}
  2690. */
  2691. () => {
  2692. mc.off(eventName, callback);
  2693. // destroy mc to prevent memory leak
  2694. if (typeof mc.destroy === 'function') {
  2695. mc.destroy();
  2696. }
  2697. });
  2698. }));
  2699. }
  2700. /**
  2701. * @param {?} eventName
  2702. * @return {?}
  2703. */
  2704. isCustomEvent(eventName) { return this._config.events.indexOf(eventName) > -1; }
  2705. }
  2706. HammerGesturesPlugin.decorators = [
  2707. { type: Injectable }
  2708. ];
  2709. /** @nocollapse */
  2710. HammerGesturesPlugin.ctorParameters = () => [
  2711. { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
  2712. { type: HammerGestureConfig, decorators: [{ type: Inject, args: [HAMMER_GESTURE_CONFIG,] }] },
  2713. { type: ɵConsole },
  2714. { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [HAMMER_LOADER,] }] }
  2715. ];
  2716. /**
  2717. * @fileoverview added by tsickle
  2718. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  2719. */
  2720. /**
  2721. * Defines supported modifiers for key events.
  2722. * @type {?}
  2723. */
  2724. const MODIFIER_KEYS = ['alt', 'control', 'meta', 'shift'];
  2725. const ɵ0$4 = /**
  2726. * @param {?} event
  2727. * @return {?}
  2728. */
  2729. (event) => event.altKey, ɵ1$1 = /**
  2730. * @param {?} event
  2731. * @return {?}
  2732. */
  2733. (event) => event.ctrlKey, ɵ2 = /**
  2734. * @param {?} event
  2735. * @return {?}
  2736. */
  2737. (event) => event.metaKey, ɵ3 = /**
  2738. * @param {?} event
  2739. * @return {?}
  2740. */
  2741. (event) => event.shiftKey;
  2742. /**
  2743. * Retrieves modifiers from key-event objects.
  2744. * @type {?}
  2745. */
  2746. const MODIFIER_KEY_GETTERS = {
  2747. 'alt': (ɵ0$4),
  2748. 'control': (ɵ1$1),
  2749. 'meta': (ɵ2),
  2750. 'shift': (ɵ3)
  2751. };
  2752. /**
  2753. * \@publicApi
  2754. * A browser plug-in that provides support for handling of key events in Angular.
  2755. */
  2756. class KeyEventsPlugin extends EventManagerPlugin {
  2757. /**
  2758. * Initializes an instance of the browser plug-in.
  2759. * @param {?} doc The document in which key events will be detected.
  2760. */
  2761. constructor(doc) { super(doc); }
  2762. /**
  2763. * Reports whether a named key event is supported.
  2764. * @param {?} eventName The event name to query.
  2765. * @return {?} True if the named key event is supported.
  2766. */
  2767. supports(eventName) { return KeyEventsPlugin.parseEventName(eventName) != null; }
  2768. /**
  2769. * Registers a handler for a specific element and key event.
  2770. * @param {?} element The HTML element to receive event notifications.
  2771. * @param {?} eventName The name of the key event to listen for.
  2772. * @param {?} handler A function to call when the notification occurs. Receives the
  2773. * event object as an argument.
  2774. * @return {?} The key event that was registered.
  2775. */
  2776. addEventListener(element, eventName, handler) {
  2777. /** @type {?} */
  2778. const parsedEvent = (/** @type {?} */ (KeyEventsPlugin.parseEventName(eventName)));
  2779. /** @type {?} */
  2780. const outsideHandler = KeyEventsPlugin.eventCallback(parsedEvent['fullKey'], handler, this.manager.getZone());
  2781. return this.manager.getZone().runOutsideAngular((/**
  2782. * @return {?}
  2783. */
  2784. () => {
  2785. return getDOM().onAndCancel(element, parsedEvent['domEventName'], outsideHandler);
  2786. }));
  2787. }
  2788. /**
  2789. * @param {?} eventName
  2790. * @return {?}
  2791. */
  2792. static parseEventName(eventName) {
  2793. /** @type {?} */
  2794. const parts = eventName.toLowerCase().split('.');
  2795. /** @type {?} */
  2796. const domEventName = parts.shift();
  2797. if ((parts.length === 0) || !(domEventName === 'keydown' || domEventName === 'keyup')) {
  2798. return null;
  2799. }
  2800. /** @type {?} */
  2801. const key = KeyEventsPlugin._normalizeKey((/** @type {?} */ (parts.pop())));
  2802. /** @type {?} */
  2803. let fullKey = '';
  2804. MODIFIER_KEYS.forEach((/**
  2805. * @param {?} modifierName
  2806. * @return {?}
  2807. */
  2808. modifierName => {
  2809. /** @type {?} */
  2810. const index = parts.indexOf(modifierName);
  2811. if (index > -1) {
  2812. parts.splice(index, 1);
  2813. fullKey += modifierName + '.';
  2814. }
  2815. }));
  2816. fullKey += key;
  2817. if (parts.length != 0 || key.length === 0) {
  2818. // returning null instead of throwing to let another plugin process the event
  2819. return null;
  2820. }
  2821. /** @type {?} */
  2822. const result = {};
  2823. result['domEventName'] = domEventName;
  2824. result['fullKey'] = fullKey;
  2825. return result;
  2826. }
  2827. /**
  2828. * @param {?} event
  2829. * @return {?}
  2830. */
  2831. static getEventFullKey(event) {
  2832. /** @type {?} */
  2833. let fullKey = '';
  2834. /** @type {?} */
  2835. let key = getDOM().getEventKey(event);
  2836. key = key.toLowerCase();
  2837. if (key === ' ') {
  2838. key = 'space'; // for readability
  2839. }
  2840. else if (key === '.') {
  2841. key = 'dot'; // because '.' is used as a separator in event names
  2842. }
  2843. MODIFIER_KEYS.forEach((/**
  2844. * @param {?} modifierName
  2845. * @return {?}
  2846. */
  2847. modifierName => {
  2848. if (modifierName != key) {
  2849. /** @type {?} */
  2850. const modifierGetter = MODIFIER_KEY_GETTERS[modifierName];
  2851. if (modifierGetter(event)) {
  2852. fullKey += modifierName + '.';
  2853. }
  2854. }
  2855. }));
  2856. fullKey += key;
  2857. return fullKey;
  2858. }
  2859. /**
  2860. * Configures a handler callback for a key event.
  2861. * @param {?} fullKey The event name that combines all simultaneous keystrokes.
  2862. * @param {?} handler The function that responds to the key event.
  2863. * @param {?} zone The zone in which the event occurred.
  2864. * @return {?} A callback function.
  2865. */
  2866. static eventCallback(fullKey, handler, zone) {
  2867. return (/**
  2868. * @param {?} event
  2869. * @return {?}
  2870. */
  2871. (event /** TODO #9100 */) => {
  2872. if (KeyEventsPlugin.getEventFullKey(event) === fullKey) {
  2873. zone.runGuarded((/**
  2874. * @return {?}
  2875. */
  2876. () => handler(event)));
  2877. }
  2878. });
  2879. }
  2880. /**
  2881. * \@internal
  2882. * @param {?} keyName
  2883. * @return {?}
  2884. */
  2885. static _normalizeKey(keyName) {
  2886. // TODO: switch to a Map if the mapping grows too much
  2887. switch (keyName) {
  2888. case 'esc':
  2889. return 'escape';
  2890. default:
  2891. return keyName;
  2892. }
  2893. }
  2894. }
  2895. KeyEventsPlugin.decorators = [
  2896. { type: Injectable }
  2897. ];
  2898. /** @nocollapse */
  2899. KeyEventsPlugin.ctorParameters = () => [
  2900. { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
  2901. ];
  2902. /**
  2903. * @fileoverview added by tsickle
  2904. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  2905. */
  2906. /**
  2907. * DomSanitizer helps preventing Cross Site Scripting Security bugs (XSS) by sanitizing
  2908. * values to be safe to use in the different DOM contexts.
  2909. *
  2910. * For example, when binding a URL in an `<a [href]="someValue">` hyperlink, `someValue` will be
  2911. * sanitized so that an attacker cannot inject e.g. a `javascript:` URL that would execute code on
  2912. * the website.
  2913. *
  2914. * In specific situations, it might be necessary to disable sanitization, for example if the
  2915. * application genuinely needs to produce a `javascript:` style link with a dynamic value in it.
  2916. * Users can bypass security by constructing a value with one of the `bypassSecurityTrust...`
  2917. * methods, and then binding to that value from the template.
  2918. *
  2919. * These situations should be very rare, and extraordinary care must be taken to avoid creating a
  2920. * Cross Site Scripting (XSS) security bug!
  2921. *
  2922. * When using `bypassSecurityTrust...`, make sure to call the method as early as possible and as
  2923. * close as possible to the source of the value, to make it easy to verify no security bug is
  2924. * created by its use.
  2925. *
  2926. * It is not required (and not recommended) to bypass security if the value is safe, e.g. a URL that
  2927. * does not start with a suspicious protocol, or an HTML snippet that does not contain dangerous
  2928. * code. The sanitizer leaves safe values intact.
  2929. *
  2930. * \@security Calling any of the `bypassSecurityTrust...` APIs disables Angular's built-in
  2931. * sanitization for the value passed in. Carefully check and audit all values and code paths going
  2932. * into this call. Make sure any user data is appropriately escaped for this security context.
  2933. * For more detail, see the [Security Guide](http://g.co/ng/security).
  2934. *
  2935. * \@publicApi
  2936. * @abstract
  2937. */
  2938. class DomSanitizer {
  2939. }
  2940. class DomSanitizerImpl extends DomSanitizer {
  2941. /**
  2942. * @param {?} _doc
  2943. */
  2944. constructor(_doc) {
  2945. super();
  2946. this._doc = _doc;
  2947. }
  2948. /**
  2949. * @param {?} ctx
  2950. * @param {?} value
  2951. * @return {?}
  2952. */
  2953. sanitize(ctx, value) {
  2954. if (value == null)
  2955. return null;
  2956. switch (ctx) {
  2957. case SecurityContext.NONE:
  2958. return (/** @type {?} */ (value));
  2959. case SecurityContext.HTML:
  2960. if (value instanceof SafeHtmlImpl)
  2961. return value.changingThisBreaksApplicationSecurity;
  2962. this.checkNotSafeValue(value, 'HTML');
  2963. return ɵ_sanitizeHtml(this._doc, String(value));
  2964. case SecurityContext.STYLE:
  2965. if (value instanceof SafeStyleImpl)
  2966. return value.changingThisBreaksApplicationSecurity;
  2967. this.checkNotSafeValue(value, 'Style');
  2968. return ɵ_sanitizeStyle((/** @type {?} */ (value)));
  2969. case SecurityContext.SCRIPT:
  2970. if (value instanceof SafeScriptImpl)
  2971. return value.changingThisBreaksApplicationSecurity;
  2972. this.checkNotSafeValue(value, 'Script');
  2973. throw new Error('unsafe value used in a script context');
  2974. case SecurityContext.URL:
  2975. if (value instanceof SafeResourceUrlImpl || value instanceof SafeUrlImpl) {
  2976. // Allow resource URLs in URL contexts, they are strictly more trusted.
  2977. return value.changingThisBreaksApplicationSecurity;
  2978. }
  2979. this.checkNotSafeValue(value, 'URL');
  2980. return ɵ_sanitizeUrl(String(value));
  2981. case SecurityContext.RESOURCE_URL:
  2982. if (value instanceof SafeResourceUrlImpl) {
  2983. return value.changingThisBreaksApplicationSecurity;
  2984. }
  2985. this.checkNotSafeValue(value, 'ResourceURL');
  2986. throw new Error('unsafe value used in a resource URL context (see http://g.co/ng/security#xss)');
  2987. default:
  2988. throw new Error(`Unexpected SecurityContext ${ctx} (see http://g.co/ng/security#xss)`);
  2989. }
  2990. }
  2991. /**
  2992. * @private
  2993. * @param {?} value
  2994. * @param {?} expectedType
  2995. * @return {?}
  2996. */
  2997. checkNotSafeValue(value, expectedType) {
  2998. if (value instanceof SafeValueImpl) {
  2999. throw new Error(`Required a safe ${expectedType}, got a ${value.getTypeName()} ` +
  3000. `(see http://g.co/ng/security#xss)`);
  3001. }
  3002. }
  3003. /**
  3004. * @param {?} value
  3005. * @return {?}
  3006. */
  3007. bypassSecurityTrustHtml(value) { return new SafeHtmlImpl(value); }
  3008. /**
  3009. * @param {?} value
  3010. * @return {?}
  3011. */
  3012. bypassSecurityTrustStyle(value) { return new SafeStyleImpl(value); }
  3013. /**
  3014. * @param {?} value
  3015. * @return {?}
  3016. */
  3017. bypassSecurityTrustScript(value) { return new SafeScriptImpl(value); }
  3018. /**
  3019. * @param {?} value
  3020. * @return {?}
  3021. */
  3022. bypassSecurityTrustUrl(value) { return new SafeUrlImpl(value); }
  3023. /**
  3024. * @param {?} value
  3025. * @return {?}
  3026. */
  3027. bypassSecurityTrustResourceUrl(value) {
  3028. return new SafeResourceUrlImpl(value);
  3029. }
  3030. }
  3031. DomSanitizerImpl.decorators = [
  3032. { type: Injectable }
  3033. ];
  3034. /** @nocollapse */
  3035. DomSanitizerImpl.ctorParameters = () => [
  3036. { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
  3037. ];
  3038. /**
  3039. * @abstract
  3040. */
  3041. class SafeValueImpl {
  3042. /**
  3043. * @param {?} changingThisBreaksApplicationSecurity
  3044. */
  3045. constructor(changingThisBreaksApplicationSecurity) {
  3046. this.changingThisBreaksApplicationSecurity = changingThisBreaksApplicationSecurity;
  3047. // empty
  3048. }
  3049. /**
  3050. * @return {?}
  3051. */
  3052. toString() {
  3053. return `SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity}` +
  3054. ` (see http://g.co/ng/security#xss)`;
  3055. }
  3056. }
  3057. class SafeHtmlImpl extends SafeValueImpl {
  3058. /**
  3059. * @return {?}
  3060. */
  3061. getTypeName() { return 'HTML'; }
  3062. }
  3063. class SafeStyleImpl extends SafeValueImpl {
  3064. /**
  3065. * @return {?}
  3066. */
  3067. getTypeName() { return 'Style'; }
  3068. }
  3069. class SafeScriptImpl extends SafeValueImpl {
  3070. /**
  3071. * @return {?}
  3072. */
  3073. getTypeName() { return 'Script'; }
  3074. }
  3075. class SafeUrlImpl extends SafeValueImpl {
  3076. /**
  3077. * @return {?}
  3078. */
  3079. getTypeName() { return 'URL'; }
  3080. }
  3081. class SafeResourceUrlImpl extends SafeValueImpl {
  3082. /**
  3083. * @return {?}
  3084. */
  3085. getTypeName() { return 'ResourceURL'; }
  3086. }
  3087. /**
  3088. * @fileoverview added by tsickle
  3089. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  3090. */
  3091. const ɵ0$5 = ɵPLATFORM_BROWSER_ID;
  3092. /** @type {?} */
  3093. const INTERNAL_BROWSER_PLATFORM_PROVIDERS = [
  3094. { provide: PLATFORM_ID, useValue: ɵ0$5 },
  3095. { provide: PLATFORM_INITIALIZER, useValue: initDomAdapter, multi: true },
  3096. { provide: PlatformLocation, useClass: BrowserPlatformLocation, deps: [DOCUMENT] },
  3097. { provide: DOCUMENT, useFactory: _document, deps: [] },
  3098. ];
  3099. /**
  3100. * \@security Replacing built-in sanitization providers exposes the application to XSS risks.
  3101. * Attacker-controlled data introduced by an unsanitized provider could expose your
  3102. * application to XSS risks. For more detail, see the [Security Guide](http://g.co/ng/security).
  3103. * \@publicApi
  3104. * @type {?}
  3105. */
  3106. const BROWSER_SANITIZATION_PROVIDERS = [
  3107. { provide: Sanitizer, useExisting: DomSanitizer },
  3108. { provide: DomSanitizer, useClass: DomSanitizerImpl, deps: [DOCUMENT] },
  3109. ];
  3110. /**
  3111. * \@publicApi
  3112. * @type {?}
  3113. */
  3114. const platformBrowser = createPlatformFactory(platformCore, 'browser', INTERNAL_BROWSER_PLATFORM_PROVIDERS);
  3115. /**
  3116. * @return {?}
  3117. */
  3118. function initDomAdapter() {
  3119. BrowserDomAdapter.makeCurrent();
  3120. BrowserGetTestability.init();
  3121. }
  3122. /**
  3123. * @return {?}
  3124. */
  3125. function errorHandler() {
  3126. return new ErrorHandler();
  3127. }
  3128. /**
  3129. * @return {?}
  3130. */
  3131. function _document() {
  3132. return document;
  3133. }
  3134. /** @type {?} */
  3135. const BROWSER_MODULE_PROVIDERS = [
  3136. BROWSER_SANITIZATION_PROVIDERS,
  3137. { provide: ɵAPP_ROOT, useValue: true },
  3138. { provide: ErrorHandler, useFactory: errorHandler, deps: [] },
  3139. {
  3140. provide: EVENT_MANAGER_PLUGINS,
  3141. useClass: DomEventsPlugin,
  3142. multi: true,
  3143. deps: [DOCUMENT, NgZone, PLATFORM_ID]
  3144. },
  3145. { provide: EVENT_MANAGER_PLUGINS, useClass: KeyEventsPlugin, multi: true, deps: [DOCUMENT] },
  3146. {
  3147. provide: EVENT_MANAGER_PLUGINS,
  3148. useClass: HammerGesturesPlugin,
  3149. multi: true,
  3150. deps: [DOCUMENT, HAMMER_GESTURE_CONFIG, ɵConsole, [new Optional(), HAMMER_LOADER]]
  3151. },
  3152. { provide: HAMMER_GESTURE_CONFIG, useClass: HammerGestureConfig, deps: [] },
  3153. {
  3154. provide: DomRendererFactory2,
  3155. useClass: DomRendererFactory2,
  3156. deps: [EventManager, DomSharedStylesHost, APP_ID]
  3157. },
  3158. { provide: RendererFactory2, useExisting: DomRendererFactory2 },
  3159. { provide: SharedStylesHost, useExisting: DomSharedStylesHost },
  3160. { provide: DomSharedStylesHost, useClass: DomSharedStylesHost, deps: [DOCUMENT] },
  3161. { provide: Testability, useClass: Testability, deps: [NgZone] },
  3162. { provide: EventManager, useClass: EventManager, deps: [EVENT_MANAGER_PLUGINS, NgZone] },
  3163. ELEMENT_PROBE_PROVIDERS,
  3164. ];
  3165. /**
  3166. * Exports required infrastructure for all Angular apps.
  3167. * Included by default in all Angular apps created with the CLI
  3168. * `new` command.
  3169. * Re-exports `CommonModule` and `ApplicationModule`, making their
  3170. * exports and providers available to all apps.
  3171. *
  3172. * \@publicApi
  3173. */
  3174. class BrowserModule {
  3175. /**
  3176. * @param {?} parentModule
  3177. */
  3178. constructor(parentModule) {
  3179. if (parentModule) {
  3180. throw new Error(`BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.`);
  3181. }
  3182. }
  3183. /**
  3184. * Configures a browser-based app to transition from a server-rendered app, if
  3185. * one is present on the page.
  3186. *
  3187. * @param {?} params An object containing an identifier for the app to transition.
  3188. * The ID must match between the client and server versions of the app.
  3189. * @return {?} The reconfigured `BrowserModule` to import into the app's root `AppModule`.
  3190. */
  3191. static withServerTransition(params) {
  3192. return {
  3193. ngModule: BrowserModule,
  3194. providers: [
  3195. { provide: APP_ID, useValue: params.appId },
  3196. { provide: TRANSITION_ID, useExisting: APP_ID },
  3197. SERVER_TRANSITION_PROVIDERS,
  3198. ],
  3199. };
  3200. }
  3201. }
  3202. BrowserModule.decorators = [
  3203. { type: NgModule, args: [{ providers: BROWSER_MODULE_PROVIDERS, exports: [CommonModule, ApplicationModule] },] }
  3204. ];
  3205. /** @nocollapse */
  3206. BrowserModule.ctorParameters = () => [
  3207. { type: undefined, decorators: [{ type: Optional }, { type: SkipSelf }, { type: Inject, args: [BrowserModule,] }] }
  3208. ];
  3209. /**
  3210. * @fileoverview added by tsickle
  3211. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  3212. */
  3213. /**
  3214. * Factory to create Meta service.
  3215. * @return {?}
  3216. */
  3217. function createMeta() {
  3218. return new Meta(ɵɵinject(DOCUMENT));
  3219. }
  3220. /**
  3221. * A service that can be used to get and add meta tags.
  3222. *
  3223. * \@publicApi
  3224. */
  3225. class Meta {
  3226. /**
  3227. * @param {?} _doc
  3228. */
  3229. constructor(_doc) {
  3230. this._doc = _doc;
  3231. this._dom = getDOM();
  3232. }
  3233. /**
  3234. * @param {?} tag
  3235. * @param {?=} forceCreation
  3236. * @return {?}
  3237. */
  3238. addTag(tag, forceCreation = false) {
  3239. if (!tag)
  3240. return null;
  3241. return this._getOrCreateElement(tag, forceCreation);
  3242. }
  3243. /**
  3244. * @param {?} tags
  3245. * @param {?=} forceCreation
  3246. * @return {?}
  3247. */
  3248. addTags(tags, forceCreation = false) {
  3249. if (!tags)
  3250. return [];
  3251. return tags.reduce((/**
  3252. * @param {?} result
  3253. * @param {?} tag
  3254. * @return {?}
  3255. */
  3256. (result, tag) => {
  3257. if (tag) {
  3258. result.push(this._getOrCreateElement(tag, forceCreation));
  3259. }
  3260. return result;
  3261. }), []);
  3262. }
  3263. /**
  3264. * @param {?} attrSelector
  3265. * @return {?}
  3266. */
  3267. getTag(attrSelector) {
  3268. if (!attrSelector)
  3269. return null;
  3270. return this._dom.querySelector(this._doc, `meta[${attrSelector}]`) || null;
  3271. }
  3272. /**
  3273. * @param {?} attrSelector
  3274. * @return {?}
  3275. */
  3276. getTags(attrSelector) {
  3277. if (!attrSelector)
  3278. return [];
  3279. /** @type {?} */
  3280. const list /*NodeList*/ = this._dom.querySelectorAll(this._doc, `meta[${attrSelector}]`);
  3281. return list ? [].slice.call(list) : [];
  3282. }
  3283. /**
  3284. * @param {?} tag
  3285. * @param {?=} selector
  3286. * @return {?}
  3287. */
  3288. updateTag(tag, selector) {
  3289. if (!tag)
  3290. return null;
  3291. selector = selector || this._parseSelector(tag);
  3292. /** @type {?} */
  3293. const meta = (/** @type {?} */ (this.getTag(selector)));
  3294. if (meta) {
  3295. return this._setMetaElementAttributes(tag, meta);
  3296. }
  3297. return this._getOrCreateElement(tag, true);
  3298. }
  3299. /**
  3300. * @param {?} attrSelector
  3301. * @return {?}
  3302. */
  3303. removeTag(attrSelector) { this.removeTagElement((/** @type {?} */ (this.getTag(attrSelector)))); }
  3304. /**
  3305. * @param {?} meta
  3306. * @return {?}
  3307. */
  3308. removeTagElement(meta) {
  3309. if (meta) {
  3310. this._dom.remove(meta);
  3311. }
  3312. }
  3313. /**
  3314. * @private
  3315. * @param {?} meta
  3316. * @param {?=} forceCreation
  3317. * @return {?}
  3318. */
  3319. _getOrCreateElement(meta, forceCreation = false) {
  3320. if (!forceCreation) {
  3321. /** @type {?} */
  3322. const selector = this._parseSelector(meta);
  3323. /** @type {?} */
  3324. const elem = (/** @type {?} */ (this.getTag(selector)));
  3325. // It's allowed to have multiple elements with the same name so it's not enough to
  3326. // just check that element with the same name already present on the page. We also need to
  3327. // check if element has tag attributes
  3328. if (elem && this._containsAttributes(meta, elem))
  3329. return elem;
  3330. }
  3331. /** @type {?} */
  3332. const element = (/** @type {?} */ (this._dom.createElement('meta')));
  3333. this._setMetaElementAttributes(meta, element);
  3334. /** @type {?} */
  3335. const head = this._dom.getElementsByTagName(this._doc, 'head')[0];
  3336. this._dom.appendChild(head, element);
  3337. return element;
  3338. }
  3339. /**
  3340. * @private
  3341. * @param {?} tag
  3342. * @param {?} el
  3343. * @return {?}
  3344. */
  3345. _setMetaElementAttributes(tag, el) {
  3346. Object.keys(tag).forEach((/**
  3347. * @param {?} prop
  3348. * @return {?}
  3349. */
  3350. (prop) => this._dom.setAttribute(el, prop, tag[prop])));
  3351. return el;
  3352. }
  3353. /**
  3354. * @private
  3355. * @param {?} tag
  3356. * @return {?}
  3357. */
  3358. _parseSelector(tag) {
  3359. /** @type {?} */
  3360. const attr = tag.name ? 'name' : 'property';
  3361. return `${attr}="${tag[attr]}"`;
  3362. }
  3363. /**
  3364. * @private
  3365. * @param {?} tag
  3366. * @param {?} elem
  3367. * @return {?}
  3368. */
  3369. _containsAttributes(tag, elem) {
  3370. return Object.keys(tag).every((/**
  3371. * @param {?} key
  3372. * @return {?}
  3373. */
  3374. (key) => this._dom.getAttribute(elem, key) === tag[key]));
  3375. }
  3376. }
  3377. Meta.decorators = [
  3378. { type: Injectable, args: [{ providedIn: 'root', useFactory: createMeta, deps: [] },] }
  3379. ];
  3380. /** @nocollapse */
  3381. Meta.ctorParameters = () => [
  3382. { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
  3383. ];
  3384. /** @nocollapse */ Meta.ngInjectableDef = ɵɵdefineInjectable({ factory: createMeta, token: Meta, providedIn: "root" });
  3385. /**
  3386. * @fileoverview added by tsickle
  3387. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  3388. */
  3389. /**
  3390. * Factory to create Title service.
  3391. * @return {?}
  3392. */
  3393. function createTitle() {
  3394. return new Title(ɵɵinject(DOCUMENT));
  3395. }
  3396. /**
  3397. * A service that can be used to get and set the title of a current HTML document.
  3398. *
  3399. * Since an Angular application can't be bootstrapped on the entire HTML document (`<html>` tag)
  3400. * it is not possible to bind to the `text` property of the `HTMLTitleElement` elements
  3401. * (representing the `<title>` tag). Instead, this service can be used to set and get the current
  3402. * title value.
  3403. *
  3404. * \@publicApi
  3405. */
  3406. class Title {
  3407. /**
  3408. * @param {?} _doc
  3409. */
  3410. constructor(_doc) {
  3411. this._doc = _doc;
  3412. }
  3413. /**
  3414. * Get the title of the current HTML document.
  3415. * @return {?}
  3416. */
  3417. getTitle() { return getDOM().getTitle(this._doc); }
  3418. /**
  3419. * Set the title of the current HTML document.
  3420. * @param {?} newTitle
  3421. * @return {?}
  3422. */
  3423. setTitle(newTitle) { getDOM().setTitle(this._doc, newTitle); }
  3424. }
  3425. Title.decorators = [
  3426. { type: Injectable, args: [{ providedIn: 'root', useFactory: createTitle, deps: [] },] }
  3427. ];
  3428. /** @nocollapse */
  3429. Title.ctorParameters = () => [
  3430. { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
  3431. ];
  3432. /** @nocollapse */ Title.ngInjectableDef = ɵɵdefineInjectable({ factory: createTitle, token: Title, providedIn: "root" });
  3433. /**
  3434. * @fileoverview added by tsickle
  3435. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  3436. */
  3437. /**
  3438. * @license
  3439. * Copyright Google Inc. All Rights Reserved.
  3440. *
  3441. * Use of this source code is governed by an MIT-style license that can be
  3442. * found in the LICENSE file at https://angular.io/license
  3443. */
  3444. /** @type {?} */
  3445. const win = typeof window !== 'undefined' && window || (/** @type {?} */ ({}));
  3446. /**
  3447. * @fileoverview added by tsickle
  3448. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  3449. */
  3450. class ChangeDetectionPerfRecord {
  3451. /**
  3452. * @param {?} msPerTick
  3453. * @param {?} numTicks
  3454. */
  3455. constructor(msPerTick, numTicks) {
  3456. this.msPerTick = msPerTick;
  3457. this.numTicks = numTicks;
  3458. }
  3459. }
  3460. /**
  3461. * Entry point for all Angular profiling-related debug tools. This object
  3462. * corresponds to the `ng.profiler` in the dev console.
  3463. */
  3464. class AngularProfiler {
  3465. /**
  3466. * @param {?} ref
  3467. */
  3468. constructor(ref) { this.appRef = ref.injector.get(ApplicationRef); }
  3469. // tslint:disable:no-console
  3470. /**
  3471. * Exercises change detection in a loop and then prints the average amount of
  3472. * time in milliseconds how long a single round of change detection takes for
  3473. * the current state of the UI. It runs a minimum of 5 rounds for a minimum
  3474. * of 500 milliseconds.
  3475. *
  3476. * Optionally, a user may pass a `config` parameter containing a map of
  3477. * options. Supported options are:
  3478. *
  3479. * `record` (boolean) - causes the profiler to record a CPU profile while
  3480. * it exercises the change detector. Example:
  3481. *
  3482. * ```
  3483. * ng.profiler.timeChangeDetection({record: true})
  3484. * ```
  3485. * @param {?} config
  3486. * @return {?}
  3487. */
  3488. timeChangeDetection(config) {
  3489. /** @type {?} */
  3490. const record = config && config['record'];
  3491. /** @type {?} */
  3492. const profileName = 'Change Detection';
  3493. // Profiler is not available in Android browsers, nor in IE 9 without dev tools opened
  3494. /** @type {?} */
  3495. const isProfilerAvailable = win.console.profile != null;
  3496. if (record && isProfilerAvailable) {
  3497. win.console.profile(profileName);
  3498. }
  3499. /** @type {?} */
  3500. const start = getDOM().performanceNow();
  3501. /** @type {?} */
  3502. let numTicks = 0;
  3503. while (numTicks < 5 || (getDOM().performanceNow() - start) < 500) {
  3504. this.appRef.tick();
  3505. numTicks++;
  3506. }
  3507. /** @type {?} */
  3508. const end = getDOM().performanceNow();
  3509. if (record && isProfilerAvailable) {
  3510. win.console.profileEnd(profileName);
  3511. }
  3512. /** @type {?} */
  3513. const msPerTick = (end - start) / numTicks;
  3514. win.console.log(`ran ${numTicks} change detection cycles`);
  3515. win.console.log(`${msPerTick.toFixed(2)} ms per check`);
  3516. return new ChangeDetectionPerfRecord(msPerTick, numTicks);
  3517. }
  3518. }
  3519. /**
  3520. * @fileoverview added by tsickle
  3521. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  3522. */
  3523. /** @type {?} */
  3524. const PROFILER_GLOBAL_NAME = 'profiler';
  3525. /**
  3526. * Enabled Angular debug tools that are accessible via your browser's
  3527. * developer console.
  3528. *
  3529. * Usage:
  3530. *
  3531. * 1. Open developer console (e.g. in Chrome Ctrl + Shift + j)
  3532. * 1. Type `ng.` (usually the console will show auto-complete suggestion)
  3533. * 1. Try the change detection profiler `ng.profiler.timeChangeDetection()`
  3534. * then hit Enter.
  3535. *
  3536. * \@publicApi
  3537. * @template T
  3538. * @param {?} ref
  3539. * @return {?}
  3540. */
  3541. function enableDebugTools(ref) {
  3542. exportNgVar(PROFILER_GLOBAL_NAME, new AngularProfiler(ref));
  3543. return ref;
  3544. }
  3545. /**
  3546. * Disables Angular tools.
  3547. *
  3548. * \@publicApi
  3549. * @return {?}
  3550. */
  3551. function disableDebugTools() {
  3552. exportNgVar(PROFILER_GLOBAL_NAME, null);
  3553. }
  3554. /**
  3555. * @fileoverview added by tsickle
  3556. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  3557. */
  3558. /**
  3559. * @param {?} text
  3560. * @return {?}
  3561. */
  3562. function escapeHtml(text) {
  3563. /** @type {?} */
  3564. const escapedText = {
  3565. '&': '&a;',
  3566. '"': '&q;',
  3567. '\'': '&s;',
  3568. '<': '&l;',
  3569. '>': '&g;',
  3570. };
  3571. return text.replace(/[&"'<>]/g, (/**
  3572. * @param {?} s
  3573. * @return {?}
  3574. */
  3575. s => escapedText[s]));
  3576. }
  3577. /**
  3578. * @param {?} text
  3579. * @return {?}
  3580. */
  3581. function unescapeHtml(text) {
  3582. /** @type {?} */
  3583. const unescapedText = {
  3584. '&a;': '&',
  3585. '&q;': '"',
  3586. '&s;': '\'',
  3587. '&l;': '<',
  3588. '&g;': '>',
  3589. };
  3590. return text.replace(/&[^;]+;/g, (/**
  3591. * @param {?} s
  3592. * @return {?}
  3593. */
  3594. s => unescapedText[s]));
  3595. }
  3596. /**
  3597. * Create a `StateKey<T>` that can be used to store value of type T with `TransferState`.
  3598. *
  3599. * Example:
  3600. *
  3601. * ```
  3602. * const COUNTER_KEY = makeStateKey<number>('counter');
  3603. * let value = 10;
  3604. *
  3605. * transferState.set(COUNTER_KEY, value);
  3606. * ```
  3607. *
  3608. * \@publicApi
  3609. * @template T
  3610. * @param {?} key
  3611. * @return {?}
  3612. */
  3613. function makeStateKey(key) {
  3614. return (/** @type {?} */ (key));
  3615. }
  3616. /**
  3617. * A key value store that is transferred from the application on the server side to the application
  3618. * on the client side.
  3619. *
  3620. * `TransferState` will be available as an injectable token. To use it import
  3621. * `ServerTransferStateModule` on the server and `BrowserTransferStateModule` on the client.
  3622. *
  3623. * The values in the store are serialized/deserialized using JSON.stringify/JSON.parse. So only
  3624. * boolean, number, string, null and non-class objects will be serialized and deserialzied in a
  3625. * non-lossy manner.
  3626. *
  3627. * \@publicApi
  3628. */
  3629. class TransferState {
  3630. constructor() {
  3631. this.store = {};
  3632. this.onSerializeCallbacks = {};
  3633. }
  3634. /**
  3635. * \@internal
  3636. * @param {?} initState
  3637. * @return {?}
  3638. */
  3639. static init(initState) {
  3640. /** @type {?} */
  3641. const transferState = new TransferState();
  3642. transferState.store = initState;
  3643. return transferState;
  3644. }
  3645. /**
  3646. * Get the value corresponding to a key. Return `defaultValue` if key is not found.
  3647. * @template T
  3648. * @param {?} key
  3649. * @param {?} defaultValue
  3650. * @return {?}
  3651. */
  3652. get(key, defaultValue) {
  3653. return this.store[key] !== undefined ? (/** @type {?} */ (this.store[key])) : defaultValue;
  3654. }
  3655. /**
  3656. * Set the value corresponding to a key.
  3657. * @template T
  3658. * @param {?} key
  3659. * @param {?} value
  3660. * @return {?}
  3661. */
  3662. set(key, value) { this.store[key] = value; }
  3663. /**
  3664. * Remove a key from the store.
  3665. * @template T
  3666. * @param {?} key
  3667. * @return {?}
  3668. */
  3669. remove(key) { delete this.store[key]; }
  3670. /**
  3671. * Test whether a key exists in the store.
  3672. * @template T
  3673. * @param {?} key
  3674. * @return {?}
  3675. */
  3676. hasKey(key) { return this.store.hasOwnProperty(key); }
  3677. /**
  3678. * Register a callback to provide the value for a key when `toJson` is called.
  3679. * @template T
  3680. * @param {?} key
  3681. * @param {?} callback
  3682. * @return {?}
  3683. */
  3684. onSerialize(key, callback) {
  3685. this.onSerializeCallbacks[key] = callback;
  3686. }
  3687. /**
  3688. * Serialize the current state of the store to JSON.
  3689. * @return {?}
  3690. */
  3691. toJson() {
  3692. // Call the onSerialize callbacks and put those values into the store.
  3693. for (const key in this.onSerializeCallbacks) {
  3694. if (this.onSerializeCallbacks.hasOwnProperty(key)) {
  3695. try {
  3696. this.store[key] = this.onSerializeCallbacks[key]();
  3697. }
  3698. catch (e) {
  3699. console.warn('Exception in onSerialize callback: ', e);
  3700. }
  3701. }
  3702. }
  3703. return JSON.stringify(this.store);
  3704. }
  3705. }
  3706. TransferState.decorators = [
  3707. { type: Injectable }
  3708. ];
  3709. /**
  3710. * @param {?} doc
  3711. * @param {?} appId
  3712. * @return {?}
  3713. */
  3714. function initTransferState(doc, appId) {
  3715. // Locate the script tag with the JSON data transferred from the server.
  3716. // The id of the script tag is set to the Angular appId + 'state'.
  3717. /** @type {?} */
  3718. const script = doc.getElementById(appId + '-state');
  3719. /** @type {?} */
  3720. let initialState = {};
  3721. if (script && script.textContent) {
  3722. try {
  3723. initialState = JSON.parse(unescapeHtml(script.textContent));
  3724. }
  3725. catch (e) {
  3726. console.warn('Exception while restoring TransferState for app ' + appId, e);
  3727. }
  3728. }
  3729. return TransferState.init(initialState);
  3730. }
  3731. /**
  3732. * NgModule to install on the client side while using the `TransferState` to transfer state from
  3733. * server to client.
  3734. *
  3735. * \@publicApi
  3736. */
  3737. class BrowserTransferStateModule {
  3738. }
  3739. BrowserTransferStateModule.decorators = [
  3740. { type: NgModule, args: [{
  3741. providers: [{ provide: TransferState, useFactory: initTransferState, deps: [DOCUMENT, APP_ID] }],
  3742. },] }
  3743. ];
  3744. /**
  3745. * @fileoverview added by tsickle
  3746. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  3747. */
  3748. /**
  3749. * Predicates for use with {\@link DebugElement}'s query functions.
  3750. *
  3751. * \@publicApi
  3752. */
  3753. class By {
  3754. /**
  3755. * Match all elements.
  3756. *
  3757. * \@usageNotes
  3758. * ### Example
  3759. *
  3760. * {\@example platform-browser/dom/debug/ts/by/by.ts region='by_all'}
  3761. * @return {?}
  3762. */
  3763. static all() { return (/**
  3764. * @param {?} debugElement
  3765. * @return {?}
  3766. */
  3767. (debugElement) => true); }
  3768. /**
  3769. * Match elements by the given CSS selector.
  3770. *
  3771. * \@usageNotes
  3772. * ### Example
  3773. *
  3774. * {\@example platform-browser/dom/debug/ts/by/by.ts region='by_css'}
  3775. * @param {?} selector
  3776. * @return {?}
  3777. */
  3778. static css(selector) {
  3779. return (/**
  3780. * @param {?} debugElement
  3781. * @return {?}
  3782. */
  3783. (debugElement) => {
  3784. return debugElement.nativeElement != null ?
  3785. getDOM().elementMatches(debugElement.nativeElement, selector) :
  3786. false;
  3787. });
  3788. }
  3789. /**
  3790. * Match elements that have the given directive present.
  3791. *
  3792. * \@usageNotes
  3793. * ### Example
  3794. *
  3795. * {\@example platform-browser/dom/debug/ts/by/by.ts region='by_directive'}
  3796. * @param {?} type
  3797. * @return {?}
  3798. */
  3799. static directive(type) {
  3800. return (/**
  3801. * @param {?} debugElement
  3802. * @return {?}
  3803. */
  3804. (debugElement) => (/** @type {?} */ (debugElement.providerTokens)).indexOf(type) !== -1);
  3805. }
  3806. }
  3807. /**
  3808. * @fileoverview added by tsickle
  3809. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  3810. */
  3811. /**
  3812. * @fileoverview added by tsickle
  3813. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  3814. */
  3815. /**
  3816. * \@publicApi
  3817. * @type {?}
  3818. */
  3819. const VERSION = new Version('8.1.3');
  3820. /**
  3821. * @fileoverview added by tsickle
  3822. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  3823. */
  3824. /**
  3825. * @fileoverview added by tsickle
  3826. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  3827. */
  3828. /**
  3829. * @fileoverview added by tsickle
  3830. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  3831. */
  3832. /**
  3833. * Generated bundle index. Do not edit.
  3834. */
  3835. export { BROWSER_MODULE_PROVIDERS as ɵangular_packages_platform_browser_platform_browser_c, _document as ɵangular_packages_platform_browser_platform_browser_b, errorHandler as ɵangular_packages_platform_browser_platform_browser_a, GenericBrowserDomAdapter as ɵangular_packages_platform_browser_platform_browser_l, createMeta as ɵangular_packages_platform_browser_platform_browser_d, SERVER_TRANSITION_PROVIDERS as ɵangular_packages_platform_browser_platform_browser_i, appInitializerFactory as ɵangular_packages_platform_browser_platform_browser_h, createTitle as ɵangular_packages_platform_browser_platform_browser_e, initTransferState as ɵangular_packages_platform_browser_platform_browser_f, ELEMENT_PROBE_PROVIDERS__PRE_R3__ as ɵangular_packages_platform_browser_platform_browser_k, _createNgProbe as ɵangular_packages_platform_browser_platform_browser_j, EventManagerPlugin as ɵangular_packages_platform_browser_platform_browser_g, BrowserModule, platformBrowser, Meta, Title, disableDebugTools, enableDebugTools, BrowserTransferStateModule, TransferState, makeStateKey, By, EVENT_MANAGER_PLUGINS, EventManager, HAMMER_GESTURE_CONFIG, HAMMER_LOADER, HammerGestureConfig, DomSanitizer, VERSION, ELEMENT_PROBE_PROVIDERS__POST_R3__ as ɵELEMENT_PROBE_PROVIDERS__POST_R3__, BROWSER_SANITIZATION_PROVIDERS as ɵBROWSER_SANITIZATION_PROVIDERS, INTERNAL_BROWSER_PLATFORM_PROVIDERS as ɵINTERNAL_BROWSER_PLATFORM_PROVIDERS, initDomAdapter as ɵinitDomAdapter, BrowserDomAdapter as ɵBrowserDomAdapter, BrowserPlatformLocation as ɵBrowserPlatformLocation, TRANSITION_ID as ɵTRANSITION_ID, BrowserGetTestability as ɵBrowserGetTestability, escapeHtml as ɵescapeHtml, ELEMENT_PROBE_PROVIDERS as ɵELEMENT_PROBE_PROVIDERS, DomAdapter as ɵDomAdapter, getDOM as ɵgetDOM, setRootDomAdapter as ɵsetRootDomAdapter, DomRendererFactory2 as ɵDomRendererFactory2, NAMESPACE_URIS as ɵNAMESPACE_URIS, flattenStyles as ɵflattenStyles, shimContentAttribute as ɵshimContentAttribute, shimHostAttribute as ɵshimHostAttribute, DomEventsPlugin as ɵDomEventsPlugin, HammerGesturesPlugin as ɵHammerGesturesPlugin, KeyEventsPlugin as ɵKeyEventsPlugin, DomSharedStylesHost as ɵDomSharedStylesHost, SharedStylesHost as ɵSharedStylesHost, DomSanitizerImpl as ɵDomSanitizerImpl };
  3836. //# sourceMappingURL=platform-browser.js.map