diff --git a/.circleci/config.yml b/.circleci/config.yml
index 5390f8459e..0efcce4401 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -1,13 +1,19 @@
---
version: 2.1
+orbs:
+ browser-tools: circleci/browser-tools@1.2.4
+
commands:
shared_steps:
steps:
+ - browser-tools/install-chrome
+ - browser-tools/install-chromedriver
+
- checkout
# Install bundler
- - run: gem install bundler:2.1.4
+ - run: gem install bundler:2.3.5
# Restore Cached Dependencies
- restore_cache:
@@ -43,21 +49,28 @@ commands:
- run: bundle exec rake db:setup
# Run the tests
- - run: bundle exec rake
+ - run: bundle exec rspec
+
+ # Check vulnerabilities
+ - run: bundle exec rake bundler:audit
default_job: &default_job
working_directory: ~/administrate
- steps:
- - shared_steps
- # Run the tests against multiple versions of Rails
- - run: bundle exec appraisal install
- - run: bundle exec appraisal rake
jobs:
ruby-26:
<<: *default_job
+ steps:
+ - shared_steps
+ # Run the tests against the versions of Rails that support Ruby 2.6
+ - run: bundle exec appraisal install
+ - run: bundle exec appraisal rails50 rspec
+ - run: bundle exec appraisal rails51 rspec
+ - run: bundle exec appraisal rails52 rspec
+ - run: bundle exec appraisal rails60 rspec
+ - run: bundle exec appraisal rails61 rspec
docker:
- - image: circleci/ruby:2.6.3-node-browsers-legacy
+ - image: circleci/ruby:2.6.3
environment:
PGHOST: localhost
PGUSER: administrate
@@ -70,8 +83,18 @@ jobs:
ruby-27:
<<: *default_job
+ steps:
+ - shared_steps
+ # Run the tests against the versions of Rails that support Ruby 2.7
+ - run: bundle exec appraisal install
+ - run: bundle exec appraisal rails50 rspec
+ - run: bundle exec appraisal rails51 rspec
+ - run: bundle exec appraisal rails52 rspec
+ - run: bundle exec appraisal rails60 rspec
+ - run: bundle exec appraisal rails61 rspec
+ - run: bundle exec appraisal rails70 rspec
docker:
- - image: circleci/ruby:2.7-node-browsers-legacy
+ - image: circleci/ruby:2.7
environment:
PGHOST: localhost
PGUSER: administrate
@@ -82,9 +105,52 @@ jobs:
POSTGRES_DB: ruby27
POSTGRES_PASSWORD: ""
+ ruby-30:
+ <<: *default_job
+ steps:
+ - shared_steps
+ # Run the tests against the versions of Rails that support Ruby 3.0
+ - run: bundle exec appraisal install
+ - run: bundle exec appraisal rails60 rspec
+ - run: bundle exec appraisal rails61 rspec
+ - run: bundle exec appraisal rails70 rspec
+ docker:
+ - image: circleci/ruby:3.0
+ environment:
+ PGHOST: localhost
+ PGUSER: administrate
+ RAILS_ENV: test
+ - image: postgres:10.1-alpine
+ environment:
+ POSTGRES_USER: administrate
+ POSTGRES_DB: ruby30
+ POSTGRES_PASSWORD: ""
+
+ ruby-31:
+ <<: *default_job
+ steps:
+ - shared_steps
+ # Run the tests against the versions of Rails that support Ruby 3.1
+ - run: bundle exec appraisal install
+ - run: bundle exec appraisal rails61 rspec
+ - run: bundle exec appraisal rails70 rspec
+ docker:
+ - image: cimg/ruby:3.1-browsers
+ environment:
+ PGHOST: localhost
+ PGUSER: administrate
+ RAILS_ENV: test
+ - image: postgres:10.1-alpine
+ environment:
+ POSTGRES_USER: administrate
+ POSTGRES_DB: ruby31
+ POSTGRES_PASSWORD: ""
+
workflows:
version: 2
multiple-rubies:
jobs:
+ - ruby-31
+ - ruby-30
- ruby-27
- ruby-26
diff --git a/.hound.yml b/.hound.yml
index 612bc4ab7b..781d3a28f5 100644
--- a/.hound.yml
+++ b/.hound.yml
@@ -3,3 +3,5 @@ ruby:
scss:
enabled: true
config_file: .scss-lint.yml
+stylelint:
+ config_file: .stylelintrc.json
diff --git a/.scss-lint.yml b/.scss-lint.yml
index ce315053f5..23ccc9ef41 100644
--- a/.scss-lint.yml
+++ b/.scss-lint.yml
@@ -2,7 +2,8 @@ scss_files: "lib/assets/stylesheets/**/*.scss"
exclude:
- "lib/assets/stylesheets/reset/**"
- - "app/assets/builds/**/*"
+ - "lib/assets/stylesheets/datetime_picker.scss"
+ - "lib/assets/stylesheets/datetime_picker/**/*"
severity: warning
diff --git a/.stylelintrc.json b/.stylelintrc.json
new file mode 100644
index 0000000000..1badfe2724
--- /dev/null
+++ b/.stylelintrc.json
@@ -0,0 +1,9 @@
+{
+ "extends": "@thoughtbot/stylelint-config",
+ "ignoreFiles": [
+ "lib/assets/stylesheets/reset/**",
+ "lib/assets/stylesheets/datetime_picker.scss",
+ "lib/assets/stylesheets/datetime_picker/**/*",
+ "app/assets/builds/**/*"
+ ]
+}
diff --git a/Appraisals b/Appraisals
index 3fca237f78..16342df08b 100644
--- a/Appraisals
+++ b/Appraisals
@@ -37,3 +37,7 @@ end
appraise "rails61" do
gem "rails", "~> 6.1"
end
+
+appraise "rails70" do
+ gem "rails", "~> 6.1"
+end
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ee2af0bb16..443b11a745 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -17,6 +17,72 @@
## Changes
+### 0.17.0 (January 31, 2022)
+
+This release incorporates nearly a year of minor changes, starts testing
+against Ruby 3 and up, plus Rails 7. We've not heard of any incompatibilities
+yet, but there are known issues around asset handling ([notably with
+sassc][#2091]) that we're working on.
+
+[#2091]: https://github.com/thoughtbot/administrate/issues/2091
+
+The following templates have changed since v0.16.0:
+
+ app/views/administrate/application/_collection.html.erb
+ app/views/administrate/application/_collection_header_actions.html.erb
+ app/views/administrate/application/_collection_item_actions.html.erb
+ app/views/administrate/application/_flashes.html.erb
+ app/views/administrate/application/_form.html.erb
+ app/views/administrate/application/_icons.html.erb
+ app/views/administrate/application/_index_header.html.erb
+ app/views/administrate/application/index.html.erb
+ app/views/fields/belongs_to/_index.html.erb
+ app/views/fields/belongs_to/_show.html.erb
+ app/views/fields/select/_form.html.erb
+ app/views/fields/time/_index.html.erb
+ app/views/fields/time/_show.html.erb
+
+If your application overrides any of them, make sure to review your
+custom templates to ensure that they remain compatible.
+
+* [BUGFIX] [#2117] Use `camelize` rather than `classify` for the namespace
+* [COMPAT] [#2132] Add Rails 7 to tests
+* [COMPAT] [#2120] Add Ruby 3.1 to Circle tests
+* [COMPAT] [#2118] Handle Selenium "options" deprecation
+* [COMPAT] [#2127] Add Ruby 3 to Circle tests
+* [COMPAT] [#2126] Drop patch for Rails 4
+* [COMPAT] [#2123] Update Bundler to 2.3.5
+* [COMPAT] [#2122] Update Ruby version in ".ruby-version"
+* [COMPAT] [#2121] Remove "rspec-rails" from gemspec
+* [COMPAT] [#2120] Add "webrick" to Gemfile
+* [UI] [#2115] Remove inline style from icon svg
+* [COMPAT] [#2102] Update browsers used in CI
+* [COMPAT] [#2097] Manage Selenium drivers automatically
+* [BUGFIX] [#2125] Fix rspec invocation in CircleCI
+* [BUGFIX] Typo navigation:back_to_app
+* [BUGFIX] [#2108] Hide link if user is not authorized to access resource
+* [COMPAT] [#2107] Relax momentjs-rails version constraint
+* [UI] [#2105] Add resource/attribute name to table headers
+* [COMPAT] [#2074] gemspec: Drop unused directive test_files
+* [COMPAT] [#2101] Limit the highest momentjs-rails version to 2.20.1
+* [DOCS] [#2046] Remove password field from Extending Administrate
+* [FEATURE] [#2029] Add format option to time field
+* [FEATURE] [#1998] Reformulate authorization in example app
+* [COMPAT] [#2027] Drop support for Ruby `< 2.6`
+* [FEATURE] [#2018] Add :include_blank option to Field::Select
+* [COMPAT] [#2023] Avoid version not compatible with Ruby 2.5
+* [BUGFIX] [#2015] Only call html_safe on flash message that responds to it
+* [FEATURE] [#2005] Add params to collection filter
+* [UI] [#2013] Fix nav styles for namespaced resources
+* [COMPAT] [#2001] Remove shims that force deprecated form of methods
+* [COMPAT] [#2008] Fix deprecation warning
+* [FEATURE] [#1991] Allow different form attributes for new/update actions
+* [BUGFIX] [#2003] Only allow HTTP(S) URLs in example app
+* [DOC] [#2002] Create SECURITY.md
+* [FEATURE] [#1995] Allow customising redirects after actions
+* [UI] [#1996] Opt-out of FLoC: https://amifloced.org/
+* [DOC] [#1968] Add a script to list recent changes to templates
+
### 0.16.0 (May 6, 2021)
This release incorporates a fix for breakages on Rails 6.1.3.2 and 6.0.3.7
diff --git a/Gemfile b/Gemfile
index 0d67fcdb25..6dfbf450f8 100644
--- a/Gemfile
+++ b/Gemfile
@@ -27,14 +27,16 @@ end
group :test do
gem "ammeter"
- gem "capybara", "3.36.0"
+ gem "capybara"
gem "database_cleaner"
gem "formulaic"
gem "launchy"
gem "selenium-webdriver"
gem "shoulda-matchers"
gem "timecop"
+ gem "webdrivers"
gem "webmock"
+ gem "webrick"
gem "xpath", "3.2.0"
end
diff --git a/Gemfile.lock b/Gemfile.lock
index 8f246f6699..8c9655de7f 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
- administrate (0.16.0)
+ administrate (0.17.0)
actionpack (>= 5.0)
actionview (>= 5.0)
activerecord (>= 5.0)
@@ -133,7 +133,7 @@ GEM
activesupport
capybara
i18n
- front_matter_parser (1.0.0)
+ front_matter_parser (1.0.1)
globalid (1.0.0)
activesupport (>= 5.0)
hashdiff (1.0.1)
@@ -177,16 +177,16 @@ GEM
matrix (0.4.2)
method_source (0.9.2)
mini_mime (1.1.2)
- mini_portile2 (2.6.1)
+ mini_portile2 (2.7.1)
minitest (5.15.0)
multipart-post (2.1.1)
nio4r (2.5.8)
- nokogiri (1.12.5)
- mini_portile2 (~> 2.6.1)
+ nokogiri (1.13.1)
+ mini_portile2 (~> 2.7.0)
racc (~> 1.4)
parser (3.0.3.2)
ast (~> 2.4.1)
- pg (1.2.3)
+ pg (1.3.1)
pry (0.12.2)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
@@ -281,7 +281,7 @@ GEM
sprockets (>= 3.0.0)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
- thor (1.1.0)
+ thor (1.2.1)
tilt (2.0.10)
timecop (0.9.4)
tzinfo (2.0.4)
@@ -292,6 +292,10 @@ GEM
unicorn (6.1.0)
kgio (~> 2.6)
raindrops (~> 0.7)
+ webdrivers (5.0.0)
+ nokogiri (~> 1.6)
+ rubyzip (>= 1.3.0)
+ selenium-webdriver (~> 4.0)
webmock (3.14.0)
addressable (>= 2.8.0)
crack (>= 0.3.2)
@@ -304,7 +308,7 @@ GEM
nokogiri (~> 1.8)
yard (0.9.27)
webrick (~> 1.7.0)
- zeitwerk (2.5.2)
+ zeitwerk (2.5.3)
PLATFORMS
ruby
@@ -317,7 +321,7 @@ DEPENDENCIES
awesome_print
bundler-audit
byebug
- capybara (= 3.36.0)
+ capybara
database_cleaner
dotenv-rails
factory_bot_rails
@@ -341,9 +345,11 @@ DEPENDENCIES
timecop
uglifier
unicorn
+ webdrivers
webmock
+ webrick
xpath (= 3.2.0)
yard
BUNDLED WITH
- 2.2.24
+ 2.3.5
diff --git a/app/assets/builds/administrate/application.css b/app/assets/builds/administrate/application.css
index eb899e0b92..4fa178dbff 100644
--- a/app/assets/builds/administrate/application.css
+++ b/app/assets/builds/administrate/application.css
@@ -819,15 +819,10 @@ template {
background-color: #fafafa;
}
-/*!
- * Datetimepicker for Bootstrap 3
- * version : 4.17.37
- * https://github.com/Eonasdan/bootstrap-datetimepicker/
- */
@font-face {
font-family: "Glyphicons Halflings";
- src: url("../fonts/glyphicons-halflings-regular.eot");
- src: url("../fonts/glyphicons-halflings-regular.eot?#iefix") format("embedded-opentype"), url("../fonts/glyphicons-halflings-regular.woff2") format("woff2"), url("../fonts/glyphicons-halflings-regular.woff") format("woff"), url("../fonts/glyphicons-halflings-regular.ttf") format("truetype"), url("../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular") format("svg");
+ src: url("assets/glyphicons-halflings-regular.eot");
+ src: url("assets/glyphicons-halflings-regular.eot?#iefix") format("embedded-opentype"), url("assets/glyphicons-halflings-regular.woff") format("woff"), url("assets/glyphicons-halflings-regular.ttf") format("truetype"), url("assets/glyphicons-halflings-regular.svg#glyphicons_halflingsregular") format("svg");
}
.glyphicon {
position: relative;
@@ -841,8 +836,12 @@ template {
-moz-osx-font-smoothing: grayscale;
}
-.glyphicon-time:before {
- content: "\e023";
+.glyphicon-calendar:before {
+ content: "\e109";
+}
+
+.glyphicon-chevron-down:before {
+ content: "\e114";
}
.glyphicon-chevron-left:before {
@@ -857,46 +856,57 @@ template {
content: "\e113";
}
-.glyphicon-chevron-down:before {
- content: "\e114";
+.glyphicon-remove:before {
+ content: "\e014";
}
-.glyphicon-calendar:before {
- content: "\e109";
+.glyphicon-screenshot:before {
+ content: "\e087";
}
-.btn {
- display: inline-block;
- padding: 6px 12px;
- margin-bottom: 0;
- font-size: 14px;
- font-weight: normal;
- line-height: 1.42857143;
- text-align: center;
- white-space: nowrap;
- vertical-align: middle;
- -ms-touch-action: manipulation;
- touch-action: manipulation;
- cursor: pointer;
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
- background-image: none;
- border: 1px solid transparent;
- border-radius: 4px;
+.glyphicon-time:before {
+ content: "\e023";
+}
+
+.glyphicon-trash:before {
+ content: "\e020";
+}
+
+.table-condensed > thead > tr > th,
+.table-condensed > thead > tr > td,
+.table-condensed > tbody > tr > th,
+.table-condensed > tbody > tr > td,
+.table-condensed > tfoot > tr > th,
+.table-condensed > tfoot > tr > td, .table-condensed > tr > th,
+.table-condensed > tr > td {
+ padding: 5px;
}
.collapse {
display: none;
}
-
.collapse.in {
display: block;
}
+tr.collapse.in {
+ display: table-row;
+}
+
+tbody.collapse.in {
+ display: table-row-group;
+}
+
+.collapsing {
+ position: relative;
+ height: 0;
+ overflow: hidden;
+ transition: height 0.35s ease;
+}
+
.dropdown-menu {
position: absolute;
+ top: 100%;
left: 0;
z-index: 1000;
display: none;
@@ -904,24 +914,500 @@ template {
min-width: 160px;
padding: 5px 0;
margin: 2px 0 0;
+ list-style: none;
font-size: 14px;
text-align: left;
- list-style: none;
background-color: #fff;
- -webkit-background-clip: padding-box;
- background-clip: padding-box;
border: 1px solid #ccc;
border: 1px solid rgba(0, 0, 0, 0.15);
border-radius: 4px;
- -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
+ background-clip: padding-box;
+}
+.dropdown-menu.pull-right {
+ right: 0;
+ left: auto;
+}
+.dropdown-menu .divider {
+ height: 1px;
+ margin: 9px 0;
+ overflow: hidden;
+ background-color: #e5e5e5;
+}
+.dropdown-menu > li > a {
+ display: block;
+ padding: 3px 20px;
+ clear: both;
+ font-weight: normal;
+ line-height: 1.428571429;
+ color: #333333;
+ white-space: nowrap;
}
-.list-unstyled {
- padding-left: 0;
+.dropdown-menu > li > a:hover, .dropdown-menu > li > a:focus {
+ text-decoration: none;
+ color: #262626;
+ background-color: #f5f5f5;
+}
+
+.dropdown-menu > .active > a, .dropdown-menu > .active > a:hover, .dropdown-menu > .active > a:focus {
+ color: #fff;
+ text-decoration: none;
+ outline: 0;
+ background-color: #428bca;
+}
+
+.dropdown-menu > .disabled > a, .dropdown-menu > .disabled > a:hover, .dropdown-menu > .disabled > a:focus {
+ color: #777777;
+}
+
+.dropdown-menu > .disabled > a:hover, .dropdown-menu > .disabled > a:focus {
+ text-decoration: none;
+ background-color: transparent;
+ background-image: none;
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
+ cursor: not-allowed;
+}
+
+.pull-right > .dropdown-menu {
+ right: 0;
+ left: auto;
+}
+
+.pull-right {
+ float: right !important;
+}
+
+/*!
+ * Datetimepicker for Bootstrap 3
+ * version : 4.15.35
+ * https://github.com/Eonasdan/bootstrap-datetimepicker/
+ */
+.bootstrap-datetimepicker-widget {
list-style: none;
}
+.bootstrap-datetimepicker-widget.dropdown-menu {
+ margin: 2px 0;
+ padding: 4px;
+ width: 19em;
+}
+
+@media (min-width: 768px) {
+ .bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs {
+ width: 38em;
+ }
+}
+@media (min-width: 992px) {
+ .bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs {
+ width: 38em;
+ }
+}
+@media (min-width: 1200px) {
+ .bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs {
+ width: 38em;
+ }
+}
+.bootstrap-datetimepicker-widget.dropdown-menu:before,
+.bootstrap-datetimepicker-widget.dropdown-menu:after {
+ content: "";
+ display: inline-block;
+ position: absolute;
+}
+
+.bootstrap-datetimepicker-widget.dropdown-menu.bottom:before {
+ border-left: 7px solid transparent;
+ border-right: 7px solid transparent;
+ border-bottom: 7px solid #cccccc;
+ border-bottom-color: rgba(0, 0, 0, 0.2);
+ top: -7px;
+ left: 7px;
+}
+
+.bootstrap-datetimepicker-widget.dropdown-menu.bottom:after {
+ border-left: 6px solid transparent;
+ border-right: 6px solid transparent;
+ border-bottom: 6px solid white;
+ top: -6px;
+ left: 8px;
+}
+
+.bootstrap-datetimepicker-widget.dropdown-menu.top:before {
+ border-left: 7px solid transparent;
+ border-right: 7px solid transparent;
+ border-top: 7px solid #cccccc;
+ border-top-color: rgba(0, 0, 0, 0.2);
+ bottom: -7px;
+ left: 6px;
+}
+
+.bootstrap-datetimepicker-widget.dropdown-menu.top:after {
+ border-left: 6px solid transparent;
+ border-right: 6px solid transparent;
+ border-top: 6px solid white;
+ bottom: -6px;
+ left: 7px;
+}
+
+.bootstrap-datetimepicker-widget.dropdown-menu.pull-right:before {
+ left: auto;
+ right: 6px;
+}
+
+.bootstrap-datetimepicker-widget.dropdown-menu.pull-right:after {
+ left: auto;
+ right: 7px;
+}
+
+.bootstrap-datetimepicker-widget .list-unstyled {
+ margin: 0;
+}
+
+.bootstrap-datetimepicker-widget a[data-action] {
+ padding: 6px 0;
+}
+
+.bootstrap-datetimepicker-widget a[data-action]:active {
+ box-shadow: none;
+}
+
+.bootstrap-datetimepicker-widget .timepicker-hour,
+.bootstrap-datetimepicker-widget .timepicker-minute,
+.bootstrap-datetimepicker-widget .timepicker-second {
+ width: 54px;
+ font-weight: bold;
+ font-size: 1.2em;
+ margin: 0;
+}
+
+.bootstrap-datetimepicker-widget button[data-action] {
+ padding: 6px;
+}
+
+.bootstrap-datetimepicker-widget .btn[data-action=incrementHours]::after {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ margin: -1px;
+ padding: 0;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ border: 0;
+ content: "Increment Hours";
+}
+
+.bootstrap-datetimepicker-widget .btn[data-action=incrementMinutes]::after {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ margin: -1px;
+ padding: 0;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ border: 0;
+ content: "Increment Minutes";
+}
+
+.bootstrap-datetimepicker-widget .btn[data-action=decrementHours]::after {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ margin: -1px;
+ padding: 0;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ border: 0;
+ content: "Decrement Hours";
+}
+
+.bootstrap-datetimepicker-widget .btn[data-action=decrementMinutes]::after {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ margin: -1px;
+ padding: 0;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ border: 0;
+ content: "Decrement Minutes";
+}
+
+.bootstrap-datetimepicker-widget .btn[data-action=showHours]::after {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ margin: -1px;
+ padding: 0;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ border: 0;
+ content: "Show Hours";
+}
+
+.bootstrap-datetimepicker-widget .btn[data-action=showMinutes]::after {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ margin: -1px;
+ padding: 0;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ border: 0;
+ content: "Show Minutes";
+}
+
+.bootstrap-datetimepicker-widget .btn[data-action=togglePeriod]::after {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ margin: -1px;
+ padding: 0;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ border: 0;
+ content: "Toggle AM/PM";
+}
+
+.bootstrap-datetimepicker-widget .btn[data-action=clear]::after {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ margin: -1px;
+ padding: 0;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ border: 0;
+ content: "Clear the picker";
+}
+
+.bootstrap-datetimepicker-widget .btn[data-action=today]::after {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ margin: -1px;
+ padding: 0;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ border: 0;
+ content: "Set the date to today";
+}
+
+.bootstrap-datetimepicker-widget .picker-switch {
+ text-align: center;
+}
+
+.bootstrap-datetimepicker-widget .picker-switch::after {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ margin: -1px;
+ padding: 0;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ border: 0;
+ content: "Toggle Date and Time Screens";
+}
+
+.bootstrap-datetimepicker-widget .picker-switch td {
+ padding: 0;
+ margin: 0;
+ height: auto;
+ width: auto;
+ line-height: inherit;
+}
+
+.bootstrap-datetimepicker-widget .picker-switch td span {
+ line-height: 2.5;
+ height: 2.5em;
+ width: 100%;
+}
+
+.bootstrap-datetimepicker-widget table {
+ width: 100%;
+ margin: 0;
+}
+
+.bootstrap-datetimepicker-widget table td,
+.bootstrap-datetimepicker-widget table th {
+ text-align: center;
+ border-radius: 4px;
+}
+
+.bootstrap-datetimepicker-widget table th {
+ height: 20px;
+ line-height: 20px;
+ width: 20px;
+}
+
+.bootstrap-datetimepicker-widget table th.picker-switch {
+ width: 145px;
+}
+
+.bootstrap-datetimepicker-widget table th.disabled,
+.bootstrap-datetimepicker-widget table th.disabled:hover {
+ background: none;
+ color: #777777;
+ cursor: not-allowed;
+}
+
+.bootstrap-datetimepicker-widget table th.prev::after {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ margin: -1px;
+ padding: 0;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ border: 0;
+ content: "Previous Month";
+}
+
+.bootstrap-datetimepicker-widget table th.next::after {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ margin: -1px;
+ padding: 0;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ border: 0;
+ content: "Next Month";
+}
+
+.bootstrap-datetimepicker-widget table thead tr:first-child th {
+ cursor: pointer;
+}
+
+.bootstrap-datetimepicker-widget table thead tr:first-child th:hover {
+ background: #eeeeee;
+}
+
+.bootstrap-datetimepicker-widget table td {
+ height: 54px;
+ line-height: 54px;
+ white-space: normal;
+ width: 54px;
+}
+
+.bootstrap-datetimepicker-widget table td.cw {
+ font-size: 0.8em;
+ height: 20px;
+ line-height: 20px;
+ color: #777777;
+}
+
+.bootstrap-datetimepicker-widget table td.day {
+ height: 20px;
+ line-height: 20px;
+ width: 20px;
+}
+
+.bootstrap-datetimepicker-widget table td.day:hover,
+.bootstrap-datetimepicker-widget table td.hour:hover,
+.bootstrap-datetimepicker-widget table td.minute:hover,
+.bootstrap-datetimepicker-widget table td.second:hover {
+ background: #eeeeee;
+ cursor: pointer;
+}
+
+.bootstrap-datetimepicker-widget table td.old,
+.bootstrap-datetimepicker-widget table td.new {
+ color: #777777;
+}
+
+.bootstrap-datetimepicker-widget table td.today {
+ position: relative;
+}
+
+.bootstrap-datetimepicker-widget table td.today:before {
+ content: "";
+ display: inline-block;
+ border: solid transparent;
+ border-width: 0 0 7px 7px;
+ border-bottom-color: #337ab7;
+ border-top-color: rgba(0, 0, 0, 0.2);
+ position: absolute;
+ bottom: 4px;
+ right: 4px;
+}
+
+.bootstrap-datetimepicker-widget table td.active,
+.bootstrap-datetimepicker-widget table td.active:hover {
+ background-color: #337ab7;
+ color: #ffffff;
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
+}
+
+.bootstrap-datetimepicker-widget table td.active.today:before {
+ border-bottom-color: #fff;
+}
+
+.bootstrap-datetimepicker-widget table td.disabled,
+.bootstrap-datetimepicker-widget table td.disabled:hover {
+ background: none;
+ color: #777777;
+ cursor: not-allowed;
+}
+
+.bootstrap-datetimepicker-widget table td span {
+ display: inline-block;
+ width: 54px;
+ height: 54px;
+ line-height: 54px;
+ margin: 2px 1.5px;
+ cursor: pointer;
+ border-radius: 4px;
+}
+
+.bootstrap-datetimepicker-widget table td span:hover {
+ background: #eeeeee;
+}
+
+.bootstrap-datetimepicker-widget table td span.active {
+ background-color: #337ab7;
+ color: #ffffff;
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
+}
+
+.bootstrap-datetimepicker-widget table td span.old {
+ color: #777777;
+}
+
+.bootstrap-datetimepicker-widget table td span.disabled,
+.bootstrap-datetimepicker-widget table td span.disabled:hover {
+ background: none;
+ color: #777777;
+ cursor: not-allowed;
+}
+
+.bootstrap-datetimepicker-widget.usetwentyfour td.hour {
+ height: 27px;
+ line-height: 27px;
+}
+
+.bootstrap-datetimepicker-widget.wider {
+ width: 21em;
+}
+
+.bootstrap-datetimepicker-widget .datepicker-decades .decade {
+ line-height: 1.8em !important;
+}
+
+.input-group.date .input-group-addon {
+ cursor: pointer;
+}
+
+.sr-only {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ margin: -1px;
+ padding: 0;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ border: 0;
+}
+
fieldset {
background-color: transparent;
border: 0;
diff --git a/app/assets/builds/administrate/application.js b/app/assets/builds/administrate/application.js
index a87ebcc90d..2eec90c96f 100644
--- a/app/assets/builds/administrate/application.js
+++ b/app/assets/builds/administrate/application.js
@@ -705,17 +705,17 @@
// node_modules/jquery/dist/jquery.js
var require_jquery = __commonJS({
"node_modules/jquery/dist/jquery.js"(exports, module) {
- (function(global2, factory) {
+ (function(global, factory) {
"use strict";
if (typeof module === "object" && typeof module.exports === "object") {
- module.exports = global2.document ? factory(global2, true) : function(w) {
+ module.exports = global.document ? factory(global, true) : function(w) {
if (!w.document) {
throw new Error("jQuery requires a window with a document");
}
return factory(w);
};
} else {
- factory(global2);
+ factory(global);
}
})(typeof window !== "undefined" ? window : exports, function(window2, noGlobal) {
"use strict";
@@ -9210,8 +9210,8 @@
// node_modules/moment/moment.js
var require_moment = __commonJS({
"node_modules/moment/moment.js"(exports, module) {
- (function(global2, factory) {
- typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory() : typeof define === "function" && define.amd ? define(factory) : global2.moment = factory();
+ (function(global, factory) {
+ typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory() : typeof define === "function" && define.amd ? define(factory) : global.moment = factory();
})(exports, function() {
"use strict";
var hookCallback;
@@ -12901,2072 +12901,29 @@
}
});
- // node_modules/bootstrap-datetimepicker-npm/node_modules/moment/moment.js
- var require_moment2 = __commonJS({
- "node_modules/bootstrap-datetimepicker-npm/node_modules/moment/moment.js"(exports, module) {
- (function(undefined2) {
- var moment2, VERSION = "2.8.4", globalScope = typeof global !== "undefined" ? global : this, oldGlobalMoment, round = Math.round, hasOwnProperty = Object.prototype.hasOwnProperty, i, YEAR = 0, MONTH = 1, DATE = 2, HOUR = 3, MINUTE = 4, SECOND = 5, MILLISECOND = 6, locales = {}, momentProperties = [], hasModule = typeof module !== "undefined" && module && module.exports, aspNetJsonRegex = /^\/?Date\((\-?\d+)/i, aspNetTimeSpanJsonRegex = /(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/, isoDurationRegex = /^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/, formattingTokens = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|x|X|zz?|ZZ?|.)/g, localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, parseTokenOneOrTwoDigits = /\d\d?/, parseTokenOneToThreeDigits = /\d{1,3}/, parseTokenOneToFourDigits = /\d{1,4}/, parseTokenOneToSixDigits = /[+\-]?\d{1,6}/, parseTokenDigits = /\d+/, parseTokenWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i, parseTokenTimezone = /Z|[\+\-]\d\d:?\d\d/gi, parseTokenT = /T/i, parseTokenOffsetMs = /[\+\-]?\d+/, parseTokenTimestampMs = /[\+\-]?\d+(\.\d{1,3})?/, parseTokenOneDigit = /\d/, parseTokenTwoDigits = /\d\d/, parseTokenThreeDigits = /\d{3}/, parseTokenFourDigits = /\d{4}/, parseTokenSixDigits = /[+-]?\d{6}/, parseTokenSignedNumber = /[+-]?\d+/, isoRegex = /^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/, isoFormat = "YYYY-MM-DDTHH:mm:ssZ", isoDates = [
- ["YYYYYY-MM-DD", /[+-]\d{6}-\d{2}-\d{2}/],
- ["YYYY-MM-DD", /\d{4}-\d{2}-\d{2}/],
- ["GGGG-[W]WW-E", /\d{4}-W\d{2}-\d/],
- ["GGGG-[W]WW", /\d{4}-W\d{2}/],
- ["YYYY-DDD", /\d{4}-\d{3}/]
- ], isoTimes = [
- ["HH:mm:ss.SSSS", /(T| )\d\d:\d\d:\d\d\.\d+/],
- ["HH:mm:ss", /(T| )\d\d:\d\d:\d\d/],
- ["HH:mm", /(T| )\d\d:\d\d/],
- ["HH", /(T| )\d\d/]
- ], parseTimezoneChunker = /([\+\-]|\d\d)/gi, proxyGettersAndSetters = "Date|Hours|Minutes|Seconds|Milliseconds".split("|"), unitMillisecondFactors = {
- "Milliseconds": 1,
- "Seconds": 1e3,
- "Minutes": 6e4,
- "Hours": 36e5,
- "Days": 864e5,
- "Months": 2592e6,
- "Years": 31536e6
- }, unitAliases = {
- ms: "millisecond",
- s: "second",
- m: "minute",
- h: "hour",
- d: "day",
- D: "date",
- w: "week",
- W: "isoWeek",
- M: "month",
- Q: "quarter",
- y: "year",
- DDD: "dayOfYear",
- e: "weekday",
- E: "isoWeekday",
- gg: "weekYear",
- GG: "isoWeekYear"
- }, camelFunctions = {
- dayofyear: "dayOfYear",
- isoweekday: "isoWeekday",
- isoweek: "isoWeek",
- weekyear: "weekYear",
- isoweekyear: "isoWeekYear"
- }, formatFunctions = {}, relativeTimeThresholds = {
- s: 45,
- m: 45,
- h: 22,
- d: 26,
- M: 11
- }, ordinalizeTokens = "DDD w W M D d".split(" "), paddedTokens = "M D H h m s w W".split(" "), formatTokenFunctions = {
- M: function() {
- return this.month() + 1;
- },
- MMM: function(format) {
- return this.localeData().monthsShort(this, format);
- },
- MMMM: function(format) {
- return this.localeData().months(this, format);
- },
- D: function() {
- return this.date();
- },
- DDD: function() {
- return this.dayOfYear();
- },
- d: function() {
- return this.day();
- },
- dd: function(format) {
- return this.localeData().weekdaysMin(this, format);
- },
- ddd: function(format) {
- return this.localeData().weekdaysShort(this, format);
- },
- dddd: function(format) {
- return this.localeData().weekdays(this, format);
- },
- w: function() {
- return this.week();
- },
- W: function() {
- return this.isoWeek();
- },
- YY: function() {
- return leftZeroFill(this.year() % 100, 2);
- },
- YYYY: function() {
- return leftZeroFill(this.year(), 4);
- },
- YYYYY: function() {
- return leftZeroFill(this.year(), 5);
- },
- YYYYYY: function() {
- var y = this.year(), sign = y >= 0 ? "+" : "-";
- return sign + leftZeroFill(Math.abs(y), 6);
- },
- gg: function() {
- return leftZeroFill(this.weekYear() % 100, 2);
- },
- gggg: function() {
- return leftZeroFill(this.weekYear(), 4);
- },
- ggggg: function() {
- return leftZeroFill(this.weekYear(), 5);
- },
- GG: function() {
- return leftZeroFill(this.isoWeekYear() % 100, 2);
- },
- GGGG: function() {
- return leftZeroFill(this.isoWeekYear(), 4);
- },
- GGGGG: function() {
- return leftZeroFill(this.isoWeekYear(), 5);
- },
- e: function() {
- return this.weekday();
- },
- E: function() {
- return this.isoWeekday();
- },
- a: function() {
- return this.localeData().meridiem(this.hours(), this.minutes(), true);
- },
- A: function() {
- return this.localeData().meridiem(this.hours(), this.minutes(), false);
- },
- H: function() {
- return this.hours();
- },
- h: function() {
- return this.hours() % 12 || 12;
- },
- m: function() {
- return this.minutes();
- },
- s: function() {
- return this.seconds();
- },
- S: function() {
- return toInt(this.milliseconds() / 100);
- },
- SS: function() {
- return leftZeroFill(toInt(this.milliseconds() / 10), 2);
- },
- SSS: function() {
- return leftZeroFill(this.milliseconds(), 3);
- },
- SSSS: function() {
- return leftZeroFill(this.milliseconds(), 3);
- },
- Z: function() {
- var a = -this.zone(), b = "+";
- if (a < 0) {
- a = -a;
- b = "-";
- }
- return b + leftZeroFill(toInt(a / 60), 2) + ":" + leftZeroFill(toInt(a) % 60, 2);
- },
- ZZ: function() {
- var a = -this.zone(), b = "+";
- if (a < 0) {
- a = -a;
- b = "-";
- }
- return b + leftZeroFill(toInt(a / 60), 2) + leftZeroFill(toInt(a) % 60, 2);
- },
- z: function() {
- return this.zoneAbbr();
- },
- zz: function() {
- return this.zoneName();
- },
- x: function() {
- return this.valueOf();
- },
- X: function() {
- return this.unix();
- },
- Q: function() {
- return this.quarter();
- }
- }, deprecations = {}, lists = ["months", "monthsShort", "weekdays", "weekdaysShort", "weekdaysMin"];
- function dfl(a, b, c) {
- switch (arguments.length) {
- case 2:
- return a != null ? a : b;
- case 3:
- return a != null ? a : b != null ? b : c;
- default:
- throw new Error("Implement me");
- }
- }
- function hasOwnProp(a, b) {
- return hasOwnProperty.call(a, b);
- }
- function defaultParsingFlags() {
- return {
- empty: false,
- unusedTokens: [],
- unusedInput: [],
- overflow: -2,
- charsLeftOver: 0,
- nullInput: false,
- invalidMonth: null,
- invalidFormat: false,
- userInvalidated: false,
- iso: false
- };
- }
- function printMsg(msg) {
- if (moment2.suppressDeprecationWarnings === false && typeof console !== "undefined" && console.warn) {
- console.warn("Deprecation warning: " + msg);
- }
- }
- function deprecate(msg, fn) {
- var firstTime = true;
- return extend(function() {
- if (firstTime) {
- printMsg(msg);
- firstTime = false;
- }
- return fn.apply(this, arguments);
- }, fn);
- }
- function deprecateSimple(name, msg) {
- if (!deprecations[name]) {
- printMsg(msg);
- deprecations[name] = true;
- }
- }
- function padToken(func, count) {
- return function(a) {
- return leftZeroFill(func.call(this, a), count);
- };
- }
- function ordinalizeToken(func, period) {
- return function(a) {
- return this.localeData().ordinal(func.call(this, a), period);
- };
- }
- while (ordinalizeTokens.length) {
- i = ordinalizeTokens.pop();
- formatTokenFunctions[i + "o"] = ordinalizeToken(formatTokenFunctions[i], i);
- }
- while (paddedTokens.length) {
- i = paddedTokens.pop();
- formatTokenFunctions[i + i] = padToken(formatTokenFunctions[i], 2);
- }
- formatTokenFunctions.DDDD = padToken(formatTokenFunctions.DDD, 3);
- function Locale() {
- }
- function Moment(config, skipOverflow) {
- if (skipOverflow !== false) {
- checkOverflow(config);
- }
- copyConfig(this, config);
- this._d = new Date(+config._d);
- }
- function Duration(duration) {
- var normalizedInput = normalizeObjectUnits(duration), years = normalizedInput.year || 0, quarters = normalizedInput.quarter || 0, months = normalizedInput.month || 0, weeks = normalizedInput.week || 0, days = normalizedInput.day || 0, hours = normalizedInput.hour || 0, minutes = normalizedInput.minute || 0, seconds = normalizedInput.second || 0, milliseconds = normalizedInput.millisecond || 0;
- this._milliseconds = +milliseconds + seconds * 1e3 + minutes * 6e4 + hours * 36e5;
- this._days = +days + weeks * 7;
- this._months = +months + quarters * 3 + years * 12;
- this._data = {};
- this._locale = moment2.localeData();
- this._bubble();
- }
- function extend(a, b) {
- for (var i2 in b) {
- if (hasOwnProp(b, i2)) {
- a[i2] = b[i2];
- }
- }
- if (hasOwnProp(b, "toString")) {
- a.toString = b.toString;
- }
- if (hasOwnProp(b, "valueOf")) {
- a.valueOf = b.valueOf;
- }
- return a;
- }
- function copyConfig(to, from) {
- var i2, prop, val;
- if (typeof from._isAMomentObject !== "undefined") {
- to._isAMomentObject = from._isAMomentObject;
- }
- if (typeof from._i !== "undefined") {
- to._i = from._i;
- }
- if (typeof from._f !== "undefined") {
- to._f = from._f;
- }
- if (typeof from._l !== "undefined") {
- to._l = from._l;
- }
- if (typeof from._strict !== "undefined") {
- to._strict = from._strict;
- }
- if (typeof from._tzm !== "undefined") {
- to._tzm = from._tzm;
- }
- if (typeof from._isUTC !== "undefined") {
- to._isUTC = from._isUTC;
- }
- if (typeof from._offset !== "undefined") {
- to._offset = from._offset;
- }
- if (typeof from._pf !== "undefined") {
- to._pf = from._pf;
- }
- if (typeof from._locale !== "undefined") {
- to._locale = from._locale;
- }
- if (momentProperties.length > 0) {
- for (i2 in momentProperties) {
- prop = momentProperties[i2];
- val = from[prop];
- if (typeof val !== "undefined") {
- to[prop] = val;
- }
- }
- }
- return to;
- }
- function absRound(number) {
- if (number < 0) {
- return Math.ceil(number);
- } else {
- return Math.floor(number);
- }
- }
- function leftZeroFill(number, targetLength, forceSign) {
- var output = "" + Math.abs(number), sign = number >= 0;
- while (output.length < targetLength) {
- output = "0" + output;
- }
- return (sign ? forceSign ? "+" : "" : "-") + output;
- }
- function positiveMomentsDifference(base, other) {
- var res = { milliseconds: 0, months: 0 };
- res.months = other.month() - base.month() + (other.year() - base.year()) * 12;
- if (base.clone().add(res.months, "M").isAfter(other)) {
- --res.months;
- }
- res.milliseconds = +other - +base.clone().add(res.months, "M");
- return res;
- }
- function momentsDifference(base, other) {
- var res;
- other = makeAs(other, base);
- if (base.isBefore(other)) {
- res = positiveMomentsDifference(base, other);
- } else {
- res = positiveMomentsDifference(other, base);
- res.milliseconds = -res.milliseconds;
- res.months = -res.months;
- }
- return res;
- }
- function createAdder(direction, name) {
- return function(val, period) {
- var dur, tmp;
- if (period !== null && !isNaN(+period)) {
- deprecateSimple(name, "moment()." + name + "(period, number) is deprecated. Please use moment()." + name + "(number, period).");
- tmp = val;
- val = period;
- period = tmp;
- }
- val = typeof val === "string" ? +val : val;
- dur = moment2.duration(val, period);
- addOrSubtractDurationFromMoment(this, dur, direction);
- return this;
- };
- }
- function addOrSubtractDurationFromMoment(mom, duration, isAdding, updateOffset) {
- var milliseconds = duration._milliseconds, days = duration._days, months = duration._months;
- updateOffset = updateOffset == null ? true : updateOffset;
- if (milliseconds) {
- mom._d.setTime(+mom._d + milliseconds * isAdding);
- }
- if (days) {
- rawSetter(mom, "Date", rawGetter(mom, "Date") + days * isAdding);
- }
- if (months) {
- rawMonthSetter(mom, rawGetter(mom, "Month") + months * isAdding);
- }
- if (updateOffset) {
- moment2.updateOffset(mom, days || months);
- }
- }
- function isArray(input) {
- return Object.prototype.toString.call(input) === "[object Array]";
- }
- function isDate(input) {
- return Object.prototype.toString.call(input) === "[object Date]" || input instanceof Date;
- }
- function compareArrays(array1, array2, dontConvert) {
- var len = Math.min(array1.length, array2.length), lengthDiff = Math.abs(array1.length - array2.length), diffs = 0, i2;
- for (i2 = 0; i2 < len; i2++) {
- if (dontConvert && array1[i2] !== array2[i2] || !dontConvert && toInt(array1[i2]) !== toInt(array2[i2])) {
- diffs++;
- }
- }
- return diffs + lengthDiff;
- }
- function normalizeUnits(units) {
- if (units) {
- var lowered = units.toLowerCase().replace(/(.)s$/, "$1");
- units = unitAliases[units] || camelFunctions[lowered] || lowered;
- }
- return units;
- }
- function normalizeObjectUnits(inputObject) {
- var normalizedInput = {}, normalizedProp, prop;
- for (prop in inputObject) {
- if (hasOwnProp(inputObject, prop)) {
- normalizedProp = normalizeUnits(prop);
- if (normalizedProp) {
- normalizedInput[normalizedProp] = inputObject[prop];
- }
- }
- }
- return normalizedInput;
- }
- function makeList(field) {
- var count, setter;
- if (field.indexOf("week") === 0) {
- count = 7;
- setter = "day";
- } else if (field.indexOf("month") === 0) {
- count = 12;
- setter = "month";
- } else {
- return;
- }
- moment2[field] = function(format, index) {
- var i2, getter, method = moment2._locale[field], results = [];
- if (typeof format === "number") {
- index = format;
- format = undefined2;
- }
- getter = function(i3) {
- var m = moment2().utc().set(setter, i3);
- return method.call(moment2._locale, m, format || "");
- };
- if (index != null) {
- return getter(index);
- } else {
- for (i2 = 0; i2 < count; i2++) {
- results.push(getter(i2));
- }
- return results;
- }
- };
- }
- function toInt(argumentForCoercion) {
- var coercedNumber = +argumentForCoercion, value = 0;
- if (coercedNumber !== 0 && isFinite(coercedNumber)) {
- if (coercedNumber >= 0) {
- value = Math.floor(coercedNumber);
- } else {
- value = Math.ceil(coercedNumber);
- }
- }
- return value;
- }
- function daysInMonth(year, month) {
- return new Date(Date.UTC(year, month + 1, 0)).getUTCDate();
- }
- function weeksInYear(year, dow, doy) {
- return weekOfYear(moment2([year, 11, 31 + dow - doy]), dow, doy).week;
- }
- function daysInYear(year) {
- return isLeapYear(year) ? 366 : 365;
- }
- function isLeapYear(year) {
- return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
- }
- function checkOverflow(m) {
- var overflow;
- if (m._a && m._pf.overflow === -2) {
- overflow = m._a[MONTH] < 0 || m._a[MONTH] > 11 ? MONTH : m._a[DATE] < 1 || m._a[DATE] > daysInMonth(m._a[YEAR], m._a[MONTH]) ? DATE : m._a[HOUR] < 0 || m._a[HOUR] > 24 || m._a[HOUR] === 24 && (m._a[MINUTE] !== 0 || m._a[SECOND] !== 0 || m._a[MILLISECOND] !== 0) ? HOUR : m._a[MINUTE] < 0 || m._a[MINUTE] > 59 ? MINUTE : m._a[SECOND] < 0 || m._a[SECOND] > 59 ? SECOND : m._a[MILLISECOND] < 0 || m._a[MILLISECOND] > 999 ? MILLISECOND : -1;
- if (m._pf._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {
- overflow = DATE;
- }
- m._pf.overflow = overflow;
- }
- }
- function isValid(m) {
- if (m._isValid == null) {
- m._isValid = !isNaN(m._d.getTime()) && m._pf.overflow < 0 && !m._pf.empty && !m._pf.invalidMonth && !m._pf.nullInput && !m._pf.invalidFormat && !m._pf.userInvalidated;
- if (m._strict) {
- m._isValid = m._isValid && m._pf.charsLeftOver === 0 && m._pf.unusedTokens.length === 0 && m._pf.bigHour === undefined2;
- }
- }
- return m._isValid;
- }
- function normalizeLocale(key) {
- return key ? key.toLowerCase().replace("_", "-") : key;
- }
- function chooseLocale(names) {
- var i2 = 0, j, next, locale, split;
- while (i2 < names.length) {
- split = normalizeLocale(names[i2]).split("-");
- j = split.length;
- next = normalizeLocale(names[i2 + 1]);
- next = next ? next.split("-") : null;
- while (j > 0) {
- locale = loadLocale(split.slice(0, j).join("-"));
- if (locale) {
- return locale;
- }
- if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {
- break;
- }
- j--;
- }
- i2++;
- }
- return null;
- }
- function loadLocale(name) {
- var oldLocale = null;
- if (!locales[name] && hasModule) {
- try {
- oldLocale = moment2.locale();
- __require("./locale/" + name);
- moment2.locale(oldLocale);
- } catch (e) {
- }
- }
- return locales[name];
- }
- function makeAs(input, model) {
- var res, diff;
- if (model._isUTC) {
- res = model.clone();
- diff = (moment2.isMoment(input) || isDate(input) ? +input : +moment2(input)) - +res;
- res._d.setTime(+res._d + diff);
- moment2.updateOffset(res, false);
- return res;
- } else {
- return moment2(input).local();
- }
- }
- extend(Locale.prototype, {
- set: function(config) {
- var prop, i2;
- for (i2 in config) {
- prop = config[i2];
- if (typeof prop === "function") {
- this[i2] = prop;
- } else {
- this["_" + i2] = prop;
- }
- }
- this._ordinalParseLenient = new RegExp(this._ordinalParse.source + "|" + /\d{1,2}/.source);
- },
- _months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"),
- months: function(m) {
- return this._months[m.month()];
- },
- _monthsShort: "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),
- monthsShort: function(m) {
- return this._monthsShort[m.month()];
- },
- monthsParse: function(monthName, format, strict) {
- var i2, mom, regex;
- if (!this._monthsParse) {
- this._monthsParse = [];
- this._longMonthsParse = [];
- this._shortMonthsParse = [];
- }
- for (i2 = 0; i2 < 12; i2++) {
- mom = moment2.utc([2e3, i2]);
- if (strict && !this._longMonthsParse[i2]) {
- this._longMonthsParse[i2] = new RegExp("^" + this.months(mom, "").replace(".", "") + "$", "i");
- this._shortMonthsParse[i2] = new RegExp("^" + this.monthsShort(mom, "").replace(".", "") + "$", "i");
- }
- if (!strict && !this._monthsParse[i2]) {
- regex = "^" + this.months(mom, "") + "|^" + this.monthsShort(mom, "");
- this._monthsParse[i2] = new RegExp(regex.replace(".", ""), "i");
- }
- if (strict && format === "MMMM" && this._longMonthsParse[i2].test(monthName)) {
- return i2;
- } else if (strict && format === "MMM" && this._shortMonthsParse[i2].test(monthName)) {
- return i2;
- } else if (!strict && this._monthsParse[i2].test(monthName)) {
- return i2;
- }
- }
- },
- _weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
- weekdays: function(m) {
- return this._weekdays[m.day()];
- },
- _weekdaysShort: "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),
- weekdaysShort: function(m) {
- return this._weekdaysShort[m.day()];
- },
- _weekdaysMin: "Su_Mo_Tu_We_Th_Fr_Sa".split("_"),
- weekdaysMin: function(m) {
- return this._weekdaysMin[m.day()];
- },
- weekdaysParse: function(weekdayName) {
- var i2, mom, regex;
- if (!this._weekdaysParse) {
- this._weekdaysParse = [];
- }
- for (i2 = 0; i2 < 7; i2++) {
- if (!this._weekdaysParse[i2]) {
- mom = moment2([2e3, 1]).day(i2);
- regex = "^" + this.weekdays(mom, "") + "|^" + this.weekdaysShort(mom, "") + "|^" + this.weekdaysMin(mom, "");
- this._weekdaysParse[i2] = new RegExp(regex.replace(".", ""), "i");
- }
- if (this._weekdaysParse[i2].test(weekdayName)) {
- return i2;
- }
- }
- },
- _longDateFormat: {
- LTS: "h:mm:ss A",
- LT: "h:mm A",
- L: "MM/DD/YYYY",
- LL: "MMMM D, YYYY",
- LLL: "MMMM D, YYYY LT",
- LLLL: "dddd, MMMM D, YYYY LT"
- },
- longDateFormat: function(key) {
- var output = this._longDateFormat[key];
- if (!output && this._longDateFormat[key.toUpperCase()]) {
- output = this._longDateFormat[key.toUpperCase()].replace(/MMMM|MM|DD|dddd/g, function(val) {
- return val.slice(1);
- });
- this._longDateFormat[key] = output;
- }
- return output;
- },
- isPM: function(input) {
- return (input + "").toLowerCase().charAt(0) === "p";
- },
- _meridiemParse: /[ap]\.?m?\.?/i,
- meridiem: function(hours, minutes, isLower) {
- if (hours > 11) {
- return isLower ? "pm" : "PM";
- } else {
- return isLower ? "am" : "AM";
- }
- },
- _calendar: {
- sameDay: "[Today at] LT",
- nextDay: "[Tomorrow at] LT",
- nextWeek: "dddd [at] LT",
- lastDay: "[Yesterday at] LT",
- lastWeek: "[Last] dddd [at] LT",
- sameElse: "L"
- },
- calendar: function(key, mom, now) {
- var output = this._calendar[key];
- return typeof output === "function" ? output.apply(mom, [now]) : output;
- },
- _relativeTime: {
- future: "in %s",
- past: "%s ago",
- s: "a few seconds",
- m: "a minute",
- mm: "%d minutes",
- h: "an hour",
- hh: "%d hours",
- d: "a day",
- dd: "%d days",
- M: "a month",
- MM: "%d months",
- y: "a year",
- yy: "%d years"
- },
- relativeTime: function(number, withoutSuffix, string, isFuture) {
- var output = this._relativeTime[string];
- return typeof output === "function" ? output(number, withoutSuffix, string, isFuture) : output.replace(/%d/i, number);
- },
- pastFuture: function(diff, output) {
- var format = this._relativeTime[diff > 0 ? "future" : "past"];
- return typeof format === "function" ? format(output) : format.replace(/%s/i, output);
- },
- ordinal: function(number) {
- return this._ordinal.replace("%d", number);
- },
- _ordinal: "%d",
- _ordinalParse: /\d{1,2}/,
- preparse: function(string) {
- return string;
- },
- postformat: function(string) {
- return string;
- },
- week: function(mom) {
- return weekOfYear(mom, this._week.dow, this._week.doy).week;
- },
- _week: {
- dow: 0,
- doy: 6
- },
- _invalidDate: "Invalid date",
- invalidDate: function() {
- return this._invalidDate;
- }
- });
- function removeFormattingTokens(input) {
- if (input.match(/\[[\s\S]/)) {
- return input.replace(/^\[|\]$/g, "");
- }
- return input.replace(/\\/g, "");
- }
- function makeFormatFunction(format) {
- var array = format.match(formattingTokens), i2, length;
- for (i2 = 0, length = array.length; i2 < length; i2++) {
- if (formatTokenFunctions[array[i2]]) {
- array[i2] = formatTokenFunctions[array[i2]];
- } else {
- array[i2] = removeFormattingTokens(array[i2]);
- }
- }
- return function(mom) {
- var output = "";
- for (i2 = 0; i2 < length; i2++) {
- output += array[i2] instanceof Function ? array[i2].call(mom, format) : array[i2];
- }
- return output;
- };
- }
- function formatMoment(m, format) {
- if (!m.isValid()) {
- return m.localeData().invalidDate();
- }
- format = expandFormat(format, m.localeData());
- if (!formatFunctions[format]) {
- formatFunctions[format] = makeFormatFunction(format);
- }
- return formatFunctions[format](m);
- }
- function expandFormat(format, locale) {
- var i2 = 5;
- function replaceLongDateFormatTokens(input) {
- return locale.longDateFormat(input) || input;
- }
- localFormattingTokens.lastIndex = 0;
- while (i2 >= 0 && localFormattingTokens.test(format)) {
- format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);
- localFormattingTokens.lastIndex = 0;
- i2 -= 1;
- }
- return format;
- }
- function getParseRegexForToken(token, config) {
- var a, strict = config._strict;
- switch (token) {
- case "Q":
- return parseTokenOneDigit;
- case "DDDD":
- return parseTokenThreeDigits;
- case "YYYY":
- case "GGGG":
- case "gggg":
- return strict ? parseTokenFourDigits : parseTokenOneToFourDigits;
- case "Y":
- case "G":
- case "g":
- return parseTokenSignedNumber;
- case "YYYYYY":
- case "YYYYY":
- case "GGGGG":
- case "ggggg":
- return strict ? parseTokenSixDigits : parseTokenOneToSixDigits;
- case "S":
- if (strict) {
- return parseTokenOneDigit;
- }
- case "SS":
- if (strict) {
- return parseTokenTwoDigits;
- }
- case "SSS":
- if (strict) {
- return parseTokenThreeDigits;
- }
- case "DDD":
- return parseTokenOneToThreeDigits;
- case "MMM":
- case "MMMM":
- case "dd":
- case "ddd":
- case "dddd":
- return parseTokenWord;
- case "a":
- case "A":
- return config._locale._meridiemParse;
- case "x":
- return parseTokenOffsetMs;
- case "X":
- return parseTokenTimestampMs;
- case "Z":
- case "ZZ":
- return parseTokenTimezone;
- case "T":
- return parseTokenT;
- case "SSSS":
- return parseTokenDigits;
- case "MM":
- case "DD":
- case "YY":
- case "GG":
- case "gg":
- case "HH":
- case "hh":
- case "mm":
- case "ss":
- case "ww":
- case "WW":
- return strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits;
- case "M":
- case "D":
- case "d":
- case "H":
- case "h":
- case "m":
- case "s":
- case "w":
- case "W":
- case "e":
- case "E":
- return parseTokenOneOrTwoDigits;
- case "Do":
- return strict ? config._locale._ordinalParse : config._locale._ordinalParseLenient;
- default:
- a = new RegExp(regexpEscape(unescapeFormat(token.replace("\\", "")), "i"));
- return a;
- }
- }
- function timezoneMinutesFromString(string) {
- string = string || "";
- var possibleTzMatches = string.match(parseTokenTimezone) || [], tzChunk = possibleTzMatches[possibleTzMatches.length - 1] || [], parts = (tzChunk + "").match(parseTimezoneChunker) || ["-", 0, 0], minutes = +(parts[1] * 60) + toInt(parts[2]);
- return parts[0] === "+" ? -minutes : minutes;
- }
- function addTimeToArrayFromToken(token, input, config) {
- var a, datePartArray = config._a;
- switch (token) {
- case "Q":
- if (input != null) {
- datePartArray[MONTH] = (toInt(input) - 1) * 3;
- }
- break;
- case "M":
- case "MM":
- if (input != null) {
- datePartArray[MONTH] = toInt(input) - 1;
- }
- break;
- case "MMM":
- case "MMMM":
- a = config._locale.monthsParse(input, token, config._strict);
- if (a != null) {
- datePartArray[MONTH] = a;
- } else {
- config._pf.invalidMonth = input;
- }
- break;
- case "D":
- case "DD":
- if (input != null) {
- datePartArray[DATE] = toInt(input);
- }
- break;
- case "Do":
- if (input != null) {
- datePartArray[DATE] = toInt(parseInt(input.match(/\d{1,2}/)[0], 10));
- }
- break;
- case "DDD":
- case "DDDD":
- if (input != null) {
- config._dayOfYear = toInt(input);
- }
- break;
- case "YY":
- datePartArray[YEAR] = moment2.parseTwoDigitYear(input);
- break;
- case "YYYY":
- case "YYYYY":
- case "YYYYYY":
- datePartArray[YEAR] = toInt(input);
- break;
- case "a":
- case "A":
- config._isPm = config._locale.isPM(input);
- break;
- case "h":
- case "hh":
- config._pf.bigHour = true;
- case "H":
- case "HH":
- datePartArray[HOUR] = toInt(input);
- break;
- case "m":
- case "mm":
- datePartArray[MINUTE] = toInt(input);
- break;
- case "s":
- case "ss":
- datePartArray[SECOND] = toInt(input);
- break;
- case "S":
- case "SS":
- case "SSS":
- case "SSSS":
- datePartArray[MILLISECOND] = toInt(("0." + input) * 1e3);
- break;
- case "x":
- config._d = new Date(toInt(input));
- break;
- case "X":
- config._d = new Date(parseFloat(input) * 1e3);
- break;
- case "Z":
- case "ZZ":
- config._useUTC = true;
- config._tzm = timezoneMinutesFromString(input);
- break;
- case "dd":
- case "ddd":
- case "dddd":
- a = config._locale.weekdaysParse(input);
- if (a != null) {
- config._w = config._w || {};
- config._w["d"] = a;
- } else {
- config._pf.invalidWeekday = input;
- }
- break;
- case "w":
- case "ww":
- case "W":
- case "WW":
- case "d":
- case "e":
- case "E":
- token = token.substr(0, 1);
- case "gggg":
- case "GGGG":
- case "GGGGG":
- token = token.substr(0, 2);
- if (input) {
- config._w = config._w || {};
- config._w[token] = toInt(input);
- }
- break;
- case "gg":
- case "GG":
- config._w = config._w || {};
- config._w[token] = moment2.parseTwoDigitYear(input);
- }
- }
- function dayOfYearFromWeekInfo(config) {
- var w, weekYear, week, weekday, dow, doy, temp;
- w = config._w;
- if (w.GG != null || w.W != null || w.E != null) {
- dow = 1;
- doy = 4;
- weekYear = dfl(w.GG, config._a[YEAR], weekOfYear(moment2(), 1, 4).year);
- week = dfl(w.W, 1);
- weekday = dfl(w.E, 1);
- } else {
- dow = config._locale._week.dow;
- doy = config._locale._week.doy;
- weekYear = dfl(w.gg, config._a[YEAR], weekOfYear(moment2(), dow, doy).year);
- week = dfl(w.w, 1);
- if (w.d != null) {
- weekday = w.d;
- if (weekday < dow) {
- ++week;
- }
- } else if (w.e != null) {
- weekday = w.e + dow;
- } else {
- weekday = dow;
- }
- }
- temp = dayOfYearFromWeeks(weekYear, week, weekday, doy, dow);
- config._a[YEAR] = temp.year;
- config._dayOfYear = temp.dayOfYear;
- }
- function dateFromConfig(config) {
- var i2, date, input = [], currentDate, yearToUse;
- if (config._d) {
- return;
- }
- currentDate = currentDateArray(config);
- if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
- dayOfYearFromWeekInfo(config);
- }
- if (config._dayOfYear) {
- yearToUse = dfl(config._a[YEAR], currentDate[YEAR]);
- if (config._dayOfYear > daysInYear(yearToUse)) {
- config._pf._overflowDayOfYear = true;
- }
- date = makeUTCDate(yearToUse, 0, config._dayOfYear);
- config._a[MONTH] = date.getUTCMonth();
- config._a[DATE] = date.getUTCDate();
- }
- for (i2 = 0; i2 < 3 && config._a[i2] == null; ++i2) {
- config._a[i2] = input[i2] = currentDate[i2];
- }
- for (; i2 < 7; i2++) {
- config._a[i2] = input[i2] = config._a[i2] == null ? i2 === 2 ? 1 : 0 : config._a[i2];
- }
- if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) {
- config._nextDay = true;
- config._a[HOUR] = 0;
- }
- config._d = (config._useUTC ? makeUTCDate : makeDate).apply(null, input);
- if (config._tzm != null) {
- config._d.setUTCMinutes(config._d.getUTCMinutes() + config._tzm);
- }
- if (config._nextDay) {
- config._a[HOUR] = 24;
- }
- }
- function dateFromObject(config) {
- var normalizedInput;
- if (config._d) {
- return;
- }
- normalizedInput = normalizeObjectUnits(config._i);
- config._a = [
- normalizedInput.year,
- normalizedInput.month,
- normalizedInput.day || normalizedInput.date,
- normalizedInput.hour,
- normalizedInput.minute,
- normalizedInput.second,
- normalizedInput.millisecond
- ];
- dateFromConfig(config);
- }
- function currentDateArray(config) {
- var now = new Date();
- if (config._useUTC) {
- return [
- now.getUTCFullYear(),
- now.getUTCMonth(),
- now.getUTCDate()
- ];
- } else {
- return [now.getFullYear(), now.getMonth(), now.getDate()];
- }
- }
- function makeDateFromStringAndFormat(config) {
- if (config._f === moment2.ISO_8601) {
- parseISO(config);
- return;
- }
- config._a = [];
- config._pf.empty = true;
- var string = "" + config._i, i2, parsedInput, tokens, token, skipped, stringLength = string.length, totalParsedInputLength = 0;
- tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];
- for (i2 = 0; i2 < tokens.length; i2++) {
- token = tokens[i2];
- parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];
- if (parsedInput) {
- skipped = string.substr(0, string.indexOf(parsedInput));
- if (skipped.length > 0) {
- config._pf.unusedInput.push(skipped);
- }
- string = string.slice(string.indexOf(parsedInput) + parsedInput.length);
- totalParsedInputLength += parsedInput.length;
- }
- if (formatTokenFunctions[token]) {
- if (parsedInput) {
- config._pf.empty = false;
- } else {
- config._pf.unusedTokens.push(token);
- }
- addTimeToArrayFromToken(token, parsedInput, config);
- } else if (config._strict && !parsedInput) {
- config._pf.unusedTokens.push(token);
- }
- }
- config._pf.charsLeftOver = stringLength - totalParsedInputLength;
- if (string.length > 0) {
- config._pf.unusedInput.push(string);
- }
- if (config._pf.bigHour === true && config._a[HOUR] <= 12) {
- config._pf.bigHour = undefined2;
- }
- if (config._isPm && config._a[HOUR] < 12) {
- config._a[HOUR] += 12;
- }
- if (config._isPm === false && config._a[HOUR] === 12) {
- config._a[HOUR] = 0;
- }
- dateFromConfig(config);
- checkOverflow(config);
- }
- function unescapeFormat(s) {
- return s.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function(matched, p1, p2, p3, p4) {
- return p1 || p2 || p3 || p4;
- });
- }
- function regexpEscape(s) {
- return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
- }
- function makeDateFromStringAndArray(config) {
- var tempConfig, bestMoment, scoreToBeat, i2, currentScore;
- if (config._f.length === 0) {
- config._pf.invalidFormat = true;
- config._d = new Date(NaN);
- return;
- }
- for (i2 = 0; i2 < config._f.length; i2++) {
- currentScore = 0;
- tempConfig = copyConfig({}, config);
- if (config._useUTC != null) {
- tempConfig._useUTC = config._useUTC;
- }
- tempConfig._pf = defaultParsingFlags();
- tempConfig._f = config._f[i2];
- makeDateFromStringAndFormat(tempConfig);
- if (!isValid(tempConfig)) {
- continue;
- }
- currentScore += tempConfig._pf.charsLeftOver;
- currentScore += tempConfig._pf.unusedTokens.length * 10;
- tempConfig._pf.score = currentScore;
- if (scoreToBeat == null || currentScore < scoreToBeat) {
- scoreToBeat = currentScore;
- bestMoment = tempConfig;
- }
- }
- extend(config, bestMoment || tempConfig);
- }
- function parseISO(config) {
- var i2, l, string = config._i, match = isoRegex.exec(string);
- if (match) {
- config._pf.iso = true;
- for (i2 = 0, l = isoDates.length; i2 < l; i2++) {
- if (isoDates[i2][1].exec(string)) {
- config._f = isoDates[i2][0] + (match[6] || " ");
- break;
- }
- }
- for (i2 = 0, l = isoTimes.length; i2 < l; i2++) {
- if (isoTimes[i2][1].exec(string)) {
- config._f += isoTimes[i2][0];
- break;
- }
- }
- if (string.match(parseTokenTimezone)) {
- config._f += "Z";
- }
- makeDateFromStringAndFormat(config);
- } else {
- config._isValid = false;
- }
- }
- function makeDateFromString(config) {
- parseISO(config);
- if (config._isValid === false) {
- delete config._isValid;
- moment2.createFromInputFallback(config);
- }
- }
- function map(arr, fn) {
- var res = [], i2;
- for (i2 = 0; i2 < arr.length; ++i2) {
- res.push(fn(arr[i2], i2));
- }
- return res;
- }
- function makeDateFromInput(config) {
- var input = config._i, matched;
- if (input === undefined2) {
- config._d = new Date();
- } else if (isDate(input)) {
- config._d = new Date(+input);
- } else if ((matched = aspNetJsonRegex.exec(input)) !== null) {
- config._d = new Date(+matched[1]);
- } else if (typeof input === "string") {
- makeDateFromString(config);
- } else if (isArray(input)) {
- config._a = map(input.slice(0), function(obj) {
- return parseInt(obj, 10);
- });
- dateFromConfig(config);
- } else if (typeof input === "object") {
- dateFromObject(config);
- } else if (typeof input === "number") {
- config._d = new Date(input);
- } else {
- moment2.createFromInputFallback(config);
- }
- }
- function makeDate(y, m, d, h, M, s, ms) {
- var date = new Date(y, m, d, h, M, s, ms);
- if (y < 1970) {
- date.setFullYear(y);
- }
- return date;
- }
- function makeUTCDate(y) {
- var date = new Date(Date.UTC.apply(null, arguments));
- if (y < 1970) {
- date.setUTCFullYear(y);
- }
- return date;
- }
- function parseWeekday(input, locale) {
- if (typeof input === "string") {
- if (!isNaN(input)) {
- input = parseInt(input, 10);
- } else {
- input = locale.weekdaysParse(input);
- if (typeof input !== "number") {
- return null;
- }
- }
- }
- return input;
- }
- function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
- return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
- }
- function relativeTime(posNegDuration, withoutSuffix, locale) {
- var duration = moment2.duration(posNegDuration).abs(), seconds = round(duration.as("s")), minutes = round(duration.as("m")), hours = round(duration.as("h")), days = round(duration.as("d")), months = round(duration.as("M")), years = round(duration.as("y")), args = seconds < relativeTimeThresholds.s && ["s", seconds] || minutes === 1 && ["m"] || minutes < relativeTimeThresholds.m && ["mm", minutes] || hours === 1 && ["h"] || hours < relativeTimeThresholds.h && ["hh", hours] || days === 1 && ["d"] || days < relativeTimeThresholds.d && ["dd", days] || months === 1 && ["M"] || months < relativeTimeThresholds.M && ["MM", months] || years === 1 && ["y"] || ["yy", years];
- args[2] = withoutSuffix;
- args[3] = +posNegDuration > 0;
- args[4] = locale;
- return substituteTimeAgo.apply({}, args);
- }
- function weekOfYear(mom, firstDayOfWeek, firstDayOfWeekOfYear) {
- var end = firstDayOfWeekOfYear - firstDayOfWeek, daysToDayOfWeek = firstDayOfWeekOfYear - mom.day(), adjustedMoment;
- if (daysToDayOfWeek > end) {
- daysToDayOfWeek -= 7;
- }
- if (daysToDayOfWeek < end - 7) {
- daysToDayOfWeek += 7;
- }
- adjustedMoment = moment2(mom).add(daysToDayOfWeek, "d");
- return {
- week: Math.ceil(adjustedMoment.dayOfYear() / 7),
- year: adjustedMoment.year()
- };
- }
- function dayOfYearFromWeeks(year, week, weekday, firstDayOfWeekOfYear, firstDayOfWeek) {
- var d = makeUTCDate(year, 0, 1).getUTCDay(), daysToAdd, dayOfYear;
- d = d === 0 ? 7 : d;
- weekday = weekday != null ? weekday : firstDayOfWeek;
- daysToAdd = firstDayOfWeek - d + (d > firstDayOfWeekOfYear ? 7 : 0) - (d < firstDayOfWeek ? 7 : 0);
- dayOfYear = 7 * (week - 1) + (weekday - firstDayOfWeek) + daysToAdd + 1;
- return {
- year: dayOfYear > 0 ? year : year - 1,
- dayOfYear: dayOfYear > 0 ? dayOfYear : daysInYear(year - 1) + dayOfYear
- };
- }
- function makeMoment(config) {
- var input = config._i, format = config._f, res;
- config._locale = config._locale || moment2.localeData(config._l);
- if (input === null || format === undefined2 && input === "") {
- return moment2.invalid({ nullInput: true });
- }
- if (typeof input === "string") {
- config._i = input = config._locale.preparse(input);
- }
- if (moment2.isMoment(input)) {
- return new Moment(input, true);
- } else if (format) {
- if (isArray(format)) {
- makeDateFromStringAndArray(config);
- } else {
- makeDateFromStringAndFormat(config);
- }
- } else {
- makeDateFromInput(config);
- }
- res = new Moment(config);
- if (res._nextDay) {
- res.add(1, "d");
- res._nextDay = undefined2;
- }
- return res;
- }
- moment2 = function(input, format, locale, strict) {
- var c;
- if (typeof locale === "boolean") {
- strict = locale;
- locale = undefined2;
- }
- c = {};
- c._isAMomentObject = true;
- c._i = input;
- c._f = format;
- c._l = locale;
- c._strict = strict;
- c._isUTC = false;
- c._pf = defaultParsingFlags();
- return makeMoment(c);
- };
- moment2.suppressDeprecationWarnings = false;
- moment2.createFromInputFallback = deprecate("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.", function(config) {
- config._d = new Date(config._i + (config._useUTC ? " UTC" : ""));
- });
- function pickBy(fn, moments) {
- var res, i2;
- if (moments.length === 1 && isArray(moments[0])) {
- moments = moments[0];
- }
- if (!moments.length) {
- return moment2();
- }
- res = moments[0];
- for (i2 = 1; i2 < moments.length; ++i2) {
- if (moments[i2][fn](res)) {
- res = moments[i2];
- }
- }
- return res;
- }
- moment2.min = function() {
- var args = [].slice.call(arguments, 0);
- return pickBy("isBefore", args);
- };
- moment2.max = function() {
- var args = [].slice.call(arguments, 0);
- return pickBy("isAfter", args);
- };
- moment2.utc = function(input, format, locale, strict) {
- var c;
- if (typeof locale === "boolean") {
- strict = locale;
- locale = undefined2;
- }
- c = {};
- c._isAMomentObject = true;
- c._useUTC = true;
- c._isUTC = true;
- c._l = locale;
- c._i = input;
- c._f = format;
- c._strict = strict;
- c._pf = defaultParsingFlags();
- return makeMoment(c).utc();
- };
- moment2.unix = function(input) {
- return moment2(input * 1e3);
- };
- moment2.duration = function(input, key) {
- var duration = input, match = null, sign, ret, parseIso, diffRes;
- if (moment2.isDuration(input)) {
- duration = {
- ms: input._milliseconds,
- d: input._days,
- M: input._months
- };
- } else if (typeof input === "number") {
- duration = {};
- if (key) {
- duration[key] = input;
- } else {
- duration.milliseconds = input;
- }
- } else if (!!(match = aspNetTimeSpanJsonRegex.exec(input))) {
- sign = match[1] === "-" ? -1 : 1;
- duration = {
- y: 0,
- d: toInt(match[DATE]) * sign,
- h: toInt(match[HOUR]) * sign,
- m: toInt(match[MINUTE]) * sign,
- s: toInt(match[SECOND]) * sign,
- ms: toInt(match[MILLISECOND]) * sign
- };
- } else if (!!(match = isoDurationRegex.exec(input))) {
- sign = match[1] === "-" ? -1 : 1;
- parseIso = function(inp) {
- var res = inp && parseFloat(inp.replace(",", "."));
- return (isNaN(res) ? 0 : res) * sign;
- };
- duration = {
- y: parseIso(match[2]),
- M: parseIso(match[3]),
- d: parseIso(match[4]),
- h: parseIso(match[5]),
- m: parseIso(match[6]),
- s: parseIso(match[7]),
- w: parseIso(match[8])
- };
- } else if (typeof duration === "object" && ("from" in duration || "to" in duration)) {
- diffRes = momentsDifference(moment2(duration.from), moment2(duration.to));
- duration = {};
- duration.ms = diffRes.milliseconds;
- duration.M = diffRes.months;
- }
- ret = new Duration(duration);
- if (moment2.isDuration(input) && hasOwnProp(input, "_locale")) {
- ret._locale = input._locale;
- }
- return ret;
- };
- moment2.version = VERSION;
- moment2.defaultFormat = isoFormat;
- moment2.ISO_8601 = function() {
- };
- moment2.momentProperties = momentProperties;
- moment2.updateOffset = function() {
- };
- moment2.relativeTimeThreshold = function(threshold, limit) {
- if (relativeTimeThresholds[threshold] === undefined2) {
- return false;
- }
- if (limit === undefined2) {
- return relativeTimeThresholds[threshold];
- }
- relativeTimeThresholds[threshold] = limit;
- return true;
- };
- moment2.lang = deprecate("moment.lang is deprecated. Use moment.locale instead.", function(key, value) {
- return moment2.locale(key, value);
- });
- moment2.locale = function(key, values) {
- var data;
- if (key) {
- if (typeof values !== "undefined") {
- data = moment2.defineLocale(key, values);
- } else {
- data = moment2.localeData(key);
- }
- if (data) {
- moment2.duration._locale = moment2._locale = data;
- }
- }
- return moment2._locale._abbr;
- };
- moment2.defineLocale = function(name, values) {
- if (values !== null) {
- values.abbr = name;
- if (!locales[name]) {
- locales[name] = new Locale();
- }
- locales[name].set(values);
- moment2.locale(name);
- return locales[name];
- } else {
- delete locales[name];
- return null;
- }
- };
- moment2.langData = deprecate("moment.langData is deprecated. Use moment.localeData instead.", function(key) {
- return moment2.localeData(key);
- });
- moment2.localeData = function(key) {
- var locale;
- if (key && key._locale && key._locale._abbr) {
- key = key._locale._abbr;
- }
- if (!key) {
- return moment2._locale;
- }
- if (!isArray(key)) {
- locale = loadLocale(key);
- if (locale) {
- return locale;
- }
- key = [key];
- }
- return chooseLocale(key);
- };
- moment2.isMoment = function(obj) {
- return obj instanceof Moment || obj != null && hasOwnProp(obj, "_isAMomentObject");
- };
- moment2.isDuration = function(obj) {
- return obj instanceof Duration;
- };
- for (i = lists.length - 1; i >= 0; --i) {
- makeList(lists[i]);
- }
- moment2.normalizeUnits = function(units) {
- return normalizeUnits(units);
- };
- moment2.invalid = function(flags) {
- var m = moment2.utc(NaN);
- if (flags != null) {
- extend(m._pf, flags);
- } else {
- m._pf.userInvalidated = true;
- }
- return m;
- };
- moment2.parseZone = function() {
- return moment2.apply(null, arguments).parseZone();
- };
- moment2.parseTwoDigitYear = function(input) {
- return toInt(input) + (toInt(input) > 68 ? 1900 : 2e3);
- };
- extend(moment2.fn = Moment.prototype, {
- clone: function() {
- return moment2(this);
- },
- valueOf: function() {
- return +this._d + (this._offset || 0) * 6e4;
- },
- unix: function() {
- return Math.floor(+this / 1e3);
- },
- toString: function() {
- return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ");
- },
- toDate: function() {
- return this._offset ? new Date(+this) : this._d;
- },
- toISOString: function() {
- var m = moment2(this).utc();
- if (0 < m.year() && m.year() <= 9999) {
- if (typeof Date.prototype.toISOString === "function") {
- return this.toDate().toISOString();
- } else {
- return formatMoment(m, "YYYY-MM-DD[T]HH:mm:ss.SSS[Z]");
- }
- } else {
- return formatMoment(m, "YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]");
- }
- },
- toArray: function() {
- var m = this;
- return [
- m.year(),
- m.month(),
- m.date(),
- m.hours(),
- m.minutes(),
- m.seconds(),
- m.milliseconds()
- ];
- },
- isValid: function() {
- return isValid(this);
- },
- isDSTShifted: function() {
- if (this._a) {
- return this.isValid() && compareArrays(this._a, (this._isUTC ? moment2.utc(this._a) : moment2(this._a)).toArray()) > 0;
- }
- return false;
- },
- parsingFlags: function() {
- return extend({}, this._pf);
- },
- invalidAt: function() {
- return this._pf.overflow;
- },
- utc: function(keepLocalTime) {
- return this.zone(0, keepLocalTime);
- },
- local: function(keepLocalTime) {
- if (this._isUTC) {
- this.zone(0, keepLocalTime);
- this._isUTC = false;
- if (keepLocalTime) {
- this.add(this._dateTzOffset(), "m");
- }
- }
- return this;
- },
- format: function(inputString) {
- var output = formatMoment(this, inputString || moment2.defaultFormat);
- return this.localeData().postformat(output);
- },
- add: createAdder(1, "add"),
- subtract: createAdder(-1, "subtract"),
- diff: function(input, units, asFloat) {
- var that = makeAs(input, this), zoneDiff = (this.zone() - that.zone()) * 6e4, diff, output, daysAdjust;
- units = normalizeUnits(units);
- if (units === "year" || units === "month") {
- diff = (this.daysInMonth() + that.daysInMonth()) * 432e5;
- output = (this.year() - that.year()) * 12 + (this.month() - that.month());
- daysAdjust = this - moment2(this).startOf("month") - (that - moment2(that).startOf("month"));
- daysAdjust -= (this.zone() - moment2(this).startOf("month").zone() - (that.zone() - moment2(that).startOf("month").zone())) * 6e4;
- output += daysAdjust / diff;
- if (units === "year") {
- output = output / 12;
- }
- } else {
- diff = this - that;
- output = units === "second" ? diff / 1e3 : units === "minute" ? diff / 6e4 : units === "hour" ? diff / 36e5 : units === "day" ? (diff - zoneDiff) / 864e5 : units === "week" ? (diff - zoneDiff) / 6048e5 : diff;
- }
- return asFloat ? output : absRound(output);
- },
- from: function(time, withoutSuffix) {
- return moment2.duration({ to: this, from: time }).locale(this.locale()).humanize(!withoutSuffix);
- },
- fromNow: function(withoutSuffix) {
- return this.from(moment2(), withoutSuffix);
- },
- calendar: function(time) {
- var now = time || moment2(), sod = makeAs(now, this).startOf("day"), diff = this.diff(sod, "days", true), format = diff < -6 ? "sameElse" : diff < -1 ? "lastWeek" : diff < 0 ? "lastDay" : diff < 1 ? "sameDay" : diff < 2 ? "nextDay" : diff < 7 ? "nextWeek" : "sameElse";
- return this.format(this.localeData().calendar(format, this, moment2(now)));
- },
- isLeapYear: function() {
- return isLeapYear(this.year());
- },
- isDST: function() {
- return this.zone() < this.clone().month(0).zone() || this.zone() < this.clone().month(5).zone();
- },
- day: function(input) {
- var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
- if (input != null) {
- input = parseWeekday(input, this.localeData());
- return this.add(input - day, "d");
- } else {
- return day;
- }
- },
- month: makeAccessor("Month", true),
- startOf: function(units) {
- units = normalizeUnits(units);
- switch (units) {
- case "year":
- this.month(0);
- case "quarter":
- case "month":
- this.date(1);
- case "week":
- case "isoWeek":
- case "day":
- this.hours(0);
- case "hour":
- this.minutes(0);
- case "minute":
- this.seconds(0);
- case "second":
- this.milliseconds(0);
- }
- if (units === "week") {
- this.weekday(0);
- } else if (units === "isoWeek") {
- this.isoWeekday(1);
- }
- if (units === "quarter") {
- this.month(Math.floor(this.month() / 3) * 3);
- }
- return this;
- },
- endOf: function(units) {
- units = normalizeUnits(units);
- if (units === undefined2 || units === "millisecond") {
- return this;
- }
- return this.startOf(units).add(1, units === "isoWeek" ? "week" : units).subtract(1, "ms");
- },
- isAfter: function(input, units) {
- var inputMs;
- units = normalizeUnits(typeof units !== "undefined" ? units : "millisecond");
- if (units === "millisecond") {
- input = moment2.isMoment(input) ? input : moment2(input);
- return +this > +input;
- } else {
- inputMs = moment2.isMoment(input) ? +input : +moment2(input);
- return inputMs < +this.clone().startOf(units);
- }
- },
- isBefore: function(input, units) {
- var inputMs;
- units = normalizeUnits(typeof units !== "undefined" ? units : "millisecond");
- if (units === "millisecond") {
- input = moment2.isMoment(input) ? input : moment2(input);
- return +this < +input;
- } else {
- inputMs = moment2.isMoment(input) ? +input : +moment2(input);
- return +this.clone().endOf(units) < inputMs;
- }
- },
- isSame: function(input, units) {
- var inputMs;
- units = normalizeUnits(units || "millisecond");
- if (units === "millisecond") {
- input = moment2.isMoment(input) ? input : moment2(input);
- return +this === +input;
- } else {
- inputMs = +moment2(input);
- return +this.clone().startOf(units) <= inputMs && inputMs <= +this.clone().endOf(units);
- }
- },
- min: deprecate("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548", function(other) {
- other = moment2.apply(null, arguments);
- return other < this ? this : other;
- }),
- max: deprecate("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548", function(other) {
- other = moment2.apply(null, arguments);
- return other > this ? this : other;
- }),
- zone: function(input, keepLocalTime) {
- var offset = this._offset || 0, localAdjust;
- if (input != null) {
- if (typeof input === "string") {
- input = timezoneMinutesFromString(input);
- }
- if (Math.abs(input) < 16) {
- input = input * 60;
- }
- if (!this._isUTC && keepLocalTime) {
- localAdjust = this._dateTzOffset();
- }
- this._offset = input;
- this._isUTC = true;
- if (localAdjust != null) {
- this.subtract(localAdjust, "m");
- }
- if (offset !== input) {
- if (!keepLocalTime || this._changeInProgress) {
- addOrSubtractDurationFromMoment(this, moment2.duration(offset - input, "m"), 1, false);
- } else if (!this._changeInProgress) {
- this._changeInProgress = true;
- moment2.updateOffset(this, true);
- this._changeInProgress = null;
- }
- }
- } else {
- return this._isUTC ? offset : this._dateTzOffset();
- }
- return this;
- },
- zoneAbbr: function() {
- return this._isUTC ? "UTC" : "";
- },
- zoneName: function() {
- return this._isUTC ? "Coordinated Universal Time" : "";
- },
- parseZone: function() {
- if (this._tzm) {
- this.zone(this._tzm);
- } else if (typeof this._i === "string") {
- this.zone(this._i);
- }
- return this;
- },
- hasAlignedHourOffset: function(input) {
- if (!input) {
- input = 0;
- } else {
- input = moment2(input).zone();
- }
- return (this.zone() - input) % 60 === 0;
- },
- daysInMonth: function() {
- return daysInMonth(this.year(), this.month());
- },
- dayOfYear: function(input) {
- var dayOfYear = round((moment2(this).startOf("day") - moment2(this).startOf("year")) / 864e5) + 1;
- return input == null ? dayOfYear : this.add(input - dayOfYear, "d");
- },
- quarter: function(input) {
- return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);
- },
- weekYear: function(input) {
- var year = weekOfYear(this, this.localeData()._week.dow, this.localeData()._week.doy).year;
- return input == null ? year : this.add(input - year, "y");
- },
- isoWeekYear: function(input) {
- var year = weekOfYear(this, 1, 4).year;
- return input == null ? year : this.add(input - year, "y");
- },
- week: function(input) {
- var week = this.localeData().week(this);
- return input == null ? week : this.add((input - week) * 7, "d");
- },
- isoWeek: function(input) {
- var week = weekOfYear(this, 1, 4).week;
- return input == null ? week : this.add((input - week) * 7, "d");
- },
- weekday: function(input) {
- var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
- return input == null ? weekday : this.add(input - weekday, "d");
- },
- isoWeekday: function(input) {
- return input == null ? this.day() || 7 : this.day(this.day() % 7 ? input : input - 7);
- },
- isoWeeksInYear: function() {
- return weeksInYear(this.year(), 1, 4);
- },
- weeksInYear: function() {
- var weekInfo = this.localeData()._week;
- return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
- },
- get: function(units) {
- units = normalizeUnits(units);
- return this[units]();
- },
- set: function(units, value) {
- units = normalizeUnits(units);
- if (typeof this[units] === "function") {
- this[units](value);
- }
- return this;
- },
- locale: function(key) {
- var newLocaleData;
- if (key === undefined2) {
- return this._locale._abbr;
- } else {
- newLocaleData = moment2.localeData(key);
- if (newLocaleData != null) {
- this._locale = newLocaleData;
- }
- return this;
- }
- },
- lang: deprecate("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.", function(key) {
- if (key === undefined2) {
- return this.localeData();
- } else {
- return this.locale(key);
- }
- }),
- localeData: function() {
- return this._locale;
- },
- _dateTzOffset: function() {
- return Math.round(this._d.getTimezoneOffset() / 15) * 15;
- }
- });
- function rawMonthSetter(mom, value) {
- var dayOfMonth;
- if (typeof value === "string") {
- value = mom.localeData().monthsParse(value);
- if (typeof value !== "number") {
- return mom;
- }
- }
- dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));
- mom._d["set" + (mom._isUTC ? "UTC" : "") + "Month"](value, dayOfMonth);
- return mom;
- }
- function rawGetter(mom, unit) {
- return mom._d["get" + (mom._isUTC ? "UTC" : "") + unit]();
- }
- function rawSetter(mom, unit, value) {
- if (unit === "Month") {
- return rawMonthSetter(mom, value);
- } else {
- return mom._d["set" + (mom._isUTC ? "UTC" : "") + unit](value);
- }
- }
- function makeAccessor(unit, keepTime) {
- return function(value) {
- if (value != null) {
- rawSetter(this, unit, value);
- moment2.updateOffset(this, keepTime);
- return this;
- } else {
- return rawGetter(this, unit);
- }
- };
- }
- moment2.fn.millisecond = moment2.fn.milliseconds = makeAccessor("Milliseconds", false);
- moment2.fn.second = moment2.fn.seconds = makeAccessor("Seconds", false);
- moment2.fn.minute = moment2.fn.minutes = makeAccessor("Minutes", false);
- moment2.fn.hour = moment2.fn.hours = makeAccessor("Hours", true);
- moment2.fn.date = makeAccessor("Date", true);
- moment2.fn.dates = deprecate("dates accessor is deprecated. Use date instead.", makeAccessor("Date", true));
- moment2.fn.year = makeAccessor("FullYear", true);
- moment2.fn.years = deprecate("years accessor is deprecated. Use year instead.", makeAccessor("FullYear", true));
- moment2.fn.days = moment2.fn.day;
- moment2.fn.months = moment2.fn.month;
- moment2.fn.weeks = moment2.fn.week;
- moment2.fn.isoWeeks = moment2.fn.isoWeek;
- moment2.fn.quarters = moment2.fn.quarter;
- moment2.fn.toJSON = moment2.fn.toISOString;
- function daysToYears(days) {
- return days * 400 / 146097;
- }
- function yearsToDays(years) {
- return years * 146097 / 400;
- }
- extend(moment2.duration.fn = Duration.prototype, {
- _bubble: function() {
- var milliseconds = this._milliseconds, days = this._days, months = this._months, data = this._data, seconds, minutes, hours, years = 0;
- data.milliseconds = milliseconds % 1e3;
- seconds = absRound(milliseconds / 1e3);
- data.seconds = seconds % 60;
- minutes = absRound(seconds / 60);
- data.minutes = minutes % 60;
- hours = absRound(minutes / 60);
- data.hours = hours % 24;
- days += absRound(hours / 24);
- years = absRound(daysToYears(days));
- days -= absRound(yearsToDays(years));
- months += absRound(days / 30);
- days %= 30;
- years += absRound(months / 12);
- months %= 12;
- data.days = days;
- data.months = months;
- data.years = years;
- },
- abs: function() {
- this._milliseconds = Math.abs(this._milliseconds);
- this._days = Math.abs(this._days);
- this._months = Math.abs(this._months);
- this._data.milliseconds = Math.abs(this._data.milliseconds);
- this._data.seconds = Math.abs(this._data.seconds);
- this._data.minutes = Math.abs(this._data.minutes);
- this._data.hours = Math.abs(this._data.hours);
- this._data.months = Math.abs(this._data.months);
- this._data.years = Math.abs(this._data.years);
- return this;
- },
- weeks: function() {
- return absRound(this.days() / 7);
- },
- valueOf: function() {
- return this._milliseconds + this._days * 864e5 + this._months % 12 * 2592e6 + toInt(this._months / 12) * 31536e6;
- },
- humanize: function(withSuffix) {
- var output = relativeTime(this, !withSuffix, this.localeData());
- if (withSuffix) {
- output = this.localeData().pastFuture(+this, output);
- }
- return this.localeData().postformat(output);
- },
- add: function(input, val) {
- var dur = moment2.duration(input, val);
- this._milliseconds += dur._milliseconds;
- this._days += dur._days;
- this._months += dur._months;
- this._bubble();
- return this;
- },
- subtract: function(input, val) {
- var dur = moment2.duration(input, val);
- this._milliseconds -= dur._milliseconds;
- this._days -= dur._days;
- this._months -= dur._months;
- this._bubble();
- return this;
- },
- get: function(units) {
- units = normalizeUnits(units);
- return this[units.toLowerCase() + "s"]();
- },
- as: function(units) {
- var days, months;
- units = normalizeUnits(units);
- if (units === "month" || units === "year") {
- days = this._days + this._milliseconds / 864e5;
- months = this._months + daysToYears(days) * 12;
- return units === "month" ? months : months / 12;
- } else {
- days = this._days + Math.round(yearsToDays(this._months / 12));
- switch (units) {
- case "week":
- return days / 7 + this._milliseconds / 6048e5;
- case "day":
- return days + this._milliseconds / 864e5;
- case "hour":
- return days * 24 + this._milliseconds / 36e5;
- case "minute":
- return days * 24 * 60 + this._milliseconds / 6e4;
- case "second":
- return days * 24 * 60 * 60 + this._milliseconds / 1e3;
- case "millisecond":
- return Math.floor(days * 24 * 60 * 60 * 1e3) + this._milliseconds;
- default:
- throw new Error("Unknown unit " + units);
- }
- }
- },
- lang: moment2.fn.lang,
- locale: moment2.fn.locale,
- toIsoString: deprecate("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)", function() {
- return this.toISOString();
- }),
- toISOString: function() {
- var years = Math.abs(this.years()), months = Math.abs(this.months()), days = Math.abs(this.days()), hours = Math.abs(this.hours()), minutes = Math.abs(this.minutes()), seconds = Math.abs(this.seconds() + this.milliseconds() / 1e3);
- if (!this.asSeconds()) {
- return "P0D";
- }
- return (this.asSeconds() < 0 ? "-" : "") + "P" + (years ? years + "Y" : "") + (months ? months + "M" : "") + (days ? days + "D" : "") + (hours || minutes || seconds ? "T" : "") + (hours ? hours + "H" : "") + (minutes ? minutes + "M" : "") + (seconds ? seconds + "S" : "");
- },
- localeData: function() {
- return this._locale;
- }
- });
- moment2.duration.fn.toString = moment2.duration.fn.toISOString;
- function makeDurationGetter(name) {
- moment2.duration.fn[name] = function() {
- return this._data[name];
- };
- }
- for (i in unitMillisecondFactors) {
- if (hasOwnProp(unitMillisecondFactors, i)) {
- makeDurationGetter(i.toLowerCase());
- }
- }
- moment2.duration.fn.asMilliseconds = function() {
- return this.as("ms");
- };
- moment2.duration.fn.asSeconds = function() {
- return this.as("s");
- };
- moment2.duration.fn.asMinutes = function() {
- return this.as("m");
- };
- moment2.duration.fn.asHours = function() {
- return this.as("h");
- };
- moment2.duration.fn.asDays = function() {
- return this.as("d");
- };
- moment2.duration.fn.asWeeks = function() {
- return this.as("weeks");
- };
- moment2.duration.fn.asMonths = function() {
- return this.as("M");
- };
- moment2.duration.fn.asYears = function() {
- return this.as("y");
- };
- moment2.locale("en", {
- ordinalParse: /\d{1,2}(th|st|nd|rd)/,
- ordinal: function(number) {
- var b = number % 10, output = toInt(number % 100 / 10) === 1 ? "th" : b === 1 ? "st" : b === 2 ? "nd" : b === 3 ? "rd" : "th";
- return number + output;
- }
- });
- function makeGlobal(shouldDeprecate) {
- if (typeof ender !== "undefined") {
- return;
+ // node_modules/eonasdan-bootstrap-datetimepicker/src/js/bootstrap-datetimepicker.js
+ var require_bootstrap_datetimepicker = __commonJS({
+ "node_modules/eonasdan-bootstrap-datetimepicker/src/js/bootstrap-datetimepicker.js"(exports, module) {
+ (function(factory) {
+ "use strict";
+ if (typeof define === "function" && define.amd) {
+ define(["jquery", "moment"], factory);
+ } else if (typeof exports === "object") {
+ module.exports = factory(require_jquery(), require_moment());
+ } else {
+ if (typeof jQuery === "undefined") {
+ throw "bootstrap-datetimepicker requires jQuery to be loaded first";
}
- oldGlobalMoment = globalScope.moment;
- if (shouldDeprecate) {
- globalScope.moment = deprecate("Accessing Moment through the global scope is deprecated, and will be removed in an upcoming release.", moment2);
- } else {
- globalScope.moment = moment2;
+ if (typeof moment === "undefined") {
+ throw "bootstrap-datetimepicker requires Moment.js to be loaded first";
}
+ factory(jQuery, moment);
}
- if (hasModule) {
- module.exports = moment2;
- } else if (typeof define === "function" && define.amd) {
- define("moment", function(require2, exports2, module2) {
- if (module2.config && module2.config() && module2.config().noGlobal === true) {
- globalScope.moment = oldGlobalMoment;
- }
- return moment2;
- });
- makeGlobal(true);
- } else {
- makeGlobal();
- }
- }).call(exports);
- }
- });
-
- // node_modules/bootstrap-datetimepicker-npm/src/js/bootstrap-datetimepicker.js
- var require_bootstrap_datetimepicker = __commonJS({
- "node_modules/bootstrap-datetimepicker-npm/src/js/bootstrap-datetimepicker.js"(exports, module) {
- module.exports = function($5) {
+ })(function($5, moment3) {
"use strict";
- var moment2 = require_moment2();
+ if (!moment3) {
+ throw new Error("bootstrap-datetimepicker requires Moment.js to be loaded first");
+ }
var dateTimePicker = function(element, options) {
var picker = {}, date, viewDate, unset = true, input, component = false, widget = false, use24Hours, minViewModeNumber = 0, actualFormat, parseFormats, currentViewMode, datePickerModes = [
{
@@ -15018,31 +12975,21 @@
84: "t",
"delete": 46,
46: "delete"
- }, keyState = {}, getMoment = function(d) {
- var tzEnabled = false, returnMoment, currentZoneOffset, incomingZoneOffset, timeZoneIndicator, dateWithTimeZoneInfo;
- if (moment2.tz !== void 0 && options.timeZone !== void 0 && options.timeZone !== null && options.timeZone !== "") {
- tzEnabled = true;
- }
+ }, keyState = {}, hasTimeZone = function() {
+ return moment3.tz !== void 0 && options.timeZone !== void 0 && options.timeZone !== null && options.timeZone !== "";
+ }, getMoment = function(d) {
+ var returnMoment;
if (d === void 0 || d === null) {
- if (tzEnabled) {
- returnMoment = moment2().tz(options.timeZone).startOf("d");
- } else {
- returnMoment = moment2().startOf("d");
- }
+ returnMoment = moment3();
+ } else if (moment3.isDate(d) || moment3.isMoment(d)) {
+ returnMoment = moment3(d);
+ } else if (hasTimeZone()) {
+ returnMoment = moment3.tz(d, parseFormats, options.useStrict, options.timeZone);
} else {
- if (tzEnabled) {
- currentZoneOffset = moment2().tz(options.timeZone).utcOffset();
- incomingZoneOffset = moment2(d, parseFormats, options.useStrict).utcOffset();
- if (incomingZoneOffset !== currentZoneOffset) {
- timeZoneIndicator = moment2().tz(options.timeZone).format("Z");
- dateWithTimeZoneInfo = moment2(d, parseFormats, options.useStrict).format("YYYY-MM-DD[T]HH:mm:ss") + timeZoneIndicator;
- returnMoment = moment2(dateWithTimeZoneInfo, parseFormats, options.useStrict).tz(options.timeZone);
- } else {
- returnMoment = moment2(d, parseFormats, options.useStrict).tz(options.timeZone);
- }
- } else {
- returnMoment = moment2(d, parseFormats, options.useStrict);
- }
+ returnMoment = moment3(d, parseFormats, options.useStrict);
+ }
+ if (hasTimeZone()) {
+ returnMoment.tz(options.timeZone);
}
return returnMoment;
}, isEnabled = function(granularity) {
@@ -15230,17 +13177,17 @@
} else {
widget.removeClass("pull-right");
}
- if (parent.css("position") !== "relative") {
+ if (parent.css("position") === "static") {
parent = parent.parents().filter(function() {
- return $5(this).css("position") === "relative";
+ return $5(this).css("position") !== "static";
}).first();
}
if (parent.length === 0) {
- throw new Error("datetimepicker component should be placed within a relative positioned container");
+ throw new Error("datetimepicker component should be placed within a non-static positioned container");
}
widget.css({
top: vertical === "top" ? "auto" : position.top + element.outerHeight(),
- bottom: vertical === "top" ? position.top + element.outerHeight() : "auto",
+ bottom: vertical === "top" ? parent.outerHeight() - (parent === element ? 0 : position.top) : "auto",
left: horizontal === "left" ? parent === element ? 0 : position.left : "auto",
right: horizontal === "left" ? "auto" : parent.outerWidth() - element.outerWidth() - (parent === element ? 0 : position.left)
});
@@ -15370,26 +13317,29 @@
}
yearsView.find("td").html(html);
}, updateDecades = function() {
- var decadesView = widget.find(".datepicker-decades"), decadesViewHeader = decadesView.find("th"), startDecade = moment2({ y: viewDate.year() - viewDate.year() % 100 - 1 }), endDecade = startDecade.clone().add(100, "y"), startedAt = startDecade.clone(), html = "";
+ var decadesView = widget.find(".datepicker-decades"), decadesViewHeader = decadesView.find("th"), startDecade = moment3({ y: viewDate.year() - viewDate.year() % 100 - 1 }), endDecade = startDecade.clone().add(100, "y"), startedAt = startDecade.clone(), minDateDecade = false, maxDateDecade = false, endDecadeYear, html = "";
decadesViewHeader.eq(0).find("span").attr("title", options.tooltips.prevCentury);
decadesViewHeader.eq(2).find("span").attr("title", options.tooltips.nextCentury);
decadesView.find(".disabled").removeClass("disabled");
- if (startDecade.isSame(moment2({ y: 1900 })) || options.minDate && options.minDate.isAfter(startDecade, "y")) {
+ if (startDecade.isSame(moment3({ y: 1900 })) || options.minDate && options.minDate.isAfter(startDecade, "y")) {
decadesViewHeader.eq(0).addClass("disabled");
}
decadesViewHeader.eq(1).text(startDecade.year() + "-" + endDecade.year());
- if (startDecade.isSame(moment2({ y: 2e3 })) || options.maxDate && options.maxDate.isBefore(endDecade, "y")) {
+ if (startDecade.isSame(moment3({ y: 2e3 })) || options.maxDate && options.maxDate.isBefore(endDecade, "y")) {
decadesViewHeader.eq(2).addClass("disabled");
}
while (!startDecade.isAfter(endDecade, "y")) {
- html += '' + (startDecade.year() + 1) + " - " + (startDecade.year() + 12) + "";
+ endDecadeYear = startDecade.year() + 12;
+ minDateDecade = options.minDate && options.minDate.isAfter(startDecade, "y") && options.minDate.year() <= endDecadeYear;
+ maxDateDecade = options.maxDate && options.maxDate.isAfter(startDecade, "y") && options.maxDate.year() <= endDecadeYear;
+ html += '' + (startDecade.year() + 1) + " - " + (startDecade.year() + 12) + "";
startDecade.add(12, "y");
}
html += "";
decadesView.find("td").html(html);
decadesViewHeader.eq(1).text(startedAt.year() + 1 + "-" + startDecade.year());
}, fillDate = function() {
- var daysView = widget.find(".datepicker-days"), daysViewHeader = daysView.find("th"), currentDate, html = [], row, clsName, i;
+ var daysView = widget.find(".datepicker-days"), daysViewHeader = daysView.find("th"), currentDate, html = [], row, clsNames = [], i;
if (!hasDate()) {
return;
}
@@ -15413,26 +13363,31 @@
}
html.push(row);
}
- clsName = "";
+ clsNames = ["day"];
if (currentDate.isBefore(viewDate, "M")) {
- clsName += " old";
+ clsNames.push("old");
}
if (currentDate.isAfter(viewDate, "M")) {
- clsName += " new";
+ clsNames.push("new");
}
if (currentDate.isSame(date, "d") && !unset) {
- clsName += " active";
+ clsNames.push("active");
}
if (!isValid(currentDate, "d")) {
- clsName += " disabled";
+ clsNames.push("disabled");
}
if (currentDate.isSame(getMoment(), "d")) {
- clsName += " today";
+ clsNames.push("today");
}
if (currentDate.day() === 0 || currentDate.day() === 6) {
- clsName += " weekend";
+ clsNames.push("weekend");
}
- row.append('
' + currentDate.date() + " | ");
+ notifyEvent({
+ type: "dp.classify",
+ date: currentDate,
+ classNames: clsNames
+ });
+ row.append('' + currentDate.date() + " | ");
currentDate.add(1, "d");
}
daysView.find("tbody").empty().append(html);
@@ -15514,8 +13469,14 @@
return;
}
targetMoment = targetMoment.clone().locale(options.locale);
+ if (hasTimeZone()) {
+ targetMoment.tz(options.timeZone);
+ }
if (options.stepping !== 1) {
- targetMoment.minutes(Math.round(targetMoment.minutes() / options.stepping) * options.stepping % 60).seconds(0);
+ targetMoment.minutes(Math.round(targetMoment.minutes() / options.stepping) * options.stepping).seconds(0);
+ while (options.minDate && targetMoment.isBefore(options.minDate)) {
+ targetMoment.add(options.stepping, "minutes");
+ }
}
if (isValid(targetMoment)) {
date = targetMoment;
@@ -15532,10 +13493,17 @@
} else {
if (!options.keepInvalid) {
input.val(unset ? "" : date.format(actualFormat));
+ } else {
+ notifyEvent({
+ type: "dp.change",
+ date: targetMoment,
+ oldDate
+ });
}
notifyEvent({
type: "dp.error",
- date: targetMoment
+ date: targetMoment,
+ oldDate
});
}
}, hide = function() {
@@ -15568,9 +13536,19 @@
date: date.clone()
});
input.blur();
+ viewDate = date.clone();
return picker;
}, clear = function() {
setValue(null);
+ }, parseInputDate = function(inputDate) {
+ if (options.parseInputDate === void 0) {
+ if (!moment3.isMoment(inputDate) || inputDate instanceof Date) {
+ inputDate = getMoment(inputDate);
+ }
+ } else {
+ inputDate = options.parseInputDate(inputDate);
+ }
+ return inputDate;
}, actions = {
next: function() {
var navFnc = datePickerModes[currentViewMode].navFnc;
@@ -15779,7 +13757,7 @@
}
if (input.val() !== void 0 && input.val().trim().length !== 0) {
setValue(parseInputDate(input.val().trim()));
- } else if (options.useCurrent && unset && (input.is("input") && input.val().trim().length === 0 || options.inline)) {
+ } else if (unset && options.useCurrent && (options.inline || input.is("input") && input.val().trim().length === 0)) {
currentMoment = getMoment();
if (typeof options.useCurrent === "string") {
currentMoment = useCurrentGranularity[options.useCurrent](currentMoment);
@@ -15800,8 +13778,8 @@
if (component && component.hasClass("btn")) {
component.toggleClass("active");
}
- widget.show();
place();
+ widget.show();
if (options.focusOnShow && !input.is(":focus")) {
input.focus();
}
@@ -15811,18 +13789,6 @@
return picker;
}, toggle = function() {
return widget ? hide() : show();
- }, parseInputDate = function(inputDate) {
- if (options.parseInputDate === void 0) {
- if (moment2.isMoment(inputDate) || inputDate instanceof Date) {
- inputDate = moment2(inputDate);
- } else {
- inputDate = getMoment(inputDate);
- }
- } else {
- inputDate = options.parseInputDate(inputDate);
- }
- inputDate.locale(options.locale);
- return inputDate;
}, keydown = function(e) {
var handler = null, index, index2, pressedKeys = [], pressedModifiers = {}, currentKey = e.which, keyBindKeys, allModifiersPressed, pressed = "p";
keyState[currentKey] = pressed;
@@ -15998,7 +13964,7 @@
}
return date.clone();
}
- if (newDate !== null && typeof newDate !== "string" && !moment2.isMoment(newDate) && !(newDate instanceof Date)) {
+ if (newDate !== null && typeof newDate !== "string" && !moment3.isMoment(newDate) && !(newDate instanceof Date)) {
throw new TypeError("date() parameter must be one of [null, string, moment or Date]");
}
setValue(newDate === null ? null : parseInputDate(newDate));
@@ -16009,7 +13975,7 @@
return options.format;
}
if (typeof newFormat !== "string" && (typeof newFormat !== "boolean" || newFormat !== false)) {
- throw new TypeError("format() expects a sting or boolean:false parameter " + newFormat);
+ throw new TypeError("format() expects a string or boolean:false parameter " + newFormat);
}
options.format = newFormat;
if (actualFormat) {
@@ -16021,6 +13987,9 @@
if (arguments.length === 0) {
return options.timeZone;
}
+ if (typeof newZone !== "string") {
+ throw new TypeError("newZone() expects a string parameter");
+ }
options.timeZone = newZone;
return picker;
};
@@ -16107,8 +14076,8 @@
var tries = 0;
while (!isValid(date, "d")) {
date.add(1, "d");
- if (tries === 7) {
- throw "Tried 7 times to find a valid date";
+ if (tries === 31) {
+ throw "Tried 31 times to find a valid date";
}
tries++;
}
@@ -16190,6 +14159,8 @@
if (typeof defaultDate === "string") {
if (defaultDate === "now" || defaultDate === "moment") {
defaultDate = getMoment();
+ } else {
+ defaultDate = getMoment(defaultDate);
}
}
var parsedDate = parseInputDate(defaultDate);
@@ -16209,7 +14180,7 @@
if (arguments.length === 0) {
return options.locale;
}
- if (!moment2.localeData(locale)) {
+ if (!moment3.localeData(locale)) {
throw new TypeError("locale() locale " + locale + " is not loaded from moment locales!");
}
options.locale = locale;
@@ -16471,6 +14442,9 @@
return picker;
};
picker.keyBinds = function(keyBinds) {
+ if (arguments.length === 0) {
+ return options.keyBinds;
+ }
options.keyBinds = keyBinds;
return picker;
};
@@ -16614,7 +14588,7 @@
viewDate = date.clone();
return picker;
}
- if (typeof newDate !== "string" && !moment2.isMoment(newDate) && !(newDate instanceof Date)) {
+ if (typeof newDate !== "string" && !moment3.isMoment(newDate) && !(newDate instanceof Date)) {
throw new TypeError("viewDate() parameter must be one of [string, moment or Date]");
}
viewDate = parseInputDate(newDate);
@@ -16625,14 +14599,14 @@
input = element;
} else {
input = element.find(options.datepickerInput);
- if (input.size() === 0) {
+ if (input.length === 0) {
input = element.find("input");
} else if (!input.is("input")) {
throw new Error('CSS class "' + options.datepickerInput + '" cannot be applied to non input element');
}
}
if (element.hasClass("input-group")) {
- if (element.find(".datepickerbutton").size() === 0) {
+ if (element.find(".datepickerbutton").length === 0) {
component = element.find(".input-group-addon");
} else {
component = element.find(".datepickerbutton");
@@ -16661,16 +14635,34 @@
return picker;
};
$5.fn.datetimepicker = function(options) {
- return this.each(function() {
- var $this = $5(this);
- if (!$this.data("DateTimePicker")) {
- options = $5.extend(true, {}, $5.fn.datetimepicker.defaults, options);
- $this.data("DateTimePicker", dateTimePicker($this, options));
+ options = options || {};
+ var args = Array.prototype.slice.call(arguments, 1), isInstance = true, thisMethods = ["destroy", "hide", "show", "toggle"], returnValue;
+ if (typeof options === "object") {
+ return this.each(function() {
+ var $this = $5(this), _options;
+ if (!$this.data("DateTimePicker")) {
+ _options = $5.extend(true, {}, $5.fn.datetimepicker.defaults, options);
+ $this.data("DateTimePicker", dateTimePicker($this, _options));
+ }
+ });
+ } else if (typeof options === "string") {
+ this.each(function() {
+ var $this = $5(this), instance = $this.data("DateTimePicker");
+ if (!instance) {
+ throw new Error('bootstrap-datetimepicker("' + options + '") method was called on an element that is not using DateTimePicker');
+ }
+ returnValue = instance[options].apply(instance, args);
+ isInstance = returnValue === instance;
+ });
+ if (isInstance || $5.inArray(options, thisMethods) > -1) {
+ return this;
}
- });
+ return returnValue;
+ }
+ throw new TypeError("Invalid arguments for DateTimePicker: " + options);
};
$5.fn.datetimepicker.defaults = {
- timeZone: "Etc/UTC",
+ timeZone: "",
format: false,
dayViewHeaderFormat: "MMMM YYYY",
extraFormats: false,
@@ -16679,7 +14671,7 @@
maxDate: false,
useCurrent: true,
collapse: true,
- locale: moment2.locale(),
+ locale: moment3.locale(),
defaultDate: false,
disabledDates: false,
enabledDates: false,
@@ -16830,6 +14822,9 @@
this.hide();
},
"control space": function(widget) {
+ if (!widget) {
+ return;
+ }
if (widget.find(".timepicker").is(":visible")) {
widget.find('.btn[data-action="togglePeriod"]').click();
}
@@ -16848,7 +14843,8 @@
enabledHours: false,
viewDate: false
};
- };
+ return $5.fn.datetimepicker;
+ });
}
});
@@ -16869,7 +14865,6 @@
var import_moment = __toESM(require_moment());
var import_bootstrap_datetimepicker = __toESM(require_bootstrap_datetimepicker());
window.moment = import_moment.default;
- (0, import_bootstrap_datetimepicker.default)(import_jquery2.default);
window.$ = import_jquery2.default;
(0, import_jquery2.default)(function() {
(0, import_jquery2.default)('[data-type="time"]').datetimepicker({
@@ -16909,6 +14904,11 @@
// lib/assets/javascript/application.js
import_ujs.default.start();
})();
+/*!
+ * Bootstrap Datetime Picker v4.17.49
+ * Copyright 2015-2020 Jonathan Peterson
+ * Licensed under MIT (https://github.com/Eonasdan/bootstrap-datetimepicker/blob/master/LICENSE)
+ */
/*!
* jQuery JavaScript Library v3.6.0
* https://jquery.com/
@@ -16922,17 +14922,9 @@
*
* Date: 2021-03-02T17:08Z
*/
-/*! version : 4.17.37
- =========================================================
- bootstrap-datetimejs
- https://github.com/Eonasdan/bootstrap-datetimepicker
- Copyright (c) 2015 Jonathan Peterson
- =========================================================
- */
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
//! license : MIT
//! moment.js
//! momentjs.com
//! version : 2.29.1
-//! version : 2.8.4
//# sourceMappingURL=application.js.map
diff --git a/app/assets/builds/administrate/application.js.map b/app/assets/builds/administrate/application.js.map
index cacb1fcd9b..b09ea390c4 100644
--- a/app/assets/builds/administrate/application.js.map
+++ b/app/assets/builds/administrate/application.js.map
@@ -1,7 +1,7 @@
{
"version": 3,
- "sources": ["../../../../node_modules/@rails/ujs/lib/assets/compiled/rails-ujs.js", "../../../../node_modules/jquery/dist/jquery.js", "../../../../node_modules/sifter/sifter.js", "../../../../node_modules/microplugin/src/microplugin.js", "../../../../node_modules/selectize/dist/js/selectize.js", "../../../../node_modules/moment/moment.js", "../../../../node_modules/bootstrap-datetimepicker-npm/node_modules/moment/moment.js", "../../../../node_modules/bootstrap-datetimepicker-npm/src/js/bootstrap-datetimepicker.js", "../../../../lib/assets/javascript/application.js", "../../../../lib/assets/javascript/components/associative.js", "../../../../lib/assets/javascript/components/date_time_picker.js", "../../../../lib/assets/javascript/components/table.js"],
- "sourcesContent": ["/*\nUnobtrusive JavaScript\nhttps://github.com/rails/rails/blob/main/actionview/app/assets/javascripts\nReleased under the MIT license\n */;\n\n(function() {\n var context = this;\n\n (function() {\n (function() {\n this.Rails = {\n linkClickSelector: 'a[data-confirm], a[data-method], a[data-remote]:not([disabled]), a[data-disable-with], a[data-disable]',\n buttonClickSelector: {\n selector: 'button[data-remote]:not([form]), button[data-confirm]:not([form])',\n exclude: 'form button'\n },\n inputChangeSelector: 'select[data-remote], input[data-remote], textarea[data-remote]',\n formSubmitSelector: 'form:not([data-turbo=true])',\n formInputClickSelector: 'form:not([data-turbo=true]) input[type=submit], form:not([data-turbo=true]) input[type=image], form:not([data-turbo=true]) button[type=submit], form:not([data-turbo=true]) button:not([type]), input[type=submit][form], input[type=image][form], button[type=submit][form], button[form]:not([type])',\n formDisableSelector: 'input[data-disable-with]:enabled, button[data-disable-with]:enabled, textarea[data-disable-with]:enabled, input[data-disable]:enabled, button[data-disable]:enabled, textarea[data-disable]:enabled',\n formEnableSelector: 'input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled, input[data-disable]:disabled, button[data-disable]:disabled, textarea[data-disable]:disabled',\n fileInputSelector: 'input[name][type=file]:not([disabled])',\n linkDisableSelector: 'a[data-disable-with], a[data-disable]',\n buttonDisableSelector: 'button[data-remote][data-disable-with], button[data-remote][data-disable]'\n };\n\n }).call(this);\n }).call(context);\n\n var Rails = context.Rails;\n\n (function() {\n (function() {\n var nonce;\n\n nonce = null;\n\n Rails.loadCSPNonce = function() {\n var ref;\n return nonce = (ref = document.querySelector(\"meta[name=csp-nonce]\")) != null ? ref.content : void 0;\n };\n\n Rails.cspNonce = function() {\n return nonce != null ? nonce : Rails.loadCSPNonce();\n };\n\n }).call(this);\n (function() {\n var expando, m;\n\n m = Element.prototype.matches || Element.prototype.matchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.oMatchesSelector || Element.prototype.webkitMatchesSelector;\n\n Rails.matches = function(element, selector) {\n if (selector.exclude != null) {\n return m.call(element, selector.selector) && !m.call(element, selector.exclude);\n } else {\n return m.call(element, selector);\n }\n };\n\n expando = '_ujsData';\n\n Rails.getData = function(element, key) {\n var ref;\n return (ref = element[expando]) != null ? ref[key] : void 0;\n };\n\n Rails.setData = function(element, key, value) {\n if (element[expando] == null) {\n element[expando] = {};\n }\n return element[expando][key] = value;\n };\n\n Rails.$ = function(selector) {\n return Array.prototype.slice.call(document.querySelectorAll(selector));\n };\n\n }).call(this);\n (function() {\n var $, csrfParam, csrfToken;\n\n $ = Rails.$;\n\n csrfToken = Rails.csrfToken = function() {\n var meta;\n meta = document.querySelector('meta[name=csrf-token]');\n return meta && meta.content;\n };\n\n csrfParam = Rails.csrfParam = function() {\n var meta;\n meta = document.querySelector('meta[name=csrf-param]');\n return meta && meta.content;\n };\n\n Rails.CSRFProtection = function(xhr) {\n var token;\n token = csrfToken();\n if (token != null) {\n return xhr.setRequestHeader('X-CSRF-Token', token);\n }\n };\n\n Rails.refreshCSRFTokens = function() {\n var param, token;\n token = csrfToken();\n param = csrfParam();\n if ((token != null) && (param != null)) {\n return $('form input[name=\"' + param + '\"]').forEach(function(input) {\n return input.value = token;\n });\n }\n };\n\n }).call(this);\n (function() {\n var CustomEvent, fire, matches, preventDefault;\n\n matches = Rails.matches;\n\n CustomEvent = window.CustomEvent;\n\n if (typeof CustomEvent !== 'function') {\n CustomEvent = function(event, params) {\n var evt;\n evt = document.createEvent('CustomEvent');\n evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);\n return evt;\n };\n CustomEvent.prototype = window.Event.prototype;\n preventDefault = CustomEvent.prototype.preventDefault;\n CustomEvent.prototype.preventDefault = function() {\n var result;\n result = preventDefault.call(this);\n if (this.cancelable && !this.defaultPrevented) {\n Object.defineProperty(this, 'defaultPrevented', {\n get: function() {\n return true;\n }\n });\n }\n return result;\n };\n }\n\n fire = Rails.fire = function(obj, name, data) {\n var event;\n event = new CustomEvent(name, {\n bubbles: true,\n cancelable: true,\n detail: data\n });\n obj.dispatchEvent(event);\n return !event.defaultPrevented;\n };\n\n Rails.stopEverything = function(e) {\n fire(e.target, 'ujs:everythingStopped');\n e.preventDefault();\n e.stopPropagation();\n return e.stopImmediatePropagation();\n };\n\n Rails.delegate = function(element, selector, eventType, handler) {\n return element.addEventListener(eventType, function(e) {\n var target;\n target = e.target;\n while (!(!(target instanceof Element) || matches(target, selector))) {\n target = target.parentNode;\n }\n if (target instanceof Element && handler.call(target, e) === false) {\n e.preventDefault();\n return e.stopPropagation();\n }\n });\n };\n\n }).call(this);\n (function() {\n var AcceptHeaders, CSRFProtection, createXHR, cspNonce, fire, prepareOptions, processResponse;\n\n cspNonce = Rails.cspNonce, CSRFProtection = Rails.CSRFProtection, fire = Rails.fire;\n\n AcceptHeaders = {\n '*': '*/*',\n text: 'text/plain',\n html: 'text/html',\n xml: 'application/xml, text/xml',\n json: 'application/json, text/javascript',\n script: 'text/javascript, application/javascript, application/ecmascript, application/x-ecmascript'\n };\n\n Rails.ajax = function(options) {\n var xhr;\n options = prepareOptions(options);\n xhr = createXHR(options, function() {\n var ref, response;\n response = processResponse((ref = xhr.response) != null ? ref : xhr.responseText, xhr.getResponseHeader('Content-Type'));\n if (Math.floor(xhr.status / 100) === 2) {\n if (typeof options.success === \"function\") {\n options.success(response, xhr.statusText, xhr);\n }\n } else {\n if (typeof options.error === \"function\") {\n options.error(response, xhr.statusText, xhr);\n }\n }\n return typeof options.complete === \"function\" ? options.complete(xhr, xhr.statusText) : void 0;\n });\n if ((options.beforeSend != null) && !options.beforeSend(xhr, options)) {\n return false;\n }\n if (xhr.readyState === XMLHttpRequest.OPENED) {\n return xhr.send(options.data);\n }\n };\n\n prepareOptions = function(options) {\n options.url = options.url || location.href;\n options.type = options.type.toUpperCase();\n if (options.type === 'GET' && options.data) {\n if (options.url.indexOf('?') < 0) {\n options.url += '?' + options.data;\n } else {\n options.url += '&' + options.data;\n }\n }\n if (AcceptHeaders[options.dataType] == null) {\n options.dataType = '*';\n }\n options.accept = AcceptHeaders[options.dataType];\n if (options.dataType !== '*') {\n options.accept += ', */*; q=0.01';\n }\n return options;\n };\n\n createXHR = function(options, done) {\n var xhr;\n xhr = new XMLHttpRequest();\n xhr.open(options.type, options.url, true);\n xhr.setRequestHeader('Accept', options.accept);\n if (typeof options.data === 'string') {\n xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');\n }\n if (!options.crossDomain) {\n xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n CSRFProtection(xhr);\n }\n xhr.withCredentials = !!options.withCredentials;\n xhr.onreadystatechange = function() {\n if (xhr.readyState === XMLHttpRequest.DONE) {\n return done(xhr);\n }\n };\n return xhr;\n };\n\n processResponse = function(response, type) {\n var parser, script;\n if (typeof response === 'string' && typeof type === 'string') {\n if (type.match(/\\bjson\\b/)) {\n try {\n response = JSON.parse(response);\n } catch (error) {}\n } else if (type.match(/\\b(?:java|ecma)script\\b/)) {\n script = document.createElement('script');\n script.setAttribute('nonce', cspNonce());\n script.text = response;\n document.head.appendChild(script).parentNode.removeChild(script);\n } else if (type.match(/\\b(xml|html|svg)\\b/)) {\n parser = new DOMParser();\n type = type.replace(/;.+/, '');\n try {\n response = parser.parseFromString(response, type);\n } catch (error) {}\n }\n }\n return response;\n };\n\n Rails.href = function(element) {\n return element.href;\n };\n\n Rails.isCrossDomain = function(url) {\n var e, originAnchor, urlAnchor;\n originAnchor = document.createElement('a');\n originAnchor.href = location.href;\n urlAnchor = document.createElement('a');\n try {\n urlAnchor.href = url;\n return !(((!urlAnchor.protocol || urlAnchor.protocol === ':') && !urlAnchor.host) || (originAnchor.protocol + '//' + originAnchor.host === urlAnchor.protocol + '//' + urlAnchor.host));\n } catch (error) {\n e = error;\n return true;\n }\n };\n\n }).call(this);\n (function() {\n var matches, toArray;\n\n matches = Rails.matches;\n\n toArray = function(e) {\n return Array.prototype.slice.call(e);\n };\n\n Rails.serializeElement = function(element, additionalParam) {\n var inputs, params;\n inputs = [element];\n if (matches(element, 'form')) {\n inputs = toArray(element.elements);\n }\n params = [];\n inputs.forEach(function(input) {\n if (!input.name || input.disabled) {\n return;\n }\n if (matches(input, 'fieldset[disabled] *')) {\n return;\n }\n if (matches(input, 'select')) {\n return toArray(input.options).forEach(function(option) {\n if (option.selected) {\n return params.push({\n name: input.name,\n value: option.value\n });\n }\n });\n } else if (input.checked || ['radio', 'checkbox', 'submit'].indexOf(input.type) === -1) {\n return params.push({\n name: input.name,\n value: input.value\n });\n }\n });\n if (additionalParam) {\n params.push(additionalParam);\n }\n return params.map(function(param) {\n if (param.name != null) {\n return (encodeURIComponent(param.name)) + \"=\" + (encodeURIComponent(param.value));\n } else {\n return param;\n }\n }).join('&');\n };\n\n Rails.formElements = function(form, selector) {\n if (matches(form, 'form')) {\n return toArray(form.elements).filter(function(el) {\n return matches(el, selector);\n });\n } else {\n return toArray(form.querySelectorAll(selector));\n }\n };\n\n }).call(this);\n (function() {\n var allowAction, fire, stopEverything;\n\n fire = Rails.fire, stopEverything = Rails.stopEverything;\n\n Rails.handleConfirm = function(e) {\n if (!allowAction(this)) {\n return stopEverything(e);\n }\n };\n\n Rails.confirm = function(message, element) {\n return confirm(message);\n };\n\n allowAction = function(element) {\n var answer, callback, message;\n message = element.getAttribute('data-confirm');\n if (!message) {\n return true;\n }\n answer = false;\n if (fire(element, 'confirm')) {\n try {\n answer = Rails.confirm(message, element);\n } catch (error) {}\n callback = fire(element, 'confirm:complete', [answer]);\n }\n return answer && callback;\n };\n\n }).call(this);\n (function() {\n var disableFormElement, disableFormElements, disableLinkElement, enableFormElement, enableFormElements, enableLinkElement, formElements, getData, isXhrRedirect, matches, setData, stopEverything;\n\n matches = Rails.matches, getData = Rails.getData, setData = Rails.setData, stopEverything = Rails.stopEverything, formElements = Rails.formElements;\n\n Rails.handleDisabledElement = function(e) {\n var element;\n element = this;\n if (element.disabled) {\n return stopEverything(e);\n }\n };\n\n Rails.enableElement = function(e) {\n var element;\n if (e instanceof Event) {\n if (isXhrRedirect(e)) {\n return;\n }\n element = e.target;\n } else {\n element = e;\n }\n if (matches(element, Rails.linkDisableSelector)) {\n return enableLinkElement(element);\n } else if (matches(element, Rails.buttonDisableSelector) || matches(element, Rails.formEnableSelector)) {\n return enableFormElement(element);\n } else if (matches(element, Rails.formSubmitSelector)) {\n return enableFormElements(element);\n }\n };\n\n Rails.disableElement = function(e) {\n var element;\n element = e instanceof Event ? e.target : e;\n if (matches(element, Rails.linkDisableSelector)) {\n return disableLinkElement(element);\n } else if (matches(element, Rails.buttonDisableSelector) || matches(element, Rails.formDisableSelector)) {\n return disableFormElement(element);\n } else if (matches(element, Rails.formSubmitSelector)) {\n return disableFormElements(element);\n }\n };\n\n disableLinkElement = function(element) {\n var replacement;\n if (getData(element, 'ujs:disabled')) {\n return;\n }\n replacement = element.getAttribute('data-disable-with');\n if (replacement != null) {\n setData(element, 'ujs:enable-with', element.innerHTML);\n element.innerHTML = replacement;\n }\n element.addEventListener('click', stopEverything);\n return setData(element, 'ujs:disabled', true);\n };\n\n enableLinkElement = function(element) {\n var originalText;\n originalText = getData(element, 'ujs:enable-with');\n if (originalText != null) {\n element.innerHTML = originalText;\n setData(element, 'ujs:enable-with', null);\n }\n element.removeEventListener('click', stopEverything);\n return setData(element, 'ujs:disabled', null);\n };\n\n disableFormElements = function(form) {\n return formElements(form, Rails.formDisableSelector).forEach(disableFormElement);\n };\n\n disableFormElement = function(element) {\n var replacement;\n if (getData(element, 'ujs:disabled')) {\n return;\n }\n replacement = element.getAttribute('data-disable-with');\n if (replacement != null) {\n if (matches(element, 'button')) {\n setData(element, 'ujs:enable-with', element.innerHTML);\n element.innerHTML = replacement;\n } else {\n setData(element, 'ujs:enable-with', element.value);\n element.value = replacement;\n }\n }\n element.disabled = true;\n return setData(element, 'ujs:disabled', true);\n };\n\n enableFormElements = function(form) {\n return formElements(form, Rails.formEnableSelector).forEach(enableFormElement);\n };\n\n enableFormElement = function(element) {\n var originalText;\n originalText = getData(element, 'ujs:enable-with');\n if (originalText != null) {\n if (matches(element, 'button')) {\n element.innerHTML = originalText;\n } else {\n element.value = originalText;\n }\n setData(element, 'ujs:enable-with', null);\n }\n element.disabled = false;\n return setData(element, 'ujs:disabled', null);\n };\n\n isXhrRedirect = function(event) {\n var ref, xhr;\n xhr = (ref = event.detail) != null ? ref[0] : void 0;\n return (xhr != null ? xhr.getResponseHeader(\"X-Xhr-Redirect\") : void 0) != null;\n };\n\n }).call(this);\n (function() {\n var stopEverything;\n\n stopEverything = Rails.stopEverything;\n\n Rails.handleMethod = function(e) {\n var csrfParam, csrfToken, form, formContent, href, link, method;\n link = this;\n method = link.getAttribute('data-method');\n if (!method) {\n return;\n }\n href = Rails.href(link);\n csrfToken = Rails.csrfToken();\n csrfParam = Rails.csrfParam();\n form = document.createElement('form');\n formContent = \"\";\n if ((csrfParam != null) && (csrfToken != null) && !Rails.isCrossDomain(href)) {\n formContent += \"\";\n }\n formContent += '';\n form.method = 'post';\n form.action = href;\n form.target = link.target;\n form.innerHTML = formContent;\n form.style.display = 'none';\n document.body.appendChild(form);\n form.querySelector('[type=\"submit\"]').click();\n return stopEverything(e);\n };\n\n }).call(this);\n (function() {\n var ajax, fire, getData, isCrossDomain, isRemote, matches, serializeElement, setData, stopEverything,\n slice = [].slice;\n\n matches = Rails.matches, getData = Rails.getData, setData = Rails.setData, fire = Rails.fire, stopEverything = Rails.stopEverything, ajax = Rails.ajax, isCrossDomain = Rails.isCrossDomain, serializeElement = Rails.serializeElement;\n\n isRemote = function(element) {\n var value;\n value = element.getAttribute('data-remote');\n return (value != null) && value !== 'false';\n };\n\n Rails.handleRemote = function(e) {\n var button, data, dataType, element, method, url, withCredentials;\n element = this;\n if (!isRemote(element)) {\n return true;\n }\n if (!fire(element, 'ajax:before')) {\n fire(element, 'ajax:stopped');\n return false;\n }\n withCredentials = element.getAttribute('data-with-credentials');\n dataType = element.getAttribute('data-type') || 'script';\n if (matches(element, Rails.formSubmitSelector)) {\n button = getData(element, 'ujs:submit-button');\n method = getData(element, 'ujs:submit-button-formmethod') || element.method;\n url = getData(element, 'ujs:submit-button-formaction') || element.getAttribute('action') || location.href;\n if (method.toUpperCase() === 'GET') {\n url = url.replace(/\\?.*$/, '');\n }\n if (element.enctype === 'multipart/form-data') {\n data = new FormData(element);\n if (button != null) {\n data.append(button.name, button.value);\n }\n } else {\n data = serializeElement(element, button);\n }\n setData(element, 'ujs:submit-button', null);\n setData(element, 'ujs:submit-button-formmethod', null);\n setData(element, 'ujs:submit-button-formaction', null);\n } else if (matches(element, Rails.buttonClickSelector) || matches(element, Rails.inputChangeSelector)) {\n method = element.getAttribute('data-method');\n url = element.getAttribute('data-url');\n data = serializeElement(element, element.getAttribute('data-params'));\n } else {\n method = element.getAttribute('data-method');\n url = Rails.href(element);\n data = element.getAttribute('data-params');\n }\n ajax({\n type: method || 'GET',\n url: url,\n data: data,\n dataType: dataType,\n beforeSend: function(xhr, options) {\n if (fire(element, 'ajax:beforeSend', [xhr, options])) {\n return fire(element, 'ajax:send', [xhr]);\n } else {\n fire(element, 'ajax:stopped');\n return false;\n }\n },\n success: function() {\n var args;\n args = 1 <= arguments.length ? slice.call(arguments, 0) : [];\n return fire(element, 'ajax:success', args);\n },\n error: function() {\n var args;\n args = 1 <= arguments.length ? slice.call(arguments, 0) : [];\n return fire(element, 'ajax:error', args);\n },\n complete: function() {\n var args;\n args = 1 <= arguments.length ? slice.call(arguments, 0) : [];\n return fire(element, 'ajax:complete', args);\n },\n crossDomain: isCrossDomain(url),\n withCredentials: (withCredentials != null) && withCredentials !== 'false'\n });\n return stopEverything(e);\n };\n\n Rails.formSubmitButtonClick = function(e) {\n var button, form;\n button = this;\n form = button.form;\n if (!form) {\n return;\n }\n if (button.name) {\n setData(form, 'ujs:submit-button', {\n name: button.name,\n value: button.value\n });\n }\n setData(form, 'ujs:formnovalidate-button', button.formNoValidate);\n setData(form, 'ujs:submit-button-formaction', button.getAttribute('formaction'));\n return setData(form, 'ujs:submit-button-formmethod', button.getAttribute('formmethod'));\n };\n\n Rails.preventInsignificantClick = function(e) {\n var data, insignificantMetaClick, link, metaClick, method, nonPrimaryMouseClick;\n link = this;\n method = (link.getAttribute('data-method') || 'GET').toUpperCase();\n data = link.getAttribute('data-params');\n metaClick = e.metaKey || e.ctrlKey;\n insignificantMetaClick = metaClick && method === 'GET' && !data;\n nonPrimaryMouseClick = (e.button != null) && e.button !== 0;\n if (nonPrimaryMouseClick || insignificantMetaClick) {\n return e.stopImmediatePropagation();\n }\n };\n\n }).call(this);\n (function() {\n var $, CSRFProtection, delegate, disableElement, enableElement, fire, formSubmitButtonClick, getData, handleConfirm, handleDisabledElement, handleMethod, handleRemote, loadCSPNonce, preventInsignificantClick, refreshCSRFTokens;\n\n fire = Rails.fire, delegate = Rails.delegate, getData = Rails.getData, $ = Rails.$, refreshCSRFTokens = Rails.refreshCSRFTokens, CSRFProtection = Rails.CSRFProtection, loadCSPNonce = Rails.loadCSPNonce, enableElement = Rails.enableElement, disableElement = Rails.disableElement, handleDisabledElement = Rails.handleDisabledElement, handleConfirm = Rails.handleConfirm, preventInsignificantClick = Rails.preventInsignificantClick, handleRemote = Rails.handleRemote, formSubmitButtonClick = Rails.formSubmitButtonClick, handleMethod = Rails.handleMethod;\n\n if ((typeof jQuery !== \"undefined\" && jQuery !== null) && (jQuery.ajax != null)) {\n if (jQuery.rails) {\n throw new Error('If you load both jquery_ujs and rails-ujs, use rails-ujs only.');\n }\n jQuery.rails = Rails;\n jQuery.ajaxPrefilter(function(options, originalOptions, xhr) {\n if (!options.crossDomain) {\n return CSRFProtection(xhr);\n }\n });\n }\n\n Rails.start = function() {\n if (window._rails_loaded) {\n throw new Error('rails-ujs has already been loaded!');\n }\n window.addEventListener('pageshow', function() {\n $(Rails.formEnableSelector).forEach(function(el) {\n if (getData(el, 'ujs:disabled')) {\n return enableElement(el);\n }\n });\n return $(Rails.linkDisableSelector).forEach(function(el) {\n if (getData(el, 'ujs:disabled')) {\n return enableElement(el);\n }\n });\n });\n delegate(document, Rails.linkDisableSelector, 'ajax:complete', enableElement);\n delegate(document, Rails.linkDisableSelector, 'ajax:stopped', enableElement);\n delegate(document, Rails.buttonDisableSelector, 'ajax:complete', enableElement);\n delegate(document, Rails.buttonDisableSelector, 'ajax:stopped', enableElement);\n delegate(document, Rails.linkClickSelector, 'click', preventInsignificantClick);\n delegate(document, Rails.linkClickSelector, 'click', handleDisabledElement);\n delegate(document, Rails.linkClickSelector, 'click', handleConfirm);\n delegate(document, Rails.linkClickSelector, 'click', disableElement);\n delegate(document, Rails.linkClickSelector, 'click', handleRemote);\n delegate(document, Rails.linkClickSelector, 'click', handleMethod);\n delegate(document, Rails.buttonClickSelector, 'click', preventInsignificantClick);\n delegate(document, Rails.buttonClickSelector, 'click', handleDisabledElement);\n delegate(document, Rails.buttonClickSelector, 'click', handleConfirm);\n delegate(document, Rails.buttonClickSelector, 'click', disableElement);\n delegate(document, Rails.buttonClickSelector, 'click', handleRemote);\n delegate(document, Rails.inputChangeSelector, 'change', handleDisabledElement);\n delegate(document, Rails.inputChangeSelector, 'change', handleConfirm);\n delegate(document, Rails.inputChangeSelector, 'change', handleRemote);\n delegate(document, Rails.formSubmitSelector, 'submit', handleDisabledElement);\n delegate(document, Rails.formSubmitSelector, 'submit', handleConfirm);\n delegate(document, Rails.formSubmitSelector, 'submit', handleRemote);\n delegate(document, Rails.formSubmitSelector, 'submit', function(e) {\n return setTimeout((function() {\n return disableElement(e);\n }), 13);\n });\n delegate(document, Rails.formSubmitSelector, 'ajax:send', disableElement);\n delegate(document, Rails.formSubmitSelector, 'ajax:complete', enableElement);\n delegate(document, Rails.formInputClickSelector, 'click', preventInsignificantClick);\n delegate(document, Rails.formInputClickSelector, 'click', handleDisabledElement);\n delegate(document, Rails.formInputClickSelector, 'click', handleConfirm);\n delegate(document, Rails.formInputClickSelector, 'click', formSubmitButtonClick);\n document.addEventListener('DOMContentLoaded', refreshCSRFTokens);\n document.addEventListener('DOMContentLoaded', loadCSPNonce);\n return window._rails_loaded = true;\n };\n\n if (window.Rails === Rails && fire(document, 'rails:attachBindings')) {\n Rails.start();\n }\n\n }).call(this);\n }).call(this);\n\n if (typeof module === \"object\" && module.exports) {\n module.exports = Rails;\n } else if (typeof define === \"function\" && define.amd) {\n define(Rails);\n }\n}).call(this);\n", "/*!\n * jQuery JavaScript Library v3.6.0\n * https://jquery.com/\n *\n * Includes Sizzle.js\n * https://sizzlejs.com/\n *\n * Copyright OpenJS Foundation and other contributors\n * Released under the MIT license\n * https://jquery.org/license\n *\n * Date: 2021-03-02T17:08Z\n */\n( function( global, factory ) {\n\n\t\"use strict\";\n\n\tif ( typeof module === \"object\" && typeof module.exports === \"object\" ) {\n\n\t\t// For CommonJS and CommonJS-like environments where a proper `window`\n\t\t// is present, execute the factory and get jQuery.\n\t\t// For environments that do not have a `window` with a `document`\n\t\t// (such as Node.js), expose a factory as module.exports.\n\t\t// This accentuates the need for the creation of a real `window`.\n\t\t// e.g. var jQuery = require(\"jquery\")(window);\n\t\t// See ticket #14549 for more info.\n\t\tmodule.exports = global.document ?\n\t\t\tfactory( global, true ) :\n\t\t\tfunction( w ) {\n\t\t\t\tif ( !w.document ) {\n\t\t\t\t\tthrow new Error( \"jQuery requires a window with a document\" );\n\t\t\t\t}\n\t\t\t\treturn factory( w );\n\t\t\t};\n\t} else {\n\t\tfactory( global );\n\t}\n\n// Pass this if window is not defined yet\n} )( typeof window !== \"undefined\" ? window : this, function( window, noGlobal ) {\n\n// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1\n// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode\n// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common\n// enough that all such attempts are guarded in a try block.\n\"use strict\";\n\nvar arr = [];\n\nvar getProto = Object.getPrototypeOf;\n\nvar slice = arr.slice;\n\nvar flat = arr.flat ? function( array ) {\n\treturn arr.flat.call( array );\n} : function( array ) {\n\treturn arr.concat.apply( [], array );\n};\n\n\nvar push = arr.push;\n\nvar indexOf = arr.indexOf;\n\nvar class2type = {};\n\nvar toString = class2type.toString;\n\nvar hasOwn = class2type.hasOwnProperty;\n\nvar fnToString = hasOwn.toString;\n\nvar ObjectFunctionString = fnToString.call( Object );\n\nvar support = {};\n\nvar isFunction = function isFunction( obj ) {\n\n\t\t// Support: Chrome <=57, Firefox <=52\n\t\t// In some browsers, typeof returns \"function\" for HTML