super 0.0.5 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +4 -1
  3. data/CONTRIBUTING.md +56 -0
  4. data/README.md +68 -38
  5. data/STABILITY.md +50 -0
  6. data/app/assets/javascripts/super/application.js +1170 -359
  7. data/app/assets/stylesheets/super/application.css +78105 -50441
  8. data/app/controllers/super/application_controller.rb +44 -52
  9. data/app/helpers/super/form_builder_helper.rb +23 -0
  10. data/app/views/layouts/super/application.html.erb +26 -6
  11. data/app/views/super/application/{_resources_header.html.erb → _collection_header.html.erb} +5 -6
  12. data/app/views/super/application/_display_rich_text.html.erb +1 -0
  13. data/app/views/super/application/_filter.html.erb +14 -0
  14. data/app/views/super/application/_filter_type_select.html.erb +18 -0
  15. data/app/views/super/application/_filter_type_text.html.erb +16 -0
  16. data/app/views/super/application/_filter_type_timestamp.html.erb +23 -0
  17. data/app/views/super/application/_flash.html.erb +13 -13
  18. data/app/views/super/application/_form_field__destroy.html.erb +1 -9
  19. data/app/views/super/application/_form_field_checkbox.html.erb +1 -0
  20. data/app/views/super/application/_form_field_rich_text_area.html.erb +1 -0
  21. data/app/views/super/application/_form_field_select.html.erb +1 -23
  22. data/app/views/super/application/_form_field_text.html.erb +1 -13
  23. data/app/views/super/application/_form_has_many.html.erb +1 -1
  24. data/app/views/super/application/{_resource_header.html.erb → _member_header.html.erb} +6 -6
  25. data/app/views/super/application/_super_layout.html.erb +12 -17
  26. data/app/views/super/application/_super_pagination.html.erb +16 -0
  27. data/app/views/super/application/_super_panel.html.erb +3 -7
  28. data/app/views/super/application/_super_schema_display_actions.html.erb +5 -0
  29. data/app/views/super/application/_super_schema_display_index.html.erb +24 -0
  30. data/app/views/super/application/_super_schema_display_show.html.erb +8 -0
  31. data/app/views/super/application/_super_schema_form.html.erb +15 -0
  32. data/app/views/super/application/edit.html.erb +2 -6
  33. data/app/views/super/application/index.html.erb +2 -6
  34. data/app/views/super/application/new.html.erb +2 -6
  35. data/app/views/super/application/show.html.erb +2 -6
  36. data/app/views/super/feather/{_chevron_down.svg → _chevron_down.html} +0 -0
  37. data/config/locales/en.yml +5 -0
  38. data/docs/README.md +4 -2
  39. data/docs/action_text.md +48 -0
  40. data/docs/cheat.md +41 -0
  41. data/docs/faq.md +3 -3
  42. data/docs/installation.md +21 -0
  43. data/docs/quick_start.md +1 -16
  44. data/docs/webpacker.md +13 -5
  45. data/frontend/super-frontend/dist/application.css +78105 -50441
  46. data/frontend/super-frontend/dist/application.js +1170 -359
  47. data/lib/generators/super/action_text/USAGE +23 -0
  48. data/lib/generators/super/action_text/action_text_generator.rb +30 -0
  49. data/lib/generators/super/action_text/templates/pack_super_action_text.css +23 -0
  50. data/lib/generators/super/action_text/templates/pack_super_action_text.js +4 -0
  51. data/lib/generators/super/install/install_generator.rb +16 -0
  52. data/lib/generators/super/resource/templates/resources_controller.rb.tt +1 -31
  53. data/lib/generators/super/webpacker/USAGE +5 -4
  54. data/lib/generators/super/webpacker/webpacker_generator.rb +3 -2
  55. data/lib/super.rb +21 -3
  56. data/lib/super/action_inquirer.rb +2 -2
  57. data/lib/super/assets.rb +112 -38
  58. data/lib/super/client_error.rb +43 -0
  59. data/lib/super/compatibility.rb +13 -1
  60. data/lib/super/configuration.rb +21 -69
  61. data/lib/super/controls.rb +9 -116
  62. data/lib/super/controls/optional.rb +79 -0
  63. data/lib/super/controls/required.rb +13 -0
  64. data/lib/super/controls/steps.rb +114 -0
  65. data/lib/super/display.rb +66 -3
  66. data/lib/super/display/guesser.rb +34 -0
  67. data/lib/super/display/schema_types.rb +61 -25
  68. data/lib/super/engine.rb +9 -1
  69. data/lib/super/error.rb +17 -9
  70. data/lib/super/filter.rb +12 -0
  71. data/lib/super/filter/form_object.rb +97 -0
  72. data/lib/super/filter/guesser.rb +30 -0
  73. data/lib/super/filter/operator.rb +103 -0
  74. data/lib/super/filter/plugin.rb +47 -0
  75. data/lib/super/filter/schema_types.rb +112 -0
  76. data/lib/super/form.rb +35 -0
  77. data/lib/super/form/builder.rb +204 -0
  78. data/lib/super/form/guesser.rb +27 -0
  79. data/lib/super/form/inline_errors.rb +26 -0
  80. data/lib/super/form/schema_types.rb +29 -22
  81. data/lib/super/form/strong_params.rb +29 -0
  82. data/lib/super/layout.rb +28 -0
  83. data/lib/super/link.rb +55 -32
  84. data/lib/super/pagination.rb +55 -0
  85. data/lib/super/panel.rb +13 -0
  86. data/lib/super/partial.rb +12 -0
  87. data/lib/super/partial/resolving.rb +24 -0
  88. data/lib/super/plugin.rb +34 -63
  89. data/lib/super/schema.rb +12 -22
  90. data/lib/super/schema/common.rb +25 -0
  91. data/lib/super/schema/guesser.rb +77 -0
  92. data/lib/super/version.rb +1 -1
  93. data/lib/super/view_helper.rb +1 -20
  94. metadata +90 -33
  95. data/app/helpers/super/application_helper.rb +0 -32
  96. data/app/views/super/application/_form.html.erb +0 -17
  97. data/app/views/super/application/_form_inline_errors.html.erb +0 -10
  98. data/app/views/super/application/_index.html.erb +0 -45
  99. data/app/views/super/application/_show.html.erb +0 -10
  100. data/docs/controls.md +0 -39
  101. data/frontend/super-frontend/build.js +0 -36
  102. data/frontend/super-frontend/package.json +0 -21
  103. data/frontend/super-frontend/postcss.config.js +0 -6
  104. data/frontend/super-frontend/src/javascripts/super/application.ts +0 -18
  105. data/frontend/super-frontend/src/javascripts/super/apply_template_controller.ts +0 -21
  106. data/frontend/super-frontend/src/javascripts/super/rails__ujs.d.ts +0 -1
  107. data/frontend/super-frontend/src/javascripts/super/toggle_pending_destruction_controller.ts +0 -15
  108. data/frontend/super-frontend/src/stylesheets/super/application.css +0 -77
  109. data/frontend/super-frontend/tailwind.config.js +0 -9
  110. data/frontend/super-frontend/tsconfig.json +0 -13
  111. data/frontend/super-frontend/yarn.lock +0 -5540
  112. data/lib/super/step.rb +0 -36
  113. data/lib/tasks/super_tasks.rake +0 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7b59b4010b17c09a380b5aff7b71a7f3f17c8406553c24349454ed8bc2e80028
4
- data.tar.gz: 6854ff2172e6c70ce60b64718133b71970e84d60db0e5a15296ba5bcf9b7a981
3
+ metadata.gz: 043677dcee80c7b83903b21904f1768a411f807567190d7227928df9bf7922c7
4
+ data.tar.gz: 5de2f073926089e4823a4228dc4f7be912fed0471d862f9b6f0f56dde280f154
5
5
  SHA512:
6
- metadata.gz: c243fa381ef6be45965a63a77d6684206b9e12e6a392059cca8dfcc4e7fec57bd8b14da4f26a8af05bf2c65aeeae8791aaa39801fe684c03df1e099f2ea3dff6
7
- data.tar.gz: c7c4e6312ad9bd301effddf4363c1cea2e01d1e4221f113160b6571dd0e07b4709d7dbc0da87660960147a9a81c79a0da812cccc10fa81231cbcd8700e5b9c0b
6
+ metadata.gz: feeba0baacdaf977c16f9e785e7abf6637679ebe2f624716f1006cce290157e29157b046a01f3d287d1b826378a04ece8c482b59cd2f21dc53bf463a28cf2848
7
+ data.tar.gz: a7d1a568a4c918ececb0200305f1e30042b4fc48946796f13e9568c27b5f95368b60aaac51ac977211566cb79f4973dd3d96a48a421531934c41884ce33ac084
data/.yardopts CHANGED
@@ -3,8 +3,11 @@
3
3
  --load ./docs/yard_customizations.rb
4
4
  -
5
5
  CONTRIBUTING.md
6
+ STABILITY.md
6
7
  LICENSE
7
8
  docs/quick_start.md
9
+ docs/installation.md
8
10
  docs/webpacker.md
9
- docs/controls.md
11
+ docs/action_text.md
12
+ docs/cheat.md
10
13
  docs/faq.md
@@ -0,0 +1,56 @@
1
+ # Contributing
2
+
3
+ Thank you for thinking about contributing to Super!
4
+
5
+
6
+ ## General guidelines
7
+
8
+ There are a few ground rules that to adhere to:
9
+
10
+ * be friendly and patient,
11
+ * be welcoming,
12
+ * be considerate,
13
+ * be respectful,
14
+ * be careful in the words that you choose and be kind to others,
15
+ * when we disagree, try to understand why.
16
+
17
+ This isn't an exhaustive list of things that you can't do. Rather, take it in
18
+ the spirit in which it's intended - a guide to make it easier to communicate and
19
+ participate in the community.
20
+
21
+ This applies to all spaces managed by the Super project.
22
+
23
+ If you believe someone is violating the code of conduct, we ask that you report
24
+ it by emailing: super+conduct at zachahn.com
25
+
26
+ Offenders may be banned, asked to apologize, etc.
27
+
28
+ (These guidelines are based on the [FreeBSD CoC][FreeBSD CoC], which in turn is
29
+ based on [LLVM Project's draft CoC][LLVM CoC], which in turn is based on the
30
+ [Django Project Code of Conduct][Django CoC], which is in turn based on wording
31
+ from the Speak Up! project.)
32
+
33
+
34
+ ## Bug reports / issues
35
+
36
+ 1. Please tell us what version of Super, Ruby, and Rails you are using
37
+ 1. Please search the issues before posting your problem
38
+ 1. Please ask questions in a public place to benefit all Super users
39
+ 1. Please email security-related problems to super+security [at] zachahn.com
40
+
41
+
42
+ ## Feature requests / pull requests
43
+
44
+ Contributors will need to sign a CLA. This isn't set up yet, so I won't be able
45
+ to accept contributions.
46
+
47
+ 1. Please note that pull requests may be closed/denied for any reason.
48
+ Your feature may be better as its own repository. If so, I will link to your
49
+ project from the README!
50
+ 1. Please allow Super's contributors to modify your PR before merging.
51
+ It might make the process a bit smoother, but this isn't a necessity.
52
+
53
+
54
+ [FreeBSD CoC]: https://www.freebsd.org/internal/code-of-conduct.html
55
+ [LLVM CoC]: https://llvm.org/docs/CodeOfConduct.html
56
+ [Django CoC]: https://www.djangoproject.com/conduct/
data/README.md CHANGED
@@ -1,61 +1,92 @@
1
1
  # Super
2
2
 
3
- Super is a zero dependency admin framework for Ruby on Rails applications.
3
+ ![Unit tests status](https://github.com/zachahn/super/workflows/Unit%20tests/badge.svg?branch=master)
4
+ [![Gem](https://img.shields.io/gem/v/super)][gem]
5
+ [![Try the demo](https://img.shields.io/badge/try-demo-blue)][demo]
4
6
 
5
- Super is made for developers. They will find it easy to build and modify admin
6
- pages. It builds on top of Rails controllers and views, so it's straightforward
7
- to customize. It's fully configurable without a DSL.
8
7
 
9
- Super is made for admins. Power users and casual users alike will find the admin
10
- pages simple and efficient. And the Professional add-on can make it even more
11
- powerful.
8
+ Super is an admin framework for Ruby on Rails applications. Super helps you make
9
+ powerful admin pages quickly so that you can concentrate on the parts of your
10
+ app that make it great.
11
+
12
+ Super strives to let engineers build great admin pages quickly and easily by:
13
+
14
+ * Providing a configurable CRUD interface with usable defaults
15
+ * Building on top of standard Rails controllers and ERB views
16
+ * Preferring plain Ruby objects and initializers instead of DSLs
17
+
18
+
19
+ Super's distinguishing feature is that it's easy to maintain in your
20
+ application. It does this by:
21
+
22
+ * Supporting a wide range of Ruby (2.3–3.0+) and Rails (5.0–6.1+) versions,
23
+ which makes it easy to upgrade your Ruby and Rails versions without breaking
24
+ your admin pages
25
+ * Having zero dependencies, so that you can upgrade your app's dependencies
26
+ without affecting your admin pages (or upgrade your admin pages without
27
+ worrying it might break your app)
28
+
29
+
30
+ Note: There may be lots of breaking changes since Super is still fairly young.
31
+ See the [stability doc](./STABILITY.md) for an idea of what might be changed.
12
32
 
13
33
 
14
34
  ## Features
15
35
 
16
- * Sprockets and Webpacker compatibility
17
- * Note: Webpacker support depends on one additional NPM package for parsing
18
- ERB
19
- * Pagination
20
- * Configurable forms (new and edit forms)
36
+ * Responsive and mobile-friendly
37
+ * Compatible with Sprockets and Webpacker
38
+ * Configurable forms
39
+ * Supports nested attributes `accepts_nested_attributes_for`
21
40
  * Configurable display (index and show tables)
22
- * Supports Rails 5.0+, Ruby 2.3+
23
- * Configurable without a DSL
24
- * Looks reasonably nice and modern
41
+ * Advanced filtering for ActiveRecord
25
42
  * Pre-built frontend assets (doesn't require Sass, PostCSS, Babel, etc)
26
43
  * Vendored assets include
27
44
  * Stimulus JS
28
45
  * Tailwind CSS
29
- * Feather icons
46
+ * Rails UJS
47
+ * Supports Rails 5.0+, Ruby 2.3+
48
+
30
49
 
31
- Super was inspired in part by the admin frameworks [ActiveAdmin][activeadmin]
32
- and [Administrate][administrate]. If Super doesn't quite fit your requirements
33
- at this moment, one of those might meet your needs better.
50
+ See the [demo][demo] and its [source][demo_source] for an example of some of its
51
+ features.
34
52
 
35
53
 
36
- ## Professional edition
54
+ ## Installation and Usage
37
55
 
38
- Super Professional is a paid add-on and provides additional benefits:
56
+ See [Installation](./docs/quick_start.md) and
57
+ [Quick start](./docs/quick_start.md)
39
58
 
40
- * Feature: Filtering by column values
41
- * Priority email support
42
- * Supporting long term development of Super
43
- * An LGPL exemption
44
59
 
45
- It will be available soon. Subscribe to the [newsletter][newsletter] to be
46
- notified of its availability or for brief, occasional updates.
60
+ ## Editions
47
61
 
62
+ There are several editions to consider.
48
63
 
49
- ## Demos
64
+ **Super FOSS** provides:
50
65
 
51
- * [Super Demo][super_demo]
52
- * [Super Demo source][super_demo_source]
53
- * [Super Professional Demo][super_professional]
66
+ * A great admin framework that's free and easy to maintain
67
+ * Community support, see the [discussion forum][discussions]
54
68
 
69
+ **Super Premium** (not available yet) provides:
55
70
 
56
- ## Installation and Usage
71
+ * Private email support
72
+ * Ensuring long term development of Super
73
+
74
+ **Super Professional** (not available yet) provides everything in Premium and:
75
+
76
+ * Productivity improvements and quality of life features for admins
77
+ * An LGPL exemption
78
+
79
+ Subscribe to the [newsletter][newsletter] to be notified of their availabilities
80
+ and for brief, quarterly-at-most updates to Super.
81
+
82
+
83
+ ## Super doesn't fit my needs. What are some alternatives?
84
+
85
+ [ActiveAdmin](https://github.com/activeadmin/activeadmin) is great if you need
86
+ lots of features. It relies heavily on DSLs but is flexible and popular.
57
87
 
58
- See [Quick start](./docs/quick_start.md)
88
+ [Administrate](https://github.com/thoughtbot/administrate) doesn't have as many
89
+ features as ActiveAdmin, but it feels like developing a normal Rails app.
59
90
 
60
91
 
61
92
  ## Contributing
@@ -68,9 +99,8 @@ See [CONTRIBUTING](./CONTRIBUTING.md)
68
99
  The gem is available under the terms of the [GNU LGPLv3](./LICENSE).
69
100
 
70
101
 
71
- [administrate]: https://github.com/thoughtbot/administrate
72
- [activeadmin]: https://github.com/activeadmin/activeadmin
102
+ [gem]: https://rubygems.org/gems/super
103
+ [discussions]: https://github.com/zachahn/super/discussions
73
104
  [newsletter]: https://tinyletter.com/zachahn
74
- [super_demo]: https://demo-super.herokuapp.com/admin/members
75
- [super_demo_source]: https://github.com/zachahn/super_demo
76
- [super_professional]: https://demo-super-professional.herokuapp.com/admin/members
105
+ [demo]: https://demo-super.herokuapp.com/admin/members
106
+ [demo_source]: https://github.com/zachahn/super_demo
@@ -0,0 +1,50 @@
1
+ # Stability
2
+
3
+ The table below shows the current progress towards API stability and the release
4
+ of version 1.0.
5
+
6
+ Note though that it is neither a comprehensive list nor a guarantee of
7
+ stability.
8
+
9
+
10
+ <table>
11
+ <thead>
12
+ <tr><th>Feature</th><th>Status</th></tr>
13
+ </thead>
14
+ <tbody>
15
+ <tr><td>UI</td> <td>❌</td></tr>
16
+ <tr><td>Frontend JS</td> <td>❌</td></tr>
17
+ <tr><td><code>Super::ActionInquirer</code></td> <td>✅</td></tr>
18
+ <tr><td><code>Super::ApplicationController</code></td> <td>✅</td></tr>
19
+ <tr><td><code>Super::Assets</code></td> <td>🚧</td></tr>
20
+ <tr><td><code>Super::ClientError</code></td> <td>✅</td></tr>
21
+ <tr><td><code>Super::Compatability</code></td> <td>🙈</td></tr>
22
+ <tr><td><code>Super::Configuration</code></td> <td>🚧</td></tr>
23
+ <tr><td><code>Super::Controls::Optional</code></td> <td>✅</td></tr>
24
+ <tr><td><code>Super::Controls::Required</code></td> <td>✅</td></tr>
25
+ <tr><td><code>Super::Controls::Steps</code></td> <td>🚧</td></tr>
26
+ <tr><td><code>Super::Controls</code></td> <td>✅</td></tr>
27
+ <tr><td><code>Super::Display</code></td> <td>🤔</td></tr>
28
+ <tr><td><code>Super::Engine</code></td> <td>🙈</td></tr>
29
+ <tr><td><code>Super::Error</code></td> <td>✅</td></tr>
30
+ <tr><td><code>Super::Filter</code></td> <td>❌</td></tr>
31
+ <tr><td><code>Super::Form</code></td> <td>🤔</td></tr>
32
+ <tr><td><code>Super::Layout</code></td> <td>🤔</td></tr>
33
+ <tr><td><code>Super::Link</code></td> <td>✅</td></tr>
34
+ <tr><td><code>Super::Navigation</code></td> <td>🤔</td></tr>
35
+ <tr><td><code>Super::Pagination</code></td> <td>🤔</td></tr>
36
+ <tr><td><code>Super::Panel</code></td> <td>🤔</td></tr>
37
+ <tr><td><code>Super::Partial</code></td> <td>🤔</td></tr>
38
+ <tr><td><code>Super::Plugin</code></td> <td>✅</td></tr>
39
+ <tr><td><code>Super::ViewHelper</code></td> <td>❌</td></tr>
40
+ </tbody>
41
+ </table>
42
+
43
+
44
+ ### Legend
45
+
46
+ * ✅ Tentatively stable. Further changes will probably be additive
47
+ * 🚧 Likely upcoming breaking changes
48
+ * ❌ Planned upcoming breaking changes
49
+ * 🤔 Undecided
50
+ * 🙈 Private API
@@ -866,7 +866,7 @@ Released under the MIT license
866
866
  }
867
867
  }).call(this);
868
868
 
869
- },{}],"../node_modules/@stimulus/core/dist/src/event_listener.js":[function(require,module,exports) {
869
+ },{}],"../node_modules/@stimulus/core/dist/event_listener.js":[function(require,module,exports) {
870
870
  "use strict";
871
871
 
872
872
  Object.defineProperty(exports, "__esModule", {
@@ -877,18 +877,19 @@ exports.EventListener = void 0;
877
877
  var EventListener =
878
878
  /** @class */
879
879
  function () {
880
- function EventListener(eventTarget, eventName) {
880
+ function EventListener(eventTarget, eventName, eventOptions) {
881
881
  this.eventTarget = eventTarget;
882
882
  this.eventName = eventName;
883
+ this.eventOptions = eventOptions;
883
884
  this.unorderedBindings = new Set();
884
885
  }
885
886
 
886
887
  EventListener.prototype.connect = function () {
887
- this.eventTarget.addEventListener(this.eventName, this, false);
888
+ this.eventTarget.addEventListener(this.eventName, this, this.eventOptions);
888
889
  };
889
890
 
890
891
  EventListener.prototype.disconnect = function () {
891
- this.eventTarget.removeEventListener(this.eventName, this, false);
892
+ this.eventTarget.removeEventListener(this.eventName, this, this.eventOptions);
892
893
  }; // Binding observer delegate
893
894
 
894
895
  /** @hidden */
@@ -926,7 +927,7 @@ function () {
926
927
  return leftIndex < rightIndex ? -1 : leftIndex > rightIndex ? 1 : 0;
927
928
  });
928
929
  },
929
- enumerable: true,
930
+ enumerable: false,
930
931
  configurable: true
931
932
  });
932
933
  return EventListener;
@@ -948,7 +949,7 @@ function extendEvent(event) {
948
949
  });
949
950
  }
950
951
  }
951
- },{}],"../node_modules/@stimulus/core/dist/src/dispatcher.js":[function(require,module,exports) {
952
+ },{}],"../node_modules/@stimulus/core/dist/dispatcher.js":[function(require,module,exports) {
952
953
  "use strict";
953
954
 
954
955
  Object.defineProperty(exports, "__esModule", {
@@ -991,7 +992,7 @@ function () {
991
992
  return listeners.concat(Array.from(map.values()));
992
993
  }, []);
993
994
  },
994
- enumerable: true,
995
+ enumerable: false,
995
996
  configurable: true
996
997
  }); // Binding observer delegate
997
998
 
@@ -1018,24 +1019,26 @@ function () {
1018
1019
 
1019
1020
  Dispatcher.prototype.fetchEventListenerForBinding = function (binding) {
1020
1021
  var eventTarget = binding.eventTarget,
1021
- eventName = binding.eventName;
1022
- return this.fetchEventListener(eventTarget, eventName);
1022
+ eventName = binding.eventName,
1023
+ eventOptions = binding.eventOptions;
1024
+ return this.fetchEventListener(eventTarget, eventName, eventOptions);
1023
1025
  };
1024
1026
 
1025
- Dispatcher.prototype.fetchEventListener = function (eventTarget, eventName) {
1027
+ Dispatcher.prototype.fetchEventListener = function (eventTarget, eventName, eventOptions) {
1026
1028
  var eventListenerMap = this.fetchEventListenerMapForEventTarget(eventTarget);
1027
- var eventListener = eventListenerMap.get(eventName);
1029
+ var cacheKey = this.cacheKey(eventName, eventOptions);
1030
+ var eventListener = eventListenerMap.get(cacheKey);
1028
1031
 
1029
1032
  if (!eventListener) {
1030
- eventListener = this.createEventListener(eventTarget, eventName);
1031
- eventListenerMap.set(eventName, eventListener);
1033
+ eventListener = this.createEventListener(eventTarget, eventName, eventOptions);
1034
+ eventListenerMap.set(cacheKey, eventListener);
1032
1035
  }
1033
1036
 
1034
1037
  return eventListener;
1035
1038
  };
1036
1039
 
1037
- Dispatcher.prototype.createEventListener = function (eventTarget, eventName) {
1038
- var eventListener = new _event_listener.EventListener(eventTarget, eventName);
1040
+ Dispatcher.prototype.createEventListener = function (eventTarget, eventName, eventOptions) {
1041
+ var eventListener = new _event_listener.EventListener(eventTarget, eventName, eventOptions);
1039
1042
 
1040
1043
  if (this.started) {
1041
1044
  eventListener.connect();
@@ -1055,27 +1058,36 @@ function () {
1055
1058
  return eventListenerMap;
1056
1059
  };
1057
1060
 
1061
+ Dispatcher.prototype.cacheKey = function (eventName, eventOptions) {
1062
+ var parts = [eventName];
1063
+ Object.keys(eventOptions).sort().forEach(function (key) {
1064
+ parts.push("" + (eventOptions[key] ? "" : "!") + key);
1065
+ });
1066
+ return parts.join(":");
1067
+ };
1068
+
1058
1069
  return Dispatcher;
1059
1070
  }();
1060
1071
 
1061
1072
  exports.Dispatcher = Dispatcher;
1062
- },{"./event_listener":"../node_modules/@stimulus/core/dist/src/event_listener.js"}],"../node_modules/@stimulus/core/dist/src/action_descriptor.js":[function(require,module,exports) {
1073
+ },{"./event_listener":"../node_modules/@stimulus/core/dist/event_listener.js"}],"../node_modules/@stimulus/core/dist/action_descriptor.js":[function(require,module,exports) {
1063
1074
  "use strict";
1064
1075
 
1065
1076
  Object.defineProperty(exports, "__esModule", {
1066
1077
  value: true
1067
1078
  });
1068
- exports.parseDescriptorString = parseDescriptorString;
1079
+ exports.parseActionDescriptorString = parseActionDescriptorString;
1069
1080
  exports.stringifyEventTarget = stringifyEventTarget;
1070
- // capture nos.: 12 23 4 43 1 5 56 7 76
1071
- var descriptorPattern = /^((.+?)(@(window|document))?->)?(.+?)(#(.+))?$/;
1081
+ // capture nos.: 12 23 4 43 1 5 56 7 768 9 98
1082
+ var descriptorPattern = /^((.+?)(@(window|document))?->)?(.+?)(#([^:]+?))(:(.+))?$/;
1072
1083
 
1073
- function parseDescriptorString(descriptorString) {
1084
+ function parseActionDescriptorString(descriptorString) {
1074
1085
  var source = descriptorString.trim();
1075
1086
  var matches = source.match(descriptorPattern) || [];
1076
1087
  return {
1077
1088
  eventTarget: parseEventTarget(matches[4]),
1078
1089
  eventName: matches[2],
1090
+ eventOptions: matches[9] ? parseEventOptions(matches[9]) : {},
1079
1091
  identifier: matches[5],
1080
1092
  methodName: matches[7]
1081
1093
  };
@@ -1089,6 +1101,14 @@ function parseEventTarget(eventTargetName) {
1089
1101
  }
1090
1102
  }
1091
1103
 
1104
+ function parseEventOptions(eventOptions) {
1105
+ return eventOptions.split(":").reduce(function (options, token) {
1106
+ var _a;
1107
+
1108
+ return Object.assign(options, (_a = {}, _a[token.replace(/^!/, "")] = !/^!/.test(token), _a));
1109
+ }, {});
1110
+ }
1111
+
1092
1112
  function stringifyEventTarget(eventTarget) {
1093
1113
  if (eventTarget == window) {
1094
1114
  return "window";
@@ -1096,7 +1116,7 @@ function stringifyEventTarget(eventTarget) {
1096
1116
  return "document";
1097
1117
  }
1098
1118
  }
1099
- },{}],"../node_modules/@stimulus/core/dist/src/action.js":[function(require,module,exports) {
1119
+ },{}],"../node_modules/@stimulus/core/dist/action.js":[function(require,module,exports) {
1100
1120
  "use strict";
1101
1121
 
1102
1122
  Object.defineProperty(exports, "__esModule", {
@@ -1115,12 +1135,13 @@ function () {
1115
1135
  this.index = index;
1116
1136
  this.eventTarget = descriptor.eventTarget || element;
1117
1137
  this.eventName = descriptor.eventName || getDefaultEventNameForElement(element) || error("missing event name");
1138
+ this.eventOptions = descriptor.eventOptions || {};
1118
1139
  this.identifier = descriptor.identifier || error("missing identifier");
1119
1140
  this.methodName = descriptor.methodName || error("missing method name");
1120
1141
  }
1121
1142
 
1122
1143
  Action.forToken = function (token) {
1123
- return new this(token.element, token.index, (0, _action_descriptor.parseDescriptorString)(token.content));
1144
+ return new this(token.element, token.index, (0, _action_descriptor.parseActionDescriptorString)(token.content));
1124
1145
  };
1125
1146
 
1126
1147
  Action.prototype.toString = function () {
@@ -1132,7 +1153,7 @@ function () {
1132
1153
  get: function () {
1133
1154
  return (0, _action_descriptor.stringifyEventTarget)(this.eventTarget);
1134
1155
  },
1135
- enumerable: true,
1156
+ enumerable: false,
1136
1157
  configurable: true
1137
1158
  });
1138
1159
  return Action;
@@ -1150,13 +1171,13 @@ var defaultEventNames = {
1150
1171
  return "submit";
1151
1172
  },
1152
1173
  "input": function (e) {
1153
- return e.getAttribute("type") == "submit" ? "click" : "change";
1174
+ return e.getAttribute("type") == "submit" ? "click" : "input";
1154
1175
  },
1155
1176
  "select": function (e) {
1156
1177
  return "change";
1157
1178
  },
1158
1179
  "textarea": function (e) {
1159
- return "change";
1180
+ return "input";
1160
1181
  }
1161
1182
  };
1162
1183
 
@@ -1171,7 +1192,7 @@ function getDefaultEventNameForElement(element) {
1171
1192
  function error(message) {
1172
1193
  throw new Error(message);
1173
1194
  }
1174
- },{"./action_descriptor":"../node_modules/@stimulus/core/dist/src/action_descriptor.js"}],"../node_modules/@stimulus/core/dist/src/binding.js":[function(require,module,exports) {
1195
+ },{"./action_descriptor":"../node_modules/@stimulus/core/dist/action_descriptor.js"}],"../node_modules/@stimulus/core/dist/binding.js":[function(require,module,exports) {
1175
1196
  "use strict";
1176
1197
 
1177
1198
  Object.defineProperty(exports, "__esModule", {
@@ -1191,21 +1212,28 @@ function () {
1191
1212
  get: function () {
1192
1213
  return this.action.index;
1193
1214
  },
1194
- enumerable: true,
1215
+ enumerable: false,
1195
1216
  configurable: true
1196
1217
  });
1197
1218
  Object.defineProperty(Binding.prototype, "eventTarget", {
1198
1219
  get: function () {
1199
1220
  return this.action.eventTarget;
1200
1221
  },
1201
- enumerable: true,
1222
+ enumerable: false,
1223
+ configurable: true
1224
+ });
1225
+ Object.defineProperty(Binding.prototype, "eventOptions", {
1226
+ get: function () {
1227
+ return this.action.eventOptions;
1228
+ },
1229
+ enumerable: false,
1202
1230
  configurable: true
1203
1231
  });
1204
1232
  Object.defineProperty(Binding.prototype, "identifier", {
1205
1233
  get: function () {
1206
1234
  return this.context.identifier;
1207
1235
  },
1208
- enumerable: true,
1236
+ enumerable: false,
1209
1237
  configurable: true
1210
1238
  });
1211
1239
 
@@ -1219,7 +1247,7 @@ function () {
1219
1247
  get: function () {
1220
1248
  return this.action.eventName;
1221
1249
  },
1222
- enumerable: true,
1250
+ enumerable: false,
1223
1251
  configurable: true
1224
1252
  });
1225
1253
  Object.defineProperty(Binding.prototype, "method", {
@@ -1232,7 +1260,7 @@ function () {
1232
1260
 
1233
1261
  throw new Error("Action \"" + this.action + "\" references undefined method \"" + this.methodName + "\"");
1234
1262
  },
1235
- enumerable: true,
1263
+ enumerable: false,
1236
1264
  configurable: true
1237
1265
  });
1238
1266
 
@@ -1265,7 +1293,7 @@ function () {
1265
1293
  } else if (eventTarget instanceof Element && this.element.contains(eventTarget)) {
1266
1294
  return this.scope.containsElement(eventTarget);
1267
1295
  } else {
1268
- return true;
1296
+ return this.scope.containsElement(this.action.element);
1269
1297
  }
1270
1298
  };
1271
1299
 
@@ -1273,35 +1301,35 @@ function () {
1273
1301
  get: function () {
1274
1302
  return this.context.controller;
1275
1303
  },
1276
- enumerable: true,
1304
+ enumerable: false,
1277
1305
  configurable: true
1278
1306
  });
1279
1307
  Object.defineProperty(Binding.prototype, "methodName", {
1280
1308
  get: function () {
1281
1309
  return this.action.methodName;
1282
1310
  },
1283
- enumerable: true,
1311
+ enumerable: false,
1284
1312
  configurable: true
1285
1313
  });
1286
1314
  Object.defineProperty(Binding.prototype, "element", {
1287
1315
  get: function () {
1288
1316
  return this.scope.element;
1289
1317
  },
1290
- enumerable: true,
1318
+ enumerable: false,
1291
1319
  configurable: true
1292
1320
  });
1293
1321
  Object.defineProperty(Binding.prototype, "scope", {
1294
1322
  get: function () {
1295
1323
  return this.context.scope;
1296
1324
  },
1297
- enumerable: true,
1325
+ enumerable: false,
1298
1326
  configurable: true
1299
1327
  });
1300
1328
  return Binding;
1301
1329
  }();
1302
1330
 
1303
1331
  exports.Binding = Binding;
1304
- },{}],"../node_modules/@stimulus/mutation-observers/dist/src/element_observer.js":[function(require,module,exports) {
1332
+ },{}],"../node_modules/@stimulus/mutation-observers/dist/element_observer.js":[function(require,module,exports) {
1305
1333
  "use strict";
1306
1334
 
1307
1335
  Object.defineProperty(exports, "__esModule", {
@@ -1479,7 +1507,7 @@ function () {
1479
1507
  }();
1480
1508
 
1481
1509
  exports.ElementObserver = ElementObserver;
1482
- },{}],"../node_modules/@stimulus/mutation-observers/dist/src/attribute_observer.js":[function(require,module,exports) {
1510
+ },{}],"../node_modules/@stimulus/mutation-observers/dist/attribute_observer.js":[function(require,module,exports) {
1483
1511
  "use strict";
1484
1512
 
1485
1513
  Object.defineProperty(exports, "__esModule", {
@@ -1502,14 +1530,14 @@ function () {
1502
1530
  get: function () {
1503
1531
  return this.elementObserver.element;
1504
1532
  },
1505
- enumerable: true,
1533
+ enumerable: false,
1506
1534
  configurable: true
1507
1535
  });
1508
1536
  Object.defineProperty(AttributeObserver.prototype, "selector", {
1509
1537
  get: function () {
1510
1538
  return "[" + this.attributeName + "]";
1511
1539
  },
1512
- enumerable: true,
1540
+ enumerable: false,
1513
1541
  configurable: true
1514
1542
  });
1515
1543
 
@@ -1529,7 +1557,7 @@ function () {
1529
1557
  get: function () {
1530
1558
  return this.elementObserver.started;
1531
1559
  },
1532
- enumerable: true,
1560
+ enumerable: false,
1533
1561
  configurable: true
1534
1562
  }); // Element observer delegate
1535
1563
 
@@ -1565,7 +1593,144 @@ function () {
1565
1593
  }();
1566
1594
 
1567
1595
  exports.AttributeObserver = AttributeObserver;
1568
- },{"./element_observer":"../node_modules/@stimulus/mutation-observers/dist/src/element_observer.js"}],"../node_modules/@stimulus/multimap/dist/src/set_operations.js":[function(require,module,exports) {
1596
+ },{"./element_observer":"../node_modules/@stimulus/mutation-observers/dist/element_observer.js"}],"../node_modules/@stimulus/mutation-observers/dist/string_map_observer.js":[function(require,module,exports) {
1597
+ "use strict";
1598
+
1599
+ Object.defineProperty(exports, "__esModule", {
1600
+ value: true
1601
+ });
1602
+ exports.StringMapObserver = void 0;
1603
+
1604
+ var StringMapObserver =
1605
+ /** @class */
1606
+ function () {
1607
+ function StringMapObserver(element, delegate) {
1608
+ var _this = this;
1609
+
1610
+ this.element = element;
1611
+ this.delegate = delegate;
1612
+ this.started = false;
1613
+ this.stringMap = new Map();
1614
+ this.mutationObserver = new MutationObserver(function (mutations) {
1615
+ return _this.processMutations(mutations);
1616
+ });
1617
+ }
1618
+
1619
+ StringMapObserver.prototype.start = function () {
1620
+ if (!this.started) {
1621
+ this.started = true;
1622
+ this.mutationObserver.observe(this.element, {
1623
+ attributes: true
1624
+ });
1625
+ this.refresh();
1626
+ }
1627
+ };
1628
+
1629
+ StringMapObserver.prototype.stop = function () {
1630
+ if (this.started) {
1631
+ this.mutationObserver.takeRecords();
1632
+ this.mutationObserver.disconnect();
1633
+ this.started = false;
1634
+ }
1635
+ };
1636
+
1637
+ StringMapObserver.prototype.refresh = function () {
1638
+ if (this.started) {
1639
+ for (var _i = 0, _a = this.knownAttributeNames; _i < _a.length; _i++) {
1640
+ var attributeName = _a[_i];
1641
+ this.refreshAttribute(attributeName);
1642
+ }
1643
+ }
1644
+ }; // Mutation record processing
1645
+
1646
+
1647
+ StringMapObserver.prototype.processMutations = function (mutations) {
1648
+ if (this.started) {
1649
+ for (var _i = 0, mutations_1 = mutations; _i < mutations_1.length; _i++) {
1650
+ var mutation = mutations_1[_i];
1651
+ this.processMutation(mutation);
1652
+ }
1653
+ }
1654
+ };
1655
+
1656
+ StringMapObserver.prototype.processMutation = function (mutation) {
1657
+ var attributeName = mutation.attributeName;
1658
+
1659
+ if (attributeName) {
1660
+ this.refreshAttribute(attributeName);
1661
+ }
1662
+ }; // State tracking
1663
+
1664
+
1665
+ StringMapObserver.prototype.refreshAttribute = function (attributeName) {
1666
+ var key = this.delegate.getStringMapKeyForAttribute(attributeName);
1667
+
1668
+ if (key != null) {
1669
+ if (!this.stringMap.has(attributeName)) {
1670
+ this.stringMapKeyAdded(key, attributeName);
1671
+ }
1672
+
1673
+ var value = this.element.getAttribute(attributeName);
1674
+
1675
+ if (this.stringMap.get(attributeName) != value) {
1676
+ this.stringMapValueChanged(value, key);
1677
+ }
1678
+
1679
+ if (value == null) {
1680
+ this.stringMap.delete(attributeName);
1681
+ this.stringMapKeyRemoved(key, attributeName);
1682
+ } else {
1683
+ this.stringMap.set(attributeName, value);
1684
+ }
1685
+ }
1686
+ };
1687
+
1688
+ StringMapObserver.prototype.stringMapKeyAdded = function (key, attributeName) {
1689
+ if (this.delegate.stringMapKeyAdded) {
1690
+ this.delegate.stringMapKeyAdded(key, attributeName);
1691
+ }
1692
+ };
1693
+
1694
+ StringMapObserver.prototype.stringMapValueChanged = function (value, key) {
1695
+ if (this.delegate.stringMapValueChanged) {
1696
+ this.delegate.stringMapValueChanged(value, key);
1697
+ }
1698
+ };
1699
+
1700
+ StringMapObserver.prototype.stringMapKeyRemoved = function (key, attributeName) {
1701
+ if (this.delegate.stringMapKeyRemoved) {
1702
+ this.delegate.stringMapKeyRemoved(key, attributeName);
1703
+ }
1704
+ };
1705
+
1706
+ Object.defineProperty(StringMapObserver.prototype, "knownAttributeNames", {
1707
+ get: function () {
1708
+ return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)));
1709
+ },
1710
+ enumerable: false,
1711
+ configurable: true
1712
+ });
1713
+ Object.defineProperty(StringMapObserver.prototype, "currentAttributeNames", {
1714
+ get: function () {
1715
+ return Array.from(this.element.attributes).map(function (attribute) {
1716
+ return attribute.name;
1717
+ });
1718
+ },
1719
+ enumerable: false,
1720
+ configurable: true
1721
+ });
1722
+ Object.defineProperty(StringMapObserver.prototype, "recordedAttributeNames", {
1723
+ get: function () {
1724
+ return Array.from(this.stringMap.keys());
1725
+ },
1726
+ enumerable: false,
1727
+ configurable: true
1728
+ });
1729
+ return StringMapObserver;
1730
+ }();
1731
+
1732
+ exports.StringMapObserver = StringMapObserver;
1733
+ },{}],"../node_modules/@stimulus/multimap/dist/set_operations.js":[function(require,module,exports) {
1569
1734
  "use strict";
1570
1735
 
1571
1736
  Object.defineProperty(exports, "__esModule", {
@@ -1603,7 +1768,7 @@ function prune(map, key) {
1603
1768
  map.delete(key);
1604
1769
  }
1605
1770
  }
1606
- },{}],"../node_modules/@stimulus/multimap/dist/src/multimap.js":[function(require,module,exports) {
1771
+ },{}],"../node_modules/@stimulus/multimap/dist/multimap.js":[function(require,module,exports) {
1607
1772
  "use strict";
1608
1773
 
1609
1774
  Object.defineProperty(exports, "__esModule", {
@@ -1627,7 +1792,7 @@ function () {
1627
1792
  return values.concat(Array.from(set));
1628
1793
  }, []);
1629
1794
  },
1630
- enumerable: true,
1795
+ enumerable: false,
1631
1796
  configurable: true
1632
1797
  });
1633
1798
  Object.defineProperty(Multimap.prototype, "size", {
@@ -1637,7 +1802,7 @@ function () {
1637
1802
  return size + set.size;
1638
1803
  }, 0);
1639
1804
  },
1640
- enumerable: true,
1805
+ enumerable: false,
1641
1806
  configurable: true
1642
1807
  });
1643
1808
 
@@ -1686,7 +1851,7 @@ function () {
1686
1851
  }();
1687
1852
 
1688
1853
  exports.Multimap = Multimap;
1689
- },{"./set_operations":"../node_modules/@stimulus/multimap/dist/src/set_operations.js"}],"../node_modules/@stimulus/multimap/dist/src/indexed_multimap.js":[function(require,module,exports) {
1854
+ },{"./set_operations":"../node_modules/@stimulus/multimap/dist/set_operations.js"}],"../node_modules/@stimulus/multimap/dist/indexed_multimap.js":[function(require,module,exports) {
1690
1855
  "use strict";
1691
1856
 
1692
1857
  Object.defineProperty(exports, "__esModule", {
@@ -1699,12 +1864,16 @@ var _multimap = require("./multimap");
1699
1864
  var _set_operations = require("./set_operations");
1700
1865
 
1701
1866
  var __extends = void 0 && (void 0).__extends || function () {
1702
- var extendStatics = Object.setPrototypeOf || {
1703
- __proto__: []
1704
- } instanceof Array && function (d, b) {
1705
- d.__proto__ = b;
1706
- } || function (d, b) {
1707
- for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
1867
+ var extendStatics = function (d, b) {
1868
+ extendStatics = Object.setPrototypeOf || {
1869
+ __proto__: []
1870
+ } instanceof Array && function (d, b) {
1871
+ d.__proto__ = b;
1872
+ } || function (d, b) {
1873
+ for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
1874
+ };
1875
+
1876
+ return extendStatics(d, b);
1708
1877
  };
1709
1878
 
1710
1879
  return function (d, b) {
@@ -1734,7 +1903,7 @@ function (_super) {
1734
1903
  get: function () {
1735
1904
  return Array.from(this.keysByValue.keys());
1736
1905
  },
1737
- enumerable: true,
1906
+ enumerable: false,
1738
1907
  configurable: true
1739
1908
  });
1740
1909
 
@@ -1763,17 +1932,31 @@ function (_super) {
1763
1932
  }(_multimap.Multimap);
1764
1933
 
1765
1934
  exports.IndexedMultimap = IndexedMultimap;
1766
- },{"./multimap":"../node_modules/@stimulus/multimap/dist/src/multimap.js","./set_operations":"../node_modules/@stimulus/multimap/dist/src/set_operations.js"}],"../node_modules/@stimulus/multimap/dist/index.js":[function(require,module,exports) {
1935
+ },{"./multimap":"../node_modules/@stimulus/multimap/dist/multimap.js","./set_operations":"../node_modules/@stimulus/multimap/dist/set_operations.js"}],"../node_modules/@stimulus/multimap/dist/index.js":[function(require,module,exports) {
1767
1936
  "use strict";
1768
1937
 
1769
1938
  Object.defineProperty(exports, "__esModule", {
1770
1939
  value: true
1771
1940
  });
1772
1941
 
1773
- var _multimap = require("./src/multimap");
1942
+ var _indexed_multimap = require("./indexed_multimap");
1943
+
1944
+ Object.keys(_indexed_multimap).forEach(function (key) {
1945
+ if (key === "default" || key === "__esModule") return;
1946
+ if (key in exports && exports[key] === _indexed_multimap[key]) return;
1947
+ Object.defineProperty(exports, key, {
1948
+ enumerable: true,
1949
+ get: function () {
1950
+ return _indexed_multimap[key];
1951
+ }
1952
+ });
1953
+ });
1954
+
1955
+ var _multimap = require("./multimap");
1774
1956
 
1775
1957
  Object.keys(_multimap).forEach(function (key) {
1776
1958
  if (key === "default" || key === "__esModule") return;
1959
+ if (key in exports && exports[key] === _multimap[key]) return;
1777
1960
  Object.defineProperty(exports, key, {
1778
1961
  enumerable: true,
1779
1962
  get: function () {
@@ -1782,18 +1965,19 @@ Object.keys(_multimap).forEach(function (key) {
1782
1965
  });
1783
1966
  });
1784
1967
 
1785
- var _indexed_multimap = require("./src/indexed_multimap");
1968
+ var _set_operations = require("./set_operations");
1786
1969
 
1787
- Object.keys(_indexed_multimap).forEach(function (key) {
1970
+ Object.keys(_set_operations).forEach(function (key) {
1788
1971
  if (key === "default" || key === "__esModule") return;
1972
+ if (key in exports && exports[key] === _set_operations[key]) return;
1789
1973
  Object.defineProperty(exports, key, {
1790
1974
  enumerable: true,
1791
1975
  get: function () {
1792
- return _indexed_multimap[key];
1976
+ return _set_operations[key];
1793
1977
  }
1794
1978
  });
1795
1979
  });
1796
- },{"./src/multimap":"../node_modules/@stimulus/multimap/dist/src/multimap.js","./src/indexed_multimap":"../node_modules/@stimulus/multimap/dist/src/indexed_multimap.js"}],"../node_modules/@stimulus/mutation-observers/dist/src/token_list_observer.js":[function(require,module,exports) {
1980
+ },{"./indexed_multimap":"../node_modules/@stimulus/multimap/dist/indexed_multimap.js","./multimap":"../node_modules/@stimulus/multimap/dist/multimap.js","./set_operations":"../node_modules/@stimulus/multimap/dist/set_operations.js"}],"../node_modules/@stimulus/mutation-observers/dist/token_list_observer.js":[function(require,module,exports) {
1797
1981
  "use strict";
1798
1982
 
1799
1983
  Object.defineProperty(exports, "__esModule", {
@@ -1818,7 +2002,7 @@ function () {
1818
2002
  get: function () {
1819
2003
  return this.attributeObserver.started;
1820
2004
  },
1821
- enumerable: true,
2005
+ enumerable: false,
1822
2006
  configurable: true
1823
2007
  });
1824
2008
 
@@ -1838,14 +2022,14 @@ function () {
1838
2022
  get: function () {
1839
2023
  return this.attributeObserver.element;
1840
2024
  },
1841
- enumerable: true,
2025
+ enumerable: false,
1842
2026
  configurable: true
1843
2027
  });
1844
2028
  Object.defineProperty(TokenListObserver.prototype, "attributeName", {
1845
2029
  get: function () {
1846
2030
  return this.attributeObserver.attributeName;
1847
2031
  },
1848
- enumerable: true,
2032
+ enumerable: false,
1849
2033
  configurable: true
1850
2034
  }); // Attribute observer delegate
1851
2035
 
@@ -1944,7 +2128,7 @@ function zip(left, right) {
1944
2128
  function tokensAreEqual(left, right) {
1945
2129
  return left && right && left.index == right.index && left.content == right.content;
1946
2130
  }
1947
- },{"./attribute_observer":"../node_modules/@stimulus/mutation-observers/dist/src/attribute_observer.js","@stimulus/multimap":"../node_modules/@stimulus/multimap/dist/index.js"}],"../node_modules/@stimulus/mutation-observers/dist/src/value_list_observer.js":[function(require,module,exports) {
2131
+ },{"./attribute_observer":"../node_modules/@stimulus/mutation-observers/dist/attribute_observer.js","@stimulus/multimap":"../node_modules/@stimulus/multimap/dist/index.js"}],"../node_modules/@stimulus/mutation-observers/dist/value_list_observer.js":[function(require,module,exports) {
1948
2132
  "use strict";
1949
2133
 
1950
2134
  Object.defineProperty(exports, "__esModule", {
@@ -1968,7 +2152,7 @@ function () {
1968
2152
  get: function () {
1969
2153
  return this.tokenListObserver.started;
1970
2154
  },
1971
- enumerable: true,
2155
+ enumerable: false,
1972
2156
  configurable: true
1973
2157
  });
1974
2158
 
@@ -1988,14 +2172,14 @@ function () {
1988
2172
  get: function () {
1989
2173
  return this.tokenListObserver.element;
1990
2174
  },
1991
- enumerable: true,
2175
+ enumerable: false,
1992
2176
  configurable: true
1993
2177
  });
1994
2178
  Object.defineProperty(ValueListObserver.prototype, "attributeName", {
1995
2179
  get: function () {
1996
2180
  return this.tokenListObserver.attributeName;
1997
2181
  },
1998
- enumerable: true,
2182
+ enumerable: false,
1999
2183
  configurable: true
2000
2184
  });
2001
2185
 
@@ -2058,17 +2242,18 @@ function () {
2058
2242
  }();
2059
2243
 
2060
2244
  exports.ValueListObserver = ValueListObserver;
2061
- },{"./token_list_observer":"../node_modules/@stimulus/mutation-observers/dist/src/token_list_observer.js"}],"../node_modules/@stimulus/mutation-observers/dist/index.js":[function(require,module,exports) {
2245
+ },{"./token_list_observer":"../node_modules/@stimulus/mutation-observers/dist/token_list_observer.js"}],"../node_modules/@stimulus/mutation-observers/dist/index.js":[function(require,module,exports) {
2062
2246
  "use strict";
2063
2247
 
2064
2248
  Object.defineProperty(exports, "__esModule", {
2065
2249
  value: true
2066
2250
  });
2067
2251
 
2068
- var _attribute_observer = require("./src/attribute_observer");
2252
+ var _attribute_observer = require("./attribute_observer");
2069
2253
 
2070
2254
  Object.keys(_attribute_observer).forEach(function (key) {
2071
2255
  if (key === "default" || key === "__esModule") return;
2256
+ if (key in exports && exports[key] === _attribute_observer[key]) return;
2072
2257
  Object.defineProperty(exports, key, {
2073
2258
  enumerable: true,
2074
2259
  get: function () {
@@ -2077,10 +2262,11 @@ Object.keys(_attribute_observer).forEach(function (key) {
2077
2262
  });
2078
2263
  });
2079
2264
 
2080
- var _element_observer = require("./src/element_observer");
2265
+ var _element_observer = require("./element_observer");
2081
2266
 
2082
2267
  Object.keys(_element_observer).forEach(function (key) {
2083
2268
  if (key === "default" || key === "__esModule") return;
2269
+ if (key in exports && exports[key] === _element_observer[key]) return;
2084
2270
  Object.defineProperty(exports, key, {
2085
2271
  enumerable: true,
2086
2272
  get: function () {
@@ -2089,10 +2275,24 @@ Object.keys(_element_observer).forEach(function (key) {
2089
2275
  });
2090
2276
  });
2091
2277
 
2092
- var _token_list_observer = require("./src/token_list_observer");
2278
+ var _string_map_observer = require("./string_map_observer");
2279
+
2280
+ Object.keys(_string_map_observer).forEach(function (key) {
2281
+ if (key === "default" || key === "__esModule") return;
2282
+ if (key in exports && exports[key] === _string_map_observer[key]) return;
2283
+ Object.defineProperty(exports, key, {
2284
+ enumerable: true,
2285
+ get: function () {
2286
+ return _string_map_observer[key];
2287
+ }
2288
+ });
2289
+ });
2290
+
2291
+ var _token_list_observer = require("./token_list_observer");
2093
2292
 
2094
2293
  Object.keys(_token_list_observer).forEach(function (key) {
2095
2294
  if (key === "default" || key === "__esModule") return;
2295
+ if (key in exports && exports[key] === _token_list_observer[key]) return;
2096
2296
  Object.defineProperty(exports, key, {
2097
2297
  enumerable: true,
2098
2298
  get: function () {
@@ -2101,10 +2301,11 @@ Object.keys(_token_list_observer).forEach(function (key) {
2101
2301
  });
2102
2302
  });
2103
2303
 
2104
- var _value_list_observer = require("./src/value_list_observer");
2304
+ var _value_list_observer = require("./value_list_observer");
2105
2305
 
2106
2306
  Object.keys(_value_list_observer).forEach(function (key) {
2107
2307
  if (key === "default" || key === "__esModule") return;
2308
+ if (key in exports && exports[key] === _value_list_observer[key]) return;
2108
2309
  Object.defineProperty(exports, key, {
2109
2310
  enumerable: true,
2110
2311
  get: function () {
@@ -2112,7 +2313,7 @@ Object.keys(_value_list_observer).forEach(function (key) {
2112
2313
  }
2113
2314
  });
2114
2315
  });
2115
- },{"./src/attribute_observer":"../node_modules/@stimulus/mutation-observers/dist/src/attribute_observer.js","./src/element_observer":"../node_modules/@stimulus/mutation-observers/dist/src/element_observer.js","./src/token_list_observer":"../node_modules/@stimulus/mutation-observers/dist/src/token_list_observer.js","./src/value_list_observer":"../node_modules/@stimulus/mutation-observers/dist/src/value_list_observer.js"}],"../node_modules/@stimulus/core/dist/src/binding_observer.js":[function(require,module,exports) {
2316
+ },{"./attribute_observer":"../node_modules/@stimulus/mutation-observers/dist/attribute_observer.js","./element_observer":"../node_modules/@stimulus/mutation-observers/dist/element_observer.js","./string_map_observer":"../node_modules/@stimulus/mutation-observers/dist/string_map_observer.js","./token_list_observer":"../node_modules/@stimulus/mutation-observers/dist/token_list_observer.js","./value_list_observer":"../node_modules/@stimulus/mutation-observers/dist/value_list_observer.js"}],"../node_modules/@stimulus/core/dist/binding_observer.js":[function(require,module,exports) {
2116
2317
  "use strict";
2117
2318
 
2118
2319
  Object.defineProperty(exports, "__esModule", {
@@ -2154,35 +2355,35 @@ function () {
2154
2355
  get: function () {
2155
2356
  return this.context.element;
2156
2357
  },
2157
- enumerable: true,
2358
+ enumerable: false,
2158
2359
  configurable: true
2159
2360
  });
2160
2361
  Object.defineProperty(BindingObserver.prototype, "identifier", {
2161
2362
  get: function () {
2162
2363
  return this.context.identifier;
2163
2364
  },
2164
- enumerable: true,
2365
+ enumerable: false,
2165
2366
  configurable: true
2166
2367
  });
2167
2368
  Object.defineProperty(BindingObserver.prototype, "actionAttribute", {
2168
2369
  get: function () {
2169
2370
  return this.schema.actionAttribute;
2170
2371
  },
2171
- enumerable: true,
2372
+ enumerable: false,
2172
2373
  configurable: true
2173
2374
  });
2174
2375
  Object.defineProperty(BindingObserver.prototype, "schema", {
2175
2376
  get: function () {
2176
2377
  return this.context.schema;
2177
2378
  },
2178
- enumerable: true,
2379
+ enumerable: false,
2179
2380
  configurable: true
2180
2381
  });
2181
2382
  Object.defineProperty(BindingObserver.prototype, "bindings", {
2182
2383
  get: function () {
2183
2384
  return Array.from(this.bindingsByAction.values());
2184
2385
  },
2185
- enumerable: true,
2386
+ enumerable: false,
2186
2387
  configurable: true
2187
2388
  });
2188
2389
 
@@ -2231,7 +2432,98 @@ function () {
2231
2432
  }();
2232
2433
 
2233
2434
  exports.BindingObserver = BindingObserver;
2234
- },{"./action":"../node_modules/@stimulus/core/dist/src/action.js","./binding":"../node_modules/@stimulus/core/dist/src/binding.js","@stimulus/mutation-observers":"../node_modules/@stimulus/mutation-observers/dist/index.js"}],"../node_modules/@stimulus/core/dist/src/context.js":[function(require,module,exports) {
2435
+ },{"./action":"../node_modules/@stimulus/core/dist/action.js","./binding":"../node_modules/@stimulus/core/dist/binding.js","@stimulus/mutation-observers":"../node_modules/@stimulus/mutation-observers/dist/index.js"}],"../node_modules/@stimulus/core/dist/value_observer.js":[function(require,module,exports) {
2436
+ "use strict";
2437
+
2438
+ Object.defineProperty(exports, "__esModule", {
2439
+ value: true
2440
+ });
2441
+ exports.ValueObserver = void 0;
2442
+
2443
+ var _mutationObservers = require("@stimulus/mutation-observers");
2444
+
2445
+ var ValueObserver =
2446
+ /** @class */
2447
+ function () {
2448
+ function ValueObserver(context, receiver) {
2449
+ this.context = context;
2450
+ this.receiver = receiver;
2451
+ this.stringMapObserver = new _mutationObservers.StringMapObserver(this.element, this);
2452
+ this.valueDescriptorMap = this.controller.valueDescriptorMap;
2453
+ this.invokeChangedCallbacksForDefaultValues();
2454
+ }
2455
+
2456
+ ValueObserver.prototype.start = function () {
2457
+ this.stringMapObserver.start();
2458
+ };
2459
+
2460
+ ValueObserver.prototype.stop = function () {
2461
+ this.stringMapObserver.stop();
2462
+ };
2463
+
2464
+ Object.defineProperty(ValueObserver.prototype, "element", {
2465
+ get: function () {
2466
+ return this.context.element;
2467
+ },
2468
+ enumerable: false,
2469
+ configurable: true
2470
+ });
2471
+ Object.defineProperty(ValueObserver.prototype, "controller", {
2472
+ get: function () {
2473
+ return this.context.controller;
2474
+ },
2475
+ enumerable: false,
2476
+ configurable: true
2477
+ }); // String map observer delegate
2478
+
2479
+ ValueObserver.prototype.getStringMapKeyForAttribute = function (attributeName) {
2480
+ if (attributeName in this.valueDescriptorMap) {
2481
+ return this.valueDescriptorMap[attributeName].name;
2482
+ }
2483
+ };
2484
+
2485
+ ValueObserver.prototype.stringMapValueChanged = function (attributeValue, name) {
2486
+ this.invokeChangedCallbackForValue(name);
2487
+ };
2488
+
2489
+ ValueObserver.prototype.invokeChangedCallbacksForDefaultValues = function () {
2490
+ for (var _i = 0, _a = this.valueDescriptors; _i < _a.length; _i++) {
2491
+ var _b = _a[_i],
2492
+ key = _b.key,
2493
+ name_1 = _b.name,
2494
+ defaultValue = _b.defaultValue;
2495
+
2496
+ if (defaultValue != undefined && !this.controller.data.has(key)) {
2497
+ this.invokeChangedCallbackForValue(name_1);
2498
+ }
2499
+ }
2500
+ };
2501
+
2502
+ ValueObserver.prototype.invokeChangedCallbackForValue = function (name) {
2503
+ var methodName = name + "Changed";
2504
+ var method = this.receiver[methodName];
2505
+
2506
+ if (typeof method == "function") {
2507
+ var value = this.receiver[name];
2508
+ method.call(this.receiver, value);
2509
+ }
2510
+ };
2511
+
2512
+ Object.defineProperty(ValueObserver.prototype, "valueDescriptors", {
2513
+ get: function () {
2514
+ var valueDescriptorMap = this.valueDescriptorMap;
2515
+ return Object.keys(valueDescriptorMap).map(function (key) {
2516
+ return valueDescriptorMap[key];
2517
+ });
2518
+ },
2519
+ enumerable: false,
2520
+ configurable: true
2521
+ });
2522
+ return ValueObserver;
2523
+ }();
2524
+
2525
+ exports.ValueObserver = ValueObserver;
2526
+ },{"@stimulus/mutation-observers":"../node_modules/@stimulus/mutation-observers/dist/index.js"}],"../node_modules/@stimulus/core/dist/context.js":[function(require,module,exports) {
2235
2527
  "use strict";
2236
2528
 
2237
2529
  Object.defineProperty(exports, "__esModule", {
@@ -2241,6 +2533,8 @@ exports.Context = void 0;
2241
2533
 
2242
2534
  var _binding_observer = require("./binding_observer");
2243
2535
 
2536
+ var _value_observer = require("./value_observer");
2537
+
2244
2538
  var Context =
2245
2539
  /** @class */
2246
2540
  function () {
@@ -2249,6 +2543,7 @@ function () {
2249
2543
  this.scope = scope;
2250
2544
  this.controller = new module.controllerConstructor(this);
2251
2545
  this.bindingObserver = new _binding_observer.BindingObserver(this, this.dispatcher);
2546
+ this.valueObserver = new _value_observer.ValueObserver(this, this.controller);
2252
2547
 
2253
2548
  try {
2254
2549
  this.controller.initialize();
@@ -2259,6 +2554,7 @@ function () {
2259
2554
 
2260
2555
  Context.prototype.connect = function () {
2261
2556
  this.bindingObserver.start();
2557
+ this.valueObserver.start();
2262
2558
 
2263
2559
  try {
2264
2560
  this.controller.connect();
@@ -2274,6 +2570,7 @@ function () {
2274
2570
  this.handleError(error, "disconnecting controller");
2275
2571
  }
2276
2572
 
2573
+ this.valueObserver.stop();
2277
2574
  this.bindingObserver.stop();
2278
2575
  };
2279
2576
 
@@ -2281,42 +2578,42 @@ function () {
2281
2578
  get: function () {
2282
2579
  return this.module.application;
2283
2580
  },
2284
- enumerable: true,
2581
+ enumerable: false,
2285
2582
  configurable: true
2286
2583
  });
2287
2584
  Object.defineProperty(Context.prototype, "identifier", {
2288
2585
  get: function () {
2289
2586
  return this.module.identifier;
2290
2587
  },
2291
- enumerable: true,
2588
+ enumerable: false,
2292
2589
  configurable: true
2293
2590
  });
2294
2591
  Object.defineProperty(Context.prototype, "schema", {
2295
2592
  get: function () {
2296
2593
  return this.application.schema;
2297
2594
  },
2298
- enumerable: true,
2595
+ enumerable: false,
2299
2596
  configurable: true
2300
2597
  });
2301
2598
  Object.defineProperty(Context.prototype, "dispatcher", {
2302
2599
  get: function () {
2303
2600
  return this.application.dispatcher;
2304
2601
  },
2305
- enumerable: true,
2602
+ enumerable: false,
2306
2603
  configurable: true
2307
2604
  });
2308
2605
  Object.defineProperty(Context.prototype, "element", {
2309
2606
  get: function () {
2310
2607
  return this.scope.element;
2311
2608
  },
2312
- enumerable: true,
2609
+ enumerable: false,
2313
2610
  configurable: true
2314
2611
  });
2315
2612
  Object.defineProperty(Context.prototype, "parentElement", {
2316
2613
  get: function () {
2317
2614
  return this.element.parentElement;
2318
2615
  },
2319
- enumerable: true,
2616
+ enumerable: false,
2320
2617
  configurable: true
2321
2618
  }); // Error handling
2322
2619
 
@@ -2342,21 +2639,76 @@ function () {
2342
2639
  }();
2343
2640
 
2344
2641
  exports.Context = Context;
2345
- },{"./binding_observer":"../node_modules/@stimulus/core/dist/src/binding_observer.js"}],"../node_modules/@stimulus/core/dist/src/definition.js":[function(require,module,exports) {
2642
+ },{"./binding_observer":"../node_modules/@stimulus/core/dist/binding_observer.js","./value_observer":"../node_modules/@stimulus/core/dist/value_observer.js"}],"../node_modules/@stimulus/core/dist/inheritable_statics.js":[function(require,module,exports) {
2346
2643
  "use strict";
2347
2644
 
2348
2645
  Object.defineProperty(exports, "__esModule", {
2349
2646
  value: true
2350
2647
  });
2351
- exports.blessDefinition = blessDefinition;
2648
+ exports.readInheritableStaticArrayValues = readInheritableStaticArrayValues;
2649
+ exports.readInheritableStaticObjectPairs = readInheritableStaticObjectPairs;
2650
+
2651
+ function readInheritableStaticArrayValues(constructor, propertyName) {
2652
+ var ancestors = getAncestorsForConstructor(constructor);
2653
+ return Array.from(ancestors.reduce(function (values, constructor) {
2654
+ getOwnStaticArrayValues(constructor, propertyName).forEach(function (name) {
2655
+ return values.add(name);
2656
+ });
2657
+ return values;
2658
+ }, new Set()));
2659
+ }
2660
+
2661
+ function readInheritableStaticObjectPairs(constructor, propertyName) {
2662
+ var ancestors = getAncestorsForConstructor(constructor);
2663
+ return ancestors.reduce(function (pairs, constructor) {
2664
+ pairs.push.apply(pairs, getOwnStaticObjectPairs(constructor, propertyName));
2665
+ return pairs;
2666
+ }, []);
2667
+ }
2668
+
2669
+ function getAncestorsForConstructor(constructor) {
2670
+ var ancestors = [];
2671
+
2672
+ while (constructor) {
2673
+ ancestors.push(constructor);
2674
+ constructor = Object.getPrototypeOf(constructor);
2675
+ }
2676
+
2677
+ return ancestors.reverse();
2678
+ }
2679
+
2680
+ function getOwnStaticArrayValues(constructor, propertyName) {
2681
+ var definition = constructor[propertyName];
2682
+ return Array.isArray(definition) ? definition : [];
2683
+ }
2684
+
2685
+ function getOwnStaticObjectPairs(constructor, propertyName) {
2686
+ var definition = constructor[propertyName];
2687
+ return definition ? Object.keys(definition).map(function (key) {
2688
+ return [key, definition[key]];
2689
+ }) : [];
2690
+ }
2691
+ },{}],"../node_modules/@stimulus/core/dist/blessing.js":[function(require,module,exports) {
2692
+ "use strict";
2693
+
2694
+ Object.defineProperty(exports, "__esModule", {
2695
+ value: true
2696
+ });
2697
+ exports.bless = bless;
2698
+
2699
+ var _inheritable_statics = require("./inheritable_statics");
2352
2700
 
2353
2701
  var __extends = void 0 && (void 0).__extends || function () {
2354
- var extendStatics = Object.setPrototypeOf || {
2355
- __proto__: []
2356
- } instanceof Array && function (d, b) {
2357
- d.__proto__ = b;
2358
- } || function (d, b) {
2359
- for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
2702
+ var extendStatics = function (d, b) {
2703
+ extendStatics = Object.setPrototypeOf || {
2704
+ __proto__: []
2705
+ } instanceof Array && function (d, b) {
2706
+ d.__proto__ = b;
2707
+ } || function (d, b) {
2708
+ for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
2709
+ };
2710
+
2711
+ return extendStatics(d, b);
2360
2712
  };
2361
2713
 
2362
2714
  return function (d, b) {
@@ -2369,37 +2721,96 @@ var __extends = void 0 && (void 0).__extends || function () {
2369
2721
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
2370
2722
  };
2371
2723
  }();
2372
- /** @hidden */
2373
2724
 
2725
+ var __spreadArrays = void 0 && (void 0).__spreadArrays || function () {
2726
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
2374
2727
 
2375
- function blessDefinition(definition) {
2376
- return {
2377
- identifier: definition.identifier,
2378
- controllerConstructor: blessControllerConstructor(definition.controllerConstructor)
2379
- };
2728
+ for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j];
2729
+
2730
+ return r;
2731
+ };
2732
+
2733
+ /** @hidden */
2734
+ function bless(constructor) {
2735
+ return shadow(constructor, getBlessedProperties(constructor));
2380
2736
  }
2381
2737
 
2382
- function blessControllerConstructor(controllerConstructor) {
2383
- var constructor = extend(controllerConstructor);
2384
- constructor.bless();
2385
- return constructor;
2738
+ function shadow(constructor, properties) {
2739
+ var shadowConstructor = extend(constructor);
2740
+ var shadowProperties = getShadowProperties(constructor.prototype, properties);
2741
+ Object.defineProperties(shadowConstructor.prototype, shadowProperties);
2742
+ return shadowConstructor;
2386
2743
  }
2387
2744
 
2745
+ function getBlessedProperties(constructor) {
2746
+ var blessings = (0, _inheritable_statics.readInheritableStaticArrayValues)(constructor, "blessings");
2747
+ return blessings.reduce(function (blessedProperties, blessing) {
2748
+ var properties = blessing(constructor);
2749
+
2750
+ for (var key in properties) {
2751
+ var descriptor = blessedProperties[key] || {};
2752
+ blessedProperties[key] = Object.assign(descriptor, properties[key]);
2753
+ }
2754
+
2755
+ return blessedProperties;
2756
+ }, {});
2757
+ }
2758
+
2759
+ function getShadowProperties(prototype, properties) {
2760
+ return getOwnKeys(properties).reduce(function (shadowProperties, key) {
2761
+ var _a;
2762
+
2763
+ var descriptor = getShadowedDescriptor(prototype, properties, key);
2764
+
2765
+ if (descriptor) {
2766
+ Object.assign(shadowProperties, (_a = {}, _a[key] = descriptor, _a));
2767
+ }
2768
+
2769
+ return shadowProperties;
2770
+ }, {});
2771
+ }
2772
+
2773
+ function getShadowedDescriptor(prototype, properties, key) {
2774
+ var shadowingDescriptor = Object.getOwnPropertyDescriptor(prototype, key);
2775
+ var shadowedByValue = shadowingDescriptor && "value" in shadowingDescriptor;
2776
+
2777
+ if (!shadowedByValue) {
2778
+ var descriptor = Object.getOwnPropertyDescriptor(properties, key).value;
2779
+
2780
+ if (shadowingDescriptor) {
2781
+ descriptor.get = shadowingDescriptor.get || descriptor.get;
2782
+ descriptor.set = shadowingDescriptor.set || descriptor.set;
2783
+ }
2784
+
2785
+ return descriptor;
2786
+ }
2787
+ }
2788
+
2789
+ var getOwnKeys = function () {
2790
+ if (typeof Object.getOwnPropertySymbols == "function") {
2791
+ return function (object) {
2792
+ return __spreadArrays(Object.getOwnPropertyNames(object), Object.getOwnPropertySymbols(object));
2793
+ };
2794
+ } else {
2795
+ return Object.getOwnPropertyNames;
2796
+ }
2797
+ }();
2798
+
2388
2799
  var extend = function () {
2389
2800
  function extendWithReflect(constructor) {
2390
- function Controller() {
2391
- var _newTarget = this && this instanceof Controller ? this.constructor : void 0;
2801
+ function extended() {
2802
+ var _newTarget = this && this instanceof extended ? this.constructor : void 0;
2392
2803
 
2393
2804
  return Reflect.construct(constructor, arguments, _newTarget);
2394
2805
  }
2395
2806
 
2396
- Controller.prototype = Object.create(constructor.prototype, {
2807
+ extended.prototype = Object.create(constructor.prototype, {
2397
2808
  constructor: {
2398
- value: Controller
2809
+ value: extended
2399
2810
  }
2400
2811
  });
2401
- Reflect.setPrototypeOf(Controller, constructor);
2402
- return Controller;
2812
+ Reflect.setPrototypeOf(extended, constructor);
2813
+ return extended;
2403
2814
  }
2404
2815
 
2405
2816
  function testReflectExtension() {
@@ -2422,19 +2833,36 @@ var extend = function () {
2422
2833
  return (
2423
2834
  /** @class */
2424
2835
  function (_super) {
2425
- __extends(Controller, _super);
2836
+ __extends(extended, _super);
2426
2837
 
2427
- function Controller() {
2838
+ function extended() {
2428
2839
  return _super !== null && _super.apply(this, arguments) || this;
2429
2840
  }
2430
2841
 
2431
- return Controller;
2842
+ return extended;
2432
2843
  }(constructor)
2433
2844
  );
2434
2845
  };
2435
2846
  }
2436
2847
  }();
2437
- },{}],"../node_modules/@stimulus/core/dist/src/module.js":[function(require,module,exports) {
2848
+ },{"./inheritable_statics":"../node_modules/@stimulus/core/dist/inheritable_statics.js"}],"../node_modules/@stimulus/core/dist/definition.js":[function(require,module,exports) {
2849
+ "use strict";
2850
+
2851
+ Object.defineProperty(exports, "__esModule", {
2852
+ value: true
2853
+ });
2854
+ exports.blessDefinition = blessDefinition;
2855
+
2856
+ var _blessing = require("./blessing");
2857
+
2858
+ /** @hidden */
2859
+ function blessDefinition(definition) {
2860
+ return {
2861
+ identifier: definition.identifier,
2862
+ controllerConstructor: (0, _blessing.bless)(definition.controllerConstructor)
2863
+ };
2864
+ }
2865
+ },{"./blessing":"../node_modules/@stimulus/core/dist/blessing.js"}],"../node_modules/@stimulus/core/dist/module.js":[function(require,module,exports) {
2438
2866
  "use strict";
2439
2867
 
2440
2868
  Object.defineProperty(exports, "__esModule", {
@@ -2460,21 +2888,21 @@ function () {
2460
2888
  get: function () {
2461
2889
  return this.definition.identifier;
2462
2890
  },
2463
- enumerable: true,
2891
+ enumerable: false,
2464
2892
  configurable: true
2465
2893
  });
2466
2894
  Object.defineProperty(Module.prototype, "controllerConstructor", {
2467
2895
  get: function () {
2468
2896
  return this.definition.controllerConstructor;
2469
2897
  },
2470
- enumerable: true,
2898
+ enumerable: false,
2471
2899
  configurable: true
2472
2900
  });
2473
2901
  Object.defineProperty(Module.prototype, "contexts", {
2474
2902
  get: function () {
2475
2903
  return Array.from(this.connectedContexts);
2476
2904
  },
2477
- enumerable: true,
2905
+ enumerable: false,
2478
2906
  configurable: true
2479
2907
  });
2480
2908
 
@@ -2508,7 +2936,74 @@ function () {
2508
2936
  }();
2509
2937
 
2510
2938
  exports.Module = Module;
2511
- },{"./context":"../node_modules/@stimulus/core/dist/src/context.js","./definition":"../node_modules/@stimulus/core/dist/src/definition.js"}],"../node_modules/@stimulus/core/dist/src/data_map.js":[function(require,module,exports) {
2939
+ },{"./context":"../node_modules/@stimulus/core/dist/context.js","./definition":"../node_modules/@stimulus/core/dist/definition.js"}],"../node_modules/@stimulus/core/dist/class_map.js":[function(require,module,exports) {
2940
+ "use strict";
2941
+
2942
+ Object.defineProperty(exports, "__esModule", {
2943
+ value: true
2944
+ });
2945
+ exports.ClassMap = void 0;
2946
+
2947
+ var ClassMap =
2948
+ /** @class */
2949
+ function () {
2950
+ function ClassMap(scope) {
2951
+ this.scope = scope;
2952
+ }
2953
+
2954
+ ClassMap.prototype.has = function (name) {
2955
+ return this.data.has(this.getDataKey(name));
2956
+ };
2957
+
2958
+ ClassMap.prototype.get = function (name) {
2959
+ return this.data.get(this.getDataKey(name));
2960
+ };
2961
+
2962
+ ClassMap.prototype.getAttributeName = function (name) {
2963
+ return this.data.getAttributeNameForKey(this.getDataKey(name));
2964
+ };
2965
+
2966
+ ClassMap.prototype.getDataKey = function (name) {
2967
+ return name + "-class";
2968
+ };
2969
+
2970
+ Object.defineProperty(ClassMap.prototype, "data", {
2971
+ get: function () {
2972
+ return this.scope.data;
2973
+ },
2974
+ enumerable: false,
2975
+ configurable: true
2976
+ });
2977
+ return ClassMap;
2978
+ }();
2979
+
2980
+ exports.ClassMap = ClassMap;
2981
+ },{}],"../node_modules/@stimulus/core/dist/string_helpers.js":[function(require,module,exports) {
2982
+ "use strict";
2983
+
2984
+ Object.defineProperty(exports, "__esModule", {
2985
+ value: true
2986
+ });
2987
+ exports.camelize = camelize;
2988
+ exports.capitalize = capitalize;
2989
+ exports.dasherize = dasherize;
2990
+
2991
+ function camelize(value) {
2992
+ return value.replace(/(?:[_-])([a-z0-9])/g, function (_, char) {
2993
+ return char.toUpperCase();
2994
+ });
2995
+ }
2996
+
2997
+ function capitalize(value) {
2998
+ return value.charAt(0).toUpperCase() + value.slice(1);
2999
+ }
3000
+
3001
+ function dasherize(value) {
3002
+ return value.replace(/([A-Z])/g, function (_, char) {
3003
+ return "-" + char.toLowerCase();
3004
+ });
3005
+ }
3006
+ },{}],"../node_modules/@stimulus/core/dist/data_map.js":[function(require,module,exports) {
2512
3007
  "use strict";
2513
3008
 
2514
3009
  Object.defineProperty(exports, "__esModule", {
@@ -2516,6 +3011,8 @@ Object.defineProperty(exports, "__esModule", {
2516
3011
  });
2517
3012
  exports.DataMap = void 0;
2518
3013
 
3014
+ var _string_helpers = require("./string_helpers");
3015
+
2519
3016
  var DataMap =
2520
3017
  /** @class */
2521
3018
  function () {
@@ -2527,58 +3024,86 @@ function () {
2527
3024
  get: function () {
2528
3025
  return this.scope.element;
2529
3026
  },
2530
- enumerable: true,
3027
+ enumerable: false,
2531
3028
  configurable: true
2532
3029
  });
2533
3030
  Object.defineProperty(DataMap.prototype, "identifier", {
2534
3031
  get: function () {
2535
3032
  return this.scope.identifier;
2536
3033
  },
2537
- enumerable: true,
3034
+ enumerable: false,
2538
3035
  configurable: true
2539
3036
  });
2540
3037
 
2541
3038
  DataMap.prototype.get = function (key) {
2542
- key = this.getFormattedKey(key);
2543
- return this.element.getAttribute(key);
3039
+ var name = this.getAttributeNameForKey(key);
3040
+ return this.element.getAttribute(name);
2544
3041
  };
2545
3042
 
2546
3043
  DataMap.prototype.set = function (key, value) {
2547
- key = this.getFormattedKey(key);
2548
- this.element.setAttribute(key, value);
3044
+ var name = this.getAttributeNameForKey(key);
3045
+ this.element.setAttribute(name, value);
2549
3046
  return this.get(key);
2550
3047
  };
2551
3048
 
2552
3049
  DataMap.prototype.has = function (key) {
2553
- key = this.getFormattedKey(key);
2554
- return this.element.hasAttribute(key);
3050
+ var name = this.getAttributeNameForKey(key);
3051
+ return this.element.hasAttribute(name);
2555
3052
  };
2556
3053
 
2557
3054
  DataMap.prototype.delete = function (key) {
2558
3055
  if (this.has(key)) {
2559
- key = this.getFormattedKey(key);
2560
- this.element.removeAttribute(key);
3056
+ var name_1 = this.getAttributeNameForKey(key);
3057
+ this.element.removeAttribute(name_1);
2561
3058
  return true;
2562
3059
  } else {
2563
3060
  return false;
2564
3061
  }
2565
3062
  };
2566
3063
 
2567
- DataMap.prototype.getFormattedKey = function (key) {
2568
- return "data-" + this.identifier + "-" + dasherize(key);
3064
+ DataMap.prototype.getAttributeNameForKey = function (key) {
3065
+ return "data-" + this.identifier + "-" + (0, _string_helpers.dasherize)(key);
2569
3066
  };
2570
3067
 
2571
3068
  return DataMap;
2572
3069
  }();
2573
3070
 
2574
3071
  exports.DataMap = DataMap;
3072
+ },{"./string_helpers":"../node_modules/@stimulus/core/dist/string_helpers.js"}],"../node_modules/@stimulus/core/dist/guide.js":[function(require,module,exports) {
3073
+ "use strict";
2575
3074
 
2576
- function dasherize(value) {
2577
- return value.replace(/([A-Z])/g, function (_, char) {
2578
- return "-" + char.toLowerCase();
2579
- });
2580
- }
2581
- },{}],"../node_modules/@stimulus/core/dist/src/selectors.js":[function(require,module,exports) {
3075
+ Object.defineProperty(exports, "__esModule", {
3076
+ value: true
3077
+ });
3078
+ exports.Guide = void 0;
3079
+
3080
+ var Guide =
3081
+ /** @class */
3082
+ function () {
3083
+ function Guide(logger) {
3084
+ this.warnedKeysByObject = new WeakMap();
3085
+ this.logger = logger;
3086
+ }
3087
+
3088
+ Guide.prototype.warn = function (object, key, message) {
3089
+ var warnedKeys = this.warnedKeysByObject.get(object);
3090
+
3091
+ if (!warnedKeys) {
3092
+ warnedKeys = new Set();
3093
+ this.warnedKeysByObject.set(object, warnedKeys);
3094
+ }
3095
+
3096
+ if (!warnedKeys.has(key)) {
3097
+ warnedKeys.add(key);
3098
+ this.logger.warn(message, object);
3099
+ }
3100
+ };
3101
+
3102
+ return Guide;
3103
+ }();
3104
+
3105
+ exports.Guide = Guide;
3106
+ },{}],"../node_modules/@stimulus/core/dist/selectors.js":[function(require,module,exports) {
2582
3107
  "use strict";
2583
3108
 
2584
3109
  Object.defineProperty(exports, "__esModule", {
@@ -2590,7 +3115,7 @@ exports.attributeValueContainsToken = attributeValueContainsToken;
2590
3115
  function attributeValueContainsToken(attributeName, token) {
2591
3116
  return "[" + attributeName + "~=\"" + token + "\"]";
2592
3117
  }
2593
- },{}],"../node_modules/@stimulus/core/dist/src/target_set.js":[function(require,module,exports) {
3118
+ },{}],"../node_modules/@stimulus/core/dist/target_set.js":[function(require,module,exports) {
2594
3119
  "use strict";
2595
3120
 
2596
3121
  Object.defineProperty(exports, "__esModule", {
@@ -2600,6 +3125,14 @@ exports.TargetSet = void 0;
2600
3125
 
2601
3126
  var _selectors = require("./selectors");
2602
3127
 
3128
+ var __spreadArrays = void 0 && (void 0).__spreadArrays || function () {
3129
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
3130
+
3131
+ for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j];
3132
+
3133
+ return r;
3134
+ };
3135
+
2603
3136
  var TargetSet =
2604
3137
  /** @class */
2605
3138
  function () {
@@ -2611,21 +3144,21 @@ function () {
2611
3144
  get: function () {
2612
3145
  return this.scope.element;
2613
3146
  },
2614
- enumerable: true,
3147
+ enumerable: false,
2615
3148
  configurable: true
2616
3149
  });
2617
3150
  Object.defineProperty(TargetSet.prototype, "identifier", {
2618
3151
  get: function () {
2619
3152
  return this.scope.identifier;
2620
3153
  },
2621
- enumerable: true,
3154
+ enumerable: false,
2622
3155
  configurable: true
2623
3156
  });
2624
3157
  Object.defineProperty(TargetSet.prototype, "schema", {
2625
3158
  get: function () {
2626
3159
  return this.scope.schema;
2627
3160
  },
2628
- enumerable: true,
3161
+ enumerable: false,
2629
3162
  configurable: true
2630
3163
  });
2631
3164
 
@@ -2634,45 +3167,89 @@ function () {
2634
3167
  };
2635
3168
 
2636
3169
  TargetSet.prototype.find = function () {
3170
+ var _this = this;
3171
+
2637
3172
  var targetNames = [];
2638
3173
 
2639
3174
  for (var _i = 0; _i < arguments.length; _i++) {
2640
3175
  targetNames[_i] = arguments[_i];
2641
3176
  }
2642
3177
 
2643
- var selector = this.getSelectorForTargetNames(targetNames);
2644
- return this.scope.findElement(selector);
3178
+ return targetNames.reduce(function (target, targetName) {
3179
+ return target || _this.findTarget(targetName) || _this.findLegacyTarget(targetName);
3180
+ }, undefined);
2645
3181
  };
2646
3182
 
2647
3183
  TargetSet.prototype.findAll = function () {
3184
+ var _this = this;
3185
+
2648
3186
  var targetNames = [];
2649
3187
 
2650
3188
  for (var _i = 0; _i < arguments.length; _i++) {
2651
3189
  targetNames[_i] = arguments[_i];
2652
3190
  }
2653
3191
 
2654
- var selector = this.getSelectorForTargetNames(targetNames);
3192
+ return targetNames.reduce(function (targets, targetName) {
3193
+ return __spreadArrays(targets, _this.findAllTargets(targetName), _this.findAllLegacyTargets(targetName));
3194
+ }, []);
3195
+ };
3196
+
3197
+ TargetSet.prototype.findTarget = function (targetName) {
3198
+ var selector = this.getSelectorForTargetName(targetName);
3199
+ return this.scope.findElement(selector);
3200
+ };
3201
+
3202
+ TargetSet.prototype.findAllTargets = function (targetName) {
3203
+ var selector = this.getSelectorForTargetName(targetName);
2655
3204
  return this.scope.findAllElements(selector);
2656
3205
  };
2657
3206
 
2658
- TargetSet.prototype.getSelectorForTargetNames = function (targetNames) {
3207
+ TargetSet.prototype.getSelectorForTargetName = function (targetName) {
3208
+ var attributeName = "data-" + this.identifier + "-target";
3209
+ return (0, _selectors.attributeValueContainsToken)(attributeName, targetName);
3210
+ };
3211
+
3212
+ TargetSet.prototype.findLegacyTarget = function (targetName) {
3213
+ var selector = this.getLegacySelectorForTargetName(targetName);
3214
+ return this.deprecate(this.scope.findElement(selector), targetName);
3215
+ };
3216
+
3217
+ TargetSet.prototype.findAllLegacyTargets = function (targetName) {
2659
3218
  var _this = this;
2660
3219
 
2661
- return targetNames.map(function (targetName) {
2662
- return _this.getSelectorForTargetName(targetName);
2663
- }).join(", ");
3220
+ var selector = this.getLegacySelectorForTargetName(targetName);
3221
+ return this.scope.findAllElements(selector).map(function (element) {
3222
+ return _this.deprecate(element, targetName);
3223
+ });
2664
3224
  };
2665
3225
 
2666
- TargetSet.prototype.getSelectorForTargetName = function (targetName) {
3226
+ TargetSet.prototype.getLegacySelectorForTargetName = function (targetName) {
2667
3227
  var targetDescriptor = this.identifier + "." + targetName;
2668
3228
  return (0, _selectors.attributeValueContainsToken)(this.schema.targetAttribute, targetDescriptor);
2669
3229
  };
2670
3230
 
3231
+ TargetSet.prototype.deprecate = function (element, targetName) {
3232
+ if (element) {
3233
+ var identifier = this.identifier;
3234
+ var attributeName = this.schema.targetAttribute;
3235
+ this.guide.warn(element, "target:" + targetName, "Please replace " + attributeName + "=\"" + identifier + "." + targetName + "\" with data-" + identifier + "-target=\"" + targetName + "\". " + ("The " + attributeName + " attribute is deprecated and will be removed in a future version of Stimulus."));
3236
+ }
3237
+
3238
+ return element;
3239
+ };
3240
+
3241
+ Object.defineProperty(TargetSet.prototype, "guide", {
3242
+ get: function () {
3243
+ return this.scope.guide;
3244
+ },
3245
+ enumerable: false,
3246
+ configurable: true
3247
+ });
2671
3248
  return TargetSet;
2672
3249
  }();
2673
3250
 
2674
3251
  exports.TargetSet = TargetSet;
2675
- },{"./selectors":"../node_modules/@stimulus/core/dist/src/selectors.js"}],"../node_modules/@stimulus/core/dist/src/scope.js":[function(require,module,exports) {
3252
+ },{"./selectors":"../node_modules/@stimulus/core/dist/selectors.js"}],"../node_modules/@stimulus/core/dist/scope.js":[function(require,module,exports) {
2676
3253
  "use strict";
2677
3254
 
2678
3255
  Object.defineProperty(exports, "__esModule", {
@@ -2680,57 +3257,68 @@ Object.defineProperty(exports, "__esModule", {
2680
3257
  });
2681
3258
  exports.Scope = void 0;
2682
3259
 
3260
+ var _class_map = require("./class_map");
3261
+
2683
3262
  var _data_map = require("./data_map");
2684
3263
 
2685
- var _target_set = require("./target_set");
3264
+ var _guide = require("./guide");
2686
3265
 
2687
3266
  var _selectors = require("./selectors");
2688
3267
 
3268
+ var _target_set = require("./target_set");
3269
+
3270
+ var __spreadArrays = void 0 && (void 0).__spreadArrays || function () {
3271
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
3272
+
3273
+ for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j];
3274
+
3275
+ return r;
3276
+ };
3277
+
2689
3278
  var Scope =
2690
3279
  /** @class */
2691
3280
  function () {
2692
- function Scope(schema, identifier, element) {
2693
- this.schema = schema;
2694
- this.identifier = identifier;
2695
- this.element = element;
3281
+ function Scope(schema, element, identifier, logger) {
3282
+ var _this = this;
3283
+
2696
3284
  this.targets = new _target_set.TargetSet(this);
3285
+ this.classes = new _class_map.ClassMap(this);
2697
3286
  this.data = new _data_map.DataMap(this);
3287
+
3288
+ this.containsElement = function (element) {
3289
+ return element.closest(_this.controllerSelector) === _this.element;
3290
+ };
3291
+
3292
+ this.schema = schema;
3293
+ this.element = element;
3294
+ this.identifier = identifier;
3295
+ this.guide = new _guide.Guide(logger);
2698
3296
  }
2699
3297
 
2700
3298
  Scope.prototype.findElement = function (selector) {
2701
- return this.findAllElements(selector)[0];
3299
+ return this.element.matches(selector) ? this.element : this.queryElements(selector).find(this.containsElement);
2702
3300
  };
2703
3301
 
2704
3302
  Scope.prototype.findAllElements = function (selector) {
2705
- var head = this.element.matches(selector) ? [this.element] : [];
2706
- var tail = this.filterElements(Array.from(this.element.querySelectorAll(selector)));
2707
- return head.concat(tail);
2708
- };
2709
-
2710
- Scope.prototype.filterElements = function (elements) {
2711
- var _this = this;
2712
-
2713
- return elements.filter(function (element) {
2714
- return _this.containsElement(element);
2715
- });
3303
+ return __spreadArrays(this.element.matches(selector) ? [this.element] : [], this.queryElements(selector).filter(this.containsElement));
2716
3304
  };
2717
3305
 
2718
- Scope.prototype.containsElement = function (element) {
2719
- return element.closest(this.controllerSelector) === this.element;
3306
+ Scope.prototype.queryElements = function (selector) {
3307
+ return Array.from(this.element.querySelectorAll(selector));
2720
3308
  };
2721
3309
 
2722
3310
  Object.defineProperty(Scope.prototype, "controllerSelector", {
2723
3311
  get: function () {
2724
3312
  return (0, _selectors.attributeValueContainsToken)(this.schema.controllerAttribute, this.identifier);
2725
3313
  },
2726
- enumerable: true,
3314
+ enumerable: false,
2727
3315
  configurable: true
2728
3316
  });
2729
3317
  return Scope;
2730
3318
  }();
2731
3319
 
2732
3320
  exports.Scope = Scope;
2733
- },{"./data_map":"../node_modules/@stimulus/core/dist/src/data_map.js","./target_set":"../node_modules/@stimulus/core/dist/src/target_set.js","./selectors":"../node_modules/@stimulus/core/dist/src/selectors.js"}],"../node_modules/@stimulus/core/dist/src/scope_observer.js":[function(require,module,exports) {
3321
+ },{"./class_map":"../node_modules/@stimulus/core/dist/class_map.js","./data_map":"../node_modules/@stimulus/core/dist/data_map.js","./guide":"../node_modules/@stimulus/core/dist/guide.js","./selectors":"../node_modules/@stimulus/core/dist/selectors.js","./target_set":"../node_modules/@stimulus/core/dist/target_set.js"}],"../node_modules/@stimulus/core/dist/scope_observer.js":[function(require,module,exports) {
2734
3322
  "use strict";
2735
3323
 
2736
3324
  Object.defineProperty(exports, "__esModule", {
@@ -2738,8 +3326,6 @@ Object.defineProperty(exports, "__esModule", {
2738
3326
  });
2739
3327
  exports.ScopeObserver = void 0;
2740
3328
 
2741
- var _scope = require("./scope");
2742
-
2743
3329
  var _mutationObservers = require("@stimulus/mutation-observers");
2744
3330
 
2745
3331
  var ScopeObserver =
@@ -2766,7 +3352,7 @@ function () {
2766
3352
  get: function () {
2767
3353
  return this.schema.controllerAttribute;
2768
3354
  },
2769
- enumerable: true,
3355
+ enumerable: false,
2770
3356
  configurable: true
2771
3357
  }); // Value observer delegate
2772
3358
 
@@ -2779,7 +3365,7 @@ function () {
2779
3365
  var scope = scopesByIdentifier.get(identifier);
2780
3366
 
2781
3367
  if (!scope) {
2782
- scope = new _scope.Scope(this.schema, identifier, element);
3368
+ scope = this.delegate.createScopeForElementAndIdentifier(element, identifier);
2783
3369
  scopesByIdentifier.set(identifier, scope);
2784
3370
  }
2785
3371
 
@@ -2826,7 +3412,7 @@ function () {
2826
3412
  }();
2827
3413
 
2828
3414
  exports.ScopeObserver = ScopeObserver;
2829
- },{"./scope":"../node_modules/@stimulus/core/dist/src/scope.js","@stimulus/mutation-observers":"../node_modules/@stimulus/mutation-observers/dist/index.js"}],"../node_modules/@stimulus/core/dist/src/router.js":[function(require,module,exports) {
3415
+ },{"@stimulus/mutation-observers":"../node_modules/@stimulus/mutation-observers/dist/index.js"}],"../node_modules/@stimulus/core/dist/router.js":[function(require,module,exports) {
2830
3416
  "use strict";
2831
3417
 
2832
3418
  Object.defineProperty(exports, "__esModule", {
@@ -2838,6 +3424,8 @@ var _module = require("./module");
2838
3424
 
2839
3425
  var _multimap = require("@stimulus/multimap");
2840
3426
 
3427
+ var _scope = require("./scope");
3428
+
2841
3429
  var _scope_observer = require("./scope_observer");
2842
3430
 
2843
3431
  var Router =
@@ -2854,28 +3442,35 @@ function () {
2854
3442
  get: function () {
2855
3443
  return this.application.element;
2856
3444
  },
2857
- enumerable: true,
3445
+ enumerable: false,
2858
3446
  configurable: true
2859
3447
  });
2860
3448
  Object.defineProperty(Router.prototype, "schema", {
2861
3449
  get: function () {
2862
3450
  return this.application.schema;
2863
3451
  },
2864
- enumerable: true,
3452
+ enumerable: false,
3453
+ configurable: true
3454
+ });
3455
+ Object.defineProperty(Router.prototype, "logger", {
3456
+ get: function () {
3457
+ return this.application.logger;
3458
+ },
3459
+ enumerable: false,
2865
3460
  configurable: true
2866
3461
  });
2867
3462
  Object.defineProperty(Router.prototype, "controllerAttribute", {
2868
3463
  get: function () {
2869
3464
  return this.schema.controllerAttribute;
2870
3465
  },
2871
- enumerable: true,
3466
+ enumerable: false,
2872
3467
  configurable: true
2873
3468
  });
2874
3469
  Object.defineProperty(Router.prototype, "modules", {
2875
3470
  get: function () {
2876
3471
  return Array.from(this.modulesByIdentifier.values());
2877
3472
  },
2878
- enumerable: true,
3473
+ enumerable: false,
2879
3474
  configurable: true
2880
3475
  });
2881
3476
  Object.defineProperty(Router.prototype, "contexts", {
@@ -2884,7 +3479,7 @@ function () {
2884
3479
  return contexts.concat(module.contexts);
2885
3480
  }, []);
2886
3481
  },
2887
- enumerable: true,
3482
+ enumerable: false,
2888
3483
  configurable: true
2889
3484
  });
2890
3485
 
@@ -2930,6 +3525,12 @@ function () {
2930
3525
  /** @hidden */
2931
3526
 
2932
3527
 
3528
+ Router.prototype.createScopeForElementAndIdentifier = function (element, identifier) {
3529
+ return new _scope.Scope(this.schema, element, identifier, this.logger);
3530
+ };
3531
+ /** @hidden */
3532
+
3533
+
2933
3534
  Router.prototype.scopeConnected = function (scope) {
2934
3535
  this.scopesByIdentifier.add(scope.identifier, scope);
2935
3536
  var module = this.modulesByIdentifier.get(scope.identifier);
@@ -2971,7 +3572,7 @@ function () {
2971
3572
  }();
2972
3573
 
2973
3574
  exports.Router = Router;
2974
- },{"./module":"../node_modules/@stimulus/core/dist/src/module.js","@stimulus/multimap":"../node_modules/@stimulus/multimap/dist/index.js","./scope_observer":"../node_modules/@stimulus/core/dist/src/scope_observer.js"}],"../node_modules/@stimulus/core/dist/src/schema.js":[function(require,module,exports) {
3575
+ },{"./module":"../node_modules/@stimulus/core/dist/module.js","@stimulus/multimap":"../node_modules/@stimulus/multimap/dist/index.js","./scope":"../node_modules/@stimulus/core/dist/scope.js","./scope_observer":"../node_modules/@stimulus/core/dist/scope_observer.js"}],"../node_modules/@stimulus/core/dist/schema.js":[function(require,module,exports) {
2975
3576
  "use strict";
2976
3577
 
2977
3578
  Object.defineProperty(exports, "__esModule", {
@@ -2984,7 +3585,7 @@ var defaultSchema = {
2984
3585
  targetAttribute: "data-target"
2985
3586
  };
2986
3587
  exports.defaultSchema = defaultSchema;
2987
- },{}],"../node_modules/@stimulus/core/dist/src/application.js":[function(require,module,exports) {
3588
+ },{}],"../node_modules/@stimulus/core/dist/application.js":[function(require,module,exports) {
2988
3589
  "use strict";
2989
3590
 
2990
3591
  Object.defineProperty(exports, "__esModule", {
@@ -2999,6 +3600,12 @@ var _router = require("./router");
2999
3600
  var _schema = require("./schema");
3000
3601
 
3001
3602
  var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
3603
+ function adopt(value) {
3604
+ return value instanceof P ? value : new P(function (resolve) {
3605
+ resolve(value);
3606
+ });
3607
+ }
3608
+
3002
3609
  return new (P || (P = Promise))(function (resolve, reject) {
3003
3610
  function fulfilled(value) {
3004
3611
  try {
@@ -3017,9 +3624,7 @@ var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P
3017
3624
  }
3018
3625
 
3019
3626
  function step(result) {
3020
- result.done ? resolve(result.value) : new P(function (resolve) {
3021
- resolve(result.value);
3022
- }).then(fulfilled, rejected);
3627
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
3023
3628
  }
3024
3629
 
3025
3630
  step((generator = generator.apply(thisArg, _arguments || [])).next());
@@ -3058,8 +3663,8 @@ var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
3058
3663
  if (f) throw new TypeError("Generator is already executing.");
3059
3664
 
3060
3665
  while (_) try {
3061
- if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
3062
- if (y = 0, t) op = [0, t.value];
3666
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
3667
+ if (y = 0, t) op = [op[0] & 2, t.value];
3063
3668
 
3064
3669
  switch (op[0]) {
3065
3670
  case 0:
@@ -3135,6 +3740,14 @@ var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
3135
3740
  }
3136
3741
  };
3137
3742
 
3743
+ var __spreadArrays = void 0 && (void 0).__spreadArrays || function () {
3744
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
3745
+
3746
+ for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j];
3747
+
3748
+ return r;
3749
+ };
3750
+
3138
3751
  var Application =
3139
3752
  /** @class */
3140
3753
  function () {
@@ -3147,6 +3760,7 @@ function () {
3147
3760
  schema = _schema.defaultSchema;
3148
3761
  }
3149
3762
 
3763
+ this.logger = console;
3150
3764
  this.element = element;
3151
3765
  this.schema = schema;
3152
3766
  this.dispatcher = new _dispatcher.Dispatcher(this);
@@ -3171,8 +3785,8 @@ function () {
3171
3785
  case 1:
3172
3786
  _a.sent();
3173
3787
 
3174
- this.router.start();
3175
3788
  this.dispatcher.start();
3789
+ this.router.start();
3176
3790
  return [2
3177
3791
  /*return*/
3178
3792
  ];
@@ -3182,8 +3796,8 @@ function () {
3182
3796
  };
3183
3797
 
3184
3798
  Application.prototype.stop = function () {
3185
- this.router.stop();
3186
3799
  this.dispatcher.stop();
3800
+ this.router.stop();
3187
3801
  };
3188
3802
 
3189
3803
  Application.prototype.register = function (identifier, controllerConstructor) {
@@ -3202,7 +3816,7 @@ function () {
3202
3816
  rest[_i - 1] = arguments[_i];
3203
3817
  }
3204
3818
 
3205
- var definitions = Array.isArray(head) ? head : [head].concat(rest);
3819
+ var definitions = Array.isArray(head) ? head : __spreadArrays([head], rest);
3206
3820
  definitions.forEach(function (definition) {
3207
3821
  return _this.router.loadDefinition(definition);
3208
3822
  });
@@ -3217,7 +3831,7 @@ function () {
3217
3831
  rest[_i - 1] = arguments[_i];
3218
3832
  }
3219
3833
 
3220
- var identifiers = Array.isArray(head) ? head : [head].concat(rest);
3834
+ var identifiers = Array.isArray(head) ? head : __spreadArrays([head], rest);
3221
3835
  identifiers.forEach(function (identifier) {
3222
3836
  return _this.router.unloadIdentifier(identifier);
3223
3837
  });
@@ -3230,7 +3844,7 @@ function () {
3230
3844
  return context.controller;
3231
3845
  });
3232
3846
  },
3233
- enumerable: true,
3847
+ enumerable: false,
3234
3848
  configurable: true
3235
3849
  });
3236
3850
 
@@ -3241,7 +3855,7 @@ function () {
3241
3855
 
3242
3856
 
3243
3857
  Application.prototype.handleError = function (error, message, detail) {
3244
- console.error("%s\n\n%o\n\n%o", message, error, detail);
3858
+ this.logger.error("%s\n\n%o\n\n%o", message, error, detail);
3245
3859
  };
3246
3860
 
3247
3861
  return Application;
@@ -3258,82 +3872,262 @@ function domReady() {
3258
3872
  }
3259
3873
  });
3260
3874
  }
3261
- },{"./dispatcher":"../node_modules/@stimulus/core/dist/src/dispatcher.js","./router":"../node_modules/@stimulus/core/dist/src/router.js","./schema":"../node_modules/@stimulus/core/dist/src/schema.js"}],"../node_modules/@stimulus/core/dist/src/target_properties.js":[function(require,module,exports) {
3875
+ },{"./dispatcher":"../node_modules/@stimulus/core/dist/dispatcher.js","./router":"../node_modules/@stimulus/core/dist/router.js","./schema":"../node_modules/@stimulus/core/dist/schema.js"}],"../node_modules/@stimulus/core/dist/class_properties.js":[function(require,module,exports) {
3262
3876
  "use strict";
3263
3877
 
3264
3878
  Object.defineProperty(exports, "__esModule", {
3265
3879
  value: true
3266
3880
  });
3267
- exports.defineTargetProperties = defineTargetProperties;
3881
+ exports.ClassPropertiesBlessing = ClassPropertiesBlessing;
3882
+
3883
+ var _inheritable_statics = require("./inheritable_statics");
3884
+
3885
+ var _string_helpers = require("./string_helpers");
3268
3886
 
3269
3887
  /** @hidden */
3270
- function defineTargetProperties(constructor) {
3271
- var prototype = constructor.prototype;
3272
- var targetNames = getTargetNamesForConstructor(constructor);
3273
- targetNames.forEach(function (name) {
3274
- var _a;
3888
+ function ClassPropertiesBlessing(constructor) {
3889
+ var classes = (0, _inheritable_statics.readInheritableStaticArrayValues)(constructor, "classes");
3890
+ return classes.reduce(function (properties, classDefinition) {
3891
+ return Object.assign(properties, propertiesForClassDefinition(classDefinition));
3892
+ }, {});
3893
+ }
3275
3894
 
3276
- return defineLinkedProperties(prototype, (_a = {}, _a[name + "Target"] = {
3277
- get: function () {
3278
- var target = this.targets.find(name);
3895
+ function propertiesForClassDefinition(key) {
3896
+ var _a;
3279
3897
 
3280
- if (target) {
3281
- return target;
3282
- } else {
3283
- throw new Error("Missing target element \"" + this.identifier + "." + name + "\"");
3284
- }
3898
+ var name = key + "Class";
3899
+ return _a = {}, _a[name] = {
3900
+ get: function () {
3901
+ var classes = this.classes;
3902
+
3903
+ if (classes.has(key)) {
3904
+ return classes.get(key);
3905
+ } else {
3906
+ var attribute = classes.getAttributeName(key);
3907
+ throw new Error("Missing attribute \"" + attribute + "\"");
3285
3908
  }
3286
- }, _a[name + "Targets"] = {
3287
- get: function () {
3288
- return this.targets.findAll(name);
3909
+ }
3910
+ }, _a["has" + (0, _string_helpers.capitalize)(name)] = {
3911
+ get: function () {
3912
+ return this.classes.has(key);
3913
+ }
3914
+ }, _a;
3915
+ }
3916
+ },{"./inheritable_statics":"../node_modules/@stimulus/core/dist/inheritable_statics.js","./string_helpers":"../node_modules/@stimulus/core/dist/string_helpers.js"}],"../node_modules/@stimulus/core/dist/target_properties.js":[function(require,module,exports) {
3917
+ "use strict";
3918
+
3919
+ Object.defineProperty(exports, "__esModule", {
3920
+ value: true
3921
+ });
3922
+ exports.TargetPropertiesBlessing = TargetPropertiesBlessing;
3923
+
3924
+ var _inheritable_statics = require("./inheritable_statics");
3925
+
3926
+ var _string_helpers = require("./string_helpers");
3927
+
3928
+ /** @hidden */
3929
+ function TargetPropertiesBlessing(constructor) {
3930
+ var targets = (0, _inheritable_statics.readInheritableStaticArrayValues)(constructor, "targets");
3931
+ return targets.reduce(function (properties, targetDefinition) {
3932
+ return Object.assign(properties, propertiesForTargetDefinition(targetDefinition));
3933
+ }, {});
3934
+ }
3935
+
3936
+ function propertiesForTargetDefinition(name) {
3937
+ var _a;
3938
+
3939
+ return _a = {}, _a[name + "Target"] = {
3940
+ get: function () {
3941
+ var target = this.targets.find(name);
3942
+
3943
+ if (target) {
3944
+ return target;
3945
+ } else {
3946
+ throw new Error("Missing target element \"" + this.identifier + "." + name + "\"");
3289
3947
  }
3290
- }, _a["has" + capitalize(name) + "Target"] = {
3948
+ }
3949
+ }, _a[name + "Targets"] = {
3950
+ get: function () {
3951
+ return this.targets.findAll(name);
3952
+ }
3953
+ }, _a["has" + (0, _string_helpers.capitalize)(name) + "Target"] = {
3954
+ get: function () {
3955
+ return this.targets.has(name);
3956
+ }
3957
+ }, _a;
3958
+ }
3959
+ },{"./inheritable_statics":"../node_modules/@stimulus/core/dist/inheritable_statics.js","./string_helpers":"../node_modules/@stimulus/core/dist/string_helpers.js"}],"../node_modules/@stimulus/core/dist/value_properties.js":[function(require,module,exports) {
3960
+ "use strict";
3961
+
3962
+ Object.defineProperty(exports, "__esModule", {
3963
+ value: true
3964
+ });
3965
+ exports.ValuePropertiesBlessing = ValuePropertiesBlessing;
3966
+ exports.propertiesForValueDefinitionPair = propertiesForValueDefinitionPair;
3967
+
3968
+ var _inheritable_statics = require("./inheritable_statics");
3969
+
3970
+ var _string_helpers = require("./string_helpers");
3971
+
3972
+ /** @hidden */
3973
+ function ValuePropertiesBlessing(constructor) {
3974
+ var valueDefinitionPairs = (0, _inheritable_statics.readInheritableStaticObjectPairs)(constructor, "values");
3975
+ var propertyDescriptorMap = {
3976
+ valueDescriptorMap: {
3291
3977
  get: function () {
3292
- return this.targets.has(name);
3978
+ var _this = this;
3979
+
3980
+ return valueDefinitionPairs.reduce(function (result, valueDefinitionPair) {
3981
+ var _a;
3982
+
3983
+ var valueDescriptor = parseValueDefinitionPair(valueDefinitionPair);
3984
+
3985
+ var attributeName = _this.data.getAttributeNameForKey(valueDescriptor.key);
3986
+
3987
+ return Object.assign(result, (_a = {}, _a[attributeName] = valueDescriptor, _a));
3988
+ }, {});
3293
3989
  }
3294
- }, _a));
3295
- });
3990
+ }
3991
+ };
3992
+ return valueDefinitionPairs.reduce(function (properties, valueDefinitionPair) {
3993
+ return Object.assign(properties, propertiesForValueDefinitionPair(valueDefinitionPair));
3994
+ }, propertyDescriptorMap);
3296
3995
  }
3996
+ /** @hidden */
3297
3997
 
3298
- function getTargetNamesForConstructor(constructor) {
3299
- var ancestors = getAncestorsForConstructor(constructor);
3300
- return Array.from(ancestors.reduce(function (targetNames, constructor) {
3301
- getOwnTargetNamesForConstructor(constructor).forEach(function (name) {
3302
- return targetNames.add(name);
3303
- });
3304
- return targetNames;
3305
- }, new Set()));
3998
+
3999
+ function propertiesForValueDefinitionPair(valueDefinitionPair) {
4000
+ var _a;
4001
+
4002
+ var definition = parseValueDefinitionPair(valueDefinitionPair);
4003
+ var type = definition.type,
4004
+ key = definition.key,
4005
+ name = definition.name;
4006
+ var read = readers[type],
4007
+ write = writers[type] || writers.default;
4008
+ return _a = {}, _a[name] = {
4009
+ get: function () {
4010
+ var value = this.data.get(key);
4011
+
4012
+ if (value !== null) {
4013
+ return read(value);
4014
+ } else {
4015
+ return definition.defaultValue;
4016
+ }
4017
+ },
4018
+ set: function (value) {
4019
+ if (value === undefined) {
4020
+ this.data.delete(key);
4021
+ } else {
4022
+ this.data.set(key, write(value));
4023
+ }
4024
+ }
4025
+ }, _a["has" + (0, _string_helpers.capitalize)(name)] = {
4026
+ get: function () {
4027
+ return this.data.has(key);
4028
+ }
4029
+ }, _a;
3306
4030
  }
3307
4031
 
3308
- function getAncestorsForConstructor(constructor) {
3309
- var ancestors = [];
4032
+ function parseValueDefinitionPair(_a) {
4033
+ var token = _a[0],
4034
+ typeConstant = _a[1];
4035
+ var type = parseValueTypeConstant(typeConstant);
4036
+ return valueDescriptorForTokenAndType(token, type);
4037
+ }
3310
4038
 
3311
- while (constructor) {
3312
- ancestors.push(constructor);
3313
- constructor = Object.getPrototypeOf(constructor);
4039
+ function parseValueTypeConstant(typeConstant) {
4040
+ switch (typeConstant) {
4041
+ case Array:
4042
+ return "array";
4043
+
4044
+ case Boolean:
4045
+ return "boolean";
4046
+
4047
+ case Number:
4048
+ return "number";
4049
+
4050
+ case Object:
4051
+ return "object";
4052
+
4053
+ case String:
4054
+ return "string";
3314
4055
  }
3315
4056
 
3316
- return ancestors;
4057
+ throw new Error("Unknown value type constant \"" + typeConstant + "\"");
3317
4058
  }
3318
4059
 
3319
- function getOwnTargetNamesForConstructor(constructor) {
3320
- var definition = constructor["targets"];
3321
- return Array.isArray(definition) ? definition : [];
4060
+ function valueDescriptorForTokenAndType(token, type) {
4061
+ var key = (0, _string_helpers.dasherize)(token) + "-value";
4062
+ return {
4063
+ type: type,
4064
+ key: key,
4065
+ name: (0, _string_helpers.camelize)(key),
4066
+
4067
+ get defaultValue() {
4068
+ return defaultValuesByType[type];
4069
+ }
4070
+
4071
+ };
3322
4072
  }
3323
4073
 
3324
- function defineLinkedProperties(object, properties) {
3325
- Object.keys(properties).forEach(function (name) {
3326
- if (!(name in object)) {
3327
- var descriptor = properties[name];
3328
- Object.defineProperty(object, name, descriptor);
4074
+ var defaultValuesByType = {
4075
+ get array() {
4076
+ return [];
4077
+ },
4078
+
4079
+ boolean: false,
4080
+ number: 0,
4081
+
4082
+ get object() {
4083
+ return {};
4084
+ },
4085
+
4086
+ string: ""
4087
+ };
4088
+ var readers = {
4089
+ array: function (value) {
4090
+ var array = JSON.parse(value);
4091
+
4092
+ if (!Array.isArray(array)) {
4093
+ throw new TypeError("Expected array");
3329
4094
  }
3330
- });
4095
+
4096
+ return array;
4097
+ },
4098
+ boolean: function (value) {
4099
+ return !(value == "0" || value == "false");
4100
+ },
4101
+ number: function (value) {
4102
+ return parseFloat(value);
4103
+ },
4104
+ object: function (value) {
4105
+ var object = JSON.parse(value);
4106
+
4107
+ if (object === null || typeof object != "object" || Array.isArray(object)) {
4108
+ throw new TypeError("Expected object");
4109
+ }
4110
+
4111
+ return object;
4112
+ },
4113
+ string: function (value) {
4114
+ return value;
4115
+ }
4116
+ };
4117
+ var writers = {
4118
+ default: writeString,
4119
+ array: writeJSON,
4120
+ object: writeJSON
4121
+ };
4122
+
4123
+ function writeJSON(value) {
4124
+ return JSON.stringify(value);
3331
4125
  }
3332
4126
 
3333
- function capitalize(name) {
3334
- return name.charAt(0).toUpperCase() + name.slice(1);
4127
+ function writeString(value) {
4128
+ return "" + value;
3335
4129
  }
3336
- },{}],"../node_modules/@stimulus/core/dist/src/controller.js":[function(require,module,exports) {
4130
+ },{"./inheritable_statics":"../node_modules/@stimulus/core/dist/inheritable_statics.js","./string_helpers":"../node_modules/@stimulus/core/dist/string_helpers.js"}],"../node_modules/@stimulus/core/dist/controller.js":[function(require,module,exports) {
3337
4131
  "use strict";
3338
4132
 
3339
4133
  Object.defineProperty(exports, "__esModule", {
@@ -3341,8 +4135,12 @@ Object.defineProperty(exports, "__esModule", {
3341
4135
  });
3342
4136
  exports.Controller = void 0;
3343
4137
 
4138
+ var _class_properties = require("./class_properties");
4139
+
3344
4140
  var _target_properties = require("./target_properties");
3345
4141
 
4142
+ var _value_properties = require("./value_properties");
4143
+
3346
4144
  var Controller =
3347
4145
  /** @class */
3348
4146
  function () {
@@ -3350,50 +4148,53 @@ function () {
3350
4148
  this.context = context;
3351
4149
  }
3352
4150
 
3353
- Controller.bless = function () {
3354
- (0, _target_properties.defineTargetProperties)(this);
3355
- };
3356
-
3357
4151
  Object.defineProperty(Controller.prototype, "application", {
3358
4152
  get: function () {
3359
4153
  return this.context.application;
3360
4154
  },
3361
- enumerable: true,
4155
+ enumerable: false,
3362
4156
  configurable: true
3363
4157
  });
3364
4158
  Object.defineProperty(Controller.prototype, "scope", {
3365
4159
  get: function () {
3366
4160
  return this.context.scope;
3367
4161
  },
3368
- enumerable: true,
4162
+ enumerable: false,
3369
4163
  configurable: true
3370
4164
  });
3371
4165
  Object.defineProperty(Controller.prototype, "element", {
3372
4166
  get: function () {
3373
4167
  return this.scope.element;
3374
4168
  },
3375
- enumerable: true,
4169
+ enumerable: false,
3376
4170
  configurable: true
3377
4171
  });
3378
4172
  Object.defineProperty(Controller.prototype, "identifier", {
3379
4173
  get: function () {
3380
4174
  return this.scope.identifier;
3381
4175
  },
3382
- enumerable: true,
4176
+ enumerable: false,
3383
4177
  configurable: true
3384
4178
  });
3385
4179
  Object.defineProperty(Controller.prototype, "targets", {
3386
4180
  get: function () {
3387
4181
  return this.scope.targets;
3388
4182
  },
3389
- enumerable: true,
4183
+ enumerable: false,
4184
+ configurable: true
4185
+ });
4186
+ Object.defineProperty(Controller.prototype, "classes", {
4187
+ get: function () {
4188
+ return this.scope.classes;
4189
+ },
4190
+ enumerable: false,
3390
4191
  configurable: true
3391
4192
  });
3392
4193
  Object.defineProperty(Controller.prototype, "data", {
3393
4194
  get: function () {
3394
4195
  return this.scope.data;
3395
4196
  },
3396
- enumerable: true,
4197
+ enumerable: false,
3397
4198
  configurable: true
3398
4199
  });
3399
4200
 
@@ -3406,12 +4207,14 @@ function () {
3406
4207
  Controller.prototype.disconnect = function () {// Override in your subclass to respond when the controller is disconnected from the DOM
3407
4208
  };
3408
4209
 
4210
+ Controller.blessings = [_class_properties.ClassPropertiesBlessing, _target_properties.TargetPropertiesBlessing, _value_properties.ValuePropertiesBlessing];
3409
4211
  Controller.targets = [];
4212
+ Controller.values = {};
3410
4213
  return Controller;
3411
4214
  }();
3412
4215
 
3413
4216
  exports.Controller = Controller;
3414
- },{"./target_properties":"../node_modules/@stimulus/core/dist/src/target_properties.js"}],"../node_modules/@stimulus/core/dist/index.js":[function(require,module,exports) {
4217
+ },{"./class_properties":"../node_modules/@stimulus/core/dist/class_properties.js","./target_properties":"../node_modules/@stimulus/core/dist/target_properties.js","./value_properties":"../node_modules/@stimulus/core/dist/value_properties.js"}],"../node_modules/@stimulus/core/dist/index.js":[function(require,module,exports) {
3415
4218
  "use strict";
3416
4219
 
3417
4220
  Object.defineProperty(exports, "__esModule", {
@@ -3442,14 +4245,14 @@ Object.defineProperty(exports, "defaultSchema", {
3442
4245
  }
3443
4246
  });
3444
4247
 
3445
- var _application = require("./src/application");
4248
+ var _application = require("./application");
3446
4249
 
3447
- var _context = require("./src/context");
4250
+ var _context = require("./context");
3448
4251
 
3449
- var _controller = require("./src/controller");
4252
+ var _controller = require("./controller");
3450
4253
 
3451
- var _schema = require("./src/schema");
3452
- },{"./src/application":"../node_modules/@stimulus/core/dist/src/application.js","./src/context":"../node_modules/@stimulus/core/dist/src/context.js","./src/controller":"../node_modules/@stimulus/core/dist/src/controller.js","./src/schema":"../node_modules/@stimulus/core/dist/src/schema.js"}],"../node_modules/stimulus/index.js":[function(require,module,exports) {
4254
+ var _schema = require("./schema");
4255
+ },{"./application":"../node_modules/@stimulus/core/dist/application.js","./context":"../node_modules/@stimulus/core/dist/context.js","./controller":"../node_modules/@stimulus/core/dist/controller.js","./schema":"../node_modules/@stimulus/core/dist/schema.js"}],"../node_modules/stimulus/index.js":[function(require,module,exports) {
3453
4256
  "use strict";
3454
4257
 
3455
4258
  Object.defineProperty(exports, "__esModule", {
@@ -3460,6 +4263,7 @@ var _core = require("@stimulus/core");
3460
4263
 
3461
4264
  Object.keys(_core).forEach(function (key) {
3462
4265
  if (key === "default" || key === "__esModule") return;
4266
+ if (key in exports && exports[key] === _core[key]) return;
3463
4267
  Object.defineProperty(exports, key, {
3464
4268
  enumerable: true,
3465
4269
  get: function () {
@@ -3467,152 +4271,159 @@ Object.keys(_core).forEach(function (key) {
3467
4271
  }
3468
4272
  });
3469
4273
  });
3470
- },{"@stimulus/core":"../node_modules/@stimulus/core/dist/index.js"}],"javascripts/super/apply_template_controller.ts":[function(require,module,exports) {
4274
+ },{"@stimulus/core":"../node_modules/@stimulus/core/dist/index.js"}],"javascripts/super/apply_template_controller.js":[function(require,module,exports) {
3471
4275
  "use strict";
3472
4276
 
3473
- var __extends = this && this.__extends || function () {
3474
- var _extendStatics = function extendStatics(d, b) {
3475
- _extendStatics = Object.setPrototypeOf || {
3476
- __proto__: []
3477
- } instanceof Array && function (d, b) {
3478
- d.__proto__ = b;
3479
- } || function (d, b) {
3480
- for (var p in b) {
3481
- if (b.hasOwnProperty(p)) d[p] = b[p];
3482
- }
3483
- };
4277
+ Object.defineProperty(exports, "__esModule", {
4278
+ value: true
4279
+ });
4280
+ exports.default = void 0;
3484
4281
 
3485
- return _extendStatics(d, b);
3486
- };
4282
+ var _stimulus = require("stimulus");
3487
4283
 
3488
- return function (d, b) {
3489
- _extendStatics(d, b);
4284
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
3490
4285
 
3491
- function __() {
3492
- this.constructor = d;
3493
- }
4286
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3494
4287
 
3495
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
3496
- };
3497
- }();
4288
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
3498
4289
 
3499
- Object.defineProperty(exports, "__esModule", {
3500
- value: true
3501
- });
4290
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
3502
4291
 
3503
- var stimulus_1 = require("stimulus");
4292
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
3504
4293
 
3505
- var default_1 =
3506
- /** @class */
3507
- function (_super) {
3508
- __extends(default_1, _super);
4294
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
3509
4295
 
3510
- function default_1() {
3511
- return _super !== null && _super.apply(this, arguments) || this;
3512
- }
4296
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
4297
+
4298
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
4299
+
4300
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
4301
+
4302
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
4303
+
4304
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
4305
+
4306
+ var _default = /*#__PURE__*/function (_Controller) {
4307
+ _inherits(_default, _Controller);
4308
+
4309
+ var _super = _createSuper(_default);
3513
4310
 
3514
- default_1.prototype.call = function (event) {
3515
- event.preventDefault();
4311
+ function _default() {
4312
+ _classCallCheck(this, _default);
3516
4313
 
3517
- if (this.templateTarget) {
4314
+ return _super.apply(this, arguments);
4315
+ }
4316
+
4317
+ _createClass(_default, [{
4318
+ key: "call",
4319
+ value: function call(event) {
4320
+ event.preventDefault();
3518
4321
  var unixtime = new Date().getTime();
3519
4322
  var content = this.templateTarget.innerHTML.replace(/TEMPLATEINDEX/g, unixtime.toString());
3520
4323
  this.templateTarget.insertAdjacentHTML("beforebegin", content);
3521
4324
  }
3522
- };
4325
+ }], [{
4326
+ key: "targets",
4327
+ get: function get() {
4328
+ return ["template"];
4329
+ }
4330
+ }]);
3523
4331
 
3524
- default_1.targets = ["template"];
3525
- return default_1;
3526
- }(stimulus_1.Controller);
4332
+ return _default;
4333
+ }(_stimulus.Controller);
3527
4334
 
3528
- exports.default = default_1;
3529
- },{"stimulus":"../node_modules/stimulus/index.js"}],"javascripts/super/toggle_pending_destruction_controller.ts":[function(require,module,exports) {
4335
+ exports.default = _default;
4336
+ },{"stimulus":"../node_modules/stimulus/index.js"}],"javascripts/super/toggle_pending_destruction_controller.js":[function(require,module,exports) {
3530
4337
  "use strict";
3531
4338
 
3532
- var __extends = this && this.__extends || function () {
3533
- var _extendStatics = function extendStatics(d, b) {
3534
- _extendStatics = Object.setPrototypeOf || {
3535
- __proto__: []
3536
- } instanceof Array && function (d, b) {
3537
- d.__proto__ = b;
3538
- } || function (d, b) {
3539
- for (var p in b) {
3540
- if (b.hasOwnProperty(p)) d[p] = b[p];
3541
- }
3542
- };
4339
+ Object.defineProperty(exports, "__esModule", {
4340
+ value: true
4341
+ });
4342
+ exports.default = void 0;
3543
4343
 
3544
- return _extendStatics(d, b);
3545
- };
4344
+ var _stimulus = require("stimulus");
3546
4345
 
3547
- return function (d, b) {
3548
- _extendStatics(d, b);
4346
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
3549
4347
 
3550
- function __() {
3551
- this.constructor = d;
3552
- }
4348
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3553
4349
 
3554
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
3555
- };
3556
- }();
4350
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
3557
4351
 
3558
- Object.defineProperty(exports, "__esModule", {
3559
- value: true
3560
- });
4352
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
3561
4353
 
3562
- var stimulus_1 = require("stimulus");
4354
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
3563
4355
 
3564
- var default_1 =
3565
- /** @class */
3566
- function (_super) {
3567
- __extends(default_1, _super);
4356
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
4357
+
4358
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
4359
+
4360
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
4361
+
4362
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
4363
+
4364
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
4365
+
4366
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
3568
4367
 
3569
- function default_1() {
3570
- return _super !== null && _super.apply(this, arguments) || this;
4368
+ var _default = /*#__PURE__*/function (_Controller) {
4369
+ _inherits(_default, _Controller);
4370
+
4371
+ var _super = _createSuper(_default);
4372
+
4373
+ function _default() {
4374
+ _classCallCheck(this, _default);
4375
+
4376
+ return _super.apply(this, arguments);
3571
4377
  }
3572
4378
 
3573
- default_1.prototype.call = function (event) {
3574
- var target = event.target;
4379
+ _createClass(_default, [{
4380
+ key: "call",
4381
+ value: function call(event) {
4382
+ var target = event.target;
3575
4383
 
3576
- if (target) {
3577
- if (target.checked) {
3578
- this.element.classList.add("opacity-75", "bg-gray-100");
3579
- } else {
3580
- this.element.classList.remove("opacity-75", "bg-gray-100");
4384
+ if (target) {
4385
+ if (target.checked) {
4386
+ this.element.classList.add("opacity-75", "bg-gray-100");
4387
+ } else {
4388
+ this.element.classList.remove("opacity-75", "bg-gray-100");
4389
+ }
3581
4390
  }
3582
4391
  }
3583
- };
4392
+ }]);
3584
4393
 
3585
- return default_1;
3586
- }(stimulus_1.Controller);
4394
+ return _default;
4395
+ }(_stimulus.Controller);
3587
4396
 
3588
- exports.default = default_1;
3589
- },{"stimulus":"../node_modules/stimulus/index.js"}],"javascripts/super/application.ts":[function(require,module,exports) {
4397
+ exports.default = _default;
4398
+ },{"stimulus":"../node_modules/stimulus/index.js"}],"javascripts/super/application.js":[function(require,module,exports) {
3590
4399
  "use strict";
3591
4400
 
3592
- var __importDefault = this && this.__importDefault || function (mod) {
3593
- return mod && mod.__esModule ? mod : {
3594
- "default": mod
3595
- };
3596
- };
3597
-
3598
4401
  Object.defineProperty(exports, "__esModule", {
3599
4402
  value: true
3600
4403
  });
4404
+ Object.defineProperty(exports, "StimulusController", {
4405
+ enumerable: true,
4406
+ get: function () {
4407
+ return _stimulus.Controller;
4408
+ }
4409
+ });
4410
+ exports.StimulusApplication = void 0;
3601
4411
 
3602
- var ujs_1 = __importDefault(require("@rails/ujs"));
4412
+ var _ujs = _interopRequireDefault(require("@rails/ujs"));
3603
4413
 
3604
- var stimulus_1 = require("stimulus");
4414
+ var _stimulus = require("stimulus");
3605
4415
 
3606
- var apply_template_controller_1 = __importDefault(require("./apply_template_controller"));
4416
+ var _apply_template_controller = _interopRequireDefault(require("./apply_template_controller"));
3607
4417
 
3608
- var toggle_pending_destruction_controller_1 = __importDefault(require("./toggle_pending_destruction_controller"));
4418
+ var _toggle_pending_destruction_controller = _interopRequireDefault(require("./toggle_pending_destruction_controller"));
3609
4419
 
3610
- ujs_1.default.start();
3611
- var application = stimulus_1.Application.start();
3612
- application.register("apply-template", apply_template_controller_1.default);
3613
- application.register("toggle-pending-destruction", toggle_pending_destruction_controller_1.default);
3614
- exports.default = {
3615
- StimulusApplication: application,
3616
- StimulusController: stimulus_1.Controller
3617
- };
3618
- },{"@rails/ujs":"../node_modules/@rails/ujs/lib/assets/compiled/rails-ujs.js","stimulus":"../node_modules/stimulus/index.js","./apply_template_controller":"javascripts/super/apply_template_controller.ts","./toggle_pending_destruction_controller":"javascripts/super/toggle_pending_destruction_controller.ts"}]},{},["javascripts/super/application.ts"], "Super")
4420
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
4421
+
4422
+ _ujs.default.start();
4423
+
4424
+ var StimulusApplication = _stimulus.Application.start();
4425
+
4426
+ exports.StimulusApplication = StimulusApplication;
4427
+ StimulusApplication.register("apply-template", _apply_template_controller.default);
4428
+ StimulusApplication.register("toggle-pending-destruction", _toggle_pending_destruction_controller.default);
4429
+ },{"@rails/ujs":"../node_modules/@rails/ujs/lib/assets/compiled/rails-ujs.js","stimulus":"../node_modules/stimulus/index.js","./apply_template_controller":"javascripts/super/apply_template_controller.js","./toggle_pending_destruction_controller":"javascripts/super/toggle_pending_destruction_controller.js"}]},{},["javascripts/super/application.js"], "Super")