@benev/tact 0.3.0-5 → 0.4.0-0

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.
Files changed (504) hide show
  1. package/README.md +72 -53
  2. package/package.json +18 -20
  3. package/s/_archive/deck/deck.ts +76 -53
  4. package/s/_archive/demo/demo-app/element.ts +17 -0
  5. package/s/_archive/{deck/views/bindings → demo/demo-app}/style.css.ts +4 -0
  6. package/s/_archive/demo/main.bundle.ts +67 -6
  7. package/s/_archive/demo/main.css +6 -8
  8. package/s/_archive/lib/bindings/resolver.ts +61 -0
  9. package/s/_archive/lib/bindings/types.ts +67 -0
  10. package/s/_archive/lib/bindings/utils/action-resolver.ts +51 -0
  11. package/s/_archive/lib/bindings/utils/evaluator.ts +162 -0
  12. package/s/_archive/lib/bindings/utils/hash-bindings.ts +22 -0
  13. package/s/_archive/lib/bindings/utils/intent-coding.ts +50 -0
  14. package/s/_archive/lib/bindings/utils/intent-resolver.ts +52 -0
  15. package/s/_archive/lib/bindings/utils/investigate.ts +47 -0
  16. package/s/_archive/lib/bindings/utils/is-expression.ts +11 -0
  17. package/s/_archive/lib/index.ts +12 -0
  18. package/s/_archive/lib/sampling/sources/example.ts +7 -0
  19. package/s/_archive/lib/sampling/sources/gamepad.ts +63 -0
  20. package/s/_archive/lib/sampling/sources/keyboard.ts +52 -0
  21. package/s/_archive/lib/sampling/sources/pointer.ts +56 -0
  22. package/s/_archive/lib/sampling/sources/sources.ts +13 -0
  23. package/s/_archive/lib/sampling/sources/stick.ts +27 -0
  24. package/s/_archive/lib/sampling/types.ts +11 -0
  25. package/s/_archive/lib/sampling/utils/add-sample.ts +12 -0
  26. package/s/_archive/lib/test.ts +57 -0
  27. package/s/_archive/lib/utils/backwards.ts +6 -0
  28. package/s/_archive/lib/utils/mouse-button.ts +10 -0
  29. package/s/_archive/lib/utils/pad/on-pad.ts +50 -0
  30. package/s/_archive/lib/utils/pad/pad.ts +10 -0
  31. package/s/_archive/lib2/core/decoder/decoder.ts +34 -0
  32. package/s/_archive/lib2/core/decoder/utils/update-input.ts +21 -0
  33. package/s/_archive/lib2/core/encoder/encoder.ts +60 -0
  34. package/s/_archive/lib2/core/encoder/evaluate/context.ts +22 -0
  35. package/s/_archive/lib2/core/encoder/evaluate/evaluate.ts +144 -0
  36. package/s/_archive/lib2/core/encoder/parts/expression-index.ts +27 -0
  37. package/s/_archive/lib2/core/encoder/parts/hash-bindings.ts +22 -0
  38. package/s/_archive/lib2/core/encoder/parts/investigate.ts +50 -0
  39. package/s/_archive/lib2/core/encoder/parts/sampler.ts +22 -0
  40. package/s/_archive/lib2/core/sources/example.ts +9 -0
  41. package/s/_archive/lib2/core/sources/sources.ts +16 -0
  42. package/s/_archive/lib2/core/types.ts +78 -0
  43. package/s/_archive/lib2/core/utils/data.ts +50 -0
  44. package/s/_archive/lib2/core/utils/is-down.ts +5 -0
  45. package/s/_archive/lib2/core/utils/is-expression.ts +11 -0
  46. package/s/_archive/lib3/input/data/decode.ts +25 -0
  47. package/s/_archive/lib3/input/data/encode.ts +24 -0
  48. package/s/_archive/lib3/input/data/params.ts +7 -0
  49. package/s/_archive/lib3/input/decoder.ts +56 -0
  50. package/s/_archive/lib3/input/encoder.ts +99 -0
  51. package/s/_archive/lib3/input/evaluate/context.ts +15 -0
  52. package/s/_archive/lib3/input/evaluate/evaluate.ts +142 -0
  53. package/s/_archive/lib3/input/evaluate/utils/clock.ts +14 -0
  54. package/s/_archive/lib3/input/investigate/hash-bindings.ts +22 -0
  55. package/s/_archive/lib3/input/investigate/investigate.ts +42 -0
  56. package/s/_archive/lib3/input/investigate/is-expression.ts +11 -0
  57. package/s/_archive/lib3/input/investigate/make-input.ts +18 -0
  58. package/s/_archive/lib3/input/investigate/root-index.ts +26 -0
  59. package/s/_archive/lib3/input/mixer.ts +20 -0
  60. package/s/_archive/lib3/input/sources/gamepad.ts +58 -0
  61. package/s/_archive/lib3/input/sources/keyboard.ts +49 -0
  62. package/s/_archive/lib3/input/sources/plain.ts +9 -0
  63. package/s/_archive/lib3/input/sources/pointer.ts +58 -0
  64. package/s/_archive/lib3/input/sources/sources.ts +24 -0
  65. package/s/_archive/lib3/input/sources/stick.ts +29 -0
  66. package/s/_archive/lib3/input/testing/quickbind.ts +20 -0
  67. package/s/_archive/lib3/input/types.ts +96 -0
  68. package/s/_archive/lib3/input/utils/evergreen.ts +10 -0
  69. package/s/_archive/lib3/input/utils/is-down.ts +5 -0
  70. package/s/_archive/lib3/input/utils/mouse-button.ts +10 -0
  71. package/s/_archive/lib3/input/utils/pad/on-pad.ts +50 -0
  72. package/s/_archive/lib3/input/utils/pad/pad.ts +10 -0
  73. package/s/_archive/lib3/input/utils/sampler.ts +28 -0
  74. package/s/_archive/lib3/input/utils/split-axis.ts +15 -0
  75. package/s/_archive/lib3/test.ts +100 -0
  76. package/s/_archive/lib4/input/data/decode.ts +25 -0
  77. package/s/_archive/lib4/input/data/encode.ts +24 -0
  78. package/s/_archive/lib4/input/data/params.ts +7 -0
  79. package/s/_archive/lib4/input/encoder.ts +100 -0
  80. package/s/_archive/lib4/input/evaluate/context.ts +16 -0
  81. package/s/_archive/lib4/input/evaluate/evaluate.ts +157 -0
  82. package/s/_archive/lib4/input/evaluate/utils/clock.ts +14 -0
  83. package/s/_archive/lib4/input/investigate/hash-bindings.ts +22 -0
  84. package/s/_archive/lib4/input/investigate/investigate.ts +37 -0
  85. package/s/_archive/lib4/input/investigate/is.ts +19 -0
  86. package/s/_archive/lib4/input/investigate/make-input.ts +18 -0
  87. package/s/_archive/lib4/input/investigate/root-index.ts +26 -0
  88. package/s/_archive/lib4/input/sources/gamepad.ts +58 -0
  89. package/s/_archive/lib4/input/sources/keyboard.ts +46 -0
  90. package/s/_archive/lib4/input/sources/plain.ts +9 -0
  91. package/s/_archive/lib4/input/sources/pointer.ts +50 -0
  92. package/s/_archive/lib4/input/sources/sources.ts +24 -0
  93. package/s/_archive/lib4/input/sources/stick.ts +25 -0
  94. package/s/_archive/lib4/input/types.ts +102 -0
  95. package/s/_archive/lib4/input/utils/evergreen.ts +10 -0
  96. package/s/_archive/lib4/input/utils/is-down.ts +5 -0
  97. package/s/_archive/lib4/input/utils/mouse-button.ts +10 -0
  98. package/s/_archive/lib4/input/utils/pad/on-pad.ts +50 -0
  99. package/s/_archive/lib4/input/utils/pad/pad.ts +10 -0
  100. package/s/_archive/lib4/input/utils/sampler.ts +28 -0
  101. package/s/_archive/lib4/input/utils/split-axis.ts +15 -0
  102. package/s/_archive/lib4/test.ts +12 -0
  103. package/s/_archive/utils/circular-clamp.ts +2 -2
  104. package/s/_archive/utils/is-down.ts +5 -0
  105. package/s/demo/demo-app/element.ts +2 -4
  106. package/s/demo/main.bundle.ts +2 -65
  107. package/s/gamepad/gamepad-app/element.ts +14 -11
  108. package/s/lib/index.ts +18 -0
  109. package/s/lib/input/data/decode.ts +25 -0
  110. package/s/lib/input/data/encode.ts +24 -0
  111. package/s/lib/input/data/params.ts +7 -0
  112. package/s/lib/input/decoder.ts +40 -0
  113. package/s/lib/input/encoder.ts +64 -0
  114. package/s/lib/input/evaluate/context.ts +17 -0
  115. package/s/lib/input/evaluate/evaluate.ts +199 -0
  116. package/s/lib/input/expression.ts +44 -0
  117. package/s/lib/input/investigate/hash-bindings.ts +22 -0
  118. package/s/lib/input/investigate/investigate.ts +35 -0
  119. package/s/lib/input/investigate/is-compatible.ts +8 -0
  120. package/s/lib/input/investigate/is-expression.ts +12 -0
  121. package/s/lib/input/investigate/make-input.ts +11 -0
  122. package/s/lib/input/sources/gamepad.ts +55 -0
  123. package/s/lib/input/sources/keyboard.ts +46 -0
  124. package/s/lib/input/sources/plain.ts +9 -0
  125. package/s/lib/input/sources/pointer.ts +56 -0
  126. package/s/lib/input/sources/sources.ts +24 -0
  127. package/s/lib/input/sources/stick.ts +32 -0
  128. package/s/lib/input/testing/quickbind.ts +20 -0
  129. package/s/lib/input/types.ts +52 -0
  130. package/s/lib/input/utils/clock.ts +14 -0
  131. package/s/lib/input/utils/evergreen.ts +10 -0
  132. package/s/lib/input/utils/is-down.ts +5 -0
  133. package/s/lib/input/utils/mouse-button.ts +10 -0
  134. package/s/lib/input/utils/pad/on-pad.ts +50 -0
  135. package/s/lib/input/utils/pad/pad.ts +10 -0
  136. package/s/lib/input/utils/sampler.ts +28 -0
  137. package/s/lib/input/utils/split-axis.ts +15 -0
  138. package/s/lib/test.ts +180 -0
  139. package/x/_archive/demo/main.css +6 -8
  140. package/x/demo/demo-app/element.d.ts +1 -3
  141. package/x/demo/demo-app/element.js +2 -3
  142. package/x/demo/demo-app/element.js.map +1 -1
  143. package/x/demo/main.bundle.js +1 -50
  144. package/x/demo/main.bundle.js.map +1 -1
  145. package/x/demo/main.bundle.min.js +9 -134
  146. package/x/demo/main.bundle.min.js.map +4 -4
  147. package/x/gamepad/gamepad-app/element.js +12 -10
  148. package/x/gamepad/gamepad-app/element.js.map +1 -1
  149. package/x/gamepad/index.html +2 -2
  150. package/x/gamepad/main.bundle.min.js +9 -9
  151. package/x/gamepad/main.bundle.min.js.map +4 -4
  152. package/x/index.html +2 -2
  153. package/x/lib/index.d.ts +13 -0
  154. package/x/lib/index.js +14 -0
  155. package/x/lib/index.js.map +1 -0
  156. package/x/lib/input/data/decode.d.ts +5 -0
  157. package/x/lib/input/data/decode.js +17 -0
  158. package/x/lib/input/data/decode.js.map +1 -0
  159. package/x/lib/input/data/encode.d.ts +2 -0
  160. package/x/lib/input/data/encode.js +17 -0
  161. package/x/lib/input/data/encode.js.map +1 -0
  162. package/x/lib/input/data/params.d.ts +5 -0
  163. package/x/lib/input/data/params.js +6 -0
  164. package/x/lib/input/data/params.js.map +1 -0
  165. package/x/lib/input/decoder.d.ts +7 -0
  166. package/x/lib/input/decoder.js +31 -0
  167. package/x/lib/input/decoder.js.map +1 -0
  168. package/x/lib/input/encoder.d.ts +10 -0
  169. package/x/lib/input/encoder.js +49 -0
  170. package/x/lib/input/encoder.js.map +1 -0
  171. package/x/lib/input/evaluate/context.d.ts +16 -0
  172. package/x/lib/input/evaluate/context.js +12 -0
  173. package/x/lib/input/evaluate/context.js.map +1 -0
  174. package/x/lib/input/evaluate/evaluate.d.ts +3 -0
  175. package/x/lib/input/evaluate/evaluate.js +147 -0
  176. package/x/lib/input/evaluate/evaluate.js.map +1 -0
  177. package/x/lib/input/expression.d.ts +1 -0
  178. package/x/lib/input/expression.js +2 -0
  179. package/x/lib/input/expression.js.map +1 -0
  180. package/x/lib/input/investigate/hash-bindings.d.ts +2 -0
  181. package/x/lib/input/investigate/hash-bindings.js +17 -0
  182. package/x/lib/input/investigate/hash-bindings.js.map +1 -0
  183. package/x/lib/input/investigate/investigate.d.ts +8 -0
  184. package/x/lib/input/investigate/investigate.js +28 -0
  185. package/x/lib/input/investigate/investigate.js.map +1 -0
  186. package/x/lib/input/investigate/is-compatible.d.ts +2 -0
  187. package/x/lib/input/investigate/is-compatible.js +5 -0
  188. package/x/lib/input/investigate/is-compatible.js.map +1 -0
  189. package/x/lib/input/investigate/is-expression.d.ts +3 -0
  190. package/x/lib/input/investigate/is-expression.js +11 -0
  191. package/x/lib/input/investigate/is-expression.js.map +1 -0
  192. package/x/lib/input/investigate/make-input.d.ts +2 -0
  193. package/x/lib/input/investigate/make-input.js +8 -0
  194. package/x/lib/input/investigate/make-input.js.map +1 -0
  195. package/x/lib/input/sources/gamepad.d.ts +9 -0
  196. package/x/lib/input/sources/gamepad.js +45 -0
  197. package/x/lib/input/sources/gamepad.js.map +1 -0
  198. package/x/lib/input/sources/keyboard.d.ts +5 -0
  199. package/x/lib/input/sources/keyboard.js +36 -0
  200. package/x/lib/input/sources/keyboard.js.map +1 -0
  201. package/x/lib/input/sources/plain.d.ts +5 -0
  202. package/x/lib/input/sources/plain.js +6 -0
  203. package/x/lib/input/sources/plain.js.map +1 -0
  204. package/x/lib/input/sources/pointer.d.ts +7 -0
  205. package/x/lib/input/sources/pointer.js +54 -0
  206. package/x/lib/input/sources/pointer.js.map +1 -0
  207. package/x/lib/input/sources/sources.d.ts +7 -0
  208. package/x/lib/input/sources/sources.js +15 -0
  209. package/x/lib/input/sources/sources.js.map +1 -0
  210. package/x/lib/input/sources/stick.d.ts +10 -0
  211. package/x/lib/input/sources/stick.js +25 -0
  212. package/x/lib/input/sources/stick.js.map +1 -0
  213. package/x/lib/input/testing/quickbind.d.ts +11 -0
  214. package/x/lib/input/testing/quickbind.js +12 -0
  215. package/x/lib/input/testing/quickbind.js.map +1 -0
  216. package/x/lib/input/types.d.ts +37 -0
  217. package/x/lib/input/types.js +2 -0
  218. package/x/lib/input/types.js.map +1 -0
  219. package/x/lib/input/utils/clock.d.ts +7 -0
  220. package/x/lib/input/utils/clock.js +14 -0
  221. package/x/lib/input/utils/clock.js.map +1 -0
  222. package/x/lib/input/utils/evergreen.js.map +1 -0
  223. package/x/lib/input/utils/is-down.js.map +1 -0
  224. package/x/lib/input/utils/mouse-button.d.ts +1 -0
  225. package/x/lib/input/utils/mouse-button.js +9 -0
  226. package/x/lib/input/utils/mouse-button.js.map +1 -0
  227. package/x/lib/input/utils/pad/on-pad.js.map +1 -0
  228. package/x/lib/input/utils/pad/pad.js.map +1 -0
  229. package/x/lib/input/utils/sampler.d.ts +7 -0
  230. package/x/lib/input/utils/sampler.js +23 -0
  231. package/x/lib/input/utils/sampler.js.map +1 -0
  232. package/x/lib/input/utils/split-axis.js.map +1 -0
  233. package/x/lib/test.d.ts +1 -0
  234. package/x/lib/test.js +134 -0
  235. package/x/lib/test.js.map +1 -0
  236. package/s/_archive/README.md +0 -435
  237. package/s/_archive/core/bindings/action.ts +0 -30
  238. package/s/_archive/core/bindings/parts/defaults.ts +0 -32
  239. package/s/_archive/core/bindings/parts/is-pressed.ts +0 -5
  240. package/s/_archive/core/bindings/parts/lens-algo.ts +0 -84
  241. package/s/_archive/core/bindings/parts/lookup-proxies.ts +0 -17
  242. package/s/_archive/core/bindings/resolver.ts +0 -103
  243. package/s/_archive/core/bindings/sample-map.ts +0 -25
  244. package/s/_archive/core/bindings/types.ts +0 -60
  245. package/s/_archive/core/core.test.ts +0 -155
  246. package/s/_archive/core/devices/auto-gamepads.ts +0 -8
  247. package/s/_archive/core/devices/device.ts +0 -12
  248. package/s/_archive/core/devices/infra/group.ts +0 -24
  249. package/s/_archive/core/devices/infra/sampler.ts +0 -22
  250. package/s/_archive/core/devices/standard/gamepad.ts +0 -83
  251. package/s/_archive/core/devices/standard/index.ts +0 -8
  252. package/s/_archive/core/devices/standard/keyboard.ts +0 -31
  253. package/s/_archive/core/devices/standard/pointer.ts +0 -97
  254. package/s/_archive/core/devices/standard/primary.ts +0 -20
  255. package/s/_archive/core/devices/standard/stick.ts +0 -27
  256. package/s/_archive/core/devices/standard/vpad.ts +0 -25
  257. package/s/_archive/core/devices/types.ts +0 -3
  258. package/s/_archive/core/hub/hub.ts +0 -118
  259. package/s/_archive/core/hub/meta-bindings.ts +0 -23
  260. package/s/_archive/core/hub/parts/connected.ts +0 -15
  261. package/s/_archive/core/hub/port.ts +0 -26
  262. package/s/_archive/core/hub/types.ts +0 -13
  263. package/s/_archive/core/index.ts +0 -19
  264. package/s/_archive/core/testing/testing.ts +0 -57
  265. package/s/_archive/deck/index.ts +0 -13
  266. package/s/_archive/deck/parts/catalog.ts +0 -58
  267. package/s/_archive/deck/parts/db.ts +0 -65
  268. package/s/_archive/deck/parts/device-skins/device-icons.ts +0 -38
  269. package/s/_archive/deck/parts/device-skins/device-skin.ts +0 -29
  270. package/s/_archive/deck/parts/local-storage-kv.ts +0 -8
  271. package/s/_archive/deck/parts/merge-bindings.ts +0 -21
  272. package/s/_archive/deck/parts/overlay-visibility.ts +0 -49
  273. package/s/_archive/deck/views/bindings/view.ts +0 -95
  274. package/s/_archive/deck/views/overlay/style.css.ts +0 -110
  275. package/s/_archive/deck/views/overlay/view.ts +0 -46
  276. package/s/_archive/demo/game/game.ts +0 -85
  277. package/s/_archive/demo/game/parts/agent.ts +0 -10
  278. package/s/_archive/demo/game/parts/game-bindings.ts +0 -20
  279. package/s/_archive/demo/game/parts/logic.ts +0 -24
  280. package/s/_archive/demo/game/parts/player.ts +0 -32
  281. package/s/_archive/demo/game/parts/renderer.ts +0 -112
  282. package/s/_archive/demo/game/parts/state.ts +0 -23
  283. package/s/_archive/demo/game/parts/virtual-device.ts +0 -13
  284. package/s/_archive/demo/ui/theater/styles.css.ts +0 -57
  285. package/s/_archive/demo/ui/theater/view.ts +0 -55
  286. package/s/_archive/demo/ui/theater/virtual/style.css.ts +0 -43
  287. package/s/_archive/demo/ui/theater/virtual/view.ts +0 -29
  288. package/s/_archive/demo/ui/utils/loader.ts +0 -5
  289. package/s/_archive/index.html.ts +0 -61
  290. package/s/_archive/index.ts +0 -8
  291. package/s/_archive/nubs/index.ts +0 -5
  292. package/s/_archive/nubs/lookpad/styles.ts +0 -21
  293. package/s/_archive/nubs/lookpad/view.ts +0 -39
  294. package/s/_archive/nubs/stick/style.css.ts +0 -70
  295. package/s/_archive/nubs/stick/view.ts +0 -108
  296. package/s/_archive/nubs/vpad/styles.css.ts +0 -134
  297. package/s/_archive/nubs/vpad/utils/gamepad-inputs.ts +0 -42
  298. package/s/_archive/nubs/vpad/utils/prevent-default-touch-shenanigans.ts +0 -12
  299. package/s/_archive/nubs/vpad/utils/touch-tracking.ts +0 -75
  300. package/s/_archive/nubs/vpad/view.ts +0 -141
  301. package/s/_archive/tests.test.ts +0 -6
  302. package/s/_archive/utils/dispensers.ts +0 -20
  303. package/s/_archive/utils/gamepads.ts +0 -41
  304. package/s/_archive/utils/quick-math.ts +0 -13
  305. package/s/deck/deck.ts +0 -92
  306. package/s/index.ts +0 -31
  307. package/s/utils/circular-clamp.ts +0 -14
  308. package/x/core/atom/defaults.d.ts +0 -3
  309. package/x/core/atom/defaults.js +0 -26
  310. package/x/core/atom/defaults.js.map +0 -1
  311. package/x/core/atom/lens-algo.d.ts +0 -2
  312. package/x/core/atom/lens-algo.js +0 -54
  313. package/x/core/atom/lens-algo.js.map +0 -1
  314. package/x/core/atom/types.d.ts +0 -27
  315. package/x/core/atom/types.js +0 -2
  316. package/x/core/atom/types.js.map +0 -1
  317. package/x/core/bindings/normalize.d.ts +0 -2
  318. package/x/core/bindings/normalize.js +0 -17
  319. package/x/core/bindings/normalize.js.map +0 -1
  320. package/x/core/bindings/shape.d.ts +0 -2
  321. package/x/core/bindings/shape.js +0 -10
  322. package/x/core/bindings/shape.js.map +0 -1
  323. package/x/core/bindings/table.d.ts +0 -2
  324. package/x/core/bindings/table.js +0 -15
  325. package/x/core/bindings/table.js.map +0 -1
  326. package/x/core/intent/bucket.d.ts +0 -7
  327. package/x/core/intent/bucket.js +0 -21
  328. package/x/core/intent/bucket.js.map +0 -1
  329. package/x/core/intent/consts.d.ts +0 -2
  330. package/x/core/intent/consts.js +0 -3
  331. package/x/core/intent/consts.js.map +0 -1
  332. package/x/core/intent/decode.d.ts +0 -3
  333. package/x/core/intent/decode.js +0 -18
  334. package/x/core/intent/decode.js.map +0 -1
  335. package/x/core/intent/encode.d.ts +0 -3
  336. package/x/core/intent/encode.js +0 -15
  337. package/x/core/intent/encode.js.map +0 -1
  338. package/x/core/intent/merge.d.ts +0 -3
  339. package/x/core/intent/merge.js +0 -10
  340. package/x/core/intent/merge.js.map +0 -1
  341. package/x/core/parts/action.d.ts +0 -14
  342. package/x/core/parts/action.js +0 -30
  343. package/x/core/parts/action.js.map +0 -1
  344. package/x/core/parts/sample-map.d.ts +0 -6
  345. package/x/core/parts/sample-map.js +0 -21
  346. package/x/core/parts/sample-map.js.map +0 -1
  347. package/x/core/resolvers/actions.d.ts +0 -2
  348. package/x/core/resolvers/actions.js +0 -23
  349. package/x/core/resolvers/actions.js.map +0 -1
  350. package/x/core/resolvers/intents.d.ts +0 -2
  351. package/x/core/resolvers/intents.js +0 -89
  352. package/x/core/resolvers/intents.js.map +0 -1
  353. package/x/core/types.d.ts +0 -43
  354. package/x/core/types.js +0 -2
  355. package/x/core/types.js.map +0 -1
  356. package/x/deck/controller.d.ts +0 -11
  357. package/x/deck/controller.js +0 -28
  358. package/x/deck/controller.js.map +0 -1
  359. package/x/deck/deck.d.ts +0 -31
  360. package/x/deck/deck.js +0 -68
  361. package/x/deck/deck.js.map +0 -1
  362. package/x/deck/parts/profiles.d.ts +0 -12
  363. package/x/deck/parts/profiles.js +0 -31
  364. package/x/deck/parts/profiles.js.map +0 -1
  365. package/x/deck/parts/runtime.d.ts +0 -8
  366. package/x/deck/parts/runtime.js +0 -7
  367. package/x/deck/parts/runtime.js.map +0 -1
  368. package/x/deck/parts/settings.d.ts +0 -11
  369. package/x/deck/parts/settings.js +0 -26
  370. package/x/deck/parts/settings.js.map +0 -1
  371. package/x/deck/port.d.ts +0 -10
  372. package/x/deck/port.js +0 -24
  373. package/x/deck/port.js.map +0 -1
  374. package/x/deck/types.d.ts +0 -11
  375. package/x/deck/types.js +0 -2
  376. package/x/deck/types.js.map +0 -1
  377. package/x/device/devices.d.ts +0 -7
  378. package/x/device/devices.js +0 -17
  379. package/x/device/devices.js.map +0 -1
  380. package/x/device/gamepad.d.ts +0 -9
  381. package/x/device/gamepad.js +0 -37
  382. package/x/device/gamepad.js.map +0 -1
  383. package/x/device/keyboard.d.ts +0 -6
  384. package/x/device/keyboard.js +0 -30
  385. package/x/device/keyboard.js.map +0 -1
  386. package/x/device/pad/on-pad.js.map +0 -1
  387. package/x/device/pad/pad.js.map +0 -1
  388. package/x/device/pointer.d.ts +0 -12
  389. package/x/device/pointer.js +0 -73
  390. package/x/device/pointer.js.map +0 -1
  391. package/x/device/sampler.d.ts +0 -9
  392. package/x/device/sampler.js +0 -19
  393. package/x/device/sampler.js.map +0 -1
  394. package/x/device/stick.d.ts +0 -14
  395. package/x/device/stick.js +0 -22
  396. package/x/device/stick.js.map +0 -1
  397. package/x/index-ui.d.ts +0 -1
  398. package/x/index-ui.js +0 -2
  399. package/x/index-ui.js.map +0 -1
  400. package/x/index.d.ts +0 -27
  401. package/x/index.js +0 -28
  402. package/x/index.js.map +0 -1
  403. package/x/test.d.ts +0 -9
  404. package/x/test.js +0 -307
  405. package/x/test.js.map +0 -1
  406. package/x/ui/views/desk/style.css.d.ts +0 -2
  407. package/x/ui/views/desk/style.css.js +0 -69
  408. package/x/ui/views/desk/style.css.js.map +0 -1
  409. package/x/ui/views/desk/view.d.ts +0 -7
  410. package/x/ui/views/desk/view.js +0 -102
  411. package/x/ui/views/desk/view.js.map +0 -1
  412. package/x/utils/circular-clamp.d.ts +0 -2
  413. package/x/utils/circular-clamp.js +0 -8
  414. package/x/utils/circular-clamp.js.map +0 -1
  415. package/x/utils/do-async.d.ts +0 -1
  416. package/x/utils/do-async.js +0 -4
  417. package/x/utils/do-async.js.map +0 -1
  418. package/x/utils/evergreen.js.map +0 -1
  419. package/x/utils/freeze-clone.d.ts +0 -1
  420. package/x/utils/freeze-clone.js +0 -5
  421. package/x/utils/freeze-clone.js.map +0 -1
  422. package/x/utils/identifier.d.ts +0 -6
  423. package/x/utils/identifier.js +0 -25
  424. package/x/utils/identifier.js.map +0 -1
  425. package/x/utils/insert.d.ts +0 -1
  426. package/x/utils/insert.js +0 -5
  427. package/x/utils/insert.js.map +0 -1
  428. package/x/utils/is-down.js.map +0 -1
  429. package/x/utils/make-id.d.ts +0 -1
  430. package/x/utils/make-id.js +0 -5
  431. package/x/utils/make-id.js.map +0 -1
  432. package/x/utils/remap.d.ts +0 -1
  433. package/x/utils/remap.js +0 -6
  434. package/x/utils/remap.js.map +0 -1
  435. package/x/utils/shift-limit.d.ts +0 -2
  436. package/x/utils/shift-limit.js +0 -7
  437. package/x/utils/shift-limit.js.map +0 -1
  438. package/x/utils/sort-by-key.d.ts +0 -1
  439. package/x/utils/sort-by-key.js +0 -6
  440. package/x/utils/sort-by-key.js.map +0 -1
  441. package/x/utils/split-axis.js.map +0 -1
  442. package/x/utils/tmax.d.ts +0 -1
  443. package/x/utils/tmax.js +0 -6
  444. package/x/utils/tmax.js.map +0 -1
  445. package/x/utils/tmin.d.ts +0 -1
  446. package/x/utils/tmin.js +0 -6
  447. package/x/utils/tmin.js.map +0 -1
  448. /package/s/{core → _archive/core}/atom/defaults.ts +0 -0
  449. /package/s/{core → _archive/core}/atom/lens-algo.ts +0 -0
  450. /package/s/{core → _archive/core}/atom/types.ts +0 -0
  451. /package/s/{core → _archive/core}/bindings/normalize.ts +0 -0
  452. /package/s/{core → _archive/core}/bindings/shape.ts +0 -0
  453. /package/s/{core → _archive/core}/bindings/table.ts +0 -0
  454. /package/s/{core → _archive/core}/intent/bucket.ts +0 -0
  455. /package/s/{core → _archive/core}/intent/consts.ts +0 -0
  456. /package/s/{core → _archive/core}/intent/decode.ts +0 -0
  457. /package/s/{core → _archive/core}/intent/encode.ts +0 -0
  458. /package/s/{core → _archive/core}/intent/merge.ts +0 -0
  459. /package/s/{core → _archive/core}/parts/action.ts +0 -0
  460. /package/s/{core → _archive/core}/parts/sample-map.ts +0 -0
  461. /package/s/{core → _archive/core}/resolvers/actions.ts +0 -0
  462. /package/s/{core → _archive/core}/resolvers/intents.ts +0 -0
  463. /package/s/{core → _archive/core}/types.ts +0 -0
  464. /package/s/{deck → _archive/deck}/controller.ts +0 -0
  465. /package/s/{deck → _archive/deck}/parts/profiles.ts +0 -0
  466. /package/s/{deck → _archive/deck}/parts/runtime.ts +0 -0
  467. /package/s/{deck → _archive/deck}/parts/settings.ts +0 -0
  468. /package/s/{deck → _archive/deck}/port.ts +0 -0
  469. /package/s/{deck → _archive/deck}/types.ts +0 -0
  470. /package/s/{device → _archive/device}/devices.ts +0 -0
  471. /package/s/{device → _archive/device}/gamepad.ts +0 -0
  472. /package/s/{device → _archive/device}/keyboard.ts +0 -0
  473. /package/s/{device → _archive/device}/pad/on-pad.ts +0 -0
  474. /package/s/{device → _archive/device}/pad/pad.ts +0 -0
  475. /package/s/{device → _archive/device}/pointer.ts +0 -0
  476. /package/s/{device → _archive/device}/sampler.ts +0 -0
  477. /package/s/{device → _archive/device}/stick.ts +0 -0
  478. /package/s/{index-ui.ts → _archive/index-ui.ts} +0 -0
  479. /package/s/{utils → _archive/lib/bindings/utils}/is-down.ts +0 -0
  480. /package/s/{utils → _archive/lib/utils}/evergreen.ts +0 -0
  481. /package/s/{utils → _archive/lib/utils}/split-axis.ts +0 -0
  482. /package/s/{test.ts → _archive/test.ts} +0 -0
  483. /package/s/{ui → _archive/ui}/views/desk/style.css.ts +0 -0
  484. /package/s/{ui → _archive/ui}/views/desk/view.ts +0 -0
  485. /package/s/{utils → _archive/utils}/do-async.ts +0 -0
  486. /package/s/{utils → _archive/utils}/freeze-clone.ts +0 -0
  487. /package/s/{utils → _archive/utils}/identifier.ts +0 -0
  488. /package/s/{utils → _archive/utils}/insert.ts +0 -0
  489. /package/s/{utils → _archive/utils}/make-id.ts +0 -0
  490. /package/s/{utils → _archive/utils}/remap.ts +0 -0
  491. /package/s/{utils → _archive/utils}/shift-limit.ts +0 -0
  492. /package/s/{utils → _archive/utils}/sort-by-key.ts +0 -0
  493. /package/s/{utils → _archive/utils}/tmax.ts +0 -0
  494. /package/s/{utils → _archive/utils}/tmin.ts +0 -0
  495. /package/x/{utils → lib/input/utils}/evergreen.d.ts +0 -0
  496. /package/x/{utils → lib/input/utils}/evergreen.js +0 -0
  497. /package/x/{utils → lib/input/utils}/is-down.d.ts +0 -0
  498. /package/x/{utils → lib/input/utils}/is-down.js +0 -0
  499. /package/x/{device → lib/input/utils}/pad/on-pad.d.ts +0 -0
  500. /package/x/{device → lib/input/utils}/pad/on-pad.js +0 -0
  501. /package/x/{device → lib/input/utils}/pad/pad.d.ts +0 -0
  502. /package/x/{device → lib/input/utils}/pad/pad.js +0 -0
  503. /package/x/{utils → lib/input/utils}/split-axis.d.ts +0 -0
  504. /package/x/{utils → lib/input/utils}/split-axis.js +0 -0
@@ -1,6 +1,6 @@
1
- var Wr=Object.defineProperty;var Kr=(r,t)=>{for(var e in t)Wr(r,e,{get:t[e],enumerable:!0})};var _t=globalThis,St=_t.ShadowRoot&&(_t.ShadyCSS===void 0||_t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,pe=Symbol(),Oe=new WeakMap,it=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==pe)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(St&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=Oe.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Oe.set(e,t))}return t}toString(){return this.cssText}},Re=r=>new it(typeof r=="string"?r:r+"",void 0,pe),A=(r,...t)=>{let e=r.length===1?r[0]:t.reduce((s,o,n)=>s+(i=>{if(i._$cssResult$===!0)return i.cssText;if(typeof i=="number")return i;throw Error("Value passed to 'css' function must be a 'css' function result: "+i+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+r[n+1],r[0]);return new it(e,r,pe)},Et=(r,t)=>{if(St)r.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let s=document.createElement("style"),o=_t.litNonce;o!==void 0&&s.setAttribute("nonce",o),s.textContent=e.cssText,r.appendChild(s)}},Y=St?r=>r:r=>r instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return Re(e)})(r):r;var{is:Gr,defineProperty:Fr,getOwnPropertyDescriptor:Yr,getOwnPropertyNames:Jr,getOwnPropertySymbols:Xr,getPrototypeOf:Qr}=Object,Ct=globalThis,Le=Ct.trustedTypes,Zr=Le?Le.emptyScript:"",ts=Ct.reactiveElementPolyfillSupport,at=(r,t)=>r,he={toAttribute(r,t){switch(t){case Boolean:r=r?Zr: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}},je=(r,t)=>!Gr(r,t),Ne={attribute:!0,type:String,converter:he,reflect:!1,useDefault:!1,hasChanged:je};Symbol.metadata??=Symbol("metadata"),Ct.litPropertyMetadata??=new WeakMap;var T=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=Ne){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){let s=Symbol(),o=this.getPropertyDescriptor(t,s,e);o!==void 0&&Fr(this.prototype,t,o)}}static getPropertyDescriptor(t,e,s){let{get:o,set:n}=Yr(this.prototype,t)??{get(){return this[e]},set(i){this[e]=i}};return{get:o,set(i){let c=o?.call(this);n?.call(this,i),this.requestUpdate(t,c,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Ne}static _$Ei(){if(this.hasOwnProperty(at("elementProperties")))return;let t=Qr(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(at("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(at("properties"))){let e=this.properties,s=[...Jr(e),...Xr(e)];for(let o of s)this.createProperty(o,e[o])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[s,o]of e)this.elementProperties.set(s,o)}this._$Eh=new Map;for(let[e,s]of this.elementProperties){let o=this._$Eu(e,s);o!==void 0&&this._$Eh.set(o,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let o of s)e.unshift(Y(o))}else t!==void 0&&e.push(Y(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 Et(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){let s=this.constructor.elementProperties.get(t),o=this.constructor._$Eu(t,s);if(o!==void 0&&s.reflect===!0){let n=(s.converter?.toAttribute!==void 0?s.converter:he).toAttribute(e,s.type);this._$Em=t,n==null?this.removeAttribute(o):this.setAttribute(o,n),this._$Em=null}}_$AK(t,e){let s=this.constructor,o=s._$Eh.get(t);if(o!==void 0&&this._$Em!==o){let n=s.getPropertyOptions(o),i=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:he;this._$Em=o;let c=i.fromAttribute(e,n.type);this[o]=c??this._$Ej?.get(o)??c,this._$Em=null}}requestUpdate(t,e,s,o=!1,n){if(t!==void 0){let i=this.constructor;if(o===!1&&(n=this[t]),s??=i.getPropertyOptions(t),!((s.hasChanged??je)(n,e)||s.useDefault&&s.reflect&&n===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:o,wrapped:n},i){s&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,i??e??this[t]),n!==!0||i!==void 0)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),o===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[o,n]of this._$Ep)this[o]=n;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[o,n]of s){let{wrapped:i}=n,c=this[o];i!==!0||this._$AL.has(o)||c===void 0||this.C(o,void 0,n,c)}}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EM()}catch(s){throw t=!1,this._$EM(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(t){}firstUpdated(t){}};T.elementStyles=[],T.shadowRootOptions={mode:"open"},T[at("elementProperties")]=new Map,T[at("finalized")]=new Map,ts?.({ReactiveElement:T}),(Ct.reactiveElementVersions??=[]).push("2.1.2");var fe=globalThis,De=r=>r,Mt=fe.trustedTypes,He=Mt?Mt.createPolicy("lit-html",{createHTML:r=>r}):void 0,me="$lit$",O=`lit$${Math.random().toFixed(9).slice(2)}$`,de="?"+O,es=`<${de}>`,z=document,ut=()=>z.createComment(""),pt=r=>r===null||typeof r!="object"&&typeof r!="function",ge=Array.isArray,Ve=r=>ge(r)||typeof r?.[Symbol.iterator]=="function",le=`[
2
- \f\r]`,ct=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ue=/-->/g,ze=/>/g,H=RegExp(`>|${le}(?:([^\\s"'>=/]+)(${le}*=${le}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),qe=/'/g,Be=/"/g,We=/^(?:script|style|textarea|title)$/i,xe=r=>(t,...e)=>({_$litType$:r,strings:t,values:e}),b=xe(1),qs=xe(2),Bs=xe(3),q=Symbol.for("lit-noChange"),g=Symbol.for("lit-nothing"),Ie=new WeakMap,U=z.createTreeWalker(z,129);function Ke(r,t){if(!ge(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return He!==void 0?He.createHTML(t):t}var Ge=(r,t)=>{let e=r.length-1,s=[],o,n=t===2?"<svg>":t===3?"<math>":"",i=ct;for(let c=0;c<e;c++){let a=r[c],u,l,h=-1,f=0;for(;f<a.length&&(i.lastIndex=f,l=i.exec(a),l!==null);)f=i.lastIndex,i===ct?l[1]==="!--"?i=Ue:l[1]!==void 0?i=ze:l[2]!==void 0?(We.test(l[2])&&(o=RegExp("</"+l[2],"g")),i=H):l[3]!==void 0&&(i=H):i===H?l[0]===">"?(i=o??ct,h=-1):l[1]===void 0?h=-2:(h=i.lastIndex-l[2].length,u=l[1],i=l[3]===void 0?H:l[3]==='"'?Be:qe):i===Be||i===qe?i=H:i===Ue||i===ze?i=ct:(i=H,o=void 0);let m=i===H&&r[c+1].startsWith("/>")?" ":"";n+=i===ct?a+es:h>=0?(s.push(u),a.slice(0,h)+me+a.slice(h)+O+m):a+O+(h===-2?c:m)}return[Ke(r,n+(r[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]},ht=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,l]=Ge(t,e);if(this.el=r.createElement(u,s),U.currentNode=this.el.content,e===2||e===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(o=U.nextNode())!==null&&a.length<c;){if(o.nodeType===1){if(o.hasAttributes())for(let h of o.getAttributeNames())if(h.endsWith(me)){let f=l[i++],m=o.getAttribute(h).split(O),d=/([.?@])?(.*)/.exec(f);a.push({type:1,index:n,name:d[2],strings:m,ctor:d[1]==="."?Pt:d[1]==="?"?Tt:d[1]==="@"?Ot:I}),o.removeAttribute(h)}else h.startsWith(O)&&(a.push({type:6,index:n}),o.removeAttribute(h));if(We.test(o.tagName)){let h=o.textContent.split(O),f=h.length-1;if(f>0){o.textContent=Mt?Mt.emptyScript:"";for(let m=0;m<f;m++)o.append(h[m],ut()),U.nextNode(),a.push({type:2,index:++n});o.append(h[f],ut())}}}else if(o.nodeType===8)if(o.data===de)a.push({type:2,index:n});else{let h=-1;for(;(h=o.data.indexOf(O,h+1))!==-1;)a.push({type:7,index:n}),h+=O.length-1}n++}}static createElement(t,e){let s=z.createElement("template");return s.innerHTML=t,s}};function B(r,t,e=r,s){if(t===q)return t;let o=s!==void 0?e._$Co?.[s]:e._$Cl,n=pt(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=B(r,o._$AS(r,t.values),o,s)),t}var kt=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??z).importNode(e,!0);U.currentNode=o;let n=U.nextNode(),i=0,c=0,a=s[0];for(;a!==void 0;){if(i===a.index){let u;a.type===2?u=new J(n,n.nextSibling,this,t):a.type===1?u=new a.ctor(n,a.name,a.strings,this,t):a.type===6&&(u=new Rt(n,this,t)),this._$AV.push(u),a=s[++c]}i!==a?.index&&(n=U.nextNode(),i++)}return U.currentNode=z,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++}},J=class r{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,o){this.type=2,this._$AH=g,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=B(this,t,e),pt(t)?t===g||t==null||t===""?(this._$AH!==g&&this._$AR(),this._$AH=g):t!==this._$AH&&t!==q&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Ve(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!==g&&pt(this._$AH)?this._$AA.nextSibling.data=t:this.T(z.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=ht.createElement(Ke(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===o)this._$AH.p(e);else{let n=new kt(o,this),i=n.u(this.options);n.p(e),this.T(i),this._$AH=n}}_$AC(t){let e=Ie.get(t.strings);return e===void 0&&Ie.set(t.strings,e=new ht(t)),e}k(t){ge(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(ut()),this.O(ut()),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=De(t).nextSibling;De(t).remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},I=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,o,n){this.type=1,this._$AH=g,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=g}_$AI(t,e=this,s,o){let n=this.strings,i=!1;if(n===void 0)t=B(this,t,e,0),i=!pt(t)||t!==this._$AH&&t!==q,i&&(this._$AH=t);else{let c=t,a,u;for(t=n[0],a=0;a<n.length-1;a++)u=B(this,c[s+a],e,a),u===q&&(u=this._$AH[a]),i||=!pt(u)||u!==this._$AH[a],u===g?t=g:t!==g&&(t+=(u??"")+n[a+1]),this._$AH[a]=u}i&&!o&&this.j(t)}j(t){t===g?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},Pt=class extends I{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===g?void 0:t}},Tt=class extends I{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==g)}},Ot=class extends I{constructor(t,e,s,o,n){super(t,e,s,o,n),this.type=5}_$AI(t,e=this){if((t=B(this,t,e,0)??g)===q)return;let s=this._$AH,o=t===g&&s!==g||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==g&&(s===g||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)}},Rt=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){B(this,t)}},Fe={M:me,P:O,A:de,C:1,L:Ge,R:kt,D:Ve,V:B,I:J,H:I,N:Tt,U:Ot,B:Pt,F:Rt},rs=fe.litHtmlPolyfillSupport;rs?.(ht,J),(fe.litHtmlVersions??=[]).push("3.3.3");var x=(r,t,e)=>{let s=e?.renderBefore??t,o=s._$litPart$;if(o===void 0){let n=e?.renderBefore??null;s._$litPart$=o=new J(t.insertBefore(ut(),n),n,void 0,e??{})}return o._$AI(r),o};var ye=globalThis,X=class extends T{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=x(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return q}};X._$litElement$=!0,X.finalized=!0,ye.litElementHydrateSupport?.({LitElement:X});var ss=ye.litElementPolyfillSupport;ss?.({LitElement:X});(ye.litElementVersions??=[]).push("4.2.2");var E={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},y={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),any:(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}"`)},entries:(r,t)=>{for(let[e,s]of t)y.any(r,e,s)},record:(r,t)=>y.entries(r,Object.entries(t))};function Ye(r,t={}){let e=document.createElement(r);return y.record(e,t),e}function Je(r){let t=document.createDocumentFragment();return x(r,t),t.firstElementChild}function Lt(r,t){let e=[];for(let[s,o]of Object.entries(t))if(typeof o=="function")r.addEventListener(s,o),e.push(()=>r.removeEventListener(s,o));else{let[n,i]=o;r.addEventListener(s,i,n),e.push(()=>r.removeEventListener(s,i))}return()=>e.forEach(s=>s())}function Xe(r,t){let e=new MutationObserver(t);return e.observe(r,{attributes:!0}),()=>e.disconnect()}var Nt=class{element;constructor(t){this.element=t}strings=new Proxy({},{get:(t,e)=>E.string(this.element,e),set:(t,e,s)=>y.string(this.element,e,s)});numbers=new Proxy({},{get:(t,e)=>E.number(this.element,e),set:(t,e,s)=>y.number(this.element,e,s)});booleans=new Proxy({},{get:(t,e)=>E.boolean(this.element,e),set:(t,e,s)=>y.boolean(this.element,e,s)})};var Qe=(r,t,e={})=>new Proxy(t,{get:(s,o)=>{switch(t[o]){case String:return E.string(r,o);case Number:return E.number(r,o);case Boolean:return E.boolean(r,o);default:throw new Error(`invalid attribute type for "${o}"`)}},set:(s,o,n)=>{try{switch(e.beforeSet?.(o),t[o]){case String:return y.string(r,o,n);case Number:return y.number(r,o,n);case Boolean:return y.boolean(r,o,n);default:throw new Error(`invalid attribute type for "${o}"`)}}finally{e.afterSet?.(o)}}});function Q(r){let t=new Nt(r);return{strings:t.strings,numbers:t.numbers,booleans:t.booleans,on:e=>Xe(r,e),spec:(e,s={})=>Qe(r,e,s)}}Q.get=E;Q.set=y;function Ze(r){return new we(r)}var we=class{tagName;#t=new Map;#e=[];constructor(t){this.tagName=t}attr(t,e=!0){return this.#t.set(t,e),this}attrs(t){for(let[e,s]of Object.entries(t))this.attr(e,s);return this}children(...t){return this.#e.push(...t),this}done(){let t=document.createElement(this.tagName);return y.entries(t,this.#t),t.append(...this.#e),t}};function Z(r,t=document){let e=t.querySelector(r);if(!e)throw new Error(`element not found (${r})`);return e}function jt(r,t=document){return t.querySelector(r)}function Dt(r,t=document){return Array.from(t.querySelectorAll(r))}var Ht=class r{element;#t;constructor(t){this.element=t}in(t){return new r(typeof t=="string"?Z(t,this.element):t)}require(t){return Z(t,this.element)}maybe(t){return jt(t,this.element)}all(t){return Dt(t,this.element)}render(...t){return x(t,this.element)}get attrs(){return this.#t??=Q(this.element)}events(t){return Lt(this.element,t)}};function tr(r){return r.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function er(r,t={}){let{soft:e=!1,upgrade:s=!0}=t;for(let[o,n]of Object.entries(r)){let i=tr(o),c=customElements.get(i);e&&c||(customElements.define(i,n),s&&document.querySelectorAll(i).forEach(a=>{a.constructor===HTMLElement&&customElements.upgrade(a)}))}}function w(r,t=document){return Z(r,t)}w.in=(r,t=document)=>new Ht(t).in(r);w.need=Z;w.maybe=jt;w.all=Dt;w.el=Ye;w.elmer=Ze;w.mk=Je;w.events=Lt;w.attrs=Q;w.register=er;w.render=(r,...t)=>x(t,r);function rr(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})}function sr(){let r,t,e=new Promise((s,o)=>{r=s,t=o});return e.resolve=r,e.reject=t,e.promise=e,e.entangle=s=>(s.then(r,t),e),e}var $={};Kr($,{clone:()=>lt,equal:()=>is,freeze:()=>as});function lt(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=>lt(s,new Set(t))):r.constructor===Object?e=Object.fromEntries(Object.entries(r).map(([s,o])=>[s,lt(o,new Set(t))])):r instanceof Map?e=new Map(Array.from(r,([s,o])=>[s,lt(o,new Set(t))])):r instanceof Set?e=new Set(Array.from(r,s=>lt(s,new Set(t)))):r instanceof Date?e=new Date(r.getTime()):e=r,t.delete(r)):e=r,e}function os(r){return r!=null}function ns(r){return r==null}var ft=Object.freeze({happy:os,sad:ns,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 is=(r,t)=>{function e(s,o,n){if(!ft.object(s)||!ft.object(o))return s===o;if(n.includes(s))throw new Error("forbidden circularity detected in deep equal comparison");let i=[...n,s];if(s instanceof Map&&o instanceof Map){if(s.size!==o.size)return!1;for(let[c,a]of s)if(!o.has(c)||!e(a,o.get(c),i))return!1}else if(s instanceof Set&&o instanceof Set){if(s.size!==o.size)return!1;for(let c of s)if(!Array.from(o).some(a=>e(c,a,i)))return!1}else{let c=Object.keys(s),a=Object.keys(o);if(c.length!==a.length)return!1;for(let u of c)if(!a.includes(u)||!e(s[u],o[u],i))return!1}return!0}return e(r,t,[])};function as(r){function t(e,s){if(!ft.object(e)||s.includes(e))return e;let o=[...s,e];if(e instanceof Map)for(let n of e.entries())for(let i of n)t(i,o);else if(e instanceof Set)for(let n of e)t(n,o);else if(Array.isArray(e))for(let n of e)t(n,o);else for(let n of Object.values(e))t(n,o);return Object.freeze(e)}return t(r,[])}function or(r){if(r.ok)return r.value;let{error:t}=r;throw t instanceof Error?t:typeof t=="string"?new Error(t):new Error("unknown")}function nr(r){if(r.ok)throw new Error("didn't get needed error");return r.error}function ir(r,t,e=typeof t=="string"?`needed key not found "${t}"`:"needed key not found"){if(r.has(t))return r.get(t);throw new Error(e)}function tt(r,t,e){if(r.has(t))return r.get(t);{let s=e();return r.set(t,s),s}}function mt(r,t){for(let[e,s]of t)r.set(e,s);return r}function Ut(){let r=[];function t(){let e=r;r=[];for(let s=e.length-1;s>=0;s--)e[s]()}return t.schedule=(...e)=>(r.push(...e),t),t.own=(e,s)=>(r.push(()=>s(e)),e),t}function V(r,t){let e=Object.entries(t);for(let[s,o]of e)r.addEventListener(s,o);return()=>{for(let[s,o]of e)r.removeEventListener(s,o)}}function $e(r){return new be(r)}var be=class r{#t;static with=$e;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 cs(){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:l}=sr(),h=o(async(...f)=>{a&&await a(...f),l(f),h()});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 ar(r){let t=cs();return r&&t.sub(r),t.sub}var zt=class{#t=new Set;#e=[];#r=new WeakMap;#o=0;#s=new Set;read(t){this.#e.at(-1)?.add(t)}write(t){let e=this.#r.get(t);if(e){for(let s of e)this.#s.add(s);this.#o===0&&this.#n()}}observe(t){let e=new Set;this.#e.push(e);try{let s=t();return{seen:e,value:s}}finally{this.#e.pop()}}subscribe(t,e){let s=tt(this.#r,t,()=>new Set);return s.add(e),()=>{s.delete(e),s.size===0&&this.#r.delete(t)}}batch=t=>{this.#o++;try{return t()}finally{this.#o--,this.#o===0&&this.#n()}};#i(t){if(this.#t.has(t))throw new Error("circularity forbidden");this.#t.add(t);try{t()}finally{this.#t.delete(t)}}#n(){for(;this.#s.size>0;){let t=[...this.#s];this.#s.clear();for(let e of t)this.#i(e)}}};var p=globalThis[Symbol.for("e280.tracker.2")]??=new zt;function L(r){function t(){return arguments.length===0?(p.read(t),r):(r=arguments[0],p.write(t),r)}return t.get=()=>t(),t.set=e=>t(e),t}function Ae(r,t){let{seen:e,value:s}=p.observe(r),o=[...e].map(i=>p.subscribe(i,t));return{value:s,dispose:()=>o.forEach(i=>i())}}function et(r){let t,e=!0,s=!1,o=!1,n=()=>{},i=()=>{n(),n=()=>{},e=!0},c=()=>{(!e||s)&&(e=!0,p.write(u))},a=()=>{if(o)throw new Error("derived circularity forbidden");o=!0;try{let l=Ae(r,()=>c());n(),n=l.dispose,t=l.value,e=!1,s=!1}catch(l){throw s=!0,l}finally{o=!1}};function u(){return p.read(u),e&&a(),t}return u.get=()=>u(),u.dispose=i,u}var R=class extends Map{get size(){return p.read(this),super.size}[Symbol.iterator](){return p.read(this),super[Symbol.iterator]()}forEach(t){p.read(this);for(let[e,s]of this)t(s,e,this);return this}keys(){return p.read(this),super.keys()}values(){return p.read(this),super.values()}entries(){return p.read(this),super.entries()}has(t){return p.read(this),super.has(t)}get(t){return p.read(this),super.get(t)}set(t,e){return super.set(t,e),p.write(this),this}delete(t){let e=super.delete(t);return p.write(this),e}clear(){return super.clear(),p.write(this),this}};var dt=class extends Set{get size(){return p.read(this),super.size}[Symbol.iterator](){return p.read(this),super[Symbol.iterator]()}forEach(t){p.read(this);for(let e of this)t(e,e,this);return this}values(){return p.read(this),super.values()}has(t){return p.read(this),super.has(t)}add(t){return super.add(t),p.write(this),this}delete(t){let e=super.delete(t);return p.write(this),e}clear(){return super.clear(),p.write(this),this}};var Ln=p.batch;function cr(r){return $.freeze($.clone(r))}var C=Symbol("optic");var gt=class{calculate;#t=!1;#e;constructor(t){this.calculate=t,this.#e=t()}get(){return this.#t&&(this.#t=!1,this.#e=this.calculate()),this.#e}invalidate(){this.#t=!0}};var qt=class r{[C];#t;#e;#r;constructor(t){this[C]=t,this.#t=$.clone(t.getState()),this.#e=new gt(()=>$.clone(t.getState())),this.#r=new gt(()=>cr(t.getState()))}update(){let t=this[C].getState();!$.equal(t,this.#t)&&(this.#e.invalidate(),this.#r.invalidate(),this.#t=$.clone(t),p.write(this))}get state(){return p.read(this),this.#e.get()}get frozen(){return p.read(this),this.#r.get()}mutate(t){return this[C].mutate(t)}lens(t){let e=new r({getState:()=>t(this[C].getState()),mutate:s=>this[C].mutate(o=>s(t(o))),registerLens:this[C].registerLens});return this[C].registerLens(e),e}};var Bt=class{key;storage;constructor(t,e=window.localStorage){this.key=t,this.storage=e}async get(){let t=this.storage.getItem(this.key);return t?JSON.parse(t):void 0}async set(t){let e=JSON.stringify(t);this.storage.setItem(this.key,e)}onStorageEvent(t){let e=s=>{s.storageArea===this.storage&&s.key===this.key&&t()};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)}};function ur(r){if(!r.done)throw new Error("wait not done");return or(r)}function pr(r){if(!r.done)throw new Error("wait not done");return nr(r)}var hr=r=>!r.done;var ve=r=>r.done&&r.ok;function lr(r,t){let{pending:e=()=>{},ok:s=()=>{},err:o=()=>{}}=t;return hr(r)?e():ve(r)?s(ur(r)):o(pr(r))}function xt(){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 It(r){let t=null;return((...e)=>(t?t.params=e:(t={params:e,deferred:xt()},queueMicrotask(()=>{let{params:s,deferred:o}=t;t=null,Promise.resolve(r(...s)).then(o.resolve).catch(o.reject)})),t.deferred.promise))}function fr(r,t,e){if(r.has(t))return r.get(t);{let s=e();return r.set(t,s),s}}function mr(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 dr=(r=0)=>new Promise(t=>setTimeout(t,r));var Vt=A`
1
+ function Xt(e){return e.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}function te(e,t={}){let{soft:r=!1,upgrade:o=!0}=t;for(let[s,n]of Object.entries(e)){let i=Xt(s),c=customElements.get(i);r&&c||(customElements.define(i,n),o&&document.querySelectorAll(i).forEach(a=>{a.constructor===HTMLElement&&customElements.upgrade(a)}))}}var it=globalThis,at=it.ShadowRoot&&(it.ShadyCSS===void 0||it.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ut=Symbol(),ee=new WeakMap,J=class{constructor(t,r,o){if(this._$cssResult$=!0,o!==Ut)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=r}get styleSheet(){let t=this.o,r=this.t;if(at&&t===void 0){let o=r!==void 0&&r.length===1;o&&(t=ee.get(r)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),o&&ee.set(r,t))}return t}toString(){return this.cssText}},re=e=>new J(typeof e=="string"?e:e+"",void 0,Ut),E=(e,...t)=>{let r=e.length===1?e[0]:t.reduce((o,s,n)=>o+(i=>{if(i._$cssResult$===!0)return i.cssText;if(typeof i=="number")return i;throw Error("Value passed to 'css' function must be a 'css' function result: "+i+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+e[n+1],e[0]);return new J(r,e,Ut)},ct=(e,t)=>{if(at)e.adoptedStyleSheets=t.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(let r of t){let o=document.createElement("style"),s=it.litNonce;s!==void 0&&o.setAttribute("nonce",s),o.textContent=r.cssText,e.appendChild(o)}},q=at?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let r="";for(let o of t.cssRules)r+=o.cssText;return re(r)})(e):e;var{is:Ge,defineProperty:Je,getOwnPropertyDescriptor:Ke,getOwnPropertyNames:Ze,getOwnPropertySymbols:Qe,getPrototypeOf:Ye}=Object,ut=globalThis,oe=ut.trustedTypes,Xe=oe?oe.emptyScript:"",tr=ut.reactiveElementPolyfillSupport,K=(e,t)=>e,jt={toAttribute(e,t){switch(t){case Boolean:e=e?Xe:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let r=e;switch(t){case Boolean:r=e!==null;break;case Number:r=e===null?null:Number(e);break;case Object:case Array:try{r=JSON.parse(e)}catch{r=null}}return r}},ne=(e,t)=>!Ge(e,t),se={attribute:!0,type:String,converter:jt,reflect:!1,useDefault:!1,hasChanged:ne};Symbol.metadata??=Symbol("metadata"),ut.litPropertyMetadata??=new WeakMap;var C=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,r=se){if(r.state&&(r.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((r=Object.create(r)).wrapped=!0),this.elementProperties.set(t,r),!r.noAccessor){let o=Symbol(),s=this.getPropertyDescriptor(t,o,r);s!==void 0&&Je(this.prototype,t,s)}}static getPropertyDescriptor(t,r,o){let{get:s,set:n}=Ke(this.prototype,t)??{get(){return this[r]},set(i){this[r]=i}};return{get:s,set(i){let c=s?.call(this);n?.call(this,i),this.requestUpdate(t,c,o)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??se}static _$Ei(){if(this.hasOwnProperty(K("elementProperties")))return;let t=Ye(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(K("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(K("properties"))){let r=this.properties,o=[...Ze(r),...Qe(r)];for(let s of o)this.createProperty(s,r[s])}let t=this[Symbol.metadata];if(t!==null){let r=litPropertyMetadata.get(t);if(r!==void 0)for(let[o,s]of r)this.elementProperties.set(o,s)}this._$Eh=new Map;for(let[r,o]of this.elementProperties){let s=this._$Eu(r,o);s!==void 0&&this._$Eh.set(s,r)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let r=[];if(Array.isArray(t)){let o=new Set(t.flat(1/0).reverse());for(let s of o)r.unshift(q(s))}else t!==void 0&&r.push(q(t));return r}static _$Eu(t,r){let o=r.attribute;return o===!1?void 0:typeof o=="string"?o: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,r=this.constructor.elementProperties;for(let o of r.keys())this.hasOwnProperty(o)&&(t.set(o,this[o]),delete this[o]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ct(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,r,o){this._$AK(t,o)}_$ET(t,r){let o=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,o);if(s!==void 0&&o.reflect===!0){let n=(o.converter?.toAttribute!==void 0?o.converter:jt).toAttribute(r,o.type);this._$Em=t,n==null?this.removeAttribute(s):this.setAttribute(s,n),this._$Em=null}}_$AK(t,r){let o=this.constructor,s=o._$Eh.get(t);if(s!==void 0&&this._$Em!==s){let n=o.getPropertyOptions(s),i=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:jt;this._$Em=s;let c=i.fromAttribute(r,n.type);this[s]=c??this._$Ej?.get(s)??c,this._$Em=null}}requestUpdate(t,r,o,s=!1,n){if(t!==void 0){let i=this.constructor;if(s===!1&&(n=this[t]),o??=i.getPropertyOptions(t),!((o.hasChanged??ne)(n,r)||o.useDefault&&o.reflect&&n===this._$Ej?.get(t)&&!this.hasAttribute(i._$Eu(t,o))))return;this.C(t,r,o)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,r,{useDefault:o,reflect:s,wrapped:n},i){o&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,i??r??this[t]),n!==!0||i!==void 0)||(this._$AL.has(t)||(this.hasUpdated||o||(r=void 0),this._$AL.set(t,r)),s===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(r){Promise.reject(r)}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[s,n]of this._$Ep)this[s]=n;this._$Ep=void 0}let o=this.constructor.elementProperties;if(o.size>0)for(let[s,n]of o){let{wrapped:i}=n,c=this[s];i!==!0||this._$AL.has(s)||c===void 0||this.C(s,void 0,n,c)}}let t=!1,r=this._$AL;try{t=this.shouldUpdate(r),t?(this.willUpdate(r),this._$EO?.forEach(o=>o.hostUpdate?.()),this.update(r)):this._$EM()}catch(o){throw t=!1,this._$EM(),o}t&&this._$AE(r)}willUpdate(t){}_$AE(t){this._$EO?.forEach(r=>r.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(r=>this._$ET(r,this[r])),this._$EM()}updated(t){}firstUpdated(t){}};C.elementStyles=[],C.shadowRootOptions={mode:"open"},C[K("elementProperties")]=new Map,C[K("finalized")]=new Map,tr?.({ReactiveElement:C}),(ut.reactiveElementVersions??=[]).push("2.1.2");var qt=globalThis,ie=e=>e,pt=qt.trustedTypes,ae=pt?pt.createPolicy("lit-html",{createHTML:e=>e}):void 0,Bt="$lit$",k=`lit$${Math.random().toFixed(9).slice(2)}$`,Wt="?"+k,er=`<${Wt}>`,N=document,Q=()=>N.createComment(""),Y=e=>e===null||typeof e!="object"&&typeof e!="function",It=Array.isArray,me=e=>It(e)||typeof e?.[Symbol.iterator]=="function",zt=`[
2
+ \f\r]`,Z=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ce=/-->/g,ue=/>/g,M=RegExp(`>|${zt}(?:([^\\s"'>=/]+)(${zt}*=${zt}*(?:[^
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),pe=/'/g,he=/"/g,le=/^(?:script|style|textarea|title)$/i,Vt=e=>(t,...r)=>({_$litType$:e,strings:t,values:r}),gt=Vt(1),Pr=Vt(2),Mr=Vt(3),D=Symbol.for("lit-noChange"),f=Symbol.for("lit-nothing"),fe=new WeakMap,R=N.createTreeWalker(N,129);function de(e,t){if(!It(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return ae!==void 0?ae.createHTML(t):t}var ge=(e,t)=>{let r=e.length-1,o=[],s,n=t===2?"<svg>":t===3?"<math>":"",i=Z;for(let c=0;c<r;c++){let a=e[c],p,d,u=-1,S=0;for(;S<a.length&&(i.lastIndex=S,d=i.exec(a),d!==null);)S=i.lastIndex,i===Z?d[1]==="!--"?i=ce:d[1]!==void 0?i=ue:d[2]!==void 0?(le.test(d[2])&&(s=RegExp("</"+d[2],"g")),i=M):d[3]!==void 0&&(i=M):i===M?d[0]===">"?(i=s??Z,u=-1):d[1]===void 0?u=-2:(u=i.lastIndex-d[2].length,p=d[1],i=d[3]===void 0?M:d[3]==='"'?he:pe):i===he||i===pe?i=M:i===ce||i===ue?i=Z:(i=M,s=void 0);let T=i===M&&e[c+1].startsWith("/>")?" ":"";n+=i===Z?a+er:u>=0?(o.push(p),a.slice(0,u)+Bt+a.slice(u)+k+T):a+k+(u===-2?c:T)}return[de(e,n+(e[r]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),o]},X=class e{constructor({strings:t,_$litType$:r},o){let s;this.parts=[];let n=0,i=0,c=t.length-1,a=this.parts,[p,d]=ge(t,r);if(this.el=e.createElement(p,o),R.currentNode=this.el.content,r===2||r===3){let u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(s=R.nextNode())!==null&&a.length<c;){if(s.nodeType===1){if(s.hasAttributes())for(let u of s.getAttributeNames())if(u.endsWith(Bt)){let S=d[i++],T=s.getAttribute(u).split(k),nt=/([.?@])?(.*)/.exec(S);a.push({type:1,index:n,name:nt[2],strings:T,ctor:nt[1]==="."?ft:nt[1]==="?"?mt:nt[1]==="@"?lt:L}),s.removeAttribute(u)}else u.startsWith(k)&&(a.push({type:6,index:n}),s.removeAttribute(u));if(le.test(s.tagName)){let u=s.textContent.split(k),S=u.length-1;if(S>0){s.textContent=pt?pt.emptyScript:"";for(let T=0;T<S;T++)s.append(u[T],Q()),R.nextNode(),a.push({type:2,index:++n});s.append(u[S],Q())}}}else if(s.nodeType===8)if(s.data===Wt)a.push({type:2,index:n});else{let u=-1;for(;(u=s.data.indexOf(k,u+1))!==-1;)a.push({type:7,index:n}),u+=k.length-1}n++}}static createElement(t,r){let o=N.createElement("template");return o.innerHTML=t,o}};function H(e,t,r=e,o){if(t===D)return t;let s=o!==void 0?r._$Co?.[o]:r._$Cl,n=Y(t)?void 0:t._$litDirective$;return s?.constructor!==n&&(s?._$AO?.(!1),n===void 0?s=void 0:(s=new n(e),s._$AT(e,r,o)),o!==void 0?(r._$Co??=[])[o]=s:r._$Cl=s),s!==void 0&&(t=H(e,s._$AS(e,t.values),s,o)),t}var ht=class{constructor(t,r){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:r},parts:o}=this._$AD,s=(t?.creationScope??N).importNode(r,!0);R.currentNode=s;let n=R.nextNode(),i=0,c=0,a=o[0];for(;a!==void 0;){if(i===a.index){let p;a.type===2?p=new B(n,n.nextSibling,this,t):a.type===1?p=new a.ctor(n,a.name,a.strings,this,t):a.type===6&&(p=new dt(n,this,t)),this._$AV.push(p),a=o[++c]}i!==a?.index&&(n=R.nextNode(),i++)}return R.currentNode=N,s}p(t){let r=0;for(let o of this._$AV)o!==void 0&&(o.strings!==void 0?(o._$AI(t,o,r),r+=o.strings.length-2):o._$AI(t[r])),r++}},B=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,r,o,s){this.type=2,this._$AH=f,this._$AN=void 0,this._$AA=t,this._$AB=r,this._$AM=o,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,r=this._$AM;return r!==void 0&&t?.nodeType===11&&(t=r.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,r=this){t=H(this,t,r),Y(t)?t===f||t==null||t===""?(this._$AH!==f&&this._$AR(),this._$AH=f):t!==this._$AH&&t!==D&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):me(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!==f&&Y(this._$AH)?this._$AA.nextSibling.data=t:this.T(N.createTextNode(t)),this._$AH=t}$(t){let{values:r,_$litType$:o}=t,s=typeof o=="number"?this._$AC(t):(o.el===void 0&&(o.el=X.createElement(de(o.h,o.h[0]),this.options)),o);if(this._$AH?._$AD===s)this._$AH.p(r);else{let n=new ht(s,this),i=n.u(this.options);n.p(r),this.T(i),this._$AH=n}}_$AC(t){let r=fe.get(t.strings);return r===void 0&&fe.set(t.strings,r=new X(t)),r}k(t){It(this._$AH)||(this._$AH=[],this._$AR());let r=this._$AH,o,s=0;for(let n of t)s===r.length?r.push(o=new e(this.O(Q()),this.O(Q()),this,this.options)):o=r[s],o._$AI(n),s++;s<r.length&&(this._$AR(o&&o._$AB.nextSibling,s),r.length=s)}_$AR(t=this._$AA.nextSibling,r){for(this._$AP?.(!1,!0,r);t!==this._$AB;){let o=ie(t).nextSibling;ie(t).remove(),t=o}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},L=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,r,o,s,n){this.type=1,this._$AH=f,this._$AN=void 0,this.element=t,this.name=r,this._$AM=s,this.options=n,o.length>2||o[0]!==""||o[1]!==""?(this._$AH=Array(o.length-1).fill(new String),this.strings=o):this._$AH=f}_$AI(t,r=this,o,s){let n=this.strings,i=!1;if(n===void 0)t=H(this,t,r,0),i=!Y(t)||t!==this._$AH&&t!==D,i&&(this._$AH=t);else{let c=t,a,p;for(t=n[0],a=0;a<n.length-1;a++)p=H(this,c[o+a],r,a),p===D&&(p=this._$AH[a]),i||=!Y(p)||p!==this._$AH[a],p===f?t=f:t!==f&&(t+=(p??"")+n[a+1]),this._$AH[a]=p}i&&!s&&this.j(t)}j(t){t===f?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},ft=class extends L{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===f?void 0:t}},mt=class extends L{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==f)}},lt=class extends L{constructor(t,r,o,s,n){super(t,r,o,s,n),this.type=5}_$AI(t,r=this){if((t=H(this,t,r,0)??f)===D)return;let o=this._$AH,s=t===f&&o!==f||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,n=t!==f&&(o===f||s);s&&this.element.removeEventListener(this.name,this,o),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,r,o){this.element=t,this.type=6,this._$AN=void 0,this._$AM=r,this.options=o}get _$AU(){return this._$AM._$AU}_$AI(t){H(this,t)}},xe={M:Bt,P:k,A:Wt,C:1,L:ge,R:ht,D:me,V:H,I:B,H:L,N:mt,U:lt,B:ft,F:dt},rr=qt.litHtmlPolyfillSupport;rr?.(X,B),(qt.litHtmlVersions??=[]).push("3.3.3");var h=(e,t,r)=>{let o=r?.renderBefore??t,s=o._$litPart$;if(s===void 0){let n=r?.renderBefore??null;o._$litPart$=s=new B(t.insertBefore(Q(),n),n,void 0,r??{})}return s._$AI(e),s};var Ft=globalThis,W=class extends C{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 r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=h(r,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return D}};W._$litElement$=!0,W.finalized=!0,Ft.litElementHydrateSupport?.({LitElement:W});var or=Ft.litElementPolyfillSupport;or?.({LitElement:W});(Ft.litElementVersions??=[]).push("4.2.2");var $={string:(e,t)=>e.getAttribute(t)??void 0,number:(e,t)=>{let r=e.getAttribute(t);return r===null||!r?void 0:Number(r)},boolean:(e,t)=>e.getAttribute(t)!==null},g={string:(e,t,r)=>(r===void 0?e.removeAttribute(t):e.setAttribute(t,r),!0),number:(e,t,r)=>(r===void 0?e.removeAttribute(t):e.setAttribute(t,r.toString()),!0),boolean:(e,t,r)=>(r?e.setAttribute(t,""):e.removeAttribute(t),!0),any:(e,t,r)=>{r==null?e.removeAttribute(t):typeof r=="string"?e.setAttribute(t,r):typeof r=="number"?e.setAttribute(t,r.toString()):typeof r=="boolean"?r===!0?e.setAttribute(t,""):e.removeAttribute(t):console.warn(`invalid attribute "${t}" type is "${typeof r}"`)},entries:(e,t)=>{for(let[r,o]of t)g.any(e,r,o)},record:(e,t)=>g.entries(e,Object.entries(t))};function ye(e,t={}){let r=document.createElement(e);return g.record(r,t),r}function $e(e){let t=document.createDocumentFragment();return h(e,t),t.firstElementChild}function xt(e,t){let r=[];for(let[o,s]of Object.entries(t))if(typeof s=="function")e.addEventListener(o,s),r.push(()=>e.removeEventListener(o,s));else{let[n,i]=s;e.addEventListener(o,i,n),r.push(()=>e.removeEventListener(o,i))}return()=>r.forEach(o=>o())}function be(e,t){let r=new MutationObserver(t);return r.observe(e,{attributes:!0}),()=>r.disconnect()}var yt=class{element;constructor(t){this.element=t}strings=new Proxy({},{get:(t,r)=>$.string(this.element,r),set:(t,r,o)=>g.string(this.element,r,o)});numbers=new Proxy({},{get:(t,r)=>$.number(this.element,r),set:(t,r,o)=>g.number(this.element,r,o)});booleans=new Proxy({},{get:(t,r)=>$.boolean(this.element,r),set:(t,r,o)=>g.boolean(this.element,r,o)})};var Ae=(e,t,r={})=>new Proxy(t,{get:(o,s)=>{switch(t[s]){case String:return $.string(e,s);case Number:return $.number(e,s);case Boolean:return $.boolean(e,s);default:throw new Error(`invalid attribute type for "${s}"`)}},set:(o,s,n)=>{try{switch(r.beforeSet?.(s),t[s]){case String:return g.string(e,s,n);case Number:return g.number(e,s,n);case Boolean:return g.boolean(e,s,n);default:throw new Error(`invalid attribute type for "${s}"`)}}finally{r.afterSet?.(s)}}});function I(e){let t=new yt(e);return{strings:t.strings,numbers:t.numbers,booleans:t.booleans,on:r=>be(e,r),spec:(r,o={})=>Ae(e,r,o)}}I.get=$;I.set=g;function we(e){return new Gt(e)}var Gt=class{tagName;#t=new Map;#e=[];constructor(t){this.tagName=t}attr(t,r=!0){return this.#t.set(t,r),this}attrs(t){for(let[r,o]of Object.entries(t))this.attr(r,o);return this}children(...t){return this.#e.push(...t),this}done(){let t=document.createElement(this.tagName);return g.entries(t,this.#t),t.append(...this.#e),t}};function V(e,t=document){let r=t.querySelector(e);if(!r)throw new Error(`element not found (${e})`);return r}function $t(e,t=document){return t.querySelector(e)}function bt(e,t=document){return Array.from(t.querySelectorAll(e))}var At=class e{element;#t;constructor(t){this.element=t}in(t){return new e(typeof t=="string"?V(t,this.element):t)}require(t){return V(t,this.element)}maybe(t){return $t(t,this.element)}all(t){return bt(t,this.element)}render(...t){return h(t,this.element)}get attrs(){return this.#t??=I(this.element)}events(t){return xt(this.element,t)}};function m(e,t=document){return V(e,t)}m.in=(e,t=document)=>new At(t).in(e);m.need=V;m.maybe=$t;m.all=bt;m.el=ye;m.elmer=we;m.mk=$e;m.events=xt;m.attrs=I;m.register=te;m.render=(e,...t)=>h(t,e);function U(){let e,t,r=new Promise((o,s)=>{e=o,t=s});return r.resolve=e,r.reject=t,r.promise=r,r.entangle=o=>(o.then(e,t),r),r}function wt(e){let t=null;return((...r)=>(t?t.params=r:(t={params:r,deferred:U()},queueMicrotask(()=>{let{params:o,deferred:s}=t;t=null,Promise.resolve(e(...o)).then(s.resolve).catch(s.reject)})),t.deferred.promise))}function b(e,t=new Set){if(t.has(e))throw new Error("cannot clone circular reference");let r;return typeof e=="function"||e!==null&&typeof e=="object"?(t.add(e),Array.isArray(e)?r=e.map(o=>b(o,new Set(t))):e.constructor===Object?r=Object.fromEntries(Object.entries(e).map(([o,s])=>[o,b(s,new Set(t))])):e instanceof Map?r=new Map(Array.from(e,([o,s])=>[o,b(s,new Set(t))])):e instanceof Set?r=new Set(Array.from(e,o=>b(o,new Set(t)))):e instanceof Date?r=new Date(e.getTime()):r=e,t.delete(e)):r=e,r}var tt=e=>typeof e=="object"&&e!==null;function sr(e){return e!=null}function nr(e){return e==null}var jo=Object.freeze({happy:sr,sad:nr,boolean:e=>typeof e=="boolean",number:e=>typeof e=="number",string:e=>typeof e=="string",bigint:e=>typeof e=="bigint",object:e=>typeof e=="object"&&e!==null,array:e=>Array.isArray(e),fn:e=>typeof e=="function",symbol:e=>typeof e=="symbol"});var _e=(e,t)=>{function r(o,s,n){if(!tt(o)||!tt(s))return o===s;if(n.includes(o))throw new Error("forbidden circularity detected in deep equal comparison");let i=[...n,o];if(o instanceof Map&&s instanceof Map){if(o.size!==s.size)return!1;for(let[c,a]of o)if(!s.has(c)||!r(a,s.get(c),i))return!1}else if(o instanceof Set&&s instanceof Set){if(o.size!==s.size)return!1;for(let c of o)if(!Array.from(s).some(a=>r(c,a,i)))return!1}else{let c=Object.keys(o),a=Object.keys(s);if(c.length!==a.length)return!1;for(let p of c)if(!a.includes(p)||!r(o[p],s[p],i))return!1}return!0}return r(e,t,[])};function ve(e){function t(r,o){if(!tt(r)||o.includes(r))return r;let s=[...o,r];if(r instanceof Map)for(let n of r.entries())for(let i of n)t(i,s);else if(r instanceof Set)for(let n of r)t(n,s);else if(Array.isArray(r))for(let n of r)t(n,s);else for(let n of Object.values(r))t(n,s);return Object.freeze(r)}return t(e,[])}function Se(e){if(e.ok)return e.value;let{error:t}=e;throw t instanceof Error?t:typeof t=="string"?new Error(t):new Error("unknown")}function Ee(e){if(e.ok)throw new Error("didn't get needed error");return e.error}function _t(e,t,r){if(e.has(t))return e.get(t);{let o=r();return e.set(t,o),o}}function Ce(e){let t,r=!1,o=()=>{r=!0,clearTimeout(t)},s=async()=>{r||(await e(o),!r&&(t=setTimeout(s,0)))};return s(),o}var ke=(e=0)=>new Promise(t=>setTimeout(t,e));function vt(e){let t=ir(),r=o=>t.on(o);return Object.assign(r,t),e&&t.on(e),r}function ir(){let e=new Set,t,r=()=>t??=U(),o=c=>{let a=t;t=void 0,a?.resolve(c)};return{set:e,on:c=>(e.add(c),()=>{e.delete(c)}),publish:(...c)=>{o(c);for(let a of[...e])a(...c)},publishAsync:async(...c)=>{o(c),await Promise.all([...e].map(async a=>a(...c)))},next:r}}var St=class{#t=new Set;#e=[];#r=new WeakMap;#o=0;#s=new Set;read(t){this.#e.at(-1)?.add(t)}write(t){let r=this.#r.get(t);if(r){for(let o of r)this.#s.add(o);this.#o===0&&this.#n()}}observe(t){let r=new Set;this.#e.push(r);try{let o=t();return{seen:r,value:o}}finally{this.#e.pop()}}subscribe(t,r){let o=_t(this.#r,t,()=>new Set);return o.add(r),()=>{o.delete(r),o.size===0&&this.#r.delete(t)}}batch=t=>{this.#o++;try{return t()}finally{this.#o--,this.#o===0&&this.#n()}};#i(t){if(this.#t.has(t))throw new Error("circularity forbidden");this.#t.add(t);try{t()}finally{this.#t.delete(t)}}#n(){for(;this.#s.size>0;){let t=[...this.#s];this.#s.clear();for(let r of t)this.#i(r)}}};var l=globalThis[Symbol.for("e280.tracker.2")]??=new St;function O(e){let t;function r(){return arguments.length===0?(l.read(r),e):(e=arguments[0],l.write(r),t?.publish(e),e)}return r.get=()=>r(),r.set=o=>r(o),r.on=o=>(t??=vt())(o),r}var vs=l.batch;function Oe(e){return ve(b(e))}var A=Symbol("optic");var et=class{calculate;#t=!1;#e;constructor(t){this.calculate=t,this.#e=t()}get(){return this.#t&&(this.#t=!1,this.#e=this.calculate()),this.#e}invalidate(){this.#t=!0}};var Et=class e{[A];#t;#e;#r;#o=vt();constructor(t){this[A]=t,this.#t=b(t.getState()),this.#e=new et(()=>b(t.getState())),this.#r=new et(()=>Oe(t.getState()))}get on(){return this.#o.on}update(){let t=this[A].getState();!_e(t,this.#t)&&(this.#e.invalidate(),this.#r.invalidate(),this.#t=b(t),l.write(this),this.#o.set.size&&this.#o.publish(this.#e.get()))}get state(){return l.read(this),this.#e.get()}get frozen(){return l.read(this),this.#r.get()}mutate(t){return this[A].mutate(t)}lens(t){let r=new e({getState:()=>t(this[A].getState()),mutate:o=>this[A].mutate(s=>o(t(s))),registerLens:this[A].registerLens});return this[A].registerLens(r),r}};function Pe(e){if(!e.done)throw new Error("wait not done");return Se(e)}function Me(e){if(!e.done)throw new Error("wait not done");return Ee(e)}var Re=e=>!e.done;var Kt=e=>e.done&&e.ok;function Ne(e,t){let{pending:r=()=>{},ok:o=()=>{},err:s=()=>{}}=t;return Re(e)?r():Kt(e)?o(Pe(e)):s(Me(e))}var Ct=E`
4
4
  * {
5
5
  margin: 0;
6
6
  padding: 0;
@@ -14,152 +14,27 @@ var Wr=Object.defineProperty;var Kr=(r,t)=>{for(var e in t)Wr(r,e,{get:t[e],enum
14
14
  ::-webkit-scrollbar-track { background: transparent; }
15
15
  ::-webkit-scrollbar-thumb { background: #888; border-radius: 1em; }
16
16
  ::-webkit-scrollbar-thumb:hover { background: #999; }
17
- `;var Wt=class r extends HTMLElement{static register(){w.register({SlyShadow:r},{soft:!0})}connectedCallback(){this.hasAttribute("view")||this.setAttribute("view","")}};var Kt=class{render;count=0;rendered=xt();constructor(t){this.render=t}doneRender(){this.count++,this.rendered.resolve(),this.rendered=xt()}},N=class extends Kt{host;shadow;constructor(t,e,s){super(t),this.host=e,this.shadow=s}};var _e=class{#t=[];get scope(){let t=this.#t.at(-1);if(!t)throw new Error("hooks must be called within a render fn");return t}increment(){let t=this.scope,e=t.position++;return{scope:t,position:e}}wrap(t,e){t.position=0,this.#t.push(t);try{return e()}finally{this.#t.pop()}}},v=globalThis[Symbol.for("e280.hooks")]??=new _e;var W=class{#t=[];clear(){this.#t.forEach(t=>t()),this.#t=[]}observe(t,e){let{seen:s,value:o}=p.observe(t);this.clear();for(let n of s){let i=p.subscribe(n,e);this.#t.push(i)}return o}};var Gt=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 K=class{cx;position=0;values=new Map;mounts=new Gt;constructor(t){this.cx=t}};var{I:Ya}=Fe;var gr=r=>r.strings===void 0;var xr={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Yt=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 yt=(r,t)=>{let e=r._$AN;if(e===void 0)return!1;for(let s of e)s._$AO?.(t,!1),yt(s,t);return!0},Jt=r=>{let t,e;do{if((t=r._$AM)===void 0)break;e=t._$AN,e.delete(r),r=t}while(e?.size===0)},yr=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 ms(r){this._$AN!==void 0?(Jt(this),this._$AM=r,yr(this)):this._$AM=r}function ds(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++)yt(s[n],!1),Jt(s[n]);else s!=null&&(yt(s,!1),Jt(s));else yt(this,r)}var gs=r=>{r.type==xr.CHILD&&(r._$AP??=ds,r._$AQ??=ms)},wt=class extends Ft{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,s){super._$AT(t,e,s),yr(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(yt(this,t),Jt(this))}setValue(t){if(gr(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 wr(r){return class extends HTMLElement{#t;#e;#r=new W;#o=this.attachShadow({mode:"open"});constructor(){super();let t=It(()=>{if(!this.isConnected)return;let e=this.#s();x(e,this.#t.shadow),this.#t.doneRender()});this.#t=new N(t,this,this.#o),this.#e=new K(this.#t)}#s(){return this.#r.observe(()=>v.wrap(this.#e,()=>r()),this.#t.render)}render(){x(this.#s(),this.#t.shadow),this.#t.doneRender()}connectedCallback(){this.#e.mounts.remountAll(),this.#t.render()}disconnectedCallback(){this.#e.mounts.unmountAll(),this.#r.clear()}}}function _(r){let{scope:t,position:e}=v.increment();return fr(t.values,e,r)}function bt(){return v.increment().scope.cx}function Xt(){let r=bt();if(!(r instanceof N))throw new Error("this hook only works on shadow views (but was called in a light view)");return r}function Se(){return Xt().host}function rt(r){let{scope:t}=v.increment();return _(()=>t.mounts.mount(r))}function $r(){return Xt().shadow}function Ar(r,t){Et(r,ys(t))}function ys(r){let t=[];if(Array.isArray(r)){let e=new Set(r.flat(1/0).reverse());for(let s of e)t.unshift(Y(s))}else r!==void 0&&t.push(Y(r));return t}function st(...r){let t=$r();_(()=>Ar(t,r))}function ot(r=""){let t=Se();_(()=>t.setAttribute("view",r))}function vr(r){return _(()=>L(r))}var Qt=st;function Sr(r,t){for(let[e,s]of Object.entries(t))bs(r,e,s)}function bs(r,t,e){let s=r.getAttribute(t),o=$s(e);o!==s&&(o===null?r.removeAttribute(t):r.setAttribute(t,o))}function $s(r){return typeof r=="string"?r:typeof r=="number"?r.toString():r?"":null}function As(){Wt.register();let r=document.createElement("sly-shadow"),t=r.attachShadow({mode:"open"});return{host:r,shadow:t}}function G(r){return Er(As,r)}G.setup=r=>(t=>Er(r,t));function Er(r,t){let e=Yt(class extends wt{#t;#e;#r;#o=new W;constructor(o){super(o);let{host:n,shadow:i}=r(),c=It(()=>{if(!this.#r)throw new Error("cannot render before props");if(!this.isConnected)return;let a=this.#s(this.#r);x(a,this.#t.shadow),this.#t.doneRender()});this.#t=new N(c,n,i),this.#e=new K(this.#t)}#s(o){return this.#r=o,this.#o.observe(()=>v.wrap(this.#e,()=>t(...this.#r)),this.#t.render)}render({props:o,children:n,attrs:i}){let{host:c}=this.#t;return this.isConnected&&(i&&Sr(c,i),x(n,this.#t.host),x(this.#s(o),this.#t.shadow),this.#t.doneRender()),c}disconnected(){x(null,this.#t.shadow),x(null,this.#t.host),this.#e.mounts.unmountAll(),this.#o.clear()}reconnected(){this.#e.mounts.remountAll(),this.#t.render()}});function s(...o){return e({props:o})}return s.with=e,s}function M(r,t){return()=>vs({hz:r,frames:t})}var vs=G(({hz:r,frames:t})=>{ot("loading"),Qt(Vt,_s);let e=vr(0);return rt(()=>mr(async()=>{await dr(1e3/r);let s=e()+1;e(s>=t.length?0:s)})),t.at(e())}),_s=A`
17
+ `;var kt=class e extends HTMLElement{static register(){m.register({SlyShadow:e},{soft:!0})}connectedCallback(){this.hasAttribute("view")||this.setAttribute("view","")}};var Tt=class{render;count=0;rendered=U();constructor(t){this.render=t}doneRender(){this.count++,this.rendered.resolve(),this.rendered=U()}},P=class extends Tt{host;shadow;constructor(t,r,o){super(t),this.host=r,this.shadow=o}};var Zt=class{#t=[];get scope(){let t=this.#t.at(-1);if(!t)throw new Error("hooks must be called within a render fn");return t}increment(){let t=this.scope,r=t.position++;return{scope:t,position:r}}wrap(t,r){t.position=0,this.#t.push(t);try{return r()}finally{this.#t.pop()}}},x=globalThis[Symbol.for("e280.hooks")]??=new Zt;var j=class{#t=[];clear(){this.#t.forEach(t=>t()),this.#t=[]}observe(t,r){let{seen:o,value:s}=l.observe(t);this.clear();for(let n of o){let i=l.subscribe(n,r);this.#t.push(i)}return s}};var Ot=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 z=class{cx;position=0;values=new Map;mounts=new Ot;constructor(t){this.cx=t}};var{I:Ni}=xe;var De=e=>e.strings===void 0;var He={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Mt=e=>(...t)=>({_$litDirective$:e,values:t}),Pt=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,r,o){this._$Ct=t,this._$AM=r,this._$Ci=o}_$AS(t,r){return this.update(t,r)}update(t,r){return this.render(...r)}};var rt=(e,t)=>{let r=e._$AN;if(r===void 0)return!1;for(let o of r)o._$AO?.(t,!1),rt(o,t);return!0},Rt=e=>{let t,r;do{if((t=e._$AM)===void 0)break;r=t._$AN,r.delete(e),e=t}while(r?.size===0)},Le=e=>{for(let t;t=e._$AM;e=t){let r=t._$AN;if(r===void 0)t._$AN=r=new Set;else if(r.has(e))break;r.add(e),mr(t)}};function hr(e){this._$AN!==void 0?(Rt(this),this._$AM=e,Le(this)):this._$AM=e}function fr(e,t=!1,r=0){let o=this._$AH,s=this._$AN;if(s!==void 0&&s.size!==0)if(t)if(Array.isArray(o))for(let n=r;n<o.length;n++)rt(o[n],!1),Rt(o[n]);else o!=null&&(rt(o,!1),Rt(o));else rt(this,e)}var mr=e=>{e.type==He.CHILD&&(e._$AP??=fr,e._$AQ??=hr)},ot=class extends Pt{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,r,o){super._$AT(t,r,o),Le(this),this.isConnected=t._$AU}_$AO(t,r=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),r&&(rt(this,t),Rt(this))}setValue(t){if(De(this._$Ct))this._$Ct._$AI(t,this);else{let r=[...this._$Ct._$AH];r[this._$Ci]=t,this._$Ct._$AI(r,this,0)}}disconnected(){}reconnected(){}};function Ue(e,t){for(let[r,o]of Object.entries(t))dr(e,r,o)}function dr(e,t,r){let o=e.getAttribute(t),s=gr(r);s!==o&&(s===null?e.removeAttribute(t):e.setAttribute(t,s))}function gr(e){return typeof e=="string"?e:typeof e=="number"?e.toString():e?"":null}function xr(){kt.register();let e=document.createElement("sly-shadow"),t=e.attachShadow({mode:"open"});return{host:e,shadow:t}}function F(e){return je(xr,e)}F.setup=e=>(t=>je(e,t));function je(e,t){let r=Mt(class extends ot{#t;#e;#r;#o=new j;constructor(s){super(s);let{host:n,shadow:i}=e(),c=wt(()=>{if(!this.#r)throw new Error("cannot render before props");if(!this.isConnected)return;let a=this.#s(this.#r);h(a,this.#t.shadow),this.#t.doneRender()});this.#t=new P(c,n,i),this.#e=new z(this.#t)}#s(s){return this.#r=s,this.#o.observe(()=>x.wrap(this.#e,()=>t(...this.#r)),this.#t.render)}render({props:s,children:n,attrs:i}){let{host:c}=this.#t;return this.isConnected&&(i&&Ue(c,i),h(n,this.#t.host),h(this.#s(s),this.#t.shadow),this.#t.doneRender()),c}disconnected(){h(null,this.#t.shadow),h(null,this.#t.host),this.#e.mounts.unmountAll(),this.#o.clear()}reconnected(){this.#e.mounts.remountAll(),this.#t.render()}});function o(...s){return r({props:s})}return o.with=r,o}function Qt(e){return class extends HTMLElement{#t;#e;#r=new j;#o=this.attachShadow({mode:"open"});constructor(){super();let t=wt(()=>{if(!this.isConnected)return;let r=this.#s();h(r,this.#t.shadow),this.#t.doneRender()});this.#t=new P(t,this,this.#o),this.#e=new z(this.#t)}#s(){return this.#r.observe(()=>x.wrap(this.#e,()=>e()),this.#t.render)}render(){h(this.#s(),this.#t.shadow),this.#t.doneRender()}connectedCallback(){this.#e.mounts.remountAll(),this.#t.render()}disconnectedCallback(){this.#e.mounts.unmountAll(),this.#r.clear()}}}function y(e){let{scope:t,position:r}=x.increment();return _t(t.values,r,e)}function st(){return x.increment().scope.cx}function Nt(){let e=st();if(!(e instanceof P))throw new Error("this hook only works on shadow views (but was called in a light view)");return e}function Yt(){return Nt().host}function G(e){let{scope:t}=x.increment();return y(()=>t.mounts.mount(e))}function qe(){return Nt().shadow}function Be(e,t){ct(e,$r(t))}function $r(e){let t=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let o of r)t.unshift(q(o))}else e!==void 0&&t.push(q(e));return t}function Dt(...e){let t=qe();y(()=>Be(t,e))}function Ht(e=""){let t=Yt();y(()=>t.setAttribute("view",e))}function We(e){return y(()=>O(e))}var Lt=Dt;function w(e,t){return()=>Ar({hz:e,frames:t})}var Ar=F(({hz:e,frames:t})=>{Ht("loading"),Lt(Ct,wr);let r=We(0);return G(()=>Ce(async()=>{await ke(1e3/e);let o=r()+1;r(o>=t.length?0:o)})),t.at(r())}),wr=E`
18
18
  :host {
19
19
  font-family: monospace;
20
20
  white-space: pre;
21
21
  user-select: none;
22
22
  }
23
- `;var k=G(r=>(ot("error"),Qt(Vt,Ss),typeof r=="string"?r:r instanceof Error?b`<strong>${r.name}:</strong> <span>${r.message}</span>`:"error")),Ss=A`
23
+ `;var _=F(e=>(Ht("error"),Lt(Ct,_r),typeof e=="string"?e:e instanceof Error?gt`<strong>${e.name}:</strong> <span>${e.message}</span>`:"error")),_r=E`
24
24
  :host {
25
25
  font-family: monospace;
26
26
  color: red;
27
27
  }
28
- `;function P(r,t){return(e,s)=>lr(e,{pending:r,err:t,ok:s})}var Bp=P(M(10,[" "," ",". ",".. ","..."," .."," ."]),k);var Gp=P(M(3,["\u{1F30E}","\u{1F30F}","\u{1F30D}"]),k);var Qp=P(M(10,["\u{1F312}","\u{1F313}","\u{1F314}","\u{1F315}","\u{1F316}","\u{1F317}","\u{1F318}","\u{1F311}","\u{1F311}","\u{1F311}"]),k);var sh=P(M(16,["|","/","-","\\"]),k);var ch=P(M(20,[":....",":....","::...",".::..","..::.","...::","....:","....:","...::","..::.",".::..","::..."]),k);var Zt=class{#t;#e;constructor(t){this.#t=t,this.#e=et(()=>[...this.#t.controllers].filter(e=>this.#t.portAssignments.get(e)===this))}get controllers(){return this.#e()}plug(t){this.#t.portAssignments.set(t,this)}unplug(t){this.#t.portAssignments.delete(t)}resolveIntents(t){return this.controllers.flatMap(e=>e.resolveIntents(t))}};var te=class{ports=new dt;controllers=new dt;portAssignments=new R};function Cr(r){return r.length>0?Math.max(...r):0}function Mr(r){return r.length>0?Math.min(...r):0}function kr([,,r],t){return{lastValue:0,holdStart:t,settings:Cs(r)}}function Es(){return{scale:1,invert:!1,clamp:null,range:null,bottom:null,top:null,timing:["direct"]}}function Cs(r={}){return{...Es(),...r}}function nt(r){return r!==0}var{min:Ms,max:ks,abs:Ps,sign:Ts,floor:Lh,ceil:Nh,pow:jh}=Math;function Pr(r,t=0,e=1){let s=Math.min(t,e),o=Math.max(t,e);return r>=s&&r<=o}function S(r,t=0,e=1){return r=Ms(r,e),r=ks(r,t),r}function Os(r,t,e,s){let n=(e-t)*r;return s!==void 0&&Ps(n)>s&&(n=Ts(n)*s),t+n}function Rs(r,t,e){return(r-t)/(e-t)}function Tr(r,t,e,s=0,o=1,n=!1){let i=Rs(r,t,e);return n&&(i=S(i)),Os(i,s,o)}var $t=class r{x;y;constructor(t=0,e=0){this.x=t,this.y=e}static new(t=0,e=0){return new this(t,e)}static zero(){return new this}static fill(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 new this().add(...t).divBy(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 rotation(t){return new this(Math.cos(t),Math.sin(t))}dup(){return new this.constructor(this.x,this.y)}*[Symbol.iterator](){yield this.x,yield this.y}array(){return[this.x,this.y]}tuple(){return this.array()}toJSON(){return this.array()}toString(){return`(${this.constructor.name} x${this.x.toFixed(2)}, y${this.y.toFixed(2)})`}fill(t){return this.x=t,this.y=t,this}zero(){return this.fill(0)}set_(t,e){return this.x=t,this.y=e,this}set({x:t,y:e}){return this.x=t,this.y=e,this}from(t){if(Array.isArray(t)){let[e,s]=t;this.x=e,this.y=s}else{let{x:e,y:s}=t;this.x=e,this.y=s}return 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=S(s/o,-1,1);return Math.acos(n)}angleBetween({x:t,y:e}){return this.angleBetween_(t,e)}normalize(){return this.divBy(this.magnitude())}half(){return this.divBy(2)}double(){return this.mulBy(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().mulBy(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=S(this.x,t.x,e.x),this.y=S(this.y,t.y,e.y),this}clampBy(t=0,e=1){return this.x=S(this.x,t,e),this.y=S(this.y,t,e),this}negate(){return this.map(t=>t*-1)}addBy(t){return this.x+=t,this.y+=t,this}subBy(t){return this.x-=t,this.y-=t,this}mulBy(t){return this.x*=t,this.y*=t,this}scale(t){return this.x*=t,this.y*=t,this}divBy(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}sub_(t,e){return this.x-=t,this.y-=e,this}sub(...t){for(let{x:e,y:s}of t)this.sub_(e,s);return this}mul_(t,e){return this.x*=t,this.y*=e,this}mul(...t){for(let{x:e,y:s}of t)this.mul_(e,s);return this}div_(t,e){return t!==0&&(this.x/=t),e!==0&&(this.y/=e),this}div(...t){for(let{x:e,y:s}of t)this.div_(e,s);return this}lerp_(t,e,s){return this.x+=(t-this.x)*s,this.y+=(e-this.y)*s,this}lerp(t,{x:e,y:s}){return this.lerp_(t,e,s)}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-e,n=this.y-s,i=Math.cos(t),c=Math.sin(t);return this.x=i*o-c*n+e,this.y=c*o+i*n+s,this}rotateAroundPoint(t,{x:e,y:s}){return this.rotateAroundPoint_(t,e,s)}};var Or=(r,t,e)=>$e(e).line(function(o){let{settings:n}=t;if(n.clamp){let[i,c]=n.clamp;o=S(o,i,c)}if(n.range){let[i,c]=n.range;o=Pr(o,i,c)?Tr(o,i,c,0,1,!0):0}return n.bottom&&(o=o<n.bottom?0:o),n.top&&(o=Math.min(n.top,o)),o},function(o){return t.settings.invert?1-o:o},function(o){return t.settings.scale*o},function(o){let{settings:n}=t,i=(n.timing[0]==="direct"?void 0:n.timing[1])??250,c=!nt(t.lastValue)&&nt(o),a=nt(t.lastValue)&&!nt(o);c&&(t.holdStart=r);let u=r-t.holdStart>=i;switch(t.lastValue=o,n.timing[0]){case"direct":return o;case"tap":return a&&!u?1:0;case"hold":return nt(o)&&u?o:0;default:throw new Error("unknown bindings timing")}});var j=class extends Map{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}merge([t,e]){let s=this.get(t)??0;return e>s&&this.set(t,e),this}};function Ee([r],[t]){return r===t?0:r<t?-1:1}function Rr(r){r=structuredClone(r);let t=new Map;return Object.entries(r).sort(Ee).flatMap(([e,s])=>Object.entries(s).sort(Ee).map(([o,n])=>({mode:e,action:o,atom:n}))).forEach((e,s)=>{t.set(s,{...e,id:s})}),t}function Ce(r){let t=Rr(r),e=new j,s=new Map,o=new Map;for(let c of t.values())o.set(c.id,0);let n=(c,a,u,l)=>{let h=tt(s,a.join("/"),()=>kr(["code",u,l],c)),f=e.get(u)??0;return Or(c,h,f)},i=(c,a)=>(u,l)=>{let h=[...a,String(l),typeof u=="string"?u:u[0]],f=i(c,h);if(typeof u=="string")return n(c,h,u);switch(u[0]){case"code":{let[,m,d]=u;return n(c,h,m,d)}case"and":{let[,...m]=u,d=m.map(f);return Mr(d)}case"or":{let[,...m]=u,d=m.map(f);return Cr(d)}case"not":{let[,m]=u;return f(m,"subject")>0?0:1}case"cond":{let[,m,d]=u;return f(d,"guard")>0?f(m,"subject"):0}case"mods":{let[,m,d]=u,vt=(Vr,...Te)=>Vr?["or",...Te]:["not",["or",...Te]];return f(["cond",m,["and",vt(d.ctrl??!1,"ControlLeft","ControlRight"),vt(d.alt??!1,"AltLeft","AltRight"),vt(d.meta??!1,"MetaLeft","MetaRight"),vt(d.shift??!1,"ShiftLeft","ShiftRight")]],"guard")>0?f(m,"subject"):0}}};return(c,a)=>{e.zero();let u=[];for(let l of a)e.merge(l);for(let l of t.values()){let h=i(c,[])(l.atom,l.mode),f=o.get(l.id);h!==f&&(o.set(l.id,h),u.push([l.id,h]))}return u}}var ee=class{handle;device;#t;#e;constructor(t,e,s){this.handle=t,this.device=s,this.#t=e,this.#e=Ce(e)}get bindings(){return this.#t}set bindings(t){$.equal(this.#t,t)||(this.#t=t,this.#e=Ce(t))}resolveIntents(t){return this.#e(t,this.device.samples())}};var re=class{custom;stock;constructor(t,e){if(this.custom=e,this.stock=new R,mt(this.stock,Object.entries(t)),this.stock.size===0)throw new Error("must be at least one stock profile")}get all(){return[...this.stock,...this.custom]}normalizeKey(t){return t&&(this.stock.has(t)||this.custom.has(t))?t:this.defaultId}get defaultId(){return[...this.stock.keys()][0]}get(t){return this.need(this.normalizeKey(t))}need(t){return this.stock.get(t)??ir(this.custom,t)}};function Me(r,t){for(;t.length>r;)t.shift();return t}var Lr=256,se=class{store;profileAssignments=new R;customProfiles=new R;constructor(t){this.store=t}async save(){await this.store.set({customProfiles:Me(Lr,[...this.customProfiles]),profileAssignments:Me(Lr,[...this.profileAssignments])})}async load(){let t=await this.store.get();this.customProfiles.clear(),this.profileAssignments.clear(),mt(this.customProfiles,t?.customProfiles??[]),mt(this.profileAssignments,t?.profileAssignments??[])}};var oe=class{profiles;settings;#t=new te;constructor(t){this.settings=new se(t.store),this.profiles=new re(t.stockProfiles,this.settings.customProfiles)}async load(){await this.settings.load();for(let t of this.#t.controllers.keys())this.#r(t)}#e=rr(100,()=>this.settings.save());get ports(){return[...this.#t.ports]}get controllers(){return[...this.#t.controllers]}get unassignedControllers(){return[...this.#t.controllers].filter(t=>!this.#t.portAssignments.get(t))}createPort(){let t=new Zt(this.#t);return this.#t.ports.add(t),t}deletePort(t){for(let e of t.controllers)t.unplug(e);this.#t.ports.delete(t)}createController(t,e,s){let o=tt(this.settings.profileAssignments,t,()=>e),n=this.profiles.get(o),i=new ee(t,n.bindings,s);return this.#t.controllers.add(i),i}deleteController(t){this.#t.controllers.delete(t),this.#t.portAssignments.delete(t)}async assignControllerProfile(t,e){this.settings.profileAssignments.set(t.handle,e),this.#r(t),await this.#e()}queryController(t){let e=this.#t.portAssignments.get(t),s=this.settings.profileAssignments.get(t.handle),o=this.profiles.get(s);return{controller:t,port:e,profileKey:s,profile:o}}#r(t){let e=this.settings.profileAssignments.get(t.handle);t.bindings=this.profiles.get(e).bindings}};var ke=r=>r;var ne=class{set=new Set;#t=new j;constructor(...t){for(let e of t)this.set.add(e)}*samples(){this.#t.zero();for(let t of this.set)for(let e of t.samples())this.#t.merge(e);yield*this.#t}};var ie=class{get;constructor(t){this.get=t}get gamepad(){return this.get()}};function Nr(r,t){let e=r;return()=>{let s=t();return s!=null&&(e=s),e}}function jr(r){let t=new Map;function e(){s(),o()}function s(){for(let i of navigator.getGamepads())if(i?.connected&&!t.has(i.index)){let c=()=>navigator.getGamepads()[i.index],a=new ie(Nr(i,c)),u=r(a);t.set(i.index,{pad:a,dispose:u})}}function o(){for(let[i,{pad:c,dispose:a}]of t)navigator.getGamepads()[c.gamepad.index]?.connected||(a(),t.delete(i))}e();let n=V(window,{gamepadconnected:e,gamepaddisconnected:e});return()=>{n();for(let{dispose:i}of t.values())i();t.clear()}}var D=class{on=ar();sampleMap=new j;setSample(t,e){return this.sampleMap.set(t,e),this.on.pub(t,e),this}zero(){for(let t of this.sampleMap.keys())this.setSample(t,0)}*samples(){yield*this.sampleMap}};function At(r){return r>=0?[r,0]:[0,Math.abs(r)]}var ae=class r extends D{client=new $t;movement=new $t;dispose=Ut();constructor(t=window){super(),this.dispose.schedule(V(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=>{this.sampleMap.set("pointer.wheel.right",0),this.sampleMap.set("pointer.wheel.left",0),this.sampleMap.set("pointer.wheel.up",0),this.sampleMap.set("pointer.wheel.down",0);for(let[s,o]of r.wheelCodes(e))this.setSample(s,o)}}))}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(){this.#t(),yield*super.samples()}#t(){let{x:t,y:e}=this.movement,[s,o]=At(t),[n,i]=At(e);this.setSample("pointer.move.left",o),this.setSample("pointer.move.right",s),this.setSample("pointer.move.up",i),this.setSample("pointer.move.down",n),this.movement.set_(0,0)}};var ce=class extends D{pad;constructor(t){super(),this.pad=t}get gamepad(){return this.pad.gamepad}*samples(){this.#t(this.pad.gamepad),this.#e(this.pad.gamepad),yield*super.samples()}#t(t){let e=0;for(let[s,o]of t.buttons.entries()){let n=s+1,i=o.value;e=Math.max(e,i),this.setSample(`gamepad.button.${n}`,i)}this.setSample("gamepad.button.any",e)}#e(t){for(let[e,s]of t.axes.entries()){let o=e+1;this.setSample(`gamepad.axis.${o}`,s);let[n,i]=At(s);this.setSample(`gamepad.axis.${o}.neg`,n),this.setSample(`gamepad.axis.${o}.pos`,i)}}};var Dr=A`
28
+ `;function v(e,t){return(r,o)=>Ne(r,{pending:e,err:t,ok:o})}var Du=v(w(10,[" "," ",". ",".. ","..."," .."," ."]),_);var zu=v(w(3,["\u{1F30E}","\u{1F30F}","\u{1F30D}"]),_);var Vu=v(w(10,["\u{1F312}","\u{1F313}","\u{1F314}","\u{1F315}","\u{1F316}","\u{1F317}","\u{1F318}","\u{1F311}","\u{1F311}","\u{1F311}"]),_);var Zu=v(w(16,["|","/","-","\\"]),_);var ep=v(w(20,[":....",":....","::...",".::..","..::.","...::","....:","....:","...::","..::.",".::..","::..."]),_);var Ve=E`
29
29
 
30
30
  .plate {
31
31
  background: black;
32
32
  }
33
33
 
34
- `;var Hr=A`
35
-
36
- .deck {
37
- display: flex;
38
- flex-direction: column;
39
- gap: 0.5em;
40
-
41
- > div {
42
- display: flex;
43
- flex-wrap: wrap;
44
- gap: 0.5em;
45
- }
46
- }
47
-
48
- .port {
49
- background: grey;
50
- width: 16em;
51
- max-width: 100%;
52
-
53
- header {
54
- display: flex;
55
- padding: 0.5em;
56
-
57
- > span {
58
- flex: 1 1 auto;
59
- font-weight: bold;
60
- }
61
- }
62
-
63
- strong {
64
- display: block;
65
- width: 100%;
66
- padding: 0.2em;
67
- }
68
-
69
- .controllerlist {
70
- display: flex;
71
- flex-direction: column;
72
- padding: 0.5em;
73
- gap: 0.5em;
74
- }
75
- }
76
-
77
- .controller {
78
- display: flex;
79
- flex-direction: column;
80
- background: green;
81
- padding: 0.5em;
82
- gap: 0.5em;
83
-
84
- .buttons {
85
- display: flex;
86
- flex-wrap: wrap;
87
- justify-content: space-between;
88
-
89
- > div {
90
- display: flex;
91
- flex-wrap: wrap;
92
- }
93
- }
94
- }
95
-
96
- button[disabled] {
97
- opacity: 0.2;
98
- }
99
-
100
- `;var Ur=G((r,t={})=>{ot("desk"),st(Hr);function e(c,a){let u=r.ports,l=r.queryController(c),h=u.indexOf(l.port),f=S(h+a,0,u.length-1),m=u.at(f);m&&m.plug(c)}function s(c,a){return b`
101
- <div class=port>
102
- <header>
103
- <span>P${a+1}</span>
104
- <div class=buttons>
105
- <button @click=${()=>r.deletePort(c)}>🚫</button>
106
- </div>
107
- </header>
108
- <div class=controllerlist>
109
- ${c.controllers.map(n)}
110
- </div>
111
- </div>
112
- `}function o(c){return b`
113
- <div class=port>
114
- <header>
115
- <span>unassigned</span>
116
- </header>
117
- <div class=controllerlist>
118
- ${c.map(n)}
119
- </div>
120
- </div>
121
- `}function n(c){let{port:a,profileKey:u}=r.queryController(c);async function l(f){let d=f.currentTarget.value;await r.assignControllerProfile(c,d)}function h(f){(r.ports.at(0)??r.createPort()).plug(f)}return b`
122
- <div class=controller>
123
- <span>${t.getControllerLabel?.(c)??c.handle}</span>
124
-
125
- <div class=buttons>
126
- <div>
127
- ${a?b`
128
- <button @click=${()=>e(c,-1)} ?disabled=${r.ports.indexOf(a)===0}>👈</button>
129
- <button @click=${()=>a.unplug(c)}>⏏️</button>
130
- <button @click=${()=>e(c,1)} ?disabled=${r.ports.indexOf(a)===r.ports.length-1}>👉</button>
131
- `:b`
132
- <button @click=${()=>h(c)}>🔌</button>
133
- `}
134
- </div>
135
- <select @change=${l}>
136
- ${r.profiles.all.map(([f,m])=>b`
137
- <option
138
- .value=${f}
139
- .selected=${f===u}>
140
- ${m.label}
141
- </option>
142
- `)}
143
- </select>
144
- </div>
145
- </div>
146
- `}let{unassignedControllers:i}=r;return b`
147
- <div class=deck>
148
- <div>
149
- ${r.ports.map(s)}
150
- <div>
151
- <button @click=${()=>r.createPort()}>✨add port</button>
152
- </div>
153
- </div>
154
-
155
- <div>
156
- ${i.length>0?o(i):null}
157
- </div>
158
- </div>
159
- `});var zr=(r,t={})=>wr(()=>(st(Dr),b`
34
+ `;var Fe=()=>Qt(()=>(Dt(Ve),gt`
160
35
  <div class=plate>
161
- ${Ur(r,t)}
36
+ coming soon, lol
162
37
  </div>
163
- `));var ue=class extends D{dispose=Ut();constructor(t=window){super(),this.dispose.schedule(V(t,this.#t)),this.dispose.schedule(V(window,this.#e))}#t={keydown:t=>{if(t.repeat)return null;this.setSample(t.code,1),this.setSample("keyboard.any",1)},keyup:t=>{if(t.repeat)return null;this.setSample(t.code,0),this.setSample("keyboard.any",0)}};#e={blur:()=>{this.zero()}}};var Ls=ke({play:{action:["or","Space","pointer.button.left","gamepad.button.1"],up:["or","KeyW","gamepad.axis.2.pos"],down:["or","KeyS","gamepad.axis.2.neg"],left:["or","KeyA","gamepad.axis.1.pos"],right:["or","KeyD","gamepad.axis.1.neg"]}}),qr=new Bt("tactDeck"),F=new oe({store:qr,stockProfiles:{standard:{label:"\u{1F4DC}standard",bindings:Ls},micro:{label:"\u{1F9A0}micro",bindings:ke({play:{action:["or","Space","pointer.button.left","gamepad.button.1"],up:["or","KeyW","gamepad.axis.2.pos"],down:["or","KeyS","gamepad.axis.2.neg"],left:["or","KeyA","gamepad.axis.1.pos"],right:["or","KeyD","gamepad.axis.1.neg"]}})}}});await F.load();qr.onStorageEvent(()=>F.load());var Br=F.createPort(),Ir=F.createController("primary","standard",new ne(new ue,new ae));Br.plug(Ir);var Pe=new Map().set(Ir,"\u2328\uFE0F\u{1F5B1}keyboard+mouse");jr(r=>{let t=`(${r.gamepad.index+1}) ${r.gamepad.id}`,e=F.createController(t,"standard",new ce(r));return Pe.set(e,`\u{1F3AE}${t}`),Br.plug(e),()=>F.deleteController(e)});w.register({DemoApp:zr(F,{getControllerLabel:Pe.get.bind(Pe)})});
38
+ `));m.register({DemoApp:Fe()});
164
39
  /*! For license information please see main.bundle.min.js.LEGAL.txt */
165
40
  //# sourceMappingURL=main.bundle.min.js.map