@e280/sly 0.0.0-6 → 0.0.0-7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -28,7 +28,14 @@ views are leaner than web components.. no dom registration, no string tag names.
28
28
 
29
29
  sly views are wired to automatically rerender whenever they're using any state stuff from [@e280/strata](https://github.com/e280/strata).
30
30
 
31
- ### 🍋 basic view example
31
+ - a minimal view looks like this:
32
+ ```ts
33
+ import {view} from "@e280/sly"
34
+
35
+ view(use => () => "hello world")
36
+ ```
37
+
38
+ ### 🍋 view example
32
39
  - views are hooks-based functional components with a [shadow root](https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_shadow_DOM)
33
40
  - **declaring a view**
34
41
  ```ts
@@ -167,6 +174,29 @@ sly views are wired to automatically rerender whenever they're using any state s
167
174
  const op = use.op.promise(doAsyncWork())
168
175
  ```
169
176
 
177
+ ### 🍋 web components
178
+ - convert any view into a proper web component
179
+ ```ts
180
+ CounterView.component(1)
181
+ ```
182
+ - or build a component directly
183
+ ```ts
184
+ const MyComponent = view(use => html`hello world`)
185
+ ```
186
+ - register web components to the dom like this
187
+ ```ts
188
+ import {$} from "@e280/sly"
189
+
190
+ $.register({
191
+ MyCounter: CounterView.component(1),
192
+ MyComponent,
193
+ })
194
+
195
+ // <my-counter></my-counter>
196
+ // <my-component></my-component>
197
+ ```
198
+ - `$.register` automatically dashes the tag names (`MyComponent` becomes `<my-component>`)
199
+
170
200
  ### 🍋 neat tricks to impress the ladies
171
201
  - make a ticker — mount, repeat, and nap
172
202
  ```ts
@@ -189,6 +219,48 @@ sly views are wired to automatically rerender whenever they're using any state s
189
219
 
190
220
  <br/>
191
221
 
222
+ ## 🦝 SLY'S `$` DOLLAR DOM MULTITOOL
223
+ - import the `$` and it has a bunch of goodies
224
+ ```ts
225
+ import {$} from "@e280/sly"
226
+ ```
227
+ - query an element (throws an error if not found)
228
+ ```ts
229
+ $(".demo")
230
+ // HTMLElement
231
+ ```
232
+
233
+ ### queries
234
+ - query an element (undefined if not found)
235
+ ```ts
236
+ $.maybe(".demo")
237
+ // HTMLElement | undefined
238
+ ```
239
+ - query all elements (returns an array)
240
+ ```ts
241
+ $.maybe("ul li")
242
+ // HTMLElement[]
243
+ ```
244
+ - query all elements (returns an array)
245
+ ```ts
246
+ $.maybe("ul li")
247
+ // HTMLElement[]
248
+ ```
249
+
250
+ ### dom stuff
251
+ - register web components
252
+ ```ts
253
+ $.register({MyComponent, AnotherCoolComponent})
254
+ // <my-component>
255
+ // <another-cool-component>
256
+ ```
257
+ - render content into an element
258
+ ```ts
259
+ $.render(element, html`hello world`)
260
+ ```
261
+
262
+ <br/>
263
+
192
264
  ## 🦝 SLY OPS, PODS, AND LOADERS
193
265
  > ***TODO*** *we need to write real docs for this, lol*
194
266
  - `Pod` is a type for loading/ready/error states
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e280/sly",
3
- "version": "0.0.0-6",
3
+ "version": "0.0.0-7",
4
4
  "description": "web shadow views",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,8 +1,13 @@
1
1
 
2
2
  import {DemoView} from "./views/demo.js"
3
3
  import {$} from "../features/dom/dollar.js"
4
+ import {CounterView} from "./views/counter.js"
4
5
 
5
6
  $.render($(".demo"), DemoView())
6
7
 
8
+ $.register({
9
+ DemoCounter: CounterView.component(1),
10
+ })
11
+
7
12
  console.log("🦝 sly")
8
13
 
@@ -5,7 +5,7 @@ import {repeat} from "@e280/stz"
5
5
  import {view} from "../../features/views/view.js"
6
6
  import {cssReset} from "../../features/views/css-reset.js"
7
7
 
8
- export const CounterView = view(use => () => {
8
+ export const CounterView = view(use => (initial: number) => {
9
9
  use.name("counter")
10
10
  use.styles(cssReset, styles)
11
11
 
@@ -17,10 +17,11 @@ export const CounterView = view(use => () => {
17
17
  seconds(Math.floor(since / 1000))
18
18
  }))
19
19
 
20
- const count = use.signal(0)
20
+ const count = use.signal(initial)
21
21
  const increment = () => count(count() + 1)
22
22
 
23
23
  return html`
24
+ <slot></slot>
24
25
  <div>
25
26
  <span>${seconds()}</span>
26
27
  </div>
@@ -34,9 +35,12 @@ export const CounterView = view(use => () => {
34
35
  const styles = css`
35
36
  :host {
36
37
  display: flex;
37
- flex-direction: column;
38
38
  justify-content: center;
39
- text-align: center;
39
+ gap: 1em;
40
+ }
41
+
42
+ button {
43
+ padding: 0.2em 0.5em;
40
44
  }
41
45
  `
42
46
 
@@ -10,7 +10,7 @@ export const DemoView = view(use => () => {
10
10
  use.styles(cssReset, styles)
11
11
 
12
12
  return html`
13
- ${CounterView()}
13
+ ${CounterView.children("view")(2)}
14
14
  ${LoadersView()}
15
15
  `
16
16
  })
@@ -1,5 +1,6 @@
1
1
 
2
2
  import {render} from "lit"
3
+ import {register} from "./register.js"
3
4
  import {Content} from "../views/types.js"
4
5
 
5
6
  export type Container = HTMLElement | ShadowRoot | DocumentFragment
@@ -22,4 +23,5 @@ $.maybe = <E extends HTMLElement = HTMLElement>(selector: string, context: Query
22
23
  $.all = all
23
24
 
24
25
  $.render = (container: Container, ...content: Content[]) => render(content, container)
26
+ $.register = register
25
27
 
@@ -1,4 +1,5 @@
1
1
 
2
+ import {Constructor} from "@e280/stz"
2
3
  import {DirectiveResult} from "lit/directive.js"
3
4
  import {CSSResultGroup, TemplateResult} from "lit"
4
5
 
@@ -7,6 +8,11 @@ import {Use} from "./use.js"
7
8
  export type Content = TemplateResult | DirectiveResult | HTMLElement | string | null | undefined | void | Content[]
8
9
  export type AttrValue = string | boolean | number | undefined | null | void
9
10
 
11
+ export type Component<Props extends any[] = []> = {
12
+ render(...props: Props): void
13
+ } & HTMLElement
14
+
15
+ export type ComponentFn = (use: Use) => Content
10
16
  export type ViewFn<Props extends any[]> = (use: Use) => (...props: Props) => Content
11
17
  export type BasicView<Props extends any[]> = (...props: Props) => DirectiveResult<any>
12
18
  export type View<Props extends any[]> = BasicView<Props> & {
@@ -15,6 +21,7 @@ export type View<Props extends any[]> = BasicView<Props> & {
15
21
  children: (...children: Content[]) => View<Props>
16
22
  attrs: (attrs: Record<string, AttrValue>) => View<Props>
17
23
  attr: (name: string, value: AttrValue) => View<Props>
24
+ component: (...props: Props) => Constructor<Component>
18
25
  }
19
26
 
20
27
  export type ViewSettings = ShadowRootInit & {
@@ -18,12 +18,13 @@ export class Use {
18
18
  #rendered = defer()
19
19
  #mounts = new Mounts()
20
20
 
21
- ;[_wrap](fn: () => void) {
21
+ ;[_wrap]<R>(fn: () => R) {
22
22
  this.#runs++
23
23
  this.#position = 0
24
24
  this.#rendered = defer()
25
- fn()
25
+ const result = fn()
26
26
  this.#rendered.resolve()
27
+ return result
27
28
  }
28
29
 
29
30
  ;[_disconnect]() {
@@ -1,7 +1,7 @@
1
1
 
2
2
  import {render} from "lit"
3
- import {debounce, MapG} from "@e280/stz"
4
3
  import {tracker} from "@e280/strata/tracker"
4
+ import {Constructor, debounce, MapG} from "@e280/stz"
5
5
  import {AsyncDirective} from "lit/async-directive.js"
6
6
  import {directive, DirectiveResult} from "lit/directive.js"
7
7
 
@@ -9,7 +9,7 @@ import {register} from "../dom/register.js"
9
9
  import {applyAttrs} from "./utils/apply-attrs.js"
10
10
  import {applyStyles} from "./utils/apply-styles.js"
11
11
  import {Use, _wrap, _disconnect, _reconnect} from "./use.js"
12
- import {AttrValue, Content, View, ViewFn, ViewSettings, ViewWith} from "./types.js"
12
+ import {AttrValue, Component, ComponentFn, Content, View, ViewFn, ViewSettings, ViewWith} from "./types.js"
13
13
 
14
14
  export const view = setupView({mode: "open"})
15
15
  export class SlyView extends HTMLElement {}
@@ -17,8 +17,13 @@ register({SlyView}, {soft: true, upgrade: true})
17
17
 
18
18
  function setupView(settings: ViewSettings) {
19
19
  function view<Props extends any[]>(fn: ViewFn<Props>) {
20
- class ViewDirective extends AsyncDirective {
21
- #element = document.createElement(settings.tag ?? "sly-view")
20
+ type Situation = {
21
+ getElement: () => HTMLElement
22
+ isComponent: boolean
23
+ }
24
+
25
+ const make = (situation: Situation) => class ViewDirective extends AsyncDirective {
26
+ #element = situation.getElement()
22
27
  #shadow = this.#element.attachShadow(settings)
23
28
  #use = new Use(this.#element, this.#shadow, () => this.#render())
24
29
  #fn = (() => {
@@ -54,7 +59,8 @@ function setupView(settings: ViewSettings) {
54
59
  )
55
60
 
56
61
  // inject content into light dom
57
- render(w.children, this.#element)
62
+ if (!situation.isComponent)
63
+ render(w.children, this.#element)
58
64
  })
59
65
  }
60
66
 
@@ -63,7 +69,7 @@ function setupView(settings: ViewSettings) {
63
69
  render(w: ViewWith, props: Props) {
64
70
  this.#params = {with: w, props}
65
71
  this.#render()
66
- return this.#element
72
+ return situation.isComponent ? null : this.#element
67
73
  }
68
74
 
69
75
  disconnected() {
@@ -78,9 +84,13 @@ function setupView(settings: ViewSettings) {
78
84
  }
79
85
  }
80
86
 
87
+ const d = directive(make({
88
+ getElement: () => document.createElement(settings.tag ?? "sly-view"),
89
+ isComponent: false,
90
+ }))
91
+
81
92
  function setupDirective(w: ViewWith): View<Props> {
82
- const r = directive(ViewDirective)
83
- const rend = (...props: Props): DirectiveResult<any> => r(w, props)
93
+ const rend = (...props: Props): DirectiveResult<any> => d(w, props)
84
94
  rend.props = rend
85
95
  rend.with = (w2: Partial<ViewWith>) => setupDirective({...w, ...w2})
86
96
  rend.children = (...children: Content[]) => setupDirective({...w, children})
@@ -89,6 +99,20 @@ function setupView(settings: ViewSettings) {
89
99
  ...w,
90
100
  attrs: {...w.attrs, [name]: value},
91
101
  })
102
+ rend.component = (...props: Props) => class extends HTMLElement {
103
+ #directive = directive(make({
104
+ getElement: () => this,
105
+ isComponent: true,
106
+ }))
107
+ constructor() {
108
+ super()
109
+ this.render(...props)
110
+ }
111
+ render(...props: Props) {
112
+ if (this.isConnected)
113
+ render(this.#directive(w, props), this)
114
+ }
115
+ }
92
116
  return rend
93
117
  }
94
118
 
@@ -100,6 +124,7 @@ function setupView(settings: ViewSettings) {
100
124
 
101
125
  view.view = view
102
126
  view.settings = (settings2: Partial<ViewSettings>) => setupView({...settings, ...settings2})
127
+ view.component = (fn: ComponentFn) => view(use => () => fn(use)).component()
103
128
  return view
104
129
  }
105
130
 
package/s/index.html.ts CHANGED
@@ -29,6 +29,7 @@ export default ssg.page(import.meta.url, async orb => ({
29
29
  <h1>sly testing page</h1>
30
30
  <p><a href="https://github.com/e280/sly">github.com/e280/sly</a></p>
31
31
  <p class=lil>v${orb.packageVersion()}</p>
32
+ <demo-counter>component</demo-counter>
32
33
  <div class=demo></div>
33
34
  `,
34
35
  }))
@@ -1,5 +1,9 @@
1
1
  import { DemoView } from "./views/demo.js";
2
2
  import { $ } from "../features/dom/dollar.js";
3
+ import { CounterView } from "./views/counter.js";
3
4
  $.render($(".demo"), DemoView());
5
+ $.register({
6
+ DemoCounter: CounterView.component(1),
7
+ });
4
8
  console.log("🦝 sly");
5
9
  //# sourceMappingURL=demo.bundle.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"demo.bundle.js","sourceRoot":"","sources":["../../s/demo/demo.bundle.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAC,CAAC,EAAC,MAAM,2BAA2B,CAAA;AAE3C,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAA;AAEhC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA"}
1
+ {"version":3,"file":"demo.bundle.js","sourceRoot":"","sources":["../../s/demo/demo.bundle.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAC,CAAC,EAAC,MAAM,2BAA2B,CAAA;AAC3C,OAAO,EAAC,WAAW,EAAC,MAAM,oBAAoB,CAAA;AAE9C,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAA;AAEhC,CAAC,CAAC,QAAQ,CAAC;IACV,WAAW,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC;CACrC,CAAC,CAAA;AAEF,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA"}
@@ -1,6 +1,6 @@
1
- var Pe=Object.defineProperty;var ke=(r,t)=>{for(var e in t)Pe(r,e,{get:t[e],enumerable:!0})};var rt=globalThis,st=rt.ShadowRoot&&(rt.ShadyCSS===void 0||rt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,St=Symbol(),Zt=new WeakMap,q=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==St)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(st&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=Zt.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Zt.set(e,t))}return t}toString(){return this.cssText}},Kt=r=>new q(typeof r=="string"?r:r+"",void 0,St),m=(r,...t)=>{let e=r.length===1?r[0]:t.reduce(((s,o,n)=>s+(i=>{if(i._$cssResult$===!0)return i.cssText;if(typeof i=="number")return i;throw Error("Value passed to 'css' function must be a 'css' function result: "+i+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+r[n+1]),r[0]);return new q(e,r,St)},ot=(r,t)=>{if(st)r.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(let e of t){let s=document.createElement("style"),o=rt.litNonce;o!==void 0&&s.setAttribute("nonce",o),s.textContent=e.cssText,r.appendChild(s)}},U=st?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return Kt(e)})(r):r;var{is:Oe,defineProperty:Te,getOwnPropertyDescriptor:je,getOwnPropertyNames:Me,getOwnPropertySymbols:Ue,getPrototypeOf:He}=Object,nt=globalThis,Qt=nt.trustedTypes,Re=Qt?Qt.emptyScript:"",Ne=nt.reactiveElementPolyfillSupport,W=(r,t)=>r,Et={toAttribute(r,t){switch(t){case Boolean:r=r?Re:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},Gt=(r,t)=>!Oe(r,t),Jt={attribute:!0,type:String,converter:Et,reflect:!1,useDefault:!1,hasChanged:Gt};Symbol.metadata??=Symbol("metadata"),nt.litPropertyMetadata??=new WeakMap;var _=class 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=Jt){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){let s=Symbol(),o=this.getPropertyDescriptor(t,s,e);o!==void 0&&Te(this.prototype,t,o)}}static getPropertyDescriptor(t,e,s){let{get:o,set:n}=je(this.prototype,t)??{get(){return this[e]},set(i){this[e]=i}};return{get:o,set(i){let c=o?.call(this);n?.call(this,i),this.requestUpdate(t,c,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Jt}static _$Ei(){if(this.hasOwnProperty(W("elementProperties")))return;let t=He(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(W("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(W("properties"))){let e=this.properties,s=[...Me(e),...Ue(e)];for(let o of s)this.createProperty(o,e[o])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,o]of e)this.elementProperties.set(s,o)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let o=this._$Eu(e,s);o!==void 0&&this._$Eh.set(o,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let o of s)e.unshift(U(o))}else t!==void 0&&e.push(U(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?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),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ot(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){let s=this.constructor.elementProperties.get(t),o=this.constructor._$Eu(t,s);if(o!==void 0&&s.reflect===!0){let n=(s.converter?.toAttribute!==void 0?s.converter:Et).toAttribute(e,s.type);this._$Em=t,n==null?this.removeAttribute(o):this.setAttribute(o,n),this._$Em=null}}_$AK(t,e){let s=this.constructor,o=s._$Eh.get(t);if(o!==void 0&&this._$Em!==o){let n=s.getPropertyOptions(o),i=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:Et;this._$Em=o,this[o]=i.fromAttribute(e,n.type)??this._$Ej?.get(o)??null,this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){let o=this.constructor,n=this[t];if(s??=o.getPropertyOptions(t),!((s.hasChanged??Gt)(n,e)||s.useDefault&&s.reflect&&n===this._$Ej?.get(t)&&!this.hasAttribute(o._$Eu(t,s))))return;this.C(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:o,wrapped:n},i){s&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,i??e??this[t]),n!==!0||i!==void 0)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),o===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[o,n]of this._$Ep)this[o]=n;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[o,n]of s){let{wrapped:i}=n,c=this[o];i!==!0||this._$AL.has(o)||c===void 0||this.C(o,void 0,n,c)}}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((s=>s.hostUpdate?.())),this.update(e)):this._$EM()}catch(s){throw t=!1,this._$EM(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((e=>e.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((e=>this._$ET(e,this[e]))),this._$EM()}updated(t){}firstUpdated(t){}};_.elementStyles=[],_.shadowRootOptions={mode:"open"},_[W("elementProperties")]=new Map,_[W("finalized")]=new Map,Ne?.({ReactiveElement:_}),(nt.reactiveElementVersions??=[]).push("2.1.0");var Ct=globalThis,it=Ct.trustedTypes,Yt=it?it.createPolicy("lit-html",{createHTML:r=>r}):void 0,Pt="$lit$",w=`lit$${Math.random().toFixed(9).slice(2)}$`,kt="?"+w,ze=`<${kt}>`,B=document,Z=()=>B.createComment(""),K=r=>r===null||typeof r!="object"&&typeof r!="function",Ot=Array.isArray,oe=r=>Ot(r)||typeof r?.[Symbol.iterator]=="function",Bt=`[
2
- \f\r]`,F=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Xt=/-->/g,te=/>/g,S=RegExp(`>|${Bt}(?:([^\\s"'>=/]+)(${Bt}*=${Bt}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),ee=/'/g,re=/"/g,ne=/^(?:script|style|textarea|title)$/i,Tt=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),v=Tt(1),zr=Tt(2),Dr=Tt(3),C=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),se=new WeakMap,E=B.createTreeWalker(B,129);function ie(r,t){if(!Ot(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return Yt!==void 0?Yt.createHTML(t):t}var ae=(r,t)=>{let e=r.length-1,s=[],o,n=t===2?"<svg>":t===3?"<math>":"",i=F;for(let c=0;c<e;c++){let a=r[c],l,h,u=-1,$=0;for(;$<a.length&&(i.lastIndex=$,h=i.exec(a),h!==null);)$=i.lastIndex,i===F?h[1]==="!--"?i=Xt:h[1]!==void 0?i=te:h[2]!==void 0?(ne.test(h[2])&&(o=RegExp("</"+h[2],"g")),i=S):h[3]!==void 0&&(i=S):i===S?h[0]===">"?(i=o??F,u=-1):h[1]===void 0?u=-2:(u=i.lastIndex-h[2].length,l=h[1],i=h[3]===void 0?S:h[3]==='"'?re:ee):i===re||i===ee?i=S:i===Xt||i===te?i=F:(i=S,o=void 0);let A=i===S&&r[c+1].startsWith("/>")?" ":"";n+=i===F?a+ze:u>=0?(s.push(l),a.slice(0,u)+Pt+a.slice(u)+w+A):a+w+(u===-2?c:A)}return[ie(r,n+(r[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]},Q=class r{constructor({strings:t,_$litType$:e},s){let o;this.parts=[];let n=0,i=0,c=t.length-1,a=this.parts,[l,h]=ae(t,e);if(this.el=r.createElement(l,s),E.currentNode=this.el.content,e===2||e===3){let u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(o=E.nextNode())!==null&&a.length<c;){if(o.nodeType===1){if(o.hasAttributes())for(let u of o.getAttributeNames())if(u.endsWith(Pt)){let $=h[i++],A=o.getAttribute(u).split(w),et=/([.?@])?(.*)/.exec($);a.push({type:1,index:n,name:et[2],strings:A,ctor:et[1]==="."?ct:et[1]==="?"?lt:et[1]==="@"?pt:k}),o.removeAttribute(u)}else u.startsWith(w)&&(a.push({type:6,index:n}),o.removeAttribute(u));if(ne.test(o.tagName)){let u=o.textContent.split(w),$=u.length-1;if($>0){o.textContent=it?it.emptyScript:"";for(let A=0;A<$;A++)o.append(u[A],Z()),E.nextNode(),a.push({type:2,index:++n});o.append(u[$],Z())}}}else if(o.nodeType===8)if(o.data===kt)a.push({type:2,index:n});else{let u=-1;for(;(u=o.data.indexOf(w,u+1))!==-1;)a.push({type:7,index:n}),u+=w.length-1}n++}}static createElement(t,e){let s=B.createElement("template");return s.innerHTML=t,s}};function P(r,t,e=r,s){if(t===C)return t;let o=s!==void 0?e._$Co?.[s]:e._$Cl,n=K(t)?void 0:t._$litDirective$;return o?.constructor!==n&&(o?._$AO?.(!1),n===void 0?o=void 0:(o=new n(r),o._$AT(r,e,s)),s!==void 0?(e._$Co??=[])[s]=o:e._$Cl=o),o!==void 0&&(t=P(r,o._$AS(r,t.values),o,s)),t}var at=class{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){let{el:{content:e},parts:s}=this._$AD,o=(t?.creationScope??B).importNode(e,!0);E.currentNode=o;let n=E.nextNode(),i=0,c=0,a=s[0];for(;a!==void 0;){if(i===a.index){let l;a.type===2?l=new H(n,n.nextSibling,this,t):a.type===1?l=new a.ctor(n,a.name,a.strings,this,t):a.type===6&&(l=new ut(n,this,t)),this._$AV.push(l),a=s[++c]}i!==a?.index&&(n=E.nextNode(),i++)}return E.currentNode=B,o}p(t){let e=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}},H=class r{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,o){this.type=2,this._$AH=d,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,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=P(this,t,e),K(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==C&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):oe(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!==d&&K(this._$AH)?this._$AA.nextSibling.data=t:this.T(B.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:s}=t,o=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=Q.createElement(ie(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===o)this._$AH.p(e);else{let n=new at(o,this),i=n.u(this.options);n.p(e),this.T(i),this._$AH=n}}_$AC(t){let e=se.get(t.strings);return e===void 0&&se.set(t.strings,e=new Q(t)),e}k(t){Ot(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,s,o=0;for(let n of t)o===e.length?e.push(s=new r(this.O(Z()),this.O(Z()),this,this.options)):s=e[o],s._$AI(n),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&&t!==this._$AB;){let s=t.nextSibling;t.remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},k=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,o,n){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=o,this.options=n,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=d}_$AI(t,e=this,s,o){let n=this.strings,i=!1;if(n===void 0)t=P(this,t,e,0),i=!K(t)||t!==this._$AH&&t!==C,i&&(this._$AH=t);else{let c=t,a,l;for(t=n[0],a=0;a<n.length-1;a++)l=P(this,c[s+a],e,a),l===C&&(l=this._$AH[a]),i||=!K(l)||l!==this._$AH[a],l===d?t=d:t!==d&&(t+=(l??"")+n[a+1]),this._$AH[a]=l}i&&!o&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},ct=class extends k{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}},lt=class extends k{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}},pt=class extends k{constructor(t,e,s,o,n){super(t,e,s,o,n),this.type=5}_$AI(t,e=this){if((t=P(this,t,e,0)??d)===C)return;let s=this._$AH,o=t===d&&s!==d||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==d&&(s===d||o);o&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},ut=class{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){P(this,t)}},ce={M:Pt,P:w,A:kt,C:1,L:ae,R:at,D:oe,V:P,I:H,H:k,N:lt,U:pt,B:ct,F:ut},De=Ct.litHtmlPolyfillSupport;De?.(Q,H),(Ct.litHtmlVersions??=[]).push("3.3.0");var O=(r,t,e)=>{let s=e?.renderBefore??t,o=s._$litPart$;if(o===void 0){let n=e?.renderBefore??null;s._$litPart$=o=new H(t.insertBefore(Z(),n),n,void 0,e??{})}return o._$AI(r),o};var jt=globalThis,R=class extends _{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=O(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return C}};R._$litElement$=!0,R.finalized=!0,jt.litElementHydrateSupport?.({LitElement:R});var Ie=jt.litElementPolyfillSupport;Ie?.({LitElement:R});(jt.litElementVersions??=[]).push("4.2.0");var g=Object.freeze({eq(r,t){if(r.length!==t.length)return!1;for(let e=0;e<=r.length;e++)if(r.at(e)!==t.at(e))return!1;return!0},random(r){return crypto.getRandomValues(new Uint8Array(r))}});var T=Object.freeze({fromBytes(r){return[...r].map(t=>t.toString(16).padStart(2,"0")).join("")},toBytes(r){if(r.length%2!==0)throw new Error("must have even number of hex characters");let t=new Uint8Array(r.length/2);for(let e=0;e<r.length;e+=2)t[e/2]=parseInt(r.slice(e,e+2),16);return t},random(r=32){return this.fromBytes(g.random(r))},string(r){return T.fromBytes(r)},bytes(r){return T.toBytes(r)}});var Mt=58,ht="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",Ut=Object.freeze({fromBytes(r){let t=BigInt("0x"+T.fromBytes(r)),e="";for(;t>0;){let s=t%BigInt(Mt);t=t/BigInt(Mt),e=ht[Number(s)]+e}for(let s of r)if(s===0)e=ht[0]+e;else break;return e},toBytes(r){let t=BigInt(0);for(let i of r){let c=ht.indexOf(i);if(c===-1)throw new Error(`Invalid character '${i}' in base58 string`);t=t*BigInt(Mt)+BigInt(c)}let e=t.toString(16);e.length%2!==0&&(e="0"+e);let s=T.toBytes(e),o=0;for(let i of r)if(i===ht[0])o++;else break;let n=new Uint8Array(o+s.length);return n.set(s,o),n},random(r=32){return this.fromBytes(g.random(r))},string(r){return Ut.fromBytes(r)},bytes(r){return Ut.toBytes(r)}});var le=class{lexicon;static lexicons=Object.freeze({base2:{characters:"01"},hex:{characters:"0123456789abcdef"},base36:{characters:"0123456789abcdefghijklmnopqrstuvwxyz"},base58:{characters:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"},base62:{characters:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"},base64url:{negativePrefix:"~",characters:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"},base64:{characters:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",padding:{character:"=",size:4}}});lookup;negativePrefix;constructor(t){this.lexicon=t,this.lookup=Object.fromEntries([...t.characters].map((e,s)=>[e,s])),this.negativePrefix=t.negativePrefix??"-"}toBytes(t){let e=Math.log2(this.lexicon.characters.length);if(Number.isInteger(e)){let c=0,a=0,l=[];for(let h of t){if(h===this.lexicon.padding?.character)continue;let u=this.lookup[h];if(u===void 0)throw new Error(`Invalid character: ${h}`);for(c=c<<e|u,a+=e;a>=8;)a-=8,l.push(c>>a&255)}return new Uint8Array(l)}let s=0n,o=BigInt(this.lexicon.characters.length),n=!1;t.startsWith(this.negativePrefix)&&(t=t.slice(this.negativePrefix.length),n=!0);for(let c of t){let a=this.lookup[c];if(a===void 0)throw new Error(`Invalid character: ${c}`);s=s*o+BigInt(a)}let i=[];for(;s>0n;)i.unshift(Number(s%256n)),s=s/256n;return new Uint8Array(i)}fromBytes(t){let e=Math.log2(this.lexicon.characters.length);if(Number.isInteger(e)){let i=0,c=0,a="";for(let l of t)for(i=i<<8|l,c+=8;c>=e;){c-=e;let h=i>>c&(1<<e)-1;a+=this.lexicon.characters[h]}if(c>0){let l=i<<e-c&(1<<e)-1;a+=this.lexicon.characters[l]}if(this.lexicon.padding)for(;a.length%this.lexicon.padding.size!==0;)a+=this.lexicon.padding.character;return a}let s=0n;for(let i of t)s=(s<<8n)+BigInt(i);if(s===0n)return this.lexicon.characters[0];let o=BigInt(this.lexicon.characters.length),n="";for(;s>0n;)n=this.lexicon.characters[Number(s%o)]+n,s=s/o;return n}toInteger(t){if(!t)return 0;let e=0n,s=!1,o=BigInt(this.lexicon.characters.length);t.startsWith(this.negativePrefix)&&(t=t.slice(this.negativePrefix.length),s=!0);for(let n of t){let i=this.lookup[n];if(i===void 0)throw new Error(`Invalid character: ${n}`);e=e*o+BigInt(i)}return Number(s?-e:e)}fromInteger(t){t=Math.floor(t);let e=t<0,s=BigInt(e?-t:t);if(s===0n)return this.lexicon.characters[0];let o=BigInt(this.lexicon.characters.length),n="";for(;s>0n;)n=this.lexicon.characters[Number(s%o)]+n,s=s/o;return e?`${this.negativePrefix}${n}`:n}random(t=32){return this.fromBytes(g.random(t))}};var Ht=Object.freeze({fromBytes(r){return typeof btoa=="function"?btoa(String.fromCharCode(...r)):Buffer.from(r).toString("base64")},toBytes(r){return typeof atob=="function"?Uint8Array.from(atob(r),t=>t.charCodeAt(0)):Uint8Array.from(Buffer.from(r,"base64"))},random(r=32){return this.fromBytes(g.random(r))},string(r){return Ht.fromBytes(r)},bytes(r){return Ht.toBytes(r)}});var pe=Object.freeze({fromBytes(r){return new TextDecoder().decode(r)},toBytes(r){return new TextEncoder().encode(r)},string(r){return pe.fromBytes(r)},bytes(r){return pe.toBytes(r)}});function ft(r,t){let e,s,o=[];function n(){e=[],s&&clearTimeout(s),s=void 0,o=[]}return n(),((...i)=>{e=i,s&&clearTimeout(s);let c=new Promise((a,l)=>{o.push({resolve:a,reject:l})});return s=setTimeout(()=>{Promise.resolve().then(()=>t(...e)).then(a=>{for(let{resolve:l}of o)l(a);n()}).catch(a=>{for(let{reject:l}of o)l(a);n()})},r),c})}var Rt=Object.freeze({set:r=>r!=null,unset:r=>r==null,boolean:r=>typeof r=="boolean",number:r=>typeof r=="number",string:r=>typeof r=="string",bigint:r=>typeof r=="bigint",object:r=>typeof r=="object"&&r!==null,array:r=>Array.isArray(r),fn:r=>typeof r=="function",symbol:r=>typeof r=="symbol"});function J(){let r,t,e=new Promise((o,n)=>{r=o,t=n});function s(o){return o.then(r).catch(t),e}return{promise:e,resolve:r,reject:t,entangle:s}}var N=class r extends Map{static require(t,e){if(t.has(e))return t.get(e);throw new Error(`required key not found: "${e}"`)}static guarantee(t,e,s){if(t.has(e))return t.get(e);{let o=s();return t.set(e,o),o}}array(){return[...this]}require(t){return r.require(this,t)}guarantee(t,e){return r.guarantee(this,t,e)}};var ue=(r=0)=>new Promise(t=>setTimeout(t,r));function Le(r){return{map:t=>he(r,t),filter:t=>fe(r,t)}}Le.pipe=Object.freeze({map:r=>(t=>he(t,r)),filter:r=>(t=>fe(t,r))});var he=(r,t)=>Object.fromEntries(Object.entries(r).map(([e,s])=>[e,t(s,e)])),fe=(r,t)=>Object.fromEntries(Object.entries(r).filter(([e,s])=>t(s,e)));function de(){let r=new Set;function t(n){return r.add(n),()=>{r.delete(n)}}async function e(...n){await Promise.all([...r].map(i=>i(...n)))}async function s(){let{promise:n,resolve:i}=J(),c=t((...a)=>{i(a),c()});return n}function o(){r.clear()}return t.pub=e,t.sub=t,t.on=t,t.next=s,t.clear=o,e.pub=e,e.sub=t,e.on=t,e.next=s,e.clear=o,[e,t]}function dt(r){let t=de()[1];return r&&t.sub(r),t}function Nt(r){let t=de()[0];return r&&t.sub(r),t}function mt(r){let t,e=!1,s=()=>{e=!0,clearTimeout(t)},o=async()=>{e||(await r(s),!e&&(t=setTimeout(o,0)))};return o(),s}var zt=class{#t=[];#e=new WeakMap;#r=[];#o=new Set;see(t){this.#t.at(-1)?.add(t)}seen(t){this.#t.push(new Set);let e=t();return{seen:this.#t.pop(),result:e}}async change(t){if(this.#o.has(t))throw new Error("circularity forbidden");let e=this.#s(t).pub();return this.#r.at(-1)?.add(e),e}changed(t,e){return this.#s(t)(async()=>{let s=new Set;this.#r.push(s),this.#o.add(t),s.add(e()),this.#o.delete(t),await Promise.all(s),this.#r.pop()})}#s(t){let e=this.#e.get(t);return e||(e=dt(),this.#e.set(t,e)),e}},Ve=Symbol.for("e280.tracker.v2"),y=globalThis[Ve]??=new zt;var{I:rn}=ce;var me=r=>r.strings===void 0;var ye={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Dt=r=>(...t)=>({_$litDirective$:r,values:t}),yt=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var G=(r,t)=>{let e=r._$AN;if(e===void 0)return!1;for(let s of e)s._$AO?.(t,!1),G(s,t);return!0},gt=r=>{let t,e;do{if((t=r._$AM)===void 0)break;e=t._$AN,e.delete(r),r=t}while(e?.size===0)},ge=r=>{for(let t;t=r._$AM;r=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(r))break;e.add(r),Fe(t)}};function qe(r){this._$AN!==void 0?(gt(this),this._$AM=r,ge(this)):this._$AM=r}function We(r,t=!1,e=0){let s=this._$AH,o=this._$AN;if(o!==void 0&&o.size!==0)if(t)if(Array.isArray(s))for(let n=e;n<s.length;n++)G(s[n],!1),gt(s[n]);else s!=null&&(G(s,!1),gt(s));else G(this,r)}var Fe=r=>{r.type==ye.CHILD&&(r._$AP??=We,r._$AQ??=qe)},bt=class extends yt{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,s){super._$AT(t,e,s),ge(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(G(this,t),gt(this))}setValue(t){if(me(this._$Ct))this._$Ct._$AI(t,this);else{let e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}};function be(r){return r.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function xe(r,t={}){let{soft:e=!1,upgrade:s=!0}=t;for(let[o,n]of Object.entries(r)){let i=be(o),c=customElements.get(i);e&&c||(customElements.define(i,n),s&&document.querySelectorAll(i).forEach(a=>{a.constructor===HTMLElement&&customElements.upgrade(a)}))}}function $e(r,t){for(let[e,s]of Object.entries(t))s===void 0||s===null?r.removeAttribute(e):typeof s=="string"?r.setAttribute(e,s):typeof s=="number"?r.setAttribute(e,s.toString()):typeof s=="boolean"?s===!0?r.setAttribute(e,""):r.removeAttribute(e):console.warn(`invalid attribute type ${e} is ${typeof s}`)}function xt(r,t){ot(r,Ze(t))}function Ze(r){let t=[];if(Array.isArray(r)){let e=new Set(r.flat(1/0).reverse());for(let s of e)t.unshift(U(s))}else r!==void 0&&t.push(U(r));return t}function It(r,t=r){let{seen:e,result:s}=y.seen(r),o=ft(0,t),n=[],i=()=>n.forEach(c=>c());for(let c of e){let a=y.changed(c,o);n.push(a)}return{result:s,dispose:i}}var Ke={compare:(r,t)=>r===t};function z(r={}){return{...Ke,...r}}var $t=class{sneak;constructor(t){this.sneak=t}get(){return y.see(this),this.sneak}get value(){return this.get()}},_t=class extends $t{on=dt();dispose(){this.on.clear()}},Y=class extends _t{_options;kind="signal";_lock=!1;constructor(t,e){super(t),this._options=e}async set(t){return!this._options.compare(this.sneak,t)&&await this.publish(t),t}get value(){return this.get()}set value(t){this.set(t)}async publish(t=this.get()){if(this._lock)throw new Error("forbid circularity");let e=Promise.resolve();try{this._lock=!0,this.sneak=t,e=Promise.all([y.change(this),this.on.pub(t)])}finally{this._lock=!1}return await e,t}},X=class extends $t{_formula;_options;kind="lazy";_dirty=!1;_effect;constructor(t,e){super(void 0),this._formula=t,this._options=e}get(){if(!this._effect){let{result:t,dispose:e}=It(this._formula,()=>this._dirty=!0);this._effect=e,this.sneak=t}if(this._dirty){this._dirty=!1;let t=this._formula();!this._options.compare(this.sneak,t)&&(this.sneak=t,y.change(this))}return super.get()}get value(){return this.get()}dispose(){this._effect&&this._effect()}},tt=class extends _t{_effect;static make(t,e,s){let{result:o,dispose:n}=It(e,async()=>{let i=e();!s.compare(t.sneak,i)&&(t.sneak=i,await Promise.all([y.change(t),t.on.pub(i)]))});return new this(o,n)}kind="derived";constructor(t,e){super(t),this._effect=e}get value(){return this.get()}dispose(){super.dispose(),this._effect()}};function _e(r,t={}){function e(){return e.value}let s=z(t),o=new X(r,s);return Object.setPrototypeOf(e,X.prototype),Object.assign(e,o),e}function we(r,t={}){function e(){return e.value}let s=z(t),o=tt.make(e,r,s);return Object.setPrototypeOf(e,tt.prototype),Object.assign(e,o),e}function D(r,t={}){function e(n){return n!==void 0?e.set(n):e.get()}let s=z(t),o=new Y(r,s);return Object.setPrototypeOf(e,Y.prototype),Object.assign(e,o),e}D.lazy=_e;D.derive=we;var j={status:r=>r[0],value:r=>r[0]==="ready"?r[1]:void 0,error:r=>r[0]==="error"?r[1]:void 0,select:(r,t)=>{switch(r[0]){case"loading":return t.loading();case"error":return t.error(r[1]);case"ready":return t.ready(r[1]);default:throw new Error("unknown op status")}},morph:(r,t)=>j.select(r,{loading:()=>["loading"],error:e=>["error",e],ready:e=>["ready",t(e)]}),all:(...r)=>{let t=[],e=[],s=0;for(let o of r)switch(o[0]){case"loading":s++;break;case"ready":t.push(o[1]);break;case"error":e.push(o[1]);break}return e.length>0?["error",e]:s===0?["ready",t]:["loading"]}};var M=class r{static loading(){return new this}static ready(t){return new this(["ready",t])}static error(t){return new this(["error",t])}static promise(t){let e=new this;return e.promise(t),e}static fn(t){return this.promise(t())}static all(...t){let e=t.map(o=>o.pod),s=j.all(...e);return new this(s)}signal;#t=Nt();#e=Nt();constructor(t=["loading"]){this.signal=D(t)}get wait(){return new Promise((t,e)=>{this.#t.next().then(t),this.#e.next().then(e)})}async setLoading(){await this.signal(["loading"])}async setReady(t){await this.signal(["ready",t]),await this.#t(t)}async setError(t){await this.signal(["error",t]),await this.#e(t)}async promise(t){await this.setLoading();try{let e=await t;return await this.setReady(e),e}catch(e){await this.setError(e)}}async fn(t){return this.promise(t())}get pod(){return this.signal()}set pod(t){this.signal(t)}get status(){return this.signal()[0]}get value(){return j.value(this.signal())}get error(){return j.error(this.signal())}get isLoading(){return this.status==="loading"}get isReady(){return this.status==="ready"}get isError(){return this.status==="error"}require(){let t=this.signal();if(t[0]!=="ready")throw new Error("required value not ready");return t[1]}select(t){return j.select(this.signal(),t)}morph(t){return new r(j.morph(this.pod,t))}};var wt=class{#t=[];#e=[];mount(t){this.#t.push(t),this.#e.push(t())}unmountAll(){for(let t of this.#e)t();this.#e=[]}remountAll(){for(let t of this.#t)this.#e.push(t())}};var Lt=Symbol(),Vt=Symbol(),qt=Symbol(),At=class{element;shadow;render;#t=0;#e=0;#r=new N;#o=J();#s=new wt;[Lt](t){this.#t++,this.#e=0,this.#o=J(),t(),this.#o.resolve()}[Vt](){this.#s.unmountAll()}[qt](){this.#s.remountAll()}constructor(t,e,s){this.element=t,this.shadow=e,this.render=s}get renderCount(){return this.#t}get rendered(){return this.#o.promise}name(t){this.once(()=>this.element.setAttribute("view",t))}styles(...t){this.once(()=>xt(this.shadow,t))}once(t){return this.#r.guarantee(this.#e++,t)}mount(t){return this.once(()=>this.#s.mount(t))}life(t){let e;return this.mount(()=>{let[s,o]=t();return e=s,o}),e}op={fn:t=>this.once(()=>M.fn(t)),promise:t=>this.once(()=>M.promise(t))};signal(t){return this.once(()=>D(t))}};var b=Ae({mode:"open"}),Wt=class extends HTMLElement{};xe({SlyView:Wt},{soft:!0,upgrade:!0});function Ae(r){function t(e){class s extends bt{#t=document.createElement(r.tag??"sly-view");#e=this.#t.attachShadow(r);#r=new At(this.#t,this.#e,()=>this.#i());#o=(()=>{let i=e(this.#r);return this.#t.setAttribute("view",r.name??""),r.styles&&xt(this.#e,r.styles),i})();#s=new N;#n;#i(){if(!this.#n||!this.isConnected)return;let{with:i,props:c}=this.#n;this.#r[Lt](()=>{$e(this.#t,i.attrs);let{result:a,seen:l}=y.seen(()=>this.#o(...c));O(a,this.#e);for(let h of l)this.#s.guarantee(h,()=>y.changed(h,async()=>this.#a()));O(i.children,this.#t)})}#a=ft(0,()=>this.#i());render(i,c){return this.#n={with:i,props:c},this.#i(),this.#t}disconnected(){this.#r[Vt]();for(let i of this.#s.values())i();this.#s.clear()}reconnected(){this.#r[qt]()}}function o(n){let i=Dt(s),c=(...a)=>i(n,a);return c.props=c,c.with=a=>o({...n,...a}),c.children=(...a)=>o({...n,children:a}),c.attrs=a=>o({...n,attrs:a}),c.attr=(a,l)=>o({...n,attrs:{...n.attrs,[a]:l}}),c}return o({attrs:{},children:null})}return t.view=t,t.settings=e=>Ae({...r,...e}),t}var x=m`
1
+ var Pe=Object.defineProperty;var ke=(r,t)=>{for(var e in t)Pe(r,e,{get:t[e],enumerable:!0})};var rt=globalThis,st=rt.ShadowRoot&&(rt.ShadyCSS===void 0||rt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ct=Symbol(),Qt=new WeakMap,q=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==Ct)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(st&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=Qt.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Qt.set(e,t))}return t}toString(){return this.cssText}},Jt=r=>new q(typeof r=="string"?r:r+"",void 0,Ct),m=(r,...t)=>{let e=r.length===1?r[0]:t.reduce(((s,o,n)=>s+(i=>{if(i._$cssResult$===!0)return i.cssText;if(typeof i=="number")return i;throw Error("Value passed to 'css' function must be a 'css' function result: "+i+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+r[n+1]),r[0]);return new q(e,r,Ct)},ot=(r,t)=>{if(st)r.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(let e of t){let s=document.createElement("style"),o=rt.litNonce;o!==void 0&&s.setAttribute("nonce",o),s.textContent=e.cssText,r.appendChild(s)}},H=st?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return Jt(e)})(r):r;var{is:Oe,defineProperty:Te,getOwnPropertyDescriptor:je,getOwnPropertyNames:Me,getOwnPropertySymbols:Ue,getPrototypeOf:He}=Object,nt=globalThis,Gt=nt.trustedTypes,Re=Gt?Gt.emptyScript:"",Ne=nt.reactiveElementPolyfillSupport,W=(r,t)=>r,Pt={toAttribute(r,t){switch(t){case Boolean:r=r?Re:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,t){let e=r;switch(t){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},Xt=(r,t)=>!Oe(r,t),Yt={attribute:!0,type:String,converter:Pt,reflect:!1,useDefault:!1,hasChanged:Xt};Symbol.metadata??=Symbol("metadata"),nt.litPropertyMetadata??=new WeakMap;var _=class 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){let s=Symbol(),o=this.getPropertyDescriptor(t,s,e);o!==void 0&&Te(this.prototype,t,o)}}static getPropertyDescriptor(t,e,s){let{get:o,set:n}=je(this.prototype,t)??{get(){return this[e]},set(i){this[e]=i}};return{get:o,set(i){let c=o?.call(this);n?.call(this,i),this.requestUpdate(t,c,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Yt}static _$Ei(){if(this.hasOwnProperty(W("elementProperties")))return;let t=He(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(W("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(W("properties"))){let e=this.properties,s=[...Me(e),...Ue(e)];for(let o of s)this.createProperty(o,e[o])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,o]of e)this.elementProperties.set(s,o)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let o=this._$Eu(e,s);o!==void 0&&this._$Eh.set(o,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let o of s)e.unshift(H(o))}else t!==void 0&&e.push(H(t));return e}static _$Eu(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?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),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ot(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){let s=this.constructor.elementProperties.get(t),o=this.constructor._$Eu(t,s);if(o!==void 0&&s.reflect===!0){let n=(s.converter?.toAttribute!==void 0?s.converter:Pt).toAttribute(e,s.type);this._$Em=t,n==null?this.removeAttribute(o):this.setAttribute(o,n),this._$Em=null}}_$AK(t,e){let s=this.constructor,o=s._$Eh.get(t);if(o!==void 0&&this._$Em!==o){let n=s.getPropertyOptions(o),i=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:Pt;this._$Em=o,this[o]=i.fromAttribute(e,n.type)??this._$Ej?.get(o)??null,this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){let o=this.constructor,n=this[t];if(s??=o.getPropertyOptions(t),!((s.hasChanged??Xt)(n,e)||s.useDefault&&s.reflect&&n===this._$Ej?.get(t)&&!this.hasAttribute(o._$Eu(t,s))))return;this.C(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:o,wrapped:n},i){s&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,i??e??this[t]),n!==!0||i!==void 0)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),o===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[o,n]of this._$Ep)this[o]=n;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[o,n]of s){let{wrapped:i}=n,c=this[o];i!==!0||this._$AL.has(o)||c===void 0||this.C(o,void 0,n,c)}}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((s=>s.hostUpdate?.())),this.update(e)):this._$EM()}catch(s){throw t=!1,this._$EM(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((e=>e.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((e=>this._$ET(e,this[e]))),this._$EM()}updated(t){}firstUpdated(t){}};_.elementStyles=[],_.shadowRootOptions={mode:"open"},_[W("elementProperties")]=new Map,_[W("finalized")]=new Map,Ne?.({ReactiveElement:_}),(nt.reactiveElementVersions??=[]).push("2.1.0");var Ot=globalThis,it=Ot.trustedTypes,te=it?it.createPolicy("lit-html",{createHTML:r=>r}):void 0,Tt="$lit$",w=`lit$${Math.random().toFixed(9).slice(2)}$`,jt="?"+w,ze=`<${jt}>`,P=document,Z=()=>P.createComment(""),K=r=>r===null||typeof r!="object"&&typeof r!="function",Mt=Array.isArray,ie=r=>Mt(r)||typeof r?.[Symbol.iterator]=="function",kt=`[
2
+ \f\r]`,F=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ee=/-->/g,re=/>/g,B=RegExp(`>|${kt}(?:([^\\s"'>=/]+)(${kt}*=${kt}*(?:[^
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),se=/'/g,oe=/"/g,ae=/^(?:script|style|textarea|title)$/i,Ut=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),v=Ut(1),zr=Ut(2),Dr=Ut(3),k=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),ne=new WeakMap,C=P.createTreeWalker(P,129);function ce(r,t){if(!Mt(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return te!==void 0?te.createHTML(t):t}var le=(r,t)=>{let e=r.length-1,s=[],o,n=t===2?"<svg>":t===3?"<math>":"",i=F;for(let c=0;c<e;c++){let a=r[c],l,h,u=-1,y=0;for(;y<a.length&&(i.lastIndex=y,h=i.exec(a),h!==null);)y=i.lastIndex,i===F?h[1]==="!--"?i=ee:h[1]!==void 0?i=re:h[2]!==void 0?(ae.test(h[2])&&(o=RegExp("</"+h[2],"g")),i=B):h[3]!==void 0&&(i=B):i===B?h[0]===">"?(i=o??F,u=-1):h[1]===void 0?u=-2:(u=i.lastIndex-h[2].length,l=h[1],i=h[3]===void 0?B:h[3]==='"'?oe:se):i===oe||i===se?i=B:i===ee||i===re?i=F:(i=B,o=void 0);let A=i===B&&r[c+1].startsWith("/>")?" ":"";n+=i===F?a+ze:u>=0?(s.push(l),a.slice(0,u)+Tt+a.slice(u)+w+A):a+w+(u===-2?c:A)}return[ce(r,n+(r[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]},Q=class r{constructor({strings:t,_$litType$:e},s){let o;this.parts=[];let n=0,i=0,c=t.length-1,a=this.parts,[l,h]=le(t,e);if(this.el=r.createElement(l,s),C.currentNode=this.el.content,e===2||e===3){let u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(o=C.nextNode())!==null&&a.length<c;){if(o.nodeType===1){if(o.hasAttributes())for(let u of o.getAttributeNames())if(u.endsWith(Tt)){let y=h[i++],A=o.getAttribute(u).split(w),et=/([.?@])?(.*)/.exec(y);a.push({type:1,index:n,name:et[2],strings:A,ctor:et[1]==="."?ct:et[1]==="?"?lt:et[1]==="@"?pt:T}),o.removeAttribute(u)}else u.startsWith(w)&&(a.push({type:6,index:n}),o.removeAttribute(u));if(ae.test(o.tagName)){let u=o.textContent.split(w),y=u.length-1;if(y>0){o.textContent=it?it.emptyScript:"";for(let A=0;A<y;A++)o.append(u[A],Z()),C.nextNode(),a.push({type:2,index:++n});o.append(u[y],Z())}}}else if(o.nodeType===8)if(o.data===jt)a.push({type:2,index:n});else{let u=-1;for(;(u=o.data.indexOf(w,u+1))!==-1;)a.push({type:7,index:n}),u+=w.length-1}n++}}static createElement(t,e){let s=P.createElement("template");return s.innerHTML=t,s}};function O(r,t,e=r,s){if(t===k)return t;let o=s!==void 0?e._$Co?.[s]:e._$Cl,n=K(t)?void 0:t._$litDirective$;return o?.constructor!==n&&(o?._$AO?.(!1),n===void 0?o=void 0:(o=new n(r),o._$AT(r,e,s)),s!==void 0?(e._$Co??=[])[s]=o:e._$Cl=o),o!==void 0&&(t=O(r,o._$AS(r,t.values),o,s)),t}var at=class{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){let{el:{content:e},parts:s}=this._$AD,o=(t?.creationScope??P).importNode(e,!0);C.currentNode=o;let n=C.nextNode(),i=0,c=0,a=s[0];for(;a!==void 0;){if(i===a.index){let l;a.type===2?l=new R(n,n.nextSibling,this,t):a.type===1?l=new a.ctor(n,a.name,a.strings,this,t):a.type===6&&(l=new ut(n,this,t)),this._$AV.push(l),a=s[++c]}i!==a?.index&&(n=C.nextNode(),i++)}return C.currentNode=P,o}p(t){let e=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}},R=class r{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,o){this.type=2,this._$AH=d,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,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=O(this,t,e),K(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==k&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):ie(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!==d&&K(this._$AH)?this._$AA.nextSibling.data=t:this.T(P.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:s}=t,o=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=Q.createElement(ce(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===o)this._$AH.p(e);else{let n=new at(o,this),i=n.u(this.options);n.p(e),this.T(i),this._$AH=n}}_$AC(t){let e=ne.get(t.strings);return e===void 0&&ne.set(t.strings,e=new Q(t)),e}k(t){Mt(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,s,o=0;for(let n of t)o===e.length?e.push(s=new r(this.O(Z()),this.O(Z()),this,this.options)):s=e[o],s._$AI(n),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&&t!==this._$AB;){let s=t.nextSibling;t.remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},T=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,o,n){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=o,this.options=n,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=d}_$AI(t,e=this,s,o){let n=this.strings,i=!1;if(n===void 0)t=O(this,t,e,0),i=!K(t)||t!==this._$AH&&t!==k,i&&(this._$AH=t);else{let c=t,a,l;for(t=n[0],a=0;a<n.length-1;a++)l=O(this,c[s+a],e,a),l===k&&(l=this._$AH[a]),i||=!K(l)||l!==this._$AH[a],l===d?t=d:t!==d&&(t+=(l??"")+n[a+1]),this._$AH[a]=l}i&&!o&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},ct=class extends T{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}},lt=class extends T{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}},pt=class extends T{constructor(t,e,s,o,n){super(t,e,s,o,n),this.type=5}_$AI(t,e=this){if((t=O(this,t,e,0)??d)===k)return;let s=this._$AH,o=t===d&&s!==d||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==d&&(s===d||o);o&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},ut=class{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){O(this,t)}},pe={M:Tt,P:w,A:jt,C:1,L:le,R:at,D:ie,V:O,I:R,H:T,N:lt,U:pt,B:ct,F:ut},De=Ot.litHtmlPolyfillSupport;De?.(Q,R),(Ot.litHtmlVersions??=[]).push("3.3.0");var S=(r,t,e)=>{let s=e?.renderBefore??t,o=s._$litPart$;if(o===void 0){let n=e?.renderBefore??null;s._$litPart$=o=new R(t.insertBefore(Z(),n),n,void 0,e??{})}return o._$AI(r),o};var Ht=globalThis,N=class extends _{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=S(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return k}};N._$litElement$=!0,N.finalized=!0,Ht.litElementHydrateSupport?.({LitElement:N});var Ie=Ht.litElementPolyfillSupport;Ie?.({LitElement:N});(Ht.litElementVersions??=[]).push("4.2.0");var b=Object.freeze({eq(r,t){if(r.length!==t.length)return!1;for(let e=0;e<=r.length;e++)if(r.at(e)!==t.at(e))return!1;return!0},random(r){return crypto.getRandomValues(new Uint8Array(r))}});var j=Object.freeze({fromBytes(r){return[...r].map(t=>t.toString(16).padStart(2,"0")).join("")},toBytes(r){if(r.length%2!==0)throw new Error("must have even number of hex characters");let t=new Uint8Array(r.length/2);for(let e=0;e<r.length;e+=2)t[e/2]=parseInt(r.slice(e,e+2),16);return t},random(r=32){return this.fromBytes(b.random(r))},string(r){return j.fromBytes(r)},bytes(r){return j.toBytes(r)}});var Rt=58,ht="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",Nt=Object.freeze({fromBytes(r){let t=BigInt("0x"+j.fromBytes(r)),e="";for(;t>0;){let s=t%BigInt(Rt);t=t/BigInt(Rt),e=ht[Number(s)]+e}for(let s of r)if(s===0)e=ht[0]+e;else break;return e},toBytes(r){let t=BigInt(0);for(let i of r){let c=ht.indexOf(i);if(c===-1)throw new Error(`Invalid character '${i}' in base58 string`);t=t*BigInt(Rt)+BigInt(c)}let e=t.toString(16);e.length%2!==0&&(e="0"+e);let s=j.toBytes(e),o=0;for(let i of r)if(i===ht[0])o++;else break;let n=new Uint8Array(o+s.length);return n.set(s,o),n},random(r=32){return this.fromBytes(b.random(r))},string(r){return Nt.fromBytes(r)},bytes(r){return Nt.toBytes(r)}});var ue=class{lexicon;static lexicons=Object.freeze({base2:{characters:"01"},hex:{characters:"0123456789abcdef"},base36:{characters:"0123456789abcdefghijklmnopqrstuvwxyz"},base58:{characters:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"},base62:{characters:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"},base64url:{negativePrefix:"~",characters:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"},base64:{characters:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",padding:{character:"=",size:4}}});lookup;negativePrefix;constructor(t){this.lexicon=t,this.lookup=Object.fromEntries([...t.characters].map((e,s)=>[e,s])),this.negativePrefix=t.negativePrefix??"-"}toBytes(t){let e=Math.log2(this.lexicon.characters.length);if(Number.isInteger(e)){let c=0,a=0,l=[];for(let h of t){if(h===this.lexicon.padding?.character)continue;let u=this.lookup[h];if(u===void 0)throw new Error(`Invalid character: ${h}`);for(c=c<<e|u,a+=e;a>=8;)a-=8,l.push(c>>a&255)}return new Uint8Array(l)}let s=0n,o=BigInt(this.lexicon.characters.length),n=!1;t.startsWith(this.negativePrefix)&&(t=t.slice(this.negativePrefix.length),n=!0);for(let c of t){let a=this.lookup[c];if(a===void 0)throw new Error(`Invalid character: ${c}`);s=s*o+BigInt(a)}let i=[];for(;s>0n;)i.unshift(Number(s%256n)),s=s/256n;return new Uint8Array(i)}fromBytes(t){let e=Math.log2(this.lexicon.characters.length);if(Number.isInteger(e)){let i=0,c=0,a="";for(let l of t)for(i=i<<8|l,c+=8;c>=e;){c-=e;let h=i>>c&(1<<e)-1;a+=this.lexicon.characters[h]}if(c>0){let l=i<<e-c&(1<<e)-1;a+=this.lexicon.characters[l]}if(this.lexicon.padding)for(;a.length%this.lexicon.padding.size!==0;)a+=this.lexicon.padding.character;return a}let s=0n;for(let i of t)s=(s<<8n)+BigInt(i);if(s===0n)return this.lexicon.characters[0];let o=BigInt(this.lexicon.characters.length),n="";for(;s>0n;)n=this.lexicon.characters[Number(s%o)]+n,s=s/o;return n}toInteger(t){if(!t)return 0;let e=0n,s=!1,o=BigInt(this.lexicon.characters.length);t.startsWith(this.negativePrefix)&&(t=t.slice(this.negativePrefix.length),s=!0);for(let n of t){let i=this.lookup[n];if(i===void 0)throw new Error(`Invalid character: ${n}`);e=e*o+BigInt(i)}return Number(s?-e:e)}fromInteger(t){t=Math.floor(t);let e=t<0,s=BigInt(e?-t:t);if(s===0n)return this.lexicon.characters[0];let o=BigInt(this.lexicon.characters.length),n="";for(;s>0n;)n=this.lexicon.characters[Number(s%o)]+n,s=s/o;return e?`${this.negativePrefix}${n}`:n}random(t=32){return this.fromBytes(b.random(t))}};var zt=Object.freeze({fromBytes(r){return typeof btoa=="function"?btoa(String.fromCharCode(...r)):Buffer.from(r).toString("base64")},toBytes(r){return typeof atob=="function"?Uint8Array.from(atob(r),t=>t.charCodeAt(0)):Uint8Array.from(Buffer.from(r,"base64"))},random(r=32){return this.fromBytes(b.random(r))},string(r){return zt.fromBytes(r)},bytes(r){return zt.toBytes(r)}});var he=Object.freeze({fromBytes(r){return new TextDecoder().decode(r)},toBytes(r){return new TextEncoder().encode(r)},string(r){return he.fromBytes(r)},bytes(r){return he.toBytes(r)}});function ft(r,t){let e,s,o=[];function n(){e=[],s&&clearTimeout(s),s=void 0,o=[]}return n(),((...i)=>{e=i,s&&clearTimeout(s);let c=new Promise((a,l)=>{o.push({resolve:a,reject:l})});return s=setTimeout(()=>{Promise.resolve().then(()=>t(...e)).then(a=>{for(let{resolve:l}of o)l(a);n()}).catch(a=>{for(let{reject:l}of o)l(a);n()})},r),c})}var Dt=Object.freeze({set:r=>r!=null,unset:r=>r==null,boolean:r=>typeof r=="boolean",number:r=>typeof r=="number",string:r=>typeof r=="string",bigint:r=>typeof r=="bigint",object:r=>typeof r=="object"&&r!==null,array:r=>Array.isArray(r),fn:r=>typeof r=="function",symbol:r=>typeof r=="symbol"});function J(){let r,t,e=new Promise((o,n)=>{r=o,t=n});function s(o){return o.then(r).catch(t),e}return{promise:e,resolve:r,reject:t,entangle:s}}var z=class r extends Map{static require(t,e){if(t.has(e))return t.get(e);throw new Error(`required key not found: "${e}"`)}static guarantee(t,e,s){if(t.has(e))return t.get(e);{let o=s();return t.set(e,o),o}}array(){return[...this]}require(t){return r.require(this,t)}guarantee(t,e){return r.guarantee(this,t,e)}};var fe=(r=0)=>new Promise(t=>setTimeout(t,r));function Le(r){return{map:t=>de(r,t),filter:t=>me(r,t)}}Le.pipe=Object.freeze({map:r=>(t=>de(t,r)),filter:r=>(t=>me(t,r))});var de=(r,t)=>Object.fromEntries(Object.entries(r).map(([e,s])=>[e,t(s,e)])),me=(r,t)=>Object.fromEntries(Object.entries(r).filter(([e,s])=>t(s,e)));function ye(){let r=new Set;function t(n){return r.add(n),()=>{r.delete(n)}}async function e(...n){await Promise.all([...r].map(i=>i(...n)))}async function s(){let{promise:n,resolve:i}=J(),c=t((...a)=>{i(a),c()});return n}function o(){r.clear()}return t.pub=e,t.sub=t,t.on=t,t.next=s,t.clear=o,e.pub=e,e.sub=t,e.on=t,e.next=s,e.clear=o,[e,t]}function dt(r){let t=ye()[1];return r&&t.sub(r),t}function It(r){let t=ye()[0];return r&&t.sub(r),t}function mt(r){let t,e=!1,s=()=>{e=!0,clearTimeout(t)},o=async()=>{e||(await r(s),!e&&(t=setTimeout(o,0)))};return o(),s}var Lt=class{#t=[];#e=new WeakMap;#r=[];#o=new Set;see(t){this.#t.at(-1)?.add(t)}seen(t){this.#t.push(new Set);let e=t();return{seen:this.#t.pop(),result:e}}async change(t){if(this.#o.has(t))throw new Error("circularity forbidden");let e=this.#s(t).pub();return this.#r.at(-1)?.add(e),e}changed(t,e){return this.#s(t)(async()=>{let s=new Set;this.#r.push(s),this.#o.add(t),s.add(e()),this.#o.delete(t),await Promise.all(s),this.#r.pop()})}#s(t){let e=this.#e.get(t);return e||(e=dt(),this.#e.set(t,e)),e}},Ve=Symbol.for("e280.tracker.v2"),g=globalThis[Ve]??=new Lt;var{I:rn}=pe;var ge=r=>r.strings===void 0;var be={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},gt=r=>(...t)=>({_$litDirective$:r,values:t}),yt=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var G=(r,t)=>{let e=r._$AN;if(e===void 0)return!1;for(let s of e)s._$AO?.(t,!1),G(s,t);return!0},bt=r=>{let t,e;do{if((t=r._$AM)===void 0)break;e=t._$AN,e.delete(r),r=t}while(e?.size===0)},xe=r=>{for(let t;t=r._$AM;r=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(r))break;e.add(r),Fe(t)}};function qe(r){this._$AN!==void 0?(bt(this),this._$AM=r,xe(this)):this._$AM=r}function We(r,t=!1,e=0){let s=this._$AH,o=this._$AN;if(o!==void 0&&o.size!==0)if(t)if(Array.isArray(s))for(let n=e;n<s.length;n++)G(s[n],!1),bt(s[n]);else s!=null&&(G(s,!1),bt(s));else G(this,r)}var Fe=r=>{r.type==be.CHILD&&(r._$AP??=We,r._$AQ??=qe)},xt=class extends yt{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,s){super._$AT(t,e,s),xe(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(G(this,t),bt(this))}setValue(t){if(ge(this._$Ct))this._$Ct._$AI(t,this);else{let e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}};function $e(r){return r.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function $t(r,t={}){let{soft:e=!1,upgrade:s=!0}=t;for(let[o,n]of Object.entries(r)){let i=$e(o),c=customElements.get(i);e&&c||(customElements.define(i,n),s&&document.querySelectorAll(i).forEach(a=>{a.constructor===HTMLElement&&customElements.upgrade(a)}))}}function _e(r,t){for(let[e,s]of Object.entries(t))s===void 0||s===null?r.removeAttribute(e):typeof s=="string"?r.setAttribute(e,s):typeof s=="number"?r.setAttribute(e,s.toString()):typeof s=="boolean"?s===!0?r.setAttribute(e,""):r.removeAttribute(e):console.warn(`invalid attribute type ${e} is ${typeof s}`)}function _t(r,t){ot(r,Ze(t))}function Ze(r){let t=[];if(Array.isArray(r)){let e=new Set(r.flat(1/0).reverse());for(let s of e)t.unshift(H(s))}else r!==void 0&&t.push(H(r));return t}function Vt(r,t=r){let{seen:e,result:s}=g.seen(r),o=ft(0,t),n=[],i=()=>n.forEach(c=>c());for(let c of e){let a=g.changed(c,o);n.push(a)}return{result:s,dispose:i}}var Ke={compare:(r,t)=>r===t};function D(r={}){return{...Ke,...r}}var wt=class{sneak;constructor(t){this.sneak=t}get(){return g.see(this),this.sneak}get value(){return this.get()}},At=class extends wt{on=dt();dispose(){this.on.clear()}},Y=class extends At{_options;kind="signal";_lock=!1;constructor(t,e){super(t),this._options=e}async set(t){return!this._options.compare(this.sneak,t)&&await this.publish(t),t}get value(){return this.get()}set value(t){this.set(t)}async publish(t=this.get()){if(this._lock)throw new Error("forbid circularity");let e=Promise.resolve();try{this._lock=!0,this.sneak=t,e=Promise.all([g.change(this),this.on.pub(t)])}finally{this._lock=!1}return await e,t}},X=class extends wt{_formula;_options;kind="lazy";_dirty=!1;_effect;constructor(t,e){super(void 0),this._formula=t,this._options=e}get(){if(!this._effect){let{result:t,dispose:e}=Vt(this._formula,()=>this._dirty=!0);this._effect=e,this.sneak=t}if(this._dirty){this._dirty=!1;let t=this._formula();!this._options.compare(this.sneak,t)&&(this.sneak=t,g.change(this))}return super.get()}get value(){return this.get()}dispose(){this._effect&&this._effect()}},tt=class extends At{_effect;static make(t,e,s){let{result:o,dispose:n}=Vt(e,async()=>{let i=e();!s.compare(t.sneak,i)&&(t.sneak=i,await Promise.all([g.change(t),t.on.pub(i)]))});return new this(o,n)}kind="derived";constructor(t,e){super(t),this._effect=e}get value(){return this.get()}dispose(){super.dispose(),this._effect()}};function we(r,t={}){function e(){return e.value}let s=D(t),o=new X(r,s);return Object.setPrototypeOf(e,X.prototype),Object.assign(e,o),e}function Ae(r,t={}){function e(){return e.value}let s=D(t),o=tt.make(e,r,s);return Object.setPrototypeOf(e,tt.prototype),Object.assign(e,o),e}function I(r,t={}){function e(n){return n!==void 0?e.set(n):e.get()}let s=D(t),o=new Y(r,s);return Object.setPrototypeOf(e,Y.prototype),Object.assign(e,o),e}I.lazy=we;I.derive=Ae;var M={status:r=>r[0],value:r=>r[0]==="ready"?r[1]:void 0,error:r=>r[0]==="error"?r[1]:void 0,select:(r,t)=>{switch(r[0]){case"loading":return t.loading();case"error":return t.error(r[1]);case"ready":return t.ready(r[1]);default:throw new Error("unknown op status")}},morph:(r,t)=>M.select(r,{loading:()=>["loading"],error:e=>["error",e],ready:e=>["ready",t(e)]}),all:(...r)=>{let t=[],e=[],s=0;for(let o of r)switch(o[0]){case"loading":s++;break;case"ready":t.push(o[1]);break;case"error":e.push(o[1]);break}return e.length>0?["error",e]:s===0?["ready",t]:["loading"]}};var U=class r{static loading(){return new this}static ready(t){return new this(["ready",t])}static error(t){return new this(["error",t])}static promise(t){let e=new this;return e.promise(t),e}static fn(t){return this.promise(t())}static all(...t){let e=t.map(o=>o.pod),s=M.all(...e);return new this(s)}signal;#t=It();#e=It();constructor(t=["loading"]){this.signal=I(t)}get wait(){return new Promise((t,e)=>{this.#t.next().then(t),this.#e.next().then(e)})}async setLoading(){await this.signal(["loading"])}async setReady(t){await this.signal(["ready",t]),await this.#t(t)}async setError(t){await this.signal(["error",t]),await this.#e(t)}async promise(t){await this.setLoading();try{let e=await t;return await this.setReady(e),e}catch(e){await this.setError(e)}}async fn(t){return this.promise(t())}get pod(){return this.signal()}set pod(t){this.signal(t)}get status(){return this.signal()[0]}get value(){return M.value(this.signal())}get error(){return M.error(this.signal())}get isLoading(){return this.status==="loading"}get isReady(){return this.status==="ready"}get isError(){return this.status==="error"}require(){let t=this.signal();if(t[0]!=="ready")throw new Error("required value not ready");return t[1]}select(t){return M.select(this.signal(),t)}morph(t){return new r(M.morph(this.pod,t))}};var vt=class{#t=[];#e=[];mount(t){this.#t.push(t),this.#e.push(t())}unmountAll(){for(let t of this.#e)t();this.#e=[]}remountAll(){for(let t of this.#t)this.#e.push(t())}};var qt=Symbol(),Wt=Symbol(),Ft=Symbol(),St=class{element;shadow;render;#t=0;#e=0;#r=new z;#o=J();#s=new vt;[qt](t){this.#t++,this.#e=0,this.#o=J();let e=t();return this.#o.resolve(),e}[Wt](){this.#s.unmountAll()}[Ft](){this.#s.remountAll()}constructor(t,e,s){this.element=t,this.shadow=e,this.render=s}get renderCount(){return this.#t}get rendered(){return this.#o.promise}name(t){this.once(()=>this.element.setAttribute("view",t))}styles(...t){this.once(()=>_t(this.shadow,t))}once(t){return this.#r.guarantee(this.#e++,t)}mount(t){return this.once(()=>this.#s.mount(t))}life(t){let e;return this.mount(()=>{let[s,o]=t();return e=s,o}),e}op={fn:t=>this.once(()=>U.fn(t)),promise:t=>this.once(()=>U.promise(t))};signal(t){return this.once(()=>I(t))}};var x=ve({mode:"open"}),Zt=class extends HTMLElement{};$t({SlyView:Zt},{soft:!0,upgrade:!0});function ve(r){function t(e){let s=i=>class extends xt{#t=i.getElement();#e=this.#t.attachShadow(r);#r=new St(this.#t,this.#e,()=>this.#i());#o=(()=>{let a=e(this.#r);return this.#t.setAttribute("view",r.name??""),r.styles&&_t(this.#e,r.styles),a})();#s=new z;#n;#i(){if(!this.#n||!this.isConnected)return;let{with:a,props:l}=this.#n;this.#r[qt](()=>{_e(this.#t,a.attrs);let{result:h,seen:u}=g.seen(()=>this.#o(...l));S(h,this.#e);for(let y of u)this.#s.guarantee(y,()=>g.changed(y,async()=>this.#a()));i.isComponent||S(a.children,this.#t)})}#a=ft(0,()=>this.#i());render(a,l){return this.#n={with:a,props:l},this.#i(),i.isComponent?null:this.#t}disconnected(){this.#r[Wt]();for(let a of this.#s.values())a();this.#s.clear()}reconnected(){this.#r[Ft]()}},o=gt(s({getElement:()=>document.createElement(r.tag??"sly-view"),isComponent:!1}));function n(i){let c=(...a)=>o(i,a);return c.props=c,c.with=a=>n({...i,...a}),c.children=(...a)=>n({...i,children:a}),c.attrs=a=>n({...i,attrs:a}),c.attr=(a,l)=>n({...i,attrs:{...i.attrs,[a]:l}}),c.component=(...a)=>class extends HTMLElement{#t=gt(s({getElement:()=>this,isComponent:!0}));constructor(){super(),this.render(...a)}render(...l){this.isConnected&&S(this.#t(i,l),this)}},c}return n({attrs:{},children:null})}return t.view=t,t.settings=e=>ve({...r,...e}),t.component=e=>t(s=>()=>e(s)).component(),t}var $=m`
4
4
  @layer reset {
5
5
  * {
6
6
  margin: 0;
@@ -16,33 +16,37 @@ var Pe=Object.defineProperty;var ke=(r,t)=>{for(var e in t)Pe(r,e,{get:t[e],enum
16
16
  ::-webkit-scrollbar-thumb { background: #333; border-radius: 1em; }
17
17
  ::-webkit-scrollbar-thumb:hover { background: #444; }
18
18
  }
19
- `;var ve=b(r=>()=>{r.name("counter"),r.styles(x,Qe);let t=r.once(()=>Date.now()),e=r.signal(0);r.mount(()=>mt(async()=>{let n=Date.now()-t;e(Math.floor(n/1e3))}));let s=r.signal(0),o=()=>s(s()+1);return v`
19
+ `;var Et=x(r=>t=>{r.name("counter"),r.styles($,Qe);let e=r.once(()=>Date.now()),s=r.signal(0);r.mount(()=>mt(async()=>{let i=Date.now()-e;s(Math.floor(i/1e3))}));let o=r.signal(t),n=()=>o(o()+1);return v`
20
+ <slot></slot>
20
21
  <div>
21
- <span>${e()}</span>
22
+ <span>${s()}</span>
22
23
  </div>
23
24
  <div>
24
- <span>${s()}</span>
25
- <button @click="${o}">+</button>
25
+ <span>${o()}</span>
26
+ <button @click="${n}">+</button>
26
27
  </div>
27
28
  `}),Qe=m`
28
29
  :host {
29
30
  display: flex;
30
- flex-direction: column;
31
31
  justify-content: center;
32
- text-align: center;
32
+ gap: 1em;
33
+ }
34
+
35
+ button {
36
+ padding: 0.2em 0.5em;
33
37
  }
34
- `;var vt={};ke(vt,{arrow:()=>Xe,bar:()=>tr,bar2:()=>er,bar3:()=>rr,bar4:()=>sr,bin:()=>br,binary:()=>xr,binary2:()=>$r,block:()=>or,block2:()=>nr,brackets:()=>pr,brackets2:()=>ur,braille:()=>Ft,bright:()=>Br,clock:()=>Ar,cylon:()=>cr,dots:()=>hr,dots2:()=>fr,earth:()=>Sr,fistbump:()=>vr,kiss:()=>wr,lock:()=>Er,moon:()=>Pr,pie:()=>ar,pulseblue:()=>_r,runner:()=>ir,slider:()=>lr,speaker:()=>Cr,spinner:()=>Ye,wave:()=>dr,wavepulse:()=>yr,wavepulse2:()=>gr,wavescrub:()=>mr});function p(r,t){return()=>Je({hz:r,frames:t})}var Je=b(r=>({hz:t,frames:e})=>{r.name("loading"),r.styles(x,Ge);let s=r.signal(0);return r.mount(()=>mt(async()=>{await ue(1e3/t);let o=s()+1;s(o>=e.length?0:o)})),e.at(s())}),Ge=m`
38
+ `;var Bt={};ke(Bt,{arrow:()=>Xe,bar:()=>tr,bar2:()=>er,bar3:()=>rr,bar4:()=>sr,bin:()=>br,binary:()=>xr,binary2:()=>$r,block:()=>or,block2:()=>nr,brackets:()=>pr,brackets2:()=>ur,braille:()=>Kt,bright:()=>Br,clock:()=>Ar,cylon:()=>cr,dots:()=>hr,dots2:()=>fr,earth:()=>Sr,fistbump:()=>vr,kiss:()=>wr,lock:()=>Er,moon:()=>Pr,pie:()=>ar,pulseblue:()=>_r,runner:()=>ir,slider:()=>lr,speaker:()=>Cr,spinner:()=>Ye,wave:()=>dr,wavepulse:()=>yr,wavepulse2:()=>gr,wavescrub:()=>mr});function p(r,t){return()=>Je({hz:r,frames:t})}var Je=x(r=>({hz:t,frames:e})=>{r.name("loading"),r.styles($,Ge);let s=r.signal(0);return r.mount(()=>mt(async()=>{await fe(1e3/t);let o=s()+1;s(o>=e.length?0:o)})),e.at(s())}),Ge=m`
35
39
  :host {
36
40
  font-family: monospace;
37
41
  white-space: pre;
38
42
  user-select: none;
39
43
  }
40
- `;var f=20,I=10,L=4,Ye=p(f,["|","/","-","\\"]),Ft=p(f,["\u2808","\u2810","\u2820","\u2880","\u2840","\u2804","\u2802","\u2801"]),Xe=p(f,["\u2B06\uFE0F","\u2197\uFE0F","\u27A1\uFE0F","\u2198\uFE0F","\u2B07\uFE0F","\u2199\uFE0F","\u2B05\uFE0F","\u2196\uFE0F"]),tr=p(f,["\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B1\u25B0\u25B1\u25B1\u25B1","\u25B1\u25B1\u25B0\u25B1\u25B1","\u25B1\u25B1\u25B1\u25B0\u25B1","\u25B1\u25B1\u25B1\u25B1\u25B0","\u25B1\u25B1\u25B1\u25B1\u25B0","\u25B1\u25B1\u25B1\u25B0\u25B1","\u25B1\u25B1\u25B0\u25B1\u25B1","\u25B1\u25B0\u25B1\u25B1\u25B1"]),er=p(f,["\u25B1\u25B1\u25B0\u25B1\u25B1","\u25B1\u25B1\u25B1\u25B0\u25B1","\u25B1\u25B1\u25B1\u25B0\u25B0","\u25B1\u25B1\u25B1\u25B0\u25B0","\u25B1\u25B1\u25B1\u25B1\u25B0","\u25B1\u25B1\u25B1\u25B1\u25B0","\u25B1\u25B1\u25B1\u25B1\u25B0","\u25B1\u25B1\u25B1\u25B0\u25B0","\u25B1\u25B1\u25B1\u25B0\u25B0","\u25B1\u25B1\u25B1\u25B0\u25B1","\u25B1\u25B1\u25B0\u25B1\u25B1","\u25B1\u25B0\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B1\u25B1\u25B1","\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B1\u25B1\u25B1","\u25B1\u25B0\u25B1\u25B1\u25B1"]),rr=p(f,["\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B1\u25B1","\u25B1\u25B0\u25B0\u25B0\u25B1","\u25B1\u25B1\u25B0\u25B0\u25B0","\u25B1\u25B1\u25B1\u25B0\u25B0","\u25B1\u25B1\u25B1\u25B1\u25B0","\u25B1\u25B1\u25B1\u25B1\u25B0","\u25B1\u25B1\u25B1\u25B0\u25B0","\u25B1\u25B1\u25B0\u25B0\u25B0","\u25B1\u25B0\u25B0\u25B0\u25B1","\u25B0\u25B0\u25B0\u25B1\u25B1","\u25B0\u25B0\u25B1\u25B1\u25B1"]),sr=p(f,["\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0","\u25B0\u25B0\u25B0\u25B0\u25B0","\u25B1\u25B0\u25B0\u25B0\u25B0","\u25B1\u25B1\u25B0\u25B0\u25B0","\u25B1\u25B1\u25B1\u25B0\u25B0","\u25B1\u25B1\u25B1\u25B1\u25B0"]),or=p(f,["\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581","\u2588\u2581\u2581\u2581\u2581","\u2588\u2588\u2581\u2581\u2581","\u2588\u2588\u2588\u2581\u2581","\u2588\u2588\u2588\u2588\u2581","\u2588\u2588\u2588\u2588\u2588","\u2588\u2588\u2588\u2588\u2588","\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2588"]),nr=p(f,["\u2588\u2581\u2581\u2581\u2581","\u2588\u2581\u2581\u2581\u2581","\u2588\u2588\u2581\u2581\u2581","\u2588\u2588\u2588\u2581\u2581","\u2588\u2588\u2588\u2588\u2581","\u2588\u2588\u2588\u2588\u2588","\u2588\u2588\u2588\u2588\u2588","\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2588\u2588\u2588","\u2581\u2588\u2588\u2588\u2588","\u2588\u2588\u2588\u2588\u2588","\u2588\u2588\u2588\u2588\u2588","\u2588\u2588\u2588\u2588\u2581","\u2588\u2588\u2588\u2581\u2581","\u2588\u2588\u2581\u2581\u2581"]),ir=p(L,["\u{1F6B6}","\u{1F3C3}"]),ar=p(I,["\u25F7","\u25F6","\u25F5","\u25F4"]),cr=p(f,["=----","-=---","--=--","---=-","----=","----=","---=-","--=--","-=---","=----"]),lr=p(f,["o----","-o---","--o--","---o-","----o","----o","---o-","--o--","-o---","o----"]),pr=p(I,["[ ]","[ ]","[= ]","[== ]","[===]","[ ==]","[ =]"]),ur=p(I,["[ ]","[ ]","[= ]","[== ]","[===]","[ ==]","[ =]","[ ]","[ ]","[ =]","[ ==]","[===]","[== ]","[= ]"]),hr=p(I,[" "," ",". ",".. ","..."," .."," ."]),fr=p(f,[". ",". ",".. ","..."," .."," ."," ."," ..","...",".. "]),dr=p(f,[".....",".....",":....","::...",":::..","::::.",":::::",":::::",".::::","..:::","...::","....:"]),mr=p(f,[":....",":....","::...",".::..","..::.","...::","....:","....:","...::","..::.",".::..","::..."]),yr=p(f,[".....",".....","..:..",".:::.",".:::.",":::::",":::::","::.::",":...:"]),gr=p(f,[".....",".....","..:..",".:::.",".:::.",":::::",":::::","::.::",":...:",".....",".....",":...:","::.::",":::::",":::::",".:::.",".:::.","..:.."]),br=p(f,["000","100","110","111","011","001"]),xr=p(f,["11111","01111","00111","10011","11001","01100","00110","10011","11001","11100","11110"]),$r=p(f,["11111","01111","10111","11011","11101","11110","11111","11110","11101","11011","10111","01111"]),_r=p(L,["\u{1F539}","\u{1F535}"]),wr=p(I,["\u{1F642}","\u{1F642}","\u{1F617}","\u{1F619}","\u{1F618}","\u{1F618}","\u{1F619}"]),Ar=p(f,["\u{1F550}","\u{1F551}","\u{1F552}","\u{1F553}","\u{1F554}","\u{1F555}","\u{1F556}","\u{1F557}","\u{1F558}","\u{1F559}","\u{1F55A}","\u{1F55B}"]),vr=p(f,["\u{1F91C} \u{1F91B}","\u{1F91C} \u{1F91B}","\u{1F91C} \u{1F91B}"," \u{1F91C} \u{1F91B} "," \u{1F91C}\u{1F91B} "," \u{1F91C}\u{1F91B} "," \u{1F91C}\u{1F4A5}\u{1F91B} ","\u{1F91C} \u{1F4A5} \u{1F91B}","\u{1F91C} \u2728 \u{1F91B}","\u{1F91C} \u2728 \u{1F91B}"]),Sr=p(L,["\u{1F30E}","\u{1F30F}","\u{1F30D}"]),Er=p(L,["\u{1F513}","\u{1F512}"]),Br=p(L,["\u{1F505}","\u{1F506}"]),Cr=p(L,["\u{1F508}","\u{1F508}","\u{1F509}","\u{1F50A}","\u{1F50A}","\u{1F509}"]),Pr=p(I,["\u{1F311}","\u{1F311}","\u{1F311}","\u{1F318}","\u{1F317}","\u{1F316}","\u{1F315}","\u{1F314}","\u{1F313}","\u{1F312}"]);var Se=b(r=>t=>(r.name("error"),r.styles(x,kr),typeof t=="string"?t:t instanceof Error?v`<strong>${t.name}:</strong> <span>${t.message}</span>`:"error")),kr=m`
44
+ `;var f=20,L=10,V=4,Ye=p(f,["|","/","-","\\"]),Kt=p(f,["\u2808","\u2810","\u2820","\u2880","\u2840","\u2804","\u2802","\u2801"]),Xe=p(f,["\u2B06\uFE0F","\u2197\uFE0F","\u27A1\uFE0F","\u2198\uFE0F","\u2B07\uFE0F","\u2199\uFE0F","\u2B05\uFE0F","\u2196\uFE0F"]),tr=p(f,["\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B1\u25B0\u25B1\u25B1\u25B1","\u25B1\u25B1\u25B0\u25B1\u25B1","\u25B1\u25B1\u25B1\u25B0\u25B1","\u25B1\u25B1\u25B1\u25B1\u25B0","\u25B1\u25B1\u25B1\u25B1\u25B0","\u25B1\u25B1\u25B1\u25B0\u25B1","\u25B1\u25B1\u25B0\u25B1\u25B1","\u25B1\u25B0\u25B1\u25B1\u25B1"]),er=p(f,["\u25B1\u25B1\u25B0\u25B1\u25B1","\u25B1\u25B1\u25B1\u25B0\u25B1","\u25B1\u25B1\u25B1\u25B0\u25B0","\u25B1\u25B1\u25B1\u25B0\u25B0","\u25B1\u25B1\u25B1\u25B1\u25B0","\u25B1\u25B1\u25B1\u25B1\u25B0","\u25B1\u25B1\u25B1\u25B1\u25B0","\u25B1\u25B1\u25B1\u25B0\u25B0","\u25B1\u25B1\u25B1\u25B0\u25B0","\u25B1\u25B1\u25B1\u25B0\u25B1","\u25B1\u25B1\u25B0\u25B1\u25B1","\u25B1\u25B0\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B1\u25B1\u25B1","\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B1\u25B1\u25B1","\u25B1\u25B0\u25B1\u25B1\u25B1"]),rr=p(f,["\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B1\u25B1","\u25B1\u25B0\u25B0\u25B0\u25B1","\u25B1\u25B1\u25B0\u25B0\u25B0","\u25B1\u25B1\u25B1\u25B0\u25B0","\u25B1\u25B1\u25B1\u25B1\u25B0","\u25B1\u25B1\u25B1\u25B1\u25B0","\u25B1\u25B1\u25B1\u25B0\u25B0","\u25B1\u25B1\u25B0\u25B0\u25B0","\u25B1\u25B0\u25B0\u25B0\u25B1","\u25B0\u25B0\u25B0\u25B1\u25B1","\u25B0\u25B0\u25B1\u25B1\u25B1"]),sr=p(f,["\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0","\u25B0\u25B0\u25B0\u25B0\u25B0","\u25B1\u25B0\u25B0\u25B0\u25B0","\u25B1\u25B1\u25B0\u25B0\u25B0","\u25B1\u25B1\u25B1\u25B0\u25B0","\u25B1\u25B1\u25B1\u25B1\u25B0"]),or=p(f,["\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581","\u2588\u2581\u2581\u2581\u2581","\u2588\u2588\u2581\u2581\u2581","\u2588\u2588\u2588\u2581\u2581","\u2588\u2588\u2588\u2588\u2581","\u2588\u2588\u2588\u2588\u2588","\u2588\u2588\u2588\u2588\u2588","\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2588"]),nr=p(f,["\u2588\u2581\u2581\u2581\u2581","\u2588\u2581\u2581\u2581\u2581","\u2588\u2588\u2581\u2581\u2581","\u2588\u2588\u2588\u2581\u2581","\u2588\u2588\u2588\u2588\u2581","\u2588\u2588\u2588\u2588\u2588","\u2588\u2588\u2588\u2588\u2588","\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2588\u2588\u2588","\u2581\u2588\u2588\u2588\u2588","\u2588\u2588\u2588\u2588\u2588","\u2588\u2588\u2588\u2588\u2588","\u2588\u2588\u2588\u2588\u2581","\u2588\u2588\u2588\u2581\u2581","\u2588\u2588\u2581\u2581\u2581"]),ir=p(V,["\u{1F6B6}","\u{1F3C3}"]),ar=p(L,["\u25F7","\u25F6","\u25F5","\u25F4"]),cr=p(f,["=----","-=---","--=--","---=-","----=","----=","---=-","--=--","-=---","=----"]),lr=p(f,["o----","-o---","--o--","---o-","----o","----o","---o-","--o--","-o---","o----"]),pr=p(L,["[ ]","[ ]","[= ]","[== ]","[===]","[ ==]","[ =]"]),ur=p(L,["[ ]","[ ]","[= ]","[== ]","[===]","[ ==]","[ =]","[ ]","[ ]","[ =]","[ ==]","[===]","[== ]","[= ]"]),hr=p(L,[" "," ",". ",".. ","..."," .."," ."]),fr=p(f,[". ",". ",".. ","..."," .."," ."," ."," ..","...",".. "]),dr=p(f,[".....",".....",":....","::...",":::..","::::.",":::::",":::::",".::::","..:::","...::","....:"]),mr=p(f,[":....",":....","::...",".::..","..::.","...::","....:","....:","...::","..::.",".::..","::..."]),yr=p(f,[".....",".....","..:..",".:::.",".:::.",":::::",":::::","::.::",":...:"]),gr=p(f,[".....",".....","..:..",".:::.",".:::.",":::::",":::::","::.::",":...:",".....",".....",":...:","::.::",":::::",":::::",".:::.",".:::.","..:.."]),br=p(f,["000","100","110","111","011","001"]),xr=p(f,["11111","01111","00111","10011","11001","01100","00110","10011","11001","11100","11110"]),$r=p(f,["11111","01111","10111","11011","11101","11110","11111","11110","11101","11011","10111","01111"]),_r=p(V,["\u{1F539}","\u{1F535}"]),wr=p(L,["\u{1F642}","\u{1F642}","\u{1F617}","\u{1F619}","\u{1F618}","\u{1F618}","\u{1F619}"]),Ar=p(f,["\u{1F550}","\u{1F551}","\u{1F552}","\u{1F553}","\u{1F554}","\u{1F555}","\u{1F556}","\u{1F557}","\u{1F558}","\u{1F559}","\u{1F55A}","\u{1F55B}"]),vr=p(f,["\u{1F91C} \u{1F91B}","\u{1F91C} \u{1F91B}","\u{1F91C} \u{1F91B}"," \u{1F91C} \u{1F91B} "," \u{1F91C}\u{1F91B} "," \u{1F91C}\u{1F91B} "," \u{1F91C}\u{1F4A5}\u{1F91B} ","\u{1F91C} \u{1F4A5} \u{1F91B}","\u{1F91C} \u2728 \u{1F91B}","\u{1F91C} \u2728 \u{1F91B}"]),Sr=p(V,["\u{1F30E}","\u{1F30F}","\u{1F30D}"]),Er=p(V,["\u{1F513}","\u{1F512}"]),Br=p(V,["\u{1F505}","\u{1F506}"]),Cr=p(V,["\u{1F508}","\u{1F508}","\u{1F509}","\u{1F50A}","\u{1F50A}","\u{1F509}"]),Pr=p(L,["\u{1F311}","\u{1F311}","\u{1F311}","\u{1F318}","\u{1F317}","\u{1F316}","\u{1F315}","\u{1F314}","\u{1F313}","\u{1F312}"]);var Se=x(r=>t=>(r.name("error"),r.styles($,kr),typeof t=="string"?t:t instanceof Error?v`<strong>${t.name}:</strong> <span>${t.message}</span>`:"error")),kr=m`
41
45
  :host {
42
46
  font-family: monospace;
43
47
  color: red;
44
48
  }
45
- `;function Ee(r=Ft,t=e=>Se(e)){return(e,s)=>e.select({loading:r,ready:s,error:t})}var Be=b(r=>()=>{r.name("loaders"),r.styles(x,Or);let t=r.once(()=>M.loading());return r.once(()=>Object.entries(vt).map(([s,o])=>({key:s,loader:Ee(o)}))).map(({key:s,loader:o})=>v`
49
+ `;function Ee(r=Kt,t=e=>Se(e)){return(e,s)=>e.select({loading:r,ready:s,error:t})}var Be=x(r=>()=>{r.name("loaders"),r.styles($,Or);let t=r.once(()=>U.loading());return r.once(()=>Object.entries(Bt).map(([s,o])=>({key:s,loader:Ee(o)}))).map(({key:s,loader:o})=>v`
46
50
  <div data-anim="${s}">
47
51
  <span>${s}</span>
48
52
  <span>${o(t,()=>null)}</span>
@@ -88,8 +92,8 @@ div {
88
92
  min-height: 2.5em;
89
93
  }
90
94
  }
91
- `;var Ce=b(r=>()=>(r.name("demo"),r.styles(x,Tr),v`
92
- ${ve()}
95
+ `;var Ce=x(r=>()=>(r.name("demo"),r.styles($,Tr),v`
96
+ ${Et.children("view")(2)}
93
97
  ${Be()}
94
98
  `)),Tr=m`
95
99
  :host {
@@ -97,7 +101,7 @@ div {
97
101
  flex-direction: column;
98
102
  gap: 1em;
99
103
  }
100
- `;function V(r,t=document){let e=t.querySelector(r);if(!e)throw new Error(`$1 ${r} not found`);return e}function jr(r,t=document){return Array.from(t.querySelectorAll(r))}V.maybe=(r,t=document)=>t.querySelector(r);V.all=jr;V.render=(r,...t)=>O(t,r);V.render(V(".demo"),Ce());console.log("\u{1F99D} sly");
104
+ `;function E(r,t=document){let e=t.querySelector(r);if(!e)throw new Error(`$1 ${r} not found`);return e}function jr(r,t=document){return Array.from(t.querySelectorAll(r))}E.maybe=(r,t=document)=>t.querySelector(r);E.all=jr;E.render=(r,...t)=>S(t,r);E.register=$t;E.render(E(".demo"),Ce());E.register({DemoCounter:Et.component(1)});console.log("\u{1F99D} sly");
101
105
  /*! Bundled license information:
102
106
 
103
107
  @lit/reactive-element/css-tag.js: