@angular/platform-server
Version:
Angular - library for using Angular in Node.js
1 lines • 64.5 kB
Source Map (JSON)
{"version":3,"file":"platform-server.mjs","sources":["../../../../../../packages/platform-server/src/domino_adapter.ts","../../../../../../packages/platform-server/src/platform_state.ts","../../../../../../packages/platform-server/src/tokens.ts","../../../../../../packages/platform-server/src/http.ts","../../../../../../packages/platform-server/src/location.ts","../../../../../../packages/platform-server/src/server_events.ts","../../../../../../packages/platform-server/src/server_renderer.ts","../../../../../../packages/platform-server/src/styles_host.ts","../../../../../../packages/platform-server/src/server.ts","../../../../../../packages/platform-server/src/transfer_state.ts","../../../../../../packages/platform-server/src/utils.ts","../../../../../../packages/platform-server/src/private_export.ts","../../../../../../packages/platform-server/src/version.ts","../../../../../../packages/platform-server/src/platform-server.ts","../../../../../../packages/platform-server/public_api.ts","../../../../../../packages/platform-server/index.ts","../../../../../../packages/platform-server/platform-server.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ɵsetRootDomAdapter as setRootDomAdapter} from '@angular/common';\nimport {ɵBrowserDomAdapter as BrowserDomAdapter} from '@angular/platform-browser';\nimport * as domino from 'domino';\n\nexport function setDomTypes() {\n // Make all Domino types available in the global env.\n Object.assign(global, domino.impl);\n (global as any)['KeyboardEvent'] = domino.impl.Event;\n}\n\n/**\n * Parses a document string to a Document object.\n */\nexport function parseDocument(html: string, url = '/') {\n let window = domino.createWindow(html, url);\n let doc = window.document;\n return doc;\n}\n\n/**\n * Serializes a document to string.\n */\nexport function serializeDocument(doc: Document): string {\n return (doc as any).serialize();\n}\n\n/**\n * DOM Adapter for the server platform based on https://github.com/fgnass/domino.\n */\nexport class DominoAdapter extends BrowserDomAdapter {\n static override makeCurrent() {\n setDomTypes();\n setRootDomAdapter(new DominoAdapter());\n }\n\n override readonly supportsDOMEvents = false;\n private static defaultDoc: Document;\n\n override createHtmlDocument(): HTMLDocument {\n return parseDocument('<html><head><title>fakeTitle</title></head><body></body></html>');\n }\n\n override getDefaultDocument(): Document {\n if (!DominoAdapter.defaultDoc) {\n DominoAdapter.defaultDoc = domino.createDocument();\n }\n return DominoAdapter.defaultDoc;\n }\n\n override isElementNode(node: any): boolean {\n return node ? node.nodeType === DominoAdapter.defaultDoc.ELEMENT_NODE : false;\n }\n override isShadowRoot(node: any): boolean {\n return node.shadowRoot == node;\n }\n\n /** @deprecated No longer being used in Ivy code. To be removed in version 14. */\n override getGlobalEventTarget(doc: Document, target: string): EventTarget|null {\n if (target === 'window') {\n return doc.defaultView;\n }\n if (target === 'document') {\n return doc;\n }\n if (target === 'body') {\n return doc.body;\n }\n return null;\n }\n\n override getBaseHref(doc: Document): string {\n // TODO(alxhub): Need relative path logic from BrowserDomAdapter here?\n return doc.documentElement!.querySelector('base')?.getAttribute('href') || '';\n }\n\n override dispatchEvent(el: Node, evt: any) {\n el.dispatchEvent(evt);\n\n // Dispatch the event to the window also.\n const doc = el.ownerDocument || el;\n const win = (doc as any).defaultView;\n if (win) {\n win.dispatchEvent(evt);\n }\n }\n\n override getUserAgent(): string {\n return 'Fake user agent';\n }\n\n override getCookie(name: string): string {\n throw new Error('getCookie has not been implemented');\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {DOCUMENT} from '@angular/common';\nimport {Inject, Injectable} from '@angular/core';\n\nimport {serializeDocument} from './domino_adapter';\n\n/**\n * Representation of the current platform state.\n *\n * @publicApi\n */\n@Injectable()\nexport class PlatformState {\n constructor(@Inject(DOCUMENT) private _doc: any) {}\n\n /**\n * Renders the current state of the platform to string.\n */\n renderToString(): string {\n return serializeDocument(this._doc);\n }\n\n /**\n * Returns the current DOM state.\n */\n getDocument(): any {\n return this._doc;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {InjectionToken} from '@angular/core';\n\n/**\n * Config object passed to initialize the platform.\n *\n * @publicApi\n */\nexport interface PlatformConfig {\n /**\n * The initial DOM to use to bootstrap the server application.\n * @default create a new DOM using Domino\n */\n document?: string;\n /**\n * The URL for the current application state. This is used for initializing\n * the platform's location. `protocol`, `hostname`, and `port` will be\n * overridden if `baseUrl` is set.\n * @default none\n */\n url?: string;\n /**\n * Whether to append the absolute URL to any relative HTTP requests. If set to\n * true, this logic executes prior to any HTTP interceptors that may run later\n * on in the request. `baseUrl` must be supplied if this flag is enabled.\n * @default false\n */\n useAbsoluteUrl?: boolean;\n /**\n * The base URL for resolving absolute URL for HTTP requests. It must be set\n * if `useAbsoluteUrl` is true, and must consist of protocol, hostname,\n * and optional port. This option has no effect if `useAbsoluteUrl` is not\n * enabled.\n */\n baseUrl?: string;\n}\n\n/**\n * The DI token for setting the initial config for the platform.\n *\n * @publicApi\n */\nexport const INITIAL_CONFIG = new InjectionToken<PlatformConfig>('Server.INITIAL_CONFIG');\n\n/**\n * A function that will be executed when calling `renderModuleFactory` or `renderModule` just\n * before current platform state is rendered to string.\n *\n * @publicApi\n */\nexport const BEFORE_APP_SERIALIZED =\n new InjectionToken<Array<() => void | Promise<void>>>('Server.RENDER_MODULE_HOOK');\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {PlatformLocation, XhrFactory} from '@angular/common';\nimport {HttpBackend, HttpEvent, HttpHandler, HttpRequest, ɵHttpInterceptingHandler as HttpInterceptingHandler} from '@angular/common/http';\nimport {Injectable, Injector, Provider} from '@angular/core';\nimport {Observable, Observer, Subscription} from 'rxjs';\nimport * as xhr2 from 'xhr2';\n\nimport {INITIAL_CONFIG, PlatformConfig} from './tokens';\n\n// @see https://www.w3.org/Protocols/HTTP/1.1/draft-ietf-http-v11-spec-01#URI-syntax\nconst isAbsoluteUrl = /^[a-zA-Z\\-\\+.]+:\\/\\//;\n\n@Injectable()\nexport class ServerXhr implements XhrFactory {\n build(): XMLHttpRequest {\n return new xhr2.XMLHttpRequest();\n }\n}\n\nexport abstract class ZoneMacroTaskWrapper<S, R> {\n wrap(request: S): Observable<R> {\n return new Observable((observer: Observer<R>) => {\n let task: Task = null!;\n let scheduled: boolean = false;\n let sub: Subscription|null = null;\n let savedResult: any = null;\n let savedError: any = null;\n\n const scheduleTask = (_task: Task) => {\n task = _task;\n scheduled = true;\n\n const delegate = this.delegate(request);\n sub = delegate.subscribe(\n res => savedResult = res,\n err => {\n if (!scheduled) {\n throw new Error(\n 'An http observable was completed twice. This shouldn\\'t happen, please file a bug.');\n }\n savedError = err;\n scheduled = false;\n task.invoke();\n },\n () => {\n if (!scheduled) {\n throw new Error(\n 'An http observable was completed twice. This shouldn\\'t happen, please file a bug.');\n }\n scheduled = false;\n task.invoke();\n });\n };\n\n const cancelTask = (_task: Task) => {\n if (!scheduled) {\n return;\n }\n scheduled = false;\n if (sub) {\n sub.unsubscribe();\n sub = null;\n }\n };\n\n const onComplete = () => {\n if (savedError !== null) {\n observer.error(savedError);\n } else {\n observer.next(savedResult);\n observer.complete();\n }\n };\n\n // MockBackend for Http is synchronous, which means that if scheduleTask is by\n // scheduleMacroTask, the request will hit MockBackend and the response will be\n // sent, causing task.invoke() to be called.\n const _task = Zone.current.scheduleMacroTask(\n 'ZoneMacroTaskWrapper.subscribe', onComplete, {}, () => null, cancelTask);\n scheduleTask(_task);\n\n return () => {\n if (scheduled && task) {\n task.zone.cancelTask(task);\n scheduled = false;\n }\n if (sub) {\n sub.unsubscribe();\n sub = null;\n }\n };\n });\n }\n\n protected abstract delegate(request: S): Observable<R>;\n}\n\nexport class ZoneClientBackend extends\n ZoneMacroTaskWrapper<HttpRequest<any>, HttpEvent<any>> implements HttpBackend {\n constructor(\n private backend: HttpBackend, private platformLocation: PlatformLocation,\n private config: PlatformConfig) {\n super();\n }\n\n handle(request: HttpRequest<any>): Observable<HttpEvent<any>> {\n const {href, protocol, hostname, port} = this.platformLocation;\n if (this.config.useAbsoluteUrl && !isAbsoluteUrl.test(request.url) &&\n isAbsoluteUrl.test(href)) {\n const baseHref = this.platformLocation.getBaseHrefFromDOM() || href;\n const urlPrefix = `${protocol}//${hostname}` + (port ? `:${port}` : '');\n const baseUrl = new URL(baseHref, urlPrefix);\n const url = new URL(request.url, baseUrl);\n return this.wrap(request.clone({url: url.toString()}));\n }\n return this.wrap(request);\n }\n\n protected override delegate(request: HttpRequest<any>): Observable<HttpEvent<any>> {\n return this.backend.handle(request);\n }\n}\n\nexport function zoneWrappedInterceptingHandler(\n backend: HttpBackend, injector: Injector, platformLocation: PlatformLocation,\n config: PlatformConfig) {\n const realBackend: HttpBackend = new HttpInterceptingHandler(backend, injector);\n return new ZoneClientBackend(realBackend, platformLocation, config);\n}\n\nexport const SERVER_HTTP_PROVIDERS: Provider[] = [\n {provide: XhrFactory, useClass: ServerXhr}, {\n provide: HttpHandler,\n useFactory: zoneWrappedInterceptingHandler,\n deps: [HttpBackend, Injector, PlatformLocation, INITIAL_CONFIG]\n }\n];\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {DOCUMENT, LocationChangeEvent, LocationChangeListener, PlatformLocation, ɵgetDOM as getDOM} from '@angular/common';\nimport {Inject, Injectable, Optional} from '@angular/core';\nimport {Subject} from 'rxjs';\nimport * as url from 'url';\nimport {INITIAL_CONFIG, PlatformConfig} from './tokens';\n\nfunction parseUrl(urlStr: string) {\n const parsedUrl = url.parse(urlStr);\n return {\n hostname: parsedUrl.hostname || '',\n protocol: parsedUrl.protocol || '',\n port: parsedUrl.port || '',\n pathname: parsedUrl.pathname || '',\n search: parsedUrl.search || '',\n hash: parsedUrl.hash || '',\n };\n}\n\n/**\n * Server-side implementation of URL state. Implements `pathname`, `search`, and `hash`\n * but not the state stack.\n */\n@Injectable()\nexport class ServerPlatformLocation implements PlatformLocation {\n public readonly href: string = '/';\n public readonly hostname: string = '/';\n public readonly protocol: string = '/';\n public readonly port: string = '/';\n public readonly pathname: string = '/';\n public readonly search: string = '';\n public readonly hash: string = '';\n private _hashUpdate = new Subject<LocationChangeEvent>();\n\n constructor(\n @Inject(DOCUMENT) private _doc: any, @Optional() @Inject(INITIAL_CONFIG) _config: any) {\n const config = _config as PlatformConfig | null;\n if (!config) {\n return;\n }\n if (config.url) {\n const url = parseUrl(config.url);\n this.protocol = url.protocol;\n this.hostname = url.hostname;\n this.port = url.port;\n this.pathname = url.pathname;\n this.search = url.search;\n this.hash = url.hash;\n this.href = _doc.location.href;\n }\n if (config.useAbsoluteUrl) {\n if (!config.baseUrl) {\n throw new Error(`\"PlatformConfig.baseUrl\" must be set if \"useAbsoluteUrl\" is true`);\n }\n const url = parseUrl(config.baseUrl);\n this.protocol = url.protocol;\n this.hostname = url.hostname;\n this.port = url.port;\n }\n }\n\n getBaseHrefFromDOM(): string {\n return getDOM().getBaseHref(this._doc)!;\n }\n\n onPopState(fn: LocationChangeListener): VoidFunction {\n // No-op: a state stack is not implemented, so\n // no events will ever come.\n return () => {};\n }\n\n onHashChange(fn: LocationChangeListener): VoidFunction {\n const subscription = this._hashUpdate.subscribe(fn);\n return () => subscription.unsubscribe();\n }\n\n get url(): string {\n return `${this.pathname}${this.search}${this.hash}`;\n }\n\n private setHash(value: string, oldUrl: string) {\n if (this.hash === value) {\n // Don't fire events if the hash has not changed.\n return;\n }\n (this as {hash: string}).hash = value;\n const newUrl = this.url;\n scheduleMicroTask(\n () => this._hashUpdate.next(\n {type: 'hashchange', state: null, oldUrl, newUrl} as LocationChangeEvent));\n }\n\n replaceState(state: any, title: string, newUrl: string): void {\n const oldUrl = this.url;\n const parsedUrl = parseUrl(newUrl);\n (this as {pathname: string}).pathname = parsedUrl.pathname;\n (this as {search: string}).search = parsedUrl.search;\n this.setHash(parsedUrl.hash, oldUrl);\n }\n\n pushState(state: any, title: string, newUrl: string): void {\n this.replaceState(state, title, newUrl);\n }\n\n forward(): void {\n throw new Error('Not implemented');\n }\n\n back(): void {\n throw new Error('Not implemented');\n }\n\n // History API isn't available on server, therefore return undefined\n getState(): unknown {\n return undefined;\n }\n}\n\nexport function scheduleMicroTask(fn: Function) {\n Zone.current.scheduleMicroTask('scheduleMicrotask', fn);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {DOCUMENT, ɵgetDOM as getDOM} from '@angular/common';\nimport {Inject, Injectable} from '@angular/core';\n\n@Injectable()\nexport class ServerEventManagerPlugin /* extends EventManagerPlugin which is private */ {\n constructor(@Inject(DOCUMENT) private doc: any) {}\n\n // Handle all events on the server.\n supports(eventName: string) {\n return true;\n }\n\n addEventListener(element: HTMLElement, eventName: string, handler: Function): Function {\n return getDOM().onAndCancel(element, eventName, handler);\n }\n\n /** @deprecated No longer being used in Ivy code. To be removed in version 14. */\n addGlobalEventListener(element: string, eventName: string, handler: Function): Function {\n const target: HTMLElement = getDOM().getGlobalEventTarget(this.doc, element);\n if (!target) {\n throw new Error(`Unsupported event target ${target} for event ${eventName}`);\n }\n return this.addEventListener(target, eventName, handler);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {DOCUMENT, ɵgetDOM as getDOM} from '@angular/common';\nimport {DomElementSchemaRegistry} from '@angular/compiler';\nimport {Inject, Injectable, NgZone, Renderer2, RendererFactory2, RendererStyleFlags2, RendererType2, ViewEncapsulation} from '@angular/core';\nimport {EventManager, ɵflattenStyles as flattenStyles, ɵNAMESPACE_URIS as NAMESPACE_URIS, ɵSharedStylesHost as SharedStylesHost, ɵshimContentAttribute as shimContentAttribute, ɵshimHostAttribute as shimHostAttribute} from '@angular/platform-browser';\n\nconst EMPTY_ARRAY: any[] = [];\n\nconst DEFAULT_SCHEMA = new DomElementSchemaRegistry();\n\n@Injectable()\nexport class ServerRendererFactory2 implements RendererFactory2 {\n private rendererByCompId = new Map<string, Renderer2>();\n private defaultRenderer: Renderer2;\n private schema = DEFAULT_SCHEMA;\n\n constructor(\n private eventManager: EventManager, private ngZone: NgZone,\n @Inject(DOCUMENT) private document: any, private sharedStylesHost: SharedStylesHost) {\n this.defaultRenderer = new DefaultServerRenderer2(eventManager, document, ngZone, this.schema);\n }\n\n createRenderer(element: any, type: RendererType2|null): Renderer2 {\n if (!element || !type) {\n return this.defaultRenderer;\n }\n switch (type.encapsulation) {\n case ViewEncapsulation.Emulated: {\n let renderer = this.rendererByCompId.get(type.id);\n if (!renderer) {\n renderer = new EmulatedEncapsulationServerRenderer2(\n this.eventManager, this.document, this.ngZone, this.sharedStylesHost, this.schema,\n type);\n this.rendererByCompId.set(type.id, renderer);\n }\n (<EmulatedEncapsulationServerRenderer2>renderer).applyToHost(element);\n return renderer;\n }\n default: {\n if (!this.rendererByCompId.has(type.id)) {\n const styles = flattenStyles(type.id, type.styles, []);\n this.sharedStylesHost.addStyles(styles);\n this.rendererByCompId.set(type.id, this.defaultRenderer);\n }\n return this.defaultRenderer;\n }\n }\n }\n\n begin() {}\n end() {}\n}\n\nclass DefaultServerRenderer2 implements Renderer2 {\n data: {[key: string]: any} = Object.create(null);\n\n constructor(\n private eventManager: EventManager, protected document: any, private ngZone: NgZone,\n private schema: DomElementSchemaRegistry) {}\n\n destroy(): void {}\n\n destroyNode = null;\n\n createElement(name: string, namespace?: string, debugInfo?: any): any {\n if (namespace) {\n const doc = this.document || getDOM().getDefaultDocument();\n return doc.createElementNS(NAMESPACE_URIS[namespace], name);\n }\n\n return getDOM().createElement(name, this.document);\n }\n\n createComment(value: string, debugInfo?: any): any {\n return getDOM().getDefaultDocument().createComment(value);\n }\n\n createText(value: string, debugInfo?: any): any {\n const doc = getDOM().getDefaultDocument();\n return doc.createTextNode(value);\n }\n\n appendChild(parent: any, newChild: any): void {\n parent.appendChild(newChild);\n }\n\n insertBefore(parent: any, newChild: any, refChild: any): void {\n if (parent) {\n parent.insertBefore(newChild, refChild);\n }\n }\n\n removeChild(parent: any, oldChild: any): void {\n if (parent) {\n parent.removeChild(oldChild);\n }\n }\n\n selectRootElement(selectorOrNode: string|any, debugInfo?: any): any {\n let el: any;\n if (typeof selectorOrNode === 'string') {\n el = this.document.querySelector(selectorOrNode);\n if (!el) {\n throw new Error(`The selector \"${selectorOrNode}\" did not match any elements`);\n }\n } else {\n el = selectorOrNode;\n }\n while (el.firstChild) {\n el.removeChild(el.firstChild);\n }\n return el;\n }\n\n parentNode(node: any): any {\n return node.parentNode;\n }\n\n nextSibling(node: any): any {\n return node.nextSibling;\n }\n\n setAttribute(el: any, name: string, value: string, namespace?: string): void {\n if (namespace) {\n el.setAttributeNS(NAMESPACE_URIS[namespace], namespace + ':' + name, value);\n } else {\n el.setAttribute(name, value);\n }\n }\n\n removeAttribute(el: any, name: string, namespace?: string): void {\n if (namespace) {\n el.removeAttributeNS(NAMESPACE_URIS[namespace], name);\n } else {\n el.removeAttribute(name);\n }\n }\n\n addClass(el: any, name: string): void {\n el.classList.add(name);\n }\n\n removeClass(el: any, name: string): void {\n el.classList.remove(name);\n }\n\n setStyle(el: any, style: string, value: any, flags: RendererStyleFlags2): void {\n style = style.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n const styleMap = _readStyleAttribute(el);\n if (flags & RendererStyleFlags2.Important) {\n value += ' !important';\n }\n styleMap[style] = value == null ? '' : value;\n _writeStyleAttribute(el, styleMap);\n }\n\n removeStyle(el: any, style: string, flags: RendererStyleFlags2): void {\n // IE requires '' instead of null\n // see https://github.com/angular/angular/issues/7916\n this.setStyle(el, style, '', flags);\n }\n\n // The value was validated already as a property binding, against the property name.\n // To know this value is safe to use as an attribute, the security context of the\n // attribute with the given name is checked against that security context of the\n // property.\n private _isSafeToReflectProperty(tagName: string, propertyName: string): boolean {\n return this.schema.securityContext(tagName, propertyName, true) ===\n this.schema.securityContext(tagName, propertyName, false);\n }\n\n setProperty(el: any, name: string, value: any): void {\n checkNoSyntheticProp(name, 'property');\n if (name === 'innerText') {\n // Domino does not support innerText. Just map it to textContent.\n el.textContent = value;\n }\n (<any>el)[name] = value;\n // Mirror property values for known HTML element properties in the attributes.\n // Skip `innerhtml` which is conservatively marked as an attribute for security\n // purposes but is not actually an attribute.\n const tagName = (el.tagName as string).toLowerCase();\n if (value != null && (typeof value === 'number' || typeof value == 'string') &&\n name.toLowerCase() !== 'innerhtml' && this.schema.hasElement(tagName, EMPTY_ARRAY) &&\n this.schema.hasProperty(tagName, name, EMPTY_ARRAY) &&\n this._isSafeToReflectProperty(tagName, name)) {\n this.setAttribute(el, name, value.toString());\n }\n }\n\n setValue(node: any, value: string): void {\n node.textContent = value;\n }\n\n listen(\n target: 'document'|'window'|'body'|any, eventName: string,\n callback: (event: any) => boolean): () => void {\n checkNoSyntheticProp(eventName, 'listener');\n if (typeof target === 'string') {\n return <() => void>this.eventManager.addGlobalEventListener(\n target, eventName, this.decoratePreventDefault(callback));\n }\n return <() => void>this.eventManager.addEventListener(\n target, eventName, this.decoratePreventDefault(callback)) as () => void;\n }\n\n private decoratePreventDefault(eventHandler: Function): Function {\n return (event: any) => {\n // Ivy uses `Function` as a special token that allows us to unwrap the function\n // so that it can be invoked programmatically by `DebugNode.triggerEventHandler`.\n if (event === Function) {\n return eventHandler;\n }\n\n // Run the event handler inside the ngZone because event handlers are not patched\n // by Zone on the server. This is required only for tests.\n const allowDefaultBehavior = this.ngZone.runGuarded(() => eventHandler(event));\n if (allowDefaultBehavior === false) {\n event.preventDefault();\n event.returnValue = false;\n }\n\n return undefined;\n };\n }\n}\n\nconst AT_CHARCODE = '@'.charCodeAt(0);\nfunction checkNoSyntheticProp(name: string, nameKind: string) {\n if (name.charCodeAt(0) === AT_CHARCODE) {\n throw new Error(`Unexpected synthetic ${nameKind} ${name} found. Please make sure that:\n - Either \\`BrowserAnimationsModule\\` or \\`NoopAnimationsModule\\` are imported in your application.\n - There is corresponding configuration for the animation named \\`${\n name}\\` defined in the \\`animations\\` field of the \\`@Component\\` decorator (see https://angular.io/api/core/Component#animations).`);\n }\n}\n\nclass EmulatedEncapsulationServerRenderer2 extends DefaultServerRenderer2 {\n private contentAttr: string;\n private hostAttr: string;\n\n constructor(\n eventManager: EventManager, document: any, ngZone: NgZone, sharedStylesHost: SharedStylesHost,\n schema: DomElementSchemaRegistry, private component: RendererType2) {\n super(eventManager, document, ngZone, schema);\n // Add a 's' prefix to style attributes to indicate server.\n const componentId = 's' + component.id;\n const styles = flattenStyles(componentId, component.styles, []);\n sharedStylesHost.addStyles(styles);\n\n this.contentAttr = shimContentAttribute(componentId);\n this.hostAttr = shimHostAttribute(componentId);\n }\n\n applyToHost(element: any) {\n super.setAttribute(element, this.hostAttr, '');\n }\n\n override createElement(parent: any, name: string): Element {\n const el = super.createElement(parent, name, this.document);\n super.setAttribute(el, this.contentAttr, '');\n return el;\n }\n}\n\nfunction _readStyleAttribute(element: any): {[name: string]: string} {\n const styleMap: {[name: string]: string} = {};\n const styleAttribute = element.getAttribute('style');\n if (styleAttribute) {\n const styleList = styleAttribute.split(/;+/g);\n for (let i = 0; i < styleList.length; i++) {\n const style = styleList[i].trim();\n if (style.length > 0) {\n const colonIndex = style.indexOf(':');\n if (colonIndex === -1) {\n throw new Error(`Invalid CSS style: ${style}`);\n }\n const name = style.substr(0, colonIndex).trim();\n styleMap[name] = style.substr(colonIndex + 1).trim();\n }\n }\n }\n return styleMap;\n}\n\nfunction _writeStyleAttribute(element: any, styleMap: {[name: string]: string}) {\n let styleAttrValue = '';\n for (const key in styleMap) {\n const newValue = styleMap[key];\n if (newValue != null) {\n styleAttrValue += key + ':' + styleMap[key] + ';';\n }\n }\n element.setAttribute('style', styleAttrValue);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {DOCUMENT, ɵgetDOM as getDOM} from '@angular/common';\nimport {Inject, Injectable, Optional} from '@angular/core';\nimport {ɵSharedStylesHost as SharedStylesHost, ɵTRANSITION_ID} from '@angular/platform-browser';\n\n@Injectable()\nexport class ServerStylesHost extends SharedStylesHost {\n private head: any = null;\n private _styleNodes = new Set<HTMLElement>();\n\n constructor(\n @Inject(DOCUMENT) private doc: any,\n @Optional() @Inject(ɵTRANSITION_ID) private transitionId: string) {\n super();\n this.head = doc.getElementsByTagName('head')[0];\n }\n\n private _addStyle(style: string): void {\n let adapter = getDOM();\n const el = adapter.createElement('style');\n el.textContent = style;\n if (!!this.transitionId) {\n el.setAttribute('ng-transition', this.transitionId);\n }\n this.head.appendChild(el);\n this._styleNodes.add(el);\n }\n\n override onStylesAdded(additions: Set<string>) {\n additions.forEach(style => this._addStyle(style));\n }\n\n ngOnDestroy() {\n this._styleNodes.forEach(styleNode => styleNode.remove());\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ɵAnimationEngine} from '@angular/animations/browser';\nimport {DOCUMENT, PlatformLocation, ViewportScroller, ɵgetDOM as getDOM, ɵNullViewportScroller as NullViewportScroller, ɵPLATFORM_SERVER_ID as PLATFORM_SERVER_ID} from '@angular/common';\nimport {HttpClientModule} from '@angular/common/http';\nimport {createPlatformFactory, Injector, NgModule, NgZone, Optional, PLATFORM_ID, PLATFORM_INITIALIZER, platformCore, PlatformRef, Provider, RendererFactory2, StaticProvider, Testability, ɵALLOW_MULTIPLE_PLATFORMS as ALLOW_MULTIPLE_PLATFORMS, ɵsetDocument} from '@angular/core';\nimport {BrowserModule, EVENT_MANAGER_PLUGINS, ɵSharedStylesHost as SharedStylesHost} from '@angular/platform-browser';\nimport {ɵplatformCoreDynamic as platformCoreDynamic} from '@angular/platform-browser-dynamic';\nimport {NoopAnimationsModule, ɵAnimationRendererFactory} from '@angular/platform-browser/animations';\n\nimport {DominoAdapter, parseDocument} from './domino_adapter';\nimport {SERVER_HTTP_PROVIDERS} from './http';\nimport {ServerPlatformLocation} from './location';\nimport {PlatformState} from './platform_state';\nimport {ServerEventManagerPlugin} from './server_events';\nimport {ServerRendererFactory2} from './server_renderer';\nimport {ServerStylesHost} from './styles_host';\nimport {INITIAL_CONFIG, PlatformConfig} from './tokens';\n\nfunction notSupported(feature: string): Error {\n throw new Error(`platform-server does not support '${feature}'.`);\n}\n\nexport const INTERNAL_SERVER_PLATFORM_PROVIDERS: StaticProvider[] = [\n {provide: DOCUMENT, useFactory: _document, deps: [Injector]},\n {provide: PLATFORM_ID, useValue: PLATFORM_SERVER_ID},\n {provide: PLATFORM_INITIALIZER, useFactory: initDominoAdapter, multi: true, deps: [Injector]}, {\n provide: PlatformLocation,\n useClass: ServerPlatformLocation,\n deps: [DOCUMENT, [Optional, INITIAL_CONFIG]]\n },\n {provide: PlatformState, deps: [DOCUMENT]},\n // Add special provider that allows multiple instances of platformServer* to be created.\n {provide: ALLOW_MULTIPLE_PLATFORMS, useValue: true}\n];\n\nfunction initDominoAdapter(injector: Injector) {\n return () => {\n DominoAdapter.makeCurrent();\n };\n}\n\nexport function instantiateServerRendererFactory(\n renderer: RendererFactory2, engine: ɵAnimationEngine, zone: NgZone) {\n return new ɵAnimationRendererFactory(renderer, engine, zone);\n}\n\nexport const SERVER_RENDER_PROVIDERS: Provider[] = [\n ServerRendererFactory2,\n {\n provide: RendererFactory2,\n useFactory: instantiateServerRendererFactory,\n deps: [ServerRendererFactory2, ɵAnimationEngine, NgZone]\n },\n ServerStylesHost,\n {provide: SharedStylesHost, useExisting: ServerStylesHost},\n {provide: EVENT_MANAGER_PLUGINS, multi: true, useClass: ServerEventManagerPlugin},\n];\n\n/**\n * The ng module for the server.\n *\n * @publicApi\n */\n@NgModule({\n exports: [BrowserModule],\n imports: [HttpClientModule, NoopAnimationsModule],\n providers: [\n SERVER_RENDER_PROVIDERS,\n SERVER_HTTP_PROVIDERS,\n {provide: Testability, useValue: null},\n {provide: ViewportScroller, useClass: NullViewportScroller},\n ],\n})\nexport class ServerModule {\n}\n\nfunction _document(injector: Injector) {\n let config: PlatformConfig|null = injector.get(INITIAL_CONFIG, null);\n const document = config && config.document ? parseDocument(config.document, config.url) :\n getDOM().createHtmlDocument();\n // Tell ivy about the global document\n ɵsetDocument(document);\n return document;\n}\n\n/**\n * @publicApi\n */\nexport const platformServer: (extraProviders?: StaticProvider[]|undefined) => PlatformRef =\n createPlatformFactory(platformCore, 'server', INTERNAL_SERVER_PLATFORM_PROVIDERS);\n\n/**\n * The server platform that supports the runtime compiler.\n *\n * @publicApi\n */\nexport const platformDynamicServer =\n createPlatformFactory(platformCoreDynamic, 'serverDynamic', INTERNAL_SERVER_PLATFORM_PROVIDERS);\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {DOCUMENT} from '@angular/common';\nimport {APP_ID, NgModule} from '@angular/core';\nimport {TransferState, ɵescapeHtml as escapeHtml} from '@angular/platform-browser';\n\nimport {BEFORE_APP_SERIALIZED} from './tokens';\n\nexport function serializeTransferStateFactory(\n doc: Document, appId: string, transferStore: TransferState) {\n return () => {\n const script = doc.createElement('script');\n script.id = appId + '-state';\n script.setAttribute('type', 'application/json');\n script.textContent = escapeHtml(transferStore.toJson());\n doc.body.appendChild(script);\n };\n}\n\n/**\n * NgModule to install on the server side while using the `TransferState` to transfer state from\n * server to client.\n *\n * @publicApi\n */\n@NgModule({\n providers: [\n TransferState, {\n provide: BEFORE_APP_SERIALIZED,\n useFactory: serializeTransferStateFactory,\n deps: [DOCUMENT, APP_ID, TransferState],\n multi: true,\n }\n ]\n})\nexport class ServerTransferStateModule {\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ApplicationRef, NgModuleFactory, NgModuleRef, PlatformRef, StaticProvider, Type, ɵisPromise} from '@angular/core';\nimport {ɵTRANSITION_ID} from '@angular/platform-browser';\nimport {first} from 'rxjs/operators';\n\nimport {PlatformState} from './platform_state';\nimport {platformDynamicServer, platformServer} from './server';\nimport {BEFORE_APP_SERIALIZED, INITIAL_CONFIG} from './tokens';\n\ninterface PlatformOptions {\n document?: string;\n url?: string;\n extraProviders?: StaticProvider[];\n}\n\nfunction _getPlatform(\n platformFactory: (extraProviders: StaticProvider[]) => PlatformRef,\n options: PlatformOptions): PlatformRef {\n const extraProviders = options.extraProviders ? options.extraProviders : [];\n return platformFactory([\n {provide: INITIAL_CONFIG, useValue: {document: options.document, url: options.url}},\n extraProviders\n ]);\n}\n\nfunction _render<T>(\n platform: PlatformRef, moduleRefPromise: Promise<NgModuleRef<T>>): Promise<string> {\n return moduleRefPromise.then((moduleRef) => {\n const transitionId = moduleRef.injector.get(ɵTRANSITION_ID, null);\n if (!transitionId) {\n throw new Error(\n `renderModule[Factory]() requires the use of BrowserModule.withServerTransition() to ensure\nthe server-rendered app can be properly bootstrapped into a client app.`);\n }\n const applicationRef: ApplicationRef = moduleRef.injector.get(ApplicationRef);\n return applicationRef.isStable.pipe((first((isStable: boolean) => isStable)))\n .toPromise()\n .then(() => {\n const platformState = platform.injector.get(PlatformState);\n\n const asyncPromises: Promise<any>[] = [];\n\n // Run any BEFORE_APP_SERIALIZED callbacks just before rendering to string.\n const callbacks = moduleRef.injector.get(BEFORE_APP_SERIALIZED, null);\n if (callbacks) {\n for (const callback of callbacks) {\n try {\n const callbackResult = callback();\n if (ɵisPromise(callbackResult)) {\n // TODO: in TS3.7, callbackResult is void.\n asyncPromises.push(callbackResult as any);\n }\n\n } catch (e) {\n // Ignore exceptions.\n console.warn('Ignoring BEFORE_APP_SERIALIZED Exception: ', e);\n }\n }\n }\n\n const complete = () => {\n const output = platformState.renderToString();\n platform.destroy();\n return output;\n };\n\n if (asyncPromises.length === 0) {\n return complete();\n }\n\n return Promise\n .all(asyncPromises.map(asyncPromise => {\n return asyncPromise.catch(e => {\n console.warn('Ignoring BEFORE_APP_SERIALIZED Exception: ', e);\n });\n }))\n .then(complete);\n });\n });\n}\n\n/**\n * Renders a Module to string.\n *\n * `document` is the full document HTML of the page to render, as a string.\n * `url` is the URL for the current render request.\n * `extraProviders` are the platform level providers for the current render request.\n *\n * @publicApi\n */\nexport function renderModule<T>(\n module: Type<T>, options: {document?: string, url?: string, extraProviders?: StaticProvider[]}):\n Promise<string> {\n const platform = _getPlatform(platformDynamicServer, options);\n return _render(platform, platform.bootstrapModule(module));\n}\n\n/**\n * Renders a {@link NgModuleFactory} to string.\n *\n * `document` is the full document HTML of the page to render, as a string.\n * `url` is the URL for the current render request.\n * `extraProviders` are the platform level providers for the current render request.\n *\n * @publicApi\n *\n * @deprecated\n * This symbol is no longer necessary as of Angular v13.\n * Use {@link renderModule} API instead.\n */\nexport function renderModuleFactory<T>(\n moduleFactory: NgModuleFactory<T>,\n options: {document?: string, url?: string, extraProviders?: StaticProvider[]}):\n Promise<string> {\n const platform = _getPlatform(platformServer, options);\n return _render(platform, platform.bootstrapModuleFactory(moduleFactory));\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nexport {INTERNAL_SERVER_PLATFORM_PROVIDERS as ɵINTERNAL_SERVER_PLATFORM_PROVIDERS, SERVER_RENDER_PROVIDERS as ɵSERVER_RENDER_PROVIDERS} from './server';\nexport {ServerRendererFactory2 as ɵServerRendererFactory2} from './server_renderer';\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of the platform-server package.\n */\n\nimport {Version} from '@angular/core';\n\n/**\n * @publicApi\n */\nexport const VERSION = new Version('13.3.8');\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport {PlatformState} from './platform_state';\nexport {platformDynamicServer, platformServer, ServerModule} from './server';\nexport {BEFORE_APP_SERIALIZED, INITIAL_CONFIG, PlatformConfig} from './tokens';\nexport {ServerTransferStateModule} from './transfer_state';\nexport {renderModule, renderModuleFactory} from './utils';\n\nexport * from './private_export';\nexport {VERSION} from './version';\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/// <reference types=\"node\" />\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of this package.\n */\nexport * from './src/platform-server';\n\n// This file only reexports content of the `src` folder. Keep it that way.\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// This file is not used to build this module. It is only used during editing\n// by the TypeScript language service and during build for verification. `ngc`\n// replaces this file with production index.ts when it rewrites private symbol\n// names.\n\nexport * from './public_api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["BrowserDomAdapter","setRootDomAdapter","HttpInterceptingHandler","getDOM","flattenStyles","NAMESPACE_URIS","shimContentAttribute","shimHostAttribute","SharedStylesHost","PLATFORM_SERVER_ID","ALLOW_MULTIPLE_PLATFORMS","NullViewportScroller","platformCoreDynamic","escapeHtml"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;SAYgB,WAAW;;IAEzB,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAClC,MAAc,CAAC,eAAe,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;AACvD,CAAC;AAED;;;SAGgB,aAAa,CAAC,IAAY,EAAE,GAAG,GAAG,GA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