alchemy_cms 7.1.0.pre.b1 → 7.1.0.pre.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +29 -0
- data/Gemfile +1 -1
- data/README.md +2 -2
- data/alchemy_cms.gemspec +1 -1
- data/app/assets/config/alchemy_manifest.js +3 -4
- data/app/assets/images/alchemy/missing-image.svg +1 -1
- data/app/assets/javascripts/alchemy/admin.js +0 -4
- data/app/assets/javascripts/alchemy/alchemy.link_dialog.js.coffee +4 -4
- data/app/assets/javascripts/tinymce/icons/remixicons/icons.js +93 -0
- data/app/assets/javascripts/tinymce/plugins/alchemy_link/plugin.min.js +37 -18
- data/app/assets/stylesheets/alchemy/_variables.scss +11 -3
- data/app/assets/stylesheets/alchemy/archive.scss +5 -2
- data/app/assets/stylesheets/alchemy/buttons.scss +5 -4
- data/app/assets/stylesheets/alchemy/dialogs.scss +1 -1
- data/app/assets/stylesheets/alchemy/elements.scss +4 -5
- data/app/assets/stylesheets/alchemy/filter_field.scss +5 -0
- data/app/assets/stylesheets/tinymce/skins/content/alchemy/content.min.scss +69 -0
- data/app/assets/stylesheets/tinymce/skins/skintool.json +38 -0
- data/app/assets/stylesheets/tinymce/skins/ui/alchemy/content.css +711 -0
- data/app/assets/stylesheets/tinymce/skins/ui/alchemy/content.inline.css +705 -0
- data/app/assets/stylesheets/tinymce/skins/ui/alchemy/content.inline.min.css +7 -0
- data/app/assets/stylesheets/tinymce/skins/ui/alchemy/content.min.css +7 -0
- data/app/assets/stylesheets/tinymce/skins/ui/alchemy/content.mobile.css +29 -0
- data/app/assets/stylesheets/tinymce/skins/ui/alchemy/content.mobile.min.css +7 -0
- data/app/assets/stylesheets/tinymce/skins/ui/alchemy/fonts/tinymce-mobile.woff +0 -0
- data/app/assets/stylesheets/tinymce/skins/ui/alchemy/skin.min.scss +3803 -0
- data/app/assets/stylesheets/tinymce/skins/ui/alchemy/skin.mobile.css +677 -0
- data/app/assets/stylesheets/tinymce/skins/ui/alchemy/skin.mobile.min.css +7 -0
- data/app/controllers/alchemy/admin/pages_controller.rb +9 -4
- data/app/helpers/alchemy/admin/base_helper.rb +23 -10
- data/app/helpers/alchemy/base_helper.rb +16 -1
- data/app/javascript/alchemy_admin/components/button.js +1 -1
- data/app/javascript/alchemy_admin/components/clipboard_button.js +27 -0
- data/app/javascript/alchemy_admin/components/element_editor.js +2 -2
- data/app/javascript/alchemy_admin/components/tinymce.js +9 -21
- data/app/javascript/alchemy_admin/picture_editors.js +4 -2
- data/app/javascript/alchemy_admin/utils/debounce.js +10 -0
- data/app/javascript/alchemy_admin/utils/max.js +3 -0
- data/app/javascript/alchemy_admin.js +4 -10
- data/app/models/alchemy/page/page_naming.rb +7 -0
- data/app/models/alchemy/page.rb +2 -2
- data/app/models/alchemy/picture_variant.rb +11 -2
- data/app/models/concerns/alchemy/picture_thumbnails.rb +1 -1
- data/app/views/alchemy/admin/attachments/show.html.erb +10 -19
- data/app/views/alchemy/admin/crop.html.erb +1 -1
- data/app/views/alchemy/admin/nodes/index.html.erb +1 -0
- data/app/views/alchemy/admin/partials/_toolbar_button.html.erb +0 -1
- data/app/views/alchemy/admin/pictures/_archive.html.erb +3 -3
- data/app/views/alchemy/admin/pictures/_archive_overlay.html.erb +16 -3
- data/app/views/alchemy/admin/pictures/_picture.html.erb +3 -5
- data/app/views/alchemy/admin/pictures/_picture_to_assign.html.erb +1 -1
- data/app/views/alchemy/admin/resources/_filter.html.erb +1 -1
- data/app/views/alchemy/admin/resources/_per_page_select.html.erb +1 -1
- data/app/views/alchemy/admin/tinymce/_setup.html.erb +1 -2
- data/app/views/alchemy/ingredients/shared/_picture_tools.html.erb +2 -2
- data/app/views/layouts/alchemy/admin.html.erb +1 -1
- data/bundles/shoelace.js +10 -0
- data/bundles/tinymce.js +20 -0
- data/config/alchemy/config.yml +11 -10
- data/config/brakeman.ignore +0 -34
- data/config/importmap.rb +9 -14
- data/config/initializers/dragonfly.rb +1 -0
- data/config/locales/alchemy.en.yml +2 -0
- data/eslint.config.js +17 -0
- data/lib/alchemy/config.rb +24 -2
- data/lib/alchemy/engine.rb +2 -1
- data/lib/alchemy/forms/builder.rb +7 -0
- data/lib/alchemy/test_support/capybara_helpers.rb +1 -1
- data/lib/alchemy/test_support/having_picture_thumbnails_examples.rb +6 -6
- data/lib/alchemy/tinymce.rb +13 -2
- data/lib/alchemy/version.rb +1 -1
- data/package.json +20 -6
- data/rollup.config.mjs +65 -0
- data/vendor/assets/stylesheets/tinymce/skins/content/default/content.min.css +1 -0
- data/vendor/javascript/clipboard.min.js +7 -0
- data/vendor/javascript/flatpickr.min.js +1 -0
- data/vendor/javascript/keymaster.min.js +1 -0
- data/vendor/javascript/rails-ujs.min.js +1 -0
- data/vendor/javascript/shoelace.min.js +995 -0
- data/vendor/javascript/sortable.min.js +7 -0
- data/vendor/javascript/tinymce.min.js +1 -0
- data/vendor/javascript/ungap-custom-elements.min.js +3 -0
- metadata +31 -39
- data/.codeclimate.yml +0 -35
- data/.editorconfig +0 -23
- data/.github/FUNDING.yml +0 -4
- data/.github/ISSUE_TEMPLATE/Bug_report.md +0 -22
- data/.github/ISSUE_TEMPLATE/Feature_request.md +0 -17
- data/.github/PULL_REQUEST_TEMPLATE.md +0 -18
- data/.github/workflows/backport.yml +0 -36
- data/.github/workflows/brakeman-analysis.yml +0 -46
- data/.github/workflows/lint.yml +0 -37
- data/.github/workflows/stale.yml +0 -33
- data/.github/workflows/test.yml +0 -125
- data/.gitignore +0 -32
- data/.hound.yml +0 -9
- data/.localeapp/config.rb +0 -8
- data/.prettierrc +0 -6
- data/.rspec +0 -1
- data/.rubocop.yml +0 -7
- data/.standard.yml +0 -4
- data/.yardopts +0 -5
- data/app/assets/stylesheets/tinymce/skins/alchemy/content.min.css.scss +0 -94
- data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce-small.svg +0 -63
- data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce-small.ttf +0 -0
- data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce-small.woff +0 -0
- data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce.svg +0 -129
- data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce.ttf +0 -0
- data/app/assets/stylesheets/tinymce/skins/alchemy/fonts/tinymce.woff +0 -0
- data/app/assets/stylesheets/tinymce/skins/alchemy/img/anchor.gif +0 -0
- data/app/assets/stylesheets/tinymce/skins/alchemy/img/loader.gif +0 -0
- data/app/assets/stylesheets/tinymce/skins/alchemy/img/object.gif +0 -0
- data/app/assets/stylesheets/tinymce/skins/alchemy/img/trans.gif +0 -0
- data/app/assets/stylesheets/tinymce/skins/alchemy/skin.min.css.scss +0 -2077
- data/app/views/alchemy/admin/pictures/_overlay_picture_list.html.erb +0 -10
- data/vendor/assets/javascripts/clipboard.min.js +0 -7
- data/vendor/assets/javascripts/keymaster.js +0 -296
- data/vendor/assets/javascripts/requestAnimationFrame.js +0 -31
- data/vendor/assets/javascripts/tinymce/license.txt +0 -504
- data/vendor/assets/javascripts/tinymce/tinymce.min.js +0 -2
data/bundles/tinymce.js
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
/* Import TinyMCE */
|
2
|
+
import tinymce from "tinymce"
|
3
|
+
|
4
|
+
/* Default icons are required. After that, import custom icons if applicable */
|
5
|
+
import "tinymce/icons/default"
|
6
|
+
|
7
|
+
/* Required TinyMCE components */
|
8
|
+
import "tinymce/themes/silver"
|
9
|
+
import "tinymce/models/dom"
|
10
|
+
|
11
|
+
/* Import plugins */
|
12
|
+
import "tinymce/plugins/anchor"
|
13
|
+
import "tinymce/plugins/charmap"
|
14
|
+
import "tinymce/plugins/code"
|
15
|
+
import "tinymce/plugins/directionality"
|
16
|
+
import "tinymce/plugins/fullscreen"
|
17
|
+
import "tinymce/plugins/link"
|
18
|
+
import "tinymce/plugins/lists"
|
19
|
+
|
20
|
+
export default tinymce
|
data/config/alchemy/config.yml
CHANGED
@@ -78,13 +78,13 @@ items_per_page: 15
|
|
78
78
|
#
|
79
79
|
# ==== Global Options:
|
80
80
|
#
|
81
|
-
#
|
81
|
+
# output_image_quality [Integer] # If image gets rendered as JPG or WebP this is the quality setting for it. (Default 85)
|
82
82
|
# preprocess_image_resize [String] # Use this option to resize images to the given size when they are uploaded to the image library. Downsizing example: '1000x1000>' (Default nil)
|
83
83
|
# image_output_format [String] # The global image output format setting. (Default +original+)
|
84
84
|
#
|
85
85
|
# NOTE: You can always override the output format in the settings of your ingredients in elements.yml, I.E. {format: 'gif'}
|
86
86
|
#
|
87
|
-
|
87
|
+
output_image_quality: 85
|
88
88
|
preprocess_image_resize:
|
89
89
|
image_output_format: original
|
90
90
|
|
@@ -133,7 +133,8 @@ mailer:
|
|
133
133
|
mail_from: your.mail@your-domain.com
|
134
134
|
mail_to: your.mail@your-domain.com
|
135
135
|
subject: A new contact form message
|
136
|
-
fields:
|
136
|
+
fields:
|
137
|
+
[salutation, firstname, lastname, address, zip, city, phone, email, message]
|
137
138
|
validate_fields: [lastname, email]
|
138
139
|
|
139
140
|
# === User roles
|
@@ -166,14 +167,14 @@ uploader:
|
|
166
167
|
file_size_limit: 100
|
167
168
|
allowed_filetypes:
|
168
169
|
alchemy/attachments:
|
169
|
-
|
170
|
+
- "*"
|
170
171
|
alchemy/pictures:
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
172
|
+
- jpg
|
173
|
+
- jpeg
|
174
|
+
- gif
|
175
|
+
- png
|
176
|
+
- svg
|
177
|
+
- webp
|
177
178
|
|
178
179
|
# === Link Target Options
|
179
180
|
#
|
data/config/brakeman.ignore
CHANGED
@@ -46,40 +46,6 @@
|
|
46
46
|
],
|
47
47
|
"note": "Because we actually can't know all attributes each inheriting controller supports, we permit all resource model params. It is adviced that all inheriting controllers implement this method and provide its own set of permitted attributes. As this all happens inside the password protected /admin namespace this can be considered a false positive."
|
48
48
|
},
|
49
|
-
{
|
50
|
-
"warning_type": "Dynamic Render Path",
|
51
|
-
"warning_code": 15,
|
52
|
-
"fingerprint": "384ec61125c6390d59fb7ebcf52792ba284bfd463d70d4ef552ab6c328e776f6",
|
53
|
-
"check_name": "Render",
|
54
|
-
"message": "Render path contains parameter value",
|
55
|
-
"file": "app/views/alchemy/admin/elements/fold.js.erb",
|
56
|
-
"line": 11,
|
57
|
-
"link": "https://brakemanscanner.org/docs/warning_types/dynamic_render_path/",
|
58
|
-
"code": "render(action => Alchemy::ElementEditor.new(Element.find(params[:id])), {})",
|
59
|
-
"render_path": [
|
60
|
-
{
|
61
|
-
"type": "controller",
|
62
|
-
"class": "Alchemy::Admin::ElementsController",
|
63
|
-
"method": "fold",
|
64
|
-
"line": 98,
|
65
|
-
"file": "app/controllers/alchemy/admin/elements_controller.rb",
|
66
|
-
"rendered": {
|
67
|
-
"name": "alchemy/admin/elements/fold",
|
68
|
-
"file": "app/views/alchemy/admin/elements/fold.js.erb"
|
69
|
-
}
|
70
|
-
}
|
71
|
-
],
|
72
|
-
"location": {
|
73
|
-
"type": "template",
|
74
|
-
"template": "alchemy/admin/elements/fold"
|
75
|
-
},
|
76
|
-
"user_input": "params[:id]",
|
77
|
-
"confidence": "Weak",
|
78
|
-
"cwe_id": [
|
79
|
-
22
|
80
|
-
],
|
81
|
-
"note": ""
|
82
|
-
},
|
83
49
|
{
|
84
50
|
"warning_type": "Cross-Site Scripting",
|
85
51
|
"warning_code": 4,
|
data/config/importmap.rb
CHANGED
@@ -1,17 +1,12 @@
|
|
1
|
-
pin "@ungap/custom-elements", to: "
|
2
|
-
pin "
|
3
|
-
pin "
|
4
|
-
pin "
|
5
|
-
pin "sortablejs", to: "
|
1
|
+
pin "@ungap/custom-elements", to: "ungap-custom-elements.min.js", preload: true # @1.3.0
|
2
|
+
pin "clipboard", to: "clipboard.min.js", preload: true
|
3
|
+
pin "flatpickr", to: "flatpickr.min.js", preload: true # @4.6.13
|
4
|
+
pin "keymaster", to: "keymaster.min.js", preload: true
|
5
|
+
pin "sortablejs", to: "sortable.min.js", preload: true # @1.15.1
|
6
6
|
pin "@hotwired/turbo-rails", to: "turbo.min.js", preload: true
|
7
|
-
pin "
|
8
|
-
pin "@
|
9
|
-
pin "
|
10
|
-
pin "@shoelace/tab-group", to: "https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.12.0/cdn/components/tab-group/tab-group.js", preload: true
|
11
|
-
pin "@shoelace/tab-panel", to: "https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.12.0/cdn/components/tab-panel/tab-panel.js", preload: true
|
12
|
-
pin "@shoelace/tooltip", to: "https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.12.0/cdn/components/tooltip/tooltip.js", preload: true
|
13
|
-
pin "@shoelace/progress-bar", to: "https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.12.0/cdn/components/progress-bar/progress-bar.js", preload: true
|
14
|
-
pin "@rails/ujs", to: "https://ga.jspm.io/npm:@rails/ujs@7.1.2/app/assets/javascripts/rails-ujs.esm.js"
|
7
|
+
pin "shoelace", to: "shoelace.min.js", preload: true
|
8
|
+
pin "@rails/ujs", to: "rails-ujs.min.js", preload: true # @7.1.2
|
9
|
+
pin "tinymce", to: "tinymce.min.js", preload: true
|
15
10
|
|
16
11
|
pin "alchemy_admin", to: "alchemy_admin.js", preload: true
|
17
|
-
pin_all_from File.expand_path("../app/javascript/alchemy_admin", __dir__), under: "alchemy_admin"
|
12
|
+
pin_all_from File.expand_path("../app/javascript/alchemy_admin", __dir__), under: "alchemy_admin", preload: true
|
@@ -16,6 +16,7 @@ end
|
|
16
16
|
|
17
17
|
# Dragonfly 1.4.0 only allows `quality` as argument to `encode`
|
18
18
|
Dragonfly::ImageMagick::Processors::Encode::WHITELISTED_ARGS << "flatten"
|
19
|
+
Dragonfly::ImageMagick::Processors::Encode::WHITELISTED_ARGS << "background"
|
19
20
|
|
20
21
|
Rails.application.config.after_initialize do
|
21
22
|
Dragonfly.app(:alchemy_pictures).add_processor(:crop_resize, Alchemy::Dragonfly::Processors::CropResize.new)
|
data/eslint.config.js
ADDED
data/lib/alchemy/config.rb
CHANGED
@@ -9,7 +9,8 @@ module Alchemy
|
|
9
9
|
#
|
10
10
|
def get(name)
|
11
11
|
check_deprecation(name)
|
12
|
-
|
12
|
+
key = check_replacement(name)
|
13
|
+
show[key.to_s]
|
13
14
|
end
|
14
15
|
|
15
16
|
alias_method :parameter, :get
|
@@ -27,13 +28,20 @@ module Alchemy
|
|
27
28
|
@config ||= merge_configs!(alchemy_config, main_app_config, env_specific_config)
|
28
29
|
end
|
29
30
|
|
30
|
-
# A list of deprecated
|
31
|
+
# A list of deprecated configuration values
|
31
32
|
# a value of nil means there is no new default
|
32
33
|
# any not nil value is the new default
|
33
34
|
def deprecated_configs
|
34
35
|
{}
|
35
36
|
end
|
36
37
|
|
38
|
+
# A list of replaced configuration keys
|
39
|
+
def replaced_config_keys
|
40
|
+
{
|
41
|
+
output_image_quality: :output_image_jpg_quality
|
42
|
+
}
|
43
|
+
end
|
44
|
+
|
37
45
|
private
|
38
46
|
|
39
47
|
# Alchemy default configuration
|
@@ -87,6 +95,20 @@ module Alchemy
|
|
87
95
|
end
|
88
96
|
end
|
89
97
|
end
|
98
|
+
|
99
|
+
def check_replacement(name)
|
100
|
+
if replaced_config_keys.key?(name.to_sym)
|
101
|
+
old_key = replaced_config_keys[name.to_sym]
|
102
|
+
if show[old_key.to_s]
|
103
|
+
Alchemy::Deprecation.warn("Using #{old_key} configuration is deprecated and will be removed in Alchemy #{Alchemy::Deprecation.deprecation_horizon}. Please use #{name} instead.")
|
104
|
+
old_key
|
105
|
+
else
|
106
|
+
name
|
107
|
+
end
|
108
|
+
else
|
109
|
+
name
|
110
|
+
end
|
111
|
+
end
|
90
112
|
end
|
91
113
|
end
|
92
114
|
end
|
data/lib/alchemy/engine.rb
CHANGED
@@ -24,7 +24,8 @@ module Alchemy
|
|
24
24
|
Alchemy.importmap.draw(Engine.root.join("config", "importmap.rb"))
|
25
25
|
|
26
26
|
package_path = Engine.root.join("app/javascript")
|
27
|
-
|
27
|
+
vendor_packages_path = Engine.root.join("vendor/javascript")
|
28
|
+
app.config.assets.paths += [package_path, vendor_packages_path]
|
28
29
|
|
29
30
|
if app.config.importmap.sweep_cache
|
30
31
|
Alchemy.importmap.cache_sweeper(watches: package_path)
|
@@ -43,6 +43,13 @@ module Alchemy
|
|
43
43
|
template.content_tag("alchemy-datepicker", date_field, type: type)
|
44
44
|
end
|
45
45
|
|
46
|
+
# Renders a simple_form input that displays a richtext editor
|
47
|
+
#
|
48
|
+
def richtext(attribute_name, options = {})
|
49
|
+
text_area = input(attribute_name, options.merge(as: :text))
|
50
|
+
template.content_tag("alchemy-tinymce", text_area)
|
51
|
+
end
|
52
|
+
|
46
53
|
# Renders a button tag wrapped in a div with 'submit' class.
|
47
54
|
#
|
48
55
|
def submit(label, options = {})
|
@@ -203,8 +203,8 @@ RSpec.shared_examples_for "having picture thumbnails" do
|
|
203
203
|
allow(record).to receive(:settings) { settings }
|
204
204
|
end
|
205
205
|
|
206
|
-
it "includes
|
207
|
-
expect(thumbnail_url).to match(/\.
|
206
|
+
it "includes webp file format." do
|
207
|
+
expect(thumbnail_url).to match(/\.webp/)
|
208
208
|
end
|
209
209
|
|
210
210
|
it "flattens the image." do
|
@@ -305,8 +305,8 @@ RSpec.shared_examples_for "having picture thumbnails" do
|
|
305
305
|
create(:alchemy_picture)
|
306
306
|
end
|
307
307
|
|
308
|
-
it "
|
309
|
-
expect(thumbnail_url_options[:format]).to eq("
|
308
|
+
it "uses webp image format." do
|
309
|
+
expect(thumbnail_url_options[:format]).to eq("webp")
|
310
310
|
end
|
311
311
|
|
312
312
|
it "flattens the image." do
|
@@ -381,7 +381,7 @@ RSpec.shared_examples_for "having picture thumbnails" do
|
|
381
381
|
crop_from: nil,
|
382
382
|
crop_size: nil,
|
383
383
|
flatten: true,
|
384
|
-
format: "
|
384
|
+
format: "webp",
|
385
385
|
size: "160x120"
|
386
386
|
)
|
387
387
|
end
|
@@ -400,7 +400,7 @@ RSpec.shared_examples_for "having picture thumbnails" do
|
|
400
400
|
crop_from: nil,
|
401
401
|
crop_size: nil,
|
402
402
|
flatten: true,
|
403
|
-
format: "
|
403
|
+
format: "webp",
|
404
404
|
size: "160x120"
|
405
405
|
)
|
406
406
|
end
|
data/lib/alchemy/tinymce.rb
CHANGED
@@ -4,14 +4,25 @@ module Alchemy
|
|
4
4
|
module Tinymce
|
5
5
|
mattr_accessor :languages, :plugins
|
6
6
|
|
7
|
-
DEFAULT_PLUGINS = %w[
|
7
|
+
DEFAULT_PLUGINS = %w[
|
8
|
+
anchor
|
9
|
+
charmap
|
10
|
+
code
|
11
|
+
directionality
|
12
|
+
fullscreen
|
13
|
+
link
|
14
|
+
lists
|
15
|
+
]
|
8
16
|
|
9
17
|
@@plugins = DEFAULT_PLUGINS + %w[alchemy_link]
|
10
18
|
@@init = {
|
11
19
|
skin: "alchemy",
|
20
|
+
content_css: "/assets/tinymce/skins/content/alchemy/content.min.css",
|
21
|
+
icons: "remixicons",
|
12
22
|
width: "auto",
|
13
23
|
resize: true,
|
14
|
-
min_height:
|
24
|
+
min_height: 250,
|
25
|
+
height: 250,
|
15
26
|
menubar: false,
|
16
27
|
statusbar: true,
|
17
28
|
toolbar: [
|
data/lib/alchemy/version.rb
CHANGED
data/package.json
CHANGED
@@ -2,24 +2,37 @@
|
|
2
2
|
"name": "alchemy_admin",
|
3
3
|
"scripts": {
|
4
4
|
"test": "jest",
|
5
|
-
"lint": "prettier --check 'app/javascript/**/*.js'"
|
5
|
+
"lint": "prettier --check 'app/javascript/**/*.js'",
|
6
|
+
"eslint": "eslint app/javascript/**/*.js",
|
7
|
+
"build": "rollup -c"
|
6
8
|
},
|
7
9
|
"keywords": [],
|
8
10
|
"author": "Thomas von Deyen",
|
9
11
|
"license": "BSD-3-Clause",
|
10
|
-
"dependencies": {
|
12
|
+
"dependencies": {
|
13
|
+
"@rails/ujs": "^7.1.2",
|
14
|
+
"@shoelace-style/shoelace": "^2.12.0",
|
15
|
+
"@ungap/custom-elements": "^1.3.0",
|
16
|
+
"clipboard": "^2.0.11",
|
17
|
+
"flatpickr": "^4.6.13",
|
18
|
+
"keymaster": "^1.6.2",
|
19
|
+
"sortablejs": "^1.15.1",
|
20
|
+
"tinymce": "^6.8.2"
|
21
|
+
},
|
11
22
|
"devDependencies": {
|
12
23
|
"@babel/core": "^7.22.11",
|
13
24
|
"@babel/preset-env": "^7.22.11",
|
25
|
+
"@rollup/plugin-commonjs": "^25.0.7",
|
26
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
27
|
+
"@rollup/plugin-terser": "^0.4.4",
|
14
28
|
"babel-jest": "^29.6.4",
|
15
|
-
"
|
29
|
+
"eslint": "^8.56.0",
|
16
30
|
"jest": "^29.6.4",
|
17
31
|
"jest-environment-jsdom": "^29.6.4",
|
18
32
|
"jquery": "^3.7.1",
|
19
33
|
"jsdom-testing-mocks": "^1.11.0",
|
20
|
-
"lodash-es": "^4.17.21",
|
21
34
|
"prettier": "^3.0.0",
|
22
|
-
"
|
35
|
+
"rollup": "^4.9.3",
|
23
36
|
"xhr-mock": "^2.5.1"
|
24
37
|
},
|
25
38
|
"jest": {
|
@@ -28,7 +41,8 @@
|
|
28
41
|
},
|
29
42
|
"moduleNameMapper": {
|
30
43
|
"alchemy_admin/(.*)": "<rootDir>/app/javascript/alchemy_admin/$1",
|
31
|
-
"
|
44
|
+
"assets/(.*)": "<rootDir>/vendor/assets/javascripts/$1",
|
45
|
+
"vendor/(.*)": "<rootDir>/vendor/javascript/$1"
|
32
46
|
},
|
33
47
|
"testEnvironment": "jsdom",
|
34
48
|
"roots": [
|
data/rollup.config.mjs
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
import resolve from "@rollup/plugin-node-resolve"
|
2
|
+
import commonjs from "@rollup/plugin-commonjs"
|
3
|
+
import terser from "@rollup/plugin-terser"
|
4
|
+
|
5
|
+
export default [
|
6
|
+
{
|
7
|
+
input: "node_modules/clipboard/dist/clipboard.min.js",
|
8
|
+
output: {
|
9
|
+
file: "vendor/javascript/clipboard.min.js"
|
10
|
+
},
|
11
|
+
context: "window"
|
12
|
+
},
|
13
|
+
{
|
14
|
+
input: "node_modules/flatpickr/dist/esm/index.js",
|
15
|
+
output: {
|
16
|
+
file: "vendor/javascript/flatpickr.min.js"
|
17
|
+
},
|
18
|
+
plugins: [resolve(), terser()],
|
19
|
+
context: "window"
|
20
|
+
},
|
21
|
+
{
|
22
|
+
input: "node_modules/keymaster/keymaster.js",
|
23
|
+
output: {
|
24
|
+
file: "vendor/javascript/keymaster.min.js"
|
25
|
+
},
|
26
|
+
plugins: [terser()],
|
27
|
+
context: "window"
|
28
|
+
},
|
29
|
+
{
|
30
|
+
input: "node_modules/sortablejs/modular/sortable.esm.js",
|
31
|
+
output: {
|
32
|
+
file: "vendor/javascript/sortable.min.js"
|
33
|
+
},
|
34
|
+
plugins: [terser()]
|
35
|
+
},
|
36
|
+
{
|
37
|
+
input: "node_modules/@ungap/custom-elements/min.js",
|
38
|
+
output: {
|
39
|
+
file: "vendor/javascript/ungap-custom-elements.min.js"
|
40
|
+
}
|
41
|
+
},
|
42
|
+
{
|
43
|
+
input: "node_modules/@rails/ujs/app/assets/javascripts/rails-ujs.esm.js",
|
44
|
+
output: {
|
45
|
+
file: "vendor/javascript/rails-ujs.min.js"
|
46
|
+
},
|
47
|
+
plugins: [terser()]
|
48
|
+
},
|
49
|
+
{
|
50
|
+
input: "bundles/shoelace.js",
|
51
|
+
output: {
|
52
|
+
file: "vendor/javascript/shoelace.min.js"
|
53
|
+
},
|
54
|
+
plugins: [resolve(), terser()]
|
55
|
+
},
|
56
|
+
{
|
57
|
+
input: "bundles/tinymce.js",
|
58
|
+
output: {
|
59
|
+
file: "vendor/javascript/tinymce.min.js",
|
60
|
+
name: "tinymce",
|
61
|
+
format: "esm"
|
62
|
+
},
|
63
|
+
plugins: [resolve(), commonjs(), terser()]
|
64
|
+
}
|
65
|
+
]
|
@@ -0,0 +1 @@
|
|
1
|
+
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;line-height:1.4;margin:1rem}table{border-collapse:collapse}table:not([cellpadding]) td,table:not([cellpadding]) th{padding:.4rem}table[border]:not([border="0"]):not([style*=border-width]) td,table[border]:not([border="0"]):not([style*=border-width]) th{border-width:1px}table[border]:not([border="0"]):not([style*=border-style]) td,table[border]:not([border="0"]):not([style*=border-style]) th{border-style:solid}table[border]:not([border="0"]):not([style*=border-color]) td,table[border]:not([border="0"]):not([style*=border-color]) th{border-color:#ccc}figure{display:table;margin:1rem auto}figure figcaption{color:#999;display:block;margin-top:.25rem;text-align:center}hr{border-color:#ccc;border-style:solid;border-width:1px 0 0 0}code{background-color:#e8e8e8;border-radius:3px;padding:.1rem .2rem}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #ccc;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #ccc;margin-right:1.5rem;padding-right:1rem}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
/*!
|
2
|
+
* clipboard.js v2.0.11
|
3
|
+
* https://clipboardjs.com/
|
4
|
+
*
|
5
|
+
* Licensed MIT © Zeno Rocha
|
6
|
+
*/
|
7
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e();}(window,function(){return n={686:function(t,e,n){n.d(e,{default:function(){return b}});var e=n(279),i=n.n(e),e=n(370),u=n.n(e),e=n(817),r=n.n(e);function c(t){try{return document.execCommand(t)}catch(t){return}}var a=function(t){t=r()(t);return c("cut"),t};function o(t,e){var n,o,t=(n=t,o="rtl"===document.documentElement.getAttribute("dir"),(t=document.createElement("textarea")).style.fontSize="12pt",t.style.border="0",t.style.padding="0",t.style.margin="0",t.style.position="absolute",t.style[o?"right":"left"]="-9999px",o=window.pageYOffset||document.documentElement.scrollTop,t.style.top="".concat(o,"px"),t.setAttribute("readonly",""),t.value=n,t);return e.container.appendChild(t),e=r()(t),c("copy"),t.remove(),e}var f=function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{container:document.body},n="";return "string"==typeof t?n=o(t,e):t instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(null==t?void 0:t.type)?n=o(t.value,e):(n=r()(t),c("copy")),n};function l(t){return (l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var s=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=t.action,n=void 0===e?"copy":e,o=t.container,e=t.target,t=t.text;if("copy"!==n&&"cut"!==n)throw new Error('Invalid "action" value, use either "copy" or "cut"');if(void 0!==e){if(!e||"object"!==l(e)||1!==e.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===n&&e.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===n&&(e.hasAttribute("readonly")||e.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes')}return t?f(t,{container:o}):e?"cut"===n?a(e):f(e,{container:o}):void 0};function p(t){return (p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function d(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o);}}function y(t,e){return (y=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function h(n){var o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return !1;if(Reflect.construct.sham)return !1;if("function"==typeof Proxy)return !0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return !1}}();return function(){var t,e=v(n);return t=o?(t=v(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments),e=this,!(t=t)||"object"!==p(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e):t}}function v(t){return (v=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function m(t,e){t="data-clipboard-".concat(t);if(e.hasAttribute(t))return e.getAttribute(t)}var b=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&y(t,e);}(r,i());var t,e,n,o=h(r);function r(t,e){var n;return function(t){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this),(n=o.call(this)).resolveOptions(e),n.listenClick(t),n}return t=r,n=[{key:"copy",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{container:document.body};return f(t,e)}},{key:"cut",value:function(t){return a(t)}},{key:"isSupported",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"==typeof t?[t]:t,e=!!document.queryCommandSupported;return t.forEach(function(t){e=e&&!!document.queryCommandSupported(t);}),e}}],(e=[{key:"resolveOptions",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText,this.container="object"===p(t.container)?t.container:document.body;}},{key:"listenClick",value:function(t){var e=this;this.listener=u()(t,"click",function(t){return e.onClick(t)});}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget,n=this.action(e)||"copy",t=s({action:n,container:this.container,target:this.target(e),text:this.text(e)});this.emit(t?"success":"error",{action:n,text:t,trigger:e,clearSelection:function(){e&&e.focus(),window.getSelection().removeAllRanges();}});}},{key:"defaultAction",value:function(t){return m("action",t)}},{key:"defaultTarget",value:function(t){t=m("target",t);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(t){return m("text",t)}},{key:"destroy",value:function(){this.listener.destroy();}}])&&d(t.prototype,e),n&&d(t,n),r}();},828:function(t){var e;"undefined"==typeof Element||Element.prototype.matches||((e=Element.prototype).matches=e.matchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector),t.exports=function(t,e){for(;t&&9!==t.nodeType;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode;}};},438:function(t,e,n){var u=n(828);function i(t,e,n,o,r){var i=function(e,n,t,o){return function(t){t.delegateTarget=u(t.target,n),t.delegateTarget&&o.call(e,t);}}.apply(this,arguments);return t.addEventListener(n,i,r),{destroy:function(){t.removeEventListener(n,i,r);}}}t.exports=function(t,e,n,o,r){return "function"==typeof t.addEventListener?i.apply(null,arguments):"function"==typeof n?i.bind(null,document).apply(null,arguments):("string"==typeof t&&(t=document.querySelectorAll(t)),Array.prototype.map.call(t,function(t){return i(t,e,n,o,r)}))};},879:function(t,n){n.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},n.nodeList=function(t){var e=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===e||"[object HTMLCollection]"===e)&&"length"in t&&(0===t.length||n.node(t[0]))},n.string=function(t){return "string"==typeof t||t instanceof String},n.fn=function(t){return "[object Function]"===Object.prototype.toString.call(t)};},370:function(t,e,n){var f=n(879),l=n(438);t.exports=function(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!f.string(e))throw new TypeError("Second argument must be a String");if(!f.fn(n))throw new TypeError("Third argument must be a Function");if(f.node(t))return c=e,a=n,(u=t).addEventListener(c,a),{destroy:function(){u.removeEventListener(c,a);}};if(f.nodeList(t))return o=t,r=e,i=n,Array.prototype.forEach.call(o,function(t){t.addEventListener(r,i);}),{destroy:function(){Array.prototype.forEach.call(o,function(t){t.removeEventListener(r,i);});}};if(f.string(t))return t=t,e=e,n=n,l(document.body,t,e,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList");var o,r,i,u,c,a;};},817:function(t){t.exports=function(t){var e,n="SELECT"===t.nodeName?(t.focus(),t.value):"INPUT"===t.nodeName||"TEXTAREA"===t.nodeName?((e=t.hasAttribute("readonly"))||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),e||t.removeAttribute("readonly"),t.value):(t.hasAttribute("contenteditable")&&t.focus(),n=window.getSelection(),(e=document.createRange()).selectNodeContents(t),n.removeAllRanges(),n.addRange(e),n.toString());return n};},279:function(t){function e(){}e.prototype={on:function(t,e,n){var o=this.e||(this.e={});return (o[t]||(o[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){var o=this;function r(){o.off(t,r),e.apply(n,arguments);}return r._=e,this.on(t,r,n)},emit:function(t){for(var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),o=0,r=n.length;o<r;o++)n[o].fn.apply(n[o].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),o=n[t],r=[];if(o&&e)for(var i=0,u=o.length;i<u;i++)o[i].fn!==e&&o[i].fn._!==e&&r.push(o[i]);return r.length?n[t]=r:delete n[t],this}},t.exports=e,t.exports.TinyEmitter=e;}},r={},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,{a:e}),e},o.d=function(t,e){for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]});},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o(686).default;function o(t){if(r[t])return r[t].exports;var e=r[t]={exports:{}};return n[t](e,e.exports,o),e.exports}var n,r;});
|
@@ -0,0 +1 @@
|
|
1
|
+
var e=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],n={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:"object"==typeof window&&-1===window.navigator.userAgent.indexOf("MSIE"),ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(e){return"undefined"!=typeof console&&console.warn(e)},getWeek:function(e){var n=new Date(e.getTime());n.setHours(0,0,0,0),n.setDate(n.getDate()+3-(n.getDay()+6)%7);var t=new Date(n.getFullYear(),0,4);return 1+Math.round(((n.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},t={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(e){var n=e%100;if(n>3&&n<21)return"th";switch(n%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},a=function(e,n){return void 0===n&&(n=2),("000"+e).slice(-1*n)},i=function(e){return!0===e?1:0};function o(e,n){var t;return function(){var a=this,i=arguments;clearTimeout(t),t=setTimeout((function(){return e.apply(a,i)}),n)}}var r=function(e){return e instanceof Array?e:[e]};function l(e,n,t){if(!0===t)return e.classList.add(n);e.classList.remove(n)}function c(e,n,t){var a=window.document.createElement(e);return n=n||"",t=t||"",a.className=n,void 0!==t&&(a.textContent=t),a}function s(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function d(e,n){return n(e)?e:e.parentNode?d(e.parentNode,n):void 0}function u(e,n){var t=c("div","numInputWrapper"),a=c("input","numInput "+e),i=c("span","arrowUp"),o=c("span","arrowDown");if(-1===navigator.userAgent.indexOf("MSIE 9.0")?a.type="number":(a.type="text",a.pattern="\\d*"),void 0!==n)for(var r in n)a.setAttribute(r,n[r]);return t.appendChild(a),t.appendChild(i),t.appendChild(o),t}function f(e){try{return"function"==typeof e.composedPath?e.composedPath()[0]:e.target}catch(n){return e.target}}var m=function(){},g=function(e,n,t){return t.months[n?"shorthand":"longhand"][e]},p={D:m,F:function(e,n,t){e.setMonth(t.months.longhand.indexOf(n))},G:function(e,n){e.setHours((e.getHours()>=12?12:0)+parseFloat(n))},H:function(e,n){e.setHours(parseFloat(n))},J:function(e,n){e.setDate(parseFloat(n))},K:function(e,n,t){e.setHours(e.getHours()%12+12*i(new RegExp(t.amPM[1],"i").test(n)))},M:function(e,n,t){e.setMonth(t.months.shorthand.indexOf(n))},S:function(e,n){e.setSeconds(parseFloat(n))},U:function(e,n){return new Date(1e3*parseFloat(n))},W:function(e,n,t){var a=parseInt(n),i=new Date(e.getFullYear(),0,2+7*(a-1),0,0,0,0);return i.setDate(i.getDate()-i.getDay()+t.firstDayOfWeek),i},Y:function(e,n){e.setFullYear(parseFloat(n))},Z:function(e,n){return new Date(n)},d:function(e,n){e.setDate(parseFloat(n))},h:function(e,n){e.setHours((e.getHours()>=12?12:0)+parseFloat(n))},i:function(e,n){e.setMinutes(parseFloat(n))},j:function(e,n){e.setDate(parseFloat(n))},l:m,m:function(e,n){e.setMonth(parseFloat(n)-1)},n:function(e,n){e.setMonth(parseFloat(n)-1)},s:function(e,n){e.setSeconds(parseFloat(n))},u:function(e,n){return new Date(parseFloat(n))},w:m,y:function(e,n){e.setFullYear(2e3+parseFloat(n))}},h={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},v={Z:function(e){return e.toISOString()},D:function(e,n,t){return n.weekdays.shorthand[v.w(e,n,t)]},F:function(e,n,t){return g(v.n(e,n,t)-1,!1,n)},G:function(e,n,t){return a(v.h(e,n,t))},H:function(e){return a(e.getHours())},J:function(e,n){return void 0!==n.ordinal?e.getDate()+n.ordinal(e.getDate()):e.getDate()},K:function(e,n){return n.amPM[i(e.getHours()>11)]},M:function(e,n){return g(e.getMonth(),!0,n)},S:function(e){return a(e.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,n,t){return t.getWeek(e)},Y:function(e){return a(e.getFullYear(),4)},d:function(e){return a(e.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(e){return a(e.getMinutes())},j:function(e){return e.getDate()},l:function(e,n){return n.weekdays.longhand[e.getDay()]},m:function(e){return a(e.getMonth()+1)},n:function(e){return e.getMonth()+1},s:function(e){return e.getSeconds()},u:function(e){return e.getTime()},w:function(e){return e.getDay()},y:function(e){return String(e.getFullYear()).substring(2)}},D=function(e){var a=e.config,i=void 0===a?n:a,o=e.l10n,r=void 0===o?t:o,l=e.isMobile,c=void 0!==l&&l;return function(e,n,t){var a=t||r;return void 0===i.formatDate||c?n.split("").map((function(n,t,o){return v[n]&&"\\"!==o[t-1]?v[n](e,a,i):"\\"!==n?n:""})).join(""):i.formatDate(e,n,a)}},w=function(e){var a=e.config,i=void 0===a?n:a,o=e.l10n,r=void 0===o?t:o;return function(e,t,a,o){if(0===e||e){var l,c=o||r,s=e;if(e instanceof Date)l=new Date(e.getTime());else if("string"!=typeof e&&void 0!==e.toFixed)l=new Date(e);else if("string"==typeof e){var d=t||(i||n).dateFormat,u=String(e).trim();if("today"===u)l=new Date,a=!0;else if(i&&i.parseDate)l=i.parseDate(e,d);else if(/Z$/.test(u)||/GMT$/.test(u))l=new Date(e);else{for(var f=void 0,m=[],g=0,v=0,D="";g<d.length;g++){var w=d[g],b="\\"===w,C="\\"===d[g-1]||b;if(h[w]&&!C){D+=h[w];var M=new RegExp(D).exec(e);M&&(f=!0)&&m["Y"!==w?"push":"unshift"]({fn:p[w],val:M[++v]})}else b||(D+=".")}l=i&&i.noCalendar?new Date((new Date).setHours(0,0,0,0)):new Date((new Date).getFullYear(),0,1,0,0,0,0),m.forEach((function(e){var n=e.fn,t=e.val;return l=n(l,t,c)||l})),l=f?l:void 0}}if(l instanceof Date&&!isNaN(l.getTime()))return!0===a&&l.setHours(0,0,0,0),l;i.errorHandler(new Error("Invalid date provided: "+s))}}};function b(e,n,t){return void 0===t&&(t=!0),!1!==t?new Date(e.getTime()).setHours(0,0,0,0)-new Date(n.getTime()).setHours(0,0,0,0):e.getTime()-n.getTime()}var C=function(e,n,t){return e>Math.min(n,t)&&e<Math.max(n,t)},M=function(e,n,t){return 3600*e+60*n+t},y=function(e){var n=Math.floor(e/3600),t=(e-3600*n)/60;return[n,t,e-3600*n-60*t]},x={DAY:864e5};function E(e){var n=e.defaultHour,t=e.defaultMinute,a=e.defaultSeconds;if(void 0!==e.minDate){var i=e.minDate.getHours(),o=e.minDate.getMinutes(),r=e.minDate.getSeconds();n<i&&(n=i),n===i&&t<o&&(t=o),n===i&&t===o&&a<r&&(a=e.minDate.getSeconds())}if(void 0!==e.maxDate){var l=e.maxDate.getHours(),c=e.maxDate.getMinutes();(n=Math.min(n,l))===l&&(t=Math.min(c,t)),n===l&&t===c&&(a=e.maxDate.getSeconds())}return{hours:n,minutes:t,seconds:a}}"function"!=typeof Object.assign&&(Object.assign=function(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];if(!e)throw TypeError("Cannot convert undefined or null to object");for(var a=function(n){n&&Object.keys(n).forEach((function(t){return e[t]=n[t]}))},i=0,o=n;i<o.length;i++){a(o[i])}return e});var k=window&&window.__assign||function(){return k=Object.assign||function(e){for(var n,t=1,a=arguments.length;t<a;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},k.apply(this,arguments)},T=window&&window.__spreadArrays||function(){for(var e=0,n=0,t=arguments.length;n<t;n++)e+=arguments[n].length;var a=Array(e),i=0;for(n=0;n<t;n++)for(var o=arguments[n],r=0,l=o.length;r<l;r++,i++)a[i]=o[r];return a},I=300;function S(m,p){var v={config:k(k({},n),O.defaultConfig),l10n:t};function S(){var e;return(null===(e=v.calendarContainer)||void 0===e?void 0:e.getRootNode()).activeElement||document.activeElement}function _(e){return e.bind(v)}function F(){var e=v.config;!1===e.weekNumbers&&1===e.showMonths||!0!==e.noCalendar&&window.requestAnimationFrame((function(){if(void 0!==v.calendarContainer&&(v.calendarContainer.style.visibility="hidden",v.calendarContainer.style.display="block"),void 0!==v.daysContainer){var n=(v.days.offsetWidth+1)*e.showMonths;v.daysContainer.style.width=n+"px",v.calendarContainer.style.width=n+(void 0!==v.weekWrapper?v.weekWrapper.offsetWidth:0)+"px",v.calendarContainer.style.removeProperty("visibility"),v.calendarContainer.style.removeProperty("display")}}))}function A(e){if(0===v.selectedDates.length){var n=void 0===v.config.minDate||b(new Date,v.config.minDate)>=0?new Date:new Date(v.config.minDate.getTime()),t=E(v.config);n.setHours(t.hours,t.minutes,t.seconds,n.getMilliseconds()),v.selectedDates=[n],v.latestSelectedDateObj=n}void 0!==e&&"blur"!==e.type&&function(e){e.preventDefault();var n="keydown"===e.type,t=f(e),o=t;void 0!==v.amPM&&t===v.amPM&&(v.amPM.textContent=v.l10n.amPM[i(v.amPM.textContent===v.l10n.amPM[0])]);var r=parseFloat(o.getAttribute("min")),l=parseFloat(o.getAttribute("max")),c=parseFloat(o.getAttribute("step")),s=parseInt(o.value,10),d=e.delta||(n?38===e.which?1:-1:0),u=s+c*d;if(void 0!==o.value&&2===o.value.length){var m=o===v.hourElement,g=o===v.minuteElement;u<r?(u=l+u+i(!m)+(i(m)&&i(!v.amPM)),g&&B(void 0,-1,v.hourElement)):u>l&&(u=o===v.hourElement?u-l-i(!v.amPM):r,g&&B(void 0,1,v.hourElement)),v.amPM&&m&&(1===c?u+s===23:Math.abs(u-s)>c)&&(v.amPM.textContent=v.l10n.amPM[i(v.amPM.textContent===v.l10n.amPM[0])]),o.value=a(u)}}(e);var o=v._input.value;N(),ke(),v._input.value!==o&&v._debouncedChange()}function N(){if(void 0!==v.hourElement&&void 0!==v.minuteElement){var e,n,t=(parseInt(v.hourElement.value.slice(-2),10)||0)%24,a=(parseInt(v.minuteElement.value,10)||0)%60,o=void 0!==v.secondElement?(parseInt(v.secondElement.value,10)||0)%60:0;void 0!==v.amPM&&(e=t,n=v.amPM.textContent,t=e%12+12*i(n===v.l10n.amPM[1]));var r=void 0!==v.config.minTime||v.config.minDate&&v.minDateHasTime&&v.latestSelectedDateObj&&0===b(v.latestSelectedDateObj,v.config.minDate,!0),l=void 0!==v.config.maxTime||v.config.maxDate&&v.maxDateHasTime&&v.latestSelectedDateObj&&0===b(v.latestSelectedDateObj,v.config.maxDate,!0);if(void 0!==v.config.maxTime&&void 0!==v.config.minTime&&v.config.minTime>v.config.maxTime){var c=M(v.config.minTime.getHours(),v.config.minTime.getMinutes(),v.config.minTime.getSeconds()),s=M(v.config.maxTime.getHours(),v.config.maxTime.getMinutes(),v.config.maxTime.getSeconds()),d=M(t,a,o);if(d>s&&d<c){var u=y(c);t=u[0],a=u[1],o=u[2]}}else{if(l){var f=void 0!==v.config.maxTime?v.config.maxTime:v.config.maxDate;(t=Math.min(t,f.getHours()))===f.getHours()&&(a=Math.min(a,f.getMinutes())),a===f.getMinutes()&&(o=Math.min(o,f.getSeconds()))}if(r){var m=void 0!==v.config.minTime?v.config.minTime:v.config.minDate;(t=Math.max(t,m.getHours()))===m.getHours()&&a<m.getMinutes()&&(a=m.getMinutes()),a===m.getMinutes()&&(o=Math.max(o,m.getSeconds()))}}Y(t,a,o)}}function P(e){var n=e||v.latestSelectedDateObj;n&&n instanceof Date&&Y(n.getHours(),n.getMinutes(),n.getSeconds())}function Y(e,n,t){void 0!==v.latestSelectedDateObj&&v.latestSelectedDateObj.setHours(e%24,n,t||0,0),v.hourElement&&v.minuteElement&&!v.isMobile&&(v.hourElement.value=a(v.config.time_24hr?e:(12+e)%12+12*i(e%12==0)),v.minuteElement.value=a(n),void 0!==v.amPM&&(v.amPM.textContent=v.l10n.amPM[i(e>=12)]),void 0!==v.secondElement&&(v.secondElement.value=a(t)))}function j(e){var n=f(e),t=parseInt(n.value)+(e.delta||0);(t/1e3>1||"Enter"===e.key&&!/[^\d]/.test(t.toString()))&&ae(t)}function H(e,n,t,a){return n instanceof Array?n.forEach((function(n){return H(e,n,t,a)})):e instanceof Array?e.forEach((function(e){return H(e,n,t,a)})):(e.addEventListener(n,t,a),void v._handlers.push({remove:function(){return e.removeEventListener(n,t,a)}}))}function L(){Ce("onChange")}function R(e,n){var t=void 0!==e?v.parseDate(e):v.latestSelectedDateObj||(v.config.minDate&&v.config.minDate>v.now?v.config.minDate:v.config.maxDate&&v.config.maxDate<v.now?v.config.maxDate:v.now),a=v.currentYear,i=v.currentMonth;try{void 0!==t&&(v.currentYear=t.getFullYear(),v.currentMonth=t.getMonth())}catch(e){e.message="Invalid date supplied: "+t,v.config.errorHandler(e)}n&&v.currentYear!==a&&(Ce("onYearChange"),z()),!n||v.currentYear===a&&v.currentMonth===i||Ce("onMonthChange"),v.redraw()}function W(e){var n=f(e);~n.className.indexOf("arrow")&&B(e,n.classList.contains("arrowUp")?1:-1)}function B(e,n,t){var a=e&&f(e),i=t||a&&a.parentNode&&a.parentNode.firstChild,o=Me("increment");o.delta=n,i&&i.dispatchEvent(o)}function J(e,n,t,a){var i=ie(n,!0),o=c("span",e,n.getDate().toString());return o.dateObj=n,o.$i=a,o.setAttribute("aria-label",v.formatDate(n,v.config.ariaDateFormat)),-1===e.indexOf("hidden")&&0===b(n,v.now)&&(v.todayDateElem=o,o.classList.add("today"),o.setAttribute("aria-current","date")),i?(o.tabIndex=-1,ye(n)&&(o.classList.add("selected"),v.selectedDateElem=o,"range"===v.config.mode&&(l(o,"startRange",v.selectedDates[0]&&0===b(n,v.selectedDates[0],!0)),l(o,"endRange",v.selectedDates[1]&&0===b(n,v.selectedDates[1],!0)),"nextMonthDay"===e&&o.classList.add("inRange")))):o.classList.add("flatpickr-disabled"),"range"===v.config.mode&&function(e){return!("range"!==v.config.mode||v.selectedDates.length<2)&&(b(e,v.selectedDates[0])>=0&&b(e,v.selectedDates[1])<=0)}(n)&&!ye(n)&&o.classList.add("inRange"),v.weekNumbers&&1===v.config.showMonths&&"prevMonthDay"!==e&&a%7==6&&v.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+v.config.getWeek(n)+"</span>"),Ce("onDayCreate",o),o}function K(e){e.focus(),"range"===v.config.mode&&ce(e)}function U(e){for(var n=e>0?0:v.config.showMonths-1,t=e>0?v.config.showMonths:-1,a=n;a!=t;a+=e)for(var i=v.daysContainer.children[a],o=e>0?0:i.children.length-1,r=e>0?i.children.length:-1,l=o;l!=r;l+=e){var c=i.children[l];if(-1===c.className.indexOf("hidden")&&ie(c.dateObj))return c}}function q(e,n){var t=S(),a=oe(t||document.body),i=void 0!==e?e:a?t:void 0!==v.selectedDateElem&&oe(v.selectedDateElem)?v.selectedDateElem:void 0!==v.todayDateElem&&oe(v.todayDateElem)?v.todayDateElem:U(n>0?1:-1);void 0===i?v._input.focus():a?function(e,n){for(var t=-1===e.className.indexOf("Month")?e.dateObj.getMonth():v.currentMonth,a=n>0?v.config.showMonths:-1,i=n>0?1:-1,o=t-v.currentMonth;o!=a;o+=i)for(var r=v.daysContainer.children[o],l=t-v.currentMonth===o?e.$i+n:n<0?r.children.length-1:0,c=r.children.length,s=l;s>=0&&s<c&&s!=(n>0?c:-1);s+=i){var d=r.children[s];if(-1===d.className.indexOf("hidden")&&ie(d.dateObj)&&Math.abs(e.$i-s)>=Math.abs(n))return K(d)}v.changeMonth(i),q(U(i),0)}(i,n):K(i)}function $(e,n){for(var t=(new Date(e,n,1).getDay()-v.l10n.firstDayOfWeek+7)%7,a=v.utils.getDaysInMonth((n-1+12)%12,e),i=v.utils.getDaysInMonth(n,e),o=window.document.createDocumentFragment(),r=v.config.showMonths>1,l=r?"prevMonthDay hidden":"prevMonthDay",s=r?"nextMonthDay hidden":"nextMonthDay",d=a+1-t,u=0;d<=a;d++,u++)o.appendChild(J("flatpickr-day "+l,new Date(e,n-1,d),0,u));for(d=1;d<=i;d++,u++)o.appendChild(J("flatpickr-day",new Date(e,n,d),0,u));for(var f=i+1;f<=42-t&&(1===v.config.showMonths||u%7!=0);f++,u++)o.appendChild(J("flatpickr-day "+s,new Date(e,n+1,f%i),0,u));var m=c("div","dayContainer");return m.appendChild(o),m}function V(){if(void 0!==v.daysContainer){s(v.daysContainer),v.weekNumbers&&s(v.weekNumbers);for(var e=document.createDocumentFragment(),n=0;n<v.config.showMonths;n++){var t=new Date(v.currentYear,v.currentMonth,1);t.setMonth(v.currentMonth+n),e.appendChild($(t.getFullYear(),t.getMonth()))}v.daysContainer.appendChild(e),v.days=v.daysContainer.firstChild,"range"===v.config.mode&&1===v.selectedDates.length&&ce()}}function z(){if(!(v.config.showMonths>1||"dropdown"!==v.config.monthSelectorType)){var e=function(e){return!(void 0!==v.config.minDate&&v.currentYear===v.config.minDate.getFullYear()&&e<v.config.minDate.getMonth())&&!(void 0!==v.config.maxDate&&v.currentYear===v.config.maxDate.getFullYear()&&e>v.config.maxDate.getMonth())};v.monthsDropdownContainer.tabIndex=-1,v.monthsDropdownContainer.innerHTML="";for(var n=0;n<12;n++)if(e(n)){var t=c("option","flatpickr-monthDropdown-month");t.value=new Date(v.currentYear,n).getMonth().toString(),t.textContent=g(n,v.config.shorthandCurrentMonth,v.l10n),t.tabIndex=-1,v.currentMonth===n&&(t.selected=!0),v.monthsDropdownContainer.appendChild(t)}}}function G(){var e,n=c("div","flatpickr-month"),t=window.document.createDocumentFragment();v.config.showMonths>1||"static"===v.config.monthSelectorType?e=c("span","cur-month"):(v.monthsDropdownContainer=c("select","flatpickr-monthDropdown-months"),v.monthsDropdownContainer.setAttribute("aria-label",v.l10n.monthAriaLabel),H(v.monthsDropdownContainer,"change",(function(e){var n=f(e),t=parseInt(n.value,10);v.changeMonth(t-v.currentMonth),Ce("onMonthChange")})),z(),e=v.monthsDropdownContainer);var a=u("cur-year",{tabindex:"-1"}),i=a.getElementsByTagName("input")[0];i.setAttribute("aria-label",v.l10n.yearAriaLabel),v.config.minDate&&i.setAttribute("min",v.config.minDate.getFullYear().toString()),v.config.maxDate&&(i.setAttribute("max",v.config.maxDate.getFullYear().toString()),i.disabled=!!v.config.minDate&&v.config.minDate.getFullYear()===v.config.maxDate.getFullYear());var o=c("div","flatpickr-current-month");return o.appendChild(e),o.appendChild(a),t.appendChild(o),n.appendChild(t),{container:n,yearElement:i,monthElement:e}}function Z(){s(v.monthNav),v.monthNav.appendChild(v.prevMonthNav),v.config.showMonths&&(v.yearElements=[],v.monthElements=[]);for(var e=v.config.showMonths;e--;){var n=G();v.yearElements.push(n.yearElement),v.monthElements.push(n.monthElement),v.monthNav.appendChild(n.container)}v.monthNav.appendChild(v.nextMonthNav)}function Q(){v.weekdayContainer?s(v.weekdayContainer):v.weekdayContainer=c("div","flatpickr-weekdays");for(var e=v.config.showMonths;e--;){var n=c("div","flatpickr-weekdaycontainer");v.weekdayContainer.appendChild(n)}return X(),v.weekdayContainer}function X(){if(v.weekdayContainer){var e=v.l10n.firstDayOfWeek,n=T(v.l10n.weekdays.shorthand);e>0&&e<n.length&&(n=T(n.splice(e,n.length),n.splice(0,e)));for(var t=v.config.showMonths;t--;)v.weekdayContainer.children[t].innerHTML="\n <span class='flatpickr-weekday'>\n "+n.join("</span><span class='flatpickr-weekday'>")+"\n </span>\n "}}function ee(e,n){void 0===n&&(n=!0);var t=n?e:e-v.currentMonth;t<0&&!0===v._hidePrevMonthArrow||t>0&&!0===v._hideNextMonthArrow||(v.currentMonth+=t,(v.currentMonth<0||v.currentMonth>11)&&(v.currentYear+=v.currentMonth>11?1:-1,v.currentMonth=(v.currentMonth+12)%12,Ce("onYearChange"),z()),V(),Ce("onMonthChange"),xe())}function ne(e){return v.calendarContainer.contains(e)}function te(e){if(v.isOpen&&!v.config.inline){var n=f(e),t=ne(n),a=!(n===v.input||n===v.altInput||v.element.contains(n)||e.path&&e.path.indexOf&&(~e.path.indexOf(v.input)||~e.path.indexOf(v.altInput)))&&!t&&!ne(e.relatedTarget),i=!v.config.ignoredFocusElements.some((function(e){return e.contains(n)}));a&&i&&(v.config.allowInput&&v.setDate(v._input.value,!1,v.config.altInput?v.config.altFormat:v.config.dateFormat),void 0!==v.timeContainer&&void 0!==v.minuteElement&&void 0!==v.hourElement&&""!==v.input.value&&void 0!==v.input.value&&A(),v.close(),v.config&&"range"===v.config.mode&&1===v.selectedDates.length&&v.clear(!1))}}function ae(e){if(!(!e||v.config.minDate&&e<v.config.minDate.getFullYear()||v.config.maxDate&&e>v.config.maxDate.getFullYear())){var n=e,t=v.currentYear!==n;v.currentYear=n||v.currentYear,v.config.maxDate&&v.currentYear===v.config.maxDate.getFullYear()?v.currentMonth=Math.min(v.config.maxDate.getMonth(),v.currentMonth):v.config.minDate&&v.currentYear===v.config.minDate.getFullYear()&&(v.currentMonth=Math.max(v.config.minDate.getMonth(),v.currentMonth)),t&&(v.redraw(),Ce("onYearChange"),z())}}function ie(e,n){var t;void 0===n&&(n=!0);var a=v.parseDate(e,void 0,n);if(v.config.minDate&&a&&b(a,v.config.minDate,void 0!==n?n:!v.minDateHasTime)<0||v.config.maxDate&&a&&b(a,v.config.maxDate,void 0!==n?n:!v.maxDateHasTime)>0)return!1;if(!v.config.enable&&0===v.config.disable.length)return!0;if(void 0===a)return!1;for(var i=!!v.config.enable,o=null!==(t=v.config.enable)&&void 0!==t?t:v.config.disable,r=0,l=void 0;r<o.length;r++){if("function"==typeof(l=o[r])&&l(a))return i;if(l instanceof Date&&void 0!==a&&l.getTime()===a.getTime())return i;if("string"==typeof l){var c=v.parseDate(l,void 0,!0);return c&&c.getTime()===a.getTime()?i:!i}if("object"==typeof l&&void 0!==a&&l.from&&l.to&&a.getTime()>=l.from.getTime()&&a.getTime()<=l.to.getTime())return i}return!i}function oe(e){return void 0!==v.daysContainer&&(-1===e.className.indexOf("hidden")&&-1===e.className.indexOf("flatpickr-disabled")&&v.daysContainer.contains(e))}function re(e){var n=e.target===v._input,t=v._input.value.trimEnd()!==Ee();!n||!t||e.relatedTarget&&ne(e.relatedTarget)||v.setDate(v._input.value,!0,e.target===v.altInput?v.config.altFormat:v.config.dateFormat)}function le(e){var n=f(e),t=v.config.wrap?m.contains(n):n===v._input,a=v.config.allowInput,i=v.isOpen&&(!a||!t),o=v.config.inline&&t&&!a;if(13===e.keyCode&&t){if(a)return v.setDate(v._input.value,!0,n===v.altInput?v.config.altFormat:v.config.dateFormat),v.close(),n.blur();v.open()}else if(ne(n)||i||o){var r=!!v.timeContainer&&v.timeContainer.contains(n);switch(e.keyCode){case 13:r?(e.preventDefault(),A(),pe()):he(e);break;case 27:e.preventDefault(),pe();break;case 8:case 46:t&&!v.config.allowInput&&(e.preventDefault(),v.clear());break;case 37:case 39:if(r||t)v.hourElement&&v.hourElement.focus();else{e.preventDefault();var l=S();if(void 0!==v.daysContainer&&(!1===a||l&&oe(l))){var c=39===e.keyCode?1:-1;e.ctrlKey?(e.stopPropagation(),ee(c),q(U(1),0)):q(void 0,c)}}break;case 38:case 40:e.preventDefault();var s=40===e.keyCode?1:-1;v.daysContainer&&void 0!==n.$i||n===v.input||n===v.altInput?e.ctrlKey?(e.stopPropagation(),ae(v.currentYear-s),q(U(1),0)):r||q(void 0,7*s):n===v.currentYearElement?ae(v.currentYear-s):v.config.enableTime&&(!r&&v.hourElement&&v.hourElement.focus(),A(e),v._debouncedChange());break;case 9:if(r){var d=[v.hourElement,v.minuteElement,v.secondElement,v.amPM].concat(v.pluginElements).filter((function(e){return e})),u=d.indexOf(n);if(-1!==u){var g=d[u+(e.shiftKey?-1:1)];e.preventDefault(),(g||v._input).focus()}}else!v.config.noCalendar&&v.daysContainer&&v.daysContainer.contains(n)&&e.shiftKey&&(e.preventDefault(),v._input.focus())}}if(void 0!==v.amPM&&n===v.amPM)switch(e.key){case v.l10n.amPM[0].charAt(0):case v.l10n.amPM[0].charAt(0).toLowerCase():v.amPM.textContent=v.l10n.amPM[0],N(),ke();break;case v.l10n.amPM[1].charAt(0):case v.l10n.amPM[1].charAt(0).toLowerCase():v.amPM.textContent=v.l10n.amPM[1],N(),ke()}(t||ne(n))&&Ce("onKeyDown",e)}function ce(e,n){if(void 0===n&&(n="flatpickr-day"),1===v.selectedDates.length&&(!e||e.classList.contains(n)&&!e.classList.contains("flatpickr-disabled"))){for(var t=e?e.dateObj.getTime():v.days.firstElementChild.dateObj.getTime(),a=v.parseDate(v.selectedDates[0],void 0,!0).getTime(),i=Math.min(t,v.selectedDates[0].getTime()),o=Math.max(t,v.selectedDates[0].getTime()),r=!1,l=0,c=0,s=i;s<o;s+=x.DAY)ie(new Date(s),!0)||(r=r||s>i&&s<o,s<a&&(!l||s>l)?l=s:s>a&&(!c||s<c)&&(c=s));Array.from(v.rContainer.querySelectorAll("*:nth-child(-n+"+v.config.showMonths+") > ."+n)).forEach((function(n){var i=n.dateObj.getTime(),o=l>0&&i<l||c>0&&i>c;if(o)return n.classList.add("notAllowed"),void["inRange","startRange","endRange"].forEach((function(e){n.classList.remove(e)}));r&&!o||(["startRange","inRange","endRange","notAllowed"].forEach((function(e){n.classList.remove(e)})),void 0!==e&&(e.classList.add(t<=v.selectedDates[0].getTime()?"startRange":"endRange"),a<t&&i===a?n.classList.add("startRange"):a>t&&i===a&&n.classList.add("endRange"),i>=l&&(0===c||i<=c)&&C(i,a,t)&&n.classList.add("inRange")))}))}}function se(){!v.isOpen||v.config.static||v.config.inline||me()}function de(e){return function(n){var t=v.config["_"+e+"Date"]=v.parseDate(n,v.config.dateFormat),a=v.config["_"+("min"===e?"max":"min")+"Date"];void 0!==t&&(v["min"===e?"minDateHasTime":"maxDateHasTime"]=t.getHours()>0||t.getMinutes()>0||t.getSeconds()>0),v.selectedDates&&(v.selectedDates=v.selectedDates.filter((function(e){return ie(e)})),v.selectedDates.length||"min"!==e||P(t),ke()),v.daysContainer&&(ge(),void 0!==t?v.currentYearElement[e]=t.getFullYear().toString():v.currentYearElement.removeAttribute(e),v.currentYearElement.disabled=!!a&&void 0!==t&&a.getFullYear()===t.getFullYear())}}function ue(){return v.config.wrap?m.querySelector("[data-input]"):m}function fe(){"object"!=typeof v.config.locale&&void 0===O.l10ns[v.config.locale]&&v.config.errorHandler(new Error("flatpickr: invalid locale "+v.config.locale)),v.l10n=k(k({},O.l10ns.default),"object"==typeof v.config.locale?v.config.locale:"default"!==v.config.locale?O.l10ns[v.config.locale]:void 0),h.D="("+v.l10n.weekdays.shorthand.join("|")+")",h.l="("+v.l10n.weekdays.longhand.join("|")+")",h.M="("+v.l10n.months.shorthand.join("|")+")",h.F="("+v.l10n.months.longhand.join("|")+")",h.K="("+v.l10n.amPM[0]+"|"+v.l10n.amPM[1]+"|"+v.l10n.amPM[0].toLowerCase()+"|"+v.l10n.amPM[1].toLowerCase()+")",void 0===k(k({},p),JSON.parse(JSON.stringify(m.dataset||{}))).time_24hr&&void 0===O.defaultConfig.time_24hr&&(v.config.time_24hr=v.l10n.time_24hr),v.formatDate=D(v),v.parseDate=w({config:v.config,l10n:v.l10n})}function me(e){if("function"!=typeof v.config.position){if(void 0!==v.calendarContainer){Ce("onPreCalendarPosition");var n=e||v._positionElement,t=Array.prototype.reduce.call(v.calendarContainer.children,(function(e,n){return e+n.offsetHeight}),0),a=v.calendarContainer.offsetWidth,i=v.config.position.split(" "),o=i[0],r=i.length>1?i[1]:null,c=n.getBoundingClientRect(),s=window.innerHeight-c.bottom,d="above"===o||"below"!==o&&s<t&&c.top>t,u=window.pageYOffset+c.top+(d?-t-2:n.offsetHeight+2);if(l(v.calendarContainer,"arrowTop",!d),l(v.calendarContainer,"arrowBottom",d),!v.config.inline){var f=window.pageXOffset+c.left,m=!1,g=!1;"center"===r?(f-=(a-c.width)/2,m=!0):"right"===r&&(f-=a-c.width,g=!0),l(v.calendarContainer,"arrowLeft",!m&&!g),l(v.calendarContainer,"arrowCenter",m),l(v.calendarContainer,"arrowRight",g);var p=window.document.body.offsetWidth-(window.pageXOffset+c.right),h=f+a>window.document.body.offsetWidth,D=p+a>window.document.body.offsetWidth;if(l(v.calendarContainer,"rightMost",h),!v.config.static)if(v.calendarContainer.style.top=u+"px",h)if(D){var w=function(){for(var e=null,n=0;n<document.styleSheets.length;n++){var t=document.styleSheets[n];if(t.cssRules){try{t.cssRules}catch(e){continue}e=t;break}}return null!=e?e:(a=document.createElement("style"),document.head.appendChild(a),a.sheet);var a}();if(void 0===w)return;var b=window.document.body.offsetWidth,C=Math.max(0,b/2-a/2),M=w.cssRules.length,y="{left:"+c.left+"px;right:auto;}";l(v.calendarContainer,"rightMost",!1),l(v.calendarContainer,"centerMost",!0),w.insertRule(".flatpickr-calendar.centerMost:before,.flatpickr-calendar.centerMost:after"+y,M),v.calendarContainer.style.left=C+"px",v.calendarContainer.style.right="auto"}else v.calendarContainer.style.left="auto",v.calendarContainer.style.right=p+"px";else v.calendarContainer.style.left=f+"px",v.calendarContainer.style.right="auto"}}}else v.config.position(v,e)}function ge(){v.config.noCalendar||v.isMobile||(z(),xe(),V())}function pe(){v._input.focus(),-1!==window.navigator.userAgent.indexOf("MSIE")||void 0!==navigator.msMaxTouchPoints?setTimeout(v.close,0):v.close()}function he(e){e.preventDefault(),e.stopPropagation();var n=d(f(e),(function(e){return e.classList&&e.classList.contains("flatpickr-day")&&!e.classList.contains("flatpickr-disabled")&&!e.classList.contains("notAllowed")}));if(void 0!==n){var t=n,a=v.latestSelectedDateObj=new Date(t.dateObj.getTime()),i=(a.getMonth()<v.currentMonth||a.getMonth()>v.currentMonth+v.config.showMonths-1)&&"range"!==v.config.mode;if(v.selectedDateElem=t,"single"===v.config.mode)v.selectedDates=[a];else if("multiple"===v.config.mode){var o=ye(a);o?v.selectedDates.splice(parseInt(o),1):v.selectedDates.push(a)}else"range"===v.config.mode&&(2===v.selectedDates.length&&v.clear(!1,!1),v.latestSelectedDateObj=a,v.selectedDates.push(a),0!==b(a,v.selectedDates[0],!0)&&v.selectedDates.sort((function(e,n){return e.getTime()-n.getTime()})));if(N(),i){var r=v.currentYear!==a.getFullYear();v.currentYear=a.getFullYear(),v.currentMonth=a.getMonth(),r&&(Ce("onYearChange"),z()),Ce("onMonthChange")}if(xe(),V(),ke(),i||"range"===v.config.mode||1!==v.config.showMonths?void 0!==v.selectedDateElem&&void 0===v.hourElement&&v.selectedDateElem&&v.selectedDateElem.focus():K(t),void 0!==v.hourElement&&void 0!==v.hourElement&&v.hourElement.focus(),v.config.closeOnSelect){var l="single"===v.config.mode&&!v.config.enableTime,c="range"===v.config.mode&&2===v.selectedDates.length&&!v.config.enableTime;(l||c)&&pe()}L()}}v.parseDate=w({config:v.config,l10n:v.l10n}),v._handlers=[],v.pluginElements=[],v.loadedPlugins=[],v._bind=H,v._setHoursFromDate=P,v._positionCalendar=me,v.changeMonth=ee,v.changeYear=ae,v.clear=function(e,n){void 0===e&&(e=!0);void 0===n&&(n=!0);v.input.value="",void 0!==v.altInput&&(v.altInput.value="");void 0!==v.mobileInput&&(v.mobileInput.value="");v.selectedDates=[],v.latestSelectedDateObj=void 0,!0===n&&(v.currentYear=v._initialDate.getFullYear(),v.currentMonth=v._initialDate.getMonth());if(!0===v.config.enableTime){var t=E(v.config);Y(t.hours,t.minutes,t.seconds)}v.redraw(),e&&Ce("onChange")},v.close=function(){v.isOpen=!1,v.isMobile||(void 0!==v.calendarContainer&&v.calendarContainer.classList.remove("open"),void 0!==v._input&&v._input.classList.remove("active"));Ce("onClose")},v.onMouseOver=ce,v._createElement=c,v.createDay=J,v.destroy=function(){void 0!==v.config&&Ce("onDestroy");for(var e=v._handlers.length;e--;)v._handlers[e].remove();if(v._handlers=[],v.mobileInput)v.mobileInput.parentNode&&v.mobileInput.parentNode.removeChild(v.mobileInput),v.mobileInput=void 0;else if(v.calendarContainer&&v.calendarContainer.parentNode)if(v.config.static&&v.calendarContainer.parentNode){var n=v.calendarContainer.parentNode;if(n.lastChild&&n.removeChild(n.lastChild),n.parentNode){for(;n.firstChild;)n.parentNode.insertBefore(n.firstChild,n);n.parentNode.removeChild(n)}}else v.calendarContainer.parentNode.removeChild(v.calendarContainer);v.altInput&&(v.input.type="text",v.altInput.parentNode&&v.altInput.parentNode.removeChild(v.altInput),delete v.altInput);v.input&&(v.input.type=v.input._type,v.input.classList.remove("flatpickr-input"),v.input.removeAttribute("readonly"));["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach((function(e){try{delete v[e]}catch(e){}}))},v.isEnabled=ie,v.jumpToDate=R,v.updateValue=ke,v.open=function(e,n){void 0===n&&(n=v._positionElement);if(!0===v.isMobile){if(e){e.preventDefault();var t=f(e);t&&t.blur()}return void 0!==v.mobileInput&&(v.mobileInput.focus(),v.mobileInput.click()),void Ce("onOpen")}if(v._input.disabled||v.config.inline)return;var a=v.isOpen;v.isOpen=!0,a||(v.calendarContainer.classList.add("open"),v._input.classList.add("active"),Ce("onOpen"),me(n));!0===v.config.enableTime&&!0===v.config.noCalendar&&(!1!==v.config.allowInput||void 0!==e&&v.timeContainer.contains(e.relatedTarget)||setTimeout((function(){return v.hourElement.select()}),50))},v.redraw=ge,v.set=function(n,t){if(null!==n&&"object"==typeof n)for(var a in Object.assign(v.config,n),n)void 0!==ve[a]&&ve[a].forEach((function(e){return e()}));else v.config[n]=t,void 0!==ve[n]?ve[n].forEach((function(e){return e()})):e.indexOf(n)>-1&&(v.config[n]=r(t));v.redraw(),ke(!0)},v.setDate=function(e,n,t){void 0===n&&(n=!1);void 0===t&&(t=v.config.dateFormat);if(0!==e&&!e||e instanceof Array&&0===e.length)return v.clear(n);De(e,t),v.latestSelectedDateObj=v.selectedDates[v.selectedDates.length-1],v.redraw(),R(void 0,n),P(),0===v.selectedDates.length&&v.clear(!1);ke(n),n&&Ce("onChange")},v.toggle=function(e){if(!0===v.isOpen)return v.close();v.open(e)};var ve={locale:[fe,X],showMonths:[Z,F,Q],minDate:[R],maxDate:[R],positionElement:[be],clickOpens:[function(){!0===v.config.clickOpens?(H(v._input,"focus",v.open),H(v._input,"click",v.open)):(v._input.removeEventListener("focus",v.open),v._input.removeEventListener("click",v.open))}]};function De(e,n){var t=[];if(e instanceof Array)t=e.map((function(e){return v.parseDate(e,n)}));else if(e instanceof Date||"number"==typeof e)t=[v.parseDate(e,n)];else if("string"==typeof e)switch(v.config.mode){case"single":case"time":t=[v.parseDate(e,n)];break;case"multiple":t=e.split(v.config.conjunction).map((function(e){return v.parseDate(e,n)}));break;case"range":t=e.split(v.l10n.rangeSeparator).map((function(e){return v.parseDate(e,n)}))}else v.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(e)));v.selectedDates=v.config.allowInvalidPreload?t:t.filter((function(e){return e instanceof Date&&ie(e,!1)})),"range"===v.config.mode&&v.selectedDates.sort((function(e,n){return e.getTime()-n.getTime()}))}function we(e){return e.slice().map((function(e){return"string"==typeof e||"number"==typeof e||e instanceof Date?v.parseDate(e,void 0,!0):e&&"object"==typeof e&&e.from&&e.to?{from:v.parseDate(e.from,void 0),to:v.parseDate(e.to,void 0)}:e})).filter((function(e){return e}))}function be(){v._positionElement=v.config.positionElement||v._input}function Ce(e,n){if(void 0!==v.config){var t=v.config[e];if(void 0!==t&&t.length>0)for(var a=0;t[a]&&a<t.length;a++)t[a](v.selectedDates,v.input.value,v,n);"onChange"===e&&(v.input.dispatchEvent(Me("change")),v.input.dispatchEvent(Me("input")))}}function Me(e){var n=document.createEvent("Event");return n.initEvent(e,!0,!0),n}function ye(e){for(var n=0;n<v.selectedDates.length;n++){var t=v.selectedDates[n];if(t instanceof Date&&0===b(t,e))return""+n}return!1}function xe(){v.config.noCalendar||v.isMobile||!v.monthNav||(v.yearElements.forEach((function(e,n){var t=new Date(v.currentYear,v.currentMonth,1);t.setMonth(v.currentMonth+n),v.config.showMonths>1||"static"===v.config.monthSelectorType?v.monthElements[n].textContent=g(t.getMonth(),v.config.shorthandCurrentMonth,v.l10n)+" ":v.monthsDropdownContainer.value=t.getMonth().toString(),e.value=t.getFullYear().toString()})),v._hidePrevMonthArrow=void 0!==v.config.minDate&&(v.currentYear===v.config.minDate.getFullYear()?v.currentMonth<=v.config.minDate.getMonth():v.currentYear<v.config.minDate.getFullYear()),v._hideNextMonthArrow=void 0!==v.config.maxDate&&(v.currentYear===v.config.maxDate.getFullYear()?v.currentMonth+1>v.config.maxDate.getMonth():v.currentYear>v.config.maxDate.getFullYear()))}function Ee(e){var n=e||(v.config.altInput?v.config.altFormat:v.config.dateFormat);return v.selectedDates.map((function(e){return v.formatDate(e,n)})).filter((function(e,n,t){return"range"!==v.config.mode||v.config.enableTime||t.indexOf(e)===n})).join("range"!==v.config.mode?v.config.conjunction:v.l10n.rangeSeparator)}function ke(e){void 0===e&&(e=!0),void 0!==v.mobileInput&&v.mobileFormatStr&&(v.mobileInput.value=void 0!==v.latestSelectedDateObj?v.formatDate(v.latestSelectedDateObj,v.mobileFormatStr):""),v.input.value=Ee(v.config.dateFormat),void 0!==v.altInput&&(v.altInput.value=Ee(v.config.altFormat)),!1!==e&&Ce("onValueUpdate")}function Te(e){var n=f(e),t=v.prevMonthNav.contains(n),a=v.nextMonthNav.contains(n);t||a?ee(t?-1:1):v.yearElements.indexOf(n)>=0?n.select():n.classList.contains("arrowUp")?v.changeYear(v.currentYear+1):n.classList.contains("arrowDown")&&v.changeYear(v.currentYear-1)}return function(){v.element=v.input=m,v.isOpen=!1,function(){var t=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],a=k(k({},JSON.parse(JSON.stringify(m.dataset||{}))),p),i={};v.config.parseDate=a.parseDate,v.config.formatDate=a.formatDate,Object.defineProperty(v.config,"enable",{get:function(){return v.config._enable},set:function(e){v.config._enable=we(e)}}),Object.defineProperty(v.config,"disable",{get:function(){return v.config._disable},set:function(e){v.config._disable=we(e)}});var o="time"===a.mode;if(!a.dateFormat&&(a.enableTime||o)){var l=O.defaultConfig.dateFormat||n.dateFormat;i.dateFormat=a.noCalendar||o?"H:i"+(a.enableSeconds?":S":""):l+" H:i"+(a.enableSeconds?":S":"")}if(a.altInput&&(a.enableTime||o)&&!a.altFormat){var c=O.defaultConfig.altFormat||n.altFormat;i.altFormat=a.noCalendar||o?"h:i"+(a.enableSeconds?":S K":" K"):c+" h:i"+(a.enableSeconds?":S":"")+" K"}Object.defineProperty(v.config,"minDate",{get:function(){return v.config._minDate},set:de("min")}),Object.defineProperty(v.config,"maxDate",{get:function(){return v.config._maxDate},set:de("max")});var s=function(e){return function(n){v.config["min"===e?"_minTime":"_maxTime"]=v.parseDate(n,"H:i:S")}};Object.defineProperty(v.config,"minTime",{get:function(){return v.config._minTime},set:s("min")}),Object.defineProperty(v.config,"maxTime",{get:function(){return v.config._maxTime},set:s("max")}),"time"===a.mode&&(v.config.noCalendar=!0,v.config.enableTime=!0);Object.assign(v.config,i,a);for(var d=0;d<t.length;d++)v.config[t[d]]=!0===v.config[t[d]]||"true"===v.config[t[d]];e.filter((function(e){return void 0!==v.config[e]})).forEach((function(e){v.config[e]=r(v.config[e]||[]).map(_)})),v.isMobile=!v.config.disableMobile&&!v.config.inline&&"single"===v.config.mode&&!v.config.disable.length&&!v.config.enable&&!v.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(d=0;d<v.config.plugins.length;d++){var u=v.config.plugins[d](v)||{};for(var f in u)e.indexOf(f)>-1?v.config[f]=r(u[f]).map(_).concat(v.config[f]):void 0===a[f]&&(v.config[f]=u[f])}a.altInputClass||(v.config.altInputClass=ue().className+" "+v.config.altInputClass);Ce("onParseConfig")}(),fe(),function(){if(v.input=ue(),!v.input)return void v.config.errorHandler(new Error("Invalid input element specified"));v.input._type=v.input.type,v.input.type="text",v.input.classList.add("flatpickr-input"),v._input=v.input,v.config.altInput&&(v.altInput=c(v.input.nodeName,v.config.altInputClass),v._input=v.altInput,v.altInput.placeholder=v.input.placeholder,v.altInput.disabled=v.input.disabled,v.altInput.required=v.input.required,v.altInput.tabIndex=v.input.tabIndex,v.altInput.type="text",v.input.setAttribute("type","hidden"),!v.config.static&&v.input.parentNode&&v.input.parentNode.insertBefore(v.altInput,v.input.nextSibling));v.config.allowInput||v._input.setAttribute("readonly","readonly");be()}(),function(){v.selectedDates=[],v.now=v.parseDate(v.config.now)||new Date;var e=v.config.defaultDate||("INPUT"!==v.input.nodeName&&"TEXTAREA"!==v.input.nodeName||!v.input.placeholder||v.input.value!==v.input.placeholder?v.input.value:null);e&&De(e,v.config.dateFormat);v._initialDate=v.selectedDates.length>0?v.selectedDates[0]:v.config.minDate&&v.config.minDate.getTime()>v.now.getTime()?v.config.minDate:v.config.maxDate&&v.config.maxDate.getTime()<v.now.getTime()?v.config.maxDate:v.now,v.currentYear=v._initialDate.getFullYear(),v.currentMonth=v._initialDate.getMonth(),v.selectedDates.length>0&&(v.latestSelectedDateObj=v.selectedDates[0]);void 0!==v.config.minTime&&(v.config.minTime=v.parseDate(v.config.minTime,"H:i"));void 0!==v.config.maxTime&&(v.config.maxTime=v.parseDate(v.config.maxTime,"H:i"));v.minDateHasTime=!!v.config.minDate&&(v.config.minDate.getHours()>0||v.config.minDate.getMinutes()>0||v.config.minDate.getSeconds()>0),v.maxDateHasTime=!!v.config.maxDate&&(v.config.maxDate.getHours()>0||v.config.maxDate.getMinutes()>0||v.config.maxDate.getSeconds()>0)}(),v.utils={getDaysInMonth:function(e,n){return void 0===e&&(e=v.currentMonth),void 0===n&&(n=v.currentYear),1===e&&(n%4==0&&n%100!=0||n%400==0)?29:v.l10n.daysInMonth[e]}},v.isMobile||function(){var e=window.document.createDocumentFragment();if(v.calendarContainer=c("div","flatpickr-calendar"),v.calendarContainer.tabIndex=-1,!v.config.noCalendar){if(e.appendChild((v.monthNav=c("div","flatpickr-months"),v.yearElements=[],v.monthElements=[],v.prevMonthNav=c("span","flatpickr-prev-month"),v.prevMonthNav.innerHTML=v.config.prevArrow,v.nextMonthNav=c("span","flatpickr-next-month"),v.nextMonthNav.innerHTML=v.config.nextArrow,Z(),Object.defineProperty(v,"_hidePrevMonthArrow",{get:function(){return v.__hidePrevMonthArrow},set:function(e){v.__hidePrevMonthArrow!==e&&(l(v.prevMonthNav,"flatpickr-disabled",e),v.__hidePrevMonthArrow=e)}}),Object.defineProperty(v,"_hideNextMonthArrow",{get:function(){return v.__hideNextMonthArrow},set:function(e){v.__hideNextMonthArrow!==e&&(l(v.nextMonthNav,"flatpickr-disabled",e),v.__hideNextMonthArrow=e)}}),v.currentYearElement=v.yearElements[0],xe(),v.monthNav)),v.innerContainer=c("div","flatpickr-innerContainer"),v.config.weekNumbers){var n=function(){v.calendarContainer.classList.add("hasWeeks");var e=c("div","flatpickr-weekwrapper");e.appendChild(c("span","flatpickr-weekday",v.l10n.weekAbbreviation));var n=c("div","flatpickr-weeks");return e.appendChild(n),{weekWrapper:e,weekNumbers:n}}(),t=n.weekWrapper,o=n.weekNumbers;v.innerContainer.appendChild(t),v.weekNumbers=o,v.weekWrapper=t}v.rContainer=c("div","flatpickr-rContainer"),v.rContainer.appendChild(Q()),v.daysContainer||(v.daysContainer=c("div","flatpickr-days"),v.daysContainer.tabIndex=-1),V(),v.rContainer.appendChild(v.daysContainer),v.innerContainer.appendChild(v.rContainer),e.appendChild(v.innerContainer)}v.config.enableTime&&e.appendChild(function(){v.calendarContainer.classList.add("hasTime"),v.config.noCalendar&&v.calendarContainer.classList.add("noCalendar");var e=E(v.config);v.timeContainer=c("div","flatpickr-time"),v.timeContainer.tabIndex=-1;var n=c("span","flatpickr-time-separator",":"),t=u("flatpickr-hour",{"aria-label":v.l10n.hourAriaLabel});v.hourElement=t.getElementsByTagName("input")[0];var o=u("flatpickr-minute",{"aria-label":v.l10n.minuteAriaLabel});v.minuteElement=o.getElementsByTagName("input")[0],v.hourElement.tabIndex=v.minuteElement.tabIndex=-1,v.hourElement.value=a(v.latestSelectedDateObj?v.latestSelectedDateObj.getHours():v.config.time_24hr?e.hours:function(e){switch(e%24){case 0:case 12:return 12;default:return e%12}}(e.hours)),v.minuteElement.value=a(v.latestSelectedDateObj?v.latestSelectedDateObj.getMinutes():e.minutes),v.hourElement.setAttribute("step",v.config.hourIncrement.toString()),v.minuteElement.setAttribute("step",v.config.minuteIncrement.toString()),v.hourElement.setAttribute("min",v.config.time_24hr?"0":"1"),v.hourElement.setAttribute("max",v.config.time_24hr?"23":"12"),v.hourElement.setAttribute("maxlength","2"),v.minuteElement.setAttribute("min","0"),v.minuteElement.setAttribute("max","59"),v.minuteElement.setAttribute("maxlength","2"),v.timeContainer.appendChild(t),v.timeContainer.appendChild(n),v.timeContainer.appendChild(o),v.config.time_24hr&&v.timeContainer.classList.add("time24hr");if(v.config.enableSeconds){v.timeContainer.classList.add("hasSeconds");var r=u("flatpickr-second");v.secondElement=r.getElementsByTagName("input")[0],v.secondElement.value=a(v.latestSelectedDateObj?v.latestSelectedDateObj.getSeconds():e.seconds),v.secondElement.setAttribute("step",v.minuteElement.getAttribute("step")),v.secondElement.setAttribute("min","0"),v.secondElement.setAttribute("max","59"),v.secondElement.setAttribute("maxlength","2"),v.timeContainer.appendChild(c("span","flatpickr-time-separator",":")),v.timeContainer.appendChild(r)}v.config.time_24hr||(v.amPM=c("span","flatpickr-am-pm",v.l10n.amPM[i((v.latestSelectedDateObj?v.hourElement.value:v.config.defaultHour)>11)]),v.amPM.title=v.l10n.toggleTitle,v.amPM.tabIndex=-1,v.timeContainer.appendChild(v.amPM));return v.timeContainer}());l(v.calendarContainer,"rangeMode","range"===v.config.mode),l(v.calendarContainer,"animate",!0===v.config.animate),l(v.calendarContainer,"multiMonth",v.config.showMonths>1),v.calendarContainer.appendChild(e);var r=void 0!==v.config.appendTo&&void 0!==v.config.appendTo.nodeType;if((v.config.inline||v.config.static)&&(v.calendarContainer.classList.add(v.config.inline?"inline":"static"),v.config.inline&&(!r&&v.element.parentNode?v.element.parentNode.insertBefore(v.calendarContainer,v._input.nextSibling):void 0!==v.config.appendTo&&v.config.appendTo.appendChild(v.calendarContainer)),v.config.static)){var s=c("div","flatpickr-wrapper");v.element.parentNode&&v.element.parentNode.insertBefore(s,v.element),s.appendChild(v.element),v.altInput&&s.appendChild(v.altInput),s.appendChild(v.calendarContainer)}v.config.static||v.config.inline||(void 0!==v.config.appendTo?v.config.appendTo:window.document.body).appendChild(v.calendarContainer)}(),function(){v.config.wrap&&["open","close","toggle","clear"].forEach((function(e){Array.prototype.forEach.call(v.element.querySelectorAll("[data-"+e+"]"),(function(n){return H(n,"click",v[e])}))}));if(v.isMobile)return void function(){var e=v.config.enableTime?v.config.noCalendar?"time":"datetime-local":"date";v.mobileInput=c("input",v.input.className+" flatpickr-mobile"),v.mobileInput.tabIndex=1,v.mobileInput.type=e,v.mobileInput.disabled=v.input.disabled,v.mobileInput.required=v.input.required,v.mobileInput.placeholder=v.input.placeholder,v.mobileFormatStr="datetime-local"===e?"Y-m-d\\TH:i:S":"date"===e?"Y-m-d":"H:i:S",v.selectedDates.length>0&&(v.mobileInput.defaultValue=v.mobileInput.value=v.formatDate(v.selectedDates[0],v.mobileFormatStr));v.config.minDate&&(v.mobileInput.min=v.formatDate(v.config.minDate,"Y-m-d"));v.config.maxDate&&(v.mobileInput.max=v.formatDate(v.config.maxDate,"Y-m-d"));v.input.getAttribute("step")&&(v.mobileInput.step=String(v.input.getAttribute("step")));v.input.type="hidden",void 0!==v.altInput&&(v.altInput.type="hidden");try{v.input.parentNode&&v.input.parentNode.insertBefore(v.mobileInput,v.input.nextSibling)}catch(e){}H(v.mobileInput,"change",(function(e){v.setDate(f(e).value,!1,v.mobileFormatStr),Ce("onChange"),Ce("onClose")}))}();var e=o(se,50);v._debouncedChange=o(L,I),v.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&H(v.daysContainer,"mouseover",(function(e){"range"===v.config.mode&&ce(f(e))}));H(v._input,"keydown",le),void 0!==v.calendarContainer&&H(v.calendarContainer,"keydown",le);v.config.inline||v.config.static||H(window,"resize",e);void 0!==window.ontouchstart?H(window.document,"touchstart",te):H(window.document,"mousedown",te);H(window.document,"focus",te,{capture:!0}),!0===v.config.clickOpens&&(H(v._input,"focus",v.open),H(v._input,"click",v.open));void 0!==v.daysContainer&&(H(v.monthNav,"click",Te),H(v.monthNav,["keyup","increment"],j),H(v.daysContainer,"click",he));if(void 0!==v.timeContainer&&void 0!==v.minuteElement&&void 0!==v.hourElement){var n=function(e){return f(e).select()};H(v.timeContainer,["increment"],A),H(v.timeContainer,"blur",A,{capture:!0}),H(v.timeContainer,"click",W),H([v.hourElement,v.minuteElement],["focus","click"],n),void 0!==v.secondElement&&H(v.secondElement,"focus",(function(){return v.secondElement&&v.secondElement.select()})),void 0!==v.amPM&&H(v.amPM,"click",(function(e){A(e)}))}v.config.allowInput&&H(v._input,"blur",re)}(),(v.selectedDates.length||v.config.noCalendar)&&(v.config.enableTime&&P(v.config.noCalendar?v.latestSelectedDateObj:void 0),ke(!1)),F();var t=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!v.isMobile&&t&&me(),Ce("onReady")}(),v}function _(e,n){for(var t=Array.prototype.slice.call(e).filter((function(e){return e instanceof HTMLElement})),a=[],i=0;i<t.length;i++){var o=t[i];try{if(null!==o.getAttribute("data-fp-omit"))continue;void 0!==o._flatpickr&&(o._flatpickr.destroy(),o._flatpickr=void 0),o._flatpickr=S(o,n||{}),a.push(o._flatpickr)}catch(e){console.error(e)}}return 1===a.length?a[0]:a}"undefined"!=typeof HTMLElement&&"undefined"!=typeof HTMLCollection&&"undefined"!=typeof NodeList&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(e){return _(this,e)},HTMLElement.prototype.flatpickr=function(e){return _([this],e)});var O=function(e,n){return"string"==typeof e?_(window.document.querySelectorAll(e),n):e instanceof Node?_([e],n):_(e,n)};O.defaultConfig={},O.l10ns={en:k({},t),default:k({},t)},O.localize=function(e){O.l10ns.default=k(k({},O.l10ns.default),e)},O.setDefaults=function(e){O.defaultConfig=k(k({},O.defaultConfig),e)},O.parseDate=w({}),O.formatDate=D({}),O.compareDates=b,"undefined"!=typeof jQuery&&void 0!==jQuery.fn&&(jQuery.fn.flatpickr=function(e){return _(this,e)}),Date.prototype.fp_incr=function(e){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+("string"==typeof e?parseInt(e,10):e))},"undefined"!=typeof window&&(window.flatpickr=O);export{O as default};
|