@telperion/elements 5.4.1 → 5.4.2

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.
@@ -1,4 +1,4 @@
1
- this.TelperionElements=this.TelperionElements||{},function(t){"use strict";function e(t,e,s,o){var r,i=arguments.length,n=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,s):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,o);else for(var c=t.length-1;c>=0;c--)(r=t[c])&&(n=(i<3?r(n):i>3?r(e,s,n):r(e,s))||n);return i>3&&n&&Object.defineProperty(e,s,n),n}function s(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}"function"==typeof SuppressedError&&SuppressedError;
1
+ this.TelperionElements=this.TelperionElements||{},function(t){"use strict";function e(t,e,s,o){var r,i=arguments.length,n=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,s):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,o);else for(var l=t.length-1;l>=0;l--)(r=t[l])&&(n=(i<3?r(n):i>3?r(e,s,n):r(e,s))||n);return i>3&&n&&Object.defineProperty(e,s,n),n}function s(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}"function"==typeof SuppressedError&&SuppressedError;
2
2
  /**
3
3
  * @license
4
4
  * Copyright 2021 Google LLC
@@ -15,7 +15,7 @@ let o=class extends Event{constructor(t,e,s,o){super("context-request",{bubbles:
15
15
  * Copyright 2021 Google LLC
16
16
  * SPDX-License-Identifier: BSD-3-Clause
17
17
  */
18
- let r=class{constructor(t,e,s,o){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(t,e)=>{this.unsubscribe&&(this.unsubscribe!==e&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=t,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(t,e)),this.unsubscribe=e},this.host=t,void 0!==e.context){const t=e;this.context=t.context,this.callback=t.callback,this.subscribe=t.subscribe??!1}else this.context=e,this.callback=s,this.subscribe=o??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new o(this.context,this.host,this.t,this.subscribe))}},i=class{get value(){return this.o}set value(t){this.setValue(t)}setValue(t,e=!1){const s=e||!Object.is(t,this.o);this.o=t,s&&this.updateObservers()}constructor(t){this.subscriptions=new Map,this.updateObservers=()=>{for(const[t,{disposer:e}]of this.subscriptions)t(this.o,e)},void 0!==t&&(this.value=t)}addCallback(t,e,s){if(!s)return void t(this.value);this.subscriptions.has(t)||this.subscriptions.set(t,{disposer:()=>{this.subscriptions.delete(t)},consumerHost:e});const{disposer:o}=this.subscriptions.get(t);t(this.value,o)}clearCallbacks(){this.subscriptions.clear()}},n=class extends Event{constructor(t,e){super("context-provider",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=e}},c=class extends i{constructor(t,e,s){super(void 0!==e.context?e.initialValue:s),this.onContextRequest=t=>{if(t.context!==this.context)return;const e=t.contextTarget??t.composedPath()[0];e!==this.host&&(t.stopPropagation(),this.addCallback(t.callback,e,t.subscribe))},this.onProviderRequest=t=>{if(t.context!==this.context)return;if((t.contextTarget??t.composedPath()[0])===this.host)return;const e=new Set;for(const[t,{consumerHost:s}]of this.subscriptions)e.has(t)||(e.add(t),s.dispatchEvent(new o(this.context,s,t,!0)));t.stopPropagation()},this.host=t,void 0!==e.context?this.context=e.context:this.context=e,this.attachListeners(),this.host.addController?.(this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new n(this.context,this.host))}};
18
+ let r=class{constructor(t,e,s,o){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(t,e)=>{this.unsubscribe&&(this.unsubscribe!==e&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=t,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(t,e)),this.unsubscribe=e},this.host=t,void 0!==e.context){const t=e;this.context=t.context,this.callback=t.callback,this.subscribe=t.subscribe??!1}else this.context=e,this.callback=s,this.subscribe=o??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new o(this.context,this.host,this.t,this.subscribe))}},i=class{get value(){return this.o}set value(t){this.setValue(t)}setValue(t,e=!1){const s=e||!Object.is(t,this.o);this.o=t,s&&this.updateObservers()}constructor(t){this.subscriptions=new Map,this.updateObservers=()=>{for(const[t,{disposer:e}]of this.subscriptions)t(this.o,e)},void 0!==t&&(this.value=t)}addCallback(t,e,s){if(!s)return void t(this.value);this.subscriptions.has(t)||this.subscriptions.set(t,{disposer:()=>{this.subscriptions.delete(t)},consumerHost:e});const{disposer:o}=this.subscriptions.get(t);t(this.value,o)}clearCallbacks(){this.subscriptions.clear()}},n=class extends Event{constructor(t,e){super("context-provider",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=e}},l=class extends i{constructor(t,e,s){super(void 0!==e.context?e.initialValue:s),this.onContextRequest=t=>{if(t.context!==this.context)return;const e=t.contextTarget??t.composedPath()[0];e!==this.host&&(t.stopPropagation(),this.addCallback(t.callback,e,t.subscribe))},this.onProviderRequest=t=>{if(t.context!==this.context)return;if((t.contextTarget??t.composedPath()[0])===this.host)return;const e=new Set;for(const[t,{consumerHost:s}]of this.subscriptions)e.has(t)||(e.add(t),s.dispatchEvent(new o(this.context,s,t,!0)));t.stopPropagation()},this.host=t,void 0!==e.context?this.context=e.context:this.context=e,this.attachListeners(),this.host.addController?.(this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new n(this.context,this.host))}};
19
19
  /**
20
20
  * @license
21
21
  * Copyright 2021 Google LLC
@@ -26,7 +26,7 @@ let r=class{constructor(t,e,s,o){if(this.subscribe=!1,this.provided=!1,this.valu
26
26
  * Copyright 2022 Google LLC
27
27
  * SPDX-License-Identifier: BSD-3-Clause
28
28
  */
29
- function l({context:t,subscribe:e}){return(s,o)=>{"object"==typeof o?o.addInitializer(function(){new r(this,{context:t,callback:t=>{s.set.call(this,t)},subscribe:e})}):s.constructor.addInitializer(s=>{new r(s,{context:t,callback:t=>{s[o]=t},subscribe:e})})}}var a=Object.defineProperty,h=(t,e,s)=>(((t,e,s)=>{e in t?a(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s})(t,"symbol"!=typeof e?e+"":e,s),s),d=(t,e)=>{if(Object(e)!==e)throw TypeError('Cannot use the "in" operator on this value');return t.has(e)},p=(t,e,s)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,s)},u=(t,e,s)=>(((t,e,s)=>{if(!e.has(t))throw TypeError("Cannot "+s)})(t,e,"access private method"),s);
29
+ function c({context:t,subscribe:e}){return(s,o)=>{"object"==typeof o?o.addInitializer(function(){new r(this,{context:t,callback:t=>{s.set.call(this,t)},subscribe:e})}):s.constructor.addInitializer(s=>{new r(s,{context:t,callback:t=>{s[o]=t},subscribe:e})})}}var a=Object.defineProperty,h=(t,e,s)=>(((t,e,s)=>{e in t?a(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s})(t,"symbol"!=typeof e?e+"":e,s),s),d=(t,e)=>{if(Object(e)!==e)throw TypeError('Cannot use the "in" operator on this value');return t.has(e)},p=(t,e,s)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,s)},u=(t,e,s)=>(((t,e,s)=>{if(!e.has(t))throw TypeError("Cannot "+s)})(t,e,"access private method"),s);
30
30
  /**
31
31
  * @license
32
32
  * Copyright Google LLC All Rights Reserved.
@@ -41,14 +41,14 @@ function f(t,e){return Object.is(t,e)}
41
41
  *
42
42
  * Use of this source code is governed by an MIT-style license that can be
43
43
  * found in the LICENSE file at https://angular.io/license
44
- */let m=null,v=!1,g=1;const y=Symbol("SIGNAL");function b(t){const e=m;return m=t,e}const S={version:0,lastCleanEpoch:0,dirty:!1,producerNode:void 0,producerLastReadVersion:void 0,producerIndexOfThis:void 0,nextProducerIndex:0,liveConsumerNode:void 0,liveConsumerIndexOfThis:void 0,consumerAllowSignalWrites:!1,consumerIsAlwaysLive:!1,producerMustRecompute:()=>!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function $(t){if(v)throw new Error("undefined"!=typeof ngDevMode&&ngDevMode?"Assertion error: signal read during notification phase":"");if(null===m)return;m.consumerOnSignalRead(t);const e=m.nextProducerIndex++;if(O(m),e<m.producerNode.length&&m.producerNode[e]!==t&&x(m)){C(m.producerNode[e],m.producerIndexOfThis[e])}m.producerNode[e]!==t&&(m.producerNode[e]=t,m.producerIndexOfThis[e]=x(m)?A(t,m,e):0),m.producerLastReadVersion[e]=t.version}function w(t){if(t.dirty||t.lastCleanEpoch!==g){if(!t.producerMustRecompute(t)&&!function(t){O(t);for(let e=0;e<t.producerNode.length;e++){const s=t.producerNode[e],o=t.producerLastReadVersion[e];if(o!==s.version)return!0;if(w(s),o!==s.version)return!0}return!1}(t))return t.dirty=!1,void(t.lastCleanEpoch=g);t.producerRecomputeValue(t),t.dirty=!1,t.lastCleanEpoch=g}}function _(t){if(void 0===t.liveConsumerNode)return;const e=v;v=!0;try{for(const e of t.liveConsumerNode)e.dirty||E(e)}finally{v=e}}function E(t){var e;t.dirty=!0,_(t),null==(e=t.consumerMarkedDirty)||e.call(t.wrapper??t)}function A(t,e,s){var o;if(N(t),O(t),0===t.liveConsumerNode.length){null==(o=t.watched)||o.call(t.wrapper);for(let e=0;e<t.producerNode.length;e++)t.producerIndexOfThis[e]=A(t.producerNode[e],t,e)}return t.liveConsumerIndexOfThis.push(s),t.liveConsumerNode.push(e)-1}function C(t,e){var s;if(N(t),O(t),"undefined"!=typeof ngDevMode&&ngDevMode&&e>=t.liveConsumerNode.length)throw new Error(`Assertion error: active consumer index ${e} is out of bounds of ${t.liveConsumerNode.length} consumers)`);if(1===t.liveConsumerNode.length){null==(s=t.unwatched)||s.call(t.wrapper);for(let e=0;e<t.producerNode.length;e++)C(t.producerNode[e],t.producerIndexOfThis[e])}const o=t.liveConsumerNode.length-1;if(t.liveConsumerNode[e]=t.liveConsumerNode[o],t.liveConsumerIndexOfThis[e]=t.liveConsumerIndexOfThis[o],t.liveConsumerNode.length--,t.liveConsumerIndexOfThis.length--,e<t.liveConsumerNode.length){const s=t.liveConsumerIndexOfThis[e],o=t.liveConsumerNode[e];O(o),o.producerIndexOfThis[s]=e}}function x(t){var e;return t.consumerIsAlwaysLive||((null==(e=null==t?void 0:t.liveConsumerNode)?void 0:e.length)??0)>0}function O(t){t.producerNode??(t.producerNode=[]),t.producerIndexOfThis??(t.producerIndexOfThis=[]),t.producerLastReadVersion??(t.producerLastReadVersion=[])}function N(t){t.liveConsumerNode??(t.liveConsumerNode=[]),t.liveConsumerIndexOfThis??(t.liveConsumerIndexOfThis=[])}
44
+ */let m=null,v=!1,g=1;const y=Symbol("SIGNAL");function b(t){const e=m;return m=t,e}const S={version:0,lastCleanEpoch:0,dirty:!1,producerNode:void 0,producerLastReadVersion:void 0,producerIndexOfThis:void 0,nextProducerIndex:0,liveConsumerNode:void 0,liveConsumerIndexOfThis:void 0,consumerAllowSignalWrites:!1,consumerIsAlwaysLive:!1,producerMustRecompute:()=>!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function $(t){if(v)throw new Error("undefined"!=typeof ngDevMode&&ngDevMode?"Assertion error: signal read during notification phase":"");if(null===m)return;m.consumerOnSignalRead(t);const e=m.nextProducerIndex++;if(O(m),e<m.producerNode.length&&m.producerNode[e]!==t&&x(m)){C(m.producerNode[e],m.producerIndexOfThis[e])}m.producerNode[e]!==t&&(m.producerNode[e]=t,m.producerIndexOfThis[e]=x(m)?A(t,m,e):0),m.producerLastReadVersion[e]=t.version}function w(t){if(t.dirty||t.lastCleanEpoch!==g){if(!t.producerMustRecompute(t)&&!function(t){O(t);for(let e=0;e<t.producerNode.length;e++){const s=t.producerNode[e],o=t.producerLastReadVersion[e];if(o!==s.version)return!0;if(w(s),o!==s.version)return!0}return!1}(t))return t.dirty=!1,void(t.lastCleanEpoch=g);t.producerRecomputeValue(t),t.dirty=!1,t.lastCleanEpoch=g}}function E(t){if(void 0===t.liveConsumerNode)return;const e=v;v=!0;try{for(const e of t.liveConsumerNode)e.dirty||_(e)}finally{v=e}}function _(t){var e;t.dirty=!0,E(t),null==(e=t.consumerMarkedDirty)||e.call(t.wrapper??t)}function A(t,e,s){var o;if(N(t),O(t),0===t.liveConsumerNode.length){null==(o=t.watched)||o.call(t.wrapper);for(let e=0;e<t.producerNode.length;e++)t.producerIndexOfThis[e]=A(t.producerNode[e],t,e)}return t.liveConsumerIndexOfThis.push(s),t.liveConsumerNode.push(e)-1}function C(t,e){var s;if(N(t),O(t),"undefined"!=typeof ngDevMode&&ngDevMode&&e>=t.liveConsumerNode.length)throw new Error(`Assertion error: active consumer index ${e} is out of bounds of ${t.liveConsumerNode.length} consumers)`);if(1===t.liveConsumerNode.length){null==(s=t.unwatched)||s.call(t.wrapper);for(let e=0;e<t.producerNode.length;e++)C(t.producerNode[e],t.producerIndexOfThis[e])}const o=t.liveConsumerNode.length-1;if(t.liveConsumerNode[e]=t.liveConsumerNode[o],t.liveConsumerIndexOfThis[e]=t.liveConsumerIndexOfThis[o],t.liveConsumerNode.length--,t.liveConsumerIndexOfThis.length--,e<t.liveConsumerNode.length){const s=t.liveConsumerIndexOfThis[e],o=t.liveConsumerNode[e];O(o),o.producerIndexOfThis[s]=e}}function x(t){var e;return t.consumerIsAlwaysLive||((null==(e=null==t?void 0:t.liveConsumerNode)?void 0:e.length)??0)>0}function O(t){t.producerNode??(t.producerNode=[]),t.producerIndexOfThis??(t.producerIndexOfThis=[]),t.producerLastReadVersion??(t.producerLastReadVersion=[])}function N(t){t.liveConsumerNode??(t.liveConsumerNode=[]),t.liveConsumerIndexOfThis??(t.liveConsumerIndexOfThis=[])}
45
45
  /**
46
46
  * @license
47
47
  * Copyright Google LLC All Rights Reserved.
48
48
  *
49
49
  * Use of this source code is governed by an MIT-style license that can be
50
50
  * found in the LICENSE file at https://angular.io/license
51
- */function k(t){if(w(t),$(t),t.value===R)throw t.error;return t.value}const T=Symbol("UNSET"),P=Symbol("COMPUTING"),R=Symbol("ERRORED"),I=(()=>({...S,value:T,dirty:!0,error:null,equal:f,producerMustRecompute:t=>t.value===T||t.value===P,producerRecomputeValue(t){if(t.value===P)throw new Error("Detected cycle in computations.");const e=t.value;t.value=P;const s=function(t){return t&&(t.nextProducerIndex=0),b(t)}(t);let o,r=!1;try{o=t.computation.call(t.wrapper);r=e!==T&&e!==R&&t.equal.call(t.wrapper,e,o)}catch(e){o=R,t.error=e}finally{!function(t,e){if(b(e),t&&void 0!==t.producerNode&&void 0!==t.producerIndexOfThis&&void 0!==t.producerLastReadVersion){if(x(t))for(let e=t.nextProducerIndex;e<t.producerNode.length;e++)C(t.producerNode[e],t.producerIndexOfThis[e]);for(;t.producerNode.length>t.nextProducerIndex;)t.producerNode.pop(),t.producerLastReadVersion.pop(),t.producerIndexOfThis.pop()}}(t,s)}r?t.value=e:(t.value=o,t.version++)}}))();let M=
51
+ */function T(t){if(w(t),$(t),t.value===I)throw t.error;return t.value}const k=Symbol("UNSET"),P=Symbol("COMPUTING"),I=Symbol("ERRORED"),R=(()=>({...S,value:k,dirty:!0,error:null,equal:f,producerMustRecompute:t=>t.value===k||t.value===P,producerRecomputeValue(t){if(t.value===P)throw new Error("Detected cycle in computations.");const e=t.value;t.value=P;const s=function(t){return t&&(t.nextProducerIndex=0),b(t)}(t);let o,r=!1;try{o=t.computation.call(t.wrapper);r=e!==k&&e!==I&&t.equal.call(t.wrapper,e,o)}catch(e){o=I,t.error=e}finally{!function(t,e){if(b(e),t&&void 0!==t.producerNode&&void 0!==t.producerIndexOfThis&&void 0!==t.producerLastReadVersion){if(x(t))for(let e=t.nextProducerIndex;e<t.producerNode.length;e++)C(t.producerNode[e],t.producerIndexOfThis[e]);for(;t.producerNode.length>t.nextProducerIndex;)t.producerNode.pop(),t.producerLastReadVersion.pop(),t.producerIndexOfThis.pop()}}(t,s)}r?t.value=e:(t.value=o,t.version++)}}))();let M=
52
52
  /**
53
53
  * @license
54
54
  * Copyright Google LLC All Rights Reserved.
@@ -56,7 +56,7 @@ function f(t,e){return Object.is(t,e)}
56
56
  * Use of this source code is governed by an MIT-style license that can be
57
57
  * found in the LICENSE file at https://angular.io/license
58
58
  */
59
- function(){throw new Error};function L(){return $(this),this.value}function U(t,e){!1===(null==m?void 0:m.consumerAllowSignalWrites)&&M(),t.equal.call(t.wrapper,t.value,e)||(t.value=e,function(t){t.version++,g++,_(t)}
59
+ function(){throw new Error};function L(){return $(this),this.value}function U(t,e){!1===(null==m?void 0:m.consumerAllowSignalWrites)&&M(),t.equal.call(t.wrapper,t.value,e)||(t.value=e,function(t){t.version++,g++,E(t)}
60
60
  /**
61
61
  * @license
62
62
  * Copyright 2024 Bloomberg Finance L.P.
@@ -72,7 +72,7 @@ function(){throw new Error};function L(){return $(this),this.value}function U(t,
72
72
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
73
73
  * See the License for the specific language governing permissions and
74
74
  * limitations under the License.
75
- */(t))}const V=(()=>({...S,equal:f,value:void 0}))();const W=Symbol("node");var j;(t=>{var e,s,o,r;e=W,s=new WeakSet,t.isState=t=>"object"==typeof t&&d(s,t),t.State=class{constructor(o,r={}){p(this,s),h(this,e);const i=
75
+ */(t))}const j=(()=>({...S,equal:f,value:void 0}))();const V=Symbol("node");var D;(t=>{var e,s,o,r;e=V,s=new WeakSet,t.isState=t=>"object"==typeof t&&d(s,t),t.State=class{constructor(o,r={}){p(this,s),h(this,e);const i=
76
76
  /**
77
77
  * @license
78
78
  * Copyright Google LLC All Rights Reserved.
@@ -80,39 +80,39 @@ function(){throw new Error};function L(){return $(this),this.value}function U(t,
80
80
  * Use of this source code is governed by an MIT-style license that can be
81
81
  * found in the LICENSE file at https://angular.io/license
82
82
  */
83
- function(t){const e=Object.create(V);e.value=t;const s=()=>($(e),e.value);return s[y]=e,s}(o),n=i[y];if(this[W]=n,n.wrapper=this,r){const e=r.equals;e&&(n.equal=e),n.watched=r[t.subtle.watched],n.unwatched=r[t.subtle.unwatched]}}get(){if(!(0,t.isState)(this))throw new TypeError("Wrong receiver type for Signal.State.prototype.get");return L.call(this[W])}set(e){if(!(0,t.isState)(this))throw new TypeError("Wrong receiver type for Signal.State.prototype.set");if(v)throw new Error("Writes to signals not permitted during Watcher callback");U(this[W],e)}};o=W,r=new WeakSet,t.isComputed=t=>"object"==typeof t&&d(r,t),t.Computed=class{constructor(e,s){p(this,r),h(this,o);const i=function(t){const e=Object.create(I);e.computation=t;const s=()=>k(e);return s[y]=e,s}(e),n=i[y];if(n.consumerAllowSignalWrites=!0,this[W]=n,n.wrapper=this,s){const e=s.equals;e&&(n.equal=e),n.watched=s[t.subtle.watched],n.unwatched=s[t.subtle.unwatched]}}get(){if(!(0,t.isComputed)(this))throw new TypeError("Wrong receiver type for Signal.Computed.prototype.get");return k(this[W])}},(e=>{var s,o,r,i;e.untrack=function(t){let e,s=null;try{s=b(null),e=t()}finally{b(s)}return e},e.introspectSources=function(e){var s;if(!(0,t.isComputed)(e)&&!(0,t.isWatcher)(e))throw new TypeError("Called introspectSources without a Computed or Watcher argument");return(null==(s=e[W].producerNode)?void 0:s.map(t=>t.wrapper))??[]},e.introspectSinks=function(e){var s;if(!(0,t.isComputed)(e)&&!(0,t.isState)(e))throw new TypeError("Called introspectSinks without a Signal argument");return(null==(s=e[W].liveConsumerNode)?void 0:s.map(t=>t.wrapper))??[]},e.hasSinks=function(e){if(!(0,t.isComputed)(e)&&!(0,t.isState)(e))throw new TypeError("Called hasSinks without a Signal argument");const s=e[W].liveConsumerNode;return!!s&&s.length>0},e.hasSources=function(e){if(!(0,t.isComputed)(e)&&!(0,t.isWatcher)(e))throw new TypeError("Called hasSources without a Computed or Watcher argument");const s=e[W].producerNode;return!!s&&s.length>0};s=W,o=new WeakSet,r=new WeakSet,i=function(e){for(const s of e)if(!(0,t.isComputed)(s)&&!(0,t.isState)(s))throw new TypeError("Called watch/unwatch without a Computed or State argument")},t.isWatcher=t=>d(o,t),e.Watcher=class{constructor(t){p(this,o),p(this,r),h(this,s);let e=Object.create(S);e.wrapper=this,e.consumerMarkedDirty=t,e.consumerIsAlwaysLive=!0,e.consumerAllowSignalWrites=!1,e.producerNode=[],this[W]=e}watch(...e){if(!(0,t.isWatcher)(this))throw new TypeError("Called unwatch without Watcher receiver");u(this,r,i).call(this,e);const s=this[W];s.dirty=!1;const o=b(s);for(const t of e)$(t[W]);b(o)}unwatch(...e){if(!(0,t.isWatcher)(this))throw new TypeError("Called unwatch without Watcher receiver");u(this,r,i).call(this,e);const s=this[W];O(s);for(let t=s.producerNode.length-1;t>=0;t--)if(e.includes(s.producerNode[t].wrapper)){C(s.producerNode[t],s.producerIndexOfThis[t]);const e=s.producerNode.length-1;if(s.producerNode[t]=s.producerNode[e],s.producerIndexOfThis[t]=s.producerIndexOfThis[e],s.producerNode.length--,s.producerIndexOfThis.length--,s.nextProducerIndex--,t<s.producerNode.length){const e=s.producerIndexOfThis[t],o=s.producerNode[t];N(o),o.liveConsumerIndexOfThis[e]=t}}}getPending(){if(!(0,t.isWatcher)(this))throw new TypeError("Called getPending without Watcher receiver");return this[W].producerNode.filter(t=>t.dirty).map(t=>t.wrapper)}},e.currentComputed=function(){var t;return null==(t=m)?void 0:t.wrapper},e.watched=Symbol("watched"),e.unwatched=Symbol("unwatched")})(t.subtle||(t.subtle={}))})(j||(j={}));
83
+ function(t){const e=Object.create(j);e.value=t;const s=()=>($(e),e.value);return s[y]=e,s}(o),n=i[y];if(this[V]=n,n.wrapper=this,r){const e=r.equals;e&&(n.equal=e),n.watched=r[t.subtle.watched],n.unwatched=r[t.subtle.unwatched]}}get(){if(!(0,t.isState)(this))throw new TypeError("Wrong receiver type for Signal.State.prototype.get");return L.call(this[V])}set(e){if(!(0,t.isState)(this))throw new TypeError("Wrong receiver type for Signal.State.prototype.set");if(v)throw new Error("Writes to signals not permitted during Watcher callback");U(this[V],e)}};o=V,r=new WeakSet,t.isComputed=t=>"object"==typeof t&&d(r,t),t.Computed=class{constructor(e,s){p(this,r),h(this,o);const i=function(t){const e=Object.create(R);e.computation=t;const s=()=>T(e);return s[y]=e,s}(e),n=i[y];if(n.consumerAllowSignalWrites=!0,this[V]=n,n.wrapper=this,s){const e=s.equals;e&&(n.equal=e),n.watched=s[t.subtle.watched],n.unwatched=s[t.subtle.unwatched]}}get(){if(!(0,t.isComputed)(this))throw new TypeError("Wrong receiver type for Signal.Computed.prototype.get");return T(this[V])}},(e=>{var s,o,r,i;e.untrack=function(t){let e,s=null;try{s=b(null),e=t()}finally{b(s)}return e},e.introspectSources=function(e){var s;if(!(0,t.isComputed)(e)&&!(0,t.isWatcher)(e))throw new TypeError("Called introspectSources without a Computed or Watcher argument");return(null==(s=e[V].producerNode)?void 0:s.map(t=>t.wrapper))??[]},e.introspectSinks=function(e){var s;if(!(0,t.isComputed)(e)&&!(0,t.isState)(e))throw new TypeError("Called introspectSinks without a Signal argument");return(null==(s=e[V].liveConsumerNode)?void 0:s.map(t=>t.wrapper))??[]},e.hasSinks=function(e){if(!(0,t.isComputed)(e)&&!(0,t.isState)(e))throw new TypeError("Called hasSinks without a Signal argument");const s=e[V].liveConsumerNode;return!!s&&s.length>0},e.hasSources=function(e){if(!(0,t.isComputed)(e)&&!(0,t.isWatcher)(e))throw new TypeError("Called hasSources without a Computed or Watcher argument");const s=e[V].producerNode;return!!s&&s.length>0};s=V,o=new WeakSet,r=new WeakSet,i=function(e){for(const s of e)if(!(0,t.isComputed)(s)&&!(0,t.isState)(s))throw new TypeError("Called watch/unwatch without a Computed or State argument")},t.isWatcher=t=>d(o,t),e.Watcher=class{constructor(t){p(this,o),p(this,r),h(this,s);let e=Object.create(S);e.wrapper=this,e.consumerMarkedDirty=t,e.consumerIsAlwaysLive=!0,e.consumerAllowSignalWrites=!1,e.producerNode=[],this[V]=e}watch(...e){if(!(0,t.isWatcher)(this))throw new TypeError("Called unwatch without Watcher receiver");u(this,r,i).call(this,e);const s=this[V];s.dirty=!1;const o=b(s);for(const t of e)$(t[V]);b(o)}unwatch(...e){if(!(0,t.isWatcher)(this))throw new TypeError("Called unwatch without Watcher receiver");u(this,r,i).call(this,e);const s=this[V];O(s);for(let t=s.producerNode.length-1;t>=0;t--)if(e.includes(s.producerNode[t].wrapper)){C(s.producerNode[t],s.producerIndexOfThis[t]);const e=s.producerNode.length-1;if(s.producerNode[t]=s.producerNode[e],s.producerIndexOfThis[t]=s.producerIndexOfThis[e],s.producerNode.length--,s.producerIndexOfThis.length--,s.nextProducerIndex--,t<s.producerNode.length){const e=s.producerIndexOfThis[t],o=s.producerNode[t];N(o),o.liveConsumerIndexOfThis[e]=t}}}getPending(){if(!(0,t.isWatcher)(this))throw new TypeError("Called getPending without Watcher receiver");return this[V].producerNode.filter(t=>t.dirty).map(t=>t.wrapper)}},e.currentComputed=function(){var t;return null==(t=m)?void 0:t.wrapper},e.watched=Symbol("watched"),e.unwatched=Symbol("unwatched")})(t.subtle||(t.subtle={}))})(D||(D={}));
84
84
  /**
85
85
  * @license
86
86
  * Copyright 2023 Google LLC
87
87
  * SPDX-License-Identifier: BSD-3-Clause
88
88
  */
89
- let q=!1;const H=new j.subtle.Watcher(()=>{q||(q=!0,queueMicrotask(()=>{q=!1;for(const t of H.getPending())t.get();H.watch()}))}),D=Symbol("SignalWatcherBrand"),B=new FinalizationRegistry(t=>{t.unwatch(...j.subtle.introspectSources(t))}),z=new WeakMap;function F(t){return!0===t[D]?(console.warn("SignalWatcher should not be applied to the same class more than once."),t):class extends t{constructor(){super(...arguments),this._$St=new Map,this._$So=new j.State(0),this._$Si=!1}_$Sl(){var t,e;const s=[],o=[];this._$St.forEach((t,e)=>{((null==t?void 0:t.beforeUpdate)?s:o).push(e)});const r=null===(t=this.h)||void 0===t?void 0:t.getPending().filter(t=>t!==this._$Su&&!this._$St.has(t));s.forEach(t=>t.get()),null===(e=this._$Su)||void 0===e||e.get(),r.forEach(t=>t.get()),o.forEach(t=>t.get())}_$Sv(){this.isUpdatePending||queueMicrotask(()=>{this.isUpdatePending||this._$Sl()})}_$S_(){if(void 0!==this.h)return;this._$Su=new j.Computed(()=>{this._$So.get(),super.performUpdate()});const t=this.h=new j.subtle.Watcher(function(){const t=z.get(this);void 0!==t&&(!1===t._$Si&&(new Set(this.getPending()).has(t._$Su)?t.requestUpdate():t._$Sv()),this.watch())});z.set(t,this),B.register(this,t),t.watch(this._$Su),t.watch(...Array.from(this._$St).map(([t])=>t))}_$Sp(){if(void 0===this.h)return;let t=!1;this.h.unwatch(...j.subtle.introspectSources(this.h).filter(e=>{var s;const o=!0!==(null===(s=this._$St.get(e))||void 0===s?void 0:s.manualDispose);return o&&this._$St.delete(e),t||(t=!o),o})),t||(this._$Su=void 0,this.h=void 0,this._$St.clear())}updateEffect(t,e){var s;this._$S_();const o=new j.Computed(()=>{t()});return this.h.watch(o),this._$St.set(o,e),null!==(s=null==e?void 0:e.beforeUpdate)&&void 0!==s&&s?j.subtle.untrack(()=>o.get()):this.updateComplete.then(()=>j.subtle.untrack(()=>o.get())),()=>{this._$St.delete(o),this.h.unwatch(o),!1===this.isConnected&&this._$Sp()}}performUpdate(){this.isUpdatePending&&(this._$S_(),this._$Si=!0,this._$So.set(this._$So.get()+1),this._$Si=!1,this._$Sl())}connectedCallback(){super.connectedCallback(),this.requestUpdate()}disconnectedCallback(){super.disconnectedCallback(),queueMicrotask(()=>{!1===this.isConnected&&this._$Sp()})}}}
89
+ let H=!1;const W=new D.subtle.Watcher(()=>{H||(H=!0,queueMicrotask(()=>{H=!1;for(const t of W.getPending())t.get();W.watch()}))}),q=Symbol("SignalWatcherBrand"),B=new FinalizationRegistry(t=>{t.unwatch(...D.subtle.introspectSources(t))}),z=new WeakMap;function F(t){return!0===t[q]?(console.warn("SignalWatcher should not be applied to the same class more than once."),t):class extends t{constructor(){super(...arguments),this._$St=new Map,this._$So=new D.State(0),this._$Si=!1}_$Sl(){var t,e;const s=[],o=[];this._$St.forEach((t,e)=>{((null==t?void 0:t.beforeUpdate)?s:o).push(e)});const r=null===(t=this.h)||void 0===t?void 0:t.getPending().filter(t=>t!==this._$Su&&!this._$St.has(t));s.forEach(t=>t.get()),null===(e=this._$Su)||void 0===e||e.get(),r.forEach(t=>t.get()),o.forEach(t=>t.get())}_$Sv(){this.isUpdatePending||queueMicrotask(()=>{this.isUpdatePending||this._$Sl()})}_$S_(){if(void 0!==this.h)return;this._$Su=new D.Computed(()=>{this._$So.get(),super.performUpdate()});const t=this.h=new D.subtle.Watcher(function(){const t=z.get(this);void 0!==t&&(!1===t._$Si&&(new Set(this.getPending()).has(t._$Su)?t.requestUpdate():t._$Sv()),this.watch())});z.set(t,this),B.register(this,t),t.watch(this._$Su),t.watch(...Array.from(this._$St).map(([t])=>t))}_$Sp(){if(void 0===this.h)return;let t=!1;this.h.unwatch(...D.subtle.introspectSources(this.h).filter(e=>{var s;const o=!0!==(null===(s=this._$St.get(e))||void 0===s?void 0:s.manualDispose);return o&&this._$St.delete(e),t||(t=!o),o})),t||(this._$Su=void 0,this.h=void 0,this._$St.clear())}updateEffect(t,e){var s;this._$S_();const o=new D.Computed(()=>{t()});return this.h.watch(o),this._$St.set(o,e),null!==(s=null==e?void 0:e.beforeUpdate)&&void 0!==s&&s?D.subtle.untrack(()=>o.get()):this.updateComplete.then(()=>D.subtle.untrack(()=>o.get())),()=>{this._$St.delete(o),this.h.unwatch(o),!1===this.isConnected&&this._$Sp()}}performUpdate(){this.isUpdatePending&&(this._$S_(),this._$Si=!0,this._$So.set(this._$So.get()+1),this._$Si=!1,this._$Sl())}connectedCallback(){super.connectedCallback(),this.requestUpdate()}disconnectedCallback(){super.disconnectedCallback(),queueMicrotask(()=>{!1===this.isConnected&&this._$Sp()})}}}
90
90
  /**
91
91
  * @license
92
92
  * Copyright 2017 Google LLC
93
93
  * SPDX-License-Identifier: BSD-3-Clause
94
- */const G=globalThis,J=G.trustedTypes,K=J?J.createPolicy("lit-html",{createHTML:t=>t}):void 0,Z="$lit$",X=`lit$${Math.random().toFixed(9).slice(2)}$`,Y="?"+X,Q=`<${Y}>`,tt=document,et=()=>tt.createComment(""),st=t=>null===t||"object"!=typeof t&&"function"!=typeof t,ot=Array.isArray,rt="[ \t\n\f\r]",it=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,nt=/-->/g,ct=/>/g,lt=RegExp(`>|${rt}(?:([^\\s"'>=/]+)(${rt}*=${rt}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),at=/'/g,ht=/"/g,dt=/^(?:script|style|textarea|title)$/i,pt=(t=>(e,...s)=>({_$litType$:t,strings:e,values:s}))(1),ut=Symbol.for("lit-noChange"),ft=Symbol.for("lit-nothing"),mt=new WeakMap,vt=tt.createTreeWalker(tt,129);function gt(t,e){if(!ot(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==K?K.createHTML(e):e}const yt=(t,e)=>{const s=t.length-1,o=[];let r,i=2===e?"<svg>":3===e?"<math>":"",n=it;for(let e=0;e<s;e++){const s=t[e];let c,l,a=-1,h=0;for(;h<s.length&&(n.lastIndex=h,l=n.exec(s),null!==l);)h=n.lastIndex,n===it?"!--"===l[1]?n=nt:void 0!==l[1]?n=ct:void 0!==l[2]?(dt.test(l[2])&&(r=RegExp("</"+l[2],"g")),n=lt):void 0!==l[3]&&(n=lt):n===lt?">"===l[0]?(n=r??it,a=-1):void 0===l[1]?a=-2:(a=n.lastIndex-l[2].length,c=l[1],n=void 0===l[3]?lt:'"'===l[3]?ht:at):n===ht||n===at?n=lt:n===nt||n===ct?n=it:(n=lt,r=void 0);const d=n===lt&&t[e+1].startsWith("/>")?" ":"";i+=n===it?s+Q:a>=0?(o.push(c),s.slice(0,a)+Z+s.slice(a)+X+d):s+X+(-2===a?e:d)}return[gt(t,i+(t[s]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),o]};class bt{constructor({strings:t,_$litType$:e},s){let o;this.parts=[];let r=0,i=0;const n=t.length-1,c=this.parts,[l,a]=yt(t,e);if(this.el=bt.createElement(l,s),vt.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(o=vt.nextNode())&&c.length<n;){if(1===o.nodeType){if(o.hasAttributes())for(const t of o.getAttributeNames())if(t.endsWith(Z)){const e=a[i++],s=o.getAttribute(t).split(X),n=/([.?@])?(.*)/.exec(e);c.push({type:1,index:r,name:n[2],strings:s,ctor:"."===n[1]?Et:"?"===n[1]?At:"@"===n[1]?Ct:_t}),o.removeAttribute(t)}else t.startsWith(X)&&(c.push({type:6,index:r}),o.removeAttribute(t));if(dt.test(o.tagName)){const t=o.textContent.split(X),e=t.length-1;if(e>0){o.textContent=J?J.emptyScript:"";for(let s=0;s<e;s++)o.append(t[s],et()),vt.nextNode(),c.push({type:2,index:++r});o.append(t[e],et())}}}else if(8===o.nodeType)if(o.data===Y)c.push({type:2,index:r});else{let t=-1;for(;-1!==(t=o.data.indexOf(X,t+1));)c.push({type:7,index:r}),t+=X.length-1}r++}}static createElement(t,e){const s=tt.createElement("template");return s.innerHTML=t,s}}function St(t,e,s=t,o){if(e===ut)return e;let r=void 0!==o?s._$Co?.[o]:s._$Cl;const i=st(e)?void 0:e._$litDirective$;return r?.constructor!==i&&(r?._$AO?.(!1),void 0===i?r=void 0:(r=new i(t),r._$AT(t,s,o)),void 0!==o?(s._$Co??=[])[o]=r:s._$Cl=r),void 0!==r&&(e=St(t,r._$AS(t,e.values),r,o)),e}class $t{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:s}=this._$AD,o=(t?.creationScope??tt).importNode(e,!0);vt.currentNode=o;let r=vt.nextNode(),i=0,n=0,c=s[0];for(;void 0!==c;){if(i===c.index){let e;2===c.type?e=new wt(r,r.nextSibling,this,t):1===c.type?e=new c.ctor(r,c.name,c.strings,this,t):6===c.type&&(e=new xt(r,this,t)),this._$AV.push(e),c=s[++n]}i!==c?.index&&(r=vt.nextNode(),i++)}return vt.currentNode=tt,o}p(t){let e=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class wt{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,o){this.type=2,this._$AH=ft,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=o,this._$Cv=o?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=St(this,t,e),st(t)?t===ft||null==t||""===t?(this._$AH!==ft&&this._$AR(),this._$AH=ft):t!==this._$AH&&t!==ut&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>ot(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==ft&&st(this._$AH)?this._$AA.nextSibling.data=t:this.T(tt.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:s}=t,o="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=bt.createElement(gt(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===o)this._$AH.p(e);else{const t=new $t(o,this),s=t.u(this.options);t.p(e),this.T(s),this._$AH=t}}_$AC(t){let e=mt.get(t.strings);return void 0===e&&mt.set(t.strings,e=new bt(t)),e}k(t){ot(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,o=0;for(const r of t)o===e.length?e.push(s=new wt(this.O(et()),this.O(et()),this,this.options)):s=e[o],s._$AI(r),o++;o<e.length&&(this._$AR(s&&s._$AB.nextSibling,o),e.length=o)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class _t{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,o,r){this.type=1,this._$AH=ft,this._$AN=void 0,this.element=t,this.name=e,this._$AM=o,this.options=r,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=ft}_$AI(t,e=this,s,o){const r=this.strings;let i=!1;if(void 0===r)t=St(this,t,e,0),i=!st(t)||t!==this._$AH&&t!==ut,i&&(this._$AH=t);else{const o=t;let n,c;for(t=r[0],n=0;n<r.length-1;n++)c=St(this,o[s+n],e,n),c===ut&&(c=this._$AH[n]),i||=!st(c)||c!==this._$AH[n],c===ft?t=ft:t!==ft&&(t+=(c??"")+r[n+1]),this._$AH[n]=c}i&&!o&&this.j(t)}j(t){t===ft?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Et extends _t{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===ft?void 0:t}}class At extends _t{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==ft)}}class Ct extends _t{constructor(t,e,s,o,r){super(t,e,s,o,r),this.type=5}_$AI(t,e=this){if((t=St(this,t,e,0)??ft)===ut)return;const s=this._$AH,o=t===ft&&s!==ft||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,r=t!==ft&&(s===ft||o);o&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class xt{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){St(this,t)}}const Ot=G.litHtmlPolyfillSupport;Ot?.(bt,wt),(G.litHtmlVersions??=[]).push("3.3.1");
94
+ */const Y=globalThis,G=Y.trustedTypes,J=G?G.createPolicy("lit-html",{createHTML:t=>t}):void 0,K="$lit$",Z=`lit$${Math.random().toFixed(9).slice(2)}$`,X="?"+Z,Q=`<${X}>`,tt=document,et=()=>tt.createComment(""),st=t=>null===t||"object"!=typeof t&&"function"!=typeof t,ot=Array.isArray,rt="[ \t\n\f\r]",it=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,nt=/-->/g,lt=/>/g,ct=RegExp(`>|${rt}(?:([^\\s"'>=/]+)(${rt}*=${rt}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),at=/'/g,ht=/"/g,dt=/^(?:script|style|textarea|title)$/i,pt=(t=>(e,...s)=>({_$litType$:t,strings:e,values:s}))(1),ut=Symbol.for("lit-noChange"),ft=Symbol.for("lit-nothing"),mt=new WeakMap,vt=tt.createTreeWalker(tt,129);function gt(t,e){if(!ot(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==J?J.createHTML(e):e}const yt=(t,e)=>{const s=t.length-1,o=[];let r,i=2===e?"<svg>":3===e?"<math>":"",n=it;for(let e=0;e<s;e++){const s=t[e];let l,c,a=-1,h=0;for(;h<s.length&&(n.lastIndex=h,c=n.exec(s),null!==c);)h=n.lastIndex,n===it?"!--"===c[1]?n=nt:void 0!==c[1]?n=lt:void 0!==c[2]?(dt.test(c[2])&&(r=RegExp("</"+c[2],"g")),n=ct):void 0!==c[3]&&(n=ct):n===ct?">"===c[0]?(n=r??it,a=-1):void 0===c[1]?a=-2:(a=n.lastIndex-c[2].length,l=c[1],n=void 0===c[3]?ct:'"'===c[3]?ht:at):n===ht||n===at?n=ct:n===nt||n===lt?n=it:(n=ct,r=void 0);const d=n===ct&&t[e+1].startsWith("/>")?" ":"";i+=n===it?s+Q:a>=0?(o.push(l),s.slice(0,a)+K+s.slice(a)+Z+d):s+Z+(-2===a?e:d)}return[gt(t,i+(t[s]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),o]};class bt{constructor({strings:t,_$litType$:e},s){let o;this.parts=[];let r=0,i=0;const n=t.length-1,l=this.parts,[c,a]=yt(t,e);if(this.el=bt.createElement(c,s),vt.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(o=vt.nextNode())&&l.length<n;){if(1===o.nodeType){if(o.hasAttributes())for(const t of o.getAttributeNames())if(t.endsWith(K)){const e=a[i++],s=o.getAttribute(t).split(Z),n=/([.?@])?(.*)/.exec(e);l.push({type:1,index:r,name:n[2],strings:s,ctor:"."===n[1]?_t:"?"===n[1]?At:"@"===n[1]?Ct:Et}),o.removeAttribute(t)}else t.startsWith(Z)&&(l.push({type:6,index:r}),o.removeAttribute(t));if(dt.test(o.tagName)){const t=o.textContent.split(Z),e=t.length-1;if(e>0){o.textContent=G?G.emptyScript:"";for(let s=0;s<e;s++)o.append(t[s],et()),vt.nextNode(),l.push({type:2,index:++r});o.append(t[e],et())}}}else if(8===o.nodeType)if(o.data===X)l.push({type:2,index:r});else{let t=-1;for(;-1!==(t=o.data.indexOf(Z,t+1));)l.push({type:7,index:r}),t+=Z.length-1}r++}}static createElement(t,e){const s=tt.createElement("template");return s.innerHTML=t,s}}function St(t,e,s=t,o){if(e===ut)return e;let r=void 0!==o?s._$Co?.[o]:s._$Cl;const i=st(e)?void 0:e._$litDirective$;return r?.constructor!==i&&(r?._$AO?.(!1),void 0===i?r=void 0:(r=new i(t),r._$AT(t,s,o)),void 0!==o?(s._$Co??=[])[o]=r:s._$Cl=r),void 0!==r&&(e=St(t,r._$AS(t,e.values),r,o)),e}class $t{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:s}=this._$AD,o=(t?.creationScope??tt).importNode(e,!0);vt.currentNode=o;let r=vt.nextNode(),i=0,n=0,l=s[0];for(;void 0!==l;){if(i===l.index){let e;2===l.type?e=new wt(r,r.nextSibling,this,t):1===l.type?e=new l.ctor(r,l.name,l.strings,this,t):6===l.type&&(e=new xt(r,this,t)),this._$AV.push(e),l=s[++n]}i!==l?.index&&(r=vt.nextNode(),i++)}return vt.currentNode=tt,o}p(t){let e=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class wt{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,o){this.type=2,this._$AH=ft,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=o,this._$Cv=o?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=St(this,t,e),st(t)?t===ft||null==t||""===t?(this._$AH!==ft&&this._$AR(),this._$AH=ft):t!==this._$AH&&t!==ut&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>ot(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==ft&&st(this._$AH)?this._$AA.nextSibling.data=t:this.T(tt.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:s}=t,o="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=bt.createElement(gt(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===o)this._$AH.p(e);else{const t=new $t(o,this),s=t.u(this.options);t.p(e),this.T(s),this._$AH=t}}_$AC(t){let e=mt.get(t.strings);return void 0===e&&mt.set(t.strings,e=new bt(t)),e}k(t){ot(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,o=0;for(const r of t)o===e.length?e.push(s=new wt(this.O(et()),this.O(et()),this,this.options)):s=e[o],s._$AI(r),o++;o<e.length&&(this._$AR(s&&s._$AB.nextSibling,o),e.length=o)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class Et{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,o,r){this.type=1,this._$AH=ft,this._$AN=void 0,this.element=t,this.name=e,this._$AM=o,this.options=r,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=ft}_$AI(t,e=this,s,o){const r=this.strings;let i=!1;if(void 0===r)t=St(this,t,e,0),i=!st(t)||t!==this._$AH&&t!==ut,i&&(this._$AH=t);else{const o=t;let n,l;for(t=r[0],n=0;n<r.length-1;n++)l=St(this,o[s+n],e,n),l===ut&&(l=this._$AH[n]),i||=!st(l)||l!==this._$AH[n],l===ft?t=ft:t!==ft&&(t+=(l??"")+r[n+1]),this._$AH[n]=l}i&&!o&&this.j(t)}j(t){t===ft?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class _t extends Et{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===ft?void 0:t}}class At extends Et{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==ft)}}class Ct extends Et{constructor(t,e,s,o,r){super(t,e,s,o,r),this.type=5}_$AI(t,e=this){if((t=St(this,t,e,0)??ft)===ut)return;const s=this._$AH,o=t===ft&&s!==ft||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,r=t!==ft&&(s===ft||o);o&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class xt{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){St(this,t)}}const Ot=Y.litHtmlPolyfillSupport;Ot?.(bt,wt),(Y.litHtmlVersions??=[]).push("3.3.1");
95
95
  /**
96
96
  * @license
97
97
  * Copyright 2023 Google LLC
98
98
  * SPDX-License-Identifier: BSD-3-Clause
99
99
  */
100
- let Nt=!1;const kt=new j.subtle.Watcher(async()=>{Nt||(Nt=!0,queueMicrotask(()=>{Nt=!1;for(const t of kt.getPending())t.get();kt.watch()}))});
100
+ let Nt=!1;const Tt=new D.subtle.Watcher(async()=>{Nt||(Nt=!0,queueMicrotask(()=>{Nt=!1;for(const t of Tt.getPending())t.get();Tt.watch()}))});
101
101
  /**
102
102
  * @license
103
103
  * Copyright 2023 Google LLC
104
104
  * SPDX-License-Identifier: BSD-3-Clause
105
- */j.State,j.Computed;const Tt=(t,e)=>new j.State(t,e),Pt=globalThis,Rt=Pt.ShadowRoot&&(void 0===Pt.ShadyCSS||Pt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,It=Symbol(),Mt=new WeakMap;
105
+ */D.State,D.Computed;const kt=(t,e)=>new D.State(t,e),Pt=globalThis,It=Pt.ShadowRoot&&(void 0===Pt.ShadyCSS||Pt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Rt=Symbol(),Mt=new WeakMap;
106
106
  /**
107
107
  * @license
108
108
  * Copyright 2019 Google LLC
109
109
  * SPDX-License-Identifier: BSD-3-Clause
110
- */let Lt=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==It)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(Rt&&void 0===t){const s=void 0!==e&&1===e.length;s&&(t=Mt.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Mt.set(e,t))}return t}toString(){return this.cssText}};const Ut=(t,...e)=>{const s=1===t.length?t[0]:e.reduce((e,s,o)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[o+1],t[0]);return new Lt(s,t,It)},Vt=Rt?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return(t=>new Lt("string"==typeof t?t:t+"",void 0,It))(e)})(t):t,{is:Wt,defineProperty:jt,getOwnPropertyDescriptor:qt,getOwnPropertyNames:Ht,getOwnPropertySymbols:Dt,getPrototypeOf:Bt}=Object,zt=globalThis,Ft=zt.trustedTypes,Gt=Ft?Ft.emptyScript:"",Jt=zt.reactiveElementPolyfillSupport,Kt=(t,e)=>t,Zt={toAttribute(t,e){switch(e){case Boolean:t=t?Gt:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(t){s=null}}return s}},Xt=(t,e)=>!Wt(t,e),Yt={attribute:!0,type:String,converter:Zt,reflect:!1,useDefault:!1,hasChanged:Xt};
110
+ */let Lt=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==Rt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(It&&void 0===t){const s=void 0!==e&&1===e.length;s&&(t=Mt.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Mt.set(e,t))}return t}toString(){return this.cssText}};const Ut=(t,...e)=>{const s=1===t.length?t[0]:e.reduce((e,s,o)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[o+1],t[0]);return new Lt(s,t,Rt)},jt=It?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return(t=>new Lt("string"==typeof t?t:t+"",void 0,Rt))(e)})(t):t,{is:Vt,defineProperty:Dt,getOwnPropertyDescriptor:Ht,getOwnPropertyNames:Wt,getOwnPropertySymbols:qt,getPrototypeOf:Bt}=Object,zt=globalThis,Ft=zt.trustedTypes,Yt=Ft?Ft.emptyScript:"",Gt=zt.reactiveElementPolyfillSupport,Jt=(t,e)=>t,Kt={toAttribute(t,e){switch(e){case Boolean:t=t?Yt:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(t){s=null}}return s}},Zt=(t,e)=>!Vt(t,e),Xt={attribute:!0,type:String,converter:Kt,reflect:!1,useDefault:!1,hasChanged:Zt};
111
111
  /**
112
112
  * @license
113
113
  * Copyright 2017 Google LLC
114
114
  * SPDX-License-Identifier: BSD-3-Clause
115
- */Symbol.metadata??=Symbol("metadata"),zt.litPropertyMetadata??=new WeakMap;class Qt extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Yt){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),o=this.getPropertyDescriptor(t,s,e);void 0!==o&&jt(this.prototype,t,o)}}static getPropertyDescriptor(t,e,s){const{get:o,set:r}=qt(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:o,set(e){const i=o?.call(this);r?.call(this,e),this.requestUpdate(t,i,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Yt}static _$Ei(){if(this.hasOwnProperty(Kt("elementProperties")))return;const t=Bt(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(Kt("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Kt("properties"))){const t=this.properties,e=[...Ht(t),...Dt(t)];for(const s of e)this.createProperty(s,t[s])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,s]of e)this.elementProperties.set(t,s)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const s=this._$Eu(t,e);void 0!==s&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)e.unshift(Vt(t))}else void 0!==t&&e.push(Vt(t));return e}static _$Eu(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(Rt)t.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const s of e){const e=document.createElement("style"),o=Pt.litNonce;void 0!==o&&e.setAttribute("nonce",o),e.textContent=s.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){const s=this.constructor.elementProperties.get(t),o=this.constructor._$Eu(t,s);if(void 0!==o&&!0===s.reflect){const r=(void 0!==s.converter?.toAttribute?s.converter:Zt).toAttribute(e,s.type);this._$Em=t,null==r?this.removeAttribute(o):this.setAttribute(o,r),this._$Em=null}}_$AK(t,e){const s=this.constructor,o=s._$Eh.get(t);if(void 0!==o&&this._$Em!==o){const t=s.getPropertyOptions(o),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:Zt;this._$Em=o;const i=r.fromAttribute(e,t.type);this[o]=i??this._$Ej?.get(o)??i,this._$Em=null}}requestUpdate(t,e,s){if(void 0!==t){const o=this.constructor,r=this[t];if(s??=o.getPropertyOptions(t),!((s.hasChanged??Xt)(r,e)||s.useDefault&&s.reflect&&r===this._$Ej?.get(t)&&!this.hasAttribute(o._$Eu(t,s))))return;this.C(t,e,s)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:o,wrapped:r},i){s&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,i??e??this[t]),!0!==r||void 0!==i)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),!0===o&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,s]of t){const{wrapped:t}=s,o=this[e];!0!==t||this._$AL.has(e)||void 0===o||this.C(e,void 0,s,o)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(t){}firstUpdated(t){}}Qt.elementStyles=[],Qt.shadowRootOptions={mode:"open"},Qt[Kt("elementProperties")]=new Map,Qt[Kt("finalized")]=new Map,Jt?.({ReactiveElement:Qt}),(zt.reactiveElementVersions??=[]).push("2.1.1");
115
+ */Symbol.metadata??=Symbol("metadata"),zt.litPropertyMetadata??=new WeakMap;class Qt extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Xt){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),o=this.getPropertyDescriptor(t,s,e);void 0!==o&&Dt(this.prototype,t,o)}}static getPropertyDescriptor(t,e,s){const{get:o,set:r}=Ht(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:o,set(e){const i=o?.call(this);r?.call(this,e),this.requestUpdate(t,i,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Xt}static _$Ei(){if(this.hasOwnProperty(Jt("elementProperties")))return;const t=Bt(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(Jt("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Jt("properties"))){const t=this.properties,e=[...Wt(t),...qt(t)];for(const s of e)this.createProperty(s,t[s])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,s]of e)this.elementProperties.set(t,s)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const s=this._$Eu(t,e);void 0!==s&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)e.unshift(jt(t))}else void 0!==t&&e.push(jt(t));return e}static _$Eu(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(It)t.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const s of e){const e=document.createElement("style"),o=Pt.litNonce;void 0!==o&&e.setAttribute("nonce",o),e.textContent=s.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){const s=this.constructor.elementProperties.get(t),o=this.constructor._$Eu(t,s);if(void 0!==o&&!0===s.reflect){const r=(void 0!==s.converter?.toAttribute?s.converter:Kt).toAttribute(e,s.type);this._$Em=t,null==r?this.removeAttribute(o):this.setAttribute(o,r),this._$Em=null}}_$AK(t,e){const s=this.constructor,o=s._$Eh.get(t);if(void 0!==o&&this._$Em!==o){const t=s.getPropertyOptions(o),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:Kt;this._$Em=o;const i=r.fromAttribute(e,t.type);this[o]=i??this._$Ej?.get(o)??i,this._$Em=null}}requestUpdate(t,e,s){if(void 0!==t){const o=this.constructor,r=this[t];if(s??=o.getPropertyOptions(t),!((s.hasChanged??Zt)(r,e)||s.useDefault&&s.reflect&&r===this._$Ej?.get(t)&&!this.hasAttribute(o._$Eu(t,s))))return;this.C(t,e,s)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:o,wrapped:r},i){s&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,i??e??this[t]),!0!==r||void 0!==i)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),!0===o&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,s]of t){const{wrapped:t}=s,o=this[e];!0!==t||this._$AL.has(e)||void 0===o||this.C(e,void 0,s,o)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(t){}firstUpdated(t){}}Qt.elementStyles=[],Qt.shadowRootOptions={mode:"open"},Qt[Jt("elementProperties")]=new Map,Qt[Jt("finalized")]=new Map,Gt?.({ReactiveElement:Qt}),(zt.reactiveElementVersions??=[]).push("2.1.1");
116
116
  /**
117
117
  * @license
118
118
  * Copyright 2017 Google LLC
@@ -124,7 +124,7 @@ const te=globalThis;class ee extends Qt{constructor(){super(...arguments),this.r
124
124
  * Copyright 2017 Google LLC
125
125
  * SPDX-License-Identifier: BSD-3-Clause
126
126
  */
127
- const oe=t=>(e,s)=>{void 0!==s?s.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)},re={attribute:!0,type:String,converter:Zt,reflect:!1,hasChanged:Xt},ie=(t=re,e,s)=>{const{kind:o,metadata:r}=s;let i=globalThis.litPropertyMetadata.get(r);if(void 0===i&&globalThis.litPropertyMetadata.set(r,i=new Map),"setter"===o&&((t=Object.create(t)).wrapped=!0),i.set(s.name,t),"accessor"===o){const{name:o}=s;return{set(s){const r=e.get.call(this);e.set.call(this,s),this.requestUpdate(o,r,t)},init(e){return void 0!==e&&this.C(o,void 0,t,e),e}}}if("setter"===o){const{name:o}=s;return function(s){const r=this[o];e.call(this,s),this.requestUpdate(o,r,t)}}throw Error("Unsupported decorator location: "+o)};
127
+ const oe=t=>(e,s)=>{void 0!==s?s.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)},re={attribute:!0,type:String,converter:Kt,reflect:!1,hasChanged:Zt},ie=(t=re,e,s)=>{const{kind:o,metadata:r}=s;let i=globalThis.litPropertyMetadata.get(r);if(void 0===i&&globalThis.litPropertyMetadata.set(r,i=new Map),"setter"===o&&((t=Object.create(t)).wrapped=!0),i.set(s.name,t),"accessor"===o){const{name:o}=s;return{set(s){const r=e.get.call(this);e.set.call(this,s),this.requestUpdate(o,r,t)},init(e){return void 0!==e&&this.C(o,void 0,t,e),e}}}if("setter"===o){const{name:o}=s;return function(s){const r=this[o];e.call(this,s),this.requestUpdate(o,r,t)}}throw Error("Unsupported decorator location: "+o)};
128
128
  /**
129
129
  * @license
130
130
  * Copyright 2017 Google LLC
@@ -134,7 +134,7 @@ const oe=t=>(e,s)=>{void 0!==s?s.addInitializer(()=>{customElements.define(t,e)}
134
134
  * @license
135
135
  * Copyright 2017 Google LLC
136
136
  * SPDX-License-Identifier: BSD-3-Clause
137
- */function ce(t){return ne({...t,state:!0,attribute:!1})}function le(){}const ae=Symbol("tp-select");class he{#t;#e;#s=!1;constructor(t,e={}){const{attributes:s=!0,childList:o=!0,characterData:r=!0}=e;this.#t=t,this.clone=t.cloneNode(!0),this.#e=new MutationObserver(t=>this.#o(t)),this.#e.observe(t,{attributes:s,childList:o,characterData:r,subtree:!0})}disconnect(){this.#s||(this.#s=!0,this.#e.disconnect())}#o(t){for(const e of t){const t=this.#r(e.target);if(!t)continue;const s=this.#i(t);if(s)switch(e.type){case"attributes":this.#n(e,s);break;case"characterData":s.nodeValue=e.target.nodeValue;break;case"childList":this.#c(e.target,s)}}}#n(t,e){const s=t.attributeName;if(!s)return;const o=t.attributeNamespace??null,r=t.target,i=o?r.getAttributeNS(o,s):r.getAttribute(s);null===i?o?e.removeAttributeNS(o,s):e.removeAttribute(s):o?e.setAttributeNS(o,s,i):e.setAttribute(s,i)}#c(t,e){for(;e.firstChild;)e.removeChild(e.firstChild);for(const s of Array.from(t.childNodes))e.appendChild(s.cloneNode(!0))}#r(t){if(t===this.#t)return[];const e=[];let s=t;for(;s&&s!==this.#t;){const t=s.parentNode;if(!t)return null;e.push(Array.prototype.indexOf.call(t.childNodes,s)),s=t}return s===this.#t?e.reverse():null}#i(t){let e=this.clone;for(const s of t){const t=e.childNodes[s];if(!t)return null;e=t}return e}}class de extends ee{constructor(){super(...arguments),this.color="contrast",this.shade=500,this.mixer="none"}static{this.rootStyles=(()=>{const t=Ut`
137
+ */function le(t){return ne({...t,state:!0,attribute:!1})}function ce(){}class ae extends Promise{static#t=ce;static#e=ce;#s=!1;#o=!1;#r=ce;#i=ce;get resolved(){return this.#s}get rejected(){return this.#o}get finished(){return this.#s||this.#o}constructor(t=ce){super((e,s)=>{ae.#t=e,ae.#e=s,t(e,s)}),this.#r=ae.#t,this.#i=ae.#e,ae.#t=ce,ae.#e=ce}resolve(...t){if(this.finished)throw new Error("Promise is already finished");this.#s=!0,this.#r(...t)}reject(...t){if(this.finished)throw new Error("Promise is already finished");this.#o=!0,this.#i(...t)}bindTo(t){t.then(t=>{this.resolve(t)}).catch(t=>this.reject(t))}}const he=function(){const t=new WeakMap,e=new Map,s=(s,o,r)=>{const i=new ae,n=setTimeout(()=>{i.resolve(o)},s),l={openPromise:i,id:n};return t.set(i,l),r&&e.set(r,l),i};return Object.defineProperties(s,{FINISHED_ALREADY:{writable:!1,value:Symbol("Timeout finished already")},IDENTIFIER_NOT_FOUND:{writable:!1,value:Symbol("Timeout not found via identifier")},TIMEOUT_CANCELLED:{writable:!1,value:Symbol("Timeout cancelled")}}),s.cancel=async(o,r)=>{const{FINISHED_ALREADY:i,IDENTIFIER_NOT_FOUND:n,TIMEOUT_CANCELLED:l}=s;let c;if(void 0===r&&(r=l),c="symbol"==typeof o?e.get(o):t.get(o),!c)throw n;if(c.openPromise.finished)throw i;clearTimeout(c.id),c.openPromise.reject(r),"symbol"==typeof o&&e.delete(o)},s}();const de=new Map;function pe(t,e,s=180,o=null,...r){let i,n;if(de.has(t)){const e=de.get(t);i=e.timeout,n=e.promise,he.cancel(i)}else n=new ae;return i=he(s),de.set(t,{promise:n,timeout:i}),i.then(()=>{de.delete(t);const s=e.call(o,...r);return n.bindTo(async function(t){return await t}(s)),s}).catch(t=>{t!==he.TIMEOUT_CANCELLED&&n.reject(t)}),n}const ue=Symbol("tp-select");class fe{#n;#l;#c=!1;constructor(t,e={}){const{attributes:s=!0,childList:o=!0,characterData:r=!0}=e;this.#n=t,this.clone=t.cloneNode(!0),this.#l=new MutationObserver(t=>this.#a(t)),this.#l.observe(t,{attributes:s,childList:o,characterData:r,subtree:!0})}disconnect(){this.#c||(this.#c=!0,this.#l.disconnect())}#a(t){for(const e of t){const t=this.#h(e.target);if(!t)continue;const s=this.#d(t);if(s)switch(e.type){case"attributes":this.#p(e,s);break;case"characterData":s.nodeValue=e.target.nodeValue;break;case"childList":this.#u(e.target,s)}}}#p(t,e){const s=t.attributeName;if(!s)return;const o=t.attributeNamespace??null,r=t.target,i=o?r.getAttributeNS(o,s):r.getAttribute(s);null===i?o?e.removeAttributeNS(o,s):e.removeAttribute(s):o?e.setAttributeNS(o,s,i):e.setAttribute(s,i)}#u(t,e){for(;e.firstChild;)e.removeChild(e.firstChild);for(const s of Array.from(t.childNodes))e.appendChild(s.cloneNode(!0))}#h(t){if(t===this.#n)return[];const e=[];let s=t;for(;s&&s!==this.#n;){const t=s.parentNode;if(!t)return null;e.push(Array.prototype.indexOf.call(t.childNodes,s)),s=t}return s===this.#n?e.reverse():null}#d(t){let e=this.clone;for(const s of t){const t=e.childNodes[s];if(!t)return null;e=t}return e}}class me extends ee{constructor(){super(...arguments),this.color="contrast",this.shade=500,this.mixer="none"}static{this.rootStyles=(()=>{const t=Ut`
138
138
  @layer properties {
139
139
  :root {
140
140
  --tp-color-white: hsl(0 0% 100%);
@@ -178,7 +178,7 @@ const oe=t=>(e,s)=>{void 0!==s?s.addInitializer(()=>{customElements.define(t,e)}
178
178
  &[color="danger"] { --tp-element-color: var(--tp-color-danger); }
179
179
  &[color="warning"] { --tp-element-color: var(--tp-color-warning); }
180
180
  &[color="neutral"] { --tp-element-color: var(--tp-color-neutral); }
181
- `}willUpdate(t){t.has("shade")&&(this.mixer=500===this.shade?"none":this.shade>500?"black":"white")}}e([ne({type:String,reflect:!0}),s("design:type",String)],de.prototype,"color",void 0),e([ne({type:Number,reflect:!0,converter(t,e){const s=Number(t);return isNaN(s)?500:function(t,e,s){return Math.max(Math.min(e,s),t)}(0,1e3,s)}}),s("design:type",Number)],de.prototype,"shade",void 0),e([ne({type:String,reflect:!0}),s("design:type",String)],de.prototype,"mixer",void 0);const pe=F(ee),ue=F(de),fe=Symbol("select:register-option"),me=Symbol("select:unregister-option"),ve=Symbol("option:should-register-to-select");var ge;t.SelectedContentElement=class extends pe{static{this.styles=(()=>{const t=Ut`
181
+ `}willUpdate(t){t.has("shade")&&(this.mixer=500===this.shade?"none":this.shade>500?"black":"white")}}e([ne({type:String,reflect:!0}),s("design:type",String)],me.prototype,"color",void 0),e([ne({type:Number,reflect:!0,converter(t,e){const s=Number(t);return isNaN(s)?500:function(t,e,s){return Math.max(Math.min(e,s),t)}(0,1e3,s)}}),s("design:type",Number)],me.prototype,"shade",void 0),e([ne({type:String,reflect:!0}),s("design:type",String)],me.prototype,"mixer",void 0);const ve=F(ee),ge=F(me),ye=Symbol("select:register-option"),be=Symbol("select:unregister-option"),Se=Symbol("option:should-register-to-select");var $e;t.SelectedContentElement=class extends ve{static{this.styles=(()=>{const t=Ut`
182
182
  tp-selected-content {
183
183
  display: inline-block;
184
184
 
@@ -192,7 +192,7 @@ const oe=t=>(e,s)=>{void 0!==s?s.addInitializer(()=>{customElements.define(t,e)}
192
192
  }
193
193
  }
194
194
  }
195
- `;return document.adoptedStyleSheets=[...document.adoptedStyleSheets,t.styleSheet],t})()}#l=new WeakMap;createRenderRoot(){return this}render(){const t=this.select?.placeholder??"",e=this.select?.selectedOptions.get().map(t=>t.deref()).filter(Boolean)??[],s=this.#a(e);return e.length?s.map(t=>pt`${t}`):pt`<slot name="placeholder"><span part="placeholder">${t}</span></slot>`}#a(t){return t.map(t=>{let e=this.#l.get(t);return e||(e=new he(t),this.#l.set(t,e),e.clone.setAttribute("part","selected-content-option"),e.clone[ve]=!1),e.clone})}},e([l({context:ae,subscribe:!0}),ce(),s("design:type",Function)],t.SelectedContentElement.prototype,"select",void 0),t.SelectedContentElement=e([oe("tp-selected-content")],t.SelectedContentElement),t.OptionElement=class extends pe{constructor(){super(...arguments),this[ge]=!0,this.value=""}static{ge=ve}static{this.styles=(()=>{const t=Ut`
195
+ `;return document.adoptedStyleSheets=[...document.adoptedStyleSheets,t.styleSheet],t})()}#f=new WeakMap;createRenderRoot(){return this}render(){const t=this.select?.placeholder??"",e=this.select?.selectedOptions.get().map(t=>t.deref()).filter(Boolean)??[],s=this.#m(e);return e.length?s.map(t=>pt`${t}`):pt`<slot name="placeholder"><span part="placeholder">${t}</span></slot>`}#m(t){return t.map(t=>{let e=this.#f.get(t);return e||(e=new fe(t),this.#f.set(t,e),e.clone.setAttribute("part","selected-content-option"),e.clone[Se]=!1),e.clone})}},e([c({context:ue,subscribe:!0}),le(),s("design:type",Function)],t.SelectedContentElement.prototype,"select",void 0),t.SelectedContentElement=e([oe("tp-selected-content")],t.SelectedContentElement),t.OptionElement=class extends ve{constructor(){super(...arguments),this[$e]=!0,this.value=""}static{$e=Se}static{this.styles=(()=>{const t=Ut`
196
196
  tp-option:not([part="selected-content-option"]) {
197
197
  display: block;
198
198
  cursor: pointer;
@@ -211,7 +211,7 @@ const oe=t=>(e,s)=>{void 0!==s?s.addInitializer(()=>{customElements.define(t,e)}
211
211
  }
212
212
  }
213
213
  }
214
- `;return document.adoptedStyleSheets=[...document.adoptedStyleSheets,t.styleSheet],t})()}connectedCallback(){super.connectedCallback(),this[ve]&&this.select?.[fe](this)}disconnectedCallback(){super.disconnectedCallback(),this[ve]&&this.select?.[me](this)}willUpdate(t){if(!this[ve])return;const e=this.select?.selectedOptions.get().some(t=>t.deref()===this)??!1;this.toggleAttribute("selected",e)}createRenderRoot(){return this}render(){return pt``}},e([l({context:ae,subscribe:!0}),ce(),s("design:type",Function)],t.OptionElement.prototype,"select",void 0),e([ne({type:String,reflect:!0}),s("design:type",Object)],t.OptionElement.prototype,"value",void 0),t.OptionElement=e([oe("tp-option")],t.OptionElement);class ye extends Event{constructor(t,e){super("change",{bubbles:!0,composed:!1,cancelable:!1,...e}),this.value=t.value,this.selectedOptions=t.selectedOptions}}const be={};const Se={popInline:"center",targetInline:"center",popBlock:"bottom",targetBlock:"top"},$e=new Set(["start","center","end"]),we=new Set(["top","middle","bottom"]),_e={start:["end","start"],center:["center","center"],end:["start","end"]},Ee={top:["bottom","top"],middle:["middle","middle"],bottom:["top","bottom"]};function Ae(t){const e=t.trim().split(/\s+to\s+/);if(1===e.length){const t=e[0];return $e.has(t)?_e[t]:null}return 2===e.length&&$e.has(e[0])&&$e.has(e[1])?[e[0],e[1]]:null}function Ce(t){const e=t.trim().split(/\s+to\s+/);if(1===e.length){const t=e[0];return we.has(t)?Ee[t]:null}return 2===e.length&&we.has(e[0])&&we.has(e[1])?[e[0],e[1]]:null}let xe=class extends ee{constructor(){var t;super(...arguments),this.mode="auto",this.target=null,this.position=null,this.trigger="click",this.#h=((t="tp-popover")in be||(be[t]=function*(t){let e=0;for(;;)yield`${t}-${e++}`}(t)),be[t].next().value),this.#d=null,this.#p=!1,this.#u=[]}static{this.styles=(()=>{const t=Ut`
214
+ `;return document.adoptedStyleSheets=[...document.adoptedStyleSheets,t.styleSheet],t})()}connectedCallback(){super.connectedCallback(),this[Se]&&this.select?.[ye](this)}disconnectedCallback(){super.disconnectedCallback(),this[Se]&&this.select?.[be](this)}willUpdate(t){if(!this[Se])return;const e=this.select?.selectedOptions.get().some(t=>t.deref()===this)??!1;this.toggleAttribute("selected",e)}createRenderRoot(){return this}render(){return pt``}},e([c({context:ue,subscribe:!0}),le(),s("design:type",Function)],t.OptionElement.prototype,"select",void 0),e([ne({type:String,reflect:!0}),s("design:type",Object)],t.OptionElement.prototype,"value",void 0),t.OptionElement=e([oe("tp-option")],t.OptionElement);class we extends Event{constructor(t,e){super("change",{bubbles:!0,composed:!1,cancelable:!1,...e}),this.value=t.value,this.selectedOptions=t.selectedOptions}}const Ee={};const _e={popInline:"center",targetInline:"center",popBlock:"bottom",targetBlock:"top"},Ae=new Set(["start","center","end"]),Ce=new Set(["top","middle","bottom"]),xe={start:["end","start"],center:["center","center"],end:["start","end"]},Oe={top:["bottom","top"],middle:["middle","middle"],bottom:["top","bottom"]};function Ne(t){const e=t.trim().split(/\s+to\s+/);if(1===e.length){const t=e[0];return Ae.has(t)?xe[t]:null}return 2===e.length&&Ae.has(e[0])&&Ae.has(e[1])?[e[0],e[1]]:null}function Te(t){const e=t.trim().split(/\s+to\s+/);if(1===e.length){const t=e[0];return Ce.has(t)?Oe[t]:null}return 2===e.length&&Ce.has(e[0])&&Ce.has(e[1])?[e[0],e[1]]:null}let ke=class extends ee{constructor(){var t;super(...arguments),this.mode="auto",this.target=null,this.position=null,this.trigger="click",this.#v=((t="tp-popover")in Ee||(Ee[t]=function*(t){let e=0;for(;;)yield`${t}-${e++}`}(t)),Ee[t].next().value),this.#g=null,this.#y=!1,this.#b=[]}static{this.styles=(()=>{const t=Ut`
215
215
  tp-popover {
216
216
  --tp-popover-inline-position: attr(data-ti type(*));
217
217
  --tp-popover-block-position: attr(data-tb type(*));
@@ -249,8 +249,8 @@ const oe=t=>(e,s)=>{void 0!==s?s.addInitializer(()=>{customElements.define(t,e)}
249
249
  inset-block-end: anchor(var(--tp-popover-block-position));
250
250
  }
251
251
  }
252
- `;return document.adoptedStyleSheets=[...document.adoptedStyleSheets,t.styleSheet],t})()}#h;#d;get anchorElement(){return this.#d}get anchorName(){return`--${this.#h}`}#p;#u;createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.#f(),this.#m(),this.#v(),this.#g()}disconnectedCallback(){super.disconnectedCallback(),this.#y(),this.#b()}updated(t){t.has("mode")&&this.#f(),t.has("target")&&(this.#m(),this.#g()),t.has("position")&&this.#v(),t.has("trigger")&&this.#g()}render(){return pt``}#f(){const t="manual"===this.mode?"manual":"auto";this.getAttribute("popover")!==t&&this.setAttribute("popover",t)}#S(){const t=this.target;if(t)try{const e=this.getRootNode().querySelector(t);if(e instanceof HTMLElement)return e;console.warn(`<tp-popover>: target "${t}" did not resolve to an HTMLElement; using parentElement.`)}catch{console.warn(`<tp-popover>: invalid target selector "${t}"; using parentElement.`)}const e=this.parentElement;if(e instanceof HTMLElement)return e;const s=this.getRootNode();return s instanceof ShadowRoot&&s.host instanceof HTMLElement?s.host:null}#m(){const t=this.#S();t!==this.#d?(this.#b(),this.#d=t,t&&this.#$(t)):t&&this.#$(t)}#$(t){const e=`--${this.#h}`,s=t.style.getPropertyValue("anchor-name").trim();if(s&&s!==e)return this.style.setProperty("position-anchor",s),void(this.#p=!1);t.style.setProperty("anchor-name",e),this.style.setProperty("position-anchor",e),this.#p=!0}#b(){if(this.#d&&this.#p){const t=`--${this.#h}`;this.#d.style.getPropertyValue("anchor-name").trim()===t&&this.#d.style.removeProperty("anchor-name")}this.#d=null,this.#p=!1,this.style.removeProperty("position-anchor")}#v(){let t=function(t){if(!t)return null;const e=t.trim().toLowerCase();if(!e)return null;if(!e.includes("/")){const t=Ae(e);if(t){const[e,s]=Ee.middle;return{popInline:t[0],targetInline:t[1],popBlock:e,targetBlock:s}}const s=Ce(e);if(s){const[t,e]=_e.center;return{popInline:t,targetInline:e,popBlock:s[0],targetBlock:s[1]}}return null}const s=e.split("/");if(2!==s.length)return null;const o=Ae(s[0]),r=Ce(s[1]);return o&&r?{popInline:o[0],targetInline:o[1],popBlock:r[0],targetBlock:r[1]}:null}(this.position);this.position&&!t&&console.warn(`<tp-popover>: invalid position "${this.position}"; using default.`),t??=Se,this.dataset.pi=t.popInline,this.dataset.ti=t.targetInline,this.dataset.pb=t.popBlock,this.dataset.tb=t.targetBlock}#y(){for(const t of this.#u)t();this.#u=[]}#g(){this.#y();const t=this.#d;if(t){if("click"===this.trigger){const e=t=>{if(!t.composedPath().includes(this))try{this.togglePopover()}catch{}};return t.addEventListener("click",e),void this.#u.push(()=>t.removeEventListener("click",e))}if("hover"===this.trigger){let e=null;const s=()=>{null!==e&&(clearTimeout(e),e=null)},o=()=>{s();try{this.showPopover()}catch{}},r=()=>{s(),e=setTimeout(()=>{try{this.hidePopover()}catch{}},120)};t.addEventListener("pointerenter",o),t.addEventListener("pointerleave",r),t.addEventListener("focusin",o),t.addEventListener("focusout",r),this.addEventListener("pointerenter",s),this.addEventListener("pointerleave",r),this.addEventListener("focusin",s),this.addEventListener("focusout",r),this.#u.push(()=>{s(),t.removeEventListener("pointerenter",o),t.removeEventListener("pointerleave",r),t.removeEventListener("focusin",o),t.removeEventListener("focusout",r),this.removeEventListener("pointerenter",s),this.removeEventListener("pointerleave",r),this.removeEventListener("focusin",s),this.removeEventListener("focusout",r)})}}}};var Oe;e([ne({reflect:!0}),s("design:type",String)],xe.prototype,"mode",void 0),e([ne({reflect:!0}),s("design:type",Object)],xe.prototype,"target",void 0),e([ne({reflect:!0}),s("design:type",Object)],xe.prototype,"position",void 0),e([ne({reflect:!0}),s("design:type",String)],xe.prototype,"trigger",void 0),xe=e([oe("tp-popover")],xe),t.SelectElement=class extends ue{static{Oe=this}static{this.formAssociated=!0}static{this.ALLOWED_OPTION_ELEMENTS=[t.OptionElement]}static{this.styles=(()=>{const t=Ut`
253
- ${de.shadedElementStyles}
252
+ `;return document.adoptedStyleSheets=[...document.adoptedStyleSheets,t.styleSheet],t})()}#v;#g;get anchorElement(){return this.#g}get anchorName(){return`--${this.#v}`}#y;#b;createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.#S(),this.#$(),this.#w(),this.#E()}disconnectedCallback(){super.disconnectedCallback(),this.#_(),this.#A()}updated(t){t.has("mode")&&this.#S(),t.has("target")&&(this.#$(),this.#E()),t.has("position")&&this.#w(),t.has("trigger")&&this.#E()}render(){return pt``}#S(){const t="manual"===this.mode?"manual":"auto";this.getAttribute("popover")!==t&&this.setAttribute("popover",t)}#C(){const t=this.target;if(t)try{const e=this.getRootNode().querySelector(t);if(e instanceof HTMLElement)return e;console.warn(`<tp-popover>: target "${t}" did not resolve to an HTMLElement; using parentElement.`)}catch{console.warn(`<tp-popover>: invalid target selector "${t}"; using parentElement.`)}const e=this.parentElement;if(e instanceof HTMLElement)return e;const s=this.getRootNode();return s instanceof ShadowRoot&&s.host instanceof HTMLElement?s.host:null}#$(){const t=this.#C();t!==this.#g?(this.#A(),this.#g=t,t&&this.#x(t)):t&&this.#x(t)}#x(t){const e=`--${this.#v}`,s=t.style.getPropertyValue("anchor-name").trim();if(s&&s!==e)return this.style.setProperty("position-anchor",s),void(this.#y=!1);t.style.setProperty("anchor-name",e),this.style.setProperty("position-anchor",e),this.#y=!0}#A(){if(this.#g&&this.#y){const t=`--${this.#v}`;this.#g.style.getPropertyValue("anchor-name").trim()===t&&this.#g.style.removeProperty("anchor-name")}this.#g=null,this.#y=!1,this.style.removeProperty("position-anchor")}#w(){let t=function(t){if(!t)return null;const e=t.trim().toLowerCase();if(!e)return null;if(!e.includes("/")){const t=Ne(e);if(t){const[e,s]=Oe.middle;return{popInline:t[0],targetInline:t[1],popBlock:e,targetBlock:s}}const s=Te(e);if(s){const[t,e]=xe.center;return{popInline:t,targetInline:e,popBlock:s[0],targetBlock:s[1]}}return null}const s=e.split("/");if(2!==s.length)return null;const o=Ne(s[0]),r=Te(s[1]);return o&&r?{popInline:o[0],targetInline:o[1],popBlock:r[0],targetBlock:r[1]}:null}(this.position);this.position&&!t&&console.warn(`<tp-popover>: invalid position "${this.position}"; using default.`),t??=_e,this.dataset.pi=t.popInline,this.dataset.ti=t.targetInline,this.dataset.pb=t.popBlock,this.dataset.tb=t.targetBlock}#_(){for(const t of this.#b)t();this.#b=[]}#E(){this.#_();const t=this.#g;if(t){if("click"===this.trigger){const e=t=>{if(!t.composedPath().includes(this))try{this.togglePopover()}catch{}};return t.addEventListener("click",e),void this.#b.push(()=>t.removeEventListener("click",e))}if("hover"===this.trigger){let e=null;const s=()=>{null!==e&&(clearTimeout(e),e=null)},o=()=>{s();try{this.showPopover()}catch{}},r=()=>{s(),e=setTimeout(()=>{try{this.hidePopover()}catch{}},120)};t.addEventListener("pointerenter",o),t.addEventListener("pointerleave",r),t.addEventListener("focusin",o),t.addEventListener("focusout",r),this.addEventListener("pointerenter",s),this.addEventListener("pointerleave",r),this.addEventListener("focusin",s),this.addEventListener("focusout",r),this.#b.push(()=>{s(),t.removeEventListener("pointerenter",o),t.removeEventListener("pointerleave",r),t.removeEventListener("focusin",o),t.removeEventListener("focusout",r),this.removeEventListener("pointerenter",s),this.removeEventListener("pointerleave",r),this.removeEventListener("focusin",s),this.removeEventListener("focusout",r)})}}}};var Pe;e([ne({reflect:!0}),s("design:type",String)],ke.prototype,"mode",void 0),e([ne({reflect:!0}),s("design:type",Object)],ke.prototype,"target",void 0),e([ne({reflect:!0}),s("design:type",Object)],ke.prototype,"position",void 0),e([ne({reflect:!0}),s("design:type",String)],ke.prototype,"trigger",void 0),ke=e([oe("tp-popover")],ke),t.SelectElement=class extends ge{static{Pe=this}static{this.formAssociated=!0}static{this.ALLOWED_OPTION_ELEMENTS=[t.OptionElement]}static{this.styles=(()=>{const t=Ut`
253
+ ${me.shadedElementStyles}
254
254
  --tp-select-option-color: white;
255
255
  --tp-select-selection-color: var(--tp-calc-element-color);
256
256
  --tp-select-highlight-percent: 20%;
@@ -301,7 +301,7 @@ const oe=t=>(e,s)=>{void 0!==s?s.addInitializer(()=>{customElements.define(t,e)}
301
301
  ${t}
302
302
  }
303
303
  }
304
- `;return document.adoptedStyleSheets=[...document.adoptedStyleSheets,s.styleSheet],e})()}#w;get#_(){return this.shadowRoot?.querySelector("tp-popover")}#E;get value(){return this.#E.get()}set value(t){!function(t=le){new Promise((e,s)=>{setTimeout(()=>{try{const s=t();e(s)}catch(t){s(t)}},0)})}(()=>{const e=t?.split(",").map(t=>t.trim())??[],s=Array.from(this.#w);this.selectedOptions.set(e.map(t=>s.find(e=>e.value===t)).filter(Boolean).map(t=>new WeakRef(t)))})}#A;get placeholder(){return this.#A.get()}set placeholder(t){this.#C(this.#A,"placeholder",t)}#x;#O;#N;constructor(){super(),this.#w=new Set,this.self=this,this.selectedOptions=Tt([]),this.#E=((t,e)=>new j.Computed(t,e))(()=>this.selectedOptions.get().map(t=>t.deref()?.value??"").filter(Boolean).join(",")),this.#A=Tt("Select an option"),this.max=1,this.min=0,this.name=null,this.disabled=!1,this.required=!1,this.open=!1,this.#O="",this.#N=null,this.#x=this.attachInternals()}get internals(){return this.#x}get form(){return this.#x.form}get validity(){return this.#x.validity}get validationMessage(){return this.#x.validationMessage}get willValidate(){return this.#x.willValidate}checkValidity(){return this.#x.checkValidity()}reportValidity(){return this.#x.reportValidity()}createRenderRoot(){const e=super.createRenderRoot();return e.adoptedStyleSheets=[...e.adoptedStyleSheets,xe.styles.styleSheet,t.SelectedContentElement.styles.styleSheet,t.OptionElement.styles.styleSheet],e}connectedCallback(){super.connectedCallback(),this.#O=this.value}disconnectedCallback(){super.disconnectedCallback()}render(){return pt`
304
+ `;return document.adoptedStyleSheets=[...document.adoptedStyleSheets,s.styleSheet],e})()}#O;get#N(){return this.shadowRoot?.querySelector("tp-popover")}#T;#k;#P;get value(){return this.#P.get()}set value(t){this.#T=t,pe(this.#k,this.#I,10,this)}#R;get placeholder(){return this.#R.get()}set placeholder(t){this.#M(this.#R,"placeholder",t)}#L;#U;#j;constructor(){super(),this.#O=new Set,this.self=this,this.selectedOptions=kt([]),this.#T=null,this.#k=Symbol("tpselect:assignValueDebouncer"),this.#P=((t,e)=>new D.Computed(t,e))(()=>this.selectedOptions.get().map(t=>t.deref()?.value??"").filter(Boolean).join(",")),this.#R=kt("Select an option"),this.max=1,this.min=0,this.name=null,this.disabled=!1,this.required=!1,this.open=!1,this.#U="",this.#j=null,this.#L=this.attachInternals()}get internals(){return this.#L}get form(){return this.#L.form}get validity(){return this.#L.validity}get validationMessage(){return this.#L.validationMessage}get willValidate(){return this.#L.willValidate}checkValidity(){return this.#L.checkValidity()}reportValidity(){return this.#L.reportValidity()}createRenderRoot(){const e=super.createRenderRoot();return e.adoptedStyleSheets=[...e.adoptedStyleSheets,ke.styles.styleSheet,t.SelectedContentElement.styles.styleSheet,t.OptionElement.styles.styleSheet],e}connectedCallback(){super.connectedCallback(),this.#U=this.value}disconnectedCallback(){super.disconnectedCallback()}render(){return pt`
305
305
  <div pseudo="button" part="button">
306
306
  <slot name="button">
307
307
  <tp-selected-content part="selected-content"></tp-selected-content>
@@ -313,18 +313,18 @@ const oe=t=>(e,s)=>{void 0!==s?s.addInitializer(()=>{customElements.define(t,e)}
313
313
  <tp-popover
314
314
  position="start to start / bottom"
315
315
  target="[pseudo=button]"
316
- @click=${this.#k}
317
- @toggle=${this.#T}
316
+ @click=${this.#V}
317
+ @toggle=${this.#D}
318
318
  part="popover">
319
319
  <slot name="popover">
320
320
  <slot></slot>
321
321
  </slot>
322
322
  </tp-popover>
323
- `}updated(t){if(super.updated(t),t.has("max")&&Number.isFinite(this.max)){const t=this.selectedOptions.get();t.length>this.max&&this.selectedOptions.set(t.slice(t.length-this.max))}}willUpdate(t){this.#P(),this.#R()}formResetCallback(){this.value=this.#O}formDisabledCallback(t){this.disabled=t}formStateRestoreCallback(t){if(null!=t)if("string"!=typeof t){if(t instanceof FormData){const e=[];t.forEach(t=>{"string"==typeof t&&e.push(t)}),this.value=e.join(",")}}else this.value=t;else this.value=""}#P(){const t=""===this.value?[]:this.value.split(",");if(1===this.max)this.#x.setFormValue(t[0]??"");else{const e=new FormData,s=this.name??"";for(const o of t)e.append(s,o);this.#x.setFormValue(e)}this.required&&0===t.length?this.#x.setValidity({valueMissing:!0},"Please select an option."):this.#x.setValidity({})}#R(){const t=this.value;if(t===this.#N)return;const e=null===this.#N;if(this.#N=t,e)return;const s=this.selectedOptions.get().map(t=>t.deref()).filter(Boolean);this.dispatchEvent(new ye({value:t,selectedOptions:s}))}selectOption(t){const e=this.selectedOptions.get();if(e.find(e=>e.deref()===t))return;const s=[...e,new WeakRef(t)],o=s.length>this.max?s.slice(s.length-this.max):s;this.selectedOptions.set(o)}deselectOption(t){const e=this.selectedOptions.get(),s=e.find(e=>e.deref()===t);s&&(e.length<=this.min||this.selectedOptions.set(e.filter(t=>t!==s)))}toggleOption(t){this.selectedOptions.get().find(e=>e.deref()===t)?this.deselectOption(t):this.selectOption(t)}togglePopover(){return this.#_.togglePopover()}hidePopover(){this.#_.hidePopover()}showPopover(){this.#_.showPopover()}[fe](t){this.#w.add(t)}[me](t){this.#w.delete(t);const e=this.selectedOptions.get(),s=e.find(e=>e.deref()===t);s&&this.selectedOptions.set(e.filter(t=>t!==s))}#k(t){if(this.disabled)return;const e=function(t,e){const s=t.indexOf(e);return s<0?[]:t.slice(0,s)}(t.composedPath(),this).find(t=>Oe.ALLOWED_OPTION_ELEMENTS.some(e=>t instanceof e));if(!e)return;this.toggleOption(e);if(this.selectedOptions.get().length>=this.max){const t=this.shadowRoot?.querySelector("tp-popover");t?.hidePopover()}}#T(t){this.open="open"===t.newState}#C(t,e,s){const o=t.get();o!==s&&(t.set(s),this.requestUpdate(e,o))}},e([
323
+ `}updated(t){if(super.updated(t),t.has("max")&&Number.isFinite(this.max)){const t=this.selectedOptions.get();t.length>this.max&&this.selectedOptions.set(t.slice(t.length-this.max))}}willUpdate(t){this.#H(),this.#W()}formResetCallback(){this.value=this.#U}formDisabledCallback(t){this.disabled=t}formStateRestoreCallback(t){if(null!=t)if("string"!=typeof t){if(t instanceof FormData){const e=[];t.forEach(t=>{"string"==typeof t&&e.push(t)}),this.value=e.join(",")}}else this.value=t;else this.value=""}#H(){const t=""===this.value?[]:this.value.split(",");if(1===this.max)this.#L.setFormValue(t[0]??"");else{const e=new FormData,s=this.name??"";for(const o of t)e.append(s,o);this.#L.setFormValue(e)}this.required&&0===t.length?this.#L.setValidity({valueMissing:!0},"Please select an option."):this.#L.setValidity({})}#W(){const t=this.value;if(t===this.#j)return;const e=null===this.#j;if(this.#j=t,e)return;const s=this.selectedOptions.get().map(t=>t.deref()).filter(Boolean);this.dispatchEvent(new we({value:t,selectedOptions:s}))}selectOption(t){const e=this.selectedOptions.get();if(e.find(e=>e.deref()===t))return;const s=[...e,new WeakRef(t)],o=s.length>this.max?s.slice(s.length-this.max):s;this.selectedOptions.set(o)}deselectOption(t){const e=this.selectedOptions.get(),s=e.find(e=>e.deref()===t);s&&(e.length<=this.min||this.selectedOptions.set(e.filter(t=>t!==s)))}toggleOption(t){this.selectedOptions.get().find(e=>e.deref()===t)?this.deselectOption(t):this.selectOption(t)}togglePopover(){return this.#N.togglePopover()}hidePopover(){this.#N.hidePopover()}showPopover(){this.#N.showPopover()}[ye](t){this.#O.add(t),pe(this.#k,this.#I,10,this)}[be](t){this.#O.delete(t);const e=this.selectedOptions.get(),s=e.find(e=>e.deref()===t);s&&this.selectedOptions.set(e.filter(t=>t!==s))}#V(t){if(this.disabled)return;const e=function(t,e){const s=t.indexOf(e);return s<0?[]:t.slice(0,s)}(t.composedPath(),this).find(t=>Pe.ALLOWED_OPTION_ELEMENTS.some(e=>t instanceof e));if(!e)return;this.toggleOption(e);if(this.selectedOptions.get().length>=this.max){const t=this.shadowRoot?.querySelector("tp-popover");t?.hidePopover()}}#D(t){this.open="open"===t.newState}#M(t,e,s){const o=t.get();o!==s&&(t.set(s),this.requestUpdate(e,o))}#I(){const t=this.#T?.split(",").map(t=>t.trim())??[],e=Array.from(this.#O);this.selectedOptions.set(t.map(t=>e.find(e=>e.value===t)).filter(Boolean).map(t=>new WeakRef(t)))}},e([
324
324
  /**
325
325
  * @license
326
326
  * Copyright 2017 Google LLC
327
327
  * SPDX-License-Identifier: BSD-3-Clause
328
328
  */
329
- function({context:t}){return(e,s)=>{const o=new WeakMap;if("object"==typeof s)return{get(){return e.get.call(this)},set(t){return o.get(this).setValue(t),e.set.call(this,t)},init(e){return o.set(this,new c(this,{context:t,initialValue:e})),e}};{e.constructor.addInitializer(e=>{o.set(e,new c(e,{context:t}))});const r=Object.getOwnPropertyDescriptor(e,s);let i;if(void 0===r){const t=new WeakMap;i={get(){return t.get(this)},set(e){o.get(this).setValue(e),t.set(this,e)},configurable:!0,enumerable:!0}}else{const t=r.set;i={...r,set(e){o.get(this).setValue(e),t?.call(this,e)}}}return void Object.defineProperty(e,s,i)}}}({context:ae}),s("design:type",t.SelectElement)],t.SelectElement.prototype,"self",void 0),e([ne({type:String,reflect:!0,noAccessor:!0}),s("design:type",Object),s("design:paramtypes",[Object])],t.SelectElement.prototype,"value",null),e([ne({type:String,reflect:!0,noAccessor:!0}),s("design:type",String),s("design:paramtypes",[String])],t.SelectElement.prototype,"placeholder",null),e([ne({reflect:!0,converter:{fromAttribute:t=>{if(null==t||""===t)return 1;const e=String(t).trim().toLowerCase();if("infinite"===e)return Number.POSITIVE_INFINITY;const s=Number(e);return Number.isFinite(s)&&s>=1?Math.floor(s):1},toAttribute:t=>Number.isFinite(t)?String(t):"infinite"}}),s("design:type",Number)],t.SelectElement.prototype,"max",void 0),e([ne({type:Number,reflect:!0,converter:{fromAttribute:t=>{if(null==t||""===t)return 0;const e=Number(String(t).trim());return Number.isFinite(e)&&e>=0?Math.floor(e):0},toAttribute:t=>String(t)}}),s("design:type",Number)],t.SelectElement.prototype,"min",void 0),e([ne({type:String,reflect:!0}),s("design:type",Object)],t.SelectElement.prototype,"name",void 0),e([ne({type:Boolean,reflect:!0}),s("design:type",Object)],t.SelectElement.prototype,"disabled",void 0),e([ne({type:Boolean,reflect:!0}),s("design:type",Object)],t.SelectElement.prototype,"required",void 0),e([ne({type:Boolean,reflect:!0}),s("design:type",Object)],t.SelectElement.prototype,"open",void 0),t.SelectElement=Oe=e([oe("tp-select"),s("design:paramtypes",[])],t.SelectElement),t.SelectChangeEvent=ye}(this.TelperionElements.Select=this.TelperionElements.Select||{});
329
+ function({context:t}){return(e,s)=>{const o=new WeakMap;if("object"==typeof s)return{get(){return e.get.call(this)},set(t){return o.get(this).setValue(t),e.set.call(this,t)},init(e){return o.set(this,new l(this,{context:t,initialValue:e})),e}};{e.constructor.addInitializer(e=>{o.set(e,new l(e,{context:t}))});const r=Object.getOwnPropertyDescriptor(e,s);let i;if(void 0===r){const t=new WeakMap;i={get(){return t.get(this)},set(e){o.get(this).setValue(e),t.set(this,e)},configurable:!0,enumerable:!0}}else{const t=r.set;i={...r,set(e){o.get(this).setValue(e),t?.call(this,e)}}}return void Object.defineProperty(e,s,i)}}}({context:ue}),s("design:type",t.SelectElement)],t.SelectElement.prototype,"self",void 0),e([ne({type:String,reflect:!0,noAccessor:!0}),s("design:type",Object),s("design:paramtypes",[Object])],t.SelectElement.prototype,"value",null),e([ne({type:String,reflect:!0,noAccessor:!0}),s("design:type",String),s("design:paramtypes",[String])],t.SelectElement.prototype,"placeholder",null),e([ne({reflect:!0,converter:{fromAttribute:t=>{if(null==t||""===t)return 1;const e=String(t).trim().toLowerCase();if("infinite"===e)return Number.POSITIVE_INFINITY;const s=Number(e);return Number.isFinite(s)&&s>=1?Math.floor(s):1},toAttribute:t=>Number.isFinite(t)?String(t):"infinite"}}),s("design:type",Number)],t.SelectElement.prototype,"max",void 0),e([ne({type:Number,reflect:!0,converter:{fromAttribute:t=>{if(null==t||""===t)return 0;const e=Number(String(t).trim());return Number.isFinite(e)&&e>=0?Math.floor(e):0},toAttribute:t=>String(t)}}),s("design:type",Number)],t.SelectElement.prototype,"min",void 0),e([ne({type:String,reflect:!0}),s("design:type",Object)],t.SelectElement.prototype,"name",void 0),e([ne({type:Boolean,reflect:!0}),s("design:type",Object)],t.SelectElement.prototype,"disabled",void 0),e([ne({type:Boolean,reflect:!0}),s("design:type",Object)],t.SelectElement.prototype,"required",void 0),e([ne({type:Boolean,reflect:!0}),s("design:type",Object)],t.SelectElement.prototype,"open",void 0),t.SelectElement=Pe=e([oe("tp-select"),s("design:paramtypes",[])],t.SelectElement),t.SelectChangeEvent=we}(this.TelperionElements.Select=this.TelperionElements.Select||{});
330
330
  //# sourceMappingURL=index.js.map