@microsoft/fast-element 2.10.2 → 2.10.3
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/ARCHITECTURE_FASTELEMENT.md +1 -1
- package/ARCHITECTURE_HTML_TAGGED_TEMPLATE_LITERAL.md +3 -1
- package/ARCHITECTURE_INTRO.md +1 -1
- package/ARCHITECTURE_OVERVIEW.md +1 -1
- package/CHANGELOG.json +108 -1
- package/CHANGELOG.md +10 -2
- package/DESIGN.md +506 -0
- package/biome.json +4 -0
- package/dist/context/context.api.json +17 -1
- package/dist/di/di.api.json +17 -1
- package/dist/dts/hydration/target-builder.d.ts +17 -1
- package/dist/dts/templating/html-binding-directive.d.ts +39 -4
- package/dist/dts/templating/html-directive.d.ts +7 -1
- package/dist/dts/templating/template.d.ts +19 -1
- package/dist/dts/templating/view.d.ts +11 -0
- package/dist/dts/tsdoc-metadata.json +1 -1
- package/dist/esm/components/hydration.js +17 -0
- package/dist/esm/hydration/target-builder.js +22 -1
- package/dist/esm/templating/compiler.js +29 -11
- package/dist/esm/templating/html-binding-directive.js +59 -4
- package/dist/esm/templating/html-directive.js +7 -1
- package/dist/esm/templating/install-hydratable-view-templates.js +6 -0
- package/dist/esm/templating/markup.js +8 -0
- package/dist/esm/templating/template.js +19 -1
- package/dist/esm/templating/view.js +13 -0
- package/dist/fast-element.api.json +20 -4
- package/dist/fast-element.debug.js +176 -227
- package/dist/fast-element.debug.min.js +2 -2
- package/dist/fast-element.js +176 -227
- package/dist/fast-element.min.js +2 -2
- package/dist/fast-element.untrimmed.d.ts +76 -6
- package/docs/api-report.api.md +3 -3
- package/package.json +7 -19
- package/tsconfig.api-extractor.json +6 -0
- package/.eslintrc.json +0 -19
- package/karma.conf.cjs +0 -148
package/dist/fast-element.min.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
let e;const t="fast-kernel";try{if(document.currentScript)e=document.currentScript.getAttribute(t);else{const s=document.getElementsByTagName("script");e=s[s.length-1].getAttribute(t)}}catch(t){e="isolate"}let s;switch(e){case"share":s=Object.freeze({updateQueue:1,observable:2,contextEvent:3,elementRegistry:4});break;case"share-v2":s=Object.freeze({updateQueue:1.2,observable:2.2,contextEvent:3.2,elementRegistry:4.2});break;default:const e=`-${Math.random().toString(36).substring(2,8)}`;s=Object.freeze({updateQueue:`1.2${e}`,observable:`2.2${e}`,contextEvent:`3.2${e}`,elementRegistry:`4.2${e}`})}var n;!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"}(n||(n={}));const i=e=>"function"==typeof e,r=e=>"string"==typeof e,o=()=>{};!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 a={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},a));const l=globalThis.FAST;if(void 0===l.getById){const e=Object.create(null);Reflect.defineProperty(l,"getById",Object.assign({value(t,s){let n=e[t];return void 0===n&&(n=s?e[t]=s():null),n}},a))}void 0===l.error&&Object.assign(l,{warn(){},error:e=>new Error(`Error ${e}`),addMessages(){}});const c=Object.freeze([]);function d(){const e=new Map;return Object.freeze({register:t=>!e.has(t.type)&&(e.set(t.type,t),!0),getByType:t=>e.get(t),getForInstance(t){if(null!=t)return e.get(t.constructor)}})}function h(){const e=new WeakMap;return function(t){let s=e.get(t);if(void 0===s){let n=Reflect.getPrototypeOf(t);for(;void 0===s&&null!==n;)s=e.get(n),n=Reflect.getPrototypeOf(n);s=void 0===s?[]:s.slice(0),e.set(t,s)}return s}}function u(e){e.prototype.toJSON=o}const f=Object.freeze({none:0,attribute:1,booleanAttribute:2,property:3,content:4,tokenList:5,event:6}),p=e=>e,g=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:p}):{createHTML:p};let b=Object.freeze({createHTML:e=>g.createHTML(e),protect:(e,t,s,n)=>n});const v=b,m=Object.freeze({get policy(){return b},setPolicy(e){if(b!==v)throw l.error(n.onlySetDOMPolicyOnce);b=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 y(e,t,s,n){return(e,t,s,...i)=>{r(s)&&(s=s.replace(/(javascript:|vbscript:|data:)/,"")),n(e,t,s,...i)}}function w(e,t,s,i){throw l.error(n.blockedByDOMPolicy,{aspectName:s,tagName:null!=e?e:"text"})}const C={onabort:w,onauxclick:w,onbeforeinput:w,onbeforematch:w,onblur:w,oncancel:w,oncanplay:w,oncanplaythrough:w,onchange:w,onclick:w,onclose:w,oncontextlost:w,oncontextmenu:w,oncontextrestored:w,oncopy:w,oncuechange:w,oncut:w,ondblclick:w,ondrag:w,ondragend:w,ondragenter:w,ondragleave:w,ondragover:w,ondragstart:w,ondrop:w,ondurationchange:w,onemptied:w,onended:w,onerror:w,onfocus:w,onformdata:w,oninput:w,oninvalid:w,onkeydown:w,onkeypress:w,onkeyup:w,onload:w,onloadeddata:w,onloadedmetadata:w,onloadstart:w,onmousedown:w,onmouseenter:w,onmouseleave:w,onmousemove:w,onmouseout:w,onmouseover:w,onmouseup:w,onpaste:w,onpause:w,onplay:w,onplaying:w,onprogress:w,onratechange:w,onreset:w,onresize:w,onscroll:w,onsecuritypolicyviolation:w,onseeked:w,onseeking:w,onselect:w,onslotchange:w,onstalled:w,onsubmit:w,onsuspend:w,ontimeupdate:w,ontoggle:w,onvolumechange:w,onwaiting:w,onwebkitanimationend:w,onwebkitanimationiteration:w,onwebkitanimationstart:w,onwebkittransitionend:w,onwheel:w},S={elements:{a:{[f.attribute]:{href:y},[f.property]:{href:y}},area:{[f.attribute]:{href:y},[f.property]:{href:y}},button:{[f.attribute]:{formaction:y},[f.property]:{formAction:y}},embed:{[f.attribute]:{src:w},[f.property]:{src:w}},form:{[f.attribute]:{action:y},[f.property]:{action:y}},frame:{[f.attribute]:{src:y},[f.property]:{src:y}},iframe:{[f.attribute]:{src:y},[f.property]:{src:y,srcdoc:w}},input:{[f.attribute]:{formaction:y},[f.property]:{formAction:y}},link:{[f.attribute]:{href:w},[f.property]:{href:w}},object:{[f.attribute]:{codebase:w,data:w},[f.property]:{codeBase:w,data:w}},script:{[f.attribute]:{src:w,text:w},[f.property]:{src:w,text:w,innerText:w,textContent:w}},style:{[f.property]:{innerText:w,textContent:w}}},aspects:{[f.attribute]:Object.assign({},C),[f.property]:Object.assign({innerHTML:w},C),[f.event]:Object.assign({},C)}};function T(e,t){const s={};for(const n in t){const i=e[n],r=t[n];switch(i){case null:break;case void 0:s[n]=r;break;default:s[n]=i}}for(const t in e)t in s||(s[t]=e[t]);return Object.freeze(s)}function O(e,t){const s={};for(const n in t){const i=e[n],r=t[n];switch(i){case null:break;case void 0:s[n]=T(r,{});break;default:s[n]=T(i,r)}}for(const t in e)t in s||(s[t]=T(e[t],{}));return Object.freeze(s)}function x(e,t){const s={};for(const n in t){const i=e[n],r=t[n];switch(i){case null:break;case void 0:s[n]=O(i,{});break;default:s[n]=O(i,r)}}for(const t in e)t in s||(s[t]=O(e[t],{}));return Object.freeze(s)}function B(e,t,s,n,i){const r=e[s];if(r){const e=r[n];if(e)return e(t,s,n,i)}}const $=Object.freeze({create(e={}){var t,s;const n=null!==(t=e.trustedType)&&void 0!==t?t:function(){const e=e=>e;return globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:e}):{createHTML:e}}(),i=(r=null!==(s=e.guards)&&void 0!==s?s:{},o=S,Object.freeze({elements:r.elements?x(r.elements,o.elements):o.elements,aspects:r.aspects?O(r.aspects,o.aspects):o.aspects}));var r,o;return Object.freeze({createHTML:e=>n.createHTML(e),protect(e,t,s,n){var r;const o=(null!=e?e:"").toLowerCase(),a=i.elements[o];if(a){const i=B(a,e,t,s,n);if(i)return i}return null!==(r=B(i.aspects,e,t,s,n))&&void 0!==r?r:n}})}});class N{constructor(e,t){this.sub1=void 0,this.sub2=void 0,this.spillover=void 0,this.subject=e,this.sub1=t}has(e){return void 0===this.spillover?this.sub1===e||this.sub2===e:-1!==this.spillover.indexOf(e)}subscribe(e){const t=this.spillover;if(void 0===t){if(this.has(e))return;if(void 0===this.sub1)return void(this.sub1=e);if(void 0===this.sub2)return void(this.sub2=e);this.spillover=[this.sub1,this.sub2,e],this.sub1=void 0,this.sub2=void 0}else{-1===t.indexOf(e)&&t.push(e)}}unsubscribe(e){const t=this.spillover;if(void 0===t)this.sub1===e?this.sub1=void 0:this.sub2===e&&(this.sub2=void 0);else{const s=t.indexOf(e);-1!==s&&t.splice(s,1)}}notify(e){const t=this.spillover,s=this.subject;if(void 0===t){const t=this.sub1,n=this.sub2;void 0!==t&&t.handleChange(s,e),void 0!==n&&n.handleChange(s,e)}else for(let n=0,i=t.length;n<i;++n)t[n].handleChange(s,e)}}class k{constructor(e){this.subscribers={},this.subjectSubscribers=null,this.subject=e}notify(e){var t,s;null===(t=this.subscribers[e])||void 0===t||t.notify(e),null===(s=this.subjectSubscribers)||void 0===s||s.notify(e)}subscribe(e,t){var s,n;let i;i=t?null!==(s=this.subscribers[t])&&void 0!==s?s:this.subscribers[t]=new N(this.subject):null!==(n=this.subjectSubscribers)&&void 0!==n?n:this.subjectSubscribers=new N(this.subject),i.subscribe(e)}unsubscribe(e,t){var s,n;t?null===(s=this.subscribers[t])||void 0===s||s.unsubscribe(e):null===(n=this.subjectSubscribers)||void 0===n||n.unsubscribe(e)}}const A=l.getById(s.updateQueue,(()=>{const e=[],t=[],s=globalThis.requestAnimationFrame;let n=!0;function i(){if(t.length)throw t.shift()}function r(s){try{s.call()}catch(s){if(!n)throw e.length=0,s;t.push(s),setTimeout(i,0)}}function o(){let t=0;for(;t<e.length;)if(r(e[t]),t++,t>1024){for(let s=0,n=e.length-t;s<n;s++)e[s]=e[s+t];e.length-=t,t=0}e.length=0}function a(t){e.push(t),e.length<2&&(n?s(o):o())}return Object.freeze({enqueue:a,next:()=>new Promise(a),process:o,setMode:e=>n=e})})),E=Object.freeze({unknown:void 0,coupled:1}),M=l.getById(s.observable,(()=>{const e=A.enqueue,t=/(:|&&|\|\||if|\?\.)/,s=new WeakMap;let o,a=e=>{throw l.error(n.needsArrayObservation)};function c(e){var t;let n=null!==(t=e.$fastController)&&void 0!==t?t:s.get(e);return void 0===n&&(Array.isArray(e)?n=a(e):s.set(e,n=new k(e))),n}const d=h();class f{constructor(e){this.name=e,this.field=`_${e}`,this.callback=`${e}Changed`}getValue(e){return void 0!==o&&o.watch(e,this.name),e[this.field]}setValue(e,t){const s=this.field,n=e[s];if(n!==t){e[s]=t;const r=e[this.callback];i(r)&&r.call(e,n,t),c(e).notify(this.name)}}}class p extends N{constructor(e,t,s=!1){super(e,t),this.expression=e,this.isVolatileBinding=s,this.needsRefresh=!0,this.needsQueue=!0,this.isAsync=!0,this.first=this,this.last=null,this.propertySource=void 0,this.propertyName=void 0,this.notifier=void 0,this.next=void 0}setMode(e){this.isAsync=this.needsQueue=e}bind(e){this.controller=e;const t=this.observe(e.source,e.context);return!e.isBound&&this.requiresUnbind(e)&&e.onUnbind(this),t}requiresUnbind(e){return e.sourceLifetime!==E.coupled||this.first!==this.last||this.first.propertySource!==e.source}unbind(e){this.dispose()}observe(e,t){this.needsRefresh&&null!==this.last&&this.dispose();const s=o;let n;o=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;try{n=this.expression(e,t)}finally{o=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=c(e),i=null===s?this.first:{};if(i.propertySource=e,i.propertyName=t,i.notifier=n,n.subscribe(this,t),null!==s){if(!this.needsRefresh){let t;o=void 0,t=s.propertySource[s.propertyName],o=this,e===t&&(this.needsRefresh=!0)}s.next=i}this.last=i}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 u(p),Object.freeze({setArrayObserverFactory(e){a=e},getNotifier:c,track(e,t){o&&o.watch(e,t)},trackVolatile(){o&&(o.needsRefresh=!0)},notify(e,t){c(e).notify(t)},defineProperty(e,t){r(t)&&(t=new f(t)),d(e).push(t),Reflect.defineProperty(e,t.name,{enumerable:!0,get(){return t.getValue(this)},set(e){t.setValue(this,e)}})},getAccessors:d,binding(e,t,s=this.isVolatileBinding(e)){return new p(e,t,s)},isVolatileBinding:e=>t.test(e.toString())})}));function I(e,t){M.defineProperty(e,t)}function R(e,t,s){return Object.assign({},s,{get(){return M.trackVolatile(),s.get.apply(this)}})}const j=l.getById(s.contextEvent,(()=>{let e=null;return{get:()=>e,set(t){e=t}}})),V=Object.freeze({default:{index:0,length:0,get event(){return V.getEvent()},eventDetail(){return this.event.detail},eventTarget(){return this.event.target}},getEvent:()=>j.get(),setEvent(e){j.set(e)}});class _{constructor(e,t,s){this.index=e,this.removed=t,this.addedCount=s}adjustTo(e){let t=this.index;const s=e.length;return t>s?t=s-this.addedCount:t<0&&(t=s+this.removed.length+t-this.addedCount),this.index=t<0?0:t,this}}class L{constructor(e){this.sorted=e}}const H=Object.freeze({reset:1,splice:2,optimized:3}),z=new _(0,c,0);z.reset=!0;const F=[z];var P;function D(e,t,s,n,i,r){let o=0,a=0;const l=Math.min(s-t,r-i);if(0===t&&0===i&&(o=function(e,t,s){for(let n=0;n<s;++n)if(e[n]!==t[n])return n;return s}(e,n,l)),s===e.length&&r===n.length&&(a=function(e,t,s){let n=e.length,i=t.length,r=0;for(;r<s&&e[--n]===t[--i];)r++;return r}(e,n,l-o)),i+=o,r-=a,(s-=a)-(t+=o)==0&&r-i==0)return c;if(t===s){const e=new _(t,[],0);for(;i<r;)e.removed.push(n[i++]);return[e]}if(i===r)return[new _(t,[],s-t)];const d=function(e){let t=e.length-1,s=e[0].length-1,n=e[t][s];const i=[];for(;t>0||s>0;){if(0===t){i.push(P.add),s--;continue}if(0===s){i.push(P.delete),t--;continue}const r=e[t-1][s-1],o=e[t-1][s],a=e[t][s-1];let l;l=o<a?o<r?o:r:a<r?a:r,l===r?(r===n?i.push(P.leave):(i.push(P.update),n=r),t--,s--):l===o?(i.push(P.delete),t--,n=o):(i.push(P.add),s--,n=a)}return i.reverse()}(function(e,t,s,n,i,r){const o=r-i+1,a=s-t+1,l=new Array(o);let c,d;for(let e=0;e<o;++e)l[e]=new Array(a),l[e][0]=e;for(let e=0;e<a;++e)l[0][e]=e;for(let s=1;s<o;++s)for(let r=1;r<a;++r)e[t+r-1]===n[i+s-1]?l[s][r]=l[s-1][r-1]:(c=l[s-1][r]+1,d=l[s][r-1]+1,l[s][r]=c<d?c:d);return l}(e,t,s,n,i,r)),h=[];let u,f=t,p=i;for(let e=0;e<d.length;++e)switch(d[e]){case P.leave:void 0!==u&&(h.push(u),u=void 0),f++,p++;break;case P.update:void 0===u&&(u=new _(f,[],0)),u.addedCount++,f++,u.removed.push(n[p]),p++;break;case P.add:void 0===u&&(u=new _(f,[],0)),u.addedCount++,f++;break;case P.delete:void 0===u&&(u=new _(f,[],0)),u.removed.push(n[p]),p++}return void 0!==u&&h.push(u),h}function q(e,t){let s=!1,n=0;for(let l=0;l<t.length;l++){const c=t[l];if(c.index+=n,s)continue;const d=(i=e.index,r=e.index+e.removed.length,o=c.index,a=c.index+c.addedCount,r<o||a<i?-1:r===o||a===i?0:i<o?r<a?r-o:a-o:a<r?a-i:r-i);if(d>=0){t.splice(l,1),l--,n-=c.addedCount-c.removed.length,e.addedCount+=c.addedCount-d;const i=e.removed.length+c.removed.length-d;if(e.addedCount||i){let t=c.removed;if(e.index<c.index){const s=e.removed.slice(0,c.index-e.index);s.push(...t),t=s}if(e.index+e.removed.length>c.index+c.addedCount){const s=e.removed.slice(c.index+c.addedCount-e.index);t.push(...s)}e.removed=t,c.index<e.index&&(e.index=c.index)}else s=!0}else if(e.index<c.index){s=!0,t.splice(l,0,e),l++;const i=e.addedCount-e.removed.length;c.index+=i,n+=i}}var i,r,o,a;s||t.push(e)}!function(e){e[e.leave=0]="leave",e[e.update=1]="update",e[e.add=2]="add",e[e.delete=3]="delete"}(P||(P={}));let U=Object.freeze({support:H.optimized,normalize:(e,t,s)=>void 0===e?void 0===s?c:function(e,t){let s=[];const n=[];for(let e=0,s=t.length;e<s;e++)q(t[e],n);for(let t=0,i=n.length;t<i;++t){const i=n[t];1!==i.addedCount||1!==i.removed.length?s=s.concat(D(e,i.index,i.index+i.addedCount,i.removed,0,i.removed.length)):i.removed[0]!==e[i.index]&&s.push(i)}return s}(t,s):F,pop(e,t,s,n){const i=e.length>0,r=s.apply(e,n);return i&&t.addSplice(new _(e.length,[r],0)),r},push(e,t,s,n){const i=s.apply(e,n);return t.addSplice(new _(e.length-n.length,[],n.length).adjustTo(e)),i},reverse(e,t,s,n){const i=s.apply(e,n);e.sorted++;const r=[];for(let t=e.length-1;t>=0;t--)r.push(t);return t.addSort(new L(r)),i},shift(e,t,s,n){const i=e.length>0,r=s.apply(e,n);return i&&t.addSplice(new _(0,[r],0)),r},sort(e,t,s,n){const i=new Map;for(let t=0,s=e.length;t<s;++t){const s=i.get(e[t])||[];i.set(e[t],[...s,t])}const r=s.apply(e,n);e.sorted++;const o=[];for(let t=0,s=e.length;t<s;++t){const s=i.get(e[t]);o.push(s[0]),i.set(e[t],s.splice(1))}return t.addSort(new L(o)),r},splice(e,t,s,n){const i=s.apply(e,n);return t.addSplice(new _(+n[0],i,n.length>2?n.length-2:0).adjustTo(e)),i},unshift(e,t,s,n){const i=s.apply(e,n);return t.addSplice(new _(0,[],n.length).adjustTo(e)),i}});const W=Object.freeze({reset:F,setDefaultStrategy(e){U=e}});function Q(e,t,s,n=!0){Reflect.defineProperty(e,t,{value:s,enumerable:!1,writable:n})}class J extends N{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,M.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,M.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,Q(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,n=this.oldCollection;void 0===t&&void 0===n&&void 0===s||(this.needsQueue=!0,this.splices=void 0,this.sorts=void 0,this.oldCollection=void 0,void 0!==s?this.notify(s):this.notify((null!==(e=this._strategy)&&void 0!==e?e:U).normalize(n,this.subject,t)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,A.enqueue(this))}}let K=!1;const X=Object.freeze({sorted:0,enable(){if(K)return;K=!0,M.setArrayObserverFactory((e=>new J(e)));const e=Array.prototype;e.$fastPatch||(Q(e,"$fastPatch",1),Q(e,"sorted",0),[e.pop,e.push,e.reverse,e.shift,e.sort,e.splice,e.unshift].forEach((t=>{e[t.name]=function(...e){var s;const n=this.$fastController;return void 0===n?t.apply(this,e):(null!==(s=n.strategy)&&void 0!==s?s:U)[t.name](this,n,t,e)}})))}});function G(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(X.enable(),t=M.getNotifier(e)),M.track(t.lengthObserver,"length"),e.length}function Y(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(X.enable(),t=M.getNotifier(e)),M.track(t.sortObserver,"sorted"),e.sorted}class Z{constructor(e,t,s=!1){this.evaluate=e,this.policy=t,this.isVolatile=s}}class ee extends Z{createObserver(e){return M.binding(this.evaluate,e,this.isVolatile)}}function te(e,t,s=M.isVolatileBinding(e)){return new ee(e,t,s)}function se(e,t){const s=new ee(e);return s.options=t,s}class ne extends Z{createObserver(){return this}bind(e){return this.evaluate(e.source,e.context)}}function ie(e,t){return new ne(e,t)}function re(e){return i(e)?te(e):e instanceof Z?e:ie((()=>e))}u(ne);const oe=d(),ae=Object.freeze({getForInstance:oe.getForInstance,getByType:oe.getByType,define:e=>(oe.register({type:e}),e)});function le(){return function(e){ae.define(e)}}function ce(e,t,s){t.source.style.setProperty(e.targetAspect,s.bind(t))}class de{constructor(e,t){this.dataBinding=e,this.targetAspect=t}createCSS(e){return e(this),`var(${this.targetAspect})`}addedCallback(e){var t;const s=e.source;if(!s.$cssBindings){s.$cssBindings=new Map;const e=s.setAttribute;s.setAttribute=(t,n)=>{e.call(s,t,n),"style"===t&&s.$cssBindings.forEach(((e,t)=>ce(t,e.controller,e.observer)))}}const n=null!==(t=e[this.targetAspect])&&void 0!==t?t:e[this.targetAspect]=this.dataBinding.createObserver(this,this);n.controller=e,e.source.$cssBindings.set(this,{controller:e,observer:n})}connectedCallback(e){ce(this,e,e[this.targetAspect])}removedCallback(e){e.source.$cssBindings&&e.source.$cssBindings.delete(this)}handleChange(e,t){ce(this,t.controller,t)}}let he;function ue(e){return e.map((e=>e instanceof fe?ue(e.styles):[e])).reduce(((e,t)=>e.concat(t)),[])}ae.define(de);class fe{get strategy(){return null===this._strategy&&this.withStrategy(he),this._strategy}constructor(e){this.styles=e,this.targets=new WeakSet,this._strategy=null,this.behaviors=e.map((e=>e instanceof fe?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(ue(this.styles)),this}static setDefaultStrategy(e){he=e}static normalize(e){return void 0===e?void 0:Array.isArray(e)?new fe(e):e instanceof fe?e:new fe([e])}}fe.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;const pe=`${Math.random().toString(36).substring(2,8)}`;let ge=0;const be=()=>`--v${pe}${++ge}`;function ve(e,t){const s=[];let n="";const r=[],o=e=>{r.push(e)};for(let r=0,a=e.length-1;r<a;++r){n+=e[r];let a=t[r];i(a)?a=new de(te(a),be()).createCSS(o):a instanceof Z?a=new de(a,be()).createCSS(o):void 0!==ae.getForInstance(a)&&(a=a.createCSS(o)),a instanceof fe||a instanceof CSSStyleSheet?(""!==n.trim()&&(s.push(n),n=""),s.push(a)):n+=a}return n+=e[e.length-1],""!==n.trim()&&s.push(n),{styles:s,behaviors:r}}const me=(e,...t)=>{const{styles:s,behaviors:n}=ve(e,t),i=new fe(s);return n.length?i.withBehaviors(...n):i};class ye{constructor(e,t){this.behaviors=t,this.css="";const s=e.reduce(((e,t)=>(r(t)?this.css+=t:e.push(t),e)),[]);s.length&&(this.styles=new fe(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)}}ae.define(ye),me.partial=(e,...t)=>{const{styles:s,behaviors:n}=ve(e,t);return new ye(s,n)};const we=`fast-${Math.random().toString(36).substring(2,8)}`,Ce=`${we}{`,Se=`}${we}`,Te=Se.length;let Oe=0;const xe=()=>`${we}-${++Oe}`,Be=Object.freeze({interpolation:e=>`${Ce}${e}${Se}`,attribute:e=>`${xe()}="${Ce}${e}${Se}"`,comment:e=>`\x3c!--${Ce}${e}${Se}--\x3e`}),$e=Object.freeze({parse(e,t){const s=e.split(Ce);if(1===s.length)return null;const n=[];for(let e=0,i=s.length;e<i;++e){const i=s[e],r=i.indexOf(Se);let o;if(-1===r)o=i;else{const e=i.substring(0,r);n.push(t[e]),o=i.substring(r+Te)}""!==o&&n.push(o)}return n}}),Ne=d(),ke=Object.freeze({getForInstance:Ne.getForInstance,getByType:Ne.getByType,define:(e,t)=>((t=t||{}).type=e,Ne.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?f.tokenList:f.property;break;case"?":e.targetAspect=t.substring(1),e.aspectType=f.booleanAttribute;break;case"@":e.targetAspect=t.substring(1),e.aspectType=f.event;break;default:e.targetAspect=t,e.aspectType=f.attribute}else e.aspectType=f.content}});function Ae(e){return function(t){ke.define(t,e)}}class Ee{constructor(e){this.options=e}createHTML(e){return Be.attribute(e(this))}createBehavior(){return this}}u(Ee);const Me=e=>1===e.nodeType,Ie=e=>e?t=>1===t.nodeType&&t.matches(e):Me;class Re extends Ee{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,c),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 je extends Re{constructor(e){super(e),this.observerProperty=Symbol(),e.childList=!0}observe(e){let t=e[this.observerProperty];if(!t){t=new MutationObserver(((t,s)=>{this.updateTarget(this.getSource(e),this.computeNodes(e))})),t.toJSON=o,e[this.observerProperty]=t}t.observe(e,this.options)}disconnect(e){e[this.observerProperty].disconnect()}getNodes(e){return"selector"in this.options?Array.from(e.querySelectorAll(this.options.selector)):Array.from(e.childNodes)}}function Ve(e){return r(e)&&(e={property:e}),new je(e)}ke.define(je);const _e=/fe-b\$\$start\$\$(\d+)\$\$(.+)\$\$fe-b/,Le=/fe-b\$\$end\$\$(\d+)\$\$(.+)\$\$fe-b/,He=/fe-repeat\$\$start\$\$(\d+)\$\$fe-repeat/,ze=/fe-repeat\$\$end\$\$(\d+)\$\$fe-repeat/,Fe=/^(?:.{0,1000})fe-eb\$\$start\$\$(.+?)\$\$fe-eb/,Pe=/fe-eb\$\$end\$\$(.{0,1000})\$\$fe-eb(?:.{0,1000})$/;function De(e){return e&&e.nodeType===Node.COMMENT_NODE}const qe=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=>Le.test(e),isRepeatViewStartMarker:e=>He.test(e),isRepeatViewEndMarker:e=>ze.test(e),isElementBoundaryStartMarker:e=>De(e)&&Fe.test(e.data.trim()),isElementBoundaryEndMarker:e=>De(e)&&Pe.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,n=`${this.attributeMarkerName}-`;for(const i of e.getAttributeNames())if(i.startsWith(n)){const e=Number(i.slice(s));if(Number.isNaN(e))throw l.error(1601,{name:i,expectedFormat:`${n}<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 n=s.slice(t.length).split("-"),i=parseInt(n[0],10),r=parseInt(n[1],10);if(2!==n.length||Number.isNaN(i)||Number.isNaN(r)||i<0||r<1)throw l.error(1604,{name:s,expectedFormat:`${this.compactAttributeMarkerName}-{index}-{count}`});const o=[];for(let e=0;e<r;e++)o.push(i+e);return o},parseContentBindingStartMarker:e=>Qe(_e,e),parseContentBindingEndMarker:e=>Qe(Le,e),parseRepeatStartMarker:e=>Ue(He,e),parseRepeatEndMarker:e=>Ue(ze,e),parseElementBoundaryStartMarker:e=>We(Fe,e.trim()),parseElementBoundaryEndMarker:e=>We(Pe,e)});function Ue(e,t){const s=e.exec(t);return null===s?s:parseInt(s[1])}function We(e,t){const s=e.exec(t);return null===s?s:s[1]}function Qe(e,t){const s=e.exec(t);return null===s?s:[parseInt(s[1]),s[2]]}const Je=Symbol.for("fe-hydration");function Ke(e){return e[Je]===Je}const Xe="defer-hydration";class Ge extends Error{constructor(e,t,s){super(e),this.factories=t,this.node=s}}function Ye(e){return e.nodeType===Node.COMMENT_NODE}function Ze(e){return e.nodeType===Node.TEXT_NODE}function et(e,t){const s=document.createRange();return s.setStart(e,0),s.setEnd(t,Ye(t)||Ze(t)?t.data.length:t.childNodes.length),s}function tt(e,t,s,n){var i,r;const o=null!==(r=null!==(i=qe.parseAttributeBinding(e))&&void 0!==i?i:qe.parseEnumeratedAttributeBinding(e))&&void 0!==r?r:qe.parseCompactAttributeBinding(e);if(null!==o){for(const i of o){const r=t[i+n];if(!r)throw new Ge(`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);nt(r,e,s)}e.removeAttribute(qe.attributeMarkerName)}}function st(e,t,s,n,i,r){if(qe.isElementBoundaryStartMarker(e))!function(e,t){const s=qe.parseElementBoundaryStartMarker(e.data);let n=t.nextSibling();for(;null!==n;){if(Ye(n)){const e=qe.parseElementBoundaryEndMarker(n.data);if(e&&e===s)break}n=t.nextSibling()}}(e,t);else if(qe.isContentBindingStartMarker(e.data)){const o=qe.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(Ye(h)){const e=qe.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&&Ze(d[0]))nt(c,d[0],n);else{h!==u&&null!==h.previousSibling&&(i[c.targetNodeId]={first:u,last:h.previousSibling});nt(c,h.parentNode.insertBefore(document.createTextNode(""),h),n)}}}function nt(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 rt(e,t){const s=e.parentNode;let n,i=e;for(;i!==t;){if(n=i.nextSibling,!n)throw new Error(`Unmatched first/last child inside "${t.getRootNode().host.nodeName}".`);s.removeChild(i),i=n}s.removeChild(t)}class ot{constructor(){this.index=0,this.length=0}get event(){return V.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 at extends ot{constructor(e,t,s){super(),this.fragment=e,this.factories=t,this.targets=s,this.behaviors=null,this.unbindables=[],this.source=null,this.isBound=!1,this.sourceLifetime=E.unknown,this.context=this,this.firstChild=e.firstChild,this.lastChild=e.lastChild}appendTo(e){e.appendChild(this.fragment)}insertBefore(e){if(this.fragment.hasChildNodes())e.parentNode.insertBefore(this.fragment,e);else{const t=this.lastChild;if(e.previousSibling===t)return;const s=e.parentNode;let n,i=this.firstChild;for(;i!==t;)n=i.nextSibling,s.insertBefore(i,e),i=n;s.insertBefore(t,e)}}remove(){const e=this.fragment,t=this.lastChild;let s,n=this.firstChild;for(;n!==t;)s=n.nextSibling,e.appendChild(n),n=s;e.appendChild(t)}dispose(){rt(this.firstChild,this.lastChild),this.unbind()}onUnbind(e){this.unbindables.push(e)}bind(e,t=this){if(this.source===e)return;let s=this.behaviors;if(null===s){this.source=e,this.context=t,this.behaviors=s=new Array(this.factories.length);const n=this.factories;for(let e=0,t=n.length;e<t;++e){const t=n[e].createBehavior();t.bind(this),s[e]=t}}else{null!==this.source&&this.evaluateUnbindables(),this.isBound=!1,this.source=e,this.context=t;for(let e=0,t=s.length;e<t;++e)s[e].bind(this)}this.isBound=!0}unbind(){this.isBound&&null!==this.source&&(this.evaluateUnbindables(),this.source=null,this.context=this,this.isBound=!1)}evaluateUnbindables(){const e=this.unbindables;for(let t=0,s=e.length;t<s;++t)e[t].unbind(this);e.length=0}static disposeContiguousBatch(e){if(0!==e.length){rt(e[0].firstChild,e[e.length-1].lastChild);for(let t=0,s=e.length;t<s;++t)e[t].unbind()}}}u(at),M.defineProperty(at.prototype,"index"),M.defineProperty(at.prototype,"length");const lt="unhydrated",ct="hydrating",dt="hydrated";class ht extends Error{constructor(e,t,s,n){super(e),this.factory=t,this.fragment=s,this.templateString=n}}it=Je,u(class extends ot{get hydrationStage(){return this._hydrationStage}get targets(){return this._targets}get bindingViewBoundaries(){return this._bindingViewBoundaries}constructor(e,t,s,n){super(),this.firstChild=e,this.lastChild=t,this.sourceTemplate=s,this.hostBindingTarget=n,this[it]=Je,this.context=this,this.source=null,this.isBound=!1,this.sourceLifetime=E.unknown,this.unbindables=[],this.fragment=null,this.behaviors=null,this._hydrationStage=lt,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 n,i=this.firstChild;for(;i!==t;)n=i.nextSibling,s.insertBefore(i,e),i=n;s.insertBefore(t,e)}}appendTo(e){null!==this.fragment&&e.appendChild(this.fragment)}remove(){const e=this.fragment||(this.fragment=document.createDocumentFragment()),t=this.lastChild;let s,n=this.firstChild;for(;n!==t;){if(s=n.nextSibling,!s)throw new Error(`Unmatched first/last child inside "${t.getRootNode().host.nodeName}".`);e.appendChild(n),n=s}e.appendChild(t)}bind(e,t=this){var s;if(this.hydrationStage!==dt&&(this._hydrationStage=ct),this.source===e)return;let n=this.behaviors;if(null===n){this.source=e,this.context=t;try{const{targets:e,boundaries:t}=function(e,t,s){const n=et(e,t),i=n.commonAncestorContainer,r=function(e){let t=0;for(let s=0,n=e.length;s<n&&"h"===e[s].targetNodeId;++s)t++;return t}(s),o=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_COMMENT+NodeFilter.SHOW_TEXT,{acceptNode:e=>0===n.comparePoint(e,0)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}),a={},l={};let c=o.currentNode=e;for(;null!==c;){switch(c.nodeType){case Node.ELEMENT_NODE:tt(c,s,a,r);break;case Node.COMMENT_NODE:st(c,o,s,a,l,r)}c=o.nextNode()}return n.detach(),{targets:a,boundaries:l}}(this.firstChild,this.lastChild,this.factories);this._targets=e,this._bindingViewBoundaries=t}catch(e){if(e instanceof Ge){let t=this.sourceTemplate.html;"string"!=typeof t&&(t=t.innerHTML),e.templateString=t}throw e}this.behaviors=n=new Array(this.factories.length);const i=this.factories;for(let e=0,t=i.length;e<t;++e){const t=i[e];if("h"===t.targetNodeId&&this.hostBindingTarget&&nt(t,this.hostBindingTarget,this._targets),!(t.targetNodeId in this.targets)){let e=this.sourceTemplate.html;"string"!=typeof e&&(e=e.innerHTML);const n=(null===(s=this.firstChild)||void 0===s?void 0:s.getRootNode()).host,i=t,r=[`HydrationView was unable to successfully target bindings inside "<${((null==n?void 0:n.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 ht(r.join("\n"),t,et(this.firstChild,this.lastChild).cloneContents(),e)}{const s=t.createBehavior();s.bind(this),n[e]=s}}}else{null!==this.source&&this.evaluateUnbindables(),this.isBound=!1,this.source=e,this.context=t;for(let e=0,t=n.length;e<t;++e)n[e].bind(this)}this.isBound=!0,this._hydrationStage=dt}unbind(){this.isBound&&null!==this.source&&(this.evaluateUnbindables(),this.source=null,this.context=this,this.isBound=!1)}dispose(){rt(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 ut={[f.attribute]:m.setAttribute,[f.booleanAttribute]:m.setBooleanAttribute,[f.property]:(e,t,s)=>e[t]=s,[f.content]:function(e,t,s,n){if(null==s&&(s=""),function(e){return void 0!==e.create}(s)){e.textContent="";let t=e.$fastView;if(void 0===t)if(Ke(n)&&Ke(s)&&void 0!==n.bindingViewBoundaries[this.targetNodeId]&&n.hydrationStage!==dt){const e=n.bindingViewBoundaries[this.targetNodeId];t=s.hydrate(e.first,e.last)}else t=s.create();else e.$fastTemplate!==s&&(t.isComposed&&(t.remove(),t.unbind()),t=s.create());t.isComposed?t.needsBindOnly&&(t.needsBindOnly=!1,t.bind(n.source,n.context)):(t.isComposed=!0,t.bind(n.source,n.context),t.insertBefore(e),e.$fastView=t,e.$fastTemplate=s)}else{const t=e.$fastView;void 0!==t&&t.isComposed&&(t.isComposed=!1,t.remove(),t.needsBindOnly?t.needsBindOnly=!1:t.unbind()),e.textContent=s}},[f.tokenList]:function(e,t,s){var n;const i=`${this.id}-t`,r=null!==(n=e[i])&&void 0!==n?n:e[i]={v:0,cv:Object.create(null)},o=r.cv;let a=r.v;const l=e[t];if(null!=s&&s.length){const e=s.split(/\s+/);for(let t=0,s=e.length;t<s;++t){const s=e[t];""!==s&&(o[s]=a,l.add(s))}}if(r.v=a+1,0!==a){a-=1;for(const e in o)o[e]===a&&l.remove(e)}},[f.event]:()=>{}};class ft{constructor(e){this.dataBinding=e,this.updateTarget=null,this.aspectType=f.content}createHTML(e){return Be.interpolation(e(this))}createBehavior(){var e;if(null===this.updateTarget){const t=ut[this.aspectType],s=null!==(e=this.dataBinding.policy)&&void 0!==e?e:this.policy;if(!t)throw l.error(n.unsupportedBindingBehavior);this.data=`${this.id}-d`,this.updateTarget=s.protect(this.targetTagName,this.aspectType,this.targetAspect,t)}return this}bind(e){var t;const s=e.targets[this.targetNodeId],n=Ke(e)&&e.hydrationStage&&e.hydrationStage!==dt;switch(this.aspectType){case f.event:s[this.data]=e,s.addEventListener(this.targetAspect,this,this.dataBinding.options);break;case f.content:e.onUnbind(this);default:const i=null!==(t=s[this.data])&&void 0!==t?t:s[this.data]=this.dataBinding.createObserver(this,this);if(i.target=s,i.controller=e,n&&(this.aspectType===f.attribute||this.aspectType===f.booleanAttribute)){i.bind(e);break}this.updateTarget(s,this.targetAspect,i.bind(e),e)}}unbind(e){const t=e.targets[this.targetNodeId].$fastView;void 0!==t&&t.isComposed&&(t.unbind(),t.needsBindOnly=!0)}handleEvent(e){const t=e.currentTarget[this.data];if(t.isBound){V.setEvent(e);const s=this.dataBinding.evaluate(t.source,t.context);V.setEvent(null),!0!==s&&e.preventDefault()}}handleChange(e,t){const s=t.target,n=t.controller;this.updateTarget(s,this.targetAspect,t.bind(n),n)}}ke.define(ft,{aspected:!0});const pt=(e,t)=>`${e}.${t}`,gt={},bt={index:0,node:null};function vt(e){e.startsWith("fast-")||l.warn(n.hostBindingWithoutHost,{name:e})}const mt=new Proxy(document.createElement("div"),{get(e,t){vt(t);const s=Reflect.get(e,t);return i(s)?s.bind(e):s},set:(e,t,s)=>(vt(t),Reflect.set(e,t,s))});class yt{constructor(e,t,s){this.fragment=e,this.directives=t,this.policy=s,this.proto=null,this.nodeIds=new Set,this.descriptors={},this.factories=[]}addFactory(e,t,s,n,i){var r,o;this.nodeIds.has(s)||(this.nodeIds.add(s),this.addTargetDescriptor(t,s,n)),e.id=null!==(r=e.id)&&void 0!==r?r:xe(),e.targetNodeId=s,e.targetTagName=i,e.policy=null!==(o=e.policy)&&void 0!==o?o:this.policy,this.factories.push(e)}freeze(){return this.proto=Object.create(null,this.descriptors),this}addTargetDescriptor(e,t,s){const n=this.descriptors;if("r"===t||"h"===t||n[t])return;if(!n[e]){const t=e.lastIndexOf("."),s=e.substring(0,t),n=parseInt(e.substring(t+1));this.addTargetDescriptor(s,e,n)}let i=gt[t];if(!i){const n=`_${t}`;gt[t]=i={get(){var t;return null!==(t=this[n])&&void 0!==t?t:this[n]=this[e].childNodes[s]}}}n[t]=i}createView(e){const t=this.fragment.cloneNode(!0),s=Object.create(this.proto);s.r=t,s.h=null!=e?e:mt;for(const e of this.nodeIds)s[e];return new at(t,this.factories,s)}}function wt(e,t,s,n,i,r=!1){const o=s.attributes,a=e.directives;for(let l=0,c=o.length;l<c;++l){const d=o[l],h=d.value,u=$e.parse(h,a);let f=null;null===u?r&&(f=new ft(ie((()=>h),e.policy)),ke.assignAspect(f,d.name)):f=Ot.aggregate(u,e.policy),null!==f&&(s.removeAttributeNode(d),l--,c--,e.addFactory(f,t,n,i,s.tagName))}}function Ct(e,t,s){let n=0,i=t.firstChild;for(;i;){const t=St(e,s,i,n);i=t.node,n=t.index}}function St(e,t,s,n){const i=pt(t,n);switch(s.nodeType){case 1:wt(e,t,s,i,n),Ct(e,s,i);break;case 3:return function(e,t,s,n,i){const o=$e.parse(t.textContent,e.directives);if(null===o)return bt.node=t.nextSibling,bt.index=i+1,bt;let a,l=a=t;for(let t=0,c=o.length;t<c;++t){const c=o[t];0!==t&&(i++,n=pt(s,i),a=l.parentNode.insertBefore(document.createTextNode(""),l.nextSibling)),r(c)?a.textContent=c:(a.textContent=" ",ke.assignAspect(c),e.addFactory(c,s,n,i,null)),l=a}return bt.index=i+1,bt.node=l.nextSibling,bt}(e,s,t,i,n);case 8:const o=$e.parse(s.data,e.directives);null!==o&&e.addFactory(Ot.aggregate(o),t,i,n,null)}return bt.index=n+1,bt.node=s.nextSibling,bt}const Tt="TEMPLATE",Ot={compile(e,t,s=m.policy){let n;if(r(e)){n=document.createElement(Tt),n.innerHTML=s.createHTML(e);const t=n.content.firstElementChild;null!==t&&t.tagName===Tt&&(n=t)}else n=e;n.content.firstChild||n.content.lastChild||n.content.appendChild(document.createComment(""));const i=document.adoptNode(n.content),o=new yt(i,t,s);var a,l;return wt(o,"",n,"h",0,!0),a=i.firstChild,l=t,(a&&8==a.nodeType&&null!==$e.parse(a.data,l)||1===i.childNodes.length&&Object.keys(t).length>0)&&i.insertBefore(document.createComment(""),i.firstChild),Ct(o,i,"r"),bt.node=null,o.freeze()},setDefaultStrategy(e){this.compile=e},aggregate(e,t=m.policy){if(1===e.length)return e[0];let s,n,i=!1;const o=e.length,a=e.map((e=>r(e)?()=>e:(s=e.sourceAspect||s,i=i||e.dataBinding.isVolatile,n=n||e.dataBinding.policy,e.dataBinding.evaluate))),l=new ft(te(((e,t)=>{let s="";for(let n=0;n<o;++n)s+=a[n](e,t);return s}),null!=n?n:t,i));return ke.assignAspect(l,s),l}};class xt extends Ee{bind(e){e.source[this.options]=e.targets[this.targetNodeId]}}ke.define(xt);const Bt=e=>new xt(e);function $t(e,t,s,n){return new(s||(s=Promise))((function(i,r){function o(e){try{l(n.next(e))}catch(e){r(e)}}function a(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,a)}l((n=n.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const Nt="boolean",kt="reflect",At=Object.freeze({locate:h()}),Et={toView:e=>e?"true":"false",fromView:e=>!(null==e||"false"===e||!1===e||0===e)},Mt={toView:e=>"boolean"==typeof e?e.toString():"",fromView:e=>[null,void 0,void 0].includes(e)?null:Et.fromView(e)};function It(e){if(null==e)return null;const t=1*e;return isNaN(t)?null:t}const Rt={toView(e){const t=It(e);return t?t.toString():t},fromView:It};class jt{constructor(e,t,s=t.toLowerCase(),n=kt,i){this.guards=new Set,this.Owner=e,this.name=t,this.attribute=s,this.mode=n,this.converter=i,this.fieldName=`_${t}`,this.callbackName=`${t}Changed`,this.hasCallback=this.callbackName in e.prototype,n===Nt&&void 0===i&&(this.converter=Et)}setValue(e,t){const s=e[this.fieldName],n=this.converter;void 0!==n&&(t=n.fromView(t)),s!==t&&(e[this.fieldName]=t,this.tryReflectToAttribute(e),this.hasCallback&&e[this.callbackName](s,t),e.$fastController.notify(this.name))}getValue(e){return M.track(e,this.name),e[this.fieldName]}onAttributeChangedCallback(e,t){this.guards.has(e)||(this.guards.add(e),this.setValue(e,t),this.guards.delete(e))}tryReflectToAttribute(e){const t=this.mode,s=this.guards;s.has(e)||"fromView"===t||A.enqueue((()=>{s.add(e);const n=e[this.fieldName];switch(t){case kt:const t=this.converter;m.setAttribute(e,this.attribute,void 0!==t?t.toView(n):n);break;case Nt:m.setBooleanAttribute(e,this.attribute,n)}s.delete(e)}))}static collect(e,...t){const s=[];t.push(At.locate(e));for(let n=0,i=t.length;n<i;++n){const i=t[n];if(void 0!==i)for(let t=0,n=i.length;t<n;++t){const n=i[t];r(n)?s.push(new jt(e,n)):s.push(new jt(e,n.property,n.attribute,n.mode,n.converter))}}return s}}function Vt(e,t){let s;function n(e,t){arguments.length>1&&(s.property=t),At.locate(e.constructor).push(s)}return arguments.length>1?(s={},void n(e,t)):(s=void 0===e?{}:e,n)}var _t;const Lt={mode:"open"},Ht={},zt=new Set,Ft=l.getById(s.elementRegistry,(()=>d())),Pt={deferAndHydrate:"defer-and-hydrate"};class Dt{get isDefined(){return this.platformDefined}constructor(e,t=e.definition){var s;this.platformDefined=!1,r(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 n=e.prototype,i=jt.collect(e,t.attributes),o=new Array(i.length),a={},l={};for(let e=0,t=i.length;e<t;++e){const t=i[e];o[e]=t.attribute,a[t.name]=t,l[t.attribute]=t,M.defineProperty(n,t)}Reflect.defineProperty(e,"observedAttributes",{value:o,enumerable:!0}),this.attributes=i,this.propertyLookup=a,this.attributeLookup=l,this.shadowOptions=void 0===t.shadowOptions?Lt:null===t.shadowOptions?void 0:Object.assign(Object.assign({},Lt),t.shadowOptions),this.elementOptions=void 0===t.elementOptions?Ht:Object.assign(Object.assign({},Ht),t.elementOptions),this.styles=fe.normalize(t.styles),Ft.register(this),M.defineProperty(_t.isRegistered,this.name),_t.isRegistered[this.name]=this.type}define(e=this.registry){var t,s;const n=this.type;return e.get(this.name)||(this.platformDefined=!0,e.define(this.name,n,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 zt.has(e)||Ft.getByType(e)?new _t(class extends e{},t):new _t(e,t)}static registerBaseType(e){zt.add(e)}static composeAsync(e,t){return new Promise((s=>{(zt.has(e)||Ft.getByType(e))&&s(new _t(class extends e{},t));const n=new _t(e,t);M.getNotifier(n).subscribe({handleChange:()=>{var e,t;null===(t=null===(e=n.lifecycleCallbacks)||void 0===e?void 0:e.templateDidUpdate)||void 0===t||t.call(e,n.name),s(n)}},"template")}))}}_t=Dt,Dt.isRegistered={},Dt.getByType=Ft.getByType,Dt.getForInstance=Ft.getForInstance,Dt.registerAsync=e=>$t(void 0,void 0,void 0,(function*(){return new Promise((t=>{_t.isRegistered[e]&&t(_t.isRegistered[e]),M.getNotifier(_t.isRegistered).subscribe({handleChange:()=>t(_t.isRegistered[e])},e)}))})),M.defineProperty(Dt.prototype,"template");const qt=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/,Ut=Object.create(null);class Wt{constructor(e,t=Ut){this.html=e,this.factories=t}createHTML(e){const t=this.factories;for(const s in t)e(t[s]);return this.html}}function Qt(e,t,s,n=ke.getForInstance(e)){if(n.aspected){const s=qt.exec(t);null!==s&&ke.assignAspect(e,s[2])}return e.createHTML(s)}Wt.empty=new Wt(""),ke.define(Wt);class Jt{constructor(e,t={},s){this.policy=s,this.result=null,this.html=e,this.factories=t}compile(){return null===this.result&&(this.result=Ot.compile(this.html,this.factories,this.policy)),this.result}create(e){return this.compile().createView(e)}inline(){return new Wt(r(this.html)?this.html:this.html.innerHTML,this.factories)}withPolicy(e){if(this.result)throw l.error(n.cannotSetTemplatePolicyAfterCompilation);if(this.policy)throw l.error(n.onlySetTemplatePolicyOnce);return this.policy=e,this}render(e,t,s){const n=this.create(s);return n.bind(e),n.appendTo(t),n}static create(e,t,s){let n="";const r=Object.create(null),o=e=>{var t;const s=null!==(t=e.id)&&void 0!==t?t:e.id=xe();return r[s]=e,s};for(let s=0,r=e.length-1;s<r;++s){const r=e[s];let a,l=t[s];if(n+=r,i(l))l=new ft(te(l));else if(l instanceof Z)l=new ft(l);else if(!(a=ke.getForInstance(l))){const e=l;l=new ft(ie((()=>e)))}n+=Qt(l,r,o,a)}return new Jt(n+e[e.length-1],r,s)}}u(Jt);const Kt=(e,...t)=>{if(Array.isArray(e)&&Array.isArray(e.raw))return Jt.create(e,t);throw l.error(n.directCallToHTMLTagNotAllowed)};Kt.partial=e=>new Wt(e);class Xt{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),Ke(this.template)&&Ke(e)&&e.hydrationStage!==dt&&!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 Gt{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.templateBindingDependsOnData=s}createHTML(e){return Be.comment(e(this))}createBehavior(){return new Xt(this)}}ke.define(Gt);const Yt=new Map,Zt={":model":e=>e},es=Symbol("RenderInstruction"),ts="default-view",ss=Kt`
|
|
1
|
+
let e;const t="fast-kernel";try{if(document.currentScript)e=document.currentScript.getAttribute(t);else{const s=document.getElementsByTagName("script");e=s[s.length-1].getAttribute(t)}}catch(t){e="isolate"}let s;switch(e){case"share":s=Object.freeze({updateQueue:1,observable:2,contextEvent:3,elementRegistry:4});break;case"share-v2":s=Object.freeze({updateQueue:1.2,observable:2.2,contextEvent:3.2,elementRegistry:4.2});break;default:const e=`-${Math.random().toString(36).substring(2,8)}`;s=Object.freeze({updateQueue:`1.2${e}`,observable:`2.2${e}`,contextEvent:`3.2${e}`,elementRegistry:`4.2${e}`})}var i;!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"}(i||(i={}));const n=e=>"function"==typeof e,r=e=>"string"==typeof e,o=()=>{};!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 a={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},a));const l=globalThis.FAST;if(void 0===l.getById){const e=Object.create(null);Reflect.defineProperty(l,"getById",Object.assign({value(t,s){let i=e[t];return void 0===i&&(i=s?e[t]=s():null),i}},a))}void 0===l.error&&Object.assign(l,{warn(){},error:e=>new Error(`Error ${e}`),addMessages(){}});const c=Object.freeze([]);function d(){const e=new Map;return Object.freeze({register:t=>!e.has(t.type)&&(e.set(t.type,t),!0),getByType:t=>e.get(t),getForInstance(t){if(null!=t)return e.get(t.constructor)}})}function h(){const e=new WeakMap;return function(t){let s=e.get(t);if(void 0===s){let i=Reflect.getPrototypeOf(t);for(;void 0===s&&null!==i;)s=e.get(i),i=Reflect.getPrototypeOf(i);s=void 0===s?[]:s.slice(0),e.set(t,s)}return s}}function u(e){e.prototype.toJSON=o}const f=Object.freeze({none:0,attribute:1,booleanAttribute:2,property:3,content:4,tokenList:5,event:6}),p=e=>e,g=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:p}):{createHTML:p};let b=Object.freeze({createHTML:e=>g.createHTML(e),protect:(e,t,s,i)=>i});const v=b,m=Object.freeze({get policy(){return b},setPolicy(e){if(b!==v)throw l.error(i.onlySetDOMPolicyOnce);b=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 y(e,t,s,i){return(e,t,s,...n)=>{r(s)&&(s=s.replace(/(javascript:|vbscript:|data:)/,"")),i(e,t,s,...n)}}function w(e,t,s,n){throw l.error(i.blockedByDOMPolicy,{aspectName:s,tagName:null!=e?e:"text"})}const C={onabort:w,onauxclick:w,onbeforeinput:w,onbeforematch:w,onblur:w,oncancel:w,oncanplay:w,oncanplaythrough:w,onchange:w,onclick:w,onclose:w,oncontextlost:w,oncontextmenu:w,oncontextrestored:w,oncopy:w,oncuechange:w,oncut:w,ondblclick:w,ondrag:w,ondragend:w,ondragenter:w,ondragleave:w,ondragover:w,ondragstart:w,ondrop:w,ondurationchange:w,onemptied:w,onended:w,onerror:w,onfocus:w,onformdata:w,oninput:w,oninvalid:w,onkeydown:w,onkeypress:w,onkeyup:w,onload:w,onloadeddata:w,onloadedmetadata:w,onloadstart:w,onmousedown:w,onmouseenter:w,onmouseleave:w,onmousemove:w,onmouseout:w,onmouseover:w,onmouseup:w,onpaste:w,onpause:w,onplay:w,onplaying:w,onprogress:w,onratechange:w,onreset:w,onresize:w,onscroll:w,onsecuritypolicyviolation:w,onseeked:w,onseeking:w,onselect:w,onslotchange:w,onstalled:w,onsubmit:w,onsuspend:w,ontimeupdate:w,ontoggle:w,onvolumechange:w,onwaiting:w,onwebkitanimationend:w,onwebkitanimationiteration:w,onwebkitanimationstart:w,onwebkittransitionend:w,onwheel:w},S={elements:{a:{[f.attribute]:{href:y},[f.property]:{href:y}},area:{[f.attribute]:{href:y},[f.property]:{href:y}},button:{[f.attribute]:{formaction:y},[f.property]:{formAction:y}},embed:{[f.attribute]:{src:w},[f.property]:{src:w}},form:{[f.attribute]:{action:y},[f.property]:{action:y}},frame:{[f.attribute]:{src:y},[f.property]:{src:y}},iframe:{[f.attribute]:{src:y},[f.property]:{src:y,srcdoc:w}},input:{[f.attribute]:{formaction:y},[f.property]:{formAction:y}},link:{[f.attribute]:{href:w},[f.property]:{href:w}},object:{[f.attribute]:{codebase:w,data:w},[f.property]:{codeBase:w,data:w}},script:{[f.attribute]:{src:w,text:w},[f.property]:{src:w,text:w,innerText:w,textContent:w}},style:{[f.property]:{innerText:w,textContent:w}}},aspects:{[f.attribute]:Object.assign({},C),[f.property]:Object.assign({innerHTML:w},C),[f.event]:Object.assign({},C)}};function T(e,t){const s={};for(const i in t){const n=e[i],r=t[i];switch(n){case null:break;case void 0:s[i]=r;break;default:s[i]=n}}for(const t in e)t in s||(s[t]=e[t]);return Object.freeze(s)}function x(e,t){const s={};for(const i in t){const n=e[i],r=t[i];switch(n){case null:break;case void 0:s[i]=T(r,{});break;default:s[i]=T(n,r)}}for(const t in e)t in s||(s[t]=T(e[t],{}));return Object.freeze(s)}function O(e,t){const s={};for(const i in t){const n=e[i],r=t[i];switch(n){case null:break;case void 0:s[i]=x(n,{});break;default:s[i]=x(n,r)}}for(const t in e)t in s||(s[t]=x(e[t],{}));return Object.freeze(s)}function B(e,t,s,i,n){const r=e[s];if(r){const e=r[i];if(e)return e(t,s,i,n)}}const $=Object.freeze({create(e={}){var t,s;const i=null!==(t=e.trustedType)&&void 0!==t?t:function(){const e=e=>e;return globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:e}):{createHTML:e}}(),n=(r=null!==(s=e.guards)&&void 0!==s?s:{},o=S,Object.freeze({elements:r.elements?O(r.elements,o.elements):o.elements,aspects:r.aspects?x(r.aspects,o.aspects):o.aspects}));var r,o;return Object.freeze({createHTML:e=>i.createHTML(e),protect(e,t,s,i){var r;const o=(null!=e?e:"").toLowerCase(),a=n.elements[o];if(a){const n=B(a,e,t,s,i);if(n)return n}return null!==(r=B(n.aspects,e,t,s,i))&&void 0!==r?r:i}})}});class N{constructor(e,t){this.sub1=void 0,this.sub2=void 0,this.spillover=void 0,this.subject=e,this.sub1=t}has(e){return void 0===this.spillover?this.sub1===e||this.sub2===e:-1!==this.spillover.indexOf(e)}subscribe(e){const t=this.spillover;if(void 0===t){if(this.has(e))return;if(void 0===this.sub1)return void(this.sub1=e);if(void 0===this.sub2)return void(this.sub2=e);this.spillover=[this.sub1,this.sub2,e],this.sub1=void 0,this.sub2=void 0}else{-1===t.indexOf(e)&&t.push(e)}}unsubscribe(e){const t=this.spillover;if(void 0===t)this.sub1===e?this.sub1=void 0:this.sub2===e&&(this.sub2=void 0);else{const s=t.indexOf(e);-1!==s&&t.splice(s,1)}}notify(e){const t=this.spillover,s=this.subject;if(void 0===t){const t=this.sub1,i=this.sub2;void 0!==t&&t.handleChange(s,e),void 0!==i&&i.handleChange(s,e)}else for(let i=0,n=t.length;i<n;++i)t[i].handleChange(s,e)}}class k{constructor(e){this.subscribers={},this.subjectSubscribers=null,this.subject=e}notify(e){var t,s;null===(t=this.subscribers[e])||void 0===t||t.notify(e),null===(s=this.subjectSubscribers)||void 0===s||s.notify(e)}subscribe(e,t){var s,i;let n;n=t?null!==(s=this.subscribers[t])&&void 0!==s?s:this.subscribers[t]=new N(this.subject):null!==(i=this.subjectSubscribers)&&void 0!==i?i:this.subjectSubscribers=new N(this.subject),n.subscribe(e)}unsubscribe(e,t){var s,i;t?null===(s=this.subscribers[t])||void 0===s||s.unsubscribe(e):null===(i=this.subjectSubscribers)||void 0===i||i.unsubscribe(e)}}const A=l.getById(s.updateQueue,(()=>{const e=[],t=[],s=globalThis.requestAnimationFrame;let i=!0;function n(){if(t.length)throw t.shift()}function r(s){try{s.call()}catch(s){if(!i)throw e.length=0,s;t.push(s),setTimeout(n,0)}}function o(){let t=0;for(;t<e.length;)if(r(e[t]),t++,t>1024){for(let s=0,i=e.length-t;s<i;s++)e[s]=e[s+t];e.length-=t,t=0}e.length=0}function a(t){e.push(t),e.length<2&&(i?s(o):o())}return Object.freeze({enqueue:a,next:()=>new Promise(a),process:o,setMode:e=>i=e})})),E=Object.freeze({unknown:void 0,coupled:1}),M=l.getById(s.observable,(()=>{const e=A.enqueue,t=/(:|&&|\|\||if|\?\.)/,s=new WeakMap;let o,a=e=>{throw l.error(i.needsArrayObservation)};function c(e){var t;let i=null!==(t=e.$fastController)&&void 0!==t?t:s.get(e);return void 0===i&&(Array.isArray(e)?i=a(e):s.set(e,i=new k(e))),i}const d=h();class f{constructor(e){this.name=e,this.field=`_${e}`,this.callback=`${e}Changed`}getValue(e){return void 0!==o&&o.watch(e,this.name),e[this.field]}setValue(e,t){const s=this.field,i=e[s];if(i!==t){e[s]=t;const r=e[this.callback];n(r)&&r.call(e,i,t),c(e).notify(this.name)}}}class p extends N{constructor(e,t,s=!1){super(e,t),this.expression=e,this.isVolatileBinding=s,this.needsRefresh=!0,this.needsQueue=!0,this.isAsync=!0,this.first=this,this.last=null,this.propertySource=void 0,this.propertyName=void 0,this.notifier=void 0,this.next=void 0}setMode(e){this.isAsync=this.needsQueue=e}bind(e){this.controller=e;const t=this.observe(e.source,e.context);return!e.isBound&&this.requiresUnbind(e)&&e.onUnbind(this),t}requiresUnbind(e){return e.sourceLifetime!==E.coupled||this.first!==this.last||this.first.propertySource!==e.source}unbind(e){this.dispose()}observe(e,t){this.needsRefresh&&null!==this.last&&this.dispose();const s=o;let i;o=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;try{i=this.expression(e,t)}finally{o=s}return i}disconnect(){this.dispose()}dispose(){if(null!==this.last){let e=this.first;for(;void 0!==e;)e.notifier.unsubscribe(this,e.propertyName),e=e.next;this.last=null,this.needsRefresh=this.needsQueue=this.isAsync}}watch(e,t){const s=this.last,i=c(e),n=null===s?this.first:{};if(n.propertySource=e,n.propertyName=t,n.notifier=i,i.subscribe(this,t),null!==s){if(!this.needsRefresh){let t;o=void 0,t=s.propertySource[s.propertyName],o=this,e===t&&(this.needsRefresh=!0)}s.next=n}this.last=n}handleChange(){this.needsQueue?(this.needsQueue=!1,e(this)):this.isAsync||this.call()}call(){null!==this.last&&(this.needsQueue=this.isAsync,this.notify(this))}*records(){let e=this.first;for(;void 0!==e;)yield e,e=e.next}}return u(p),Object.freeze({setArrayObserverFactory(e){a=e},getNotifier:c,track(e,t){o&&o.watch(e,t)},trackVolatile(){o&&(o.needsRefresh=!0)},notify(e,t){c(e).notify(t)},defineProperty(e,t){r(t)&&(t=new f(t)),d(e).push(t),Reflect.defineProperty(e,t.name,{enumerable:!0,get(){return t.getValue(this)},set(e){t.setValue(this,e)}})},getAccessors:d,binding(e,t,s=this.isVolatileBinding(e)){return new p(e,t,s)},isVolatileBinding:e=>t.test(e.toString())})}));function I(e,t){M.defineProperty(e,t)}function R(e,t,s){return Object.assign({},s,{get(){return M.trackVolatile(),s.get.apply(this)}})}const j=l.getById(s.contextEvent,(()=>{let e=null;return{get:()=>e,set(t){e=t}}})),V=Object.freeze({default:{index:0,length:0,get event(){return V.getEvent()},eventDetail(){return this.event.detail},eventTarget(){return this.event.target}},getEvent:()=>j.get(),setEvent(e){j.set(e)}});class _{constructor(e,t,s){this.index=e,this.removed=t,this.addedCount=s}adjustTo(e){let t=this.index;const s=e.length;return t>s?t=s-this.addedCount:t<0&&(t=s+this.removed.length+t-this.addedCount),this.index=t<0?0:t,this}}class L{constructor(e){this.sorted=e}}const H=Object.freeze({reset:1,splice:2,optimized:3}),z=new _(0,c,0);z.reset=!0;const F=[z];var D;function P(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 c;if(t===s){const e=new _(t,[],0);for(;n<r;)e.removed.push(i[n++]);return[e]}if(n===r)return[new _(t,[],s-t)];const d=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(D.add),s--;continue}if(0===s){n.push(D.delete),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(D.leave):(n.push(D.update),i=r),t--,s--):l===o?(n.push(D.delete),t--,i=o):(n.push(D.add),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)),h=[];let u,f=t,p=n;for(let e=0;e<d.length;++e)switch(d[e]){case D.leave:void 0!==u&&(h.push(u),u=void 0),f++,p++;break;case D.update:void 0===u&&(u=new _(f,[],0)),u.addedCount++,f++,u.removed.push(i[p]),p++;break;case D.add:void 0===u&&(u=new _(f,[],0)),u.addedCount++,f++;break;case D.delete:void 0===u&&(u=new _(f,[],0)),u.removed.push(i[p]),p++}return void 0!==u&&h.push(u),h}function q(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)}!function(e){e[e.leave=0]="leave",e[e.update=1]="update",e[e.add=2]="add",e[e.delete=3]="delete"}(D||(D={}));let U=Object.freeze({support:H.optimized,normalize:(e,t,s)=>void 0===e?void 0===s?c:function(e,t){let s=[];const i=[];for(let e=0,s=t.length;e<s;e++)q(t[e],i);for(let t=0,n=i.length;t<n;++t){const n=i[t];1!==n.addedCount||1!==n.removed.length?s=s.concat(P(e,n.index,n.index+n.addedCount,n.removed,0,n.removed.length)):n.removed[0]!==e[n.index]&&s.push(n)}return s}(t,s):F,pop(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new _(e.length,[r],0)),r},push(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new _(e.length-i.length,[],i.length).adjustTo(e)),n},reverse(e,t,s,i){const n=s.apply(e,i);e.sorted++;const r=[];for(let t=e.length-1;t>=0;t--)r.push(t);return t.addSort(new L(r)),n},shift(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new _(0,[r],0)),r},sort(e,t,s,i){const n=new Map;for(let t=0,s=e.length;t<s;++t){const s=n.get(e[t])||[];n.set(e[t],[...s,t])}const r=s.apply(e,i);e.sorted++;const o=[];for(let t=0,s=e.length;t<s;++t){const s=n.get(e[t]);o.push(s[0]),n.set(e[t],s.splice(1))}return t.addSort(new L(o)),r},splice(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new _(+i[0],n,i.length>2?i.length-2:0).adjustTo(e)),n},unshift(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new _(0,[],i.length).adjustTo(e)),n}});const W=Object.freeze({reset:F,setDefaultStrategy(e){U=e}});function Q(e,t,s,i=!0){Reflect.defineProperty(e,t,{value:s,enumerable:!1,writable:i})}class J extends N{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,M.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,M.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,Q(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:U).normalize(i,this.subject,t)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,A.enqueue(this))}}let K=!1;const X=Object.freeze({sorted:0,enable(){if(K)return;K=!0,M.setArrayObserverFactory((e=>new J(e)));const e=Array.prototype;e.$fastPatch||(Q(e,"$fastPatch",1),Q(e,"sorted",0),[e.pop,e.push,e.reverse,e.shift,e.sort,e.splice,e.unshift].forEach((t=>{e[t.name]=function(...e){var s;const i=this.$fastController;return void 0===i?t.apply(this,e):(null!==(s=i.strategy)&&void 0!==s?s:U)[t.name](this,i,t,e)}})))}});function G(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(X.enable(),t=M.getNotifier(e)),M.track(t.lengthObserver,"length"),e.length}function Y(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(X.enable(),t=M.getNotifier(e)),M.track(t.sortObserver,"sorted"),e.sorted}class Z{constructor(e,t,s=!1){this.evaluate=e,this.policy=t,this.isVolatile=s}}class ee extends Z{createObserver(e){return M.binding(this.evaluate,e,this.isVolatile)}}function te(e,t,s=M.isVolatileBinding(e)){return new ee(e,t,s)}function se(e,t){const s=new ee(e);return s.options=t,s}class ie extends Z{createObserver(){return this}bind(e){return this.evaluate(e.source,e.context)}}function ne(e,t){return new ie(e,t)}function re(e){return n(e)?te(e):e instanceof Z?e:ne((()=>e))}u(ie);const oe=d(),ae=Object.freeze({getForInstance:oe.getForInstance,getByType:oe.getByType,define:e=>(oe.register({type:e}),e)});function le(){return function(e){ae.define(e)}}function ce(e,t,s){t.source.style.setProperty(e.targetAspect,s.bind(t))}class de{constructor(e,t){this.dataBinding=e,this.targetAspect=t}createCSS(e){return e(this),`var(${this.targetAspect})`}addedCallback(e){var t;const s=e.source;if(!s.$cssBindings){s.$cssBindings=new Map;const e=s.setAttribute;s.setAttribute=(t,i)=>{e.call(s,t,i),"style"===t&&s.$cssBindings.forEach(((e,t)=>ce(t,e.controller,e.observer)))}}const i=null!==(t=e[this.targetAspect])&&void 0!==t?t:e[this.targetAspect]=this.dataBinding.createObserver(this,this);i.controller=e,e.source.$cssBindings.set(this,{controller:e,observer:i})}connectedCallback(e){ce(this,e,e[this.targetAspect])}removedCallback(e){e.source.$cssBindings&&e.source.$cssBindings.delete(this)}handleChange(e,t){ce(this,t.controller,t)}}let he;function ue(e){return e.map((e=>e instanceof fe?ue(e.styles):[e])).reduce(((e,t)=>e.concat(t)),[])}ae.define(de);class fe{get strategy(){return null===this._strategy&&this.withStrategy(he),this._strategy}constructor(e){this.styles=e,this.targets=new WeakSet,this._strategy=null,this.behaviors=e.map((e=>e instanceof fe?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(ue(this.styles)),this}static setDefaultStrategy(e){he=e}static normalize(e){return void 0===e?void 0:Array.isArray(e)?new fe(e):e instanceof fe?e:new fe([e])}}fe.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;const pe=`${Math.random().toString(36).substring(2,8)}`;let ge=0;const be=()=>`--v${pe}${++ge}`;function ve(e,t){const s=[];let i="";const r=[],o=e=>{r.push(e)};for(let r=0,a=e.length-1;r<a;++r){i+=e[r];let a=t[r];n(a)?a=new de(te(a),be()).createCSS(o):a instanceof Z?a=new de(a,be()).createCSS(o):void 0!==ae.getForInstance(a)&&(a=a.createCSS(o)),a instanceof fe||a instanceof CSSStyleSheet?(""!==i.trim()&&(s.push(i),i=""),s.push(a)):i+=a}return i+=e[e.length-1],""!==i.trim()&&s.push(i),{styles:s,behaviors:r}}const me=(e,...t)=>{const{styles:s,behaviors:i}=ve(e,t),n=new fe(s);return i.length?n.withBehaviors(...i):n};class ye{constructor(e,t){this.behaviors=t,this.css="";const s=e.reduce(((e,t)=>(r(t)?this.css+=t:e.push(t),e)),[]);s.length&&(this.styles=new fe(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)}}ae.define(ye),me.partial=(e,...t)=>{const{styles:s,behaviors:i}=ve(e,t);return new ye(s,i)};const we=`fast-${Math.random().toString(36).substring(2,8)}`,Ce=`${we}{`,Se=`}${we}`,Te=Se.length;let xe=0;const Oe=()=>`${we}-${++xe}`,Be=Object.freeze({interpolation:e=>`${Ce}${e}${Se}`,attribute:e=>`${Oe()}="${Ce}${e}${Se}"`,comment:e=>`\x3c!--${Ce}${e}${Se}--\x3e`}),$e=Object.freeze({parse(e,t){const s=e.split(Ce);if(1===s.length)return null;const i=[];for(let e=0,n=s.length;e<n;++e){const n=s[e],r=n.indexOf(Se);let o;if(-1===r)o=n;else{const e=n.substring(0,r);i.push(t[e]),o=n.substring(r+Te)}""!==o&&i.push(o)}return i}}),Ne=d(),ke=Object.freeze({getForInstance:Ne.getForInstance,getByType:Ne.getByType,define:(e,t)=>((t=t||{}).type=e,Ne.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?f.tokenList:f.property;break;case"?":e.targetAspect=t.substring(1),e.aspectType=f.booleanAttribute;break;case"@":e.targetAspect=t.substring(1),e.aspectType=f.event;break;default:e.targetAspect=t,e.aspectType=f.attribute}else e.aspectType=f.content}});function Ae(e){return function(t){ke.define(t,e)}}class Ee{constructor(e){this.options=e}createHTML(e){return Be.attribute(e(this))}createBehavior(){return this}}u(Ee);const Me=e=>1===e.nodeType,Ie=e=>e?t=>1===t.nodeType&&t.matches(e):Me;class Re extends Ee{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,c),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 je extends Re{constructor(e){super(e),this.observerProperty=Symbol(),e.childList=!0}observe(e){let t=e[this.observerProperty];if(!t){t=new MutationObserver(((t,s)=>{this.updateTarget(this.getSource(e),this.computeNodes(e))})),t.toJSON=o,e[this.observerProperty]=t}t.observe(e,this.options)}disconnect(e){e[this.observerProperty].disconnect()}getNodes(e){return"selector"in this.options?Array.from(e.querySelectorAll(this.options.selector)):Array.from(e.childNodes)}}function Ve(e){return r(e)&&(e={property:e}),new je(e)}ke.define(je);const _e=/fe-b\$\$start\$\$(\d+)\$\$(.+)\$\$fe-b/,Le=/fe-b\$\$end\$\$(\d+)\$\$(.+)\$\$fe-b/,He=/fe-repeat\$\$start\$\$(\d+)\$\$fe-repeat/,ze=/fe-repeat\$\$end\$\$(\d+)\$\$fe-repeat/,Fe=/^(?:.{0,1000})fe-eb\$\$start\$\$(.+?)\$\$fe-eb/,De=/fe-eb\$\$end\$\$(.{0,1000})\$\$fe-eb(?:.{0,1000})$/;function Pe(e){return e&&e.nodeType===Node.COMMENT_NODE}const qe=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=>Le.test(e),isRepeatViewStartMarker:e=>He.test(e),isRepeatViewEndMarker:e=>ze.test(e),isElementBoundaryStartMarker:e=>Pe(e)&&Fe.test(e.data.trim()),isElementBoundaryEndMarker:e=>Pe(e)&&De.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 l.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 l.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=>Qe(_e,e),parseContentBindingEndMarker:e=>Qe(Le,e),parseRepeatStartMarker:e=>Ue(He,e),parseRepeatEndMarker:e=>Ue(ze,e),parseElementBoundaryStartMarker:e=>We(Fe,e.trim()),parseElementBoundaryEndMarker:e=>We(De,e)});function Ue(e,t){const s=e.exec(t);return null===s?s:parseInt(s[1])}function We(e,t){const s=e.exec(t);return null===s?s:s[1]}function Qe(e,t){const s=e.exec(t);return null===s?s:[parseInt(s[1]),s[2]]}const Je=Symbol.for("fe-hydration");function Ke(e){return e[Je]===Je}const Xe="defer-hydration";class Ge extends Error{constructor(e,t,s){super(e),this.factories=t,this.node=s}}function Ye(e){return e.nodeType===Node.COMMENT_NODE}function Ze(e){return e.nodeType===Node.TEXT_NODE}function et(e,t){const s=document.createRange();return s.setStart(e,0),s.setEnd(t,Ye(t)||Ze(t)?t.data.length:t.childNodes.length),s}function tt(e,t,s,i){var n,r;const o=null!==(r=null!==(n=qe.parseAttributeBinding(e))&&void 0!==n?n:qe.parseEnumeratedAttributeBinding(e))&&void 0!==r?r:qe.parseCompactAttributeBinding(e);if(null!==o){for(const n of o){const r=t[n+i];if(!r)throw new Ge(`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);it(r,e,s)}e.removeAttribute(qe.attributeMarkerName)}}function st(e,t,s,i,n,r){if(qe.isElementBoundaryStartMarker(e))!function(e,t){const s=qe.parseElementBoundaryStartMarker(e.data);let i=t.nextSibling();for(;null!==i;){if(Ye(i)){const e=qe.parseElementBoundaryEndMarker(i.data);if(e&&e===s)break}i=t.nextSibling()}}(e,t);else if(qe.isContentBindingStartMarker(e.data)){const o=qe.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(Ye(h)){const e=qe.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&&Ze(d[0]))it(c,d[0],i);else{h!==u&&null!==h.previousSibling&&(n[c.targetNodeId]={first:u,last:h.previousSibling});it(c,h.parentNode.insertBefore(document.createTextNode(""),h),i)}}}function it(e,t,s){if(void 0===e.targetNodeId)throw new Error("Factory could not be target to the node");s[e.targetNodeId]=t}var nt;function rt(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 ot{constructor(){this.index=0,this.length=0}get event(){return V.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 at extends ot{constructor(e,t,s){super(),this.fragment=e,this.factories=t,this.targets=s,this.behaviors=null,this.unbindables=[],this.source=null,this.isBound=!1,this.sourceLifetime=E.unknown,this.context=this,this.firstChild=e.firstChild,this.lastChild=e.lastChild}appendTo(e){e.appendChild(this.fragment)}insertBefore(e){if(this.fragment.hasChildNodes())e.parentNode.insertBefore(this.fragment,e);else{const t=this.lastChild;if(e.previousSibling===t)return;const s=e.parentNode;let i,n=this.firstChild;for(;n!==t;)i=n.nextSibling,s.insertBefore(n,e),n=i;s.insertBefore(t,e)}}remove(){const e=this.fragment,t=this.lastChild;let s,i=this.firstChild;for(;i!==t;)s=i.nextSibling,e.appendChild(i),i=s;e.appendChild(t)}dispose(){rt(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){rt(e[0].firstChild,e[e.length-1].lastChild);for(let t=0,s=e.length;t<s;++t)e[t].unbind()}}}u(at),M.defineProperty(at.prototype,"index"),M.defineProperty(at.prototype,"length");const lt="unhydrated",ct="hydrating",dt="hydrated";class ht extends Error{constructor(e,t,s,i){super(e),this.factory=t,this.fragment=s,this.templateString=i}}nt=Je,u(class extends ot{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[nt]=Je,this.context=this,this.source=null,this.isBound=!1,this.sourceLifetime=E.unknown,this.unbindables=[],this.fragment=null,this.behaviors=null,this._hydrationStage=lt,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!==dt&&(this._hydrationStage=ct),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=et(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:tt(c,s,a,r);break;case Node.COMMENT_NODE:st(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 Ge){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&&it(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 ht(r.join("\n"),t,et(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=dt}unbind(){this.isBound&&null!==this.source&&(this.evaluateUnbindables(),this.source=null,this.context=this,this.isBound=!1)}dispose(){rt(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 ut={[f.attribute]:m.setAttribute,[f.booleanAttribute]:m.setBooleanAttribute,[f.property]:(e,t,s)=>e[t]=s,[f.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(Ke(i)&&Ke(s)&&void 0!==i.bindingViewBoundaries[this.targetNodeId]&&i.hydrationStage!==dt){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}},[f.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)}},[f.event]:()=>{}};class ft{constructor(e){this.dataBinding=e,this.updateTarget=null,this.aspectType=f.content}createHTML(e){return Be.interpolation(e(this))}createBehavior(){var e;if(null===this.updateTarget){const t=ut[this.aspectType],s=null!==(e=this.dataBinding.policy)&&void 0!==e?e:this.policy;if(!t)throw l.error(i.unsupportedBindingBehavior);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=Ke(e)&&e.hydrationStage&&e.hydrationStage!==dt;switch(this.aspectType){case f.event:s[this.data]=e,s.addEventListener(this.targetAspect,this,this.dataBinding.options);break;case f.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===f.attribute||this.aspectType===f.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){V.setEvent(e);const s=this.dataBinding.evaluate(t.source,t.context);V.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)}}ke.define(ft,{aspected:!0});const pt=(e,t)=>`${e}.${t}`,gt={},bt={index:0,node:null};function vt(e){e.startsWith("fast-")||l.warn(i.hostBindingWithoutHost,{name:e})}const mt=new Proxy(document.createElement("div"),{get(e,t){vt(t);const s=Reflect.get(e,t);return n(s)?s.bind(e):s},set:(e,t,s)=>(vt(t),Reflect.set(e,t,s))});class yt{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:Oe(),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),10);this.addTargetDescriptor(s,e,i)}let n=gt[t];if(!n){const i=`_${t}`;gt[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:mt;for(const e of this.nodeIds)Reflect.get(s,e);return new at(t,this.factories,s)}}function wt(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=$e.parse(h,a);let f=null;null===u?r&&(f=new ft(ne((()=>h),e.policy)),ke.assignAspect(f,d.name)):f=xt.aggregate(u,e.policy),null!==f&&(s.removeAttributeNode(d),l--,c--,e.addFactory(f,t,i,n,s.tagName))}}function Ct(e,t,s){let i=0,n=t.firstChild;for(;n;){const t=St(e,s,n,i);n=t.node,i=t.index}}function St(e,t,s,i){const n=pt(t,i);switch(s.nodeType){case 1:wt(e,t,s,n,i),Ct(e,s,n);break;case 3:return function(e,t,s,i,n){const o=$e.parse(t.textContent,e.directives);if(null===o)return bt.node=t.nextSibling,bt.index=n+1,bt;let a,l=a=t;for(let t=0,c=o.length;t<c;++t){const c=o[t];0!==t&&(n++,i=pt(s,n),a=l.parentNode.insertBefore(document.createTextNode(""),l.nextSibling)),r(c)?a.textContent=c:(a.textContent=" ",ke.assignAspect(c),e.addFactory(c,s,i,n,null)),l=a}return bt.index=n+1,bt.node=l.nextSibling,bt}(e,s,t,n,i);case 8:{const r=$e.parse(s.data,e.directives);null!==r&&e.addFactory(xt.aggregate(r),t,n,i,null);break}}return bt.index=i+1,bt.node=s.nextSibling,bt}const Tt="TEMPLATE",xt={compile(e,t,s=m.policy){let i;if(r(e)){i=document.createElement(Tt),i.innerHTML=s.createHTML(e);const t=i.content.firstElementChild;null!==t&&t.tagName===Tt&&(i=t)}else i=e;i.content.firstChild||i.content.lastChild||i.content.appendChild(document.createComment(""));const n=document.adoptNode(i.content),o=new yt(n,t,s);var a,l;return wt(o,"",i,"h",0,!0),a=n.firstChild,l=t,(a&&8===a.nodeType&&null!==$e.parse(a.data,l)||1===n.childNodes.length&&Object.keys(t).length>0)&&n.insertBefore(document.createComment(""),n.firstChild),Ct(o,n,"r"),bt.node=null,o.freeze()},setDefaultStrategy(e){this.compile=e},aggregate(e,t=m.policy){if(1===e.length)return e[0];let s,i,n=!1;const o=e.length,a=e.map((e=>r(e)?()=>e:(s=e.sourceAspect||s,n=n||e.dataBinding.isVolatile,i=i||e.dataBinding.policy,e.dataBinding.evaluate))),l=new ft(te(((e,t)=>{let s="";for(let i=0;i<o;++i)s+=a[i](e,t);return s}),null!=i?i:t,n));return ke.assignAspect(l,s),l}};class Ot extends Ee{bind(e){e.source[this.options]=e.targets[this.targetNodeId]}}ke.define(Ot);const Bt=e=>new Ot(e);function $t(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())}))}"function"==typeof SuppressedError&&SuppressedError;const Nt="boolean",kt="reflect",At=Object.freeze({locate:h()}),Et={toView:e=>e?"true":"false",fromView:e=>!(null==e||"false"===e||!1===e||0===e)},Mt={toView:e=>"boolean"==typeof e?e.toString():"",fromView:e=>[null,void 0,void 0].includes(e)?null:Et.fromView(e)};function It(e){if(null==e)return null;const t=1*e;return isNaN(t)?null:t}const Rt={toView(e){const t=It(e);return t?t.toString():t},fromView:It};class jt{constructor(e,t,s=t.toLowerCase(),i=kt,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===Nt&&void 0===n&&(this.converter=Et)}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 M.track(e,this.name),e[this.fieldName]}onAttributeChangedCallback(e,t){this.guards.has(e)||(this.guards.add(e),this.setValue(e,t),this.guards.delete(e))}tryReflectToAttribute(e){const t=this.mode,s=this.guards;s.has(e)||"fromView"===t||A.enqueue((()=>{s.add(e);const i=e[this.fieldName];switch(t){case kt:const t=this.converter;m.setAttribute(e,this.attribute,void 0!==t?t.toView(i):i);break;case Nt:m.setBooleanAttribute(e,this.attribute,i)}s.delete(e)}))}static collect(e,...t){const s=[];t.push(At.locate(e));for(let i=0,n=t.length;i<n;++i){const n=t[i];if(void 0!==n)for(let t=0,i=n.length;t<i;++t){const i=n[t];r(i)?s.push(new jt(e,i)):s.push(new jt(e,i.property,i.attribute,i.mode,i.converter))}}return s}}function Vt(e,t){let s;function i(e,t){arguments.length>1&&(s.property=t),At.locate(e.constructor).push(s)}return arguments.length>1?(s={},void i(e,t)):(s=void 0===e?{}:e,i)}var _t;const Lt={mode:"open"},Ht={},zt=new Set,Ft=l.getById(s.elementRegistry,(()=>d())),Dt={deferAndHydrate:"defer-and-hydrate"};class Pt{get isDefined(){return this.platformDefined}constructor(e,t=e.definition){var s;this.platformDefined=!1,r(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=jt.collect(e,t.attributes),o=new Array(n.length),a={},l={};for(let e=0,t=n.length;e<t;++e){const t=n[e];o[e]=t.attribute,a[t.name]=t,l[t.attribute]=t,M.defineProperty(i,t)}Reflect.defineProperty(e,"observedAttributes",{value:o,enumerable:!0}),this.attributes=n,this.propertyLookup=a,this.attributeLookup=l,this.shadowOptions=void 0===t.shadowOptions?Lt:null===t.shadowOptions?void 0:Object.assign(Object.assign({},Lt),t.shadowOptions),this.elementOptions=void 0===t.elementOptions?Ht:Object.assign(Object.assign({},Ht),t.elementOptions),this.styles=fe.normalize(t.styles),Ft.register(this),M.defineProperty(_t.isRegistered,this.name),_t.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 zt.has(e)||Ft.getByType(e)?new _t(class extends e{},t):new _t(e,t)}static registerBaseType(e){zt.add(e)}static composeAsync(e,t){return new Promise((s=>{(zt.has(e)||Ft.getByType(e))&&s(new _t(class extends e{},t));const i=new _t(e,t);M.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")}))}}_t=Pt,Pt.isRegistered={},Pt.getByType=Ft.getByType,Pt.getForInstance=Ft.getForInstance,Pt.registerAsync=e=>$t(void 0,void 0,void 0,(function*(){return new Promise((t=>{_t.isRegistered[e]&&t(_t.isRegistered[e]),M.getNotifier(_t.isRegistered).subscribe({handleChange:()=>t(_t.isRegistered[e])},e)}))})),M.defineProperty(Pt.prototype,"template");const qt=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/,Ut=Object.create(null);class Wt{constructor(e,t=Ut){this.html=e,this.factories=t}createHTML(e){const t=this.factories;for(const s in t)e(t[s]);return this.html}}function Qt(e,t,s,i=ke.getForInstance(e)){if(i.aspected){const s=qt.exec(t);null!==s&&ke.assignAspect(e,s[2])}return e.createHTML(s)}Wt.empty=new Wt(""),ke.define(Wt);class Jt{constructor(e,t={},s){this.policy=s,this.result=null,this.html=e,this.factories=t}compile(){return null===this.result&&(this.result=xt.compile(this.html,this.factories,this.policy)),this.result}create(e){return this.compile().createView(e)}inline(){return new Wt(r(this.html)?this.html:this.html.innerHTML,this.factories)}withPolicy(e){if(this.result)throw l.error(i.cannotSetTemplatePolicyAfterCompilation);if(this.policy)throw l.error(i.onlySetTemplatePolicyOnce);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 r=Object.create(null),o=e=>{var t;const s=null!==(t=e.id)&&void 0!==t?t:e.id=Oe();return r[s]=e,s};for(let s=0,r=e.length-1;s<r;++s){const r=e[s];let a,l=t[s];if(i+=r,n(l))l=new ft(te(l));else if(l instanceof Z)l=new ft(l);else if(!(a=ke.getForInstance(l))){const e=l;l=new ft(ne((()=>e)))}i+=Qt(l,r,o,a)}return new Jt(i+e[e.length-1],r,s)}}u(Jt);const Kt=(e,...t)=>{if(Array.isArray(e)&&Array.isArray(e.raw))return Jt.create(e,t);throw l.error(i.directCallToHTMLTagNotAllowed)};Kt.partial=e=>new Wt(e);class Xt{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),Ke(this.template)&&Ke(e)&&e.hydrationStage!==dt&&!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 Gt{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.templateBindingDependsOnData=s}createHTML(e){return Be.comment(e(this))}createBehavior(){return new Xt(this)}}ke.define(Gt);const Yt=new Map,Zt="default-view",es=Kt`
|
|
2
2
|
|
|
3
|
-
`;function ns(e){return void 0===e?ss:e.template}function is(e,t){const s=[],n=[],{attributes:r,directives:o,content:a,policy:l}=null!=t?t:{};if(s.push(`<${e}`),r){const e=Object.getOwnPropertyNames(r);for(let t=0,i=e.length;t<i;++t){const i=e[t];0===t?s[0]=`${s[0]} ${i}="`:s.push(`" ${i}="`),n.push(r[i])}s.push('"')}if(o){s[s.length-1]+=" ";for(let e=0,t=o.length;e<t;++e){const t=o[e];s.push(e>0?"":" "),n.push(t)}}if(s[s.length-1]+=">",a&&i(a.create))n.push(a),s.push(`</${e}>`);else{const t=s.length-1;s[t]=`${s[t]}${null!=a?a:""}</${e}>`}return Jt.create(s,n,l)}function rs(e){var t;const s=null!==(t=e.name)&&void 0!==t?t:ts;let n;if((i=e).element||i.tagName){let t=e.tagName;if(!t){const s=Dt.getByType(e.element);if(!s)throw new Error("Invalid element for model rendering.");t=s.name}e.attributes||(e.attributes=Zt),n=is(t,e)}else n=e.template;var i;return{brand:es,type:e.type,name:s,template:n}}function os(e){return e&&e.brand===es}function as(e,t){const s=Yt.get(e);if(void 0!==s)return s[null!=t?t:ts]}function ls(e,t){if(e)return as(e.constructor,t)}Object.freeze({instanceOf:os,create:rs,createElementTemplate:is,register:function(e){let t=Yt.get(e.type);void 0===t&&Yt.set(e.type,t=Object.create(null));const s=os(e)?e:rs(e);return t[s.name]=s},getByType:as,getForInstance:ls});class cs{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 ds(e,t){let s,n;s=void 0===e?ie((e=>e)):re(e);let o=!1;if(void 0===t)o=!0,n=ie(((e,t)=>{var n;const i=s.evaluate(e,t);return i instanceof Node?null!==(n=i.$fastTemplate)&&void 0!==n?n:new cs(i):ns(ls(i))}));else if(i(t))n=te(((e,n)=>{var i;let o=t(e,n);return r(o)?o=ns(ls(s.evaluate(e,n),o)):o instanceof Node&&(o=null!==(i=o.$fastTemplate)&&void 0!==i?i:new cs(o)),o}),void 0,!0);else if(r(t))o=!0,n=ie(((e,n)=>{var i;const r=s.evaluate(e,n);return r instanceof Node?null!==(i=r.$fastTemplate)&&void 0!==i?i:new cs(r):ns(ls(r,t))}));else if(t instanceof Z){const e=t.evaluate;t.evaluate=(t,n)=>{var i;let o=e(t,n);return r(o)?o=ns(ls(s.evaluate(t,n),o)):o instanceof Node&&(o=null!==(i=o.$fastTemplate)&&void 0!==i?i:new cs(o)),o},n=t}else n=ie(((e,s)=>t));return new Gt(s,n,o)}const hs=Object.freeze({positioning:!1,recycle:!0});function us(e,t,s,n){e.context.parent=n.source,e.context.parentContext=n.context,e.bind(t[s])}function fs(e,t,s,n){e.context.parent=n.source,e.context.parentContext=n.context,e.context.length=t.length,e.context.index=s,e.bind(t[s])}function ps(e){return e.nodeType===Node.COMMENT_NODE}class gs extends Error{constructor(e,t){super(e),this.propertyBag=t}}class bs{constructor(e){this.directive=e,this.items=null,this.itemsObserver=null,this.bindView=us,this.views=[],this.itemsBindingObserver=e.dataBinding.createObserver(this,e),this.templateBindingObserver=e.templateBinding.createObserver(this,e),e.options.positioning&&(this.bindView=fs)}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),Ke(this.template)&&Ke(e)&&e.hydrationStage!==dt?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=c);const t=this.itemsObserver,s=this.itemsObserver=M.getNotifier(this.items),n=t!==s;n&&null!==t&&t.unsubscribe(this),(n||e)&&s.subscribe(this)}updateSortedViews(e){const t=this.views;for(let s=0,n=e.length;s<n;++s){const n=e[s].sorted.slice(),i=n.slice().sort();for(let e=0,s=n.length;e<s;++e){const s=n.find((t=>n[e]===i[t]));if(s!==e){const n=i.splice(s,1);i.splice(e,0,...n);const r=t[e],o=r?r.firstChild:this.location;t[s].remove(),t[s].insertBefore(o);const a=t.splice(s,1);t.splice(e,0,...a)}}}}updateSplicedViews(e){const t=this.views,s=this.bindView,n=this.items,i=this.template,r=this.controller,o=this.directive.options.recycle,a=[];let l=0,c=0;for(let d=0,h=e.length;d<h;++d){const h=e[d],u=h.removed;let f=0,p=h.index;const g=p+h.addedCount,b=t.splice(h.index,u.length),v=c=a.length+b.length;for(;p<g;++p){const e=t[p],d=e?e.firstChild:this.location;let h;o&&c>0?(f<=v&&b.length>0?(h=b[f],f++):(h=a[l],l++),c--):h=i.create(),t.splice(p,0,h),s(h,n,p,r),h.insertBefore(d)}b[f]&&a.push(...b.slice(f))}for(let e=l,t=a.length;e<t;++e)a[e].dispose();if(this.directive.options.positioning)for(let e=0,s=t.length;e<s;++e){const n=t[e].context;n.length=s,n.index=e}}refreshAllViews(e=!1){const t=this.items,s=this.template,n=this.location,i=this.bindView,r=this.controller;let o=t.length,a=this.views,l=a.length;if(0!==o&&!e&&this.directive.options.recycle||(at.disposeContiguousBatch(a),l=0),0===l){this.views=a=new Array(o);for(let e=0;e<o;++e){const o=s.create();i(o,t,e,r),a[e]=o,o.insertBefore(n)}}else{let e=0;for(;e<o;++e)if(e<l){const n=a[e];if(!n){const t=new XMLSerializer;throw new gs(`View is null or undefined inside "${this.location.getRootNode().host.nodeName}".`,{index:e,hydrationStage:this.controller.hydrationStage,itemsLength:o,viewsState:a.map((e=>e?"hydrated":"empty")),viewTemplateString:t.serializeToString(s.create().fragment),rootNodeContent:t.serializeToString(this.location.getRootNode())})}i(n,t,e,r)}else{const o=s.create();i(o,t,e,r),a.push(o),o.insertBefore(n)}const c=a.splice(e,l-e);for(e=0,o=c.length;e<o;++e)c[e].dispose()}}unbindAllViews(){const e=this.views;for(let t=0,s=e.length;t<s;++t){const s=e[t];if(!s){const s=new XMLSerializer;throw new gs(`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(!ps(t)){t=t.previousSibling;continue}const s=qe.parseRepeatEndMarker(t.data);if(null===s){t=t.previousSibling;continue}t.data="";const n=t.previousSibling;if(!n)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": end should never be null.`);let i=n,r=0;for(;null!==i;){if(ps(i))if(qe.isRepeatViewEndMarker(i.data))r++;else if(qe.isRepeatViewStartMarker(i.data)){if(!r){if(qe.parseRepeatStartMarker(i.data)!==s)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": Mismatched start and end markers.`);i.data="",t=i.previousSibling,i=i.nextSibling;const r=e.hydrate(i,n);this.views[s]=r,this.bindView(r,this.items,s,this.controller);break}r--}i=i.previousSibling}if(!i)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": start should never be null.`)}}}class vs{createHTML(e){return Be.comment(e(this))}constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.options=s,X.enable()}createBehavior(){return new bs(this)}}function ms(e,t,s=hs){const n=re(e),i=re(t);return new vs(n,i,Object.assign(Object.assign({},hs),s))}ke.define(vs);const ys="slotchange";class ws extends Re{observe(e){e.addEventListener(ys,this)}disconnect(e){e.removeEventListener(ys,this)}getNodes(e){return e.assignedNodes(this.options)}handleEvent(e){const t=e.currentTarget;this.updateTarget(this.getSource(t),this.computeNodes(t))}}function Cs(e){return r(e)&&(e={property:e}),new ws(e)}ke.define(ws);const Ss=()=>null;function Ts(e){return void 0===e?Ss:i(e)?e:()=>e}function Os(e,t,s){const n=i(e)?e:()=>e,r=Ts(t),o=Ts(s);return(e,t)=>n(e,t)?r(e,t):o(e,t)}class xs extends MutationObserver{constructor(e){super((function(e){this.callback.call(null,e.filter((e=>this.observedNodes.has(e.target))))})),this.callback=e,this.observedNodes=new Set}observe(e,t){this.observedNodes.add(e),super.observe(e,t)}unobserve(e){this.observedNodes.delete(e),this.observedNodes.size<1&&this.disconnect()}}Object.freeze({create(e){const t=[],s={};let n=null,i=!1;return{source:e,context:V.default,targets:s,get isBound(){return i},addBehaviorFactory(e,t){var s,n,i,r;const o=e;o.id=null!==(s=o.id)&&void 0!==s?s:xe(),o.targetNodeId=null!==(n=o.targetNodeId)&&void 0!==n?n:xe(),o.targetTagName=null!==(i=t.tagName)&&void 0!==i?i:null,o.policy=null!==(r=o.policy)&&void 0!==r?r:m.policy,this.addTarget(o.targetNodeId,t),this.addBehavior(o.createBehavior())},addTarget(e,t){s[e]=t},addBehavior(e){t.push(e),i&&e.bind(this)},onUnbind(e){null===n&&(n=[]),n.push(e)},connectedCallback(e){i||(i=!0,t.forEach((e=>e.bind(this))))},disconnectedCallback(e){i&&(i=!1,null!==n&&n.forEach((e=>e.unbind(this))))}}}});const Bs={bubbles:!0,composed:!0,cancelable:!0},$s="isConnected",Ns=new WeakMap;function ks(e){var t,s;return null!==(s=null!==(t=e.shadowRoot)&&void 0!==t?t:Ns.get(e))&&void 0!==s?s:null}let As;var Es;!function(e){e[e.connecting=0]="connecting",e[e.connected=1]="connected",e[e.disconnecting=2]="disconnecting",e[e.disconnected=3]="disconnected"}(Es||(Es={}));class Ms extends k{get isConnected(){return M.track(this,$s),this.stage===Es.connected}get context(){var e,t;return null!==(t=null===(e=this.view)||void 0===e?void 0:e.context)&&void 0!==t?t:V.default}get isBound(){var e,t;return null!==(t=null===(e=this.view)||void 0===e?void 0:e.isBound)&&void 0!==t&&t}get sourceLifetime(){var e;return null===(e=this.view)||void 0===e?void 0:e.sourceLifetime}get template(){var e;if(null===this._template){const t=this.definition;this.source.resolveTemplate?this._template=this.source.resolveTemplate():t.template&&(this._template=null!==(e=t.template)&&void 0!==e?e:null)}return this._template}set template(e){this._template!==e&&(this._template=e,this.needsInitialization||this.renderTemplate(e))}get shadowOptions(){return this._shadowRootOptions}set shadowOptions(e){if(void 0===this._shadowRootOptions&&void 0!==e){this._shadowRootOptions=e;let t=this.source.shadowRoot;t?this.hasExistingShadowRoot=!0:(t=this.source.attachShadow(e),"closed"===e.mode&&Ns.set(this.source,t))}}get mainStyles(){var e;if(null===this._mainStyles){const t=this.definition;this.source.resolveStyles?this._mainStyles=this.source.resolveStyles():t.styles&&(this._mainStyles=null!==(e=t.styles)&&void 0!==e?e:null)}return this._mainStyles}set mainStyles(e){this._mainStyles!==e&&(null!==this._mainStyles&&this.removeStyles(this._mainStyles),this._mainStyles=e,this.needsInitialization||this.addStyles(e))}constructor(e,t){super(e),this.boundObservables=null,this.needsInitialization=!0,this.hasExistingShadowRoot=!1,this._template=null,this.stage=Es.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 s=M.getAccessors(e);if(s.length>0){const t=this.boundObservables=Object.create(null);for(let n=0,i=s.length;n<i;++n){const i=s[n].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,s;const n=null!==(t=this.behaviors)&&void 0!==t?t:this.behaviors=new Map,i=null!==(s=n.get(e))&&void 0!==s?s:0;0===i?(n.set(e,1),e.addedCallback&&e.addedCallback(this),!e.connectedCallback||this.guardBehaviorConnection||this.stage!==Es.connected&&this.stage!==Es.connecting||e.connectedCallback(this)):n.set(e,i+1)}removeBehavior(e,t=!1){const s=this.behaviors;if(null===s)return;const n=s.get(e);void 0!==n&&(1===n||t?(s.delete(e),e.disconnectedCallback&&this.stage!==Es.disconnected&&e.disconnectedCallback(this),e.removedCallback&&e.removedCallback(this)):s.set(e,n-1))}addStyles(e){var t;if(!e)return;const s=this.source;if(e instanceof HTMLElement){(null!==(t=ks(s))&&void 0!==t?t:this.source).append(e)}else if(!e.isAttachedTo(s)){const t=e.behaviors;if(e.addStylesTo(s),null!==t)for(let e=0,s=t.length;e<s;++e)this.addBehavior(t[e])}}removeStyles(e){var t;if(!e)return;const s=this.source;if(e instanceof HTMLElement){(null!==(t=ks(s))&&void 0!==t?t:s).removeChild(e)}else if(e.isAttachedTo(s)){const t=e.behaviors;if(e.removeStylesFrom(s),null!==t)for(let e=0,s=t.length;e<s;++e)this.removeBehavior(t[e])}}connect(){this.stage===Es.disconnected&&(this.stage=Es.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=Es.connected,M.notify(this,$s))}bindObservables(){if(null!==this.boundObservables){const e=this.source,t=this.boundObservables,s=Object.keys(t);for(let n=0,i=s.length;n<i;++n){const i=s[n];e[i]=t[i]}this.boundObservables=null}}connectBehaviors(){if(!1===this.behaviorsConnected){const e=this.behaviors;if(null!==e){this.guardBehaviorConnection=!0;for(const t of e.keys())t.connectedCallback&&t.connectedCallback(this);this.guardBehaviorConnection=!1}this.behaviorsConnected=!0}}disconnectBehaviors(){if(!0===this.behaviorsConnected){const e=this.behaviors;if(null!==e)for(const t of e.keys())t.disconnectedCallback&&t.disconnectedCallback(this);this.behaviorsConnected=!1}}disconnect(){this.stage===Es.connected&&(this.stage=Es.disconnecting,M.notify(this,$s),null!==this.view&&this.view.unbind(),this.disconnectBehaviors(),this.stage=Es.disconnected)}onAttributeChangedCallback(e,t,s){const n=this.definition.attributeLookup[e];void 0!==n&&n.onAttributeChangedCallback(this.source,s)}emit(e,t,s){return this.stage===Es.connected&&this.source.dispatchEvent(new CustomEvent(e,Object.assign(Object.assign({detail:t},Bs),s)))}renderTemplate(e){var t;const s=this.source,n=null!==(t=ks(s))&&void 0!==t?t:s;if(null!==this.view)this.view.dispose(),this.view=null;else if(!this.needsInitialization||this.hasExistingShadowRoot){this.hasExistingShadowRoot=!1;for(let e=n.firstChild;null!==e;e=n.firstChild)n.removeChild(e)}e&&(this.view=e.render(s,n,s),this.view.sourceLifetime=E.coupled)}static forCustomElement(e,t=!1){const s=e.$fastController;if(void 0!==s&&!t)return s;const i=Dt.getForInstance(e);if(void 0===i)throw l.error(n.missingElementDefinition);return M.getNotifier(i).subscribe({handleChange:()=>{Ms.forCustomElement(e,!0),e.$fastController.connect()}},"template"),M.getNotifier(i).subscribe({handleChange:()=>{Ms.forCustomElement(e,!0),e.$fastController.connect()}},"shadowOptions"),e.$fastController=new As(e,i)}static setStrategy(e){As=e}}function Is(e){var t;return"adoptedStyleSheets"in e?e:null!==(t=ks(e))&&void 0!==t?t:e.getRootNode()}u(Ms),Ms.setStrategy(Ms);class Rs{constructor(e){const t=Rs.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){Ls(Is(e),this.sheets)}removeStylesFrom(e){Hs(Is(e),this.sheets)}}Rs.styleSheetCache=new Map;let js=0;function Vs(e){return e===document?document.body:e}class _s{constructor(e){this.styles=e,this.styleClass="fast-"+ ++js}addStylesTo(e){e=Vs(Is(e));const t=this.styles,s=this.styleClass;for(let n=0;n<t.length;n++){const i=document.createElement("style");i.innerHTML=t[n],i.className=s,e.append(i)}}removeStylesFrom(e){const t=(e=Vs(Is(e))).querySelectorAll(`.${this.styleClass}`);for(let s=0,n=t.length;s<n;++s)e.removeChild(t[s])}}let Ls=(e,t)=>{e.adoptedStyleSheets=[...e.adoptedStyleSheets,...t]},Hs=(e,t)=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter((e=>-1===t.indexOf(e)))};if(fe.supportsAdoptedStyleSheets){try{document.adoptedStyleSheets.push(),document.adoptedStyleSheets.splice(),Ls=(e,t)=>{e.adoptedStyleSheets.push(...t)},Hs=(e,t)=>{for(const s of t){const t=e.adoptedStyleSheets.indexOf(s);-1!==t&&e.adoptedStyleSheets.splice(t,1)}}}catch(e){}fe.setDefaultStrategy(Rs)}else fe.setDefaultStrategy(_s);const zs="needs-hydration";class Fs extends Ms{get shadowOptions(){return super.shadowOptions}set shadowOptions(e){super.shadowOptions=e,(this.hasExistingShadowRoot||void 0!==e&&!this.template)&&this.definition.templateOptions===Pt.deferAndHydrate&&(this.source.toggleAttribute(Xe,!0),this.source.toggleAttribute(zs,!0))}addHydratingInstance(){if(!Fs.hydratingInstances)return;const e=this.definition.name;let t=Fs.hydratingInstances.get(e);t||(t=new Set,Fs.hydratingInstances.set(e,t)),t.add(this.source)}static config(e){return Fs.lifecycleCallbacks=e,this}static hydrationObserverHandler(e){for(const t of e)t.target.hasAttribute(Xe)||(Fs.hydrationObserver.unobserve(t.target),t.target.$fastController.connect())}static checkHydrationComplete(e){var t,s,n;if(e.didTimeout)Fs.idleCallbackId=requestIdleCallback(Fs.checkHydrationComplete,{timeout:50});else if(0===(null===(t=Fs.hydratingInstances)||void 0===t?void 0:t.size)){try{null===(n=(s=Fs.lifecycleCallbacks).hydrationComplete)||void 0===n||n.call(s)}catch(e){}Ms.setStrategy(Ms)}}connect(){var e,t,s,n,i,r,o;if(this.needsHydration=null!==(e=this.needsHydration)&&void 0!==e?e:this.source.hasAttribute(zs),this.needsHydration&&this.addHydratingInstance(),this.source.hasAttribute(Xe))return this.addHydratingInstance(),void Fs.hydrationObserver.observe(this.source,{attributeFilter:[Xe]});if(!this.needsHydration)return super.connect(),void this.removeHydratingInstance();if(this.stage===Es.disconnected){if(!Fs.hydrationStarted){Fs.hydrationStarted=!0;try{null===(s=(t=Fs.lifecycleCallbacks).hydrationStarted)||void 0===s||s.call(t)}catch(e){}}try{null===(i=(n=Fs.lifecycleCallbacks).elementWillHydrate)||void 0===i||i.call(n,this.source)}catch(e){}if(this.stage=Es.connecting,this.bindObservables(),this.connectBehaviors(),this.template)if(Ke(this.template)){const e=this.source,t=null!==(r=ks(e))&&void 0!==r?r:e;let s=t.firstChild,n=t.lastChild;null===e.shadowRoot&&(qe.isElementBoundaryStartMarker(s)&&(s.data="",s=s.nextSibling),qe.isElementBoundaryEndMarker(n)&&(n.data="",n=n.previousSibling)),this.view=this.template.hydrate(s,n,e),null===(o=this.view)||void 0===o||o.bind(this.source)}else this.renderTemplate(this.template);this.addStyles(this.mainStyles),this.stage=Es.connected,this.source.removeAttribute(zs),this.needsInitialization=this.needsHydration=!1,this.removeHydratingInstance(),M.notify(this,$s)}}removeHydratingInstance(){var e,t;if(!Fs.hydratingInstances)return;try{null===(t=(e=Fs.lifecycleCallbacks).elementDidHydrate)||void 0===t||t.call(e,this.source)}catch(e){}const s=this.definition.name,n=Fs.hydratingInstances.get(s);n&&(n.delete(this.source),n.size||Fs.hydratingInstances.delete(s),Fs.idleCallbackId&&cancelIdleCallback(Fs.idleCallbackId),Fs.idleCallbackId=requestIdleCallback(Fs.checkHydrationComplete,{timeout:50}))}disconnect(){super.disconnect(),Fs.hydrationObserver.unobserve(this.source)}static install(){Ms.setStrategy(Fs)}}function Ps(e){const t=class extends e{constructor(){super(),Ms.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 Dt.registerBaseType(t),t}function Ds(e,t){return i(e)?Dt.compose(e,t).define().type:Dt.compose(this,e).define().type}Fs.hydrationObserver=new xs(Fs.hydrationObserverHandler),Fs.lifecycleCallbacks={},Fs.hydrationStarted=!1,Fs.idleCallbackId=null,Fs.hydratingInstances=new Map;const qs=Object.assign(Ps(HTMLElement),{from:function(e){return Ps(e)},define:Ds,compose:function(e,t){return i(e)?Dt.compose(e,t):Dt.compose(this,e)},defineAsync:function(e,t){return i(e)?new Promise((s=>{Dt.composeAsync(e,t).then((e=>{s(e)}))})).then((e=>e.define().type)):new Promise((t=>{Dt.composeAsync(this,e).then((e=>{t(e)}))})).then((e=>e.define().type))}});function Us(e){return function(t){Ds(t,e)}}m.setPolicy($.create());export{X as ArrayObserver,At as AttributeConfiguration,jt as AttributeDefinition,Z as Binding,de as CSSBindingDirective,ae as CSSDirective,je as ChildrenDirective,Ot as Compiler,m as DOM,f as DOMAspect,Ms as ElementController,fe as ElementStyles,V as ExecutionContext,l as FAST,qs as FASTElement,Dt as FASTElementDefinition,ft as HTMLBindingDirective,ke as HTMLDirective,at as HTMLView,Fs as HydratableElementController,ht as HydrationBindingError,Wt as InlineTemplateDirective,Be as Markup,Re as NodeObservationDirective,M as Observable,$e as Parser,k as PropertyChangeNotifier,xt as RefDirective,Xt as RenderBehavior,Gt as RenderDirective,bs as RepeatBehavior,vs as RepeatDirective,ws as SlottedDirective,L as Sort,E as SourceLifetime,_ as Splice,W as SpliceStrategy,H as SpliceStrategySupport,Es as Stages,Ee as StatelessAttachedAttributeDirective,N as SubscriberSet,Pt as TemplateOptions,A as Updates,Jt as ViewTemplate,Vt as attr,Et as booleanConverter,Ve as children,me as css,le as cssDirective,Us as customElement,Xe as deferHydrationAttribute,Ie as elements,c as emptyArray,Ft as fastElementRegistry,Kt as html,Ae as htmlDirective,Ke as isHydratable,G as lengthOf,se as listener,zs as needsHydrationAttribute,re as normalizeBinding,Mt as nullableBooleanConverter,Rt as nullableNumberConverter,I as observable,ie as oneTime,te as oneWay,Bt as ref,ds as render,ms as repeat,Cs as slotted,Y as sortedCount,R as volatile,Os as when};
|
|
3
|
+
`;function ts(e){return void 0===e?es:e.template}function ss(e,t){if(e)return function(e,t){const s=Yt.get(e);if(void 0!==s)return s[null!=t?t:Zt]}(e.constructor,t)}class is{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?ne((e=>e)):re(e);let o=!1;if(void 0===t)o=!0,i=ne(((e,t)=>{var i;const n=s.evaluate(e,t);return n instanceof Node?null!==(i=n.$fastTemplate)&&void 0!==i?i:new is(n):ts(ss(n))}));else if(n(t))i=te(((e,i)=>{var n;let o=t(e,i);return r(o)?o=ts(ss(s.evaluate(e,i),o)):o instanceof Node&&(o=null!==(n=o.$fastTemplate)&&void 0!==n?n:new is(o)),o}),void 0,!0);else if(r(t))o=!0,i=ne(((e,i)=>{var n;const r=s.evaluate(e,i);return r instanceof Node?null!==(n=r.$fastTemplate)&&void 0!==n?n:new is(r):ts(ss(r,t))}));else if(t instanceof Z){const e=t.evaluate;t.evaluate=(t,i)=>{var n;let o=e(t,i);return r(o)?o=ts(ss(s.evaluate(t,i),o)):o instanceof Node&&(o=null!==(n=o.$fastTemplate)&&void 0!==n?n:new is(o)),o},i=t}else i=ne(((e,s)=>t));return new Gt(s,i,o)}const rs=Object.freeze({positioning:!1,recycle:!0});function os(e,t,s,i){e.context.parent=i.source,e.context.parentContext=i.context,e.bind(t[s])}function as(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 ls(e){return e.nodeType===Node.COMMENT_NODE}class cs extends Error{constructor(e,t){super(e),this.propertyBag=t}}class ds{constructor(e){this.directive=e,this.items=null,this.itemsObserver=null,this.bindView=os,this.views=[],this.itemsBindingObserver=e.dataBinding.createObserver(this,e),this.templateBindingObserver=e.templateBinding.createObserver(this,e),e.options.positioning&&(this.bindView=as)}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),Ke(this.template)&&Ke(e)&&e.hydrationStage!==dt?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=c);const t=this.itemsObserver,s=this.itemsObserver=M.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||(at.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 cs(`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 cs(`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(!ls(t)){t=t.previousSibling;continue}const s=qe.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(ls(n))if(qe.isRepeatViewEndMarker(n.data))r++;else if(qe.isRepeatViewStartMarker(n.data)){if(!r){if(qe.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 hs{createHTML(e){return Be.comment(e(this))}constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.options=s,X.enable()}createBehavior(){return new ds(this)}}function us(e,t,s=rs){const i=re(e),n=re(t);return new hs(i,n,Object.assign(Object.assign({},rs),s))}ke.define(hs);const fs="slotchange";class ps extends Re{observe(e){e.addEventListener(fs,this)}disconnect(e){e.removeEventListener(fs,this)}getNodes(e){return e.assignedNodes(this.options)}handleEvent(e){const t=e.currentTarget;this.updateTarget(this.getSource(t),this.computeNodes(t))}}function gs(e){return r(e)&&(e={property:e}),new ps(e)}ke.define(ps);const bs=()=>null;function vs(e){return void 0===e?bs:n(e)?e:()=>e}function ms(e,t,s){const i=n(e)?e:()=>e,r=vs(t),o=vs(s);return(e,t)=>i(e,t)?r(e,t):o(e,t)}class ys extends MutationObserver{constructor(e){super((function(e){this.callback.call(null,e.filter((e=>this.observedNodes.has(e.target))))})),this.callback=e,this.observedNodes=new Set}observe(e,t){this.observedNodes.add(e),super.observe(e,t)}unobserve(e){this.observedNodes.delete(e),this.observedNodes.size<1&&this.disconnect()}}const ws={bubbles:!0,composed:!0,cancelable:!0},Cs="isConnected",Ss=new WeakMap;function Ts(e){var t,s;return null!==(s=null!==(t=e.shadowRoot)&&void 0!==t?t:Ss.get(e))&&void 0!==s?s:null}let xs;var Os;!function(e){e[e.connecting=0]="connecting",e[e.connected=1]="connected",e[e.disconnecting=2]="disconnecting",e[e.disconnected=3]="disconnected"}(Os||(Os={}));class Bs extends k{get isConnected(){return M.track(this,Cs),this.stage===Os.connected}get context(){var e,t;return null!==(t=null===(e=this.view)||void 0===e?void 0:e.context)&&void 0!==t?t:V.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&&Ss.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=Os.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 s=M.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||this.stage!==Os.connected&&this.stage!==Os.connecting||e.connectedCallback(this)):i.set(e,n+1)}removeBehavior(e,t=!1){const s=this.behaviors;if(null===s)return;const i=s.get(e);void 0!==i&&(1===i||t?(s.delete(e),e.disconnectedCallback&&this.stage!==Os.disconnected&&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=Ts(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=Ts(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(){this.stage===Os.disconnected&&(this.stage=Os.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=Os.connected,M.notify(this,Cs))}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(){this.stage===Os.connected&&(this.stage=Os.disconnecting,M.notify(this,Cs),null!==this.view&&this.view.unbind(),this.disconnectBehaviors(),this.stage=Os.disconnected)}onAttributeChangedCallback(e,t,s){const i=this.definition.attributeLookup[e];void 0!==i&&i.onAttributeChangedCallback(this.source,s)}emit(e,t,s){return this.stage===Os.connected&&this.source.dispatchEvent(new CustomEvent(e,Object.assign(Object.assign({detail:t},ws),s)))}renderTemplate(e){var t;const s=this.source,i=null!==(t=Ts(s))&&void 0!==t?t:s;if(null!==this.view)this.view.dispose(),this.view=null;else if(!this.needsInitialization||this.hasExistingShadowRoot){this.hasExistingShadowRoot=!1;for(let e=i.firstChild;null!==e;e=i.firstChild)i.removeChild(e)}e&&(this.view=e.render(s,i,s),this.view.sourceLifetime=E.coupled)}static forCustomElement(e,t=!1){const s=e.$fastController;if(void 0!==s&&!t)return s;const n=Pt.getForInstance(e);if(void 0===n)throw l.error(i.missingElementDefinition);return M.getNotifier(n).subscribe({handleChange:()=>{Bs.forCustomElement(e,!0),e.$fastController.connect()}},"template"),M.getNotifier(n).subscribe({handleChange:()=>{Bs.forCustomElement(e,!0),e.$fastController.connect()}},"shadowOptions"),e.$fastController=new xs(e,n)}static setStrategy(e){xs=e}}function $s(e){var t;return"adoptedStyleSheets"in e?e:null!==(t=Ts(e))&&void 0!==t?t:e.getRootNode()}u(Bs),Bs.setStrategy(Bs);class Ns{constructor(e){const t=Ns.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){Ms($s(e),this.sheets)}removeStylesFrom(e){Is($s(e),this.sheets)}}Ns.styleSheetCache=new Map;let ks=0;function As(e){return e===document?document.body:e}class Es{constructor(e){this.styles=e,this.styleClass="fast-"+ ++ks}addStylesTo(e){e=As($s(e));const t=this.styles,s=this.styleClass;for(let i=0;i<t.length;i++){const n=document.createElement("style");n.innerHTML=t[i],n.className=s,e.append(n)}}removeStylesFrom(e){const t=(e=As($s(e))).querySelectorAll(`.${this.styleClass}`);for(let s=0,i=t.length;s<i;++s)e.removeChild(t[s])}}let Ms=(e,t)=>{e.adoptedStyleSheets=[...e.adoptedStyleSheets,...t]},Is=(e,t)=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter((e=>-1===t.indexOf(e)))};if(fe.supportsAdoptedStyleSheets){try{document.adoptedStyleSheets.push(),document.adoptedStyleSheets.splice(),Ms=(e,t)=>{e.adoptedStyleSheets.push(...t)},Is=(e,t)=>{for(const s of t){const t=e.adoptedStyleSheets.indexOf(s);-1!==t&&e.adoptedStyleSheets.splice(t,1)}}}catch(e){}fe.setDefaultStrategy(Ns)}else fe.setDefaultStrategy(Es);const Rs="needs-hydration";class js extends Bs{get shadowOptions(){return super.shadowOptions}set shadowOptions(e){super.shadowOptions=e,(this.hasExistingShadowRoot||void 0!==e&&!this.template)&&this.definition.templateOptions===Dt.deferAndHydrate&&(this.source.toggleAttribute(Xe,!0),this.source.toggleAttribute(Rs,!0))}addHydratingInstance(){if(!js.hydratingInstances)return;const e=this.definition.name;let t=js.hydratingInstances.get(e);t||(t=new Set,js.hydratingInstances.set(e,t)),t.add(this.source)}static config(e){return js.lifecycleCallbacks=e,this}static hydrationObserverHandler(e){for(const t of e)t.target.hasAttribute(Xe)||(js.hydrationObserver.unobserve(t.target),t.target.$fastController.connect())}static checkHydrationComplete(e){var t,s,i;if(e.didTimeout)js.idleCallbackId=requestIdleCallback(js.checkHydrationComplete,{timeout:50});else if(0===(null===(t=js.hydratingInstances)||void 0===t?void 0:t.size)){try{null===(i=(s=js.lifecycleCallbacks).hydrationComplete)||void 0===i||i.call(s)}catch(e){}Bs.setStrategy(Bs)}}connect(){var e,t,s,i,n,r,o;if(this.needsHydration=null!==(e=this.needsHydration)&&void 0!==e?e:this.source.hasAttribute(Rs),this.needsHydration&&this.addHydratingInstance(),this.source.hasAttribute(Xe))return this.addHydratingInstance(),void js.hydrationObserver.observe(this.source,{attributeFilter:[Xe]});if(!this.needsHydration)return super.connect(),void this.removeHydratingInstance();if(this.stage===Os.disconnected){if(!js.hydrationStarted){js.hydrationStarted=!0;try{null===(s=(t=js.lifecycleCallbacks).hydrationStarted)||void 0===s||s.call(t)}catch(e){}}try{null===(n=(i=js.lifecycleCallbacks).elementWillHydrate)||void 0===n||n.call(i,this.source)}catch(e){}if(this.stage=Os.connecting,this.bindObservables(),this.connectBehaviors(),this.template)if(Ke(this.template)){const e=this.source,t=null!==(r=Ts(e))&&void 0!==r?r:e;let s=t.firstChild,i=t.lastChild;null===e.shadowRoot&&(qe.isElementBoundaryStartMarker(s)&&(s.data="",s=s.nextSibling),qe.isElementBoundaryEndMarker(i)&&(i.data="",i=i.previousSibling)),this.view=this.template.hydrate(s,i,e),null===(o=this.view)||void 0===o||o.bind(this.source)}else this.renderTemplate(this.template);this.addStyles(this.mainStyles),this.stage=Os.connected,this.source.removeAttribute(Rs),this.needsInitialization=this.needsHydration=!1,this.removeHydratingInstance(),M.notify(this,Cs)}}removeHydratingInstance(){var e,t;if(!js.hydratingInstances)return;try{null===(t=(e=js.lifecycleCallbacks).elementDidHydrate)||void 0===t||t.call(e,this.source)}catch(e){}const s=this.definition.name,i=js.hydratingInstances.get(s);i&&(i.delete(this.source),i.size||js.hydratingInstances.delete(s),js.idleCallbackId&&cancelIdleCallback(js.idleCallbackId),js.idleCallbackId=requestIdleCallback(js.checkHydrationComplete,{timeout:50}))}disconnect(){super.disconnect(),js.hydrationObserver.unobserve(this.source)}static install(){Bs.setStrategy(js)}}function Vs(e){const t=class extends e{constructor(){super(),Bs.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 Pt.registerBaseType(t),t}function _s(e,t){return n(e)?Pt.compose(e,t).define().type:Pt.compose(this,e).define().type}js.hydrationObserver=new ys(js.hydrationObserverHandler),js.lifecycleCallbacks={},js.hydrationStarted=!1,js.idleCallbackId=null,js.hydratingInstances=new Map;const Ls=Object.assign(Vs(HTMLElement),{from:function(e){return Vs(e)},define:_s,compose:function(e,t){return n(e)?Pt.compose(e,t):Pt.compose(this,e)},defineAsync:function(e,t){return n(e)?new Promise((s=>{Pt.composeAsync(e,t).then((e=>{s(e)}))})).then((e=>e.define().type)):new Promise((t=>{Pt.composeAsync(this,e).then((e=>{t(e)}))})).then((e=>e.define().type))}});function Hs(e){return function(t){_s(t,e)}}m.setPolicy($.create());export{X as ArrayObserver,At as AttributeConfiguration,jt as AttributeDefinition,Z as Binding,de as CSSBindingDirective,ae as CSSDirective,je as ChildrenDirective,xt as Compiler,m as DOM,f as DOMAspect,Bs as ElementController,fe as ElementStyles,V as ExecutionContext,l as FAST,Ls as FASTElement,Pt as FASTElementDefinition,ft as HTMLBindingDirective,ke as HTMLDirective,at as HTMLView,js as HydratableElementController,ht as HydrationBindingError,Wt as InlineTemplateDirective,Be as Markup,Re as NodeObservationDirective,M as Observable,$e as Parser,k as PropertyChangeNotifier,Ot as RefDirective,Xt as RenderBehavior,Gt as RenderDirective,ds as RepeatBehavior,hs as RepeatDirective,ps as SlottedDirective,L as Sort,E as SourceLifetime,_ as Splice,W as SpliceStrategy,H as SpliceStrategySupport,Os as Stages,Ee as StatelessAttachedAttributeDirective,N as SubscriberSet,Dt as TemplateOptions,A as Updates,Jt as ViewTemplate,Vt as attr,Et as booleanConverter,Ve as children,me as css,le as cssDirective,Hs as customElement,Xe as deferHydrationAttribute,Ie as elements,c as emptyArray,Ft as fastElementRegistry,Kt as html,Ae as htmlDirective,Ke as isHydratable,G as lengthOf,se as listener,Rs as needsHydrationAttribute,re as normalizeBinding,Mt as nullableBooleanConverter,Rt as nullableNumberConverter,I as observable,ne as oneTime,te as oneWay,Bt as ref,ns as render,us as repeat,gs as slotted,Y as sortedCount,R as volatile,ms as when};
|
|
@@ -1621,7 +1621,18 @@ export declare interface HostController<TSource = any> extends ExpressionControl
|
|
|
1621
1621
|
export declare const html: HTMLTemplateTag;
|
|
1622
1622
|
|
|
1623
1623
|
/**
|
|
1624
|
-
*
|
|
1624
|
+
* The central binding directive that bridges data expressions and DOM updates.
|
|
1625
|
+
*
|
|
1626
|
+
* HTMLBindingDirective fulfills three roles simultaneously:
|
|
1627
|
+
* - **HTMLDirective**: Produces placeholder HTML via createHTML() during template authoring.
|
|
1628
|
+
* - **ViewBehaviorFactory**: Creates behaviors (returns itself) during view creation.
|
|
1629
|
+
* - **ViewBehavior / EventListener**: Attaches to a DOM node during bind, manages
|
|
1630
|
+
* expression observers for reactive updates, and handles DOM events directly.
|
|
1631
|
+
*
|
|
1632
|
+
* The aspectType (set by HTMLDirective.assignAspect during template processing)
|
|
1633
|
+
* determines which DOM "sink" function is used to apply values — e.g.,
|
|
1634
|
+
* setAttribute for attributes, addEventListener for events, textContent for content.
|
|
1635
|
+
*
|
|
1625
1636
|
* @public
|
|
1626
1637
|
*/
|
|
1627
1638
|
export declare class HTMLBindingDirective implements HTMLDirective, ViewBehaviorFactory, ViewBehavior, Aspected, BindingDirective {
|
|
@@ -1670,13 +1681,37 @@ export declare class HTMLBindingDirective implements HTMLDirective, ViewBehavior
|
|
|
1670
1681
|
* Creates a behavior.
|
|
1671
1682
|
*/
|
|
1672
1683
|
createBehavior(): ViewBehavior;
|
|
1673
|
-
/**
|
|
1684
|
+
/**
|
|
1685
|
+
* Attaches this binding to its target DOM node.
|
|
1686
|
+
* - For events: stores the controller reference on the target element and registers
|
|
1687
|
+
* this directive as the EventListener via addEventListener. The directive's
|
|
1688
|
+
* handleEvent() method will be called when the event fires.
|
|
1689
|
+
* - For content bindings: registers an unbind handler, then falls through to the
|
|
1690
|
+
* default path.
|
|
1691
|
+
* - For all non-event bindings: creates (or reuses) an ExpressionObserver, evaluates
|
|
1692
|
+
* the binding expression, and applies the result to the DOM via the updateTarget
|
|
1693
|
+
* sink function. The observer will call handleChange() on future data changes.
|
|
1694
|
+
* @internal
|
|
1695
|
+
*/
|
|
1674
1696
|
bind(controller: ViewController): void;
|
|
1675
1697
|
/** @internal */
|
|
1676
1698
|
unbind(controller: ViewController): void;
|
|
1677
|
-
/**
|
|
1699
|
+
/**
|
|
1700
|
+
* Implements the EventListener interface. When a DOM event fires on the target
|
|
1701
|
+
* element, this method retrieves the ViewController stored on the element,
|
|
1702
|
+
* sets the event on the ExecutionContext so `c.event` is available to the
|
|
1703
|
+
* binding expression, and evaluates the expression. If the expression returns
|
|
1704
|
+
* anything other than `true`, the event's default action is prevented.
|
|
1705
|
+
* @internal
|
|
1706
|
+
*/
|
|
1678
1707
|
handleEvent(event: Event): void;
|
|
1679
|
-
/**
|
|
1708
|
+
/**
|
|
1709
|
+
* Called by the ExpressionObserver when a tracked dependency changes.
|
|
1710
|
+
* Re-evaluates the binding expression via observer.bind() and pushes
|
|
1711
|
+
* the new value to the DOM through the updateTarget sink function.
|
|
1712
|
+
* This is the reactive update path that keeps the DOM in sync with data.
|
|
1713
|
+
* @internal
|
|
1714
|
+
*/
|
|
1680
1715
|
handleChange(binding: Expression, observer: ExpressionObserver): void;
|
|
1681
1716
|
}
|
|
1682
1717
|
|
|
@@ -1714,7 +1749,13 @@ export declare const HTMLDirective: Readonly<{
|
|
|
1714
1749
|
*/
|
|
1715
1750
|
define<TType extends Constructable<HTMLDirective>>(type: TType, options?: PartialHTMLDirectiveDefinition): TType;
|
|
1716
1751
|
/**
|
|
1717
|
-
*
|
|
1752
|
+
* Determines the DOM aspect type for a directive based on attribute name prefix.
|
|
1753
|
+
* The prefix convention maps to aspect types as follows:
|
|
1754
|
+
* - No prefix (e.g. "class") → DOMAspect.attribute
|
|
1755
|
+
* - ":" prefix (e.g. ":value") → DOMAspect.property (":classList" → DOMAspect.tokenList)
|
|
1756
|
+
* - "?" prefix (e.g. "?disabled") → DOMAspect.booleanAttribute
|
|
1757
|
+
* - `@` prefix (e.g. `@click`) → DOMAspect.event
|
|
1758
|
+
* - Falsy or absent value → DOMAspect.content (see remarks)
|
|
1718
1759
|
* @param directive - The directive to assign the aspect to.
|
|
1719
1760
|
* @param value - The value to base the aspect determination on.
|
|
1720
1761
|
* @remarks
|
|
@@ -1837,6 +1878,17 @@ export declare class HTMLView<TSource = any, TParent = any> extends DefaultExecu
|
|
|
1837
1878
|
}): void;
|
|
1838
1879
|
/**
|
|
1839
1880
|
* Binds a view's behaviors to its binding source.
|
|
1881
|
+
*
|
|
1882
|
+
* On the first call, this iterates through all compiled factories, calling
|
|
1883
|
+
* createBehavior() on each to produce a ViewBehavior instance (e.g., an
|
|
1884
|
+
* HTMLBindingDirective), and then immediately binds it. This is where event
|
|
1885
|
+
* listeners are registered, expression observers are created, and initial
|
|
1886
|
+
* DOM values are set.
|
|
1887
|
+
*
|
|
1888
|
+
* On subsequent calls with a new source, existing behaviors are re-bound
|
|
1889
|
+
* to the new data source, which re-evaluates all binding expressions and
|
|
1890
|
+
* updates the DOM accordingly.
|
|
1891
|
+
*
|
|
1840
1892
|
* @param source - The binding source for the view's binding behaviors.
|
|
1841
1893
|
* @param context - The execution context to run the behaviors within.
|
|
1842
1894
|
*/
|
|
@@ -3503,7 +3555,25 @@ export declare class ViewTemplate<TSource = any, TParent = any> implements Eleme
|
|
|
3503
3555
|
*/
|
|
3504
3556
|
render(source: TSource, host: Node, hostBindingTarget?: Element): HTMLView<TSource, TParent>;
|
|
3505
3557
|
/**
|
|
3506
|
-
*
|
|
3558
|
+
* Processes the tagged template literal's static strings and interpolated values and
|
|
3559
|
+
* creates a ViewTemplate.
|
|
3560
|
+
*
|
|
3561
|
+
* For each interpolated value:
|
|
3562
|
+
* 1. Functions (binding expressions, e.g., `x => x.name`) → wrapped in a one-way HTMLBindingDirective
|
|
3563
|
+
* 2. Binding instances → wrapped in an HTMLBindingDirective
|
|
3564
|
+
* 3. HTMLDirective instances → used as-is
|
|
3565
|
+
* 4. Static values (strings, numbers) → wrapped in a one-time HTMLBindingDirective
|
|
3566
|
+
*
|
|
3567
|
+
* Each directive's createHTML() is called with an `add` callback that registers
|
|
3568
|
+
* the factory in the factories record under a unique ID and returns that ID.
|
|
3569
|
+
* The directive inserts a placeholder marker (e.g., `fast-abc123{0}fast-abc123`) into
|
|
3570
|
+
* the HTML string so the compiler can later find and associate it with the factory.
|
|
3571
|
+
*
|
|
3572
|
+
* Aspect detection happens here too: the `lastAttributeNameRegex` checks whether
|
|
3573
|
+
* the placeholder appears inside an attribute value, and if so, assignAspect()
|
|
3574
|
+
* sets the correct DOMAspect (attribute, property, event, etc.) based on the
|
|
3575
|
+
* attribute name prefix.
|
|
3576
|
+
*
|
|
3507
3577
|
* @param strings - The static strings to create the template with.
|
|
3508
3578
|
* @param values - The dynamic values to create the template with.
|
|
3509
3579
|
* @param policy - The DOMPolicy to associated with the template.
|
package/docs/api-report.api.md
CHANGED
|
@@ -509,15 +509,15 @@ export const html: HTMLTemplateTag;
|
|
|
509
509
|
export class HTMLBindingDirective implements HTMLDirective, ViewBehaviorFactory, ViewBehavior, Aspected, BindingDirective {
|
|
510
510
|
constructor(dataBinding: Binding);
|
|
511
511
|
aspectType: DOMAspect;
|
|
512
|
-
// @internal
|
|
512
|
+
// @internal
|
|
513
513
|
bind(controller: ViewController): void;
|
|
514
514
|
createBehavior(): ViewBehavior;
|
|
515
515
|
createHTML(add: AddViewBehaviorFactory): string;
|
|
516
516
|
// (undocumented)
|
|
517
517
|
dataBinding: Binding;
|
|
518
|
-
// @internal
|
|
518
|
+
// @internal
|
|
519
519
|
handleChange(binding: Expression, observer: ExpressionObserver): void;
|
|
520
|
-
// @internal
|
|
520
|
+
// @internal
|
|
521
521
|
handleEvent(event: Event): void;
|
|
522
522
|
id: string;
|
|
523
523
|
policy: DOMPolicy;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/fast-element",
|
|
3
3
|
"description": "A library for constructing Web Components",
|
|
4
|
-
"version": "2.10.
|
|
4
|
+
"version": "2.10.3",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Microsoft",
|
|
7
7
|
"url": "https://discord.gg/FcSNfg4"
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
"./dist/esm/interfaces.js"
|
|
102
102
|
],
|
|
103
103
|
"scripts": {
|
|
104
|
-
"clean
|
|
104
|
+
"clean": "clean dist temp test-results",
|
|
105
105
|
"doc": "api-extractor run --local",
|
|
106
106
|
"doc:ci": "api-extractor run",
|
|
107
107
|
"doc:exports": "node ./scripts/run-api-extractor.js",
|
|
@@ -110,24 +110,12 @@
|
|
|
110
110
|
"build:rollup": "rollup -c",
|
|
111
111
|
"build:tsc": "tsc -p ./tsconfig.json",
|
|
112
112
|
"dev": "tsc -p ./tsconfig.json -w",
|
|
113
|
-
"
|
|
114
|
-
"
|
|
115
|
-
"
|
|
116
|
-
"prettier:diff": "prettier --config ../../.prettierrc \"**/*.ts\" --list-different",
|
|
117
|
-
"eslint": "eslint . --ext .ts",
|
|
118
|
-
"eslint:fix": "eslint . --ext .ts --fix",
|
|
113
|
+
"prepublishOnly": "npm run clean && npm run build",
|
|
114
|
+
"lint": "biome-changed",
|
|
115
|
+
"lint:fix": "biome-changed -- --fix",
|
|
119
116
|
"test:playwright": "playwright test",
|
|
120
117
|
"test-server": "npx vite test/ --clearScreen false",
|
|
121
|
-
"test": "npm run
|
|
122
|
-
"test
|
|
123
|
-
"test-node:verbose": "nyc --reporter=lcov --reporter=text-summary --report-dir=coverage/node --temp-dir=coverage/.nyc_output mocha --reporter spec --exit dist/esm/__test__/setup-node.js './dist/esm/**/*.spec.js'",
|
|
124
|
-
"test-chrome": "karma start karma.conf.cjs --browsers=ChromeHeadlessOpt --single-run --coverage",
|
|
125
|
-
"test-chrome:verbose": "karma start karma.conf.cjs --browsers=ChromeHeadlessOpt --single-run --coverage --reporter=mocha",
|
|
126
|
-
"test-chrome:watch": "karma start karma.conf.cjs --browsers=ChromeHeadlessOpt --coverage --watch-extensions js",
|
|
127
|
-
"test-chrome:debugger": "karma start karma.conf.cjs --browsers=ChromeDebugging",
|
|
128
|
-
"test-chrome:verbose:watch": "karma start karma.conf.cjs --browsers=ChromeHeadlessOpt --coverage --watch-extensions js --reporter=mocha",
|
|
129
|
-
"test-chrome:verbose:debugger": "karma start karma.conf.cjs --browsers=ChromeDebugging --reporter=mocha",
|
|
130
|
-
"test-firefox": "karma start karma.conf.cjs --browsers=FirefoxHeadless --single-run --coverage",
|
|
131
|
-
"test-firefox:verbose": "karma start karma.conf.cjs --browsers=FirefoxHeadless --single-run --coverage --reporter=mocha"
|
|
118
|
+
"test": "npm run lint && npm run doc:ci && npm run doc:exports:ci && npm run test:playwright",
|
|
119
|
+
"test:ci": "npm run doc:ci && npm run doc:exports:ci && npm run test:playwright"
|
|
132
120
|
}
|
|
133
121
|
}
|
package/.eslintrc.json
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": ["../../.eslintrc.js"],
|
|
3
|
-
"rules": {
|
|
4
|
-
"max-classes-per-file": "off",
|
|
5
|
-
"no-case-declarations": "off",
|
|
6
|
-
"@typescript-eslint/no-non-null-assertion": "off",
|
|
7
|
-
"@typescript-eslint/ban-types": [
|
|
8
|
-
"error",
|
|
9
|
-
{
|
|
10
|
-
"types": {
|
|
11
|
-
"{}": false,
|
|
12
|
-
"Function": false,
|
|
13
|
-
"Object": false
|
|
14
|
-
},
|
|
15
|
-
"extendDefaults": true
|
|
16
|
-
}
|
|
17
|
-
]
|
|
18
|
-
}
|
|
19
|
-
}
|