@stacksjs/composables 0.70.45 → 0.70.54

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ # MIT License
2
+
3
+ Copyright (c) 2023 Open Web Foundation
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,394 @@
1
+ ![Social Card of Stacks](./public/images/social.png)
2
+
3
+ # Rapid App & Library Development
4
+
5
+ [![npm version](https://img.shields.io/npm/v/stacks?style=flat-square)](https://npmjs.com/package/stacks)
6
+ [![GitHub Actions](https://img.shields.io/github/actions/workflow/status/stacksjs/stacks/ci.yml?style=flat-square&branch=main)](https://github.com/stacksjs/stacks/actions?query=workflow%3Aci)
7
+ [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
8
+ [![npm downloads](https://img.shields.io/npm/dm/stacks?style=flat-square)](https://npmjs.com/package/stacks)
9
+ <!-- [![Codecov][codecov-src]][codecov-href] -->
10
+
11
+ > [!NOTE]
12
+ > Stacks is in active development and usable today — every section below
13
+ > is real, runnable functionality. Expect occasional breaking changes
14
+ > while we cut the official 1.0. Feedback and issue reports are welcome.
15
+
16
+ Stacks is a rapid development framework, where the goal is to _help you_ create & maintain frontends, backends, and clouds—without having to worry about the boilerplate. _An all-in-one toolkit that meets all your full stack needs._
17
+
18
+ - Web & Desktop Applications _(including system tray apps)_
19
+ - Serverless & Traditional APIs
20
+ - Cloud Infrastructure Creation & Maintenance
21
+ - Interactive CLIs
22
+ - Framework-agnostic Component & Function Libraries
23
+ - Deployment & Release Manager _(CI & CD)_
24
+
25
+ ## Convention Over Configuration
26
+
27
+ As a developer, Stacks helps you every step along the way—in beginner & expert-friendly ways, allowing you to focus on the _what & why_ of your project, all while enabling you to stay in control & ownership of your _(& your users’)_ data.
28
+
29
+ > “It is the framework’s responsibility to remove patterns that lead to boilerplate code. And Stacks is really good at that.” _- Chris_
30
+
31
+ <!-- ![Atomic UI & FX Design](./docs/assets/diagram.png) -->
32
+
33
+ ## Prerequisites
34
+
35
+ Stacks runs on [Bun](https://bun.sh). You'll need:
36
+
37
+ - **Bun ≥ 1.3.11** — install with `curl -fsSL https://bun.sh/install | bash`, or upgrade an existing install with `bun upgrade`.
38
+ - **macOS, Linux, or WSL** — Windows-native is on the roadmap; today the toolchain assumes a POSIX shell.
39
+ - **Node.js is NOT required.** Bun handles the JS/TS runtime, package management, and bundling.
40
+
41
+ That's it for the framework itself. Individual features (Postgres, Redis, AWS deploys, etc.) bring their own prereqs — each is called out where it matters in the docs.
42
+
43
+ ## Get Started
44
+
45
+ The fastest path, assuming Bun is installed:
46
+
47
+ ```bash
48
+ bunx buddy new my-project
49
+ ```
50
+
51
+ A one-line installer (`curl -Ssf stacksjs.com/install | sh`) is also planned and will appear here once it lands; for now the `bunx` form above is the supported install path.
52
+
53
+ ## Usage
54
+
55
+ Stacks ships with `buddy`, a single CLI for everything you'll do day to day. The handful below covers the common workflows; the full reference is collapsed underneath.
56
+
57
+ ```bash
58
+ buddy dev # start the dev server (frontend, API, dashboard, …)
59
+ buddy build # build for production (CLI prompts for what to build)
60
+ buddy test # run tests
61
+ buddy migrate # run database migrations
62
+ buddy make:action UpdateUser # scaffold a new Action (also: model, view, job, …)
63
+ buddy --help # show every available command
64
+ ```
65
+
66
+ For the full command reference, see the collapsible section below or the [Buddy CLI documentation](https://stacksjs.org/docs/cli).
67
+
68
+ <details>
69
+ <summary>View the complete Buddy Toolkit</summary>
70
+
71
+ ```bash
72
+ buddy --version # get the Stacks version
73
+ buddy --help # view help menu
74
+ # please note: you may suffix any command with the
75
+ # `command --help` flag to review the help menu
76
+
77
+ buddy install # installs dependencies
78
+ buddy add # adds a stack or dependency
79
+ buddy fresh # fresh reinstall of all deps
80
+ buddy clean # removes all deps
81
+ buddy setup # sets up the project initially
82
+ buddy setup:oh-my-zsh # optional: sets up Oh My Zsh with auto-completions & "aliases"
83
+
84
+ buddy upgrade # upgrades all dependencies
85
+ buddy upgrade -i # prompts you to select which updates to apply (wip)
86
+ buddy upgrade:dependencies # auto-upgrades package.json deps
87
+ buddy upgrade:framework # auto-upgrades deps & the Stacks framework
88
+ buddy upgrade:search-engine # auto-upgrades configured search engine
89
+ buddy upgrade:shell # upgrades the shell integration
90
+ buddy upgrade:binary # upgrades the `stacks` binary
91
+ buddy upgrade:bun # upgrades to latest project-defined Bun version
92
+ buddy upgrade:all # auto-upgrades all of the above
93
+
94
+ # if you need any more info on any command listed here, you may suffix
95
+ # any of them via the "help option", i.e. `buddy ... --help`
96
+
97
+ buddy dev # starts the frontend dev server
98
+ buddy dev -i # prompts any of the dev servers (components, functions, views, docs, or api)
99
+ buddy dev:api # starts the API dev server
100
+ buddy dev:dashboard # starts the Admin/Dashboard dev server
101
+ buddy dev:desktop # starts the Desktop dev server
102
+ buddy dev:views # starts frontend dev server
103
+ buddy dev:components # starts component dev server
104
+ buddy dev:functions # stubs functions
105
+ buddy dev:docs # starts local docs dev server
106
+ buddy dev docs # also starts the local docs dev server (colon is optional for all commands)
107
+ buddy development # `buddy dev` alias
108
+
109
+ buddy share # creates a sharable link to your local project
110
+
111
+ # for Laravel folks, `serve` may ring more familiar than the `dev` name. Hence, we aliased it
112
+ buddy serve
113
+ buddy serve:components
114
+ buddy serve:desktop
115
+ buddy serve:views
116
+ buddy serve:functions
117
+ buddy serve:docs
118
+
119
+ # building for production (e.g. AWS, Google Cloud, npm, Vercel, Netlify, et al.)
120
+ buddy build # select a specific build (follow CLI prompts)
121
+ buddy build:views # builds SSG views
122
+ buddy build:desktop # builds Desktop application
123
+ buddy build:library # builds any or all libraries
124
+ buddy build:functions # builds function library
125
+ buddy build:components # builds Vue component library & Web Component library
126
+ buddy build:web-components # builds framework agnostic Web Component library (i.e. Custom Elements)
127
+ buddy build:all # builds all your code
128
+
129
+ # `buddy build` aliases
130
+ buddy prod
131
+ buddy prod:components
132
+ buddy prod:desktop
133
+ buddy prod:library
134
+ buddy prod:views
135
+ buddy prod:functions
136
+ buddy prod:web-components
137
+ buddy prod:all
138
+ buddy production # `buddy prod` alias
139
+
140
+ # sets your application key
141
+ buddy key:generate
142
+
143
+ buddy make:component HelloWorld # bootstraps a HelloWorld component
144
+ buddy make:function hello-world # bootstraps a hello-world function
145
+ buddy make:view hello-world # bootstraps a hello-word page
146
+ buddy make:model Car # bootstraps a Car model
147
+ buddy make:database cars # creates a cars database
148
+ buddy make:migration create_cars_table # creates a cars migration file
149
+ buddy make:factory cars # creates a Car factory file
150
+ buddy make:table cars # bootstraps a cars data table
151
+ buddy make:notification welcome-email # bootstraps a welcome-email notification
152
+ buddy make:lang de # bootstraps a lang/de.yml language file
153
+ buddy make:stack my-project # shares logic with `bunx --bun stacks new my-project`
154
+
155
+ buddy migrate # runs database migrations
156
+ buddy migrate:dns # sets the ./config/dns.ts file
157
+
158
+ buddy dns example.com # list all DNS records for example.com
159
+ buddy dns example.com --type MX # list MX records for example.com
160
+
161
+ buddy https example.com/api/hello
162
+ # http [flags] [METHOD] URL [ITEM [ITEM]]
163
+ buddy http --help
164
+ buddy http PUT example.com/api/put X-API-Token:123 name=John # Custom HTTP method, HTTP headers and JSON data
165
+ buddy http -v example.com/api/get # See the request that is being sent using one of the output options
166
+ buddy http POST example.com/api/post hello=World # submitting forms
167
+ buddy http -a USERNAME POST https://api.github.com/repos/user/repo/issues/83/comments body='Great feature! :heart:'
168
+ buddy http localhost:8000 Host:example.com
169
+
170
+ buddy lint # runs linter
171
+ buddy lint:fix # runs linter and fixes issues
172
+
173
+ buddy commit # follow CLI prompts for committing staged changes
174
+ buddy release # creates the releases for the stack & triggers the Release Action (workflow)
175
+ buddy changelog # generates CHANGELOG.md
176
+
177
+ # when deploying your app/s to a remote server or cloud provider
178
+ buddy deploy # select a specific deployment (follow CLI prompts)
179
+ # buddy deploy:docs # deploys docs to AWS (or other configured provider)
180
+ # buddy deploy:functions # deploys functions to AWS (or other configured provider)
181
+ # buddy deploy:views # deploys views to AWS (or other configured provider)
182
+ # buddy deploy:all # deploys all your code
183
+ buddy undeploy # be careful: "undeploys" removes/deletes your deployed resources
184
+
185
+ buddy cloud:remove # removes cloud setup
186
+ buddy cloud:cleanup # removes cloud setup & cleans up all potentially leftover resources
187
+ buddy cloud:add --jump-box # adds a jump box to your cloud setup
188
+
189
+ # select the example to run (follow CLI prompts)
190
+ buddy example # prompts you to select which example to run
191
+ buddy example:vue # runs the Vue example
192
+ buddy example:web-components # runs the Web Component example
193
+
194
+ # you likely won’t need to run these commands as they are auto-triggered, but they are available
195
+ buddy generate # prompts you to select which generator to run
196
+ buddy generate:types # generates types for your components, functions, & views
197
+ buddy generate:entries # generates entry files for components, functions, & views
198
+ buddy generate:web-types # generates Web Component types
199
+ buddy generate:vscode-custom-data # generates VSCode custom data
200
+ buddy generate:ide-helpers # generates IDE helpers
201
+ buddy generate:component-meta # generates component meta
202
+ buddy generate:all # runs all generators
203
+
204
+ # generates your application key
205
+ buddy key:generate # generates your application key
206
+
207
+ # manage your environment variables
208
+ buddy env:get # get an environment variable
209
+ buddy env:set # set an environment variable
210
+ buddy env:encrypt # encrypt an environment variable
211
+ buddy env:decrypt # decrypt an environment variable
212
+ buddy env:keypair # generate a keypair
213
+ buddy env:rotate # rotate a keypair
214
+
215
+ # generate your TypeScript declarations
216
+ buddy types:generate # generates types for your components, functions, & views
217
+ buddy types:fix # auto-fixes types for your components, functions, & views
218
+
219
+ buddy domains # alias for `buddy domains:list`
220
+ buddy domains:add stacksjs.com # adds a domain
221
+ buddy domains:remove stacksjs.com # removes a domain
222
+ buddy domains:list # lists all domains
223
+ buddy domains:update # apply ./config/dns.ts updates
224
+ buddy domains:purchase stacksjs.com # purchase a new domain
225
+
226
+ # test your stack
227
+ buddy test # runs test suite (unit & e2e)
228
+ buddy test:coverage # runs test coverage
229
+ buddy test:types # runs typecheck
230
+
231
+ # the CLI may be triggered in any
232
+ # of the following syntax
233
+ stx fresh
234
+ buddy fresh
235
+ bud fresh
236
+ ```
237
+
238
+ </details>
239
+
240
+ Read more about the Buddy CLI in the [official docs](https://stacksjs.org/docs/cli) — every command, every flag, every prompt explained.
241
+
242
+ ## Features
243
+
244
+ The Stacks framework is a harmony of several “engines” to build any web and/or desktop application, in highly scalable & privacy-friendly ways. It consists of the following engines:
245
+
246
+ ### Frontend Development
247
+
248
+ _Develop dynamic UIs with helpers for atomic design, and much more._
249
+
250
+ - 🧩 **Components** _primitive to develop user interfaces_
251
+ - 🤖 **Functions** _primitive to develop business logic (and grant your UI superpowers)_
252
+ - 🎨 **UI Kit** _modern & deeply-integrated components_
253
+ - 🌐 **Web** _“a routing & templating engine that makes sense”_
254
+ - 🖥️ **Desktop** _transforms your web app into a desktop app, plus more_
255
+ - 📝 **Documentation** _markdown-based documentation, auto-generated_
256
+ - 📚 **Library** _auto-builds & manages component & function libraries_
257
+ - ⚡️ Powered by Bun, Craft, Headwind
258
+
259
+ ### Backend Development
260
+
261
+ _Develop serverless (or server) functions with countless helpers to build scalable & fast APIs._
262
+
263
+ - 🪄 **AI** _deep AI integrations to simplify building agentic workflow_
264
+ - 🤖 **APIs** _scalability & maintainability built-in_
265
+ - 🏎️ **Cache** _unified caching for DynamoDB, Redis and more_
266
+ - ⚙️ **CLIs** _create beautiful CLIs for Linux, Windows, and Mac (dependency-free binaries)_
267
+ - 🛍️ **Commerce** _own & grow your own online business with ease (SaaS-optimized)_
268
+ - 📀 **Database** _DynamoDB, SQLite, MySQL, Postgres, and more_
269
+ - 👾 **Errors** _native type-safe error handling_
270
+ - 🗓️ **Events** _functional event (front & backend) communication_
271
+ - 📢 **Notifications** _emails, SMSs, direct, and push notifications & webhooks_
272
+ - 🗺️ **ORM** _automated schemas for scale & a pretty API_
273
+ - 💳 **Payments** _unified API for one-off & subscription billing methods for Stripe_
274
+ - ⚙️ **Queues** _run any heavy workload in the background_
275
+ - 🛠️ **Query Builder** _powerful, type-safe SQL query builder_
276
+ - 💬 **Realtime** _“everything you need to build dynamic real-time apps”_
277
+ - 🧭 **Router** _smart routing, file-based or Laravel-like_
278
+ - 🔎 **Search Engine** _smart searching, advanced filtering & sorting, pagination, headless UI_
279
+ - 💾 **Storage** _a secure-by-default File API that feels right_
280
+ - 🧪 **Tinker** _a powerful TypeScript REPL_
281
+ - 🌪️ **Validation** _e2e type-safety (true frontend & backend harmony)_
282
+ - 🎯 **X-Ray** _all you need to debug, log & analyze_
283
+
284
+ ### Cloud Development
285
+
286
+ _Develop & maintain cloud infrastructure with ease. “Imagine Vercel, Vapor and Forge having been unified.”_
287
+
288
+ - ☁️ **Server** _local development server & production-ready servers out-of-the-box_
289
+ - ⛅️ **Serverless** _on-demand, auto-scaling, zero maintenance_
290
+ - ⏰ **Alarms** _built-in cloud infrastructure monitoring to avoid surprises_
291
+ - 🚏 **CDN** _zero-config, low-latency, request life-cycle hooks, optimized request compressions (Brotli & gzip)_
292
+ - 🔀 **Domain** _version-controlled & zero-config domain management (e.g. DNS management)_
293
+ - 🤖 **AI** _fine-tune a foundational model using your application data_
294
+ - 📧 **Email** _secure & zero-setup <easy-peasy@custom-domains.com> mailboxes_
295
+ - 🔐 **Firewall** _native web application firewall support_
296
+ - 📦 **Storage** _unlimited cloud storage & automatic backups_
297
+ - 🚜 **Maintenance** _maintain your cloud infrastructure with ease using Buddy & Stacks_
298
+ - 🚦 **Infrastructure as Code** _version-controlled cloud infrastructure (AWS, Google next?)_
299
+
300
+ ### CI/CD
301
+
302
+ _Focus on coding, not publishing._
303
+
304
+ - 🚀 **Deployment Manager** _takes the sweat out of production deployments—zero-setup push-to-deploy_
305
+ - 0️⃣ **Zero Downtime** _deploy with confidence using a zero-downtime deployment strategy_
306
+ - 📫 **Release Manager** _libraries (component & function) auto-published to npm, git helpers, and more_
307
+
308
+ ### Developer Experience (DX)
309
+
310
+ Convention over configuration, while staying wholly configurable. _No more boilerplate._
311
+
312
+ - 💎 **Automated Upgrades** _no need to worry about upgrading to the latest versions, Stacks upgrades you_
313
+ - 🦋 **Pretty Dev URLs** _your-project.localhost instead of localhost:3000_
314
+ - 💡 **IDE Integration** _auto-completions, inline docs & a powerful IDE setup_
315
+ - 🪄 **Zero-Config** _yet highly configurable—convention over configuration_
316
+ - 💅 **Linter & Formatter** _auto-configured & built into your IDE_
317
+ - 💪🏼 **Type Strong** _built-in e2e type-safety_
318
+ - ✨ **Git Workflows** _committing with ease_
319
+ - 🚗 **Auto Imports** _your components & functions, including date, string, array, & object helpers_
320
+ - ⏩ **Code Snippets** _goodbye to the boilerplate code—thank you Sarah Drasner_
321
+ - 🔤 **Spell Checker** _be notified once there are typos_
322
+ - 🛠️ **Essential Utilities** _powers at your fingertips. Collections, VueUse, and more_
323
+ - 👥 **Team Management** _manage your team & their permissions_
324
+ - 🧪 **Streamlined Testing** _unit & e2e tests powered by Bun, Vitest & Playwright_
325
+
326
+ No matter whether you are a beginner or an expert, the approachable Stacks design allows you to learn at your own pace, using our thorough documentation covering every aspect of the framework. Stacks is extremely beginner & expert-friendly.
327
+
328
+ Develop beautiful, reactive, composable UIs without learning a new set of languages. HTML, CSS, and minimal JavaScript—that’s all you need to dive in now! _Or TypeScript ✌🏼_
329
+
330
+ > _An actual rapid application development framework for all Full Stack needs. Next-level simplicity & DX._
331
+
332
+ ## Testing
333
+
334
+ ```bash
335
+ ./buddy test
336
+ ```
337
+
338
+ ## Changelog
339
+
340
+ Please see our [releases](https://github.com/stacksjs/stacks/releases) page for more information on what has changed recently.
341
+
342
+ ## Contributing
343
+
344
+ Please see the [Contributing Guide](https://github.com/stacksjs/contributing) for details.
345
+
346
+ ## Community
347
+
348
+ For help, discussion about best practices, or any other conversation that would benefit from being searchable:
349
+
350
+ [Discussions on GitHub](https://github.com/stacksjs/stacks/discussions)
351
+
352
+ For casual chit-chat with others using this package:
353
+
354
+ [Join the Stacks Discord Server](https://discord.gg/stacksjs)
355
+
356
+ ## Postcardware
357
+
358
+ “Software that is free, but hopes for a postcard.” We love receiving postcards from around the world showing where Stacks is being used! We showcase them on our website too.
359
+
360
+ Our address: Stacks.js, 12665 Village Ln #2306, Playa Vista, CA 90094, United States 🌎
361
+
362
+ ## Sponsors
363
+
364
+ We would like to extend our thanks to the following sponsors for funding Stacks development. If you are interested in becoming a sponsor, please reach out to us.
365
+
366
+ - [JetBrains](https://www.jetbrains.com/)
367
+ - [The Solana Foundation](https://solana.com/)
368
+
369
+ ## Credits
370
+
371
+ - [Laravel](https://laravel.com) _many thanks to their community_
372
+ - [Chris Breuer](https://github.com/chrisbbreuer)
373
+ - [All Contributors](../../contributors)
374
+
375
+ And a special thanks to [Dan Scanlon](https://twitter.com/danscan) for donating the `stacks` name on npm ✨
376
+
377
+ ## License
378
+
379
+ The MIT License (MIT). Please see [LICENSE](LICENSE.md) for more information.
380
+
381
+ Made with 💙
382
+
383
+ <!-- Badges -->
384
+ [npm-version-src]: https://img.shields.io/npm/v/stacks?style=flat-square
385
+ [npm-version-href]: https://npmjs.com/package/stacks
386
+
387
+ [npm-downloads-src]: https://img.shields.io/npm/dm/stacks?style=flat-square
388
+ [npm-downloads-href]: https://npmjs.com/package/stacks
389
+
390
+ [github-actions-src]: https://img.shields.io/github/actions/workflow/status/stacksjs/stacks/ci.yml?style=flat-square&branch=main
391
+ [github-actions-href]: https://github.com/stacksjs/stacks/actions?query=workflow%3Aci
392
+
393
+ <!-- [codecov-src]: https://img.shields.io/codecov/c/gh/stacksjs/stacks/main?style=flat-square
394
+ [codecov-href]: https://codecov.io/gh/stacksjs/buddy -->
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- function L(J){if(J&&typeof J==="object"&&"value"in J&&"subscribe"in J)return J.value;return J}function T(J){if(typeof J==="function")return J();return L(J)}function j(J){return J!==null&&typeof J==="object"&&"value"in J&&"subscribe"in J}function N(){}function U(){return typeof window<"u"?window:void 0}function a(){return typeof document<"u"?document:void 0}function FJ(){return typeof navigator<"u"?navigator:void 0}var iJ=new Map;function S9(J){return iJ.get(J)}function x9(J,$){iJ.set(J,$)}var y9="stx-storage";import{onUnmounted as w9,ref as k9,watch as g9}from"@stacksjs/stx";function t(J,$,Q,G){let Z=Q??(typeof localStorage<"u"?localStorage:void 0),K=G?.serializer??{read:(M)=>{try{return JSON.parse(M)}catch{return M}},write:(M)=>JSON.stringify(M)},q=$;if(Z)try{let M=Z.getItem(J);if(M!==null)q=K.read(M)}catch{}let z=k9(q);if(g9(z,(M)=>{if(!Z)return;try{if(M===null||M===void 0)Z.removeItem(J);else Z.setItem(J,K.write(M))}catch(B){let W=B?.name??"",X=B?.message??String(B);if(W==="QuotaExceededError"||/quota/i.test(X))console.warn(`[useStorage] ${J}: storage quota exceeded \u2014 value not persisted.`);else console.warn(`[useStorage] ${J}: failed to persist value \u2014 ${X}`)}}),typeof window<"u"){let M=(B)=>{if(B.key!==J||B.storageArea!==Z)return;if(B.newValue===null)z.value=$;else try{z.value=K.read(B.newValue)}catch{z.value=$}};window.addEventListener("storage",M),w9(()=>window.removeEventListener("storage",M))}return z}function h9(J,$,Q){return t(J,$,typeof localStorage<"u"?localStorage:void 0,Q)}function v9(J,$,Q){return t(J,$,typeof sessionStorage<"u"?sessionStorage:void 0,Q)}import{onUnmounted as f9,ref as rJ,watch as m9}from"@stacksjs/stx";function sJ(){let J=rJ(!1);if(typeof window<"u"&&window.matchMedia){let $=window.matchMedia("(prefers-color-scheme: dark)");J.value=$.matches;let Q=(G)=>{J.value=G.matches};$.addEventListener("change",Q);try{f9(()=>{$.removeEventListener("change",Q)})}catch{}}return J}function p9(){let $=sJ().value;if(typeof localStorage<"u"){let G=localStorage.getItem("color-scheme");if(G==="dark")$=!0;else if(G==="light")$=!1}let Q=rJ($);if(m9(Q,(G)=>{if(typeof document<"u")document.documentElement.classList.toggle("dark",G);if(typeof localStorage<"u")localStorage.setItem("color-scheme",G?"dark":"light")}),typeof document<"u")document.documentElement.classList.toggle("dark",Q.value);return Q}import{onUnmounted as d9,ref as LJ,watch as OJ}from"@stacksjs/stx";function u9(J={}){let{attribute:$="class",initialValue:Q="auto",modes:G={},storageKey:Z="color-mode",selector:K}=J,q=LJ("light");if(typeof window<"u"&&window.matchMedia){let X=window.matchMedia("(prefers-color-scheme: dark)");q.value=X.matches?"dark":"light";let _=(Y)=>{q.value=Y.matches?"dark":"light"};X.addEventListener("change",_);try{d9(()=>{X.removeEventListener("change",_)})}catch{}}let z=Q;if(typeof localStorage<"u"){let X=localStorage.getItem(Z);if(X)z=X}let M=LJ(z),B=LJ(M.value==="auto"?q.value:M.value);function W(X){if(typeof document>"u")return;let _=K?document.querySelector(K):document.documentElement;if(!_)return;let Y=G[X]??X;if($==="class"){let H=["dark","light",...Object.keys(G),...Object.values(G)];for(let F of H)_.classList.remove(F);if(Y)_.classList.add(Y)}else _.setAttribute($,Y)}return OJ(M,(X)=>{if(typeof localStorage<"u")localStorage.setItem(Z,X);B.value=X==="auto"?q.value:X}),OJ(q,(X)=>{if(M.value==="auto")B.value=X}),OJ(B,(X)=>{W(X)}),W(B.value),{mode:B,system:q,store:M}}import{onUnmounted as c9,ref as l9}from"@stacksjs/stx";function i9(){let J=l9("no-preference");if(typeof window>"u"||!window.matchMedia)return J;let $=window.matchMedia("(prefers-color-scheme: dark)"),Q=window.matchMedia("(prefers-color-scheme: light)");function G(){if($.matches)J.value="dark";else if(Q.matches)J.value="light";else J.value="no-preference"}G(),$.addEventListener("change",G),Q.addEventListener("change",G);try{c9(()=>{$.removeEventListener("change",G),Q.removeEventListener("change",G)})}catch{}return J}import{onUnmounted as r9,ref as s9}from"@stacksjs/stx";function n9(){let J=s9("no-preference");if(typeof window>"u"||!window.matchMedia)return J;let $=window.matchMedia("(prefers-contrast: more)"),Q=window.matchMedia("(prefers-contrast: less)"),G=window.matchMedia("(prefers-contrast: custom)");function Z(){if($.matches)J.value="more";else if(Q.matches)J.value="less";else if(G.matches)J.value="custom";else J.value="no-preference"}Z(),$.addEventListener("change",Z),Q.addEventListener("change",Z),G.addEventListener("change",Z);try{r9(()=>{$.removeEventListener("change",Z),Q.removeEventListener("change",Z),G.removeEventListener("change",Z)})}catch{}return J}import{onUnmounted as o9,ref as a9}from"@stacksjs/stx";function t9(){let J=a9("no-preference");if(typeof window>"u"||!window.matchMedia)return J;let $=window.matchMedia("(prefers-reduced-motion: reduce)");function Q(){J.value=$.matches?"reduce":"no-preference"}Q(),$.addEventListener("change",Q);try{o9(()=>{$.removeEventListener("change",Q)})}catch{}return J}import{onUnmounted as e9,ref as J$}from"@stacksjs/stx";function $$(){let J=J$(typeof navigator<"u"?navigator.onLine:!0);if(typeof window<"u"){let $=()=>{J.value=!0},Q=()=>{J.value=!1};window.addEventListener("online",$),window.addEventListener("offline",Q);try{e9(()=>{window.removeEventListener("online",$),window.removeEventListener("offline",Q)})}catch{}}return J}import{onUnmounted as nJ,ref as g}from"@stacksjs/stx";function Q$(){let J=g(typeof navigator<"u"&&"connection"in navigator),$=g(typeof navigator<"u"?navigator.onLine:!0),Q=g(void 0),G=g(void 0),Z=g(void 0),K=g(void 0),q=g(void 0),z=g(void 0),M=g(void 0),B=g(void 0);function W(){if(!J.value)return;let X=navigator.connection;if(X)Z.value=X.downlink,K.value=X.downlinkMax,q.value=X.effectiveType,z.value=X.rtt,M.value=X.saveData,B.value=X.type}if(W(),typeof window<"u"){let X=()=>{$.value=!0,G.value=Date.now()},_=()=>{$.value=!1,Q.value=Date.now()};window.addEventListener("online",X),window.addEventListener("offline",_);try{nJ(()=>{window.removeEventListener("online",X),window.removeEventListener("offline",_)})}catch{}if(J.value){let Y=navigator.connection;if(Y?.addEventListener){Y.addEventListener("change",W);try{nJ(()=>{Y.removeEventListener("change",W)})}catch{}}}}return{isSupported:J,isOnline:$,offlineAt:Q,onlineAt:G,downlink:Z,downlinkMax:K,effectiveType:q,rtt:z,saveData:M,type:B}}import{ref as Z$}from"@stacksjs/stx";function G$(J=!1){let $=typeof J==="boolean"?Z$(J):J;function Q(G){if(typeof G==="boolean")$.value=G;else $.value=!$.value;return $.value}return[$,Q]}import{ref as AJ}from"@stacksjs/stx";function NJ(J){let $="GET",Q,G={get(){return $="GET",Q=void 0,G},post(Z){return $="POST",Q=Z,G},patch(Z){return $="PATCH",Q=Z,G},put(Z){return $="PUT",Q=Z,G},delete(){return $="DELETE",Q=void 0,G},json(){let Z=AJ(null),K=AJ(null),q=AJ(!0),z={method:$,headers:{Accept:"application/json"}};if(Q&&$!=="GET"&&$!=="DELETE")z.headers={...z.headers,"Content-Type":"application/json"},z.body=Q;let M={data:Z,error:K},B=fetch(J,z).then(async(W)=>{let X=await W.json();if(W.ok)Z.value=X;else K.value=X}).catch((W)=>{K.value=W}).finally(()=>{q.value=!1});return{data:Z,error:K,isFetching:q,then(W){return B.then(()=>W(M))}}}};return G}function K$(J={}){let{baseUrl:$=""}=J;return function(Q){let G=$?`${$.replace(/\/$/,"")}/${Q.replace(/^\//,"")}`:Q;return NJ(G)}}import{computed as q$,ref as z$}from"@stacksjs/stx";import{format as oJ}from"@stacksjs/datetime";function M$(J,$){if(typeof J==="object"&&J!==null&&"value"in J&&"subscribe"in J)return q$(()=>{let G=J.value;return oJ(G instanceof Date?G:new Date(G),$)});let Q=J instanceof Date?J:new Date(J);return z$(oJ(Q,$))}import{onUnmounted as B$,ref as X$}from"@stacksjs/stx";function W$(J){let $=J?.interval??1000,Q=X$(new Date),G=setInterval(()=>{Q.value=new Date},$);try{B$(()=>clearInterval(G))}catch{}return Q}import{onUnmounted as _$,ref as Y$}from"@stacksjs/stx";function H$(J={}){let{offset:$=0,interval:Q=1000,immediate:G=!0}=J,Z=Y$(Date.now()+$),K=null,q=null,z=!1;function M(){Z.value=Date.now()+$}function B(){if(K!==null)clearInterval(K),K=null;if(q!==null&&typeof cancelAnimationFrame<"u")cancelAnimationFrame(q),q=null;z=!1}function W(){if(z)return;if(z=!0,M(),Q==="requestAnimationFrame"){if(typeof requestAnimationFrame<"u"){let X=()=>{if(!z)return;M(),q=requestAnimationFrame(X)};q=requestAnimationFrame(X)}}else K=setInterval(M,Q)}if(G)W();try{_$(B)}catch{}return Z}import{onUnmounted as F$,ref as L$}from"@stacksjs/stx";var PJ=1000,DJ=60*PJ,CJ=60*DJ,e=24*CJ,aJ=7*e,tJ=30*e,eJ=365*e;function O$(J){let $=Math.abs(J);if($<5*PJ)return"just now";let Q=J<0,G,Z;if($<DJ)G=Math.floor($/PJ),Z="second";else if($<CJ)G=Math.floor($/DJ),Z="minute";else if($<e)G=Math.floor($/CJ),Z="hour";else if($<aJ)G=Math.floor($/e),Z="day";else if($<tJ)G=Math.floor($/aJ),Z="week";else if($<eJ)G=Math.floor($/tJ),Z="month";else G=Math.floor($/eJ),Z="year";let K=G!==1?"s":"";if(Q)return`in ${G} ${Z}${K}`;return`${G} ${Z}${K} ago`}function A$(J,$={}){let{updateInterval:Q=30000}=$;function G(){let z=T(J);if(z instanceof Date)return z.getTime();if(typeof z==="number")return z;return new Date(z).getTime()}function Z(){let z=Date.now(),M=G(),B=z-M;return O$(B)}let K=L$(Z()),q=setInterval(()=>{K.value=Z()},Q);try{F$(()=>clearInterval(q))}catch{}return K}import{onUnmounted as N$,watch as P$}from"@stacksjs/stx";function D$(J,$,Q,G){let Z=N,K=(z)=>{if(!z)return N;return z.addEventListener($,Q,G),()=>{z.removeEventListener($,Q,G)}};if(j(J))P$(J,(z,M)=>{Z(),Z=K(L(J))}),Z=K(J.value);else Z=K(J);let q=()=>{Z(),Z=N};try{N$(q)}catch{}return q}import{onUnmounted as C$}from"@stacksjs/stx";var EJ=new Map;function E$(J){if(!EJ.has(J))EJ.set(J,new Set);let $=EJ.get(J),Q=[];function G(M){return $.add(M),Q.push(M),()=>q(M)}function Z(M){let B=(W)=>{M(W),q(B)};return G(B)}function K(M){for(let B of $)B(M)}function q(M){$.delete(M);let B=Q.indexOf(M);if(B!==-1)Q.splice(B,1)}function z(){$.clear(),Q.length=0}try{C$(()=>{for(let M of Q)$.delete(M);Q.length=0})}catch{}return{on:G,once:Z,emit:K,off:q,reset:z}}function JJ(){let J=new Set;function $(Z){return J.add(Z),{off:()=>J.delete(Z)}}function Q(Z){J.delete(Z)}function G(Z){for(let K of J)K(Z)}return{on:$,off:Q,trigger:G}}function T$(J,$=200){let Q=null,G=function(...Z){if(Q!==null)clearTimeout(Q);Q=setTimeout(()=>{Q=null,J.apply(this,Z)},$)};return G.cancel=()=>{if(Q!==null)clearTimeout(Q),Q=null},G}function V$(J,$=200){let Q=0,G=null,Z=null,K=null,q=function(...z){let M=Date.now(),B=M-Q;if(B>=$){if(Q=M,G!==null)clearTimeout(G),G=null;J.apply(this,z)}else if(Z=z,K=this,G===null)G=setTimeout(()=>{if(Q=Date.now(),G=null,Z!==null)J.apply(K,Z),Z=null,K=null},$-B)};return q.cancel=()=>{if(G!==null)clearTimeout(G),G=null;Z=null,K=null},q}import{ref as J9,watch as j$}from"@stacksjs/stx";function TJ(J,$=200){let Q=J9(J),G=J9(J),Z=null;return j$(Q,(K)=>{if(Z!==null)clearTimeout(Z);Z=setTimeout(()=>{G.value=K,Z=null},$)}),{get value(){return G.value},set value(K){Q.value=K},subscribe:G.subscribe}}import{ref as $9,watch as U$}from"@stacksjs/stx";function VJ(J,$=200){let Q=$9(J),G=$9(J),Z=0,K=null;return U$(Q,(q)=>{let z=Date.now(),M=z-Z;if(M>=$){if(Z=z,G.value=q,K!==null)clearTimeout(K),K=null}else if(K===null)K=setTimeout(()=>{Z=Date.now(),G.value=Q.value,K=null},$-M)}),{get value(){return G.value},set value(q){Q.value=q},subscribe:G.subscribe}}import{ref as R$,watch as I$}from"@stacksjs/stx";function b$(J,$=200){let Q=R$(L(J)),G=null;if(j(J))I$(J,(Z)=>{if(G!==null)clearTimeout(G);G=setTimeout(()=>{Q.value=Z,G=null},$)});return Q}import{ref as S$,watch as x$}from"@stacksjs/stx";function y$(J,$=200){let Q=S$(L(J)),G=0,Z=null;if(j(J))x$(J,(K)=>{let q=Date.now(),z=q-G;if(z>=$)Q.value=K,G=q;else{if(Z!==null)clearTimeout(Z);Z=setTimeout(()=>{Q.value=J.value,G=Date.now(),Z=null},$-z)}});return Q}import{onUnmounted as w$,ref as k$}from"@stacksjs/stx";function g$(J=1000,$={}){let{controls:Q=!1,immediate:G=!0}=$,Z=k$(0),K=null;function q(){if(K!==null)clearInterval(K),K=null}function z(){if(K!==null)return;K=setInterval(()=>{Z.value++},J)}function M(){if(Z.value=0,q(),G)z()}if(G)z();try{w$(q)}catch{}if(Q)return{counter:Z,pause:q,resume:z,reset:M};return Z}import{onUnmounted as h$,ref as v$}from"@stacksjs/stx";function f$(J,$=1000,Q={}){let{immediate:G=!0}=Q,Z=v$(!1),K=null;function q(){if(K!==null)clearInterval(K),K=null;Z.value=!1}function z(){if(K!==null)return;Z.value=!0,K=setInterval(J,$)}if(G)z();try{h$(q)}catch{}return{pause:q,resume:z,isActive:Z}}import{onUnmounted as m$,ref as p$}from"@stacksjs/stx";function d$(J=1000,$={}){let{controls:Q=!1,immediate:G=!0}=$,Z=p$(!1),K=null;function q(){if(K!==null)clearTimeout(K),K=null;Z.value=!1}function z(){q(),K=setTimeout(()=>{Z.value=!0,K=null},J)}if(G)z();try{m$(()=>{if(K!==null)clearTimeout(K),K=null})}catch{}if(Q)return{ready:Z,start:z,stop:q};return Z}import{onUnmounted as u$,ref as c$}from"@stacksjs/stx";function l$(J,$=1000,Q={}){let{immediate:G=!0}=Q,Z=c$(!1),K=null;function q(){if(K!==null)clearTimeout(K),K=null;Z.value=!1}function z(){q(),Z.value=!0,K=setTimeout(()=>{K=null,Z.value=!1,J()},$)}if(G)z();try{u$(q)}catch{}return{start:z,stop:q,isPending:Z}}import{onUnmounted as i$,ref as r$}from"@stacksjs/stx";function s$(J,$,Q){let{immediate:G=!0}=Q??{},Z=r$(!1),K=null;async function q(){if(!Z.value)return;try{await J()}catch{}if(Z.value)K=setTimeout(q,$)}function z(){if(Z.value)return;Z.value=!0,q()}function M(){if(Z.value=!1,K!==null)clearTimeout(K),K=null}if(G)z();try{i$(()=>M())}catch{}return{isActive:Z,pause:M,resume:z}}import{onUnmounted as n$,ref as o$}from"@stacksjs/stx";function a$(J,$={}){let{immediate:Q=!0}=$,G=o$(!1),Z=null,K=0;function q(B){if(!G.value)return;let W=K?B-K:0;K=B,J({delta:W,timestamp:B}),Z=requestAnimationFrame(q)}function z(){if(G.value)return;if(typeof requestAnimationFrame>"u")return;G.value=!0,K=0,Z=requestAnimationFrame(q)}function M(){if(!G.value)return;if(G.value=!1,Z!==null&&typeof cancelAnimationFrame<"u")cancelAnimationFrame(Z),Z=null}if(Q)z();try{n$(M)}catch{}return{pause:M,resume:z,isActive:G}}import{onUnmounted as t$,ref as e$}from"@stacksjs/stx";function J4(J=10){let $=e$(0);if(typeof requestAnimationFrame>"u")return $;let Q=performance.now(),G=0,Z;function K(){if(G++,G>=J){let q=performance.now(),z=q-Q;$.value=Math.round(G/z*1000),Q=q,G=0}Z=requestAnimationFrame(K)}Z=requestAnimationFrame(K);try{t$(()=>cancelAnimationFrame(Z))}catch{}return $}import{ref as jJ}from"@stacksjs/stx";function $4(J){let{source:$,copiedDuring:Q=1500}=J??{},G=FJ(),Z=jJ(!!G&&"clipboard"in G),K=jJ(""),q=jJ(!1),z;async function M(B){if(!Z.value)return;let W=B??($!==void 0?T($):void 0);if(W===void 0)return;try{if(await G.clipboard.writeText(W),K.value=W,q.value=!0,z)clearTimeout(z);z=setTimeout(()=>{q.value=!1},Q)}catch{}}return{text:K,isSupported:Z,copied:q,copy:M}}import{ref as Q9}from"@stacksjs/stx";function Q4(){let J=Q9(typeof navigator<"u"&&"clipboard"in navigator&&typeof ClipboardItem<"u"),$=Q9([]);async function Q(Z){if(J.value)await navigator.clipboard.write(Z),$.value=Z}async function G(){if(J.value)$.value=await navigator.clipboard.read()}return{isSupported:J,content:$,copy:Q,read:G}}import{onUnmounted as Z4,ref as G4}from"@stacksjs/stx";function K4(J){let $=U(),Q=G4(!1);if(!$||!$.matchMedia)return Q;let G=T(J),Z=$.matchMedia(G);Q.value=Z.matches;let K=(q)=>{Q.value=q.matches};Z.addEventListener("change",K);try{Z4(()=>{Z.removeEventListener("change",K)})}catch{}return Q}import{computed as s,ref as q4,onUnmounted as z4}from"@stacksjs/stx";function M4(J){let $=U(),Q=q4($?$.innerWidth:0);function G(){if($)Q.value=$.innerWidth}if($){$.addEventListener("resize",G);try{z4(()=>{$.removeEventListener("resize",G)})}catch{}}function Z(X){return J[X]}function K(X){return s(()=>Q.value>=Z(X))}function q(X){return s(()=>Q.value<=Z(X))}function z(X,_){return s(()=>Q.value>=Z(X)&&Q.value<Z(_))}function M(X){return s(()=>Q.value>Z(X))}function B(X){return s(()=>Q.value<Z(X))}function W(){return s(()=>{return Object.keys(J).sort((_,Y)=>J[_]-J[Y]).filter((_)=>Q.value>=J[_])})}return{greaterOrEqual:K,smallerOrEqual:q,between:z,isGreater:M,isSmaller:B,current:W}}var B4={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},Z9={sm:576,md:768,lg:992,xl:1200,xxl:1400},X4=Z9,W4={xs:480,sm:576,md:768,lg:992,xl:1200,xxl:1600},_4={xs:600,sm:960,md:1264,lg:1904},Y4={xs:600,sm:1024,md:1440,lg:1920},H4={"3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560},F4={mobileS:320,mobileM:375,mobileL:425,tablet:768,laptop:1024,laptopL:1440,desktop:2560};import{ref as L4,watch as O4}from"@stacksjs/stx";function A4(J){let $=a(),Q=J!==void 0?T(J):$?.title??"",G=L4(Q);if($&&J!==void 0)$.title=G.value;return O4(G,(Z)=>{if($)$.title=Z}),G}import{ref as N4,watch as P4}from"@stacksjs/stx";function D4(J){let $=N4(T(J??null));function Q(G){if(typeof document>"u"||!G)return;let Z=document.querySelector('link[rel*="icon"]');if(!Z)Z=document.createElement("link"),Z.rel="icon",Z.type="image/x-icon",document.head.appendChild(Z);Z.href=G}return P4($,(G)=>{Q(G)}),Q($.value),$}import{onUnmounted as C4,ref as E4}from"@stacksjs/stx";function T4(){let J=E4(typeof document<"u"?document.visibilityState:"visible");if(typeof document>"u")return J;let $=()=>{J.value=document.visibilityState};document.addEventListener("visibilitychange",$,{passive:!0});try{C4(()=>{document.removeEventListener("visibilitychange",$)})}catch{}return J}import{ref as V4,watch as j4}from"@stacksjs/stx";function U4(J,$){let Q=J??(typeof document<"u"?document.documentElement:null),G=$??"ltr";if(Q){let K=Q.getAttribute("dir");if(K==="rtl"||K==="ltr"||K==="auto")G=K}let Z=V4(G);return j4(Z,(K)=>{if(Q)Q.setAttribute("dir",K)}),Z}import{onUnmounted as R4,ref as UJ}from"@stacksjs/stx";function I4(){let J=UJ(""),$=UJ([]),Q=UJ(null);if(typeof document>"u")return{text:J,ranges:$,selection:Q};let G=()=>{let Z=document.getSelection();if(Q.value=Z,Z&&Z.rangeCount>0){J.value=Z.toString();let K=[];for(let q=0;q<Z.rangeCount;q++)K.push(Z.getRangeAt(q));$.value=K}else J.value="",$.value=[]};document.addEventListener("selectionchange",G,{passive:!0});try{R4(()=>{document.removeEventListener("selectionchange",G)})}catch{}return{text:J,ranges:$,selection:Q}}import{onUnmounted as b4,ref as S4}from"@stacksjs/stx";function x4(J="history",$){let Q=U(),{initialValue:G}=$??{};function Z(){if(!Q)return{...G};let W="";if(J==="hash"){let Y=Q.location.hash,H=Y.indexOf("?");W=H>=0?Y.slice(H+1):""}else W=Q.location.search.slice(1);let X={...G};return new URLSearchParams(W).forEach((Y,H)=>{X[H]=Y}),X}let K=S4(Z());function q(){if(!Q)return;let W=new URLSearchParams;for(let[_,Y]of Object.entries(K.value))if(Y!==void 0&&Y!==null&&Y!=="")W.set(_,Y);let X=W.toString();if(J==="hash"){let _=Q.location.hash.split("?")[0]||"#";Q.location.hash=X?`${_}?${X}`:_}else{let _=X?`${Q.location.pathname}?${X}`:Q.location.pathname;Q.history.replaceState(Q.history.state,"",_)}}function z(W){return K.value[W]??null}function M(W,X){let _={...K.value};_[W]=X,K.value=_,q()}function B(W){let X={...K.value};delete X[W],K.value=X,q()}if(Q){let W=()=>{K.value=Z()},X=()=>{if(J==="hash")K.value=Z()};Q.addEventListener("popstate",W),Q.addEventListener("hashchange",X),b4(()=>{Q.removeEventListener("popstate",W),Q.removeEventListener("hashchange",X)})}return{params:K,get:z,set:M,delete:B}}import{onUnmounted as y4,ref as f}from"@stacksjs/stx";function w4(){let J=U();function $(){if(!J)return{href:"",protocol:"",host:"",hostname:"",port:"",pathname:"",search:"",hash:"",origin:""};return{href:J.location.href,protocol:J.location.protocol,host:J.location.host,hostname:J.location.hostname,port:J.location.port,pathname:J.location.pathname,search:J.location.search,hash:J.location.hash,origin:J.location.origin}}let Q=$(),G=f(Q.href),Z=f(Q.protocol),K=f(Q.host),q=f(Q.hostname),z=f(Q.port),M=f(Q.pathname),B=f(Q.search),W=f(Q.hash),X=f(Q.origin);function _(){let Y=$();G.value=Y.href,Z.value=Y.protocol,K.value=Y.host,q.value=Y.hostname,z.value=Y.port,M.value=Y.pathname,B.value=Y.search,W.value=Y.hash,X.value=Y.origin}if(J){J.addEventListener("popstate",_),J.addEventListener("hashchange",_);try{y4(()=>{J.removeEventListener("popstate",_),J.removeEventListener("hashchange",_)})}catch{}}return{href:G,protocol:Z,host:K,hostname:q,port:z,pathname:M,search:B,hash:W,origin:X}}import{onUnmounted as k4,ref as G9}from"@stacksjs/stx";function g4(J){let{initialWidth:$=0,initialHeight:Q=0,listenOrientation:G=!0}=J??{},Z=U(),K=G9(Z?Z.innerWidth:$),q=G9(Z?Z.innerHeight:Q);function z(){if(Z)K.value=Z.innerWidth,q.value=Z.innerHeight}if(Z){if(Z.addEventListener("resize",z),G)Z.addEventListener("orientationchange",z);try{k4(()=>{if(Z.removeEventListener("resize",z),G)Z.removeEventListener("orientationchange",z)})}catch{}}return{width:K,height:q}}import{onUnmounted as h4,ref as v4}from"@stacksjs/stx";function f4(){let J=v4(typeof document<"u"?document.hasFocus():!1);if(typeof window>"u")return J;let $=()=>{J.value=!0},Q=()=>{J.value=!1};window.addEventListener("focus",$,{passive:!0}),window.addEventListener("blur",Q,{passive:!0});try{h4(()=>{window.removeEventListener("focus",$),window.removeEventListener("blur",Q)})}catch{}return J}import{onUnmounted as m4,ref as K9}from"@stacksjs/stx";function p4(){let J=K9(typeof window<"u"?window.scrollX:0),$=K9(typeof window<"u"?window.scrollY:0);if(typeof window>"u")return{x:J,y:$};let Q=()=>{J.value=window.scrollX,$.value=window.scrollY};window.addEventListener("scroll",Q,{passive:!0});try{m4(()=>{window.removeEventListener("scroll",Q)})}catch{}return{x:J,y:$}}import{onUnmounted as d4,ref as x}from"@stacksjs/stx";function u4(J,$){let{throttle:Q=0,offset:G={}}=$??{},Z=G.top??0,K=G.bottom??0,q=G.left??0,z=G.right??0,M=x(0),B=x(0),W=x(!1),X=x(!0),_=x(!1),Y=x(!0),H=x(!1),F=x(!1),O=x(!1),P=x(!1),C=x(!1),E,b=0,u=0,c,l=!1;function r(D){if(typeof window<"u"&&D===window||"innerHeight"in D&&"scrollX"in D){let I=D,lJ=typeof document<"u"?document:void 0;return{scrollLeft:I.scrollX??I.pageXOffset??0,scrollTop:I.scrollY??I.pageYOffset??0,scrollHeight:lJ?.documentElement?.scrollHeight??0,scrollWidth:lJ?.documentElement?.scrollWidth??0,clientHeight:I.innerHeight,clientWidth:I.innerWidth}}if(typeof document<"u"&&D===document||"documentElement"in D){let I=D.documentElement;return{scrollLeft:I.scrollLeft,scrollTop:I.scrollTop,scrollHeight:I.scrollHeight,scrollWidth:I.scrollWidth,clientHeight:I.clientHeight,clientWidth:I.clientWidth}}let A=D;return{scrollLeft:A.scrollLeft,scrollTop:A.scrollTop,scrollHeight:A.scrollHeight,scrollWidth:A.scrollWidth,clientHeight:A.clientHeight,clientWidth:A.clientWidth}}function BJ(){let D=J?L(J):typeof window<"u"?window:null;if(!D)return;let A=r(D);if(F.value=A.scrollTop<u,O.value=A.scrollTop>u,P.value=A.scrollLeft<b,C.value=A.scrollLeft>b,b=A.scrollLeft,u=A.scrollTop,M.value=A.scrollLeft,B.value=A.scrollTop,X.value=A.scrollTop<=Z,Y.value=A.scrollLeft<=q,_.value=A.scrollTop+A.clientHeight>=A.scrollHeight-K,H.value=A.scrollLeft+A.clientWidth>=A.scrollWidth-z,W.value=!0,E)clearTimeout(E);E=setTimeout(()=>{W.value=!1},150)}function S(){if(Q>0){if(!l)BJ(),l=!0,c=setTimeout(()=>{l=!1},Q)}else BJ()}if(typeof window<"u"){let D=J?L(J):window;if(D){let A=r(D);M.value=A.scrollLeft,B.value=A.scrollTop,b=A.scrollLeft,u=A.scrollTop,X.value=A.scrollTop<=Z,Y.value=A.scrollLeft<=q,_.value=A.scrollTop+A.clientHeight>=A.scrollHeight-K,H.value=A.scrollLeft+A.clientWidth>=A.scrollWidth-z,D.addEventListener("scroll",S,{passive:!0});try{d4(()=>{if(D.removeEventListener("scroll",S),E)clearTimeout(E);if(c)clearTimeout(c)})}catch{}}}return{x:M,y:B,isScrolling:W,arrivedState:{top:X,bottom:_,left:Y,right:H},directions:{top:F,bottom:O,left:P,right:C}}}import{onUnmounted as c4,ref as l4,watch as i4}from"@stacksjs/stx";function r4(J){let $=l4(!1),Q="";function G(){if(J)return L(J);if(typeof document<"u")return document.body;return null}function Z(){let q=G();if(!q)return;Q=q.style.overflow,q.style.overflow="hidden"}function K(){let q=G();if(!q)return;q.style.overflow=Q}i4($,(q)=>{if(q)Z();else K()});try{c4(()=>{if($.value)K()})}catch{}return $}import{onUnmounted as s4,ref as n4}from"@stacksjs/stx";function o4(J,$,Q={}){let{distance:G=100,direction:Z="bottom"}=Q,K=n4(!1),q=!0,z=async()=>{if(!q||K.value)return;let B=L(J);if(!B)return;let W=!1;if(B===window||B===document.documentElement){let X=window.scrollY||document.documentElement.scrollTop,_=document.documentElement.scrollHeight,Y=window.innerHeight;if(Z==="bottom")W=_-X-Y<=G;else if(Z==="top")W=X<=G}else{let X=B;if(Z==="bottom")W=X.scrollHeight-X.scrollTop-X.clientHeight<=G;else if(Z==="top")W=X.scrollTop<=G;else if(Z==="right")W=X.scrollWidth-X.scrollLeft-X.clientWidth<=G;else if(Z==="left")W=X.scrollLeft<=G}if(W){K.value=!0;try{await $()}finally{K.value=!1}}},M=L(J);if(M){let B=M===document.documentElement?window:M;B.addEventListener("scroll",z,{passive:!0});try{s4(()=>{q=!1,B.removeEventListener("scroll",z)})}catch{}}return{isLoading:K}}import{onUnmounted as a4,ref as q9}from"@stacksjs/stx";function t4(J){let $=a(),Q=q9(!1),G=q9(!!$&&(("fullscreenEnabled"in $)||("webkitFullscreenEnabled"in $)));function Z(){if(J)return L(J);return $?.documentElement??null}function K(){if(!$)return null;return $.fullscreenElement??$.webkitFullscreenElement??null}function q(){Q.value=K()!==null}async function z(){if(!G.value)return;let W=Z();if(!W)return;try{if(W.requestFullscreen)await W.requestFullscreen();else if(W.webkitRequestFullscreen)await W.webkitRequestFullscreen();Q.value=!0}catch{}}async function M(){if(!G.value||!$)return;try{if($.exitFullscreen)await $.exitFullscreen();else if($.webkitExitFullscreen)await $.webkitExitFullscreen();Q.value=!1}catch{}}async function B(){if(Q.value)await M();else await z()}if($){let W=()=>q();$.addEventListener("fullscreenchange",W),$.addEventListener("webkitfullscreenchange",W);try{a4(()=>{$.removeEventListener("fullscreenchange",W),$.removeEventListener("webkitfullscreenchange",W)})}catch{}}return{isFullscreen:Q,isSupported:G,enter:z,exit:M,toggle:B}}function e4(J,$,Q){let G=U();if(!G)return()=>{};let{ignore:Z=[]}=Q??{};function K(z){let M=L(J);if(!M)return;let B=z,W=B.composedPath?.()??[];if(M===B.target||W.includes(M)||M.contains(B.target))return;for(let X of Z){let _=L(X);if(_&&(_===B.target||W.includes(_)||_.contains(B.target)))return}$(B)}return G.addEventListener("pointerdown",K,{passive:!0}),()=>{G.removeEventListener("pointerdown",K)}}function RJ(J,$,Q){let{eventName:G="keydown",target:Z}=Q??{},K=U(),q=Z?L(Z):K;if(!q)return()=>{};function z(X){if(typeof X==="function")return X;if(typeof X==="string")return(_)=>_.key===X;if(Array.isArray(X))return(_)=>X.includes(_.key);return()=>!0}let M=z(J);function B(X){let _=X;if(M(_))$(_)}return q.addEventListener(G,B),()=>{q.removeEventListener(G,B)}}function J6(J,$,Q){return RJ(J,$,{...Q,eventName:"keydown"})}function $6(J,$,Q){return RJ(J,$,{...Q,eventName:"keyup"})}import{onUnmounted as Q6}from"@stacksjs/stx";function Z6(J,$,Q={}){let{delay:G=500,distanceThreshold:Z=10}=Q,K=null,q=0,z=0,M=L(J);if(!M)return()=>{};let B=()=>{if(K!==null)clearTimeout(K),K=null},W=(H)=>{q=H.clientX,z=H.clientY,B(),K=setTimeout(()=>$(H),G)},X=(H)=>{if(K===null)return;let F=Math.abs(H.clientX-q),O=Math.abs(H.clientY-z);if(F>Z||O>Z)B()},_=()=>{B()};M.addEventListener("pointerdown",W),M.addEventListener("pointermove",X),M.addEventListener("pointerup",_),M.addEventListener("pointercancel",_);let Y=()=>{B(),M.removeEventListener("pointerdown",W),M.removeEventListener("pointermove",X),M.removeEventListener("pointerup",_),M.removeEventListener("pointercancel",_)};try{Q6(Y)}catch{}return Y}import{onUnmounted as G6}from"@stacksjs/stx";function K6(J){if(typeof document>"u")return()=>{};let $=(G)=>{let Z=document.activeElement;if(Z){let K=Z.tagName.toLowerCase();if(K==="input"||K==="textarea"||Z.isContentEditable)return}if(G.key.length===1&&!G.ctrlKey&&!G.metaKey&&!G.altKey)J(G)};document.addEventListener("keydown",$);let Q=()=>{document.removeEventListener("keydown",$)};try{G6(Q)}catch{}return Q}import{onUnmounted as q6,ref as z6}from"@stacksjs/stx";function M6(J){let $=z6(!1);if(typeof window>"u")return $;let Q=(G)=>{$.value=G.getModifierState(J)};window.addEventListener("keydown",Q,{passive:!0}),window.addEventListener("keyup",Q,{passive:!0}),window.addEventListener("mousedown",Q,{passive:!0}),window.addEventListener("mouseup",Q,{passive:!0});try{q6(()=>{window.removeEventListener("keydown",Q),window.removeEventListener("keyup",Q),window.removeEventListener("mousedown",Q),window.removeEventListener("mouseup",Q)})}catch{}return $}import{onUnmounted as B6,ref as z9}from"@stacksjs/stx";function X6(){let J=z9(new Set),$=new Map;function Q(Z){let K=Z.toLowerCase();if(!$.has(K))$.set(K,z9(!1));return $.get(K)}function G(){for(let[Z,K]of $)if(Z.includes("+")){let q=Z.split("+").map((z)=>z.trim().toLowerCase());K.value=q.every((z)=>J.value.has(z))}}if(typeof window<"u"){let Z=(q)=>{let z=q.key.toLowerCase();J.value.add(z),J.value=new Set(J.value);let M=Q(z);if(M.value=!0,q.ctrlKey)Q("ctrl").value=!0,J.value.add("ctrl");if(q.shiftKey)Q("shift").value=!0,J.value.add("shift");if(q.altKey)Q("alt").value=!0,J.value.add("alt");if(q.metaKey)Q("meta").value=!0,J.value.add("meta");G()},K=(q)=>{let z=q.key.toLowerCase();J.value.delete(z),J.value=new Set(J.value);let M=Q(z);if(M.value=!1,!q.ctrlKey)Q("ctrl").value=!1,J.value.delete("ctrl");if(!q.shiftKey)Q("shift").value=!1,J.value.delete("shift");if(!q.altKey)Q("alt").value=!1,J.value.delete("alt");if(!q.metaKey)Q("meta").value=!1,J.value.delete("meta");G()};window.addEventListener("keydown",Z,{passive:!0}),window.addEventListener("keyup",K,{passive:!0});try{B6(()=>{window.removeEventListener("keydown",Z),window.removeEventListener("keyup",K)})}catch{}}return new Proxy({current:J},{get(Z,K){if(K==="current")return J;return Q(K)}})}import{computed as R}from"@stacksjs/stx";function V(J){if(J&&typeof J==="object"&&"value"in J&&"subscribe"in J)return J.value;return J}function W6(J){return R(()=>Math.abs(V(J)))}function _6(...J){return R(()=>{let $=J.map(V);return $.length?$.reduce((Q,G)=>Q+G,0)/$.length:0})}function Y6(J){return R(()=>Math.ceil(V(J)))}function H6(J,$,Q){return R(()=>Math.min(V(Q),Math.max(V($),V(J))))}function F6(J){return R(()=>Math.floor(V(J)))}function L6(...J){return R(()=>Math.max(...J.map(V)))}function O6(...J){return R(()=>Math.min(...J.map(V)))}function A6(J,$=0){return R(()=>Number(V(J).toFixed(Math.max(0,Math.min(100,V($))))))}function N6(J){return R(()=>Math.round(V(J)))}function P6(...J){return R(()=>J.map(V).reduce(($,Q)=>$+Q,0))}function D6(J){return R(()=>Math.trunc(V(J)))}function C6(J){return R(()=>!V(J))}function M9(...J){return R(()=>J.some(($)=>V($)))}var E6=M9;function T6(...J){return R(()=>J.every(($)=>V($)))}import{ref as V6}from"@stacksjs/stx";function j6(J=0,$={}){let{min:Q=-1/0,max:G=1/0}=$;function Z(X){return Math.min(G,Math.max(Q,X))}let K=V6(Z(J));function q(X=1){return K.value=Z(K.value+X),K.value}function z(X=1){return K.value=Z(K.value-X),K.value}function M(X){return K.value=Z(X),K.value}function B(X=J){return K.value=Z(X),K.value}function W(){return K.value}return{count:K,inc:q,dec:z,set:M,reset:B,get:W}}import{ref as U6,watch as R6}from"@stacksjs/stx";function I6(J,$){let Q=U6($);return R6(J,(G,Z)=>{Q.value=Z}),Q}import{ref as b6,watch as S6}from"@stacksjs/stx";function x6(J,$={}){let{initialValue:Q=null}=$,G=b6(Q);return S6(J,()=>{G.value=Date.now()}),G}import{computed as IJ,ref as B9}from"@stacksjs/stx";function y6(J,$){let Q=B9([...J]),G=$!==void 0?J.indexOf($):0,Z=B9(G>=0?G:0),K=IJ(()=>Q.value[Z.value]),q=IJ(()=>Z.value===0),z=IJ(()=>Z.value===Q.value.length-1);function M(){if(Z.value<Q.value.length-1)Z.value++}function B(){if(Z.value>0)Z.value--}function W(F){let O=Q.value.indexOf(F);if(O>=0)Z.value=O}function X(F){if(F>=0&&F<Q.value.length)Z.value=F}function _(F){let O=Q.value.indexOf(F);return O>=0&&Z.value<O}function Y(F){let O=Q.value.indexOf(F);return O>=0&&Z.value>O}function H(F){return Q.value[Z.value]===F}return{steps:Q,current:K,index:Z,isFirst:q,isLast:z,next:M,previous:B,goTo:W,goToIndex:X,isBefore:_,isAfter:Y,isCurrent:H}}import{computed as w6,ref as k6}from"@stacksjs/stx";function g6(J,$={}){let Q=J.length;if(Q===0)throw Error("useCycleList requires a non-empty list");let G=$.initialValue!==void 0?J.indexOf($.initialValue):0,Z=k6(G>=0?G:0);function K(X){return J[X]}let q=w6(()=>K(Z.value));function z(X){return(X%Q+Q)%Q}function M(X=1){return Z.value=z(Z.value+X),K(Z.value)}function B(X=1){return Z.value=z(Z.value-X),K(Z.value)}function W(X){return Z.value=z(X),K(Z.value)}return{state:q,index:Z,next:M,prev:B,go:W}}import{computed as h6}from"@stacksjs/stx";function v6(J,$){return h6(()=>{let Q=[...L(J)];if($)return Q.sort($);return Q.sort()})}import{ref as f6,watch as m6}from"@stacksjs/stx";function p6(J){if(typeof structuredClone==="function")return structuredClone(J);return JSON.parse(JSON.stringify(J))}function d6(J,$={}){let Q=$.clone??p6,G=f6(Q(J.value));function Z(){G.value=Q(J.value)}return m6(J,()=>{Z()}),{cloned:G,sync:Z}}import{computed as bJ,ref as X9}from"@stacksjs/stx";function $J(J,$){if(!$)return J;if(typeof structuredClone==="function")return structuredClone(J);return JSON.parse(JSON.stringify(J))}function QJ(J,$={}){let{capacity:Q=1/0,clone:G=!1}=$,Z=X9([{snapshot:$J(J.value,G),timestamp:Date.now()}]),K=X9([]),q=bJ(()=>Z.value.length>1),z=bJ(()=>K.value.length>0),M=bJ(()=>{return Z.value[Z.value.length-1]});function B(){let Y={snapshot:$J(J.value,G),timestamp:Date.now()};if(Z.value=[...Z.value,Y],Q!==1/0&&Z.value.length>Q)Z.value=Z.value.slice(Z.value.length-Q);K.value=[]}function W(){if(Z.value.length<=1)return;let Y=Z.value[Z.value.length-1],H=Z.value.slice(0,-1);if(Z.value=H,Y)K.value=[...K.value,Y];let F=H[H.length-1];if(!F)return;J.value=$J(F.snapshot,G)}function X(){if(K.value.length===0)return;let Y=K.value[K.value.length-1];if(K.value=K.value.slice(0,-1),Y)Z.value=[...Z.value,Y];if(!Y)return;J.value=$J(Y.snapshot,G)}function _(){Z.value=[{snapshot:$J(J.value,G),timestamp:Date.now()}],K.value=[]}return{history:Z,commit:B,undo:W,redo:X,canUndo:q,canRedo:z,clear:_,last:M}}import{computed as SJ,ref as W9,watch as u6}from"@stacksjs/stx";function ZJ(J,$){if(!$)return J;if(typeof structuredClone==="function")return structuredClone(J);return JSON.parse(JSON.stringify(J))}function c6(J,$={}){let{capacity:Q=1/0,deep:G=!1,clone:Z=!1}=$,K=W9([{snapshot:ZJ(J.value,Z),timestamp:Date.now()}]),q=W9([]),z=!1,M=SJ(()=>K.value.length>1),B=SJ(()=>q.value.length>0),W=SJ(()=>{return K.value[K.value.length-1]});function X(){let F={snapshot:ZJ(J.value,Z),timestamp:Date.now()};if(K.value=[...K.value,F],Q!==1/0&&K.value.length>Q)K.value=K.value.slice(K.value.length-Q);q.value=[]}function _(){if(K.value.length<=1)return;z=!0;let F=K.value[K.value.length-1],O=K.value.slice(0,-1);if(K.value=O,F)q.value=[...q.value,F];let P=O[O.length-1];if(P)J.value=ZJ(P.snapshot,Z);z=!1}function Y(){if(q.value.length===0)return;z=!0;let F=q.value[q.value.length-1];if(q.value=q.value.slice(0,-1),F)K.value=[...K.value,F],J.value=ZJ(F.snapshot,Z);z=!1}function H(){K.value=[{snapshot:ZJ(J.value,Z),timestamp:Date.now()}],q.value=[]}return u6(J,()=>{if(!z)X()},{deep:G}),{history:K,commit:X,undo:_,redo:Y,canUndo:M,canRedo:B,clear:H,last:W}}import{watch as l6}from"@stacksjs/stx";function i6(J,$){let Q=$?.debounce??200,{history:G,commit:Z,undo:K,redo:q,canUndo:z,canRedo:M,clear:B,last:W}=QJ(J,$),X=null,_=!1;l6(J,()=>{if(_){_=!1;return}if(X!==null)clearTimeout(X);X=setTimeout(()=>{X=null,Z()},Q)});let Y=K,H=q;function F(){if(X!==null)clearTimeout(X),X=null;_=!0,Y()}function O(){if(X!==null)clearTimeout(X),X=null;_=!0,H()}return{history:G,commit:Z,undo:F,redo:O,canUndo:z,canRedo:M,clear:B,last:W}}import{watch as r6}from"@stacksjs/stx";function s6(J,$){let Q=$?.throttle??200,{history:G,commit:Z,undo:K,redo:q,canUndo:z,canRedo:M,clear:B,last:W}=QJ(J,$),X=0,_=null,Y=!1;r6(J,()=>{if(Y){Y=!1;return}let C=Date.now();if(C-X>=Q)X=C,Z();else{if(_!==null)clearTimeout(_);_=setTimeout(()=>{_=null,X=Date.now(),Z()},Q-(C-X))}});let H=K,F=q;function O(){if(_!==null)clearTimeout(_),_=null;Y=!0,H()}function P(){if(_!==null)clearTimeout(_),_=null;Y=!0,F()}return{history:G,commit:Z,undo:O,redo:P,canUndo:z,canRedo:M,clear:B,last:W}}import{ref as XJ}from"@stacksjs/stx";function n6(J,$,Q={}){let{immediate:G=!0,onError:Z,resetOnExecute:K=!0,delay:q=0}=Q,z=XJ($),M=XJ(!1),B=XJ(!1),W=XJ(void 0);async function X(_){let Y=_??q;if(K)z.value=$;if(W.value=void 0,M.value=!1,B.value=!0,Y>0)await new Promise((H)=>setTimeout(H,Y));try{let H=typeof J==="function"?await J():await J;return z.value=H,M.value=!0,H}catch(H){if(W.value=H,Z)Z(H);return z.value}finally{B.value=!1}}if(G)X();return{state:z,isReady:M,isLoading:B,error:W,execute:X}}import{ref as xJ}from"@stacksjs/stx";function o6(J){let $=xJ(-1),Q=xJ(!1),G=xJ(J.map(()=>({state:"pending"})));async function Z(){for(let K=0;K<J.length;K++){$.value=K;let q=J[K];if(!q)continue;try{let z=await q();G.value=G.value.map((M,B)=>B===K?{state:"fulfilled",data:z}:M)}catch(z){G.value=G.value.map((M,B)=>B===K?{state:"rejected",data:z}:M)}}$.value=J.length,Q.value=!0}return Z(),{activeIndex:$,result:G,isFinished:Q}}import{watch as a6}from"@stacksjs/stx";function t6(J,$){return a6(J,(G)=>{if(G)$(G)})}import{watch as e6}from"@stacksjs/stx";function J8(J,$){let Q=!1,G=e6(J,(Z)=>{if(Q)return;Q=!0,G(),$(Z)});return()=>{if(!Q)Q=!0,G()}}import{watch as $8}from"@stacksjs/stx";function _9(J,$,Q){let G=Q?.debounce??200,Z=null,K=$8(J,(q)=>{if(Z!==null)clearTimeout(Z);Z=setTimeout(()=>{Z=null,$(q)},G)});return()=>{if(Z!==null)clearTimeout(Z),Z=null;K()}}import{watch as Q8}from"@stacksjs/stx";function Y9(J,$,Q){let G=Q?.throttle??200,Z=0,K=null,q,z=!1,M=Q8(J,(B)=>{let W=Date.now(),X=W-Z;if(X>=G){if(Z=W,K!==null)clearTimeout(K),K=null;z=!1,$(B)}else if(q=B,z=!0,K===null)K=setTimeout(()=>{if(Z=Date.now(),K=null,z)z=!1,$(q)},G-X)});return()=>{if(K!==null)clearTimeout(K),K=null;z=!1,M()}}import{ref as Z8,watch as G8}from"@stacksjs/stx";function H9(J,$){let Q=Z8(!0),G,Z=G8(J,(z)=>{if(Q.value)$(z,G);G=z});function K(){Q.value=!1}function q(){Q.value=!0}return{stop:Z,pause:K,resume:q,isActive:Q}}var K8=H9;import{ref as q8,watch as z8}from"@stacksjs/stx";function F9(J,$){let Q=q8(!1),G,Z=z8(J,(q)=>{if(!Q.value)$(q,G);G=q});function K(q){Q.value=!0,q(),Promise.resolve().then(()=>{Q.value=!1})}return{stop:Z,ignoreUpdates:K,isIgnoring:Q}}var M8=F9;import{watch as B8}from"@stacksjs/stx";function X8(J,$){let Q=[...J.value];return B8(J,(Z)=>{let K=[...Z],q=K.filter((M)=>!Q.includes(M)),z=Q.filter((M)=>!K.includes(M));$(K,Q,q,z),Q=K})}import{ref as W8,watch as _8}from"@stacksjs/stx";function Y8(J,$,Q){let G=W8(Q),Z=_8(J,(K)=>{if(G.value>0){if(G.value--,$(K),G.value<=0)Z()}});return{stop:Z,remaining:G}}import{watch as H8}from"@stacksjs/stx";function F8(J,$,Q){let G=JSON.stringify(J.value);if(Q?.immediate)$(J.value);return H8(J,(K)=>{let q=JSON.stringify(K);if(q!==G)G=q,$(K)})}import{watch as L8}from"@stacksjs/stx";function O8(J,$){return $(J.value),L8(J,(Q)=>{$(Q)})}import{watch as A8}from"@stacksjs/stx";function N8(J,$){let Q=A8(J,(Z)=>{$(Z)});function G(){$(J.value)}return{stop:Q,trigger:G}}import{watch as P8}from"@stacksjs/stx";function D8(J,$,Q){return P8(J,(Z)=>{Q(()=>$(Z))})}import{onUnmounted as C8,ref as yJ}from"@stacksjs/stx";function E8(J,$={}){let{onConnected:Q,onDisconnected:G,onError:Z,onMessage:K,immediate:q=!0,autoReconnect:z=!1,heartbeat:M=!1,protocols:B}=$,W=yJ(null),X=yJ("CLOSED"),_=yJ(null),Y=0,H=null,F=null,O=!1,P=typeof M==="object"?M.interval??30000:30000,C=typeof M==="object"?M.message??"ping":"ping",E=typeof z==="object"?z.retries??3:z?1/0:0,b=typeof z==="object"?z.delay??1000:1000;function u(S){if(c(),!M)return;F=setInterval(()=>{if(S.readyState===WebSocket.OPEN)S.send(C)},P)}function c(){if(F!==null)clearInterval(F),F=null}function l(){if(typeof WebSocket>"u")return;r(),O=!1,Y=0;let S=T(J);X.value="CONNECTING";let D=B?new WebSocket(S,B):new WebSocket(S);_.value=D,D.onopen=()=>{X.value="OPEN",Y=0,u(D),Q?.(D)},D.onclose=(A)=>{if(X.value="CLOSED",_.value=null,c(),G?.(D,A),!O&&z&&Y<E)Y++,H=setTimeout(()=>{l()},b)},D.onerror=(A)=>{Z?.(D,A)},D.onmessage=(A)=>{W.value=typeof A.data==="string"?A.data:String(A.data),K?.(D,A)}}function r(S,D){if(O=!0,c(),H!==null)clearTimeout(H),H=null;let A=_.value;if(A){if(A.readyState===WebSocket.OPEN||A.readyState===WebSocket.CONNECTING)X.value="CLOSING",A.close(S,D);_.value=null}}function BJ(S){let D=_.value;if(D&&D.readyState===WebSocket.OPEN)D.send(S)}if(q)l();try{C8(()=>{r()})}catch{}return{data:W,status:X,ws:_,open:l,close:r,send:BJ}}import{onUnmounted as T8,ref as GJ}from"@stacksjs/stx";function V8(J,$=[],Q={}){let{withCredentials:G=!1,immediate:Z=!0}=Q,K=GJ(null),q=GJ(null),z=GJ("CLOSED"),M=GJ(null),B=GJ(null),W=[];function X(){let Y=B.value;if(Y){for(let{eventName:H,handler:F}of W)Y.removeEventListener(H,F);W=[],Y.close(),B.value=null,z.value="CLOSED"}}function _(){if(typeof EventSource>"u")return;X();let Y=T(J);z.value="CONNECTING";let H=new EventSource(Y,{withCredentials:G});B.value=H,H.onopen=()=>{z.value="OPEN",M.value=null},H.onerror=(O)=>{if(M.value=O,H.readyState===EventSource.CLOSED)z.value="CLOSED";else z.value="CONNECTING"};let F=(O)=>{let P=O;K.value=P.data,q.value="message"};H.addEventListener("message",F),W.push({eventName:"message",handler:F});for(let O of $){let P=(C)=>{let E=C;K.value=E.data,q.value=O};H.addEventListener(O,P),W.push({eventName:O,handler:P})}}if(Z)_();try{T8(()=>{X()})}catch{}return{data:K,event:q,status:z,error:M,eventSource:B,close:X,open:_}}import{onUnmounted as j8,ref as KJ}from"@stacksjs/stx";function U8(J){let $=KJ(typeof BroadcastChannel<"u"),Q=KJ(void 0),G=KJ(null),Z=KJ(null),K=KJ(!1);if($.value){let M=new BroadcastChannel(J);Q.value=M,M.onmessage=(B)=>{G.value=B.data},M.onmessageerror=(B)=>{Z.value=B};try{j8(()=>{M.close(),K.value=!0})}catch{}}function q(M){if(Q.value&&!K.value)Q.value.postMessage(M)}function z(){if(Q.value&&!K.value)Q.value.close(),K.value=!0}return{isSupported:$,channel:Q,data:G,error:Z,post:q,close:z,isClosed:K}}import{ref as R8,watch as I8}from"@stacksjs/stx";function L9(J,$,Q){let G=R8($),Z=0;async function K(){let q=++Z;try{let z=await J();if(q===Z)G.value=z}catch{}}if(K(),Q&&Q.length>0)for(let q of Q)I8(q,()=>{K()});return G}import{ref as b8,watch as S8}from"@stacksjs/stx";function O9(J,$){let Q=b8(J());if($&&$.length>0)for(let G of $)S8(G,()=>{Q.value=J()});return Q}import{onUnmounted as x8,ref as y8}from"@stacksjs/stx";function wJ(J,$,Q){let G=y8(typeof window<"u"&&"IntersectionObserver"in window),Z=N;(()=>{if(Z(),!G.value)return;let z=L(J);if(!z)return;let M=new IntersectionObserver($,Q);M.observe(z),Z=()=>{M.disconnect(),Z=N}})();let q=()=>{Z()};try{x8(q)}catch{}return{isSupported:G,stop:q}}import{onUnmounted as w8,ref as k8}from"@stacksjs/stx";function g8(J,$,Q){let G=k8(typeof window<"u"&&"ResizeObserver"in window),Z=N;(()=>{if(Z(),!G.value)return;let z=L(J);if(!z)return;let M=new ResizeObserver($);M.observe(z,Q),Z=()=>{M.disconnect(),Z=N}})();let q=()=>{Z()};try{w8(q)}catch{}return{isSupported:G,stop:q}}import{onUnmounted as h8,ref as v8}from"@stacksjs/stx";function f8(J,$,Q){let G=v8(typeof window<"u"&&"MutationObserver"in window),Z=N;(()=>{if(Z(),!G.value)return;let z=L(J);if(!z)return;let M=new MutationObserver($);M.observe(z,Q??{childList:!0,subtree:!0}),Z=()=>{M.disconnect(),Z=N}})();let q=()=>{Z()};try{h8(q)}catch{}return{isSupported:G,stop:q}}import{onUnmounted as m8,ref as A9}from"@stacksjs/stx";function p8(J,$){let Q=A9($?.initialSize?.width??0),G=A9($?.initialSize?.height??0),Z=typeof window<"u"&&"ResizeObserver"in window,K=N;if(Z){let z=L(J);if(z){let M=new ResizeObserver((B)=>{for(let W of B)if(W.contentBoxSize){let X=Array.isArray(W.contentBoxSize)?W.contentBoxSize[0]:W.contentBoxSize;Q.value=X.inlineSize,G.value=X.blockSize}else Q.value=W.contentRect.width,G.value=W.contentRect.height});M.observe(z),K=()=>{M.disconnect(),K=N}}}let q=()=>{K()};try{m8(q)}catch{}return{width:Q,height:G,stop:q}}import{onUnmounted as d8,ref as p}from"@stacksjs/stx";function u8(J){let $=p(0),Q=p(0),G=p(0),Z=p(0),K=p(0),q=p(0),z=p(0),M=p(0),B=[],W=N,X=()=>{let _=L(J);if(!_)return;let Y=_.getBoundingClientRect();$.value=Y.x,Q.value=Y.y,G.value=Y.top,Z.value=Y.right,K.value=Y.bottom,q.value=Y.left,z.value=Y.width,M.value=Y.height};if(typeof window<"u"){X();let _=()=>X();window.addEventListener("resize",_,{passive:!0}),B.push(()=>window.removeEventListener("resize",_));let Y=()=>X();if(window.addEventListener("scroll",Y,{passive:!0}),B.push(()=>window.removeEventListener("scroll",Y)),"ResizeObserver"in window){let H=L(J);if(H){let F=new ResizeObserver(X);F.observe(H),B.push(()=>F.disconnect())}}if("MutationObserver"in window){let H=L(J);if(H){let F=new MutationObserver(X);F.observe(H,{childList:!0,subtree:!0,attributes:!0}),B.push(()=>F.disconnect())}}W=()=>{for(let H of B)H();B.length=0,W=N}}try{d8(()=>W())}catch{}return{x:$,y:Q,top:G,right:Z,bottom:K,left:q,width:z,height:M,update:X}}import{ref as c8}from"@stacksjs/stx";function l8(J){let $=c8(!1);return wJ(J,(Q)=>{for(let G of Q)$.value=G.isIntersecting},{threshold:0}),$}import{onUnmounted as i8,ref as r8}from"@stacksjs/stx";function s8(J){let $=r8(!1),Q=()=>{};function G(Z){if(Q(),!Z)return;let K=()=>{$.value=!0},q=()=>{$.value=!1};Z.addEventListener("mouseenter",K,{passive:!0}),Z.addEventListener("mouseleave",q,{passive:!0}),Q=()=>{Z.removeEventListener("mouseenter",K),Z.removeEventListener("mouseleave",q),Q=()=>{}}}G(L(J));try{i8(()=>Q())}catch{}return $}import{onUnmounted as n8,ref as kJ}from"@stacksjs/stx";function o8(J){let $=J?.x??kJ(0),Q=J?.y??kJ(0),G=kJ(null);if(typeof document>"u")return{element:G,x:$,y:Q};let Z=(K)=>{$.value=K.clientX,Q.value=K.clientY,G.value=document.elementFromPoint(K.clientX,K.clientY)};document.addEventListener("mousemove",Z,{passive:!0});try{n8(()=>{document.removeEventListener("mousemove",Z)})}catch{}return{element:G,x:$,y:Q}}import{ref as a8,watch as t8}from"@stacksjs/stx";function e8(J,$,Q){let G=a8(Q??""),Z=()=>{let q=L($);if(q)return q;if(typeof document<"u")return document.documentElement;return null},K=Z();if(K){let q=getComputedStyle(K).getPropertyValue(L(J)).trim();if(q)G.value=q}return t8(G,(q)=>{let z=Z();if(z)z.style.setProperty(L(J),q)}),G}function J2(J){let $=L(J);if(!$)return $;if($.$el)return $.$el;return $}import{onUnmounted as $2,ref as gJ}from"@stacksjs/stx";function Q2(J){let $=J?.type??"page",Q=J?.touch??!0,G=J?.initialValue??{x:0,y:0},Z=gJ(G.x),K=gJ(G.y),q=gJ(null),z=N;if(typeof window<"u"){let M=[],B=(X)=>{switch($){case"page":return{x:X.pageX,y:X.pageY};case"client":return{x:X.clientX,y:X.clientY};case"screen":return{x:X.screenX,y:X.screenY};default:return{x:X.pageX,y:X.pageY}}},W=(X)=>{let _=B(X);Z.value=_.x,K.value=_.y,q.value="mouse"};if(window.addEventListener("mousemove",W,{passive:!0}),M.push(()=>window.removeEventListener("mousemove",W)),Q){let X=(_)=>{if(_.touches.length>0){let Y=_.touches[0];if(!Y)return;switch($){case"page":Z.value=Y.pageX,K.value=Y.pageY;break;case"client":Z.value=Y.clientX,K.value=Y.clientY;break;case"screen":Z.value=Y.screenX,K.value=Y.screenY;break}q.value="touch"}};window.addEventListener("touchstart",X,{passive:!0}),window.addEventListener("touchmove",X,{passive:!0}),M.push(()=>{window.removeEventListener("touchstart",X),window.removeEventListener("touchmove",X)})}z=()=>{for(let X of M)X();M.length=0,z=N}}try{$2(()=>z())}catch{}return{x:Z,y:K,sourceType:q}}import{onUnmounted as Z2,ref as m}from"@stacksjs/stx";function G2(J){let $=m(0),Q=m(0),G=m(0),Z=m(0),K=m(0),q=m(0),z=m(0),M=m(0),B=m(!0);if(typeof window>"u")return{x:$,y:Q,elementX:G,elementY:Z,elementPositionX:K,elementPositionY:q,elementHeight:z,elementWidth:M,isOutside:B};let W=(X)=>{$.value=X.pageX,Q.value=X.pageY;let _=L(J);if(!_){B.value=!0;return}let Y=_.getBoundingClientRect();K.value=Y.left+window.scrollX,q.value=Y.top+window.scrollY,z.value=Y.height,M.value=Y.width,G.value=X.pageX-K.value,Z.value=X.pageY-q.value,B.value=G.value<0||Z.value<0||G.value>M.value||Z.value>z.value};window.addEventListener("mousemove",W,{passive:!0});try{Z2(()=>{window.removeEventListener("mousemove",W)})}catch{}return{x:$,y:Q,elementX:G,elementY:Z,elementPositionX:K,elementPositionY:q,elementHeight:z,elementWidth:M,isOutside:B}}import{onUnmounted as K2,ref as N9}from"@stacksjs/stx";function q2(J){let $=N9(!1),Q=N9(null);if(typeof window>"u")return{pressed:$,sourceType:Q};let G=L(J)??window,Z=()=>{$.value=!0,Q.value="mouse"},K=()=>{$.value=!0,Q.value="touch"},q=()=>{$.value=!1};G.addEventListener("mousedown",Z,{passive:!0}),G.addEventListener("touchstart",K,{passive:!0}),window.addEventListener("mouseup",q,{passive:!0}),window.addEventListener("touchend",q,{passive:!0}),window.addEventListener("touchcancel",q,{passive:!0});try{K2(()=>{G.removeEventListener("mousedown",Z),G.removeEventListener("touchstart",K),window.removeEventListener("mouseup",q),window.removeEventListener("touchend",q),window.removeEventListener("touchcancel",q)})}catch{}return{pressed:$,sourceType:Q}}import{onUnmounted as z2,ref as d}from"@stacksjs/stx";function M2(J){let $=d(0),Q=d(0),G=d(0),Z=d(0),K=d(0),q=d(0),z=d(""),M=d(!1);if(typeof window>"u")return{isInside:M,x:$,y:Q,pointerId:G,pressure:Z,tiltX:K,tiltY:q,pointerType:z};let B=J??window,W=(Y)=>{$.value=Y.pageX,Q.value=Y.pageY,G.value=Y.pointerId,Z.value=Y.pressure,K.value=Y.tiltX,q.value=Y.tiltY,z.value=Y.pointerType},X=()=>{M.value=!0},_=()=>{M.value=!1};B.addEventListener("pointermove",W,{passive:!0}),B.addEventListener("pointerdown",W,{passive:!0}),B.addEventListener("pointerenter",X,{passive:!0}),B.addEventListener("pointerleave",_,{passive:!0});try{z2(()=>{B.removeEventListener("pointermove",W),B.removeEventListener("pointerdown",W),B.removeEventListener("pointerenter",X),B.removeEventListener("pointerleave",_)})}catch{}return{isInside:M,x:$,y:Q,pointerId:G,pressure:Z,tiltX:K,tiltY:q,pointerType:z}}import{onUnmounted as B2,ref as WJ}from"@stacksjs/stx";function X2(J,$={}){let{threshold:Q=50,onSwipe:G,onSwipeStart:Z,onSwipeEnd:K,passive:q=!0}=$,z=WJ(!1),M=WJ("none"),B=WJ(0),W=WJ(0),X=0,_=0;if(typeof window>"u")return{isSwiping:z,direction:M,lengthX:B,lengthY:W};let Y=L(J)??window,H=(P)=>{let C=P.touches[0];if(!C)return;X=C.clientX,_=C.clientY,z.value=!0,M.value="none",B.value=0,W.value=0,Z?.(P)},F=(P)=>{if(!z.value)return;let C=P.touches[0];if(!C)return;B.value=C.clientX-X,W.value=C.clientY-_;let E=Math.abs(B.value),b=Math.abs(W.value);if(E>b)M.value=B.value>0?"right":"left";else if(b>E)M.value=W.value>0?"down":"up"},O=(P)=>{if(!z.value)return;z.value=!1;let C=Math.abs(B.value),E=Math.abs(W.value);if(Math.max(C,E)>=Q)G?.(M.value),K?.(P,M.value);else M.value="none",K?.(P,"none")};Y.addEventListener("touchstart",H,{passive:q}),Y.addEventListener("touchmove",F,{passive:q}),Y.addEventListener("touchend",O,{passive:q}),Y.addEventListener("touchcancel",O,{passive:q});try{B2(()=>{Y.removeEventListener("touchstart",H),Y.removeEventListener("touchmove",F),Y.removeEventListener("touchend",O),Y.removeEventListener("touchcancel",O)})}catch{}return{isSwiping:z,direction:M,lengthX:B,lengthY:W}}import{onUnmounted as W2,ref as n}from"@stacksjs/stx";function _2(J,$={}){let{threshold:Q=50,onSwipe:G,onSwipeEnd:Z}=$,K=n(!1),q=n("none"),z=n(0),M=n(0),B=n({x:0,y:0}),W=n({x:0,y:0});if(typeof window>"u")return{isSwiping:K,direction:q,distanceX:z,distanceY:M,posStart:B,posEnd:W};let X=L(J);if(!X)return{isSwiping:K,direction:q,distanceX:z,distanceY:M,posStart:B,posEnd:W};let _=(F)=>{K.value=!0,q.value="none",B.value={x:F.clientX,y:F.clientY},W.value={x:F.clientX,y:F.clientY},z.value=0,M.value=0,X.setPointerCapture(F.pointerId)},Y=(F)=>{if(!K.value)return;W.value={x:F.clientX,y:F.clientY},z.value=W.value.x-B.value.x,M.value=W.value.y-B.value.y;let O=Math.abs(z.value),P=Math.abs(M.value);if(O>P)q.value=z.value>0?"right":"left";else if(P>O)q.value=M.value>0?"down":"up"},H=(F)=>{if(!K.value)return;if(K.value=!1,Math.max(Math.abs(z.value),Math.abs(M.value))>=Q)G?.(q.value),Z?.(F,q.value);else q.value="none",Z?.(F,"none")};X.addEventListener("pointerdown",_),X.addEventListener("pointermove",Y),X.addEventListener("pointerup",H);try{W2(()=>{X.removeEventListener("pointerdown",_),X.removeEventListener("pointermove",Y),X.removeEventListener("pointerup",H)})}catch{}return{isSwiping:K,direction:q,distanceX:z,distanceY:M,posStart:B,posEnd:W}}import{onUnmounted as Y2,ref as hJ}from"@stacksjs/stx";function H2(J){let $=hJ(typeof document<"u"&&"pointerLockElement"in document),Q=hJ(!1),G=hJ(null);if(typeof document<"u"){let q=()=>{Q.value=!!document.pointerLockElement,G.value=document.pointerLockElement};document.addEventListener("pointerlockchange",q),document.addEventListener("pointerlockerror",q);try{Y2(()=>{document.removeEventListener("pointerlockchange",q),document.removeEventListener("pointerlockerror",q)})}catch{}}async function Z(q){if(!$.value)return;let z=q??L(J);if(z)await z.requestPointerLock()}function K(){if(!$.value)return;if(document.pointerLockElement)document.exitPointerLock()}return{isSupported:$,isLocked:Q,lock:Z,unlock:K,element:G}}import{onUnmounted as F2,ref as vJ}from"@stacksjs/stx";function L2(J,$={}){let Q=vJ(0),G=vJ(0),Z=vJ("mouse");if(typeof window>"u")return{tilt:Q,roll:G,source:Z};let K=(z)=>{let M=L(J);if(!M)return;let B=M.getBoundingClientRect(),W=B.left+B.width/2,X=B.top+B.height/2;Q.value=(z.clientX-W)/(B.width/2)*0.5,G.value=(z.clientY-X)/(B.height/2)*0.5,Z.value="mouse"};window.addEventListener("mousemove",K,{passive:!0});let q=(z)=>{if(z.gamma!==null&&z.beta!==null){let M=z.gamma/90,B=(z.beta-45)/90;Q.value=$.deviceOrientationTiltAdjust?.(M)??M*0.5,G.value=$.deviceOrientationRollAdjust?.(B)??B*0.5,Z.value="deviceOrientation"}};window.addEventListener("deviceorientation",q,{passive:!0});try{F2(()=>{window.removeEventListener("mousemove",K),window.removeEventListener("deviceorientation",q)})}catch{}return{tilt:Q,roll:G,source:Z}}import{onUnmounted as O2,ref as h}from"@stacksjs/stx";function A2(J){let{immediate:$=!0,...Q}=J??{},G=h(typeof navigator<"u"&&"geolocation"in navigator),Z={latitude:h(null),longitude:h(null),accuracy:h(null),altitude:h(null),altitudeAccuracy:h(null),heading:h(null),speed:h(null)},K=h(null),q=h(null),z=null,M=N,B=(Y)=>{Z.latitude.value=Y.coords.latitude,Z.longitude.value=Y.coords.longitude,Z.accuracy.value=Y.coords.accuracy,Z.altitude.value=Y.coords.altitude,Z.altitudeAccuracy.value=Y.coords.altitudeAccuracy,Z.heading.value=Y.coords.heading,Z.speed.value=Y.coords.speed,K.value=Y.timestamp,q.value=null},W=(Y)=>{q.value=Y},X=()=>{if(!G.value)return;if(z!==null)return;z=navigator.geolocation.watchPosition(B,W,Q),M=()=>{if(z!==null)navigator.geolocation.clearWatch(z),z=null;M=N}},_=()=>{M()};if($)X();try{O2(_)}catch{}return{coords:Z,locatedAt:K,error:q,isSupported:G,pause:_,resume:X}}import{onUnmounted as N2,ref as y}from"@stacksjs/stx";function P2(){let J=y(typeof window<"u"&&"DeviceMotionEvent"in window),$={x:y(null),y:y(null),z:y(null)},Q={x:y(null),y:y(null),z:y(null)},G={alpha:y(null),beta:y(null),gamma:y(null)},Z=y(0),K=N;if(typeof window<"u"&&J.value){let q=(z)=>{if(z.acceleration)$.x.value=z.acceleration.x,$.y.value=z.acceleration.y,$.z.value=z.acceleration.z;if(z.accelerationIncludingGravity)Q.x.value=z.accelerationIncludingGravity.x,Q.y.value=z.accelerationIncludingGravity.y,Q.z.value=z.accelerationIncludingGravity.z;if(z.rotationRate)G.alpha.value=z.rotationRate.alpha,G.beta.value=z.rotationRate.beta,G.gamma.value=z.rotationRate.gamma;Z.value=z.interval};window.addEventListener("devicemotion",q,{passive:!0}),K=()=>{window.removeEventListener("devicemotion",q),K=N}}try{N2(()=>K())}catch{}return{acceleration:$,accelerationIncludingGravity:Q,rotationRate:G,interval:Z,isSupported:J}}import{onUnmounted as D2,ref as qJ}from"@stacksjs/stx";function C2(){let J=qJ(typeof window<"u"&&"DeviceOrientationEvent"in window),$=qJ(null),Q=qJ(null),G=qJ(null),Z=qJ(!1),K=N;if(typeof window<"u"&&J.value){let q=(z)=>{$.value=z.alpha,Q.value=z.beta,G.value=z.gamma,Z.value=z.absolute};window.addEventListener("deviceorientation",q,{passive:!0}),K=()=>{window.removeEventListener("deviceorientation",q),K=N}}try{D2(()=>K())}catch{}return{alpha:$,beta:Q,gamma:G,absolute:Z,isSupported:J}}import{onUnmounted as E2,ref as T2}from"@stacksjs/stx";function V2(){let J=T2(typeof window<"u"?window.devicePixelRatio:1);if(typeof window>"u")return{pixelRatio:J};let $=null,Q=()=>{};function G(){Q(),$=window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);let Z=()=>{J.value=window.devicePixelRatio,G()};$.addEventListener("change",Z,{once:!0}),Q=()=>{$?.removeEventListener("change",Z)}}G();try{E2(()=>Q())}catch{}return{pixelRatio:J}}import{onUnmounted as j2,ref as zJ}from"@stacksjs/stx";function U2(){let J=typeof navigator<"u"?navigator:void 0,$=zJ(!!J?.getBattery),Q=zJ(!1),G=zJ(0),Z=zJ(0),K=zJ(1),q=[],z=N;if($.value&&J?.getBattery)J.getBattery().then((M)=>{let B=()=>{Q.value=M.charging,G.value=M.chargingTime,Z.value=M.dischargingTime,K.value=M.level};B(),M.addEventListener("chargingchange",B),M.addEventListener("chargingtimechange",B),M.addEventListener("dischargingtimechange",B),M.addEventListener("levelchange",B),q.push(()=>{M.removeEventListener("chargingchange",B),M.removeEventListener("chargingtimechange",B),M.removeEventListener("dischargingtimechange",B),M.removeEventListener("levelchange",B)}),z=()=>{for(let W of q)W();q.length=0,z=N}}).catch(()=>{$.value=!1});try{j2(()=>z())}catch{}return{charging:Q,chargingTime:G,dischargingTime:Z,level:K,isSupported:$}}import{onUnmounted as R2,ref as I2,watch as b2}from"@stacksjs/stx";function S2(J,$={}){let{initialValue:Q=!1}=$,G=I2(Q),Z=()=>{};function K(z){if(Z(),!z)return;let M=()=>{G.value=!0},B=()=>{G.value=!1};if(z.addEventListener("focus",M,{passive:!0}),z.addEventListener("blur",B,{passive:!0}),Z=()=>{z.removeEventListener("focus",M),z.removeEventListener("blur",B),Z=()=>{}},document.activeElement===z)G.value=!0;if(Q)z.focus()}let q=L(J);K(q),b2(G,(z)=>{let M=L(J);if(!M)return;if(z)M.focus();else M.blur()});try{R2(()=>Z())}catch{}return{focused:G}}import{onUnmounted as x2,ref as y2}from"@stacksjs/stx";function w2(J){let $=y2(!1),Q=()=>{};function G(Z){if(Q(),!Z)return;let K=()=>{$.value=!0},q=(z)=>{if(!Z.contains(z.relatedTarget))$.value=!1};Z.addEventListener("focusin",K,{passive:!0}),Z.addEventListener("focusout",q),Q=()=>{Z.removeEventListener("focusin",K),Z.removeEventListener("focusout",q),Q=()=>{}}}G(L(J));try{x2(()=>Q())}catch{}return{focused:$}}import{onUnmounted as k2,ref as g2}from"@stacksjs/stx";function h2(){let J=g2(null);if(typeof document>"u")return J;J.value=document.activeElement;let $=()=>{J.value=document.activeElement};document.addEventListener("focusin",$,{passive:!0}),document.addEventListener("focusout",$,{passive:!0});try{k2(()=>{document.removeEventListener("focusin",$),document.removeEventListener("focusout",$)})}catch{}return J}import{onUnmounted as v2,ref as P9}from"@stacksjs/stx";var f2=["mousemove","mousedown","resize","keydown","touchstart","wheel"];function m2(J=60000,$){let Q=$?.events??f2,G=$?.initialState??!1,Z=P9(G),K=P9(Date.now()),q=null,z=N;if(typeof window<"u"){let M=[],B=()=>{if(Z.value=!1,K.value=Date.now(),q!==null)clearTimeout(q);q=setTimeout(()=>{Z.value=!0},J)};for(let W of Q)window.addEventListener(W,B,{passive:!0}),M.push(()=>window.removeEventListener(W,B));q=setTimeout(()=>{Z.value=!0},J),z=()=>{for(let W of M)W();if(M.length=0,q!==null)clearTimeout(q),q=null;z=N}}try{v2(()=>z())}catch{}return{idle:Z,lastActive:K}}import{onUnmounted as p2,ref as d2}from"@stacksjs/stx";function u2(){let J=d2(!1),$=N;if(typeof document<"u"){let Q=[],G=(K)=>{if(K.clientY<=0||K.clientX<=0||K.clientX>=(typeof window<"u"?window.innerWidth:0)||K.clientY>=(typeof window<"u"?window.innerHeight:0))J.value=!0},Z=()=>{J.value=!1};document.documentElement.addEventListener("mouseleave",G),document.documentElement.addEventListener("mouseenter",Z),Q.push(()=>document.documentElement.removeEventListener("mouseleave",G),()=>document.documentElement.removeEventListener("mouseenter",Z)),$=()=>{for(let K of Q)K();Q.length=0,$=N}}try{p2(()=>$())}catch{}return J}import{ref as c2}from"@stacksjs/stx";function l2(){let J=c2(!1);return Promise.resolve().then(()=>{J.value=!0}),J}import{onUnmounted as i2,ref as _J}from"@stacksjs/stx";function r2(J,$){let Q=$?.initialValue?.x??0,G=$?.initialValue?.y??0,Z=_J(Q),K=_J(G),q=_J(!1),z=_J(`left: ${Q}px; top: ${G}px;`),M=N;if(typeof window<"u"){let B=[],W=0,X=0,_=0,Y=0,H=()=>{z.value=`left: ${Z.value}px; top: ${K.value}px;`},F=(E)=>{if(!q.value)return;if(Z.value=E.clientX-_,K.value=E.clientY-Y,H(),$?.onMove)$.onMove({x:Z.value,y:K.value},E)},O=(E)=>{if(!q.value)return;if(q.value=!1,$?.onEnd)$.onEnd({x:Z.value,y:K.value},E);window.removeEventListener("pointermove",F),window.removeEventListener("pointerup",O)},P=(E)=>{let b={x:Z.value,y:K.value};if($?.onStart){if($.onStart(b,E)===!1)return}W=E.clientX,X=E.clientY,_=W-Z.value,Y=X-K.value,q.value=!0,window.addEventListener("pointermove",F),window.addEventListener("pointerup",O)},C=L(J);if(C)C.addEventListener("pointerdown",P),B.push(()=>C.removeEventListener("pointerdown",P));M=()=>{for(let E of B)E();B.length=0,window.removeEventListener("pointermove",F),window.removeEventListener("pointerup",O),M=N}}try{i2(()=>M())}catch{}return{x:Z,y:K,isDragging:q,style:z}}import{onUnmounted as s2,ref as D9}from"@stacksjs/stx";function n2(J,$){let Q=D9(!1),G=D9(null),Z=N,K=0;if(typeof window<"u"){let q=L(J);if(q){let z=[],M=(_)=>{_.preventDefault(),K++,Q.value=!0},B=(_)=>{_.preventDefault(),Q.value=!0},W=(_)=>{if(_.preventDefault(),K--,K<=0)K=0,Q.value=!1},X=(_)=>{_.preventDefault(),K=0,Q.value=!1;let Y=_.dataTransfer?.files;if(Y&&Y.length>0)G.value=Array.from(Y);else G.value=null;if($)$(G.value)};q.addEventListener("dragenter",M),q.addEventListener("dragover",B),q.addEventListener("dragleave",W),q.addEventListener("drop",X),z.push(()=>q.removeEventListener("dragenter",M),()=>q.removeEventListener("dragover",B),()=>q.removeEventListener("dragleave",W),()=>q.removeEventListener("drop",X)),Z=()=>{for(let _ of z)_();z.length=0,Z=N}}}try{s2(()=>Z())}catch{}return{isOverDropZone:Q,files:G}}import{onUnmounted as o2,ref as C9}from"@stacksjs/stx";function a2(){let J=C9(typeof navigator<"u"&&"language"in navigator),$=C9(J.value?navigator.language:"");if(typeof window<"u"){let Q=()=>{if(J.value)$.value=navigator.language};window.addEventListener("languagechange",Q,{passive:!0});try{o2(()=>{window.removeEventListener("languagechange",Q)})}catch{}}return{language:$,isSupported:J}}import{onUnmounted as t2,ref as e2}from"@stacksjs/stx";function J7(){let J=e2(typeof navigator<"u"?navigator.languages:[]);if(typeof window>"u")return J;let $=()=>{J.value=navigator.languages};window.addEventListener("languagechange",$,{passive:!0});try{t2(()=>{window.removeEventListener("languagechange",$)})}catch{}return J}import{onUnmounted as $7,ref as fJ}from"@stacksjs/stx";function Q7(){let J=fJ(typeof screen<"u"&&"orientation"in screen),$=fJ(void 0),Q=fJ(0);if(J.value){$.value=screen.orientation.type,Q.value=screen.orientation.angle;let K=()=>{$.value=screen.orientation.type,Q.value=screen.orientation.angle};screen.orientation.addEventListener("change",K);try{$7(()=>{screen.orientation.removeEventListener("change",K)})}catch{}}async function G(K){if(J.value)await screen.orientation.lock(K)}function Z(){if(J.value)screen.orientation.unlock()}return{isSupported:J,orientation:$,angle:Q,lockOrientation:G,unlockOrientation:Z}}import{ref as YJ}from"@stacksjs/stx";function Z7(){let J=YJ("0px"),$=YJ("0px"),Q=YJ("0px"),G=YJ("0px");function Z(){if(typeof document>"u"||typeof getComputedStyle>"u")return;let K=document.createElement("div");K.style.position="fixed",K.style.top="env(safe-area-inset-top, 0px)",K.style.right="env(safe-area-inset-right, 0px)",K.style.bottom="env(safe-area-inset-bottom, 0px)",K.style.left="env(safe-area-inset-left, 0px)",K.style.pointerEvents="none",K.style.visibility="hidden",document.body.appendChild(K);let q=getComputedStyle(K);J.value=q.top,$.value=q.right,Q.value=q.bottom,G.value=q.left,document.body.removeChild(K)}return Z(),{top:J,right:$,bottom:Q,left:G,update:Z}}import{ref as G7}from"@stacksjs/stx";function K7(J){let $=G7(null),Q=L(J);if(Q)$.value=Q.parentElement;return $}import{onUnmounted as q7,ref as E9}from"@stacksjs/stx";function z7(J){let $=E9(typeof navigator<"u"&&"permissions"in navigator),Q=E9("prompt");if(!$.value)return{state:Q,isSupported:$};let G=null;return navigator.permissions.query({name:J}).then((Z)=>{G=Z,Q.value=Z.state;let K=()=>{Q.value=Z.state};Z.addEventListener("change",K);try{q7(()=>{Z.removeEventListener("change",K)})}catch{}}).catch(()=>{}),{state:Q,isSupported:$}}import{ref as M7}from"@stacksjs/stx";function B7(J={}){let $=M7(typeof navigator<"u"&&"share"in navigator);async function Q(G){if(!$.value)return;let Z={...J,...G};await navigator.share(Z)}return{share:Q,isSupported:$}}import{onUnmounted as X7,ref as W7,watch as _7}from"@stacksjs/stx";function Y7(J){let $=W7(void 0);function Q(){if($.value)URL.revokeObjectURL($.value),$.value=void 0}function G(Z){if(Q(),Z)$.value=URL.createObjectURL(Z)}G(J.value),_7(J,(Z)=>{G(Z)});try{X7(()=>Q())}catch{}return $}import{ref as mJ}from"@stacksjs/stx";function H7(J){let $=mJ(!0),Q=mJ(!1),G=mJ(null);if(typeof Image>"u")return $.value=!1,{isLoading:$,error:G,isReady:Q};let Z=new Image;if(Z.onload=()=>{$.value=!1,Q.value=!0},Z.onerror=(K)=>{if($.value=!1,typeof K==="string")G.value=K;else if(K instanceof Event&&K.type==="error")G.value=`Failed to load image: ${J.src}`;else G.value="Failed to load image"},J.crossorigin)Z.crossOrigin=J.crossorigin;if(J.referrerpolicy)Z.referrerPolicy=J.referrerpolicy;if(J.sizes)Z.sizes=J.sizes;if(J.srcset)Z.srcset=J.srcset;return Z.src=J.src,{isLoading:$,error:G,isReady:Q}}import{ref as F7,watch as L7}from"@stacksjs/stx";function O7(J){let $=F7("");async function Q(Z){if(typeof Z==="string"){if(typeof btoa<"u")return btoa(Z);return Buffer.from(Z).toString("base64")}if(Z instanceof ArrayBuffer){let K=new Uint8Array(Z),q="";for(let z of K)q+=String.fromCharCode(z);if(typeof btoa<"u")return btoa(q);return Buffer.from(Z).toString("base64")}if(typeof Blob<"u"&&Z instanceof Blob)return new Promise((K,q)=>{let z=new FileReader;z.onload=()=>{let M=z.result,B=M.split(",")[1]??M;K(B)},z.onerror=q,z.readAsDataURL(Z)});if(typeof HTMLCanvasElement<"u"&&Z instanceof HTMLCanvasElement)return Z.toDataURL().split(",")[1]??"";return""}async function G(){let Z=L(J),K=await Q(Z);return $.value=K,K}if(G().catch(()=>{}),j(J))L7(J,()=>{G().catch(()=>{})});return{base64:$,execute:G}}import{onUnmounted as A7,ref as MJ}from"@stacksjs/stx";function N7(J,$,Q){let G=MJ(typeof HTMLElement<"u"&&"animate"in HTMLElement.prototype),Z=MJ(void 0),K=MJ(!1),q=MJ("idle"),z=MJ(null);function M(){if(Z.value)K.value=Z.value.pending,q.value=Z.value.playState,z.value=Z.value.currentTime}function B(){let F=L(J);if(!F||!G.value)return;Z.value=F.animate($,Q),Z.value.addEventListener("finish",M),Z.value.addEventListener("cancel",M),M()}function W(){Z.value?.play(),M()}function X(){Z.value?.pause(),M()}function _(){Z.value?.reverse(),M()}function Y(){Z.value?.finish(),M()}function H(){Z.value?.cancel(),M()}B();try{A7(()=>{Z.value?.cancel()})}catch{}return{isSupported:G,animate:Z,play:W,pause:X,reverse:_,finish:Y,cancel:H,pending:K,playState:q,currentTime:z}}import{onUnmounted as P7,ref as D7,watch as C7}from"@stacksjs/stx";var pJ={linear:(J)=>J,easeInQuad:(J)=>J*J,easeOutQuad:(J)=>J*(2-J),easeInOutQuad:(J)=>J<0.5?2*J*J:-1+(4-2*J)*J,easeInCubic:(J)=>J*J*J,easeOutCubic:(J)=>--J*J*J+1,easeInOutCubic:(J)=>J<0.5?4*J*J*J:(J-1)*(2*J-2)*(2*J-2)+1};function E7(J,$={}){let{duration:Q=300,transition:G=pJ.linear,delay:Z=0,onFinished:K,onStarted:q}=$,z=D7(L(J)),M=null;function B(W,X){if(M!==null)cancelAnimationFrame(M);let _=performance.now()+Z;q?.();function Y(H){let F=H-_;if(F<0){M=requestAnimationFrame(Y);return}let O=Math.min(F/Q,1),P=G(O);if(z.value=W+(X-W)*P,O<1)M=requestAnimationFrame(Y);else M=null,z.value=X,K?.()}M=requestAnimationFrame(Y)}if(typeof J==="object"&&J&&"value"in J&&"subscribe"in J)C7(J,(W)=>{if(typeof requestAnimationFrame<"u")B(z.value,W);else z.value=W});try{P7(()=>{if(M!==null)cancelAnimationFrame(M)})}catch{}return z}function T7(J,$,Q={}){return new Promise((G)=>{let{duration:Z=300,transition:K=pJ.linear,delay:q=0,onFinished:z,onStarted:M}=Q;if(typeof requestAnimationFrame>"u"){z?.(),G();return}let B=performance.now()+q;M?.();function W(X){let _=X-B;if(_<0){requestAnimationFrame(W);return}if(Math.min(_/Z,1)>=1)z?.(),G();else requestAnimationFrame(W)}requestAnimationFrame(W)})}import{onUnmounted as V7,ref as j7}from"@stacksjs/stx";function U7(J,$,Q={}){let{immediate:G=!0,type:Z="text/javascript",manual:K=!1,attrs:q={}}=Q,z=j7(null);function M(){return new Promise((W,X)=>{if(typeof document>"u"){X(Error("Document is not available"));return}let _=document.createElement("script");if(_.type=Z,_.src=J,Q.async)_.async=!0;if(Q.defer)_.defer=!0;if(Q.crossOrigin)_.crossOrigin=Q.crossOrigin;if(Q.referrerPolicy)_.referrerPolicy=Q.referrerPolicy;for(let[Y,H]of Object.entries(q))_.setAttribute(Y,H);_.addEventListener("load",()=>{z.value=_,$?.(_),W(_)}),_.addEventListener("error",(Y)=>{X(Y)}),document.head.appendChild(_)})}function B(){if(z.value)z.value.remove(),z.value=null}if(G)M();if(!K)try{V7(()=>B())}catch{}return{scriptTag:z,load:M,unload:B}}import{onUnmounted as R7,ref as T9,watch as I7}from"@stacksjs/stx";function b7(J,$={}){let{immediate:Q=!0,id:G=`style-${Math.random().toString(36).slice(2,9)}`,media:Z}=$,K=T9(J),q=T9(!1),z=null;function M(){if(typeof document>"u")return;if(z)return;if(z=document.createElement("style"),z.id=G,Z)z.media=Z;z.textContent=K.value,document.head.appendChild(z),q.value=!0}function B(){if(z)z.remove(),z=null,q.value=!1}if(I7(K,(W)=>{if(z)z.textContent=W}),Q)M();try{R7(()=>B())}catch{}return{id:G,css:K,load:M,unload:B,isLoaded:q}}import{ref as S7}from"@stacksjs/stx";function x7(){let J=S7(!1),$=JJ(),Q=JJ(),G=JJ(),Z=null;function K(M){return J.value=!0,G.trigger(M),new Promise((B)=>{Z=B})}function q(M){J.value=!1,$.trigger(M),Z?.({data:M,isCanceled:!1}),Z=null}function z(){J.value=!1,Q.trigger(void 0),Z?.({isCanceled:!0}),Z=null}return{isRevealed:J,reveal:K,confirm:q,cancel:z,onConfirm:$.on,onCancel:Q.on,onReveal:G.on}}import{ref as y7}from"@stacksjs/stx";function w7(J={}){let $=y7(null);function Q(Z){if(typeof document>"u")return;let K={...J,...Z},q=document.createElement("input");if(q.type="file",K.accept)q.accept=K.accept;if(K.multiple)q.multiple=!0;if(K.capture)q.setAttribute("capture",K.capture);q.onchange=()=>{$.value=q.files},q.click()}function G(){$.value=null}return{files:$,open:Q,reset:G}}import{ref as V9}from"@stacksjs/stx";function k7(){let J=V9(typeof window<"u"&&"EyeDropper"in window),$=V9("");async function Q(){if(!J.value)return;let G=new window.EyeDropper;try{let Z=await G.open();return $.value=Z.sRGBHex,Z}catch{return}}return{isSupported:J,sRGBHex:$,open:Q}}import{ref as j9,watch as g7}from"@stacksjs/stx";function h7(J){let $=j9(J?.element??null),Q=j9(J?.input??"");function G(){let Z=$.value;if(!Z)return;Z.style.height="auto",Z.style.height=`${Z.scrollHeight}px`}return g7(Q,()=>{if($.value)$.value.value=Q.value;if(typeof requestAnimationFrame<"u")requestAnimationFrame(G);else G()}),{textarea:$,input:Q,triggerResize:G}}import{onUnmounted as v7,ref as i}from"@stacksjs/stx";function f7(J={}){let $=i(typeof Notification<"u"),Q=i(null),G=i($.value&&Notification.permission==="granted"),Z=i(null),K=i(null),q=i(null),z=i(null);async function M(W){if(!$.value)return;if(Notification.permission!=="granted"){let H=await Notification.requestPermission();if(G.value=H==="granted",!G.value)return}let X={...J,...W},_=X.title??"",Y=new Notification(_,{body:X.body,icon:X.icon,dir:X.dir,lang:X.lang,tag:X.tag,requireInteraction:X.requireInteraction});return Q.value=Y,Y.onclick=(H)=>Z.value?.(H),Y.onshow=(H)=>K.value?.(H),Y.onerror=(H)=>q.value?.(H),Y.onclose=(H)=>{z.value?.(H),Q.value=null},Y}function B(){Q.value?.close(),Q.value=null}try{v7(()=>B())}catch{}return{isSupported:$,notification:Q,permissionGranted:G,show:M,close:B,onClick:Z,onShow:K,onError:q,onClose:z}}import{ref as m7}from"@stacksjs/stx";function p7(J={}){let{pattern:$=200}=J,Q=m7(typeof navigator<"u"&&"vibrate"in navigator);function G(K){if(!Q.value)return!1;return navigator.vibrate(K??$)}function Z(){if(Q.value)navigator.vibrate(0)}return{isSupported:Q,vibrate:G,stop:Z}}import{onUnmounted as d7,ref as U9}from"@stacksjs/stx";function u7(){let J=U9(typeof navigator<"u"&&"wakeLock"in navigator),$=U9(!1),Q=null;async function G(){if(!J.value)return;try{Q=await navigator.wakeLock.request("screen"),$.value=!0,Q.addEventListener("release",()=>{$.value=!1,Q=null})}catch{$.value=!1}}async function Z(){if(Q)await Q.release(),Q=null,$.value=!1}try{d7(()=>{Z()})}catch{}return{isSupported:J,isActive:$,request:G,release:Z}}import{onUnmounted as c7,ref as R9}from"@stacksjs/stx";function l7(J,$){let Q=R9(null),G=R9(void 0);if(typeof Worker<"u"){let q=new Worker(J,$);G.value=q,q.onmessage=(z)=>{Q.value=z.data};try{c7(()=>q.terminate())}catch{}}function Z(q){G.value?.postMessage(q)}function K(){G.value?.terminate(),G.value=void 0}return{data:Q,post:Z,terminate:K,worker:G}}function i7(J){let $;function Q(){let K=new Blob([`self.onmessage = function(e) { self.postMessage((${J.toString()})(...e.data)); }`],{type:"text/javascript"}),q=URL.createObjectURL(K);return new Worker(q)}function G(...K){return new Promise((q,z)=>{if(typeof Worker>"u"){try{q(J(...K))}catch(M){z(M)}return}$=Q(),$.onmessage=(M)=>{q(M.data),$?.terminate()},$.onerror=(M)=>{z(M),$?.terminate()},$.postMessage(K)})}function Z(){$?.terminate(),$=void 0}return{workerFn:G,terminate:Z}}import{ref as HJ,watch as r7}from"@stacksjs/stx";function s7(J,$){let{itemHeight:Q,overscan:G=5}=$,Z=HJ([]),K=HJ(0),q=HJ(0),z=HJ({style:{width:"100%",height:"0px",marginTop:"0px"}});function M(){return L(J)}function B(){let _=M(),Y=_.length*Q,H=Math.max(0,Math.floor(q.value/Q)-G),F=Math.min(_.length,Math.ceil((q.value+K.value)/Q)+G),O=[];for(let P=H;P<F;P++){let C=_[P];if(C===void 0&&!(P in _))continue;O.push({data:C,index:P})}Z.value=O,z.value={style:{width:"100%",height:`${Y-H*Q}px`,marginTop:`${H*Q}px`}}}let W=(_)=>{let Y=_.target;q.value=Y.scrollTop,K.value=Y.clientHeight,B()};if(B(),typeof J==="object"&&J&&"value"in J&&"subscribe"in J)r7(J,()=>B());function X(_){q.value=_*Q,B()}return{list:Z,containerProps:{onScroll:W,style:{overflow:"auto",position:"relative"}},wrapperProps:z,scrollTo:X}}import{ref as o,watch as dJ}from"@stacksjs/stx";function n7(J={}){let{total:$,pageSize:Q=10,page:G=1,onPageChange:Z,onPageSizeChange:K}=J,q=o(G),z=o(Q),M=typeof $==="object"&&$&&"value"in $?$:o(typeof $==="number"?$:0),B=o(Math.max(1,Math.ceil(M.value/z.value))),W=o(q.value<=1),X=o(q.value>=B.value);function _(){B.value=Math.max(1,Math.ceil(M.value/z.value)),W.value=q.value<=1,X.value=q.value>=B.value}dJ(q,()=>{_(),Z?.({currentPage:q.value,currentPageSize:z.value})}),dJ(z,()=>{q.value=1,_(),K?.({currentPage:q.value,currentPageSize:z.value})}),dJ(M,()=>{_()});function Y(){if(q.value>1)q.value--}function H(){if(q.value<B.value)q.value++}return _(),{currentPage:q,currentPageSize:z,pageCount:B,isFirstPage:W,isLastPage:X,prev:Y,next:H}}function o7(J){return J.value!==null&&J.value!==void 0}import{ref as a7}from"@stacksjs/stx";function t7(J){let $=a7(!1);try{$.value=J()}catch{$.value=!1}return $}import{ref as e7,watch as JQ}from"@stacksjs/stx";function $Q(J,$={}){let{method:Q="parseFloat",radix:G=10,nanToZero:Z=!1}=$,K=e7(0);function q(z){if(typeof z==="number")return z;let M;if(Q==="parseInt")M=Number.parseInt(z,G);else M=Number.parseFloat(z);if(Z&&Number.isNaN(M))return 0;return M}if(K.value=q(T(J)),typeof J==="function");else if(J&&typeof J==="object"&&"value"in J&&"subscribe"in J)JQ(J,(z)=>{K.value=q(z)});return K}import{ref as QQ,watch as ZQ}from"@stacksjs/stx";function GQ(J){let $=QQ(String(T(J)??""));if(j(J))ZQ(J,(Q)=>{$.value=String(Q??"")});return $}import{ref as KQ,watch as qQ}from"@stacksjs/stx";function zQ(J,$){let Q=KQ(J.value??$);return qQ(J,(G)=>{Q.value=G??$}),Q}import{ref as MQ,watch as BQ}from"@stacksjs/stx";function I9(J,$=1000){let Q=MQ(J),G=null;return BQ(Q,()=>{if(G!==null)clearTimeout(G);G=setTimeout(()=>{Q.value=J,G=null},$)}),Q}var XQ=I9;function WQ(J){return JSON.parse(JSON.stringify(J))}var _Q={justNow:"just now",past:(J)=>`${J} ago`,future:(J)=>`in ${J}`,second:(J)=>`${J} second${J>1?"s":""}`,minute:(J)=>`${J} minute${J>1?"s":""}`,hour:(J)=>`${J} hour${J>1?"s":""}`,day:(J)=>`${J} day${J>1?"s":""}`,week:(J)=>`${J} week${J>1?"s":""}`,month:(J)=>`${J} month${J>1?"s":""}`,year:(J)=>`${J} year${J>1?"s":""}`};function YQ(J,$={}){let Q={..._Q,...$.messages},G=J instanceof Date?J:new Date(J),K=Date.now()-G.getTime(),q=Math.abs(K),z=Math.floor(q/1000),M=Math.floor(z/60),B=Math.floor(M/60),W=Math.floor(B/24),X=Math.floor(W/7),_=Math.floor(W/30),Y=Math.floor(W/365),H=K<0;function F(O){return H?Q.future(O):Q.past(O)}if(z<5)return Q.justNow;if(z<60)return F(Q.second(z));if(M<60)return F(Q.minute(M));if(B<24)return F(Q.hour(B));if(W<7)return F(Q.day(W));if(X<4)return F(Q.week(X));if(_<12)return F(Q.month(_));return F(Q.year(Y))}import{watch as HQ}from"@stacksjs/stx";function FQ(J){function $(M,B={}){let{timeout:W,throwOnTimeout:X=!1}=B;if(M(J.value))return Promise.resolve(J.value);return new Promise((_,Y)=>{let H=null,F=HQ(J,(O)=>{if(M(O)){if(F(),H!==null)clearTimeout(H);_(O)}});if(W!==void 0)H=setTimeout(()=>{if(F(),X)Y(Error("Timeout"));else _(J.value)},W)})}function Q(M,B){return $((W)=>W===M,B)}function G(M){return $((B)=>Boolean(B),M)}function Z(M){return $((B)=>B===null,M)}function K(M){return $((B)=>B===void 0,M)}function q(M){return $((B)=>Number.isNaN(B),M)}function z(M){let B=J.value;return $((W)=>W!==B,M)}return{toMatch:$,toBe:Q,toBeTruthy:G,toBeNull:Z,toBeUndefined:K,toBeNaN:q,changed:z,not:{toBe:(M,B)=>$((W)=>W!==M,B),toBeTruthy:(M)=>$((B)=>!B,M),toBeNull:(M)=>$((B)=>B!==null,M),toBeUndefined:(M)=>$((B)=>B!==void 0,M),toBeNaN:(M)=>$((B)=>!Number.isNaN(B),M)}}}import{ref as LQ}from"@stacksjs/stx";function OQ(J){if(j(J))return J;return LQ(J)}function AQ(J,$){for(let[Q,G]of Object.entries($))if(Q!=="value")J[Q]=G;return J}function NQ(J,$){let Q=new Map,G=$??((...K)=>JSON.stringify(K)),Z=function(...K){let q=G(...K);if(Q.has(q))return Q.get(q);let z=J(...K);return Q.set(q,z),z};return Z.load=(...K)=>{let q=G(...K),z=J(...K);return Q.set(q,z),z},Z.delete=(...K)=>{let q=G(...K);Q.delete(q)},Z.clear=()=>{Q.clear()},Z.cache=Q,Z}function PQ(J,$){let Q={...J};return Object.defineProperty(Q,Symbol.iterator,{enumerable:!1,value(){let G=0;return{next:()=>({value:$[G++],done:G>$.length})}}}),Q}import{watch as uJ}from"@stacksjs/stx";function DQ(J,$,Q={}){let{direction:G="both"}=Q,Z=!1,K=[];if(G==="both"||G==="ltr")K.push(uJ(J,(q)=>{if(Z)return;Z=!0,$.value=q,Z=!1}));if(G==="both"||G==="rtl")K.push(uJ($,(q)=>{if(Z)return;Z=!0,J.value=q,Z=!1}));return()=>{for(let q of K)q()}}function CQ(J,$){let Q=J.map((G)=>uJ(G,(Z)=>{$.value=Z}));return()=>{for(let G of Q)G()}}function EQ(J){let $=!1,Q;return()=>{if(!$)Q=J(),$=!0;return Q}}function TQ(J){let $=0,Q;return(...G)=>{if($++,!Q)Q=J(...G);return Q}}import{onUnmounted as cJ}from"@stacksjs/stx";function VQ(J){J()}function jQ(J){J()}function UQ(J){try{cJ(J)}catch{}}function RQ(J){try{cJ(J)}catch{}}function IQ(J){try{cJ(J)}catch{}}import{ref as v,watch as b9}from"@stacksjs/stx";function w(J,$){if(j(J))b9(J,$)}function k(J){return L(J)}function bQ(J,$,Q){let G=v([]);function Z(){let K=k(J),q=k($);if(Q)G.value=K.filter((z)=>!q.some((M)=>Q(z,M)));else G.value=K.filter((z)=>!q.includes(z))}return Z(),w(J,Z),w($,Z),G}function SQ(J,$){let Q=v(!1);function G(){Q.value=k(J).every($)}return G(),w(J,G),Q}function xQ(J,$){let Q=v([]);function G(){Q.value=k(J).filter($)}return G(),w(J,G),Q}function yQ(J,$){let Q=v(void 0);function G(){Q.value=k(J).find($)}return G(),w(J,G),Q}function wQ(J,$){let Q=v(-1);function G(){Q.value=k(J).findIndex($)}return G(),w(J,G),Q}function kQ(J,$,Q){let G=v(!1);function Z(){let K=k(J),q=L($);if(Q)G.value=K.some((z)=>Q(z,q));else G.value=K.includes(q)}if(Z(),w(J,Z),j($))b9($,Z);return G}function gQ(J,$){let Q=v([]);function G(){Q.value=k(J).map($)}return G(),w(J,G),Q}function hQ(J,$,Q){let G=v(Q);function Z(){G.value=k(J).reduce($,Q)}return Z(),w(J,Z),G}function vQ(J,$){let Q=v(!1);function G(){Q.value=k(J).some($)}return G(),w(J,G),Q}function fQ(J,$){let Q=v([]);function G(){let Z=k(J);if($)Q.value=Z.filter((K,q)=>Z.findIndex((z)=>$(K,z))===q);else Q.value=[...new Set(Z)]}return G(),w(J,G),Q}export{t6 as whenever,D8 as watchWithFilter,N8 as watchTriggerable,Y9 as watchThrottled,H9 as watchPausable,J8 as watchOnce,O8 as watchImmediate,F9 as watchIgnorable,F8 as watchDeep,_9 as watchDebounced,Y8 as watchAtMost,X8 as watchArray,g4 as useWindowSize,p4 as useWindowScroll,f4 as useWindowFocus,i7 as useWebWorkerFn,l7 as useWebWorker,E8 as useWebSocket,f7 as useWebNotification,u7 as useWakeLock,s7 as useVirtualList,p7 as useVibrate,x4 as useUrlSearchParams,D6 as useTrunc,E7 as useTransition,G$ as useToggle,GQ as useToString,$Q as useToNumber,A4 as useTitle,H$ as useTimestamp,s$ as useTimeoutPoll,l$ as useTimeoutFn,d$ as useTimeout,A$ as useTimeAgo,s6 as useThrottledRefHistory,VJ as useThrottledRef,V$ as useThrottleFn,y$ as useThrottle,h7 as useTextareaAutosize,I4 as useTextSelection,U4 as useTextDirection,X2 as useSwipe,t7 as useSupported,P6 as useSum,b7 as useStyleTag,t as useStorage,y6 as useStepper,v6 as useSorted,B7 as useShare,v9 as useSessionStorage,r4 as useScrollLock,u4 as useScroll,U7 as useScriptTag,Z7 as useScreenSafeArea,Q7 as useScreenOrientation,N6 as useRound,g8 as useResizeObserver,c6 as useRefHistory,a$ as useRafFn,I6 as usePrevious,t9 as usePreferredReducedMotion,J7 as usePreferredLanguages,sJ as usePreferredDark,n9 as usePreferredContrast,i9 as usePreferredColorScheme,A6 as usePrecision,_2 as usePointerSwipe,H2 as usePointerLock,M2 as usePointer,z7 as usePermission,K7 as useParentElement,L2 as useParallax,u2 as usePageLeave,$$ as useOnline,n7 as useOffsetPagination,Y7 as useObjectUrl,W$ as useNow,Q$ as useNetwork,a2 as useNavigatorLanguage,f8 as useMutationObserver,q2 as useMousePressed,G2 as useMouseInElement,Q2 as useMouse,l2 as useMounted,O6 as useMin,NQ as useMemoize,K4 as useMediaQuery,L6 as useMax,QJ as useManualRefHistory,X6 as useMagicKeys,h9 as useLocalStorage,x6 as useLastChanged,M6 as useKeyModifier,f$ as useIntervalFn,g$ as useInterval,wJ as useIntersectionObserver,o4 as useInfiniteScroll,H7 as useImage,m2 as useIdle,A2 as useGeolocation,t4 as useFullscreen,J4 as useFps,w2 as useFocusWithin,S2 as useFocus,F6 as useFloor,w7 as useFileDialog,NJ as useFetch,D4 as useFavicon,k7 as useEyeDropper,V8 as useEventSource,D$ as useEventListener,E$ as useEventBus,l8 as useElementVisibility,p8 as useElementSize,s8 as useElementHover,o8 as useElementByPoint,u8 as useElementBounding,n2 as useDropZone,r2 as useDraggable,T4 as useDocumentVisibility,V2 as useDevicePixelRatio,C2 as useDeviceOrientation,P2 as useDeviceMotion,i6 as useDebouncedRefHistory,TJ as useDebouncedRef,T$ as useDebounceFn,b$ as useDebounce,M$ as useDateFormat,p9 as useDark,g6 as useCycleList,e8 as useCssVar,j6 as useCounter,x7 as useConfirmDialog,u9 as useColorMode,d6 as useCloned,Q4 as useClipboardItems,$4 as useClipboard,H6 as useClamp,Y6 as useCeil,w4 as useBrowserLocation,U8 as useBroadcastChannel,M4 as useBreakpoints,U2 as useBattery,O7 as useBase64,_6 as useAverage,n6 as useAsyncState,o6 as useAsyncQueue,fQ as useArrayUnique,vQ as useArraySome,hQ as useArrayReduce,gQ as useArrayMap,kQ as useArrayIncludes,wQ as useArrayFindIndex,yQ as useArrayFind,xQ as useArrayFilter,SQ as useArrayEvery,bQ as useArrayDifference,N7 as useAnimate,h2 as useActiveElement,W6 as useAbs,FQ as until,J2 as unrefElement,L as unref,UQ as tryOnUnmounted,IQ as tryOnScopeDispose,VQ as tryOnMounted,RQ as tryOnBeforeUnmount,jQ as tryOnBeforeMount,T as toValue,Y9 as throttledWatch,VJ as throttledRef,CQ as syncRefs,DQ as syncRef,x9 as setSSRHandler,OQ as resolveRef,VJ as refThrottled,zQ as refDefault,TJ as refDebounced,I9 as refAutoReset,K8 as pausableWatch,E6 as or,K6 as onStartTyping,Z6 as onLongPress,$6 as onKeyUp,RJ as onKeyStroke,J6 as onKeyDown,e4 as onClickOutside,N as noop,PQ as makeDestructurable,M9 as logicOr,C6 as logicNot,j as isRef,o7 as isDefined,M8 as ignorableWatch,S9 as getSSRHandler,YQ as formatTimeAgo,AQ as extendRef,T7 as executeTransition,O9 as eagerComputed,U as defaultWindow,FJ as defaultNavigator,a as defaultDocument,_9 as debouncedWatch,TJ as debouncedRef,y9 as customStorageEventName,TQ as createSharedComposable,EQ as createGlobalState,K$ as createFetch,JJ as createEventHook,O9 as computedEager,L9 as computedAsync,WQ as cloneFnJSON,_4 as breakpointsVuetify,B4 as breakpointsTailwind,F4 as breakpointsSematic,Y4 as breakpointsQuasar,H4 as breakpointsMasterCss,X4 as breakpointsBootstrapV5,Z9 as breakpointsBootstrap,W4 as breakpointsAntDesign,XQ as autoResetRef,L9 as asyncComputed,T6 as and,pJ as TransitionPresets};
2
+ function A(J){if(J&&typeof J==="object"&&"value"in J&&"subscribe"in J)return J.value;return J}function R(J){if(typeof J==="function")return J();return A(J)}function b(J){return J!==null&&typeof J==="object"&&"value"in J&&"subscribe"in J}function D(){}function x(){return typeof window<"u"?window:void 0}function JJ(){return typeof document<"u"?document:void 0}function NJ(){return typeof navigator<"u"?navigator:void 0}var nJ=new Map;function h9(J){return nJ.get(J)}function f9(J,Q){nJ.set(J,Q)}var v9="stx-storage";import{onUnmounted as m9,ref as p9,watch as d9}from"@stacksjs/stx";function $J(J,Q,Z,G){let $=Z??(typeof localStorage<"u"?localStorage:void 0),K=G?.serializer??{read:(M)=>{try{return JSON.parse(M)}catch{return M}},write:(M)=>JSON.stringify(M)},z=Q;if($)try{let M=$.getItem(J);if(M!==null)z=K.read(M)}catch{}let q=p9(z);if(d9(q,(M)=>{if(!$)return;try{if(M===null||M===void 0)$.removeItem(J);else $.setItem(J,K.write(M))}catch(B){let Y=B?.name??"",X=B?.message??String(B);if(Y==="QuotaExceededError"||/quota/i.test(X))console.warn(`[useStorage] ${J}: storage quota exceeded \u2014 value not persisted.`);else console.warn(`[useStorage] ${J}: failed to persist value \u2014 ${X}`)}}),typeof window<"u"){let M=(B)=>{if(B.key!==J||B.storageArea!==$)return;if(B.newValue===null)q.value=Q;else try{q.value=K.read(B.newValue)}catch{q.value=Q}};window.addEventListener("storage",M),m9(()=>window.removeEventListener("storage",M))}return q}function u9(J,Q,Z){return $J(J,Q,typeof localStorage<"u"?localStorage:void 0,Z)}function c9(J,Q,Z){return $J(J,Q,typeof sessionStorage<"u"?sessionStorage:void 0,Z)}import{onUnmounted as l9,ref as oJ,watch as i9}from"@stacksjs/stx";function aJ(){let J=oJ(!1);if(typeof window<"u"&&window.matchMedia){let Q=window.matchMedia("(prefers-color-scheme: dark)");J.value=Q.matches;let Z=(G)=>{J.value=G.matches};Q.addEventListener("change",Z);try{l9(()=>{Q.removeEventListener("change",Z)})}catch{}}return J}function r9(){let Q=aJ().value;if(typeof localStorage<"u"){let G=localStorage.getItem("color-scheme");if(G==="dark")Q=!0;else if(G==="light")Q=!1}let Z=oJ(Q);if(i9(Z,(G)=>{if(typeof document<"u")document.documentElement.classList.toggle("dark",G);if(typeof localStorage<"u")localStorage.setItem("color-scheme",G?"dark":"light")}),typeof document<"u")document.documentElement.classList.toggle("dark",Z.value);return Z}import{onUnmounted as s9,ref as OJ,watch as DJ}from"@stacksjs/stx";function n9(J={}){let{attribute:Q="class",initialValue:Z="auto",modes:G={},storageKey:$="color-mode",selector:K}=J,z=OJ("light");if(typeof window<"u"&&window.matchMedia){let X=window.matchMedia("(prefers-color-scheme: dark)");z.value=X.matches?"dark":"light";let W=(_)=>{z.value=_.matches?"dark":"light"};X.addEventListener("change",W);try{s9(()=>{X.removeEventListener("change",W)})}catch{}}let q=Z;if(typeof localStorage<"u"){let X=localStorage.getItem($);if(X)q=X}let M=OJ(q),B=OJ(M.value==="auto"?z.value:M.value);function Y(X){if(typeof document>"u")return;let W=K?document.querySelector(K):document.documentElement;if(!W)return;let _=G[X]??X;if(Q==="class"){let H=["dark","light",...Object.keys(G),...Object.values(G)];for(let F of H)W.classList.remove(F);if(_)W.classList.add(_)}else W.setAttribute(Q,_)}return DJ(M,(X)=>{if(typeof localStorage<"u")localStorage.setItem($,X);B.value=X==="auto"?z.value:X}),DJ(z,(X)=>{if(M.value==="auto")B.value=X}),DJ(B,(X)=>{Y(X)}),Y(B.value),{mode:B,system:z,store:M}}import{onUnmounted as o9,ref as a9}from"@stacksjs/stx";function t9(){let J=a9("no-preference");if(typeof window>"u"||!window.matchMedia)return J;let Q=window.matchMedia("(prefers-color-scheme: dark)"),Z=window.matchMedia("(prefers-color-scheme: light)");function G(){if(Q.matches)J.value="dark";else if(Z.matches)J.value="light";else J.value="no-preference"}G(),Q.addEventListener("change",G),Z.addEventListener("change",G);try{o9(()=>{Q.removeEventListener("change",G),Z.removeEventListener("change",G)})}catch{}return J}import{onUnmounted as e9,ref as J$}from"@stacksjs/stx";function $$(){let J=J$("no-preference");if(typeof window>"u"||!window.matchMedia)return J;let Q=window.matchMedia("(prefers-contrast: more)"),Z=window.matchMedia("(prefers-contrast: less)"),G=window.matchMedia("(prefers-contrast: custom)");function $(){if(Q.matches)J.value="more";else if(Z.matches)J.value="less";else if(G.matches)J.value="custom";else J.value="no-preference"}$(),Q.addEventListener("change",$),Z.addEventListener("change",$),G.addEventListener("change",$);try{e9(()=>{Q.removeEventListener("change",$),Z.removeEventListener("change",$),G.removeEventListener("change",$)})}catch{}return J}import{onUnmounted as Q$,ref as Z$}from"@stacksjs/stx";function G$(){let J=Z$("no-preference");if(typeof window>"u"||!window.matchMedia)return J;let Q=window.matchMedia("(prefers-reduced-motion: reduce)");function Z(){J.value=Q.matches?"reduce":"no-preference"}Z(),Q.addEventListener("change",Z);try{Q$(()=>{Q.removeEventListener("change",Z)})}catch{}return J}import{onUnmounted as K$,ref as z$}from"@stacksjs/stx";function q$(){let J=z$(typeof navigator<"u"?navigator.onLine:!0);if(typeof window<"u"){let Q=()=>{J.value=!0},Z=()=>{J.value=!1};window.addEventListener("online",Q),window.addEventListener("offline",Z);try{K$(()=>{window.removeEventListener("online",Q),window.removeEventListener("offline",Z)})}catch{}}return J}import{onUnmounted as tJ,ref as v}from"@stacksjs/stx";function M$(){let J=v(typeof navigator<"u"&&"connection"in navigator),Q=v(typeof navigator<"u"?navigator.onLine:!0),Z=v(void 0),G=v(void 0),$=v(void 0),K=v(void 0),z=v(void 0),q=v(void 0),M=v(void 0),B=v(void 0);function Y(){if(!J.value)return;let X=navigator.connection;if(X)$.value=X.downlink,K.value=X.downlinkMax,z.value=X.effectiveType,q.value=X.rtt,M.value=X.saveData,B.value=X.type}if(Y(),typeof window<"u"){let X=()=>{Q.value=!0,G.value=Date.now()},W=()=>{Q.value=!1,Z.value=Date.now()};window.addEventListener("online",X),window.addEventListener("offline",W);try{tJ(()=>{window.removeEventListener("online",X),window.removeEventListener("offline",W)})}catch{}if(J.value){let _=navigator.connection;if(_?.addEventListener){_.addEventListener("change",Y);try{tJ(()=>{_.removeEventListener("change",Y)})}catch{}}}}return{isSupported:J,isOnline:Q,offlineAt:Z,onlineAt:G,downlink:$,downlinkMax:K,effectiveType:z,rtt:q,saveData:M,type:B}}import{ref as X$}from"@stacksjs/stx";function B$(J=!1){let Q=typeof J==="boolean"?X$(J):J;function Z(G){if(typeof G==="boolean")Q.value=G;else Q.value=!Q.value;return Q.value}return[Q,Z]}import{ref as CJ}from"@stacksjs/stx";function PJ(J){let Q="GET",Z,G={get(){return Q="GET",Z=void 0,G},post($){return Q="POST",Z=$,G},patch($){return Q="PATCH",Z=$,G},put($){return Q="PUT",Z=$,G},delete(){return Q="DELETE",Z=void 0,G},json(){let $=CJ(null),K=CJ(null),z=CJ(!0),q={method:Q,headers:{Accept:"application/json"}};if(Z&&Q!=="GET"&&Q!=="DELETE")q.headers={...q.headers,"Content-Type":"application/json"},q.body=Z;let M={data:$,error:K},B=fetch(J,q).then(async(Y)=>{let X=await Y.json();if(Y.ok)$.value=X;else K.value=X}).catch((Y)=>{K.value=Y}).finally(()=>{z.value=!1});return{data:$,error:K,isFetching:z,then(Y){return B.then(()=>Y(M))}}}};return G}function W$(J={}){let{baseUrl:Q=""}=J;return function(Z){let G=Q?`${Q.replace(/\/$/,"")}/${Z.replace(/^\//,"")}`:Z;return PJ(G)}}import{ref as s}from"@stacksjs/stx";function QJ(J){if(J===null||typeof J!=="object")return JSON.stringify(J);if(Array.isArray(J))return`[${J.map(QJ).join(",")}]`;return`{${Object.keys(J).sort().map((Z)=>`${JSON.stringify(Z)}:${QJ(J[Z])}`).join(",")}}`}function eJ(J){return QJ(J)}function J9(J={}){let Q=new Map,Z=J.gcTime??300000,G=new Map;function $(X){return X.subscribers.size===0&&X.inflight===null}function K(X){let W=Q.get(X);if(W&&$(W))Q.delete(X);G.delete(X)}function z(X){let W=G.get(X);if(W)clearTimeout(W);if(!Number.isFinite(Z))return;if(Z<=0){K(X);return}let _=setTimeout(()=>K(X),Z);_.unref?.(),G.set(X,_)}function q(X){let W=G.get(X);if(W)clearTimeout(W),G.delete(X)}function M(X){let W=eJ(X),_=Q.get(W);if(!_)_={key:X,hash:W,data:void 0,error:null,updatedAt:0,status:"idle",inflight:null,invalidated:!1,subscribers:new Set},Q.set(W,_);return _}function B(X){let W=Q.get(X);if(!W)return;for(let _ of W.subscribers)_()}function Y(X,W){if(X.length>W.length)return!1;for(let _=0;_<X.length;_++)if(QJ(X[_])!==QJ(W[_]))return!1;return!0}return{get(X){let W=eJ(X);return Q.get(W)?.data},set(X,W){let _=M(X),H=typeof W==="function"?W(_.data):W;_.data=H,_.updatedAt=Date.now(),_.status="success",_.error=null,_.invalidated=!1,B(_.hash)},async invalidate(X){let W=Array.isArray(X)?(H)=>Y(X,H):X.predicate,_=[];for(let H of Q.values()){if(!W(H.key))continue;H.updatedAt=0,H.invalidated=!0;for(let F of H.subscribers){let L=F();if(L&&typeof L.then==="function")_.push(L)}}await Promise.all(_)},clear(){for(let X of G.values())clearTimeout(X);G.clear(),Q.clear()},gc(){let X=0;for(let[W,_]of Q)if($(_))Q.delete(W),q(W),X++;return X},_subscribe(X,W){let _=Q.get(X);if(!_)return()=>{};return q(X),_.subscribers.add(W),()=>{if(_.subscribers.delete(W),_.subscribers.size===0)z(X)}},_entry:M,_notify:B}}var $9=J9();function _$(J){let Q=J.client??$9,Z=J.staleTime??0,G=J.enabled??!0,$=Q._entry(J.queryKey),K=s($.data),z=s($.error),q=s($.data===void 0&&G),M=s(!1);function B(){if(K.value=$.data,z.value=$.error,M.value=$.status==="fetching",$.data!==void 0||$.error!==null)q.value=!1}async function Y(F){if(!F){if($.data!==void 0&&Date.now()-$.updatedAt<Z){B();return}}if($.inflight){try{await $.inflight}catch{}B();return}let L=new AbortController;if($.status="fetching",M.value=!0,$.data===void 0)q.value=!0;let C=J.queryFn({signal:L.signal}).then((U)=>{return $.data=U,$.error=null,$.updatedAt=Date.now(),$.status="success",$.invalidated=!1,U}).catch((U)=>{throw $.error=U instanceof Error?U:Error(String(U)),$.status="error",$.invalidated=!1,$.error}).finally(()=>{$.inflight=null,Q._notify($.hash)});$.inflight=C;try{await C}catch{}B()}let X=Q._subscribe($.hash,()=>{if($.invalidated&&G&&$.status!=="fetching")return Y(!0);B();return}),W=J.window??(typeof window<"u"?window:void 0),_=[];if(W&&G){let F=()=>{if($.status!=="fetching")Y(!1)};if(J.refetchOnFocus)_.push(["focus",F]);if(J.refetchOnReconnect)_.push(["online",F]);for(let[L,C]of _)W.addEventListener(L,C)}function H(){if(X(),W)for(let[F,L]of _)W.removeEventListener(F,L)}if(G)Y(!1);else B();return{data:K,error:z,isLoading:q,isFetching:M,refetch:()=>Y(!0),unsubscribe:H}}function Y$(J){let Q=s(void 0),Z=s(null),G=s(!1);async function $(K){G.value=!0,Z.value=null;let z;try{if(J.onMutate)z=await J.onMutate(K);let q=await J.mutationFn(K);return Q.value=q,await J.onSuccess?.(q,K,z),await J.onSettled?.(q,null,K,z),q}catch(q){let M=q instanceof Error?q:Error(String(q));throw Z.value=M,await J.onError?.(M,K,z),await J.onSettled?.(void 0,M,K,z),M}finally{G.value=!1}}return{data:Q,error:Z,isPending:G,mutate(K){$(K).catch(()=>{})},mutateAsync:$,reset(){Q.value=void 0,Z.value=null,G.value=!1}}}import{ref as n}from"@stacksjs/stx";function H$(J){let Q=J.validateOn??"submit",Z={...J.initialValues},G=n({...Z}),$=n({}),K=n({}),z=n({}),q=n(!1),M=n(!0),B=n(!1);function Y(O){if(O.valid)return"";if(Array.isArray(O.errors))return O.errors[0]?.message??"Invalid";for(let E of Object.values(O.errors))if(E.length>0)return E[0]?.message??"Invalid";return"Invalid"}function X(O){let E=J.schema?.[O];if(!E)return!0;let I=E.validate(G.value[O]),T=Y(I);if(T)return $.value={...$.value,[O]:T},M.value=!1,!1;if($.value[O]){let{[O]:P,...N}=$.value;$.value=N}return M.value=Object.keys($.value).length===0,!0}function W(O,E){if(G.value={...G.value,[O]:E},z.value={...z.value,[O]:E!==Z[O]},B.value=!0,Q==="change")X(O)}function _(O,E=!0){if(K.value={...K.value,[O]:E},E)B.value=!0}function H(O){let E=O,I=`${E}-error`,T=()=>{if(_(O,!0),Q==="blur"||Q==="change")X(O)};return{get value(){return G.value[O]},get error(){return $.value[E]??""},get touched(){return!!K.value[E]},get dirty(){return!!z.value[E]},errorId:I,setValue:(P)=>W(O,P),onBlur:T,validate:()=>X(O),inputProps:()=>{let P=!!$.value[E];return{name:E,value:G.value[O],onInput:(N)=>{let V=N&&typeof N==="object"&&"target"in N?N.target.value:N;W(O,V)},onBlur:T,"aria-invalid":P,"aria-describedby":P?I:void 0}}}}function F(){let O=!0;for(let E of Object.keys(J.schema??{}))if(!X(E))O=!1;return O}function L(O,E){$.value={...$.value,[O]:E},M.value=!1}function C(O){let E={...$.value},I=!1,T=Object.entries(O);for(let[P,N]of T){if(N==null)continue;let V=Array.isArray(N)?N[0]:N;if(V==null||V==="")continue;E[P]=V,I=!0}if($.value=E,I)M.value=!1}function U(O){if(O==null){$.value={},M.value=!0;return}let{[O]:E,...I}=$.value;$.value=I,M.value=Object.keys($.value).length===0}async function j(){let O={};for(let E of Object.keys(G.value))O[E]=!0;if(K.value=O,!F()){J.onError?.($.value);return}q.value=!0;try{await J.onSubmit(G.value)}catch(E){let I=E instanceof Error?E:Error(String(E));L("form",I.message),J.onError?.(I)}finally{q.value=!1}}function y(){G.value={...Z},$.value={},K.value={},z.value={},q.value=!1,M.value=!0,B.value=!1}function d(){return{type:"submit",disabled:q.value,"aria-busy":q.value}}function u(){for(let O of Object.keys(Z))if($.value[O])return O;return null}return{values:G,errors:$,touched:K,dirty:z,isSubmitting:q,isValid:M,isDirty:B,field:H,setValue:W,setError:L,setErrors:C,clearErrors:U,setTouched:_,validate:F,handleSubmit:j,reset:y,submitButtonProps:d,firstErrorField:u}}import{computed as F$,ref as A$}from"@stacksjs/stx";import{format as Q9}from"@stacksjs/datetime";function L$(J,Q){if(typeof J==="object"&&J!==null&&"value"in J&&"subscribe"in J)return F$(()=>{let G=J.value;return Q9(G instanceof Date?G:new Date(G),Q)});let Z=J instanceof Date?J:new Date(J);return A$(Q9(Z,Q))}import{onUnmounted as N$,ref as O$}from"@stacksjs/stx";function D$(J){let Q=J?.interval??1000,Z=O$(new Date),G=setInterval(()=>{Z.value=new Date},Q);try{N$(()=>clearInterval(G))}catch{}return Z}import{onUnmounted as C$,ref as P$}from"@stacksjs/stx";function E$(J={}){let{offset:Q=0,interval:Z=1000,immediate:G=!0}=J,$=P$(Date.now()+Q),K=null,z=null,q=!1;function M(){$.value=Date.now()+Q}function B(){if(K!==null)clearInterval(K),K=null;if(z!==null&&typeof cancelAnimationFrame<"u")cancelAnimationFrame(z),z=null;q=!1}function Y(){if(q)return;if(q=!0,M(),Z==="requestAnimationFrame"){if(typeof requestAnimationFrame<"u"){let X=()=>{if(!q)return;M(),z=requestAnimationFrame(X)};z=requestAnimationFrame(X)}}else K=setInterval(M,Z)}if(G)Y();try{C$(B)}catch{}return $}import{onUnmounted as U$,ref as j$}from"@stacksjs/stx";var EJ=1000,UJ=60*EJ,jJ=60*UJ,ZJ=24*jJ,Z9=7*ZJ,G9=30*ZJ,K9=365*ZJ;function T$(J){let Q=Math.abs(J);if(Q<5*EJ)return"just now";let Z=J<0,G,$;if(Q<UJ)G=Math.floor(Q/EJ),$="second";else if(Q<jJ)G=Math.floor(Q/UJ),$="minute";else if(Q<ZJ)G=Math.floor(Q/jJ),$="hour";else if(Q<Z9)G=Math.floor(Q/ZJ),$="day";else if(Q<G9)G=Math.floor(Q/Z9),$="week";else if(Q<K9)G=Math.floor(Q/G9),$="month";else G=Math.floor(Q/K9),$="year";let K=G!==1?"s":"";if(Z)return`in ${G} ${$}${K}`;return`${G} ${$}${K} ago`}function V$(J,Q={}){let{updateInterval:Z=30000}=Q;function G(){let q=R(J);if(q instanceof Date)return q.getTime();if(typeof q==="number")return q;return new Date(q).getTime()}function $(){let q=Date.now(),M=G(),B=q-M;return T$(B)}let K=j$($()),z=setInterval(()=>{K.value=$()},Z);try{U$(()=>clearInterval(z))}catch{}return K}import{onUnmounted as R$,watch as I$}from"@stacksjs/stx";function S$(J,Q,Z,G){let $=D,K=(q)=>{if(!q)return D;return q.addEventListener(Q,Z,G),()=>{q.removeEventListener(Q,Z,G)}};if(b(J))I$(J,(q,M)=>{$(),$=K(A(J))}),$=K(J.value);else $=K(J);let z=()=>{$(),$=D};try{R$(z)}catch{}return z}import{onUnmounted as b$}from"@stacksjs/stx";var TJ=new Map;function x$(J){if(!TJ.has(J))TJ.set(J,new Set);let Q=TJ.get(J),Z=[];function G(M){return Q.add(M),Z.push(M),()=>z(M)}function $(M){let B=(Y)=>{M(Y),z(B)};return G(B)}function K(M){for(let B of Q)B(M)}function z(M){Q.delete(M);let B=Z.indexOf(M);if(B!==-1)Z.splice(B,1)}function q(){Q.clear(),Z.length=0}try{b$(()=>{for(let M of Z)Q.delete(M);Z.length=0})}catch{}return{on:G,once:$,emit:K,off:z,reset:q}}function GJ(){let J=new Set;function Q($){return J.add($),{off:()=>J.delete($)}}function Z($){J.delete($)}function G($){for(let K of J)K($)}return{on:Q,off:Z,trigger:G}}function y$(J,Q=200){let Z=null,G=function(...$){if(Z!==null)clearTimeout(Z);Z=setTimeout(()=>{Z=null,J.apply(this,$)},Q)};return G.cancel=()=>{if(Z!==null)clearTimeout(Z),Z=null},G}function w$(J,Q=200){let Z=0,G=null,$=null,K=null,z=function(...q){let M=Date.now(),B=M-Z;if(B>=Q){if(Z=M,G!==null)clearTimeout(G),G=null;J.apply(this,q)}else if($=q,K=this,G===null)G=setTimeout(()=>{if(Z=Date.now(),G=null,$!==null)J.apply(K,$),$=null,K=null},Q-B)};return z.cancel=()=>{if(G!==null)clearTimeout(G),G=null;$=null,K=null},z}import{ref as z9,watch as k$}from"@stacksjs/stx";function VJ(J,Q=200){let Z=z9(J),G=z9(J),$=null;return k$(Z,(K)=>{if($!==null)clearTimeout($);$=setTimeout(()=>{G.value=K,$=null},Q)}),{get value(){return G.value},set value(K){Z.value=K},subscribe:G.subscribe}}import{ref as q9,watch as g$}from"@stacksjs/stx";function RJ(J,Q=200){let Z=q9(J),G=q9(J),$=0,K=null;return g$(Z,(z)=>{let q=Date.now(),M=q-$;if(M>=Q){if($=q,G.value=z,K!==null)clearTimeout(K),K=null}else if(K===null)K=setTimeout(()=>{$=Date.now(),G.value=Z.value,K=null},Q-M)}),{get value(){return G.value},set value(z){Z.value=z},subscribe:G.subscribe}}import{ref as h$,watch as f$}from"@stacksjs/stx";function v$(J,Q=200){let Z=h$(A(J)),G=null;if(b(J))f$(J,($)=>{if(G!==null)clearTimeout(G);G=setTimeout(()=>{Z.value=$,G=null},Q)});return Z}import{ref as m$,watch as p$}from"@stacksjs/stx";function d$(J,Q=200){let Z=m$(A(J)),G=0,$=null;if(b(J))p$(J,(K)=>{let z=Date.now(),q=z-G;if(q>=Q)Z.value=K,G=z;else{if($!==null)clearTimeout($);$=setTimeout(()=>{Z.value=J.value,G=Date.now(),$=null},Q-q)}});return Z}import{onUnmounted as u$,ref as c$}from"@stacksjs/stx";function l$(J=1000,Q={}){let{controls:Z=!1,immediate:G=!0}=Q,$=c$(0),K=null;function z(){if(K!==null)clearInterval(K),K=null}function q(){if(K!==null)return;K=setInterval(()=>{$.value++},J)}function M(){if($.value=0,z(),G)q()}if(G)q();try{u$(z)}catch{}if(Z)return{counter:$,pause:z,resume:q,reset:M};return $}import{onUnmounted as i$,ref as r$}from"@stacksjs/stx";function s$(J,Q=1000,Z={}){let{immediate:G=!0}=Z,$=r$(!1),K=null;function z(){if(K!==null)clearInterval(K),K=null;$.value=!1}function q(){if(K!==null)return;$.value=!0,K=setInterval(J,Q)}if(G)q();try{i$(z)}catch{}return{pause:z,resume:q,isActive:$}}import{onUnmounted as n$,ref as o$}from"@stacksjs/stx";function a$(J=1000,Q={}){let{controls:Z=!1,immediate:G=!0}=Q,$=o$(!1),K=null;function z(){if(K!==null)clearTimeout(K),K=null;$.value=!1}function q(){z(),K=setTimeout(()=>{$.value=!0,K=null},J)}if(G)q();try{n$(()=>{if(K!==null)clearTimeout(K),K=null})}catch{}if(Z)return{ready:$,start:q,stop:z};return $}import{onUnmounted as t$,ref as e$}from"@stacksjs/stx";function J6(J,Q=1000,Z={}){let{immediate:G=!0}=Z,$=e$(!1),K=null;function z(){if(K!==null)clearTimeout(K),K=null;$.value=!1}function q(){z(),$.value=!0,K=setTimeout(()=>{K=null,$.value=!1,J()},Q)}if(G)q();try{t$(z)}catch{}return{start:q,stop:z,isPending:$}}import{onUnmounted as $6,ref as Q6}from"@stacksjs/stx";function Z6(J,Q,Z){let{immediate:G=!0}=Z??{},$=Q6(!1),K=null;async function z(){if(!$.value)return;try{await J()}catch{}if($.value)K=setTimeout(z,Q)}function q(){if($.value)return;$.value=!0,z()}function M(){if($.value=!1,K!==null)clearTimeout(K),K=null}if(G)q();try{$6(()=>M())}catch{}return{isActive:$,pause:M,resume:q}}import{onUnmounted as G6,ref as K6}from"@stacksjs/stx";function z6(J,Q={}){let{immediate:Z=!0}=Q,G=K6(!1),$=null,K=0;function z(B){if(!G.value)return;let Y=K?B-K:0;K=B,J({delta:Y,timestamp:B}),$=requestAnimationFrame(z)}function q(){if(G.value)return;if(typeof requestAnimationFrame>"u")return;G.value=!0,K=0,$=requestAnimationFrame(z)}function M(){if(!G.value)return;if(G.value=!1,$!==null&&typeof cancelAnimationFrame<"u")cancelAnimationFrame($),$=null}if(Z)q();try{G6(M)}catch{}return{pause:M,resume:q,isActive:G}}import{onUnmounted as q6,ref as M6}from"@stacksjs/stx";function X6(J=10){let Q=M6(0);if(typeof requestAnimationFrame>"u")return Q;let Z=performance.now(),G=0,$;function K(){if(G++,G>=J){let z=performance.now(),q=z-Z;Q.value=Math.round(G/q*1000),Z=z,G=0}$=requestAnimationFrame(K)}$=requestAnimationFrame(K);try{q6(()=>cancelAnimationFrame($))}catch{}return Q}import{ref as IJ}from"@stacksjs/stx";function B6(J){let{source:Q,copiedDuring:Z=1500}=J??{},G=NJ(),$=IJ(!!G&&"clipboard"in G),K=IJ(""),z=IJ(!1),q;async function M(B){if(!$.value)return;let Y=B??(Q!==void 0?R(Q):void 0);if(Y===void 0)return;try{if(await G.clipboard.writeText(Y),K.value=Y,z.value=!0,q)clearTimeout(q);q=setTimeout(()=>{z.value=!1},Z)}catch{}}return{text:K,isSupported:$,copied:z,copy:M}}import{ref as M9}from"@stacksjs/stx";function W6(){let J=M9(typeof navigator<"u"&&"clipboard"in navigator&&typeof ClipboardItem<"u"),Q=M9([]);async function Z($){if(J.value)await navigator.clipboard.write($),Q.value=$}async function G(){if(J.value)Q.value=await navigator.clipboard.read()}return{isSupported:J,content:Q,copy:Z,read:G}}import{onUnmounted as _6,ref as Y6}from"@stacksjs/stx";function H6(J){let Q=x(),Z=Y6(!1);if(!Q||!Q.matchMedia)return Z;let G=R(J),$=Q.matchMedia(G);Z.value=$.matches;let K=(z)=>{Z.value=z.matches};$.addEventListener("change",K);try{_6(()=>{$.removeEventListener("change",K)})}catch{}return Z}import{computed as a,ref as F6,onUnmounted as A6}from"@stacksjs/stx";function L6(J){let Q=x(),Z=F6(Q?Q.innerWidth:0);function G(){if(Q)Z.value=Q.innerWidth}if(Q){Q.addEventListener("resize",G);try{A6(()=>{Q.removeEventListener("resize",G)})}catch{}}function $(X){return J[X]}function K(X){return a(()=>Z.value>=$(X))}function z(X){return a(()=>Z.value<=$(X))}function q(X,W){return a(()=>Z.value>=$(X)&&Z.value<$(W))}function M(X){return a(()=>Z.value>$(X))}function B(X){return a(()=>Z.value<$(X))}function Y(){return a(()=>{return Object.keys(J).sort((W,_)=>J[W]-J[_]).filter((W)=>Z.value>=J[W])})}return{greaterOrEqual:K,smallerOrEqual:z,between:q,isGreater:M,isSmaller:B,current:Y}}var N6={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},X9={sm:576,md:768,lg:992,xl:1200,xxl:1400},O6=X9,D6={xs:480,sm:576,md:768,lg:992,xl:1200,xxl:1600},C6={xs:600,sm:960,md:1264,lg:1904},P6={xs:600,sm:1024,md:1440,lg:1920},E6={"3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560},U6={mobileS:320,mobileM:375,mobileL:425,tablet:768,laptop:1024,laptopL:1440,desktop:2560};import{ref as j6,watch as T6}from"@stacksjs/stx";function V6(J){let Q=JJ(),Z=J!==void 0?R(J):Q?.title??"",G=j6(Z);if(Q&&J!==void 0)Q.title=G.value;return T6(G,($)=>{if(Q)Q.title=$}),G}import{ref as R6,watch as I6}from"@stacksjs/stx";function S6(J){let Q=R6(R(J??null));function Z(G){if(typeof document>"u"||!G)return;let $=document.querySelector('link[rel*="icon"]');if(!$)$=document.createElement("link"),$.rel="icon",$.type="image/x-icon",document.head.appendChild($);$.href=G}return I6(Q,(G)=>{Z(G)}),Z(Q.value),Q}import{onUnmounted as b6,ref as x6}from"@stacksjs/stx";function y6(){let J=x6(typeof document<"u"?document.visibilityState:"visible");if(typeof document>"u")return J;let Q=()=>{J.value=document.visibilityState};document.addEventListener("visibilitychange",Q,{passive:!0});try{b6(()=>{document.removeEventListener("visibilitychange",Q)})}catch{}return J}import{ref as w6,watch as k6}from"@stacksjs/stx";function g6(J,Q){let Z=J??(typeof document<"u"?document.documentElement:null),G=Q??"ltr";if(Z){let K=Z.getAttribute("dir");if(K==="rtl"||K==="ltr"||K==="auto")G=K}let $=w6(G);return k6($,(K)=>{if(Z)Z.setAttribute("dir",K)}),$}import{onUnmounted as h6,ref as SJ}from"@stacksjs/stx";function f6(){let J=SJ(""),Q=SJ([]),Z=SJ(null);if(typeof document>"u")return{text:J,ranges:Q,selection:Z};let G=()=>{let $=document.getSelection();if(Z.value=$,$&&$.rangeCount>0){J.value=$.toString();let K=[];for(let z=0;z<$.rangeCount;z++)K.push($.getRangeAt(z));Q.value=K}else J.value="",Q.value=[]};document.addEventListener("selectionchange",G,{passive:!0});try{h6(()=>{document.removeEventListener("selectionchange",G)})}catch{}return{text:J,ranges:Q,selection:Z}}import{onUnmounted as v6,ref as m6}from"@stacksjs/stx";function p6(J="history",Q){let Z=x(),{initialValue:G}=Q??{};function $(){if(!Z)return{...G};let Y="";if(J==="hash"){let _=Z.location.hash,H=_.indexOf("?");Y=H>=0?_.slice(H+1):""}else Y=Z.location.search.slice(1);let X={...G};return new URLSearchParams(Y).forEach((_,H)=>{X[H]=_}),X}let K=m6($());function z(){if(!Z)return;let Y=new URLSearchParams;for(let[W,_]of Object.entries(K.value))if(_!==void 0&&_!==null&&_!=="")Y.set(W,_);let X=Y.toString();if(J==="hash"){let W=Z.location.hash.split("?")[0]||"#";Z.location.hash=X?`${W}?${X}`:W}else{let W=X?`${Z.location.pathname}?${X}`:Z.location.pathname;Z.history.replaceState(Z.history.state,"",W)}}function q(Y){return K.value[Y]??null}function M(Y,X){let W={...K.value};W[Y]=X,K.value=W,z()}function B(Y){let X={...K.value};delete X[Y],K.value=X,z()}if(Z){let Y=()=>{K.value=$()},X=()=>{if(J==="hash")K.value=$()};Z.addEventListener("popstate",Y),Z.addEventListener("hashchange",X),v6(()=>{Z.removeEventListener("popstate",Y),Z.removeEventListener("hashchange",X)})}return{params:K,get:q,set:M,delete:B}}import{onUnmounted as d6,ref as c}from"@stacksjs/stx";function u6(){let J=x();function Q(){if(!J)return{href:"",protocol:"",host:"",hostname:"",port:"",pathname:"",search:"",hash:"",origin:""};return{href:J.location.href,protocol:J.location.protocol,host:J.location.host,hostname:J.location.hostname,port:J.location.port,pathname:J.location.pathname,search:J.location.search,hash:J.location.hash,origin:J.location.origin}}let Z=Q(),G=c(Z.href),$=c(Z.protocol),K=c(Z.host),z=c(Z.hostname),q=c(Z.port),M=c(Z.pathname),B=c(Z.search),Y=c(Z.hash),X=c(Z.origin);function W(){let _=Q();G.value=_.href,$.value=_.protocol,K.value=_.host,z.value=_.hostname,q.value=_.port,M.value=_.pathname,B.value=_.search,Y.value=_.hash,X.value=_.origin}if(J){J.addEventListener("popstate",W),J.addEventListener("hashchange",W);try{d6(()=>{J.removeEventListener("popstate",W),J.removeEventListener("hashchange",W)})}catch{}}return{href:G,protocol:$,host:K,hostname:z,port:q,pathname:M,search:B,hash:Y,origin:X}}import{onUnmounted as c6,ref as B9}from"@stacksjs/stx";function l6(J){let{initialWidth:Q=0,initialHeight:Z=0,listenOrientation:G=!0}=J??{},$=x(),K=B9($?$.innerWidth:Q),z=B9($?$.innerHeight:Z);function q(){if($)K.value=$.innerWidth,z.value=$.innerHeight}if($){if($.addEventListener("resize",q),G)$.addEventListener("orientationchange",q);try{c6(()=>{if($.removeEventListener("resize",q),G)$.removeEventListener("orientationchange",q)})}catch{}}return{width:K,height:z}}import{onUnmounted as i6,ref as r6}from"@stacksjs/stx";function s6(){let J=r6(typeof document<"u"?document.hasFocus():!1);if(typeof window>"u")return J;let Q=()=>{J.value=!0},Z=()=>{J.value=!1};window.addEventListener("focus",Q,{passive:!0}),window.addEventListener("blur",Z,{passive:!0});try{i6(()=>{window.removeEventListener("focus",Q),window.removeEventListener("blur",Z)})}catch{}return J}import{onUnmounted as n6,ref as W9}from"@stacksjs/stx";function o6(){let J=W9(typeof window<"u"?window.scrollX:0),Q=W9(typeof window<"u"?window.scrollY:0);if(typeof window>"u")return{x:J,y:Q};let Z=()=>{J.value=window.scrollX,Q.value=window.scrollY};window.addEventListener("scroll",Z,{passive:!0});try{n6(()=>{window.removeEventListener("scroll",Z)})}catch{}return{x:J,y:Q}}import{onUnmounted as a6,ref as k}from"@stacksjs/stx";function t6(J,Q){let{throttle:Z=0,offset:G={}}=Q??{},$=G.top??0,K=G.bottom??0,z=G.left??0,q=G.right??0,M=k(0),B=k(0),Y=k(!1),X=k(!0),W=k(!1),_=k(!0),H=k(!1),F=k(!1),L=k(!1),C=k(!1),U=k(!1),j,y=0,d=0,u,O=!1;function E(P){if(typeof window<"u"&&P===window||"innerHeight"in P&&"scrollX"in P){let V=P,sJ=typeof document<"u"?document:void 0;return{scrollLeft:V.scrollX??V.pageXOffset??0,scrollTop:V.scrollY??V.pageYOffset??0,scrollHeight:sJ?.documentElement?.scrollHeight??0,scrollWidth:sJ?.documentElement?.scrollWidth??0,clientHeight:V.innerHeight,clientWidth:V.innerWidth}}if(typeof document<"u"&&P===document||"documentElement"in P){let V=P.documentElement;return{scrollLeft:V.scrollLeft,scrollTop:V.scrollTop,scrollHeight:V.scrollHeight,scrollWidth:V.scrollWidth,clientHeight:V.clientHeight,clientWidth:V.clientWidth}}let N=P;return{scrollLeft:N.scrollLeft,scrollTop:N.scrollTop,scrollHeight:N.scrollHeight,scrollWidth:N.scrollWidth,clientHeight:N.clientHeight,clientWidth:N.clientWidth}}function I(){let P=J?A(J):typeof window<"u"?window:null;if(!P)return;let N=E(P);if(F.value=N.scrollTop<d,L.value=N.scrollTop>d,C.value=N.scrollLeft<y,U.value=N.scrollLeft>y,y=N.scrollLeft,d=N.scrollTop,M.value=N.scrollLeft,B.value=N.scrollTop,X.value=N.scrollTop<=$,_.value=N.scrollLeft<=z,W.value=N.scrollTop+N.clientHeight>=N.scrollHeight-K,H.value=N.scrollLeft+N.clientWidth>=N.scrollWidth-q,Y.value=!0,j)clearTimeout(j);j=setTimeout(()=>{Y.value=!1},150)}function T(){if(Z>0){if(!O)I(),O=!0,u=setTimeout(()=>{O=!1},Z)}else I()}if(typeof window<"u"){let P=J?A(J):window;if(P){let N=E(P);M.value=N.scrollLeft,B.value=N.scrollTop,y=N.scrollLeft,d=N.scrollTop,X.value=N.scrollTop<=$,_.value=N.scrollLeft<=z,W.value=N.scrollTop+N.clientHeight>=N.scrollHeight-K,H.value=N.scrollLeft+N.clientWidth>=N.scrollWidth-q,P.addEventListener("scroll",T,{passive:!0});try{a6(()=>{if(P.removeEventListener("scroll",T),j)clearTimeout(j);if(u)clearTimeout(u)})}catch{}}}return{x:M,y:B,isScrolling:Y,arrivedState:{top:X,bottom:W,left:_,right:H},directions:{top:F,bottom:L,left:C,right:U}}}import{onUnmounted as e6,ref as J8,watch as $8}from"@stacksjs/stx";function Q8(J){let Q=J8(!1),Z="";function G(){if(J)return A(J);if(typeof document<"u")return document.body;return null}function $(){let z=G();if(!z)return;Z=z.style.overflow,z.style.overflow="hidden"}function K(){let z=G();if(!z)return;z.style.overflow=Z}$8(Q,(z)=>{if(z)$();else K()});try{e6(()=>{if(Q.value)K()})}catch{}return Q}import{onUnmounted as Z8,ref as G8}from"@stacksjs/stx";function K8(J,Q,Z={}){let{distance:G=100,direction:$="bottom"}=Z,K=G8(!1),z=!0,q=async()=>{if(!z||K.value)return;let B=A(J);if(!B)return;let Y=!1;if(B===window||B===document.documentElement){let X=window.scrollY||document.documentElement.scrollTop,W=document.documentElement.scrollHeight,_=window.innerHeight;if($==="bottom")Y=W-X-_<=G;else if($==="top")Y=X<=G}else{let X=B;if($==="bottom")Y=X.scrollHeight-X.scrollTop-X.clientHeight<=G;else if($==="top")Y=X.scrollTop<=G;else if($==="right")Y=X.scrollWidth-X.scrollLeft-X.clientWidth<=G;else if($==="left")Y=X.scrollLeft<=G}if(Y){K.value=!0;try{await Q()}finally{K.value=!1}}},M=A(J);if(M){let B=M===document.documentElement?window:M;B.addEventListener("scroll",q,{passive:!0});try{Z8(()=>{z=!1,B.removeEventListener("scroll",q)})}catch{}}return{isLoading:K}}import{onUnmounted as z8,ref as _9}from"@stacksjs/stx";function q8(J){let Q=JJ(),Z=_9(!1),G=_9(!!Q&&(("fullscreenEnabled"in Q)||("webkitFullscreenEnabled"in Q)));function $(){if(J)return A(J);return Q?.documentElement??null}function K(){if(!Q)return null;return Q.fullscreenElement??Q.webkitFullscreenElement??null}function z(){Z.value=K()!==null}async function q(){if(!G.value)return;let Y=$();if(!Y)return;try{if(Y.requestFullscreen)await Y.requestFullscreen();else if(Y.webkitRequestFullscreen)await Y.webkitRequestFullscreen();Z.value=!0}catch{}}async function M(){if(!G.value||!Q)return;try{if(Q.exitFullscreen)await Q.exitFullscreen();else if(Q.webkitExitFullscreen)await Q.webkitExitFullscreen();Z.value=!1}catch{}}async function B(){if(Z.value)await M();else await q()}if(Q){let Y=()=>z();Q.addEventListener("fullscreenchange",Y),Q.addEventListener("webkitfullscreenchange",Y);try{z8(()=>{Q.removeEventListener("fullscreenchange",Y),Q.removeEventListener("webkitfullscreenchange",Y)})}catch{}}return{isFullscreen:Z,isSupported:G,enter:q,exit:M,toggle:B}}function M8(J,Q,Z){let G=x();if(!G)return()=>{};let{ignore:$=[]}=Z??{};function K(q){let M=A(J);if(!M)return;let B=q,Y=B.composedPath?.()??[];if(M===B.target||Y.includes(M)||M.contains(B.target))return;for(let X of $){let W=A(X);if(W&&(W===B.target||Y.includes(W)||W.contains(B.target)))return}Q(B)}return G.addEventListener("pointerdown",K,{passive:!0}),()=>{G.removeEventListener("pointerdown",K)}}function bJ(J,Q,Z){let{eventName:G="keydown",target:$}=Z??{},K=x(),z=$?A($):K;if(!z)return()=>{};function q(X){if(typeof X==="function")return X;if(typeof X==="string")return(W)=>W.key===X;if(Array.isArray(X))return(W)=>X.includes(W.key);return()=>!0}let M=q(J);function B(X){let W=X;if(M(W))Q(W)}return z.addEventListener(G,B),()=>{z.removeEventListener(G,B)}}function X8(J,Q,Z){return bJ(J,Q,{...Z,eventName:"keydown"})}function B8(J,Q,Z){return bJ(J,Q,{...Z,eventName:"keyup"})}import{onUnmounted as W8}from"@stacksjs/stx";function _8(J,Q,Z={}){let{delay:G=500,distanceThreshold:$=10}=Z,K=null,z=0,q=0,M=A(J);if(!M)return()=>{};let B=()=>{if(K!==null)clearTimeout(K),K=null},Y=(H)=>{z=H.clientX,q=H.clientY,B(),K=setTimeout(()=>Q(H),G)},X=(H)=>{if(K===null)return;let F=Math.abs(H.clientX-z),L=Math.abs(H.clientY-q);if(F>$||L>$)B()},W=()=>{B()};M.addEventListener("pointerdown",Y),M.addEventListener("pointermove",X),M.addEventListener("pointerup",W),M.addEventListener("pointercancel",W);let _=()=>{B(),M.removeEventListener("pointerdown",Y),M.removeEventListener("pointermove",X),M.removeEventListener("pointerup",W),M.removeEventListener("pointercancel",W)};try{W8(_)}catch{}return _}import{onUnmounted as Y8}from"@stacksjs/stx";function H8(J){if(typeof document>"u")return()=>{};let Q=(G)=>{let $=document.activeElement;if($){let K=$.tagName.toLowerCase();if(K==="input"||K==="textarea"||$.isContentEditable)return}if(G.key.length===1&&!G.ctrlKey&&!G.metaKey&&!G.altKey)J(G)};document.addEventListener("keydown",Q);let Z=()=>{document.removeEventListener("keydown",Q)};try{Y8(Z)}catch{}return Z}import{onUnmounted as F8,ref as A8}from"@stacksjs/stx";function L8(J){let Q=A8(!1);if(typeof window>"u")return Q;let Z=(G)=>{Q.value=G.getModifierState(J)};window.addEventListener("keydown",Z,{passive:!0}),window.addEventListener("keyup",Z,{passive:!0}),window.addEventListener("mousedown",Z,{passive:!0}),window.addEventListener("mouseup",Z,{passive:!0});try{F8(()=>{window.removeEventListener("keydown",Z),window.removeEventListener("keyup",Z),window.removeEventListener("mousedown",Z),window.removeEventListener("mouseup",Z)})}catch{}return Q}import{onUnmounted as N8,ref as Y9}from"@stacksjs/stx";function O8(){let J=Y9(new Set),Q=new Map;function Z($){let K=$.toLowerCase();if(!Q.has(K))Q.set(K,Y9(!1));return Q.get(K)}function G(){for(let[$,K]of Q)if($.includes("+")){let z=$.split("+").map((q)=>q.trim().toLowerCase());K.value=z.every((q)=>J.value.has(q))}}if(typeof window<"u"){let $=(z)=>{let q=z.key.toLowerCase();J.value.add(q),J.value=new Set(J.value);let M=Z(q);if(M.value=!0,z.ctrlKey)Z("ctrl").value=!0,J.value.add("ctrl");if(z.shiftKey)Z("shift").value=!0,J.value.add("shift");if(z.altKey)Z("alt").value=!0,J.value.add("alt");if(z.metaKey)Z("meta").value=!0,J.value.add("meta");G()},K=(z)=>{let q=z.key.toLowerCase();J.value.delete(q),J.value=new Set(J.value);let M=Z(q);if(M.value=!1,!z.ctrlKey)Z("ctrl").value=!1,J.value.delete("ctrl");if(!z.shiftKey)Z("shift").value=!1,J.value.delete("shift");if(!z.altKey)Z("alt").value=!1,J.value.delete("alt");if(!z.metaKey)Z("meta").value=!1,J.value.delete("meta");G()};window.addEventListener("keydown",$,{passive:!0}),window.addEventListener("keyup",K,{passive:!0});try{N8(()=>{window.removeEventListener("keydown",$),window.removeEventListener("keyup",K)})}catch{}}return new Proxy({current:J},{get($,K){if(K==="current")return J;return Z(K)}})}import{computed as w}from"@stacksjs/stx";function S(J){if(J&&typeof J==="object"&&"value"in J&&"subscribe"in J)return J.value;return J}function D8(J){return w(()=>Math.abs(S(J)))}function C8(...J){return w(()=>{let Q=J.map(S);return Q.length?Q.reduce((Z,G)=>Z+G,0)/Q.length:0})}function P8(J){return w(()=>Math.ceil(S(J)))}function E8(J,Q,Z){return w(()=>Math.min(S(Z),Math.max(S(Q),S(J))))}function U8(J){return w(()=>Math.floor(S(J)))}function j8(...J){return w(()=>Math.max(...J.map(S)))}function T8(...J){return w(()=>Math.min(...J.map(S)))}function V8(J,Q=0){return w(()=>Number(S(J).toFixed(Math.max(0,Math.min(100,S(Q))))))}function R8(J){return w(()=>Math.round(S(J)))}function I8(...J){return w(()=>J.map(S).reduce((Q,Z)=>Q+Z,0))}function S8(J){return w(()=>Math.trunc(S(J)))}function b8(J){return w(()=>!S(J))}function H9(...J){return w(()=>J.some((Q)=>S(Q)))}var x8=H9;function y8(...J){return w(()=>J.every((Q)=>S(Q)))}import{ref as w8}from"@stacksjs/stx";function k8(J=0,Q={}){let{min:Z=-1/0,max:G=1/0}=Q;function $(X){return Math.min(G,Math.max(Z,X))}let K=w8($(J));function z(X=1){return K.value=$(K.value+X),K.value}function q(X=1){return K.value=$(K.value-X),K.value}function M(X){return K.value=$(X),K.value}function B(X=J){return K.value=$(X),K.value}function Y(){return K.value}return{count:K,inc:z,dec:q,set:M,reset:B,get:Y}}import{ref as g8,watch as h8}from"@stacksjs/stx";function f8(J,Q){let Z=g8(Q);return h8(J,(G,$)=>{Z.value=$}),Z}import{ref as v8,watch as m8}from"@stacksjs/stx";function p8(J,Q={}){let{initialValue:Z=null}=Q,G=v8(Z);return m8(J,()=>{G.value=Date.now()}),G}import{computed as xJ,ref as F9}from"@stacksjs/stx";function d8(J,Q){let Z=F9([...J]),G=Q!==void 0?J.indexOf(Q):0,$=F9(G>=0?G:0),K=xJ(()=>Z.value[$.value]),z=xJ(()=>$.value===0),q=xJ(()=>$.value===Z.value.length-1);function M(){if($.value<Z.value.length-1)$.value++}function B(){if($.value>0)$.value--}function Y(F){let L=Z.value.indexOf(F);if(L>=0)$.value=L}function X(F){if(F>=0&&F<Z.value.length)$.value=F}function W(F){let L=Z.value.indexOf(F);return L>=0&&$.value<L}function _(F){let L=Z.value.indexOf(F);return L>=0&&$.value>L}function H(F){return Z.value[$.value]===F}return{steps:Z,current:K,index:$,isFirst:z,isLast:q,next:M,previous:B,goTo:Y,goToIndex:X,isBefore:W,isAfter:_,isCurrent:H}}import{computed as u8,ref as c8}from"@stacksjs/stx";function l8(J,Q={}){let Z=J.length;if(Z===0)throw Error("useCycleList requires a non-empty list");let G=Q.initialValue!==void 0?J.indexOf(Q.initialValue):0,$=c8(G>=0?G:0);function K(X){return J[X]}let z=u8(()=>K($.value));function q(X){return(X%Z+Z)%Z}function M(X=1){return $.value=q($.value+X),K($.value)}function B(X=1){return $.value=q($.value-X),K($.value)}function Y(X){return $.value=q(X),K($.value)}return{state:z,index:$,next:M,prev:B,go:Y}}import{computed as i8}from"@stacksjs/stx";function r8(J,Q){return i8(()=>{let Z=[...A(J)];if(Q)return Z.sort(Q);return Z.sort()})}import{ref as s8,watch as n8}from"@stacksjs/stx";function o8(J){if(typeof structuredClone==="function")return structuredClone(J);return JSON.parse(JSON.stringify(J))}function a8(J,Q={}){let Z=Q.clone??o8,G=s8(Z(J.value));function $(){G.value=Z(J.value)}return n8(J,()=>{$()}),{cloned:G,sync:$}}import{computed as yJ,ref as A9}from"@stacksjs/stx";function KJ(J,Q){if(!Q)return J;if(typeof structuredClone==="function")return structuredClone(J);return JSON.parse(JSON.stringify(J))}function zJ(J,Q={}){let{capacity:Z=1/0,clone:G=!1}=Q,$=A9([{snapshot:KJ(J.value,G),timestamp:Date.now()}]),K=A9([]),z=yJ(()=>$.value.length>1),q=yJ(()=>K.value.length>0),M=yJ(()=>{return $.value[$.value.length-1]});function B(){let _={snapshot:KJ(J.value,G),timestamp:Date.now()};if($.value=[...$.value,_],Z!==1/0&&$.value.length>Z)$.value=$.value.slice($.value.length-Z);K.value=[]}function Y(){if($.value.length<=1)return;let _=$.value[$.value.length-1],H=$.value.slice(0,-1);if($.value=H,_)K.value=[...K.value,_];let F=H[H.length-1];if(!F)return;J.value=KJ(F.snapshot,G)}function X(){if(K.value.length===0)return;let _=K.value[K.value.length-1];if(K.value=K.value.slice(0,-1),_)$.value=[...$.value,_];if(!_)return;J.value=KJ(_.snapshot,G)}function W(){$.value=[{snapshot:KJ(J.value,G),timestamp:Date.now()}],K.value=[]}return{history:$,commit:B,undo:Y,redo:X,canUndo:z,canRedo:q,clear:W,last:M}}import{computed as wJ,ref as L9,watch as t8}from"@stacksjs/stx";function qJ(J,Q){if(!Q)return J;if(typeof structuredClone==="function")return structuredClone(J);return JSON.parse(JSON.stringify(J))}function e8(J,Q={}){let{capacity:Z=1/0,deep:G=!1,clone:$=!1}=Q,K=L9([{snapshot:qJ(J.value,$),timestamp:Date.now()}]),z=L9([]),q=!1,M=wJ(()=>K.value.length>1),B=wJ(()=>z.value.length>0),Y=wJ(()=>{return K.value[K.value.length-1]});function X(){let F={snapshot:qJ(J.value,$),timestamp:Date.now()};if(K.value=[...K.value,F],Z!==1/0&&K.value.length>Z)K.value=K.value.slice(K.value.length-Z);z.value=[]}function W(){if(K.value.length<=1)return;q=!0;let F=K.value[K.value.length-1],L=K.value.slice(0,-1);if(K.value=L,F)z.value=[...z.value,F];let C=L[L.length-1];if(C)J.value=qJ(C.snapshot,$);q=!1}function _(){if(z.value.length===0)return;q=!0;let F=z.value[z.value.length-1];if(z.value=z.value.slice(0,-1),F)K.value=[...K.value,F],J.value=qJ(F.snapshot,$);q=!1}function H(){K.value=[{snapshot:qJ(J.value,$),timestamp:Date.now()}],z.value=[]}return t8(J,()=>{if(!q)X()},{deep:G}),{history:K,commit:X,undo:W,redo:_,canUndo:M,canRedo:B,clear:H,last:Y}}import{watch as J4}from"@stacksjs/stx";function $4(J,Q){let Z=Q?.debounce??200,{history:G,commit:$,undo:K,redo:z,canUndo:q,canRedo:M,clear:B,last:Y}=zJ(J,Q),X=null,W=!1;J4(J,()=>{if(W){W=!1;return}if(X!==null)clearTimeout(X);X=setTimeout(()=>{X=null,$()},Z)});let _=K,H=z;function F(){if(X!==null)clearTimeout(X),X=null;W=!0,_()}function L(){if(X!==null)clearTimeout(X),X=null;W=!0,H()}return{history:G,commit:$,undo:F,redo:L,canUndo:q,canRedo:M,clear:B,last:Y}}import{watch as Q4}from"@stacksjs/stx";function Z4(J,Q){let Z=Q?.throttle??200,{history:G,commit:$,undo:K,redo:z,canUndo:q,canRedo:M,clear:B,last:Y}=zJ(J,Q),X=0,W=null,_=!1;Q4(J,()=>{if(_){_=!1;return}let U=Date.now();if(U-X>=Z)X=U,$();else{if(W!==null)clearTimeout(W);W=setTimeout(()=>{W=null,X=Date.now(),$()},Z-(U-X))}});let H=K,F=z;function L(){if(W!==null)clearTimeout(W),W=null;_=!0,H()}function C(){if(W!==null)clearTimeout(W),W=null;_=!0,F()}return{history:G,commit:$,undo:L,redo:C,canUndo:q,canRedo:M,clear:B,last:Y}}import{ref as YJ}from"@stacksjs/stx";function G4(J,Q,Z={}){let{immediate:G=!0,onError:$,resetOnExecute:K=!0,delay:z=0}=Z,q=YJ(Q),M=YJ(!1),B=YJ(!1),Y=YJ(void 0);async function X(W){let _=W??z;if(K)q.value=Q;if(Y.value=void 0,M.value=!1,B.value=!0,_>0)await new Promise((H)=>setTimeout(H,_));try{let H=typeof J==="function"?await J():await J;return q.value=H,M.value=!0,H}catch(H){if(Y.value=H,$)$(H);return q.value}finally{B.value=!1}}if(G)X();return{state:q,isReady:M,isLoading:B,error:Y,execute:X}}import{ref as kJ}from"@stacksjs/stx";function K4(J){let Q=kJ(-1),Z=kJ(!1),G=kJ(J.map(()=>({state:"pending"})));async function $(){for(let K=0;K<J.length;K++){Q.value=K;let z=J[K];if(!z)continue;try{let q=await z();G.value=G.value.map((M,B)=>B===K?{state:"fulfilled",data:q}:M)}catch(q){G.value=G.value.map((M,B)=>B===K?{state:"rejected",data:q}:M)}}Q.value=J.length,Z.value=!0}return $(),{activeIndex:Q,result:G,isFinished:Z}}import{watch as z4}from"@stacksjs/stx";function q4(J,Q){return z4(J,(G)=>{if(G)Q(G)})}import{watch as M4}from"@stacksjs/stx";function X4(J,Q){let Z=!1,G=M4(J,($)=>{if(Z)return;Z=!0,G(),Q($)});return()=>{if(!Z)Z=!0,G()}}import{watch as B4}from"@stacksjs/stx";function N9(J,Q,Z){let G=Z?.debounce??200,$=null,K=B4(J,(z)=>{if($!==null)clearTimeout($);$=setTimeout(()=>{$=null,Q(z)},G)});return()=>{if($!==null)clearTimeout($),$=null;K()}}import{watch as W4}from"@stacksjs/stx";function O9(J,Q,Z){let G=Z?.throttle??200,$=0,K=null,z,q=!1,M=W4(J,(B)=>{let Y=Date.now(),X=Y-$;if(X>=G){if($=Y,K!==null)clearTimeout(K),K=null;q=!1,Q(B)}else if(z=B,q=!0,K===null)K=setTimeout(()=>{if($=Date.now(),K=null,q)q=!1,Q(z)},G-X)});return()=>{if(K!==null)clearTimeout(K),K=null;q=!1,M()}}import{ref as _4,watch as Y4}from"@stacksjs/stx";function D9(J,Q){let Z=_4(!0),G,$=Y4(J,(q)=>{if(Z.value)Q(q,G);G=q});function K(){Z.value=!1}function z(){Z.value=!0}return{stop:$,pause:K,resume:z,isActive:Z}}var H4=D9;import{ref as F4,watch as A4}from"@stacksjs/stx";function C9(J,Q){let Z=F4(!1),G,$=A4(J,(z)=>{if(!Z.value)Q(z,G);G=z});function K(z){Z.value=!0,z(),Promise.resolve().then(()=>{Z.value=!1})}return{stop:$,ignoreUpdates:K,isIgnoring:Z}}var L4=C9;import{watch as N4}from"@stacksjs/stx";function O4(J,Q){let Z=[...J.value];return N4(J,($)=>{let K=[...$],z=K.filter((M)=>!Z.includes(M)),q=Z.filter((M)=>!K.includes(M));Q(K,Z,z,q),Z=K})}import{ref as D4,watch as C4}from"@stacksjs/stx";function P4(J,Q,Z){let G=D4(Z),$=C4(J,(K)=>{if(G.value>0){if(G.value--,Q(K),G.value<=0)$()}});return{stop:$,remaining:G}}import{watch as E4}from"@stacksjs/stx";function U4(J,Q,Z){let G=JSON.stringify(J.value);if(Z?.immediate)Q(J.value);return E4(J,(K)=>{let z=JSON.stringify(K);if(z!==G)G=z,Q(K)})}import{watch as j4}from"@stacksjs/stx";function T4(J,Q){return Q(J.value),j4(J,(Z)=>{Q(Z)})}import{watch as V4}from"@stacksjs/stx";function R4(J,Q){let Z=V4(J,($)=>{Q($)});function G(){Q(J.value)}return{stop:Z,trigger:G}}import{watch as I4}from"@stacksjs/stx";function S4(J,Q,Z){return I4(J,($)=>{Z(()=>Q($))})}import{onUnmounted as b4,ref as gJ}from"@stacksjs/stx";function x4(J,Q={}){let{onConnected:Z,onDisconnected:G,onError:$,onMessage:K,immediate:z=!0,autoReconnect:q=!1,heartbeat:M=!1,protocols:B}=Q,Y=gJ(null),X=gJ("CLOSED"),W=gJ(null),_=0,H=null,F=null,L=!1,C=typeof M==="object"?M.interval??30000:30000,U=typeof M==="object"?M.message??"ping":"ping",j=typeof q==="object"?q.retries??3:q?1/0:0,y=typeof q==="object"?q.delay??1000:1000;function d(T){if(u(),!M)return;F=setInterval(()=>{if(T.readyState===WebSocket.OPEN)T.send(U)},C)}function u(){if(F!==null)clearInterval(F),F=null}function O(){if(typeof WebSocket>"u")return;E(),L=!1,_=0;let T=R(J);X.value="CONNECTING";let P=B?new WebSocket(T,B):new WebSocket(T);W.value=P,P.onopen=()=>{X.value="OPEN",_=0,d(P),Z?.(P)},P.onclose=(N)=>{if(X.value="CLOSED",W.value=null,u(),G?.(P,N),!L&&q&&_<j)_++,H=setTimeout(()=>{O()},y)},P.onerror=(N)=>{$?.(P,N)},P.onmessage=(N)=>{Y.value=typeof N.data==="string"?N.data:String(N.data),K?.(P,N)}}function E(T,P){if(L=!0,u(),H!==null)clearTimeout(H),H=null;let N=W.value;if(N){if(N.readyState===WebSocket.OPEN||N.readyState===WebSocket.CONNECTING)X.value="CLOSING",N.close(T,P);W.value=null}}function I(T){let P=W.value;if(P&&P.readyState===WebSocket.OPEN)P.send(T)}if(z)O();try{b4(()=>{E()})}catch{}return{data:Y,status:X,ws:W,open:O,close:E,send:I}}import{onUnmounted as y4,ref as MJ}from"@stacksjs/stx";function w4(J,Q=[],Z={}){let{withCredentials:G=!1,immediate:$=!0}=Z,K=MJ(null),z=MJ(null),q=MJ("CLOSED"),M=MJ(null),B=MJ(null),Y=[];function X(){let _=B.value;if(_){for(let{eventName:H,handler:F}of Y)_.removeEventListener(H,F);Y=[],_.close(),B.value=null,q.value="CLOSED"}}function W(){if(typeof EventSource>"u")return;X();let _=R(J);q.value="CONNECTING";let H=new EventSource(_,{withCredentials:G});B.value=H,H.onopen=()=>{q.value="OPEN",M.value=null},H.onerror=(L)=>{if(M.value=L,H.readyState===EventSource.CLOSED)q.value="CLOSED";else q.value="CONNECTING"};let F=(L)=>{let C=L;K.value=C.data,z.value="message"};H.addEventListener("message",F),Y.push({eventName:"message",handler:F});for(let L of Q){let C=(U)=>{let j=U;K.value=j.data,z.value=L};H.addEventListener(L,C),Y.push({eventName:L,handler:C})}}if($)W();try{y4(()=>{X()})}catch{}return{data:K,event:z,status:q,error:M,eventSource:B,close:X,open:W}}import{onUnmounted as k4,ref as XJ}from"@stacksjs/stx";function g4(J){let Q=XJ(typeof BroadcastChannel<"u"),Z=XJ(void 0),G=XJ(null),$=XJ(null),K=XJ(!1);if(Q.value){let M=new BroadcastChannel(J);Z.value=M,M.onmessage=(B)=>{G.value=B.data},M.onmessageerror=(B)=>{$.value=B};try{k4(()=>{M.close(),K.value=!0})}catch{}}function z(M){if(Z.value&&!K.value)Z.value.postMessage(M)}function q(){if(Z.value&&!K.value)Z.value.close(),K.value=!0}return{isSupported:Q,channel:Z,data:G,error:$,post:z,close:q,isClosed:K}}import{ref as h4,watch as f4}from"@stacksjs/stx";function P9(J,Q,Z){let G=h4(Q),$=0;async function K(){let z=++$;try{let q=await J();if(z===$)G.value=q}catch{}}if(K(),Z&&Z.length>0)for(let z of Z)f4(z,()=>{K()});return G}import{ref as v4,watch as m4}from"@stacksjs/stx";function E9(J,Q){let Z=v4(J());if(Q&&Q.length>0)for(let G of Q)m4(G,()=>{Z.value=J()});return Z}import{onUnmounted as p4,ref as d4}from"@stacksjs/stx";function hJ(J,Q,Z){let G=d4(typeof window<"u"&&"IntersectionObserver"in window),$=D;(()=>{if($(),!G.value)return;let q=A(J);if(!q)return;let M=new IntersectionObserver(Q,Z);M.observe(q),$=()=>{M.disconnect(),$=D}})();let z=()=>{$()};try{p4(z)}catch{}return{isSupported:G,stop:z}}import{onUnmounted as u4,ref as c4}from"@stacksjs/stx";function l4(J,Q,Z){let G=c4(typeof window<"u"&&"ResizeObserver"in window),$=D;(()=>{if($(),!G.value)return;let q=A(J);if(!q)return;let M=new ResizeObserver(Q);M.observe(q,Z),$=()=>{M.disconnect(),$=D}})();let z=()=>{$()};try{u4(z)}catch{}return{isSupported:G,stop:z}}import{onUnmounted as i4,ref as r4}from"@stacksjs/stx";function s4(J,Q,Z){let G=r4(typeof window<"u"&&"MutationObserver"in window),$=D;(()=>{if($(),!G.value)return;let q=A(J);if(!q)return;let M=new MutationObserver(Q);M.observe(q,Z??{childList:!0,subtree:!0}),$=()=>{M.disconnect(),$=D}})();let z=()=>{$()};try{i4(z)}catch{}return{isSupported:G,stop:z}}import{onUnmounted as n4,ref as U9}from"@stacksjs/stx";function o4(J,Q){let Z=U9(Q?.initialSize?.width??0),G=U9(Q?.initialSize?.height??0),$=typeof window<"u"&&"ResizeObserver"in window,K=D;if($){let q=A(J);if(q){let M=new ResizeObserver((B)=>{for(let Y of B)if(Y.contentBoxSize){let X=Array.isArray(Y.contentBoxSize)?Y.contentBoxSize[0]:Y.contentBoxSize;Z.value=X.inlineSize,G.value=X.blockSize}else Z.value=Y.contentRect.width,G.value=Y.contentRect.height});M.observe(q),K=()=>{M.disconnect(),K=D}}}let z=()=>{K()};try{n4(z)}catch{}return{width:Z,height:G,stop:z}}import{onUnmounted as a4,ref as i}from"@stacksjs/stx";function t4(J){let Q=i(0),Z=i(0),G=i(0),$=i(0),K=i(0),z=i(0),q=i(0),M=i(0),B=[],Y=D,X=()=>{let W=A(J);if(!W)return;let _=W.getBoundingClientRect();Q.value=_.x,Z.value=_.y,G.value=_.top,$.value=_.right,K.value=_.bottom,z.value=_.left,q.value=_.width,M.value=_.height};if(typeof window<"u"){X();let W=()=>X();window.addEventListener("resize",W,{passive:!0}),B.push(()=>window.removeEventListener("resize",W));let _=()=>X();if(window.addEventListener("scroll",_,{passive:!0}),B.push(()=>window.removeEventListener("scroll",_)),"ResizeObserver"in window){let H=A(J);if(H){let F=new ResizeObserver(X);F.observe(H),B.push(()=>F.disconnect())}}if("MutationObserver"in window){let H=A(J);if(H){let F=new MutationObserver(X);F.observe(H,{childList:!0,subtree:!0,attributes:!0}),B.push(()=>F.disconnect())}}Y=()=>{for(let H of B)H();B.length=0,Y=D}}try{a4(()=>Y())}catch{}return{x:Q,y:Z,top:G,right:$,bottom:K,left:z,width:q,height:M,update:X}}import{ref as e4}from"@stacksjs/stx";function J7(J){let Q=e4(!1);return hJ(J,(Z)=>{for(let G of Z)Q.value=G.isIntersecting},{threshold:0}),Q}import{onUnmounted as $7,ref as Q7}from"@stacksjs/stx";function Z7(J){let Q=Q7(!1),Z=()=>{};function G($){if(Z(),!$)return;let K=()=>{Q.value=!0},z=()=>{Q.value=!1};$.addEventListener("mouseenter",K,{passive:!0}),$.addEventListener("mouseleave",z,{passive:!0}),Z=()=>{$.removeEventListener("mouseenter",K),$.removeEventListener("mouseleave",z),Z=()=>{}}}G(A(J));try{$7(()=>Z())}catch{}return Q}import{onUnmounted as G7,ref as fJ}from"@stacksjs/stx";function K7(J){let Q=J?.x??fJ(0),Z=J?.y??fJ(0),G=fJ(null);if(typeof document>"u")return{element:G,x:Q,y:Z};let $=(K)=>{Q.value=K.clientX,Z.value=K.clientY,G.value=document.elementFromPoint(K.clientX,K.clientY)};document.addEventListener("mousemove",$,{passive:!0});try{G7(()=>{document.removeEventListener("mousemove",$)})}catch{}return{element:G,x:Q,y:Z}}import{ref as z7,watch as q7}from"@stacksjs/stx";function M7(J,Q,Z){let G=z7(Z??""),$=()=>{let z=A(Q);if(z)return z;if(typeof document<"u")return document.documentElement;return null},K=$();if(K){let z=getComputedStyle(K).getPropertyValue(A(J)).trim();if(z)G.value=z}return q7(G,(z)=>{let q=$();if(q)q.style.setProperty(A(J),z)}),G}function X7(J){let Q=A(J);if(!Q)return Q;if(Q.$el)return Q.$el;return Q}import{onUnmounted as B7,ref as vJ}from"@stacksjs/stx";function W7(J){let Q=J?.type??"page",Z=J?.touch??!0,G=J?.initialValue??{x:0,y:0},$=vJ(G.x),K=vJ(G.y),z=vJ(null),q=D;if(typeof window<"u"){let M=[],B=(X)=>{switch(Q){case"page":return{x:X.pageX,y:X.pageY};case"client":return{x:X.clientX,y:X.clientY};case"screen":return{x:X.screenX,y:X.screenY};default:return{x:X.pageX,y:X.pageY}}},Y=(X)=>{let W=B(X);$.value=W.x,K.value=W.y,z.value="mouse"};if(window.addEventListener("mousemove",Y,{passive:!0}),M.push(()=>window.removeEventListener("mousemove",Y)),Z){let X=(W)=>{if(W.touches.length>0){let _=W.touches[0];if(!_)return;switch(Q){case"page":$.value=_.pageX,K.value=_.pageY;break;case"client":$.value=_.clientX,K.value=_.clientY;break;case"screen":$.value=_.screenX,K.value=_.screenY;break}z.value="touch"}};window.addEventListener("touchstart",X,{passive:!0}),window.addEventListener("touchmove",X,{passive:!0}),M.push(()=>{window.removeEventListener("touchstart",X),window.removeEventListener("touchmove",X)})}q=()=>{for(let X of M)X();M.length=0,q=D}}try{B7(()=>q())}catch{}return{x:$,y:K,sourceType:z}}import{onUnmounted as _7,ref as l}from"@stacksjs/stx";function Y7(J){let Q=l(0),Z=l(0),G=l(0),$=l(0),K=l(0),z=l(0),q=l(0),M=l(0),B=l(!0);if(typeof window>"u")return{x:Q,y:Z,elementX:G,elementY:$,elementPositionX:K,elementPositionY:z,elementHeight:q,elementWidth:M,isOutside:B};let Y=(X)=>{Q.value=X.pageX,Z.value=X.pageY;let W=A(J);if(!W){B.value=!0;return}let _=W.getBoundingClientRect();K.value=_.left+window.scrollX,z.value=_.top+window.scrollY,q.value=_.height,M.value=_.width,G.value=X.pageX-K.value,$.value=X.pageY-z.value,B.value=G.value<0||$.value<0||G.value>M.value||$.value>q.value};window.addEventListener("mousemove",Y,{passive:!0});try{_7(()=>{window.removeEventListener("mousemove",Y)})}catch{}return{x:Q,y:Z,elementX:G,elementY:$,elementPositionX:K,elementPositionY:z,elementHeight:q,elementWidth:M,isOutside:B}}import{onUnmounted as H7,ref as j9}from"@stacksjs/stx";function F7(J){let Q=j9(!1),Z=j9(null);if(typeof window>"u")return{pressed:Q,sourceType:Z};let G=A(J)??window,$=()=>{Q.value=!0,Z.value="mouse"},K=()=>{Q.value=!0,Z.value="touch"},z=()=>{Q.value=!1};G.addEventListener("mousedown",$,{passive:!0}),G.addEventListener("touchstart",K,{passive:!0}),window.addEventListener("mouseup",z,{passive:!0}),window.addEventListener("touchend",z,{passive:!0}),window.addEventListener("touchcancel",z,{passive:!0});try{H7(()=>{G.removeEventListener("mousedown",$),G.removeEventListener("touchstart",K),window.removeEventListener("mouseup",z),window.removeEventListener("touchend",z),window.removeEventListener("touchcancel",z)})}catch{}return{pressed:Q,sourceType:Z}}import{onUnmounted as A7,ref as r}from"@stacksjs/stx";function L7(J){let Q=r(0),Z=r(0),G=r(0),$=r(0),K=r(0),z=r(0),q=r(""),M=r(!1);if(typeof window>"u")return{isInside:M,x:Q,y:Z,pointerId:G,pressure:$,tiltX:K,tiltY:z,pointerType:q};let B=J??window,Y=(_)=>{Q.value=_.pageX,Z.value=_.pageY,G.value=_.pointerId,$.value=_.pressure,K.value=_.tiltX,z.value=_.tiltY,q.value=_.pointerType},X=()=>{M.value=!0},W=()=>{M.value=!1};B.addEventListener("pointermove",Y,{passive:!0}),B.addEventListener("pointerdown",Y,{passive:!0}),B.addEventListener("pointerenter",X,{passive:!0}),B.addEventListener("pointerleave",W,{passive:!0});try{A7(()=>{B.removeEventListener("pointermove",Y),B.removeEventListener("pointerdown",Y),B.removeEventListener("pointerenter",X),B.removeEventListener("pointerleave",W)})}catch{}return{isInside:M,x:Q,y:Z,pointerId:G,pressure:$,tiltX:K,tiltY:z,pointerType:q}}import{onUnmounted as N7,ref as HJ}from"@stacksjs/stx";function O7(J,Q={}){let{threshold:Z=50,onSwipe:G,onSwipeStart:$,onSwipeEnd:K,passive:z=!0}=Q,q=HJ(!1),M=HJ("none"),B=HJ(0),Y=HJ(0),X=0,W=0;if(typeof window>"u")return{isSwiping:q,direction:M,lengthX:B,lengthY:Y};let _=A(J)??window,H=(C)=>{let U=C.touches[0];if(!U)return;X=U.clientX,W=U.clientY,q.value=!0,M.value="none",B.value=0,Y.value=0,$?.(C)},F=(C)=>{if(!q.value)return;let U=C.touches[0];if(!U)return;B.value=U.clientX-X,Y.value=U.clientY-W;let j=Math.abs(B.value),y=Math.abs(Y.value);if(j>y)M.value=B.value>0?"right":"left";else if(y>j)M.value=Y.value>0?"down":"up"},L=(C)=>{if(!q.value)return;q.value=!1;let U=Math.abs(B.value),j=Math.abs(Y.value);if(Math.max(U,j)>=Z)G?.(M.value),K?.(C,M.value);else M.value="none",K?.(C,"none")};_.addEventListener("touchstart",H,{passive:z}),_.addEventListener("touchmove",F,{passive:z}),_.addEventListener("touchend",L,{passive:z}),_.addEventListener("touchcancel",L,{passive:z});try{N7(()=>{_.removeEventListener("touchstart",H),_.removeEventListener("touchmove",F),_.removeEventListener("touchend",L),_.removeEventListener("touchcancel",L)})}catch{}return{isSwiping:q,direction:M,lengthX:B,lengthY:Y}}import{onUnmounted as D7,ref as t}from"@stacksjs/stx";function C7(J,Q={}){let{threshold:Z=50,onSwipe:G,onSwipeEnd:$}=Q,K=t(!1),z=t("none"),q=t(0),M=t(0),B=t({x:0,y:0}),Y=t({x:0,y:0});if(typeof window>"u")return{isSwiping:K,direction:z,distanceX:q,distanceY:M,posStart:B,posEnd:Y};let X=A(J);if(!X)return{isSwiping:K,direction:z,distanceX:q,distanceY:M,posStart:B,posEnd:Y};let W=(F)=>{K.value=!0,z.value="none",B.value={x:F.clientX,y:F.clientY},Y.value={x:F.clientX,y:F.clientY},q.value=0,M.value=0,X.setPointerCapture(F.pointerId)},_=(F)=>{if(!K.value)return;Y.value={x:F.clientX,y:F.clientY},q.value=Y.value.x-B.value.x,M.value=Y.value.y-B.value.y;let L=Math.abs(q.value),C=Math.abs(M.value);if(L>C)z.value=q.value>0?"right":"left";else if(C>L)z.value=M.value>0?"down":"up"},H=(F)=>{if(!K.value)return;if(K.value=!1,Math.max(Math.abs(q.value),Math.abs(M.value))>=Z)G?.(z.value),$?.(F,z.value);else z.value="none",$?.(F,"none")};X.addEventListener("pointerdown",W),X.addEventListener("pointermove",_),X.addEventListener("pointerup",H);try{D7(()=>{X.removeEventListener("pointerdown",W),X.removeEventListener("pointermove",_),X.removeEventListener("pointerup",H)})}catch{}return{isSwiping:K,direction:z,distanceX:q,distanceY:M,posStart:B,posEnd:Y}}import{onUnmounted as P7,ref as mJ}from"@stacksjs/stx";function E7(J){let Q=mJ(typeof document<"u"&&"pointerLockElement"in document),Z=mJ(!1),G=mJ(null);if(typeof document<"u"){let z=()=>{Z.value=!!document.pointerLockElement,G.value=document.pointerLockElement};document.addEventListener("pointerlockchange",z),document.addEventListener("pointerlockerror",z);try{P7(()=>{document.removeEventListener("pointerlockchange",z),document.removeEventListener("pointerlockerror",z)})}catch{}}async function $(z){if(!Q.value)return;let q=z??A(J);if(q)await q.requestPointerLock()}function K(){if(!Q.value)return;if(document.pointerLockElement)document.exitPointerLock()}return{isSupported:Q,isLocked:Z,lock:$,unlock:K,element:G}}import{onUnmounted as U7,ref as pJ}from"@stacksjs/stx";function j7(J,Q={}){let Z=pJ(0),G=pJ(0),$=pJ("mouse");if(typeof window>"u")return{tilt:Z,roll:G,source:$};let K=(q)=>{let M=A(J);if(!M)return;let B=M.getBoundingClientRect(),Y=B.left+B.width/2,X=B.top+B.height/2;Z.value=(q.clientX-Y)/(B.width/2)*0.5,G.value=(q.clientY-X)/(B.height/2)*0.5,$.value="mouse"};window.addEventListener("mousemove",K,{passive:!0});let z=(q)=>{if(q.gamma!==null&&q.beta!==null){let M=q.gamma/90,B=(q.beta-45)/90;Z.value=Q.deviceOrientationTiltAdjust?.(M)??M*0.5,G.value=Q.deviceOrientationRollAdjust?.(B)??B*0.5,$.value="deviceOrientation"}};window.addEventListener("deviceorientation",z,{passive:!0});try{U7(()=>{window.removeEventListener("mousemove",K),window.removeEventListener("deviceorientation",z)})}catch{}return{tilt:Z,roll:G,source:$}}import{onUnmounted as T7,ref as m}from"@stacksjs/stx";function V7(J){let{immediate:Q=!0,...Z}=J??{},G=m(typeof navigator<"u"&&"geolocation"in navigator),$={latitude:m(null),longitude:m(null),accuracy:m(null),altitude:m(null),altitudeAccuracy:m(null),heading:m(null),speed:m(null)},K=m(null),z=m(null),q=null,M=D,B=(_)=>{$.latitude.value=_.coords.latitude,$.longitude.value=_.coords.longitude,$.accuracy.value=_.coords.accuracy,$.altitude.value=_.coords.altitude,$.altitudeAccuracy.value=_.coords.altitudeAccuracy,$.heading.value=_.coords.heading,$.speed.value=_.coords.speed,K.value=_.timestamp,z.value=null},Y=(_)=>{z.value=_},X=()=>{if(!G.value)return;if(q!==null)return;q=navigator.geolocation.watchPosition(B,Y,Z),M=()=>{if(q!==null)navigator.geolocation.clearWatch(q),q=null;M=D}},W=()=>{M()};if(Q)X();try{T7(W)}catch{}return{coords:$,locatedAt:K,error:z,isSupported:G,pause:W,resume:X}}import{onUnmounted as R7,ref as g}from"@stacksjs/stx";function I7(){let J=g(typeof window<"u"&&"DeviceMotionEvent"in window),Q={x:g(null),y:g(null),z:g(null)},Z={x:g(null),y:g(null),z:g(null)},G={alpha:g(null),beta:g(null),gamma:g(null)},$=g(0),K=D;if(typeof window<"u"&&J.value){let z=(q)=>{if(q.acceleration)Q.x.value=q.acceleration.x,Q.y.value=q.acceleration.y,Q.z.value=q.acceleration.z;if(q.accelerationIncludingGravity)Z.x.value=q.accelerationIncludingGravity.x,Z.y.value=q.accelerationIncludingGravity.y,Z.z.value=q.accelerationIncludingGravity.z;if(q.rotationRate)G.alpha.value=q.rotationRate.alpha,G.beta.value=q.rotationRate.beta,G.gamma.value=q.rotationRate.gamma;$.value=q.interval};window.addEventListener("devicemotion",z,{passive:!0}),K=()=>{window.removeEventListener("devicemotion",z),K=D}}try{R7(()=>K())}catch{}return{acceleration:Q,accelerationIncludingGravity:Z,rotationRate:G,interval:$,isSupported:J}}import{onUnmounted as S7,ref as BJ}from"@stacksjs/stx";function b7(){let J=BJ(typeof window<"u"&&"DeviceOrientationEvent"in window),Q=BJ(null),Z=BJ(null),G=BJ(null),$=BJ(!1),K=D;if(typeof window<"u"&&J.value){let z=(q)=>{Q.value=q.alpha,Z.value=q.beta,G.value=q.gamma,$.value=q.absolute};window.addEventListener("deviceorientation",z,{passive:!0}),K=()=>{window.removeEventListener("deviceorientation",z),K=D}}try{S7(()=>K())}catch{}return{alpha:Q,beta:Z,gamma:G,absolute:$,isSupported:J}}import{onUnmounted as x7,ref as y7}from"@stacksjs/stx";function w7(){let J=y7(typeof window<"u"?window.devicePixelRatio:1);if(typeof window>"u")return{pixelRatio:J};let Q=null,Z=()=>{};function G(){Z(),Q=window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);let $=()=>{J.value=window.devicePixelRatio,G()};Q.addEventListener("change",$,{once:!0}),Z=()=>{Q?.removeEventListener("change",$)}}G();try{x7(()=>Z())}catch{}return{pixelRatio:J}}import{onUnmounted as k7,ref as WJ}from"@stacksjs/stx";function g7(){let J=typeof navigator<"u"?navigator:void 0,Q=WJ(!!J?.getBattery),Z=WJ(!1),G=WJ(0),$=WJ(0),K=WJ(1),z=[],q=D;if(Q.value&&J?.getBattery)J.getBattery().then((M)=>{let B=()=>{Z.value=M.charging,G.value=M.chargingTime,$.value=M.dischargingTime,K.value=M.level};B(),M.addEventListener("chargingchange",B),M.addEventListener("chargingtimechange",B),M.addEventListener("dischargingtimechange",B),M.addEventListener("levelchange",B),z.push(()=>{M.removeEventListener("chargingchange",B),M.removeEventListener("chargingtimechange",B),M.removeEventListener("dischargingtimechange",B),M.removeEventListener("levelchange",B)}),q=()=>{for(let Y of z)Y();z.length=0,q=D}}).catch(()=>{Q.value=!1});try{k7(()=>q())}catch{}return{charging:Z,chargingTime:G,dischargingTime:$,level:K,isSupported:Q}}import{onUnmounted as h7,ref as f7,watch as v7}from"@stacksjs/stx";function m7(J,Q={}){let{initialValue:Z=!1}=Q,G=f7(Z),$=()=>{};function K(q){if($(),!q)return;let M=()=>{G.value=!0},B=()=>{G.value=!1};if(q.addEventListener("focus",M,{passive:!0}),q.addEventListener("blur",B,{passive:!0}),$=()=>{q.removeEventListener("focus",M),q.removeEventListener("blur",B),$=()=>{}},document.activeElement===q)G.value=!0;if(Z)q.focus()}let z=A(J);K(z),v7(G,(q)=>{let M=A(J);if(!M)return;if(q)M.focus();else M.blur()});try{h7(()=>$())}catch{}return{focused:G}}import{onUnmounted as p7,ref as d7}from"@stacksjs/stx";function u7(J){let Q=d7(!1),Z=()=>{};function G($){if(Z(),!$)return;let K=()=>{Q.value=!0},z=(q)=>{if(!$.contains(q.relatedTarget))Q.value=!1};$.addEventListener("focusin",K,{passive:!0}),$.addEventListener("focusout",z),Z=()=>{$.removeEventListener("focusin",K),$.removeEventListener("focusout",z),Z=()=>{}}}G(A(J));try{p7(()=>Z())}catch{}return{focused:Q}}import{onUnmounted as c7,ref as l7}from"@stacksjs/stx";function i7(){let J=l7(null);if(typeof document>"u")return J;J.value=document.activeElement;let Q=()=>{J.value=document.activeElement};document.addEventListener("focusin",Q,{passive:!0}),document.addEventListener("focusout",Q,{passive:!0});try{c7(()=>{document.removeEventListener("focusin",Q),document.removeEventListener("focusout",Q)})}catch{}return J}import{onUnmounted as r7,ref as T9}from"@stacksjs/stx";var s7=["mousemove","mousedown","resize","keydown","touchstart","wheel"];function n7(J=60000,Q){let Z=Q?.events??s7,G=Q?.initialState??!1,$=T9(G),K=T9(Date.now()),z=null,q=D;if(typeof window<"u"){let M=[],B=()=>{if($.value=!1,K.value=Date.now(),z!==null)clearTimeout(z);z=setTimeout(()=>{$.value=!0},J)};for(let Y of Z)window.addEventListener(Y,B,{passive:!0}),M.push(()=>window.removeEventListener(Y,B));z=setTimeout(()=>{$.value=!0},J),q=()=>{for(let Y of M)Y();if(M.length=0,z!==null)clearTimeout(z),z=null;q=D}}try{r7(()=>q())}catch{}return{idle:$,lastActive:K}}import{onUnmounted as o7,ref as a7}from"@stacksjs/stx";function t7(){let J=a7(!1),Q=D;if(typeof document<"u"){let Z=[],G=(K)=>{if(K.clientY<=0||K.clientX<=0||K.clientX>=(typeof window<"u"?window.innerWidth:0)||K.clientY>=(typeof window<"u"?window.innerHeight:0))J.value=!0},$=()=>{J.value=!1};document.documentElement.addEventListener("mouseleave",G),document.documentElement.addEventListener("mouseenter",$),Z.push(()=>document.documentElement.removeEventListener("mouseleave",G),()=>document.documentElement.removeEventListener("mouseenter",$)),Q=()=>{for(let K of Z)K();Z.length=0,Q=D}}try{o7(()=>Q())}catch{}return J}import{ref as e7}from"@stacksjs/stx";function J2(){let J=e7(!1);return Promise.resolve().then(()=>{J.value=!0}),J}import{onUnmounted as $2,ref as FJ}from"@stacksjs/stx";function Q2(J,Q){let Z=Q?.initialValue?.x??0,G=Q?.initialValue?.y??0,$=FJ(Z),K=FJ(G),z=FJ(!1),q=FJ(`left: ${Z}px; top: ${G}px;`),M=D;if(typeof window<"u"){let B=[],Y=0,X=0,W=0,_=0,H=()=>{q.value=`left: ${$.value}px; top: ${K.value}px;`},F=(j)=>{if(!z.value)return;if($.value=j.clientX-W,K.value=j.clientY-_,H(),Q?.onMove)Q.onMove({x:$.value,y:K.value},j)},L=(j)=>{if(!z.value)return;if(z.value=!1,Q?.onEnd)Q.onEnd({x:$.value,y:K.value},j);window.removeEventListener("pointermove",F),window.removeEventListener("pointerup",L)},C=(j)=>{let y={x:$.value,y:K.value};if(Q?.onStart){if(Q.onStart(y,j)===!1)return}Y=j.clientX,X=j.clientY,W=Y-$.value,_=X-K.value,z.value=!0,window.addEventListener("pointermove",F),window.addEventListener("pointerup",L)},U=A(J);if(U)U.addEventListener("pointerdown",C),B.push(()=>U.removeEventListener("pointerdown",C));M=()=>{for(let j of B)j();B.length=0,window.removeEventListener("pointermove",F),window.removeEventListener("pointerup",L),M=D}}try{$2(()=>M())}catch{}return{x:$,y:K,isDragging:z,style:q}}import{onUnmounted as Z2,ref as V9}from"@stacksjs/stx";function G2(J,Q){let Z=V9(!1),G=V9(null),$=D,K=0;if(typeof window<"u"){let z=A(J);if(z){let q=[],M=(W)=>{W.preventDefault(),K++,Z.value=!0},B=(W)=>{W.preventDefault(),Z.value=!0},Y=(W)=>{if(W.preventDefault(),K--,K<=0)K=0,Z.value=!1},X=(W)=>{W.preventDefault(),K=0,Z.value=!1;let _=W.dataTransfer?.files;if(_&&_.length>0)G.value=Array.from(_);else G.value=null;if(Q)Q(G.value)};z.addEventListener("dragenter",M),z.addEventListener("dragover",B),z.addEventListener("dragleave",Y),z.addEventListener("drop",X),q.push(()=>z.removeEventListener("dragenter",M),()=>z.removeEventListener("dragover",B),()=>z.removeEventListener("dragleave",Y),()=>z.removeEventListener("drop",X)),$=()=>{for(let W of q)W();q.length=0,$=D}}}try{Z2(()=>$())}catch{}return{isOverDropZone:Z,files:G}}import{onUnmounted as K2,ref as R9}from"@stacksjs/stx";function z2(){let J=R9(typeof navigator<"u"&&"language"in navigator),Q=R9(J.value?navigator.language:"");if(typeof window<"u"){let Z=()=>{if(J.value)Q.value=navigator.language};window.addEventListener("languagechange",Z,{passive:!0});try{K2(()=>{window.removeEventListener("languagechange",Z)})}catch{}}return{language:Q,isSupported:J}}import{onUnmounted as q2,ref as M2}from"@stacksjs/stx";function X2(){let J=M2(typeof navigator<"u"?navigator.languages:[]);if(typeof window>"u")return J;let Q=()=>{J.value=navigator.languages};window.addEventListener("languagechange",Q,{passive:!0});try{q2(()=>{window.removeEventListener("languagechange",Q)})}catch{}return J}import{onUnmounted as B2,ref as dJ}from"@stacksjs/stx";function W2(){let J=dJ(typeof screen<"u"&&"orientation"in screen),Q=dJ(void 0),Z=dJ(0);if(J.value){Q.value=screen.orientation.type,Z.value=screen.orientation.angle;let K=()=>{Q.value=screen.orientation.type,Z.value=screen.orientation.angle};screen.orientation.addEventListener("change",K);try{B2(()=>{screen.orientation.removeEventListener("change",K)})}catch{}}async function G(K){if(J.value)await screen.orientation.lock(K)}function $(){if(J.value)screen.orientation.unlock()}return{isSupported:J,orientation:Q,angle:Z,lockOrientation:G,unlockOrientation:$}}import{ref as AJ}from"@stacksjs/stx";function _2(){let J=AJ("0px"),Q=AJ("0px"),Z=AJ("0px"),G=AJ("0px");function $(){if(typeof document>"u"||typeof getComputedStyle>"u")return;let K=document.createElement("div");K.style.position="fixed",K.style.top="env(safe-area-inset-top, 0px)",K.style.right="env(safe-area-inset-right, 0px)",K.style.bottom="env(safe-area-inset-bottom, 0px)",K.style.left="env(safe-area-inset-left, 0px)",K.style.pointerEvents="none",K.style.visibility="hidden",document.body.appendChild(K);let z=getComputedStyle(K);J.value=z.top,Q.value=z.right,Z.value=z.bottom,G.value=z.left,document.body.removeChild(K)}return $(),{top:J,right:Q,bottom:Z,left:G,update:$}}import{ref as Y2}from"@stacksjs/stx";function H2(J){let Q=Y2(null),Z=A(J);if(Z)Q.value=Z.parentElement;return Q}import{onUnmounted as F2,ref as I9}from"@stacksjs/stx";function A2(J){let Q=I9(typeof navigator<"u"&&"permissions"in navigator),Z=I9("prompt");if(!Q.value)return{state:Z,isSupported:Q};let G=null;return navigator.permissions.query({name:J}).then(($)=>{G=$,Z.value=$.state;let K=()=>{Z.value=$.state};$.addEventListener("change",K);try{F2(()=>{$.removeEventListener("change",K)})}catch{}}).catch(()=>{}),{state:Z,isSupported:Q}}import{ref as L2}from"@stacksjs/stx";function N2(J={}){let Q=L2(typeof navigator<"u"&&"share"in navigator);async function Z(G){if(!Q.value)return;let $={...J,...G};await navigator.share($)}return{share:Z,isSupported:Q}}import{onUnmounted as O2,ref as D2,watch as C2}from"@stacksjs/stx";function P2(J){let Q=D2(void 0);function Z(){if(Q.value)URL.revokeObjectURL(Q.value),Q.value=void 0}function G($){if(Z(),$)Q.value=URL.createObjectURL($)}G(J.value),C2(J,($)=>{G($)});try{O2(()=>Z())}catch{}return Q}import{ref as uJ}from"@stacksjs/stx";function E2(J){let Q=uJ(!0),Z=uJ(!1),G=uJ(null);if(typeof Image>"u")return Q.value=!1,{isLoading:Q,error:G,isReady:Z};let $=new Image;if($.onload=()=>{Q.value=!1,Z.value=!0},$.onerror=(K)=>{if(Q.value=!1,typeof K==="string")G.value=K;else if(K instanceof Event&&K.type==="error")G.value=`Failed to load image: ${J.src}`;else G.value="Failed to load image"},J.crossorigin)$.crossOrigin=J.crossorigin;if(J.referrerpolicy)$.referrerPolicy=J.referrerpolicy;if(J.sizes)$.sizes=J.sizes;if(J.srcset)$.srcset=J.srcset;return $.src=J.src,{isLoading:Q,error:G,isReady:Z}}import{ref as U2,watch as j2}from"@stacksjs/stx";function T2(J){let Q=U2("");async function Z($){if(typeof $==="string"){if(typeof btoa<"u")return btoa($);return Buffer.from($).toString("base64")}if($ instanceof ArrayBuffer){let K=new Uint8Array($),z="";for(let q of K)z+=String.fromCharCode(q);if(typeof btoa<"u")return btoa(z);return Buffer.from($).toString("base64")}if(typeof Blob<"u"&&$ instanceof Blob)return new Promise((K,z)=>{let q=new FileReader;q.onload=()=>{let M=q.result,B=M.split(",")[1]??M;K(B)},q.onerror=z,q.readAsDataURL($)});if(typeof HTMLCanvasElement<"u"&&$ instanceof HTMLCanvasElement)return $.toDataURL().split(",")[1]??"";return""}async function G(){let $=A(J),K=await Z($);return Q.value=K,K}if(G().catch(()=>{}),b(J))j2(J,()=>{G().catch(()=>{})});return{base64:Q,execute:G}}import{onUnmounted as V2,ref as _J}from"@stacksjs/stx";function R2(J,Q,Z){let G=_J(typeof HTMLElement<"u"&&"animate"in HTMLElement.prototype),$=_J(void 0),K=_J(!1),z=_J("idle"),q=_J(null);function M(){if($.value)K.value=$.value.pending,z.value=$.value.playState,q.value=$.value.currentTime}function B(){let F=A(J);if(!F||!G.value)return;$.value=F.animate(Q,Z),$.value.addEventListener("finish",M),$.value.addEventListener("cancel",M),M()}function Y(){$.value?.play(),M()}function X(){$.value?.pause(),M()}function W(){$.value?.reverse(),M()}function _(){$.value?.finish(),M()}function H(){$.value?.cancel(),M()}B();try{V2(()=>{$.value?.cancel()})}catch{}return{isSupported:G,animate:$,play:Y,pause:X,reverse:W,finish:_,cancel:H,pending:K,playState:z,currentTime:q}}import{onUnmounted as I2,ref as S2,watch as b2}from"@stacksjs/stx";var cJ={linear:(J)=>J,easeInQuad:(J)=>J*J,easeOutQuad:(J)=>J*(2-J),easeInOutQuad:(J)=>J<0.5?2*J*J:-1+(4-2*J)*J,easeInCubic:(J)=>J*J*J,easeOutCubic:(J)=>--J*J*J+1,easeInOutCubic:(J)=>J<0.5?4*J*J*J:(J-1)*(2*J-2)*(2*J-2)+1};function x2(J,Q={}){let{duration:Z=300,transition:G=cJ.linear,delay:$=0,onFinished:K,onStarted:z}=Q,q=S2(A(J)),M=null;function B(Y,X){if(M!==null)cancelAnimationFrame(M);let W=performance.now()+$;z?.();function _(H){let F=H-W;if(F<0){M=requestAnimationFrame(_);return}let L=Math.min(F/Z,1),C=G(L);if(q.value=Y+(X-Y)*C,L<1)M=requestAnimationFrame(_);else M=null,q.value=X,K?.()}M=requestAnimationFrame(_)}if(typeof J==="object"&&J&&"value"in J&&"subscribe"in J)b2(J,(Y)=>{if(typeof requestAnimationFrame<"u")B(q.value,Y);else q.value=Y});try{I2(()=>{if(M!==null)cancelAnimationFrame(M)})}catch{}return q}function y2(J,Q,Z={}){return new Promise((G)=>{let{duration:$=300,transition:K=cJ.linear,delay:z=0,onFinished:q,onStarted:M}=Z;if(typeof requestAnimationFrame>"u"){q?.(),G();return}let B=performance.now()+z;M?.();function Y(X){let W=X-B;if(W<0){requestAnimationFrame(Y);return}if(Math.min(W/$,1)>=1)q?.(),G();else requestAnimationFrame(Y)}requestAnimationFrame(Y)})}import{onUnmounted as w2,ref as k2}from"@stacksjs/stx";function g2(J,Q,Z={}){let{immediate:G=!0,type:$="text/javascript",manual:K=!1,attrs:z={}}=Z,q=k2(null);function M(){return new Promise((Y,X)=>{if(typeof document>"u"){X(Error("Document is not available"));return}let W=document.createElement("script");if(W.type=$,W.src=J,Z.async)W.async=!0;if(Z.defer)W.defer=!0;if(Z.crossOrigin)W.crossOrigin=Z.crossOrigin;if(Z.referrerPolicy)W.referrerPolicy=Z.referrerPolicy;for(let[_,H]of Object.entries(z))W.setAttribute(_,H);W.addEventListener("load",()=>{q.value=W,Q?.(W),Y(W)}),W.addEventListener("error",(_)=>{X(_)}),document.head.appendChild(W)})}function B(){if(q.value)q.value.remove(),q.value=null}if(G)M();if(!K)try{w2(()=>B())}catch{}return{scriptTag:q,load:M,unload:B}}import{onUnmounted as h2,ref as S9,watch as f2}from"@stacksjs/stx";function v2(J,Q={}){let{immediate:Z=!0,id:G=`style-${Math.random().toString(36).slice(2,9)}`,media:$}=Q,K=S9(J),z=S9(!1),q=null;function M(){if(typeof document>"u")return;if(q)return;if(q=document.createElement("style"),q.id=G,$)q.media=$;q.textContent=K.value,document.head.appendChild(q),z.value=!0}function B(){if(q)q.remove(),q=null,z.value=!1}if(f2(K,(Y)=>{if(q)q.textContent=Y}),Z)M();try{h2(()=>B())}catch{}return{id:G,css:K,load:M,unload:B,isLoaded:z}}import{ref as m2}from"@stacksjs/stx";function p2(){let J=m2(!1),Q=GJ(),Z=GJ(),G=GJ(),$=null;function K(M){return J.value=!0,G.trigger(M),new Promise((B)=>{$=B})}function z(M){J.value=!1,Q.trigger(M),$?.({data:M,isCanceled:!1}),$=null}function q(){J.value=!1,Z.trigger(void 0),$?.({isCanceled:!0}),$=null}return{isRevealed:J,reveal:K,confirm:z,cancel:q,onConfirm:Q.on,onCancel:Z.on,onReveal:G.on}}import{ref as d2}from"@stacksjs/stx";function u2(J={}){let Q=d2(null);function Z($){if(typeof document>"u")return;let K={...J,...$},z=document.createElement("input");if(z.type="file",K.accept)z.accept=K.accept;if(K.multiple)z.multiple=!0;if(K.capture)z.setAttribute("capture",K.capture);z.onchange=()=>{Q.value=z.files},z.click()}function G(){Q.value=null}return{files:Q,open:Z,reset:G}}import{ref as b9}from"@stacksjs/stx";function c2(){let J=b9(typeof window<"u"&&"EyeDropper"in window),Q=b9("");async function Z(){if(!J.value)return;let G=new window.EyeDropper;try{let $=await G.open();return Q.value=$.sRGBHex,$}catch{return}}return{isSupported:J,sRGBHex:Q,open:Z}}import{ref as x9,watch as l2}from"@stacksjs/stx";function i2(J){let Q=x9(J?.element??null),Z=x9(J?.input??"");function G(){let $=Q.value;if(!$)return;$.style.height="auto",$.style.height=`${$.scrollHeight}px`}return l2(Z,()=>{if(Q.value)Q.value.value=Z.value;if(typeof requestAnimationFrame<"u")requestAnimationFrame(G);else G()}),{textarea:Q,input:Z,triggerResize:G}}import{onUnmounted as r2,ref as o}from"@stacksjs/stx";function s2(J={}){let Q=o(typeof Notification<"u"),Z=o(null),G=o(Q.value&&Notification.permission==="granted"),$=o(null),K=o(null),z=o(null),q=o(null);async function M(Y){if(!Q.value)return;if(Notification.permission!=="granted"){let H=await Notification.requestPermission();if(G.value=H==="granted",!G.value)return}let X={...J,...Y},W=X.title??"",_=new Notification(W,{body:X.body,icon:X.icon,dir:X.dir,lang:X.lang,tag:X.tag,requireInteraction:X.requireInteraction});return Z.value=_,_.onclick=(H)=>$.value?.(H),_.onshow=(H)=>K.value?.(H),_.onerror=(H)=>z.value?.(H),_.onclose=(H)=>{q.value?.(H),Z.value=null},_}function B(){Z.value?.close(),Z.value=null}try{r2(()=>B())}catch{}return{isSupported:Q,notification:Z,permissionGranted:G,show:M,close:B,onClick:$,onShow:K,onError:z,onClose:q}}import{ref as n2}from"@stacksjs/stx";function o2(J={}){let{pattern:Q=200}=J,Z=n2(typeof navigator<"u"&&"vibrate"in navigator);function G(K){if(!Z.value)return!1;return navigator.vibrate(K??Q)}function $(){if(Z.value)navigator.vibrate(0)}return{isSupported:Z,vibrate:G,stop:$}}import{onUnmounted as a2,ref as y9}from"@stacksjs/stx";function t2(){let J=y9(typeof navigator<"u"&&"wakeLock"in navigator),Q=y9(!1),Z=null;async function G(){if(!J.value)return;try{Z=await navigator.wakeLock.request("screen"),Q.value=!0,Z.addEventListener("release",()=>{Q.value=!1,Z=null})}catch{Q.value=!1}}async function $(){if(Z)await Z.release(),Z=null,Q.value=!1}try{a2(()=>{$()})}catch{}return{isSupported:J,isActive:Q,request:G,release:$}}import{onUnmounted as e2,ref as w9}from"@stacksjs/stx";function J3(J,Q){let Z=w9(null),G=w9(void 0);if(typeof Worker<"u"){let z=new Worker(J,Q);G.value=z,z.onmessage=(q)=>{Z.value=q.data};try{e2(()=>z.terminate())}catch{}}function $(z){G.value?.postMessage(z)}function K(){G.value?.terminate(),G.value=void 0}return{data:Z,post:$,terminate:K,worker:G}}function $3(J){let Q;function Z(){let K=new Blob([`self.onmessage = function(e) { self.postMessage((${J.toString()})(...e.data)); }`],{type:"text/javascript"}),z=URL.createObjectURL(K);return new Worker(z)}function G(...K){return new Promise((z,q)=>{if(typeof Worker>"u"){try{z(J(...K))}catch(M){q(M)}return}Q=Z(),Q.onmessage=(M)=>{z(M.data),Q?.terminate()},Q.onerror=(M)=>{q(M),Q?.terminate()},Q.postMessage(K)})}function $(){Q?.terminate(),Q=void 0}return{workerFn:G,terminate:$}}import{ref as LJ,watch as Q3}from"@stacksjs/stx";function Z3(J,Q){let{itemHeight:Z,overscan:G=5}=Q,$=LJ([]),K=LJ(0),z=LJ(0),q=LJ({style:{width:"100%",height:"0px",marginTop:"0px"}});function M(){return A(J)}function B(){let W=M(),_=W.length*Z,H=Math.max(0,Math.floor(z.value/Z)-G),F=Math.min(W.length,Math.ceil((z.value+K.value)/Z)+G),L=[];for(let C=H;C<F;C++){let U=W[C];if(U===void 0&&!(C in W))continue;L.push({data:U,index:C})}$.value=L,q.value={style:{width:"100%",height:`${_-H*Z}px`,marginTop:`${H*Z}px`}}}let Y=(W)=>{let _=W.target;z.value=_.scrollTop,K.value=_.clientHeight,B()};if(B(),typeof J==="object"&&J&&"value"in J&&"subscribe"in J)Q3(J,()=>B());function X(W){z.value=W*Z,B()}return{list:$,containerProps:{onScroll:Y,style:{overflow:"auto",position:"relative"}},wrapperProps:q,scrollTo:X}}import{ref as e,watch as lJ}from"@stacksjs/stx";function G3(J={}){let{total:Q,pageSize:Z=10,page:G=1,onPageChange:$,onPageSizeChange:K}=J,z=e(G),q=e(Z),M=typeof Q==="object"&&Q&&"value"in Q?Q:e(typeof Q==="number"?Q:0),B=e(Math.max(1,Math.ceil(M.value/q.value))),Y=e(z.value<=1),X=e(z.value>=B.value);function W(){B.value=Math.max(1,Math.ceil(M.value/q.value)),Y.value=z.value<=1,X.value=z.value>=B.value}lJ(z,()=>{W(),$?.({currentPage:z.value,currentPageSize:q.value})}),lJ(q,()=>{z.value=1,W(),K?.({currentPage:z.value,currentPageSize:q.value})}),lJ(M,()=>{W()});function _(){if(z.value>1)z.value--}function H(){if(z.value<B.value)z.value++}return W(),{currentPage:z,currentPageSize:q,pageCount:B,isFirstPage:Y,isLastPage:X,prev:_,next:H}}function K3(J){return J.value!==null&&J.value!==void 0}import{ref as z3}from"@stacksjs/stx";function q3(J){let Q=z3(!1);try{Q.value=J()}catch{Q.value=!1}return Q}import{ref as M3,watch as X3}from"@stacksjs/stx";function B3(J,Q={}){let{method:Z="parseFloat",radix:G=10,nanToZero:$=!1}=Q,K=M3(0);function z(q){if(typeof q==="number")return q;let M;if(Z==="parseInt")M=Number.parseInt(q,G);else M=Number.parseFloat(q);if($&&Number.isNaN(M))return 0;return M}if(K.value=z(R(J)),typeof J==="function");else if(J&&typeof J==="object"&&"value"in J&&"subscribe"in J)X3(J,(q)=>{K.value=z(q)});return K}import{ref as W3,watch as _3}from"@stacksjs/stx";function Y3(J){let Q=W3(String(R(J)??""));if(b(J))_3(J,(Z)=>{Q.value=String(Z??"")});return Q}import{ref as H3,watch as F3}from"@stacksjs/stx";function A3(J,Q){let Z=H3(J.value??Q);return F3(J,(G)=>{Z.value=G??Q}),Z}import{ref as L3,watch as N3}from"@stacksjs/stx";function k9(J,Q=1000){let Z=L3(J),G=null;return N3(Z,()=>{if(G!==null)clearTimeout(G);G=setTimeout(()=>{Z.value=J,G=null},Q)}),Z}var O3=k9;function D3(J){return JSON.parse(JSON.stringify(J))}var C3={justNow:"just now",past:(J)=>`${J} ago`,future:(J)=>`in ${J}`,second:(J)=>`${J} second${J>1?"s":""}`,minute:(J)=>`${J} minute${J>1?"s":""}`,hour:(J)=>`${J} hour${J>1?"s":""}`,day:(J)=>`${J} day${J>1?"s":""}`,week:(J)=>`${J} week${J>1?"s":""}`,month:(J)=>`${J} month${J>1?"s":""}`,year:(J)=>`${J} year${J>1?"s":""}`};function P3(J,Q={}){let Z={...C3,...Q.messages},G=J instanceof Date?J:new Date(J),K=Date.now()-G.getTime(),z=Math.abs(K),q=Math.floor(z/1000),M=Math.floor(q/60),B=Math.floor(M/60),Y=Math.floor(B/24),X=Math.floor(Y/7),W=Math.floor(Y/30),_=Math.floor(Y/365),H=K<0;function F(L){return H?Z.future(L):Z.past(L)}if(q<5)return Z.justNow;if(q<60)return F(Z.second(q));if(M<60)return F(Z.minute(M));if(B<24)return F(Z.hour(B));if(Y<7)return F(Z.day(Y));if(X<4)return F(Z.week(X));if(W<12)return F(Z.month(W));return F(Z.year(_))}import{watch as E3}from"@stacksjs/stx";function U3(J){function Q(M,B={}){let{timeout:Y,throwOnTimeout:X=!1}=B;if(M(J.value))return Promise.resolve(J.value);return new Promise((W,_)=>{let H=null,F=E3(J,(L)=>{if(M(L)){if(F(),H!==null)clearTimeout(H);W(L)}});if(Y!==void 0)H=setTimeout(()=>{if(F(),X)_(Error("Timeout"));else W(J.value)},Y)})}function Z(M,B){return Q((Y)=>Y===M,B)}function G(M){return Q((B)=>Boolean(B),M)}function $(M){return Q((B)=>B===null,M)}function K(M){return Q((B)=>B===void 0,M)}function z(M){return Q((B)=>Number.isNaN(B),M)}function q(M){let B=J.value;return Q((Y)=>Y!==B,M)}return{toMatch:Q,toBe:Z,toBeTruthy:G,toBeNull:$,toBeUndefined:K,toBeNaN:z,changed:q,not:{toBe:(M,B)=>Q((Y)=>Y!==M,B),toBeTruthy:(M)=>Q((B)=>!B,M),toBeNull:(M)=>Q((B)=>B!==null,M),toBeUndefined:(M)=>Q((B)=>B!==void 0,M),toBeNaN:(M)=>Q((B)=>!Number.isNaN(B),M)}}}import{ref as j3}from"@stacksjs/stx";function T3(J){if(b(J))return J;return j3(J)}function V3(J,Q){for(let[Z,G]of Object.entries(Q))if(Z!=="value")J[Z]=G;return J}function R3(J,Q){let Z=new Map,G=Q??((...K)=>JSON.stringify(K)),$=function(...K){let z=G(...K);if(Z.has(z))return Z.get(z);let q=J(...K);return Z.set(z,q),q};return $.load=(...K)=>{let z=G(...K),q=J(...K);return Z.set(z,q),q},$.delete=(...K)=>{let z=G(...K);Z.delete(z)},$.clear=()=>{Z.clear()},$.cache=Z,$}function I3(J,Q){let Z={...J};return Object.defineProperty(Z,Symbol.iterator,{enumerable:!1,value(){let G=0;return{next:()=>({value:Q[G++],done:G>Q.length})}}}),Z}import{watch as iJ}from"@stacksjs/stx";function S3(J,Q,Z={}){let{direction:G="both"}=Z,$=!1,K=[];if(G==="both"||G==="ltr")K.push(iJ(J,(z)=>{if($)return;$=!0,Q.value=z,$=!1}));if(G==="both"||G==="rtl")K.push(iJ(Q,(z)=>{if($)return;$=!0,J.value=z,$=!1}));return()=>{for(let z of K)z()}}function b3(J,Q){let Z=J.map((G)=>iJ(G,($)=>{Q.value=$}));return()=>{for(let G of Z)G()}}function x3(J){let Q=!1,Z;return()=>{if(!Q)Z=J(),Q=!0;return Z}}function y3(J){let Q=0,Z;return(...G)=>{if(Q++,!Z)Z=J(...G);return Z}}import{onUnmounted as rJ}from"@stacksjs/stx";function w3(J){J()}function k3(J){J()}function g3(J){try{rJ(J)}catch{}}function h3(J){try{rJ(J)}catch{}}function f3(J){try{rJ(J)}catch{}}import{ref as p,watch as g9}from"@stacksjs/stx";function h(J,Q){if(b(J))g9(J,Q)}function f(J){return A(J)}function v3(J,Q,Z){let G=p([]);function $(){let K=f(J),z=f(Q);if(Z)G.value=K.filter((q)=>!z.some((M)=>Z(q,M)));else G.value=K.filter((q)=>!z.includes(q))}return $(),h(J,$),h(Q,$),G}function m3(J,Q){let Z=p(!1);function G(){Z.value=f(J).every(Q)}return G(),h(J,G),Z}function p3(J,Q){let Z=p([]);function G(){Z.value=f(J).filter(Q)}return G(),h(J,G),Z}function d3(J,Q){let Z=p(void 0);function G(){Z.value=f(J).find(Q)}return G(),h(J,G),Z}function u3(J,Q){let Z=p(-1);function G(){Z.value=f(J).findIndex(Q)}return G(),h(J,G),Z}function c3(J,Q,Z){let G=p(!1);function $(){let K=f(J),z=A(Q);if(Z)G.value=K.some((q)=>Z(q,z));else G.value=K.includes(z)}if($(),h(J,$),b(Q))g9(Q,$);return G}function l3(J,Q){let Z=p([]);function G(){Z.value=f(J).map(Q)}return G(),h(J,G),Z}function i3(J,Q,Z){let G=p(Z);function $(){G.value=f(J).reduce(Q,Z)}return $(),h(J,$),G}function r3(J,Q){let Z=p(!1);function G(){Z.value=f(J).some(Q)}return G(),h(J,G),Z}function s3(J,Q){let Z=p([]);function G(){let $=f(J);if(Q)Z.value=$.filter((K,z)=>$.findIndex((q)=>Q(K,q))===z);else Z.value=[...new Set($)]}return G(),h(J,G),Z}export{q4 as whenever,S4 as watchWithFilter,R4 as watchTriggerable,O9 as watchThrottled,D9 as watchPausable,X4 as watchOnce,T4 as watchImmediate,C9 as watchIgnorable,U4 as watchDeep,N9 as watchDebounced,P4 as watchAtMost,O4 as watchArray,l6 as useWindowSize,o6 as useWindowScroll,s6 as useWindowFocus,$3 as useWebWorkerFn,J3 as useWebWorker,x4 as useWebSocket,s2 as useWebNotification,t2 as useWakeLock,Z3 as useVirtualList,o2 as useVibrate,p6 as useUrlSearchParams,S8 as useTrunc,x2 as useTransition,B$ as useToggle,Y3 as useToString,B3 as useToNumber,V6 as useTitle,E$ as useTimestamp,Z6 as useTimeoutPoll,J6 as useTimeoutFn,a$ as useTimeout,V$ as useTimeAgo,Z4 as useThrottledRefHistory,RJ as useThrottledRef,w$ as useThrottleFn,d$ as useThrottle,i2 as useTextareaAutosize,f6 as useTextSelection,g6 as useTextDirection,O7 as useSwipe,q3 as useSupported,I8 as useSum,v2 as useStyleTag,$J as useStorage,d8 as useStepper,r8 as useSorted,N2 as useShare,c9 as useSessionStorage,Q8 as useScrollLock,t6 as useScroll,g2 as useScriptTag,_2 as useScreenSafeArea,W2 as useScreenOrientation,R8 as useRound,l4 as useResizeObserver,e8 as useRefHistory,z6 as useRafFn,_$ as useQuery,f8 as usePrevious,G$ as usePreferredReducedMotion,X2 as usePreferredLanguages,aJ as usePreferredDark,$$ as usePreferredContrast,t9 as usePreferredColorScheme,V8 as usePrecision,C7 as usePointerSwipe,E7 as usePointerLock,L7 as usePointer,A2 as usePermission,H2 as useParentElement,j7 as useParallax,t7 as usePageLeave,q$ as useOnline,G3 as useOffsetPagination,P2 as useObjectUrl,D$ as useNow,M$ as useNetwork,z2 as useNavigatorLanguage,s4 as useMutationObserver,Y$ as useMutation,F7 as useMousePressed,Y7 as useMouseInElement,W7 as useMouse,J2 as useMounted,T8 as useMin,R3 as useMemoize,H6 as useMediaQuery,j8 as useMax,zJ as useManualRefHistory,O8 as useMagicKeys,u9 as useLocalStorage,p8 as useLastChanged,L8 as useKeyModifier,s$ as useIntervalFn,l$ as useInterval,hJ as useIntersectionObserver,K8 as useInfiniteScroll,E2 as useImage,n7 as useIdle,V7 as useGeolocation,q8 as useFullscreen,X6 as useFps,H$ as useForm,u7 as useFocusWithin,m7 as useFocus,U8 as useFloor,u2 as useFileDialog,PJ as useFetch,S6 as useFavicon,c2 as useEyeDropper,w4 as useEventSource,S$ as useEventListener,x$ as useEventBus,J7 as useElementVisibility,o4 as useElementSize,Z7 as useElementHover,K7 as useElementByPoint,t4 as useElementBounding,G2 as useDropZone,Q2 as useDraggable,y6 as useDocumentVisibility,w7 as useDevicePixelRatio,b7 as useDeviceOrientation,I7 as useDeviceMotion,$4 as useDebouncedRefHistory,VJ as useDebouncedRef,y$ as useDebounceFn,v$ as useDebounce,L$ as useDateFormat,r9 as useDark,l8 as useCycleList,M7 as useCssVar,k8 as useCounter,p2 as useConfirmDialog,n9 as useColorMode,a8 as useCloned,W6 as useClipboardItems,B6 as useClipboard,E8 as useClamp,P8 as useCeil,u6 as useBrowserLocation,g4 as useBroadcastChannel,L6 as useBreakpoints,g7 as useBattery,T2 as useBase64,C8 as useAverage,G4 as useAsyncState,K4 as useAsyncQueue,s3 as useArrayUnique,r3 as useArraySome,i3 as useArrayReduce,l3 as useArrayMap,c3 as useArrayIncludes,u3 as useArrayFindIndex,d3 as useArrayFind,p3 as useArrayFilter,m3 as useArrayEvery,v3 as useArrayDifference,R2 as useAnimate,i7 as useActiveElement,D8 as useAbs,U3 as until,X7 as unrefElement,A as unref,g3 as tryOnUnmounted,f3 as tryOnScopeDispose,w3 as tryOnMounted,h3 as tryOnBeforeUnmount,k3 as tryOnBeforeMount,R as toValue,O9 as throttledWatch,RJ as throttledRef,b3 as syncRefs,S3 as syncRef,f9 as setSSRHandler,T3 as resolveRef,RJ as refThrottled,A3 as refDefault,VJ as refDebounced,k9 as refAutoReset,$9 as queryClient,H4 as pausableWatch,x8 as or,H8 as onStartTyping,_8 as onLongPress,B8 as onKeyUp,bJ as onKeyStroke,X8 as onKeyDown,M8 as onClickOutside,D as noop,I3 as makeDestructurable,H9 as logicOr,b8 as logicNot,b as isRef,K3 as isDefined,L4 as ignorableWatch,h9 as getSSRHandler,P3 as formatTimeAgo,V3 as extendRef,y2 as executeTransition,E9 as eagerComputed,x as defaultWindow,NJ as defaultNavigator,JJ as defaultDocument,N9 as debouncedWatch,VJ as debouncedRef,v9 as customStorageEventName,y3 as createSharedComposable,J9 as createQueryClient,x3 as createGlobalState,W$ as createFetch,GJ as createEventHook,E9 as computedEager,P9 as computedAsync,D3 as cloneFnJSON,C6 as breakpointsVuetify,N6 as breakpointsTailwind,U6 as breakpointsSematic,P6 as breakpointsQuasar,E6 as breakpointsMasterCss,O6 as breakpointsBootstrapV5,X9 as breakpointsBootstrap,D6 as breakpointsAntDesign,O3 as autoResetRef,P9 as asyncComputed,y8 as and,cJ as TransitionPresets};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/composables",
3
3
  "type": "module",
4
- "version": "0.70.45",
4
+ "version": "0.70.54",
5
5
  "description": "Stacks composables powered by stx reactivity.",
6
6
  "author": "Chris Breuer",
7
7
  "contributors": [
@@ -47,8 +47,8 @@
47
47
  "prepublishOnly": "bun run build"
48
48
  },
49
49
  "dependencies": {
50
- "@stacksjs/stx": "^0.2.40",
51
- "@stacksjs/datetime": "^0.70.45"
50
+ "@stacksjs/stx": "^0.2.82",
51
+ "@stacksjs/datetime": "0.70.54"
52
52
  },
53
53
  "devDependencies": {
54
54
  "better-dx": "^0.2.12"