@angular/core 20.3.14 → 20.3.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api.d.d.ts +1 -1
- package/chrome_dev_tools_performance.d.d.ts +1 -1
- package/discovery.d.d.ts +1 -1
- package/effect.d.d.ts +1 -1
- package/event_dispatcher.d.d.ts +1 -1
- package/fesm2022/attribute.mjs +1 -1
- package/fesm2022/core.mjs +2 -2
- package/fesm2022/debug_node.mjs +956 -922
- package/fesm2022/debug_node.mjs.map +1 -1
- package/fesm2022/effect.mjs +1 -1
- package/fesm2022/not_found.mjs +1 -1
- package/fesm2022/primitives/di.mjs +1 -1
- package/fesm2022/primitives/event-dispatch.mjs +1 -1
- package/fesm2022/primitives/signals.mjs +1 -1
- package/fesm2022/resource.mjs +1 -1
- package/fesm2022/root_effect_scheduler.mjs +2 -2
- package/fesm2022/root_effect_scheduler.mjs.map +1 -1
- package/fesm2022/rxjs-interop.mjs +1 -1
- package/fesm2022/signal.mjs +1 -1
- package/fesm2022/testing.mjs +1 -1
- package/fesm2022/weak_ref.mjs +1 -1
- package/formatter.d.d.ts +1 -1
- package/index.d.ts +11 -10
- package/package.json +2 -2
- package/primitives/di/index.d.ts +1 -1
- package/primitives/event-dispatch/index.d.ts +1 -1
- package/primitives/signals/index.d.ts +1 -1
- package/rxjs-interop/index.d.ts +1 -1
- package/schematics/bundles/add-bootstrap-context-to-server-main.cjs +5 -5
- package/schematics/bundles/{apply_import_manager-D4J7SXHI.cjs → apply_import_manager-C-hIllzM.cjs} +3 -3
- package/schematics/bundles/cleanup-unused-imports.cjs +5 -5
- package/schematics/bundles/{compiler_host-C306_97v.cjs → compiler_host-C7zi7NDP.cjs} +2 -2
- package/schematics/bundles/control-flow-migration.cjs +3 -3
- package/schematics/bundles/document-core.cjs +5 -5
- package/schematics/bundles/imports-CIX-JgAN.cjs +1 -1
- package/schematics/bundles/{index-u3tqvIQa.cjs → index-BdbAclL_.cjs} +4 -4
- package/schematics/bundles/{index-AeYmwRJL.cjs → index-CEqacA4Q.cjs} +12 -12
- package/schematics/bundles/inject-flags.cjs +5 -5
- package/schematics/bundles/inject-migration.cjs +3 -3
- package/schematics/bundles/leading_space-D9nQ8UQC.cjs +1 -1
- package/schematics/bundles/{migrate_ts_type_references-D0f8FXVW.cjs → migrate_ts_type_references-BJnim1Tm.cjs} +5 -5
- package/schematics/bundles/ng_decorators-B5HCqr20.cjs +1 -1
- package/schematics/bundles/nodes-B16H9JUd.cjs +1 -1
- package/schematics/bundles/output-migration.cjs +6 -6
- package/schematics/bundles/{project_paths-CMd3bdgw.cjs → project_paths-qw-vHpyb.cjs} +3 -3
- package/schematics/bundles/{project_tsconfig_paths-CopGppNj.cjs → project_tsconfig_paths-C5dXM8JP.cjs} +107 -69
- package/schematics/bundles/property_name-BBwFuqMe.cjs +1 -1
- package/schematics/bundles/route-lazy-loading.cjs +3 -3
- package/schematics/bundles/router-current-navigation.cjs +4 -4
- package/schematics/bundles/self-closing-tags-migration.cjs +4 -4
- package/schematics/bundles/signal-input-migration.cjs +7 -7
- package/schematics/bundles/signal-queries-migration.cjs +7 -7
- package/schematics/bundles/signals.cjs +7 -7
- package/schematics/bundles/standalone-migration.cjs +4 -4
- package/schematics/bundles/symbol-VPWguRxr.cjs +1 -1
- package/schematics/bundles/test-bed-get.cjs +4 -4
- package/testing/index.d.ts +1 -1
- package/weak_ref.d.d.ts +1 -1
package/fesm2022/debug_node.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v20.3.
|
|
2
|
+
* @license Angular v20.3.16
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.dev/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { attachInjectFlag, _global, ɵɵdefineInjectable as __defineInjectable, ɵɵdefineInjector as __defineInjector, ɵɵinject as __inject, ɵɵinvalidFactoryDep as __invalidFactoryDep, resolveForwardRef, newArray, EMPTY_OBJ, assertString, assertNotEqual, FLAGS, assertEqual, isInCheckNoChangesMode, PREORDER_HOOK_FLAGS, assertFirstCreatePass, assertDefined, throwError, assertNumber, assertGreaterThan, HEADER_OFFSET, DECLARATION_VIEW, NG_FACTORY_DEF, isForwardRef, getFactoryDef, assertIndexInRange, assertTNodeForLView, enterDI, runInInjectorProfilerContext, getCurrentTNode, getLView, emitInjectorToCreateInstanceEvent, emitInstanceCreatedByInjectorEvent, throwProviderNotFoundError, leaveDI, assertNodeInjector, stringifyForError, cyclicDependencyErrorWithDetails, cyclicDependencyError, setInjectorProfilerContext, setInjectImplementation, assertDirectiveDef, NG_ELEMENT_ID, convertToBitFlags, isRootView, T_HOST, TVIEW, injectRootLimpMode, isComponentDef, EMBEDDED_VIEW_INJECTOR, INJECTOR$1 as INJECTOR, DECLARATION_COMPONENT_VIEW, isComponentHost, RuntimeError, NG_PROV_DEF, getClosureSafeProperty, getNativeByTNode, flatten, arrayEquals, ID, isLView, assertDomNode, unwrapRNode, getComponentLViewByIndex, CONTEXT, EMPTY_ARRAY, assertLView, HOST, CHILD_HEAD, NEXT, isLContainer, getLViewParent, Injector, CLEANUP, getComponentDef, getDirectiveDef, InjectionToken, inject, formatRuntimeError, isInSkipHydrationBlock as isInSkipHydrationBlock$1, HYDRATION, isContentQueryHost, setCurrentQueryIndex, XSS_SECURITY_URL, renderStringify, ENVIRONMENT, makeEnvironmentProviders,
|
|
7
|
+
import { attachInjectFlag, _global, ɵɵdefineInjectable as __defineInjectable, ɵɵdefineInjector as __defineInjector, ɵɵinject as __inject, ɵɵinvalidFactoryDep as __invalidFactoryDep, resolveForwardRef, newArray, EMPTY_OBJ, assertString, assertNotEqual, FLAGS, assertEqual, isInCheckNoChangesMode, PREORDER_HOOK_FLAGS, assertFirstCreatePass, assertDefined, throwError, assertNumber, assertGreaterThan, HEADER_OFFSET, DECLARATION_VIEW, NG_FACTORY_DEF, isForwardRef, getFactoryDef, assertIndexInRange, assertTNodeForLView, enterDI, runInInjectorProfilerContext, getCurrentTNode, getLView, emitInjectorToCreateInstanceEvent, emitInstanceCreatedByInjectorEvent, throwProviderNotFoundError, leaveDI, assertNodeInjector, stringifyForError, cyclicDependencyErrorWithDetails, cyclicDependencyError, setInjectorProfilerContext, setInjectImplementation, assertDirectiveDef, NG_ELEMENT_ID, convertToBitFlags, isRootView, T_HOST, TVIEW, injectRootLimpMode, isComponentDef, EMBEDDED_VIEW_INJECTOR, INJECTOR$1 as INJECTOR, DECLARATION_COMPONENT_VIEW, isComponentHost, RuntimeError, NG_PROV_DEF, getClosureSafeProperty, getNativeByTNode, flatten, arrayEquals, ID, isLView, assertDomNode, unwrapRNode, getComponentLViewByIndex, CONTEXT, EMPTY_ARRAY, assertLView, HOST, CHILD_HEAD, NEXT, isLContainer, getLViewParent, Injector, CLEANUP, getComponentDef, getDirectiveDef, InjectionToken, inject, formatRuntimeError, isInSkipHydrationBlock as isInSkipHydrationBlock$1, HYDRATION, isContentQueryHost, setCurrentQueryIndex, isDirectiveHost, XSS_SECURITY_URL, RENDERER, renderStringify, getSelectedTNode, ENVIRONMENT, makeEnvironmentProviders, resetPreOrderHookFlags, PARENT, CHILD_TAIL, assertSame, assertFirstUpdatePass, getSelectedIndex, getTView, assertIndexInDeclRange, setSelectedIndex, isInInjectionContext, DestroyRef, PendingTasksInternal, noop, ChangeDetectionScheduler, ErrorHandler, AFTER_RENDER_SEQUENCES_TO_ADD, markAncestorsForTraversal, assertNotInReactiveContext, assertInInjectionContext, ViewContext, assertLContainer, MOVED_VIEWS, isDestroyed, REACTIVE_TEMPLATE_CONSUMER, DECLARATION_LCONTAINER, QUERIES, assertNotReactive, ON_DESTROY_HOOKS, assertFunction, EFFECTS, assertProjectionSlots, NATIVE, ANIMATIONS, assertParentView, CONTAINER_HEADER_OFFSET, assertNotSame, setCurrentDirectiveIndex, setCurrentTNode, getElementDepthCount, increaseElementDepthCount, wasLastNodeCreated, isCurrentTNodeParent, setCurrentTNodeAsNotParent, assertHasParent, INTERNAL_APPLICATION_ERROR_HANDLER, stringify, getCurrentDirectiveIndex, unwrapLView, isCreationMode, enterView, leaveView, markViewForRefresh, setIsRefreshingViews, isExhaustiveCheckNoChanges, requiresRefreshOrTraversal, setIsInCheckNoChangesMode, CheckNoChangesMode, setBindingIndex, EFFECTS_TO_SCHEDULE, viewAttachedToChangeDetector, setBindingRootForHostBindings, isRefreshingViews, removeFromArray, addToArray, updateAncestorTraversalFlagsOnAttach, storeLViewOnDestroy, VIEW_REFS, assertGreaterThanOrEqual, isInI18nBlock, assertTNodeForTView, getCurrentParentTNode, getCurrentTNodePlaceholderOk, assertTNode, assertTIcu, assertNumberInRange, DEHYDRATED_VIEWS, getNgModuleDef, getPipeDef as getPipeDef$1, getNgModuleDefOrThrow, isStandalone, concatStringsWithSpace, assertInjectImplementationNotEqual, emitInjectEvent, getConstant, assertLessThan, getOrCreateTViewCleanup, getOrCreateLViewCleanup, assertNotDefined, nextBindingIndex, getDirectiveDefOrThrow, getTNode, assertComponentType, debugStringifyTypeForError, EnvironmentInjector, SVG_NAMESPACE, MATH_ML_NAMESPACE, viewAttachedToContainer, storeCleanupWithContext, signal, createInjectorWithoutInjectorInstances, R3Injector, getNullInjector, internalImportProvidersFrom, initNgDevMode, fillProperties, getBindingsEnabled, lastNodeWasCreated, removeLViewOnDestroy, walkUpViews, getNativeByIndex, assertElement, arrayInsert2, arraySplice, setInjectorProfiler, NullInjector, ENVIRONMENT_INITIALIZER, INJECTOR_DEF_TYPES, walkProviderTree, getInjectorDef, deepForEach, isTypeProvider, isSignal, runInInjectionContext, ZONELESS_ENABLED, EffectScheduler, PendingTasks, assertTNodeCreationIndex, isSkipHydrationRootTNode, leaveSkipHydrationBlock, decreaseElementDepthCount, getNamespace, enterSkipHydrationBlock, getCurrentDirectiveDef, assertIndexInExpandoRange, getBindingIndex, assertOneOf, setInI18nBlock, nextContextImpl, getCurrentQueryIndex, getContextLView, load, keyValueArrayIndexOf, keyValueArraySet, keyValueArrayGet, incrementBindingIndex, isWritableSignal, store, providerToFactory, emitProviderConfiguredEvent, isClassProvider, getBindingRoot, NG_COMP_DEF, ɵɵresetView as __resetView, ɵɵnamespaceHTML as __namespaceHTML, ɵɵnamespaceMathML as __namespaceMathML, ɵɵnamespaceSVG as __namespaceSVG, ɵɵenableBindings as __enableBindings, ɵɵdisableBindings as __disableBindings, ɵɵrestoreView as __restoreView, forwardRef, NG_MOD_DEF, NG_INJ_DEF, NG_DIR_DEF, NG_PIPE_DEF, ZONELESS_SCHEDULER_DISABLED, SCHEDULE_IN_ROOT_ZONE, PROVIDED_ZONELESS, getNativeByTNodeOrNull } from './root_effect_scheduler.mjs';
|
|
8
8
|
import { setActiveConsumer, SIGNAL, consumerDestroy, REACTIVE_NODE, consumerPollProducersForChange, consumerBeforeComputation, getActiveConsumer, consumerAfterComputation, createComputed, setThrowInvalidWriteToSignalError } from './signal.mjs';
|
|
9
9
|
import { Subject, Subscription } from 'rxjs';
|
|
10
10
|
import { setActiveConsumer as setActiveConsumer$1 } from '@angular/core/primitives/signals';
|
|
@@ -4906,311 +4906,599 @@ var ViewEncapsulation;
|
|
|
4906
4906
|
})(ViewEncapsulation || (ViewEncapsulation = {}));
|
|
4907
4907
|
|
|
4908
4908
|
/**
|
|
4909
|
-
*
|
|
4910
|
-
*
|
|
4911
|
-
*
|
|
4912
|
-
*
|
|
4913
|
-
*
|
|
4914
|
-
* @
|
|
4915
|
-
* security review.
|
|
4909
|
+
* Defines a schema that allows an NgModule to contain the following:
|
|
4910
|
+
* - Non-Angular elements named with dash case (`-`).
|
|
4911
|
+
* - Element properties named with dash case (`-`).
|
|
4912
|
+
* Dash case is the naming convention for custom elements.
|
|
4913
|
+
*
|
|
4914
|
+
* @publicApi
|
|
4916
4915
|
*/
|
|
4916
|
+
const CUSTOM_ELEMENTS_SCHEMA = {
|
|
4917
|
+
name: 'custom-elements',
|
|
4918
|
+
};
|
|
4917
4919
|
/**
|
|
4918
|
-
*
|
|
4919
|
-
*
|
|
4920
|
+
* Defines a schema that allows any property on any element.
|
|
4921
|
+
*
|
|
4922
|
+
* This schema allows you to ignore the errors related to any unknown elements or properties in a
|
|
4923
|
+
* template. The usage of this schema is generally discouraged because it prevents useful validation
|
|
4924
|
+
* and may hide real errors in your template. Consider using the `CUSTOM_ELEMENTS_SCHEMA` instead.
|
|
4925
|
+
*
|
|
4926
|
+
* @publicApi
|
|
4920
4927
|
*/
|
|
4921
|
-
|
|
4928
|
+
const NO_ERRORS_SCHEMA = {
|
|
4929
|
+
name: 'no-errors-schema',
|
|
4930
|
+
};
|
|
4931
|
+
|
|
4932
|
+
let shouldThrowErrorOnUnknownElement = false;
|
|
4922
4933
|
/**
|
|
4923
|
-
*
|
|
4924
|
-
*
|
|
4934
|
+
* Sets a strict mode for JIT-compiled components to throw an error on unknown elements,
|
|
4935
|
+
* instead of just logging the error.
|
|
4936
|
+
* (for AOT-compiled ones this check happens at build time).
|
|
4925
4937
|
*/
|
|
4926
|
-
function
|
|
4927
|
-
|
|
4928
|
-
policy$1 = null;
|
|
4929
|
-
if (_global.trustedTypes) {
|
|
4930
|
-
try {
|
|
4931
|
-
policy$1 = _global.trustedTypes.createPolicy('angular', {
|
|
4932
|
-
createHTML: (s) => s,
|
|
4933
|
-
createScript: (s) => s,
|
|
4934
|
-
createScriptURL: (s) => s,
|
|
4935
|
-
});
|
|
4936
|
-
}
|
|
4937
|
-
catch {
|
|
4938
|
-
// trustedTypes.createPolicy throws if called with a name that is
|
|
4939
|
-
// already registered, even in report-only mode. Until the API changes,
|
|
4940
|
-
// catch the error not to break the applications functionally. In such
|
|
4941
|
-
// cases, the code will fall back to using strings.
|
|
4942
|
-
}
|
|
4943
|
-
}
|
|
4944
|
-
}
|
|
4945
|
-
return policy$1;
|
|
4938
|
+
function ɵsetUnknownElementStrictMode(shouldThrow) {
|
|
4939
|
+
shouldThrowErrorOnUnknownElement = shouldThrow;
|
|
4946
4940
|
}
|
|
4947
4941
|
/**
|
|
4948
|
-
*
|
|
4949
|
-
* Trusted Types are not available.
|
|
4950
|
-
* @security This is a security-sensitive function; any use of this function
|
|
4951
|
-
* must go through security review. In particular, it must be assured that the
|
|
4952
|
-
* provided string will never cause an XSS vulnerability if used in a context
|
|
4953
|
-
* that will be interpreted as HTML by a browser, e.g. when assigning to
|
|
4954
|
-
* element.innerHTML.
|
|
4942
|
+
* Gets the current value of the strict mode.
|
|
4955
4943
|
*/
|
|
4956
|
-
function
|
|
4957
|
-
return
|
|
4944
|
+
function ɵgetUnknownElementStrictMode() {
|
|
4945
|
+
return shouldThrowErrorOnUnknownElement;
|
|
4958
4946
|
}
|
|
4947
|
+
let shouldThrowErrorOnUnknownProperty = false;
|
|
4959
4948
|
/**
|
|
4960
|
-
*
|
|
4961
|
-
*
|
|
4962
|
-
*
|
|
4963
|
-
* must go through security review. In particular, it must be assured that the
|
|
4964
|
-
* provided string will never cause an XSS vulnerability if used in a context
|
|
4965
|
-
* that will cause a browser to load and execute a resource, e.g. when
|
|
4966
|
-
* assigning to script.src.
|
|
4949
|
+
* Sets a strict mode for JIT-compiled components to throw an error on unknown properties,
|
|
4950
|
+
* instead of just logging the error.
|
|
4951
|
+
* (for AOT-compiled ones this check happens at build time).
|
|
4967
4952
|
*/
|
|
4968
|
-
function
|
|
4969
|
-
|
|
4953
|
+
function ɵsetUnknownPropertyStrictMode(shouldThrow) {
|
|
4954
|
+
shouldThrowErrorOnUnknownProperty = shouldThrow;
|
|
4970
4955
|
}
|
|
4971
|
-
|
|
4972
|
-
/**
|
|
4973
|
-
* @fileoverview
|
|
4974
|
-
* A module to facilitate use of a Trusted Types policy internally within
|
|
4975
|
-
* Angular specifically for bypassSecurityTrust* and custom sanitizers. It
|
|
4976
|
-
* lazily constructs the Trusted Types policy, providing helper utilities for
|
|
4977
|
-
* promoting strings to Trusted Types. When Trusted Types are not available,
|
|
4978
|
-
* strings are used as a fallback.
|
|
4979
|
-
* @security All use of this module is security-sensitive and should go through
|
|
4980
|
-
* security review.
|
|
4981
|
-
*/
|
|
4982
4956
|
/**
|
|
4983
|
-
*
|
|
4984
|
-
* enabled/supported, or undefined if the policy has not been created yet.
|
|
4957
|
+
* Gets the current value of the strict mode.
|
|
4985
4958
|
*/
|
|
4986
|
-
|
|
4959
|
+
function ɵgetUnknownPropertyStrictMode() {
|
|
4960
|
+
return shouldThrowErrorOnUnknownProperty;
|
|
4961
|
+
}
|
|
4987
4962
|
/**
|
|
4988
|
-
*
|
|
4989
|
-
*
|
|
4963
|
+
* Validates that the element is known at runtime and produces
|
|
4964
|
+
* an error if it's not the case.
|
|
4965
|
+
* This check is relevant for JIT-compiled components (for AOT-compiled
|
|
4966
|
+
* ones this check happens at build time).
|
|
4967
|
+
*
|
|
4968
|
+
* The element is considered known if either:
|
|
4969
|
+
* - it's a known HTML element
|
|
4970
|
+
* - it's a known custom element
|
|
4971
|
+
* - the element matches any directive
|
|
4972
|
+
* - the element is allowed by one of the schemas
|
|
4973
|
+
*
|
|
4974
|
+
* @param lView An `LView` associated with a template is being rendered
|
|
4975
|
+
* @param tNode TNode representing an element to be validated
|
|
4990
4976
|
*/
|
|
4991
|
-
function
|
|
4992
|
-
|
|
4993
|
-
|
|
4994
|
-
|
|
4995
|
-
|
|
4996
|
-
|
|
4997
|
-
|
|
4998
|
-
|
|
4999
|
-
|
|
5000
|
-
|
|
4977
|
+
function validateElementIsKnown(lView, tNode) {
|
|
4978
|
+
const tView = lView[TVIEW];
|
|
4979
|
+
// If `schemas` is set to `null`, that's an indication that this Component was compiled in AOT
|
|
4980
|
+
// mode where this check happens at compile time. In JIT mode, `schemas` is always present and
|
|
4981
|
+
// defined as an array (as an empty array in case `schemas` field is not defined) and we should
|
|
4982
|
+
// execute the check below.
|
|
4983
|
+
if (tView.schemas === null)
|
|
4984
|
+
return;
|
|
4985
|
+
const tagName = tNode.value;
|
|
4986
|
+
// If the element matches any directive, it's considered as valid.
|
|
4987
|
+
if (!isDirectiveHost(tNode) && tagName !== null) {
|
|
4988
|
+
// The element is unknown if it's an instance of HTMLUnknownElement, or it isn't registered
|
|
4989
|
+
// as a custom element. Note that unknown elements with a dash in their name won't be instances
|
|
4990
|
+
// of HTMLUnknownElement in browsers that support web components.
|
|
4991
|
+
const isUnknown =
|
|
4992
|
+
// Note that we can't check for `typeof HTMLUnknownElement === 'function'` because
|
|
4993
|
+
// Domino doesn't expose HTMLUnknownElement globally.
|
|
4994
|
+
(typeof HTMLUnknownElement !== 'undefined' &&
|
|
4995
|
+
HTMLUnknownElement &&
|
|
4996
|
+
getNativeByTNode(tNode, lView) instanceof HTMLUnknownElement) ||
|
|
4997
|
+
(typeof customElements !== 'undefined' &&
|
|
4998
|
+
tagName.indexOf('-') > -1 &&
|
|
4999
|
+
!customElements.get(tagName));
|
|
5000
|
+
if (isUnknown && !matchingSchemas(tView.schemas, tagName)) {
|
|
5001
|
+
const isHostStandalone = isHostComponentStandalone(lView);
|
|
5002
|
+
const templateLocation = getTemplateLocationDetails(lView);
|
|
5003
|
+
const schemas = `'${isHostStandalone ? '@Component' : '@NgModule'}.schemas'`;
|
|
5004
|
+
let message = `'${tagName}' is not a known element${templateLocation}:\n`;
|
|
5005
|
+
message += `1. If '${tagName}' is an Angular component, then verify that it is ${isHostStandalone
|
|
5006
|
+
? "included in the '@Component.imports' of this component"
|
|
5007
|
+
: 'a part of an @NgModule where this component is declared'}.\n`;
|
|
5008
|
+
if (tagName && tagName.indexOf('-') > -1) {
|
|
5009
|
+
message += `2. If '${tagName}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the ${schemas} of this component to suppress this message.`;
|
|
5001
5010
|
}
|
|
5002
|
-
|
|
5003
|
-
|
|
5004
|
-
|
|
5005
|
-
|
|
5006
|
-
|
|
5011
|
+
else {
|
|
5012
|
+
message += `2. To allow any element add 'NO_ERRORS_SCHEMA' to the ${schemas} of this component.`;
|
|
5013
|
+
}
|
|
5014
|
+
if (shouldThrowErrorOnUnknownElement) {
|
|
5015
|
+
throw new RuntimeError(304 /* RuntimeErrorCode.UNKNOWN_ELEMENT */, message);
|
|
5016
|
+
}
|
|
5017
|
+
else {
|
|
5018
|
+
console.error(formatRuntimeError(304 /* RuntimeErrorCode.UNKNOWN_ELEMENT */, message));
|
|
5007
5019
|
}
|
|
5008
5020
|
}
|
|
5009
5021
|
}
|
|
5010
|
-
return policy;
|
|
5011
|
-
}
|
|
5012
|
-
/**
|
|
5013
|
-
* Unsafely promote a string to a TrustedHTML, falling back to strings when
|
|
5014
|
-
* Trusted Types are not available.
|
|
5015
|
-
* @security This is a security-sensitive function; any use of this function
|
|
5016
|
-
* must go through security review. In particular, it must be assured that it
|
|
5017
|
-
* is only passed strings that come directly from custom sanitizers or the
|
|
5018
|
-
* bypassSecurityTrust* functions.
|
|
5019
|
-
*/
|
|
5020
|
-
function trustedHTMLFromStringBypass(html) {
|
|
5021
|
-
return getPolicy()?.createHTML(html) || html;
|
|
5022
5022
|
}
|
|
5023
5023
|
/**
|
|
5024
|
-
*
|
|
5025
|
-
*
|
|
5026
|
-
*
|
|
5027
|
-
*
|
|
5028
|
-
*
|
|
5029
|
-
*
|
|
5024
|
+
* Validates that the property of the element is known at runtime and returns
|
|
5025
|
+
* false if it's not the case.
|
|
5026
|
+
* This check is relevant for JIT-compiled components (for AOT-compiled
|
|
5027
|
+
* ones this check happens at build time).
|
|
5028
|
+
*
|
|
5029
|
+
* The property is considered known if either:
|
|
5030
|
+
* - it's a known property of the element
|
|
5031
|
+
* - the element is allowed by one of the schemas
|
|
5032
|
+
* - the property is used for animations
|
|
5033
|
+
*
|
|
5034
|
+
* @param element Element to validate
|
|
5035
|
+
* @param propName Name of the property to check
|
|
5036
|
+
* @param tagName Name of the tag hosting the property
|
|
5037
|
+
* @param schemas Array of schemas
|
|
5030
5038
|
*/
|
|
5031
|
-
function
|
|
5032
|
-
|
|
5039
|
+
function isPropertyValid(element, propName, tagName, schemas) {
|
|
5040
|
+
// If `schemas` is set to `null`, that's an indication that this Component was compiled in AOT
|
|
5041
|
+
// mode where this check happens at compile time. In JIT mode, `schemas` is always present and
|
|
5042
|
+
// defined as an array (as an empty array in case `schemas` field is not defined) and we should
|
|
5043
|
+
// execute the check below.
|
|
5044
|
+
if (schemas === null)
|
|
5045
|
+
return true;
|
|
5046
|
+
// The property is considered valid if the element matches the schema, it exists on the element,
|
|
5047
|
+
// or it is synthetic.
|
|
5048
|
+
if (matchingSchemas(schemas, tagName) || propName in element || isAnimationProp(propName)) {
|
|
5049
|
+
return true;
|
|
5050
|
+
}
|
|
5051
|
+
// Note: `typeof Node` returns 'function' in most browsers, but is undefined with domino.
|
|
5052
|
+
return typeof Node === 'undefined' || Node === null || !(element instanceof Node);
|
|
5033
5053
|
}
|
|
5034
5054
|
/**
|
|
5035
|
-
*
|
|
5036
|
-
*
|
|
5037
|
-
* @
|
|
5038
|
-
*
|
|
5039
|
-
*
|
|
5040
|
-
*
|
|
5055
|
+
* Logs or throws an error that a property is not supported on an element.
|
|
5056
|
+
*
|
|
5057
|
+
* @param propName Name of the invalid property
|
|
5058
|
+
* @param tagName Name of the tag hosting the property
|
|
5059
|
+
* @param nodeType Type of the node hosting the property
|
|
5060
|
+
* @param lView An `LView` that represents a current component
|
|
5041
5061
|
*/
|
|
5042
|
-
function
|
|
5043
|
-
|
|
5044
|
-
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
|
|
5051
|
-
toString() {
|
|
5052
|
-
return (`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity}` +
|
|
5053
|
-
` (see ${XSS_SECURITY_URL})`);
|
|
5062
|
+
function handleUnknownPropertyError(propName, tagName, nodeType, lView) {
|
|
5063
|
+
// Special-case a situation when a structural directive is applied to
|
|
5064
|
+
// an `<ng-template>` element, for example: `<ng-template *ngIf="true">`.
|
|
5065
|
+
// In this case the compiler generates the `ɵɵtemplate` instruction with
|
|
5066
|
+
// the `null` as the tagName. The directive matching logic at runtime relies
|
|
5067
|
+
// on this effect (see `isInlineTemplate`), thus using the 'ng-template' as
|
|
5068
|
+
// a default value of the `tNode.value` is not feasible at this moment.
|
|
5069
|
+
if (!tagName && nodeType === 4 /* TNodeType.Container */) {
|
|
5070
|
+
tagName = 'ng-template';
|
|
5054
5071
|
}
|
|
5055
|
-
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
|
|
5059
|
-
|
|
5060
|
-
|
|
5061
|
-
|
|
5062
|
-
|
|
5063
|
-
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
|
|
5072
|
+
const isHostStandalone = isHostComponentStandalone(lView);
|
|
5073
|
+
const templateLocation = getTemplateLocationDetails(lView);
|
|
5074
|
+
let message = `Can't bind to '${propName}' since it isn't a known property of '${tagName}'${templateLocation}.`;
|
|
5075
|
+
const schemas = `'${isHostStandalone ? '@Component' : '@NgModule'}.schemas'`;
|
|
5076
|
+
const importLocation = isHostStandalone
|
|
5077
|
+
? "included in the '@Component.imports' of this component"
|
|
5078
|
+
: 'a part of an @NgModule where this component is declared';
|
|
5079
|
+
if (KNOWN_CONTROL_FLOW_DIRECTIVES.has(propName)) {
|
|
5080
|
+
// Most likely this is a control flow directive (such as `*ngIf`) used in
|
|
5081
|
+
// a template, but the directive or the `CommonModule` is not imported.
|
|
5082
|
+
const correspondingImport = KNOWN_CONTROL_FLOW_DIRECTIVES.get(propName);
|
|
5083
|
+
message +=
|
|
5084
|
+
`\nIf the '${propName}' is an Angular control flow directive, ` +
|
|
5085
|
+
`please make sure that either the '${correspondingImport}' directive or the 'CommonModule' is ${importLocation}.`;
|
|
5069
5086
|
}
|
|
5070
|
-
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
|
|
5087
|
+
else {
|
|
5088
|
+
// May be an Angular component, which is not imported/declared?
|
|
5089
|
+
message +=
|
|
5090
|
+
`\n1. If '${tagName}' is an Angular component and it has the ` +
|
|
5091
|
+
`'${propName}' input, then verify that it is ${importLocation}.`;
|
|
5092
|
+
// May be a Web Component?
|
|
5093
|
+
if (tagName && tagName.indexOf('-') > -1) {
|
|
5094
|
+
message +=
|
|
5095
|
+
`\n2. If '${tagName}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' ` +
|
|
5096
|
+
`to the ${schemas} of this component to suppress this message.`;
|
|
5097
|
+
message +=
|
|
5098
|
+
`\n3. To allow any property add 'NO_ERRORS_SCHEMA' to ` +
|
|
5099
|
+
`the ${schemas} of this component.`;
|
|
5100
|
+
}
|
|
5101
|
+
else {
|
|
5102
|
+
// If it's expected, the error can be suppressed by the `NO_ERRORS_SCHEMA` schema.
|
|
5103
|
+
message +=
|
|
5104
|
+
`\n2. To allow any property add 'NO_ERRORS_SCHEMA' to ` +
|
|
5105
|
+
`the ${schemas} of this component.`;
|
|
5106
|
+
}
|
|
5074
5107
|
}
|
|
5108
|
+
reportUnknownPropertyError(message);
|
|
5075
5109
|
}
|
|
5076
|
-
|
|
5077
|
-
|
|
5078
|
-
|
|
5110
|
+
function reportUnknownPropertyError(message) {
|
|
5111
|
+
if (shouldThrowErrorOnUnknownProperty) {
|
|
5112
|
+
throw new RuntimeError(303 /* RuntimeErrorCode.UNKNOWN_BINDING */, message);
|
|
5079
5113
|
}
|
|
5080
|
-
|
|
5081
|
-
|
|
5082
|
-
return value instanceof SafeValueImpl
|
|
5083
|
-
? value.changingThisBreaksApplicationSecurity
|
|
5084
|
-
: value;
|
|
5085
|
-
}
|
|
5086
|
-
function allowSanitizationBypassAndThrow(value, type) {
|
|
5087
|
-
const actualType = getSanitizationBypassType(value);
|
|
5088
|
-
if (actualType != null && actualType !== type) {
|
|
5089
|
-
// Allow ResourceURLs in URL contexts, they are strictly more trusted.
|
|
5090
|
-
if (actualType === "ResourceURL" /* BypassType.ResourceUrl */ && type === "URL" /* BypassType.Url */)
|
|
5091
|
-
return true;
|
|
5092
|
-
throw new Error(`Required a safe ${type}, got a ${actualType} (see ${XSS_SECURITY_URL})`);
|
|
5114
|
+
else {
|
|
5115
|
+
console.error(formatRuntimeError(303 /* RuntimeErrorCode.UNKNOWN_BINDING */, message));
|
|
5093
5116
|
}
|
|
5094
|
-
return actualType === type;
|
|
5095
|
-
}
|
|
5096
|
-
function getSanitizationBypassType(value) {
|
|
5097
|
-
return (value instanceof SafeValueImpl && value.getTypeName()) || null;
|
|
5098
5117
|
}
|
|
5099
5118
|
/**
|
|
5100
|
-
*
|
|
5119
|
+
* WARNING: this is a **dev-mode only** function (thus should always be guarded by the `ngDevMode`)
|
|
5120
|
+
* and must **not** be used in production bundles. The function makes megamorphic reads, which might
|
|
5121
|
+
* be too slow for production mode and also it relies on the constructor function being available.
|
|
5101
5122
|
*
|
|
5102
|
-
*
|
|
5103
|
-
* recognizable to {@link htmlSanitizer} to be trusted implicitly.
|
|
5123
|
+
* Gets a reference to the host component def (where a current component is declared).
|
|
5104
5124
|
*
|
|
5105
|
-
* @param
|
|
5106
|
-
* @returns a `html` which has been branded to be implicitly trusted.
|
|
5125
|
+
* @param lView An `LView` that represents a current component that is being rendered.
|
|
5107
5126
|
*/
|
|
5108
|
-
function
|
|
5109
|
-
|
|
5127
|
+
function getDeclarationComponentDef(lView) {
|
|
5128
|
+
!ngDevMode && throwError('Must never be called in production mode');
|
|
5129
|
+
const declarationLView = lView[DECLARATION_COMPONENT_VIEW];
|
|
5130
|
+
const context = declarationLView[CONTEXT];
|
|
5131
|
+
// Unable to obtain a context.
|
|
5132
|
+
if (!context)
|
|
5133
|
+
return null;
|
|
5134
|
+
return context.constructor ? getComponentDef(context.constructor) : null;
|
|
5110
5135
|
}
|
|
5111
5136
|
/**
|
|
5112
|
-
*
|
|
5137
|
+
* WARNING: this is a **dev-mode only** function (thus should always be guarded by the `ngDevMode`)
|
|
5138
|
+
* and must **not** be used in production bundles. The function makes megamorphic reads, which might
|
|
5139
|
+
* be too slow for production mode.
|
|
5113
5140
|
*
|
|
5114
|
-
*
|
|
5115
|
-
* recognizable to {@link styleSanitizer} to be trusted implicitly.
|
|
5141
|
+
* Checks if the current component is declared inside of a standalone component template.
|
|
5116
5142
|
*
|
|
5117
|
-
* @param
|
|
5118
|
-
* @returns a `style` hich has been branded to be implicitly trusted.
|
|
5143
|
+
* @param lView An `LView` that represents a current component that is being rendered.
|
|
5119
5144
|
*/
|
|
5120
|
-
function
|
|
5121
|
-
|
|
5145
|
+
function isHostComponentStandalone(lView) {
|
|
5146
|
+
!ngDevMode && throwError('Must never be called in production mode');
|
|
5147
|
+
const componentDef = getDeclarationComponentDef(lView);
|
|
5148
|
+
// Treat host component as non-standalone if we can't obtain the def.
|
|
5149
|
+
return !!componentDef?.standalone;
|
|
5122
5150
|
}
|
|
5123
5151
|
/**
|
|
5124
|
-
*
|
|
5152
|
+
* WARNING: this is a **dev-mode only** function (thus should always be guarded by the `ngDevMode`)
|
|
5153
|
+
* and must **not** be used in production bundles. The function makes megamorphic reads, which might
|
|
5154
|
+
* be too slow for production mode.
|
|
5125
5155
|
*
|
|
5126
|
-
*
|
|
5127
|
-
*
|
|
5156
|
+
* Constructs a string describing the location of the host component template. The function is used
|
|
5157
|
+
* in dev mode to produce error messages.
|
|
5128
5158
|
*
|
|
5129
|
-
* @param
|
|
5130
|
-
* @returns a `script` which has been branded to be implicitly trusted.
|
|
5159
|
+
* @param lView An `LView` that represents a current component that is being rendered.
|
|
5131
5160
|
*/
|
|
5132
|
-
function
|
|
5133
|
-
|
|
5161
|
+
function getTemplateLocationDetails(lView) {
|
|
5162
|
+
!ngDevMode && throwError('Must never be called in production mode');
|
|
5163
|
+
const hostComponentDef = getDeclarationComponentDef(lView);
|
|
5164
|
+
const componentClassName = hostComponentDef?.type?.name;
|
|
5165
|
+
return componentClassName ? ` (used in the '${componentClassName}' component template)` : '';
|
|
5134
5166
|
}
|
|
5135
5167
|
/**
|
|
5136
|
-
*
|
|
5137
|
-
*
|
|
5138
|
-
*
|
|
5139
|
-
* recognizable to {@link urlSanitizer} to be trusted implicitly.
|
|
5140
|
-
*
|
|
5141
|
-
* @param trustedUrl `url` string which needs to be implicitly trusted.
|
|
5142
|
-
* @returns a `url` which has been branded to be implicitly trusted.
|
|
5168
|
+
* The set of known control flow directives and their corresponding imports.
|
|
5169
|
+
* We use this set to produce a more precises error message with a note
|
|
5170
|
+
* that the `CommonModule` should also be included.
|
|
5143
5171
|
*/
|
|
5144
|
-
|
|
5145
|
-
|
|
5146
|
-
|
|
5172
|
+
const KNOWN_CONTROL_FLOW_DIRECTIVES = new Map([
|
|
5173
|
+
['ngIf', 'NgIf'],
|
|
5174
|
+
['ngFor', 'NgFor'],
|
|
5175
|
+
['ngSwitchCase', 'NgSwitchCase'],
|
|
5176
|
+
['ngSwitchDefault', 'NgSwitchDefault'],
|
|
5177
|
+
]);
|
|
5147
5178
|
/**
|
|
5148
|
-
*
|
|
5149
|
-
*
|
|
5150
|
-
*
|
|
5151
|
-
* recognizable to {@link resourceUrlSanitizer} to be trusted implicitly.
|
|
5152
|
-
*
|
|
5153
|
-
* @param trustedResourceUrl `url` string which needs to be implicitly trusted.
|
|
5154
|
-
* @returns a `url` which has been branded to be implicitly trusted.
|
|
5179
|
+
* Returns true if the tag name is allowed by specified schemas.
|
|
5180
|
+
* @param schemas Array of schemas
|
|
5181
|
+
* @param tagName Name of the tag
|
|
5155
5182
|
*/
|
|
5156
|
-
function
|
|
5157
|
-
|
|
5183
|
+
function matchingSchemas(schemas, tagName) {
|
|
5184
|
+
if (schemas !== null) {
|
|
5185
|
+
for (let i = 0; i < schemas.length; i++) {
|
|
5186
|
+
const schema = schemas[i];
|
|
5187
|
+
if (schema === NO_ERRORS_SCHEMA ||
|
|
5188
|
+
(schema === CUSTOM_ELEMENTS_SCHEMA && tagName && tagName.indexOf('-') > -1)) {
|
|
5189
|
+
return true;
|
|
5190
|
+
}
|
|
5191
|
+
}
|
|
5192
|
+
}
|
|
5193
|
+
return false;
|
|
5158
5194
|
}
|
|
5159
5195
|
|
|
5160
5196
|
/**
|
|
5161
|
-
*
|
|
5162
|
-
*
|
|
5163
|
-
*
|
|
5164
|
-
*
|
|
5165
|
-
*
|
|
5197
|
+
* @fileoverview
|
|
5198
|
+
* A module to facilitate use of a Trusted Types policy internally within
|
|
5199
|
+
* Angular. It lazily constructs the Trusted Types policy, providing helper
|
|
5200
|
+
* utilities for promoting strings to Trusted Types. When Trusted Types are not
|
|
5201
|
+
* available, strings are used as a fallback.
|
|
5202
|
+
* @security All use of this module is security-sensitive and should go through
|
|
5203
|
+
* security review.
|
|
5166
5204
|
*/
|
|
5167
|
-
function getInertBodyHelper(defaultDoc) {
|
|
5168
|
-
const inertDocumentHelper = new InertDocumentHelper(defaultDoc);
|
|
5169
|
-
return isDOMParserAvailable() ? new DOMParserHelper(inertDocumentHelper) : inertDocumentHelper;
|
|
5170
|
-
}
|
|
5171
5205
|
/**
|
|
5172
|
-
*
|
|
5173
|
-
*
|
|
5206
|
+
* The Trusted Types policy, or null if Trusted Types are not
|
|
5207
|
+
* enabled/supported, or undefined if the policy has not been created yet.
|
|
5174
5208
|
*/
|
|
5175
|
-
|
|
5176
|
-
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
|
|
5180
|
-
|
|
5181
|
-
|
|
5182
|
-
|
|
5183
|
-
|
|
5184
|
-
|
|
5185
|
-
|
|
5186
|
-
|
|
5187
|
-
|
|
5188
|
-
|
|
5189
|
-
|
|
5190
|
-
|
|
5191
|
-
|
|
5192
|
-
|
|
5209
|
+
let policy$1;
|
|
5210
|
+
/**
|
|
5211
|
+
* Returns the Trusted Types policy, or null if Trusted Types are not
|
|
5212
|
+
* enabled/supported. The first call to this function will create the policy.
|
|
5213
|
+
*/
|
|
5214
|
+
function getPolicy$1() {
|
|
5215
|
+
if (policy$1 === undefined) {
|
|
5216
|
+
policy$1 = null;
|
|
5217
|
+
if (_global.trustedTypes) {
|
|
5218
|
+
try {
|
|
5219
|
+
policy$1 = _global.trustedTypes.createPolicy('angular', {
|
|
5220
|
+
createHTML: (s) => s,
|
|
5221
|
+
createScript: (s) => s,
|
|
5222
|
+
createScriptURL: (s) => s,
|
|
5223
|
+
});
|
|
5224
|
+
}
|
|
5225
|
+
catch {
|
|
5226
|
+
// trustedTypes.createPolicy throws if called with a name that is
|
|
5227
|
+
// already registered, even in report-only mode. Until the API changes,
|
|
5228
|
+
// catch the error not to break the applications functionally. In such
|
|
5229
|
+
// cases, the code will fall back to using strings.
|
|
5193
5230
|
}
|
|
5194
|
-
body.firstChild?.remove();
|
|
5195
|
-
return body;
|
|
5196
|
-
}
|
|
5197
|
-
catch {
|
|
5198
|
-
return null;
|
|
5199
5231
|
}
|
|
5200
5232
|
}
|
|
5233
|
+
return policy$1;
|
|
5201
5234
|
}
|
|
5202
5235
|
/**
|
|
5203
|
-
*
|
|
5204
|
-
*
|
|
5236
|
+
* Unsafely promote a string to a TrustedHTML, falling back to strings when
|
|
5237
|
+
* Trusted Types are not available.
|
|
5238
|
+
* @security This is a security-sensitive function; any use of this function
|
|
5239
|
+
* must go through security review. In particular, it must be assured that the
|
|
5240
|
+
* provided string will never cause an XSS vulnerability if used in a context
|
|
5241
|
+
* that will be interpreted as HTML by a browser, e.g. when assigning to
|
|
5242
|
+
* element.innerHTML.
|
|
5205
5243
|
*/
|
|
5206
|
-
|
|
5207
|
-
|
|
5208
|
-
|
|
5209
|
-
|
|
5210
|
-
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
|
|
5244
|
+
function trustedHTMLFromString(html) {
|
|
5245
|
+
return getPolicy$1()?.createHTML(html) || html;
|
|
5246
|
+
}
|
|
5247
|
+
/**
|
|
5248
|
+
* Unsafely promote a string to a TrustedScriptURL, falling back to strings
|
|
5249
|
+
* when Trusted Types are not available.
|
|
5250
|
+
* @security This is a security-sensitive function; any use of this function
|
|
5251
|
+
* must go through security review. In particular, it must be assured that the
|
|
5252
|
+
* provided string will never cause an XSS vulnerability if used in a context
|
|
5253
|
+
* that will cause a browser to load and execute a resource, e.g. when
|
|
5254
|
+
* assigning to script.src.
|
|
5255
|
+
*/
|
|
5256
|
+
function trustedScriptURLFromString(url) {
|
|
5257
|
+
return getPolicy$1()?.createScriptURL(url) || url;
|
|
5258
|
+
}
|
|
5259
|
+
|
|
5260
|
+
/**
|
|
5261
|
+
* @fileoverview
|
|
5262
|
+
* A module to facilitate use of a Trusted Types policy internally within
|
|
5263
|
+
* Angular specifically for bypassSecurityTrust* and custom sanitizers. It
|
|
5264
|
+
* lazily constructs the Trusted Types policy, providing helper utilities for
|
|
5265
|
+
* promoting strings to Trusted Types. When Trusted Types are not available,
|
|
5266
|
+
* strings are used as a fallback.
|
|
5267
|
+
* @security All use of this module is security-sensitive and should go through
|
|
5268
|
+
* security review.
|
|
5269
|
+
*/
|
|
5270
|
+
/**
|
|
5271
|
+
* The Trusted Types policy, or null if Trusted Types are not
|
|
5272
|
+
* enabled/supported, or undefined if the policy has not been created yet.
|
|
5273
|
+
*/
|
|
5274
|
+
let policy;
|
|
5275
|
+
/**
|
|
5276
|
+
* Returns the Trusted Types policy, or null if Trusted Types are not
|
|
5277
|
+
* enabled/supported. The first call to this function will create the policy.
|
|
5278
|
+
*/
|
|
5279
|
+
function getPolicy() {
|
|
5280
|
+
if (policy === undefined) {
|
|
5281
|
+
policy = null;
|
|
5282
|
+
if (_global.trustedTypes) {
|
|
5283
|
+
try {
|
|
5284
|
+
policy = _global.trustedTypes.createPolicy('angular#unsafe-bypass', {
|
|
5285
|
+
createHTML: (s) => s,
|
|
5286
|
+
createScript: (s) => s,
|
|
5287
|
+
createScriptURL: (s) => s,
|
|
5288
|
+
});
|
|
5289
|
+
}
|
|
5290
|
+
catch {
|
|
5291
|
+
// trustedTypes.createPolicy throws if called with a name that is
|
|
5292
|
+
// already registered, even in report-only mode. Until the API changes,
|
|
5293
|
+
// catch the error not to break the applications functionally. In such
|
|
5294
|
+
// cases, the code will fall back to using strings.
|
|
5295
|
+
}
|
|
5296
|
+
}
|
|
5297
|
+
}
|
|
5298
|
+
return policy;
|
|
5299
|
+
}
|
|
5300
|
+
/**
|
|
5301
|
+
* Unsafely promote a string to a TrustedHTML, falling back to strings when
|
|
5302
|
+
* Trusted Types are not available.
|
|
5303
|
+
* @security This is a security-sensitive function; any use of this function
|
|
5304
|
+
* must go through security review. In particular, it must be assured that it
|
|
5305
|
+
* is only passed strings that come directly from custom sanitizers or the
|
|
5306
|
+
* bypassSecurityTrust* functions.
|
|
5307
|
+
*/
|
|
5308
|
+
function trustedHTMLFromStringBypass(html) {
|
|
5309
|
+
return getPolicy()?.createHTML(html) || html;
|
|
5310
|
+
}
|
|
5311
|
+
/**
|
|
5312
|
+
* Unsafely promote a string to a TrustedScript, falling back to strings when
|
|
5313
|
+
* Trusted Types are not available.
|
|
5314
|
+
* @security This is a security-sensitive function; any use of this function
|
|
5315
|
+
* must go through security review. In particular, it must be assured that it
|
|
5316
|
+
* is only passed strings that come directly from custom sanitizers or the
|
|
5317
|
+
* bypassSecurityTrust* functions.
|
|
5318
|
+
*/
|
|
5319
|
+
function trustedScriptFromStringBypass(script) {
|
|
5320
|
+
return getPolicy()?.createScript(script) || script;
|
|
5321
|
+
}
|
|
5322
|
+
/**
|
|
5323
|
+
* Unsafely promote a string to a TrustedScriptURL, falling back to strings
|
|
5324
|
+
* when Trusted Types are not available.
|
|
5325
|
+
* @security This is a security-sensitive function; any use of this function
|
|
5326
|
+
* must go through security review. In particular, it must be assured that it
|
|
5327
|
+
* is only passed strings that come directly from custom sanitizers or the
|
|
5328
|
+
* bypassSecurityTrust* functions.
|
|
5329
|
+
*/
|
|
5330
|
+
function trustedScriptURLFromStringBypass(url) {
|
|
5331
|
+
return getPolicy()?.createScriptURL(url) || url;
|
|
5332
|
+
}
|
|
5333
|
+
|
|
5334
|
+
class SafeValueImpl {
|
|
5335
|
+
changingThisBreaksApplicationSecurity;
|
|
5336
|
+
constructor(changingThisBreaksApplicationSecurity) {
|
|
5337
|
+
this.changingThisBreaksApplicationSecurity = changingThisBreaksApplicationSecurity;
|
|
5338
|
+
}
|
|
5339
|
+
toString() {
|
|
5340
|
+
return (`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity}` +
|
|
5341
|
+
` (see ${XSS_SECURITY_URL})`);
|
|
5342
|
+
}
|
|
5343
|
+
}
|
|
5344
|
+
class SafeHtmlImpl extends SafeValueImpl {
|
|
5345
|
+
getTypeName() {
|
|
5346
|
+
return "HTML" /* BypassType.Html */;
|
|
5347
|
+
}
|
|
5348
|
+
}
|
|
5349
|
+
class SafeStyleImpl extends SafeValueImpl {
|
|
5350
|
+
getTypeName() {
|
|
5351
|
+
return "Style" /* BypassType.Style */;
|
|
5352
|
+
}
|
|
5353
|
+
}
|
|
5354
|
+
class SafeScriptImpl extends SafeValueImpl {
|
|
5355
|
+
getTypeName() {
|
|
5356
|
+
return "Script" /* BypassType.Script */;
|
|
5357
|
+
}
|
|
5358
|
+
}
|
|
5359
|
+
class SafeUrlImpl extends SafeValueImpl {
|
|
5360
|
+
getTypeName() {
|
|
5361
|
+
return "URL" /* BypassType.Url */;
|
|
5362
|
+
}
|
|
5363
|
+
}
|
|
5364
|
+
class SafeResourceUrlImpl extends SafeValueImpl {
|
|
5365
|
+
getTypeName() {
|
|
5366
|
+
return "ResourceURL" /* BypassType.ResourceUrl */;
|
|
5367
|
+
}
|
|
5368
|
+
}
|
|
5369
|
+
function unwrapSafeValue(value) {
|
|
5370
|
+
return value instanceof SafeValueImpl
|
|
5371
|
+
? value.changingThisBreaksApplicationSecurity
|
|
5372
|
+
: value;
|
|
5373
|
+
}
|
|
5374
|
+
function allowSanitizationBypassAndThrow(value, type) {
|
|
5375
|
+
const actualType = getSanitizationBypassType(value);
|
|
5376
|
+
if (actualType != null && actualType !== type) {
|
|
5377
|
+
// Allow ResourceURLs in URL contexts, they are strictly more trusted.
|
|
5378
|
+
if (actualType === "ResourceURL" /* BypassType.ResourceUrl */ && type === "URL" /* BypassType.Url */)
|
|
5379
|
+
return true;
|
|
5380
|
+
throw new Error(`Required a safe ${type}, got a ${actualType} (see ${XSS_SECURITY_URL})`);
|
|
5381
|
+
}
|
|
5382
|
+
return actualType === type;
|
|
5383
|
+
}
|
|
5384
|
+
function getSanitizationBypassType(value) {
|
|
5385
|
+
return (value instanceof SafeValueImpl && value.getTypeName()) || null;
|
|
5386
|
+
}
|
|
5387
|
+
/**
|
|
5388
|
+
* Mark `html` string as trusted.
|
|
5389
|
+
*
|
|
5390
|
+
* This function wraps the trusted string in `String` and brands it in a way which makes it
|
|
5391
|
+
* recognizable to {@link htmlSanitizer} to be trusted implicitly.
|
|
5392
|
+
*
|
|
5393
|
+
* @param trustedHtml `html` string which needs to be implicitly trusted.
|
|
5394
|
+
* @returns a `html` which has been branded to be implicitly trusted.
|
|
5395
|
+
*/
|
|
5396
|
+
function bypassSanitizationTrustHtml(trustedHtml) {
|
|
5397
|
+
return new SafeHtmlImpl(trustedHtml);
|
|
5398
|
+
}
|
|
5399
|
+
/**
|
|
5400
|
+
* Mark `style` string as trusted.
|
|
5401
|
+
*
|
|
5402
|
+
* This function wraps the trusted string in `String` and brands it in a way which makes it
|
|
5403
|
+
* recognizable to {@link styleSanitizer} to be trusted implicitly.
|
|
5404
|
+
*
|
|
5405
|
+
* @param trustedStyle `style` string which needs to be implicitly trusted.
|
|
5406
|
+
* @returns a `style` hich has been branded to be implicitly trusted.
|
|
5407
|
+
*/
|
|
5408
|
+
function bypassSanitizationTrustStyle(trustedStyle) {
|
|
5409
|
+
return new SafeStyleImpl(trustedStyle);
|
|
5410
|
+
}
|
|
5411
|
+
/**
|
|
5412
|
+
* Mark `script` string as trusted.
|
|
5413
|
+
*
|
|
5414
|
+
* This function wraps the trusted string in `String` and brands it in a way which makes it
|
|
5415
|
+
* recognizable to {@link scriptSanitizer} to be trusted implicitly.
|
|
5416
|
+
*
|
|
5417
|
+
* @param trustedScript `script` string which needs to be implicitly trusted.
|
|
5418
|
+
* @returns a `script` which has been branded to be implicitly trusted.
|
|
5419
|
+
*/
|
|
5420
|
+
function bypassSanitizationTrustScript(trustedScript) {
|
|
5421
|
+
return new SafeScriptImpl(trustedScript);
|
|
5422
|
+
}
|
|
5423
|
+
/**
|
|
5424
|
+
* Mark `url` string as trusted.
|
|
5425
|
+
*
|
|
5426
|
+
* This function wraps the trusted string in `String` and brands it in a way which makes it
|
|
5427
|
+
* recognizable to {@link urlSanitizer} to be trusted implicitly.
|
|
5428
|
+
*
|
|
5429
|
+
* @param trustedUrl `url` string which needs to be implicitly trusted.
|
|
5430
|
+
* @returns a `url` which has been branded to be implicitly trusted.
|
|
5431
|
+
*/
|
|
5432
|
+
function bypassSanitizationTrustUrl(trustedUrl) {
|
|
5433
|
+
return new SafeUrlImpl(trustedUrl);
|
|
5434
|
+
}
|
|
5435
|
+
/**
|
|
5436
|
+
* Mark `url` string as trusted.
|
|
5437
|
+
*
|
|
5438
|
+
* This function wraps the trusted string in `String` and brands it in a way which makes it
|
|
5439
|
+
* recognizable to {@link resourceUrlSanitizer} to be trusted implicitly.
|
|
5440
|
+
*
|
|
5441
|
+
* @param trustedResourceUrl `url` string which needs to be implicitly trusted.
|
|
5442
|
+
* @returns a `url` which has been branded to be implicitly trusted.
|
|
5443
|
+
*/
|
|
5444
|
+
function bypassSanitizationTrustResourceUrl(trustedResourceUrl) {
|
|
5445
|
+
return new SafeResourceUrlImpl(trustedResourceUrl);
|
|
5446
|
+
}
|
|
5447
|
+
|
|
5448
|
+
/**
|
|
5449
|
+
* This helper is used to get hold of an inert tree of DOM elements containing dirty HTML
|
|
5450
|
+
* that needs sanitizing.
|
|
5451
|
+
* Depending upon browser support we use one of two strategies for doing this.
|
|
5452
|
+
* Default: DOMParser strategy
|
|
5453
|
+
* Fallback: InertDocument strategy
|
|
5454
|
+
*/
|
|
5455
|
+
function getInertBodyHelper(defaultDoc) {
|
|
5456
|
+
const inertDocumentHelper = new InertDocumentHelper(defaultDoc);
|
|
5457
|
+
return isDOMParserAvailable() ? new DOMParserHelper(inertDocumentHelper) : inertDocumentHelper;
|
|
5458
|
+
}
|
|
5459
|
+
/**
|
|
5460
|
+
* Uses DOMParser to create and fill an inert body element.
|
|
5461
|
+
* This is the default strategy used in browsers that support it.
|
|
5462
|
+
*/
|
|
5463
|
+
class DOMParserHelper {
|
|
5464
|
+
inertDocumentHelper;
|
|
5465
|
+
constructor(inertDocumentHelper) {
|
|
5466
|
+
this.inertDocumentHelper = inertDocumentHelper;
|
|
5467
|
+
}
|
|
5468
|
+
getInertBodyElement(html) {
|
|
5469
|
+
// We add these extra elements to ensure that the rest of the content is parsed as expected
|
|
5470
|
+
// e.g. leading whitespace is maintained and tags like `<meta>` do not get hoisted to the
|
|
5471
|
+
// `<head>` tag. Note that the `<body>` tag is closed implicitly to prevent unclosed tags
|
|
5472
|
+
// in `html` from consuming the otherwise explicit `</body>` tag.
|
|
5473
|
+
html = '<body><remove></remove>' + html;
|
|
5474
|
+
try {
|
|
5475
|
+
const body = new window.DOMParser().parseFromString(trustedHTMLFromString(html), 'text/html').body;
|
|
5476
|
+
if (body === null) {
|
|
5477
|
+
// In some browsers (e.g. Mozilla/5.0 iPad AppleWebKit Mobile) the `body` property only
|
|
5478
|
+
// becomes available in the following tick of the JS engine. In that case we fall back to
|
|
5479
|
+
// the `inertDocumentHelper` instead.
|
|
5480
|
+
return this.inertDocumentHelper.getInertBodyElement(html);
|
|
5481
|
+
}
|
|
5482
|
+
body.firstChild?.remove();
|
|
5483
|
+
return body;
|
|
5484
|
+
}
|
|
5485
|
+
catch {
|
|
5486
|
+
return null;
|
|
5487
|
+
}
|
|
5488
|
+
}
|
|
5489
|
+
}
|
|
5490
|
+
/**
|
|
5491
|
+
* Use an HTML5 `template` element to create and fill an inert DOM element.
|
|
5492
|
+
* This is the fallback strategy if the browser does not support DOMParser.
|
|
5493
|
+
*/
|
|
5494
|
+
class InertDocumentHelper {
|
|
5495
|
+
defaultDoc;
|
|
5496
|
+
inertDocument;
|
|
5497
|
+
constructor(defaultDoc) {
|
|
5498
|
+
this.defaultDoc = defaultDoc;
|
|
5499
|
+
this.inertDocument = this.defaultDoc.implementation.createHTMLDocument('sanitization-inert');
|
|
5500
|
+
}
|
|
5501
|
+
getInertBodyElement(html) {
|
|
5214
5502
|
const templateEl = this.inertDocument.createElement('template');
|
|
5215
5503
|
templateEl.innerHTML = trustedHTMLFromString(html);
|
|
5216
5504
|
return templateEl;
|
|
@@ -5527,267 +5815,25 @@ function _sanitizeHtml(defaultDoc, unsafeHtmlInput) {
|
|
|
5527
5815
|
if ((typeof ngDevMode === 'undefined' || ngDevMode) && sanitizer.sanitizedSomething) {
|
|
5528
5816
|
console.warn(`WARNING: sanitizing HTML stripped some content, see ${XSS_SECURITY_URL}`);
|
|
5529
5817
|
}
|
|
5530
|
-
return trustedHTMLFromString(safeHtml);
|
|
5531
|
-
}
|
|
5532
|
-
finally {
|
|
5533
|
-
// In case anything goes wrong, clear out inertElement to reset the entire DOM structure.
|
|
5534
|
-
if (inertBodyElement) {
|
|
5535
|
-
const parent = getTemplateContent(inertBodyElement) || inertBodyElement;
|
|
5536
|
-
while (parent.firstChild) {
|
|
5537
|
-
parent.firstChild.remove();
|
|
5538
|
-
}
|
|
5539
|
-
}
|
|
5540
|
-
}
|
|
5541
|
-
}
|
|
5542
|
-
function getTemplateContent(el) {
|
|
5543
|
-
return 'content' in el /** Microsoft/TypeScript#21517 */ && isTemplateElement(el)
|
|
5544
|
-
? el.content
|
|
5545
|
-
: null;
|
|
5546
|
-
}
|
|
5547
|
-
function isTemplateElement(el) {
|
|
5548
|
-
return el.nodeType === Node.ELEMENT_NODE && el.nodeName === 'TEMPLATE';
|
|
5549
|
-
}
|
|
5550
|
-
|
|
5551
|
-
/**
|
|
5552
|
-
* A SecurityContext marks a location that has dangerous security implications, e.g. a DOM property
|
|
5553
|
-
* like `innerHTML` that could cause Cross Site Scripting (XSS) security bugs when improperly
|
|
5554
|
-
* handled.
|
|
5555
|
-
*
|
|
5556
|
-
* See DomSanitizer for more details on security in Angular applications.
|
|
5557
|
-
*
|
|
5558
|
-
* @publicApi
|
|
5559
|
-
*/
|
|
5560
|
-
var SecurityContext;
|
|
5561
|
-
(function (SecurityContext) {
|
|
5562
|
-
SecurityContext[SecurityContext["NONE"] = 0] = "NONE";
|
|
5563
|
-
SecurityContext[SecurityContext["HTML"] = 1] = "HTML";
|
|
5564
|
-
SecurityContext[SecurityContext["STYLE"] = 2] = "STYLE";
|
|
5565
|
-
SecurityContext[SecurityContext["SCRIPT"] = 3] = "SCRIPT";
|
|
5566
|
-
SecurityContext[SecurityContext["URL"] = 4] = "URL";
|
|
5567
|
-
SecurityContext[SecurityContext["RESOURCE_URL"] = 5] = "RESOURCE_URL";
|
|
5568
|
-
})(SecurityContext || (SecurityContext = {}));
|
|
5569
|
-
|
|
5570
|
-
/**
|
|
5571
|
-
* An `html` sanitizer which converts untrusted `html` **string** into trusted string by removing
|
|
5572
|
-
* dangerous content.
|
|
5573
|
-
*
|
|
5574
|
-
* This method parses the `html` and locates potentially dangerous content (such as urls and
|
|
5575
|
-
* javascript) and removes it.
|
|
5576
|
-
*
|
|
5577
|
-
* It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustHtml}.
|
|
5578
|
-
*
|
|
5579
|
-
* @param unsafeHtml untrusted `html`, typically from the user.
|
|
5580
|
-
* @returns `html` string which is safe to display to user, because all of the dangerous javascript
|
|
5581
|
-
* and urls have been removed.
|
|
5582
|
-
*
|
|
5583
|
-
* @codeGenApi
|
|
5584
|
-
*/
|
|
5585
|
-
function ɵɵsanitizeHtml(unsafeHtml) {
|
|
5586
|
-
const sanitizer = getSanitizer();
|
|
5587
|
-
if (sanitizer) {
|
|
5588
|
-
return trustedHTMLFromStringBypass(sanitizer.sanitize(SecurityContext.HTML, unsafeHtml) || '');
|
|
5589
|
-
}
|
|
5590
|
-
if (allowSanitizationBypassAndThrow(unsafeHtml, "HTML" /* BypassType.Html */)) {
|
|
5591
|
-
return trustedHTMLFromStringBypass(unwrapSafeValue(unsafeHtml));
|
|
5592
|
-
}
|
|
5593
|
-
return _sanitizeHtml(getDocument(), renderStringify(unsafeHtml));
|
|
5594
|
-
}
|
|
5595
|
-
/**
|
|
5596
|
-
* A `style` sanitizer which converts untrusted `style` **string** into trusted string by removing
|
|
5597
|
-
* dangerous content.
|
|
5598
|
-
*
|
|
5599
|
-
* It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustStyle}.
|
|
5600
|
-
*
|
|
5601
|
-
* @param unsafeStyle untrusted `style`, typically from the user.
|
|
5602
|
-
* @returns `style` string which is safe to bind to the `style` properties.
|
|
5603
|
-
*
|
|
5604
|
-
* @codeGenApi
|
|
5605
|
-
*/
|
|
5606
|
-
function ɵɵsanitizeStyle(unsafeStyle) {
|
|
5607
|
-
const sanitizer = getSanitizer();
|
|
5608
|
-
if (sanitizer) {
|
|
5609
|
-
return sanitizer.sanitize(SecurityContext.STYLE, unsafeStyle) || '';
|
|
5610
|
-
}
|
|
5611
|
-
if (allowSanitizationBypassAndThrow(unsafeStyle, "Style" /* BypassType.Style */)) {
|
|
5612
|
-
return unwrapSafeValue(unsafeStyle);
|
|
5613
|
-
}
|
|
5614
|
-
return renderStringify(unsafeStyle);
|
|
5615
|
-
}
|
|
5616
|
-
/**
|
|
5617
|
-
* A `url` sanitizer which converts untrusted `url` **string** into trusted string by removing
|
|
5618
|
-
* dangerous
|
|
5619
|
-
* content.
|
|
5620
|
-
*
|
|
5621
|
-
* This method parses the `url` and locates potentially dangerous content (such as javascript) and
|
|
5622
|
-
* removes it.
|
|
5623
|
-
*
|
|
5624
|
-
* It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustUrl}.
|
|
5625
|
-
*
|
|
5626
|
-
* @param unsafeUrl untrusted `url`, typically from the user.
|
|
5627
|
-
* @returns `url` string which is safe to bind to the `src` properties such as `<img src>`, because
|
|
5628
|
-
* all of the dangerous javascript has been removed.
|
|
5629
|
-
*
|
|
5630
|
-
* @codeGenApi
|
|
5631
|
-
*/
|
|
5632
|
-
function ɵɵsanitizeUrl(unsafeUrl) {
|
|
5633
|
-
const sanitizer = getSanitizer();
|
|
5634
|
-
if (sanitizer) {
|
|
5635
|
-
return sanitizer.sanitize(SecurityContext.URL, unsafeUrl) || '';
|
|
5636
|
-
}
|
|
5637
|
-
if (allowSanitizationBypassAndThrow(unsafeUrl, "URL" /* BypassType.Url */)) {
|
|
5638
|
-
return unwrapSafeValue(unsafeUrl);
|
|
5639
|
-
}
|
|
5640
|
-
return _sanitizeUrl(renderStringify(unsafeUrl));
|
|
5641
|
-
}
|
|
5642
|
-
/**
|
|
5643
|
-
* A `url` sanitizer which only lets trusted `url`s through.
|
|
5644
|
-
*
|
|
5645
|
-
* This passes only `url`s marked trusted by calling {@link bypassSanitizationTrustResourceUrl}.
|
|
5646
|
-
*
|
|
5647
|
-
* @param unsafeResourceUrl untrusted `url`, typically from the user.
|
|
5648
|
-
* @returns `url` string which is safe to bind to the `src` properties such as `<img src>`, because
|
|
5649
|
-
* only trusted `url`s have been allowed to pass.
|
|
5650
|
-
*
|
|
5651
|
-
* @codeGenApi
|
|
5652
|
-
*/
|
|
5653
|
-
function ɵɵsanitizeResourceUrl(unsafeResourceUrl) {
|
|
5654
|
-
const sanitizer = getSanitizer();
|
|
5655
|
-
if (sanitizer) {
|
|
5656
|
-
return trustedScriptURLFromStringBypass(sanitizer.sanitize(SecurityContext.RESOURCE_URL, unsafeResourceUrl) || '');
|
|
5657
|
-
}
|
|
5658
|
-
if (allowSanitizationBypassAndThrow(unsafeResourceUrl, "ResourceURL" /* BypassType.ResourceUrl */)) {
|
|
5659
|
-
return trustedScriptURLFromStringBypass(unwrapSafeValue(unsafeResourceUrl));
|
|
5660
|
-
}
|
|
5661
|
-
throw new RuntimeError(904 /* RuntimeErrorCode.UNSAFE_VALUE_IN_RESOURCE_URL */, ngDevMode && `unsafe value used in a resource URL context (see ${XSS_SECURITY_URL})`);
|
|
5662
|
-
}
|
|
5663
|
-
/**
|
|
5664
|
-
* A `script` sanitizer which only lets trusted javascript through.
|
|
5665
|
-
*
|
|
5666
|
-
* This passes only `script`s marked trusted by calling {@link
|
|
5667
|
-
* bypassSanitizationTrustScript}.
|
|
5668
|
-
*
|
|
5669
|
-
* @param unsafeScript untrusted `script`, typically from the user.
|
|
5670
|
-
* @returns `url` string which is safe to bind to the `<script>` element such as `<img src>`,
|
|
5671
|
-
* because only trusted `scripts` have been allowed to pass.
|
|
5672
|
-
*
|
|
5673
|
-
* @codeGenApi
|
|
5674
|
-
*/
|
|
5675
|
-
function ɵɵsanitizeScript(unsafeScript) {
|
|
5676
|
-
const sanitizer = getSanitizer();
|
|
5677
|
-
if (sanitizer) {
|
|
5678
|
-
return trustedScriptFromStringBypass(sanitizer.sanitize(SecurityContext.SCRIPT, unsafeScript) || '');
|
|
5679
|
-
}
|
|
5680
|
-
if (allowSanitizationBypassAndThrow(unsafeScript, "Script" /* BypassType.Script */)) {
|
|
5681
|
-
return trustedScriptFromStringBypass(unwrapSafeValue(unsafeScript));
|
|
5682
|
-
}
|
|
5683
|
-
throw new RuntimeError(905 /* RuntimeErrorCode.UNSAFE_VALUE_IN_SCRIPT */, ngDevMode && 'unsafe value used in a script context');
|
|
5684
|
-
}
|
|
5685
|
-
/**
|
|
5686
|
-
* A template tag function for promoting the associated constant literal to a
|
|
5687
|
-
* TrustedHTML. Interpolation is explicitly not allowed.
|
|
5688
|
-
*
|
|
5689
|
-
* @param html constant template literal containing trusted HTML.
|
|
5690
|
-
* @returns TrustedHTML wrapping `html`.
|
|
5691
|
-
*
|
|
5692
|
-
* @security This is a security-sensitive function and should only be used to
|
|
5693
|
-
* convert constant values of attributes and properties found in
|
|
5694
|
-
* application-provided Angular templates to TrustedHTML.
|
|
5695
|
-
*
|
|
5696
|
-
* @codeGenApi
|
|
5697
|
-
*/
|
|
5698
|
-
function ɵɵtrustConstantHtml(html) {
|
|
5699
|
-
// The following runtime check ensures that the function was called as a
|
|
5700
|
-
// template tag (e.g. ɵɵtrustConstantHtml`content`), without any interpolation
|
|
5701
|
-
// (e.g. not ɵɵtrustConstantHtml`content ${variable}`). A TemplateStringsArray
|
|
5702
|
-
// is an array with a `raw` property that is also an array. The associated
|
|
5703
|
-
// template literal has no interpolation if and only if the length of the
|
|
5704
|
-
// TemplateStringsArray is 1.
|
|
5705
|
-
if (ngDevMode && (!Array.isArray(html) || !Array.isArray(html.raw) || html.length !== 1)) {
|
|
5706
|
-
throw new Error(`Unexpected interpolation in trusted HTML constant: ${html.join('?')}`);
|
|
5707
|
-
}
|
|
5708
|
-
return trustedHTMLFromString(html[0]);
|
|
5709
|
-
}
|
|
5710
|
-
/**
|
|
5711
|
-
* A template tag function for promoting the associated constant literal to a
|
|
5712
|
-
* TrustedScriptURL. Interpolation is explicitly not allowed.
|
|
5713
|
-
*
|
|
5714
|
-
* @param url constant template literal containing a trusted script URL.
|
|
5715
|
-
* @returns TrustedScriptURL wrapping `url`.
|
|
5716
|
-
*
|
|
5717
|
-
* @security This is a security-sensitive function and should only be used to
|
|
5718
|
-
* convert constant values of attributes and properties found in
|
|
5719
|
-
* application-provided Angular templates to TrustedScriptURL.
|
|
5720
|
-
*
|
|
5721
|
-
* @codeGenApi
|
|
5722
|
-
*/
|
|
5723
|
-
function ɵɵtrustConstantResourceUrl(url) {
|
|
5724
|
-
// The following runtime check ensures that the function was called as a
|
|
5725
|
-
// template tag (e.g. ɵɵtrustConstantResourceUrl`content`), without any
|
|
5726
|
-
// interpolation (e.g. not ɵɵtrustConstantResourceUrl`content ${variable}`). A
|
|
5727
|
-
// TemplateStringsArray is an array with a `raw` property that is also an
|
|
5728
|
-
// array. The associated template literal has no interpolation if and only if
|
|
5729
|
-
// the length of the TemplateStringsArray is 1.
|
|
5730
|
-
if (ngDevMode && (!Array.isArray(url) || !Array.isArray(url.raw) || url.length !== 1)) {
|
|
5731
|
-
throw new Error(`Unexpected interpolation in trusted URL constant: ${url.join('?')}`);
|
|
5732
|
-
}
|
|
5733
|
-
return trustedScriptURLFromString(url[0]);
|
|
5734
|
-
}
|
|
5735
|
-
/**
|
|
5736
|
-
* Detects which sanitizer to use for URL property, based on tag name and prop name.
|
|
5737
|
-
*
|
|
5738
|
-
* The rules are based on the RESOURCE_URL context config from
|
|
5739
|
-
* `packages/compiler/src/schema/dom_security_schema.ts`.
|
|
5740
|
-
* If tag and prop names don't match Resource URL schema, use URL sanitizer.
|
|
5741
|
-
*/
|
|
5742
|
-
function getUrlSanitizer(tag, prop) {
|
|
5743
|
-
if ((prop === 'src' &&
|
|
5744
|
-
(tag === 'embed' ||
|
|
5745
|
-
tag === 'frame' ||
|
|
5746
|
-
tag === 'iframe' ||
|
|
5747
|
-
tag === 'media' ||
|
|
5748
|
-
tag === 'script')) ||
|
|
5749
|
-
(prop === 'href' && (tag === 'base' || tag === 'link'))) {
|
|
5750
|
-
return ɵɵsanitizeResourceUrl;
|
|
5751
|
-
}
|
|
5752
|
-
return ɵɵsanitizeUrl;
|
|
5753
|
-
}
|
|
5754
|
-
/**
|
|
5755
|
-
* Sanitizes URL, selecting sanitizer function based on tag and property names.
|
|
5756
|
-
*
|
|
5757
|
-
* This function is used in case we can't define security context at compile time, when only prop
|
|
5758
|
-
* name is available. This happens when we generate host bindings for Directives/Components. The
|
|
5759
|
-
* host element is unknown at compile time, so we defer calculation of specific sanitizer to
|
|
5760
|
-
* runtime.
|
|
5761
|
-
*
|
|
5762
|
-
* @param unsafeUrl untrusted `url`, typically from the user.
|
|
5763
|
-
* @param tag target element tag name.
|
|
5764
|
-
* @param prop name of the property that contains the value.
|
|
5765
|
-
* @returns `url` string which is safe to bind.
|
|
5766
|
-
*
|
|
5767
|
-
* @codeGenApi
|
|
5768
|
-
*/
|
|
5769
|
-
function ɵɵsanitizeUrlOrResourceUrl(unsafeUrl, tag, prop) {
|
|
5770
|
-
return getUrlSanitizer(tag, prop)(unsafeUrl);
|
|
5771
|
-
}
|
|
5772
|
-
function validateAgainstEventProperties(name) {
|
|
5773
|
-
if (name.toLowerCase().startsWith('on')) {
|
|
5774
|
-
const errorMessage = `Binding to event property '${name}' is disallowed for security reasons, ` +
|
|
5775
|
-
`please use (${name.slice(2)})=...` +
|
|
5776
|
-
`\nIf '${name}' is a directive input, make sure the directive is imported by the` +
|
|
5777
|
-
` current module.`;
|
|
5778
|
-
throw new RuntimeError(306 /* RuntimeErrorCode.INVALID_EVENT_BINDING */, errorMessage);
|
|
5818
|
+
return trustedHTMLFromString(safeHtml);
|
|
5779
5819
|
}
|
|
5780
|
-
|
|
5781
|
-
|
|
5782
|
-
|
|
5783
|
-
|
|
5784
|
-
|
|
5785
|
-
|
|
5820
|
+
finally {
|
|
5821
|
+
// In case anything goes wrong, clear out inertElement to reset the entire DOM structure.
|
|
5822
|
+
if (inertBodyElement) {
|
|
5823
|
+
const parent = getTemplateContent(inertBodyElement) || inertBodyElement;
|
|
5824
|
+
while (parent.firstChild) {
|
|
5825
|
+
parent.firstChild.remove();
|
|
5826
|
+
}
|
|
5827
|
+
}
|
|
5786
5828
|
}
|
|
5787
5829
|
}
|
|
5788
|
-
function
|
|
5789
|
-
|
|
5790
|
-
|
|
5830
|
+
function getTemplateContent(el) {
|
|
5831
|
+
return 'content' in el /** Microsoft/TypeScript#21517 */ && isTemplateElement(el)
|
|
5832
|
+
? el.content
|
|
5833
|
+
: null;
|
|
5834
|
+
}
|
|
5835
|
+
function isTemplateElement(el) {
|
|
5836
|
+
return el.nodeType === Node.ELEMENT_NODE && el.nodeName === 'TEMPLATE';
|
|
5791
5837
|
}
|
|
5792
5838
|
|
|
5793
5839
|
/**
|
|
@@ -5832,344 +5878,475 @@ function escapeCommentText(value) {
|
|
|
5832
5878
|
return value.replace(COMMENT_DISALLOWED, (text) => text.replace(COMMENT_DELIMITER, COMMENT_DELIMITER_ESCAPED));
|
|
5833
5879
|
}
|
|
5834
5880
|
|
|
5835
|
-
|
|
5836
|
-
|
|
5881
|
+
function createTextNode(renderer, value) {
|
|
5882
|
+
return renderer.createText(value);
|
|
5883
|
+
}
|
|
5884
|
+
function updateTextNode(renderer, rNode, value) {
|
|
5885
|
+
renderer.setValue(rNode, value);
|
|
5886
|
+
}
|
|
5887
|
+
function createCommentNode(renderer, value) {
|
|
5888
|
+
return renderer.createComment(escapeCommentText(value));
|
|
5889
|
+
}
|
|
5837
5890
|
/**
|
|
5838
|
-
*
|
|
5839
|
-
*
|
|
5891
|
+
* Creates a native element from a tag name, using a renderer.
|
|
5892
|
+
* @param renderer A renderer to use
|
|
5893
|
+
* @param name the tag name
|
|
5894
|
+
* @param namespace Optional namespace for element.
|
|
5895
|
+
* @returns the element created
|
|
5840
5896
|
*/
|
|
5841
|
-
|
|
5842
|
-
|
|
5843
|
-
|
|
5844
|
-
});
|
|
5897
|
+
function createElementNode(renderer, name, namespace) {
|
|
5898
|
+
return renderer.createElement(name, namespace);
|
|
5899
|
+
}
|
|
5845
5900
|
/**
|
|
5846
|
-
*
|
|
5847
|
-
*
|
|
5848
|
-
|
|
5849
|
-
|
|
5901
|
+
* Inserts a native node before another native node for a given parent.
|
|
5902
|
+
* This is a utility function that can be used when native nodes were determined.
|
|
5903
|
+
*/
|
|
5904
|
+
function nativeInsertBefore(renderer, parent, child, beforeNode, isMove) {
|
|
5905
|
+
renderer.insertBefore(parent, child, beforeNode, isMove);
|
|
5906
|
+
}
|
|
5907
|
+
function nativeAppendChild(renderer, parent, child) {
|
|
5908
|
+
ngDevMode && assertDefined(parent, 'parent node must be defined');
|
|
5909
|
+
renderer.appendChild(parent, child);
|
|
5910
|
+
}
|
|
5911
|
+
function nativeAppendOrInsertBefore(renderer, parent, child, beforeNode, isMove) {
|
|
5912
|
+
if (beforeNode !== null) {
|
|
5913
|
+
nativeInsertBefore(renderer, parent, child, beforeNode, isMove);
|
|
5914
|
+
}
|
|
5915
|
+
else {
|
|
5916
|
+
nativeAppendChild(renderer, parent, child);
|
|
5917
|
+
}
|
|
5918
|
+
}
|
|
5919
|
+
/**
|
|
5920
|
+
* Removes a native node itself using a given renderer. To remove the node we are looking up its
|
|
5921
|
+
* parent from the native tree as not all platforms / browsers support the equivalent of
|
|
5922
|
+
* node.remove().
|
|
5850
5923
|
*
|
|
5851
|
-
*
|
|
5852
|
-
*
|
|
5853
|
-
*
|
|
5924
|
+
* @param renderer A renderer to be used
|
|
5925
|
+
* @param rNode The native node that should be removed
|
|
5926
|
+
* @param isHostElement A flag indicating if a node to be removed is a host of a component.
|
|
5927
|
+
* @param requireSynchronousElementRemoval A flag indicating if a node requires synchronous
|
|
5928
|
+
* removal from the DOM.
|
|
5929
|
+
*/
|
|
5930
|
+
function nativeRemoveNode(renderer, rNode, isHostElement, requireSynchronousElementRemoval) {
|
|
5931
|
+
renderer.removeChild(null, rNode, isHostElement, requireSynchronousElementRemoval);
|
|
5932
|
+
}
|
|
5933
|
+
/**
|
|
5934
|
+
* Clears the contents of a given RElement.
|
|
5854
5935
|
*
|
|
5855
|
-
* @
|
|
5936
|
+
* @param rElement the native RElement to be cleared
|
|
5856
5937
|
*/
|
|
5857
|
-
function
|
|
5858
|
-
|
|
5859
|
-
? [
|
|
5860
|
-
{
|
|
5861
|
-
provide: NG_REFLECT_ATTRS_FLAG,
|
|
5862
|
-
useValue: true,
|
|
5863
|
-
},
|
|
5864
|
-
]
|
|
5865
|
-
: [];
|
|
5866
|
-
return makeEnvironmentProviders(providers);
|
|
5938
|
+
function clearElementContents(rElement) {
|
|
5939
|
+
rElement.textContent = '';
|
|
5867
5940
|
}
|
|
5868
|
-
|
|
5869
|
-
|
|
5870
|
-
|
|
5871
|
-
|
|
5941
|
+
/**
|
|
5942
|
+
* Write `cssText` to `RElement`.
|
|
5943
|
+
*
|
|
5944
|
+
* This function does direct write without any reconciliation. Used for writing initial values, so
|
|
5945
|
+
* that static styling values do not pull in the style parser.
|
|
5946
|
+
*
|
|
5947
|
+
* @param renderer Renderer to use
|
|
5948
|
+
* @param element The element which needs to be updated.
|
|
5949
|
+
* @param newValue The new class list to write.
|
|
5950
|
+
*/
|
|
5951
|
+
function writeDirectStyle(renderer, element, newValue) {
|
|
5952
|
+
ngDevMode && assertString(newValue, "'newValue' should be a string");
|
|
5953
|
+
renderer.setAttribute(element, 'style', newValue);
|
|
5872
5954
|
}
|
|
5873
|
-
|
|
5874
|
-
|
|
5875
|
-
|
|
5955
|
+
/**
|
|
5956
|
+
* Write `className` to `RElement`.
|
|
5957
|
+
*
|
|
5958
|
+
* This function does direct write without any reconciliation. Used for writing initial values, so
|
|
5959
|
+
* that static styling values do not pull in the style parser.
|
|
5960
|
+
*
|
|
5961
|
+
* @param renderer Renderer to use
|
|
5962
|
+
* @param element The element which needs to be updated.
|
|
5963
|
+
* @param newValue The new class list to write.
|
|
5964
|
+
*/
|
|
5965
|
+
function writeDirectClass(renderer, element, newValue) {
|
|
5966
|
+
ngDevMode && assertString(newValue, "'newValue' should be a string");
|
|
5967
|
+
if (newValue === '') {
|
|
5968
|
+
// There are tests in `google3` which expect `element.getAttribute('class')` to be `null`.
|
|
5969
|
+
renderer.removeAttribute(element, 'class');
|
|
5970
|
+
}
|
|
5971
|
+
else {
|
|
5972
|
+
renderer.setAttribute(element, 'class', newValue);
|
|
5973
|
+
}
|
|
5876
5974
|
}
|
|
5877
|
-
|
|
5878
|
-
|
|
5879
|
-
|
|
5880
|
-
|
|
5975
|
+
/** Sets up the static DOM attributes on an `RNode`. */
|
|
5976
|
+
function setupStaticAttributes(renderer, element, tNode) {
|
|
5977
|
+
const { mergedAttrs, classes, styles } = tNode;
|
|
5978
|
+
if (mergedAttrs !== null) {
|
|
5979
|
+
setUpAttributes(renderer, element, mergedAttrs);
|
|
5881
5980
|
}
|
|
5882
|
-
|
|
5883
|
-
|
|
5981
|
+
if (classes !== null) {
|
|
5982
|
+
writeDirectClass(renderer, element, classes);
|
|
5983
|
+
}
|
|
5984
|
+
if (styles !== null) {
|
|
5985
|
+
writeDirectStyle(renderer, element, styles);
|
|
5884
5986
|
}
|
|
5885
5987
|
}
|
|
5886
5988
|
|
|
5887
5989
|
/**
|
|
5888
|
-
*
|
|
5889
|
-
* - Non-Angular elements named with dash case (`-`).
|
|
5890
|
-
* - Element properties named with dash case (`-`).
|
|
5891
|
-
* Dash case is the naming convention for custom elements.
|
|
5990
|
+
* Enforces security by neutralizing an `<iframe>` if a security-sensitive attribute is set.
|
|
5892
5991
|
*
|
|
5893
|
-
*
|
|
5992
|
+
* This function is invoked at runtime when a security-sensitive attribute is bound to an `<iframe>`.
|
|
5993
|
+
* It clears the `src` and `srcdoc` attributes and removes the `<iframe>` from the DOM to prevent
|
|
5994
|
+
* potential security risks.
|
|
5995
|
+
*
|
|
5996
|
+
* @see [SECURITY_SCHEMA](../../../compiler/src/schema/dom_security_schema.ts) for the full list
|
|
5997
|
+
* of such attributes.
|
|
5998
|
+
*
|
|
5999
|
+
* @codeGenApi
|
|
5894
6000
|
*/
|
|
5895
|
-
|
|
5896
|
-
|
|
5897
|
-
|
|
6001
|
+
function enforceIframeSecurity(iframe) {
|
|
6002
|
+
const lView = getLView();
|
|
6003
|
+
// Unset previously applied `src` and `srcdoc` if we come across a situation when
|
|
6004
|
+
// a security-sensitive attribute is set later via an attribute/property binding.
|
|
6005
|
+
iframe.src = '';
|
|
6006
|
+
iframe.srcdoc = trustedHTMLFromString('');
|
|
6007
|
+
// Also remove the <iframe> from the document.
|
|
6008
|
+
nativeRemoveNode(lView[RENDERER], iframe);
|
|
6009
|
+
}
|
|
6010
|
+
|
|
5898
6011
|
/**
|
|
5899
|
-
*
|
|
6012
|
+
* A SecurityContext marks a location that has dangerous security implications, e.g. a DOM property
|
|
6013
|
+
* like `innerHTML` that could cause Cross Site Scripting (XSS) security bugs when improperly
|
|
6014
|
+
* handled.
|
|
5900
6015
|
*
|
|
5901
|
-
*
|
|
5902
|
-
* template. The usage of this schema is generally discouraged because it prevents useful validation
|
|
5903
|
-
* and may hide real errors in your template. Consider using the `CUSTOM_ELEMENTS_SCHEMA` instead.
|
|
6016
|
+
* See DomSanitizer for more details on security in Angular applications.
|
|
5904
6017
|
*
|
|
5905
6018
|
* @publicApi
|
|
5906
6019
|
*/
|
|
5907
|
-
|
|
5908
|
-
|
|
5909
|
-
|
|
6020
|
+
var SecurityContext;
|
|
6021
|
+
(function (SecurityContext) {
|
|
6022
|
+
SecurityContext[SecurityContext["NONE"] = 0] = "NONE";
|
|
6023
|
+
SecurityContext[SecurityContext["HTML"] = 1] = "HTML";
|
|
6024
|
+
SecurityContext[SecurityContext["STYLE"] = 2] = "STYLE";
|
|
6025
|
+
SecurityContext[SecurityContext["SCRIPT"] = 3] = "SCRIPT";
|
|
6026
|
+
SecurityContext[SecurityContext["URL"] = 4] = "URL";
|
|
6027
|
+
SecurityContext[SecurityContext["RESOURCE_URL"] = 5] = "RESOURCE_URL";
|
|
6028
|
+
})(SecurityContext || (SecurityContext = {}));
|
|
5910
6029
|
|
|
5911
|
-
let shouldThrowErrorOnUnknownElement = false;
|
|
5912
6030
|
/**
|
|
5913
|
-
*
|
|
5914
|
-
*
|
|
5915
|
-
*
|
|
6031
|
+
* An `html` sanitizer which converts untrusted `html` **string** into trusted string by removing
|
|
6032
|
+
* dangerous content.
|
|
6033
|
+
*
|
|
6034
|
+
* This method parses the `html` and locates potentially dangerous content (such as urls and
|
|
6035
|
+
* javascript) and removes it.
|
|
6036
|
+
*
|
|
6037
|
+
* It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustHtml}.
|
|
6038
|
+
*
|
|
6039
|
+
* @param unsafeHtml untrusted `html`, typically from the user.
|
|
6040
|
+
* @returns `html` string which is safe to display to user, because all of the dangerous javascript
|
|
6041
|
+
* and urls have been removed.
|
|
6042
|
+
*
|
|
6043
|
+
* @codeGenApi
|
|
6044
|
+
*/
|
|
6045
|
+
function ɵɵsanitizeHtml(unsafeHtml) {
|
|
6046
|
+
const sanitizer = getSanitizer();
|
|
6047
|
+
if (sanitizer) {
|
|
6048
|
+
return trustedHTMLFromStringBypass(sanitizer.sanitize(SecurityContext.HTML, unsafeHtml) || '');
|
|
6049
|
+
}
|
|
6050
|
+
if (allowSanitizationBypassAndThrow(unsafeHtml, "HTML" /* BypassType.Html */)) {
|
|
6051
|
+
return trustedHTMLFromStringBypass(unwrapSafeValue(unsafeHtml));
|
|
6052
|
+
}
|
|
6053
|
+
return _sanitizeHtml(getDocument(), renderStringify(unsafeHtml));
|
|
6054
|
+
}
|
|
6055
|
+
/**
|
|
6056
|
+
* A `style` sanitizer which converts untrusted `style` **string** into trusted string by removing
|
|
6057
|
+
* dangerous content.
|
|
6058
|
+
*
|
|
6059
|
+
* It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustStyle}.
|
|
6060
|
+
*
|
|
6061
|
+
* @param unsafeStyle untrusted `style`, typically from the user.
|
|
6062
|
+
* @returns `style` string which is safe to bind to the `style` properties.
|
|
6063
|
+
*
|
|
6064
|
+
* @codeGenApi
|
|
6065
|
+
*/
|
|
6066
|
+
function ɵɵsanitizeStyle(unsafeStyle) {
|
|
6067
|
+
const sanitizer = getSanitizer();
|
|
6068
|
+
if (sanitizer) {
|
|
6069
|
+
return sanitizer.sanitize(SecurityContext.STYLE, unsafeStyle) || '';
|
|
6070
|
+
}
|
|
6071
|
+
if (allowSanitizationBypassAndThrow(unsafeStyle, "Style" /* BypassType.Style */)) {
|
|
6072
|
+
return unwrapSafeValue(unsafeStyle);
|
|
6073
|
+
}
|
|
6074
|
+
return renderStringify(unsafeStyle);
|
|
6075
|
+
}
|
|
6076
|
+
/**
|
|
6077
|
+
* A `url` sanitizer which converts untrusted `url` **string** into trusted string by removing
|
|
6078
|
+
* dangerous
|
|
6079
|
+
* content.
|
|
6080
|
+
*
|
|
6081
|
+
* This method parses the `url` and locates potentially dangerous content (such as javascript) and
|
|
6082
|
+
* removes it.
|
|
6083
|
+
*
|
|
6084
|
+
* It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustUrl}.
|
|
6085
|
+
*
|
|
6086
|
+
* @param unsafeUrl untrusted `url`, typically from the user.
|
|
6087
|
+
* @returns `url` string which is safe to bind to the `src` properties such as `<img src>`, because
|
|
6088
|
+
* all of the dangerous javascript has been removed.
|
|
6089
|
+
*
|
|
6090
|
+
* @codeGenApi
|
|
5916
6091
|
*/
|
|
5917
|
-
function
|
|
5918
|
-
|
|
6092
|
+
function ɵɵsanitizeUrl(unsafeUrl) {
|
|
6093
|
+
const sanitizer = getSanitizer();
|
|
6094
|
+
if (sanitizer) {
|
|
6095
|
+
return sanitizer.sanitize(SecurityContext.URL, unsafeUrl) || '';
|
|
6096
|
+
}
|
|
6097
|
+
if (allowSanitizationBypassAndThrow(unsafeUrl, "URL" /* BypassType.Url */)) {
|
|
6098
|
+
return unwrapSafeValue(unsafeUrl);
|
|
6099
|
+
}
|
|
6100
|
+
return _sanitizeUrl(renderStringify(unsafeUrl));
|
|
5919
6101
|
}
|
|
5920
6102
|
/**
|
|
5921
|
-
*
|
|
6103
|
+
* A `url` sanitizer which only lets trusted `url`s through.
|
|
6104
|
+
*
|
|
6105
|
+
* This passes only `url`s marked trusted by calling {@link bypassSanitizationTrustResourceUrl}.
|
|
6106
|
+
*
|
|
6107
|
+
* @param unsafeResourceUrl untrusted `url`, typically from the user.
|
|
6108
|
+
* @returns `url` string which is safe to bind to the `src` properties such as `<img src>`, because
|
|
6109
|
+
* only trusted `url`s have been allowed to pass.
|
|
6110
|
+
*
|
|
6111
|
+
* @codeGenApi
|
|
5922
6112
|
*/
|
|
5923
|
-
function
|
|
5924
|
-
|
|
6113
|
+
function ɵɵsanitizeResourceUrl(unsafeResourceUrl) {
|
|
6114
|
+
const sanitizer = getSanitizer();
|
|
6115
|
+
if (sanitizer) {
|
|
6116
|
+
return trustedScriptURLFromStringBypass(sanitizer.sanitize(SecurityContext.RESOURCE_URL, unsafeResourceUrl) || '');
|
|
6117
|
+
}
|
|
6118
|
+
if (allowSanitizationBypassAndThrow(unsafeResourceUrl, "ResourceURL" /* BypassType.ResourceUrl */)) {
|
|
6119
|
+
return trustedScriptURLFromStringBypass(unwrapSafeValue(unsafeResourceUrl));
|
|
6120
|
+
}
|
|
6121
|
+
throw new RuntimeError(904 /* RuntimeErrorCode.UNSAFE_VALUE_IN_RESOURCE_URL */, ngDevMode && `unsafe value used in a resource URL context (see ${XSS_SECURITY_URL})`);
|
|
5925
6122
|
}
|
|
5926
|
-
let shouldThrowErrorOnUnknownProperty = false;
|
|
5927
6123
|
/**
|
|
5928
|
-
*
|
|
5929
|
-
*
|
|
5930
|
-
*
|
|
6124
|
+
* A `script` sanitizer which only lets trusted javascript through.
|
|
6125
|
+
*
|
|
6126
|
+
* This passes only `script`s marked trusted by calling {@link
|
|
6127
|
+
* bypassSanitizationTrustScript}.
|
|
6128
|
+
*
|
|
6129
|
+
* @param unsafeScript untrusted `script`, typically from the user.
|
|
6130
|
+
* @returns `url` string which is safe to bind to the `<script>` element such as `<img src>`,
|
|
6131
|
+
* because only trusted `scripts` have been allowed to pass.
|
|
6132
|
+
*
|
|
6133
|
+
* @codeGenApi
|
|
5931
6134
|
*/
|
|
5932
|
-
function
|
|
5933
|
-
|
|
6135
|
+
function ɵɵsanitizeScript(unsafeScript) {
|
|
6136
|
+
const sanitizer = getSanitizer();
|
|
6137
|
+
if (sanitizer) {
|
|
6138
|
+
return trustedScriptFromStringBypass(sanitizer.sanitize(SecurityContext.SCRIPT, unsafeScript) || '');
|
|
6139
|
+
}
|
|
6140
|
+
if (allowSanitizationBypassAndThrow(unsafeScript, "Script" /* BypassType.Script */)) {
|
|
6141
|
+
return trustedScriptFromStringBypass(unwrapSafeValue(unsafeScript));
|
|
6142
|
+
}
|
|
6143
|
+
throw new RuntimeError(905 /* RuntimeErrorCode.UNSAFE_VALUE_IN_SCRIPT */, ngDevMode && 'unsafe value used in a script context');
|
|
5934
6144
|
}
|
|
5935
6145
|
/**
|
|
5936
|
-
*
|
|
6146
|
+
* A template tag function for promoting the associated constant literal to a
|
|
6147
|
+
* TrustedHTML. Interpolation is explicitly not allowed.
|
|
6148
|
+
*
|
|
6149
|
+
* @param html constant template literal containing trusted HTML.
|
|
6150
|
+
* @returns TrustedHTML wrapping `html`.
|
|
6151
|
+
*
|
|
6152
|
+
* @security This is a security-sensitive function and should only be used to
|
|
6153
|
+
* convert constant values of attributes and properties found in
|
|
6154
|
+
* application-provided Angular templates to TrustedHTML.
|
|
6155
|
+
*
|
|
6156
|
+
* @codeGenApi
|
|
5937
6157
|
*/
|
|
5938
|
-
function
|
|
5939
|
-
|
|
6158
|
+
function ɵɵtrustConstantHtml(html) {
|
|
6159
|
+
// The following runtime check ensures that the function was called as a
|
|
6160
|
+
// template tag (e.g. ɵɵtrustConstantHtml`content`), without any interpolation
|
|
6161
|
+
// (e.g. not ɵɵtrustConstantHtml`content ${variable}`). A TemplateStringsArray
|
|
6162
|
+
// is an array with a `raw` property that is also an array. The associated
|
|
6163
|
+
// template literal has no interpolation if and only if the length of the
|
|
6164
|
+
// TemplateStringsArray is 1.
|
|
6165
|
+
if (ngDevMode && (!Array.isArray(html) || !Array.isArray(html.raw) || html.length !== 1)) {
|
|
6166
|
+
throw new Error(`Unexpected interpolation in trusted HTML constant: ${html.join('?')}`);
|
|
6167
|
+
}
|
|
6168
|
+
return trustedHTMLFromString(html[0]);
|
|
5940
6169
|
}
|
|
5941
6170
|
/**
|
|
5942
|
-
*
|
|
5943
|
-
*
|
|
5944
|
-
* This check is relevant for JIT-compiled components (for AOT-compiled
|
|
5945
|
-
* ones this check happens at build time).
|
|
6171
|
+
* A template tag function for promoting the associated constant literal to a
|
|
6172
|
+
* TrustedScriptURL. Interpolation is explicitly not allowed.
|
|
5946
6173
|
*
|
|
5947
|
-
*
|
|
5948
|
-
*
|
|
5949
|
-
* - it's a known custom element
|
|
5950
|
-
* - the element matches any directive
|
|
5951
|
-
* - the element is allowed by one of the schemas
|
|
6174
|
+
* @param url constant template literal containing a trusted script URL.
|
|
6175
|
+
* @returns TrustedScriptURL wrapping `url`.
|
|
5952
6176
|
*
|
|
5953
|
-
* @
|
|
5954
|
-
*
|
|
6177
|
+
* @security This is a security-sensitive function and should only be used to
|
|
6178
|
+
* convert constant values of attributes and properties found in
|
|
6179
|
+
* application-provided Angular templates to TrustedScriptURL.
|
|
6180
|
+
*
|
|
6181
|
+
* @codeGenApi
|
|
5955
6182
|
*/
|
|
5956
|
-
function
|
|
5957
|
-
|
|
5958
|
-
//
|
|
5959
|
-
//
|
|
5960
|
-
//
|
|
5961
|
-
//
|
|
5962
|
-
|
|
5963
|
-
|
|
5964
|
-
|
|
5965
|
-
// If the element matches any directive, it's considered as valid.
|
|
5966
|
-
if (!isDirectiveHost(tNode) && tagName !== null) {
|
|
5967
|
-
// The element is unknown if it's an instance of HTMLUnknownElement, or it isn't registered
|
|
5968
|
-
// as a custom element. Note that unknown elements with a dash in their name won't be instances
|
|
5969
|
-
// of HTMLUnknownElement in browsers that support web components.
|
|
5970
|
-
const isUnknown =
|
|
5971
|
-
// Note that we can't check for `typeof HTMLUnknownElement === 'function'` because
|
|
5972
|
-
// Domino doesn't expose HTMLUnknownElement globally.
|
|
5973
|
-
(typeof HTMLUnknownElement !== 'undefined' &&
|
|
5974
|
-
HTMLUnknownElement &&
|
|
5975
|
-
getNativeByTNode(tNode, lView) instanceof HTMLUnknownElement) ||
|
|
5976
|
-
(typeof customElements !== 'undefined' &&
|
|
5977
|
-
tagName.indexOf('-') > -1 &&
|
|
5978
|
-
!customElements.get(tagName));
|
|
5979
|
-
if (isUnknown && !matchingSchemas(tView.schemas, tagName)) {
|
|
5980
|
-
const isHostStandalone = isHostComponentStandalone(lView);
|
|
5981
|
-
const templateLocation = getTemplateLocationDetails(lView);
|
|
5982
|
-
const schemas = `'${isHostStandalone ? '@Component' : '@NgModule'}.schemas'`;
|
|
5983
|
-
let message = `'${tagName}' is not a known element${templateLocation}:\n`;
|
|
5984
|
-
message += `1. If '${tagName}' is an Angular component, then verify that it is ${isHostStandalone
|
|
5985
|
-
? "included in the '@Component.imports' of this component"
|
|
5986
|
-
: 'a part of an @NgModule where this component is declared'}.\n`;
|
|
5987
|
-
if (tagName && tagName.indexOf('-') > -1) {
|
|
5988
|
-
message += `2. If '${tagName}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the ${schemas} of this component to suppress this message.`;
|
|
5989
|
-
}
|
|
5990
|
-
else {
|
|
5991
|
-
message += `2. To allow any element add 'NO_ERRORS_SCHEMA' to the ${schemas} of this component.`;
|
|
5992
|
-
}
|
|
5993
|
-
if (shouldThrowErrorOnUnknownElement) {
|
|
5994
|
-
throw new RuntimeError(304 /* RuntimeErrorCode.UNKNOWN_ELEMENT */, message);
|
|
5995
|
-
}
|
|
5996
|
-
else {
|
|
5997
|
-
console.error(formatRuntimeError(304 /* RuntimeErrorCode.UNKNOWN_ELEMENT */, message));
|
|
5998
|
-
}
|
|
5999
|
-
}
|
|
6183
|
+
function ɵɵtrustConstantResourceUrl(url) {
|
|
6184
|
+
// The following runtime check ensures that the function was called as a
|
|
6185
|
+
// template tag (e.g. ɵɵtrustConstantResourceUrl`content`), without any
|
|
6186
|
+
// interpolation (e.g. not ɵɵtrustConstantResourceUrl`content ${variable}`). A
|
|
6187
|
+
// TemplateStringsArray is an array with a `raw` property that is also an
|
|
6188
|
+
// array. The associated template literal has no interpolation if and only if
|
|
6189
|
+
// the length of the TemplateStringsArray is 1.
|
|
6190
|
+
if (ngDevMode && (!Array.isArray(url) || !Array.isArray(url.raw) || url.length !== 1)) {
|
|
6191
|
+
throw new Error(`Unexpected interpolation in trusted URL constant: ${url.join('?')}`);
|
|
6000
6192
|
}
|
|
6193
|
+
return trustedScriptURLFromString(url[0]);
|
|
6001
6194
|
}
|
|
6195
|
+
// Define sets outside the function for O(1) lookups and memory efficiency
|
|
6196
|
+
const SRC_RESOURCE_TAGS = new Set(['embed', 'frame', 'iframe', 'media', 'script']);
|
|
6197
|
+
const HREF_RESOURCE_TAGS = new Set(['base', 'link', 'script']);
|
|
6002
6198
|
/**
|
|
6003
|
-
*
|
|
6004
|
-
* false if it's not the case.
|
|
6005
|
-
* This check is relevant for JIT-compiled components (for AOT-compiled
|
|
6006
|
-
* ones this check happens at build time).
|
|
6007
|
-
*
|
|
6008
|
-
* The property is considered known if either:
|
|
6009
|
-
* - it's a known property of the element
|
|
6010
|
-
* - the element is allowed by one of the schemas
|
|
6011
|
-
* - the property is used for animations
|
|
6199
|
+
* Detects which sanitizer to use for URL property, based on tag name and prop name.
|
|
6012
6200
|
*
|
|
6013
|
-
*
|
|
6014
|
-
*
|
|
6015
|
-
*
|
|
6016
|
-
* @param schemas Array of schemas
|
|
6201
|
+
* The rules are based on the RESOURCE_URL context config from
|
|
6202
|
+
* `packages/compiler/src/schema/dom_security_schema.ts`.
|
|
6203
|
+
* If tag and prop names don't match Resource URL schema, use URL sanitizer.
|
|
6017
6204
|
*/
|
|
6018
|
-
function
|
|
6019
|
-
|
|
6020
|
-
|
|
6021
|
-
|
|
6022
|
-
|
|
6023
|
-
if (schemas === null)
|
|
6024
|
-
return true;
|
|
6025
|
-
// The property is considered valid if the element matches the schema, it exists on the element,
|
|
6026
|
-
// or it is synthetic.
|
|
6027
|
-
if (matchingSchemas(schemas, tagName) || propName in element || isAnimationProp(propName)) {
|
|
6028
|
-
return true;
|
|
6029
|
-
}
|
|
6030
|
-
// Note: `typeof Node` returns 'function' in most browsers, but is undefined with domino.
|
|
6031
|
-
return typeof Node === 'undefined' || Node === null || !(element instanceof Node);
|
|
6205
|
+
function getUrlSanitizer(tag, prop) {
|
|
6206
|
+
const isResource = (prop === 'src' && SRC_RESOURCE_TAGS.has(tag)) ||
|
|
6207
|
+
(prop === 'href' && HREF_RESOURCE_TAGS.has(tag)) ||
|
|
6208
|
+
(prop === 'xlink:href' && tag === 'script');
|
|
6209
|
+
return isResource ? ɵɵsanitizeResourceUrl : ɵɵsanitizeUrl;
|
|
6032
6210
|
}
|
|
6033
6211
|
/**
|
|
6034
|
-
*
|
|
6212
|
+
* Sanitizes URL, selecting sanitizer function based on tag and property names.
|
|
6035
6213
|
*
|
|
6036
|
-
*
|
|
6037
|
-
*
|
|
6038
|
-
*
|
|
6039
|
-
*
|
|
6214
|
+
* This function is used in case we can't define security context at compile time, when only prop
|
|
6215
|
+
* name is available. This happens when we generate host bindings for Directives/Components. The
|
|
6216
|
+
* host element is unknown at compile time, so we defer calculation of specific sanitizer to
|
|
6217
|
+
* runtime.
|
|
6218
|
+
*
|
|
6219
|
+
* @param unsafeUrl untrusted `url`, typically from the user.
|
|
6220
|
+
* @param tag target element tag name.
|
|
6221
|
+
* @param prop name of the property that contains the value.
|
|
6222
|
+
* @returns `url` string which is safe to bind.
|
|
6223
|
+
*
|
|
6224
|
+
* @codeGenApi
|
|
6040
6225
|
*/
|
|
6041
|
-
function
|
|
6042
|
-
|
|
6043
|
-
// an `<ng-template>` element, for example: `<ng-template *ngIf="true">`.
|
|
6044
|
-
// In this case the compiler generates the `ɵɵtemplate` instruction with
|
|
6045
|
-
// the `null` as the tagName. The directive matching logic at runtime relies
|
|
6046
|
-
// on this effect (see `isInlineTemplate`), thus using the 'ng-template' as
|
|
6047
|
-
// a default value of the `tNode.value` is not feasible at this moment.
|
|
6048
|
-
if (!tagName && nodeType === 4 /* TNodeType.Container */) {
|
|
6049
|
-
tagName = 'ng-template';
|
|
6050
|
-
}
|
|
6051
|
-
const isHostStandalone = isHostComponentStandalone(lView);
|
|
6052
|
-
const templateLocation = getTemplateLocationDetails(lView);
|
|
6053
|
-
let message = `Can't bind to '${propName}' since it isn't a known property of '${tagName}'${templateLocation}.`;
|
|
6054
|
-
const schemas = `'${isHostStandalone ? '@Component' : '@NgModule'}.schemas'`;
|
|
6055
|
-
const importLocation = isHostStandalone
|
|
6056
|
-
? "included in the '@Component.imports' of this component"
|
|
6057
|
-
: 'a part of an @NgModule where this component is declared';
|
|
6058
|
-
if (KNOWN_CONTROL_FLOW_DIRECTIVES.has(propName)) {
|
|
6059
|
-
// Most likely this is a control flow directive (such as `*ngIf`) used in
|
|
6060
|
-
// a template, but the directive or the `CommonModule` is not imported.
|
|
6061
|
-
const correspondingImport = KNOWN_CONTROL_FLOW_DIRECTIVES.get(propName);
|
|
6062
|
-
message +=
|
|
6063
|
-
`\nIf the '${propName}' is an Angular control flow directive, ` +
|
|
6064
|
-
`please make sure that either the '${correspondingImport}' directive or the 'CommonModule' is ${importLocation}.`;
|
|
6065
|
-
}
|
|
6066
|
-
else {
|
|
6067
|
-
// May be an Angular component, which is not imported/declared?
|
|
6068
|
-
message +=
|
|
6069
|
-
`\n1. If '${tagName}' is an Angular component and it has the ` +
|
|
6070
|
-
`'${propName}' input, then verify that it is ${importLocation}.`;
|
|
6071
|
-
// May be a Web Component?
|
|
6072
|
-
if (tagName && tagName.indexOf('-') > -1) {
|
|
6073
|
-
message +=
|
|
6074
|
-
`\n2. If '${tagName}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' ` +
|
|
6075
|
-
`to the ${schemas} of this component to suppress this message.`;
|
|
6076
|
-
message +=
|
|
6077
|
-
`\n3. To allow any property add 'NO_ERRORS_SCHEMA' to ` +
|
|
6078
|
-
`the ${schemas} of this component.`;
|
|
6079
|
-
}
|
|
6080
|
-
else {
|
|
6081
|
-
// If it's expected, the error can be suppressed by the `NO_ERRORS_SCHEMA` schema.
|
|
6082
|
-
message +=
|
|
6083
|
-
`\n2. To allow any property add 'NO_ERRORS_SCHEMA' to ` +
|
|
6084
|
-
`the ${schemas} of this component.`;
|
|
6085
|
-
}
|
|
6086
|
-
}
|
|
6087
|
-
reportUnknownPropertyError(message);
|
|
6226
|
+
function ɵɵsanitizeUrlOrResourceUrl(unsafeUrl, tag, prop) {
|
|
6227
|
+
return getUrlSanitizer(tag, prop)(unsafeUrl);
|
|
6088
6228
|
}
|
|
6089
|
-
function
|
|
6090
|
-
if (
|
|
6091
|
-
|
|
6229
|
+
function validateAgainstEventProperties(name) {
|
|
6230
|
+
if (name.toLowerCase().startsWith('on')) {
|
|
6231
|
+
const errorMessage = `Binding to event property '${name}' is disallowed for security reasons, ` +
|
|
6232
|
+
`please use (${name.slice(2)})=...` +
|
|
6233
|
+
`\nIf '${name}' is a directive input, make sure the directive is imported by the` +
|
|
6234
|
+
` current module.`;
|
|
6235
|
+
throw new RuntimeError(306 /* RuntimeErrorCode.INVALID_EVENT_BINDING */, errorMessage);
|
|
6092
6236
|
}
|
|
6093
|
-
|
|
6094
|
-
|
|
6237
|
+
}
|
|
6238
|
+
function validateAgainstEventAttributes(name) {
|
|
6239
|
+
if (name.toLowerCase().startsWith('on')) {
|
|
6240
|
+
const errorMessage = `Binding to event attribute '${name}' is disallowed for security reasons, ` +
|
|
6241
|
+
`please use (${name.slice(2)})=...`;
|
|
6242
|
+
throw new RuntimeError(306 /* RuntimeErrorCode.INVALID_EVENT_BINDING */, errorMessage);
|
|
6095
6243
|
}
|
|
6096
6244
|
}
|
|
6245
|
+
function getSanitizer() {
|
|
6246
|
+
const lView = getLView();
|
|
6247
|
+
return lView && lView[ENVIRONMENT].sanitizer;
|
|
6248
|
+
}
|
|
6249
|
+
const attributeName = new Set(['attributename']);
|
|
6250
|
+
/**
|
|
6251
|
+
* @remarks Keep this in sync with DOM Security Schema.
|
|
6252
|
+
* @see [SECURITY_SCHEMA](../../../compiler/src/schema/dom_security_schema.ts)
|
|
6253
|
+
*/
|
|
6254
|
+
const SECURITY_SENSITIVE_ELEMENTS = {
|
|
6255
|
+
'iframe': new Set([
|
|
6256
|
+
'sandbox',
|
|
6257
|
+
'allow',
|
|
6258
|
+
'allowfullscreen',
|
|
6259
|
+
'referrerpolicy',
|
|
6260
|
+
'csp',
|
|
6261
|
+
'fetchpriority',
|
|
6262
|
+
]),
|
|
6263
|
+
'animate': attributeName,
|
|
6264
|
+
'set': attributeName,
|
|
6265
|
+
'animatemotion': attributeName,
|
|
6266
|
+
'animatetransform': attributeName,
|
|
6267
|
+
};
|
|
6097
6268
|
/**
|
|
6098
|
-
*
|
|
6099
|
-
* and must **not** be used in production bundles. The function makes megamorphic reads, which might
|
|
6100
|
-
* be too slow for production mode and also it relies on the constructor function being available.
|
|
6101
|
-
*
|
|
6102
|
-
* Gets a reference to the host component def (where a current component is declared).
|
|
6269
|
+
* Validates that the attribute binding is safe to use.
|
|
6103
6270
|
*
|
|
6104
|
-
* @param
|
|
6271
|
+
* @param value The value of the attribute.
|
|
6272
|
+
* @param tagName The name of the tag.
|
|
6273
|
+
* @param attributeName The name of the attribute.
|
|
6105
6274
|
*/
|
|
6106
|
-
function
|
|
6107
|
-
|
|
6108
|
-
const
|
|
6109
|
-
|
|
6110
|
-
|
|
6111
|
-
|
|
6112
|
-
|
|
6113
|
-
|
|
6275
|
+
function ɵɵvalidateAttribute(value, tagName, attributeName) {
|
|
6276
|
+
const lowerCaseTagName = tagName.toLowerCase();
|
|
6277
|
+
const lowerCaseAttrName = attributeName.toLowerCase();
|
|
6278
|
+
if (!SECURITY_SENSITIVE_ELEMENTS[lowerCaseTagName]?.has(lowerCaseAttrName)) {
|
|
6279
|
+
return value;
|
|
6280
|
+
}
|
|
6281
|
+
const tNode = getSelectedTNode();
|
|
6282
|
+
if (tNode.type !== 2 /* TNodeType.Element */) {
|
|
6283
|
+
return value;
|
|
6284
|
+
}
|
|
6285
|
+
const lView = getLView();
|
|
6286
|
+
if (lowerCaseTagName === 'iframe') {
|
|
6287
|
+
const element = getNativeByTNode(tNode, lView);
|
|
6288
|
+
enforceIframeSecurity(element);
|
|
6289
|
+
}
|
|
6290
|
+
const errorMessage = ngDevMode &&
|
|
6291
|
+
`Angular has detected that the \`${attributeName}\` was applied ` +
|
|
6292
|
+
`as a binding to the <${tagName}> element${getTemplateLocationDetails(lView)}. ` +
|
|
6293
|
+
`For security reasons, the \`${attributeName}\` can be set on the <${tagName}> element ` +
|
|
6294
|
+
`as a static attribute only. \n` +
|
|
6295
|
+
`To fix this, switch the \`${attributeName}\` binding to a static attribute ` +
|
|
6296
|
+
`in a template or in host bindings section.`;
|
|
6297
|
+
throw new RuntimeError(-910 /* RuntimeErrorCode.UNSAFE_ATTRIBUTE_BINDING */, errorMessage);
|
|
6114
6298
|
}
|
|
6299
|
+
|
|
6300
|
+
/** Defines the default value of the `NG_REFLECT_ATTRS_FLAG` flag. */
|
|
6301
|
+
const NG_REFLECT_ATTRS_FLAG_DEFAULT = false;
|
|
6115
6302
|
/**
|
|
6116
|
-
*
|
|
6117
|
-
*
|
|
6118
|
-
* be too slow for production mode.
|
|
6119
|
-
*
|
|
6120
|
-
* Checks if the current component is declared inside of a standalone component template.
|
|
6121
|
-
*
|
|
6122
|
-
* @param lView An `LView` that represents a current component that is being rendered.
|
|
6303
|
+
* Defines an internal flag that indicates whether the runtime code should be
|
|
6304
|
+
* producing `ng-reflect-*` attributes.
|
|
6123
6305
|
*/
|
|
6124
|
-
|
|
6125
|
-
|
|
6126
|
-
|
|
6127
|
-
|
|
6128
|
-
return !!componentDef?.standalone;
|
|
6129
|
-
}
|
|
6306
|
+
const NG_REFLECT_ATTRS_FLAG = new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'NG_REFLECT_FLAG' : '', {
|
|
6307
|
+
providedIn: 'root',
|
|
6308
|
+
factory: () => NG_REFLECT_ATTRS_FLAG_DEFAULT,
|
|
6309
|
+
});
|
|
6130
6310
|
/**
|
|
6131
|
-
*
|
|
6132
|
-
* and must **not** be used in production bundles. The function makes megamorphic reads, which might
|
|
6133
|
-
* be too slow for production mode.
|
|
6311
|
+
* Enables the logic to produce `ng-reflect-*` attributes on elements with bindings.
|
|
6134
6312
|
*
|
|
6135
|
-
*
|
|
6136
|
-
*
|
|
6313
|
+
* Note: this is a dev-mode only setting and it will have no effect in production mode.
|
|
6314
|
+
* In production mode, the `ng-reflect-*` attributes are *never* produced by Angular.
|
|
6137
6315
|
*
|
|
6138
|
-
*
|
|
6316
|
+
* Important: using and relying on the `ng-reflect-*` attributes is not recommended,
|
|
6317
|
+
* they are deprecated and only present for backwards compatibility. Angular will stop
|
|
6318
|
+
* producing them in one of the future versions.
|
|
6319
|
+
*
|
|
6320
|
+
* @publicApi
|
|
6139
6321
|
*/
|
|
6140
|
-
function
|
|
6141
|
-
|
|
6142
|
-
|
|
6143
|
-
|
|
6144
|
-
|
|
6322
|
+
function provideNgReflectAttributes() {
|
|
6323
|
+
const providers = typeof ngDevMode === 'undefined' || ngDevMode
|
|
6324
|
+
? [
|
|
6325
|
+
{
|
|
6326
|
+
provide: NG_REFLECT_ATTRS_FLAG,
|
|
6327
|
+
useValue: true,
|
|
6328
|
+
},
|
|
6329
|
+
]
|
|
6330
|
+
: [];
|
|
6331
|
+
return makeEnvironmentProviders(providers);
|
|
6145
6332
|
}
|
|
6146
|
-
|
|
6147
|
-
|
|
6148
|
-
|
|
6149
|
-
|
|
6150
|
-
|
|
6151
|
-
const
|
|
6152
|
-
|
|
6153
|
-
|
|
6154
|
-
|
|
6155
|
-
|
|
6156
|
-
|
|
6157
|
-
|
|
6158
|
-
|
|
6159
|
-
|
|
6160
|
-
|
|
6161
|
-
|
|
6162
|
-
function matchingSchemas(schemas, tagName) {
|
|
6163
|
-
if (schemas !== null) {
|
|
6164
|
-
for (let i = 0; i < schemas.length; i++) {
|
|
6165
|
-
const schema = schemas[i];
|
|
6166
|
-
if (schema === NO_ERRORS_SCHEMA ||
|
|
6167
|
-
(schema === CUSTOM_ELEMENTS_SCHEMA && tagName && tagName.indexOf('-') > -1)) {
|
|
6168
|
-
return true;
|
|
6169
|
-
}
|
|
6170
|
-
}
|
|
6333
|
+
function normalizeDebugBindingName(name) {
|
|
6334
|
+
// Attribute names with `$` (eg `x-y$`) are valid per spec, but unsupported by some browsers
|
|
6335
|
+
name = camelCaseToDashCase(name.replace(/[$@]/g, '_'));
|
|
6336
|
+
return `ng-reflect-${name}`;
|
|
6337
|
+
}
|
|
6338
|
+
const CAMEL_CASE_REGEXP = /([A-Z])/g;
|
|
6339
|
+
function camelCaseToDashCase(input) {
|
|
6340
|
+
return input.replace(CAMEL_CASE_REGEXP, (...m) => '-' + m[1].toLowerCase());
|
|
6341
|
+
}
|
|
6342
|
+
function normalizeDebugBindingValue(value) {
|
|
6343
|
+
try {
|
|
6344
|
+
// Limit the size of the value as otherwise the DOM just gets polluted.
|
|
6345
|
+
return value != null ? value.toString().slice(0, 30) : value;
|
|
6346
|
+
}
|
|
6347
|
+
catch (e) {
|
|
6348
|
+
return '[ERROR] Exception while trying to serialize the value';
|
|
6171
6349
|
}
|
|
6172
|
-
return false;
|
|
6173
6350
|
}
|
|
6174
6351
|
|
|
6175
6352
|
/**
|
|
@@ -6765,114 +6942,6 @@ function extractAttrsAndClassesFromSelector(selector) {
|
|
|
6765
6942
|
/** A special value which designates that a value has not changed. */
|
|
6766
6943
|
const NO_CHANGE = typeof ngDevMode === 'undefined' || ngDevMode ? { __brand__: 'NO_CHANGE' } : {};
|
|
6767
6944
|
|
|
6768
|
-
function createTextNode(renderer, value) {
|
|
6769
|
-
return renderer.createText(value);
|
|
6770
|
-
}
|
|
6771
|
-
function updateTextNode(renderer, rNode, value) {
|
|
6772
|
-
renderer.setValue(rNode, value);
|
|
6773
|
-
}
|
|
6774
|
-
function createCommentNode(renderer, value) {
|
|
6775
|
-
return renderer.createComment(escapeCommentText(value));
|
|
6776
|
-
}
|
|
6777
|
-
/**
|
|
6778
|
-
* Creates a native element from a tag name, using a renderer.
|
|
6779
|
-
* @param renderer A renderer to use
|
|
6780
|
-
* @param name the tag name
|
|
6781
|
-
* @param namespace Optional namespace for element.
|
|
6782
|
-
* @returns the element created
|
|
6783
|
-
*/
|
|
6784
|
-
function createElementNode(renderer, name, namespace) {
|
|
6785
|
-
return renderer.createElement(name, namespace);
|
|
6786
|
-
}
|
|
6787
|
-
/**
|
|
6788
|
-
* Inserts a native node before another native node for a given parent.
|
|
6789
|
-
* This is a utility function that can be used when native nodes were determined.
|
|
6790
|
-
*/
|
|
6791
|
-
function nativeInsertBefore(renderer, parent, child, beforeNode, isMove) {
|
|
6792
|
-
renderer.insertBefore(parent, child, beforeNode, isMove);
|
|
6793
|
-
}
|
|
6794
|
-
function nativeAppendChild(renderer, parent, child) {
|
|
6795
|
-
ngDevMode && assertDefined(parent, 'parent node must be defined');
|
|
6796
|
-
renderer.appendChild(parent, child);
|
|
6797
|
-
}
|
|
6798
|
-
function nativeAppendOrInsertBefore(renderer, parent, child, beforeNode, isMove) {
|
|
6799
|
-
if (beforeNode !== null) {
|
|
6800
|
-
nativeInsertBefore(renderer, parent, child, beforeNode, isMove);
|
|
6801
|
-
}
|
|
6802
|
-
else {
|
|
6803
|
-
nativeAppendChild(renderer, parent, child);
|
|
6804
|
-
}
|
|
6805
|
-
}
|
|
6806
|
-
/**
|
|
6807
|
-
* Removes a native node itself using a given renderer. To remove the node we are looking up its
|
|
6808
|
-
* parent from the native tree as not all platforms / browsers support the equivalent of
|
|
6809
|
-
* node.remove().
|
|
6810
|
-
*
|
|
6811
|
-
* @param renderer A renderer to be used
|
|
6812
|
-
* @param rNode The native node that should be removed
|
|
6813
|
-
* @param isHostElement A flag indicating if a node to be removed is a host of a component.
|
|
6814
|
-
* @param requireSynchronousElementRemoval A flag indicating if a node requires synchronous
|
|
6815
|
-
* removal from the DOM.
|
|
6816
|
-
*/
|
|
6817
|
-
function nativeRemoveNode(renderer, rNode, isHostElement, requireSynchronousElementRemoval) {
|
|
6818
|
-
renderer.removeChild(null, rNode, isHostElement, requireSynchronousElementRemoval);
|
|
6819
|
-
}
|
|
6820
|
-
/**
|
|
6821
|
-
* Clears the contents of a given RElement.
|
|
6822
|
-
*
|
|
6823
|
-
* @param rElement the native RElement to be cleared
|
|
6824
|
-
*/
|
|
6825
|
-
function clearElementContents(rElement) {
|
|
6826
|
-
rElement.textContent = '';
|
|
6827
|
-
}
|
|
6828
|
-
/**
|
|
6829
|
-
* Write `cssText` to `RElement`.
|
|
6830
|
-
*
|
|
6831
|
-
* This function does direct write without any reconciliation. Used for writing initial values, so
|
|
6832
|
-
* that static styling values do not pull in the style parser.
|
|
6833
|
-
*
|
|
6834
|
-
* @param renderer Renderer to use
|
|
6835
|
-
* @param element The element which needs to be updated.
|
|
6836
|
-
* @param newValue The new class list to write.
|
|
6837
|
-
*/
|
|
6838
|
-
function writeDirectStyle(renderer, element, newValue) {
|
|
6839
|
-
ngDevMode && assertString(newValue, "'newValue' should be a string");
|
|
6840
|
-
renderer.setAttribute(element, 'style', newValue);
|
|
6841
|
-
}
|
|
6842
|
-
/**
|
|
6843
|
-
* Write `className` to `RElement`.
|
|
6844
|
-
*
|
|
6845
|
-
* This function does direct write without any reconciliation. Used for writing initial values, so
|
|
6846
|
-
* that static styling values do not pull in the style parser.
|
|
6847
|
-
*
|
|
6848
|
-
* @param renderer Renderer to use
|
|
6849
|
-
* @param element The element which needs to be updated.
|
|
6850
|
-
* @param newValue The new class list to write.
|
|
6851
|
-
*/
|
|
6852
|
-
function writeDirectClass(renderer, element, newValue) {
|
|
6853
|
-
ngDevMode && assertString(newValue, "'newValue' should be a string");
|
|
6854
|
-
if (newValue === '') {
|
|
6855
|
-
// There are tests in `google3` which expect `element.getAttribute('class')` to be `null`.
|
|
6856
|
-
renderer.removeAttribute(element, 'class');
|
|
6857
|
-
}
|
|
6858
|
-
else {
|
|
6859
|
-
renderer.setAttribute(element, 'class', newValue);
|
|
6860
|
-
}
|
|
6861
|
-
}
|
|
6862
|
-
/** Sets up the static DOM attributes on an `RNode`. */
|
|
6863
|
-
function setupStaticAttributes(renderer, element, tNode) {
|
|
6864
|
-
const { mergedAttrs, classes, styles } = tNode;
|
|
6865
|
-
if (mergedAttrs !== null) {
|
|
6866
|
-
setUpAttributes(renderer, element, mergedAttrs);
|
|
6867
|
-
}
|
|
6868
|
-
if (classes !== null) {
|
|
6869
|
-
writeDirectClass(renderer, element, classes);
|
|
6870
|
-
}
|
|
6871
|
-
if (styles !== null) {
|
|
6872
|
-
writeDirectStyle(renderer, element, styles);
|
|
6873
|
-
}
|
|
6874
|
-
}
|
|
6875
|
-
|
|
6876
6945
|
/**
|
|
6877
6946
|
* Creates a TView instance
|
|
6878
6947
|
*
|
|
@@ -14651,7 +14720,7 @@ class ComponentFactory extends ComponentFactory$1 {
|
|
|
14651
14720
|
}
|
|
14652
14721
|
function createRootTView(rootSelectorOrNode, componentDef, componentBindings, directives) {
|
|
14653
14722
|
const tAttributes = rootSelectorOrNode
|
|
14654
|
-
? ['ng-version', '20.3.
|
|
14723
|
+
? ['ng-version', '20.3.16']
|
|
14655
14724
|
: // Extract attributes and classes from the first selector only to match VE behavior.
|
|
14656
14725
|
extractAttrsAndClassesFromSelector(componentDef.selectors[0]);
|
|
14657
14726
|
let creationBindings = null;
|
|
@@ -15924,41 +15993,6 @@ function setAllowDuplicateNgModuleIdsForTest(allowDuplicates) {
|
|
|
15924
15993
|
checkForDuplicateNgModules = !allowDuplicates;
|
|
15925
15994
|
}
|
|
15926
15995
|
|
|
15927
|
-
/**
|
|
15928
|
-
* Validation function invoked at runtime for each binding that might potentially
|
|
15929
|
-
* represent a security-sensitive attribute of an <iframe>.
|
|
15930
|
-
* See `IFRAME_SECURITY_SENSITIVE_ATTRS` in the
|
|
15931
|
-
* `packages/compiler/src/schema/dom_security_schema.ts` script for the full list
|
|
15932
|
-
* of such attributes.
|
|
15933
|
-
*
|
|
15934
|
-
* @codeGenApi
|
|
15935
|
-
*/
|
|
15936
|
-
function ɵɵvalidateIframeAttribute(attrValue, tagName, attrName) {
|
|
15937
|
-
const lView = getLView();
|
|
15938
|
-
const tNode = getSelectedTNode();
|
|
15939
|
-
const element = getNativeByTNode(tNode, lView);
|
|
15940
|
-
// Restrict any dynamic bindings of security-sensitive attributes/properties
|
|
15941
|
-
// on an <iframe> for security reasons.
|
|
15942
|
-
if (tNode.type === 2 /* TNodeType.Element */ && tagName.toLowerCase() === 'iframe') {
|
|
15943
|
-
const iframe = element;
|
|
15944
|
-
// Unset previously applied `src` and `srcdoc` if we come across a situation when
|
|
15945
|
-
// a security-sensitive attribute is set later via an attribute/property binding.
|
|
15946
|
-
iframe.src = '';
|
|
15947
|
-
iframe.srcdoc = trustedHTMLFromString('');
|
|
15948
|
-
// Also remove the <iframe> from the document.
|
|
15949
|
-
nativeRemoveNode(lView[RENDERER], iframe);
|
|
15950
|
-
const errorMessage = ngDevMode &&
|
|
15951
|
-
`Angular has detected that the \`${attrName}\` was applied ` +
|
|
15952
|
-
`as a binding to an <iframe>${getTemplateLocationDetails(lView)}. ` +
|
|
15953
|
-
`For security reasons, the \`${attrName}\` can be set on an <iframe> ` +
|
|
15954
|
-
`as a static attribute only. \n` +
|
|
15955
|
-
`To fix this, switch the \`${attrName}\` binding to a static attribute ` +
|
|
15956
|
-
`in a template or in host bindings section.`;
|
|
15957
|
-
throw new RuntimeError(-910 /* RuntimeErrorCode.UNSAFE_IFRAME_ATTRS */, errorMessage);
|
|
15958
|
-
}
|
|
15959
|
-
return attrValue;
|
|
15960
|
-
}
|
|
15961
|
-
|
|
15962
15996
|
/**
|
|
15963
15997
|
* Represents an instance of an `NgModule` created by an `NgModuleFactory`.
|
|
15964
15998
|
* Provides access to the `NgModule` instance and related objects.
|
|
@@ -29602,11 +29636,11 @@ const angularCoreEnv = (() => ({
|
|
|
29602
29636
|
'ɵɵsanitizeStyle': ɵɵsanitizeStyle,
|
|
29603
29637
|
'ɵɵsanitizeResourceUrl': ɵɵsanitizeResourceUrl,
|
|
29604
29638
|
'ɵɵsanitizeScript': ɵɵsanitizeScript,
|
|
29639
|
+
'ɵɵvalidateAttribute': ɵɵvalidateAttribute,
|
|
29605
29640
|
'ɵɵsanitizeUrl': ɵɵsanitizeUrl,
|
|
29606
29641
|
'ɵɵsanitizeUrlOrResourceUrl': ɵɵsanitizeUrlOrResourceUrl,
|
|
29607
29642
|
'ɵɵtrustConstantHtml': ɵɵtrustConstantHtml,
|
|
29608
29643
|
'ɵɵtrustConstantResourceUrl': ɵɵtrustConstantResourceUrl,
|
|
29609
|
-
'ɵɵvalidateIframeAttribute': ɵɵvalidateIframeAttribute,
|
|
29610
29644
|
'forwardRef': forwardRef,
|
|
29611
29645
|
'resolveForwardRef': resolveForwardRef,
|
|
29612
29646
|
'ɵɵtwoWayProperty': ɵɵtwoWayProperty,
|
|
@@ -32013,5 +32047,5 @@ function getDebugNode(nativeNode) {
|
|
|
32013
32047
|
return null;
|
|
32014
32048
|
}
|
|
32015
32049
|
|
|
32016
|
-
export { AFTER_RENDER_PHASES, ANIMATIONS_DISABLED, ANIMATION_MODULE_TYPE, APP_BOOTSTRAP_LISTENER, APP_ID, APP_INITIALIZER, AcxChangeDetectionStrategy, AcxViewEncapsulation, AfterRenderImpl, AfterRenderManager, AfterRenderSequence, ApplicationInitStatus, ApplicationRef, Attribute, COMPILER_OPTIONS, CONTAINERS, CSP_NONCE, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionSchedulerImpl, ChangeDetectionStrategy, Compiler, CompilerFactory, Component, ComponentFactory, ComponentFactory$1, ComponentFactoryResolver$1 as ComponentFactoryResolver, ComponentRef$1 as ComponentRef, ComponentRef as ComponentRef$1, Console, DEFAULT_CURRENCY_CODE, DEFAULT_LOCALE_ID, DEFER_BLOCK_CONFIG, DEFER_BLOCK_DEPENDENCY_INTERCEPTOR, DEFER_BLOCK_ID, DEFER_BLOCK_SSR_ID_ATTRIBUTE, DEFER_BLOCK_STATE$1 as DEFER_BLOCK_STATE, DEFER_BLOCK_STATE as DEFER_BLOCK_STATE$1, DEFER_HYDRATE_TRIGGERS, DEFER_PARENT_BLOCK_ID, DEHYDRATED_BLOCK_REGISTRY, DISCONNECTED_NODES, DebugElement, DebugEventListener, DebugNode, DeferBlockBehavior, DeferBlockState, DehydratedBlockRegistry, Directive, ELEMENT_CONTAINERS, EVENT_REPLAY_ENABLED_DEFAULT, ElementRef, EnvironmentNgModuleRefAdapter, EventEmitter, Framework, Host, HostBinding, HostListener, HydrationStatus, I18N_DATA, IMAGE_CONFIG, IMAGE_CONFIG_DEFAULTS, IS_ENABLED_BLOCKING_INITIAL_NAVIGATION, IS_EVENT_REPLAY_ENABLED, IS_HYDRATION_DOM_REUSE_ENABLED, IS_I18N_HYDRATION_ENABLED, IS_INCREMENTAL_HYDRATION_ENABLED, Inject, Injectable, Input, JSACTION_BLOCK_ELEMENT_MAP, JSACTION_EVENT_CONTRACT, LContext, LOCALE_ID, LocaleDataIndex, MAX_ANIMATION_TIMEOUT, MULTIPLIER, MissingTranslationStrategy, ModuleWithComponentFactories, NGH_ATTR_NAME, NGH_DATA_KEY, NGH_DEFER_BLOCKS_KEY, NODES, NOOP_AFTER_RENDER_REF, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, NO_CHANGE, NO_ERRORS_SCHEMA, NUM_ROOT_NODES, NgModule, NgModuleFactory, NgModuleFactory$1, NgModuleRef, NgModuleRef$1, NgProbeToken, NgZone, NoopNgZone, Optional, Output, PACKAGE_ROOT_URL, PLATFORM_ID, PLATFORM_INITIALIZER, PRESERVE_HOST_CONTENT, PROVIDED_NG_ZONE, Pipe, QueryList, ReflectionCapabilities, Renderer2, RendererFactory2, RendererStyleFlags2, SKIP_HYDRATION_ATTR_NAME, SSR_CONTENT_INTEGRITY_MARKER, Sanitizer, SecurityContext, Self, SimpleChange, SkipSelf, TEMPLATES, TEMPLATE_ID, TESTABILITY, TESTABILITY_GETTER, TRANSLATIONS, TRANSLATIONS_FORMAT, TemplateRef, Testability, TestabilityRegistry, TimerScheduler, TracingAction, TracingService, TransferState, Type, UseExhaustiveCheckNoChanges, ViewContainerRef, ViewEncapsulation, ViewRef, _sanitizeHtml, _sanitizeUrl, afterEveryRender, afterNextRender, allLeavingAnimations, allowSanitizationBypassAndThrow, angularCoreEnv, appendDeferBlocksToJSActionMap, asNativeElements, assertComponentDef, assertStandaloneComponentType, bypassSanitizationTrustHtml, bypassSanitizationTrustResourceUrl, bypassSanitizationTrustScript, bypassSanitizationTrustStyle, bypassSanitizationTrustUrl, calcPathForNode, checkNoChangesInternal, cleanupDehydratedViews, clearResolutionOfComponentResourcesQueue, collectNativeNodes, collectNativeNodesInLContainer, compileComponent, compileDirective, compileNgModule, compileNgModuleDefs, compilePipe, convertHydrateTriggersToJsAction, countBlocksSkippedByHydration, createEnvironmentInjector, createMultiResultQuerySignalFn, createNgModule, createNgModuleRef, createNgModuleRefWithProviders, createSingleResultOptionalQuerySignalFn, createSingleResultRequiredQuerySignalFn, depsTracker, devModeEqual, enableApplyRootElementTransformImpl, enableClaimDehydratedIcuCaseImpl, enableFindMatchingDehydratedViewImpl, enableLocateOrCreateContainerAnchorImpl, enableLocateOrCreateContainerRefImpl, enableLocateOrCreateElementContainerNodeImpl, enableLocateOrCreateElementNodeImpl, enableLocateOrCreateI18nNodeImpl, enableLocateOrCreateTextNodeImpl, enablePrepareI18nBlockForHydrationImpl, enableProfiling, enableRetrieveDeferBlockDataImpl, enableRetrieveHydrationInfoImpl, enableStashEventListenerImpl, findLocaleData, flushModuleScopingQueueAsMuchAsPossible, gatherDeferBlocksCommentNodes, generateStandaloneInDeclarationsError, getAsyncClassMetadataFn, getCompilerFacade, getDebugNode, getDeferBlocks$1 as getDeferBlocks, getDirectives, getDocument, getHostElement, getLContext, getLDeferBlockDetails, getLNodeForHydration, getLocaleCurrencyCode, getLocalePluralCase, getNgZone, getNgZoneOptions, getOrComputeI18nChildren, getRegisteredNgModuleType, getSanitizationBypassType, getTDeferBlockDetails, getTransferState, inferTagNameFromDefinition, inputBinding, internalProvideZoneChangeDetection, invokeListeners, isBoundToModule, isComponentDefPendingResolution, isComponentResourceResolutionQueueEmpty, isDeferBlock, isDetachedByI18n, isDisconnectedNode, isI18nHydrationEnabled, isI18nHydrationSupportEnabled, isInSkipHydrationBlock, isIncrementalHydrationEnabled, isJsObject, isLetDeclaration, isListLikeIterable, isNgModule, isPromise, isSubscribable, isTNodeShape, isViewDirty, iterateListLike, makePropDecorator, makeStateKey, markForRefresh, noSideEffects, optionsReducer, outputBinding, patchComponentDefWithScope, performanceMarkFeature, processAndInitTriggers, processBlockData, processTextNodeBeforeSerialization, profiler, provideAppInitializer, provideNgReflectAttributes, provideZoneChangeDetection, provideZonelessChangeDetection, publishDefaultGlobalUtils, publishExternalGlobalUtil, publishSignalConfiguration, readHydrationInfo, readPatchedLView, registerLocaleData, registerNgModuleType, remove, removeListeners, renderDeferBlockState, resetCompiledComponents, resetIncrementalHydrationEnabledWarnedForTests, resetJitOptions, resolveComponentResources, restoreComponentResolutionQueue, setAllowDuplicateNgModuleIdsForTest, setClassMetadata, setClassMetadataAsync, setDocument, setIsI18nHydrationSupportEnabled, setJSActionAttributes, setJitOptions, setLocaleId, setStashFn, setTestabilityGetter, sharedMapFunction, sharedStashFunction, transitiveScopesFor, triggerHydrationFromBlockName, triggerResourceLoading, trySerializeI18nBlock, twoWayBinding, unregisterAllLocaleData, unsupportedProjectionOfDomNodes, unwrapSafeValue, validateMatchingNode, validateNodeExists, verifySsrContentsIntegrity, ɵgetUnknownElementStrictMode, ɵgetUnknownPropertyStrictMode, ɵsetClassDebugInfo, ɵsetUnknownElementStrictMode, ɵsetUnknownPropertyStrictMode, ɵɵCopyDefinitionFeature, ɵɵExternalStylesFeature, ɵɵHostDirectivesFeature, ɵɵInheritDefinitionFeature, ɵɵNgOnChangesFeature, ɵɵProvidersFeature, ɵɵadvance, ɵɵanimateEnter, ɵɵanimateEnterListener, ɵɵanimateLeave, ɵɵanimateLeaveListener, ɵɵariaProperty, ɵɵattachSourceLocations, ɵɵattribute, ɵɵclassMap, ɵɵclassProp, ɵɵcomponentInstance, ɵɵconditional, ɵɵconditionalBranchCreate, ɵɵconditionalCreate, ɵɵcontentQuery, ɵɵcontentQuerySignal, ɵɵdeclareLet, ɵɵdefer, ɵɵdeferEnableTimerScheduling, ɵɵdeferHydrateNever, ɵɵdeferHydrateOnHover, ɵɵdeferHydrateOnIdle, ɵɵdeferHydrateOnImmediate, ɵɵdeferHydrateOnInteraction, ɵɵdeferHydrateOnTimer, ɵɵdeferHydrateOnViewport, ɵɵdeferHydrateWhen, ɵɵdeferOnHover, ɵɵdeferOnIdle, ɵɵdeferOnImmediate, ɵɵdeferOnInteraction, ɵɵdeferOnTimer, ɵɵdeferOnViewport, ɵɵdeferPrefetchOnHover, ɵɵdeferPrefetchOnIdle, ɵɵdeferPrefetchOnImmediate, ɵɵdeferPrefetchOnInteraction, ɵɵdeferPrefetchOnTimer, ɵɵdeferPrefetchOnViewport, ɵɵdeferPrefetchWhen, ɵɵdeferWhen, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵdefineNgModule, ɵɵdefinePipe, ɵɵdirectiveInject, ɵɵdomElement, ɵɵdomElementContainer, ɵɵdomElementContainerEnd, ɵɵdomElementContainerStart, ɵɵdomElementEnd, ɵɵdomElementStart, ɵɵdomListener, ɵɵdomProperty, ɵɵdomTemplate, ɵɵelement, ɵɵelementContainer, ɵɵelementContainerEnd, ɵɵelementContainerStart, ɵɵelementEnd, ɵɵelementStart, ɵɵgetComponentDepsFactory, ɵɵgetCurrentView, ɵɵgetInheritedFactory, ɵɵgetReplaceMetadataURL, ɵɵi18n, ɵɵi18nApply, ɵɵi18nAttributes, ɵɵi18nEnd, ɵɵi18nExp, ɵɵi18nPostprocess, ɵɵi18nStart, ɵɵinjectAttribute, ɵɵinterpolate, ɵɵinterpolate1, ɵɵinterpolate2, ɵɵinterpolate3, ɵɵinterpolate4, ɵɵinterpolate5, ɵɵinterpolate6, ɵɵinterpolate7, ɵɵinterpolate8, ɵɵinterpolateV, ɵɵinvalidFactory, ɵɵlistener, ɵɵloadQuery, ɵɵnextContext, ɵɵpipe, ɵɵpipeBind1, ɵɵpipeBind2, ɵɵpipeBind3, ɵɵpipeBind4, ɵɵpipeBindV, ɵɵprojection, ɵɵprojectionDef, ɵɵproperty, ɵɵpureFunction0, ɵɵpureFunction1, ɵɵpureFunction2, ɵɵpureFunction3, ɵɵpureFunction4, ɵɵpureFunction5, ɵɵpureFunction6, ɵɵpureFunction7, ɵɵpureFunction8, ɵɵpureFunctionV, ɵɵqueryAdvance, ɵɵqueryRefresh, ɵɵreadContextLet, ɵɵreference, ɵɵrepeater, ɵɵrepeaterCreate, ɵɵrepeaterTrackByIdentity, ɵɵrepeaterTrackByIndex, ɵɵreplaceMetadata, ɵɵresolveBody, ɵɵresolveDocument, ɵɵresolveWindow, ɵɵsanitizeHtml, ɵɵsanitizeResourceUrl, ɵɵsanitizeScript, ɵɵsanitizeStyle, ɵɵsanitizeUrl, ɵɵsanitizeUrlOrResourceUrl, ɵɵsetComponentScope, ɵɵsetNgModuleScope, ɵɵstoreLet, ɵɵstyleMap, ɵɵstyleProp, ɵɵsyntheticHostListener, ɵɵsyntheticHostProperty, ɵɵtemplate, ɵɵtemplateRefExtractor, ɵɵtext, ɵɵtextInterpolate, ɵɵtextInterpolate1, ɵɵtextInterpolate2, ɵɵtextInterpolate3, ɵɵtextInterpolate4, ɵɵtextInterpolate5, ɵɵtextInterpolate6, ɵɵtextInterpolate7, ɵɵtextInterpolate8, ɵɵtextInterpolateV, ɵɵtrustConstantHtml, ɵɵtrustConstantResourceUrl, ɵɵtwoWayBindingSet, ɵɵtwoWayListener, ɵɵtwoWayProperty,
|
|
32050
|
+
export { AFTER_RENDER_PHASES, ANIMATIONS_DISABLED, ANIMATION_MODULE_TYPE, APP_BOOTSTRAP_LISTENER, APP_ID, APP_INITIALIZER, AcxChangeDetectionStrategy, AcxViewEncapsulation, AfterRenderImpl, AfterRenderManager, AfterRenderSequence, ApplicationInitStatus, ApplicationRef, Attribute, COMPILER_OPTIONS, CONTAINERS, CSP_NONCE, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionSchedulerImpl, ChangeDetectionStrategy, Compiler, CompilerFactory, Component, ComponentFactory, ComponentFactory$1, ComponentFactoryResolver$1 as ComponentFactoryResolver, ComponentRef$1 as ComponentRef, ComponentRef as ComponentRef$1, Console, DEFAULT_CURRENCY_CODE, DEFAULT_LOCALE_ID, DEFER_BLOCK_CONFIG, DEFER_BLOCK_DEPENDENCY_INTERCEPTOR, DEFER_BLOCK_ID, DEFER_BLOCK_SSR_ID_ATTRIBUTE, DEFER_BLOCK_STATE$1 as DEFER_BLOCK_STATE, DEFER_BLOCK_STATE as DEFER_BLOCK_STATE$1, DEFER_HYDRATE_TRIGGERS, DEFER_PARENT_BLOCK_ID, DEHYDRATED_BLOCK_REGISTRY, DISCONNECTED_NODES, DebugElement, DebugEventListener, DebugNode, DeferBlockBehavior, DeferBlockState, DehydratedBlockRegistry, Directive, ELEMENT_CONTAINERS, EVENT_REPLAY_ENABLED_DEFAULT, ElementRef, EnvironmentNgModuleRefAdapter, EventEmitter, Framework, Host, HostBinding, HostListener, HydrationStatus, I18N_DATA, IMAGE_CONFIG, IMAGE_CONFIG_DEFAULTS, IS_ENABLED_BLOCKING_INITIAL_NAVIGATION, IS_EVENT_REPLAY_ENABLED, IS_HYDRATION_DOM_REUSE_ENABLED, IS_I18N_HYDRATION_ENABLED, IS_INCREMENTAL_HYDRATION_ENABLED, Inject, Injectable, Input, JSACTION_BLOCK_ELEMENT_MAP, JSACTION_EVENT_CONTRACT, LContext, LOCALE_ID, LocaleDataIndex, MAX_ANIMATION_TIMEOUT, MULTIPLIER, MissingTranslationStrategy, ModuleWithComponentFactories, NGH_ATTR_NAME, NGH_DATA_KEY, NGH_DEFER_BLOCKS_KEY, NODES, NOOP_AFTER_RENDER_REF, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, NO_CHANGE, NO_ERRORS_SCHEMA, NUM_ROOT_NODES, NgModule, NgModuleFactory, NgModuleFactory$1, NgModuleRef, NgModuleRef$1, NgProbeToken, NgZone, NoopNgZone, Optional, Output, PACKAGE_ROOT_URL, PLATFORM_ID, PLATFORM_INITIALIZER, PRESERVE_HOST_CONTENT, PROVIDED_NG_ZONE, Pipe, QueryList, ReflectionCapabilities, Renderer2, RendererFactory2, RendererStyleFlags2, SKIP_HYDRATION_ATTR_NAME, SSR_CONTENT_INTEGRITY_MARKER, Sanitizer, SecurityContext, Self, SimpleChange, SkipSelf, TEMPLATES, TEMPLATE_ID, TESTABILITY, TESTABILITY_GETTER, TRANSLATIONS, TRANSLATIONS_FORMAT, TemplateRef, Testability, TestabilityRegistry, TimerScheduler, TracingAction, TracingService, TransferState, Type, UseExhaustiveCheckNoChanges, ViewContainerRef, ViewEncapsulation, ViewRef, _sanitizeHtml, _sanitizeUrl, afterEveryRender, afterNextRender, allLeavingAnimations, allowSanitizationBypassAndThrow, angularCoreEnv, appendDeferBlocksToJSActionMap, asNativeElements, assertComponentDef, assertStandaloneComponentType, bypassSanitizationTrustHtml, bypassSanitizationTrustResourceUrl, bypassSanitizationTrustScript, bypassSanitizationTrustStyle, bypassSanitizationTrustUrl, calcPathForNode, checkNoChangesInternal, cleanupDehydratedViews, clearResolutionOfComponentResourcesQueue, collectNativeNodes, collectNativeNodesInLContainer, compileComponent, compileDirective, compileNgModule, compileNgModuleDefs, compilePipe, convertHydrateTriggersToJsAction, countBlocksSkippedByHydration, createEnvironmentInjector, createMultiResultQuerySignalFn, createNgModule, createNgModuleRef, createNgModuleRefWithProviders, createSingleResultOptionalQuerySignalFn, createSingleResultRequiredQuerySignalFn, depsTracker, devModeEqual, enableApplyRootElementTransformImpl, enableClaimDehydratedIcuCaseImpl, enableFindMatchingDehydratedViewImpl, enableLocateOrCreateContainerAnchorImpl, enableLocateOrCreateContainerRefImpl, enableLocateOrCreateElementContainerNodeImpl, enableLocateOrCreateElementNodeImpl, enableLocateOrCreateI18nNodeImpl, enableLocateOrCreateTextNodeImpl, enablePrepareI18nBlockForHydrationImpl, enableProfiling, enableRetrieveDeferBlockDataImpl, enableRetrieveHydrationInfoImpl, enableStashEventListenerImpl, findLocaleData, flushModuleScopingQueueAsMuchAsPossible, gatherDeferBlocksCommentNodes, generateStandaloneInDeclarationsError, getAsyncClassMetadataFn, getCompilerFacade, getDebugNode, getDeferBlocks$1 as getDeferBlocks, getDirectives, getDocument, getHostElement, getLContext, getLDeferBlockDetails, getLNodeForHydration, getLocaleCurrencyCode, getLocalePluralCase, getNgZone, getNgZoneOptions, getOrComputeI18nChildren, getRegisteredNgModuleType, getSanitizationBypassType, getTDeferBlockDetails, getTransferState, inferTagNameFromDefinition, inputBinding, internalProvideZoneChangeDetection, invokeListeners, isBoundToModule, isComponentDefPendingResolution, isComponentResourceResolutionQueueEmpty, isDeferBlock, isDetachedByI18n, isDisconnectedNode, isI18nHydrationEnabled, isI18nHydrationSupportEnabled, isInSkipHydrationBlock, isIncrementalHydrationEnabled, isJsObject, isLetDeclaration, isListLikeIterable, isNgModule, isPromise, isSubscribable, isTNodeShape, isViewDirty, iterateListLike, makePropDecorator, makeStateKey, markForRefresh, noSideEffects, optionsReducer, outputBinding, patchComponentDefWithScope, performanceMarkFeature, processAndInitTriggers, processBlockData, processTextNodeBeforeSerialization, profiler, provideAppInitializer, provideNgReflectAttributes, provideZoneChangeDetection, provideZonelessChangeDetection, publishDefaultGlobalUtils, publishExternalGlobalUtil, publishSignalConfiguration, readHydrationInfo, readPatchedLView, registerLocaleData, registerNgModuleType, remove, removeListeners, renderDeferBlockState, resetCompiledComponents, resetIncrementalHydrationEnabledWarnedForTests, resetJitOptions, resolveComponentResources, restoreComponentResolutionQueue, setAllowDuplicateNgModuleIdsForTest, setClassMetadata, setClassMetadataAsync, setDocument, setIsI18nHydrationSupportEnabled, setJSActionAttributes, setJitOptions, setLocaleId, setStashFn, setTestabilityGetter, sharedMapFunction, sharedStashFunction, transitiveScopesFor, triggerHydrationFromBlockName, triggerResourceLoading, trySerializeI18nBlock, twoWayBinding, unregisterAllLocaleData, unsupportedProjectionOfDomNodes, unwrapSafeValue, validateMatchingNode, validateNodeExists, verifySsrContentsIntegrity, ɵgetUnknownElementStrictMode, ɵgetUnknownPropertyStrictMode, ɵsetClassDebugInfo, ɵsetUnknownElementStrictMode, ɵsetUnknownPropertyStrictMode, ɵɵCopyDefinitionFeature, ɵɵExternalStylesFeature, ɵɵHostDirectivesFeature, ɵɵInheritDefinitionFeature, ɵɵNgOnChangesFeature, ɵɵProvidersFeature, ɵɵadvance, ɵɵanimateEnter, ɵɵanimateEnterListener, ɵɵanimateLeave, ɵɵanimateLeaveListener, ɵɵariaProperty, ɵɵattachSourceLocations, ɵɵattribute, ɵɵclassMap, ɵɵclassProp, ɵɵcomponentInstance, ɵɵconditional, ɵɵconditionalBranchCreate, ɵɵconditionalCreate, ɵɵcontentQuery, ɵɵcontentQuerySignal, ɵɵdeclareLet, ɵɵdefer, ɵɵdeferEnableTimerScheduling, ɵɵdeferHydrateNever, ɵɵdeferHydrateOnHover, ɵɵdeferHydrateOnIdle, ɵɵdeferHydrateOnImmediate, ɵɵdeferHydrateOnInteraction, ɵɵdeferHydrateOnTimer, ɵɵdeferHydrateOnViewport, ɵɵdeferHydrateWhen, ɵɵdeferOnHover, ɵɵdeferOnIdle, ɵɵdeferOnImmediate, ɵɵdeferOnInteraction, ɵɵdeferOnTimer, ɵɵdeferOnViewport, ɵɵdeferPrefetchOnHover, ɵɵdeferPrefetchOnIdle, ɵɵdeferPrefetchOnImmediate, ɵɵdeferPrefetchOnInteraction, ɵɵdeferPrefetchOnTimer, ɵɵdeferPrefetchOnViewport, ɵɵdeferPrefetchWhen, ɵɵdeferWhen, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵdefineNgModule, ɵɵdefinePipe, ɵɵdirectiveInject, ɵɵdomElement, ɵɵdomElementContainer, ɵɵdomElementContainerEnd, ɵɵdomElementContainerStart, ɵɵdomElementEnd, ɵɵdomElementStart, ɵɵdomListener, ɵɵdomProperty, ɵɵdomTemplate, ɵɵelement, ɵɵelementContainer, ɵɵelementContainerEnd, ɵɵelementContainerStart, ɵɵelementEnd, ɵɵelementStart, ɵɵgetComponentDepsFactory, ɵɵgetCurrentView, ɵɵgetInheritedFactory, ɵɵgetReplaceMetadataURL, ɵɵi18n, ɵɵi18nApply, ɵɵi18nAttributes, ɵɵi18nEnd, ɵɵi18nExp, ɵɵi18nPostprocess, ɵɵi18nStart, ɵɵinjectAttribute, ɵɵinterpolate, ɵɵinterpolate1, ɵɵinterpolate2, ɵɵinterpolate3, ɵɵinterpolate4, ɵɵinterpolate5, ɵɵinterpolate6, ɵɵinterpolate7, ɵɵinterpolate8, ɵɵinterpolateV, ɵɵinvalidFactory, ɵɵlistener, ɵɵloadQuery, ɵɵnextContext, ɵɵpipe, ɵɵpipeBind1, ɵɵpipeBind2, ɵɵpipeBind3, ɵɵpipeBind4, ɵɵpipeBindV, ɵɵprojection, ɵɵprojectionDef, ɵɵproperty, ɵɵpureFunction0, ɵɵpureFunction1, ɵɵpureFunction2, ɵɵpureFunction3, ɵɵpureFunction4, ɵɵpureFunction5, ɵɵpureFunction6, ɵɵpureFunction7, ɵɵpureFunction8, ɵɵpureFunctionV, ɵɵqueryAdvance, ɵɵqueryRefresh, ɵɵreadContextLet, ɵɵreference, ɵɵrepeater, ɵɵrepeaterCreate, ɵɵrepeaterTrackByIdentity, ɵɵrepeaterTrackByIndex, ɵɵreplaceMetadata, ɵɵresolveBody, ɵɵresolveDocument, ɵɵresolveWindow, ɵɵsanitizeHtml, ɵɵsanitizeResourceUrl, ɵɵsanitizeScript, ɵɵsanitizeStyle, ɵɵsanitizeUrl, ɵɵsanitizeUrlOrResourceUrl, ɵɵsetComponentScope, ɵɵsetNgModuleScope, ɵɵstoreLet, ɵɵstyleMap, ɵɵstyleProp, ɵɵsyntheticHostListener, ɵɵsyntheticHostProperty, ɵɵtemplate, ɵɵtemplateRefExtractor, ɵɵtext, ɵɵtextInterpolate, ɵɵtextInterpolate1, ɵɵtextInterpolate2, ɵɵtextInterpolate3, ɵɵtextInterpolate4, ɵɵtextInterpolate5, ɵɵtextInterpolate6, ɵɵtextInterpolate7, ɵɵtextInterpolate8, ɵɵtextInterpolateV, ɵɵtrustConstantHtml, ɵɵtrustConstantResourceUrl, ɵɵtwoWayBindingSet, ɵɵtwoWayListener, ɵɵtwoWayProperty, ɵɵvalidateAttribute, ɵɵviewQuery, ɵɵviewQuerySignal };
|
|
32017
32051
|
//# sourceMappingURL=debug_node.mjs.map
|