Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge main into i35 #2153

Merged
merged 51 commits into from
Jan 11, 2024
Merged

Merge main into i35 #2153

merged 51 commits into from
Jan 11, 2024

Conversation

jeremyf
Copy link
Contributor

@jeremyf jeremyf commented Jan 10, 2024

Merge main back into Branch

## 🎁 Contributions from PALNI/PALCI

6a1e0c5

Which were resolved via the following PRs:

Contribute back the following features:

Co-authored-by: Shana Moore [email protected]
Co-authored-by: Kirk Wang [email protected]

🎁 Contributions from PALNI/PALCI

6f9b88b

Contribute back the following features:

Which were resolved via the following PRs:

Co-authored-by: Lea Ann Bradford [email protected]
Co-authored-by: LaRita Robinson [email protected]
Co-authored-by: Kirk Wang [email protected]
Co-authored-by: Shana Moore [email protected]

Updating translations

0166692

🎁 Contribute back work from PALNI/PALCI

d2649f9

Related to Issues:

Related to Pull Requests:

🎁 Hyrax 5 upgrade (#2047)

17c9192

  • remove dogbiscuit crossover, fix routes

  • add spec for search history

  • add missing methods to avoid content block errors

  • Update Hyku Gemfile.lock

  • add option to support good job for background jobs instead of sidekiq

  • update gemfile lock

  • Update good_job.rb

  • merge

  • fix routes file, add missing js file

  • 💄 styling fix

  • 💄 rubocop fixes

  • remove iiif_print/iiif_print require

cause of Sprockets::FileNotFound in Splash#index error. Doesn't seem necessary.

  • 🎁 🧹 add missing file and format with semicolons

The previous build revealed that admin_color_select.js was missing. It also complained about missing semicolons.

  • 💄 correct missing semicolons

appease the hound by formatting js file with semicolons.

  • 🧹 remove call to iiif_print/iiif_print

Cause of build error. It's already being included in sass.

  • 💄 Rubocop fixes

  • ✅ Fix test setup for catalog_controller_spec

This commit will add additional setup to the catalog_controller_spec.

  • Add knapsack helper

  • remove Adventist from application.rb

  • 🎁 Add conditional to run correct command for worker

This commit adds a conditional to run the correct command for sidekiq or good_job, when running docker compose up.

  • Make appearance constants overrideable

This allows for the knapsack to override the constants by defining and
using a method rather than a constant in the look-ups.

  • add reporting fix to hyku ci

  • spec loading fixes

  • rubocop

  • 🧹Make appearance defaults overrideable

  • bump bulkrax to 5.4.0

This commit pulls in a small collection of bug fixes.

  • 🧹 Include knapsack css

  • fix job loading when selecting good job

  • adjust docker compose to use the startup script

  • 🎁 install tesseract eng_best

  • ♻️ revert tesseract best changes to dockerfile

this change belongs in the knapsack directory instead

  • ♻️ revert tesseract best changes to dockerfile

this change belongs in the knapsack directory instead

  • 🐛 Bring fix for entry show page not showing link

This commit will bring in a fix from Bulkrax that correctly shows the
object from the entry show page.

ref:

  • 🧹 Revert previous commit and update Bulkrax

This commit will update Bulkrax to 5.4.1 instead of using the override
from the last commit. We also revert the changes from the last commit.

  • 🐛 subject can't be blank for the contact form

Previously there was a bug because even if you typed in a subject, the contact form would error saying that it was blank.

Part of issue:

  • mend

  • ♻️ Add handling for Knapsack theme overrides

Prior to this commit, we were looking for themes yaml files relative to
the directory of the spawning script. For Hyku that was always the
Rails.root directory. However, when running specs in Knapsack, that
directory was Knapsack::Engine.root.

This unearthed a potential configuration issue; namely that we want
Knapsack's to control what themes are available, meaning we don't want
to require amending Hyku's themes.

So, we introduce a mechanism for looking up files first in the Knapsack
then in Hyku.

I discovered this bug in the specs for knapsack (below is the Error stack trace)

Error stack trace
2) Hyrax::Admin::AppearancesController with an administrator GET #show assigns the requested site as @site
     Failure/Error: get :show, params: {}

     Errno::ENOENT:
       No such file or directory @ rb_sysopen - config/home_themes.yml
     # /usr/local/bundle/gems/psych-3.3.4/lib/psych.rb:582:in `initialize'
     # /usr/local/bundle/gems/psych-3.3.4/lib/psych.rb:582:in `open'
     # /usr/local/bundle/gems/psych-3.3.4/lib/psych.rb:582:in `unsafe_load_file'
     # ./hyrax-webapp/app/controllers/hyrax/admin/appearances_controller.rb:19:in `show'
     # /usr/local/bundle/gems/rails-controller-testing-1.0.5/lib/rails/controller/testing/template_assertions.rb:62:in `process'
     # /usr/local/bundle/gems/devise-4.9.2/lib/devise/test/controller_helpers.rb:35:in `block in process'
     # /usr/local/bundle/gems/devise-4.9.2/lib/devise/test/controller_helpers.rb:104:in `catch'
     # /usr/local/bundle/gems/devise-4.9.2/lib/devise/test/controller_helpers.rb:104:in `_catch_warden'
     # /usr/local/bundle/gems/devise-4.9.2/lib/devise/test/controller_helpers.rb:35:in `process'
     # /usr/local/bundle/gems/rails-controller-testing-1.0.5/lib/rails/controller/testing/integration.rb:16:in `block (2 levels) in <module:Integration>'
     # ./spec/controllers/hyrax/hyrax/admin/appearances_controller_spec.rb:31:in `block (4 levels) in <top (required)>'
     # /usr/local/bundle/gems/webmock-3.19.1/lib/webmock/rspec.rb:39:in `block (2 levels) in <top (required)>'
     # ./hyrax-webapp/spec/support/multitenancy_metadata.rb:50:in `block (2 levels) in <top (required)>'
     # /usr/local/bundle/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:124:in `block in run'
     # /usr/local/bundle/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:110:in `loop'
     # /usr/local/bundle/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:110:in `run'
     # /usr/local/bundle/gems/rspec-retry-0.6.2/lib/rspec_ext/rspec_ext.rb:12:in `run_with_retry'
     # /usr/local/bundle/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:37:in `block (2 levels) in setup'
     # ./spec/spec_helper.rb:10:in `block (2 levels) in <top (required)>'

Related to:

The above two commits will require some reconciliation once this is incorporated.

  • ♻️ Favor Hyku::Application.path_for over Rails.root

Given the existence of Knapsack we need to consider how overrides in
Knapsack will take precedence over Hyku files. This change handles
cases where we want to use the Knapsack's uploaded thumbnails.

Related to:

  • 🎁 Add highlight key to UV

This commit allows for the parent_query to be highlighted in the UV so
users won't have to do a catalog search and also a UV search.

  • 🐛 Mixin HykuKnapsack::ApplicationHelper

This commit will mixin the HykuKnapsack::ApplicationHelper into the
ApplicationHelper which will allow us to use #render_ocr_snippets for
snippet highlighting.

  • Revert "🐛 Mixin HykuKnapsack::ApplicationHelper"

This reverts commit ae093f1.

  • ♻️ Favor class_attribute over constant

In Adventist, we're needing to override the constant's values. By
making this a class_attribute we can more readily do the override via
configuration instead of obliteration of a constant.

  • ♻️ Favor configurable html head title value

Prior to this commit, we hard-coded the page title; this is something
that should be far more configurable. And this refactor is a step
towards that.

This also allows for downstream implementors to not have to override the
view simply to change the title element.

  • 🐛 Add custom rendering for license

Prior to this commit, the License would render as a plain URL. With
this change, we are now coercing the license into a URL that is labeled
and titled with the name of the license.

This is copied and modified based on Rights show partial

Related to:

  • ♻️ Add option to override devise configuration

For Adventist, we wanted to disable registration of accounts as this was
creating a case where folks were creating their own accounts and
tenants.

Related to:

  • run asset build later in process to allow knapsack to run it only one time

  • 🐛 Fix Add to Collection for page 2+ of works

Prior to this commit, when you were on page 2 of your works and selected
a work to add to a collection, the query for available collections would
use the page 2 as part of the collection query. This would mean the
first 100 collections (default page size) that you had access to add
works to were skipped.

With this commit, we omit the query parameters from the works page and
then query collections.

Related to:

Co-authored-by: LaRita Robinson [email protected]

  • test that invited users are added to the registered group

  • Add invited users to the registered group

Fixes a bug where users who were invited with no roles would not
show up in the users list at all

Typo caused inability to upload collection thumbnail.

  • 🎁 Modify labels in UV for V3 manifests

This commit will add the same treatment as we have for V2 manifests to
V3 manifests. This will allow the UV to add a more human readable label
to the pages.

Ref:

  • 🐛 Fix bad method name

Related to:

  • 🐛 Move some methods to be public

This commit will move #solr_document, #current_ability, and #request to
be public methods. Since these methods in Hyrax were not private, in
the decorator it should not be private either.

Ref:

  • First attempt for upgrade to Hyrax 5.0.0.rc2

So far the changes throw an error The adapter nulldb_adapter is not yet supported when doing a docker compose build. Commenting out RUN RAILS_ENV=production SECRET_KEY_BASE=bin/rake secret DB_ADAPTER=nulldb DB_URL='postgresql://fake' bundle exec rake assets:precompile && yarn install in the Dockerfile allows the build to complete but still can't
boot yet.

  • 🧹 Get assets to precompile

This commit has a lot in it, but of note:

  • We forked apartment gem to expand activerecord version support
  • Used the Hyrax upgrade guide to update assets
  • Replaced bootstrap 3 variables with hard coded values
  • Commented out blacklight_helper_behavior.rb because Blacklight 7
    removed it, we'll have to figure out how to get the same functionality
    in the new version
  • 🧹 Switch to Hyrax double_combo branch

We are using this branch on Hyrax because it has quite a few Valkyrie
related fixes in it.

  • 🧹 use class attribute instead of constant to correct failing specs

  • Fix specs

  • 🧹 Get the page to load

This commit will get the proprietor page to load. You can create a
tenant and vist it as well.

  • ♻️ Introduce Hyku::Application.theme_view_path_roots

With the introduction of HykuKnapsack, we are adjusting how we
create instances of Hyku. Namely we don't clone Hyku but instead we
incorporate Hyku as a submodule into a Knapsack.

The Knapsack is a Rails engine that is mounted in the Hyku application.
What this means is that when we want to

Prior to this commit, the only way to adjust themed views would have
been to add them to the Rails application (e.g. Hyku) directly. Which
would work in a non-Knapsack ecosystem.

However, with Knapsack we need a means of saying "Hey, for themes we
want to be able to add/adjust views within the knapsack." Hence this
change.

  • 🧹 Prepping for rubocop

This commit will change the Docker image to rc1 because rc2 stopped
working (at least locally). Also getting things ready to run rubocop.

  • 🧹 Ran bundle exec rubocop -a

  • 🧹 Autocorrect frozen string literals

rubocop --only Style/FrozenStringLiteralComment -A
  • 🧹 Rubocop'd lengths and other low hanging fruit

Various length metrics were disabled in this commit. Also other various
cops that were easy to fix.

  • 🧹 Remove deprecated Blacklight code

removing the deprecated blacklight code allows the specs to run. We should consider if finding a replacement is necessary in the following ticket:

Issue:

  • 🧹 Avoid #present? in non-Rails situations

Rails provides Object#present?, which is a method that is not
generally available in Ruby. However in the changed context, the
scripts do not have access to Rails methods.

By using this adjusted approach we favor baseline Ruby methods.

Refactor homepage controller to more closely align with Hyrax's
homepage controller.
Adjust theme views to render modal instead of ajax_modal.

refs: scientist-softserv/hykuup_knapsack#56

File fixtures were broken.
Ref scientist-softserv/hykuup_knapsack#56

  • 🧹 Remove google analytics from config reload

This is a piece of a fix for analytics that came in via
scientist-softserv/palni-palci#946

Additional backporting of analytics work is still needed, but this
fixes numerous specs so it is being pulled in earlier.

For table hyrax_counter_metrics

This commit is a first swing of upgrading all the views from Bootstrap 3
to 4. There's still a lot of work to be done to make the views look
good but this is a good first step.

The override was causing issues not passing the nav-link class into the
anchor tags. This fix specifically passes the title attribute in vs the
previous implementation of trying to pass all html options in.

  • 🧹 Remove required translations from locales

This commit will remove the override for the required translations
since it changed to a badge badge-style in Bootstrap 4. This is
accounted for in Hyrax so we can fall back to that.

  • 🐛 Fix some javascript errors

This commit will fix a few javascript errors, at least enough to get the
the bootstrap javascript to work correctly. We're still getting a the
almond-rails js error but that seems to exist in previous Hyku as well.

These are adjustments made after the PR has been reviewed.

  • 🧹 Clean up a couple blacklight views

This commit will account for the new versions of Blacklight and
Blacklight Gallery. The masonry view no longer exists so we can't tell
how it's broken as of right now. I'm sure we'll run into it during our
testing.

NOTE: These changes refer to the shared search tenant.

  • 🧹 Bring back BlacklightHelperBehavior

This commit will bring back the BlacklightHelperBehavior module but it
will be namespaced under Hyku to avoid conflicts. We will then
include it in the HyraxHelper module so those methods should override
the ones in Blacklight::BlacklightHelperBehavior.

Ref scientist-softserv/hykuup_knapsack#55

  • Contact form controller and pages controller duplicate some of the
    homepage controller behavior, so corresponding fixes are needed.
  • Update collections factory and collection_ability_spec to match hyrax
    and stop calling .gid on a collection_type.
  • Adjust permission_template_form_spec to adjust for removal of method
    reset_access_controls! and add a few new expectations instead.
  • 🧹 Begin work on Roles Service

Working with Permission Templates has changed, requiring an adjustment
to both logic and specs.

  • 🧹 Solr Document Ability Spec

  • Rubocop fixes

  • Fix typo of collection variable

  • Reinstate some collections factory overrides

  • Revert Rubocop changes

Caused spec failure in roles_service_spec.

  • Fix create_default_admin_set_job_spec

  • Restore mistakenly removed capta use

  • 🧹 Stanford import specs

We have plans to remove the Stanford import logic, but for now, this
handles the specs that were failing, in an attempt to get CI to pass.

  • Make Rubocop happy

  • Fix typo

  • Update Hyrax to pull in most recent changes

  • More spec fixes

Menu presenter: removed html_options
Application Helper: override for missing_translations now receives
false when translation wasn't found rather than a string.

  • Fix missing translation logic

  • Fix missing_translation override

Simplify and fix override. A missing translation now returns false
instead of the text translation missing.

The super method requires the option parameter, so we opted to keep
the override.

  • 🧹 Remove copied code

The overrides are no longer necessary. In reviewing the diff between
what I'm removing and what is in the double_combo branch; the major
change was adding an operator for the reduce function. The breaking
problem was that the method signature of one of the copied methods has
changed in Hyrax 5.0.

The removal considers that Hyrax::Group is of two different classes:

  • In Hyrax, it is a plain old Ruby object
  • In Hyku, it is descended from ActiveRecord::Base

The two classes have different instantiation parameters. Hence the
introduction of Hyrax::Group.new in this code.

  • 🧹 Fix missing method name

  • 🐛 Ensure :maxFileSize is integer

Prior to this commit, we were casting the value to string. However
Hyrax attempts to do division on that string.

See https://github.com/samvera/hyrax/blob/b7891b758411c59f71ff54212e0d250fcc47e35f/app/views/hyrax/base/_form_files.html.erb#L6-L15

  • Skip taking a picture on failure

  • 🧹 Fix issue regarding Valkyrie::Identifier

The encountered error was:

NoMethodError:
  undefined method `split' for #<Valkyrie::ID:0x0000ffffa5f04bc8
  @id="admin_set/default">
  • 🧹 Favor Sipity::Entity function over to_sipity_entity

The Sipity conversion methods are now explicit functions (much like the
Array() function).

  • Update Hyrax IIIF AV gem

  • 🧹 Review controller overrides

Many of the controllers just needed to be updated with the decorator
pattern. We're creating a new concern for all the Hyku specific
overrides in Hyku::WorksControllerBehavior. This has to be included in
the Controller classes after Hyrax::WorksControllerBehavior to override
the relevant methods.

  • clean up from pr review

  • Appease rubocop

  • Update IIIF Print gem

  • 🤖 Specify Cache Root

Prior to this commit, we were seeing the following failure:

Failure/Error: Site.application_name || super

ActionView::Template::Error:
Permission denied @ dir_s_mkdir - /app

The Account#setup_tenant_cache sets the cache_store to be
ENV.fetch('HYKU_CACHE_ROOT', '/app/samvera/file_cache'). When I
locally chanced it to /blorg/samvera/file_cache I could repeat the
error.

With this commit, we're setting the cache value for the CircleCI run.

Why was it previously working? Perhaps because
Account#setup_tenant_cache never got called due to other
configurations? There is a guard clause around the method call.

  • 🧹 Update spec to reflect AdminSet default behavior

In the following commit, we removed the deprecated
AdminSet.find_or_create_default_admin_set_id:

This commit follows the advice of the deprecation warning and now favors
the Hyrax::AdminSetCreateService.find_or_create_default_admin_set.id
method call.

Related to:

The site/roles route is obsolete. This is an attempt to remove as much
of the obsolete logic as possible, as it has been replaced by the groups
with roles feature.

  • Remove stanford importer

Importer was deprecated in prior release version.

  • 🤖 Fix spec/features/collection_type_spec.rb

There are three major changes:

  1. Favor setting collection_type attribute instead of
    collection_type_gid
  2. Change #collections? to #collections#any?
  3. Change CSS selector based on Bootstrap upgrade

The above changes are related to work done in:

See:

  • 🤖 Fix stub methods to pass tests

These tests weren't verifying that we could reach Redis; they were
testing the interface of the RedisEndpoint#ping by mocking the
instance.

This commit changes the mocking by avoiding a call to
Hyrax::RedisEventStore.instance which was raising a Redis connection
error.

Again, this test is not is redis connecting but "assume we are trying to
connect to redis now demonstrate ping."

Refs
CircleCI-Public/browser-tools-orb#96
CircleCI-Public/browser-tools-orb#75 (comment)

  • 🧹 Clean up model overrides

Most of what's in this commit is just updating the Hyrax version in the
override comments. There was also an opportunity to switch the
ContactForm model to a decorator.

  • 🤖 Favor general spec over specific

With the CircleCI alternate place for the file_store cache, we need to
fallback to a more general test assertion.

  • 🤖 Bring over Hyrax spec changes

  • 🤖 Extract constant to ease testing

We're not concerned with where the cached file is for testing purposes;
so instead of hard-coding a value that can change in the ENV, let's
compare the constant that we use in the code.

tl;dr - Don't rely on magic strings

  • 🤖 Re-arrange CleanupAccountJob specs

The CleanupAccountJob was stubbing very nosily; needing to know too
much about implementation details of the end-points. Instead this
preserves the over-view spec (e.g. what all the cleanup spec actually
cleans up) while moving that nosy logic to the constituent endpoint.

Most of these specs are testing that the method chains work; which is
perhaps adequate as the other option is far more expensive tests (e.g.
make a new Fedora node only to then immediately destroy it)

I'm also leveraging the new Redis::Namespace#clear method.

Related to:

  • 🧹 Restore btn-sign-up on splash page

This change was part of the bulk upgrade of Bootstrap 3 to 4.

  • 🧹 Fix ./spec/requests/admin_dashboard_spec.rb spec

Prior to this commit, the specs failed because of the introduction of
the WorkflowResponsibilityFormDecorator. The decorator extracted prior
logic from Hyrax::Admin::WorkflowRolesController.

In copying that logic we introduced a subtle bug. Namely, we favored
the original .new behavior if and only if you provided a :user_id.
This broke places where we instantiated the form in a
view (e.g. ./app/views/hyrax/admin/workflow_roles/index.html.erb).

With this change, we make the behavior of .new fail towards its
"normal" implementation and instead rely on the presence of an attribute
to switch to a different form instantatior.

See Commit:

Related to:

Co-authored-by: LaRita Robinson [email protected]
Co-authored-by: Kirk Wang [email protected]

  • 🎁 Upgrade Redis initializer to Hyrax 5's gen version

Prior to this commit, when looking at the
Hyrax::RedisEventStore.instance we saw it's connection information as:

#<Redis client v4.8.1 for redis://localhost:6379/0>

We were expecting the connection to be the following:

#<Redis client v4.8.1 for redis://redis:6379/0>

What we were seeing in tests is when we hit the redis connection we were
getting an error about not being able to connect to 127.0.0.1:6379 (e.g.
localhost).

With this commit, we have a clear connection to Redis.

See Redis Config initializer:

Co-authored-by: Kirk Wang [email protected]

  • 🧹 Clean up actors

Just found one actor that was overriding Hyrax. This commit will switch
it to a decorator.

  • 🐛 Handle missing labels

Adjust paths and keys to look for labels.

  • Appease the cops

  • 🧹 Assigning collection_type

The partials rendered in the tested view assume that we've set a
collection type.

  • Appease rubocop

  • Fixing nav link selectors to new structure

  • Fixing nav link selectors to new structure

  • 🧹 Clean up forms

The only big thing in this commit is the appearance_decorator. I've
added to the spec to show that the decorator should be working as
intended.

  • 🧹 Fix spec based on HTML class changes

  • 🧹 Narrow specificity of CSS selector

The selector was very specific, and with the HTML class changes for
Bootstrap 3 to 4, this almost certainly broke.

Note, there are still underlying issues with two other specs; there
errors are listed below:

1) Admin can select home page theme when a search results theme is
selected updates the search results page with the selected layout view

Failure/Error: super

     ActionView::Template::Error:
       undefined method `with_collection' for nil:NilClass
  • 🧹 Remove specificity of CSS selectors in test

The hyper specific selectors are not durable for CSS framework upgrades.

  • 🐛 Adding document_component to blacklight's config

Blacklight 7.35.0 's default document_component is nil, see:

Digging around in the wiki, you might find (only found because I cloned the repo):

Related to:

  • 🧹 Allow :clean or :clean_repo to work for the cleaners

Hyrax has :clean_repo and Hyku has :clean

Sometimes folks copy over specs from Hyrax, and bring along the
:clean_repo; which looks like it should work.

With this commit, we bring that logic along!

  • 🧹 Remove skip CI

Perhaps it's flappy; but let's see.

  • 🧹 Fix button class for Bootstrap 3 to 4

  • 🧹 Favor Layout/LineLength over Metrics/LineLength

Rubocop seams to prefer the Layout namespace for LineLength.

  • 🧹 The selector is not working

Checking the HTML (on the CircleCI SSH environment), it appears that the
selector should work in test. But it is not. So I'm removing the specificity.

  • Cleaning a spec that should start clean

  • 🧹 Ensure feature specs run clean

Prior to this commit, we did not automatically clean the features. The
below ripgrep (and output) shows that there were some features which did
not start from a clean state.

rg "(clean|clean_repo):" spec/features --files-without-match
``

spec/features/accounts_spec.rb
spec/features/proprietor_spec.rb
spec/features/featured_collections_spec.rb
spec/features/user_roles_spec.rb
spec/features/oai_pmh_spec.rb


* Stab at trying to find a problem

* 🧹 Clean up services

This commit will reconcile the services that are overrides for Hyrax
with the Hyrax 5.0.0rc2 version.  There were a number of overrides that
were changed to the decorator pattern.

* Moving rescue and documenting the why

* 🧹 Rearrange order of filter chain

This is not tested in the UI, but the
`show_works_or_works_that_contain_files` remains after the troublesome
advanced query filters.

* 🧹 Address PR comments

This commit addresses comments from the review but one thing that is of
note is loading the I18n translations in the application.rb file.  We
needed this because our decorators load prior to I18n loads the locales
in our config/locales directory for them to use so we were getting
missing translations.

* 🧹 Attempting to find and squash bug

* ♻️ Account for observed customizations

Dear reviewer, put on your reading glasses.

This commit looks at the newly refactored
`Hyrax::IiifAv::DisplaysContentDecorator` as well as the current state
of [PALS's Hyrax::IiifAv::DisplaysContentDecorator][1] and attempts to
account for the variances between the two by introducing configurations.

Yes, we could port this to the hyrax-iiif_av gem, but for now that would
not solve the underlying issue of how we've been handling things.

Why the Hyku::Application class attribute?  Because the decorator is
being mixed into a module, which does not response to `.class_attribute`
methods.

[1]: https://github.com/scientist-softserv/palni-palci/blob/8754556c0225ce9f04674c1ffac6403586fd65f4/app/presenters/concerns/hyrax/iiif_av/displays_content_decorator.rb

* 🧹 Clean up other overrides

This commit is aiming to clean up the rest of the found overrides.

* 🧹 Change locale file load order so that our local files are prioritized

We add our local config locale directory to the I18n.load_path so that our local files take precendence over the ones found in our gems.

Related issue:
- https://github.com/scientist-softserv/hykuup_knapsack/issues/55

* 🧹 Update IIIF Print and AV gems

We were not seeing images loading correctly in the UV because we
introduced the `Hyku::WorksControllerBehavior` and IIIF Print did not
know about it.
  - https://github.com/scientist-softserv/iiif_print/commit/cad2cf33fc07ec2abb5b6834a858b5ed74903c12

We were seeing a respon to mismatch error in the Hyrax IIIF AV.
  - https://github.com/samvera-labs/hyrax-iiif_av/commit/4723b8fd0961fa179caf787532bd7922a44957ec

Also, the image that I tested was a phone image that apparently had
different ExifImageHeight/ExifImageWidth values than the
ImageHeight/ImageWidth values.  This was probably because modern phones
typically generate multiple images so the user can choose the best shot.
The exiftool_image_to_fits.xslt was proritizing the Exif values over the
regular values and would cause our image characterization to have weird
height and width values.  The change in this PR prioritizes the regular
over the Exif values.

Ref:
  - https://github.com/scientist-softserv/hykuup_knapsack/issues/68

* 🐛 Fix video thumbnail generation

In a previous commit we created the
`Hyrax::FileSetDerivativesServiceDecorator` to override the default
thumbnails that Hyrax uses but I forgot to add the video thumbnail,
which is fixed here.

Ref
  - https://github.com/scientist-softserv/hykuup_knapsack/issues/69

* 🧹 Add space between thumbnail and title

* 🧹 Update Hyku version

This commit bumps the hyku version from 5.1.0 to 6.0.0.

* :lipstick: ruboco fix

* 🧹 Fixing a few styles

This commit will change the maximized size to match Bootstrap 4 break
points.  Also, added btn-secondary to hyku.css so it doesn't get
overriden by appearance styles.  Finally, restructured the homepage to
make it look more like Hyrax 5.

* sort properties

* adjust screen size

* 🧹 Update `rails` to `6-1-stable` for GoodJob

There is a compatibility issue with Rails 6.1.7.6 and Ruby 3.2 that was
affecting GoodJob.  There was a backport to the 6-1-stable branch that
fixes this issue.

See:
  - https://github.com/rails/rails/pull/46895

Ref:
  - https://github.com/scientist-softserv/hykuup_knapsack/issues/67

* 🎁 only add Good Job classes if it's enabled

ref:
- https://github.com/samvera/hyku/pull/2047#discussion_r1441130543

* ♻️ Removing file in favor of comments found in docker-compose.yml

Remove file in favor of comments found on lines scientist-softserv/adventist-dl#138 - 139, which uses the sleep infinity command to accomplish the same thing.

ref:
- https://devopscube.com/keep-docker-container-running/

* 🧹 Remove disabling of Rubocop Naming/PredicateName (#2126)

This cop was originally disabled in order to get specs to run during CI
without code changes. Now that specs are running, the changes can be
safely made to appease rubocop rather than disabling it.

* 🎁 Add Hyrax version in the footer

Often we forget what version of Hyrax we're running so this should help.

---------

Co-authored-by: Rob Kaufman <[email protected]>
Co-authored-by: Shana Moore <[email protected]>
Co-authored-by: LaRita Robinson <[email protected]>
Co-authored-by: Jeremy Friesen <[email protected]>
Co-authored-by: Benjamin Kiah Stroud <[email protected]>
Co-authored-by: LaRita Robinson <[email protected]>
## 🤖 Update charts for deploy

929565b6e52bfa46d48b6642fc9efe6dd5f593b5


## ♻️ Account for observed customizations

27cb0a98704e5d4a97222097e986269d22b974f9

Dear reviewer, put on your reading glasses.

This commit looks at the newly refactored
`Hyrax::IiifAv::DisplaysContentDecorator` as well as the current state
of [PALS's Hyrax::IiifAv::DisplaysContentDecorator][1] and attempts to
account for the variances between the two by introducing configurations.

Yes, we could port this to the hyrax-iiif_av gem, but for now that would
not solve the underlying issue of how we've been handling things.

Why the Hyku::Application class attribute?  Because the decorator is
being mixed into a module, which does not response to `.class_attribute`
methods.

[1]: https://github.com/scientist-softserv/palni-palci/blob/8754556c0225ce9f04674c1ffac6403586fd65f4/app/presenters/concerns/hyrax/iiif_av/displays_content_decorator.rb

## 🧹 Appeasing Rubocop

99a97339bbb42508a43f24094222e200c6c92985


## Remove conflict in controller

c7bbda6a4d7f2c5831c09120ee73cc716a6ded5b


## knapsack gemfile additions or replacement

9cfca93924913aa03ebdfc7c423e83779a043132


## 🐛 Add tests for all defined color methods

747601fe145d6ed24c3c55ac110d4b5d85ecf61a


## 🐛 Add placement_class for masthead rendering

821cbf2e305d47cba4bae8fac623e65a93259afb

This change aligns with expectations in [Hyrax 5.0.0.rc1][1]

[1]:https://github.com/samvera/hyrax/blob/966951ffaa72524e4a775f8a198bd51a47ece7d9/app/views/layouts/hyrax/dashboard.html.erb#L12

## 🎁 fixes to unblock deploys

66d529266e9588b132c47e3a2b41c59a7d55e268

Removes SaveSearchesController as it is not longer supported. Blacklight::SavedSearched was removed in v7+
Adds storage.yml, a required file to boot up in production.

ref:
- https://github.com/projectblacklight/blacklight/wiki/Saved-Searches
- https://github.com/projectblacklight/blacklight/pull/1736

## Removing unneeded file

a559908147afa211c3c8c547f852004abb0dc83d


## Resolving menu structure for site configuration

f2c6b8911ca1708dcbaa82ee025c72966dc147dc


## Applying changes in main to this work

b2334faf73cbf1615c3f53416b39e5cd5ca1aff0


## update version to 6.0.0rc1 (#2137)

ead10171c362944a82fdb1d1e51d61d67a58ab7f


## Fixing locale_for tests to reflect I18n behavior

0fbde5004ceaaadffd124e5b3296c806fc5f50fb


## 🐛 Use non-deprecated and non-removed method

5894b93010aa119df8d3fb410d9988107f0718c5

The `member_presenters_for` was removed in
https://github.com/samvera/hyrax/commit/eeb3c3e888f87809b5f55287f1d95302d61d6ba8;
the deprecation advice prior to removal was to use `member_presenters`

Related to:

- https://github.com/samvera/hyrax/pull/6203

## Fixing roles service

6b17b5cab2f8b15c0508625df0034236205eb377


## Removing file that came along for the ride

ad0d56bc176d434d3b3d8f900db99c277892d4ff


## working on fixing redis deploy

6a23643ae0b5bd3508a31ac603e49f5c6e203dea


## 🐛 Restore translation

b8d7a2e14fe45f91634995407e16b62c50b83d89

The translation should be plural

## 🧹 Revisiting translations

a880b5086b57516302062d5593cc7b52bf43a94e


## 🧹 Fix badge status for feature

2879a36a1cdbe42cf1fe5966fb7ae00f5025fca6


## ♻️ Updating Gemfile to reflect pointing to main

ff3532eefcf64f37535f9d1bf4f3b8092559d15b

I have tested this against Hyku Knapsack prime by pointing the submodule
to this branch and then rebuilding Hyku.  Once I rebuilt and brought
docker up, I was able to open http://hyku.test.

## Add missing logo translation

6b7ba4b78c25729facb1218aaed7d56e8774cbbc


## Revert "knapsack gemfile additions or replacement"

e43ce2969e5826d7b45a5184813f40de7a0f7bc0


## 🧹 Specify knapsack required branch

cde504f756adaff5e5fcb3d37c4b56aaaf5aaa21

See inline documentation regarding purpose and intent of the hard-coded
branch logic.

</details>

ShanaLMoore and others added 30 commits December 19, 2023 12:05
* remove dogbiscuit crossover, fix routes

* add spec for search history

* add missing methods to avoid content block errors

* Update Hyku Gemfile.lock

* add option to support good job for background jobs instead of sidekiq

* update gemfile lock

* Update good_job.rb

* merge

* fix routes file, add missing js file

* 💄 styling fix

* 💄 rubocop fixes

* remove iiif_print/iiif_print require

cause of Sprockets::FileNotFound in Splash#index error. Doesn't seem necessary.

* 🎁 🧹 add missing file and format with semicolons

The previous build revealed that admin_color_select.js was missing. It also complained about missing semicolons.

* 💄 correct missing semicolons

appease the hound by formatting js file with semicolons.

* 🧹 remove call to iiif_print/iiif_print

Cause of build error. It's already being included in sass.

* 💄 Rubocop fixes

* ✅ Fix test setup for catalog_controller_spec

This commit will add additional setup to the catalog_controller_spec.

* Add knapsack helper

* remove Adventist from application.rb

* 🎁 Add conditional to run correct command for worker

This commit adds a conditional to run the correct command for sidekiq or good_job, when running docker compose up.

* Make appearance constants overrideable

This allows for the knapsack to override the constants by defining and
using a method rather than a constant in the look-ups.

* add reporting fix to hyku ci

* spec loading fixes

* rubocop

* 🧹Make appearance defaults overrideable

* bump bulkrax to 5.4.0

This commit pulls in a small collection of bug fixes.

* 🧹 Include knapsack css

* fix job loading when selecting good job

* adjust docker compose to use the startup script

* 🎁 install tesseract eng_best

* ♻️ revert tesseract best changes to dockerfile

this change belongs in the knapsack directory instead

* ♻️ revert tesseract best changes to dockerfile

this change belongs in the knapsack directory instead

* 🐛 Bring fix for entry show page not showing link

This commit will bring in a fix from Bulkrax that correctly shows the
object from the entry show page.

ref:
  - samvera/bulkrax@0e68a5e

* 🧹 Revert previous commit and update Bulkrax

This commit will update Bulkrax to 5.4.1 instead of using the override
from the last commit.  We also revert the changes from the last commit.

* 🐛 subject can't be blank for the contact form

Previously there was a bug because even if you typed in a subject, the contact form would error saying that it was blank.

Part of issue:
- https://github.com/scientist-softserv/adventist-dl/issues/608

* mend

* ♻️ Add handling for Knapsack theme overrides

Prior to this commit, we were looking for themes yaml files relative to
the directory of the spawning script.  For Hyku that was always the
`Rails.root` directory.  However, when running specs in Knapsack, that
directory was `Knapsack::Engine.root`.

This unearthed a potential configuration issue; namely that we want
Knapsack's to control what themes are available, meaning we don't want
to require amending Hyku's themes.

So, we introduce a mechanism for looking up files first in the Knapsack
then in Hyku.

I discovered this bug in the specs for knapsack (below is the *Error stack trace*)

<details>
<summary>Error stack trace</summary>

```
2) Hyrax::Admin::AppearancesController with an administrator GET #show assigns the requested site as @site
     Failure/Error: get :show, params: {}

     Errno::ENOENT:
       No such file or directory @ rb_sysopen - config/home_themes.yml
     # /usr/local/bundle/gems/psych-3.3.4/lib/psych.rb:582:in `initialize'
     # /usr/local/bundle/gems/psych-3.3.4/lib/psych.rb:582:in `open'
     # /usr/local/bundle/gems/psych-3.3.4/lib/psych.rb:582:in `unsafe_load_file'
     # ./hyrax-webapp/app/controllers/hyrax/admin/appearances_controller.rb:19:in `show'
     # /usr/local/bundle/gems/rails-controller-testing-1.0.5/lib/rails/controller/testing/template_assertions.rb:62:in `process'
     # /usr/local/bundle/gems/devise-4.9.2/lib/devise/test/controller_helpers.rb:35:in `block in process'
     # /usr/local/bundle/gems/devise-4.9.2/lib/devise/test/controller_helpers.rb:104:in `catch'
     # /usr/local/bundle/gems/devise-4.9.2/lib/devise/test/controller_helpers.rb:104:in `_catch_warden'
     # /usr/local/bundle/gems/devise-4.9.2/lib/devise/test/controller_helpers.rb:35:in `process'
     # /usr/local/bundle/gems/rails-controller-testing-1.0.5/lib/rails/controller/testing/integration.rb:16:in `block (2 levels) in <module:Integration>'
     # ./spec/controllers/hyrax/hyrax/admin/appearances_controller_spec.rb:31:in `block (4 levels) in <top (required)>'
     # /usr/local/bundle/gems/webmock-3.19.1/lib/webmock/rspec.rb:39:in `block (2 levels) in <top (required)>'
     # ./hyrax-webapp/spec/support/multitenancy_metadata.rb:50:in `block (2 levels) in <top (required)>'
     # /usr/local/bundle/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:124:in `block in run'
     # /usr/local/bundle/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:110:in `loop'
     # /usr/local/bundle/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:110:in `run'
     # /usr/local/bundle/gems/rspec-retry-0.6.2/lib/rspec_ext/rspec_ext.rb:12:in `run_with_retry'
     # /usr/local/bundle/gems/rspec-retry-0.6.2/lib/rspec/retry.rb:37:in `block (2 levels) in setup'
     # ./spec/spec_helper.rb:10:in `block (2 levels) in <top (required)>'
```

</details>

Related to:

- #2007
- #2008

The above two commits will require some reconciliation once this is incorporated.

* ♻️ Favor Hyku::Application.path_for over Rails.root

Given the existence of Knapsack we need to consider how overrides in
Knapsack will take precedence over Hyku files.  This change handles
cases where we want to use the Knapsack's uploaded thumbnails.

Related to:

- #2010

* 🎁 Add highlight key to UV

This commit allows for the `parent_query` to be highlighted in the UV so
users won't have to do a catalog search and also a UV search.

* 🐛 Mixin `HykuKnapsack::ApplicationHelper`

This commit will mixin the `HykuKnapsack::ApplicationHelper` into the
ApplicationHelper which will allow us to use #render_ocr_snippets for
snippet highlighting.

* Revert "🐛 Mixin `HykuKnapsack::ApplicationHelper`"

This reverts commit ae093f1.

* ♻️ Favor class_attribute over constant

In Adventist, we're needing to override the constant's values.  By
making this a class_attribute we can more readily do the override via
configuration instead of obliteration of a constant.

* ♻️ Favor configurable html head title value

Prior to this commit, we hard-coded the page title; this is something
that should be far more configurable.  And this refactor is a step
towards that.

This also allows for downstream implementors to not have to override the
view simply to change the title element.

* 🐛 Add custom rendering for license

Prior to this commit, the License would render as a plain URL.  With
this change, we are now coercing the license into a URL that is labeled
and titled with the name of the license.

This is copied and modified based on [Rights show partial][1]

Related to:

- https://github.com/scientist-softserv/adventist-dl/issues/620

[1]: https://github.com/samvera/hyrax/blob/b334e186e77691d7da8ed59ff27f091be1c2a700/app/views/records/show_fields/_rights.html.erb

* ♻️ Add option to override devise configuration

For Adventist, we wanted to disable registration of accounts as this was
creating a case where folks were creating their own accounts and
tenants.

Related to:

- https://github.com/scientist-softserv/adventist-dl/issues/492
- https://github.com/scientist-softserv/adventist-dl/issues/618
- #1964
- scientist-softserv/adventist-dl#493

* run asset build later in process to allow knapsack to run it only one time

* 🐛 Fix Add to Collection for page 2+ of works

Prior to this commit, when you were on page 2 of your works and selected
a work to add to a collection, the query for available collections would
use the page 2 as part of the collection query.  This would mean the
first 100 collections (default page size) that you had access to add
works to were skipped.

With this commit, we omit the query parameters from the works page and
then query collections.

Related to:

- samvera/hyrax#5972
- samvera/hyrax#5969
- https://github.com/scientist-softserv/adventist-dl/issues/625

Co-authored-by: LaRita Robinson <[email protected]>

* test that invited users are added to the registered group

* Add invited users to the registered group

Fixes a bug where users who were invited with no roles would not
show up in the users list at all

* 🐛 Change Hyky to Hyku (#2029)

Typo caused inability to upload collection thumbnail.

* 🎁 Modify labels in UV for V3 manifests

This commit will add the same treatment as we have for V2 manifests to
V3 manifests. This will allow the UV to add a more human readable label
to the pages.

Ref:
  - https://github.com/scientist-softserv/adventist-dl/issues/628

* 🐛 Fix bad method name

Related to:

- https://github.com/samvera/hyku/pull/2023/files
- scientist-softserv/atla-hyku#198

* 🐛 Move some methods to be public

This commit will move #solr_document, #current_ability, and #request to
be public methods.  Since these methods in Hyrax were not private, in
the decorator it should not be private either.

Ref:
  - https://github.com/samvera/hyrax/blob/b334e186e77691d7da8ed59ff27f091be1c2a700/app/presenters/hyrax/file_set_presenter.rb#L10

* First attempt for upgrade to Hyrax 5.0.0.rc2

So far the changes throw an error `The adapter `nulldb_adapter` is not
yet supported` when doing a `docker compose build`.  Commenting out `RUN
RAILS_ENV=production SECRET_KEY_BASE=`bin/rake secret` DB_ADAPTER=nulldb
DB_URL='postgresql://fake' bundle exec rake assets:precompile && yarn
install` in the Dockerfile allows the build to complete but still can't
boot yet.

* 🧹 Get assets to precompile

This commit has a lot in it, but of note:

- We forked apartment gem to expand activerecord version support
- Used the Hyrax upgrade guide to update assets
- Replaced bootstrap 3 variables with hard coded values
- Commented out blacklight_helper_behavior.rb because Blacklight 7
  removed it, we'll have to figure out how to get the same functionality
  in the new version

* 🧹 Switch to Hyrax `double_combo` branch

We are using this branch on Hyrax because it has quite a few Valkyrie
related fixes in it.

* 🧹 use class attribute instead of constant to correct failing specs

* Fix specs

* 🧹 Get the page to load

This commit will get the proprietor page to load.  You can create a
tenant and vist it as well.

* ♻️ Introduce Hyku::Application.theme_view_path_roots

With the introduction of [HykuKnapsack][1], we are adjusting how we
create instances of Hyku.  Namely we don't clone Hyku but instead we
incorporate Hyku as a submodule into a Knapsack.

The Knapsack is a Rails engine that is mounted in the Hyku application.
What this means is that when we want to

Prior to this commit, the only way to adjust themed views would have
been to add them to the Rails application (e.g. Hyku) directly.  Which
would work in a non-Knapsack ecosystem.

However, with Knapsack we need a means of saying "Hey, for themes we
want to be able to add/adjust views within the knapsack."  Hence this
change.

[1]: https://github.com/samvera-labs/hyku_knapsack

* 🧹 Prepping for rubocop

This commit will change the Docker image to rc1 because rc2 stopped
working (at least locally).  Also getting things ready to run rubocop.

* 🧹 Ran `bundle exec rubocop -a`

* 🧹 Autocorrect frozen string literals

```sh
rubocop --only Style/FrozenStringLiteralComment -A
```

* 🧹 Rubocop'd lengths and other low hanging fruit

Various length metrics were disabled in this commit.  Also other various
cops that were easy to fix.

* 🧹 Remove deprecated Blacklight code

removing the deprecated blacklight code allows the specs to run. We should consider if finding a replacement is necessary in the following ticket:

- scientist-softserv/hykuup_knapsack#54

Issue:
- scientist-softserv/hykuup_knapsack#35

* 🧹 Avoid `#present?` in non-Rails situations

Rails provides [`Object#present?`][1], which is a method that is not
generally available in Ruby.  However in the changed context, the
scripts do not have access to Rails methods.

By using this adjusted approach we favor baseline Ruby methods.

[1]: https://api.rubyonrails.org/classes/Object.html#method-i-present-3F

* 🧹 Get Homepage Controller specs passing (#2058)

Refactor homepage controller to more closely align with Hyrax's
homepage controller.
Adjust theme views to render `modal` instead of `ajax_modal`.

refs: scientist-softserv/hykuup_knapsack#56

* ♻️ Replace Homepage Presenter with decorator (#2059)

* 🧹Get CatalogController specs working (#2060)

* 🧹 Hyrax 5 get additional specs passing (#2062)

* 🧹 Get chrome.hyku.test working

* 🧹 Get SitesControllerSpecs working

 File fixtures were broken.
 Ref scientist-softserv/hykuup_knapsack#56

* 🧹 Remove google analytics from config reload

This is a piece of a fix for analytics that came in via
scientist-softserv/palni-palci#946

Additional backporting of analytics work is still needed, but this
fixes numerous specs so it is being pulled in earlier.

* 🧹 Update ruby version for circleci

* 🧹 Update rails version for circleci

* 🧹Database migration & schema update (#2063)

For table hyrax_counter_metrics

* 🧹 Fix Hyrax 5 remaining controller spec failures (#2064)

* 🧹Remove ActiveFedora monkeypatch

* 🧹Fix file fixture

* 🧹 Upgrade views from Bootstrap 3 to 4

This commit is a first swing of upgrading all the views from Bootstrap 3
to 4.  There's still a lot of work to be done to make the views look
good but this is a good first step.

* Hyrax 5 upgrade rubocop fixes & get specs running in CI (#2065)

* 🧹Rubocop Fixes

* Attempt to fix circleci

* 🧹 Fix CollapsableSectionPresenter override

The override was causing issues not passing the nav-link class into the
anchor tags.  This fix specifically passes the title attribute in vs the
previous implementation of trying to pass all html options in.

* 🧹 Remove required translations from locales

This commit will remove the override for the `required` translations
since it changed to a badge badge-style in Bootstrap 4.  This is
accounted for in Hyrax so we can fall back to that.

* 🐛 Fix some javascript errors

This commit will fix a few javascript errors, at least enough to get the
the bootstrap javascript to work correctly.  We're still getting a the
almond-rails js error but that seems to exist in previous Hyku as well.

* Hyrax 5 upgrade rubocop fixes & get specs running in CI (#2065)

* 🧹Rubocop Fixes

* Attempt to fix circleci

* 🧹 Post review adjustments

These are adjustments made after the PR has been reviewed.

* 🧹 Clean up a couple blacklight views

This commit will account for the new versions of Blacklight and
Blacklight Gallery.  The masonry view no longer exists so we can't tell
how it's broken as of right now.  I'm sure we'll run into it during our
testing.

NOTE:  These changes refer to the shared search tenant.

* 🧹 Bring back `BlacklightHelperBehavior`

This commit will bring back the `BlacklightHelperBehavior` module but it
will be namespaced under `Hyku` to avoid conflicts.  We will then
include it in the `HyraxHelper` module so those methods should override
the ones in `Blacklight::BlacklightHelperBehavior`.

* 🧹 Hyrax 5 upgrade additional specs (#2067)

* 🧹 More spec & controller fixes

 Ref scientist-softserv/hykuup_knapsack#55

 - Contact form controller and pages controller duplicate some of the
 homepage controller behavior, so corresponding fixes are needed.
 - Update collections factory and collection_ability_spec to match hyrax
 and stop calling `.gid` on a collection_type.
 - Adjust permission_template_form_spec to adjust for removal of method
 `reset_access_controls!` and add a few new expectations instead.

* 🧹 Begin work on Roles Service

Working with Permission Templates has changed, requiring an adjustment
to both logic and specs.

* 🧹 Solr Document Ability Spec

* Rubocop fixes

* Fix typo of collection variable

* Reinstate some collections factory overrides

* Revert Rubocop changes

Caused spec failure in roles_service_spec.

* Fix create_default_admin_set_job_spec

* Restore mistakenly removed capta use

* 🧹 Stanford import specs

We have plans to remove the Stanford import logic, but for now, this
handles the specs that were failing, in an attempt to get CI to pass.

* Make Rubocop happy

* Fix typo

* Update Hyrax to pull in most recent changes

* More spec fixes

Menu presenter: removed html_options
Application Helper: override for missing_translations now receives
`false` when translation wasn't found rather than a string.

* Fix missing translation logic

* Fix  missing_translation override

Simplify and fix override. A missing translation now returns `false`
instead of the text `translation missing`.

The super method requires the `option` parameter, so we opted to keep
the override.

* 🧹 Remove copied code

The overrides are no longer necessary.  In reviewing the diff between
what I'm removing and what is in the `double_combo` branch; the major
change was adding an operator for the `reduce` function.  The breaking
problem was that the method signature of one of the copied methods has
changed in Hyrax 5.0.

The removal considers that Hyrax::Group is of two different classes:

- In Hyrax, it is a plain old Ruby object
- In Hyku, it is descended from ActiveRecord::Base

The two classes have different instantiation parameters.  Hence the
introduction of `Hyrax::Group.new` in this code.

* 🧹 Fix missing method name

* 🐛 Ensure :maxFileSize is integer

Prior to this commit, we were casting the value to string.  However
Hyrax attempts to do division on that string.

See https://github.com/samvera/hyrax/blob/b7891b758411c59f71ff54212e0d250fcc47e35f/app/views/hyrax/base/_form_files.html.erb#L6-L15

* Skip taking a picture on failure

* 🧹 Fix issue regarding Valkyrie::Identifier

The encountered error was:

```
NoMethodError:
  undefined method `split' for #<Valkyrie::ID:0x0000ffffa5f04bc8
  @id="admin_set/default">
```

* 🧹 Favor Sipity::Entity function over to_sipity_entity

The Sipity conversion methods are now explicit functions (much like the
`Array()` function).

- https://github.com/samvera/hyrax/blob/5aaa568d348a180add2a1337d9d794b740703df8/app/models/sipity.rb#L20

* Update Hyrax IIIF AV gem

* 🧹 Review controller overrides

Many of the controllers just needed to be updated with the decorator
pattern.  We're creating a new concern for all the Hyku specific
overrides in Hyku::WorksControllerBehavior.  This has to be included in
the Controller classes after Hyrax::WorksControllerBehavior to override
the relevant methods.

* clean up from pr review

* Appease rubocop

* Update IIIF Print gem

* 🤖 Specify Cache Root

Prior to this commit, we were seeing the following failure:

> Failure/Error: Site.application\_name || super
>
> ActionView::Template::Error:
>  Permission denied @ dir\_s\_mkdir - /app

The `Account#setup_tenant_cache` sets the cache\_store to be
`ENV.fetch('HYKU_CACHE_ROOT', '/app/samvera/file_cache')`.  When I
locally chanced it to `/blorg/samvera/file_cache` I could repeat the
error.

With this commit, we're setting the cache value for the CircleCI run.

Why was it previously working?  Perhaps because
`Account#setup_tenant_cache` never got called due to other
configurations?  There is a guard clause around the method call.

* 🧹 Update spec to reflect AdminSet default behavior

In the following commit, we removed the deprecated
`AdminSet.find_or_create_default_admin_set_id`:

- samvera/hyrax@863c4bc

This commit follows the advice of the deprecation warning and now favors
the `Hyrax::AdminSetCreateService.find_or_create_default_admin_set.id`
method call.

Related to:

- samvera/hyrax#6203

* Remove obsolete site roles and routes (#2080)

The site/roles route is obsolete. This is an attempt to remove as much
of the obsolete logic as possible, as it has been replaced by the groups
with roles feature.

* Remove stanford importer

Importer was deprecated in prior release version.

* 🤖 Fix spec/features/collection_type_spec.rb

There are three major changes:

1. Favor setting `collection_type` attribute instead of
   `collection_type_gid`
2. Change `#collections?` to `#collections#any?`
3. Change CSS selector based on Bootstrap upgrade

The above changes are related to work done in:

- samvera/hyrax#5730
- samvera/hyrax#5742
- samvera/hyrax#4701

See:
- samvera/hyrax@eb6e04e
- samvera/hyrax@237c0c6
- samvera/hyrax@280664b

* 🤖 Fix stub methods to pass tests

These tests weren't verifying that we could reach Redis; they were
testing the interface of the `RedisEndpoint#ping` by mocking the
instance.

This commit changes the mocking by avoiding a call to
`Hyrax::RedisEventStore.instance` which was raising a Redis connection
error.

Again, this test is not is redis connecting but "assume we are trying to
connect to redis now demonstrate ping."

* Lock chromedriver version (#2086)

Refs
CircleCI-Public/browser-tools-orb#96
CircleCI-Public/browser-tools-orb#75 (comment)

* 🧹 Clean up model overrides

Most of what's in this commit is just updating the Hyrax version in the
override comments.  There was also an opportunity to switch the
`ContactForm` model to a decorator.

* 🤖 Favor general spec over specific

With the CircleCI alternate place for the file_store cache, we need to
fallback to a more general test assertion.

* 🤖 Bring over Hyrax spec changes

* 🤖 Extract constant to ease testing

We're not concerned with where the cached file is for testing purposes;
so instead of hard-coding a value that can change in the ENV, let's
compare the constant that we use in the code.

tl;dr - Don't rely on magic strings

* 🤖 Re-arrange CleanupAccountJob specs

The `CleanupAccountJob` was stubbing very nosily; needing to know too
much about implementation details of the end-points.  Instead this
preserves the over-view spec (e.g. what all the cleanup spec actually
cleans up) while moving that nosy logic to the constituent endpoint.

Most of these specs are testing that the method chains work; which is
perhaps adequate as the other option is far more expensive tests (e.g.
make a new Fedora node only to then immediately destroy it)

I'm also leveraging the new `Redis::Namespace#clear` method.

Related to:

- resque/redis-namespace#202

* 🧹 Restore btn-sign-up on splash page

This change was part of the bulk upgrade of Bootstrap 3 to 4.

* 🧹 Fix `./spec/requests/admin_dashboard_spec.rb` spec

Prior to this commit, the specs failed because of the introduction of
the WorkflowResponsibilityFormDecorator.  The decorator extracted prior
logic from Hyrax::Admin::WorkflowRolesController.

In copying that logic we introduced a subtle bug.  Namely, we favored
the original `.new` behavior if and only if you provided a `:user_id`.
This broke places where we instantiated the form in a
view (e.g. `./app/views/hyrax/admin/workflow_roles/index.html.erb`).

With this change, we make the behavior of `.new` fail towards its
"normal" implementation and instead rely on the presence of an attribute
to switch to a different form instantatior.

See Commit:

- 095edca

Related to:

- #2079

Co-authored-by: LaRita Robinson <[email protected]>
Co-authored-by: Kirk Wang <[email protected]>

* 🎁 Upgrade Redis initializer to Hyrax 5's gen version

Prior to this commit, when looking at the
`Hyrax::RedisEventStore.instance` we saw it's connection information as:

`#<Redis client v4.8.1 for redis://localhost:6379/0>`

We were expecting the connection to be the following:

`#<Redis client v4.8.1 for redis://redis:6379/0>`

What we were seeing in tests is when we hit the redis connection we were
getting an error about not being able to connect to 127.0.0.1:6379 (e.g.
localhost).

With this commit, we have a clear connection to Redis.

See Redis Config initializer:

- https://github.com/samvera/hyrax/blob/966951ffaa72524e4a775f8a198bd51a47ece7d9/lib/generators/hyrax/templates/config/initializers/redis_config.rb#L1-L10

Co-authored-by: Kirk Wang <[email protected]>

* 🧹 Clean up actors

Just found one actor that was overriding Hyrax.  This commit will switch
it to a decorator.

* 🐛 Handle missing labels

Adjust paths and keys to look for labels.

* Appease the cops

* 🧹 Assigning collection_type

The partials rendered in the tested view assume that we've set a
collection type.

* Appease rubocop

* Fixing nav link selectors to new structure

* Fixing nav link selectors to new structure

* 🧹 Clean up forms

The only big thing in this commit is the appearance_decorator.  I've
added to the spec to show that the decorator should be working as
intended.

* 🧹 Fix spec based on HTML class changes

* 🧹 Narrow specificity of CSS selector

The selector was *very* specific, and with the HTML class changes for
Bootstrap 3 to 4, this almost certainly broke.

Note, there are still underlying issues with two other specs; there
errors are listed below:

```
1) Admin can select home page theme when a search results theme is
selected updates the search results page with the selected layout view

Failure/Error: super

     ActionView::Template::Error:
       undefined method `with_collection' for nil:NilClass
```

* 🧹 Remove specificity of CSS selectors in test

The hyper specific selectors are not durable for CSS framework upgrades.

* 🐛 Adding document_component to blacklight's config

Blacklight 7.35.0 's default document_component is `nil`, see:

- https://github.com/projectblacklight/blacklight/blob/ac5fa8b300c5ad5c35b1663ef0f15372ffa2be0f/lib/blacklight/configuration.rb#L213
- https://github.com/projectblacklight/blacklight/blob/ac5fa8b300c5ad5c35b1663ef0f15372ffa2be0f/lib/blacklight/configuration.rb#L186

 Digging around in the wiki, you might find (only found because I cloned the repo):

- https://github.com/projectblacklight/blacklight/wiki/Configuration---Results-View

Related to:

- projectblacklight/blacklight#2317

* 🧹 Allow :clean or :clean_repo to work for the cleaners

Hyrax has :clean_repo and Hyku has :clean

Sometimes folks copy over specs from Hyrax, and bring along the
:clean_repo; which looks like it should work.

With this commit, we bring that logic along!

* 🧹 Remove skip CI

Perhaps it's flappy; but let's see.

* 🧹 Fix button class for Bootstrap 3 to 4

* 🧹 Favor Layout/LineLength over Metrics/LineLength

Rubocop seams to prefer the Layout namespace for LineLength.

* 🧹 The selector is not working

Checking the HTML (on the CircleCI SSH environment), it appears that the
selector should work in test.  But it is not.  So I'm removing the specificity.

* Cleaning a spec that should start clean

* 🧹 Ensure feature specs run clean

Prior to this commit, we did not automatically clean the features.  The
below ripgrep (and output) shows that there were some features which did
not start from a clean state.

```
rg "(clean|clean_repo):" spec/features --files-without-match
``

```
spec/features/accounts_spec.rb
spec/features/proprietor_spec.rb
spec/features/featured_collections_spec.rb
spec/features/user_roles_spec.rb
spec/features/oai_pmh_spec.rb
```

* Stab at trying to find a problem

* 🧹 Clean up services

This commit will reconcile the services that are overrides for Hyrax
with the Hyrax 5.0.0rc2 version.  There were a number of overrides that
were changed to the decorator pattern.

* Moving rescue and documenting the why

* 🧹 Rearrange order of filter chain

This is not tested in the UI, but the
`show_works_or_works_that_contain_files` remains after the troublesome
advanced query filters.

* 🧹 Address PR comments

This commit addresses comments from the review but one thing that is of
note is loading the I18n translations in the application.rb file.  We
needed this because our decorators load prior to I18n loads the locales
in our config/locales directory for them to use so we were getting
missing translations.

* 🧹 Attempting to find and squash bug

* ♻️ Account for observed customizations

Dear reviewer, put on your reading glasses.

This commit looks at the newly refactored
`Hyrax::IiifAv::DisplaysContentDecorator` as well as the current state
of [PALS's Hyrax::IiifAv::DisplaysContentDecorator][1] and attempts to
account for the variances between the two by introducing configurations.

Yes, we could port this to the hyrax-iiif_av gem, but for now that would
not solve the underlying issue of how we've been handling things.

Why the Hyku::Application class attribute?  Because the decorator is
being mixed into a module, which does not response to `.class_attribute`
methods.

[1]: https://github.com/scientist-softserv/palni-palci/blob/8754556c0225ce9f04674c1ffac6403586fd65f4/app/presenters/concerns/hyrax/iiif_av/displays_content_decorator.rb

* 🧹 Clean up other overrides

This commit is aiming to clean up the rest of the found overrides.

* 🧹 Change locale file load order so that our local files are prioritized

We add our local config locale directory to the I18n.load_path so that our local files take precendence over the ones found in our gems.

Related issue:
- scientist-softserv/hykuup_knapsack#55

* 🧹 Update IIIF Print and AV gems

We were not seeing images loading correctly in the UV because we
introduced the `Hyku::WorksControllerBehavior` and IIIF Print did not
know about it.
  - scientist-softserv/iiif_print@cad2cf3

We were seeing a respon to mismatch error in the Hyrax IIIF AV.
  - samvera-labs/hyrax-iiif_av@4723b8f

Also, the image that I tested was a phone image that apparently had
different ExifImageHeight/ExifImageWidth values than the
ImageHeight/ImageWidth values.  This was probably because modern phones
typically generate multiple images so the user can choose the best shot.
The exiftool_image_to_fits.xslt was proritizing the Exif values over the
regular values and would cause our image characterization to have weird
height and width values.  The change in this PR prioritizes the regular
over the Exif values.

Ref:
  - scientist-softserv/hykuup_knapsack#68

* 🐛 Fix video thumbnail generation

In a previous commit we created the
`Hyrax::FileSetDerivativesServiceDecorator` to override the default
thumbnails that Hyrax uses but I forgot to add the video thumbnail,
which is fixed here.

Ref
  - scientist-softserv/hykuup_knapsack#69

* 🧹 Add space between thumbnail and title

* 🧹 Update Hyku version

This commit bumps the hyku version from 5.1.0 to 6.0.0.

* 💄 ruboco fix

* 🧹 Fixing a few styles

This commit will change the maximized size to match Bootstrap 4 break
points.  Also, added btn-secondary to hyku.css so it doesn't get
overriden by appearance styles.  Finally, restructured the homepage to
make it look more like Hyrax 5.

* sort properties

* adjust screen size

* 🧹 Update `rails` to `6-1-stable` for GoodJob

There is a compatibility issue with Rails 6.1.7.6 and Ruby 3.2 that was
affecting GoodJob.  There was a backport to the 6-1-stable branch that
fixes this issue.

See:
  - rails/rails#46895

Ref:
  - scientist-softserv/hykuup_knapsack#67

* 🎁 only add Good Job classes if it's enabled

ref:
- #2047 (comment)

* ♻️ Removing file in favor of comments found in docker-compose.yml

Remove file in favor of comments found on lines #138 - 139, which uses the sleep infinity command to accomplish the same thing.

ref:
- https://devopscube.com/keep-docker-container-running/

* 🧹 Remove disabling of Rubocop Naming/PredicateName (#2126)

This cop was originally disabled in order to get specs to run during CI
without code changes. Now that specs are running, the changes can be
safely made to appease rubocop rather than disabling it.

* 🎁 Add Hyrax version in the footer

Often we forget what version of Hyrax we're running so this should help.

---------

Co-authored-by: Rob Kaufman <[email protected]>
Co-authored-by: Shana Moore <[email protected]>
Co-authored-by: LaRita Robinson <[email protected]>
Co-authored-by: Jeremy Friesen <[email protected]>
Co-authored-by: Benjamin Kiah Stroud <[email protected]>
Co-authored-by: LaRita Robinson <[email protected]>
* pals-contribute-back-to-prime:
  🎁 Contribute back work from PALNI/PALCI
  Updating translations
  🎁 Contributions from PALNI/PALCI
  🎁 Contributions from PALNI/PALCI
Dear reviewer, put on your reading glasses.

This commit looks at the newly refactored
`Hyrax::IiifAv::DisplaysContentDecorator` as well as the current state
of [PALS's Hyrax::IiifAv::DisplaysContentDecorator][1] and attempts to
account for the variances between the two by introducing configurations.

Yes, we could port this to the hyrax-iiif_av gem, but for now that would
not solve the underlying issue of how we've been handling things.

Why the Hyku::Application class attribute?  Because the decorator is
being mixed into a module, which does not response to `.class_attribute`
methods.

[1]: https://github.com/scientist-softserv/palni-palci/blob/8754556c0225ce9f04674c1ffac6403586fd65f4/app/presenters/concerns/hyrax/iiif_av/displays_content_decorator.rb
Removes SaveSearchesController as it is not longer supported. Blacklight::SavedSearched was removed in v7+
Adds storage.yml, a required file to boot up in production.

ref:
- https://github.com/projectblacklight/blacklight/wiki/Saved-Searches
- projectblacklight/blacklight#1736
The `member_presenters_for` was removed in
samvera/hyrax@eeb3c3e;
the deprecation advice prior to removal was to use `member_presenters`

Related to:

- samvera/hyrax#6203
orangewolf and others added 18 commits January 8, 2024 20:40
The translation should be plural
I have tested this against Hyku Knapsack prime by pointing the submodule
to this branch and then rebuilding Hyku.  Once I rebuilt and brought
docker up, I was able to open http://hyku.test.
knapsack gemfile additions or replacement
Revert "knapsack gemfile additions or replacement"
♻️ Updating Gemfile to reflect pointing to main
* main:
  Revert "knapsack gemfile additions or replacement"
  ♻️ Updating Gemfile to reflect pointing to main
  knapsack gemfile additions or replacement
See inline documentation regarding purpose and intent of the hard-coded
branch logic.
…sack

🧹 Specify knapsack required branch
* main: (29 commits)
  🧹 Specify knapsack required branch
  Revert "knapsack gemfile additions or replacement"
  Add missing logo translation
  ♻️ Updating Gemfile to reflect pointing to main
  🧹 Fix badge status for feature
  🧹 Revisiting translations
  🐛 Restore translation
  working on fixing redis deploy
  Removing file that came along for the ride
  Fixing roles service
  🐛 Use non-deprecated and non-removed method
  Fixing locale_for tests to reflect I18n behavior
  update version to 6.0.0rc1 (#2137)
  Applying changes in main to this work
  Resolving menu structure for site configuration
  Removing unneeded file
  🎁 fixes to unblock deploys
  🐛 Add placement_class for masthead rendering
  🐛 Add tests for all defined color methods
  knapsack gemfile additions or replacement
  ...
*
* Date: 2023-09-17T03:44:19.860Z
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Cropper=e()}(this,function(){"use strict";function C(e,t){var i,a=Object.keys(e);return Object.getOwnPropertySymbols&&(i=Object.getOwnPropertySymbols(e),t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),a.push.apply(a,i)),a}function S(a){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?C(Object(n),!0).forEach(function(t){var e,i;e=a,i=n[t=t],(t=P(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach(function(t){Object.defineProperty(a,t,Object.getOwnPropertyDescriptor(n,t))})}return a}function D(t){return(D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function j(t,e){for(var i=0;i<e.length;i++){var a=e[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,P(a.key),a)}}function A(t){return function(t){if(Array.isArray(t))return a(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){var i;if(t)return"string"==typeof t?a(t,e):"Map"===(i="Object"===(i=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:i)||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?a(t,e):void 0}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,a=new Array(e);i<e;i++)a[i]=t[i];return a}function P(t){t=function(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0===i)return("string"===e?String:Number)(t);if("object"!=typeof(i=i.call(t,e||"default")))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}(t,"string");return"symbol"==typeof t?t:String(t)}var t="undefined"!=typeof window&&void 0!==window.document,h=t?window:{},e=!(!t||!h.document.documentElement)&&"ontouchstart"in h.document.documentElement,i=t&&"PointerEvent"in h,c="cropper",I="all",U="crop",q="move",$="zoom",B="e",k="w",O="s",T="n",E="ne",W="nw",H="se",N="sw",Q="".concat(c,"-crop"),K="".concat(c,"-disabled"),L="".concat(c,"-hidden"),Z="".concat(c,"-hide"),G="".concat(c,"-invisible"),n="".concat(c,"-modal"),V="".concat(c,"-move"),d="".concat(c,"Action"),m="".concat(c,"Preview"),F="crop",J="move",_="none",tt="crop",et="cropend",it="cropmove",at="cropstart",nt="dblclick",ot=i?"pointerdown":e?"touchstart":"mousedown",ht=i?"pointermove":e?"touchmove":"mousemove",rt=i?"pointerup pointercancel":e?"touchend touchcancel":"mouseup",st="zoom",ct="image/jpeg",dt=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,lt=/^data:/,pt=/^data:image\/jpeg;base64,/,mt=/^img|canvas$/i,ut={viewMode:0,dragMode:F,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:200,minContainerHeight:100,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},gt=Number.isNaN||h.isNaN;function p(t){return"number"==typeof t&&!gt(t)}function ft(t){return 0<t&&t<1/0}function vt(t){return void 0===t}function o(t){return"object"===D(t)&&null!==t}var wt=Object.prototype.hasOwnProperty;function u(t){if(!o(t))return!1;try{var e=t.constructor,i=e.prototype;return e&&i&&wt.call(i,"isPrototypeOf")}catch(t){return!1}}function l(t){return"function"==typeof t}var bt=Array.prototype.slice;function yt(t){return Array.from?Array.from(t):bt.call(t)}function z(i,a){return i&&l(a)&&(Array.isArray(i)||p(i.length)?yt(i).forEach(function(t,e){a.call(i,t,e,i)}):o(i)&&Object.keys(i).forEach(function(t){a.call(i,i[t],t,i)})),i}var g=Object.assign||function(i){for(var t=arguments.length,e=new Array(1<t?t-1:0),a=1;a<t;a++)e[a-1]=arguments[a];return o(i)&&0<e.length&&e.forEach(function(e){o(e)&&Object.keys(e).forEach(function(t){i[t]=e[t]})}),i},xt=/\.\d*(?:0|9){12}\d*$/;function Y(t,e){e=1<arguments.length&&void 0!==e?e:1e11;return xt.test(t)?Math.round(t*e)/e:t}var Mt=/^width|height|left|top|marginLeft|marginTop$/;function f(t,e){var i=t.style;z(e,function(t,e){Mt.test(e)&&p(t)&&(t="".concat(t,"px")),i[e]=t})}function v(t,e){var i;e&&(p(t.length)?z(t,function(t){v(t,e)}):t.classList?t.classList.add(e):(i=t.className.trim())?i.indexOf(e)<0&&(t.className="".concat(i," ").concat(e)):t.className=e)}function X(t,e){e&&(p(t.length)?z(t,function(t){X(t,e)}):t.classList?t.classList.remove(e):0<=t.className.indexOf(e)&&(t.className=t.className.replace(e,"")))}function r(t,e,i){e&&(p(t.length)?z(t,function(t){r(t,e,i)}):(i?v:X)(t,e))}var Ct=/([a-z\d])([A-Z])/g;function Dt(t){return t.replace(Ct,"$1-$2").toLowerCase()}function Bt(t,e){return o(t[e])?t[e]:t.dataset?t.dataset[e]:t.getAttribute("data-".concat(Dt(e)))}function w(t,e,i){o(i)?t[e]=i:t.dataset?t.dataset[e]=i:t.setAttribute("data-".concat(Dt(e)),i)}var kt,Ot,Tt=/\s\s*/,Et=(Ot=!1,t&&(kt=!1,i=function(){},e=Object.defineProperty({},"once",{get:function(){return Ot=!0,kt},set:function(t){kt=t}}),h.addEventListener("test",i,e),h.removeEventListener("test",i,e)),Ot);function s(i,t,a,e){var n=3<arguments.length&&void 0!==e?e:{},o=a;t.trim().split(Tt).forEach(function(t){var e;Et||(e=i.listeners)&&e[t]&&e[t][a]&&(o=e[t][a],delete e[t][a],0===Object.keys(e[t]).length&&delete e[t],0===Object.keys(e).length)&&delete i.listeners,i.removeEventListener(t,o,n)})}function b(o,t,h,e){var r=3<arguments.length&&void 0!==e?e:{},s=h;t.trim().split(Tt).forEach(function(a){var t,n;r.once&&!Et&&(t=o.listeners,s=function(){delete n[a][h],o.removeEventListener(a,s,r);for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];h.apply(o,e)},(n=void 0===t?{}:t)[a]||(n[a]={}),n[a][h]&&o.removeEventListener(a,n[a][h],r),n[a][h]=s,o.listeners=n),o.addEventListener(a,s,r)})}function y(t,e,i){var a;return l(Event)&&l(CustomEvent)?a=new CustomEvent(e,{detail:i,bubbles:!0,cancelable:!0}):(a=document.createEvent("CustomEvent")).initCustomEvent(e,!0,!0,i),t.dispatchEvent(a)}function Wt(t){t=t.getBoundingClientRect();return{left:t.left+(window.pageXOffset-document.documentElement.clientLeft),top:t.top+(window.pageYOffset-document.documentElement.clientTop)}}var Ht=h.location,Nt=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function Lt(t){t=t.match(Nt);return null!==t&&(t[1]!==Ht.protocol||t[2]!==Ht.hostname||t[3]!==Ht.port)}function zt(t){var e="timestamp=".concat((new Date).getTime());return t+(-1===t.indexOf("?")?"?":"&")+e}function x(t){var e=t.rotate,i=t.scaleX,a=t.scaleY,n=t.translateX,t=t.translateY,o=[],n=(p(n)&&0!==n&&o.push("translateX(".concat(n,"px)")),p(t)&&0!==t&&o.push("translateY(".concat(t,"px)")),p(e)&&0!==e&&o.push("rotate(".concat(e,"deg)")),p(i)&&1!==i&&o.push("scaleX(".concat(i,")")),p(a)&&1!==a&&o.push("scaleY(".concat(a,")")),o.length?o.join(" "):"none");return{WebkitTransform:n,msTransform:n,transform:n}}function M(t,e){var i=t.pageX,t=t.pageY,a={endX:i,endY:t};return e?a:S({startX:i,startY:t},a)}function R(t,e){var i,a=t.aspectRatio,n=t.height,t=t.width,e=1<arguments.length&&void 0!==e?e:"contain",o=ft(t),h=ft(n);return o&&h?(i=n*a,"contain"===e&&t<i||"cover"===e&&i<t?n=t/a:t=n*a):o?n=t/a:h&&(t=n*a),{width:t,height:n}}var Yt=String.fromCharCode;var Xt=/^data:.*,/;function Rt(t){var e,i,a,n,o,h,r,s=new DataView(t);try{if(255===s.getUint8(0)&&216===s.getUint8(1))for(var c=s.byteLength,d=2;d+1<c;){if(255===s.getUint8(d)&&225===s.getUint8(d+1)){i=d;break}d+=1}if(a=i&&(n=i+10,"Exif"===function(t,e,i){var a="";i+=e;for(var n=e;n<i;n+=1)a+=Yt(t.getUint8(n));return a}(s,i+4,4))&&((r=18761===(o=s.getUint16(n)))||19789===o)&&42===s.getUint16(n+2,r)&&8<=(h=s.getUint32(n+4,r))?n+h:a)for(var l,p=s.getUint16(a,r),m=0;m<p;m+=1)if(l=a+12*m+2,274===s.getUint16(l,r)){l+=8,e=s.getUint16(l,r),s.setUint16(l,1,r);break}}catch(t){e=1}return e}var t={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var t=this.element,e=this.options,i=this.container,a=this.cropper,n=Number(e.minContainerWidth),e=Number(e.minContainerHeight),n=(v(a,L),X(t,L),{width:Math.max(i.offsetWidth,0<=n?n:200),height:Math.max(i.offsetHeight,0<=e?e:100)});f(a,{width:(this.containerData=n).width,height:n.height}),v(t,L),X(a,L)},initCanvas:function(){var t=this.containerData,e=this.imageData,i=this.options.viewMode,a=Math.abs(e.rotate)%180==90,n=a?e.naturalHeight:e.naturalWidth,a=a?e.naturalWidth:e.naturalHeight,e=n/a,o=t.width,h=t.height,e=(t.height*e>t.width?3===i?o=t.height*e:h=t.width/e:3===i?h=t.width/e:o=t.height*e,{aspectRatio:e,naturalWidth:n,naturalHeight:a,width:o,height:h});this.canvasData=e,this.limited=1===i||2===i,this.limitCanvas(!0,!0),e.width=Math.min(Math.max(e.width,e.minWidth),e.maxWidth),e.height=Math.min(Math.max(e.height,e.minHeight),e.maxHeight),e.left=(t.width-e.width)/2,e.top=(t.height-e.height)/2,e.oldLeft=e.left,e.oldTop=e.top,this.initialCanvasData=g({},e)},limitCanvas:function(t,e){var i=this.options,a=this.containerData,n=this.canvasData,o=this.cropBoxData,h=i.viewMode,r=n.aspectRatio,s=this.cropped&&o;t&&(t=Number(i.minCanvasWidth)||0,i=Number(i.minCanvasHeight)||0,1<h?(t=Math.max(t,a.width),i=Math.max(i,a.height),3===h&&(t<i*r?t=i*r:i=t/r)):0<h&&(t?t=Math.max(t,s?o.width:0):i?i=Math.max(i,s?o.height:0):s&&((t=o.width)<(i=o.height)*r?t=i*r:i=t/r)),t=(r=R({aspectRatio:r,width:t,height:i})).width,i=r.height,n.minWidth=t,n.minHeight=i,n.maxWidth=1/0,n.maxHeight=1/0),e&&((s?0:1)<h?(r=a.width-n.width,t=a.height-n.height,n.minLeft=Math.min(0,r),n.minTop=Math.min(0,t),n.maxLeft=Math.max(0,r),n.maxTop=Math.max(0,t),s&&this.limited&&(n.minLeft=Math.min(o.left,o.left+(o.width-n.width)),n.minTop=Math.min(o.top,o.top+(o.height-n.height)),n.maxLeft=o.left,n.maxTop=o.top,2===h)&&(n.width>=a.width&&(n.minLeft=Math.min(0,r),n.maxLeft=Math.max(0,r)),n.height>=a.height)&&(n.minTop=Math.min(0,t),n.maxTop=Math.max(0,t))):(n.minLeft=-n.width,n.minTop=-n.height,n.maxLeft=a.width,n.maxTop=a.height))},renderCanvas:function(t,e){var i,a,n,o,h=this.canvasData,r=this.imageData;e&&(e={width:r.naturalWidth*Math.abs(r.scaleX||1),height:r.naturalHeight*Math.abs(r.scaleY||1),degree:r.rotate||0},r=e.width,o=e.height,e=e.degree,i=90==(e=Math.abs(e)%180)?{width:o,height:r}:(a=e%90*Math.PI/180,i=Math.sin(a),n=r*(a=Math.cos(a))+o*i,r=r*i+o*a,90<e?{width:r,height:n}:{width:n,height:r}),a=h.width*((o=i.width)/h.naturalWidth),n=h.height*((e=i.height)/h.naturalHeight),h.left-=(a-h.width)/2,h.top-=(n-h.height)/2,h.width=a,h.height=n,h.aspectRatio=o/e,h.naturalWidth=o,h.naturalHeight=e,this.limitCanvas(!0,!1)),(h.width>h.maxWidth||h.width<h.minWidth)&&(h.left=h.oldLeft),(h.height>h.maxHeight||h.height<h.minHeight)&&(h.top=h.oldTop),h.width=Math.min(Math.max(h.width,h.minWidth),h.maxWidth),h.height=Math.min(Math.max(h.height,h.minHeight),h.maxHeight),this.limitCanvas(!1,!0),h.left=Math.min(Math.max(h.left,h.minLeft),h.maxLeft),h.top=Math.min(Math.max(h.top,h.minTop),h.maxTop),h.oldLeft=h.left,h.oldTop=h.top,f(this.canvas,g({width:h.width,height:h.height},x({translateX:h.left,translateY:h.top}))),this.renderImage(t),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(t){var e=this.canvasData,i=this.imageData,a=i.naturalWidth*(e.width/e.naturalWidth),n=i.naturalHeight*(e.height/e.naturalHeight);g(i,{width:a,height:n,left:(e.width-a)/2,top:(e.height-n)/2}),f(this.image,g({width:i.width,height:i.height},x(g({translateX:i.left,translateY:i.top},i)))),t&&this.output()},initCropBox:function(){var t=this.options,e=this.canvasData,i=t.aspectRatio||t.initialAspectRatio,t=Number(t.autoCropArea)||.8,a={width:e.width,height:e.height};i&&(e.height*i>e.width?a.height=a.width/i:a.width=a.height*i),this.cropBoxData=a,this.limitCropBox(!0,!0),a.width=Math.min(Math.max(a.width,a.minWidth),a.maxWidth),a.height=Math.min(Math.max(a.height,a.minHeight),a.maxHeight),a.width=Math.max(a.minWidth,a.width*t),a.height=Math.max(a.minHeight,a.height*t),a.left=e.left+(e.width-a.width)/2,a.top=e.top+(e.height-a.height)/2,a.oldLeft=a.left,a.oldTop=a.top,this.initialCropBoxData=g({},a)},limitCropBox:function(t,e){var i,a,n=this.options,o=this.containerData,h=this.canvasData,r=this.cropBoxData,s=this.limited,c=n.aspectRatio;t&&(t=Number(n.minCropBoxWidth)||0,n=Number(n.minCropBoxHeight)||0,i=s?Math.min(o.width,h.width,h.width+h.left,o.width-h.left):o.width,a=s?Math.min(o.height,h.height,h.height+h.top,o.height-h.top):o.height,t=Math.min(t,o.width),n=Math.min(n,o.height),c&&(t&&n?t<n*c?n=t/c:t=n*c:t?n=t/c:n&&(t=n*c),i<a*c?a=i/c:i=a*c),r.minWidth=Math.min(t,i),r.minHeight=Math.min(n,a),r.maxWidth=i,r.maxHeight=a),e&&(s?(r.minLeft=Math.max(0,h.left),r.minTop=Math.max(0,h.top),r.maxLeft=Math.min(o.width,h.left+h.width)-r.width,r.maxTop=Math.min(o.height,h.top+h.height)-r.height):(r.minLeft=0,r.minTop=0,r.maxLeft=o.width-r.width,r.maxTop=o.height-r.height))},renderCropBox:function(){var t=this.options,e=this.containerData,i=this.cropBoxData;(i.width>i.maxWidth||i.width<i.minWidth)&&(i.left=i.oldLeft),(i.height>i.maxHeight||i.height<i.minHeight)&&(i.top=i.oldTop),i.width=Math.min(Math.max(i.width,i.minWidth),i.maxWidth),i.height=Math.min(Math.max(i.height,i.minHeight),i.maxHeight),this.limitCropBox(!1,!0),i.left=Math.min(Math.max(i.left,i.minLeft),i.maxLeft),i.top=Math.min(Math.max(i.top,i.minTop),i.maxTop),i.oldLeft=i.left,i.oldTop=i.top,t.movable&&t.cropBoxMovable&&w(this.face,d,i.width>=e.width&&i.height>=e.height?q:I),f(this.cropBox,g({width:i.width,height:i.height},x({translateX:i.left,translateY:i.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),y(this.element,tt,this.getData())}},i={initPreview:function(){var t=this.element,i=this.crossOrigin,e=this.options.preview,a=i?this.crossOriginUrl:this.url,n=t.alt||"The image to preview",o=document.createElement("img");i&&(o.crossOrigin=i),o.src=a,o.alt=n,this.viewBox.appendChild(o),this.viewBoxImage=o,e&&("string"==typeof(o=e)?o=t.ownerDocument.querySelectorAll(e):e.querySelector&&(o=[e]),z(this.previews=o,function(t){var e=document.createElement("img");w(t,m,{width:t.offsetWidth,height:t.offsetHeight,html:t.innerHTML}),i&&(e.crossOrigin=i),e.src=a,e.alt=n,e.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',t.innerHTML="",t.appendChild(e)}))},resetPreview:function(){z(this.previews,function(e){var i=Bt(e,m),i=(f(e,{width:i.width,height:i.height}),e.innerHTML=i.html,e),e=m;if(o(i[e]))try{delete i[e]}catch(t){i[e]=void 0}else if(i.dataset)try{delete i.dataset[e]}catch(t){i.dataset[e]=void 0}else i.removeAttribute("data-".concat(Dt(e)))})},preview:function(){var h=this.imageData,t=this.canvasData,e=this.cropBoxData,r=e.width,s=e.height,c=h.width,d=h.height,l=e.left-t.left-h.left,p=e.top-t.top-h.top;this.cropped&&!this.disabled&&(f(this.viewBoxImage,g({width:c,height:d},x(g({translateX:-l,translateY:-p},h)))),z(this.previews,function(t){var e=Bt(t,m),i=e.width,e=e.height,a=i,n=e,o=1;r&&(n=s*(o=i/r)),s&&e<n&&(a=r*(o=e/s),n=e),f(t,{width:a,height:n}),f(t.getElementsByTagName("img")[0],g({width:c*o,height:d*o},x(g({translateX:-l*o,translateY:-p*o},h))))}))}},e={bind:function(){var t=this.element,e=this.options,i=this.cropper;l(e.cropstart)&&b(t,at,e.cropstart),l(e.cropmove)&&b(t,it,e.cropmove),l(e.cropend)&&b(t,et,e.cropend),l(e.crop)&&b(t,tt,e.crop),l(e.zoom)&&b(t,st,e.zoom),b(i,ot,this.onCropStart=this.cropStart.bind(this)),e.zoomable&&e.zoomOnWheel&&b(i,"wheel",this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&b(i,nt,this.onDblclick=this.dblclick.bind(this)),b(t.ownerDocument,ht,this.onCropMove=this.cropMove.bind(this)),b(t.ownerDocument,rt,this.onCropEnd=this.cropEnd.bind(this)),e.responsive&&b(window,"resize",this.onResize=this.resize.bind(this))},unbind:function(){var t=this.element,e=this.options,i=this.cropper;l(e.cropstart)&&s(t,at,e.cropstart),l(e.cropmove)&&s(t,it,e.cropmove),l(e.cropend)&&s(t,et,e.cropend),l(e.crop)&&s(t,tt,e.crop),l(e.zoom)&&s(t,st,e.zoom),s(i,ot,this.onCropStart),e.zoomable&&e.zoomOnWheel&&s(i,"wheel",this.onWheel,{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&s(i,nt,this.onDblclick),s(t.ownerDocument,ht,this.onCropMove),s(t.ownerDocument,rt,this.onCropEnd),e.responsive&&s(window,"resize",this.onResize)}},St={resize:function(){var t,e,i,a,n,o,h;this.disabled||(t=this.options,a=this.container,e=this.containerData,i=a.offsetWidth/e.width,a=a.offsetHeight/e.height,1!=(n=Math.abs(i-1)>Math.abs(a-1)?i:a)&&(t.restore&&(o=this.getCanvasData(),h=this.getCropBoxData()),this.render(),t.restore)&&(this.setCanvasData(z(o,function(t,e){o[e]=t*n})),this.setCropBoxData(z(h,function(t,e){h[e]=t*n}))))},dblclick:function(){var t,e;this.disabled||this.options.dragMode===_||this.setDragMode((t=this.dragBox,e=Q,(t.classList?t.classList.contains(e):-1<t.className.indexOf(e))?J:F))},wheel:function(t){var e=this,i=Number(this.options.wheelZoomRatio)||.1,a=1;this.disabled||(t.preventDefault(),this.wheeling)||(this.wheeling=!0,setTimeout(function(){e.wheeling=!1},50),t.deltaY?a=0<t.deltaY?1:-1:t.wheelDelta?a=-t.wheelDelta/120:t.detail&&(a=0<t.detail?1:-1),this.zoom(-a*i,t))},cropStart:function(t){var e,i=t.buttons,a=t.button;this.disabled||("mousedown"===t.type||"pointerdown"===t.type&&"mouse"===t.pointerType)&&(p(i)&&1!==i||p(a)&&0!==a||t.ctrlKey)||(i=this.options,e=this.pointers,t.changedTouches?z(t.changedTouches,function(t){e[t.identifier]=M(t)}):e[t.pointerId||0]=M(t),a=1<Object.keys(e).length&&i.zoomable&&i.zoomOnTouch?$:Bt(t.target,d),dt.test(a)&&!1!==y(this.element,at,{originalEvent:t,action:a})&&(t.preventDefault(),this.action=a,this.cropping=!1,a===U)&&(this.cropping=!0,v(this.dragBox,n)))},cropMove:function(t){var e,i=this.action;!this.disabled&&i&&(e=this.pointers,t.preventDefault(),!1!==y(this.element,it,{originalEvent:t,action:i}))&&(t.changedTouches?z(t.changedTouches,function(t){g(e[t.identifier]||{},M(t,!0))}):g(e[t.pointerId||0]||{},M(t,!0)),this.change(t))},cropEnd:function(t){var e,i;this.disabled||(e=this.action,i=this.pointers,t.changedTouches?z(t.changedTouches,function(t){delete i[t.identifier]}):delete i[t.pointerId||0],e&&(t.preventDefault(),Object.keys(i).length||(this.action=""),this.cropping&&(this.cropping=!1,r(this.dragBox,n,this.cropped&&this.options.modal)),y(this.element,et,{originalEvent:t,action:e})))}},jt={change:function(t){function e(t){switch(t){case B:f+D.x>y&&(D.x=y-f);break;case k:p+D.x<w&&(D.x=w-p);break;case T:m+D.y<b&&(D.y=b-m);break;case O:v+D.y>x&&(D.y=x-v)}}var i,a,o,n=this.options,h=this.canvasData,r=this.containerData,s=this.cropBoxData,c=this.pointers,d=this.action,l=n.aspectRatio,p=s.left,m=s.top,u=s.width,g=s.height,f=p+u,v=m+g,w=0,b=0,y=r.width,x=r.height,M=!0,C=(!l&&t.shiftKey&&(l=u&&g?u/g:1),this.limited&&(w=s.minLeft,b=s.minTop,y=w+Math.min(r.width,h.width,h.left+h.width),x=b+Math.min(r.height,h.height,h.top+h.height)),c[Object.keys(c)[0]]),D={x:C.endX-C.startX,y:C.endY-C.startY};switch(d){case I:p+=D.x,m+=D.y;break;case B:0<=D.x&&(y<=f||l&&(m<=b||x<=v))?M=!1:(e(B),(u+=D.x)<0&&(d=k,p-=u=-u),l&&(m+=(s.height-(g=u/l))/2));break;case T:D.y<=0&&(m<=b||l&&(p<=w||y<=f))?M=!1:(e(T),g-=D.y,m+=D.y,g<0&&(d=O,m-=g=-g),l&&(p+=(s.width-(u=g*l))/2));break;case k:D.x<=0&&(p<=w||l&&(m<=b||x<=v))?M=!1:(e(k),u-=D.x,p+=D.x,u<0&&(d=B,p-=u=-u),l&&(m+=(s.height-(g=u/l))/2));break;case O:0<=D.y&&(x<=v||l&&(p<=w||y<=f))?M=!1:(e(O),(g+=D.y)<0&&(d=T,m-=g=-g),l&&(p+=(s.width-(u=g*l))/2));break;case E:if(l){if(D.y<=0&&(m<=b||y<=f)){M=!1;break}e(T),g-=D.y,m+=D.y,u=g*l}else e(T),e(B),!(0<=D.x)||f<y?u+=D.x:D.y<=0&&m<=b&&(M=!1),(!(D.y<=0)||b<m)&&(g-=D.y,m+=D.y);u<0&&g<0?(d=N,m-=g=-g,p-=u=-u):u<0?(d=W,p-=u=-u):g<0&&(d=H,m-=g=-g);break;case W:if(l){if(D.y<=0&&(m<=b||p<=w)){M=!1;break}e(T),g-=D.y,m+=D.y,p+=s.width-(u=g*l)}else e(T),e(k),!(D.x<=0)||w<p?(u-=D.x,p+=D.x):D.y<=0&&m<=b&&(M=!1),(!(D.y<=0)||b<m)&&(g-=D.y,m+=D.y);u<0&&g<0?(d=H,m-=g=-g,p-=u=-u):u<0?(d=E,p-=u=-u):g<0&&(d=N,m-=g=-g);break;case N:if(l){if(D.x<=0&&(p<=w||x<=v)){M=!1;break}e(k),u-=D.x,p+=D.x,g=u/l}else e(O),e(k),!(D.x<=0)||w<p?(u-=D.x,p+=D.x):0<=D.y&&x<=v&&(M=!1),(!(0<=D.y)||v<x)&&(g+=D.y);u<0&&g<0?(d=E,m-=g=-g,p-=u=-u):u<0?(d=H,p-=u=-u):g<0&&(d=W,m-=g=-g);break;case H:if(l){if(0<=D.x&&(y<=f||x<=v)){M=!1;break}e(B),g=(u+=D.x)/l}else e(O),e(B),!(0<=D.x)||f<y?u+=D.x:0<=D.y&&x<=v&&(M=!1),(!(0<=D.y)||v<x)&&(g+=D.y);u<0&&g<0?(d=W,m-=g=-g,p-=u=-u):u<0?(d=N,p-=u=-u):g<0&&(d=E,m-=g=-g);break;case q:this.move(D.x,D.y),M=!1;break;case $:this.zoom((a=S({},i=c),o=0,z(i,function(n,t){delete a[t],z(a,function(t){var e=Math.abs(n.startX-t.startX),i=Math.abs(n.startY-t.startY),a=Math.abs(n.endX-t.endX),t=Math.abs(n.endY-t.endY),e=Math.sqrt(e*e+i*i),i=(Math.sqrt(a*a+t*t)-e)/e;Math.abs(i)>Math.abs(o)&&(o=i)})}),o),t),M=!1;break;case U:D.x&&D.y?(i=Wt(this.cropper),p=C.startX-i.left,m=C.startY-i.top,u=s.minWidth,g=s.minHeight,0<D.x?d=0<D.y?H:E:D.x<0&&(p-=u,d=0<D.y?N:W),D.y<0&&(m-=g),this.cropped||(X(this.cropBox,L),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0))):M=!1}M&&(s.width=u,s.height=g,s.left=p,s.top=m,this.action=d,this.renderCropBox()),z(c,function(t){t.startX=t.endX,t.startY=t.endY})}},At={crop:function(){return!this.ready||this.cropped||this.disabled||(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&v(this.dragBox,n),X(this.cropBox,L),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=g({},this.initialImageData),this.canvasData=g({},this.initialCanvasData),this.cropBoxData=g({},this.initialCropBoxData),this.renderCanvas(),this.cropped)&&this.renderCropBox(),this},clear:function(){return this.cropped&&!this.disabled&&(g(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),X(this.dragBox,n),v(this.cropBox,L)),this},replace:function(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1];return!this.disabled&&e&&(this.isImg&&(this.element.src=e),t?(this.url=e,this.image.src=e,this.ready&&(this.viewBoxImage.src=e,z(this.previews,function(t){t.getElementsByTagName("img")[0].src=e}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(e))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,X(this.cropper,K)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,v(this.cropper,K)),this},destroy:function(){var t=this.element;return t[c]&&(t[c]=void 0,this.isImg&&this.replaced&&(t.src=this.originalUrl),this.uncreate()),this},move:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:t,i=this.canvasData,a=i.left,i=i.top;return this.moveTo(vt(t)?t:a+Number(t),vt(e)?e:i+Number(e))},moveTo:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:t,i=this.canvasData,a=!1;return t=Number(t),e=Number(e),this.ready&&!this.disabled&&this.options.movable&&(p(t)&&(i.left=t,a=!0),p(e)&&(i.top=e,a=!0),a)&&this.renderCanvas(!0),this},zoom:function(t,e){var i=this.canvasData;return t=Number(t),this.zoomTo(i.width*(t=t<0?1/(1-t):1+t)/i.naturalWidth,null,e)},zoomTo:function(t,e,i){var a,n,o,h=this.options,r=this.canvasData,s=r.width,c=r.height,d=r.naturalWidth,l=r.naturalHeight;if(0<=(t=Number(t))&&this.ready&&!this.disabled&&h.zoomable){h=d*t,l=l*t;if(!1===y(this.element,st,{ratio:t,oldRatio:s/d,originalEvent:i}))return this;i?(t=this.pointers,d=Wt(this.cropper),t=t&&Object.keys(t).length?(o=n=a=0,z(t,function(t){var e=t.startX,t=t.startY;a+=e,n+=t,o+=1}),{pageX:a/=o,pageY:n/=o}):{pageX:i.pageX,pageY:i.pageY},r.left-=(h-s)*((t.pageX-d.left-r.left)/s),r.top-=(l-c)*((t.pageY-d.top-r.top)/c)):u(e)&&p(e.x)&&p(e.y)?(r.left-=(h-s)*((e.x-r.left)/s),r.top-=(l-c)*((e.y-r.top)/c)):(r.left-=(h-s)/2,r.top-=(l-c)/2),r.width=h,r.height=l,this.renderCanvas(!0)}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t))},rotateTo:function(t){return p(t=Number(t))&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=t%360,this.renderCanvas(!0,!0)),this},scaleX:function(t){var e=this.imageData.scaleY;return this.scale(t,p(e)?e:1)},scaleY:function(t){var e=this.imageData.scaleX;return this.scale(p(e)?e:1,t)},scale:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:t,i=this.imageData,a=!1;return t=Number(t),e=Number(e),this.ready&&!this.disabled&&this.options.scalable&&(p(t)&&(i.scaleX=t,a=!0),p(e)&&(i.scaleY=e,a=!0),a)&&this.renderCanvas(!0,!0),this},getData:function(){var i,a,t=0<arguments.length&&void 0!==arguments[0]&&arguments[0],e=this.options,n=this.imageData,o=this.canvasData,h=this.cropBoxData;return this.ready&&this.cropped?(i={x:h.left-o.left,y:h.top-o.top,width:h.width,height:h.height},a=n.width/n.naturalWidth,z(i,function(t,e){i[e]=t/a}),t&&(o=Math.round(i.y+i.height),h=Math.round(i.x+i.width),i.x=Math.round(i.x),i.y=Math.round(i.y),i.width=h-i.x,i.height=o-i.y)):i={x:0,y:0,width:0,height:0},e.rotatable&&(i.rotate=n.rotate||0),e.scalable&&(i.scaleX=n.scaleX||1,i.scaleY=n.scaleY||1),i},setData:function(t){var e,i=this.options,a=this.imageData,n=this.canvasData,o={};return this.ready&&!this.disabled&&u(t)&&(e=!1,i.rotatable&&p(t.rotate)&&t.rotate!==a.rotate&&(a.rotate=t.rotate,e=!0),i.scalable&&(p(t.scaleX)&&t.scaleX!==a.scaleX&&(a.scaleX=t.scaleX,e=!0),p(t.scaleY))&&t.scaleY!==a.scaleY&&(a.scaleY=t.scaleY,e=!0),e&&this.renderCanvas(!0,!0),i=a.width/a.naturalWidth,p(t.x)&&(o.left=t.x*i+n.left),p(t.y)&&(o.top=t.y*i+n.top),p(t.width)&&(o.width=t.width*i),p(t.height)&&(o.height=t.height*i),this.setCropBoxData(o)),this},getContainerData:function(){return this.ready?g({},this.containerData):{}},getImageData:function(){return this.sized?g({},this.imageData):{}},getCanvasData:function(){var e=this.canvasData,i={};return this.ready&&z(["left","top","width","height","naturalWidth","naturalHeight"],function(t){i[t]=e[t]}),i},setCanvasData:function(t){var e=this.canvasData,i=e.aspectRatio;return this.ready&&!this.disabled&&u(t)&&(p(t.left)&&(e.left=t.left),p(t.top)&&(e.top=t.top),p(t.width)?(e.width=t.width,e.height=t.width/i):p(t.height)&&(e.height=t.height,e.width=t.height*i),this.renderCanvas(!0)),this},getCropBoxData:function(){var t,e=this.cropBoxData;return(t=this.ready&&this.cropped?{left:e.left,top:e.top,width:e.width,height:e.height}:t)||{}},setCropBoxData:function(t){var e,i,a=this.cropBoxData,n=this.options.aspectRatio;return this.ready&&this.cropped&&!this.disabled&&u(t)&&(p(t.left)&&(a.left=t.left),p(t.top)&&(a.top=t.top),p(t.width)&&t.width!==a.width&&(e=!0,a.width=t.width),p(t.height)&&t.height!==a.height&&(i=!0,a.height=t.height),n&&(e?a.height=a.width/n:i&&(a.width=a.height*n)),this.renderCropBox()),this},getCroppedCanvas:function(){var t,e,i,a,n,o,h,r,s,c,d,l,p,m,u,g,f,v,w,b,y,x,M,C,D,B,k,O=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return this.ready&&window.HTMLCanvasElement?(B=this.canvasData,u=this.image,l=this.imageData,a=B,v=O,g=l.aspectRatio,e=l.naturalWidth,n=l.naturalHeight,c=void 0===(c=l.rotate)?0:c,d=void 0===(d=l.scaleX)?1:d,l=void 0===(l=l.scaleY)?1:l,i=a.aspectRatio,r=a.naturalWidth,a=a.naturalHeight,h=void 0===(h=v.fillColor)?"transparent":h,p=void 0===(p=v.imageSmoothingEnabled)||p,m=void 0===(m=v.imageSmoothingQuality)?"low":m,o=void 0===(o=v.maxWidth)?1/0:o,k=void 0===(k=v.maxHeight)?1/0:k,t=void 0===(t=v.minWidth)?0:t,v=void 0===(v=v.minHeight)?0:v,w=document.createElement("canvas"),f=w.getContext("2d"),s=R({aspectRatio:i,width:o,height:k}),i=R({aspectRatio:i,width:t,height:v},"cover"),r=Math.min(s.width,Math.max(i.width,r)),s=Math.min(s.height,Math.max(i.height,a)),i=R({aspectRatio:g,width:o,height:k}),a=R({aspectRatio:g,width:t,height:v},"cover"),o=Math.min(i.width,Math.max(a.width,e)),k=Math.min(i.height,Math.max(a.height,n)),g=[-o/2,-k/2,o,k],w.width=Y(r),w.height=Y(s),f.fillStyle=h,f.fillRect(0,0,r,s),f.save(),f.translate(r/2,s/2),f.rotate(c*Math.PI/180),f.scale(d,l),f.imageSmoothingEnabled=p,f.imageSmoothingQuality=m,f.drawImage.apply(f,[u].concat(A(g.map(function(t){return Math.floor(Y(t))})))),f.restore(),t=w,this.cropped?(e=(v=this.getData(O.rounded)).x,i=v.y,a=v.width,n=v.height,1!=(o=t.width/Math.floor(B.naturalWidth))&&(e*=o,i*=o,a*=o,n*=o),h=R({aspectRatio:k=a/n,width:O.maxWidth||1/0,height:O.maxHeight||1/0}),r=R({aspectRatio:k,width:O.minWidth||0,height:O.minHeight||0},"cover"),c=(s=R({aspectRatio:k,width:O.width||(1!=o?t.width:a),height:O.height||(1!=o?t.height:n)})).width,d=s.height,c=Math.min(h.width,Math.max(r.width,c)),d=Math.min(h.height,Math.max(r.height,d)),p=(l=document.createElement("canvas")).getContext("2d"),l.width=Y(c),l.height=Y(d),p.fillStyle=O.fillColor||"transparent",p.fillRect(0,0,c,d),m=O.imageSmoothingEnabled,u=O.imageSmoothingQuality,p.imageSmoothingEnabled=void 0===m||m,u&&(p.imageSmoothingQuality=u),g=t.width,f=t.height,w=i,(v=e)<=-a||g<v?C=x=b=v=0:v<=0?(x=-v,v=0,C=b=Math.min(g,a+v)):v<=g&&(x=0,C=b=Math.min(a,g-v)),b<=0||w<=-n||f<w?D=M=y=w=0:w<=0?(M=-w,w=0,D=y=Math.min(f,n+w)):w<=f&&(M=0,D=y=Math.min(n,f-w)),B=[v,w,b,y],0<C&&0<D&&B.push(x*(k=c/a),M*k,C*k,D*k),p.drawImage.apply(p,[t].concat(A(B.map(function(t){return Math.floor(Y(t))})))),l):t):null},setAspectRatio:function(t){var e=this.options;return this.disabled||vt(t)||(e.aspectRatio=Math.max(0,t)||NaN,this.ready&&(this.initCropBox(),this.cropped)&&this.renderCropBox()),this},setDragMode:function(t){var e,i,a=this.options,n=this.dragBox,o=this.face;return this.ready&&!this.disabled&&(i=a.movable&&t===J,a.dragMode=t=(e=t===F)||i?t:_,w(n,d,t),r(n,Q,e),r(n,V,i),a.cropBoxMovable||(w(o,d,t),r(o,Q,e),r(o,V,i))),this}},Pt=h.Cropper,It=function(){function n(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},i=this,a=n;if(!(i instanceof a))throw new TypeError("Cannot call a class as a function");if(!t||!mt.test(t.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=t,this.options=g({},ut,u(e)&&e),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}var t,e,i;return t=n,i=[{key:"noConflict",value:function(){return window.Cropper=Pt,n}},{key:"setDefaults",value:function(t){g(ut,u(t)&&t)}}],(e=[{key:"init",value:function(){var t,e=this.element,i=e.tagName.toLowerCase();if(!e[c]){if(e[c]=this,"img"===i){if(this.isImg=!0,t=e.getAttribute("src")||"",!(this.originalUrl=t))return;t=e.src}else"canvas"===i&&window.HTMLCanvasElement&&(t=e.toDataURL());this.load(t)}}},{key:"load",value:function(t){var e,i,a,n,o,h,r=this;t&&(this.url=t,this.imageData={},e=this.element,(i=this.options).rotatable||i.scalable||(i.checkOrientation=!1),i.checkOrientation&&window.ArrayBuffer?lt.test(t)?pt.test(t)?this.read((h=(h=t).replace(Xt,""),a=atob(h),h=new ArrayBuffer(a.length),z(n=new Uint8Array(h),function(t,e){n[e]=a.charCodeAt(e)}),h)):this.clone():(o=new XMLHttpRequest,h=this.clone.bind(this),this.reloading=!0,(this.xhr=o).onabort=h,o.onerror=h,o.ontimeout=h,o.onprogress=function(){o.getResponseHeader("content-type")!==ct&&o.abort()},o.onload=function(){r.read(o.response)},o.onloadend=function(){r.reloading=!1,r.xhr=null},i.checkCrossOrigin&&Lt(t)&&e.crossOrigin&&(t=zt(t)),o.open("GET",t,!0),o.responseType="arraybuffer",o.withCredentials="use-credentials"===e.crossOrigin,o.send()):this.clone())}},{key:"read",value:function(t){var e=this.options,i=this.imageData,a=Rt(t),n=0,o=1,h=1;1<a&&(this.url=function(t,e){for(var i=[],a=new Uint8Array(t);0<a.length;)i.push(Yt.apply(null,yt(a.subarray(0,8192)))),a=a.subarray(8192);return"data:".concat(e,";base64,").concat(btoa(i.join("")))}(t,ct),n=(t=function(t){var e=0,i=1,a=1;switch(t){case 2:i=-1;break;case 3:e=-180;break;case 4:a=-1;break;case 5:e=90,a=-1;break;case 6:e=90;break;case 7:e=90,i=-1;break;case 8:e=-90}return{rotate:e,scaleX:i,scaleY:a}}(a)).rotate,o=t.scaleX,h=t.scaleY),e.rotatable&&(i.rotate=n),e.scalable&&(i.scaleX=o,i.scaleY=h),this.clone()}},{key:"clone",value:function(){var t=this.element,e=this.url,i=t.crossOrigin,a=e,n=(this.options.checkCrossOrigin&&Lt(e)&&(i=i||"anonymous",a=zt(e)),this.crossOrigin=i,this.crossOriginUrl=a,document.createElement("img"));i&&(n.crossOrigin=i),n.src=a||e,n.alt=t.alt||"The image to crop",(this.image=n).onload=this.start.bind(this),n.onerror=this.stop.bind(this),v(n,Z),t.parentNode.insertBefore(n,t.nextSibling)}},{key:"start",value:function(){function t(t,e){g(a.imageData,{naturalWidth:t,naturalHeight:e,aspectRatio:t/e}),a.initialImageData=g({},a.imageData),a.sizing=!1,a.sized=!0,a.build()}var e,i,a=this,n=this.image,o=(n.onload=null,n.onerror=null,this.sizing=!0,h.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(h.navigator.userAgent));n.naturalWidth&&!o?t(n.naturalWidth,n.naturalHeight):(e=document.createElement("img"),i=document.body||document.documentElement,(this.sizingImage=e).onload=function(){t(e.width,e.height),o||i.removeChild(e)},e.src=n.src,o||(e.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",i.appendChild(e)))}},{key:"stop",value:function(){var t=this.image;t.onload=null,t.onerror=null,t.parentNode.removeChild(t),this.image=null}},{key:"build",value:function(){var t,e,i,a,n,o,h,r,s;this.sized&&!this.ready&&(t=this.element,e=this.options,i=this.image,a=t.parentNode,(n=document.createElement("div")).innerHTML='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>',o=(n=n.querySelector(".".concat(c,"-container"))).querySelector(".".concat(c,"-canvas")),h=n.querySelector(".".concat(c,"-drag-box")),s=(r=n.querySelector(".".concat(c,"-crop-box"))).querySelector(".".concat(c,"-face")),this.container=a,this.cropper=n,this.canvas=o,this.dragBox=h,this.cropBox=r,this.viewBox=n.querySelector(".".concat(c,"-view-box")),this.face=s,o.appendChild(i),v(t,L),a.insertBefore(n,t.nextSibling),X(i,Z),this.initPreview(),this.bind(),e.initialAspectRatio=Math.max(0,e.initialAspectRatio)||NaN,e.aspectRatio=Math.max(0,e.aspectRatio)||NaN,e.viewMode=Math.max(0,Math.min(3,Math.round(e.viewMode)))||0,v(r,L),e.guides||v(r.getElementsByClassName("".concat(c,"-dashed")),L),e.center||v(r.getElementsByClassName("".concat(c,"-center")),L),e.background&&v(n,"".concat(c,"-bg")),e.highlight||v(s,G),e.cropBoxMovable&&(v(s,V),w(s,d,I)),e.cropBoxResizable||(v(r.getElementsByClassName("".concat(c,"-line")),L),v(r.getElementsByClassName("".concat(c,"-point")),L)),this.render(),this.ready=!0,this.setDragMode(e.dragMode),e.autoCrop&&this.crop(),this.setData(e.data),l(e.ready)&&b(t,"ready",e.ready,{once:!0}),y(t,"ready"))}},{key:"unbuild",value:function(){var t;this.ready&&(this.ready=!1,this.unbind(),this.resetPreview(),(t=this.cropper.parentNode)&&t.removeChild(this.cropper),X(this.element,L))}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}])&&j(t.prototype,e),i&&j(t,i),Object.defineProperty(t,"prototype",{writable:!1}),n}();return g(It.prototype,t,i,e,St,jt,At),It});

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A leading decimal point can be confused with a dot: '.1'.
A leading decimal point can be confused with a dot: '.8'.
Bad invocation.
Expected an assignment or function call and instead saw an expression.
Functions declared within loops referencing an outer scoped variable may lead to confusing semantics. (a, n)
Functions declared within loops referencing an outer scoped variable may lead to confusing semantics. (a, n, P)
Invalid typeof value 'symbol'
Missing semicolon.
Reassignment of 'D', which is a function. Use 'var' or 'let' to declare bindings that may change.
Too many errors. (100% scanned).
Value of 't' may be overwritten in IE 8 and earlier.


// hide iiif-print feature flipper

tr[data-feature="use-iiif-print"] {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid qualifying attribute selectors with an element.

}

.py-4 {
padding-top: 2em;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Properties should be ordered padding-bottom, padding-top

}

.py-0 {
padding-top: 0;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Properties should be ordered padding-bottom, padding-top

}

.mx-3 {
margin-right: 1em;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Properties should be ordered margin-left, margin-right

}

#download-pdf-button {
margin: 10px 0 10px 0;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shorthand form for property margin should be written more concisely as 10px 0 instead of 10px 0 10px 0
Shorthands of length 4 are not allowed. Value was 10px 0 10px 0

}
}

#download-pdf-button {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid using id selectors

// style the analytics button to match citations button
#stats {
margin-top: 10px;
@media (min-width: 576px) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@media declaration should be preceded by an empty line

}

// style the analytics button to match citations button
#stats {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid using id selectors

@@ -502,3 +514,115 @@ body.public-facing {
vertical-align: middle;
width: 1.5em;
}

// make sure constraints are on only one line, even with markdown
span.constraint-value p, .facet-values p {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid qualifying class selectors with an element.
Each selector in a comma sequence should be on its own single line

nav.navbar-nav.col-sm-5 {
padding-right: 0;
}
}

//these styles modify the theming for the citations section
div#collapse-citations {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid qualifying id selectors with an element.
Avoid using id selectors

.highlight {
background: yellow;
font-weight: 700;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Files should end with a trailing newline


// for catalog search result snippets
.highlight {
background: yellow;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Color yellow should be written in hexadecimal form as #ffff00

.video-embed-viewer {
aspect-ratio: 16 / 9;
width: 100%;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Files should end with a trailing newline

@jeremyf jeremyf added the ignore-for-release ignore this for release notes label Jan 11, 2024

.hyc-banner {
padding: 15px;
.hyc-bugs .hyc-created-by,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rule declaration should be preceded by an empty line


// for catalog search result snippets
.highlight {
background: #ffff00;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line should be indented 2 spaces, but was indented 4 spaces

* i35-valkyrize-hyku:
  🧹 Update view to include translations
  📚 Adjust documentation to help clarify
  ♻️ Favor config of `FeaturedWork`
@jeremyf jeremyf merged commit 7f1b1c3 into i35-valkyrize-hyku Jan 11, 2024
2 of 3 checks passed
@jeremyf jeremyf deleted the merge-main-into-i35 branch January 11, 2024 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ignore-for-release ignore this for release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants