avo 3.0.1.beta19 → 3.0.1.beta21
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of avo might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/app/assets/builds/avo.base.css +8 -31
- data/app/assets/builds/avo.base.js +2 -1
- data/app/assets/builds/avo.base.js.map +2 -2
- data/app/components/avo/fields/common/badge_viewer_component.rb +1 -1
- data/app/components/avo/fields/common/files/list_viewer_component.rb +3 -3
- data/app/components/avo/fields/common/files/view_type/{grid_component.html.erb → grid_item_component.html.erb} +2 -2
- data/app/components/avo/fields/common/files/view_type/{grid_component.rb → grid_item_component.rb} +3 -2
- data/app/components/avo/fields/common/files/view_type/{list_component.rb → list_item_component.rb} +1 -1
- data/app/components/avo/fields/file_field/edit_component.html.erb +1 -1
- data/app/components/avo/fields/file_field/show_component.html.erb +1 -1
- data/app/components/avo/index/resource_table_component.rb +1 -4
- data/app/components/avo/modal_component.html.erb +2 -2
- data/app/components/avo/sidebar_profile_component.html.erb +1 -2
- data/app/components/avo/views/resource_index_component.rb +2 -1
- data/app/controllers/avo/actions_controller.rb +1 -1
- data/app/controllers/avo/application_controller.rb +6 -2
- data/app/controllers/avo/base_controller.rb +1 -0
- data/app/controllers/avo/search_controller.rb +12 -2
- data/app/javascript/js/controllers/search_controller.js +2 -0
- data/app/views/avo/actions/show.html.erb +1 -1
- data/app/views/avo/partials/_resource_search.html.erb +1 -0
- data/lib/avo/base_resource.rb +21 -3
- data/lib/avo/fields/has_base_field.rb +8 -1
- data/lib/avo/fields/has_one_field.rb +1 -1
- data/lib/avo/services/encryption_service.rb +8 -12
- data/lib/avo/version.rb +1 -1
- data/lib/avo/view_inquirer.rb +2 -2
- data/lib/avo.rb +2 -2
- data/public/avo-assets/avo.base.js +1 -1
- data/public/avo-assets/avo.base.js.map +2 -2
- metadata +6 -6
- /data/app/components/avo/fields/common/files/view_type/{list_component.html.erb → list_item_component.html.erb} +0 -0
@@ -17,7 +17,7 @@ class Avo::Fields::Common::BadgeViewerComponent < ViewComponent::Base
|
|
17
17
|
background = :info
|
18
18
|
|
19
19
|
@options.invert.each do |values, type|
|
20
|
-
if [values].flatten.map { |value| value }.include? @value
|
20
|
+
if [values].flatten.map { |value| value.to_s }.include? @value.to_s
|
21
21
|
background = type.to_sym
|
22
22
|
next
|
23
23
|
end
|
@@ -31,11 +31,11 @@ class Avo::Fields::Common::Files::ListViewerComponent < ViewComponent::Base
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def view_type_component(file)
|
34
|
-
component = "Avo::Fields::Common::Files::ViewType::#{view_type.to_s.capitalize}
|
35
|
-
component.new(field: field, resource: resource, file: file)
|
34
|
+
component = "Avo::Fields::Common::Files::ViewType::#{view_type.to_s.capitalize}ItemComponent".constantize
|
35
|
+
component.new(field: field, resource: resource, file: file, extra_classes: "aspect-video")
|
36
36
|
end
|
37
37
|
|
38
38
|
def view_type
|
39
|
-
(resource.params.dig(:view_type) || field.view_type).to_sym
|
39
|
+
@view_type ||= (resource.params.dig(:view_type) || field.view_type).to_sym
|
40
40
|
end
|
41
41
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
<div id="<%= dom_id file %>" class="relative min-h-full max-w-full flex-1 flex flex-col justify-between space-y-2">
|
2
2
|
<% if file.present? %>
|
3
|
-
<div class="flex
|
3
|
+
<div class="flex h-full">
|
4
4
|
<% if file.representable? && is_image? %>
|
5
|
-
<%= image_tag helpers.main_app.url_for(file), class:
|
5
|
+
<%= image_tag helpers.main_app.url_for(file), class: "rounded-lg max-w-full #{@extra_classes}" %>
|
6
6
|
<% elsif is_audio? %>
|
7
7
|
<%= audio_tag(helpers.main_app.url_for(file), controls: true, preload: false, class: 'w-full') %>
|
8
8
|
<% elsif is_video? %>
|
data/app/components/avo/fields/common/files/view_type/{grid_component.rb → grid_item_component.rb}
RENAMED
@@ -1,12 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
class Avo::Fields::Common::Files::ViewType::
|
3
|
+
class Avo::Fields::Common::Files::ViewType::GridItemComponent < ViewComponent::Base
|
4
4
|
attr_reader :field, :resource
|
5
5
|
|
6
|
-
def initialize(field:, resource:, file: nil)
|
6
|
+
def initialize(field:, resource:, file: nil, extra_classes: nil)
|
7
7
|
@file = file
|
8
8
|
@field = field
|
9
9
|
@resource = resource
|
10
|
+
@extra_classes = extra_classes
|
10
11
|
end
|
11
12
|
|
12
13
|
def id
|
data/app/components/avo/fields/common/files/view_type/{list_component.rb → list_item_component.rb}
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
class Avo::Fields::Common::Files::ViewType::
|
3
|
+
class Avo::Fields::Common::Files::ViewType::ListItemComponent < Avo::Fields::Common::Files::ViewType::GridItemComponent
|
4
4
|
def icon_for_file
|
5
5
|
if is_image?
|
6
6
|
"photo"
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<%= field_wrapper **field_wrapper_args do %>
|
2
2
|
<% if @field.value.present? %>
|
3
3
|
<div class="mb-2">
|
4
|
-
<%= render Avo::Fields::Common::Files::ViewType::
|
4
|
+
<%= render Avo::Fields::Common::Files::ViewType::GridItemComponent.new resource: @resource, field: @field %>
|
5
5
|
</div>
|
6
6
|
<% end %>
|
7
7
|
|
@@ -1,3 +1,3 @@
|
|
1
1
|
<%= field_wrapper **field_wrapper_args do %>
|
2
|
-
<%= render Avo::Fields::Common::Files::ViewType::
|
2
|
+
<%= render Avo::Fields::Common::Files::ViewType::GridItemComponent.new resource: @resource, field: @field %>
|
3
3
|
<% end %>
|
@@ -21,9 +21,6 @@ class Avo::Index::ResourceTableComponent < ViewComponent::Base
|
|
21
21
|
@query = @query.result
|
22
22
|
end
|
23
23
|
|
24
|
-
Avo::Services::EncryptionService.encrypt(
|
25
|
-
message: Marshal.dump(@query),
|
26
|
-
purpose: :select_all
|
27
|
-
)
|
24
|
+
Avo::Services::EncryptionService.encrypt(message: @query, purpose: :select_all, serializer: Marshal)
|
28
25
|
end
|
29
26
|
end
|
@@ -6,10 +6,10 @@
|
|
6
6
|
<div aria-expanded="true" role="dialog" aria-modal="true" class="modal-body rounded-lg inset-auto w-11/12 lg:w-1/2 sm:max-w-168 min-h-1/4 bg-white flex z-50 relative shadow-modal overflow-auto max-h-full">
|
7
7
|
<div class="flex-1 flex flex-col justify-between">
|
8
8
|
<div>
|
9
|
-
<div class="p-6 text-2xl tracking-normal font-semibold text-black">
|
9
|
+
<div class="p-6 pb-0 text-2xl tracking-normal font-semibold text-black">
|
10
10
|
<%= heading %>
|
11
11
|
</div>
|
12
|
-
<div class="
|
12
|
+
<div class="p-6 text-base text-gray-500">
|
13
13
|
<%= content %>
|
14
14
|
</div>
|
15
15
|
</div>
|
@@ -39,8 +39,7 @@
|
|
39
39
|
<% end %>
|
40
40
|
</div>
|
41
41
|
<% end %>
|
42
|
-
|
43
|
-
<%#= render Avo::ProfileItemComponent.new label: 'Profile', path: '/profile', icon: 'user-circle' %>
|
42
|
+
<%= render "avo/partials/profile_menu_extra" %>
|
44
43
|
<% if can_destroy_user? %>
|
45
44
|
<%= button_to helpers.main_app.send(destroy_user_session_path),
|
46
45
|
form: { "data-turbo" => "false" },
|
@@ -186,7 +186,8 @@ class Avo::Views::ResourceIndexComponent < Avo::ResourceComponent
|
|
186
186
|
association: "has_many",
|
187
187
|
association_id: @reflection.name,
|
188
188
|
class: reflection_model_class,
|
189
|
-
id: @parent_record.to_param
|
189
|
+
id: @parent_record.to_param,
|
190
|
+
view: @parent_resource.view
|
190
191
|
}
|
191
192
|
end
|
192
193
|
|
@@ -98,7 +98,7 @@ module Avo
|
|
98
98
|
def decrypted_query
|
99
99
|
return if (encrypted_query = action_params[:fields][:avo_selected_query]).blank?
|
100
100
|
|
101
|
-
|
101
|
+
Avo::Services::EncryptionService.decrypt(message: encrypted_query, purpose: :select_all, serializer: Marshal)
|
102
102
|
end
|
103
103
|
|
104
104
|
def decrypted_arguments
|
@@ -116,13 +116,17 @@ module Avo
|
|
116
116
|
def set_resource
|
117
117
|
raise ActionController::RoutingError.new "No route matches" if resource.nil?
|
118
118
|
|
119
|
-
@resource = resource.new(view: action_name.to_s, user: _current_user, params: params)
|
119
|
+
@resource = resource.new(view: params[:view] || action_name.to_s, user: _current_user, params: params)
|
120
120
|
|
121
121
|
set_authorization
|
122
122
|
end
|
123
123
|
|
124
|
+
def detect_fields
|
125
|
+
@resource.detect_fields
|
126
|
+
end
|
127
|
+
|
124
128
|
def set_related_resource
|
125
|
-
@related_resource = related_resource.new(params: params, view: action_name.to_sym, user: _current_user, record: @related_record)
|
129
|
+
@related_resource = related_resource.new(params: params, view: action_name.to_sym, user: _current_user, record: @related_record).detect_fields
|
126
130
|
end
|
127
131
|
|
128
132
|
def set_record
|
@@ -8,6 +8,7 @@ module Avo
|
|
8
8
|
before_action :set_resource
|
9
9
|
before_action :set_applied_filters, only: :index
|
10
10
|
before_action :set_record, only: [:show, :edit, :destroy, :update, :preview]
|
11
|
+
before_action :detect_fields
|
11
12
|
before_action :set_record_to_fill
|
12
13
|
before_action :set_edit_title_and_breadcrumbs, only: [:edit, :update]
|
13
14
|
before_action :fill_record, only: [:create, :update]
|
@@ -156,8 +156,18 @@ module Avo
|
|
156
156
|
end
|
157
157
|
|
158
158
|
def fetch_field
|
159
|
-
|
160
|
-
|
159
|
+
return if params[:via_association_id].nil?
|
160
|
+
|
161
|
+
reflection_resource = Avo.resource_manager.get_resource_by_model_class(params[:via_reflection_class]).new(
|
162
|
+
view: Avo::ViewInquirer.new(params[:via_reflection_view]),
|
163
|
+
record: parent,
|
164
|
+
params: params,
|
165
|
+
user: current_user
|
166
|
+
)
|
167
|
+
|
168
|
+
reflection_resource.detect_fields.get_field_definitions.find do |field|
|
169
|
+
field.id.to_s == params[:via_association_id]
|
170
|
+
end
|
161
171
|
end
|
162
172
|
|
163
173
|
def fetch_parent
|
@@ -279,6 +279,8 @@ export default class extends Controller {
|
|
279
279
|
via_reflection_class: this.dataset.viaReflectionClass,
|
280
280
|
// eslint-disable-next-line camelcase
|
281
281
|
via_reflection_id: this.dataset.viaReflectionId,
|
282
|
+
// eslint-disable-next-line camelcase
|
283
|
+
via_reflection_view: this.dataset.viaReflectionView,
|
282
284
|
}
|
283
285
|
|
284
286
|
return params
|
@@ -25,7 +25,7 @@
|
|
25
25
|
<%= form.hidden_field :avo_selected_query, 'data-action-target': 'selectedAllQuery' %>
|
26
26
|
<%= form.hidden_field :arguments, value: params[:arguments] %>
|
27
27
|
<% if @action.get_fields.present? %>
|
28
|
-
<div class="
|
28
|
+
<div class="mt-4 -mx-6">
|
29
29
|
<% @action.get_fields.each_with_index do |field, index| %>
|
30
30
|
<%= render field
|
31
31
|
.hydrate(resource: @resource, record: @resource.record, user: @resource.user, view: @view)
|
@@ -8,6 +8,7 @@
|
|
8
8
|
data-via-association-id="<%= via_reflection[:association_id] %>"
|
9
9
|
data-via-reflection-class="<%= via_reflection[:class] %>"
|
10
10
|
data-via-reflection-id="<%= via_reflection[:id] %>"
|
11
|
+
data-via-reflection-view="<%= via_reflection[:view] %>"
|
11
12
|
<% end %>
|
12
13
|
>
|
13
14
|
</div>
|
data/lib/avo/base_resource.rb
CHANGED
@@ -244,8 +244,6 @@ module Avo
|
|
244
244
|
hydrate_model_with_default_values if @view&.new?
|
245
245
|
end
|
246
246
|
|
247
|
-
detect_fields
|
248
|
-
|
249
247
|
unless self.class.model_class.present?
|
250
248
|
if model_class.present? && model_class.respond_to?(:base_class)
|
251
249
|
self.class.model_class = model_class.base_class
|
@@ -260,12 +258,32 @@ module Avo
|
|
260
258
|
if temporary_items.present?
|
261
259
|
instance_eval(&temporary_items)
|
262
260
|
else
|
263
|
-
|
261
|
+
fetch_fields
|
264
262
|
end
|
265
263
|
|
266
264
|
self
|
267
265
|
end
|
268
266
|
|
267
|
+
VIEW_METHODS_MAPPING = {
|
268
|
+
index: [:index_fields, :display_fields],
|
269
|
+
show: [:show_fields, :display_fields],
|
270
|
+
edit: [:edit_fields, :form_fields],
|
271
|
+
update: [:edit_fields, :form_fields],
|
272
|
+
new: [:new_fields, :form_fields],
|
273
|
+
create: [:new_fields, :form_fields]
|
274
|
+
} unless defined? VIEW_METHODS_MAPPING
|
275
|
+
|
276
|
+
def fetch_fields
|
277
|
+
possible_methods_for_view = VIEW_METHODS_MAPPING[view.to_sym]
|
278
|
+
|
279
|
+
# Safe navigation operator is used because the view can be "destroy" or "preview"
|
280
|
+
possible_methods_for_view&.each do |method_for_view|
|
281
|
+
return send(method_for_view) if respond_to?(method_for_view)
|
282
|
+
end
|
283
|
+
|
284
|
+
fields
|
285
|
+
end
|
286
|
+
|
269
287
|
def fields
|
270
288
|
# blank fields method
|
271
289
|
end
|
@@ -37,7 +37,7 @@ module Avo
|
|
37
37
|
def frame_url
|
38
38
|
Avo::Services::URIService.parse(field_resource.record_path)
|
39
39
|
.append_path(id.to_s)
|
40
|
-
.append_query(
|
40
|
+
.append_query(query_params)
|
41
41
|
.to_s
|
42
42
|
end
|
43
43
|
|
@@ -100,6 +100,13 @@ module Avo
|
|
100
100
|
use_resource&.name || super
|
101
101
|
end
|
102
102
|
|
103
|
+
def query_params
|
104
|
+
{
|
105
|
+
turbo_frame: turbo_frame,
|
106
|
+
view: view
|
107
|
+
}
|
108
|
+
end
|
109
|
+
|
103
110
|
private
|
104
111
|
|
105
112
|
def frame_id
|
@@ -1,32 +1,28 @@
|
|
1
1
|
module Avo
|
2
2
|
module Services
|
3
3
|
class EncryptionService
|
4
|
-
attr_reader :message
|
5
|
-
attr_reader :purpose
|
6
|
-
attr_reader :crypt
|
7
|
-
|
8
4
|
class << self
|
9
|
-
def encrypt(
|
10
|
-
new(
|
5
|
+
def encrypt(...)
|
6
|
+
new(...).encrypt
|
11
7
|
end
|
12
8
|
|
13
|
-
def decrypt(
|
14
|
-
new(
|
9
|
+
def decrypt(...)
|
10
|
+
new(...).decrypt
|
15
11
|
end
|
16
12
|
end
|
17
13
|
|
18
|
-
def initialize(message:, purpose
|
14
|
+
def initialize(message:, purpose:, **kwargs)
|
19
15
|
@message = message
|
20
16
|
@purpose = purpose
|
21
|
-
@crypt = ActiveSupport::MessageEncryptor.new(encryption_key)
|
17
|
+
@crypt = ActiveSupport::MessageEncryptor.new(encryption_key, **kwargs)
|
22
18
|
end
|
23
19
|
|
24
20
|
def encrypt
|
25
|
-
crypt.encrypt_and_sign(message, purpose: purpose)
|
21
|
+
@crypt.encrypt_and_sign(@message, purpose: @purpose)
|
26
22
|
end
|
27
23
|
|
28
24
|
def decrypt
|
29
|
-
crypt.decrypt_and_verify(message, purpose: purpose)
|
25
|
+
@crypt.decrypt_and_verify(@message, purpose: @purpose)
|
30
26
|
end
|
31
27
|
|
32
28
|
private
|
data/lib/avo/version.rb
CHANGED
data/lib/avo/view_inquirer.rb
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
# It also allows to check if the view is a form or a display view by using `view.form?` or `view.display?`
|
3
3
|
module Avo
|
4
4
|
class ViewInquirer < ActiveSupport::StringInquirer
|
5
|
-
DISPLAY_VIEWS = %w[index show]
|
6
|
-
FORM_VIEWS = %w[new edit]
|
5
|
+
DISPLAY_VIEWS = %w[index show].freeze unless defined? DISPLAY_VIEWS
|
6
|
+
FORM_VIEWS = %w[new edit].freeze unless defined? FORM_VIEWS
|
7
7
|
|
8
8
|
def initialize(view)
|
9
9
|
super(view.to_s)
|
data/lib/avo.rb
CHANGED
@@ -64,7 +64,7 @@ module Avo
|
|
64
64
|
Avo.run_load_hooks(:init, self)
|
65
65
|
end
|
66
66
|
|
67
|
-
#
|
67
|
+
# Generate a dynamic root path using the URIService
|
68
68
|
def root_path(paths: [], query: {}, **args)
|
69
69
|
Avo::Services::URIService.parse(Avo::Current.view_context.avo.root_url.to_s)
|
70
70
|
.append_paths(paths)
|
@@ -147,7 +147,7 @@ module Avo
|
|
147
147
|
def get_cache_store
|
148
148
|
if Rails.env.production?
|
149
149
|
case Rails.cache.class.to_s
|
150
|
-
when "ActiveSupport::Cache::MemCacheStore", "ActiveSupport::Cache::RedisCacheStore"
|
150
|
+
when "ActiveSupport::Cache::MemCacheStore", "ActiveSupport::Cache::RedisCacheStore", "SolidCache::Store"
|
151
151
|
Rails.cache
|
152
152
|
else
|
153
153
|
ActiveSupport::Cache.lookup_store(:file_store, Rails.root.join("tmp", "cache"))
|
@@ -714,7 +714,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
714
714
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Hit(r,e){if(!!r){if(typeof r=="string")return yB(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return yB(r,e)}}function Wit(r){if(typeof Symbol<"u"&&Symbol.iterator in Object(r))return Array.from(r)}function Vit(r){if(Array.isArray(r))return yB(r)}function yB(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function Ime(r){var e=r.createElement,t=r.Fragment;return function(i){var a=i.hit,l=i.attribute,h=i.tagName,b=h===void 0?"mark":h;return e.apply(void 0,[t,{}].concat(jit(j2({hit:a,attribute:l}).map(function(k,E){return k.isHighlighted?e(b,{key:E},k.value):k.value}))))}}var Mme=Ue(()=>{Vb()});function $it(r){return Zit(r)||Yit(r)||Kit(r)||Git()}function Git(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
715
715
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Kit(r,e){if(!!r){if(typeof r=="string")return bB(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return bB(r,e)}}function Yit(r){if(typeof Symbol<"u"&&Symbol.iterator in Object(r))return Array.from(r)}function Zit(r){if(Array.isArray(r))return bB(r)}function bB(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function Lme(r){var e=r.createElement,t=r.Fragment;return function(i){var a=i.hit,l=i.attribute,h=i.tagName,b=h===void 0?"mark":h;return e.apply(void 0,[t,{}].concat($it(pme({hit:a,attribute:l}).map(function(k,E){return k.isHighlighted?e(b,{key:E},k.value):k.value}))))}}var Pme=Ue(()=>{Vb()});function Xit(r){return tot(r)||eot(r)||Qit(r)||Jit()}function Jit(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
716
716
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qit(r,e){if(!!r){if(typeof r=="string")return xB(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return xB(r,e)}}function eot(r){if(typeof Symbol<"u"&&Symbol.iterator in Object(r))return Array.from(r)}function tot(r){if(Array.isArray(r))return xB(r)}function xB(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function Rme(r){var e=r.createElement,t=r.Fragment;return function(i){var a=i.hit,l=i.attribute,h=i.tagName,b=h===void 0?"mark":h;return e.apply(void 0,[t,{}].concat(Xit(gme({hit:a,attribute:l}).map(function(k,E){return k.isHighlighted?e(b,{key:E},k.value):k.value}))))}}var Fme=Ue(()=>{Vb()});function rot(r){return aot(r)||oot(r)||iot(r)||not()}function not(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
717
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function iot(r,e){if(!!r){if(typeof r=="string")return _B(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return _B(r,e)}}function oot(r){if(typeof Symbol<"u"&&Symbol.iterator in Object(r))return Array.from(r)}function aot(r){if(Array.isArray(r))return _B(r)}function _B(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function qme(r){var e=r.createElement,t=r.Fragment;return function(i){var a=i.hit,l=i.attribute,h=i.tagName,b=h===void 0?"mark":h;return e.apply(void 0,[t,{}].concat(rot(W2({hit:a,attribute:l}).map(function(k,E){return k.isHighlighted?e(b,{key:E},k.value):k.value}))))}}var zme=Ue(()=>{Vb()});var Bme=Ue(()=>{Mme();Pme();Fme();zme()});function Nme(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function G2(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Nme(Object(t),!0).forEach(function(n){sot(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Nme(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function sot(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function lot(r,e){if(r==null)return{};var t=uot(r,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(r,n)||(t[n]=r[n]))}return t}function uot(r,e){if(r==null)return{};var t={},n=Object.keys(r),i,a;for(a=0;a<n.length;a++)i=n[a],!(e.indexOf(i)>=0)&&(t[i]=r[i]);return t}function jme(r){var e,t=r.classNames,n=r.container,i=r.getEnvironmentProps,a=r.getFormProps,l=r.getInputProps,h=r.getItemProps,b=r.getLabelProps,k=r.getListProps,E=r.getPanelProps,O=r.getRootProps,L=r.panelContainer,q=r.panelPlacement,z=r.render,N=r.renderNoResults,V=r.renderer,K=r.detachedMediaQuery,Q=r.components,ae=lot(r,["classNames","container","getEnvironmentProps","getFormProps","getInputProps","getItemProps","getLabelProps","getListProps","getPanelProps","getRootProps","panelContainer","panelPlacement","render","renderNoResults","renderer","detachedMediaQuery","components"]),_=Zz(n);_.tagName;var pe=typeof window<"u"?window:{},ne=V??hot,de={Highlight:Ime(ne),ReverseHighlight:Lme(ne),ReverseSnippet:Rme(ne),Snippet:qme(ne)};return{renderer:{classNames:Spe(cot,t??{}),container:_,getEnvironmentProps:i??function(he){var be=he.props;return be},getFormProps:a??function(he){var be=he.props;return be},getInputProps:l??function(he){var be=he.props;return be},getItemProps:h??function(he){var be=he.props;return be},getLabelProps:b??function(he){var be=he.props;return be},getListProps:k??function(he){var be=he.props;return be},getPanelProps:E??function(he){var be=he.props;return be},getRootProps:O??function(he){var be=he.props;return be},panelContainer:L?Zz(L):document.body,panelPlacement:q??"input-wrapper-width",render:z??fot,renderNoResults:N,renderer:ne,detachedMediaQuery:K??getComputedStyle(pe.document.documentElement).getPropertyValue("--aa-detached-media-query"),components:G2(G2({},de),Q)},core:G2(G2({},ae),{},{id:(e=ae.id)!==null&&e!==void 0?e:E2(),environment:pe})}}var cot,fot,hot,Ume=Ue(()=>{Uv();lme();Bme();Hb();cot={clearButton:"aa-ClearButton",detachedCancelButton:"aa-DetachedCancelButton",detachedContainer:"aa-DetachedContainer",detachedFormContainer:"aa-DetachedFormContainer",detachedOverlay:"aa-DetachedOverlay",detachedSearchButton:"aa-DetachedSearchButton",detachedSearchButtonIcon:"aa-DetachedSearchButtonIcon",detachedSearchButtonPlaceholder:"aa-DetachedSearchButtonPlaceholder",form:"aa-Form",input:"aa-Input",inputWrapper:"aa-InputWrapper",inputWrapperPrefix:"aa-InputWrapperPrefix",inputWrapperSuffix:"aa-InputWrapperSuffix",item:"aa-Item",label:"aa-Label",list:"aa-List",loadingIndicator:"aa-LoadingIndicator",panel:"aa-Panel",panelLayout:"aa-PanelLayout",root:"aa-Autocomplete",source:"aa-Source",sourceFooter:"aa-SourceFooter",sourceHeader:"aa-SourceHeader",sourceNoResults:"aa-SourceNoResults",submitButton:"aa-SubmitButton"},fot=function(e,t){var n=e.children;sme(n,t)},hot={createElement:oB,Fragment:Wb}});function Hme(r){var e=r.panelPlacement,t=r.container,n=r.form,i=r.environment,a=t.getBoundingClientRect(),l=a.top+a.height;switch(e){case"start":return{top:l,left:a.left};case"end":return{top:l,right:i.document.documentElement.clientWidth-(a.left+a.width)};case"full-width":return{top:l,left:0,right:0,width:"unset",maxWidth:"unset"};case"input-wrapper-width":{var h=n.getBoundingClientRect();return{top:l,left:h.left,right:i.document.documentElement.clientWidth-(h.left+h.width),width:"unset",maxWidth:"unset"}}default:throw new Error("[Autocomplete] The `panelPlacement` value ".concat(JSON.stringify(e)," is not valid."))}}var Wme=Ue(()=>{});function K2(){return K2=Object.assign||function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},K2.apply(this,arguments)}function Vme(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Y2(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Vme(Object(t),!0).forEach(function(n){dot(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Vme(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function dot(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function $me(r){var e=r.autocomplete,t=r.autocompleteScopeApi,n=r.dom,i=r.propGetters,a=r.state;Qz(n.root,i.getRootProps(Y2({state:a,props:e.getRootProps({})},t))),Qz(n.input,i.getInputProps(Y2({state:a,props:e.getInputProps({inputElement:n.input}),inputElement:n.input},t))),Uf(n.label,{hidden:a.status==="stalled"}),Uf(n.loadingIndicator,{hidden:a.status!=="stalled"}),Uf(n.clearButton,{hidden:!a.query})}function Gme(r,e){var t=e.autocomplete,n=e.autocompleteScopeApi,i=e.classNames,a=e.createElement,l=e.dom,h=e.Fragment,b=e.panelContainer,k=e.propGetters,E=e.state,O=e.components;if(!E.isOpen){b.contains(l.panel)&&b.removeChild(l.panel);return}!b.contains(l.panel)&&E.status!=="loading"&&b.appendChild(l.panel),l.panel.classList.toggle("aa-Panel--stalled",E.status==="stalled");var L=E.collections.map(function(N,V){var K=N.source,Q=N.items;return a("section",{key:V,className:i.source,"data-autocomplete-source-id":K.sourceId},K.templates.header&&a("div",{className:i.sourceHeader},K.templates.header({components:O,createElement:a,Fragment:h,items:Q,source:K,state:E})),Q.length===0&&K.templates.noResults&&E.query?a("div",{className:i.sourceNoResults},K.templates.noResults({components:O,createElement:a,Fragment:h,source:K,state:E})):a("ul",K2({className:i.list},k.getListProps(Y2({state:E,props:t.getListProps({})},n))),Q.map(function(ae){var _=t.getItemProps({item:ae,source:K});return a("li",K2({key:_.id,className:i.item},k.getItemProps(Y2({state:E,props:_},n))),K.templates.item({components:O,createElement:a,Fragment:h,item:ae,state:E}))})),K.templates.footer&&a("div",{className:i.sourceFooter},K.templates.footer({components:O,createElement:a,Fragment:h,items:Q,source:K,state:E})))}),q=a(h,null,a("div",{className:"aa-PanelLayout aa-Panel--scrollable"},L),a("div",{className:"aa-GradientBottom"})),z=L.reduce(function(N,V){return N[V.props["data-autocomplete-source-id"]]=V,N},{});r({children:q,state:E,sections:L,elements:z,createElement:a,Fragment:h,components:O},l.panel)}var Kme=Ue(()=>{Hb()});function Yme(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Wv(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Yme(Object(t),!0).forEach(function(n){Zme(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Yme(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Zme(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Xme(r){var e=Hpe(),t=e.runEffect,n=e.cleanupEffects,i=e.runEffects,a=Vpe(),l=a.reactive,h=a.runReactives,b=Hw(!1),k=Hw(r),E=Hw(void 0),O=l(function(){return jme(k.current)}),L=l(function(){return O.value.core.environment.matchMedia(O.value.renderer.detachedMediaQuery).matches}),q=l(function(){return ope(Wv(Wv({},O.value.core),{},{onStateChange:function(de){var he,be,_e;b.current=de.state.collections.some(function(Ve){return Ve.source.templates.noResults}),(he=E.current)===null||he===void 0||he.call(E,de),(be=(_e=O.value.core).onStateChange)===null||be===void 0||be.call(_e,de)},shouldPanelOpen:k.current.shouldPanelOpen||function(ne){var de=ne.state,he=lg(de)>0;if(!O.value.core.openOnFocus&&!de.query)return he;var be=Boolean(b.current||O.value.renderer.renderNoResults);return!he&&be||he}}))}),z=Hw(Wv({collections:[],completion:null,context:{},isOpen:!1,query:"",activeItemId:null,status:"idle"},O.value.core.initialState)),N={getEnvironmentProps:O.value.renderer.getEnvironmentProps,getFormProps:O.value.renderer.getFormProps,getInputProps:O.value.renderer.getInputProps,getItemProps:O.value.renderer.getItemProps,getLabelProps:O.value.renderer.getLabelProps,getListProps:O.value.renderer.getListProps,getPanelProps:O.value.renderer.getPanelProps,getRootProps:O.value.renderer.getRootProps},V={setActiveItemId:q.value.setActiveItemId,setQuery:q.value.setQuery,setCollections:q.value.setCollections,setIsOpen:q.value.setIsOpen,setStatus:q.value.setStatus,setContext:q.value.setContext,refresh:q.value.refresh},K=l(function(){return jpe({autocomplete:q.value,autocompleteScopeApi:V,classNames:O.value.renderer.classNames,isDetached:L.value,placeholder:O.value.core.placeholder,propGetters:N,state:z.current})});function Q(){Uf(K.value.panel,{style:L.value?{}:Hme({panelPlacement:O.value.renderer.panelPlacement,container:K.value.root,form:K.value.form,environment:O.value.core.environment})})}function ae(ne){z.current=ne;var de={autocomplete:q.value,autocompleteScopeApi:V,classNames:O.value.renderer.classNames,components:O.value.renderer.components,container:O.value.renderer.container,createElement:O.value.renderer.renderer.createElement,dom:K.value,Fragment:O.value.renderer.renderer.Fragment,panelContainer:L.value?K.value.detachedContainer:O.value.renderer.panelContainer,propGetters:N,state:z.current},he=!lg(ne)&&!b.current&&O.value.renderer.renderNoResults||O.value.renderer.render;$me(de),Gme(he,de)}t(function(){var ne=q.value.getEnvironmentProps({formElement:K.value.form,panelElement:K.value.panel,inputElement:K.value.input});return Uf(O.value.core.environment,ne),function(){Uf(O.value.core.environment,Object.keys(ne).reduce(function(de,he){return Wv(Wv({},de),{},Zme({},he,void 0))},{}))}}),t(function(){var ne=L.value?O.value.core.environment.document.body:O.value.renderer.panelContainer,de=L.value?K.value.detachedOverlay:K.value.panel;return L.value&&z.current.isOpen&&K.value.openDetachedOverlay(),ae(z.current),function(){ne.contains(de)&&ne.removeChild(de)}}),t(function(){var ne=O.value.renderer.container;return ne.appendChild(K.value.root),function(){ne.removeChild(K.value.root)}}),t(function(){var ne=Uz(function(de){var he=de.state;ae(he)},0);return E.current=function(de){var he=de.state,be=de.prevState;if(he.isOpen&&!be.isOpen&&Q(),he.query!==be.query){var _e=document.querySelectorAll(".aa-Panel--scrollable");_e.forEach(function(Ve){Ve.scrollTop!==0&&(Ve.scrollTop=0)})}ne({state:he})},function(){E.current=void 0}}),t(function(){var ne=Uz(function(){var de=L.value;L.value=O.value.core.environment.matchMedia(O.value.renderer.detachedMediaQuery).matches,de!==L.value?pe({}):requestAnimationFrame(Q)},20);return O.value.core.environment.addEventListener("resize",ne),function(){O.value.core.environment.removeEventListener("resize",ne)}}),t(function(){if(!L.value)return function(){};function ne(be){K.value.detachedContainer.classList.toggle("aa-DetachedContainer--modal",be)}function de(be){ne(be.matches)}var he=O.value.core.environment.matchMedia(getComputedStyle(O.value.core.environment.document.documentElement).getPropertyValue("--aa-detached-modal-media-query"));return ne(he.matches),he.addEventListener("change",de),function(){he.removeEventListener("change",de)}}),t(function(){return requestAnimationFrame(Q),function(){}});function _(){n()}function pe(){var ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n(),k.current=Jz(O.value.renderer,O.value.core,{initialState:z.current},ne),h(),i(),q.value.refresh().then(function(){ae(z.current)})}return Wv(Wv({},V),{},{update:pe,destroy:_})}var Jme=Ue(()=>{_pe();Uv();Upe();Wpe();$pe();Ume();Wme();Kme();Hb()});var Qme,ege=Ue(()=>{Qme="1.0.0-alpha.46"});function tge(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function rge(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?tge(Object(t),!0).forEach(function(n){pot(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):tge(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function pot(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}var nge,ige=Ue(()=>{Vb();ege();nge=V2(function(r){return $2(rge(rge({},r),{},{userAgents:[{segment:"autocomplete-js",version:Qme}]}))})});var oge=Ue(()=>{});var sPt,age=Ue(()=>{ige();sPt=nge({transformResponse:function(e){return e.hits}})});var sge=Ue(()=>{oge();age()});var lge=Ue(()=>{});var uge=Ue(()=>{});var cge=Ue(()=>{});var fge=Ue(()=>{});var hge=Ue(()=>{});var dge=Ue(()=>{});var pge=Ue(()=>{});var mge=Ue(()=>{});var gge=Ue(()=>{});var vge=Ue(()=>{});var yge=Ue(()=>{});var bge=Ue(()=>{});var xge=Ue(()=>{});var _ge=Ue(()=>{lge();uge();cge();fge();hge();dge();pge();mge();gge();vge();yge();bge();xge()});var wge=Ue(()=>{Jme();sge();_ge()});var Sge,kge=Ue(()=>{Sge=(r,e)=>{let t;return(...n)=>(t&&clearTimeout(t),new Promise(i=>{t=setTimeout(()=>i(r(...n)),e)}))}});var Cge,Ege,Z2,Tge=Ue(()=>{Cge=So(AR());_i();YR();wge();Ege=So(yw());kge();Z2=class extends qr{constructor(){super(...arguments);Dr(this,"debouncedFetch",Sge(fetch,this.searchDebounce));Dr(this,"destroyMethod")}get dataset(){return this.autocompleteTarget.dataset}get searchDebounce(){return window.Avo.configuration.search_debounce}get translationKeys(){let r;try{r=JSON.parse(this.dataset.translationKeys)}catch(e){r={}}return r}get isBelongsToSearch(){return this.dataset.viaAssociation==="belongs_to"}get isHasManySearch(){return this.dataset.viaAssociation==="has_many"}get isGlobalSearch(){return this.dataset.searchResource==="global"}connect(){let r=this;this.buttonTarget.onclick=()=>this.showSearchPanel(),this.clearValueTargets.forEach(t=>{t.getAttribute("value")&&this.hasClearButtonTarget&&this.clearButtonTarget.classList.remove("hidden")}),this.isGlobalSearch&&Cge.bind(["command+k","ctrl+k"],()=>this.showSearchPanel()),this.autocompleteTarget.innerHTML="";let{destroy:e}=Xme({container:this.autocompleteTarget,placeholder:this.translationKeys.placeholder,translations:{detachedCancelButtonText:this.translationKeys.cancel_button},autoFocus:!0,openOnFocus:!0,detachedMediaQuery:"",getSources:({query:t})=>{document.body.classList.add("search-loading");let n=r.searchUrl(t);return r.debouncedFetch(n).then(i=>(document.body.classList.remove("search-loading"),i.json())).then(i=>Object.keys(i).map(a=>r.addSource(a,i[a])))}});this.destroyMethod=e,this.buttonTarget.dataset.shouldBeDisabled!=="true"&&this.buttonTarget.removeAttribute("disabled")}disconnect(){this.destroyMethod&&(this.destroyMethod(),this.destroyMethod=null)}addSource(r,e){let t=this;return{sourceId:r,getItems:()=>e.results,onSelect:t.handleOnSelect.bind(t),templates:{header(){return`${e.header.toUpperCase()} ${e.help}`},item({item:n,createElement:i}){let a=[];if(n._avatar){let h;switch(n._avatar_type){default:case"circle":h="rounded-full";break;case"rounded":h="rounded";break;case"square":h="rounded-none";break}a.push(i("img",{src:n._avatar,alt:n._label,class:`flex-shrink-0 w-8 h-8 my-[2px] inline mr-2 ${h}`}))}let l=[n._label];return n._description&&l.push(i("div",{class:"aa-ItemDescription"},n._description)),a.push(i("div",null,l)),i("div",{class:"flex"},a)},noResults(){return t.translationKeys.no_item_found.replace("%{item}",r)}}}}handleOnSelect({item:r}){this.isBelongsToSearch?(this.updateFieldAttribute(this.hiddenIdTarget,"value",r._id),this.updateFieldAttribute(this.buttonTarget,"value",r._label),document.querySelector(".aa-DetachedOverlay").remove(),this.hasClearButtonTarget&&this.clearButtonTarget.classList.remove("hidden")):fv.visit(r._url,{action:"advance"}),document.body.classList.remove("aa-Detached")}searchUrl(r){return(0,Ege.default)().segment([window.Avo.configuration.root_path,...this.searchSegments()]).search(this.searchParams(encodeURIComponent(r))).readable().toString()}searchSegments(){let r=["avo_api",this.dataset.searchResource,"search"];return this.isGlobalSearch&&(r=["avo_api","search"]),r}searchParams(r){let e={q:r,global:!1};return this.isGlobalSearch&&(e.global=!0),(this.isBelongsToSearch||this.isHasManySearch)&&(e=this.addAssociationParams(e),e=this.addReflectionParams(e),this.isBelongsToSearch&&(e=mm(kf({},e),{via_parent_resource_id:this.dataset.viaParentResourceId,via_parent_resource_class:this.dataset.viaParentResourceClass,via_relation:this.dataset.viaRelation}))),e}addAssociationParams(r){return r=mm(kf({},r),{via_association:this.dataset.viaAssociation,via_association_id:this.dataset.viaAssociationId}),r}addReflectionParams(r){return r=mm(kf({},r),{via_reflection_class:this.dataset.viaReflectionClass,via_reflection_id:this.dataset.viaReflectionId}),r}showSearchPanel(){this.autocompleteTarget.querySelector("button").click()}clearValue(){this.clearValueTargets.map(r=>this.updateFieldAttribute(r,"value","")),this.clearButtonTarget.classList.add("hidden")}updateFieldAttribute(r,e,t){r.setAttribute(e,t),r.dispatchEvent(new Event("input"))}};Dr(Z2,"targets",["autocomplete","button","hiddenId","visibleLabel","clearValue","clearButton"])});var Age,X2,Dge=Ue(()=>{_i();Age=So(yw()),X2=class extends qr{get parentTurboFrame(){return this.context.scope.element.closest("turbo-frame")}onChange(r){if(!this.parentTurboFrame.src)return;let e=new Age.default(this.parentTurboFrame.src);e.search(mm(kf({},e.query(!0)),{range:r.currentTarget.value})),this.parentTurboFrame.src=e.toString(),this.parentTurboFrame.reload()}};Dr(X2,"targets",["select"])});var J2,Oge=Ue(()=>{xb();J2=class extends af{getFilterValue(){return this.selectorTarget.value===""?null:this.selectorTarget.value}getFilterClass(){let{filterClass:r}=this.selectorTarget.dataset;return r}};Dr(J2,"targets",["selector"])});var wB,Ige=Ue(()=>{_i();wB=class extends qr{destroy(){this.context.element.remove()}}});async function CB(r,e=null){r.classList.remove("hidden"),await Mge("enter",r,e)}async function $b(r,e=null){await Mge("leave",r,e),r.classList.add("hidden")}async function Q2(r,e=null){r.classList.contains("hidden")?await CB(r,e):await $b(r,e)}async function Mge(r,e,t){let n=e.dataset,i=t?`${t}-${r}`:r,a=`transition${r.charAt(0).toUpperCase()+r.slice(1)}`,l=n[a]?n[a].split(" "):[i],h=n[`${a}Start`]?n[`${a}Start`].split(" "):[`${i}-start`],b=n[`${a}End`]?n[`${a}End`].split(" "):[`${i}-end`];SB(e,l),SB(e,h),await mot(),kB(e,h),SB(e,b),await got(e),kB(e,b),kB(e,l)}function SB(r,e){r.classList.add(...e)}function kB(r,e){r.classList.remove(...e)}function mot(){return new Promise(r=>{requestAnimationFrame(()=>{requestAnimationFrame(r)})})}function got(r){return new Promise(e=>{let t=getComputedStyle(r).transitionDuration.split(",")[0],n=Number(t.replace("s",""))*1e3;setTimeout(()=>{e()},n)})}var EB=Ue(()=>{});function eD(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)r[n]=t[n]}return r}function TB(r,e){function t(i,a,l){if(!(typeof document>"u")){l=eD({},e,l),typeof l.expires=="number"&&(l.expires=new Date(Date.now()+l.expires*864e5)),l.expires&&(l.expires=l.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var h="";for(var b in l)!l[b]||(h+="; "+b,l[b]!==!0&&(h+="="+l[b].split(";")[0]));return document.cookie=i+"="+r.write(a,i)+h}}function n(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var a=document.cookie?document.cookie.split("; "):[],l={},h=0;h<a.length;h++){var b=a[h].split("="),k=b.slice(1).join("=");try{var E=decodeURIComponent(b[0]);if(l[E]=r.read(k,E),i===E)break}catch{}}return i?l[i]:l}}return Object.create({set:t,get:n,remove:function(i,a){t(i,"",eD({},a,{expires:-1}))},withAttributes:function(i){return TB(this.converter,eD({},this.attributes,i))},withConverter:function(i){return TB(eD({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(r)}})}var vot,yot,Yw,Lge=Ue(()=>{vot={read:function(r){return r[0]==='"'&&(r=r.slice(1,-1)),r.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(r){return encodeURIComponent(r).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};yot=TB(vot,{path:"/"}),Yw=yot});var Zw,Pge=Ue(()=>{_i();EB();Lge();Zw=class extends qr{get cookieKey(){return`${window.Avo.configuration.cookies_key}.sidebar.open`}get sidebarOpen(){return Yw.get(this.cookieKey)==="1"}set cookie(r){Yw.set(this.cookieKey,r===!0?1:0)}markSidebarClosed(){Yw.set(this.cookieKey,"0"),this.openValue=!1,$b(this.sidebarTarget),this.mainAreaTarget.classList.remove("sidebar-open")}markSidebarOpen(){Yw.set(this.cookieKey,"1"),this.openValue=!0,CB(this.sidebarTarget),this.mainAreaTarget.classList.add("sidebar-open")}toggleSidebar(){this.openValue?this.markSidebarClosed():this.markSidebarOpen()}toggleSidebarOnMobile(){Q2(this.mobileSidebarTarget)}};Dr(Zw,"targets",["sidebar","mobileSidebar","mainArea"]),Dr(Zw,"values",{open:Boolean})});var Xw,Rge=Ue(()=>{_i();vb();Xw=class extends qr{get currentTab(){return this.tabPanelTargets.find(r=>r.dataset.tabId===this.activeTabValue)}targetTabPanel(r){return this.tabPanelTargets.find(e=>e.dataset.tabId===r)}changeTab(r){return Pg(this,null,function*(){r.preventDefault();let{params:e}=r,{id:t}=e;yield this.setTheTargetPanelHeight(t),this.hideAllTabs(),this.revealTab(t),this.markTabLoaded(t),this.activeTabValue=t})}setTheTargetPanelHeight(r){return Pg(this,null,function*(){if(this.viewValue==="edit"||this.viewValue==="new"||Wu(this.targetTabPanel(r).dataset.loaded))return;let{height:e}=this.currentTab.getBoundingClientRect();this.targetTabPanel(r).style.height=`${e}px`,yield this.targetTabPanel(r).loaded,this.targetTabPanel(r).style.height=""})}markTabLoaded(r){this.targetTabPanel(r).dataset.loaded=!0}revealTab(r){this.targetTabPanel(r).classList.remove("hidden")}hideAllTabs(){this.tabPanelTargets.map(r=>r.classList.add("hidden"))}};Dr(Xw,"targets",["tabPanel"]),Dr(Xw,"values",{view:String,activeTab:String})});var tD,Fge=Ue(()=>{xb();tD=class extends af{getFilterValue(){return this.textTarget.value}tryToSubmit(r){if(r.keyCode===13)return this.changeFilter()}getFilterClass(){let{filterClass:r}=this.textTarget.dataset;return r}};Dr(tD,"targets",["text"])});var rD,qge=Ue(()=>{_i();BE();rD=class extends qr{connect(){$0(this.sourceTarget,{content:this.contentTarget.innerHTML,allowHTML:!0,theme:"light"})}};Dr(rD,"targets",["source","content"])});function DB(r,e,t){r.addEventListener?r.addEventListener(e,t,!1):r.attachEvent&&r.attachEvent("on".concat(e),function(){t(window.event)})}function Uge(r,e){for(var t=e.slice(0,e.length-1),n=0;n<t.length;n++)t[n]=r[t[n].toLowerCase()];return t}function Hge(r){typeof r!="string"&&(r=""),r=r.replace(/\s/g,"");for(var e=r.split(","),t=e.lastIndexOf("");t>=0;)e[t-1]+=",",e.splice(t,1),t=e.lastIndexOf("");return e}function bot(r,e){for(var t=r.length>=e.length?r:e,n=r.length>=e.length?e:r,i=!0,a=0;a<t.length;a++)n.indexOf(t[a])===-1&&(i=!1);return i}function Gge(r){Vge=r||"all"}function Qw(){return Vge||"all"}function xot(){return Ta.slice(0)}function _ot(r){var e=r.target||r.srcElement,t=e.tagName,n=!0;return(e.isContentEditable||(t==="INPUT"||t==="TEXTAREA"||t==="SELECT")&&!e.readOnly)&&(n=!1),n}function wot(r){return typeof r=="string"&&(r=iD(r)),Ta.indexOf(r)!==-1}function Sot(r,e){var t,n;r||(r=Qw());for(var i in Al)if(Object.prototype.hasOwnProperty.call(Al,i))for(t=Al[i],n=0;n<t.length;)t[n].scope===r?t.splice(n,1):n++;Qw()===r&&Gge(e||"all")}function kot(r){var e=r.keyCode||r.which||r.charCode,t=Ta.indexOf(e);if(t>=0&&Ta.splice(t,1),r.key&&r.key.toLowerCase()==="meta"&&Ta.splice(0,Ta.length),(e===93||e===224)&&(e=91),e in Zl){Zl[e]=!1;for(var n in Vv)Vv[n]===e&&(hg[n]=!1)}}function Cot(r){if(!r)Object.keys(Al).forEach(function(l){return delete Al[l]});else if(Array.isArray(r))r.forEach(function(l){l.key&&OB(l)});else if(typeof r=="object")r.key&&OB(r);else if(typeof r=="string"){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];var i=t[0],a=t[1];typeof i=="function"&&(a=i,i=""),OB({key:r,scope:i,method:a,splitKey:"+"})}}function Bge(r,e,t){var n;if(e.scope===t||e.scope==="all"){n=e.mods.length>0;for(var i in Zl)Object.prototype.hasOwnProperty.call(Zl,i)&&(!Zl[i]&&e.mods.indexOf(+i)>-1||Zl[i]&&e.mods.indexOf(+i)===-1)&&(n=!1);(e.mods.length===0&&!Zl[16]&&!Zl[18]&&!Zl[17]&&!Zl[91]||n||e.shortcut==="*")&&e.method(r,e)===!1&&(r.preventDefault?r.preventDefault():r.returnValue=!1,r.stopPropagation&&r.stopPropagation(),r.cancelBubble&&(r.cancelBubble=!0))}}function Nge(r){var e=Al["*"],t=r.keyCode||r.which||r.charCode;if(!!hg.filter.call(this,r)){if((t===93||t===224)&&(t=91),Ta.indexOf(t)===-1&&t!==229&&Ta.push(t),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(q){var z=zge[q];r[q]&&Ta.indexOf(z)===-1?Ta.push(z):!r[q]&&Ta.indexOf(z)>-1?Ta.splice(Ta.indexOf(z),1):q==="metaKey"&&r[q]&&Ta.length===3&&(r.ctrlKey||r.shiftKey||r.altKey||(Ta=Ta.slice(Ta.indexOf(z))))}),t in Zl){Zl[t]=!0;for(var n in Vv)Vv[n]===t&&(hg[n]=!0);if(!e)return}for(var i in Zl)Object.prototype.hasOwnProperty.call(Zl,i)&&(Zl[i]=r[zge[i]]);r.getModifierState&&!(r.altKey&&!r.ctrlKey)&&r.getModifierState("AltGraph")&&(Ta.indexOf(17)===-1&&Ta.push(17),Ta.indexOf(18)===-1&&Ta.push(18),Zl[17]=!0,Zl[18]=!0);var a=Qw();if(e)for(var l=0;l<e.length;l++)e[l].scope===a&&(r.type==="keydown"&&e[l].keydown||r.type==="keyup"&&e[l].keyup)&&Bge(r,e[l],a);if(t in Al){for(var h=0;h<Al[t].length;h++)if((r.type==="keydown"&&Al[t][h].keydown||r.type==="keyup"&&Al[t][h].keyup)&&Al[t][h].key){for(var b=Al[t][h],k=b.splitKey,E=b.key.split(k),O=[],L=0;L<E.length;L++)O.push(iD(E[L]));O.sort().join("")===Ta.sort().join("")&&Bge(r,b,a)}}}}function Eot(r){return $ge.indexOf(r)>-1}function hg(r,e,t){Ta=[];var n=Hge(r),i=[],a="all",l=document,h=0,b=!1,k=!0,E="+";for(t===void 0&&typeof e=="function"&&(t=e),Object.prototype.toString.call(e)==="[object Object]"&&(e.scope&&(a=e.scope),e.element&&(l=e.element),e.keyup&&(b=e.keyup),e.keydown!==void 0&&(k=e.keydown),typeof e.splitKey=="string"&&(E=e.splitKey)),typeof e=="string"&&(a=e);h<n.length;h++)r=n[h].split(E),i=[],r.length>1&&(i=Uge(Vv,r)),r=r[r.length-1],r=r==="*"?"*":iD(r),r in Al||(Al[r]=[]),Al[r].push({keyup:b,keydown:k,scope:a,mods:i,shortcut:n[h],method:t,key:n[h],splitKey:E});typeof l<"u"&&!Eot(l)&&window&&($ge.push(l),DB(l,"keydown",function(O){Nge(O)}),DB(window,"focus",function(){Ta=[]}),DB(l,"keyup",function(O){Nge(O),kot(O)}))}var AB,Wge,Vv,zge,Zl,Al,Jw,Ta,Vge,$ge,iD,OB,IB,nD,jge,Kge=Ue(()=>{AB=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;Wge={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"\u21EA":20,",":188,".":190,"/":191,"`":192,"-":AB?173:189,"=":AB?61:187,";":AB?59:186,"'":222,"[":219,"]":221,"\\":220},Vv={"\u21E7":16,shift:16,"\u2325":18,alt:18,option:18,"\u2303":17,ctrl:17,control:17,"\u2318":91,cmd:91,command:91},zge={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},Zl={16:!1,18:!1,17:!1,91:!1},Al={};for(Jw=1;Jw<20;Jw++)Wge["f".concat(Jw)]=111+Jw;Ta=[],Vge="all",$ge=[],iD=function(e){return Wge[e.toLowerCase()]||Vv[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};OB=function(e){var t=e.key,n=e.scope,i=e.method,a=e.splitKey,l=a===void 0?"+":a,h=Hge(t);h.forEach(function(b){var k=b.split(l),E=k.length,O=k[E-1],L=O==="*"?"*":iD(O);if(!!Al[L]){n||(n=Qw());var q=E>1?Uge(Vv,k):[];Al[L]=Al[L].map(function(z){var N=i?z.method===i:!0;return N&&z.scope===n&&bot(z.mods,q)?{}:z})}})};IB={setScope:Gge,getScope:Qw,deleteScope:Sot,getPressedKeyCodes:xot,isPressed:wot,filter:_ot,unbind:Cot};for(nD in IB)Object.prototype.hasOwnProperty.call(IB,nD)&&(hg[nD]=IB[nD]);typeof window<"u"&&(jge=window.hotkeys,hg.noConflict=function(r){return r&&window.hotkeys===hg&&(window.hotkeys=jge),hg},window.hotkeys=hg)});function Dot(r){let e=r.getBoundingClientRect(),t=window.innerHeight||document.documentElement.clientHeight,n=window.innerWidth||document.documentElement.clientWidth,i=e.top<=t&&e.top+e.height>=0,a=e.left<=n&&e.left+e.width>=0;return i&&a}var Tot,Aot,Oot,Yge,Zge,Xge,Jge=Ue(()=>{_i();Kge();Tot=(r,e,t)=>{let n=r;return t===!0?n=`${e.identifier}:${r}`:typeof t=="string"&&(n=`${t}:${r}`),n},Aot=(r,e,t)=>{let{bubbles:n,cancelable:i,composed:a}=e||{bubbles:!0,cancelable:!0,composed:!0};return e&&Object.assign(t,{originalEvent:e}),new CustomEvent(r,{bubbles:n,cancelable:i,composed:a,detail:t})};Oot={events:["click","touchend"],onlyVisible:!0,dispatchEvent:!0,eventPrefix:!0},Yge=(r,e={})=>{let{onlyVisible:t,dispatchEvent:n,events:i,eventPrefix:a}=Object.assign({},Oot,e),l=E=>{let O=e?.element||r.element;if(!(O.contains(E.target)||!Dot(O)&&t)&&(r.clickOutside&&r.clickOutside(E),n)){let L=Tot("click:outside",r,a),q=Aot(L,E,{controller:r});O.dispatchEvent(q)}},h=()=>{i?.forEach(E=>{window.addEventListener(E,l,!1)})},b=()=>{i?.forEach(E=>{window.removeEventListener(E,l,!1)})},k=r.disconnect.bind(r);return Object.assign(r,{disconnect(){b(),k()}}),h(),[h,b]};Zge=class extends qr{};Zge.debounces=[];Xge=class extends qr{};Xge.throttles=[]});var eS,Qge=Ue(()=>{_i();EB();Jge();eS=class extends qr{get exemptionContainerTarget(){return document.querySelector(this.exemptionContainerValue)}connect(){Yge(this)}clickOutside(r){this.hasPanelTarget&&(this.hasExemptionContainerValue?this.exemptionContainerTarget.contains(r.target)||$b(this.panelTarget):$b(this.panelTarget))}togglePanel(){this.hasPanelTarget&&Q2(this.panelTarget)}outlet({params:r}){let{outlet:e}=r;e&&document.querySelector(e)&&document.querySelector(e).classList.toggle("hidden")}};Dr(eS,"targets",["panel"]),Dr(eS,"values",{exemptionContainer:String})});function tat(r){this.wrapped=r}function aD(r){var e,t;function n(a,l){try{var h=r[a](l),b=h.value,k=b instanceof tat;Promise.resolve(k?b.wrapped:b).then(function(E){k?n(a==="return"?"return":"next",E):i(h.done?"return":"normal",E)},function(E){n("throw",E)})}catch(E){i("throw",E)}}function i(a,l){switch(a){case"return":e.resolve({value:l,done:!0});break;case"throw":e.reject(l);break;default:e.resolve({value:l,done:!1})}(e=e.next)?n(e.key,e.arg):t=null}this._invoke=function(a,l){return new Promise(function(h,b){var k={key:a,arg:l,resolve:h,reject:b,next:null};t?t=t.next=k:(e=t=k,n(a,l))})},typeof r.return!="function"&&(this.return=void 0)}function hf(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}var rN,Oc,eve,tve,MB,uS,ei,Iot,Tve,Ave,nN,Mot,ja,iS,Dve,mg,iN,Gv,LB,gg,uD,Dc,wi,tS,oS,PB,Lot,rve,Kb,Pot,Yb,Kv,Ove,aS,oN,sD,Yv,Ive,YB,cS,xs,Rot,nve,Fot,RB,FB,qB,Qb,qot,zot,Bot,ZB,XB,Not,vg,Zv,aN,jot,Uot,zB,BB,NB,oD,JB,qs,Hot,QB,Wot,Mve,Vot,$ot,ive,ove,Lve,Pve,sN,Rve,fS,Co,$p,cD,ave,eN,lN,Got,Xv,Fve,Zb,qve,Kot,sve,nS,uN,cN,lve,jB,Ic,Yot,Zot,lD,rS,Xot,hD,zve,Bve,uve,sS,Qv,Nve,dg,fN,cve,Jot,jve,Uve,Hve,Qot,fve,Wve,dD,hve,eat,dve,yg,hN,ey,Jv,pD,lS,rat,nat,iat,Hf,zd,oat,aat,sat,lat,Vve,uat,pve,mve,gve,ff,vve,cat,fat,hat,dN,dat,UB,yve,ex,bve,pat,xve,mat,gat,vat,$ve,yat,bat,xat,_at,wat,rs,pN,mN,Vp,fD,Sat,gN,Gve,kat,vN,yN,HB,Cat,Eat,Kve,bN,pg,Yve,Tat,WB,$v,Aat,VB,xN,_N,wN,Dat,Oat,SN,tN,kN,Zve,Iat,Mat,_ve,hS,$B,Lat,Xve,Pat,qd,Rat,Fat,qat,zat,Wp,Xb,Bat,GB,Nat,jat,Uat,KB,Hat,Wat,Vat,wve,Sve,kve,Gb,CN,Jb,$at,Gat,Kat,EN,Yat,Zat,Xat,Jat,Qat,Cve,TN,Eve,Jve=Ue(()=>{rN={preview:{presentation:"gallery",caption:{name:!0,size:!0}},file:{caption:{size:!0}}},Oc={default:{tagName:"div",parse:!1},quote:{tagName:"blockquote",nestable:!0},heading1:{tagName:"h1",terminal:!0,breakOnReturn:!0,group:!1},code:{tagName:"pre",terminal:!0,text:{plaintext:!0}},bulletList:{tagName:"ul",parse:!1},bullet:{tagName:"li",listAttribute:"bulletList",group:!1,nestable:!0,test(r){return eve(r.parentNode)===Oc[this.listAttribute].tagName}},numberList:{tagName:"ol",parse:!1},number:{tagName:"li",listAttribute:"numberList",group:!1,nestable:!0,test(r){return eve(r.parentNode)===Oc[this.listAttribute].tagName}},attachmentGallery:{tagName:"div",exclusive:!0,terminal:!0,parse:!1,group:!1}},eve=r=>{var e;return r==null||(e=r.tagName)===null||e===void 0?void 0:e.toLowerCase()},tve=navigator.userAgent.match(/android\s([0-9]+.*Chrome)/i),MB=tve&&parseInt(tve[1]),uS={composesExistingText:/Android.*Chrome/.test(navigator.userAgent),recentAndroid:MB&&MB>12,samsungAndroid:MB&&navigator.userAgent.match(/Android.*SM-/),forcesObjectResizing:/Trident.*rv:11/.test(navigator.userAgent),supportsInputEvents:typeof InputEvent<"u"&&["data","getTargetRanges","inputType"].every(r=>r in InputEvent.prototype)},ei={attachFiles:"Attach Files",bold:"Bold",bullets:"Bullets",byte:"Byte",bytes:"Bytes",captionPlaceholder:"Add a caption\u2026",code:"Code",heading1:"Heading",indent:"Increase Level",italic:"Italic",link:"Link",numbers:"Numbers",outdent:"Decrease Level",quote:"Quote",redo:"Redo",remove:"Remove",strike:"Strikethrough",undo:"Undo",unlink:"Unlink",url:"URL",urlPlaceholder:"Enter a URL\u2026",GB:"GB",KB:"KB",MB:"MB",PB:"PB",TB:"TB"},Iot=[ei.bytes,ei.KB,ei.MB,ei.GB,ei.TB,ei.PB],Tve={prefix:"IEC",precision:2,formatter(r){switch(r){case 0:return"0 ".concat(ei.bytes);case 1:return"1 ".concat(ei.byte);default:let e;this.prefix==="SI"?e=1e3:this.prefix==="IEC"&&(e=1024);let t=Math.floor(Math.log(r)/Math.log(e)),n=(r/Math.pow(e,t)).toFixed(this.precision).replace(/0*$/,"").replace(/\.$/,"");return"".concat(n," ").concat(Iot[t])}}},Ave=function(r){for(let e in r){let t=r[e];this[e]=t}return this},nN=document.documentElement,Mot=nN.matches,ja=function(r){let{onElement:e,matchingSelector:t,withCallback:n,inPhase:i,preventDefault:a,times:l}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},h=e||nN,b=t,k=i==="capturing",E=function(O){l!=null&&--l==0&&E.destroy();let L=mg(O.target,{matchingSelector:b});L!=null&&(n?.call(L,O,L),a&&O.preventDefault())};return E.destroy=()=>h.removeEventListener(r,E,k),h.addEventListener(r,E,k),E},iS=function(r){let{onElement:e,bubbles:t,cancelable:n,attributes:i}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=e??nN;t=t!==!1,n=n!==!1;let l=document.createEvent("Events");return l.initEvent(r,t,n),i!=null&&Ave.call(l,i),a.dispatchEvent(l)},Dve=function(r,e){if(r?.nodeType===1)return Mot.call(r,e)},mg=function(r){let{matchingSelector:e,untilNode:t}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};for(;r&&r.nodeType!==Node.ELEMENT_NODE;)r=r.parentNode;if(r!=null){if(e==null)return r;if(r.closest&&t==null)return r.closest(e);for(;r&&r!==t;){if(Dve(r,e))return r;r=r.parentNode}}},iN=r=>document.activeElement!==r&&Gv(r,document.activeElement),Gv=function(r,e){if(r&&e)for(;e;){if(e===r)return!0;e=e.parentNode}},LB=function(r){var e;if((e=r)===null||e===void 0||!e.parentNode)return;let t=0;for(r=r.previousSibling;r;)t++,r=r.previousSibling;return t},gg=r=>{var e;return r==null||(e=r.parentNode)===null||e===void 0?void 0:e.removeChild(r)},uD=function(r){let{onlyNodesOfType:e,usingFilter:t,expandEntityReferences:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=(()=>{switch(e){case"element":return NodeFilter.SHOW_ELEMENT;case"text":return NodeFilter.SHOW_TEXT;case"comment":return NodeFilter.SHOW_COMMENT;default:return NodeFilter.SHOW_ALL}})();return document.createTreeWalker(r,i,t??null,n===!0)},Dc=r=>{var e;return r==null||(e=r.tagName)===null||e===void 0?void 0:e.toLowerCase()},wi=function(r){let e,t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};typeof r=="object"?(n=r,r=n.tagName):n={attributes:n};let i=document.createElement(r);if(n.editable!=null&&(n.attributes==null&&(n.attributes={}),n.attributes.contenteditable=n.editable),n.attributes)for(e in n.attributes)t=n.attributes[e],i.setAttribute(e,t);if(n.style)for(e in n.style)t=n.style[e],i.style[e]=t;if(n.data)for(e in n.data)t=n.data[e],i.dataset[e]=t;return n.className&&n.className.split(" ").forEach(a=>{i.classList.add(a)}),n.textContent&&(i.textContent=n.textContent),n.childNodes&&[].concat(n.childNodes).forEach(a=>{i.appendChild(a)}),i},oS=function(){if(tS!=null)return tS;tS=[];for(let r in Oc){let e=Oc[r];e.tagName&&tS.push(e.tagName)}return tS},PB=r=>Kb(r?.firstChild),Lot=function(r){return oS().includes(Dc(r))&&!oS().includes(Dc(r.firstChild))},rve=function(r){let{strict:e}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{strict:!0};return e?Kb(r):Kb(r)||!Kb(r.firstChild)&&Lot(r)},Kb=r=>Pot(r)&&r?.data==="block",Pot=r=>r?.nodeType===Node.COMMENT_NODE,Yb=function(r){let{name:e}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(r)return aS(r)?r.data==="\uFEFF"?!e||r.parentNode.dataset.trixCursorTarget===e:void 0:Yb(r.firstChild)},Kv=r=>Dve(r,"[data-trix-attachment]"),Ove=r=>aS(r)&&r?.data==="",aS=r=>r?.nodeType===Node.TEXT_NODE,oN={level2Enabled:!0,getLevel(){return this.level2Enabled&&uS.supportsInputEvents?2:0},pickFiles(r){let e=wi("input",{type:"file",multiple:!0,hidden:!0,id:this.fileInputId});e.addEventListener("change",()=>{r(e.files),gg(e)}),gg(document.getElementById(this.fileInputId)),document.body.appendChild(e),e.click()}},sD={removeBlankTableCells:!1,tableCellSeparator:" | ",tableRowSeparator:`
|
717
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function iot(r,e){if(!!r){if(typeof r=="string")return _B(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return _B(r,e)}}function oot(r){if(typeof Symbol<"u"&&Symbol.iterator in Object(r))return Array.from(r)}function aot(r){if(Array.isArray(r))return _B(r)}function _B(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function qme(r){var e=r.createElement,t=r.Fragment;return function(i){var a=i.hit,l=i.attribute,h=i.tagName,b=h===void 0?"mark":h;return e.apply(void 0,[t,{}].concat(rot(W2({hit:a,attribute:l}).map(function(k,E){return k.isHighlighted?e(b,{key:E},k.value):k.value}))))}}var zme=Ue(()=>{Vb()});var Bme=Ue(()=>{Mme();Pme();Fme();zme()});function Nme(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function G2(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Nme(Object(t),!0).forEach(function(n){sot(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Nme(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function sot(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function lot(r,e){if(r==null)return{};var t=uot(r,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(r,n)||(t[n]=r[n]))}return t}function uot(r,e){if(r==null)return{};var t={},n=Object.keys(r),i,a;for(a=0;a<n.length;a++)i=n[a],!(e.indexOf(i)>=0)&&(t[i]=r[i]);return t}function jme(r){var e,t=r.classNames,n=r.container,i=r.getEnvironmentProps,a=r.getFormProps,l=r.getInputProps,h=r.getItemProps,b=r.getLabelProps,k=r.getListProps,E=r.getPanelProps,O=r.getRootProps,L=r.panelContainer,q=r.panelPlacement,z=r.render,N=r.renderNoResults,V=r.renderer,K=r.detachedMediaQuery,Q=r.components,ae=lot(r,["classNames","container","getEnvironmentProps","getFormProps","getInputProps","getItemProps","getLabelProps","getListProps","getPanelProps","getRootProps","panelContainer","panelPlacement","render","renderNoResults","renderer","detachedMediaQuery","components"]),_=Zz(n);_.tagName;var pe=typeof window<"u"?window:{},ne=V??hot,de={Highlight:Ime(ne),ReverseHighlight:Lme(ne),ReverseSnippet:Rme(ne),Snippet:qme(ne)};return{renderer:{classNames:Spe(cot,t??{}),container:_,getEnvironmentProps:i??function(he){var be=he.props;return be},getFormProps:a??function(he){var be=he.props;return be},getInputProps:l??function(he){var be=he.props;return be},getItemProps:h??function(he){var be=he.props;return be},getLabelProps:b??function(he){var be=he.props;return be},getListProps:k??function(he){var be=he.props;return be},getPanelProps:E??function(he){var be=he.props;return be},getRootProps:O??function(he){var be=he.props;return be},panelContainer:L?Zz(L):document.body,panelPlacement:q??"input-wrapper-width",render:z??fot,renderNoResults:N,renderer:ne,detachedMediaQuery:K??getComputedStyle(pe.document.documentElement).getPropertyValue("--aa-detached-media-query"),components:G2(G2({},de),Q)},core:G2(G2({},ae),{},{id:(e=ae.id)!==null&&e!==void 0?e:E2(),environment:pe})}}var cot,fot,hot,Ume=Ue(()=>{Uv();lme();Bme();Hb();cot={clearButton:"aa-ClearButton",detachedCancelButton:"aa-DetachedCancelButton",detachedContainer:"aa-DetachedContainer",detachedFormContainer:"aa-DetachedFormContainer",detachedOverlay:"aa-DetachedOverlay",detachedSearchButton:"aa-DetachedSearchButton",detachedSearchButtonIcon:"aa-DetachedSearchButtonIcon",detachedSearchButtonPlaceholder:"aa-DetachedSearchButtonPlaceholder",form:"aa-Form",input:"aa-Input",inputWrapper:"aa-InputWrapper",inputWrapperPrefix:"aa-InputWrapperPrefix",inputWrapperSuffix:"aa-InputWrapperSuffix",item:"aa-Item",label:"aa-Label",list:"aa-List",loadingIndicator:"aa-LoadingIndicator",panel:"aa-Panel",panelLayout:"aa-PanelLayout",root:"aa-Autocomplete",source:"aa-Source",sourceFooter:"aa-SourceFooter",sourceHeader:"aa-SourceHeader",sourceNoResults:"aa-SourceNoResults",submitButton:"aa-SubmitButton"},fot=function(e,t){var n=e.children;sme(n,t)},hot={createElement:oB,Fragment:Wb}});function Hme(r){var e=r.panelPlacement,t=r.container,n=r.form,i=r.environment,a=t.getBoundingClientRect(),l=a.top+a.height;switch(e){case"start":return{top:l,left:a.left};case"end":return{top:l,right:i.document.documentElement.clientWidth-(a.left+a.width)};case"full-width":return{top:l,left:0,right:0,width:"unset",maxWidth:"unset"};case"input-wrapper-width":{var h=n.getBoundingClientRect();return{top:l,left:h.left,right:i.document.documentElement.clientWidth-(h.left+h.width),width:"unset",maxWidth:"unset"}}default:throw new Error("[Autocomplete] The `panelPlacement` value ".concat(JSON.stringify(e)," is not valid."))}}var Wme=Ue(()=>{});function K2(){return K2=Object.assign||function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},K2.apply(this,arguments)}function Vme(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Y2(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Vme(Object(t),!0).forEach(function(n){dot(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Vme(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function dot(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function $me(r){var e=r.autocomplete,t=r.autocompleteScopeApi,n=r.dom,i=r.propGetters,a=r.state;Qz(n.root,i.getRootProps(Y2({state:a,props:e.getRootProps({})},t))),Qz(n.input,i.getInputProps(Y2({state:a,props:e.getInputProps({inputElement:n.input}),inputElement:n.input},t))),Uf(n.label,{hidden:a.status==="stalled"}),Uf(n.loadingIndicator,{hidden:a.status!=="stalled"}),Uf(n.clearButton,{hidden:!a.query})}function Gme(r,e){var t=e.autocomplete,n=e.autocompleteScopeApi,i=e.classNames,a=e.createElement,l=e.dom,h=e.Fragment,b=e.panelContainer,k=e.propGetters,E=e.state,O=e.components;if(!E.isOpen){b.contains(l.panel)&&b.removeChild(l.panel);return}!b.contains(l.panel)&&E.status!=="loading"&&b.appendChild(l.panel),l.panel.classList.toggle("aa-Panel--stalled",E.status==="stalled");var L=E.collections.map(function(N,V){var K=N.source,Q=N.items;return a("section",{key:V,className:i.source,"data-autocomplete-source-id":K.sourceId},K.templates.header&&a("div",{className:i.sourceHeader},K.templates.header({components:O,createElement:a,Fragment:h,items:Q,source:K,state:E})),Q.length===0&&K.templates.noResults&&E.query?a("div",{className:i.sourceNoResults},K.templates.noResults({components:O,createElement:a,Fragment:h,source:K,state:E})):a("ul",K2({className:i.list},k.getListProps(Y2({state:E,props:t.getListProps({})},n))),Q.map(function(ae){var _=t.getItemProps({item:ae,source:K});return a("li",K2({key:_.id,className:i.item},k.getItemProps(Y2({state:E,props:_},n))),K.templates.item({components:O,createElement:a,Fragment:h,item:ae,state:E}))})),K.templates.footer&&a("div",{className:i.sourceFooter},K.templates.footer({components:O,createElement:a,Fragment:h,items:Q,source:K,state:E})))}),q=a(h,null,a("div",{className:"aa-PanelLayout aa-Panel--scrollable"},L),a("div",{className:"aa-GradientBottom"})),z=L.reduce(function(N,V){return N[V.props["data-autocomplete-source-id"]]=V,N},{});r({children:q,state:E,sections:L,elements:z,createElement:a,Fragment:h,components:O},l.panel)}var Kme=Ue(()=>{Hb()});function Yme(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Wv(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Yme(Object(t),!0).forEach(function(n){Zme(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Yme(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Zme(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Xme(r){var e=Hpe(),t=e.runEffect,n=e.cleanupEffects,i=e.runEffects,a=Vpe(),l=a.reactive,h=a.runReactives,b=Hw(!1),k=Hw(r),E=Hw(void 0),O=l(function(){return jme(k.current)}),L=l(function(){return O.value.core.environment.matchMedia(O.value.renderer.detachedMediaQuery).matches}),q=l(function(){return ope(Wv(Wv({},O.value.core),{},{onStateChange:function(de){var he,be,_e;b.current=de.state.collections.some(function(Ve){return Ve.source.templates.noResults}),(he=E.current)===null||he===void 0||he.call(E,de),(be=(_e=O.value.core).onStateChange)===null||be===void 0||be.call(_e,de)},shouldPanelOpen:k.current.shouldPanelOpen||function(ne){var de=ne.state,he=lg(de)>0;if(!O.value.core.openOnFocus&&!de.query)return he;var be=Boolean(b.current||O.value.renderer.renderNoResults);return!he&&be||he}}))}),z=Hw(Wv({collections:[],completion:null,context:{},isOpen:!1,query:"",activeItemId:null,status:"idle"},O.value.core.initialState)),N={getEnvironmentProps:O.value.renderer.getEnvironmentProps,getFormProps:O.value.renderer.getFormProps,getInputProps:O.value.renderer.getInputProps,getItemProps:O.value.renderer.getItemProps,getLabelProps:O.value.renderer.getLabelProps,getListProps:O.value.renderer.getListProps,getPanelProps:O.value.renderer.getPanelProps,getRootProps:O.value.renderer.getRootProps},V={setActiveItemId:q.value.setActiveItemId,setQuery:q.value.setQuery,setCollections:q.value.setCollections,setIsOpen:q.value.setIsOpen,setStatus:q.value.setStatus,setContext:q.value.setContext,refresh:q.value.refresh},K=l(function(){return jpe({autocomplete:q.value,autocompleteScopeApi:V,classNames:O.value.renderer.classNames,isDetached:L.value,placeholder:O.value.core.placeholder,propGetters:N,state:z.current})});function Q(){Uf(K.value.panel,{style:L.value?{}:Hme({panelPlacement:O.value.renderer.panelPlacement,container:K.value.root,form:K.value.form,environment:O.value.core.environment})})}function ae(ne){z.current=ne;var de={autocomplete:q.value,autocompleteScopeApi:V,classNames:O.value.renderer.classNames,components:O.value.renderer.components,container:O.value.renderer.container,createElement:O.value.renderer.renderer.createElement,dom:K.value,Fragment:O.value.renderer.renderer.Fragment,panelContainer:L.value?K.value.detachedContainer:O.value.renderer.panelContainer,propGetters:N,state:z.current},he=!lg(ne)&&!b.current&&O.value.renderer.renderNoResults||O.value.renderer.render;$me(de),Gme(he,de)}t(function(){var ne=q.value.getEnvironmentProps({formElement:K.value.form,panelElement:K.value.panel,inputElement:K.value.input});return Uf(O.value.core.environment,ne),function(){Uf(O.value.core.environment,Object.keys(ne).reduce(function(de,he){return Wv(Wv({},de),{},Zme({},he,void 0))},{}))}}),t(function(){var ne=L.value?O.value.core.environment.document.body:O.value.renderer.panelContainer,de=L.value?K.value.detachedOverlay:K.value.panel;return L.value&&z.current.isOpen&&K.value.openDetachedOverlay(),ae(z.current),function(){ne.contains(de)&&ne.removeChild(de)}}),t(function(){var ne=O.value.renderer.container;return ne.appendChild(K.value.root),function(){ne.removeChild(K.value.root)}}),t(function(){var ne=Uz(function(de){var he=de.state;ae(he)},0);return E.current=function(de){var he=de.state,be=de.prevState;if(he.isOpen&&!be.isOpen&&Q(),he.query!==be.query){var _e=document.querySelectorAll(".aa-Panel--scrollable");_e.forEach(function(Ve){Ve.scrollTop!==0&&(Ve.scrollTop=0)})}ne({state:he})},function(){E.current=void 0}}),t(function(){var ne=Uz(function(){var de=L.value;L.value=O.value.core.environment.matchMedia(O.value.renderer.detachedMediaQuery).matches,de!==L.value?pe({}):requestAnimationFrame(Q)},20);return O.value.core.environment.addEventListener("resize",ne),function(){O.value.core.environment.removeEventListener("resize",ne)}}),t(function(){if(!L.value)return function(){};function ne(be){K.value.detachedContainer.classList.toggle("aa-DetachedContainer--modal",be)}function de(be){ne(be.matches)}var he=O.value.core.environment.matchMedia(getComputedStyle(O.value.core.environment.document.documentElement).getPropertyValue("--aa-detached-modal-media-query"));return ne(he.matches),he.addEventListener("change",de),function(){he.removeEventListener("change",de)}}),t(function(){return requestAnimationFrame(Q),function(){}});function _(){n()}function pe(){var ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n(),k.current=Jz(O.value.renderer,O.value.core,{initialState:z.current},ne),h(),i(),q.value.refresh().then(function(){ae(z.current)})}return Wv(Wv({},V),{},{update:pe,destroy:_})}var Jme=Ue(()=>{_pe();Uv();Upe();Wpe();$pe();Ume();Wme();Kme();Hb()});var Qme,ege=Ue(()=>{Qme="1.0.0-alpha.46"});function tge(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function rge(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?tge(Object(t),!0).forEach(function(n){pot(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):tge(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function pot(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}var nge,ige=Ue(()=>{Vb();ege();nge=V2(function(r){return $2(rge(rge({},r),{},{userAgents:[{segment:"autocomplete-js",version:Qme}]}))})});var oge=Ue(()=>{});var sPt,age=Ue(()=>{ige();sPt=nge({transformResponse:function(e){return e.hits}})});var sge=Ue(()=>{oge();age()});var lge=Ue(()=>{});var uge=Ue(()=>{});var cge=Ue(()=>{});var fge=Ue(()=>{});var hge=Ue(()=>{});var dge=Ue(()=>{});var pge=Ue(()=>{});var mge=Ue(()=>{});var gge=Ue(()=>{});var vge=Ue(()=>{});var yge=Ue(()=>{});var bge=Ue(()=>{});var xge=Ue(()=>{});var _ge=Ue(()=>{lge();uge();cge();fge();hge();dge();pge();mge();gge();vge();yge();bge();xge()});var wge=Ue(()=>{Jme();sge();_ge()});var Sge,kge=Ue(()=>{Sge=(r,e)=>{let t;return(...n)=>(t&&clearTimeout(t),new Promise(i=>{t=setTimeout(()=>i(r(...n)),e)}))}});var Cge,Ege,Z2,Tge=Ue(()=>{Cge=So(AR());_i();YR();wge();Ege=So(yw());kge();Z2=class extends qr{constructor(){super(...arguments);Dr(this,"debouncedFetch",Sge(fetch,this.searchDebounce));Dr(this,"destroyMethod")}get dataset(){return this.autocompleteTarget.dataset}get searchDebounce(){return window.Avo.configuration.search_debounce}get translationKeys(){let r;try{r=JSON.parse(this.dataset.translationKeys)}catch(e){r={}}return r}get isBelongsToSearch(){return this.dataset.viaAssociation==="belongs_to"}get isHasManySearch(){return this.dataset.viaAssociation==="has_many"}get isGlobalSearch(){return this.dataset.searchResource==="global"}connect(){let r=this;this.buttonTarget.onclick=()=>this.showSearchPanel(),this.clearValueTargets.forEach(t=>{t.getAttribute("value")&&this.hasClearButtonTarget&&this.clearButtonTarget.classList.remove("hidden")}),this.isGlobalSearch&&Cge.bind(["command+k","ctrl+k"],()=>this.showSearchPanel()),this.autocompleteTarget.innerHTML="";let{destroy:e}=Xme({container:this.autocompleteTarget,placeholder:this.translationKeys.placeholder,translations:{detachedCancelButtonText:this.translationKeys.cancel_button},autoFocus:!0,openOnFocus:!0,detachedMediaQuery:"",getSources:({query:t})=>{document.body.classList.add("search-loading");let n=r.searchUrl(t);return r.debouncedFetch(n).then(i=>(document.body.classList.remove("search-loading"),i.json())).then(i=>Object.keys(i).map(a=>r.addSource(a,i[a])))}});this.destroyMethod=e,this.buttonTarget.dataset.shouldBeDisabled!=="true"&&this.buttonTarget.removeAttribute("disabled")}disconnect(){this.destroyMethod&&(this.destroyMethod(),this.destroyMethod=null)}addSource(r,e){let t=this;return{sourceId:r,getItems:()=>e.results,onSelect:t.handleOnSelect.bind(t),templates:{header(){return`${e.header.toUpperCase()} ${e.help}`},item({item:n,createElement:i}){let a=[];if(n._avatar){let h;switch(n._avatar_type){default:case"circle":h="rounded-full";break;case"rounded":h="rounded";break;case"square":h="rounded-none";break}a.push(i("img",{src:n._avatar,alt:n._label,class:`flex-shrink-0 w-8 h-8 my-[2px] inline mr-2 ${h}`}))}let l=[n._label];return n._description&&l.push(i("div",{class:"aa-ItemDescription"},n._description)),a.push(i("div",null,l)),i("div",{class:"flex"},a)},noResults(){return t.translationKeys.no_item_found.replace("%{item}",r)}}}}handleOnSelect({item:r}){this.isBelongsToSearch?(this.updateFieldAttribute(this.hiddenIdTarget,"value",r._id),this.updateFieldAttribute(this.buttonTarget,"value",r._label),document.querySelector(".aa-DetachedOverlay").remove(),this.hasClearButtonTarget&&this.clearButtonTarget.classList.remove("hidden")):fv.visit(r._url,{action:"advance"}),document.body.classList.remove("aa-Detached")}searchUrl(r){return(0,Ege.default)().segment([window.Avo.configuration.root_path,...this.searchSegments()]).search(this.searchParams(encodeURIComponent(r))).readable().toString()}searchSegments(){let r=["avo_api",this.dataset.searchResource,"search"];return this.isGlobalSearch&&(r=["avo_api","search"]),r}searchParams(r){let e={q:r,global:!1};return this.isGlobalSearch&&(e.global=!0),(this.isBelongsToSearch||this.isHasManySearch)&&(e=this.addAssociationParams(e),e=this.addReflectionParams(e),this.isBelongsToSearch&&(e=mm(kf({},e),{via_parent_resource_id:this.dataset.viaParentResourceId,via_parent_resource_class:this.dataset.viaParentResourceClass,via_relation:this.dataset.viaRelation}))),e}addAssociationParams(r){return r=mm(kf({},r),{via_association:this.dataset.viaAssociation,via_association_id:this.dataset.viaAssociationId}),r}addReflectionParams(r){return r=mm(kf({},r),{via_reflection_class:this.dataset.viaReflectionClass,via_reflection_id:this.dataset.viaReflectionId,via_reflection_view:this.dataset.viaReflectionView}),r}showSearchPanel(){this.autocompleteTarget.querySelector("button").click()}clearValue(){this.clearValueTargets.map(r=>this.updateFieldAttribute(r,"value","")),this.clearButtonTarget.classList.add("hidden")}updateFieldAttribute(r,e,t){r.setAttribute(e,t),r.dispatchEvent(new Event("input"))}};Dr(Z2,"targets",["autocomplete","button","hiddenId","visibleLabel","clearValue","clearButton"])});var Age,X2,Dge=Ue(()=>{_i();Age=So(yw()),X2=class extends qr{get parentTurboFrame(){return this.context.scope.element.closest("turbo-frame")}onChange(r){if(!this.parentTurboFrame.src)return;let e=new Age.default(this.parentTurboFrame.src);e.search(mm(kf({},e.query(!0)),{range:r.currentTarget.value})),this.parentTurboFrame.src=e.toString(),this.parentTurboFrame.reload()}};Dr(X2,"targets",["select"])});var J2,Oge=Ue(()=>{xb();J2=class extends af{getFilterValue(){return this.selectorTarget.value===""?null:this.selectorTarget.value}getFilterClass(){let{filterClass:r}=this.selectorTarget.dataset;return r}};Dr(J2,"targets",["selector"])});var wB,Ige=Ue(()=>{_i();wB=class extends qr{destroy(){this.context.element.remove()}}});async function CB(r,e=null){r.classList.remove("hidden"),await Mge("enter",r,e)}async function $b(r,e=null){await Mge("leave",r,e),r.classList.add("hidden")}async function Q2(r,e=null){r.classList.contains("hidden")?await CB(r,e):await $b(r,e)}async function Mge(r,e,t){let n=e.dataset,i=t?`${t}-${r}`:r,a=`transition${r.charAt(0).toUpperCase()+r.slice(1)}`,l=n[a]?n[a].split(" "):[i],h=n[`${a}Start`]?n[`${a}Start`].split(" "):[`${i}-start`],b=n[`${a}End`]?n[`${a}End`].split(" "):[`${i}-end`];SB(e,l),SB(e,h),await mot(),kB(e,h),SB(e,b),await got(e),kB(e,b),kB(e,l)}function SB(r,e){r.classList.add(...e)}function kB(r,e){r.classList.remove(...e)}function mot(){return new Promise(r=>{requestAnimationFrame(()=>{requestAnimationFrame(r)})})}function got(r){return new Promise(e=>{let t=getComputedStyle(r).transitionDuration.split(",")[0],n=Number(t.replace("s",""))*1e3;setTimeout(()=>{e()},n)})}var EB=Ue(()=>{});function eD(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)r[n]=t[n]}return r}function TB(r,e){function t(i,a,l){if(!(typeof document>"u")){l=eD({},e,l),typeof l.expires=="number"&&(l.expires=new Date(Date.now()+l.expires*864e5)),l.expires&&(l.expires=l.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var h="";for(var b in l)!l[b]||(h+="; "+b,l[b]!==!0&&(h+="="+l[b].split(";")[0]));return document.cookie=i+"="+r.write(a,i)+h}}function n(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var a=document.cookie?document.cookie.split("; "):[],l={},h=0;h<a.length;h++){var b=a[h].split("="),k=b.slice(1).join("=");try{var E=decodeURIComponent(b[0]);if(l[E]=r.read(k,E),i===E)break}catch{}}return i?l[i]:l}}return Object.create({set:t,get:n,remove:function(i,a){t(i,"",eD({},a,{expires:-1}))},withAttributes:function(i){return TB(this.converter,eD({},this.attributes,i))},withConverter:function(i){return TB(eD({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(r)}})}var vot,yot,Yw,Lge=Ue(()=>{vot={read:function(r){return r[0]==='"'&&(r=r.slice(1,-1)),r.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(r){return encodeURIComponent(r).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};yot=TB(vot,{path:"/"}),Yw=yot});var Zw,Pge=Ue(()=>{_i();EB();Lge();Zw=class extends qr{get cookieKey(){return`${window.Avo.configuration.cookies_key}.sidebar.open`}get sidebarOpen(){return Yw.get(this.cookieKey)==="1"}set cookie(r){Yw.set(this.cookieKey,r===!0?1:0)}markSidebarClosed(){Yw.set(this.cookieKey,"0"),this.openValue=!1,$b(this.sidebarTarget),this.mainAreaTarget.classList.remove("sidebar-open")}markSidebarOpen(){Yw.set(this.cookieKey,"1"),this.openValue=!0,CB(this.sidebarTarget),this.mainAreaTarget.classList.add("sidebar-open")}toggleSidebar(){this.openValue?this.markSidebarClosed():this.markSidebarOpen()}toggleSidebarOnMobile(){Q2(this.mobileSidebarTarget)}};Dr(Zw,"targets",["sidebar","mobileSidebar","mainArea"]),Dr(Zw,"values",{open:Boolean})});var Xw,Rge=Ue(()=>{_i();vb();Xw=class extends qr{get currentTab(){return this.tabPanelTargets.find(r=>r.dataset.tabId===this.activeTabValue)}targetTabPanel(r){return this.tabPanelTargets.find(e=>e.dataset.tabId===r)}changeTab(r){return Pg(this,null,function*(){r.preventDefault();let{params:e}=r,{id:t}=e;yield this.setTheTargetPanelHeight(t),this.hideAllTabs(),this.revealTab(t),this.markTabLoaded(t),this.activeTabValue=t})}setTheTargetPanelHeight(r){return Pg(this,null,function*(){if(this.viewValue==="edit"||this.viewValue==="new"||Wu(this.targetTabPanel(r).dataset.loaded))return;let{height:e}=this.currentTab.getBoundingClientRect();this.targetTabPanel(r).style.height=`${e}px`,yield this.targetTabPanel(r).loaded,this.targetTabPanel(r).style.height=""})}markTabLoaded(r){this.targetTabPanel(r).dataset.loaded=!0}revealTab(r){this.targetTabPanel(r).classList.remove("hidden")}hideAllTabs(){this.tabPanelTargets.map(r=>r.classList.add("hidden"))}};Dr(Xw,"targets",["tabPanel"]),Dr(Xw,"values",{view:String,activeTab:String})});var tD,Fge=Ue(()=>{xb();tD=class extends af{getFilterValue(){return this.textTarget.value}tryToSubmit(r){if(r.keyCode===13)return this.changeFilter()}getFilterClass(){let{filterClass:r}=this.textTarget.dataset;return r}};Dr(tD,"targets",["text"])});var rD,qge=Ue(()=>{_i();BE();rD=class extends qr{connect(){$0(this.sourceTarget,{content:this.contentTarget.innerHTML,allowHTML:!0,theme:"light"})}};Dr(rD,"targets",["source","content"])});function DB(r,e,t){r.addEventListener?r.addEventListener(e,t,!1):r.attachEvent&&r.attachEvent("on".concat(e),function(){t(window.event)})}function Uge(r,e){for(var t=e.slice(0,e.length-1),n=0;n<t.length;n++)t[n]=r[t[n].toLowerCase()];return t}function Hge(r){typeof r!="string"&&(r=""),r=r.replace(/\s/g,"");for(var e=r.split(","),t=e.lastIndexOf("");t>=0;)e[t-1]+=",",e.splice(t,1),t=e.lastIndexOf("");return e}function bot(r,e){for(var t=r.length>=e.length?r:e,n=r.length>=e.length?e:r,i=!0,a=0;a<t.length;a++)n.indexOf(t[a])===-1&&(i=!1);return i}function Gge(r){Vge=r||"all"}function Qw(){return Vge||"all"}function xot(){return Ta.slice(0)}function _ot(r){var e=r.target||r.srcElement,t=e.tagName,n=!0;return(e.isContentEditable||(t==="INPUT"||t==="TEXTAREA"||t==="SELECT")&&!e.readOnly)&&(n=!1),n}function wot(r){return typeof r=="string"&&(r=iD(r)),Ta.indexOf(r)!==-1}function Sot(r,e){var t,n;r||(r=Qw());for(var i in Al)if(Object.prototype.hasOwnProperty.call(Al,i))for(t=Al[i],n=0;n<t.length;)t[n].scope===r?t.splice(n,1):n++;Qw()===r&&Gge(e||"all")}function kot(r){var e=r.keyCode||r.which||r.charCode,t=Ta.indexOf(e);if(t>=0&&Ta.splice(t,1),r.key&&r.key.toLowerCase()==="meta"&&Ta.splice(0,Ta.length),(e===93||e===224)&&(e=91),e in Zl){Zl[e]=!1;for(var n in Vv)Vv[n]===e&&(hg[n]=!1)}}function Cot(r){if(!r)Object.keys(Al).forEach(function(l){return delete Al[l]});else if(Array.isArray(r))r.forEach(function(l){l.key&&OB(l)});else if(typeof r=="object")r.key&&OB(r);else if(typeof r=="string"){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];var i=t[0],a=t[1];typeof i=="function"&&(a=i,i=""),OB({key:r,scope:i,method:a,splitKey:"+"})}}function Bge(r,e,t){var n;if(e.scope===t||e.scope==="all"){n=e.mods.length>0;for(var i in Zl)Object.prototype.hasOwnProperty.call(Zl,i)&&(!Zl[i]&&e.mods.indexOf(+i)>-1||Zl[i]&&e.mods.indexOf(+i)===-1)&&(n=!1);(e.mods.length===0&&!Zl[16]&&!Zl[18]&&!Zl[17]&&!Zl[91]||n||e.shortcut==="*")&&e.method(r,e)===!1&&(r.preventDefault?r.preventDefault():r.returnValue=!1,r.stopPropagation&&r.stopPropagation(),r.cancelBubble&&(r.cancelBubble=!0))}}function Nge(r){var e=Al["*"],t=r.keyCode||r.which||r.charCode;if(!!hg.filter.call(this,r)){if((t===93||t===224)&&(t=91),Ta.indexOf(t)===-1&&t!==229&&Ta.push(t),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(q){var z=zge[q];r[q]&&Ta.indexOf(z)===-1?Ta.push(z):!r[q]&&Ta.indexOf(z)>-1?Ta.splice(Ta.indexOf(z),1):q==="metaKey"&&r[q]&&Ta.length===3&&(r.ctrlKey||r.shiftKey||r.altKey||(Ta=Ta.slice(Ta.indexOf(z))))}),t in Zl){Zl[t]=!0;for(var n in Vv)Vv[n]===t&&(hg[n]=!0);if(!e)return}for(var i in Zl)Object.prototype.hasOwnProperty.call(Zl,i)&&(Zl[i]=r[zge[i]]);r.getModifierState&&!(r.altKey&&!r.ctrlKey)&&r.getModifierState("AltGraph")&&(Ta.indexOf(17)===-1&&Ta.push(17),Ta.indexOf(18)===-1&&Ta.push(18),Zl[17]=!0,Zl[18]=!0);var a=Qw();if(e)for(var l=0;l<e.length;l++)e[l].scope===a&&(r.type==="keydown"&&e[l].keydown||r.type==="keyup"&&e[l].keyup)&&Bge(r,e[l],a);if(t in Al){for(var h=0;h<Al[t].length;h++)if((r.type==="keydown"&&Al[t][h].keydown||r.type==="keyup"&&Al[t][h].keyup)&&Al[t][h].key){for(var b=Al[t][h],k=b.splitKey,E=b.key.split(k),O=[],L=0;L<E.length;L++)O.push(iD(E[L]));O.sort().join("")===Ta.sort().join("")&&Bge(r,b,a)}}}}function Eot(r){return $ge.indexOf(r)>-1}function hg(r,e,t){Ta=[];var n=Hge(r),i=[],a="all",l=document,h=0,b=!1,k=!0,E="+";for(t===void 0&&typeof e=="function"&&(t=e),Object.prototype.toString.call(e)==="[object Object]"&&(e.scope&&(a=e.scope),e.element&&(l=e.element),e.keyup&&(b=e.keyup),e.keydown!==void 0&&(k=e.keydown),typeof e.splitKey=="string"&&(E=e.splitKey)),typeof e=="string"&&(a=e);h<n.length;h++)r=n[h].split(E),i=[],r.length>1&&(i=Uge(Vv,r)),r=r[r.length-1],r=r==="*"?"*":iD(r),r in Al||(Al[r]=[]),Al[r].push({keyup:b,keydown:k,scope:a,mods:i,shortcut:n[h],method:t,key:n[h],splitKey:E});typeof l<"u"&&!Eot(l)&&window&&($ge.push(l),DB(l,"keydown",function(O){Nge(O)}),DB(window,"focus",function(){Ta=[]}),DB(l,"keyup",function(O){Nge(O),kot(O)}))}var AB,Wge,Vv,zge,Zl,Al,Jw,Ta,Vge,$ge,iD,OB,IB,nD,jge,Kge=Ue(()=>{AB=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;Wge={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"\u21EA":20,",":188,".":190,"/":191,"`":192,"-":AB?173:189,"=":AB?61:187,";":AB?59:186,"'":222,"[":219,"]":221,"\\":220},Vv={"\u21E7":16,shift:16,"\u2325":18,alt:18,option:18,"\u2303":17,ctrl:17,control:17,"\u2318":91,cmd:91,command:91},zge={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},Zl={16:!1,18:!1,17:!1,91:!1},Al={};for(Jw=1;Jw<20;Jw++)Wge["f".concat(Jw)]=111+Jw;Ta=[],Vge="all",$ge=[],iD=function(e){return Wge[e.toLowerCase()]||Vv[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};OB=function(e){var t=e.key,n=e.scope,i=e.method,a=e.splitKey,l=a===void 0?"+":a,h=Hge(t);h.forEach(function(b){var k=b.split(l),E=k.length,O=k[E-1],L=O==="*"?"*":iD(O);if(!!Al[L]){n||(n=Qw());var q=E>1?Uge(Vv,k):[];Al[L]=Al[L].map(function(z){var N=i?z.method===i:!0;return N&&z.scope===n&&bot(z.mods,q)?{}:z})}})};IB={setScope:Gge,getScope:Qw,deleteScope:Sot,getPressedKeyCodes:xot,isPressed:wot,filter:_ot,unbind:Cot};for(nD in IB)Object.prototype.hasOwnProperty.call(IB,nD)&&(hg[nD]=IB[nD]);typeof window<"u"&&(jge=window.hotkeys,hg.noConflict=function(r){return r&&window.hotkeys===hg&&(window.hotkeys=jge),hg},window.hotkeys=hg)});function Dot(r){let e=r.getBoundingClientRect(),t=window.innerHeight||document.documentElement.clientHeight,n=window.innerWidth||document.documentElement.clientWidth,i=e.top<=t&&e.top+e.height>=0,a=e.left<=n&&e.left+e.width>=0;return i&&a}var Tot,Aot,Oot,Yge,Zge,Xge,Jge=Ue(()=>{_i();Kge();Tot=(r,e,t)=>{let n=r;return t===!0?n=`${e.identifier}:${r}`:typeof t=="string"&&(n=`${t}:${r}`),n},Aot=(r,e,t)=>{let{bubbles:n,cancelable:i,composed:a}=e||{bubbles:!0,cancelable:!0,composed:!0};return e&&Object.assign(t,{originalEvent:e}),new CustomEvent(r,{bubbles:n,cancelable:i,composed:a,detail:t})};Oot={events:["click","touchend"],onlyVisible:!0,dispatchEvent:!0,eventPrefix:!0},Yge=(r,e={})=>{let{onlyVisible:t,dispatchEvent:n,events:i,eventPrefix:a}=Object.assign({},Oot,e),l=E=>{let O=e?.element||r.element;if(!(O.contains(E.target)||!Dot(O)&&t)&&(r.clickOutside&&r.clickOutside(E),n)){let L=Tot("click:outside",r,a),q=Aot(L,E,{controller:r});O.dispatchEvent(q)}},h=()=>{i?.forEach(E=>{window.addEventListener(E,l,!1)})},b=()=>{i?.forEach(E=>{window.removeEventListener(E,l,!1)})},k=r.disconnect.bind(r);return Object.assign(r,{disconnect(){b(),k()}}),h(),[h,b]};Zge=class extends qr{};Zge.debounces=[];Xge=class extends qr{};Xge.throttles=[]});var eS,Qge=Ue(()=>{_i();EB();Jge();eS=class extends qr{get exemptionContainerTarget(){return document.querySelector(this.exemptionContainerValue)}connect(){Yge(this)}clickOutside(r){this.hasPanelTarget&&(this.hasExemptionContainerValue?this.exemptionContainerTarget.contains(r.target)||$b(this.panelTarget):$b(this.panelTarget))}togglePanel(){this.hasPanelTarget&&Q2(this.panelTarget)}outlet({params:r}){let{outlet:e}=r;e&&document.querySelector(e)&&document.querySelector(e).classList.toggle("hidden")}};Dr(eS,"targets",["panel"]),Dr(eS,"values",{exemptionContainer:String})});function tat(r){this.wrapped=r}function aD(r){var e,t;function n(a,l){try{var h=r[a](l),b=h.value,k=b instanceof tat;Promise.resolve(k?b.wrapped:b).then(function(E){k?n(a==="return"?"return":"next",E):i(h.done?"return":"normal",E)},function(E){n("throw",E)})}catch(E){i("throw",E)}}function i(a,l){switch(a){case"return":e.resolve({value:l,done:!0});break;case"throw":e.reject(l);break;default:e.resolve({value:l,done:!1})}(e=e.next)?n(e.key,e.arg):t=null}this._invoke=function(a,l){return new Promise(function(h,b){var k={key:a,arg:l,resolve:h,reject:b,next:null};t?t=t.next=k:(e=t=k,n(a,l))})},typeof r.return!="function"&&(this.return=void 0)}function hf(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}var rN,Oc,eve,tve,MB,uS,ei,Iot,Tve,Ave,nN,Mot,ja,iS,Dve,mg,iN,Gv,LB,gg,uD,Dc,wi,tS,oS,PB,Lot,rve,Kb,Pot,Yb,Kv,Ove,aS,oN,sD,Yv,Ive,YB,cS,xs,Rot,nve,Fot,RB,FB,qB,Qb,qot,zot,Bot,ZB,XB,Not,vg,Zv,aN,jot,Uot,zB,BB,NB,oD,JB,qs,Hot,QB,Wot,Mve,Vot,$ot,ive,ove,Lve,Pve,sN,Rve,fS,Co,$p,cD,ave,eN,lN,Got,Xv,Fve,Zb,qve,Kot,sve,nS,uN,cN,lve,jB,Ic,Yot,Zot,lD,rS,Xot,hD,zve,Bve,uve,sS,Qv,Nve,dg,fN,cve,Jot,jve,Uve,Hve,Qot,fve,Wve,dD,hve,eat,dve,yg,hN,ey,Jv,pD,lS,rat,nat,iat,Hf,zd,oat,aat,sat,lat,Vve,uat,pve,mve,gve,ff,vve,cat,fat,hat,dN,dat,UB,yve,ex,bve,pat,xve,mat,gat,vat,$ve,yat,bat,xat,_at,wat,rs,pN,mN,Vp,fD,Sat,gN,Gve,kat,vN,yN,HB,Cat,Eat,Kve,bN,pg,Yve,Tat,WB,$v,Aat,VB,xN,_N,wN,Dat,Oat,SN,tN,kN,Zve,Iat,Mat,_ve,hS,$B,Lat,Xve,Pat,qd,Rat,Fat,qat,zat,Wp,Xb,Bat,GB,Nat,jat,Uat,KB,Hat,Wat,Vat,wve,Sve,kve,Gb,CN,Jb,$at,Gat,Kat,EN,Yat,Zat,Xat,Jat,Qat,Cve,TN,Eve,Jve=Ue(()=>{rN={preview:{presentation:"gallery",caption:{name:!0,size:!0}},file:{caption:{size:!0}}},Oc={default:{tagName:"div",parse:!1},quote:{tagName:"blockquote",nestable:!0},heading1:{tagName:"h1",terminal:!0,breakOnReturn:!0,group:!1},code:{tagName:"pre",terminal:!0,text:{plaintext:!0}},bulletList:{tagName:"ul",parse:!1},bullet:{tagName:"li",listAttribute:"bulletList",group:!1,nestable:!0,test(r){return eve(r.parentNode)===Oc[this.listAttribute].tagName}},numberList:{tagName:"ol",parse:!1},number:{tagName:"li",listAttribute:"numberList",group:!1,nestable:!0,test(r){return eve(r.parentNode)===Oc[this.listAttribute].tagName}},attachmentGallery:{tagName:"div",exclusive:!0,terminal:!0,parse:!1,group:!1}},eve=r=>{var e;return r==null||(e=r.tagName)===null||e===void 0?void 0:e.toLowerCase()},tve=navigator.userAgent.match(/android\s([0-9]+.*Chrome)/i),MB=tve&&parseInt(tve[1]),uS={composesExistingText:/Android.*Chrome/.test(navigator.userAgent),recentAndroid:MB&&MB>12,samsungAndroid:MB&&navigator.userAgent.match(/Android.*SM-/),forcesObjectResizing:/Trident.*rv:11/.test(navigator.userAgent),supportsInputEvents:typeof InputEvent<"u"&&["data","getTargetRanges","inputType"].every(r=>r in InputEvent.prototype)},ei={attachFiles:"Attach Files",bold:"Bold",bullets:"Bullets",byte:"Byte",bytes:"Bytes",captionPlaceholder:"Add a caption\u2026",code:"Code",heading1:"Heading",indent:"Increase Level",italic:"Italic",link:"Link",numbers:"Numbers",outdent:"Decrease Level",quote:"Quote",redo:"Redo",remove:"Remove",strike:"Strikethrough",undo:"Undo",unlink:"Unlink",url:"URL",urlPlaceholder:"Enter a URL\u2026",GB:"GB",KB:"KB",MB:"MB",PB:"PB",TB:"TB"},Iot=[ei.bytes,ei.KB,ei.MB,ei.GB,ei.TB,ei.PB],Tve={prefix:"IEC",precision:2,formatter(r){switch(r){case 0:return"0 ".concat(ei.bytes);case 1:return"1 ".concat(ei.byte);default:let e;this.prefix==="SI"?e=1e3:this.prefix==="IEC"&&(e=1024);let t=Math.floor(Math.log(r)/Math.log(e)),n=(r/Math.pow(e,t)).toFixed(this.precision).replace(/0*$/,"").replace(/\.$/,"");return"".concat(n," ").concat(Iot[t])}}},Ave=function(r){for(let e in r){let t=r[e];this[e]=t}return this},nN=document.documentElement,Mot=nN.matches,ja=function(r){let{onElement:e,matchingSelector:t,withCallback:n,inPhase:i,preventDefault:a,times:l}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},h=e||nN,b=t,k=i==="capturing",E=function(O){l!=null&&--l==0&&E.destroy();let L=mg(O.target,{matchingSelector:b});L!=null&&(n?.call(L,O,L),a&&O.preventDefault())};return E.destroy=()=>h.removeEventListener(r,E,k),h.addEventListener(r,E,k),E},iS=function(r){let{onElement:e,bubbles:t,cancelable:n,attributes:i}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=e??nN;t=t!==!1,n=n!==!1;let l=document.createEvent("Events");return l.initEvent(r,t,n),i!=null&&Ave.call(l,i),a.dispatchEvent(l)},Dve=function(r,e){if(r?.nodeType===1)return Mot.call(r,e)},mg=function(r){let{matchingSelector:e,untilNode:t}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};for(;r&&r.nodeType!==Node.ELEMENT_NODE;)r=r.parentNode;if(r!=null){if(e==null)return r;if(r.closest&&t==null)return r.closest(e);for(;r&&r!==t;){if(Dve(r,e))return r;r=r.parentNode}}},iN=r=>document.activeElement!==r&&Gv(r,document.activeElement),Gv=function(r,e){if(r&&e)for(;e;){if(e===r)return!0;e=e.parentNode}},LB=function(r){var e;if((e=r)===null||e===void 0||!e.parentNode)return;let t=0;for(r=r.previousSibling;r;)t++,r=r.previousSibling;return t},gg=r=>{var e;return r==null||(e=r.parentNode)===null||e===void 0?void 0:e.removeChild(r)},uD=function(r){let{onlyNodesOfType:e,usingFilter:t,expandEntityReferences:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=(()=>{switch(e){case"element":return NodeFilter.SHOW_ELEMENT;case"text":return NodeFilter.SHOW_TEXT;case"comment":return NodeFilter.SHOW_COMMENT;default:return NodeFilter.SHOW_ALL}})();return document.createTreeWalker(r,i,t??null,n===!0)},Dc=r=>{var e;return r==null||(e=r.tagName)===null||e===void 0?void 0:e.toLowerCase()},wi=function(r){let e,t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};typeof r=="object"?(n=r,r=n.tagName):n={attributes:n};let i=document.createElement(r);if(n.editable!=null&&(n.attributes==null&&(n.attributes={}),n.attributes.contenteditable=n.editable),n.attributes)for(e in n.attributes)t=n.attributes[e],i.setAttribute(e,t);if(n.style)for(e in n.style)t=n.style[e],i.style[e]=t;if(n.data)for(e in n.data)t=n.data[e],i.dataset[e]=t;return n.className&&n.className.split(" ").forEach(a=>{i.classList.add(a)}),n.textContent&&(i.textContent=n.textContent),n.childNodes&&[].concat(n.childNodes).forEach(a=>{i.appendChild(a)}),i},oS=function(){if(tS!=null)return tS;tS=[];for(let r in Oc){let e=Oc[r];e.tagName&&tS.push(e.tagName)}return tS},PB=r=>Kb(r?.firstChild),Lot=function(r){return oS().includes(Dc(r))&&!oS().includes(Dc(r.firstChild))},rve=function(r){let{strict:e}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{strict:!0};return e?Kb(r):Kb(r)||!Kb(r.firstChild)&&Lot(r)},Kb=r=>Pot(r)&&r?.data==="block",Pot=r=>r?.nodeType===Node.COMMENT_NODE,Yb=function(r){let{name:e}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(r)return aS(r)?r.data==="\uFEFF"?!e||r.parentNode.dataset.trixCursorTarget===e:void 0:Yb(r.firstChild)},Kv=r=>Dve(r,"[data-trix-attachment]"),Ove=r=>aS(r)&&r?.data==="",aS=r=>r?.nodeType===Node.TEXT_NODE,oN={level2Enabled:!0,getLevel(){return this.level2Enabled&&uS.supportsInputEvents?2:0},pickFiles(r){let e=wi("input",{type:"file",multiple:!0,hidden:!0,id:this.fileInputId});e.addEventListener("change",()=>{r(e.files),gg(e)}),gg(document.getElementById(this.fileInputId)),document.body.appendChild(e),e.click()}},sD={removeBlankTableCells:!1,tableCellSeparator:" | ",tableRowSeparator:`
|
718
718
|
`},Yv={bold:{tagName:"strong",inheritable:!0,parser(r){let e=window.getComputedStyle(r);return e.fontWeight==="bold"||e.fontWeight>=600}},italic:{tagName:"em",inheritable:!0,parser:r=>window.getComputedStyle(r).fontStyle==="italic"},href:{groupTagName:"a",parser(r){let e="a:not(".concat("[data-trix-attachment]",")"),t=r.closest(e);if(t)return t.getAttribute("href")}},strike:{tagName:"del",inheritable:!0},frozen:{style:{backgroundColor:"highlight"}}},Ive={getDefaultHTML:()=>`<div class="trix-button-row">
|
719
719
|
<span class="trix-button-group trix-button-group--text-tools" data-trix-button-group="text-tools">
|
720
720
|
<button type="button" class="trix-button trix-button--icon trix-button--icon-bold" data-trix-attribute="bold" data-trix-key="b" title="`.concat(ei.bold,'" tabindex="-1">').concat(ei.bold,`</button>
|