@microsoft/fast-element 2.9.2 → 2.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +43 -0
- package/CHANGELOG.md +14 -1
- package/dist/dts/binding/one-way.d.ts +1 -1
- package/dist/dts/binding/two-way.d.ts +2 -2
- package/dist/dts/components/attributes.d.ts +1 -1
- package/dist/dts/components/element-controller.d.ts +19 -8
- package/dist/dts/components/fast-definitions.d.ts +4 -4
- package/dist/dts/components/fast-element.d.ts +2 -2
- package/dist/dts/context.d.ts +1 -1
- package/dist/dts/di/di.d.ts +2 -2
- package/dist/dts/dom-policy.d.ts +3 -3
- package/dist/dts/index.d.ts +41 -28
- package/dist/dts/observable.d.ts +4 -2
- package/dist/dts/observation/arrays.d.ts +1 -1
- package/dist/dts/observation/observable.d.ts +1 -1
- package/dist/dts/observation/update-queue.d.ts +1 -1
- package/dist/dts/platform.d.ts +1 -1
- package/dist/dts/state/state.d.ts +1 -1
- package/dist/dts/state/watch.d.ts +1 -1
- package/dist/dts/styles/css-binding-directive.d.ts +1 -1
- package/dist/dts/styles/css.d.ts +2 -2
- package/dist/dts/templating/children.d.ts +1 -1
- package/dist/dts/templating/compiler.d.ts +2 -2
- package/dist/dts/templating/html-binding-directive.d.ts +3 -3
- package/dist/dts/templating/html-directive.d.ts +2 -2
- package/dist/dts/templating/node-observation.d.ts +1 -1
- package/dist/dts/templating/ref.d.ts +1 -1
- package/dist/dts/templating/render.d.ts +4 -4
- package/dist/dts/templating/repeat.d.ts +4 -4
- package/dist/dts/templating/slotted.d.ts +1 -1
- package/dist/dts/templating/template.d.ts +2 -2
- package/dist/dts/templating/view.d.ts +2 -2
- package/dist/esm/binding/one-way.js +1 -1
- package/dist/esm/binding/two-way.js +3 -3
- package/dist/esm/components/element-controller.js +69 -23
- package/dist/esm/components/fast-definitions.js +1 -1
- package/dist/esm/context.js +2 -2
- package/dist/esm/di/di.js +61 -51
- package/dist/esm/dom-policy.js +2 -2
- package/dist/esm/dom.js +2 -2
- package/dist/esm/index.js +21 -22
- package/dist/esm/interfaces.js +38 -0
- package/dist/esm/observable.js +1 -1
- package/dist/esm/observation/arrays.js +17 -10
- package/dist/esm/observation/observable.js +3 -3
- package/dist/esm/styles/css.js +2 -2
- package/dist/esm/templating/children.js +1 -1
- package/dist/esm/templating/compiler.js +5 -5
- package/dist/esm/templating/html-binding-directive.js +2 -2
- package/dist/esm/templating/node-observation.js +1 -1
- package/dist/esm/templating/render.js +4 -4
- package/dist/esm/templating/repeat.js +4 -4
- package/dist/esm/templating/slotted.js +1 -1
- package/dist/esm/templating/template.js +7 -7
- package/dist/fast-element.api.json +70 -11
- package/dist/fast-element.debug.js +2506 -2415
- package/dist/fast-element.debug.min.js +2 -2
- package/dist/fast-element.js +2506 -2415
- package/dist/fast-element.min.js +2 -2
- package/dist/fast-element.untrimmed.d.ts +17 -6
- package/docs/api-report.api.md +5 -4
- package/package.json +4 -3
- package/playwright.config.ts +18 -0
- package/test/index.html +11 -0
- package/test/main.ts +10 -0
- package/test/vite.config.ts +19 -0
- package/dist/dts/observation/observable.bench.d.ts +0 -18
- package/dist/dts/templating/render.bench.d.ts +0 -3
- package/dist/dts/templating/repeat-basic-reverse.bench.d.ts +0 -3
- package/dist/dts/templating/repeat-basic-shift.bench.d.ts +0 -3
- package/dist/dts/templating/when-basic.bench.d.ts +0 -3
- package/dist/dts/templating/when-conditional.bench.d.ts +0 -3
- package/dist/dts/templating/when-switch.bench.d.ts +0 -3
- package/dist/esm/observation/observable.bench.js +0 -79
- package/dist/esm/templating/render.bench.js +0 -56
- package/dist/esm/templating/repeat-basic-reverse.bench.js +0 -43
- package/dist/esm/templating/repeat-basic-shift.bench.js +0 -43
- package/dist/esm/templating/when-basic.bench.js +0 -36
- package/dist/esm/templating/when-conditional.bench.js +0 -39
- package/dist/esm/templating/when-switch.bench.js +0 -68
- package/scripts/run-benchmarks.js +0 -46
- package/tensile.config.js +0 -12
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",{value:Object.create(null),configurable:!1,enumerable:!1,writable:!1});const e=globalThis.FAST,t={1101:"Must call ArrayObserver.enable() before observing arrays.",1201:"The DOM Policy can only be set once.",1202:"To bind innerHTML, you must use a TrustedTypesPolicy.",1203:"View=>Model update skipped. To use twoWay binding, the target property must be observable.",1204:"No host element is present. Cannot bind host with ${name}.",1205:"The requested binding behavior is not supported by the binding engine.",1206:"Calling html`` as a normal function invalidates the security guarantees provided by FAST.",1207:"The DOM Policy for an HTML template can only be set once.",1208:"The DOM Policy cannot be set after a template is compiled.",1209:"'${aspectName}' on '${tagName}' is blocked by the current DOMPolicy.",1401:"Missing FASTElement definition.",1501:"No registration for Context/Interface '${name}'.",1502:"Dependency injection resolver for '${key}' returned a null factory.",1503:"Invalid dependency injection resolver strategy specified '${strategy}'.",1504:"Unable to autoregister dependency.",1505:"Unable to resolve dependency injection key '${key}'.",1506:"'${name}' is a native function and therefore cannot be safely constructed by DI. If this is intentional, please use a callback or cachedCallback resolver.",1507:"Attempted to jitRegister something that is not a constructor '${value}'. Did you forget to register this dependency?",1508:"Attempted to jitRegister an intrinsic type '${value}'. Did you forget to add @inject(Key)?",1509:"Attempted to jitRegister an interface '${value}'.",1510:"A valid resolver was not returned from the register method.",1511:"Key/value cannot be null or undefined. Are you trying to inject/register something that doesn't exist with DI?",1512:"'${key}' not registered. Did you forget to add @singleton()?",1513:"Cyclic dependency found '${name}'.",1514:"Injected properties that are updated on changes to DOM connectivity require the target object to be an instance of FASTElement.",1601:"Invalid attribute marker name: ${name}. Expected format is ${expectedFormat}.",1602:"Invalid compact attribute marker values in ${markerName}. Both index and count must be positive integers.",1604:"Invalid compact attribute marker name: ${name}. Expected format is ${expectedFormat}."},s=/(\$\{\w+?})/g,i=/\$\{(\w+?)}/g,n=Object.freeze({});function r(e,t){return e.split(s).map((e=>{var s;const n=e.replace(i,"$1");return String(null!==(s=t[n])&&void 0!==s?s:e)})).join("")}let o;Object.assign(e,{addMessages(e){Object.assign(t,e)},warn(e,s=n){var i;const o=null!==(i=t[e])&&void 0!==i?i:"Unknown Warning";console.warn(r(o,s))},error(e,s=n){var i;const o=null!==(i=t[e])&&void 0!==i?i:"Unknown Error";return new Error(r(o,s))}});const a="fast-kernel";try{if(document.currentScript)o=document.currentScript.getAttribute(a);else{const e=document.getElementsByTagName("script");o=e[e.length-1].getAttribute(a)}}catch(e){o="isolate"}let l;switch(o){case"share":l=Object.freeze({updateQueue:1,observable:2,contextEvent:3,elementRegistry:4});break;case"share-v2":l=Object.freeze({updateQueue:1.2,observable:2.2,contextEvent:3.2,elementRegistry:4.2});break;default:const e=`-${Math.random().toString(36).substring(2,8)}`;l=Object.freeze({updateQueue:`1.2${e}`,observable:`2.2${e}`,contextEvent:`3.2${e}`,elementRegistry:`4.2${e}`})}const c=e=>"function"==typeof e,d=e=>"string"==typeof e,h=()=>{};!function(){if("undefined"==typeof globalThis)if("undefined"!=typeof global)global.globalThis=global;else if("undefined"!=typeof self)self.globalThis=self;else if("undefined"!=typeof window)window.globalThis=window;else{const e=new Function("return this")();e.globalThis=e}}(),"requestIdleCallback"in globalThis||(globalThis.requestIdleCallback=function(e,t){const s=Date.now();return setTimeout((()=>{e({didTimeout:!!(null==t?void 0:t.timeout)&&Date.now()-s>=t.timeout,timeRemaining:()=>0})}),1)},globalThis.cancelIdleCallback=function(e){clearTimeout(e)});const u={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},u));const f=globalThis.FAST;if(void 0===f.getById){const e=Object.create(null);Reflect.defineProperty(f,"getById",Object.assign({value(t,s){let i=e[t];return void 0===i&&(i=s?e[t]=s():null),i}},u))}void 0===f.error&&Object.assign(f,{warn(){},error:e=>new Error(`Error ${e}`),addMessages(){}});const p=Object.freeze([]);function g(){const e=new Map;return Object.freeze({register:t=>!e.has(t.type)&&(e.set(t.type,t),!0),getByType:t=>e.get(t),getForInstance(t){if(null!=t)return e.get(t.constructor)}})}function b(){const e=new WeakMap;return function(t){let s=e.get(t);if(void 0===s){let i=Reflect.getPrototypeOf(t);for(;void 0===s&&null!==i;)s=e.get(i),i=Reflect.getPrototypeOf(i);s=void 0===s?[]:s.slice(0),e.set(t,s)}return s}}function v(e){e.prototype.toJSON=h}const m=Object.freeze({none:0,attribute:1,booleanAttribute:2,property:3,content:4,tokenList:5,event:6}),y=e=>e,w=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:y}):{createHTML:y};let C=Object.freeze({createHTML:e=>w.createHTML(e),protect:(e,t,s,i)=>i});const S=C,T=Object.freeze({get policy(){return C},setPolicy(e){if(C!==S)throw f.error(1201);C=e},setAttribute(e,t,s){null==s?e.removeAttribute(t):e.setAttribute(t,s)},setBooleanAttribute(e,t,s){s?e.setAttribute(t,""):e.removeAttribute(t)}});function $(e,t,s,i){return(e,t,s,...n)=>{d(s)&&(s=s.replace(/(javascript:|vbscript:|data:)/,"")),i(e,t,s,...n)}}function x(e,t,s,i){throw f.error(1209,{aspectName:s,tagName:null!=e?e:"text"})}const O={onabort:x,onauxclick:x,onbeforeinput:x,onbeforematch:x,onblur:x,oncancel:x,oncanplay:x,oncanplaythrough:x,onchange:x,onclick:x,onclose:x,oncontextlost:x,oncontextmenu:x,oncontextrestored:x,oncopy:x,oncuechange:x,oncut:x,ondblclick:x,ondrag:x,ondragend:x,ondragenter:x,ondragleave:x,ondragover:x,ondragstart:x,ondrop:x,ondurationchange:x,onemptied:x,onended:x,onerror:x,onfocus:x,onformdata:x,oninput:x,oninvalid:x,onkeydown:x,onkeypress:x,onkeyup:x,onload:x,onloadeddata:x,onloadedmetadata:x,onloadstart:x,onmousedown:x,onmouseenter:x,onmouseleave:x,onmousemove:x,onmouseout:x,onmouseover:x,onmouseup:x,onpaste:x,onpause:x,onplay:x,onplaying:x,onprogress:x,onratechange:x,onreset:x,onresize:x,onscroll:x,onsecuritypolicyviolation:x,onseeked:x,onseeking:x,onselect:x,onslotchange:x,onstalled:x,onsubmit:x,onsuspend:x,ontimeupdate:x,ontoggle:x,onvolumechange:x,onwaiting:x,onwebkitanimationend:x,onwebkitanimationiteration:x,onwebkitanimationstart:x,onwebkittransitionend:x,onwheel:x},B={elements:{a:{[m.attribute]:{href:$},[m.property]:{href:$}},area:{[m.attribute]:{href:$},[m.property]:{href:$}},button:{[m.attribute]:{formaction:$},[m.property]:{formAction:$}},embed:{[m.attribute]:{src:x},[m.property]:{src:x}},form:{[m.attribute]:{action:$},[m.property]:{action:$}},frame:{[m.attribute]:{src:$},[m.property]:{src:$}},iframe:{[m.attribute]:{src:$},[m.property]:{src:$,srcdoc:x}},input:{[m.attribute]:{formaction:$},[m.property]:{formAction:$}},link:{[m.attribute]:{href:x},[m.property]:{href:x}},object:{[m.attribute]:{codebase:x,data:x},[m.property]:{codeBase:x,data:x}},script:{[m.attribute]:{src:x,text:x},[m.property]:{src:x,text:x,innerText:x,textContent:x}},style:{[m.property]:{innerText:x,textContent:x}}},aspects:{[m.attribute]:Object.assign({},O),[m.property]:Object.assign({innerHTML:x},O),[m.event]:Object.assign({},O)}};function N(e,t){const s={};for(const i in t){const n=e[i],r=t[i];switch(n){case null:break;case void 0:s[i]=r;break;default:s[i]=n}}for(const t in e)t in s||(s[t]=e[t]);return Object.freeze(s)}function k(e,t){const s={};for(const i in t){const n=e[i],r=t[i];switch(n){case null:break;case void 0:s[i]=N(r,{});break;default:s[i]=N(n,r)}}for(const t in e)t in s||(s[t]=N(e[t],{}));return Object.freeze(s)}function A(e,t){const s={};for(const i in t){const n=e[i],r=t[i];switch(n){case null:break;case void 0:s[i]=k(n,{});break;default:s[i]=k(n,r)}}for(const t in e)t in s||(s[t]=k(e[t],{}));return Object.freeze(s)}function E(e,t,s,i,n){const r=e[s];if(r){const e=r[i];if(e)return e(t,s,i,n)}}const M=Object.freeze({create(e={}){var t,s;const i=null!==(t=e.trustedType)&&void 0!==t?t:function(){const e=e=>e;return globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:e}):{createHTML:e}}(),n=(r=null!==(s=e.guards)&&void 0!==s?s:{},o=B,Object.freeze({elements:r.elements?A(r.elements,o.elements):o.elements,aspects:r.aspects?k(r.aspects,o.aspects):o.aspects}));var r,o;return Object.freeze({createHTML:e=>i.createHTML(e),protect(e,t,s,i){var r;const o=(null!=e?e:"").toLowerCase(),a=n.elements[o];if(a){const n=E(a,e,t,s,i);if(n)return n}return null!==(r=E(n.aspects,e,t,s,i))&&void 0!==r?r:i}})}}),I=f.getById(l.updateQueue,(()=>{const e=[],t=[],s=globalThis.requestAnimationFrame;let i=!0;function n(){if(t.length)throw t.shift()}function r(s){try{s.call()}catch(s){if(!i)throw e.length=0,s;t.push(s),setTimeout(n,0)}}function o(){let t=0;for(;t<e.length;)if(r(e[t]),t++,t>1024){for(let s=0,i=e.length-t;s<i;s++)e[s]=e[s+t];e.length-=t,t=0}e.length=0}function a(t){e.push(t),e.length<2&&(i?s(o):o())}return Object.freeze({enqueue:a,next:()=>new Promise(a),process:o,setMode:e=>i=e})}));class j{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 R{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 j(this.subject):null!==(i=this.subjectSubscribers)&&void 0!==i?i:this.subjectSubscribers=new j(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 V=Object.freeze({unknown:void 0,coupled:1}),_=f.getById(l.observable,(()=>{const e=I.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 R(e))),i}const o=b();class a{constructor(e){this.name=e,this.field=`_${e}`,this.callback=`${e}Changed`}getValue(e){return void 0!==i&&i.watch(e,this.name),e[this.field]}setValue(e,t){const s=this.field,i=e[s];if(i!==t){e[s]=t;const n=e[this.callback];c(n)&&n.call(e,i,t),r(e).notify(this.name)}}}class l extends j{constructor(e,t,s=!1){super(e,t),this.expression=e,this.isVolatileBinding=s,this.needsRefresh=!0,this.needsQueue=!0,this.isAsync=!0,this.first=this,this.last=null,this.propertySource=void 0,this.propertyName=void 0,this.notifier=void 0,this.next=void 0}setMode(e){this.isAsync=this.needsQueue=e}bind(e){this.controller=e;const t=this.observe(e.source,e.context);return!e.isBound&&this.requiresUnbind(e)&&e.onUnbind(this),t}requiresUnbind(e){return e.sourceLifetime!==V.coupled||this.first!==this.last||this.first.propertySource!==e.source}unbind(e){this.dispose()}observe(e,t){this.needsRefresh&&null!==this.last&&this.dispose();const s=i;let n;i=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;try{n=this.expression(e,t)}finally{i=s}return n}disconnect(){this.dispose()}dispose(){if(null!==this.last){let e=this.first;for(;void 0!==e;)e.notifier.unsubscribe(this,e.propertyName),e=e.next;this.last=null,this.needsRefresh=this.needsQueue=this.isAsync}}watch(e,t){const s=this.last,n=r(e),o=null===s?this.first:{};if(o.propertySource=e,o.propertyName=t,o.notifier=n,n.subscribe(this,t),null!==s){if(!this.needsRefresh){let t;i=void 0,t=s.propertySource[s.propertyName],i=this,e===t&&(this.needsRefresh=!0)}s.next=o}this.last=o}handleChange(){this.needsQueue?(this.needsQueue=!1,e(this)):this.isAsync||this.call()}call(){null!==this.last&&(this.needsQueue=this.isAsync,this.notify(this))}*records(){let e=this.first;for(;void 0!==e;)yield e,e=e.next}}return v(l),Object.freeze({setArrayObserverFactory(e){n=e},getNotifier:r,track(e,t){i&&i.watch(e,t)},trackVolatile(){i&&(i.needsRefresh=!0)},notify(e,t){r(e).notify(t)},defineProperty(e,t){d(t)&&(t=new a(t)),o(e).push(t),Reflect.defineProperty(e,t.name,{enumerable:!0,get(){return t.getValue(this)},set(e){t.setValue(this,e)}})},getAccessors:o,binding(e,t,s=this.isVolatileBinding(e)){return new l(e,t,s)},isVolatileBinding:e=>t.test(e.toString())})}));function z(e,t){_.defineProperty(e,t)}function L(e,t,s){return Object.assign({},s,{get(){return _.trackVolatile(),s.get.apply(this)}})}const F=f.getById(l.contextEvent,(()=>{let e=null;return{get:()=>e,set(t){e=t}}})),H=Object.freeze({default:{index:0,length:0,get event(){return H.getEvent()},eventDetail(){return this.event.detail},eventTarget(){return this.event.target}},getEvent:()=>F.get(),setEvent(e){F.set(e)}});class D{constructor(e,t,s){this.index=e,this.removed=t,this.addedCount=s}adjustTo(e){let t=this.index;const s=e.length;return t>s?t=s-this.addedCount:t<0&&(t=s+this.removed.length+t-this.addedCount),this.index=t<0?0:t,this}}class P{constructor(e){this.sorted=e}}const U=Object.freeze({reset:1,splice:2,optimized:3}),q=new D(0,p,0);q.reset=!0;const Q=[q];function W(e,t,s,i,n,r){let o=0,a=0;const l=Math.min(s-t,r-n);if(0===t&&0===n&&(o=function(e,t,s){for(let i=0;i<s;++i)if(e[i]!==t[i])return i;return s}(e,i,l)),s===e.length&&r===i.length&&(a=function(e,t,s){let i=e.length,n=t.length,r=0;for(;r<s&&e[--i]===t[--n];)r++;return r}(e,i,l-o)),n+=o,r-=a,(s-=a)-(t+=o)==0&&r-n==0)return p;if(t===s){const e=new D(t,[],0);for(;n<r;)e.removed.push(i[n++]);return[e]}if(n===r)return[new D(t,[],s-t)];const c=function(e){let t=e.length-1,s=e[0].length-1,i=e[t][s];const n=[];for(;t>0||s>0;){if(0===t){n.push(2),s--;continue}if(0===s){n.push(3),t--;continue}const r=e[t-1][s-1],o=e[t-1][s],a=e[t][s-1];let l;l=o<a?o<r?o:r:a<r?a:r,l===r?(r===i?n.push(0):(n.push(1),i=r),t--,s--):l===o?(n.push(3),t--,i=o):(n.push(2),s--,i=a)}return n.reverse()}(function(e,t,s,i,n,r){const o=r-n+1,a=s-t+1,l=new Array(o);let c,d;for(let e=0;e<o;++e)l[e]=new Array(a),l[e][0]=e;for(let e=0;e<a;++e)l[0][e]=e;for(let s=1;s<o;++s)for(let r=1;r<a;++r)e[t+r-1]===i[n+s-1]?l[s][r]=l[s-1][r-1]:(c=l[s-1][r]+1,d=l[s][r-1]+1,l[s][r]=c<d?c:d);return l}(e,t,s,i,n,r)),d=[];let h,u=t,f=n;for(let e=0;e<c.length;++e)switch(c[e]){case 0:void 0!==h&&(d.push(h),h=void 0),u++,f++;break;case 1:void 0===h&&(h=new D(u,[],0)),h.addedCount++,u++,h.removed.push(i[f]),f++;break;case 2:void 0===h&&(h=new D(u,[],0)),h.addedCount++,u++;break;case 3:void 0===h&&(h=new D(u,[],0)),h.removed.push(i[f]),f++}return void 0!==h&&d.push(h),d}function X(e,t){let s=!1,i=0;for(let l=0;l<t.length;l++){const c=t[l];if(c.index+=i,s)continue;const d=(n=e.index,r=e.index+e.removed.length,o=c.index,a=c.index+c.addedCount,r<o||a<n?-1:r===o||a===n?0:n<o?r<a?r-o:a-o:a<r?a-n:r-n);if(d>=0){t.splice(l,1),l--,i-=c.addedCount-c.removed.length,e.addedCount+=c.addedCount-d;const n=e.removed.length+c.removed.length-d;if(e.addedCount||n){let t=c.removed;if(e.index<c.index){const s=e.removed.slice(0,c.index-e.index);s.push(...t),t=s}if(e.index+e.removed.length>c.index+c.addedCount){const s=e.removed.slice(c.index+c.addedCount-e.index);t.push(...s)}e.removed=t,c.index<e.index&&(e.index=c.index)}else s=!0}else if(e.index<c.index){s=!0,t.splice(l,0,e),l++;const n=e.addedCount-e.removed.length;c.index+=n,i+=n}}var n,r,o,a;s||t.push(e)}let J=Object.freeze({support:U.optimized,normalize:(e,t,s)=>void 0===e?void 0===s?p:function(e,t){let s=[];const i=[];for(let e=0,s=t.length;e<s;e++)X(t[e],i);for(let t=0,n=i.length;t<n;++t){const n=i[t];1!==n.addedCount||1!==n.removed.length?s=s.concat(W(e,n.index,n.index+n.addedCount,n.removed,0,n.removed.length)):n.removed[0]!==e[n.index]&&s.push(n)}return s}(t,s):Q,pop(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new D(e.length,[r],0)),r},push(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new D(e.length-i.length,[],i.length).adjustTo(e)),n},reverse(e,t,s,i){const n=s.apply(e,i);e.sorted++;const r=[];for(let t=e.length-1;t>=0;t--)r.push(t);return t.addSort(new P(r)),n},shift(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new D(0,[r],0)),r},sort(e,t,s,i){const n=new Map;for(let t=0,s=e.length;t<s;++t){const s=n.get(e[t])||[];n.set(e[t],[...s,t])}const r=s.apply(e,i);e.sorted++;const o=[];for(let t=0,s=e.length;t<s;++t){const s=n.get(e[t]);o.push(s[0]),n.set(e[t],s.splice(1))}return t.addSort(new P(o)),r},splice(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new D(+i[0],n,i.length>2?i.length-2:0).adjustTo(e)),n},unshift(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new D(0,[],i.length).adjustTo(e)),n}});const K=Object.freeze({reset:Q,setDefaultStrategy(e){J=e}});function G(e,t,s,i=!0){Reflect.defineProperty(e,t,{value:s,enumerable:!1,writable:i})}class Y extends j{get strategy(){return this._strategy}set strategy(e){this._strategy=e}get lengthObserver(){let e=this._lengthObserver;if(void 0===e){const t=this.subject;this._lengthObserver=e={length:t.length,handleChange(){this.length!==t.length&&(this.length=t.length,_.notify(e,"length"))}},this.subscribe(e)}return e}get sortObserver(){let e=this._sortObserver;if(void 0===e){const t=this.subject;this._sortObserver=e={sorted:t.sorted,handleChange(){this.sorted!==t.sorted&&(this.sorted=t.sorted,_.notify(e,"sorted"))}},this.subscribe(e)}return e}constructor(e){super(e),this.oldCollection=void 0,this.splices=void 0,this.sorts=void 0,this.needsQueue=!0,this._strategy=null,this._lengthObserver=void 0,this._sortObserver=void 0,this.call=this.flush,G(e,"$fastController",this)}subscribe(e){this.flush(),super.subscribe(e)}addSplice(e){void 0===this.splices?this.splices=[e]:this.splices.push(e),this.enqueue()}addSort(e){void 0===this.sorts?this.sorts=[e]:this.sorts.push(e),this.enqueue()}reset(e){this.oldCollection=e,this.enqueue()}flush(){var e;const t=this.splices,s=this.sorts,i=this.oldCollection;void 0===t&&void 0===i&&void 0===s||(this.needsQueue=!0,this.splices=void 0,this.sorts=void 0,this.oldCollection=void 0,void 0!==s?this.notify(s):this.notify((null!==(e=this._strategy)&&void 0!==e?e:J).normalize(i,this.subject,t)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,I.enqueue(this))}}let Z=!1;const ee=Object.freeze({sorted:0,enable(){if(Z)return;Z=!0,_.setArrayObserverFactory((e=>new Y(e)));const e=Array.prototype;e.$fastPatch||(G(e,"$fastPatch",1),G(e,"sorted",0),[e.pop,e.push,e.reverse,e.shift,e.sort,e.splice,e.unshift].forEach((t=>{e[t.name]=function(...e){var s;const i=this.$fastController;return void 0===i?t.apply(this,e):(null!==(s=i.strategy)&&void 0!==s?s:J)[t.name](this,i,t,e)}})))}});function te(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(ee.enable(),t=_.getNotifier(e)),_.track(t.lengthObserver,"length"),e.length}function se(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(ee.enable(),t=_.getNotifier(e)),_.track(t.sortObserver,"sorted"),e.sorted}class ie{constructor(e,t,s=!1){this.evaluate=e,this.policy=t,this.isVolatile=s}}class ne extends ie{createObserver(e){return _.binding(this.evaluate,e,this.isVolatile)}}function re(e,t,s=_.isVolatileBinding(e)){return new ne(e,t,s)}function oe(e,t){const s=new ne(e);return s.options=t,s}class ae extends ie{createObserver(){return this}bind(e){return this.evaluate(e.source,e.context)}}function le(e,t){return new ae(e,t)}function ce(e){return c(e)?re(e):e instanceof ie?e:le((()=>e))}let de;function he(e){return e.map((e=>e instanceof ue?he(e.styles):[e])).reduce(((e,t)=>e.concat(t)),[])}v(ae);class ue{get strategy(){return null===this._strategy&&this.withStrategy(de),this._strategy}constructor(e){this.styles=e,this.targets=new WeakSet,this._strategy=null,this.behaviors=e.map((e=>e instanceof ue?e.behaviors:null)).reduce(((e,t)=>null===t?e:null===e?t:e.concat(t)),null)}addStylesTo(e){this.strategy.addStylesTo(e),this.targets.add(e)}removeStylesFrom(e){this.strategy.removeStylesFrom(e),this.targets.delete(e)}isAttachedTo(e){return this.targets.has(e)}withBehaviors(...e){return this.behaviors=null===this.behaviors?e:this.behaviors.concat(e),this}withStrategy(e){return this._strategy=new e(he(this.styles)),this}static setDefaultStrategy(e){de=e}static normalize(e){return void 0===e?void 0:Array.isArray(e)?new ue(e):e instanceof ue?e:new ue([e])}}ue.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;const fe=g(),pe=Object.freeze({getForInstance:fe.getForInstance,getByType:fe.getByType,define:e=>(fe.register({type:e}),e)});function ge(){return function(e){pe.define(e)}}function be(e,t,s){t.source.style.setProperty(e.targetAspect,s.bind(t))}class ve{constructor(e,t){this.dataBinding=e,this.targetAspect=t}createCSS(e){return e(this),`var(${this.targetAspect})`}addedCallback(e){var t;const s=e.source;if(!s.$cssBindings){s.$cssBindings=new Map;const e=s.setAttribute;s.setAttribute=(t,i)=>{e.call(s,t,i),"style"===t&&s.$cssBindings.forEach(((e,t)=>be(t,e.controller,e.observer)))}}const i=null!==(t=e[this.targetAspect])&&void 0!==t?t:e[this.targetAspect]=this.dataBinding.createObserver(this,this);i.controller=e,e.source.$cssBindings.set(this,{controller:e,observer:i})}connectedCallback(e){be(this,e,e[this.targetAspect])}removedCallback(e){e.source.$cssBindings&&e.source.$cssBindings.delete(this)}handleChange(e,t){be(this,t.controller,t)}}pe.define(ve);const me=`${Math.random().toString(36).substring(2,8)}`;let ye=0;const we=()=>`--v${me}${++ye}`;function Ce(e,t){const s=[];let i="";const n=[],r=e=>{n.push(e)};for(let n=0,o=e.length-1;n<o;++n){i+=e[n];let o=t[n];c(o)?o=new ve(re(o),we()).createCSS(r):o instanceof ie?o=new ve(o,we()).createCSS(r):void 0!==pe.getForInstance(o)&&(o=o.createCSS(r)),o instanceof ue||o instanceof CSSStyleSheet?(""!==i.trim()&&(s.push(i),i=""),s.push(o)):i+=o}return i+=e[e.length-1],""!==i.trim()&&s.push(i),{styles:s,behaviors:n}}const Se=(e,...t)=>{const{styles:s,behaviors:i}=Ce(e,t),n=new ue(s);return i.length?n.withBehaviors(...i):n};class Te{constructor(e,t){this.behaviors=t,this.css="";const s=e.reduce(((e,t)=>(d(t)?this.css+=t:e.push(t),e)),[]);s.length&&(this.styles=new ue(s))}createCSS(e){return this.behaviors.forEach(e),this.styles&&e(this),this.css}addedCallback(e){e.addStyles(this.styles)}removedCallback(e){e.removeStyles(this.styles)}}pe.define(Te),Se.partial=(e,...t)=>{const{styles:s,behaviors:i}=Ce(e,t);return new Te(s,i)};const $e=/fe-b\$\$start\$\$(\d+)\$\$(.+)\$\$fe-b/,xe=/fe-b\$\$end\$\$(\d+)\$\$(.+)\$\$fe-b/,Oe=/fe-repeat\$\$start\$\$(\d+)\$\$fe-repeat/,Be=/fe-repeat\$\$end\$\$(\d+)\$\$fe-repeat/,Ne=/^(?:.{0,1000})fe-eb\$\$start\$\$(.+?)\$\$fe-eb/,ke=/fe-eb\$\$end\$\$(.{0,1000})\$\$fe-eb(?:.{0,1000})$/;function Ae(e){return e&&e.nodeType===Node.COMMENT_NODE}const Ee=Object.freeze({attributeMarkerName:"data-fe-b",compactAttributeMarkerName:"data-fe-c",attributeBindingSeparator:" ",contentBindingStartMarker:(e,t)=>`fe-b$$start$$${e}$$${t}$$fe-b`,contentBindingEndMarker:(e,t)=>`fe-b$$end$$${e}$$${t}$$fe-b`,repeatStartMarker:e=>`fe-repeat$$start$$${e}$$fe-repeat`,repeatEndMarker:e=>`fe-repeat$$end$$${e}$$fe-repeat`,isContentBindingStartMarker:e=>$e.test(e),isContentBindingEndMarker:e=>xe.test(e),isRepeatViewStartMarker:e=>Oe.test(e),isRepeatViewEndMarker:e=>Be.test(e),isElementBoundaryStartMarker:e=>Ae(e)&&Ne.test(e.data.trim()),isElementBoundaryEndMarker:e=>Ae(e)&&ke.test(e.data),parseAttributeBinding(e){const t=e.getAttribute(this.attributeMarkerName);return null===t?t:t.split(this.attributeBindingSeparator).map((e=>parseInt(e)))},parseEnumeratedAttributeBinding(e){const t=[],s=this.attributeMarkerName.length+1,i=`${this.attributeMarkerName}-`;for(const n of e.getAttributeNames())if(n.startsWith(i)){const e=Number(n.slice(s));if(Number.isNaN(e))throw f.error(1601,{name:n,expectedFormat:`${i}<number>`});t.push(e)}return 0===t.length?null:t},parseCompactAttributeBinding(e){const t=`${this.compactAttributeMarkerName}-`,s=e.getAttributeNames().find((e=>e.startsWith(t)));if(!s)return null;const i=s.slice(t.length).split("-"),n=parseInt(i[0],10),r=parseInt(i[1],10);if(2!==i.length||Number.isNaN(n)||Number.isNaN(r)||n<0||r<1)throw f.error(1604,{name:s,expectedFormat:`${this.compactAttributeMarkerName}-{index}-{count}`});const o=[];for(let e=0;e<r;e++)o.push(n+e);return o},parseContentBindingStartMarker:e=>je($e,e),parseContentBindingEndMarker:e=>je(xe,e),parseRepeatStartMarker:e=>Me(Oe,e),parseRepeatEndMarker:e=>Me(Be,e),parseElementBoundaryStartMarker:e=>Ie(Ne,e.trim()),parseElementBoundaryEndMarker:e=>Ie(ke,e)});function Me(e,t){const s=e.exec(t);return null===s?s:parseInt(s[1])}function Ie(e,t){const s=e.exec(t);return null===s?s:s[1]}function je(e,t){const s=e.exec(t);return null===s?s:[parseInt(s[1]),s[2]]}const Re=Symbol.for("fe-hydration");function Ve(e){return e[Re]===Re}const _e="defer-hydration",ze=`fast-${Math.random().toString(36).substring(2,8)}`,Le=`${ze}{`,Fe=`}${ze}`,He=Fe.length;let De=0;const Pe=()=>`${ze}-${++De}`,Ue=Object.freeze({interpolation:e=>`${Le}${e}${Fe}`,attribute:e=>`${Pe()}="${Le}${e}${Fe}"`,comment:e=>`\x3c!--${Le}${e}${Fe}--\x3e`}),qe=Object.freeze({parse(e,t){const s=e.split(Le);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(Fe);let o;if(-1===r)o=n;else{const e=n.substring(0,r);i.push(t[e]),o=n.substring(r+He)}""!==o&&i.push(o)}return i}}),Qe=g(),We=Object.freeze({getForInstance:Qe.getForInstance,getByType:Qe.getByType,define:(e,t)=>((t=t||{}).type=e,Qe.register(t),e),assignAspect(e,t){if(t)switch(e.sourceAspect=t,t[0]){case":":e.targetAspect=t.substring(1),e.aspectType="classList"===e.targetAspect?m.tokenList:m.property;break;case"?":e.targetAspect=t.substring(1),e.aspectType=m.booleanAttribute;break;case"@":e.targetAspect=t.substring(1),e.aspectType=m.event;break;default:e.targetAspect=t,e.aspectType=m.attribute}else e.aspectType=m.content}});function Xe(e){return function(t){We.define(t,e)}}class Je{constructor(e){this.options=e}createHTML(e){return Ue.attribute(e(this))}createBehavior(){return this}}v(Je);class Ke extends Error{constructor(e,t,s){super(e),this.factories=t,this.node=s}}function Ge(e){return e.nodeType===Node.COMMENT_NODE}function Ye(e){return e.nodeType===Node.TEXT_NODE}function Ze(e,t){const s=document.createRange();return s.setStart(e,0),s.setEnd(t,Ge(t)||Ye(t)?t.data.length:t.childNodes.length),s}function et(e,t,s,i){var n,r;const o=null!==(r=null!==(n=Ee.parseAttributeBinding(e))&&void 0!==n?n:Ee.parseEnumeratedAttributeBinding(e))&&void 0!==r?r:Ee.parseCompactAttributeBinding(e);if(null!==o){for(const n of o){const r=t[n+i];if(!r)throw new Ke(`HydrationView was unable to successfully target factory on ${e.nodeName} inside ${e.getRootNode().host.nodeName}. This likely indicates a template mismatch between SSR rendering and hydration.`,t,e);st(r,e,s)}e.removeAttribute(Ee.attributeMarkerName)}}function tt(e,t,s,i,n,r){if(Ee.isElementBoundaryStartMarker(e))!function(e,t){const s=Ee.parseElementBoundaryStartMarker(e.data);let i=t.nextSibling();for(;null!==i;){if(Ge(i)){const e=Ee.parseElementBoundaryEndMarker(i.data);if(e&&e===s)break}i=t.nextSibling()}}(e,t);else if(Ee.isContentBindingStartMarker(e.data)){const o=Ee.parseContentBindingStartMarker(e.data);if(null===o)return;const[a,l]=o,c=s[a+r],d=[];let h=t.nextSibling();e.data="";const u=h;for(;null!==h;){if(Ge(h)){const e=Ee.parseContentBindingEndMarker(h.data);if(e&&e[1]===l)break}d.push(h),h=t.nextSibling()}if(null===h){const t=e.getRootNode();throw new Error(`Error hydrating Comment node inside "${function(e){return e instanceof DocumentFragment&&"mode"in e}(t)?t.host.nodeName:t.nodeName}".`)}if(h.data="",1===d.length&&Ye(d[0]))st(c,d[0],i);else{h!==u&&null!==h.previousSibling&&(n[c.targetNodeId]={first:u,last:h.previousSibling});st(c,h.parentNode.insertBefore(document.createTextNode(""),h),i)}}}function st(e,t,s){if(void 0===e.targetNodeId)throw new Error("Factory could not be target to the node");s[e.targetNodeId]=t}var it;function nt(e,t){const s=e.parentNode;let i,n=e;for(;n!==t;){if(i=n.nextSibling,!i)throw new Error(`Unmatched first/last child inside "${t.getRootNode().host.nodeName}".`);s.removeChild(n),n=i}s.removeChild(t)}class rt{constructor(){this.index=0,this.length=0}get event(){return H.getEvent()}get isEven(){return this.index%2==0}get isOdd(){return this.index%2!=0}get isFirst(){return 0===this.index}get isInMiddle(){return!this.isFirst&&!this.isLast}get isLast(){return this.index===this.length-1}eventDetail(){return this.event.detail}eventTarget(){return this.event.target}}class ot extends rt{constructor(e,t,s){super(),this.fragment=e,this.factories=t,this.targets=s,this.behaviors=null,this.unbindables=[],this.source=null,this.isBound=!1,this.sourceLifetime=V.unknown,this.context=this,this.firstChild=e.firstChild,this.lastChild=e.lastChild}appendTo(e){e.appendChild(this.fragment)}insertBefore(e){if(this.fragment.hasChildNodes())e.parentNode.insertBefore(this.fragment,e);else{const t=this.lastChild;if(e.previousSibling===t)return;const s=e.parentNode;let i,n=this.firstChild;for(;n!==t;)i=n.nextSibling,s.insertBefore(n,e),n=i;s.insertBefore(t,e)}}remove(){const e=this.fragment,t=this.lastChild;let s,i=this.firstChild;for(;i!==t;)s=i.nextSibling,e.appendChild(i),i=s;e.appendChild(t)}dispose(){nt(this.firstChild,this.lastChild),this.unbind()}onUnbind(e){this.unbindables.push(e)}bind(e,t=this){if(this.source===e)return;let s=this.behaviors;if(null===s){this.source=e,this.context=t,this.behaviors=s=new Array(this.factories.length);const i=this.factories;for(let e=0,t=i.length;e<t;++e){const t=i[e].createBehavior();t.bind(this),s[e]=t}}else{null!==this.source&&this.evaluateUnbindables(),this.isBound=!1,this.source=e,this.context=t;for(let e=0,t=s.length;e<t;++e)s[e].bind(this)}this.isBound=!0}unbind(){this.isBound&&null!==this.source&&(this.evaluateUnbindables(),this.source=null,this.context=this,this.isBound=!1)}evaluateUnbindables(){const e=this.unbindables;for(let t=0,s=e.length;t<s;++t)e[t].unbind(this);e.length=0}static disposeContiguousBatch(e){if(0!==e.length){nt(e[0].firstChild,e[e.length-1].lastChild);for(let t=0,s=e.length;t<s;++t)e[t].unbind()}}}v(ot),_.defineProperty(ot.prototype,"index"),_.defineProperty(ot.prototype,"length");const at="unhydrated",lt="hydrating",ct="hydrated";class dt extends Error{constructor(e,t,s,i){super(e),this.factory=t,this.fragment=s,this.templateString=i}}it=Re,v(class extends rt{get hydrationStage(){return this._hydrationStage}get targets(){return this._targets}get bindingViewBoundaries(){return this._bindingViewBoundaries}constructor(e,t,s,i){super(),this.firstChild=e,this.lastChild=t,this.sourceTemplate=s,this.hostBindingTarget=i,this[it]=Re,this.context=this,this.source=null,this.isBound=!1,this.sourceLifetime=V.unknown,this.unbindables=[],this.fragment=null,this.behaviors=null,this._hydrationStage=at,this._bindingViewBoundaries={},this._targets={},this.factories=s.compile().factories}insertBefore(e){if(null!==this.fragment)if(this.fragment.hasChildNodes())e.parentNode.insertBefore(this.fragment,e);else{const t=this.lastChild;if(e.previousSibling===t)return;const s=e.parentNode;let i,n=this.firstChild;for(;n!==t;)i=n.nextSibling,s.insertBefore(n,e),n=i;s.insertBefore(t,e)}}appendTo(e){null!==this.fragment&&e.appendChild(this.fragment)}remove(){const e=this.fragment||(this.fragment=document.createDocumentFragment()),t=this.lastChild;let s,i=this.firstChild;for(;i!==t;){if(s=i.nextSibling,!s)throw new Error(`Unmatched first/last child inside "${t.getRootNode().host.nodeName}".`);e.appendChild(i),i=s}e.appendChild(t)}bind(e,t=this){var s;if(this.hydrationStage!==ct&&(this._hydrationStage=lt),this.source===e)return;let i=this.behaviors;if(null===i){this.source=e,this.context=t;try{const{targets:e,boundaries:t}=function(e,t,s){const i=Ze(e,t),n=i.commonAncestorContainer,r=function(e){let t=0;for(let s=0,i=e.length;s<i&&"h"===e[s].targetNodeId;++s)t++;return t}(s),o=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_COMMENT+NodeFilter.SHOW_TEXT,{acceptNode:e=>0===i.comparePoint(e,0)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}),a={},l={};let c=o.currentNode=e;for(;null!==c;){switch(c.nodeType){case Node.ELEMENT_NODE:et(c,s,a,r);break;case Node.COMMENT_NODE:tt(c,o,s,a,l,r)}c=o.nextNode()}return i.detach(),{targets:a,boundaries:l}}(this.firstChild,this.lastChild,this.factories);this._targets=e,this._bindingViewBoundaries=t}catch(e){if(e instanceof Ke){let t=this.sourceTemplate.html;"string"!=typeof t&&(t=t.innerHTML),e.templateString=t}throw e}this.behaviors=i=new Array(this.factories.length);const n=this.factories;for(let e=0,t=n.length;e<t;++e){const t=n[e];if("h"===t.targetNodeId&&this.hostBindingTarget&&st(t,this.hostBindingTarget,this._targets),!(t.targetNodeId in this.targets)){let e=this.sourceTemplate.html;"string"!=typeof e&&(e=e.innerHTML);const i=(null===(s=this.firstChild)||void 0===s?void 0:s.getRootNode()).host,n=t,r=[`HydrationView was unable to successfully target bindings inside "<${((null==i?void 0:i.nodeName)||"unknown").toLowerCase()}>".`,"\nMismatch Details:",` - Expected target node ID: "${t.targetNodeId}"`,` - Available target IDs: [${Object.keys(this.targets).join(", ")||"none"}]`];throw t.targetTagName&&r.push(` - Expected tag name: "${t.targetTagName}"`),n.sourceAspect&&r.push(` - Source aspect: "${n.sourceAspect}"`),void 0!==n.aspectType&&r.push(` - Aspect type: ${n.aspectType}`),r.push("\nThis usually means:"," 1. The server-rendered HTML doesn't match the client template"," 2. The hydration markers are missing or corrupted"," 3. The DOM structure was modified before hydration",`\nTemplate: ${e.slice(0,200)}${e.length>200?"...":""}`),new dt(r.join("\n"),t,Ze(this.firstChild,this.lastChild).cloneContents(),e)}{const s=t.createBehavior();s.bind(this),i[e]=s}}}else{null!==this.source&&this.evaluateUnbindables(),this.isBound=!1,this.source=e,this.context=t;for(let e=0,t=i.length;e<t;++e)i[e].bind(this)}this.isBound=!0,this._hydrationStage=ct}unbind(){this.isBound&&null!==this.source&&(this.evaluateUnbindables(),this.source=null,this.context=this,this.isBound=!1)}dispose(){nt(this.firstChild,this.lastChild),this.unbind()}onUnbind(e){this.unbindables.push(e)}evaluateUnbindables(){const e=this.unbindables;for(let t=0,s=e.length;t<s;++t)e[t].unbind(this);e.length=0}});const ht={[m.attribute]:T.setAttribute,[m.booleanAttribute]:T.setBooleanAttribute,[m.property]:(e,t,s)=>e[t]=s,[m.content]:function(e,t,s,i){if(null==s&&(s=""),function(e){return void 0!==e.create}(s)){e.textContent="";let t=e.$fastView;if(void 0===t)if(Ve(i)&&Ve(s)&&void 0!==i.bindingViewBoundaries[this.targetNodeId]&&i.hydrationStage!==ct){const e=i.bindingViewBoundaries[this.targetNodeId];t=s.hydrate(e.first,e.last)}else t=s.create();else e.$fastTemplate!==s&&(t.isComposed&&(t.remove(),t.unbind()),t=s.create());t.isComposed?t.needsBindOnly&&(t.needsBindOnly=!1,t.bind(i.source,i.context)):(t.isComposed=!0,t.bind(i.source,i.context),t.insertBefore(e),e.$fastView=t,e.$fastTemplate=s)}else{const t=e.$fastView;void 0!==t&&t.isComposed&&(t.isComposed=!1,t.remove(),t.needsBindOnly?t.needsBindOnly=!1:t.unbind()),e.textContent=s}},[m.tokenList]:function(e,t,s){var i;const n=`${this.id}-t`,r=null!==(i=e[n])&&void 0!==i?i:e[n]={v:0,cv:Object.create(null)},o=r.cv;let a=r.v;const l=e[t];if(null!=s&&s.length){const e=s.split(/\s+/);for(let t=0,s=e.length;t<s;++t){const s=e[t];""!==s&&(o[s]=a,l.add(s))}}if(r.v=a+1,0!==a){a-=1;for(const e in o)o[e]===a&&l.remove(e)}},[m.event]:()=>{}};class ut{constructor(e){this.dataBinding=e,this.updateTarget=null,this.aspectType=m.content}createHTML(e){return Ue.interpolation(e(this))}createBehavior(){var e;if(null===this.updateTarget){const t=ht[this.aspectType],s=null!==(e=this.dataBinding.policy)&&void 0!==e?e:this.policy;if(!t)throw f.error(1205);this.data=`${this.id}-d`,this.updateTarget=s.protect(this.targetTagName,this.aspectType,this.targetAspect,t)}return this}bind(e){var t;const s=e.targets[this.targetNodeId],i=Ve(e)&&e.hydrationStage&&e.hydrationStage!==ct;switch(this.aspectType){case m.event:s[this.data]=e,s.addEventListener(this.targetAspect,this,this.dataBinding.options);break;case m.content:e.onUnbind(this);default:const n=null!==(t=s[this.data])&&void 0!==t?t:s[this.data]=this.dataBinding.createObserver(this,this);if(n.target=s,n.controller=e,i&&(this.aspectType===m.attribute||this.aspectType===m.booleanAttribute)){n.bind(e);break}this.updateTarget(s,this.targetAspect,n.bind(e),e)}}unbind(e){const t=e.targets[this.targetNodeId].$fastView;void 0!==t&&t.isComposed&&(t.unbind(),t.needsBindOnly=!0)}handleEvent(e){const t=e.currentTarget[this.data];if(t.isBound){H.setEvent(e);const s=this.dataBinding.evaluate(t.source,t.context);H.setEvent(null),!0!==s&&e.preventDefault()}}handleChange(e,t){const s=t.target,i=t.controller;this.updateTarget(s,this.targetAspect,t.bind(i),i)}}We.define(ut,{aspected:!0});const ft=(e,t)=>`${e}.${t}`,pt={},gt={index:0,node:null};function bt(e){e.startsWith("fast-")||f.warn(1204,{name:e})}const vt=new Proxy(document.createElement("div"),{get(e,t){bt(t);const s=Reflect.get(e,t);return c(s)?s.bind(e):s},set:(e,t,s)=>(bt(t),Reflect.set(e,t,s))});class mt{constructor(e,t,s){this.fragment=e,this.directives=t,this.policy=s,this.proto=null,this.nodeIds=new Set,this.descriptors={},this.factories=[]}addFactory(e,t,s,i,n){var r,o;this.nodeIds.has(s)||(this.nodeIds.add(s),this.addTargetDescriptor(t,s,i)),e.id=null!==(r=e.id)&&void 0!==r?r:Pe(),e.targetNodeId=s,e.targetTagName=n,e.policy=null!==(o=e.policy)&&void 0!==o?o:this.policy,this.factories.push(e)}freeze(){return this.proto=Object.create(null,this.descriptors),this}addTargetDescriptor(e,t,s){const i=this.descriptors;if("r"===t||"h"===t||i[t])return;if(!i[e]){const t=e.lastIndexOf("."),s=e.substring(0,t),i=parseInt(e.substring(t+1));this.addTargetDescriptor(s,e,i)}let n=pt[t];if(!n){const i=`_${t}`;pt[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:vt;for(const e of this.nodeIds)s[e];return new ot(t,this.factories,s)}}function yt(e,t,s,i,n,r=!1){const o=s.attributes,a=e.directives;for(let l=0,c=o.length;l<c;++l){const d=o[l],h=d.value,u=qe.parse(h,a);let f=null;null===u?r&&(f=new ut(le((()=>h),e.policy)),We.assignAspect(f,d.name)):f=Tt.aggregate(u,e.policy),null!==f&&(s.removeAttributeNode(d),l--,c--,e.addFactory(f,t,i,n,s.tagName))}}function wt(e,t,s){let i=0,n=t.firstChild;for(;n;){const t=Ct(e,s,n,i);n=t.node,i=t.index}}function Ct(e,t,s,i){const n=ft(t,i);switch(s.nodeType){case 1:yt(e,t,s,n,i),wt(e,s,n);break;case 3:return function(e,t,s,i,n){const r=qe.parse(t.textContent,e.directives);if(null===r)return gt.node=t.nextSibling,gt.index=n+1,gt;let o,a=o=t;for(let t=0,l=r.length;t<l;++t){const l=r[t];0!==t&&(n++,i=ft(s,n),o=a.parentNode.insertBefore(document.createTextNode(""),a.nextSibling)),d(l)?o.textContent=l:(o.textContent=" ",We.assignAspect(l),e.addFactory(l,s,i,n,null)),a=o}return gt.index=n+1,gt.node=a.nextSibling,gt}(e,s,t,n,i);case 8:const r=qe.parse(s.data,e.directives);null!==r&&e.addFactory(Tt.aggregate(r),t,n,i,null)}return gt.index=i+1,gt.node=s.nextSibling,gt}const St="TEMPLATE",Tt={compile(e,t,s=T.policy){let i;if(d(e)){i=document.createElement(St),i.innerHTML=s.createHTML(e);const t=i.content.firstElementChild;null!==t&&t.tagName===St&&(i=t)}else i=e;i.content.firstChild||i.content.lastChild||i.content.appendChild(document.createComment(""));const n=document.adoptNode(i.content),r=new mt(n,t,s);var o,a;return yt(r,"",i,"h",0,!0),o=n.firstChild,a=t,(o&&8==o.nodeType&&null!==qe.parse(o.data,a)||1===n.childNodes.length&&Object.keys(t).length>0)&&n.insertBefore(document.createComment(""),n.firstChild),wt(r,n,"r"),gt.node=null,r.freeze()},setDefaultStrategy(e){this.compile=e},aggregate(e,t=T.policy){if(1===e.length)return e[0];let s,i,n=!1;const r=e.length,o=e.map((e=>d(e)?()=>e:(s=e.sourceAspect||s,n=n||e.dataBinding.isVolatile,i=i||e.dataBinding.policy,e.dataBinding.evaluate))),a=new ut(re(((e,t)=>{let s="";for(let i=0;i<r;++i)s+=o[i](e,t);return s}),null!=i?i:t,n));return We.assignAspect(a,s),a}},$t=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/,xt=Object.create(null);class Ot{constructor(e,t=xt){this.html=e,this.factories=t}createHTML(e){const t=this.factories;for(const s in t)e(t[s]);return this.html}}function Bt(e,t,s,i=We.getForInstance(e)){if(i.aspected){const s=$t.exec(t);null!==s&&We.assignAspect(e,s[2])}return e.createHTML(s)}Ot.empty=new Ot(""),We.define(Ot);class Nt{constructor(e,t={},s){this.policy=s,this.result=null,this.html=e,this.factories=t}compile(){return null===this.result&&(this.result=Tt.compile(this.html,this.factories,this.policy)),this.result}create(e){return this.compile().createView(e)}inline(){return new Ot(d(this.html)?this.html:this.html.innerHTML,this.factories)}withPolicy(e){if(this.result)throw f.error(1208);if(this.policy)throw f.error(1207);return this.policy=e,this}render(e,t,s){const i=this.create(s);return i.bind(e),i.appendTo(t),i}static create(e,t,s){let i="";const n=Object.create(null),r=e=>{var t;const s=null!==(t=e.id)&&void 0!==t?t:e.id=Pe();return n[s]=e,s};for(let s=0,n=e.length-1;s<n;++s){const n=e[s];let o,a=t[s];if(i+=n,c(a))a=new ut(re(a));else if(a instanceof ie)a=new ut(a);else if(!(o=We.getForInstance(a))){const e=a;a=new ut(le((()=>e)))}i+=Bt(a,n,r,o)}return new Nt(i+e[e.length-1],n,s)}}v(Nt);const kt=(e,...t)=>{if(Array.isArray(e)&&Array.isArray(e.raw))return Nt.create(e,t);throw f.error(1206)};kt.partial=e=>new Ot(e);class At extends Je{bind(e){e.source[this.options]=e.targets[this.targetNodeId]}}We.define(At);const Et=e=>new At(e),Mt=()=>null;function It(e){return void 0===e?Mt:c(e)?e:()=>e}function jt(e,t,s){const i=c(e)?e:()=>e,n=It(t),r=It(s);return(e,t)=>i(e,t)?n(e,t):r(e,t)}const Rt=Object.freeze({positioning:!1,recycle:!0});function Vt(e,t,s,i){e.context.parent=i.source,e.context.parentContext=i.context,e.bind(t[s])}function _t(e,t,s,i){e.context.parent=i.source,e.context.parentContext=i.context,e.context.length=t.length,e.context.index=s,e.bind(t[s])}function zt(e){return e.nodeType===Node.COMMENT_NODE}class Lt extends Error{constructor(e,t){super(e),this.propertyBag=t}}class Ft{constructor(e){this.directive=e,this.items=null,this.itemsObserver=null,this.bindView=Vt,this.views=[],this.itemsBindingObserver=e.dataBinding.createObserver(this,e),this.templateBindingObserver=e.templateBinding.createObserver(this,e),e.options.positioning&&(this.bindView=_t)}bind(e){this.location=e.targets[this.directive.targetNodeId],this.controller=e,this.items=this.itemsBindingObserver.bind(e),this.template=this.templateBindingObserver.bind(e),this.observeItems(!0),Ve(this.template)&&Ve(e)&&e.hydrationStage!==ct?this.hydrateViews(this.template):this.refreshAllViews(),e.onUnbind(this)}unbind(){null!==this.itemsObserver&&this.itemsObserver.unsubscribe(this),this.unbindAllViews()}handleChange(e,t){if(t===this.itemsBindingObserver)this.items=this.itemsBindingObserver.bind(this.controller),this.observeItems(),this.refreshAllViews();else if(t===this.templateBindingObserver)this.template=this.templateBindingObserver.bind(this.controller),this.refreshAllViews(!0);else{if(!t[0])return;t[0].reset?this.refreshAllViews():t[0].sorted?this.updateSortedViews(t):this.updateSplicedViews(t)}}observeItems(e=!1){if(!this.items)return void(this.items=p);const t=this.itemsObserver,s=this.itemsObserver=_.getNotifier(this.items),i=t!==s;i&&null!==t&&t.unsubscribe(this),(i||e)&&s.subscribe(this)}updateSortedViews(e){const t=this.views;for(let s=0,i=e.length;s<i;++s){const i=e[s].sorted.slice(),n=i.slice().sort();for(let e=0,s=i.length;e<s;++e){const s=i.find((t=>i[e]===n[t]));if(s!==e){const i=n.splice(s,1);n.splice(e,0,...i);const r=t[e],o=r?r.firstChild:this.location;t[s].remove(),t[s].insertBefore(o);const a=t.splice(s,1);t.splice(e,0,...a)}}}}updateSplicedViews(e){const t=this.views,s=this.bindView,i=this.items,n=this.template,r=this.controller,o=this.directive.options.recycle,a=[];let l=0,c=0;for(let d=0,h=e.length;d<h;++d){const h=e[d],u=h.removed;let f=0,p=h.index;const g=p+h.addedCount,b=t.splice(h.index,u.length),v=c=a.length+b.length;for(;p<g;++p){const e=t[p],d=e?e.firstChild:this.location;let h;o&&c>0?(f<=v&&b.length>0?(h=b[f],f++):(h=a[l],l++),c--):h=n.create(),t.splice(p,0,h),s(h,i,p,r),h.insertBefore(d)}b[f]&&a.push(...b.slice(f))}for(let e=l,t=a.length;e<t;++e)a[e].dispose();if(this.directive.options.positioning)for(let e=0,s=t.length;e<s;++e){const i=t[e].context;i.length=s,i.index=e}}refreshAllViews(e=!1){const t=this.items,s=this.template,i=this.location,n=this.bindView,r=this.controller;let o=t.length,a=this.views,l=a.length;if(0!==o&&!e&&this.directive.options.recycle||(ot.disposeContiguousBatch(a),l=0),0===l){this.views=a=new Array(o);for(let e=0;e<o;++e){const o=s.create();n(o,t,e,r),a[e]=o,o.insertBefore(i)}}else{let e=0;for(;e<o;++e)if(e<l){const i=a[e];if(!i){const t=new XMLSerializer;throw new Lt(`View is null or undefined inside "${this.location.getRootNode().host.nodeName}".`,{index:e,hydrationStage:this.controller.hydrationStage,itemsLength:o,viewsState:a.map((e=>e?"hydrated":"empty")),viewTemplateString:t.serializeToString(s.create().fragment),rootNodeContent:t.serializeToString(this.location.getRootNode())})}n(i,t,e,r)}else{const o=s.create();n(o,t,e,r),a.push(o),o.insertBefore(i)}const c=a.splice(e,l-e);for(e=0,o=c.length;e<o;++e)c[e].dispose()}}unbindAllViews(){const e=this.views;for(let t=0,s=e.length;t<s;++t){const s=e[t];if(!s){const s=new XMLSerializer;throw new Lt(`View is null or undefined inside "${this.location.getRootNode().host.nodeName}".`,{index:t,hydrationStage:this.controller.hydrationStage,viewsState:e.map((e=>e?"hydrated":"empty")),rootNodeContent:s.serializeToString(this.location.getRootNode())})}s.unbind()}}hydrateViews(e){if(!this.items)return;this.views=new Array(this.items.length);let t=this.location.previousSibling;for(;null!==t;){if(!zt(t)){t=t.previousSibling;continue}const s=Ee.parseRepeatEndMarker(t.data);if(null===s){t=t.previousSibling;continue}t.data="";const i=t.previousSibling;if(!i)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": end should never be null.`);let n=i,r=0;for(;null!==n;){if(zt(n))if(Ee.isRepeatViewEndMarker(n.data))r++;else if(Ee.isRepeatViewStartMarker(n.data)){if(!r){if(Ee.parseRepeatStartMarker(n.data)!==s)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": Mismatched start and end markers.`);n.data="",t=n.previousSibling,n=n.nextSibling;const r=e.hydrate(n,i);this.views[s]=r,this.bindView(r,this.items,s,this.controller);break}r--}n=n.previousSibling}if(!n)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": start should never be null.`)}}}class Ht{createHTML(e){return Ue.comment(e(this))}constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.options=s,ee.enable()}createBehavior(){return new Ft(this)}}function Dt(e,t,s=Rt){const i=ce(e),n=ce(t);return new Ht(i,n,Object.assign(Object.assign({},Rt),s))}We.define(Ht);const Pt=e=>1===e.nodeType,Ut=e=>e?t=>1===t.nodeType&&t.matches(e):Pt;class qt extends Je{get id(){return this._id}set id(e){this._id=e,this._controllerProperty=`${e}-c`}bind(e){const t=e.targets[this.targetNodeId];t[this._controllerProperty]=e,this.updateTarget(e.source,this.computeNodes(t)),this.observe(t),e.onUnbind(this)}unbind(e){const t=e.targets[this.targetNodeId];this.updateTarget(e.source,p),this.disconnect(t),t[this._controllerProperty]=null}getSource(e){return e[this._controllerProperty].source}updateTarget(e,t){e[this.options.property]=t}computeNodes(e){let t=this.getNodes(e);return"filter"in this.options&&(t=t.filter(this.options.filter)),t}}const Qt="slotchange";class Wt extends qt{observe(e){e.addEventListener(Qt,this)}disconnect(e){e.removeEventListener(Qt,this)}getNodes(e){return e.assignedNodes(this.options)}handleEvent(e){const t=e.currentTarget;this.updateTarget(this.getSource(t),this.computeNodes(t))}}function Xt(e){return d(e)&&(e={property:e}),new Wt(e)}We.define(Wt);class Jt extends qt{constructor(e){super(e),this.observerProperty=Symbol(),this.handleEvent=(e,t)=>{const s=t.target;this.updateTarget(this.getSource(s),this.computeNodes(s))},e.childList=!0}observe(e){let t=e[this.observerProperty];t||(t=new MutationObserver(this.handleEvent),t.toJSON=h,e[this.observerProperty]=t),t.target=e,t.observe(e,this.options)}disconnect(e){const t=e[this.observerProperty];t.target=null,t.disconnect()}getNodes(e){return"selector"in this.options?Array.from(e.querySelectorAll(this.options.selector)):Array.from(e.childNodes)}}function Kt(e){return d(e)&&(e={property:e}),new Jt(e)}function Gt(e,t,s,i){return new(s||(s=Promise))((function(n,r){function o(e){try{l(i.next(e))}catch(e){r(e)}}function a(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,a)}l((i=i.apply(e,t||[])).next())}))}We.define(Jt),"function"==typeof SuppressedError&&SuppressedError;const Yt="boolean",Zt="reflect",es=Object.freeze({locate:b()}),ts={toView:e=>e?"true":"false",fromView:e=>!(null==e||"false"===e||!1===e||0===e)},ss={toView:e=>"boolean"==typeof e?e.toString():"",fromView:e=>[null,void 0,void 0].includes(e)?null:ts.fromView(e)};function is(e){if(null==e)return null;const t=1*e;return isNaN(t)?null:t}const ns={toView(e){const t=is(e);return t?t.toString():t},fromView:is};class rs{constructor(e,t,s=t.toLowerCase(),i=Zt,n){this.guards=new Set,this.Owner=e,this.name=t,this.attribute=s,this.mode=i,this.converter=n,this.fieldName=`_${t}`,this.callbackName=`${t}Changed`,this.hasCallback=this.callbackName in e.prototype,i===Yt&&void 0===n&&(this.converter=ts)}setValue(e,t){const s=e[this.fieldName],i=this.converter;void 0!==i&&(t=i.fromView(t)),s!==t&&(e[this.fieldName]=t,this.tryReflectToAttribute(e),this.hasCallback&&e[this.callbackName](s,t),e.$fastController.notify(this.name))}getValue(e){return _.track(e,this.name),e[this.fieldName]}onAttributeChangedCallback(e,t){this.guards.has(e)||(this.guards.add(e),this.setValue(e,t),this.guards.delete(e))}tryReflectToAttribute(e){const t=this.mode,s=this.guards;s.has(e)||"fromView"===t||I.enqueue((()=>{s.add(e);const i=e[this.fieldName];switch(t){case Zt:const t=this.converter;T.setAttribute(e,this.attribute,void 0!==t?t.toView(i):i);break;case Yt:T.setBooleanAttribute(e,this.attribute,i)}s.delete(e)}))}static collect(e,...t){const s=[];t.push(es.locate(e));for(let i=0,n=t.length;i<n;++i){const n=t[i];if(void 0!==n)for(let t=0,i=n.length;t<i;++t){const i=n[t];d(i)?s.push(new rs(e,i)):s.push(new rs(e,i.property,i.attribute,i.mode,i.converter))}}return s}}function os(e,t){let s;function i(e,t){arguments.length>1&&(s.property=t),es.locate(e.constructor).push(s)}return arguments.length>1?(s={},void i(e,t)):(s=void 0===e?{}:e,i)}var as;const ls={mode:"open"},cs={},ds=new Set,hs=f.getById(l.elementRegistry,(()=>g())),us={deferAndHydrate:"defer-and-hydrate"};class fs{get isDefined(){return this.platformDefined}constructor(e,t=e.definition){var s;this.platformDefined=!1,d(t)&&(t={name:t}),this.type=e,this.name=t.name,this.template=t.template,this.templateOptions=t.templateOptions,this.registry=null!==(s=t.registry)&&void 0!==s?s:customElements;const i=e.prototype,n=rs.collect(e,t.attributes),r=new Array(n.length),o={},a={};for(let e=0,t=n.length;e<t;++e){const t=n[e];r[e]=t.attribute,o[t.name]=t,a[t.attribute]=t,_.defineProperty(i,t)}Reflect.defineProperty(e,"observedAttributes",{value:r,enumerable:!0}),this.attributes=n,this.propertyLookup=o,this.attributeLookup=a,this.shadowOptions=void 0===t.shadowOptions?ls:null===t.shadowOptions?void 0:Object.assign(Object.assign({},ls),t.shadowOptions),this.elementOptions=void 0===t.elementOptions?cs:Object.assign(Object.assign({},cs),t.elementOptions),this.styles=ue.normalize(t.styles),hs.register(this),_.defineProperty(as.isRegistered,this.name),as.isRegistered[this.name]=this.type}define(e=this.registry){var t,s;const i=this.type;return e.get(this.name)||(this.platformDefined=!0,e.define(this.name,i,this.elementOptions),null===(s=null===(t=this.lifecycleCallbacks)||void 0===t?void 0:t.elementDidDefine)||void 0===s||s.call(t,this.name)),this}static compose(e,t){return ds.has(e)||hs.getByType(e)?new as(class extends e{},t):new as(e,t)}static registerBaseType(e){ds.add(e)}static composeAsync(e,t){return new Promise((s=>{(ds.has(e)||hs.getByType(e))&&s(new as(class extends e{},t));const i=new as(e,t);_.getNotifier(i).subscribe({handleChange:()=>{var e,t;null===(t=null===(e=i.lifecycleCallbacks)||void 0===e?void 0:e.templateDidUpdate)||void 0===t||t.call(e,i.name),s(i)}},"template")}))}}as=fs,fs.isRegistered={},fs.getByType=hs.getByType,fs.getForInstance=hs.getForInstance,fs.registerAsync=e=>Gt(void 0,void 0,void 0,(function*(){return new Promise((t=>{as.isRegistered[e]&&t(as.isRegistered[e]),_.getNotifier(as.isRegistered).subscribe({handleChange:()=>t(as.isRegistered[e])},e)}))})),_.defineProperty(fs.prototype,"template");class ps{constructor(e){this.directive=e,this.location=null,this.controller=null,this.view=null,this.data=null,this.dataBindingObserver=e.dataBinding.createObserver(this,e),this.templateBindingObserver=e.templateBinding.createObserver(this,e)}bind(e){if(this.location=e.targets[this.directive.targetNodeId],this.controller=e,this.data=this.dataBindingObserver.bind(e),this.template=this.templateBindingObserver.bind(e),e.onUnbind(this),Ve(this.template)&&Ve(e)&&e.hydrationStage!==ct&&!this.view){const t=e.bindingViewBoundaries[this.directive.targetNodeId];t&&(this.view=this.template.hydrate(t.first,t.last),this.bindView(this.view))}else this.refreshView()}unbind(e){const t=this.view;null!==t&&t.isComposed&&(t.unbind(),t.needsBindOnly=!0)}handleChange(e,t){t===this.dataBindingObserver&&(this.data=this.dataBindingObserver.bind(this.controller)),(this.directive.templateBindingDependsOnData||t===this.templateBindingObserver)&&(this.template=this.templateBindingObserver.bind(this.controller)),this.refreshView()}bindView(e){e.isComposed?e.needsBindOnly&&(e.needsBindOnly=!1,e.bind(this.data)):(e.isComposed=!0,e.bind(this.data),e.insertBefore(this.location),e.$fastTemplate=this.template)}refreshView(){let e=this.view;const t=this.template;null===e?(this.view=e=t.create(),this.view.context.parent=this.controller.source,this.view.context.parentContext=this.controller.context):e.$fastTemplate!==t&&(e.isComposed&&(e.remove(),e.unbind()),this.view=e=t.create(),this.view.context.parent=this.controller.source,this.view.context.parentContext=this.controller.context),this.bindView(e)}}class gs{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.templateBindingDependsOnData=s}createHTML(e){return Ue.comment(e(this))}createBehavior(){return new ps(this)}}We.define(gs);const bs=new Map,vs={":model":e=>e},ms=Symbol("RenderInstruction"),ys="default-view",ws=kt`
|
|
1
|
+
void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",{value:Object.create(null),configurable:!1,enumerable:!1,writable:!1});const e=globalThis.FAST,t={1101:"Must call ArrayObserver.enable() before observing arrays.",1201:"The DOM Policy can only be set once.",1202:"To bind innerHTML, you must use a TrustedTypesPolicy.",1203:"View=>Model update skipped. To use twoWay binding, the target property must be observable.",1204:"No host element is present. Cannot bind host with ${name}.",1205:"The requested binding behavior is not supported by the binding engine.",1206:"Calling html`` as a normal function invalidates the security guarantees provided by FAST.",1207:"The DOM Policy for an HTML template can only be set once.",1208:"The DOM Policy cannot be set after a template is compiled.",1209:"'${aspectName}' on '${tagName}' is blocked by the current DOMPolicy.",1401:"Missing FASTElement definition.",1501:"No registration for Context/Interface '${name}'.",1502:"Dependency injection resolver for '${key}' returned a null factory.",1503:"Invalid dependency injection resolver strategy specified '${strategy}'.",1504:"Unable to autoregister dependency.",1505:"Unable to resolve dependency injection key '${key}'.",1506:"'${name}' is a native function and therefore cannot be safely constructed by DI. If this is intentional, please use a callback or cachedCallback resolver.",1507:"Attempted to jitRegister something that is not a constructor '${value}'. Did you forget to register this dependency?",1508:"Attempted to jitRegister an intrinsic type '${value}'. Did you forget to add @inject(Key)?",1509:"Attempted to jitRegister an interface '${value}'.",1510:"A valid resolver was not returned from the register method.",1511:"Key/value cannot be null or undefined. Are you trying to inject/register something that doesn't exist with DI?",1512:"'${key}' not registered. Did you forget to add @singleton()?",1513:"Cyclic dependency found '${name}'.",1514:"Injected properties that are updated on changes to DOM connectivity require the target object to be an instance of FASTElement.",1601:"Invalid attribute marker name: ${name}. Expected format is ${expectedFormat}.",1602:"Invalid compact attribute marker values in ${markerName}. Both index and count must be positive integers.",1604:"Invalid compact attribute marker name: ${name}. Expected format is ${expectedFormat}."},n=/(\$\{\w+?})/g,s=/\$\{(\w+?)}/g,i=Object.freeze({});function r(e,t){return e.split(n).map((e=>{var n;const i=e.replace(s,"$1");return String(null!==(n=t[i])&&void 0!==n?n:e)})).join("")}let o;Object.assign(e,{addMessages(e){Object.assign(t,e)},warn(e,n=i){var s;const o=null!==(s=t[e])&&void 0!==s?s:"Unknown Warning";console.warn(r(o,n))},error(e,n=i){var s;const o=null!==(s=t[e])&&void 0!==s?s:"Unknown Error";return new Error(r(o,n))}});const a="fast-kernel";try{if(document.currentScript)o=document.currentScript.getAttribute(a);else{const e=document.getElementsByTagName("script");o=e[e.length-1].getAttribute(a)}}catch(e){o="isolate"}let l;switch(o){case"share":l=Object.freeze({updateQueue:1,observable:2,contextEvent:3,elementRegistry:4});break;case"share-v2":l=Object.freeze({updateQueue:1.2,observable:2.2,contextEvent:3.2,elementRegistry:4.2});break;default:const e=`-${Math.random().toString(36).substring(2,8)}`;l=Object.freeze({updateQueue:`1.2${e}`,observable:`2.2${e}`,contextEvent:`3.2${e}`,elementRegistry:`4.2${e}`})}var c;!function(e){e[e.needsArrayObservation=1101]="needsArrayObservation",e[e.onlySetDOMPolicyOnce=1201]="onlySetDOMPolicyOnce",e[e.bindingInnerHTMLRequiresTrustedTypes=1202]="bindingInnerHTMLRequiresTrustedTypes",e[e.twoWayBindingRequiresObservables=1203]="twoWayBindingRequiresObservables",e[e.hostBindingWithoutHost=1204]="hostBindingWithoutHost",e[e.unsupportedBindingBehavior=1205]="unsupportedBindingBehavior",e[e.directCallToHTMLTagNotAllowed=1206]="directCallToHTMLTagNotAllowed",e[e.onlySetTemplatePolicyOnce=1207]="onlySetTemplatePolicyOnce",e[e.cannotSetTemplatePolicyAfterCompilation=1208]="cannotSetTemplatePolicyAfterCompilation",e[e.blockedByDOMPolicy=1209]="blockedByDOMPolicy",e[e.missingElementDefinition=1401]="missingElementDefinition",e[e.noRegistrationForContext=1501]="noRegistrationForContext",e[e.noFactoryForResolver=1502]="noFactoryForResolver",e[e.invalidResolverStrategy=1503]="invalidResolverStrategy",e[e.cannotAutoregisterDependency=1504]="cannotAutoregisterDependency",e[e.cannotResolveKey=1505]="cannotResolveKey",e[e.cannotConstructNativeFunction=1506]="cannotConstructNativeFunction",e[e.cannotJITRegisterNonConstructor=1507]="cannotJITRegisterNonConstructor",e[e.cannotJITRegisterIntrinsic=1508]="cannotJITRegisterIntrinsic",e[e.cannotJITRegisterInterface=1509]="cannotJITRegisterInterface",e[e.invalidResolver=1510]="invalidResolver",e[e.invalidKey=1511]="invalidKey",e[e.noDefaultResolver=1512]="noDefaultResolver",e[e.cyclicDependency=1513]="cyclicDependency",e[e.connectUpdateRequiresController=1514]="connectUpdateRequiresController"}(c||(c={}));const d=e=>"function"==typeof e,h=e=>"string"==typeof e,u=()=>{};!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}}(),"requestIdleCallback"in globalThis||(globalThis.requestIdleCallback=function(e,t){const n=Date.now();return setTimeout((()=>{e({didTimeout:!!(null==t?void 0:t.timeout)&&Date.now()-n>=t.timeout,timeRemaining:()=>0})}),1)},globalThis.cancelIdleCallback=function(e){clearTimeout(e)});const p={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},p));const f=globalThis.FAST;if(void 0===f.getById){const e=Object.create(null);Reflect.defineProperty(f,"getById",Object.assign({value(t,n){let s=e[t];return void 0===s&&(s=n?e[t]=n():null),s}},p))}void 0===f.error&&Object.assign(f,{warn(){},error:e=>new Error(`Error ${e}`),addMessages(){}});const g=Object.freeze([]);function b(){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 v(){const e=new WeakMap;return function(t){let n=e.get(t);if(void 0===n){let s=Reflect.getPrototypeOf(t);for(;void 0===n&&null!==s;)n=e.get(s),s=Reflect.getPrototypeOf(s);n=void 0===n?[]:n.slice(0),e.set(t,n)}return n}}function m(e){e.prototype.toJSON=u}const y=Object.freeze({none:0,attribute:1,booleanAttribute:2,property:3,content:4,tokenList:5,event:6}),w=e=>e,C=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:w}):{createHTML:w};let S=Object.freeze({createHTML:e=>C.createHTML(e),protect:(e,t,n,s)=>s});const T=S,O=Object.freeze({get policy(){return S},setPolicy(e){if(S!==T)throw f.error(c.onlySetDOMPolicyOnce);S=e},setAttribute(e,t,n){null==n?e.removeAttribute(t):e.setAttribute(t,n)},setBooleanAttribute(e,t,n){n?e.setAttribute(t,""):e.removeAttribute(t)}});function $(e,t,n,s){return(e,t,n,...i)=>{h(n)&&(n=n.replace(/(javascript:|vbscript:|data:)/,"")),s(e,t,n,...i)}}function x(e,t,n,s){throw f.error(c.blockedByDOMPolicy,{aspectName:n,tagName:null!=e?e:"text"})}const B={onabort:x,onauxclick:x,onbeforeinput:x,onbeforematch:x,onblur:x,oncancel:x,oncanplay:x,oncanplaythrough:x,onchange:x,onclick:x,onclose:x,oncontextlost:x,oncontextmenu:x,oncontextrestored:x,oncopy:x,oncuechange:x,oncut:x,ondblclick:x,ondrag:x,ondragend:x,ondragenter:x,ondragleave:x,ondragover:x,ondragstart:x,ondrop:x,ondurationchange:x,onemptied:x,onended:x,onerror:x,onfocus:x,onformdata:x,oninput:x,oninvalid:x,onkeydown:x,onkeypress:x,onkeyup:x,onload:x,onloadeddata:x,onloadedmetadata:x,onloadstart:x,onmousedown:x,onmouseenter:x,onmouseleave:x,onmousemove:x,onmouseout:x,onmouseover:x,onmouseup:x,onpaste:x,onpause:x,onplay:x,onplaying:x,onprogress:x,onratechange:x,onreset:x,onresize:x,onscroll:x,onsecuritypolicyviolation:x,onseeked:x,onseeking:x,onselect:x,onslotchange:x,onstalled:x,onsubmit:x,onsuspend:x,ontimeupdate:x,ontoggle:x,onvolumechange:x,onwaiting:x,onwebkitanimationend:x,onwebkitanimationiteration:x,onwebkitanimationstart:x,onwebkittransitionend:x,onwheel:x},N={elements:{a:{[y.attribute]:{href:$},[y.property]:{href:$}},area:{[y.attribute]:{href:$},[y.property]:{href:$}},button:{[y.attribute]:{formaction:$},[y.property]:{formAction:$}},embed:{[y.attribute]:{src:x},[y.property]:{src:x}},form:{[y.attribute]:{action:$},[y.property]:{action:$}},frame:{[y.attribute]:{src:$},[y.property]:{src:$}},iframe:{[y.attribute]:{src:$},[y.property]:{src:$,srcdoc:x}},input:{[y.attribute]:{formaction:$},[y.property]:{formAction:$}},link:{[y.attribute]:{href:x},[y.property]:{href:x}},object:{[y.attribute]:{codebase:x,data:x},[y.property]:{codeBase:x,data:x}},script:{[y.attribute]:{src:x,text:x},[y.property]:{src:x,text:x,innerText:x,textContent:x}},style:{[y.property]:{innerText:x,textContent:x}}},aspects:{[y.attribute]:Object.assign({},B),[y.property]:Object.assign({innerHTML:x},B),[y.event]:Object.assign({},B)}};function k(e,t){const n={};for(const s in t){const i=e[s],r=t[s];switch(i){case null:break;case void 0:n[s]=r;break;default:n[s]=i}}for(const t in e)t in n||(n[t]=e[t]);return Object.freeze(n)}function A(e,t){const n={};for(const s in t){const i=e[s],r=t[s];switch(i){case null:break;case void 0:n[s]=k(r,{});break;default:n[s]=k(i,r)}}for(const t in e)t in n||(n[t]=k(e[t],{}));return Object.freeze(n)}function E(e,t){const n={};for(const s in t){const i=e[s],r=t[s];switch(i){case null:break;case void 0:n[s]=A(i,{});break;default:n[s]=A(i,r)}}for(const t in e)t in n||(n[t]=A(e[t],{}));return Object.freeze(n)}function M(e,t,n,s,i){const r=e[n];if(r){const e=r[s];if(e)return e(t,n,s,i)}}const I=Object.freeze({create(e={}){var t,n;const s=null!==(t=e.trustedType)&&void 0!==t?t:function(){const e=e=>e;return globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:e}):{createHTML:e}}(),i=(r=null!==(n=e.guards)&&void 0!==n?n:{},o=N,Object.freeze({elements:r.elements?E(r.elements,o.elements):o.elements,aspects:r.aspects?A(r.aspects,o.aspects):o.aspects}));var r,o;return Object.freeze({createHTML:e=>s.createHTML(e),protect(e,t,n,s){var r;const o=(null!=e?e:"").toLowerCase(),a=i.elements[o];if(a){const i=M(a,e,t,n,s);if(i)return i}return null!==(r=M(i.aspects,e,t,n,s))&&void 0!==r?r:s}})}});class R{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 n=t.indexOf(e);-1!==n&&t.splice(n,1)}}notify(e){const t=this.spillover,n=this.subject;if(void 0===t){const t=this.sub1,s=this.sub2;void 0!==t&&t.handleChange(n,e),void 0!==s&&s.handleChange(n,e)}else for(let s=0,i=t.length;s<i;++s)t[s].handleChange(n,e)}}class j{constructor(e){this.subscribers={},this.subjectSubscribers=null,this.subject=e}notify(e){var t,n;null===(t=this.subscribers[e])||void 0===t||t.notify(e),null===(n=this.subjectSubscribers)||void 0===n||n.notify(e)}subscribe(e,t){var n,s;let i;i=t?null!==(n=this.subscribers[t])&&void 0!==n?n:this.subscribers[t]=new R(this.subject):null!==(s=this.subjectSubscribers)&&void 0!==s?s:this.subjectSubscribers=new R(this.subject),i.subscribe(e)}unsubscribe(e,t){var n,s;t?null===(n=this.subscribers[t])||void 0===n||n.unsubscribe(e):null===(s=this.subjectSubscribers)||void 0===s||s.unsubscribe(e)}}const V=f.getById(l.updateQueue,(()=>{const e=[],t=[],n=globalThis.requestAnimationFrame;let s=!0;function i(){if(t.length)throw t.shift()}function r(n){try{n.call()}catch(n){if(!s)throw e.length=0,n;t.push(n),setTimeout(i,0)}}function o(){let t=0;for(;t<e.length;)if(r(e[t]),t++,t>1024){for(let n=0,s=e.length-t;n<s;n++)e[n]=e[n+t];e.length-=t,t=0}e.length=0}function a(t){e.push(t),e.length<2&&(s?n(o):o())}return Object.freeze({enqueue:a,next:()=>new Promise(a),process:o,setMode:e=>s=e})})),_=Object.freeze({unknown:void 0,coupled:1}),D=f.getById(l.observable,(()=>{const e=V.enqueue,t=/(:|&&|\|\||if|\?\.)/,n=new WeakMap;let s,i=e=>{throw f.error(c.needsArrayObservation)};function r(e){var t;let s=null!==(t=e.$fastController)&&void 0!==t?t:n.get(e);return void 0===s&&(Array.isArray(e)?s=i(e):n.set(e,s=new j(e))),s}const o=v();class a{constructor(e){this.name=e,this.field=`_${e}`,this.callback=`${e}Changed`}getValue(e){return void 0!==s&&s.watch(e,this.name),e[this.field]}setValue(e,t){const n=this.field,s=e[n];if(s!==t){e[n]=t;const i=e[this.callback];d(i)&&i.call(e,s,t),r(e).notify(this.name)}}}class l extends R{constructor(e,t,n=!1){super(e,t),this.expression=e,this.isVolatileBinding=n,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!==_.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 n=s;let i;s=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;try{i=this.expression(e,t)}finally{s=n}return i}disconnect(){this.dispose()}dispose(){if(null!==this.last){let e=this.first;for(;void 0!==e;)e.notifier.unsubscribe(this,e.propertyName),e=e.next;this.last=null,this.needsRefresh=this.needsQueue=this.isAsync}}watch(e,t){const n=this.last,i=r(e),o=null===n?this.first:{};if(o.propertySource=e,o.propertyName=t,o.notifier=i,i.subscribe(this,t),null!==n){if(!this.needsRefresh){let t;s=void 0,t=n.propertySource[n.propertyName],s=this,e===t&&(this.needsRefresh=!0)}n.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 m(l),Object.freeze({setArrayObserverFactory(e){i=e},getNotifier:r,track(e,t){s&&s.watch(e,t)},trackVolatile(){s&&(s.needsRefresh=!0)},notify(e,t){r(e).notify(t)},defineProperty(e,t){h(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,n=this.isVolatileBinding(e)){return new l(e,t,n)},isVolatileBinding:e=>t.test(e.toString())})}));function F(e,t){D.defineProperty(e,t)}function L(e,t,n){return Object.assign({},n,{get(){return D.trackVolatile(),n.get.apply(this)}})}const P=f.getById(l.contextEvent,(()=>{let e=null;return{get:()=>e,set(t){e=t}}})),H=Object.freeze({default:{index:0,length:0,get event(){return H.getEvent()},eventDetail(){return this.event.detail},eventTarget(){return this.event.target}},getEvent:()=>P.get(),setEvent(e){P.set(e)}});class z{constructor(e,t,n){this.index=e,this.removed=t,this.addedCount=n}adjustTo(e){let t=this.index;const n=e.length;return t>n?t=n-this.addedCount:t<0&&(t=n+this.removed.length+t-this.addedCount),this.index=t<0?0:t,this}}class U{constructor(e){this.sorted=e}}const q=Object.freeze({reset:1,splice:2,optimized:3}),W=new z(0,g,0);W.reset=!0;const Q=[W];var J;function K(e,t,n,s,i,r){let o=0,a=0;const l=Math.min(n-t,r-i);if(0===t&&0===i&&(o=function(e,t,n){for(let s=0;s<n;++s)if(e[s]!==t[s])return s;return n}(e,s,l)),n===e.length&&r===s.length&&(a=function(e,t,n){let s=e.length,i=t.length,r=0;for(;r<n&&e[--s]===t[--i];)r++;return r}(e,s,l-o)),i+=o,r-=a,(n-=a)-(t+=o)==0&&r-i==0)return g;if(t===n){const e=new z(t,[],0);for(;i<r;)e.removed.push(s[i++]);return[e]}if(i===r)return[new z(t,[],n-t)];const c=function(e){let t=e.length-1,n=e[0].length-1,s=e[t][n];const i=[];for(;t>0||n>0;){if(0===t){i.push(J.add),n--;continue}if(0===n){i.push(J.delete),t--;continue}const r=e[t-1][n-1],o=e[t-1][n],a=e[t][n-1];let l;l=o<a?o<r?o:r:a<r?a:r,l===r?(r===s?i.push(J.leave):(i.push(J.update),s=r),t--,n--):l===o?(i.push(J.delete),t--,s=o):(i.push(J.add),n--,s=a)}return i.reverse()}(function(e,t,n,s,i,r){const o=r-i+1,a=n-t+1,l=new Array(o);let c,d;for(let e=0;e<o;++e)l[e]=new Array(a),l[e][0]=e;for(let e=0;e<a;++e)l[0][e]=e;for(let n=1;n<o;++n)for(let r=1;r<a;++r)e[t+r-1]===s[i+n-1]?l[n][r]=l[n-1][r-1]:(c=l[n-1][r]+1,d=l[n][r-1]+1,l[n][r]=c<d?c:d);return l}(e,t,n,s,i,r)),d=[];let h,u=t,p=i;for(let e=0;e<c.length;++e)switch(c[e]){case J.leave:void 0!==h&&(d.push(h),h=void 0),u++,p++;break;case J.update:void 0===h&&(h=new z(u,[],0)),h.addedCount++,u++,h.removed.push(s[p]),p++;break;case J.add:void 0===h&&(h=new z(u,[],0)),h.addedCount++,u++;break;case J.delete:void 0===h&&(h=new z(u,[],0)),h.removed.push(s[p]),p++}return void 0!==h&&d.push(h),d}function X(e,t){let n=!1,s=0;for(let l=0;l<t.length;l++){const c=t[l];if(c.index+=s,n)continue;const d=(i=e.index,r=e.index+e.removed.length,o=c.index,a=c.index+c.addedCount,r<o||a<i?-1:r===o||a===i?0:i<o?r<a?r-o:a-o:a<r?a-i:r-i);if(d>=0){t.splice(l,1),l--,s-=c.addedCount-c.removed.length,e.addedCount+=c.addedCount-d;const i=e.removed.length+c.removed.length-d;if(e.addedCount||i){let t=c.removed;if(e.index<c.index){const n=e.removed.slice(0,c.index-e.index);n.push(...t),t=n}if(e.index+e.removed.length>c.index+c.addedCount){const n=e.removed.slice(c.index+c.addedCount-e.index);t.push(...n)}e.removed=t,c.index<e.index&&(e.index=c.index)}else n=!0}else if(e.index<c.index){n=!0,t.splice(l,0,e),l++;const i=e.addedCount-e.removed.length;c.index+=i,s+=i}}var i,r,o,a;n||t.push(e)}!function(e){e[e.leave=0]="leave",e[e.update=1]="update",e[e.add=2]="add",e[e.delete=3]="delete"}(J||(J={}));let G=Object.freeze({support:q.optimized,normalize:(e,t,n)=>void 0===e?void 0===n?g:function(e,t){let n=[];const s=[];for(let e=0,n=t.length;e<n;e++)X(t[e],s);for(let t=0,i=s.length;t<i;++t){const i=s[t];1!==i.addedCount||1!==i.removed.length?n=n.concat(K(e,i.index,i.index+i.addedCount,i.removed,0,i.removed.length)):i.removed[0]!==e[i.index]&&n.push(i)}return n}(t,n):Q,pop(e,t,n,s){const i=e.length>0,r=n.apply(e,s);return i&&t.addSplice(new z(e.length,[r],0)),r},push(e,t,n,s){const i=n.apply(e,s);return t.addSplice(new z(e.length-s.length,[],s.length).adjustTo(e)),i},reverse(e,t,n,s){const i=n.apply(e,s);e.sorted++;const r=[];for(let t=e.length-1;t>=0;t--)r.push(t);return t.addSort(new U(r)),i},shift(e,t,n,s){const i=e.length>0,r=n.apply(e,s);return i&&t.addSplice(new z(0,[r],0)),r},sort(e,t,n,s){const i=new Map;for(let t=0,n=e.length;t<n;++t){const n=i.get(e[t])||[];i.set(e[t],[...n,t])}const r=n.apply(e,s);e.sorted++;const o=[];for(let t=0,n=e.length;t<n;++t){const n=i.get(e[t]);o.push(n[0]),i.set(e[t],n.splice(1))}return t.addSort(new U(o)),r},splice(e,t,n,s){const i=n.apply(e,s);return t.addSplice(new z(+s[0],i,s.length>2?s.length-2:0).adjustTo(e)),i},unshift(e,t,n,s){const i=n.apply(e,s);return t.addSplice(new z(0,[],s.length).adjustTo(e)),i}});const Y=Object.freeze({reset:Q,setDefaultStrategy(e){G=e}});function Z(e,t,n,s=!0){Reflect.defineProperty(e,t,{value:n,enumerable:!1,writable:s})}class ee extends R{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,D.notify(e,"length"))}},this.subscribe(e)}return e}get sortObserver(){let e=this._sortObserver;if(void 0===e){const t=this.subject;this._sortObserver=e={sorted:t.sorted,handleChange(){this.sorted!==t.sorted&&(this.sorted=t.sorted,D.notify(e,"sorted"))}},this.subscribe(e)}return e}constructor(e){super(e),this.oldCollection=void 0,this.splices=void 0,this.sorts=void 0,this.needsQueue=!0,this._strategy=null,this._lengthObserver=void 0,this._sortObserver=void 0,this.call=this.flush,Z(e,"$fastController",this)}subscribe(e){this.flush(),super.subscribe(e)}addSplice(e){void 0===this.splices?this.splices=[e]:this.splices.push(e),this.enqueue()}addSort(e){void 0===this.sorts?this.sorts=[e]:this.sorts.push(e),this.enqueue()}reset(e){this.oldCollection=e,this.enqueue()}flush(){var e;const t=this.splices,n=this.sorts,s=this.oldCollection;void 0===t&&void 0===s&&void 0===n||(this.needsQueue=!0,this.splices=void 0,this.sorts=void 0,this.oldCollection=void 0,void 0!==n?this.notify(n):this.notify((null!==(e=this._strategy)&&void 0!==e?e:G).normalize(s,this.subject,t)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,V.enqueue(this))}}let te=!1;const ne=Object.freeze({sorted:0,enable(){if(te)return;te=!0,D.setArrayObserverFactory((e=>new ee(e)));const e=Array.prototype;e.$fastPatch||(Z(e,"$fastPatch",1),Z(e,"sorted",0),[e.pop,e.push,e.reverse,e.shift,e.sort,e.splice,e.unshift].forEach((t=>{e[t.name]=function(...e){var n;const s=this.$fastController;return void 0===s?t.apply(this,e):(null!==(n=s.strategy)&&void 0!==n?n:G)[t.name](this,s,t,e)}})))}});function se(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(ne.enable(),t=D.getNotifier(e)),D.track(t.lengthObserver,"length"),e.length}function ie(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(ne.enable(),t=D.getNotifier(e)),D.track(t.sortObserver,"sorted"),e.sorted}class re{constructor(e,t,n=!1){this.evaluate=e,this.policy=t,this.isVolatile=n}}class oe extends re{createObserver(e){return D.binding(this.evaluate,e,this.isVolatile)}}function ae(e,t,n=D.isVolatileBinding(e)){return new oe(e,t,n)}function le(e,t){const n=new oe(e);return n.options=t,n}class ce extends re{createObserver(){return this}bind(e){return this.evaluate(e.source,e.context)}}function de(e,t){return new ce(e,t)}function he(e){return d(e)?ae(e):e instanceof re?e:de((()=>e))}m(ce);const ue=b(),pe=Object.freeze({getForInstance:ue.getForInstance,getByType:ue.getByType,define:e=>(ue.register({type:e}),e)});function fe(){return function(e){pe.define(e)}}function ge(e,t,n){t.source.style.setProperty(e.targetAspect,n.bind(t))}class be{constructor(e,t){this.dataBinding=e,this.targetAspect=t}createCSS(e){return e(this),`var(${this.targetAspect})`}addedCallback(e){var t;const n=e.source;if(!n.$cssBindings){n.$cssBindings=new Map;const e=n.setAttribute;n.setAttribute=(t,s)=>{e.call(n,t,s),"style"===t&&n.$cssBindings.forEach(((e,t)=>ge(t,e.controller,e.observer)))}}const s=null!==(t=e[this.targetAspect])&&void 0!==t?t:e[this.targetAspect]=this.dataBinding.createObserver(this,this);s.controller=e,e.source.$cssBindings.set(this,{controller:e,observer:s})}connectedCallback(e){ge(this,e,e[this.targetAspect])}removedCallback(e){e.source.$cssBindings&&e.source.$cssBindings.delete(this)}handleChange(e,t){ge(this,t.controller,t)}}let ve;function me(e){return e.map((e=>e instanceof ye?me(e.styles):[e])).reduce(((e,t)=>e.concat(t)),[])}pe.define(be);class ye{get strategy(){return null===this._strategy&&this.withStrategy(ve),this._strategy}constructor(e){this.styles=e,this.targets=new WeakSet,this._strategy=null,this.behaviors=e.map((e=>e instanceof ye?e.behaviors:null)).reduce(((e,t)=>null===t?e:null===e?t:e.concat(t)),null)}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(me(this.styles)),this}static setDefaultStrategy(e){ve=e}static normalize(e){return void 0===e?void 0:Array.isArray(e)?new ye(e):e instanceof ye?e:new ye([e])}}ye.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;const we=`${Math.random().toString(36).substring(2,8)}`;let Ce=0;const Se=()=>`--v${we}${++Ce}`;function Te(e,t){const n=[];let s="";const i=[],r=e=>{i.push(e)};for(let i=0,o=e.length-1;i<o;++i){s+=e[i];let o=t[i];d(o)?o=new be(ae(o),Se()).createCSS(r):o instanceof re?o=new be(o,Se()).createCSS(r):void 0!==pe.getForInstance(o)&&(o=o.createCSS(r)),o instanceof ye||o instanceof CSSStyleSheet?(""!==s.trim()&&(n.push(s),s=""),n.push(o)):s+=o}return s+=e[e.length-1],""!==s.trim()&&n.push(s),{styles:n,behaviors:i}}const Oe=(e,...t)=>{const{styles:n,behaviors:s}=Te(e,t),i=new ye(n);return s.length?i.withBehaviors(...s):i};class $e{constructor(e,t){this.behaviors=t,this.css="";const n=e.reduce(((e,t)=>(h(t)?this.css+=t:e.push(t),e)),[]);n.length&&(this.styles=new ye(n))}createCSS(e){return this.behaviors.forEach(e),this.styles&&e(this),this.css}addedCallback(e){e.addStyles(this.styles)}removedCallback(e){e.removeStyles(this.styles)}}pe.define($e),Oe.partial=(e,...t)=>{const{styles:n,behaviors:s}=Te(e,t);return new $e(n,s)};const xe=`fast-${Math.random().toString(36).substring(2,8)}`,Be=`${xe}{`,Ne=`}${xe}`,ke=Ne.length;let Ae=0;const Ee=()=>`${xe}-${++Ae}`,Me=Object.freeze({interpolation:e=>`${Be}${e}${Ne}`,attribute:e=>`${Ee()}="${Be}${e}${Ne}"`,comment:e=>`\x3c!--${Be}${e}${Ne}--\x3e`}),Ie=Object.freeze({parse(e,t){const n=e.split(Be);if(1===n.length)return null;const s=[];for(let e=0,i=n.length;e<i;++e){const i=n[e],r=i.indexOf(Ne);let o;if(-1===r)o=i;else{const e=i.substring(0,r);s.push(t[e]),o=i.substring(r+ke)}""!==o&&s.push(o)}return s}}),Re=b(),je=Object.freeze({getForInstance:Re.getForInstance,getByType:Re.getByType,define:(e,t)=>((t=t||{}).type=e,Re.register(t),e),assignAspect(e,t){if(t)switch(e.sourceAspect=t,t[0]){case":":e.targetAspect=t.substring(1),e.aspectType="classList"===e.targetAspect?y.tokenList:y.property;break;case"?":e.targetAspect=t.substring(1),e.aspectType=y.booleanAttribute;break;case"@":e.targetAspect=t.substring(1),e.aspectType=y.event;break;default:e.targetAspect=t,e.aspectType=y.attribute}else e.aspectType=y.content}});function Ve(e){return function(t){je.define(t,e)}}class _e{constructor(e){this.options=e}createHTML(e){return Me.attribute(e(this))}createBehavior(){return this}}m(_e);const De=e=>1===e.nodeType,Fe=e=>e?t=>1===t.nodeType&&t.matches(e):De;class Le extends _e{get id(){return this._id}set id(e){this._id=e,this._controllerProperty=`${e}-c`}bind(e){const t=e.targets[this.targetNodeId];t[this._controllerProperty]=e,this.updateTarget(e.source,this.computeNodes(t)),this.observe(t),e.onUnbind(this)}unbind(e){const t=e.targets[this.targetNodeId];this.updateTarget(e.source,g),this.disconnect(t),t[this._controllerProperty]=null}getSource(e){return e[this._controllerProperty].source}updateTarget(e,t){e[this.options.property]=t}computeNodes(e){let t=this.getNodes(e);return"filter"in this.options&&(t=t.filter(this.options.filter)),t}}class Pe extends Le{constructor(e){super(e),this.observerProperty=Symbol(),this.handleEvent=(e,t)=>{const n=t.target;this.updateTarget(this.getSource(n),this.computeNodes(n))},e.childList=!0}observe(e){let t=e[this.observerProperty];t||(t=new MutationObserver(this.handleEvent),t.toJSON=u,e[this.observerProperty]=t),t.target=e,t.observe(e,this.options)}disconnect(e){const t=e[this.observerProperty];t.target=null,t.disconnect()}getNodes(e){return"selector"in this.options?Array.from(e.querySelectorAll(this.options.selector)):Array.from(e.childNodes)}}function He(e){return h(e)&&(e={property:e}),new Pe(e)}je.define(Pe);const ze=/fe-b\$\$start\$\$(\d+)\$\$(.+)\$\$fe-b/,Ue=/fe-b\$\$end\$\$(\d+)\$\$(.+)\$\$fe-b/,qe=/fe-repeat\$\$start\$\$(\d+)\$\$fe-repeat/,We=/fe-repeat\$\$end\$\$(\d+)\$\$fe-repeat/,Qe=/^(?:.{0,1000})fe-eb\$\$start\$\$(.+?)\$\$fe-eb/,Je=/fe-eb\$\$end\$\$(.{0,1000})\$\$fe-eb(?:.{0,1000})$/;function Ke(e){return e&&e.nodeType===Node.COMMENT_NODE}const Xe=Object.freeze({attributeMarkerName:"data-fe-b",compactAttributeMarkerName:"data-fe-c",attributeBindingSeparator:" ",contentBindingStartMarker:(e,t)=>`fe-b$$start$$${e}$$${t}$$fe-b`,contentBindingEndMarker:(e,t)=>`fe-b$$end$$${e}$$${t}$$fe-b`,repeatStartMarker:e=>`fe-repeat$$start$$${e}$$fe-repeat`,repeatEndMarker:e=>`fe-repeat$$end$$${e}$$fe-repeat`,isContentBindingStartMarker:e=>ze.test(e),isContentBindingEndMarker:e=>Ue.test(e),isRepeatViewStartMarker:e=>qe.test(e),isRepeatViewEndMarker:e=>We.test(e),isElementBoundaryStartMarker:e=>Ke(e)&&Qe.test(e.data.trim()),isElementBoundaryEndMarker:e=>Ke(e)&&Je.test(e.data),parseAttributeBinding(e){const t=e.getAttribute(this.attributeMarkerName);return null===t?t:t.split(this.attributeBindingSeparator).map((e=>parseInt(e)))},parseEnumeratedAttributeBinding(e){const t=[],n=this.attributeMarkerName.length+1,s=`${this.attributeMarkerName}-`;for(const i of e.getAttributeNames())if(i.startsWith(s)){const e=Number(i.slice(n));if(Number.isNaN(e))throw f.error(1601,{name:i,expectedFormat:`${s}<number>`});t.push(e)}return 0===t.length?null:t},parseCompactAttributeBinding(e){const t=`${this.compactAttributeMarkerName}-`,n=e.getAttributeNames().find((e=>e.startsWith(t)));if(!n)return null;const s=n.slice(t.length).split("-"),i=parseInt(s[0],10),r=parseInt(s[1],10);if(2!==s.length||Number.isNaN(i)||Number.isNaN(r)||i<0||r<1)throw f.error(1604,{name:n,expectedFormat:`${this.compactAttributeMarkerName}-{index}-{count}`});const o=[];for(let e=0;e<r;e++)o.push(i+e);return o},parseContentBindingStartMarker:e=>Ze(ze,e),parseContentBindingEndMarker:e=>Ze(Ue,e),parseRepeatStartMarker:e=>Ge(qe,e),parseRepeatEndMarker:e=>Ge(We,e),parseElementBoundaryStartMarker:e=>Ye(Qe,e.trim()),parseElementBoundaryEndMarker:e=>Ye(Je,e)});function Ge(e,t){const n=e.exec(t);return null===n?n:parseInt(n[1])}function Ye(e,t){const n=e.exec(t);return null===n?n:n[1]}function Ze(e,t){const n=e.exec(t);return null===n?n:[parseInt(n[1]),n[2]]}const et=Symbol.for("fe-hydration");function tt(e){return e[et]===et}const nt="defer-hydration";class st extends Error{constructor(e,t,n){super(e),this.factories=t,this.node=n}}function it(e){return e.nodeType===Node.COMMENT_NODE}function rt(e){return e.nodeType===Node.TEXT_NODE}function ot(e,t){const n=document.createRange();return n.setStart(e,0),n.setEnd(t,it(t)||rt(t)?t.data.length:t.childNodes.length),n}function at(e,t,n,s){var i,r;const o=null!==(r=null!==(i=Xe.parseAttributeBinding(e))&&void 0!==i?i:Xe.parseEnumeratedAttributeBinding(e))&&void 0!==r?r:Xe.parseCompactAttributeBinding(e);if(null!==o){for(const i of o){const r=t[i+s];if(!r)throw new st(`HydrationView was unable to successfully target factory on ${e.nodeName} inside ${e.getRootNode().host.nodeName}. This likely indicates a template mismatch between SSR rendering and hydration.`,t,e);ct(r,e,n)}e.removeAttribute(Xe.attributeMarkerName)}}function lt(e,t,n,s,i,r){if(Xe.isElementBoundaryStartMarker(e))!function(e,t){const n=Xe.parseElementBoundaryStartMarker(e.data);let s=t.nextSibling();for(;null!==s;){if(it(s)){const e=Xe.parseElementBoundaryEndMarker(s.data);if(e&&e===n)break}s=t.nextSibling()}}(e,t);else if(Xe.isContentBindingStartMarker(e.data)){const o=Xe.parseContentBindingStartMarker(e.data);if(null===o)return;const[a,l]=o,c=n[a+r],d=[];let h=t.nextSibling();e.data="";const u=h;for(;null!==h;){if(it(h)){const e=Xe.parseContentBindingEndMarker(h.data);if(e&&e[1]===l)break}d.push(h),h=t.nextSibling()}if(null===h){const t=e.getRootNode();throw new Error(`Error hydrating Comment node inside "${function(e){return e instanceof DocumentFragment&&"mode"in e}(t)?t.host.nodeName:t.nodeName}".`)}if(h.data="",1===d.length&&rt(d[0]))ct(c,d[0],s);else{h!==u&&null!==h.previousSibling&&(i[c.targetNodeId]={first:u,last:h.previousSibling});ct(c,h.parentNode.insertBefore(document.createTextNode(""),h),s)}}}function ct(e,t,n){if(void 0===e.targetNodeId)throw new Error("Factory could not be target to the node");n[e.targetNodeId]=t}var dt;function ht(e,t){const n=e.parentNode;let s,i=e;for(;i!==t;){if(s=i.nextSibling,!s)throw new Error(`Unmatched first/last child inside "${t.getRootNode().host.nodeName}".`);n.removeChild(i),i=s}n.removeChild(t)}class ut{constructor(){this.index=0,this.length=0}get event(){return H.getEvent()}get isEven(){return this.index%2==0}get isOdd(){return this.index%2!=0}get isFirst(){return 0===this.index}get isInMiddle(){return!this.isFirst&&!this.isLast}get isLast(){return this.index===this.length-1}eventDetail(){return this.event.detail}eventTarget(){return this.event.target}}class pt extends ut{constructor(e,t,n){super(),this.fragment=e,this.factories=t,this.targets=n,this.behaviors=null,this.unbindables=[],this.source=null,this.isBound=!1,this.sourceLifetime=_.unknown,this.context=this,this.firstChild=e.firstChild,this.lastChild=e.lastChild}appendTo(e){e.appendChild(this.fragment)}insertBefore(e){if(this.fragment.hasChildNodes())e.parentNode.insertBefore(this.fragment,e);else{const t=this.lastChild;if(e.previousSibling===t)return;const n=e.parentNode;let s,i=this.firstChild;for(;i!==t;)s=i.nextSibling,n.insertBefore(i,e),i=s;n.insertBefore(t,e)}}remove(){const e=this.fragment,t=this.lastChild;let n,s=this.firstChild;for(;s!==t;)n=s.nextSibling,e.appendChild(s),s=n;e.appendChild(t)}dispose(){ht(this.firstChild,this.lastChild),this.unbind()}onUnbind(e){this.unbindables.push(e)}bind(e,t=this){if(this.source===e)return;let n=this.behaviors;if(null===n){this.source=e,this.context=t,this.behaviors=n=new Array(this.factories.length);const s=this.factories;for(let e=0,t=s.length;e<t;++e){const t=s[e].createBehavior();t.bind(this),n[e]=t}}else{null!==this.source&&this.evaluateUnbindables(),this.isBound=!1,this.source=e,this.context=t;for(let e=0,t=n.length;e<t;++e)n[e].bind(this)}this.isBound=!0}unbind(){this.isBound&&null!==this.source&&(this.evaluateUnbindables(),this.source=null,this.context=this,this.isBound=!1)}evaluateUnbindables(){const e=this.unbindables;for(let t=0,n=e.length;t<n;++t)e[t].unbind(this);e.length=0}static disposeContiguousBatch(e){if(0!==e.length){ht(e[0].firstChild,e[e.length-1].lastChild);for(let t=0,n=e.length;t<n;++t)e[t].unbind()}}}m(pt),D.defineProperty(pt.prototype,"index"),D.defineProperty(pt.prototype,"length");const ft="unhydrated",gt="hydrating",bt="hydrated";class vt extends Error{constructor(e,t,n,s){super(e),this.factory=t,this.fragment=n,this.templateString=s}}dt=et,m(class extends ut{get hydrationStage(){return this._hydrationStage}get targets(){return this._targets}get bindingViewBoundaries(){return this._bindingViewBoundaries}constructor(e,t,n,s){super(),this.firstChild=e,this.lastChild=t,this.sourceTemplate=n,this.hostBindingTarget=s,this[dt]=et,this.context=this,this.source=null,this.isBound=!1,this.sourceLifetime=_.unknown,this.unbindables=[],this.fragment=null,this.behaviors=null,this._hydrationStage=ft,this._bindingViewBoundaries={},this._targets={},this.factories=n.compile().factories}insertBefore(e){if(null!==this.fragment)if(this.fragment.hasChildNodes())e.parentNode.insertBefore(this.fragment,e);else{const t=this.lastChild;if(e.previousSibling===t)return;const n=e.parentNode;let s,i=this.firstChild;for(;i!==t;)s=i.nextSibling,n.insertBefore(i,e),i=s;n.insertBefore(t,e)}}appendTo(e){null!==this.fragment&&e.appendChild(this.fragment)}remove(){const e=this.fragment||(this.fragment=document.createDocumentFragment()),t=this.lastChild;let n,s=this.firstChild;for(;s!==t;){if(n=s.nextSibling,!n)throw new Error(`Unmatched first/last child inside "${t.getRootNode().host.nodeName}".`);e.appendChild(s),s=n}e.appendChild(t)}bind(e,t=this){var n;if(this.hydrationStage!==bt&&(this._hydrationStage=gt),this.source===e)return;let s=this.behaviors;if(null===s){this.source=e,this.context=t;try{const{targets:e,boundaries:t}=function(e,t,n){const s=ot(e,t),i=s.commonAncestorContainer,r=function(e){let t=0;for(let n=0,s=e.length;n<s&&"h"===e[n].targetNodeId;++n)t++;return t}(n),o=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_COMMENT+NodeFilter.SHOW_TEXT,{acceptNode:e=>0===s.comparePoint(e,0)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}),a={},l={};let c=o.currentNode=e;for(;null!==c;){switch(c.nodeType){case Node.ELEMENT_NODE:at(c,n,a,r);break;case Node.COMMENT_NODE:lt(c,o,n,a,l,r)}c=o.nextNode()}return s.detach(),{targets:a,boundaries:l}}(this.firstChild,this.lastChild,this.factories);this._targets=e,this._bindingViewBoundaries=t}catch(e){if(e instanceof st){let t=this.sourceTemplate.html;"string"!=typeof t&&(t=t.innerHTML),e.templateString=t}throw e}this.behaviors=s=new Array(this.factories.length);const i=this.factories;for(let e=0,t=i.length;e<t;++e){const t=i[e];if("h"===t.targetNodeId&&this.hostBindingTarget&&ct(t,this.hostBindingTarget,this._targets),!(t.targetNodeId in this.targets)){let e=this.sourceTemplate.html;"string"!=typeof e&&(e=e.innerHTML);const s=(null===(n=this.firstChild)||void 0===n?void 0:n.getRootNode()).host,i=t,r=[`HydrationView was unable to successfully target bindings inside "<${((null==s?void 0:s.nodeName)||"unknown").toLowerCase()}>".`,"\nMismatch Details:",` - Expected target node ID: "${t.targetNodeId}"`,` - Available target IDs: [${Object.keys(this.targets).join(", ")||"none"}]`];throw t.targetTagName&&r.push(` - Expected tag name: "${t.targetTagName}"`),i.sourceAspect&&r.push(` - Source aspect: "${i.sourceAspect}"`),void 0!==i.aspectType&&r.push(` - Aspect type: ${i.aspectType}`),r.push("\nThis usually means:"," 1. The server-rendered HTML doesn't match the client template"," 2. The hydration markers are missing or corrupted"," 3. The DOM structure was modified before hydration",`\nTemplate: ${e.slice(0,200)}${e.length>200?"...":""}`),new vt(r.join("\n"),t,ot(this.firstChild,this.lastChild).cloneContents(),e)}{const n=t.createBehavior();n.bind(this),s[e]=n}}}else{null!==this.source&&this.evaluateUnbindables(),this.isBound=!1,this.source=e,this.context=t;for(let e=0,t=s.length;e<t;++e)s[e].bind(this)}this.isBound=!0,this._hydrationStage=bt}unbind(){this.isBound&&null!==this.source&&(this.evaluateUnbindables(),this.source=null,this.context=this,this.isBound=!1)}dispose(){ht(this.firstChild,this.lastChild),this.unbind()}onUnbind(e){this.unbindables.push(e)}evaluateUnbindables(){const e=this.unbindables;for(let t=0,n=e.length;t<n;++t)e[t].unbind(this);e.length=0}});const mt={[y.attribute]:O.setAttribute,[y.booleanAttribute]:O.setBooleanAttribute,[y.property]:(e,t,n)=>e[t]=n,[y.content]:function(e,t,n,s){if(null==n&&(n=""),function(e){return void 0!==e.create}(n)){e.textContent="";let t=e.$fastView;if(void 0===t)if(tt(s)&&tt(n)&&void 0!==s.bindingViewBoundaries[this.targetNodeId]&&s.hydrationStage!==bt){const e=s.bindingViewBoundaries[this.targetNodeId];t=n.hydrate(e.first,e.last)}else t=n.create();else e.$fastTemplate!==n&&(t.isComposed&&(t.remove(),t.unbind()),t=n.create());t.isComposed?t.needsBindOnly&&(t.needsBindOnly=!1,t.bind(s.source,s.context)):(t.isComposed=!0,t.bind(s.source,s.context),t.insertBefore(e),e.$fastView=t,e.$fastTemplate=n)}else{const t=e.$fastView;void 0!==t&&t.isComposed&&(t.isComposed=!1,t.remove(),t.needsBindOnly?t.needsBindOnly=!1:t.unbind()),e.textContent=n}},[y.tokenList]:function(e,t,n){var s;const i=`${this.id}-t`,r=null!==(s=e[i])&&void 0!==s?s:e[i]={v:0,cv:Object.create(null)},o=r.cv;let a=r.v;const l=e[t];if(null!=n&&n.length){const e=n.split(/\s+/);for(let t=0,n=e.length;t<n;++t){const n=e[t];""!==n&&(o[n]=a,l.add(n))}}if(r.v=a+1,0!==a){a-=1;for(const e in o)o[e]===a&&l.remove(e)}},[y.event]:()=>{}};class yt{constructor(e){this.dataBinding=e,this.updateTarget=null,this.aspectType=y.content}createHTML(e){return Me.interpolation(e(this))}createBehavior(){var e;if(null===this.updateTarget){const t=mt[this.aspectType],n=null!==(e=this.dataBinding.policy)&&void 0!==e?e:this.policy;if(!t)throw f.error(c.unsupportedBindingBehavior);this.data=`${this.id}-d`,this.updateTarget=n.protect(this.targetTagName,this.aspectType,this.targetAspect,t)}return this}bind(e){var t;const n=e.targets[this.targetNodeId],s=tt(e)&&e.hydrationStage&&e.hydrationStage!==bt;switch(this.aspectType){case y.event:n[this.data]=e,n.addEventListener(this.targetAspect,this,this.dataBinding.options);break;case y.content:e.onUnbind(this);default:const i=null!==(t=n[this.data])&&void 0!==t?t:n[this.data]=this.dataBinding.createObserver(this,this);if(i.target=n,i.controller=e,s&&(this.aspectType===y.attribute||this.aspectType===y.booleanAttribute)){i.bind(e);break}this.updateTarget(n,this.targetAspect,i.bind(e),e)}}unbind(e){const t=e.targets[this.targetNodeId].$fastView;void 0!==t&&t.isComposed&&(t.unbind(),t.needsBindOnly=!0)}handleEvent(e){const t=e.currentTarget[this.data];if(t.isBound){H.setEvent(e);const n=this.dataBinding.evaluate(t.source,t.context);H.setEvent(null),!0!==n&&e.preventDefault()}}handleChange(e,t){const n=t.target,s=t.controller;this.updateTarget(n,this.targetAspect,t.bind(s),s)}}je.define(yt,{aspected:!0});const wt=(e,t)=>`${e}.${t}`,Ct={},St={index:0,node:null};function Tt(e){e.startsWith("fast-")||f.warn(c.hostBindingWithoutHost,{name:e})}const Ot=new Proxy(document.createElement("div"),{get(e,t){Tt(t);const n=Reflect.get(e,t);return d(n)?n.bind(e):n},set:(e,t,n)=>(Tt(t),Reflect.set(e,t,n))});class $t{constructor(e,t,n){this.fragment=e,this.directives=t,this.policy=n,this.proto=null,this.nodeIds=new Set,this.descriptors={},this.factories=[]}addFactory(e,t,n,s,i){var r,o;this.nodeIds.has(n)||(this.nodeIds.add(n),this.addTargetDescriptor(t,n,s)),e.id=null!==(r=e.id)&&void 0!==r?r:Ee(),e.targetNodeId=n,e.targetTagName=i,e.policy=null!==(o=e.policy)&&void 0!==o?o:this.policy,this.factories.push(e)}freeze(){return this.proto=Object.create(null,this.descriptors),this}addTargetDescriptor(e,t,n){const s=this.descriptors;if("r"===t||"h"===t||s[t])return;if(!s[e]){const t=e.lastIndexOf("."),n=e.substring(0,t),s=parseInt(e.substring(t+1));this.addTargetDescriptor(n,e,s)}let i=Ct[t];if(!i){const s=`_${t}`;Ct[t]=i={get(){var t;return null!==(t=this[s])&&void 0!==t?t:this[s]=this[e].childNodes[n]}}}s[t]=i}createView(e){const t=this.fragment.cloneNode(!0),n=Object.create(this.proto);n.r=t,n.h=null!=e?e:Ot;for(const e of this.nodeIds)n[e];return new pt(t,this.factories,n)}}function xt(e,t,n,s,i,r=!1){const o=n.attributes,a=e.directives;for(let l=0,c=o.length;l<c;++l){const d=o[l],h=d.value,u=Ie.parse(h,a);let p=null;null===u?r&&(p=new yt(de((()=>h),e.policy)),je.assignAspect(p,d.name)):p=At.aggregate(u,e.policy),null!==p&&(n.removeAttributeNode(d),l--,c--,e.addFactory(p,t,s,i,n.tagName))}}function Bt(e,t,n){let s=0,i=t.firstChild;for(;i;){const t=Nt(e,n,i,s);i=t.node,s=t.index}}function Nt(e,t,n,s){const i=wt(t,s);switch(n.nodeType){case 1:xt(e,t,n,i,s),Bt(e,n,i);break;case 3:return function(e,t,n,s,i){const r=Ie.parse(t.textContent,e.directives);if(null===r)return St.node=t.nextSibling,St.index=i+1,St;let o,a=o=t;for(let t=0,l=r.length;t<l;++t){const l=r[t];0!==t&&(i++,s=wt(n,i),o=a.parentNode.insertBefore(document.createTextNode(""),a.nextSibling)),h(l)?o.textContent=l:(o.textContent=" ",je.assignAspect(l),e.addFactory(l,n,s,i,null)),a=o}return St.index=i+1,St.node=a.nextSibling,St}(e,n,t,i,s);case 8:const r=Ie.parse(n.data,e.directives);null!==r&&e.addFactory(At.aggregate(r),t,i,s,null)}return St.index=s+1,St.node=n.nextSibling,St}const kt="TEMPLATE",At={compile(e,t,n=O.policy){let s;if(h(e)){s=document.createElement(kt),s.innerHTML=n.createHTML(e);const t=s.content.firstElementChild;null!==t&&t.tagName===kt&&(s=t)}else s=e;s.content.firstChild||s.content.lastChild||s.content.appendChild(document.createComment(""));const i=document.adoptNode(s.content),r=new $t(i,t,n);var o,a;return xt(r,"",s,"h",0,!0),o=i.firstChild,a=t,(o&&8==o.nodeType&&null!==Ie.parse(o.data,a)||1===i.childNodes.length&&Object.keys(t).length>0)&&i.insertBefore(document.createComment(""),i.firstChild),Bt(r,i,"r"),St.node=null,r.freeze()},setDefaultStrategy(e){this.compile=e},aggregate(e,t=O.policy){if(1===e.length)return e[0];let n,s,i=!1;const r=e.length,o=e.map((e=>h(e)?()=>e:(n=e.sourceAspect||n,i=i||e.dataBinding.isVolatile,s=s||e.dataBinding.policy,e.dataBinding.evaluate))),a=new yt(ae(((e,t)=>{let n="";for(let s=0;s<r;++s)n+=o[s](e,t);return n}),null!=s?s:t,i));return je.assignAspect(a,n),a}};class Et extends _e{bind(e){e.source[this.options]=e.targets[this.targetNodeId]}}je.define(Et);const Mt=e=>new Et(e);function It(e,t,n,s){return new(n||(n=Promise))((function(i,r){function o(e){try{l(s.next(e))}catch(e){r(e)}}function a(e){try{l(s.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((s=s.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const Rt="boolean",jt="reflect",Vt=Object.freeze({locate:v()}),_t={toView:e=>e?"true":"false",fromView:e=>!(null==e||"false"===e||!1===e||0===e)},Dt={toView:e=>"boolean"==typeof e?e.toString():"",fromView:e=>[null,void 0,void 0].includes(e)?null:_t.fromView(e)};function Ft(e){if(null==e)return null;const t=1*e;return isNaN(t)?null:t}const Lt={toView(e){const t=Ft(e);return t?t.toString():t},fromView:Ft};class Pt{constructor(e,t,n=t.toLowerCase(),s=jt,i){this.guards=new Set,this.Owner=e,this.name=t,this.attribute=n,this.mode=s,this.converter=i,this.fieldName=`_${t}`,this.callbackName=`${t}Changed`,this.hasCallback=this.callbackName in e.prototype,s===Rt&&void 0===i&&(this.converter=_t)}setValue(e,t){const n=e[this.fieldName],s=this.converter;void 0!==s&&(t=s.fromView(t)),n!==t&&(e[this.fieldName]=t,this.tryReflectToAttribute(e),this.hasCallback&&e[this.callbackName](n,t),e.$fastController.notify(this.name))}getValue(e){return D.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,n=this.guards;n.has(e)||"fromView"===t||V.enqueue((()=>{n.add(e);const s=e[this.fieldName];switch(t){case jt:const t=this.converter;O.setAttribute(e,this.attribute,void 0!==t?t.toView(s):s);break;case Rt:O.setBooleanAttribute(e,this.attribute,s)}n.delete(e)}))}static collect(e,...t){const n=[];t.push(Vt.locate(e));for(let s=0,i=t.length;s<i;++s){const i=t[s];if(void 0!==i)for(let t=0,s=i.length;t<s;++t){const s=i[t];h(s)?n.push(new Pt(e,s)):n.push(new Pt(e,s.property,s.attribute,s.mode,s.converter))}}return n}}function Ht(e,t){let n;function s(e,t){arguments.length>1&&(n.property=t),Vt.locate(e.constructor).push(n)}return arguments.length>1?(n={},void s(e,t)):(n=void 0===e?{}:e,s)}var zt;const Ut={mode:"open"},qt={},Wt=new Set,Qt=f.getById(l.elementRegistry,(()=>b())),Jt={deferAndHydrate:"defer-and-hydrate"};class Kt{get isDefined(){return this.platformDefined}constructor(e,t=e.definition){var n;this.platformDefined=!1,h(t)&&(t={name:t}),this.type=e,this.name=t.name,this.template=t.template,this.templateOptions=t.templateOptions,this.registry=null!==(n=t.registry)&&void 0!==n?n:customElements;const s=e.prototype,i=Pt.collect(e,t.attributes),r=new Array(i.length),o={},a={};for(let e=0,t=i.length;e<t;++e){const t=i[e];r[e]=t.attribute,o[t.name]=t,a[t.attribute]=t,D.defineProperty(s,t)}Reflect.defineProperty(e,"observedAttributes",{value:r,enumerable:!0}),this.attributes=i,this.propertyLookup=o,this.attributeLookup=a,this.shadowOptions=void 0===t.shadowOptions?Ut:null===t.shadowOptions?void 0:Object.assign(Object.assign({},Ut),t.shadowOptions),this.elementOptions=void 0===t.elementOptions?qt:Object.assign(Object.assign({},qt),t.elementOptions),this.styles=ye.normalize(t.styles),Qt.register(this),D.defineProperty(zt.isRegistered,this.name),zt.isRegistered[this.name]=this.type}define(e=this.registry){var t,n;const s=this.type;return e.get(this.name)||(this.platformDefined=!0,e.define(this.name,s,this.elementOptions),null===(n=null===(t=this.lifecycleCallbacks)||void 0===t?void 0:t.elementDidDefine)||void 0===n||n.call(t,this.name)),this}static compose(e,t){return Wt.has(e)||Qt.getByType(e)?new zt(class extends e{},t):new zt(e,t)}static registerBaseType(e){Wt.add(e)}static composeAsync(e,t){return new Promise((n=>{(Wt.has(e)||Qt.getByType(e))&&n(new zt(class extends e{},t));const s=new zt(e,t);D.getNotifier(s).subscribe({handleChange:()=>{var e,t;null===(t=null===(e=s.lifecycleCallbacks)||void 0===e?void 0:e.templateDidUpdate)||void 0===t||t.call(e,s.name),n(s)}},"template")}))}}zt=Kt,Kt.isRegistered={},Kt.getByType=Qt.getByType,Kt.getForInstance=Qt.getForInstance,Kt.registerAsync=e=>It(void 0,void 0,void 0,(function*(){return new Promise((t=>{zt.isRegistered[e]&&t(zt.isRegistered[e]),D.getNotifier(zt.isRegistered).subscribe({handleChange:()=>t(zt.isRegistered[e])},e)}))})),D.defineProperty(Kt.prototype,"template");const Xt=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/,Gt=Object.create(null);class Yt{constructor(e,t=Gt){this.html=e,this.factories=t}createHTML(e){const t=this.factories;for(const n in t)e(t[n]);return this.html}}function Zt(e,t,n,s=je.getForInstance(e)){if(s.aspected){const n=Xt.exec(t);null!==n&&je.assignAspect(e,n[2])}return e.createHTML(n)}Yt.empty=new Yt(""),je.define(Yt);class en{constructor(e,t={},n){this.policy=n,this.result=null,this.html=e,this.factories=t}compile(){return null===this.result&&(this.result=At.compile(this.html,this.factories,this.policy)),this.result}create(e){return this.compile().createView(e)}inline(){return new Yt(h(this.html)?this.html:this.html.innerHTML,this.factories)}withPolicy(e){if(this.result)throw f.error(c.cannotSetTemplatePolicyAfterCompilation);if(this.policy)throw f.error(c.onlySetTemplatePolicyOnce);return this.policy=e,this}render(e,t,n){const s=this.create(n);return s.bind(e),s.appendTo(t),s}static create(e,t,n){let s="";const i=Object.create(null),r=e=>{var t;const n=null!==(t=e.id)&&void 0!==t?t:e.id=Ee();return i[n]=e,n};for(let n=0,i=e.length-1;n<i;++n){const i=e[n];let o,a=t[n];if(s+=i,d(a))a=new yt(ae(a));else if(a instanceof re)a=new yt(a);else if(!(o=je.getForInstance(a))){const e=a;a=new yt(de((()=>e)))}s+=Zt(a,i,r,o)}return new en(s+e[e.length-1],i,n)}}m(en);const tn=(e,...t)=>{if(Array.isArray(e)&&Array.isArray(e.raw))return en.create(e,t);throw f.error(c.directCallToHTMLTagNotAllowed)};tn.partial=e=>new Yt(e);class nn{constructor(e){this.directive=e,this.location=null,this.controller=null,this.view=null,this.data=null,this.dataBindingObserver=e.dataBinding.createObserver(this,e),this.templateBindingObserver=e.templateBinding.createObserver(this,e)}bind(e){if(this.location=e.targets[this.directive.targetNodeId],this.controller=e,this.data=this.dataBindingObserver.bind(e),this.template=this.templateBindingObserver.bind(e),e.onUnbind(this),tt(this.template)&&tt(e)&&e.hydrationStage!==bt&&!this.view){const t=e.bindingViewBoundaries[this.directive.targetNodeId];t&&(this.view=this.template.hydrate(t.first,t.last),this.bindView(this.view))}else this.refreshView()}unbind(e){const t=this.view;null!==t&&t.isComposed&&(t.unbind(),t.needsBindOnly=!0)}handleChange(e,t){t===this.dataBindingObserver&&(this.data=this.dataBindingObserver.bind(this.controller)),(this.directive.templateBindingDependsOnData||t===this.templateBindingObserver)&&(this.template=this.templateBindingObserver.bind(this.controller)),this.refreshView()}bindView(e){e.isComposed?e.needsBindOnly&&(e.needsBindOnly=!1,e.bind(this.data)):(e.isComposed=!0,e.bind(this.data),e.insertBefore(this.location),e.$fastTemplate=this.template)}refreshView(){let e=this.view;const t=this.template;null===e?(this.view=e=t.create(),this.view.context.parent=this.controller.source,this.view.context.parentContext=this.controller.context):e.$fastTemplate!==t&&(e.isComposed&&(e.remove(),e.unbind()),this.view=e=t.create(),this.view.context.parent=this.controller.source,this.view.context.parentContext=this.controller.context),this.bindView(e)}}class sn{constructor(e,t,n){this.dataBinding=e,this.templateBinding=t,this.templateBindingDependsOnData=n}createHTML(e){return Me.comment(e(this))}createBehavior(){return new nn(this)}}je.define(sn);const rn=new Map,on={":model":e=>e},an=Symbol("RenderInstruction"),ln="default-view",cn=tn`
|
|
2
2
|
|
|
3
|
-
`;function Cs(e){return void 0===e?ws:e.template}function Ss(e,t){const s=[],i=[],{attributes:n,directives:r,content:o,policy:a}=null!=t?t:{};if(s.push(`<${e}`),n){const e=Object.getOwnPropertyNames(n);for(let t=0,r=e.length;t<r;++t){const r=e[t];0===t?s[0]=`${s[0]} ${r}="`:s.push(`" ${r}="`),i.push(n[r])}s.push('"')}if(r){s[s.length-1]+=" ";for(let e=0,t=r.length;e<t;++e){const t=r[e];s.push(e>0?"":" "),i.push(t)}}if(s[s.length-1]+=">",o&&c(o.create))i.push(o),s.push(`</${e}>`);else{const t=s.length-1;s[t]=`${s[t]}${null!=o?o:""}</${e}>`}return Nt.create(s,i,a)}function Ts(e){var t;const s=null!==(t=e.name)&&void 0!==t?t:ys;let i;if((n=e).element||n.tagName){let t=e.tagName;if(!t){const s=fs.getByType(e.element);if(!s)throw new Error("Invalid element for model rendering.");t=s.name}e.attributes||(e.attributes=vs),i=Ss(t,e)}else i=e.template;var n;return{brand:ms,type:e.type,name:s,template:i}}function $s(e){return e&&e.brand===ms}function xs(e,t){const s=bs.get(e);if(void 0!==s)return s[null!=t?t:ys]}function Os(e,t){if(e)return xs(e.constructor,t)}Object.freeze({instanceOf:$s,create:Ts,createElementTemplate:Ss,register:function(e){let t=bs.get(e.type);void 0===t&&bs.set(e.type,t=Object.create(null));const s=$s(e)?e:Ts(e);return t[s.name]=s},getByType:xs,getForInstance:Os});class Bs{constructor(e){this.node=e,e.$fastTemplate=this}get context(){return this}bind(e){}unbind(){}insertBefore(e){e.parentNode.insertBefore(this.node,e)}remove(){this.node.parentNode.removeChild(this.node)}create(){return this}hydrate(e,t){return this}}function Ns(e,t){let s,i;s=void 0===e?le((e=>e)):ce(e);let n=!1;if(void 0===t)n=!0,i=le(((e,t)=>{var i;const n=s.evaluate(e,t);return n instanceof Node?null!==(i=n.$fastTemplate)&&void 0!==i?i:new Bs(n):Cs(Os(n))}));else if(c(t))i=re(((e,i)=>{var n;let r=t(e,i);return d(r)?r=Cs(Os(s.evaluate(e,i),r)):r instanceof Node&&(r=null!==(n=r.$fastTemplate)&&void 0!==n?n:new Bs(r)),r}),void 0,!0);else if(d(t))n=!0,i=le(((e,i)=>{var n;const r=s.evaluate(e,i);return r instanceof Node?null!==(n=r.$fastTemplate)&&void 0!==n?n:new Bs(r):Cs(Os(r,t))}));else if(t instanceof ie){const e=t.evaluate;t.evaluate=(t,i)=>{var n;let r=e(t,i);return d(r)?r=Cs(Os(s.evaluate(t,i),r)):r instanceof Node&&(r=null!==(n=r.$fastTemplate)&&void 0!==n?n:new Bs(r)),r},i=t}else i=le(((e,s)=>t));return new gs(s,i,n)}class ks extends MutationObserver{constructor(e){super((function(e){this.callback.call(null,e.filter((e=>this.observedNodes.has(e.target))))})),this.callback=e,this.observedNodes=new Set}observe(e,t){this.observedNodes.add(e),super.observe(e,t)}unobserve(e){this.observedNodes.delete(e),this.observedNodes.size<1&&this.disconnect()}}Object.freeze({create(e){const t=[],s={};let i=null,n=!1;return{source:e,context:H.default,targets:s,get isBound(){return n},addBehaviorFactory(e,t){var s,i,n,r;const o=e;o.id=null!==(s=o.id)&&void 0!==s?s:Pe(),o.targetNodeId=null!==(i=o.targetNodeId)&&void 0!==i?i:Pe(),o.targetTagName=null!==(n=t.tagName)&&void 0!==n?n:null,o.policy=null!==(r=o.policy)&&void 0!==r?r:T.policy,this.addTarget(o.targetNodeId,t),this.addBehavior(o.createBehavior())},addTarget(e,t){s[e]=t},addBehavior(e){t.push(e),n&&e.bind(this)},onUnbind(e){null===i&&(i=[]),i.push(e)},connectedCallback(e){n||(n=!0,t.forEach((e=>e.bind(this))))},disconnectedCallback(e){n&&(n=!1,null!==i&&i.forEach((e=>e.unbind(this))))}}}});const As={bubbles:!0,composed:!0,cancelable:!0},Es="isConnected",Ms=new WeakMap;function Is(e){var t,s;return null!==(s=null!==(t=e.shadowRoot)&&void 0!==t?t:Ms.get(e))&&void 0!==s?s:null}let js;class Rs extends R{get isConnected(){return _.track(this,Es),1===this.stage}get context(){var e,t;return null!==(t=null===(e=this.view)||void 0===e?void 0:e.context)&&void 0!==t?t:H.default}get isBound(){var e,t;return null!==(t=null===(e=this.view)||void 0===e?void 0:e.isBound)&&void 0!==t&&t}get sourceLifetime(){var e;return null===(e=this.view)||void 0===e?void 0:e.sourceLifetime}get template(){var e;if(null===this._template){const t=this.definition;this.source.resolveTemplate?this._template=this.source.resolveTemplate():t.template&&(this._template=null!==(e=t.template)&&void 0!==e?e:null)}return this._template}set template(e){this._template!==e&&(this._template=e,this.needsInitialization||this.renderTemplate(e))}get shadowOptions(){return this._shadowRootOptions}set shadowOptions(e){if(void 0===this._shadowRootOptions&&void 0!==e){this._shadowRootOptions=e;let t=this.source.shadowRoot;t?this.hasExistingShadowRoot=!0:(t=this.source.attachShadow(e),"closed"===e.mode&&Ms.set(this.source,t))}}get mainStyles(){var e;if(null===this._mainStyles){const t=this.definition;this.source.resolveStyles?this._mainStyles=this.source.resolveStyles():t.styles&&(this._mainStyles=null!==(e=t.styles)&&void 0!==e?e:null)}return this._mainStyles}set mainStyles(e){this._mainStyles!==e&&(null!==this._mainStyles&&this.removeStyles(this._mainStyles),this._mainStyles=e,this.needsInitialization||this.addStyles(e))}constructor(e,t){super(e),this.boundObservables=null,this.needsInitialization=!0,this.hasExistingShadowRoot=!1,this._template=null,this.stage=3,this.guardBehaviorConnection=!1,this.behaviors=null,this.behaviorsConnected=!1,this._mainStyles=null,this.$fastController=this,this.view=null,this.source=e,this.definition=t,this.shadowOptions=t.shadowOptions;const s=_.getAccessors(e);if(s.length>0){const t=this.boundObservables=Object.create(null);for(let i=0,n=s.length;i<n;++i){const n=s[i].name,r=e[n];void 0!==r&&(delete e[n],t[n]=r)}}}onUnbind(e){var t;null===(t=this.view)||void 0===t||t.onUnbind(e)}addBehavior(e){var t,s;const i=null!==(t=this.behaviors)&&void 0!==t?t:this.behaviors=new Map,n=null!==(s=i.get(e))&&void 0!==s?s:0;0===n?(i.set(e,1),e.addedCallback&&e.addedCallback(this),!e.connectedCallback||this.guardBehaviorConnection||1!==this.stage&&0!==this.stage||e.connectedCallback(this)):i.set(e,n+1)}removeBehavior(e,t=!1){const s=this.behaviors;if(null===s)return;const i=s.get(e);void 0!==i&&(1===i||t?(s.delete(e),e.disconnectedCallback&&3!==this.stage&&e.disconnectedCallback(this),e.removedCallback&&e.removedCallback(this)):s.set(e,i-1))}addStyles(e){var t;if(!e)return;const s=this.source;if(e instanceof HTMLElement){(null!==(t=Is(s))&&void 0!==t?t:this.source).append(e)}else if(!e.isAttachedTo(s)){const t=e.behaviors;if(e.addStylesTo(s),null!==t)for(let e=0,s=t.length;e<s;++e)this.addBehavior(t[e])}}removeStyles(e){var t;if(!e)return;const s=this.source;if(e instanceof HTMLElement){(null!==(t=Is(s))&&void 0!==t?t:s).removeChild(e)}else if(e.isAttachedTo(s)){const t=e.behaviors;if(e.removeStylesFrom(s),null!==t)for(let e=0,s=t.length;e<s;++e)this.removeBehavior(t[e])}}connect(){3===this.stage&&(this.stage=0,this.bindObservables(),this.connectBehaviors(),this.needsInitialization?(this.renderTemplate(this.template),this.addStyles(this.mainStyles),this.needsInitialization=!1):null!==this.view&&this.view.bind(this.source),this.stage=1,_.notify(this,Es))}bindObservables(){if(null!==this.boundObservables){const e=this.source,t=this.boundObservables,s=Object.keys(t);for(let i=0,n=s.length;i<n;++i){const n=s[i];e[n]=t[n]}this.boundObservables=null}}connectBehaviors(){if(!1===this.behaviorsConnected){const e=this.behaviors;if(null!==e){this.guardBehaviorConnection=!0;for(const t of e.keys())t.connectedCallback&&t.connectedCallback(this);this.guardBehaviorConnection=!1}this.behaviorsConnected=!0}}disconnectBehaviors(){if(!0===this.behaviorsConnected){const e=this.behaviors;if(null!==e)for(const t of e.keys())t.disconnectedCallback&&t.disconnectedCallback(this);this.behaviorsConnected=!1}}disconnect(){1===this.stage&&(this.stage=2,_.notify(this,Es),null!==this.view&&this.view.unbind(),this.disconnectBehaviors(),this.stage=3)}onAttributeChangedCallback(e,t,s){const i=this.definition.attributeLookup[e];void 0!==i&&i.onAttributeChangedCallback(this.source,s)}emit(e,t,s){return 1===this.stage&&this.source.dispatchEvent(new CustomEvent(e,Object.assign(Object.assign({detail:t},As),s)))}renderTemplate(e){var t;const s=this.source,i=null!==(t=Is(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=V.coupled)}static forCustomElement(e,t=!1){const s=e.$fastController;if(void 0!==s&&!t)return s;const i=fs.getForInstance(e);if(void 0===i)throw f.error(1401);return _.getNotifier(i).subscribe({handleChange:()=>{Rs.forCustomElement(e,!0),e.$fastController.connect()}},"template"),_.getNotifier(i).subscribe({handleChange:()=>{Rs.forCustomElement(e,!0),e.$fastController.connect()}},"shadowOptions"),e.$fastController=new js(e,i)}static setStrategy(e){js=e}}function Vs(e){var t;return"adoptedStyleSheets"in e?e:null!==(t=Is(e))&&void 0!==t?t:e.getRootNode()}v(Rs),Rs.setStrategy(Rs);class _s{constructor(e){const t=_s.styleSheetCache;this.sheets=e.map((e=>{if(e instanceof CSSStyleSheet)return e;let s=t.get(e);return void 0===s&&(s=new CSSStyleSheet,s.replaceSync(e),t.set(e,s)),s}))}addStylesTo(e){Hs(Vs(e),this.sheets)}removeStylesFrom(e){Ds(Vs(e),this.sheets)}}_s.styleSheetCache=new Map;let zs=0;function Ls(e){return e===document?document.body:e}class Fs{constructor(e){this.styles=e,this.styleClass="fast-"+ ++zs}addStylesTo(e){e=Ls(Vs(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=Ls(Vs(e))).querySelectorAll(`.${this.styleClass}`);for(let s=0,i=t.length;s<i;++s)e.removeChild(t[s])}}let Hs=(e,t)=>{e.adoptedStyleSheets=[...e.adoptedStyleSheets,...t]},Ds=(e,t)=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter((e=>-1===t.indexOf(e)))};if(ue.supportsAdoptedStyleSheets){try{document.adoptedStyleSheets.push(),document.adoptedStyleSheets.splice(),Hs=(e,t)=>{e.adoptedStyleSheets.push(...t)},Ds=(e,t)=>{for(const s of t){const t=e.adoptedStyleSheets.indexOf(s);-1!==t&&e.adoptedStyleSheets.splice(t,1)}}}catch(e){}ue.setDefaultStrategy(_s)}else ue.setDefaultStrategy(Fs);const Ps="needs-hydration";class Us extends Rs{get shadowOptions(){return super.shadowOptions}set shadowOptions(e){super.shadowOptions=e,(this.hasExistingShadowRoot||void 0!==e&&!this.template)&&this.definition.templateOptions===us.deferAndHydrate&&(this.source.toggleAttribute(_e,!0),this.source.toggleAttribute(Ps,!0))}addHydratingInstance(){if(!Us.hydratingInstances)return;const e=this.definition.name;let t=Us.hydratingInstances.get(e);t||(t=new Set,Us.hydratingInstances.set(e,t)),t.add(this.source)}static config(e){return Us.lifecycleCallbacks=e,this}static hydrationObserverHandler(e){for(const t of e)t.target.hasAttribute(_e)||(Us.hydrationObserver.unobserve(t.target),t.target.$fastController.connect())}static checkHydrationComplete(e){var t,s,i;e.didTimeout?Us.idleCallbackId=requestIdleCallback(Us.checkHydrationComplete,{timeout:50}):0===(null===(t=Us.hydratingInstances)||void 0===t?void 0:t.size)&&(null===(i=null===(s=Us.lifecycleCallbacks)||void 0===s?void 0:s.hydrationComplete)||void 0===i||i.call(s),Rs.setStrategy(Rs))}connect(){var e,t,s,i,n;if(this.needsHydration=null!==(e=this.needsHydration)&&void 0!==e?e:this.source.hasAttribute(Ps),this.source.hasAttribute(_e))return this.addHydratingInstance(),void Us.hydrationObserver.observe(this.source,{attributeFilter:[_e]});if(!this.needsHydration)return super.connect(),void this.removeHydratingInstance();if(3===this.stage){if(null===(s=null===(t=Us.lifecycleCallbacks)||void 0===t?void 0:t.elementWillHydrate)||void 0===s||s.call(t,this.definition.name),this.stage=0,this.bindObservables(),this.connectBehaviors(),this.template)if(Ve(this.template)){const e=this.source,t=null!==(i=Is(e))&&void 0!==i?i:e;let s=t.firstChild,r=t.lastChild;null===e.shadowRoot&&(Ee.isElementBoundaryStartMarker(s)&&(s.data="",s=s.nextSibling),Ee.isElementBoundaryEndMarker(r)&&(r.data="",r=r.previousSibling)),this.view=this.template.hydrate(s,r,e),null===(n=this.view)||void 0===n||n.bind(this.source)}else this.renderTemplate(this.template);this.addStyles(this.mainStyles),this.stage=1,this.source.removeAttribute(Ps),this.needsInitialization=this.needsHydration=!1,this.removeHydratingInstance(),_.notify(this,Es)}}removeHydratingInstance(){var e,t;if(!Us.hydratingInstances)return;const s=this.definition.name,i=Us.hydratingInstances.get(s);null===(t=null===(e=Us.lifecycleCallbacks)||void 0===e?void 0:e.elementDidHydrate)||void 0===t||t.call(e,this.definition.name),i&&(i.delete(this.source),i.size||Us.hydratingInstances.delete(s),Us.idleCallbackId&&cancelIdleCallback(Us.idleCallbackId),Us.idleCallbackId=requestIdleCallback(Us.checkHydrationComplete,{timeout:50}))}disconnect(){super.disconnect(),Us.hydrationObserver.unobserve(this.source)}static install(){Rs.setStrategy(Us)}}function qs(e){const t=class extends e{constructor(){super(),Rs.forCustomElement(this)}$emit(e,t,s){return this.$fastController.emit(e,t,s)}connectedCallback(){this.$fastController.connect()}disconnectedCallback(){this.$fastController.disconnect()}attributeChangedCallback(e,t,s){this.$fastController.onAttributeChangedCallback(e,t,s)}};return fs.registerBaseType(t),t}function Qs(e,t){return c(e)?fs.compose(e,t).define().type:fs.compose(this,e).define().type}Us.hydrationObserver=new ks(Us.hydrationObserverHandler),Us.idleCallbackId=null,Us.hydratingInstances=new Map;const Ws=Object.assign(qs(HTMLElement),{from:function(e){return qs(e)},define:Qs,compose:function(e,t){return c(e)?fs.compose(e,t):fs.compose(this,e)},defineAsync:function(e,t){return c(e)?new Promise((s=>{fs.composeAsync(e,t).then((e=>{s(e)}))})).then((e=>e.define().type)):new Promise((t=>{fs.composeAsync(this,e).then((e=>{t(e)}))})).then((e=>e.define().type))}});function Xs(e){return function(t){Qs(t,e)}}T.setPolicy(M.create());export{ee as ArrayObserver,es as AttributeConfiguration,rs as AttributeDefinition,ie as Binding,ve as CSSBindingDirective,pe as CSSDirective,Jt as ChildrenDirective,Tt as Compiler,T as DOM,m as DOMAspect,Rs as ElementController,ue as ElementStyles,H as ExecutionContext,f as FAST,Ws as FASTElement,fs as FASTElementDefinition,ut as HTMLBindingDirective,We as HTMLDirective,ot as HTMLView,Us as HydratableElementController,dt as HydrationBindingError,Ot as InlineTemplateDirective,Ue as Markup,qt as NodeObservationDirective,_ as Observable,qe as Parser,R as PropertyChangeNotifier,At as RefDirective,ps as RenderBehavior,gs as RenderDirective,Ft as RepeatBehavior,Ht as RepeatDirective,Wt as SlottedDirective,P as Sort,V as SourceLifetime,D as Splice,K as SpliceStrategy,U as SpliceStrategySupport,Je as StatelessAttachedAttributeDirective,j as SubscriberSet,us as TemplateOptions,I as Updates,Nt as ViewTemplate,os as attr,ts as booleanConverter,Kt as children,Se as css,ge as cssDirective,Xs as customElement,_e as deferHydrationAttribute,Ut as elements,p as emptyArray,hs as fastElementRegistry,kt as html,Xe as htmlDirective,Ve as isHydratable,te as lengthOf,oe as listener,Ps as needsHydrationAttribute,ce as normalizeBinding,ss as nullableBooleanConverter,ns as nullableNumberConverter,z as observable,le as oneTime,re as oneWay,Et as ref,Ns as render,Dt as repeat,Xt as slotted,se as sortedCount,L as volatile,jt as when};
|
|
3
|
+
`;function dn(e){return void 0===e?cn:e.template}function hn(e,t){const n=[],s=[],{attributes:i,directives:r,content:o,policy:a}=null!=t?t:{};if(n.push(`<${e}`),i){const e=Object.getOwnPropertyNames(i);for(let t=0,r=e.length;t<r;++t){const r=e[t];0===t?n[0]=`${n[0]} ${r}="`:n.push(`" ${r}="`),s.push(i[r])}n.push('"')}if(r){n[n.length-1]+=" ";for(let e=0,t=r.length;e<t;++e){const t=r[e];n.push(e>0?"":" "),s.push(t)}}if(n[n.length-1]+=">",o&&d(o.create))s.push(o),n.push(`</${e}>`);else{const t=n.length-1;n[t]=`${n[t]}${null!=o?o:""}</${e}>`}return en.create(n,s,a)}function un(e){var t;const n=null!==(t=e.name)&&void 0!==t?t:ln;let s;if((i=e).element||i.tagName){let t=e.tagName;if(!t){const n=Kt.getByType(e.element);if(!n)throw new Error("Invalid element for model rendering.");t=n.name}e.attributes||(e.attributes=on),s=hn(t,e)}else s=e.template;var i;return{brand:an,type:e.type,name:n,template:s}}function pn(e){return e&&e.brand===an}function fn(e,t){const n=rn.get(e);if(void 0!==n)return n[null!=t?t:ln]}function gn(e,t){if(e)return fn(e.constructor,t)}Object.freeze({instanceOf:pn,create:un,createElementTemplate:hn,register:function(e){let t=rn.get(e.type);void 0===t&&rn.set(e.type,t=Object.create(null));const n=pn(e)?e:un(e);return t[n.name]=n},getByType:fn,getForInstance:gn});class bn{constructor(e){this.node=e,e.$fastTemplate=this}get context(){return this}bind(e){}unbind(){}insertBefore(e){e.parentNode.insertBefore(this.node,e)}remove(){this.node.parentNode.removeChild(this.node)}create(){return this}hydrate(e,t){return this}}function vn(e,t){let n,s;n=void 0===e?de((e=>e)):he(e);let i=!1;if(void 0===t)i=!0,s=de(((e,t)=>{var s;const i=n.evaluate(e,t);return i instanceof Node?null!==(s=i.$fastTemplate)&&void 0!==s?s:new bn(i):dn(gn(i))}));else if(d(t))s=ae(((e,s)=>{var i;let r=t(e,s);return h(r)?r=dn(gn(n.evaluate(e,s),r)):r instanceof Node&&(r=null!==(i=r.$fastTemplate)&&void 0!==i?i:new bn(r)),r}),void 0,!0);else if(h(t))i=!0,s=de(((e,s)=>{var i;const r=n.evaluate(e,s);return r instanceof Node?null!==(i=r.$fastTemplate)&&void 0!==i?i:new bn(r):dn(gn(r,t))}));else if(t instanceof re){const e=t.evaluate;t.evaluate=(t,s)=>{var i;let r=e(t,s);return h(r)?r=dn(gn(n.evaluate(t,s),r)):r instanceof Node&&(r=null!==(i=r.$fastTemplate)&&void 0!==i?i:new bn(r)),r},s=t}else s=de(((e,n)=>t));return new sn(n,s,i)}const mn=Object.freeze({positioning:!1,recycle:!0});function yn(e,t,n,s){e.context.parent=s.source,e.context.parentContext=s.context,e.bind(t[n])}function wn(e,t,n,s){e.context.parent=s.source,e.context.parentContext=s.context,e.context.length=t.length,e.context.index=n,e.bind(t[n])}function Cn(e){return e.nodeType===Node.COMMENT_NODE}class Sn extends Error{constructor(e,t){super(e),this.propertyBag=t}}class Tn{constructor(e){this.directive=e,this.items=null,this.itemsObserver=null,this.bindView=yn,this.views=[],this.itemsBindingObserver=e.dataBinding.createObserver(this,e),this.templateBindingObserver=e.templateBinding.createObserver(this,e),e.options.positioning&&(this.bindView=wn)}bind(e){this.location=e.targets[this.directive.targetNodeId],this.controller=e,this.items=this.itemsBindingObserver.bind(e),this.template=this.templateBindingObserver.bind(e),this.observeItems(!0),tt(this.template)&&tt(e)&&e.hydrationStage!==bt?this.hydrateViews(this.template):this.refreshAllViews(),e.onUnbind(this)}unbind(){null!==this.itemsObserver&&this.itemsObserver.unsubscribe(this),this.unbindAllViews()}handleChange(e,t){if(t===this.itemsBindingObserver)this.items=this.itemsBindingObserver.bind(this.controller),this.observeItems(),this.refreshAllViews();else if(t===this.templateBindingObserver)this.template=this.templateBindingObserver.bind(this.controller),this.refreshAllViews(!0);else{if(!t[0])return;t[0].reset?this.refreshAllViews():t[0].sorted?this.updateSortedViews(t):this.updateSplicedViews(t)}}observeItems(e=!1){if(!this.items)return void(this.items=g);const t=this.itemsObserver,n=this.itemsObserver=D.getNotifier(this.items),s=t!==n;s&&null!==t&&t.unsubscribe(this),(s||e)&&n.subscribe(this)}updateSortedViews(e){const t=this.views;for(let n=0,s=e.length;n<s;++n){const s=e[n].sorted.slice(),i=s.slice().sort();for(let e=0,n=s.length;e<n;++e){const n=s.find((t=>s[e]===i[t]));if(n!==e){const s=i.splice(n,1);i.splice(e,0,...s);const r=t[e],o=r?r.firstChild:this.location;t[n].remove(),t[n].insertBefore(o);const a=t.splice(n,1);t.splice(e,0,...a)}}}}updateSplicedViews(e){const t=this.views,n=this.bindView,s=this.items,i=this.template,r=this.controller,o=this.directive.options.recycle,a=[];let l=0,c=0;for(let d=0,h=e.length;d<h;++d){const h=e[d],u=h.removed;let p=0,f=h.index;const g=f+h.addedCount,b=t.splice(h.index,u.length),v=c=a.length+b.length;for(;f<g;++f){const e=t[f],d=e?e.firstChild:this.location;let h;o&&c>0?(p<=v&&b.length>0?(h=b[p],p++):(h=a[l],l++),c--):h=i.create(),t.splice(f,0,h),n(h,s,f,r),h.insertBefore(d)}b[p]&&a.push(...b.slice(p))}for(let e=l,t=a.length;e<t;++e)a[e].dispose();if(this.directive.options.positioning)for(let e=0,n=t.length;e<n;++e){const s=t[e].context;s.length=n,s.index=e}}refreshAllViews(e=!1){const t=this.items,n=this.template,s=this.location,i=this.bindView,r=this.controller;let o=t.length,a=this.views,l=a.length;if(0!==o&&!e&&this.directive.options.recycle||(pt.disposeContiguousBatch(a),l=0),0===l){this.views=a=new Array(o);for(let e=0;e<o;++e){const o=n.create();i(o,t,e,r),a[e]=o,o.insertBefore(s)}}else{let e=0;for(;e<o;++e)if(e<l){const s=a[e];if(!s){const t=new XMLSerializer;throw new Sn(`View is null or undefined inside "${this.location.getRootNode().host.nodeName}".`,{index:e,hydrationStage:this.controller.hydrationStage,itemsLength:o,viewsState:a.map((e=>e?"hydrated":"empty")),viewTemplateString:t.serializeToString(n.create().fragment),rootNodeContent:t.serializeToString(this.location.getRootNode())})}i(s,t,e,r)}else{const o=n.create();i(o,t,e,r),a.push(o),o.insertBefore(s)}const c=a.splice(e,l-e);for(e=0,o=c.length;e<o;++e)c[e].dispose()}}unbindAllViews(){const e=this.views;for(let t=0,n=e.length;t<n;++t){const n=e[t];if(!n){const n=new XMLSerializer;throw new Sn(`View is null or undefined inside "${this.location.getRootNode().host.nodeName}".`,{index:t,hydrationStage:this.controller.hydrationStage,viewsState:e.map((e=>e?"hydrated":"empty")),rootNodeContent:n.serializeToString(this.location.getRootNode())})}n.unbind()}}hydrateViews(e){if(!this.items)return;this.views=new Array(this.items.length);let t=this.location.previousSibling;for(;null!==t;){if(!Cn(t)){t=t.previousSibling;continue}const n=Xe.parseRepeatEndMarker(t.data);if(null===n){t=t.previousSibling;continue}t.data="";const s=t.previousSibling;if(!s)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": end should never be null.`);let i=s,r=0;for(;null!==i;){if(Cn(i))if(Xe.isRepeatViewEndMarker(i.data))r++;else if(Xe.isRepeatViewStartMarker(i.data)){if(!r){if(Xe.parseRepeatStartMarker(i.data)!==n)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": Mismatched start and end markers.`);i.data="",t=i.previousSibling,i=i.nextSibling;const r=e.hydrate(i,s);this.views[n]=r,this.bindView(r,this.items,n,this.controller);break}r--}i=i.previousSibling}if(!i)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": start should never be null.`)}}}class On{createHTML(e){return Me.comment(e(this))}constructor(e,t,n){this.dataBinding=e,this.templateBinding=t,this.options=n,ne.enable()}createBehavior(){return new Tn(this)}}function $n(e,t,n=mn){const s=he(e),i=he(t);return new On(s,i,Object.assign(Object.assign({},mn),n))}je.define(On);const xn="slotchange";class Bn extends Le{observe(e){e.addEventListener(xn,this)}disconnect(e){e.removeEventListener(xn,this)}getNodes(e){return e.assignedNodes(this.options)}handleEvent(e){const t=e.currentTarget;this.updateTarget(this.getSource(t),this.computeNodes(t))}}function Nn(e){return h(e)&&(e={property:e}),new Bn(e)}je.define(Bn);const kn=()=>null;function An(e){return void 0===e?kn:d(e)?e:()=>e}function En(e,t,n){const s=d(e)?e:()=>e,i=An(t),r=An(n);return(e,t)=>s(e,t)?i(e,t):r(e,t)}class Mn extends MutationObserver{constructor(e){super((function(e){this.callback.call(null,e.filter((e=>this.observedNodes.has(e.target))))})),this.callback=e,this.observedNodes=new Set}observe(e,t){this.observedNodes.add(e),super.observe(e,t)}unobserve(e){this.observedNodes.delete(e),this.observedNodes.size<1&&this.disconnect()}}Object.freeze({create(e){const t=[],n={};let s=null,i=!1;return{source:e,context:H.default,targets:n,get isBound(){return i},addBehaviorFactory(e,t){var n,s,i,r;const o=e;o.id=null!==(n=o.id)&&void 0!==n?n:Ee(),o.targetNodeId=null!==(s=o.targetNodeId)&&void 0!==s?s:Ee(),o.targetTagName=null!==(i=t.tagName)&&void 0!==i?i:null,o.policy=null!==(r=o.policy)&&void 0!==r?r:O.policy,this.addTarget(o.targetNodeId,t),this.addBehavior(o.createBehavior())},addTarget(e,t){n[e]=t},addBehavior(e){t.push(e),i&&e.bind(this)},onUnbind(e){null===s&&(s=[]),s.push(e)},connectedCallback(e){i||(i=!0,t.forEach((e=>e.bind(this))))},disconnectedCallback(e){i&&(i=!1,null!==s&&s.forEach((e=>e.unbind(this))))}}}});const In={bubbles:!0,composed:!0,cancelable:!0},Rn="isConnected",jn=new WeakMap;function Vn(e){var t,n;return null!==(n=null!==(t=e.shadowRoot)&&void 0!==t?t:jn.get(e))&&void 0!==n?n:null}let _n;var Dn;!function(e){e[e.connecting=0]="connecting",e[e.connected=1]="connected",e[e.disconnecting=2]="disconnecting",e[e.disconnected=3]="disconnected"}(Dn||(Dn={}));class Fn extends j{get isConnected(){return D.track(this,Rn),this.stage===Dn.connected}get context(){var e,t;return null!==(t=null===(e=this.view)||void 0===e?void 0:e.context)&&void 0!==t?t:H.default}get isBound(){var e,t;return null!==(t=null===(e=this.view)||void 0===e?void 0:e.isBound)&&void 0!==t&&t}get sourceLifetime(){var e;return null===(e=this.view)||void 0===e?void 0:e.sourceLifetime}get template(){var e;if(null===this._template){const t=this.definition;this.source.resolveTemplate?this._template=this.source.resolveTemplate():t.template&&(this._template=null!==(e=t.template)&&void 0!==e?e:null)}return this._template}set template(e){this._template!==e&&(this._template=e,this.needsInitialization||this.renderTemplate(e))}get shadowOptions(){return this._shadowRootOptions}set shadowOptions(e){if(void 0===this._shadowRootOptions&&void 0!==e){this._shadowRootOptions=e;let t=this.source.shadowRoot;t?this.hasExistingShadowRoot=!0:(t=this.source.attachShadow(e),"closed"===e.mode&&jn.set(this.source,t))}}get mainStyles(){var e;if(null===this._mainStyles){const t=this.definition;this.source.resolveStyles?this._mainStyles=this.source.resolveStyles():t.styles&&(this._mainStyles=null!==(e=t.styles)&&void 0!==e?e:null)}return this._mainStyles}set mainStyles(e){this._mainStyles!==e&&(null!==this._mainStyles&&this.removeStyles(this._mainStyles),this._mainStyles=e,this.needsInitialization||this.addStyles(e))}constructor(e,t){super(e),this.boundObservables=null,this.needsInitialization=!0,this.hasExistingShadowRoot=!1,this._template=null,this.stage=Dn.disconnected,this.guardBehaviorConnection=!1,this.behaviors=null,this.behaviorsConnected=!1,this._mainStyles=null,this.$fastController=this,this.view=null,this.source=e,this.definition=t,this.shadowOptions=t.shadowOptions;const n=D.getAccessors(e);if(n.length>0){const t=this.boundObservables=Object.create(null);for(let s=0,i=n.length;s<i;++s){const i=n[s].name,r=e[i];void 0!==r&&(delete e[i],t[i]=r)}}}onUnbind(e){var t;null===(t=this.view)||void 0===t||t.onUnbind(e)}addBehavior(e){var t,n;const s=null!==(t=this.behaviors)&&void 0!==t?t:this.behaviors=new Map,i=null!==(n=s.get(e))&&void 0!==n?n:0;0===i?(s.set(e,1),e.addedCallback&&e.addedCallback(this),!e.connectedCallback||this.guardBehaviorConnection||this.stage!==Dn.connected&&this.stage!==Dn.connecting||e.connectedCallback(this)):s.set(e,i+1)}removeBehavior(e,t=!1){const n=this.behaviors;if(null===n)return;const s=n.get(e);void 0!==s&&(1===s||t?(n.delete(e),e.disconnectedCallback&&this.stage!==Dn.disconnected&&e.disconnectedCallback(this),e.removedCallback&&e.removedCallback(this)):n.set(e,s-1))}addStyles(e){var t;if(!e)return;const n=this.source;if(e instanceof HTMLElement){(null!==(t=Vn(n))&&void 0!==t?t:this.source).append(e)}else if(!e.isAttachedTo(n)){const t=e.behaviors;if(e.addStylesTo(n),null!==t)for(let e=0,n=t.length;e<n;++e)this.addBehavior(t[e])}}removeStyles(e){var t;if(!e)return;const n=this.source;if(e instanceof HTMLElement){(null!==(t=Vn(n))&&void 0!==t?t:n).removeChild(e)}else if(e.isAttachedTo(n)){const t=e.behaviors;if(e.removeStylesFrom(n),null!==t)for(let e=0,n=t.length;e<n;++e)this.removeBehavior(t[e])}}connect(){this.stage===Dn.disconnected&&(this.stage=Dn.connecting,this.bindObservables(),this.connectBehaviors(),this.needsInitialization?(this.renderTemplate(this.template),this.addStyles(this.mainStyles),this.needsInitialization=!1):null!==this.view&&this.view.bind(this.source),this.stage=Dn.connected,D.notify(this,Rn))}bindObservables(){if(null!==this.boundObservables){const e=this.source,t=this.boundObservables,n=Object.keys(t);for(let s=0,i=n.length;s<i;++s){const i=n[s];e[i]=t[i]}this.boundObservables=null}}connectBehaviors(){if(!1===this.behaviorsConnected){const e=this.behaviors;if(null!==e){this.guardBehaviorConnection=!0;for(const t of e.keys())t.connectedCallback&&t.connectedCallback(this);this.guardBehaviorConnection=!1}this.behaviorsConnected=!0}}disconnectBehaviors(){if(!0===this.behaviorsConnected){const e=this.behaviors;if(null!==e)for(const t of e.keys())t.disconnectedCallback&&t.disconnectedCallback(this);this.behaviorsConnected=!1}}disconnect(){this.stage===Dn.connected&&(this.stage=Dn.disconnecting,D.notify(this,Rn),null!==this.view&&this.view.unbind(),this.disconnectBehaviors(),this.stage=Dn.disconnected)}onAttributeChangedCallback(e,t,n){const s=this.definition.attributeLookup[e];void 0!==s&&s.onAttributeChangedCallback(this.source,n)}emit(e,t,n){return this.stage===Dn.connected&&this.source.dispatchEvent(new CustomEvent(e,Object.assign(Object.assign({detail:t},In),n)))}renderTemplate(e){var t;const n=this.source,s=null!==(t=Vn(n))&&void 0!==t?t:n;if(null!==this.view)this.view.dispose(),this.view=null;else if(!this.needsInitialization||this.hasExistingShadowRoot){this.hasExistingShadowRoot=!1;for(let e=s.firstChild;null!==e;e=s.firstChild)s.removeChild(e)}e&&(this.view=e.render(n,s,n),this.view.sourceLifetime=_.coupled)}static forCustomElement(e,t=!1){const n=e.$fastController;if(void 0!==n&&!t)return n;const s=Kt.getForInstance(e);if(void 0===s)throw f.error(c.missingElementDefinition);return D.getNotifier(s).subscribe({handleChange:()=>{Fn.forCustomElement(e,!0),e.$fastController.connect()}},"template"),D.getNotifier(s).subscribe({handleChange:()=>{Fn.forCustomElement(e,!0),e.$fastController.connect()}},"shadowOptions"),e.$fastController=new _n(e,s)}static setStrategy(e){_n=e}}function Ln(e){var t;return"adoptedStyleSheets"in e?e:null!==(t=Vn(e))&&void 0!==t?t:e.getRootNode()}m(Fn),Fn.setStrategy(Fn);class Pn{constructor(e){const t=Pn.styleSheetCache;this.sheets=e.map((e=>{if(e instanceof CSSStyleSheet)return e;let n=t.get(e);return void 0===n&&(n=new CSSStyleSheet,n.replaceSync(e),t.set(e,n)),n}))}addStylesTo(e){qn(Ln(e),this.sheets)}removeStylesFrom(e){Wn(Ln(e),this.sheets)}}Pn.styleSheetCache=new Map;let Hn=0;function zn(e){return e===document?document.body:e}class Un{constructor(e){this.styles=e,this.styleClass="fast-"+ ++Hn}addStylesTo(e){e=zn(Ln(e));const t=this.styles,n=this.styleClass;for(let s=0;s<t.length;s++){const i=document.createElement("style");i.innerHTML=t[s],i.className=n,e.append(i)}}removeStylesFrom(e){const t=(e=zn(Ln(e))).querySelectorAll(`.${this.styleClass}`);for(let n=0,s=t.length;n<s;++n)e.removeChild(t[n])}}let qn=(e,t)=>{e.adoptedStyleSheets=[...e.adoptedStyleSheets,...t]},Wn=(e,t)=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter((e=>-1===t.indexOf(e)))};if(ye.supportsAdoptedStyleSheets){try{document.adoptedStyleSheets.push(),document.adoptedStyleSheets.splice(),qn=(e,t)=>{e.adoptedStyleSheets.push(...t)},Wn=(e,t)=>{for(const n of t){const t=e.adoptedStyleSheets.indexOf(n);-1!==t&&e.adoptedStyleSheets.splice(t,1)}}}catch(e){}ye.setDefaultStrategy(Pn)}else ye.setDefaultStrategy(Un);const Qn="needs-hydration";class Jn extends Fn{get shadowOptions(){return super.shadowOptions}set shadowOptions(e){super.shadowOptions=e,(this.hasExistingShadowRoot||void 0!==e&&!this.template)&&this.definition.templateOptions===Jt.deferAndHydrate&&(this.source.toggleAttribute(nt,!0),this.source.toggleAttribute(Qn,!0))}addHydratingInstance(){if(!Jn.hydratingInstances)return;const e=this.definition.name;let t=Jn.hydratingInstances.get(e);t||(t=new Set,Jn.hydratingInstances.set(e,t)),t.add(this.source)}static config(e){return Jn.lifecycleCallbacks=e,this}static hydrationObserverHandler(e){for(const t of e)t.target.hasAttribute(nt)||(Jn.hydrationObserver.unobserve(t.target),t.target.$fastController.connect())}static checkHydrationComplete(e){var t,n,s;if(e.didTimeout)Jn.idleCallbackId=requestIdleCallback(Jn.checkHydrationComplete,{timeout:50});else if(0===(null===(t=Jn.hydratingInstances)||void 0===t?void 0:t.size)){try{null===(s=(n=Jn.lifecycleCallbacks).hydrationComplete)||void 0===s||s.call(n)}catch(e){}Fn.setStrategy(Fn)}}connect(){var e,t,n,s,i,r,o;if(this.needsHydration=null!==(e=this.needsHydration)&&void 0!==e?e:this.source.hasAttribute(Qn),this.source.hasAttribute(nt))return this.addHydratingInstance(),void Jn.hydrationObserver.observe(this.source,{attributeFilter:[nt]});if(!this.needsHydration)return super.connect(),void this.removeHydratingInstance();if(this.stage===Dn.disconnected){if(!Jn.hydrationStarted){Jn.hydrationStarted=!0;try{null===(n=(t=Jn.lifecycleCallbacks).hydrationStarted)||void 0===n||n.call(t)}catch(e){}}try{null===(i=(s=Jn.lifecycleCallbacks).elementWillHydrate)||void 0===i||i.call(s,this.source)}catch(e){}if(this.stage=Dn.connecting,this.bindObservables(),this.connectBehaviors(),this.template)if(tt(this.template)){const e=this.source,t=null!==(r=Vn(e))&&void 0!==r?r:e;let n=t.firstChild,s=t.lastChild;null===e.shadowRoot&&(Xe.isElementBoundaryStartMarker(n)&&(n.data="",n=n.nextSibling),Xe.isElementBoundaryEndMarker(s)&&(s.data="",s=s.previousSibling)),this.view=this.template.hydrate(n,s,e),null===(o=this.view)||void 0===o||o.bind(this.source)}else this.renderTemplate(this.template);this.addStyles(this.mainStyles),this.stage=Dn.connected,this.source.removeAttribute(Qn),this.needsInitialization=this.needsHydration=!1,this.removeHydratingInstance(),D.notify(this,Rn)}}removeHydratingInstance(){var e,t;if(!Jn.hydratingInstances)return;try{null===(t=(e=Jn.lifecycleCallbacks).elementDidHydrate)||void 0===t||t.call(e,this.source)}catch(e){}const n=this.definition.name,s=Jn.hydratingInstances.get(n);s&&(s.delete(this.source),s.size||Jn.hydratingInstances.delete(n),Jn.idleCallbackId&&cancelIdleCallback(Jn.idleCallbackId),Jn.idleCallbackId=requestIdleCallback(Jn.checkHydrationComplete,{timeout:50}))}disconnect(){super.disconnect(),Jn.hydrationObserver.unobserve(this.source)}static install(){Fn.setStrategy(Jn)}}function Kn(e){const t=class extends e{constructor(){super(),Fn.forCustomElement(this)}$emit(e,t,n){return this.$fastController.emit(e,t,n)}connectedCallback(){this.$fastController.connect()}disconnectedCallback(){this.$fastController.disconnect()}attributeChangedCallback(e,t,n){this.$fastController.onAttributeChangedCallback(e,t,n)}};return Kt.registerBaseType(t),t}function Xn(e,t){return d(e)?Kt.compose(e,t).define().type:Kt.compose(this,e).define().type}Jn.hydrationObserver=new Mn(Jn.hydrationObserverHandler),Jn.lifecycleCallbacks={},Jn.hydrationStarted=!1,Jn.idleCallbackId=null,Jn.hydratingInstances=new Map;const Gn=Object.assign(Kn(HTMLElement),{from:function(e){return Kn(e)},define:Xn,compose:function(e,t){return d(e)?Kt.compose(e,t):Kt.compose(this,e)},defineAsync:function(e,t){return d(e)?new Promise((n=>{Kt.composeAsync(e,t).then((e=>{n(e)}))})).then((e=>e.define().type)):new Promise((t=>{Kt.composeAsync(this,e).then((e=>{t(e)}))})).then((e=>e.define().type))}});function Yn(e){return function(t){Xn(t,e)}}O.setPolicy(I.create());export{ne as ArrayObserver,Vt as AttributeConfiguration,Pt as AttributeDefinition,re as Binding,be as CSSBindingDirective,pe as CSSDirective,Pe as ChildrenDirective,At as Compiler,O as DOM,y as DOMAspect,Fn as ElementController,ye as ElementStyles,H as ExecutionContext,f as FAST,Gn as FASTElement,Kt as FASTElementDefinition,yt as HTMLBindingDirective,je as HTMLDirective,pt as HTMLView,Jn as HydratableElementController,vt as HydrationBindingError,Yt as InlineTemplateDirective,Me as Markup,Le as NodeObservationDirective,D as Observable,Ie as Parser,j as PropertyChangeNotifier,Et as RefDirective,nn as RenderBehavior,sn as RenderDirective,Tn as RepeatBehavior,On as RepeatDirective,Bn as SlottedDirective,U as Sort,_ as SourceLifetime,z as Splice,Y as SpliceStrategy,q as SpliceStrategySupport,Dn as Stages,_e as StatelessAttachedAttributeDirective,R as SubscriberSet,Jt as TemplateOptions,V as Updates,en as ViewTemplate,Ht as attr,_t as booleanConverter,He as children,Oe as css,fe as cssDirective,Yn as customElement,nt as deferHydrationAttribute,Fe as elements,g as emptyArray,Qt as fastElementRegistry,tn as html,Ve as htmlDirective,tt as isHydratable,se as lengthOf,le as listener,Qn as needsHydrationAttribute,he as normalizeBinding,Dt as nullableBooleanConverter,Lt as nullableNumberConverter,F as observable,de as oneTime,ae as oneWay,Mt as ref,vn as render,$n as repeat,Nn as slotted,ie as sortedCount,L as volatile,En as when};
|