@microsoft/fast-element
Advanced tools
Comparing version 2.0.0-beta.7 to 2.0.0-beta.8
@@ -5,2 +5,23 @@ { | ||
{ | ||
"date": "Tue, 27 Sep 2022 22:31:52 GMT", | ||
"tag": "@microsoft/fast-element_v2.0.0-beta.8", | ||
"version": "2.0.0-beta.8", | ||
"comments": { | ||
"prerelease": [ | ||
{ | ||
"author": "roeisenb@microsoft.com", | ||
"package": "@microsoft/fast-element", | ||
"commit": "8834c6732c727d39f92f72b197388453a9c17f9b", | ||
"comment": "fix: correct view state when processing unbindables during rebind" | ||
}, | ||
{ | ||
"author": "roeisenb@microsoft.com", | ||
"package": "@microsoft/fast-element", | ||
"commit": "d949a8873621f409f9d9f3453cdb40b593d14b67", | ||
"comment": "fix: do not crash when null/undefined is provided literally in templates" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"date": "Fri, 23 Sep 2022 22:53:27 GMT", | ||
@@ -7,0 +28,0 @@ "tag": "@microsoft/fast-element_v2.0.0-beta.7", |
# Change Log - @microsoft/fast-element | ||
This log was last generated on Fri, 23 Sep 2022 22:53:27 GMT and should not be manually modified. | ||
This log was last generated on Tue, 27 Sep 2022 22:31:52 GMT and should not be manually modified. | ||
<!-- Start content --> | ||
## 2.0.0-beta.8 | ||
Tue, 27 Sep 2022 22:31:52 GMT | ||
### Changes | ||
- fix: correct view state when processing unbindables during rebind (roeisenb@microsoft.com) | ||
- fix: do not crash when null/undefined is provided literally in templates (roeisenb@microsoft.com) | ||
## 2.0.0-beta.7 | ||
@@ -8,0 +17,0 @@ |
@@ -60,2 +60,5 @@ // ensure FAST global - duplicated in polyfills.ts and debug.ts | ||
getForInstance(object) { | ||
if (object === null || object === void 0) { | ||
return void 0; | ||
} | ||
return typeToDefinition.get(object.constructor); | ||
@@ -62,0 +65,0 @@ }, |
@@ -168,9 +168,8 @@ import { ExecutionContext, Observable } from "../observation/observable.js"; | ||
bind(source) { | ||
const oldSource = this.source; | ||
if (oldSource === source) { | ||
if (this.source === source) { | ||
return; | ||
} | ||
let behaviors = this.behaviors; | ||
this.source = source; | ||
if (behaviors === null) { | ||
this.source = source; | ||
this.behaviors = behaviors = new Array(this.factories.length); | ||
@@ -185,5 +184,7 @@ const factories = this.factories; | ||
else { | ||
if (oldSource !== null) { | ||
if (this.source !== null) { | ||
this.evaluateUnbindables(); | ||
} | ||
this.isBound = false; | ||
this.source = source; | ||
for (let i = 0, ii = behaviors.length; i < ii; ++i) { | ||
@@ -199,9 +200,5 @@ behaviors[i].bind(this); | ||
unbind() { | ||
if (!this.isBound) { | ||
if (!this.isBound || this.source === null) { | ||
return; | ||
} | ||
const oldSource = this.source; | ||
if (oldSource === null) { | ||
return; | ||
} | ||
this.evaluateUnbindables(); | ||
@@ -208,0 +205,0 @@ this.source = null; |
@@ -1,1 +0,1 @@ | ||
!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}}(),globalThis.trustedTypes||(globalThis.trustedTypes={createPolicy:(e,t)=>t});const e={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},e));const t=globalThis.FAST;if(void 0===t.getById){const s=Object.create(null);Reflect.defineProperty(t,"getById",Object.assign({value(e,t){let i=s[e];return void 0===i&&(i=t?s[e]=t():null),i}},e))}const s=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;function i(e){return e===document?document.body:e}let n=0;class r{constructor(e){this.styles=e,this.styleClass="fast-"+ ++n}addStylesTo(e){e=i(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.querySelectorAll(`.${this.styleClass}`);e=i(e);for(let s=0,i=t.length;s<i;++s)e.removeChild(t[s])}}s||t.getById(5,(()=>r)),void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",{value:Object.create(null),configurable:!1,enumerable:!1,writable:!1});const o=globalThis.FAST,l={1101:"Must call enableArrayObservation before observing arrays.",1201:"The HTML 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.",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."},a=/(\$\{\w+?})/g,h=/\$\{(\w+?)}/g,c=Object.freeze({});function d(e,t){return e.split(a).map((e=>{var s;const i=e.replace(h,"$1");return String(null!==(s=t[i])&&void 0!==s?s:e)})).join("")}Object.assign(o,{addMessages(e){Object.assign(l,e)},warn(e,t=c){var s;const i=null!==(s=l[e])&&void 0!==s?s:"Unknown Warning";console.warn(d(i,t))},error(e,t=c){var s;const i=null!==(s=l[e])&&void 0!==s?s:"Unknown Error";return new Error(d(i,t))}});const u={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},u));const f=globalThis.FAST;if(void 0===f.getById){const e=Object.create(null);Reflect.defineProperty(f,"getById",Object.assign({value(t,s){let i=e[t];return void 0===i&&(i=s?e[t]=s():null),i}},u))}void 0===f.error&&Object.assign(f,{warn(){},error:e=>new Error(`Error ${e}`),addMessages(){}});const g=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=>e.get(t.constructor)})}function b(){const e=new WeakMap;return function(t){let s=e.get(t);if(void 0===s){let i=Reflect.getPrototypeOf(t);for(;void 0===s&&null!==i;)s=e.get(i),i=Reflect.getPrototypeOf(i);s=void 0===s?[]:s.slice(0),e.set(t,s)}return s}}const v=e=>"function"==typeof e,y=e=>"string"==typeof e,m=f.getById(1,(()=>{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 w{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 C{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 w(this.subject):null!==(i=this.subjectSubscribers)&&void 0!==i?i:this.subjectSubscribers=new w(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 T=Object.freeze({unknown:void 0,coupled:1}),S=f.getById(2,(()=>{const e=m.enqueue,t=/(:|&&|\|\||if)/,s=new WeakMap;let i,n=e=>{throw f.error(1101)};function r(e){var t;let i=null!==(t=e.$fastController)&&void 0!==t?t:s.get(e);return void 0===i&&(Array.isArray(e)?i=n(e):s.set(e,i=new C(e))),i}const o=b();class l{constructor(e){this.name=e,this.field=`_${e}`,this.callback=`${e}Changed`}getValue(e){return void 0!==i&&i.watch(e,this.name),e[this.field]}setValue(e,t){const s=this.field,i=e[s];if(i!==t){e[s]=t;const n=e[this.callback];v(n)&&n.call(e,i,t),r(e).notify(this.name)}}}class a extends w{constructor(e,t,s=!1){super(e,t),this.binding=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!==T.coupled||this.first!==this.last||this.first.propertySource!==e.source}unbind(e){this.dispose()}observe(e,t){this.needsRefresh&&null!==this.last&&this.dispose();const s=i;let n;i=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;try{n=this.binding(e,t)}finally{i=s}return n}dispose(){if(null!==this.last){let e=this.first;for(;void 0!==e;)e.notifier.unsubscribe(this,e.propertyName),e=e.next;this.last=null,this.needsRefresh=this.needsQueue=this.isAsync}}watch(e,t){const s=this.last,n=r(e),o=null===s?this.first:{};if(o.propertySource=e,o.propertyName=t,o.notifier=n,n.subscribe(this,t),null!==s){if(!this.needsRefresh){let t;i=void 0,t=s.propertySource[s.propertyName],i=this,e===t&&(this.needsRefresh=!0)}s.next=o}this.last=o}handleChange(){this.needsQueue?(this.needsQueue=!1,e(this)):this.isAsync||this.call()}call(){null!==this.last&&(this.needsQueue=this.isAsync,this.notify(this))}*records(){let e=this.first;for(;void 0!==e;)yield e,e=e.next}}return Object.freeze({setArrayObserverFactory(e){n=e},getNotifier:r,track(e,t){i&&i.watch(e,t)},trackVolatile(){i&&(i.needsRefresh=!0)},notify(e,t){r(e).notify(t)},defineProperty(e,t){y(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 a(e,t,s)},isVolatileBinding:e=>t.test(e.toString())})}));function x(e,t){S.defineProperty(e,t)}function O(e,t,s){return Object.assign({},s,{get(){return S.trackVolatile(),s.get.apply(this)}})}const A=f.getById(3,(()=>{let e=null;return{get:()=>e,set(t){e=t}}})),B=Object.freeze({default:{index:0,length:0,get event(){return B.getEvent()},eventDetail(){return this.event.detail},eventTarget(){return this.event.target}},getEvent:()=>A.get(),setEvent(e){A.set(e)}});class j{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 k=Object.freeze({reset:1,splice:2,optimized:3}),$=new j(0,g,0);$.reset=!0;const I=[$];function E(e,t,s,i,n,r){let o=0,l=0;const a=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,a)),s===e.length&&r===i.length&&(l=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,a-o)),n+=o,r-=l,(s-=l)-(t+=o)==0&&r-n==0)return g;if(t===s){const e=new j(t,[],0);for(;n<r;)e.removed.push(i[n++]);return[e]}if(n===r)return[new j(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 h,c;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]:(h=a[s-1][r]+1,c=a[s][r-1]+1,a[s][r]=h<c?h:c);return a}(e,t,s,i,n,r)),c=[];let d,u=t,f=n;for(let e=0;e<h.length;++e)switch(h[e]){case 0:void 0!==d&&(c.push(d),d=void 0),u++,f++;break;case 1:void 0===d&&(d=new j(u,[],0)),d.addedCount++,u++,d.removed.push(i[f]),f++;break;case 2:void 0===d&&(d=new j(u,[],0)),d.addedCount++,u++;break;case 3:void 0===d&&(d=new j(u,[],0)),d.removed.push(i[f]),f++}return void 0!==d&&c.push(d),c}function V(e,t){let s=!1,i=0;for(let a=0;a<t.length;a++){const h=t[a];if(h.index+=i,s)continue;const c=(n=e.index,r=e.index+e.removed.length,o=h.index,l=h.index+h.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(c>=0){t.splice(a,1),a--,i-=h.addedCount-h.removed.length,e.addedCount+=h.addedCount-c;const n=e.removed.length+h.removed.length-c;if(e.addedCount||n){let t=h.removed;if(e.index<h.index){const s=e.removed.slice(0,h.index-e.index);s.push(...t),t=s}if(e.index+e.removed.length>h.index+h.addedCount){const s=e.removed.slice(h.index+h.addedCount-e.index);t.push(...s)}e.removed=t,h.index<e.index&&(e.index=h.index)}else s=!0}else if(e.index<h.index){s=!0,t.splice(a,0,e),a++;const n=e.addedCount-e.removed.length;h.index+=n,i+=n}}var n,r,o,l;s||t.push(e)}let N=Object.freeze({support:k.optimized,normalize:(e,t,s)=>void 0===e?void 0===s?g:s.length>1?function(e,t){let s=[];const i=[];for(let e=0,s=t.length;e<s;e++)V(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(E(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:I,pop(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new j(e.length,[r],0)),r},push(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new j(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 j(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 j(+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 j(0,[],i.length).adjustTo(e)),n}});const F=Object.freeze({reset:I,setDefaultStrategy(e){N=e}});function M(e,t,s){Reflect.defineProperty(e,t,{value:s,enumerable:!1})}class L extends w{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,M(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,S.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:N).normalize(s,this.subject,t)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,m.enqueue(this))}}let z=!1;const _=Object.freeze({enable(){if(z)return;z=!0,S.setArrayObserverFactory((e=>new L(e)));const e=Array.prototype;e.$fastPatch||(M(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:N)[t.name](this,i,t,e)}})))}});function P(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(_.enable(),t=S.getNotifier(e)),S.track(t.lengthObserver,"length"),e.length}const R=new Map;let D;function H(e){return e.map((e=>e instanceof U?H(e.styles):[e])).reduce(((e,t)=>e.concat(t)),[])}class U{constructor(e){this.styles=e,this.targets=new WeakSet,this._strategy=null,this.behaviors=e.map((e=>e instanceof U?e.behaviors:null)).reduce(((e,t)=>null===t?e:null===e?t:e.concat(t)),null)}get strategy(){return null===this._strategy&&this.withStrategy(D),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(H(this.styles)),this}static setDefaultStrategy(e){D=e}static normalize(e){return void 0===e?void 0:Array.isArray(e)?new U(e):e instanceof U?e:new U([e])}}U.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;class q{constructor(e){this.sheets=e.map((e=>{if(e instanceof CSSStyleSheet)return e;let t=R.get(e);return void 0===t&&(t=new CSSStyleSheet,t.replaceSync(e),R.set(e,t)),t}))}addStylesTo(e){e.adoptedStyleSheets=[...e.adoptedStyleSheets,...this.sheets]}removeStylesFrom(e){const t=this.sheets;e.adoptedStyleSheets=e.adoptedStyleSheets.filter((e=>-1===t.indexOf(e)))}}U.setDefaultStrategy(f.getById(5,(()=>q)));const Q=p(),W=Object.freeze({getForInstance:Q.getForInstance,getByType:Q.getByType,define:e=>(Q.register({type:e}),e)});function K(){return function(e){W.define(e)}}function G(e,t){const s=[];let i="";const n=[],r=e=>{n.push(e)};for(let n=0,o=e.length-1;n<o;++n){i+=e[n];let o=t[n];void 0!==W.getForInstance(o)&&(o=o.createCSS(r)),o instanceof U||o instanceof CSSStyleSheet?(""!==i.trim()&&(s.push(i),i=""),s.push(o)):i+=o}return i+=e[e.length-1],""!==i.trim()&&s.push(i),{styles:s,behaviors:n}}const J=(e,...t)=>{const{styles:s,behaviors:i}=G(e,t),n=new U(s);return i.length?n.withBehaviors(...i):n};class X{constructor(e,t){this.behaviors=t,this.css="";const s=e.reduce(((e,t)=>(y(t)?this.css+=t:e.push(t),e)),[]);s.length&&(this.styles=new U(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)}}W.define(X);const Y=J.partial=(e,...t)=>{const{styles:s,behaviors:i}=G(e,t);return new X(s,i)},Z=Object.freeze({queueUpdate:m.enqueue,nextUpdate:m.next,processUpdates:m.process,setAttribute(e,t,s){null==s?e.removeAttribute(t):e.setAttribute(t,s)},setBooleanAttribute(e,t,s){s?e.setAttribute(t,""):e.removeAttribute(t)}}),ee=`fast-${Math.random().toString(36).substring(2,8)}`,te=`${ee}{`,se=`}${ee}`,ie=se.length;let ne=0;const re=()=>`${ee}-${++ne}`,oe=Object.freeze({interpolation:e=>`${te}${e}${se}`,attribute:e=>`${re()}="${te}${e}${se}"`,comment:e=>`\x3c!--${te}${e}${se}--\x3e`}),le=Object.freeze({parse(e,t){const s=e.split(te);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(se);let o;if(-1===r)o=n;else{const e=n.substring(0,r);i.push(t[e]),o=n.substring(r+ie)}""!==o&&i.push(o)}return i}}),ae=Object.freeze({create(e){const t=[],s={};let i=null,n=!1;return{source:e,context:B.default,targets:s,get isBound(){return n},addBehaviorFactory(e,t){const s=e.nodeId||(e.nodeId=re());e.id||(e.id=re()),this.addTarget(s,t),this.addBehavior(e.createBehavior())},addTarget(e,t){s[e]=t},addBehavior(e){t.push(e),n&&e.bind(this)},onUnbind(e){null===i&&(i=[]),i.push(e)},connectedCallback(e){n||(n=!0,t.forEach((e=>e.bind(this))))},disconnectedCallback(e){n&&(n=!1,null!==i&&i.forEach((e=>e.unbind(this))))}}}}),he=p(),ce=Object.freeze({getForInstance:he.getForInstance,getByType:he.getByType,define:(e,t)=>((t=t||{}).type=e,he.register(t),e)});function de(e){return function(t){ce.define(t,e)}}class ue{constructor(e,t=!1){this.evaluate=e,this.isVolatile=t}}const fe=Object.freeze({none:0,attribute:1,booleanAttribute:2,property:3,content:4,tokenList:5,event:6,assign(e,t){if(t)switch(e.sourceAspect=t,t[0]){case":":switch(e.targetAspect=t.substring(1),e.targetAspect){case"innerHTML":default:e.aspectType=fe.property;break;case"classList":e.aspectType=fe.tokenList}break;case"?":e.targetAspect=t.substring(1),e.aspectType=fe.booleanAttribute;break;case"@":e.targetAspect=t.substring(1),e.aspectType=fe.event;break;default:"class"===t?(e.targetAspect="className",e.aspectType=fe.property):(e.targetAspect=t,e.aspectType=fe.attribute)}else e.aspectType=fe.content}});class ge{constructor(e){this.options=e,this.id=re()}createHTML(e){return oe.attribute(e(this))}createBehavior(){return this}}const pe=globalThis.TrustedHTML?e=>(t,s)=>{const i=e(t,s);if(i instanceof TrustedHTML)return i;throw f.error(1202)}:e=>e;class be extends ue{createObserver(e,t){return S.binding(this.evaluate,t,this.isVolatile)}}class ve extends ue{createObserver(){return this}bind(e){return this.evaluate(e.source,e.context)}}function ye(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)):(t.isComposed=!0,t.bind(i.source),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}}function me(e,t,s){var i;const n=`${this.id}-t`,r=null!==(i=e[n])&&void 0!==i?i:e[n]={c:0,v:Object.create(null)},o=r.v;let l=r.c;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)}}const we=(e,t,s)=>e[t]=s,Ce=()=>{};class Te{constructor(e){this.dataBinding=e,this.updateTarget=null,this.id=re(),this.aspectType=fe.content,this.bind=this.bindDefault,this.data=`${this.id}-d`}createHTML(e){return oe.interpolation(e(this))}createBehavior(){if(null===this.updateTarget)switch("innerHTML"===this.targetAspect&&(this.dataBinding.evaluate=pe(this.dataBinding.evaluate)),this.aspectType){case 1:this.updateTarget=Z.setAttribute;break;case 2:this.updateTarget=Z.setBooleanAttribute;break;case 3:this.updateTarget=we;break;case 4:this.bind=this.bindContent,this.updateTarget=ye;break;case 5:this.updateTarget=me;break;case 6:this.bind=this.bindEvent,this.updateTarget=Ce;break;default:throw f.error(1205)}return this}bindDefault(e){var t;const s=e.targets[this.nodeId],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),this.updateTarget===ye&&e.onUnbind(this)}bindContent(e){this.bindDefault(e),e.onUnbind(this)}bindEvent(e){const t=e.targets[this.nodeId];t[this.data]=e,t.addEventListener(this.targetAspect,this,this.dataBinding.options)}unbind(e){const t=e.targets[this.nodeId].$fastView;void 0!==t&&t.isComposed&&(t.unbind(),t.needsBindOnly=!0)}handleEvent(e){const t=e.currentTarget;B.setEvent(e);const s=t[this.data],i=this.dataBinding.evaluate(s.source,s.context);B.setEvent(null),!0!==i&&e.preventDefault()}handleChange(e,t){const s=t.target,i=t.controller;this.updateTarget(s,this.targetAspect,t.bind(i),i)}}function Se(e,t=S.isVolatileBinding(e)){return new be(e,t)}function xe(e){return new ve(e)}function Oe(e,t){const s=new be(e,!1);return s.options=t,s}function Ae(e){return v(e)?Se(e):e instanceof ue?e:xe((()=>e))}function Be(e,t){const s=e.parentNode;let i,n=e;for(;n!==t;)i=n.nextSibling,s.removeChild(n),n=i;s.removeChild(t)}ce.define(Te,{aspected:!0});class je{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.selfContained=!1,this.index=0,this.length=0,this.firstChild=e.firstChild,this.lastChild=e.lastChild}get context(){return this}get event(){return B.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(){Be(this.firstChild,this.lastChild),this.unbind()}onUnbind(e){this.unbindables.push(e)}bind(e){const t=this.source;if(t===e)return;let s=this.behaviors;if(this.source=e,null===s){this.behaviors=s=new Array(this.factories.length);const e=this.factories;for(let t=0,i=e.length;t<i;++t){const i=e[t].createBehavior();i.bind(this),s[t]=i}}else{null!==t&&this.evaluateUnbindables();for(let e=0,t=s.length;e<t;++e)s[e].bind(this)}this.isBound=!0}unbind(){if(!this.isBound)return;null!==this.source&&(this.evaluateUnbindables(),this.source=null,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){Be(e[0].firstChild,e[e.length-1].lastChild);for(let t=0,s=e.length;t<s;++t)e[t].unbind()}}}S.defineProperty(je.prototype,"index"),S.defineProperty(je.prototype,"length");const ke=(e,t)=>`${e}.${t}`,$e={},Ie={index:0,node:null};function Ee(e){e.startsWith("fast-")||f.warn(1204,{name:e})}const Ve=new Proxy(document.createElement("div"),{get(e,t){Ee(t);const s=Reflect.get(e,t);return v(s)?s.bind(e):s},set:(e,t,s)=>(Ee(t),Reflect.set(e,t,s))});class Ne{constructor(e,t){this.fragment=e,this.directives=t,this.proto=null,this.nodeIds=new Set,this.descriptors={},this.factories=[]}addFactory(e,t,s,i){this.nodeIds.has(s)||(this.nodeIds.add(s),this.addTargetDescriptor(t,s,i)),e.nodeId=s,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=$e[t];if(!n){const i=`_${t}`;$e[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:Ve;for(const e of this.nodeIds)s[e];return new je(t,this.factories,s)}}function Fe(e,t,s,i,n,r=!1){const o=s.attributes,l=e.directives;for(let a=0,h=o.length;a<h;++a){const c=o[a],d=c.value,u=le.parse(d,l);let f=null;null===u?r&&(f=new Te(xe((()=>d))),fe.assign(f,c.name)):f=Re.aggregate(u),null!==f&&(s.removeAttributeNode(c),a--,h--,e.addFactory(f,t,i,n))}}function Me(e,t,s){let i=0,n=t.firstChild;for(;n;){const t=Le(e,s,n,i);n=t.node,i=t.index}}function Le(e,t,s,i){const n=ke(t,i);switch(s.nodeType){case 1:Fe(e,t,s,n,i),Me(e,s,n);break;case 3:return function(e,t,s,i,n){const r=le.parse(t.textContent,e.directives);if(null===r)return Ie.node=t.nextSibling,Ie.index=n+1,Ie;let o,l=o=t;for(let t=0,a=r.length;t<a;++t){const a=r[t];0!==t&&(n++,i=ke(s,n),o=l.parentNode.insertBefore(document.createTextNode(""),l.nextSibling)),y(a)?o.textContent=a:(o.textContent=" ",fe.assign(a),e.addFactory(a,s,i,n)),l=o}return Ie.index=n+1,Ie.node=l.nextSibling,Ie}(e,s,t,n,i);case 8:const r=le.parse(s.data,e.directives);null!==r&&e.addFactory(Re.aggregate(r),t,n,i)}return Ie.index=i+1,Ie.node=s.nextSibling,Ie}const ze={createHTML:e=>e};let _e=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",ze):ze;const Pe=_e,Re={setHTMLPolicy(e){if(_e!==Pe)throw f.error(1201);_e=e},compile(e,t){let s;if(y(e)){s=document.createElement("TEMPLATE"),s.innerHTML=_e.createHTML(e);const t=s.content.firstElementChild;null!==t&&"TEMPLATE"===t.tagName&&(s=t)}else s=e;const i=document.adoptNode(s.content),n=new Ne(i,t);return Fe(n,"",s,"h",0,!0),(function(e,t){return e&&8==e.nodeType&&null!==le.parse(e.data,t)}(i.firstChild,t)||1===i.childNodes.length&&Object.keys(t).length>0)&&i.insertBefore(document.createComment(""),i.firstChild),Me(n,i,"r"),Ie.node=null,n.freeze()},setDefaultStrategy(e){this.compile=e},aggregate(e){if(1===e.length)return e[0];let t,s,i=!1;const n=e.length,r=e.map((e=>y(e)?()=>e:(t=e.sourceAspect||t,s=e.dataBinding||s,i=i||e.dataBinding.isVolatile,e.dataBinding.evaluate)));s.evaluate=(e,t)=>{let s="";for(let i=0;i<n;++i)s+=r[i](e,t);return s},s.isVolatile=i;const o=new Te(s);return fe.assign(o,t),o}};class De{constructor(e,t){this.result=null,this.html=e,this.factories=t}create(e){return null===this.result&&(this.result=Re.compile(this.html,this.factories)),this.result.createView(e)}render(e,t,s){const i=this.create(s);return i.bind(e),i.appendTo(t),i}}const He=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function Ue(e,t,s){const i=He.exec(t);return null!==i&&fe.assign(e,i[2]),e.createHTML(s)}function qe(e,...t){let s="";const i=Object.create(null),n=e=>{var t;const s=null!==(t=e.id)&&void 0!==t?t:e.id=re();return i[s]=e,s};for(let i=0,r=e.length-1;i<r;++i){const r=e[i],o=t[i];let l;if(s+=r,v(o))s+=Ue(new Te(Se(o)),r,n);else if(y(o)){const e=He.exec(r);if(null!==e){const t=new Te(xe((()=>o)));fe.assign(t,e[2]),s+=t.createHTML(n)}else s+=o}else o instanceof ue?s+=Ue(new Te(o),r,n):void 0===(l=ce.getForInstance(o))?s+=Ue(new Te(xe((()=>o))),r,n):l.aspected?s+=Ue(o,r,n):s+=o.createHTML(n)}return new De(s+e[e.length-1],i)}class Qe extends ge{bind(e){e.source[this.options]=e.targets[this.nodeId]}}ce.define(Qe);const We=e=>new Qe(e);function Ke(e,t){const s=v(e)?e:()=>e,i=v(t)?t:()=>t;return(e,t)=>s(e,t)?i(e,t):null}const Ge=Object.freeze({positioning:!1,recycle:!0});function Je(e,t,s,i){e.context.parent=i.source,e.context.parentContext=i.context,e.bind(t[s])}function Xe(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 Ye{constructor(e){this.directive=e,this.views=[],this.items=null,this.itemsObserver=null,this.bindView=Je,this.itemsBindingObserver=e.dataBinding.createObserver(e,this),this.templateBindingObserver=e.templateBinding.createObserver(e,this),e.options.positioning&&(this.bindView=Xe)}bind(e){this.location=e.targets[this.directive.nodeId],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=g);const t=this.itemsObserver,s=this.itemsObserver=S.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,h=0;for(let c=0,d=e.length;c<d;++c){const d=e[c],u=d.removed;let f=0,g=d.index;const p=g+d.addedCount,b=t.splice(d.index,u.length),v=h=l.length+b.length;for(;g<p;++g){const e=t[g],c=e?e.firstChild:this.location;let d;o&&h>0?(f<=v&&b.length>0?(d=b[f],f++):(d=l[a],a++),h--):d=n.create(),t.splice(g,0,d),s(d,i,g,r),d.insertBefore(c)}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=e,i.index=s}}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||(je.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 h=l.splice(e,a-e);for(e=0,o=h.length;e<o;++e)h[e].dispose()}}unbindAllViews(){const e=this.views;for(let t=0,s=e.length;t<s;++t)e[t].unbind()}}class Ze{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.options=s,this.id=re(),_.enable()}createHTML(e){return oe.comment(e(this))}createBehavior(){return new Ye(this)}}function et(e,t,s=Ge){const i=Ae(e),n=Ae(t);return new Ze(i,n,Object.assign(Object.assign({},Ge),s))}ce.define(Ze);const tt=e=>1===e.nodeType,st=e=>e?t=>1===t.nodeType&&t.matches(e):tt;class it extends ge{constructor(){super(...arguments),this.sourceProperty=`${this.id}-s`}bind(e){const t=e.targets[this.nodeId];t[this.sourceProperty]=e.source,this.updateTarget(e.source,this.computeNodes(t)),this.observe(t),e.onUnbind(this)}unbind(e){const t=e.targets[this.nodeId];this.updateTarget(e.source,g),this.disconnect(t),t[this.sourceProperty]=null}getSource(e){return e[this.sourceProperty]}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 nt extends it{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 rt(e){return y(e)&&(e={property:e}),new nt(e)}ce.define(nt);class ot extends it{constructor(e){super(e),this.observerProperty=`${this.id}-o`,this.handleEvent=(e,t)=>{const s=t.target;this.updateTarget(this.getSource(s),this.computeNodes(s))},e.childList=!0}observe(e){var t;const s=null!==(t=e[this.observerProperty])&&void 0!==t?t:e[this.observerProperty]=new MutationObserver(this.handleEvent);s.target=e,s.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 lt(e){return y(e)&&(e={property:e}),new ot(e)}ce.define(ot);const at=Object.freeze({locate:b()}),ht={toView:e=>e?"true":"false",fromView:e=>null!=e&&"false"!==e&&!1!==e&&0!==e};function ct(e){if(null==e)return null;const t=1*e;return isNaN(t)?null:t}const dt={toView(e){const t=ct(e);return t?t.toString():t},fromView:ct};class ut{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=ht)}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 S.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 i=e[this.fieldName];switch(t){case"reflect":const t=this.converter;Z.setAttribute(e,this.attribute,void 0!==t?t.toView(i):i);break;case"boolean":Z.setBooleanAttribute(e,this.attribute,i)}s.delete(e)}))}static collect(e,...t){const s=[];t.push(at.locate(e));for(let i=0,n=t.length;i<n;++i){const n=t[i];if(void 0!==n)for(let t=0,i=n.length;t<i;++t){const i=n[t];y(i)?s.push(new ut(e,i)):s.push(new ut(e,i.property,i.attribute,i.mode,i.converter))}}return s}}function ft(e,t){let s;function i(e,t){arguments.length>1&&(s.property=t),at.locate(e.constructor).push(s)}return arguments.length>1?(s={},void i(e,t)):(s=void 0===e?{}:e,i)}const gt={mode:"open"},pt={},bt=f.getById(4,(()=>p()));class vt{constructor(e,t=e.definition){var s;this.platformDefined=!1,y(t)&&(t={name:t}),this.type=e,this.name=t.name,this.template=t.template,this.registry=null!==(s=t.registry)&&void 0!==s?s:customElements;const i=e.prototype,n=ut.collect(e,t.attributes),r=new Array(n.length),o={},l={};for(let e=0,t=n.length;e<t;++e){const t=n[e];r[e]=t.attribute,o[t.name]=t,l[t.attribute]=t,S.defineProperty(i,t)}Reflect.defineProperty(e,"observedAttributes",{value:r,enumerable:!0}),this.attributes=n,this.propertyLookup=o,this.attributeLookup=l,this.shadowOptions=void 0===t.shadowOptions?gt:null===t.shadowOptions?void 0:Object.assign(Object.assign({},gt),t.shadowOptions),this.elementOptions=void 0===t.elementOptions?pt:Object.assign(Object.assign({},pt),t.elementOptions),this.styles=U.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){const s=bt.getByType(e);return new vt(s?class extends e{}:e,t)}}vt.getByType=bt.getByType,vt.getForInstance=bt.getForInstance;const yt={bubbles:!0,composed:!0,cancelable:!0},mt=new WeakMap;function wt(e){var t,s;return null!==(s=null!==(t=e.shadowRoot)&&void 0!==t?t:mt.get(e))&&void 0!==s?s:null}class Ct extends C{constructor(e,t){super(e),this.boundObservables=null,this.needsInitialization=!0,this.hasExistingShadowRoot=!1,this._template=null,this._isConnected=!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&&mt.set(e,t))}const i=S.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 S.track(this,"isConnected"),this._isConnected}setIsConnected(e){this._isConnected=e,S.notify(this,"isConnected")}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))}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.isConnected&&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&&this.isConnected&&e.disconnectedCallback(this),e.removedCallback&&e.removedCallback(this)):s.set(e,i-1))}addStyles(e){var t;if(!e)return;const s=this.source,i=null!==(t=wt(s))&&void 0!==t?t:s.getRootNode();if(e instanceof HTMLElement)i.append(e);else if(!e.isAttachedTo(i)){const t=e.behaviors;if(e.addStylesTo(i),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,i=null!==(t=wt(s))&&void 0!==t?t:s.getRootNode();if(e instanceof HTMLElement)i.removeChild(e);else if(e.isAttachedTo(i)){const t=e.behaviors;if(e.removeStylesFrom(i),null!==t)for(let e=0,s=t.length;e<s;++e)this.addBehavior(t[e])}}connect(){if(this._isConnected)return;this.needsInitialization?this.finishInitialization():null!==this.view&&this.view.bind(this.source);const e=this.behaviors;if(null!==e)for(const t of e.keys())t.connectedCallback&&t.connectedCallback(this);this.setIsConnected(!0)}disconnect(){if(!this._isConnected)return;this.setIsConnected(!1),null!==this.view&&this.view.unbind();const e=this.behaviors;if(null!==e)for(const t of e.keys())t.disconnectedCallback&&t.disconnectedCallback(this)}onAttributeChangedCallback(e,t,s){const i=this.definition.attributeLookup[e];void 0!==i&&i.onAttributeChangedCallback(this.source,s)}emit(e,t,s){return!!this._isConnected&&this.source.dispatchEvent(new CustomEvent(e,Object.assign(Object.assign({detail:t},yt),s)))}finishInitialization(){const e=this.source,t=this.boundObservables;if(null!==t){const 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}this.renderTemplate(this.template),this.addStyles(this.mainStyles),this.needsInitialization=!1}renderTemplate(e){var t;const s=this.source,i=null!==(t=wt(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=T.coupled)}static forCustomElement(e){const t=e.$fastController;if(void 0!==t)return t;const s=vt.getForInstance(e);if(void 0===s)throw f.error(1401);return e.$fastController=new Ct(e,s)}}function Tt(e){return class extends e{constructor(){super(),Ct.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)}}}function St(e,t){return v(e)?vt.compose(e,t).define().type:vt.compose(this,e).define().type}const xt=Object.assign(Tt(HTMLElement),{from:function(e){return Tt(e)},define:St,compose:function(e,t){return v(e)?vt.compose(e,t):vt.compose(this,e)}});function Ot(e){return function(t){St(t,e)}}export{q as AdoptedStyleSheetsStrategy,_ as ArrayObserver,fe as Aspect,at as AttributeConfiguration,ut as AttributeDefinition,ue as Binding,W as CSSDirective,ot as ChildrenDirective,Re as Compiler,Z as DOM,Ct as ElementController,U as ElementStyles,B as ExecutionContext,f as FAST,xt as FASTElement,vt as FASTElementDefinition,Te as HTMLBindingDirective,ce as HTMLDirective,je as HTMLView,oe as Markup,it as NodeObservationDirective,S as Observable,le as Parser,C as PropertyChangeNotifier,Qe as RefDirective,Ye as RepeatBehavior,Ze as RepeatDirective,nt as SlottedDirective,T as SourceLifetime,j as Splice,F as SpliceStrategy,k as SpliceStrategySupport,ge as StatelessAttachedAttributeDirective,w as SubscriberSet,m as Updates,ae as ViewBehaviorOrchestrator,De as ViewTemplate,ft as attr,Se as bind,ht as booleanConverter,lt as children,b as createMetadataLocator,p as createTypeRegistry,J as css,K as cssDirective,Y as cssPartial,Ot as customElement,st as elements,g as emptyArray,qe as html,de as htmlDirective,P as lengthOf,Oe as listener,Ae as normalizeBinding,dt as nullableNumberConverter,x as observable,xe as oneTime,We as ref,et as repeat,rt as slotted,O as volatile,Ke as when}; | ||
!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}}(),globalThis.trustedTypes||(globalThis.trustedTypes={createPolicy:(e,t)=>t});const e={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},e));const t=globalThis.FAST;if(void 0===t.getById){const s=Object.create(null);Reflect.defineProperty(t,"getById",Object.assign({value(e,t){let i=s[e];return void 0===i&&(i=t?s[e]=t():null),i}},e))}const s=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;function i(e){return e===document?document.body:e}let n=0;class r{constructor(e){this.styles=e,this.styleClass="fast-"+ ++n}addStylesTo(e){e=i(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.querySelectorAll(`.${this.styleClass}`);e=i(e);for(let s=0,i=t.length;s<i;++s)e.removeChild(t[s])}}s||t.getById(5,(()=>r)),void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",{value:Object.create(null),configurable:!1,enumerable:!1,writable:!1});const o=globalThis.FAST,l={1101:"Must call enableArrayObservation before observing arrays.",1201:"The HTML 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.",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."},a=/(\$\{\w+?})/g,h=/\$\{(\w+?)}/g,c=Object.freeze({});function d(e,t){return e.split(a).map((e=>{var s;const i=e.replace(h,"$1");return String(null!==(s=t[i])&&void 0!==s?s:e)})).join("")}Object.assign(o,{addMessages(e){Object.assign(l,e)},warn(e,t=c){var s;const i=null!==(s=l[e])&&void 0!==s?s:"Unknown Warning";console.warn(d(i,t))},error(e,t=c){var s;const i=null!==(s=l[e])&&void 0!==s?s:"Unknown Error";return new Error(d(i,t))}});const u={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},u));const f=globalThis.FAST;if(void 0===f.getById){const e=Object.create(null);Reflect.defineProperty(f,"getById",Object.assign({value(t,s){let i=e[t];return void 0===i&&(i=s?e[t]=s():null),i}},u))}void 0===f.error&&Object.assign(f,{warn(){},error:e=>new Error(`Error ${e}`),addMessages(){}});const g=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 b(){const e=new WeakMap;return function(t){let s=e.get(t);if(void 0===s){let i=Reflect.getPrototypeOf(t);for(;void 0===s&&null!==i;)s=e.get(i),i=Reflect.getPrototypeOf(i);s=void 0===s?[]:s.slice(0),e.set(t,s)}return s}}const v=e=>"function"==typeof e,y=e=>"string"==typeof e,m=f.getById(1,(()=>{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 w{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 C{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 w(this.subject):null!==(i=this.subjectSubscribers)&&void 0!==i?i:this.subjectSubscribers=new w(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 T=Object.freeze({unknown:void 0,coupled:1}),S=f.getById(2,(()=>{const e=m.enqueue,t=/(:|&&|\|\||if)/,s=new WeakMap;let i,n=e=>{throw f.error(1101)};function r(e){var t;let i=null!==(t=e.$fastController)&&void 0!==t?t:s.get(e);return void 0===i&&(Array.isArray(e)?i=n(e):s.set(e,i=new C(e))),i}const o=b();class l{constructor(e){this.name=e,this.field=`_${e}`,this.callback=`${e}Changed`}getValue(e){return void 0!==i&&i.watch(e,this.name),e[this.field]}setValue(e,t){const s=this.field,i=e[s];if(i!==t){e[s]=t;const n=e[this.callback];v(n)&&n.call(e,i,t),r(e).notify(this.name)}}}class a extends w{constructor(e,t,s=!1){super(e,t),this.binding=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!==T.coupled||this.first!==this.last||this.first.propertySource!==e.source}unbind(e){this.dispose()}observe(e,t){this.needsRefresh&&null!==this.last&&this.dispose();const s=i;let n;i=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;try{n=this.binding(e,t)}finally{i=s}return n}dispose(){if(null!==this.last){let e=this.first;for(;void 0!==e;)e.notifier.unsubscribe(this,e.propertyName),e=e.next;this.last=null,this.needsRefresh=this.needsQueue=this.isAsync}}watch(e,t){const s=this.last,n=r(e),o=null===s?this.first:{};if(o.propertySource=e,o.propertyName=t,o.notifier=n,n.subscribe(this,t),null!==s){if(!this.needsRefresh){let t;i=void 0,t=s.propertySource[s.propertyName],i=this,e===t&&(this.needsRefresh=!0)}s.next=o}this.last=o}handleChange(){this.needsQueue?(this.needsQueue=!1,e(this)):this.isAsync||this.call()}call(){null!==this.last&&(this.needsQueue=this.isAsync,this.notify(this))}*records(){let e=this.first;for(;void 0!==e;)yield e,e=e.next}}return Object.freeze({setArrayObserverFactory(e){n=e},getNotifier:r,track(e,t){i&&i.watch(e,t)},trackVolatile(){i&&(i.needsRefresh=!0)},notify(e,t){r(e).notify(t)},defineProperty(e,t){y(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 a(e,t,s)},isVolatileBinding:e=>t.test(e.toString())})}));function x(e,t){S.defineProperty(e,t)}function O(e,t,s){return Object.assign({},s,{get(){return S.trackVolatile(),s.get.apply(this)}})}const A=f.getById(3,(()=>{let e=null;return{get:()=>e,set(t){e=t}}})),B=Object.freeze({default:{index:0,length:0,get event(){return B.getEvent()},eventDetail(){return this.event.detail},eventTarget(){return this.event.target}},getEvent:()=>A.get(),setEvent(e){A.set(e)}});class j{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 k=Object.freeze({reset:1,splice:2,optimized:3}),$=new j(0,g,0);$.reset=!0;const I=[$];function E(e,t,s,i,n,r){let o=0,l=0;const a=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,a)),s===e.length&&r===i.length&&(l=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,a-o)),n+=o,r-=l,(s-=l)-(t+=o)==0&&r-n==0)return g;if(t===s){const e=new j(t,[],0);for(;n<r;)e.removed.push(i[n++]);return[e]}if(n===r)return[new j(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 h,c;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]:(h=a[s-1][r]+1,c=a[s][r-1]+1,a[s][r]=h<c?h:c);return a}(e,t,s,i,n,r)),c=[];let d,u=t,f=n;for(let e=0;e<h.length;++e)switch(h[e]){case 0:void 0!==d&&(c.push(d),d=void 0),u++,f++;break;case 1:void 0===d&&(d=new j(u,[],0)),d.addedCount++,u++,d.removed.push(i[f]),f++;break;case 2:void 0===d&&(d=new j(u,[],0)),d.addedCount++,u++;break;case 3:void 0===d&&(d=new j(u,[],0)),d.removed.push(i[f]),f++}return void 0!==d&&c.push(d),c}function V(e,t){let s=!1,i=0;for(let a=0;a<t.length;a++){const h=t[a];if(h.index+=i,s)continue;const c=(n=e.index,r=e.index+e.removed.length,o=h.index,l=h.index+h.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(c>=0){t.splice(a,1),a--,i-=h.addedCount-h.removed.length,e.addedCount+=h.addedCount-c;const n=e.removed.length+h.removed.length-c;if(e.addedCount||n){let t=h.removed;if(e.index<h.index){const s=e.removed.slice(0,h.index-e.index);s.push(...t),t=s}if(e.index+e.removed.length>h.index+h.addedCount){const s=e.removed.slice(h.index+h.addedCount-e.index);t.push(...s)}e.removed=t,h.index<e.index&&(e.index=h.index)}else s=!0}else if(e.index<h.index){s=!0,t.splice(a,0,e),a++;const n=e.addedCount-e.removed.length;h.index+=n,i+=n}}var n,r,o,l;s||t.push(e)}let N=Object.freeze({support:k.optimized,normalize:(e,t,s)=>void 0===e?void 0===s?g:s.length>1?function(e,t){let s=[];const i=[];for(let e=0,s=t.length;e<s;e++)V(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(E(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:I,pop(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new j(e.length,[r],0)),r},push(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new j(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 j(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 j(+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 j(0,[],i.length).adjustTo(e)),n}});const F=Object.freeze({reset:I,setDefaultStrategy(e){N=e}});function M(e,t,s){Reflect.defineProperty(e,t,{value:s,enumerable:!1})}class L extends w{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,M(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,S.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:N).normalize(s,this.subject,t)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,m.enqueue(this))}}let z=!1;const _=Object.freeze({enable(){if(z)return;z=!0,S.setArrayObserverFactory((e=>new L(e)));const e=Array.prototype;e.$fastPatch||(M(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:N)[t.name](this,i,t,e)}})))}});function P(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(_.enable(),t=S.getNotifier(e)),S.track(t.lengthObserver,"length"),e.length}const R=new Map;let D;function H(e){return e.map((e=>e instanceof U?H(e.styles):[e])).reduce(((e,t)=>e.concat(t)),[])}class U{constructor(e){this.styles=e,this.targets=new WeakSet,this._strategy=null,this.behaviors=e.map((e=>e instanceof U?e.behaviors:null)).reduce(((e,t)=>null===t?e:null===e?t:e.concat(t)),null)}get strategy(){return null===this._strategy&&this.withStrategy(D),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(H(this.styles)),this}static setDefaultStrategy(e){D=e}static normalize(e){return void 0===e?void 0:Array.isArray(e)?new U(e):e instanceof U?e:new U([e])}}U.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;class q{constructor(e){this.sheets=e.map((e=>{if(e instanceof CSSStyleSheet)return e;let t=R.get(e);return void 0===t&&(t=new CSSStyleSheet,t.replaceSync(e),R.set(e,t)),t}))}addStylesTo(e){e.adoptedStyleSheets=[...e.adoptedStyleSheets,...this.sheets]}removeStylesFrom(e){const t=this.sheets;e.adoptedStyleSheets=e.adoptedStyleSheets.filter((e=>-1===t.indexOf(e)))}}U.setDefaultStrategy(f.getById(5,(()=>q)));const Q=p(),W=Object.freeze({getForInstance:Q.getForInstance,getByType:Q.getByType,define:e=>(Q.register({type:e}),e)});function K(){return function(e){W.define(e)}}function G(e,t){const s=[];let i="";const n=[],r=e=>{n.push(e)};for(let n=0,o=e.length-1;n<o;++n){i+=e[n];let o=t[n];void 0!==W.getForInstance(o)&&(o=o.createCSS(r)),o instanceof U||o instanceof CSSStyleSheet?(""!==i.trim()&&(s.push(i),i=""),s.push(o)):i+=o}return i+=e[e.length-1],""!==i.trim()&&s.push(i),{styles:s,behaviors:n}}const J=(e,...t)=>{const{styles:s,behaviors:i}=G(e,t),n=new U(s);return i.length?n.withBehaviors(...i):n};class X{constructor(e,t){this.behaviors=t,this.css="";const s=e.reduce(((e,t)=>(y(t)?this.css+=t:e.push(t),e)),[]);s.length&&(this.styles=new U(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)}}W.define(X);const Y=J.partial=(e,...t)=>{const{styles:s,behaviors:i}=G(e,t);return new X(s,i)},Z=Object.freeze({queueUpdate:m.enqueue,nextUpdate:m.next,processUpdates:m.process,setAttribute(e,t,s){null==s?e.removeAttribute(t):e.setAttribute(t,s)},setBooleanAttribute(e,t,s){s?e.setAttribute(t,""):e.removeAttribute(t)}}),ee=`fast-${Math.random().toString(36).substring(2,8)}`,te=`${ee}{`,se=`}${ee}`,ie=se.length;let ne=0;const re=()=>`${ee}-${++ne}`,oe=Object.freeze({interpolation:e=>`${te}${e}${se}`,attribute:e=>`${re()}="${te}${e}${se}"`,comment:e=>`\x3c!--${te}${e}${se}--\x3e`}),le=Object.freeze({parse(e,t){const s=e.split(te);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(se);let o;if(-1===r)o=n;else{const e=n.substring(0,r);i.push(t[e]),o=n.substring(r+ie)}""!==o&&i.push(o)}return i}}),ae=Object.freeze({create(e){const t=[],s={};let i=null,n=!1;return{source:e,context:B.default,targets:s,get isBound(){return n},addBehaviorFactory(e,t){const s=e.nodeId||(e.nodeId=re());e.id||(e.id=re()),this.addTarget(s,t),this.addBehavior(e.createBehavior())},addTarget(e,t){s[e]=t},addBehavior(e){t.push(e),n&&e.bind(this)},onUnbind(e){null===i&&(i=[]),i.push(e)},connectedCallback(e){n||(n=!0,t.forEach((e=>e.bind(this))))},disconnectedCallback(e){n&&(n=!1,null!==i&&i.forEach((e=>e.unbind(this))))}}}}),he=p(),ce=Object.freeze({getForInstance:he.getForInstance,getByType:he.getByType,define:(e,t)=>((t=t||{}).type=e,he.register(t),e)});function de(e){return function(t){ce.define(t,e)}}class ue{constructor(e,t=!1){this.evaluate=e,this.isVolatile=t}}const fe=Object.freeze({none:0,attribute:1,booleanAttribute:2,property:3,content:4,tokenList:5,event:6,assign(e,t){if(t)switch(e.sourceAspect=t,t[0]){case":":switch(e.targetAspect=t.substring(1),e.targetAspect){case"innerHTML":default:e.aspectType=fe.property;break;case"classList":e.aspectType=fe.tokenList}break;case"?":e.targetAspect=t.substring(1),e.aspectType=fe.booleanAttribute;break;case"@":e.targetAspect=t.substring(1),e.aspectType=fe.event;break;default:"class"===t?(e.targetAspect="className",e.aspectType=fe.property):(e.targetAspect=t,e.aspectType=fe.attribute)}else e.aspectType=fe.content}});class ge{constructor(e){this.options=e,this.id=re()}createHTML(e){return oe.attribute(e(this))}createBehavior(){return this}}const pe=globalThis.TrustedHTML?e=>(t,s)=>{const i=e(t,s);if(i instanceof TrustedHTML)return i;throw f.error(1202)}:e=>e;class be extends ue{createObserver(e,t){return S.binding(this.evaluate,t,this.isVolatile)}}class ve extends ue{createObserver(){return this}bind(e){return this.evaluate(e.source,e.context)}}function ye(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)):(t.isComposed=!0,t.bind(i.source),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}}function me(e,t,s){var i;const n=`${this.id}-t`,r=null!==(i=e[n])&&void 0!==i?i:e[n]={c:0,v:Object.create(null)},o=r.v;let l=r.c;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)}}const we=(e,t,s)=>e[t]=s,Ce=()=>{};class Te{constructor(e){this.dataBinding=e,this.updateTarget=null,this.id=re(),this.aspectType=fe.content,this.bind=this.bindDefault,this.data=`${this.id}-d`}createHTML(e){return oe.interpolation(e(this))}createBehavior(){if(null===this.updateTarget)switch("innerHTML"===this.targetAspect&&(this.dataBinding.evaluate=pe(this.dataBinding.evaluate)),this.aspectType){case 1:this.updateTarget=Z.setAttribute;break;case 2:this.updateTarget=Z.setBooleanAttribute;break;case 3:this.updateTarget=we;break;case 4:this.bind=this.bindContent,this.updateTarget=ye;break;case 5:this.updateTarget=me;break;case 6:this.bind=this.bindEvent,this.updateTarget=Ce;break;default:throw f.error(1205)}return this}bindDefault(e){var t;const s=e.targets[this.nodeId],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),this.updateTarget===ye&&e.onUnbind(this)}bindContent(e){this.bindDefault(e),e.onUnbind(this)}bindEvent(e){const t=e.targets[this.nodeId];t[this.data]=e,t.addEventListener(this.targetAspect,this,this.dataBinding.options)}unbind(e){const t=e.targets[this.nodeId].$fastView;void 0!==t&&t.isComposed&&(t.unbind(),t.needsBindOnly=!0)}handleEvent(e){const t=e.currentTarget;B.setEvent(e);const s=t[this.data],i=this.dataBinding.evaluate(s.source,s.context);B.setEvent(null),!0!==i&&e.preventDefault()}handleChange(e,t){const s=t.target,i=t.controller;this.updateTarget(s,this.targetAspect,t.bind(i),i)}}function Se(e,t=S.isVolatileBinding(e)){return new be(e,t)}function xe(e){return new ve(e)}function Oe(e,t){const s=new be(e,!1);return s.options=t,s}function Ae(e){return v(e)?Se(e):e instanceof ue?e:xe((()=>e))}function Be(e,t){const s=e.parentNode;let i,n=e;for(;n!==t;)i=n.nextSibling,s.removeChild(n),n=i;s.removeChild(t)}ce.define(Te,{aspected:!0});class je{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.selfContained=!1,this.index=0,this.length=0,this.firstChild=e.firstChild,this.lastChild=e.lastChild}get context(){return this}get event(){return B.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(){Be(this.firstChild,this.lastChild),this.unbind()}onUnbind(e){this.unbindables.push(e)}bind(e){if(this.source===e)return;let t=this.behaviors;if(null===t){this.source=e,this.behaviors=t=new Array(this.factories.length);const s=this.factories;for(let e=0,i=s.length;e<i;++e){const i=s[e].createBehavior();i.bind(this),t[e]=i}}else{null!==this.source&&this.evaluateUnbindables(),this.isBound=!1,this.source=e;for(let e=0,s=t.length;e<s;++e)t[e].bind(this)}this.isBound=!0}unbind(){this.isBound&&null!==this.source&&(this.evaluateUnbindables(),this.source=null,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){Be(e[0].firstChild,e[e.length-1].lastChild);for(let t=0,s=e.length;t<s;++t)e[t].unbind()}}}S.defineProperty(je.prototype,"index"),S.defineProperty(je.prototype,"length");const ke=(e,t)=>`${e}.${t}`,$e={},Ie={index:0,node:null};function Ee(e){e.startsWith("fast-")||f.warn(1204,{name:e})}const Ve=new Proxy(document.createElement("div"),{get(e,t){Ee(t);const s=Reflect.get(e,t);return v(s)?s.bind(e):s},set:(e,t,s)=>(Ee(t),Reflect.set(e,t,s))});class Ne{constructor(e,t){this.fragment=e,this.directives=t,this.proto=null,this.nodeIds=new Set,this.descriptors={},this.factories=[]}addFactory(e,t,s,i){this.nodeIds.has(s)||(this.nodeIds.add(s),this.addTargetDescriptor(t,s,i)),e.nodeId=s,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=$e[t];if(!n){const i=`_${t}`;$e[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:Ve;for(const e of this.nodeIds)s[e];return new je(t,this.factories,s)}}function Fe(e,t,s,i,n,r=!1){const o=s.attributes,l=e.directives;for(let a=0,h=o.length;a<h;++a){const c=o[a],d=c.value,u=le.parse(d,l);let f=null;null===u?r&&(f=new Te(xe((()=>d))),fe.assign(f,c.name)):f=Re.aggregate(u),null!==f&&(s.removeAttributeNode(c),a--,h--,e.addFactory(f,t,i,n))}}function Me(e,t,s){let i=0,n=t.firstChild;for(;n;){const t=Le(e,s,n,i);n=t.node,i=t.index}}function Le(e,t,s,i){const n=ke(t,i);switch(s.nodeType){case 1:Fe(e,t,s,n,i),Me(e,s,n);break;case 3:return function(e,t,s,i,n){const r=le.parse(t.textContent,e.directives);if(null===r)return Ie.node=t.nextSibling,Ie.index=n+1,Ie;let o,l=o=t;for(let t=0,a=r.length;t<a;++t){const a=r[t];0!==t&&(n++,i=ke(s,n),o=l.parentNode.insertBefore(document.createTextNode(""),l.nextSibling)),y(a)?o.textContent=a:(o.textContent=" ",fe.assign(a),e.addFactory(a,s,i,n)),l=o}return Ie.index=n+1,Ie.node=l.nextSibling,Ie}(e,s,t,n,i);case 8:const r=le.parse(s.data,e.directives);null!==r&&e.addFactory(Re.aggregate(r),t,n,i)}return Ie.index=i+1,Ie.node=s.nextSibling,Ie}const ze={createHTML:e=>e};let _e=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",ze):ze;const Pe=_e,Re={setHTMLPolicy(e){if(_e!==Pe)throw f.error(1201);_e=e},compile(e,t){let s;if(y(e)){s=document.createElement("TEMPLATE"),s.innerHTML=_e.createHTML(e);const t=s.content.firstElementChild;null!==t&&"TEMPLATE"===t.tagName&&(s=t)}else s=e;const i=document.adoptNode(s.content),n=new Ne(i,t);return Fe(n,"",s,"h",0,!0),(function(e,t){return e&&8==e.nodeType&&null!==le.parse(e.data,t)}(i.firstChild,t)||1===i.childNodes.length&&Object.keys(t).length>0)&&i.insertBefore(document.createComment(""),i.firstChild),Me(n,i,"r"),Ie.node=null,n.freeze()},setDefaultStrategy(e){this.compile=e},aggregate(e){if(1===e.length)return e[0];let t,s,i=!1;const n=e.length,r=e.map((e=>y(e)?()=>e:(t=e.sourceAspect||t,s=e.dataBinding||s,i=i||e.dataBinding.isVolatile,e.dataBinding.evaluate)));s.evaluate=(e,t)=>{let s="";for(let i=0;i<n;++i)s+=r[i](e,t);return s},s.isVolatile=i;const o=new Te(s);return fe.assign(o,t),o}};class De{constructor(e,t){this.result=null,this.html=e,this.factories=t}create(e){return null===this.result&&(this.result=Re.compile(this.html,this.factories)),this.result.createView(e)}render(e,t,s){const i=this.create(s);return i.bind(e),i.appendTo(t),i}}const He=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function Ue(e,t,s){const i=He.exec(t);return null!==i&&fe.assign(e,i[2]),e.createHTML(s)}function qe(e,...t){let s="";const i=Object.create(null),n=e=>{var t;const s=null!==(t=e.id)&&void 0!==t?t:e.id=re();return i[s]=e,s};for(let i=0,r=e.length-1;i<r;++i){const r=e[i],o=t[i];let l;if(s+=r,v(o))s+=Ue(new Te(Se(o)),r,n);else if(y(o)){const e=He.exec(r);if(null!==e){const t=new Te(xe((()=>o)));fe.assign(t,e[2]),s+=t.createHTML(n)}else s+=o}else o instanceof ue?s+=Ue(new Te(o),r,n):void 0===(l=ce.getForInstance(o))?s+=Ue(new Te(xe((()=>o))),r,n):l.aspected?s+=Ue(o,r,n):s+=o.createHTML(n)}return new De(s+e[e.length-1],i)}class Qe extends ge{bind(e){e.source[this.options]=e.targets[this.nodeId]}}ce.define(Qe);const We=e=>new Qe(e);function Ke(e,t){const s=v(e)?e:()=>e,i=v(t)?t:()=>t;return(e,t)=>s(e,t)?i(e,t):null}const Ge=Object.freeze({positioning:!1,recycle:!0});function Je(e,t,s,i){e.context.parent=i.source,e.context.parentContext=i.context,e.bind(t[s])}function Xe(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 Ye{constructor(e){this.directive=e,this.views=[],this.items=null,this.itemsObserver=null,this.bindView=Je,this.itemsBindingObserver=e.dataBinding.createObserver(e,this),this.templateBindingObserver=e.templateBinding.createObserver(e,this),e.options.positioning&&(this.bindView=Xe)}bind(e){this.location=e.targets[this.directive.nodeId],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=g);const t=this.itemsObserver,s=this.itemsObserver=S.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,h=0;for(let c=0,d=e.length;c<d;++c){const d=e[c],u=d.removed;let f=0,g=d.index;const p=g+d.addedCount,b=t.splice(d.index,u.length),v=h=l.length+b.length;for(;g<p;++g){const e=t[g],c=e?e.firstChild:this.location;let d;o&&h>0?(f<=v&&b.length>0?(d=b[f],f++):(d=l[a],a++),h--):d=n.create(),t.splice(g,0,d),s(d,i,g,r),d.insertBefore(c)}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=e,i.index=s}}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||(je.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 h=l.splice(e,a-e);for(e=0,o=h.length;e<o;++e)h[e].dispose()}}unbindAllViews(){const e=this.views;for(let t=0,s=e.length;t<s;++t)e[t].unbind()}}class Ze{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.options=s,this.id=re(),_.enable()}createHTML(e){return oe.comment(e(this))}createBehavior(){return new Ye(this)}}function et(e,t,s=Ge){const i=Ae(e),n=Ae(t);return new Ze(i,n,Object.assign(Object.assign({},Ge),s))}ce.define(Ze);const tt=e=>1===e.nodeType,st=e=>e?t=>1===t.nodeType&&t.matches(e):tt;class it extends ge{constructor(){super(...arguments),this.sourceProperty=`${this.id}-s`}bind(e){const t=e.targets[this.nodeId];t[this.sourceProperty]=e.source,this.updateTarget(e.source,this.computeNodes(t)),this.observe(t),e.onUnbind(this)}unbind(e){const t=e.targets[this.nodeId];this.updateTarget(e.source,g),this.disconnect(t),t[this.sourceProperty]=null}getSource(e){return e[this.sourceProperty]}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 nt extends it{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 rt(e){return y(e)&&(e={property:e}),new nt(e)}ce.define(nt);class ot extends it{constructor(e){super(e),this.observerProperty=`${this.id}-o`,this.handleEvent=(e,t)=>{const s=t.target;this.updateTarget(this.getSource(s),this.computeNodes(s))},e.childList=!0}observe(e){var t;const s=null!==(t=e[this.observerProperty])&&void 0!==t?t:e[this.observerProperty]=new MutationObserver(this.handleEvent);s.target=e,s.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 lt(e){return y(e)&&(e={property:e}),new ot(e)}ce.define(ot);const at=Object.freeze({locate:b()}),ht={toView:e=>e?"true":"false",fromView:e=>null!=e&&"false"!==e&&!1!==e&&0!==e};function ct(e){if(null==e)return null;const t=1*e;return isNaN(t)?null:t}const dt={toView(e){const t=ct(e);return t?t.toString():t},fromView:ct};class ut{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=ht)}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 S.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 i=e[this.fieldName];switch(t){case"reflect":const t=this.converter;Z.setAttribute(e,this.attribute,void 0!==t?t.toView(i):i);break;case"boolean":Z.setBooleanAttribute(e,this.attribute,i)}s.delete(e)}))}static collect(e,...t){const s=[];t.push(at.locate(e));for(let i=0,n=t.length;i<n;++i){const n=t[i];if(void 0!==n)for(let t=0,i=n.length;t<i;++t){const i=n[t];y(i)?s.push(new ut(e,i)):s.push(new ut(e,i.property,i.attribute,i.mode,i.converter))}}return s}}function ft(e,t){let s;function i(e,t){arguments.length>1&&(s.property=t),at.locate(e.constructor).push(s)}return arguments.length>1?(s={},void i(e,t)):(s=void 0===e?{}:e,i)}const gt={mode:"open"},pt={},bt=f.getById(4,(()=>p()));class vt{constructor(e,t=e.definition){var s;this.platformDefined=!1,y(t)&&(t={name:t}),this.type=e,this.name=t.name,this.template=t.template,this.registry=null!==(s=t.registry)&&void 0!==s?s:customElements;const i=e.prototype,n=ut.collect(e,t.attributes),r=new Array(n.length),o={},l={};for(let e=0,t=n.length;e<t;++e){const t=n[e];r[e]=t.attribute,o[t.name]=t,l[t.attribute]=t,S.defineProperty(i,t)}Reflect.defineProperty(e,"observedAttributes",{value:r,enumerable:!0}),this.attributes=n,this.propertyLookup=o,this.attributeLookup=l,this.shadowOptions=void 0===t.shadowOptions?gt:null===t.shadowOptions?void 0:Object.assign(Object.assign({},gt),t.shadowOptions),this.elementOptions=void 0===t.elementOptions?pt:Object.assign(Object.assign({},pt),t.elementOptions),this.styles=U.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){const s=bt.getByType(e);return new vt(s?class extends e{}:e,t)}}vt.getByType=bt.getByType,vt.getForInstance=bt.getForInstance;const yt={bubbles:!0,composed:!0,cancelable:!0},mt=new WeakMap;function wt(e){var t,s;return null!==(s=null!==(t=e.shadowRoot)&&void 0!==t?t:mt.get(e))&&void 0!==s?s:null}class Ct extends C{constructor(e,t){super(e),this.boundObservables=null,this.needsInitialization=!0,this.hasExistingShadowRoot=!1,this._template=null,this._isConnected=!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&&mt.set(e,t))}const i=S.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 S.track(this,"isConnected"),this._isConnected}setIsConnected(e){this._isConnected=e,S.notify(this,"isConnected")}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))}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.isConnected&&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&&this.isConnected&&e.disconnectedCallback(this),e.removedCallback&&e.removedCallback(this)):s.set(e,i-1))}addStyles(e){var t;if(!e)return;const s=this.source,i=null!==(t=wt(s))&&void 0!==t?t:s.getRootNode();if(e instanceof HTMLElement)i.append(e);else if(!e.isAttachedTo(i)){const t=e.behaviors;if(e.addStylesTo(i),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,i=null!==(t=wt(s))&&void 0!==t?t:s.getRootNode();if(e instanceof HTMLElement)i.removeChild(e);else if(e.isAttachedTo(i)){const t=e.behaviors;if(e.removeStylesFrom(i),null!==t)for(let e=0,s=t.length;e<s;++e)this.addBehavior(t[e])}}connect(){if(this._isConnected)return;this.needsInitialization?this.finishInitialization():null!==this.view&&this.view.bind(this.source);const e=this.behaviors;if(null!==e)for(const t of e.keys())t.connectedCallback&&t.connectedCallback(this);this.setIsConnected(!0)}disconnect(){if(!this._isConnected)return;this.setIsConnected(!1),null!==this.view&&this.view.unbind();const e=this.behaviors;if(null!==e)for(const t of e.keys())t.disconnectedCallback&&t.disconnectedCallback(this)}onAttributeChangedCallback(e,t,s){const i=this.definition.attributeLookup[e];void 0!==i&&i.onAttributeChangedCallback(this.source,s)}emit(e,t,s){return!!this._isConnected&&this.source.dispatchEvent(new CustomEvent(e,Object.assign(Object.assign({detail:t},yt),s)))}finishInitialization(){const e=this.source,t=this.boundObservables;if(null!==t){const 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}this.renderTemplate(this.template),this.addStyles(this.mainStyles),this.needsInitialization=!1}renderTemplate(e){var t;const s=this.source,i=null!==(t=wt(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=T.coupled)}static forCustomElement(e){const t=e.$fastController;if(void 0!==t)return t;const s=vt.getForInstance(e);if(void 0===s)throw f.error(1401);return e.$fastController=new Ct(e,s)}}function Tt(e){return class extends e{constructor(){super(),Ct.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)}}}function St(e,t){return v(e)?vt.compose(e,t).define().type:vt.compose(this,e).define().type}const xt=Object.assign(Tt(HTMLElement),{from:function(e){return Tt(e)},define:St,compose:function(e,t){return v(e)?vt.compose(e,t):vt.compose(this,e)}});function Ot(e){return function(t){St(t,e)}}export{q as AdoptedStyleSheetsStrategy,_ as ArrayObserver,fe as Aspect,at as AttributeConfiguration,ut as AttributeDefinition,ue as Binding,W as CSSDirective,ot as ChildrenDirective,Re as Compiler,Z as DOM,Ct as ElementController,U as ElementStyles,B as ExecutionContext,f as FAST,xt as FASTElement,vt as FASTElementDefinition,Te as HTMLBindingDirective,ce as HTMLDirective,je as HTMLView,oe as Markup,it as NodeObservationDirective,S as Observable,le as Parser,C as PropertyChangeNotifier,Qe as RefDirective,Ye as RepeatBehavior,Ze as RepeatDirective,nt as SlottedDirective,T as SourceLifetime,j as Splice,F as SpliceStrategy,k as SpliceStrategySupport,ge as StatelessAttachedAttributeDirective,w as SubscriberSet,m as Updates,ae as ViewBehaviorOrchestrator,De as ViewTemplate,ft as attr,Se as bind,ht as booleanConverter,lt as children,b as createMetadataLocator,p as createTypeRegistry,J as css,K as cssDirective,Y as cssPartial,Ot as customElement,st as elements,g as emptyArray,qe as html,de as htmlDirective,P as lengthOf,Oe as listener,Ae as normalizeBinding,dt as nullableNumberConverter,x as observable,xe as oneTime,We as ref,et as repeat,rt as slotted,O as volatile,Ke as when}; |
@@ -1,1 +0,1 @@ | ||
!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}}(),globalThis.trustedTypes||(globalThis.trustedTypes={createPolicy:(e,t)=>t});const e={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},e));const t=globalThis.FAST;if(void 0===t.getById){const s=Object.create(null);Reflect.defineProperty(t,"getById",Object.assign({value(e,t){let i=s[e];return void 0===i&&(i=t?s[e]=t():null),i}},e))}const s=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;function i(e){return e===document?document.body:e}let n=0;class r{constructor(e){this.styles=e,this.styleClass="fast-"+ ++n}addStylesTo(e){e=i(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.querySelectorAll(`.${this.styleClass}`);e=i(e);for(let s=0,i=t.length;s<i;++s)e.removeChild(t[s])}}s||t.getById(5,(()=>r));const o={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},o));const l=globalThis.FAST;if(void 0===l.getById){const e=Object.create(null);Reflect.defineProperty(l,"getById",Object.assign({value(t,s){let i=e[t];return void 0===i&&(i=s?e[t]=s():null),i}},o))}void 0===l.error&&Object.assign(l,{warn(){},error:e=>new Error(`Error ${e}`),addMessages(){}});const a=Object.freeze([]);function h(){const e=new Map;return Object.freeze({register:t=>!e.has(t.type)&&(e.set(t.type,t),!0),getByType:t=>e.get(t),getForInstance:t=>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}}const d=e=>"function"==typeof e,u=e=>"string"==typeof e,f=l.getById(1,(()=>{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 p{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 b{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 p(this.subject):null!==(i=this.subjectSubscribers)&&void 0!==i?i:this.subjectSubscribers=new p(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 g=Object.freeze({unknown:void 0,coupled:1}),v=l.getById(2,(()=>{const e=f.enqueue,t=/(:|&&|\|\||if)/,s=new WeakMap;let i,n=e=>{throw l.error(1101)};function r(e){var t;let i=null!==(t=e.$fastController)&&void 0!==t?t:s.get(e);return void 0===i&&(Array.isArray(e)?i=n(e):s.set(e,i=new b(e))),i}const o=c();class a{constructor(e){this.name=e,this.field=`_${e}`,this.callback=`${e}Changed`}getValue(e){return void 0!==i&&i.watch(e,this.name),e[this.field]}setValue(e,t){const s=this.field,i=e[s];if(i!==t){e[s]=t;const n=e[this.callback];d(n)&&n.call(e,i,t),r(e).notify(this.name)}}}class h extends p{constructor(e,t,s=!1){super(e,t),this.binding=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!==g.coupled||this.first!==this.last||this.first.propertySource!==e.source}unbind(e){this.dispose()}observe(e,t){this.needsRefresh&&null!==this.last&&this.dispose();const s=i;let n;i=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;try{n=this.binding(e,t)}finally{i=s}return n}dispose(){if(null!==this.last){let e=this.first;for(;void 0!==e;)e.notifier.unsubscribe(this,e.propertyName),e=e.next;this.last=null,this.needsRefresh=this.needsQueue=this.isAsync}}watch(e,t){const s=this.last,n=r(e),o=null===s?this.first:{};if(o.propertySource=e,o.propertyName=t,o.notifier=n,n.subscribe(this,t),null!==s){if(!this.needsRefresh){let t;i=void 0,t=s.propertySource[s.propertyName],i=this,e===t&&(this.needsRefresh=!0)}s.next=o}this.last=o}handleChange(){this.needsQueue?(this.needsQueue=!1,e(this)):this.isAsync||this.call()}call(){null!==this.last&&(this.needsQueue=this.isAsync,this.notify(this))}*records(){let e=this.first;for(;void 0!==e;)yield e,e=e.next}}return Object.freeze({setArrayObserverFactory(e){n=e},getNotifier:r,track(e,t){i&&i.watch(e,t)},trackVolatile(){i&&(i.needsRefresh=!0)},notify(e,t){r(e).notify(t)},defineProperty(e,t){u(t)&&(t=new a(t)),o(e).push(t),Reflect.defineProperty(e,t.name,{enumerable:!0,get(){return t.getValue(this)},set(e){t.setValue(this,e)}})},getAccessors:o,binding(e,t,s=this.isVolatileBinding(e)){return new h(e,t,s)},isVolatileBinding:e=>t.test(e.toString())})}));function y(e,t){v.defineProperty(e,t)}function m(e,t,s){return Object.assign({},s,{get(){return v.trackVolatile(),s.get.apply(this)}})}const w=l.getById(3,(()=>{let e=null;return{get:()=>e,set(t){e=t}}})),C=Object.freeze({default:{index:0,length:0,get event(){return C.getEvent()},eventDetail(){return this.event.detail},eventTarget(){return this.event.target}},getEvent:()=>w.get(),setEvent(e){w.set(e)}});class x{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 T=Object.freeze({reset:1,splice:2,optimized:3}),S=new x(0,a,0);S.reset=!0;const O=[S];function B(e,t,s,i,n,r){let o=0,l=0;const h=Math.min(s-t,r-n);if(0===t&&0===n&&(o=function(e,t,s){for(let i=0;i<s;++i)if(e[i]!==t[i])return i;return s}(e,i,h)),s===e.length&&r===i.length&&(l=function(e,t,s){let i=e.length,n=t.length,r=0;for(;r<s&&e[--i]===t[--n];)r++;return r}(e,i,h-o)),n+=o,r-=l,(s-=l)-(t+=o)==0&&r-n==0)return a;if(t===s){const e=new x(t,[],0);for(;n<r;)e.removed.push(i[n++]);return[e]}if(n===r)return[new x(t,[],s-t)];const c=function(e){let t=e.length-1,s=e[0].length-1,i=e[t][s];const n=[];for(;t>0||s>0;){if(0===t){n.push(2),s--;continue}if(0===s){n.push(3),t--;continue}const r=e[t-1][s-1],o=e[t-1][s],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 h,c;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]:(h=a[s-1][r]+1,c=a[s][r-1]+1,a[s][r]=h<c?h:c);return a}(e,t,s,i,n,r)),d=[];let u,f=t,p=n;for(let e=0;e<c.length;++e)switch(c[e]){case 0:void 0!==u&&(d.push(u),u=void 0),f++,p++;break;case 1:void 0===u&&(u=new x(f,[],0)),u.addedCount++,f++,u.removed.push(i[p]),p++;break;case 2:void 0===u&&(u=new x(f,[],0)),u.addedCount++,f++;break;case 3:void 0===u&&(u=new x(f,[],0)),u.removed.push(i[p]),p++}return void 0!==u&&d.push(u),d}function A(e,t){let s=!1,i=0;for(let a=0;a<t.length;a++){const h=t[a];if(h.index+=i,s)continue;const c=(n=e.index,r=e.index+e.removed.length,o=h.index,l=h.index+h.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(c>=0){t.splice(a,1),a--,i-=h.addedCount-h.removed.length,e.addedCount+=h.addedCount-c;const n=e.removed.length+h.removed.length-c;if(e.addedCount||n){let t=h.removed;if(e.index<h.index){const s=e.removed.slice(0,h.index-e.index);s.push(...t),t=s}if(e.index+e.removed.length>h.index+h.addedCount){const s=e.removed.slice(h.index+h.addedCount-e.index);t.push(...s)}e.removed=t,h.index<e.index&&(e.index=h.index)}else s=!0}else if(e.index<h.index){s=!0,t.splice(a,0,e),a++;const n=e.addedCount-e.removed.length;h.index+=n,i+=n}}var n,r,o,l;s||t.push(e)}let k=Object.freeze({support:T.optimized,normalize:(e,t,s)=>void 0===e?void 0===s?a:s.length>1?function(e,t){let s=[];const i=[];for(let e=0,s=t.length;e<s;e++)A(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(B(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:O,pop(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new x(e.length,[r],0)),r},push(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new x(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 x(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 x(+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 x(0,[],i.length).adjustTo(e)),n}});const j=Object.freeze({reset:O,setDefaultStrategy(e){k=e}});function I(e,t,s){Reflect.defineProperty(e,t,{value:s,enumerable:!1})}class $ extends p{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,I(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,v.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:k).normalize(s,this.subject,t)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,f.enqueue(this))}}let V=!1;const E=Object.freeze({enable(){if(V)return;V=!0,v.setArrayObserverFactory((e=>new $(e)));const e=Array.prototype;e.$fastPatch||(I(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:k)[t.name](this,i,t,e)}})))}});function N(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(E.enable(),t=v.getNotifier(e)),v.track(t.lengthObserver,"length"),e.length}const _=new Map;let z;function F(e){return e.map((e=>e instanceof L?F(e.styles):[e])).reduce(((e,t)=>e.concat(t)),[])}class L{constructor(e){this.styles=e,this.targets=new WeakSet,this._strategy=null,this.behaviors=e.map((e=>e instanceof L?e.behaviors:null)).reduce(((e,t)=>null===t?e:null===e?t:e.concat(t)),null)}get strategy(){return null===this._strategy&&this.withStrategy(z),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(F(this.styles)),this}static setDefaultStrategy(e){z=e}static normalize(e){return void 0===e?void 0:Array.isArray(e)?new L(e):e instanceof L?e:new L([e])}}L.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;class M{constructor(e){this.sheets=e.map((e=>{if(e instanceof CSSStyleSheet)return e;let t=_.get(e);return void 0===t&&(t=new CSSStyleSheet,t.replaceSync(e),_.set(e,t)),t}))}addStylesTo(e){e.adoptedStyleSheets=[...e.adoptedStyleSheets,...this.sheets]}removeStylesFrom(e){const t=this.sheets;e.adoptedStyleSheets=e.adoptedStyleSheets.filter((e=>-1===t.indexOf(e)))}}L.setDefaultStrategy(l.getById(5,(()=>M)));const P=h(),R=Object.freeze({getForInstance:P.getForInstance,getByType:P.getByType,define:e=>(P.register({type:e}),e)});function H(){return function(e){R.define(e)}}function D(e,t){const s=[];let i="";const n=[],r=e=>{n.push(e)};for(let n=0,o=e.length-1;n<o;++n){i+=e[n];let o=t[n];void 0!==R.getForInstance(o)&&(o=o.createCSS(r)),o instanceof L||o instanceof CSSStyleSheet?(""!==i.trim()&&(s.push(i),i=""),s.push(o)):i+=o}return i+=e[e.length-1],""!==i.trim()&&s.push(i),{styles:s,behaviors:n}}const U=(e,...t)=>{const{styles:s,behaviors:i}=D(e,t),n=new L(s);return i.length?n.withBehaviors(...i):n};class q{constructor(e,t){this.behaviors=t,this.css="";const s=e.reduce(((e,t)=>(u(t)?this.css+=t:e.push(t),e)),[]);s.length&&(this.styles=new L(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)}}R.define(q);const Q=U.partial=(e,...t)=>{const{styles:s,behaviors:i}=D(e,t);return new q(s,i)},W=Object.freeze({queueUpdate:f.enqueue,nextUpdate:f.next,processUpdates:f.process,setAttribute(e,t,s){null==s?e.removeAttribute(t):e.setAttribute(t,s)},setBooleanAttribute(e,t,s){s?e.setAttribute(t,""):e.removeAttribute(t)}}),G=`fast-${Math.random().toString(36).substring(2,8)}`,J=`${G}{`,K=`}${G}`,X=K.length;let Y=0;const Z=()=>`${G}-${++Y}`,ee=Object.freeze({interpolation:e=>`${J}${e}${K}`,attribute:e=>`${Z()}="${J}${e}${K}"`,comment:e=>`\x3c!--${J}${e}${K}--\x3e`}),te=Object.freeze({parse(e,t){const s=e.split(J);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(K);let o;if(-1===r)o=n;else{const e=n.substring(0,r);i.push(t[e]),o=n.substring(r+X)}""!==o&&i.push(o)}return i}}),se=Object.freeze({create(e){const t=[],s={};let i=null,n=!1;return{source:e,context:C.default,targets:s,get isBound(){return n},addBehaviorFactory(e,t){const s=e.nodeId||(e.nodeId=Z());e.id||(e.id=Z()),this.addTarget(s,t),this.addBehavior(e.createBehavior())},addTarget(e,t){s[e]=t},addBehavior(e){t.push(e),n&&e.bind(this)},onUnbind(e){null===i&&(i=[]),i.push(e)},connectedCallback(e){n||(n=!0,t.forEach((e=>e.bind(this))))},disconnectedCallback(e){n&&(n=!1,null!==i&&i.forEach((e=>e.unbind(this))))}}}}),ie=h(),ne=Object.freeze({getForInstance:ie.getForInstance,getByType:ie.getByType,define:(e,t)=>((t=t||{}).type=e,ie.register(t),e)});function re(e){return function(t){ne.define(t,e)}}class oe{constructor(e,t=!1){this.evaluate=e,this.isVolatile=t}}const le=Object.freeze({none:0,attribute:1,booleanAttribute:2,property:3,content:4,tokenList:5,event:6,assign(e,t){if(t)switch(e.sourceAspect=t,t[0]){case":":switch(e.targetAspect=t.substring(1),e.targetAspect){case"innerHTML":default:e.aspectType=le.property;break;case"classList":e.aspectType=le.tokenList}break;case"?":e.targetAspect=t.substring(1),e.aspectType=le.booleanAttribute;break;case"@":e.targetAspect=t.substring(1),e.aspectType=le.event;break;default:"class"===t?(e.targetAspect="className",e.aspectType=le.property):(e.targetAspect=t,e.aspectType=le.attribute)}else e.aspectType=le.content}});class ae{constructor(e){this.options=e,this.id=Z()}createHTML(e){return ee.attribute(e(this))}createBehavior(){return this}}const he=globalThis.TrustedHTML?e=>(t,s)=>{const i=e(t,s);if(i instanceof TrustedHTML)return i;throw l.error(1202)}:e=>e;class ce extends oe{createObserver(e,t){return v.binding(this.evaluate,t,this.isVolatile)}}class de extends oe{createObserver(){return this}bind(e){return this.evaluate(e.source,e.context)}}function ue(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)):(t.isComposed=!0,t.bind(i.source),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}}function fe(e,t,s){var i;const n=`${this.id}-t`,r=null!==(i=e[n])&&void 0!==i?i:e[n]={c:0,v:Object.create(null)},o=r.v;let l=r.c;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)}}const pe=(e,t,s)=>e[t]=s,be=()=>{};class ge{constructor(e){this.dataBinding=e,this.updateTarget=null,this.id=Z(),this.aspectType=le.content,this.bind=this.bindDefault,this.data=`${this.id}-d`}createHTML(e){return ee.interpolation(e(this))}createBehavior(){if(null===this.updateTarget)switch("innerHTML"===this.targetAspect&&(this.dataBinding.evaluate=he(this.dataBinding.evaluate)),this.aspectType){case 1:this.updateTarget=W.setAttribute;break;case 2:this.updateTarget=W.setBooleanAttribute;break;case 3:this.updateTarget=pe;break;case 4:this.bind=this.bindContent,this.updateTarget=ue;break;case 5:this.updateTarget=fe;break;case 6:this.bind=this.bindEvent,this.updateTarget=be;break;default:throw l.error(1205)}return this}bindDefault(e){var t;const s=e.targets[this.nodeId],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),this.updateTarget===ue&&e.onUnbind(this)}bindContent(e){this.bindDefault(e),e.onUnbind(this)}bindEvent(e){const t=e.targets[this.nodeId];t[this.data]=e,t.addEventListener(this.targetAspect,this,this.dataBinding.options)}unbind(e){const t=e.targets[this.nodeId].$fastView;void 0!==t&&t.isComposed&&(t.unbind(),t.needsBindOnly=!0)}handleEvent(e){const t=e.currentTarget;C.setEvent(e);const s=t[this.data],i=this.dataBinding.evaluate(s.source,s.context);C.setEvent(null),!0!==i&&e.preventDefault()}handleChange(e,t){const s=t.target,i=t.controller;this.updateTarget(s,this.targetAspect,t.bind(i),i)}}function ve(e,t=v.isVolatileBinding(e)){return new ce(e,t)}function ye(e){return new de(e)}function me(e,t){const s=new ce(e,!1);return s.options=t,s}function we(e){return d(e)?ve(e):e instanceof oe?e:ye((()=>e))}function Ce(e,t){const s=e.parentNode;let i,n=e;for(;n!==t;)i=n.nextSibling,s.removeChild(n),n=i;s.removeChild(t)}ne.define(ge,{aspected:!0});class xe{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.selfContained=!1,this.index=0,this.length=0,this.firstChild=e.firstChild,this.lastChild=e.lastChild}get context(){return this}get event(){return C.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(){Ce(this.firstChild,this.lastChild),this.unbind()}onUnbind(e){this.unbindables.push(e)}bind(e){const t=this.source;if(t===e)return;let s=this.behaviors;if(this.source=e,null===s){this.behaviors=s=new Array(this.factories.length);const e=this.factories;for(let t=0,i=e.length;t<i;++t){const i=e[t].createBehavior();i.bind(this),s[t]=i}}else{null!==t&&this.evaluateUnbindables();for(let e=0,t=s.length;e<t;++e)s[e].bind(this)}this.isBound=!0}unbind(){if(!this.isBound)return;null!==this.source&&(this.evaluateUnbindables(),this.source=null,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){Ce(e[0].firstChild,e[e.length-1].lastChild);for(let t=0,s=e.length;t<s;++t)e[t].unbind()}}}v.defineProperty(xe.prototype,"index"),v.defineProperty(xe.prototype,"length");const Te=(e,t)=>`${e}.${t}`,Se={},Oe={index:0,node:null};function Be(e){e.startsWith("fast-")||l.warn(1204,{name:e})}const Ae=new Proxy(document.createElement("div"),{get(e,t){Be(t);const s=Reflect.get(e,t);return d(s)?s.bind(e):s},set:(e,t,s)=>(Be(t),Reflect.set(e,t,s))});class ke{constructor(e,t){this.fragment=e,this.directives=t,this.proto=null,this.nodeIds=new Set,this.descriptors={},this.factories=[]}addFactory(e,t,s,i){this.nodeIds.has(s)||(this.nodeIds.add(s),this.addTargetDescriptor(t,s,i)),e.nodeId=s,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=Se[t];if(!n){const i=`_${t}`;Se[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:Ae;for(const e of this.nodeIds)s[e];return new xe(t,this.factories,s)}}function je(e,t,s,i,n,r=!1){const o=s.attributes,l=e.directives;for(let a=0,h=o.length;a<h;++a){const c=o[a],d=c.value,u=te.parse(d,l);let f=null;null===u?r&&(f=new ge(ye((()=>d))),le.assign(f,c.name)):f=_e.aggregate(u),null!==f&&(s.removeAttributeNode(c),a--,h--,e.addFactory(f,t,i,n))}}function Ie(e,t,s){let i=0,n=t.firstChild;for(;n;){const t=$e(e,s,n,i);n=t.node,i=t.index}}function $e(e,t,s,i){const n=Te(t,i);switch(s.nodeType){case 1:je(e,t,s,n,i),Ie(e,s,n);break;case 3:return function(e,t,s,i,n){const r=te.parse(t.textContent,e.directives);if(null===r)return Oe.node=t.nextSibling,Oe.index=n+1,Oe;let o,l=o=t;for(let t=0,a=r.length;t<a;++t){const a=r[t];0!==t&&(n++,i=Te(s,n),o=l.parentNode.insertBefore(document.createTextNode(""),l.nextSibling)),u(a)?o.textContent=a:(o.textContent=" ",le.assign(a),e.addFactory(a,s,i,n)),l=o}return Oe.index=n+1,Oe.node=l.nextSibling,Oe}(e,s,t,n,i);case 8:const r=te.parse(s.data,e.directives);null!==r&&e.addFactory(_e.aggregate(r),t,n,i)}return Oe.index=i+1,Oe.node=s.nextSibling,Oe}const Ve={createHTML:e=>e};let Ee=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",Ve):Ve;const Ne=Ee,_e={setHTMLPolicy(e){if(Ee!==Ne)throw l.error(1201);Ee=e},compile(e,t){let s;if(u(e)){s=document.createElement("TEMPLATE"),s.innerHTML=Ee.createHTML(e);const t=s.content.firstElementChild;null!==t&&"TEMPLATE"===t.tagName&&(s=t)}else s=e;const i=document.adoptNode(s.content),n=new ke(i,t);return je(n,"",s,"h",0,!0),(function(e,t){return e&&8==e.nodeType&&null!==te.parse(e.data,t)}(i.firstChild,t)||1===i.childNodes.length&&Object.keys(t).length>0)&&i.insertBefore(document.createComment(""),i.firstChild),Ie(n,i,"r"),Oe.node=null,n.freeze()},setDefaultStrategy(e){this.compile=e},aggregate(e){if(1===e.length)return e[0];let t,s,i=!1;const n=e.length,r=e.map((e=>u(e)?()=>e:(t=e.sourceAspect||t,s=e.dataBinding||s,i=i||e.dataBinding.isVolatile,e.dataBinding.evaluate)));s.evaluate=(e,t)=>{let s="";for(let i=0;i<n;++i)s+=r[i](e,t);return s},s.isVolatile=i;const o=new ge(s);return le.assign(o,t),o}};class ze{constructor(e,t){this.result=null,this.html=e,this.factories=t}create(e){return null===this.result&&(this.result=_e.compile(this.html,this.factories)),this.result.createView(e)}render(e,t,s){const i=this.create(s);return i.bind(e),i.appendTo(t),i}}const Fe=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function Le(e,t,s){const i=Fe.exec(t);return null!==i&&le.assign(e,i[2]),e.createHTML(s)}function Me(e,...t){let s="";const i=Object.create(null),n=e=>{var t;const s=null!==(t=e.id)&&void 0!==t?t:e.id=Z();return i[s]=e,s};for(let i=0,r=e.length-1;i<r;++i){const r=e[i],o=t[i];let l;if(s+=r,d(o))s+=Le(new ge(ve(o)),r,n);else if(u(o)){const e=Fe.exec(r);if(null!==e){const t=new ge(ye((()=>o)));le.assign(t,e[2]),s+=t.createHTML(n)}else s+=o}else o instanceof oe?s+=Le(new ge(o),r,n):void 0===(l=ne.getForInstance(o))?s+=Le(new ge(ye((()=>o))),r,n):l.aspected?s+=Le(o,r,n):s+=o.createHTML(n)}return new ze(s+e[e.length-1],i)}class Pe extends ae{bind(e){e.source[this.options]=e.targets[this.nodeId]}}ne.define(Pe);const Re=e=>new Pe(e);function He(e,t){const s=d(e)?e:()=>e,i=d(t)?t:()=>t;return(e,t)=>s(e,t)?i(e,t):null}const De=Object.freeze({positioning:!1,recycle:!0});function Ue(e,t,s,i){e.context.parent=i.source,e.context.parentContext=i.context,e.bind(t[s])}function qe(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 Qe{constructor(e){this.directive=e,this.views=[],this.items=null,this.itemsObserver=null,this.bindView=Ue,this.itemsBindingObserver=e.dataBinding.createObserver(e,this),this.templateBindingObserver=e.templateBinding.createObserver(e,this),e.options.positioning&&(this.bindView=qe)}bind(e){this.location=e.targets[this.directive.nodeId],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=a);const t=this.itemsObserver,s=this.itemsObserver=v.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,h=0;for(let c=0,d=e.length;c<d;++c){const d=e[c],u=d.removed;let f=0,p=d.index;const b=p+d.addedCount,g=t.splice(d.index,u.length),v=h=l.length+g.length;for(;p<b;++p){const e=t[p],c=e?e.firstChild:this.location;let d;o&&h>0?(f<=v&&g.length>0?(d=g[f],f++):(d=l[a],a++),h--):d=n.create(),t.splice(p,0,d),s(d,i,p,r),d.insertBefore(c)}g[f]&&l.push(...g.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=e,i.index=s}}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||(xe.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 h=l.splice(e,a-e);for(e=0,o=h.length;e<o;++e)h[e].dispose()}}unbindAllViews(){const e=this.views;for(let t=0,s=e.length;t<s;++t)e[t].unbind()}}class We{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.options=s,this.id=Z(),E.enable()}createHTML(e){return ee.comment(e(this))}createBehavior(){return new Qe(this)}}function Ge(e,t,s=De){const i=we(e),n=we(t);return new We(i,n,Object.assign(Object.assign({},De),s))}ne.define(We);const Je=e=>1===e.nodeType,Ke=e=>e?t=>1===t.nodeType&&t.matches(e):Je;class Xe extends ae{constructor(){super(...arguments),this.sourceProperty=`${this.id}-s`}bind(e){const t=e.targets[this.nodeId];t[this.sourceProperty]=e.source,this.updateTarget(e.source,this.computeNodes(t)),this.observe(t),e.onUnbind(this)}unbind(e){const t=e.targets[this.nodeId];this.updateTarget(e.source,a),this.disconnect(t),t[this.sourceProperty]=null}getSource(e){return e[this.sourceProperty]}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 Ye extends Xe{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 Ze(e){return u(e)&&(e={property:e}),new Ye(e)}ne.define(Ye);class et extends Xe{constructor(e){super(e),this.observerProperty=`${this.id}-o`,this.handleEvent=(e,t)=>{const s=t.target;this.updateTarget(this.getSource(s),this.computeNodes(s))},e.childList=!0}observe(e){var t;const s=null!==(t=e[this.observerProperty])&&void 0!==t?t:e[this.observerProperty]=new MutationObserver(this.handleEvent);s.target=e,s.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 tt(e){return u(e)&&(e={property:e}),new et(e)}ne.define(et);const st=Object.freeze({locate:c()}),it={toView:e=>e?"true":"false",fromView:e=>null!=e&&"false"!==e&&!1!==e&&0!==e};function nt(e){if(null==e)return null;const t=1*e;return isNaN(t)?null:t}const rt={toView(e){const t=nt(e);return t?t.toString():t},fromView:nt};class ot{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=it)}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 v.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||f.enqueue((()=>{s.add(e);const i=e[this.fieldName];switch(t){case"reflect":const t=this.converter;W.setAttribute(e,this.attribute,void 0!==t?t.toView(i):i);break;case"boolean":W.setBooleanAttribute(e,this.attribute,i)}s.delete(e)}))}static collect(e,...t){const s=[];t.push(st.locate(e));for(let i=0,n=t.length;i<n;++i){const n=t[i];if(void 0!==n)for(let t=0,i=n.length;t<i;++t){const i=n[t];u(i)?s.push(new ot(e,i)):s.push(new ot(e,i.property,i.attribute,i.mode,i.converter))}}return s}}function lt(e,t){let s;function i(e,t){arguments.length>1&&(s.property=t),st.locate(e.constructor).push(s)}return arguments.length>1?(s={},void i(e,t)):(s=void 0===e?{}:e,i)}const at={mode:"open"},ht={},ct=l.getById(4,(()=>h()));class dt{constructor(e,t=e.definition){var s;this.platformDefined=!1,u(t)&&(t={name:t}),this.type=e,this.name=t.name,this.template=t.template,this.registry=null!==(s=t.registry)&&void 0!==s?s:customElements;const i=e.prototype,n=ot.collect(e,t.attributes),r=new Array(n.length),o={},l={};for(let e=0,t=n.length;e<t;++e){const t=n[e];r[e]=t.attribute,o[t.name]=t,l[t.attribute]=t,v.defineProperty(i,t)}Reflect.defineProperty(e,"observedAttributes",{value:r,enumerable:!0}),this.attributes=n,this.propertyLookup=o,this.attributeLookup=l,this.shadowOptions=void 0===t.shadowOptions?at:null===t.shadowOptions?void 0:Object.assign(Object.assign({},at),t.shadowOptions),this.elementOptions=void 0===t.elementOptions?ht:Object.assign(Object.assign({},ht),t.elementOptions),this.styles=L.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){const s=ct.getByType(e);return new dt(s?class extends e{}:e,t)}}dt.getByType=ct.getByType,dt.getForInstance=ct.getForInstance;const ut={bubbles:!0,composed:!0,cancelable:!0},ft=new WeakMap;function pt(e){var t,s;return null!==(s=null!==(t=e.shadowRoot)&&void 0!==t?t:ft.get(e))&&void 0!==s?s:null}class bt extends b{constructor(e,t){super(e),this.boundObservables=null,this.needsInitialization=!0,this.hasExistingShadowRoot=!1,this._template=null,this._isConnected=!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&&ft.set(e,t))}const i=v.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 v.track(this,"isConnected"),this._isConnected}setIsConnected(e){this._isConnected=e,v.notify(this,"isConnected")}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))}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.isConnected&&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&&this.isConnected&&e.disconnectedCallback(this),e.removedCallback&&e.removedCallback(this)):s.set(e,i-1))}addStyles(e){var t;if(!e)return;const s=this.source,i=null!==(t=pt(s))&&void 0!==t?t:s.getRootNode();if(e instanceof HTMLElement)i.append(e);else if(!e.isAttachedTo(i)){const t=e.behaviors;if(e.addStylesTo(i),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,i=null!==(t=pt(s))&&void 0!==t?t:s.getRootNode();if(e instanceof HTMLElement)i.removeChild(e);else if(e.isAttachedTo(i)){const t=e.behaviors;if(e.removeStylesFrom(i),null!==t)for(let e=0,s=t.length;e<s;++e)this.addBehavior(t[e])}}connect(){if(this._isConnected)return;this.needsInitialization?this.finishInitialization():null!==this.view&&this.view.bind(this.source);const e=this.behaviors;if(null!==e)for(const t of e.keys())t.connectedCallback&&t.connectedCallback(this);this.setIsConnected(!0)}disconnect(){if(!this._isConnected)return;this.setIsConnected(!1),null!==this.view&&this.view.unbind();const e=this.behaviors;if(null!==e)for(const t of e.keys())t.disconnectedCallback&&t.disconnectedCallback(this)}onAttributeChangedCallback(e,t,s){const i=this.definition.attributeLookup[e];void 0!==i&&i.onAttributeChangedCallback(this.source,s)}emit(e,t,s){return!!this._isConnected&&this.source.dispatchEvent(new CustomEvent(e,Object.assign(Object.assign({detail:t},ut),s)))}finishInitialization(){const e=this.source,t=this.boundObservables;if(null!==t){const 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}this.renderTemplate(this.template),this.addStyles(this.mainStyles),this.needsInitialization=!1}renderTemplate(e){var t;const s=this.source,i=null!==(t=pt(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=g.coupled)}static forCustomElement(e){const t=e.$fastController;if(void 0!==t)return t;const s=dt.getForInstance(e);if(void 0===s)throw l.error(1401);return e.$fastController=new bt(e,s)}}function gt(e){return 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)}}}function vt(e,t){return d(e)?dt.compose(e,t).define().type:dt.compose(this,e).define().type}const yt=Object.assign(gt(HTMLElement),{from:function(e){return gt(e)},define:vt,compose:function(e,t){return d(e)?dt.compose(e,t):dt.compose(this,e)}});function mt(e){return function(t){vt(t,e)}}export{M as AdoptedStyleSheetsStrategy,E as ArrayObserver,le as Aspect,st as AttributeConfiguration,ot as AttributeDefinition,oe as Binding,R as CSSDirective,et as ChildrenDirective,_e as Compiler,W as DOM,bt as ElementController,L as ElementStyles,C as ExecutionContext,l as FAST,yt as FASTElement,dt as FASTElementDefinition,ge as HTMLBindingDirective,ne as HTMLDirective,xe as HTMLView,ee as Markup,Xe as NodeObservationDirective,v as Observable,te as Parser,b as PropertyChangeNotifier,Pe as RefDirective,Qe as RepeatBehavior,We as RepeatDirective,Ye as SlottedDirective,g as SourceLifetime,x as Splice,j as SpliceStrategy,T as SpliceStrategySupport,ae as StatelessAttachedAttributeDirective,p as SubscriberSet,f as Updates,se as ViewBehaviorOrchestrator,ze as ViewTemplate,lt as attr,ve as bind,it as booleanConverter,tt as children,c as createMetadataLocator,h as createTypeRegistry,U as css,H as cssDirective,Q as cssPartial,mt as customElement,Ke as elements,a as emptyArray,Me as html,re as htmlDirective,N as lengthOf,me as listener,we as normalizeBinding,rt as nullableNumberConverter,y as observable,ye as oneTime,Re as ref,Ge as repeat,Ze as slotted,m as volatile,He as when}; | ||
!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}}(),globalThis.trustedTypes||(globalThis.trustedTypes={createPolicy:(e,t)=>t});const e={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},e));const t=globalThis.FAST;if(void 0===t.getById){const s=Object.create(null);Reflect.defineProperty(t,"getById",Object.assign({value(e,t){let i=s[e];return void 0===i&&(i=t?s[e]=t():null),i}},e))}const s=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;function i(e){return e===document?document.body:e}let n=0;class r{constructor(e){this.styles=e,this.styleClass="fast-"+ ++n}addStylesTo(e){e=i(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.querySelectorAll(`.${this.styleClass}`);e=i(e);for(let s=0,i=t.length;s<i;++s)e.removeChild(t[s])}}s||t.getById(5,(()=>r));const o={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},o));const l=globalThis.FAST;if(void 0===l.getById){const e=Object.create(null);Reflect.defineProperty(l,"getById",Object.assign({value(t,s){let i=e[t];return void 0===i&&(i=s?e[t]=s():null),i}},o))}void 0===l.error&&Object.assign(l,{warn(){},error:e=>new Error(`Error ${e}`),addMessages(){}});const a=Object.freeze([]);function h(){const e=new Map;return Object.freeze({register:t=>!e.has(t.type)&&(e.set(t.type,t),!0),getByType:t=>e.get(t),getForInstance(t){if(null!=t)return e.get(t.constructor)}})}function c(){const e=new WeakMap;return function(t){let s=e.get(t);if(void 0===s){let i=Reflect.getPrototypeOf(t);for(;void 0===s&&null!==i;)s=e.get(i),i=Reflect.getPrototypeOf(i);s=void 0===s?[]:s.slice(0),e.set(t,s)}return s}}const d=e=>"function"==typeof e,u=e=>"string"==typeof e,f=l.getById(1,(()=>{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 p{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 b{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 p(this.subject):null!==(i=this.subjectSubscribers)&&void 0!==i?i:this.subjectSubscribers=new p(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 g=Object.freeze({unknown:void 0,coupled:1}),v=l.getById(2,(()=>{const e=f.enqueue,t=/(:|&&|\|\||if)/,s=new WeakMap;let i,n=e=>{throw l.error(1101)};function r(e){var t;let i=null!==(t=e.$fastController)&&void 0!==t?t:s.get(e);return void 0===i&&(Array.isArray(e)?i=n(e):s.set(e,i=new b(e))),i}const o=c();class a{constructor(e){this.name=e,this.field=`_${e}`,this.callback=`${e}Changed`}getValue(e){return void 0!==i&&i.watch(e,this.name),e[this.field]}setValue(e,t){const s=this.field,i=e[s];if(i!==t){e[s]=t;const n=e[this.callback];d(n)&&n.call(e,i,t),r(e).notify(this.name)}}}class h extends p{constructor(e,t,s=!1){super(e,t),this.binding=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!==g.coupled||this.first!==this.last||this.first.propertySource!==e.source}unbind(e){this.dispose()}observe(e,t){this.needsRefresh&&null!==this.last&&this.dispose();const s=i;let n;i=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;try{n=this.binding(e,t)}finally{i=s}return n}dispose(){if(null!==this.last){let e=this.first;for(;void 0!==e;)e.notifier.unsubscribe(this,e.propertyName),e=e.next;this.last=null,this.needsRefresh=this.needsQueue=this.isAsync}}watch(e,t){const s=this.last,n=r(e),o=null===s?this.first:{};if(o.propertySource=e,o.propertyName=t,o.notifier=n,n.subscribe(this,t),null!==s){if(!this.needsRefresh){let t;i=void 0,t=s.propertySource[s.propertyName],i=this,e===t&&(this.needsRefresh=!0)}s.next=o}this.last=o}handleChange(){this.needsQueue?(this.needsQueue=!1,e(this)):this.isAsync||this.call()}call(){null!==this.last&&(this.needsQueue=this.isAsync,this.notify(this))}*records(){let e=this.first;for(;void 0!==e;)yield e,e=e.next}}return Object.freeze({setArrayObserverFactory(e){n=e},getNotifier:r,track(e,t){i&&i.watch(e,t)},trackVolatile(){i&&(i.needsRefresh=!0)},notify(e,t){r(e).notify(t)},defineProperty(e,t){u(t)&&(t=new a(t)),o(e).push(t),Reflect.defineProperty(e,t.name,{enumerable:!0,get(){return t.getValue(this)},set(e){t.setValue(this,e)}})},getAccessors:o,binding(e,t,s=this.isVolatileBinding(e)){return new h(e,t,s)},isVolatileBinding:e=>t.test(e.toString())})}));function y(e,t){v.defineProperty(e,t)}function m(e,t,s){return Object.assign({},s,{get(){return v.trackVolatile(),s.get.apply(this)}})}const w=l.getById(3,(()=>{let e=null;return{get:()=>e,set(t){e=t}}})),C=Object.freeze({default:{index:0,length:0,get event(){return C.getEvent()},eventDetail(){return this.event.detail},eventTarget(){return this.event.target}},getEvent:()=>w.get(),setEvent(e){w.set(e)}});class x{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 T=Object.freeze({reset:1,splice:2,optimized:3}),S=new x(0,a,0);S.reset=!0;const O=[S];function B(e,t,s,i,n,r){let o=0,l=0;const h=Math.min(s-t,r-n);if(0===t&&0===n&&(o=function(e,t,s){for(let i=0;i<s;++i)if(e[i]!==t[i])return i;return s}(e,i,h)),s===e.length&&r===i.length&&(l=function(e,t,s){let i=e.length,n=t.length,r=0;for(;r<s&&e[--i]===t[--n];)r++;return r}(e,i,h-o)),n+=o,r-=l,(s-=l)-(t+=o)==0&&r-n==0)return a;if(t===s){const e=new x(t,[],0);for(;n<r;)e.removed.push(i[n++]);return[e]}if(n===r)return[new x(t,[],s-t)];const c=function(e){let t=e.length-1,s=e[0].length-1,i=e[t][s];const n=[];for(;t>0||s>0;){if(0===t){n.push(2),s--;continue}if(0===s){n.push(3),t--;continue}const r=e[t-1][s-1],o=e[t-1][s],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 h,c;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]:(h=a[s-1][r]+1,c=a[s][r-1]+1,a[s][r]=h<c?h:c);return a}(e,t,s,i,n,r)),d=[];let u,f=t,p=n;for(let e=0;e<c.length;++e)switch(c[e]){case 0:void 0!==u&&(d.push(u),u=void 0),f++,p++;break;case 1:void 0===u&&(u=new x(f,[],0)),u.addedCount++,f++,u.removed.push(i[p]),p++;break;case 2:void 0===u&&(u=new x(f,[],0)),u.addedCount++,f++;break;case 3:void 0===u&&(u=new x(f,[],0)),u.removed.push(i[p]),p++}return void 0!==u&&d.push(u),d}function A(e,t){let s=!1,i=0;for(let a=0;a<t.length;a++){const h=t[a];if(h.index+=i,s)continue;const c=(n=e.index,r=e.index+e.removed.length,o=h.index,l=h.index+h.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(c>=0){t.splice(a,1),a--,i-=h.addedCount-h.removed.length,e.addedCount+=h.addedCount-c;const n=e.removed.length+h.removed.length-c;if(e.addedCount||n){let t=h.removed;if(e.index<h.index){const s=e.removed.slice(0,h.index-e.index);s.push(...t),t=s}if(e.index+e.removed.length>h.index+h.addedCount){const s=e.removed.slice(h.index+h.addedCount-e.index);t.push(...s)}e.removed=t,h.index<e.index&&(e.index=h.index)}else s=!0}else if(e.index<h.index){s=!0,t.splice(a,0,e),a++;const n=e.addedCount-e.removed.length;h.index+=n,i+=n}}var n,r,o,l;s||t.push(e)}let k=Object.freeze({support:T.optimized,normalize:(e,t,s)=>void 0===e?void 0===s?a:s.length>1?function(e,t){let s=[];const i=[];for(let e=0,s=t.length;e<s;e++)A(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(B(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:O,pop(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new x(e.length,[r],0)),r},push(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new x(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 x(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 x(+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 x(0,[],i.length).adjustTo(e)),n}});const j=Object.freeze({reset:O,setDefaultStrategy(e){k=e}});function I(e,t,s){Reflect.defineProperty(e,t,{value:s,enumerable:!1})}class $ extends p{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,I(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,v.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:k).normalize(s,this.subject,t)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,f.enqueue(this))}}let V=!1;const E=Object.freeze({enable(){if(V)return;V=!0,v.setArrayObserverFactory((e=>new $(e)));const e=Array.prototype;e.$fastPatch||(I(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:k)[t.name](this,i,t,e)}})))}});function N(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(E.enable(),t=v.getNotifier(e)),v.track(t.lengthObserver,"length"),e.length}const _=new Map;let z;function F(e){return e.map((e=>e instanceof L?F(e.styles):[e])).reduce(((e,t)=>e.concat(t)),[])}class L{constructor(e){this.styles=e,this.targets=new WeakSet,this._strategy=null,this.behaviors=e.map((e=>e instanceof L?e.behaviors:null)).reduce(((e,t)=>null===t?e:null===e?t:e.concat(t)),null)}get strategy(){return null===this._strategy&&this.withStrategy(z),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(F(this.styles)),this}static setDefaultStrategy(e){z=e}static normalize(e){return void 0===e?void 0:Array.isArray(e)?new L(e):e instanceof L?e:new L([e])}}L.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;class M{constructor(e){this.sheets=e.map((e=>{if(e instanceof CSSStyleSheet)return e;let t=_.get(e);return void 0===t&&(t=new CSSStyleSheet,t.replaceSync(e),_.set(e,t)),t}))}addStylesTo(e){e.adoptedStyleSheets=[...e.adoptedStyleSheets,...this.sheets]}removeStylesFrom(e){const t=this.sheets;e.adoptedStyleSheets=e.adoptedStyleSheets.filter((e=>-1===t.indexOf(e)))}}L.setDefaultStrategy(l.getById(5,(()=>M)));const P=h(),R=Object.freeze({getForInstance:P.getForInstance,getByType:P.getByType,define:e=>(P.register({type:e}),e)});function H(){return function(e){R.define(e)}}function D(e,t){const s=[];let i="";const n=[],r=e=>{n.push(e)};for(let n=0,o=e.length-1;n<o;++n){i+=e[n];let o=t[n];void 0!==R.getForInstance(o)&&(o=o.createCSS(r)),o instanceof L||o instanceof CSSStyleSheet?(""!==i.trim()&&(s.push(i),i=""),s.push(o)):i+=o}return i+=e[e.length-1],""!==i.trim()&&s.push(i),{styles:s,behaviors:n}}const U=(e,...t)=>{const{styles:s,behaviors:i}=D(e,t),n=new L(s);return i.length?n.withBehaviors(...i):n};class q{constructor(e,t){this.behaviors=t,this.css="";const s=e.reduce(((e,t)=>(u(t)?this.css+=t:e.push(t),e)),[]);s.length&&(this.styles=new L(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)}}R.define(q);const Q=U.partial=(e,...t)=>{const{styles:s,behaviors:i}=D(e,t);return new q(s,i)},W=Object.freeze({queueUpdate:f.enqueue,nextUpdate:f.next,processUpdates:f.process,setAttribute(e,t,s){null==s?e.removeAttribute(t):e.setAttribute(t,s)},setBooleanAttribute(e,t,s){s?e.setAttribute(t,""):e.removeAttribute(t)}}),G=`fast-${Math.random().toString(36).substring(2,8)}`,J=`${G}{`,K=`}${G}`,X=K.length;let Y=0;const Z=()=>`${G}-${++Y}`,ee=Object.freeze({interpolation:e=>`${J}${e}${K}`,attribute:e=>`${Z()}="${J}${e}${K}"`,comment:e=>`\x3c!--${J}${e}${K}--\x3e`}),te=Object.freeze({parse(e,t){const s=e.split(J);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(K);let o;if(-1===r)o=n;else{const e=n.substring(0,r);i.push(t[e]),o=n.substring(r+X)}""!==o&&i.push(o)}return i}}),se=Object.freeze({create(e){const t=[],s={};let i=null,n=!1;return{source:e,context:C.default,targets:s,get isBound(){return n},addBehaviorFactory(e,t){const s=e.nodeId||(e.nodeId=Z());e.id||(e.id=Z()),this.addTarget(s,t),this.addBehavior(e.createBehavior())},addTarget(e,t){s[e]=t},addBehavior(e){t.push(e),n&&e.bind(this)},onUnbind(e){null===i&&(i=[]),i.push(e)},connectedCallback(e){n||(n=!0,t.forEach((e=>e.bind(this))))},disconnectedCallback(e){n&&(n=!1,null!==i&&i.forEach((e=>e.unbind(this))))}}}}),ie=h(),ne=Object.freeze({getForInstance:ie.getForInstance,getByType:ie.getByType,define:(e,t)=>((t=t||{}).type=e,ie.register(t),e)});function re(e){return function(t){ne.define(t,e)}}class oe{constructor(e,t=!1){this.evaluate=e,this.isVolatile=t}}const le=Object.freeze({none:0,attribute:1,booleanAttribute:2,property:3,content:4,tokenList:5,event:6,assign(e,t){if(t)switch(e.sourceAspect=t,t[0]){case":":switch(e.targetAspect=t.substring(1),e.targetAspect){case"innerHTML":default:e.aspectType=le.property;break;case"classList":e.aspectType=le.tokenList}break;case"?":e.targetAspect=t.substring(1),e.aspectType=le.booleanAttribute;break;case"@":e.targetAspect=t.substring(1),e.aspectType=le.event;break;default:"class"===t?(e.targetAspect="className",e.aspectType=le.property):(e.targetAspect=t,e.aspectType=le.attribute)}else e.aspectType=le.content}});class ae{constructor(e){this.options=e,this.id=Z()}createHTML(e){return ee.attribute(e(this))}createBehavior(){return this}}const he=globalThis.TrustedHTML?e=>(t,s)=>{const i=e(t,s);if(i instanceof TrustedHTML)return i;throw l.error(1202)}:e=>e;class ce extends oe{createObserver(e,t){return v.binding(this.evaluate,t,this.isVolatile)}}class de extends oe{createObserver(){return this}bind(e){return this.evaluate(e.source,e.context)}}function ue(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)):(t.isComposed=!0,t.bind(i.source),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}}function fe(e,t,s){var i;const n=`${this.id}-t`,r=null!==(i=e[n])&&void 0!==i?i:e[n]={c:0,v:Object.create(null)},o=r.v;let l=r.c;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)}}const pe=(e,t,s)=>e[t]=s,be=()=>{};class ge{constructor(e){this.dataBinding=e,this.updateTarget=null,this.id=Z(),this.aspectType=le.content,this.bind=this.bindDefault,this.data=`${this.id}-d`}createHTML(e){return ee.interpolation(e(this))}createBehavior(){if(null===this.updateTarget)switch("innerHTML"===this.targetAspect&&(this.dataBinding.evaluate=he(this.dataBinding.evaluate)),this.aspectType){case 1:this.updateTarget=W.setAttribute;break;case 2:this.updateTarget=W.setBooleanAttribute;break;case 3:this.updateTarget=pe;break;case 4:this.bind=this.bindContent,this.updateTarget=ue;break;case 5:this.updateTarget=fe;break;case 6:this.bind=this.bindEvent,this.updateTarget=be;break;default:throw l.error(1205)}return this}bindDefault(e){var t;const s=e.targets[this.nodeId],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),this.updateTarget===ue&&e.onUnbind(this)}bindContent(e){this.bindDefault(e),e.onUnbind(this)}bindEvent(e){const t=e.targets[this.nodeId];t[this.data]=e,t.addEventListener(this.targetAspect,this,this.dataBinding.options)}unbind(e){const t=e.targets[this.nodeId].$fastView;void 0!==t&&t.isComposed&&(t.unbind(),t.needsBindOnly=!0)}handleEvent(e){const t=e.currentTarget;C.setEvent(e);const s=t[this.data],i=this.dataBinding.evaluate(s.source,s.context);C.setEvent(null),!0!==i&&e.preventDefault()}handleChange(e,t){const s=t.target,i=t.controller;this.updateTarget(s,this.targetAspect,t.bind(i),i)}}function ve(e,t=v.isVolatileBinding(e)){return new ce(e,t)}function ye(e){return new de(e)}function me(e,t){const s=new ce(e,!1);return s.options=t,s}function we(e){return d(e)?ve(e):e instanceof oe?e:ye((()=>e))}function Ce(e,t){const s=e.parentNode;let i,n=e;for(;n!==t;)i=n.nextSibling,s.removeChild(n),n=i;s.removeChild(t)}ne.define(ge,{aspected:!0});class xe{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.selfContained=!1,this.index=0,this.length=0,this.firstChild=e.firstChild,this.lastChild=e.lastChild}get context(){return this}get event(){return C.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(){Ce(this.firstChild,this.lastChild),this.unbind()}onUnbind(e){this.unbindables.push(e)}bind(e){if(this.source===e)return;let t=this.behaviors;if(null===t){this.source=e,this.behaviors=t=new Array(this.factories.length);const s=this.factories;for(let e=0,i=s.length;e<i;++e){const i=s[e].createBehavior();i.bind(this),t[e]=i}}else{null!==this.source&&this.evaluateUnbindables(),this.isBound=!1,this.source=e;for(let e=0,s=t.length;e<s;++e)t[e].bind(this)}this.isBound=!0}unbind(){this.isBound&&null!==this.source&&(this.evaluateUnbindables(),this.source=null,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){Ce(e[0].firstChild,e[e.length-1].lastChild);for(let t=0,s=e.length;t<s;++t)e[t].unbind()}}}v.defineProperty(xe.prototype,"index"),v.defineProperty(xe.prototype,"length");const Te=(e,t)=>`${e}.${t}`,Se={},Oe={index:0,node:null};function Be(e){e.startsWith("fast-")||l.warn(1204,{name:e})}const Ae=new Proxy(document.createElement("div"),{get(e,t){Be(t);const s=Reflect.get(e,t);return d(s)?s.bind(e):s},set:(e,t,s)=>(Be(t),Reflect.set(e,t,s))});class ke{constructor(e,t){this.fragment=e,this.directives=t,this.proto=null,this.nodeIds=new Set,this.descriptors={},this.factories=[]}addFactory(e,t,s,i){this.nodeIds.has(s)||(this.nodeIds.add(s),this.addTargetDescriptor(t,s,i)),e.nodeId=s,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=Se[t];if(!n){const i=`_${t}`;Se[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:Ae;for(const e of this.nodeIds)s[e];return new xe(t,this.factories,s)}}function je(e,t,s,i,n,r=!1){const o=s.attributes,l=e.directives;for(let a=0,h=o.length;a<h;++a){const c=o[a],d=c.value,u=te.parse(d,l);let f=null;null===u?r&&(f=new ge(ye((()=>d))),le.assign(f,c.name)):f=_e.aggregate(u),null!==f&&(s.removeAttributeNode(c),a--,h--,e.addFactory(f,t,i,n))}}function Ie(e,t,s){let i=0,n=t.firstChild;for(;n;){const t=$e(e,s,n,i);n=t.node,i=t.index}}function $e(e,t,s,i){const n=Te(t,i);switch(s.nodeType){case 1:je(e,t,s,n,i),Ie(e,s,n);break;case 3:return function(e,t,s,i,n){const r=te.parse(t.textContent,e.directives);if(null===r)return Oe.node=t.nextSibling,Oe.index=n+1,Oe;let o,l=o=t;for(let t=0,a=r.length;t<a;++t){const a=r[t];0!==t&&(n++,i=Te(s,n),o=l.parentNode.insertBefore(document.createTextNode(""),l.nextSibling)),u(a)?o.textContent=a:(o.textContent=" ",le.assign(a),e.addFactory(a,s,i,n)),l=o}return Oe.index=n+1,Oe.node=l.nextSibling,Oe}(e,s,t,n,i);case 8:const r=te.parse(s.data,e.directives);null!==r&&e.addFactory(_e.aggregate(r),t,n,i)}return Oe.index=i+1,Oe.node=s.nextSibling,Oe}const Ve={createHTML:e=>e};let Ee=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",Ve):Ve;const Ne=Ee,_e={setHTMLPolicy(e){if(Ee!==Ne)throw l.error(1201);Ee=e},compile(e,t){let s;if(u(e)){s=document.createElement("TEMPLATE"),s.innerHTML=Ee.createHTML(e);const t=s.content.firstElementChild;null!==t&&"TEMPLATE"===t.tagName&&(s=t)}else s=e;const i=document.adoptNode(s.content),n=new ke(i,t);return je(n,"",s,"h",0,!0),(function(e,t){return e&&8==e.nodeType&&null!==te.parse(e.data,t)}(i.firstChild,t)||1===i.childNodes.length&&Object.keys(t).length>0)&&i.insertBefore(document.createComment(""),i.firstChild),Ie(n,i,"r"),Oe.node=null,n.freeze()},setDefaultStrategy(e){this.compile=e},aggregate(e){if(1===e.length)return e[0];let t,s,i=!1;const n=e.length,r=e.map((e=>u(e)?()=>e:(t=e.sourceAspect||t,s=e.dataBinding||s,i=i||e.dataBinding.isVolatile,e.dataBinding.evaluate)));s.evaluate=(e,t)=>{let s="";for(let i=0;i<n;++i)s+=r[i](e,t);return s},s.isVolatile=i;const o=new ge(s);return le.assign(o,t),o}};class ze{constructor(e,t){this.result=null,this.html=e,this.factories=t}create(e){return null===this.result&&(this.result=_e.compile(this.html,this.factories)),this.result.createView(e)}render(e,t,s){const i=this.create(s);return i.bind(e),i.appendTo(t),i}}const Fe=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function Le(e,t,s){const i=Fe.exec(t);return null!==i&&le.assign(e,i[2]),e.createHTML(s)}function Me(e,...t){let s="";const i=Object.create(null),n=e=>{var t;const s=null!==(t=e.id)&&void 0!==t?t:e.id=Z();return i[s]=e,s};for(let i=0,r=e.length-1;i<r;++i){const r=e[i],o=t[i];let l;if(s+=r,d(o))s+=Le(new ge(ve(o)),r,n);else if(u(o)){const e=Fe.exec(r);if(null!==e){const t=new ge(ye((()=>o)));le.assign(t,e[2]),s+=t.createHTML(n)}else s+=o}else o instanceof oe?s+=Le(new ge(o),r,n):void 0===(l=ne.getForInstance(o))?s+=Le(new ge(ye((()=>o))),r,n):l.aspected?s+=Le(o,r,n):s+=o.createHTML(n)}return new ze(s+e[e.length-1],i)}class Pe extends ae{bind(e){e.source[this.options]=e.targets[this.nodeId]}}ne.define(Pe);const Re=e=>new Pe(e);function He(e,t){const s=d(e)?e:()=>e,i=d(t)?t:()=>t;return(e,t)=>s(e,t)?i(e,t):null}const De=Object.freeze({positioning:!1,recycle:!0});function Ue(e,t,s,i){e.context.parent=i.source,e.context.parentContext=i.context,e.bind(t[s])}function qe(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 Qe{constructor(e){this.directive=e,this.views=[],this.items=null,this.itemsObserver=null,this.bindView=Ue,this.itemsBindingObserver=e.dataBinding.createObserver(e,this),this.templateBindingObserver=e.templateBinding.createObserver(e,this),e.options.positioning&&(this.bindView=qe)}bind(e){this.location=e.targets[this.directive.nodeId],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=a);const t=this.itemsObserver,s=this.itemsObserver=v.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,h=0;for(let c=0,d=e.length;c<d;++c){const d=e[c],u=d.removed;let f=0,p=d.index;const b=p+d.addedCount,g=t.splice(d.index,u.length),v=h=l.length+g.length;for(;p<b;++p){const e=t[p],c=e?e.firstChild:this.location;let d;o&&h>0?(f<=v&&g.length>0?(d=g[f],f++):(d=l[a],a++),h--):d=n.create(),t.splice(p,0,d),s(d,i,p,r),d.insertBefore(c)}g[f]&&l.push(...g.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=e,i.index=s}}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||(xe.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 h=l.splice(e,a-e);for(e=0,o=h.length;e<o;++e)h[e].dispose()}}unbindAllViews(){const e=this.views;for(let t=0,s=e.length;t<s;++t)e[t].unbind()}}class We{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.options=s,this.id=Z(),E.enable()}createHTML(e){return ee.comment(e(this))}createBehavior(){return new Qe(this)}}function Ge(e,t,s=De){const i=we(e),n=we(t);return new We(i,n,Object.assign(Object.assign({},De),s))}ne.define(We);const Je=e=>1===e.nodeType,Ke=e=>e?t=>1===t.nodeType&&t.matches(e):Je;class Xe extends ae{constructor(){super(...arguments),this.sourceProperty=`${this.id}-s`}bind(e){const t=e.targets[this.nodeId];t[this.sourceProperty]=e.source,this.updateTarget(e.source,this.computeNodes(t)),this.observe(t),e.onUnbind(this)}unbind(e){const t=e.targets[this.nodeId];this.updateTarget(e.source,a),this.disconnect(t),t[this.sourceProperty]=null}getSource(e){return e[this.sourceProperty]}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 Ye extends Xe{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 Ze(e){return u(e)&&(e={property:e}),new Ye(e)}ne.define(Ye);class et extends Xe{constructor(e){super(e),this.observerProperty=`${this.id}-o`,this.handleEvent=(e,t)=>{const s=t.target;this.updateTarget(this.getSource(s),this.computeNodes(s))},e.childList=!0}observe(e){var t;const s=null!==(t=e[this.observerProperty])&&void 0!==t?t:e[this.observerProperty]=new MutationObserver(this.handleEvent);s.target=e,s.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 tt(e){return u(e)&&(e={property:e}),new et(e)}ne.define(et);const st=Object.freeze({locate:c()}),it={toView:e=>e?"true":"false",fromView:e=>null!=e&&"false"!==e&&!1!==e&&0!==e};function nt(e){if(null==e)return null;const t=1*e;return isNaN(t)?null:t}const rt={toView(e){const t=nt(e);return t?t.toString():t},fromView:nt};class ot{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=it)}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 v.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||f.enqueue((()=>{s.add(e);const i=e[this.fieldName];switch(t){case"reflect":const t=this.converter;W.setAttribute(e,this.attribute,void 0!==t?t.toView(i):i);break;case"boolean":W.setBooleanAttribute(e,this.attribute,i)}s.delete(e)}))}static collect(e,...t){const s=[];t.push(st.locate(e));for(let i=0,n=t.length;i<n;++i){const n=t[i];if(void 0!==n)for(let t=0,i=n.length;t<i;++t){const i=n[t];u(i)?s.push(new ot(e,i)):s.push(new ot(e,i.property,i.attribute,i.mode,i.converter))}}return s}}function lt(e,t){let s;function i(e,t){arguments.length>1&&(s.property=t),st.locate(e.constructor).push(s)}return arguments.length>1?(s={},void i(e,t)):(s=void 0===e?{}:e,i)}const at={mode:"open"},ht={},ct=l.getById(4,(()=>h()));class dt{constructor(e,t=e.definition){var s;this.platformDefined=!1,u(t)&&(t={name:t}),this.type=e,this.name=t.name,this.template=t.template,this.registry=null!==(s=t.registry)&&void 0!==s?s:customElements;const i=e.prototype,n=ot.collect(e,t.attributes),r=new Array(n.length),o={},l={};for(let e=0,t=n.length;e<t;++e){const t=n[e];r[e]=t.attribute,o[t.name]=t,l[t.attribute]=t,v.defineProperty(i,t)}Reflect.defineProperty(e,"observedAttributes",{value:r,enumerable:!0}),this.attributes=n,this.propertyLookup=o,this.attributeLookup=l,this.shadowOptions=void 0===t.shadowOptions?at:null===t.shadowOptions?void 0:Object.assign(Object.assign({},at),t.shadowOptions),this.elementOptions=void 0===t.elementOptions?ht:Object.assign(Object.assign({},ht),t.elementOptions),this.styles=L.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){const s=ct.getByType(e);return new dt(s?class extends e{}:e,t)}}dt.getByType=ct.getByType,dt.getForInstance=ct.getForInstance;const ut={bubbles:!0,composed:!0,cancelable:!0},ft=new WeakMap;function pt(e){var t,s;return null!==(s=null!==(t=e.shadowRoot)&&void 0!==t?t:ft.get(e))&&void 0!==s?s:null}class bt extends b{constructor(e,t){super(e),this.boundObservables=null,this.needsInitialization=!0,this.hasExistingShadowRoot=!1,this._template=null,this._isConnected=!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&&ft.set(e,t))}const i=v.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 v.track(this,"isConnected"),this._isConnected}setIsConnected(e){this._isConnected=e,v.notify(this,"isConnected")}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))}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.isConnected&&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&&this.isConnected&&e.disconnectedCallback(this),e.removedCallback&&e.removedCallback(this)):s.set(e,i-1))}addStyles(e){var t;if(!e)return;const s=this.source,i=null!==(t=pt(s))&&void 0!==t?t:s.getRootNode();if(e instanceof HTMLElement)i.append(e);else if(!e.isAttachedTo(i)){const t=e.behaviors;if(e.addStylesTo(i),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,i=null!==(t=pt(s))&&void 0!==t?t:s.getRootNode();if(e instanceof HTMLElement)i.removeChild(e);else if(e.isAttachedTo(i)){const t=e.behaviors;if(e.removeStylesFrom(i),null!==t)for(let e=0,s=t.length;e<s;++e)this.addBehavior(t[e])}}connect(){if(this._isConnected)return;this.needsInitialization?this.finishInitialization():null!==this.view&&this.view.bind(this.source);const e=this.behaviors;if(null!==e)for(const t of e.keys())t.connectedCallback&&t.connectedCallback(this);this.setIsConnected(!0)}disconnect(){if(!this._isConnected)return;this.setIsConnected(!1),null!==this.view&&this.view.unbind();const e=this.behaviors;if(null!==e)for(const t of e.keys())t.disconnectedCallback&&t.disconnectedCallback(this)}onAttributeChangedCallback(e,t,s){const i=this.definition.attributeLookup[e];void 0!==i&&i.onAttributeChangedCallback(this.source,s)}emit(e,t,s){return!!this._isConnected&&this.source.dispatchEvent(new CustomEvent(e,Object.assign(Object.assign({detail:t},ut),s)))}finishInitialization(){const e=this.source,t=this.boundObservables;if(null!==t){const 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}this.renderTemplate(this.template),this.addStyles(this.mainStyles),this.needsInitialization=!1}renderTemplate(e){var t;const s=this.source,i=null!==(t=pt(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=g.coupled)}static forCustomElement(e){const t=e.$fastController;if(void 0!==t)return t;const s=dt.getForInstance(e);if(void 0===s)throw l.error(1401);return e.$fastController=new bt(e,s)}}function gt(e){return 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)}}}function vt(e,t){return d(e)?dt.compose(e,t).define().type:dt.compose(this,e).define().type}const yt=Object.assign(gt(HTMLElement),{from:function(e){return gt(e)},define:vt,compose:function(e,t){return d(e)?dt.compose(e,t):dt.compose(this,e)}});function mt(e){return function(t){vt(t,e)}}export{M as AdoptedStyleSheetsStrategy,E as ArrayObserver,le as Aspect,st as AttributeConfiguration,ot as AttributeDefinition,oe as Binding,R as CSSDirective,et as ChildrenDirective,_e as Compiler,W as DOM,bt as ElementController,L as ElementStyles,C as ExecutionContext,l as FAST,yt as FASTElement,dt as FASTElementDefinition,ge as HTMLBindingDirective,ne as HTMLDirective,xe as HTMLView,ee as Markup,Xe as NodeObservationDirective,v as Observable,te as Parser,b as PropertyChangeNotifier,Pe as RefDirective,Qe as RepeatBehavior,We as RepeatDirective,Ye as SlottedDirective,g as SourceLifetime,x as Splice,j as SpliceStrategy,T as SpliceStrategySupport,ae as StatelessAttachedAttributeDirective,p as SubscriberSet,f as Updates,se as ViewBehaviorOrchestrator,ze as ViewTemplate,lt as attr,ve as bind,it as booleanConverter,tt as children,c as createMetadataLocator,h as createTypeRegistry,U as css,H as cssDirective,Q as cssPartial,mt as customElement,Ke as elements,a as emptyArray,Me as html,re as htmlDirective,N as lengthOf,me as listener,we as normalizeBinding,rt as nullableNumberConverter,y as observable,ye as oneTime,Re as ref,Ge as repeat,Ze as slotted,m as volatile,He as when}; |
{ | ||
"name": "@microsoft/fast-element", | ||
"description": "A library for constructing Web Components", | ||
"version": "2.0.0-beta.7", | ||
"version": "2.0.0-beta.8", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Microsoft", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1799459
44468