turbo_boost-commands 0.0.11 → 0.0.13

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of turbo_boost-commands might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4fb82d3f8de70446dda0321e99024957728236f0ec2709c0602e44db64427e1f
4
- data.tar.gz: 279c3eeacb3b4ab343f1cf143adcc8519a7fb298791652ddc274ee79f9bc2de4
3
+ metadata.gz: 2ac2d1a9dca699a75d265c7c0de4f6e1f1789b7a0674f74b873c64a035f90d90
4
+ data.tar.gz: 3cb82fa2b7581c6a187e26ea688db94f27c7e1149c87da44fb6e4dc484044bd2
5
5
  SHA512:
6
- metadata.gz: 221120fd87336c58ad4ad9b8937af8044fb981c032cacd905b02f3b89ea2df61458fd0f2bc3dc7a787f076c4f239a6eea0dde41fc199c6c2ebc3ef2b6b89cda1
7
- data.tar.gz: 23e58472270abbb85c5236769924304fadf37f1c43158bbc1e3e72dd96fc369882ad0f56fdeb9028dbfb809cf5555ea384a1927478c3d2d754315b604dfa6685
6
+ metadata.gz: dba4b1962f500f1b99e696c608351a9d7a9c4c5f526839dc3350d00592b8ee0941d374e398d76aee96f1215fbaced0fe24564cd762d396d58453cb2f5c6a4360
7
+ data.tar.gz: 9fcb1ca969e600df2320591a9a2acbf2dd1e8e31a7690d77872127da9d72f9b86465aac82c556ea849d0876bbaf82e1e25c4b863d5ab98043ba882117db46bb9
data/README.md CHANGED
@@ -59,29 +59,29 @@
59
59
 
60
60
  ## Table of Contents
61
61
 
62
- - [Why TurboBoost Commands?](#why-turboboost-commands)
63
- - [Sponsors](#sponsors)
64
- - [Dependencies](#dependencies)
65
- - [Setup](#setup)
66
- - [Usage](#usage)
67
- - [Event Delegates](#event-delegates)
68
- - [Lifecycle Events](#lifecycle-events)
69
- - [Targeting Frames](#targeting-frames)
70
- - [Working with Forms](#working-with-forms)
71
- - [Server Side Commands](#server-side-commands)
72
- - [Appending Turbo Streams](#appending-turbo-streams)
73
- - [Setting Instance Variables](#setting-instance-variables)
74
- - [Prevent Controller Action](#prevent-controller-action)
75
- - [Broadcasting Turbo Streams](#broadcasting-turbo-streams)
76
- - [Putting it All Together](#putting-it-all-together)
77
- - [Running Locally](#running-locally)
78
- - [Running in Docker](#running-in-docker)
79
- - [Community](#community)
80
- - [Discussions](#discussions)
81
- - [Twitter](#twitter)
82
- - [Releasing](#releasing)
83
- - [About TurboBoost](#about-turboboost)
84
- - [License](#license)
62
+ - [Why TurboBoost Commands?](#why-turboboost-commands)
63
+ - [Sponsors](#sponsors)
64
+ - [Dependencies](#dependencies)
65
+ - [Setup](#setup)
66
+ - [Usage](#usage)
67
+ - [Event Delegates](#event-delegates)
68
+ - [Lifecycle Events](#lifecycle-events)
69
+ - [Targeting Frames](#targeting-frames)
70
+ - [Working with Forms](#working-with-forms)
71
+ - [Server Side Commands](#server-side-commands)
72
+ - [Appending Turbo Streams](#appending-turbo-streams)
73
+ - [Setting Instance Variables](#setting-instance-variables)
74
+ - [Prevent Controller Action](#prevent-controller-action)
75
+ - [Broadcasting Turbo Streams](#broadcasting-turbo-streams)
76
+ - [Community](#community)
77
+ - [Developing](#developing)
78
+ - [Notable Files](#notable-files)
79
+ - [Deploying](#deploying)
80
+ - [Notable Files](#notable-files-1)
81
+ - [How to Deploy](#how-to-deploy)
82
+ - [Releasing](#releasing)
83
+ - [About TurboBoost](#about-turboboost)
84
+ - [License](#license)
85
85
 
86
86
  <!-- Tocer[finish]: Auto-generated, don't remove. -->
87
87
 
@@ -91,11 +91,11 @@ Commands help you build robust reactive applications with Rails & Hotwire.
91
91
  They allow you to declaratively specify server methods that will execute whenever client side events are triggered by users.
92
92
 
93
93
  TurboBoost Commands work with Hotwire's Turbo Frames.
94
- __They also work independent of frames.__
94
+ **They also work independent of frames.**
95
95
 
96
- Commands let you *sprinkle* ✨ in reactive functionality and skip the ceremony of the typical
96
+ Commands let you _sprinkle_ ✨ in reactive functionality and skip the ceremony of the typical
97
97
  [REST semantics](https://en.wikipedia.org/wiki/Representational_state_transfer)
98
- imposed by Rails conventions and Turbo Frames i.e. boilerplate *(routes, controllers, actions, etc...)*.
98
+ imposed by Rails conventions and Turbo Frames i.e. boilerplate _(routes, controllers, actions, etc...)_.
99
99
 
100
100
  Commands are great for features adjacent to traditional RESTful resources.
101
101
  Things like making selections, toggling switches, adding filters, etc...
@@ -108,9 +108,9 @@ Namely,
108
108
  1. **Trigger an event**
109
109
  2. **Change state**
110
110
  3. **(Re)render to reflect the new state**
111
- 4. *repeat...*
111
+ 4. _repeat..._
112
112
 
113
- *The primary distinction being that __state is wholly managed by the server__.*
113
+ _The primary distinction being that **state is wholly managed by the server**._
114
114
 
115
115
  Commands are executed via a Rails `before_action` which means that reactivity runs over HTTP.
116
116
  _**Web sockets are NOT used for the reactive critical path!** 🎉_
@@ -138,97 +138,108 @@ Commands can be tested in isolation as well as with standard Rails controller, i
138
138
 
139
139
  ## Setup
140
140
 
141
+ Complete the steps below, or use [this RailsByte](https://railsbytes.com/templates/xkjsbB):
142
+
143
+ ```sh
144
+ rails app:template LOCATION='https://railsbytes.com/script/xkjsbB'
145
+ ```
146
+
141
147
  1. Add TurboBoost Commands dependencies
142
148
 
143
- ```diff
144
- # Gemfile
145
- gem "turbo-rails", ">= 1.1", "< 2"
146
- +gem "turbo_boost-commands", "~> VERSION"
147
- ```
149
+ ```diff
150
+ # Gemfile
151
+ gem "turbo-rails", ">= 1.1", "< 2"
152
+ +gem "turbo_boost-commands", "~> VERSION"
153
+ ```
148
154
 
149
- ```diff
150
- # package.json
151
- "dependencies": {
152
- "@hotwired/turbo-rails": ">=7.2",
153
- + "@turbo-boost/commands": "^VERSION"
154
- ```
155
+ ```diff
156
+ # package.json
157
+ "dependencies": {
158
+ "@hotwired/turbo-rails": ">=7.2",
159
+ + "@turbo-boost/commands": "^VERSION"
160
+ ```
155
161
 
156
- *Be sure to install the __same version__ of the Ruby and JavaScript libraries.*
162
+ _Be sure to install the **same version** of the Ruby and JavaScript libraries._
157
163
 
158
164
  2. Import TurboBoost Commands in your JavaScript app
159
165
 
160
- ```diff
161
- # app/javascript/application.js
162
- import '@hotwired/turbo-rails'
163
- +import '@turbo-boost/commands'
164
- ```
165
-
166
- 2. Add TurboBoost to your Rails app
167
-
168
- ```diff
169
- # app/views/layouts/application.html.erb
170
- <html>
171
- <head>
172
- + <%= turbo_boost.meta_tag %>
173
- </head>
174
- <body>
175
- </body>
176
- </html>
177
- ```
166
+ ```diff
167
+ # app/javascript/application.js
168
+ import '@hotwired/turbo-rails'
169
+ +import '@turbo-boost/commands'
170
+ ```
171
+
172
+ 3. Add TurboBoost to your Rails app
173
+
174
+ ```diff
175
+ # app/views/layouts/application.html.erb
176
+ <html>
177
+ <head>
178
+ + <%= turbo_boost.meta_tag %>
179
+ </head>
180
+ <body>
181
+ </body>
182
+ </html>
183
+ ```
178
184
 
179
185
  ## Usage
180
186
 
181
187
  This example illustrates how to use TurboBoost Commands to manage upvotes on a Post.
182
188
 
183
- 1. **Trigger an event** - *register an element to listen for client side events that trigger server side commands*
189
+ 1. **Trigger an event** - _register an element to listen for client side events that trigger server side commands_
184
190
 
185
- ```erb
186
- <!-- app/views/posts/show.html.erb -->
187
- <%= turbo_frame_tag dom_id(@post) do %>
188
- <a href="#" data-turbo-command="PostCommand#upvote">Upvote</a>
189
- Upvote Count: <%= @post.votes %>
190
- <% end %>
191
- ```
191
+ ```erb
192
+ <!-- app/views/posts/show.html.erb -->
193
+ <%= turbo_frame_tag dom_id(@post) do %>
194
+ <a href="#" data-turbo-command="PostCommand#upvote">Upvote</a>
195
+ Upvote Count: <%= @post.votes %>
196
+ <% end %>
197
+ ```
192
198
 
193
- 2. **Change state** - *create a server side command that modifies state*
199
+ 2. **Change state** - _create a server side command that modifies state_
194
200
 
195
- ```ruby
196
- # app/commands/post_command.rb
197
- class PostCommand < TurboBoost::Commands::Command
198
- def upvote
199
- Post.find(controller.params[:id]).increment! :votes
200
- end
201
- end
202
- ```
201
+ ```ruby
202
+ # app/commands/post_command.rb
203
+ class PostCommand < TurboBoost::Commands::Command
204
+ def upvote
205
+ Post.find(controller.params[:id]).increment! :votes
206
+ end
207
+ end
208
+ ```
203
209
 
204
- 3. **(Re)render to reflect the new state** - *normal Rails / Turbo Frame behavior runs and (re)renders the frame*
210
+ 3. **(Re)render to reflect the new state** - _normal Rails / Turbo Frame behavior runs and (re)renders the frame_
205
211
 
206
212
  ### Event Delegates
207
213
 
208
214
  TurboBoost Commands use [event delegation](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Events#event_delegation) to capture client side events that invoke server side commands.
209
215
 
210
- Here is the list of default **event delegates** *(DOM event name + CSS selectors)* that TurboBoost Commands monitors.
216
+ Here is the list of default **event delegates** _(DOM event name + CSS selectors)_ that TurboBoost Commands monitors.
211
217
 
212
218
  - **`change`** - `input[data-turbo-command],select[data-turbo-command],textarea[data-turbo-command]`
213
219
  - **`submit`** - `form[data-turbo-command]`
214
220
  - **`click`** - `[data-turbo-command]`
215
221
 
216
222
  Note that the list of event delegates is ordinal.
217
- Matches are identified by scanning the list of delegates top to bottom *(first match wins)*.
223
+ Matches are identified by scanning the list of delegates top to bottom _(first match wins)_.
218
224
 
219
225
  It's possible to override the default event delegates.
220
226
  Just note that registered events are required to [bubble up through the DOM tree](https://developer.mozilla.org/en-US/docs/Web/API/Event/bubbles).
221
227
 
222
- **IMPORTANT:** *New entries and overrides are prepended to the list of delegates and will match before defaults.*
228
+ **IMPORTANT:** _New entries and overrides are prepended to the list of delegates and will match before defaults._
223
229
 
224
230
  ```js
225
231
  // restrict `click` monitoring to <a> and <button> elements
226
- TurboBoost.Commands.registerEventDelegate('click', ['a[data-turbo-command]', 'button[data-command]'])
232
+ TurboBoost.Commands.registerEventDelegate('click', [
233
+ 'a[data-turbo-command]',
234
+ 'button[data-command]'
235
+ ])
227
236
  ```
228
237
 
229
238
  ```js
230
239
  // append selectors to the `change` event
231
- const delegate = TurboBoost.Commands.eventDelegates.find(e => e.name === 'change')
240
+ const delegate = TurboBoost.Commands.eventDelegates.find(
241
+ e => e.name === 'change'
242
+ )
232
243
  const selectors = [...delegate.selectors, '.example[data-turbo-command]']
233
244
  TurboBoost.Commands.registerEventDelegate('change', selectors)
234
245
  ```
@@ -237,7 +248,9 @@ You can also register custom events and elements.
237
248
  Here's an example that sets up monitoring for the `sl-change` event on the `sl-switch` element from the [Shoelace web component library](https://shoelace.style/).
238
249
 
239
250
  ```js
240
- TurboBoost.Commands.registerEventDelegate('sl-change', ['sl-switch[data-turbo-command]'])
251
+ TurboBoost.Commands.registerEventDelegate('sl-change', [
252
+ 'sl-switch[data-turbo-command]'
253
+ ])
241
254
  ```
242
255
 
243
256
  ### Lifecycle Events
@@ -255,19 +268,19 @@ but you can also explicitly target other frames just like you normally would wit
255
268
 
256
269
  1. Look for `data-turbo-frame` on the command element
257
270
 
258
- ```erb
259
- <input type="checkbox"
260
- data-turbo-command="ExampleCommand#work"
261
- data-turbo-frame="some-frame-id">
262
- ```
271
+ ```erb
272
+ <input type="checkbox"
273
+ data-turbo-command="ExampleCommand#work"
274
+ data-turbo-frame="some-frame-id">
275
+ ```
263
276
 
264
277
  1. Find the closest `<turbo-frame>` to the command element
265
278
 
266
- ```erb
267
- <turbo-frame id="example-frame">
268
- <input type="checkbox" data-turbo-command="ExampleCommand#work">
269
- </turbo-frame>
270
- ```
279
+ ```erb
280
+ <turbo-frame id="example-frame">
281
+ <input type="checkbox" data-turbo-command="ExampleCommand#work">
282
+ </turbo-frame>
283
+ ```
271
284
 
272
285
  ### Working with Forms
273
286
 
@@ -297,7 +310,7 @@ Just specify the `data-turbo-command` attribute on the form.
297
310
  ### Server Side Commands
298
311
 
299
312
  The client side DOM attribute `data-turbo-command` indicates what Ruby class and method to invoke.
300
- *The attribute value is specified with RDoc notation. i.e. `ClassName#method_name`*
313
+ _The attribute value is specified with RDoc notation. i.e. `ClassName#method_name`_
301
314
 
302
315
  Here's an example.
303
316
 
@@ -378,7 +391,7 @@ class DemoCommand < TurboBoost::Commands::Command
378
391
  end
379
392
  ```
380
393
 
381
- *This proves especially powerful when paired with [TurboBoost Streams](https://github.com/hopsoft/turbo_boost-streams).*
394
+ _This proves especially powerful when paired with [TurboBoost Streams](https://github.com/hopsoft/turbo_boost-streams)._
382
395
 
383
396
  > 📘 **NOTE:** `turbo_stream.invoke` is a [TurboBoost Streams](https://github.com/hopsoft/turbo_boost-streams#usage) feature.
384
397
 
@@ -472,76 +485,96 @@ class DemoCommand < TurboBoost::Commands::Command
472
485
  end
473
486
  ```
474
487
 
475
- *Learn more about Turbo Stream broadcasting by reading through the
476
- [hotwired/turbo-rails](https://github.com/hotwired/turbo-rails/blob/main/app/models/concerns/turbo/broadcastable.rb) source code.*
488
+ _Learn more about Turbo Stream broadcasting by reading through the
489
+ [hotwired/turbo-rails](https://github.com/hotwired/turbo-rails/blob/main/app/models/concerns/turbo/broadcastable.rb) source code._
477
490
 
478
491
  > 📘 **NOTE:** `broadcast_invoke_later_to` is a [TurboBoost Streams](https://github.com/hopsoft/turbo_boost-streams#broadcasting) feature.
479
492
 
480
- ### Putting it All Together
493
+ ## Community
481
494
 
482
- The best way to learn this stuff is from working examples.
483
- Be sure to clone the library and run the test application.
484
- Then dig into the internals.
495
+ Come join the party with over 2200+ like-minded friendly Rails/Hotwire enthusiasts on our [Discord server](https://discord.gg/stimulus-reflex).
485
496
 
486
- #### Running Locally
497
+ ## Developing
487
498
 
488
- ```sh
489
- git clone https://github.com/hopsoft/turbo_boost-commands.git
490
- cd turbo_boost-commands
491
- bundle
492
- cd test/dummy
493
- bin/rails s
494
- # View the app in a browser at http://localhost:3000
495
- ```
499
+ This project supports a fully Dockerized development experience.
496
500
 
497
- #### Running in Docker
501
+ 1. Simply run the following commands to get started.
498
502
 
499
- Docker users can get up and running even faster.
503
+ ```sh
504
+ git clone -o github https://github.com/hopsoft/turbo_boost-streams.git
505
+ cd turbo_boost-streams
506
+ ```
500
507
 
501
- ```sh
502
- git clone https://github.com/hopsoft/turbo_boost-commands.git
503
- cd turbo_boost-commands
504
- docker compose up -d
505
- # View the app in a browser at http://localhost:3000
506
- ```
508
+ ```sh
509
+ docker compose up -d # start the envionment (will take a few minutes on 1st run)
510
+ docker exec -it turbo_boost-streams-web rake # run the test suite
511
+ open http://localhost:3000 # open the `test/dummy` app in a browser
512
+ ```
507
513
 
508
- You can review the implementation in [`test/dummy/app`](https://github.com/hopsoft/turbo_boost-commands/tree/main/test/dummy).
509
- *Feel free to add some demos and submit a pull request while you're in there.*
514
+ And, if you're using the [containers gem (WIP)](https://github.com/hopsoft/containers).
510
515
 
511
- ## Community
516
+ ```sh
517
+ containers up # start the envionment (will take a few minutes on 1st run)
518
+ containers rake # run the test suite
519
+ open http://localhost:3000 # open the `test/dummy` app in a browser
520
+ ```
521
+
522
+ 1. Edit files using your preferred tools on the host machine.
512
523
 
513
- ### Discussions
524
+ 1. That's it!
514
525
 
515
- Feel free to add to the conversation here on [GitHub Discussions](https://github.com/hopsoft/turbo_boost-commands/discussions).
526
+ #### Notable Files
516
527
 
517
- ### Twitter
528
+ - [Dockerfile](https://github.com/hopsoft/turbo_boost-streams/blob/main/Dockerfile)
529
+ - [docker-compose.yml](https://github.com/hopsoft/turbo_boost-streams/blob/main/docker-compose.yml)
530
+ - [bin/docker/run/local](https://github.com/hopsoft/turbo_boost-streams/blob/main/bin/docker/run/local)
518
531
 
519
- Connect with the core team on Twitter.
532
+ ## Deploying
520
533
 
521
- <a href="https://twitter.com/hopsoft" target="_blank">
522
- <img alt="Twitter Follow" src="https://img.shields.io/twitter/follow/hopsoft?logo=twitter&style=social">
523
- </a>
534
+ This project supports Dockerized deployment via the same configurtation used for development,
535
+ and... it actually runs the [`test/dummy`](https://github.com/hopsoft/turbo_boost-streams/tree/main/test/dummy) application in "production". 🤯
536
+
537
+ The `test/dummy` app serves the following purposes.
538
+
539
+ - Test app for the Rails engine
540
+ - Documentation and marketing site with interactive demos
541
+
542
+ You can [**see it in action** here.](https://hopsoft.io/@turbo-boost/streams)
543
+ _How's that for innovative simplicity?_
544
+
545
+ #### Notable Files
546
+
547
+ - [Dockerfile](https://github.com/hopsoft/turbo_boost-streams/blob/main/Dockerfile)
548
+ - [fly.toml](https://github.com/hopsoft/turbo_boost-streams/blob/main/fly.toml)
549
+ - [bin/docker/run/remote](https://github.com/hopsoft/turbo_boost-streams/blob/main/bin/docker/run/remote)
550
+
551
+ #### How to Deploy
552
+
553
+ ```sh
554
+ fly deploy
555
+ ```
524
556
 
525
557
  ## Releasing
526
558
 
527
- 1. Run `yarn upgrade` and `bundle update` to pick up the latest
528
- 1. Bump version number at `lib/turbo_boost-commands/version.rb`. Pre-release versions use `.preN`
529
- 1. Run `bin/standardize`
559
+ 1. Run `yarn` and `bundle` to pick up the latest
560
+ 1. Bump version number at `lib/turbo_boost-streams/version.rb`. Pre-release versions use `.preN`
530
561
  1. Run `rake build` and `yarn build`
531
562
  1. Commit and push changes to GitHub
532
563
  1. Run `rake release`
533
564
  1. Run `yarn publish --no-git-tag-version --access public`
534
565
  1. Yarn will prompt you for the new version. Pre-release versions use `-preN`
535
- 1. Commit and push any changes to GitHub
536
- 1. Create a new release on GitHub ([here](https://github.com/hopsoft/turbo_boost-commands/releases)) and generate the changelog for the stable release for it
566
+ 1. Commit and push changes to GitHub
567
+ 1. Create a new release on GitHub ([here](https://github.com/hopsoft/turbo_boost-streams/releases)) and generate the changelog for the stable release for it
537
568
 
538
569
  ## About TurboBoost
539
570
 
540
- TurboBoost is a suite of projects that enhance Rails and Hotwire to make building server rendered reactive applications simpler and more powerful.
571
+ TurboBoost is a suite of libraries that enhance Rails, Hotwire, and Turbo... making them even more powerful and boosing your productivity.
541
572
  Be sure to check out all of the various the libraries.
542
573
 
543
574
  - [Streams](https://github.com/hopsoft/turbo_boost-streams)
544
575
  - [Commands](https://github.com/hopsoft/turbo_boost-commands)
576
+ - [Elements](https://github.com/hopsoft/turbo_boost-elements)
577
+ - [Devtools](https://github.com/hopsoft/turbo_boost-devtools)
545
578
  - Coming soon...
546
579
 
547
580
  ## License
@@ -1,6 +1,2 @@
1
- var Qn=Object.defineProperty,eo=Object.defineProperties;var to=Object.getOwnPropertyDescriptors;var lr=Object.getOwnPropertySymbols;var ro=Object.prototype.hasOwnProperty,no=Object.prototype.propertyIsEnumerable;var ur=(e,t,r)=>t in e?Qn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,x=(e,t)=>{for(var r in t||(t={}))ro.call(t,r)&&ur(e,r,t[r]);if(lr)for(var r of lr(t))no.call(t,r)&&ur(e,r,t[r]);return e},D=(e,t)=>eo(e,to(t));var oo=Object.defineProperty,io=Object.defineProperties,ao=Object.getOwnPropertyDescriptors,cr=Object.getOwnPropertySymbols,so=Object.prototype.hasOwnProperty,lo=Object.prototype.propertyIsEnumerable,fr=(e,t,r)=>t in e?oo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Te=(e,t)=>{for(var r in t||(t={}))so.call(t,r)&&fr(e,r,t[r]);if(cr)for(var r of cr(t))lo.call(t,r)&&fr(e,r,t[r]);return e},yr=(e,t)=>io(e,ao(t)),gt=!1,bt=!1,oe=[];function uo(e){co(e)}function co(e){oe.includes(e)||oe.push(e),fo()}function wr(e){let t=oe.indexOf(e);t!==-1&&oe.splice(t,1)}function fo(){!bt&&!gt&&(gt=!0,queueMicrotask(po))}function po(){gt=!1,bt=!0;for(let e=0;e<oe.length;e++)oe[e]();oe.length=0,bt=!1}var _e,ve,$e,Er,xt=!0;function mo(e){xt=!1,e(),xt=!0}function ho(e){_e=e.reactive,$e=e.release,ve=t=>e.effect(t,{scheduler:r=>{xt?uo(r):r()}}),Er=e.raw}function dr(e){ve=e}function _o(e){let t=()=>{};return[r=>{let n=ve(r);return e._x_effects||(e._x_effects=new Set,e._x_runEffects=()=>{e._x_effects.forEach(o=>o())}),e._x_effects.add(n),t=()=>{n!==void 0&&(e._x_effects.delete(n),$e(n))},n},()=>{t()}]}var kr=[],Ar=[],Or=[];function vo(e){Or.push(e)}function Cr(e,t){typeof t=="function"?(e._x_cleanups||(e._x_cleanups=[]),e._x_cleanups.push(t)):(t=e,Ar.push(t))}function go(e){kr.push(e)}function bo(e,t,r){e._x_attributeCleanups||(e._x_attributeCleanups={}),e._x_attributeCleanups[t]||(e._x_attributeCleanups[t]=[]),e._x_attributeCleanups[t].push(r)}function Sr(e,t){e._x_attributeCleanups&&Object.entries(e._x_attributeCleanups).forEach(([r,n])=>{(t===void 0||t.includes(r))&&(n.forEach(o=>o()),delete e._x_attributeCleanups[r])})}var Nt=new MutationObserver(Rt),Pt=!1;function Mt(){Nt.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),Pt=!0}function Tr(){xo(),Nt.disconnect(),Pt=!1}var Oe=[],mt=!1;function xo(){Oe=Oe.concat(Nt.takeRecords()),Oe.length&&!mt&&(mt=!0,queueMicrotask(()=>{yo(),mt=!1}))}function yo(){Rt(Oe),Oe.length=0}function $(e){if(!Pt)return e();Tr();let t=e();return Mt(),t}var Bt=!1,Ve=[];function wo(){Bt=!0}function Eo(){Bt=!1,Rt(Ve),Ve=[]}function Rt(e){if(Bt){Ve=Ve.concat(e);return}let t=[],r=[],n=new Map,o=new Map;for(let i=0;i<e.length;i++)if(!e[i].target._x_ignoreMutationObserver&&(e[i].type==="childList"&&(e[i].addedNodes.forEach(a=>a.nodeType===1&&t.push(a)),e[i].removedNodes.forEach(a=>a.nodeType===1&&r.push(a))),e[i].type==="attributes")){let a=e[i].target,s=e[i].attributeName,l=e[i].oldValue,u=()=>{n.has(a)||n.set(a,[]),n.get(a).push({name:s,value:a.getAttribute(s)})},f=()=>{o.has(a)||o.set(a,[]),o.get(a).push(s)};a.hasAttribute(s)&&l===null?u():a.hasAttribute(s)?(f(),u()):f()}o.forEach((i,a)=>{Sr(a,i)}),n.forEach((i,a)=>{kr.forEach(s=>s(a,i))});for(let i of r)if(!t.includes(i)&&(Ar.forEach(a=>a(i)),i._x_cleanups))for(;i._x_cleanups.length;)i._x_cleanups.pop()();t.forEach(i=>{i._x_ignoreSelf=!0,i._x_ignore=!0});for(let i of t)r.includes(i)||i.isConnected&&(delete i._x_ignoreSelf,delete i._x_ignore,Or.forEach(a=>a(i)),i._x_ignore=!0,i._x_ignoreSelf=!0);t.forEach(i=>{delete i._x_ignoreSelf,delete i._x_ignore}),t=null,r=null,n=null,o=null}function jr(e){return Ne(pe(e))}function Le(e,t,r){return e._x_dataStack=[t,...pe(r||e)],()=>{e._x_dataStack=e._x_dataStack.filter(n=>n!==t)}}function pr(e,t){let r=e._x_dataStack[0];Object.entries(t).forEach(([n,o])=>{r[n]=o})}function pe(e){return e._x_dataStack?e._x_dataStack:typeof ShadowRoot=="function"&&e instanceof ShadowRoot?pe(e.host):e.parentNode?pe(e.parentNode):[]}function Ne(e){let t=new Proxy({},{ownKeys:()=>Array.from(new Set(e.flatMap(r=>Object.keys(r)))),has:(r,n)=>e.some(o=>o.hasOwnProperty(n)),get:(r,n)=>(e.find(o=>{if(o.hasOwnProperty(n)){let i=Object.getOwnPropertyDescriptor(o,n);if(i.get&&i.get._x_alreadyBound||i.set&&i.set._x_alreadyBound)return!0;if((i.get||i.set)&&i.enumerable){let a=i.get,s=i.set,l=i;a=a&&a.bind(t),s=s&&s.bind(t),a&&(a._x_alreadyBound=!0),s&&(s._x_alreadyBound=!0),Object.defineProperty(o,n,yr(Te({},l),{get:a,set:s}))}return!0}return!1})||{})[n],set:(r,n,o)=>{let i=e.find(a=>a.hasOwnProperty(n));return i?i[n]=o:e[e.length-1][n]=o,!0}});return t}function $r(e){let t=n=>typeof n=="object"&&!Array.isArray(n)&&n!==null,r=(n,o="")=>{Object.entries(Object.getOwnPropertyDescriptors(n)).forEach(([i,{value:a,enumerable:s}])=>{if(s===!1||a===void 0)return;let l=o===""?i:`${o}.${i}`;typeof a=="object"&&a!==null&&a._x_interceptor?n[i]=a.initialize(e,l,i):t(a)&&a!==n&&!(a instanceof Element)&&r(a,l)})};return r(e)}function Lr(e,t=()=>{}){let r={initialValue:void 0,_x_interceptor:!0,initialize(n,o,i){return e(this.initialValue,()=>ko(n,o),a=>Nr(n,o,a),o,i)}};return t(r),n=>{if(typeof n=="object"&&n!==null&&n._x_interceptor){let o=r.initialize.bind(r);r.initialize=(i,a,s)=>{let l=n.initialize(i,a,s);return r.initialValue=l,o(i,a,s)}}else r.initialValue=n;return r}}function ko(e,t){return t.split(".").reduce((r,n)=>r[n],e)}function Nr(e,t,r){if(typeof t=="string"&&(t=t.split(".")),t.length===1)e[t[0]]=r;else{if(t.length===0)throw error;return e[t[0]]||(e[t[0]]={}),Nr(e[t[0]],t.slice(1),r)}}var Pr={};function F(e,t){Pr[e]=t}function yt(e,t){return Object.entries(Pr).forEach(([r,n])=>{Object.defineProperty(e,`$${r}`,{get(){let[o,i]=Ir(t);return o=Te({interceptor:Lr},o),Cr(t,i),n(t,o)},enumerable:!1})}),e}function Ao(e,t,r,...n){try{return r(...n)}catch(o){je(o,e,t)}}function je(e,t,r=void 0){Object.assign(e,{el:t,expression:r}),console.warn(`Alpine Expression Error: ${e.message}
2
-
3
- ${r?'Expression: "'+r+`"
4
-
5
- `:""}`,t),setTimeout(()=>{throw e},0)}var We=!0;function Oo(e){let t=We;We=!1,e(),We=t}function de(e,t,r={}){let n;return M(e,t)(o=>n=o,r),n}function M(...e){return Mr(...e)}var Mr=Br;function Co(e){Mr=e}function Br(e,t){let r={};yt(r,e);let n=[r,...pe(e)];if(typeof t=="function")return So(n,t);let o=jo(n,t,e);return Ao.bind(null,e,t,o)}function So(e,t){return(r=()=>{},{scope:n={},params:o=[]}={})=>{let i=t.apply(Ne([n,...e]),o);He(r,i)}}var ht={};function To(e,t){if(ht[e])return ht[e];let r=Object.getPrototypeOf(async function(){}).constructor,n=/^[\n\s]*if.*\(.*\)/.test(e)||/^(let|const)\s/.test(e)?`(async()=>{ ${e} })()`:e,o=(()=>{try{return new r(["__self","scope"],`with (scope) { __self.result = ${n} }; __self.finished = true; return __self.result;`)}catch(i){return je(i,t,e),Promise.resolve()}})();return ht[e]=o,o}function jo(e,t,r){let n=To(t,r);return(o=()=>{},{scope:i={},params:a=[]}={})=>{n.result=void 0,n.finished=!1;let s=Ne([i,...e]);if(typeof n=="function"){let l=n(n,s).catch(u=>je(u,r,t));n.finished?(He(o,n.result,s,a,r),n.result=void 0):l.then(u=>{He(o,u,s,a,r)}).catch(u=>je(u,r,t)).finally(()=>n.result=void 0)}}}function He(e,t,r,n,o){if(We&&typeof t=="function"){let i=t.apply(r,n);i instanceof Promise?i.then(a=>He(e,a,r,n)).catch(a=>je(a,o,t)):e(i)}else typeof t=="object"&&t instanceof Promise?t.then(i=>e(i)):e(t)}var Dt="x-";function ge(e=""){return Dt+e}function $o(e){Dt=e}var wt={};function O(e,t){return wt[e]=t,{before(r){var n;if(!wt[r]){console.warn("Cannot find directive `${directive}`. `${name}` will use the default order of execution");return}let o=(n=ne.indexOf(r))!=null?n:ne.indexOf("DEFAULT");o>=0&&ne.splice(o,0,e)}}}function It(e,t,r){if(t=Array.from(t),e._x_virtualDirectives){let o=Object.entries(e._x_virtualDirectives).map(([a,s])=>({name:a,value:s})),i=Rr(o);o=o.map(a=>i.find(s=>s.name===a.name)?{name:`x-bind:${a.name}`,value:`"${a.value}"`}:a),t=t.concat(o)}let n={};return t.map(Fr((o,i)=>n[o]=i)).filter(Vr).map(Po(n,r)).sort(Mo).map(o=>No(e,o))}function Rr(e){return Array.from(e).map(Fr()).filter(t=>!Vr(t))}var Et=!1,Ae=new Map,Dr=Symbol();function Lo(e){Et=!0;let t=Symbol();Dr=t,Ae.set(t,[]);let r=()=>{for(;Ae.get(t).length;)Ae.get(t).shift()();Ae.delete(t)},n=()=>{Et=!1,r()};e(r),n()}function Ir(e){let t=[],r=i=>t.push(i),[n,o]=_o(e);return t.push(o),[{Alpine:Me,effect:n,cleanup:r,evaluateLater:M.bind(M,e),evaluate:de.bind(de,e)},()=>t.forEach(i=>i())]}function No(e,t){let r=()=>{},n=wt[t.type]||r,[o,i]=Ir(e);bo(e,t.original,i);let a=()=>{e._x_ignore||e._x_ignoreSelf||(n.inline&&n.inline(e,t,o),n=n.bind(n,e,t,o),Et?Ae.get(Dr).push(n):n())};return a.runCleanups=i,a}var qr=(e,t)=>({name:r,value:n})=>(r.startsWith(e)&&(r=r.replace(e,t)),{name:r,value:n}),zr=e=>e;function Fr(e=()=>{}){return({name:t,value:r})=>{let{name:n,value:o}=Wr.reduce((i,a)=>a(i),{name:t,value:r});return n!==t&&e(n,t),{name:n,value:o}}}var Wr=[];function qt(e){Wr.push(e)}function Vr({name:e}){return Hr().test(e)}var Hr=()=>new RegExp(`^${Dt}([^:^.]+)\\b`);function Po(e,t){return({name:r,value:n})=>{let o=r.match(Hr()),i=r.match(/:([a-zA-Z0-9\-:]+)/),a=r.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],s=t||e[r]||r;return{type:o?o[1]:null,value:i?i[1]:null,modifiers:a.map(l=>l.replace(".","")),expression:n,original:s}}}var kt="DEFAULT",ne=["ignore","ref","data","id","radio","tabs","switch","disclosure","menu","listbox","combobox","bind","init","for","mask","model","modelable","transition","show","if",kt,"teleport"];function Mo(e,t){let r=ne.indexOf(e.type)===-1?kt:e.type,n=ne.indexOf(t.type)===-1?kt:t.type;return ne.indexOf(r)-ne.indexOf(n)}function Ce(e,t,r={}){e.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,composed:!0,cancelable:!0}))}function Z(e,t){if(typeof ShadowRoot=="function"&&e instanceof ShadowRoot){Array.from(e.children).forEach(o=>Z(o,t));return}let r=!1;if(t(e,()=>r=!0),r)return;let n=e.firstElementChild;for(;n;)Z(n,t,!1),n=n.nextElementSibling}function me(e,...t){console.warn(`Alpine Warning: ${e}`,...t)}function Bo(){document.body||me("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?"),Ce(document,"alpine:init"),Ce(document,"alpine:initializing"),Mt(),vo(t=>Y(t,Z)),Cr(t=>Gr(t)),go((t,r)=>{It(t,r).forEach(n=>n())});let e=t=>!Ke(t.parentElement,!0);Array.from(document.querySelectorAll(Xr())).filter(e).forEach(t=>{Y(t)}),Ce(document,"alpine:initialized")}var zt=[],Ur=[];function Jr(){return zt.map(e=>e())}function Xr(){return zt.concat(Ur).map(e=>e())}function Kr(e){zt.push(e)}function Zr(e){Ur.push(e)}function Ke(e,t=!1){return Ze(e,r=>{if((t?Xr():Jr()).some(n=>r.matches(n)))return!0})}function Ze(e,t){if(e){if(t(e))return e;if(e._x_teleportBack&&(e=e._x_teleportBack),!!e.parentElement)return Ze(e.parentElement,t)}}function Ro(e){return Jr().some(t=>e.matches(t))}var Yr=[];function Do(e){Yr.push(e)}function Y(e,t=Z,r=()=>{}){Lo(()=>{t(e,(n,o)=>{r(n,o),Yr.forEach(i=>i(n,o)),It(n,n.attributes).forEach(i=>i()),n._x_ignore&&o()})})}function Gr(e){Z(e,t=>Sr(t))}var At=[],Ft=!1;function Wt(e=()=>{}){return queueMicrotask(()=>{Ft||setTimeout(()=>{Ot()})}),new Promise(t=>{At.push(()=>{e(),t()})})}function Ot(){for(Ft=!1;At.length;)At.shift()()}function Io(){Ft=!0}function Vt(e,t){return Array.isArray(t)?mr(e,t.join(" ")):typeof t=="object"&&t!==null?qo(e,t):typeof t=="function"?Vt(e,t()):mr(e,t)}function mr(e,t){let r=i=>i.split(" ").filter(Boolean),n=i=>i.split(" ").filter(a=>!e.classList.contains(a)).filter(Boolean),o=i=>(e.classList.add(...i),()=>{e.classList.remove(...i)});return t=t===!0?t="":t||"",o(n(t))}function qo(e,t){let r=s=>s.split(" ").filter(Boolean),n=Object.entries(t).flatMap(([s,l])=>l?r(s):!1).filter(Boolean),o=Object.entries(t).flatMap(([s,l])=>l?!1:r(s)).filter(Boolean),i=[],a=[];return o.forEach(s=>{e.classList.contains(s)&&(e.classList.remove(s),a.push(s))}),n.forEach(s=>{e.classList.contains(s)||(e.classList.add(s),i.push(s))}),()=>{a.forEach(s=>e.classList.add(s)),i.forEach(s=>e.classList.remove(s))}}function Ye(e,t){return typeof t=="object"&&t!==null?zo(e,t):Fo(e,t)}function zo(e,t){let r={};return Object.entries(t).forEach(([n,o])=>{r[n]=e.style[n],n.startsWith("--")||(n=Wo(n)),e.style.setProperty(n,o)}),setTimeout(()=>{e.style.length===0&&e.removeAttribute("style")}),()=>{Ye(e,r)}}function Fo(e,t){let r=e.getAttribute("style",t);return e.setAttribute("style",t),()=>{e.setAttribute("style",r||"")}}function Wo(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Ct(e,t=()=>{}){let r=!1;return function(){r?t.apply(this,arguments):(r=!0,e.apply(this,arguments))}}O("transition",(e,{value:t,modifiers:r,expression:n},{evaluate:o})=>{typeof n=="function"&&(n=o(n)),n?Vo(e,n,t):Ho(e,r,t)});function Vo(e,t,r){Qr(e,Vt,""),{enter:n=>{e._x_transition.enter.during=n},"enter-start":n=>{e._x_transition.enter.start=n},"enter-end":n=>{e._x_transition.enter.end=n},leave:n=>{e._x_transition.leave.during=n},"leave-start":n=>{e._x_transition.leave.start=n},"leave-end":n=>{e._x_transition.leave.end=n}}[r](t)}function Ho(e,t,r){Qr(e,Ye);let n=!t.includes("in")&&!t.includes("out")&&!r,o=n||t.includes("in")||["enter"].includes(r),i=n||t.includes("out")||["leave"].includes(r);t.includes("in")&&!n&&(t=t.filter((b,k)=>k<t.indexOf("out"))),t.includes("out")&&!n&&(t=t.filter((b,k)=>k>t.indexOf("out")));let a=!t.includes("opacity")&&!t.includes("scale"),s=a||t.includes("opacity"),l=a||t.includes("scale"),u=s?0:1,f=l?Ee(t,"scale",95)/100:1,d=Ee(t,"delay",0),h=Ee(t,"origin","center"),A="opacity, transform",q=Ee(t,"duration",150)/1e3,ue=Ee(t,"duration",75)/1e3,p="cubic-bezier(0.4, 0.0, 0.2, 1)";o&&(e._x_transition.enter.during={transformOrigin:h,transitionDelay:d,transitionProperty:A,transitionDuration:`${q}s`,transitionTimingFunction:p},e._x_transition.enter.start={opacity:u,transform:`scale(${f})`},e._x_transition.enter.end={opacity:1,transform:"scale(1)"}),i&&(e._x_transition.leave.during={transformOrigin:h,transitionDelay:d,transitionProperty:A,transitionDuration:`${ue}s`,transitionTimingFunction:p},e._x_transition.leave.start={opacity:1,transform:"scale(1)"},e._x_transition.leave.end={opacity:u,transform:`scale(${f})`})}function Qr(e,t,r={}){e._x_transition||(e._x_transition={enter:{during:r,start:r,end:r},leave:{during:r,start:r,end:r},in(n=()=>{},o=()=>{}){St(e,t,{during:this.enter.during,start:this.enter.start,end:this.enter.end},n,o)},out(n=()=>{},o=()=>{}){St(e,t,{during:this.leave.during,start:this.leave.start,end:this.leave.end},n,o)}})}window.Element.prototype._x_toggleAndCascadeWithTransitions=function(e,t,r,n){let o=document.visibilityState==="visible"?requestAnimationFrame:setTimeout,i=()=>o(r);if(t){e._x_transition&&(e._x_transition.enter||e._x_transition.leave)?e._x_transition.enter&&(Object.entries(e._x_transition.enter.during).length||Object.entries(e._x_transition.enter.start).length||Object.entries(e._x_transition.enter.end).length)?e._x_transition.in(r):i():e._x_transition?e._x_transition.in(r):i();return}e._x_hidePromise=e._x_transition?new Promise((a,s)=>{e._x_transition.out(()=>{},()=>a(n)),e._x_transitioning.beforeCancel(()=>s({isFromCancelledTransition:!0}))}):Promise.resolve(n),queueMicrotask(()=>{let a=en(e);a?(a._x_hideChildren||(a._x_hideChildren=[]),a._x_hideChildren.push(e)):o(()=>{let s=l=>{let u=Promise.all([l._x_hidePromise,...(l._x_hideChildren||[]).map(s)]).then(([f])=>f());return delete l._x_hidePromise,delete l._x_hideChildren,u};s(e).catch(l=>{if(!l.isFromCancelledTransition)throw l})})})};function en(e){let t=e.parentNode;if(t)return t._x_hidePromise?t:en(t)}function St(e,t,{during:r,start:n,end:o}={},i=()=>{},a=()=>{}){if(e._x_transitioning&&e._x_transitioning.cancel(),Object.keys(r).length===0&&Object.keys(n).length===0&&Object.keys(o).length===0){i(),a();return}let s,l,u;Uo(e,{start(){s=t(e,n)},during(){l=t(e,r)},before:i,end(){s(),u=t(e,o)},after:a,cleanup(){l(),u()}})}function Uo(e,t){let r,n,o,i=Ct(()=>{$(()=>{r=!0,n||t.before(),o||(t.end(),Ot()),t.after(),e.isConnected&&t.cleanup(),delete e._x_transitioning})});e._x_transitioning={beforeCancels:[],beforeCancel(a){this.beforeCancels.push(a)},cancel:Ct(function(){for(;this.beforeCancels.length;)this.beforeCancels.shift()();i()}),finish:i},$(()=>{t.start(),t.during()}),Io(),requestAnimationFrame(()=>{if(r)return;let a=Number(getComputedStyle(e).transitionDuration.replace(/,.*/,"").replace("s",""))*1e3,s=Number(getComputedStyle(e).transitionDelay.replace(/,.*/,"").replace("s",""))*1e3;a===0&&(a=Number(getComputedStyle(e).animationDuration.replace("s",""))*1e3),$(()=>{t.before()}),n=!0,requestAnimationFrame(()=>{r||($(()=>{t.end()}),Ot(),setTimeout(e._x_transitioning.finish,a+s),o=!0)})})}function Ee(e,t,r){if(e.indexOf(t)===-1)return r;let n=e[e.indexOf(t)+1];if(!n||t==="scale"&&isNaN(n))return r;if(t==="duration"){let o=n.match(/([0-9]+)ms/);if(o)return o[1]}return t==="origin"&&["top","right","left","center","bottom"].includes(e[e.indexOf(t)+2])?[n,e[e.indexOf(t)+2]].join(" "):n}var Ue=!1;function Pe(e,t=()=>{}){return(...r)=>Ue?t(...r):e(...r)}function Jo(e){return(...t)=>Ue&&e(...t)}function Xo(e,t){t._x_dataStack||(t._x_dataStack=e._x_dataStack),Ue=!0,Zo(()=>{Ko(t)}),Ue=!1}function Ko(e){let t=!1;Y(e,(r,n)=>{Z(r,(o,i)=>{if(t&&Ro(o))return i();t=!0,n(o,i)})})}function Zo(e){let t=ve;dr((r,n)=>{let o=t(r);return $e(o),()=>{}}),e(),dr(t)}function tn(e,t,r,n=[]){switch(e._x_bindings||(e._x_bindings=_e({})),e._x_bindings[t]=r,t=n.includes("camel")?ni(t):t,t){case"value":Yo(e,r);break;case"style":Qo(e,r);break;case"class":Go(e,r);break;default:ei(e,t,r);break}}function Yo(e,t){if(e.type==="radio")e.attributes.value===void 0&&(e.value=t),window.fromModel&&(e.checked=hr(e.value,t));else if(e.type==="checkbox")Number.isInteger(t)?e.value=t:!Number.isInteger(t)&&!Array.isArray(t)&&typeof t!="boolean"&&![null,void 0].includes(t)?e.value=String(t):Array.isArray(t)?e.checked=t.some(r=>hr(r,e.value)):e.checked=!!t;else if(e.tagName==="SELECT")ri(e,t);else{if(e.value===t)return;e.value=t}}function Go(e,t){e._x_undoAddedClasses&&e._x_undoAddedClasses(),e._x_undoAddedClasses=Vt(e,t)}function Qo(e,t){e._x_undoAddedStyles&&e._x_undoAddedStyles(),e._x_undoAddedStyles=Ye(e,t)}function ei(e,t,r){[null,void 0,!1].includes(r)&&oi(t)?e.removeAttribute(t):(rn(t)&&(r=t),ti(e,t,r))}function ti(e,t,r){e.getAttribute(t)!=r&&e.setAttribute(t,r)}function ri(e,t){let r=[].concat(t).map(n=>n+"");Array.from(e.options).forEach(n=>{n.selected=r.includes(n.value)})}function ni(e){return e.toLowerCase().replace(/-(\w)/g,(t,r)=>r.toUpperCase())}function hr(e,t){return e==t}function rn(e){return["disabled","checked","required","readonly","hidden","open","selected","autofocus","itemscope","multiple","novalidate","allowfullscreen","allowpaymentrequest","formnovalidate","autoplay","controls","loop","muted","playsinline","default","ismap","reversed","async","defer","nomodule"].includes(e)}function oi(e){return!["aria-pressed","aria-checked","aria-expanded","aria-selected"].includes(e)}function ii(e,t,r){if(e._x_bindings&&e._x_bindings[t]!==void 0)return e._x_bindings[t];let n=e.getAttribute(t);return n===null?typeof r=="function"?r():r:n===""?!0:rn(t)?!![t,"true"].includes(n):n}function nn(e,t){var r;return function(){var n=this,o=arguments,i=function(){r=null,e.apply(n,o)};clearTimeout(r),r=setTimeout(i,t)}}function on(e,t){let r;return function(){let n=this,o=arguments;r||(e.apply(n,o),r=!0,setTimeout(()=>r=!1,t))}}function ai(e){e(Me)}var re={},_r=!1;function si(e,t){if(_r||(re=_e(re),_r=!0),t===void 0)return re[e];re[e]=t,typeof t=="object"&&t!==null&&t.hasOwnProperty("init")&&typeof t.init=="function"&&re[e].init(),$r(re[e])}function li(){return re}var an={};function ui(e,t){let r=typeof t!="function"?()=>t:t;e instanceof Element?sn(e,r()):an[e]=r}function ci(e){return Object.entries(an).forEach(([t,r])=>{Object.defineProperty(e,t,{get(){return(...n)=>r(...n)}})}),e}function sn(e,t,r){let n=[];for(;n.length;)n.pop()();let o=Object.entries(t).map(([a,s])=>({name:a,value:s})),i=Rr(o);o=o.map(a=>i.find(s=>s.name===a.name)?{name:`x-bind:${a.name}`,value:`"${a.value}"`}:a),It(e,o,r).map(a=>{n.push(a.runCleanups),a()})}var ln={};function fi(e,t){ln[e]=t}function di(e,t){return Object.entries(ln).forEach(([r,n])=>{Object.defineProperty(e,r,{get(){return(...o)=>n.bind(t)(...o)},enumerable:!1})}),e}var pi={get reactive(){return _e},get release(){return $e},get effect(){return ve},get raw(){return Er},version:"3.11.1",flushAndStopDeferringMutations:Eo,dontAutoEvaluateFunctions:Oo,disableEffectScheduling:mo,startObservingMutations:Mt,stopObservingMutations:Tr,setReactivityEngine:ho,closestDataStack:pe,skipDuringClone:Pe,onlyDuringClone:Jo,addRootSelector:Kr,addInitSelector:Zr,addScopeToNode:Le,deferMutations:wo,mapAttributes:qt,evaluateLater:M,interceptInit:Do,setEvaluator:Co,mergeProxies:Ne,findClosest:Ze,closestRoot:Ke,destroyTree:Gr,interceptor:Lr,transition:St,setStyles:Ye,mutateDom:$,directive:O,throttle:on,debounce:nn,evaluate:de,initTree:Y,nextTick:Wt,prefixed:ge,prefix:$o,plugin:ai,magic:F,store:si,start:Bo,clone:Xo,bound:ii,$data:jr,walk:Z,data:fi,bind:ui},Me=pi;function un(e,t){let r=Object.create(null),n=e.split(",");for(let o=0;o<n.length;o++)r[n[o]]=!0;return t?o=>!!r[o.toLowerCase()]:o=>!!r[o]}var mi="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Xa=un(mi+",async,autofocus,autoplay,controls,default,defer,disabled,hidden,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected"),hi=Object.freeze({}),Ka=Object.freeze([]),cn=Object.assign,_i=Object.prototype.hasOwnProperty,Ge=(e,t)=>_i.call(e,t),ie=Array.isArray,Se=e=>fn(e)==="[object Map]",vi=e=>typeof e=="string",Ht=e=>typeof e=="symbol",Qe=e=>e!==null&&typeof e=="object",gi=Object.prototype.toString,fn=e=>gi.call(e),dn=e=>fn(e).slice(8,-1),Ut=e=>vi(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,et=e=>{let t=Object.create(null);return r=>t[r]||(t[r]=e(r))},bi=/-(\w)/g,Za=et(e=>e.replace(bi,(t,r)=>r?r.toUpperCase():"")),xi=/\B([A-Z])/g,Ya=et(e=>e.replace(xi,"-$1").toLowerCase()),pn=et(e=>e.charAt(0).toUpperCase()+e.slice(1)),Ga=et(e=>e?`on${pn(e)}`:""),mn=(e,t)=>e!==t&&(e===e||t===t),Tt=new WeakMap,ke=[],V,ae=Symbol("iterate"),jt=Symbol("Map key iterate");function yi(e){return e&&e._isEffect===!0}function wi(e,t=hi){yi(e)&&(e=e.raw);let r=Ai(e,t);return t.lazy||r(),r}function Ei(e){e.active&&(hn(e),e.options.onStop&&e.options.onStop(),e.active=!1)}var ki=0;function Ai(e,t){let r=function(){if(!r.active)return e();if(!ke.includes(r)){hn(r);try{return Ci(),ke.push(r),V=r,e()}finally{ke.pop(),_n(),V=ke[ke.length-1]}}};return r.id=ki++,r.allowRecurse=!!t.allowRecurse,r._isEffect=!0,r.active=!0,r.raw=e,r.deps=[],r.options=t,r}function hn(e){let{deps:t}=e;if(t.length){for(let r=0;r<t.length;r++)t[r].delete(e);t.length=0}}var he=!0,Jt=[];function Oi(){Jt.push(he),he=!1}function Ci(){Jt.push(he),he=!0}function _n(){let e=Jt.pop();he=e===void 0?!0:e}function z(e,t,r){if(!he||V===void 0)return;let n=Tt.get(e);n||Tt.set(e,n=new Map);let o=n.get(r);o||n.set(r,o=new Set),o.has(V)||(o.add(V),V.deps.push(o),V.options.onTrack&&V.options.onTrack({effect:V,target:e,type:t,key:r}))}function G(e,t,r,n,o,i){let a=Tt.get(e);if(!a)return;let s=new Set,l=f=>{f&&f.forEach(d=>{(d!==V||d.allowRecurse)&&s.add(d)})};if(t==="clear")a.forEach(l);else if(r==="length"&&ie(e))a.forEach((f,d)=>{(d==="length"||d>=n)&&l(f)});else switch(r!==void 0&&l(a.get(r)),t){case"add":ie(e)?Ut(r)&&l(a.get("length")):(l(a.get(ae)),Se(e)&&l(a.get(jt)));break;case"delete":ie(e)||(l(a.get(ae)),Se(e)&&l(a.get(jt)));break;case"set":Se(e)&&l(a.get(ae));break}let u=f=>{f.options.onTrigger&&f.options.onTrigger({effect:f,target:e,key:r,type:t,newValue:n,oldValue:o,oldTarget:i}),f.options.scheduler?f.options.scheduler(f):f()};s.forEach(u)}var Si=un("__proto__,__v_isRef,__isVue"),vn=new Set(Object.getOwnPropertyNames(Symbol).map(e=>Symbol[e]).filter(Ht)),Ti=tt(),ji=tt(!1,!0),$i=tt(!0),Li=tt(!0,!0),Je={};["includes","indexOf","lastIndexOf"].forEach(e=>{let t=Array.prototype[e];Je[e]=function(...r){let n=w(this);for(let i=0,a=this.length;i<a;i++)z(n,"get",i+"");let o=t.apply(n,r);return o===-1||o===!1?t.apply(n,r.map(w)):o}});["push","pop","shift","unshift","splice"].forEach(e=>{let t=Array.prototype[e];Je[e]=function(...r){Oi();let n=t.apply(this,r);return _n(),n}});function tt(e=!1,t=!1){return function(r,n,o){if(n==="__v_isReactive")return!e;if(n==="__v_isReadonly")return e;if(n==="__v_raw"&&o===(e?t?Fi:$n:t?zi:jn).get(r))return r;let i=ie(r);if(!e&&i&&Ge(Je,n))return Reflect.get(Je,n,o);let a=Reflect.get(r,n,o);return(Ht(n)?vn.has(n):Si(n))||(e||z(r,"get",n),t)?a:$t(a)?!i||!Ut(n)?a.value:a:Qe(a)?e?Ln(a):Yt(a):a}}var Ni=gn(),Pi=gn(!0);function gn(e=!1){return function(t,r,n,o){let i=t[r];if(!e&&(n=w(n),i=w(i),!ie(t)&&$t(i)&&!$t(n)))return i.value=n,!0;let a=ie(t)&&Ut(r)?Number(r)<t.length:Ge(t,r),s=Reflect.set(t,r,n,o);return t===w(o)&&(a?mn(n,i)&&G(t,"set",r,n,i):G(t,"add",r,n)),s}}function Mi(e,t){let r=Ge(e,t),n=e[t],o=Reflect.deleteProperty(e,t);return o&&r&&G(e,"delete",t,void 0,n),o}function Bi(e,t){let r=Reflect.has(e,t);return(!Ht(t)||!vn.has(t))&&z(e,"has",t),r}function Ri(e){return z(e,"iterate",ie(e)?"length":ae),Reflect.ownKeys(e)}var bn={get:Ti,set:Ni,deleteProperty:Mi,has:Bi,ownKeys:Ri},xn={get:$i,set(e,t){return console.warn(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0},deleteProperty(e,t){return console.warn(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}},Qa=cn({},bn,{get:ji,set:Pi}),es=cn({},xn,{get:Li}),Xt=e=>Qe(e)?Yt(e):e,Kt=e=>Qe(e)?Ln(e):e,Zt=e=>e,rt=e=>Reflect.getPrototypeOf(e);function nt(e,t,r=!1,n=!1){e=e.__v_raw;let o=w(e),i=w(t);t!==i&&!r&&z(o,"get",t),!r&&z(o,"get",i);let{has:a}=rt(o),s=n?Zt:r?Kt:Xt;if(a.call(o,t))return s(e.get(t));if(a.call(o,i))return s(e.get(i));e!==o&&e.get(t)}function ot(e,t=!1){let r=this.__v_raw,n=w(r),o=w(e);return e!==o&&!t&&z(n,"has",e),!t&&z(n,"has",o),e===o?r.has(e):r.has(e)||r.has(o)}function it(e,t=!1){return e=e.__v_raw,!t&&z(w(e),"iterate",ae),Reflect.get(e,"size",e)}function yn(e){e=w(e);let t=w(this);return rt(t).has.call(t,e)||(t.add(e),G(t,"add",e,e)),this}function wn(e,t){t=w(t);let r=w(this),{has:n,get:o}=rt(r),i=n.call(r,e);i?Tn(r,n,e):(e=w(e),i=n.call(r,e));let a=o.call(r,e);return r.set(e,t),i?mn(t,a)&&G(r,"set",e,t,a):G(r,"add",e,t),this}function En(e){let t=w(this),{has:r,get:n}=rt(t),o=r.call(t,e);o?Tn(t,r,e):(e=w(e),o=r.call(t,e));let i=n?n.call(t,e):void 0,a=t.delete(e);return o&&G(t,"delete",e,void 0,i),a}function kn(){let e=w(this),t=e.size!==0,r=Se(e)?new Map(e):new Set(e),n=e.clear();return t&&G(e,"clear",void 0,void 0,r),n}function at(e,t){return function(r,n){let o=this,i=o.__v_raw,a=w(i),s=t?Zt:e?Kt:Xt;return!e&&z(a,"iterate",ae),i.forEach((l,u)=>r.call(n,s(l),s(u),o))}}function Fe(e,t,r){return function(...n){let o=this.__v_raw,i=w(o),a=Se(i),s=e==="entries"||e===Symbol.iterator&&a,l=e==="keys"&&a,u=o[e](...n),f=r?Zt:t?Kt:Xt;return!t&&z(i,"iterate",l?jt:ae),{next(){let{value:d,done:h}=u.next();return h?{value:d,done:h}:{value:s?[f(d[0]),f(d[1])]:f(d),done:h}},[Symbol.iterator](){return this}}}}function K(e){return function(...t){{let r=t[0]?`on key "${t[0]}" `:"";console.warn(`${pn(e)} operation ${r}failed: target is readonly.`,w(this))}return e==="delete"?!1:this}}var An={get(e){return nt(this,e)},get size(){return it(this)},has:ot,add:yn,set:wn,delete:En,clear:kn,forEach:at(!1,!1)},On={get(e){return nt(this,e,!1,!0)},get size(){return it(this)},has:ot,add:yn,set:wn,delete:En,clear:kn,forEach:at(!1,!0)},Cn={get(e){return nt(this,e,!0)},get size(){return it(this,!0)},has(e){return ot.call(this,e,!0)},add:K("add"),set:K("set"),delete:K("delete"),clear:K("clear"),forEach:at(!0,!1)},Sn={get(e){return nt(this,e,!0,!0)},get size(){return it(this,!0)},has(e){return ot.call(this,e,!0)},add:K("add"),set:K("set"),delete:K("delete"),clear:K("clear"),forEach:at(!0,!0)},Di=["keys","values","entries",Symbol.iterator];Di.forEach(e=>{An[e]=Fe(e,!1,!1),Cn[e]=Fe(e,!0,!1),On[e]=Fe(e,!1,!0),Sn[e]=Fe(e,!0,!0)});function st(e,t){let r=t?e?Sn:On:e?Cn:An;return(n,o,i)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?n:Reflect.get(Ge(r,o)&&o in n?r:n,o,i)}var Ii={get:st(!1,!1)},ts={get:st(!1,!0)},qi={get:st(!0,!1)},rs={get:st(!0,!0)};function Tn(e,t,r){let n=w(r);if(n!==r&&t.call(e,n)){let o=dn(e);console.warn(`Reactive ${o} contains both the raw and reactive versions of the same object${o==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}var jn=new WeakMap,zi=new WeakMap,$n=new WeakMap,Fi=new WeakMap;function Wi(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Vi(e){return e.__v_skip||!Object.isExtensible(e)?0:Wi(dn(e))}function Yt(e){return e&&e.__v_isReadonly?e:Nn(e,!1,bn,Ii,jn)}function Ln(e){return Nn(e,!0,xn,qi,$n)}function Nn(e,t,r,n,o){if(!Qe(e))return console.warn(`value cannot be made reactive: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;let i=o.get(e);if(i)return i;let a=Vi(e);if(a===0)return e;let s=new Proxy(e,a===2?n:r);return o.set(e,s),s}function w(e){return e&&w(e.__v_raw)||e}function $t(e){return Boolean(e&&e.__v_isRef===!0)}F("nextTick",()=>Wt);F("dispatch",e=>Ce.bind(Ce,e));F("watch",(e,{evaluateLater:t,effect:r})=>(n,o)=>{let i=t(n),a=!0,s,l=r(()=>i(u=>{JSON.stringify(u),a?s=u:queueMicrotask(()=>{o(u,s),s=u}),a=!1}));e._x_effects.delete(l)});F("store",li);F("data",e=>jr(e));F("root",e=>Ke(e));F("refs",e=>(e._x_refs_proxy||(e._x_refs_proxy=Ne(Hi(e))),e._x_refs_proxy));function Hi(e){let t=[],r=e;for(;r;)r._x_refs&&t.push(r._x_refs),r=r.parentNode;return t}var _t={};function Pn(e){return _t[e]||(_t[e]=0),++_t[e]}function Ui(e,t){return Ze(e,r=>{if(r._x_ids&&r._x_ids[t])return!0})}function Ji(e,t){e._x_ids||(e._x_ids={}),e._x_ids[t]||(e._x_ids[t]=Pn(t))}F("id",e=>(t,r=null)=>{let n=Ui(e,t),o=n?n._x_ids[t]:Pn(t);return r?`${t}-${o}-${r}`:`${t}-${o}`});F("el",e=>e);Mn("Focus","focus","focus");Mn("Persist","persist","persist");function Mn(e,t,r){F(t,n=>me(`You can't use [$${directiveName}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${r}`,n))}function Xi({get:e,set:t},{get:r,set:n}){let o=!0,i,a,s,l,u=ve(()=>{let f,d;o?(f=e(),n(f),d=r(),o=!1):(f=e(),d=r(),s=JSON.stringify(f),l=JSON.stringify(d),s!==i?(d=r(),n(f),d=f):(t(d),f=d)),i=JSON.stringify(f),a=JSON.stringify(d)});return()=>{$e(u)}}O("modelable",(e,{expression:t},{effect:r,evaluateLater:n,cleanup:o})=>{let i=n(t),a=()=>{let f;return i(d=>f=d),f},s=n(`${t} = __placeholder`),l=f=>s(()=>{},{scope:{__placeholder:f}}),u=a();l(u),queueMicrotask(()=>{if(!e._x_model)return;e._x_removeModelListeners.default();let f=e._x_model.get,d=e._x_model.set,h=Xi({get(){return f()},set(A){d(A)}},{get(){return a()},set(A){l(A)}});o(h)})});var Ki=document.createElement("div");O("teleport",(e,{modifiers:t,expression:r},{cleanup:n})=>{e.tagName.toLowerCase()!=="template"&&me("x-teleport can only be used on a <template> tag",e);let o=Pe(()=>document.querySelector(r),()=>Ki)();o||me(`Cannot find x-teleport element for selector: "${r}"`);let i=e.content.cloneNode(!0).firstElementChild;e._x_teleport=i,i._x_teleportBack=e,e._x_forwardEvents&&e._x_forwardEvents.forEach(a=>{i.addEventListener(a,s=>{s.stopPropagation(),e.dispatchEvent(new s.constructor(s.type,s))})}),Le(i,{},e),$(()=>{t.includes("prepend")?o.parentNode.insertBefore(i,o):t.includes("append")?o.parentNode.insertBefore(i,o.nextSibling):o.appendChild(i),Y(i),i._x_ignore=!0}),n(()=>i.remove())});var Bn=()=>{};Bn.inline=(e,{modifiers:t},{cleanup:r})=>{t.includes("self")?e._x_ignoreSelf=!0:e._x_ignore=!0,r(()=>{t.includes("self")?delete e._x_ignoreSelf:delete e._x_ignore})};O("ignore",Bn);O("effect",(e,{expression:t},{effect:r})=>r(M(e,t)));function Lt(e,t,r,n){let o=e,i=l=>n(l),a={},s=(l,u)=>f=>u(l,f);if(r.includes("dot")&&(t=Zi(t)),r.includes("camel")&&(t=Yi(t)),r.includes("passive")&&(a.passive=!0),r.includes("capture")&&(a.capture=!0),r.includes("window")&&(o=window),r.includes("document")&&(o=document),r.includes("prevent")&&(i=s(i,(l,u)=>{u.preventDefault(),l(u)})),r.includes("stop")&&(i=s(i,(l,u)=>{u.stopPropagation(),l(u)})),r.includes("self")&&(i=s(i,(l,u)=>{u.target===e&&l(u)})),(r.includes("away")||r.includes("outside"))&&(o=document,i=s(i,(l,u)=>{e.contains(u.target)||u.target.isConnected!==!1&&(e.offsetWidth<1&&e.offsetHeight<1||e._x_isShown!==!1&&l(u))})),r.includes("once")&&(i=s(i,(l,u)=>{l(u),o.removeEventListener(t,i,a)})),i=s(i,(l,u)=>{Qi(t)&&ea(u,r)||l(u)}),r.includes("debounce")){let l=r[r.indexOf("debounce")+1]||"invalid-wait",u=Xe(l.split("ms")[0])?Number(l.split("ms")[0]):250;i=nn(i,u)}if(r.includes("throttle")){let l=r[r.indexOf("throttle")+1]||"invalid-wait",u=Xe(l.split("ms")[0])?Number(l.split("ms")[0]):250;i=on(i,u)}return o.addEventListener(t,i,a),()=>{o.removeEventListener(t,i,a)}}function Zi(e){return e.replace(/-/g,".")}function Yi(e){return e.toLowerCase().replace(/-(\w)/g,(t,r)=>r.toUpperCase())}function Xe(e){return!Array.isArray(e)&&!isNaN(e)}function Gi(e){return[" ","_"].includes(e)?e:e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]/,"-").toLowerCase()}function Qi(e){return["keydown","keyup"].includes(e)}function ea(e,t){let r=t.filter(o=>!["window","document","prevent","stop","once"].includes(o));if(r.includes("debounce")){let o=r.indexOf("debounce");r.splice(o,Xe((r[o+1]||"invalid-wait").split("ms")[0])?2:1)}if(r.includes("throttle")){let o=r.indexOf("throttle");r.splice(o,Xe((r[o+1]||"invalid-wait").split("ms")[0])?2:1)}if(r.length===0||r.length===1&&vr(e.key).includes(r[0]))return!1;let n=["ctrl","shift","alt","meta","cmd","super"].filter(o=>r.includes(o));return r=r.filter(o=>!n.includes(o)),!(n.length>0&&n.filter(o=>((o==="cmd"||o==="super")&&(o="meta"),e[`${o}Key`])).length===n.length&&vr(e.key).includes(r[0]))}function vr(e){if(!e)return[];e=Gi(e);let t={ctrl:"control",slash:"/",space:" ",spacebar:" ",cmd:"meta",esc:"escape",up:"arrow-up",down:"arrow-down",left:"arrow-left",right:"arrow-right",period:".",equal:"=",minus:"-",underscore:"_"};return t[e]=e,Object.keys(t).map(r=>{if(t[r]===e)return r}).filter(r=>r)}O("model",(e,{modifiers:t,expression:r},{effect:n,cleanup:o})=>{let i=e;t.includes("parent")&&(i=e.parentNode);let a=M(i,r),s;typeof r=="string"?s=M(i,`${r} = __placeholder`):typeof r=="function"&&typeof r()=="string"?s=M(i,`${r()} = __placeholder`):s=()=>{};let l=()=>{let h;return a(A=>h=A),gr(h)?h.get():h},u=h=>{let A;a(q=>A=q),gr(A)?A.set(h):s(()=>{},{scope:{__placeholder:h}})};typeof r=="string"&&e.type==="radio"&&$(()=>{e.hasAttribute("name")||e.setAttribute("name",r)});var f=e.tagName.toLowerCase()==="select"||["checkbox","radio"].includes(e.type)||t.includes("lazy")?"change":"input";let d=Lt(e,f,t,h=>{u(ta(e,t,h,l()))});if(e._x_removeModelListeners||(e._x_removeModelListeners={}),e._x_removeModelListeners.default=d,o(()=>e._x_removeModelListeners.default()),e.form){let h=Lt(e.form,"reset",[],A=>{Wt(()=>e._x_model&&e._x_model.set(e.value))});o(()=>h())}e._x_model={get(){return l()},set(h){u(h)}},e._x_forceModelUpdate=h=>{h=h===void 0?l():h,h===void 0&&typeof r=="string"&&r.match(/\./)&&(h=""),window.fromModel=!0,$(()=>tn(e,"value",h)),delete window.fromModel},n(()=>{let h=l();t.includes("unintrusive")&&document.activeElement.isSameNode(e)||e._x_forceModelUpdate(h)})});function ta(e,t,r,n){return $(()=>{if(r instanceof CustomEvent&&r.detail!==void 0)return typeof r.detail<"u"?r.detail:r.target.value;if(e.type==="checkbox")if(Array.isArray(n)){let o=t.includes("number")?vt(r.target.value):r.target.value;return r.target.checked?n.concat([o]):n.filter(i=>!ra(i,o))}else return r.target.checked;else{if(e.tagName.toLowerCase()==="select"&&e.multiple)return t.includes("number")?Array.from(r.target.selectedOptions).map(o=>{let i=o.value||o.text;return vt(i)}):Array.from(r.target.selectedOptions).map(o=>o.value||o.text);{let o=r.target.value;return t.includes("number")?vt(o):t.includes("trim")?o.trim():o}}})}function vt(e){let t=e?parseFloat(e):null;return na(t)?t:e}function ra(e,t){return e==t}function na(e){return!Array.isArray(e)&&!isNaN(e)}function gr(e){return e!==null&&typeof e=="object"&&typeof e.get=="function"&&typeof e.set=="function"}O("cloak",e=>queueMicrotask(()=>$(()=>e.removeAttribute(ge("cloak")))));Zr(()=>`[${ge("init")}]`);O("init",Pe((e,{expression:t},{evaluate:r})=>typeof t=="string"?!!t.trim()&&r(t,{},!1):r(t,{},!1)));O("text",(e,{expression:t},{effect:r,evaluateLater:n})=>{let o=n(t);r(()=>{o(i=>{$(()=>{e.textContent=i})})})});O("html",(e,{expression:t},{effect:r,evaluateLater:n})=>{let o=n(t);r(()=>{o(i=>{$(()=>{e.innerHTML=i,e._x_ignoreSelf=!0,Y(e),delete e._x_ignoreSelf})})})});qt(qr(":",zr(ge("bind:"))));O("bind",(e,{value:t,modifiers:r,expression:n,original:o},{effect:i})=>{if(!t){let s={};ci(s),M(e,n)(l=>{sn(e,l,o)},{scope:s});return}if(t==="key")return oa(e,n);let a=M(e,n);i(()=>a(s=>{s===void 0&&typeof n=="string"&&n.match(/\./)&&(s=""),$(()=>tn(e,t,s,r))}))});function oa(e,t){e._x_keyExpression=t}Kr(()=>`[${ge("data")}]`);O("data",Pe((e,{expression:t},{cleanup:r})=>{t=t===""?"{}":t;let n={};yt(n,e);let o={};di(o,n);let i=de(e,t,{scope:o});i===void 0&&(i={}),yt(i,e);let a=_e(i);$r(a);let s=Le(e,a);a.init&&de(e,a.init),r(()=>{a.destroy&&de(e,a.destroy),s()})}));O("show",(e,{modifiers:t,expression:r},{effect:n})=>{let o=M(e,r);e._x_doHide||(e._x_doHide=()=>{$(()=>{e.style.setProperty("display","none",t.includes("important")?"important":void 0)})}),e._x_doShow||(e._x_doShow=()=>{$(()=>{e.style.length===1&&e.style.display==="none"?e.removeAttribute("style"):e.style.removeProperty("display")})});let i=()=>{e._x_doHide(),e._x_isShown=!1},a=()=>{e._x_doShow(),e._x_isShown=!0},s=()=>setTimeout(a),l=Ct(d=>d?a():i(),d=>{typeof e._x_toggleAndCascadeWithTransitions=="function"?e._x_toggleAndCascadeWithTransitions(e,d,a,i):d?s():i()}),u,f=!0;n(()=>o(d=>{!f&&d===u||(t.includes("immediate")&&(d?s():i()),l(d),u=d,f=!1)}))});O("for",(e,{expression:t},{effect:r,cleanup:n})=>{let o=aa(t),i=M(e,o.items),a=M(e,e._x_keyExpression||"index");e._x_prevKeys=[],e._x_lookup={},r(()=>ia(e,o,i,a)),n(()=>{Object.values(e._x_lookup).forEach(s=>s.remove()),delete e._x_prevKeys,delete e._x_lookup})});function ia(e,t,r,n){let o=a=>typeof a=="object"&&!Array.isArray(a),i=e;r(a=>{sa(a)&&a>=0&&(a=Array.from(Array(a).keys(),p=>p+1)),a===void 0&&(a=[]);let s=e._x_lookup,l=e._x_prevKeys,u=[],f=[];if(o(a))a=Object.entries(a).map(([p,b])=>{let k=br(t,b,p,a);n(T=>f.push(T),{scope:Te({index:p},k)}),u.push(k)});else for(let p=0;p<a.length;p++){let b=br(t,a[p],p,a);n(k=>f.push(k),{scope:Te({index:p},b)}),u.push(b)}let d=[],h=[],A=[],q=[];for(let p=0;p<l.length;p++){let b=l[p];f.indexOf(b)===-1&&A.push(b)}l=l.filter(p=>!A.includes(p));let ue="template";for(let p=0;p<f.length;p++){let b=f[p],k=l.indexOf(b);if(k===-1)l.splice(p,0,b),d.push([ue,p]);else if(k!==p){let T=l.splice(p,1)[0],j=l.splice(k-1,1)[0];l.splice(p,0,j),l.splice(k,0,T),h.push([T,j])}else q.push(b);ue=b}for(let p=0;p<A.length;p++){let b=A[p];s[b]._x_effects&&s[b]._x_effects.forEach(wr),s[b].remove(),s[b]=null,delete s[b]}for(let p=0;p<h.length;p++){let[b,k]=h[p],T=s[b],j=s[k],te=document.createElement("div");$(()=>{j.after(te),T.after(j),j._x_currentIfEl&&j.after(j._x_currentIfEl),te.before(T),T._x_currentIfEl&&T.after(T._x_currentIfEl),te.remove()}),pr(j,u[f.indexOf(k)])}for(let p=0;p<d.length;p++){let[b,k]=d[p],T=b==="template"?i:s[b];T._x_currentIfEl&&(T=T._x_currentIfEl);let j=u[k],te=f[k],X=document.importNode(i.content,!0).firstElementChild;Le(X,_e(j),i),$(()=>{T.after(X),Y(X)}),typeof te=="object"&&me("x-for key cannot be an object, it must be a string or an integer",i),s[te]=X}for(let p=0;p<q.length;p++)pr(s[q[p]],u[f.indexOf(q[p])]);i._x_prevKeys=f})}function aa(e){let t=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,r=/^\s*\(|\)\s*$/g,n=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,o=e.match(n);if(!o)return;let i={};i.items=o[2].trim();let a=o[1].replace(r,"").trim(),s=a.match(t);return s?(i.item=a.replace(t,"").trim(),i.index=s[1].trim(),s[2]&&(i.collection=s[2].trim())):i.item=a,i}function br(e,t,r,n){let o={};return/^\[.*\]$/.test(e.item)&&Array.isArray(t)?e.item.replace("[","").replace("]","").split(",").map(i=>i.trim()).forEach((i,a)=>{o[i]=t[a]}):/^\{.*\}$/.test(e.item)&&!Array.isArray(t)&&typeof t=="object"?e.item.replace("{","").replace("}","").split(",").map(i=>i.trim()).forEach(i=>{o[i]=t[i]}):o[e.item]=t,e.index&&(o[e.index]=r),e.collection&&(o[e.collection]=n),o}function sa(e){return!Array.isArray(e)&&!isNaN(e)}function Rn(){}Rn.inline=(e,{expression:t},{cleanup:r})=>{let n=Ke(e);n._x_refs||(n._x_refs={}),n._x_refs[t]=e,r(()=>delete n._x_refs[t])};O("ref",Rn);O("if",(e,{expression:t},{effect:r,cleanup:n})=>{let o=M(e,t),i=()=>{if(e._x_currentIfEl)return e._x_currentIfEl;let s=e.content.cloneNode(!0).firstElementChild;return Le(s,{},e),$(()=>{e.after(s),Y(s)}),e._x_currentIfEl=s,e._x_undoIf=()=>{Z(s,l=>{l._x_effects&&l._x_effects.forEach(wr)}),s.remove(),delete e._x_currentIfEl},s},a=()=>{e._x_undoIf&&(e._x_undoIf(),delete e._x_undoIf)};r(()=>o(s=>{s?i():a()})),n(()=>e._x_undoIf&&e._x_undoIf())});O("id",(e,{expression:t},{evaluate:r})=>{r(t).forEach(n=>Ji(e,n))});qt(qr("@",zr(ge("on:"))));O("on",Pe((e,{value:t,modifiers:r,expression:n},{cleanup:o})=>{let i=n?M(e,n):()=>{};e.tagName.toLowerCase()==="template"&&(e._x_forwardEvents||(e._x_forwardEvents=[]),e._x_forwardEvents.includes(t)||e._x_forwardEvents.push(t));let a=Lt(e,t,r,s=>{i(()=>{},{scope:{$event:s},params:[s]})});o(()=>a())}));lt("Collapse","collapse","collapse");lt("Intersect","intersect","intersect");lt("Focus","trap","focus");lt("Mask","mask","mask");function lt(e,t,r){O(t,n=>me(`You can't use [x-${t}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${r}`,n))}Me.setEvaluator(Br);Me.setReactivityEngine({reactive:Yt,effect:wi,release:Ei,raw:w});var la=Me,Dn=la;function ua(e){let t=document.createElement("template");return t.innerHTML=e,t.content.firstElementChild}function ca(e){return e.nodeType===3||e.nodeType===8}var y={replace(e,t,r){let n=e.indexOf(t);if(n===-1)throw"Cant find element in children";return t.replaceWith(r),e[n]=r,e},before(e,t,r){let n=e.indexOf(t);if(n===-1)throw"Cant find element in children";return t.before(r),e.splice(n,0,r),e},append(e,t,r){let n=e[e.length-1];return r(t),e.push(t),e},remove(e,t){if(e.indexOf(t)===-1)throw"Cant find element in children";return t.remove(),e.filter(r=>r!==t)},first(e){return this.teleportTo(e[0])},next(e,t){let r=e.indexOf(t);if(r!==-1)return this.teleportTo(this.teleportBack(e[r+1]))},teleportTo(e){return e&&(e._x_teleport?e._x_teleport:e)},teleportBack(e){return e&&(e._x_teleportBack?e._x_teleportBack:e)}},fa=()=>{},da=()=>{};function Gt(e,t,r){let n,o,i,a,s,l,u,f,d,h;function A(c={}){let m=S=>S.getAttribute("key"),g=()=>{};s=c.updating||g,l=c.updated||g,u=c.removing||g,f=c.removed||g,d=c.adding||g,h=c.added||g,i=c.key||m,a=c.lookahead||!1}function q(c,m){if(ue(c,m))return p(c,m);let g=!1;if(!ce(s,c,m,()=>g=!0)){if(window.Alpine&&pa(c,m,()=>g=!0),ca(m)){b(c,m),l(c,m);return}g||k(c,m),l(c,m),T(Array.from(c.childNodes),Array.from(m.childNodes),S=>{c.appendChild(S)})}}function ue(c,m){return c.nodeType!=m.nodeType||c.nodeName!=m.nodeName||j(c)!=j(m)}function p(c,m){if(ce(u,c))return;let g=m.cloneNode(!0);ce(d,g)||(y.replace([c],c,g),f(c),h(g))}function b(c,m){let g=m.nodeValue;c.nodeValue!==g&&(c.nodeValue=g)}function k(c,m){if(c._x_isShown&&!m._x_isShown||!c._x_isShown&&m._x_isShown)return;let g=Array.from(c.attributes),S=Array.from(m.attributes);for(let L=g.length-1;L>=0;L--){let v=g[L].name;m.hasAttribute(v)||c.removeAttribute(v)}for(let L=S.length-1;L>=0;L--){let v=S[L].name,_=S[L].value;c.getAttribute(v)!==_&&c.setAttribute(v,_)}}function T(c,m,g){let S={},L={},v=y.first(m),_=y.first(c);for(;v;){let R=j(v),W=j(_);if(!_)if(R&&L[R]){let E=L[R];c=y.append(c,E,g),_=E}else{if(!ce(d,v)){let E=v.cloneNode(!0);c=y.append(c,E,g),h(E)}v=y.next(m,v);continue}let qe=E=>E.nodeType===8&&E.textContent===" __BLOCK__ ",ze=E=>E.nodeType===8&&E.textContent===" __ENDBLOCK__ ";if(qe(v)&&qe(_)){let E=[],we,U=0;for(;_;){let N=y.next(c,_);if(qe(N))U++;else if(ze(N)&&U>0)U--;else if(ze(N)&&U===0){_=y.next(c,N),we=N;break}E.push(N),_=N}let sr=[];for(U=0;v;){let N=y.next(m,v);if(qe(N))U++;else if(ze(N)&&U>0)U--;else if(ze(N)&&U===0){v=y.next(m,N);break}sr.push(N),v=N}T(E,sr,N=>we.before(N));continue}if(_.nodeType===1&&a){let E=y.next(m,v),we=!1;for(;!we&&E;)_.isEqualNode(E)&&(we=!0,[c,_]=X(c,v,_),W=j(_)),E=y.next(m,E)}if(R!==W){if(!R&&W){L[W]=_,[c,_]=X(c,v,_),c=y.remove(c,L[W]),_=y.next(c,_),v=y.next(m,v);continue}if(R&&!W&&S[R]&&(c=y.replace(c,_,S[R]),_=S[R]),R&&W){let E=S[R];if(E)L[W]=_,c=y.replace(c,_,E),_=E;else{L[W]=_,[c,_]=X(c,v,_),c=y.remove(c,L[W]),_=y.next(c,_),v=y.next(m,v);continue}}}let Gn=_&&y.next(c,_);q(_,v),v=v&&y.next(m,v),_=Gn}let pt=[];for(;_;)ce(u,_)||pt.push(_),_=y.next(c,_);for(;pt.length;){let R=pt.shift();R.remove(),f(R)}}function j(c){return c&&c.nodeType===1&&i(c)}function te(c){let m={};return c.forEach(g=>{let S=j(g);S&&(m[S]=g)}),m}function X(c,m,g){if(!ce(d,m)){let S=m.cloneNode(!0);return c=y.before(c,g,S),h(S),[c,S]}return[c,m]}return A(r),n=e,o=typeof t=="string"?ua(t):t,window.Alpine&&window.Alpine.closestDataStack&&!e._x_dataStack&&(o._x_dataStack=window.Alpine.closestDataStack(e),o._x_dataStack&&window.Alpine.clone(e,o)),q(e,o),n=void 0,o=void 0,e}Gt.step=()=>fa();Gt.log=e=>{da=e};function ce(e,...t){let r=!1;return e(...t,()=>r=!0),r}function pa(e,t,r){e.nodeType===1&&e._x_dataStack&&window.Alpine.clone(e,t)}function ma(e){e.morph=Gt}var ha=ma;Dn.plugin(ha);var _a=/INPUT/i,va=/date|datetime-local|email|month|number|password|range|search|tel|text|time|url|week/i,ga=/TEXTAREA/i;function ba(e,t,r,n){if(!(e.nodeType!==Node.ELEMENT_NODE||e!==document.activeElement)&&(e.tagName.match(ga)||e.tagName.match(_a)&&e.getAttribute("type").match(va)))return n()}function xa(e,t){Dn.morph(e,t,{updating:ba})}var fe={before:"turbo-boost:stream:before-invoke",after:"turbo-boost:stream:after-invoke",finish:"turbo-boost:stream:finish-invoke"};function ut(e,t,r){let{object:n,target:o}=e;t=t||{},t=yr(Te({},t),{object:e.object});let i={detail:t,bubbles:!0};o.dispatchEvent(new CustomEvent(fe.before,i));let{delay:a}=t.invoke||{};a=a||0;let s=()=>{let l=r(n);i.detail.result=l,o.dispatchEvent(new CustomEvent(fe.after,i));let u;l instanceof Animation&&(u=l.finished),l instanceof Promise&&(u=l),u?u.then(()=>{i.detail.promise="fulfilled",o.dispatchEvent(new CustomEvent(fe.finish,i))},()=>{i.detail.promise="rejected",o.dispatchEvent(new CustomEvent(fe.finish,i))}):o.dispatchEvent(new CustomEvent(fe.finish,i))};a>0?setTimeout(s,a):s()}function ya(e,t,r){let n=t[0],o=t[1],i={method:e,eventName:n,eventOptions:o};r.forEach(a=>ut(a,i,s=>s.dispatchEvent(new CustomEvent(n,o))))}function wa(e,t,r){let n=t[0],o={method:e,html:n};r.forEach(i=>ut(i,o,a=>xa(a,n)))}function Ea(e,t,r){let n=e.slice(0,-1).trim(),o=t[0],i={method:e,property:n,value:o};r.forEach(a=>ut(a,i,s=>s[n]=o))}function ka(e,t,r){let n={method:e,args:t};r.forEach(o=>ut(o,n,i=>i[e].apply(i,t)))}function xr(e,t,r){return e.match(/^dispatch(Event)?$/)?ya(e,t,r):e.match(/^morph|mutate$/)?wa(e,t,r):e.endsWith("=")?Ea(e,t,r):ka(e,t,r)}function In(){let e=JSON.parse(this.templateContent.textContent),{id:t,selector:r,receiver:n,method:o,args:i,delay:a}=e,s=[{object:self,target:self}];r&&(s=Array.from(document.querySelectorAll(r)).map(l=>({object:l,target:l}))),n&&(s=s.map(l=>{let{object:u,target:f}=l,d=n.split(".");for(;d.length>0;)u=u[d.shift()],u.dispatchEvent&&(f=u);return{object:u,target:f}})),a>0?setTimeout(()=>xr(o,i,s),a):xr(o,i,s)}if(!self.Turbo)throw new Error("`Turbo` is not defined! Be sure to import `@turbo-boost/streams` after `@hotwired/turbo` or `@hotwired/turbo-rails`.");if(!Turbo.StreamActions)throw new Error("`Turbo.StreamActions` is not defined! Verify that you are running >= `7.2.0` of `@hotwired/turbo`.");Turbo.StreamActions.invoke=In;self.TurboBoost=self.TurboBoost||{};self.TurboBoost.Streams={invoke:In,invokeEvents:fe};console.info("@turbo-boost/streams has initialized and registered new stream actions with Turbo.");var ns=self.TurboBoost.Streams;var Qt=class{get element(){return document.querySelector('meta[name="turbo-boost"]')}get token(){return this.element.getAttribute("content")}get busy(){return this.element.dataset.busy==="true"}set busy(t){return this.element.dataset.busy=!!t}},C=new Qt;var B={start:"turbo-boost:command:start",success:"turbo-boost:command:success",finish:"turbo-boost:command:finish",abort:"turbo-boost:command:abort",clientError:"turbo-boost:command:client-error",serverError:"turbo-boost:command:server-error"},H={stateLoad:"turbo-boost:state:load",stateChange:"turbo-boost:state:change"},J=x(x({},B),H);function P(e,t,r={}){r=r||{},r.detail=r.detail||{},t=t||document;let n=new CustomEvent(e,D(x({},r),{bubbles:!0}));return t.dispatchEvent(n),n}var er;function ct(e,t=null){if(!e||typeof e!="object")return e;let r=new Proxy(e,{deleteProperty(n,o){return delete n[o],P(H.stateChange,C.element,{detail:{state:er}}),!0},set(n,o,i,a){return n[o]=ct(i,this),P(H.stateChange,C.element,{detail:{state:er}}),!0}});if(Array.isArray(e))e.forEach((n,o)=>e[o]=ct(n,r));else if(typeof e=="object")for(let[n,o]of Object.entries(e))e[n]=ct(o,r);return t||(er=r),r}var qn=ct;var tr,be,Be,zn;function Fn(){if(!C.element)return xe();let e=atob(C.element.dataset.state);Be={},be=qn(JSON.parse(e)),tr=x({},be),delete C.element.dataset.clientStateChange,setTimeout(()=>P(H.stateLoad,C.element,{detail:{state:be}}))}function xe(){clearTimeout(zn),zn=setTimeout(Fn,10)}tr||Fn();addEventListener("DOMContentLoaded",xe);addEventListener("load",xe);addEventListener("turbo:load",xe);addEventListener("turbo:frame-load",xe);addEventListener(B.success,xe);addEventListener(H.stateChange,e=>{Be={};for(let[t,r]of Object.entries(be))tr[t]!==r&&(Be[t]=r);C.element.dataset.clientStateChange=!0,C.element.dataset.state=btoa(JSON.stringify(be))});var se={events:H,get current(){return be},get delta(){return Be},get payloadChunks(){return btoa(JSON.stringify(Be)).match(/.{1,2000}/g)}};function Aa(e){let t="<html",r="</html",n=e.indexOf(t),o=e.lastIndexOf(r);if(n>=0&&o>=0){let i=e.slice(e.indexOf(">",n)+1,o);document.documentElement.innerHTML=i}}function Oa(e){document.body.insertAdjacentHTML("beforeend",e)}var le={append:Oa,replaceDocument:Aa};var ft={};function Ca(e){ft[e.id]=e}function Sa(e){delete ft[e]}var dt={add:Ca,remove:Sa,get commands(){return[...Object.values(ft)]},get length(){return Object.keys(ft).length}};function Wn(e){e.detail.endedAt=Date.now(),e.detail.milliseconds=e.detail.endedAt-e.detail.startedAt,setTimeout(()=>P(B.finish,e.target,{detail:e.detail}),25)}addEventListener(B.serverError,Wn);addEventListener(B.success,Wn);addEventListener(B.finish,e=>dt.remove(e.detail.id),!0);var Re={events:B};var rr={};addEventListener("turbo:before-fetch-request",e=>{let t=e.target.closest("turbo-frame"),{fetchOptions:r}=e.detail;if(C.busy){let n=["text/vnd.turbo-boost.html",r.headers.Accept];n=n.filter(o=>o&&o.trim().length>0).join(", "),r.headers.Accept=n,r.headers["TurboBoost-Token"]=C.token}se.payloadChunks.forEach((n,o)=>{r.headers[`TurboBoost-State-${o.toString().padStart(4,"0")}`]=n})});addEventListener("turbo:before-fetch-response",e=>{let t=e.target.closest("turbo-frame"),{fetchResponse:r}=e.detail;if(t&&(rr[t.id]=t.src),r.header("TurboBoost")){if(r.statusCode<200||r.statusCode>399){let n=`Server returned a ${r.statusCode} status code! TurboBoost Commands require 2XX-3XX status codes.`;P(Re.events.clientError,document,{detail:D(x({},e.detail),{error:n})},!0)}r.header("TurboBoost")==="Append"&&(e.preventDefault(),r.responseText.then(n=>le.append(n)))}});addEventListener("turbo:frame-load",e=>{let t=e.target.closest("turbo-frame");t.dataset.turboBoostSrc=rr[t.id]||t.src||t.dataset.turboBoostSrc,delete rr[t.id]});var Ta={frameAttribute:"data-turbo-frame",methodAttribute:"data-turbo-method",commandAttribute:"data-turbo-command"},I=x({},Ta);var Q=[],Vn;function ja(e,t){let r=Q.find(n=>n.name===e);return r&&Q.splice(Q.indexOf(r),1),Q=[{name:e,selectors:t},...Q],document.addEventListener(e,Vn,!0),x({},Q.find(n=>n.name===e))}function $a(e){return Q.find(t=>t.selectors.find(r=>Array.from(document.querySelectorAll(r)).find(n=>n===e)))}function La(e,t){let r=$a(t);return r&&r.name===e}var ee={register:ja,isRegisteredForElement:La,get events(){return[...Q]},set handler(e){Vn=e}};function Na(e){return e.closest(`[${I.commandAttribute}]`)}function Pa(e){return e.closest("turbo-frame[src]")||e.closest("turbo-frame[data-turbo-frame-src]")||e.closest("turbo-frame")}function Ma(e,t={}){if(e.tagName.toLowerCase()!=="select")return t.value=e.value||null;if(!e.multiple)return t.value=e.options[e.selectedIndex].value;t.values=Array.from(e.options).reduce((r,n)=>(n.selected&&r.push(n.value),r),[])}function Ba(e){let t=Array.from(e.attributes).reduce((r,n)=>{let o=n.value;return r[n.name]=o,r},{});return t.tag=e.tagName,t.checked=!!e.checked,t.disabled=!!e.disabled,Ma(e,t),delete t.class,delete t.action,delete t.href,delete t[I.commandAttribute],delete t[I.frameAttribute],t}var De={buildAttributePayload:Ba,findClosestCommand:Na,findClosestFrameWithSource:Pa};function Ra(e,t={}){t.token=C.token;let r=document.createElement("input");r.type="hidden",r.name="turbo_boost_command",r.value=JSON.stringify(t),e.appendChild(r)}var Hn={invokeCommand:Ra};function Da(e,t={}){let r=document.createElement("a");r.href=e;let n=new URL(r);return n.searchParams.set("turbo_boost_command",JSON.stringify(t)),n}var ye={build:Da};function Ia(e,t){let r=t.src;t=x({},t),delete t.src,e.src=ye.build(r,t)}var nr={invokeCommand:Ia};function qa(e,t={}){let r=t.src;t=x({},t),delete t.src,delete t.href,e.setAttribute("href",ye.build(r,t))}var Un={invokeCommand:qa};function za(e){let t=e.target;P(Re.events.abort,document,{detail:D(x({},e.detail),{xhr:t})})}function or(e){let t=e.target;t.getResponseHeader("TurboBoost")==="Append"?le.append(t.responseText):le.replaceDocument(t.responseText);let r=`Server returned a ${t.status} status code! TurboBoost Commands require 2XX-3XX status codes.`;P(Re.events.clientError,document,{detail:D(x({},e.detail),{error:r,xhr:t})},!0)}function Fa(e){let t=e.target;if(t.status<200||t.status>399)return or(e);let r=t.responseText;t.getResponseHeader("TurboBoost")==="Append"?le.append(t.responseText):le.replaceDocument(t.responseText)}function Wa(e){let t=e.src;e=x({},e),delete e.src;try{let r=new XMLHttpRequest;r.open("GET",ye.build(t,e),!0),r.setRequestHeader("Accept","text/vnd.turbo-boost.html, text/html, application/xhtml+xml"),r.setRequestHeader("TurboBoost-Token",C.token),se.payloadChunks.forEach((n,o)=>r.setRequestHeader(`TurboBoost-State-${o.toString().padStart(4,"0")}`,n)),r.addEventListener("abort",za),r.addEventListener("error",or),r.addEventListener("load",Fa),r.send()}catch(r){let n=`Unexpected error sending HTTP request! ${r.message}`;or(r,{detail:{message:n}})}}var Jn={invokeCommand:Wa};function ir(e,t){return t=t||{dataset:{}},e.href||t.src||t.dataset.turboBoostSrc||location.href}function Va(e){let t=De.findClosestFrameWithSource(e),{turboFrame:r,turboMethod:n}=e.dataset;return e.tagName.toLowerCase()==="form"?{name:"form",reason:"Element is a form.",frame:t,src:e.action,invokeCommand:Hn.invokeCommand}:n&&n.length>0?{name:"method",reason:"Element defines data-turbo-method.",frame:t,src:e.href,invokeCommand:Un.invokeCommand}:r&&r!=="_self"?(t=document.getElementById(r),{name:"frame",reason:"element targets a frame that is not _self",frame:t,src:ir(e,t),invokeCommand:nr.invokeCommand}):(!r||r==="_self")&&t?{name:"frame",reason:"element does NOT target a frame or targets _self and is contained by a frame",frame:t,src:ir(e,t),invokeCommand:nr.invokeCommand}:{name:"window",reason:"element matches one or more of the following conditions (targets _top, does NOT target a frame, is NOT contained by a frame)",frame:null,src:ir(e),invokeCommand:Jn.invokeCommand}}var ar={find:Va};var Ie="unknown",Xn={debug:Object.values(J),info:Object.values(J),warn:[J.abort,J.clientError,J.serverError],error:[J.clientError,J.serverError],unknown:[]};Object.values(J).forEach(e=>{addEventListener(e,t=>{Xn[Ie].includes(t.type)&&console[Ie==="debug"?"log":Ie](t.type,{target:t.target,detail:t.detail})})});var Kn={get level(){return Ie},set level(e){return Object.keys(Xn).includes(e)||(e="unknown"),Ie=e}};function Ha(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))}var Zn={v4:Ha};function Yn(e,t){return{id:e,name:t.getAttribute(I.commandAttribute),elementId:t.id.length>0?t.id:null,elementAttributes:De.buildAttributePayload(t),startedAt:Date.now()}}function Ua(e){let t,r={};try{if(t=De.findClosestCommand(e.target),!t||!ee.isRegisteredForElement(e.type,t))return;let n=`turbo-command-${Zn.v4()}`,o=ar.find(t),i=D(x({},Yn(n,t)),{driver:o.name,frameId:o.frame?o.frame.id:null,src:o.src}),a=P(B.start,t,{cancelable:!0,detail:i});if(a.defaultPrevented)return P(B.abort,t,{detail:{message:`An event handler for '${B.start}' prevented default behavior and blocked command invocation!`,source:a}});switch(o=ar.find(t),i=D(x({},Yn(n,t)),{driver:o.name,frameId:o.frame?o.frame.id:null,src:o.src}),dt.add(i),["frame","window"].includes(o.name)&&e.preventDefault(),C.busy=!0,setTimeout(()=>C.busy=!1,10),o.name){case"method":return o.invokeCommand(t,i);case"form":return o.invokeCommand(t,i);case"frame":return o.invokeCommand(o.frame,i);case"window":return o.invokeCommand(i)}}catch(n){P(B.clientError,t,{detail:D(x({},r),{error:n})})}}ee.handler=Ua;ee.register("click",[`[${I.commandAttribute}]`]);ee.register("submit",[`form[${I.commandAttribute}]`]);ee.register("change",[`input[${I.commandAttribute}]`,`select[${I.commandAttribute}]`,`textarea[${I.commandAttribute}]`]);self.TurboBoost=self.TurboBoost||{};self.TurboBoost=D(x({},self.TurboBoost),{stateEvents:H,get state(){return se.current},get stateDelta(){return se.delta}});self.TurboBoost.Commands={logger:Kn,schema:I,events:B,registerEventDelegate:ee.register,get eventDelegates(){return ee.events}};var El=self.TurboBoost.Commands;export{El as default};
1
+ var Z=Object.defineProperty,ee=Object.defineProperties;var te=Object.getOwnPropertyDescriptors;var X=Object.getOwnPropertySymbols;var re=Object.prototype.hasOwnProperty,oe=Object.prototype.propertyIsEnumerable;var _=(e,t,r)=>t in e?Z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,s=(e,t)=>{for(var r in t||(t={}))re.call(t,r)&&_(e,r,t[r]);if(X)for(var r of X(t))oe.call(t,r)&&_(e,r,t[r]);return e},u=(e,t)=>ee(e,te(t));var O=class{get element(){return document.querySelector('meta[name="turbo-boost"]')}get token(){return this.element.getAttribute("content")}get busy(){return this.element.dataset.busy==="true"}set busy(t){return this.element.dataset.busy=!!t}},a=new O;var i={start:"turbo-boost:command:start",success:"turbo-boost:command:success",finish:"turbo-boost:command:finish",abort:"turbo-boost:command:abort",clientError:"turbo-boost:command:client-error",serverError:"turbo-boost:command:server-error"},l={stateLoad:"turbo-boost:state:load",stateChange:"turbo-boost:state:change"},f=s(s({},i),l);function d(e,t,r={}){return new Promise(o=>{r=r||{},r.detail=r.detail||{},t=t||document;let n=new CustomEvent(e,u(s({},r),{bubbles:!0}));t.dispatchEvent(n),o(n)})}var B;function k(e,t=null){if(!e||typeof e!="object")return e;let r=new Proxy(e,{deleteProperty(o,n){return delete o[n],d(l.stateChange,a.element,{detail:{state:B}}),!0},set(o,n,c,A){return o[n]=k(c,this),d(l.stateChange,a.element,{detail:{state:B}}),!0}});if(Array.isArray(e))e.forEach((o,n)=>e[n]=k(o,r));else if(typeof e=="object")for(let[o,n]of Object.entries(e))e[o]=k(n,r);return t||(B=r),r}var F=k;var D,g,C,N;function J(){if(!a.element)return E();let e=atob(a.element.dataset.state);C={},g=F(JSON.parse(e)),D=s({},g),delete a.element.dataset.clientStateChange,setTimeout(()=>d(l.stateLoad,a.element,{detail:{state:g}}))}function E(){clearTimeout(N),N=setTimeout(J,10)}D||J();addEventListener("DOMContentLoaded",E);addEventListener("load",E);addEventListener("turbo:load",E);addEventListener("turbo:frame-load",E);addEventListener(i.success,E);addEventListener(l.stateChange,e=>{C={};for(let[t,r]of Object.entries(g))D[t]!==r&&(C[t]=r);a.element.dataset.clientStateChange=!0,a.element.dataset.state=btoa(JSON.stringify(g))});var h={events:l,get current(){return g},get delta(){return C},get payloadChunks(){return btoa(JSON.stringify(C)).match(/.{1,2000}/g)}};function ne(e){let t="<html",r="</html",o=e.indexOf(t),n=e.lastIndexOf(r);if(o>=0&&n>=0){let c=e.slice(e.indexOf(">",o)+1,n);document.documentElement.innerHTML=c}}function se(e){document.body.insertAdjacentHTML("beforeend",e)}var v={append:se,replaceDocument:ne};var L={};function ae(e){L[e.id]=e}function ie(e){delete L[e]}var S={add:ae,remove:ie,get commands(){return[...Object.values(L)]},get length(){return Object.keys(L).length}};function M(e){e.detail.endedAt=Date.now(),e.detail.milliseconds=e.detail.endedAt-e.detail.startedAt,setTimeout(()=>d(i.finish,e.target,{detail:e.detail}),25)}addEventListener(i.serverError,M);addEventListener(i.success,M);addEventListener(i.finish,e=>S.remove(e.detail.id),!0);var T={events:i};var R={};addEventListener("turbo:before-fetch-request",e=>{let t=e.target.closest("turbo-frame"),{fetchOptions:r}=e.detail;if(a.busy){let o=["text/vnd.turbo-boost.html",r.headers.Accept];o=o.filter(n=>n&&n.trim().length>0).join(", "),r.headers.Accept=o,r.headers["TurboBoost-Token"]=a.token}h.payloadChunks.forEach((o,n)=>{r.headers[`TurboBoost-State-${n.toString().padStart(4,"0")}`]=o})});addEventListener("turbo:before-fetch-response",e=>{let t=e.target.closest("turbo-frame"),{fetchResponse:r}=e.detail;if(t&&(R[t.id]=t.src),r.header("TurboBoost")){if(r.statusCode<200||r.statusCode>399){let o=`Server returned a ${r.statusCode} status code! TurboBoost Commands require 2XX-3XX status codes.`;d(T.events.clientError,document,{detail:u(s({},e.detail),{error:o})},!0)}r.header("TurboBoost")==="Append"&&(e.preventDefault(),r.responseText.then(o=>v.append(o)))}});addEventListener("turbo:frame-load",e=>{let t=e.target.closest("turbo-frame");t.dataset.turboBoostSrc=R[t.id]||t.src||t.dataset.turboBoostSrc,delete R[t.id]});var de={frameAttribute:"data-turbo-frame",methodAttribute:"data-turbo-method",commandAttribute:"data-turbo-command",confirmAttribute:"data-turbo-confirm"},m=s({},de);var j={method:e=>Promise.resolve(confirm(e))},me=e=>e.detail.driver==="method",ue=e=>{if(e.detail.driver!=="form")return!1;let t=e.target,r=t.closest("turbo-frame"),o=t.closest(`[${m.frameAttribute}]`);return!!(r||o)},ce=e=>me(e)||ue(e);document.addEventListener(i.start,async e=>{let t=e.target.getAttribute(m.confirmAttribute);if(!t||(e.detail.confirmation=!0,ce(e)))return;await j.method(t)||e.preventDefault()});var W=j;var b=[],$;function le(e,t){let r=b.find(o=>o.name===e);return r&&b.splice(b.indexOf(r),1),b=[{name:e,selectors:t},...b],document.removeEventListener(e,$,!0),document.addEventListener(e,$,!0),s({},b.find(o=>o.name===e))}function fe(e){return b.find(t=>t.selectors.find(r=>Array.from(document.querySelectorAll(r)).find(o=>o===e)))}function be(e,t){let r=fe(t);return r&&r.name===e}var p={register:le,isRegisteredForElement:be,get events(){return[...b]},set handler(e){$=e}};function pe(e){return e.closest(`[${m.commandAttribute}]`)}function he(e){return e.closest("turbo-frame[src]")||e.closest("turbo-frame[data-turbo-frame-src]")||e.closest("turbo-frame")}function ve(e,t={}){if(e.tagName.toLowerCase()!=="select")return t.value=e.value||null;if(!e.multiple)return t.value=e.options[e.selectedIndex].value;t.values=Array.from(e.options).reduce((r,o)=>(o.selected&&r.push(o.value),r),[])}function ge(e){let t=Array.from(e.attributes).reduce((r,o)=>{let n=o.value;return r[o.name]=n,r},{});return t.tag=e.tagName,t.checked=!!e.checked,t.disabled=!!e.disabled,ve(e,t),delete t.class,delete t.action,delete t.href,delete t[m.commandAttribute],delete t[m.frameAttribute],t}var y={buildAttributePayload:ge,findClosestCommand:pe,findClosestFrameWithSource:he};function Ee(e,t={}){t.token=a.token;let r=document.createElement("input");r.type="hidden",r.name="turbo_boost_command",r.value=JSON.stringify(t),e.appendChild(r)}var U={invokeCommand:Ee};function xe(e,t={}){let r=document.createElement("a");r.href=e;let o=new URL(r);return o.searchParams.set("turbo_boost_command",JSON.stringify(t)),o}var x={build:xe};function Ce(e,t){let r=t.src;t=s({},t),delete t.src,e.src=x.build(r,t)}var H={invokeCommand:Ce};function Te(e,t={}){let r=t.src;t=s({},t),delete t.src,delete t.href,e.setAttribute("href",x.build(r,t))}var V={invokeCommand:Te};function ye(e){let t=e.target;d(T.events.abort,document,{detail:u(s({},e.detail),{xhr:t})})}function P(e){let t=e.target;t.getResponseHeader("TurboBoost")==="Append"||t.getResponseHeader("Content-Type").startsWith("text/vnd.turbo-boost.html")?v.append(t.responseText):v.replaceDocument(t.responseText);let o=`Server returned a ${t.status} status code! TurboBoost Commands require 2XX-3XX status codes.`;d(T.events.clientError,document,{detail:u(s({},e.detail),{error:o,xhr:t})},!0)}function Ae(e){let t=e.target;if(t.status<200||t.status>399)return P(e);let r=t.responseText;t.getResponseHeader("TurboBoost")==="Append"||t.getResponseHeader("Content-Type").startsWith("text/vnd.turbo-boost.html")?v.append(t.responseText):v.replaceDocument(t.responseText)}function ke(e){let t=e.src;e=s({},e),delete e.src;try{let r=new XMLHttpRequest;r.open("GET",x.build(t,e),!0),r.setRequestHeader("Accept","text/vnd.turbo-boost.html, text/html, application/xhtml+xml"),r.setRequestHeader("TurboBoost-Token",a.token),h.payloadChunks.forEach((o,n)=>r.setRequestHeader(`TurboBoost-State-${n.toString().padStart(4,"0")}`,o)),r.addEventListener("abort",ye),r.addEventListener("error",P),r.addEventListener("load",Ae),r.send()}catch(r){let o=`Unexpected error sending HTTP request! ${r.message}`;P(r,{detail:{message:o}})}}var G={invokeCommand:ke};function q(e,t){return t=t||{dataset:{}},e.href||t.src||t.dataset.turboBoostSrc||location.href}function Le(e){let t=y.findClosestFrameWithSource(e),{turboFrame:r,turboMethod:o}=e.dataset;return e.tagName.toLowerCase()==="form"?{name:"form",reason:"Element is a form.",frame:t,src:e.action,invokeCommand:U.invokeCommand}:o&&o.length>0?{name:"method",reason:"Element defines data-turbo-method.",frame:t,src:e.href,invokeCommand:V.invokeCommand}:r&&r!=="_self"?(t=document.getElementById(r),{name:"frame",reason:"element targets a frame that is not _self",frame:t,src:q(e,t),invokeCommand:H.invokeCommand}):(!r||r==="_self")&&t?{name:"frame",reason:"element does NOT target a frame or targets _self and is contained by a frame",frame:t,src:q(e,t),invokeCommand:H.invokeCommand}:{name:"window",reason:"element matches one or more of the following conditions (targets _top, does NOT target a frame, is NOT contained by a frame)",frame:null,src:q(e),invokeCommand:G.invokeCommand}}var I={find:Le};var w="unknown",z={debug:Object.values(f),info:Object.values(f),warn:[f.abort,f.clientError,f.serverError],error:[f.clientError,f.serverError],unknown:[]};Object.values(f).forEach(e=>{addEventListener(e,t=>{if(z[w].includes(t.type)){let{target:r,detail:o}=t;console[w](t.type,{target:r,detail:o})}})});var K={get level(){return w},set level(e){return Object.keys(z).includes(e)||(e="unknown"),w=e}};function Se(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))}var Q={v4:Se};function Y(e,t){return{id:e,name:t.getAttribute(m.commandAttribute),elementId:t.id.length>0?t.id:null,elementAttributes:y.buildAttributePayload(t),startedAt:Date.now()}}async function we(e){let t,r={};try{if(t=y.findClosestCommand(e.target),!t||!p.isRegisteredForElement(e.type,t))return;let o=`turbo-command-${Q.v4()}`,n=I.find(t),c=u(s({},Y(o,t)),{driver:n.name,frameId:n.frame?n.frame.id:null,src:n.src}),A=await d(i.start,t,{cancelable:!0,detail:c});if(A.defaultPrevented||A.detail.confirmation&&e.defaultPrevented)return d(i.abort,t,{detail:{message:`An event handler for '${i.start}' prevented default behavior and blocked command invocation!`,source:A}});switch(n=I.find(t),c=u(s({},Y(o,t)),{driver:n.name,frameId:n.frame?n.frame.id:null,src:n.src}),S.add(c),["frame","window"].includes(n.name)&&e.preventDefault(),a.busy=!0,setTimeout(()=>a.busy=!1,10),n.name){case"method":return n.invokeCommand(t,c);case"form":return n.invokeCommand(t,c);case"frame":return n.invokeCommand(n.frame,c);case"window":return n.invokeCommand(c)}}catch(o){d(i.clientError,t,{detail:u(s({},r),{error:o})})}}self.TurboBoost=self.TurboBoost||{};self.TurboBoost=u(s({},self.TurboBoost),{stateEvents:l,get state(){return h.current},get stateDelta(){return h.delta}});self.TurboBoost.Commands||(p.handler=we,p.register("click",[`[${m.commandAttribute}]`]),p.register("submit",[`form[${m.commandAttribute}]`]),p.register("change",[`input[${m.commandAttribute}]`,`select[${m.commandAttribute}]`,`textarea[${m.commandAttribute}]`]),self.TurboBoost.Commands={confirmation:W,logger:K,schema:m,events:i,registerEventDelegate:p.register,get eventDelegates(){return p.events}});var Qt=self.TurboBoost.Commands;export{Qt as default};
6
2
  //# sourceMappingURL=commands.js.map