@microsoft/fast-element 2.0.0-beta.24 → 2.0.0-beta.26

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
@@ -1,6 +1,48 @@
1
1
  {
2
2
  "name": "@microsoft/fast-element",
3
3
  "entries": [
4
+ {
5
+ "date": "Fri, 18 Aug 2023 00:04:40 GMT",
6
+ "tag": "@microsoft/fast-element_v2.0.0-beta.26",
7
+ "version": "2.0.0-beta.26",
8
+ "comments": {
9
+ "prerelease": [
10
+ {
11
+ "author": "chhol@microsoft.com",
12
+ "package": "@microsoft/fast-element",
13
+ "commit": "2dab94c0eda05bee7c4b497e68951d79d6fcbe46",
14
+ "comment": "BREAKING: update fast-element export paths to include extensions"
15
+ },
16
+ {
17
+ "author": "chhol@microsoft.com",
18
+ "package": "@microsoft/fast-element",
19
+ "commit": "8a23a94530ec7e6fb269c149bd70ca97e662dbf4",
20
+ "comment": "update fast-element exports to be explicit"
21
+ }
22
+ ]
23
+ }
24
+ },
25
+ {
26
+ "date": "Sat, 12 Aug 2023 00:26:36 GMT",
27
+ "tag": "@microsoft/fast-element_v2.0.0-beta.25",
28
+ "version": "2.0.0-beta.25",
29
+ "comments": {
30
+ "prerelease": [
31
+ {
32
+ "author": "nicholasrice@users.noreply.github.com",
33
+ "package": "@microsoft/fast-element",
34
+ "commit": "ff0b93a7fb4ca416629f51cc233078494aaf5f60",
35
+ "comment": "Prevent notification of array splices when operation does not mutate array values"
36
+ },
37
+ {
38
+ "author": "nicholasrice@users.noreply.github.com",
39
+ "package": "@microsoft/fast-element",
40
+ "commit": "9f6451f7e7c121d76e2ead6f50f77c312a0157f7",
41
+ "comment": "Adds volatile binding support for JavaScript optional chaining syntax"
42
+ }
43
+ ]
44
+ }
45
+ },
4
46
  {
5
47
  "date": "Fri, 16 Jun 2023 18:17:12 GMT",
6
48
  "tag": "@microsoft/fast-element_v2.0.0-beta.24",
package/CHANGELOG.md CHANGED
@@ -1,9 +1,27 @@
1
1
  # Change Log - @microsoft/fast-element
2
2
 
3
- This log was last generated on Fri, 16 Jun 2023 18:17:12 GMT and should not be manually modified.
3
+ This log was last generated on Fri, 18 Aug 2023 00:04:40 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 2.0.0-beta.26
8
+
9
+ Fri, 18 Aug 2023 00:04:40 GMT
10
+
11
+ ### Changes
12
+
13
+ - BREAKING: update fast-element export paths to include extensions (chhol@microsoft.com)
14
+ - update fast-element exports to be explicit (chhol@microsoft.com)
15
+
16
+ ## 2.0.0-beta.25
17
+
18
+ Sat, 12 Aug 2023 00:26:36 GMT
19
+
20
+ ### Changes
21
+
22
+ - Prevent notification of array splices when operation does not mutate array values (nicholasrice@users.noreply.github.com)
23
+ - Adds volatile binding support for JavaScript optional chaining syntax (nicholasrice@users.noreply.github.com)
24
+
7
25
  ## 2.0.0-beta.24
8
26
 
9
27
  Fri, 16 Jun 2023 18:17:12 GMT
@@ -1,33 +1,33 @@
1
1
  export type { Callable, Constructable, Class, Disposable, FASTGlobal, TrustedTypesPolicy, } from "./interfaces.js";
2
2
  export { FAST, emptyArray } from "./platform.js";
3
- export * from "./dom.js";
4
- export * from "./observation/observable.js";
5
- export * from "./observation/notifier.js";
6
- export * from "./observation/arrays.js";
7
- export * from "./observation/update-queue.js";
8
- export * from "./binding/binding.js";
9
- export * from "./binding/one-way.js";
10
- export * from "./binding/one-time.js";
11
- export * from "./binding/normalize.js";
12
- export * from "./styles/element-styles.js";
13
- export * from "./styles/css.js";
14
- export * from "./styles/css-directive.js";
15
- export * from "./styles/host.js";
16
- export * from "./styles/style-strategy.js";
17
- export * from "./styles/css-binding-directive.js";
18
- export * from "./templating/template.js";
19
- export * from "./templating/compiler.js";
3
+ export { DOMAspect, DOMSink, DOMPolicy, DOM } from "./dom.js";
4
+ export { Accessor, Expression, ExecutionContext, ExpressionController, ExpressionObserver, ExpressionNotifier, Observable, observable, ObservationRecord, SourceLifetime, volatile, } from "./observation/observable.js";
5
+ export { Notifier, PropertyChangeNotifier, Subscriber, SubscriberSet, } from "./observation/notifier.js";
6
+ export { ArrayObserver, LengthObserver, lengthOf, Splice, SpliceStrategy, SpliceStrategySupport, } from "./observation/arrays.js";
7
+ export { UpdateQueue, Updates } from "./observation/update-queue.js";
8
+ export { Binding, BindingDirective } from "./binding/binding.js";
9
+ export { listener, oneWay } from "./binding/one-way.js";
10
+ export { oneTime } from "./binding/one-time.js";
11
+ export { normalizeBinding } from "./binding/normalize.js";
12
+ export { ComposableStyles, ConstructibleStyleStrategy, ElementStyles, } from "./styles/element-styles.js";
13
+ export { css, CSSTemplateTag, CSSValue } from "./styles/css.js";
14
+ export { AddBehavior, cssDirective, CSSDirective, CSSDirectiveDefinition, } from "./styles/css-directive.js";
15
+ export { HostController, HostBehavior } from "./styles/host.js";
16
+ export { StyleStrategy, StyleTarget } from "./styles/style-strategy.js";
17
+ export { CSSBindingDirective } from "./styles/css-binding-directive.js";
18
+ export { CaptureType, ElementViewTemplate, html, HTMLTemplateCompilationResult, HTMLTemplateTag, InlineTemplateDirective, SyntheticViewTemplate, TemplateValue, ViewTemplate, } from "./templating/template.js";
19
+ export { CompilationStrategy, Compiler } from "./templating/compiler.js";
20
20
  export { Markup, Parser } from "./templating/markup.js";
21
- export * from "./templating/html-binding-directive.js";
22
- export * from "./templating/html-directive.js";
23
- export * from "./templating/ref.js";
24
- export * from "./templating/when.js";
25
- export * from "./templating/repeat.js";
26
- export * from "./templating/slotted.js";
27
- export * from "./templating/children.js";
28
- export * from "./templating/view.js";
29
- export * from "./templating/node-observation.js";
30
- export * from "./components/fast-element.js";
31
- export * from "./components/fast-definitions.js";
32
- export * from "./components/attributes.js";
21
+ export { ContentTemplate, ContentView, HTMLBindingDirective, } from "./templating/html-binding-directive.js";
22
+ export { AddViewBehaviorFactory, Aspected, CompiledViewBehaviorFactory, htmlDirective, HTMLDirective, HTMLDirectiveDefinition, PartialHTMLDirectiveDefinition, StatelessAttachedAttributeDirective, ViewBehavior, ViewBehaviorFactory, ViewBehaviorTargets, ViewController, } from "./templating/html-directive.js";
23
+ export { ref, RefDirective } from "./templating/ref.js";
24
+ export { when } from "./templating/when.js";
25
+ export { repeat, RepeatBehavior, RepeatDirective, RepeatOptions, } from "./templating/repeat.js";
26
+ export { slotted, SlottedDirective, SlottedDirectiveOptions, } from "./templating/slotted.js";
27
+ export { children, ChildrenDirective, ChildrenDirectiveOptions, ChildListDirectiveOptions, SubtreeDirectiveOptions, } from "./templating/children.js";
28
+ export { ElementView, HTMLView, SyntheticView, View } from "./templating/view.js";
29
+ export { elements, ElementsFilter, NodeBehaviorOptions, NodeObservationDirective, } from "./templating/node-observation.js";
30
+ export { customElement, FASTElement } from "./components/fast-element.js";
31
+ export { FASTElementDefinition, PartialFASTElementDefinition, ShadowRootOptions, } from "./components/fast-definitions.js";
32
+ export { attr, AttributeConfiguration, AttributeDefinition, AttributeMode, booleanConverter, DecoratorAttributeConfiguration, nullableBooleanConverter, nullableNumberConverter, ValueConverter, } from "./components/attributes.js";
33
33
  export { ElementController, ElementControllerStrategy, } from "./components/element-controller.js";
package/dist/esm/index.js CHANGED
@@ -1,38 +1,38 @@
1
1
  export { FAST, emptyArray } from "./platform.js";
2
2
  // DOM
3
- export * from "./dom.js";
3
+ export { DOMAspect, DOM } from "./dom.js";
4
4
  // Observation
5
- export * from "./observation/observable.js";
6
- export * from "./observation/notifier.js";
7
- export * from "./observation/arrays.js";
8
- export * from "./observation/update-queue.js";
5
+ export { ExecutionContext, Observable, observable, SourceLifetime, volatile, } from "./observation/observable.js";
6
+ export { PropertyChangeNotifier, SubscriberSet, } from "./observation/notifier.js";
7
+ export { ArrayObserver, lengthOf, Splice, SpliceStrategy, SpliceStrategySupport, } from "./observation/arrays.js";
8
+ export { Updates } from "./observation/update-queue.js";
9
9
  // Binding
10
- export * from "./binding/binding.js";
11
- export * from "./binding/one-way.js";
12
- export * from "./binding/one-time.js";
13
- export * from "./binding/normalize.js";
10
+ export { Binding } from "./binding/binding.js";
11
+ export { listener, oneWay } from "./binding/one-way.js";
12
+ export { oneTime } from "./binding/one-time.js";
13
+ export { normalizeBinding } from "./binding/normalize.js";
14
14
  // Styles
15
- export * from "./styles/element-styles.js";
16
- export * from "./styles/css.js";
17
- export * from "./styles/css-directive.js";
18
- export * from "./styles/host.js";
19
- export * from "./styles/style-strategy.js";
20
- export * from "./styles/css-binding-directive.js";
15
+ export { ElementStyles, } from "./styles/element-styles.js";
16
+ export { css } from "./styles/css.js";
17
+ export { cssDirective, CSSDirective, } from "./styles/css-directive.js";
18
+ export {} from "./styles/host.js";
19
+ export {} from "./styles/style-strategy.js";
20
+ export { CSSBindingDirective } from "./styles/css-binding-directive.js";
21
21
  // Templating
22
- export * from "./templating/template.js";
23
- export * from "./templating/compiler.js";
22
+ export { html, InlineTemplateDirective, ViewTemplate, } from "./templating/template.js";
23
+ export { Compiler } from "./templating/compiler.js";
24
24
  export { Markup, Parser } from "./templating/markup.js";
25
- export * from "./templating/html-binding-directive.js";
26
- export * from "./templating/html-directive.js";
27
- export * from "./templating/ref.js";
28
- export * from "./templating/when.js";
29
- export * from "./templating/repeat.js";
30
- export * from "./templating/slotted.js";
31
- export * from "./templating/children.js";
32
- export * from "./templating/view.js";
33
- export * from "./templating/node-observation.js";
25
+ export { HTMLBindingDirective, } from "./templating/html-binding-directive.js";
26
+ export { htmlDirective, HTMLDirective, StatelessAttachedAttributeDirective, } from "./templating/html-directive.js";
27
+ export { ref, RefDirective } from "./templating/ref.js";
28
+ export { when } from "./templating/when.js";
29
+ export { repeat, RepeatBehavior, RepeatDirective, } from "./templating/repeat.js";
30
+ export { slotted, SlottedDirective, } from "./templating/slotted.js";
31
+ export { children, ChildrenDirective, } from "./templating/children.js";
32
+ export { HTMLView } from "./templating/view.js";
33
+ export { elements, NodeObservationDirective, } from "./templating/node-observation.js";
34
34
  // Components
35
- export * from "./components/fast-element.js";
36
- export * from "./components/fast-definitions.js";
37
- export * from "./components/attributes.js";
35
+ export { customElement, FASTElement } from "./components/fast-element.js";
36
+ export { FASTElementDefinition, } from "./components/fast-definitions.js";
37
+ export { attr, AttributeConfiguration, AttributeDefinition, booleanConverter, nullableBooleanConverter, nullableNumberConverter, } from "./components/attributes.js";
38
38
  export { ElementController, } from "./components/element-controller.js";
@@ -369,7 +369,7 @@ let defaultSpliceStrategy = Object.freeze({
369
369
  if (changes === void 0) {
370
370
  return emptyArray;
371
371
  }
372
- return changes.length > 1 ? project(current, changes) : changes;
372
+ return project(current, changes);
373
373
  }
374
374
  return resetSplices;
375
375
  },
@@ -23,7 +23,7 @@ export const SourceLifetime = Object.freeze({
23
23
  */
24
24
  export const Observable = FAST.getById(KernelServiceId.observable, () => {
25
25
  const queueUpdate = Updates.enqueue;
26
- const volatileRegex = /(:|&&|\|\||if)/;
26
+ const volatileRegex = /(:|&&|\|\||if|\?\.)/;
27
27
  const notifierLookup = new WeakMap();
28
28
  let watcher = void 0;
29
29
  let createArrayObserver = (array) => {
@@ -941,7 +941,7 @@ const SourceLifetime = Object.freeze({
941
941
  */
942
942
  const Observable = FAST.getById(KernelServiceId.observable, () => {
943
943
  const queueUpdate = Updates.enqueue;
944
- const volatileRegex = /(:|&&|\|\||if)/;
944
+ const volatileRegex = /(:|&&|\|\||if|\?\.)/;
945
945
  const notifierLookup = new WeakMap();
946
946
  let watcher = void 0;
947
947
  let createArrayObserver = (array) => {
@@ -1622,7 +1622,7 @@ let defaultSpliceStrategy = Object.freeze({
1622
1622
  if (changes === void 0) {
1623
1623
  return emptyArray;
1624
1624
  }
1625
- return changes.length > 1 ? project(current, changes) : changes;
1625
+ return project(current, changes);
1626
1626
  }
1627
1627
  return resetSplices;
1628
1628
  },
@@ -1 +1 @@
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 enableArrayObservation 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))}});try{if(document.currentScript)o=document.currentScript.getAttribute("fast-kernel");else{const e=document.getElementsByTagName("script");o=e[e.length-1].getAttribute("fast-kernel")}}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 a=e=>"function"==typeof e,c=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 d={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},d));const u=globalThis.FAST;if(void 0===u.getById){const e=Object.create(null);Reflect.defineProperty(u,"getById",Object.assign({value(t,s){let n=e[t];return void 0===n&&(n=s?e[t]=s():null),n}},d))}void 0===u.error&&Object.assign(u,{warn(){},error:e=>new Error(`Error ${e}`),addMessages(){}});const f=Object.freeze([]);function p(){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 g(){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 b(e){e.prototype.toJSON=h}const v=Object.freeze({none:0,attribute:1,booleanAttribute:2,property:3,content:4,tokenList:5,event:6}),y=e=>e,m=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:y}):{createHTML:y};let w=Object.freeze({createHTML:e=>m.createHTML(e),protect:(e,t,s,n)=>n});const C=w,S=Object.freeze({get policy(){return w},setPolicy(e){if(w!==C)throw u.error(1201);w=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 x(e,t,s,n){return(e,t,s,...i)=>{c(s)&&(s=s.replace("javascript:","")),n(e,t,s,...i)}}function T(e,t,s,n){throw u.error(1209,{aspectName:s,tagName:null!=e?e:"text"})}const O={onabort:T,onauxclick:T,onbeforeinput:T,onbeforematch:T,onblur:T,oncancel:T,oncanplay:T,oncanplaythrough:T,onchange:T,onclick:T,onclose:T,oncontextlost:T,oncontextmenu:T,oncontextrestored:T,oncopy:T,oncuechange:T,oncut:T,ondblclick:T,ondrag:T,ondragend:T,ondragenter:T,ondragleave:T,ondragover:T,ondragstart:T,ondrop:T,ondurationchange:T,onemptied:T,onended:T,onerror:T,onfocus:T,onformdata:T,oninput:T,oninvalid:T,onkeydown:T,onkeypress:T,onkeyup:T,onload:T,onloadeddata:T,onloadedmetadata:T,onloadstart:T,onmousedown:T,onmouseenter:T,onmouseleave:T,onmousemove:T,onmouseout:T,onmouseover:T,onmouseup:T,onpaste:T,onpause:T,onplay:T,onplaying:T,onprogress:T,onratechange:T,onreset:T,onresize:T,onscroll:T,onsecuritypolicyviolation:T,onseeked:T,onseeking:T,onselect:T,onslotchange:T,onstalled:T,onsubmit:T,onsuspend:T,ontimeupdate:T,ontoggle:T,onvolumechange:T,onwaiting:T,onwebkitanimationend:T,onwebkitanimationiteration:T,onwebkitanimationstart:T,onwebkittransitionend:T,onwheel:T},A={elements:{a:{[v.attribute]:{href:x},[v.property]:{href:x}},area:{[v.attribute]:{href:x},[v.property]:{href:x}},button:{[v.attribute]:{formaction:x},[v.property]:{formAction:x}},embed:{[v.attribute]:{src:T},[v.property]:{src:T}},form:{[v.attribute]:{action:x},[v.property]:{action:x}},frame:{[v.attribute]:{src:x},[v.property]:{src:x}},iframe:{[v.attribute]:{src:x},[v.property]:{src:x,srcdoc:T}},input:{[v.attribute]:{formaction:x},[v.property]:{formAction:x}},link:{[v.attribute]:{href:T},[v.property]:{href:T}},object:{[v.attribute]:{codebase:T,data:T},[v.property]:{codeBase:T,data:T}},script:{[v.attribute]:{src:T,text:T},[v.property]:{src:T,text:T,innerText:T,textContent:T}},style:{[v.property]:{innerText:T,textContent:T}}},aspects:{[v.attribute]:Object.assign({},O),[v.property]:Object.assign({innerHTML:T},O),[v.event]:Object.assign({},O)}};function B(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]=B(r,{});break;default:s[n]=B(i,r)}}for(const t in e)t in s||(s[t]=B(e[t],{}));return Object.freeze(s)}function j(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,t,s,n,i){const r=e[s];if(r){const e=r[n];if(e)return e(t,s,n,i)}}const N=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=A,Object.freeze({elements:r.elements?j(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(),l=i.elements[o];if(l){const i=$(l,e,t,s,n);if(i)return i}return null!==(r=$(i.aspects,e,t,s,n))&&void 0!==r?r:n}})}}),M=u.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 l(t){e.push(t),e.length<2&&(n?s(o):o())}return Object.freeze({enqueue:l,next:()=>new Promise(l),process:o,setMode:e=>n=e})}));class E{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 V{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 E(this.subject):null!==(n=this.subjectSubscribers)&&void 0!==n?n:this.subjectSubscribers=new E(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 I=Object.freeze({unknown:void 0,coupled:1}),z=u.getById(l.observable,(()=>{const e=M.enqueue,t=/(:|&&|\|\||if)/,s=new WeakMap;let n,i=e=>{throw u.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 V(e))),n}const o=g();class l{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];a(i)&&i.call(e,n,t),r(e).notify(this.name)}}}class h extends E{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!==I.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 b(h),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){c(t)&&(t=new l(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 h(e,t,s)},isVolatileBinding:e=>t.test(e.toString())})}));function L(e,t){z.defineProperty(e,t)}function F(e,t,s){return Object.assign({},s,{get(){return z.trackVolatile(),s.get.apply(this)}})}const P=u.getById(l.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:()=>P.get(),setEvent(e){P.set(e)}});class R{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}}const D=Object.freeze({reset:1,splice:2,optimized:3}),H=new R(0,f,0);H.reset=!0;const U=[H];function q(e,t,s,n,i,r){let o=0,l=0;const a=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,a)),s===e.length&&r===n.length&&(l=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,a-o)),i+=o,r-=l,(s-=l)-(t+=o)==0&&r-i==0)return f;if(t===s){const e=new R(t,[],0);for(;i<r;)e.removed.push(n[i++]);return[e]}if(i===r)return[new R(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],l=e[t][s-1];let a;a=o<l?o<r?o:r:l<r?l:r,a===r?(r===n?i.push(0):(i.push(1),n=r),t--,s--):a===o?(i.push(3),t--,n=o):(i.push(2),s--,n=l)}return i.reverse()}(function(e,t,s,n,i,r){const o=r-i+1,l=s-t+1,a=new Array(o);let c,h;for(let e=0;e<o;++e)a[e]=new Array(l),a[e][0]=e;for(let e=0;e<l;++e)a[0][e]=e;for(let s=1;s<o;++s)for(let r=1;r<l;++r)e[t+r-1]===n[i+s-1]?a[s][r]=a[s-1][r-1]:(c=a[s-1][r]+1,h=a[s][r-1]+1,a[s][r]=c<h?c:h);return a}(e,t,s,n,i,r)),h=[];let d,u=t,p=i;for(let e=0;e<c.length;++e)switch(c[e]){case 0:void 0!==d&&(h.push(d),d=void 0),u++,p++;break;case 1:void 0===d&&(d=new R(u,[],0)),d.addedCount++,u++,d.removed.push(n[p]),p++;break;case 2:void 0===d&&(d=new R(u,[],0)),d.addedCount++,u++;break;case 3:void 0===d&&(d=new R(u,[],0)),d.removed.push(n[p]),p++}return void 0!==d&&h.push(d),h}function Q(e,t){let s=!1,n=0;for(let a=0;a<t.length;a++){const c=t[a];if(c.index+=n,s)continue;const h=(i=e.index,r=e.index+e.removed.length,o=c.index,l=c.index+c.addedCount,r<o||l<i?-1:r===o||l===i?0:i<o?r<l?r-o:l-o:l<r?l-i:r-i);if(h>=0){t.splice(a,1),a--,n-=c.addedCount-c.removed.length,e.addedCount+=c.addedCount-h;const i=e.removed.length+c.removed.length-h;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(a,0,e),a++;const i=e.addedCount-e.removed.length;c.index+=i,n+=i}}var i,r,o,l;s||t.push(e)}let W=Object.freeze({support:D.optimized,normalize:(e,t,s)=>void 0===e?void 0===s?f:s.length>1?function(e,t){let s=[];const n=[];for(let e=0,s=t.length;e<s;e++)Q(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(q(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):s:U,pop(e,t,s,n){const i=e.length>0,r=s.apply(e,n);return i&&t.addSplice(new R(e.length,[r],0)),r},push(e,t,s,n){const i=s.apply(e,n);return t.addSplice(new R(e.length-n.length,[],n.length).adjustTo(e)),i},reverse(e,t,s,n){const i=s.apply(e,n);return t.reset(e),i},shift(e,t,s,n){const i=e.length>0,r=s.apply(e,n);return i&&t.addSplice(new R(0,[r],0)),r},sort(e,t,s,n){const i=s.apply(e,n);return t.reset(e),i},splice(e,t,s,n){const i=s.apply(e,n);return t.addSplice(new R(+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 R(0,[],n.length).adjustTo(e)),i}});const J=Object.freeze({reset:U,setDefaultStrategy(e){W=e}});function K(e,t,s){Reflect.defineProperty(e,t,{value:s,enumerable:!1})}class G extends E{constructor(e){super(e),this.oldCollection=void 0,this.splices=void 0,this.needsQueue=!0,this._strategy=null,this._lengthObserver=void 0,this.call=this.flush,K(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,z.notify(e,"length"))}},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()}reset(e){this.oldCollection=e,this.enqueue()}flush(){var e;const t=this.splices,s=this.oldCollection;void 0===t&&void 0===s||(this.needsQueue=!0,this.splices=void 0,this.oldCollection=void 0,this.notify((null!==(e=this._strategy)&&void 0!==e?e:W).normalize(s,this.subject,t)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,M.enqueue(this))}}let X=!1;const Y=Object.freeze({enable(){if(X)return;X=!0,z.setArrayObserverFactory((e=>new G(e)));const e=Array.prototype;e.$fastPatch||(K(e,"$fastPatch",1),[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:W)[t.name](this,n,t,e)}})))}});function Z(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(Y.enable(),t=z.getNotifier(e)),z.track(t.lengthObserver,"length"),e.length}class ee{constructor(e,t,s=!1){this.evaluate=e,this.policy=t,this.isVolatile=s}}class te extends ee{createObserver(e){return z.binding(this.evaluate,e,this.isVolatile)}}function se(e,t,s=z.isVolatileBinding(e)){return new te(e,t,s)}function ne(e,t){const s=new te(e);return s.options=t,s}class ie extends ee{createObserver(){return this}bind(e){return this.evaluate(e.source,e.context)}}function re(e,t){return new ie(e,t)}function oe(e){return a(e)?se(e):e instanceof ee?e:re((()=>e))}let le;function ae(e){return e.map((e=>e instanceof ce?ae(e.styles):[e])).reduce(((e,t)=>e.concat(t)),[])}b(ie);class ce{constructor(e){this.styles=e,this.targets=new WeakSet,this._strategy=null,this.behaviors=e.map((e=>e instanceof ce?e.behaviors:null)).reduce(((e,t)=>null===t?e:null===e?t:e.concat(t)),null)}get strategy(){return null===this._strategy&&this.withStrategy(le),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(ae(this.styles)),this}static setDefaultStrategy(e){le=e}static normalize(e){return void 0===e?void 0:Array.isArray(e)?new ce(e):e instanceof ce?e:new ce([e])}}ce.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;const he=p(),de=Object.freeze({getForInstance:he.getForInstance,getByType:he.getByType,define:e=>(he.register({type:e}),e)});function ue(){return function(e){de.define(e)}}function fe(e,t,s){t.source.style.setProperty(e.targetAspect,s.bind(t))}class pe{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)=>fe(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){fe(this,e,e[this.targetAspect])}removedCallback(e){e.source.$cssBindings&&e.source.$cssBindings.delete(this)}handleChange(e,t){fe(this,t.controller,t)}}de.define(pe);const ge=`${Math.random().toString(36).substring(2,8)}`;let be=0;const ve=()=>`--v${ge}${++be}`;function ye(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];a(o)?o=new pe(se(o),ve()).createCSS(r):o instanceof ee?o=new pe(o,ve()).createCSS(r):void 0!==de.getForInstance(o)&&(o=o.createCSS(r)),o instanceof ce||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 me=(e,...t)=>{const{styles:s,behaviors:n}=ye(e,t),i=new ce(s);return n.length?i.withBehaviors(...n):i};class we{constructor(e,t){this.behaviors=t,this.css="";const s=e.reduce(((e,t)=>(c(t)?this.css+=t:e.push(t),e)),[]);s.length&&(this.styles=new ce(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)}}de.define(we),me.partial=(e,...t)=>{const{styles:s,behaviors:n}=ye(e,t);return new we(s,n)};const Ce=`fast-${Math.random().toString(36).substring(2,8)}`,Se=`${Ce}{`,xe=`}${Ce}`,Te=xe.length;let Oe=0;const Ae=()=>`${Ce}-${++Oe}`,Be=Object.freeze({interpolation:e=>`${Se}${e}${xe}`,attribute:e=>`${Ae()}="${Se}${e}${xe}"`,comment:e=>`\x3c!--${Se}${e}${xe}--\x3e`}),ke=Object.freeze({parse(e,t){const s=e.split(Se);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(xe);let o;if(-1===r)o=i;else{const e=i.substring(0,r);n.push(t[e]),o=i.substring(r+Te)}""!==o&&n.push(o)}return n}}),je=p(),$e=Object.freeze({getForInstance:je.getForInstance,getByType:je.getByType,define:(e,t)=>((t=t||{}).type=e,je.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?v.tokenList:v.property;break;case"?":e.targetAspect=t.substring(1),e.aspectType=v.booleanAttribute;break;case"@":e.targetAspect=t.substring(1),e.aspectType=v.event;break;default:e.targetAspect=t,e.aspectType=v.attribute}else e.aspectType=v.content}});function Ne(e){return function(t){$e.define(t,e)}}class Me{constructor(e){this.options=e}createHTML(e){return Be.attribute(e(this))}createBehavior(){return this}}b(Me);const Ee={[v.attribute]:S.setAttribute,[v.booleanAttribute]:S.setBooleanAttribute,[v.property]:(e,t,s)=>e[t]=s,[v.content]:function(e,t,s,n){if(null==s&&(s=""),s.create){e.textContent="";let t=e.$fastView;void 0===t?t=s.create():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}},[v.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 l=r.v;const a=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]=l,a.add(s))}}if(r.v=l+1,0!==l){l-=1;for(const e in o)o[e]===l&&a.remove(e)}},[v.event]:()=>{}};class Ve{constructor(e){this.dataBinding=e,this.updateTarget=null,this.aspectType=v.content}createHTML(e){return Be.interpolation(e(this))}createBehavior(){var e;if(null===this.updateTarget){const t=Ee[this.aspectType],s=null!==(e=this.dataBinding.policy)&&void 0!==e?e:this.policy;if(!t)throw u.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];switch(this.aspectType){case v.event:s[this.data]=e,s.addEventListener(this.targetAspect,this,this.dataBinding.options);break;case v.content:e.onUnbind(this);default:const n=null!==(t=s[this.data])&&void 0!==t?t:s[this.data]=this.dataBinding.createObserver(this,this);n.target=s,n.controller=e,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,n=t.controller;this.updateTarget(s,this.targetAspect,t.bind(n),n)}}function Ie(e,t){const s=e.parentNode;let n,i=e;for(;i!==t;)n=i.nextSibling,s.removeChild(i),i=n;s.removeChild(t)}$e.define(Ve,{aspected:!0});class ze{constructor(e,t,s){this.fragment=e,this.factories=t,this.targets=s,this.behaviors=null,this.unbindables=[],this.source=null,this.isBound=!1,this.sourceLifetime=I.unknown,this.context=this,this.index=0,this.length=0,this.firstChild=e.firstChild,this.lastChild=e.lastChild}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}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(){Ie(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){Ie(e[0].firstChild,e[e.length-1].lastChild);for(let t=0,s=e.length;t<s;++t)e[t].unbind()}}}b(ze),z.defineProperty(ze.prototype,"index"),z.defineProperty(ze.prototype,"length");const Le=(e,t)=>`${e}.${t}`,Fe={},Pe={index:0,node:null};function _e(e){e.startsWith("fast-")||u.warn(1204,{name:e})}const Re=new Proxy(document.createElement("div"),{get(e,t){_e(t);const s=Reflect.get(e,t);return a(s)?s.bind(e):s},set:(e,t,s)=>(_e(t),Reflect.set(e,t,s))});class De{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:Ae(),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=Fe[t];if(!i){const n=`_${t}`;Fe[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:Re;for(const e of this.nodeIds)s[e];return new ze(t,this.factories,s)}}function He(e,t,s,n,i,r=!1){const o=s.attributes,l=e.directives;for(let a=0,c=o.length;a<c;++a){const h=o[a],d=h.value,u=ke.parse(d,l);let f=null;null===u?r&&(f=new Ve(re((()=>d),e.policy)),$e.assignAspect(f,h.name)):f=Qe.aggregate(u,e.policy),null!==f&&(s.removeAttributeNode(h),a--,c--,e.addFactory(f,t,n,i,s.tagName))}}function Ue(e,t,s){let n=0,i=t.firstChild;for(;i;){const t=qe(e,s,i,n);i=t.node,n=t.index}}function qe(e,t,s,n){const i=Le(t,n);switch(s.nodeType){case 1:He(e,t,s,i,n),Ue(e,s,i);break;case 3:return function(e,t,s,n,i){const r=ke.parse(t.textContent,e.directives);if(null===r)return Pe.node=t.nextSibling,Pe.index=i+1,Pe;let o,l=o=t;for(let t=0,a=r.length;t<a;++t){const a=r[t];0!==t&&(i++,n=Le(s,i),o=l.parentNode.insertBefore(document.createTextNode(""),l.nextSibling)),c(a)?o.textContent=a:(o.textContent=" ",$e.assignAspect(a),e.addFactory(a,s,n,i,null)),l=o}return Pe.index=i+1,Pe.node=l.nextSibling,Pe}(e,s,t,i,n);case 8:const r=ke.parse(s.data,e.directives);null!==r&&e.addFactory(Qe.aggregate(r),t,i,n,null)}return Pe.index=n+1,Pe.node=s.nextSibling,Pe}const Qe={compile(e,t,s=S.policy){let n;if(c(e)){n=document.createElement("TEMPLATE"),n.innerHTML=s.createHTML(e);const t=n.content.firstElementChild;null!==t&&"TEMPLATE"===t.tagName&&(n=t)}else n=e;n.content.firstChild||n.content.lastChild||n.content.appendChild(document.createComment(""));const i=document.adoptNode(n.content),r=new De(i,t,s);var o,l;return He(r,"",n,"h",0,!0),o=i.firstChild,l=t,(o&&8==o.nodeType&&null!==ke.parse(o.data,l)||1===i.childNodes.length&&Object.keys(t).length>0)&&i.insertBefore(document.createComment(""),i.firstChild),Ue(r,i,"r"),Pe.node=null,r.freeze()},setDefaultStrategy(e){this.compile=e},aggregate(e,t=S.policy){if(1===e.length)return e[0];let s,n,i,r=!1;const o=e.length,l=e.map((e=>c(e)?()=>e:(s=e.sourceAspect||s,n=e.dataBinding||n,r=r||e.dataBinding.isVolatile,i=i||e.dataBinding.policy,e.dataBinding.evaluate)));n.evaluate=(e,t)=>{let s="";for(let n=0;n<o;++n)s+=l[n](e,t);return s},n.isVolatile=r,n.policy=null!=i?i:t;const a=new Ve(n);return $e.assignAspect(a,s),a}},We=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/,Je=Object.create(null);class Ke{constructor(e,t=Je){this.html=e,this.factories=t}createHTML(e){const t=this.factories;for(const s in t)e(t[s]);return this.html}}function Ge(e,t,s,n=$e.getForInstance(e)){if(n.aspected){const s=We.exec(t);null!==s&&$e.assignAspect(e,s[2])}return e.createHTML(s)}Ke.empty=new Ke(""),$e.define(Ke);class Xe{constructor(e,t={},s){this.policy=s,this.result=null,this.html=e,this.factories=t}create(e){return null===this.result&&(this.result=Qe.compile(this.html,this.factories,this.policy)),this.result.createView(e)}inline(){return new Ke(c(this.html)?this.html:this.html.innerHTML,this.factories)}withPolicy(e){if(this.result)throw u.error(1208);if(this.policy)throw u.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=Ae();return i[s]=e,s};for(let s=0,i=e.length-1;s<i;++s){const i=e[s];let o,l=t[s];if(n+=i,a(l))l=new Ve(se(l));else if(l instanceof ee)l=new Ve(l);else if(!(o=$e.getForInstance(l))){const e=l;l=new Ve(re((()=>e)))}n+=Ge(l,i,r,o)}return new Xe(n+e[e.length-1],i,s)}}b(Xe);const Ye=(e,...t)=>{if(Array.isArray(e)&&Array.isArray(e.raw))return Xe.create(e,t);throw u.error(1206)};Ye.partial=e=>new Ke(e);class Ze extends Me{bind(e){e.source[this.options]=e.targets[this.targetNodeId]}}$e.define(Ze);const et=e=>new Ze(e),tt=()=>null;function st(e){return void 0===e?tt:a(e)?e:()=>e}function nt(e,t,s){const n=a(e)?e:()=>e,i=st(t),r=st(s);return(e,t)=>n(e,t)?i(e,t):r(e,t)}const it=Object.freeze({positioning:!1,recycle:!0});function rt(e,t,s,n){e.context.parent=n.source,e.context.parentContext=n.context,e.bind(t[s])}function ot(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])}class lt{constructor(e){this.directive=e,this.items=null,this.itemsObserver=null,this.bindView=rt,this.views=[],this.itemsBindingObserver=e.dataBinding.createObserver(this,e),this.templateBindingObserver=e.templateBinding.createObserver(this,e),e.options.positioning&&(this.bindView=ot)}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),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():this.updateViews(t)}}observeItems(e=!1){if(!this.items)return void(this.items=f);const t=this.itemsObserver,s=this.itemsObserver=z.getNotifier(this.items),n=t!==s;n&&null!==t&&t.unsubscribe(this),(n||e)&&s.subscribe(this)}updateViews(e){const t=this.views,s=this.bindView,n=this.items,i=this.template,r=this.controller,o=this.directive.options.recycle,l=[];let a=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=l.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=l[a],a++),c--):d=i.create(),t.splice(p,0,d),s(d,n,p,r),d.insertBefore(h)}b[f]&&l.push(...b.slice(f))}for(let e=a,t=l.length;e<t;++e)l[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,l=this.views,a=l.length;if(0!==o&&!e&&this.directive.options.recycle||(ze.disposeContiguousBatch(l),a=0),0===a){this.views=l=new Array(o);for(let e=0;e<o;++e){const o=s.create();i(o,t,e,r),l[e]=o,o.insertBefore(n)}}else{let e=0;for(;e<o;++e)if(e<a){i(l[e],t,e,r)}else{const o=s.create();i(o,t,e,r),l.push(o),o.insertBefore(n)}const c=l.splice(e,a-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)e[t].unbind()}}class at{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.options=s,Y.enable()}createHTML(e){return Be.comment(e(this))}createBehavior(){return new lt(this)}}function ct(e,t,s=it){const n=oe(e),i=oe(t);return new at(n,i,Object.assign(Object.assign({},it),s))}$e.define(at);const ht=e=>1===e.nodeType,dt=e=>e?t=>1===t.nodeType&&t.matches(e):ht;class ut extends Me{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,f),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}}class ft extends ut{observe(e){e.addEventListener("slotchange",this)}disconnect(e){e.removeEventListener("slotchange",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 c(e)&&(e={property:e}),new ft(e)}$e.define(ft);class gt 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 bt(e){return c(e)&&(e={property:e}),new gt(e)}$e.define(gt);const vt=Object.freeze({locate:g()}),yt={toView:e=>e?"true":"false",fromView:e=>null!=e&&"false"!==e&&!1!==e&&0!==e},mt={toView:e=>"boolean"==typeof e?e.toString():"",fromView:e=>[null,void 0,void 0].includes(e)?null:yt.fromView(e)};function wt(e){if(null==e)return null;const t=1*e;return isNaN(t)?null:t}const Ct={toView(e){const t=wt(e);return t?t.toString():t},fromView:wt};class St{constructor(e,t,s=t.toLowerCase(),n="reflect",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,"boolean"===n&&void 0===i&&(this.converter=yt)}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 z.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||M.enqueue((()=>{s.add(e);const n=e[this.fieldName];switch(t){case"reflect":const t=this.converter;S.setAttribute(e,this.attribute,void 0!==t?t.toView(n):n);break;case"boolean":S.setBooleanAttribute(e,this.attribute,n)}s.delete(e)}))}static collect(e,...t){const s=[];t.push(vt.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];c(n)?s.push(new St(e,n)):s.push(new St(e,n.property,n.attribute,n.mode,n.converter))}}return s}}function xt(e,t){let s;function n(e,t){arguments.length>1&&(s.property=t),vt.locate(e.constructor).push(s)}return arguments.length>1?(s={},void n(e,t)):(s=void 0===e?{}:e,n)}const Tt={mode:"open"},Ot={},At=new Set,Bt=u.getById(l.elementRegistry,(()=>p()));class kt{constructor(e,t=e.definition){var s;this.platformDefined=!1,c(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=St.collect(e,t.attributes),r=new Array(i.length),o={},l={};for(let e=0,t=i.length;e<t;++e){const t=i[e];r[e]=t.attribute,o[t.name]=t,l[t.attribute]=t,z.defineProperty(n,t)}Reflect.defineProperty(e,"observedAttributes",{value:r,enumerable:!0}),this.attributes=i,this.propertyLookup=o,this.attributeLookup=l,this.shadowOptions=void 0===t.shadowOptions?Tt:null===t.shadowOptions?void 0:Object.assign(Object.assign({},Tt),t.shadowOptions),this.elementOptions=void 0===t.elementOptions?Ot:Object.assign(Object.assign({},Ot),t.elementOptions),this.styles=ce.normalize(t.styles),Bt.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 At.has(e)||Bt.getByType(e)?new kt(class extends e{},t):new kt(e,t)}static registerBaseType(e){At.add(e)}}kt.getByType=Bt.getByType,kt.getForInstance=Bt.getForInstance;const jt={bubbles:!0,composed:!0,cancelable:!0},$t=new WeakMap;function Nt(e){var t,s;return null!==(s=null!==(t=e.shadowRoot)&&void 0!==t?t:$t.get(e))&&void 0!==s?s:null}let Mt;class Et extends V{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._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&&$t.set(e,t))}const n=z.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 z.track(this,"isConnected"),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 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=Nt(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=Nt(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(){if(3!==this.stage)return;if(this.stage=0,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}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.needsInitialization?(this.renderTemplate(this.template),this.addStyles(this.mainStyles),this.needsInitialization=!1):null!==this.view&&this.view.bind(this.source),this.stage=1,z.notify(this,"isConnected")}disconnect(){if(1!==this.stage)return;this.stage=2,z.notify(this,"isConnected"),null!==this.view&&this.view.unbind();const e=this.behaviors;if(null!==e)for(const t of e.keys())t.disconnectedCallback&&t.disconnectedCallback(this);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},jt),s)))}renderTemplate(e){var t;const s=this.source,n=null!==(t=Nt(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=I.coupled)}static forCustomElement(e){const t=e.$fastController;if(void 0!==t)return t;const s=kt.getForInstance(e);if(void 0===s)throw u.error(1401);return e.$fastController=new Mt(e,s)}static setStrategy(e){Mt=e}}function Vt(e){var t;return"adoptedStyleSheets"in e?e:null!==(t=Nt(e))&&void 0!==t?t:e.getRootNode()}b(Et),Et.setStrategy(Et);class It{constructor(e){const t=It.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){Pt(Vt(e),this.sheets)}removeStylesFrom(e){_t(Vt(e),this.sheets)}}It.styleSheetCache=new Map;let zt=0;function Lt(e){return e===document?document.body:e}class Ft{constructor(e){this.styles=e,this.styleClass="fast-"+ ++zt}addStylesTo(e){e=Lt(Vt(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=Lt(Vt(e))).querySelectorAll(`.${this.styleClass}`);for(let s=0,n=t.length;s<n;++s)e.removeChild(t[s])}}let Pt=(e,t)=>{e.adoptedStyleSheets=[...e.adoptedStyleSheets,...t]},_t=(e,t)=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter((e=>-1===t.indexOf(e)))};if(ce.supportsAdoptedStyleSheets){try{document.adoptedStyleSheets.push(),document.adoptedStyleSheets.splice(),Pt=(e,t)=>{e.adoptedStyleSheets.push(...t)},_t=(e,t)=>{for(const s of t){const t=e.adoptedStyleSheets.indexOf(s);-1!==t&&e.adoptedStyleSheets.splice(t,1)}}}catch(e){}ce.setDefaultStrategy(It)}else ce.setDefaultStrategy(Ft);function Rt(e){const t=class extends e{constructor(){super(),Et.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 kt.registerBaseType(t),t}function Dt(e,t){return a(e)?kt.compose(e,t).define().type:kt.compose(this,e).define().type}const Ht=Object.assign(Rt(HTMLElement),{from:function(e){return Rt(e)},define:Dt,compose:function(e,t){return a(e)?kt.compose(e,t):kt.compose(this,e)}});function Ut(e){return function(t){Dt(t,e)}}S.setPolicy(N.create());export{Y as ArrayObserver,vt as AttributeConfiguration,St as AttributeDefinition,ee as Binding,pe as CSSBindingDirective,de as CSSDirective,gt as ChildrenDirective,Qe as Compiler,S as DOM,v as DOMAspect,Et as ElementController,ce as ElementStyles,_ as ExecutionContext,u as FAST,Ht as FASTElement,kt as FASTElementDefinition,Ve as HTMLBindingDirective,$e as HTMLDirective,ze as HTMLView,Ke as InlineTemplateDirective,Be as Markup,ut as NodeObservationDirective,z as Observable,ke as Parser,V as PropertyChangeNotifier,Ze as RefDirective,lt as RepeatBehavior,at as RepeatDirective,ft as SlottedDirective,I as SourceLifetime,R as Splice,J as SpliceStrategy,D as SpliceStrategySupport,Me as StatelessAttachedAttributeDirective,E as SubscriberSet,M as Updates,Xe as ViewTemplate,xt as attr,yt as booleanConverter,bt as children,me as css,ue as cssDirective,Ut as customElement,dt as elements,f as emptyArray,Ye as html,Ne as htmlDirective,Z as lengthOf,ne as listener,oe as normalizeBinding,mt as nullableBooleanConverter,Ct as nullableNumberConverter,L as observable,re as oneTime,se as oneWay,et as ref,ct as repeat,pt as slotted,F as volatile,nt as when};
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 enableArrayObservation 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))}});try{if(document.currentScript)o=document.currentScript.getAttribute("fast-kernel");else{const e=document.getElementsByTagName("script");o=e[e.length-1].getAttribute("fast-kernel")}}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 a=e=>"function"==typeof e,c=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 d={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},d));const u=globalThis.FAST;if(void 0===u.getById){const e=Object.create(null);Reflect.defineProperty(u,"getById",Object.assign({value(t,s){let n=e[t];return void 0===n&&(n=s?e[t]=s():null),n}},d))}void 0===u.error&&Object.assign(u,{warn(){},error:e=>new Error(`Error ${e}`),addMessages(){}});const f=Object.freeze([]);function p(){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 g(){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 b(e){e.prototype.toJSON=h}const v=Object.freeze({none:0,attribute:1,booleanAttribute:2,property:3,content:4,tokenList:5,event:6}),y=e=>e,m=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:y}):{createHTML:y};let w=Object.freeze({createHTML:e=>m.createHTML(e),protect:(e,t,s,n)=>n});const C=w,S=Object.freeze({get policy(){return w},setPolicy(e){if(w!==C)throw u.error(1201);w=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 x(e,t,s,n){return(e,t,s,...i)=>{c(s)&&(s=s.replace("javascript:","")),n(e,t,s,...i)}}function T(e,t,s,n){throw u.error(1209,{aspectName:s,tagName:null!=e?e:"text"})}const O={onabort:T,onauxclick:T,onbeforeinput:T,onbeforematch:T,onblur:T,oncancel:T,oncanplay:T,oncanplaythrough:T,onchange:T,onclick:T,onclose:T,oncontextlost:T,oncontextmenu:T,oncontextrestored:T,oncopy:T,oncuechange:T,oncut:T,ondblclick:T,ondrag:T,ondragend:T,ondragenter:T,ondragleave:T,ondragover:T,ondragstart:T,ondrop:T,ondurationchange:T,onemptied:T,onended:T,onerror:T,onfocus:T,onformdata:T,oninput:T,oninvalid:T,onkeydown:T,onkeypress:T,onkeyup:T,onload:T,onloadeddata:T,onloadedmetadata:T,onloadstart:T,onmousedown:T,onmouseenter:T,onmouseleave:T,onmousemove:T,onmouseout:T,onmouseover:T,onmouseup:T,onpaste:T,onpause:T,onplay:T,onplaying:T,onprogress:T,onratechange:T,onreset:T,onresize:T,onscroll:T,onsecuritypolicyviolation:T,onseeked:T,onseeking:T,onselect:T,onslotchange:T,onstalled:T,onsubmit:T,onsuspend:T,ontimeupdate:T,ontoggle:T,onvolumechange:T,onwaiting:T,onwebkitanimationend:T,onwebkitanimationiteration:T,onwebkitanimationstart:T,onwebkittransitionend:T,onwheel:T},A={elements:{a:{[v.attribute]:{href:x},[v.property]:{href:x}},area:{[v.attribute]:{href:x},[v.property]:{href:x}},button:{[v.attribute]:{formaction:x},[v.property]:{formAction:x}},embed:{[v.attribute]:{src:T},[v.property]:{src:T}},form:{[v.attribute]:{action:x},[v.property]:{action:x}},frame:{[v.attribute]:{src:x},[v.property]:{src:x}},iframe:{[v.attribute]:{src:x},[v.property]:{src:x,srcdoc:T}},input:{[v.attribute]:{formaction:x},[v.property]:{formAction:x}},link:{[v.attribute]:{href:T},[v.property]:{href:T}},object:{[v.attribute]:{codebase:T,data:T},[v.property]:{codeBase:T,data:T}},script:{[v.attribute]:{src:T,text:T},[v.property]:{src:T,text:T,innerText:T,textContent:T}},style:{[v.property]:{innerText:T,textContent:T}}},aspects:{[v.attribute]:Object.assign({},O),[v.property]:Object.assign({innerHTML:T},O),[v.event]:Object.assign({},O)}};function B(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]=B(r,{});break;default:s[n]=B(i,r)}}for(const t in e)t in s||(s[t]=B(e[t],{}));return Object.freeze(s)}function j(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,t,s,n,i){const r=e[s];if(r){const e=r[n];if(e)return e(t,s,n,i)}}const N=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=A,Object.freeze({elements:r.elements?j(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(),l=i.elements[o];if(l){const i=$(l,e,t,s,n);if(i)return i}return null!==(r=$(i.aspects,e,t,s,n))&&void 0!==r?r:n}})}}),M=u.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 l(t){e.push(t),e.length<2&&(n?s(o):o())}return Object.freeze({enqueue:l,next:()=>new Promise(l),process:o,setMode:e=>n=e})}));class E{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 V{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 E(this.subject):null!==(n=this.subjectSubscribers)&&void 0!==n?n:this.subjectSubscribers=new E(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 I=Object.freeze({unknown:void 0,coupled:1}),z=u.getById(l.observable,(()=>{const e=M.enqueue,t=/(:|&&|\|\||if|\?\.)/,s=new WeakMap;let n,i=e=>{throw u.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 V(e))),n}const o=g();class l{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];a(i)&&i.call(e,n,t),r(e).notify(this.name)}}}class h extends E{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!==I.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 b(h),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){c(t)&&(t=new l(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 h(e,t,s)},isVolatileBinding:e=>t.test(e.toString())})}));function L(e,t){z.defineProperty(e,t)}function F(e,t,s){return Object.assign({},s,{get(){return z.trackVolatile(),s.get.apply(this)}})}const P=u.getById(l.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:()=>P.get(),setEvent(e){P.set(e)}});class R{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}}const D=Object.freeze({reset:1,splice:2,optimized:3}),H=new R(0,f,0);H.reset=!0;const U=[H];function q(e,t,s,n,i,r){let o=0,l=0;const a=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,a)),s===e.length&&r===n.length&&(l=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,a-o)),i+=o,r-=l,(s-=l)-(t+=o)==0&&r-i==0)return f;if(t===s){const e=new R(t,[],0);for(;i<r;)e.removed.push(n[i++]);return[e]}if(i===r)return[new R(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],l=e[t][s-1];let a;a=o<l?o<r?o:r:l<r?l:r,a===r?(r===n?i.push(0):(i.push(1),n=r),t--,s--):a===o?(i.push(3),t--,n=o):(i.push(2),s--,n=l)}return i.reverse()}(function(e,t,s,n,i,r){const o=r-i+1,l=s-t+1,a=new Array(o);let c,h;for(let e=0;e<o;++e)a[e]=new Array(l),a[e][0]=e;for(let e=0;e<l;++e)a[0][e]=e;for(let s=1;s<o;++s)for(let r=1;r<l;++r)e[t+r-1]===n[i+s-1]?a[s][r]=a[s-1][r-1]:(c=a[s-1][r]+1,h=a[s][r-1]+1,a[s][r]=c<h?c:h);return a}(e,t,s,n,i,r)),h=[];let d,u=t,p=i;for(let e=0;e<c.length;++e)switch(c[e]){case 0:void 0!==d&&(h.push(d),d=void 0),u++,p++;break;case 1:void 0===d&&(d=new R(u,[],0)),d.addedCount++,u++,d.removed.push(n[p]),p++;break;case 2:void 0===d&&(d=new R(u,[],0)),d.addedCount++,u++;break;case 3:void 0===d&&(d=new R(u,[],0)),d.removed.push(n[p]),p++}return void 0!==d&&h.push(d),h}function Q(e,t){let s=!1,n=0;for(let a=0;a<t.length;a++){const c=t[a];if(c.index+=n,s)continue;const h=(i=e.index,r=e.index+e.removed.length,o=c.index,l=c.index+c.addedCount,r<o||l<i?-1:r===o||l===i?0:i<o?r<l?r-o:l-o:l<r?l-i:r-i);if(h>=0){t.splice(a,1),a--,n-=c.addedCount-c.removed.length,e.addedCount+=c.addedCount-h;const i=e.removed.length+c.removed.length-h;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(a,0,e),a++;const i=e.addedCount-e.removed.length;c.index+=i,n+=i}}var i,r,o,l;s||t.push(e)}let W=Object.freeze({support:D.optimized,normalize:(e,t,s)=>void 0===e?void 0===s?f:function(e,t){let s=[];const n=[];for(let e=0,s=t.length;e<s;e++)Q(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(q(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):U,pop(e,t,s,n){const i=e.length>0,r=s.apply(e,n);return i&&t.addSplice(new R(e.length,[r],0)),r},push(e,t,s,n){const i=s.apply(e,n);return t.addSplice(new R(e.length-n.length,[],n.length).adjustTo(e)),i},reverse(e,t,s,n){const i=s.apply(e,n);return t.reset(e),i},shift(e,t,s,n){const i=e.length>0,r=s.apply(e,n);return i&&t.addSplice(new R(0,[r],0)),r},sort(e,t,s,n){const i=s.apply(e,n);return t.reset(e),i},splice(e,t,s,n){const i=s.apply(e,n);return t.addSplice(new R(+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 R(0,[],n.length).adjustTo(e)),i}});const J=Object.freeze({reset:U,setDefaultStrategy(e){W=e}});function K(e,t,s){Reflect.defineProperty(e,t,{value:s,enumerable:!1})}class G extends E{constructor(e){super(e),this.oldCollection=void 0,this.splices=void 0,this.needsQueue=!0,this._strategy=null,this._lengthObserver=void 0,this.call=this.flush,K(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,z.notify(e,"length"))}},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()}reset(e){this.oldCollection=e,this.enqueue()}flush(){var e;const t=this.splices,s=this.oldCollection;void 0===t&&void 0===s||(this.needsQueue=!0,this.splices=void 0,this.oldCollection=void 0,this.notify((null!==(e=this._strategy)&&void 0!==e?e:W).normalize(s,this.subject,t)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,M.enqueue(this))}}let X=!1;const Y=Object.freeze({enable(){if(X)return;X=!0,z.setArrayObserverFactory((e=>new G(e)));const e=Array.prototype;e.$fastPatch||(K(e,"$fastPatch",1),[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:W)[t.name](this,n,t,e)}})))}});function Z(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(Y.enable(),t=z.getNotifier(e)),z.track(t.lengthObserver,"length"),e.length}class ee{constructor(e,t,s=!1){this.evaluate=e,this.policy=t,this.isVolatile=s}}class te extends ee{createObserver(e){return z.binding(this.evaluate,e,this.isVolatile)}}function se(e,t,s=z.isVolatileBinding(e)){return new te(e,t,s)}function ne(e,t){const s=new te(e);return s.options=t,s}class ie extends ee{createObserver(){return this}bind(e){return this.evaluate(e.source,e.context)}}function re(e,t){return new ie(e,t)}function oe(e){return a(e)?se(e):e instanceof ee?e:re((()=>e))}let le;function ae(e){return e.map((e=>e instanceof ce?ae(e.styles):[e])).reduce(((e,t)=>e.concat(t)),[])}b(ie);class ce{constructor(e){this.styles=e,this.targets=new WeakSet,this._strategy=null,this.behaviors=e.map((e=>e instanceof ce?e.behaviors:null)).reduce(((e,t)=>null===t?e:null===e?t:e.concat(t)),null)}get strategy(){return null===this._strategy&&this.withStrategy(le),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(ae(this.styles)),this}static setDefaultStrategy(e){le=e}static normalize(e){return void 0===e?void 0:Array.isArray(e)?new ce(e):e instanceof ce?e:new ce([e])}}ce.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;const he=p(),de=Object.freeze({getForInstance:he.getForInstance,getByType:he.getByType,define:e=>(he.register({type:e}),e)});function ue(){return function(e){de.define(e)}}function fe(e,t,s){t.source.style.setProperty(e.targetAspect,s.bind(t))}class pe{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)=>fe(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){fe(this,e,e[this.targetAspect])}removedCallback(e){e.source.$cssBindings&&e.source.$cssBindings.delete(this)}handleChange(e,t){fe(this,t.controller,t)}}de.define(pe);const ge=`${Math.random().toString(36).substring(2,8)}`;let be=0;const ve=()=>`--v${ge}${++be}`;function ye(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];a(o)?o=new pe(se(o),ve()).createCSS(r):o instanceof ee?o=new pe(o,ve()).createCSS(r):void 0!==de.getForInstance(o)&&(o=o.createCSS(r)),o instanceof ce||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 me=(e,...t)=>{const{styles:s,behaviors:n}=ye(e,t),i=new ce(s);return n.length?i.withBehaviors(...n):i};class we{constructor(e,t){this.behaviors=t,this.css="";const s=e.reduce(((e,t)=>(c(t)?this.css+=t:e.push(t),e)),[]);s.length&&(this.styles=new ce(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)}}de.define(we),me.partial=(e,...t)=>{const{styles:s,behaviors:n}=ye(e,t);return new we(s,n)};const Ce=`fast-${Math.random().toString(36).substring(2,8)}`,Se=`${Ce}{`,xe=`}${Ce}`,Te=xe.length;let Oe=0;const Ae=()=>`${Ce}-${++Oe}`,Be=Object.freeze({interpolation:e=>`${Se}${e}${xe}`,attribute:e=>`${Ae()}="${Se}${e}${xe}"`,comment:e=>`\x3c!--${Se}${e}${xe}--\x3e`}),ke=Object.freeze({parse(e,t){const s=e.split(Se);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(xe);let o;if(-1===r)o=i;else{const e=i.substring(0,r);n.push(t[e]),o=i.substring(r+Te)}""!==o&&n.push(o)}return n}}),je=p(),$e=Object.freeze({getForInstance:je.getForInstance,getByType:je.getByType,define:(e,t)=>((t=t||{}).type=e,je.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?v.tokenList:v.property;break;case"?":e.targetAspect=t.substring(1),e.aspectType=v.booleanAttribute;break;case"@":e.targetAspect=t.substring(1),e.aspectType=v.event;break;default:e.targetAspect=t,e.aspectType=v.attribute}else e.aspectType=v.content}});function Ne(e){return function(t){$e.define(t,e)}}class Me{constructor(e){this.options=e}createHTML(e){return Be.attribute(e(this))}createBehavior(){return this}}b(Me);const Ee={[v.attribute]:S.setAttribute,[v.booleanAttribute]:S.setBooleanAttribute,[v.property]:(e,t,s)=>e[t]=s,[v.content]:function(e,t,s,n){if(null==s&&(s=""),s.create){e.textContent="";let t=e.$fastView;void 0===t?t=s.create():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}},[v.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 l=r.v;const a=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]=l,a.add(s))}}if(r.v=l+1,0!==l){l-=1;for(const e in o)o[e]===l&&a.remove(e)}},[v.event]:()=>{}};class Ve{constructor(e){this.dataBinding=e,this.updateTarget=null,this.aspectType=v.content}createHTML(e){return Be.interpolation(e(this))}createBehavior(){var e;if(null===this.updateTarget){const t=Ee[this.aspectType],s=null!==(e=this.dataBinding.policy)&&void 0!==e?e:this.policy;if(!t)throw u.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];switch(this.aspectType){case v.event:s[this.data]=e,s.addEventListener(this.targetAspect,this,this.dataBinding.options);break;case v.content:e.onUnbind(this);default:const n=null!==(t=s[this.data])&&void 0!==t?t:s[this.data]=this.dataBinding.createObserver(this,this);n.target=s,n.controller=e,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,n=t.controller;this.updateTarget(s,this.targetAspect,t.bind(n),n)}}function Ie(e,t){const s=e.parentNode;let n,i=e;for(;i!==t;)n=i.nextSibling,s.removeChild(i),i=n;s.removeChild(t)}$e.define(Ve,{aspected:!0});class ze{constructor(e,t,s){this.fragment=e,this.factories=t,this.targets=s,this.behaviors=null,this.unbindables=[],this.source=null,this.isBound=!1,this.sourceLifetime=I.unknown,this.context=this,this.index=0,this.length=0,this.firstChild=e.firstChild,this.lastChild=e.lastChild}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}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(){Ie(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){Ie(e[0].firstChild,e[e.length-1].lastChild);for(let t=0,s=e.length;t<s;++t)e[t].unbind()}}}b(ze),z.defineProperty(ze.prototype,"index"),z.defineProperty(ze.prototype,"length");const Le=(e,t)=>`${e}.${t}`,Fe={},Pe={index:0,node:null};function _e(e){e.startsWith("fast-")||u.warn(1204,{name:e})}const Re=new Proxy(document.createElement("div"),{get(e,t){_e(t);const s=Reflect.get(e,t);return a(s)?s.bind(e):s},set:(e,t,s)=>(_e(t),Reflect.set(e,t,s))});class De{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:Ae(),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=Fe[t];if(!i){const n=`_${t}`;Fe[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:Re;for(const e of this.nodeIds)s[e];return new ze(t,this.factories,s)}}function He(e,t,s,n,i,r=!1){const o=s.attributes,l=e.directives;for(let a=0,c=o.length;a<c;++a){const h=o[a],d=h.value,u=ke.parse(d,l);let f=null;null===u?r&&(f=new Ve(re((()=>d),e.policy)),$e.assignAspect(f,h.name)):f=Qe.aggregate(u,e.policy),null!==f&&(s.removeAttributeNode(h),a--,c--,e.addFactory(f,t,n,i,s.tagName))}}function Ue(e,t,s){let n=0,i=t.firstChild;for(;i;){const t=qe(e,s,i,n);i=t.node,n=t.index}}function qe(e,t,s,n){const i=Le(t,n);switch(s.nodeType){case 1:He(e,t,s,i,n),Ue(e,s,i);break;case 3:return function(e,t,s,n,i){const r=ke.parse(t.textContent,e.directives);if(null===r)return Pe.node=t.nextSibling,Pe.index=i+1,Pe;let o,l=o=t;for(let t=0,a=r.length;t<a;++t){const a=r[t];0!==t&&(i++,n=Le(s,i),o=l.parentNode.insertBefore(document.createTextNode(""),l.nextSibling)),c(a)?o.textContent=a:(o.textContent=" ",$e.assignAspect(a),e.addFactory(a,s,n,i,null)),l=o}return Pe.index=i+1,Pe.node=l.nextSibling,Pe}(e,s,t,i,n);case 8:const r=ke.parse(s.data,e.directives);null!==r&&e.addFactory(Qe.aggregate(r),t,i,n,null)}return Pe.index=n+1,Pe.node=s.nextSibling,Pe}const Qe={compile(e,t,s=S.policy){let n;if(c(e)){n=document.createElement("TEMPLATE"),n.innerHTML=s.createHTML(e);const t=n.content.firstElementChild;null!==t&&"TEMPLATE"===t.tagName&&(n=t)}else n=e;n.content.firstChild||n.content.lastChild||n.content.appendChild(document.createComment(""));const i=document.adoptNode(n.content),r=new De(i,t,s);var o,l;return He(r,"",n,"h",0,!0),o=i.firstChild,l=t,(o&&8==o.nodeType&&null!==ke.parse(o.data,l)||1===i.childNodes.length&&Object.keys(t).length>0)&&i.insertBefore(document.createComment(""),i.firstChild),Ue(r,i,"r"),Pe.node=null,r.freeze()},setDefaultStrategy(e){this.compile=e},aggregate(e,t=S.policy){if(1===e.length)return e[0];let s,n,i,r=!1;const o=e.length,l=e.map((e=>c(e)?()=>e:(s=e.sourceAspect||s,n=e.dataBinding||n,r=r||e.dataBinding.isVolatile,i=i||e.dataBinding.policy,e.dataBinding.evaluate)));n.evaluate=(e,t)=>{let s="";for(let n=0;n<o;++n)s+=l[n](e,t);return s},n.isVolatile=r,n.policy=null!=i?i:t;const a=new Ve(n);return $e.assignAspect(a,s),a}},We=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/,Je=Object.create(null);class Ke{constructor(e,t=Je){this.html=e,this.factories=t}createHTML(e){const t=this.factories;for(const s in t)e(t[s]);return this.html}}function Ge(e,t,s,n=$e.getForInstance(e)){if(n.aspected){const s=We.exec(t);null!==s&&$e.assignAspect(e,s[2])}return e.createHTML(s)}Ke.empty=new Ke(""),$e.define(Ke);class Xe{constructor(e,t={},s){this.policy=s,this.result=null,this.html=e,this.factories=t}create(e){return null===this.result&&(this.result=Qe.compile(this.html,this.factories,this.policy)),this.result.createView(e)}inline(){return new Ke(c(this.html)?this.html:this.html.innerHTML,this.factories)}withPolicy(e){if(this.result)throw u.error(1208);if(this.policy)throw u.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=Ae();return i[s]=e,s};for(let s=0,i=e.length-1;s<i;++s){const i=e[s];let o,l=t[s];if(n+=i,a(l))l=new Ve(se(l));else if(l instanceof ee)l=new Ve(l);else if(!(o=$e.getForInstance(l))){const e=l;l=new Ve(re((()=>e)))}n+=Ge(l,i,r,o)}return new Xe(n+e[e.length-1],i,s)}}b(Xe);const Ye=(e,...t)=>{if(Array.isArray(e)&&Array.isArray(e.raw))return Xe.create(e,t);throw u.error(1206)};Ye.partial=e=>new Ke(e);class Ze extends Me{bind(e){e.source[this.options]=e.targets[this.targetNodeId]}}$e.define(Ze);const et=e=>new Ze(e),tt=()=>null;function st(e){return void 0===e?tt:a(e)?e:()=>e}function nt(e,t,s){const n=a(e)?e:()=>e,i=st(t),r=st(s);return(e,t)=>n(e,t)?i(e,t):r(e,t)}const it=Object.freeze({positioning:!1,recycle:!0});function rt(e,t,s,n){e.context.parent=n.source,e.context.parentContext=n.context,e.bind(t[s])}function ot(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])}class lt{constructor(e){this.directive=e,this.items=null,this.itemsObserver=null,this.bindView=rt,this.views=[],this.itemsBindingObserver=e.dataBinding.createObserver(this,e),this.templateBindingObserver=e.templateBinding.createObserver(this,e),e.options.positioning&&(this.bindView=ot)}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),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():this.updateViews(t)}}observeItems(e=!1){if(!this.items)return void(this.items=f);const t=this.itemsObserver,s=this.itemsObserver=z.getNotifier(this.items),n=t!==s;n&&null!==t&&t.unsubscribe(this),(n||e)&&s.subscribe(this)}updateViews(e){const t=this.views,s=this.bindView,n=this.items,i=this.template,r=this.controller,o=this.directive.options.recycle,l=[];let a=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=l.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=l[a],a++),c--):d=i.create(),t.splice(p,0,d),s(d,n,p,r),d.insertBefore(h)}b[f]&&l.push(...b.slice(f))}for(let e=a,t=l.length;e<t;++e)l[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,l=this.views,a=l.length;if(0!==o&&!e&&this.directive.options.recycle||(ze.disposeContiguousBatch(l),a=0),0===a){this.views=l=new Array(o);for(let e=0;e<o;++e){const o=s.create();i(o,t,e,r),l[e]=o,o.insertBefore(n)}}else{let e=0;for(;e<o;++e)if(e<a){i(l[e],t,e,r)}else{const o=s.create();i(o,t,e,r),l.push(o),o.insertBefore(n)}const c=l.splice(e,a-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)e[t].unbind()}}class at{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.options=s,Y.enable()}createHTML(e){return Be.comment(e(this))}createBehavior(){return new lt(this)}}function ct(e,t,s=it){const n=oe(e),i=oe(t);return new at(n,i,Object.assign(Object.assign({},it),s))}$e.define(at);const ht=e=>1===e.nodeType,dt=e=>e?t=>1===t.nodeType&&t.matches(e):ht;class ut extends Me{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,f),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}}class ft extends ut{observe(e){e.addEventListener("slotchange",this)}disconnect(e){e.removeEventListener("slotchange",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 c(e)&&(e={property:e}),new ft(e)}$e.define(ft);class gt 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 bt(e){return c(e)&&(e={property:e}),new gt(e)}$e.define(gt);const vt=Object.freeze({locate:g()}),yt={toView:e=>e?"true":"false",fromView:e=>null!=e&&"false"!==e&&!1!==e&&0!==e},mt={toView:e=>"boolean"==typeof e?e.toString():"",fromView:e=>[null,void 0,void 0].includes(e)?null:yt.fromView(e)};function wt(e){if(null==e)return null;const t=1*e;return isNaN(t)?null:t}const Ct={toView(e){const t=wt(e);return t?t.toString():t},fromView:wt};class St{constructor(e,t,s=t.toLowerCase(),n="reflect",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,"boolean"===n&&void 0===i&&(this.converter=yt)}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 z.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||M.enqueue((()=>{s.add(e);const n=e[this.fieldName];switch(t){case"reflect":const t=this.converter;S.setAttribute(e,this.attribute,void 0!==t?t.toView(n):n);break;case"boolean":S.setBooleanAttribute(e,this.attribute,n)}s.delete(e)}))}static collect(e,...t){const s=[];t.push(vt.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];c(n)?s.push(new St(e,n)):s.push(new St(e,n.property,n.attribute,n.mode,n.converter))}}return s}}function xt(e,t){let s;function n(e,t){arguments.length>1&&(s.property=t),vt.locate(e.constructor).push(s)}return arguments.length>1?(s={},void n(e,t)):(s=void 0===e?{}:e,n)}const Tt={mode:"open"},Ot={},At=new Set,Bt=u.getById(l.elementRegistry,(()=>p()));class kt{constructor(e,t=e.definition){var s;this.platformDefined=!1,c(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=St.collect(e,t.attributes),r=new Array(i.length),o={},l={};for(let e=0,t=i.length;e<t;++e){const t=i[e];r[e]=t.attribute,o[t.name]=t,l[t.attribute]=t,z.defineProperty(n,t)}Reflect.defineProperty(e,"observedAttributes",{value:r,enumerable:!0}),this.attributes=i,this.propertyLookup=o,this.attributeLookup=l,this.shadowOptions=void 0===t.shadowOptions?Tt:null===t.shadowOptions?void 0:Object.assign(Object.assign({},Tt),t.shadowOptions),this.elementOptions=void 0===t.elementOptions?Ot:Object.assign(Object.assign({},Ot),t.elementOptions),this.styles=ce.normalize(t.styles),Bt.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 At.has(e)||Bt.getByType(e)?new kt(class extends e{},t):new kt(e,t)}static registerBaseType(e){At.add(e)}}kt.getByType=Bt.getByType,kt.getForInstance=Bt.getForInstance;const jt={bubbles:!0,composed:!0,cancelable:!0},$t=new WeakMap;function Nt(e){var t,s;return null!==(s=null!==(t=e.shadowRoot)&&void 0!==t?t:$t.get(e))&&void 0!==s?s:null}let Mt;class Et extends V{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._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&&$t.set(e,t))}const n=z.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 z.track(this,"isConnected"),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 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=Nt(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=Nt(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(){if(3!==this.stage)return;if(this.stage=0,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}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.needsInitialization?(this.renderTemplate(this.template),this.addStyles(this.mainStyles),this.needsInitialization=!1):null!==this.view&&this.view.bind(this.source),this.stage=1,z.notify(this,"isConnected")}disconnect(){if(1!==this.stage)return;this.stage=2,z.notify(this,"isConnected"),null!==this.view&&this.view.unbind();const e=this.behaviors;if(null!==e)for(const t of e.keys())t.disconnectedCallback&&t.disconnectedCallback(this);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},jt),s)))}renderTemplate(e){var t;const s=this.source,n=null!==(t=Nt(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=I.coupled)}static forCustomElement(e){const t=e.$fastController;if(void 0!==t)return t;const s=kt.getForInstance(e);if(void 0===s)throw u.error(1401);return e.$fastController=new Mt(e,s)}static setStrategy(e){Mt=e}}function Vt(e){var t;return"adoptedStyleSheets"in e?e:null!==(t=Nt(e))&&void 0!==t?t:e.getRootNode()}b(Et),Et.setStrategy(Et);class It{constructor(e){const t=It.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){Pt(Vt(e),this.sheets)}removeStylesFrom(e){_t(Vt(e),this.sheets)}}It.styleSheetCache=new Map;let zt=0;function Lt(e){return e===document?document.body:e}class Ft{constructor(e){this.styles=e,this.styleClass="fast-"+ ++zt}addStylesTo(e){e=Lt(Vt(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=Lt(Vt(e))).querySelectorAll(`.${this.styleClass}`);for(let s=0,n=t.length;s<n;++s)e.removeChild(t[s])}}let Pt=(e,t)=>{e.adoptedStyleSheets=[...e.adoptedStyleSheets,...t]},_t=(e,t)=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter((e=>-1===t.indexOf(e)))};if(ce.supportsAdoptedStyleSheets){try{document.adoptedStyleSheets.push(),document.adoptedStyleSheets.splice(),Pt=(e,t)=>{e.adoptedStyleSheets.push(...t)},_t=(e,t)=>{for(const s of t){const t=e.adoptedStyleSheets.indexOf(s);-1!==t&&e.adoptedStyleSheets.splice(t,1)}}}catch(e){}ce.setDefaultStrategy(It)}else ce.setDefaultStrategy(Ft);function Rt(e){const t=class extends e{constructor(){super(),Et.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 kt.registerBaseType(t),t}function Dt(e,t){return a(e)?kt.compose(e,t).define().type:kt.compose(this,e).define().type}const Ht=Object.assign(Rt(HTMLElement),{from:function(e){return Rt(e)},define:Dt,compose:function(e,t){return a(e)?kt.compose(e,t):kt.compose(this,e)}});function Ut(e){return function(t){Dt(t,e)}}S.setPolicy(N.create());export{Y as ArrayObserver,vt as AttributeConfiguration,St as AttributeDefinition,ee as Binding,pe as CSSBindingDirective,de as CSSDirective,gt as ChildrenDirective,Qe as Compiler,S as DOM,v as DOMAspect,Et as ElementController,ce as ElementStyles,_ as ExecutionContext,u as FAST,Ht as FASTElement,kt as FASTElementDefinition,Ve as HTMLBindingDirective,$e as HTMLDirective,ze as HTMLView,Ke as InlineTemplateDirective,Be as Markup,ut as NodeObservationDirective,z as Observable,ke as Parser,V as PropertyChangeNotifier,Ze as RefDirective,lt as RepeatBehavior,at as RepeatDirective,ft as SlottedDirective,I as SourceLifetime,R as Splice,J as SpliceStrategy,D as SpliceStrategySupport,Me as StatelessAttachedAttributeDirective,E as SubscriberSet,M as Updates,Xe as ViewTemplate,xt as attr,yt as booleanConverter,bt as children,me as css,ue as cssDirective,Ut as customElement,dt as elements,f as emptyArray,Ye as html,Ne as htmlDirective,Z as lengthOf,ne as listener,oe as normalizeBinding,mt as nullableBooleanConverter,Ct as nullableNumberConverter,L as observable,re as oneTime,se as oneWay,et as ref,ct as repeat,pt as slotted,F as volatile,nt as when};
@@ -876,7 +876,7 @@ const SourceLifetime = Object.freeze({
876
876
  */
877
877
  const Observable = FAST.getById(KernelServiceId.observable, () => {
878
878
  const queueUpdate = Updates.enqueue;
879
- const volatileRegex = /(:|&&|\|\||if)/;
879
+ const volatileRegex = /(:|&&|\|\||if|\?\.)/;
880
880
  const notifierLookup = new WeakMap();
881
881
  let watcher = void 0;
882
882
  let createArrayObserver = (array) => {
@@ -1557,7 +1557,7 @@ let defaultSpliceStrategy = Object.freeze({
1557
1557
  if (changes === void 0) {
1558
1558
  return emptyArray;
1559
1559
  }
1560
- return changes.length > 1 ? project(current, changes) : changes;
1560
+ return project(current, changes);
1561
1561
  }
1562
1562
  return resetSplices;
1563
1563
  },
@@ -1 +1 @@
1
- let e;try{if(document.currentScript)e=document.currentScript.getAttribute("fast-kernel");else{const t=document.getElementsByTagName("script");e=t[t.length-1].getAttribute("fast-kernel")}}catch(t){e="isolate"}let t;switch(e){case"share":t=Object.freeze({updateQueue:1,observable:2,contextEvent:3,elementRegistry:4});break;case"share-v2":t=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)}`;t=Object.freeze({updateQueue:`1.2${e}`,observable:`2.2${e}`,contextEvent:`3.2${e}`,elementRegistry:`4.2${e}`})}const s=e=>"function"==typeof e,i=e=>"string"==typeof e,n=()=>{};!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 r={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},r));const o=globalThis.FAST;if(void 0===o.getById){const e=Object.create(null);Reflect.defineProperty(o,"getById",Object.assign({value(t,s){let i=e[t];return void 0===i&&(i=s?e[t]=s():null),i}},r))}void 0===o.error&&Object.assign(o,{warn(){},error:e=>new Error(`Error ${e}`),addMessages(){}});const l=Object.freeze([]);function a(){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 h(e){e.prototype.toJSON=n}const d=Object.freeze({none:0,attribute:1,booleanAttribute:2,property:3,content:4,tokenList:5,event:6}),u=e=>e,f=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:u}):{createHTML:u};let p=Object.freeze({createHTML:e=>f.createHTML(e),protect:(e,t,s,i)=>i});const g=p,b=Object.freeze({get policy(){return p},setPolicy(e){if(p!==g)throw o.error(1201);p=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 v(e,t,s,n){return(e,t,s,...r)=>{i(s)&&(s=s.replace("javascript:","")),n(e,t,s,...r)}}function y(e,t,s,i){throw o.error(1209,{aspectName:s,tagName:null!=e?e:"text"})}const m={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},w={elements:{a:{[d.attribute]:{href:v},[d.property]:{href:v}},area:{[d.attribute]:{href:v},[d.property]:{href:v}},button:{[d.attribute]:{formaction:v},[d.property]:{formAction:v}},embed:{[d.attribute]:{src:y},[d.property]:{src:y}},form:{[d.attribute]:{action:v},[d.property]:{action:v}},frame:{[d.attribute]:{src:v},[d.property]:{src:v}},iframe:{[d.attribute]:{src:v},[d.property]:{src:v,srcdoc:y}},input:{[d.attribute]:{formaction:v},[d.property]:{formAction:v}},link:{[d.attribute]:{href:y},[d.property]:{href:y}},object:{[d.attribute]:{codebase:y,data:y},[d.property]:{codeBase:y,data:y}},script:{[d.attribute]:{src:y,text:y},[d.property]:{src:y,text:y,innerText:y,textContent:y}},style:{[d.property]:{innerText:y,textContent:y}}},aspects:{[d.attribute]:Object.assign({},m),[d.property]:Object.assign({innerHTML:y},m),[d.event]:Object.assign({},m)}};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 S(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 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]=S(n,{});break;default:s[i]=S(n,r)}}for(const t in e)t in s||(s[t]=S(e[t],{}));return Object.freeze(s)}function T(e,t,s,i,n){const r=e[s];if(r){const e=r[i];if(e)return e(t,s,i,n)}}const O=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=w,Object.freeze({elements:r.elements?x(r.elements,o.elements):o.elements,aspects:r.aspects?S(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(),l=n.elements[o];if(l){const n=T(l,e,t,s,i);if(n)return n}return null!==(r=T(n.aspects,e,t,s,i))&&void 0!==r?r:i}})}}),A=o.getById(t.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 l(t){e.push(t),e.length<2&&(i?s(o):o())}return Object.freeze({enqueue:l,next:()=>new Promise(l),process:o,setMode:e=>i=e})}));class B{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 B(this.subject):null!==(i=this.subjectSubscribers)&&void 0!==i?i:this.subjectSubscribers=new B(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 j=Object.freeze({unknown:void 0,coupled:1}),$=o.getById(t.observable,(()=>{const e=A.enqueue,t=/(:|&&|\|\||if)/,n=new WeakMap;let r,l=e=>{throw o.error(1101)};function a(e){var t;let s=null!==(t=e.$fastController)&&void 0!==t?t:n.get(e);return void 0===s&&(Array.isArray(e)?s=l(e):n.set(e,s=new k(e))),s}const d=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 i=this.field,n=e[i];if(n!==t){e[i]=t;const r=e[this.callback];s(r)&&r.call(e,n,t),a(e).notify(this.name)}}}class f extends B{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!==j.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=a(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 h(f),Object.freeze({setArrayObserverFactory(e){l=e},getNotifier:a,track(e,t){r&&r.watch(e,t)},trackVolatile(){r&&(r.needsRefresh=!0)},notify(e,t){a(e).notify(t)},defineProperty(e,t){i(t)&&(t=new u(t)),d(e).push(t),Reflect.defineProperty(e,t.name,{enumerable:!0,get(){return t.getValue(this)},set(e){t.setValue(this,e)}})},getAccessors:d,binding(e,t,s=this.isVolatileBinding(e)){return new f(e,t,s)},isVolatileBinding:e=>t.test(e.toString())})}));function N(e,t){$.defineProperty(e,t)}function V(e,t,s){return Object.assign({},s,{get(){return $.trackVolatile(),s.get.apply(this)}})}const z=o.getById(t.contextEvent,(()=>{let e=null;return{get:()=>e,set(t){e=t}}})),E=Object.freeze({default:{index:0,length:0,get event(){return E.getEvent()},eventDetail(){return this.event.detail},eventTarget(){return this.event.target}},getEvent:()=>z.get(),setEvent(e){z.set(e)}});class L{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}}const I=Object.freeze({reset:1,splice:2,optimized:3}),M=new L(0,l,0);M.reset=!0;const _=[M];function F(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 L(t,[],0);for(;n<r;)e.removed.push(i[n++]);return[e]}if(n===r)return[new L(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],l=e[t][s-1];let a;a=o<l?o<r?o:r:l<r?l:r,a===r?(r===i?n.push(0):(n.push(1),i=r),t--,s--):a===o?(n.push(3),t--,i=o):(n.push(2),s--,i=l)}return n.reverse()}(function(e,t,s,i,n,r){const o=r-n+1,l=s-t+1,a=new Array(o);let c,h;for(let e=0;e<o;++e)a[e]=new Array(l),a[e][0]=e;for(let e=0;e<l;++e)a[0][e]=e;for(let s=1;s<o;++s)for(let r=1;r<l;++r)e[t+r-1]===i[n+s-1]?a[s][r]=a[s-1][r-1]:(c=a[s-1][r]+1,h=a[s][r-1]+1,a[s][r]=c<h?c:h);return a}(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 L(f,[],0)),u.addedCount++,f++,u.removed.push(i[p]),p++;break;case 2:void 0===u&&(u=new L(f,[],0)),u.addedCount++,f++;break;case 3:void 0===u&&(u=new L(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 a=0;a<t.length;a++){const c=t[a];if(c.index+=i,s)continue;const h=(n=e.index,r=e.index+e.removed.length,o=c.index,l=c.index+c.addedCount,r<o||l<n?-1:r===o||l===n?0:n<o?r<l?r-o:l-o:l<r?l-n:r-n);if(h>=0){t.splice(a,1),a--,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(a,0,e),a++;const n=e.addedCount-e.removed.length;c.index+=n,i+=n}}var n,r,o,l;s||t.push(e)}let R=Object.freeze({support:I.optimized,normalize:(e,t,s)=>void 0===e?void 0===s?l:s.length>1?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(F(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):s:_,pop(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new L(e.length,[r],0)),r},push(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new L(e.length-i.length,[],i.length).adjustTo(e)),n},reverse(e,t,s,i){const n=s.apply(e,i);return t.reset(e),n},shift(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new L(0,[r],0)),r},sort(e,t,s,i){const n=s.apply(e,i);return t.reset(e),n},splice(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new L(+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 L(0,[],i.length).adjustTo(e)),n}});const H=Object.freeze({reset:_,setDefaultStrategy(e){R=e}});function D(e,t,s){Reflect.defineProperty(e,t,{value:s,enumerable:!1})}class Q extends B{constructor(e){super(e),this.oldCollection=void 0,this.splices=void 0,this.needsQueue=!0,this._strategy=null,this._lengthObserver=void 0,this.call=this.flush,D(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}subscribe(e){this.flush(),super.subscribe(e)}addSplice(e){void 0===this.splices?this.splices=[e]:this.splices.push(e),this.enqueue()}reset(e){this.oldCollection=e,this.enqueue()}flush(){var e;const t=this.splices,s=this.oldCollection;void 0===t&&void 0===s||(this.needsQueue=!0,this.splices=void 0,this.oldCollection=void 0,this.notify((null!==(e=this._strategy)&&void 0!==e?e:R).normalize(s,this.subject,t)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,A.enqueue(this))}}let q=!1;const U=Object.freeze({enable(){if(q)return;q=!0,$.setArrayObserverFactory((e=>new Q(e)));const e=Array.prototype;e.$fastPatch||(D(e,"$fastPatch",1),[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:R)[t.name](this,i,t,e)}})))}});function W(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(U.enable(),t=$.getNotifier(e)),$.track(t.lengthObserver,"length"),e.length}class J{constructor(e,t,s=!1){this.evaluate=e,this.policy=t,this.isVolatile=s}}class G extends J{createObserver(e){return $.binding(this.evaluate,e,this.isVolatile)}}function K(e,t,s=$.isVolatileBinding(e)){return new G(e,t,s)}function X(e,t){const s=new G(e);return s.options=t,s}class Y extends J{createObserver(){return this}bind(e){return this.evaluate(e.source,e.context)}}function Z(e,t){return new Y(e,t)}function ee(e){return s(e)?K(e):e instanceof J?e:Z((()=>e))}let te;function se(e){return e.map((e=>e instanceof ie?se(e.styles):[e])).reduce(((e,t)=>e.concat(t)),[])}h(Y);class ie{constructor(e){this.styles=e,this.targets=new WeakSet,this._strategy=null,this.behaviors=e.map((e=>e instanceof ie?e.behaviors:null)).reduce(((e,t)=>null===t?e:null===e?t:e.concat(t)),null)}get strategy(){return null===this._strategy&&this.withStrategy(te),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(se(this.styles)),this}static setDefaultStrategy(e){te=e}static normalize(e){return void 0===e?void 0:Array.isArray(e)?new ie(e):e instanceof ie?e:new ie([e])}}ie.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;const ne=a(),re=Object.freeze({getForInstance:ne.getForInstance,getByType:ne.getByType,define:e=>(ne.register({type:e}),e)});function oe(){return function(e){re.define(e)}}function le(e,t,s){t.source.style.setProperty(e.targetAspect,s.bind(t))}class ae{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)=>le(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){le(this,e,e[this.targetAspect])}removedCallback(e){e.source.$cssBindings&&e.source.$cssBindings.delete(this)}handleChange(e,t){le(this,t.controller,t)}}re.define(ae);const ce=`${Math.random().toString(36).substring(2,8)}`;let he=0;const de=()=>`--v${ce}${++he}`;function ue(e,t){const i=[];let n="";const r=[],o=e=>{r.push(e)};for(let r=0,l=e.length-1;r<l;++r){n+=e[r];let l=t[r];s(l)?l=new ae(K(l),de()).createCSS(o):l instanceof J?l=new ae(l,de()).createCSS(o):void 0!==re.getForInstance(l)&&(l=l.createCSS(o)),l instanceof ie||l instanceof CSSStyleSheet?(""!==n.trim()&&(i.push(n),n=""),i.push(l)):n+=l}return n+=e[e.length-1],""!==n.trim()&&i.push(n),{styles:i,behaviors:r}}const fe=(e,...t)=>{const{styles:s,behaviors:i}=ue(e,t),n=new ie(s);return i.length?n.withBehaviors(...i):n};class pe{constructor(e,t){this.behaviors=t,this.css="";const s=e.reduce(((e,t)=>(i(t)?this.css+=t:e.push(t),e)),[]);s.length&&(this.styles=new ie(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)}}re.define(pe),fe.partial=(e,...t)=>{const{styles:s,behaviors:i}=ue(e,t);return new pe(s,i)};const ge=`fast-${Math.random().toString(36).substring(2,8)}`,be=`${ge}{`,ve=`}${ge}`,ye=ve.length;let me=0;const we=()=>`${ge}-${++me}`,Ce=Object.freeze({interpolation:e=>`${be}${e}${ve}`,attribute:e=>`${we()}="${be}${e}${ve}"`,comment:e=>`\x3c!--${be}${e}${ve}--\x3e`}),Se=Object.freeze({parse(e,t){const s=e.split(be);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(ve);let o;if(-1===r)o=n;else{const e=n.substring(0,r);i.push(t[e]),o=n.substring(r+ye)}""!==o&&i.push(o)}return i}}),xe=a(),Te=Object.freeze({getForInstance:xe.getForInstance,getByType:xe.getByType,define:(e,t)=>((t=t||{}).type=e,xe.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?d.tokenList:d.property;break;case"?":e.targetAspect=t.substring(1),e.aspectType=d.booleanAttribute;break;case"@":e.targetAspect=t.substring(1),e.aspectType=d.event;break;default:e.targetAspect=t,e.aspectType=d.attribute}else e.aspectType=d.content}});function Oe(e){return function(t){Te.define(t,e)}}class Ae{constructor(e){this.options=e}createHTML(e){return Ce.attribute(e(this))}createBehavior(){return this}}h(Ae);const Be={[d.attribute]:b.setAttribute,[d.booleanAttribute]:b.setBooleanAttribute,[d.property]:(e,t,s)=>e[t]=s,[d.content]:function(e,t,s,i){if(null==s&&(s=""),s.create){e.textContent="";let t=e.$fastView;void 0===t?t=s.create():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}},[d.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 l=r.v;const a=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]=l,a.add(s))}}if(r.v=l+1,0!==l){l-=1;for(const e in o)o[e]===l&&a.remove(e)}},[d.event]:()=>{}};class ke{constructor(e){this.dataBinding=e,this.updateTarget=null,this.aspectType=d.content}createHTML(e){return Ce.interpolation(e(this))}createBehavior(){var e;if(null===this.updateTarget){const t=Be[this.aspectType],s=null!==(e=this.dataBinding.policy)&&void 0!==e?e:this.policy;if(!t)throw o.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];switch(this.aspectType){case d.event:s[this.data]=e,s.addEventListener(this.targetAspect,this,this.dataBinding.options);break;case d.content:e.onUnbind(this);default:const i=null!==(t=s[this.data])&&void 0!==t?t:s[this.data]=this.dataBinding.createObserver(this,this);i.target=s,i.controller=e,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){E.setEvent(e);const s=this.dataBinding.evaluate(t.source,t.context);E.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)}}function je(e,t){const s=e.parentNode;let i,n=e;for(;n!==t;)i=n.nextSibling,s.removeChild(n),n=i;s.removeChild(t)}Te.define(ke,{aspected:!0});class $e{constructor(e,t,s){this.fragment=e,this.factories=t,this.targets=s,this.behaviors=null,this.unbindables=[],this.source=null,this.isBound=!1,this.sourceLifetime=j.unknown,this.context=this,this.index=0,this.length=0,this.firstChild=e.firstChild,this.lastChild=e.lastChild}get event(){return E.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}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(){je(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){je(e[0].firstChild,e[e.length-1].lastChild);for(let t=0,s=e.length;t<s;++t)e[t].unbind()}}}h($e),$.defineProperty($e.prototype,"index"),$.defineProperty($e.prototype,"length");const Ne=(e,t)=>`${e}.${t}`,Ve={},ze={index:0,node:null};function Ee(e){e.startsWith("fast-")||o.warn(1204,{name:e})}const Le=new Proxy(document.createElement("div"),{get(e,t){Ee(t);const i=Reflect.get(e,t);return s(i)?i.bind(e):i},set:(e,t,s)=>(Ee(t),Reflect.set(e,t,s))});class Ie{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:we(),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=Ve[t];if(!n){const i=`_${t}`;Ve[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:Le;for(const e of this.nodeIds)s[e];return new $e(t,this.factories,s)}}function Me(e,t,s,i,n,r=!1){const o=s.attributes,l=e.directives;for(let a=0,c=o.length;a<c;++a){const h=o[a],d=h.value,u=Se.parse(d,l);let f=null;null===u?r&&(f=new ke(Z((()=>d),e.policy)),Te.assignAspect(f,h.name)):f=Pe.aggregate(u,e.policy),null!==f&&(s.removeAttributeNode(h),a--,c--,e.addFactory(f,t,i,n,s.tagName))}}function _e(e,t,s){let i=0,n=t.firstChild;for(;n;){const t=Fe(e,s,n,i);n=t.node,i=t.index}}function Fe(e,t,s,n){const r=Ne(t,n);switch(s.nodeType){case 1:Me(e,t,s,r,n),_e(e,s,r);break;case 3:return function(e,t,s,n,r){const o=Se.parse(t.textContent,e.directives);if(null===o)return ze.node=t.nextSibling,ze.index=r+1,ze;let l,a=l=t;for(let t=0,c=o.length;t<c;++t){const c=o[t];0!==t&&(r++,n=Ne(s,r),l=a.parentNode.insertBefore(document.createTextNode(""),a.nextSibling)),i(c)?l.textContent=c:(l.textContent=" ",Te.assignAspect(c),e.addFactory(c,s,n,r,null)),a=l}return ze.index=r+1,ze.node=a.nextSibling,ze}(e,s,t,r,n);case 8:const o=Se.parse(s.data,e.directives);null!==o&&e.addFactory(Pe.aggregate(o),t,r,n,null)}return ze.index=n+1,ze.node=s.nextSibling,ze}const Pe={compile(e,t,s=b.policy){let n;if(i(e)){n=document.createElement("TEMPLATE"),n.innerHTML=s.createHTML(e);const t=n.content.firstElementChild;null!==t&&"TEMPLATE"===t.tagName&&(n=t)}else n=e;n.content.firstChild||n.content.lastChild||n.content.appendChild(document.createComment(""));const r=document.adoptNode(n.content),o=new Ie(r,t,s);var l,a;return Me(o,"",n,"h",0,!0),l=r.firstChild,a=t,(l&&8==l.nodeType&&null!==Se.parse(l.data,a)||1===r.childNodes.length&&Object.keys(t).length>0)&&r.insertBefore(document.createComment(""),r.firstChild),_e(o,r,"r"),ze.node=null,o.freeze()},setDefaultStrategy(e){this.compile=e},aggregate(e,t=b.policy){if(1===e.length)return e[0];let s,n,r,o=!1;const l=e.length,a=e.map((e=>i(e)?()=>e:(s=e.sourceAspect||s,n=e.dataBinding||n,o=o||e.dataBinding.isVolatile,r=r||e.dataBinding.policy,e.dataBinding.evaluate)));n.evaluate=(e,t)=>{let s="";for(let i=0;i<l;++i)s+=a[i](e,t);return s},n.isVolatile=o,n.policy=null!=r?r:t;const c=new ke(n);return Te.assignAspect(c,s),c}},Re=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/,He=Object.create(null);class De{constructor(e,t=He){this.html=e,this.factories=t}createHTML(e){const t=this.factories;for(const s in t)e(t[s]);return this.html}}function Qe(e,t,s,i=Te.getForInstance(e)){if(i.aspected){const s=Re.exec(t);null!==s&&Te.assignAspect(e,s[2])}return e.createHTML(s)}De.empty=new De(""),Te.define(De);class qe{constructor(e,t={},s){this.policy=s,this.result=null,this.html=e,this.factories=t}create(e){return null===this.result&&(this.result=Pe.compile(this.html,this.factories,this.policy)),this.result.createView(e)}inline(){return new De(i(this.html)?this.html:this.html.innerHTML,this.factories)}withPolicy(e){if(this.result)throw o.error(1208);if(this.policy)throw o.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,i){let n="";const r=Object.create(null),o=e=>{var t;const s=null!==(t=e.id)&&void 0!==t?t:e.id=we();return r[s]=e,s};for(let i=0,r=e.length-1;i<r;++i){const r=e[i];let l,a=t[i];if(n+=r,s(a))a=new ke(K(a));else if(a instanceof J)a=new ke(a);else if(!(l=Te.getForInstance(a))){const e=a;a=new ke(Z((()=>e)))}n+=Qe(a,r,o,l)}return new qe(n+e[e.length-1],r,i)}}h(qe);const Ue=(e,...t)=>{if(Array.isArray(e)&&Array.isArray(e.raw))return qe.create(e,t);throw o.error(1206)};Ue.partial=e=>new De(e);class We extends Ae{bind(e){e.source[this.options]=e.targets[this.targetNodeId]}}Te.define(We);const Je=e=>new We(e),Ge=()=>null;function Ke(e){return void 0===e?Ge:s(e)?e:()=>e}function Xe(e,t,i){const n=s(e)?e:()=>e,r=Ke(t),o=Ke(i);return(e,t)=>n(e,t)?r(e,t):o(e,t)}const Ye=Object.freeze({positioning:!1,recycle:!0});function Ze(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])}class tt{constructor(e){this.directive=e,this.items=null,this.itemsObserver=null,this.bindView=Ze,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),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():this.updateViews(t)}}observeItems(e=!1){if(!this.items)return void(this.items=l);const t=this.itemsObserver,s=this.itemsObserver=$.getNotifier(this.items),i=t!==s;i&&null!==t&&t.unsubscribe(this),(i||e)&&s.subscribe(this)}updateViews(e){const t=this.views,s=this.bindView,i=this.items,n=this.template,r=this.controller,o=this.directive.options.recycle,l=[];let a=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=l.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=l[a],a++),c--):d=n.create(),t.splice(p,0,d),s(d,i,p,r),d.insertBefore(h)}b[f]&&l.push(...b.slice(f))}for(let e=a,t=l.length;e<t;++e)l[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,l=this.views,a=l.length;if(0!==o&&!e&&this.directive.options.recycle||($e.disposeContiguousBatch(l),a=0),0===a){this.views=l=new Array(o);for(let e=0;e<o;++e){const o=s.create();n(o,t,e,r),l[e]=o,o.insertBefore(i)}}else{let e=0;for(;e<o;++e)if(e<a){n(l[e],t,e,r)}else{const o=s.create();n(o,t,e,r),l.push(o),o.insertBefore(i)}const c=l.splice(e,a-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)e[t].unbind()}}class st{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.options=s,U.enable()}createHTML(e){return Ce.comment(e(this))}createBehavior(){return new tt(this)}}function it(e,t,s=Ye){const i=ee(e),n=ee(t);return new st(i,n,Object.assign(Object.assign({},Ye),s))}Te.define(st);const nt=e=>1===e.nodeType,rt=e=>e?t=>1===t.nodeType&&t.matches(e):nt;class ot extends Ae{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}}class lt extends ot{observe(e){e.addEventListener("slotchange",this)}disconnect(e){e.removeEventListener("slotchange",this)}getNodes(e){return e.assignedNodes(this.options)}handleEvent(e){const t=e.currentTarget;this.updateTarget(this.getSource(t),this.computeNodes(t))}}function at(e){return i(e)&&(e={property:e}),new lt(e)}Te.define(lt);class ct extends ot{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=n,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 ht(e){return i(e)&&(e={property:e}),new ct(e)}Te.define(ct);const dt=Object.freeze({locate:c()}),ut={toView:e=>e?"true":"false",fromView:e=>null!=e&&"false"!==e&&!1!==e&&0!==e},ft={toView:e=>"boolean"==typeof e?e.toString():"",fromView:e=>[null,void 0,void 0].includes(e)?null:ut.fromView(e)};function pt(e){if(null==e)return null;const t=1*e;return isNaN(t)?null:t}const gt={toView(e){const t=pt(e);return t?t.toString():t},fromView:pt};class bt{constructor(e,t,s=t.toLowerCase(),i="reflect",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,"boolean"===i&&void 0===n&&(this.converter=ut)}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||A.enqueue((()=>{s.add(e);const i=e[this.fieldName];switch(t){case"reflect":const t=this.converter;b.setAttribute(e,this.attribute,void 0!==t?t.toView(i):i);break;case"boolean":b.setBooleanAttribute(e,this.attribute,i)}s.delete(e)}))}static collect(e,...t){const s=[];t.push(dt.locate(e));for(let n=0,r=t.length;n<r;++n){const r=t[n];if(void 0!==r)for(let t=0,n=r.length;t<n;++t){const n=r[t];i(n)?s.push(new bt(e,n)):s.push(new bt(e,n.property,n.attribute,n.mode,n.converter))}}return s}}function vt(e,t){let s;function i(e,t){arguments.length>1&&(s.property=t),dt.locate(e.constructor).push(s)}return arguments.length>1?(s={},void i(e,t)):(s=void 0===e?{}:e,i)}const yt={mode:"open"},mt={},wt=new Set,Ct=o.getById(t.elementRegistry,(()=>a()));class St{constructor(e,t=e.definition){var s;this.platformDefined=!1,i(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,r=bt.collect(e,t.attributes),o=new Array(r.length),l={},a={};for(let e=0,t=r.length;e<t;++e){const t=r[e];o[e]=t.attribute,l[t.name]=t,a[t.attribute]=t,$.defineProperty(n,t)}Reflect.defineProperty(e,"observedAttributes",{value:o,enumerable:!0}),this.attributes=r,this.propertyLookup=l,this.attributeLookup=a,this.shadowOptions=void 0===t.shadowOptions?yt:null===t.shadowOptions?void 0:Object.assign(Object.assign({},yt),t.shadowOptions),this.elementOptions=void 0===t.elementOptions?mt:Object.assign(Object.assign({},mt),t.elementOptions),this.styles=ie.normalize(t.styles),Ct.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 wt.has(e)||Ct.getByType(e)?new St(class extends e{},t):new St(e,t)}static registerBaseType(e){wt.add(e)}}St.getByType=Ct.getByType,St.getForInstance=Ct.getForInstance;const xt={bubbles:!0,composed:!0,cancelable:!0},Tt=new WeakMap;function Ot(e){var t,s;return null!==(s=null!==(t=e.shadowRoot)&&void 0!==t?t:Tt.get(e))&&void 0!==s?s:null}let At;class Bt 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._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&&Tt.set(e,t))}const i=$.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 $.track(this,"isConnected"),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:E.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=Ot(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=Ot(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(){if(3!==this.stage)return;if(this.stage=0,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}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.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,"isConnected")}disconnect(){if(1!==this.stage)return;this.stage=2,$.notify(this,"isConnected"),null!==this.view&&this.view.unbind();const e=this.behaviors;if(null!==e)for(const t of e.keys())t.disconnectedCallback&&t.disconnectedCallback(this);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},xt),s)))}renderTemplate(e){var t;const s=this.source,i=null!==(t=Ot(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=j.coupled)}static forCustomElement(e){const t=e.$fastController;if(void 0!==t)return t;const s=St.getForInstance(e);if(void 0===s)throw o.error(1401);return e.$fastController=new At(e,s)}static setStrategy(e){At=e}}function kt(e){var t;return"adoptedStyleSheets"in e?e:null!==(t=Ot(e))&&void 0!==t?t:e.getRootNode()}h(Bt),Bt.setStrategy(Bt);class jt{constructor(e){const t=jt.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){zt(kt(e),this.sheets)}removeStylesFrom(e){Et(kt(e),this.sheets)}}jt.styleSheetCache=new Map;let $t=0;function Nt(e){return e===document?document.body:e}class Vt{constructor(e){this.styles=e,this.styleClass="fast-"+ ++$t}addStylesTo(e){e=Nt(kt(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=Nt(kt(e))).querySelectorAll(`.${this.styleClass}`);for(let s=0,i=t.length;s<i;++s)e.removeChild(t[s])}}let zt=(e,t)=>{e.adoptedStyleSheets=[...e.adoptedStyleSheets,...t]},Et=(e,t)=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter((e=>-1===t.indexOf(e)))};if(ie.supportsAdoptedStyleSheets){try{document.adoptedStyleSheets.push(),document.adoptedStyleSheets.splice(),zt=(e,t)=>{e.adoptedStyleSheets.push(...t)},Et=(e,t)=>{for(const s of t){const t=e.adoptedStyleSheets.indexOf(s);-1!==t&&e.adoptedStyleSheets.splice(t,1)}}}catch(e){}ie.setDefaultStrategy(jt)}else ie.setDefaultStrategy(Vt);function Lt(e){const t=class extends e{constructor(){super(),Bt.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 St.registerBaseType(t),t}function It(e,t){return s(e)?St.compose(e,t).define().type:St.compose(this,e).define().type}const Mt=Object.assign(Lt(HTMLElement),{from:function(e){return Lt(e)},define:It,compose:function(e,t){return s(e)?St.compose(e,t):St.compose(this,e)}});function _t(e){return function(t){It(t,e)}}b.setPolicy(O.create());export{U as ArrayObserver,dt as AttributeConfiguration,bt as AttributeDefinition,J as Binding,ae as CSSBindingDirective,re as CSSDirective,ct as ChildrenDirective,Pe as Compiler,b as DOM,d as DOMAspect,Bt as ElementController,ie as ElementStyles,E as ExecutionContext,o as FAST,Mt as FASTElement,St as FASTElementDefinition,ke as HTMLBindingDirective,Te as HTMLDirective,$e as HTMLView,De as InlineTemplateDirective,Ce as Markup,ot as NodeObservationDirective,$ as Observable,Se as Parser,k as PropertyChangeNotifier,We as RefDirective,tt as RepeatBehavior,st as RepeatDirective,lt as SlottedDirective,j as SourceLifetime,L as Splice,H as SpliceStrategy,I as SpliceStrategySupport,Ae as StatelessAttachedAttributeDirective,B as SubscriberSet,A as Updates,qe as ViewTemplate,vt as attr,ut as booleanConverter,ht as children,fe as css,oe as cssDirective,_t as customElement,rt as elements,l as emptyArray,Ue as html,Oe as htmlDirective,W as lengthOf,X as listener,ee as normalizeBinding,ft as nullableBooleanConverter,gt as nullableNumberConverter,N as observable,Z as oneTime,K as oneWay,Je as ref,it as repeat,at as slotted,V as volatile,Xe as when};
1
+ let e;try{if(document.currentScript)e=document.currentScript.getAttribute("fast-kernel");else{const t=document.getElementsByTagName("script");e=t[t.length-1].getAttribute("fast-kernel")}}catch(t){e="isolate"}let t;switch(e){case"share":t=Object.freeze({updateQueue:1,observable:2,contextEvent:3,elementRegistry:4});break;case"share-v2":t=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)}`;t=Object.freeze({updateQueue:`1.2${e}`,observable:`2.2${e}`,contextEvent:`3.2${e}`,elementRegistry:`4.2${e}`})}const s=e=>"function"==typeof e,i=e=>"string"==typeof e,n=()=>{};!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 r={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},r));const o=globalThis.FAST;if(void 0===o.getById){const e=Object.create(null);Reflect.defineProperty(o,"getById",Object.assign({value(t,s){let i=e[t];return void 0===i&&(i=s?e[t]=s():null),i}},r))}void 0===o.error&&Object.assign(o,{warn(){},error:e=>new Error(`Error ${e}`),addMessages(){}});const l=Object.freeze([]);function a(){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 h(e){e.prototype.toJSON=n}const d=Object.freeze({none:0,attribute:1,booleanAttribute:2,property:3,content:4,tokenList:5,event:6}),u=e=>e,f=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:u}):{createHTML:u};let p=Object.freeze({createHTML:e=>f.createHTML(e),protect:(e,t,s,i)=>i});const g=p,b=Object.freeze({get policy(){return p},setPolicy(e){if(p!==g)throw o.error(1201);p=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 v(e,t,s,n){return(e,t,s,...r)=>{i(s)&&(s=s.replace("javascript:","")),n(e,t,s,...r)}}function y(e,t,s,i){throw o.error(1209,{aspectName:s,tagName:null!=e?e:"text"})}const m={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},w={elements:{a:{[d.attribute]:{href:v},[d.property]:{href:v}},area:{[d.attribute]:{href:v},[d.property]:{href:v}},button:{[d.attribute]:{formaction:v},[d.property]:{formAction:v}},embed:{[d.attribute]:{src:y},[d.property]:{src:y}},form:{[d.attribute]:{action:v},[d.property]:{action:v}},frame:{[d.attribute]:{src:v},[d.property]:{src:v}},iframe:{[d.attribute]:{src:v},[d.property]:{src:v,srcdoc:y}},input:{[d.attribute]:{formaction:v},[d.property]:{formAction:v}},link:{[d.attribute]:{href:y},[d.property]:{href:y}},object:{[d.attribute]:{codebase:y,data:y},[d.property]:{codeBase:y,data:y}},script:{[d.attribute]:{src:y,text:y},[d.property]:{src:y,text:y,innerText:y,textContent:y}},style:{[d.property]:{innerText:y,textContent:y}}},aspects:{[d.attribute]:Object.assign({},m),[d.property]:Object.assign({innerHTML:y},m),[d.event]:Object.assign({},m)}};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 S(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 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]=S(n,{});break;default:s[i]=S(n,r)}}for(const t in e)t in s||(s[t]=S(e[t],{}));return Object.freeze(s)}function T(e,t,s,i,n){const r=e[s];if(r){const e=r[i];if(e)return e(t,s,i,n)}}const O=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=w,Object.freeze({elements:r.elements?x(r.elements,o.elements):o.elements,aspects:r.aspects?S(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(),l=n.elements[o];if(l){const n=T(l,e,t,s,i);if(n)return n}return null!==(r=T(n.aspects,e,t,s,i))&&void 0!==r?r:i}})}}),A=o.getById(t.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 l(t){e.push(t),e.length<2&&(i?s(o):o())}return Object.freeze({enqueue:l,next:()=>new Promise(l),process:o,setMode:e=>i=e})}));class B{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 B(this.subject):null!==(i=this.subjectSubscribers)&&void 0!==i?i:this.subjectSubscribers=new B(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 j=Object.freeze({unknown:void 0,coupled:1}),$=o.getById(t.observable,(()=>{const e=A.enqueue,t=/(:|&&|\|\||if|\?\.)/,n=new WeakMap;let r,l=e=>{throw o.error(1101)};function a(e){var t;let s=null!==(t=e.$fastController)&&void 0!==t?t:n.get(e);return void 0===s&&(Array.isArray(e)?s=l(e):n.set(e,s=new k(e))),s}const d=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 i=this.field,n=e[i];if(n!==t){e[i]=t;const r=e[this.callback];s(r)&&r.call(e,n,t),a(e).notify(this.name)}}}class f extends B{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!==j.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=a(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 h(f),Object.freeze({setArrayObserverFactory(e){l=e},getNotifier:a,track(e,t){r&&r.watch(e,t)},trackVolatile(){r&&(r.needsRefresh=!0)},notify(e,t){a(e).notify(t)},defineProperty(e,t){i(t)&&(t=new u(t)),d(e).push(t),Reflect.defineProperty(e,t.name,{enumerable:!0,get(){return t.getValue(this)},set(e){t.setValue(this,e)}})},getAccessors:d,binding(e,t,s=this.isVolatileBinding(e)){return new f(e,t,s)},isVolatileBinding:e=>t.test(e.toString())})}));function N(e,t){$.defineProperty(e,t)}function V(e,t,s){return Object.assign({},s,{get(){return $.trackVolatile(),s.get.apply(this)}})}const z=o.getById(t.contextEvent,(()=>{let e=null;return{get:()=>e,set(t){e=t}}})),E=Object.freeze({default:{index:0,length:0,get event(){return E.getEvent()},eventDetail(){return this.event.detail},eventTarget(){return this.event.target}},getEvent:()=>z.get(),setEvent(e){z.set(e)}});class L{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}}const I=Object.freeze({reset:1,splice:2,optimized:3}),M=new L(0,l,0);M.reset=!0;const _=[M];function F(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 L(t,[],0);for(;n<r;)e.removed.push(i[n++]);return[e]}if(n===r)return[new L(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],l=e[t][s-1];let a;a=o<l?o<r?o:r:l<r?l:r,a===r?(r===i?n.push(0):(n.push(1),i=r),t--,s--):a===o?(n.push(3),t--,i=o):(n.push(2),s--,i=l)}return n.reverse()}(function(e,t,s,i,n,r){const o=r-n+1,l=s-t+1,a=new Array(o);let c,h;for(let e=0;e<o;++e)a[e]=new Array(l),a[e][0]=e;for(let e=0;e<l;++e)a[0][e]=e;for(let s=1;s<o;++s)for(let r=1;r<l;++r)e[t+r-1]===i[n+s-1]?a[s][r]=a[s-1][r-1]:(c=a[s-1][r]+1,h=a[s][r-1]+1,a[s][r]=c<h?c:h);return a}(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 L(f,[],0)),u.addedCount++,f++,u.removed.push(i[p]),p++;break;case 2:void 0===u&&(u=new L(f,[],0)),u.addedCount++,f++;break;case 3:void 0===u&&(u=new L(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 a=0;a<t.length;a++){const c=t[a];if(c.index+=i,s)continue;const h=(n=e.index,r=e.index+e.removed.length,o=c.index,l=c.index+c.addedCount,r<o||l<n?-1:r===o||l===n?0:n<o?r<l?r-o:l-o:l<r?l-n:r-n);if(h>=0){t.splice(a,1),a--,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(a,0,e),a++;const n=e.addedCount-e.removed.length;c.index+=n,i+=n}}var n,r,o,l;s||t.push(e)}let R=Object.freeze({support:I.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(F(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):_,pop(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new L(e.length,[r],0)),r},push(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new L(e.length-i.length,[],i.length).adjustTo(e)),n},reverse(e,t,s,i){const n=s.apply(e,i);return t.reset(e),n},shift(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new L(0,[r],0)),r},sort(e,t,s,i){const n=s.apply(e,i);return t.reset(e),n},splice(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new L(+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 L(0,[],i.length).adjustTo(e)),n}});const H=Object.freeze({reset:_,setDefaultStrategy(e){R=e}});function D(e,t,s){Reflect.defineProperty(e,t,{value:s,enumerable:!1})}class Q extends B{constructor(e){super(e),this.oldCollection=void 0,this.splices=void 0,this.needsQueue=!0,this._strategy=null,this._lengthObserver=void 0,this.call=this.flush,D(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}subscribe(e){this.flush(),super.subscribe(e)}addSplice(e){void 0===this.splices?this.splices=[e]:this.splices.push(e),this.enqueue()}reset(e){this.oldCollection=e,this.enqueue()}flush(){var e;const t=this.splices,s=this.oldCollection;void 0===t&&void 0===s||(this.needsQueue=!0,this.splices=void 0,this.oldCollection=void 0,this.notify((null!==(e=this._strategy)&&void 0!==e?e:R).normalize(s,this.subject,t)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,A.enqueue(this))}}let q=!1;const U=Object.freeze({enable(){if(q)return;q=!0,$.setArrayObserverFactory((e=>new Q(e)));const e=Array.prototype;e.$fastPatch||(D(e,"$fastPatch",1),[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:R)[t.name](this,i,t,e)}})))}});function W(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(U.enable(),t=$.getNotifier(e)),$.track(t.lengthObserver,"length"),e.length}class J{constructor(e,t,s=!1){this.evaluate=e,this.policy=t,this.isVolatile=s}}class G extends J{createObserver(e){return $.binding(this.evaluate,e,this.isVolatile)}}function K(e,t,s=$.isVolatileBinding(e)){return new G(e,t,s)}function X(e,t){const s=new G(e);return s.options=t,s}class Y extends J{createObserver(){return this}bind(e){return this.evaluate(e.source,e.context)}}function Z(e,t){return new Y(e,t)}function ee(e){return s(e)?K(e):e instanceof J?e:Z((()=>e))}let te;function se(e){return e.map((e=>e instanceof ie?se(e.styles):[e])).reduce(((e,t)=>e.concat(t)),[])}h(Y);class ie{constructor(e){this.styles=e,this.targets=new WeakSet,this._strategy=null,this.behaviors=e.map((e=>e instanceof ie?e.behaviors:null)).reduce(((e,t)=>null===t?e:null===e?t:e.concat(t)),null)}get strategy(){return null===this._strategy&&this.withStrategy(te),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(se(this.styles)),this}static setDefaultStrategy(e){te=e}static normalize(e){return void 0===e?void 0:Array.isArray(e)?new ie(e):e instanceof ie?e:new ie([e])}}ie.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;const ne=a(),re=Object.freeze({getForInstance:ne.getForInstance,getByType:ne.getByType,define:e=>(ne.register({type:e}),e)});function oe(){return function(e){re.define(e)}}function le(e,t,s){t.source.style.setProperty(e.targetAspect,s.bind(t))}class ae{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)=>le(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){le(this,e,e[this.targetAspect])}removedCallback(e){e.source.$cssBindings&&e.source.$cssBindings.delete(this)}handleChange(e,t){le(this,t.controller,t)}}re.define(ae);const ce=`${Math.random().toString(36).substring(2,8)}`;let he=0;const de=()=>`--v${ce}${++he}`;function ue(e,t){const i=[];let n="";const r=[],o=e=>{r.push(e)};for(let r=0,l=e.length-1;r<l;++r){n+=e[r];let l=t[r];s(l)?l=new ae(K(l),de()).createCSS(o):l instanceof J?l=new ae(l,de()).createCSS(o):void 0!==re.getForInstance(l)&&(l=l.createCSS(o)),l instanceof ie||l instanceof CSSStyleSheet?(""!==n.trim()&&(i.push(n),n=""),i.push(l)):n+=l}return n+=e[e.length-1],""!==n.trim()&&i.push(n),{styles:i,behaviors:r}}const fe=(e,...t)=>{const{styles:s,behaviors:i}=ue(e,t),n=new ie(s);return i.length?n.withBehaviors(...i):n};class pe{constructor(e,t){this.behaviors=t,this.css="";const s=e.reduce(((e,t)=>(i(t)?this.css+=t:e.push(t),e)),[]);s.length&&(this.styles=new ie(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)}}re.define(pe),fe.partial=(e,...t)=>{const{styles:s,behaviors:i}=ue(e,t);return new pe(s,i)};const ge=`fast-${Math.random().toString(36).substring(2,8)}`,be=`${ge}{`,ve=`}${ge}`,ye=ve.length;let me=0;const we=()=>`${ge}-${++me}`,Ce=Object.freeze({interpolation:e=>`${be}${e}${ve}`,attribute:e=>`${we()}="${be}${e}${ve}"`,comment:e=>`\x3c!--${be}${e}${ve}--\x3e`}),Se=Object.freeze({parse(e,t){const s=e.split(be);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(ve);let o;if(-1===r)o=n;else{const e=n.substring(0,r);i.push(t[e]),o=n.substring(r+ye)}""!==o&&i.push(o)}return i}}),xe=a(),Te=Object.freeze({getForInstance:xe.getForInstance,getByType:xe.getByType,define:(e,t)=>((t=t||{}).type=e,xe.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?d.tokenList:d.property;break;case"?":e.targetAspect=t.substring(1),e.aspectType=d.booleanAttribute;break;case"@":e.targetAspect=t.substring(1),e.aspectType=d.event;break;default:e.targetAspect=t,e.aspectType=d.attribute}else e.aspectType=d.content}});function Oe(e){return function(t){Te.define(t,e)}}class Ae{constructor(e){this.options=e}createHTML(e){return Ce.attribute(e(this))}createBehavior(){return this}}h(Ae);const Be={[d.attribute]:b.setAttribute,[d.booleanAttribute]:b.setBooleanAttribute,[d.property]:(e,t,s)=>e[t]=s,[d.content]:function(e,t,s,i){if(null==s&&(s=""),s.create){e.textContent="";let t=e.$fastView;void 0===t?t=s.create():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}},[d.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 l=r.v;const a=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]=l,a.add(s))}}if(r.v=l+1,0!==l){l-=1;for(const e in o)o[e]===l&&a.remove(e)}},[d.event]:()=>{}};class ke{constructor(e){this.dataBinding=e,this.updateTarget=null,this.aspectType=d.content}createHTML(e){return Ce.interpolation(e(this))}createBehavior(){var e;if(null===this.updateTarget){const t=Be[this.aspectType],s=null!==(e=this.dataBinding.policy)&&void 0!==e?e:this.policy;if(!t)throw o.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];switch(this.aspectType){case d.event:s[this.data]=e,s.addEventListener(this.targetAspect,this,this.dataBinding.options);break;case d.content:e.onUnbind(this);default:const i=null!==(t=s[this.data])&&void 0!==t?t:s[this.data]=this.dataBinding.createObserver(this,this);i.target=s,i.controller=e,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){E.setEvent(e);const s=this.dataBinding.evaluate(t.source,t.context);E.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)}}function je(e,t){const s=e.parentNode;let i,n=e;for(;n!==t;)i=n.nextSibling,s.removeChild(n),n=i;s.removeChild(t)}Te.define(ke,{aspected:!0});class $e{constructor(e,t,s){this.fragment=e,this.factories=t,this.targets=s,this.behaviors=null,this.unbindables=[],this.source=null,this.isBound=!1,this.sourceLifetime=j.unknown,this.context=this,this.index=0,this.length=0,this.firstChild=e.firstChild,this.lastChild=e.lastChild}get event(){return E.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}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(){je(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){je(e[0].firstChild,e[e.length-1].lastChild);for(let t=0,s=e.length;t<s;++t)e[t].unbind()}}}h($e),$.defineProperty($e.prototype,"index"),$.defineProperty($e.prototype,"length");const Ne=(e,t)=>`${e}.${t}`,Ve={},ze={index:0,node:null};function Ee(e){e.startsWith("fast-")||o.warn(1204,{name:e})}const Le=new Proxy(document.createElement("div"),{get(e,t){Ee(t);const i=Reflect.get(e,t);return s(i)?i.bind(e):i},set:(e,t,s)=>(Ee(t),Reflect.set(e,t,s))});class Ie{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:we(),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=Ve[t];if(!n){const i=`_${t}`;Ve[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:Le;for(const e of this.nodeIds)s[e];return new $e(t,this.factories,s)}}function Me(e,t,s,i,n,r=!1){const o=s.attributes,l=e.directives;for(let a=0,c=o.length;a<c;++a){const h=o[a],d=h.value,u=Se.parse(d,l);let f=null;null===u?r&&(f=new ke(Z((()=>d),e.policy)),Te.assignAspect(f,h.name)):f=Pe.aggregate(u,e.policy),null!==f&&(s.removeAttributeNode(h),a--,c--,e.addFactory(f,t,i,n,s.tagName))}}function _e(e,t,s){let i=0,n=t.firstChild;for(;n;){const t=Fe(e,s,n,i);n=t.node,i=t.index}}function Fe(e,t,s,n){const r=Ne(t,n);switch(s.nodeType){case 1:Me(e,t,s,r,n),_e(e,s,r);break;case 3:return function(e,t,s,n,r){const o=Se.parse(t.textContent,e.directives);if(null===o)return ze.node=t.nextSibling,ze.index=r+1,ze;let l,a=l=t;for(let t=0,c=o.length;t<c;++t){const c=o[t];0!==t&&(r++,n=Ne(s,r),l=a.parentNode.insertBefore(document.createTextNode(""),a.nextSibling)),i(c)?l.textContent=c:(l.textContent=" ",Te.assignAspect(c),e.addFactory(c,s,n,r,null)),a=l}return ze.index=r+1,ze.node=a.nextSibling,ze}(e,s,t,r,n);case 8:const o=Se.parse(s.data,e.directives);null!==o&&e.addFactory(Pe.aggregate(o),t,r,n,null)}return ze.index=n+1,ze.node=s.nextSibling,ze}const Pe={compile(e,t,s=b.policy){let n;if(i(e)){n=document.createElement("TEMPLATE"),n.innerHTML=s.createHTML(e);const t=n.content.firstElementChild;null!==t&&"TEMPLATE"===t.tagName&&(n=t)}else n=e;n.content.firstChild||n.content.lastChild||n.content.appendChild(document.createComment(""));const r=document.adoptNode(n.content),o=new Ie(r,t,s);var l,a;return Me(o,"",n,"h",0,!0),l=r.firstChild,a=t,(l&&8==l.nodeType&&null!==Se.parse(l.data,a)||1===r.childNodes.length&&Object.keys(t).length>0)&&r.insertBefore(document.createComment(""),r.firstChild),_e(o,r,"r"),ze.node=null,o.freeze()},setDefaultStrategy(e){this.compile=e},aggregate(e,t=b.policy){if(1===e.length)return e[0];let s,n,r,o=!1;const l=e.length,a=e.map((e=>i(e)?()=>e:(s=e.sourceAspect||s,n=e.dataBinding||n,o=o||e.dataBinding.isVolatile,r=r||e.dataBinding.policy,e.dataBinding.evaluate)));n.evaluate=(e,t)=>{let s="";for(let i=0;i<l;++i)s+=a[i](e,t);return s},n.isVolatile=o,n.policy=null!=r?r:t;const c=new ke(n);return Te.assignAspect(c,s),c}},Re=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/,He=Object.create(null);class De{constructor(e,t=He){this.html=e,this.factories=t}createHTML(e){const t=this.factories;for(const s in t)e(t[s]);return this.html}}function Qe(e,t,s,i=Te.getForInstance(e)){if(i.aspected){const s=Re.exec(t);null!==s&&Te.assignAspect(e,s[2])}return e.createHTML(s)}De.empty=new De(""),Te.define(De);class qe{constructor(e,t={},s){this.policy=s,this.result=null,this.html=e,this.factories=t}create(e){return null===this.result&&(this.result=Pe.compile(this.html,this.factories,this.policy)),this.result.createView(e)}inline(){return new De(i(this.html)?this.html:this.html.innerHTML,this.factories)}withPolicy(e){if(this.result)throw o.error(1208);if(this.policy)throw o.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,i){let n="";const r=Object.create(null),o=e=>{var t;const s=null!==(t=e.id)&&void 0!==t?t:e.id=we();return r[s]=e,s};for(let i=0,r=e.length-1;i<r;++i){const r=e[i];let l,a=t[i];if(n+=r,s(a))a=new ke(K(a));else if(a instanceof J)a=new ke(a);else if(!(l=Te.getForInstance(a))){const e=a;a=new ke(Z((()=>e)))}n+=Qe(a,r,o,l)}return new qe(n+e[e.length-1],r,i)}}h(qe);const Ue=(e,...t)=>{if(Array.isArray(e)&&Array.isArray(e.raw))return qe.create(e,t);throw o.error(1206)};Ue.partial=e=>new De(e);class We extends Ae{bind(e){e.source[this.options]=e.targets[this.targetNodeId]}}Te.define(We);const Je=e=>new We(e),Ge=()=>null;function Ke(e){return void 0===e?Ge:s(e)?e:()=>e}function Xe(e,t,i){const n=s(e)?e:()=>e,r=Ke(t),o=Ke(i);return(e,t)=>n(e,t)?r(e,t):o(e,t)}const Ye=Object.freeze({positioning:!1,recycle:!0});function Ze(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])}class tt{constructor(e){this.directive=e,this.items=null,this.itemsObserver=null,this.bindView=Ze,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),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():this.updateViews(t)}}observeItems(e=!1){if(!this.items)return void(this.items=l);const t=this.itemsObserver,s=this.itemsObserver=$.getNotifier(this.items),i=t!==s;i&&null!==t&&t.unsubscribe(this),(i||e)&&s.subscribe(this)}updateViews(e){const t=this.views,s=this.bindView,i=this.items,n=this.template,r=this.controller,o=this.directive.options.recycle,l=[];let a=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=l.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=l[a],a++),c--):d=n.create(),t.splice(p,0,d),s(d,i,p,r),d.insertBefore(h)}b[f]&&l.push(...b.slice(f))}for(let e=a,t=l.length;e<t;++e)l[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,l=this.views,a=l.length;if(0!==o&&!e&&this.directive.options.recycle||($e.disposeContiguousBatch(l),a=0),0===a){this.views=l=new Array(o);for(let e=0;e<o;++e){const o=s.create();n(o,t,e,r),l[e]=o,o.insertBefore(i)}}else{let e=0;for(;e<o;++e)if(e<a){n(l[e],t,e,r)}else{const o=s.create();n(o,t,e,r),l.push(o),o.insertBefore(i)}const c=l.splice(e,a-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)e[t].unbind()}}class st{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.options=s,U.enable()}createHTML(e){return Ce.comment(e(this))}createBehavior(){return new tt(this)}}function it(e,t,s=Ye){const i=ee(e),n=ee(t);return new st(i,n,Object.assign(Object.assign({},Ye),s))}Te.define(st);const nt=e=>1===e.nodeType,rt=e=>e?t=>1===t.nodeType&&t.matches(e):nt;class ot extends Ae{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}}class lt extends ot{observe(e){e.addEventListener("slotchange",this)}disconnect(e){e.removeEventListener("slotchange",this)}getNodes(e){return e.assignedNodes(this.options)}handleEvent(e){const t=e.currentTarget;this.updateTarget(this.getSource(t),this.computeNodes(t))}}function at(e){return i(e)&&(e={property:e}),new lt(e)}Te.define(lt);class ct extends ot{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=n,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 ht(e){return i(e)&&(e={property:e}),new ct(e)}Te.define(ct);const dt=Object.freeze({locate:c()}),ut={toView:e=>e?"true":"false",fromView:e=>null!=e&&"false"!==e&&!1!==e&&0!==e},ft={toView:e=>"boolean"==typeof e?e.toString():"",fromView:e=>[null,void 0,void 0].includes(e)?null:ut.fromView(e)};function pt(e){if(null==e)return null;const t=1*e;return isNaN(t)?null:t}const gt={toView(e){const t=pt(e);return t?t.toString():t},fromView:pt};class bt{constructor(e,t,s=t.toLowerCase(),i="reflect",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,"boolean"===i&&void 0===n&&(this.converter=ut)}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||A.enqueue((()=>{s.add(e);const i=e[this.fieldName];switch(t){case"reflect":const t=this.converter;b.setAttribute(e,this.attribute,void 0!==t?t.toView(i):i);break;case"boolean":b.setBooleanAttribute(e,this.attribute,i)}s.delete(e)}))}static collect(e,...t){const s=[];t.push(dt.locate(e));for(let n=0,r=t.length;n<r;++n){const r=t[n];if(void 0!==r)for(let t=0,n=r.length;t<n;++t){const n=r[t];i(n)?s.push(new bt(e,n)):s.push(new bt(e,n.property,n.attribute,n.mode,n.converter))}}return s}}function vt(e,t){let s;function i(e,t){arguments.length>1&&(s.property=t),dt.locate(e.constructor).push(s)}return arguments.length>1?(s={},void i(e,t)):(s=void 0===e?{}:e,i)}const yt={mode:"open"},mt={},wt=new Set,Ct=o.getById(t.elementRegistry,(()=>a()));class St{constructor(e,t=e.definition){var s;this.platformDefined=!1,i(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,r=bt.collect(e,t.attributes),o=new Array(r.length),l={},a={};for(let e=0,t=r.length;e<t;++e){const t=r[e];o[e]=t.attribute,l[t.name]=t,a[t.attribute]=t,$.defineProperty(n,t)}Reflect.defineProperty(e,"observedAttributes",{value:o,enumerable:!0}),this.attributes=r,this.propertyLookup=l,this.attributeLookup=a,this.shadowOptions=void 0===t.shadowOptions?yt:null===t.shadowOptions?void 0:Object.assign(Object.assign({},yt),t.shadowOptions),this.elementOptions=void 0===t.elementOptions?mt:Object.assign(Object.assign({},mt),t.elementOptions),this.styles=ie.normalize(t.styles),Ct.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 wt.has(e)||Ct.getByType(e)?new St(class extends e{},t):new St(e,t)}static registerBaseType(e){wt.add(e)}}St.getByType=Ct.getByType,St.getForInstance=Ct.getForInstance;const xt={bubbles:!0,composed:!0,cancelable:!0},Tt=new WeakMap;function Ot(e){var t,s;return null!==(s=null!==(t=e.shadowRoot)&&void 0!==t?t:Tt.get(e))&&void 0!==s?s:null}let At;class Bt 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._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&&Tt.set(e,t))}const i=$.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 $.track(this,"isConnected"),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:E.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=Ot(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=Ot(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(){if(3!==this.stage)return;if(this.stage=0,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}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.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,"isConnected")}disconnect(){if(1!==this.stage)return;this.stage=2,$.notify(this,"isConnected"),null!==this.view&&this.view.unbind();const e=this.behaviors;if(null!==e)for(const t of e.keys())t.disconnectedCallback&&t.disconnectedCallback(this);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},xt),s)))}renderTemplate(e){var t;const s=this.source,i=null!==(t=Ot(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=j.coupled)}static forCustomElement(e){const t=e.$fastController;if(void 0!==t)return t;const s=St.getForInstance(e);if(void 0===s)throw o.error(1401);return e.$fastController=new At(e,s)}static setStrategy(e){At=e}}function kt(e){var t;return"adoptedStyleSheets"in e?e:null!==(t=Ot(e))&&void 0!==t?t:e.getRootNode()}h(Bt),Bt.setStrategy(Bt);class jt{constructor(e){const t=jt.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){zt(kt(e),this.sheets)}removeStylesFrom(e){Et(kt(e),this.sheets)}}jt.styleSheetCache=new Map;let $t=0;function Nt(e){return e===document?document.body:e}class Vt{constructor(e){this.styles=e,this.styleClass="fast-"+ ++$t}addStylesTo(e){e=Nt(kt(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=Nt(kt(e))).querySelectorAll(`.${this.styleClass}`);for(let s=0,i=t.length;s<i;++s)e.removeChild(t[s])}}let zt=(e,t)=>{e.adoptedStyleSheets=[...e.adoptedStyleSheets,...t]},Et=(e,t)=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter((e=>-1===t.indexOf(e)))};if(ie.supportsAdoptedStyleSheets){try{document.adoptedStyleSheets.push(),document.adoptedStyleSheets.splice(),zt=(e,t)=>{e.adoptedStyleSheets.push(...t)},Et=(e,t)=>{for(const s of t){const t=e.adoptedStyleSheets.indexOf(s);-1!==t&&e.adoptedStyleSheets.splice(t,1)}}}catch(e){}ie.setDefaultStrategy(jt)}else ie.setDefaultStrategy(Vt);function Lt(e){const t=class extends e{constructor(){super(),Bt.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 St.registerBaseType(t),t}function It(e,t){return s(e)?St.compose(e,t).define().type:St.compose(this,e).define().type}const Mt=Object.assign(Lt(HTMLElement),{from:function(e){return Lt(e)},define:It,compose:function(e,t){return s(e)?St.compose(e,t):St.compose(this,e)}});function _t(e){return function(t){It(t,e)}}b.setPolicy(O.create());export{U as ArrayObserver,dt as AttributeConfiguration,bt as AttributeDefinition,J as Binding,ae as CSSBindingDirective,re as CSSDirective,ct as ChildrenDirective,Pe as Compiler,b as DOM,d as DOMAspect,Bt as ElementController,ie as ElementStyles,E as ExecutionContext,o as FAST,Mt as FASTElement,St as FASTElementDefinition,ke as HTMLBindingDirective,Te as HTMLDirective,$e as HTMLView,De as InlineTemplateDirective,Ce as Markup,ot as NodeObservationDirective,$ as Observable,Se as Parser,k as PropertyChangeNotifier,We as RefDirective,tt as RepeatBehavior,st as RepeatDirective,lt as SlottedDirective,j as SourceLifetime,L as Splice,H as SpliceStrategy,I as SpliceStrategySupport,Ae as StatelessAttachedAttributeDirective,B as SubscriberSet,A as Updates,qe as ViewTemplate,vt as attr,ut as booleanConverter,ht as children,fe as css,oe as cssDirective,_t as customElement,rt as elements,l as emptyArray,Ue as html,Oe as htmlDirective,W as lengthOf,X as listener,ee as normalizeBinding,ft as nullableBooleanConverter,gt as nullableNumberConverter,N as observable,Z as oneTime,K as oneWay,Je as ref,it as repeat,at as slotted,V as volatile,Xe as when};
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.0.0-beta.24",
4
+ "version": "2.0.0-beta.26",
5
5
  "author": {
6
6
  "name": "Microsoft",
7
7
  "url": "https://discord.gg/FcSNfg4"
@@ -26,59 +26,59 @@
26
26
  "development": "./dist/esm/index.debug.js",
27
27
  "default": "./dist/esm/index.js"
28
28
  },
29
- "./debug": {
29
+ "./debug.js": {
30
30
  "types": "./dist/dts/debug.d.ts",
31
31
  "default": "./dist/esm/debug.js"
32
32
  },
33
- "./binding/two-way": {
33
+ "./binding/two-way.js": {
34
34
  "types": "./dist/dts/binding/two-way.d.ts",
35
35
  "default": "./dist/esm/binding/two-way.js"
36
36
  },
37
- "./binding/signal": {
37
+ "./binding/signal.js": {
38
38
  "types": "./dist/dts/binding/signal.d.ts",
39
39
  "default": "./dist/esm/binding/signal.js"
40
40
  },
41
- "./render": {
41
+ "./render.js": {
42
42
  "types": "./dist/dts/templating/render.d.ts",
43
43
  "default": "./dist/esm/templating/render.js"
44
44
  },
45
- "./utilities": {
45
+ "./utilities.js": {
46
46
  "types": "./dist/dts/utilities.d.ts",
47
47
  "default": "./dist/esm/utilities.js"
48
48
  },
49
- "./state": {
49
+ "./state.js": {
50
50
  "types": "./dist/dts/state/exports.d.ts",
51
51
  "default": "./dist/esm/state/exports.js"
52
52
  },
53
- "./context": {
53
+ "./context.js": {
54
54
  "types": "./dist/dts/context.d.ts",
55
55
  "default": "./dist/esm/context.js"
56
56
  },
57
- "./metadata": {
57
+ "./metadata.js": {
58
58
  "types": "./dist/dts/metadata.d.ts",
59
59
  "default": "./dist/esm/metadata.js"
60
60
  },
61
- "./testing": {
61
+ "./testing.js": {
62
62
  "types": "./dist/dts/testing/exports.d.ts",
63
63
  "default": "./dist/esm/testing/exports.js"
64
64
  },
65
- "./di": {
65
+ "./di.js": {
66
66
  "types": "./dist/dts/di/di.d.ts",
67
67
  "default": "./dist/esm/di/di.js"
68
68
  },
69
- "./element-hydration": {
69
+ "./element-hydration.js": {
70
70
  "types": "./dist/dts/components/hydration.d.ts",
71
71
  "default": "./dist/esm/components/hydration.js"
72
72
  },
73
- "./install-element-hydration": {
73
+ "./install-element-hydration.js": {
74
74
  "types": "./dist/dts/components/install-hydration.d.ts",
75
75
  "default": "./dist/esm/components/install-hydration.js"
76
76
  },
77
- "./pending-task": {
77
+ "./pending-task.js": {
78
78
  "types": "./dist/dts/pending-task.d.ts",
79
79
  "default": "./dist/esm/pending-task.js"
80
80
  },
81
- "./dom-policy": {
81
+ "./dom-policy.js": {
82
82
  "types": "./dist/dts/dom-policy.d.ts",
83
83
  "default": "./dist/esm/dom-policy.js"
84
84
  },