Changing front

This commit is contained in:
2023-01-16 17:44:37 +01:00
parent 0b8a93b256
commit 4fe4be7730
48586 changed files with 4725790 additions and 17464 deletions

View File

@@ -0,0 +1,587 @@
/**
* @license Angular v15.0.4
* (c) 2010-2022 Google LLC. https://angular.io/
* License: MIT
*/
import * as i0 from '@angular/core';
import { ViewEncapsulation, Injectable, Inject, RendererFactory2, NgZone, ANIMATION_MODULE_TYPE, NgModule } from '@angular/core';
export { ANIMATION_MODULE_TYPE } from '@angular/core';
import { ɵDomRendererFactory2, BrowserModule } from '@angular/platform-browser';
import { AnimationBuilder, sequence, AnimationFactory } from '@angular/animations';
import * as i1 from '@angular/animations/browser';
import { ɵAnimationEngine, ɵWebAnimationsStyleNormalizer, ɵAnimationStyleNormalizer, AnimationDriver, ɵWebAnimationsDriver, ɵNoopAnimationDriver } from '@angular/animations/browser';
import { DOCUMENT } from '@angular/common';
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
class BrowserAnimationBuilder extends AnimationBuilder {
constructor(rootRenderer, doc) {
super();
this._nextAnimationId = 0;
const typeData = { id: '0', encapsulation: ViewEncapsulation.None, styles: [], data: { animation: [] } };
this._renderer = rootRenderer.createRenderer(doc.body, typeData);
}
build(animation) {
const id = this._nextAnimationId.toString();
this._nextAnimationId++;
const entry = Array.isArray(animation) ? sequence(animation) : animation;
issueAnimationCommand(this._renderer, null, id, 'register', [entry]);
return new BrowserAnimationFactory(id, this._renderer);
}
}
BrowserAnimationBuilder.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BrowserAnimationBuilder, deps: [{ token: i0.RendererFactory2 }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
BrowserAnimationBuilder.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BrowserAnimationBuilder });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BrowserAnimationBuilder, decorators: [{
type: Injectable
}], ctorParameters: function () {
return [{ type: i0.RendererFactory2 }, { type: undefined, decorators: [{
type: Inject,
args: [DOCUMENT]
}] }];
} });
class BrowserAnimationFactory extends AnimationFactory {
constructor(_id, _renderer) {
super();
this._id = _id;
this._renderer = _renderer;
}
create(element, options) {
return new RendererAnimationPlayer(this._id, element, options || {}, this._renderer);
}
}
class RendererAnimationPlayer {
constructor(id, element, options, _renderer) {
this.id = id;
this.element = element;
this._renderer = _renderer;
this.parentPlayer = null;
this._started = false;
this.totalTime = 0;
this._command('create', options);
}
_listen(eventName, callback) {
return this._renderer.listen(this.element, `@@${this.id}:${eventName}`, callback);
}
_command(command, ...args) {
return issueAnimationCommand(this._renderer, this.element, this.id, command, args);
}
onDone(fn) {
this._listen('done', fn);
}
onStart(fn) {
this._listen('start', fn);
}
onDestroy(fn) {
this._listen('destroy', fn);
}
init() {
this._command('init');
}
hasStarted() {
return this._started;
}
play() {
this._command('play');
this._started = true;
}
pause() {
this._command('pause');
}
restart() {
this._command('restart');
}
finish() {
this._command('finish');
}
destroy() {
this._command('destroy');
}
reset() {
this._command('reset');
this._started = false;
}
setPosition(p) {
this._command('setPosition', p);
}
getPosition() {
var _a, _b;
return (_b = (_a = this._renderer.engine.players[+this.id]) === null || _a === void 0 ? void 0 : _a.getPosition()) !== null && _b !== void 0 ? _b : 0;
}
}
function issueAnimationCommand(renderer, element, id, command, args) {
return renderer.setProperty(element, `@@${id}:${command}`, args);
}
const ANIMATION_PREFIX = '@';
const DISABLE_ANIMATIONS_FLAG = '@.disabled';
class AnimationRendererFactory {
constructor(delegate, engine, _zone) {
this.delegate = delegate;
this.engine = engine;
this._zone = _zone;
this._currentId = 0;
this._microtaskId = 1;
this._animationCallbacksBuffer = [];
this._rendererCache = new Map();
this._cdRecurDepth = 0;
this.promise = Promise.resolve(0);
engine.onRemovalComplete = (element, delegate) => {
// Note: if a component element has a leave animation, and a host leave animation,
// the view engine will call `removeChild` for the parent
// component renderer as well as for the child component renderer.
// Therefore, we need to check if we already removed the element.
const parentNode = delegate === null || delegate === void 0 ? void 0 : delegate.parentNode(element);
if (parentNode) {
delegate.removeChild(parentNode, element);
}
};
}
createRenderer(hostElement, type) {
const EMPTY_NAMESPACE_ID = '';
// cache the delegates to find out which cached delegate can
// be used by which cached renderer
const delegate = this.delegate.createRenderer(hostElement, type);
if (!hostElement || !type || !type.data || !type.data['animation']) {
let renderer = this._rendererCache.get(delegate);
if (!renderer) {
// Ensure that the renderer is removed from the cache on destroy
// since it may contain references to detached DOM nodes.
const onRendererDestroy = () => this._rendererCache.delete(delegate);
renderer =
new BaseAnimationRenderer(EMPTY_NAMESPACE_ID, delegate, this.engine, onRendererDestroy);
// only cache this result when the base renderer is used
this._rendererCache.set(delegate, renderer);
}
return renderer;
}
const componentId = type.id;
const namespaceId = type.id + '-' + this._currentId;
this._currentId++;
this.engine.register(namespaceId, hostElement);
const registerTrigger = (trigger) => {
if (Array.isArray(trigger)) {
trigger.forEach(registerTrigger);
}
else {
this.engine.registerTrigger(componentId, namespaceId, hostElement, trigger.name, trigger);
}
};
const animationTriggers = type.data['animation'];
animationTriggers.forEach(registerTrigger);
return new AnimationRenderer(this, namespaceId, delegate, this.engine);
}
begin() {
this._cdRecurDepth++;
if (this.delegate.begin) {
this.delegate.begin();
}
}
_scheduleCountTask() {
// always use promise to schedule microtask instead of use Zone
this.promise.then(() => {
this._microtaskId++;
});
}
/** @internal */
scheduleListenerCallback(count, fn, data) {
if (count >= 0 && count < this._microtaskId) {
this._zone.run(() => fn(data));
return;
}
if (this._animationCallbacksBuffer.length == 0) {
Promise.resolve(null).then(() => {
this._zone.run(() => {
this._animationCallbacksBuffer.forEach(tuple => {
const [fn, data] = tuple;
fn(data);
});
this._animationCallbacksBuffer = [];
});
});
}
this._animationCallbacksBuffer.push([fn, data]);
}
end() {
this._cdRecurDepth--;
// this is to prevent animations from running twice when an inner
// component does CD when a parent component instead has inserted it
if (this._cdRecurDepth == 0) {
this._zone.runOutsideAngular(() => {
this._scheduleCountTask();
this.engine.flush(this._microtaskId);
});
}
if (this.delegate.end) {
this.delegate.end();
}
}
whenRenderingDone() {
return this.engine.whenRenderingDone();
}
}
AnimationRendererFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AnimationRendererFactory, deps: [{ token: i0.RendererFactory2 }, { token: i1.ɵAnimationEngine }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
AnimationRendererFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AnimationRendererFactory });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: AnimationRendererFactory, decorators: [{
type: Injectable
}], ctorParameters: function () { return [{ type: i0.RendererFactory2 }, { type: i1.ɵAnimationEngine }, { type: i0.NgZone }]; } });
class BaseAnimationRenderer {
constructor(namespaceId, delegate, engine, _onDestroy) {
this.namespaceId = namespaceId;
this.delegate = delegate;
this.engine = engine;
this._onDestroy = _onDestroy;
this.destroyNode = this.delegate.destroyNode ? (n) => delegate.destroyNode(n) : null;
}
get data() {
return this.delegate.data;
}
destroy() {
var _a;
this.engine.destroy(this.namespaceId, this.delegate);
this.delegate.destroy();
(_a = this._onDestroy) === null || _a === void 0 ? void 0 : _a.call(this);
}
createElement(name, namespace) {
return this.delegate.createElement(name, namespace);
}
createComment(value) {
return this.delegate.createComment(value);
}
createText(value) {
return this.delegate.createText(value);
}
appendChild(parent, newChild) {
this.delegate.appendChild(parent, newChild);
this.engine.onInsert(this.namespaceId, newChild, parent, false);
}
insertBefore(parent, newChild, refChild, isMove = true) {
this.delegate.insertBefore(parent, newChild, refChild);
// If `isMove` true than we should animate this insert.
this.engine.onInsert(this.namespaceId, newChild, parent, isMove);
}
removeChild(parent, oldChild, isHostElement) {
this.engine.onRemove(this.namespaceId, oldChild, this.delegate, isHostElement);
}
selectRootElement(selectorOrNode, preserveContent) {
return this.delegate.selectRootElement(selectorOrNode, preserveContent);
}
parentNode(node) {
return this.delegate.parentNode(node);
}
nextSibling(node) {
return this.delegate.nextSibling(node);
}
setAttribute(el, name, value, namespace) {
this.delegate.setAttribute(el, name, value, namespace);
}
removeAttribute(el, name, namespace) {
this.delegate.removeAttribute(el, name, namespace);
}
addClass(el, name) {
this.delegate.addClass(el, name);
}
removeClass(el, name) {
this.delegate.removeClass(el, name);
}
setStyle(el, style, value, flags) {
this.delegate.setStyle(el, style, value, flags);
}
removeStyle(el, style, flags) {
this.delegate.removeStyle(el, style, flags);
}
setProperty(el, name, value) {
if (name.charAt(0) == ANIMATION_PREFIX && name == DISABLE_ANIMATIONS_FLAG) {
this.disableAnimations(el, !!value);
}
else {
this.delegate.setProperty(el, name, value);
}
}
setValue(node, value) {
this.delegate.setValue(node, value);
}
listen(target, eventName, callback) {
return this.delegate.listen(target, eventName, callback);
}
disableAnimations(element, value) {
this.engine.disableAnimations(element, value);
}
}
class AnimationRenderer extends BaseAnimationRenderer {
constructor(factory, namespaceId, delegate, engine, onDestroy) {
super(namespaceId, delegate, engine, onDestroy);
this.factory = factory;
this.namespaceId = namespaceId;
}
setProperty(el, name, value) {
if (name.charAt(0) == ANIMATION_PREFIX) {
if (name.charAt(1) == '.' && name == DISABLE_ANIMATIONS_FLAG) {
value = value === undefined ? true : !!value;
this.disableAnimations(el, value);
}
else {
this.engine.process(this.namespaceId, el, name.slice(1), value);
}
}
else {
this.delegate.setProperty(el, name, value);
}
}
listen(target, eventName, callback) {
if (eventName.charAt(0) == ANIMATION_PREFIX) {
const element = resolveElementFromTarget(target);
let name = eventName.slice(1);
let phase = '';
// @listener.phase is for trigger animation callbacks
// @@listener is for animation builder callbacks
if (name.charAt(0) != ANIMATION_PREFIX) {
[name, phase] = parseTriggerCallbackName(name);
}
return this.engine.listen(this.namespaceId, element, name, phase, event => {
const countId = event['_data'] || -1;
this.factory.scheduleListenerCallback(countId, callback, event);
});
}
return this.delegate.listen(target, eventName, callback);
}
}
function resolveElementFromTarget(target) {
switch (target) {
case 'body':
return document.body;
case 'document':
return document;
case 'window':
return window;
default:
return target;
}
}
function parseTriggerCallbackName(triggerName) {
const dotIndex = triggerName.indexOf('.');
const trigger = triggerName.substring(0, dotIndex);
const phase = triggerName.slice(dotIndex + 1);
return [trigger, phase];
}
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
class InjectableAnimationEngine extends ɵAnimationEngine {
// The `ApplicationRef` is injected here explicitly to force the dependency ordering.
// Since the `ApplicationRef` should be created earlier before the `AnimationEngine`, they
// both have `ngOnDestroy` hooks and `flush()` must be called after all views are destroyed.
constructor(doc, driver, normalizer, appRef) {
super(doc.body, driver, normalizer);
}
ngOnDestroy() {
this.flush();
}
}
InjectableAnimationEngine.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: InjectableAnimationEngine, deps: [{ token: DOCUMENT }, { token: i1.AnimationDriver }, { token: i1.ɵAnimationStyleNormalizer }, { token: i0.ApplicationRef }], target: i0.ɵɵFactoryTarget.Injectable });
InjectableAnimationEngine.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: InjectableAnimationEngine });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: InjectableAnimationEngine, decorators: [{
type: Injectable
}], ctorParameters: function () {
return [{ type: undefined, decorators: [{
type: Inject,
args: [DOCUMENT]
}] }, { type: i1.AnimationDriver }, { type: i1.ɵAnimationStyleNormalizer }, { type: i0.ApplicationRef }];
} });
function instantiateDefaultStyleNormalizer() {
return new ɵWebAnimationsStyleNormalizer();
}
function instantiateRendererFactory(renderer, engine, zone) {
return new AnimationRendererFactory(renderer, engine, zone);
}
const SHARED_ANIMATION_PROVIDERS = [
{ provide: AnimationBuilder, useClass: BrowserAnimationBuilder },
{ provide: ɵAnimationStyleNormalizer, useFactory: instantiateDefaultStyleNormalizer },
{ provide: ɵAnimationEngine, useClass: InjectableAnimationEngine }, {
provide: RendererFactory2,
useFactory: instantiateRendererFactory,
deps: [ɵDomRendererFactory2, ɵAnimationEngine, NgZone]
}
];
/**
* Separate providers from the actual module so that we can do a local modification in Google3 to
* include them in the BrowserModule.
*/
const BROWSER_ANIMATIONS_PROVIDERS = [
{ provide: AnimationDriver, useFactory: () => new ɵWebAnimationsDriver() },
{ provide: ANIMATION_MODULE_TYPE, useValue: 'BrowserAnimations' }, ...SHARED_ANIMATION_PROVIDERS
];
/**
* Separate providers from the actual module so that we can do a local modification in Google3 to
* include them in the BrowserTestingModule.
*/
const BROWSER_NOOP_ANIMATIONS_PROVIDERS = [
{ provide: AnimationDriver, useClass: ɵNoopAnimationDriver },
{ provide: ANIMATION_MODULE_TYPE, useValue: 'NoopAnimations' }, ...SHARED_ANIMATION_PROVIDERS
];
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* Exports `BrowserModule` with additional [dependency-injection providers](guide/glossary#provider)
* for use with animations. See [Animations](guide/animations).
* @publicApi
*/
class BrowserAnimationsModule {
/**
* Configures the module based on the specified object.
*
* @param config Object used to configure the behavior of the `BrowserAnimationsModule`.
* @see `BrowserAnimationsModuleConfig`
*
* @usageNotes
* When registering the `BrowserAnimationsModule`, you can use the `withConfig`
* function as follows:
* ```
* @NgModule({
* imports: [BrowserAnimationsModule.withConfig(config)]
* })
* class MyNgModule {}
* ```
*/
static withConfig(config) {
return {
ngModule: BrowserAnimationsModule,
providers: config.disableAnimations ? BROWSER_NOOP_ANIMATIONS_PROVIDERS :
BROWSER_ANIMATIONS_PROVIDERS
};
}
}
BrowserAnimationsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BrowserAnimationsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
BrowserAnimationsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.4", ngImport: i0, type: BrowserAnimationsModule, exports: [BrowserModule] });
BrowserAnimationsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BrowserAnimationsModule, providers: BROWSER_ANIMATIONS_PROVIDERS, imports: [BrowserModule] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BrowserAnimationsModule, decorators: [{
type: NgModule,
args: [{
exports: [BrowserModule],
providers: BROWSER_ANIMATIONS_PROVIDERS,
}]
}] });
/**
* Returns the set of [dependency-injection providers](guide/glossary#provider)
* to enable animations in an application. See [animations guide](guide/animations)
* to learn more about animations in Angular.
*
* @usageNotes
*
* The function is useful when you want to enable animations in an application
* bootstrapped using the `bootstrapApplication` function. In this scenario there
* is no need to import the `BrowserAnimationsModule` NgModule at all, just add
* providers returned by this function to the `providers` list as show below.
*
* ```typescript
* bootstrapApplication(RootComponent, {
* providers: [
* provideAnimations()
* ]
* });
* ```
*
* @publicApi
*/
function provideAnimations() {
// Return a copy to prevent changes to the original array in case any in-place
// alterations are performed to the `provideAnimations` call results in app code.
return [...BROWSER_ANIMATIONS_PROVIDERS];
}
/**
* A null player that must be imported to allow disabling of animations.
* @publicApi
*/
class NoopAnimationsModule {
}
NoopAnimationsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: NoopAnimationsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
NoopAnimationsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.4", ngImport: i0, type: NoopAnimationsModule, exports: [BrowserModule] });
NoopAnimationsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: NoopAnimationsModule, providers: BROWSER_NOOP_ANIMATIONS_PROVIDERS, imports: [BrowserModule] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: NoopAnimationsModule, decorators: [{
type: NgModule,
args: [{
exports: [BrowserModule],
providers: BROWSER_NOOP_ANIMATIONS_PROVIDERS,
}]
}] });
/**
* Returns the set of [dependency-injection providers](guide/glossary#provider)
* to disable animations in an application. See [animations guide](guide/animations)
* to learn more about animations in Angular.
*
* @usageNotes
*
* The function is useful when you want to bootstrap an application using
* the `bootstrapApplication` function, but you need to disable animations
* (for example, when running tests).
*
* ```typescript
* bootstrapApplication(RootComponent, {
* providers: [
* provideNoopAnimations()
* ]
* });
* ```
*
* @publicApi
*/
function provideNoopAnimations() {
// Return a copy to prevent changes to the original array in case any in-place
// alterations are performed to the `provideNoopAnimations` call results in app code.
return [...BROWSER_NOOP_ANIMATIONS_PROVIDERS];
}
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* Generated bundle index. Do not edit.
*/
export { BrowserAnimationsModule, NoopAnimationsModule, provideAnimations, provideNoopAnimations, AnimationRenderer as ɵAnimationRenderer, AnimationRendererFactory as ɵAnimationRendererFactory, BrowserAnimationBuilder as ɵBrowserAnimationBuilder, BrowserAnimationFactory as ɵBrowserAnimationFactory, InjectableAnimationEngine as ɵInjectableAnimationEngine };
//# sourceMappingURL=animations.mjs.map

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,285 @@
/**
* @license Angular v15.0.4
* (c) 2010-2022 Google LLC. https://angular.io/
* License: MIT
*/
import * as i0 from '@angular/core';
import { ɵglobal, NgZone, PLATFORM_INITIALIZER, createPlatformFactory, platformCore, APP_ID, NgModule } from '@angular/core';
import { ɵBrowserDomAdapter, BrowserModule } from '@angular/platform-browser';
import { ɵgetDOM } from '@angular/common';
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
class BrowserDetection {
constructor(ua) {
this._overrideUa = ua;
}
get _ua() {
if (typeof this._overrideUa === 'string') {
return this._overrideUa;
}
return ɵgetDOM() ? ɵgetDOM().getUserAgent() : '';
}
static setup() {
return new BrowserDetection(null);
}
get isFirefox() {
return this._ua.indexOf('Firefox') > -1;
}
get isAndroid() {
return this._ua.indexOf('Mozilla/5.0') > -1 && this._ua.indexOf('Android') > -1 &&
this._ua.indexOf('AppleWebKit') > -1 && this._ua.indexOf('Chrome') == -1 &&
this._ua.indexOf('IEMobile') == -1;
}
get isEdge() {
return this._ua.indexOf('Edge') > -1;
}
get isWebkit() {
return this._ua.indexOf('AppleWebKit') > -1 && this._ua.indexOf('Edge') == -1 &&
this._ua.indexOf('IEMobile') == -1;
}
get isIOS7() {
return (this._ua.indexOf('iPhone OS 7') > -1 || this._ua.indexOf('iPad OS 7') > -1) &&
this._ua.indexOf('IEMobile') == -1;
}
get isSlow() {
return this.isAndroid || this.isIOS7;
}
get isChromeDesktop() {
return this._ua.indexOf('Chrome') > -1 && this._ua.indexOf('Mobile Safari') == -1 &&
this._ua.indexOf('Edge') == -1;
}
// "Old Chrome" means Chrome 3X, where there are some discrepancies in the Intl API.
// Android 4.4 and 5.X have such browsers by default (respectively 30 and 39).
get isOldChrome() {
return this._ua.indexOf('Chrome') > -1 && this._ua.indexOf('Chrome/3') > -1 &&
this._ua.indexOf('Edge') == -1;
}
get supportsCustomElements() {
return (typeof ɵglobal.customElements !== 'undefined');
}
get supportsDeprecatedCustomCustomElementsV0() {
return (typeof document.registerElement !== 'undefined');
}
get supportsRegExUnicodeFlag() {
return RegExp.prototype.hasOwnProperty('unicode');
}
get supportsShadowDom() {
const testEl = document.createElement('div');
return (typeof testEl.attachShadow !== 'undefined');
}
get supportsDeprecatedShadowDomV0() {
const testEl = document.createElement('div');
return (typeof testEl.createShadowRoot !== 'undefined');
}
get supportsTemplateElement() {
const testEl = document.createElement('template');
return (typeof testEl.content !== 'undefined');
}
}
const browserDetection = BrowserDetection.setup();
function dispatchEvent(element, eventType) {
const evt = ɵgetDOM().getDefaultDocument().createEvent('Event');
evt.initEvent(eventType, true, true);
ɵgetDOM().dispatchEvent(element, evt);
return evt;
}
function createMouseEvent(eventType) {
const evt = ɵgetDOM().getDefaultDocument().createEvent('MouseEvent');
evt.initEvent(eventType, true, true);
return evt;
}
function el(html) {
return getContent(createTemplate(html)).firstChild;
}
function normalizeCSS(css) {
return css.replace(/\s+/g, ' ')
.replace(/:\s/g, ':')
.replace(/'/g, '"')
.replace(/ }/g, '}')
.replace(/url\((\"|\s)(.+)(\"|\s)\)(\s*)/g, (...match) => `url("${match[2]}")`)
.replace(/\[(.+)=([^"\]]+)\]/g, (...match) => `[${match[1]}="${match[2]}"]`);
}
function getAttributeMap(element) {
const res = new Map();
const elAttrs = element.attributes;
for (let i = 0; i < elAttrs.length; i++) {
const attrib = elAttrs.item(i);
res.set(attrib.name, attrib.value);
}
return res;
}
const _selfClosingTags = ['br', 'hr', 'input'];
function stringifyElement(el /** TODO #9100 */) {
let result = '';
if (ɵgetDOM().isElementNode(el)) {
const tagName = el.tagName.toLowerCase();
// Opening tag
result += `<${tagName}`;
// Attributes in an ordered way
const attributeMap = getAttributeMap(el);
const sortedKeys = Array.from(attributeMap.keys()).sort();
for (const key of sortedKeys) {
const lowerCaseKey = key.toLowerCase();
let attValue = attributeMap.get(key);
if (typeof attValue !== 'string') {
result += ` ${lowerCaseKey}`;
}
else {
// Browsers order style rules differently. Order them alphabetically for consistency.
if (lowerCaseKey === 'style') {
attValue = attValue.split(/; ?/).filter(s => !!s).sort().map(s => `${s};`).join(' ');
}
result += ` ${lowerCaseKey}="${attValue}"`;
}
}
result += '>';
// Children
const childrenRoot = templateAwareRoot(el);
const children = childrenRoot ? childrenRoot.childNodes : [];
for (let j = 0; j < children.length; j++) {
result += stringifyElement(children[j]);
}
// Closing tag
if (_selfClosingTags.indexOf(tagName) == -1) {
result += `</${tagName}>`;
}
}
else if (isCommentNode(el)) {
result += `<!--${el.nodeValue}-->`;
}
else {
result += el.textContent;
}
return result;
}
function createNgZone() {
return new NgZone({ enableLongStackTrace: true, shouldCoalesceEventChangeDetection: false });
}
function isCommentNode(node) {
return node.nodeType === Node.COMMENT_NODE;
}
function isTextNode(node) {
return node.nodeType === Node.TEXT_NODE;
}
function getContent(node) {
if ('content' in node) {
return node.content;
}
else {
return node;
}
}
function templateAwareRoot(el) {
return ɵgetDOM().isElementNode(el) && el.nodeName === 'TEMPLATE' ? getContent(el) : el;
}
function setCookie(name, value) {
// document.cookie is magical, assigning into it assigns/overrides one cookie value, but does
// not clear other cookies.
document.cookie = encodeURIComponent(name) + '=' + encodeURIComponent(value);
}
function supportsWebAnimation() {
return typeof Element.prototype['animate'] === 'function';
}
function hasStyle(element, styleName, styleValue) {
const value = element.style[styleName] || '';
return styleValue ? value == styleValue : value.length > 0;
}
function hasClass(element, className) {
return element.classList.contains(className);
}
function sortedClassList(element) {
return Array.prototype.slice.call(element.classList, 0).sort();
}
function createTemplate(html) {
const t = ɵgetDOM().getDefaultDocument().createElement('template');
t.innerHTML = html;
return t;
}
function childNodesAsList(el) {
const childNodes = el.childNodes;
const res = [];
for (let i = 0; i < childNodes.length; i++) {
res[i] = childNodes[i];
}
return res;
}
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
function initBrowserTests() {
ɵBrowserDomAdapter.makeCurrent();
BrowserDetection.setup();
}
const _TEST_BROWSER_PLATFORM_PROVIDERS = [{ provide: PLATFORM_INITIALIZER, useValue: initBrowserTests, multi: true }];
/**
* Platform for testing
*
* @publicApi
*/
const platformBrowserTesting = createPlatformFactory(platformCore, 'browserTesting', _TEST_BROWSER_PLATFORM_PROVIDERS);
/**
* NgModule for testing.
*
* @publicApi
*/
class BrowserTestingModule {
}
BrowserTestingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BrowserTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
BrowserTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.4", ngImport: i0, type: BrowserTestingModule, exports: [BrowserModule] });
BrowserTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BrowserTestingModule, providers: [
{ provide: APP_ID, useValue: 'a' },
{ provide: NgZone, useFactory: createNgZone },
], imports: [BrowserModule] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BrowserTestingModule, decorators: [{
type: NgModule,
args: [{
exports: [BrowserModule],
providers: [
{ provide: APP_ID, useValue: 'a' },
{ provide: NgZone, useFactory: createNgZone },
]
}]
}] });
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* Generated bundle index. Do not edit.
*/
export { BrowserTestingModule, platformBrowserTesting };
//# sourceMappingURL=testing.mjs.map

File diff suppressed because one or more lines are too long