-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchunk-DAHHMHGV.js
More file actions
4692 lines (4685 loc) · 160 KB
/
chunk-DAHHMHGV.js
File metadata and controls
4692 lines (4685 loc) · 160 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import {
CommonModule,
DomAdapter,
PLATFORM_BROWSER_ID,
XhrFactory,
getDOM,
parseCookieValue,
setRootDomAdapter
} from "./chunk-OV2CFM4K.js";
import {
APP_BOOTSTRAP_LISTENER,
APP_ID,
ApplicationModule,
ApplicationRef,
CSP_NONCE,
Console,
DOCUMENT,
DestroyRef,
ENVIRONMENT_INITIALIZER,
EnvironmentInjector,
ErrorHandler,
INJECTOR_SCOPE,
IS_ENABLED_BLOCKING_INITIAL_NAVIGATION,
Inject,
Injectable,
InjectionToken,
Injector,
NgModule,
NgZone,
Observable,
Optional,
PLATFORM_ID,
PLATFORM_INITIALIZER,
PendingTasks,
RendererFactory2,
RendererStyleFlags2,
ResourceImpl,
RuntimeError,
SecurityContext,
TESTABILITY,
TESTABILITY_GETTER,
Testability,
TestabilityRegistry,
TracingService,
TransferState,
Version,
ViewEncapsulation,
XSS_SECURITY_URL,
ZONELESS_ENABLED,
__name,
__objRest,
__publicField,
__spreadValues,
_global,
_sanitizeHtml,
_sanitizeUrl,
allLeavingAnimations,
allowSanitizationBypassAndThrow,
assertInInjectionContext,
bypassSanitizationTrustHtml,
bypassSanitizationTrustResourceUrl,
bypassSanitizationTrustScript,
bypassSanitizationTrustStyle,
bypassSanitizationTrustUrl,
computed,
concatMap,
createPlatformFactory,
encapsulateResourceError,
filter,
finalize,
formatRuntimeError,
forwardRef,
inject,
internalCreateApplication,
linkedSignal,
makeEnvironmentProviders,
makeStateKey,
map,
of,
performanceMarkFeature,
platformCore,
runInInjectionContext,
setClassMetadata,
setDocument,
signal,
switchMap,
truncateMiddle,
unwrapSafeValue,
withDomHydration,
ɵɵdefineInjectable,
ɵɵdefineInjector,
ɵɵdefineNgModule,
ɵɵinject
} from "./chunk-2CX5BJWG.js";
// node_modules/@angular/platform-browser/fesm2022/dom_renderer.mjs
var EVENT_MANAGER_PLUGINS = new InjectionToken(ngDevMode ? "EventManagerPlugins" : "");
var _EventManager = class _EventManager {
_zone;
_plugins;
_eventNameToPlugin = /* @__PURE__ */ new Map();
/**
* Initializes an instance of the event-manager service.
*/
constructor(plugins, _zone) {
this._zone = _zone;
plugins.forEach((plugin) => {
plugin.manager = this;
});
this._plugins = plugins.slice().reverse();
}
/**
* Registers a handler for a specific element and event.
*
* @param element The HTML element to receive event notifications.
* @param eventName The name of the event to listen for.
* @param handler A function to call when the notification occurs. Receives the
* event object as an argument.
* @param options Options that configure how the event listener is bound.
* @returns A callback function that can be used to remove the handler.
*/
addEventListener(element, eventName, handler, options) {
const plugin = this._findPluginFor(eventName);
return plugin.addEventListener(element, eventName, handler, options);
}
/**
* Retrieves the compilation zone in which event listeners are registered.
*/
getZone() {
return this._zone;
}
/** @internal */
_findPluginFor(eventName) {
let plugin = this._eventNameToPlugin.get(eventName);
if (plugin) {
return plugin;
}
const plugins = this._plugins;
plugin = plugins.find((plugin2) => plugin2.supports(eventName));
if (!plugin) {
throw new RuntimeError(5101, (typeof ngDevMode === "undefined" || ngDevMode) && `No event manager plugin found for event ${eventName}`);
}
this._eventNameToPlugin.set(eventName, plugin);
return plugin;
}
};
__name(_EventManager, "EventManager");
__publicField(_EventManager, "\u0275fac", /* @__PURE__ */ __name(function EventManager_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _EventManager)(\u0275\u0275inject(EVENT_MANAGER_PLUGINS), \u0275\u0275inject(NgZone));
}, "EventManager_Factory"));
__publicField(_EventManager, "\u0275prov", /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _EventManager,
factory: _EventManager.\u0275fac
}));
var EventManager = _EventManager;
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(EventManager, [{
type: Injectable
}], () => [{
type: void 0,
decorators: [{
type: Inject,
args: [EVENT_MANAGER_PLUGINS]
}]
}, {
type: NgZone
}], null);
})();
var _EventManagerPlugin = class _EventManagerPlugin {
_doc;
// TODO: remove (has some usage in G3)
constructor(_doc) {
this._doc = _doc;
}
// Using non-null assertion because it's set by EventManager's constructor
manager;
};
__name(_EventManagerPlugin, "EventManagerPlugin");
var EventManagerPlugin = _EventManagerPlugin;
var APP_ID_ATTRIBUTE_NAME = "ng-app-id";
function removeElements(elements) {
for (const element of elements) {
element.remove();
}
}
__name(removeElements, "removeElements");
function createStyleElement(style, doc) {
const styleElement = doc.createElement("style");
styleElement.textContent = style;
return styleElement;
}
__name(createStyleElement, "createStyleElement");
function addServerStyles(doc, appId, inline, external) {
const elements = doc.head?.querySelectorAll(`style[${APP_ID_ATTRIBUTE_NAME}="${appId}"],link[${APP_ID_ATTRIBUTE_NAME}="${appId}"]`);
if (elements) {
for (const styleElement of elements) {
styleElement.removeAttribute(APP_ID_ATTRIBUTE_NAME);
if (styleElement instanceof HTMLLinkElement) {
external.set(styleElement.href.slice(styleElement.href.lastIndexOf("/") + 1), {
usage: 0,
elements: [styleElement]
});
} else if (styleElement.textContent) {
inline.set(styleElement.textContent, {
usage: 0,
elements: [styleElement]
});
}
}
}
}
__name(addServerStyles, "addServerStyles");
function createLinkElement(url, doc) {
const linkElement = doc.createElement("link");
linkElement.setAttribute("rel", "stylesheet");
linkElement.setAttribute("href", url);
return linkElement;
}
__name(createLinkElement, "createLinkElement");
var _SharedStylesHost = class _SharedStylesHost {
doc;
appId;
nonce;
/**
* Provides usage information for active inline style content and associated HTML <style> elements.
* Embedded styles typically originate from the `styles` metadata of a rendered component.
*/
inline = /* @__PURE__ */ new Map();
/**
* Provides usage information for active external style URLs and the associated HTML <link> elements.
* External styles typically originate from the `ɵɵExternalStylesFeature` of a rendered component.
*/
external = /* @__PURE__ */ new Map();
/**
* Set of host DOM nodes that will have styles attached.
*/
hosts = /* @__PURE__ */ new Set();
constructor(doc, appId, nonce, platformId = {}) {
this.doc = doc;
this.appId = appId;
this.nonce = nonce;
addServerStyles(doc, appId, this.inline, this.external);
this.hosts.add(doc.head);
}
/**
* Adds embedded styles to the DOM via HTML `style` elements.
* @param styles An array of style content strings.
*/
addStyles(styles, urls) {
for (const value of styles) {
this.addUsage(value, this.inline, createStyleElement);
}
urls?.forEach((value) => this.addUsage(value, this.external, createLinkElement));
}
/**
* Removes embedded styles from the DOM that were added as HTML `style` elements.
* @param styles An array of style content strings.
*/
removeStyles(styles, urls) {
for (const value of styles) {
this.removeUsage(value, this.inline);
}
urls?.forEach((value) => this.removeUsage(value, this.external));
}
addUsage(value, usages, creator) {
const record = usages.get(value);
if (record) {
if ((typeof ngDevMode === "undefined" || ngDevMode) && record.usage === 0) {
record.elements.forEach((element) => element.setAttribute("ng-style-reused", ""));
}
record.usage++;
} else {
usages.set(value, {
usage: 1,
elements: [...this.hosts].map((host) => this.addElement(host, creator(value, this.doc)))
});
}
}
removeUsage(value, usages) {
const record = usages.get(value);
if (record) {
record.usage--;
if (record.usage <= 0) {
removeElements(record.elements);
usages.delete(value);
}
}
}
ngOnDestroy() {
for (const [, {
elements
}] of [...this.inline, ...this.external]) {
removeElements(elements);
}
this.hosts.clear();
}
/**
* Adds a host node to the set of style hosts and adds all existing style usage to
* the newly added host node.
*
* This is currently only used for Shadow DOM encapsulation mode.
*/
addHost(hostNode) {
this.hosts.add(hostNode);
for (const [style, {
elements
}] of this.inline) {
elements.push(this.addElement(hostNode, createStyleElement(style, this.doc)));
}
for (const [url, {
elements
}] of this.external) {
elements.push(this.addElement(hostNode, createLinkElement(url, this.doc)));
}
}
removeHost(hostNode) {
this.hosts.delete(hostNode);
}
addElement(host, element) {
if (this.nonce) {
element.setAttribute("nonce", this.nonce);
}
if (false) {
element.setAttribute(APP_ID_ATTRIBUTE_NAME, this.appId);
}
return host.appendChild(element);
}
};
__name(_SharedStylesHost, "SharedStylesHost");
__publicField(_SharedStylesHost, "\u0275fac", /* @__PURE__ */ __name(function SharedStylesHost_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _SharedStylesHost)(\u0275\u0275inject(DOCUMENT), \u0275\u0275inject(APP_ID), \u0275\u0275inject(CSP_NONCE, 8), \u0275\u0275inject(PLATFORM_ID));
}, "SharedStylesHost_Factory"));
__publicField(_SharedStylesHost, "\u0275prov", /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _SharedStylesHost,
factory: _SharedStylesHost.\u0275fac
}));
var SharedStylesHost = _SharedStylesHost;
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(SharedStylesHost, [{
type: Injectable
}], () => [{
type: Document,
decorators: [{
type: Inject,
args: [DOCUMENT]
}]
}, {
type: void 0,
decorators: [{
type: Inject,
args: [APP_ID]
}]
}, {
type: void 0,
decorators: [{
type: Inject,
args: [CSP_NONCE]
}, {
type: Optional
}]
}, {
type: void 0,
decorators: [{
type: Inject,
args: [PLATFORM_ID]
}]
}], null);
})();
var NAMESPACE_URIS = {
"svg": "http://www.w3.org/2000/svg",
"xhtml": "http://www.w3.org/1999/xhtml",
"xlink": "http://www.w3.org/1999/xlink",
"xml": "http://www.w3.org/XML/1998/namespace",
"xmlns": "http://www.w3.org/2000/xmlns/",
"math": "http://www.w3.org/1998/Math/MathML"
};
var COMPONENT_REGEX = /%COMP%/g;
var SOURCEMAP_URL_REGEXP = /\/\*#\s*sourceMappingURL=(.+?)\s*\*\//;
var PROTOCOL_REGEXP = /^https?:/;
var COMPONENT_VARIABLE = "%COMP%";
var HOST_ATTR = `_nghost-${COMPONENT_VARIABLE}`;
var CONTENT_ATTR = `_ngcontent-${COMPONENT_VARIABLE}`;
var REMOVE_STYLES_ON_COMPONENT_DESTROY_DEFAULT = true;
var REMOVE_STYLES_ON_COMPONENT_DESTROY = new InjectionToken(ngDevMode ? "RemoveStylesOnCompDestroy" : "", {
providedIn: "root",
factory: /* @__PURE__ */ __name(() => REMOVE_STYLES_ON_COMPONENT_DESTROY_DEFAULT, "factory")
});
function shimContentAttribute(componentShortId) {
return CONTENT_ATTR.replace(COMPONENT_REGEX, componentShortId);
}
__name(shimContentAttribute, "shimContentAttribute");
function shimHostAttribute(componentShortId) {
return HOST_ATTR.replace(COMPONENT_REGEX, componentShortId);
}
__name(shimHostAttribute, "shimHostAttribute");
function shimStylesContent(compId, styles) {
return styles.map((s) => s.replace(COMPONENT_REGEX, compId));
}
__name(shimStylesContent, "shimStylesContent");
function addBaseHrefToCssSourceMap(baseHref, styles) {
if (!baseHref) {
return styles;
}
const absoluteBaseHrefUrl = new URL(baseHref, "http://localhost");
return styles.map((cssContent) => {
if (!cssContent.includes("sourceMappingURL=")) {
return cssContent;
}
return cssContent.replace(SOURCEMAP_URL_REGEXP, (_, sourceMapUrl) => {
if (sourceMapUrl[0] === "/" || sourceMapUrl.startsWith("data:") || PROTOCOL_REGEXP.test(sourceMapUrl)) {
return `/*# sourceMappingURL=${sourceMapUrl} */`;
}
const {
pathname: resolvedSourceMapUrl
} = new URL(sourceMapUrl, absoluteBaseHrefUrl);
return `/*# sourceMappingURL=${resolvedSourceMapUrl} */`;
});
});
}
__name(addBaseHrefToCssSourceMap, "addBaseHrefToCssSourceMap");
var _DomRendererFactory2 = class _DomRendererFactory2 {
eventManager;
sharedStylesHost;
appId;
removeStylesOnCompDestroy;
doc;
platformId;
ngZone;
nonce;
tracingService;
rendererByCompId = /* @__PURE__ */ new Map();
defaultRenderer;
platformIsServer;
constructor(eventManager, sharedStylesHost, appId, removeStylesOnCompDestroy, doc, platformId, ngZone, nonce = null, tracingService = null) {
this.eventManager = eventManager;
this.sharedStylesHost = sharedStylesHost;
this.appId = appId;
this.removeStylesOnCompDestroy = removeStylesOnCompDestroy;
this.doc = doc;
this.platformId = platformId;
this.ngZone = ngZone;
this.nonce = nonce;
this.tracingService = tracingService;
this.platformIsServer = false;
this.defaultRenderer = new DefaultDomRenderer2(eventManager, doc, ngZone, this.platformIsServer, this.tracingService);
}
createRenderer(element, type) {
if (!element || !type) {
return this.defaultRenderer;
}
if (false) {
type = __spreadProps(__spreadValues({}, type), {
encapsulation: ViewEncapsulation.Emulated
});
}
const renderer = this.getOrCreateRenderer(element, type);
if (renderer instanceof EmulatedEncapsulationDomRenderer2) {
renderer.applyToHost(element);
} else if (renderer instanceof NoneEncapsulationDomRenderer) {
renderer.applyStyles();
}
return renderer;
}
getOrCreateRenderer(element, type) {
const rendererByCompId = this.rendererByCompId;
let renderer = rendererByCompId.get(type.id);
if (!renderer) {
const doc = this.doc;
const ngZone = this.ngZone;
const eventManager = this.eventManager;
const sharedStylesHost = this.sharedStylesHost;
const removeStylesOnCompDestroy = this.removeStylesOnCompDestroy;
const platformIsServer = this.platformIsServer;
const tracingService = this.tracingService;
switch (type.encapsulation) {
case ViewEncapsulation.Emulated:
renderer = new EmulatedEncapsulationDomRenderer2(eventManager, sharedStylesHost, type, this.appId, removeStylesOnCompDestroy, doc, ngZone, platformIsServer, tracingService);
break;
case ViewEncapsulation.ShadowDom:
return new ShadowDomRenderer(eventManager, sharedStylesHost, element, type, doc, ngZone, this.nonce, platformIsServer, tracingService);
default:
renderer = new NoneEncapsulationDomRenderer(eventManager, sharedStylesHost, type, removeStylesOnCompDestroy, doc, ngZone, platformIsServer, tracingService);
break;
}
rendererByCompId.set(type.id, renderer);
}
return renderer;
}
ngOnDestroy() {
this.rendererByCompId.clear();
}
/**
* Used during HMR to clear any cached data about a component.
* @param componentId ID of the component that is being replaced.
*/
componentReplaced(componentId) {
this.rendererByCompId.delete(componentId);
}
};
__name(_DomRendererFactory2, "DomRendererFactory2");
__publicField(_DomRendererFactory2, "\u0275fac", /* @__PURE__ */ __name(function DomRendererFactory2_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _DomRendererFactory2)(\u0275\u0275inject(EventManager), \u0275\u0275inject(SharedStylesHost), \u0275\u0275inject(APP_ID), \u0275\u0275inject(REMOVE_STYLES_ON_COMPONENT_DESTROY), \u0275\u0275inject(DOCUMENT), \u0275\u0275inject(PLATFORM_ID), \u0275\u0275inject(NgZone), \u0275\u0275inject(CSP_NONCE), \u0275\u0275inject(TracingService, 8));
}, "DomRendererFactory2_Factory"));
__publicField(_DomRendererFactory2, "\u0275prov", /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _DomRendererFactory2,
factory: _DomRendererFactory2.\u0275fac
}));
var DomRendererFactory2 = _DomRendererFactory2;
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(DomRendererFactory2, [{
type: Injectable
}], () => [{
type: EventManager
}, {
type: SharedStylesHost
}, {
type: void 0,
decorators: [{
type: Inject,
args: [APP_ID]
}]
}, {
type: void 0,
decorators: [{
type: Inject,
args: [REMOVE_STYLES_ON_COMPONENT_DESTROY]
}]
}, {
type: Document,
decorators: [{
type: Inject,
args: [DOCUMENT]
}]
}, {
type: Object,
decorators: [{
type: Inject,
args: [PLATFORM_ID]
}]
}, {
type: NgZone
}, {
type: void 0,
decorators: [{
type: Inject,
args: [CSP_NONCE]
}]
}, {
type: TracingService,
decorators: [{
type: Inject,
args: [TracingService]
}, {
type: Optional
}]
}], null);
})();
var _DefaultDomRenderer2 = class _DefaultDomRenderer2 {
eventManager;
doc;
ngZone;
platformIsServer;
tracingService;
data = /* @__PURE__ */ Object.create(null);
/**
* By default this renderer throws when encountering synthetic properties
* This can be disabled for example by the AsyncAnimationRendererFactory
*/
throwOnSyntheticProps = true;
constructor(eventManager, doc, ngZone, platformIsServer, tracingService) {
this.eventManager = eventManager;
this.doc = doc;
this.ngZone = ngZone;
this.platformIsServer = platformIsServer;
this.tracingService = tracingService;
}
destroy() {
}
destroyNode = null;
createElement(name, namespace) {
if (namespace) {
return this.doc.createElementNS(NAMESPACE_URIS[namespace] || namespace, name);
}
return this.doc.createElement(name);
}
createComment(value) {
return this.doc.createComment(value);
}
createText(value) {
return this.doc.createTextNode(value);
}
appendChild(parent, newChild) {
const targetParent = isTemplateNode(parent) ? parent.content : parent;
targetParent.appendChild(newChild);
}
insertBefore(parent, newChild, refChild) {
if (parent) {
const targetParent = isTemplateNode(parent) ? parent.content : parent;
targetParent.insertBefore(newChild, refChild);
}
}
removeChild(_parent, oldChild) {
oldChild.remove();
}
selectRootElement(selectorOrNode, preserveContent) {
let el = typeof selectorOrNode === "string" ? this.doc.querySelector(selectorOrNode) : selectorOrNode;
if (!el) {
throw new RuntimeError(-5104, (typeof ngDevMode === "undefined" || ngDevMode) && `The selector "${selectorOrNode}" did not match any elements`);
}
if (!preserveContent) {
el.textContent = "";
}
return el;
}
parentNode(node) {
return node.parentNode;
}
nextSibling(node) {
return node.nextSibling;
}
setAttribute(el, name, value, namespace) {
if (namespace) {
name = namespace + ":" + name;
const namespaceUri = NAMESPACE_URIS[namespace];
if (namespaceUri) {
el.setAttributeNS(namespaceUri, name, value);
} else {
el.setAttribute(name, value);
}
} else {
el.setAttribute(name, value);
}
}
removeAttribute(el, name, namespace) {
if (namespace) {
const namespaceUri = NAMESPACE_URIS[namespace];
if (namespaceUri) {
el.removeAttributeNS(namespaceUri, name);
} else {
el.removeAttribute(`${namespace}:${name}`);
}
} else {
el.removeAttribute(name);
}
}
addClass(el, name) {
el.classList.add(name);
}
removeClass(el, name) {
el.classList.remove(name);
}
setStyle(el, style, value, flags) {
if (flags & (RendererStyleFlags2.DashCase | RendererStyleFlags2.Important)) {
el.style.setProperty(style, value, flags & RendererStyleFlags2.Important ? "important" : "");
} else {
el.style[style] = value;
}
}
removeStyle(el, style, flags) {
if (flags & RendererStyleFlags2.DashCase) {
el.style.removeProperty(style);
} else {
el.style[style] = "";
}
}
setProperty(el, name, value) {
if (el == null) {
return;
}
(typeof ngDevMode === "undefined" || ngDevMode) && this.throwOnSyntheticProps && checkNoSyntheticProp(name, "property");
el[name] = value;
}
setValue(node, value) {
node.nodeValue = value;
}
listen(target, event, callback, options) {
(typeof ngDevMode === "undefined" || ngDevMode) && this.throwOnSyntheticProps && checkNoSyntheticProp(event, "listener");
if (typeof target === "string") {
target = getDOM().getGlobalEventTarget(this.doc, target);
if (!target) {
throw new RuntimeError(5102, (typeof ngDevMode === "undefined" || ngDevMode) && `Unsupported event target ${target} for event ${event}`);
}
}
let wrappedCallback = this.decoratePreventDefault(callback);
if (this.tracingService?.wrapEventListener) {
wrappedCallback = this.tracingService.wrapEventListener(target, event, wrappedCallback);
}
return this.eventManager.addEventListener(target, event, wrappedCallback, options);
}
decoratePreventDefault(eventHandler) {
return (event) => {
if (event === "__ngUnwrap__") {
return eventHandler;
}
const allowDefaultBehavior = false ? this.ngZone.runGuarded(() => eventHandler(event)) : eventHandler(event);
if (allowDefaultBehavior === false) {
event.preventDefault();
}
return void 0;
};
}
};
__name(_DefaultDomRenderer2, "DefaultDomRenderer2");
var DefaultDomRenderer2 = _DefaultDomRenderer2;
var AT_CHARCODE = (() => "@".charCodeAt(0))();
function checkNoSyntheticProp(name, nameKind) {
if (name.charCodeAt(0) === AT_CHARCODE) {
throw new RuntimeError(5105, `Unexpected synthetic ${nameKind} ${name} found. Please make sure that:
- Make sure \`provideAnimationsAsync()\`, \`provideAnimations()\` or \`provideNoopAnimations()\` call was added to a list of providers used to bootstrap an application.
- There is a corresponding animation configuration named \`${name}\` defined in the \`animations\` field of the \`@Component\` decorator (see https://angular.dev/api/core/Component#animations).`);
}
}
__name(checkNoSyntheticProp, "checkNoSyntheticProp");
function isTemplateNode(node) {
return node.tagName === "TEMPLATE" && node.content !== void 0;
}
__name(isTemplateNode, "isTemplateNode");
var _ShadowDomRenderer = class _ShadowDomRenderer extends DefaultDomRenderer2 {
sharedStylesHost;
hostEl;
shadowRoot;
constructor(eventManager, sharedStylesHost, hostEl, component, doc, ngZone, nonce, platformIsServer, tracingService) {
super(eventManager, doc, ngZone, platformIsServer, tracingService);
this.sharedStylesHost = sharedStylesHost;
this.hostEl = hostEl;
this.shadowRoot = hostEl.attachShadow({
mode: "open"
});
this.sharedStylesHost.addHost(this.shadowRoot);
let styles = component.styles;
if (ngDevMode) {
const baseHref = getDOM().getBaseHref(doc) ?? "";
styles = addBaseHrefToCssSourceMap(baseHref, styles);
}
styles = shimStylesContent(component.id, styles);
for (const style of styles) {
const styleEl = document.createElement("style");
if (nonce) {
styleEl.setAttribute("nonce", nonce);
}
styleEl.textContent = style;
this.shadowRoot.appendChild(styleEl);
}
const styleUrls = component.getExternalStyles?.();
if (styleUrls) {
for (const styleUrl of styleUrls) {
const linkEl = createLinkElement(styleUrl, doc);
if (nonce) {
linkEl.setAttribute("nonce", nonce);
}
this.shadowRoot.appendChild(linkEl);
}
}
}
nodeOrShadowRoot(node) {
return node === this.hostEl ? this.shadowRoot : node;
}
appendChild(parent, newChild) {
return super.appendChild(this.nodeOrShadowRoot(parent), newChild);
}
insertBefore(parent, newChild, refChild) {
return super.insertBefore(this.nodeOrShadowRoot(parent), newChild, refChild);
}
removeChild(_parent, oldChild) {
return super.removeChild(null, oldChild);
}
parentNode(node) {
return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(node)));
}
destroy() {
this.sharedStylesHost.removeHost(this.shadowRoot);
}
};
__name(_ShadowDomRenderer, "ShadowDomRenderer");
var ShadowDomRenderer = _ShadowDomRenderer;
var _NoneEncapsulationDomRenderer = class _NoneEncapsulationDomRenderer extends DefaultDomRenderer2 {
sharedStylesHost;
removeStylesOnCompDestroy;
styles;
styleUrls;
constructor(eventManager, sharedStylesHost, component, removeStylesOnCompDestroy, doc, ngZone, platformIsServer, tracingService, compId) {
super(eventManager, doc, ngZone, platformIsServer, tracingService);
this.sharedStylesHost = sharedStylesHost;
this.removeStylesOnCompDestroy = removeStylesOnCompDestroy;
let styles = component.styles;
if (ngDevMode) {
const baseHref = getDOM().getBaseHref(doc) ?? "";
styles = addBaseHrefToCssSourceMap(baseHref, styles);
}
this.styles = compId ? shimStylesContent(compId, styles) : styles;
this.styleUrls = component.getExternalStyles?.(compId);
}
applyStyles() {
this.sharedStylesHost.addStyles(this.styles, this.styleUrls);
}
destroy() {
if (!this.removeStylesOnCompDestroy) {
return;
}
if (allLeavingAnimations.size === 0) {
this.sharedStylesHost.removeStyles(this.styles, this.styleUrls);
}
}
};
__name(_NoneEncapsulationDomRenderer, "NoneEncapsulationDomRenderer");
var NoneEncapsulationDomRenderer = _NoneEncapsulationDomRenderer;
var _EmulatedEncapsulationDomRenderer2 = class _EmulatedEncapsulationDomRenderer2 extends NoneEncapsulationDomRenderer {
contentAttr;
hostAttr;
constructor(eventManager, sharedStylesHost, component, appId, removeStylesOnCompDestroy, doc, ngZone, platformIsServer, tracingService) {
const compId = appId + "-" + component.id;
super(eventManager, sharedStylesHost, component, removeStylesOnCompDestroy, doc, ngZone, platformIsServer, tracingService, compId);
this.contentAttr = shimContentAttribute(compId);
this.hostAttr = shimHostAttribute(compId);
}
applyToHost(element) {
this.applyStyles();
this.setAttribute(element, this.hostAttr, "");
}
createElement(parent, name) {
const el = super.createElement(parent, name);
super.setAttribute(el, this.contentAttr, "");
return el;
}
};
__name(_EmulatedEncapsulationDomRenderer2, "EmulatedEncapsulationDomRenderer2");
var EmulatedEncapsulationDomRenderer2 = _EmulatedEncapsulationDomRenderer2;
// node_modules/@angular/platform-browser/fesm2022/browser.mjs
var _BrowserDomAdapter = class _BrowserDomAdapter extends DomAdapter {
supportsDOMEvents = true;
static makeCurrent() {
setRootDomAdapter(new _BrowserDomAdapter());
}
onAndCancel(el, evt, listener, options) {
el.addEventListener(evt, listener, options);
return () => {
el.removeEventListener(evt, listener, options);
};
}
dispatchEvent(el, evt) {
el.dispatchEvent(evt);
}
remove(node) {
node.remove();
}
createElement(tagName, doc) {
doc = doc || this.getDefaultDocument();
return doc.createElement(tagName);
}
createHtmlDocument() {
return document.implementation.createHTMLDocument("fakeTitle");
}
getDefaultDocument() {
return document;
}
isElementNode(node) {
return node.nodeType === Node.ELEMENT_NODE;
}
isShadowRoot(node) {
return node instanceof DocumentFragment;
}
/** @deprecated No longer being used in Ivy code. To be removed in version 14. */
getGlobalEventTarget(doc, target) {
if (target === "window") {
return window;
}
if (target === "document") {
return doc;
}
if (target === "body") {
return doc.body;
}
return null;
}
getBaseHref(doc) {
const href = getBaseElementHref();
return href == null ? null : relativePath(href);
}
resetBaseElement() {
baseElement = null;
}
getUserAgent() {
return window.navigator.userAgent;
}
getCookie(name) {
return parseCookieValue(document.cookie, name);
}
};
__name(_BrowserDomAdapter, "BrowserDomAdapter");
var BrowserDomAdapter = _BrowserDomAdapter;
var baseElement = null;
function getBaseElementHref() {
baseElement = baseElement || document.head.querySelector("base");
return baseElement ? baseElement.getAttribute("href") : null;
}
__name(getBaseElementHref, "getBaseElementHref");
function relativePath(url) {
return new URL(url, document.baseURI).pathname;
}
__name(relativePath, "relativePath");
var _BrowserGetTestability = class _BrowserGetTestability {
addToWindow(registry) {
_global["getAngularTestability"] = (elem, findInAncestors = true) => {
const testability = registry.findTestabilityInTree(elem, findInAncestors);
if (testability == null) {
throw new RuntimeError(5103, (typeof ngDevMode === "undefined" || ngDevMode) && "Could not find testability for element.");
}
return testability;
};
_global["getAllAngularTestabilities"] = () => registry.getAllTestabilities();
_global["getAllAngularRootElements"] = () => registry.getAllRootElements();
const whenAllStable = /* @__PURE__ */ __name((callback) => {
const testabilities = _global["getAllAngularTestabilities"]();
let count = testabilities.length;
const decrement = /* @__PURE__ */ __name(function() {
count--;
if (count == 0) {
callback();
}
}, "decrement");
testabilities.forEach((testability) => {
testability.whenStable(decrement);
});
}, "whenAllStable");
if (!_global["frameworkStabilizers"]) {
_global["frameworkStabilizers"] = [];
}
_global["frameworkStabilizers"].push(whenAllStable);
}
findTestabilityInTree(registry, elem, findInAncestors) {
if (elem == null) {
return null;
}
const t = registry.getTestability(elem);
if (t != null) {
return t;
} else if (!findInAncestors) {
return null;
}
if (getDOM().isShadowRoot(elem)) {
return this.findTestabilityInTree(registry, elem.host, true);
}
return this.findTestabilityInTree(registry, elem.parentElement, true);
}
};
__name(_BrowserGetTestability, "BrowserGetTestability");
var BrowserGetTestability = _BrowserGetTestability;
var _BrowserXhr = class _BrowserXhr {
build() {
return new XMLHttpRequest();
}
};
__name(_BrowserXhr, "BrowserXhr");
__publicField(_BrowserXhr, "\u0275fac", /* @__PURE__ */ __name(function BrowserXhr_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _BrowserXhr)();
}, "BrowserXhr_Factory"));
__publicField(_BrowserXhr, "\u0275prov", /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _BrowserXhr,
factory: _BrowserXhr.\u0275fac
}));
var BrowserXhr = _BrowserXhr;
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(BrowserXhr, [{
type: Injectable
}], null, null);
})();
var _DomEventsPlugin = class _DomEventsPlugin extends EventManagerPlugin {
constructor(doc) {
super(doc);
}
// This plugin should come last in the list of plugins, because it accepts all
// events.
supports(eventName) {
return true;
}
addEventListener(element, eventName, handler, options) {
element.addEventListener(eventName, handler, options);
return () => this.removeEventListener(element, eventName, handler, options);
}
removeEventListener(target, eventName, callback, options) {
return target.removeEventListener(eventName, callback, options);
}
};
__name(_DomEventsPlugin, "DomEventsPlugin");
__publicField(_DomEventsPlugin, "\u0275fac", /* @__PURE__ */ __name(function DomEventsPlugin_Factory(__ngFactoryType__) {
return new (__ngFactoryType__ || _DomEventsPlugin)(\u0275\u0275inject(DOCUMENT));
}, "DomEventsPlugin_Factory"));
__publicField(_DomEventsPlugin, "\u0275prov", /* @__PURE__ */ \u0275\u0275defineInjectable({
token: _DomEventsPlugin,
factory: _DomEventsPlugin.\u0275fac
}));
var DomEventsPlugin = _DomEventsPlugin;
(() => {
(typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(DomEventsPlugin, [{
type: Injectable
}], () => [{
type: void 0,
decorators: [{
type: Inject,