/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import { ApplicationRef, ComponentRef, ErrorHandler, Injectable, Provider, Type, ɵConsole as Console, ɵHydrationStatus as HydrationStatus, ɵreadHydrationInfo as readHydrationInfo, ɵSSR_CONTENT_INTEGRITY_MARKER as SSR_CONTENT_INTEGRITY_MARKER, } from '@angular/core'; import { bootstrapApplication, HydrationFeature, provideClientHydration, HydrationFeatureKind, } from '@angular/platform-browser'; import {provideServerRendering} from '../public_api'; import {EVENT_DISPATCH_SCRIPT_ID, renderApplication} from '../src/utils'; import {getAppContents, stripUtilAttributes} from './dom_utils'; /** * The name of the attribute that contains a slot index * inside the TransferState storage where hydration info * could be found. */ export const NGH_ATTR_NAME = 'ngh'; export const EMPTY_TEXT_NODE_COMMENT = 'ngetn'; export const TEXT_NODE_SEPARATOR_COMMENT = 'ngtns'; export const SKIP_HYDRATION_ATTR_NAME = 'ngSkipHydration'; export const SKIP_HYDRATION_ATTR_NAME_LOWER_CASE: string = SKIP_HYDRATION_ATTR_NAME.toLowerCase(); export const TRANSFER_STATE_TOKEN_ID = '__nghData__'; /** * Represents the `; export const DEFAULT_DOCUMENT = `${EVENT_DISPATCH_SCRIPT}`; export function getComponentRef(appRef: ApplicationRef): ComponentRef { return appRef.components[0]; } export function stripSsrIntegrityMarker(input: string): string { return input.replace(``, ''); } export function stripTransferDataScript(input: string): string { return input.replace(/