@microsoft/fast-element 2.0.0-beta.9 → 2.0.1
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/.eslintrc.json +1 -1
- package/CHANGELOG.json +518 -0
- package/CHANGELOG.md +181 -1
- package/README.md +1 -9
- package/api-extractor.context.json +14 -0
- package/api-extractor.di.json +14 -0
- package/dist/context/context.api.json +1068 -0
- package/dist/di/di.api.json +4929 -0
- package/dist/dts/binding/binding.d.ts +49 -0
- package/dist/dts/binding/normalize.d.ts +9 -0
- package/dist/dts/binding/one-time.d.ts +11 -0
- package/dist/dts/binding/one-way.d.ts +20 -0
- package/dist/dts/{templating/binding-signal.d.ts → binding/signal.d.ts} +19 -4
- package/dist/dts/{templating/binding-two-way.d.ts → binding/two-way.d.ts} +9 -5
- package/dist/dts/components/attributes.d.ts +7 -1
- package/dist/dts/components/element-controller.d.ts +104 -8
- package/dist/dts/components/element-hydration.d.ts +2 -0
- package/dist/dts/components/fast-definitions.d.ts +6 -0
- package/dist/dts/components/hydration.d.ts +56 -0
- package/dist/dts/components/install-hydration.d.ts +1 -0
- package/dist/dts/context.d.ts +29 -15
- package/dist/dts/di/di.d.ts +0 -5
- package/dist/dts/dom-policy.d.ts +83 -0
- package/dist/dts/dom.d.ts +100 -0
- package/dist/dts/hydration/target-builder.d.ts +63 -0
- package/dist/dts/index.d.ts +33 -26
- package/dist/dts/index.rollup.d.ts +0 -1
- package/dist/dts/index.rollup.debug.d.ts +0 -1
- package/dist/dts/interfaces.d.ts +32 -82
- package/dist/dts/metadata.d.ts +6 -5
- package/dist/dts/observation/arrays.d.ts +1 -1
- package/dist/dts/observation/observable.bench.d.ts +18 -0
- package/dist/dts/observation/observable.d.ts +5 -5
- package/dist/dts/pending-task.d.ts +19 -7
- package/dist/dts/platform.d.ts +11 -2
- package/dist/dts/polyfills.d.ts +0 -8
- package/dist/dts/styles/css-binding-directive.d.ts +60 -0
- package/dist/dts/styles/css.d.ts +9 -7
- package/dist/dts/styles/element-styles.d.ts +1 -14
- package/dist/dts/styles/host.d.ts +2 -5
- package/dist/dts/styles/style-strategy.d.ts +42 -0
- package/dist/dts/templating/compiler.d.ts +11 -13
- package/dist/dts/templating/{binding.d.ts → html-binding-directive.d.ts} +21 -41
- package/dist/dts/templating/html-directive.d.ts +44 -140
- package/dist/dts/templating/install-hydratable-view-templates.d.ts +1 -0
- package/dist/dts/templating/node-observation.d.ts +11 -1
- package/dist/dts/templating/ref.d.ts +4 -0
- package/dist/dts/templating/render.bench.d.ts +3 -0
- package/dist/dts/templating/render.d.ts +49 -9
- package/dist/dts/templating/repeat-basic-reverse.bench.d.ts +3 -0
- package/dist/dts/templating/repeat-basic-shift.bench.d.ts +3 -0
- package/dist/dts/templating/repeat.d.ts +31 -9
- package/dist/dts/templating/template.d.ts +97 -12
- package/dist/dts/templating/view.d.ts +146 -29
- package/dist/dts/templating/when-basic.bench.d.ts +3 -0
- package/dist/dts/templating/when-conditional.bench.d.ts +3 -0
- package/dist/dts/templating/when-switch.bench.d.ts +3 -0
- package/dist/dts/templating/when.d.ts +3 -1
- package/dist/dts/testing/fakes.d.ts +12 -1
- package/dist/dts/tsdoc-metadata.json +1 -1
- package/dist/dts/utilities.d.ts +55 -1
- package/dist/esm/binding/binding.js +18 -0
- package/dist/esm/binding/normalize.js +17 -0
- package/dist/esm/binding/one-time.js +21 -0
- package/dist/esm/binding/one-way.js +30 -0
- package/dist/esm/{templating/binding-signal.js → binding/signal.js} +22 -6
- package/dist/esm/{templating/binding-two-way.js → binding/two-way.js} +18 -12
- package/dist/esm/components/attributes.js +19 -6
- package/dist/esm/components/element-controller.js +319 -49
- package/dist/esm/components/element-hydration.js +2 -0
- package/dist/esm/components/fast-definitions.js +12 -4
- package/dist/esm/components/fast-element.js +3 -1
- package/dist/esm/components/hydration.js +104 -0
- package/dist/esm/components/install-hydration.js +3 -0
- package/dist/esm/context.js +26 -4
- package/dist/esm/debug.js +8 -2
- package/dist/esm/di/di.js +9 -12
- package/dist/esm/dom-policy.js +345 -0
- package/dist/esm/dom.js +101 -0
- package/dist/esm/hydration/target-builder.js +175 -0
- package/dist/esm/index.js +34 -25
- package/dist/esm/index.rollup.debug.js +3 -1
- package/dist/esm/index.rollup.js +3 -1
- package/dist/esm/interfaces.js +51 -3
- package/dist/esm/metadata.js +11 -8
- package/dist/esm/observation/arrays.js +1 -1
- package/dist/esm/observation/observable.bench.js +79 -0
- package/dist/esm/observation/observable.js +20 -15
- package/dist/esm/observation/update-queue.js +2 -2
- package/dist/esm/pending-task.js +13 -1
- package/dist/esm/platform.js +12 -2
- package/dist/esm/polyfills.js +3 -61
- package/dist/esm/styles/css-binding-directive.js +76 -0
- package/dist/esm/styles/css.js +14 -7
- package/dist/esm/styles/element-styles.js +0 -33
- package/dist/esm/styles/style-strategy.js +1 -0
- package/dist/esm/templating/children.js +8 -4
- package/dist/esm/templating/compiler.js +37 -44
- package/dist/esm/templating/html-binding-directive.js +218 -0
- package/dist/esm/templating/html-directive.js +25 -152
- package/dist/esm/templating/install-hydratable-view-templates.js +17 -0
- package/dist/esm/templating/node-observation.js +14 -8
- package/dist/esm/templating/ref.js +1 -1
- package/dist/esm/templating/render.bench.js +56 -0
- package/dist/esm/templating/render.js +74 -30
- package/dist/esm/templating/repeat-basic-reverse.bench.js +43 -0
- package/dist/esm/templating/repeat-basic-shift.bench.js +43 -0
- package/dist/esm/templating/repeat.js +116 -17
- package/dist/esm/templating/template.js +135 -60
- package/dist/esm/templating/view.js +254 -34
- package/dist/esm/templating/when-basic.bench.js +36 -0
- package/dist/esm/templating/when-conditional.bench.js +39 -0
- package/dist/esm/templating/when-switch.bench.js +68 -0
- package/dist/esm/templating/when.js +12 -5
- package/dist/esm/testing/fakes.js +32 -1
- package/dist/esm/testing/fixture.js +1 -1
- package/dist/esm/utilities.js +97 -1
- package/dist/fast-element.api.json +9789 -5667
- package/dist/fast-element.d.ts +813 -2392
- package/dist/fast-element.debug.js +2788 -974
- package/dist/fast-element.debug.min.js +3 -1
- package/dist/fast-element.js +2641 -833
- package/dist/fast-element.min.js +3 -1
- package/dist/fast-element.untrimmed.d.ts +662 -314
- package/docs/{api-report.md → api-report.api.md} +238 -151
- package/docs/context/api-report.api.md +69 -0
- package/docs/di/api-report.api.md +315 -0
- package/karma.conf.cjs +2 -1
- package/package.json +59 -47
- package/scripts/run-api-extractor.js +51 -0
- package/scripts/run-benchmarks.js +46 -0
- package/tensile.config.js +12 -0
- package/dist/dts/templating/dom.d.ts +0 -41
- package/dist/esm/templating/binding.js +0 -282
- package/dist/esm/templating/dom.js +0 -49
- package/docs/guide/declaring-templates.md +0 -230
- package/docs/guide/defining-elements.md +0 -214
- package/docs/guide/leveraging-css.md +0 -253
- package/docs/guide/next-steps.md +0 -13
- package/docs/guide/observables-and-state.md +0 -213
- package/docs/guide/using-directives.md +0 -576
- package/docs/guide/working-with-shadow-dom.md +0 -296
|
@@ -1 +1,3 @@
|
|
|
1
|
-
!function(){if("undefined"==typeof globalThis)if("undefined"!=typeof global)global.globalThis=global;else if("undefined"!=typeof self)self.globalThis=self;else if("undefined"!=typeof window)window.globalThis=window;else{const e=new Function("return this")();e.globalThis=e}}(),globalThis.trustedTypes||(globalThis.trustedTypes={createPolicy:(e,t)=>t});const e={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},e));const t=globalThis.FAST;if(void 0===t.getById){const s=Object.create(null);Reflect.defineProperty(t,"getById",Object.assign({value(e,t){let i=s[e];return void 0===i&&(i=t?s[e]=t():null),i}},e))}const s=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;function i(e){return e===document?document.body:e}let n=0;class r{constructor(e){this.styles=e,this.styleClass="fast-"+ ++n}addStylesTo(e){e=i(e);const t=this.styles,s=this.styleClass;for(let i=0;i<t.length;i++){const n=document.createElement("style");n.innerHTML=t[i],n.className=s,e.append(n)}}removeStylesFrom(e){const t=e.querySelectorAll(`.${this.styleClass}`);e=i(e);for(let s=0,i=t.length;s<i;++s)e.removeChild(t[s])}}s||t.getById(5,(()=>r)),void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",{value:Object.create(null),configurable:!1,enumerable:!1,writable:!1});const o=globalThis.FAST,l={1101:"Must call enableArrayObservation before observing arrays.",1201:"The HTML policy can only be set once.",1202:"To bind innerHTML, you must use a TrustedTypesPolicy.",1203:"View=>Model update skipped. To use twoWay binding, the target property must be observable.",1204:"No host element is present. Cannot bind host with ${name}.",1205:"The requested binding behavior is not supported by the binding engine.",1401:"Missing FASTElement definition.",1501:"No registration for Context/Interface '${name}'.",1502:"Dependency injection resolver for '${key}' returned a null factory.",1503:"Invalid dependency injection resolver strategy specified '${strategy}'.",1504:"Unable to autoregister dependency.",1505:"Unable to resolve dependency injection key '${key}'.",1506:"'${name}' is a native function and therefore cannot be safely constructed by DI. If this is intentional, please use a callback or cachedCallback resolver.",1507:"Attempted to jitRegister something that is not a constructor '${value}'. Did you forget to register this dependency?",1508:"Attempted to jitRegister an intrinsic type '${value}'. Did you forget to add @inject(Key)?",1509:"Attempted to jitRegister an interface '${value}'.",1510:"A valid resolver was not returned from the register method.",1511:"Key/value cannot be null or undefined. Are you trying to inject/register something that doesn't exist with DI?",1512:"'${key}' not registered. Did you forget to add @singleton()?",1513:"Cyclic dependency found '${name}'.",1514:"Injected properties that are updated on changes to DOM connectivity require the target object to be an instance of FASTElement."},a=/(\$\{\w+?})/g,h=/\$\{(\w+?)}/g,c=Object.freeze({});function d(e,t){return e.split(a).map((e=>{var s;const i=e.replace(h,"$1");return String(null!==(s=t[i])&&void 0!==s?s:e)})).join("")}Object.assign(o,{addMessages(e){Object.assign(l,e)},warn(e,t=c){var s;const i=null!==(s=l[e])&&void 0!==s?s:"Unknown Warning";console.warn(d(i,t))},error(e,t=c){var s;const i=null!==(s=l[e])&&void 0!==s?s:"Unknown Error";return new Error(d(i,t))}});const u={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},u));const f=globalThis.FAST;if(void 0===f.getById){const e=Object.create(null);Reflect.defineProperty(f,"getById",Object.assign({value(t,s){let i=e[t];return void 0===i&&(i=s?e[t]=s():null),i}},u))}void 0===f.error&&Object.assign(f,{warn(){},error:e=>new Error(`Error ${e}`),addMessages(){}});const g=Object.freeze([]);function p(){const e=new Map;return Object.freeze({register:t=>!e.has(t.type)&&(e.set(t.type,t),!0),getByType:t=>e.get(t),getForInstance(t){if(null!=t)return e.get(t.constructor)}})}function b(){const e=new WeakMap;return function(t){let s=e.get(t);if(void 0===s){let i=Reflect.getPrototypeOf(t);for(;void 0===s&&null!==i;)s=e.get(i),i=Reflect.getPrototypeOf(i);s=void 0===s?[]:s.slice(0),e.set(t,s)}return s}}const v=e=>"function"==typeof e,y=e=>"string"==typeof e,m=f.getById(1,(()=>{const e=[],t=[],s=globalThis.requestAnimationFrame;let i=!0;function n(){if(t.length)throw t.shift()}function r(s){try{s.call()}catch(s){if(!i)throw e.length=0,s;t.push(s),setTimeout(n,0)}}function o(){let t=0;for(;t<e.length;)if(r(e[t]),t++,t>1024){for(let s=0,i=e.length-t;s<i;s++)e[s]=e[s+t];e.length-=t,t=0}e.length=0}function l(t){e.push(t),e.length<2&&(i?s(o):o())}return Object.freeze({enqueue:l,next:()=>new Promise(l),process:o,setMode:e=>i=e})}));class w{constructor(e,t){this.sub1=void 0,this.sub2=void 0,this.spillover=void 0,this.subject=e,this.sub1=t}has(e){return void 0===this.spillover?this.sub1===e||this.sub2===e:-1!==this.spillover.indexOf(e)}subscribe(e){const t=this.spillover;if(void 0===t){if(this.has(e))return;if(void 0===this.sub1)return void(this.sub1=e);if(void 0===this.sub2)return void(this.sub2=e);this.spillover=[this.sub1,this.sub2,e],this.sub1=void 0,this.sub2=void 0}else{-1===t.indexOf(e)&&t.push(e)}}unsubscribe(e){const t=this.spillover;if(void 0===t)this.sub1===e?this.sub1=void 0:this.sub2===e&&(this.sub2=void 0);else{const s=t.indexOf(e);-1!==s&&t.splice(s,1)}}notify(e){const t=this.spillover,s=this.subject;if(void 0===t){const t=this.sub1,i=this.sub2;void 0!==t&&t.handleChange(s,e),void 0!==i&&i.handleChange(s,e)}else for(let i=0,n=t.length;i<n;++i)t[i].handleChange(s,e)}}class C{constructor(e){this.subscribers={},this.subjectSubscribers=null,this.subject=e}notify(e){var t,s;null===(t=this.subscribers[e])||void 0===t||t.notify(e),null===(s=this.subjectSubscribers)||void 0===s||s.notify(e)}subscribe(e,t){var s,i;let n;n=t?null!==(s=this.subscribers[t])&&void 0!==s?s:this.subscribers[t]=new w(this.subject):null!==(i=this.subjectSubscribers)&&void 0!==i?i:this.subjectSubscribers=new w(this.subject),n.subscribe(e)}unsubscribe(e,t){var s,i;t?null===(s=this.subscribers[t])||void 0===s||s.unsubscribe(e):null===(i=this.subjectSubscribers)||void 0===i||i.unsubscribe(e)}}const T=Object.freeze({unknown:void 0,coupled:1}),x=f.getById(2,(()=>{const e=m.enqueue,t=/(:|&&|\|\||if)/,s=new WeakMap;let i,n=e=>{throw f.error(1101)};function r(e){var t;let i=null!==(t=e.$fastController)&&void 0!==t?t:s.get(e);return void 0===i&&(Array.isArray(e)?i=n(e):s.set(e,i=new C(e))),i}const o=b();class l{constructor(e){this.name=e,this.field=`_${e}`,this.callback=`${e}Changed`}getValue(e){return void 0!==i&&i.watch(e,this.name),e[this.field]}setValue(e,t){const s=this.field,i=e[s];if(i!==t){e[s]=t;const n=e[this.callback];v(n)&&n.call(e,i,t),r(e).notify(this.name)}}}class a extends w{constructor(e,t,s=!1){super(e,t),this.binding=e,this.isVolatileBinding=s,this.needsRefresh=!0,this.needsQueue=!0,this.isAsync=!0,this.first=this,this.last=null,this.propertySource=void 0,this.propertyName=void 0,this.notifier=void 0,this.next=void 0}setMode(e){this.isAsync=this.needsQueue=e}bind(e){this.controller=e;const t=this.observe(e.source,e.context);return!e.isBound&&this.requiresUnbind(e)&&e.onUnbind(this),t}requiresUnbind(e){return e.sourceLifetime!==T.coupled||this.first!==this.last||this.first.propertySource!==e.source}unbind(e){this.dispose()}observe(e,t){this.needsRefresh&&null!==this.last&&this.dispose();const s=i;let n;i=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;try{n=this.binding(e,t)}finally{i=s}return n}dispose(){if(null!==this.last){let e=this.first;for(;void 0!==e;)e.notifier.unsubscribe(this,e.propertyName),e=e.next;this.last=null,this.needsRefresh=this.needsQueue=this.isAsync}}watch(e,t){const s=this.last,n=r(e),o=null===s?this.first:{};if(o.propertySource=e,o.propertyName=t,o.notifier=n,n.subscribe(this,t),null!==s){if(!this.needsRefresh){let t;i=void 0,t=s.propertySource[s.propertyName],i=this,e===t&&(this.needsRefresh=!0)}s.next=o}this.last=o}handleChange(){this.needsQueue?(this.needsQueue=!1,e(this)):this.isAsync||this.call()}call(){null!==this.last&&(this.needsQueue=this.isAsync,this.notify(this))}*records(){let e=this.first;for(;void 0!==e;)yield e,e=e.next}}return Object.freeze({setArrayObserverFactory(e){n=e},getNotifier:r,track(e,t){i&&i.watch(e,t)},trackVolatile(){i&&(i.needsRefresh=!0)},notify(e,t){r(e).notify(t)},defineProperty(e,t){y(t)&&(t=new l(t)),o(e).push(t),Reflect.defineProperty(e,t.name,{enumerable:!0,get(){return t.getValue(this)},set(e){t.setValue(this,e)}})},getAccessors:o,binding(e,t,s=this.isVolatileBinding(e)){return new a(e,t,s)},isVolatileBinding:e=>t.test(e.toString())})}));function S(e,t){x.defineProperty(e,t)}function O(e,t,s){return Object.assign({},s,{get(){return x.trackVolatile(),s.get.apply(this)}})}const A=f.getById(3,(()=>{let e=null;return{get:()=>e,set(t){e=t}}})),B=Object.freeze({default:{index:0,length:0,get event(){return B.getEvent()},eventDetail(){return this.event.detail},eventTarget(){return this.event.target}},getEvent:()=>A.get(),setEvent(e){A.set(e)}});class j{constructor(e,t,s){this.index=e,this.removed=t,this.addedCount=s}adjustTo(e){let t=this.index;const s=e.length;return t>s?t=s-this.addedCount:t<0&&(t=s+this.removed.length+t-this.addedCount),this.index=t<0?0:t,this}}const k=Object.freeze({reset:1,splice:2,optimized:3}),$=new j(0,g,0);$.reset=!0;const I=[$];function E(e,t,s,i,n,r){let o=0,l=0;const a=Math.min(s-t,r-n);if(0===t&&0===n&&(o=function(e,t,s){for(let i=0;i<s;++i)if(e[i]!==t[i])return i;return s}(e,i,a)),s===e.length&&r===i.length&&(l=function(e,t,s){let i=e.length,n=t.length,r=0;for(;r<s&&e[--i]===t[--n];)r++;return r}(e,i,a-o)),n+=o,r-=l,(s-=l)-(t+=o)==0&&r-n==0)return g;if(t===s){const e=new j(t,[],0);for(;n<r;)e.removed.push(i[n++]);return[e]}if(n===r)return[new j(t,[],s-t)];const h=function(e){let t=e.length-1,s=e[0].length-1,i=e[t][s];const n=[];for(;t>0||s>0;){if(0===t){n.push(2),s--;continue}if(0===s){n.push(3),t--;continue}const r=e[t-1][s-1],o=e[t-1][s],l=e[t][s-1];let a;a=o<l?o<r?o:r:l<r?l:r,a===r?(r===i?n.push(0):(n.push(1),i=r),t--,s--):a===o?(n.push(3),t--,i=o):(n.push(2),s--,i=l)}return n.reverse()}(function(e,t,s,i,n,r){const o=r-n+1,l=s-t+1,a=new Array(o);let h,c;for(let e=0;e<o;++e)a[e]=new Array(l),a[e][0]=e;for(let e=0;e<l;++e)a[0][e]=e;for(let s=1;s<o;++s)for(let r=1;r<l;++r)e[t+r-1]===i[n+s-1]?a[s][r]=a[s-1][r-1]:(h=a[s-1][r]+1,c=a[s][r-1]+1,a[s][r]=h<c?h:c);return a}(e,t,s,i,n,r)),c=[];let d,u=t,f=n;for(let e=0;e<h.length;++e)switch(h[e]){case 0:void 0!==d&&(c.push(d),d=void 0),u++,f++;break;case 1:void 0===d&&(d=new j(u,[],0)),d.addedCount++,u++,d.removed.push(i[f]),f++;break;case 2:void 0===d&&(d=new j(u,[],0)),d.addedCount++,u++;break;case 3:void 0===d&&(d=new j(u,[],0)),d.removed.push(i[f]),f++}return void 0!==d&&c.push(d),c}function V(e,t){let s=!1,i=0;for(let a=0;a<t.length;a++){const h=t[a];if(h.index+=i,s)continue;const c=(n=e.index,r=e.index+e.removed.length,o=h.index,l=h.index+h.addedCount,r<o||l<n?-1:r===o||l===n?0:n<o?r<l?r-o:l-o:l<r?l-n:r-n);if(c>=0){t.splice(a,1),a--,i-=h.addedCount-h.removed.length,e.addedCount+=h.addedCount-c;const n=e.removed.length+h.removed.length-c;if(e.addedCount||n){let t=h.removed;if(e.index<h.index){const s=e.removed.slice(0,h.index-e.index);s.push(...t),t=s}if(e.index+e.removed.length>h.index+h.addedCount){const s=e.removed.slice(h.index+h.addedCount-e.index);t.push(...s)}e.removed=t,h.index<e.index&&(e.index=h.index)}else s=!0}else if(e.index<h.index){s=!0,t.splice(a,0,e),a++;const n=e.addedCount-e.removed.length;h.index+=n,i+=n}}var n,r,o,l;s||t.push(e)}let N=Object.freeze({support:k.optimized,normalize:(e,t,s)=>void 0===e?void 0===s?g:s.length>1?function(e,t){let s=[];const i=[];for(let e=0,s=t.length;e<s;e++)V(t[e],i);for(let t=0,n=i.length;t<n;++t){const n=i[t];1!==n.addedCount||1!==n.removed.length?s=s.concat(E(e,n.index,n.index+n.addedCount,n.removed,0,n.removed.length)):n.removed[0]!==e[n.index]&&s.push(n)}return s}(t,s):s:I,pop(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new j(e.length,[r],0)),r},push(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new j(e.length-i.length,[],i.length).adjustTo(e)),n},reverse(e,t,s,i){const n=s.apply(e,i);return t.reset(e),n},shift(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new j(0,[r],0)),r},sort(e,t,s,i){const n=s.apply(e,i);return t.reset(e),n},splice(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new j(+i[0],n,i.length>2?i.length-2:0).adjustTo(e)),n},unshift(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new j(0,[],i.length).adjustTo(e)),n}});const F=Object.freeze({reset:I,setDefaultStrategy(e){N=e}});function M(e,t,s){Reflect.defineProperty(e,t,{value:s,enumerable:!1})}class L extends w{constructor(e){super(e),this.oldCollection=void 0,this.splices=void 0,this.needsQueue=!0,this._strategy=null,this._lengthObserver=void 0,this.call=this.flush,M(e,"$fastController",this)}get strategy(){return this._strategy}set strategy(e){this._strategy=e}get lengthObserver(){let e=this._lengthObserver;if(void 0===e){const t=this.subject;this._lengthObserver=e={length:t.length,handleChange(){this.length!==t.length&&(this.length=t.length,x.notify(e,"length"))}},this.subscribe(e)}return e}subscribe(e){this.flush(),super.subscribe(e)}addSplice(e){void 0===this.splices?this.splices=[e]:this.splices.push(e),this.enqueue()}reset(e){this.oldCollection=e,this.enqueue()}flush(){var e;const t=this.splices,s=this.oldCollection;void 0===t&&void 0===s||(this.needsQueue=!0,this.splices=void 0,this.oldCollection=void 0,this.notify((null!==(e=this._strategy)&&void 0!==e?e:N).normalize(s,this.subject,t)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,m.enqueue(this))}}let z=!1;const _=Object.freeze({enable(){if(z)return;z=!0,x.setArrayObserverFactory((e=>new L(e)));const e=Array.prototype;e.$fastPatch||(M(e,"$fastPatch",1),[e.pop,e.push,e.reverse,e.shift,e.sort,e.splice,e.unshift].forEach((t=>{e[t.name]=function(...e){var s;const i=this.$fastController;return void 0===i?t.apply(this,e):(null!==(s=i.strategy)&&void 0!==s?s:N)[t.name](this,i,t,e)}})))}});function P(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(_.enable(),t=x.getNotifier(e)),x.track(t.lengthObserver,"length"),e.length}const R=new Map;let D;function H(e){return e.map((e=>e instanceof U?H(e.styles):[e])).reduce(((e,t)=>e.concat(t)),[])}class U{constructor(e){this.styles=e,this.targets=new WeakSet,this._strategy=null,this.behaviors=e.map((e=>e instanceof U?e.behaviors:null)).reduce(((e,t)=>null===t?e:null===e?t:e.concat(t)),null)}get strategy(){return null===this._strategy&&this.withStrategy(D),this._strategy}addStylesTo(e){this.strategy.addStylesTo(e),this.targets.add(e)}removeStylesFrom(e){this.strategy.removeStylesFrom(e),this.targets.delete(e)}isAttachedTo(e){return this.targets.has(e)}withBehaviors(...e){return this.behaviors=null===this.behaviors?e:this.behaviors.concat(e),this}withStrategy(e){return this._strategy=new e(H(this.styles)),this}static setDefaultStrategy(e){D=e}static normalize(e){return void 0===e?void 0:Array.isArray(e)?new U(e):e instanceof U?e:new U([e])}}U.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;class q{constructor(e){this.sheets=e.map((e=>{if(e instanceof CSSStyleSheet)return e;let t=R.get(e);return void 0===t&&(t=new CSSStyleSheet,t.replaceSync(e),R.set(e,t)),t}))}addStylesTo(e){e.adoptedStyleSheets=[...e.adoptedStyleSheets,...this.sheets]}removeStylesFrom(e){const t=this.sheets;e.adoptedStyleSheets=e.adoptedStyleSheets.filter((e=>-1===t.indexOf(e)))}}U.setDefaultStrategy(f.getById(5,(()=>q)));const Q=p(),W=Object.freeze({getForInstance:Q.getForInstance,getByType:Q.getByType,define:e=>(Q.register({type:e}),e)});function K(){return function(e){W.define(e)}}function G(e,t){const s=[];let i="";const n=[],r=e=>{n.push(e)};for(let n=0,o=e.length-1;n<o;++n){i+=e[n];let o=t[n];void 0!==W.getForInstance(o)&&(o=o.createCSS(r)),o instanceof U||o instanceof CSSStyleSheet?(""!==i.trim()&&(s.push(i),i=""),s.push(o)):i+=o}return i+=e[e.length-1],""!==i.trim()&&s.push(i),{styles:s,behaviors:n}}const J=(e,...t)=>{const{styles:s,behaviors:i}=G(e,t),n=new U(s);return i.length?n.withBehaviors(...i):n};class X{constructor(e,t){this.behaviors=t,this.css="";const s=e.reduce(((e,t)=>(y(t)?this.css+=t:e.push(t),e)),[]);s.length&&(this.styles=new U(s))}createCSS(e){return this.behaviors.forEach(e),this.styles&&e(this),this.css}addedCallback(e){e.addStyles(this.styles)}removedCallback(e){e.removeStyles(this.styles)}}W.define(X);const Y=J.partial=(e,...t)=>{const{styles:s,behaviors:i}=G(e,t);return new X(s,i)},Z=Object.freeze({queueUpdate:m.enqueue,nextUpdate:m.next,processUpdates:m.process,setAttribute(e,t,s){null==s?e.removeAttribute(t):e.setAttribute(t,s)},setBooleanAttribute(e,t,s){s?e.setAttribute(t,""):e.removeAttribute(t)}}),ee=`fast-${Math.random().toString(36).substring(2,8)}`,te=`${ee}{`,se=`}${ee}`,ie=se.length;let ne=0;const re=()=>`${ee}-${++ne}`,oe=Object.freeze({interpolation:e=>`${te}${e}${se}`,attribute:e=>`${re()}="${te}${e}${se}"`,comment:e=>`\x3c!--${te}${e}${se}--\x3e`}),le=Object.freeze({parse(e,t){const s=e.split(te);if(1===s.length)return null;const i=[];for(let e=0,n=s.length;e<n;++e){const n=s[e],r=n.indexOf(se);let o;if(-1===r)o=n;else{const e=n.substring(0,r);i.push(t[e]),o=n.substring(r+ie)}""!==o&&i.push(o)}return i}}),ae=Object.freeze({create(e){const t=[],s={};let i=null,n=!1;return{source:e,context:B.default,targets:s,get isBound(){return n},addBehaviorFactory(e,t){const s=e.nodeId||(e.nodeId=re());e.id||(e.id=re()),this.addTarget(s,t),this.addBehavior(e.createBehavior())},addTarget(e,t){s[e]=t},addBehavior(e){t.push(e),n&&e.bind(this)},onUnbind(e){null===i&&(i=[]),i.push(e)},connectedCallback(e){n||(n=!0,t.forEach((e=>e.bind(this))))},disconnectedCallback(e){n&&(n=!1,null!==i&&i.forEach((e=>e.unbind(this))))}}}}),he=p(),ce=Object.freeze({getForInstance:he.getForInstance,getByType:he.getByType,define:(e,t)=>((t=t||{}).type=e,he.register(t),e)});function de(e){return function(t){ce.define(t,e)}}class ue{constructor(e,t=!1){this.evaluate=e,this.isVolatile=t}}const fe=Object.freeze({none:0,attribute:1,booleanAttribute:2,property:3,content:4,tokenList:5,event:6,assign(e,t){if(t)switch(e.sourceAspect=t,t[0]){case":":switch(e.targetAspect=t.substring(1),e.targetAspect){case"innerHTML":default:e.aspectType=fe.property;break;case"classList":e.aspectType=fe.tokenList}break;case"?":e.targetAspect=t.substring(1),e.aspectType=fe.booleanAttribute;break;case"@":e.targetAspect=t.substring(1),e.aspectType=fe.event;break;default:"class"===t?(e.targetAspect="className",e.aspectType=fe.property):(e.targetAspect=t,e.aspectType=fe.attribute)}else e.aspectType=fe.content}});class ge{constructor(e){this.options=e,this.id=re()}createHTML(e){return oe.attribute(e(this))}createBehavior(){return this}}const pe=globalThis.TrustedHTML?e=>(t,s)=>{const i=e(t,s);if(i instanceof TrustedHTML)return i;throw f.error(1202)}:e=>e;class be extends ue{createObserver(e,t){return x.binding(this.evaluate,t,this.isVolatile)}}class ve extends ue{createObserver(){return this}bind(e){return this.evaluate(e.source,e.context)}}function ye(e,t,s,i){if(null==s&&(s=""),s.create){e.textContent="";let t=e.$fastView;void 0===t?t=s.create():e.$fastTemplate!==s&&(t.isComposed&&(t.remove(),t.unbind()),t=s.create()),t.isComposed?t.needsBindOnly&&(t.needsBindOnly=!1,t.bind(i.source,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}}function me(e,t,s){var i;const n=`${this.id}-t`,r=null!==(i=e[n])&&void 0!==i?i:e[n]={c:0,v:Object.create(null)},o=r.v;let l=r.c;const a=e[t];if(null!=s&&s.length){const e=s.split(/\s+/);for(let t=0,s=e.length;t<s;++t){const s=e[t];""!==s&&(o[s]=l,a.add(s))}}if(r.v=l+1,0!==l){l-=1;for(const e in o)o[e]===l&&a.remove(e)}}const we=(e,t,s)=>e[t]=s,Ce=()=>{};class Te{constructor(e){this.dataBinding=e,this.updateTarget=null,this.id=re(),this.aspectType=fe.content,this.bind=this.bindDefault,this.data=`${this.id}-d`}createHTML(e){return oe.interpolation(e(this))}createBehavior(){if(null===this.updateTarget)switch("innerHTML"===this.targetAspect&&(this.dataBinding.evaluate=pe(this.dataBinding.evaluate)),this.aspectType){case 1:this.updateTarget=Z.setAttribute;break;case 2:this.updateTarget=Z.setBooleanAttribute;break;case 3:this.updateTarget=we;break;case 4:this.bind=this.bindContent,this.updateTarget=ye;break;case 5:this.updateTarget=me;break;case 6:this.bind=this.bindEvent,this.updateTarget=Ce;break;default:throw f.error(1205)}return this}bindDefault(e){var t;const s=e.targets[this.nodeId],i=null!==(t=s[this.data])&&void 0!==t?t:s[this.data]=this.dataBinding.createObserver(this,this);i.target=s,i.controller=e,this.updateTarget(s,this.targetAspect,i.bind(e),e),this.updateTarget===ye&&e.onUnbind(this)}bindContent(e){this.bindDefault(e),e.onUnbind(this)}bindEvent(e){const t=e.targets[this.nodeId];t[this.data]=e,t.addEventListener(this.targetAspect,this,this.dataBinding.options)}unbind(e){const t=e.targets[this.nodeId].$fastView;void 0!==t&&t.isComposed&&(t.unbind(),t.needsBindOnly=!0)}handleEvent(e){const t=e.currentTarget;B.setEvent(e);const s=t[this.data],i=this.dataBinding.evaluate(s.source,s.context);B.setEvent(null),!0!==i&&e.preventDefault()}handleChange(e,t){const s=t.target,i=t.controller;this.updateTarget(s,this.targetAspect,t.bind(i),i)}}function xe(e,t=x.isVolatileBinding(e)){return new be(e,t)}function Se(e){return new ve(e)}function Oe(e,t){const s=new be(e,!1);return s.options=t,s}function Ae(e){return v(e)?xe(e):e instanceof ue?e:Se((()=>e))}function Be(e,t){const s=e.parentNode;let i,n=e;for(;n!==t;)i=n.nextSibling,s.removeChild(n),n=i;s.removeChild(t)}ce.define(Te,{aspected:!0});class je{constructor(e,t,s){this.fragment=e,this.factories=t,this.targets=s,this.behaviors=null,this.unbindables=[],this.source=null,this.isBound=!1,this.sourceLifetime=T.unknown,this.context=this,this.index=0,this.length=0,this.firstChild=e.firstChild,this.lastChild=e.lastChild}get event(){return B.getEvent()}get isEven(){return this.index%2==0}get isOdd(){return this.index%2!=0}get isFirst(){return 0===this.index}get isInMiddle(){return!this.isFirst&&!this.isLast}get isLast(){return this.index===this.length-1}eventDetail(){return this.event.detail}eventTarget(){return this.event.target}appendTo(e){e.appendChild(this.fragment)}insertBefore(e){if(this.fragment.hasChildNodes())e.parentNode.insertBefore(this.fragment,e);else{const t=this.lastChild;if(e.previousSibling===t)return;const s=e.parentNode;let i,n=this.firstChild;for(;n!==t;)i=n.nextSibling,s.insertBefore(n,e),n=i;s.insertBefore(t,e)}}remove(){const e=this.fragment,t=this.lastChild;let s,i=this.firstChild;for(;i!==t;)s=i.nextSibling,e.appendChild(i),i=s;e.appendChild(t)}dispose(){Be(this.firstChild,this.lastChild),this.unbind()}onUnbind(e){this.unbindables.push(e)}bind(e,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){Be(e[0].firstChild,e[e.length-1].lastChild);for(let t=0,s=e.length;t<s;++t)e[t].unbind()}}}x.defineProperty(je.prototype,"index"),x.defineProperty(je.prototype,"length");const ke=(e,t)=>`${e}.${t}`,$e={},Ie={index:0,node:null};function Ee(e){e.startsWith("fast-")||f.warn(1204,{name:e})}const Ve=new Proxy(document.createElement("div"),{get(e,t){Ee(t);const s=Reflect.get(e,t);return v(s)?s.bind(e):s},set:(e,t,s)=>(Ee(t),Reflect.set(e,t,s))});class Ne{constructor(e,t){this.fragment=e,this.directives=t,this.proto=null,this.nodeIds=new Set,this.descriptors={},this.factories=[]}addFactory(e,t,s,i){this.nodeIds.has(s)||(this.nodeIds.add(s),this.addTargetDescriptor(t,s,i)),e.nodeId=s,this.factories.push(e)}freeze(){return this.proto=Object.create(null,this.descriptors),this}addTargetDescriptor(e,t,s){const i=this.descriptors;if("r"===t||"h"===t||i[t])return;if(!i[e]){const t=e.lastIndexOf("."),s=e.substring(0,t),i=parseInt(e.substring(t+1));this.addTargetDescriptor(s,e,i)}let n=$e[t];if(!n){const i=`_${t}`;$e[t]=n={get(){var t;return null!==(t=this[i])&&void 0!==t?t:this[i]=this[e].childNodes[s]}}}i[t]=n}createView(e){const t=this.fragment.cloneNode(!0),s=Object.create(this.proto);s.r=t,s.h=null!=e?e:Ve;for(const e of this.nodeIds)s[e];return new je(t,this.factories,s)}}function Fe(e,t,s,i,n,r=!1){const o=s.attributes,l=e.directives;for(let a=0,h=o.length;a<h;++a){const c=o[a],d=c.value,u=le.parse(d,l);let f=null;null===u?r&&(f=new Te(Se((()=>d))),fe.assign(f,c.name)):f=Re.aggregate(u),null!==f&&(s.removeAttributeNode(c),a--,h--,e.addFactory(f,t,i,n))}}function Me(e,t,s){let i=0,n=t.firstChild;for(;n;){const t=Le(e,s,n,i);n=t.node,i=t.index}}function Le(e,t,s,i){const n=ke(t,i);switch(s.nodeType){case 1:Fe(e,t,s,n,i),Me(e,s,n);break;case 3:return function(e,t,s,i,n){const r=le.parse(t.textContent,e.directives);if(null===r)return Ie.node=t.nextSibling,Ie.index=n+1,Ie;let o,l=o=t;for(let t=0,a=r.length;t<a;++t){const a=r[t];0!==t&&(n++,i=ke(s,n),o=l.parentNode.insertBefore(document.createTextNode(""),l.nextSibling)),y(a)?o.textContent=a:(o.textContent=" ",fe.assign(a),e.addFactory(a,s,i,n)),l=o}return Ie.index=n+1,Ie.node=l.nextSibling,Ie}(e,s,t,n,i);case 8:const r=le.parse(s.data,e.directives);null!==r&&e.addFactory(Re.aggregate(r),t,n,i)}return Ie.index=i+1,Ie.node=s.nextSibling,Ie}const ze={createHTML:e=>e};let _e=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",ze):ze;const Pe=_e,Re={setHTMLPolicy(e){if(_e!==Pe)throw f.error(1201);_e=e},compile(e,t){let s;if(y(e)){s=document.createElement("TEMPLATE"),s.innerHTML=_e.createHTML(e);const t=s.content.firstElementChild;null!==t&&"TEMPLATE"===t.tagName&&(s=t)}else s=e;const i=document.adoptNode(s.content),n=new Ne(i,t);return Fe(n,"",s,"h",0,!0),(function(e,t){return e&&8==e.nodeType&&null!==le.parse(e.data,t)}(i.firstChild,t)||1===i.childNodes.length&&Object.keys(t).length>0)&&i.insertBefore(document.createComment(""),i.firstChild),Me(n,i,"r"),Ie.node=null,n.freeze()},setDefaultStrategy(e){this.compile=e},aggregate(e){if(1===e.length)return e[0];let t,s,i=!1;const n=e.length,r=e.map((e=>y(e)?()=>e:(t=e.sourceAspect||t,s=e.dataBinding||s,i=i||e.dataBinding.isVolatile,e.dataBinding.evaluate)));s.evaluate=(e,t)=>{let s="";for(let i=0;i<n;++i)s+=r[i](e,t);return s},s.isVolatile=i;const o=new Te(s);return fe.assign(o,t),o}};class De{constructor(e,t){this.result=null,this.html=e,this.factories=t}create(e){return null===this.result&&(this.result=Re.compile(this.html,this.factories)),this.result.createView(e)}render(e,t,s){const i=this.create(s);return i.bind(e),i.appendTo(t),i}}const He=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function Ue(e,t,s){const i=He.exec(t);return null!==i&&fe.assign(e,i[2]),e.createHTML(s)}function qe(e,...t){let s="";const i=Object.create(null),n=e=>{var t;const s=null!==(t=e.id)&&void 0!==t?t:e.id=re();return i[s]=e,s};for(let i=0,r=e.length-1;i<r;++i){const r=e[i],o=t[i];let l;if(s+=r,v(o))s+=Ue(new Te(xe(o)),r,n);else if(y(o)){const e=He.exec(r);if(null!==e){const t=new Te(Se((()=>o)));fe.assign(t,e[2]),s+=t.createHTML(n)}else s+=o}else o instanceof ue?s+=Ue(new Te(o),r,n):void 0===(l=ce.getForInstance(o))?s+=Ue(new Te(Se((()=>o))),r,n):l.aspected?s+=Ue(o,r,n):s+=o.createHTML(n)}return new De(s+e[e.length-1],i)}class Qe extends ge{bind(e){e.source[this.options]=e.targets[this.nodeId]}}ce.define(Qe);const We=e=>new Qe(e);function Ke(e,t){const s=v(e)?e:()=>e,i=v(t)?t:()=>t;return(e,t)=>s(e,t)?i(e,t):null}const Ge=Object.freeze({positioning:!1,recycle:!0});function Je(e,t,s,i){e.context.parent=i.source,e.context.parentContext=i.context,e.bind(t[s])}function Xe(e,t,s,i){e.context.parent=i.source,e.context.parentContext=i.context,e.context.length=t.length,e.context.index=s,e.bind(t[s])}class Ye{constructor(e){this.directive=e,this.views=[],this.items=null,this.itemsObserver=null,this.bindView=Je,this.itemsBindingObserver=e.dataBinding.createObserver(e,this),this.templateBindingObserver=e.templateBinding.createObserver(e,this),e.options.positioning&&(this.bindView=Xe)}bind(e){this.location=e.targets[this.directive.nodeId],this.controller=e,this.items=this.itemsBindingObserver.bind(e),this.template=this.templateBindingObserver.bind(e),this.observeItems(!0),this.refreshAllViews(),e.onUnbind(this)}unbind(){null!==this.itemsObserver&&this.itemsObserver.unsubscribe(this),this.unbindAllViews()}handleChange(e,t){if(t===this.itemsBindingObserver)this.items=this.itemsBindingObserver.bind(this.controller),this.observeItems(),this.refreshAllViews();else if(t===this.templateBindingObserver)this.template=this.templateBindingObserver.bind(this.controller),this.refreshAllViews(!0);else{if(!t[0])return;t[0].reset?this.refreshAllViews():this.updateViews(t)}}observeItems(e=!1){if(!this.items)return void(this.items=g);const t=this.itemsObserver,s=this.itemsObserver=x.getNotifier(this.items),i=t!==s;i&&null!==t&&t.unsubscribe(this),(i||e)&&s.subscribe(this)}updateViews(e){const t=this.views,s=this.bindView,i=this.items,n=this.template,r=this.controller,o=this.directive.options.recycle,l=[];let a=0,h=0;for(let c=0,d=e.length;c<d;++c){const d=e[c],u=d.removed;let f=0,g=d.index;const p=g+d.addedCount,b=t.splice(d.index,u.length),v=h=l.length+b.length;for(;g<p;++g){const e=t[g],c=e?e.firstChild:this.location;let d;o&&h>0?(f<=v&&b.length>0?(d=b[f],f++):(d=l[a],a++),h--):d=n.create(),t.splice(g,0,d),s(d,i,g,r),d.insertBefore(c)}b[f]&&l.push(...b.slice(f))}for(let e=a,t=l.length;e<t;++e)l[e].dispose();if(this.directive.options.positioning)for(let e=0,s=t.length;e<s;++e){const i=t[e].context;i.length=e,i.index=s}}refreshAllViews(e=!1){const t=this.items,s=this.template,i=this.location,n=this.bindView,r=this.controller;let o=t.length,l=this.views,a=l.length;if(0!==o&&!e&&this.directive.options.recycle||(je.disposeContiguousBatch(l),a=0),0===a){this.views=l=new Array(o);for(let e=0;e<o;++e){const o=s.create();n(o,t,e,r),l[e]=o,o.insertBefore(i)}}else{let e=0;for(;e<o;++e)if(e<a){n(l[e],t,e,r)}else{const o=s.create();n(o,t,e,r),l.push(o),o.insertBefore(i)}const h=l.splice(e,a-e);for(e=0,o=h.length;e<o;++e)h[e].dispose()}}unbindAllViews(){const e=this.views;for(let t=0,s=e.length;t<s;++t)e[t].unbind()}}class Ze{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.options=s,this.id=re(),_.enable()}createHTML(e){return oe.comment(e(this))}createBehavior(){return new Ye(this)}}function et(e,t,s=Ge){const i=Ae(e),n=Ae(t);return new Ze(i,n,Object.assign(Object.assign({},Ge),s))}ce.define(Ze);const tt=e=>1===e.nodeType,st=e=>e?t=>1===t.nodeType&&t.matches(e):tt;class it extends ge{constructor(){super(...arguments),this.sourceProperty=`${this.id}-s`}bind(e){const t=e.targets[this.nodeId];t[this.sourceProperty]=e.source,this.updateTarget(e.source,this.computeNodes(t)),this.observe(t),e.onUnbind(this)}unbind(e){const t=e.targets[this.nodeId];this.updateTarget(e.source,g),this.disconnect(t),t[this.sourceProperty]=null}getSource(e){return e[this.sourceProperty]}updateTarget(e,t){e[this.options.property]=t}computeNodes(e){let t=this.getNodes(e);return"filter"in this.options&&(t=t.filter(this.options.filter)),t}}class nt extends it{observe(e){e.addEventListener("slotchange",this)}disconnect(e){e.removeEventListener("slotchange",this)}getNodes(e){return e.assignedNodes(this.options)}handleEvent(e){const t=e.currentTarget;this.updateTarget(this.getSource(t),this.computeNodes(t))}}function rt(e){return y(e)&&(e={property:e}),new nt(e)}ce.define(nt);class ot extends it{constructor(e){super(e),this.observerProperty=`${this.id}-o`,this.handleEvent=(e,t)=>{const s=t.target;this.updateTarget(this.getSource(s),this.computeNodes(s))},e.childList=!0}observe(e){var t;const s=null!==(t=e[this.observerProperty])&&void 0!==t?t:e[this.observerProperty]=new MutationObserver(this.handleEvent);s.target=e,s.observe(e,this.options)}disconnect(e){const t=e[this.observerProperty];t.target=null,t.disconnect()}getNodes(e){return"selector"in this.options?Array.from(e.querySelectorAll(this.options.selector)):Array.from(e.childNodes)}}function lt(e){return y(e)&&(e={property:e}),new ot(e)}ce.define(ot);const at=Object.freeze({locate:b()}),ht={toView:e=>e?"true":"false",fromView:e=>null!=e&&"false"!==e&&!1!==e&&0!==e};function ct(e){if(null==e)return null;const t=1*e;return isNaN(t)?null:t}const dt={toView(e){const t=ct(e);return t?t.toString():t},fromView:ct};class ut{constructor(e,t,s=t.toLowerCase(),i="reflect",n){this.guards=new Set,this.Owner=e,this.name=t,this.attribute=s,this.mode=i,this.converter=n,this.fieldName=`_${t}`,this.callbackName=`${t}Changed`,this.hasCallback=this.callbackName in e.prototype,"boolean"===i&&void 0===n&&(this.converter=ht)}setValue(e,t){const s=e[this.fieldName],i=this.converter;void 0!==i&&(t=i.fromView(t)),s!==t&&(e[this.fieldName]=t,this.tryReflectToAttribute(e),this.hasCallback&&e[this.callbackName](s,t),e.$fastController.notify(this.name))}getValue(e){return x.track(e,this.name),e[this.fieldName]}onAttributeChangedCallback(e,t){this.guards.has(e)||(this.guards.add(e),this.setValue(e,t),this.guards.delete(e))}tryReflectToAttribute(e){const t=this.mode,s=this.guards;s.has(e)||"fromView"===t||m.enqueue((()=>{s.add(e);const i=e[this.fieldName];switch(t){case"reflect":const t=this.converter;Z.setAttribute(e,this.attribute,void 0!==t?t.toView(i):i);break;case"boolean":Z.setBooleanAttribute(e,this.attribute,i)}s.delete(e)}))}static collect(e,...t){const s=[];t.push(at.locate(e));for(let i=0,n=t.length;i<n;++i){const n=t[i];if(void 0!==n)for(let t=0,i=n.length;t<i;++t){const i=n[t];y(i)?s.push(new ut(e,i)):s.push(new ut(e,i.property,i.attribute,i.mode,i.converter))}}return s}}function ft(e,t){let s;function i(e,t){arguments.length>1&&(s.property=t),at.locate(e.constructor).push(s)}return arguments.length>1?(s={},void i(e,t)):(s=void 0===e?{}:e,i)}const gt={mode:"open"},pt={},bt=f.getById(4,(()=>p()));class vt{constructor(e,t=e.definition){var s;this.platformDefined=!1,y(t)&&(t={name:t}),this.type=e,this.name=t.name,this.template=t.template,this.registry=null!==(s=t.registry)&&void 0!==s?s:customElements;const i=e.prototype,n=ut.collect(e,t.attributes),r=new Array(n.length),o={},l={};for(let e=0,t=n.length;e<t;++e){const t=n[e];r[e]=t.attribute,o[t.name]=t,l[t.attribute]=t,x.defineProperty(i,t)}Reflect.defineProperty(e,"observedAttributes",{value:r,enumerable:!0}),this.attributes=n,this.propertyLookup=o,this.attributeLookup=l,this.shadowOptions=void 0===t.shadowOptions?gt:null===t.shadowOptions?void 0:Object.assign(Object.assign({},gt),t.shadowOptions),this.elementOptions=void 0===t.elementOptions?pt:Object.assign(Object.assign({},pt),t.elementOptions),this.styles=U.normalize(t.styles),bt.register(this)}get isDefined(){return this.platformDefined}define(e=this.registry){const t=this.type;return e.get(this.name)||(this.platformDefined=!0,e.define(this.name,t,this.elementOptions)),this}static compose(e,t){const s=bt.getByType(e);return new vt(s?class extends e{}:e,t)}}vt.getByType=bt.getByType,vt.getForInstance=bt.getForInstance;const yt={bubbles:!0,composed:!0,cancelable:!0},mt=new WeakMap;function wt(e){var t,s;return null!==(s=null!==(t=e.shadowRoot)&&void 0!==t?t:mt.get(e))&&void 0!==s?s:null}class Ct extends C{constructor(e,t){super(e),this.boundObservables=null,this.needsInitialization=!0,this.hasExistingShadowRoot=!1,this._template=null,this._isConnected=!1,this.behaviors=null,this._mainStyles=null,this.$fastController=this,this.view=null,this.source=e,this.definition=t;const s=t.shadowOptions;if(void 0!==s){let t=e.shadowRoot;t?this.hasExistingShadowRoot=!0:(t=e.attachShadow(s),"closed"===s.mode&&mt.set(e,t))}const i=x.getAccessors(e);if(i.length>0){const t=this.boundObservables=Object.create(null);for(let s=0,n=i.length;s<n;++s){const n=i[s].name,r=e[n];void 0!==r&&(delete e[n],t[n]=r)}}}get isConnected(){return x.track(this,"isConnected"),this._isConnected}setIsConnected(e){this._isConnected=e,x.notify(this,"isConnected")}get template(){var e;if(null===this._template){const t=this.definition;this.source.resolveTemplate?this._template=this.source.resolveTemplate():t.template&&(this._template=null!==(e=t.template)&&void 0!==e?e:null)}return this._template}set template(e){this._template!==e&&(this._template=e,this.needsInitialization||this.renderTemplate(e))}get mainStyles(){var e;if(null===this._mainStyles){const t=this.definition;this.source.resolveStyles?this._mainStyles=this.source.resolveStyles():t.styles&&(this._mainStyles=null!==(e=t.styles)&&void 0!==e?e:null)}return this._mainStyles}set mainStyles(e){this._mainStyles!==e&&(null!==this._mainStyles&&this.removeStyles(this._mainStyles),this._mainStyles=e,this.needsInitialization||this.addStyles(e))}addBehavior(e){var t,s;const i=null!==(t=this.behaviors)&&void 0!==t?t:this.behaviors=new Map,n=null!==(s=i.get(e))&&void 0!==s?s:0;0===n?(i.set(e,1),e.addedCallback&&e.addedCallback(this),e.connectedCallback&&this.isConnected&&e.connectedCallback(this)):i.set(e,n+1)}removeBehavior(e,t=!1){const s=this.behaviors;if(null===s)return;const i=s.get(e);void 0!==i&&(1===i||t?(s.delete(e),e.disconnectedCallback&&this.isConnected&&e.disconnectedCallback(this),e.removedCallback&&e.removedCallback(this)):s.set(e,i-1))}addStyles(e){var t;if(!e)return;const s=this.source,i=null!==(t=wt(s))&&void 0!==t?t:s.getRootNode();if(e instanceof HTMLElement)i.append(e);else if(!e.isAttachedTo(i)){const t=e.behaviors;if(e.addStylesTo(i),null!==t)for(let e=0,s=t.length;e<s;++e)this.addBehavior(t[e])}}removeStyles(e){var t;if(!e)return;const s=this.source,i=null!==(t=wt(s))&&void 0!==t?t:s.getRootNode();if(e instanceof HTMLElement)i.removeChild(e);else if(e.isAttachedTo(i)){const t=e.behaviors;if(e.removeStylesFrom(i),null!==t)for(let e=0,s=t.length;e<s;++e)this.addBehavior(t[e])}}connect(){if(this._isConnected)return;this.needsInitialization?this.finishInitialization():null!==this.view&&this.view.bind(this.source);const e=this.behaviors;if(null!==e)for(const t of e.keys())t.connectedCallback&&t.connectedCallback(this);this.setIsConnected(!0)}disconnect(){if(!this._isConnected)return;this.setIsConnected(!1),null!==this.view&&this.view.unbind();const e=this.behaviors;if(null!==e)for(const t of e.keys())t.disconnectedCallback&&t.disconnectedCallback(this)}onAttributeChangedCallback(e,t,s){const i=this.definition.attributeLookup[e];void 0!==i&&i.onAttributeChangedCallback(this.source,s)}emit(e,t,s){return!!this._isConnected&&this.source.dispatchEvent(new CustomEvent(e,Object.assign(Object.assign({detail:t},yt),s)))}finishInitialization(){const e=this.source,t=this.boundObservables;if(null!==t){const s=Object.keys(t);for(let i=0,n=s.length;i<n;++i){const n=s[i];e[n]=t[n]}this.boundObservables=null}this.renderTemplate(this.template),this.addStyles(this.mainStyles),this.needsInitialization=!1}renderTemplate(e){var t;const s=this.source,i=null!==(t=wt(s))&&void 0!==t?t:s;if(null!==this.view)this.view.dispose(),this.view=null;else if(!this.needsInitialization||this.hasExistingShadowRoot){this.hasExistingShadowRoot=!1;for(let e=i.firstChild;null!==e;e=i.firstChild)i.removeChild(e)}e&&(this.view=e.render(s,i,s),this.view.sourceLifetime=T.coupled)}static forCustomElement(e){const t=e.$fastController;if(void 0!==t)return t;const s=vt.getForInstance(e);if(void 0===s)throw f.error(1401);return e.$fastController=new Ct(e,s)}}function Tt(e){return class extends e{constructor(){super(),Ct.forCustomElement(this)}$emit(e,t,s){return this.$fastController.emit(e,t,s)}connectedCallback(){this.$fastController.connect()}disconnectedCallback(){this.$fastController.disconnect()}attributeChangedCallback(e,t,s){this.$fastController.onAttributeChangedCallback(e,t,s)}}}function xt(e,t){return v(e)?vt.compose(e,t).define().type:vt.compose(this,e).define().type}const St=Object.assign(Tt(HTMLElement),{from:function(e){return Tt(e)},define:xt,compose:function(e,t){return v(e)?vt.compose(e,t):vt.compose(this,e)}});function Ot(e){return function(t){xt(t,e)}}export{q as AdoptedStyleSheetsStrategy,_ as ArrayObserver,fe as Aspect,at as AttributeConfiguration,ut as AttributeDefinition,ue as Binding,W as CSSDirective,ot as ChildrenDirective,Re as Compiler,Z as DOM,Ct as ElementController,U as ElementStyles,B as ExecutionContext,f as FAST,St as FASTElement,vt as FASTElementDefinition,Te as HTMLBindingDirective,ce as HTMLDirective,je as HTMLView,oe as Markup,it as NodeObservationDirective,x as Observable,le as Parser,C as PropertyChangeNotifier,Qe as RefDirective,Ye as RepeatBehavior,Ze as RepeatDirective,nt as SlottedDirective,T as SourceLifetime,j as Splice,F as SpliceStrategy,k as SpliceStrategySupport,ge as StatelessAttachedAttributeDirective,w as SubscriberSet,m as Updates,ae as ViewBehaviorOrchestrator,De as ViewTemplate,ft as attr,xe as bind,ht as booleanConverter,lt as children,b as createMetadataLocator,p as createTypeRegistry,J as css,K as cssDirective,Y as cssPartial,Ot as customElement,st as elements,g as emptyArray,qe as html,de as htmlDirective,P as lengthOf,Oe as listener,Ae as normalizeBinding,dt as nullableNumberConverter,S as observable,Se as oneTime,We as ref,et as repeat,rt as slotted,O as volatile,Ke as when};
|
|
1
|
+
void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",{value:Object.create(null),configurable:!1,enumerable:!1,writable:!1});const e=globalThis.FAST,t={1101:"Must call enableArrayObservation before observing arrays.",1201:"The DOM Policy can only be set once.",1202:"To bind innerHTML, you must use a TrustedTypesPolicy.",1203:"View=>Model update skipped. To use twoWay binding, the target property must be observable.",1204:"No host element is present. Cannot bind host with ${name}.",1205:"The requested binding behavior is not supported by the binding engine.",1206:"Calling html`` as a normal function invalidates the security guarantees provided by FAST.",1207:"The DOM Policy for an HTML template can only be set once.",1208:"The DOM Policy cannot be set after a template is compiled.",1209:"'${aspectName}' on '${tagName}' is blocked by the current DOMPolicy.",1401:"Missing FASTElement definition.",1501:"No registration for Context/Interface '${name}'.",1502:"Dependency injection resolver for '${key}' returned a null factory.",1503:"Invalid dependency injection resolver strategy specified '${strategy}'.",1504:"Unable to autoregister dependency.",1505:"Unable to resolve dependency injection key '${key}'.",1506:"'${name}' is a native function and therefore cannot be safely constructed by DI. If this is intentional, please use a callback or cachedCallback resolver.",1507:"Attempted to jitRegister something that is not a constructor '${value}'. Did you forget to register this dependency?",1508:"Attempted to jitRegister an intrinsic type '${value}'. Did you forget to add @inject(Key)?",1509:"Attempted to jitRegister an interface '${value}'.",1510:"A valid resolver was not returned from the register method.",1511:"Key/value cannot be null or undefined. Are you trying to inject/register something that doesn't exist with DI?",1512:"'${key}' not registered. Did you forget to add @singleton()?",1513:"Cyclic dependency found '${name}'.",1514:"Injected properties that are updated on changes to DOM connectivity require the target object to be an instance of FASTElement."},s=/(\$\{\w+?})/g,n=/\$\{(\w+?)}/g,i=Object.freeze({});function r(e,t){return e.split(s).map((e=>{var s;const i=e.replace(n,"$1");return String(null!==(s=t[i])&&void 0!==s?s:e)})).join("")}let o;Object.assign(e,{addMessages(e){Object.assign(t,e)},warn(e,s=i){var n;const o=null!==(n=t[e])&&void 0!==n?n:"Unknown Warning";console.warn(r(o,s))},error(e,s=i){var n;const o=null!==(n=t[e])&&void 0!==n?n:"Unknown Error";return new Error(r(o,s))}});const a="fast-kernel";try{if(document.currentScript)o=document.currentScript.getAttribute(a);else{const e=document.getElementsByTagName("script");o=e[e.length-1].getAttribute(a)}}catch(e){o="isolate"}let l;switch(o){case"share":l=Object.freeze({updateQueue:1,observable:2,contextEvent:3,elementRegistry:4});break;case"share-v2":l=Object.freeze({updateQueue:1.2,observable:2.2,contextEvent:3.2,elementRegistry:4.2});break;default:const e=`-${Math.random().toString(36).substring(2,8)}`;l=Object.freeze({updateQueue:`1.2${e}`,observable:`2.2${e}`,contextEvent:`3.2${e}`,elementRegistry:`4.2${e}`})}const c=e=>"function"==typeof e,d=e=>"string"==typeof e,h=()=>{};!function(){if("undefined"==typeof globalThis)if("undefined"!=typeof global)global.globalThis=global;else if("undefined"!=typeof self)self.globalThis=self;else if("undefined"!=typeof window)window.globalThis=window;else{const e=new Function("return this")();e.globalThis=e}}();const u={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},u));const f=globalThis.FAST;if(void 0===f.getById){const e=Object.create(null);Reflect.defineProperty(f,"getById",Object.assign({value(t,s){let n=e[t];return void 0===n&&(n=s?e[t]=s():null),n}},u))}void 0===f.error&&Object.assign(f,{warn(){},error:e=>new Error(`Error ${e}`),addMessages(){}});const p=Object.freeze([]);function g(){const e=new Map;return Object.freeze({register:t=>!e.has(t.type)&&(e.set(t.type,t),!0),getByType:t=>e.get(t),getForInstance(t){if(null!=t)return e.get(t.constructor)}})}function b(){const e=new WeakMap;return function(t){let s=e.get(t);if(void 0===s){let n=Reflect.getPrototypeOf(t);for(;void 0===s&&null!==n;)s=e.get(n),n=Reflect.getPrototypeOf(n);s=void 0===s?[]:s.slice(0),e.set(t,s)}return s}}function v(e){e.prototype.toJSON=h}const m=Object.freeze({none:0,attribute:1,booleanAttribute:2,property:3,content:4,tokenList:5,event:6}),y=e=>e,w=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:y}):{createHTML:y};let S=Object.freeze({createHTML:e=>w.createHTML(e),protect:(e,t,s,n)=>n});const C=S,T=Object.freeze({get policy(){return S},setPolicy(e){if(S!==C)throw f.error(1201);S=e},setAttribute(e,t,s){null==s?e.removeAttribute(t):e.setAttribute(t,s)},setBooleanAttribute(e,t,s){s?e.setAttribute(t,""):e.removeAttribute(t)}});function x(e,t,s,n){return(e,t,s,...i)=>{d(s)&&(s=s.replace(/(javascript:|vbscript:|data:)/,"")),n(e,t,s,...i)}}function $(e,t,s,n){throw f.error(1209,{aspectName:s,tagName:null!=e?e:"text"})}const B={onabort:$,onauxclick:$,onbeforeinput:$,onbeforematch:$,onblur:$,oncancel:$,oncanplay:$,oncanplaythrough:$,onchange:$,onclick:$,onclose:$,oncontextlost:$,oncontextmenu:$,oncontextrestored:$,oncopy:$,oncuechange:$,oncut:$,ondblclick:$,ondrag:$,ondragend:$,ondragenter:$,ondragleave:$,ondragover:$,ondragstart:$,ondrop:$,ondurationchange:$,onemptied:$,onended:$,onerror:$,onfocus:$,onformdata:$,oninput:$,oninvalid:$,onkeydown:$,onkeypress:$,onkeyup:$,onload:$,onloadeddata:$,onloadedmetadata:$,onloadstart:$,onmousedown:$,onmouseenter:$,onmouseleave:$,onmousemove:$,onmouseout:$,onmouseover:$,onmouseup:$,onpaste:$,onpause:$,onplay:$,onplaying:$,onprogress:$,onratechange:$,onreset:$,onresize:$,onscroll:$,onsecuritypolicyviolation:$,onseeked:$,onseeking:$,onselect:$,onslotchange:$,onstalled:$,onsubmit:$,onsuspend:$,ontimeupdate:$,ontoggle:$,onvolumechange:$,onwaiting:$,onwebkitanimationend:$,onwebkitanimationiteration:$,onwebkitanimationstart:$,onwebkittransitionend:$,onwheel:$},O={elements:{a:{[m.attribute]:{href:x},[m.property]:{href:x}},area:{[m.attribute]:{href:x},[m.property]:{href:x}},button:{[m.attribute]:{formaction:x},[m.property]:{formAction:x}},embed:{[m.attribute]:{src:$},[m.property]:{src:$}},form:{[m.attribute]:{action:x},[m.property]:{action:x}},frame:{[m.attribute]:{src:x},[m.property]:{src:x}},iframe:{[m.attribute]:{src:x},[m.property]:{src:x,srcdoc:$}},input:{[m.attribute]:{formaction:x},[m.property]:{formAction:x}},link:{[m.attribute]:{href:$},[m.property]:{href:$}},object:{[m.attribute]:{codebase:$,data:$},[m.property]:{codeBase:$,data:$}},script:{[m.attribute]:{src:$,text:$},[m.property]:{src:$,text:$,innerText:$,textContent:$}},style:{[m.property]:{innerText:$,textContent:$}}},aspects:{[m.attribute]:Object.assign({},B),[m.property]:Object.assign({innerHTML:$},B),[m.event]:Object.assign({},B)}};function N(e,t){const s={};for(const n in t){const i=e[n],r=t[n];switch(i){case null:break;case void 0:s[n]=r;break;default:s[n]=i}}for(const t in e)t in s||(s[t]=e[t]);return Object.freeze(s)}function k(e,t){const s={};for(const n in t){const i=e[n],r=t[n];switch(i){case null:break;case void 0:s[n]=N(r,{});break;default:s[n]=N(i,r)}}for(const t in e)t in s||(s[t]=N(e[t],{}));return Object.freeze(s)}function A(e,t){const s={};for(const n in t){const i=e[n],r=t[n];switch(i){case null:break;case void 0:s[n]=k(i,{});break;default:s[n]=k(i,r)}}for(const t in e)t in s||(s[t]=k(e[t],{}));return Object.freeze(s)}function E(e,t,s,n,i){const r=e[s];if(r){const e=r[n];if(e)return e(t,s,n,i)}}const M=Object.freeze({create(e={}){var t,s;const n=null!==(t=e.trustedType)&&void 0!==t?t:function(){const e=e=>e;return globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:e}):{createHTML:e}}(),i=(r=null!==(s=e.guards)&&void 0!==s?s:{},o=O,Object.freeze({elements:r.elements?A(r.elements,o.elements):o.elements,aspects:r.aspects?k(r.aspects,o.aspects):o.aspects}));var r,o;return Object.freeze({createHTML:e=>n.createHTML(e),protect(e,t,s,n){var r;const o=(null!=e?e:"").toLowerCase(),a=i.elements[o];if(a){const i=E(a,e,t,s,n);if(i)return i}return null!==(r=E(i.aspects,e,t,s,n))&&void 0!==r?r:n}})}}),j=f.getById(l.updateQueue,(()=>{const e=[],t=[],s=globalThis.requestAnimationFrame;let n=!0;function i(){if(t.length)throw t.shift()}function r(s){try{s.call()}catch(s){if(!n)throw e.length=0,s;t.push(s),setTimeout(i,0)}}function o(){let t=0;for(;t<e.length;)if(r(e[t]),t++,t>1024){for(let s=0,n=e.length-t;s<n;s++)e[s]=e[s+t];e.length-=t,t=0}e.length=0}function a(t){e.push(t),e.length<2&&(n?s(o):o())}return Object.freeze({enqueue:a,next:()=>new Promise(a),process:o,setMode:e=>n=e})}));class V{constructor(e,t){this.sub1=void 0,this.sub2=void 0,this.spillover=void 0,this.subject=e,this.sub1=t}has(e){return void 0===this.spillover?this.sub1===e||this.sub2===e:-1!==this.spillover.indexOf(e)}subscribe(e){const t=this.spillover;if(void 0===t){if(this.has(e))return;if(void 0===this.sub1)return void(this.sub1=e);if(void 0===this.sub2)return void(this.sub2=e);this.spillover=[this.sub1,this.sub2,e],this.sub1=void 0,this.sub2=void 0}else{-1===t.indexOf(e)&&t.push(e)}}unsubscribe(e){const t=this.spillover;if(void 0===t)this.sub1===e?this.sub1=void 0:this.sub2===e&&(this.sub2=void 0);else{const s=t.indexOf(e);-1!==s&&t.splice(s,1)}}notify(e){const t=this.spillover,s=this.subject;if(void 0===t){const t=this.sub1,n=this.sub2;void 0!==t&&t.handleChange(s,e),void 0!==n&&n.handleChange(s,e)}else for(let n=0,i=t.length;n<i;++n)t[n].handleChange(s,e)}}class I{constructor(e){this.subscribers={},this.subjectSubscribers=null,this.subject=e}notify(e){var t,s;null===(t=this.subscribers[e])||void 0===t||t.notify(e),null===(s=this.subjectSubscribers)||void 0===s||s.notify(e)}subscribe(e,t){var s,n;let i;i=t?null!==(s=this.subscribers[t])&&void 0!==s?s:this.subscribers[t]=new V(this.subject):null!==(n=this.subjectSubscribers)&&void 0!==n?n:this.subjectSubscribers=new V(this.subject),i.subscribe(e)}unsubscribe(e,t){var s,n;t?null===(s=this.subscribers[t])||void 0===s||s.unsubscribe(e):null===(n=this.subjectSubscribers)||void 0===n||n.unsubscribe(e)}}const R=Object.freeze({unknown:void 0,coupled:1}),_=f.getById(l.observable,(()=>{const e=j.enqueue,t=/(:|&&|\|\||if|\?\.)/,s=new WeakMap;let n,i=e=>{throw f.error(1101)};function r(e){var t;let n=null!==(t=e.$fastController)&&void 0!==t?t:s.get(e);return void 0===n&&(Array.isArray(e)?n=i(e):s.set(e,n=new I(e))),n}const o=b();class a{constructor(e){this.name=e,this.field=`_${e}`,this.callback=`${e}Changed`}getValue(e){return void 0!==n&&n.watch(e,this.name),e[this.field]}setValue(e,t){const s=this.field,n=e[s];if(n!==t){e[s]=t;const i=e[this.callback];c(i)&&i.call(e,n,t),r(e).notify(this.name)}}}class l extends V{constructor(e,t,s=!1){super(e,t),this.expression=e,this.isVolatileBinding=s,this.needsRefresh=!0,this.needsQueue=!0,this.isAsync=!0,this.first=this,this.last=null,this.propertySource=void 0,this.propertyName=void 0,this.notifier=void 0,this.next=void 0}setMode(e){this.isAsync=this.needsQueue=e}bind(e){this.controller=e;const t=this.observe(e.source,e.context);return!e.isBound&&this.requiresUnbind(e)&&e.onUnbind(this),t}requiresUnbind(e){return e.sourceLifetime!==R.coupled||this.first!==this.last||this.first.propertySource!==e.source}unbind(e){this.dispose()}observe(e,t){this.needsRefresh&&null!==this.last&&this.dispose();const s=n;let i;n=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;try{i=this.expression(e,t)}finally{n=s}return i}disconnect(){this.dispose()}dispose(){if(null!==this.last){let e=this.first;for(;void 0!==e;)e.notifier.unsubscribe(this,e.propertyName),e=e.next;this.last=null,this.needsRefresh=this.needsQueue=this.isAsync}}watch(e,t){const s=this.last,i=r(e),o=null===s?this.first:{};if(o.propertySource=e,o.propertyName=t,o.notifier=i,i.subscribe(this,t),null!==s){if(!this.needsRefresh){let t;n=void 0,t=s.propertySource[s.propertyName],n=this,e===t&&(this.needsRefresh=!0)}s.next=o}this.last=o}handleChange(){this.needsQueue?(this.needsQueue=!1,e(this)):this.isAsync||this.call()}call(){null!==this.last&&(this.needsQueue=this.isAsync,this.notify(this))}*records(){let e=this.first;for(;void 0!==e;)yield e,e=e.next}}return v(l),Object.freeze({setArrayObserverFactory(e){i=e},getNotifier:r,track(e,t){n&&n.watch(e,t)},trackVolatile(){n&&(n.needsRefresh=!0)},notify(e,t){r(e).notify(t)},defineProperty(e,t){d(t)&&(t=new a(t)),o(e).push(t),Reflect.defineProperty(e,t.name,{enumerable:!0,get(){return t.getValue(this)},set(e){t.setValue(this,e)}})},getAccessors:o,binding(e,t,s=this.isVolatileBinding(e)){return new l(e,t,s)},isVolatileBinding:e=>t.test(e.toString())})}));function z(e,t){_.defineProperty(e,t)}function L(e,t,s){return Object.assign({},s,{get(){return _.trackVolatile(),s.get.apply(this)}})}const F=f.getById(l.contextEvent,(()=>{let e=null;return{get:()=>e,set(t){e=t}}})),P=Object.freeze({default:{index:0,length:0,get event(){return P.getEvent()},eventDetail(){return this.event.detail},eventTarget(){return this.event.target}},getEvent:()=>F.get(),setEvent(e){F.set(e)}});class D{constructor(e,t,s){this.index=e,this.removed=t,this.addedCount=s}adjustTo(e){let t=this.index;const s=e.length;return t>s?t=s-this.addedCount:t<0&&(t=s+this.removed.length+t-this.addedCount),this.index=t<0?0:t,this}}const H=Object.freeze({reset:1,splice:2,optimized:3}),U=new D(0,p,0);U.reset=!0;const q=[U];function Q(e,t,s,n,i,r){let o=0,a=0;const l=Math.min(s-t,r-i);if(0===t&&0===i&&(o=function(e,t,s){for(let n=0;n<s;++n)if(e[n]!==t[n])return n;return s}(e,n,l)),s===e.length&&r===n.length&&(a=function(e,t,s){let n=e.length,i=t.length,r=0;for(;r<s&&e[--n]===t[--i];)r++;return r}(e,n,l-o)),i+=o,r-=a,(s-=a)-(t+=o)==0&&r-i==0)return p;if(t===s){const e=new D(t,[],0);for(;i<r;)e.removed.push(n[i++]);return[e]}if(i===r)return[new D(t,[],s-t)];const c=function(e){let t=e.length-1,s=e[0].length-1,n=e[t][s];const i=[];for(;t>0||s>0;){if(0===t){i.push(2),s--;continue}if(0===s){i.push(3),t--;continue}const r=e[t-1][s-1],o=e[t-1][s],a=e[t][s-1];let l;l=o<a?o<r?o:r:a<r?a:r,l===r?(r===n?i.push(0):(i.push(1),n=r),t--,s--):l===o?(i.push(3),t--,n=o):(i.push(2),s--,n=a)}return i.reverse()}(function(e,t,s,n,i,r){const o=r-i+1,a=s-t+1,l=new Array(o);let c,d;for(let e=0;e<o;++e)l[e]=new Array(a),l[e][0]=e;for(let e=0;e<a;++e)l[0][e]=e;for(let s=1;s<o;++s)for(let r=1;r<a;++r)e[t+r-1]===n[i+s-1]?l[s][r]=l[s-1][r-1]:(c=l[s-1][r]+1,d=l[s][r-1]+1,l[s][r]=c<d?c:d);return l}(e,t,s,n,i,r)),d=[];let h,u=t,f=i;for(let e=0;e<c.length;++e)switch(c[e]){case 0:void 0!==h&&(d.push(h),h=void 0),u++,f++;break;case 1:void 0===h&&(h=new D(u,[],0)),h.addedCount++,u++,h.removed.push(n[f]),f++;break;case 2:void 0===h&&(h=new D(u,[],0)),h.addedCount++,u++;break;case 3:void 0===h&&(h=new D(u,[],0)),h.removed.push(n[f]),f++}return void 0!==h&&d.push(h),d}function W(e,t){let s=!1,n=0;for(let l=0;l<t.length;l++){const c=t[l];if(c.index+=n,s)continue;const d=(i=e.index,r=e.index+e.removed.length,o=c.index,a=c.index+c.addedCount,r<o||a<i?-1:r===o||a===i?0:i<o?r<a?r-o:a-o:a<r?a-i:r-i);if(d>=0){t.splice(l,1),l--,n-=c.addedCount-c.removed.length,e.addedCount+=c.addedCount-d;const i=e.removed.length+c.removed.length-d;if(e.addedCount||i){let t=c.removed;if(e.index<c.index){const s=e.removed.slice(0,c.index-e.index);s.push(...t),t=s}if(e.index+e.removed.length>c.index+c.addedCount){const s=e.removed.slice(c.index+c.addedCount-e.index);t.push(...s)}e.removed=t,c.index<e.index&&(e.index=c.index)}else s=!0}else if(e.index<c.index){s=!0,t.splice(l,0,e),l++;const i=e.addedCount-e.removed.length;c.index+=i,n+=i}}var i,r,o,a;s||t.push(e)}let X=Object.freeze({support:H.optimized,normalize:(e,t,s)=>void 0===e?void 0===s?p:function(e,t){let s=[];const n=[];for(let e=0,s=t.length;e<s;e++)W(t[e],n);for(let t=0,i=n.length;t<i;++t){const i=n[t];1!==i.addedCount||1!==i.removed.length?s=s.concat(Q(e,i.index,i.index+i.addedCount,i.removed,0,i.removed.length)):i.removed[0]!==e[i.index]&&s.push(i)}return s}(t,s):q,pop(e,t,s,n){const i=e.length>0,r=s.apply(e,n);return i&&t.addSplice(new D(e.length,[r],0)),r},push(e,t,s,n){const i=s.apply(e,n);return t.addSplice(new D(e.length-n.length,[],n.length).adjustTo(e)),i},reverse(e,t,s,n){const i=s.apply(e,n);return t.reset(e),i},shift(e,t,s,n){const i=e.length>0,r=s.apply(e,n);return i&&t.addSplice(new D(0,[r],0)),r},sort(e,t,s,n){const i=s.apply(e,n);return t.reset(e),i},splice(e,t,s,n){const i=s.apply(e,n);return t.addSplice(new D(+n[0],i,n.length>2?n.length-2:0).adjustTo(e)),i},unshift(e,t,s,n){const i=s.apply(e,n);return t.addSplice(new D(0,[],n.length).adjustTo(e)),i}});const J=Object.freeze({reset:q,setDefaultStrategy(e){X=e}});function K(e,t,s){Reflect.defineProperty(e,t,{value:s,enumerable:!1})}class G extends V{constructor(e){super(e),this.oldCollection=void 0,this.splices=void 0,this.needsQueue=!0,this._strategy=null,this._lengthObserver=void 0,this.call=this.flush,K(e,"$fastController",this)}get strategy(){return this._strategy}set strategy(e){this._strategy=e}get lengthObserver(){let e=this._lengthObserver;if(void 0===e){const t=this.subject;this._lengthObserver=e={length:t.length,handleChange(){this.length!==t.length&&(this.length=t.length,_.notify(e,"length"))}},this.subscribe(e)}return e}subscribe(e){this.flush(),super.subscribe(e)}addSplice(e){void 0===this.splices?this.splices=[e]:this.splices.push(e),this.enqueue()}reset(e){this.oldCollection=e,this.enqueue()}flush(){var e;const t=this.splices,s=this.oldCollection;void 0===t&&void 0===s||(this.needsQueue=!0,this.splices=void 0,this.oldCollection=void 0,this.notify((null!==(e=this._strategy)&&void 0!==e?e:X).normalize(s,this.subject,t)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,j.enqueue(this))}}let Y=!1;const Z=Object.freeze({enable(){if(Y)return;Y=!0,_.setArrayObserverFactory((e=>new G(e)));const e=Array.prototype;e.$fastPatch||(K(e,"$fastPatch",1),[e.pop,e.push,e.reverse,e.shift,e.sort,e.splice,e.unshift].forEach((t=>{e[t.name]=function(...e){var s;const n=this.$fastController;return void 0===n?t.apply(this,e):(null!==(s=n.strategy)&&void 0!==s?s:X)[t.name](this,n,t,e)}})))}});function ee(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(Z.enable(),t=_.getNotifier(e)),_.track(t.lengthObserver,"length"),e.length}class te{constructor(e,t,s=!1){this.evaluate=e,this.policy=t,this.isVolatile=s}}class se extends te{createObserver(e){return _.binding(this.evaluate,e,this.isVolatile)}}function ne(e,t,s=_.isVolatileBinding(e)){return new se(e,t,s)}function ie(e,t){const s=new se(e);return s.options=t,s}class re extends te{createObserver(){return this}bind(e){return this.evaluate(e.source,e.context)}}function oe(e,t){return new re(e,t)}function ae(e){return c(e)?ne(e):e instanceof te?e:oe((()=>e))}let le;function ce(e){return e.map((e=>e instanceof de?ce(e.styles):[e])).reduce(((e,t)=>e.concat(t)),[])}v(re);class de{constructor(e){this.styles=e,this.targets=new WeakSet,this._strategy=null,this.behaviors=e.map((e=>e instanceof de?e.behaviors:null)).reduce(((e,t)=>null===t?e:null===e?t:e.concat(t)),null)}get strategy(){return null===this._strategy&&this.withStrategy(le),this._strategy}addStylesTo(e){this.strategy.addStylesTo(e),this.targets.add(e)}removeStylesFrom(e){this.strategy.removeStylesFrom(e),this.targets.delete(e)}isAttachedTo(e){return this.targets.has(e)}withBehaviors(...e){return this.behaviors=null===this.behaviors?e:this.behaviors.concat(e),this}withStrategy(e){return this._strategy=new e(ce(this.styles)),this}static setDefaultStrategy(e){le=e}static normalize(e){return void 0===e?void 0:Array.isArray(e)?new de(e):e instanceof de?e:new de([e])}}de.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;const he=g(),ue=Object.freeze({getForInstance:he.getForInstance,getByType:he.getByType,define:e=>(he.register({type:e}),e)});function fe(){return function(e){ue.define(e)}}function pe(e,t,s){t.source.style.setProperty(e.targetAspect,s.bind(t))}class ge{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)=>pe(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){pe(this,e,e[this.targetAspect])}removedCallback(e){e.source.$cssBindings&&e.source.$cssBindings.delete(this)}handleChange(e,t){pe(this,t.controller,t)}}ue.define(ge);const be=`${Math.random().toString(36).substring(2,8)}`;let ve=0;const me=()=>`--v${be}${++ve}`;function ye(e,t){const s=[];let n="";const i=[],r=e=>{i.push(e)};for(let i=0,o=e.length-1;i<o;++i){n+=e[i];let o=t[i];c(o)?o=new ge(ne(o),me()).createCSS(r):o instanceof te?o=new ge(o,me()).createCSS(r):void 0!==ue.getForInstance(o)&&(o=o.createCSS(r)),o instanceof de||o instanceof CSSStyleSheet?(""!==n.trim()&&(s.push(n),n=""),s.push(o)):n+=o}return n+=e[e.length-1],""!==n.trim()&&s.push(n),{styles:s,behaviors:i}}const we=(e,...t)=>{const{styles:s,behaviors:n}=ye(e,t),i=new de(s);return n.length?i.withBehaviors(...n):i};class Se{constructor(e,t){this.behaviors=t,this.css="";const s=e.reduce(((e,t)=>(d(t)?this.css+=t:e.push(t),e)),[]);s.length&&(this.styles=new de(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)}}ue.define(Se),we.partial=(e,...t)=>{const{styles:s,behaviors:n}=ye(e,t);return new Se(s,n)};const Ce=/fe-b\$\$start\$\$(\d+)\$\$(.+)\$\$fe-b/,Te=/fe-b\$\$end\$\$(\d+)\$\$(.+)\$\$fe-b/,xe=/fe-repeat\$\$start\$\$(\d+)\$\$fe-repeat/,$e=/fe-repeat\$\$end\$\$(\d+)\$\$fe-repeat/,Be=/^(?:.{0,1000})fe-eb\$\$start\$\$(.+?)\$\$fe-eb/,Oe=/fe-eb\$\$end\$\$(.{0,1000})\$\$fe-eb(?:.{0,1000})$/;function Ne(e){return e&&e.nodeType===Node.COMMENT_NODE}const ke=Object.freeze({attributeMarkerName:"data-fe-b",attributeBindingSeparator:" ",contentBindingStartMarker:(e,t)=>`fe-b$$start$$${e}$$${t}$$fe-b`,contentBindingEndMarker:(e,t)=>`fe-b$$end$$${e}$$${t}$$fe-b`,repeatStartMarker:e=>`fe-repeat$$start$$${e}$$fe-repeat`,repeatEndMarker:e=>`fe-repeat$$end$$${e}$$fe-repeat`,isContentBindingStartMarker:e=>Ce.test(e),isContentBindingEndMarker:e=>Te.test(e),isRepeatViewStartMarker:e=>xe.test(e),isRepeatViewEndMarker:e=>$e.test(e),isElementBoundaryStartMarker:e=>Ne(e)&&Be.test(e.data.trim()),isElementBoundaryEndMarker:e=>Ne(e)&&Oe.test(e.data),parseAttributeBinding(e){const t=e.getAttribute(this.attributeMarkerName);return null===t?t:t.split(this.attributeBindingSeparator).map((e=>parseInt(e)))},parseContentBindingStartMarker:e=>Me(Ce,e),parseContentBindingEndMarker:e=>Me(Te,e),parseRepeatStartMarker:e=>Ae(xe,e),parseRepeatEndMarker:e=>Ae($e,e),parseElementBoundaryStartMarker:e=>Ee(Be,e.trim()),parseElementBoundaryEndMarker:e=>Ee(Oe,e)});function Ae(e,t){const s=e.exec(t);return null===s?s:parseInt(s[1])}function Ee(e,t){const s=e.exec(t);return null===s?s:s[1]}function Me(e,t){const s=e.exec(t);return null===s?s:[parseInt(s[1]),s[2]]}const je=Symbol.for("fe-hydration");function Ve(e){return e[je]===je}const Ie=`fast-${Math.random().toString(36).substring(2,8)}`,Re=`${Ie}{`,_e=`}${Ie}`,ze=_e.length;let Le=0;const Fe=()=>`${Ie}-${++Le}`,Pe=Object.freeze({interpolation:e=>`${Re}${e}${_e}`,attribute:e=>`${Fe()}="${Re}${e}${_e}"`,comment:e=>`\x3c!--${Re}${e}${_e}--\x3e`}),De=Object.freeze({parse(e,t){const s=e.split(Re);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(_e);let o;if(-1===r)o=i;else{const e=i.substring(0,r);n.push(t[e]),o=i.substring(r+ze)}""!==o&&n.push(o)}return n}}),He=g(),Ue=Object.freeze({getForInstance:He.getForInstance,getByType:He.getByType,define:(e,t)=>((t=t||{}).type=e,He.register(t),e),assignAspect(e,t){if(t)switch(e.sourceAspect=t,t[0]){case":":e.targetAspect=t.substring(1),e.aspectType="classList"===e.targetAspect?m.tokenList:m.property;break;case"?":e.targetAspect=t.substring(1),e.aspectType=m.booleanAttribute;break;case"@":e.targetAspect=t.substring(1),e.aspectType=m.event;break;default:e.targetAspect=t,e.aspectType=m.attribute}else e.aspectType=m.content}});function qe(e){return function(t){Ue.define(t,e)}}class Qe{constructor(e){this.options=e}createHTML(e){return Pe.attribute(e(this))}createBehavior(){return this}}v(Qe);class We extends Error{constructor(e,t,s){super(e),this.factories=t,this.node=s}}function Xe(e){return e.nodeType===Node.COMMENT_NODE}function Je(e){return e.nodeType===Node.TEXT_NODE}function Ke(e,t){const s=document.createRange();return s.setStart(e,0),s.setEnd(t,Xe(t)||Je(t)?t.data.length:t.childNodes.length),s}function Ge(e,t,s){const n=ke.parseAttributeBinding(e);if(null!==n){for(const i of n){if(!t[i])throw new We(`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);Ze(t[i],e,s)}e.removeAttribute(ke.attributeMarkerName)}}function Ye(e,t,s,n,i){if(ke.isElementBoundaryStartMarker(e))!function(e,t){const s=ke.parseElementBoundaryStartMarker(e.data);let n=t.nextSibling();for(;null!==n;){if(Xe(n)){const e=ke.parseElementBoundaryEndMarker(n.data);if(e&&e===s)break}n=t.nextSibling()}}(e,t);else if(ke.isContentBindingStartMarker(e.data)){const r=ke.parseContentBindingStartMarker(e.data);if(null===r)return;const[o,a]=r,l=s[o],c=[];let d=t.nextSibling();e.data="";const h=d;for(;null!==d;){if(Xe(d)){const e=ke.parseContentBindingEndMarker(d.data);if(e&&e[1]===a)break}c.push(d),d=t.nextSibling()}if(null===d){const t=e.getRootNode();throw new Error(`Error hydrating Comment node inside "${function(e){return e instanceof DocumentFragment&&"mode"in e}(t)?t.host.nodeName:t.nodeName}".`)}if(d.data="",1===c.length&&Je(c[0]))Ze(l,c[0],n);else{d!==h&&null!==d.previousSibling&&(i[l.targetNodeId]={first:h,last:d.previousSibling});Ze(l,d.parentNode.insertBefore(document.createTextNode(""),d),n)}}}function Ze(e,t,s){if(void 0===e.targetNodeId)throw new Error("Factory could not be target to the node");s[e.targetNodeId]=t}var et;function tt(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 st{constructor(){this.index=0,this.length=0}get event(){return P.getEvent()}get isEven(){return this.index%2==0}get isOdd(){return this.index%2!=0}get isFirst(){return 0===this.index}get isInMiddle(){return!this.isFirst&&!this.isLast}get isLast(){return this.index===this.length-1}eventDetail(){return this.event.detail}eventTarget(){return this.event.target}}class nt extends st{constructor(e,t,s){super(),this.fragment=e,this.factories=t,this.targets=s,this.behaviors=null,this.unbindables=[],this.source=null,this.isBound=!1,this.sourceLifetime=R.unknown,this.context=this,this.firstChild=e.firstChild,this.lastChild=e.lastChild}appendTo(e){e.appendChild(this.fragment)}insertBefore(e){if(this.fragment.hasChildNodes())e.parentNode.insertBefore(this.fragment,e);else{const t=this.lastChild;if(e.previousSibling===t)return;const s=e.parentNode;let n,i=this.firstChild;for(;i!==t;)n=i.nextSibling,s.insertBefore(i,e),i=n;s.insertBefore(t,e)}}remove(){const e=this.fragment,t=this.lastChild;let s,n=this.firstChild;for(;n!==t;)s=n.nextSibling,e.appendChild(n),n=s;e.appendChild(t)}dispose(){tt(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){tt(e[0].firstChild,e[e.length-1].lastChild);for(let t=0,s=e.length;t<s;++t)e[t].unbind()}}}v(nt),_.defineProperty(nt.prototype,"index"),_.defineProperty(nt.prototype,"length");const it="unhydrated",rt="hydrating",ot="hydrated";class at extends Error{constructor(e,t,s,n){super(e),this.factory=t,this.fragment=s,this.templateString=n}}et=je,v(class extends st{constructor(e,t,s,n){super(),this.firstChild=e,this.lastChild=t,this.sourceTemplate=s,this.hostBindingTarget=n,this[et]=je,this.context=this,this.source=null,this.isBound=!1,this.sourceLifetime=R.unknown,this.unbindables=[],this.fragment=null,this.behaviors=null,this._hydrationStage=it,this._bindingViewBoundaries={},this._targets={},this.factories=s.compile().factories}get hydrationStage(){return this._hydrationStage}get targets(){return this._targets}get bindingViewBoundaries(){return this._bindingViewBoundaries}insertBefore(e){if(null!==this.fragment)if(this.fragment.hasChildNodes())e.parentNode.insertBefore(this.fragment,e);else{const t=this.lastChild;if(e.previousSibling===t)return;const s=e.parentNode;let n,i=this.firstChild;for(;i!==t;)n=i.nextSibling,s.insertBefore(i,e),i=n;s.insertBefore(t,e)}}appendTo(e){null!==this.fragment&&e.appendChild(this.fragment)}remove(){const e=this.fragment||(this.fragment=document.createDocumentFragment()),t=this.lastChild;let s,n=this.firstChild;for(;n!==t;){if(s=n.nextSibling,!s)throw new Error(`Unmatched first/last child inside "${t.getRootNode().host.nodeName}".`);e.appendChild(n),n=s}e.appendChild(t)}bind(e,t=this){var s,n;if(this.hydrationStage!==ot&&(this._hydrationStage=rt),this.source===e)return;let i=this.behaviors;if(null===i){this.source=e,this.context=t;try{const{targets:e,boundaries:t}=function(e,t,s){const n=Ke(e,t),i=n.commonAncestorContainer,r=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_COMMENT+NodeFilter.SHOW_TEXT,{acceptNode:e=>0===n.comparePoint(e,0)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}),o={},a={};let l=r.currentNode=e;for(;null!==l;){switch(l.nodeType){case Node.ELEMENT_NODE:Ge(l,s,o);break;case Node.COMMENT_NODE:Ye(l,r,s,o,a)}l=r.nextNode()}return n.detach(),{targets:o,boundaries:a}}(this.firstChild,this.lastChild,this.factories);this._targets=e,this._bindingViewBoundaries=t}catch(e){if(e instanceof We){let t=this.sourceTemplate.html;"string"!=typeof t&&(t=t.innerHTML),e.templateString=t}throw e}this.behaviors=i=new Array(this.factories.length);const r=this.factories;for(let e=0,t=r.length;e<t;++e){const t=r[e];if("h"===t.targetNodeId&&this.hostBindingTarget&&Ze(t,this.hostBindingTarget,this._targets),!(t.targetNodeId in this.targets)){let e=this.sourceTemplate.html;throw"string"!=typeof e&&(e=e.innerHTML),new at(`HydrationView was unable to successfully target bindings inside "${null===(n=(null===(s=this.firstChild)||void 0===s?void 0:s.getRootNode()).host)||void 0===n?void 0:n.nodeName}".`,t,Ke(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=ot}unbind(){this.isBound&&null!==this.source&&(this.evaluateUnbindables(),this.source=null,this.context=this,this.isBound=!1)}dispose(){tt(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 lt={[m.attribute]:T.setAttribute,[m.booleanAttribute]:T.setBooleanAttribute,[m.property]:(e,t,s)=>e[t]=s,[m.content]:function(e,t,s,n){if(null==s&&(s=""),function(e){return void 0!==e.create}(s)){e.textContent="";let t=e.$fastView;if(void 0===t)if(Ve(n)&&Ve(s)&&void 0!==n.bindingViewBoundaries[this.targetNodeId]&&n.hydrationStage!==ot){const e=n.bindingViewBoundaries[this.targetNodeId];t=s.hydrate(e.first,e.last)}else t=s.create();else e.$fastTemplate!==s&&(t.isComposed&&(t.remove(),t.unbind()),t=s.create());t.isComposed?t.needsBindOnly&&(t.needsBindOnly=!1,t.bind(n.source,n.context)):(t.isComposed=!0,t.bind(n.source,n.context),t.insertBefore(e),e.$fastView=t,e.$fastTemplate=s)}else{const t=e.$fastView;void 0!==t&&t.isComposed&&(t.isComposed=!1,t.remove(),t.needsBindOnly?t.needsBindOnly=!1:t.unbind()),e.textContent=s}},[m.tokenList]:function(e,t,s){var n;const i=`${this.id}-t`,r=null!==(n=e[i])&&void 0!==n?n:e[i]={v:0,cv:Object.create(null)},o=r.cv;let a=r.v;const l=e[t];if(null!=s&&s.length){const e=s.split(/\s+/);for(let t=0,s=e.length;t<s;++t){const s=e[t];""!==s&&(o[s]=a,l.add(s))}}if(r.v=a+1,0!==a){a-=1;for(const e in o)o[e]===a&&l.remove(e)}},[m.event]:()=>{}};class ct{constructor(e){this.dataBinding=e,this.updateTarget=null,this.aspectType=m.content}createHTML(e){return Pe.interpolation(e(this))}createBehavior(){var e;if(null===this.updateTarget){const t=lt[this.aspectType],s=null!==(e=this.dataBinding.policy)&&void 0!==e?e:this.policy;if(!t)throw f.error(1205);this.data=`${this.id}-d`,this.updateTarget=s.protect(this.targetTagName,this.aspectType,this.targetAspect,t)}return this}bind(e){var t;const s=e.targets[this.targetNodeId],n=Ve(e)&&e.hydrationStage&&e.hydrationStage!==ot;switch(this.aspectType){case m.event:s[this.data]=e,s.addEventListener(this.targetAspect,this,this.dataBinding.options);break;case m.content:e.onUnbind(this);default:const i=null!==(t=s[this.data])&&void 0!==t?t:s[this.data]=this.dataBinding.createObserver(this,this);if(i.target=s,i.controller=e,n&&(this.aspectType===m.attribute||this.aspectType===m.booleanAttribute)){i.bind(e);break}this.updateTarget(s,this.targetAspect,i.bind(e),e)}}unbind(e){const t=e.targets[this.targetNodeId].$fastView;void 0!==t&&t.isComposed&&(t.unbind(),t.needsBindOnly=!0)}handleEvent(e){const t=e.currentTarget[this.data];if(t.isBound){P.setEvent(e);const s=this.dataBinding.evaluate(t.source,t.context);P.setEvent(null),!0!==s&&e.preventDefault()}}handleChange(e,t){const s=t.target,n=t.controller;this.updateTarget(s,this.targetAspect,t.bind(n),n)}}Ue.define(ct,{aspected:!0});const dt=(e,t)=>`${e}.${t}`,ht={},ut={index:0,node:null};function ft(e){e.startsWith("fast-")||f.warn(1204,{name:e})}const pt=new Proxy(document.createElement("div"),{get(e,t){ft(t);const s=Reflect.get(e,t);return c(s)?s.bind(e):s},set:(e,t,s)=>(ft(t),Reflect.set(e,t,s))});class gt{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:Fe(),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=ht[t];if(!i){const n=`_${t}`;ht[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:pt;for(const e of this.nodeIds)s[e];return new nt(t,this.factories,s)}}function bt(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=De.parse(h,a);let f=null;null===u?r&&(f=new ct(oe((()=>h),e.policy)),Ue.assignAspect(f,d.name)):f=wt.aggregate(u,e.policy),null!==f&&(s.removeAttributeNode(d),l--,c--,e.addFactory(f,t,n,i,s.tagName))}}function vt(e,t,s){let n=0,i=t.firstChild;for(;i;){const t=mt(e,s,i,n);i=t.node,n=t.index}}function mt(e,t,s,n){const i=dt(t,n);switch(s.nodeType){case 1:bt(e,t,s,i,n),vt(e,s,i);break;case 3:return function(e,t,s,n,i){const r=De.parse(t.textContent,e.directives);if(null===r)return ut.node=t.nextSibling,ut.index=i+1,ut;let o,a=o=t;for(let t=0,l=r.length;t<l;++t){const l=r[t];0!==t&&(i++,n=dt(s,i),o=a.parentNode.insertBefore(document.createTextNode(""),a.nextSibling)),d(l)?o.textContent=l:(o.textContent=" ",Ue.assignAspect(l),e.addFactory(l,s,n,i,null)),a=o}return ut.index=i+1,ut.node=a.nextSibling,ut}(e,s,t,i,n);case 8:const r=De.parse(s.data,e.directives);null!==r&&e.addFactory(wt.aggregate(r),t,i,n,null)}return ut.index=n+1,ut.node=s.nextSibling,ut}const yt="TEMPLATE",wt={compile(e,t,s=T.policy){let n;if(d(e)){n=document.createElement(yt),n.innerHTML=s.createHTML(e);const t=n.content.firstElementChild;null!==t&&t.tagName===yt&&(n=t)}else n=e;n.content.firstChild||n.content.lastChild||n.content.appendChild(document.createComment(""));const i=document.adoptNode(n.content),r=new gt(i,t,s);var o,a;return bt(r,"",n,"h",0,!0),o=i.firstChild,a=t,(o&&8==o.nodeType&&null!==De.parse(o.data,a)||1===i.childNodes.length&&Object.keys(t).length>0)&&i.insertBefore(document.createComment(""),i.firstChild),vt(r,i,"r"),ut.node=null,r.freeze()},setDefaultStrategy(e){this.compile=e},aggregate(e,t=T.policy){if(1===e.length)return e[0];let s,n,i=!1;const r=e.length,o=e.map((e=>d(e)?()=>e:(s=e.sourceAspect||s,i=i||e.dataBinding.isVolatile,n=n||e.dataBinding.policy,e.dataBinding.evaluate))),a=new ct(ne(((e,t)=>{let s="";for(let n=0;n<r;++n)s+=o[n](e,t);return s}),null!=n?n:t,i));return Ue.assignAspect(a,s),a}},St=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/,Ct=Object.create(null);class Tt{constructor(e,t=Ct){this.html=e,this.factories=t}createHTML(e){const t=this.factories;for(const s in t)e(t[s]);return this.html}}function xt(e,t,s,n=Ue.getForInstance(e)){if(n.aspected){const s=St.exec(t);null!==s&&Ue.assignAspect(e,s[2])}return e.createHTML(s)}Tt.empty=new Tt(""),Ue.define(Tt);class $t{constructor(e,t={},s){this.policy=s,this.result=null,this.html=e,this.factories=t}compile(){return null===this.result&&(this.result=wt.compile(this.html,this.factories,this.policy)),this.result}create(e){return this.compile().createView(e)}inline(){return new Tt(d(this.html)?this.html:this.html.innerHTML,this.factories)}withPolicy(e){if(this.result)throw f.error(1208);if(this.policy)throw f.error(1207);return this.policy=e,this}render(e,t,s){const n=this.create(s);return n.bind(e),n.appendTo(t),n}static create(e,t,s){let n="";const i=Object.create(null),r=e=>{var t;const s=null!==(t=e.id)&&void 0!==t?t:e.id=Fe();return i[s]=e,s};for(let s=0,i=e.length-1;s<i;++s){const i=e[s];let o,a=t[s];if(n+=i,c(a))a=new ct(ne(a));else if(a instanceof te)a=new ct(a);else if(!(o=Ue.getForInstance(a))){const e=a;a=new ct(oe((()=>e)))}n+=xt(a,i,r,o)}return new $t(n+e[e.length-1],i,s)}}v($t);const Bt=(e,...t)=>{if(Array.isArray(e)&&Array.isArray(e.raw))return $t.create(e,t);throw f.error(1206)};Bt.partial=e=>new Tt(e);class Ot extends Qe{bind(e){e.source[this.options]=e.targets[this.targetNodeId]}}Ue.define(Ot);const Nt=e=>new Ot(e),kt=()=>null;function At(e){return void 0===e?kt:c(e)?e:()=>e}function Et(e,t,s){const n=c(e)?e:()=>e,i=At(t),r=At(s);return(e,t)=>n(e,t)?i(e,t):r(e,t)}const Mt=Object.freeze({positioning:!1,recycle:!0});function jt(e,t,s,n){e.context.parent=n.source,e.context.parentContext=n.context,e.bind(t[s])}function Vt(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 It(e){return e.nodeType===Node.COMMENT_NODE}class Rt extends Error{constructor(e,t){super(e),this.propertyBag=t}}class _t{constructor(e){this.directive=e,this.items=null,this.itemsObserver=null,this.bindView=jt,this.views=[],this.itemsBindingObserver=e.dataBinding.createObserver(this,e),this.templateBindingObserver=e.templateBinding.createObserver(this,e),e.options.positioning&&(this.bindView=Vt)}bind(e){this.location=e.targets[this.directive.targetNodeId],this.controller=e,this.items=this.itemsBindingObserver.bind(e),this.template=this.templateBindingObserver.bind(e),this.observeItems(!0),Ve(this.template)&&Ve(e)&&e.hydrationStage!==ot?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():this.updateViews(t)}}observeItems(e=!1){if(!this.items)return void(this.items=p);const t=this.itemsObserver,s=this.itemsObserver=_.getNotifier(this.items),n=t!==s;n&&null!==t&&t.unsubscribe(this),(n||e)&&s.subscribe(this)}updateViews(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||(nt.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 Rt(`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 Rt(`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(!It(t)){t=t.previousSibling;continue}const s=ke.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(It(i))if(ke.isRepeatViewEndMarker(i.data))r++;else if(ke.isRepeatViewStartMarker(i.data)){if(!r){if(ke.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 zt{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.options=s,Z.enable()}createHTML(e){return Pe.comment(e(this))}createBehavior(){return new _t(this)}}function Lt(e,t,s=Mt){const n=ae(e),i=ae(t);return new zt(n,i,Object.assign(Object.assign({},Mt),s))}Ue.define(zt);const Ft=e=>1===e.nodeType,Pt=e=>e?t=>1===t.nodeType&&t.matches(e):Ft;class Dt extends Qe{get id(){return this._id}set id(e){this._id=e,this._controllerProperty=`${e}-c`}bind(e){const t=e.targets[this.targetNodeId];t[this._controllerProperty]=e,this.updateTarget(e.source,this.computeNodes(t)),this.observe(t),e.onUnbind(this)}unbind(e){const t=e.targets[this.targetNodeId];this.updateTarget(e.source,p),this.disconnect(t),t[this._controllerProperty]=null}getSource(e){return e[this._controllerProperty].source}updateTarget(e,t){e[this.options.property]=t}computeNodes(e){let t=this.getNodes(e);return"filter"in this.options&&(t=t.filter(this.options.filter)),t}}const Ht="slotchange";class Ut extends Dt{observe(e){e.addEventListener(Ht,this)}disconnect(e){e.removeEventListener(Ht,this)}getNodes(e){return e.assignedNodes(this.options)}handleEvent(e){const t=e.currentTarget;this.updateTarget(this.getSource(t),this.computeNodes(t))}}function qt(e){return d(e)&&(e={property:e}),new Ut(e)}Ue.define(Ut);class Qt extends Dt{constructor(e){super(e),this.observerProperty=Symbol(),this.handleEvent=(e,t)=>{const s=t.target;this.updateTarget(this.getSource(s),this.computeNodes(s))},e.childList=!0}observe(e){let t=e[this.observerProperty];t||(t=new MutationObserver(this.handleEvent),t.toJSON=h,e[this.observerProperty]=t),t.target=e,t.observe(e,this.options)}disconnect(e){const t=e[this.observerProperty];t.target=null,t.disconnect()}getNodes(e){return"selector"in this.options?Array.from(e.querySelectorAll(this.options.selector)):Array.from(e.childNodes)}}function Wt(e){return d(e)&&(e={property:e}),new Qt(e)}Ue.define(Qt);const Xt="boolean",Jt="reflect",Kt=Object.freeze({locate:b()}),Gt={toView:e=>e?"true":"false",fromView:e=>!(null==e||"false"===e||!1===e||0===e)},Yt={toView:e=>"boolean"==typeof e?e.toString():"",fromView:e=>[null,void 0,void 0].includes(e)?null:Gt.fromView(e)};function Zt(e){if(null==e)return null;const t=1*e;return isNaN(t)?null:t}const es={toView(e){const t=Zt(e);return t?t.toString():t},fromView:Zt};class ts{constructor(e,t,s=t.toLowerCase(),n=Jt,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===Xt&&void 0===i&&(this.converter=Gt)}setValue(e,t){const s=e[this.fieldName],n=this.converter;void 0!==n&&(t=n.fromView(t)),s!==t&&(e[this.fieldName]=t,this.tryReflectToAttribute(e),this.hasCallback&&e[this.callbackName](s,t),e.$fastController.notify(this.name))}getValue(e){return _.track(e,this.name),e[this.fieldName]}onAttributeChangedCallback(e,t){this.guards.has(e)||(this.guards.add(e),this.setValue(e,t),this.guards.delete(e))}tryReflectToAttribute(e){const t=this.mode,s=this.guards;s.has(e)||"fromView"===t||j.enqueue((()=>{s.add(e);const n=e[this.fieldName];switch(t){case Jt:const t=this.converter;T.setAttribute(e,this.attribute,void 0!==t?t.toView(n):n);break;case Xt:T.setBooleanAttribute(e,this.attribute,n)}s.delete(e)}))}static collect(e,...t){const s=[];t.push(Kt.locate(e));for(let n=0,i=t.length;n<i;++n){const i=t[n];if(void 0!==i)for(let t=0,n=i.length;t<n;++t){const n=i[t];d(n)?s.push(new ts(e,n)):s.push(new ts(e,n.property,n.attribute,n.mode,n.converter))}}return s}}function ss(e,t){let s;function n(e,t){arguments.length>1&&(s.property=t),Kt.locate(e.constructor).push(s)}return arguments.length>1?(s={},void n(e,t)):(s=void 0===e?{}:e,n)}const ns={mode:"open"},is={},rs=new Set,os=f.getById(l.elementRegistry,(()=>g()));class as{constructor(e,t=e.definition){var s;this.platformDefined=!1,d(t)&&(t={name:t}),this.type=e,this.name=t.name,this.template=t.template,this.registry=null!==(s=t.registry)&&void 0!==s?s:customElements;const n=e.prototype,i=ts.collect(e,t.attributes),r=new Array(i.length),o={},a={};for(let e=0,t=i.length;e<t;++e){const t=i[e];r[e]=t.attribute,o[t.name]=t,a[t.attribute]=t,_.defineProperty(n,t)}Reflect.defineProperty(e,"observedAttributes",{value:r,enumerable:!0}),this.attributes=i,this.propertyLookup=o,this.attributeLookup=a,this.shadowOptions=void 0===t.shadowOptions?ns:null===t.shadowOptions?void 0:Object.assign(Object.assign({},ns),t.shadowOptions),this.elementOptions=void 0===t.elementOptions?is:Object.assign(Object.assign({},is),t.elementOptions),this.styles=de.normalize(t.styles),os.register(this)}get isDefined(){return this.platformDefined}define(e=this.registry){const t=this.type;return e.get(this.name)||(this.platformDefined=!0,e.define(this.name,t,this.elementOptions)),this}static compose(e,t){return rs.has(e)||os.getByType(e)?new as(class extends e{},t):new as(e,t)}static registerBaseType(e){rs.add(e)}}as.getByType=os.getByType,as.getForInstance=os.getForInstance;class ls{constructor(e){this.directive=e,this.location=null,this.controller=null,this.view=null,this.data=null,this.dataBindingObserver=e.dataBinding.createObserver(this,e),this.templateBindingObserver=e.templateBinding.createObserver(this,e)}bind(e){if(this.location=e.targets[this.directive.targetNodeId],this.controller=e,this.data=this.dataBindingObserver.bind(e),this.template=this.templateBindingObserver.bind(e),e.onUnbind(this),Ve(this.template)&&Ve(e)&&e.hydrationStage!==ot&&!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 cs{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.templateBindingDependsOnData=s}createHTML(e){return Pe.comment(e(this))}createBehavior(){return new ls(this)}}Ue.define(cs);const ds=new Map,hs={":model":e=>e},us=Symbol("RenderInstruction"),fs="default-view",ps=Bt`
|
|
2
|
+
|
|
3
|
+
`;function gs(e){return void 0===e?ps:e.template}function bs(e,t){const s=[],n=[],{attributes:i,directives:r,content:o,policy:a}=null!=t?t:{};if(s.push(`<${e}`),i){const e=Object.getOwnPropertyNames(i);for(let t=0,r=e.length;t<r;++t){const r=e[t];0===t?s[0]=`${s[0]} ${r}="`:s.push(`" ${r}="`),n.push(i[r])}s.push('"')}if(r){s[s.length-1]+=" ";for(let e=0,t=r.length;e<t;++e){const t=r[e];s.push(e>0?"":" "),n.push(t)}}if(s[s.length-1]+=">",o&&c(o.create))n.push(o),s.push(`</${e}>`);else{const t=s.length-1;s[t]=`${s[t]}${null!=o?o:""}</${e}>`}return $t.create(s,n,a)}function vs(e){var t;const s=null!==(t=e.name)&&void 0!==t?t:fs;let n;if((i=e).element||i.tagName){let t=e.tagName;if(!t){const s=as.getByType(e.element);if(!s)throw new Error("Invalid element for model rendering.");t=s.name}e.attributes||(e.attributes=hs),n=bs(t,e)}else n=e.template;var i;return{brand:us,type:e.type,name:s,template:n}}function ms(e){return e&&e.brand===us}function ys(e,t){const s=ds.get(e);if(void 0!==s)return s[null!=t?t:fs]}function ws(e,t){if(e)return ys(e.constructor,t)}Object.freeze({instanceOf:ms,create:vs,createElementTemplate:bs,register:function(e){let t=ds.get(e.type);void 0===t&&ds.set(e.type,t=Object.create(null));const s=ms(e)?e:vs(e);return t[s.name]=s},getByType:ys,getForInstance:ws});class Ss{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 Cs(e,t){let s,n;s=void 0===e?oe((e=>e)):ae(e);let i=!1;if(void 0===t)i=!0,n=oe(((e,t)=>{var n;const i=s.evaluate(e,t);return i instanceof Node?null!==(n=i.$fastTemplate)&&void 0!==n?n:new Ss(i):gs(ws(i))}));else if(c(t))n=ne(((e,n)=>{var i;let r=t(e,n);return d(r)?r=gs(ws(s.evaluate(e,n),r)):r instanceof Node&&(r=null!==(i=r.$fastTemplate)&&void 0!==i?i:new Ss(r)),r}),void 0,!0);else if(d(t))i=!0,n=oe(((e,n)=>{var i;const r=s.evaluate(e,n);return r instanceof Node?null!==(i=r.$fastTemplate)&&void 0!==i?i:new Ss(r):gs(ws(r,t))}));else if(t instanceof te){const e=t.evaluate;t.evaluate=(t,n)=>{var i;let r=e(t,n);return d(r)?r=gs(ws(s.evaluate(t,n),r)):r instanceof Node&&(r=null!==(i=r.$fastTemplate)&&void 0!==i?i:new Ss(r)),r},n=t}else n=oe(((e,s)=>t));return new cs(s,n,i)}class Ts extends MutationObserver{constructor(e){super((function(e){this.callback.call(null,e.filter((e=>this.observedNodes.has(e.target))))})),this.callback=e,this.observedNodes=new Set}observe(e,t){this.observedNodes.add(e),super.observe(e,t)}unobserve(e){this.observedNodes.delete(e),this.observedNodes.size<1&&this.disconnect()}}Object.freeze({create(e){const t=[],s={};let n=null,i=!1;return{source:e,context:P.default,targets:s,get isBound(){return i},addBehaviorFactory(e,t){var s,n,i,r;const o=e;o.id=null!==(s=o.id)&&void 0!==s?s:Fe(),o.targetNodeId=null!==(n=o.targetNodeId)&&void 0!==n?n:Fe(),o.targetTagName=null!==(i=t.tagName)&&void 0!==i?i:null,o.policy=null!==(r=o.policy)&&void 0!==r?r:T.policy,this.addTarget(o.targetNodeId,t),this.addBehavior(o.createBehavior())},addTarget(e,t){s[e]=t},addBehavior(e){t.push(e),i&&e.bind(this)},onUnbind(e){null===n&&(n=[]),n.push(e)},connectedCallback(e){i||(i=!0,t.forEach((e=>e.bind(this))))},disconnectedCallback(e){i&&(i=!1,null!==n&&n.forEach((e=>e.unbind(this))))}}}});const xs={bubbles:!0,composed:!0,cancelable:!0},$s="isConnected",Bs=new WeakMap;function Os(e){var t,s;return null!==(s=null!==(t=e.shadowRoot)&&void 0!==t?t:Bs.get(e))&&void 0!==s?s:null}let Ns;class ks extends I{constructor(e,t){super(e),this.boundObservables=null,this.needsInitialization=!0,this.hasExistingShadowRoot=!1,this._template=null,this.stage=3,this.guardBehaviorConnection=!1,this.behaviors=null,this.behaviorsConnected=!1,this._mainStyles=null,this.$fastController=this,this.view=null,this.source=e,this.definition=t;const s=t.shadowOptions;if(void 0!==s){let t=e.shadowRoot;t?this.hasExistingShadowRoot=!0:(t=e.attachShadow(s),"closed"===s.mode&&Bs.set(e,t))}const n=_.getAccessors(e);if(n.length>0){const t=this.boundObservables=Object.create(null);for(let s=0,i=n.length;s<i;++s){const i=n[s].name,r=e[i];void 0!==r&&(delete e[i],t[i]=r)}}}get isConnected(){return _.track(this,$s),1===this.stage}get context(){var e,t;return null!==(t=null===(e=this.view)||void 0===e?void 0:e.context)&&void 0!==t?t:P.default}get isBound(){var e,t;return null!==(t=null===(e=this.view)||void 0===e?void 0:e.isBound)&&void 0!==t&&t}get sourceLifetime(){var e;return null===(e=this.view)||void 0===e?void 0:e.sourceLifetime}get template(){var e;if(null===this._template){const t=this.definition;this.source.resolveTemplate?this._template=this.source.resolveTemplate():t.template&&(this._template=null!==(e=t.template)&&void 0!==e?e:null)}return this._template}set template(e){this._template!==e&&(this._template=e,this.needsInitialization||this.renderTemplate(e))}get mainStyles(){var e;if(null===this._mainStyles){const t=this.definition;this.source.resolveStyles?this._mainStyles=this.source.resolveStyles():t.styles&&(this._mainStyles=null!==(e=t.styles)&&void 0!==e?e:null)}return this._mainStyles}set mainStyles(e){this._mainStyles!==e&&(null!==this._mainStyles&&this.removeStyles(this._mainStyles),this._mainStyles=e,this.needsInitialization||this.addStyles(e))}onUnbind(e){var t;null===(t=this.view)||void 0===t||t.onUnbind(e)}addBehavior(e){var t,s;const n=null!==(t=this.behaviors)&&void 0!==t?t:this.behaviors=new Map,i=null!==(s=n.get(e))&&void 0!==s?s:0;0===i?(n.set(e,1),e.addedCallback&&e.addedCallback(this),!e.connectedCallback||this.guardBehaviorConnection||1!==this.stage&&0!==this.stage||e.connectedCallback(this)):n.set(e,i+1)}removeBehavior(e,t=!1){const s=this.behaviors;if(null===s)return;const n=s.get(e);void 0!==n&&(1===n||t?(s.delete(e),e.disconnectedCallback&&3!==this.stage&&e.disconnectedCallback(this),e.removedCallback&&e.removedCallback(this)):s.set(e,n-1))}addStyles(e){var t;if(!e)return;const s=this.source;if(e instanceof HTMLElement){(null!==(t=Os(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=Os(s))&&void 0!==t?t:s).removeChild(e)}else if(e.isAttachedTo(s)){const t=e.behaviors;if(e.removeStylesFrom(s),null!==t)for(let e=0,s=t.length;e<s;++e)this.removeBehavior(t[e])}}connect(){3===this.stage&&(this.stage=0,this.bindObservables(),this.connectBehaviors(),this.needsInitialization?(this.renderTemplate(this.template),this.addStyles(this.mainStyles),this.needsInitialization=!1):null!==this.view&&this.view.bind(this.source),this.stage=1,_.notify(this,$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(){1===this.stage&&(this.stage=2,_.notify(this,$s),null!==this.view&&this.view.unbind(),this.disconnectBehaviors(),this.stage=3)}onAttributeChangedCallback(e,t,s){const n=this.definition.attributeLookup[e];void 0!==n&&n.onAttributeChangedCallback(this.source,s)}emit(e,t,s){return 1===this.stage&&this.source.dispatchEvent(new CustomEvent(e,Object.assign(Object.assign({detail:t},xs),s)))}renderTemplate(e){var t;const s=this.source,n=null!==(t=Os(s))&&void 0!==t?t:s;if(null!==this.view)this.view.dispose(),this.view=null;else if(!this.needsInitialization||this.hasExistingShadowRoot){this.hasExistingShadowRoot=!1;for(let e=n.firstChild;null!==e;e=n.firstChild)n.removeChild(e)}e&&(this.view=e.render(s,n,s),this.view.sourceLifetime=R.coupled)}static forCustomElement(e){const t=e.$fastController;if(void 0!==t)return t;const s=as.getForInstance(e);if(void 0===s)throw f.error(1401);return e.$fastController=new Ns(e,s)}static setStrategy(e){Ns=e}}function As(e){var t;return"adoptedStyleSheets"in e?e:null!==(t=Os(e))&&void 0!==t?t:e.getRootNode()}v(ks),ks.setStrategy(ks);class Es{constructor(e){const t=Es.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){Is(As(e),this.sheets)}removeStylesFrom(e){Rs(As(e),this.sheets)}}Es.styleSheetCache=new Map;let Ms=0;function js(e){return e===document?document.body:e}class Vs{constructor(e){this.styles=e,this.styleClass="fast-"+ ++Ms}addStylesTo(e){e=js(As(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=js(As(e))).querySelectorAll(`.${this.styleClass}`);for(let s=0,n=t.length;s<n;++s)e.removeChild(t[s])}}let Is=(e,t)=>{e.adoptedStyleSheets=[...e.adoptedStyleSheets,...t]},Rs=(e,t)=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter((e=>-1===t.indexOf(e)))};if(de.supportsAdoptedStyleSheets){try{document.adoptedStyleSheets.push(),document.adoptedStyleSheets.splice(),Is=(e,t)=>{e.adoptedStyleSheets.push(...t)},Rs=(e,t)=>{for(const s of t){const t=e.adoptedStyleSheets.indexOf(s);-1!==t&&e.adoptedStyleSheets.splice(t,1)}}}catch(e){}de.setDefaultStrategy(Es)}else de.setDefaultStrategy(Vs);const _s="defer-hydration",zs="needs-hydration";class Ls extends ks{static hydrationObserverHandler(e){for(const t of e)Ls.hydrationObserver.unobserve(t.target),t.target.$fastController.connect()}connect(){var e,t;if(void 0===this.needsHydration&&(this.needsHydration=null!==this.source.getAttribute(zs)),this.source.hasAttribute(_s))return void Ls.hydrationObserver.observe(this.source,{attributeFilter:[_s]});if(!this.needsHydration)return void super.connect();if(3!==this.stage)return;this.stage=0,this.bindObservables(),this.connectBehaviors();const s=this.source,n=null!==(e=Os(s))&&void 0!==e?e:s;if(this.template)if(Ve(this.template)){let e=n.firstChild,i=n.lastChild;null===s.shadowRoot&&(ke.isElementBoundaryStartMarker(e)&&(e.data="",e=e.nextSibling),ke.isElementBoundaryEndMarker(i)&&(i.data="",i=i.previousSibling)),this.view=this.template.hydrate(e,i,s),null===(t=this.view)||void 0===t||t.bind(this.source)}else this.renderTemplate(this.template);this.addStyles(this.mainStyles),this.stage=1,this.source.removeAttribute(zs),this.needsInitialization=this.needsHydration=!1,_.notify(this,$s)}disconnect(){super.disconnect(),Ls.hydrationObserver.unobserve(this.source)}static install(){ks.setStrategy(Ls)}}function Fs(e){const t=class extends e{constructor(){super(),ks.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 as.registerBaseType(t),t}function Ps(e,t){return c(e)?as.compose(e,t).define().type:as.compose(this,e).define().type}Ls.hydrationObserver=new Ts(Ls.hydrationObserverHandler);const Ds=Object.assign(Fs(HTMLElement),{from:function(e){return Fs(e)},define:Ps,compose:function(e,t){return c(e)?as.compose(e,t):as.compose(this,e)}});function Hs(e){return function(t){Ps(t,e)}}T.setPolicy(M.create());export{Z as ArrayObserver,Kt as AttributeConfiguration,ts as AttributeDefinition,te as Binding,ge as CSSBindingDirective,ue as CSSDirective,Qt as ChildrenDirective,wt as Compiler,T as DOM,m as DOMAspect,ks as ElementController,de as ElementStyles,P as ExecutionContext,f as FAST,Ds as FASTElement,as as FASTElementDefinition,ct as HTMLBindingDirective,Ue as HTMLDirective,nt as HTMLView,Ls as HydratableElementController,at as HydrationBindingError,Tt as InlineTemplateDirective,Pe as Markup,Dt as NodeObservationDirective,_ as Observable,De as Parser,I as PropertyChangeNotifier,Ot as RefDirective,ls as RenderBehavior,cs as RenderDirective,_t as RepeatBehavior,zt as RepeatDirective,Ut as SlottedDirective,R as SourceLifetime,D as Splice,J as SpliceStrategy,H as SpliceStrategySupport,Qe as StatelessAttachedAttributeDirective,V as SubscriberSet,j as Updates,$t as ViewTemplate,ss as attr,Gt as booleanConverter,Wt as children,we as css,fe as cssDirective,Hs as customElement,Pt as elements,p as emptyArray,Bt as html,qe as htmlDirective,ee as lengthOf,ie as listener,ae as normalizeBinding,Yt as nullableBooleanConverter,es as nullableNumberConverter,z as observable,oe as oneTime,ne as oneWay,Nt as ref,Cs as render,Lt as repeat,qt as slotted,L as volatile,Et as when};
|