From 92cebc9bb1f45cd651697d4779fbe7b06aac83b0 Mon Sep 17 00:00:00 2001 From: George <31376482+george-gca@users.noreply.github.com> Date: Thu, 23 May 2024 23:21:16 -0300 Subject: [PATCH] Added support for search (#2415) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added support for search within the template as suggested in #581. I decided to go with a client side search based on [Ninja keys](https://github.com/ssleptsov/ninja-keys), but using [deepdub's fork](https://github.com/deepdub-ai/ninja-keys) as basis since it supports fuzzy search. Had to do a bunch of changes to their code to make it work without using node to install everything. Also changed to use some colors defined in our side and using both pages' titles and descriptions for search. Also had to increase the template max width to better accomodate the new item in navigation bar. Missing implementations: - [ ] One thing I'd love to do (but currently have no idea how) would be to change the text next to the search button depending on the platform. For example, if the user is accessing the site on a mac they should use ⌘k instead of ctrl k. - [x] Test how this looks like (and how it is supposed to work) on devices with smaller screens - [x] Support for offline mode Some screenshots: --- ## Dark version ![Screenshot from 2024-05-13 16-30-12](https://github.com/alshedivat/al-folio/assets/31376482/535acec5-dd7a-48cb-a17f-a295da98b5d3) ![Screenshot from 2024-05-13 16-30-26](https://github.com/alshedivat/al-folio/assets/31376482/6b2d94bb-3981-4252-ae2b-53994b514491) ![Screenshot from 2024-05-13 16-30-36](https://github.com/alshedivat/al-folio/assets/31376482/66262b56-2744-475d-b09f-2cb65210017b) --- ## Light version ![Screenshot from 2024-05-13 16-30-44](https://github.com/alshedivat/al-folio/assets/31376482/a0eec50c-e7ac-4b52-aee8-2050bff05d54) ![Screenshot from 2024-05-13 16-30-50](https://github.com/alshedivat/al-folio/assets/31376482/41d72066-3e68-4ec3-bf3d-140da621f67b) ![Screenshot from 2024-05-13 16-30-55](https://github.com/alshedivat/al-folio/assets/31376482/613fd56e-7180-4373-ab7a-dfed184b5a18) --------- Signed-off-by: George Araujo Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .prettierignore | 2 + _config.yml | 6 +- _includes/header.liquid | 8 + _includes/scripts/search.liquid | 24 + _layouts/default.liquid | 1 + _sass/_base.scss | 16 +- assets/js/search-data.js | 535 ++++++++++++++++++ assets/js/search/base-styles.min.js | 286 ++++++++++ assets/js/search/command-score.min.js | 7 + .../js/search/hotkeys-js/hotkeys.esm.min.js | 18 + .../js/search/lit-element/lit-element.min.js | 12 + .../lit-html/directives/class-map.min.js | 22 + .../js/search/lit-html/directives/join.min.js | 12 + .../js/search/lit-html/directives/live.min.js | 28 + .../js/search/lit-html/directives/ref.min.js | 32 ++ .../search/lit-html/directives/repeat.min.js | 27 + .../lit-html/directives/unsafe-html.min.js | 22 + assets/js/search/lit-html/is-server.min.js | 12 + assets/js/search/lit-html/lit-html.min.js | 12 + assets/js/search/lit/decorators.min.js | 7 + .../js/search/lit/directives/class-map.min.js | 7 + assets/js/search/lit/directives/join.min.js | 7 + assets/js/search/lit/directives/live.min.js | 7 + assets/js/search/lit/directives/ref.min.js | 7 + assets/js/search/lit/directives/repeat.min.js | 7 + .../search/lit/directives/unsafe-html.min.js | 7 + assets/js/search/lit/index.min.js | 7 + assets/js/search/ninja-action.min.js | 101 ++++ assets/js/search/ninja-footer.min.js | 62 ++ assets/js/search/ninja-header.min.js | 78 +++ assets/js/search/ninja-keys.min.js | 39 ++ .../decorators/custom-element.min.js | 12 + .../decorators/event-options.min.js | 12 + .../decorators/property.min.js | 22 + .../decorators/query-all.min.js | 17 + .../decorators/query-assigned-elements.min.js | 17 + .../decorators/query-assigned-nodes.min.js | 17 + .../decorators/query-async.min.js | 17 + .../reactive-element/decorators/query.min.js | 17 + .../reactive-element/decorators/state.min.js | 27 + .../reactive-element/reactive-element.min.js | 17 + assets/js/theme.js | 12 + requirements.txt | 1 + 43 files changed, 1603 insertions(+), 3 deletions(-) create mode 100644 _includes/scripts/search.liquid create mode 100644 assets/js/search-data.js create mode 100644 assets/js/search/base-styles.min.js create mode 100644 assets/js/search/command-score.min.js create mode 100644 assets/js/search/hotkeys-js/hotkeys.esm.min.js create mode 100644 assets/js/search/lit-element/lit-element.min.js create mode 100644 assets/js/search/lit-html/directives/class-map.min.js create mode 100644 assets/js/search/lit-html/directives/join.min.js create mode 100644 assets/js/search/lit-html/directives/live.min.js create mode 100644 assets/js/search/lit-html/directives/ref.min.js create mode 100644 assets/js/search/lit-html/directives/repeat.min.js create mode 100644 assets/js/search/lit-html/directives/unsafe-html.min.js create mode 100644 assets/js/search/lit-html/is-server.min.js create mode 100644 assets/js/search/lit-html/lit-html.min.js create mode 100644 assets/js/search/lit/decorators.min.js create mode 100644 assets/js/search/lit/directives/class-map.min.js create mode 100644 assets/js/search/lit/directives/join.min.js create mode 100644 assets/js/search/lit/directives/live.min.js create mode 100644 assets/js/search/lit/directives/ref.min.js create mode 100644 assets/js/search/lit/directives/repeat.min.js create mode 100644 assets/js/search/lit/directives/unsafe-html.min.js create mode 100644 assets/js/search/lit/index.min.js create mode 100644 assets/js/search/ninja-action.min.js create mode 100644 assets/js/search/ninja-footer.min.js create mode 100644 assets/js/search/ninja-header.min.js create mode 100644 assets/js/search/ninja-keys.min.js create mode 100644 assets/js/search/reactive-element/decorators/custom-element.min.js create mode 100644 assets/js/search/reactive-element/decorators/event-options.min.js create mode 100644 assets/js/search/reactive-element/decorators/property.min.js create mode 100644 assets/js/search/reactive-element/decorators/query-all.min.js create mode 100644 assets/js/search/reactive-element/decorators/query-assigned-elements.min.js create mode 100644 assets/js/search/reactive-element/decorators/query-assigned-nodes.min.js create mode 100644 assets/js/search/reactive-element/decorators/query-async.min.js create mode 100644 assets/js/search/reactive-element/decorators/query.min.js create mode 100644 assets/js/search/reactive-element/decorators/state.min.js create mode 100644 assets/js/search/reactive-element/reactive-element.min.js create mode 100644 requirements.txt diff --git a/.prettierignore b/.prettierignore index 8057079..bfd89b7 100644 --- a/.prettierignore +++ b/.prettierignore @@ -2,7 +2,9 @@ **/*.min.css **/*.min.js assets/css/main.scss +assets/js/search-data.js assets/js/distillpub/template.v2.js +assets/js/search/*.js assets/plotly/demo.html lighthouse_results/** _posts/2015-10-20-math.md diff --git a/_config.yml b/_config.yml index 7e82abb..fe428e7 100644 --- a/_config.yml +++ b/_config.yml @@ -48,9 +48,11 @@ rss_icon: true navbar_fixed: true footer_fixed: true +search_enabled: true +socials_in_search: true # Dimensions -max_width: 800px +max_width: 930px # TODO: add layout settings (single page vs. multi-page) @@ -266,7 +268,7 @@ sass: # ----------------------------------------------------------------------------- jekyll-minifier: - exclude: ["robots.txt"] + exclude: ["robots.txt", "assets/js/search/*.js"] uglifier_args: harmony: true diff --git a/_includes/header.liquid b/_includes/header.liquid index 6a5829e..805280b 100644 --- a/_includes/header.liquid +++ b/_includes/header.liquid @@ -107,6 +107,14 @@ {% endif %} {% endif %} {% endfor %} + {% if site.search_enabled %} + + + {% endif %} {% if site.enable_darkmode %}
  • diff --git a/_includes/scripts/search.liquid b/_includes/scripts/search.liquid new file mode 100644 index 0000000..404741b --- /dev/null +++ b/_includes/scripts/search.liquid @@ -0,0 +1,24 @@ +{% if site.search_enabled %} + + + + +{% endif %} diff --git a/_layouts/default.liquid b/_layouts/default.liquid index 77b78b2..3f4af10 100644 --- a/_layouts/default.liquid +++ b/_layouts/default.liquid @@ -72,5 +72,6 @@ {% include scripts/imageLayouts.liquid %} {% include scripts/jekyll_tabs.liquid %} {% include scripts/back_to_top.liquid %} + {% include scripts/search.liquid %} diff --git a/_sass/_base.scss b/_sass/_base.scss index c4b7f98..f6e3369 100644 --- a/_sass/_base.scss +++ b/_sass/_base.scss @@ -355,7 +355,8 @@ ul.task-list input[type="checkbox"] { } } -#light-toggle { +#light-toggle, +#search-toggle { padding: 0; border: 0; background-color: inherit; @@ -1109,3 +1110,16 @@ swiper-container { border-bottom: 2px solid var(--global-text-color); } } + +// Ninja Keys +// for more options, check https://github.com/ssleptsov/ninja-keys?tab=readme-ov-file#css-variables +ninja-keys { + --ninja-accent-color: var(--global-theme-color); + --ninja-icon-size: 0px; + --ninja-modal-background: var(--global-bg-color); + --ninja-z-index: 1031; +} + +ninja-keys::part(ninja-input-wrapper) { + background: var(--global-bg-color); +} diff --git a/assets/js/search-data.js b/assets/js/search-data.js new file mode 100644 index 0000000..4850244 --- /dev/null +++ b/assets/js/search-data.js @@ -0,0 +1,535 @@ +--- +--- +// don't remove the above lines +// they are required to make the code work + +// get the ninja-keys element +const ninja = document.querySelector('ninja-keys'); + +// add the home and posts menu items +ninja.data = [ + {%- for page in site.pages -%} + {%- if page.permalink == '/' -%}{%- assign about_title = page.title -%}{%- endif -%} + {%- endfor -%} + { + id: "nav-{{ about_title | slugify }}", + title: "{{ about_title }}", + section: "Navigation", + handler: () => { + window.location.href = "{{ '/' | relative_url }}"; + }, + }, + {%- assign sorted_pages = site.pages | sort: "nav_order" -%} + {%- for p in sorted_pages -%} + {%- if p.nav and p.autogen == null -%} + {%- if p.dropdown -%} + {%- for child in p.children -%} + {%- unless child.title == 'divider' -%} + { + {%- assign title = child.title | escape -%} + {%- if child.permalink contains "/blog/" -%}{%- assign url = "/blog/" -%} {%- else -%}{%- assign url = child.url -%}{%- endif -%} + id: "dropdown-{{ title | slugify }}", + title: "{{ title }}", + description: "{{ child.description | strip_html | strip_newlines | escape }}", + section: "Dropdown", + handler: () => { + window.location.href = "{{ url | relative_url }}"; + }, + }, + {%- endunless -%} + {%- endfor -%} + + {%- else -%} + { + {%- assign title = p.title | escape -%} + {%- if p.permalink contains "/blog/" -%}{%- assign url = "/blog/" -%} {%- else -%}{%- assign url = p.url -%}{%- endif -%} + id: "nav-{{ title | slugify }}", + title: "{{ title }}", + description: "{{ p.description | strip_html | strip_newlines | escape }}", + section: "Navigation", + handler: () => { + window.location.href = "{{ url | relative_url }}"; + }, + }, + {%- endif -%} + {%- endif -%} + {%- endfor -%} + {%- for post in site.posts -%} + { + {%- assign title = post.title | escape -%} + id: "post-{{ title | slugify }}", + title: "{{ title }}", + description: "{{ post.description | strip_html | strip_newlines | escape }}", + section: "Posts", + handler: () => { + window.location.href = "{{ post.url | relative_url }}"; + }, + }, + {%- endfor -%} + {%- for project in site.projects -%} + { + {%- assign title = project.title | escape -%} + id: "project-{{ title | slugify }}", + title: "{{ title }}", + description: "{{ project.description | strip_html | strip_newlines | escape }}", + section: "Projects", + handler: () => { + window.location.href = "{{ project.url | relative_url }}"; + }, + }, + {%- endfor -%} + {%- if site.socials_in_search -%} + {%- if site.email -%} + { + id: 'socials-email', + title: 'Send email', + section: 'Socials', + handler: () => { + window.open("mailto:{{ site.email | encode_email }}", "_blank"); + }, + }, + {%- endif -%} + {%- if site.telegram_username -%} + { + id: 'socials-telegram', + title: 'Telegram', + section: 'Socials', + handler: () => { + window.open("https://telegram.me/{{ site.telegram_username }}", "_blank"); + }, + }, + {%- endif -%} + {%- if site.whatsapp_number -%} + { + id: 'socials-whatsapp', + title: 'WhatsApp', + section: 'Socials', + handler: () => { + window.open("https://wa.me/{{ site.whatsapp_number }}", "_blank"); + }, + }, + {%- endif -%} + {%- if site.orcid_id -%} + { + id: 'socials-orcid', + title: 'ORCID', + section: 'Socials', + handler: () => { + window.open("https://orcid.org/{{ site.orcid_id }}", "_blank"); + }, + }, + {%- endif -%} + {%- if site.scholar_userid -%} + { + id: 'socials-google-scholar', + title: 'Google Scholar', + section: 'Socials', + handler: () => { + window.open("https://scholar.google.com/citations?user={{ site.scholar_userid }}", "_blank"); + }, + }, + {%- endif -%} + {%- if site.semanticscholar_id -%} + { + id: 'socials-semantic-scholar', + title: 'Semantic Scholar', + section: 'Socials', + handler: () => { + window.open("https://www.semanticscholar.org/author/{{ site.semanticscholar_id }}", "_blank"); + }, + }, + {%- endif -%} + {%- if site.publons_id -%} + { + id: 'socials-publons', + title: 'Publons', + section: 'Socials', + handler: () => { + window.open("https://publons.com/a/{{ site.publons_id }}/", "_blank"); + }, + }, + {%- endif -%} + {%- if site.lattes_id -%} + { + id: 'socials-lattes', + title: 'Lattes', + section: 'Socials', + handler: () => { + window.open("http://lattes.cnpq.br/{{ site.lattes_id }}", "_blank"); + }, + }, + {%- endif -%} + {%- if site.osf_id -%} + id: 'socials-open-science-framework', + title: 'Open Science Framework', + section: 'Socials', + handler: () => { + window.open("https://osf.io/{{ site.osf_id }}/", "_blank"); + }, + }, + {%- endif -%} + {%- if site.research_gate_profile -%} + { + id: 'socials-researchgate', + title: 'ResearchGate', + section: 'Socials', + handler: () => { + window.open("https://www.researchgate.net/profile/{{site.research_gate_profile}}/", "_blank"); + }, + }, + {%- endif -%} + {%- if site.ieee_id -%} + { + id: 'socials-ieee-xplore', + title: 'IEEE Xplore', + section: 'Socials', + handler: () => { + window.open("https://ieeexplore.ieee.org/author/{{site.ieee_id}}/", "_blank"); + }, + }, + {%- endif -%} + {%- if site.acm_id -%} + { + id: 'socials-acm-dl', + title: 'ACM DL', + section: 'Socials', + handler: () => { + window.open("https://dl.acm.org/profile/{{site.acm_id}}/", "_blank"); + }, + }, + {%- endif -%} + {%- if site.scopus_id -%} + { + id: 'socials-scopus', + title: 'Scopus', + section: 'Socials', + handler: () => { + window.open("https://www.scopus.com/authid/detail.uri?authorId={{site.scopus_id}}", "_blank"); + }, + }, + {%- endif -%} + {%- if site.github_username -%} + { + id: 'socials-github', + title: 'GitHub', + section: 'Socials', + handler: () => { + window.open("https://github.com/{{ site.github_username }}", "_blank"); + }, + }, + {%- endif -%} + {%- if site.linkedin_username -%} + { + id: 'socials-linkedin', + title: 'LinkedIn', + section: 'Socials', + handler: () => { + window.open("https://www.linkedin.com/in/{{ site.linkedin_username }}", "_blank"); + }, + }, + {%- endif -%} + {%- if site.x_username -%} + { + id: 'socials-x', + title: 'X', + description: 'Twitter', + section: 'Socials', + handler: () => { + window.open("https://twitter.com/{{ site.x_username }}", "_blank"); + }, + }, + {%- endif -%} + {%- if site.mastodon_username -%} + { + id: 'socials-mastodon', + title: 'Mastodon', + section: 'Socials', + handler: () => { + window.open("https://{{ site.mastodon_username }}", "_blank"); + }, + }, + {%- endif -%} + {%- if site.medium_username -%} + { + id: 'socials-medium', + title: 'Medium', + section: 'Socials', + handler: () => { + window.open("https://medium.com/@{{ site.medium_username }}", "_blank"); + }, + }, + {%- endif -%} + {%- if site.quora_username -%} + { + id: 'socials-quora', + title: 'Quora', + section: 'Socials', + handler: () => { + window.open("https://www.quora.com/profile/{{ site.quora_username }}", "_blank"); + }, + }, + {%- endif -%} + {%- if site.flickr_id -%} + { + id: 'socials-flickr', + title: 'Flickr', + section: 'Socials', + handler: () => { + window.open("https://www.flickr.com/{{ site.flickr_id }}", "_blank"); + }, + }, + {%- endif -%} + {%- if site.blogger_url -%} + { + id: 'socials-blogger', + title: 'Blogger', + section: 'Socials', + handler: () => { + window.open("{{ site.blogger_url }}", "_blank"); + }, + }, + {%- endif -%} + {%- if site.work_url -%} + { + id: 'socials-work', + title: 'Work', + section: 'Socials', + handler: () => { + window.open("{{ site.work_url }}", "_blank"); + }, + }, + {%- endif -%} + {%- if site.wikidata_id -%} + { + id: 'socials-wikidata', + title: 'Wikidata', + section: 'Socials', + handler: () => { + window.open("https://www.wikidata.org/wiki/{{ site.wikidata_id }}", "_blank"); + }, + }, + {%- endif -%} + {%- if site.wikipedia_id -%} + { + id: 'socials-wikipedia', + title: 'Wikipedia', + section: 'Socials', + handler: () => { + window.open("https://wikipedia.org/wiki/User:{{ site.wikipedia_id }}", "_blank"); + }, + }, + {%- endif -%} + {%- if site.strava_userid -%} + { + id: 'socials-strava', + title: 'Strava', + section: 'Socials', + handler: () => { + window.open("https://www.strava.com/athletes/{{ site.strava_userid }}", "_blank"); + }, + }, + {%- endif -%} + {%- if site.keybase_username -%} + { + id: 'socials-keybase', + title: 'Keybase', + section: 'Socials', + handler: () => { + window.open("https://keybase.io/{{ site.keybase_username }}", "_blank"); + }, + }, + {%- endif -%} + {%- if site.gitlab_username -%} + { + id: 'socials-gitlab', + title: 'GitLab', + section: 'Socials', + handler: () => { + window.open("https://gitlab.com/{{ site.gitlab_username }}", "_blank"); + }, + }, + {%- endif -%} + {%- if site.dblp_url -%} + { + id: 'socials-dblp', + title: 'DBLP', + section: 'Socials', + handler: () => { + window.open("{{ site.dblp_url }}", "_blank"); + }, + }, + {%- endif -%} + {%- if site.stackoverflow_id -%} + { + id: 'socials-stackoverflow', + title: 'Stackoverflow', + section: 'Socials', + handler: () => { + window.open("https://stackoverflow.com/users/{{ site.stackoverflow_id }}", "_blank"); + }, + }, + {%- endif -%} + {%- if site.kaggle_id -%} + { + id: 'socials-kaggle', + title: 'Kaggle', + section: 'Socials', + handler: () => { + window.open("https://www.kaggle.com/{{ site.kaggle_id }}", "_blank"); + }, + }, + {%- endif -%} + {%- if site.lastfm_id -%} + { + id: 'socials-last-fm', + title: 'Last FM', + section: 'Socials', + handler: () => { + window.open("https://www.last.fm/user/{{ site.lastfm_id }}", "_blank"); + }, + }, + {%- endif -%} + {%- if site.spotify_id -%} + { + id: 'socials-spotify', + title: 'Spotify', + section: 'Socials', + handler: () => { + window.open("https://open.spotify.com/user/{{ site.spotify_id }}", "_blank"); + }, + }, + {%- endif -%} + {%- if site.pinterest_id -%} + { + id: 'socials-pinterest', + title: 'Pinterest', + section: 'Socials', + handler: () => { + window.open("https://www.pinterest.com/{{ site.pinterest_id }}", "_blank"); + }, + }, + {%- endif -%} + {%- if site.unsplash_id -%} + { + id: 'socials-unsplash', + title: 'Unsplash', + section: 'Socials', + handler: () => { + window.open("https://unsplash.com/@{{ site.unsplash_id }}", "_blank"); + }, + }, + {%- endif -%} + {%- if site.instagram_id -%} + { + id: 'socials-instagram', + title: 'Instagram', + section: 'Socials', + handler: () => { + window.open("https://instagram.com/{{ site.instagram_id }}", "_blank"); + }, + }, + {%- endif -%} + {%- if site.facebook_id -%} + { + id: 'socials-facebook', + title: 'Facebook', + section: 'Socials', + handler: () => { + window.open("https://facebook.com/{{ site.facebook_id }}", "_blank"); + }, + }, + {%- endif -%} + {%- if site.bluesky_url -%} + { + id: 'socials-bluesky', + title: 'Bluesky', + section: 'Socials', + handler: () => { + window.open("https://bsky.app/profile/{{ site.bluesky_url }}", "_blank"); + }, + }, + {%- endif -%} + {%- if site.youtube_id -%} + { + id: 'socials-youtube', + title: 'YouTube', + section: 'Socials', + handler: () => { + window.open("https://youtube.com/@{{ site.youtube_id }}", "_blank"); + }, + }, + {%- endif -%} + {%- if site.discord_id -%} + { + id: 'socials-discord', + title: 'Discord', + section: 'Socials', + handler: () => { + window.open("https://discord.com/users/{{ site.discord_id }}", "_blank"); + }, + }, + {%- endif -%} + {%- if site.zotero_username -%} + { + id: 'socials-zotero', + title: 'Zotero', + section: 'Socials', + handler: () => { + window.open("https://www.zotero.org/{{ site.zotero_username }}", "_blank"); + }, + }, + {%- endif -%} + {%- if site.rss_icon -%} + { + id: 'socials-rss', + title: 'RSS Feed', + section: 'Socials', + handler: () => { + window.open("{{ site.baseurl }}/feed.xml", "_blank"); + }, + }, + {%- endif -%} + {%- comment -%} + {%- if site.wechat_qr -%} + // check how to add wechat qr code + { + id: 'socials-wechat', + title: 'WeChat', + section: 'Socials', + handler: () => { + window.open("", "_blank"); + }, + }, + {%- endif -%} + {%- endcomment -%} + {%- endif -%} + {%- if site.enable_darkmode -%} + { + id: 'light-theme', + title: 'Change theme to light', + description: 'Change the theme of the site to Light', + section: 'Theme', + handler: () => { + setThemeSetting("light"); + }, + }, + { + id: 'dark-theme', + title: 'Change theme to dark', + description: 'Change the theme of the site to Dark', + section: 'Theme', + handler: () => { + setThemeSetting("dark"); + }, + }, + { + id: 'system-theme', + title: 'Use system default theme', + description: 'Change the theme of the site to System Default', + section: 'Theme', + handler: () => { + setThemeSetting("system"); + }, + }, + {%- endif -%} +]; \ No newline at end of file diff --git a/assets/js/search/base-styles.min.js b/assets/js/search/base-styles.min.js new file mode 100644 index 0000000..7ffae43 --- /dev/null +++ b/assets/js/search/base-styles.min.js @@ -0,0 +1,286 @@ +/** + * Minified by jsDelivr using Terser v5.19.2. + * Original file: /npm/@deepdub/ninja-keys@1.2.11/dist/base-styles.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +import{css}from"./lit/index.min.js";export const baseStyles=css` + :host { + --ninja-width: 640px; + --ninja-backdrop-filter: none; + --ninja-overflow-background: rgba(255, 255, 255, 0.5); + --ninja-text-color: rgb(60, 65, 73); + --ninja-font-size: 16px; + --ninja-top: 20%; + + --ninja-key-border-radius: 0.25em; + --ninja-accent-color: rgb(110, 94, 210); + --ninja-secondary-background-color: rgb(239, 241, 244); + --ninja-secondary-text-color: rgb(107, 111, 118); + + --ninja-selected-background: rgb(248, 249, 251); + + --ninja-icon-color: var(--ninja-secondary-text-color); + --ninja-icon-size: 1.2em; + --ninja-separate-border: 1px solid var(--ninja-secondary-background-color); + + --ninja-modal-background: #fff; + --ninja-modal-shadow: rgb(0 0 0 / 50%) 0px 16px 70px; + + --ninja-actions-height: 300px; + --ninja-group-text-color: rgb(144, 149, 157); + + --ninja-footer-background: rgba(242, 242, 242, 0.4); + + --ninja-placeholder-color: #8e8e8e; + + font-size: var(--ninja-font-size); + + --ninja-z-index: 1; + } + + :host(.dark) { + --ninja-backdrop-filter: none; + --ninja-overflow-background: rgba(0, 0, 0, 0.7); + --ninja-text-color: #7d7d7d; + + --ninja-modal-background: rgba(17, 17, 17, 0.85); + --ninja-accent-color: rgb(110, 94, 210); + --ninja-secondary-background-color: rgba(51, 51, 51, 0.44); + --ninja-secondary-text-color: #888; + + --ninja-selected-text-color: #eaeaea; + --ninja-selected-background: rgba(51, 51, 51, 0.44); + + --ninja-icon-color: var(--ninja-secondary-text-color); + --ninja-separate-border: 1px solid var(--ninja-secondary-background-color); + + --ninja-modal-shadow: 0 16px 70px rgba(0, 0, 0, 0.2); + + --ninja-group-text-color: rgb(144, 149, 157); + + --ninja-footer-background: rgba(30, 30, 30, 85%); + } + + .modal { + display: none; + position: fixed; + z-index: var(--ninja-z-index); + left: 0; + top: 0; + width: 100%; + height: 100%; + overflow: auto; + background: var(--ninja-overflow-background); + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + -webkit-backdrop-filter: var(--ninja-backdrop-filter); + backdrop-filter: var(--ninja-backdrop-filter); + text-align: left; + color: var(--ninja-text-color); + font-family: var(--ninja-font-family); + } + .modal.visible { + display: block; + } + + .modal.isLoadingItems .loading-indicator { + opacity: 1; + } + + .modal-content { + position: relative; + top: var(--ninja-top); + margin: auto; + padding: 0; + display: flex; + flex-direction: column; + flex-shrink: 1; + -webkit-box-flex: 1; + flex-grow: 1; + min-width: 0px; + will-change: transform; + background: var(--global-bg-color); + backdrop-filter: blur(20px); + border-radius: 0.5em; + box-shadow: var(--ninja-modal-shadow); + max-width: var(--ninja-width); + overflow: hidden; + } + + .modal-body { + background: var(--global-bg-color); + } + + .loading-indicator { + position: absolute; + width: 100%; + overflow: hidden; + opacity: 0; + height: 3px; + z-index: 1; + bottom: 34px; + } + + .loading-indicator::before { + content: ''; + position: absolute; + inset: 0; + background-color: var(--ninja-accent-color); + opacity: 0.3; + } + + @keyframes animation-bar1 { + 0% { + left: -35%; + right: 100%; + } + 60% { + left: 100%; + right: -90%; + } + 100% { + left: 100%; + right: -90%; + } + } + + .loading-indicator .bar1 { + width: 100%; + position: absolute; + left: 0; + bottom: 0; + top: 0; + -webkit-transition: -webkit-transform 0.2s linear; + transition: transform 0.2s linear; + transform-origin: left; + background-color: var(--ninja-accent-color); + width: auto; + -webkit-animation: animation-bar1 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite; + animation: animation-bar1 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite; + } + + @keyframes animation-bar2 { + 0% { + left: -200%; + right: 100%; + } + 60% { + left: 107%; + right: -8%; + } + 100% { + left: 107%; + right: -8%; + } + } + + .loading-indicator .bar2 { + width: 100%; + position: absolute; + left: 0; + bottom: 0; + top: 0; + -webkit-transition: -webkit-transform 0.2s linear; + transition: transform 0.2s linear; + transform-origin: left; + background-color: var(--ninja-accent-color); + width: auto; + -webkit-animation: animation-bar2 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite; + animation: animation-bar2 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite; + } + + .bump { + animation: zoom-in-zoom-out 0.2s ease; + } + + @keyframes zoom-in-zoom-out { + 0% { + transform: scale(0.99); + } + 50% { + transform: scale(1.01, 1.01); + } + 100% { + transform: scale(1, 1); + } + } + + .title { + font-size: 0.75rem; + padding: 0.25rem 0.25rem; + text-align: right; + position: absolute; + right: 0px; + width: 100%; + } + + .title.separator { + border-top: 1px solid rgb(51, 51, 51); + } + + .ninja-github { + color: var(--ninja-keys-text-color); + font-weight: normal; + text-decoration: none; + } + + .actions-list { + max-height: var(--ninja-actions-height); + overflow: auto; + position: relative; + margin: 0; + padding: 0.5em 0; + list-style: none; + scroll-behavior: auto; + } + + .group-header { + height: 1.375em; + line-height: 1.375em; + padding-left: 1.25em; + padding-top: 0.5em; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; + font-size: 0.75em; + line-height: 1em; + color: var(--ninja-group-text-color); + margin: 1px 0; + } + + .modal-footer { + padding: 0.5em 1em; + display: flex; + /* font-size: 0.75em; */ + border-top: var(--ninja-separate-border); + color: var(--ninja-secondary-text-color); + } + + .modal-footer .help { + display: flex; + margin-right: 1em; + align-items: center; + font-size: 0.75em; + } + + .ninja-examplekey { + background: var(--ninja-secondary-background-color); + padding: 0.06em 0.25em; + border-radius: var(--ninja-key-border-radius); + color: var(--ninja-secondary-text-color); + width: 1em; + height: 1em; + margin-right: 0.5em; + font-size: 1.25em; + fill: currentColor; + } + .ninja-examplekey.esc { + width: auto; + height: auto; + font-size: 1.1em; + } + .ninja-examplekey.backspace { + opacity: 0.7; + } +`; \ No newline at end of file diff --git a/assets/js/search/command-score.min.js b/assets/js/search/command-score.min.js new file mode 100644 index 0000000..5114c73 --- /dev/null +++ b/assets/js/search/command-score.min.js @@ -0,0 +1,7 @@ +/** + * Minified by jsDelivr using Terser v5.19.2. + * Original file: /npm/@deepdub/ninja-keys@1.2.11/dist/command-score.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +const SCORE_CONTINUE_MATCH=1,SCORE_SPACE_WORD_JUMP=.9,SCORE_NON_SPACE_WORD_JUMP=.8,SCORE_CHARACTER_JUMP=.3,PENALTY_SKIPPED=.999,PENALTY_CASE_MISMATCH=.9999,PENALTY_NOT_COMPLETE=.99,IS_GAP_REGEXP=/[\\/_+.#"@[({&]/,COUNT_GAPS_REGEXP=/[\\/_+.#"@[({&]/g,IS_SPACE_REGEXP=/[\s-]/,COUNT_SPACE_REGEXP=/[\s-]/g;function commandScoreInner(E,_,P,C,e,n,t){if(n===_.length)return e===E.length?{score:SCORE_CONTINUE_MATCH,indices:[]}:{score:PENALTY_NOT_COMPLETE,indices:[]};const A=`${e},${n}`;if(void 0!==t[A])return t[A];const S=C.charAt(n);let c,r,o,O,T=P.indexOf(S,e),R=0,N=[];for(;T>=0;)O=commandScoreInner(E,_,P,C,T+1,n+1,t),c=O.score,c>R&&(T===e?c*=SCORE_CONTINUE_MATCH:IS_GAP_REGEXP.test(E.charAt(T-1))?(c*=SCORE_NON_SPACE_WORD_JUMP,r=E.slice(e,T-1).match(COUNT_GAPS_REGEXP),r&&e>0&&(c*=Math.pow(PENALTY_SKIPPED,r.length))):IS_SPACE_REGEXP.test(E.charAt(T-1))?(c*=SCORE_SPACE_WORD_JUMP,o=E.slice(e,T-1).match(COUNT_SPACE_REGEXP),o&&e>0&&(c*=Math.pow(PENALTY_SKIPPED,o.length))):(c*=SCORE_CHARACTER_JUMP,e>0&&(c*=Math.pow(PENALTY_SKIPPED,T-e))),E.charAt(T)!==_.charAt(n)&&(c*=PENALTY_CASE_MISMATCH)),c>R&&(N=[T,...O.indices],R=c),T=P.indexOf(S,T+1);return t[A]={score:R,indices:N},{score:R,indices:N}}function formatInput(E){return E.toLowerCase().replace(COUNT_SPACE_REGEXP," ")}function commandScore(E,_){return commandScoreInner(E,_,formatInput(E),formatInput(_),0,0,{})}export{commandScore}; \ No newline at end of file diff --git a/assets/js/search/hotkeys-js/hotkeys.esm.min.js b/assets/js/search/hotkeys-js/hotkeys.esm.min.js new file mode 100644 index 0000000..a3056ee --- /dev/null +++ b/assets/js/search/hotkeys-js/hotkeys.esm.min.js @@ -0,0 +1,18 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. + * Original file: /npm/hotkeys-js@3.13.7/dist/hotkeys.esm.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +/**! + * hotkeys-js v3.13.7 + * A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies. + * + * Copyright (c) 2024 kenny wong + * https://github.com/jaywcjlove/hotkeys-js.git + * + * @website: https://jaywcjlove.github.io/hotkeys-js + + * Licensed under the MIT license + */ +const e="undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function t(e,t,n,o){e.addEventListener?e.addEventListener(t,n,o):e.attachEvent&&e.attachEvent("on".concat(t),n)}function n(e,t,n,o){e.removeEventListener?e.removeEventListener(t,n,o):e.detachEvent&&e.detachEvent("on".concat(t),n)}function o(e,t){const n=t.slice(0,t.length-1);for(let t=0;t=0;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}const i={backspace:8,"⌫":8,tab:9,clear:12,enter:13,"↩":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":e?173:189,"=":e?61:187,";":e?59:186,"'":222,"[":219,"]":221,"\\":220},c={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},s={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},l={16:!1,18:!1,17:!1,91:!1},f={};for(let e=1;e<20;e++)i["f".concat(e)]=111+e;let a=[],u=null,p="all";const d=new Map,y=e=>i[e.toLowerCase()]||c[e.toLowerCase()]||e.toUpperCase().charCodeAt(0);function h(e){p=e||"all"}function m(){return p||"all"}function k(e){if(void 0===e)Object.keys(f).forEach((e=>{Array.isArray(f[e])&&f[e].forEach((e=>g(e))),delete f[e]})),v(null);else if(Array.isArray(e))e.forEach((e=>{e.key&&g(e)}));else if("object"==typeof e)e.key&&g(e);else if("string"==typeof e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o{let{key:t,scope:n,method:i,splitKey:s="+"}=e;r(t).forEach((e=>{const t=e.split(s),r=t.length,l=t[r-1],a="*"===l?"*":y(l);if(!f[a])return;n||(n=m());const u=r>1?o(c,t):[],p=[];f[a]=f[a].filter((e=>{const t=(!i||e.method===i)&&e.scope===n&&function(e,t){const n=e.length>=t.length?e:t,o=e.length>=t.length?t:e;let r=!0;for(let e=0;ev(e)))}))};function w(e,t,n,o){if(t.element!==o)return;let r;if(t.scope===n||"all"===t.scope){r=t.mods.length>0;for(const e in l)Object.prototype.hasOwnProperty.call(l,e)&&(!l[e]&&t.mods.indexOf(+e)>-1||l[e]&&-1===t.mods.indexOf(+e))&&(r=!1);(0!==t.mods.length||l[16]||l[18]||l[17]||l[91])&&!r&&"*"!==t.shortcut||(t.keys=[],t.keys=t.keys.concat(a),!1===t.method(e,t)&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0)))}}function O(e,t){const n=f["*"];let o=e.keyCode||e.which||e.charCode;if(!b.filter.call(this,e))return;if(93!==o&&224!==o||(o=91),-1===a.indexOf(o)&&229!==o&&a.push(o),["ctrlKey","altKey","shiftKey","metaKey"].forEach((t=>{const n=s[t];e[t]&&-1===a.indexOf(n)?a.push(n):!e[t]&&a.indexOf(n)>-1?a.splice(a.indexOf(n),1):"metaKey"===t&&e[t]&&3===a.length&&(e.ctrlKey||e.shiftKey||e.altKey||(a=a.slice(a.indexOf(n))))})),o in l){l[o]=!0;for(const e in c)c[e]===o&&(b[e]=!0);if(!n)return}for(const t in l)Object.prototype.hasOwnProperty.call(l,t)&&(l[t]=e[s[t]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(-1===a.indexOf(17)&&a.push(17),-1===a.indexOf(18)&&a.push(18),l[17]=!0,l[18]=!0);const r=m();if(n)for(let o=0;o1&&(p=o(c,e)),(e="*"===(e=e[e.length-1])?"*":y(e))in f||(f[e]=[]),f[e].push({keyup:w,keydown:v,scope:h,mods:p,shortcut:s[g],method:i,key:s[g],splitKey:E,element:m});if(void 0!==m&&window){if(!d.has(m)){const e=function(){return O(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.event,m)},n=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.event;O(e,m),function(e){let t=e.keyCode||e.which||e.charCode;const n=a.indexOf(t);if(n>=0&&a.splice(n,1),e.key&&"meta"===e.key.toLowerCase()&&a.splice(0,a.length),93!==t&&224!==t||(t=91),t in l){l[t]=!1;for(const e in c)c[e]===t&&(b[e]=!1)}}(e)};d.set(m,{keydownListener:e,keyupListenr:n,capture:K}),t(m,"keydown",e,K),t(m,"keyup",n,K)}if(!u){const e=()=>{a=[]};u={listener:e,capture:K},t(window,"focus",e,K)}}}function v(e){const t=Object.values(f).flat();if(t.findIndex((t=>{let{element:n}=t;return n===e}))<0){const{keydownListener:t,keyupListenr:o,capture:r}=d.get(e)||{};t&&o&&(n(e,"keyup",o,r),n(e,"keydown",t,r),d.delete(e))}if(t.length<=0||d.size<=0){if(Object.keys(d).forEach((e=>{const{keydownListener:t,keyupListenr:o,capture:r}=d.get(e)||{};t&&o&&(n(e,"keyup",o,r),n(e,"keydown",t,r),d.delete(e))})),d.clear(),Object.keys(f).forEach((e=>delete f[e])),u){const{listener:e,capture:t}=u;n(window,"focus",e,t),u=null}}}const E={getPressedKeyString:function(){return a.map((e=>{return t=e,Object.keys(i).find((e=>i[e]===t))||(e=>Object.keys(c).find((t=>c[t]===e)))(e)||String.fromCharCode(e);var t}))},setScope:h,getScope:m,deleteScope:function(e,t){let n,o;e||(e=m());for(const t in f)if(Object.prototype.hasOwnProperty.call(f,t))for(n=f[t],o=0;o{let{element:t}=e;return v(t)}))}else o++;m()===e&&h(t||"all")},getPressedKeyCodes:function(){return a.slice(0)},getAllKeyCodes:function(){const e=[];return Object.keys(f).forEach((t=>{f[t].forEach((t=>{let{key:n,scope:o,mods:r,shortcut:i}=t;e.push({scope:o,shortcut:i,mods:r,keys:n.split("+").map((e=>y(e)))})}))})),e},isPressed:function(e){return"string"==typeof e&&(e=y(e)),-1!==a.indexOf(e)},filter:function(e){const t=e.target||e.srcElement,{tagName:n}=t;let o=!0;const r="INPUT"===n&&!["checkbox","radio","range","button","file","reset","submit","color"].includes(t.type);return(t.isContentEditable||(r||"TEXTAREA"===n||"SELECT"===n)&&!t.readOnly)&&(o=!1),o},trigger:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"all";Object.keys(f).forEach((n=>{f[n].filter((n=>n.scope===t&&n.shortcut===e)).forEach((e=>{e&&e.method&&e.method()}))}))},unbind:k,keyMap:i,modifier:c,modifierMap:s};for(const e in E)Object.prototype.hasOwnProperty.call(E,e)&&(b[e]=E[e]);if("undefined"!=typeof window){const e=window.hotkeys;b.noConflict=t=>(t&&window.hotkeys===b&&(window.hotkeys=e),b),window.hotkeys=b}export{b as default}; \ No newline at end of file diff --git a/assets/js/search/lit-element/lit-element.min.js b/assets/js/search/lit-element/lit-element.min.js new file mode 100644 index 0000000..170f791 --- /dev/null +++ b/assets/js/search/lit-element/lit-element.min.js @@ -0,0 +1,12 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. + * Original file: /npm/lit-element@4.0.5/lit-element.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +import{ReactiveElement as e}from"../reactive-element/reactive-element.min.js";export*from"../reactive-element/reactive-element.min.js";import{render as t,noChange as n}from"../lit-html/lit-html.min.js";export*from"../lit-html/lit-html.min.js"; +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */class s extends e{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=t(n,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return n}}s._$litElement$=!0,s.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:s});const r=globalThis.litElementPolyfillSupport;r?.({LitElement:s});const o={_$AK:(e,t,n)=>{e._$AK(t,n)},_$AL:e=>e._$AL};(globalThis.litElementVersions??=[]).push("4.0.5");export{s as LitElement,o as _$LE};export default null; \ No newline at end of file diff --git a/assets/js/search/lit-html/directives/class-map.min.js b/assets/js/search/lit-html/directives/class-map.min.js new file mode 100644 index 0000000..002f40a --- /dev/null +++ b/assets/js/search/lit-html/directives/class-map.min.js @@ -0,0 +1,22 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. + * Original file: /npm/lit-html@3.1.3/directives/class-map.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const t=globalThis,e=t.trustedTypes,s=e?e.createPolicy("lit-html",{createHTML:t=>t}):void 0,i="$lit$",n=`lit$${Math.random().toFixed(9).slice(2)}$`,r="?"+n,o=`<${r}>`,h=document,l=()=>h.createComment(""),$=t=>null===t||"object"!=typeof t&&"function"!=typeof t,a=Array.isArray,A=t=>a(t)||"function"==typeof t?.[Symbol.iterator],c="[ \t\n\f\r]",_=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,d=/-->/g,p=/>/g,u=RegExp(`>|${c}(?:([^\\s"'>=/]+)(${c}*=${c}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),g=/'/g,f=/"/g,v=/^(?:script|style|textarea|title)$/i,m=Symbol.for("lit-noChange"),y=Symbol.for("lit-nothing"),x=new WeakMap,H=h.createTreeWalker(h,129);function T(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==s?s.createHTML(e):e}const N=(t,e)=>{const s=t.length-1,r=[];let h,l=2===e?"":"",$=_;for(let e=0;e"===A[0]?($=h??_,c=-1):void 0===A[1]?c=-2:(c=$.lastIndex-A[2].length,a=A[1],$=void 0===A[3]?u:'"'===A[3]?f:g):$===f||$===g?$=u:$===d||$===p?$=_:($=u,h=void 0);const y=$===u&&t[e+1].startsWith("/>")?" ":"";l+=$===_?s+o:c>=0?(r.push(a),s.slice(0,c)+i+s.slice(c)+n+y):s+n+(-2===c?e:y)}return[T(t,l+(t[s]||"")+(2===e?"":"")),r]};class b{constructor({strings:t,_$litType$:s},o){let h;this.parts=[];let $=0,a=0;const A=t.length-1,c=this.parts,[_,d]=N(t,s);if(this.el=b.createElement(_,o),H.currentNode=this.el.content,2===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(h=H.nextNode())&&c.length0){h.textContent=e?e.emptyScript:"";for(let e=0;e2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=y}_$AI(t,e=this,s,i){const n=this.strings;let r=!1;if(void 0===n)t=E(this,t,e,0),r=!$(t)||t!==this._$AH&&t!==m,r&&(this._$AH=t);else{const i=t;let o,h;for(t=n[0],o=0;o(...e)=>({_$litDirective$:t,values:e});class O{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}} +/** + * @license + * Copyright 2018 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const P=j(class extends O{constructor(t){if(super(t),t.type!==L.ATTRIBUTE||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(e)}const s=t.element.classList;for(const t of this.st)t in e||(s.remove(t),this.st.delete(t));for(const t in e){const i=!!e[t];i===this.st.has(t)||this.nt?.has(t)||(i?(s.add(t),this.st.add(t)):(s.remove(t),this.st.delete(t)))}return m}});export{P as classMap};export default null; \ No newline at end of file diff --git a/assets/js/search/lit-html/directives/join.min.js b/assets/js/search/lit-html/directives/join.min.js new file mode 100644 index 0000000..eba9a9f --- /dev/null +++ b/assets/js/search/lit-html/directives/join.min.js @@ -0,0 +1,12 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. + * Original file: /npm/lit-html@3.1.3/directives/join.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +function*o(o,t){const n="function"==typeof t;if(void 0!==o){let e=-1;for(const f of o)e>-1&&(yield n?t(e):t),e++,yield f}}export{o as join};export default null; \ No newline at end of file diff --git a/assets/js/search/lit-html/directives/live.min.js b/assets/js/search/lit-html/directives/live.min.js new file mode 100644 index 0000000..40550b9 --- /dev/null +++ b/assets/js/search/lit-html/directives/live.min.js @@ -0,0 +1,28 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. + * Original file: /npm/lit-html@3.1.3/directives/live.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const t=globalThis,e=t.trustedTypes,i=e?e.createPolicy("lit-html",{createHTML:t=>t}):void 0,s="$lit$",n=`lit$${Math.random().toFixed(9).slice(2)}$`,r="?"+n,o=`<${r}>`,h=document,l=()=>h.createComment(""),$=t=>null===t||"object"!=typeof t&&"function"!=typeof t,A=Array.isArray,_="[ \t\n\f\r]",c=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,a=/-->/g,d=/>/g,p=RegExp(`>|${_}(?:([^\\s"'>=/]+)(${_}*=${_}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),u=/'/g,g=/"/g,v=/^(?:script|style|textarea|title)$/i,f=Symbol.for("lit-noChange"),m=Symbol.for("lit-nothing"),y=new WeakMap,x=h.createTreeWalker(h,129);function H(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==i?i.createHTML(e):e}const N=(t,e)=>{const i=t.length-1,r=[];let h,l=2===e?"":"",$=c;for(let e=0;e"===_[0]?($=h??c,f=-1):void 0===_[1]?f=-2:(f=$.lastIndex-_[2].length,A=_[1],$=void 0===_[3]?p:'"'===_[3]?g:u):$===g||$===u?$=p:$===a||$===d?$=c:($=p,h=void 0);const y=$===p&&t[e+1].startsWith("/>")?" ":"";l+=$===c?i+o:f>=0?(r.push(A),i.slice(0,f)+s+i.slice(f)+n+y):i+n+(-2===f?e:y)}return[H(t,l+(t[i]||"")+(2===e?"":"")),r]};class b{constructor({strings:t,_$litType$:i},o){let h;this.parts=[];let $=0,A=0;const _=t.length-1,c=this.parts,[a,d]=N(t,i);if(this.el=b.createElement(a,o),x.currentNode=this.el.content,2===i){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(h=x.nextNode())&&c.length<_;){if(1===h.nodeType){if(h.hasAttributes())for(const t of h.getAttributeNames())if(t.endsWith(s)){const e=d[A++],i=h.getAttribute(t).split(n),s=/([.?@])?(.*)/.exec(e);c.push({type:1,index:$,name:s[2],strings:i,ctor:"."===s[1]?w:"?"===s[1]?E:"@"===s[1]?I:S}),h.removeAttribute(t)}else t.startsWith(n)&&(c.push({type:6,index:$}),h.removeAttribute(t));if(v.test(h.tagName)){const t=h.textContent.split(n),i=t.length-1;if(i>0){h.textContent=e?e.emptyScript:"";for(let e=0;eA(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}S(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t))}_(t){this._$AH!==m&&$(this._$AH)?this._$AA.nextSibling.data=t:this.T(h.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:i}=t,s="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=b.createElement(H(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===s)this._$AH.p(e);else{const t=new C(s,this),i=t.u(this.options);t.p(e),this.T(i),this._$AH=t}}_$AC(t){let e=y.get(t.strings);return void 0===e&&y.set(t.strings,e=new b(t)),e}k(t){A(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const n of t)s===e.length?e.push(i=new M(this.S(l()),this.S(l()),this,this.options)):i=e[s],i._$AI(n),s++;s2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=m}_$AI(t,e=this,i,s){const n=this.strings;let r=!1;if(void 0===n)t=T(this,t,e,0),r=!$(t)||t!==this._$AH&&t!==f,r&&(this._$AH=t);else{const s=t;let o,h;for(t=n[0],o=0;o(...e)=>({_$litDirective$:t,values:e}))(class extends D{constructor(t){if(super(t),t.type!==W&&t.type!==B&&t.type!==j)throw Error("The `live` directive is not allowed on child or event bindings");if(!(t=>void 0===t.strings)(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===f||e===m)return e;const i=t.element,s=t.name;if(t.type===W){if(e===i[s])return f}else if(t.type===j){if(!!e===i.hasAttribute(s))return f}else if(t.type===B&&i.getAttribute(s)===e+"")return f;return((t,e=L)=>{t._$AH=e; +/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */})(t),e}});export{P as live};export default null; \ No newline at end of file diff --git a/assets/js/search/lit-html/directives/ref.min.js b/assets/js/search/lit-html/directives/ref.min.js new file mode 100644 index 0000000..0784e02 --- /dev/null +++ b/assets/js/search/lit-html/directives/ref.min.js @@ -0,0 +1,32 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. + * Original file: /npm/lit-html@3.1.3/directives/ref.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const t=globalThis,e=t.trustedTypes,s=e?e.createPolicy("lit-html",{createHTML:t=>t}):void 0,i="$lit$",n=`lit$${Math.random().toFixed(9).slice(2)}$`,h="?"+n,o=`<${h}>`,r=document,l=()=>r.createComment(""),$=t=>null===t||"object"!=typeof t&&"function"!=typeof t,c=Array.isArray,A=t=>c(t)||"function"==typeof t?.[Symbol.iterator],_="[ \t\n\f\r]",a=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,d=/-->/g,p=/>/g,u=RegExp(`>|${_}(?:([^\\s"'>=/]+)(${_}*=${_}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),g=/'/g,f=/"/g,v=/^(?:script|style|textarea|title)$/i,m=Symbol.for("lit-noChange"),y=Symbol.for("lit-nothing"),H=new WeakMap,x=r.createTreeWalker(r,129);function N(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==s?s.createHTML(e):e}const T=(t,e)=>{const s=t.length-1,h=[];let r,l=2===e?"":"",$=a;for(let e=0;e"===A[0]?($=r??a,_=-1):void 0===A[1]?_=-2:(_=$.lastIndex-A[2].length,c=A[1],$=void 0===A[3]?u:'"'===A[3]?f:g):$===f||$===g?$=u:$===d||$===p?$=a:($=u,r=void 0);const y=$===u&&t[e+1].startsWith("/>")?" ":"";l+=$===a?s+o:_>=0?(h.push(c),s.slice(0,_)+i+s.slice(_)+n+y):s+n+(-2===_?e:y)}return[N(t,l+(t[s]||"")+(2===e?"":"")),h]};class C{constructor({strings:t,_$litType$:s},o){let r;this.parts=[];let $=0,c=0;const A=t.length-1,_=this.parts,[a,d]=T(t,s);if(this.el=C.createElement(a,o),x.currentNode=this.el.content,2===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(r=x.nextNode())&&_.length0){r.textContent=e?e.emptyScript:"";for(let e=0;e2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=y}_$AI(t,e=this,s,i){const n=this.strings;let h=!1;if(void 0===n)t=M(this,t,e,0),h=!$(t)||t!==this._$AH&&t!==m,h&&(this._$AH=t);else{const i=t;let o,r;for(t=n[0],o=0;ovoid 0===t.strings +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */;const L={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},k=t=>(...e)=>({_$litDirective$:t,values:e});class O{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}} +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const P=(t,e)=>{const s=t._$AN;if(void 0===s)return!1;for(const t of s)t._$AO?.(e,!1),P(t,e);return!0},W=t=>{let e,s;do{if(void 0===(e=t._$AM))break;s=e._$AN,s.delete(t),t=e}while(0===s?.size)},D=t=>{for(let e;e=t._$AM;t=e){let s=e._$AN;if(void 0===s)e._$AN=s=new Set;else if(s.has(t))break;s.add(t),z(e)}};function V(t){void 0!==this._$AN?(W(this),this._$AM=t,D(this)):this._$AM=t}function j(t,e=!1,s=0){const i=this._$AH,n=this._$AN;if(void 0!==n&&0!==n.size)if(e)if(Array.isArray(i))for(let t=s;t{t.type==L.CHILD&&(t._$AP??=j,t._$AQ??=V)};class Z extends O{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,s){super._$AT(t,e,s),D(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(P(this,t),W(this))}setValue(t){if(B(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}} +/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const F=()=>new Q;class Q{}const q=new WeakMap,G=k(class extends Z{render(t){return y}update(t,[e]){const s=e!==this.Y;return s&&void 0!==this.Y&&this.rt(void 0),(s||this.lt!==this.ct)&&(this.Y=e,this.ht=t.options?.host,this.rt(this.ct=t.element)),y}rt(t){if("function"==typeof this.Y){const e=this.ht??globalThis;let s=q.get(e);void 0===s&&(s=new WeakMap,q.set(e,s)),void 0!==s.get(this.Y)&&this.Y.call(this.ht,void 0),s.set(this.Y,t),void 0!==t&&this.Y.call(this.ht,t)}else this.Y.value=t}get lt(){return"function"==typeof this.Y?q.get(this.ht??globalThis)?.get(this.Y):this.Y?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});export{F as createRef,G as ref};export default null; \ No newline at end of file diff --git a/assets/js/search/lit-html/directives/repeat.min.js b/assets/js/search/lit-html/directives/repeat.min.js new file mode 100644 index 0000000..91942ff --- /dev/null +++ b/assets/js/search/lit-html/directives/repeat.min.js @@ -0,0 +1,27 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. + * Original file: /npm/lit-html@3.1.3/directives/repeat.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const t=globalThis,e=t.trustedTypes,s=e?e.createPolicy("lit-html",{createHTML:t=>t}):void 0,i="$lit$",n=`lit$${Math.random().toFixed(9).slice(2)}$`,o="?"+n,r=`<${o}>`,h=document,l=()=>h.createComment(""),$=t=>null===t||"object"!=typeof t&&"function"!=typeof t,A=Array.isArray,_=t=>A(t)||"function"==typeof t?.[Symbol.iterator],c="[ \t\n\f\r]",a=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,d=/-->/g,u=/>/g,p=RegExp(`>|${c}(?:([^\\s"'>=/]+)(${c}*=${c}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),f=/'/g,g=/"/g,v=/^(?:script|style|textarea|title)$/i,m=Symbol.for("lit-noChange"),y=Symbol.for("lit-nothing"),x=new WeakMap,H=h.createTreeWalker(h,129);function N(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==s?s.createHTML(e):e}const T=(t,e)=>{const s=t.length-1,o=[];let h,l=2===e?"":"",$=a;for(let e=0;e"===_[0]?($=h??a,c=-1):void 0===_[1]?c=-2:(c=$.lastIndex-_[2].length,A=_[1],$=void 0===_[3]?p:'"'===_[3]?g:f):$===g||$===f?$=p:$===d||$===u?$=a:($=p,h=void 0);const y=$===p&&t[e+1].startsWith("/>")?" ":"";l+=$===a?s+r:c>=0?(o.push(A),s.slice(0,c)+i+s.slice(c)+n+y):s+n+(-2===c?e:y)}return[N(t,l+(t[s]||"")+(2===e?"":"")),o]};class b{constructor({strings:t,_$litType$:s},r){let h;this.parts=[];let $=0,A=0;const _=t.length-1,c=this.parts,[a,d]=T(t,s);if(this.el=b.createElement(a,r),H.currentNode=this.el.content,2===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(h=H.nextNode())&&c.length<_;){if(1===h.nodeType){if(h.hasAttributes())for(const t of h.getAttributeNames())if(t.endsWith(i)){const e=d[A++],s=h.getAttribute(t).split(n),i=/([.?@])?(.*)/.exec(e);c.push({type:1,index:$,name:i[2],strings:s,ctor:"."===i[1]?I:"?"===i[1]?B:"@"===i[1]?w:E}),h.removeAttribute(t)}else t.startsWith(n)&&(c.push({type:6,index:$}),h.removeAttribute(t));if(v.test(h.tagName)){const t=h.textContent.split(n),s=t.length-1;if(s>0){h.textContent=e?e.emptyScript:"";for(let e=0;e2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=y}_$AI(t,e=this,s,i){const n=this.strings;let o=!1;if(void 0===n)t=M(this,t,e,0),o=!$(t)||t!==this._$AH&&t!==m,o&&(this._$AH=t);else{const i=t;let r,h;for(t=n[0],r=0;r(...e)=>({_$litDirective$:t,values:e});class k{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}} +/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const{I:O}=R,V=()=>document.createComment(""),W=(t,e,s)=>{const i=t._$AA.parentNode,n=void 0===e?t._$AB:e._$AA;if(void 0===s){const e=i.insertBefore(V(),n),o=i.insertBefore(V(),n);s=new O(e,o,t,t.options)}else{const e=s._$AB.nextSibling,o=s._$AM,r=o!==t;if(r){let e;s._$AQ?.(t),s._$AM=t,void 0!==s._$AP&&(e=t._$AU)!==o._$AU&&s._$AP(e)}if(e!==n||r){let t=s._$AA;for(;t!==e;){const e=t.nextSibling;i.insertBefore(t,n),t=e}}}return s},j=(t,e,s=t)=>(t._$AI(e,s),t),z={},F=(t,e=z)=>t._$AH=e,Z=t=>t._$AH,Q=t=>{t._$AP?.(!1,!0);let e=t._$AA;const s=t._$AB.nextSibling;for(;e!==s;){const t=e.nextSibling;e.remove(),e=t}}; +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const Y=(t,e,s)=>{const i=new Map;for(let n=e;n<=s;n++)i.set(t[n],n);return i},q=D(class extends k{constructor(t){if(super(t),t.type!==L.CHILD)throw Error("repeat() can only be used in text expressions")}dt(t,e,s){let i;void 0===s?s=e:void 0!==e&&(i=e);const n=[],o=[];let r=0;for(const e of t)n[r]=i?i(e,r):r,o[r]=s(e,r),r++;return{values:o,keys:n}}render(t,e,s){return this.dt(t,e,s).values}update(t,[e,s,i]){const n=Z(t),{values:o,keys:r}=this.dt(e,s,i);if(!Array.isArray(n))return this.ut=r,o;const h=this.ut??=[],l=[];let $,A,_=0,c=n.length-1,a=0,d=o.length-1;for(;_<=c&&a<=d;)if(null===n[_])_++;else if(null===n[c])c--;else if(h[_]===r[a])l[a]=j(n[_],o[a]),_++,a++;else if(h[c]===r[d])l[d]=j(n[c],o[d]),c--,d--;else if(h[_]===r[d])l[d]=j(n[_],o[d]),W(t,l[d+1],n[_]),_++,d--;else if(h[c]===r[a])l[a]=j(n[c],o[a]),W(t,n[_],n[c]),c--,a++;else if(void 0===$&&($=Y(r,a,d),A=Y(h,_,c)),$.has(h[_]))if($.has(h[c])){const e=A.get(r[a]),s=void 0!==e?n[e]:null;if(null===s){const e=W(t,n[_]);j(e,o[a]),l[a]=e}else l[a]=j(s,o[a]),W(t,n[_],s),n[e]=null;a++}else Q(n[c]),c--;else Q(n[_]),_++;for(;a<=d;){const e=W(t,l[d+1]);j(e,o[a]),l[a++]=e}for(;_<=c;){const t=n[_++];null!==t&&Q(t)}return this.ut=r,F(t,l),m}});export{q as repeat};export default null; \ No newline at end of file diff --git a/assets/js/search/lit-html/directives/unsafe-html.min.js b/assets/js/search/lit-html/directives/unsafe-html.min.js new file mode 100644 index 0000000..7ecd217 --- /dev/null +++ b/assets/js/search/lit-html/directives/unsafe-html.min.js @@ -0,0 +1,22 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. + * Original file: /npm/lit-html@3.1.3/directives/unsafe-html.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const t=globalThis,e=t.trustedTypes,s=e?e.createPolicy("lit-html",{createHTML:t=>t}):void 0,i="$lit$",n=`lit$${Math.random().toFixed(9).slice(2)}$`,r="?"+n,o=`<${r}>`,h=document,l=()=>h.createComment(""),$=t=>null===t||"object"!=typeof t&&"function"!=typeof t,c=Array.isArray,A=t=>c(t)||"function"==typeof t?.[Symbol.iterator],a="[ \t\n\f\r]",_=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,d=/-->/g,u=/>/g,p=RegExp(`>|${a}(?:([^\\s"'>=/]+)(${a}*=${a}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),g=/'/g,v=/"/g,f=/^(?:script|style|textarea|title)$/i,m=Symbol.for("lit-noChange"),y=Symbol.for("lit-nothing"),H=new WeakMap,x=h.createTreeWalker(h,129);function T(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==s?s.createHTML(e):e}const N=(t,e)=>{const s=t.length-1,r=[];let h,l=2===e?"":"",$=_;for(let e=0;e"===A[0]?($=h??_,a=-1):void 0===A[1]?a=-2:(a=$.lastIndex-A[2].length,c=A[1],$=void 0===A[3]?p:'"'===A[3]?v:g):$===v||$===g?$=p:$===d||$===u?$=_:($=p,h=void 0);const y=$===p&&t[e+1].startsWith("/>")?" ":"";l+=$===_?s+o:a>=0?(r.push(c),s.slice(0,a)+i+s.slice(a)+n+y):s+n+(-2===a?e:y)}return[T(t,l+(t[s]||"")+(2===e?"":"")),r]};class E{constructor({strings:t,_$litType$:s},o){let h;this.parts=[];let $=0,c=0;const A=t.length-1,a=this.parts,[_,d]=N(t,s);if(this.el=E.createElement(_,o),x.currentNode=this.el.content,2===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(h=x.nextNode())&&a.length0){h.textContent=e?e.emptyScript:"";for(let e=0;e2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=y}_$AI(t,e=this,s,i){const n=this.strings;let r=!1;if(void 0===n)t=M(this,t,e,0),r=!$(t)||t!==this._$AH&&t!==m,r&&(this._$AH=t);else{const i=t;let o,h;for(t=n[0],o=0;o(...e)=>({_$litDirective$:t,values:e});class P{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}} +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */class O extends P{constructor(t){if(super(t),this.it=y,t.type!==B.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===y||null==t)return this._t=void 0,this.it=t;if(t===m)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}O.directiveName="unsafeHTML",O.resultType=1;const W=D(O);export{O as UnsafeHTMLDirective,W as unsafeHTML};export default null; \ No newline at end of file diff --git a/assets/js/search/lit-html/is-server.min.js b/assets/js/search/lit-html/is-server.min.js new file mode 100644 index 0000000..f7f16cb --- /dev/null +++ b/assets/js/search/lit-html/is-server.min.js @@ -0,0 +1,12 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. + * Original file: /npm/lit-html@3.1.3/is-server.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const e=!1;export{e as isServer};export default null; \ No newline at end of file diff --git a/assets/js/search/lit-html/lit-html.min.js b/assets/js/search/lit-html/lit-html.min.js new file mode 100644 index 0000000..2c27b5c --- /dev/null +++ b/assets/js/search/lit-html/lit-html.min.js @@ -0,0 +1,12 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. + * Original file: /npm/lit-html@3.1.3/lit-html.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const t=globalThis,e=t.trustedTypes,s=e?e.createPolicy("lit-html",{createHTML:t=>t}):void 0,i="$lit$",n=`lit$${Math.random().toFixed(9).slice(2)}$`,o="?"+n,r=`<${o}>`,h=document,l=()=>h.createComment(""),$=t=>null===t||"object"!=typeof t&&"function"!=typeof t,A=Array.isArray,a=t=>A(t)||"function"==typeof t?.[Symbol.iterator],_="[ \t\n\f\r]",c=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,d=/-->/g,p=/>/g,u=RegExp(`>|${_}(?:([^\\s"'>=/]+)(${_}*=${_}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),g=/'/g,v=/"/g,f=/^(?:script|style|textarea|title)$/i,m=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),y=m(1),H=m(2),x=Symbol.for("lit-noChange"),N=Symbol.for("lit-nothing"),T=new WeakMap,b=h.createTreeWalker(h,129);function C(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==s?s.createHTML(e):e}const M=(t,e)=>{const s=t.length-1,o=[];let h,l=2===e?"":"",$=c;for(let e=0;e"===a[0]?($=h??c,_=-1):void 0===a[1]?_=-2:(_=$.lastIndex-a[2].length,A=a[1],$=void 0===a[3]?u:'"'===a[3]?v:g):$===v||$===g?$=u:$===d||$===p?$=c:($=u,h=void 0);const y=$===u&&t[e+1].startsWith("/>")?" ":"";l+=$===c?s+r:_>=0?(o.push(A),s.slice(0,_)+i+s.slice(_)+n+y):s+n+(-2===_?e:y)}return[C(t,l+(t[s]||"")+(2===e?"":"")),o]};class S{constructor({strings:t,_$litType$:s},r){let h;this.parts=[];let $=0,A=0;const a=t.length-1,_=this.parts,[c,d]=M(t,s);if(this.el=S.createElement(c,r),b.currentNode=this.el.content,2===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(h=b.nextNode())&&_.length0){h.textContent=e?e.emptyScript:"";for(let e=0;e2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=N}_$AI(t,e=this,s,i){const n=this.strings;let o=!1;if(void 0===n)t=w(this,t,e,0),o=!$(t)||t!==this._$AH&&t!==x,o&&(this._$AH=t);else{const i=t;let r,h;for(t=n[0],r=0;r{const i=s?.renderBefore??e;let n=i._$litPart$;if(void 0===n){const t=s?.renderBefore??null;i._$litPart$=n=new E(e.insertBefore(l(),t),t,void 0,s??{})}return n._$AI(t),n};export{W as _$LH,y as html,x as noChange,N as nothing,D as render,H as svg};export default null; \ No newline at end of file diff --git a/assets/js/search/lit/decorators.min.js b/assets/js/search/lit/decorators.min.js new file mode 100644 index 0000000..e4f2f3e --- /dev/null +++ b/assets/js/search/lit/decorators.min.js @@ -0,0 +1,7 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. + * Original file: /npm/lit@3.1.3/decorators.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +export*from"../reactive-element/decorators/custom-element.min.js";export*from"../reactive-element/decorators/property.min.js";export*from"../reactive-element/decorators/state.min.js";export*from"../reactive-element/decorators/event-options.min.js";export*from"../reactive-element/decorators/query.min.js";export*from"../reactive-element/decorators/query-all.min.js";export*from"../reactive-element/decorators/query-async.min.js";export*from"../reactive-element/decorators/query-assigned-elements.min.js";export*from"../reactive-element/decorators/query-assigned-nodes.min.js";export default null; \ No newline at end of file diff --git a/assets/js/search/lit/directives/class-map.min.js b/assets/js/search/lit/directives/class-map.min.js new file mode 100644 index 0000000..0518604 --- /dev/null +++ b/assets/js/search/lit/directives/class-map.min.js @@ -0,0 +1,7 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. + * Original file: /npm/lit@3.1.3/directives/class-map.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +export*from"../../lit-html/directives/class-map.min.js";export default null; \ No newline at end of file diff --git a/assets/js/search/lit/directives/join.min.js b/assets/js/search/lit/directives/join.min.js new file mode 100644 index 0000000..26a10a5 --- /dev/null +++ b/assets/js/search/lit/directives/join.min.js @@ -0,0 +1,7 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. + * Original file: /npm/lit@3.1.3/directives/join.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +export*from"../../lit-html/directives/join.min.js";export default null; \ No newline at end of file diff --git a/assets/js/search/lit/directives/live.min.js b/assets/js/search/lit/directives/live.min.js new file mode 100644 index 0000000..5b930a6 --- /dev/null +++ b/assets/js/search/lit/directives/live.min.js @@ -0,0 +1,7 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. + * Original file: /npm/lit@3.1.3/directives/live.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +export*from"../../lit-html/directives/live.min.js";export default null; \ No newline at end of file diff --git a/assets/js/search/lit/directives/ref.min.js b/assets/js/search/lit/directives/ref.min.js new file mode 100644 index 0000000..385c3b8 --- /dev/null +++ b/assets/js/search/lit/directives/ref.min.js @@ -0,0 +1,7 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. + * Original file: /npm/lit@3.1.3/directives/ref.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +export*from"../../lit-html/directives/ref.min.js";export default null; \ No newline at end of file diff --git a/assets/js/search/lit/directives/repeat.min.js b/assets/js/search/lit/directives/repeat.min.js new file mode 100644 index 0000000..8bc3238 --- /dev/null +++ b/assets/js/search/lit/directives/repeat.min.js @@ -0,0 +1,7 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. + * Original file: /npm/lit@3.1.3/directives/repeat.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +export*from"../../lit-html/directives/repeat.min.js";export default null; \ No newline at end of file diff --git a/assets/js/search/lit/directives/unsafe-html.min.js b/assets/js/search/lit/directives/unsafe-html.min.js new file mode 100644 index 0000000..193aa4e --- /dev/null +++ b/assets/js/search/lit/directives/unsafe-html.min.js @@ -0,0 +1,7 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. + * Original file: /npm/lit@3.1.3/directives/unsafe-html.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +export*from"../../lit-html/directives/unsafe-html.min.js";export default null; \ No newline at end of file diff --git a/assets/js/search/lit/index.min.js b/assets/js/search/lit/index.min.js new file mode 100644 index 0000000..49c9ad6 --- /dev/null +++ b/assets/js/search/lit/index.min.js @@ -0,0 +1,7 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. + * Original file: /npm/lit@3.1.3/index.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +import"../reactive-element/reactive-element.min.js";import"../lit-html/lit-html.min.js";export*from"../lit-element/lit-element.min.js";export*from"../lit-html/is-server.min.js";export default null; \ No newline at end of file diff --git a/assets/js/search/ninja-action.min.js b/assets/js/search/ninja-action.min.js new file mode 100644 index 0000000..8f55387 --- /dev/null +++ b/assets/js/search/ninja-action.min.js @@ -0,0 +1,101 @@ +/** + * Minified by jsDelivr using Terser v5.19.2. + * Original file: /npm/@deepdub/ninja-keys@1.2.11/dist/ninja-action.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +var __decorate=this&&this.__decorate||function(t,e,i,n){var o,a=arguments.length,s=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var c=t.length-1;c>=0;c--)(o=t[c])&&(s=(a<3?o(s):a>3?o(e,i,s):o(e,i))||s);return a>3&&s&&Object.defineProperty(e,i,s),s};import{LitElement,html,css}from"./lit/index.min.js";import{customElement,property}from"./lit/decorators.min.js";import{classMap}from"./lit/directives/class-map.min.js";import{unsafeHTML}from"./lit/directives/unsafe-html.min.js";import{join}from"./lit/directives/join.min.js";let NinjaAction=class extends LitElement{constructor(){super(),this.selected=!1,this.hotKeysJoinedView=!0,this.addEventListener("click",this.click)}ensureInView(){this.scrollIntoView({block:"nearest"})}click(){this.dispatchEvent(new CustomEvent("actionsSelected",{detail:this.action,bubbles:!0,composed:!0}))}updated(t){t.has("selected")&&this.selected&&this.ensureInView()}highlightMatch(t,e){let i="",n=0;for(let o=0;o${t[o]}`,n++):i+=t[o];return unsafeHTML(i)}render(){let t,e;this.action.mdIcon?t=html`
    ${this.action.mdIcon}
    `:this.action.icon&&(t=this.action.icon?unsafeHTML(`
    ${this.action.icon}
    `):""),this.action.hotkey&&(e=this.hotKeysJoinedView?this.action.hotkey.split(",").map((t=>{const e=t.split("+"),i=html`${join(e.map((t=>html`${t}`)),"+")}`;return html`
    ${i}
    `})):this.action.hotkey.split(",").map((t=>{const e=t.split("+").map((t=>html`${t}`));return html`${e}`})));const i={selected:this.selected,"ninja-action":!0};return html` +
    + ${t} + ${this.action.type?html`
    + ${this.action.type} +
    `:html``} +
    ${this.highlightMatch(this.action.title,this.matchIndices)}
    + ${e} +
    + `;var n}};NinjaAction.styles=css` + :host { + display: flex; + width: 100%; + } + .ninja-action { + padding: 0.75em 1em; + display: flex; + gap: 0.75rem; + border-left: 2px solid transparent; + align-items: center; + justify-content: start; + outline: none; + transition: color 0s ease 0s; + width: 100%; + } + .ninja-action .highlight { + color: var(--ninja-accent-color); + font-weight: bold; + } + .ninja-action.selected { + cursor: pointer; + color: var(--ninja-selected-text-color); + background-color: var(--ninja-selected-background); + border-left: 2px solid var(--ninja-accent-color); + outline: none; + } + .ninja-action.selected .ninja-icon { + color: var(--ninja-selected-text-color); + } + .ninja-icon { + width: 20px; + font-size: var(--ninja-icon-size); + color: var(--ninja-icon-color); + margin-right: 0.5625rem; + position: relative; + line-height: 0; + flex-shrink: 0; + } + .ninja-icon img { + width: 100%; + } + + .ninja-title { + flex-shrink: 0.01; + margin-right: 0.5em; + flex-grow: 1; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + + .ninja-action-type { + font-size: 11px; + padding: 3px 5px; + border-radius: 3px; + color: #ffffff; + text-transform: uppercase; + } + + .ninja-hotkeys { + flex-shrink: 0; + width: min-content; + display: flex; + } + + .ninja-hotkeys kbd { + font-family: inherit; + } + .ninja-hotkey { + background: var(--ninja-secondary-background-color); + padding: 0.06em 0.25em; + border-radius: var(--ninja-key-border-radius); + text-transform: capitalize; + color: var(--ninja-secondary-text-color); + font-size: 0.75em; + font-family: inherit; + } + + .ninja-hotkey + .ninja-hotkey { + margin-left: 0.5em; + } + .ninja-hotkeys + .ninja-hotkeys { + margin-left: 1em; + } + `,__decorate([property({type:Object})],NinjaAction.prototype,"action",void 0),__decorate([property({type:Array})],NinjaAction.prototype,"matchIndices",void 0),__decorate([property({type:Boolean})],NinjaAction.prototype,"selected",void 0),__decorate([property({type:Boolean})],NinjaAction.prototype,"hotKeysJoinedView",void 0),NinjaAction=__decorate([customElement("ninja-action")],NinjaAction);export{NinjaAction}; \ No newline at end of file diff --git a/assets/js/search/ninja-footer.min.js b/assets/js/search/ninja-footer.min.js new file mode 100644 index 0000000..645b844 --- /dev/null +++ b/assets/js/search/ninja-footer.min.js @@ -0,0 +1,62 @@ +/** + * Minified by jsDelivr using Terser v5.19.2. + * Original file: /npm/@deepdub/ninja-keys@1.2.11/dist/ninja-footer.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +import{html}from"./lit/index.min.js";export const footerHtml=html` `; \ No newline at end of file diff --git a/assets/js/search/ninja-header.min.js b/assets/js/search/ninja-header.min.js new file mode 100644 index 0000000..79b6092 --- /dev/null +++ b/assets/js/search/ninja-header.min.js @@ -0,0 +1,78 @@ +/** + * Minified by jsDelivr using Terser v5.19.2. + * Original file: /npm/@deepdub/ninja-keys@1.2.11/dist/ninja-header.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +var __decorate=this&&this.__decorate||function(e,t,r,a){var n,o=arguments.length,i=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(i=(o<3?n(i):o>3?n(t,r,i):n(t,r))||i);return o>3&&i&&Object.defineProperty(t,r,i),i};import{LitElement,html,css}from"./lit/index.min.js";import{customElement,property}from"./lit/decorators.min.js";import{ref,createRef}from"./lit/directives/ref.min.js";let NinjaHeader=class extends LitElement{constructor(){super(...arguments),this.placeholder="",this.hideBreadcrumbs=!1,this.breadcrumbHome="Home",this.breadcrumbs=[],this._inputRef=createRef(),this._prevValue=""}render(){let e="";if(!this.hideBreadcrumbs){const t=[];for(const e of this.breadcrumbs)t.push(html``);e=html``}return html` + ${e} +
    + +
    + `}setSearch(e){this._inputRef.value&&(this._prevValue=e,this._inputRef.value.value=e)}focusSearch(){requestAnimationFrame((()=>this._inputRef.value.focus()))}_handleInput(e){const t=e.target;this.handleChange(t.value)}_handleKeyup(e){const t=e.target;t.value!==this._prevValue&&this.handleChange(t.value)}handleChange(e){this._prevValue=e,this.dispatchEvent(new CustomEvent("change",{detail:{search:e},bubbles:!1,composed:!1}))}selectParent(e){this.dispatchEvent(new CustomEvent("setParent",{detail:{parent:e},bubbles:!0,composed:!0}))}firstUpdated(){this.focusSearch()}_close(){this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}};NinjaHeader.styles=css` + :host { + flex: 1; + position: relative; + } + .search { + padding: 1.25em; + flex-grow: 1; + flex-shrink: 0; + margin: 0px; + border: none; + appearance: none; + font-size: 1.125em; + background: transparent; + caret-color: var(--ninja-accent-color); + color: #ffffff; + outline: none; + font-family: var(--ninja-font-family); + } + .search::placeholder { + color: var(--ninja-placeholder-color); + } + .breadcrumb-list { + padding: 1em 4em 0 1em; + display: flex; + flex-direction: row; + align-items: stretch; + justify-content: flex-start; + flex: initial; + } + + .breadcrumb { + background: var(--ninja-secondary-background-color); + text-align: center; + line-height: 1.2em; + border-radius: var(--ninja-key-border-radius); + border: 0; + cursor: pointer; + padding: 0.1em 0.5em; + color: var(--ninja-secondary-text-color); + margin-right: 0.5em; + outline: none; + font-family: var(--ninja-font-family); + } + + .search-wrapper { + display: flex; + border-bottom: var(--ninja-separate-border); + background: #000000; + } + `,__decorate([property()],NinjaHeader.prototype,"placeholder",void 0),__decorate([property({type:Boolean})],NinjaHeader.prototype,"hideBreadcrumbs",void 0),__decorate([property()],NinjaHeader.prototype,"breadcrumbHome",void 0),__decorate([property({type:Array})],NinjaHeader.prototype,"breadcrumbs",void 0),NinjaHeader=__decorate([customElement("ninja-header")],NinjaHeader);export{NinjaHeader}; \ No newline at end of file diff --git a/assets/js/search/ninja-keys.min.js b/assets/js/search/ninja-keys.min.js new file mode 100644 index 0000000..407bd8f --- /dev/null +++ b/assets/js/search/ninja-keys.min.js @@ -0,0 +1,39 @@ +/** + * Minified by jsDelivr using Terser v5.19.2. + * Original file: /npm/@deepdub/ninja-keys@1.2.11/dist/ninja-keys.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +var __decorate=this&&this.__decorate||function(e,t,i,s){var o,a=arguments.length,n=a<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var r=e.length-1;r>=0;r--)(o=e[r])&&(n=(a<3?o(n):a>3?o(t,i,n):o(t,i))||n);return a>3&&n&&Object.defineProperty(t,i,n),n};import{LitElement,html}from"./lit/index.min.js";import{customElement,property,state}from"./lit/decorators.min.js";import{repeat}from"./lit/directives/repeat.min.js";import{live}from"./lit/directives/live.min.js";import{createRef,ref}from"./lit-html/directives/ref.min.js";import{classMap}from"./lit/directives/class-map.min.js";import hotkeys from"./hotkeys-js/hotkeys.esm.min.js";import"./ninja-header.min.js";import"./ninja-action.min.js";import{footerHtml}from"./ninja-footer.min.js";import{baseStyles}from"./base-styles.min.js";import{commandScore}from"./command-score.min.js";let NinjaKeys=class extends LitElement{constructor(){super(...arguments),this._ignorePrefixesSplit=null,this.placeholder="Type a command or search...",this.disableHotkeys=!1,this.hideBreadcrumbs=!1,this.ignorePrefixes="",this.openHotkey="cmd+k,ctrl+k",this.navigationUpHotkey="up,shift+tab",this.navigationDownHotkey="down,tab",this.closeHotkey="esc",this.goBackHotkey="backspace",this.selectHotkey="enter",this.hotKeysJoinedView=!1,this.noAutoLoadMdIcons=!1,this.numRecentActions=0,this.data=[],this.visible=!1,this._bump=!0,this._actionMatches=[],this._search="",this._headerRef=createRef(),this._wrapperRef=createRef()}open(e={}){var t,i,s;this._bump=!0,this.visible=!0,this._headerRef.value.focusSearch(),this._actionMatches.length>0&&(this._selected=this._actionMatches[0]),this.setParent(e.parent),null===(t=this._headerRef.value)||void 0===t||t.setSearch(null!==(i=e.search)&&void 0!==i?i:""),this._search=null!==(s=e.search)&&void 0!==s?s:"",setTimeout((()=>{var e,t;null===(t=null===(e=this._wrapperRef.value)||void 0===e?void 0:e.querySelector(".actions-list"))||void 0===t||t.scrollTo({top:0})}),0)}close(){this._bump=!1,this.visible=!1}setParent(e){this._currentRoot=e||void 0,this._selected=void 0,this._search="",this._headerRef.value.setSearch("")}get breadcrumbs(){var e;const t=[];let i=null===(e=this._selected)||void 0===e?void 0:e.parent;if(i)for(t.push(i);i;){const e=[].find((e=>e.id===i));(null==e?void 0:e.parent)&&t.push(e.parent),i=e?e.parent:void 0}return t.reverse()}connectedCallback(){super.connectedCallback(),this.noAutoLoadMdIcons||document.fonts.load("24px Material Icons","apps").then((()=>{})),this._registerInternalHotkeys()}disconnectedCallback(){super.disconnectedCallback(),this._unregisterInternalHotkeys()}_registerInternalHotkeys(){this.openHotkey&&hotkeys(this.openHotkey,(e=>{e.preventDefault(),this.visible?this.close():this.open()})),this.selectHotkey&&hotkeys(this.selectHotkey,(e=>{this.visible&&(e.preventDefault(),this._actionSelected(this._actionMatches[this._selectedIndex]))})),this.goBackHotkey&&hotkeys(this.goBackHotkey,(e=>{this.visible&&(this._search||(e.preventDefault(),this._goBack()))})),this.navigationDownHotkey&&hotkeys(this.navigationDownHotkey,(e=>{this.visible&&(e.preventDefault(),this._selectedIndex>=this._actionMatches.length-1?this._selected=this._actionMatches[0]:this._selected=this._actionMatches[this._selectedIndex+1])})),this.navigationUpHotkey&&hotkeys(this.navigationUpHotkey,(e=>{this.visible&&(e.preventDefault(),0===this._selectedIndex?this._selected=this._actionMatches[this._actionMatches.length-1]:this._selected=this._actionMatches[this._selectedIndex-1])})),this.closeHotkey&&hotkeys(this.closeHotkey,(()=>{this.visible&&this.close()}))}_unregisterInternalHotkeys(){this.openHotkey&&hotkeys.unbind(this.openHotkey),this.selectHotkey&&hotkeys.unbind(this.selectHotkey),this.goBackHotkey&&hotkeys.unbind(this.goBackHotkey),this.navigationDownHotkey&&hotkeys.unbind(this.navigationDownHotkey),this.navigationUpHotkey&&hotkeys.unbind(this.navigationUpHotkey),this.closeHotkey&&hotkeys.unbind(this.closeHotkey)}_actionFocused(e,t){this._selected=e,t.target.ensureInView()}_onTransitionEnd(){this._bump=!1}_goBack(){const e=this.breadcrumbs.length>1?this.breadcrumbs[this.breadcrumbs.length-2]:void 0;this.setParent(e)}render(){var e,t,i,s;const o={bump:this._bump,"modal-content":!0},a={visible:this.visible,modal:!0,isLoadingItems:!1};let n=this._search;null!==(e=this._ignorePrefixesSplit)&&void 0!==e||(this._ignorePrefixesSplit=""!==this.ignorePrefixes?this.ignorePrefixes.split(","):[]),null===(t=this._ignorePrefixesSplit)||void 0===t||t.some((e=>!!n.startsWith(e)&&(n=n.substring(e.length),!0))),n=n.trim();const r={},c=[];(this._currentRoot?null!==(s=null===(i=this.data.find((e=>e.id===this._currentRoot)))||void 0===i?void 0:i.children)&&void 0!==s?s:[]:this.data).forEach(((e,t)=>{var i;if("loading"===e)return void(a.isLoadingItems=!0);if("function"==typeof e){const s=this.data.find((e=>e.id===this._currentRoot));return null===(i=s.children)||void 0===i||i.splice(t,1,"loading"),a.isLoadingItems=!0,void e().then((e=>{var i;null===(i=s.children)||void 0===i||i.splice(t,1,...e),this.render()}))}const s=commandScore(e.title+" "+e.description,n);(!this._currentRoot&&n||e.parent===this._currentRoot)&&(r[e.title]=s.indices,s.score>0&&c.push({score:s.score,item:e}))}));const h=(n?c.sort(((e,t)=>e.score===t.score?e.item.title.localeCompare(t.item.title):t.score-e.score)):c).map((e=>e.item)).reduce(((e,t)=>e.set(t.section,[...e.get(t.section)||[],t])),new Map);this._actionMatches=[...h.values()].flat(),this._actionMatches.length>0&&-1===this._selectedIndex&&(this._selected=this._actionMatches[0]),0===this._actionMatches.length&&(this._selected=void 0);const d=!this._currentRoot&&0!==this.numRecentActions&&!n,l=e=>html` ${repeat(e,(e=>e.id),((e,t)=>{var i;const s=d?0===t?html`
    Recently Used
    `:this.numRecentActions===t?html`
    Other Commands
    `:"":"";return html`${s}this._actionFocused(e,t)} + @actionsSelected=${e=>this._actionSelected(e.detail)} + .action=${e} + .matchIndices=${r[e.title]} + >`}))}`,p=[];return h.forEach(((e,t)=>{const i=t?html`
    ${t}
    `:void 0;p.push(html`${i}${l(e)}`)})),html` +
    +
    + this.setParent(e.detail.parent)} + @close=${this.close} + > + + + ${footerHtml} +
    +
    + `}get _selectedIndex(){return this._selected?this._actionMatches.indexOf(this._selected):-1}_actionSelected(e){var t;if(this.dispatchEvent(new CustomEvent("selected",{detail:{search:this._search,action:e},bubbles:!0,composed:!0})),e){if(e.children&&(null===(t=e.children)||void 0===t?void 0:t.length)>0&&(this._currentRoot=e.id,this._search=""),this._headerRef.value.setSearch(""),this._headerRef.value.focusSearch(),e.handler){const t=e.handler(e);(null==t?void 0:t.keepOpen)||this.close()}this._bump=!0}}async _handleInput(e){this._search=e.detail.search,await this.updateComplete,this._selected=this._actionMatches[0],this.dispatchEvent(new CustomEvent("change",{detail:{search:this._search,actions:this._actionMatches},bubbles:!0,composed:!0}))}_overlayClick(e){var t;(null===(t=e.target)||void 0===t?void 0:t.classList.contains("modal"))&&this.close()}};NinjaKeys.styles=[baseStyles],__decorate([property({type:String})],NinjaKeys.prototype,"placeholder",void 0),__decorate([property({type:Boolean})],NinjaKeys.prototype,"disableHotkeys",void 0),__decorate([property({type:Boolean})],NinjaKeys.prototype,"hideBreadcrumbs",void 0),__decorate([property({type:String})],NinjaKeys.prototype,"ignorePrefixes",void 0),__decorate([property()],NinjaKeys.prototype,"openHotkey",void 0),__decorate([property()],NinjaKeys.prototype,"navigationUpHotkey",void 0),__decorate([property()],NinjaKeys.prototype,"navigationDownHotkey",void 0),__decorate([property()],NinjaKeys.prototype,"closeHotkey",void 0),__decorate([property()],NinjaKeys.prototype,"goBackHotkey",void 0),__decorate([property()],NinjaKeys.prototype,"selectHotkey",void 0),__decorate([property({type:Boolean})],NinjaKeys.prototype,"hotKeysJoinedView",void 0),__decorate([property({type:Boolean})],NinjaKeys.prototype,"noAutoLoadMdIcons",void 0),__decorate([property({type:Number})],NinjaKeys.prototype,"numRecentActions",void 0),__decorate([property({type:Array,hasChanged:()=>!0})],NinjaKeys.prototype,"data",void 0),__decorate([state()],NinjaKeys.prototype,"visible",void 0),__decorate([state()],NinjaKeys.prototype,"_bump",void 0),__decorate([state()],NinjaKeys.prototype,"_actionMatches",void 0),__decorate([state()],NinjaKeys.prototype,"_search",void 0),__decorate([state()],NinjaKeys.prototype,"_currentRoot",void 0),__decorate([state()],NinjaKeys.prototype,"breadcrumbs",null),__decorate([state()],NinjaKeys.prototype,"_selected",void 0),NinjaKeys=__decorate([customElement("ninja-keys")],NinjaKeys);export{NinjaKeys}; \ No newline at end of file diff --git a/assets/js/search/reactive-element/decorators/custom-element.min.js b/assets/js/search/reactive-element/decorators/custom-element.min.js new file mode 100644 index 0000000..b8e9f27 --- /dev/null +++ b/assets/js/search/reactive-element/decorators/custom-element.min.js @@ -0,0 +1,12 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. + * Original file: /npm/@lit/reactive-element@2.0.4/decorators/custom-element.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const e=e=>(t,n)=>{void 0!==n?n.addInitializer((()=>{customElements.define(e,t)})):customElements.define(e,t)};export{e as customElement};export default null; \ No newline at end of file diff --git a/assets/js/search/reactive-element/decorators/event-options.min.js b/assets/js/search/reactive-element/decorators/event-options.min.js new file mode 100644 index 0000000..efc0dbf --- /dev/null +++ b/assets/js/search/reactive-element/decorators/event-options.min.js @@ -0,0 +1,12 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. + * Original file: /npm/@lit/reactive-element@2.0.4/decorators/event-options.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +function t(t){return(n,e)=>{const o="function"==typeof n?n:n[e];Object.assign(o,t)}}export{t as eventOptions};export default null; \ No newline at end of file diff --git a/assets/js/search/reactive-element/decorators/property.min.js b/assets/js/search/reactive-element/decorators/property.min.js new file mode 100644 index 0000000..2979d6f --- /dev/null +++ b/assets/js/search/reactive-element/decorators/property.min.js @@ -0,0 +1,22 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. + * Original file: /npm/@lit/reactive-element@2.0.4/decorators/property.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +/** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),i=new WeakMap;class r{constructor(t,e,i){if(this._$cssResult$=!0,i!==s)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const s=this.t;if(e&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=i.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&i.set(s,t))}return t}toString(){return this.cssText}}const o=t=>new r("string"==typeof t?t:t+"",void 0,s),n=(s,i)=>{if(e)s.adoptedStyleSheets=i.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of i){const i=document.createElement("style"),r=t.litNonce;void 0!==r&&i.setAttribute("nonce",r),i.textContent=e.cssText,s.appendChild(i)}},a=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return o(e)})(t):t +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */;const{is:h,defineProperty:c,getOwnPropertyDescriptor:l,getOwnPropertyNames:p,getOwnPropertySymbols:d,getPrototypeOf:u}=Object,f=globalThis,y=f.trustedTypes,E=y?y.emptyScript:"",_=f.reactiveElementPolyfillSupport,m=(t,e)=>t,S={toAttribute(t,e){switch(e){case Boolean:t=t?E:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(t){s=null}}return s}},$=(t,e)=>!h(t,e),g={attribute:!0,type:String,converter:S,reflect:!1,hasChanged:$};Symbol.metadata??=Symbol("metadata"),f.litPropertyMetadata??=new WeakMap;class P extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=g){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(t,s,e);void 0!==i&&c(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:r}=l(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get(){return i?.call(this)},set(e){const o=i?.call(this);r.call(this,e),this.requestUpdate(t,o,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??g}static _$Ei(){if(this.hasOwnProperty(m("elementProperties")))return;const t=u(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(m("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(m("properties"))){const t=this.properties,e=[...p(t),...d(t)];for(const s of e)this.createProperty(s,t[s])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,s]of e)this.elementProperties.set(t,s)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const s=this._$Eu(t,e);void 0!==s&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)e.unshift(a(t))}else void 0!==t&&e.push(a(t));return e}static _$Eu(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return n(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){const s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(void 0!==i&&!0===s.reflect){const r=(void 0!==s.converter?.toAttribute?s.converter:S).toAttribute(e,s.type);this._$Em=t,null==r?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(t,e){const s=this.constructor,i=s._$Eh.get(t);if(void 0!==i&&this._$Em!==i){const t=s.getPropertyOptions(i),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:S;this._$Em=i,this[i]=r.fromAttribute(e,t.type),this._$Em=null}}requestUpdate(t,e,s){if(void 0!==t){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??$)(this[t],e))return;this.P(t,e,s)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),!0===s.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,s]of t)!0!==s.wrapped||this._$AL.has(e)||void 0===this[e]||this.P(e,this[e],s)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$EU()}catch(e){throw t=!1,this._$EU(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EC(t,this[t]))),this._$EU()}updated(t){}firstUpdated(t){}}P.elementStyles=[],P.shadowRootOptions={mode:"open"},P[m("elementProperties")]=new Map,P[m("finalized")]=new Map,_?.({ReactiveElement:P}),(f.reactiveElementVersions??=[]).push("2.0.4"); +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const b={attribute:!0,type:String,converter:S,reflect:!1,hasChanged:$},v=(t=b,e,s)=>{const{kind:i,metadata:r}=s;let o=globalThis.litPropertyMetadata.get(r);if(void 0===o&&globalThis.litPropertyMetadata.set(r,o=new Map),o.set(s.name,t),"accessor"===i){const{name:i}=s;return{set(s){const r=e.get.call(this);e.set.call(this,s),this.requestUpdate(i,r,t)},init(e){return void 0!==e&&this.P(i,void 0,t),e}}}if("setter"===i){const{name:i}=s;return function(s){const r=this[i];e.call(this,s),this.requestUpdate(i,r,t)}}throw Error("Unsupported decorator location: "+i)};function w(t){return(e,s)=>"object"==typeof s?v(t,e,s):((t,e,s)=>{const i=e.hasOwnProperty(s);return e.constructor.createProperty(s,i?{...t,wrapped:!0}:t),i?Object.getOwnPropertyDescriptor(e,s):void 0})(t,e,s)}export{w as property,v as standardProperty};export default null; \ No newline at end of file diff --git a/assets/js/search/reactive-element/decorators/query-all.min.js b/assets/js/search/reactive-element/decorators/query-all.min.js new file mode 100644 index 0000000..dc2f0b7 --- /dev/null +++ b/assets/js/search/reactive-element/decorators/query-all.min.js @@ -0,0 +1,17 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. + * Original file: /npm/@lit/reactive-element@2.0.4/decorators/query-all.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +let e;function t(t){return(r,o)=>((e,t,r)=>(r.configurable=!0,r.enumerable=!0,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,r),r))(r,o,{get(){return(this.renderRoot??(e??=document.createDocumentFragment())).querySelectorAll(t)}})}export{t as queryAll};export default null; \ No newline at end of file diff --git a/assets/js/search/reactive-element/decorators/query-assigned-elements.min.js b/assets/js/search/reactive-element/decorators/query-assigned-elements.min.js new file mode 100644 index 0000000..52a06db --- /dev/null +++ b/assets/js/search/reactive-element/decorators/query-assigned-elements.min.js @@ -0,0 +1,17 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. + * Original file: /npm/@lit/reactive-element@2.0.4/decorators/query-assigned-elements.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +/** + * @license + * Copyright 2021 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +function e(e){return(t,r)=>{const{slot:n,selector:o}=e??{},s="slot"+(n?`[name=${n}]`:":not([name])");return((e,t,r)=>(r.configurable=!0,r.enumerable=!0,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,r),r))(t,r,{get(){const t=this.renderRoot?.querySelector(s),r=t?.assignedElements(e)??[];return void 0===o?r:r.filter((e=>e.matches(o)))}})}}export{e as queryAssignedElements};export default null; \ No newline at end of file diff --git a/assets/js/search/reactive-element/decorators/query-assigned-nodes.min.js b/assets/js/search/reactive-element/decorators/query-assigned-nodes.min.js new file mode 100644 index 0000000..9a51d53 --- /dev/null +++ b/assets/js/search/reactive-element/decorators/query-assigned-nodes.min.js @@ -0,0 +1,17 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. + * Original file: /npm/@lit/reactive-element@2.0.4/decorators/query-assigned-nodes.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +function e(e){return(t,o)=>{const{slot:r}=e??{},n="slot"+(r?`[name=${r}]`:":not([name])");return((e,t,o)=>(o.configurable=!0,o.enumerable=!0,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,o),o))(t,o,{get(){const t=this.renderRoot?.querySelector(n);return t?.assignedNodes(e)??[]}})}}export{e as queryAssignedNodes};export default null; \ No newline at end of file diff --git a/assets/js/search/reactive-element/decorators/query-async.min.js b/assets/js/search/reactive-element/decorators/query-async.min.js new file mode 100644 index 0000000..bb1db85 --- /dev/null +++ b/assets/js/search/reactive-element/decorators/query-async.min.js @@ -0,0 +1,17 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. + * Original file: /npm/@lit/reactive-element@2.0.4/decorators/query-async.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +function e(e){return(t,r)=>((e,t,r)=>(r.configurable=!0,r.enumerable=!0,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,r),r))(t,r,{async get(){return await this.updateComplete,this.renderRoot?.querySelector(e)??null}})}export{e as queryAsync};export default null; \ No newline at end of file diff --git a/assets/js/search/reactive-element/decorators/query.min.js b/assets/js/search/reactive-element/decorators/query.min.js new file mode 100644 index 0000000..711e44d --- /dev/null +++ b/assets/js/search/reactive-element/decorators/query.min.js @@ -0,0 +1,17 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. + * Original file: /npm/@lit/reactive-element@2.0.4/decorators/query.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const e=(e,t,r)=>(r.configurable=!0,r.enumerable=!0,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,r),r) +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */;function t(t,r){return(n,o,l)=>{const u=e=>e.renderRoot?.querySelector(t)??null;if(r){const{get:t,set:r}="object"==typeof o?n:l??(()=>{const e=Symbol();return{get(){return this[e]},set(t){this[e]=t}}})();return e(n,o,{get(){let e=t.call(this);return void 0===e&&(e=u(this),(null!==e||this.hasUpdated)&&r.call(this,e)),e}})}return e(n,o,{get(){return u(this)}})}}export{t as query};export default null; \ No newline at end of file diff --git a/assets/js/search/reactive-element/decorators/state.min.js b/assets/js/search/reactive-element/decorators/state.min.js new file mode 100644 index 0000000..9f046cf --- /dev/null +++ b/assets/js/search/reactive-element/decorators/state.min.js @@ -0,0 +1,27 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. + * Original file: /npm/@lit/reactive-element@2.0.4/decorators/state.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +/** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),i=new WeakMap;class r{constructor(t,e,i){if(this._$cssResult$=!0,i!==s)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const s=this.t;if(e&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=i.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&i.set(s,t))}return t}toString(){return this.cssText}}const o=t=>new r("string"==typeof t?t:t+"",void 0,s),n=(s,i)=>{if(e)s.adoptedStyleSheets=i.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of i){const i=document.createElement("style"),r=t.litNonce;void 0!==r&&i.setAttribute("nonce",r),i.textContent=e.cssText,s.appendChild(i)}},a=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return o(e)})(t):t +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */;const{is:h,defineProperty:c,getOwnPropertyDescriptor:l,getOwnPropertyNames:d,getOwnPropertySymbols:p,getPrototypeOf:u}=Object,f=globalThis,y=f.trustedTypes,E=y?y.emptyScript:"",_=f.reactiveElementPolyfillSupport,m=(t,e)=>t,S={toAttribute(t,e){switch(e){case Boolean:t=t?E:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(t){s=null}}return s}},$=(t,e)=>!h(t,e),g={attribute:!0,type:String,converter:S,reflect:!1,hasChanged:$};Symbol.metadata??=Symbol("metadata"),f.litPropertyMetadata??=new WeakMap;class b extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=g){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(t,s,e);void 0!==i&&c(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:r}=l(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get(){return i?.call(this)},set(e){const o=i?.call(this);r.call(this,e),this.requestUpdate(t,o,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??g}static _$Ei(){if(this.hasOwnProperty(m("elementProperties")))return;const t=u(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(m("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(m("properties"))){const t=this.properties,e=[...d(t),...p(t)];for(const s of e)this.createProperty(s,t[s])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,s]of e)this.elementProperties.set(t,s)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const s=this._$Eu(t,e);void 0!==s&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)e.unshift(a(t))}else void 0!==t&&e.push(a(t));return e}static _$Eu(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return n(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){const s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(void 0!==i&&!0===s.reflect){const r=(void 0!==s.converter?.toAttribute?s.converter:S).toAttribute(e,s.type);this._$Em=t,null==r?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(t,e){const s=this.constructor,i=s._$Eh.get(t);if(void 0!==i&&this._$Em!==i){const t=s.getPropertyOptions(i),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:S;this._$Em=i,this[i]=r.fromAttribute(e,t.type),this._$Em=null}}requestUpdate(t,e,s){if(void 0!==t){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??$)(this[t],e))return;this.P(t,e,s)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),!0===s.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,s]of t)!0!==s.wrapped||this._$AL.has(e)||void 0===this[e]||this.P(e,this[e],s)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$EU()}catch(e){throw t=!1,this._$EU(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EC(t,this[t]))),this._$EU()}updated(t){}firstUpdated(t){}}b.elementStyles=[],b.shadowRootOptions={mode:"open"},b[m("elementProperties")]=new Map,b[m("finalized")]=new Map,_?.({ReactiveElement:b}),(f.reactiveElementVersions??=[]).push("2.0.4"); +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */const P={attribute:!0,type:String,converter:S,reflect:!1,hasChanged:$},v=(t=P,e,s)=>{const{kind:i,metadata:r}=s;let o=globalThis.litPropertyMetadata.get(r);if(void 0===o&&globalThis.litPropertyMetadata.set(r,o=new Map),o.set(s.name,t),"accessor"===i){const{name:i}=s;return{set(s){const r=e.get.call(this);e.set.call(this,s),this.requestUpdate(i,r,t)},init(e){return void 0!==e&&this.P(i,void 0,t),e}}}if("setter"===i){const{name:i}=s;return function(s){const r=this[i];e.call(this,s),this.requestUpdate(i,r,t)}}throw Error("Unsupported decorator location: "+i)};function w(t){return(e,s)=>"object"==typeof s?v(t,e,s):((t,e,s)=>{const i=e.hasOwnProperty(s);return e.constructor.createProperty(s,i?{...t,wrapped:!0}:t),i?Object.getOwnPropertyDescriptor(e,s):void 0})(t,e,s) +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */}function U(t){return w({...t,state:!0,attribute:!1})}export{U as state};export default null; \ No newline at end of file diff --git a/assets/js/search/reactive-element/reactive-element.min.js b/assets/js/search/reactive-element/reactive-element.min.js new file mode 100644 index 0000000..f17fbbe --- /dev/null +++ b/assets/js/search/reactive-element/reactive-element.min.js @@ -0,0 +1,17 @@ +/** + * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. + * Original file: /npm/@lit/reactive-element@2.0.4/reactive-element.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +/** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */ +const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),i=new WeakMap;class r{constructor(t,e,i){if(this._$cssResult$=!0,i!==s)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const s=this.t;if(e&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=i.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&i.set(s,t))}return t}toString(){return this.cssText}}const o=t=>new r("string"==typeof t?t:t+"",void 0,s),n=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,s,i)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[i+1]),t[0]);return new r(i,t,s)},a=(s,i)=>{if(e)s.adoptedStyleSheets=i.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of i){const i=document.createElement("style"),r=t.litNonce;void 0!==r&&i.setAttribute("nonce",r),i.textContent=e.cssText,s.appendChild(i)}},h=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return o(e)})(t):t +/** + * @license + * Copyright 2017 Google LLC + * SPDX-License-Identifier: BSD-3-Clause + */;const{is:c,defineProperty:l,getOwnPropertyDescriptor:p,getOwnPropertyNames:d,getOwnPropertySymbols:u,getPrototypeOf:f}=Object,y=globalThis,S=y.trustedTypes,E=S?S.emptyScript:"",$=y.reactiveElementPolyfillSupport,_=(t,e)=>t,m={toAttribute(t,e){switch(e){case Boolean:t=t?E:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(t){s=null}}return s}},g=(t,e)=>!c(t,e),b={attribute:!0,type:String,converter:m,reflect:!1,hasChanged:g};Symbol.metadata??=Symbol("metadata"),y.litPropertyMetadata??=new WeakMap;class v extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=b){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(t,s,e);void 0!==i&&l(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:r}=p(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get(){return i?.call(this)},set(e){const o=i?.call(this);r.call(this,e),this.requestUpdate(t,o,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??b}static _$Ei(){if(this.hasOwnProperty(_("elementProperties")))return;const t=f(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(_("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(_("properties"))){const t=this.properties,e=[...d(t),...u(t)];for(const s of e)this.createProperty(s,t[s])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,s]of e)this.elementProperties.set(t,s)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const s=this._$Eu(t,e);void 0!==s&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)e.unshift(h(t))}else void 0!==t&&e.push(h(t));return e}static _$Eu(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return a(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){const s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(void 0!==i&&!0===s.reflect){const r=(void 0!==s.converter?.toAttribute?s.converter:m).toAttribute(e,s.type);this._$Em=t,null==r?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(t,e){const s=this.constructor,i=s._$Eh.get(t);if(void 0!==i&&this._$Em!==i){const t=s.getPropertyOptions(i),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:m;this._$Em=i,this[i]=r.fromAttribute(e,t.type),this._$Em=null}}requestUpdate(t,e,s){if(void 0!==t){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??g)(this[t],e))return;this.P(t,e,s)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),!0===s.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,s]of t)!0!==s.wrapped||this._$AL.has(e)||void 0===this[e]||this.P(e,this[e],s)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$EU()}catch(e){throw t=!1,this._$EU(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EC(t,this[t]))),this._$EU()}updated(t){}firstUpdated(t){}}v.elementStyles=[],v.shadowRootOptions={mode:"open"},v[_("elementProperties")]=new Map,v[_("finalized")]=new Map,$?.({ReactiveElement:v}),(y.reactiveElementVersions??=[]).push("2.0.4");export{r as CSSResult,v as ReactiveElement,a as adoptStyles,n as css,m as defaultConverter,h as getCompatibleStyle,g as notEqual,e as supportsAdoptingStyleSheets,o as unsafeCSS};export default null; \ No newline at end of file diff --git a/assets/js/theme.js b/assets/js/theme.js index c7e9246..9fa1db7 100644 --- a/assets/js/theme.js +++ b/assets/js/theme.js @@ -28,6 +28,7 @@ let applyTheme = () => { transTheme(); setHighlight(theme); setGiscusTheme(theme); + setSearchTheme(theme); // if mermaid is not defined, do nothing if (typeof mermaid !== "undefined") { @@ -186,6 +187,17 @@ let setVegaLiteTheme = (theme) => { }); }; +let setSearchTheme = (theme) => { + const ninjaKeys = document.querySelector("ninja-keys"); + if (!ninjaKeys) return; + + if (theme === "dark") { + ninjaKeys.classList.add("dark"); + } else { + ninjaKeys.classList.remove("dark"); + } +}; + let transTheme = () => { document.documentElement.classList.add("transition"); window.setTimeout(() => { diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..f43bea8 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +nbconvert