@microsoft/fast-element 2.2.1 → 2.4.0

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/CHANGELOG.json CHANGED
@@ -2,7 +2,67 @@
2
2
  "name": "@microsoft/fast-element",
3
3
  "entries": [
4
4
  {
5
- "date": "Wed, 16 Apr 2025 15:52:41 GMT",
5
+ "date": "Fri, 23 May 2025 23:51:58 GMT",
6
+ "version": "2.4.0",
7
+ "tag": "@microsoft/fast-element_v2.4.0",
8
+ "comments": {
9
+ "minor": [
10
+ {
11
+ "author": "7559015+janechu@users.noreply.github.com",
12
+ "package": "@microsoft/fast-element",
13
+ "commit": "746baedf522782b78b6827c99062366770ecd384",
14
+ "comment": "Add enumerated hydration binding markers"
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "date": "Mon, 12 May 2025 00:33:45 GMT",
21
+ "version": "2.3.0",
22
+ "tag": "@microsoft/fast-element_v2.3.0",
23
+ "comments": {
24
+ "none": [
25
+ {
26
+ "author": "7559015+janechu@users.noreply.github.com",
27
+ "package": "@microsoft/fast-element",
28
+ "commit": "d9eed655b48ad78b173a0688161f6e218fd0d9c9",
29
+ "comment": "Fix a dependency security issue due to an outdated version of express"
30
+ }
31
+ ]
32
+ }
33
+ },
34
+ {
35
+ "date": "Mon, 05 May 2025 00:33:41 GMT",
36
+ "version": "2.3.0",
37
+ "tag": "@microsoft/fast-element_v2.3.0",
38
+ "comments": {
39
+ "minor": [
40
+ {
41
+ "author": "7559015+janechu@users.noreply.github.com",
42
+ "package": "@microsoft/fast-element",
43
+ "commit": "9ccfe094e922753556ab041f833cec716402cdd3",
44
+ "comment": "Allow shadowOptions to be observed"
45
+ }
46
+ ]
47
+ }
48
+ },
49
+ {
50
+ "date": "Mon, 28 Apr 2025 16:06:00 GMT",
51
+ "version": "2.2.1",
52
+ "tag": "@microsoft/fast-element_v2.2.1",
53
+ "comments": {
54
+ "none": [
55
+ {
56
+ "author": "7559015+janechu@users.noreply.github.com",
57
+ "package": "@microsoft/fast-element",
58
+ "commit": "3217b8f88254fb703bd3aae6a408ba2de8b8f741",
59
+ "comment": "Add iterations to conditional test timeout"
60
+ }
61
+ ]
62
+ }
63
+ },
64
+ {
65
+ "date": "Wed, 16 Apr 2025 15:53:12 GMT",
6
66
  "version": "2.2.1",
7
67
  "tag": "@microsoft/fast-element_v2.2.1",
8
68
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,28 @@
1
1
  # Change Log - @microsoft/fast-element
2
2
 
3
- <!-- This log was last generated on Wed, 16 Apr 2025 15:52:41 GMT and should not be manually modified. -->
3
+ <!-- This log was last generated on Fri, 23 May 2025 23:51:58 GMT and should not be manually modified. -->
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 2.4.0
8
+
9
+ Fri, 23 May 2025 23:51:58 GMT
10
+
11
+ ### Minor changes
12
+
13
+ - Add enumerated hydration binding markers (7559015+janechu@users.noreply.github.com)
14
+
15
+ ## 2.3.0
16
+
17
+ Mon, 05 May 2025 00:33:41 GMT
18
+
19
+ ### Minor changes
20
+
21
+ - Allow shadowOptions to be observed (7559015+janechu@users.noreply.github.com)
22
+
7
23
  ## 2.2.1
8
24
 
9
- Wed, 16 Apr 2025 15:52:41 GMT
25
+ Wed, 16 Apr 2025 15:53:12 GMT
10
26
 
11
27
  ### Patches
12
28
 
@@ -5,7 +5,7 @@ import type { HostBehavior, HostController } from "../styles/host.js";
5
5
  import type { StyleStrategy, StyleTarget } from "../styles/style-strategy.js";
6
6
  import type { ElementViewTemplate } from "../templating/template.js";
7
7
  import type { ElementView } from "../templating/view.js";
8
- import { FASTElementDefinition } from "./fast-definitions.js";
8
+ import { FASTElementDefinition, ShadowRootOptions } from "./fast-definitions.js";
9
9
  /**
10
10
  * A type that instantiates an ElementController
11
11
  * @public
@@ -28,6 +28,7 @@ export declare class ElementController<TElement extends HTMLElement = HTMLElemen
28
28
  protected needsInitialization: boolean;
29
29
  private hasExistingShadowRoot;
30
30
  private _template;
31
+ private _shadowRootOptions;
31
32
  protected stage: Stages;
32
33
  /**
33
34
  * A guard against connecting behaviors multiple times
@@ -90,6 +91,8 @@ export declare class ElementController<TElement extends HTMLElement = HTMLElemen
90
91
  */
91
92
  get template(): ElementViewTemplate<TElement> | null;
92
93
  set template(value: ElementViewTemplate<TElement> | null);
94
+ get shadowOptions(): ShadowRootOptions | undefined;
95
+ set shadowOptions(value: ShadowRootOptions | undefined);
93
96
  /**
94
97
  * The main set of styles used for the component, independent
95
98
  * of any dynamically added styles.
@@ -101,7 +101,7 @@ export declare class FASTElementDefinition<TType extends Constructable<HTMLEleme
101
101
  /**
102
102
  * Options controlling the creation of the custom element's shadow DOM.
103
103
  */
104
- readonly shadowOptions?: ShadowRootOptions;
104
+ shadowOptions?: ShadowRootOptions;
105
105
  /**
106
106
  * Options controlling how the custom element is defined with the platform.
107
107
  */
@@ -24,6 +24,13 @@ export declare const HydrationMarkup: Readonly<{
24
24
  * attributes for the element, or null if no factories were found.
25
25
  */
26
26
  parseAttributeBinding(node: Element): null | number[];
27
+ /**
28
+ * Returns the indexes of the ViewBehaviorFactories affecting
29
+ * attributes for the element, or null if no factories were found.
30
+ *
31
+ * Uses the alternative syntax of data-fe-b-<number>
32
+ */
33
+ parseEnumeratedAttributeBinding(node: Element): null | number[];
27
34
  /**
28
35
  * Parses the ViewBehaviorFactory index from string data. Returns
29
36
  * the binding index or null if the index cannot be retrieved.
@@ -67,19 +67,7 @@ export class ElementController extends PropertyChangeNotifier {
67
67
  this.view = null;
68
68
  this.source = element;
69
69
  this.definition = definition;
70
- const shadowOptions = definition.shadowOptions;
71
- if (shadowOptions !== void 0) {
72
- let shadowRoot = element.shadowRoot;
73
- if (shadowRoot) {
74
- this.hasExistingShadowRoot = true;
75
- }
76
- else {
77
- shadowRoot = element.attachShadow(shadowOptions);
78
- if (shadowOptions.mode === "closed") {
79
- shadowRoots.set(element, shadowRoot);
80
- }
81
- }
82
- }
70
+ this.shadowOptions = definition.shadowOptions;
83
71
  // Capture any observable values that were set by the binding engine before
84
72
  // the browser upgraded the element. Then delete the property since it will
85
73
  // shadow the getter/setter that is required to make the observable operate.
@@ -156,6 +144,25 @@ export class ElementController extends PropertyChangeNotifier {
156
144
  this.renderTemplate(value);
157
145
  }
158
146
  }
147
+ get shadowOptions() {
148
+ return this._shadowRootOptions;
149
+ }
150
+ set shadowOptions(value) {
151
+ // options on the shadowRoot can only be set once
152
+ if (this._shadowRootOptions === void 0 && value !== void 0) {
153
+ this._shadowRootOptions = value;
154
+ let shadowRoot = this.source.shadowRoot;
155
+ if (shadowRoot) {
156
+ this.hasExistingShadowRoot = true;
157
+ }
158
+ else {
159
+ shadowRoot = this.source.attachShadow(value);
160
+ if (value.mode === "closed") {
161
+ shadowRoots.set(this.source, shadowRoot);
162
+ }
163
+ }
164
+ }
165
+ }
159
166
  /**
160
167
  * The main set of styles used for the component, independent
161
168
  * of any dynamically added styles.
@@ -438,6 +445,12 @@ export class ElementController extends PropertyChangeNotifier {
438
445
  element.$fastController.connect();
439
446
  },
440
447
  }, "template");
448
+ Observable.getNotifier(definition).subscribe({
449
+ handleChange: () => {
450
+ ElementController.forCustomElement(element, true);
451
+ element.$fastController.connect();
452
+ },
453
+ }, "shadowOptions");
441
454
  return (element.$fastController = new elementControllerStrategy(element, definition));
442
455
  }
443
456
  /**
@@ -111,3 +111,4 @@ FASTElementDefinition.getByType = fastElementRegistry.getByType;
111
111
  */
112
112
  FASTElementDefinition.getForInstance = fastElementRegistry.getForInstance;
113
113
  Observable.defineProperty(FASTElementDefinition.prototype, "template");
114
+ Observable.defineProperty(FASTElementDefinition.prototype, "shadowOptions");
@@ -54,6 +54,20 @@ export const HydrationMarkup = Object.freeze({
54
54
  ? attr
55
55
  : attr.split(this.attributeBindingSeparator).map(i => parseInt(i));
56
56
  },
57
+ /**
58
+ * Returns the indexes of the ViewBehaviorFactories affecting
59
+ * attributes for the element, or null if no factories were found.
60
+ *
61
+ * Uses the alternative syntax of data-fe-b-<number>
62
+ */
63
+ parseEnumeratedAttributeBinding(node) {
64
+ const attrs = [];
65
+ let count = 0;
66
+ while (node.hasAttribute(`${this.attributeMarkerName}-${count}`)) {
67
+ attrs.push(count++);
68
+ }
69
+ return count === 0 ? null : attrs;
70
+ },
57
71
  /**
58
72
  * Parses the ViewBehaviorFactory index from string data. Returns
59
73
  * the binding index or null if the index cannot be retrieved.
@@ -79,8 +79,9 @@ export function buildViewBindingTargets(firstNode, lastNode, factories) {
79
79
  return { targets, boundaries };
80
80
  }
81
81
  function targetElement(node, factories, targets) {
82
+ var _a;
82
83
  // Check for attributes and map any factories.
83
- const attrFactoryIds = HydrationMarkup.parseAttributeBinding(node);
84
+ const attrFactoryIds = (_a = HydrationMarkup.parseAttributeBinding(node)) !== null && _a !== void 0 ? _a : HydrationMarkup.parseEnumeratedAttributeBinding(node);
84
85
  if (attrFactoryIds !== null) {
85
86
  for (const id of attrFactoryIds) {
86
87
  if (!factories[id]) {
@@ -5777,6 +5777,50 @@
5777
5777
  "isAbstract": false,
5778
5778
  "name": "setStrategy"
5779
5779
  },
5780
+ {
5781
+ "kind": "Property",
5782
+ "canonicalReference": "@microsoft/fast-element!ElementController#shadowOptions:member",
5783
+ "docComment": "",
5784
+ "excerptTokens": [
5785
+ {
5786
+ "kind": "Content",
5787
+ "text": "get shadowOptions(): "
5788
+ },
5789
+ {
5790
+ "kind": "Reference",
5791
+ "text": "ShadowRootOptions",
5792
+ "canonicalReference": "@microsoft/fast-element!ShadowRootOptions:interface"
5793
+ },
5794
+ {
5795
+ "kind": "Content",
5796
+ "text": " | undefined"
5797
+ },
5798
+ {
5799
+ "kind": "Content",
5800
+ "text": ";\n\nset shadowOptions(value: "
5801
+ },
5802
+ {
5803
+ "kind": "Reference",
5804
+ "text": "ShadowRootOptions",
5805
+ "canonicalReference": "@microsoft/fast-element!ShadowRootOptions:interface"
5806
+ },
5807
+ {
5808
+ "kind": "Content",
5809
+ "text": " | undefined);"
5810
+ }
5811
+ ],
5812
+ "isReadonly": false,
5813
+ "isOptional": false,
5814
+ "releaseTag": "Public",
5815
+ "name": "shadowOptions",
5816
+ "propertyTypeTokenRange": {
5817
+ "startIndex": 1,
5818
+ "endIndex": 3
5819
+ },
5820
+ "isStatic": false,
5821
+ "isProtected": false,
5822
+ "isAbstract": false
5823
+ },
5780
5824
  {
5781
5825
  "kind": "Property",
5782
5826
  "canonicalReference": "@microsoft/fast-element!ElementController#source:member",
@@ -9182,7 +9226,7 @@
9182
9226
  "excerptTokens": [
9183
9227
  {
9184
9228
  "kind": "Content",
9185
- "text": "readonly shadowOptions?: "
9229
+ "text": "shadowOptions?: "
9186
9230
  },
9187
9231
  {
9188
9232
  "kind": "Reference",
@@ -9194,7 +9238,7 @@
9194
9238
  "text": ";"
9195
9239
  }
9196
9240
  ],
9197
- "isReadonly": true,
9241
+ "isReadonly": false,
9198
9242
  "isOptional": true,
9199
9243
  "releaseTag": "Public",
9200
9244
  "name": "shadowOptions",
@@ -2341,6 +2341,20 @@ const HydrationMarkup = Object.freeze({
2341
2341
  ? attr
2342
2342
  : attr.split(this.attributeBindingSeparator).map(i => parseInt(i));
2343
2343
  },
2344
+ /**
2345
+ * Returns the indexes of the ViewBehaviorFactories affecting
2346
+ * attributes for the element, or null if no factories were found.
2347
+ *
2348
+ * Uses the alternative syntax of data-fe-b-<number>
2349
+ */
2350
+ parseEnumeratedAttributeBinding(node) {
2351
+ const attrs = [];
2352
+ let count = 0;
2353
+ while (node.hasAttribute(`${this.attributeMarkerName}-${count}`)) {
2354
+ attrs.push(count++);
2355
+ }
2356
+ return count === 0 ? null : attrs;
2357
+ },
2344
2358
  /**
2345
2359
  * Parses the ViewBehaviorFactory index from string data. Returns
2346
2360
  * the binding index or null if the index cannot be retrieved.
@@ -2651,8 +2665,9 @@ function buildViewBindingTargets(firstNode, lastNode, factories) {
2651
2665
  return { targets, boundaries };
2652
2666
  }
2653
2667
  function targetElement(node, factories, targets) {
2668
+ var _a;
2654
2669
  // Check for attributes and map any factories.
2655
- const attrFactoryIds = HydrationMarkup.parseAttributeBinding(node);
2670
+ const attrFactoryIds = (_a = HydrationMarkup.parseAttributeBinding(node)) !== null && _a !== void 0 ? _a : HydrationMarkup.parseEnumeratedAttributeBinding(node);
2656
2671
  if (attrFactoryIds !== null) {
2657
2672
  for (const id of attrFactoryIds) {
2658
2673
  if (!factories[id]) {
@@ -4802,6 +4817,7 @@ FASTElementDefinition.getByType = fastElementRegistry.getByType;
4802
4817
  */
4803
4818
  FASTElementDefinition.getForInstance = fastElementRegistry.getForInstance;
4804
4819
  Observable.defineProperty(FASTElementDefinition.prototype, "template");
4820
+ Observable.defineProperty(FASTElementDefinition.prototype, "shadowOptions");
4805
4821
 
4806
4822
  /**
4807
4823
  * A Behavior that enables advanced rendering.
@@ -5370,19 +5386,7 @@ class ElementController extends PropertyChangeNotifier {
5370
5386
  this.view = null;
5371
5387
  this.source = element;
5372
5388
  this.definition = definition;
5373
- const shadowOptions = definition.shadowOptions;
5374
- if (shadowOptions !== void 0) {
5375
- let shadowRoot = element.shadowRoot;
5376
- if (shadowRoot) {
5377
- this.hasExistingShadowRoot = true;
5378
- }
5379
- else {
5380
- shadowRoot = element.attachShadow(shadowOptions);
5381
- if (shadowOptions.mode === "closed") {
5382
- shadowRoots.set(element, shadowRoot);
5383
- }
5384
- }
5385
- }
5389
+ this.shadowOptions = definition.shadowOptions;
5386
5390
  // Capture any observable values that were set by the binding engine before
5387
5391
  // the browser upgraded the element. Then delete the property since it will
5388
5392
  // shadow the getter/setter that is required to make the observable operate.
@@ -5459,6 +5463,25 @@ class ElementController extends PropertyChangeNotifier {
5459
5463
  this.renderTemplate(value);
5460
5464
  }
5461
5465
  }
5466
+ get shadowOptions() {
5467
+ return this._shadowRootOptions;
5468
+ }
5469
+ set shadowOptions(value) {
5470
+ // options on the shadowRoot can only be set once
5471
+ if (this._shadowRootOptions === void 0 && value !== void 0) {
5472
+ this._shadowRootOptions = value;
5473
+ let shadowRoot = this.source.shadowRoot;
5474
+ if (shadowRoot) {
5475
+ this.hasExistingShadowRoot = true;
5476
+ }
5477
+ else {
5478
+ shadowRoot = this.source.attachShadow(value);
5479
+ if (value.mode === "closed") {
5480
+ shadowRoots.set(this.source, shadowRoot);
5481
+ }
5482
+ }
5483
+ }
5484
+ }
5462
5485
  /**
5463
5486
  * The main set of styles used for the component, independent
5464
5487
  * of any dynamically added styles.
@@ -5741,6 +5764,12 @@ class ElementController extends PropertyChangeNotifier {
5741
5764
  element.$fastController.connect();
5742
5765
  },
5743
5766
  }, "template");
5767
+ Observable.getNotifier(definition).subscribe({
5768
+ handleChange: () => {
5769
+ ElementController.forCustomElement(element, true);
5770
+ element.$fastController.connect();
5771
+ },
5772
+ }, "shadowOptions");
5744
5773
  return (element.$fastController = new elementControllerStrategy(element, definition));
5745
5774
  }
5746
5775
  /**
@@ -1,3 +1,3 @@
1
- void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",{value:Object.create(null),configurable:!1,enumerable:!1,writable:!1});const e=globalThis.FAST,t={1101:"Must call ArrayObserver.enable() before observing arrays.",1201:"The DOM Policy can only be set once.",1202:"To bind innerHTML, you must use a TrustedTypesPolicy.",1203:"View=>Model update skipped. To use twoWay binding, the target property must be observable.",1204:"No host element is present. Cannot bind host with ${name}.",1205:"The requested binding behavior is not supported by the binding engine.",1206:"Calling html`` as a normal function invalidates the security guarantees provided by FAST.",1207:"The DOM Policy for an HTML template can only be set once.",1208:"The DOM Policy cannot be set after a template is compiled.",1209:"'${aspectName}' on '${tagName}' is blocked by the current DOMPolicy.",1401:"Missing FASTElement definition.",1501:"No registration for Context/Interface '${name}'.",1502:"Dependency injection resolver for '${key}' returned a null factory.",1503:"Invalid dependency injection resolver strategy specified '${strategy}'.",1504:"Unable to autoregister dependency.",1505:"Unable to resolve dependency injection key '${key}'.",1506:"'${name}' is a native function and therefore cannot be safely constructed by DI. If this is intentional, please use a callback or cachedCallback resolver.",1507:"Attempted to jitRegister something that is not a constructor '${value}'. Did you forget to register this dependency?",1508:"Attempted to jitRegister an intrinsic type '${value}'. Did you forget to add @inject(Key)?",1509:"Attempted to jitRegister an interface '${value}'.",1510:"A valid resolver was not returned from the register method.",1511:"Key/value cannot be null or undefined. Are you trying to inject/register something that doesn't exist with DI?",1512:"'${key}' not registered. Did you forget to add @singleton()?",1513:"Cyclic dependency found '${name}'.",1514:"Injected properties that are updated on changes to DOM connectivity require the target object to be an instance of FASTElement."},s=/(\$\{\w+?})/g,n=/\$\{(\w+?)}/g,i=Object.freeze({});function r(e,t){return e.split(s).map((e=>{var s;const i=e.replace(n,"$1");return String(null!==(s=t[i])&&void 0!==s?s:e)})).join("")}let o;Object.assign(e,{addMessages(e){Object.assign(t,e)},warn(e,s=i){var n;const o=null!==(n=t[e])&&void 0!==n?n:"Unknown Warning";console.warn(r(o,s))},error(e,s=i){var n;const o=null!==(n=t[e])&&void 0!==n?n:"Unknown Error";return new Error(r(o,s))}});const a="fast-kernel";try{if(document.currentScript)o=document.currentScript.getAttribute(a);else{const e=document.getElementsByTagName("script");o=e[e.length-1].getAttribute(a)}}catch(e){o="isolate"}let l;switch(o){case"share":l=Object.freeze({updateQueue:1,observable:2,contextEvent:3,elementRegistry:4});break;case"share-v2":l=Object.freeze({updateQueue:1.2,observable:2.2,contextEvent:3.2,elementRegistry:4.2});break;default:const e=`-${Math.random().toString(36).substring(2,8)}`;l=Object.freeze({updateQueue:`1.2${e}`,observable:`2.2${e}`,contextEvent:`3.2${e}`,elementRegistry:`4.2${e}`})}const c=e=>"function"==typeof e,d=e=>"string"==typeof e,h=()=>{};!function(){if("undefined"==typeof globalThis)if("undefined"!=typeof global)global.globalThis=global;else if("undefined"!=typeof self)self.globalThis=self;else if("undefined"!=typeof window)window.globalThis=window;else{const e=new Function("return this")();e.globalThis=e}}();const u={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},u));const f=globalThis.FAST;if(void 0===f.getById){const e=Object.create(null);Reflect.defineProperty(f,"getById",Object.assign({value(t,s){let n=e[t];return void 0===n&&(n=s?e[t]=s():null),n}},u))}void 0===f.error&&Object.assign(f,{warn(){},error:e=>new Error(`Error ${e}`),addMessages(){}});const p=Object.freeze([]);function g(){const e=new Map;return Object.freeze({register:t=>!e.has(t.type)&&(e.set(t.type,t),!0),getByType:t=>e.get(t),getForInstance(t){if(null!=t)return e.get(t.constructor)}})}function b(){const e=new WeakMap;return function(t){let s=e.get(t);if(void 0===s){let n=Reflect.getPrototypeOf(t);for(;void 0===s&&null!==n;)s=e.get(n),n=Reflect.getPrototypeOf(n);s=void 0===s?[]:s.slice(0),e.set(t,s)}return s}}function v(e){e.prototype.toJSON=h}const m=Object.freeze({none:0,attribute:1,booleanAttribute:2,property:3,content:4,tokenList:5,event:6}),y=e=>e,w=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:y}):{createHTML:y};let S=Object.freeze({createHTML:e=>w.createHTML(e),protect:(e,t,s,n)=>n});const C=S,T=Object.freeze({get policy(){return S},setPolicy(e){if(S!==C)throw f.error(1201);S=e},setAttribute(e,t,s){null==s?e.removeAttribute(t):e.setAttribute(t,s)},setBooleanAttribute(e,t,s){s?e.setAttribute(t,""):e.removeAttribute(t)}});function $(e,t,s,n){return(e,t,s,...i)=>{d(s)&&(s=s.replace(/(javascript:|vbscript:|data:)/,"")),n(e,t,s,...i)}}function x(e,t,s,n){throw f.error(1209,{aspectName:s,tagName:null!=e?e:"text"})}const O={onabort:x,onauxclick:x,onbeforeinput:x,onbeforematch:x,onblur:x,oncancel:x,oncanplay:x,oncanplaythrough:x,onchange:x,onclick:x,onclose:x,oncontextlost:x,oncontextmenu:x,oncontextrestored:x,oncopy:x,oncuechange:x,oncut:x,ondblclick:x,ondrag:x,ondragend:x,ondragenter:x,ondragleave:x,ondragover:x,ondragstart:x,ondrop:x,ondurationchange:x,onemptied:x,onended:x,onerror:x,onfocus:x,onformdata:x,oninput:x,oninvalid:x,onkeydown:x,onkeypress:x,onkeyup:x,onload:x,onloadeddata:x,onloadedmetadata:x,onloadstart:x,onmousedown:x,onmouseenter:x,onmouseleave:x,onmousemove:x,onmouseout:x,onmouseover:x,onmouseup:x,onpaste:x,onpause:x,onplay:x,onplaying:x,onprogress:x,onratechange:x,onreset:x,onresize:x,onscroll:x,onsecuritypolicyviolation:x,onseeked:x,onseeking:x,onselect:x,onslotchange:x,onstalled:x,onsubmit:x,onsuspend:x,ontimeupdate:x,ontoggle:x,onvolumechange:x,onwaiting:x,onwebkitanimationend:x,onwebkitanimationiteration:x,onwebkitanimationstart:x,onwebkittransitionend:x,onwheel:x},B={elements:{a:{[m.attribute]:{href:$},[m.property]:{href:$}},area:{[m.attribute]:{href:$},[m.property]:{href:$}},button:{[m.attribute]:{formaction:$},[m.property]:{formAction:$}},embed:{[m.attribute]:{src:x},[m.property]:{src:x}},form:{[m.attribute]:{action:$},[m.property]:{action:$}},frame:{[m.attribute]:{src:$},[m.property]:{src:$}},iframe:{[m.attribute]:{src:$},[m.property]:{src:$,srcdoc:x}},input:{[m.attribute]:{formaction:$},[m.property]:{formAction:$}},link:{[m.attribute]:{href:x},[m.property]:{href:x}},object:{[m.attribute]:{codebase:x,data:x},[m.property]:{codeBase:x,data:x}},script:{[m.attribute]:{src:x,text:x},[m.property]:{src:x,text:x,innerText:x,textContent:x}},style:{[m.property]:{innerText:x,textContent:x}}},aspects:{[m.attribute]:Object.assign({},O),[m.property]:Object.assign({innerHTML:x},O),[m.event]:Object.assign({},O)}};function N(e,t){const s={};for(const n in t){const i=e[n],r=t[n];switch(i){case null:break;case void 0:s[n]=r;break;default:s[n]=i}}for(const t in e)t in s||(s[t]=e[t]);return Object.freeze(s)}function k(e,t){const s={};for(const n in t){const i=e[n],r=t[n];switch(i){case null:break;case void 0:s[n]=N(r,{});break;default:s[n]=N(i,r)}}for(const t in e)t in s||(s[t]=N(e[t],{}));return Object.freeze(s)}function A(e,t){const s={};for(const n in t){const i=e[n],r=t[n];switch(i){case null:break;case void 0:s[n]=k(i,{});break;default:s[n]=k(i,r)}}for(const t in e)t in s||(s[t]=k(e[t],{}));return Object.freeze(s)}function E(e,t,s,n,i){const r=e[s];if(r){const e=r[n];if(e)return e(t,s,n,i)}}const M=Object.freeze({create(e={}){var t,s;const n=null!==(t=e.trustedType)&&void 0!==t?t:function(){const e=e=>e;return globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:e}):{createHTML:e}}(),i=(r=null!==(s=e.guards)&&void 0!==s?s:{},o=B,Object.freeze({elements:r.elements?A(r.elements,o.elements):o.elements,aspects:r.aspects?k(r.aspects,o.aspects):o.aspects}));var r,o;return Object.freeze({createHTML:e=>n.createHTML(e),protect(e,t,s,n){var r;const o=(null!=e?e:"").toLowerCase(),a=i.elements[o];if(a){const i=E(a,e,t,s,n);if(i)return i}return null!==(r=E(i.aspects,e,t,s,n))&&void 0!==r?r:n}})}}),j=f.getById(l.updateQueue,(()=>{const e=[],t=[],s=globalThis.requestAnimationFrame;let n=!0;function i(){if(t.length)throw t.shift()}function r(s){try{s.call()}catch(s){if(!n)throw e.length=0,s;t.push(s),setTimeout(i,0)}}function o(){let t=0;for(;t<e.length;)if(r(e[t]),t++,t>1024){for(let s=0,n=e.length-t;s<n;s++)e[s]=e[s+t];e.length-=t,t=0}e.length=0}function a(t){e.push(t),e.length<2&&(n?s(o):o())}return Object.freeze({enqueue:a,next:()=>new Promise(a),process:o,setMode:e=>n=e})}));class V{constructor(e,t){this.sub1=void 0,this.sub2=void 0,this.spillover=void 0,this.subject=e,this.sub1=t}has(e){return void 0===this.spillover?this.sub1===e||this.sub2===e:-1!==this.spillover.indexOf(e)}subscribe(e){const t=this.spillover;if(void 0===t){if(this.has(e))return;if(void 0===this.sub1)return void(this.sub1=e);if(void 0===this.sub2)return void(this.sub2=e);this.spillover=[this.sub1,this.sub2,e],this.sub1=void 0,this.sub2=void 0}else{-1===t.indexOf(e)&&t.push(e)}}unsubscribe(e){const t=this.spillover;if(void 0===t)this.sub1===e?this.sub1=void 0:this.sub2===e&&(this.sub2=void 0);else{const s=t.indexOf(e);-1!==s&&t.splice(s,1)}}notify(e){const t=this.spillover,s=this.subject;if(void 0===t){const t=this.sub1,n=this.sub2;void 0!==t&&t.handleChange(s,e),void 0!==n&&n.handleChange(s,e)}else for(let n=0,i=t.length;n<i;++n)t[n].handleChange(s,e)}}class I{constructor(e){this.subscribers={},this.subjectSubscribers=null,this.subject=e}notify(e){var t,s;null===(t=this.subscribers[e])||void 0===t||t.notify(e),null===(s=this.subjectSubscribers)||void 0===s||s.notify(e)}subscribe(e,t){var s,n;let i;i=t?null!==(s=this.subscribers[t])&&void 0!==s?s:this.subscribers[t]=new V(this.subject):null!==(n=this.subjectSubscribers)&&void 0!==n?n:this.subjectSubscribers=new V(this.subject),i.subscribe(e)}unsubscribe(e,t){var s,n;t?null===(s=this.subscribers[t])||void 0===s||s.unsubscribe(e):null===(n=this.subjectSubscribers)||void 0===n||n.unsubscribe(e)}}const R=Object.freeze({unknown:void 0,coupled:1}),_=f.getById(l.observable,(()=>{const e=j.enqueue,t=/(:|&&|\|\||if|\?\.)/,s=new WeakMap;let n,i=e=>{throw f.error(1101)};function r(e){var t;let n=null!==(t=e.$fastController)&&void 0!==t?t:s.get(e);return void 0===n&&(Array.isArray(e)?n=i(e):s.set(e,n=new I(e))),n}const o=b();class a{constructor(e){this.name=e,this.field=`_${e}`,this.callback=`${e}Changed`}getValue(e){return void 0!==n&&n.watch(e,this.name),e[this.field]}setValue(e,t){const s=this.field,n=e[s];if(n!==t){e[s]=t;const i=e[this.callback];c(i)&&i.call(e,n,t),r(e).notify(this.name)}}}class l extends V{constructor(e,t,s=!1){super(e,t),this.expression=e,this.isVolatileBinding=s,this.needsRefresh=!0,this.needsQueue=!0,this.isAsync=!0,this.first=this,this.last=null,this.propertySource=void 0,this.propertyName=void 0,this.notifier=void 0,this.next=void 0}setMode(e){this.isAsync=this.needsQueue=e}bind(e){this.controller=e;const t=this.observe(e.source,e.context);return!e.isBound&&this.requiresUnbind(e)&&e.onUnbind(this),t}requiresUnbind(e){return e.sourceLifetime!==R.coupled||this.first!==this.last||this.first.propertySource!==e.source}unbind(e){this.dispose()}observe(e,t){this.needsRefresh&&null!==this.last&&this.dispose();const s=n;let i;n=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;try{i=this.expression(e,t)}finally{n=s}return i}disconnect(){this.dispose()}dispose(){if(null!==this.last){let e=this.first;for(;void 0!==e;)e.notifier.unsubscribe(this,e.propertyName),e=e.next;this.last=null,this.needsRefresh=this.needsQueue=this.isAsync}}watch(e,t){const s=this.last,i=r(e),o=null===s?this.first:{};if(o.propertySource=e,o.propertyName=t,o.notifier=i,i.subscribe(this,t),null!==s){if(!this.needsRefresh){let t;n=void 0,t=s.propertySource[s.propertyName],n=this,e===t&&(this.needsRefresh=!0)}s.next=o}this.last=o}handleChange(){this.needsQueue?(this.needsQueue=!1,e(this)):this.isAsync||this.call()}call(){null!==this.last&&(this.needsQueue=this.isAsync,this.notify(this))}*records(){let e=this.first;for(;void 0!==e;)yield e,e=e.next}}return v(l),Object.freeze({setArrayObserverFactory(e){i=e},getNotifier:r,track(e,t){n&&n.watch(e,t)},trackVolatile(){n&&(n.needsRefresh=!0)},notify(e,t){r(e).notify(t)},defineProperty(e,t){d(t)&&(t=new a(t)),o(e).push(t),Reflect.defineProperty(e,t.name,{enumerable:!0,get(){return t.getValue(this)},set(e){t.setValue(this,e)}})},getAccessors:o,binding(e,t,s=this.isVolatileBinding(e)){return new l(e,t,s)},isVolatileBinding:e=>t.test(e.toString())})}));function z(e,t){_.defineProperty(e,t)}function L(e,t,s){return Object.assign({},s,{get(){return _.trackVolatile(),s.get.apply(this)}})}const F=f.getById(l.contextEvent,(()=>{let e=null;return{get:()=>e,set(t){e=t}}})),P=Object.freeze({default:{index:0,length:0,get event(){return P.getEvent()},eventDetail(){return this.event.detail},eventTarget(){return this.event.target}},getEvent:()=>F.get(),setEvent(e){F.set(e)}});class D{constructor(e,t,s){this.index=e,this.removed=t,this.addedCount=s}adjustTo(e){let t=this.index;const s=e.length;return t>s?t=s-this.addedCount:t<0&&(t=s+this.removed.length+t-this.addedCount),this.index=t<0?0:t,this}}class H{constructor(e){this.sorted=e}}const U=Object.freeze({reset:1,splice:2,optimized:3}),q=new D(0,p,0);q.reset=!0;const Q=[q];function W(e,t,s,n,i,r){let o=0,a=0;const l=Math.min(s-t,r-i);if(0===t&&0===i&&(o=function(e,t,s){for(let n=0;n<s;++n)if(e[n]!==t[n])return n;return s}(e,n,l)),s===e.length&&r===n.length&&(a=function(e,t,s){let n=e.length,i=t.length,r=0;for(;r<s&&e[--n]===t[--i];)r++;return r}(e,n,l-o)),i+=o,r-=a,(s-=a)-(t+=o)==0&&r-i==0)return p;if(t===s){const e=new D(t,[],0);for(;i<r;)e.removed.push(n[i++]);return[e]}if(i===r)return[new D(t,[],s-t)];const c=function(e){let t=e.length-1,s=e[0].length-1,n=e[t][s];const i=[];for(;t>0||s>0;){if(0===t){i.push(2),s--;continue}if(0===s){i.push(3),t--;continue}const r=e[t-1][s-1],o=e[t-1][s],a=e[t][s-1];let l;l=o<a?o<r?o:r:a<r?a:r,l===r?(r===n?i.push(0):(i.push(1),n=r),t--,s--):l===o?(i.push(3),t--,n=o):(i.push(2),s--,n=a)}return i.reverse()}(function(e,t,s,n,i,r){const o=r-i+1,a=s-t+1,l=new Array(o);let c,d;for(let e=0;e<o;++e)l[e]=new Array(a),l[e][0]=e;for(let e=0;e<a;++e)l[0][e]=e;for(let s=1;s<o;++s)for(let r=1;r<a;++r)e[t+r-1]===n[i+s-1]?l[s][r]=l[s-1][r-1]:(c=l[s-1][r]+1,d=l[s][r-1]+1,l[s][r]=c<d?c:d);return l}(e,t,s,n,i,r)),d=[];let h,u=t,f=i;for(let e=0;e<c.length;++e)switch(c[e]){case 0:void 0!==h&&(d.push(h),h=void 0),u++,f++;break;case 1:void 0===h&&(h=new D(u,[],0)),h.addedCount++,u++,h.removed.push(n[f]),f++;break;case 2:void 0===h&&(h=new D(u,[],0)),h.addedCount++,u++;break;case 3:void 0===h&&(h=new D(u,[],0)),h.removed.push(n[f]),f++}return void 0!==h&&d.push(h),d}function X(e,t){let s=!1,n=0;for(let l=0;l<t.length;l++){const c=t[l];if(c.index+=n,s)continue;const d=(i=e.index,r=e.index+e.removed.length,o=c.index,a=c.index+c.addedCount,r<o||a<i?-1:r===o||a===i?0:i<o?r<a?r-o:a-o:a<r?a-i:r-i);if(d>=0){t.splice(l,1),l--,n-=c.addedCount-c.removed.length,e.addedCount+=c.addedCount-d;const i=e.removed.length+c.removed.length-d;if(e.addedCount||i){let t=c.removed;if(e.index<c.index){const s=e.removed.slice(0,c.index-e.index);s.push(...t),t=s}if(e.index+e.removed.length>c.index+c.addedCount){const s=e.removed.slice(c.index+c.addedCount-e.index);t.push(...s)}e.removed=t,c.index<e.index&&(e.index=c.index)}else s=!0}else if(e.index<c.index){s=!0,t.splice(l,0,e),l++;const i=e.addedCount-e.removed.length;c.index+=i,n+=i}}var i,r,o,a;s||t.push(e)}let J=Object.freeze({support:U.optimized,normalize:(e,t,s)=>void 0===e?void 0===s?p:function(e,t){let s=[];const n=[];for(let e=0,s=t.length;e<s;e++)X(t[e],n);for(let t=0,i=n.length;t<i;++t){const i=n[t];1!==i.addedCount||1!==i.removed.length?s=s.concat(W(e,i.index,i.index+i.addedCount,i.removed,0,i.removed.length)):i.removed[0]!==e[i.index]&&s.push(i)}return s}(t,s):Q,pop(e,t,s,n){const i=e.length>0,r=s.apply(e,n);return i&&t.addSplice(new D(e.length,[r],0)),r},push(e,t,s,n){const i=s.apply(e,n);return t.addSplice(new D(e.length-n.length,[],n.length).adjustTo(e)),i},reverse(e,t,s,n){const i=s.apply(e,n);e.sorted++;const r=[];for(let t=e.length-1;t>=0;t--)r.push(t);return t.addSort(new H(r)),i},shift(e,t,s,n){const i=e.length>0,r=s.apply(e,n);return i&&t.addSplice(new D(0,[r],0)),r},sort(e,t,s,n){const i=new Map;for(let t=0,s=e.length;t<s;++t){const s=i.get(e[t])||[];i.set(e[t],[...s,t])}const r=s.apply(e,n);e.sorted++;const o=[];for(let t=0,s=e.length;t<s;++t){const s=i.get(e[t]);o.push(s[0]),i.set(e[t],s.splice(1))}return t.addSort(new H(o)),r},splice(e,t,s,n){const i=s.apply(e,n);return t.addSplice(new D(+n[0],i,n.length>2?n.length-2:0).adjustTo(e)),i},unshift(e,t,s,n){const i=s.apply(e,n);return t.addSplice(new D(0,[],n.length).adjustTo(e)),i}});const K=Object.freeze({reset:Q,setDefaultStrategy(e){J=e}});function G(e,t,s,n=!0){Reflect.defineProperty(e,t,{value:s,enumerable:!1,writable:n})}class Y extends V{constructor(e){super(e),this.oldCollection=void 0,this.splices=void 0,this.sorts=void 0,this.needsQueue=!0,this._strategy=null,this._lengthObserver=void 0,this._sortObserver=void 0,this.call=this.flush,G(e,"$fastController",this)}get strategy(){return this._strategy}set strategy(e){this._strategy=e}get lengthObserver(){let e=this._lengthObserver;if(void 0===e){const t=this.subject;this._lengthObserver=e={length:t.length,handleChange(){this.length!==t.length&&(this.length=t.length,_.notify(e,"length"))}},this.subscribe(e)}return e}get sortObserver(){let e=this._sortObserver;if(void 0===e){const t=this.subject;this._sortObserver=e={sorted:t.sorted,handleChange(){this.sorted!==t.sorted&&(this.sorted=t.sorted,_.notify(e,"sorted"))}},this.subscribe(e)}return e}subscribe(e){this.flush(),super.subscribe(e)}addSplice(e){void 0===this.splices?this.splices=[e]:this.splices.push(e),this.enqueue()}addSort(e){void 0===this.sorts?this.sorts=[e]:this.sorts.push(e),this.enqueue()}reset(e){this.oldCollection=e,this.enqueue()}flush(){var e;const t=this.splices,s=this.sorts,n=this.oldCollection;void 0===t&&void 0===n&&void 0===s||(this.needsQueue=!0,this.splices=void 0,this.sorts=void 0,this.oldCollection=void 0,void 0!==s?this.notify(s):this.notify((null!==(e=this._strategy)&&void 0!==e?e:J).normalize(n,this.subject,t)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,j.enqueue(this))}}let Z=!1;const ee=Object.freeze({sorted:0,enable(){if(Z)return;Z=!0,_.setArrayObserverFactory((e=>new Y(e)));const e=Array.prototype;e.$fastPatch||(G(e,"$fastPatch",1),G(e,"sorted",0),[e.pop,e.push,e.reverse,e.shift,e.sort,e.splice,e.unshift].forEach((t=>{e[t.name]=function(...e){var s;const n=this.$fastController;return void 0===n?t.apply(this,e):(null!==(s=n.strategy)&&void 0!==s?s:J)[t.name](this,n,t,e)}})))}});function te(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(ee.enable(),t=_.getNotifier(e)),_.track(t.lengthObserver,"length"),e.length}function se(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(ee.enable(),t=_.getNotifier(e)),_.track(t.sortObserver,"sorted"),e.sorted}class ne{constructor(e,t,s=!1){this.evaluate=e,this.policy=t,this.isVolatile=s}}class ie extends ne{createObserver(e){return _.binding(this.evaluate,e,this.isVolatile)}}function re(e,t,s=_.isVolatileBinding(e)){return new ie(e,t,s)}function oe(e,t){const s=new ie(e);return s.options=t,s}class ae extends ne{createObserver(){return this}bind(e){return this.evaluate(e.source,e.context)}}function le(e,t){return new ae(e,t)}function ce(e){return c(e)?re(e):e instanceof ne?e:le((()=>e))}let de;function he(e){return e.map((e=>e instanceof ue?he(e.styles):[e])).reduce(((e,t)=>e.concat(t)),[])}v(ae);class ue{constructor(e){this.styles=e,this.targets=new WeakSet,this._strategy=null,this.behaviors=e.map((e=>e instanceof ue?e.behaviors:null)).reduce(((e,t)=>null===t?e:null===e?t:e.concat(t)),null)}get strategy(){return null===this._strategy&&this.withStrategy(de),this._strategy}addStylesTo(e){this.strategy.addStylesTo(e),this.targets.add(e)}removeStylesFrom(e){this.strategy.removeStylesFrom(e),this.targets.delete(e)}isAttachedTo(e){return this.targets.has(e)}withBehaviors(...e){return this.behaviors=null===this.behaviors?e:this.behaviors.concat(e),this}withStrategy(e){return this._strategy=new e(he(this.styles)),this}static setDefaultStrategy(e){de=e}static normalize(e){return void 0===e?void 0:Array.isArray(e)?new ue(e):e instanceof ue?e:new ue([e])}}ue.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;const fe=g(),pe=Object.freeze({getForInstance:fe.getForInstance,getByType:fe.getByType,define:e=>(fe.register({type:e}),e)});function ge(){return function(e){pe.define(e)}}function be(e,t,s){t.source.style.setProperty(e.targetAspect,s.bind(t))}class ve{constructor(e,t){this.dataBinding=e,this.targetAspect=t}createCSS(e){return e(this),`var(${this.targetAspect})`}addedCallback(e){var t;const s=e.source;if(!s.$cssBindings){s.$cssBindings=new Map;const e=s.setAttribute;s.setAttribute=(t,n)=>{e.call(s,t,n),"style"===t&&s.$cssBindings.forEach(((e,t)=>be(t,e.controller,e.observer)))}}const n=null!==(t=e[this.targetAspect])&&void 0!==t?t:e[this.targetAspect]=this.dataBinding.createObserver(this,this);n.controller=e,e.source.$cssBindings.set(this,{controller:e,observer:n})}connectedCallback(e){be(this,e,e[this.targetAspect])}removedCallback(e){e.source.$cssBindings&&e.source.$cssBindings.delete(this)}handleChange(e,t){be(this,t.controller,t)}}pe.define(ve);const me=`${Math.random().toString(36).substring(2,8)}`;let ye=0;const we=()=>`--v${me}${++ye}`;function Se(e,t){const s=[];let n="";const i=[],r=e=>{i.push(e)};for(let i=0,o=e.length-1;i<o;++i){n+=e[i];let o=t[i];c(o)?o=new ve(re(o),we()).createCSS(r):o instanceof ne?o=new ve(o,we()).createCSS(r):void 0!==pe.getForInstance(o)&&(o=o.createCSS(r)),o instanceof ue||o instanceof CSSStyleSheet?(""!==n.trim()&&(s.push(n),n=""),s.push(o)):n+=o}return n+=e[e.length-1],""!==n.trim()&&s.push(n),{styles:s,behaviors:i}}const Ce=(e,...t)=>{const{styles:s,behaviors:n}=Se(e,t),i=new ue(s);return n.length?i.withBehaviors(...n):i};class Te{constructor(e,t){this.behaviors=t,this.css="";const s=e.reduce(((e,t)=>(d(t)?this.css+=t:e.push(t),e)),[]);s.length&&(this.styles=new ue(s))}createCSS(e){return this.behaviors.forEach(e),this.styles&&e(this),this.css}addedCallback(e){e.addStyles(this.styles)}removedCallback(e){e.removeStyles(this.styles)}}pe.define(Te),Ce.partial=(e,...t)=>{const{styles:s,behaviors:n}=Se(e,t);return new Te(s,n)};const $e=/fe-b\$\$start\$\$(\d+)\$\$(.+)\$\$fe-b/,xe=/fe-b\$\$end\$\$(\d+)\$\$(.+)\$\$fe-b/,Oe=/fe-repeat\$\$start\$\$(\d+)\$\$fe-repeat/,Be=/fe-repeat\$\$end\$\$(\d+)\$\$fe-repeat/,Ne=/^(?:.{0,1000})fe-eb\$\$start\$\$(.+?)\$\$fe-eb/,ke=/fe-eb\$\$end\$\$(.{0,1000})\$\$fe-eb(?:.{0,1000})$/;function Ae(e){return e&&e.nodeType===Node.COMMENT_NODE}const Ee=Object.freeze({attributeMarkerName:"data-fe-b",attributeBindingSeparator:" ",contentBindingStartMarker:(e,t)=>`fe-b$$start$$${e}$$${t}$$fe-b`,contentBindingEndMarker:(e,t)=>`fe-b$$end$$${e}$$${t}$$fe-b`,repeatStartMarker:e=>`fe-repeat$$start$$${e}$$fe-repeat`,repeatEndMarker:e=>`fe-repeat$$end$$${e}$$fe-repeat`,isContentBindingStartMarker:e=>$e.test(e),isContentBindingEndMarker:e=>xe.test(e),isRepeatViewStartMarker:e=>Oe.test(e),isRepeatViewEndMarker:e=>Be.test(e),isElementBoundaryStartMarker:e=>Ae(e)&&Ne.test(e.data.trim()),isElementBoundaryEndMarker:e=>Ae(e)&&ke.test(e.data),parseAttributeBinding(e){const t=e.getAttribute(this.attributeMarkerName);return null===t?t:t.split(this.attributeBindingSeparator).map((e=>parseInt(e)))},parseContentBindingStartMarker:e=>Ve($e,e),parseContentBindingEndMarker:e=>Ve(xe,e),parseRepeatStartMarker:e=>Me(Oe,e),parseRepeatEndMarker:e=>Me(Be,e),parseElementBoundaryStartMarker:e=>je(Ne,e.trim()),parseElementBoundaryEndMarker:e=>je(ke,e)});function Me(e,t){const s=e.exec(t);return null===s?s:parseInt(s[1])}function je(e,t){const s=e.exec(t);return null===s?s:s[1]}function Ve(e,t){const s=e.exec(t);return null===s?s:[parseInt(s[1]),s[2]]}const Ie=Symbol.for("fe-hydration");function Re(e){return e[Ie]===Ie}const _e=`fast-${Math.random().toString(36).substring(2,8)}`,ze=`${_e}{`,Le=`}${_e}`,Fe=Le.length;let Pe=0;const De=()=>`${_e}-${++Pe}`,He=Object.freeze({interpolation:e=>`${ze}${e}${Le}`,attribute:e=>`${De()}="${ze}${e}${Le}"`,comment:e=>`\x3c!--${ze}${e}${Le}--\x3e`}),Ue=Object.freeze({parse(e,t){const s=e.split(ze);if(1===s.length)return null;const n=[];for(let e=0,i=s.length;e<i;++e){const i=s[e],r=i.indexOf(Le);let o;if(-1===r)o=i;else{const e=i.substring(0,r);n.push(t[e]),o=i.substring(r+Fe)}""!==o&&n.push(o)}return n}}),qe=g(),Qe=Object.freeze({getForInstance:qe.getForInstance,getByType:qe.getByType,define:(e,t)=>((t=t||{}).type=e,qe.register(t),e),assignAspect(e,t){if(t)switch(e.sourceAspect=t,t[0]){case":":e.targetAspect=t.substring(1),e.aspectType="classList"===e.targetAspect?m.tokenList:m.property;break;case"?":e.targetAspect=t.substring(1),e.aspectType=m.booleanAttribute;break;case"@":e.targetAspect=t.substring(1),e.aspectType=m.event;break;default:e.targetAspect=t,e.aspectType=m.attribute}else e.aspectType=m.content}});function We(e){return function(t){Qe.define(t,e)}}class Xe{constructor(e){this.options=e}createHTML(e){return He.attribute(e(this))}createBehavior(){return this}}v(Xe);class Je extends Error{constructor(e,t,s){super(e),this.factories=t,this.node=s}}function Ke(e){return e.nodeType===Node.COMMENT_NODE}function Ge(e){return e.nodeType===Node.TEXT_NODE}function Ye(e,t){const s=document.createRange();return s.setStart(e,0),s.setEnd(t,Ke(t)||Ge(t)?t.data.length:t.childNodes.length),s}function Ze(e,t,s){const n=Ee.parseAttributeBinding(e);if(null!==n){for(const i of n){if(!t[i])throw new Je(`HydrationView was unable to successfully target factory on ${e.nodeName} inside ${e.getRootNode().host.nodeName}. This likely indicates a template mismatch between SSR rendering and hydration.`,t,e);tt(t[i],e,s)}e.removeAttribute(Ee.attributeMarkerName)}}function et(e,t,s,n,i){if(Ee.isElementBoundaryStartMarker(e))!function(e,t){const s=Ee.parseElementBoundaryStartMarker(e.data);let n=t.nextSibling();for(;null!==n;){if(Ke(n)){const e=Ee.parseElementBoundaryEndMarker(n.data);if(e&&e===s)break}n=t.nextSibling()}}(e,t);else if(Ee.isContentBindingStartMarker(e.data)){const r=Ee.parseContentBindingStartMarker(e.data);if(null===r)return;const[o,a]=r,l=s[o],c=[];let d=t.nextSibling();e.data="";const h=d;for(;null!==d;){if(Ke(d)){const e=Ee.parseContentBindingEndMarker(d.data);if(e&&e[1]===a)break}c.push(d),d=t.nextSibling()}if(null===d){const t=e.getRootNode();throw new Error(`Error hydrating Comment node inside "${function(e){return e instanceof DocumentFragment&&"mode"in e}(t)?t.host.nodeName:t.nodeName}".`)}if(d.data="",1===c.length&&Ge(c[0]))tt(l,c[0],n);else{d!==h&&null!==d.previousSibling&&(i[l.targetNodeId]={first:h,last:d.previousSibling});tt(l,d.parentNode.insertBefore(document.createTextNode(""),d),n)}}}function tt(e,t,s){if(void 0===e.targetNodeId)throw new Error("Factory could not be target to the node");s[e.targetNodeId]=t}var st;function nt(e,t){const s=e.parentNode;let n,i=e;for(;i!==t;){if(n=i.nextSibling,!n)throw new Error(`Unmatched first/last child inside "${t.getRootNode().host.nodeName}".`);s.removeChild(i),i=n}s.removeChild(t)}class it{constructor(){this.index=0,this.length=0}get event(){return P.getEvent()}get isEven(){return this.index%2==0}get isOdd(){return this.index%2!=0}get isFirst(){return 0===this.index}get isInMiddle(){return!this.isFirst&&!this.isLast}get isLast(){return this.index===this.length-1}eventDetail(){return this.event.detail}eventTarget(){return this.event.target}}class rt extends it{constructor(e,t,s){super(),this.fragment=e,this.factories=t,this.targets=s,this.behaviors=null,this.unbindables=[],this.source=null,this.isBound=!1,this.sourceLifetime=R.unknown,this.context=this,this.firstChild=e.firstChild,this.lastChild=e.lastChild}appendTo(e){e.appendChild(this.fragment)}insertBefore(e){if(this.fragment.hasChildNodes())e.parentNode.insertBefore(this.fragment,e);else{const t=this.lastChild;if(e.previousSibling===t)return;const s=e.parentNode;let n,i=this.firstChild;for(;i!==t;)n=i.nextSibling,s.insertBefore(i,e),i=n;s.insertBefore(t,e)}}remove(){const e=this.fragment,t=this.lastChild;let s,n=this.firstChild;for(;n!==t;)s=n.nextSibling,e.appendChild(n),n=s;e.appendChild(t)}dispose(){nt(this.firstChild,this.lastChild),this.unbind()}onUnbind(e){this.unbindables.push(e)}bind(e,t=this){if(this.source===e)return;let s=this.behaviors;if(null===s){this.source=e,this.context=t,this.behaviors=s=new Array(this.factories.length);const n=this.factories;for(let e=0,t=n.length;e<t;++e){const t=n[e].createBehavior();t.bind(this),s[e]=t}}else{null!==this.source&&this.evaluateUnbindables(),this.isBound=!1,this.source=e,this.context=t;for(let e=0,t=s.length;e<t;++e)s[e].bind(this)}this.isBound=!0}unbind(){this.isBound&&null!==this.source&&(this.evaluateUnbindables(),this.source=null,this.context=this,this.isBound=!1)}evaluateUnbindables(){const e=this.unbindables;for(let t=0,s=e.length;t<s;++t)e[t].unbind(this);e.length=0}static disposeContiguousBatch(e){if(0!==e.length){nt(e[0].firstChild,e[e.length-1].lastChild);for(let t=0,s=e.length;t<s;++t)e[t].unbind()}}}v(rt),_.defineProperty(rt.prototype,"index"),_.defineProperty(rt.prototype,"length");const ot="unhydrated",at="hydrating",lt="hydrated";class ct extends Error{constructor(e,t,s,n){super(e),this.factory=t,this.fragment=s,this.templateString=n}}st=Ie,v(class extends it{constructor(e,t,s,n){super(),this.firstChild=e,this.lastChild=t,this.sourceTemplate=s,this.hostBindingTarget=n,this[st]=Ie,this.context=this,this.source=null,this.isBound=!1,this.sourceLifetime=R.unknown,this.unbindables=[],this.fragment=null,this.behaviors=null,this._hydrationStage=ot,this._bindingViewBoundaries={},this._targets={},this.factories=s.compile().factories}get hydrationStage(){return this._hydrationStage}get targets(){return this._targets}get bindingViewBoundaries(){return this._bindingViewBoundaries}insertBefore(e){if(null!==this.fragment)if(this.fragment.hasChildNodes())e.parentNode.insertBefore(this.fragment,e);else{const t=this.lastChild;if(e.previousSibling===t)return;const s=e.parentNode;let n,i=this.firstChild;for(;i!==t;)n=i.nextSibling,s.insertBefore(i,e),i=n;s.insertBefore(t,e)}}appendTo(e){null!==this.fragment&&e.appendChild(this.fragment)}remove(){const e=this.fragment||(this.fragment=document.createDocumentFragment()),t=this.lastChild;let s,n=this.firstChild;for(;n!==t;){if(s=n.nextSibling,!s)throw new Error(`Unmatched first/last child inside "${t.getRootNode().host.nodeName}".`);e.appendChild(n),n=s}e.appendChild(t)}bind(e,t=this){var s,n;if(this.hydrationStage!==lt&&(this._hydrationStage=at),this.source===e)return;let i=this.behaviors;if(null===i){this.source=e,this.context=t;try{const{targets:e,boundaries:t}=function(e,t,s){const n=Ye(e,t),i=n.commonAncestorContainer,r=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_COMMENT+NodeFilter.SHOW_TEXT,{acceptNode:e=>0===n.comparePoint(e,0)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}),o={},a={};let l=r.currentNode=e;for(;null!==l;){switch(l.nodeType){case Node.ELEMENT_NODE:Ze(l,s,o);break;case Node.COMMENT_NODE:et(l,r,s,o,a)}l=r.nextNode()}return n.detach(),{targets:o,boundaries:a}}(this.firstChild,this.lastChild,this.factories);this._targets=e,this._bindingViewBoundaries=t}catch(e){if(e instanceof Je){let t=this.sourceTemplate.html;"string"!=typeof t&&(t=t.innerHTML),e.templateString=t}throw e}this.behaviors=i=new Array(this.factories.length);const r=this.factories;for(let e=0,t=r.length;e<t;++e){const t=r[e];if("h"===t.targetNodeId&&this.hostBindingTarget&&tt(t,this.hostBindingTarget,this._targets),!(t.targetNodeId in this.targets)){let e=this.sourceTemplate.html;throw"string"!=typeof e&&(e=e.innerHTML),new ct(`HydrationView was unable to successfully target bindings inside "${null===(n=(null===(s=this.firstChild)||void 0===s?void 0:s.getRootNode()).host)||void 0===n?void 0:n.nodeName}".`,t,Ye(this.firstChild,this.lastChild).cloneContents(),e)}{const s=t.createBehavior();s.bind(this),i[e]=s}}}else{null!==this.source&&this.evaluateUnbindables(),this.isBound=!1,this.source=e,this.context=t;for(let e=0,t=i.length;e<t;++e)i[e].bind(this)}this.isBound=!0,this._hydrationStage=lt}unbind(){this.isBound&&null!==this.source&&(this.evaluateUnbindables(),this.source=null,this.context=this,this.isBound=!1)}dispose(){nt(this.firstChild,this.lastChild),this.unbind()}onUnbind(e){this.unbindables.push(e)}evaluateUnbindables(){const e=this.unbindables;for(let t=0,s=e.length;t<s;++t)e[t].unbind(this);e.length=0}});const dt={[m.attribute]:T.setAttribute,[m.booleanAttribute]:T.setBooleanAttribute,[m.property]:(e,t,s)=>e[t]=s,[m.content]:function(e,t,s,n){if(null==s&&(s=""),function(e){return void 0!==e.create}(s)){e.textContent="";let t=e.$fastView;if(void 0===t)if(Re(n)&&Re(s)&&void 0!==n.bindingViewBoundaries[this.targetNodeId]&&n.hydrationStage!==lt){const e=n.bindingViewBoundaries[this.targetNodeId];t=s.hydrate(e.first,e.last)}else t=s.create();else e.$fastTemplate!==s&&(t.isComposed&&(t.remove(),t.unbind()),t=s.create());t.isComposed?t.needsBindOnly&&(t.needsBindOnly=!1,t.bind(n.source,n.context)):(t.isComposed=!0,t.bind(n.source,n.context),t.insertBefore(e),e.$fastView=t,e.$fastTemplate=s)}else{const t=e.$fastView;void 0!==t&&t.isComposed&&(t.isComposed=!1,t.remove(),t.needsBindOnly?t.needsBindOnly=!1:t.unbind()),e.textContent=s}},[m.tokenList]:function(e,t,s){var n;const i=`${this.id}-t`,r=null!==(n=e[i])&&void 0!==n?n:e[i]={v:0,cv:Object.create(null)},o=r.cv;let a=r.v;const l=e[t];if(null!=s&&s.length){const e=s.split(/\s+/);for(let t=0,s=e.length;t<s;++t){const s=e[t];""!==s&&(o[s]=a,l.add(s))}}if(r.v=a+1,0!==a){a-=1;for(const e in o)o[e]===a&&l.remove(e)}},[m.event]:()=>{}};class ht{constructor(e){this.dataBinding=e,this.updateTarget=null,this.aspectType=m.content}createHTML(e){return He.interpolation(e(this))}createBehavior(){var e;if(null===this.updateTarget){const t=dt[this.aspectType],s=null!==(e=this.dataBinding.policy)&&void 0!==e?e:this.policy;if(!t)throw f.error(1205);this.data=`${this.id}-d`,this.updateTarget=s.protect(this.targetTagName,this.aspectType,this.targetAspect,t)}return this}bind(e){var t;const s=e.targets[this.targetNodeId],n=Re(e)&&e.hydrationStage&&e.hydrationStage!==lt;switch(this.aspectType){case m.event:s[this.data]=e,s.addEventListener(this.targetAspect,this,this.dataBinding.options);break;case m.content:e.onUnbind(this);default:const i=null!==(t=s[this.data])&&void 0!==t?t:s[this.data]=this.dataBinding.createObserver(this,this);if(i.target=s,i.controller=e,n&&(this.aspectType===m.attribute||this.aspectType===m.booleanAttribute)){i.bind(e);break}this.updateTarget(s,this.targetAspect,i.bind(e),e)}}unbind(e){const t=e.targets[this.targetNodeId].$fastView;void 0!==t&&t.isComposed&&(t.unbind(),t.needsBindOnly=!0)}handleEvent(e){const t=e.currentTarget[this.data];if(t.isBound){P.setEvent(e);const s=this.dataBinding.evaluate(t.source,t.context);P.setEvent(null),!0!==s&&e.preventDefault()}}handleChange(e,t){const s=t.target,n=t.controller;this.updateTarget(s,this.targetAspect,t.bind(n),n)}}Qe.define(ht,{aspected:!0});const ut=(e,t)=>`${e}.${t}`,ft={},pt={index:0,node:null};function gt(e){e.startsWith("fast-")||f.warn(1204,{name:e})}const bt=new Proxy(document.createElement("div"),{get(e,t){gt(t);const s=Reflect.get(e,t);return c(s)?s.bind(e):s},set:(e,t,s)=>(gt(t),Reflect.set(e,t,s))});class vt{constructor(e,t,s){this.fragment=e,this.directives=t,this.policy=s,this.proto=null,this.nodeIds=new Set,this.descriptors={},this.factories=[]}addFactory(e,t,s,n,i){var r,o;this.nodeIds.has(s)||(this.nodeIds.add(s),this.addTargetDescriptor(t,s,n)),e.id=null!==(r=e.id)&&void 0!==r?r:De(),e.targetNodeId=s,e.targetTagName=i,e.policy=null!==(o=e.policy)&&void 0!==o?o:this.policy,this.factories.push(e)}freeze(){return this.proto=Object.create(null,this.descriptors),this}addTargetDescriptor(e,t,s){const n=this.descriptors;if("r"===t||"h"===t||n[t])return;if(!n[e]){const t=e.lastIndexOf("."),s=e.substring(0,t),n=parseInt(e.substring(t+1));this.addTargetDescriptor(s,e,n)}let i=ft[t];if(!i){const n=`_${t}`;ft[t]=i={get(){var t;return null!==(t=this[n])&&void 0!==t?t:this[n]=this[e].childNodes[s]}}}n[t]=i}createView(e){const t=this.fragment.cloneNode(!0),s=Object.create(this.proto);s.r=t,s.h=null!=e?e:bt;for(const e of this.nodeIds)s[e];return new rt(t,this.factories,s)}}function mt(e,t,s,n,i,r=!1){const o=s.attributes,a=e.directives;for(let l=0,c=o.length;l<c;++l){const d=o[l],h=d.value,u=Ue.parse(h,a);let f=null;null===u?r&&(f=new ht(le((()=>h),e.policy)),Qe.assignAspect(f,d.name)):f=Ct.aggregate(u,e.policy),null!==f&&(s.removeAttributeNode(d),l--,c--,e.addFactory(f,t,n,i,s.tagName))}}function yt(e,t,s){let n=0,i=t.firstChild;for(;i;){const t=wt(e,s,i,n);i=t.node,n=t.index}}function wt(e,t,s,n){const i=ut(t,n);switch(s.nodeType){case 1:mt(e,t,s,i,n),yt(e,s,i);break;case 3:return function(e,t,s,n,i){const r=Ue.parse(t.textContent,e.directives);if(null===r)return pt.node=t.nextSibling,pt.index=i+1,pt;let o,a=o=t;for(let t=0,l=r.length;t<l;++t){const l=r[t];0!==t&&(i++,n=ut(s,i),o=a.parentNode.insertBefore(document.createTextNode(""),a.nextSibling)),d(l)?o.textContent=l:(o.textContent=" ",Qe.assignAspect(l),e.addFactory(l,s,n,i,null)),a=o}return pt.index=i+1,pt.node=a.nextSibling,pt}(e,s,t,i,n);case 8:const r=Ue.parse(s.data,e.directives);null!==r&&e.addFactory(Ct.aggregate(r),t,i,n,null)}return pt.index=n+1,pt.node=s.nextSibling,pt}const St="TEMPLATE",Ct={compile(e,t,s=T.policy){let n;if(d(e)){n=document.createElement(St),n.innerHTML=s.createHTML(e);const t=n.content.firstElementChild;null!==t&&t.tagName===St&&(n=t)}else n=e;n.content.firstChild||n.content.lastChild||n.content.appendChild(document.createComment(""));const i=document.adoptNode(n.content),r=new vt(i,t,s);var o,a;return mt(r,"",n,"h",0,!0),o=i.firstChild,a=t,(o&&8==o.nodeType&&null!==Ue.parse(o.data,a)||1===i.childNodes.length&&Object.keys(t).length>0)&&i.insertBefore(document.createComment(""),i.firstChild),yt(r,i,"r"),pt.node=null,r.freeze()},setDefaultStrategy(e){this.compile=e},aggregate(e,t=T.policy){if(1===e.length)return e[0];let s,n,i=!1;const r=e.length,o=e.map((e=>d(e)?()=>e:(s=e.sourceAspect||s,i=i||e.dataBinding.isVolatile,n=n||e.dataBinding.policy,e.dataBinding.evaluate))),a=new ht(re(((e,t)=>{let s="";for(let n=0;n<r;++n)s+=o[n](e,t);return s}),null!=n?n:t,i));return Qe.assignAspect(a,s),a}},Tt=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/,$t=Object.create(null);class xt{constructor(e,t=$t){this.html=e,this.factories=t}createHTML(e){const t=this.factories;for(const s in t)e(t[s]);return this.html}}function Ot(e,t,s,n=Qe.getForInstance(e)){if(n.aspected){const s=Tt.exec(t);null!==s&&Qe.assignAspect(e,s[2])}return e.createHTML(s)}xt.empty=new xt(""),Qe.define(xt);class Bt{constructor(e,t={},s){this.policy=s,this.result=null,this.html=e,this.factories=t}compile(){return null===this.result&&(this.result=Ct.compile(this.html,this.factories,this.policy)),this.result}create(e){return this.compile().createView(e)}inline(){return new xt(d(this.html)?this.html:this.html.innerHTML,this.factories)}withPolicy(e){if(this.result)throw f.error(1208);if(this.policy)throw f.error(1207);return this.policy=e,this}render(e,t,s){const n=this.create(s);return n.bind(e),n.appendTo(t),n}static create(e,t,s){let n="";const i=Object.create(null),r=e=>{var t;const s=null!==(t=e.id)&&void 0!==t?t:e.id=De();return i[s]=e,s};for(let s=0,i=e.length-1;s<i;++s){const i=e[s];let o,a=t[s];if(n+=i,c(a))a=new ht(re(a));else if(a instanceof ne)a=new ht(a);else if(!(o=Qe.getForInstance(a))){const e=a;a=new ht(le((()=>e)))}n+=Ot(a,i,r,o)}return new Bt(n+e[e.length-1],i,s)}}v(Bt);const Nt=(e,...t)=>{if(Array.isArray(e)&&Array.isArray(e.raw))return Bt.create(e,t);throw f.error(1206)};Nt.partial=e=>new xt(e);class kt extends Xe{bind(e){e.source[this.options]=e.targets[this.targetNodeId]}}Qe.define(kt);const At=e=>new kt(e),Et=()=>null;function Mt(e){return void 0===e?Et:c(e)?e:()=>e}function jt(e,t,s){const n=c(e)?e:()=>e,i=Mt(t),r=Mt(s);return(e,t)=>n(e,t)?i(e,t):r(e,t)}const Vt=Object.freeze({positioning:!1,recycle:!0});function It(e,t,s,n){e.context.parent=n.source,e.context.parentContext=n.context,e.bind(t[s])}function Rt(e,t,s,n){e.context.parent=n.source,e.context.parentContext=n.context,e.context.length=t.length,e.context.index=s,e.bind(t[s])}function _t(e){return e.nodeType===Node.COMMENT_NODE}class zt extends Error{constructor(e,t){super(e),this.propertyBag=t}}class Lt{constructor(e){this.directive=e,this.items=null,this.itemsObserver=null,this.bindView=It,this.views=[],this.itemsBindingObserver=e.dataBinding.createObserver(this,e),this.templateBindingObserver=e.templateBinding.createObserver(this,e),e.options.positioning&&(this.bindView=Rt)}bind(e){this.location=e.targets[this.directive.targetNodeId],this.controller=e,this.items=this.itemsBindingObserver.bind(e),this.template=this.templateBindingObserver.bind(e),this.observeItems(!0),Re(this.template)&&Re(e)&&e.hydrationStage!==lt?this.hydrateViews(this.template):this.refreshAllViews(),e.onUnbind(this)}unbind(){null!==this.itemsObserver&&this.itemsObserver.unsubscribe(this),this.unbindAllViews()}handleChange(e,t){if(t===this.itemsBindingObserver)this.items=this.itemsBindingObserver.bind(this.controller),this.observeItems(),this.refreshAllViews();else if(t===this.templateBindingObserver)this.template=this.templateBindingObserver.bind(this.controller),this.refreshAllViews(!0);else{if(!t[0])return;t[0].reset?this.refreshAllViews():t[0].sorted?this.updateSortedViews(t):this.updateSplicedViews(t)}}observeItems(e=!1){if(!this.items)return void(this.items=p);const t=this.itemsObserver,s=this.itemsObserver=_.getNotifier(this.items),n=t!==s;n&&null!==t&&t.unsubscribe(this),(n||e)&&s.subscribe(this)}updateSortedViews(e){const t=this.views;for(let s=0,n=e.length;s<n;++s){const n=e[s].sorted.slice(),i=n.slice().sort();for(let e=0,s=n.length;e<s;++e){const s=n.find((t=>n[e]===i[t]));if(s!==e){const n=i.splice(s,1);i.splice(e,0,...n);const r=t[e],o=r?r.firstChild:this.location;t[s].remove(),t[s].insertBefore(o);const a=t.splice(s,1);t.splice(e,0,...a)}}}}updateSplicedViews(e){const t=this.views,s=this.bindView,n=this.items,i=this.template,r=this.controller,o=this.directive.options.recycle,a=[];let l=0,c=0;for(let d=0,h=e.length;d<h;++d){const h=e[d],u=h.removed;let f=0,p=h.index;const g=p+h.addedCount,b=t.splice(h.index,u.length),v=c=a.length+b.length;for(;p<g;++p){const e=t[p],d=e?e.firstChild:this.location;let h;o&&c>0?(f<=v&&b.length>0?(h=b[f],f++):(h=a[l],l++),c--):h=i.create(),t.splice(p,0,h),s(h,n,p,r),h.insertBefore(d)}b[f]&&a.push(...b.slice(f))}for(let e=l,t=a.length;e<t;++e)a[e].dispose();if(this.directive.options.positioning)for(let e=0,s=t.length;e<s;++e){const n=t[e].context;n.length=s,n.index=e}}refreshAllViews(e=!1){const t=this.items,s=this.template,n=this.location,i=this.bindView,r=this.controller;let o=t.length,a=this.views,l=a.length;if(0!==o&&!e&&this.directive.options.recycle||(rt.disposeContiguousBatch(a),l=0),0===l){this.views=a=new Array(o);for(let e=0;e<o;++e){const o=s.create();i(o,t,e,r),a[e]=o,o.insertBefore(n)}}else{let e=0;for(;e<o;++e)if(e<l){const n=a[e];if(!n){const t=new XMLSerializer;throw new zt(`View is null or undefined inside "${this.location.getRootNode().host.nodeName}".`,{index:e,hydrationStage:this.controller.hydrationStage,itemsLength:o,viewsState:a.map((e=>e?"hydrated":"empty")),viewTemplateString:t.serializeToString(s.create().fragment),rootNodeContent:t.serializeToString(this.location.getRootNode())})}i(n,t,e,r)}else{const o=s.create();i(o,t,e,r),a.push(o),o.insertBefore(n)}const c=a.splice(e,l-e);for(e=0,o=c.length;e<o;++e)c[e].dispose()}}unbindAllViews(){const e=this.views;for(let t=0,s=e.length;t<s;++t){const s=e[t];if(!s){const s=new XMLSerializer;throw new zt(`View is null or undefined inside "${this.location.getRootNode().host.nodeName}".`,{index:t,hydrationStage:this.controller.hydrationStage,viewsState:e.map((e=>e?"hydrated":"empty")),rootNodeContent:s.serializeToString(this.location.getRootNode())})}s.unbind()}}hydrateViews(e){if(!this.items)return;this.views=new Array(this.items.length);let t=this.location.previousSibling;for(;null!==t;){if(!_t(t)){t=t.previousSibling;continue}const s=Ee.parseRepeatEndMarker(t.data);if(null===s){t=t.previousSibling;continue}t.data="";const n=t.previousSibling;if(!n)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": end should never be null.`);let i=n,r=0;for(;null!==i;){if(_t(i))if(Ee.isRepeatViewEndMarker(i.data))r++;else if(Ee.isRepeatViewStartMarker(i.data)){if(!r){if(Ee.parseRepeatStartMarker(i.data)!==s)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": Mismatched start and end markers.`);i.data="",t=i.previousSibling,i=i.nextSibling;const r=e.hydrate(i,n);this.views[s]=r,this.bindView(r,this.items,s,this.controller);break}r--}i=i.previousSibling}if(!i)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": start should never be null.`)}}}class Ft{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.options=s,ee.enable()}createHTML(e){return He.comment(e(this))}createBehavior(){return new Lt(this)}}function Pt(e,t,s=Vt){const n=ce(e),i=ce(t);return new Ft(n,i,Object.assign(Object.assign({},Vt),s))}Qe.define(Ft);const Dt=e=>1===e.nodeType,Ht=e=>e?t=>1===t.nodeType&&t.matches(e):Dt;class Ut extends Xe{get id(){return this._id}set id(e){this._id=e,this._controllerProperty=`${e}-c`}bind(e){const t=e.targets[this.targetNodeId];t[this._controllerProperty]=e,this.updateTarget(e.source,this.computeNodes(t)),this.observe(t),e.onUnbind(this)}unbind(e){const t=e.targets[this.targetNodeId];this.updateTarget(e.source,p),this.disconnect(t),t[this._controllerProperty]=null}getSource(e){return e[this._controllerProperty].source}updateTarget(e,t){e[this.options.property]=t}computeNodes(e){let t=this.getNodes(e);return"filter"in this.options&&(t=t.filter(this.options.filter)),t}}const qt="slotchange";class Qt extends Ut{observe(e){e.addEventListener(qt,this)}disconnect(e){e.removeEventListener(qt,this)}getNodes(e){return e.assignedNodes(this.options)}handleEvent(e){const t=e.currentTarget;this.updateTarget(this.getSource(t),this.computeNodes(t))}}function Wt(e){return d(e)&&(e={property:e}),new Qt(e)}Qe.define(Qt);class Xt extends Ut{constructor(e){super(e),this.observerProperty=Symbol(),this.handleEvent=(e,t)=>{const s=t.target;this.updateTarget(this.getSource(s),this.computeNodes(s))},e.childList=!0}observe(e){let t=e[this.observerProperty];t||(t=new MutationObserver(this.handleEvent),t.toJSON=h,e[this.observerProperty]=t),t.target=e,t.observe(e,this.options)}disconnect(e){const t=e[this.observerProperty];t.target=null,t.disconnect()}getNodes(e){return"selector"in this.options?Array.from(e.querySelectorAll(this.options.selector)):Array.from(e.childNodes)}}function Jt(e){return d(e)&&(e={property:e}),new Xt(e)}Qe.define(Xt);const Kt="boolean",Gt="reflect",Yt=Object.freeze({locate:b()}),Zt={toView:e=>e?"true":"false",fromView:e=>!(null==e||"false"===e||!1===e||0===e)},es={toView:e=>"boolean"==typeof e?e.toString():"",fromView:e=>[null,void 0,void 0].includes(e)?null:Zt.fromView(e)};function ts(e){if(null==e)return null;const t=1*e;return isNaN(t)?null:t}const ss={toView(e){const t=ts(e);return t?t.toString():t},fromView:ts};class ns{constructor(e,t,s=t.toLowerCase(),n=Gt,i){this.guards=new Set,this.Owner=e,this.name=t,this.attribute=s,this.mode=n,this.converter=i,this.fieldName=`_${t}`,this.callbackName=`${t}Changed`,this.hasCallback=this.callbackName in e.prototype,n===Kt&&void 0===i&&(this.converter=Zt)}setValue(e,t){const s=e[this.fieldName],n=this.converter;void 0!==n&&(t=n.fromView(t)),s!==t&&(e[this.fieldName]=t,this.tryReflectToAttribute(e),this.hasCallback&&e[this.callbackName](s,t),e.$fastController.notify(this.name))}getValue(e){return _.track(e,this.name),e[this.fieldName]}onAttributeChangedCallback(e,t){this.guards.has(e)||(this.guards.add(e),this.setValue(e,t),this.guards.delete(e))}tryReflectToAttribute(e){const t=this.mode,s=this.guards;s.has(e)||"fromView"===t||j.enqueue((()=>{s.add(e);const n=e[this.fieldName];switch(t){case Gt:const t=this.converter;T.setAttribute(e,this.attribute,void 0!==t?t.toView(n):n);break;case Kt:T.setBooleanAttribute(e,this.attribute,n)}s.delete(e)}))}static collect(e,...t){const s=[];t.push(Yt.locate(e));for(let n=0,i=t.length;n<i;++n){const i=t[n];if(void 0!==i)for(let t=0,n=i.length;t<n;++t){const n=i[t];d(n)?s.push(new ns(e,n)):s.push(new ns(e,n.property,n.attribute,n.mode,n.converter))}}return s}}function is(e,t){let s;function n(e,t){arguments.length>1&&(s.property=t),Yt.locate(e.constructor).push(s)}return arguments.length>1?(s={},void n(e,t)):(s=void 0===e?{}:e,n)}const rs={mode:"open"},os={},as=new Set,ls=f.getById(l.elementRegistry,(()=>g()));class cs{constructor(e,t=e.definition){var s;this.platformDefined=!1,d(t)&&(t={name:t}),this.type=e,this.name=t.name,this.template=t.template,this.registry=null!==(s=t.registry)&&void 0!==s?s:customElements;const n=e.prototype,i=ns.collect(e,t.attributes),r=new Array(i.length),o={},a={};for(let e=0,t=i.length;e<t;++e){const t=i[e];r[e]=t.attribute,o[t.name]=t,a[t.attribute]=t,_.defineProperty(n,t)}Reflect.defineProperty(e,"observedAttributes",{value:r,enumerable:!0}),this.attributes=i,this.propertyLookup=o,this.attributeLookup=a,this.shadowOptions=void 0===t.shadowOptions?rs:null===t.shadowOptions?void 0:Object.assign(Object.assign({},rs),t.shadowOptions),this.elementOptions=void 0===t.elementOptions?os:Object.assign(Object.assign({},os),t.elementOptions),this.styles=ue.normalize(t.styles),ls.register(this)}get isDefined(){return this.platformDefined}define(e=this.registry){const t=this.type;return e.get(this.name)||(this.platformDefined=!0,e.define(this.name,t,this.elementOptions)),this}static compose(e,t){return as.has(e)||ls.getByType(e)?new cs(class extends e{},t):new cs(e,t)}static registerBaseType(e){as.add(e)}}cs.getByType=ls.getByType,cs.getForInstance=ls.getForInstance,_.defineProperty(cs.prototype,"template");class ds{constructor(e){this.directive=e,this.location=null,this.controller=null,this.view=null,this.data=null,this.dataBindingObserver=e.dataBinding.createObserver(this,e),this.templateBindingObserver=e.templateBinding.createObserver(this,e)}bind(e){if(this.location=e.targets[this.directive.targetNodeId],this.controller=e,this.data=this.dataBindingObserver.bind(e),this.template=this.templateBindingObserver.bind(e),e.onUnbind(this),Re(this.template)&&Re(e)&&e.hydrationStage!==lt&&!this.view){const t=e.bindingViewBoundaries[this.directive.targetNodeId];t&&(this.view=this.template.hydrate(t.first,t.last),this.bindView(this.view))}else this.refreshView()}unbind(e){const t=this.view;null!==t&&t.isComposed&&(t.unbind(),t.needsBindOnly=!0)}handleChange(e,t){t===this.dataBindingObserver&&(this.data=this.dataBindingObserver.bind(this.controller)),(this.directive.templateBindingDependsOnData||t===this.templateBindingObserver)&&(this.template=this.templateBindingObserver.bind(this.controller)),this.refreshView()}bindView(e){e.isComposed?e.needsBindOnly&&(e.needsBindOnly=!1,e.bind(this.data)):(e.isComposed=!0,e.bind(this.data),e.insertBefore(this.location),e.$fastTemplate=this.template)}refreshView(){let e=this.view;const t=this.template;null===e?(this.view=e=t.create(),this.view.context.parent=this.controller.source,this.view.context.parentContext=this.controller.context):e.$fastTemplate!==t&&(e.isComposed&&(e.remove(),e.unbind()),this.view=e=t.create(),this.view.context.parent=this.controller.source,this.view.context.parentContext=this.controller.context),this.bindView(e)}}class hs{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.templateBindingDependsOnData=s}createHTML(e){return He.comment(e(this))}createBehavior(){return new ds(this)}}Qe.define(hs);const us=new Map,fs={":model":e=>e},ps=Symbol("RenderInstruction"),gs="default-view",bs=Nt`
1
+ void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",{value:Object.create(null),configurable:!1,enumerable:!1,writable:!1});const e=globalThis.FAST,t={1101:"Must call ArrayObserver.enable() before observing arrays.",1201:"The DOM Policy can only be set once.",1202:"To bind innerHTML, you must use a TrustedTypesPolicy.",1203:"View=>Model update skipped. To use twoWay binding, the target property must be observable.",1204:"No host element is present. Cannot bind host with ${name}.",1205:"The requested binding behavior is not supported by the binding engine.",1206:"Calling html`` as a normal function invalidates the security guarantees provided by FAST.",1207:"The DOM Policy for an HTML template can only be set once.",1208:"The DOM Policy cannot be set after a template is compiled.",1209:"'${aspectName}' on '${tagName}' is blocked by the current DOMPolicy.",1401:"Missing FASTElement definition.",1501:"No registration for Context/Interface '${name}'.",1502:"Dependency injection resolver for '${key}' returned a null factory.",1503:"Invalid dependency injection resolver strategy specified '${strategy}'.",1504:"Unable to autoregister dependency.",1505:"Unable to resolve dependency injection key '${key}'.",1506:"'${name}' is a native function and therefore cannot be safely constructed by DI. If this is intentional, please use a callback or cachedCallback resolver.",1507:"Attempted to jitRegister something that is not a constructor '${value}'. Did you forget to register this dependency?",1508:"Attempted to jitRegister an intrinsic type '${value}'. Did you forget to add @inject(Key)?",1509:"Attempted to jitRegister an interface '${value}'.",1510:"A valid resolver was not returned from the register method.",1511:"Key/value cannot be null or undefined. Are you trying to inject/register something that doesn't exist with DI?",1512:"'${key}' not registered. Did you forget to add @singleton()?",1513:"Cyclic dependency found '${name}'.",1514:"Injected properties that are updated on changes to DOM connectivity require the target object to be an instance of FASTElement."},s=/(\$\{\w+?})/g,i=/\$\{(\w+?)}/g,n=Object.freeze({});function r(e,t){return e.split(s).map((e=>{var s;const n=e.replace(i,"$1");return String(null!==(s=t[n])&&void 0!==s?s:e)})).join("")}let o;Object.assign(e,{addMessages(e){Object.assign(t,e)},warn(e,s=n){var i;const o=null!==(i=t[e])&&void 0!==i?i:"Unknown Warning";console.warn(r(o,s))},error(e,s=n){var i;const o=null!==(i=t[e])&&void 0!==i?i:"Unknown Error";return new Error(r(o,s))}});const a="fast-kernel";try{if(document.currentScript)o=document.currentScript.getAttribute(a);else{const e=document.getElementsByTagName("script");o=e[e.length-1].getAttribute(a)}}catch(e){o="isolate"}let l;switch(o){case"share":l=Object.freeze({updateQueue:1,observable:2,contextEvent:3,elementRegistry:4});break;case"share-v2":l=Object.freeze({updateQueue:1.2,observable:2.2,contextEvent:3.2,elementRegistry:4.2});break;default:const e=`-${Math.random().toString(36).substring(2,8)}`;l=Object.freeze({updateQueue:`1.2${e}`,observable:`2.2${e}`,contextEvent:`3.2${e}`,elementRegistry:`4.2${e}`})}const c=e=>"function"==typeof e,d=e=>"string"==typeof e,h=()=>{};!function(){if("undefined"==typeof globalThis)if("undefined"!=typeof global)global.globalThis=global;else if("undefined"!=typeof self)self.globalThis=self;else if("undefined"!=typeof window)window.globalThis=window;else{const e=new Function("return this")();e.globalThis=e}}();const u={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},u));const f=globalThis.FAST;if(void 0===f.getById){const e=Object.create(null);Reflect.defineProperty(f,"getById",Object.assign({value(t,s){let i=e[t];return void 0===i&&(i=s?e[t]=s():null),i}},u))}void 0===f.error&&Object.assign(f,{warn(){},error:e=>new Error(`Error ${e}`),addMessages(){}});const p=Object.freeze([]);function g(){const e=new Map;return Object.freeze({register:t=>!e.has(t.type)&&(e.set(t.type,t),!0),getByType:t=>e.get(t),getForInstance(t){if(null!=t)return e.get(t.constructor)}})}function b(){const e=new WeakMap;return function(t){let s=e.get(t);if(void 0===s){let i=Reflect.getPrototypeOf(t);for(;void 0===s&&null!==i;)s=e.get(i),i=Reflect.getPrototypeOf(i);s=void 0===s?[]:s.slice(0),e.set(t,s)}return s}}function v(e){e.prototype.toJSON=h}const m=Object.freeze({none:0,attribute:1,booleanAttribute:2,property:3,content:4,tokenList:5,event:6}),y=e=>e,w=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:y}):{createHTML:y};let S=Object.freeze({createHTML:e=>w.createHTML(e),protect:(e,t,s,i)=>i});const C=S,$=Object.freeze({get policy(){return S},setPolicy(e){if(S!==C)throw f.error(1201);S=e},setAttribute(e,t,s){null==s?e.removeAttribute(t):e.setAttribute(t,s)},setBooleanAttribute(e,t,s){s?e.setAttribute(t,""):e.removeAttribute(t)}});function T(e,t,s,i){return(e,t,s,...n)=>{d(s)&&(s=s.replace(/(javascript:|vbscript:|data:)/,"")),i(e,t,s,...n)}}function x(e,t,s,i){throw f.error(1209,{aspectName:s,tagName:null!=e?e:"text"})}const O={onabort:x,onauxclick:x,onbeforeinput:x,onbeforematch:x,onblur:x,oncancel:x,oncanplay:x,oncanplaythrough:x,onchange:x,onclick:x,onclose:x,oncontextlost:x,oncontextmenu:x,oncontextrestored:x,oncopy:x,oncuechange:x,oncut:x,ondblclick:x,ondrag:x,ondragend:x,ondragenter:x,ondragleave:x,ondragover:x,ondragstart:x,ondrop:x,ondurationchange:x,onemptied:x,onended:x,onerror:x,onfocus:x,onformdata:x,oninput:x,oninvalid:x,onkeydown:x,onkeypress:x,onkeyup:x,onload:x,onloadeddata:x,onloadedmetadata:x,onloadstart:x,onmousedown:x,onmouseenter:x,onmouseleave:x,onmousemove:x,onmouseout:x,onmouseover:x,onmouseup:x,onpaste:x,onpause:x,onplay:x,onplaying:x,onprogress:x,onratechange:x,onreset:x,onresize:x,onscroll:x,onsecuritypolicyviolation:x,onseeked:x,onseeking:x,onselect:x,onslotchange:x,onstalled:x,onsubmit:x,onsuspend:x,ontimeupdate:x,ontoggle:x,onvolumechange:x,onwaiting:x,onwebkitanimationend:x,onwebkitanimationiteration:x,onwebkitanimationstart:x,onwebkittransitionend:x,onwheel:x},B={elements:{a:{[m.attribute]:{href:T},[m.property]:{href:T}},area:{[m.attribute]:{href:T},[m.property]:{href:T}},button:{[m.attribute]:{formaction:T},[m.property]:{formAction:T}},embed:{[m.attribute]:{src:x},[m.property]:{src:x}},form:{[m.attribute]:{action:T},[m.property]:{action:T}},frame:{[m.attribute]:{src:T},[m.property]:{src:T}},iframe:{[m.attribute]:{src:T},[m.property]:{src:T,srcdoc:x}},input:{[m.attribute]:{formaction:T},[m.property]:{formAction:T}},link:{[m.attribute]:{href:x},[m.property]:{href:x}},object:{[m.attribute]:{codebase:x,data:x},[m.property]:{codeBase:x,data:x}},script:{[m.attribute]:{src:x,text:x},[m.property]:{src:x,text:x,innerText:x,textContent:x}},style:{[m.property]:{innerText:x,textContent:x}}},aspects:{[m.attribute]:Object.assign({},O),[m.property]:Object.assign({innerHTML:x},O),[m.event]:Object.assign({},O)}};function N(e,t){const s={};for(const i in t){const n=e[i],r=t[i];switch(n){case null:break;case void 0:s[i]=r;break;default:s[i]=n}}for(const t in e)t in s||(s[t]=e[t]);return Object.freeze(s)}function k(e,t){const s={};for(const i in t){const n=e[i],r=t[i];switch(n){case null:break;case void 0:s[i]=N(r,{});break;default:s[i]=N(n,r)}}for(const t in e)t in s||(s[t]=N(e[t],{}));return Object.freeze(s)}function A(e,t){const s={};for(const i in t){const n=e[i],r=t[i];switch(n){case null:break;case void 0:s[i]=k(n,{});break;default:s[i]=k(n,r)}}for(const t in e)t in s||(s[t]=k(e[t],{}));return Object.freeze(s)}function E(e,t,s,i,n){const r=e[s];if(r){const e=r[i];if(e)return e(t,s,i,n)}}const M=Object.freeze({create(e={}){var t,s;const i=null!==(t=e.trustedType)&&void 0!==t?t:function(){const e=e=>e;return globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:e}):{createHTML:e}}(),n=(r=null!==(s=e.guards)&&void 0!==s?s:{},o=B,Object.freeze({elements:r.elements?A(r.elements,o.elements):o.elements,aspects:r.aspects?k(r.aspects,o.aspects):o.aspects}));var r,o;return Object.freeze({createHTML:e=>i.createHTML(e),protect(e,t,s,i){var r;const o=(null!=e?e:"").toLowerCase(),a=n.elements[o];if(a){const n=E(a,e,t,s,i);if(n)return n}return null!==(r=E(n.aspects,e,t,s,i))&&void 0!==r?r:i}})}}),j=f.getById(l.updateQueue,(()=>{const e=[],t=[],s=globalThis.requestAnimationFrame;let i=!0;function n(){if(t.length)throw t.shift()}function r(s){try{s.call()}catch(s){if(!i)throw e.length=0,s;t.push(s),setTimeout(n,0)}}function o(){let t=0;for(;t<e.length;)if(r(e[t]),t++,t>1024){for(let s=0,i=e.length-t;s<i;s++)e[s]=e[s+t];e.length-=t,t=0}e.length=0}function a(t){e.push(t),e.length<2&&(i?s(o):o())}return Object.freeze({enqueue:a,next:()=>new Promise(a),process:o,setMode:e=>i=e})}));class V{constructor(e,t){this.sub1=void 0,this.sub2=void 0,this.spillover=void 0,this.subject=e,this.sub1=t}has(e){return void 0===this.spillover?this.sub1===e||this.sub2===e:-1!==this.spillover.indexOf(e)}subscribe(e){const t=this.spillover;if(void 0===t){if(this.has(e))return;if(void 0===this.sub1)return void(this.sub1=e);if(void 0===this.sub2)return void(this.sub2=e);this.spillover=[this.sub1,this.sub2,e],this.sub1=void 0,this.sub2=void 0}else{-1===t.indexOf(e)&&t.push(e)}}unsubscribe(e){const t=this.spillover;if(void 0===t)this.sub1===e?this.sub1=void 0:this.sub2===e&&(this.sub2=void 0);else{const s=t.indexOf(e);-1!==s&&t.splice(s,1)}}notify(e){const t=this.spillover,s=this.subject;if(void 0===t){const t=this.sub1,i=this.sub2;void 0!==t&&t.handleChange(s,e),void 0!==i&&i.handleChange(s,e)}else for(let i=0,n=t.length;i<n;++i)t[i].handleChange(s,e)}}class I{constructor(e){this.subscribers={},this.subjectSubscribers=null,this.subject=e}notify(e){var t,s;null===(t=this.subscribers[e])||void 0===t||t.notify(e),null===(s=this.subjectSubscribers)||void 0===s||s.notify(e)}subscribe(e,t){var s,i;let n;n=t?null!==(s=this.subscribers[t])&&void 0!==s?s:this.subscribers[t]=new V(this.subject):null!==(i=this.subjectSubscribers)&&void 0!==i?i:this.subjectSubscribers=new V(this.subject),n.subscribe(e)}unsubscribe(e,t){var s,i;t?null===(s=this.subscribers[t])||void 0===s||s.unsubscribe(e):null===(i=this.subjectSubscribers)||void 0===i||i.unsubscribe(e)}}const R=Object.freeze({unknown:void 0,coupled:1}),_=f.getById(l.observable,(()=>{const e=j.enqueue,t=/(:|&&|\|\||if|\?\.)/,s=new WeakMap;let i,n=e=>{throw f.error(1101)};function r(e){var t;let i=null!==(t=e.$fastController)&&void 0!==t?t:s.get(e);return void 0===i&&(Array.isArray(e)?i=n(e):s.set(e,i=new I(e))),i}const o=b();class a{constructor(e){this.name=e,this.field=`_${e}`,this.callback=`${e}Changed`}getValue(e){return void 0!==i&&i.watch(e,this.name),e[this.field]}setValue(e,t){const s=this.field,i=e[s];if(i!==t){e[s]=t;const n=e[this.callback];c(n)&&n.call(e,i,t),r(e).notify(this.name)}}}class l extends V{constructor(e,t,s=!1){super(e,t),this.expression=e,this.isVolatileBinding=s,this.needsRefresh=!0,this.needsQueue=!0,this.isAsync=!0,this.first=this,this.last=null,this.propertySource=void 0,this.propertyName=void 0,this.notifier=void 0,this.next=void 0}setMode(e){this.isAsync=this.needsQueue=e}bind(e){this.controller=e;const t=this.observe(e.source,e.context);return!e.isBound&&this.requiresUnbind(e)&&e.onUnbind(this),t}requiresUnbind(e){return e.sourceLifetime!==R.coupled||this.first!==this.last||this.first.propertySource!==e.source}unbind(e){this.dispose()}observe(e,t){this.needsRefresh&&null!==this.last&&this.dispose();const s=i;let n;i=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;try{n=this.expression(e,t)}finally{i=s}return n}disconnect(){this.dispose()}dispose(){if(null!==this.last){let e=this.first;for(;void 0!==e;)e.notifier.unsubscribe(this,e.propertyName),e=e.next;this.last=null,this.needsRefresh=this.needsQueue=this.isAsync}}watch(e,t){const s=this.last,n=r(e),o=null===s?this.first:{};if(o.propertySource=e,o.propertyName=t,o.notifier=n,n.subscribe(this,t),null!==s){if(!this.needsRefresh){let t;i=void 0,t=s.propertySource[s.propertyName],i=this,e===t&&(this.needsRefresh=!0)}s.next=o}this.last=o}handleChange(){this.needsQueue?(this.needsQueue=!1,e(this)):this.isAsync||this.call()}call(){null!==this.last&&(this.needsQueue=this.isAsync,this.notify(this))}*records(){let e=this.first;for(;void 0!==e;)yield e,e=e.next}}return v(l),Object.freeze({setArrayObserverFactory(e){n=e},getNotifier:r,track(e,t){i&&i.watch(e,t)},trackVolatile(){i&&(i.needsRefresh=!0)},notify(e,t){r(e).notify(t)},defineProperty(e,t){d(t)&&(t=new a(t)),o(e).push(t),Reflect.defineProperty(e,t.name,{enumerable:!0,get(){return t.getValue(this)},set(e){t.setValue(this,e)}})},getAccessors:o,binding(e,t,s=this.isVolatileBinding(e)){return new l(e,t,s)},isVolatileBinding:e=>t.test(e.toString())})}));function z(e,t){_.defineProperty(e,t)}function L(e,t,s){return Object.assign({},s,{get(){return _.trackVolatile(),s.get.apply(this)}})}const F=f.getById(l.contextEvent,(()=>{let e=null;return{get:()=>e,set(t){e=t}}})),P=Object.freeze({default:{index:0,length:0,get event(){return P.getEvent()},eventDetail(){return this.event.detail},eventTarget(){return this.event.target}},getEvent:()=>F.get(),setEvent(e){F.set(e)}});class D{constructor(e,t,s){this.index=e,this.removed=t,this.addedCount=s}adjustTo(e){let t=this.index;const s=e.length;return t>s?t=s-this.addedCount:t<0&&(t=s+this.removed.length+t-this.addedCount),this.index=t<0?0:t,this}}class H{constructor(e){this.sorted=e}}const U=Object.freeze({reset:1,splice:2,optimized:3}),q=new D(0,p,0);q.reset=!0;const Q=[q];function W(e,t,s,i,n,r){let o=0,a=0;const l=Math.min(s-t,r-n);if(0===t&&0===n&&(o=function(e,t,s){for(let i=0;i<s;++i)if(e[i]!==t[i])return i;return s}(e,i,l)),s===e.length&&r===i.length&&(a=function(e,t,s){let i=e.length,n=t.length,r=0;for(;r<s&&e[--i]===t[--n];)r++;return r}(e,i,l-o)),n+=o,r-=a,(s-=a)-(t+=o)==0&&r-n==0)return p;if(t===s){const e=new D(t,[],0);for(;n<r;)e.removed.push(i[n++]);return[e]}if(n===r)return[new D(t,[],s-t)];const c=function(e){let t=e.length-1,s=e[0].length-1,i=e[t][s];const n=[];for(;t>0||s>0;){if(0===t){n.push(2),s--;continue}if(0===s){n.push(3),t--;continue}const r=e[t-1][s-1],o=e[t-1][s],a=e[t][s-1];let l;l=o<a?o<r?o:r:a<r?a:r,l===r?(r===i?n.push(0):(n.push(1),i=r),t--,s--):l===o?(n.push(3),t--,i=o):(n.push(2),s--,i=a)}return n.reverse()}(function(e,t,s,i,n,r){const o=r-n+1,a=s-t+1,l=new Array(o);let c,d;for(let e=0;e<o;++e)l[e]=new Array(a),l[e][0]=e;for(let e=0;e<a;++e)l[0][e]=e;for(let s=1;s<o;++s)for(let r=1;r<a;++r)e[t+r-1]===i[n+s-1]?l[s][r]=l[s-1][r-1]:(c=l[s-1][r]+1,d=l[s][r-1]+1,l[s][r]=c<d?c:d);return l}(e,t,s,i,n,r)),d=[];let h,u=t,f=n;for(let e=0;e<c.length;++e)switch(c[e]){case 0:void 0!==h&&(d.push(h),h=void 0),u++,f++;break;case 1:void 0===h&&(h=new D(u,[],0)),h.addedCount++,u++,h.removed.push(i[f]),f++;break;case 2:void 0===h&&(h=new D(u,[],0)),h.addedCount++,u++;break;case 3:void 0===h&&(h=new D(u,[],0)),h.removed.push(i[f]),f++}return void 0!==h&&d.push(h),d}function X(e,t){let s=!1,i=0;for(let l=0;l<t.length;l++){const c=t[l];if(c.index+=i,s)continue;const d=(n=e.index,r=e.index+e.removed.length,o=c.index,a=c.index+c.addedCount,r<o||a<n?-1:r===o||a===n?0:n<o?r<a?r-o:a-o:a<r?a-n:r-n);if(d>=0){t.splice(l,1),l--,i-=c.addedCount-c.removed.length,e.addedCount+=c.addedCount-d;const n=e.removed.length+c.removed.length-d;if(e.addedCount||n){let t=c.removed;if(e.index<c.index){const s=e.removed.slice(0,c.index-e.index);s.push(...t),t=s}if(e.index+e.removed.length>c.index+c.addedCount){const s=e.removed.slice(c.index+c.addedCount-e.index);t.push(...s)}e.removed=t,c.index<e.index&&(e.index=c.index)}else s=!0}else if(e.index<c.index){s=!0,t.splice(l,0,e),l++;const n=e.addedCount-e.removed.length;c.index+=n,i+=n}}var n,r,o,a;s||t.push(e)}let J=Object.freeze({support:U.optimized,normalize:(e,t,s)=>void 0===e?void 0===s?p:function(e,t){let s=[];const i=[];for(let e=0,s=t.length;e<s;e++)X(t[e],i);for(let t=0,n=i.length;t<n;++t){const n=i[t];1!==n.addedCount||1!==n.removed.length?s=s.concat(W(e,n.index,n.index+n.addedCount,n.removed,0,n.removed.length)):n.removed[0]!==e[n.index]&&s.push(n)}return s}(t,s):Q,pop(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new D(e.length,[r],0)),r},push(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new D(e.length-i.length,[],i.length).adjustTo(e)),n},reverse(e,t,s,i){const n=s.apply(e,i);e.sorted++;const r=[];for(let t=e.length-1;t>=0;t--)r.push(t);return t.addSort(new H(r)),n},shift(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new D(0,[r],0)),r},sort(e,t,s,i){const n=new Map;for(let t=0,s=e.length;t<s;++t){const s=n.get(e[t])||[];n.set(e[t],[...s,t])}const r=s.apply(e,i);e.sorted++;const o=[];for(let t=0,s=e.length;t<s;++t){const s=n.get(e[t]);o.push(s[0]),n.set(e[t],s.splice(1))}return t.addSort(new H(o)),r},splice(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new D(+i[0],n,i.length>2?i.length-2:0).adjustTo(e)),n},unshift(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new D(0,[],i.length).adjustTo(e)),n}});const K=Object.freeze({reset:Q,setDefaultStrategy(e){J=e}});function G(e,t,s,i=!0){Reflect.defineProperty(e,t,{value:s,enumerable:!1,writable:i})}class Y extends V{constructor(e){super(e),this.oldCollection=void 0,this.splices=void 0,this.sorts=void 0,this.needsQueue=!0,this._strategy=null,this._lengthObserver=void 0,this._sortObserver=void 0,this.call=this.flush,G(e,"$fastController",this)}get strategy(){return this._strategy}set strategy(e){this._strategy=e}get lengthObserver(){let e=this._lengthObserver;if(void 0===e){const t=this.subject;this._lengthObserver=e={length:t.length,handleChange(){this.length!==t.length&&(this.length=t.length,_.notify(e,"length"))}},this.subscribe(e)}return e}get sortObserver(){let e=this._sortObserver;if(void 0===e){const t=this.subject;this._sortObserver=e={sorted:t.sorted,handleChange(){this.sorted!==t.sorted&&(this.sorted=t.sorted,_.notify(e,"sorted"))}},this.subscribe(e)}return e}subscribe(e){this.flush(),super.subscribe(e)}addSplice(e){void 0===this.splices?this.splices=[e]:this.splices.push(e),this.enqueue()}addSort(e){void 0===this.sorts?this.sorts=[e]:this.sorts.push(e),this.enqueue()}reset(e){this.oldCollection=e,this.enqueue()}flush(){var e;const t=this.splices,s=this.sorts,i=this.oldCollection;void 0===t&&void 0===i&&void 0===s||(this.needsQueue=!0,this.splices=void 0,this.sorts=void 0,this.oldCollection=void 0,void 0!==s?this.notify(s):this.notify((null!==(e=this._strategy)&&void 0!==e?e:J).normalize(i,this.subject,t)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,j.enqueue(this))}}let Z=!1;const ee=Object.freeze({sorted:0,enable(){if(Z)return;Z=!0,_.setArrayObserverFactory((e=>new Y(e)));const e=Array.prototype;e.$fastPatch||(G(e,"$fastPatch",1),G(e,"sorted",0),[e.pop,e.push,e.reverse,e.shift,e.sort,e.splice,e.unshift].forEach((t=>{e[t.name]=function(...e){var s;const i=this.$fastController;return void 0===i?t.apply(this,e):(null!==(s=i.strategy)&&void 0!==s?s:J)[t.name](this,i,t,e)}})))}});function te(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(ee.enable(),t=_.getNotifier(e)),_.track(t.lengthObserver,"length"),e.length}function se(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(ee.enable(),t=_.getNotifier(e)),_.track(t.sortObserver,"sorted"),e.sorted}class ie{constructor(e,t,s=!1){this.evaluate=e,this.policy=t,this.isVolatile=s}}class ne extends ie{createObserver(e){return _.binding(this.evaluate,e,this.isVolatile)}}function re(e,t,s=_.isVolatileBinding(e)){return new ne(e,t,s)}function oe(e,t){const s=new ne(e);return s.options=t,s}class ae extends ie{createObserver(){return this}bind(e){return this.evaluate(e.source,e.context)}}function le(e,t){return new ae(e,t)}function ce(e){return c(e)?re(e):e instanceof ie?e:le((()=>e))}let de;function he(e){return e.map((e=>e instanceof ue?he(e.styles):[e])).reduce(((e,t)=>e.concat(t)),[])}v(ae);class ue{constructor(e){this.styles=e,this.targets=new WeakSet,this._strategy=null,this.behaviors=e.map((e=>e instanceof ue?e.behaviors:null)).reduce(((e,t)=>null===t?e:null===e?t:e.concat(t)),null)}get strategy(){return null===this._strategy&&this.withStrategy(de),this._strategy}addStylesTo(e){this.strategy.addStylesTo(e),this.targets.add(e)}removeStylesFrom(e){this.strategy.removeStylesFrom(e),this.targets.delete(e)}isAttachedTo(e){return this.targets.has(e)}withBehaviors(...e){return this.behaviors=null===this.behaviors?e:this.behaviors.concat(e),this}withStrategy(e){return this._strategy=new e(he(this.styles)),this}static setDefaultStrategy(e){de=e}static normalize(e){return void 0===e?void 0:Array.isArray(e)?new ue(e):e instanceof ue?e:new ue([e])}}ue.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;const fe=g(),pe=Object.freeze({getForInstance:fe.getForInstance,getByType:fe.getByType,define:e=>(fe.register({type:e}),e)});function ge(){return function(e){pe.define(e)}}function be(e,t,s){t.source.style.setProperty(e.targetAspect,s.bind(t))}class ve{constructor(e,t){this.dataBinding=e,this.targetAspect=t}createCSS(e){return e(this),`var(${this.targetAspect})`}addedCallback(e){var t;const s=e.source;if(!s.$cssBindings){s.$cssBindings=new Map;const e=s.setAttribute;s.setAttribute=(t,i)=>{e.call(s,t,i),"style"===t&&s.$cssBindings.forEach(((e,t)=>be(t,e.controller,e.observer)))}}const i=null!==(t=e[this.targetAspect])&&void 0!==t?t:e[this.targetAspect]=this.dataBinding.createObserver(this,this);i.controller=e,e.source.$cssBindings.set(this,{controller:e,observer:i})}connectedCallback(e){be(this,e,e[this.targetAspect])}removedCallback(e){e.source.$cssBindings&&e.source.$cssBindings.delete(this)}handleChange(e,t){be(this,t.controller,t)}}pe.define(ve);const me=`${Math.random().toString(36).substring(2,8)}`;let ye=0;const we=()=>`--v${me}${++ye}`;function Se(e,t){const s=[];let i="";const n=[],r=e=>{n.push(e)};for(let n=0,o=e.length-1;n<o;++n){i+=e[n];let o=t[n];c(o)?o=new ve(re(o),we()).createCSS(r):o instanceof ie?o=new ve(o,we()).createCSS(r):void 0!==pe.getForInstance(o)&&(o=o.createCSS(r)),o instanceof ue||o instanceof CSSStyleSheet?(""!==i.trim()&&(s.push(i),i=""),s.push(o)):i+=o}return i+=e[e.length-1],""!==i.trim()&&s.push(i),{styles:s,behaviors:n}}const Ce=(e,...t)=>{const{styles:s,behaviors:i}=Se(e,t),n=new ue(s);return i.length?n.withBehaviors(...i):n};class $e{constructor(e,t){this.behaviors=t,this.css="";const s=e.reduce(((e,t)=>(d(t)?this.css+=t:e.push(t),e)),[]);s.length&&(this.styles=new ue(s))}createCSS(e){return this.behaviors.forEach(e),this.styles&&e(this),this.css}addedCallback(e){e.addStyles(this.styles)}removedCallback(e){e.removeStyles(this.styles)}}pe.define($e),Ce.partial=(e,...t)=>{const{styles:s,behaviors:i}=Se(e,t);return new $e(s,i)};const Te=/fe-b\$\$start\$\$(\d+)\$\$(.+)\$\$fe-b/,xe=/fe-b\$\$end\$\$(\d+)\$\$(.+)\$\$fe-b/,Oe=/fe-repeat\$\$start\$\$(\d+)\$\$fe-repeat/,Be=/fe-repeat\$\$end\$\$(\d+)\$\$fe-repeat/,Ne=/^(?:.{0,1000})fe-eb\$\$start\$\$(.+?)\$\$fe-eb/,ke=/fe-eb\$\$end\$\$(.{0,1000})\$\$fe-eb(?:.{0,1000})$/;function Ae(e){return e&&e.nodeType===Node.COMMENT_NODE}const Ee=Object.freeze({attributeMarkerName:"data-fe-b",attributeBindingSeparator:" ",contentBindingStartMarker:(e,t)=>`fe-b$$start$$${e}$$${t}$$fe-b`,contentBindingEndMarker:(e,t)=>`fe-b$$end$$${e}$$${t}$$fe-b`,repeatStartMarker:e=>`fe-repeat$$start$$${e}$$fe-repeat`,repeatEndMarker:e=>`fe-repeat$$end$$${e}$$fe-repeat`,isContentBindingStartMarker:e=>Te.test(e),isContentBindingEndMarker:e=>xe.test(e),isRepeatViewStartMarker:e=>Oe.test(e),isRepeatViewEndMarker:e=>Be.test(e),isElementBoundaryStartMarker:e=>Ae(e)&&Ne.test(e.data.trim()),isElementBoundaryEndMarker:e=>Ae(e)&&ke.test(e.data),parseAttributeBinding(e){const t=e.getAttribute(this.attributeMarkerName);return null===t?t:t.split(this.attributeBindingSeparator).map((e=>parseInt(e)))},parseEnumeratedAttributeBinding(e){const t=[];let s=0;for(;e.hasAttribute(`${this.attributeMarkerName}-${s}`);)t.push(s++);return 0===s?null:t},parseContentBindingStartMarker:e=>Ve(Te,e),parseContentBindingEndMarker:e=>Ve(xe,e),parseRepeatStartMarker:e=>Me(Oe,e),parseRepeatEndMarker:e=>Me(Be,e),parseElementBoundaryStartMarker:e=>je(Ne,e.trim()),parseElementBoundaryEndMarker:e=>je(ke,e)});function Me(e,t){const s=e.exec(t);return null===s?s:parseInt(s[1])}function je(e,t){const s=e.exec(t);return null===s?s:s[1]}function Ve(e,t){const s=e.exec(t);return null===s?s:[parseInt(s[1]),s[2]]}const Ie=Symbol.for("fe-hydration");function Re(e){return e[Ie]===Ie}const _e=`fast-${Math.random().toString(36).substring(2,8)}`,ze=`${_e}{`,Le=`}${_e}`,Fe=Le.length;let Pe=0;const De=()=>`${_e}-${++Pe}`,He=Object.freeze({interpolation:e=>`${ze}${e}${Le}`,attribute:e=>`${De()}="${ze}${e}${Le}"`,comment:e=>`\x3c!--${ze}${e}${Le}--\x3e`}),Ue=Object.freeze({parse(e,t){const s=e.split(ze);if(1===s.length)return null;const i=[];for(let e=0,n=s.length;e<n;++e){const n=s[e],r=n.indexOf(Le);let o;if(-1===r)o=n;else{const e=n.substring(0,r);i.push(t[e]),o=n.substring(r+Fe)}""!==o&&i.push(o)}return i}}),qe=g(),Qe=Object.freeze({getForInstance:qe.getForInstance,getByType:qe.getByType,define:(e,t)=>((t=t||{}).type=e,qe.register(t),e),assignAspect(e,t){if(t)switch(e.sourceAspect=t,t[0]){case":":e.targetAspect=t.substring(1),e.aspectType="classList"===e.targetAspect?m.tokenList:m.property;break;case"?":e.targetAspect=t.substring(1),e.aspectType=m.booleanAttribute;break;case"@":e.targetAspect=t.substring(1),e.aspectType=m.event;break;default:e.targetAspect=t,e.aspectType=m.attribute}else e.aspectType=m.content}});function We(e){return function(t){Qe.define(t,e)}}class Xe{constructor(e){this.options=e}createHTML(e){return He.attribute(e(this))}createBehavior(){return this}}v(Xe);class Je extends Error{constructor(e,t,s){super(e),this.factories=t,this.node=s}}function Ke(e){return e.nodeType===Node.COMMENT_NODE}function Ge(e){return e.nodeType===Node.TEXT_NODE}function Ye(e,t){const s=document.createRange();return s.setStart(e,0),s.setEnd(t,Ke(t)||Ge(t)?t.data.length:t.childNodes.length),s}function Ze(e,t,s){var i;const n=null!==(i=Ee.parseAttributeBinding(e))&&void 0!==i?i:Ee.parseEnumeratedAttributeBinding(e);if(null!==n){for(const i of n){if(!t[i])throw new Je(`HydrationView was unable to successfully target factory on ${e.nodeName} inside ${e.getRootNode().host.nodeName}. This likely indicates a template mismatch between SSR rendering and hydration.`,t,e);tt(t[i],e,s)}e.removeAttribute(Ee.attributeMarkerName)}}function et(e,t,s,i,n){if(Ee.isElementBoundaryStartMarker(e))!function(e,t){const s=Ee.parseElementBoundaryStartMarker(e.data);let i=t.nextSibling();for(;null!==i;){if(Ke(i)){const e=Ee.parseElementBoundaryEndMarker(i.data);if(e&&e===s)break}i=t.nextSibling()}}(e,t);else if(Ee.isContentBindingStartMarker(e.data)){const r=Ee.parseContentBindingStartMarker(e.data);if(null===r)return;const[o,a]=r,l=s[o],c=[];let d=t.nextSibling();e.data="";const h=d;for(;null!==d;){if(Ke(d)){const e=Ee.parseContentBindingEndMarker(d.data);if(e&&e[1]===a)break}c.push(d),d=t.nextSibling()}if(null===d){const t=e.getRootNode();throw new Error(`Error hydrating Comment node inside "${function(e){return e instanceof DocumentFragment&&"mode"in e}(t)?t.host.nodeName:t.nodeName}".`)}if(d.data="",1===c.length&&Ge(c[0]))tt(l,c[0],i);else{d!==h&&null!==d.previousSibling&&(n[l.targetNodeId]={first:h,last:d.previousSibling});tt(l,d.parentNode.insertBefore(document.createTextNode(""),d),i)}}}function tt(e,t,s){if(void 0===e.targetNodeId)throw new Error("Factory could not be target to the node");s[e.targetNodeId]=t}var st;function it(e,t){const s=e.parentNode;let i,n=e;for(;n!==t;){if(i=n.nextSibling,!i)throw new Error(`Unmatched first/last child inside "${t.getRootNode().host.nodeName}".`);s.removeChild(n),n=i}s.removeChild(t)}class nt{constructor(){this.index=0,this.length=0}get event(){return P.getEvent()}get isEven(){return this.index%2==0}get isOdd(){return this.index%2!=0}get isFirst(){return 0===this.index}get isInMiddle(){return!this.isFirst&&!this.isLast}get isLast(){return this.index===this.length-1}eventDetail(){return this.event.detail}eventTarget(){return this.event.target}}class rt extends nt{constructor(e,t,s){super(),this.fragment=e,this.factories=t,this.targets=s,this.behaviors=null,this.unbindables=[],this.source=null,this.isBound=!1,this.sourceLifetime=R.unknown,this.context=this,this.firstChild=e.firstChild,this.lastChild=e.lastChild}appendTo(e){e.appendChild(this.fragment)}insertBefore(e){if(this.fragment.hasChildNodes())e.parentNode.insertBefore(this.fragment,e);else{const t=this.lastChild;if(e.previousSibling===t)return;const s=e.parentNode;let i,n=this.firstChild;for(;n!==t;)i=n.nextSibling,s.insertBefore(n,e),n=i;s.insertBefore(t,e)}}remove(){const e=this.fragment,t=this.lastChild;let s,i=this.firstChild;for(;i!==t;)s=i.nextSibling,e.appendChild(i),i=s;e.appendChild(t)}dispose(){it(this.firstChild,this.lastChild),this.unbind()}onUnbind(e){this.unbindables.push(e)}bind(e,t=this){if(this.source===e)return;let s=this.behaviors;if(null===s){this.source=e,this.context=t,this.behaviors=s=new Array(this.factories.length);const i=this.factories;for(let e=0,t=i.length;e<t;++e){const t=i[e].createBehavior();t.bind(this),s[e]=t}}else{null!==this.source&&this.evaluateUnbindables(),this.isBound=!1,this.source=e,this.context=t;for(let e=0,t=s.length;e<t;++e)s[e].bind(this)}this.isBound=!0}unbind(){this.isBound&&null!==this.source&&(this.evaluateUnbindables(),this.source=null,this.context=this,this.isBound=!1)}evaluateUnbindables(){const e=this.unbindables;for(let t=0,s=e.length;t<s;++t)e[t].unbind(this);e.length=0}static disposeContiguousBatch(e){if(0!==e.length){it(e[0].firstChild,e[e.length-1].lastChild);for(let t=0,s=e.length;t<s;++t)e[t].unbind()}}}v(rt),_.defineProperty(rt.prototype,"index"),_.defineProperty(rt.prototype,"length");const ot="unhydrated",at="hydrating",lt="hydrated";class ct extends Error{constructor(e,t,s,i){super(e),this.factory=t,this.fragment=s,this.templateString=i}}st=Ie,v(class extends nt{constructor(e,t,s,i){super(),this.firstChild=e,this.lastChild=t,this.sourceTemplate=s,this.hostBindingTarget=i,this[st]=Ie,this.context=this,this.source=null,this.isBound=!1,this.sourceLifetime=R.unknown,this.unbindables=[],this.fragment=null,this.behaviors=null,this._hydrationStage=ot,this._bindingViewBoundaries={},this._targets={},this.factories=s.compile().factories}get hydrationStage(){return this._hydrationStage}get targets(){return this._targets}get bindingViewBoundaries(){return this._bindingViewBoundaries}insertBefore(e){if(null!==this.fragment)if(this.fragment.hasChildNodes())e.parentNode.insertBefore(this.fragment,e);else{const t=this.lastChild;if(e.previousSibling===t)return;const s=e.parentNode;let i,n=this.firstChild;for(;n!==t;)i=n.nextSibling,s.insertBefore(n,e),n=i;s.insertBefore(t,e)}}appendTo(e){null!==this.fragment&&e.appendChild(this.fragment)}remove(){const e=this.fragment||(this.fragment=document.createDocumentFragment()),t=this.lastChild;let s,i=this.firstChild;for(;i!==t;){if(s=i.nextSibling,!s)throw new Error(`Unmatched first/last child inside "${t.getRootNode().host.nodeName}".`);e.appendChild(i),i=s}e.appendChild(t)}bind(e,t=this){var s,i;if(this.hydrationStage!==lt&&(this._hydrationStage=at),this.source===e)return;let n=this.behaviors;if(null===n){this.source=e,this.context=t;try{const{targets:e,boundaries:t}=function(e,t,s){const i=Ye(e,t),n=i.commonAncestorContainer,r=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_COMMENT+NodeFilter.SHOW_TEXT,{acceptNode:e=>0===i.comparePoint(e,0)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}),o={},a={};let l=r.currentNode=e;for(;null!==l;){switch(l.nodeType){case Node.ELEMENT_NODE:Ze(l,s,o);break;case Node.COMMENT_NODE:et(l,r,s,o,a)}l=r.nextNode()}return i.detach(),{targets:o,boundaries:a}}(this.firstChild,this.lastChild,this.factories);this._targets=e,this._bindingViewBoundaries=t}catch(e){if(e instanceof Je){let t=this.sourceTemplate.html;"string"!=typeof t&&(t=t.innerHTML),e.templateString=t}throw e}this.behaviors=n=new Array(this.factories.length);const r=this.factories;for(let e=0,t=r.length;e<t;++e){const t=r[e];if("h"===t.targetNodeId&&this.hostBindingTarget&&tt(t,this.hostBindingTarget,this._targets),!(t.targetNodeId in this.targets)){let e=this.sourceTemplate.html;throw"string"!=typeof e&&(e=e.innerHTML),new ct(`HydrationView was unable to successfully target bindings inside "${null===(i=(null===(s=this.firstChild)||void 0===s?void 0:s.getRootNode()).host)||void 0===i?void 0:i.nodeName}".`,t,Ye(this.firstChild,this.lastChild).cloneContents(),e)}{const s=t.createBehavior();s.bind(this),n[e]=s}}}else{null!==this.source&&this.evaluateUnbindables(),this.isBound=!1,this.source=e,this.context=t;for(let e=0,t=n.length;e<t;++e)n[e].bind(this)}this.isBound=!0,this._hydrationStage=lt}unbind(){this.isBound&&null!==this.source&&(this.evaluateUnbindables(),this.source=null,this.context=this,this.isBound=!1)}dispose(){it(this.firstChild,this.lastChild),this.unbind()}onUnbind(e){this.unbindables.push(e)}evaluateUnbindables(){const e=this.unbindables;for(let t=0,s=e.length;t<s;++t)e[t].unbind(this);e.length=0}});const dt={[m.attribute]:$.setAttribute,[m.booleanAttribute]:$.setBooleanAttribute,[m.property]:(e,t,s)=>e[t]=s,[m.content]:function(e,t,s,i){if(null==s&&(s=""),function(e){return void 0!==e.create}(s)){e.textContent="";let t=e.$fastView;if(void 0===t)if(Re(i)&&Re(s)&&void 0!==i.bindingViewBoundaries[this.targetNodeId]&&i.hydrationStage!==lt){const e=i.bindingViewBoundaries[this.targetNodeId];t=s.hydrate(e.first,e.last)}else t=s.create();else e.$fastTemplate!==s&&(t.isComposed&&(t.remove(),t.unbind()),t=s.create());t.isComposed?t.needsBindOnly&&(t.needsBindOnly=!1,t.bind(i.source,i.context)):(t.isComposed=!0,t.bind(i.source,i.context),t.insertBefore(e),e.$fastView=t,e.$fastTemplate=s)}else{const t=e.$fastView;void 0!==t&&t.isComposed&&(t.isComposed=!1,t.remove(),t.needsBindOnly?t.needsBindOnly=!1:t.unbind()),e.textContent=s}},[m.tokenList]:function(e,t,s){var i;const n=`${this.id}-t`,r=null!==(i=e[n])&&void 0!==i?i:e[n]={v:0,cv:Object.create(null)},o=r.cv;let a=r.v;const l=e[t];if(null!=s&&s.length){const e=s.split(/\s+/);for(let t=0,s=e.length;t<s;++t){const s=e[t];""!==s&&(o[s]=a,l.add(s))}}if(r.v=a+1,0!==a){a-=1;for(const e in o)o[e]===a&&l.remove(e)}},[m.event]:()=>{}};class ht{constructor(e){this.dataBinding=e,this.updateTarget=null,this.aspectType=m.content}createHTML(e){return He.interpolation(e(this))}createBehavior(){var e;if(null===this.updateTarget){const t=dt[this.aspectType],s=null!==(e=this.dataBinding.policy)&&void 0!==e?e:this.policy;if(!t)throw f.error(1205);this.data=`${this.id}-d`,this.updateTarget=s.protect(this.targetTagName,this.aspectType,this.targetAspect,t)}return this}bind(e){var t;const s=e.targets[this.targetNodeId],i=Re(e)&&e.hydrationStage&&e.hydrationStage!==lt;switch(this.aspectType){case m.event:s[this.data]=e,s.addEventListener(this.targetAspect,this,this.dataBinding.options);break;case m.content:e.onUnbind(this);default:const n=null!==(t=s[this.data])&&void 0!==t?t:s[this.data]=this.dataBinding.createObserver(this,this);if(n.target=s,n.controller=e,i&&(this.aspectType===m.attribute||this.aspectType===m.booleanAttribute)){n.bind(e);break}this.updateTarget(s,this.targetAspect,n.bind(e),e)}}unbind(e){const t=e.targets[this.targetNodeId].$fastView;void 0!==t&&t.isComposed&&(t.unbind(),t.needsBindOnly=!0)}handleEvent(e){const t=e.currentTarget[this.data];if(t.isBound){P.setEvent(e);const s=this.dataBinding.evaluate(t.source,t.context);P.setEvent(null),!0!==s&&e.preventDefault()}}handleChange(e,t){const s=t.target,i=t.controller;this.updateTarget(s,this.targetAspect,t.bind(i),i)}}Qe.define(ht,{aspected:!0});const ut=(e,t)=>`${e}.${t}`,ft={},pt={index:0,node:null};function gt(e){e.startsWith("fast-")||f.warn(1204,{name:e})}const bt=new Proxy(document.createElement("div"),{get(e,t){gt(t);const s=Reflect.get(e,t);return c(s)?s.bind(e):s},set:(e,t,s)=>(gt(t),Reflect.set(e,t,s))});class vt{constructor(e,t,s){this.fragment=e,this.directives=t,this.policy=s,this.proto=null,this.nodeIds=new Set,this.descriptors={},this.factories=[]}addFactory(e,t,s,i,n){var r,o;this.nodeIds.has(s)||(this.nodeIds.add(s),this.addTargetDescriptor(t,s,i)),e.id=null!==(r=e.id)&&void 0!==r?r:De(),e.targetNodeId=s,e.targetTagName=n,e.policy=null!==(o=e.policy)&&void 0!==o?o:this.policy,this.factories.push(e)}freeze(){return this.proto=Object.create(null,this.descriptors),this}addTargetDescriptor(e,t,s){const i=this.descriptors;if("r"===t||"h"===t||i[t])return;if(!i[e]){const t=e.lastIndexOf("."),s=e.substring(0,t),i=parseInt(e.substring(t+1));this.addTargetDescriptor(s,e,i)}let n=ft[t];if(!n){const i=`_${t}`;ft[t]=n={get(){var t;return null!==(t=this[i])&&void 0!==t?t:this[i]=this[e].childNodes[s]}}}i[t]=n}createView(e){const t=this.fragment.cloneNode(!0),s=Object.create(this.proto);s.r=t,s.h=null!=e?e:bt;for(const e of this.nodeIds)s[e];return new rt(t,this.factories,s)}}function mt(e,t,s,i,n,r=!1){const o=s.attributes,a=e.directives;for(let l=0,c=o.length;l<c;++l){const d=o[l],h=d.value,u=Ue.parse(h,a);let f=null;null===u?r&&(f=new ht(le((()=>h),e.policy)),Qe.assignAspect(f,d.name)):f=Ct.aggregate(u,e.policy),null!==f&&(s.removeAttributeNode(d),l--,c--,e.addFactory(f,t,i,n,s.tagName))}}function yt(e,t,s){let i=0,n=t.firstChild;for(;n;){const t=wt(e,s,n,i);n=t.node,i=t.index}}function wt(e,t,s,i){const n=ut(t,i);switch(s.nodeType){case 1:mt(e,t,s,n,i),yt(e,s,n);break;case 3:return function(e,t,s,i,n){const r=Ue.parse(t.textContent,e.directives);if(null===r)return pt.node=t.nextSibling,pt.index=n+1,pt;let o,a=o=t;for(let t=0,l=r.length;t<l;++t){const l=r[t];0!==t&&(n++,i=ut(s,n),o=a.parentNode.insertBefore(document.createTextNode(""),a.nextSibling)),d(l)?o.textContent=l:(o.textContent=" ",Qe.assignAspect(l),e.addFactory(l,s,i,n,null)),a=o}return pt.index=n+1,pt.node=a.nextSibling,pt}(e,s,t,n,i);case 8:const r=Ue.parse(s.data,e.directives);null!==r&&e.addFactory(Ct.aggregate(r),t,n,i,null)}return pt.index=i+1,pt.node=s.nextSibling,pt}const St="TEMPLATE",Ct={compile(e,t,s=$.policy){let i;if(d(e)){i=document.createElement(St),i.innerHTML=s.createHTML(e);const t=i.content.firstElementChild;null!==t&&t.tagName===St&&(i=t)}else i=e;i.content.firstChild||i.content.lastChild||i.content.appendChild(document.createComment(""));const n=document.adoptNode(i.content),r=new vt(n,t,s);var o,a;return mt(r,"",i,"h",0,!0),o=n.firstChild,a=t,(o&&8==o.nodeType&&null!==Ue.parse(o.data,a)||1===n.childNodes.length&&Object.keys(t).length>0)&&n.insertBefore(document.createComment(""),n.firstChild),yt(r,n,"r"),pt.node=null,r.freeze()},setDefaultStrategy(e){this.compile=e},aggregate(e,t=$.policy){if(1===e.length)return e[0];let s,i,n=!1;const r=e.length,o=e.map((e=>d(e)?()=>e:(s=e.sourceAspect||s,n=n||e.dataBinding.isVolatile,i=i||e.dataBinding.policy,e.dataBinding.evaluate))),a=new ht(re(((e,t)=>{let s="";for(let i=0;i<r;++i)s+=o[i](e,t);return s}),null!=i?i:t,n));return Qe.assignAspect(a,s),a}},$t=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/,Tt=Object.create(null);class xt{constructor(e,t=Tt){this.html=e,this.factories=t}createHTML(e){const t=this.factories;for(const s in t)e(t[s]);return this.html}}function Ot(e,t,s,i=Qe.getForInstance(e)){if(i.aspected){const s=$t.exec(t);null!==s&&Qe.assignAspect(e,s[2])}return e.createHTML(s)}xt.empty=new xt(""),Qe.define(xt);class Bt{constructor(e,t={},s){this.policy=s,this.result=null,this.html=e,this.factories=t}compile(){return null===this.result&&(this.result=Ct.compile(this.html,this.factories,this.policy)),this.result}create(e){return this.compile().createView(e)}inline(){return new xt(d(this.html)?this.html:this.html.innerHTML,this.factories)}withPolicy(e){if(this.result)throw f.error(1208);if(this.policy)throw f.error(1207);return this.policy=e,this}render(e,t,s){const i=this.create(s);return i.bind(e),i.appendTo(t),i}static create(e,t,s){let i="";const n=Object.create(null),r=e=>{var t;const s=null!==(t=e.id)&&void 0!==t?t:e.id=De();return n[s]=e,s};for(let s=0,n=e.length-1;s<n;++s){const n=e[s];let o,a=t[s];if(i+=n,c(a))a=new ht(re(a));else if(a instanceof ie)a=new ht(a);else if(!(o=Qe.getForInstance(a))){const e=a;a=new ht(le((()=>e)))}i+=Ot(a,n,r,o)}return new Bt(i+e[e.length-1],n,s)}}v(Bt);const Nt=(e,...t)=>{if(Array.isArray(e)&&Array.isArray(e.raw))return Bt.create(e,t);throw f.error(1206)};Nt.partial=e=>new xt(e);class kt extends Xe{bind(e){e.source[this.options]=e.targets[this.targetNodeId]}}Qe.define(kt);const At=e=>new kt(e),Et=()=>null;function Mt(e){return void 0===e?Et:c(e)?e:()=>e}function jt(e,t,s){const i=c(e)?e:()=>e,n=Mt(t),r=Mt(s);return(e,t)=>i(e,t)?n(e,t):r(e,t)}const Vt=Object.freeze({positioning:!1,recycle:!0});function It(e,t,s,i){e.context.parent=i.source,e.context.parentContext=i.context,e.bind(t[s])}function Rt(e,t,s,i){e.context.parent=i.source,e.context.parentContext=i.context,e.context.length=t.length,e.context.index=s,e.bind(t[s])}function _t(e){return e.nodeType===Node.COMMENT_NODE}class zt extends Error{constructor(e,t){super(e),this.propertyBag=t}}class Lt{constructor(e){this.directive=e,this.items=null,this.itemsObserver=null,this.bindView=It,this.views=[],this.itemsBindingObserver=e.dataBinding.createObserver(this,e),this.templateBindingObserver=e.templateBinding.createObserver(this,e),e.options.positioning&&(this.bindView=Rt)}bind(e){this.location=e.targets[this.directive.targetNodeId],this.controller=e,this.items=this.itemsBindingObserver.bind(e),this.template=this.templateBindingObserver.bind(e),this.observeItems(!0),Re(this.template)&&Re(e)&&e.hydrationStage!==lt?this.hydrateViews(this.template):this.refreshAllViews(),e.onUnbind(this)}unbind(){null!==this.itemsObserver&&this.itemsObserver.unsubscribe(this),this.unbindAllViews()}handleChange(e,t){if(t===this.itemsBindingObserver)this.items=this.itemsBindingObserver.bind(this.controller),this.observeItems(),this.refreshAllViews();else if(t===this.templateBindingObserver)this.template=this.templateBindingObserver.bind(this.controller),this.refreshAllViews(!0);else{if(!t[0])return;t[0].reset?this.refreshAllViews():t[0].sorted?this.updateSortedViews(t):this.updateSplicedViews(t)}}observeItems(e=!1){if(!this.items)return void(this.items=p);const t=this.itemsObserver,s=this.itemsObserver=_.getNotifier(this.items),i=t!==s;i&&null!==t&&t.unsubscribe(this),(i||e)&&s.subscribe(this)}updateSortedViews(e){const t=this.views;for(let s=0,i=e.length;s<i;++s){const i=e[s].sorted.slice(),n=i.slice().sort();for(let e=0,s=i.length;e<s;++e){const s=i.find((t=>i[e]===n[t]));if(s!==e){const i=n.splice(s,1);n.splice(e,0,...i);const r=t[e],o=r?r.firstChild:this.location;t[s].remove(),t[s].insertBefore(o);const a=t.splice(s,1);t.splice(e,0,...a)}}}}updateSplicedViews(e){const t=this.views,s=this.bindView,i=this.items,n=this.template,r=this.controller,o=this.directive.options.recycle,a=[];let l=0,c=0;for(let d=0,h=e.length;d<h;++d){const h=e[d],u=h.removed;let f=0,p=h.index;const g=p+h.addedCount,b=t.splice(h.index,u.length),v=c=a.length+b.length;for(;p<g;++p){const e=t[p],d=e?e.firstChild:this.location;let h;o&&c>0?(f<=v&&b.length>0?(h=b[f],f++):(h=a[l],l++),c--):h=n.create(),t.splice(p,0,h),s(h,i,p,r),h.insertBefore(d)}b[f]&&a.push(...b.slice(f))}for(let e=l,t=a.length;e<t;++e)a[e].dispose();if(this.directive.options.positioning)for(let e=0,s=t.length;e<s;++e){const i=t[e].context;i.length=s,i.index=e}}refreshAllViews(e=!1){const t=this.items,s=this.template,i=this.location,n=this.bindView,r=this.controller;let o=t.length,a=this.views,l=a.length;if(0!==o&&!e&&this.directive.options.recycle||(rt.disposeContiguousBatch(a),l=0),0===l){this.views=a=new Array(o);for(let e=0;e<o;++e){const o=s.create();n(o,t,e,r),a[e]=o,o.insertBefore(i)}}else{let e=0;for(;e<o;++e)if(e<l){const i=a[e];if(!i){const t=new XMLSerializer;throw new zt(`View is null or undefined inside "${this.location.getRootNode().host.nodeName}".`,{index:e,hydrationStage:this.controller.hydrationStage,itemsLength:o,viewsState:a.map((e=>e?"hydrated":"empty")),viewTemplateString:t.serializeToString(s.create().fragment),rootNodeContent:t.serializeToString(this.location.getRootNode())})}n(i,t,e,r)}else{const o=s.create();n(o,t,e,r),a.push(o),o.insertBefore(i)}const c=a.splice(e,l-e);for(e=0,o=c.length;e<o;++e)c[e].dispose()}}unbindAllViews(){const e=this.views;for(let t=0,s=e.length;t<s;++t){const s=e[t];if(!s){const s=new XMLSerializer;throw new zt(`View is null or undefined inside "${this.location.getRootNode().host.nodeName}".`,{index:t,hydrationStage:this.controller.hydrationStage,viewsState:e.map((e=>e?"hydrated":"empty")),rootNodeContent:s.serializeToString(this.location.getRootNode())})}s.unbind()}}hydrateViews(e){if(!this.items)return;this.views=new Array(this.items.length);let t=this.location.previousSibling;for(;null!==t;){if(!_t(t)){t=t.previousSibling;continue}const s=Ee.parseRepeatEndMarker(t.data);if(null===s){t=t.previousSibling;continue}t.data="";const i=t.previousSibling;if(!i)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": end should never be null.`);let n=i,r=0;for(;null!==n;){if(_t(n))if(Ee.isRepeatViewEndMarker(n.data))r++;else if(Ee.isRepeatViewStartMarker(n.data)){if(!r){if(Ee.parseRepeatStartMarker(n.data)!==s)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": Mismatched start and end markers.`);n.data="",t=n.previousSibling,n=n.nextSibling;const r=e.hydrate(n,i);this.views[s]=r,this.bindView(r,this.items,s,this.controller);break}r--}n=n.previousSibling}if(!n)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": start should never be null.`)}}}class Ft{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.options=s,ee.enable()}createHTML(e){return He.comment(e(this))}createBehavior(){return new Lt(this)}}function Pt(e,t,s=Vt){const i=ce(e),n=ce(t);return new Ft(i,n,Object.assign(Object.assign({},Vt),s))}Qe.define(Ft);const Dt=e=>1===e.nodeType,Ht=e=>e?t=>1===t.nodeType&&t.matches(e):Dt;class Ut extends Xe{get id(){return this._id}set id(e){this._id=e,this._controllerProperty=`${e}-c`}bind(e){const t=e.targets[this.targetNodeId];t[this._controllerProperty]=e,this.updateTarget(e.source,this.computeNodes(t)),this.observe(t),e.onUnbind(this)}unbind(e){const t=e.targets[this.targetNodeId];this.updateTarget(e.source,p),this.disconnect(t),t[this._controllerProperty]=null}getSource(e){return e[this._controllerProperty].source}updateTarget(e,t){e[this.options.property]=t}computeNodes(e){let t=this.getNodes(e);return"filter"in this.options&&(t=t.filter(this.options.filter)),t}}const qt="slotchange";class Qt extends Ut{observe(e){e.addEventListener(qt,this)}disconnect(e){e.removeEventListener(qt,this)}getNodes(e){return e.assignedNodes(this.options)}handleEvent(e){const t=e.currentTarget;this.updateTarget(this.getSource(t),this.computeNodes(t))}}function Wt(e){return d(e)&&(e={property:e}),new Qt(e)}Qe.define(Qt);class Xt extends Ut{constructor(e){super(e),this.observerProperty=Symbol(),this.handleEvent=(e,t)=>{const s=t.target;this.updateTarget(this.getSource(s),this.computeNodes(s))},e.childList=!0}observe(e){let t=e[this.observerProperty];t||(t=new MutationObserver(this.handleEvent),t.toJSON=h,e[this.observerProperty]=t),t.target=e,t.observe(e,this.options)}disconnect(e){const t=e[this.observerProperty];t.target=null,t.disconnect()}getNodes(e){return"selector"in this.options?Array.from(e.querySelectorAll(this.options.selector)):Array.from(e.childNodes)}}function Jt(e){return d(e)&&(e={property:e}),new Xt(e)}Qe.define(Xt);const Kt="boolean",Gt="reflect",Yt=Object.freeze({locate:b()}),Zt={toView:e=>e?"true":"false",fromView:e=>!(null==e||"false"===e||!1===e||0===e)},es={toView:e=>"boolean"==typeof e?e.toString():"",fromView:e=>[null,void 0,void 0].includes(e)?null:Zt.fromView(e)};function ts(e){if(null==e)return null;const t=1*e;return isNaN(t)?null:t}const ss={toView(e){const t=ts(e);return t?t.toString():t},fromView:ts};class is{constructor(e,t,s=t.toLowerCase(),i=Gt,n){this.guards=new Set,this.Owner=e,this.name=t,this.attribute=s,this.mode=i,this.converter=n,this.fieldName=`_${t}`,this.callbackName=`${t}Changed`,this.hasCallback=this.callbackName in e.prototype,i===Kt&&void 0===n&&(this.converter=Zt)}setValue(e,t){const s=e[this.fieldName],i=this.converter;void 0!==i&&(t=i.fromView(t)),s!==t&&(e[this.fieldName]=t,this.tryReflectToAttribute(e),this.hasCallback&&e[this.callbackName](s,t),e.$fastController.notify(this.name))}getValue(e){return _.track(e,this.name),e[this.fieldName]}onAttributeChangedCallback(e,t){this.guards.has(e)||(this.guards.add(e),this.setValue(e,t),this.guards.delete(e))}tryReflectToAttribute(e){const t=this.mode,s=this.guards;s.has(e)||"fromView"===t||j.enqueue((()=>{s.add(e);const i=e[this.fieldName];switch(t){case Gt:const t=this.converter;$.setAttribute(e,this.attribute,void 0!==t?t.toView(i):i);break;case Kt:$.setBooleanAttribute(e,this.attribute,i)}s.delete(e)}))}static collect(e,...t){const s=[];t.push(Yt.locate(e));for(let i=0,n=t.length;i<n;++i){const n=t[i];if(void 0!==n)for(let t=0,i=n.length;t<i;++t){const i=n[t];d(i)?s.push(new is(e,i)):s.push(new is(e,i.property,i.attribute,i.mode,i.converter))}}return s}}function ns(e,t){let s;function i(e,t){arguments.length>1&&(s.property=t),Yt.locate(e.constructor).push(s)}return arguments.length>1?(s={},void i(e,t)):(s=void 0===e?{}:e,i)}const rs={mode:"open"},os={},as=new Set,ls=f.getById(l.elementRegistry,(()=>g()));class cs{constructor(e,t=e.definition){var s;this.platformDefined=!1,d(t)&&(t={name:t}),this.type=e,this.name=t.name,this.template=t.template,this.registry=null!==(s=t.registry)&&void 0!==s?s:customElements;const i=e.prototype,n=is.collect(e,t.attributes),r=new Array(n.length),o={},a={};for(let e=0,t=n.length;e<t;++e){const t=n[e];r[e]=t.attribute,o[t.name]=t,a[t.attribute]=t,_.defineProperty(i,t)}Reflect.defineProperty(e,"observedAttributes",{value:r,enumerable:!0}),this.attributes=n,this.propertyLookup=o,this.attributeLookup=a,this.shadowOptions=void 0===t.shadowOptions?rs:null===t.shadowOptions?void 0:Object.assign(Object.assign({},rs),t.shadowOptions),this.elementOptions=void 0===t.elementOptions?os:Object.assign(Object.assign({},os),t.elementOptions),this.styles=ue.normalize(t.styles),ls.register(this)}get isDefined(){return this.platformDefined}define(e=this.registry){const t=this.type;return e.get(this.name)||(this.platformDefined=!0,e.define(this.name,t,this.elementOptions)),this}static compose(e,t){return as.has(e)||ls.getByType(e)?new cs(class extends e{},t):new cs(e,t)}static registerBaseType(e){as.add(e)}}cs.getByType=ls.getByType,cs.getForInstance=ls.getForInstance,_.defineProperty(cs.prototype,"template"),_.defineProperty(cs.prototype,"shadowOptions");class ds{constructor(e){this.directive=e,this.location=null,this.controller=null,this.view=null,this.data=null,this.dataBindingObserver=e.dataBinding.createObserver(this,e),this.templateBindingObserver=e.templateBinding.createObserver(this,e)}bind(e){if(this.location=e.targets[this.directive.targetNodeId],this.controller=e,this.data=this.dataBindingObserver.bind(e),this.template=this.templateBindingObserver.bind(e),e.onUnbind(this),Re(this.template)&&Re(e)&&e.hydrationStage!==lt&&!this.view){const t=e.bindingViewBoundaries[this.directive.targetNodeId];t&&(this.view=this.template.hydrate(t.first,t.last),this.bindView(this.view))}else this.refreshView()}unbind(e){const t=this.view;null!==t&&t.isComposed&&(t.unbind(),t.needsBindOnly=!0)}handleChange(e,t){t===this.dataBindingObserver&&(this.data=this.dataBindingObserver.bind(this.controller)),(this.directive.templateBindingDependsOnData||t===this.templateBindingObserver)&&(this.template=this.templateBindingObserver.bind(this.controller)),this.refreshView()}bindView(e){e.isComposed?e.needsBindOnly&&(e.needsBindOnly=!1,e.bind(this.data)):(e.isComposed=!0,e.bind(this.data),e.insertBefore(this.location),e.$fastTemplate=this.template)}refreshView(){let e=this.view;const t=this.template;null===e?(this.view=e=t.create(),this.view.context.parent=this.controller.source,this.view.context.parentContext=this.controller.context):e.$fastTemplate!==t&&(e.isComposed&&(e.remove(),e.unbind()),this.view=e=t.create(),this.view.context.parent=this.controller.source,this.view.context.parentContext=this.controller.context),this.bindView(e)}}class hs{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.templateBindingDependsOnData=s}createHTML(e){return He.comment(e(this))}createBehavior(){return new ds(this)}}Qe.define(hs);const us=new Map,fs={":model":e=>e},ps=Symbol("RenderInstruction"),gs="default-view",bs=Nt`
2
2
  &nbsp;
3
- `;function vs(e){return void 0===e?bs:e.template}function ms(e,t){const s=[],n=[],{attributes:i,directives:r,content:o,policy:a}=null!=t?t:{};if(s.push(`<${e}`),i){const e=Object.getOwnPropertyNames(i);for(let t=0,r=e.length;t<r;++t){const r=e[t];0===t?s[0]=`${s[0]} ${r}="`:s.push(`" ${r}="`),n.push(i[r])}s.push('"')}if(r){s[s.length-1]+=" ";for(let e=0,t=r.length;e<t;++e){const t=r[e];s.push(e>0?"":" "),n.push(t)}}if(s[s.length-1]+=">",o&&c(o.create))n.push(o),s.push(`</${e}>`);else{const t=s.length-1;s[t]=`${s[t]}${null!=o?o:""}</${e}>`}return Bt.create(s,n,a)}function ys(e){var t;const s=null!==(t=e.name)&&void 0!==t?t:gs;let n;if((i=e).element||i.tagName){let t=e.tagName;if(!t){const s=cs.getByType(e.element);if(!s)throw new Error("Invalid element for model rendering.");t=s.name}e.attributes||(e.attributes=fs),n=ms(t,e)}else n=e.template;var i;return{brand:ps,type:e.type,name:s,template:n}}function ws(e){return e&&e.brand===ps}function Ss(e,t){const s=us.get(e);if(void 0!==s)return s[null!=t?t:gs]}function Cs(e,t){if(e)return Ss(e.constructor,t)}Object.freeze({instanceOf:ws,create:ys,createElementTemplate:ms,register:function(e){let t=us.get(e.type);void 0===t&&us.set(e.type,t=Object.create(null));const s=ws(e)?e:ys(e);return t[s.name]=s},getByType:Ss,getForInstance:Cs});class Ts{constructor(e){this.node=e,e.$fastTemplate=this}get context(){return this}bind(e){}unbind(){}insertBefore(e){e.parentNode.insertBefore(this.node,e)}remove(){this.node.parentNode.removeChild(this.node)}create(){return this}hydrate(e,t){return this}}function $s(e,t){let s,n;s=void 0===e?le((e=>e)):ce(e);let i=!1;if(void 0===t)i=!0,n=le(((e,t)=>{var n;const i=s.evaluate(e,t);return i instanceof Node?null!==(n=i.$fastTemplate)&&void 0!==n?n:new Ts(i):vs(Cs(i))}));else if(c(t))n=re(((e,n)=>{var i;let r=t(e,n);return d(r)?r=vs(Cs(s.evaluate(e,n),r)):r instanceof Node&&(r=null!==(i=r.$fastTemplate)&&void 0!==i?i:new Ts(r)),r}),void 0,!0);else if(d(t))i=!0,n=le(((e,n)=>{var i;const r=s.evaluate(e,n);return r instanceof Node?null!==(i=r.$fastTemplate)&&void 0!==i?i:new Ts(r):vs(Cs(r,t))}));else if(t instanceof ne){const e=t.evaluate;t.evaluate=(t,n)=>{var i;let r=e(t,n);return d(r)?r=vs(Cs(s.evaluate(t,n),r)):r instanceof Node&&(r=null!==(i=r.$fastTemplate)&&void 0!==i?i:new Ts(r)),r},n=t}else n=le(((e,s)=>t));return new hs(s,n,i)}class xs extends MutationObserver{constructor(e){super((function(e){this.callback.call(null,e.filter((e=>this.observedNodes.has(e.target))))})),this.callback=e,this.observedNodes=new Set}observe(e,t){this.observedNodes.add(e),super.observe(e,t)}unobserve(e){this.observedNodes.delete(e),this.observedNodes.size<1&&this.disconnect()}}Object.freeze({create(e){const t=[],s={};let n=null,i=!1;return{source:e,context:P.default,targets:s,get isBound(){return i},addBehaviorFactory(e,t){var s,n,i,r;const o=e;o.id=null!==(s=o.id)&&void 0!==s?s:De(),o.targetNodeId=null!==(n=o.targetNodeId)&&void 0!==n?n:De(),o.targetTagName=null!==(i=t.tagName)&&void 0!==i?i:null,o.policy=null!==(r=o.policy)&&void 0!==r?r:T.policy,this.addTarget(o.targetNodeId,t),this.addBehavior(o.createBehavior())},addTarget(e,t){s[e]=t},addBehavior(e){t.push(e),i&&e.bind(this)},onUnbind(e){null===n&&(n=[]),n.push(e)},connectedCallback(e){i||(i=!0,t.forEach((e=>e.bind(this))))},disconnectedCallback(e){i&&(i=!1,null!==n&&n.forEach((e=>e.unbind(this))))}}}});const Os={bubbles:!0,composed:!0,cancelable:!0},Bs="isConnected",Ns=new WeakMap;function ks(e){var t,s;return null!==(s=null!==(t=e.shadowRoot)&&void 0!==t?t:Ns.get(e))&&void 0!==s?s:null}let As;class Es extends I{constructor(e,t){super(e),this.boundObservables=null,this.needsInitialization=!0,this.hasExistingShadowRoot=!1,this._template=null,this.stage=3,this.guardBehaviorConnection=!1,this.behaviors=null,this.behaviorsConnected=!1,this._mainStyles=null,this.$fastController=this,this.view=null,this.source=e,this.definition=t;const s=t.shadowOptions;if(void 0!==s){let t=e.shadowRoot;t?this.hasExistingShadowRoot=!0:(t=e.attachShadow(s),"closed"===s.mode&&Ns.set(e,t))}const n=_.getAccessors(e);if(n.length>0){const t=this.boundObservables=Object.create(null);for(let s=0,i=n.length;s<i;++s){const i=n[s].name,r=e[i];void 0!==r&&(delete e[i],t[i]=r)}}}get isConnected(){return _.track(this,Bs),1===this.stage}get context(){var e,t;return null!==(t=null===(e=this.view)||void 0===e?void 0:e.context)&&void 0!==t?t:P.default}get isBound(){var e,t;return null!==(t=null===(e=this.view)||void 0===e?void 0:e.isBound)&&void 0!==t&&t}get sourceLifetime(){var e;return null===(e=this.view)||void 0===e?void 0:e.sourceLifetime}get template(){var e;if(null===this._template){const t=this.definition;this.source.resolveTemplate?this._template=this.source.resolveTemplate():t.template&&(this._template=null!==(e=t.template)&&void 0!==e?e:null)}return this._template}set template(e){this._template!==e&&(this._template=e,this.needsInitialization||this.renderTemplate(e))}get mainStyles(){var e;if(null===this._mainStyles){const t=this.definition;this.source.resolveStyles?this._mainStyles=this.source.resolveStyles():t.styles&&(this._mainStyles=null!==(e=t.styles)&&void 0!==e?e:null)}return this._mainStyles}set mainStyles(e){this._mainStyles!==e&&(null!==this._mainStyles&&this.removeStyles(this._mainStyles),this._mainStyles=e,this.needsInitialization||this.addStyles(e))}onUnbind(e){var t;null===(t=this.view)||void 0===t||t.onUnbind(e)}addBehavior(e){var t,s;const n=null!==(t=this.behaviors)&&void 0!==t?t:this.behaviors=new Map,i=null!==(s=n.get(e))&&void 0!==s?s:0;0===i?(n.set(e,1),e.addedCallback&&e.addedCallback(this),!e.connectedCallback||this.guardBehaviorConnection||1!==this.stage&&0!==this.stage||e.connectedCallback(this)):n.set(e,i+1)}removeBehavior(e,t=!1){const s=this.behaviors;if(null===s)return;const n=s.get(e);void 0!==n&&(1===n||t?(s.delete(e),e.disconnectedCallback&&3!==this.stage&&e.disconnectedCallback(this),e.removedCallback&&e.removedCallback(this)):s.set(e,n-1))}addStyles(e){var t;if(!e)return;const s=this.source;if(e instanceof HTMLElement){(null!==(t=ks(s))&&void 0!==t?t:this.source).append(e)}else if(!e.isAttachedTo(s)){const t=e.behaviors;if(e.addStylesTo(s),null!==t)for(let e=0,s=t.length;e<s;++e)this.addBehavior(t[e])}}removeStyles(e){var t;if(!e)return;const s=this.source;if(e instanceof HTMLElement){(null!==(t=ks(s))&&void 0!==t?t:s).removeChild(e)}else if(e.isAttachedTo(s)){const t=e.behaviors;if(e.removeStylesFrom(s),null!==t)for(let e=0,s=t.length;e<s;++e)this.removeBehavior(t[e])}}connect(){3===this.stage&&(this.stage=0,this.bindObservables(),this.connectBehaviors(),this.needsInitialization?(this.renderTemplate(this.template),this.addStyles(this.mainStyles),this.needsInitialization=!1):null!==this.view&&this.view.bind(this.source),this.stage=1,_.notify(this,Bs))}bindObservables(){if(null!==this.boundObservables){const e=this.source,t=this.boundObservables,s=Object.keys(t);for(let n=0,i=s.length;n<i;++n){const i=s[n];e[i]=t[i]}this.boundObservables=null}}connectBehaviors(){if(!1===this.behaviorsConnected){const e=this.behaviors;if(null!==e){this.guardBehaviorConnection=!0;for(const t of e.keys())t.connectedCallback&&t.connectedCallback(this);this.guardBehaviorConnection=!1}this.behaviorsConnected=!0}}disconnectBehaviors(){if(!0===this.behaviorsConnected){const e=this.behaviors;if(null!==e)for(const t of e.keys())t.disconnectedCallback&&t.disconnectedCallback(this);this.behaviorsConnected=!1}}disconnect(){1===this.stage&&(this.stage=2,_.notify(this,Bs),null!==this.view&&this.view.unbind(),this.disconnectBehaviors(),this.stage=3)}onAttributeChangedCallback(e,t,s){const n=this.definition.attributeLookup[e];void 0!==n&&n.onAttributeChangedCallback(this.source,s)}emit(e,t,s){return 1===this.stage&&this.source.dispatchEvent(new CustomEvent(e,Object.assign(Object.assign({detail:t},Os),s)))}renderTemplate(e){var t;const s=this.source,n=null!==(t=ks(s))&&void 0!==t?t:s;if(null!==this.view)this.view.dispose(),this.view=null;else if(!this.needsInitialization||this.hasExistingShadowRoot){this.hasExistingShadowRoot=!1;for(let e=n.firstChild;null!==e;e=n.firstChild)n.removeChild(e)}e&&(this.view=e.render(s,n,s),this.view.sourceLifetime=R.coupled)}static forCustomElement(e,t=!1){const s=e.$fastController;if(void 0!==s&&!t)return s;const n=cs.getForInstance(e);if(void 0===n)throw f.error(1401);return _.getNotifier(n).subscribe({handleChange:()=>{Es.forCustomElement(e,!0),e.$fastController.connect()}},"template"),e.$fastController=new As(e,n)}static setStrategy(e){As=e}}function Ms(e){var t;return"adoptedStyleSheets"in e?e:null!==(t=ks(e))&&void 0!==t?t:e.getRootNode()}v(Es),Es.setStrategy(Es);class js{constructor(e){const t=js.styleSheetCache;this.sheets=e.map((e=>{if(e instanceof CSSStyleSheet)return e;let s=t.get(e);return void 0===s&&(s=new CSSStyleSheet,s.replaceSync(e),t.set(e,s)),s}))}addStylesTo(e){_s(Ms(e),this.sheets)}removeStylesFrom(e){zs(Ms(e),this.sheets)}}js.styleSheetCache=new Map;let Vs=0;function Is(e){return e===document?document.body:e}class Rs{constructor(e){this.styles=e,this.styleClass="fast-"+ ++Vs}addStylesTo(e){e=Is(Ms(e));const t=this.styles,s=this.styleClass;for(let n=0;n<t.length;n++){const i=document.createElement("style");i.innerHTML=t[n],i.className=s,e.append(i)}}removeStylesFrom(e){const t=(e=Is(Ms(e))).querySelectorAll(`.${this.styleClass}`);for(let s=0,n=t.length;s<n;++s)e.removeChild(t[s])}}let _s=(e,t)=>{e.adoptedStyleSheets=[...e.adoptedStyleSheets,...t]},zs=(e,t)=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter((e=>-1===t.indexOf(e)))};if(ue.supportsAdoptedStyleSheets){try{document.adoptedStyleSheets.push(),document.adoptedStyleSheets.splice(),_s=(e,t)=>{e.adoptedStyleSheets.push(...t)},zs=(e,t)=>{for(const s of t){const t=e.adoptedStyleSheets.indexOf(s);-1!==t&&e.adoptedStyleSheets.splice(t,1)}}}catch(e){}ue.setDefaultStrategy(js)}else ue.setDefaultStrategy(Rs);const Ls="defer-hydration",Fs="needs-hydration";class Ps extends Es{static hydrationObserverHandler(e){for(const t of e)Ps.hydrationObserver.unobserve(t.target),t.target.$fastController.connect()}connect(){var e,t;if(void 0===this.needsHydration&&(this.needsHydration=null!==this.source.getAttribute(Fs)),this.source.hasAttribute(Ls))return void Ps.hydrationObserver.observe(this.source,{attributeFilter:[Ls]});if(!this.needsHydration)return void super.connect();if(3!==this.stage)return;this.stage=0,this.bindObservables(),this.connectBehaviors();const s=this.source,n=null!==(e=ks(s))&&void 0!==e?e:s;if(this.template)if(Re(this.template)){let e=n.firstChild,i=n.lastChild;null===s.shadowRoot&&(Ee.isElementBoundaryStartMarker(e)&&(e.data="",e=e.nextSibling),Ee.isElementBoundaryEndMarker(i)&&(i.data="",i=i.previousSibling)),this.view=this.template.hydrate(e,i,s),null===(t=this.view)||void 0===t||t.bind(this.source)}else this.renderTemplate(this.template);this.addStyles(this.mainStyles),this.stage=1,this.source.removeAttribute(Fs),this.needsInitialization=this.needsHydration=!1,_.notify(this,Bs)}disconnect(){super.disconnect(),Ps.hydrationObserver.unobserve(this.source)}static install(){Es.setStrategy(Ps)}}function Ds(e){const t=class extends e{constructor(){super(),Es.forCustomElement(this)}$emit(e,t,s){return this.$fastController.emit(e,t,s)}connectedCallback(){this.$fastController.connect()}disconnectedCallback(){this.$fastController.disconnect()}attributeChangedCallback(e,t,s){this.$fastController.onAttributeChangedCallback(e,t,s)}};return cs.registerBaseType(t),t}function Hs(e,t){return c(e)?cs.compose(e,t).define().type:cs.compose(this,e).define().type}Ps.hydrationObserver=new xs(Ps.hydrationObserverHandler);const Us=Object.assign(Ds(HTMLElement),{from:function(e){return Ds(e)},define:Hs,compose:function(e,t){return c(e)?cs.compose(e,t):cs.compose(this,e)}});function qs(e){return function(t){Hs(t,e)}}T.setPolicy(M.create());export{ee as ArrayObserver,Yt as AttributeConfiguration,ns as AttributeDefinition,ne as Binding,ve as CSSBindingDirective,pe as CSSDirective,Xt as ChildrenDirective,Ct as Compiler,T as DOM,m as DOMAspect,Es as ElementController,ue as ElementStyles,P as ExecutionContext,f as FAST,Us as FASTElement,cs as FASTElementDefinition,ht as HTMLBindingDirective,Qe as HTMLDirective,rt as HTMLView,Ps as HydratableElementController,ct as HydrationBindingError,xt as InlineTemplateDirective,He as Markup,Ut as NodeObservationDirective,_ as Observable,Ue as Parser,I as PropertyChangeNotifier,kt as RefDirective,ds as RenderBehavior,hs as RenderDirective,Lt as RepeatBehavior,Ft as RepeatDirective,Qt as SlottedDirective,H as Sort,R as SourceLifetime,D as Splice,K as SpliceStrategy,U as SpliceStrategySupport,Xe as StatelessAttachedAttributeDirective,V as SubscriberSet,j as Updates,Bt as ViewTemplate,is as attr,Zt as booleanConverter,Jt as children,Ce as css,ge as cssDirective,qs as customElement,Ht as elements,p as emptyArray,ls as fastElementRegistry,Nt as html,We as htmlDirective,te as lengthOf,oe as listener,ce as normalizeBinding,es as nullableBooleanConverter,ss as nullableNumberConverter,z as observable,le as oneTime,re as oneWay,At as ref,$s as render,Pt as repeat,Wt as slotted,se as sortedCount,L as volatile,jt as when};
3
+ `;function vs(e){return void 0===e?bs:e.template}function ms(e,t){const s=[],i=[],{attributes:n,directives:r,content:o,policy:a}=null!=t?t:{};if(s.push(`<${e}`),n){const e=Object.getOwnPropertyNames(n);for(let t=0,r=e.length;t<r;++t){const r=e[t];0===t?s[0]=`${s[0]} ${r}="`:s.push(`" ${r}="`),i.push(n[r])}s.push('"')}if(r){s[s.length-1]+=" ";for(let e=0,t=r.length;e<t;++e){const t=r[e];s.push(e>0?"":" "),i.push(t)}}if(s[s.length-1]+=">",o&&c(o.create))i.push(o),s.push(`</${e}>`);else{const t=s.length-1;s[t]=`${s[t]}${null!=o?o:""}</${e}>`}return Bt.create(s,i,a)}function ys(e){var t;const s=null!==(t=e.name)&&void 0!==t?t:gs;let i;if((n=e).element||n.tagName){let t=e.tagName;if(!t){const s=cs.getByType(e.element);if(!s)throw new Error("Invalid element for model rendering.");t=s.name}e.attributes||(e.attributes=fs),i=ms(t,e)}else i=e.template;var n;return{brand:ps,type:e.type,name:s,template:i}}function ws(e){return e&&e.brand===ps}function Ss(e,t){const s=us.get(e);if(void 0!==s)return s[null!=t?t:gs]}function Cs(e,t){if(e)return Ss(e.constructor,t)}Object.freeze({instanceOf:ws,create:ys,createElementTemplate:ms,register:function(e){let t=us.get(e.type);void 0===t&&us.set(e.type,t=Object.create(null));const s=ws(e)?e:ys(e);return t[s.name]=s},getByType:Ss,getForInstance:Cs});class $s{constructor(e){this.node=e,e.$fastTemplate=this}get context(){return this}bind(e){}unbind(){}insertBefore(e){e.parentNode.insertBefore(this.node,e)}remove(){this.node.parentNode.removeChild(this.node)}create(){return this}hydrate(e,t){return this}}function Ts(e,t){let s,i;s=void 0===e?le((e=>e)):ce(e);let n=!1;if(void 0===t)n=!0,i=le(((e,t)=>{var i;const n=s.evaluate(e,t);return n instanceof Node?null!==(i=n.$fastTemplate)&&void 0!==i?i:new $s(n):vs(Cs(n))}));else if(c(t))i=re(((e,i)=>{var n;let r=t(e,i);return d(r)?r=vs(Cs(s.evaluate(e,i),r)):r instanceof Node&&(r=null!==(n=r.$fastTemplate)&&void 0!==n?n:new $s(r)),r}),void 0,!0);else if(d(t))n=!0,i=le(((e,i)=>{var n;const r=s.evaluate(e,i);return r instanceof Node?null!==(n=r.$fastTemplate)&&void 0!==n?n:new $s(r):vs(Cs(r,t))}));else if(t instanceof ie){const e=t.evaluate;t.evaluate=(t,i)=>{var n;let r=e(t,i);return d(r)?r=vs(Cs(s.evaluate(t,i),r)):r instanceof Node&&(r=null!==(n=r.$fastTemplate)&&void 0!==n?n:new $s(r)),r},i=t}else i=le(((e,s)=>t));return new hs(s,i,n)}class xs extends MutationObserver{constructor(e){super((function(e){this.callback.call(null,e.filter((e=>this.observedNodes.has(e.target))))})),this.callback=e,this.observedNodes=new Set}observe(e,t){this.observedNodes.add(e),super.observe(e,t)}unobserve(e){this.observedNodes.delete(e),this.observedNodes.size<1&&this.disconnect()}}Object.freeze({create(e){const t=[],s={};let i=null,n=!1;return{source:e,context:P.default,targets:s,get isBound(){return n},addBehaviorFactory(e,t){var s,i,n,r;const o=e;o.id=null!==(s=o.id)&&void 0!==s?s:De(),o.targetNodeId=null!==(i=o.targetNodeId)&&void 0!==i?i:De(),o.targetTagName=null!==(n=t.tagName)&&void 0!==n?n:null,o.policy=null!==(r=o.policy)&&void 0!==r?r:$.policy,this.addTarget(o.targetNodeId,t),this.addBehavior(o.createBehavior())},addTarget(e,t){s[e]=t},addBehavior(e){t.push(e),n&&e.bind(this)},onUnbind(e){null===i&&(i=[]),i.push(e)},connectedCallback(e){n||(n=!0,t.forEach((e=>e.bind(this))))},disconnectedCallback(e){n&&(n=!1,null!==i&&i.forEach((e=>e.unbind(this))))}}}});const Os={bubbles:!0,composed:!0,cancelable:!0},Bs="isConnected",Ns=new WeakMap;function ks(e){var t,s;return null!==(s=null!==(t=e.shadowRoot)&&void 0!==t?t:Ns.get(e))&&void 0!==s?s:null}let As;class Es extends I{constructor(e,t){super(e),this.boundObservables=null,this.needsInitialization=!0,this.hasExistingShadowRoot=!1,this._template=null,this.stage=3,this.guardBehaviorConnection=!1,this.behaviors=null,this.behaviorsConnected=!1,this._mainStyles=null,this.$fastController=this,this.view=null,this.source=e,this.definition=t,this.shadowOptions=t.shadowOptions;const s=_.getAccessors(e);if(s.length>0){const t=this.boundObservables=Object.create(null);for(let i=0,n=s.length;i<n;++i){const n=s[i].name,r=e[n];void 0!==r&&(delete e[n],t[n]=r)}}}get isConnected(){return _.track(this,Bs),1===this.stage}get context(){var e,t;return null!==(t=null===(e=this.view)||void 0===e?void 0:e.context)&&void 0!==t?t:P.default}get isBound(){var e,t;return null!==(t=null===(e=this.view)||void 0===e?void 0:e.isBound)&&void 0!==t&&t}get sourceLifetime(){var e;return null===(e=this.view)||void 0===e?void 0:e.sourceLifetime}get template(){var e;if(null===this._template){const t=this.definition;this.source.resolveTemplate?this._template=this.source.resolveTemplate():t.template&&(this._template=null!==(e=t.template)&&void 0!==e?e:null)}return this._template}set template(e){this._template!==e&&(this._template=e,this.needsInitialization||this.renderTemplate(e))}get shadowOptions(){return this._shadowRootOptions}set shadowOptions(e){if(void 0===this._shadowRootOptions&&void 0!==e){this._shadowRootOptions=e;let t=this.source.shadowRoot;t?this.hasExistingShadowRoot=!0:(t=this.source.attachShadow(e),"closed"===e.mode&&Ns.set(this.source,t))}}get mainStyles(){var e;if(null===this._mainStyles){const t=this.definition;this.source.resolveStyles?this._mainStyles=this.source.resolveStyles():t.styles&&(this._mainStyles=null!==(e=t.styles)&&void 0!==e?e:null)}return this._mainStyles}set mainStyles(e){this._mainStyles!==e&&(null!==this._mainStyles&&this.removeStyles(this._mainStyles),this._mainStyles=e,this.needsInitialization||this.addStyles(e))}onUnbind(e){var t;null===(t=this.view)||void 0===t||t.onUnbind(e)}addBehavior(e){var t,s;const i=null!==(t=this.behaviors)&&void 0!==t?t:this.behaviors=new Map,n=null!==(s=i.get(e))&&void 0!==s?s:0;0===n?(i.set(e,1),e.addedCallback&&e.addedCallback(this),!e.connectedCallback||this.guardBehaviorConnection||1!==this.stage&&0!==this.stage||e.connectedCallback(this)):i.set(e,n+1)}removeBehavior(e,t=!1){const s=this.behaviors;if(null===s)return;const i=s.get(e);void 0!==i&&(1===i||t?(s.delete(e),e.disconnectedCallback&&3!==this.stage&&e.disconnectedCallback(this),e.removedCallback&&e.removedCallback(this)):s.set(e,i-1))}addStyles(e){var t;if(!e)return;const s=this.source;if(e instanceof HTMLElement){(null!==(t=ks(s))&&void 0!==t?t:this.source).append(e)}else if(!e.isAttachedTo(s)){const t=e.behaviors;if(e.addStylesTo(s),null!==t)for(let e=0,s=t.length;e<s;++e)this.addBehavior(t[e])}}removeStyles(e){var t;if(!e)return;const s=this.source;if(e instanceof HTMLElement){(null!==(t=ks(s))&&void 0!==t?t:s).removeChild(e)}else if(e.isAttachedTo(s)){const t=e.behaviors;if(e.removeStylesFrom(s),null!==t)for(let e=0,s=t.length;e<s;++e)this.removeBehavior(t[e])}}connect(){3===this.stage&&(this.stage=0,this.bindObservables(),this.connectBehaviors(),this.needsInitialization?(this.renderTemplate(this.template),this.addStyles(this.mainStyles),this.needsInitialization=!1):null!==this.view&&this.view.bind(this.source),this.stage=1,_.notify(this,Bs))}bindObservables(){if(null!==this.boundObservables){const e=this.source,t=this.boundObservables,s=Object.keys(t);for(let i=0,n=s.length;i<n;++i){const n=s[i];e[n]=t[n]}this.boundObservables=null}}connectBehaviors(){if(!1===this.behaviorsConnected){const e=this.behaviors;if(null!==e){this.guardBehaviorConnection=!0;for(const t of e.keys())t.connectedCallback&&t.connectedCallback(this);this.guardBehaviorConnection=!1}this.behaviorsConnected=!0}}disconnectBehaviors(){if(!0===this.behaviorsConnected){const e=this.behaviors;if(null!==e)for(const t of e.keys())t.disconnectedCallback&&t.disconnectedCallback(this);this.behaviorsConnected=!1}}disconnect(){1===this.stage&&(this.stage=2,_.notify(this,Bs),null!==this.view&&this.view.unbind(),this.disconnectBehaviors(),this.stage=3)}onAttributeChangedCallback(e,t,s){const i=this.definition.attributeLookup[e];void 0!==i&&i.onAttributeChangedCallback(this.source,s)}emit(e,t,s){return 1===this.stage&&this.source.dispatchEvent(new CustomEvent(e,Object.assign(Object.assign({detail:t},Os),s)))}renderTemplate(e){var t;const s=this.source,i=null!==(t=ks(s))&&void 0!==t?t:s;if(null!==this.view)this.view.dispose(),this.view=null;else if(!this.needsInitialization||this.hasExistingShadowRoot){this.hasExistingShadowRoot=!1;for(let e=i.firstChild;null!==e;e=i.firstChild)i.removeChild(e)}e&&(this.view=e.render(s,i,s),this.view.sourceLifetime=R.coupled)}static forCustomElement(e,t=!1){const s=e.$fastController;if(void 0!==s&&!t)return s;const i=cs.getForInstance(e);if(void 0===i)throw f.error(1401);return _.getNotifier(i).subscribe({handleChange:()=>{Es.forCustomElement(e,!0),e.$fastController.connect()}},"template"),_.getNotifier(i).subscribe({handleChange:()=>{Es.forCustomElement(e,!0),e.$fastController.connect()}},"shadowOptions"),e.$fastController=new As(e,i)}static setStrategy(e){As=e}}function Ms(e){var t;return"adoptedStyleSheets"in e?e:null!==(t=ks(e))&&void 0!==t?t:e.getRootNode()}v(Es),Es.setStrategy(Es);class js{constructor(e){const t=js.styleSheetCache;this.sheets=e.map((e=>{if(e instanceof CSSStyleSheet)return e;let s=t.get(e);return void 0===s&&(s=new CSSStyleSheet,s.replaceSync(e),t.set(e,s)),s}))}addStylesTo(e){_s(Ms(e),this.sheets)}removeStylesFrom(e){zs(Ms(e),this.sheets)}}js.styleSheetCache=new Map;let Vs=0;function Is(e){return e===document?document.body:e}class Rs{constructor(e){this.styles=e,this.styleClass="fast-"+ ++Vs}addStylesTo(e){e=Is(Ms(e));const t=this.styles,s=this.styleClass;for(let i=0;i<t.length;i++){const n=document.createElement("style");n.innerHTML=t[i],n.className=s,e.append(n)}}removeStylesFrom(e){const t=(e=Is(Ms(e))).querySelectorAll(`.${this.styleClass}`);for(let s=0,i=t.length;s<i;++s)e.removeChild(t[s])}}let _s=(e,t)=>{e.adoptedStyleSheets=[...e.adoptedStyleSheets,...t]},zs=(e,t)=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter((e=>-1===t.indexOf(e)))};if(ue.supportsAdoptedStyleSheets){try{document.adoptedStyleSheets.push(),document.adoptedStyleSheets.splice(),_s=(e,t)=>{e.adoptedStyleSheets.push(...t)},zs=(e,t)=>{for(const s of t){const t=e.adoptedStyleSheets.indexOf(s);-1!==t&&e.adoptedStyleSheets.splice(t,1)}}}catch(e){}ue.setDefaultStrategy(js)}else ue.setDefaultStrategy(Rs);const Ls="defer-hydration",Fs="needs-hydration";class Ps extends Es{static hydrationObserverHandler(e){for(const t of e)Ps.hydrationObserver.unobserve(t.target),t.target.$fastController.connect()}connect(){var e,t;if(void 0===this.needsHydration&&(this.needsHydration=null!==this.source.getAttribute(Fs)),this.source.hasAttribute(Ls))return void Ps.hydrationObserver.observe(this.source,{attributeFilter:[Ls]});if(!this.needsHydration)return void super.connect();if(3!==this.stage)return;this.stage=0,this.bindObservables(),this.connectBehaviors();const s=this.source,i=null!==(e=ks(s))&&void 0!==e?e:s;if(this.template)if(Re(this.template)){let e=i.firstChild,n=i.lastChild;null===s.shadowRoot&&(Ee.isElementBoundaryStartMarker(e)&&(e.data="",e=e.nextSibling),Ee.isElementBoundaryEndMarker(n)&&(n.data="",n=n.previousSibling)),this.view=this.template.hydrate(e,n,s),null===(t=this.view)||void 0===t||t.bind(this.source)}else this.renderTemplate(this.template);this.addStyles(this.mainStyles),this.stage=1,this.source.removeAttribute(Fs),this.needsInitialization=this.needsHydration=!1,_.notify(this,Bs)}disconnect(){super.disconnect(),Ps.hydrationObserver.unobserve(this.source)}static install(){Es.setStrategy(Ps)}}function Ds(e){const t=class extends e{constructor(){super(),Es.forCustomElement(this)}$emit(e,t,s){return this.$fastController.emit(e,t,s)}connectedCallback(){this.$fastController.connect()}disconnectedCallback(){this.$fastController.disconnect()}attributeChangedCallback(e,t,s){this.$fastController.onAttributeChangedCallback(e,t,s)}};return cs.registerBaseType(t),t}function Hs(e,t){return c(e)?cs.compose(e,t).define().type:cs.compose(this,e).define().type}Ps.hydrationObserver=new xs(Ps.hydrationObserverHandler);const Us=Object.assign(Ds(HTMLElement),{from:function(e){return Ds(e)},define:Hs,compose:function(e,t){return c(e)?cs.compose(e,t):cs.compose(this,e)}});function qs(e){return function(t){Hs(t,e)}}$.setPolicy(M.create());export{ee as ArrayObserver,Yt as AttributeConfiguration,is as AttributeDefinition,ie as Binding,ve as CSSBindingDirective,pe as CSSDirective,Xt as ChildrenDirective,Ct as Compiler,$ as DOM,m as DOMAspect,Es as ElementController,ue as ElementStyles,P as ExecutionContext,f as FAST,Us as FASTElement,cs as FASTElementDefinition,ht as HTMLBindingDirective,Qe as HTMLDirective,rt as HTMLView,Ps as HydratableElementController,ct as HydrationBindingError,xt as InlineTemplateDirective,He as Markup,Ut as NodeObservationDirective,_ as Observable,Ue as Parser,I as PropertyChangeNotifier,kt as RefDirective,ds as RenderBehavior,hs as RenderDirective,Lt as RepeatBehavior,Ft as RepeatDirective,Qt as SlottedDirective,H as Sort,R as SourceLifetime,D as Splice,K as SpliceStrategy,U as SpliceStrategySupport,Xe as StatelessAttachedAttributeDirective,V as SubscriberSet,j as Updates,Bt as ViewTemplate,ns as attr,Zt as booleanConverter,Jt as children,Ce as css,ge as cssDirective,qs as customElement,Ht as elements,p as emptyArray,ls as fastElementRegistry,Nt as html,We as htmlDirective,te as lengthOf,oe as listener,ce as normalizeBinding,es as nullableBooleanConverter,ss as nullableNumberConverter,z as observable,le as oneTime,re as oneWay,At as ref,Ts as render,Pt as repeat,Wt as slotted,se as sortedCount,L as volatile,jt as when};
@@ -2274,6 +2274,20 @@ const HydrationMarkup = Object.freeze({
2274
2274
  ? attr
2275
2275
  : attr.split(this.attributeBindingSeparator).map(i => parseInt(i));
2276
2276
  },
2277
+ /**
2278
+ * Returns the indexes of the ViewBehaviorFactories affecting
2279
+ * attributes for the element, or null if no factories were found.
2280
+ *
2281
+ * Uses the alternative syntax of data-fe-b-<number>
2282
+ */
2283
+ parseEnumeratedAttributeBinding(node) {
2284
+ const attrs = [];
2285
+ let count = 0;
2286
+ while (node.hasAttribute(`${this.attributeMarkerName}-${count}`)) {
2287
+ attrs.push(count++);
2288
+ }
2289
+ return count === 0 ? null : attrs;
2290
+ },
2277
2291
  /**
2278
2292
  * Parses the ViewBehaviorFactory index from string data. Returns
2279
2293
  * the binding index or null if the index cannot be retrieved.
@@ -2584,8 +2598,9 @@ function buildViewBindingTargets(firstNode, lastNode, factories) {
2584
2598
  return { targets, boundaries };
2585
2599
  }
2586
2600
  function targetElement(node, factories, targets) {
2601
+ var _a;
2587
2602
  // Check for attributes and map any factories.
2588
- const attrFactoryIds = HydrationMarkup.parseAttributeBinding(node);
2603
+ const attrFactoryIds = (_a = HydrationMarkup.parseAttributeBinding(node)) !== null && _a !== void 0 ? _a : HydrationMarkup.parseEnumeratedAttributeBinding(node);
2589
2604
  if (attrFactoryIds !== null) {
2590
2605
  for (const id of attrFactoryIds) {
2591
2606
  if (!factories[id]) {
@@ -4735,6 +4750,7 @@ FASTElementDefinition.getByType = fastElementRegistry.getByType;
4735
4750
  */
4736
4751
  FASTElementDefinition.getForInstance = fastElementRegistry.getForInstance;
4737
4752
  Observable.defineProperty(FASTElementDefinition.prototype, "template");
4753
+ Observable.defineProperty(FASTElementDefinition.prototype, "shadowOptions");
4738
4754
 
4739
4755
  /**
4740
4756
  * A Behavior that enables advanced rendering.
@@ -5303,19 +5319,7 @@ class ElementController extends PropertyChangeNotifier {
5303
5319
  this.view = null;
5304
5320
  this.source = element;
5305
5321
  this.definition = definition;
5306
- const shadowOptions = definition.shadowOptions;
5307
- if (shadowOptions !== void 0) {
5308
- let shadowRoot = element.shadowRoot;
5309
- if (shadowRoot) {
5310
- this.hasExistingShadowRoot = true;
5311
- }
5312
- else {
5313
- shadowRoot = element.attachShadow(shadowOptions);
5314
- if (shadowOptions.mode === "closed") {
5315
- shadowRoots.set(element, shadowRoot);
5316
- }
5317
- }
5318
- }
5322
+ this.shadowOptions = definition.shadowOptions;
5319
5323
  // Capture any observable values that were set by the binding engine before
5320
5324
  // the browser upgraded the element. Then delete the property since it will
5321
5325
  // shadow the getter/setter that is required to make the observable operate.
@@ -5392,6 +5396,25 @@ class ElementController extends PropertyChangeNotifier {
5392
5396
  this.renderTemplate(value);
5393
5397
  }
5394
5398
  }
5399
+ get shadowOptions() {
5400
+ return this._shadowRootOptions;
5401
+ }
5402
+ set shadowOptions(value) {
5403
+ // options on the shadowRoot can only be set once
5404
+ if (this._shadowRootOptions === void 0 && value !== void 0) {
5405
+ this._shadowRootOptions = value;
5406
+ let shadowRoot = this.source.shadowRoot;
5407
+ if (shadowRoot) {
5408
+ this.hasExistingShadowRoot = true;
5409
+ }
5410
+ else {
5411
+ shadowRoot = this.source.attachShadow(value);
5412
+ if (value.mode === "closed") {
5413
+ shadowRoots.set(this.source, shadowRoot);
5414
+ }
5415
+ }
5416
+ }
5417
+ }
5395
5418
  /**
5396
5419
  * The main set of styles used for the component, independent
5397
5420
  * of any dynamically added styles.
@@ -5674,6 +5697,12 @@ class ElementController extends PropertyChangeNotifier {
5674
5697
  element.$fastController.connect();
5675
5698
  },
5676
5699
  }, "template");
5700
+ Observable.getNotifier(definition).subscribe({
5701
+ handleChange: () => {
5702
+ ElementController.forCustomElement(element, true);
5703
+ element.$fastController.connect();
5704
+ },
5705
+ }, "shadowOptions");
5677
5706
  return (element.$fastController = new elementControllerStrategy(element, definition));
5678
5707
  }
5679
5708
  /**
@@ -1,3 +1,3 @@
1
- let e;const t="fast-kernel";try{if(document.currentScript)e=document.currentScript.getAttribute(t);else{const s=document.getElementsByTagName("script");e=s[s.length-1].getAttribute(t)}}catch(t){e="isolate"}let s;switch(e){case"share":s=Object.freeze({updateQueue:1,observable:2,contextEvent:3,elementRegistry:4});break;case"share-v2":s=Object.freeze({updateQueue:1.2,observable:2.2,contextEvent:3.2,elementRegistry:4.2});break;default:const e=`-${Math.random().toString(36).substring(2,8)}`;s=Object.freeze({updateQueue:`1.2${e}`,observable:`2.2${e}`,contextEvent:`3.2${e}`,elementRegistry:`4.2${e}`})}const i=e=>"function"==typeof e,n=e=>"string"==typeof e,r=()=>{};!function(){if("undefined"==typeof globalThis)if("undefined"!=typeof global)global.globalThis=global;else if("undefined"!=typeof self)self.globalThis=self;else if("undefined"!=typeof window)window.globalThis=window;else{const e=new Function("return this")();e.globalThis=e}}();const o={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},o));const a=globalThis.FAST;if(void 0===a.getById){const e=Object.create(null);Reflect.defineProperty(a,"getById",Object.assign({value(t,s){let i=e[t];return void 0===i&&(i=s?e[t]=s():null),i}},o))}void 0===a.error&&Object.assign(a,{warn(){},error:e=>new Error(`Error ${e}`),addMessages(){}});const l=Object.freeze([]);function c(){const e=new Map;return Object.freeze({register:t=>!e.has(t.type)&&(e.set(t.type,t),!0),getByType:t=>e.get(t),getForInstance(t){if(null!=t)return e.get(t.constructor)}})}function h(){const e=new WeakMap;return function(t){let s=e.get(t);if(void 0===s){let i=Reflect.getPrototypeOf(t);for(;void 0===s&&null!==i;)s=e.get(i),i=Reflect.getPrototypeOf(i);s=void 0===s?[]:s.slice(0),e.set(t,s)}return s}}function d(e){e.prototype.toJSON=r}const u=Object.freeze({none:0,attribute:1,booleanAttribute:2,property:3,content:4,tokenList:5,event:6}),f=e=>e,p=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:f}):{createHTML:f};let g=Object.freeze({createHTML:e=>p.createHTML(e),protect:(e,t,s,i)=>i});const b=g,v=Object.freeze({get policy(){return g},setPolicy(e){if(g!==b)throw a.error(1201);g=e},setAttribute(e,t,s){null==s?e.removeAttribute(t):e.setAttribute(t,s)},setBooleanAttribute(e,t,s){s?e.setAttribute(t,""):e.removeAttribute(t)}});function m(e,t,s,i){return(e,t,s,...r)=>{n(s)&&(s=s.replace(/(javascript:|vbscript:|data:)/,"")),i(e,t,s,...r)}}function y(e,t,s,i){throw a.error(1209,{aspectName:s,tagName:null!=e?e:"text"})}const w={onabort:y,onauxclick:y,onbeforeinput:y,onbeforematch:y,onblur:y,oncancel:y,oncanplay:y,oncanplaythrough:y,onchange:y,onclick:y,onclose:y,oncontextlost:y,oncontextmenu:y,oncontextrestored:y,oncopy:y,oncuechange:y,oncut:y,ondblclick:y,ondrag:y,ondragend:y,ondragenter:y,ondragleave:y,ondragover:y,ondragstart:y,ondrop:y,ondurationchange:y,onemptied:y,onended:y,onerror:y,onfocus:y,onformdata:y,oninput:y,oninvalid:y,onkeydown:y,onkeypress:y,onkeyup:y,onload:y,onloadeddata:y,onloadedmetadata:y,onloadstart:y,onmousedown:y,onmouseenter:y,onmouseleave:y,onmousemove:y,onmouseout:y,onmouseover:y,onmouseup:y,onpaste:y,onpause:y,onplay:y,onplaying:y,onprogress:y,onratechange:y,onreset:y,onresize:y,onscroll:y,onsecuritypolicyviolation:y,onseeked:y,onseeking:y,onselect:y,onslotchange:y,onstalled:y,onsubmit:y,onsuspend:y,ontimeupdate:y,ontoggle:y,onvolumechange:y,onwaiting:y,onwebkitanimationend:y,onwebkitanimationiteration:y,onwebkitanimationstart:y,onwebkittransitionend:y,onwheel:y},S={elements:{a:{[u.attribute]:{href:m},[u.property]:{href:m}},area:{[u.attribute]:{href:m},[u.property]:{href:m}},button:{[u.attribute]:{formaction:m},[u.property]:{formAction:m}},embed:{[u.attribute]:{src:y},[u.property]:{src:y}},form:{[u.attribute]:{action:m},[u.property]:{action:m}},frame:{[u.attribute]:{src:m},[u.property]:{src:m}},iframe:{[u.attribute]:{src:m},[u.property]:{src:m,srcdoc:y}},input:{[u.attribute]:{formaction:m},[u.property]:{formAction:m}},link:{[u.attribute]:{href:y},[u.property]:{href:y}},object:{[u.attribute]:{codebase:y,data:y},[u.property]:{codeBase:y,data:y}},script:{[u.attribute]:{src:y,text:y},[u.property]:{src:y,text:y,innerText:y,textContent:y}},style:{[u.property]:{innerText:y,textContent:y}}},aspects:{[u.attribute]:Object.assign({},w),[u.property]:Object.assign({innerHTML:y},w),[u.event]:Object.assign({},w)}};function C(e,t){const s={};for(const i in t){const n=e[i],r=t[i];switch(n){case null:break;case void 0:s[i]=r;break;default:s[i]=n}}for(const t in e)t in s||(s[t]=e[t]);return Object.freeze(s)}function x(e,t){const s={};for(const i in t){const n=e[i],r=t[i];switch(n){case null:break;case void 0:s[i]=C(r,{});break;default:s[i]=C(n,r)}}for(const t in e)t in s||(s[t]=C(e[t],{}));return Object.freeze(s)}function B(e,t){const s={};for(const i in t){const n=e[i],r=t[i];switch(n){case null:break;case void 0:s[i]=x(n,{});break;default:s[i]=x(n,r)}}for(const t in e)t in s||(s[t]=x(e[t],{}));return Object.freeze(s)}function $(e,t,s,i,n){const r=e[s];if(r){const e=r[i];if(e)return e(t,s,i,n)}}const T=Object.freeze({create(e={}){var t,s;const i=null!==(t=e.trustedType)&&void 0!==t?t:function(){const e=e=>e;return globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:e}):{createHTML:e}}(),n=(r=null!==(s=e.guards)&&void 0!==s?s:{},o=S,Object.freeze({elements:r.elements?B(r.elements,o.elements):o.elements,aspects:r.aspects?x(r.aspects,o.aspects):o.aspects}));var r,o;return Object.freeze({createHTML:e=>i.createHTML(e),protect(e,t,s,i){var r;const o=(null!=e?e:"").toLowerCase(),a=n.elements[o];if(a){const n=$(a,e,t,s,i);if(n)return n}return null!==(r=$(n.aspects,e,t,s,i))&&void 0!==r?r:i}})}}),O=a.getById(s.updateQueue,(()=>{const e=[],t=[],s=globalThis.requestAnimationFrame;let i=!0;function n(){if(t.length)throw t.shift()}function r(s){try{s.call()}catch(s){if(!i)throw e.length=0,s;t.push(s),setTimeout(n,0)}}function o(){let t=0;for(;t<e.length;)if(r(e[t]),t++,t>1024){for(let s=0,i=e.length-t;s<i;s++)e[s]=e[s+t];e.length-=t,t=0}e.length=0}function a(t){e.push(t),e.length<2&&(i?s(o):o())}return Object.freeze({enqueue:a,next:()=>new Promise(a),process:o,setMode:e=>i=e})}));class N{constructor(e,t){this.sub1=void 0,this.sub2=void 0,this.spillover=void 0,this.subject=e,this.sub1=t}has(e){return void 0===this.spillover?this.sub1===e||this.sub2===e:-1!==this.spillover.indexOf(e)}subscribe(e){const t=this.spillover;if(void 0===t){if(this.has(e))return;if(void 0===this.sub1)return void(this.sub1=e);if(void 0===this.sub2)return void(this.sub2=e);this.spillover=[this.sub1,this.sub2,e],this.sub1=void 0,this.sub2=void 0}else{-1===t.indexOf(e)&&t.push(e)}}unsubscribe(e){const t=this.spillover;if(void 0===t)this.sub1===e?this.sub1=void 0:this.sub2===e&&(this.sub2=void 0);else{const s=t.indexOf(e);-1!==s&&t.splice(s,1)}}notify(e){const t=this.spillover,s=this.subject;if(void 0===t){const t=this.sub1,i=this.sub2;void 0!==t&&t.handleChange(s,e),void 0!==i&&i.handleChange(s,e)}else for(let i=0,n=t.length;i<n;++i)t[i].handleChange(s,e)}}class k{constructor(e){this.subscribers={},this.subjectSubscribers=null,this.subject=e}notify(e){var t,s;null===(t=this.subscribers[e])||void 0===t||t.notify(e),null===(s=this.subjectSubscribers)||void 0===s||s.notify(e)}subscribe(e,t){var s,i;let n;n=t?null!==(s=this.subscribers[t])&&void 0!==s?s:this.subscribers[t]=new N(this.subject):null!==(i=this.subjectSubscribers)&&void 0!==i?i:this.subjectSubscribers=new N(this.subject),n.subscribe(e)}unsubscribe(e,t){var s,i;t?null===(s=this.subscribers[t])||void 0===s||s.unsubscribe(e):null===(i=this.subjectSubscribers)||void 0===i||i.unsubscribe(e)}}const E=Object.freeze({unknown:void 0,coupled:1}),A=a.getById(s.observable,(()=>{const e=O.enqueue,t=/(:|&&|\|\||if|\?\.)/,s=new WeakMap;let r,o=e=>{throw a.error(1101)};function l(e){var t;let i=null!==(t=e.$fastController)&&void 0!==t?t:s.get(e);return void 0===i&&(Array.isArray(e)?i=o(e):s.set(e,i=new k(e))),i}const c=h();class u{constructor(e){this.name=e,this.field=`_${e}`,this.callback=`${e}Changed`}getValue(e){return void 0!==r&&r.watch(e,this.name),e[this.field]}setValue(e,t){const s=this.field,n=e[s];if(n!==t){e[s]=t;const r=e[this.callback];i(r)&&r.call(e,n,t),l(e).notify(this.name)}}}class f extends N{constructor(e,t,s=!1){super(e,t),this.expression=e,this.isVolatileBinding=s,this.needsRefresh=!0,this.needsQueue=!0,this.isAsync=!0,this.first=this,this.last=null,this.propertySource=void 0,this.propertyName=void 0,this.notifier=void 0,this.next=void 0}setMode(e){this.isAsync=this.needsQueue=e}bind(e){this.controller=e;const t=this.observe(e.source,e.context);return!e.isBound&&this.requiresUnbind(e)&&e.onUnbind(this),t}requiresUnbind(e){return e.sourceLifetime!==E.coupled||this.first!==this.last||this.first.propertySource!==e.source}unbind(e){this.dispose()}observe(e,t){this.needsRefresh&&null!==this.last&&this.dispose();const s=r;let i;r=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;try{i=this.expression(e,t)}finally{r=s}return i}disconnect(){this.dispose()}dispose(){if(null!==this.last){let e=this.first;for(;void 0!==e;)e.notifier.unsubscribe(this,e.propertyName),e=e.next;this.last=null,this.needsRefresh=this.needsQueue=this.isAsync}}watch(e,t){const s=this.last,i=l(e),n=null===s?this.first:{};if(n.propertySource=e,n.propertyName=t,n.notifier=i,i.subscribe(this,t),null!==s){if(!this.needsRefresh){let t;r=void 0,t=s.propertySource[s.propertyName],r=this,e===t&&(this.needsRefresh=!0)}s.next=n}this.last=n}handleChange(){this.needsQueue?(this.needsQueue=!1,e(this)):this.isAsync||this.call()}call(){null!==this.last&&(this.needsQueue=this.isAsync,this.notify(this))}*records(){let e=this.first;for(;void 0!==e;)yield e,e=e.next}}return d(f),Object.freeze({setArrayObserverFactory(e){o=e},getNotifier:l,track(e,t){r&&r.watch(e,t)},trackVolatile(){r&&(r.needsRefresh=!0)},notify(e,t){l(e).notify(t)},defineProperty(e,t){n(t)&&(t=new u(t)),c(e).push(t),Reflect.defineProperty(e,t.name,{enumerable:!0,get(){return t.getValue(this)},set(e){t.setValue(this,e)}})},getAccessors:c,binding(e,t,s=this.isVolatileBinding(e)){return new f(e,t,s)},isVolatileBinding:e=>t.test(e.toString())})}));function M(e,t){A.defineProperty(e,t)}function j(e,t,s){return Object.assign({},s,{get(){return A.trackVolatile(),s.get.apply(this)}})}const V=a.getById(s.contextEvent,(()=>{let e=null;return{get:()=>e,set(t){e=t}}})),I=Object.freeze({default:{index:0,length:0,get event(){return I.getEvent()},eventDetail(){return this.event.detail},eventTarget(){return this.event.target}},getEvent:()=>V.get(),setEvent(e){V.set(e)}});class _{constructor(e,t,s){this.index=e,this.removed=t,this.addedCount=s}adjustTo(e){let t=this.index;const s=e.length;return t>s?t=s-this.addedCount:t<0&&(t=s+this.removed.length+t-this.addedCount),this.index=t<0?0:t,this}}class R{constructor(e){this.sorted=e}}const z=Object.freeze({reset:1,splice:2,optimized:3}),L=new _(0,l,0);L.reset=!0;const F=[L];function H(e,t,s,i,n,r){let o=0,a=0;const c=Math.min(s-t,r-n);if(0===t&&0===n&&(o=function(e,t,s){for(let i=0;i<s;++i)if(e[i]!==t[i])return i;return s}(e,i,c)),s===e.length&&r===i.length&&(a=function(e,t,s){let i=e.length,n=t.length,r=0;for(;r<s&&e[--i]===t[--n];)r++;return r}(e,i,c-o)),n+=o,r-=a,(s-=a)-(t+=o)==0&&r-n==0)return l;if(t===s){const e=new _(t,[],0);for(;n<r;)e.removed.push(i[n++]);return[e]}if(n===r)return[new _(t,[],s-t)];const h=function(e){let t=e.length-1,s=e[0].length-1,i=e[t][s];const n=[];for(;t>0||s>0;){if(0===t){n.push(2),s--;continue}if(0===s){n.push(3),t--;continue}const r=e[t-1][s-1],o=e[t-1][s],a=e[t][s-1];let l;l=o<a?o<r?o:r:a<r?a:r,l===r?(r===i?n.push(0):(n.push(1),i=r),t--,s--):l===o?(n.push(3),t--,i=o):(n.push(2),s--,i=a)}return n.reverse()}(function(e,t,s,i,n,r){const o=r-n+1,a=s-t+1,l=new Array(o);let c,h;for(let e=0;e<o;++e)l[e]=new Array(a),l[e][0]=e;for(let e=0;e<a;++e)l[0][e]=e;for(let s=1;s<o;++s)for(let r=1;r<a;++r)e[t+r-1]===i[n+s-1]?l[s][r]=l[s-1][r-1]:(c=l[s-1][r]+1,h=l[s][r-1]+1,l[s][r]=c<h?c:h);return l}(e,t,s,i,n,r)),d=[];let u,f=t,p=n;for(let e=0;e<h.length;++e)switch(h[e]){case 0:void 0!==u&&(d.push(u),u=void 0),f++,p++;break;case 1:void 0===u&&(u=new _(f,[],0)),u.addedCount++,f++,u.removed.push(i[p]),p++;break;case 2:void 0===u&&(u=new _(f,[],0)),u.addedCount++,f++;break;case 3:void 0===u&&(u=new _(f,[],0)),u.removed.push(i[p]),p++}return void 0!==u&&d.push(u),d}function P(e,t){let s=!1,i=0;for(let l=0;l<t.length;l++){const c=t[l];if(c.index+=i,s)continue;const h=(n=e.index,r=e.index+e.removed.length,o=c.index,a=c.index+c.addedCount,r<o||a<n?-1:r===o||a===n?0:n<o?r<a?r-o:a-o:a<r?a-n:r-n);if(h>=0){t.splice(l,1),l--,i-=c.addedCount-c.removed.length,e.addedCount+=c.addedCount-h;const n=e.removed.length+c.removed.length-h;if(e.addedCount||n){let t=c.removed;if(e.index<c.index){const s=e.removed.slice(0,c.index-e.index);s.push(...t),t=s}if(e.index+e.removed.length>c.index+c.addedCount){const s=e.removed.slice(c.index+c.addedCount-e.index);t.push(...s)}e.removed=t,c.index<e.index&&(e.index=c.index)}else s=!0}else if(e.index<c.index){s=!0,t.splice(l,0,e),l++;const n=e.addedCount-e.removed.length;c.index+=n,i+=n}}var n,r,o,a;s||t.push(e)}let D=Object.freeze({support:z.optimized,normalize:(e,t,s)=>void 0===e?void 0===s?l:function(e,t){let s=[];const i=[];for(let e=0,s=t.length;e<s;e++)P(t[e],i);for(let t=0,n=i.length;t<n;++t){const n=i[t];1!==n.addedCount||1!==n.removed.length?s=s.concat(H(e,n.index,n.index+n.addedCount,n.removed,0,n.removed.length)):n.removed[0]!==e[n.index]&&s.push(n)}return s}(t,s):F,pop(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new _(e.length,[r],0)),r},push(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new _(e.length-i.length,[],i.length).adjustTo(e)),n},reverse(e,t,s,i){const n=s.apply(e,i);e.sorted++;const r=[];for(let t=e.length-1;t>=0;t--)r.push(t);return t.addSort(new R(r)),n},shift(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new _(0,[r],0)),r},sort(e,t,s,i){const n=new Map;for(let t=0,s=e.length;t<s;++t){const s=n.get(e[t])||[];n.set(e[t],[...s,t])}const r=s.apply(e,i);e.sorted++;const o=[];for(let t=0,s=e.length;t<s;++t){const s=n.get(e[t]);o.push(s[0]),n.set(e[t],s.splice(1))}return t.addSort(new R(o)),r},splice(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new _(+i[0],n,i.length>2?i.length-2:0).adjustTo(e)),n},unshift(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new _(0,[],i.length).adjustTo(e)),n}});const U=Object.freeze({reset:F,setDefaultStrategy(e){D=e}});function Q(e,t,s,i=!0){Reflect.defineProperty(e,t,{value:s,enumerable:!1,writable:i})}class q extends N{constructor(e){super(e),this.oldCollection=void 0,this.splices=void 0,this.sorts=void 0,this.needsQueue=!0,this._strategy=null,this._lengthObserver=void 0,this._sortObserver=void 0,this.call=this.flush,Q(e,"$fastController",this)}get strategy(){return this._strategy}set strategy(e){this._strategy=e}get lengthObserver(){let e=this._lengthObserver;if(void 0===e){const t=this.subject;this._lengthObserver=e={length:t.length,handleChange(){this.length!==t.length&&(this.length=t.length,A.notify(e,"length"))}},this.subscribe(e)}return e}get sortObserver(){let e=this._sortObserver;if(void 0===e){const t=this.subject;this._sortObserver=e={sorted:t.sorted,handleChange(){this.sorted!==t.sorted&&(this.sorted=t.sorted,A.notify(e,"sorted"))}},this.subscribe(e)}return e}subscribe(e){this.flush(),super.subscribe(e)}addSplice(e){void 0===this.splices?this.splices=[e]:this.splices.push(e),this.enqueue()}addSort(e){void 0===this.sorts?this.sorts=[e]:this.sorts.push(e),this.enqueue()}reset(e){this.oldCollection=e,this.enqueue()}flush(){var e;const t=this.splices,s=this.sorts,i=this.oldCollection;void 0===t&&void 0===i&&void 0===s||(this.needsQueue=!0,this.splices=void 0,this.sorts=void 0,this.oldCollection=void 0,void 0!==s?this.notify(s):this.notify((null!==(e=this._strategy)&&void 0!==e?e:D).normalize(i,this.subject,t)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,O.enqueue(this))}}let W=!1;const X=Object.freeze({sorted:0,enable(){if(W)return;W=!0,A.setArrayObserverFactory((e=>new q(e)));const e=Array.prototype;e.$fastPatch||(Q(e,"$fastPatch",1),Q(e,"sorted",0),[e.pop,e.push,e.reverse,e.shift,e.sort,e.splice,e.unshift].forEach((t=>{e[t.name]=function(...e){var s;const i=this.$fastController;return void 0===i?t.apply(this,e):(null!==(s=i.strategy)&&void 0!==s?s:D)[t.name](this,i,t,e)}})))}});function J(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(X.enable(),t=A.getNotifier(e)),A.track(t.lengthObserver,"length"),e.length}function G(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(X.enable(),t=A.getNotifier(e)),A.track(t.sortObserver,"sorted"),e.sorted}class K{constructor(e,t,s=!1){this.evaluate=e,this.policy=t,this.isVolatile=s}}class Y extends K{createObserver(e){return A.binding(this.evaluate,e,this.isVolatile)}}function Z(e,t,s=A.isVolatileBinding(e)){return new Y(e,t,s)}function ee(e,t){const s=new Y(e);return s.options=t,s}class te extends K{createObserver(){return this}bind(e){return this.evaluate(e.source,e.context)}}function se(e,t){return new te(e,t)}function ie(e){return i(e)?Z(e):e instanceof K?e:se((()=>e))}let ne;function re(e){return e.map((e=>e instanceof oe?re(e.styles):[e])).reduce(((e,t)=>e.concat(t)),[])}d(te);class oe{constructor(e){this.styles=e,this.targets=new WeakSet,this._strategy=null,this.behaviors=e.map((e=>e instanceof oe?e.behaviors:null)).reduce(((e,t)=>null===t?e:null===e?t:e.concat(t)),null)}get strategy(){return null===this._strategy&&this.withStrategy(ne),this._strategy}addStylesTo(e){this.strategy.addStylesTo(e),this.targets.add(e)}removeStylesFrom(e){this.strategy.removeStylesFrom(e),this.targets.delete(e)}isAttachedTo(e){return this.targets.has(e)}withBehaviors(...e){return this.behaviors=null===this.behaviors?e:this.behaviors.concat(e),this}withStrategy(e){return this._strategy=new e(re(this.styles)),this}static setDefaultStrategy(e){ne=e}static normalize(e){return void 0===e?void 0:Array.isArray(e)?new oe(e):e instanceof oe?e:new oe([e])}}oe.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;const ae=c(),le=Object.freeze({getForInstance:ae.getForInstance,getByType:ae.getByType,define:e=>(ae.register({type:e}),e)});function ce(){return function(e){le.define(e)}}function he(e,t,s){t.source.style.setProperty(e.targetAspect,s.bind(t))}class de{constructor(e,t){this.dataBinding=e,this.targetAspect=t}createCSS(e){return e(this),`var(${this.targetAspect})`}addedCallback(e){var t;const s=e.source;if(!s.$cssBindings){s.$cssBindings=new Map;const e=s.setAttribute;s.setAttribute=(t,i)=>{e.call(s,t,i),"style"===t&&s.$cssBindings.forEach(((e,t)=>he(t,e.controller,e.observer)))}}const i=null!==(t=e[this.targetAspect])&&void 0!==t?t:e[this.targetAspect]=this.dataBinding.createObserver(this,this);i.controller=e,e.source.$cssBindings.set(this,{controller:e,observer:i})}connectedCallback(e){he(this,e,e[this.targetAspect])}removedCallback(e){e.source.$cssBindings&&e.source.$cssBindings.delete(this)}handleChange(e,t){he(this,t.controller,t)}}le.define(de);const ue=`${Math.random().toString(36).substring(2,8)}`;let fe=0;const pe=()=>`--v${ue}${++fe}`;function ge(e,t){const s=[];let n="";const r=[],o=e=>{r.push(e)};for(let r=0,a=e.length-1;r<a;++r){n+=e[r];let a=t[r];i(a)?a=new de(Z(a),pe()).createCSS(o):a instanceof K?a=new de(a,pe()).createCSS(o):void 0!==le.getForInstance(a)&&(a=a.createCSS(o)),a instanceof oe||a instanceof CSSStyleSheet?(""!==n.trim()&&(s.push(n),n=""),s.push(a)):n+=a}return n+=e[e.length-1],""!==n.trim()&&s.push(n),{styles:s,behaviors:r}}const be=(e,...t)=>{const{styles:s,behaviors:i}=ge(e,t),n=new oe(s);return i.length?n.withBehaviors(...i):n};class ve{constructor(e,t){this.behaviors=t,this.css="";const s=e.reduce(((e,t)=>(n(t)?this.css+=t:e.push(t),e)),[]);s.length&&(this.styles=new oe(s))}createCSS(e){return this.behaviors.forEach(e),this.styles&&e(this),this.css}addedCallback(e){e.addStyles(this.styles)}removedCallback(e){e.removeStyles(this.styles)}}le.define(ve),be.partial=(e,...t)=>{const{styles:s,behaviors:i}=ge(e,t);return new ve(s,i)};const me=/fe-b\$\$start\$\$(\d+)\$\$(.+)\$\$fe-b/,ye=/fe-b\$\$end\$\$(\d+)\$\$(.+)\$\$fe-b/,we=/fe-repeat\$\$start\$\$(\d+)\$\$fe-repeat/,Se=/fe-repeat\$\$end\$\$(\d+)\$\$fe-repeat/,Ce=/^(?:.{0,1000})fe-eb\$\$start\$\$(.+?)\$\$fe-eb/,xe=/fe-eb\$\$end\$\$(.{0,1000})\$\$fe-eb(?:.{0,1000})$/;function Be(e){return e&&e.nodeType===Node.COMMENT_NODE}const $e=Object.freeze({attributeMarkerName:"data-fe-b",attributeBindingSeparator:" ",contentBindingStartMarker:(e,t)=>`fe-b$$start$$${e}$$${t}$$fe-b`,contentBindingEndMarker:(e,t)=>`fe-b$$end$$${e}$$${t}$$fe-b`,repeatStartMarker:e=>`fe-repeat$$start$$${e}$$fe-repeat`,repeatEndMarker:e=>`fe-repeat$$end$$${e}$$fe-repeat`,isContentBindingStartMarker:e=>me.test(e),isContentBindingEndMarker:e=>ye.test(e),isRepeatViewStartMarker:e=>we.test(e),isRepeatViewEndMarker:e=>Se.test(e),isElementBoundaryStartMarker:e=>Be(e)&&Ce.test(e.data.trim()),isElementBoundaryEndMarker:e=>Be(e)&&xe.test(e.data),parseAttributeBinding(e){const t=e.getAttribute(this.attributeMarkerName);return null===t?t:t.split(this.attributeBindingSeparator).map((e=>parseInt(e)))},parseContentBindingStartMarker:e=>Ne(me,e),parseContentBindingEndMarker:e=>Ne(ye,e),parseRepeatStartMarker:e=>Te(we,e),parseRepeatEndMarker:e=>Te(Se,e),parseElementBoundaryStartMarker:e=>Oe(Ce,e.trim()),parseElementBoundaryEndMarker:e=>Oe(xe,e)});function Te(e,t){const s=e.exec(t);return null===s?s:parseInt(s[1])}function Oe(e,t){const s=e.exec(t);return null===s?s:s[1]}function Ne(e,t){const s=e.exec(t);return null===s?s:[parseInt(s[1]),s[2]]}const ke=Symbol.for("fe-hydration");function Ee(e){return e[ke]===ke}const Ae=`fast-${Math.random().toString(36).substring(2,8)}`,Me=`${Ae}{`,je=`}${Ae}`,Ve=je.length;let Ie=0;const _e=()=>`${Ae}-${++Ie}`,Re=Object.freeze({interpolation:e=>`${Me}${e}${je}`,attribute:e=>`${_e()}="${Me}${e}${je}"`,comment:e=>`\x3c!--${Me}${e}${je}--\x3e`}),ze=Object.freeze({parse(e,t){const s=e.split(Me);if(1===s.length)return null;const i=[];for(let e=0,n=s.length;e<n;++e){const n=s[e],r=n.indexOf(je);let o;if(-1===r)o=n;else{const e=n.substring(0,r);i.push(t[e]),o=n.substring(r+Ve)}""!==o&&i.push(o)}return i}}),Le=c(),Fe=Object.freeze({getForInstance:Le.getForInstance,getByType:Le.getByType,define:(e,t)=>((t=t||{}).type=e,Le.register(t),e),assignAspect(e,t){if(t)switch(e.sourceAspect=t,t[0]){case":":e.targetAspect=t.substring(1),e.aspectType="classList"===e.targetAspect?u.tokenList:u.property;break;case"?":e.targetAspect=t.substring(1),e.aspectType=u.booleanAttribute;break;case"@":e.targetAspect=t.substring(1),e.aspectType=u.event;break;default:e.targetAspect=t,e.aspectType=u.attribute}else e.aspectType=u.content}});function He(e){return function(t){Fe.define(t,e)}}class Pe{constructor(e){this.options=e}createHTML(e){return Re.attribute(e(this))}createBehavior(){return this}}d(Pe);class De extends Error{constructor(e,t,s){super(e),this.factories=t,this.node=s}}function Ue(e){return e.nodeType===Node.COMMENT_NODE}function Qe(e){return e.nodeType===Node.TEXT_NODE}function qe(e,t){const s=document.createRange();return s.setStart(e,0),s.setEnd(t,Ue(t)||Qe(t)?t.data.length:t.childNodes.length),s}function We(e,t,s){const i=$e.parseAttributeBinding(e);if(null!==i){for(const n of i){if(!t[n])throw new De(`HydrationView was unable to successfully target factory on ${e.nodeName} inside ${e.getRootNode().host.nodeName}. This likely indicates a template mismatch between SSR rendering and hydration.`,t,e);Je(t[n],e,s)}e.removeAttribute($e.attributeMarkerName)}}function Xe(e,t,s,i,n){if($e.isElementBoundaryStartMarker(e))!function(e,t){const s=$e.parseElementBoundaryStartMarker(e.data);let i=t.nextSibling();for(;null!==i;){if(Ue(i)){const e=$e.parseElementBoundaryEndMarker(i.data);if(e&&e===s)break}i=t.nextSibling()}}(e,t);else if($e.isContentBindingStartMarker(e.data)){const r=$e.parseContentBindingStartMarker(e.data);if(null===r)return;const[o,a]=r,l=s[o],c=[];let h=t.nextSibling();e.data="";const d=h;for(;null!==h;){if(Ue(h)){const e=$e.parseContentBindingEndMarker(h.data);if(e&&e[1]===a)break}c.push(h),h=t.nextSibling()}if(null===h){const t=e.getRootNode();throw new Error(`Error hydrating Comment node inside "${function(e){return e instanceof DocumentFragment&&"mode"in e}(t)?t.host.nodeName:t.nodeName}".`)}if(h.data="",1===c.length&&Qe(c[0]))Je(l,c[0],i);else{h!==d&&null!==h.previousSibling&&(n[l.targetNodeId]={first:d,last:h.previousSibling});Je(l,h.parentNode.insertBefore(document.createTextNode(""),h),i)}}}function Je(e,t,s){if(void 0===e.targetNodeId)throw new Error("Factory could not be target to the node");s[e.targetNodeId]=t}var Ge;function Ke(e,t){const s=e.parentNode;let i,n=e;for(;n!==t;){if(i=n.nextSibling,!i)throw new Error(`Unmatched first/last child inside "${t.getRootNode().host.nodeName}".`);s.removeChild(n),n=i}s.removeChild(t)}class Ye{constructor(){this.index=0,this.length=0}get event(){return I.getEvent()}get isEven(){return this.index%2==0}get isOdd(){return this.index%2!=0}get isFirst(){return 0===this.index}get isInMiddle(){return!this.isFirst&&!this.isLast}get isLast(){return this.index===this.length-1}eventDetail(){return this.event.detail}eventTarget(){return this.event.target}}class Ze extends Ye{constructor(e,t,s){super(),this.fragment=e,this.factories=t,this.targets=s,this.behaviors=null,this.unbindables=[],this.source=null,this.isBound=!1,this.sourceLifetime=E.unknown,this.context=this,this.firstChild=e.firstChild,this.lastChild=e.lastChild}appendTo(e){e.appendChild(this.fragment)}insertBefore(e){if(this.fragment.hasChildNodes())e.parentNode.insertBefore(this.fragment,e);else{const t=this.lastChild;if(e.previousSibling===t)return;const s=e.parentNode;let i,n=this.firstChild;for(;n!==t;)i=n.nextSibling,s.insertBefore(n,e),n=i;s.insertBefore(t,e)}}remove(){const e=this.fragment,t=this.lastChild;let s,i=this.firstChild;for(;i!==t;)s=i.nextSibling,e.appendChild(i),i=s;e.appendChild(t)}dispose(){Ke(this.firstChild,this.lastChild),this.unbind()}onUnbind(e){this.unbindables.push(e)}bind(e,t=this){if(this.source===e)return;let s=this.behaviors;if(null===s){this.source=e,this.context=t,this.behaviors=s=new Array(this.factories.length);const i=this.factories;for(let e=0,t=i.length;e<t;++e){const t=i[e].createBehavior();t.bind(this),s[e]=t}}else{null!==this.source&&this.evaluateUnbindables(),this.isBound=!1,this.source=e,this.context=t;for(let e=0,t=s.length;e<t;++e)s[e].bind(this)}this.isBound=!0}unbind(){this.isBound&&null!==this.source&&(this.evaluateUnbindables(),this.source=null,this.context=this,this.isBound=!1)}evaluateUnbindables(){const e=this.unbindables;for(let t=0,s=e.length;t<s;++t)e[t].unbind(this);e.length=0}static disposeContiguousBatch(e){if(0!==e.length){Ke(e[0].firstChild,e[e.length-1].lastChild);for(let t=0,s=e.length;t<s;++t)e[t].unbind()}}}d(Ze),A.defineProperty(Ze.prototype,"index"),A.defineProperty(Ze.prototype,"length");const et="unhydrated",tt="hydrating",st="hydrated";class it extends Error{constructor(e,t,s,i){super(e),this.factory=t,this.fragment=s,this.templateString=i}}Ge=ke,d(class extends Ye{constructor(e,t,s,i){super(),this.firstChild=e,this.lastChild=t,this.sourceTemplate=s,this.hostBindingTarget=i,this[Ge]=ke,this.context=this,this.source=null,this.isBound=!1,this.sourceLifetime=E.unknown,this.unbindables=[],this.fragment=null,this.behaviors=null,this._hydrationStage=et,this._bindingViewBoundaries={},this._targets={},this.factories=s.compile().factories}get hydrationStage(){return this._hydrationStage}get targets(){return this._targets}get bindingViewBoundaries(){return this._bindingViewBoundaries}insertBefore(e){if(null!==this.fragment)if(this.fragment.hasChildNodes())e.parentNode.insertBefore(this.fragment,e);else{const t=this.lastChild;if(e.previousSibling===t)return;const s=e.parentNode;let i,n=this.firstChild;for(;n!==t;)i=n.nextSibling,s.insertBefore(n,e),n=i;s.insertBefore(t,e)}}appendTo(e){null!==this.fragment&&e.appendChild(this.fragment)}remove(){const e=this.fragment||(this.fragment=document.createDocumentFragment()),t=this.lastChild;let s,i=this.firstChild;for(;i!==t;){if(s=i.nextSibling,!s)throw new Error(`Unmatched first/last child inside "${t.getRootNode().host.nodeName}".`);e.appendChild(i),i=s}e.appendChild(t)}bind(e,t=this){var s,i;if(this.hydrationStage!==st&&(this._hydrationStage=tt),this.source===e)return;let n=this.behaviors;if(null===n){this.source=e,this.context=t;try{const{targets:e,boundaries:t}=function(e,t,s){const i=qe(e,t),n=i.commonAncestorContainer,r=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_COMMENT+NodeFilter.SHOW_TEXT,{acceptNode:e=>0===i.comparePoint(e,0)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}),o={},a={};let l=r.currentNode=e;for(;null!==l;){switch(l.nodeType){case Node.ELEMENT_NODE:We(l,s,o);break;case Node.COMMENT_NODE:Xe(l,r,s,o,a)}l=r.nextNode()}return i.detach(),{targets:o,boundaries:a}}(this.firstChild,this.lastChild,this.factories);this._targets=e,this._bindingViewBoundaries=t}catch(e){if(e instanceof De){let t=this.sourceTemplate.html;"string"!=typeof t&&(t=t.innerHTML),e.templateString=t}throw e}this.behaviors=n=new Array(this.factories.length);const r=this.factories;for(let e=0,t=r.length;e<t;++e){const t=r[e];if("h"===t.targetNodeId&&this.hostBindingTarget&&Je(t,this.hostBindingTarget,this._targets),!(t.targetNodeId in this.targets)){let e=this.sourceTemplate.html;throw"string"!=typeof e&&(e=e.innerHTML),new it(`HydrationView was unable to successfully target bindings inside "${null===(i=(null===(s=this.firstChild)||void 0===s?void 0:s.getRootNode()).host)||void 0===i?void 0:i.nodeName}".`,t,qe(this.firstChild,this.lastChild).cloneContents(),e)}{const s=t.createBehavior();s.bind(this),n[e]=s}}}else{null!==this.source&&this.evaluateUnbindables(),this.isBound=!1,this.source=e,this.context=t;for(let e=0,t=n.length;e<t;++e)n[e].bind(this)}this.isBound=!0,this._hydrationStage=st}unbind(){this.isBound&&null!==this.source&&(this.evaluateUnbindables(),this.source=null,this.context=this,this.isBound=!1)}dispose(){Ke(this.firstChild,this.lastChild),this.unbind()}onUnbind(e){this.unbindables.push(e)}evaluateUnbindables(){const e=this.unbindables;for(let t=0,s=e.length;t<s;++t)e[t].unbind(this);e.length=0}});const nt={[u.attribute]:v.setAttribute,[u.booleanAttribute]:v.setBooleanAttribute,[u.property]:(e,t,s)=>e[t]=s,[u.content]:function(e,t,s,i){if(null==s&&(s=""),function(e){return void 0!==e.create}(s)){e.textContent="";let t=e.$fastView;if(void 0===t)if(Ee(i)&&Ee(s)&&void 0!==i.bindingViewBoundaries[this.targetNodeId]&&i.hydrationStage!==st){const e=i.bindingViewBoundaries[this.targetNodeId];t=s.hydrate(e.first,e.last)}else t=s.create();else e.$fastTemplate!==s&&(t.isComposed&&(t.remove(),t.unbind()),t=s.create());t.isComposed?t.needsBindOnly&&(t.needsBindOnly=!1,t.bind(i.source,i.context)):(t.isComposed=!0,t.bind(i.source,i.context),t.insertBefore(e),e.$fastView=t,e.$fastTemplate=s)}else{const t=e.$fastView;void 0!==t&&t.isComposed&&(t.isComposed=!1,t.remove(),t.needsBindOnly?t.needsBindOnly=!1:t.unbind()),e.textContent=s}},[u.tokenList]:function(e,t,s){var i;const n=`${this.id}-t`,r=null!==(i=e[n])&&void 0!==i?i:e[n]={v:0,cv:Object.create(null)},o=r.cv;let a=r.v;const l=e[t];if(null!=s&&s.length){const e=s.split(/\s+/);for(let t=0,s=e.length;t<s;++t){const s=e[t];""!==s&&(o[s]=a,l.add(s))}}if(r.v=a+1,0!==a){a-=1;for(const e in o)o[e]===a&&l.remove(e)}},[u.event]:()=>{}};class rt{constructor(e){this.dataBinding=e,this.updateTarget=null,this.aspectType=u.content}createHTML(e){return Re.interpolation(e(this))}createBehavior(){var e;if(null===this.updateTarget){const t=nt[this.aspectType],s=null!==(e=this.dataBinding.policy)&&void 0!==e?e:this.policy;if(!t)throw a.error(1205);this.data=`${this.id}-d`,this.updateTarget=s.protect(this.targetTagName,this.aspectType,this.targetAspect,t)}return this}bind(e){var t;const s=e.targets[this.targetNodeId],i=Ee(e)&&e.hydrationStage&&e.hydrationStage!==st;switch(this.aspectType){case u.event:s[this.data]=e,s.addEventListener(this.targetAspect,this,this.dataBinding.options);break;case u.content:e.onUnbind(this);default:const n=null!==(t=s[this.data])&&void 0!==t?t:s[this.data]=this.dataBinding.createObserver(this,this);if(n.target=s,n.controller=e,i&&(this.aspectType===u.attribute||this.aspectType===u.booleanAttribute)){n.bind(e);break}this.updateTarget(s,this.targetAspect,n.bind(e),e)}}unbind(e){const t=e.targets[this.targetNodeId].$fastView;void 0!==t&&t.isComposed&&(t.unbind(),t.needsBindOnly=!0)}handleEvent(e){const t=e.currentTarget[this.data];if(t.isBound){I.setEvent(e);const s=this.dataBinding.evaluate(t.source,t.context);I.setEvent(null),!0!==s&&e.preventDefault()}}handleChange(e,t){const s=t.target,i=t.controller;this.updateTarget(s,this.targetAspect,t.bind(i),i)}}Fe.define(rt,{aspected:!0});const ot=(e,t)=>`${e}.${t}`,at={},lt={index:0,node:null};function ct(e){e.startsWith("fast-")||a.warn(1204,{name:e})}const ht=new Proxy(document.createElement("div"),{get(e,t){ct(t);const s=Reflect.get(e,t);return i(s)?s.bind(e):s},set:(e,t,s)=>(ct(t),Reflect.set(e,t,s))});class dt{constructor(e,t,s){this.fragment=e,this.directives=t,this.policy=s,this.proto=null,this.nodeIds=new Set,this.descriptors={},this.factories=[]}addFactory(e,t,s,i,n){var r,o;this.nodeIds.has(s)||(this.nodeIds.add(s),this.addTargetDescriptor(t,s,i)),e.id=null!==(r=e.id)&&void 0!==r?r:_e(),e.targetNodeId=s,e.targetTagName=n,e.policy=null!==(o=e.policy)&&void 0!==o?o:this.policy,this.factories.push(e)}freeze(){return this.proto=Object.create(null,this.descriptors),this}addTargetDescriptor(e,t,s){const i=this.descriptors;if("r"===t||"h"===t||i[t])return;if(!i[e]){const t=e.lastIndexOf("."),s=e.substring(0,t),i=parseInt(e.substring(t+1));this.addTargetDescriptor(s,e,i)}let n=at[t];if(!n){const i=`_${t}`;at[t]=n={get(){var t;return null!==(t=this[i])&&void 0!==t?t:this[i]=this[e].childNodes[s]}}}i[t]=n}createView(e){const t=this.fragment.cloneNode(!0),s=Object.create(this.proto);s.r=t,s.h=null!=e?e:ht;for(const e of this.nodeIds)s[e];return new Ze(t,this.factories,s)}}function ut(e,t,s,i,n,r=!1){const o=s.attributes,a=e.directives;for(let l=0,c=o.length;l<c;++l){const h=o[l],d=h.value,u=ze.parse(d,a);let f=null;null===u?r&&(f=new rt(se((()=>d),e.policy)),Fe.assignAspect(f,h.name)):f=bt.aggregate(u,e.policy),null!==f&&(s.removeAttributeNode(h),l--,c--,e.addFactory(f,t,i,n,s.tagName))}}function ft(e,t,s){let i=0,n=t.firstChild;for(;n;){const t=pt(e,s,n,i);n=t.node,i=t.index}}function pt(e,t,s,i){const r=ot(t,i);switch(s.nodeType){case 1:ut(e,t,s,r,i),ft(e,s,r);break;case 3:return function(e,t,s,i,r){const o=ze.parse(t.textContent,e.directives);if(null===o)return lt.node=t.nextSibling,lt.index=r+1,lt;let a,l=a=t;for(let t=0,c=o.length;t<c;++t){const c=o[t];0!==t&&(r++,i=ot(s,r),a=l.parentNode.insertBefore(document.createTextNode(""),l.nextSibling)),n(c)?a.textContent=c:(a.textContent=" ",Fe.assignAspect(c),e.addFactory(c,s,i,r,null)),l=a}return lt.index=r+1,lt.node=l.nextSibling,lt}(e,s,t,r,i);case 8:const o=ze.parse(s.data,e.directives);null!==o&&e.addFactory(bt.aggregate(o),t,r,i,null)}return lt.index=i+1,lt.node=s.nextSibling,lt}const gt="TEMPLATE",bt={compile(e,t,s=v.policy){let i;if(n(e)){i=document.createElement(gt),i.innerHTML=s.createHTML(e);const t=i.content.firstElementChild;null!==t&&t.tagName===gt&&(i=t)}else i=e;i.content.firstChild||i.content.lastChild||i.content.appendChild(document.createComment(""));const r=document.adoptNode(i.content),o=new dt(r,t,s);var a,l;return ut(o,"",i,"h",0,!0),a=r.firstChild,l=t,(a&&8==a.nodeType&&null!==ze.parse(a.data,l)||1===r.childNodes.length&&Object.keys(t).length>0)&&r.insertBefore(document.createComment(""),r.firstChild),ft(o,r,"r"),lt.node=null,o.freeze()},setDefaultStrategy(e){this.compile=e},aggregate(e,t=v.policy){if(1===e.length)return e[0];let s,i,r=!1;const o=e.length,a=e.map((e=>n(e)?()=>e:(s=e.sourceAspect||s,r=r||e.dataBinding.isVolatile,i=i||e.dataBinding.policy,e.dataBinding.evaluate))),l=new rt(Z(((e,t)=>{let s="";for(let i=0;i<o;++i)s+=a[i](e,t);return s}),null!=i?i:t,r));return Fe.assignAspect(l,s),l}},vt=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/,mt=Object.create(null);class yt{constructor(e,t=mt){this.html=e,this.factories=t}createHTML(e){const t=this.factories;for(const s in t)e(t[s]);return this.html}}function wt(e,t,s,i=Fe.getForInstance(e)){if(i.aspected){const s=vt.exec(t);null!==s&&Fe.assignAspect(e,s[2])}return e.createHTML(s)}yt.empty=new yt(""),Fe.define(yt);class St{constructor(e,t={},s){this.policy=s,this.result=null,this.html=e,this.factories=t}compile(){return null===this.result&&(this.result=bt.compile(this.html,this.factories,this.policy)),this.result}create(e){return this.compile().createView(e)}inline(){return new yt(n(this.html)?this.html:this.html.innerHTML,this.factories)}withPolicy(e){if(this.result)throw a.error(1208);if(this.policy)throw a.error(1207);return this.policy=e,this}render(e,t,s){const i=this.create(s);return i.bind(e),i.appendTo(t),i}static create(e,t,s){let n="";const r=Object.create(null),o=e=>{var t;const s=null!==(t=e.id)&&void 0!==t?t:e.id=_e();return r[s]=e,s};for(let s=0,r=e.length-1;s<r;++s){const r=e[s];let a,l=t[s];if(n+=r,i(l))l=new rt(Z(l));else if(l instanceof K)l=new rt(l);else if(!(a=Fe.getForInstance(l))){const e=l;l=new rt(se((()=>e)))}n+=wt(l,r,o,a)}return new St(n+e[e.length-1],r,s)}}d(St);const Ct=(e,...t)=>{if(Array.isArray(e)&&Array.isArray(e.raw))return St.create(e,t);throw a.error(1206)};Ct.partial=e=>new yt(e);class xt extends Pe{bind(e){e.source[this.options]=e.targets[this.targetNodeId]}}Fe.define(xt);const Bt=e=>new xt(e),$t=()=>null;function Tt(e){return void 0===e?$t:i(e)?e:()=>e}function Ot(e,t,s){const n=i(e)?e:()=>e,r=Tt(t),o=Tt(s);return(e,t)=>n(e,t)?r(e,t):o(e,t)}const Nt=Object.freeze({positioning:!1,recycle:!0});function kt(e,t,s,i){e.context.parent=i.source,e.context.parentContext=i.context,e.bind(t[s])}function Et(e,t,s,i){e.context.parent=i.source,e.context.parentContext=i.context,e.context.length=t.length,e.context.index=s,e.bind(t[s])}function At(e){return e.nodeType===Node.COMMENT_NODE}class Mt extends Error{constructor(e,t){super(e),this.propertyBag=t}}class jt{constructor(e){this.directive=e,this.items=null,this.itemsObserver=null,this.bindView=kt,this.views=[],this.itemsBindingObserver=e.dataBinding.createObserver(this,e),this.templateBindingObserver=e.templateBinding.createObserver(this,e),e.options.positioning&&(this.bindView=Et)}bind(e){this.location=e.targets[this.directive.targetNodeId],this.controller=e,this.items=this.itemsBindingObserver.bind(e),this.template=this.templateBindingObserver.bind(e),this.observeItems(!0),Ee(this.template)&&Ee(e)&&e.hydrationStage!==st?this.hydrateViews(this.template):this.refreshAllViews(),e.onUnbind(this)}unbind(){null!==this.itemsObserver&&this.itemsObserver.unsubscribe(this),this.unbindAllViews()}handleChange(e,t){if(t===this.itemsBindingObserver)this.items=this.itemsBindingObserver.bind(this.controller),this.observeItems(),this.refreshAllViews();else if(t===this.templateBindingObserver)this.template=this.templateBindingObserver.bind(this.controller),this.refreshAllViews(!0);else{if(!t[0])return;t[0].reset?this.refreshAllViews():t[0].sorted?this.updateSortedViews(t):this.updateSplicedViews(t)}}observeItems(e=!1){if(!this.items)return void(this.items=l);const t=this.itemsObserver,s=this.itemsObserver=A.getNotifier(this.items),i=t!==s;i&&null!==t&&t.unsubscribe(this),(i||e)&&s.subscribe(this)}updateSortedViews(e){const t=this.views;for(let s=0,i=e.length;s<i;++s){const i=e[s].sorted.slice(),n=i.slice().sort();for(let e=0,s=i.length;e<s;++e){const s=i.find((t=>i[e]===n[t]));if(s!==e){const i=n.splice(s,1);n.splice(e,0,...i);const r=t[e],o=r?r.firstChild:this.location;t[s].remove(),t[s].insertBefore(o);const a=t.splice(s,1);t.splice(e,0,...a)}}}}updateSplicedViews(e){const t=this.views,s=this.bindView,i=this.items,n=this.template,r=this.controller,o=this.directive.options.recycle,a=[];let l=0,c=0;for(let h=0,d=e.length;h<d;++h){const d=e[h],u=d.removed;let f=0,p=d.index;const g=p+d.addedCount,b=t.splice(d.index,u.length),v=c=a.length+b.length;for(;p<g;++p){const e=t[p],h=e?e.firstChild:this.location;let d;o&&c>0?(f<=v&&b.length>0?(d=b[f],f++):(d=a[l],l++),c--):d=n.create(),t.splice(p,0,d),s(d,i,p,r),d.insertBefore(h)}b[f]&&a.push(...b.slice(f))}for(let e=l,t=a.length;e<t;++e)a[e].dispose();if(this.directive.options.positioning)for(let e=0,s=t.length;e<s;++e){const i=t[e].context;i.length=s,i.index=e}}refreshAllViews(e=!1){const t=this.items,s=this.template,i=this.location,n=this.bindView,r=this.controller;let o=t.length,a=this.views,l=a.length;if(0!==o&&!e&&this.directive.options.recycle||(Ze.disposeContiguousBatch(a),l=0),0===l){this.views=a=new Array(o);for(let e=0;e<o;++e){const o=s.create();n(o,t,e,r),a[e]=o,o.insertBefore(i)}}else{let e=0;for(;e<o;++e)if(e<l){const i=a[e];if(!i){const t=new XMLSerializer;throw new Mt(`View is null or undefined inside "${this.location.getRootNode().host.nodeName}".`,{index:e,hydrationStage:this.controller.hydrationStage,itemsLength:o,viewsState:a.map((e=>e?"hydrated":"empty")),viewTemplateString:t.serializeToString(s.create().fragment),rootNodeContent:t.serializeToString(this.location.getRootNode())})}n(i,t,e,r)}else{const o=s.create();n(o,t,e,r),a.push(o),o.insertBefore(i)}const c=a.splice(e,l-e);for(e=0,o=c.length;e<o;++e)c[e].dispose()}}unbindAllViews(){const e=this.views;for(let t=0,s=e.length;t<s;++t){const s=e[t];if(!s){const s=new XMLSerializer;throw new Mt(`View is null or undefined inside "${this.location.getRootNode().host.nodeName}".`,{index:t,hydrationStage:this.controller.hydrationStage,viewsState:e.map((e=>e?"hydrated":"empty")),rootNodeContent:s.serializeToString(this.location.getRootNode())})}s.unbind()}}hydrateViews(e){if(!this.items)return;this.views=new Array(this.items.length);let t=this.location.previousSibling;for(;null!==t;){if(!At(t)){t=t.previousSibling;continue}const s=$e.parseRepeatEndMarker(t.data);if(null===s){t=t.previousSibling;continue}t.data="";const i=t.previousSibling;if(!i)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": end should never be null.`);let n=i,r=0;for(;null!==n;){if(At(n))if($e.isRepeatViewEndMarker(n.data))r++;else if($e.isRepeatViewStartMarker(n.data)){if(!r){if($e.parseRepeatStartMarker(n.data)!==s)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": Mismatched start and end markers.`);n.data="",t=n.previousSibling,n=n.nextSibling;const r=e.hydrate(n,i);this.views[s]=r,this.bindView(r,this.items,s,this.controller);break}r--}n=n.previousSibling}if(!n)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": start should never be null.`)}}}class Vt{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.options=s,X.enable()}createHTML(e){return Re.comment(e(this))}createBehavior(){return new jt(this)}}function It(e,t,s=Nt){const i=ie(e),n=ie(t);return new Vt(i,n,Object.assign(Object.assign({},Nt),s))}Fe.define(Vt);const _t=e=>1===e.nodeType,Rt=e=>e?t=>1===t.nodeType&&t.matches(e):_t;class zt extends Pe{get id(){return this._id}set id(e){this._id=e,this._controllerProperty=`${e}-c`}bind(e){const t=e.targets[this.targetNodeId];t[this._controllerProperty]=e,this.updateTarget(e.source,this.computeNodes(t)),this.observe(t),e.onUnbind(this)}unbind(e){const t=e.targets[this.targetNodeId];this.updateTarget(e.source,l),this.disconnect(t),t[this._controllerProperty]=null}getSource(e){return e[this._controllerProperty].source}updateTarget(e,t){e[this.options.property]=t}computeNodes(e){let t=this.getNodes(e);return"filter"in this.options&&(t=t.filter(this.options.filter)),t}}const Lt="slotchange";class Ft extends zt{observe(e){e.addEventListener(Lt,this)}disconnect(e){e.removeEventListener(Lt,this)}getNodes(e){return e.assignedNodes(this.options)}handleEvent(e){const t=e.currentTarget;this.updateTarget(this.getSource(t),this.computeNodes(t))}}function Ht(e){return n(e)&&(e={property:e}),new Ft(e)}Fe.define(Ft);class Pt extends zt{constructor(e){super(e),this.observerProperty=Symbol(),this.handleEvent=(e,t)=>{const s=t.target;this.updateTarget(this.getSource(s),this.computeNodes(s))},e.childList=!0}observe(e){let t=e[this.observerProperty];t||(t=new MutationObserver(this.handleEvent),t.toJSON=r,e[this.observerProperty]=t),t.target=e,t.observe(e,this.options)}disconnect(e){const t=e[this.observerProperty];t.target=null,t.disconnect()}getNodes(e){return"selector"in this.options?Array.from(e.querySelectorAll(this.options.selector)):Array.from(e.childNodes)}}function Dt(e){return n(e)&&(e={property:e}),new Pt(e)}Fe.define(Pt);const Ut="boolean",Qt="reflect",qt=Object.freeze({locate:h()}),Wt={toView:e=>e?"true":"false",fromView:e=>!(null==e||"false"===e||!1===e||0===e)},Xt={toView:e=>"boolean"==typeof e?e.toString():"",fromView:e=>[null,void 0,void 0].includes(e)?null:Wt.fromView(e)};function Jt(e){if(null==e)return null;const t=1*e;return isNaN(t)?null:t}const Gt={toView(e){const t=Jt(e);return t?t.toString():t},fromView:Jt};class Kt{constructor(e,t,s=t.toLowerCase(),i=Qt,n){this.guards=new Set,this.Owner=e,this.name=t,this.attribute=s,this.mode=i,this.converter=n,this.fieldName=`_${t}`,this.callbackName=`${t}Changed`,this.hasCallback=this.callbackName in e.prototype,i===Ut&&void 0===n&&(this.converter=Wt)}setValue(e,t){const s=e[this.fieldName],i=this.converter;void 0!==i&&(t=i.fromView(t)),s!==t&&(e[this.fieldName]=t,this.tryReflectToAttribute(e),this.hasCallback&&e[this.callbackName](s,t),e.$fastController.notify(this.name))}getValue(e){return A.track(e,this.name),e[this.fieldName]}onAttributeChangedCallback(e,t){this.guards.has(e)||(this.guards.add(e),this.setValue(e,t),this.guards.delete(e))}tryReflectToAttribute(e){const t=this.mode,s=this.guards;s.has(e)||"fromView"===t||O.enqueue((()=>{s.add(e);const i=e[this.fieldName];switch(t){case Qt:const t=this.converter;v.setAttribute(e,this.attribute,void 0!==t?t.toView(i):i);break;case Ut:v.setBooleanAttribute(e,this.attribute,i)}s.delete(e)}))}static collect(e,...t){const s=[];t.push(qt.locate(e));for(let i=0,r=t.length;i<r;++i){const r=t[i];if(void 0!==r)for(let t=0,i=r.length;t<i;++t){const i=r[t];n(i)?s.push(new Kt(e,i)):s.push(new Kt(e,i.property,i.attribute,i.mode,i.converter))}}return s}}function Yt(e,t){let s;function i(e,t){arguments.length>1&&(s.property=t),qt.locate(e.constructor).push(s)}return arguments.length>1?(s={},void i(e,t)):(s=void 0===e?{}:e,i)}const Zt={mode:"open"},es={},ts=new Set,ss=a.getById(s.elementRegistry,(()=>c()));class is{constructor(e,t=e.definition){var s;this.platformDefined=!1,n(t)&&(t={name:t}),this.type=e,this.name=t.name,this.template=t.template,this.registry=null!==(s=t.registry)&&void 0!==s?s:customElements;const i=e.prototype,r=Kt.collect(e,t.attributes),o=new Array(r.length),a={},l={};for(let e=0,t=r.length;e<t;++e){const t=r[e];o[e]=t.attribute,a[t.name]=t,l[t.attribute]=t,A.defineProperty(i,t)}Reflect.defineProperty(e,"observedAttributes",{value:o,enumerable:!0}),this.attributes=r,this.propertyLookup=a,this.attributeLookup=l,this.shadowOptions=void 0===t.shadowOptions?Zt:null===t.shadowOptions?void 0:Object.assign(Object.assign({},Zt),t.shadowOptions),this.elementOptions=void 0===t.elementOptions?es:Object.assign(Object.assign({},es),t.elementOptions),this.styles=oe.normalize(t.styles),ss.register(this)}get isDefined(){return this.platformDefined}define(e=this.registry){const t=this.type;return e.get(this.name)||(this.platformDefined=!0,e.define(this.name,t,this.elementOptions)),this}static compose(e,t){return ts.has(e)||ss.getByType(e)?new is(class extends e{},t):new is(e,t)}static registerBaseType(e){ts.add(e)}}is.getByType=ss.getByType,is.getForInstance=ss.getForInstance,A.defineProperty(is.prototype,"template");class ns{constructor(e){this.directive=e,this.location=null,this.controller=null,this.view=null,this.data=null,this.dataBindingObserver=e.dataBinding.createObserver(this,e),this.templateBindingObserver=e.templateBinding.createObserver(this,e)}bind(e){if(this.location=e.targets[this.directive.targetNodeId],this.controller=e,this.data=this.dataBindingObserver.bind(e),this.template=this.templateBindingObserver.bind(e),e.onUnbind(this),Ee(this.template)&&Ee(e)&&e.hydrationStage!==st&&!this.view){const t=e.bindingViewBoundaries[this.directive.targetNodeId];t&&(this.view=this.template.hydrate(t.first,t.last),this.bindView(this.view))}else this.refreshView()}unbind(e){const t=this.view;null!==t&&t.isComposed&&(t.unbind(),t.needsBindOnly=!0)}handleChange(e,t){t===this.dataBindingObserver&&(this.data=this.dataBindingObserver.bind(this.controller)),(this.directive.templateBindingDependsOnData||t===this.templateBindingObserver)&&(this.template=this.templateBindingObserver.bind(this.controller)),this.refreshView()}bindView(e){e.isComposed?e.needsBindOnly&&(e.needsBindOnly=!1,e.bind(this.data)):(e.isComposed=!0,e.bind(this.data),e.insertBefore(this.location),e.$fastTemplate=this.template)}refreshView(){let e=this.view;const t=this.template;null===e?(this.view=e=t.create(),this.view.context.parent=this.controller.source,this.view.context.parentContext=this.controller.context):e.$fastTemplate!==t&&(e.isComposed&&(e.remove(),e.unbind()),this.view=e=t.create(),this.view.context.parent=this.controller.source,this.view.context.parentContext=this.controller.context),this.bindView(e)}}class rs{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.templateBindingDependsOnData=s}createHTML(e){return Re.comment(e(this))}createBehavior(){return new ns(this)}}Fe.define(rs);const os=new Map,as={":model":e=>e},ls=Symbol("RenderInstruction"),cs="default-view",hs=Ct`
1
+ let e;const t="fast-kernel";try{if(document.currentScript)e=document.currentScript.getAttribute(t);else{const s=document.getElementsByTagName("script");e=s[s.length-1].getAttribute(t)}}catch(t){e="isolate"}let s;switch(e){case"share":s=Object.freeze({updateQueue:1,observable:2,contextEvent:3,elementRegistry:4});break;case"share-v2":s=Object.freeze({updateQueue:1.2,observable:2.2,contextEvent:3.2,elementRegistry:4.2});break;default:const e=`-${Math.random().toString(36).substring(2,8)}`;s=Object.freeze({updateQueue:`1.2${e}`,observable:`2.2${e}`,contextEvent:`3.2${e}`,elementRegistry:`4.2${e}`})}const i=e=>"function"==typeof e,n=e=>"string"==typeof e,r=()=>{};!function(){if("undefined"==typeof globalThis)if("undefined"!=typeof global)global.globalThis=global;else if("undefined"!=typeof self)self.globalThis=self;else if("undefined"!=typeof window)window.globalThis=window;else{const e=new Function("return this")();e.globalThis=e}}();const o={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},o));const a=globalThis.FAST;if(void 0===a.getById){const e=Object.create(null);Reflect.defineProperty(a,"getById",Object.assign({value(t,s){let i=e[t];return void 0===i&&(i=s?e[t]=s():null),i}},o))}void 0===a.error&&Object.assign(a,{warn(){},error:e=>new Error(`Error ${e}`),addMessages(){}});const l=Object.freeze([]);function h(){const e=new Map;return Object.freeze({register:t=>!e.has(t.type)&&(e.set(t.type,t),!0),getByType:t=>e.get(t),getForInstance(t){if(null!=t)return e.get(t.constructor)}})}function c(){const e=new WeakMap;return function(t){let s=e.get(t);if(void 0===s){let i=Reflect.getPrototypeOf(t);for(;void 0===s&&null!==i;)s=e.get(i),i=Reflect.getPrototypeOf(i);s=void 0===s?[]:s.slice(0),e.set(t,s)}return s}}function d(e){e.prototype.toJSON=r}const u=Object.freeze({none:0,attribute:1,booleanAttribute:2,property:3,content:4,tokenList:5,event:6}),f=e=>e,p=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:f}):{createHTML:f};let g=Object.freeze({createHTML:e=>p.createHTML(e),protect:(e,t,s,i)=>i});const b=g,v=Object.freeze({get policy(){return g},setPolicy(e){if(g!==b)throw a.error(1201);g=e},setAttribute(e,t,s){null==s?e.removeAttribute(t):e.setAttribute(t,s)},setBooleanAttribute(e,t,s){s?e.setAttribute(t,""):e.removeAttribute(t)}});function m(e,t,s,i){return(e,t,s,...r)=>{n(s)&&(s=s.replace(/(javascript:|vbscript:|data:)/,"")),i(e,t,s,...r)}}function y(e,t,s,i){throw a.error(1209,{aspectName:s,tagName:null!=e?e:"text"})}const w={onabort:y,onauxclick:y,onbeforeinput:y,onbeforematch:y,onblur:y,oncancel:y,oncanplay:y,oncanplaythrough:y,onchange:y,onclick:y,onclose:y,oncontextlost:y,oncontextmenu:y,oncontextrestored:y,oncopy:y,oncuechange:y,oncut:y,ondblclick:y,ondrag:y,ondragend:y,ondragenter:y,ondragleave:y,ondragover:y,ondragstart:y,ondrop:y,ondurationchange:y,onemptied:y,onended:y,onerror:y,onfocus:y,onformdata:y,oninput:y,oninvalid:y,onkeydown:y,onkeypress:y,onkeyup:y,onload:y,onloadeddata:y,onloadedmetadata:y,onloadstart:y,onmousedown:y,onmouseenter:y,onmouseleave:y,onmousemove:y,onmouseout:y,onmouseover:y,onmouseup:y,onpaste:y,onpause:y,onplay:y,onplaying:y,onprogress:y,onratechange:y,onreset:y,onresize:y,onscroll:y,onsecuritypolicyviolation:y,onseeked:y,onseeking:y,onselect:y,onslotchange:y,onstalled:y,onsubmit:y,onsuspend:y,ontimeupdate:y,ontoggle:y,onvolumechange:y,onwaiting:y,onwebkitanimationend:y,onwebkitanimationiteration:y,onwebkitanimationstart:y,onwebkittransitionend:y,onwheel:y},S={elements:{a:{[u.attribute]:{href:m},[u.property]:{href:m}},area:{[u.attribute]:{href:m},[u.property]:{href:m}},button:{[u.attribute]:{formaction:m},[u.property]:{formAction:m}},embed:{[u.attribute]:{src:y},[u.property]:{src:y}},form:{[u.attribute]:{action:m},[u.property]:{action:m}},frame:{[u.attribute]:{src:m},[u.property]:{src:m}},iframe:{[u.attribute]:{src:m},[u.property]:{src:m,srcdoc:y}},input:{[u.attribute]:{formaction:m},[u.property]:{formAction:m}},link:{[u.attribute]:{href:y},[u.property]:{href:y}},object:{[u.attribute]:{codebase:y,data:y},[u.property]:{codeBase:y,data:y}},script:{[u.attribute]:{src:y,text:y},[u.property]:{src:y,text:y,innerText:y,textContent:y}},style:{[u.property]:{innerText:y,textContent:y}}},aspects:{[u.attribute]:Object.assign({},w),[u.property]:Object.assign({innerHTML:y},w),[u.event]:Object.assign({},w)}};function C(e,t){const s={};for(const i in t){const n=e[i],r=t[i];switch(n){case null:break;case void 0:s[i]=r;break;default:s[i]=n}}for(const t in e)t in s||(s[t]=e[t]);return Object.freeze(s)}function x(e,t){const s={};for(const i in t){const n=e[i],r=t[i];switch(n){case null:break;case void 0:s[i]=C(r,{});break;default:s[i]=C(n,r)}}for(const t in e)t in s||(s[t]=C(e[t],{}));return Object.freeze(s)}function B(e,t){const s={};for(const i in t){const n=e[i],r=t[i];switch(n){case null:break;case void 0:s[i]=x(n,{});break;default:s[i]=x(n,r)}}for(const t in e)t in s||(s[t]=x(e[t],{}));return Object.freeze(s)}function O(e,t,s,i,n){const r=e[s];if(r){const e=r[i];if(e)return e(t,s,i,n)}}const $=Object.freeze({create(e={}){var t,s;const i=null!==(t=e.trustedType)&&void 0!==t?t:function(){const e=e=>e;return globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:e}):{createHTML:e}}(),n=(r=null!==(s=e.guards)&&void 0!==s?s:{},o=S,Object.freeze({elements:r.elements?B(r.elements,o.elements):o.elements,aspects:r.aspects?x(r.aspects,o.aspects):o.aspects}));var r,o;return Object.freeze({createHTML:e=>i.createHTML(e),protect(e,t,s,i){var r;const o=(null!=e?e:"").toLowerCase(),a=n.elements[o];if(a){const n=O(a,e,t,s,i);if(n)return n}return null!==(r=O(n.aspects,e,t,s,i))&&void 0!==r?r:i}})}}),T=a.getById(s.updateQueue,(()=>{const e=[],t=[],s=globalThis.requestAnimationFrame;let i=!0;function n(){if(t.length)throw t.shift()}function r(s){try{s.call()}catch(s){if(!i)throw e.length=0,s;t.push(s),setTimeout(n,0)}}function o(){let t=0;for(;t<e.length;)if(r(e[t]),t++,t>1024){for(let s=0,i=e.length-t;s<i;s++)e[s]=e[s+t];e.length-=t,t=0}e.length=0}function a(t){e.push(t),e.length<2&&(i?s(o):o())}return Object.freeze({enqueue:a,next:()=>new Promise(a),process:o,setMode:e=>i=e})}));class N{constructor(e,t){this.sub1=void 0,this.sub2=void 0,this.spillover=void 0,this.subject=e,this.sub1=t}has(e){return void 0===this.spillover?this.sub1===e||this.sub2===e:-1!==this.spillover.indexOf(e)}subscribe(e){const t=this.spillover;if(void 0===t){if(this.has(e))return;if(void 0===this.sub1)return void(this.sub1=e);if(void 0===this.sub2)return void(this.sub2=e);this.spillover=[this.sub1,this.sub2,e],this.sub1=void 0,this.sub2=void 0}else{-1===t.indexOf(e)&&t.push(e)}}unsubscribe(e){const t=this.spillover;if(void 0===t)this.sub1===e?this.sub1=void 0:this.sub2===e&&(this.sub2=void 0);else{const s=t.indexOf(e);-1!==s&&t.splice(s,1)}}notify(e){const t=this.spillover,s=this.subject;if(void 0===t){const t=this.sub1,i=this.sub2;void 0!==t&&t.handleChange(s,e),void 0!==i&&i.handleChange(s,e)}else for(let i=0,n=t.length;i<n;++i)t[i].handleChange(s,e)}}class k{constructor(e){this.subscribers={},this.subjectSubscribers=null,this.subject=e}notify(e){var t,s;null===(t=this.subscribers[e])||void 0===t||t.notify(e),null===(s=this.subjectSubscribers)||void 0===s||s.notify(e)}subscribe(e,t){var s,i;let n;n=t?null!==(s=this.subscribers[t])&&void 0!==s?s:this.subscribers[t]=new N(this.subject):null!==(i=this.subjectSubscribers)&&void 0!==i?i:this.subjectSubscribers=new N(this.subject),n.subscribe(e)}unsubscribe(e,t){var s,i;t?null===(s=this.subscribers[t])||void 0===s||s.unsubscribe(e):null===(i=this.subjectSubscribers)||void 0===i||i.unsubscribe(e)}}const E=Object.freeze({unknown:void 0,coupled:1}),A=a.getById(s.observable,(()=>{const e=T.enqueue,t=/(:|&&|\|\||if|\?\.)/,s=new WeakMap;let r,o=e=>{throw a.error(1101)};function l(e){var t;let i=null!==(t=e.$fastController)&&void 0!==t?t:s.get(e);return void 0===i&&(Array.isArray(e)?i=o(e):s.set(e,i=new k(e))),i}const h=c();class u{constructor(e){this.name=e,this.field=`_${e}`,this.callback=`${e}Changed`}getValue(e){return void 0!==r&&r.watch(e,this.name),e[this.field]}setValue(e,t){const s=this.field,n=e[s];if(n!==t){e[s]=t;const r=e[this.callback];i(r)&&r.call(e,n,t),l(e).notify(this.name)}}}class f extends N{constructor(e,t,s=!1){super(e,t),this.expression=e,this.isVolatileBinding=s,this.needsRefresh=!0,this.needsQueue=!0,this.isAsync=!0,this.first=this,this.last=null,this.propertySource=void 0,this.propertyName=void 0,this.notifier=void 0,this.next=void 0}setMode(e){this.isAsync=this.needsQueue=e}bind(e){this.controller=e;const t=this.observe(e.source,e.context);return!e.isBound&&this.requiresUnbind(e)&&e.onUnbind(this),t}requiresUnbind(e){return e.sourceLifetime!==E.coupled||this.first!==this.last||this.first.propertySource!==e.source}unbind(e){this.dispose()}observe(e,t){this.needsRefresh&&null!==this.last&&this.dispose();const s=r;let i;r=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;try{i=this.expression(e,t)}finally{r=s}return i}disconnect(){this.dispose()}dispose(){if(null!==this.last){let e=this.first;for(;void 0!==e;)e.notifier.unsubscribe(this,e.propertyName),e=e.next;this.last=null,this.needsRefresh=this.needsQueue=this.isAsync}}watch(e,t){const s=this.last,i=l(e),n=null===s?this.first:{};if(n.propertySource=e,n.propertyName=t,n.notifier=i,i.subscribe(this,t),null!==s){if(!this.needsRefresh){let t;r=void 0,t=s.propertySource[s.propertyName],r=this,e===t&&(this.needsRefresh=!0)}s.next=n}this.last=n}handleChange(){this.needsQueue?(this.needsQueue=!1,e(this)):this.isAsync||this.call()}call(){null!==this.last&&(this.needsQueue=this.isAsync,this.notify(this))}*records(){let e=this.first;for(;void 0!==e;)yield e,e=e.next}}return d(f),Object.freeze({setArrayObserverFactory(e){o=e},getNotifier:l,track(e,t){r&&r.watch(e,t)},trackVolatile(){r&&(r.needsRefresh=!0)},notify(e,t){l(e).notify(t)},defineProperty(e,t){n(t)&&(t=new u(t)),h(e).push(t),Reflect.defineProperty(e,t.name,{enumerable:!0,get(){return t.getValue(this)},set(e){t.setValue(this,e)}})},getAccessors:h,binding(e,t,s=this.isVolatileBinding(e)){return new f(e,t,s)},isVolatileBinding:e=>t.test(e.toString())})}));function M(e,t){A.defineProperty(e,t)}function j(e,t,s){return Object.assign({},s,{get(){return A.trackVolatile(),s.get.apply(this)}})}const V=a.getById(s.contextEvent,(()=>{let e=null;return{get:()=>e,set(t){e=t}}})),_=Object.freeze({default:{index:0,length:0,get event(){return _.getEvent()},eventDetail(){return this.event.detail},eventTarget(){return this.event.target}},getEvent:()=>V.get(),setEvent(e){V.set(e)}});class I{constructor(e,t,s){this.index=e,this.removed=t,this.addedCount=s}adjustTo(e){let t=this.index;const s=e.length;return t>s?t=s-this.addedCount:t<0&&(t=s+this.removed.length+t-this.addedCount),this.index=t<0?0:t,this}}class R{constructor(e){this.sorted=e}}const z=Object.freeze({reset:1,splice:2,optimized:3}),L=new I(0,l,0);L.reset=!0;const F=[L];function P(e,t,s,i,n,r){let o=0,a=0;const h=Math.min(s-t,r-n);if(0===t&&0===n&&(o=function(e,t,s){for(let i=0;i<s;++i)if(e[i]!==t[i])return i;return s}(e,i,h)),s===e.length&&r===i.length&&(a=function(e,t,s){let i=e.length,n=t.length,r=0;for(;r<s&&e[--i]===t[--n];)r++;return r}(e,i,h-o)),n+=o,r-=a,(s-=a)-(t+=o)==0&&r-n==0)return l;if(t===s){const e=new I(t,[],0);for(;n<r;)e.removed.push(i[n++]);return[e]}if(n===r)return[new I(t,[],s-t)];const c=function(e){let t=e.length-1,s=e[0].length-1,i=e[t][s];const n=[];for(;t>0||s>0;){if(0===t){n.push(2),s--;continue}if(0===s){n.push(3),t--;continue}const r=e[t-1][s-1],o=e[t-1][s],a=e[t][s-1];let l;l=o<a?o<r?o:r:a<r?a:r,l===r?(r===i?n.push(0):(n.push(1),i=r),t--,s--):l===o?(n.push(3),t--,i=o):(n.push(2),s--,i=a)}return n.reverse()}(function(e,t,s,i,n,r){const o=r-n+1,a=s-t+1,l=new Array(o);let h,c;for(let e=0;e<o;++e)l[e]=new Array(a),l[e][0]=e;for(let e=0;e<a;++e)l[0][e]=e;for(let s=1;s<o;++s)for(let r=1;r<a;++r)e[t+r-1]===i[n+s-1]?l[s][r]=l[s-1][r-1]:(h=l[s-1][r]+1,c=l[s][r-1]+1,l[s][r]=h<c?h:c);return l}(e,t,s,i,n,r)),d=[];let u,f=t,p=n;for(let e=0;e<c.length;++e)switch(c[e]){case 0:void 0!==u&&(d.push(u),u=void 0),f++,p++;break;case 1:void 0===u&&(u=new I(f,[],0)),u.addedCount++,f++,u.removed.push(i[p]),p++;break;case 2:void 0===u&&(u=new I(f,[],0)),u.addedCount++,f++;break;case 3:void 0===u&&(u=new I(f,[],0)),u.removed.push(i[p]),p++}return void 0!==u&&d.push(u),d}function H(e,t){let s=!1,i=0;for(let l=0;l<t.length;l++){const h=t[l];if(h.index+=i,s)continue;const c=(n=e.index,r=e.index+e.removed.length,o=h.index,a=h.index+h.addedCount,r<o||a<n?-1:r===o||a===n?0:n<o?r<a?r-o:a-o:a<r?a-n:r-n);if(c>=0){t.splice(l,1),l--,i-=h.addedCount-h.removed.length,e.addedCount+=h.addedCount-c;const n=e.removed.length+h.removed.length-c;if(e.addedCount||n){let t=h.removed;if(e.index<h.index){const s=e.removed.slice(0,h.index-e.index);s.push(...t),t=s}if(e.index+e.removed.length>h.index+h.addedCount){const s=e.removed.slice(h.index+h.addedCount-e.index);t.push(...s)}e.removed=t,h.index<e.index&&(e.index=h.index)}else s=!0}else if(e.index<h.index){s=!0,t.splice(l,0,e),l++;const n=e.addedCount-e.removed.length;h.index+=n,i+=n}}var n,r,o,a;s||t.push(e)}let D=Object.freeze({support:z.optimized,normalize:(e,t,s)=>void 0===e?void 0===s?l:function(e,t){let s=[];const i=[];for(let e=0,s=t.length;e<s;e++)H(t[e],i);for(let t=0,n=i.length;t<n;++t){const n=i[t];1!==n.addedCount||1!==n.removed.length?s=s.concat(P(e,n.index,n.index+n.addedCount,n.removed,0,n.removed.length)):n.removed[0]!==e[n.index]&&s.push(n)}return s}(t,s):F,pop(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new I(e.length,[r],0)),r},push(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new I(e.length-i.length,[],i.length).adjustTo(e)),n},reverse(e,t,s,i){const n=s.apply(e,i);e.sorted++;const r=[];for(let t=e.length-1;t>=0;t--)r.push(t);return t.addSort(new R(r)),n},shift(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new I(0,[r],0)),r},sort(e,t,s,i){const n=new Map;for(let t=0,s=e.length;t<s;++t){const s=n.get(e[t])||[];n.set(e[t],[...s,t])}const r=s.apply(e,i);e.sorted++;const o=[];for(let t=0,s=e.length;t<s;++t){const s=n.get(e[t]);o.push(s[0]),n.set(e[t],s.splice(1))}return t.addSort(new R(o)),r},splice(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new I(+i[0],n,i.length>2?i.length-2:0).adjustTo(e)),n},unshift(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new I(0,[],i.length).adjustTo(e)),n}});const U=Object.freeze({reset:F,setDefaultStrategy(e){D=e}});function Q(e,t,s,i=!0){Reflect.defineProperty(e,t,{value:s,enumerable:!1,writable:i})}class q extends N{constructor(e){super(e),this.oldCollection=void 0,this.splices=void 0,this.sorts=void 0,this.needsQueue=!0,this._strategy=null,this._lengthObserver=void 0,this._sortObserver=void 0,this.call=this.flush,Q(e,"$fastController",this)}get strategy(){return this._strategy}set strategy(e){this._strategy=e}get lengthObserver(){let e=this._lengthObserver;if(void 0===e){const t=this.subject;this._lengthObserver=e={length:t.length,handleChange(){this.length!==t.length&&(this.length=t.length,A.notify(e,"length"))}},this.subscribe(e)}return e}get sortObserver(){let e=this._sortObserver;if(void 0===e){const t=this.subject;this._sortObserver=e={sorted:t.sorted,handleChange(){this.sorted!==t.sorted&&(this.sorted=t.sorted,A.notify(e,"sorted"))}},this.subscribe(e)}return e}subscribe(e){this.flush(),super.subscribe(e)}addSplice(e){void 0===this.splices?this.splices=[e]:this.splices.push(e),this.enqueue()}addSort(e){void 0===this.sorts?this.sorts=[e]:this.sorts.push(e),this.enqueue()}reset(e){this.oldCollection=e,this.enqueue()}flush(){var e;const t=this.splices,s=this.sorts,i=this.oldCollection;void 0===t&&void 0===i&&void 0===s||(this.needsQueue=!0,this.splices=void 0,this.sorts=void 0,this.oldCollection=void 0,void 0!==s?this.notify(s):this.notify((null!==(e=this._strategy)&&void 0!==e?e:D).normalize(i,this.subject,t)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,T.enqueue(this))}}let W=!1;const X=Object.freeze({sorted:0,enable(){if(W)return;W=!0,A.setArrayObserverFactory((e=>new q(e)));const e=Array.prototype;e.$fastPatch||(Q(e,"$fastPatch",1),Q(e,"sorted",0),[e.pop,e.push,e.reverse,e.shift,e.sort,e.splice,e.unshift].forEach((t=>{e[t.name]=function(...e){var s;const i=this.$fastController;return void 0===i?t.apply(this,e):(null!==(s=i.strategy)&&void 0!==s?s:D)[t.name](this,i,t,e)}})))}});function J(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(X.enable(),t=A.getNotifier(e)),A.track(t.lengthObserver,"length"),e.length}function G(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(X.enable(),t=A.getNotifier(e)),A.track(t.sortObserver,"sorted"),e.sorted}class K{constructor(e,t,s=!1){this.evaluate=e,this.policy=t,this.isVolatile=s}}class Y extends K{createObserver(e){return A.binding(this.evaluate,e,this.isVolatile)}}function Z(e,t,s=A.isVolatileBinding(e)){return new Y(e,t,s)}function ee(e,t){const s=new Y(e);return s.options=t,s}class te extends K{createObserver(){return this}bind(e){return this.evaluate(e.source,e.context)}}function se(e,t){return new te(e,t)}function ie(e){return i(e)?Z(e):e instanceof K?e:se((()=>e))}let ne;function re(e){return e.map((e=>e instanceof oe?re(e.styles):[e])).reduce(((e,t)=>e.concat(t)),[])}d(te);class oe{constructor(e){this.styles=e,this.targets=new WeakSet,this._strategy=null,this.behaviors=e.map((e=>e instanceof oe?e.behaviors:null)).reduce(((e,t)=>null===t?e:null===e?t:e.concat(t)),null)}get strategy(){return null===this._strategy&&this.withStrategy(ne),this._strategy}addStylesTo(e){this.strategy.addStylesTo(e),this.targets.add(e)}removeStylesFrom(e){this.strategy.removeStylesFrom(e),this.targets.delete(e)}isAttachedTo(e){return this.targets.has(e)}withBehaviors(...e){return this.behaviors=null===this.behaviors?e:this.behaviors.concat(e),this}withStrategy(e){return this._strategy=new e(re(this.styles)),this}static setDefaultStrategy(e){ne=e}static normalize(e){return void 0===e?void 0:Array.isArray(e)?new oe(e):e instanceof oe?e:new oe([e])}}oe.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;const ae=h(),le=Object.freeze({getForInstance:ae.getForInstance,getByType:ae.getByType,define:e=>(ae.register({type:e}),e)});function he(){return function(e){le.define(e)}}function ce(e,t,s){t.source.style.setProperty(e.targetAspect,s.bind(t))}class de{constructor(e,t){this.dataBinding=e,this.targetAspect=t}createCSS(e){return e(this),`var(${this.targetAspect})`}addedCallback(e){var t;const s=e.source;if(!s.$cssBindings){s.$cssBindings=new Map;const e=s.setAttribute;s.setAttribute=(t,i)=>{e.call(s,t,i),"style"===t&&s.$cssBindings.forEach(((e,t)=>ce(t,e.controller,e.observer)))}}const i=null!==(t=e[this.targetAspect])&&void 0!==t?t:e[this.targetAspect]=this.dataBinding.createObserver(this,this);i.controller=e,e.source.$cssBindings.set(this,{controller:e,observer:i})}connectedCallback(e){ce(this,e,e[this.targetAspect])}removedCallback(e){e.source.$cssBindings&&e.source.$cssBindings.delete(this)}handleChange(e,t){ce(this,t.controller,t)}}le.define(de);const ue=`${Math.random().toString(36).substring(2,8)}`;let fe=0;const pe=()=>`--v${ue}${++fe}`;function ge(e,t){const s=[];let n="";const r=[],o=e=>{r.push(e)};for(let r=0,a=e.length-1;r<a;++r){n+=e[r];let a=t[r];i(a)?a=new de(Z(a),pe()).createCSS(o):a instanceof K?a=new de(a,pe()).createCSS(o):void 0!==le.getForInstance(a)&&(a=a.createCSS(o)),a instanceof oe||a instanceof CSSStyleSheet?(""!==n.trim()&&(s.push(n),n=""),s.push(a)):n+=a}return n+=e[e.length-1],""!==n.trim()&&s.push(n),{styles:s,behaviors:r}}const be=(e,...t)=>{const{styles:s,behaviors:i}=ge(e,t),n=new oe(s);return i.length?n.withBehaviors(...i):n};class ve{constructor(e,t){this.behaviors=t,this.css="";const s=e.reduce(((e,t)=>(n(t)?this.css+=t:e.push(t),e)),[]);s.length&&(this.styles=new oe(s))}createCSS(e){return this.behaviors.forEach(e),this.styles&&e(this),this.css}addedCallback(e){e.addStyles(this.styles)}removedCallback(e){e.removeStyles(this.styles)}}le.define(ve),be.partial=(e,...t)=>{const{styles:s,behaviors:i}=ge(e,t);return new ve(s,i)};const me=/fe-b\$\$start\$\$(\d+)\$\$(.+)\$\$fe-b/,ye=/fe-b\$\$end\$\$(\d+)\$\$(.+)\$\$fe-b/,we=/fe-repeat\$\$start\$\$(\d+)\$\$fe-repeat/,Se=/fe-repeat\$\$end\$\$(\d+)\$\$fe-repeat/,Ce=/^(?:.{0,1000})fe-eb\$\$start\$\$(.+?)\$\$fe-eb/,xe=/fe-eb\$\$end\$\$(.{0,1000})\$\$fe-eb(?:.{0,1000})$/;function Be(e){return e&&e.nodeType===Node.COMMENT_NODE}const Oe=Object.freeze({attributeMarkerName:"data-fe-b",attributeBindingSeparator:" ",contentBindingStartMarker:(e,t)=>`fe-b$$start$$${e}$$${t}$$fe-b`,contentBindingEndMarker:(e,t)=>`fe-b$$end$$${e}$$${t}$$fe-b`,repeatStartMarker:e=>`fe-repeat$$start$$${e}$$fe-repeat`,repeatEndMarker:e=>`fe-repeat$$end$$${e}$$fe-repeat`,isContentBindingStartMarker:e=>me.test(e),isContentBindingEndMarker:e=>ye.test(e),isRepeatViewStartMarker:e=>we.test(e),isRepeatViewEndMarker:e=>Se.test(e),isElementBoundaryStartMarker:e=>Be(e)&&Ce.test(e.data.trim()),isElementBoundaryEndMarker:e=>Be(e)&&xe.test(e.data),parseAttributeBinding(e){const t=e.getAttribute(this.attributeMarkerName);return null===t?t:t.split(this.attributeBindingSeparator).map((e=>parseInt(e)))},parseEnumeratedAttributeBinding(e){const t=[];let s=0;for(;e.hasAttribute(`${this.attributeMarkerName}-${s}`);)t.push(s++);return 0===s?null:t},parseContentBindingStartMarker:e=>Ne(me,e),parseContentBindingEndMarker:e=>Ne(ye,e),parseRepeatStartMarker:e=>$e(we,e),parseRepeatEndMarker:e=>$e(Se,e),parseElementBoundaryStartMarker:e=>Te(Ce,e.trim()),parseElementBoundaryEndMarker:e=>Te(xe,e)});function $e(e,t){const s=e.exec(t);return null===s?s:parseInt(s[1])}function Te(e,t){const s=e.exec(t);return null===s?s:s[1]}function Ne(e,t){const s=e.exec(t);return null===s?s:[parseInt(s[1]),s[2]]}const ke=Symbol.for("fe-hydration");function Ee(e){return e[ke]===ke}const Ae=`fast-${Math.random().toString(36).substring(2,8)}`,Me=`${Ae}{`,je=`}${Ae}`,Ve=je.length;let _e=0;const Ie=()=>`${Ae}-${++_e}`,Re=Object.freeze({interpolation:e=>`${Me}${e}${je}`,attribute:e=>`${Ie()}="${Me}${e}${je}"`,comment:e=>`\x3c!--${Me}${e}${je}--\x3e`}),ze=Object.freeze({parse(e,t){const s=e.split(Me);if(1===s.length)return null;const i=[];for(let e=0,n=s.length;e<n;++e){const n=s[e],r=n.indexOf(je);let o;if(-1===r)o=n;else{const e=n.substring(0,r);i.push(t[e]),o=n.substring(r+Ve)}""!==o&&i.push(o)}return i}}),Le=h(),Fe=Object.freeze({getForInstance:Le.getForInstance,getByType:Le.getByType,define:(e,t)=>((t=t||{}).type=e,Le.register(t),e),assignAspect(e,t){if(t)switch(e.sourceAspect=t,t[0]){case":":e.targetAspect=t.substring(1),e.aspectType="classList"===e.targetAspect?u.tokenList:u.property;break;case"?":e.targetAspect=t.substring(1),e.aspectType=u.booleanAttribute;break;case"@":e.targetAspect=t.substring(1),e.aspectType=u.event;break;default:e.targetAspect=t,e.aspectType=u.attribute}else e.aspectType=u.content}});function Pe(e){return function(t){Fe.define(t,e)}}class He{constructor(e){this.options=e}createHTML(e){return Re.attribute(e(this))}createBehavior(){return this}}d(He);class De extends Error{constructor(e,t,s){super(e),this.factories=t,this.node=s}}function Ue(e){return e.nodeType===Node.COMMENT_NODE}function Qe(e){return e.nodeType===Node.TEXT_NODE}function qe(e,t){const s=document.createRange();return s.setStart(e,0),s.setEnd(t,Ue(t)||Qe(t)?t.data.length:t.childNodes.length),s}function We(e,t,s){var i;const n=null!==(i=Oe.parseAttributeBinding(e))&&void 0!==i?i:Oe.parseEnumeratedAttributeBinding(e);if(null!==n){for(const i of n){if(!t[i])throw new De(`HydrationView was unable to successfully target factory on ${e.nodeName} inside ${e.getRootNode().host.nodeName}. This likely indicates a template mismatch between SSR rendering and hydration.`,t,e);Je(t[i],e,s)}e.removeAttribute(Oe.attributeMarkerName)}}function Xe(e,t,s,i,n){if(Oe.isElementBoundaryStartMarker(e))!function(e,t){const s=Oe.parseElementBoundaryStartMarker(e.data);let i=t.nextSibling();for(;null!==i;){if(Ue(i)){const e=Oe.parseElementBoundaryEndMarker(i.data);if(e&&e===s)break}i=t.nextSibling()}}(e,t);else if(Oe.isContentBindingStartMarker(e.data)){const r=Oe.parseContentBindingStartMarker(e.data);if(null===r)return;const[o,a]=r,l=s[o],h=[];let c=t.nextSibling();e.data="";const d=c;for(;null!==c;){if(Ue(c)){const e=Oe.parseContentBindingEndMarker(c.data);if(e&&e[1]===a)break}h.push(c),c=t.nextSibling()}if(null===c){const t=e.getRootNode();throw new Error(`Error hydrating Comment node inside "${function(e){return e instanceof DocumentFragment&&"mode"in e}(t)?t.host.nodeName:t.nodeName}".`)}if(c.data="",1===h.length&&Qe(h[0]))Je(l,h[0],i);else{c!==d&&null!==c.previousSibling&&(n[l.targetNodeId]={first:d,last:c.previousSibling});Je(l,c.parentNode.insertBefore(document.createTextNode(""),c),i)}}}function Je(e,t,s){if(void 0===e.targetNodeId)throw new Error("Factory could not be target to the node");s[e.targetNodeId]=t}var Ge;function Ke(e,t){const s=e.parentNode;let i,n=e;for(;n!==t;){if(i=n.nextSibling,!i)throw new Error(`Unmatched first/last child inside "${t.getRootNode().host.nodeName}".`);s.removeChild(n),n=i}s.removeChild(t)}class Ye{constructor(){this.index=0,this.length=0}get event(){return _.getEvent()}get isEven(){return this.index%2==0}get isOdd(){return this.index%2!=0}get isFirst(){return 0===this.index}get isInMiddle(){return!this.isFirst&&!this.isLast}get isLast(){return this.index===this.length-1}eventDetail(){return this.event.detail}eventTarget(){return this.event.target}}class Ze extends Ye{constructor(e,t,s){super(),this.fragment=e,this.factories=t,this.targets=s,this.behaviors=null,this.unbindables=[],this.source=null,this.isBound=!1,this.sourceLifetime=E.unknown,this.context=this,this.firstChild=e.firstChild,this.lastChild=e.lastChild}appendTo(e){e.appendChild(this.fragment)}insertBefore(e){if(this.fragment.hasChildNodes())e.parentNode.insertBefore(this.fragment,e);else{const t=this.lastChild;if(e.previousSibling===t)return;const s=e.parentNode;let i,n=this.firstChild;for(;n!==t;)i=n.nextSibling,s.insertBefore(n,e),n=i;s.insertBefore(t,e)}}remove(){const e=this.fragment,t=this.lastChild;let s,i=this.firstChild;for(;i!==t;)s=i.nextSibling,e.appendChild(i),i=s;e.appendChild(t)}dispose(){Ke(this.firstChild,this.lastChild),this.unbind()}onUnbind(e){this.unbindables.push(e)}bind(e,t=this){if(this.source===e)return;let s=this.behaviors;if(null===s){this.source=e,this.context=t,this.behaviors=s=new Array(this.factories.length);const i=this.factories;for(let e=0,t=i.length;e<t;++e){const t=i[e].createBehavior();t.bind(this),s[e]=t}}else{null!==this.source&&this.evaluateUnbindables(),this.isBound=!1,this.source=e,this.context=t;for(let e=0,t=s.length;e<t;++e)s[e].bind(this)}this.isBound=!0}unbind(){this.isBound&&null!==this.source&&(this.evaluateUnbindables(),this.source=null,this.context=this,this.isBound=!1)}evaluateUnbindables(){const e=this.unbindables;for(let t=0,s=e.length;t<s;++t)e[t].unbind(this);e.length=0}static disposeContiguousBatch(e){if(0!==e.length){Ke(e[0].firstChild,e[e.length-1].lastChild);for(let t=0,s=e.length;t<s;++t)e[t].unbind()}}}d(Ze),A.defineProperty(Ze.prototype,"index"),A.defineProperty(Ze.prototype,"length");const et="unhydrated",tt="hydrating",st="hydrated";class it extends Error{constructor(e,t,s,i){super(e),this.factory=t,this.fragment=s,this.templateString=i}}Ge=ke,d(class extends Ye{constructor(e,t,s,i){super(),this.firstChild=e,this.lastChild=t,this.sourceTemplate=s,this.hostBindingTarget=i,this[Ge]=ke,this.context=this,this.source=null,this.isBound=!1,this.sourceLifetime=E.unknown,this.unbindables=[],this.fragment=null,this.behaviors=null,this._hydrationStage=et,this._bindingViewBoundaries={},this._targets={},this.factories=s.compile().factories}get hydrationStage(){return this._hydrationStage}get targets(){return this._targets}get bindingViewBoundaries(){return this._bindingViewBoundaries}insertBefore(e){if(null!==this.fragment)if(this.fragment.hasChildNodes())e.parentNode.insertBefore(this.fragment,e);else{const t=this.lastChild;if(e.previousSibling===t)return;const s=e.parentNode;let i,n=this.firstChild;for(;n!==t;)i=n.nextSibling,s.insertBefore(n,e),n=i;s.insertBefore(t,e)}}appendTo(e){null!==this.fragment&&e.appendChild(this.fragment)}remove(){const e=this.fragment||(this.fragment=document.createDocumentFragment()),t=this.lastChild;let s,i=this.firstChild;for(;i!==t;){if(s=i.nextSibling,!s)throw new Error(`Unmatched first/last child inside "${t.getRootNode().host.nodeName}".`);e.appendChild(i),i=s}e.appendChild(t)}bind(e,t=this){var s,i;if(this.hydrationStage!==st&&(this._hydrationStage=tt),this.source===e)return;let n=this.behaviors;if(null===n){this.source=e,this.context=t;try{const{targets:e,boundaries:t}=function(e,t,s){const i=qe(e,t),n=i.commonAncestorContainer,r=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_COMMENT+NodeFilter.SHOW_TEXT,{acceptNode:e=>0===i.comparePoint(e,0)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}),o={},a={};let l=r.currentNode=e;for(;null!==l;){switch(l.nodeType){case Node.ELEMENT_NODE:We(l,s,o);break;case Node.COMMENT_NODE:Xe(l,r,s,o,a)}l=r.nextNode()}return i.detach(),{targets:o,boundaries:a}}(this.firstChild,this.lastChild,this.factories);this._targets=e,this._bindingViewBoundaries=t}catch(e){if(e instanceof De){let t=this.sourceTemplate.html;"string"!=typeof t&&(t=t.innerHTML),e.templateString=t}throw e}this.behaviors=n=new Array(this.factories.length);const r=this.factories;for(let e=0,t=r.length;e<t;++e){const t=r[e];if("h"===t.targetNodeId&&this.hostBindingTarget&&Je(t,this.hostBindingTarget,this._targets),!(t.targetNodeId in this.targets)){let e=this.sourceTemplate.html;throw"string"!=typeof e&&(e=e.innerHTML),new it(`HydrationView was unable to successfully target bindings inside "${null===(i=(null===(s=this.firstChild)||void 0===s?void 0:s.getRootNode()).host)||void 0===i?void 0:i.nodeName}".`,t,qe(this.firstChild,this.lastChild).cloneContents(),e)}{const s=t.createBehavior();s.bind(this),n[e]=s}}}else{null!==this.source&&this.evaluateUnbindables(),this.isBound=!1,this.source=e,this.context=t;for(let e=0,t=n.length;e<t;++e)n[e].bind(this)}this.isBound=!0,this._hydrationStage=st}unbind(){this.isBound&&null!==this.source&&(this.evaluateUnbindables(),this.source=null,this.context=this,this.isBound=!1)}dispose(){Ke(this.firstChild,this.lastChild),this.unbind()}onUnbind(e){this.unbindables.push(e)}evaluateUnbindables(){const e=this.unbindables;for(let t=0,s=e.length;t<s;++t)e[t].unbind(this);e.length=0}});const nt={[u.attribute]:v.setAttribute,[u.booleanAttribute]:v.setBooleanAttribute,[u.property]:(e,t,s)=>e[t]=s,[u.content]:function(e,t,s,i){if(null==s&&(s=""),function(e){return void 0!==e.create}(s)){e.textContent="";let t=e.$fastView;if(void 0===t)if(Ee(i)&&Ee(s)&&void 0!==i.bindingViewBoundaries[this.targetNodeId]&&i.hydrationStage!==st){const e=i.bindingViewBoundaries[this.targetNodeId];t=s.hydrate(e.first,e.last)}else t=s.create();else e.$fastTemplate!==s&&(t.isComposed&&(t.remove(),t.unbind()),t=s.create());t.isComposed?t.needsBindOnly&&(t.needsBindOnly=!1,t.bind(i.source,i.context)):(t.isComposed=!0,t.bind(i.source,i.context),t.insertBefore(e),e.$fastView=t,e.$fastTemplate=s)}else{const t=e.$fastView;void 0!==t&&t.isComposed&&(t.isComposed=!1,t.remove(),t.needsBindOnly?t.needsBindOnly=!1:t.unbind()),e.textContent=s}},[u.tokenList]:function(e,t,s){var i;const n=`${this.id}-t`,r=null!==(i=e[n])&&void 0!==i?i:e[n]={v:0,cv:Object.create(null)},o=r.cv;let a=r.v;const l=e[t];if(null!=s&&s.length){const e=s.split(/\s+/);for(let t=0,s=e.length;t<s;++t){const s=e[t];""!==s&&(o[s]=a,l.add(s))}}if(r.v=a+1,0!==a){a-=1;for(const e in o)o[e]===a&&l.remove(e)}},[u.event]:()=>{}};class rt{constructor(e){this.dataBinding=e,this.updateTarget=null,this.aspectType=u.content}createHTML(e){return Re.interpolation(e(this))}createBehavior(){var e;if(null===this.updateTarget){const t=nt[this.aspectType],s=null!==(e=this.dataBinding.policy)&&void 0!==e?e:this.policy;if(!t)throw a.error(1205);this.data=`${this.id}-d`,this.updateTarget=s.protect(this.targetTagName,this.aspectType,this.targetAspect,t)}return this}bind(e){var t;const s=e.targets[this.targetNodeId],i=Ee(e)&&e.hydrationStage&&e.hydrationStage!==st;switch(this.aspectType){case u.event:s[this.data]=e,s.addEventListener(this.targetAspect,this,this.dataBinding.options);break;case u.content:e.onUnbind(this);default:const n=null!==(t=s[this.data])&&void 0!==t?t:s[this.data]=this.dataBinding.createObserver(this,this);if(n.target=s,n.controller=e,i&&(this.aspectType===u.attribute||this.aspectType===u.booleanAttribute)){n.bind(e);break}this.updateTarget(s,this.targetAspect,n.bind(e),e)}}unbind(e){const t=e.targets[this.targetNodeId].$fastView;void 0!==t&&t.isComposed&&(t.unbind(),t.needsBindOnly=!0)}handleEvent(e){const t=e.currentTarget[this.data];if(t.isBound){_.setEvent(e);const s=this.dataBinding.evaluate(t.source,t.context);_.setEvent(null),!0!==s&&e.preventDefault()}}handleChange(e,t){const s=t.target,i=t.controller;this.updateTarget(s,this.targetAspect,t.bind(i),i)}}Fe.define(rt,{aspected:!0});const ot=(e,t)=>`${e}.${t}`,at={},lt={index:0,node:null};function ht(e){e.startsWith("fast-")||a.warn(1204,{name:e})}const ct=new Proxy(document.createElement("div"),{get(e,t){ht(t);const s=Reflect.get(e,t);return i(s)?s.bind(e):s},set:(e,t,s)=>(ht(t),Reflect.set(e,t,s))});class dt{constructor(e,t,s){this.fragment=e,this.directives=t,this.policy=s,this.proto=null,this.nodeIds=new Set,this.descriptors={},this.factories=[]}addFactory(e,t,s,i,n){var r,o;this.nodeIds.has(s)||(this.nodeIds.add(s),this.addTargetDescriptor(t,s,i)),e.id=null!==(r=e.id)&&void 0!==r?r:Ie(),e.targetNodeId=s,e.targetTagName=n,e.policy=null!==(o=e.policy)&&void 0!==o?o:this.policy,this.factories.push(e)}freeze(){return this.proto=Object.create(null,this.descriptors),this}addTargetDescriptor(e,t,s){const i=this.descriptors;if("r"===t||"h"===t||i[t])return;if(!i[e]){const t=e.lastIndexOf("."),s=e.substring(0,t),i=parseInt(e.substring(t+1));this.addTargetDescriptor(s,e,i)}let n=at[t];if(!n){const i=`_${t}`;at[t]=n={get(){var t;return null!==(t=this[i])&&void 0!==t?t:this[i]=this[e].childNodes[s]}}}i[t]=n}createView(e){const t=this.fragment.cloneNode(!0),s=Object.create(this.proto);s.r=t,s.h=null!=e?e:ct;for(const e of this.nodeIds)s[e];return new Ze(t,this.factories,s)}}function ut(e,t,s,i,n,r=!1){const o=s.attributes,a=e.directives;for(let l=0,h=o.length;l<h;++l){const c=o[l],d=c.value,u=ze.parse(d,a);let f=null;null===u?r&&(f=new rt(se((()=>d),e.policy)),Fe.assignAspect(f,c.name)):f=bt.aggregate(u,e.policy),null!==f&&(s.removeAttributeNode(c),l--,h--,e.addFactory(f,t,i,n,s.tagName))}}function ft(e,t,s){let i=0,n=t.firstChild;for(;n;){const t=pt(e,s,n,i);n=t.node,i=t.index}}function pt(e,t,s,i){const r=ot(t,i);switch(s.nodeType){case 1:ut(e,t,s,r,i),ft(e,s,r);break;case 3:return function(e,t,s,i,r){const o=ze.parse(t.textContent,e.directives);if(null===o)return lt.node=t.nextSibling,lt.index=r+1,lt;let a,l=a=t;for(let t=0,h=o.length;t<h;++t){const h=o[t];0!==t&&(r++,i=ot(s,r),a=l.parentNode.insertBefore(document.createTextNode(""),l.nextSibling)),n(h)?a.textContent=h:(a.textContent=" ",Fe.assignAspect(h),e.addFactory(h,s,i,r,null)),l=a}return lt.index=r+1,lt.node=l.nextSibling,lt}(e,s,t,r,i);case 8:const o=ze.parse(s.data,e.directives);null!==o&&e.addFactory(bt.aggregate(o),t,r,i,null)}return lt.index=i+1,lt.node=s.nextSibling,lt}const gt="TEMPLATE",bt={compile(e,t,s=v.policy){let i;if(n(e)){i=document.createElement(gt),i.innerHTML=s.createHTML(e);const t=i.content.firstElementChild;null!==t&&t.tagName===gt&&(i=t)}else i=e;i.content.firstChild||i.content.lastChild||i.content.appendChild(document.createComment(""));const r=document.adoptNode(i.content),o=new dt(r,t,s);var a,l;return ut(o,"",i,"h",0,!0),a=r.firstChild,l=t,(a&&8==a.nodeType&&null!==ze.parse(a.data,l)||1===r.childNodes.length&&Object.keys(t).length>0)&&r.insertBefore(document.createComment(""),r.firstChild),ft(o,r,"r"),lt.node=null,o.freeze()},setDefaultStrategy(e){this.compile=e},aggregate(e,t=v.policy){if(1===e.length)return e[0];let s,i,r=!1;const o=e.length,a=e.map((e=>n(e)?()=>e:(s=e.sourceAspect||s,r=r||e.dataBinding.isVolatile,i=i||e.dataBinding.policy,e.dataBinding.evaluate))),l=new rt(Z(((e,t)=>{let s="";for(let i=0;i<o;++i)s+=a[i](e,t);return s}),null!=i?i:t,r));return Fe.assignAspect(l,s),l}},vt=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/,mt=Object.create(null);class yt{constructor(e,t=mt){this.html=e,this.factories=t}createHTML(e){const t=this.factories;for(const s in t)e(t[s]);return this.html}}function wt(e,t,s,i=Fe.getForInstance(e)){if(i.aspected){const s=vt.exec(t);null!==s&&Fe.assignAspect(e,s[2])}return e.createHTML(s)}yt.empty=new yt(""),Fe.define(yt);class St{constructor(e,t={},s){this.policy=s,this.result=null,this.html=e,this.factories=t}compile(){return null===this.result&&(this.result=bt.compile(this.html,this.factories,this.policy)),this.result}create(e){return this.compile().createView(e)}inline(){return new yt(n(this.html)?this.html:this.html.innerHTML,this.factories)}withPolicy(e){if(this.result)throw a.error(1208);if(this.policy)throw a.error(1207);return this.policy=e,this}render(e,t,s){const i=this.create(s);return i.bind(e),i.appendTo(t),i}static create(e,t,s){let n="";const r=Object.create(null),o=e=>{var t;const s=null!==(t=e.id)&&void 0!==t?t:e.id=Ie();return r[s]=e,s};for(let s=0,r=e.length-1;s<r;++s){const r=e[s];let a,l=t[s];if(n+=r,i(l))l=new rt(Z(l));else if(l instanceof K)l=new rt(l);else if(!(a=Fe.getForInstance(l))){const e=l;l=new rt(se((()=>e)))}n+=wt(l,r,o,a)}return new St(n+e[e.length-1],r,s)}}d(St);const Ct=(e,...t)=>{if(Array.isArray(e)&&Array.isArray(e.raw))return St.create(e,t);throw a.error(1206)};Ct.partial=e=>new yt(e);class xt extends He{bind(e){e.source[this.options]=e.targets[this.targetNodeId]}}Fe.define(xt);const Bt=e=>new xt(e),Ot=()=>null;function $t(e){return void 0===e?Ot:i(e)?e:()=>e}function Tt(e,t,s){const n=i(e)?e:()=>e,r=$t(t),o=$t(s);return(e,t)=>n(e,t)?r(e,t):o(e,t)}const Nt=Object.freeze({positioning:!1,recycle:!0});function kt(e,t,s,i){e.context.parent=i.source,e.context.parentContext=i.context,e.bind(t[s])}function Et(e,t,s,i){e.context.parent=i.source,e.context.parentContext=i.context,e.context.length=t.length,e.context.index=s,e.bind(t[s])}function At(e){return e.nodeType===Node.COMMENT_NODE}class Mt extends Error{constructor(e,t){super(e),this.propertyBag=t}}class jt{constructor(e){this.directive=e,this.items=null,this.itemsObserver=null,this.bindView=kt,this.views=[],this.itemsBindingObserver=e.dataBinding.createObserver(this,e),this.templateBindingObserver=e.templateBinding.createObserver(this,e),e.options.positioning&&(this.bindView=Et)}bind(e){this.location=e.targets[this.directive.targetNodeId],this.controller=e,this.items=this.itemsBindingObserver.bind(e),this.template=this.templateBindingObserver.bind(e),this.observeItems(!0),Ee(this.template)&&Ee(e)&&e.hydrationStage!==st?this.hydrateViews(this.template):this.refreshAllViews(),e.onUnbind(this)}unbind(){null!==this.itemsObserver&&this.itemsObserver.unsubscribe(this),this.unbindAllViews()}handleChange(e,t){if(t===this.itemsBindingObserver)this.items=this.itemsBindingObserver.bind(this.controller),this.observeItems(),this.refreshAllViews();else if(t===this.templateBindingObserver)this.template=this.templateBindingObserver.bind(this.controller),this.refreshAllViews(!0);else{if(!t[0])return;t[0].reset?this.refreshAllViews():t[0].sorted?this.updateSortedViews(t):this.updateSplicedViews(t)}}observeItems(e=!1){if(!this.items)return void(this.items=l);const t=this.itemsObserver,s=this.itemsObserver=A.getNotifier(this.items),i=t!==s;i&&null!==t&&t.unsubscribe(this),(i||e)&&s.subscribe(this)}updateSortedViews(e){const t=this.views;for(let s=0,i=e.length;s<i;++s){const i=e[s].sorted.slice(),n=i.slice().sort();for(let e=0,s=i.length;e<s;++e){const s=i.find((t=>i[e]===n[t]));if(s!==e){const i=n.splice(s,1);n.splice(e,0,...i);const r=t[e],o=r?r.firstChild:this.location;t[s].remove(),t[s].insertBefore(o);const a=t.splice(s,1);t.splice(e,0,...a)}}}}updateSplicedViews(e){const t=this.views,s=this.bindView,i=this.items,n=this.template,r=this.controller,o=this.directive.options.recycle,a=[];let l=0,h=0;for(let c=0,d=e.length;c<d;++c){const d=e[c],u=d.removed;let f=0,p=d.index;const g=p+d.addedCount,b=t.splice(d.index,u.length),v=h=a.length+b.length;for(;p<g;++p){const e=t[p],c=e?e.firstChild:this.location;let d;o&&h>0?(f<=v&&b.length>0?(d=b[f],f++):(d=a[l],l++),h--):d=n.create(),t.splice(p,0,d),s(d,i,p,r),d.insertBefore(c)}b[f]&&a.push(...b.slice(f))}for(let e=l,t=a.length;e<t;++e)a[e].dispose();if(this.directive.options.positioning)for(let e=0,s=t.length;e<s;++e){const i=t[e].context;i.length=s,i.index=e}}refreshAllViews(e=!1){const t=this.items,s=this.template,i=this.location,n=this.bindView,r=this.controller;let o=t.length,a=this.views,l=a.length;if(0!==o&&!e&&this.directive.options.recycle||(Ze.disposeContiguousBatch(a),l=0),0===l){this.views=a=new Array(o);for(let e=0;e<o;++e){const o=s.create();n(o,t,e,r),a[e]=o,o.insertBefore(i)}}else{let e=0;for(;e<o;++e)if(e<l){const i=a[e];if(!i){const t=new XMLSerializer;throw new Mt(`View is null or undefined inside "${this.location.getRootNode().host.nodeName}".`,{index:e,hydrationStage:this.controller.hydrationStage,itemsLength:o,viewsState:a.map((e=>e?"hydrated":"empty")),viewTemplateString:t.serializeToString(s.create().fragment),rootNodeContent:t.serializeToString(this.location.getRootNode())})}n(i,t,e,r)}else{const o=s.create();n(o,t,e,r),a.push(o),o.insertBefore(i)}const h=a.splice(e,l-e);for(e=0,o=h.length;e<o;++e)h[e].dispose()}}unbindAllViews(){const e=this.views;for(let t=0,s=e.length;t<s;++t){const s=e[t];if(!s){const s=new XMLSerializer;throw new Mt(`View is null or undefined inside "${this.location.getRootNode().host.nodeName}".`,{index:t,hydrationStage:this.controller.hydrationStage,viewsState:e.map((e=>e?"hydrated":"empty")),rootNodeContent:s.serializeToString(this.location.getRootNode())})}s.unbind()}}hydrateViews(e){if(!this.items)return;this.views=new Array(this.items.length);let t=this.location.previousSibling;for(;null!==t;){if(!At(t)){t=t.previousSibling;continue}const s=Oe.parseRepeatEndMarker(t.data);if(null===s){t=t.previousSibling;continue}t.data="";const i=t.previousSibling;if(!i)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": end should never be null.`);let n=i,r=0;for(;null!==n;){if(At(n))if(Oe.isRepeatViewEndMarker(n.data))r++;else if(Oe.isRepeatViewStartMarker(n.data)){if(!r){if(Oe.parseRepeatStartMarker(n.data)!==s)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": Mismatched start and end markers.`);n.data="",t=n.previousSibling,n=n.nextSibling;const r=e.hydrate(n,i);this.views[s]=r,this.bindView(r,this.items,s,this.controller);break}r--}n=n.previousSibling}if(!n)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": start should never be null.`)}}}class Vt{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.options=s,X.enable()}createHTML(e){return Re.comment(e(this))}createBehavior(){return new jt(this)}}function _t(e,t,s=Nt){const i=ie(e),n=ie(t);return new Vt(i,n,Object.assign(Object.assign({},Nt),s))}Fe.define(Vt);const It=e=>1===e.nodeType,Rt=e=>e?t=>1===t.nodeType&&t.matches(e):It;class zt extends He{get id(){return this._id}set id(e){this._id=e,this._controllerProperty=`${e}-c`}bind(e){const t=e.targets[this.targetNodeId];t[this._controllerProperty]=e,this.updateTarget(e.source,this.computeNodes(t)),this.observe(t),e.onUnbind(this)}unbind(e){const t=e.targets[this.targetNodeId];this.updateTarget(e.source,l),this.disconnect(t),t[this._controllerProperty]=null}getSource(e){return e[this._controllerProperty].source}updateTarget(e,t){e[this.options.property]=t}computeNodes(e){let t=this.getNodes(e);return"filter"in this.options&&(t=t.filter(this.options.filter)),t}}const Lt="slotchange";class Ft extends zt{observe(e){e.addEventListener(Lt,this)}disconnect(e){e.removeEventListener(Lt,this)}getNodes(e){return e.assignedNodes(this.options)}handleEvent(e){const t=e.currentTarget;this.updateTarget(this.getSource(t),this.computeNodes(t))}}function Pt(e){return n(e)&&(e={property:e}),new Ft(e)}Fe.define(Ft);class Ht extends zt{constructor(e){super(e),this.observerProperty=Symbol(),this.handleEvent=(e,t)=>{const s=t.target;this.updateTarget(this.getSource(s),this.computeNodes(s))},e.childList=!0}observe(e){let t=e[this.observerProperty];t||(t=new MutationObserver(this.handleEvent),t.toJSON=r,e[this.observerProperty]=t),t.target=e,t.observe(e,this.options)}disconnect(e){const t=e[this.observerProperty];t.target=null,t.disconnect()}getNodes(e){return"selector"in this.options?Array.from(e.querySelectorAll(this.options.selector)):Array.from(e.childNodes)}}function Dt(e){return n(e)&&(e={property:e}),new Ht(e)}Fe.define(Ht);const Ut="boolean",Qt="reflect",qt=Object.freeze({locate:c()}),Wt={toView:e=>e?"true":"false",fromView:e=>!(null==e||"false"===e||!1===e||0===e)},Xt={toView:e=>"boolean"==typeof e?e.toString():"",fromView:e=>[null,void 0,void 0].includes(e)?null:Wt.fromView(e)};function Jt(e){if(null==e)return null;const t=1*e;return isNaN(t)?null:t}const Gt={toView(e){const t=Jt(e);return t?t.toString():t},fromView:Jt};class Kt{constructor(e,t,s=t.toLowerCase(),i=Qt,n){this.guards=new Set,this.Owner=e,this.name=t,this.attribute=s,this.mode=i,this.converter=n,this.fieldName=`_${t}`,this.callbackName=`${t}Changed`,this.hasCallback=this.callbackName in e.prototype,i===Ut&&void 0===n&&(this.converter=Wt)}setValue(e,t){const s=e[this.fieldName],i=this.converter;void 0!==i&&(t=i.fromView(t)),s!==t&&(e[this.fieldName]=t,this.tryReflectToAttribute(e),this.hasCallback&&e[this.callbackName](s,t),e.$fastController.notify(this.name))}getValue(e){return A.track(e,this.name),e[this.fieldName]}onAttributeChangedCallback(e,t){this.guards.has(e)||(this.guards.add(e),this.setValue(e,t),this.guards.delete(e))}tryReflectToAttribute(e){const t=this.mode,s=this.guards;s.has(e)||"fromView"===t||T.enqueue((()=>{s.add(e);const i=e[this.fieldName];switch(t){case Qt:const t=this.converter;v.setAttribute(e,this.attribute,void 0!==t?t.toView(i):i);break;case Ut:v.setBooleanAttribute(e,this.attribute,i)}s.delete(e)}))}static collect(e,...t){const s=[];t.push(qt.locate(e));for(let i=0,r=t.length;i<r;++i){const r=t[i];if(void 0!==r)for(let t=0,i=r.length;t<i;++t){const i=r[t];n(i)?s.push(new Kt(e,i)):s.push(new Kt(e,i.property,i.attribute,i.mode,i.converter))}}return s}}function Yt(e,t){let s;function i(e,t){arguments.length>1&&(s.property=t),qt.locate(e.constructor).push(s)}return arguments.length>1?(s={},void i(e,t)):(s=void 0===e?{}:e,i)}const Zt={mode:"open"},es={},ts=new Set,ss=a.getById(s.elementRegistry,(()=>h()));class is{constructor(e,t=e.definition){var s;this.platformDefined=!1,n(t)&&(t={name:t}),this.type=e,this.name=t.name,this.template=t.template,this.registry=null!==(s=t.registry)&&void 0!==s?s:customElements;const i=e.prototype,r=Kt.collect(e,t.attributes),o=new Array(r.length),a={},l={};for(let e=0,t=r.length;e<t;++e){const t=r[e];o[e]=t.attribute,a[t.name]=t,l[t.attribute]=t,A.defineProperty(i,t)}Reflect.defineProperty(e,"observedAttributes",{value:o,enumerable:!0}),this.attributes=r,this.propertyLookup=a,this.attributeLookup=l,this.shadowOptions=void 0===t.shadowOptions?Zt:null===t.shadowOptions?void 0:Object.assign(Object.assign({},Zt),t.shadowOptions),this.elementOptions=void 0===t.elementOptions?es:Object.assign(Object.assign({},es),t.elementOptions),this.styles=oe.normalize(t.styles),ss.register(this)}get isDefined(){return this.platformDefined}define(e=this.registry){const t=this.type;return e.get(this.name)||(this.platformDefined=!0,e.define(this.name,t,this.elementOptions)),this}static compose(e,t){return ts.has(e)||ss.getByType(e)?new is(class extends e{},t):new is(e,t)}static registerBaseType(e){ts.add(e)}}is.getByType=ss.getByType,is.getForInstance=ss.getForInstance,A.defineProperty(is.prototype,"template"),A.defineProperty(is.prototype,"shadowOptions");class ns{constructor(e){this.directive=e,this.location=null,this.controller=null,this.view=null,this.data=null,this.dataBindingObserver=e.dataBinding.createObserver(this,e),this.templateBindingObserver=e.templateBinding.createObserver(this,e)}bind(e){if(this.location=e.targets[this.directive.targetNodeId],this.controller=e,this.data=this.dataBindingObserver.bind(e),this.template=this.templateBindingObserver.bind(e),e.onUnbind(this),Ee(this.template)&&Ee(e)&&e.hydrationStage!==st&&!this.view){const t=e.bindingViewBoundaries[this.directive.targetNodeId];t&&(this.view=this.template.hydrate(t.first,t.last),this.bindView(this.view))}else this.refreshView()}unbind(e){const t=this.view;null!==t&&t.isComposed&&(t.unbind(),t.needsBindOnly=!0)}handleChange(e,t){t===this.dataBindingObserver&&(this.data=this.dataBindingObserver.bind(this.controller)),(this.directive.templateBindingDependsOnData||t===this.templateBindingObserver)&&(this.template=this.templateBindingObserver.bind(this.controller)),this.refreshView()}bindView(e){e.isComposed?e.needsBindOnly&&(e.needsBindOnly=!1,e.bind(this.data)):(e.isComposed=!0,e.bind(this.data),e.insertBefore(this.location),e.$fastTemplate=this.template)}refreshView(){let e=this.view;const t=this.template;null===e?(this.view=e=t.create(),this.view.context.parent=this.controller.source,this.view.context.parentContext=this.controller.context):e.$fastTemplate!==t&&(e.isComposed&&(e.remove(),e.unbind()),this.view=e=t.create(),this.view.context.parent=this.controller.source,this.view.context.parentContext=this.controller.context),this.bindView(e)}}class rs{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.templateBindingDependsOnData=s}createHTML(e){return Re.comment(e(this))}createBehavior(){return new ns(this)}}Fe.define(rs);const os=new Map,as={":model":e=>e},ls=Symbol("RenderInstruction"),hs="default-view",cs=Ct`
2
2
  &nbsp;
3
- `;function ds(e){return void 0===e?hs:e.template}function us(e,t){const s=[],n=[],{attributes:r,directives:o,content:a,policy:l}=null!=t?t:{};if(s.push(`<${e}`),r){const e=Object.getOwnPropertyNames(r);for(let t=0,i=e.length;t<i;++t){const i=e[t];0===t?s[0]=`${s[0]} ${i}="`:s.push(`" ${i}="`),n.push(r[i])}s.push('"')}if(o){s[s.length-1]+=" ";for(let e=0,t=o.length;e<t;++e){const t=o[e];s.push(e>0?"":" "),n.push(t)}}if(s[s.length-1]+=">",a&&i(a.create))n.push(a),s.push(`</${e}>`);else{const t=s.length-1;s[t]=`${s[t]}${null!=a?a:""}</${e}>`}return St.create(s,n,l)}function fs(e){var t;const s=null!==(t=e.name)&&void 0!==t?t:cs;let i;if((n=e).element||n.tagName){let t=e.tagName;if(!t){const s=is.getByType(e.element);if(!s)throw new Error("Invalid element for model rendering.");t=s.name}e.attributes||(e.attributes=as),i=us(t,e)}else i=e.template;var n;return{brand:ls,type:e.type,name:s,template:i}}function ps(e){return e&&e.brand===ls}function gs(e,t){const s=os.get(e);if(void 0!==s)return s[null!=t?t:cs]}function bs(e,t){if(e)return gs(e.constructor,t)}Object.freeze({instanceOf:ps,create:fs,createElementTemplate:us,register:function(e){let t=os.get(e.type);void 0===t&&os.set(e.type,t=Object.create(null));const s=ps(e)?e:fs(e);return t[s.name]=s},getByType:gs,getForInstance:bs});class vs{constructor(e){this.node=e,e.$fastTemplate=this}get context(){return this}bind(e){}unbind(){}insertBefore(e){e.parentNode.insertBefore(this.node,e)}remove(){this.node.parentNode.removeChild(this.node)}create(){return this}hydrate(e,t){return this}}function ms(e,t){let s,r;s=void 0===e?se((e=>e)):ie(e);let o=!1;if(void 0===t)o=!0,r=se(((e,t)=>{var i;const n=s.evaluate(e,t);return n instanceof Node?null!==(i=n.$fastTemplate)&&void 0!==i?i:new vs(n):ds(bs(n))}));else if(i(t))r=Z(((e,i)=>{var r;let o=t(e,i);return n(o)?o=ds(bs(s.evaluate(e,i),o)):o instanceof Node&&(o=null!==(r=o.$fastTemplate)&&void 0!==r?r:new vs(o)),o}),void 0,!0);else if(n(t))o=!0,r=se(((e,i)=>{var n;const r=s.evaluate(e,i);return r instanceof Node?null!==(n=r.$fastTemplate)&&void 0!==n?n:new vs(r):ds(bs(r,t))}));else if(t instanceof K){const e=t.evaluate;t.evaluate=(t,i)=>{var r;let o=e(t,i);return n(o)?o=ds(bs(s.evaluate(t,i),o)):o instanceof Node&&(o=null!==(r=o.$fastTemplate)&&void 0!==r?r:new vs(o)),o},r=t}else r=se(((e,s)=>t));return new rs(s,r,o)}class ys extends MutationObserver{constructor(e){super((function(e){this.callback.call(null,e.filter((e=>this.observedNodes.has(e.target))))})),this.callback=e,this.observedNodes=new Set}observe(e,t){this.observedNodes.add(e),super.observe(e,t)}unobserve(e){this.observedNodes.delete(e),this.observedNodes.size<1&&this.disconnect()}}Object.freeze({create(e){const t=[],s={};let i=null,n=!1;return{source:e,context:I.default,targets:s,get isBound(){return n},addBehaviorFactory(e,t){var s,i,n,r;const o=e;o.id=null!==(s=o.id)&&void 0!==s?s:_e(),o.targetNodeId=null!==(i=o.targetNodeId)&&void 0!==i?i:_e(),o.targetTagName=null!==(n=t.tagName)&&void 0!==n?n:null,o.policy=null!==(r=o.policy)&&void 0!==r?r:v.policy,this.addTarget(o.targetNodeId,t),this.addBehavior(o.createBehavior())},addTarget(e,t){s[e]=t},addBehavior(e){t.push(e),n&&e.bind(this)},onUnbind(e){null===i&&(i=[]),i.push(e)},connectedCallback(e){n||(n=!0,t.forEach((e=>e.bind(this))))},disconnectedCallback(e){n&&(n=!1,null!==i&&i.forEach((e=>e.unbind(this))))}}}});const ws={bubbles:!0,composed:!0,cancelable:!0},Ss="isConnected",Cs=new WeakMap;function xs(e){var t,s;return null!==(s=null!==(t=e.shadowRoot)&&void 0!==t?t:Cs.get(e))&&void 0!==s?s:null}let Bs;class $s extends k{constructor(e,t){super(e),this.boundObservables=null,this.needsInitialization=!0,this.hasExistingShadowRoot=!1,this._template=null,this.stage=3,this.guardBehaviorConnection=!1,this.behaviors=null,this.behaviorsConnected=!1,this._mainStyles=null,this.$fastController=this,this.view=null,this.source=e,this.definition=t;const s=t.shadowOptions;if(void 0!==s){let t=e.shadowRoot;t?this.hasExistingShadowRoot=!0:(t=e.attachShadow(s),"closed"===s.mode&&Cs.set(e,t))}const i=A.getAccessors(e);if(i.length>0){const t=this.boundObservables=Object.create(null);for(let s=0,n=i.length;s<n;++s){const n=i[s].name,r=e[n];void 0!==r&&(delete e[n],t[n]=r)}}}get isConnected(){return A.track(this,Ss),1===this.stage}get context(){var e,t;return null!==(t=null===(e=this.view)||void 0===e?void 0:e.context)&&void 0!==t?t:I.default}get isBound(){var e,t;return null!==(t=null===(e=this.view)||void 0===e?void 0:e.isBound)&&void 0!==t&&t}get sourceLifetime(){var e;return null===(e=this.view)||void 0===e?void 0:e.sourceLifetime}get template(){var e;if(null===this._template){const t=this.definition;this.source.resolveTemplate?this._template=this.source.resolveTemplate():t.template&&(this._template=null!==(e=t.template)&&void 0!==e?e:null)}return this._template}set template(e){this._template!==e&&(this._template=e,this.needsInitialization||this.renderTemplate(e))}get mainStyles(){var e;if(null===this._mainStyles){const t=this.definition;this.source.resolveStyles?this._mainStyles=this.source.resolveStyles():t.styles&&(this._mainStyles=null!==(e=t.styles)&&void 0!==e?e:null)}return this._mainStyles}set mainStyles(e){this._mainStyles!==e&&(null!==this._mainStyles&&this.removeStyles(this._mainStyles),this._mainStyles=e,this.needsInitialization||this.addStyles(e))}onUnbind(e){var t;null===(t=this.view)||void 0===t||t.onUnbind(e)}addBehavior(e){var t,s;const i=null!==(t=this.behaviors)&&void 0!==t?t:this.behaviors=new Map,n=null!==(s=i.get(e))&&void 0!==s?s:0;0===n?(i.set(e,1),e.addedCallback&&e.addedCallback(this),!e.connectedCallback||this.guardBehaviorConnection||1!==this.stage&&0!==this.stage||e.connectedCallback(this)):i.set(e,n+1)}removeBehavior(e,t=!1){const s=this.behaviors;if(null===s)return;const i=s.get(e);void 0!==i&&(1===i||t?(s.delete(e),e.disconnectedCallback&&3!==this.stage&&e.disconnectedCallback(this),e.removedCallback&&e.removedCallback(this)):s.set(e,i-1))}addStyles(e){var t;if(!e)return;const s=this.source;if(e instanceof HTMLElement){(null!==(t=xs(s))&&void 0!==t?t:this.source).append(e)}else if(!e.isAttachedTo(s)){const t=e.behaviors;if(e.addStylesTo(s),null!==t)for(let e=0,s=t.length;e<s;++e)this.addBehavior(t[e])}}removeStyles(e){var t;if(!e)return;const s=this.source;if(e instanceof HTMLElement){(null!==(t=xs(s))&&void 0!==t?t:s).removeChild(e)}else if(e.isAttachedTo(s)){const t=e.behaviors;if(e.removeStylesFrom(s),null!==t)for(let e=0,s=t.length;e<s;++e)this.removeBehavior(t[e])}}connect(){3===this.stage&&(this.stage=0,this.bindObservables(),this.connectBehaviors(),this.needsInitialization?(this.renderTemplate(this.template),this.addStyles(this.mainStyles),this.needsInitialization=!1):null!==this.view&&this.view.bind(this.source),this.stage=1,A.notify(this,Ss))}bindObservables(){if(null!==this.boundObservables){const e=this.source,t=this.boundObservables,s=Object.keys(t);for(let i=0,n=s.length;i<n;++i){const n=s[i];e[n]=t[n]}this.boundObservables=null}}connectBehaviors(){if(!1===this.behaviorsConnected){const e=this.behaviors;if(null!==e){this.guardBehaviorConnection=!0;for(const t of e.keys())t.connectedCallback&&t.connectedCallback(this);this.guardBehaviorConnection=!1}this.behaviorsConnected=!0}}disconnectBehaviors(){if(!0===this.behaviorsConnected){const e=this.behaviors;if(null!==e)for(const t of e.keys())t.disconnectedCallback&&t.disconnectedCallback(this);this.behaviorsConnected=!1}}disconnect(){1===this.stage&&(this.stage=2,A.notify(this,Ss),null!==this.view&&this.view.unbind(),this.disconnectBehaviors(),this.stage=3)}onAttributeChangedCallback(e,t,s){const i=this.definition.attributeLookup[e];void 0!==i&&i.onAttributeChangedCallback(this.source,s)}emit(e,t,s){return 1===this.stage&&this.source.dispatchEvent(new CustomEvent(e,Object.assign(Object.assign({detail:t},ws),s)))}renderTemplate(e){var t;const s=this.source,i=null!==(t=xs(s))&&void 0!==t?t:s;if(null!==this.view)this.view.dispose(),this.view=null;else if(!this.needsInitialization||this.hasExistingShadowRoot){this.hasExistingShadowRoot=!1;for(let e=i.firstChild;null!==e;e=i.firstChild)i.removeChild(e)}e&&(this.view=e.render(s,i,s),this.view.sourceLifetime=E.coupled)}static forCustomElement(e,t=!1){const s=e.$fastController;if(void 0!==s&&!t)return s;const i=is.getForInstance(e);if(void 0===i)throw a.error(1401);return A.getNotifier(i).subscribe({handleChange:()=>{$s.forCustomElement(e,!0),e.$fastController.connect()}},"template"),e.$fastController=new Bs(e,i)}static setStrategy(e){Bs=e}}function Ts(e){var t;return"adoptedStyleSheets"in e?e:null!==(t=xs(e))&&void 0!==t?t:e.getRootNode()}d($s),$s.setStrategy($s);class Os{constructor(e){const t=Os.styleSheetCache;this.sheets=e.map((e=>{if(e instanceof CSSStyleSheet)return e;let s=t.get(e);return void 0===s&&(s=new CSSStyleSheet,s.replaceSync(e),t.set(e,s)),s}))}addStylesTo(e){As(Ts(e),this.sheets)}removeStylesFrom(e){Ms(Ts(e),this.sheets)}}Os.styleSheetCache=new Map;let Ns=0;function ks(e){return e===document?document.body:e}class Es{constructor(e){this.styles=e,this.styleClass="fast-"+ ++Ns}addStylesTo(e){e=ks(Ts(e));const t=this.styles,s=this.styleClass;for(let i=0;i<t.length;i++){const n=document.createElement("style");n.innerHTML=t[i],n.className=s,e.append(n)}}removeStylesFrom(e){const t=(e=ks(Ts(e))).querySelectorAll(`.${this.styleClass}`);for(let s=0,i=t.length;s<i;++s)e.removeChild(t[s])}}let As=(e,t)=>{e.adoptedStyleSheets=[...e.adoptedStyleSheets,...t]},Ms=(e,t)=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter((e=>-1===t.indexOf(e)))};if(oe.supportsAdoptedStyleSheets){try{document.adoptedStyleSheets.push(),document.adoptedStyleSheets.splice(),As=(e,t)=>{e.adoptedStyleSheets.push(...t)},Ms=(e,t)=>{for(const s of t){const t=e.adoptedStyleSheets.indexOf(s);-1!==t&&e.adoptedStyleSheets.splice(t,1)}}}catch(e){}oe.setDefaultStrategy(Os)}else oe.setDefaultStrategy(Es);const js="defer-hydration",Vs="needs-hydration";class Is extends $s{static hydrationObserverHandler(e){for(const t of e)Is.hydrationObserver.unobserve(t.target),t.target.$fastController.connect()}connect(){var e,t;if(void 0===this.needsHydration&&(this.needsHydration=null!==this.source.getAttribute(Vs)),this.source.hasAttribute(js))return void Is.hydrationObserver.observe(this.source,{attributeFilter:[js]});if(!this.needsHydration)return void super.connect();if(3!==this.stage)return;this.stage=0,this.bindObservables(),this.connectBehaviors();const s=this.source,i=null!==(e=xs(s))&&void 0!==e?e:s;if(this.template)if(Ee(this.template)){let e=i.firstChild,n=i.lastChild;null===s.shadowRoot&&($e.isElementBoundaryStartMarker(e)&&(e.data="",e=e.nextSibling),$e.isElementBoundaryEndMarker(n)&&(n.data="",n=n.previousSibling)),this.view=this.template.hydrate(e,n,s),null===(t=this.view)||void 0===t||t.bind(this.source)}else this.renderTemplate(this.template);this.addStyles(this.mainStyles),this.stage=1,this.source.removeAttribute(Vs),this.needsInitialization=this.needsHydration=!1,A.notify(this,Ss)}disconnect(){super.disconnect(),Is.hydrationObserver.unobserve(this.source)}static install(){$s.setStrategy(Is)}}function _s(e){const t=class extends e{constructor(){super(),$s.forCustomElement(this)}$emit(e,t,s){return this.$fastController.emit(e,t,s)}connectedCallback(){this.$fastController.connect()}disconnectedCallback(){this.$fastController.disconnect()}attributeChangedCallback(e,t,s){this.$fastController.onAttributeChangedCallback(e,t,s)}};return is.registerBaseType(t),t}function Rs(e,t){return i(e)?is.compose(e,t).define().type:is.compose(this,e).define().type}Is.hydrationObserver=new ys(Is.hydrationObserverHandler);const zs=Object.assign(_s(HTMLElement),{from:function(e){return _s(e)},define:Rs,compose:function(e,t){return i(e)?is.compose(e,t):is.compose(this,e)}});function Ls(e){return function(t){Rs(t,e)}}v.setPolicy(T.create());export{X as ArrayObserver,qt as AttributeConfiguration,Kt as AttributeDefinition,K as Binding,de as CSSBindingDirective,le as CSSDirective,Pt as ChildrenDirective,bt as Compiler,v as DOM,u as DOMAspect,$s as ElementController,oe as ElementStyles,I as ExecutionContext,a as FAST,zs as FASTElement,is as FASTElementDefinition,rt as HTMLBindingDirective,Fe as HTMLDirective,Ze as HTMLView,Is as HydratableElementController,it as HydrationBindingError,yt as InlineTemplateDirective,Re as Markup,zt as NodeObservationDirective,A as Observable,ze as Parser,k as PropertyChangeNotifier,xt as RefDirective,ns as RenderBehavior,rs as RenderDirective,jt as RepeatBehavior,Vt as RepeatDirective,Ft as SlottedDirective,R as Sort,E as SourceLifetime,_ as Splice,U as SpliceStrategy,z as SpliceStrategySupport,Pe as StatelessAttachedAttributeDirective,N as SubscriberSet,O as Updates,St as ViewTemplate,Yt as attr,Wt as booleanConverter,Dt as children,be as css,ce as cssDirective,Ls as customElement,Rt as elements,l as emptyArray,ss as fastElementRegistry,Ct as html,He as htmlDirective,J as lengthOf,ee as listener,ie as normalizeBinding,Xt as nullableBooleanConverter,Gt as nullableNumberConverter,M as observable,se as oneTime,Z as oneWay,Bt as ref,ms as render,It as repeat,Ht as slotted,G as sortedCount,j as volatile,Ot as when};
3
+ `;function ds(e){return void 0===e?cs:e.template}function us(e,t){const s=[],n=[],{attributes:r,directives:o,content:a,policy:l}=null!=t?t:{};if(s.push(`<${e}`),r){const e=Object.getOwnPropertyNames(r);for(let t=0,i=e.length;t<i;++t){const i=e[t];0===t?s[0]=`${s[0]} ${i}="`:s.push(`" ${i}="`),n.push(r[i])}s.push('"')}if(o){s[s.length-1]+=" ";for(let e=0,t=o.length;e<t;++e){const t=o[e];s.push(e>0?"":" "),n.push(t)}}if(s[s.length-1]+=">",a&&i(a.create))n.push(a),s.push(`</${e}>`);else{const t=s.length-1;s[t]=`${s[t]}${null!=a?a:""}</${e}>`}return St.create(s,n,l)}function fs(e){var t;const s=null!==(t=e.name)&&void 0!==t?t:hs;let i;if((n=e).element||n.tagName){let t=e.tagName;if(!t){const s=is.getByType(e.element);if(!s)throw new Error("Invalid element for model rendering.");t=s.name}e.attributes||(e.attributes=as),i=us(t,e)}else i=e.template;var n;return{brand:ls,type:e.type,name:s,template:i}}function ps(e){return e&&e.brand===ls}function gs(e,t){const s=os.get(e);if(void 0!==s)return s[null!=t?t:hs]}function bs(e,t){if(e)return gs(e.constructor,t)}Object.freeze({instanceOf:ps,create:fs,createElementTemplate:us,register:function(e){let t=os.get(e.type);void 0===t&&os.set(e.type,t=Object.create(null));const s=ps(e)?e:fs(e);return t[s.name]=s},getByType:gs,getForInstance:bs});class vs{constructor(e){this.node=e,e.$fastTemplate=this}get context(){return this}bind(e){}unbind(){}insertBefore(e){e.parentNode.insertBefore(this.node,e)}remove(){this.node.parentNode.removeChild(this.node)}create(){return this}hydrate(e,t){return this}}function ms(e,t){let s,r;s=void 0===e?se((e=>e)):ie(e);let o=!1;if(void 0===t)o=!0,r=se(((e,t)=>{var i;const n=s.evaluate(e,t);return n instanceof Node?null!==(i=n.$fastTemplate)&&void 0!==i?i:new vs(n):ds(bs(n))}));else if(i(t))r=Z(((e,i)=>{var r;let o=t(e,i);return n(o)?o=ds(bs(s.evaluate(e,i),o)):o instanceof Node&&(o=null!==(r=o.$fastTemplate)&&void 0!==r?r:new vs(o)),o}),void 0,!0);else if(n(t))o=!0,r=se(((e,i)=>{var n;const r=s.evaluate(e,i);return r instanceof Node?null!==(n=r.$fastTemplate)&&void 0!==n?n:new vs(r):ds(bs(r,t))}));else if(t instanceof K){const e=t.evaluate;t.evaluate=(t,i)=>{var r;let o=e(t,i);return n(o)?o=ds(bs(s.evaluate(t,i),o)):o instanceof Node&&(o=null!==(r=o.$fastTemplate)&&void 0!==r?r:new vs(o)),o},r=t}else r=se(((e,s)=>t));return new rs(s,r,o)}class ys extends MutationObserver{constructor(e){super((function(e){this.callback.call(null,e.filter((e=>this.observedNodes.has(e.target))))})),this.callback=e,this.observedNodes=new Set}observe(e,t){this.observedNodes.add(e),super.observe(e,t)}unobserve(e){this.observedNodes.delete(e),this.observedNodes.size<1&&this.disconnect()}}Object.freeze({create(e){const t=[],s={};let i=null,n=!1;return{source:e,context:_.default,targets:s,get isBound(){return n},addBehaviorFactory(e,t){var s,i,n,r;const o=e;o.id=null!==(s=o.id)&&void 0!==s?s:Ie(),o.targetNodeId=null!==(i=o.targetNodeId)&&void 0!==i?i:Ie(),o.targetTagName=null!==(n=t.tagName)&&void 0!==n?n:null,o.policy=null!==(r=o.policy)&&void 0!==r?r:v.policy,this.addTarget(o.targetNodeId,t),this.addBehavior(o.createBehavior())},addTarget(e,t){s[e]=t},addBehavior(e){t.push(e),n&&e.bind(this)},onUnbind(e){null===i&&(i=[]),i.push(e)},connectedCallback(e){n||(n=!0,t.forEach((e=>e.bind(this))))},disconnectedCallback(e){n&&(n=!1,null!==i&&i.forEach((e=>e.unbind(this))))}}}});const ws={bubbles:!0,composed:!0,cancelable:!0},Ss="isConnected",Cs=new WeakMap;function xs(e){var t,s;return null!==(s=null!==(t=e.shadowRoot)&&void 0!==t?t:Cs.get(e))&&void 0!==s?s:null}let Bs;class Os extends k{constructor(e,t){super(e),this.boundObservables=null,this.needsInitialization=!0,this.hasExistingShadowRoot=!1,this._template=null,this.stage=3,this.guardBehaviorConnection=!1,this.behaviors=null,this.behaviorsConnected=!1,this._mainStyles=null,this.$fastController=this,this.view=null,this.source=e,this.definition=t,this.shadowOptions=t.shadowOptions;const s=A.getAccessors(e);if(s.length>0){const t=this.boundObservables=Object.create(null);for(let i=0,n=s.length;i<n;++i){const n=s[i].name,r=e[n];void 0!==r&&(delete e[n],t[n]=r)}}}get isConnected(){return A.track(this,Ss),1===this.stage}get context(){var e,t;return null!==(t=null===(e=this.view)||void 0===e?void 0:e.context)&&void 0!==t?t:_.default}get isBound(){var e,t;return null!==(t=null===(e=this.view)||void 0===e?void 0:e.isBound)&&void 0!==t&&t}get sourceLifetime(){var e;return null===(e=this.view)||void 0===e?void 0:e.sourceLifetime}get template(){var e;if(null===this._template){const t=this.definition;this.source.resolveTemplate?this._template=this.source.resolveTemplate():t.template&&(this._template=null!==(e=t.template)&&void 0!==e?e:null)}return this._template}set template(e){this._template!==e&&(this._template=e,this.needsInitialization||this.renderTemplate(e))}get shadowOptions(){return this._shadowRootOptions}set shadowOptions(e){if(void 0===this._shadowRootOptions&&void 0!==e){this._shadowRootOptions=e;let t=this.source.shadowRoot;t?this.hasExistingShadowRoot=!0:(t=this.source.attachShadow(e),"closed"===e.mode&&Cs.set(this.source,t))}}get mainStyles(){var e;if(null===this._mainStyles){const t=this.definition;this.source.resolveStyles?this._mainStyles=this.source.resolveStyles():t.styles&&(this._mainStyles=null!==(e=t.styles)&&void 0!==e?e:null)}return this._mainStyles}set mainStyles(e){this._mainStyles!==e&&(null!==this._mainStyles&&this.removeStyles(this._mainStyles),this._mainStyles=e,this.needsInitialization||this.addStyles(e))}onUnbind(e){var t;null===(t=this.view)||void 0===t||t.onUnbind(e)}addBehavior(e){var t,s;const i=null!==(t=this.behaviors)&&void 0!==t?t:this.behaviors=new Map,n=null!==(s=i.get(e))&&void 0!==s?s:0;0===n?(i.set(e,1),e.addedCallback&&e.addedCallback(this),!e.connectedCallback||this.guardBehaviorConnection||1!==this.stage&&0!==this.stage||e.connectedCallback(this)):i.set(e,n+1)}removeBehavior(e,t=!1){const s=this.behaviors;if(null===s)return;const i=s.get(e);void 0!==i&&(1===i||t?(s.delete(e),e.disconnectedCallback&&3!==this.stage&&e.disconnectedCallback(this),e.removedCallback&&e.removedCallback(this)):s.set(e,i-1))}addStyles(e){var t;if(!e)return;const s=this.source;if(e instanceof HTMLElement){(null!==(t=xs(s))&&void 0!==t?t:this.source).append(e)}else if(!e.isAttachedTo(s)){const t=e.behaviors;if(e.addStylesTo(s),null!==t)for(let e=0,s=t.length;e<s;++e)this.addBehavior(t[e])}}removeStyles(e){var t;if(!e)return;const s=this.source;if(e instanceof HTMLElement){(null!==(t=xs(s))&&void 0!==t?t:s).removeChild(e)}else if(e.isAttachedTo(s)){const t=e.behaviors;if(e.removeStylesFrom(s),null!==t)for(let e=0,s=t.length;e<s;++e)this.removeBehavior(t[e])}}connect(){3===this.stage&&(this.stage=0,this.bindObservables(),this.connectBehaviors(),this.needsInitialization?(this.renderTemplate(this.template),this.addStyles(this.mainStyles),this.needsInitialization=!1):null!==this.view&&this.view.bind(this.source),this.stage=1,A.notify(this,Ss))}bindObservables(){if(null!==this.boundObservables){const e=this.source,t=this.boundObservables,s=Object.keys(t);for(let i=0,n=s.length;i<n;++i){const n=s[i];e[n]=t[n]}this.boundObservables=null}}connectBehaviors(){if(!1===this.behaviorsConnected){const e=this.behaviors;if(null!==e){this.guardBehaviorConnection=!0;for(const t of e.keys())t.connectedCallback&&t.connectedCallback(this);this.guardBehaviorConnection=!1}this.behaviorsConnected=!0}}disconnectBehaviors(){if(!0===this.behaviorsConnected){const e=this.behaviors;if(null!==e)for(const t of e.keys())t.disconnectedCallback&&t.disconnectedCallback(this);this.behaviorsConnected=!1}}disconnect(){1===this.stage&&(this.stage=2,A.notify(this,Ss),null!==this.view&&this.view.unbind(),this.disconnectBehaviors(),this.stage=3)}onAttributeChangedCallback(e,t,s){const i=this.definition.attributeLookup[e];void 0!==i&&i.onAttributeChangedCallback(this.source,s)}emit(e,t,s){return 1===this.stage&&this.source.dispatchEvent(new CustomEvent(e,Object.assign(Object.assign({detail:t},ws),s)))}renderTemplate(e){var t;const s=this.source,i=null!==(t=xs(s))&&void 0!==t?t:s;if(null!==this.view)this.view.dispose(),this.view=null;else if(!this.needsInitialization||this.hasExistingShadowRoot){this.hasExistingShadowRoot=!1;for(let e=i.firstChild;null!==e;e=i.firstChild)i.removeChild(e)}e&&(this.view=e.render(s,i,s),this.view.sourceLifetime=E.coupled)}static forCustomElement(e,t=!1){const s=e.$fastController;if(void 0!==s&&!t)return s;const i=is.getForInstance(e);if(void 0===i)throw a.error(1401);return A.getNotifier(i).subscribe({handleChange:()=>{Os.forCustomElement(e,!0),e.$fastController.connect()}},"template"),A.getNotifier(i).subscribe({handleChange:()=>{Os.forCustomElement(e,!0),e.$fastController.connect()}},"shadowOptions"),e.$fastController=new Bs(e,i)}static setStrategy(e){Bs=e}}function $s(e){var t;return"adoptedStyleSheets"in e?e:null!==(t=xs(e))&&void 0!==t?t:e.getRootNode()}d(Os),Os.setStrategy(Os);class Ts{constructor(e){const t=Ts.styleSheetCache;this.sheets=e.map((e=>{if(e instanceof CSSStyleSheet)return e;let s=t.get(e);return void 0===s&&(s=new CSSStyleSheet,s.replaceSync(e),t.set(e,s)),s}))}addStylesTo(e){As($s(e),this.sheets)}removeStylesFrom(e){Ms($s(e),this.sheets)}}Ts.styleSheetCache=new Map;let Ns=0;function ks(e){return e===document?document.body:e}class Es{constructor(e){this.styles=e,this.styleClass="fast-"+ ++Ns}addStylesTo(e){e=ks($s(e));const t=this.styles,s=this.styleClass;for(let i=0;i<t.length;i++){const n=document.createElement("style");n.innerHTML=t[i],n.className=s,e.append(n)}}removeStylesFrom(e){const t=(e=ks($s(e))).querySelectorAll(`.${this.styleClass}`);for(let s=0,i=t.length;s<i;++s)e.removeChild(t[s])}}let As=(e,t)=>{e.adoptedStyleSheets=[...e.adoptedStyleSheets,...t]},Ms=(e,t)=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter((e=>-1===t.indexOf(e)))};if(oe.supportsAdoptedStyleSheets){try{document.adoptedStyleSheets.push(),document.adoptedStyleSheets.splice(),As=(e,t)=>{e.adoptedStyleSheets.push(...t)},Ms=(e,t)=>{for(const s of t){const t=e.adoptedStyleSheets.indexOf(s);-1!==t&&e.adoptedStyleSheets.splice(t,1)}}}catch(e){}oe.setDefaultStrategy(Ts)}else oe.setDefaultStrategy(Es);const js="defer-hydration",Vs="needs-hydration";class _s extends Os{static hydrationObserverHandler(e){for(const t of e)_s.hydrationObserver.unobserve(t.target),t.target.$fastController.connect()}connect(){var e,t;if(void 0===this.needsHydration&&(this.needsHydration=null!==this.source.getAttribute(Vs)),this.source.hasAttribute(js))return void _s.hydrationObserver.observe(this.source,{attributeFilter:[js]});if(!this.needsHydration)return void super.connect();if(3!==this.stage)return;this.stage=0,this.bindObservables(),this.connectBehaviors();const s=this.source,i=null!==(e=xs(s))&&void 0!==e?e:s;if(this.template)if(Ee(this.template)){let e=i.firstChild,n=i.lastChild;null===s.shadowRoot&&(Oe.isElementBoundaryStartMarker(e)&&(e.data="",e=e.nextSibling),Oe.isElementBoundaryEndMarker(n)&&(n.data="",n=n.previousSibling)),this.view=this.template.hydrate(e,n,s),null===(t=this.view)||void 0===t||t.bind(this.source)}else this.renderTemplate(this.template);this.addStyles(this.mainStyles),this.stage=1,this.source.removeAttribute(Vs),this.needsInitialization=this.needsHydration=!1,A.notify(this,Ss)}disconnect(){super.disconnect(),_s.hydrationObserver.unobserve(this.source)}static install(){Os.setStrategy(_s)}}function Is(e){const t=class extends e{constructor(){super(),Os.forCustomElement(this)}$emit(e,t,s){return this.$fastController.emit(e,t,s)}connectedCallback(){this.$fastController.connect()}disconnectedCallback(){this.$fastController.disconnect()}attributeChangedCallback(e,t,s){this.$fastController.onAttributeChangedCallback(e,t,s)}};return is.registerBaseType(t),t}function Rs(e,t){return i(e)?is.compose(e,t).define().type:is.compose(this,e).define().type}_s.hydrationObserver=new ys(_s.hydrationObserverHandler);const zs=Object.assign(Is(HTMLElement),{from:function(e){return Is(e)},define:Rs,compose:function(e,t){return i(e)?is.compose(e,t):is.compose(this,e)}});function Ls(e){return function(t){Rs(t,e)}}v.setPolicy($.create());export{X as ArrayObserver,qt as AttributeConfiguration,Kt as AttributeDefinition,K as Binding,de as CSSBindingDirective,le as CSSDirective,Ht as ChildrenDirective,bt as Compiler,v as DOM,u as DOMAspect,Os as ElementController,oe as ElementStyles,_ as ExecutionContext,a as FAST,zs as FASTElement,is as FASTElementDefinition,rt as HTMLBindingDirective,Fe as HTMLDirective,Ze as HTMLView,_s as HydratableElementController,it as HydrationBindingError,yt as InlineTemplateDirective,Re as Markup,zt as NodeObservationDirective,A as Observable,ze as Parser,k as PropertyChangeNotifier,xt as RefDirective,ns as RenderBehavior,rs as RenderDirective,jt as RepeatBehavior,Vt as RepeatDirective,Ft as SlottedDirective,R as Sort,E as SourceLifetime,I as Splice,U as SpliceStrategy,z as SpliceStrategySupport,He as StatelessAttachedAttributeDirective,N as SubscriberSet,T as Updates,St as ViewTemplate,Yt as attr,Wt as booleanConverter,Dt as children,be as css,he as cssDirective,Ls as customElement,Rt as elements,l as emptyArray,ss as fastElementRegistry,Ct as html,Pe as htmlDirective,J as lengthOf,ee as listener,ie as normalizeBinding,Xt as nullableBooleanConverter,Gt as nullableNumberConverter,M as observable,se as oneTime,Z as oneWay,Bt as ref,ms as render,_t as repeat,Pt as slotted,G as sortedCount,j as volatile,Tt as when};
@@ -830,6 +830,7 @@ export declare class ElementController<TElement extends HTMLElement = HTMLElemen
830
830
  protected needsInitialization: boolean;
831
831
  private hasExistingShadowRoot;
832
832
  private _template;
833
+ private _shadowRootOptions;
833
834
  protected stage: Stages;
834
835
  /**
835
836
  * A guard against connecting behaviors multiple times
@@ -892,6 +893,8 @@ export declare class ElementController<TElement extends HTMLElement = HTMLElemen
892
893
  */
893
894
  get template(): ElementViewTemplate<TElement> | null;
894
895
  set template(value: ElementViewTemplate<TElement> | null);
896
+ get shadowOptions(): ShadowRootOptions | undefined;
897
+ set shadowOptions(value: ShadowRootOptions | undefined);
895
898
  /**
896
899
  * The main set of styles used for the component, independent
897
900
  * of any dynamically added styles.
@@ -1370,7 +1373,7 @@ export declare class FASTElementDefinition<TType extends Constructable<HTMLEleme
1370
1373
  /**
1371
1374
  * Options controlling the creation of the custom element's shadow DOM.
1372
1375
  */
1373
- readonly shadowOptions?: ShadowRootOptions;
1376
+ shadowOptions?: ShadowRootOptions;
1374
1377
  /**
1375
1378
  * Options controlling how the custom element is defined with the platform.
1376
1379
  */
@@ -311,6 +311,9 @@ export class ElementController<TElement extends HTMLElement = HTMLElement> exten
311
311
  // (undocumented)
312
312
  protected renderTemplate(template: ElementViewTemplate | null | undefined): void;
313
313
  static setStrategy(strategy: ElementControllerStrategy): void;
314
+ // (undocumented)
315
+ get shadowOptions(): ShadowRootOptions | undefined;
316
+ set shadowOptions(value: ShadowRootOptions | undefined);
314
317
  readonly source: TElement;
315
318
  get sourceLifetime(): SourceLifetime | undefined;
316
319
  // Warning: (ae-forgotten-export) The symbol "Stages" needs to be exported by the entry point index.d.ts
@@ -456,7 +459,7 @@ export class FASTElementDefinition<TType extends Constructable<HTMLElement> = Co
456
459
  // @internal
457
460
  static registerBaseType(type: Function): void;
458
461
  readonly registry: CustomElementRegistry;
459
- readonly shadowOptions?: ShadowRootOptions;
462
+ shadowOptions?: ShadowRootOptions;
460
463
  readonly styles?: ElementStyles;
461
464
  template?: ElementViewTemplate;
462
465
  readonly type: TType;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@microsoft/fast-element",
3
3
  "description": "A library for constructing Web Components",
4
- "version": "2.2.1",
4
+ "version": "2.4.0",
5
5
  "author": {
6
6
  "name": "Microsoft",
7
7
  "url": "https://discord.gg/FcSNfg4"
@@ -125,7 +125,7 @@
125
125
  "@rollup/plugin-node-resolve": "^15.2.3",
126
126
  "@rollup/plugin-terser": "^0.4.4",
127
127
  "@rollup/plugin-typescript": "^8.3.2",
128
- "@tensile-perf/web-components": "^0.2.1",
128
+ "@tensile-perf/web-components": "^0.2.3",
129
129
  "@types/chai": "^4.2.11",
130
130
  "@types/chai-spies": "^1.0.3",
131
131
  "@types/karma": "^6.3.3",