@benev/tact 0.1.0-3 → 0.1.0-4
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 +111 -103
- package/package.json +7 -7
- package/s/core/bindings/action.ts +14 -4
- package/s/core/bindings/parts/defaults.ts +3 -1
- package/s/core/bindings/parts/lens-algo.ts +17 -13
- package/s/core/bindings/resolver.ts +12 -12
- package/s/core/bindings/sample-map.ts +25 -0
- package/s/core/bindings/types.ts +3 -1
- package/s/core/core.test.ts +46 -34
- package/s/core/devices/auto-gamepads.ts +8 -0
- package/s/core/devices/device.ts +12 -0
- package/s/core/devices/infra/group.ts +24 -0
- package/s/core/devices/infra/sampler.ts +22 -0
- package/s/core/devices/standard/gamepad.ts +83 -0
- package/s/core/{controllers → devices}/standard/index.ts +2 -1
- package/s/core/devices/standard/keyboard.ts +31 -0
- package/s/core/{controllers → devices}/standard/pointer.ts +15 -11
- package/s/core/devices/standard/primary.ts +20 -0
- package/s/core/devices/standard/stick.ts +27 -0
- package/s/core/{controllers/standard/virtual-gamepad.ts → devices/standard/vpad.ts} +9 -9
- package/s/core/{controllers → devices}/types.ts +0 -1
- package/s/core/hub/hub.ts +78 -62
- package/s/core/hub/meta-bindings.ts +23 -0
- package/s/core/hub/parts/connected.ts +15 -0
- package/s/core/hub/port.ts +26 -0
- package/s/core/hub/types.ts +5 -6
- package/s/core/index.ts +12 -14
- package/s/core/testing/testing.ts +19 -14
- package/s/deck/deck.ts +77 -0
- package/s/deck/index.ts +14 -0
- package/s/deck/parts/catalog.ts +58 -0
- package/s/deck/parts/db.ts +66 -0
- package/s/deck/parts/device-skins/device-icons.ts +38 -0
- package/s/deck/parts/device-skins/device-skin.ts +29 -0
- package/s/deck/parts/local-storage-kv.ts +8 -0
- package/s/deck/parts/merge-bindings.ts +21 -0
- package/s/deck/parts/overlay-visibility.ts +49 -0
- package/s/deck/views/deck-overlay/component.ts +48 -0
- package/s/deck/views/deck-overlay/style.css.ts +112 -0
- package/s/deck/views/framework.ts +14 -0
- package/s/demo/game/game.ts +85 -0
- package/s/demo/game/parts/agent.ts +10 -0
- package/s/demo/game/parts/game-bindings.ts +20 -0
- package/s/demo/game/parts/logic.ts +24 -0
- package/s/demo/game/parts/player.ts +32 -0
- package/s/demo/game/parts/renderer.ts +113 -0
- package/s/demo/game/parts/state.ts +24 -0
- package/s/demo/game/parts/virtual-device.ts +13 -0
- package/s/demo/main.bundle.ts +6 -12
- package/s/demo/main.css +30 -2
- package/s/demo/ui/tact-demo/component.ts +13 -0
- package/s/demo/ui/tact-demo/style.css.ts +4 -0
- package/s/demo/ui/theater/styles.css.ts +57 -0
- package/s/demo/ui/theater/view.ts +53 -0
- package/s/demo/ui/theater/virtual/style.css.ts +43 -0
- package/s/demo/ui/theater/virtual/view.ts +31 -0
- package/s/demo/ui/utils/loader.ts +5 -0
- package/s/index.html.ts +16 -6
- package/s/index.ts +3 -1
- package/s/nubs/components.ts +14 -0
- package/s/nubs/index.ts +6 -0
- package/s/nubs/lookpad/component.ts +45 -0
- package/s/nubs/stick/component.ts +115 -0
- package/s/nubs/stick/style.css.ts +70 -0
- package/s/nubs/{virtual-gamepad/view.ts → vpad/component.ts} +21 -11
- package/s/nubs/{virtual-gamepad → vpad}/styles.css.ts +1 -0
- package/s/utils/circular-clamp.ts +15 -0
- package/s/utils/dispensers.ts +20 -0
- package/s/utils/split-axis.ts +10 -2
- package/x/core/bindings/action.d.ts +3 -1
- package/x/core/bindings/action.js +12 -4
- package/x/core/bindings/action.js.map +1 -1
- package/x/core/bindings/parts/defaults.js +3 -1
- package/x/core/bindings/parts/defaults.js.map +1 -1
- package/x/core/bindings/parts/lens-algo.js +14 -7
- package/x/core/bindings/parts/lens-algo.js.map +1 -1
- package/x/core/bindings/resolver.d.ts +5 -4
- package/x/core/bindings/resolver.js +12 -10
- package/x/core/bindings/resolver.js.map +1 -1
- package/x/core/bindings/sample-map.d.ts +7 -0
- package/x/core/bindings/sample-map.js +22 -0
- package/x/core/bindings/sample-map.js.map +1 -0
- package/x/core/bindings/types.d.ts +3 -1
- package/x/core/core.test.d.ts +5 -4
- package/x/core/core.test.js +45 -34
- package/x/core/core.test.js.map +1 -1
- package/x/core/devices/auto-gamepads.d.ts +2 -0
- package/x/core/devices/auto-gamepads.js +6 -0
- package/x/core/devices/auto-gamepads.js.map +1 -0
- package/x/core/devices/device.d.ts +5 -0
- package/x/core/devices/device.js +7 -0
- package/x/core/devices/device.js.map +1 -0
- package/x/core/devices/infra/group.d.ts +8 -0
- package/x/core/devices/infra/group.js +21 -0
- package/x/core/devices/infra/group.js.map +1 -0
- package/x/core/devices/infra/sampler.d.ts +9 -0
- package/x/core/devices/infra/sampler.js +18 -0
- package/x/core/devices/infra/sampler.js.map +1 -0
- package/x/core/devices/standard/gamepad.d.ts +11 -0
- package/x/core/devices/standard/gamepad.js +65 -0
- package/x/core/devices/standard/gamepad.js.map +1 -0
- package/x/core/{controllers → devices}/standard/index.d.ts +2 -1
- package/x/core/{controllers → devices}/standard/index.js +2 -1
- package/x/core/devices/standard/index.js.map +1 -0
- package/x/core/devices/standard/keyboard.d.ts +9 -0
- package/x/core/devices/standard/keyboard.js +28 -0
- package/x/core/devices/standard/keyboard.js.map +1 -0
- package/x/core/devices/standard/pointer.d.ts +15 -0
- package/x/core/{controllers → devices}/standard/pointer.js +14 -11
- package/x/core/devices/standard/pointer.js.map +1 -0
- package/x/core/devices/standard/primary.d.ts +10 -0
- package/x/core/devices/standard/primary.js +17 -0
- package/x/core/devices/standard/primary.js.map +1 -0
- package/x/core/devices/standard/stick.d.ts +15 -0
- package/x/core/devices/standard/stick.js +24 -0
- package/x/core/devices/standard/stick.js.map +1 -0
- package/x/core/devices/standard/vpad.d.ts +7 -0
- package/x/core/{controllers/standard/virtual-gamepad.js → devices/standard/vpad.js} +10 -10
- package/x/core/devices/standard/vpad.js.map +1 -0
- package/x/core/{controllers → devices}/types.d.ts +0 -1
- package/x/core/{controllers → devices}/types.js.map +1 -1
- package/x/core/hub/hub.d.ts +27 -23
- package/x/core/hub/hub.js +71 -61
- package/x/core/hub/hub.js.map +1 -1
- package/x/core/hub/meta-bindings.d.ts +2 -0
- package/x/core/hub/meta-bindings.js +21 -0
- package/x/core/hub/meta-bindings.js.map +1 -0
- package/x/core/hub/parts/connected.d.ts +14 -0
- package/x/core/hub/parts/connected.js +12 -0
- package/x/core/hub/parts/connected.js.map +1 -0
- package/x/core/hub/port.d.ts +10 -0
- package/x/core/hub/port.js +19 -0
- package/x/core/hub/port.js.map +1 -0
- package/x/core/hub/types.d.ts +5 -5
- package/x/core/hub/types.js +1 -1
- package/x/core/hub/types.js.map +1 -1
- package/x/core/index.d.ts +12 -12
- package/x/core/index.js +12 -12
- package/x/core/index.js.map +1 -1
- package/x/core/testing/testing.d.ts +13 -11
- package/x/core/testing/testing.js +14 -13
- package/x/core/testing/testing.js.map +1 -1
- package/x/deck/deck.d.ts +35 -0
- package/x/deck/deck.js +50 -0
- package/x/deck/deck.js.map +1 -0
- package/x/deck/index.d.ts +10 -0
- package/x/deck/index.js +11 -0
- package/x/deck/index.js.map +1 -0
- package/x/deck/parts/catalog.d.ts +23 -0
- package/x/deck/parts/catalog.js +35 -0
- package/x/deck/parts/catalog.js.map +1 -0
- package/x/deck/parts/db.d.ts +20 -0
- package/x/deck/parts/db.js +52 -0
- package/x/deck/parts/db.js.map +1 -0
- package/x/deck/parts/device-skins/device-icons.d.ts +12 -0
- package/x/deck/parts/device-skins/device-icons.js +27 -0
- package/x/deck/parts/device-skins/device-icons.js.map +1 -0
- package/x/deck/parts/device-skins/device-skin.d.ts +14 -0
- package/x/deck/parts/device-skins/device-skin.js +22 -0
- package/x/deck/parts/device-skins/device-skin.js.map +1 -0
- package/x/deck/parts/local-storage-kv.js +6 -0
- package/x/deck/parts/local-storage-kv.js.map +1 -0
- package/x/deck/parts/merge-bindings.d.ts +2 -0
- package/x/deck/parts/merge-bindings.js +15 -0
- package/x/deck/parts/merge-bindings.js.map +1 -0
- package/x/deck/parts/overlay-visibility.d.ts +21 -0
- package/x/deck/parts/overlay-visibility.js +35 -0
- package/x/deck/parts/overlay-visibility.js.map +1 -0
- package/x/deck/views/deck-overlay/component.d.ts +2 -0
- package/x/deck/views/deck-overlay/component.js +40 -0
- package/x/deck/views/deck-overlay/component.js.map +1 -0
- package/x/deck/views/deck-overlay/style.css.js +109 -0
- package/x/deck/views/deck-overlay/style.css.js.map +1 -0
- package/x/deck/views/framework.d.ts +3 -0
- package/x/deck/views/framework.js +8 -0
- package/x/deck/views/framework.js.map +1 -0
- package/x/demo/game/game.d.ts +20 -0
- package/x/demo/game/game.js +63 -0
- package/x/demo/game/game.js.map +1 -0
- package/x/demo/game/parts/agent.d.ts +7 -0
- package/x/demo/game/parts/agent.js +8 -0
- package/x/demo/game/parts/agent.js.map +1 -0
- package/x/demo/game/parts/game-bindings.d.ts +15 -0
- package/x/demo/game/parts/game-bindings.js +10 -0
- package/x/demo/game/parts/game-bindings.js.map +1 -0
- package/x/demo/game/parts/logic.d.ts +8 -0
- package/x/demo/game/parts/logic.js +21 -0
- package/x/demo/game/parts/logic.js.map +1 -0
- package/x/demo/game/parts/player.d.ts +14 -0
- package/x/demo/game/parts/player.js +26 -0
- package/x/demo/game/parts/player.js.map +1 -0
- package/x/demo/game/parts/renderer.d.ts +13 -0
- package/x/demo/game/parts/renderer.js +91 -0
- package/x/demo/game/parts/renderer.js.map +1 -0
- package/x/demo/game/parts/state.d.ts +8 -0
- package/x/demo/game/parts/state.js +20 -0
- package/x/demo/game/parts/state.js.map +1 -0
- package/x/demo/game/parts/virtual-device.d.ts +8 -0
- package/x/demo/game/parts/virtual-device.js +11 -0
- package/x/demo/game/parts/virtual-device.js.map +1 -0
- package/x/demo/main.bundle.js +4 -10
- package/x/demo/main.bundle.js.map +1 -1
- package/x/demo/main.bundle.min.js +315 -54
- package/x/demo/main.bundle.min.js.map +4 -4
- package/x/demo/main.css +30 -2
- package/x/demo/ui/tact-demo/component.d.ts +4 -0
- package/x/demo/ui/tact-demo/component.js +12 -0
- package/x/demo/ui/tact-demo/component.js.map +1 -0
- package/x/demo/ui/tact-demo/style.css.d.ts +2 -0
- package/x/demo/ui/tact-demo/style.css.js +3 -0
- package/x/demo/ui/tact-demo/style.css.js.map +1 -0
- package/x/demo/ui/theater/styles.css.js +56 -0
- package/x/demo/ui/theater/styles.css.js.map +1 -0
- package/x/demo/ui/theater/view.d.ts +2 -0
- package/x/demo/ui/theater/view.js +42 -0
- package/x/demo/ui/theater/view.js.map +1 -0
- package/x/demo/ui/theater/virtual/style.css.d.ts +2 -0
- package/x/demo/ui/theater/virtual/style.css.js +42 -0
- package/x/demo/ui/theater/virtual/style.css.js.map +1 -0
- package/x/demo/ui/theater/virtual/view.d.ts +4 -0
- package/x/demo/ui/theater/virtual/view.js +19 -0
- package/x/demo/ui/theater/virtual/view.js.map +1 -0
- package/x/demo/ui/utils/loader.d.ts +1 -0
- package/x/demo/ui/utils/loader.js +3 -0
- package/x/demo/ui/utils/loader.js.map +1 -0
- package/x/index.d.ts +3 -1
- package/x/index.html +47 -8
- package/x/index.html.js +16 -6
- package/x/index.html.js.map +1 -1
- package/x/index.js +3 -1
- package/x/index.js.map +1 -1
- package/x/nubs/components.d.ts +9 -0
- package/x/nubs/components.js +11 -0
- package/x/nubs/components.js.map +1 -0
- package/x/nubs/index.d.ts +4 -0
- package/x/nubs/index.js +5 -0
- package/x/nubs/index.js.map +1 -0
- package/x/nubs/lookpad/component.d.ts +4 -0
- package/x/nubs/lookpad/component.js +36 -0
- package/x/nubs/lookpad/component.js.map +1 -0
- package/x/nubs/stick/component.d.ts +368 -0
- package/x/nubs/stick/component.js +101 -0
- package/x/nubs/stick/component.js.map +1 -0
- package/x/nubs/stick/style.css.d.ts +2 -0
- package/x/nubs/stick/style.css.js +69 -0
- package/x/nubs/stick/style.css.js.map +1 -0
- package/x/nubs/vpad/component.d.ts +368 -0
- package/x/nubs/{virtual-gamepad/view.js → vpad/component.js} +20 -11
- package/x/nubs/vpad/component.js.map +1 -0
- package/x/nubs/vpad/styles.css.d.ts +2 -0
- package/x/nubs/vpad/styles.css.js.map +1 -0
- package/x/nubs/vpad/utils/gamepad-inputs.js.map +1 -0
- package/x/nubs/vpad/utils/prevent-default-touch-shenanigans.js.map +1 -0
- package/x/nubs/vpad/utils/touch-tracking.js.map +1 -0
- package/x/utils/circular-clamp.d.ts +2 -0
- package/x/utils/circular-clamp.js +8 -0
- package/x/utils/circular-clamp.js.map +1 -0
- package/x/utils/dispensers.d.ts +7 -0
- package/x/utils/dispensers.js +16 -0
- package/x/utils/dispensers.js.map +1 -0
- package/x/utils/split-axis.d.ts +7 -0
- package/x/utils/split-axis.js +7 -2
- package/x/utils/split-axis.js.map +1 -1
- package/s/core/controllers/controller.ts +0 -7
- package/s/core/controllers/infra/group.ts +0 -17
- package/s/core/controllers/infra/sampler.ts +0 -22
- package/s/core/controllers/standard/gamepad.ts +0 -77
- package/s/core/controllers/standard/keyboard.ts +0 -50
- package/s/core/controllers/standard/stick.ts +0 -30
- package/s/core/deck/deck.ts +0 -40
- package/s/core/deck/parts/bindings-depot.ts +0 -24
- package/s/core/deck/parts/local-storage-kv.ts +0 -7
- package/s/core/hub/auto-gamepads.ts +0 -8
- package/s/core/hub/bindings.ts +0 -18
- package/s/core/port/port.ts +0 -34
- package/s/core/port/utils/aggregate_samples_into_map.ts +0 -20
- package/s/core/port/utils/wipe_samples_map.ts +0 -8
- package/s/nubs/lookpad/utils/listeners.ts +0 -53
- package/s/nubs/lookpad/view.ts +0 -32
- package/s/nubs/stick/styles.ts +0 -22
- package/s/nubs/stick/utils/calculate_new_vector_from_pointer_position.ts +0 -27
- package/s/nubs/stick/utils/find_closest_point_on_circle.ts +0 -15
- package/s/nubs/stick/utils/make_pointer_listeners.ts +0 -50
- package/s/nubs/stick/utils/within_radius.ts +0 -6
- package/s/nubs/stick/view.ts +0 -50
- package/s/nubs/stick-graphic/styles.ts +0 -38
- package/s/nubs/stick-graphic/types/basis.ts +0 -5
- package/s/nubs/stick-graphic/utils/calculate_basis.ts +0 -19
- package/s/nubs/stick-graphic/utils/stick_vector_to_pixels.ts +0 -13
- package/s/nubs/stick-graphic/utils/transform.ts +0 -10
- package/s/nubs/stick-graphic/view.ts +0 -43
- package/x/core/controllers/controller.d.ts +0 -4
- package/x/core/controllers/controller.js +0 -3
- package/x/core/controllers/controller.js.map +0 -1
- package/x/core/controllers/infra/group.d.ts +0 -7
- package/x/core/controllers/infra/group.js +0 -13
- package/x/core/controllers/infra/group.js.map +0 -1
- package/x/core/controllers/infra/sampler.d.ts +0 -8
- package/x/core/controllers/infra/sampler.js +0 -17
- package/x/core/controllers/infra/sampler.js.map +0 -1
- package/x/core/controllers/standard/gamepad.d.ts +0 -9
- package/x/core/controllers/standard/gamepad.js +0 -66
- package/x/core/controllers/standard/gamepad.js.map +0 -1
- package/x/core/controllers/standard/index.js.map +0 -1
- package/x/core/controllers/standard/keyboard.d.ts +0 -9
- package/x/core/controllers/standard/keyboard.js +0 -39
- package/x/core/controllers/standard/keyboard.js.map +0 -1
- package/x/core/controllers/standard/pointer.d.ts +0 -11
- package/x/core/controllers/standard/pointer.js.map +0 -1
- package/x/core/controllers/standard/stick.d.ts +0 -15
- package/x/core/controllers/standard/stick.js +0 -27
- package/x/core/controllers/standard/stick.js.map +0 -1
- package/x/core/controllers/standard/virtual-gamepad.d.ts +0 -7
- package/x/core/controllers/standard/virtual-gamepad.js.map +0 -1
- package/x/core/deck/deck.d.ts +0 -16
- package/x/core/deck/deck.js +0 -31
- package/x/core/deck/deck.js.map +0 -1
- package/x/core/deck/parts/bindings-depot.d.ts +0 -9
- package/x/core/deck/parts/bindings-depot.js +0 -19
- package/x/core/deck/parts/bindings-depot.js.map +0 -1
- package/x/core/deck/parts/local-storage-kv.js +0 -5
- package/x/core/deck/parts/local-storage-kv.js.map +0 -1
- package/x/core/hub/auto-gamepads.d.ts +0 -2
- package/x/core/hub/auto-gamepads.js +0 -6
- package/x/core/hub/auto-gamepads.js.map +0 -1
- package/x/core/hub/bindings.d.ts +0 -2
- package/x/core/hub/bindings.js +0 -16
- package/x/core/hub/bindings.js.map +0 -1
- package/x/core/port/port.d.ts +0 -12
- package/x/core/port/port.js +0 -25
- package/x/core/port/port.js.map +0 -1
- package/x/core/port/utils/aggregate_samples_into_map.d.ts +0 -3
- package/x/core/port/utils/aggregate_samples_into_map.js +0 -11
- package/x/core/port/utils/aggregate_samples_into_map.js.map +0 -1
- package/x/core/port/utils/wipe_samples_map.d.ts +0 -2
- package/x/core/port/utils/wipe_samples_map.js +0 -5
- package/x/core/port/utils/wipe_samples_map.js.map +0 -1
- package/x/nubs/lookpad/utils/listeners.d.ts +0 -19
- package/x/nubs/lookpad/utils/listeners.js +0 -37
- package/x/nubs/lookpad/utils/listeners.js.map +0 -1
- package/x/nubs/lookpad/view.d.ts +0 -1
- package/x/nubs/lookpad/view.js +0 -24
- package/x/nubs/lookpad/view.js.map +0 -1
- package/x/nubs/stick/styles.d.ts +0 -1
- package/x/nubs/stick/styles.js +0 -22
- package/x/nubs/stick/styles.js.map +0 -1
- package/x/nubs/stick/utils/calculate_new_vector_from_pointer_position.d.ts +0 -3
- package/x/nubs/stick/utils/calculate_new_vector_from_pointer_position.js +0 -16
- package/x/nubs/stick/utils/calculate_new_vector_from_pointer_position.js.map +0 -1
- package/x/nubs/stick/utils/find_closest_point_on_circle.d.ts +0 -2
- package/x/nubs/stick/utils/find_closest_point_on_circle.js +0 -6
- package/x/nubs/stick/utils/find_closest_point_on_circle.js.map +0 -1
- package/x/nubs/stick/utils/make_pointer_listeners.d.ts +0 -16
- package/x/nubs/stick/utils/make_pointer_listeners.js +0 -34
- package/x/nubs/stick/utils/make_pointer_listeners.js.map +0 -1
- package/x/nubs/stick/utils/within_radius.d.ts +0 -2
- package/x/nubs/stick/utils/within_radius.js +0 -4
- package/x/nubs/stick/utils/within_radius.js.map +0 -1
- package/x/nubs/stick/view.d.ts +0 -2
- package/x/nubs/stick/view.js +0 -38
- package/x/nubs/stick/view.js.map +0 -1
- package/x/nubs/stick-graphic/styles.js +0 -38
- package/x/nubs/stick-graphic/styles.js.map +0 -1
- package/x/nubs/stick-graphic/types/basis.d.ts +0 -4
- package/x/nubs/stick-graphic/types/basis.js +0 -2
- package/x/nubs/stick-graphic/types/basis.js.map +0 -1
- package/x/nubs/stick-graphic/utils/calculate_basis.d.ts +0 -2
- package/x/nubs/stick-graphic/utils/calculate_basis.js +0 -10
- package/x/nubs/stick-graphic/utils/calculate_basis.js.map +0 -1
- package/x/nubs/stick-graphic/utils/stick_vector_to_pixels.d.ts +0 -2
- package/x/nubs/stick-graphic/utils/stick_vector_to_pixels.js +0 -7
- package/x/nubs/stick-graphic/utils/stick_vector_to_pixels.js.map +0 -1
- package/x/nubs/stick-graphic/utils/transform.d.ts +0 -2
- package/x/nubs/stick-graphic/utils/transform.js +0 -7
- package/x/nubs/stick-graphic/utils/transform.js.map +0 -1
- package/x/nubs/stick-graphic/view.d.ts +0 -3
- package/x/nubs/stick-graphic/view.js +0 -30
- package/x/nubs/stick-graphic/view.js.map +0 -1
- package/x/nubs/virtual-gamepad/styles.css.js.map +0 -1
- package/x/nubs/virtual-gamepad/utils/gamepad-inputs.js.map +0 -1
- package/x/nubs/virtual-gamepad/utils/prevent-default-touch-shenanigans.js.map +0 -1
- package/x/nubs/virtual-gamepad/utils/touch-tracking.js.map +0 -1
- package/x/nubs/virtual-gamepad/view.d.ts +0 -2
- package/x/nubs/virtual-gamepad/view.js.map +0 -1
- /package/s/nubs/{virtual-gamepad → vpad}/utils/gamepad-inputs.ts +0 -0
- /package/s/nubs/{virtual-gamepad → vpad}/utils/prevent-default-touch-shenanigans.ts +0 -0
- /package/s/nubs/{virtual-gamepad → vpad}/utils/touch-tracking.ts +0 -0
- /package/x/core/{controllers → devices}/types.js +0 -0
- /package/x/{core/deck → deck}/parts/local-storage-kv.d.ts +0 -0
- /package/x/{nubs/virtual-gamepad/styles.css.d.ts → deck/views/deck-overlay/style.css.d.ts} +0 -0
- /package/x/{nubs/stick-graphic/styles.d.ts → demo/ui/theater/styles.css.d.ts} +0 -0
- /package/x/nubs/{virtual-gamepad → vpad}/styles.css.js +0 -0
- /package/x/nubs/{virtual-gamepad → vpad}/utils/gamepad-inputs.d.ts +0 -0
- /package/x/nubs/{virtual-gamepad → vpad}/utils/gamepad-inputs.js +0 -0
- /package/x/nubs/{virtual-gamepad → vpad}/utils/prevent-default-touch-shenanigans.d.ts +0 -0
- /package/x/nubs/{virtual-gamepad → vpad}/utils/prevent-default-touch-shenanigans.js +0 -0
- /package/x/nubs/{virtual-gamepad → vpad}/utils/touch-tracking.d.ts +0 -0
- /package/x/nubs/{virtual-gamepad → vpad}/utils/touch-tracking.js +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
\f\r]`,
|
|
3
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),de=/'/g,me=/"/g,ge=/^(?:script|style|textarea|title)$/i,Ut=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),U=Ut(1),zr=Ut(2),Tr=Ut(3),P=Symbol.for("lit-noChange"),y=Symbol.for("lit-nothing"),ye=new WeakMap,M=C.createTreeWalker(C,129);function be(r,t){if(!Ht(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return he!==void 0?he.createHTML(t):t}var we=(r,t)=>{let e=r.length-1,s=[],o,n=t===2?"<svg>":t===3?"<math>":"",i=J;for(let c=0;c<e;c++){let a=r[c],u,h,l=-1,m=0;for(;m<a.length&&(i.lastIndex=m,h=i.exec(a),h!==null);)m=i.lastIndex,i===J?h[1]==="!--"?i=pe:h[1]!==void 0?i=fe:h[2]!==void 0?(ge.test(h[2])&&(o=RegExp("</"+h[2],"g")),i=k):h[3]!==void 0&&(i=k):i===k?h[0]===">"?(i=o??J,l=-1):h[1]===void 0?l=-2:(l=i.lastIndex-h[2].length,u=h[1],i=h[3]===void 0?k:h[3]==='"'?me:de):i===me||i===de?i=k:i===pe||i===fe?i=J:(i=k,o=void 0);let S=i===k&&r[c+1].startsWith("/>")?" ":"";n+=i===J?a+ur:l>=0?(s.push(u),a.slice(0,l)+Nt+a.slice(l)+B+S):a+B+(l===-2?c:S)}return[be(r,n+(r[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]},Y=class r{constructor({strings:t,_$litType$:e},s){let o;this.parts=[];let n=0,i=0,c=t.length-1,a=this.parts,[u,h]=we(t,e);if(this.el=r.createElement(u,s),M.currentNode=this.el.content,e===2||e===3){let l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(o=M.nextNode())!==null&&a.length<c;){if(o.nodeType===1){if(o.hasAttributes())for(let l of o.getAttributeNames())if(l.endsWith(Nt)){let m=h[i++],S=o.getAttribute(l).split(B),ot=/([.?@])?(.*)/.exec(m);a.push({type:1,index:n,name:ot[2],strings:S,ctor:ot[1]==="."?ht:ot[1]==="?"?pt:ot[1]==="@"?ft:O}),o.removeAttribute(l)}else l.startsWith(B)&&(a.push({type:6,index:n}),o.removeAttribute(l));if(ge.test(o.tagName)){let l=o.textContent.split(B),m=l.length-1;if(m>0){o.textContent=ut?ut.emptyScript:"";for(let S=0;S<m;S++)o.append(l[S],K()),M.nextNode(),a.push({type:2,index:++n});o.append(l[m],K())}}}else if(o.nodeType===8)if(o.data===It)a.push({type:2,index:n});else{let l=-1;for(;(l=o.data.indexOf(B,l+1))!==-1;)a.push({type:7,index:n}),l+=B.length-1}n++}}static createElement(t,e){let s=C.createElement("template");return s.innerHTML=t,s}};function j(r,t,e=r,s){if(t===P)return t;let o=s!==void 0?e._$Co?.[s]:e._$Cl,n=Q(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=j(r,o._$AS(r,t.values),o,s)),t}var lt=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??C).importNode(e,!0);M.currentNode=o;let n=M.nextNode(),i=0,c=0,a=s[0];for(;a!==void 0;){if(i===a.index){let u;a.type===2?u=new H(n,n.nextSibling,this,t):a.type===1?u=new a.ctor(n,a.name,a.strings,this,t):a.type===6&&(u=new dt(n,this,t)),this._$AV.push(u),a=s[++c]}i!==a?.index&&(n=M.nextNode(),i++)}return M.currentNode=C,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=y,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=j(this,t,e),Q(t)?t===y||t==null||t===""?(this._$AH!==y&&this._$AR(),this._$AH=y):t!==this._$AH&&t!==P&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):xe(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!==y&&Q(this._$AH)?this._$AA.nextSibling.data=t:this.T(C.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=Y.createElement(be(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===o)this._$AH.p(e);else{let n=new lt(o,this),i=n.u(this.options);n.p(e),this.T(i),this._$AH=n}}_$AC(t){let e=ye.get(t.strings);return e===void 0&&ye.set(t.strings,e=new Y(t)),e}k(t){Ht(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(K()),this.O(K()),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!==this._$AB;){let s=t.nextSibling;t.remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},O=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,o,n){this.type=1,this._$AH=y,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=y}_$AI(t,e=this,s,o){let n=this.strings,i=!1;if(n===void 0)t=j(this,t,e,0),i=!Q(t)||t!==this._$AH&&t!==P,i&&(this._$AH=t);else{let c=t,a,u;for(t=n[0],a=0;a<n.length-1;a++)u=j(this,c[s+a],e,a),u===P&&(u=this._$AH[a]),i||=!Q(u)||u!==this._$AH[a],u===y?t=y:t!==y&&(t+=(u??"")+n[a+1]),this._$AH[a]=u}i&&!o&&this.j(t)}j(t){t===y?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},ht=class extends O{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===y?void 0:t}},pt=class extends O{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==y)}},ft=class extends O{constructor(t,e,s,o,n){super(t,e,s,o,n),this.type=5}_$AI(t,e=this){if((t=j(this,t,e,0)??y)===P)return;let s=this._$AH,o=t===y&&s!==y||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==y&&(s===y||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)}},dt=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){j(this,t)}},ve={M:Nt,P:B,A:It,C:1,L:we,R:lt,D:xe,V:j,I:H,H:O,N:pt,U:ft,B:ht,F:dt},lr=Tt.litHtmlPolyfillSupport;lr?.(Y,H),(Tt.litHtmlVersions??=[]).push("3.3.1");var E=(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(K(),n),n,void 0,e??{})}return o._$AI(r),o};var Dt=globalThis,D=class extends A{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=E(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return P}};D._$litElement$=!0,D.finalized=!0,Dt.litElementHydrateSupport?.({LitElement:D});var hr=Dt.litElementPolyfillSupport;hr?.({LitElement:D});(Dt.litElementVersions??=[]).push("4.2.1");function mt(r,t={}){let{soft:e=!1,upgrade:s=!0}=t;for(let[o,n]of Object.entries(r)){let i=ne(o),c=customElements.get(i);e&&c||(customElements.define(i,n),s&&document.querySelectorAll(i).forEach(a=>{a.constructor===HTMLElement&&customElements.upgrade(a)}))}}function q(r,t=document){let e=t.querySelector(r);if(!e)throw new Error(`$1 ${r} not found`);return e}function pr(r,t=document){return Array.from(t.querySelectorAll(r))}q.maybe=(r,t=document)=>t.querySelector(r);q.all=pr;q.render=(r,...t)=>E(t,r);q.register=mt;var w=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 z=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(w.random(r))},string(r){return z.fromBytes(r)},bytes(r){return z.toBytes(r)}});var qt=58,yt="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",Rt=Object.freeze({fromBytes(r){let t=BigInt("0x"+z.fromBytes(r)),e="";for(;t>0;){let s=t%BigInt(qt);t=t/BigInt(qt),e=yt[Number(s)]+e}for(let s of r)if(s===0)e=yt[0]+e;else break;return e},toBytes(r){let t=BigInt(0);for(let i of r){let c=yt.indexOf(i);if(c===-1)throw new Error(`Invalid character '${i}' in base58 string`);t=t*BigInt(qt)+BigInt(c)}let e=t.toString(16);e.length%2!==0&&(e="0"+e);let s=z.toBytes(e),o=0;for(let i of r)if(i===yt[0])o++;else break;let n=new Uint8Array(o+s.length);return n.set(s,o),n},random(r=32){return this.fromBytes(w.random(r))},string(r){return Rt.fromBytes(r)},bytes(r){return Rt.toBytes(r)}});var $e=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,u=[];for(let h of t){if(h===this.lexicon.padding?.character)continue;let l=this.lookup[h];if(l===void 0)throw new Error(`Invalid character: ${h}`);for(c=c<<e|l,a+=e;a>=8;)a-=8,u.push(c>>a&255)}return new Uint8Array(u)}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 u of t)for(i=i<<8|u,c+=8;c>=e;){c-=e;let h=i>>c&(1<<e)-1;a+=this.lexicon.characters[h]}if(c>0){let u=i<<e-c&(1<<e)-1;a+=this.lexicon.characters[u]}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(w.random(t))}};var Lt=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(w.random(r))},string(r){return Lt.fromBytes(r)},bytes(r){return Lt.toBytes(r)}});var _e=Object.freeze({fromBytes(r){return new TextDecoder().decode(r)},toBytes(r){return new TextEncoder().encode(r)},string(r){return _e.fromBytes(r)},bytes(r){return _e.toBytes(r)}});function Ae(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,u)=>{o.push({resolve:a,reject:u})});return s=setTimeout(()=>{Promise.resolve().then(()=>t(...e)).then(a=>{for(let{resolve:u}of o)u(a);n()}).catch(a=>{for(let{reject:u}of o)u(a);n()})},r),c})}var Vt=Object.freeze({happy:r=>r!=null,sad: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 X(){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 R=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 Be=(r=0)=>new Promise(t=>setTimeout(t,r));function fr(r){return{map:t=>Se(r,t),filter:t=>Ee(r,t)}}fr.pipe=Object.freeze({map:r=>(t=>Se(t,r)),filter:r=>(t=>Ee(t,r))});var Se=(r,t)=>Object.fromEntries(Object.entries(r).map(([e,s])=>[e,t(s,e)])),Ee=(r,t)=>Object.fromEntries(Object.entries(r).filter(([e,s])=>t(s,e)));function ke(){let r=new Set;async function t(...a){await Promise.all([...r].map(u=>u(...a)))}function e(a){return r.add(a),()=>{r.delete(a)}}async function s(...a){return t(...a)}function o(a){return e(a)}async function n(a){let{promise:u,resolve:h}=X(),l=o(async(...m)=>{a&&await a(...m),h(m),l()});return u}function i(){r.clear()}let c={pub:s,sub:o,publish:t,subscribe:e,on:e,next:n,clear:i};return Object.assign(o,c),Object.assign(s,c),c}function Me(r){let t=ke();return r&&t.sub(r),t.sub}function Ft(r){let t=ke();return r&&t.sub(r),t.pub}function Ce(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 v=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(v.random(r))},string(r){return T.fromBytes(r)},bytes(r){return T.toBytes(r)}});var Wt=58,xt="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",Zt=Object.freeze({fromBytes(r){let t=BigInt("0x"+T.fromBytes(r)),e="";for(;t>0;){let s=t%BigInt(Wt);t=t/BigInt(Wt),e=xt[Number(s)]+e}for(let s of r)if(s===0)e=xt[0]+e;else break;return e},toBytes(r){let t=BigInt(0);for(let i of r){let c=xt.indexOf(i);if(c===-1)throw new Error(`Invalid character '${i}' in base58 string`);t=t*BigInt(Wt)+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===xt[0])o++;else break;let n=new Uint8Array(o+s.length);return n.set(s,o),n},random(r=32){return this.fromBytes(v.random(r))},string(r){return Zt.fromBytes(r)},bytes(r){return Zt.toBytes(r)}});var Pe=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,u=[];for(let h of t){if(h===this.lexicon.padding?.character)continue;let l=this.lookup[h];if(l===void 0)throw new Error(`Invalid character: ${h}`);for(c=c<<e|l,a+=e;a>=8;)a-=8,u.push(c>>a&255)}return new Uint8Array(u)}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 u of t)for(i=i<<8|u,c+=8;c>=e;){c-=e;let h=i>>c&(1<<e)-1;a+=this.lexicon.characters[h]}if(c>0){let u=i<<e-c&(1<<e)-1;a+=this.lexicon.characters[u]}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(v.random(t))}};var Jt=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(v.random(r))},string(r){return Jt.fromBytes(r)},bytes(r){return Jt.toBytes(r)}});var je=Object.freeze({fromBytes(r){return new TextDecoder().decode(r)},toBytes(r){return new TextEncoder().encode(r)},string(r){return je.fromBytes(r)},bytes(r){return je.toBytes(r)}});function Kt(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,u)=>{o.push({resolve:a,reject:u})});return s=setTimeout(()=>{Promise.resolve().then(()=>t(...e)).then(a=>{for(let{resolve:u}of o)u(a);n()}).catch(a=>{for(let{reject:u}of o)u(a);n()})},r),c})}var Qt=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 Oe(){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}}function dr(r){return{map:t=>ze(r,t),filter:t=>Te(r,t)}}dr.pipe=Object.freeze({map:r=>(t=>ze(t,r)),filter:r=>(t=>Te(t,r))});var ze=(r,t)=>Object.fromEntries(Object.entries(r).map(([e,s])=>[e,t(s,e)])),Te=(r,t)=>Object.fromEntries(Object.entries(r).filter(([e,s])=>t(s,e)));function mr(){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}=Oe(),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 gt(r){let t=mr()[1];return r&&t.sub(r),t}var Yt=class{#t=[];#e=new WeakMap;#r=[];#s=new Set;notifyRead(t){this.#t.at(-1)?.add(t)}async notifyWrite(t){if(this.#s.has(t))throw new Error("circularity forbidden");let e=this.#o(t).pub();return this.#r.at(-1)?.add(e),e}observe(t){this.#t.push(new Set);let e=t();return{seen:this.#t.pop(),result:e}}subscribe(t,e){return this.#o(t)(async()=>{let s=new Set;this.#r.push(s),this.#s.add(t),s.add(e()),this.#s.delete(t),await Promise.all(s),this.#r.pop()})}#o(t){let e=this.#e.get(t);return e||(e=gt(),this.#e.set(t,e)),e}},b=globalThis[Symbol.for("e280.tracker")]??=new Yt;var{I:la}=ve;var Ne=r=>r.strings===void 0;var Ie={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},wt=r=>(...t)=>({_$litDirective$:r,values:t}),bt=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},vt=r=>{let t,e;do{if((t=r._$AM)===void 0)break;e=t._$AN,e.delete(r),r=t}while(e?.size===0)},He=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),gr(t)}};function yr(r){this._$AN!==void 0?(vt(this),this._$AM=r,He(this)):this._$AM=r}function xr(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),vt(s[n]);else s!=null&&(G(s,!1),vt(s));else G(this,r)}var gr=r=>{r.type==Ie.CHILD&&(r._$AP??=xr,r._$AQ??=yr)},$t=class extends bt{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,s){super._$AT(t,e,s),He(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(G(this,t),vt(this))}setValue(t){if(Ne(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 Ue(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){at(r,br(t))}function br(r){let t=[];if(Array.isArray(r)){let e=new Set(r.flat(1/0).reverse());for(let s of e)t.unshift(I(s))}else r!==void 0&&t.push(I(r));return t}function Xt(r,t=r){let{seen:e,result:s}=b.observe(r),o=Kt(0,t),n=[],i=()=>n.forEach(c=>c());for(let c of e){let a=b.subscribe(c,o);n.push(a)}return{result:s,dispose:i}}var wr={compare:(r,t)=>r===t};function L(r={}){return{...wr,...r}}var At=class{sneak;constructor(t){this.sneak=t}get(){return b.notifyRead(this),this.sneak}get value(){return this.get()}},Bt=class extends At{on=gt();dispose(){this.on.clear()}},tt=class extends Bt{_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([b.notifyWrite(this),this.on.pub(t)])}finally{this._lock=!1}return await e,t}},et=class extends At{_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}=Xt(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,b.notifyWrite(this))}return super.get()}get value(){return this.get()}dispose(){this._effect&&this._effect()}},rt=class extends Bt{_effect;static make(t,e,s){let{result:o,dispose:n}=Xt(e,async()=>{let i=e();!s.compare(t.sneak,i)&&(t.sneak=i,await Promise.all([b.notifyWrite(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 De(r,t={}){function e(){return e.value}let s=L(t),o=rt.make(e,r,s);return Object.setPrototypeOf(e,rt.prototype),Object.assign(e,o),e}function qe(r,t={}){function e(){return e.value}let s=L(t),o=new et(r,s);return Object.setPrototypeOf(e,et.prototype),Object.assign(e,o),e}function $(r,t={}){function e(n){return n!==void 0?e.set(n):e.get()}let s=L(t),o=new tt(r,s);return Object.setPrototypeOf(e,tt.prototype),Object.assign(e,o),e}$.lazy=qe;$.derive=De;var N={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)=>N.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 st=class{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(s=>s.pod);return N.all(...e)}signal;#t=0;#e=Ft();#r=Ft();constructor(t=["loading"]){this.signal=$(t)}get wait(){return new Promise((t,e)=>{this.#e.next().then(([s])=>t(s)),this.#r.next().then(([s])=>e(s))})}get then(){return this.wait.then.bind(this.wait)}get catch(){return this.wait.catch.bind(this.wait)}get finally(){return this.wait.finally.bind(this.wait)}async setLoading(){await this.signal(["loading"])}async setReady(t){await this.signal(["ready",t]),await this.#e(t)}async setError(t){await this.signal(["error",t]),await this.#r(t)}async promise(t){let e=++this.#t;await this.setLoading();try{let s=await t;return e===this.#t&&await this.setReady(s),s}catch(s){e===this.#t&&await this.setError(s)}}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 N.value(this.signal())}get error(){return N.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 N.select(this.signal(),t)}morph(t){return N.morph(this.pod,t)}};var St=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 Re=(r,t)=>new Proxy(t,{get:(e,s)=>{let o=t[s],n=r.getAttribute(s);switch(o){case String:return n??void 0;case Number:return n!==null?Number(n):void 0;case Boolean:return n!==null;default:throw new Error(`invalid attribute type for "${s}"`)}},set:(e,s,o)=>{switch(t[s]){case String:return r.setAttribute(s,o),!0;case Number:return r.setAttribute(s,o.toString()),!0;case Boolean:return o?r.setAttribute(s,""):r.removeAttribute(s),!0;default:throw new Error(`invalid attribute type for "${s}"`)}}});function Le(r,t){let e=new MutationObserver(t);return e.observe(r,{attributes:!0}),()=>e.disconnect()}var Gt=Symbol(),te=Symbol(),ee=Symbol(),Et=class{element;shadow;renderNow;render;#t=0;#e=0;#r=new R;#s=X();#o=new St;[Gt](t){this.#t++,this.#e=0,this.#s=X();let e=t();return this.#s.resolve(),e}[te](){this.#o.unmountAll()}[ee](){this.#o.remountAll()}constructor(t,e,s,o){this.element=t,this.shadow=e,this.renderNow=s,this.render=o}get renderCount(){return this.#t}get rendered(){return this.#s.promise}name(t){this.once(()=>this.element.setAttribute("view",t))}styles(...t){this.once(()=>_t(this.shadow,t))}css(...t){return this.styles(...t)}attrs(t){return this.mount(()=>Le(this.element,this.render)),this.once(()=>Re(this.element,t))}once(t){return this.#r.guarantee(this.#e++,t)}mount(t){return this.once(()=>this.#o.mount(t))}life(t){let e;return this.mount(()=>{let[s,o]=t();return e=s,o}),e}wake(t){return this.life(()=>[t(),()=>{}])}op=(()=>{let t=this;function e(s){return t.once(()=>st.fn(s))}return e.fn=e,e.promise=s=>this.once(()=>st.promise(s)),e})();signal(t){return this.once(()=>$(t))}};var _=Ve({mode:"open"}),re=class extends HTMLElement{};mt({SlyView:re},{soft:!0,upgrade:!0});function Ve(r){function t(e){let s=i=>class extends $t{#t=i.getElement();#e=this.#t.attachShadow(r);#r=Ae(0,()=>this.#i());#s=new R;#o;#n=new Et(this.#t,this.#e,()=>this.#i(),this.#r);#a=(()=>{let a=e(this.#n);return this.#t.setAttribute("view",r.name??""),r.styles&&_t(this.#e,r.styles),a})();#i(){if(!this.#o||!this.isConnected)return;let{with:a,props:u}=this.#o;this.#n[Gt](()=>{Ue(this.#t,a.attrs);let{result:h,seen:l}=b.observe(()=>this.#a(...u));E(h,this.#e);for(let m of l)this.#s.guarantee(m,()=>b.subscribe(m,async()=>this.#r()));i.isComponent||E(a.children,this.#t)})}render(a,u){return this.#o={with:a,props:u},this.#i(),i.isComponent?null:this.#t}disconnected(){this.#n[te]();for(let a of this.#s.values())a();this.#s.clear()}reconnected(){this.#n[ee]()}},o=wt(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,u)=>n({...i,attrs:{...i.attrs,[a]:u}}),c.component=(...a)=>class extends HTMLElement{#t=wt(s({getElement:()=>this,isComponent:!0}));constructor(){super(),this.render(...a)}render(...u){this.isConnected&&E(this.#t(i,u),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 kt=g`
|
|
1
|
+
var Jt=globalThis,Zt=Jt.ShadowRoot&&(Jt.ShadyCSS===void 0||Jt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,er=Symbol(),wr=new WeakMap,_t=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==er)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(Zt&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=wr.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&wr.set(e,t))}return t}toString(){return this.cssText}},br=r=>new _t(typeof r=="string"?r:r+"",void 0,er),S=(r,...t)=>{let e=r.length===1?r[0]:t.reduce(((s,i,o)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[o+1]),r[0]);return new _t(e,r,er)},Qt=(r,t)=>{if(Zt)r.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(let e of t){let s=document.createElement("style"),i=Jt.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,r.appendChild(s)}},rt=Zt?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return br(e)})(r):r;var{is:Ms,defineProperty:Cs,getOwnPropertyDescriptor:Ps,getOwnPropertyNames:Os,getOwnPropertySymbols:Rs,getPrototypeOf:Ts}=Object,te=globalThis,vr=te.trustedTypes,Ds=vr?vr.emptyScript:"",Bs=te.reactiveElementPolyfillSupport,Et=(r,t)=>r,rr={toAttribute(r,t){switch(t){case Boolean:r=r?Ds: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}},Ar=(r,t)=>!Ms(r,t),$r={attribute:!0,type:String,converter:rr,reflect:!1,useDefault:!1,hasChanged:Ar};Symbol.metadata??=Symbol("metadata"),te.litPropertyMetadata??=new WeakMap;var j=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=$r){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(),i=this.getPropertyDescriptor(t,s,e);i!==void 0&&Cs(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){let{get:i,set:o}=Ps(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get:i,set(n){let c=i?.call(this);o?.call(this,n),this.requestUpdate(t,c,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??$r}static _$Ei(){if(this.hasOwnProperty(Et("elementProperties")))return;let t=Ts(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(Et("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Et("properties"))){let e=this.properties,s=[...Os(e),...Rs(e)];for(let i of s)this.createProperty(i,e[i])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,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 i of s)e.unshift(rt(i))}else t!==void 0&&e.push(rt(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 Qt(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),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){let o=(s.converter?.toAttribute!==void 0?s.converter:rr).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){let s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){let o=s.getPropertyOptions(i),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:rr;this._$Em=i;let c=n.fromAttribute(e,o.type);this[i]=c??this._$Ej?.get(i)??c,this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){let i=this.constructor,o=this[t];if(s??=i.getPropertyOptions(t),!((s.hasChanged??Ar)(o,e)||s.useDefault&&s.reflect&&o===this._$Ej?.get(t)&&!this.hasAttribute(i._$Eu(t,s))))return;this.C(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:i,wrapped:o},n){s&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,n??e??this[t]),o!==!0||n!==void 0)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),i===!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[i,o]of this._$Ep)this[i]=o;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,o]of s){let{wrapped:n}=o,c=this[i];n!==!0||this._$AL.has(i)||c===void 0||this.C(i,void 0,o,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){}};j.elementStyles=[],j.shadowRootOptions={mode:"open"},j[Et("elementProperties")]=new Map,j[Et("finalized")]=new Map,Bs?.({ReactiveElement:j}),(te.reactiveElementVersions??=[]).push("2.1.1");var ir=globalThis,ee=ir.trustedTypes,Sr=ee?ee.createPolicy("lit-html",{createHTML:r=>r}):void 0,or="$lit$",z=`lit$${Math.random().toFixed(9).slice(2)}$`,nr="?"+z,js=`<${nr}>`,X=document,Ct=()=>X.createComment(""),Pt=r=>r===null||typeof r!="object"&&typeof r!="function",ar=Array.isArray,Pr=r=>ar(r)||typeof r?.[Symbol.iterator]=="function",sr=`[
|
|
2
|
+
\f\r]`,Mt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,kr=/-->/g,_r=/>/g,G=RegExp(`>|${sr}(?:([^\\s"'>=/]+)(${sr}*=${sr}*(?:[^
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Er=/'/g,Mr=/"/g,Or=/^(?:script|style|textarea|title)$/i,cr=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),M=cr(1),li=cr(2),pi=cr(3),N=Symbol.for("lit-noChange"),$=Symbol.for("lit-nothing"),Cr=new WeakMap,Y=X.createTreeWalker(X,129);function Rr(r,t){if(!ar(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return Sr!==void 0?Sr.createHTML(t):t}var Tr=(r,t)=>{let e=r.length-1,s=[],i,o=t===2?"<svg>":t===3?"<math>":"",n=Mt;for(let c=0;c<e;c++){let a=r[c],l,p,h=-1,d=0;for(;d<a.length&&(n.lastIndex=d,p=n.exec(a),p!==null);)d=n.lastIndex,n===Mt?p[1]==="!--"?n=kr:p[1]!==void 0?n=_r:p[2]!==void 0?(Or.test(p[2])&&(i=RegExp("</"+p[2],"g")),n=G):p[3]!==void 0&&(n=G):n===G?p[0]===">"?(n=i??Mt,h=-1):p[1]===void 0?h=-2:(h=n.lastIndex-p[2].length,l=p[1],n=p[3]===void 0?G:p[3]==='"'?Mr:Er):n===Mr||n===Er?n=G:n===kr||n===_r?n=Mt:(n=G,i=void 0);let m=n===G&&r[c+1].startsWith("/>")?" ":"";o+=n===Mt?a+js:h>=0?(s.push(l),a.slice(0,h)+or+a.slice(h)+z+m):a+z+(h===-2?c:m)}return[Rr(r,o+(r[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]},Ot=class r{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let o=0,n=0,c=t.length-1,a=this.parts,[l,p]=Tr(t,e);if(this.el=r.createElement(l,s),Y.currentNode=this.el.content,e===2||e===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(i=Y.nextNode())!==null&&a.length<c;){if(i.nodeType===1){if(i.hasAttributes())for(let h of i.getAttributeNames())if(h.endsWith(or)){let d=p[n++],m=i.getAttribute(h).split(z),v=/([.?@])?(.*)/.exec(d);a.push({type:1,index:o,name:v[2],strings:m,ctor:v[1]==="."?se:v[1]==="?"?ie:v[1]==="@"?oe:Z}),i.removeAttribute(h)}else h.startsWith(z)&&(a.push({type:6,index:o}),i.removeAttribute(h));if(Or.test(i.tagName)){let h=i.textContent.split(z),d=h.length-1;if(d>0){i.textContent=ee?ee.emptyScript:"";for(let m=0;m<d;m++)i.append(h[m],Ct()),Y.nextNode(),a.push({type:2,index:++o});i.append(h[d],Ct())}}}else if(i.nodeType===8)if(i.data===nr)a.push({type:2,index:o});else{let h=-1;for(;(h=i.data.indexOf(z,h+1))!==-1;)a.push({type:7,index:o}),h+=z.length-1}o++}}static createElement(t,e){let s=X.createElement("template");return s.innerHTML=t,s}};function J(r,t,e=r,s){if(t===N)return t;let i=s!==void 0?e._$Co?.[s]:e._$Cl,o=Pt(t)?void 0:t._$litDirective$;return i?.constructor!==o&&(i?._$AO?.(!1),o===void 0?i=void 0:(i=new o(r),i._$AT(r,e,s)),s!==void 0?(e._$Co??=[])[s]=i:e._$Cl=i),i!==void 0&&(t=J(r,i._$AS(r,t.values),i,s)),t}var re=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,i=(t?.creationScope??X).importNode(e,!0);Y.currentNode=i;let o=Y.nextNode(),n=0,c=0,a=s[0];for(;a!==void 0;){if(n===a.index){let l;a.type===2?l=new st(o,o.nextSibling,this,t):a.type===1?l=new a.ctor(o,a.name,a.strings,this,t):a.type===6&&(l=new ne(o,this,t)),this._$AV.push(l),a=s[++c]}n!==a?.index&&(o=Y.nextNode(),n++)}return Y.currentNode=X,i}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++}},st=class r{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=$,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=i?.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=J(this,t,e),Pt(t)?t===$||t==null||t===""?(this._$AH!==$&&this._$AR(),this._$AH=$):t!==this._$AH&&t!==N&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Pr(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!==$&&Pt(this._$AH)?this._$AA.nextSibling.data=t:this.T(X.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=Ot.createElement(Rr(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(e);else{let o=new re(i,this),n=o.u(this.options);o.p(e),this.T(n),this._$AH=o}}_$AC(t){let e=Cr.get(t.strings);return e===void 0&&Cr.set(t.strings,e=new Ot(t)),e}k(t){ar(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,s,i=0;for(let o of t)i===e.length?e.push(s=new r(this.O(Ct()),this.O(Ct()),this,this.options)):s=e[i],s._$AI(o),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let s=t.nextSibling;t.remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},Z=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,o){this.type=1,this._$AH=$,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=o,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=$}_$AI(t,e=this,s,i){let o=this.strings,n=!1;if(o===void 0)t=J(this,t,e,0),n=!Pt(t)||t!==this._$AH&&t!==N,n&&(this._$AH=t);else{let c=t,a,l;for(t=o[0],a=0;a<o.length-1;a++)l=J(this,c[s+a],e,a),l===N&&(l=this._$AH[a]),n||=!Pt(l)||l!==this._$AH[a],l===$?t=$:t!==$&&(t+=(l??"")+o[a+1]),this._$AH[a]=l}n&&!i&&this.j(t)}j(t){t===$?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},se=class extends Z{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===$?void 0:t}},ie=class extends Z{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==$)}},oe=class extends Z{constructor(t,e,s,i,o){super(t,e,s,i,o),this.type=5}_$AI(t,e=this){if((t=J(this,t,e,0)??$)===N)return;let s=this._$AH,i=t===$&&s!==$||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,o=t!==$&&(s===$||i);i&&this.element.removeEventListener(this.name,this,s),o&&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)}},ne=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){J(this,t)}},Dr={M:or,P:z,A:nr,C:1,L:Tr,R:re,D:Pr,V:J,I:st,H:Z,N:ie,U:oe,B:se,F:ne},zs=ir.litHtmlPolyfillSupport;zs?.(Ot,st),(ir.litHtmlVersions??=[]).push("3.3.1");var Rt=(r,t,e)=>{let s=e?.renderBefore??t,i=s._$litPart$;if(i===void 0){let o=e?.renderBefore??null;s._$litPart$=i=new st(t.insertBefore(Ct(),o),o,void 0,e??{})}return i._$AI(r),i};var hr=globalThis,it=class extends j{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=Rt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return N}};it._$litElement$=!0,it.finalized=!0,hr.litElementHydrateSupport?.({LitElement:it});var Ns=hr.litElementPolyfillSupport;Ns?.({LitElement:it});(hr.litElementVersions??=[]).push("4.2.1");function Br(r,t){let e=new MutationObserver(t);return e.observe(r,{attributes:!0}),()=>e.disconnect()}var k={get:{string:(r,t)=>r.getAttribute(t)??void 0,number:(r,t)=>{let e=r.getAttribute(t);return e===null||!e?void 0:Number(e)},boolean:(r,t)=>r.getAttribute(t)!==null},set:{string:(r,t,e)=>(e===void 0?r.removeAttribute(t):r.setAttribute(t,e),!0),number:(r,t,e)=>(e===void 0?r.removeAttribute(t):r.setAttribute(t,e.toString()),!0),boolean:(r,t,e)=>(e?r.setAttribute(t,""):r.removeAttribute(t),!0)}};var jr=(r,t)=>new Proxy(t,{get:(e,s)=>{switch(t[s]){case String:return k.get.string(r,s);case Number:return k.get.number(r,s);case Boolean:return k.get.boolean(r,s);default:throw new Error(`invalid attribute type for "${s}"`)}},set:(e,s,i)=>{switch(t[s]){case String:return k.set.string(r,s,i);case Number:return k.set.number(r,s,i);case Boolean:return k.set.boolean(r,s,i);default:throw new Error(`invalid attribute type for "${s}"`)}}});var ae=class{element;constructor(t){this.element=t}string=new Proxy({},{get:(t,e)=>k.get.string(this.element,e),set:(t,e,s)=>k.set.string(this.element,e,s)});number=new Proxy({},{get:(t,e)=>k.get.number(this.element,e),set:(t,e,s)=>k.set.number(this.element,e,s)});boolean=new Proxy({},{get:(t,e)=>k.get.boolean(this.element,e),set:(t,e,s)=>k.set.boolean(this.element,e,s)})};function Tt(r){let t=new ae(r);return{string:t.string,number:t.number,boolean:t.boolean,on:e=>Br(r,e),spec:e=>jr(r,e)}}Tt.get=k.get;Tt.set=k.set;function zr(r){return r.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function Nr(r,t={}){let{soft:e=!1,upgrade:s=!0}=t;for(let[i,o]of Object.entries(r)){let n=zr(i),c=customElements.get(n);e&&c||(customElements.define(n,o),s&&document.querySelectorAll(n).forEach(a=>{a.constructor===HTMLElement&&customElements.upgrade(a)}))}}function lr(r,t){let e=[];for(let[s,i]of Object.entries(t))if(typeof i=="function")r.addEventListener(s,i),e.push(()=>r.removeEventListener(s,i));else{let[o,n]=i;r.addEventListener(s,n,o),e.push(()=>r.removeEventListener(s,n))}return()=>e.forEach(s=>s())}function Ls(r,t,e){e==null?r.removeAttribute(t):typeof e=="string"?r.setAttribute(t,e):typeof e=="number"?r.setAttribute(t,e.toString()):typeof e=="boolean"?e===!0?r.setAttribute(t,""):r.removeAttribute(t):console.warn(`invalid attribute "${t}" type is "${typeof e}"`)}function ce(r,t){for(let[e,s]of t)Ls(r,e,s)}function Lr(r,t){let e=document.createElement(r);return ce(e,Object.entries(t)),e}function Vr(r,t){let e=r.querySelector(t);if(!e)throw new Error(`element not found (${t})`);return e}var he=class r{element;constructor(t){this.element=t}in(t){return new r(typeof t=="string"?Vr(this.element,t):t)}require(t){let e=this.element.querySelector(t);if(!e)throw new Error(`element not found (${t})`);return e}maybe(t){return this.element.querySelector(t)}all(t){return Array.from(this.element.querySelectorAll(t))}render(...t){return Rt(t,this.element)}attrs(){return Tt(this.element)}events(t){return lr(this.element,t)}};function f(r){return typeof r=="string"?Vr(document,r):new he(r)}var V=new he(document);f.in=V.in.bind(V);f.require=V.require.bind(V);f.maybe=V.maybe.bind(V);f.all=V.all.bind(V);f.el=Lr;f.events=lr;f.attrs=Tt;f.register=Nr;f.render=(r,...t)=>Rt(t,r);var qr=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 ot=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(qr.random(r))},string(r){return ot.fromBytes(r)},bytes(r){return ot.toBytes(r)}});function R(r,t){let e,s,i=[];function o(){e=[],s&&clearTimeout(s),s=void 0,i=[]}return o(),((...n)=>{e=n,s&&clearTimeout(s);let c=new Promise((a,l)=>{i.push({resolve:a,reject:l})});return s=setTimeout(()=>{Promise.resolve().then(()=>t(...e)).then(a=>{for(let{resolve:l}of i)l(a);o()}).catch(a=>{for(let{reject:l}of i)l(a);o()})},r),c})}function nt(r,t=new Set){if(t.has(r))throw new Error("cannot clone circular reference");let e;return typeof r=="function"||r!==null&&typeof r=="object"?(t.add(r),Array.isArray(r)?e=r.map(s=>nt(s,new Set(t))):r.constructor===Object?e=Object.fromEntries(Object.entries(r).map(([s,i])=>[s,nt(i,new Set(t))])):r instanceof Map?e=new Map(Array.from(r,([s,i])=>[s,nt(i,new Set(t))])):r instanceof Set?e=new Set(Array.from(r,s=>nt(s,new Set(t)))):r instanceof Date?e=new Date(r.getTime()):e=r,t.delete(r)):e=r,e}var Dt=Object.freeze({happy:r=>r!=null,sad: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"});var Hr=(r,t)=>{function e(s,i,o){if(!Dt.object(s)||!Dt.object(i))return s===i;if(o.includes(s))throw new Error("forbidden circularity detected in deep equal comparison");let n=[...o,s];if(s instanceof Map&&i instanceof Map){if(s.size!==i.size)return!1;for(let[c,a]of s)if(!i.has(c)||!e(a,i.get(c),n))return!1}else if(s instanceof Set&&i instanceof Set){if(s.size!==i.size)return!1;for(let c of s)if(!Array.from(i).some(a=>e(c,a,n)))return!1}else{let c=Object.keys(s),a=Object.keys(i);if(c.length!==a.length)return!1;for(let l of c)if(!a.includes(l)||!e(s[l],i[l],n))return!1}return!0}return e(r,t,[])};function Ur(r){function t(e,s){if(!Dt.object(e)||s.includes(e))return e;let i=[...s,e];if(e instanceof Map)for(let o of e.entries())for(let n of o)t(n,i);else if(e instanceof Set)for(let o of e)t(o,i);else if(Array.isArray(e))for(let o of e)t(o,i);else for(let o of Object.values(e))t(o,i);return Object.freeze(e)}return t(r,[])}var le={clone:nt,equal:Hr,freeze:Ur};function Ir(...r){return(...t)=>r.forEach(e=>e(...t))}function Bt(){let r,t,e=new Promise((i,o)=>{r=i,t=o});function s(i){return i.then(r).catch(t),e}return{promise:e,resolve:r,reject:t,entangle:s}}var pe=class{getRefill;#t=[];constructor(t){this.getRefill=t,this.#e()}get currentStock(){return[...this.#t]}#e(){if(this.#t.length===0&&(this.#t=[...this.getRefill()]),this.#t.length===0)throw new Error("dispenser's getRefill returned an empty array")}takeAll(){let t=this.#t;return this.#t=[...this.getRefill()],t}takeRandom(){this.#e();let t=Math.floor(Math.random()*this.#t.length),[e]=this.#t.splice(t,1);return e}takeFirst(){return this.#e(),this.#t.shift()}takeLast(){return this.#e(),this.#t.pop()}shift=this.takeFirst.bind(this);pop=this.takeLast.bind(this)};function C(){let r=[];function t(){for(let e of r)e();r=[]}return t.schedule=e=>(r.push(e),t),t}function Q(r,t){let e=Object.entries(t);for(let[s,i]of e)r.addEventListener(s,i);return()=>{for(let[s,i]of e)r.removeEventListener(s,i)}}function*Vs(r){for(let t=0;t<r;t++)yield t}function ue(r){return[...Vs(r)]}var A=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 i=s();return t.set(e,i),i}}array(){return[...this]}require(t){return r.require(this,t)}guarantee(t,e){return r.guarantee(this,t,e)}},de=class r extends WeakMap{static require(t,e){if(t.has(e))return t.get(e);throw new Error("required key not found")}static guarantee(t,e,s){if(t.has(e))return t.get(e);{let i=s();return t.set(e,i),i}}require(t){return r.require(this,t)}guarantee(t,e){return r.guarantee(this,t,e)}};var at=(r=0)=>new Promise(t=>setTimeout(t,r));function me(r){return{map:t=>jt(r,t),filter:t=>Wr(r,t)}}me.pipe=Object.freeze({map:r=>(t=>jt(t,r)),filter:r=>(t=>Wr(t,r))});var jt=(r,t)=>Object.fromEntries(Object.entries(r).map(([e,s])=>[e,t(s,e)])),Wr=(r,t)=>Object.fromEntries(Object.entries(r).filter(([e,s])=>t(s,e)));function ur(r){return new pr(r)}var pr=class r{#t;static with=ur;constructor(t){this.#t=t}to(t){return new r(t(this.#t))}done(){return this.#t}line(...t){let e=this.#t;for(let s of t)e=s(e);return e}};function Fr(){let r=new Set;async function t(...a){await Promise.all([...r].map(l=>l(...a)))}function e(a){return r.add(a),()=>{r.delete(a)}}async function s(...a){return t(...a)}function i(a){return e(a)}async function o(a){let{promise:l,resolve:p}=Bt(),h=i(async(...d)=>{a&&await a(...d),p(d),h()});return l}function n(){r.clear()}let c={pub:s,sub:i,publish:t,subscribe:e,on:e,next:o,clear:n};return Object.assign(i,c),Object.assign(s,c),c}function O(r){let t=Fr();return r&&t.sub(r),t.sub}function zt(r){let t=Fr();return r&&t.sub(r),t.pub}function fe(r){let t,e=!1,s=()=>{e=!0,clearTimeout(t)},i=async()=>{e||(await r(s),!e&&(t=setTimeout(i,0)))};return i(),s}var ct=class extends Set{array(){return[...this]}hasAll(...t){return t.every(e=>this.has(e))}adds(...t){for(let e of t)this.add(e);return this}deletes(...t){for(let e of t)this.delete(e);return this}};var ge=class{#t;#e;constructor(t,e){this.#e=t,this.#t=e}attr(t,e){return this.#e.attrs.set(t,e),this}children(...t){return this.#e.children.push(...t),this}render(){return this.#t(this.#e)}};var dr=class{#t=[];#e=new WeakMap;#r=[];#s=new Set;notifyRead(t){this.#t.at(-1)?.add(t)}async notifyWrite(t){if(this.#s.has(t))throw new Error("circularity forbidden");let e=this.#i(t).pub();return this.#r.at(-1)?.add(e),e}observe(t){this.#t.push(new Set);let e=t();return{seen:this.#t.pop(),result:e}}subscribe(t,e){return this.#i(t)(async()=>{let s=new Set;this.#r.push(s),this.#s.add(t),s.add(e()),this.#s.delete(t),await Promise.all(s),this.#r.pop()})}#i(t){let e=this.#e.get(t);return e||(e=O(),this.#e.set(t,e)),e}},_=globalThis[Symbol.for("e280.tracker")]??=new dr;var ht=class{sneak;constructor(t){this.sneak=t}get(){return _.notifyRead(this),this.sneak}get value(){return this.get()}};var lt=class extends ht{on=O();dispose(){this.on.clear()}};function ye(r,t=r){let{seen:e,result:s}=_.observe(r),i=R(0,t),o=[],n=()=>o.forEach(c=>c());for(let c of e){let a=_.subscribe(c,i);o.push(a)}return{result:s,dispose:n}}function pt(r,t){return r===t}var xe=class extends lt{#t;constructor(t,e){let s=e?.compare??pt,{result:i,dispose:o}=ye(t,async()=>{let n=t();!s(this.sneak,n)&&(this.sneak=n,await Promise.all([_.notifyWrite(this),this.on.pub(n)]))});super(i),this.#t=o}toString(){return`(derived "${String(this.get())}")`}dispose(){super.dispose(),this.#t()}get core(){return this}fn(){let t=this;function e(){return t.get()}return e.core=t,e.get=t.get.bind(t),e.on=t.on,e.dispose=t.dispose.bind(t),e.fn=t.fn.bind(t),Object.defineProperty(e,"value",{get:()=>t.value}),Object.defineProperty(e,"sneak",{get:()=>t.sneak}),e}};var we=class extends ht{#t;#e;#r=!1;#s;constructor(t,e){super(void 0),this.#t=t,this.#e=e?.compare??pt}toString(){return`($lazy "${String(this.get())}")`}get(){if(!this.#s){let{result:t,dispose:e}=ye(this.#t,()=>this.#r=!0);this.#s=e,this.sneak=t}if(this.#r){this.#r=!1;let t=this.#t();!this.#e(this.sneak,t)&&(this.sneak=t,_.notifyWrite(this))}return super.get()}dispose(){this.#s&&this.#s()}get core(){return this}fn(){let t=this;function e(){return t.get()}return e.core=t,e.get=t.get.bind(t),e.dispose=t.dispose.bind(t),e.fn=t.fn.bind(t),Object.defineProperty(e,"value",{get:()=>t.value}),Object.defineProperty(e,"sneak",{get:()=>t.sneak}),e}};var be=class extends lt{#t=!1;#e;constructor(t,e){super(t),this.#e=e?.compare??pt}toString(){return`($signal "${String(this.get())}")`}async set(t,e=!1){let s=this.sneak;return this.sneak=t,(e||!this.#e(s,t))&&await this.publish(),t}get value(){return this.get()}set value(t){this.set(t)}async publish(){if(this.#t)throw new Error("forbid circularity");let t=this.sneak,e=Promise.resolve();try{this.#t=!0,e=Promise.all([_.notifyWrite(this),this.on.publish(t)])}finally{this.#t=!1}return await e,t}get core(){return this}fn(){let t=this;function e(s){return arguments.length===0?t.get():t.set(arguments[0])}return e.core=t,e.get=t.get.bind(t),e.set=t.set.bind(t),e.on=t.on,e.dispose=t.dispose.bind(t),e.publish=t.publish.bind(t),e.fn=t.fn.bind(t),Object.defineProperty(e,"value",{get:()=>t.value,set:s=>t.value=s}),Object.defineProperty(e,"sneak",{get:()=>t.sneak,set:s=>t.sneak=s}),e}};function qs(r,t){return new we(r,t).fn()}function ve(r,t){return new xe(r,t).fn()}function g(r,t){return new be(r,t).fn()}g.lazy=qs;g.derived=ve;var q=class{#t=new A;effect(t,e){let{seen:s,result:i}=_.observe(t);for(let o of s)this.#t.guarantee(o,()=>_.subscribe(o,e));for(let[o,n]of this.#t)s.has(o)||(n(),this.#t.delete(o));return i}clear(){for(let t of this.#t.values())t();this.#t.clear()}};var ut=class{element;response;#t;constructor(t,e){this.element=t,this.response=e}start(){this.#t||(this.#t=f.attrs(this.element).on(this.response))}stop(){this.#t&&this.#t(),this.#t=void 0}};function $e(r,t){Qt(r,Us(t))}function Us(r){let t=[];if(Array.isArray(r)){let e=new Set(r.flat(1/0).reverse());for(let s of e)t.unshift(rt(s))}else r!==void 0&&t.push(rt(r));return t}var tt={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)=>tt.select(r,{loading:()=>["loading"],error:e=>["error",e],ready:e=>["ready",t(e)]}),all:(...r)=>{let t=[],e=[],s=0;for(let i of r)switch(i[0]){case"loading":s++;break;case"ready":t.push(i[1]);break;case"error":e.push(i[1]);break}return e.length>0?["error",e]:s===0?["ready",t]:["loading"]}};var Nt=class{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 load(t){return this.promise(t())}static all(...t){let e=t.map(s=>s.pod);return tt.all(...e)}signal;#t=0;#e=zt();#r=zt();constructor(t=["loading"]){this.signal=g(t)}get wait(){return new Promise((t,e)=>{this.#e.next().then(([s])=>t(s)),this.#r.next().then(([s])=>e(s))})}get then(){return this.wait.then.bind(this.wait)}get catch(){return this.wait.catch.bind(this.wait)}get finally(){return this.wait.finally.bind(this.wait)}async setLoading(){await this.signal.set(["loading"])}async setReady(t){await this.signal.set(["ready",t]),await this.#e(t)}async setError(t){await this.signal.set(["error",t]),await this.#r(t)}async promise(t){let e=++this.#t;await this.setLoading();try{let s=await t;return e===this.#t&&await this.setReady(s),s}catch(s){console.error(s),e===this.#t&&await this.setError(s)}}async load(t){return this.promise(t())}get pod(){return this.signal.get()}set pod(t){this.signal.set(t)}get status(){return this.signal.get()[0]}get value(){return tt.value(this.signal.get())}get error(){return tt.error(this.signal.get())}get isLoading(){return this.status==="loading"}get isReady(){return this.status==="ready"}get isError(){return this.status==="error"}require(){let t=this.signal.get();if(t[0]!=="ready")throw new Error("required value not ready");return t[1]}select(t){return tt.select(this.signal.get(),t)}morph(t){return tt.morph(this.pod,t)}};var Ae=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(),dt=class{element;shadow;renderNow;render;attrs;#t=0;#e=0;#r=new A;#s=Bt();#i=new Ae;[Lt](t){this.#t++,this.#e=0,this.#s=Bt();let e=t();return this.#s.resolve(),e}[Vt](){this.#i.unmountAll()}[qt](){this.#i.remountAll()}constructor(t,e,s,i){this.element=t,this.shadow=e,this.renderNow=s,this.render=i,this.attrs=f.attrs(this.element)}get renderCount(){return this.#t}get rendered(){return this.#s.promise}name(t){this.once(()=>this.element.setAttribute("view",t))}styles(...t){this.once(()=>$e(this.shadow,t))}css(...t){return this.styles(...t)}once(t){return this.#r.guarantee(this.#e++,t)}mount(t){return this.once(()=>this.#i.mount(t))}life(t){let e;return this.mount(()=>{let[s,i]=t();return e=s,i}),e}wake(t){return this.life(()=>[t(),()=>{}])}op=(()=>{let t=this;function e(s){return t.once(()=>Nt.load(s))}return e.load=e,e.promise=s=>this.once(()=>Nt.promise(s)),e})();signal=(()=>{let t=this;function e(s,i){return t.once(()=>g(s,i))}return e.derived=function(i,o){return t.once(()=>g.derived(i,o))},e.lazy=function(i,o){return t.once(()=>g.lazy(i,o))},e})();derived(t,e){return this.once(()=>g.derived(t,e))}lazy(t,e){return this.once(()=>g.lazy(t,e))}};var H=class extends HTMLElement{static styles;shadow;#t;#e=0;#r=new q;#s=new ut(this,()=>this.update());createShadow(){return this.attachShadow({mode:"open"})}constructor(){super(),this.shadow=this.createShadow(),this.#t=new dt(this,this.shadow,this.updateNow,this.update)}render(t){}updateNow=()=>{this.#t[Lt](()=>{f.render(this.shadow,this.#r.effect(()=>this.render(this.#t),this.update))})};update=R(0,this.updateNow);connectedCallback(){if(this.#e===0){let t=this.constructor.styles;t&&$e(this.shadow,t),this.updateNow()}else this.#t[qt]();this.#s.start(),this.#e++}disconnectedCallback(){this.#t[Vt](),this.#r.clear(),this.#s.stop()}};var Ht=class{props;attrs=new Map;children=[];constructor(t){this.props=t}};function Kr(r,t,e,s){return class extends t{static view=Ut(s,r);#t=new q;createShadow(){return this.attachShadow(r)}render(o){return s(o)(...this.#t.effect(()=>e(this),()=>this.update()))}}}var{I:Is}=Dr;var Yr=r=>r.strings===void 0,Gr=()=>document.createComment(""),mt=(r,t,e)=>{let s=r._$AA.parentNode,i=t===void 0?r._$AB:t._$AA;if(e===void 0){let o=s.insertBefore(Gr(),i),n=s.insertBefore(Gr(),i);e=new Is(o,n,r,r.options)}else{let o=e._$AB.nextSibling,n=e._$AM,c=n!==r;if(c){let a;e._$AQ?.(r),e._$AM=r,e._$AP!==void 0&&(a=r._$AU)!==n._$AU&&e._$AP(a)}if(o!==i||c){let a=e._$AA;for(;a!==o;){let l=a.nextSibling;s.insertBefore(a,i),a=l}}}return e},U=(r,t,e=r)=>(r._$AI(t,e),r),Ws={},Xr=(r,t=Ws)=>r._$AH=t,Jr=r=>r._$AH,Se=r=>{r._$AR(),r._$AA.remove()};var ke={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},It=r=>(...t)=>({_$litDirective$:r,values:t}),ft=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 Wt=(r,t)=>{let e=r._$AN;if(e===void 0)return!1;for(let s of e)s._$AO?.(t,!1),Wt(s,t);return!0},_e=r=>{let t,e;do{if((t=r._$AM)===void 0)break;e=t._$AN,e.delete(r),r=t}while(e?.size===0)},Zr=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),Gs(t)}};function Fs(r){this._$AN!==void 0?(_e(this),this._$AM=r,Zr(this)):this._$AM=r}function Ks(r,t=!1,e=0){let s=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(t)if(Array.isArray(s))for(let o=e;o<s.length;o++)Wt(s[o],!1),_e(s[o]);else s!=null&&(Wt(s,!1),_e(s));else Wt(this,r)}var Gs=r=>{r.type==ke.CHILD&&(r._$AP??=Ks,r._$AQ??=Fs)},Ee=class extends ft{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,s){super._$AT(t,e,s),Zr(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(Wt(this,t),_e(this))}setValue(t){if(Yr(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(){}};var Me=class r extends HTMLElement{static#t=!1;static make(){return this.#t||(f.register({SlyView:r},{soft:!0,upgrade:!0}),this.#t=!0),document.createElement("sly-view")}};var Ce=class{viewFn;settings;#t=Me.make();#e=new q;#r;#s;#i;#o=new ut(this.#t,()=>this.#a());constructor(t,e){this.viewFn=t,this.settings=e,this.#s=this.#t.attachShadow(this.settings),this.#r=new dt(this.#t,this.#s,this.#n,this.#a)}update(t){return this.#i=t,this.#n(),this.#t}#n=()=>{this.#r[Lt](()=>{let t=this.#e.effect(()=>this.viewFn(this.#r)(...this.#i.props),()=>this.#a());ce(this.#t,[...this.#i.attrs]),f.render(this.#s,t),f.render(this.#t,this.#i.children),this.#o.start()})};#a=R(0,this.#n);disconnected(){this.#r[Vt](),this.#e.clear(),this.#o.stop()}reconnected(){this.#r[qt](),this.#o.start()}};function Qr(r,t){return It(class extends Ee{#t=new Ce(r,t);render(s){return this.#t.update(s)}disconnected(){this.#t.disconnected()}reconnected(){this.#t.reconnected()}})}function Ut(r,t){let e=Qr(r,t);function s(...i){return e(new Ht(i))}return s.props=(...i)=>new ge(new Ht(i),e),s.component=(i=H)=>({props:o=>Kr(t,i,o,r)}),s}function b(r){return Ut(r,{mode:"open"})}b.settings=r=>({render:t=>Ut(t,r)});b.render=b;b.component=r=>b(t=>()=>r(t)).component(H).props(()=>[]);var E=S`
|
|
4
4
|
@layer reset {
|
|
5
5
|
* {
|
|
6
6
|
margin: 0;
|
|
@@ -16,92 +16,352 @@ function ne(r){return r.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}var
|
|
|
16
16
|
::-webkit-scrollbar-thumb { background: #333; border-radius: 1em; }
|
|
17
17
|
::-webkit-scrollbar-thumb:hover { background: #444; }
|
|
18
18
|
}
|
|
19
|
-
`;function
|
|
19
|
+
`;function u(r,t){return()=>Ys({hz:r,frames:t})}var Ys=b(r=>({hz:t,frames:e})=>{r.name("loading"),r.styles(E,Xs);let s=r.signal(0);return r.mount(()=>fe(async()=>{await at(1e3/t);let i=s.get()+1;s.set(i>=e.length?0:i)})),e.at(s.get())}),Xs=S`
|
|
20
20
|
:host {
|
|
21
21
|
font-family: monospace;
|
|
22
22
|
white-space: pre;
|
|
23
23
|
user-select: none;
|
|
24
24
|
}
|
|
25
|
-
`;var
|
|
25
|
+
`;var x=20,gt=10,yt=4,pc=u(x,["|","/","-","\\"]),uc=u(x,["\u2808","\u2810","\u2820","\u2880","\u2840","\u2804","\u2802","\u2801"]),dc=u(x,["\u2B06\uFE0F","\u2197\uFE0F","\u27A1\uFE0F","\u2198\uFE0F","\u2B07\uFE0F","\u2199\uFE0F","\u2B05\uFE0F","\u2196\uFE0F"]),mc=u(x,["\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"]),fc=u(x,["\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"]),gc=u(x,["\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"]),yc=u(x,["\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"]),xc=u(x,["\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"]),wc=u(x,["\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"]),bc=u(yt,["\u{1F6B6}","\u{1F3C3}"]),vc=u(gt,["\u25F7","\u25F6","\u25F5","\u25F4"]),$c=u(x,["=----","-=---","--=--","---=-","----=","----=","---=-","--=--","-=---","=----"]),Ac=u(x,["o----","-o---","--o--","---o-","----o","----o","---o-","--o--","-o---","o----"]),Sc=u(gt,["[ ]","[ ]","[= ]","[== ]","[===]","[ ==]","[ =]"]),kc=u(gt,["[ ]","[ ]","[= ]","[== ]","[===]","[ ==]","[ =]","[ ]","[ ]","[ =]","[ ==]","[===]","[== ]","[= ]"]),_c=u(gt,[" "," ",". ",".. ","..."," .."," ."]),Ec=u(x,[". ",". ",".. ","..."," .."," ."," ."," ..","...",".. "]),Mc=u(x,[".....",".....",":....","::...",":::..","::::.",":::::",":::::",".::::","..:::","...::","....:"]),Cc=u(x,[":....",":....","::...",".::..","..::.","...::","....:","....:","...::","..::.",".::..","::..."]),Pc=u(x,[".....",".....","..:..",".:::.",".:::.",":::::",":::::","::.::",":...:"]),Oc=u(x,[".....",".....","..:..",".:::.",".:::.",":::::",":::::","::.::",":...:",".....",".....",":...:","::.::",":::::",":::::",".:::.",".:::.","..:.."]),Rc=u(x,["000","100","110","111","011","001"]),Tc=u(x,["11111","01111","00111","10011","11001","01100","00110","10011","11001","11100","11110"]),Dc=u(x,["11111","01111","10111","11011","11101","11110","11111","11110","11101","11011","10111","01111"]),Bc=u(yt,["\u{1F539}","\u{1F535}"]),jc=u(gt,["\u{1F642}","\u{1F642}","\u{1F617}","\u{1F619}","\u{1F618}","\u{1F618}","\u{1F619}"]),zc=u(x,["\u{1F550}","\u{1F551}","\u{1F552}","\u{1F553}","\u{1F554}","\u{1F555}","\u{1F556}","\u{1F557}","\u{1F558}","\u{1F559}","\u{1F55A}","\u{1F55B}"]),Nc=u(x,["\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}"]),ts=u(yt,["\u{1F30E}","\u{1F30F}","\u{1F30D}"]),Lc=u(yt,["\u{1F513}","\u{1F512}"]),Vc=u(yt,["\u{1F505}","\u{1F506}"]),qc=u(yt,["\u{1F508}","\u{1F508}","\u{1F509}","\u{1F50A}","\u{1F50A}","\u{1F509}"]),Hc=u(gt,["\u{1F311}","\u{1F311}","\u{1F311}","\u{1F318}","\u{1F317}","\u{1F316}","\u{1F315}","\u{1F314}","\u{1F313}","\u{1F312}"]);var es=b(r=>t=>(r.name("error"),r.styles(E,Zs),typeof t=="string"?t:t instanceof Error?M`<strong>${t.name}:</strong> <span>${t.message}</span>`:"error")),Zs=S`
|
|
26
26
|
:host {
|
|
27
27
|
font-family: monospace;
|
|
28
28
|
color: red;
|
|
29
29
|
}
|
|
30
|
-
`;var x=class r{x;constructor(t){this.x=t}static new(t){return new this(t)}clone(){return new r(this.x)}set(t){return this.x=t,this}static isBetween(t,e=0,s=1){let o=Math.min(e,s),n=Math.max(e,s);return t>=o&&t<=n}isBetween(t=0,e=1){return r.isBetween(this.x,t,e)}static isNear(t,e,s=.01){return Math.abs(t-e)<=s}isNear(t,e=.01){return r.isNear(this.x,t,e)}static add(...t){let e=0;for(let s of t)e+=s;return e}add(...t){return this.x=r.add(this.x,...t),this}subtract(...t){for(let e of t)this.x-=e;return this}static atLeast(t,e=0){return Math.max(t,e)}atLeast(t=0){return this.x=r.atLeast(this.x,t),this}static atMost(t,e=1){return Math.min(t,e)}atMost(t=1){return this.x=r.atMost(this.x,t),this}static clamp(t,e=0,s=1){return t=r.atLeast(t,Math.min(e,s)),t=r.atMost(t,Math.max(e,s)),t}clamp(t=0,e=1){return this.x=r.clamp(this.x,t,e),this}static lerp(t,e,s,o){let i=(e-t)*s;return o!==void 0&&Math.abs(i)>o&&(i=Math.sign(i)*o),t+i}lerp(t,e,s){return this.x=r.lerp(this.x,t,e,s),this}static step(t,e,s){let o=e-t;return Math.abs(o)<=s?e:t+Math.sign(o)*s}step(t,e){return this.x=r.step(this.x,t,e),this}static creep(t,e,s,o){let n=t*(1-Math.exp(-e*s));if(o!==void 0){let i=o*s;Math.abs(n)>i&&(n=Math.sign(n)*i)}return n}static approach(t,e,s,o,n){let i=e-t,c=this.creep(i,s,o,n);return t+c}approach(t,e,s,o){return this.x=r.approach(this.x,t,e,s,o),this}static wrap(t,e=0,s=1){let o=Math.min(e,s),i=Math.max(e,s)-o,c=t-o,a=c<0?i- -c%i:c%i;return o+a}wrap(t=0,e=1){return this.x=r.wrap(this.x,t,e),this}static constrainProximity(t,e,s){let o=e-t,n=Math.abs(o),i=n>s?s:n,c=o<0?-i:i;return t+c}constrainProximity(t,e){return this.x=r.constrainProximity(this.x,t,e),this}static inverse(t){return 1-t}inverse(){return this.x=r.inverse(this.x),this}static center(t){return t*2-1}center(){return this.x=r.center(this.x),this}static uncenter(t){return(t+1)/2}uncenter(){return this.x=r.uncenter(this.x),this}static map(t,e,s){let n=(s-e)*t;return e+n}map(t,e){return this.x=r.map(this.x,t,e),this}static remap(t,e,s,o=0,n=1,i=!1){let a=(t-e)/(s-e)*(n-o)+o;return i?r.clamp(a,o,n):a}remap(t,e,s=0,o=1,n=!1){return this.x=r.remap(this.x,t,e,s,o,n),this}static magnify(t){return 4*Math.pow(t-.5,3)+.5}magnify(){return this.x=r.magnify(this.x),this}static floor(t){return Math.floor(t)}floor(){return this.x=r.floor(this.x),this}static ceil(t){return Math.ceil(t)}ceil(){return this.x=r.ceil(this.x),this}static round(t){return Math.round(t)}round(){return this.x=r.round(this.x),this}static smooth(t,e,s){return s<=1?e:t+(e-t)/s}smooth(t,e){return this.x=r.smooth(this.x,t,e),this}};var d=class r{x;y;constructor(t,e){this.x=t,this.y=e}static new(t,e){return new this(t,e)}static zero(){return new this(0,0)}static all(t){return new this(t,t)}static from(t){return Array.isArray(t)?new this(...t):new this(t.x,t.y)}static magnitudeSquared(t,e){return t*t+e*e}static magnitude(t,e){return Math.sqrt(this.magnitudeSquared(t,e))}static average(...t){return this.zero().add(...t).divideBy(t.length)}static min(...t){return new this(Math.min(...t.map(e=>e.x)),Math.min(...t.map(e=>e.y)))}static max(...t){return new this(Math.max(...t.map(e=>e.x)),Math.max(...t.map(e=>e.y)))}static fromAngle(t){return new this(Math.cos(t),Math.sin(t))}clone(){return new r(this.x,this.y)}*[Symbol.iterator](){yield this.x,yield this.y}toJSON(){return[this.x,this.y]}toString(){return`(Vec2 x${this.x.toFixed(2)}, y${this.y.toFixed(2)})`}set_(t,e){return this.x=t,this.y=e,this}set({x:t,y:e}){return this.x=t,this.y=e,this}magnitudeSquared(){return r.magnitudeSquared(this.x,this.y)}magnitude(){return r.magnitude(this.x,this.y)}rotation(){return Math.atan2(this.y,this.x)}equals_(t,e){return this.x===t&&this.y===e}equals(...t){return t.every(({x:e,y:s})=>this.equals_(e,s))}near_(t,e,s=1e-6){return Math.abs(this.x-t)<=s&&Math.abs(this.y-e)<=s}near({x:t,y:e},s=1e-6){return this.near_(t,e,s)}dot_(t,e){return this.x*t+this.y*e}dot({x:t,y:e}){return this.dot_(t,e)}distanceSquared_(t,e){return t=this.x-t,e=this.y-e,t*t+e*e}distanceSquared({x:t,y:e}){return this.distanceSquared_(t,e)}distance_(t,e){return Math.sqrt(this.distanceSquared_(t,e))}distance({x:t,y:e}){return this.distance_(t,e)}angleBetween_(t,e){let s=this.dot_(t,e),o=this.magnitude()*r.magnitude(t,e);if(o===0)return 0;let n=x.clamp(s/o,-1,1);return Math.acos(n)}angleBetween({x:t,y:e}){return this.angleBetween_(t,e)}normalize(){return this.divideBy(this.magnitude())}half(){return this.divideBy(2)}double(){return this.multiplyBy(2)}abs(){return this.map(t=>Math.abs(t))}rotate(t){let{x:e,y:s}=this;return this.x=e*Math.cos(t)-s*Math.sin(t),this.y=e*Math.sin(t)+s*Math.cos(t),this}perpendicular(){let{x:t,y:e}=this;return this.x=-e,this.y=t,this}clampMagnitude(t){return this.magnitude()>t&&this.normalize().multiplyBy(t),this}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}map(t){return this.x=t(this.x,0),this.y=t(this.y,1),this}clamp(t,e){return this.x=x.clamp(this.x,t.x,e.x),this.y=x.clamp(this.y,t.y,e.y),this}clampBy(t,e){return this.x=x.clamp(this.x,t,e),this.y=x.clamp(this.y,t,e),this}negate(){return this.map(t=>t*-1)}addBy(t){return this.x+=t,this.y+=t,this}subtractBy(t){return this.x-=t,this.y-=t,this}multiplyBy(t){return this.x*=t,this.y*=t,this}divideBy(t){return t===0?this:(this.x/=t,this.y/=t,this)}add_(t,e){return this.x+=t,this.y+=e,this}add(...t){for(let{x:e,y:s}of t)this.add_(e,s);return this}subtract_(t,e){return this.x-=t,this.y-=e,this}subtract(...t){for(let{x:e,y:s}of t)this.subtract_(e,s);return this}multiply_(t,e){return this.x*=t,this.y*=e,this}multiply(...t){for(let{x:e,y:s}of t)this.multiply_(e,s);return this}divide_(t,e){return t!==0&&(this.x/=t),e!==0&&(this.y/=e),this}divide(...t){for(let{x:e,y:s}of t)this.divide_(e,s);return this}lerp_(t,e,s){return this.x+=(t-this.x)*s,this.y+=(e-this.y)*s,this}lerp({x:t,y:e},s){return this.lerp_(t,e,s)}approach_(t,e,s,o,n){return this.x=x.approach(this.x,t,s,o,n),this.y=x.approach(this.y,e,s,o,n),this}approach({x:t,y:e},s,o,n){return this.approach_(t,e,s,o,n)}reflect_(t,e){let s=2*this.dot_(t,e);return this.x-=s*t,this.y-=s*e,this}reflect({x:t,y:e}){return this.reflect_(t,e)}rotateAroundPoint_(t,e,s){let o=this.x-t,n=this.y-e,i=Math.cos(s),c=Math.sin(s);return this.x=i*o-c*n+t,this.y=c*o+i*n+e,this}rotateAroundPoint({x:t,y:e},s){return this.rotateAroundPoint_(t,e,s)}smooth_(t,e,s){return this.x=x.smooth(this.x,t,s),this.y=x.smooth(this.y,e,s),this}smooth({x:t,y:e},s){return this.smooth_(t,e,s)}};var Fe=g`
|
|
30
|
+
`;function rs(r=ts,t=e=>es(e)){return(e,s)=>e.select({loading:r,ready:s,error:t})}var ss=S``;var y=class r{x;constructor(t){this.x=t}static new(t){return new this(t)}clone(){return new r(this.x)}set(t){return this.x=t,this}static isBetween(t,e=0,s=1){let i=Math.min(e,s),o=Math.max(e,s);return t>=i&&t<=o}isBetween(t=0,e=1){return r.isBetween(this.x,t,e)}static isNear(t,e,s=.01){return Math.abs(t-e)<=s}isNear(t,e=.01){return r.isNear(this.x,t,e)}static add(...t){let e=0;for(let s of t)e+=s;return e}add(...t){return this.x=r.add(this.x,...t),this}subtract(...t){for(let e of t)this.x-=e;return this}static atLeast(t,e=0){return Math.max(t,e)}atLeast(t=0){return this.x=r.atLeast(this.x,t),this}static atMost(t,e=1){return Math.min(t,e)}atMost(t=1){return this.x=r.atMost(this.x,t),this}static clamp(t,e=0,s=1){return t=r.atLeast(t,Math.min(e,s)),t=r.atMost(t,Math.max(e,s)),t}clamp(t=0,e=1){return this.x=r.clamp(this.x,t,e),this}static lerp(t,e,s,i){let n=(e-t)*s;return i!==void 0&&Math.abs(n)>i&&(n=Math.sign(n)*i),t+n}lerp(t,e,s){return this.x=r.lerp(this.x,t,e,s),this}static step(t,e,s){let i=e-t;return Math.abs(i)<=s?e:t+Math.sign(i)*s}step(t,e){return this.x=r.step(this.x,t,e),this}static creep(t,e,s,i){let o=t*(1-Math.exp(-e*s));if(i!==void 0){let n=i*s;Math.abs(o)>n&&(o=Math.sign(o)*n)}return o}static approach(t,e,s,i,o){let n=e-t,c=this.creep(n,s,i,o);return t+c}approach(t,e,s,i){return this.x=r.approach(this.x,t,e,s,i),this}static wrap(t,e=0,s=1){let i=Math.min(e,s),n=Math.max(e,s)-i,c=t-i,a=c<0?n- -c%n:c%n;return i+a}wrap(t=0,e=1){return this.x=r.wrap(this.x,t,e),this}static constrainProximity(t,e,s){let i=e-t,o=Math.abs(i),n=o>s?s:o,c=i<0?-n:n;return t+c}constrainProximity(t,e){return this.x=r.constrainProximity(this.x,t,e),this}static inverse(t){return 1-t}inverse(){return this.x=r.inverse(this.x),this}static center(t){return t*2-1}center(){return this.x=r.center(this.x),this}static uncenter(t){return(t+1)/2}uncenter(){return this.x=r.uncenter(this.x),this}static map(t,e,s){let o=(s-e)*t;return e+o}map(t,e){return this.x=r.map(this.x,t,e),this}static remap(t,e,s,i=0,o=1,n=!1){let a=(t-e)/(s-e)*(o-i)+i;return n?r.clamp(a,i,o):a}remap(t,e,s=0,i=1,o=!1){return this.x=r.remap(this.x,t,e,s,i,o),this}static magnify(t){return 4*Math.pow(t-.5,3)+.5}magnify(){return this.x=r.magnify(this.x),this}static floor(t){return Math.floor(t)}floor(){return this.x=r.floor(this.x),this}static ceil(t){return Math.ceil(t)}ceil(){return this.x=r.ceil(this.x),this}static round(t){return Math.round(t)}round(){return this.x=r.round(this.x),this}static smooth(t,e,s){return s<=1?e:t+(e-t)/s}smooth(t,e){return this.x=r.smooth(this.x,t,e),this}};var w=class r{x;y;constructor(t,e){this.x=t,this.y=e}static new(t,e){return new this(t,e)}static zero(){return new this(0,0)}static all(t){return new this(t,t)}static from(t){return Array.isArray(t)?new this(...t):new this(t.x,t.y)}static magnitudeSquared(t,e){return t*t+e*e}static magnitude(t,e){return Math.sqrt(this.magnitudeSquared(t,e))}static average(...t){return this.zero().add(...t).divideBy(t.length)}static min(...t){return new this(Math.min(...t.map(e=>e.x)),Math.min(...t.map(e=>e.y)))}static max(...t){return new this(Math.max(...t.map(e=>e.x)),Math.max(...t.map(e=>e.y)))}static fromAngle(t){return new this(Math.cos(t),Math.sin(t))}clone(){return new r(this.x,this.y)}*[Symbol.iterator](){yield this.x,yield this.y}toJSON(){return[this.x,this.y]}toString(){return`(Vec2 x${this.x.toFixed(2)}, y${this.y.toFixed(2)})`}set_(t,e){return this.x=t,this.y=e,this}set({x:t,y:e}){return this.x=t,this.y=e,this}magnitudeSquared(){return r.magnitudeSquared(this.x,this.y)}magnitude(){return r.magnitude(this.x,this.y)}rotation(){return Math.atan2(this.y,this.x)}equals_(t,e){return this.x===t&&this.y===e}equals(...t){return t.every(({x:e,y:s})=>this.equals_(e,s))}near_(t,e,s=1e-6){return Math.abs(this.x-t)<=s&&Math.abs(this.y-e)<=s}near({x:t,y:e},s=1e-6){return this.near_(t,e,s)}dot_(t,e){return this.x*t+this.y*e}dot({x:t,y:e}){return this.dot_(t,e)}distanceSquared_(t,e){return t=this.x-t,e=this.y-e,t*t+e*e}distanceSquared({x:t,y:e}){return this.distanceSquared_(t,e)}distance_(t,e){return Math.sqrt(this.distanceSquared_(t,e))}distance({x:t,y:e}){return this.distance_(t,e)}angleBetween_(t,e){let s=this.dot_(t,e),i=this.magnitude()*r.magnitude(t,e);if(i===0)return 0;let o=y.clamp(s/i,-1,1);return Math.acos(o)}angleBetween({x:t,y:e}){return this.angleBetween_(t,e)}normalize(){return this.divideBy(this.magnitude())}half(){return this.divideBy(2)}double(){return this.multiplyBy(2)}abs(){return this.map(t=>Math.abs(t))}rotate(t){let{x:e,y:s}=this;return this.x=e*Math.cos(t)-s*Math.sin(t),this.y=e*Math.sin(t)+s*Math.cos(t),this}perpendicular(){let{x:t,y:e}=this;return this.x=-e,this.y=t,this}clampMagnitude(t){return this.magnitude()>t&&this.normalize().multiplyBy(t),this}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}map(t){return this.x=t(this.x,0),this.y=t(this.y,1),this}morph(t){let e=t(this);return e&&e!==this&&this.set(e),this}clamp(t={x:0,y:0},e={x:1,y:1}){return this.x=y.clamp(this.x,t.x,e.x),this.y=y.clamp(this.y,t.y,e.y),this}clampBy(t=0,e=1){return this.x=y.clamp(this.x,t,e),this.y=y.clamp(this.y,t,e),this}negate(){return this.map(t=>t*-1)}addBy(t){return this.x+=t,this.y+=t,this}subtractBy(t){return this.x-=t,this.y-=t,this}multiplyBy(t){return this.x*=t,this.y*=t,this}divideBy(t){return t===0?this:(this.x/=t,this.y/=t,this)}add_(t,e){return this.x+=t,this.y+=e,this}add(...t){for(let{x:e,y:s}of t)this.add_(e,s);return this}subtract_(t,e){return this.x-=t,this.y-=e,this}subtract(...t){for(let{x:e,y:s}of t)this.subtract_(e,s);return this}multiply_(t,e){return this.x*=t,this.y*=e,this}multiply(...t){for(let{x:e,y:s}of t)this.multiply_(e,s);return this}divide_(t,e){return t!==0&&(this.x/=t),e!==0&&(this.y/=e),this}divide(...t){for(let{x:e,y:s}of t)this.divide_(e,s);return this}lerp_(t,e,s){return this.x+=(t-this.x)*s,this.y+=(e-this.y)*s,this}lerp({x:t,y:e},s){return this.lerp_(t,e,s)}approach_(t,e,s,i,o){return this.x=y.approach(this.x,t,s,i,o),this.y=y.approach(this.y,e,s,i,o),this}approach({x:t,y:e},s,i,o){return this.approach_(t,e,s,i,o)}reflect_(t,e){let s=2*this.dot_(t,e);return this.x-=s*t,this.y-=s*e,this}reflect({x:t,y:e}){return this.reflect_(t,e)}rotateAroundPoint_(t,e,s){let i=this.x-t,o=this.y-e,n=Math.cos(s),c=Math.sin(s);return this.x=n*i-c*o+t,this.y=c*i+n*o+e,this}rotateAroundPoint({x:t,y:e},s){return this.rotateAroundPoint_(t,e,s)}smooth_(t,e,s){return this.x=y.smooth(this.x,t,s),this.y=y.smooth(this.y,e,s),this}smooth({x:t,y:e},s){return this.smooth_(t,e,s)}};var Pe=class{state;players;constructor(t,e){this.state=t,this.players=e}tick(){for(let t of this.players){let{agent:e,port:{actions:s}}=t,i=1;e.position.y+=i*s.gameplay.up.value,e.position.y-=i*s.gameplay.down.value,e.position.x-=i*s.gameplay.left.value,e.position.x+=i*s.gameplay.right.value,e.position.clamp(w.zero(),this.state.arenaSize)}}};var Oe=class{label="0";alive=!0;color="#444";position=w.zero()};var Re=class{arenaSize=new w(200,100);agents=new Set;makeAgent(t){let e=new Oe;return e.label=t,e.position.set_(.5,.5).multiply(this.arenaSize),this.agents.add(e),e}deleteAgent(t){return this.agents.delete(t),this}};var xt=class{};function wt(r,{start:t,end:e}){return!(t&&r<t||e&&r>e)}var Te=class extends xt{#t=new Map;async gets(...t){return t.map(e=>this.#t.get(e))}async hasKeys(...t){return t.map(e=>this.#t.has(e))}async*keys(t={}){if(t.limit===0)return;let e=0;for(let s of this.#t.keys())if(wt(s,t)&&(yield s,e+=1),e>=(t.limit??1/0))break}async*entries(t={}){if(t.limit===0)return;let e=0;for(let[s,i]of this.#t.entries())if(wt(s,t)&&(yield[s,i],e+=1),e>=(t.limit??1/0))break}async transaction(...t){for(let[e,s]of t)s===void 0?this.#t.delete(e):this.#t.set(e,s)}};function is(r,t,e){let s=Object.entries(t);for(let[i,o]of s)r.addEventListener(i,o,e);return function(){for(let[o,n]of s)r.removeEventListener(o,n)}}var bt=class extends xt{storage;static onStorageEvent=t=>is(window,{storage:t});constructor(t=window.localStorage){super(),this.storage=t}async gets(...t){return t.map(e=>this.storage.getItem(e)??void 0)}async hasKeys(...t){return t.map(e=>this.storage.getItem(e)!==null)}async*keys(t={}){if(t.limit===0)return;let e=0;for(let s of Object.keys(this.storage))if(wt(s,t)&&(yield s,e+=1),e>=(t.limit??1/0))break}async*entries(t={}){if(t.limit===0)return;let e=0;for(let[s,i]of Object.entries(this.storage))if(wt(s,t)&&(yield[s,i],e+=1),e>=(t.limit??1/0))break}async transaction(...t){for(let[e,s]of t)s===void 0?this.storage.removeItem(e):this.storage.setItem(e,s)}};async function os(r){let t=[];for await(let e of r)t.push(e);return t}var De=class{kv;key;write;constructor(t,e){this.kv=t,this.key=e,this.write=new mr(t.write,e)}async set(t){return this.kv.set(this.key,t)}async get(){return this.kv.get(this.key)}async require(){return this.kv.require(this.key)}async guarantee(t){let e=await this.get();return e===void 0&&(e=await t(),await this.set(e)),e}},mr=class{key;#t;constructor(t,e){this.key=e,this.#t=t}set(t){return this.#t.set(this.key,t)}};var Ft={parse:r=>JSON.parse(r),stringify:r=>JSON.stringify(r)};var Be=class{#t;constructor(t){this.#t=t}sets(...t){return t.map(([e,s])=>{let i=this.#t.prefix(e),o=s===void 0?void 0:Ft.stringify(s);return[i,o]})}set(t,e){return this.sets([t,e])}del(...t){return t.map(e=>[this.#t.prefix(e),void 0])}};function*ns(r,t){if(r<=0)throw new Error("chunk size must be greater than zero");for(let e=0;e<t.length;e+=r)yield t.slice(e,e+r)}var je=class{#t;constructor(t){let{scopes:e,divisor:s,delimiter:i}=t;this.#t=e.length>0?e.join(s)+i:""}prefix=t=>this.#t+t;unprefix=t=>{let e=this.#t.length;return t.slice(e)};scan=t=>{let{limit:e}=t,s=this.#t+(t.start??""),i=this.#t+(t.end??"\xFF");return{limit:e,start:s,end:i}}};var ze=class r{driver;static collect=os;write;#t;#e;constructor(t=new Te,e={}){this.driver=t,this.#t={scopes:[],divisor:".",delimiter:":",chunkSize:1e4,...e},this.#e=new je(this.#t),this.write=new Be(this.#e)}async gets(...t){return(await this.driver.gets(...t.map(this.#e.prefix))).map(s=>s===void 0?s:Ft.parse(s))}async get(t){let[e]=await this.gets(t);return e}async requires(...t){let e=await this.gets(...t);for(let s of e)if(s===void 0)throw new Error("required key not found");return e}async require(t){let[e]=await this.requires(t);return e}async hasKeys(...t){return this.driver.hasKeys(...t.map(this.#e.prefix))}async has(t){let[e]=await this.hasKeys(t);return e}async*keys(t={}){for await(let e of this.driver.keys(this.#e.scan(t)))yield this.#e.unprefix(e)}async clear(t={}){let e=[];for await(let s of this.keys(t))e.push(s);for(let s of ns(this.#t.chunkSize,e))await this.del(...s)}async*entries(t={}){for await(let[e,s]of this.driver.entries(this.#e.scan(t)))yield[this.#e.unprefix(e),Ft.parse(s)]}async*values(t){for await(let[,e]of this.entries(t))yield e}async transaction(t){let e=t(this.write).flat();return this.driver.transaction(...e)}async set(t,e){return this.transaction(s=>[s.set(t,e)])}async sets(...t){return this.transaction(e=>[e.sets(...t)])}async del(...t){return this.transaction(e=>[e.del(...t)])}async guarantee(t,e){let s=await this.get(t);return s===void 0&&(s=await e(),await this.transaction(i=>[i.set(t,s)])),s}async versionMigration(t,e,s){let i=this,o=await i.get(t)??0;typeof o!="number"&&(o=0),o!==e&&(await s(o),await i.set(t,e))}store(t){return new De(this,t)}scope(t,e=this.#t.delimiter){return new r(this.driver,{...this.#t,delimiter:e,scopes:[...this.#t.scopes,t]})}flatten(){return new r(this.driver,{...this.#t,delimiter:""})}};var Kt=class r{profiles=new A;portProfiles=[];metaBindings=null;constructor(t){if(t){for(let e of t.profiles)this.profiles.set(e.id,e);this.portProfiles=t.portProfiles.map(e=>e&&(this.profiles.has(e)?e:null)),this.metaBindings=t.metaBindings}}toJSON(){return le.clone({profiles:[...this.profiles.values()],portProfiles:this.portProfiles,metaBindings:this.metaBindings})}clone(){return new r(this.toJSON())}getProfile(t){return this.profiles.get(t)}getProfileForPort(t){let e=this.portProfiles.at(t);return e?this.getProfile(e):void 0}};var Ne=class{store;$catalog;static async load(t){let e=g(new Kt(await t.get()));return new this(t,e)}dispose=C();constructor(t,e){this.store=t,this.$catalog=e,this.dispose.schedule(bt.onStorageEvent(async()=>this.reload()))}async reload(){let t=new Kt(await this.store.get());await this.$catalog.set(t)}async save(t){await this.store.set(t.toJSON()),await this.$catalog(t)}async#t(t){let e=this.$catalog().clone(),s=t(e);return await this.store.set(e.toJSON()),await this.$catalog(e),s}async createProfile(t,e){return this.#t(s=>{let i=ot.random(),o={id:i,label:t,bindings:e};return s.profiles.set(i,o),o})}async deleteProfile(t){return this.#t(e=>{e.profiles.delete(t)})}async assignPortToProfile(t,e){return this.#t(s=>{s.portProfiles[t]=e})}};function P(r){return r>0}var Le=class{on=O();onDown=O();#t=0;#e=0;get value(){return this.#t}set value(t){this.#e=this.#t,this.#t=t,this.on.publish(this),this.down&&this.onDown.publish(this)}get previous(){return this.#e}get changed(){return this.#t!==this.#e}get pressed(){return P(this.#t)}get down(){return!P(this.#e)&&P(this.#t)}get up(){return P(this.#e)&&!P(this.#t)}};var T=class extends A{constructor(t){if(super(),t)for(let[e,s]of t)this.set(e,s)}zero(){for(let t of this.keys())this.set(t,0);return this}mergeSample([t,e]){let s=this.get(t)??0;return e>s&&this.set(t,e),this}};function as([,,r]){return{lastValue:0,holdStart:0,settings:ri(r)}}function ei(){return{scale:1,invert:!1,range:null,bottom:null,top:null,timing:["direct"]}}function ri(r={}){return{...ei(),...r}}var cs=(r,t,e)=>ur(e).line(function(i){let{settings:o}=t;if(o.range){let[n,c]=o.range;i=y.isBetween(i,n,c)?y.remap(i,n,c,0,1,!0):0}return o.bottom&&(i=Math.max(o.bottom,i)),o.top&&(i=Math.min(o.top,i)),i},function(i){return t.settings.invert?1-i:i},function(i){return t.settings.scale*i},function(i){let{settings:o}=t,n=(o.timing[0]==="direct"?void 0:o.timing[1])??250,c=!P(t.lastValue)&&P(i),a=P(t.lastValue)&&!P(i),l=r-t.holdStart>=n;switch(c&&(t.holdStart=r),t.lastValue=i,o.timing[0]){case"direct":return i;case"tap":return a&&!l?1:0;case"hold":return P(i)&&l?i:0;default:throw new Error("unknown bindings timing")}});function hs(r){return r.length>0?Math.max(...r):0}function ls(r){return r.length>0?Math.min(...r):0}var Ve=class{bindings;actions;#t=new Set;#e=new T;#r=0;#s=new A;#i=zt();constructor(t){this.bindings=t,this.actions=jt(t,(e,s)=>jt(e,i=>{let o=new Le;return this.#i.subscribe(()=>{o.value=this.#t.has(s)?this.#n()(i):0}),o}))}resolve(t,e,s){return this.#r=t,this.#t=e,this.#e=s,this.#i(),this.actions}#o(t,e,s){let i=this.#s.guarantee(t,()=>as(["code",e,s])),o=this.#e.get(e)??0;return cs(this.#r,i,o)}#n=(t={count:0})=>e=>{let s=this.#n(t);if(typeof e=="string")return this.#o(t.count++,e);switch(e[0]){case"code":{let[,i,o]=e;return this.#o(t.count++,i,o)}case"and":{let[,...i]=e,o=i.map(s);return ls(o)}case"or":{let[,...i]=e,o=i.map(s);return hs(o)}case"not":{let[,i]=e;return s(i)>0?0:1}case"cond":{let[,i,o]=e;return s(o)>0?s(i):0}case"mods":{let[,i,o]=e,n=(a,...l)=>a?["or",...l]:["not",["or",...l]];return s(["cond",i,["and",n(o.ctrl??!1,"ControlLeft","ControlRight"),n(o.alt??!1,"AltLeft","AltRight"),n(o.meta??!1,"MetaLeft","MetaRight"),n(o.shift??!1,"ShiftLeft","ShiftRight")]])>0?s(i):0}}}};var I=class{*[Symbol.iterator](){for(let t of this.samples())yield t}};var vt=class extends I{devices=new ct;#t=new T;constructor(...t){super(),this.devices.adds(...t)}*samples(){this.#t.zero();for(let t of this.devices)for(let e of t.samples())this.#t.mergeSample(e);yield*this.#t.entries()}};var W=class extends Ve{#t=new vt;devices=this.#t.devices;modes=new ct;constructor(t){super(t),this.modes.adds(...Object.keys(t))}resolve(t=Date.now()){let e=new T(this.#t.samples());return super.resolve(t,this.modes,e)}};var et="meta";var $t=()=>({[et]:{revealOverlay:["or","Backslash","gamepad.beta","gamepad.gamma"],shimmyNext:["or","BracketRight",["and",["or","gamepad.beta","gamepad.gamma"],"gamepad.right"],["and",["or","gamepad.beta","gamepad.gamma"],"gamepad.bumper.right"]],shimmyPrevious:["or","BracketLeft",["and",["or","gamepad.beta","gamepad.gamma"],"gamepad.left"],["and",["or","gamepad.beta","gamepad.gamma"],"gamepad.bumper.left"]]}});var qe=class{device;metaPort;constructor(t,e=$t()){this.device=t,this.metaPort=new W(e),this.metaPort.devices.add(t)}};var He=class{ports;metaBindings;on=O();#t=new A;metaPort;constructor(t,e=$t()){this.ports=t,this.metaBindings=e,this.metaPort=new W(e)}poll(t=Date.now()){return this.#r(t),this.#s(t),this.#i(t)}portByIndex(t){let e=this.ports.at(t);if(!e)throw new Error(`port ${t} not found`);return e}portByDevice(t){for(let e of this.ports)if(e.devices.has(t))return e}shimmy(t,e){let s=this.ports.findIndex(c=>c.devices.has(t)),i=Math.max(0,this.ports.length-1),o=y.clamp(s+e,0,i),n=this.portByIndex(o);return this.reassign(t,n),n}reassign(t,e=this.getLonelyPort()){this.ports.forEach(s=>s.devices.delete(t)),e.devices.add(t),this.#e()}unplug(t){this.ports.forEach(e=>e.devices.delete(t)),this.#t.delete(t),this.#e()}plug=(t,e=this.getLonelyPort())=>(this.unplug(t),this.#t.set(t,new qe(t,this.metaBindings)),e.devices.add(t),this.#e(),()=>this.unplug(t));getLonelyPort(){let t=this.ports.at(0);for(let e of this.ports)e.devices.size<t.devices.size&&(t=e);return t}#e=R(0,()=>this.on.publish());#r(t){this.metaPort.devices.clear(),this.metaPort.devices.adds(...this.#t.keys()),this.metaPort.resolve(t)}#s(t){for(let e of this.#t.values()){let s=e.metaPort.resolve(t);s[et].shimmyNext.down&&this.shimmy(e.device,1),s[et].shimmyPrevious.down&&this.shimmy(e.device,-1)}}#i(t){return this.ports.map(e=>(e.resolve(t),e))}};function ps(r,t){let e=le.clone(r);if(!t)return e;for(let[s,i]of Object.entries(e))for(let o of Object.keys(i)){let n=t[s]?.[o];n&&(i[o]=n)}return e}var us=S`
|
|
31
31
|
|
|
32
32
|
:host {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
--gap: 0.3em;
|
|
34
|
+
pointer-events: none;
|
|
35
|
+
cursor: default;
|
|
36
|
+
user-select: none;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
.
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
.portlist {
|
|
40
|
+
pointer-events: none;
|
|
41
|
+
|
|
42
|
+
display: flex;
|
|
43
|
+
align-items: start;
|
|
44
|
+
|
|
45
|
+
width: max-content;
|
|
46
|
+
gap: var(--gap);
|
|
47
|
+
padding: 0.5em;
|
|
48
|
+
|
|
49
|
+
color: #fff8;
|
|
50
|
+
background: #222a;
|
|
51
|
+
border-radius: 1em;
|
|
52
|
+
|
|
53
|
+
opacity: 0;
|
|
54
|
+
transition: opacity 300ms linear;
|
|
55
|
+
|
|
56
|
+
&[data-active] {
|
|
57
|
+
opacity: 1;
|
|
58
|
+
pointer-events: all;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.port {
|
|
62
|
+
flex: 1 0 0;
|
|
63
|
+
display: flex;
|
|
64
|
+
flex-direction: column;
|
|
65
|
+
|
|
66
|
+
min-width: 6em;
|
|
67
|
+
gap: var(--gap);
|
|
68
|
+
|
|
69
|
+
> * {
|
|
70
|
+
color: white;
|
|
71
|
+
font-weight: bold;
|
|
72
|
+
text-shadow: 0.05em 0.05em 0.1em #0008;
|
|
73
|
+
text-transform: uppercase;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
header {
|
|
77
|
+
text-align: center;
|
|
78
|
+
color: #fff8;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.device {
|
|
82
|
+
display: flex;
|
|
83
|
+
flex-direction: column;
|
|
84
|
+
gap: var(--gap);
|
|
85
|
+
|
|
86
|
+
box-shadow: 0.1em 0.2em 0.7em #0004;
|
|
87
|
+
background: color-mix(in srgb, #fffa, var(--color) 50%);
|
|
88
|
+
border-top: 2px solid #fff8;
|
|
89
|
+
border-bottom: 2px solid #0004;
|
|
90
|
+
border-radius: 0.5em;
|
|
91
|
+
|
|
92
|
+
.row {
|
|
93
|
+
display: flex;
|
|
94
|
+
align-items: center;
|
|
95
|
+
|
|
96
|
+
&.primary {
|
|
97
|
+
justify-content: space-between;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
&.secondary {
|
|
101
|
+
justify-content: center;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.icon {
|
|
106
|
+
font-size: 1.5em;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.label {
|
|
110
|
+
font-family: monospace;
|
|
111
|
+
font-size: 0.8em;
|
|
112
|
+
opacity: 0.5;
|
|
113
|
+
line-height: 0.9em;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
button {
|
|
117
|
+
opacity: 0.2;
|
|
118
|
+
cursor: pointer;
|
|
119
|
+
padding: 0 0.2em;
|
|
120
|
+
font-family: monospace;
|
|
121
|
+
font-size: 1.5em;
|
|
122
|
+
font-weight: bold;
|
|
123
|
+
|
|
124
|
+
background: transparent;
|
|
125
|
+
border: 1px solid transparent;
|
|
126
|
+
text-shadow: inherit;
|
|
127
|
+
|
|
128
|
+
&:is(:hover, :focus-visible) {
|
|
129
|
+
opacity: 1;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
`;function ds(r){return t=>{let e=r(t);return b(s=>()=>e(s))}}var ms=ds(r=>t=>{t.css(E,us),t.attrs.string.deck="overlay";let{hub:e,deviceSkins:s,overlayVisibility:{$visible:i,$showLabels:o}}=r;function n(c){let a=s.get(c),l=`--color: ${a.color};`,p=()=>e.shimmy(c,1);return M`
|
|
137
|
+
<div class=device style="${l}">
|
|
138
|
+
<div class="primary row">
|
|
139
|
+
<button @click="${()=>e.shimmy(c,-1)}"><</button>
|
|
140
|
+
<div class=icon>${a.icon}</div>
|
|
141
|
+
<button @click="${p}">></button>
|
|
142
|
+
</div>
|
|
143
|
+
${o()?M`
|
|
144
|
+
<div class="secondary row">
|
|
145
|
+
<div class=label>${a.label}</div>
|
|
146
|
+
</div>
|
|
147
|
+
`:null}
|
|
148
|
+
</div>
|
|
149
|
+
`}return M`
|
|
150
|
+
<div class=portlist ?data-active="${i()}">
|
|
151
|
+
${e.ports.map((c,a)=>M`
|
|
152
|
+
<div class=port>
|
|
153
|
+
<header>P${a+1}</header>
|
|
154
|
+
${c.devices.array().map(n)}
|
|
155
|
+
</div>
|
|
156
|
+
`)}
|
|
157
|
+
</div>
|
|
158
|
+
`});function Gt(r){return r>=0?[r,0]:[0,Math.abs(r)]}function Yt(r){let[t,e]=Gt(r.x),[s,i]=Gt(r.y);return{up:i,down:s,left:e,right:t}}var L=class extends I{channel;$vector=g(w.zero());$breakdown=ve(()=>Yt(this.$vector.get()));constructor(t="stick"){super(),this.channel=t}samples(){let{channel:t}=this,{up:e,down:s,left:i,right:o}=this.$breakdown.get();return[[`${t}.up`,e],[`${t}.down`,s],[`${t}.left`,i],[`${t}.right`,o]]}};var D=class extends I{on=O();sampleMap=new T;setSample(t,e){return this.sampleMap.set(t,e),this.on.pub(t,e),this}*samples(){for(let t of this.sampleMap)yield t}};var At=class extends D{stickLeft=new L;stickRight=new L;samples(){let t=this.stickLeft.$breakdown();this.setSample("gamepad.stick.left.up",t.up),this.setSample("gamepad.stick.left.down",t.down),this.setSample("gamepad.stick.left.left",t.left),this.setSample("gamepad.stick.left.right",t.right);let e=this.stickRight.$breakdown();return this.setSample("gamepad.stick.right.up",e.up),this.setSample("gamepad.stick.right.down",e.down),this.setSample("gamepad.stick.right.left",e.left),this.setSample("gamepad.stick.right.right",e.right),super.samples()}};var Ue=class r extends D{client=new w(0,0);movement=new w(0,0);dispose=C();constructor(t=window){super(),this.dispose.schedule(Q(t,{pointerdown:e=>{let s=r.buttonCode(e);this.setSample(s,1)},pointerup:e=>{let s=r.buttonCode(e);this.setSample(s,0)},pointermove:e=>{this.client.x=e.clientX,this.client.y=e.clientY,this.movement.x+=e.movementX,this.movement.y+=e.movementY},wheel:e=>{for(let[s,i]of r.wheelCodes(e))this.setSample(s,i)}}))}static buttonCode(t){switch(t.button){case 0:return"pointer.button.left";case 1:return"pointer.button.middle";case 2:return"pointer.button.right";default:return`pointer.button.${t.button+1}`}}static wheelCodes(t){let e=[];return t.deltaX&&e.push([t.deltaX>0?"pointer.wheel.right":"pointer.wheel.left",t.deltaX]),t.deltaY&&e.push([t.deltaY>0?"pointer.wheel.down":"pointer.wheel.up",t.deltaY]),e}samples(){return this.#t(),super.samples()}#t(){let[t,e]=this.movement,[s,i]=Gt(t),[o,n]=Gt(e);t&&(t>=0?this.setSample("pointer.move.right",Math.abs(i)):this.setSample("pointer.move.left",Math.abs(s))),e&&(e>=0?this.setSample("pointer.move.up",Math.abs(n)):this.setSample("pointer.move.down",Math.abs(o))),this.movement.set_(0,0)}};var Ie=class extends D{dispose=C();constructor(t=window){super(),this.dispose.schedule(Q(t,this.#t)),this.dispose.schedule(Q(window,this.#e))}#t={keydown:t=>{if(t.repeat)return null;this.setSample(t.code,1)},keyup:t=>{if(t.repeat)return null;this.setSample(t.code,0)}};#e={blur:()=>{this.sampleMap.zero()}}};var F=class extends vt{keyboard=new Ie;pointer=new Ue;vpad=new At;constructor(){super(),this.devices.add(this.keyboard).add(this.pointer).add(this.vpad)}};function Xt(r,t){let e=w.from(r),s=e.distance_(0,0),i=y.remap(s,t.x,t.y,0,1,!0);return e.normalize().multiplyBy(i)}var si=["gamepad.a","gamepad.b","gamepad.x","gamepad.y","gamepad.bumper.left","gamepad.bumper.right","gamepad.trigger.left","gamepad.trigger.right","gamepad.alpha","gamepad.beta","gamepad.stick.left.click","gamepad.stick.right.click","gamepad.up","gamepad.down","gamepad.left","gamepad.right","gamepad.gamma"],St=class extends D{pad;range=new w(.2,.9);constructor(t){super(),this.pad=t}get gamepad(){return this.pad.gamepad}samples(){return this.#t(this.pad.gamepad),this.#e(this.pad.gamepad),super.samples()}#t(t){let e=0,s=i=>{e=Math.max(e,i)};for(let[i,o]of si.entries()){let n=t.buttons.at(i)?.value??0;s(n),this.setSample(o,n)}this.setSample("gamepad.any",e)}#e(t){let[e,s,i,o]=t.axes,n=Yt(Xt(new w(e,s),this.range)),c=Yt(Xt(new w(i,o),this.range));this.setSample("gamepad.stick.left.up",n.up),this.setSample("gamepad.stick.left.down",n.down),this.setSample("gamepad.stick.left.left",n.left),this.setSample("gamepad.stick.left.right",n.right),this.setSample("gamepad.stick.right.up",c.up),this.setSample("gamepad.stick.right.down",c.down),this.setSample("gamepad.stick.right.left",c.left),this.setSample("gamepad.stick.right.right",c.right)}};var We=class{fallback="\u2754";#t=new Map;constructor(t=[[F,"\u{1F4BB}"],[St,"\u{1F3AE}"],[At,"\u{1F4F1}"]]){this.add(...t)}get(t){return this.#t.get(t)??this.fallback}add(...t){for(let[e,s]of t)this.#t.set(e,s);return this}clear(){return this.#t.clear(),this}};var ii=r=>ue(r).map(t=>`hsl(${(t*(360/r)+180)%360}deg, 100%, 50%)`),Fe=class extends pe{constructor(){super(()=>ii(12))}};var fr=class{icon;label;color;constructor(t,e,s){this.icon=t,this.label=e,this.color=s}},kt=class{icons=new We;#t=new de;#e=new Fe;get(t){return this.#t.guarantee(t,()=>new fr(this.icons.get(t.constructor),ot.random(4),this.#e.takeFirst()))}};var Ke=class{hub;deviceSkins;auto=!0;dispose=C();#t=Date.now();#e=g(!1);$manual=g(!1);$visible=g.derived(()=>this.$manual()||this.auto&&this.#e());$showLabels=g(!1);constructor(t,e=new kt){this.hub=t,this.deviceSkins=e,this.dispose.schedule(t.on(async()=>{Date.now()-this.#t>100&&await this.bump()}))}#r=R(1500,()=>this.#e(!1));async bump(){await this.#e(!0),await this.#r()}async toggle(t=!this.$manual()){return this.$manual.set(t)}};var Ge=class{hub;db;static async load(t){let e=await Ne.load(t.kv.store("catalog")),s=ue(t.portCount).map(o=>e.$catalog().getProfileForPort(o)).map(o=>ps(t.bindings,o?.bindings)).map(o=>new W(o)),i=new He(s,e.$catalog().metaBindings??t.metaBindings??$t());return new this(i,e)}dispose=C();deviceSkins=new kt;overlayVisibility;primaryDevice=new F;views=me({DeckOverlay:ms}).map(t=>t(this));components=me(this.views).map(t=>t.component().props(e=>[]));registerComponents(){f.register(this.components)}constructor(t,e){this.hub=t,this.db=e,this.overlayVisibility=new Ke(t,this.deviceSkins),this.dispose.schedule(t.metaPort.actions[et].revealOverlay.on(s=>{s.pressed&&this.overlayVisibility.bump()}))}get catalog(){return this.db.$catalog()}};var gr=class{port;agent;constructor(t,e){this.port=t,this.agent=e}},Ye=class{#t=new A;constructor(t,e){for(let[s,i]of t.ports.entries()){let o=(s+1).toString();this.#t.set(i,new gr(i,e.makeAgent(o)))}}[Symbol.iterator](){return this.#t.values()}require(t){return this.#t.require(t)}};var Xe=class{state;canvas=(()=>{let t=document.createElement("canvas");return t.width=200,t.height=100,t})();ctx=this.canvas.getContext("2d");constructor(t){this.state=t}percent(t){let e=Math.min(this.canvas.width,this.canvas.height);return Math.ceil(e*(t/100))}resolve(t){return t.clone().divide(this.state.arenaSize).morph(e=>{e.y=1-e.y}).multiply_(this.canvas.width,this.canvas.height)}render(){let{state:t}=this;this.#e();let e=[...t.agents].reverse(),s=e.filter(o=>!o.alive),i=e.filter(o=>o.alive);for(let o of s)this.#r(o);for(let o of i)this.#s(o)}#t(){let{ctx:t}=this;return t.imageSmoothingEnabled=!1,t.fillStyle="#000",t.strokeStyle="#000",t.lineWidth=1,t.font="10px sans-serif",t.textAlign="center",t.textBaseline="middle",t}#e(){let{canvas:t}=this,e=this.#t();e.fillStyle="#000",e.fillRect(0,0,t.width,t.height)}#r(t){let e=this.#t(),s=this.percent(10),{position:i}=t,[o,n]=this.resolve(i);e.font=`${s*1.3}px sans-serif`,e.textAlign="center",e.textBaseline="middle",e.fillStyle="#fff4",e.fillText(t.label,o,n)}#s(t){let e=this.#t(),s=this.percent(10),{color:i,position:o}=t,[n,c]=this.resolve(o);e.beginPath(),e.arc(n,c,s,0,Math.PI*2),e.fillStyle=i,e.fill(),e.lineWidth=this.percent(2),e.strokeStyle="#fff",e.stroke(),e.font=`${s*1.3}px sans-serif`,e.textAlign="center",e.textBaseline="middle",e.strokeStyle="#0004",e.strokeText(t.label,n,c),e.fillStyle="#fff",e.fillText(t.label,n,c)}};var K=class extends L{hub;constructor(t){super(),this.hub=t}shimmyNext=()=>this.hub.shimmy(this,1);shimmyPrevious=()=>this.hub.shimmy(this,-1)};var fs={gameplay:{up:["or","KeyW","ArrowUp","stick.up","gamepad.stick.left.up","gamepad.stick.right.up"],down:["or","KeyS","ArrowDown","stick.down","gamepad.stick.left.down","gamepad.stick.right.down"],left:["or","KeyA","ArrowLeft","stick.left","gamepad.stick.left.left","gamepad.stick.right.left"],right:["or","KeyD","ArrowRight","stick.right","gamepad.stick.left.right","gamepad.stick.right.right"]}};function gs(r,t){let e=r;return()=>{let s=t();return s!=null&&(e=s),e}}var yr=class{get;constructor(t){this.get=t}get gamepad(){return this.get()}};function ys(r){let t=new A;return Q(window,{gamepadconnected:({gamepad:e})=>{let s=()=>navigator.getGamepads().at(e.index),i=new yr(gs(e,s)),o=r(i);t.set(e.index,{pad:i,dispose:o})},gamepaddisconnected:({gamepad:e})=>{let s=t.get(e.index);s&&(t.delete(e.index),s.dispose())}})}function xs(r){return ys(t=>r(new St(t)))}function ws(){let r=new bt(window.localStorage);return new ze(r).scope("tact")}var Je=class{deck;static async load(){return new this(await Ge.load({portCount:4,kv:ws(),bindings:fs}))}logic;dispose=C();state=new Re;renderer=new Xe(this.state);constructor(t){this.deck=t,this.deck.deviceSkins.icons.add([K,"\u{1F518}"]),this.logic=new Pe(this.state,new Ye(t.hub,this.state)),this.dispose.schedule(this.deck.hub.on(()=>{for(let e of this.logic.players){e.agent.alive=e.port.devices.size>0;let[s]=e.port.devices;e.agent.color=s?this.deck.deviceSkins.get(s).color:"#444"}})),this.plug(new F),this.plug(new K(t.hub)),this.dispose.schedule(xs(t.hub.plug))}plug(t){return this.deck.hub.plug(t),()=>this.unplug(t)}unplug(t){this.deck.hub.unplug(t)}loop(t){return fe(async()=>{await at(1e3/t),this.deck.hub.poll(),this.logic.tick(),this.renderer.render()})}};var bs=rs();var vs=(r,t,e)=>{let s=new Map;for(let i=t;i<=e;i++)s.set(r[i],i);return s},$s=It(class extends ft{constructor(r){if(super(r),r.type!==ke.CHILD)throw Error("repeat() can only be used in text expressions")}dt(r,t,e){let s;e===void 0?e=t:t!==void 0&&(s=t);let i=[],o=[],n=0;for(let c of r)i[n]=s?s(c,n):n,o[n]=e(c,n),n++;return{values:o,keys:i}}render(r,t,e){return this.dt(r,t,e).values}update(r,[t,e,s]){let i=Jr(r),{values:o,keys:n}=this.dt(t,e,s);if(!Array.isArray(i))return this.ut=n,o;let c=this.ut??=[],a=[],l,p,h=0,d=i.length-1,m=0,v=o.length-1;for(;h<=d&&m<=v;)if(i[h]===null)h++;else if(i[d]===null)d--;else if(c[h]===n[m])a[m]=U(i[h],o[m]),h++,m++;else if(c[d]===n[v])a[v]=U(i[d],o[v]),d--,v--;else if(c[h]===n[v])a[v]=U(i[h],o[v]),mt(r,a[v+1],i[h]),h++,v--;else if(c[d]===n[m])a[m]=U(i[d],o[m]),mt(r,i[h],i[d]),d--,m++;else if(l===void 0&&(l=vs(n,m,v),p=vs(c,h,d)),l.has(c[h]))if(l.has(c[d])){let B=p.get(n[m]),tr=B!==void 0?i[B]:null;if(tr===null){let xr=mt(r,i[h]);U(xr,o[m]),a[m]=xr}else a[m]=U(tr,o[m]),mt(r,i[h],tr),i[B]=null;m++}else Se(i[d]),d--;else Se(i[h]),h++;for(;m<=v;){let B=mt(r,a[v+1]);U(B,o[m]),a[m++]=B}for(;h<=d;){let B=i[h++];B!==null&&Se(B)}return this.ut=n,Xr(r,a),N}});var As=S`
|
|
159
|
+
|
|
160
|
+
:host {
|
|
161
|
+
display: flex;
|
|
162
|
+
flex-direction: column;
|
|
163
|
+
align-items: center;
|
|
164
|
+
|
|
165
|
+
gap: 1em;
|
|
42
166
|
}
|
|
43
167
|
|
|
44
|
-
|
|
168
|
+
.surface {
|
|
169
|
+
position: relative;
|
|
45
170
|
width: 100%;
|
|
46
|
-
height:
|
|
171
|
+
height: auto;
|
|
172
|
+
aspect-ratio: 2 / 1;
|
|
173
|
+
overflow: hidden;
|
|
174
|
+
|
|
175
|
+
background: #000;
|
|
176
|
+
border: 0.5em solid #fff4;
|
|
177
|
+
border-radius: 2em;
|
|
178
|
+
|
|
179
|
+
canvas {
|
|
180
|
+
display: block;
|
|
181
|
+
position: absolute;
|
|
182
|
+
inset: 0;
|
|
183
|
+
|
|
184
|
+
width: 100%;
|
|
185
|
+
height: 100%;
|
|
186
|
+
|
|
187
|
+
image-rendering: pixelated;
|
|
188
|
+
outline: 1px solid red;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
[deck="overlay"] {
|
|
192
|
+
position: absolute;
|
|
193
|
+
top: 10%;
|
|
194
|
+
left: 0;
|
|
195
|
+
right: 0;
|
|
196
|
+
|
|
197
|
+
display: flex;
|
|
198
|
+
justify-content: center;
|
|
199
|
+
align-items: center;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.dlist {
|
|
204
|
+
display: flex;
|
|
205
|
+
flex-wrap: wrap;
|
|
206
|
+
justify-content: center;
|
|
207
|
+
align-items: center;
|
|
208
|
+
gap: 0.5em;
|
|
47
209
|
}
|
|
48
210
|
|
|
49
|
-
`;var
|
|
211
|
+
`;var Ss=S`
|
|
50
212
|
|
|
51
213
|
:host {
|
|
52
|
-
|
|
53
|
-
width: 8em;
|
|
54
|
-
height: 8em;
|
|
55
|
-
--size: var(--nub-stick-size, 66%);
|
|
56
|
-
--background: var(--nub-stick-background, black);
|
|
57
|
-
--color: var(--nub-stick-color, white);
|
|
214
|
+
--color: #aaa;
|
|
58
215
|
}
|
|
59
216
|
|
|
60
|
-
|
|
217
|
+
.box {
|
|
218
|
+
display: flex;
|
|
219
|
+
align-items: center;
|
|
220
|
+
justify-content: center;
|
|
221
|
+
|
|
222
|
+
gap: 0.2em;
|
|
223
|
+
padding: 0.2em;
|
|
224
|
+
padding-right: 0.5em;
|
|
225
|
+
|
|
226
|
+
border-radius: 2em;
|
|
227
|
+
background: color-mix(in srgb, #fff4, var(--color));
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
[view="nub-stick"] {
|
|
231
|
+
width: 2em;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.label {
|
|
235
|
+
font-size: 1.2em;
|
|
236
|
+
font-weight: bold;
|
|
237
|
+
|
|
238
|
+
padding: 0 0.5em;
|
|
239
|
+
text-align: center;
|
|
240
|
+
|
|
241
|
+
color: white;
|
|
242
|
+
text-shadow: 0.1em 0.1em 0.1em #0004;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
button {
|
|
246
|
+
font-size: 0.8em;
|
|
247
|
+
padding: 0.2em;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
`;var ks=S`
|
|
251
|
+
|
|
252
|
+
:host {
|
|
253
|
+
--nub-size: 60%;
|
|
254
|
+
--nub-color: #fff8;
|
|
255
|
+
|
|
61
256
|
position: relative;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
257
|
+
display: block;
|
|
258
|
+
|
|
259
|
+
cursor: default;
|
|
260
|
+
user-select: none;
|
|
261
|
+
|
|
262
|
+
width: 6em;
|
|
263
|
+
height: auto;
|
|
264
|
+
aspect-ratio: 1 / 1;
|
|
265
|
+
|
|
266
|
+
background: #0008;
|
|
66
267
|
border-radius: 100%;
|
|
268
|
+
outline: 1px solid color-mix(in srgb, transparent, var(--nub-color) 10%);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
:host * {
|
|
272
|
+
pointer-events: none;
|
|
67
273
|
}
|
|
68
274
|
|
|
69
|
-
|
|
275
|
+
.frame {
|
|
70
276
|
position: absolute;
|
|
71
277
|
inset: 0;
|
|
72
|
-
width: var(--size);
|
|
73
|
-
height: var(--size);
|
|
74
|
-
border-radius: 100%;
|
|
75
278
|
margin: auto;
|
|
76
|
-
|
|
77
|
-
|
|
279
|
+
|
|
280
|
+
width: 100%;
|
|
281
|
+
height: auto;
|
|
282
|
+
aspect-ratio: 1 / 1;
|
|
283
|
+
|
|
284
|
+
> div {
|
|
285
|
+
position: absolute;
|
|
286
|
+
inset: 0;
|
|
287
|
+
margin: auto;
|
|
288
|
+
width: var(--nub-size);
|
|
289
|
+
height: auto;
|
|
290
|
+
aspect-ratio: 1 / 1;
|
|
291
|
+
border-radius: 100%;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.inner {
|
|
296
|
+
outline: 1px solid color-mix(in srgb, transparent, var(--nub-color) 10%);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
.outer {
|
|
300
|
+
outline: 1px solid color-mix(in srgb, transparent, var(--nub-color) 10%);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.stickbase {
|
|
304
|
+
display: none;
|
|
305
|
+
background: color-mix(in srgb, transparent, var(--nub-color) 25%);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.stickunder {
|
|
309
|
+
background: color-mix(in srgb, transparent, var(--nub-color) 50%);
|
|
78
310
|
}
|
|
79
311
|
|
|
80
|
-
|
|
81
|
-
|
|
312
|
+
.stick {
|
|
313
|
+
background: #fff8;
|
|
82
314
|
}
|
|
83
315
|
|
|
84
|
-
`;var
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
316
|
+
`;var oi=b(r=>({$vector:t})=>{r.name("nub-stick"),r.css(E,ks);let e=r.once(()=>new w(.2,.8)),s=r.signal(void 0);r.mount(()=>{function a(p){let h=r.element.getBoundingClientRect(),d=t.get();d.x=y.remap(p.clientX,h.left,h.right,-1,1),d.y=y.remap(p.clientY,h.top,h.bottom,-1,1),d.set(Xt(d,e)),t.publish()}function l(){s.value!==void 0&&(t.get().set_(0,0),t.publish(),at(0).then(()=>{s.value!==void 0&&(r.element.releasePointerCapture(s.value),s.value=void 0)}))}return Ir(f.events(document.body,{click:[{capture:!0},p=>{s.value!==void 0&&(p.preventDefault(),p.stopPropagation())}]}),f.events(r.element,{pointerdown:p=>{s.value===void 0&&(s.value=p.pointerId,r.element.setPointerCapture(s.value),a(p))},pointermove:[{},p=>{s.value!==void 0&&a(p)}],pointerup:l,pointercancel:l}))});let i=t.get(),o=`width: ${e.x*100}%;`,n=`width: ${e.y*100}%;`,c=a=>{let l=a*.5,p=l*i.x*100,h=l*i.y*100;return`
|
|
317
|
+
transform-origin: center center;
|
|
318
|
+
transform: translate(${p}%, ${h}%);
|
|
319
|
+
`};return M`
|
|
320
|
+
<div class=frame>
|
|
321
|
+
<div class=inner style="${o}"></div>
|
|
322
|
+
</div>
|
|
323
|
+
|
|
324
|
+
<div class=frame>
|
|
325
|
+
<div class=outer style="${n}"></div>
|
|
326
|
+
</div>
|
|
327
|
+
|
|
328
|
+
<div class=frame>
|
|
329
|
+
<div class=stickbase></div>
|
|
330
|
+
</div>
|
|
331
|
+
|
|
332
|
+
<div class=frame style="${c(.5)}">
|
|
333
|
+
<div class=stickunder></div>
|
|
334
|
+
</div>
|
|
335
|
+
|
|
336
|
+
<div class=frame style="${c(1)}">
|
|
337
|
+
<div class=stick></div>
|
|
338
|
+
</div>
|
|
339
|
+
`}),Ze=class extends oi.component(class extends H{device=new L}).props(t=>[t.device]){};var _s=b(r=>(t,e,s)=>{r.styles(E,Ss),r.attrs.string.device="virtual";let i=()=>t.unplug(e);return M`
|
|
340
|
+
<div class=box>
|
|
341
|
+
${Ze.view(e)}
|
|
342
|
+
|
|
343
|
+
<button @click="${e.shimmyPrevious}">👈</button>
|
|
344
|
+
<button @click="${i}">💀</button>
|
|
345
|
+
<button @click="${e.shimmyNext}">👉</button>
|
|
346
|
+
</div>
|
|
347
|
+
`});var Es=b(r=>t=>{r.css(E,As),r.mount(()=>t.loop(60)),r.mount(()=>t.deck.hub.on(r.render));let e=()=>t.plug(new K(t.deck.hub)),s=()=>t.deck.overlayVisibility.bump(),i=t.deck.hub.ports.flatMap(o=>o.devices.array()).filter(o=>o instanceof K).map(o=>({device:o,skin:t.deck.deviceSkins.get(o)})).sort((o,n)=>o.skin.label<n.skin.label?-1:1);return M`
|
|
348
|
+
<div class=surface>
|
|
349
|
+
${t.renderer.canvas}
|
|
350
|
+
${t.deck.views.DeckOverlay()}
|
|
93
351
|
</div>
|
|
94
|
-
|
|
95
|
-
<div
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
@
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
${
|
|
352
|
+
|
|
353
|
+
<div class=dlist>
|
|
354
|
+
${$s(i,o=>o.skin.label,({device:o,skin:n})=>_s.props(t.deck.hub,o,n).attr("style",`--color: ${n.color};`).render())}
|
|
355
|
+
|
|
356
|
+
<button @click="${e}">
|
|
357
|
+
✨
|
|
358
|
+
</button>
|
|
359
|
+
|
|
360
|
+
<button @click="${s}">
|
|
361
|
+
👁️
|
|
362
|
+
</button>
|
|
103
363
|
</div>
|
|
104
|
-
`});var
|
|
364
|
+
`});var Qe=class extends b.component(t=>{t.css(E,ss);let e=t.op.load(async()=>Je.load());return bs(e,s=>Es(s))}){};f.register({TactDemo:Qe});console.log("\u{1F3AE} tact");
|
|
105
365
|
/*! Bundled license information:
|
|
106
366
|
|
|
107
367
|
@lit/reactive-element/css-tag.js:
|
|
@@ -116,6 +376,7 @@ lit-html/lit-html.js:
|
|
|
116
376
|
lit-element/lit-element.js:
|
|
117
377
|
lit-html/directive.js:
|
|
118
378
|
lit-html/async-directive.js:
|
|
379
|
+
lit-html/directives/repeat.js:
|
|
119
380
|
(**
|
|
120
381
|
* @license
|
|
121
382
|
* Copyright 2017 Google LLC
|